WP Table Builder – WordPress Table Plugin - Version 1.2.4

Version Description

  • NEW: Option to Change Link Color in Text Element.
  • NEW: Sticky Top Menu Bar.
  • NEW: Freemius SDK.
  • FIX: Issue of Indent on List Element.
Download this release

Release Info

Developer imtiazrayhan
Plugin Icon 128x128 WP Table Builder – WordPress Table Plugin
Version 1.2.4
Comparing to
See all releases

Code changes from version 1.2.3 to 1.2.4

Files changed (38) hide show
  1. inc/admin/controls/control-alignment.php +7 -7
  2. inc/admin/css/admin.css +19 -3
  3. inc/admin/element-classes/base/element-base.php +24 -0
  4. inc/admin/element-classes/element-scripts/list-element.js +1 -1
  5. inc/admin/element-classes/elements/button-element.php +0 -24
  6. inc/admin/element-classes/elements/text-element.php +11 -0
  7. inc/admin/js/WPTB_Admin_Settings.js +32 -23
  8. inc/admin/js/WPTB_BuilderControls.js +51 -42
  9. inc/admin/js/WPTB_Import_Menu.js +49 -40
  10. inc/admin/js/core/WPTB_Helper.js +0 -1
  11. inc/admin/js/core/rollup-source/containers/IconSelectControl.vue +2 -2
  12. inc/core/freemius/LICENSE.txt +674 -0
  13. inc/core/freemius/README.md +253 -0
  14. inc/core/freemius/assets/css/admin/account.css +1 -0
  15. inc/core/freemius/assets/css/admin/add-ons.css +2 -0
  16. inc/core/freemius/assets/css/admin/affiliation.css +1 -0
  17. inc/core/freemius/assets/css/admin/checkout.css +1 -0
  18. inc/core/freemius/assets/css/admin/common.css +2 -0
  19. inc/core/freemius/assets/css/admin/connect.css +1 -0
  20. inc/core/freemius/assets/css/admin/debug.css +1 -0
  21. inc/core/freemius/assets/css/admin/dialog-boxes.css +2 -0
  22. inc/core/freemius/assets/css/admin/gdpr-optin-notice.css +1 -0
  23. inc/core/freemius/assets/css/admin/index.php +3 -0
  24. inc/core/freemius/assets/css/admin/plugins.css +1 -0
  25. inc/core/freemius/assets/css/customizer.css +1 -0
  26. inc/core/freemius/assets/css/index.php +3 -0
  27. inc/core/freemius/assets/img/index.php +3 -0
  28. inc/core/freemius/assets/img/plugin-icon.png +0 -0
  29. inc/core/freemius/assets/img/theme-icon.png +0 -0
  30. inc/core/freemius/assets/img/wp-table-builder.png +0 -0
  31. inc/core/freemius/assets/index.php +3 -0
  32. inc/core/freemius/assets/js/index.php +3 -0
  33. inc/core/freemius/assets/js/nojquery.ba-postmessage.js +140 -0
  34. inc/core/freemius/assets/js/nojquery.ba-postmessage.min.js +12 -0
  35. inc/core/freemius/assets/js/postmessage.js +135 -0
  36. inc/core/freemius/config.php +388 -0
  37. inc/core/freemius/includes/class-freemius-abstract.php +597 -0
  38. inc/core/freemius/includes/class-freemius.php +11589 -0
inc/admin/controls/control-alignment.php CHANGED
@@ -71,11 +71,11 @@ class Control_Alignment extends Base_Control {
71
 
72
  if( 'selected' in data ) {
73
  if( data.selected == 0 ) {
74
- selected0 = 'selected';
75
  } else if( data.selected == 1 ) {
76
- selected1 = 'selected';
77
  } else if( data.selected == 2 ) {
78
- selected2 = 'selected';
79
  }
80
  }
81
 
@@ -229,18 +229,18 @@ class Control_Alignment extends Base_Control {
229
  }
230
 
231
  for ( var i = 0; i < buttons.length; i++ ) {
232
- buttons[i].classList.remove( 'selected' );
233
 
234
  if( valueSetting == buttons[i].dataset.alignmentValue ) {
235
- buttons[i].classList.add( 'selected' );
236
  }
237
 
238
  buttons[i].onclick = function () {
239
  var b = this.parentNode.getElementsByClassName( 'wptb-btn-size-btn' );
240
  for ( let i = 0; i < b.length; i++ ) {
241
- b[i].classList.remove( 'selected' );
242
  }
243
- this.classList.add( 'selected' );
244
 
245
  if( this.dataset.alignmentValue && '{{{selectorsJson}}}' ) {
246
  let selectors = JSON.parse( '{{{selectorsJson}}}' );
71
 
72
  if( 'selected' in data ) {
73
  if( data.selected == 0 ) {
74
+ selected0 = 'bnt-selected';
75
  } else if( data.selected == 1 ) {
76
+ selected1 = 'bnt-selected';
77
  } else if( data.selected == 2 ) {
78
+ selected2 = 'bnt-selected';
79
  }
80
  }
81
 
229
  }
230
 
231
  for ( var i = 0; i < buttons.length; i++ ) {
232
+ buttons[i].classList.remove( 'bnt-selected' );
233
 
234
  if( valueSetting == buttons[i].dataset.alignmentValue ) {
235
+ buttons[i].classList.add( 'bnt-selected' );
236
  }
237
 
238
  buttons[i].onclick = function () {
239
  var b = this.parentNode.getElementsByClassName( 'wptb-btn-size-btn' );
240
  for ( let i = 0; i < b.length; i++ ) {
241
+ b[i].classList.remove( 'bnt-selected' );
242
  }
243
+ this.classList.add( 'bnt-selected' );
244
 
245
  if( this.dataset.alignmentValue && '{{{selectorsJson}}}' ) {
246
  let selectors = JSON.parse( '{{{selectorsJson}}}' );
inc/admin/css/admin.css CHANGED
@@ -70,6 +70,12 @@ body > img {
70
  * Header Section
71
  */
72
 
 
 
 
 
 
 
73
  .wptb-header {
74
  width: 100%;
75
  background-color: var(--wptb-plugin-theme-color-light);
@@ -1803,7 +1809,7 @@ table.wptb-table {
1803
  min-height: 55px;
1804
  text-align: center;
1805
  position: sticky !important;
1806
- top: 20px;
1807
  z-index: 100;
1808
  display: inline-block;
1809
  }
@@ -1852,7 +1858,7 @@ table.wptb-table {
1852
  box-shadow: inset 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
1853
  }
1854
 
1855
- .wptb-btn-size-switcher.selected {
1856
  background: #fff;
1857
  box-shadow: inset 0px 0px 20px 4px rgba(0, 0, 0, 0.15);
1858
  cursor: default;
@@ -1900,6 +1906,10 @@ br[data-mce-bogus="1"] {
1900
  display: none;
1901
  }
1902
 
 
 
 
 
1903
  .wptb-droppable.wptb-cell ul,
1904
  .wptb-droppable.wptb-cell ol {
1905
  border: 1px solid transparent;
@@ -1935,6 +1945,7 @@ br[data-mce-bogus="1"] {
1935
  word-wrap: break-word;
1936
  line-height: 30px;
1937
  font-size: 15px;
 
1938
  }
1939
 
1940
  .wptb-list-container ul li > div > p::before {
@@ -1945,10 +1956,15 @@ br[data-mce-bogus="1"] {
1945
  /* font-size: 15px; */
1946
  font-family: verdana, sans-serif;
1947
  cursor: text;
 
 
 
 
 
1948
  }
1949
 
1950
  .wptb-list-container ul li > div > p::before {
1951
- padding-right: 10px;
1952
  }
1953
 
1954
  .wptb-list-container ul li > div > p.wptb-list-style-type-disc::before {
70
  * Header Section
71
  */
72
 
73
+ .wptb-builder-header {
74
+ position: sticky !important;
75
+ top: 0px;
76
+ z-index: 10;
77
+ }
78
+
79
  .wptb-header {
80
  width: 100%;
81
  background-color: var(--wptb-plugin-theme-color-light);
1809
  min-height: 55px;
1810
  text-align: center;
1811
  position: sticky !important;
1812
+ top: 80px;
1813
  z-index: 100;
1814
  display: inline-block;
1815
  }
1858
  box-shadow: inset 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
1859
  }
1860
 
1861
+ .wptb-btn-size-switcher.bnt-selected {
1862
  background: #fff;
1863
  box-shadow: inset 0px 0px 20px 4px rgba(0, 0, 0, 0.15);
1864
  cursor: default;
1906
  display: none;
1907
  }
1908
 
1909
+ .wptb-text-container .mce-content-body a {
1910
+ color: rgb(30, 115, 190);
1911
+ }
1912
+
1913
  .wptb-droppable.wptb-cell ul,
1914
  .wptb-droppable.wptb-cell ol {
1915
  border: 1px solid transparent;
1945
  word-wrap: break-word;
1946
  line-height: 30px;
1947
  font-size: 15px;
1948
+ padding-left: 20px;
1949
  }
1950
 
1951
  .wptb-list-container ul li > div > p::before {
1956
  /* font-size: 15px; */
1957
  font-family: verdana, sans-serif;
1958
  cursor: text;
1959
+ min-width: fit-content;
1960
+ }
1961
+
1962
+ .wptb-droppable.wptb-cell li .wptb-list-item-content p span.content {
1963
+ display: block;
1964
  }
1965
 
1966
  .wptb-list-container ul li > div > p::before {
1967
+ margin-left: -20px;
1968
  }
1969
 
1970
  .wptb-list-container ul li > div > p.wptb-list-style-type-disc::before {
inc/admin/element-classes/base/element-base.php CHANGED
@@ -59,6 +59,30 @@ abstract class Element_Base extends Element_Base_Object {
59
  protected function _content_template() {
60
  }
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  /**
63
  * Output element template and script.
64
  *
59
  protected function _content_template() {
60
  }
61
 
62
+ protected function readIcons( $extension, $icon_dir, $icon_url ) {
63
+ $creds = request_filesystem_credentials( site_url() . '/wp-admin/', '', true, null );
64
+ if ( ! WP_Filesystem( $creds ) ) {
65
+ return;
66
+ }
67
+
68
+ global $wp_filesystem;
69
+
70
+ $filtered_files = [];
71
+ if ( $wp_filesystem->is_dir( $icon_dir ) ) {
72
+ $icons = $wp_filesystem->dirlist( $icon_dir );
73
+ foreach ( $icons as $name => $info ) {
74
+ $current_file_path = path_join( $icon_dir, $name );
75
+ $file_info = pathinfo( $current_file_path );
76
+ if ( $file_info['extension'] === $extension ) {
77
+ $current_file_url = join( '', [ trailingslashit( $icon_url ), $name ] );
78
+ $filtered_files[ $file_info['filename'] ] = $current_file_url;
79
+ }
80
+ }
81
+ }
82
+
83
+ return $filtered_files;
84
+ }
85
+
86
  /**
87
  * Output element template and script.
88
  *
inc/admin/element-classes/element-scripts/list-element.js CHANGED
@@ -58,7 +58,7 @@ function listItemsTinyMceInit( listItem ) {
58
  }
59
 
60
  applyGenericItemSettings( duplicate );
61
- e.target.querySelector( 'p' ).innerText = 'New List Item';
62
  article.parentNode.insertBefore( elementCopy, article );
63
  elementCopy.classList.remove( 'wptb-directlyhovered' );
64
  article.classList.remove( 'wptb-directlyhovered' );
58
  }
59
 
60
  applyGenericItemSettings( duplicate );
61
+ e.target.querySelector( 'p' ).innerHTML = '<span class="content">New List Item</span>';
62
  article.parentNode.insertBefore( elementCopy, article );
63
  elementCopy.classList.remove( 'wptb-directlyhovered' );
64
  article.classList.remove( 'wptb-directlyhovered' );
inc/admin/element-classes/elements/button-element.php CHANGED
@@ -261,30 +261,6 @@ class Button_Element extends Element_Base {
261
  ] );
262
  }
263
 
264
- protected function readIcons( $extension, $icon_dir, $icon_url ) {
265
- $creds = request_filesystem_credentials( site_url() . '/wp-admin/', '', true, null );
266
- if ( ! WP_Filesystem( $creds ) ) {
267
- return;
268
- }
269
-
270
- global $wp_filesystem;
271
-
272
- $filtered_files = [];
273
- if ( $wp_filesystem->is_dir( $icon_dir ) ) {
274
- $icons = $wp_filesystem->dirlist( $icon_dir );
275
- foreach ( $icons as $name => $info ) {
276
- $current_file_path = path_join( $icon_dir, $name );
277
- $file_info = pathinfo( $current_file_path );
278
- if ( $file_info['extension'] === $extension ) {
279
- $current_file_url = join( '', [ trailingslashit( $icon_url ), $name ] );
280
- $filtered_files[ $file_info['filename'] ] = $current_file_url;
281
- }
282
- }
283
- }
284
-
285
- return $filtered_files;
286
- }
287
-
288
  /**
289
  * Render text editor element output in the editor.
290
  *
261
  ] );
262
  }
263
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
264
  /**
265
  * Render text editor element output in the editor.
266
  *
inc/admin/element-classes/elements/text-element.php CHANGED
@@ -107,6 +107,17 @@ class Text_Element extends Element_Base {
107
  ]
108
  ]
109
  );
 
 
 
 
 
 
 
 
 
 
 
110
 
111
  $this->add_control(
112
  'size',
107
  ]
108
  ]
109
  );
110
+
111
+ $this->add_control(
112
+ 'linkColor',
113
+ [
114
+ 'label' => __( 'Link Font Color', 'wp_table_builder' ),
115
+ 'type' => Controls_Manager::COLOR,
116
+ 'selectors' => [
117
+ '{{{data.container}}} a' => 'color',
118
+ ]
119
+ ]
120
+ );
121
 
122
  $this->add_control(
123
  'size',
inc/admin/js/WPTB_Admin_Settings.js CHANGED
@@ -5,41 +5,50 @@ var e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),export
5
  "use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function t(t){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{};o%2?e(Object(n),!0).forEach(function(e){r(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var o=t({},wptbAdminSettingsData.options),n=t({},wptbAdminSettingsData.options),c={data:function(){return{store:o,rawStore:n}},methods:{revertStore:function(){var e=this;Object.keys(this.store).map(function(t){Object.prototype.hasOwnProperty.call(e.store,t)&&(e.store[t]=e.rawStore[t])})}}},i=c;exports.default=i;
6
  },{}],"wm3G":[function(require,module,exports) {
7
  "use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,s)}return r}function t(t){for(var s=1;s<arguments.length;s++){var a=null!=arguments[s]?arguments[s]:{};s%2?e(Object(a),!0).forEach(function(e){r(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var s={withMessageData:{busy:!1,show:!1,message:"",type:"ok",intervalId:-1,intervalTime:5e3}},a=t({},s.withMessageData),i={data:function(){return s},methods:{isBusy:function(){return this.withMessageData.busy},setMessage:function(e){var r=this,s=t({},a,{},e);this.withMessageData.message=s.message,this.withMessageData.type=s.type,this.withMessageData.show=!0,clearInterval(this.withMessageData.intervalId),this.withMessageData.intervalId=setInterval(function(){r.withMessageData.show=!1},s.intervalTime)},setBusy:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.withMessageData.busy=e}}},n=i;exports.default=n;
 
 
8
  },{}],"vi91":[function(require,module,exports) {
9
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:["logoSrc","logoAlt","pluginName"]};exports.default=e;
10
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"wptb-settings-header"},[e("div",{staticClass:"wptb-settings-brand"},[e("img",{attrs:{src:t.logoSrc,alt:t.logoAlt}}),t._v(" "),e("span",{staticClass:"wptb-settings-header-name"},[t._v(" "+t._s(t.pluginName)+" ")])]),t._v(" "),e("div",{staticClass:"wptb-settings-links"},[t._t("default")],2)])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
11
- },{}],"bosS":[function(require,module,exports) {
12
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={props:["name","current"],methods:{activePosition:function(){void 0!==this.current&&this.current!==this.name||this.$emit("activeSectionElement",this.$refs.sectionItem)}},computed:{isActive:function(){return this.activePosition(),void 0===this.current||this.current===this.name}}};exports.default=t;
13
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{ref:"sectionItem",staticClass:"wptb-settings-section-item",class:{disabled:!e.isActive},on:{click:function(t){return e.$emit("sectionchange",e.name,t.target)}}},[e._v(" "+e._s(e.name)+"\n")])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
14
- },{}],"jLHe":[function(require,module,exports) {
15
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={props:["activeItem","relativeParent"],methods:{toPx:function(t){return"".concat(t,"px")}},computed:{styleCalculations:function(){if(this.activeItem){var t=this.activeItem.getBoundingClientRect(),e=this.relativeParent.getBoundingClientRect(),i=Math.abs(t.left-e.left);return{width:this.toPx(t.width),height:"2px",bottom:0,left:this.toPx(i)}}return{}}}};exports.default=t;
16
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"wptb-menu-active-section-indicator",style:this.styleCalculations})},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
17
- },{}],"yPIx":[function(require,module,exports) {
18
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("./SectionItem")),t=n(require("./ActiveSectionIndicator"));function n(e){return e&&e.__esModule?e:{default:e}}var i={model:{prop:"currentSection",event:"updateSection"},props:{child:{type:Boolean,default:!1},items:Array,currentSection:String},components:{SectionItem:e.default,ActiveSectionIndicator:t.default},data:function(){return{innerCurrentSection:"",activeSectionElement:null}},mounted:function(){this.innerCurrentSection=this.currentSection||this.items[0]},watch:{innerCurrentSection:function(e){this.$emit("updateSection",e)}},methods:{handleSectionChange:function(e){this.innerCurrentSection=e},handleActiveSectionElement:function(e){this.activeSectionElement=e}}};exports.default=i;
19
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{ref:"wrapper",staticClass:"wptb-settings-sections-wrapper",class:{child:e.child}},[e._l(e.items,function(t){return n("section-item",{key:t,attrs:{name:t,current:e.innerCurrentSection},on:{sectionchange:e.handleSectionChange,activeSectionElement:e.handleActiveSectionElement}})}),e._v(" "),n("active-section-indicator",{attrs:{"relative-parent":e.$refs.wrapper,"active-item":e.activeSectionElement}})],2),e._v(" "),e._t("default")],2)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
20
- },{"./SectionItem":"bosS","./ActiveSectionIndicator":"jLHe"}],"vTRD":[function(require,module,exports) {
21
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:{center:{type:Boolean,default:!1}}};exports.default=e;
22
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"wptb-settings-controls-wrapper",class:[this.center?"center":"grid"]},[e("transition",{attrs:{name:"wptb-fade",mode:"out-in"}},[this._t("default")],2)],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
23
- },{}],"Bhde":[function(require,module,exports) {
24
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:["title"]};exports.default=e;
25
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"wptb-setting-control"},[this.title?s("div",{staticClass:"title"},[this._v(this._s(this.title))]):this._e(),this._v(" "),this._t("default")],2)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
26
- },{}],"yXWm":[function(require,module,exports) {
27
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:["fieldData","modelBind"],methods:{isType:function(e){return this.fieldData.type===e}}};exports.default=e;
28
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,i=e.$createElement,d=e._self._c||i;return d("div",[e.isType("multiCheckbox")?d("div",e._l(e.fieldData.options,function(i,a){return d("div",{key:i,staticClass:"wptb-setting-control-row"},[d("input",{directives:[{name:"model",rawName:"v-model",value:e.modelBind[e.fieldData.id],expression:"modelBind[fieldData.id]"}],attrs:{id:e.fieldData.id,type:"checkbox"},domProps:{value:a,checked:Array.isArray(e.modelBind[e.fieldData.id])?e._i(e.modelBind[e.fieldData.id],a)>-1:e.modelBind[e.fieldData.id]},on:{change:function(i){var d=e.modelBind[e.fieldData.id],t=i.target,l=!!t.checked;if(Array.isArray(d)){var o=a,n=e._i(d,o);t.checked?n<0&&e.$set(e.modelBind,e.fieldData.id,d.concat([o])):n>-1&&e.$set(e.modelBind,e.fieldData.id,d.slice(0,n).concat(d.slice(n+1)))}else e.$set(e.modelBind,e.fieldData.id,l)}}}),e._v(" "),d("label",{attrs:{for:e.fieldData.id}},[e._v(e._s(i))])])}),0):e.isType("checkbox")?d("div",[d("div",{staticClass:"wptb-setting-control-row"},[d("input",{directives:[{name:"model",rawName:"v-model",value:e.modelBind[e.fieldData.id],expression:"modelBind[fieldData.id]"}],attrs:{id:e.fieldData.id,type:"checkbox"},domProps:{checked:Array.isArray(e.modelBind[e.fieldData.id])?e._i(e.modelBind[e.fieldData.id],null)>-1:e.modelBind[e.fieldData.id]},on:{change:function(i){var d=e.modelBind[e.fieldData.id],a=i.target,t=!!a.checked;if(Array.isArray(d)){var l=e._i(d,null);a.checked?l<0&&e.$set(e.modelBind,e.fieldData.id,d.concat([null])):l>-1&&e.$set(e.modelBind,e.fieldData.id,d.slice(0,l).concat(d.slice(l+1)))}else e.$set(e.modelBind,e.fieldData.id,t)}}}),e._v(" "),d("label",{attrs:{for:e.fieldData.id}},[e._v(e._s(e.fieldData.label))])])]):e.isType("dropdown")?d("div",[d("div",{staticClass:"wptb-setting-control-row"},[d("select",{directives:[{name:"model",rawName:"v-model",value:e.modelBind[e.fieldData.id],expression:"modelBind[fieldData.id]"}],attrs:{id:e.fieldData.id},on:{change:function(i){var d=Array.prototype.filter.call(i.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.$set(e.modelBind,e.fieldData.id,i.target.multiple?d:d[0])}}},e._l(e.fieldData.options,function(i){return d("option",{key:i.label,domProps:{value:i.value}},[e._v(" "+e._s(i.label)+" ")])}),0),e._v(" "),d("label",{attrs:{for:e.fieldData.id}},[e._v(e._s(e.fieldData.label))]),e._v(" "),e._t("default")],2)]):e._e()])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
29
- },{}],"P9T4":[function(require,module,exports) {
30
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("../mixins/withMessage"));function t(e){return e&&e.__esModule?e:{default:e}}var r={mixins:[e.default]};exports.default=r;
31
- (function(){var s=exports.default||module.exports;"function"==typeof s&&(s=s.options),Object.assign(s,{render:function(){var s=this,t=s.$createElement,e=s._self._c||t;return e("div",{staticClass:"wptb-settings-messages"},[s.withMessageData.busy?e("span",{staticClass:"dashicons dashicons-image-rotate wptb-settings-fetching"}):s._e(),s._v(" "),e("transition",{attrs:{name:"wptb-fade"}},[s.withMessageData.show?e("span",{staticClass:"wptb-settings-message",class:[s.withMessageData.type]},[s._v(s._s(s.withMessageData.message))]):s._e()])],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
32
- },{"../mixins/withMessage":"wm3G"}],"ksMR":[function(require,module,exports) {
33
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:{disabled:Boolean,type:{type:String,default:"primary"},size:{type:String,default:"normal"}},methods:{handleClick:function(){this.disabled||this.$emit("click")}}};exports.default=e;
34
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"wptb-settings-button",class:[{disabled:this.disabled},this.type,this.size],on:{click:this.handleClick}},[this._t("default")],2)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
35
- },{}],"nwtb":[function(require,module,exports) {
 
 
 
 
36
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./MessageDisplay.vue")),s=t(require("./MenuButton"));function t(e){return e&&e.__esModule?e:{default:e}}var u={props:["messageType","messageShow","messageBody","messageBusy"],components:{MessageDisplay:e.default,MenuButton:s.default}};exports.default=u;
37
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"wptb-settings-footer"},[s("message-display",{attrs:{busy:e.messageBusy,message:e.messageBody,show:e.messageShow,type:e.messageType}}),e._v(" "),s("div",{staticClass:"wptb-settings-button-container"},[s("menu-button",{staticStyle:{visibility:"hidden"}},[e._v("dummy")]),e._v(" "),e._t("default")],2)],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
38
- },{"./MessageDisplay.vue":"P9T4","./MenuButton":"ksMR"}],"pZ9N":[function(require,module,exports) {
39
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=c(require("../mixins/withStore.js")),t=c(require("../mixins/withMessage")),r=c(require("../components/MenuHeader.vue")),n=c(require("../components/Sections.vue")),i=c(require("../components/MenuContent.vue")),o=c(require("../components/SettingCard.vue")),s=c(require("../components/ControlItem.vue")),u=c(require("../components/MenuFooter.vue")),a=c(require("../components/MenuButton.vue"));function c(e){return e&&e.__esModule?e:{default:e}}function f(e,t){return m(e)||h(e,t)||p(e,t)||l()}function l(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(e,t){if(e){if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function h(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var s,u=e[Symbol.iterator]();!(n=(s=u.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(a){i=!0,o=a}finally{try{n||null==u.return||u.return()}finally{if(i)throw o}}return r}}function m(e){if(Array.isArray(e))return e}function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach(function(t){g(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var v={props:["fieldsData","settings","pluginInfo"],components:{MenuButton:a.default,MenuHeader:r.default,Sections:n.default,MenuContent:i.default,SettingCard:o.default,ControlItem:s.default,MenuFooter:u.default},mixins:[e.default,t.default],data:function(){return{sections:[],currentSection:"",parsedFields:{},resetActive:!1,canSubmit:!1,fetching:!1}},watch:{store:{handler:function(){this.resetActive?(this.canSubmit=!1,this.resetActive=!1):this.canSubmit=!0},deep:!0},fetching:function(e){this.setBusy(e)}},beforeMount:function(){var e=this;Object.keys(this.fieldsData).map(function(t){if(Object.prototype.hasOwnProperty.call(e.fieldsData,t)){var r=e.fieldsData[t].section;void 0===e.parsedFields[r]&&(e.parsedFields[r]=[]),e.parsedFields[r].push(y({},e.fieldsData[t],{id:t})),e.sections.push(r)}return null});var t=f(Object.keys(this.parsedFields).map(function(t){if(Object.prototype.hasOwnProperty.call(e.parsedFields,t))return t}),1);this.currentSection=t[0],this.sections=Array.from(new Set(this.sections))},computed:{currentFields:function(){return this.parsedFields[this.currentSection]}},methods:{resetStore:function(){this.canSubmit&&(this.revertStore(),this.resetActive=!0,this.setMessage({message:this.strings.revertMessage}))},submitSettings:function(){var e=this;if(this.canSubmit){var t=new FormData;t.append("nonce",this.settings.nonce),t.append("action",this.settings.action),t.append("options",JSON.stringify(this.store)),this.canSubmit=!1,this.fetching=!0,fetch(this.settings.ajaxUrl,{method:"POST",body:t}).then(function(e){if(e.ok)return e.json()}).then(function(t){if(t.error)throw new Error(t.error);e.setMessage({message:t.message})}).catch(function(t){console.error(t),e.setMessage({type:"error",message:t})}).finally(function(){e.fetching=!1})}}}};exports.default=v;
40
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"wptb-settings-wrapper"},[n("menu-header",{attrs:{"logo-src":t.pluginInfo.logo,"logo-alt":t.strings.logoAlt,"plugin-name":t.pluginInfo.pluginName}},[n("a",{attrs:{href:t.pluginInfo.pluginHomepage}},[t._v(t._s(t.strings.homepage))])]),t._v(" "),n("sections",{attrs:{items:t.sections},model:{value:t.currentSection,callback:function(e){t.currentSection=e},expression:"currentSection"}}),t._v(" "),n("menu-content",t._l(t.currentFields,function(e){return n("setting-card",{key:e.id,attrs:{title:e.label}},[n("control-item",{attrs:{"field-data":e,modelBind:t.store}})],1)}),1),t._v(" "),n("menu-footer",[n("menu-button",{attrs:{type:"danger",disabled:!t.canSubmit},on:{click:t.resetStore}},[t._v(t._s(t.strings.revert))]),t._v(" "),n("menu-button",{attrs:{type:"primary",disabled:!t.canSubmit},on:{click:t.submitSettings}},[t._v(t._s(t.strings.submit))])],1)],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
41
- },{"../mixins/withStore.js":"D1kn","../mixins/withMessage":"wm3G","../components/MenuHeader.vue":"vi91","../components/Sections.vue":"yPIx","../components/MenuContent.vue":"vTRD","../components/SettingCard.vue":"Bhde","../components/ControlItem.vue":"yXWm","../components/MenuFooter.vue":"nwtb","../components/MenuButton.vue":"ksMR"}],"yEip":[function(require,module,exports) {
42
  "use strict";function t(t,e){t.mixin({data:function(){return{strings:e.strings}}})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={install:t};exports.default=e;
43
  },{}],"uD0a":[function(require,module,exports) {
44
  "use strict";var e=n(require("vue")),t=n(require("./containers/SettingsApp.vue")),r=n(require("./plugins/strings.js"));function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){u(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=o({},wptbAdminSettingsData);wptbAdminSettingsData=void 0,e.default.config.productionTip=!1,e.default.use(r.default,{strings:a.strings}),new e.default({components:{SettingsApp:t.default},data:{fieldsData:a.fields,settings:a.data,pluginInfo:a.pluginInfo}}).$mount(a.data.mountId);
45
- },{"vue":"HYXJ","./containers/SettingsApp.vue":"pZ9N","./plugins/strings.js":"yEip"}]},{},["uD0a"], null)
 
 
 
5
  "use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function t(t){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{};o%2?e(Object(n),!0).forEach(function(e){r(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var o=t({},wptbAdminSettingsData.options),n=t({},wptbAdminSettingsData.options),c={data:function(){return{store:o,rawStore:n}},methods:{revertStore:function(){var e=this;Object.keys(this.store).map(function(t){Object.prototype.hasOwnProperty.call(e.store,t)&&(e.store[t]=e.rawStore[t])})}}},i=c;exports.default=i;
6
  },{}],"wm3G":[function(require,module,exports) {
7
  "use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,s)}return r}function t(t){for(var s=1;s<arguments.length;s++){var a=null!=arguments[s]?arguments[s]:{};s%2?e(Object(a),!0).forEach(function(e){r(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var s={withMessageData:{busy:!1,show:!1,message:"",type:"ok",intervalId:-1,intervalTime:5e3}},a=t({},s.withMessageData),i={data:function(){return s},methods:{isBusy:function(){return this.withMessageData.busy},setMessage:function(e){var r=this,s=t({},a,{},e);this.withMessageData.message=s.message,this.withMessageData.type=s.type,this.withMessageData.show=!0,clearInterval(this.withMessageData.intervalId),this.withMessageData.intervalId=setInterval(function(){r.withMessageData.show=!1},s.intervalTime)},setBusy:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.withMessageData.busy=e}}},n=i;exports.default=n;
8
+ },{}],"aJOh":[function(require,module,exports) {
9
+ var e,n,o=Object.create(null);"undefined"!=typeof window&&(window.__VUE_HOT_MAP__=o);var t=!1,r=!1,i="beforeCreate";function s(e,n){if(n.functional){var t=n.render;n.render=function(n,r){var i=o[e].instances;return r&&i.indexOf(r.parent)<0&&i.push(r.parent),t(n,r)}}else c(n,i,function(){var n=o[e];n.Ctor||(n.Ctor=this.constructor),n.instances.push(this)}),c(n,"beforeDestroy",function(){var n=o[e].instances;n.splice(n.indexOf(this),1)})}function c(e,n,o){var t=e[n];e[n]=t?Array.isArray(t)?t.concat(o):[t,o]:[o]}function a(e){return function(n,o){try{e(n,o)}catch(t){console.error(t),console.warn("Something went wrong during Vue component hot-reload. Full reload required.")}}}function f(e,n){for(var o in e)o in n||delete e[o];for(var t in n)e[t]=n[t]}function u(e){if(e._u){var n=e._u;return e._u=function(e){try{return n(e,!0)}catch(o){return n(e,null,!0)}},function(){e._u=n}}}exports.install=function(o,s){t||(t=!0,e=o.__esModule?o.default:o,n=e.version.split(".").map(Number),r=s,e.config._lifecycleHooks.indexOf("init")>-1&&(i="init"),exports.compatible=n[0]>=2,exports.compatible||console.warn("[HMR] You are using a version of vue-hot-reload-api that is only compatible with Vue.js core ^2.0.0."))},exports.createRecord=function(e,n){if(!o[e]){var t=null;"function"==typeof n&&(n=(t=n).options),s(e,n),o[e]={Ctor:t,options:n,instances:[]}}},exports.isRecorded=function(e){return void 0!==o[e]},exports.rerender=a(function(e,n){var t=o[e];if(n){if("function"==typeof n&&(n=n.options),t.Ctor)t.Ctor.options.render=n.render,t.Ctor.options.staticRenderFns=n.staticRenderFns,t.instances.slice().forEach(function(e){e.$options.render=n.render,e.$options.staticRenderFns=n.staticRenderFns,e._staticTrees&&(e._staticTrees=[]),Array.isArray(t.Ctor.options.cached)&&(t.Ctor.options.cached=[]),Array.isArray(e.$options.cached)&&(e.$options.cached=[]);var o=u(e);e.$forceUpdate(),e.$nextTick(o)});else if(t.options.render=n.render,t.options.staticRenderFns=n.staticRenderFns,t.options.functional){if(Object.keys(n).length>2)f(t.options,n);else{var r=t.options._injectStyles;if(r){var i=n.render;t.options.render=function(e,n){return r.call(n),i(e,n)}}}t.options._Ctor=null,Array.isArray(t.options.cached)&&(t.options.cached=[]),t.instances.slice().forEach(function(e){e.$forceUpdate()})}}else t.instances.slice().forEach(function(e){e.$forceUpdate()})}),exports.reload=a(function(e,t){var r=o[e];if(t)if("function"==typeof t&&(t=t.options),s(e,t),r.Ctor){n[1]<2&&(r.Ctor.extendOptions=t);var i=r.Ctor.super.extend(t);i.options._Ctor=r.options._Ctor,r.Ctor.options=i.options,r.Ctor.cid=i.cid,r.Ctor.prototype=i.prototype,i.release&&i.release()}else f(r.options,t);r.instances.slice().forEach(function(e){e.$vnode&&e.$vnode.context?e.$vnode.context.$forceUpdate():console.warn("Root or manually mounted instance modified. Full reload required.")})});
10
  },{}],"vi91":[function(require,module,exports) {
11
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:["logoSrc","logoAlt","pluginName"]};exports.default=e;
12
+ (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"wptb-settings-header"},[a("div",{staticClass:"wptb-settings-brand"},[a("img",{attrs:{src:t.logoSrc,alt:t.logoAlt}}),t._v(" "),a("span",{staticClass:"wptb-settings-header-name"},[t._v(" "+t._s(t.pluginName)+" ")])]),t._v(" "),a("div",{staticClass:"wptb-settings-links"},[t._t("default")],2)])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var e=require("vue-hot-reload-api");e.install(require("vue")),e.compatible&&(module.hot.accept(),module.hot.data?e.reload("$b57d2a",t):e.createRecord("$b57d2a",t))}}();})();
13
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"bosS":[function(require,module,exports) {
14
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={props:["name","current"],methods:{activePosition:function(){void 0!==this.current&&this.current!==this.name||this.$emit("activeSectionElement",this.$refs.sectionItem)}},computed:{isActive:function(){return this.activePosition(),void 0===this.current||this.current===this.name}}};exports.default=t;
15
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{ref:"sectionItem",staticClass:"wptb-settings-section-item",class:{disabled:!e.isActive},on:{click:function(t){return e.$emit("sectionchange",e.name,t.target)}}},[e._v(" "+e._s(e.name)+"\n")])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$354c7f",e):t.createRecord("$354c7f",e))}}();})();
16
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"jLHe":[function(require,module,exports) {
17
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={props:["activeItem","relativeParent"],methods:{toPx:function(t){return"".concat(t,"px")}},computed:{styleCalculations:function(){if(this.activeItem){var t=this.activeItem.getBoundingClientRect(),e=this.relativeParent.getBoundingClientRect(),i=Math.abs(t.left-e.left);return{width:this.toPx(t.width),height:"2px",bottom:0,left:this.toPx(i)}}return{}}}};exports.default=t;
18
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"wptb-menu-active-section-indicator",style:this.styleCalculations})},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$d41ec1",e):t.createRecord("$d41ec1",e))}}();})();
19
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"yPIx":[function(require,module,exports) {
20
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("./SectionItem")),t=n(require("./ActiveSectionIndicator"));function n(e){return e&&e.__esModule?e:{default:e}}var i={model:{prop:"currentSection",event:"updateSection"},props:{child:{type:Boolean,default:!1},items:Array,currentSection:String},components:{SectionItem:e.default,ActiveSectionIndicator:t.default},data:function(){return{innerCurrentSection:"",activeSectionElement:null}},mounted:function(){this.innerCurrentSection=this.currentSection||this.items[0]},watch:{innerCurrentSection:function(e){this.$emit("updateSection",e)}},methods:{handleSectionChange:function(e){this.innerCurrentSection=e},handleActiveSectionElement:function(e){this.activeSectionElement=e}}};exports.default=i;
21
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{ref:"wrapper",staticClass:"wptb-settings-sections-wrapper",class:{child:e.child}},[e._l(e.items,function(t){return n("section-item",{key:t,attrs:{name:t,current:e.innerCurrentSection},on:{sectionchange:e.handleSectionChange,activeSectionElement:e.handleActiveSectionElement}})}),e._v(" "),n("active-section-indicator",{attrs:{"relative-parent":e.$refs.wrapper,"active-item":e.activeSectionElement}})],2),e._v(" "),e._t("default")],2)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$07c866",e):t.createRecord("$07c866",e))}}();})();
22
+ },{"./SectionItem":"bosS","./ActiveSectionIndicator":"jLHe","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"vTRD":[function(require,module,exports) {
23
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:{center:{type:Boolean,default:!1}}};exports.default=e;
24
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"wptb-settings-controls-wrapper",class:[this.center?"center":"grid"]},[t("transition",{attrs:{name:"wptb-fade",mode:"out-in"}},[this._t("default")],2)],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$ef5f07",e):t.createRecord("$ef5f07",e))}}();})();
25
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"Bhde":[function(require,module,exports) {
26
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:["title"]};exports.default=e;
27
+ (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"wptb-setting-control"},[this.title?e("div",{staticClass:"title"},[this._v(this._s(this.title))]):this._e(),this._v(" "),this._t("default")],2)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var e=require("vue-hot-reload-api");e.install(require("vue")),e.compatible&&(module.hot.accept(),module.hot.data?e.reload("$b8d3ae",t):e.createRecord("$b8d3ae",t))}}();})();
28
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"yXWm":[function(require,module,exports) {
29
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:["fieldData","modelBind"],methods:{isType:function(e){return this.fieldData.type===e}}};exports.default=e;
30
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,i=e.$createElement,d=e._self._c||i;return d("div",[e.isType("multiCheckbox")?d("div",e._l(e.fieldData.options,function(i,a){return d("div",{key:i,staticClass:"wptb-setting-control-row"},[d("input",{directives:[{name:"model",rawName:"v-model",value:e.modelBind[e.fieldData.id],expression:"modelBind[fieldData.id]"}],attrs:{id:e.fieldData.id,type:"checkbox"},domProps:{value:a,checked:Array.isArray(e.modelBind[e.fieldData.id])?e._i(e.modelBind[e.fieldData.id],a)>-1:e.modelBind[e.fieldData.id]},on:{change:function(i){var d=e.modelBind[e.fieldData.id],t=i.target,l=!!t.checked;if(Array.isArray(d)){var o=a,n=e._i(d,o);t.checked?n<0&&e.$set(e.modelBind,e.fieldData.id,d.concat([o])):n>-1&&e.$set(e.modelBind,e.fieldData.id,d.slice(0,n).concat(d.slice(n+1)))}else e.$set(e.modelBind,e.fieldData.id,l)}}}),e._v(" "),d("label",{attrs:{for:e.fieldData.id}},[e._v(e._s(i))])])}),0):e.isType("checkbox")?d("div",[d("div",{staticClass:"wptb-setting-control-row"},[d("input",{directives:[{name:"model",rawName:"v-model",value:e.modelBind[e.fieldData.id],expression:"modelBind[fieldData.id]"}],attrs:{id:e.fieldData.id,type:"checkbox"},domProps:{checked:Array.isArray(e.modelBind[e.fieldData.id])?e._i(e.modelBind[e.fieldData.id],null)>-1:e.modelBind[e.fieldData.id]},on:{change:function(i){var d=e.modelBind[e.fieldData.id],a=i.target,t=!!a.checked;if(Array.isArray(d)){var l=e._i(d,null);a.checked?l<0&&e.$set(e.modelBind,e.fieldData.id,d.concat([null])):l>-1&&e.$set(e.modelBind,e.fieldData.id,d.slice(0,l).concat(d.slice(l+1)))}else e.$set(e.modelBind,e.fieldData.id,t)}}}),e._v(" "),d("label",{attrs:{for:e.fieldData.id}},[e._v(e._s(e.fieldData.label))])])]):e.isType("dropdown")?d("div",[d("div",{staticClass:"wptb-setting-control-row"},[d("select",{directives:[{name:"model",rawName:"v-model",value:e.modelBind[e.fieldData.id],expression:"modelBind[fieldData.id]"}],attrs:{id:e.fieldData.id},on:{change:function(i){var d=Array.prototype.filter.call(i.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.$set(e.modelBind,e.fieldData.id,i.target.multiple?d:d[0])}}},e._l(e.fieldData.options,function(i){return d("option",{key:i.label,domProps:{value:i.value}},[e._v(" "+e._s(i.label)+" ")])}),0),e._v(" "),d("label",{attrs:{for:e.fieldData.id}},[e._v(e._s(e.fieldData.label))]),e._v(" "),e._t("default")],2)]):e._e()])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var i=require("vue-hot-reload-api");i.install(require("vue")),i.compatible&&(module.hot.accept(),module.hot.data?i.reload("$d317c2",e):i.createRecord("$d317c2",e))}}();})();
31
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"P9T4":[function(require,module,exports) {
32
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("../mixins/withMessage"));function t(e){return e&&e.__esModule?e:{default:e}}var r={mixins:[e.default]};exports.default=r;
33
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"wptb-settings-messages"},[e.withMessageData.busy?s("span",{staticClass:"dashicons dashicons-image-rotate wptb-settings-fetching"}):e._e(),e._v(" "),s("transition",{attrs:{name:"wptb-fade"}},[e.withMessageData.show?s("span",{staticClass:"wptb-settings-message",class:[e.withMessageData.type]},[e._v(e._s(e.withMessageData.message))]):e._e()])],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$08e206",e):t.createRecord("$08e206",e))}}();})();
34
+ },{"../mixins/withMessage":"wm3G","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"ksMR":[function(require,module,exports) {
35
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:{disabled:Boolean,type:{type:String,default:"primary"},size:{type:String,default:"normal"}},methods:{handleClick:function(){this.disabled||this.$emit("click")}}};exports.default=e;
36
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"wptb-settings-button",class:[{disabled:this.disabled},this.type,this.size],on:{click:this.handleClick}},[this._t("default")],2)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$201995",e):t.createRecord("$201995",e))}}();})();
37
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"y8Jx":[function(require,module,exports) {
38
+ var t=null;function e(){return t||(t=n()),t}function n(){try{throw new Error}catch(e){var t=(""+e.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(t)return r(t[0])}return"/"}function r(t){return(""+t).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)\/[^\/]+$/,"$1")+"/"}exports.getBundleURL=e,exports.getBaseURL=r;
39
+ },{}],"uNEb":[function(require,module,exports) {
40
+ var e=require("./bundle-url");function n(e){var n=e.cloneNode();n.onload=function(){e.remove()},n.href=e.href.split("?")[0]+"?"+Date.now(),e.parentNode.insertBefore(n,e.nextSibling)}var l=null;function r(){l||(l=setTimeout(function(){for(var r=document.querySelectorAll('link[rel="stylesheet"]'),t=0;t<r.length;t++)e.getBaseURL(r[t].href)===e.getBundleURL()&&n(r[t]);l=null},50))}module.exports=r;
41
+ },{"./bundle-url":"y8Jx"}],"nwtb":[function(require,module,exports) {
42
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./MessageDisplay.vue")),s=t(require("./MenuButton"));function t(e){return e&&e.__esModule?e:{default:e}}var u={props:["messageType","messageShow","messageBody","messageBusy"],components:{MessageDisplay:e.default,MenuButton:s.default}};exports.default=u;
43
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"wptb-settings-footer"},[s("message-display",{attrs:{busy:e.messageBusy,message:e.messageBody,show:e.messageShow,type:e.messageType}}),e._v(" "),s("div",{staticClass:"wptb-settings-button-container"},[s("menu-button",{staticStyle:{visibility:"hidden"}},[e._v("dummy")]),e._v(" "),e._t("default")],2)],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$3ebe93",e):t.createRecord("$3ebe93",e))}}();})();
44
+ },{"./MessageDisplay.vue":"P9T4","./MenuButton":"ksMR","_css_loader":"uNEb","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"pZ9N":[function(require,module,exports) {
45
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=c(require("../mixins/withStore.js")),t=c(require("../mixins/withMessage")),r=c(require("../components/MenuHeader.vue")),n=c(require("../components/Sections.vue")),i=c(require("../components/MenuContent.vue")),o=c(require("../components/SettingCard.vue")),s=c(require("../components/ControlItem.vue")),u=c(require("../components/MenuFooter.vue")),a=c(require("../components/MenuButton.vue"));function c(e){return e&&e.__esModule?e:{default:e}}function f(e,t){return m(e)||h(e,t)||p(e,t)||l()}function l(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(e,t){if(e){if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function h(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var s,u=e[Symbol.iterator]();!(n=(s=u.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(a){i=!0,o=a}finally{try{n||null==u.return||u.return()}finally{if(i)throw o}}return r}}function m(e){if(Array.isArray(e))return e}function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach(function(t){g(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var v={props:["fieldsData","settings","pluginInfo"],components:{MenuButton:a.default,MenuHeader:r.default,Sections:n.default,MenuContent:i.default,SettingCard:o.default,ControlItem:s.default,MenuFooter:u.default},mixins:[e.default,t.default],data:function(){return{sections:[],currentSection:"",parsedFields:{},resetActive:!1,canSubmit:!1,fetching:!1}},watch:{store:{handler:function(){this.resetActive?(this.canSubmit=!1,this.resetActive=!1):this.canSubmit=!0},deep:!0},fetching:function(e){this.setBusy(e)}},beforeMount:function(){var e=this;Object.keys(this.fieldsData).map(function(t){if(Object.prototype.hasOwnProperty.call(e.fieldsData,t)){var r=e.fieldsData[t].section;void 0===e.parsedFields[r]&&(e.parsedFields[r]=[]),e.parsedFields[r].push(y({},e.fieldsData[t],{id:t})),e.sections.push(r)}return null});var t=f(Object.keys(this.parsedFields).map(function(t){if(Object.prototype.hasOwnProperty.call(e.parsedFields,t))return t}),1);this.currentSection=t[0],this.sections=Array.from(new Set(this.sections))},computed:{currentFields:function(){return this.parsedFields[this.currentSection]}},methods:{resetStore:function(){this.canSubmit&&(this.revertStore(),this.resetActive=!0,this.setMessage({message:this.strings.revertMessage}))},submitSettings:function(){var e=this;if(this.canSubmit){var t=new FormData;t.append("nonce",this.settings.nonce),t.append("action",this.settings.action),t.append("options",JSON.stringify(this.store)),this.canSubmit=!1,this.fetching=!0,fetch(this.settings.ajaxUrl,{method:"POST",body:t}).then(function(e){if(e.ok)return e.json()}).then(function(t){if(t.error)throw new Error(t.error);e.setMessage({message:t.message})}).catch(function(t){console.error(t),e.setMessage({type:"error",message:t})}).finally(function(){e.fetching=!1})}}}};exports.default=v;
46
+ (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"wptb-settings-wrapper"},[n("menu-header",{attrs:{"logo-src":t.pluginInfo.logo,"logo-alt":t.strings.logoAlt,"plugin-name":t.pluginInfo.pluginName}},[n("a",{attrs:{href:t.pluginInfo.pluginHomepage}},[t._v(t._s(t.strings.homepage))])]),t._v(" "),n("sections",{attrs:{items:t.sections},model:{value:t.currentSection,callback:function(e){t.currentSection=e},expression:"currentSection"}}),t._v(" "),n("menu-content",t._l(t.currentFields,function(e){return n("setting-card",{key:e.id,attrs:{title:e.label}},[n("control-item",{attrs:{"field-data":e,modelBind:t.store}})],1)}),1),t._v(" "),n("menu-footer",[n("menu-button",{attrs:{type:"danger",disabled:!t.canSubmit},on:{click:t.resetStore}},[t._v(t._s(t.strings.revert))]),t._v(" "),n("menu-button",{attrs:{type:"primary",disabled:!t.canSubmit},on:{click:t.submitSettings}},[t._v(t._s(t.strings.submit))])],1)],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var e=require("vue-hot-reload-api");e.install(require("vue")),e.compatible&&(module.hot.accept(),module.hot.data?e.reload("$81608b",t):e.createRecord("$81608b",t))}}();})();
47
+ },{"../mixins/withStore.js":"D1kn","../mixins/withMessage":"wm3G","../components/MenuHeader.vue":"vi91","../components/Sections.vue":"yPIx","../components/MenuContent.vue":"vTRD","../components/SettingCard.vue":"Bhde","../components/ControlItem.vue":"yXWm","../components/MenuFooter.vue":"nwtb","../components/MenuButton.vue":"ksMR","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"yEip":[function(require,module,exports) {
48
  "use strict";function t(t,e){t.mixin({data:function(){return{strings:e.strings}}})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={install:t};exports.default=e;
49
  },{}],"uD0a":[function(require,module,exports) {
50
  "use strict";var e=n(require("vue")),t=n(require("./containers/SettingsApp.vue")),r=n(require("./plugins/strings.js"));function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){u(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=o({},wptbAdminSettingsData);wptbAdminSettingsData=void 0,e.default.config.productionTip=!1,e.default.use(r.default,{strings:a.strings}),new e.default({components:{SettingsApp:t.default},data:{fieldsData:a.fields,settings:a.data,pluginInfo:a.pluginInfo}}).$mount(a.data.mountId);
51
+ },{"vue":"HYXJ","./containers/SettingsApp.vue":"pZ9N","./plugins/strings.js":"yEip"}],"PMBU":[function(require,module,exports) {
52
+ var global = arguments[3];
53
+ var e,t,o=arguments[3],a="__parcel__error__overlay__",r=module.bundle.Module;function n(e){r.call(this,e),this.hot={data:module.bundle.hotData,_acceptCallbacks:[],_disposeCallbacks:[],accept:function(e){this._acceptCallbacks.push(e||function(){})},dispose:function(e){this._disposeCallbacks.push(e)}},module.bundle.hotData=null}module.bundle.Module=n;var c=module.bundle.parent;if(!(c&&c.isParcelRequire||"undefined"==typeof WebSocket)){var i=location.hostname,l="https:"===location.protocol?"wss":"ws",s=new WebSocket(l+"://"+i+":3488/");s.onmessage=function(a){e={},t=[];var r=JSON.parse(a.data);if("update"===r.type){var n=!1;r.assets.forEach(function(e){e.isNew||h(o.parcelRequire,e.id)&&(n=!0)}),(n=n||r.assets.every(function(e){return"css"===e.type&&e.generated.js}))?(console.clear(),r.assets.forEach(function(e){f(o.parcelRequire,e)}),t.forEach(function(e){m(e[0],e[1])})):location.reload&&location.reload()}if("reload"===r.type&&(s.close(),s.onclose=function(){location.reload()}),"error-resolved"===r.type&&(console.log("[parcel] ✨ Error resolved"),p()),"error"===r.type){console.error("[parcel] 🚨 "+r.error.message+"\n"+r.error.stack),p();var c=d(r);document.body.appendChild(c)}}}function p(){var e=document.getElementById(a);e&&e.remove()}function d(e){var t=document.createElement("div");t.id=a;var o=document.createElement("div"),r=document.createElement("pre");return o.innerText=e.error.message,r.innerText=e.error.stack,t.innerHTML='<div style="background: black; font-size: 16px; color: white; position: fixed; height: 100%; width: 100%; top: 0px; left: 0px; padding: 30px; opacity: 0.85; font-family: Menlo, Consolas, monospace; z-index: 9999;"><span style="background: red; padding: 2px 4px; border-radius: 2px;">ERROR</span><span style="top: 2px; margin-left: 5px; position: relative;">🚨</span><div style="font-size: 18px; font-weight: bold; margin-top: 20px;">'+o.innerHTML+"</div><pre>"+r.innerHTML+"</pre></div>",t}function u(e,t){var o=e.modules;if(!o)return[];var a,r,n,c=[];for(a in o)for(r in o[a][1])((n=o[a][1][r])===t||Array.isArray(n)&&n[n.length-1]===t)&&c.push(a);return e.parent&&(c=c.concat(u(e.parent,t))),c}function f(e,t){var o=e.modules;if(o)if(o[t.id]||!e.parent){var a=new Function("require","module","exports",t.generated.js);t.isNew=!o[t.id],o[t.id]=[a,t.deps]}else e.parent&&f(e.parent,t)}function h(a,r){var n=a.modules;if(n){if(!n[r]&&a.parent)return h(a.parent,r);if(!e[r]){e[r]=!0;var c=a.cache[r];return t.push([a,r]),!!(c&&c.hot&&c.hot._acceptCallbacks.length)||u(o.parcelRequire,r).some(function(e){return h(o.parcelRequire,e)})}}}function m(e,t){var o=e.cache[t];if(e.hotData={},o&&(o.hot.data=e.hotData),o&&o.hot&&o.hot._disposeCallbacks.length&&o.hot._disposeCallbacks.forEach(function(t){t(e.hotData)}),delete e.cache[t],e(t),(o=e.cache[t])&&o.hot&&o.hot._acceptCallbacks.length)return o.hot._acceptCallbacks.forEach(function(e){e()}),!0}
54
+ },{}]},{},["PMBU","uD0a"], null)
inc/admin/js/WPTB_BuilderControls.js CHANGED
@@ -3,44 +3,50 @@ var global = arguments[3];
3
  var e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=Object.freeze({});function n(e){return null==e}function r(e){return null!=e}function i(e){return!0===e}function o(e){return!1===e}function a(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function s(e){return null!==e&&"object"==typeof e}var c=Object.prototype.toString;function u(e){return c.call(e).slice(8,-1)}function l(e){return"[object Object]"===c.call(e)}function f(e){return"[object RegExp]"===c.call(e)}function p(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function d(e){return r(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function v(e){return null==e?"":Array.isArray(e)||l(e)&&e.toString===c?JSON.stringify(e,null,2):String(e)}function h(e){var t=parseFloat(e);return isNaN(t)?e:t}function m(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}var y=m("slot,component",!0),g=m("key,ref,slot,slot-scope,is");function _(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}var b=Object.prototype.hasOwnProperty;function $(e,t){return b.call(e,t)}function w(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var x=/-(\w)/g,C=w(function(e){return e.replace(x,function(e,t){return t?t.toUpperCase():""})}),A=w(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),k=/\B([A-Z])/g,O=w(function(e){return e.replace(k,"-$1").toLowerCase()});function S(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function T(e,t){return e.bind(t)}var N=Function.prototype.bind?T:S;function j(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function E(e,t){for(var n in t)e[n]=t[n];return e}function M(e){for(var t={},n=0;n<e.length;n++)e[n]&&E(t,e[n]);return t}function D(e,t,n){}var L=function(e,t,n){return!1},I=function(e){return e};function F(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}function P(e,t){if(e===t)return!0;var n=s(e),r=s(t);if(!n||!r)return!n&&!r&&String(e)===String(t);try{var i=Array.isArray(e),o=Array.isArray(t);if(i&&o)return e.length===t.length&&e.every(function(e,n){return P(e,t[n])});if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(i||o)return!1;var a=Object.keys(e),c=Object.keys(t);return a.length===c.length&&a.every(function(n){return P(e[n],t[n])})}catch(u){return!1}}function R(e,t){for(var n=0;n<e.length;n++)if(P(e[n],t))return n;return-1}function H(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}var B="data-server-rendered",U=["component","directive","filter"],z=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch"],V={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:L,isReservedAttr:L,isUnknownElement:L,getTagNamespace:D,parsePlatformTagName:I,mustUseProp:L,async:!0,_lifecycleHooks:z},J=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function K(e){var t=(e+"").charCodeAt(0);return 36===t||95===t}function q(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var W=new RegExp("[^"+J.source+".$_\\d]");function Z(e){if(!W.test(e)){var t=e.split(".");return function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e}}}var G,X="__proto__"in{},Y="undefined"!=typeof window,Q="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,ee=Q&&WXEnvironment.platform.toLowerCase(),te=Y&&window.navigator.userAgent.toLowerCase(),ne=te&&/msie|trident/.test(te),re=te&&te.indexOf("msie 9.0")>0,ie=te&&te.indexOf("edge/")>0,oe=te&&te.indexOf("android")>0||"android"===ee,ae=te&&/iphone|ipad|ipod|ios/.test(te)||"ios"===ee,se=te&&/chrome\/\d+/.test(te)&&!ie,ce=te&&/phantomjs/.test(te),ue=te&&te.match(/firefox\/(\d+)/),le={}.watch,fe=!1;if(Y)try{var pe={};Object.defineProperty(pe,"passive",{get:function(){fe=!0}}),window.addEventListener("test-passive",null,pe)}catch(Xl){}var de=function(){return void 0===G&&(G=!Y&&!Q&&void 0!==e&&(e.process&&"server"===e.process.env.VUE_ENV)),G},ve=Y&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function he(e){return"function"==typeof e&&/native code/.test(e.toString())}var me,ye="undefined"!=typeof Symbol&&he(Symbol)&&"undefined"!=typeof Reflect&&he(Reflect.ownKeys);me="undefined"!=typeof Set&&he(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ge,_e,be,$e,we=D,xe=D,Ce=D,Ae=D,ke=0,Oe=function(){this.id=ke++,this.subs=[]};Oe.prototype.addSub=function(e){this.subs.push(e)},Oe.prototype.removeSub=function(e){_(this.subs,e)},Oe.prototype.depend=function(){Oe.target&&Oe.target.addDep(this)},Oe.prototype.notify=function(){var e=this.subs.slice();for(var t=0,n=e.length;t<n;t++)e[t].update()},Oe.target=null;var Se=[];function Te(e){Se.push(e),Oe.target=e}function Ne(){Se.pop(),Oe.target=Se[Se.length-1]}var je=function(e,t,n,r,i,o,a,s){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},Ee={child:{configurable:!0}};Ee.child.get=function(){return this.componentInstance},Object.defineProperties(je.prototype,Ee);var Me=function(e){void 0===e&&(e="");var t=new je;return t.text=e,t.isComment=!0,t};function De(e){return new je(void 0,void 0,void 0,String(e))}function Le(e){var t=new je(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}var Ie=Array.prototype,Fe=Object.create(Ie),Pe=["push","pop","shift","unshift","splice","sort","reverse"];Pe.forEach(function(e){var t=Ie[e];q(Fe,e,function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var i,o=t.apply(this,n),a=this.__ob__;switch(e){case"push":case"unshift":i=n;break;case"splice":i=n.slice(2)}return i&&a.observeArray(i),a.dep.notify(),o})});var Re=Object.getOwnPropertyNames(Fe),He=!0;function Be(e){He=e}var Ue=function(e){this.value=e,this.dep=new Oe,this.vmCount=0,q(e,"__ob__",this),Array.isArray(e)?(X?ze(e,Fe):Ve(e,Fe,Re),this.observeArray(e)):this.walk(e)};function ze(e,t){e.__proto__=t}function Ve(e,t,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];q(e,o,t[o])}}function Je(e,t){var n;if(s(e)&&!(e instanceof je))return $(e,"__ob__")&&e.__ob__ instanceof Ue?n=e.__ob__:He&&!de()&&(Array.isArray(e)||l(e))&&Object.isExtensible(e)&&!e._isVue&&(n=new Ue(e)),t&&n&&n.vmCount++,n}function Ke(e,t,n,r,i){var o=new Oe,a=Object.getOwnPropertyDescriptor(e,t);if(!a||!1!==a.configurable){var s=a&&a.get,c=a&&a.set;s&&!c||2!==arguments.length||(n=e[t]);var u=!i&&Je(n);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=s?s.call(e):n;return Oe.target&&(o.depend(),u&&(u.dep.depend(),Array.isArray(t)&&Ze(t))),t},set:function(t){var r=s?s.call(e):n;t===r||t!=t&&r!=r||s&&!c||(c?c.call(e,t):n=t,u=!i&&Je(t),o.notify())}})}}function qe(e,t,n){if(Array.isArray(e)&&p(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var r=e.__ob__;return e._isVue||r&&r.vmCount?n:r?(Ke(r.value,t,n),r.dep.notify(),n):(e[t]=n,n)}function We(e,t){if(Array.isArray(e)&&p(t))e.splice(t,1);else{var n=e.__ob__;e._isVue||n&&n.vmCount||$(e,t)&&(delete e[t],n&&n.dep.notify())}}function Ze(e){for(var t=void 0,n=0,r=e.length;n<r;n++)(t=e[n])&&t.__ob__&&t.__ob__.dep.depend(),Array.isArray(t)&&Ze(t)}Ue.prototype.walk=function(e){for(var t=Object.keys(e),n=0;n<t.length;n++)Ke(e,t[n])},Ue.prototype.observeArray=function(e){for(var t=0,n=e.length;t<n;t++)Je(e[t])};var Ge=V.optionMergeStrategies;function Xe(e,t){if(!t)return e;for(var n,r,i,o=ye?Reflect.ownKeys(t):Object.keys(t),a=0;a<o.length;a++)"__ob__"!==(n=o[a])&&(r=e[n],i=t[n],$(e,n)?r!==i&&l(r)&&l(i)&&Xe(r,i):qe(e,n,i));return e}function Ye(e,t,n){return n?function(){var r="function"==typeof t?t.call(n,n):t,i="function"==typeof e?e.call(n,n):e;return r?Xe(r,i):i}:t?e?function(){return Xe("function"==typeof t?t.call(this,this):t,"function"==typeof e?e.call(this,this):e)}:t:e}function Qe(e,t){var n=t?e?e.concat(t):Array.isArray(t)?t:[t]:e;return n?et(n):n}function et(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}function tt(e,t,n,r){var i=Object.create(e||null);return t?E(i,t):i}Ge.data=function(e,t,n){return n?Ye(e,t,n):t&&"function"!=typeof t?e:Ye(e,t)},z.forEach(function(e){Ge[e]=Qe}),U.forEach(function(e){Ge[e+"s"]=tt}),Ge.watch=function(e,t,n,r){if(e===le&&(e=void 0),t===le&&(t=void 0),!t)return Object.create(e||null);if(!e)return t;var i={};for(var o in E(i,e),t){var a=i[o],s=t[o];a&&!Array.isArray(a)&&(a=[a]),i[o]=a?a.concat(s):Array.isArray(s)?s:[s]}return i},Ge.props=Ge.methods=Ge.inject=Ge.computed=function(e,t,n,r){if(!e)return t;var i=Object.create(null);return E(i,e),t&&E(i,t),i},Ge.provide=Ye;var nt=function(e,t){return void 0===t?e:t};function rt(e){for(var t in e.components)it(t)}function it(e){new RegExp("^[a-zA-Z][\\-\\.0-9_"+J.source+"]*$").test(e)||we('Invalid component name: "'+e+'". Component names should conform to valid custom element name in html5 specification.'),(y(e)||V.isReservedTag(e))&&we("Do not use built-in or reserved HTML elements as component id: "+e)}function ot(e,t){var n=e.props;if(n){var r,i,o={};if(Array.isArray(n))for(r=n.length;r--;)"string"==typeof(i=n[r])&&(o[C(i)]={type:null});else if(l(n))for(var a in n)i=n[a],o[C(a)]=l(i)?i:{type:i};else 0;e.props=o}}function at(e,t){var n=e.inject;if(n){var r=e.inject={};if(Array.isArray(n))for(var i=0;i<n.length;i++)r[n[i]]={from:n[i]};else if(l(n))for(var o in n){var a=n[o];r[o]=l(a)?E({from:o},a):{from:a}}else 0}}function st(e){var t=e.directives;if(t)for(var n in t){var r=t[n];"function"==typeof r&&(t[n]={bind:r,update:r})}}function ct(e,t,n){l(t)||we('Invalid value for option "'+e+'": expected an Object, but got '+u(t)+".",n)}function ut(e,t,n){if("function"==typeof t&&(t=t.options),ot(t,n),at(t,n),st(t),!t._base&&(t.extends&&(e=ut(e,t.extends,n)),t.mixins))for(var r=0,i=t.mixins.length;r<i;r++)e=ut(e,t.mixins[r],n);var o,a={};for(o in e)s(o);for(o in t)$(e,o)||s(o);function s(r){var i=Ge[r]||nt;a[r]=i(e[r],t[r],n,r)}return a}function lt(e,t,n,r){if("string"==typeof n){var i=e[t];if($(i,n))return i[n];var o=C(n);if($(i,o))return i[o];var a=A(o);if($(i,a))return i[a];var s=i[n]||i[o]||i[a];return s}}function ft(e,t,n,r){var i=t[e],o=!$(n,e),a=n[e],s=gt(Boolean,i.type);if(s>-1)if(o&&!$(i,"default"))a=!1;else if(""===a||a===O(e)){var c=gt(String,i.type);(c<0||s<c)&&(a=!0)}if(void 0===a){a=pt(r,i,e);var u=He;Be(!0),Je(a),Be(u)}return a}function pt(e,t,n){if($(t,"default")){var r=t.default;return e&&e.$options.propsData&&void 0===e.$options.propsData[n]&&void 0!==e._props[n]?e._props[n]:"function"==typeof r&&"Function"!==mt(t.type)?r.call(e):r}}function dt(e,t,n,r,i){if(e.required&&i)we('Missing required prop: "'+t+'"',r);else if(null!=n||e.required){var o=e.type,a=!o||!0===o,s=[];if(o){Array.isArray(o)||(o=[o]);for(var c=0;c<o.length&&!a;c++){var u=ht(n,o[c]);s.push(u.expectedType||""),a=u.valid}}if(a){var l=e.validator;l&&(l(n)||we('Invalid prop: custom validator check failed for prop "'+t+'".',r))}else we(_t(t,n,s),r)}}var vt=/^(String|Number|Boolean|Function|Symbol)$/;function ht(e,t){var n,r=mt(t);if(vt.test(r)){var i=typeof e;(n=i===r.toLowerCase())||"object"!==i||(n=e instanceof t)}else n="Object"===r?l(e):"Array"===r?Array.isArray(e):e instanceof t;return{valid:n,expectedType:r}}function mt(e){var t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:""}function yt(e,t){return mt(e)===mt(t)}function gt(e,t){if(!Array.isArray(t))return yt(t,e)?0:-1;for(var n=0,r=t.length;n<r;n++)if(yt(t[n],e))return n;return-1}function _t(e,t,n){var r='Invalid prop: type check failed for prop "'+e+'". Expected '+n.map(A).join(", "),i=n[0],o=u(t),a=bt(t,i),s=bt(t,o);return 1===n.length&&$t(i)&&!wt(i,o)&&(r+=" with value "+a),r+=", got "+o+" ",$t(o)&&(r+="with value "+s+"."),r}function bt(e,t){return"String"===t?'"'+e+'"':"Number"===t?""+Number(e):""+e}function $t(e){return["string","number","boolean"].some(function(t){return e.toLowerCase()===t})}function wt(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return e.some(function(e){return"boolean"===e.toLowerCase()})}function xt(e,t,n){Te();try{if(t)for(var r=t;r=r.$parent;){var i=r.$options.errorCaptured;if(i)for(var o=0;o<i.length;o++)try{if(!1===i[o].call(r,e,t,n))return}catch(Xl){At(Xl,r,"errorCaptured hook")}}At(e,t,n)}finally{Ne()}}function Ct(e,t,n,r,i){var o;try{(o=n?e.apply(t,n):e.call(t))&&!o._isVue&&d(o)&&!o._handled&&(o.catch(function(e){return xt(e,r,i+" (Promise/async)")}),o._handled=!0)}catch(Xl){xt(Xl,r,i)}return o}function At(e,t,n){if(V.errorHandler)try{return V.errorHandler.call(null,e,t,n)}catch(Xl){Xl!==e&&kt(Xl,null,"config.errorHandler")}kt(e,t,n)}function kt(e,t,n){if(!Y&&!Q||"undefined"==typeof console)throw e;console.error(e)}var Ot,St,Tt,Nt,jt,Et,Mt,Dt,Lt,It,Ft,Pt,Rt=!1,Ht=[],Bt=!1;function Ut(){Bt=!1;var e=Ht.slice(0);Ht.length=0;for(var t=0;t<e.length;t++)e[t]()}if("undefined"!=typeof Promise&&he(Promise)){var zt=Promise.resolve();Ot=function(){zt.then(Ut),ae&&setTimeout(D)},Rt=!0}else if(ne||"undefined"==typeof MutationObserver||!he(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())Ot="undefined"!=typeof setImmediate&&he(setImmediate)?function(){setImmediate(Ut)}:function(){setTimeout(Ut,0)};else{var Vt=1,Jt=new MutationObserver(Ut),Kt=document.createTextNode(String(Vt));Jt.observe(Kt,{characterData:!0}),Ot=function(){Vt=(Vt+1)%2,Kt.data=String(Vt)},Rt=!0}function qt(e,t){var n;if(Ht.push(function(){if(e)try{e.call(t)}catch(Xl){xt(Xl,t,"nextTick")}else n&&n(t)}),Bt||(Bt=!0,Ot()),!e&&"undefined"!=typeof Promise)return new Promise(function(e){n=e})}var Wt=new me;function Zt(e){Gt(e,Wt),Wt.clear()}function Gt(e,t){var n,r,i=Array.isArray(e);if(!(!i&&!s(e)||Object.isFrozen(e)||e instanceof je)){if(e.__ob__){var o=e.__ob__.dep.id;if(t.has(o))return;t.add(o)}if(i)for(n=e.length;n--;)Gt(e[n],t);else for(n=(r=Object.keys(e)).length;n--;)Gt(e[r[n]],t)}}var Xt=w(function(e){var t="&"===e.charAt(0),n="~"===(e=t?e.slice(1):e).charAt(0),r="!"===(e=n?e.slice(1):e).charAt(0);return{name:e=r?e.slice(1):e,once:n,capture:r,passive:t}});function Yt(e,t){function n(){var e=arguments,r=n.fns;if(!Array.isArray(r))return Ct(r,null,arguments,t,"v-on handler");for(var i=r.slice(),o=0;o<i.length;o++)Ct(i[o],null,e,t,"v-on handler")}return n.fns=e,n}function Qt(e,t,r,o,a,s){var c,u,l,f;for(c in e)u=e[c],l=t[c],f=Xt(c),n(u)||(n(l)?(n(u.fns)&&(u=e[c]=Yt(u,s)),i(f.once)&&(u=e[c]=a(f.name,u,f.capture)),r(f.name,u,f.capture,f.passive,f.params)):u!==l&&(l.fns=u,e[c]=l));for(c in t)n(e[c])&&o((f=Xt(c)).name,t[c],f.capture)}function en(e,t,o){var a;e instanceof je&&(e=e.data.hook||(e.data.hook={}));var s=e[t];function c(){o.apply(this,arguments),_(a.fns,c)}n(s)?a=Yt([c]):r(s.fns)&&i(s.merged)?(a=s).fns.push(c):a=Yt([s,c]),a.merged=!0,e[t]=a}function tn(e,t,i){var o=t.options.props;if(!n(o)){var a={},s=e.attrs,c=e.props;if(r(s)||r(c))for(var u in o){var l=O(u);nn(a,c,u,l,!0)||nn(a,s,u,l,!1)}return a}}function nn(e,t,n,i,o){if(r(t)){if($(t,n))return e[n]=t[n],o||delete t[n],!0;if($(t,i))return e[n]=t[i],o||delete t[i],!0}return!1}function rn(e){for(var t=0;t<e.length;t++)if(Array.isArray(e[t]))return Array.prototype.concat.apply([],e);return e}function on(e){return a(e)?[De(e)]:Array.isArray(e)?sn(e):void 0}function an(e){return r(e)&&r(e.text)&&o(e.isComment)}function sn(e,t){var o,s,c,u,l=[];for(o=0;o<e.length;o++)n(s=e[o])||"boolean"==typeof s||(u=l[c=l.length-1],Array.isArray(s)?s.length>0&&(an((s=sn(s,(t||"")+"_"+o))[0])&&an(u)&&(l[c]=De(u.text+s[0].text),s.shift()),l.push.apply(l,s)):a(s)?an(u)?l[c]=De(u.text+s):""!==s&&l.push(De(s)):an(s)&&an(u)?l[c]=De(u.text+s.text):(i(e._isVList)&&r(s.tag)&&n(s.key)&&r(t)&&(s.key="__vlist"+t+"_"+o+"__"),l.push(s)));return l}function cn(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}function un(e){var t=ln(e.$options.inject,e);t&&(Be(!1),Object.keys(t).forEach(function(n){Ke(e,n,t[n])}),Be(!0))}function ln(e,t){if(e){for(var n=Object.create(null),r=ye?Reflect.ownKeys(e):Object.keys(e),i=0;i<r.length;i++){var o=r[i];if("__ob__"!==o){for(var a=e[o].from,s=t;s;){if(s._provided&&$(s._provided,a)){n[o]=s._provided[a];break}s=s.$parent}if(!s)if("default"in e[o]){var c=e[o].default;n[o]="function"==typeof c?c.call(t):c}else 0}}return n}}function fn(e,t){if(!e||!e.length)return{};for(var n={},r=0,i=e.length;r<i;r++){var o=e[r],a=o.data;if(a&&a.attrs&&a.attrs.slot&&delete a.attrs.slot,o.context!==t&&o.fnContext!==t||!a||null==a.slot)(n.default||(n.default=[])).push(o);else{var s=a.slot,c=n[s]||(n[s]=[]);"template"===o.tag?c.push.apply(c,o.children||[]):c.push(o)}}for(var u in n)n[u].every(pn)&&delete n[u];return n}function pn(e){return e.isComment&&!e.asyncFactory||" "===e.text}function dn(e,n,r){var i,o=Object.keys(n).length>0,a=e?!!e.$stable:!o,s=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(a&&r&&r!==t&&s===r.$key&&!o&&!r.$hasNormal)return r;for(var c in i={},e)e[c]&&"$"!==c[0]&&(i[c]=vn(n,c,e[c]))}else i={};for(var u in n)u in i||(i[u]=hn(n,u));return e&&Object.isExtensible(e)&&(e._normalized=i),q(i,"$stable",a),q(i,"$key",s),q(i,"$hasNormal",o),i}function vn(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({});return(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:on(e))&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function hn(e,t){return function(){return e[t]}}function mn(e,t){var n,i,o,a,c;if(Array.isArray(e)||"string"==typeof e)for(n=new Array(e.length),i=0,o=e.length;i<o;i++)n[i]=t(e[i],i);else if("number"==typeof e)for(n=new Array(e),i=0;i<e;i++)n[i]=t(i+1,i);else if(s(e))if(ye&&e[Symbol.iterator]){n=[];for(var u=e[Symbol.iterator](),l=u.next();!l.done;)n.push(t(l.value,n.length)),l=u.next()}else for(a=Object.keys(e),n=new Array(a.length),i=0,o=a.length;i<o;i++)c=a[i],n[i]=t(e[c],c,i);return r(n)||(n=[]),n._isVList=!0,n}function yn(e,t,n,r){var i,o=this.$scopedSlots[e];o?(n=n||{},r&&(n=E(E({},r),n)),i=o(n)||t):i=this.$slots[e]||t;var a=n&&n.slot;return a?this.$createElement("template",{slot:a},i):i}function gn(e){return lt(this.$options,"filters",e,!0)||I}function _n(e,t){return Array.isArray(e)?-1===e.indexOf(t):e!==t}function bn(e,t,n,r,i){var o=V.keyCodes[t]||n;return i&&r&&!V.keyCodes[t]?_n(i,r):o?_n(o,e):r?O(r)!==t:void 0}function $n(e,t,n,r,i){if(n)if(s(n)){var o;Array.isArray(n)&&(n=M(n));var a=function(a){if("class"===a||"style"===a||g(a))o=e;else{var s=e.attrs&&e.attrs.type;o=r||V.mustUseProp(t,s,a)?e.domProps||(e.domProps={}):e.attrs||(e.attrs={})}var c=C(a),u=O(a);c in o||u in o||(o[a]=n[a],i&&((e.on||(e.on={}))["update:"+a]=function(e){n[a]=e}))};for(var c in n)a(c)}else;return e}function wn(e,t){var n=this._staticTrees||(this._staticTrees=[]),r=n[e];return r&&!t?r:(Cn(r=n[e]=this.$options.staticRenderFns[e].call(this._renderProxy,null,this),"__static__"+e,!1),r)}function xn(e,t,n){return Cn(e,"__once__"+t+(n?"_"+n:""),!0),e}function Cn(e,t,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]&&"string"!=typeof e[r]&&An(e[r],t+"_"+r,n);else An(e,t,n)}function An(e,t,n){e.isStatic=!0,e.key=t,e.isOnce=n}function kn(e,t){if(t)if(l(t)){var n=e.on=e.on?E({},e.on):{};for(var r in t){var i=n[r],o=t[r];n[r]=i?[].concat(i,o):o}}else;return e}function On(e,t,n,r){t=t||{$stable:!n};for(var i=0;i<e.length;i++){var o=e[i];Array.isArray(o)?On(o,t,n):o&&(o.proxy&&(o.fn.proxy=!0),t[o.key]=o.fn)}return r&&(t.$key=r),t}function Sn(e,t){for(var n=0;n<t.length;n+=2){var r=t[n];"string"==typeof r&&r&&(e[t[n]]=t[n+1])}return e}function Tn(e,t){return"string"==typeof e?t+e:e}function Nn(e){e._o=xn,e._n=h,e._s=v,e._l=mn,e._t=yn,e._q=P,e._i=R,e._m=wn,e._f=gn,e._k=bn,e._b=$n,e._v=De,e._e=Me,e._u=On,e._g=kn,e._d=Sn,e._p=Tn}function jn(e,n,r,o,a){var s,c=this,u=a.options;$(o,"_uid")?(s=Object.create(o))._original=o:(s=o,o=o._original);var l=i(u._compiled),f=!l;this.data=e,this.props=n,this.children=r,this.parent=o,this.listeners=e.on||t,this.injections=ln(u.inject,o),this.slots=function(){return c.$slots||dn(e.scopedSlots,c.$slots=fn(r,o)),c.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return dn(e.scopedSlots,this.slots())}}),l&&(this.$options=u,this.$slots=this.slots(),this.$scopedSlots=dn(e.scopedSlots,this.$slots)),u._scopeId?this._c=function(e,t,n,r){var i=Vn(s,e,t,n,r,f);return i&&!Array.isArray(i)&&(i.fnScopeId=u._scopeId,i.fnContext=o),i}:this._c=function(e,t,n,r){return Vn(s,e,t,n,r,f)}}function En(e,n,i,o,a){var s=e.options,c={},u=s.props;if(r(u))for(var l in u)c[l]=ft(l,u,n||t);else r(i.attrs)&&Dn(c,i.attrs),r(i.props)&&Dn(c,i.props);var f=new jn(i,c,a,o,e),p=s.render.call(null,f._c,f);if(p instanceof je)return Mn(p,i,f.parent,s,f);if(Array.isArray(p)){for(var d=on(p)||[],v=new Array(d.length),h=0;h<d.length;h++)v[h]=Mn(d[h],i,f.parent,s,f);return v}}function Mn(e,t,n,r,i){var o=Le(e);return o.fnContext=n,o.fnOptions=r,t.slot&&((o.data||(o.data={})).slot=t.slot),o}function Dn(e,t){for(var n in t)e[C(n)]=t[n]}Nn(jn.prototype);var Ln={init:function(e,t){if(e.componentInstance&&!e.componentInstance._isDestroyed&&e.data.keepAlive){var n=e;Ln.prepatch(n,n)}else{(e.componentInstance=Pn(e,ur)).$mount(t?e.elm:void 0,t)}},prepatch:function(e,t){var n=t.componentOptions;hr(t.componentInstance=e.componentInstance,n.propsData,n.listeners,t,n.children)},insert:function(e){var t=e.context,n=e.componentInstance;n._isMounted||(n._isMounted=!0,_r(n,"mounted")),e.data.keepAlive&&(t._isMounted?Dr(n):yr(n,!0))},destroy:function(e){var t=e.componentInstance;t._isDestroyed||(e.data.keepAlive?gr(t,!0):t.$destroy())}},In=Object.keys(Ln);function Fn(e,t,o,a,c){if(!n(e)){var u=o.$options._base;if(s(e)&&(e=u.extend(e)),"function"==typeof e){var l;if(n(e.cid)&&void 0===(e=er(l=e,u)))return Qn(l,t,o,a,c);t=t||{},ri(e),r(t.model)&&Bn(e.options,t);var f=tn(t,e,c);if(i(e.options.functional))return En(e,f,t,o,a);var p=t.on;if(t.on=t.nativeOn,i(e.options.abstract)){var d=t.slot;t={},d&&(t.slot=d)}Rn(t);var v=e.options.name||c;return new je("vue-component-"+e.cid+(v?"-"+v:""),t,void 0,void 0,void 0,o,{Ctor:e,propsData:f,listeners:p,tag:c,children:a},l)}}}function Pn(e,t){var n={_isComponent:!0,_parentVnode:e,parent:t},i=e.data.inlineTemplate;return r(i)&&(n.render=i.render,n.staticRenderFns=i.staticRenderFns),new e.componentOptions.Ctor(n)}function Rn(e){for(var t=e.hook||(e.hook={}),n=0;n<In.length;n++){var r=In[n],i=t[r],o=Ln[r];i===o||i&&i._merged||(t[r]=i?Hn(o,i):o)}}function Hn(e,t){var n=function(n,r){e(n,r),t(n,r)};return n._merged=!0,n}function Bn(e,t){var n=e.model&&e.model.prop||"value",i=e.model&&e.model.event||"input";(t.attrs||(t.attrs={}))[n]=t.model.value;var o=t.on||(t.on={}),a=o[i],s=t.model.callback;r(a)?(Array.isArray(a)?-1===a.indexOf(s):a!==s)&&(o[i]=[s].concat(a)):o[i]=s}var Un=1,zn=2;function Vn(e,t,n,r,o,s){return(Array.isArray(n)||a(n))&&(o=r,r=n,n=void 0),i(s)&&(o=zn),Jn(e,t,n,r,o)}function Jn(e,t,n,i,o){if(r(n)&&r(n.__ob__))return Me();if(r(n)&&r(n.is)&&(t=n.is),!t)return Me();var a,s,c;(Array.isArray(i)&&"function"==typeof i[0]&&((n=n||{}).scopedSlots={default:i[0]},i.length=0),o===zn?i=on(i):o===Un&&(i=rn(i)),"string"==typeof t)?(s=e.$vnode&&e.$vnode.ns||V.getTagNamespace(t),a=V.isReservedTag(t)?new je(V.parsePlatformTagName(t),n,i,void 0,void 0,e):n&&n.pre||!r(c=lt(e.$options,"components",t))?new je(t,n,i,void 0,void 0,e):Fn(c,n,e,i,t)):a=Fn(t,n,e,i);return Array.isArray(a)?a:r(a)?(r(s)&&Kn(a,s),r(n)&&qn(n),a):Me()}function Kn(e,t,o){if(e.ns=t,"foreignObject"===e.tag&&(t=void 0,o=!0),r(e.children))for(var a=0,s=e.children.length;a<s;a++){var c=e.children[a];r(c.tag)&&(n(c.ns)||i(o)&&"svg"!==c.tag)&&Kn(c,t,o)}}function qn(e){s(e.style)&&Zt(e.style),s(e.class)&&Zt(e.class)}function Wn(e){e._vnode=null,e._staticTrees=null;var n=e.$options,r=e.$vnode=n._parentVnode,i=r&&r.context;e.$slots=fn(n._renderChildren,i),e.$scopedSlots=t,e._c=function(t,n,r,i){return Vn(e,t,n,r,i,!1)},e.$createElement=function(t,n,r,i){return Vn(e,t,n,r,i,!0)};var o=r&&r.data;Ke(e,"$attrs",o&&o.attrs||t,null,!0),Ke(e,"$listeners",n._parentListeners||t,null,!0)}var Zn,Gn=null;function Xn(e){Nn(e.prototype),e.prototype.$nextTick=function(e){return qt(e,this)},e.prototype._render=function(){var e,t=this,n=t.$options,r=n.render,i=n._parentVnode;i&&(t.$scopedSlots=dn(i.data.scopedSlots,t.$slots,t.$scopedSlots)),t.$vnode=i;try{Gn=t,e=r.call(t._renderProxy,t.$createElement)}catch(Xl){xt(Xl,t,"render"),e=t._vnode}finally{Gn=null}return Array.isArray(e)&&1===e.length&&(e=e[0]),e instanceof je||(e=Me()),e.parent=i,e}}function Yn(e,t){return(e.__esModule||ye&&"Module"===e[Symbol.toStringTag])&&(e=e.default),s(e)?t.extend(e):e}function Qn(e,t,n,r,i){var o=Me();return o.asyncFactory=e,o.asyncMeta={data:t,context:n,children:r,tag:i},o}function er(e,t){if(i(e.error)&&r(e.errorComp))return e.errorComp;if(r(e.resolved))return e.resolved;var o=Gn;if(o&&r(e.owners)&&-1===e.owners.indexOf(o)&&e.owners.push(o),i(e.loading)&&r(e.loadingComp))return e.loadingComp;if(o&&!r(e.owners)){var a=e.owners=[o],c=!0,u=null,l=null;o.$on("hook:destroyed",function(){return _(a,o)});var f=function(e){for(var t=0,n=a.length;t<n;t++)a[t].$forceUpdate();e&&(a.length=0,null!==u&&(clearTimeout(u),u=null),null!==l&&(clearTimeout(l),l=null))},p=H(function(n){e.resolved=Yn(n,t),c?a.length=0:f(!0)}),v=H(function(t){r(e.errorComp)&&(e.error=!0,f(!0))}),h=e(p,v);return s(h)&&(d(h)?n(e.resolved)&&h.then(p,v):d(h.component)&&(h.component.then(p,v),r(h.error)&&(e.errorComp=Yn(h.error,t)),r(h.loading)&&(e.loadingComp=Yn(h.loading,t),0===h.delay?e.loading=!0:u=setTimeout(function(){u=null,n(e.resolved)&&n(e.error)&&(e.loading=!0,f(!1))},h.delay||200)),r(h.timeout)&&(l=setTimeout(function(){l=null,n(e.resolved)&&v(null)},h.timeout)))),c=!1,e.loading?e.loadingComp:e.resolved}}function tr(e){return e.isComment&&e.asyncFactory}function nr(e){if(Array.isArray(e))for(var t=0;t<e.length;t++){var n=e[t];if(r(n)&&(r(n.componentOptions)||tr(n)))return n}}function rr(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&sr(e,t)}function ir(e,t){Zn.$on(e,t)}function or(e,t){Zn.$off(e,t)}function ar(e,t){var n=Zn;return function r(){null!==t.apply(null,arguments)&&n.$off(e,r)}}function sr(e,t,n){Zn=e,Qt(t,n||{},ir,or,ar,e),Zn=void 0}function cr(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i<o;i++)r.$on(e[i],n);else(r._events[e]||(r._events[e]=[])).push(n),t.test(e)&&(r._hasHookEvent=!0);return r},e.prototype.$once=function(e,t){var n=this;function r(){n.$off(e,r),t.apply(n,arguments)}return r.fn=t,n.$on(e,r),n},e.prototype.$off=function(e,t){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(Array.isArray(e)){for(var r=0,i=e.length;r<i;r++)n.$off(e[r],t);return n}var o,a=n._events[e];if(!a)return n;if(!t)return n._events[e]=null,n;for(var s=a.length;s--;)if((o=a[s])===t||o.fn===t){a.splice(s,1);break}return n},e.prototype.$emit=function(e){var t=this,n=t._events[e];if(n){n=n.length>1?j(n):n;for(var r=j(arguments,1),i='event handler for "'+e+'"',o=0,a=n.length;o<a;o++)Ct(n[o],t,r,t,i)}return t}}var ur=null,lr=!1;function fr(e){var t=ur;return ur=e,function(){ur=t}}function pr(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}function dr(e){e.prototype._update=function(e,t){var n=this,r=n.$el,i=n._vnode,o=fr(n);n._vnode=e,n.$el=i?n.__patch__(i,e):n.__patch__(n.$el,e,t,!1),o(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},e.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},e.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){_r(e,"beforeDestroy"),e._isBeingDestroyed=!0;var t=e.$parent;!t||t._isBeingDestroyed||e.$options.abstract||_(t.$children,e),e._watcher&&e._watcher.teardown();for(var n=e._watchers.length;n--;)e._watchers[n].teardown();e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),_r(e,"destroyed"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}}function vr(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=Me),_r(e,"beforeMount"),r=function(){e._update(e._render(),n)},new Pr(e,r,D,{before:function(){e._isMounted&&!e._isDestroyed&&_r(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,_r(e,"mounted")),e}function hr(e,n,r,i,o){var a=i.data.scopedSlots,s=e.$scopedSlots,c=!!(a&&!a.$stable||s!==t&&!s.$stable||a&&e.$scopedSlots.$key!==a.$key),u=!!(o||e.$options._renderChildren||c);if(e.$options._parentVnode=i,e.$vnode=i,e._vnode&&(e._vnode.parent=i),e.$options._renderChildren=o,e.$attrs=i.data.attrs||t,e.$listeners=r||t,n&&e.$options.props){Be(!1);for(var l=e._props,f=e.$options._propKeys||[],p=0;p<f.length;p++){var d=f[p],v=e.$options.props;l[d]=ft(d,v,n,e)}Be(!0),e.$options.propsData=n}r=r||t;var h=e.$options._parentListeners;e.$options._parentListeners=r,sr(e,r,h),u&&(e.$slots=fn(o,i.context),e.$forceUpdate())}function mr(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}function yr(e,t){if(t){if(e._directInactive=!1,mr(e))return}else if(e._directInactive)return;if(e._inactive||null===e._inactive){e._inactive=!1;for(var n=0;n<e.$children.length;n++)yr(e.$children[n]);_r(e,"activated")}}function gr(e,t){if(!(t&&(e._directInactive=!0,mr(e))||e._inactive)){e._inactive=!0;for(var n=0;n<e.$children.length;n++)gr(e.$children[n]);_r(e,"deactivated")}}function _r(e,t){Te();var n=e.$options[t],r=t+" hook";if(n)for(var i=0,o=n.length;i<o;i++)Ct(n[i],e,null,e,r);e._hasHookEvent&&e.$emit("hook:"+t),Ne()}var br=100,$r=[],wr=[],xr={},Cr={},Ar=!1,kr=!1,Or=0;function Sr(){Or=$r.length=wr.length=0,xr={},Ar=kr=!1}var Tr=0,Nr=Date.now;if(Y&&!ne){var jr=window.performance;jr&&"function"==typeof jr.now&&Nr()>document.createEvent("Event").timeStamp&&(Nr=function(){return jr.now()})}function Er(){var e,t;for(Tr=Nr(),kr=!0,$r.sort(function(e,t){return e.id-t.id}),Or=0;Or<$r.length;Or++)(e=$r[Or]).before&&e.before(),t=e.id,xr[t]=null,e.run();var n=wr.slice(),r=$r.slice();Sr(),Lr(n),Mr(r),ve&&V.devtools&&ve.emit("flush")}function Mr(e){for(var t=e.length;t--;){var n=e[t],r=n.vm;r._watcher===n&&r._isMounted&&!r._isDestroyed&&_r(r,"updated")}}function Dr(e){e._inactive=!1,wr.push(e)}function Lr(e){for(var t=0;t<e.length;t++)e[t]._inactive=!0,yr(e[t],!0)}function Ir(e){var t=e.id;if(null==xr[t]){if(xr[t]=!0,kr){for(var n=$r.length-1;n>Or&&$r[n].id>e.id;)n--;$r.splice(n+1,0,e)}else $r.push(e);Ar||(Ar=!0,qt(Er))}}var Fr=0,Pr=function(e,t,n,r,i){this.vm=e,i&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++Fr,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new me,this.newDepIds=new me,this.expression="","function"==typeof t?this.getter=t:(this.getter=Z(t),this.getter||(this.getter=D)),this.value=this.lazy?void 0:this.get()};Pr.prototype.get=function(){var e;Te(this);var t=this.vm;try{e=this.getter.call(t,t)}catch(Xl){if(!this.user)throw Xl;xt(Xl,t,'getter for watcher "'+this.expression+'"')}finally{this.deep&&Zt(e),Ne(),this.cleanupDeps()}return e},Pr.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},Pr.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},Pr.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():Ir(this)},Pr.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||s(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(Xl){xt(Xl,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},Pr.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},Pr.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},Pr.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||_(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Rr={enumerable:!0,configurable:!0,get:D,set:D};function Hr(e,t,n){Rr.get=function(){return this[t][n]},Rr.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Rr)}function Br(e){e._watchers=[];var t=e.$options;t.props&&Ur(e,t.props),t.methods&&Gr(e,t.methods),t.data?zr(e):Je(e._data={},!0),t.computed&&Kr(e,t.computed),t.watch&&t.watch!==le&&Xr(e,t.watch)}function Ur(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[],o=!e.$parent;o||Be(!1);var a=function(o){i.push(o);var a=ft(o,t,n,e);Ke(r,o,a),o in e||Hr(e,"_props",o)};for(var s in t)a(s);Be(!0)}function zr(e){var t=e.$options.data;l(t=e._data="function"==typeof t?Vr(t,e):t||{})||(t={});for(var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);i--;){var o=n[i];0,r&&$(r,o)||K(o)||Hr(e,"_data",o)}Je(t,!0)}function Vr(e,t){Te();try{return e.call(t,t)}catch(Xl){return xt(Xl,t,"data()"),{}}finally{Ne()}}var Jr={lazy:!0};function Kr(e,t){var n=e._computedWatchers=Object.create(null),r=de();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;0,r||(n[i]=new Pr(e,a||D,D,Jr)),i in e||qr(e,i,o)}}function qr(e,t,n){var r=!de();"function"==typeof n?(Rr.get=r?Wr(t):Zr(n),Rr.set=D):(Rr.get=n.get?r&&!1!==n.cache?Wr(t):Zr(n.get):D,Rr.set=n.set||D),Object.defineProperty(e,t,Rr)}function Wr(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),Oe.target&&t.depend(),t.value}}function Zr(e){return function(){return e.call(this,this)}}function Gr(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?D:N(t[n],e)}function Xr(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)Yr(e,n,r[i]);else Yr(e,n,r)}}function Yr(e,t,n,r){return l(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=e[n]),e.$watch(t,n,r)}function Qr(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=qe,e.prototype.$delete=We,e.prototype.$watch=function(e,t,n){if(l(t))return Yr(this,e,t,n);(n=n||{}).user=!0;var r=new Pr(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(i){xt(i,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}var ei=0;function ti(e){e.prototype._init=function(e){var t=this;t._uid=ei++,t._isVue=!0,e&&e._isComponent?ni(t,e):t.$options=ut(ri(t.constructor),e||{},t),t._renderProxy=t,t._self=t,pr(t),rr(t),Wn(t),_r(t,"beforeCreate"),un(t),Br(t),cn(t),_r(t,"created"),t.$options.el&&t.$mount(t.$options.el)}}function ni(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}function ri(e){var t=e.options;if(e.super){var n=ri(e.super);if(n!==e.superOptions){e.superOptions=n;var r=ii(e);r&&E(e.extendOptions,r),(t=e.options=ut(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function ii(e){var t,n=e.options,r=e.sealedOptions;for(var i in n)n[i]!==r[i]&&(t||(t={}),t[i]=n[i]);return t}function oi(e){this._init(e)}function ai(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=j(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}function si(e){e.mixin=function(e){return this.options=ut(this.options,e),this}}function ci(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,i=e._Ctor||(e._Ctor={});if(i[r])return i[r];var o=e.name||n.options.name;var a=function(e){this._init(e)};return(a.prototype=Object.create(n.prototype)).constructor=a,a.cid=t++,a.options=ut(n.options,e),a.super=n,a.options.props&&ui(a),a.options.computed&&li(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,U.forEach(function(e){a[e]=n[e]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=e,a.sealedOptions=E({},a.options),i[r]=a,a}}function ui(e){var t=e.options.props;for(var n in t)Hr(e.prototype,"_props",n)}function li(e){var t=e.options.computed;for(var n in t)qr(e.prototype,n,t[n])}function fi(e){U.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&l(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}function pi(e){return e&&(e.Ctor.options.name||e.tag)}function di(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!f(e)&&e.test(t)}function vi(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=pi(a.componentOptions);s&&!t(s)&&hi(n,o,r,i)}}}function hi(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,_(n,t)}ti(oi),Qr(oi),cr(oi),dr(oi),Xn(oi);var mi=[String,RegExp,Array],yi={name:"keep-alive",abstract:!0,props:{include:mi,exclude:mi,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)hi(this.cache,e,this.keys)},mounted:function(){var e=this;this.$watch("include",function(t){vi(e,function(e){return di(t,e)})}),this.$watch("exclude",function(t){vi(e,function(e){return!di(t,e)})})},render:function(){var e=this.$slots.default,t=nr(e),n=t&&t.componentOptions;if(n){var r=pi(n),i=this.include,o=this.exclude;if(i&&(!r||!di(i,r))||o&&r&&di(o,r))return t;var a=this.cache,s=this.keys,c=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;a[c]?(t.componentInstance=a[c].componentInstance,_(s,c),s.push(c)):(a[c]=t,s.push(c),this.max&&s.length>parseInt(this.max)&&hi(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}},gi={KeepAlive:yi};function _i(e){var t={get:function(){return V}};Object.defineProperty(e,"config",t),e.util={warn:we,extend:E,mergeOptions:ut,defineReactive:Ke},e.set=qe,e.delete=We,e.nextTick=qt,e.observable=function(e){return Je(e),e},e.options=Object.create(null),U.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,E(e.options.components,gi),ai(e),si(e),ci(e),fi(e)}_i(oi),Object.defineProperty(oi.prototype,"$isServer",{get:de}),Object.defineProperty(oi.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(oi,"FunctionalRenderContext",{value:jn}),oi.version="2.6.11";var bi=m("style,class"),$i=m("input,textarea,option,select,progress"),wi=function(e,t,n){return"value"===n&&$i(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},xi=m("contenteditable,draggable,spellcheck"),Ci=m("events,caret,typing,plaintext-only"),Ai=function(e,t){return Ni(t)||"false"===t?"false":"contenteditable"===e&&Ci(t)?t:"true"},ki=m("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Oi="http://www.w3.org/1999/xlink",Si=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Ti=function(e){return Si(e)?e.slice(6,e.length):""},Ni=function(e){return null==e||!1===e};function ji(e){for(var t=e.data,n=e,i=e;r(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=Ei(i.data,t));for(;r(n=n.parent);)n&&n.data&&(t=Ei(t,n.data));return Mi(t.staticClass,t.class)}function Ei(e,t){return{staticClass:Di(e.staticClass,t.staticClass),class:r(e.class)?[e.class,t.class]:t.class}}function Mi(e,t){return r(e)||r(t)?Di(e,Li(t)):""}function Di(e,t){return e?t?e+" "+t:e:t||""}function Li(e){return Array.isArray(e)?Ii(e):s(e)?Fi(e):"string"==typeof e?e:""}function Ii(e){for(var t,n="",i=0,o=e.length;i<o;i++)r(t=Li(e[i]))&&""!==t&&(n&&(n+=" "),n+=t);return n}function Fi(e){var t="";for(var n in e)e[n]&&(t&&(t+=" "),t+=n);return t}var Pi={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Ri=m("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),Hi=m("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Bi=function(e){return"pre"===e},Ui=function(e){return Ri(e)||Hi(e)};function zi(e){return Hi(e)?"svg":"math"===e?"math":void 0}var Vi=Object.create(null);function Ji(e){if(!Y)return!0;if(Ui(e))return!1;if(e=e.toLowerCase(),null!=Vi[e])return Vi[e];var t=document.createElement(e);return e.indexOf("-")>-1?Vi[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Vi[e]=/HTMLUnknownElement/.test(t.toString())}var Ki=m("text,number,password,search,email,tel,url");function qi(e){if("string"==typeof e){var t=document.querySelector(e);return t||document.createElement("div")}return e}function Wi(e,t){var n=document.createElement(e);return"select"!==e?n:(t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)}function Zi(e,t){return document.createElementNS(Pi[e],t)}function Gi(e){return document.createTextNode(e)}function Xi(e){return document.createComment(e)}function Yi(e,t,n){e.insertBefore(t,n)}function Qi(e,t){e.removeChild(t)}function eo(e,t){e.appendChild(t)}function to(e){return e.parentNode}function no(e){return e.nextSibling}function ro(e){return e.tagName}function io(e,t){e.textContent=t}function oo(e,t){e.setAttribute(t,"")}var ao=Object.freeze({createElement:Wi,createElementNS:Zi,createTextNode:Gi,createComment:Xi,insertBefore:Yi,removeChild:Qi,appendChild:eo,parentNode:to,nextSibling:no,tagName:ro,setTextContent:io,setStyleScope:oo}),so={create:function(e,t){co(t)},update:function(e,t){e.data.ref!==t.data.ref&&(co(e,!0),co(t))},destroy:function(e){co(e,!0)}};function co(e,t){var n=e.data.ref;if(r(n)){var i=e.context,o=e.componentInstance||e.elm,a=i.$refs;t?Array.isArray(a[n])?_(a[n],o):a[n]===o&&(a[n]=void 0):e.data.refInFor?Array.isArray(a[n])?a[n].indexOf(o)<0&&a[n].push(o):a[n]=[o]:a[n]=o}}var uo=new je("",{},[]),lo=["create","activate","update","remove","destroy"];function fo(e,t){return e.key===t.key&&(e.tag===t.tag&&e.isComment===t.isComment&&r(e.data)===r(t.data)&&po(e,t)||i(e.isAsyncPlaceholder)&&e.asyncFactory===t.asyncFactory&&n(t.asyncFactory.error))}function po(e,t){if("input"!==e.tag)return!0;var n,i=r(n=e.data)&&r(n=n.attrs)&&n.type,o=r(n=t.data)&&r(n=n.attrs)&&n.type;return i===o||Ki(i)&&Ki(o)}function vo(e,t,n){var i,o,a={};for(i=t;i<=n;++i)r(o=e[i].key)&&(a[o]=i);return a}function ho(e){var t,o,s={},c=e.modules,u=e.nodeOps;for(t=0;t<lo.length;++t)for(s[lo[t]]=[],o=0;o<c.length;++o)r(c[o][lo[t]])&&s[lo[t]].push(c[o][lo[t]]);function l(e){var t=u.parentNode(e);r(t)&&u.removeChild(t,e)}function f(e,t,n,o,a,c,l){if(r(e.elm)&&r(c)&&(e=c[l]=Le(e)),e.isRootInsert=!a,!function(e,t,n,o){var a=e.data;if(r(a)){var c=r(e.componentInstance)&&a.keepAlive;if(r(a=a.hook)&&r(a=a.init)&&a(e,!1),r(e.componentInstance))return p(e,t),d(n,e.elm,o),i(c)&&function(e,t,n,i){var o,a=e;for(;a.componentInstance;)if(a=a.componentInstance._vnode,r(o=a.data)&&r(o=o.transition)){for(o=0;o<s.activate.length;++o)s.activate[o](uo,a);t.push(a);break}d(n,e.elm,i)}(e,t,n,o),!0}}(e,t,n,o)){var f=e.data,h=e.children,m=e.tag;r(m)?(e.elm=e.ns?u.createElementNS(e.ns,m):u.createElement(m,e),g(e),v(e,h,t),r(f)&&y(e,t),d(n,e.elm,o)):i(e.isComment)?(e.elm=u.createComment(e.text),d(n,e.elm,o)):(e.elm=u.createTextNode(e.text),d(n,e.elm,o))}}function p(e,t){r(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,h(e)?(y(e,t),g(e)):(co(e),t.push(e))}function d(e,t,n){r(e)&&(r(n)?u.parentNode(n)===e&&u.insertBefore(e,t,n):u.appendChild(e,t))}function v(e,t,n){if(Array.isArray(t)){0;for(var r=0;r<t.length;++r)f(t[r],n,e.elm,null,!0,t,r)}else a(e.text)&&u.appendChild(e.elm,u.createTextNode(String(e.text)))}function h(e){for(;e.componentInstance;)e=e.componentInstance._vnode;return r(e.tag)}function y(e,n){for(var i=0;i<s.create.length;++i)s.create[i](uo,e);r(t=e.data.hook)&&(r(t.create)&&t.create(uo,e),r(t.insert)&&n.push(e))}function g(e){var t;if(r(t=e.fnScopeId))u.setStyleScope(e.elm,t);else for(var n=e;n;)r(t=n.context)&&r(t=t.$options._scopeId)&&u.setStyleScope(e.elm,t),n=n.parent;r(t=ur)&&t!==e.context&&t!==e.fnContext&&r(t=t.$options._scopeId)&&u.setStyleScope(e.elm,t)}function _(e,t,n,r,i,o){for(;r<=i;++r)f(n[r],o,e,t,!1,n,r)}function b(e){var t,n,i=e.data;if(r(i))for(r(t=i.hook)&&r(t=t.destroy)&&t(e),t=0;t<s.destroy.length;++t)s.destroy[t](e);if(r(t=e.children))for(n=0;n<e.children.length;++n)b(e.children[n])}function $(e,t,n){for(;t<=n;++t){var i=e[t];r(i)&&(r(i.tag)?(w(i),b(i)):l(i.elm))}}function w(e,t){if(r(t)||r(e.data)){var n,i=s.remove.length+1;for(r(t)?t.listeners+=i:t=function(e,t){function n(){0==--n.listeners&&l(e)}return n.listeners=t,n}(e.elm,i),r(n=e.componentInstance)&&r(n=n._vnode)&&r(n.data)&&w(n,t),n=0;n<s.remove.length;++n)s.remove[n](e,t);r(n=e.data.hook)&&r(n=n.remove)?n(e,t):t()}else l(e.elm)}function x(e,t,n,i){for(var o=n;o<i;o++){var a=t[o];if(r(a)&&fo(e,a))return o}}function C(e,t,o,a,c,l){if(e!==t){r(t.elm)&&r(a)&&(t=a[c]=Le(t));var p=t.elm=e.elm;if(i(e.isAsyncPlaceholder))r(t.asyncFactory.resolved)?O(e.elm,t,o):t.isAsyncPlaceholder=!0;else if(i(t.isStatic)&&i(e.isStatic)&&t.key===e.key&&(i(t.isCloned)||i(t.isOnce)))t.componentInstance=e.componentInstance;else{var d,v=t.data;r(v)&&r(d=v.hook)&&r(d=d.prepatch)&&d(e,t);var m=e.children,y=t.children;if(r(v)&&h(t)){for(d=0;d<s.update.length;++d)s.update[d](e,t);r(d=v.hook)&&r(d=d.update)&&d(e,t)}n(t.text)?r(m)&&r(y)?m!==y&&function(e,t,i,o,a){var s,c,l,p=0,d=0,v=t.length-1,h=t[0],m=t[v],y=i.length-1,g=i[0],b=i[y],w=!a;for(;p<=v&&d<=y;)n(h)?h=t[++p]:n(m)?m=t[--v]:fo(h,g)?(C(h,g,o,i,d),h=t[++p],g=i[++d]):fo(m,b)?(C(m,b,o,i,y),m=t[--v],b=i[--y]):fo(h,b)?(C(h,b,o,i,y),w&&u.insertBefore(e,h.elm,u.nextSibling(m.elm)),h=t[++p],b=i[--y]):fo(m,g)?(C(m,g,o,i,d),w&&u.insertBefore(e,m.elm,h.elm),m=t[--v],g=i[++d]):(n(s)&&(s=vo(t,p,v)),n(c=r(g.key)?s[g.key]:x(g,t,p,v))?f(g,o,e,h.elm,!1,i,d):fo(l=t[c],g)?(C(l,g,o,i,d),t[c]=void 0,w&&u.insertBefore(e,l.elm,h.elm)):f(g,o,e,h.elm,!1,i,d),g=i[++d]);p>v?_(e,n(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(t,p,v)}(p,m,y,o,l):r(y)?(r(e.text)&&u.setTextContent(p,""),_(p,null,y,0,y.length-1,o)):r(m)?$(m,0,m.length-1):r(e.text)&&u.setTextContent(p,""):e.text!==t.text&&u.setTextContent(p,t.text),r(v)&&r(d=v.hook)&&r(d=d.postpatch)&&d(e,t)}}}function A(e,t,n){if(i(n)&&r(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o<t.length;++o)t[o].data.hook.insert(t[o])}var k=m("attrs,class,staticClass,staticStyle,key");function O(e,t,n,o){var a,s=t.tag,c=t.data,u=t.children;if(o=o||c&&c.pre,t.elm=e,i(t.isComment)&&r(t.asyncFactory))return t.isAsyncPlaceholder=!0,!0;if(r(c)&&(r(a=c.hook)&&r(a=a.init)&&a(t,!0),r(a=t.componentInstance)))return p(t,n),!0;if(r(s)){if(r(u))if(e.hasChildNodes())if(r(a=c)&&r(a=a.domProps)&&r(a=a.innerHTML)){if(a!==e.innerHTML)return!1}else{for(var l=!0,f=e.firstChild,d=0;d<u.length;d++){if(!f||!O(f,u[d],n,o)){l=!1;break}f=f.nextSibling}if(!l||f)return!1}else v(t,u,n);if(r(c)){var h=!1;for(var m in c)if(!k(m)){h=!0,y(t,n);break}!h&&c.class&&Zt(c.class)}}else e.data!==t.text&&(e.data=t.text);return!0}return function(e,t,o,a){if(!n(t)){var c,l=!1,p=[];if(n(e))l=!0,f(t,p);else{var d=r(e.nodeType);if(!d&&fo(e,t))C(e,t,p,null,null,a);else{if(d){if(1===e.nodeType&&e.hasAttribute(B)&&(e.removeAttribute(B),o=!0),i(o)&&O(e,t,p))return A(t,p,!0),e;c=e,e=new je(u.tagName(c).toLowerCase(),{},[],void 0,c)}var v=e.elm,m=u.parentNode(v);if(f(t,p,v._leaveCb?null:m,u.nextSibling(v)),r(t.parent))for(var y=t.parent,g=h(t);y;){for(var _=0;_<s.destroy.length;++_)s.destroy[_](y);if(y.elm=t.elm,g){for(var w=0;w<s.create.length;++w)s.create[w](uo,y);var x=y.data.hook.insert;if(x.merged)for(var k=1;k<x.fns.length;k++)x.fns[k]()}else co(y);y=y.parent}r(m)?$([e],0,0):r(e.tag)&&b(e)}}return A(t,p,l),t.elm}r(e)&&b(e)}}var mo={create:yo,update:yo,destroy:function(e){yo(e,uo)}};function yo(e,t){(e.data.directives||t.data.directives)&&go(e,t)}function go(e,t){var n,r,i,o=e===uo,a=t===uo,s=bo(e.data.directives,e.context),c=bo(t.data.directives,t.context),u=[],l=[];for(n in c)r=s[n],i=c[n],r?(i.oldValue=r.value,i.oldArg=r.arg,wo(i,"update",t,e),i.def&&i.def.componentUpdated&&l.push(i)):(wo(i,"bind",t,e),i.def&&i.def.inserted&&u.push(i));if(u.length){var f=function(){for(var n=0;n<u.length;n++)wo(u[n],"inserted",t,e)};o?en(t,"insert",f):f()}if(l.length&&en(t,"postpatch",function(){for(var n=0;n<l.length;n++)wo(l[n],"componentUpdated",t,e)}),!o)for(n in s)c[n]||wo(s[n],"unbind",e,e,a)}var _o=Object.create(null);function bo(e,t){var n,r,i=Object.create(null);if(!e)return i;for(n=0;n<e.length;n++)(r=e[n]).modifiers||(r.modifiers=_o),i[$o(r)]=r,r.def=lt(t.$options,"directives",r.name,!0);return i}function $o(e){return e.rawName||e.name+"."+Object.keys(e.modifiers||{}).join(".")}function wo(e,t,n,r,i){var o=e.def&&e.def[t];if(o)try{o(n.elm,e,n,r,i)}catch(Xl){xt(Xl,n.context,"directive "+e.name+" "+t+" hook")}}var xo=[so,mo];function Co(e,t){var i=t.componentOptions;if(!(r(i)&&!1===i.Ctor.options.inheritAttrs||n(e.data.attrs)&&n(t.data.attrs))){var o,a,s=t.elm,c=e.data.attrs||{},u=t.data.attrs||{};for(o in r(u.__ob__)&&(u=t.data.attrs=E({},u)),u)a=u[o],c[o]!==a&&Ao(s,o,a);for(o in(ne||ie)&&u.value!==c.value&&Ao(s,"value",u.value),c)n(u[o])&&(Si(o)?s.removeAttributeNS(Oi,Ti(o)):xi(o)||s.removeAttribute(o))}}function Ao(e,t,n){e.tagName.indexOf("-")>-1?ko(e,t,n):ki(t)?Ni(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):xi(t)?e.setAttribute(t,Ai(t,n)):Si(t)?Ni(n)?e.removeAttributeNS(Oi,Ti(t)):e.setAttributeNS(Oi,t,n):ko(e,t,n)}function ko(e,t,n){if(Ni(n))e.removeAttribute(t);else{if(ne&&!re&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var Oo={create:Co,update:Co};function So(e,t){var i=t.elm,o=t.data,a=e.data;if(!(n(o.staticClass)&&n(o.class)&&(n(a)||n(a.staticClass)&&n(a.class)))){var s=ji(t),c=i._transitionClasses;r(c)&&(s=Di(s,Li(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var To,No,jo,Eo,Mo,Do,Lo,Io={create:So,update:So},Fo=/[\w).+\-_$\]]/;function Po(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r<e.length;r++)if(n=t,t=e.charCodeAt(r),a)39===t&&92!==n&&(a=!1);else if(s)34===t&&92!==n&&(s=!1);else if(c)96===t&&92!==n&&(c=!1);else if(u)47===t&&92!==n&&(u=!1);else if(124!==t||124===e.charCodeAt(r+1)||124===e.charCodeAt(r-1)||l||f||p){switch(t){case 34:s=!0;break;case 39:a=!0;break;case 96:c=!0;break;case 40:p++;break;case 41:p--;break;case 91:f++;break;case 93:f--;break;case 123:l++;break;case 125:l--}if(47===t){for(var v=r-1,h=void 0;v>=0&&" "===(h=e.charAt(v));v--);h&&Fo.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r<o.length;r++)i=Ro(i,o[r]);return i}function Ro(e,t){var n=t.indexOf("(");if(n<0)return'_f("'+t+'")('+e+")";var r=t.slice(0,n),i=t.slice(n+1);return'_f("'+r+'")('+e+(")"!==i?","+i:i)}function Ho(e,t){console.error("[Vue compiler]: "+e)}function Bo(e,t){return e?e.map(function(e){return e[t]}).filter(function(e){return e}):[]}function Uo(e,t,n,r,i){(e.props||(e.props=[])).push(Yo({name:t,value:n,dynamic:i},r)),e.plain=!1}function zo(e,t,n,r,i){(i?e.dynamicAttrs||(e.dynamicAttrs=[]):e.attrs||(e.attrs=[])).push(Yo({name:t,value:n,dynamic:i},r)),e.plain=!1}function Vo(e,t,n,r){e.attrsMap[t]=n,e.attrsList.push(Yo({name:t,value:n},r))}function Jo(e,t,n,r,i,o,a,s){(e.directives||(e.directives=[])).push(Yo({name:t,rawName:n,value:r,arg:i,isDynamicArg:o,modifiers:a},s)),e.plain=!1}function Ko(e,t,n){return n?"_p("+t+',"'+e+'")':e+t}function qo(e,n,r,i,o,a,s,c){var u;(i=i||t).right?c?n="("+n+")==='click'?'contextmenu':("+n+")":"click"===n&&(n="contextmenu",delete i.right):i.middle&&(c?n="("+n+")==='click'?'mouseup':("+n+")":"click"===n&&(n="mouseup")),i.capture&&(delete i.capture,n=Ko("!",n,c)),i.once&&(delete i.once,n=Ko("~",n,c)),i.passive&&(delete i.passive,n=Ko("&",n,c)),i.native?(delete i.native,u=e.nativeEvents||(e.nativeEvents={})):u=e.events||(e.events={});var l=Yo({value:r.trim(),dynamic:c},s);i!==t&&(l.modifiers=i);var f=u[n];Array.isArray(f)?o?f.unshift(l):f.push(l):u[n]=f?o?[l,f]:[f,l]:l,e.plain=!1}function Wo(e,t){return e.rawAttrsMap[":"+t]||e.rawAttrsMap["v-bind:"+t]||e.rawAttrsMap[t]}function Zo(e,t,n){var r=Go(e,":"+t)||Go(e,"v-bind:"+t);if(null!=r)return Po(r);if(!1!==n){var i=Go(e,t);if(null!=i)return JSON.stringify(i)}}function Go(e,t,n){var r;if(null!=(r=e.attrsMap[t]))for(var i=e.attrsList,o=0,a=i.length;o<a;o++)if(i[o].name===t){i.splice(o,1);break}return n&&delete e.attrsMap[t],r}function Xo(e,t){for(var n=e.attrsList,r=0,i=n.length;r<i;r++){var o=n[r];if(t.test(o.name))return n.splice(r,1),o}}function Yo(e,t){return t&&(null!=t.start&&(e.start=t.start),null!=t.end&&(e.end=t.end)),e}function Qo(e,t,n){var r=n||{},i=r.number,o="$$v";r.trim&&(o="(typeof $$v === 'string'? $$v.trim(): $$v)"),i&&(o="_n("+o+")");var a=ea(t,o);e.model={value:"("+t+")",expression:JSON.stringify(t),callback:"function ($$v) {"+a+"}"}}function ea(e,t){var n=ta(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function ta(e){if(e=e.trim(),To=e.length,e.indexOf("[")<0||e.lastIndexOf("]")<To-1)return(Eo=e.lastIndexOf("."))>-1?{exp:e.slice(0,Eo),key:'"'+e.slice(Eo+1)+'"'}:{exp:e,key:null};for(No=e,Eo=Mo=Do=0;!ra();)ia(jo=na())?aa(jo):91===jo&&oa(jo);return{exp:e.slice(0,Mo),key:e.slice(Mo+1,Do)}}function na(){return No.charCodeAt(++Eo)}function ra(){return Eo>=To}function ia(e){return 34===e||39===e}function oa(e){var t=1;for(Mo=Eo;!ra();)if(ia(e=na()))aa(e);else if(91===e&&t++,93===e&&t--,0===t){Do=Eo;break}}function aa(e){for(var t=e;!ra()&&(e=na())!==t;);}var sa,ca="__r",ua="__c";function la(e,t,n){Lo=n;var r=t.value,i=t.modifiers,o=e.tag,a=e.attrsMap.type;if(e.component)return Qo(e,r,i),!1;if("select"===o)da(e,r,i);else if("input"===o&&"checkbox"===a)fa(e,r,i);else if("input"===o&&"radio"===a)pa(e,r,i);else if("input"===o||"textarea"===o)va(e,r,i);else{if(!V.isReservedTag(o))return Qo(e,r,i),!1}return!0}function fa(e,t,n){var r=n&&n.number,i=Zo(e,"value")||"null",o=Zo(e,"true-value")||"true",a=Zo(e,"false-value")||"false";Uo(e,"checked","Array.isArray("+t+")?_i("+t+","+i+")>-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),qo(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+ea(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+ea(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+ea(t,"$$c")+"}",null,!0)}function pa(e,t,n){var r=n&&n.number,i=Zo(e,"value")||"null";Uo(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),qo(e,"change",ea(t,i),null,!0)}function da(e,t,n){var r="var $$selectedVal = "+('Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(n&&n.number?"_n(val)":"val")+"})")+";";qo(e,"change",r=r+" "+ea(t,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),null,!0)}function va(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?ca:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=ea(t,l);c&&(f="if($event.target.composing)return;"+f),Uo(e,"value","("+t+")"),qo(e,u,f,null,!0),(s||a)&&qo(e,"blur","$forceUpdate()")}function ha(e){if(r(e[ca])){var t=ne?"change":"input";e[t]=[].concat(e[ca],e[t]||[]),delete e[ca]}r(e[ua])&&(e.change=[].concat(e[ua],e.change||[]),delete e[ua])}function ma(e,t,n){var r=sa;return function i(){null!==t.apply(null,arguments)&&_a(e,i,n,r)}}var ya=Rt&&!(ue&&Number(ue[1])<=53);function ga(e,t,n,r){if(ya){var i=Tr,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}sa.addEventListener(e,t,fe?{capture:n,passive:r}:n)}function _a(e,t,n,r){(r||sa).removeEventListener(e,t._wrapper||t,n)}function ba(e,t){if(!n(e.data.on)||!n(t.data.on)){var r=t.data.on||{},i=e.data.on||{};sa=t.elm,ha(r),Qt(r,i,ga,_a,ma,t.context),sa=void 0}}var $a,wa={create:ba,update:ba};function xa(e,t){if(!n(e.data.domProps)||!n(t.data.domProps)){var i,o,a=t.elm,s=e.data.domProps||{},c=t.data.domProps||{};for(i in r(c.__ob__)&&(c=t.data.domProps=E({},c)),s)i in c||(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(t.children&&(t.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i&&"PROGRESS"!==a.tagName){a._value=o;var u=n(o)?"":String(o);Ca(a,u)&&(a.value=u)}else if("innerHTML"===i&&Hi(a.tagName)&&n(a.innerHTML)){($a=$a||document.createElement("div")).innerHTML="<svg>"+o+"</svg>";for(var l=$a.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else if(o!==s[i])try{a[i]=o}catch(Xl){}}}}function Ca(e,t){return!e.composing&&("OPTION"===e.tagName||Aa(e,t)||ka(e,t))}function Aa(e,t){var n=!0;try{n=document.activeElement!==e}catch(Xl){}return n&&e.value!==t}function ka(e,t){var n=e.value,i=e._vModifiers;if(r(i)){if(i.number)return h(n)!==h(t);if(i.trim)return n.trim()!==t.trim()}return n!==t}var Oa={create:xa,update:xa},Sa=w(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function Ta(e){var t=Na(e.style);return e.staticStyle?E(e.staticStyle,t):t}function Na(e){return Array.isArray(e)?M(e):"string"==typeof e?Sa(e):e}function ja(e,t){var n,r={};if(t)for(var i=e;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=Ta(i.data))&&E(r,n);(n=Ta(e.data))&&E(r,n);for(var o=e;o=o.parent;)o.data&&(n=Ta(o.data))&&E(r,n);return r}var Ea,Ma=/^--/,Da=/\s*!important$/,La=function(e,t,n){if(Ma.test(t))e.style.setProperty(t,n);else if(Da.test(n))e.style.setProperty(O(t),n.replace(Da,""),"important");else{var r=Fa(t);if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++)e.style[r]=n[i];else e.style[r]=n}},Ia=["Webkit","Moz","ms"],Fa=w(function(e){if(Ea=Ea||document.createElement("div").style,"filter"!==(e=C(e))&&e in Ea)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<Ia.length;n++){var r=Ia[n]+t;if(r in Ea)return r}});function Pa(e,t){var i=t.data,o=e.data;if(!(n(i.staticStyle)&&n(i.style)&&n(o.staticStyle)&&n(o.style))){var a,s,c=t.elm,u=o.staticStyle,l=o.normalizedStyle||o.style||{},f=u||l,p=Na(t.data.style)||{};t.data.normalizedStyle=r(p.__ob__)?E({},p):p;var d=ja(t,!0);for(s in f)n(d[s])&&La(c,s,"");for(s in d)(a=d[s])!==f[s]&&La(c,s,null==a?"":a)}}var Ra={create:Pa,update:Pa},Ha=/\s+/;function Ba(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(Ha).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Ua(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(Ha).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function za(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&E(t,Va(e.name||"v")),E(t,e),t}return"string"==typeof e?Va(e):void 0}}var Va=w(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),Ja=Y&&!re,Ka="transition",qa="animation",Wa="transition",Za="transitionend",Ga="animation",Xa="animationend";Ja&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Wa="WebkitTransition",Za="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Ga="WebkitAnimation",Xa="webkitAnimationEnd"));var Ya=Y?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Qa(e){Ya(function(){Ya(e)})}function es(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),Ba(e,t))}function ts(e,t){e._transitionClasses&&_(e._transitionClasses,t),Ua(e,t)}function ns(e,t,n){var r=is(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===Ka?Za:Xa,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c<a&&u()},o+1),e.addEventListener(s,l)}var rs=/\b(transform|all)(,|$)/;function is(e,t){var n,r=window.getComputedStyle(e),i=(r[Wa+"Delay"]||"").split(", "),o=(r[Wa+"Duration"]||"").split(", "),a=os(i,o),s=(r[Ga+"Delay"]||"").split(", "),c=(r[Ga+"Duration"]||"").split(", "),u=os(s,c),l=0,f=0;return t===Ka?a>0&&(n=Ka,l=a,f=o.length):t===qa?u>0&&(n=qa,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?Ka:qa:null)?n===Ka?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===Ka&&rs.test(r[Wa+"Property"])}}function os(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max.apply(null,t.map(function(t,n){return as(t)+as(e[n])}))}function as(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}function ss(e,t){var i=e.elm;r(i._leaveCb)&&(i._leaveCb.cancelled=!0,i._leaveCb());var o=za(e.data.transition);if(!n(o)&&!r(i._enterCb)&&1===i.nodeType){for(var a=o.css,c=o.type,u=o.enterClass,l=o.enterToClass,f=o.enterActiveClass,p=o.appearClass,d=o.appearToClass,v=o.appearActiveClass,m=o.beforeEnter,y=o.enter,g=o.afterEnter,_=o.enterCancelled,b=o.beforeAppear,$=o.appear,w=o.afterAppear,x=o.appearCancelled,C=o.duration,A=ur,k=ur.$vnode;k&&k.parent;)A=k.context,k=k.parent;var O=!A._isMounted||!e.isRootInsert;if(!O||$||""===$){var S=O&&p?p:u,T=O&&v?v:f,N=O&&d?d:l,j=O&&b||m,E=O&&"function"==typeof $?$:y,M=O&&w||g,D=O&&x||_,L=h(s(C)?C.enter:C);0;var I=!1!==a&&!re,F=fs(E),P=i._enterCb=H(function(){I&&(ts(i,N),ts(i,T)),P.cancelled?(I&&ts(i,S),D&&D(i)):M&&M(i),i._enterCb=null});e.data.show||en(e,"insert",function(){var t=i.parentNode,n=t&&t._pending&&t._pending[e.key];n&&n.tag===e.tag&&n.elm._leaveCb&&n.elm._leaveCb(),E&&E(i,P)}),j&&j(i),I&&(es(i,S),es(i,T),Qa(function(){ts(i,S),P.cancelled||(es(i,N),F||(ls(L)?setTimeout(P,L):ns(i,c,P)))})),e.data.show&&(t&&t(),E&&E(i,P)),I||F||P()}}}function cs(e,t){var i=e.elm;r(i._enterCb)&&(i._enterCb.cancelled=!0,i._enterCb());var o=za(e.data.transition);if(n(o)||1!==i.nodeType)return t();if(!r(i._leaveCb)){var a=o.css,c=o.type,u=o.leaveClass,l=o.leaveToClass,f=o.leaveActiveClass,p=o.beforeLeave,d=o.leave,v=o.afterLeave,m=o.leaveCancelled,y=o.delayLeave,g=o.duration,_=!1!==a&&!re,b=fs(d),$=h(s(g)?g.leave:g);0;var w=i._leaveCb=H(function(){i.parentNode&&i.parentNode._pending&&(i.parentNode._pending[e.key]=null),_&&(ts(i,l),ts(i,f)),w.cancelled?(_&&ts(i,u),m&&m(i)):(t(),v&&v(i)),i._leaveCb=null});y?y(x):x()}function x(){w.cancelled||(!e.data.show&&i.parentNode&&((i.parentNode._pending||(i.parentNode._pending={}))[e.key]=e),p&&p(i),_&&(es(i,u),es(i,f),Qa(function(){ts(i,u),w.cancelled||(es(i,l),b||(ls($)?setTimeout(w,$):ns(i,c,w)))})),d&&d(i,w),_||b||w())}}function us(e,t,n){"number"!=typeof e?we("<transition> explicit "+t+" duration is not a valid number - got "+JSON.stringify(e)+".",n.context):isNaN(e)&&we("<transition> explicit "+t+" duration is NaN - the duration expression might be incorrect.",n.context)}function ls(e){return"number"==typeof e&&!isNaN(e)}function fs(e){if(n(e))return!1;var t=e.fns;return r(t)?fs(Array.isArray(t)?t[0]:t):(e._length||e.length)>1}function ps(e,t){!0!==t.data.show&&ss(t)}var ds=Y?{create:ps,activate:ps,remove:function(e,t){!0!==e.data.show?cs(e,t):t()}}:{},vs=[Oo,Io,wa,Oa,Ra,ds],hs=vs.concat(xo),ms=ho({nodeOps:ao,modules:hs});re&&document.addEventListener("selectionchange",function(){var e=document.activeElement;e&&e.vmodel&&Cs(e,"input")});var ys={inserted:function(e,t,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?en(n,"postpatch",function(){ys.componentUpdated(e,t,n)}):gs(e,t,n.context),e._vOptions=[].map.call(e.options,$s)):("textarea"===n.tag||Ki(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener("compositionstart",ws),e.addEventListener("compositionend",xs),e.addEventListener("change",xs),re&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){gs(e,t,n.context);var r=e._vOptions,i=e._vOptions=[].map.call(e.options,$s);if(i.some(function(e,t){return!P(e,r[t])}))(e.multiple?t.value.some(function(e){return bs(e,i)}):t.value!==t.oldValue&&bs(t.value,i))&&Cs(e,"change")}}};function gs(e,t,n){_s(e,t,n),(ne||ie)&&setTimeout(function(){_s(e,t,n)},0)}function _s(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=e.options.length;s<c;s++)if(a=e.options[s],i)o=R(r,$s(a))>-1,a.selected!==o&&(a.selected=o);else if(P($s(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function bs(e,t){return t.every(function(t){return!P(t,e)})}function $s(e){return"_value"in e?e._value:e.value}function ws(e){e.target.composing=!0}function xs(e){e.target.composing&&(e.target.composing=!1,Cs(e.target,"input"))}function Cs(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function As(e){return!e.componentInstance||e.data&&e.data.transition?e:As(e.componentInstance._vnode)}var ks={bind:function(e,t,n){var r=t.value,i=(n=As(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,ss(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=As(n)).data&&n.data.transition?(n.data.show=!0,r?ss(n,function(){e.style.display=e.__vOriginalDisplay}):cs(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}},Os={model:ys,show:ks},Ss={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Ts(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Ts(nr(t.children)):e}function Ns(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[C(o)]=i[o];return t}function js(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}function Es(e){for(;e=e.parent;)if(e.data.transition)return!0}function Ms(e,t){return t.key===e.key&&t.tag===e.tag}var Ds=function(e){return e.tag||tr(e)},Ls=function(e){return"show"===e.name},Is={name:"transition",props:Ss,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(Ds)).length){0;var r=this.mode;0;var i=n[0];if(Es(this.$vnode))return i;var o=Ts(i);if(!o)return i;if(this._leaving)return js(e,i);var s="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?s+"comment":s+o.tag:a(o.key)?0===String(o.key).indexOf(s)?o.key:s+o.key:o.key;var c=(o.data||(o.data={})).transition=Ns(this),u=this._vnode,l=Ts(u);if(o.data.directives&&o.data.directives.some(Ls)&&(o.data.show=!0),l&&l.data&&!Ms(o,l)&&!tr(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=E({},c);if("out-in"===r)return this._leaving=!0,en(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),js(e,i);if("in-out"===r){if(tr(o))return u;var p,d=function(){p()};en(c,"afterEnter",d),en(c,"enterCancelled",d),en(f,"delayLeave",function(e){p=e})}}return i}}},Fs=E({tag:String,moveClass:String},Ss);delete Fs.mode;var Ps={props:Fs,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=fr(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Ns(this),s=0;s<i.length;s++){var c=i[s];if(c.tag)if(null!=c.key&&0!==String(c.key).indexOf("__vlist"))o.push(c),n[c.key]=c,(c.data||(c.data={})).transition=a;else;}if(r){for(var u=[],l=[],f=0;f<r.length;f++){var p=r[f];p.data.transition=a,p.data.pos=p.elm.getBoundingClientRect(),n[p.key]?u.push(p):l.push(p)}this.kept=e(t,null,u),this.removed=l}return e(t,null,o)},updated:function(){var e=this.prevChildren,t=this.moveClass||(this.name||"v")+"-move";e.length&&this.hasMove(e[0].elm,t)&&(e.forEach(Rs),e.forEach(Hs),e.forEach(Bs),this._reflow=document.body.offsetHeight,e.forEach(function(e){if(e.data.moved){var n=e.elm,r=n.style;es(n,t),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(Za,n._moveCb=function e(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(Za,e),n._moveCb=null,ts(n,t))})}}))},methods:{hasMove:function(e,t){if(!Ja)return!1;if(this._hasMove)return this._hasMove;var n=e.cloneNode();e._transitionClasses&&e._transitionClasses.forEach(function(e){Ua(n,e)}),Ba(n,t),n.style.display="none",this.$el.appendChild(n);var r=is(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}};function Rs(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function Hs(e){e.data.newPos=e.elm.getBoundingClientRect()}function Bs(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}var Us={Transition:Is,TransitionGroup:Ps};oi.config.mustUseProp=wi,oi.config.isReservedTag=Ui,oi.config.isReservedAttr=bi,oi.config.getTagNamespace=zi,oi.config.isUnknownElement=Ji,E(oi.options.directives,Os),E(oi.options.components,Us),oi.prototype.__patch__=Y?ms:D,oi.prototype.$mount=function(e,t){return vr(this,e=e&&Y?qi(e):void 0,t)},Y&&setTimeout(function(){V.devtools&&ve&&ve.emit("init",oi)},0);var zs=/\{\{((?:.|\r?\n)+?)\}\}/g,Vs=/[-.*+?^${}()|[\]\/\\]/g,Js=w(function(e){var t=e[0].replace(Vs,"\\$&"),n=e[1].replace(Vs,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});function Ks(e,t){var n=t?Js(t):zs;if(n.test(e)){for(var r,i,o,a=[],s=[],c=n.lastIndex=0;r=n.exec(e);){(i=r.index)>c&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=Po(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c<e.length&&(s.push(o=e.slice(c)),a.push(JSON.stringify(o))),{expression:a.join("+"),tokens:s}}}function qs(e,t){t.warn;var n=Go(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Zo(e,"class",!1);r&&(e.classBinding=r)}function Ws(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}var Zs={staticKeys:["staticClass"],transformNode:qs,genData:Ws};function Gs(e,t){t.warn;var n=Go(e,"style");n&&(e.staticStyle=JSON.stringify(Sa(n)));var r=Zo(e,"style",!1);r&&(e.styleBinding=r)}function Xs(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}var Ys,Qs={staticKeys:["staticStyle"],transformNode:Gs,genData:Xs},ec={decode:function(e){return(Ys=Ys||document.createElement("div")).innerHTML=e,Ys.textContent}},tc=m("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),nc=m("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),rc=m("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),ic=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,oc=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ac="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+J.source+"]*",sc="((?:"+ac+"\\:)?"+ac+")",cc=new RegExp("^<"+sc),uc=/^\s*(\/?)>/,lc=new RegExp("^<\\/"+sc+"[^>]*>"),fc=/^<!DOCTYPE [^>]+>/i,pc=/^<!\--/,dc=/^<!\[/,vc=m("script,style,textarea",!0),hc={},mc={"&lt;":"<","&gt;":">","&quot;":'"',"&amp;":"&","&#10;":"\n","&#9;":"\t","&#39;":"'"},yc=/&(?:lt|gt|quot|amp|#39);/g,gc=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,_c=m("pre,textarea",!0),bc=function(e,t){return e&&_c(e)&&"\n"===t[0]};function $c(e,t){var n=t?gc:yc;return e.replace(n,function(e){return mc[e]})}function wc(e,t){for(var n,r,i=[],o=t.expectHTML,a=t.isUnaryTag||L,s=t.canBeLeftOpenTag||L,c=0;e;){if(n=e,r&&vc(r)){var u=0,l=r.toLowerCase(),f=hc[l]||(hc[l]=new RegExp("([\\s\\S]*?)(</"+l+"[^>]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,vc(l)||"noscript"===l||(n=n.replace(/<!\--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),bc(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,k(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(pc.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v),c,c+v+3),x(v+3);continue}}if(dc.test(e)){var h=e.indexOf("]>");if(h>=0){x(h+2);continue}}var m=e.match(fc);if(m){x(m[0].length);continue}var y=e.match(lc);if(y){var g=c;x(y[0].length),k(y[1],g,c);continue}var _=C();if(_){A(_),bc(_.tagName,e)&&x(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(lc.test($)||cc.test($)||pc.test($)||dc.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d)}d<0&&(b=e),b&&x(b.length),t.chars&&b&&t.chars(b,c-b.length,c)}if(e===n){t.chars&&t.chars(e);break}}function x(t){c+=t,e=e.substring(t)}function C(){var t=e.match(cc);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(x(t[0].length);!(n=e.match(uc))&&(r=e.match(oc)||e.match(ic));)r.start=c,x(r[0].length),r.end=c,i.attrs.push(r);if(n)return i.unarySlash=n[1],x(n[0].length),i.end=c,i}}function A(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&rc(n)&&k(r),s(n)&&r===n&&k(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p<l;p++){var d=e.attrs[p],v=d[3]||d[4]||d[5]||"",h="a"===n&&"href"===d[1]?t.shouldDecodeNewlinesForHref:t.shouldDecodeNewlines;f[p]={name:d[1],value:$c(v,h)}}u||(i.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:f,start:e.start,end:e.end}),r=n),t.start&&t.start(n,f,u,e.start,e.end)}function k(e,n,o){var a,s;if(null==n&&(n=c),null==o&&(o=c),e)for(s=e.toLowerCase(),a=i.length-1;a>=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}k()}var xc,Cc,Ac,kc,Oc,Sc,Tc,Nc,jc,Ec=/^@|^v-on:/,Mc=/^v-|^@|^:|^#/,Dc=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Lc=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Ic=/^\(|\)$/g,Fc=/^\[.*\]$/,Pc=/:(.*)$/,Rc=/^:|^\.|^v-bind:/,Hc=/\.[^.\]]+(?=[^\]]*$)/g,Bc=/^v-slot(:|$)|^#/,Uc=/[\r\n]/,zc=/\s+/g,Vc=/[\s"'<>\/=]/,Jc=w(ec.decode),Kc="_empty_";function qc(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:vu(t),rawAttrsMap:{},parent:n,children:[]}}function Wc(e,t){xc=t.warn||Ho,Sc=t.isPreTag||L,Tc=t.mustUseProp||L,Nc=t.getTagNamespace||L;var n=t.isReservedTag||L;jc=function(e){return!!e.component||!n(e.tag)},Ac=Bo(t.modules,"transformNode"),kc=Bo(t.modules,"preTransformNode"),Oc=Bo(t.modules,"postTransformNode"),Cc=t.delimiters;var r,i,o=[],a=!1!==t.preserveWhitespace,s=t.whitespace,c=!1,u=!1;function l(e){if(f(e),c||e.processed||(e=Xc(e,t)),o.length||e===r||r.if&&(e.elseif||e.else)&&ou(r,{exp:e.elseif,block:e}),i&&!e.forbidden)if(e.elseif||e.else)ru(e,i);else{if(e.slotScope){var n=e.slotTarget||'"default"';(i.scopedSlots||(i.scopedSlots={}))[n]=e}i.children.push(e),e.parent=i}e.children=e.children.filter(function(e){return!e.slotScope}),f(e),e.pre&&(c=!1),Sc(e.tag)&&(u=!1);for(var a=0;a<Oc.length;a++)Oc[a](e,t)}function f(e){if(!u)for(var t;(t=e.children[e.children.length-1])&&3===t.type&&" "===t.text;)e.children.pop()}return wc(e,{warn:xc,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,n,a,s,f){var p=i&&i.ns||Nc(e);ne&&"svg"===p&&(n=_u(n));var d=qc(e,n,i);p&&(d.ns=p),mu(d)&&!de()&&(d.forbidden=!0);for(var v=0;v<kc.length;v++)d=kc[v](d,t)||d;c||(Zc(d),d.pre&&(c=!0)),Sc(d.tag)&&(u=!0),c?Gc(d):d.processed||(eu(d),nu(d),au(d)),r||(r=d),a?l(d):(i=d,o.push(d))},end:function(e,t,n){var r=o[o.length-1];o.length-=1,i=o[o.length-1],l(r)},chars:function(e,t,n){if(i&&(!ne||"textarea"!==i.tag||i.attrsMap.placeholder!==e)){var r,o,l=i.children;if(e=u||e.trim()?hu(i)?e:Jc(e):l.length?s?"condense"===s&&Uc.test(e)?"":" ":a?" ":"":"")u||"condense"!==s||(e=e.replace(zc," ")),!c&&" "!==e&&(r=Ks(e,Cc))?o={type:2,expression:r.expression,tokens:r.tokens,text:e}:" "===e&&l.length&&" "===l[l.length-1].text||(o={type:3,text:e}),o&&l.push(o)}},comment:function(e,t,n){if(i){var r={type:3,text:e,isComment:!0};0,i.children.push(r)}}}),r}function Zc(e){null!=Go(e,"v-pre")&&(e.pre=!0)}function Gc(e){var t=e.attrsList,n=t.length;if(n)for(var r=e.attrs=new Array(n),i=0;i<n;i++)r[i]={name:t[i].name,value:JSON.stringify(t[i].value)},null!=t[i].start&&(r[i].start=t[i].start,r[i].end=t[i].end);else e.pre||(e.plain=!0)}function Xc(e,t){Yc(e),e.plain=!e.key&&!e.scopedSlots&&!e.attrsList.length,Qc(e),su(e),uu(e),lu(e);for(var n=0;n<Ac.length;n++)e=Ac[n](e,t)||e;return fu(e),e}function Yc(e){var t=Zo(e,"key");t&&(e.key=t)}function Qc(e){var t=Zo(e,"ref");t&&(e.ref=t,e.refInFor=pu(e))}function eu(e){var t;if(t=Go(e,"v-for")){var n=tu(t);n&&E(e,n)}}function tu(e){var t=e.match(Dc);if(t){var n={};n.for=t[2].trim();var r=t[1].trim().replace(Ic,""),i=r.match(Lc);return i?(n.alias=r.replace(Lc,"").trim(),n.iterator1=i[1].trim(),i[2]&&(n.iterator2=i[2].trim())):n.alias=r,n}}function nu(e){var t=Go(e,"v-if");if(t)e.if=t,ou(e,{exp:t,block:e});else{null!=Go(e,"v-else")&&(e.else=!0);var n=Go(e,"v-else-if");n&&(e.elseif=n)}}function ru(e,t){var n=iu(t.children);n&&n.if&&ou(n,{exp:e.elseif,block:e})}function iu(e){for(var t=e.length;t--;){if(1===e[t].type)return e[t];e.pop()}}function ou(e,t){e.ifConditions||(e.ifConditions=[]),e.ifConditions.push(t)}function au(e){null!=Go(e,"v-once")&&(e.once=!0)}function su(e){var t;"template"===e.tag?(t=Go(e,"scope"),e.slotScope=t||Go(e,"slot-scope")):(t=Go(e,"slot-scope"))&&(e.slotScope=t);var n=Zo(e,"slot");if(n&&(e.slotTarget='""'===n?'"default"':n,e.slotTargetDynamic=!(!e.attrsMap[":slot"]&&!e.attrsMap["v-bind:slot"]),"template"===e.tag||e.slotScope||zo(e,"slot",n,Wo(e,"slot"))),"template"===e.tag){var r=Xo(e,Bc);if(r){0;var i=cu(r),o=i.name,a=i.dynamic;e.slotTarget=o,e.slotTargetDynamic=a,e.slotScope=r.value||Kc}}else{var s=Xo(e,Bc);if(s){0;var c=e.scopedSlots||(e.scopedSlots={}),u=cu(s),l=u.name,f=u.dynamic,p=c[l]=qc("template",[],e);p.slotTarget=l,p.slotTargetDynamic=f,p.children=e.children.filter(function(e){if(!e.slotScope)return e.parent=p,!0}),p.slotScope=s.value||Kc,e.children=[],e.plain=!1}}}function cu(e){var t=e.name.replace(Bc,"");return t||"#"!==e.name[0]&&(t="default"),Fc.test(t)?{name:t.slice(1,-1),dynamic:!0}:{name:'"'+t+'"',dynamic:!1}}function uu(e){"slot"===e.tag&&(e.slotName=Zo(e,"name"))}function lu(e){var t;(t=Zo(e,"is"))&&(e.component=t),null!=Go(e,"inline-template")&&(e.inlineTemplate=!0)}function fu(e){var t,n,r,i,o,a,s,c,u=e.attrsList;for(t=0,n=u.length;t<n;t++){if(r=i=u[t].name,o=u[t].value,Mc.test(r))if(e.hasBindings=!0,(a=du(r.replace(Mc,"")))&&(r=r.replace(Hc,"")),Rc.test(r))r=r.replace(Rc,""),o=Po(o),(c=Fc.test(r))&&(r=r.slice(1,-1)),a&&(a.prop&&!c&&"innerHtml"===(r=C(r))&&(r="innerHTML"),a.camel&&!c&&(r=C(r)),a.sync&&(s=ea(o,"$event"),c?qo(e,'"update:"+('+r+")",s,null,!1,xc,u[t],!0):(qo(e,"update:"+C(r),s,null,!1,xc,u[t]),O(r)!==C(r)&&qo(e,"update:"+O(r),s,null,!1,xc,u[t])))),a&&a.prop||!e.component&&Tc(e.tag,e.attrsMap.type,r)?Uo(e,r,o,u[t],c):zo(e,r,o,u[t],c);else if(Ec.test(r))r=r.replace(Ec,""),(c=Fc.test(r))&&(r=r.slice(1,-1)),qo(e,r,o,a,!1,xc,u[t],c);else{var l=(r=r.replace(Mc,"")).match(Pc),f=l&&l[1];c=!1,f&&(r=r.slice(0,-(f.length+1)),Fc.test(f)&&(f=f.slice(1,-1),c=!0)),Jo(e,r,i,o,f,c,a,u[t])}else zo(e,r,JSON.stringify(o),u[t]),!e.component&&"muted"===r&&Tc(e.tag,e.attrsMap.type,r)&&Uo(e,r,"true",u[t])}}function pu(e){for(var t=e;t;){if(void 0!==t.for)return!0;t=t.parent}return!1}function du(e){var t=e.match(Hc);if(t){var n={};return t.forEach(function(e){n[e.slice(1)]=!0}),n}}function vu(e){for(var t={},n=0,r=e.length;n<r;n++)t[e[n].name]=e[n].value;return t}function hu(e){return"script"===e.tag||"style"===e.tag}function mu(e){return"style"===e.tag||"script"===e.tag&&(!e.attrsMap.type||"text/javascript"===e.attrsMap.type)}var yu=/^xmlns:NS\d+/,gu=/^NS\d+:/;function _u(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];yu.test(r.name)||(r.name=r.name.replace(gu,""),t.push(r))}return t}function bu(e,t){for(var n=e;n;)n.for&&n.alias===t&&xc("<"+e.tag+' v-model="'+t+'">: You are binding v-model directly to a v-for iteration alias. This will not be able to modify the v-for source array because writing to the alias is like modifying a function local variable. Consider using an array of objects and use v-model on an object property instead.',e.rawAttrsMap["v-model"]),n=n.parent}function $u(e,t){if("input"===e.tag){var n,r=e.attrsMap;if(!r["v-model"])return;if((r[":type"]||r["v-bind:type"])&&(n=Zo(e,"type")),r.type||n||!r["v-bind"]||(n="("+r["v-bind"]+").type"),n){var i=Go(e,"v-if",!0),o=i?"&&("+i+")":"",a=null!=Go(e,"v-else",!0),s=Go(e,"v-else-if",!0),c=wu(e);eu(c),Vo(c,"type","checkbox"),Xc(c,t),c.processed=!0,c.if="("+n+")==='checkbox'"+o,ou(c,{exp:c.if,block:c});var u=wu(e);Go(u,"v-for",!0),Vo(u,"type","radio"),Xc(u,t),ou(c,{exp:"("+n+")==='radio'"+o,block:u});var l=wu(e);return Go(l,"v-for",!0),Vo(l,":type",n),Xc(l,t),ou(c,{exp:i,block:l}),a?c.else=!0:s&&(c.elseif=s),c}}}function wu(e){return qc(e.tag,e.attrsList.slice(),e.parent)}var xu={preTransformNode:$u},Cu=[Zs,Qs,xu];function Au(e,t){t.value&&Uo(e,"textContent","_s("+t.value+")",t)}function ku(e,t){t.value&&Uo(e,"innerHTML","_s("+t.value+")",t)}var Ou,Su,Tu={model:la,text:Au,html:ku},Nu={expectHTML:!0,modules:Cu,directives:Tu,isPreTag:Bi,isUnaryTag:tc,mustUseProp:wi,canBeLeftOpenTag:nc,isReservedTag:Ui,getTagNamespace:zi,staticKeys:F(Cu)},ju=w(Mu);function Eu(e,t){e&&(Ou=ju(t.staticKeys||""),Su=t.isReservedTag||L,Du(e),Lu(e,!1))}function Mu(e){return m("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))}function Du(e){if(e.static=Iu(e),1===e.type){if(!Su(e.tag)&&"slot"!==e.tag&&null==e.attrsMap["inline-template"])return;for(var t=0,n=e.children.length;t<n;t++){var r=e.children[t];Du(r),r.static||(e.static=!1)}if(e.ifConditions)for(var i=1,o=e.ifConditions.length;i<o;i++){var a=e.ifConditions[i].block;Du(a),a.static||(e.static=!1)}}}function Lu(e,t){if(1===e.type){if((e.static||e.once)&&(e.staticInFor=t),e.static&&e.children.length&&(1!==e.children.length||3!==e.children[0].type))return void(e.staticRoot=!0);if(e.staticRoot=!1,e.children)for(var n=0,r=e.children.length;n<r;n++)Lu(e.children[n],t||!!e.for);if(e.ifConditions)for(var i=1,o=e.ifConditions.length;i<o;i++)Lu(e.ifConditions[i].block,t)}}function Iu(e){return 2!==e.type&&(3===e.type||!(!e.pre&&(e.hasBindings||e.if||e.for||y(e.tag)||!Su(e.tag)||Fu(e)||!Object.keys(e).every(Ou))))}function Fu(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}var Pu=/^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/,Ru=/\([^)]*?\);*$/,Hu=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Bu={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Uu={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},zu=function(e){return"if("+e+")return null;"},Vu={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:zu("$event.target !== $event.currentTarget"),ctrl:zu("!$event.ctrlKey"),shift:zu("!$event.shiftKey"),alt:zu("!$event.altKey"),meta:zu("!$event.metaKey"),left:zu("'button' in $event && $event.button !== 0"),middle:zu("'button' in $event && $event.button !== 1"),right:zu("'button' in $event && $event.button !== 2")};function Ju(e,t){var n=t?"nativeOn:":"on:",r="",i="";for(var o in e){var a=Ku(e[o]);e[o]&&e[o].dynamic?i+=o+","+a+",":r+='"'+o+'":'+a+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function Ku(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return Ku(e)}).join(",")+"]";var t=Hu.test(e.value),n=Pu.test(e.value),r=Hu.test(e.value.replace(Ru,""));if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(Vu[s])o+=Vu[s],Bu[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=zu(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=qu(a)),o&&(i+=o),"function($event){"+i+(t?"return "+e.value+"($event)":n?"return ("+e.value+")($event)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function qu(e){return"if(!$event.type.indexOf('key')&&"+e.map(Wu).join("&&")+")return null;"}function Wu(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Bu[e],r=Uu[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}function Zu(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}}function Gu(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}}var Xu={on:Zu,bind:Gu,cloak:D},Yu=function(e){this.options=e,this.warn=e.warn||Ho,this.transforms=Bo(e.modules,"transformCode"),this.dataGenFns=Bo(e.modules,"genData"),this.directives=E(E({},Xu),e.directives);var t=e.isReservedTag||L;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Qu(e,t){var n=new Yu(t);return{render:"with(this){return "+(e?el(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function el(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return tl(e,t);if(e.once&&!e.onceProcessed)return nl(e,t);if(e.for&&!e.forProcessed)return ol(e,t);if(e.if&&!e.ifProcessed)return rl(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return _l(e,t);var n;if(e.component)n=bl(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=al(e,t));var i=e.inlineTemplate?null:dl(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o<t.transforms.length;o++)n=t.transforms[o](e,n);return n}return dl(e,t)||"void 0"}function tl(e,t){e.staticProcessed=!0;var n=t.pre;return e.pre&&(t.pre=e.pre),t.staticRenderFns.push("with(this){return "+el(e,t)+"}"),t.pre=n,"_m("+(t.staticRenderFns.length-1)+(e.staticInFor?",true":"")+")"}function nl(e,t){if(e.onceProcessed=!0,e.if&&!e.ifProcessed)return rl(e,t);if(e.staticInFor){for(var n="",r=e.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?"_o("+el(e,t)+","+t.onceId+++","+n+")":el(e,t)}return tl(e,t)}function rl(e,t,n,r){return e.ifProcessed=!0,il(e.ifConditions.slice(),t,n,r)}function il(e,t,n,r){if(!e.length)return r||"_e()";var i=e.shift();return i.exp?"("+i.exp+")?"+o(i.block)+":"+il(e,t,n,r):""+o(i.block);function o(e){return n?n(e,t):e.once?nl(e,t):el(e,t)}}function ol(e,t,n,r){var i=e.for,o=e.alias,a=e.iterator1?","+e.iterator1:"",s=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+a+s+"){return "+(n||el)(e,t)+"})"}function al(e,t){var n="{",r=sl(e,t);r&&(n+=r+","),e.key&&(n+="key:"+e.key+","),e.ref&&(n+="ref:"+e.ref+","),e.refInFor&&(n+="refInFor:true,"),e.pre&&(n+="pre:true,"),e.component&&(n+='tag:"'+e.tag+'",');for(var i=0;i<t.dataGenFns.length;i++)n+=t.dataGenFns[i](e);if(e.attrs&&(n+="attrs:"+$l(e.attrs)+","),e.props&&(n+="domProps:"+$l(e.props)+","),e.events&&(n+=Ju(e.events,!1)+","),e.nativeEvents&&(n+=Ju(e.nativeEvents,!0)+","),e.slotTarget&&!e.slotScope&&(n+="slot:"+e.slotTarget+","),e.scopedSlots&&(n+=ul(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var o=cl(e,t);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+$l(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function sl(e,t){var n=e.directives;if(n){var r,i,o,a,s="directives:[",c=!1;for(r=0,i=n.length;r<i;r++){o=n[r],a=!0;var u=t.directives[o.name];u&&(a=!!u(e,o,t.warn)),a&&(c=!0,s+='{name:"'+o.name+'",rawName:"'+o.rawName+'"'+(o.value?",value:("+o.value+"),expression:"+JSON.stringify(o.value):"")+(o.arg?",arg:"+(o.isDynamicArg?o.arg:'"'+o.arg+'"'):"")+(o.modifiers?",modifiers:"+JSON.stringify(o.modifiers):"")+"},")}return c?s.slice(0,-1)+"]":void 0}}function cl(e,t){var n=e.children[0];if(n&&1===n.type){var r=Qu(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map(function(e){return"function(){"+e+"}"}).join(",")+"]}"}}function ul(e,t,n){var r=e.for||Object.keys(t).some(function(e){var n=t[e];return n.slotTargetDynamic||n.if||n.for||fl(n)}),i=!!e.if;if(!r)for(var o=e.parent;o;){if(o.slotScope&&o.slotScope!==Kc||o.for){r=!0;break}o.if&&(i=!0),o=o.parent}var a=Object.keys(t).map(function(e){return pl(t[e],n)}).join(",");return"scopedSlots:_u(["+a+"]"+(r?",null,true":"")+(!r&&i?",null,false,"+ll(a):"")+")"}function ll(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0}function fl(e){return 1===e.type&&("slot"===e.tag||e.children.some(fl))}function pl(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return rl(e,t,pl,"null");if(e.for&&!e.forProcessed)return ol(e,t,pl);var r=e.slotScope===Kc?"":String(e.slotScope),i="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(dl(e,t)||"undefined")+":undefined":dl(e,t)||"undefined":el(e,t))+"}",o=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+i+o+"}"}function dl(e,t,n,r,i){var o=e.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?t.maybeComponent(a)?",1":",0":"";return""+(r||el)(a,t)+s}var c=n?vl(o,t.maybeComponent):0,u=i||ml;return"["+o.map(function(e){return u(e,t)}).join(",")+"]"+(c?","+c:"")}}function vl(e,t){for(var n=0,r=0;r<e.length;r++){var i=e[r];if(1===i.type){if(hl(i)||i.ifConditions&&i.ifConditions.some(function(e){return hl(e.block)})){n=2;break}(t(i)||i.ifConditions&&i.ifConditions.some(function(e){return t(e.block)}))&&(n=1)}}return n}function hl(e){return void 0!==e.for||"template"===e.tag||"slot"===e.tag}function ml(e,t){return 1===e.type?el(e,t):3===e.type&&e.isComment?gl(e):yl(e)}function yl(e){return"_v("+(2===e.type?e.expression:wl(JSON.stringify(e.text)))+")"}function gl(e){return"_e("+JSON.stringify(e.text)+")"}function _l(e,t){var n=e.slotName||'"default"',r=dl(e,t),i="_t("+n+(r?","+r:""),o=e.attrs||e.dynamicAttrs?$l((e.attrs||[]).concat(e.dynamicAttrs||[]).map(function(e){return{name:C(e.name),value:e.value,dynamic:e.dynamic}})):null,a=e.attrsMap["v-bind"];return!o&&!a||r||(i+=",null"),o&&(i+=","+o),a&&(i+=(o?"":",null")+","+a),i+")"}function bl(e,t,n){var r=t.inlineTemplate?null:dl(t,n,!0);return"_c("+e+","+al(t,n)+(r?","+r:"")+")"}function $l(e){for(var t="",n="",r=0;r<e.length;r++){var i=e[r],o=wl(i.value);i.dynamic?n+=i.name+","+o+",":t+='"'+i.name+'":'+o+","}return t="{"+t.slice(0,-1)+"}",n?"_d("+t+",["+n.slice(0,-1)+"])":t}function wl(e){return e.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}var xl=new RegExp("\\b"+"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments".split(",").join("\\b|\\b")+"\\b"),Cl=new RegExp("\\b"+"delete,typeof,void".split(",").join("\\s*\\([^\\)]*\\)|\\b")+"\\s*\\([^\\)]*\\)"),Al=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;function kl(e,t){e&&Ol(e,t)}function Ol(e,t){if(1===e.type){for(var n in e.attrsMap)if(Mc.test(n)){var r=e.attrsMap[n];if(r){var i=e.rawAttrsMap[n];"v-for"===n?Tl(e,'v-for="'+r+'"',t,i):"v-slot"===n||"#"===n[0]?El(r,n+'="'+r+'"',t,i):Ec.test(n)?Sl(r,n+'="'+r+'"',t,i):jl(r,n+'="'+r+'"',t,i)}}if(e.children)for(var o=0;o<e.children.length;o++)Ol(e.children[o],t)}else 2===e.type&&jl(e.expression,e.text,t,e)}function Sl(e,t,n,r){var i=e.replace(Al,""),o=i.match(Cl);o&&"$"!==i.charAt(o.index-1)&&n('avoid using JavaScript unary operator as property name: "'+o[0]+'" in expression '+t.trim(),r),jl(e,t,n,r)}function Tl(e,t,n,r){jl(e.for||"",t,n,r),Nl(e.alias,"v-for alias",t,n,r),Nl(e.iterator1,"v-for iterator",t,n,r),Nl(e.iterator2,"v-for iterator",t,n,r)}function Nl(e,t,n,r,i){if("string"==typeof e)try{new Function("var "+e+"=_")}catch(Xl){r("invalid "+t+' "'+e+'" in expression: '+n.trim(),i)}}function jl(e,t,n,r){try{new Function("return "+e)}catch(Xl){var i=e.replace(Al,"").match(xl);n(i?'avoid using JavaScript keyword as property name: "'+i[0]+'"\n Raw expression: '+t.trim():"invalid expression: "+Xl.message+" in\n\n "+e+"\n\n Raw expression: "+t.trim()+"\n",r)}}function El(e,t,n,r){try{new Function(e,"")}catch(Xl){n("invalid function parameter expression: "+Xl.message+" in\n\n "+e+"\n\n Raw expression: "+t.trim()+"\n",r)}}var Ml=2;function Dl(e,t,n){void 0===t&&(t=0),void 0===n&&(n=e.length);for(var r=e.split(/\r?\n/),i=0,o=[],a=0;a<r.length;a++)if((i+=r[a].length+1)>=t){for(var s=a-Ml;s<=a+Ml||n>i;s++)if(!(s<0||s>=r.length)){o.push(""+(s+1)+Ll(" ",3-String(s+1).length)+"| "+r[s]);var c=r[s].length;if(s===a){var u=t-(i-c)+1,l=n>i?c-u:n-t;o.push(" | "+Ll(" ",u)+Ll("^",l))}else if(s>a){if(n>i){var f=Math.min(n-i,c);o.push(" | "+Ll("^",f))}i+=c+1}}break}return o.join("\n")}function Ll(e,t){var n="";if(t>0)for(;1&t&&(n+=e),!((t>>>=1)<=0);)e+=e;return n}function Il(e,t){try{return new Function(e)}catch(n){return t.push({err:n,code:e}),D}}function Fl(e){var t=Object.create(null);return function(n,r,i){(r=E({},r)).warn;delete r.warn;var o=r.delimiters?String(r.delimiters)+n:n;if(t[o])return t[o];var a=e(n,r);var s={},c=[];return s.render=Il(a.render,c),s.staticRenderFns=a.staticRenderFns.map(function(e){return Il(e,c)}),t[o]=s}}function Pl(e){return function(t){function n(n,r){var i=Object.create(t),o=[],a=[],s=function(e,t,n){(n?a:o).push(e)};if(r)for(var c in r.modules&&(i.modules=(t.modules||[]).concat(r.modules)),r.directives&&(i.directives=E(Object.create(t.directives||null),r.directives)),r)"modules"!==c&&"directives"!==c&&(i[c]=r[c]);i.warn=s;var u=e(n.trim(),i);return u.errors=o,u.tips=a,u}return{compile:n,compileToFunctions:Fl(n)}}}var Rl,Hl=Pl(function(e,t){var n=Wc(e.trim(),t);!1!==t.optimize&&Eu(n,t);var r=Qu(n,t);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}}),Bl=Hl(Nu),Ul=Bl.compile,zl=Bl.compileToFunctions;function Vl(e){return(Rl=Rl||document.createElement("div")).innerHTML=e?'<a href="\n"/>':'<div a="\n"/>',Rl.innerHTML.indexOf("&#10;")>0}var Jl=!!Y&&Vl(!1),Kl=!!Y&&Vl(!0),ql=w(function(e){var t=qi(e);return t&&t.innerHTML}),Wl=oi.prototype.$mount;function Zl(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}oi.prototype.$mount=function(e,t){if((e=e&&qi(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=ql(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=Zl(e));if(r){0;var i=zl(r,{outputSourceRange:!1,shouldDecodeNewlines:Jl,shouldDecodeNewlinesForHref:Kl,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return Wl.call(this,e,t)},oi.compile=zl;var Gl=oi;exports.default=Gl;
4
  },{}],"WZJa":[function(require,module,exports) {
5
  "use strict";function t(){var t={},o={};return{addControlScript:function(o,r){t[o]=r},callControlScript:function(o,r){if(!t[o])throw new Error("Called control element not found: [".concat(o,"]"));t[o](r)},setControlData:function(t,r){o[t]=r},getControlData:function(t){if(!o[t])throw new Error("Control data for [".concat(t,"] not found."));return o[t]}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var o=t();exports.default=o;
 
 
6
  },{}],"WV0h":[function(require,module,exports) {
7
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:["relativeElement","forceHide"],data:function(){return{listening:!1}},watch:{relativeElement:function(){this.relativeElement&&!this.listening&&(this.relativeElement.addEventListener("scroll",this.handleScroll),this.handleScroll(),this.listening=!0)}},methods:{handleScroll:function(){if(!this.forceHide){var e=this.relativeElement.scrollTop,t=this.$refs.observerElement.offsetTop;e+this.relativeElement.clientHeight>=t&&this.$emit("visible")}}}};exports.default=e;
8
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this.$createElement;return(this._self._c||e)("div",{ref:"observerElement"},[this._t("default")],2)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
9
- },{}],"wvh1":[function(require,module,exports) {
10
  "use strict";function e(e,t){var u=null;switch(t){case"dataset":default:u=e.dataset}return u}function t(t){var u=t.query,a=t.type,r=t.key,n=document.querySelector(u),l=e(n,a);if(l)return{element:n,value:l[r],type:a,key:r};throw new Error("no related operation found with a type of [".concat(a,"]"))}function u(t,u){var a=t.element,r=t.type,n=t.key;e(a,r)[n]=u}function a(e,t){e.map(function(e){u(e,t)})}function r(e){var u={elements:[],startupValue:null};return e.map(function(e){var a=t(e);u.elements.push(t(e)),e.useAsStartup&&(u.startupValue=a)}),u.startupValue||(u.startupValue=u.elements[0].value),u}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var n={getTargetValue:t,getAllValues:r,setTargetValue:u,setAllValues:a};exports.default=n;
11
  },{}],"LTB1":[function(require,module,exports) {
12
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("../functions/selector"));function t(e){return e&&e.__esModule?e:{default:e}}var a={props:{label:String,selectors:{type:Array,required:!1,default:function(){return[]}}},data:function(){return{startupValue:null,targetElements:[],elementMainValue:"",mountedDataUpdate:!1}},mounted:function(){if(this.selectors.length>0){var t=e.default.getAllValues(this.selectors);this.targetElements=t.elements,this.startupValue=t.startupValue}},methods:{assignDefaultValue:function(){this.startupValue&&(this.mountedDataUpdate=!0,this.elementMainValue=this.startupValue)},setTargetValue:function(t,a){e.default.setTargetValue(t,a)},setAllValues:function(t){e.default.setAllValues(this.targetElements,t)},setTableDirty:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.mountedDataUpdate||(new WPTB_TableStateSaveManager).tableStateSet(),this.mountedDataUpdate=!1}}},u=a;exports.default=u;
13
  },{"../functions/selector":"wvh1"}],"DTps":[function(require,module,exports) {
14
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("../components/IntersectionObserver")),t=n(require("../mixins/ControlBase"));function n(e){return e&&e.__esModule?e:{default:e}}var r={props:{label:String,icons:Object,perPage:{type:Number,default:20}},mixins:[t.default],components:{IntersectionObserver:e.default},data:function(){return{selectedIcon:{url:null,name:null},openDrawer:!1,innerDrawerRef:null,paginationIndex:1,observerHide:!1,debunkedFilterText:"",debunkId:-1,filterText:"",drawerPosition:{left:0}}},mounted:function(){var e=this;document.addEventListener("keyup",function(t){"Escape"===t.code&&e.openDrawer&&e.setDrawerState(!1)});var t=this.startupValue;this.selectedIcon.name=""===t?null:t,this.selectedIcon.url=""===t?null:this.icons[t]},watch:{debunkedFilterText:function(e){var t=this;clearTimeout(this.debunkId),this.debunkId=setTimeout(function(){t.filterText=e},500)},selectedIcon:{handler:function(){var e=this,t=this.targetElements[0].element;t&&(this.selectedIcon.url?fetch(this.selectedIcon.url).then(function(e){return e.text()}).then(function(n){e.setTargetValue(e.targetElements[0],e.selectedIcon.name),t.innerHTML="";var r=document.createRange();r.setStart(t,0);var i=r.createContextualFragment(n);t.appendChild(i)}):(t.dataset.wptbButtonIconSrc="",t.innerHTML=""))},deep:!0}},methods:{setDrawerState:function(e){this.openDrawer=e},fullIconList:function(){var e=this;return Object.keys(this.icons).filter(function(t){return t.includes(e.filterText)}).slice(0,this.paginationIndex*this.perPage).reduce(function(t,n){return t[n]=e.icons[n],t},{})},toggleIconDrawer:function(){this.calculateDrawerPosition(),this.openDrawer=!this.openDrawer,this.innerDrawerRef=this.$refs.drawerRefElement},setIcon:function(e,t){this.selectedIcon.url=t,this.selectedIcon.name=e,this.toggleIconDrawer(),this.setTableDirty()},observerVisible:function(){this.paginationIndex+=1},calculateDrawerPosition:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=this.$refs.iconSelectButton.getBoundingClientRect(),n=t.x+t.width+e,r=t.y;this.drawerPosition.top=this.toPx(r),this.drawerPosition.left=this.toPx(n)},toPx:function(e){return"".concat(e,"px")}}};exports.default=r;
15
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"wptb-settings-row wptb-settings-middle-xs"},[i("div",{staticClass:"wptb-settings-space-between"},[i("p",{staticClass:"wptb-settings-item-title"},[e._v(e._s(e.label))]),e._v(" "),i("div",{staticClass:"wptb-icon-select-wrapper"},[i("div",{staticClass:"wptb-icon-select-display"},[i("div",{ref:"iconSelectButton",staticClass:"wptb-icon-select-preview",on:{click:e.toggleIconDrawer}},[i("img",{attrs:{src:e.selectedIcon.url}})]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.openDrawer,expression:"openDrawer"}],staticClass:"wptb-icon-select-drawer wptb-plugin-box-shadow-md",style:e.drawerPosition},[i("div",{staticClass:"wptb-icon-search-wrapper"},[i("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.debunkedFilterText,expression:"debunkedFilterText",modifiers:{trim:!0}}],attrs:{type:"text",placeholder:"Search for icons..."},domProps:{value:e.debunkedFilterText},on:{input:function(t){t.target.composing||(e.debunkedFilterText=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),i("div",{ref:"drawerRefElement",staticClass:"wptb-icon-previews"},[i("div",{staticClass:"wptb-icon-select-drawer-preview wptb-icon-reset",on:{click:function(t){return e.setIcon("","")}}}),e._v(" "),e._l(e.fullIconList(),function(t,s){return i("div",{key:s,staticClass:"wptb-icon-select-drawer-preview",class:{"wptb-icon-preview-active":e.selectedIcon.name===s}},[i("img",{attrs:{src:t,title:s},on:{click:function(i){return e.setIcon(s,t)}}})])}),e._v(" "),i("intersection-observer",{attrs:{"relative-element":e.innerDrawerRef,"force-hide":e.observerHide},on:{visible:e.observerVisible}},[i("div",{staticClass:"wptb-icon-select-drawer-end"})])],2)])])])])])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
16
- },{"../components/IntersectionObserver":"WV0h","../mixins/ControlBase":"LTB1"}],"Pn7d":[function(require,module,exports) {
17
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("vue")),t=n(require("../functions/WPTB_ControlsManager")),o=n(require("../containers/IconSelectControl"));function n(e){return e&&e.__esModule?e:{default:e}}var r={name:"ControlIconSelect",handler:function(n){var r=t.default.getControlData(n);new e.default({data:r,components:{IconSelectControl:o.default}}).$mount("#".concat(n))}};exports.default=r;
18
  },{"vue":"HYXJ","../functions/WPTB_ControlsManager":"WZJa","../containers/IconSelectControl":"DTps"}],"W4BN":[function(require,module,exports) {
19
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("../mixins/ControlBase"));function t(e){return e&&e.__esModule?e:{default:e}}var u={props:{min:{type:Number,default:1,required:!1},max:{type:Number,default:10,required:!1},step:{type:Number,default:1,required:!1},defaultValue:{type:Number,default:1,required:!1}},mixins:[e.default],data:function(){return{elementMainValue:this.defaultValue}},mounted:function(){this.assignDefaultValue()},watch:{elementMainValue:function(e){var t=this.clampValue(e);this.setTargetValue(this.targetElements[0],t),this.setTableDirty(!0)}},methods:{clampValue:function(e){return e<this.min?this.min:e>this.max?this.max:e}}};exports.default=u;
20
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticClass:"wptb-settings-item-header"},[e._v(e._s(e.label))]),e._v(" "),n("div",{staticClass:"wptb-settings-row wptb-settings-middle-xs"},[n("div",{staticClass:"wptb-settings-col-xs-8"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.elementMainValue,expression:"elementMainValue"}],staticClass:"wptb-element-property wptb-size-slider",attrs:{type:"range",min:e.min,max:e.max,step:e.step},domProps:{value:e.elementMainValue},on:{__r:function(t){e.elementMainValue=t.target.value}}})]),e._v(" "),n("div",{staticClass:"wptb-settings-col-xs-4"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.elementMainValue,expression:"elementMainValue"}],staticClass:"wptb-size-number wptb-number-input wptb-element-property",attrs:{type:"number",min:e.min,max:e.max,step:e.step},domProps:{value:e.elementMainValue},on:{input:function(t){t.target.composing||(e.elementMainValue=t.target.value)}}})])])])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
21
- },{"../mixins/ControlBase":"LTB1"}],"YVYX":[function(require,module,exports) {
22
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("vue")),t=o(require("../containers/RangeControl")),n=o(require("../functions/WPTB_ControlsManager"));function o(e){return e&&e.__esModule?e:{default:e}}var r={name:"ControlRange",handler:function(o){var r=n.default.getControlData(o);new e.default({data:r,components:{RangeControl:t.default}}).$mount("#".concat(o))}};exports.default=r;
23
  },{"vue":"HYXJ","../containers/RangeControl":"W4BN","../functions/WPTB_ControlsManager":"WZJa"}],"qsi5":[function(require,module,exports) {
24
  "use strict";function e(){var e={};return function(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2e3;Object.keys(e).includes(t)&&clearTimeout(e[t]),e[t]=setTimeout(r,o)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e();exports.default=t;
25
  },{}],"cW6v":[function(require,module,exports) {
26
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("../functions/DeBouncer"));function t(e){return e&&e.__esModule?e:{default:e}}var i={props:{clone:{type:Boolean,default:!1,required:!1},cloneQuery:{type:String,required:!0},tableDirectives:{type:String,default:""},tableStyle:{type:Object,default:function(){}}},inheritAttrs:!1,data:function(){return{cloneInner:!1,clonedTable:null,mainTable:null,tableDirectiveDatasetId:"wptbResponsiveDirectives",tableHaveDirectives:!1}},mounted:function(){this.cloneInner=this.clone},watch:{clone:function(e){this.cloneInner=e},cloneInner:function(e){e&&(this.startClone(),this.cloneInner=!1)},tableDirectives:function(e){e&&this.addDirectivesToTable(e)},"appOptions.identifyCells":{handler:function(e){e&&(this.showCellIdentification(),this.appOptions.identifyCells=!1)}},"directives.responsiveEnabled":{handler:function(e){e&&(this.mainTable.dataset.wptbAdaptiveTable=0)}}},methods:{startClone:function(){if(this.mainTable=document.querySelector(this.cloneQuery),!this.mainTable)throw new Error("no clone target is found with a query value of ".concat(this.cloneQuery));this.appOptions.hasLegacyResponsive="1"===this.mainTable.dataset.wptbAdaptiveTable,this.clonedTable=this.mainTable.cloneNode(!0),this.clonedTable.classList.add("wptb-plugin-box-shadow-xl"),this.$refs.tableClone.appendChild(this.clonedTable);var e=this.mainTable.dataset[this.tableDirectiveDatasetId];this.tableDirectives&&this.addDirectivesToTable(this.tableDirectives),this.tableHaveDirectives=void 0!==e,this.setupCellIdentification(this.clonedTable),this.$emit("tableCloned",e)},addDirectivesToTable:function(e){this.clonedTable&&this.mainTable&&(this.clonedTable.dataset[this.tableDirectiveDatasetId]=e,this.mainTable.dataset[this.tableDirectiveDatasetId]=e,this.$emit("directivesCopied",this.tableHaveDirectives),this.tableHaveDirectives=!1)},setupCellIdentification:function(e){Array.from(e.querySelectorAll("td")).map(function(e,t){"relative"!==getComputedStyle(e).position&&(e.style.position="relative");var i=document.createRange();i.setStart(e,0);var a="background-color: hsla(211, 25%, ".concat(t%2==0?70:90,"%, 80%)"),n='<div class="wptb-responsive-cell-identifier" style="'.concat(a,'">').concat(t+1,"</div>"),l=i.createContextualFragment(n);e.appendChild(l.childNodes[0])})},showCellIdentification:function(){var t=this;this.clonedTable.classList.add("wptb-responsive-show-cell-identifier"),(0,e.default)("cellIdentification",function(){t.clonedTable.classList.remove("wptb-responsive-show-cell-identifier")},2e3)}}};exports.default=i;
27
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"wptb-responsive-clone-wrapper"},[t("div",{staticClass:"wptb-responsive-clone-inner-wrapper"},[t("div",{ref:"tableClone",style:this.tableStyle})])])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
28
- },{"../functions/DeBouncer":"qsi5"}],"h0P7":[function(require,module,exports) {
29
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={inheritAttrs:!1,props:{postFix:{type:String,default:""},value:{type:null,default:0},enableDynamicWidth:{type:Boolean,default:!1},dynamicWidthPadding:{type:Number,default:3},onlyEnter:{type:Boolean,default:!1},min:{type:Number,default:0},max:{type:Number,default:1e3},enableLimit:{type:Boolean,default:!1}},model:{prop:"value",event:"valueChanged"},watch:{value:function(t){this.innerValue=t}},data:function(){return{innerValue:0}},mounted:function(){this.innerValue=this.value},computed:{postFixIt:function(){return"".concat(this.innerValue).concat(this.postFix)},dynamicWidth:function(){return this.enableDynamicWidth?{width:"calc(".concat(this.innerValue.toString().length+this.postFix.length+this.dynamicWidthPadding,"ch) !important")}:{}}},methods:{getValue:function(t){var e=Number.parseInt(t,10);return e=isNaN(e)?0:e,this.enableLimit?this.limitValue(e):e},limitValue:function(t){return t<this.min?this.min:t>this.max?this.max:t},handleOnInput:function(t){this.onlyEnter||this.$emit("valueChanged",this.getValue(t.target.value))},handleEnterInput:function(t){this.onlyEnter&&this.$emit("valueChanged",this.getValue(t.target.value))},handleKeyPress:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"up",e=this.getValue(this.innerValue);switch(t){case"up":e+=1;break;case"down":e-=1;break;default:e+=1}e=this.getValue(e),this.$emit("valueChanged",e)}}};exports.default=t;
30
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,n=e.$createElement;return(e._self._c||n)("input",{style:e.dynamicWidth,attrs:{type:"text",disabled:e.$attrs.disabled},domProps:{value:e.postFixIt},on:{input:e.handleOnInput,keydown:[function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"up",38,n.key,["Up","ArrowUp"])?null:(n.preventDefault(),e.handleKeyPress("up"))},function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"down",40,n.key,["Down","ArrowDown"])?null:(n.preventDefault(),e.handleKeyPress("down"))},function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:(n.preventDefault(),e.handleEnterInput(n))}]}})},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
31
- },{}],"xi3E":[function(require,module,exports) {
 
 
 
 
32
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e(require("./NumberPostfixInput"));function e(t){return t&&t.__esModule?t:{default:t}}var a={props:{value:{type:Number,default:0},rawValue:{type:Number,default:0},active:{type:Boolean,default:!1},stopId:String,enableBreakpointCustomization:{type:Boolean,default:!1}},components:{NumberPostfixInput:t.default},data:function(){return{wrapperStyle:{left:0,top:0},innerRawValue:this.rawValue}},watch:{rawValue:function(t){this.innerRawValue=t},value:function(){this.calculateStyle()},innerRawValue:function(t){this.$emit("breakpointChange",t,this.stopId)}},mounted:function(){var t=this;this.$nextTick(function(){t.calculateStyle()})},methods:{clickEvent:function(){this.$emit("click",this.rawValue)},calculateStyle:function(){var t=this.$refs.wrapper,e=this.$refs.knob;if(t){var a=t.getBoundingClientRect().width;this.wrapperStyle.left="calc(".concat(this.value,"% - ").concat(a/2,"px)")}if(e){var n=e.getBoundingClientRect().height;this.wrapperStyle.top="-".concat(n/2,"px")}}}};exports.default=a;
33
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"wrapper",staticClass:"wptb-slider-stop",class:{"wptb-slider-stop-active":e.active},style:e.wrapperStyle,on:{"!click":function(t){return t.preventDefault(),e.clickEvent(t)}}},[i("div",{ref:"knob",staticClass:"wptb-slider-stop-knob"}),e._v(" "),i("div",{staticClass:"wptb-slider-stop-label"},[e._t("default")],2),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.enableBreakpointCustomization,expression:"enableBreakpointCustomization"}]},[i("number-postfix-input",{staticClass:"wptb-size-input",staticStyle:{"font-size":"90%"},attrs:{"enable-dynamic-width":!0,"only-enter":!0,"post-fix":"px"},model:{value:e.innerRawValue,callback:function(t){e.innerRawValue=t},expression:"innerRawValue"}})],1)])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
34
- },{"./NumberPostfixInput":"h0P7"}],"ooD9":[function(require,module,exports) {
35
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={props:{amount:{type:Number,default:0}},computed:{calculateStyle:function(){return{width:"".concat(this.amount,"%")}}}};exports.default=t;
36
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"wptb-screen-size-slider-fill",style:this.calculateStyle})},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
37
- },{}],"q8F8":[function(require,module,exports) {
38
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:{positionPercentage:{type:Number,default:0}},data:function(){return{style:{left:0}}},watch:{positionPercentage:{handler:function(){this.calculateStyle()},deep:!0}},mounted:function(){this.calculateStyle()},methods:{calculateStyle:function(){var e=this.$refs.arrowWrapper.getBoundingClientRect().width;this.style.left="calc(".concat(this.positionPercentage,"% - ").concat(e/2,"px)")},handleDrag:function(e){var t=e.screenX,a=e.screenY;0===t&&0===a||this.$emit("arrowDrag",e)}}};exports.default=e;
39
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{ref:"arrowWrapper",staticClass:"wptb-screen-size-slider-arrow",style:e.style,attrs:{draggable:"true"},on:{drag:function(t){return t.preventDefault(),e.handleDrag(t)},dragover:function(e){e.preventDefault()},dragend:function(t){return t.preventDefault(),e.$emit("arrowDragEnd")},drop:function(e){e.preventDefault()},dragexit:function(e){e.preventDefault()},dragleave:function(e){e.preventDefault()}}},[r("svg",{attrs:{width:"17",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[r("path",{attrs:{d:"M8.5 16L0 0h17L8.5 16z",fill:"var(--wptb-plugin-logo-color)"}})])])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
40
- },{}],"V4gv":[function(require,module,exports) {
41
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=n(require("./SliderStop")),e=n(require("./SliderFill")),i=n(require("./SliderArrow"));function n(t){return t&&t.__esModule?t:{default:t}}var r={props:{stops:Object,endPadding:{type:Number,default:0},modelVal:{type:Number,default:0},enableBreakpointCustomization:{type:Boolean,default:!1}},components:{SliderStop:t.default,SliderFill:e.default,SliderArrow:i.default},data:function(){return{min:0,max:100,currentVal:0,isDragging:!1,minSizeBetweenBreakpoints:100,repaintId:0}},beforeMount:function(){this.calculateMinMax()},watch:{currentVal:function(){this.$emit("slide",this.currentVal)},modelVal:function(t){this.currentVal=Math.floor(t)}},methods:{handleBreakpointChange:function(t,e){var i=this.directives.breakpoints;if(!i[e])throw new Error("no breakpoint found with the given ID: [".concat(e,"]"));var n=Object.keys(i).sort(function(t,e){return i[t].width-i[e].width}),r=n.indexOf(e),a=n[r-1],s=n[r+1];a&&i[a].width>=t&&(t=i[a].width+this.minSizeBetweenBreakpoints),s&&i[s].width<=t&&(t=i[s].width-this.minSizeBetweenBreakpoints),i[e].width=t,this.calculateMinMax(),this.repaintId+=1},calculateMinMax:function(){var t=Object.values(this.stops).sort(function(t,e){return-1*(e.width-t.width)});this.min=t[0].width-this.endPadding,this.max=t[t.length-1].width+this.endPadding,this.currentVal=t[t.length-1].width},translateIntoPercent:function(t){var e=this.max-this.min;return 100*(t-this.min)/e},slide:function(t){this.currentVal=t},handleArrowDrag:function(t){this.isDragging=!0;var e=this.$refs.sliderWrapper.getBoundingClientRect(),i=e.left,n=e.width,r=(t.clientX-i)*(this.max-this.min)/n;this.currentVal=this.limitToRange(this.min+r)},limitToRange:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=t;return t<this.min&&(i=this.min),t>this.max&&(i=this.max),e&&(i=Math.floor(i)),i},isStopActive:function(t){var e=this;return this.currentVal>=t&&Object.values(this.stops).filter(function(t){return t<=e.currentVal}).every(function(e){return e<=t})}}};exports.default=r;
42
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{key:e.repaintId,ref:"sliderWrapper",staticClass:"wptb-screen-size-slider-wrapper",class:{"wptb-drag-active":e.isDragging}},[r("div",{staticClass:"wptb-screen-size-slider-empty"},[r("slider-arrow",{attrs:{"position-percentage":e.translateIntoPercent(e.limitToRange(e.currentVal))},on:{arrowDrag:e.handleArrowDrag,arrowDragEnd:function(t){e.isDragging=!1}}}),e._v(" "),r("slider-fill",{attrs:{amount:e.translateIntoPercent(e.limitToRange(e.currentVal))}}),e._v(" "),e._l(e.stops,function(t,a){var n=t.name,i=t.width;return r("slider-stop",{key:a,attrs:{active:e.isStopActive(i),value:e.translateIntoPercent(i),"raw-value":i,"stop-id":a,enableBreakpointCustomization:e.enableBreakpointCustomization},on:{click:e.slide,breakpointChange:e.handleBreakpointChange}},[e._v(e._s(n))])})],2)])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
43
- },{"./SliderStop":"xi3E","./SliderFill":"ooD9","./SliderArrow":"q8F8"}],"phKF":[function(require,module,exports) {
44
 
45
  var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(n){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(n){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};
46
  },{}],"Q6f0":[function(require,module,exports) {
@@ -49,17 +55,17 @@ var process = require("process");
49
  var e=arguments[3],t=require("process");function n(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 r(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){o(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){return(a="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(e,t,n){"object"===("undefined"==typeof exports?"undefined":a(exports))&&"undefined"!=typeof module?module.exports=n():t[e]=n()}("WPTB_ResponsiveFrontend",self||e,function(){function e(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]}function t(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.element=e,this.referenceObject=n,this.mergedRenderStatus=!0,this.mergedCells={row:[],column:[]},this.getMergedRenderStatus=function(){return t.mergedRenderStatus},this.setMergedRenderStatus=function(e){t.mergedRenderStatus=e},this.addToMergedCells=function(e,n){t.mergedCells[e].push(n)},this.isReference=function(){return null!==t.referenceObject},this.isReference()&&(this.element=e.cloneNode(!0)),this.modifications={},this.spans={row:1,col:1},this.remainingSpans={row:0,col:0},this.cacheSpanValues=function(){Object.keys(t.spans).map(function(e){if(Object.prototype.hasOwnProperty.call(t.spans,e)){var n=t.spans[e];t.spans[e]=t.element.getAttribute("".concat(e,"Span"))||n}})},this.cacheSpanValues(),this.getSpan=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?t.getElement().getAttribute("".concat(e,"Span")):t.spans[e];if(n)return n;throw new Error("no span value found with the given type of [".concat(e,"]"))},this.getRemainingSpans=function(e){return t.remainingSpans[e]},this.setRemainingSpans=function(e,n){t.remainingSpans[e]=n},this.getElement=function(){return t.element},this.createCellElement=function(){return document.createElement("td")},e||(this.element=this.createCellElement()),this.setAttribute=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:",",s=t.getElement()[e];"function"!=typeof s&&"object"!==a(s)||(s=t.getElement().getAttribute(e)),t.modifications[e]&&(s=t.modifications[e].default);var i=s;r?i+="".concat(i).concat(o).concat(n):i=n,t.modifications[e]={value:i,default:s},t.getElement()[e]=i},this.setSpan=function(e,n){if(!t.isReference()){var r=t.getSpan(e)-n<0?t.getSpan(e):n;t.setAttribute("".concat(e,"Span"),r),t.setRemainingSpans(e,t.getSpan(e)-r);for(var o=0;o<r-1;o+=1)t.mergedCells[e][o].setMergedRenderStatus(!1);return!0}if(!t.getMergedRenderStatus())return!1;var a=t.referenceObject.getRemainingSpans(e);if(0===a)return!1;var s=a-n<0?a:n,i=a-s;if(t.referenceObject.setRemainingSpans(e,i),t.setAttribute("".concat(e,"Span"),s),0!==i)for(var l=t.referenceObject.mergedCells[e].length-a+1,d=l+s-1,u=l;u<d;u+=1)t.mergedCells[e][u].setMergedRenderStatus(!1);return!0},this.resetAttribute=function(e){t.modifications[e]&&(t.getElement()[e]=t.modifications[e].default,t.modifications[e]=void 0)},this.resetAllAttributes=function(){Object.keys(t.modifications).map(function(e){Object.prototype.hasOwnProperty.call(t.modifications,e)&&t.resetAttribute(e)})},{getElement:this.getElement,el:this.element,setAttribute:this.setAttribute,resetAllAttributes:this.resetAllAttributes,getSpan:this.getSpan,setSpan:this.setSpan,getRemainingSpans:this.getRemainingSpans,setRemainingSpans:this.setRemainingSpans,isReference:this.isReference,addToMergedCells:this.addToMergedCells,mergedCells:this.mergedCells,setMergedRenderStatus:this.setMergedRenderStatus,getMergedRenderStatus:this.getMergedRenderStatus}}function n(n){var r=this;return this.tableElement=n,this.parsedTable=[],this.rowCache=[],this.originals={rows:[]},this.rowColors={header:null,even:null,odd:null},this.addToParsed=function(e,t,n){r.parsedTable[e]||(r.parsedTable[e]=[]),r.parsedTable[e][t]=n},this.parseTable=function(){var e=Array.from(r.tableElement.querySelectorAll("tr"));e.map(function(e,n){r.originals.rows.push(e),Array.from(e.querySelectorAll("td")).map(function(e,o){var a=new t(e);r.addToParsed(n,o,a);var s=a.getSpan(t.spanTypes.row),i=a.getSpan(t.spanTypes.column);if(s>1)for(var l=1;l<s;l+=1){var d=new t(e,a);a.addToMergedCells("row",d),r.addToParsed(n+l,o,d)}if(i>1)for(var u=1;u<i;u+=1){var c=new t(e,a);a.addToMergedCells("column",c),r.addToParsed(n,o+u,c)}})}),r.parseRowColors(e)},this.parseRowColors=function(t){(!t||t.length<=0)&&e("no rows are found to parse their colors","error"),r.rowColors.header=""===t[0].style.backgroundColor?null:t[0].style.backgroundColor;for(var n=t.length/3>=1?0:1===t.length?2:(t.length-1)%2,o=0;o<n;o+=1){var a=document.createElement("tr");r.tableElement.querySelector("tbody").appendChild(a),t.push(a)}r.rowColors.even=getComputedStyle(t[1]).backgroundColor,r.rowColors.odd=getComputedStyle(t[2]).backgroundColor;for(var s=0;s<n;s+=1)t[t.length-(s+1)].remove()},this.addRow=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;Array.isArray(e)||(e=[e]);var o,a=r.tableElement.querySelector("tbody");if(t)o=r.originals.rows[n];else{var s=document.createRange();s.setStart(a,0),o=s.createContextualFragment('<tr class="'.concat(e.join(" "),'"></tr>')).childNodes[0]}return a.appendChild(o),r.rowCache.push(o),{el:o,id:r.rowCache.length-1}},this.clearTable=function(){r.rowCache=[],r.tableElement.querySelector("tbody").innerHTML=""},this.getRow=function(t){return r.rowCache[t]?r.rowCache[t]:(e("no row with id [".concat(t,"] found in the cache."),"warn"),null)},this.maxRows=function(){return r.parsedTable.length},this.maxColumns=function(){return r.parsedTable.reduce(function(e,t){return t.length>e&&(e=t.length),e},0)},this.getCell=function(t,n){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{if(r.parsedTable[t][n])return o?r.parsedTable[t][n]:r.parsedTable[t][n].el}catch(a){return e("no cell found at the given address of [".concat(t,"-").concat(n,"]"),"warn"),null}return e("no cell found at the given address of [".concat(t,"-").concat(n,"]"),"warn"),null},this.getCellsAtRow=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],o=0;o<r.maxColumns();o+=1){var a=r.getCell(e,o,t);a&&n.push(a)}return n},this.appendToRow=function(e,t,n){var o=r.getRow(n),a=r.getCell(e,t,!0);return a&&o&&o.appendChild(a.getElement()),a},this.appendElementToRow=function(e,t){var n=r.getRow(t);e&&n&&n.appendChild(e)},this.appendObjectToRow=function(e,t){var n=r.getRow(t);e&&n&&n.appendChild(e.getElement())},this.parseTable(),{maxRows:this.maxRows,maxColumns:this.maxColumns,addRow:this.addRow,clearTable:this.clearTable,getCell:this.getCell,appendToRow:this.appendToRow,appendElementToRow:this.appendElementToRow,appendObjectToRow:this.appendObjectToRow,getCellsAtRow:this.getCellsAtRow,el:this.tableElement,rowColors:this.rowColors}}t.spanTypes={row:"row",column:"col"};var o={query:".wptb-preview-table",defaultClasses:["wptb-plugin-responsive-base"],bindToResize:!1};return function(){var e=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.options=r({},o,{},a),this.elements=Array.from(document.querySelectorAll(this.options.query)),this.elementObjects=this.elements.map(function(e){return{el:e,tableObject:new n(e)}}),this.bindRebuildToResize=function(){window.addEventListener("resize",function(t){e.rebuildTables(t.target.innerWidth)})},this.getDirective=function(e){var t=e.dataset.wptbResponsiveDirectives;return t?JSON.parse(atob(t)):null},this.addDefaultClasses=function(t){t.classList.add(e.options.defaultClasses)},this.removeDefaultClasses=function(t){t.classList.remove(e.options.defaultClasses)},this.autoBuild=function(t,n,r,o){var a=r.cellStackDirection[n],s=r.topRowAsHeader[n],i=r.cellsPerRow[n];o.clearTable(),"desktop"===n?(e.buildDefault(o),e.removeDefaultClasses(t)):(e.autoDirectionBuild(o,a,s,i),e.addDefaultClasses(t))},this.autoDirectionBuild=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=t.maxRows(),s=t.maxColumns(),i="row"===n;if(r)e.headerBuild(t,n,o);else if(i)!function(){for(var e=[],n=0;n<a;n+=1)t.getCellsAtRow(n,!0).forEach(function(t){return e.push(t)});for(var r=e.length,s=0,i=0;s<r;s+=o,i+=1){var l=t.addRow("wptb-row");l.el.style.backgroundColor=t.rowColors[i%2==0?"odd":"even"];for(var d=0;d<o;d+=1){var u=e[s+d];u&&(t.appendElementToRow(u.getElement(),l.id),u.resetAllAttributes(),u.setAttribute("style","width: 100% !important",!0,";"),u.setAttribute("colSpan",1),u.setAttribute("rowSpan",1))}}}();else{for(var l=[],d=0;d<s;d+=1)for(var u=0;u<a;u+=1){var c=t.getCell(u,d,!0);c&&l.push(c)}for(var p=l.length,f=0,h=0;f<p;f+=o,h+=1){var g=t.addRow("wptb-row");g.el.style.backgroundColor=t.rowColors[h%2==0?"odd":"even"];for(var b=0;b<o;b+=1){var m=l[f+b];m&&(t.appendElementToRow(m.getElement(),g.id),m.resetAllAttributes(),m.setAttribute("style","width: 100% !important",!0,";"),m.setAttribute("colSpan",1),m.setAttribute("rowSpan",1))}}}},this.headerBuild=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=e.getCellsAtRow(0,!0).map(function(t){return t.setAttribute("style","background-color: ".concat(e.rowColors.header),!0,";"),t}),a="column"===n,s=e.maxRows(),i=e.maxColumns();if(a)for(var l=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=e.addRow("wptb-row");t&&(n.el.style.borderTop="3px solid gray"),o.map(function(t){e.appendElementToRow(t.el.cloneNode(!0),n.id)})},d=Math.ceil((s-1)/r),u=1,c=0;c<d;c+=1){l(c>0);for(var p=0;p<r&&!(u>=s);p+=1){var f=e.addRow("wptb-row");f.el.style.backgroundColor=e.rowColors[p%2==0?"even":"odd"];for(var h=0;h<i;h+=1){var g=e.getCell(u,h,!0);if(g){g.resetAllAttributes();var b=!0,m=g.getSpan(t.spanTypes.row);if(g.getSpan(t.spanTypes.column),m>1){var w=r-p,v=Math.min(m,w);b=g.setSpan(t.spanTypes.row,v),g.setMergedRenderStatus(!0)}b&&e.appendObjectToRow(g,f.id)}}u+=1}}else for(var R=Math.ceil((s-1)/r),C=1,y=0;y<R;y+=1){for(var S=0;S<i;S+=1){var T=e.addRow("wptb-row");T.el.style.backgroundColor="none",y>0&&0===S&&(T.el.style.borderTop="3px solid gray");var A=o[S].el.cloneNode(!0);A.style.backgroundColor="".concat(e.rowColors.header," !important"),e.appendElementToRow(A,T.id);for(var O=0;O<r&&!(C+O>=s);O+=1){var E=e.getCell(C+O,S,!0);if(E){E.resetAllAttributes();var j=!0,M=E.getSpan(t.spanTypes.row);if(E.getSpan(t.spanTypes.column),M>1){var x=r-O,k=Math.min(M,x);j=E.setSpan(t.spanTypes.row,k);var P=E.el.getAttribute("rowSpan"),D=E.el.getAttribute("colSpan");E.setAttribute("rowSpan",D),E.setAttribute("colSpan",P),E.setMergedRenderStatus(!0)}if(j){var q=(C+O+y)%2==0?"even":"odd";1===r&&(q=C%2==0?"even":"odd"),E.setAttribute("style","background-color: ".concat(e.rowColors[q]),!0,";"),e.appendObjectToRow(E,T.id)}}}}C+=r}},this.buildDefault=function(e){for(var t=e.maxRows(),n=e.maxColumns(),r=0;r<t;r+=1)for(var o=e.addRow("",!0,r).id,a=0;a<n;a+=1){var s=e.getCell(r,a,!0);s&&!s.isReference()&&(s.resetAllAttributes(),e.appendElementToRow(s.getElement(),o))}},this.calculateRangeId=function(e,t){var n=Object.keys(t).sort(function(e,n){return t[e].width-t[n].width}),r=n[0];return n.map(function(n){e>=t[n].width&&(r=n)}),r},this.rebuildTable=function(t,n,r){var o=e.getDirective(t);if(o){if(!o.responsiveEnabled)return;var a=o.responsiveMode,s=e["".concat(a,"Build")];n||(n=t.getBoundingClientRect().width);var i=e.calculateRangeId(n,o.breakpoints);if(!s)throw new Error("No build mode named as [".concat(a,"] found."));var l=o.modeOptions[a];s.call(e,t,i,l,r)}},this.rebuildTables=function(t){t||(t=window.innerWidth),e.elementObjects.map(function(n){e.rebuildTable(n.el,t,n.tableObject)})},this.options.bindToResize&&this.bindRebuildToResize(),{rebuildTables:this.rebuildTables}}});
50
  },{"process":"phKF"}],"ATQh":[function(require,module,exports) {
51
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={props:{click:{type:Function,default:function(){console.log("Material button clicked")}},size:{type:String,default:"fit-content"}},computed:{buttonClass:function(){return["wptb-plugin-button-material-".concat(this.size)]}}};exports.default=t;
52
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"wptb-plugin-button-material",class:t.buttonClass,on:{click:function(e){return e.preventDefault(),t.click(e)}}},[t._t("default")],2)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
53
- },{}],"vCKs":[function(require,module,exports) {
54
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./MaterialButton"));function t(e){return e&&e.__esModule?e:{default:e}}var o={props:{message:{type:String,default:"This is a default message for modal window."},visible:{type:Boolean,default:!1},relativeRef:{type:HTMLElement,required:!0},callback:{type:Function,default:function(){console.log("modal button clicked")}}},components:{MaterialButton:e.default},mounted:function(){this.relativeRef.appendChild(this.$refs.mainWrapper)},beforeDestroy:function(){this.$refs.mainWrapper.remove()}};exports.default=o;
55
- (function(){var s=exports.default||module.exports;"function"==typeof s&&(s=s.options),Object.assign(s,{render:function(){var s=this,i=s.$createElement,t=s._self._c||i;return t("div",{directives:[{name:"show",rawName:"v-show",value:s.visible,expression:"visible"}],ref:"mainWrapper",staticClass:"wptb-plugin-modal-window"},[t("div",{staticClass:"wptb-plugin-modal-inner-window"},[s._m(0),s._v(" "),t("div",{staticClass:"wptb-plugin-modal-message"},[s._v(s._s(s.message))]),s._v(" "),t("div",{staticClass:"wptb-plugin-modal-button-container"},[t("material-button",{attrs:{size:"full-size",click:s.callback}},[s._v(s._s(s.strings.okay))])],1)])])},staticRenderFns:[function(){var s=this.$createElement,i=this._self._c||s;return i("div",{staticClass:"wptb-plugin-modal-icon"},[i("span",{staticClass:"dashicons dashicons-warning"})])}],_compiled:!0,_scopeId:null,functional:void 0});})();
56
- },{"./MaterialButton":"ATQh"}],"waBm":[function(require,module,exports) {
57
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=c(require("../components/TableClone")),t=c(require("../components/ScreenSizeSlider")),i=c(require("../../../WPTB_ResponsiveFrontend")),n=c(require("../functions/DeBouncer")),r=c(require("../components/ModalWindow")),o=c(require("../components/MaterialButton")),s=c(require("../components/NumberPostfixInput"));function c(e){return e&&e.__esModule?e:{default:e}}function u(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function a(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?u(Object(i),!0).forEach(function(t){l(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):u(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function l(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var d={props:{cloneQuery:{type:String,required:!0},screenSizes:Object,compareSizes:Object},components:{TableClone:e.default,ScreenSizeSlider:t.default,ModalWindow:r.default,MaterialButton:o.default,NumberPostfixInput:s.default},data:function(){return{isVisible:!0,currentSize:0,currentDirectives:null,currentSizeRangeName:"desktop",sliderPadding:20,sizeStops:{},responsiveFrontend:null,rebuilding:!1,debounceTime:1e3,sizeLimitMin:100,sizeLimitMax:0}},watch:{currentSizeRangeName:function(e){this.appOptions.currentBreakpoint=e},directives:{handler:function(){this.currentDirectives=this.encodeResponsiveDirectives()},deep:!0},"appOptions.currentSize":{handler:function(e){var t=this,i=this.currentSizeRangeName;this.currentSizeRangeName=this.calculateSizeRangeName(e),i!==this.currentSizeRangeName&&this.directives.responsiveEnabled&&(this.rebuilding=!0,(0,n.default)("currentSize",function(){t.responsiveFrontend.rebuildTables(t.appOptions.currentSize),t.rebuilding=!1},this.debounceTime))}}},beforeMount:function(){},mounted:function(){var e=this;document.addEventListener("wptbSectionChanged",function(t){e.isVisible="table_responsive_menu"===t.detail}),this.sizeLimitMax=this.$refs.builderResponsive.getBoundingClientRect().width},computed:{tableStyle:function(){if(!this.directives.responsiveEnabled)return{};var e=this.limitToRange(this.appOptions.currentSize,Math.min(this.sizeLimitMin,this.sizeLimitMax),Math.max(this.sizeLimitMin,this.sizeLimitMax));return{width:"".concat(e,"px")}},modalRelative:function(){return document.querySelector(".wptb-builder-panel")}},methods:{limitToRange:function(e,t,i){return e>i?i:e<t?t:e},tableCloned:function(e){if(this.responsiveFrontend=new i.default({query:".wptb-builder-responsive table"}),e){var t=this.decodeResponsiveDirectives(e);try{var n=JSON.parse(t);this.deepMergeObject(this.directives,n)}catch(r){console.warn("[WPTB]: invalid directive found at main table")}}},deepMergeObject:function(e,t){Object.keys(t).map(function(i){Object.prototype.hasOwnProperty.call(t,i)&&void 0!==e[i]&&("object"===p(e[i])?e[i]=a({},e[i],{},t[i]):e[i]=t[i])})},directivesCopied:function(e){this.responsiveFrontend.rebuildTables(this.appOptions.currentSize),e||(new WPTB_TableStateSaveManager).tableStateSet(),this.rebuilding=!1},sliderSizeStops:function(){var e=this,t=Object.keys(this.screenSizes).reduce(function(t,i){return Object.prototype.hasOwnProperty.call(e.screenSizes,i)&&(t[e.screenSizes[i].name]=e.screenSizes[i].width),t},{});return this.directives.stops=t,t},calculateSizeRangeName:function(e){var t=this.directives.breakpoints,i=Object.keys(t).filter(function(i){return!!Object.prototype.hasOwnProperty.call(t,i)&&t[i].width<=e}).sort(function(e,i){return t[e].width-t[i].width});return 0===i.length?"mobile":i[i.length-1]},handleSizeSlideChange:function(e){this.appOptions.currentSize=e},encodeResponsiveDirectives:function(){var e=JSON.stringify(this.directives);return btoa(e)},decodeResponsiveDirectives:function(e){return atob(e)},showCellIdentifications:function(){this.appOptions.identifyCells=!0}}};exports.default=d;
58
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"wptb-fade"}},[e.isVisible?i("div",{ref:"builderResponsive",staticClass:"wptb-builder-responsive"},[i("div",{staticClass:"wptb-responsive-menu-tools"},[i("screen-size-slider",{attrs:{"end-padding":e.sliderPadding,stops:e.directives.breakpoints,"model-val":e.appOptions.currentSize,"enable-breakpoint-customization":!1},on:{slide:e.handleSizeSlideChange}})],1),e._v(" "),i("div",{staticClass:"wptb-responsive-builder-main wptb-checkerboard-pattern wptb-plugin-inset-shadow-md"},[i("div",{staticClass:"wptb-responsive-builder-toolbox-float"},[i("number-postfix-input",{staticClass:"wptb-size-input wptb-plugin-box-shadow-xl",attrs:{"post-fix":"px","only-enter":!0},model:{value:e.appOptions.currentSize,callback:function(t){e.$set(e.appOptions,"currentSize",t)},expression:"appOptions.currentSize"}}),e._v(" "),i("material-button",{staticClass:"wptb-plugin-box-shadow-xl",attrs:{size:"fit-content",click:e.showCellIdentifications}},[e._v(e._s(e._f("cap")(e.strings.identifyCells))+" ")])],1),e._v(" "),i("table-clone",{ref:"tableClone",attrs:{clone:e.isVisible,"clone-query":e.cloneQuery,"table-directives":e.currentDirectives,"table-style":e.tableStyle},on:{tableCloned:e.tableCloned,directivesCopied:e.directivesCopied}}),e._v(" "),i("transition",{attrs:{name:"wptb-fade"}},[e.directives.responsiveEnabled?e._e():i("div",{staticClass:"wptb-responsive-disabled-table-overlay"})]),e._v(" "),i("transition",{attrs:{name:"wptb-fade"}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.rebuilding,expression:"rebuilding"}],staticClass:"wptb-responsive-wait-overlay"},[e._v(e._s(e.strings.rebuilding))])]),e._v(" "),i("modal-window",{attrs:{visible:e.appOptions.hasLegacyResponsive,message:e.strings.legacyResponsiveWarning,"relative-ref":e.modalRelative,callback:function(){e.appOptions.hasLegacyResponsive=!1}}})],1)]):e._e()])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
59
- },{"../components/TableClone":"cW6v","../components/ScreenSizeSlider":"V4gv","../../../WPTB_ResponsiveFrontend":"Q6f0","../functions/DeBouncer":"qsi5","../components/ModalWindow":"vCKs","../components/MaterialButton":"ATQh","../components/NumberPostfixInput":"h0P7"}],"TuCQ":[function(require,module,exports) {
60
 
61
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"wptb-controls-flex-row"},[this._t("default")],2)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
62
- },{}],"GZC0":[function(require,module,exports) {
63
  "use strict";function e(e,t){e.filter("cap",function(e){return e.split(" ").map(function(e){return e[0].toUpperCase()+e.slice(1)}).join(" ")})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={install:e};exports.default=t;
64
  },{}],"yEip":[function(require,module,exports) {
65
  "use strict";function t(t,e){t.mixin({data:function(){return{strings:e.strings}}})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={install:t};exports.default=e;
@@ -69,28 +75,31 @@ var e=arguments[3],t=require("process");function n(e,t){var n=Object.keys(e);if(
69
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:{label:String,value:{type:null},disabled:{type:Boolean,default:!1}},data:function(){return{innerValue:""}},model:{prop:"value",event:"valueChanged"},watch:{value:function(e){this.innerValue=e},innerValue:function(e){this.$emit("valueChanged",e)}},mounted:function(){this.innerValue=this.value}},t=e;exports.default=t;
70
  },{}],"osOD":[function(require,module,exports) {
71
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("../mixins/PanelControlBase"));function t(e){return e&&e.__esModule?e:{default:e}}var r={mixins:[e.default]};exports.default=r;
72
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"wptb-element-option wptb-settings-items wptb-plugin-width-full"},[n("div",{staticClass:"wptb-settings-row wptb-settings-middle-xs"},[n("label",{staticClass:"wptb-toggle"},[n("span",{staticStyle:{"font-size":"16px"}},[e._v(" "+e._s(e.label)+" ")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.innerValue,expression:"innerValue"}],staticClass:"wptb-element-property",attrs:{type:"checkbox",disabled:e.disabled},domProps:{checked:Array.isArray(e.innerValue)?e._i(e.innerValue,null)>-1:e.innerValue},on:{change:function(t){var n=e.innerValue,i=t.target,l=!!i.checked;if(Array.isArray(n)){var s=e._i(n,null);i.checked?s<0&&(e.innerValue=n.concat([null])):s>-1&&(e.innerValue=n.slice(0,s).concat(n.slice(s+1)))}else e.innerValue=l}}}),e._v(" "),n("i")])])])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
73
- },{"../mixins/PanelControlBase":"vpWQ"}],"fI53":[function(require,module,exports) {
74
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("../mixins/PanelControlBase"));function t(e){return e&&e.__esModule?e:{default:e}}var o={props:{options:{type:Object,default:function(){}}},mixins:[e.default]};exports.default=o;
75
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"wptb-element-option wptb-settings-items wptb-plugin-width-full"},[n("div",{staticClass:"wptb-settings-row wptb-settings-middle-xs"},[n("label",{staticClass:"wptb-control-row wptb-flex wptb-flex-row wptb-flex-align-center wptb-flex-justify-space-between"},[n("span",{staticStyle:{"font-size":"16px"}},[e._v(" "+e._s(e.label)+" ")]),e._v(" "),n("select",{directives:[{name:"model",rawName:"v-model",value:e.innerValue,expression:"innerValue"}],attrs:{disabled:e.disabled},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.innerValue=t.target.multiple?n:n[0]}}},e._l(e.options,function(t,l){return n("option",{key:l,domProps:{value:l}},[e._v(e._s(e._f("cap")(t)))])}),0)])])])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
76
- },{"../mixins/PanelControlBase":"vpWQ"}],"DmVJ":[function(require,module,exports) {
77
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("vue-fragment"),r=t(require("./PanelToggleControl")),o=t(require("./PanelDropdownControl"));function t(e){return e&&e.__esModule?e:{default:e}}var n={components:{PanelToggleControl:r.default,PanelDropdownControl:o.default,Fragment:e.Fragment}};exports.default=n;
78
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,s=e.$createElement,n=e._self._c||s;return n("fragment",[n("panel-toggle-control",{attrs:{label:e._f("cap")(e.strings.enableResponsive)},model:{value:e.directives.responsiveEnabled,callback:function(s){e.$set(e.directives,"responsiveEnabled",s)},expression:"directives.responsiveEnabled"}}),e._v(" "),n("panel-dropdown-control",{attrs:{label:e._f("cap")(e.strings.mode),options:{auto:"auto"},disabled:!e.directives.responsiveEnabled},model:{value:e.directives.responsiveMode,callback:function(s){e.$set(e.directives,"responsiveMode",s)},expression:"directives.responsiveMode"}})],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
79
- },{"vue-fragment":"CDb8","./PanelToggleControl":"osOD","./PanelDropdownControl":"fI53"}],"UchZ":[function(require,module,exports) {
80
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:{header:{type:String,default:"Tab Header"},tabs:{type:Object,default:function(){return{default:"Default"}}},currentTab:{type:String,default:"default"}},methods:{isActiveTab:function(e){return this.currentTab===e},handleTabClick:function(e){this.$emit("tabClicked",e)}}};exports.default=e;
81
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"wptb-section-group-tabbed wptb-plugin-box-shadow-md wptb-plugin-width-full"},[s("div",{staticClass:"wptb-panel-toggle wptb-section-group-tabbed-header"},[s("div",{staticClass:"header"},[t._v(t._s(t.header))])]),t._v(" "),s("div",{staticClass:"wptb-section-group-tabbed-tabs-buttons"},t._l(t.tabs,function(e,i){return s("div",{key:i,staticClass:"wptb-settings-section-item static-active",class:{active:t.isActiveTab(i),disabled:!t.isActiveTab(i)},on:{"!click":function(e){return e.preventDefault(),t.handleTabClick(i)}}},[t._v(" "+t._s(e)+" ")])}),0),t._v(" "),s("div",{staticClass:"wptb-section-group-tab-content"},[t._t("default")],2)])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
82
- },{}],"bOKu":[function(require,module,exports) {
83
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("../mixins/PanelControlBase")),t=r(require("./NumberPostfixInput"));function r(e){return e&&e.__esModule?e:{default:e}}var u={components:{NumberPostfixInput:t.default},mixins:[e.default]};exports.default=u;
84
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"wptb-element-option wptb-settings-items wptb-plugin-width-full"},[i("div",{staticClass:"wptb-settings-row wptb-settings-middle-xs"},[i("label",{staticClass:"wptb-control-row wptb-flex wptb-flex-row wptb-flex-align-center wptb-flex-justify-space-between"},[i("span",{staticStyle:{"font-size":"16px"}},[t._v(" "+t._s(t.label)+" ")]),t._v(" "),i("number-postfix-input",{staticClass:"wptb-size-input",attrs:{"enable-dynamic-width":!0,min:1,max:100,"enable-limit":!0,disabled:t.disabled},model:{value:t.innerValue,callback:function(e){t.innerValue=e},expression:"innerValue"}})],1)])])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
85
- },{"../mixins/PanelControlBase":"vpWQ","./NumberPostfixInput":"h0P7"}],"rfRR":[function(require,module,exports) {
86
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("vue-fragment"),t=n(require("./PanelToggleControl")),r=n(require("./PanelDropdownControl")),o=n(require("./PanelInputControl"));function n(e){return e&&e.__esModule?e:{default:e}}var i={components:{Fragment:e.Fragment,PanelToggleControl:t.default,PanelDropdownControl:r.default,PanelInputControl:o.default},methods:{isDisabled:function(){return"desktop"===this.appOptions.currentBreakpoint||!this.directives.responsiveEnabled}},computed:{perLabelString:function(){return this.directives.modeOptions.auto.topRowAsHeader[this.appOptions.currentBreakpoint]?this.strings.itemsPerHeader:this.strings.cellsPerRow}}};exports.default=i;
87
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("fragment",[o("panel-toggle-control",{attrs:{label:e._f("cap")(e.strings.topRowHeader),disabled:e.isDisabled()},model:{value:e.directives.modeOptions.auto.topRowAsHeader[e.appOptions.currentBreakpoint],callback:function(t){e.$set(e.directives.modeOptions.auto.topRowAsHeader,e.appOptions.currentBreakpoint,t)},expression:"directives.modeOptions.auto.topRowAsHeader[appOptions.currentBreakpoint]"}}),e._v(" "),o("panel-dropdown-control",{attrs:{label:e._f("cap")(e.strings.stackDirection),options:{row:e.strings.row,column:e.strings.column},disabled:e.isDisabled()},model:{value:e.directives.modeOptions.auto.cellStackDirection[e.appOptions.currentBreakpoint],callback:function(t){e.$set(e.directives.modeOptions.auto.cellStackDirection,e.appOptions.currentBreakpoint,t)},expression:"directives.modeOptions.auto.cellStackDirection[appOptions.currentBreakpoint]"}}),e._v(" "),o("panel-input-control",{attrs:{label:e._f("cap")(e.perLabelString),disabled:e.isDisabled()},model:{value:e.directives.modeOptions.auto.cellsPerRow[e.appOptions.currentBreakpoint],callback:function(t){e.$set(e.directives.modeOptions.auto.cellsPerRow,e.appOptions.currentBreakpoint,t)},expression:"directives.modeOptions.auto.cellsPerRow[appOptions.currentBreakpoint]"}})],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
88
- },{"vue-fragment":"CDb8","./PanelToggleControl":"osOD","./PanelDropdownControl":"fI53","./PanelInputControl":"bOKu"}],"BxO6":[function(require,module,exports) {
89
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("./PanelSectionGroupTabbed")),t=r(require("./AutoModePanelControls"));function r(e){return e&&e.__esModule?e:{default:e}}var o={components:{PanelSectionGroupTabbed:e.default,AutoModePanelControls:t.default},computed:{breakpointsObject:function(){var e=this;return Object.keys(this.directives.breakpoints).sort(function(t,r){return e.directives.breakpoints[t].width-e.directives.breakpoints[r].width}).reduce(function(t,r){return Object.prototype.hasOwnProperty.call(e.directives.breakpoints,r)&&(t[r]=e.directives.breakpoints[r].name),t},{})},currentPanelControls:function(){return"".concat(this.directives.responsiveMode[0].toUpperCase()+this.directives.responsiveMode.slice(1),"ModePanelControls")}},methods:{handleTabChange:function(e){this.appOptions.currentBreakpoint=e,this.appOptions.currentSize=this.directives.breakpoints[e].width}}};exports.default=o;
90
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this.$createElement,e=this._self._c||t;return e("panel-section-group-tabbed",{attrs:{"current-tab":this.appOptions.currentBreakpoint,tabs:this.breakpointsObject,header:this.strings[this.directives.responsiveMode]},on:{tabClicked:this.handleTabChange}},[e(this.currentPanelControls,{tag:"component"})],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
91
- },{"./PanelSectionGroupTabbed":"UchZ","./AutoModePanelControls":"rfRR"}],"Ub7O":[function(require,module,exports) {
92
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=l(require("vue")),n=l(require("../containers/ResponsiveApp")),t=l(require("../components/ResponsiveControlsRow")),o=l(require("../functions/WPTB_ControlsManager")),r=l(require("../plugins/filters")),s=l(require("../plugins/strings")),a=l(require("../components/ResponsivePanelGeneralControls")),i=l(require("../components/ResponsivePanelModeControls"));function l(e){return e&&e.__esModule?e:{default:e}}function p(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function u(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?p(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function c(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var d={name:"ResponsiveTable",handler:function(l){var p=o.default.getControlData("responsiveMenuData"),c={responsiveEnabled:!1,responsiveMode:"auto",preserveRowColor:!1,modeOptions:{auto:{topRowAsHeader:{desktop:!1,tablet:!1,mobile:!1},cellStackDirection:{desktop:"row",tablet:"row",mobile:"row"},cellsPerRow:{desktop:1,tablet:1,mobile:1}}},breakpoints:p.screenSizes};e.default.use({install:function(e,n){var t=n.components;e.mixin({components:t})}},{components:{ResponsiveControlsRow:t.default}}),e.default.use({install:function(e,n){e.mixin({data:function(){return n.data}})}},{data:{appOptions:{identifyCells:!1,hasLegacyResponsive:!1,currentBreakpoint:"desktop",currentSize:0},directives:c}}),e.default.use(r.default),e.default.use(s.default,p),new e.default({components:{ResponsiveApp:n.default},data:u({mainTableQuery:".wptb-preview-table"},p),template:'<responsive-app :clone-query="mainTableQuery" :screen-sizes="screenSizes" :compare-sizes="compareSizes"></responsive-app>'}).$mount("#".concat(l)),new e.default({components:{ResponsivePanelGeneralControls:a.default},template:"<responsive-panel-general-controls></responsive-panel-general-controls>"}).$mount("#responsiveBuilderLeftPanelGeneralControls"),new e.default({components:{ResponsivePanelModeControls:i.default},data:u({},p),template:"<responsive-panel-mode-controls></responsive-panel-mode-controls>"}).$mount("#responsiveBuilderLeftPanelModeOptions")}};exports.default=d;
93
  },{"vue":"HYXJ","../containers/ResponsiveApp":"waBm","../components/ResponsiveControlsRow":"TuCQ","../functions/WPTB_ControlsManager":"WZJa","../plugins/filters":"GZC0","../plugins/strings":"yEip","../components/ResponsivePanelGeneralControls":"DmVJ","../components/ResponsivePanelModeControls":"BxO6"}],"Zn1h":[function(require,module,exports) {
94
 
95
  "use strict";var e=u(require("vue")),t=u(require("./mountPoints/WPTB_IconSelectControl")),n=u(require("./mountPoints/WPTB_RangeControl")),o=u(require("./functions/WPTB_ControlsManager")),r=u(require("./mountPoints/WPTB_ResponsiveTable"));function u(e){return e&&e.__esModule?e:{default:e}}e.default.config.productionTip=!1;var a=self||void 0;a.WPTB_ControlsManager=o.default;var i=[t.default,n.default,o.default,r.default];function l(e){o.default.addControlScript(e.name,e.handler)}i.map(l);
96
- },{"vue":"HYXJ","./mountPoints/WPTB_IconSelectControl":"Pn7d","./mountPoints/WPTB_RangeControl":"YVYX","./functions/WPTB_ControlsManager":"WZJa","./mountPoints/WPTB_ResponsiveTable":"Ub7O"}]},{},["Zn1h"], null)
 
 
 
3
  var e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=Object.freeze({});function n(e){return null==e}function r(e){return null!=e}function i(e){return!0===e}function o(e){return!1===e}function a(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function s(e){return null!==e&&"object"==typeof e}var c=Object.prototype.toString;function u(e){return c.call(e).slice(8,-1)}function l(e){return"[object Object]"===c.call(e)}function f(e){return"[object RegExp]"===c.call(e)}function p(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function d(e){return r(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function v(e){return null==e?"":Array.isArray(e)||l(e)&&e.toString===c?JSON.stringify(e,null,2):String(e)}function h(e){var t=parseFloat(e);return isNaN(t)?e:t}function m(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}var y=m("slot,component",!0),g=m("key,ref,slot,slot-scope,is");function _(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}var b=Object.prototype.hasOwnProperty;function $(e,t){return b.call(e,t)}function w(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var x=/-(\w)/g,C=w(function(e){return e.replace(x,function(e,t){return t?t.toUpperCase():""})}),A=w(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),k=/\B([A-Z])/g,O=w(function(e){return e.replace(k,"-$1").toLowerCase()});function S(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function T(e,t){return e.bind(t)}var N=Function.prototype.bind?T:S;function j(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function E(e,t){for(var n in t)e[n]=t[n];return e}function M(e){for(var t={},n=0;n<e.length;n++)e[n]&&E(t,e[n]);return t}function D(e,t,n){}var L=function(e,t,n){return!1},I=function(e){return e};function F(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}function P(e,t){if(e===t)return!0;var n=s(e),r=s(t);if(!n||!r)return!n&&!r&&String(e)===String(t);try{var i=Array.isArray(e),o=Array.isArray(t);if(i&&o)return e.length===t.length&&e.every(function(e,n){return P(e,t[n])});if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(i||o)return!1;var a=Object.keys(e),c=Object.keys(t);return a.length===c.length&&a.every(function(n){return P(e[n],t[n])})}catch(u){return!1}}function R(e,t){for(var n=0;n<e.length;n++)if(P(e[n],t))return n;return-1}function H(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}var B="data-server-rendered",U=["component","directive","filter"],z=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch"],V={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:L,isReservedAttr:L,isUnknownElement:L,getTagNamespace:D,parsePlatformTagName:I,mustUseProp:L,async:!0,_lifecycleHooks:z},J=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function K(e){var t=(e+"").charCodeAt(0);return 36===t||95===t}function q(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var W=new RegExp("[^"+J.source+".$_\\d]");function Z(e){if(!W.test(e)){var t=e.split(".");return function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e}}}var G,X="__proto__"in{},Y="undefined"!=typeof window,Q="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,ee=Q&&WXEnvironment.platform.toLowerCase(),te=Y&&window.navigator.userAgent.toLowerCase(),ne=te&&/msie|trident/.test(te),re=te&&te.indexOf("msie 9.0")>0,ie=te&&te.indexOf("edge/")>0,oe=te&&te.indexOf("android")>0||"android"===ee,ae=te&&/iphone|ipad|ipod|ios/.test(te)||"ios"===ee,se=te&&/chrome\/\d+/.test(te)&&!ie,ce=te&&/phantomjs/.test(te),ue=te&&te.match(/firefox\/(\d+)/),le={}.watch,fe=!1;if(Y)try{var pe={};Object.defineProperty(pe,"passive",{get:function(){fe=!0}}),window.addEventListener("test-passive",null,pe)}catch(Xl){}var de=function(){return void 0===G&&(G=!Y&&!Q&&void 0!==e&&(e.process&&"server"===e.process.env.VUE_ENV)),G},ve=Y&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function he(e){return"function"==typeof e&&/native code/.test(e.toString())}var me,ye="undefined"!=typeof Symbol&&he(Symbol)&&"undefined"!=typeof Reflect&&he(Reflect.ownKeys);me="undefined"!=typeof Set&&he(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ge,_e,be,$e,we=D,xe=D,Ce=D,Ae=D,ke=0,Oe=function(){this.id=ke++,this.subs=[]};Oe.prototype.addSub=function(e){this.subs.push(e)},Oe.prototype.removeSub=function(e){_(this.subs,e)},Oe.prototype.depend=function(){Oe.target&&Oe.target.addDep(this)},Oe.prototype.notify=function(){var e=this.subs.slice();for(var t=0,n=e.length;t<n;t++)e[t].update()},Oe.target=null;var Se=[];function Te(e){Se.push(e),Oe.target=e}function Ne(){Se.pop(),Oe.target=Se[Se.length-1]}var je=function(e,t,n,r,i,o,a,s){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},Ee={child:{configurable:!0}};Ee.child.get=function(){return this.componentInstance},Object.defineProperties(je.prototype,Ee);var Me=function(e){void 0===e&&(e="");var t=new je;return t.text=e,t.isComment=!0,t};function De(e){return new je(void 0,void 0,void 0,String(e))}function Le(e){var t=new je(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}var Ie=Array.prototype,Fe=Object.create(Ie),Pe=["push","pop","shift","unshift","splice","sort","reverse"];Pe.forEach(function(e){var t=Ie[e];q(Fe,e,function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var i,o=t.apply(this,n),a=this.__ob__;switch(e){case"push":case"unshift":i=n;break;case"splice":i=n.slice(2)}return i&&a.observeArray(i),a.dep.notify(),o})});var Re=Object.getOwnPropertyNames(Fe),He=!0;function Be(e){He=e}var Ue=function(e){this.value=e,this.dep=new Oe,this.vmCount=0,q(e,"__ob__",this),Array.isArray(e)?(X?ze(e,Fe):Ve(e,Fe,Re),this.observeArray(e)):this.walk(e)};function ze(e,t){e.__proto__=t}function Ve(e,t,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];q(e,o,t[o])}}function Je(e,t){var n;if(s(e)&&!(e instanceof je))return $(e,"__ob__")&&e.__ob__ instanceof Ue?n=e.__ob__:He&&!de()&&(Array.isArray(e)||l(e))&&Object.isExtensible(e)&&!e._isVue&&(n=new Ue(e)),t&&n&&n.vmCount++,n}function Ke(e,t,n,r,i){var o=new Oe,a=Object.getOwnPropertyDescriptor(e,t);if(!a||!1!==a.configurable){var s=a&&a.get,c=a&&a.set;s&&!c||2!==arguments.length||(n=e[t]);var u=!i&&Je(n);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=s?s.call(e):n;return Oe.target&&(o.depend(),u&&(u.dep.depend(),Array.isArray(t)&&Ze(t))),t},set:function(t){var r=s?s.call(e):n;t===r||t!=t&&r!=r||s&&!c||(c?c.call(e,t):n=t,u=!i&&Je(t),o.notify())}})}}function qe(e,t,n){if(Array.isArray(e)&&p(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var r=e.__ob__;return e._isVue||r&&r.vmCount?n:r?(Ke(r.value,t,n),r.dep.notify(),n):(e[t]=n,n)}function We(e,t){if(Array.isArray(e)&&p(t))e.splice(t,1);else{var n=e.__ob__;e._isVue||n&&n.vmCount||$(e,t)&&(delete e[t],n&&n.dep.notify())}}function Ze(e){for(var t=void 0,n=0,r=e.length;n<r;n++)(t=e[n])&&t.__ob__&&t.__ob__.dep.depend(),Array.isArray(t)&&Ze(t)}Ue.prototype.walk=function(e){for(var t=Object.keys(e),n=0;n<t.length;n++)Ke(e,t[n])},Ue.prototype.observeArray=function(e){for(var t=0,n=e.length;t<n;t++)Je(e[t])};var Ge=V.optionMergeStrategies;function Xe(e,t){if(!t)return e;for(var n,r,i,o=ye?Reflect.ownKeys(t):Object.keys(t),a=0;a<o.length;a++)"__ob__"!==(n=o[a])&&(r=e[n],i=t[n],$(e,n)?r!==i&&l(r)&&l(i)&&Xe(r,i):qe(e,n,i));return e}function Ye(e,t,n){return n?function(){var r="function"==typeof t?t.call(n,n):t,i="function"==typeof e?e.call(n,n):e;return r?Xe(r,i):i}:t?e?function(){return Xe("function"==typeof t?t.call(this,this):t,"function"==typeof e?e.call(this,this):e)}:t:e}function Qe(e,t){var n=t?e?e.concat(t):Array.isArray(t)?t:[t]:e;return n?et(n):n}function et(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}function tt(e,t,n,r){var i=Object.create(e||null);return t?E(i,t):i}Ge.data=function(e,t,n){return n?Ye(e,t,n):t&&"function"!=typeof t?e:Ye(e,t)},z.forEach(function(e){Ge[e]=Qe}),U.forEach(function(e){Ge[e+"s"]=tt}),Ge.watch=function(e,t,n,r){if(e===le&&(e=void 0),t===le&&(t=void 0),!t)return Object.create(e||null);if(!e)return t;var i={};for(var o in E(i,e),t){var a=i[o],s=t[o];a&&!Array.isArray(a)&&(a=[a]),i[o]=a?a.concat(s):Array.isArray(s)?s:[s]}return i},Ge.props=Ge.methods=Ge.inject=Ge.computed=function(e,t,n,r){if(!e)return t;var i=Object.create(null);return E(i,e),t&&E(i,t),i},Ge.provide=Ye;var nt=function(e,t){return void 0===t?e:t};function rt(e){for(var t in e.components)it(t)}function it(e){new RegExp("^[a-zA-Z][\\-\\.0-9_"+J.source+"]*$").test(e)||we('Invalid component name: "'+e+'". Component names should conform to valid custom element name in html5 specification.'),(y(e)||V.isReservedTag(e))&&we("Do not use built-in or reserved HTML elements as component id: "+e)}function ot(e,t){var n=e.props;if(n){var r,i,o={};if(Array.isArray(n))for(r=n.length;r--;)"string"==typeof(i=n[r])&&(o[C(i)]={type:null});else if(l(n))for(var a in n)i=n[a],o[C(a)]=l(i)?i:{type:i};else 0;e.props=o}}function at(e,t){var n=e.inject;if(n){var r=e.inject={};if(Array.isArray(n))for(var i=0;i<n.length;i++)r[n[i]]={from:n[i]};else if(l(n))for(var o in n){var a=n[o];r[o]=l(a)?E({from:o},a):{from:a}}else 0}}function st(e){var t=e.directives;if(t)for(var n in t){var r=t[n];"function"==typeof r&&(t[n]={bind:r,update:r})}}function ct(e,t,n){l(t)||we('Invalid value for option "'+e+'": expected an Object, but got '+u(t)+".",n)}function ut(e,t,n){if("function"==typeof t&&(t=t.options),ot(t,n),at(t,n),st(t),!t._base&&(t.extends&&(e=ut(e,t.extends,n)),t.mixins))for(var r=0,i=t.mixins.length;r<i;r++)e=ut(e,t.mixins[r],n);var o,a={};for(o in e)s(o);for(o in t)$(e,o)||s(o);function s(r){var i=Ge[r]||nt;a[r]=i(e[r],t[r],n,r)}return a}function lt(e,t,n,r){if("string"==typeof n){var i=e[t];if($(i,n))return i[n];var o=C(n);if($(i,o))return i[o];var a=A(o);if($(i,a))return i[a];var s=i[n]||i[o]||i[a];return s}}function ft(e,t,n,r){var i=t[e],o=!$(n,e),a=n[e],s=gt(Boolean,i.type);if(s>-1)if(o&&!$(i,"default"))a=!1;else if(""===a||a===O(e)){var c=gt(String,i.type);(c<0||s<c)&&(a=!0)}if(void 0===a){a=pt(r,i,e);var u=He;Be(!0),Je(a),Be(u)}return a}function pt(e,t,n){if($(t,"default")){var r=t.default;return e&&e.$options.propsData&&void 0===e.$options.propsData[n]&&void 0!==e._props[n]?e._props[n]:"function"==typeof r&&"Function"!==mt(t.type)?r.call(e):r}}function dt(e,t,n,r,i){if(e.required&&i)we('Missing required prop: "'+t+'"',r);else if(null!=n||e.required){var o=e.type,a=!o||!0===o,s=[];if(o){Array.isArray(o)||(o=[o]);for(var c=0;c<o.length&&!a;c++){var u=ht(n,o[c]);s.push(u.expectedType||""),a=u.valid}}if(a){var l=e.validator;l&&(l(n)||we('Invalid prop: custom validator check failed for prop "'+t+'".',r))}else we(_t(t,n,s),r)}}var vt=/^(String|Number|Boolean|Function|Symbol)$/;function ht(e,t){var n,r=mt(t);if(vt.test(r)){var i=typeof e;(n=i===r.toLowerCase())||"object"!==i||(n=e instanceof t)}else n="Object"===r?l(e):"Array"===r?Array.isArray(e):e instanceof t;return{valid:n,expectedType:r}}function mt(e){var t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:""}function yt(e,t){return mt(e)===mt(t)}function gt(e,t){if(!Array.isArray(t))return yt(t,e)?0:-1;for(var n=0,r=t.length;n<r;n++)if(yt(t[n],e))return n;return-1}function _t(e,t,n){var r='Invalid prop: type check failed for prop "'+e+'". Expected '+n.map(A).join(", "),i=n[0],o=u(t),a=bt(t,i),s=bt(t,o);return 1===n.length&&$t(i)&&!wt(i,o)&&(r+=" with value "+a),r+=", got "+o+" ",$t(o)&&(r+="with value "+s+"."),r}function bt(e,t){return"String"===t?'"'+e+'"':"Number"===t?""+Number(e):""+e}function $t(e){return["string","number","boolean"].some(function(t){return e.toLowerCase()===t})}function wt(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return e.some(function(e){return"boolean"===e.toLowerCase()})}function xt(e,t,n){Te();try{if(t)for(var r=t;r=r.$parent;){var i=r.$options.errorCaptured;if(i)for(var o=0;o<i.length;o++)try{if(!1===i[o].call(r,e,t,n))return}catch(Xl){At(Xl,r,"errorCaptured hook")}}At(e,t,n)}finally{Ne()}}function Ct(e,t,n,r,i){var o;try{(o=n?e.apply(t,n):e.call(t))&&!o._isVue&&d(o)&&!o._handled&&(o.catch(function(e){return xt(e,r,i+" (Promise/async)")}),o._handled=!0)}catch(Xl){xt(Xl,r,i)}return o}function At(e,t,n){if(V.errorHandler)try{return V.errorHandler.call(null,e,t,n)}catch(Xl){Xl!==e&&kt(Xl,null,"config.errorHandler")}kt(e,t,n)}function kt(e,t,n){if(!Y&&!Q||"undefined"==typeof console)throw e;console.error(e)}var Ot,St,Tt,Nt,jt,Et,Mt,Dt,Lt,It,Ft,Pt,Rt=!1,Ht=[],Bt=!1;function Ut(){Bt=!1;var e=Ht.slice(0);Ht.length=0;for(var t=0;t<e.length;t++)e[t]()}if("undefined"!=typeof Promise&&he(Promise)){var zt=Promise.resolve();Ot=function(){zt.then(Ut),ae&&setTimeout(D)},Rt=!0}else if(ne||"undefined"==typeof MutationObserver||!he(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())Ot="undefined"!=typeof setImmediate&&he(setImmediate)?function(){setImmediate(Ut)}:function(){setTimeout(Ut,0)};else{var Vt=1,Jt=new MutationObserver(Ut),Kt=document.createTextNode(String(Vt));Jt.observe(Kt,{characterData:!0}),Ot=function(){Vt=(Vt+1)%2,Kt.data=String(Vt)},Rt=!0}function qt(e,t){var n;if(Ht.push(function(){if(e)try{e.call(t)}catch(Xl){xt(Xl,t,"nextTick")}else n&&n(t)}),Bt||(Bt=!0,Ot()),!e&&"undefined"!=typeof Promise)return new Promise(function(e){n=e})}var Wt=new me;function Zt(e){Gt(e,Wt),Wt.clear()}function Gt(e,t){var n,r,i=Array.isArray(e);if(!(!i&&!s(e)||Object.isFrozen(e)||e instanceof je)){if(e.__ob__){var o=e.__ob__.dep.id;if(t.has(o))return;t.add(o)}if(i)for(n=e.length;n--;)Gt(e[n],t);else for(n=(r=Object.keys(e)).length;n--;)Gt(e[r[n]],t)}}var Xt=w(function(e){var t="&"===e.charAt(0),n="~"===(e=t?e.slice(1):e).charAt(0),r="!"===(e=n?e.slice(1):e).charAt(0);return{name:e=r?e.slice(1):e,once:n,capture:r,passive:t}});function Yt(e,t){function n(){var e=arguments,r=n.fns;if(!Array.isArray(r))return Ct(r,null,arguments,t,"v-on handler");for(var i=r.slice(),o=0;o<i.length;o++)Ct(i[o],null,e,t,"v-on handler")}return n.fns=e,n}function Qt(e,t,r,o,a,s){var c,u,l,f;for(c in e)u=e[c],l=t[c],f=Xt(c),n(u)||(n(l)?(n(u.fns)&&(u=e[c]=Yt(u,s)),i(f.once)&&(u=e[c]=a(f.name,u,f.capture)),r(f.name,u,f.capture,f.passive,f.params)):u!==l&&(l.fns=u,e[c]=l));for(c in t)n(e[c])&&o((f=Xt(c)).name,t[c],f.capture)}function en(e,t,o){var a;e instanceof je&&(e=e.data.hook||(e.data.hook={}));var s=e[t];function c(){o.apply(this,arguments),_(a.fns,c)}n(s)?a=Yt([c]):r(s.fns)&&i(s.merged)?(a=s).fns.push(c):a=Yt([s,c]),a.merged=!0,e[t]=a}function tn(e,t,i){var o=t.options.props;if(!n(o)){var a={},s=e.attrs,c=e.props;if(r(s)||r(c))for(var u in o){var l=O(u);nn(a,c,u,l,!0)||nn(a,s,u,l,!1)}return a}}function nn(e,t,n,i,o){if(r(t)){if($(t,n))return e[n]=t[n],o||delete t[n],!0;if($(t,i))return e[n]=t[i],o||delete t[i],!0}return!1}function rn(e){for(var t=0;t<e.length;t++)if(Array.isArray(e[t]))return Array.prototype.concat.apply([],e);return e}function on(e){return a(e)?[De(e)]:Array.isArray(e)?sn(e):void 0}function an(e){return r(e)&&r(e.text)&&o(e.isComment)}function sn(e,t){var o,s,c,u,l=[];for(o=0;o<e.length;o++)n(s=e[o])||"boolean"==typeof s||(u=l[c=l.length-1],Array.isArray(s)?s.length>0&&(an((s=sn(s,(t||"")+"_"+o))[0])&&an(u)&&(l[c]=De(u.text+s[0].text),s.shift()),l.push.apply(l,s)):a(s)?an(u)?l[c]=De(u.text+s):""!==s&&l.push(De(s)):an(s)&&an(u)?l[c]=De(u.text+s.text):(i(e._isVList)&&r(s.tag)&&n(s.key)&&r(t)&&(s.key="__vlist"+t+"_"+o+"__"),l.push(s)));return l}function cn(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}function un(e){var t=ln(e.$options.inject,e);t&&(Be(!1),Object.keys(t).forEach(function(n){Ke(e,n,t[n])}),Be(!0))}function ln(e,t){if(e){for(var n=Object.create(null),r=ye?Reflect.ownKeys(e):Object.keys(e),i=0;i<r.length;i++){var o=r[i];if("__ob__"!==o){for(var a=e[o].from,s=t;s;){if(s._provided&&$(s._provided,a)){n[o]=s._provided[a];break}s=s.$parent}if(!s)if("default"in e[o]){var c=e[o].default;n[o]="function"==typeof c?c.call(t):c}else 0}}return n}}function fn(e,t){if(!e||!e.length)return{};for(var n={},r=0,i=e.length;r<i;r++){var o=e[r],a=o.data;if(a&&a.attrs&&a.attrs.slot&&delete a.attrs.slot,o.context!==t&&o.fnContext!==t||!a||null==a.slot)(n.default||(n.default=[])).push(o);else{var s=a.slot,c=n[s]||(n[s]=[]);"template"===o.tag?c.push.apply(c,o.children||[]):c.push(o)}}for(var u in n)n[u].every(pn)&&delete n[u];return n}function pn(e){return e.isComment&&!e.asyncFactory||" "===e.text}function dn(e,n,r){var i,o=Object.keys(n).length>0,a=e?!!e.$stable:!o,s=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(a&&r&&r!==t&&s===r.$key&&!o&&!r.$hasNormal)return r;for(var c in i={},e)e[c]&&"$"!==c[0]&&(i[c]=vn(n,c,e[c]))}else i={};for(var u in n)u in i||(i[u]=hn(n,u));return e&&Object.isExtensible(e)&&(e._normalized=i),q(i,"$stable",a),q(i,"$key",s),q(i,"$hasNormal",o),i}function vn(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({});return(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:on(e))&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function hn(e,t){return function(){return e[t]}}function mn(e,t){var n,i,o,a,c;if(Array.isArray(e)||"string"==typeof e)for(n=new Array(e.length),i=0,o=e.length;i<o;i++)n[i]=t(e[i],i);else if("number"==typeof e)for(n=new Array(e),i=0;i<e;i++)n[i]=t(i+1,i);else if(s(e))if(ye&&e[Symbol.iterator]){n=[];for(var u=e[Symbol.iterator](),l=u.next();!l.done;)n.push(t(l.value,n.length)),l=u.next()}else for(a=Object.keys(e),n=new Array(a.length),i=0,o=a.length;i<o;i++)c=a[i],n[i]=t(e[c],c,i);return r(n)||(n=[]),n._isVList=!0,n}function yn(e,t,n,r){var i,o=this.$scopedSlots[e];o?(n=n||{},r&&(n=E(E({},r),n)),i=o(n)||t):i=this.$slots[e]||t;var a=n&&n.slot;return a?this.$createElement("template",{slot:a},i):i}function gn(e){return lt(this.$options,"filters",e,!0)||I}function _n(e,t){return Array.isArray(e)?-1===e.indexOf(t):e!==t}function bn(e,t,n,r,i){var o=V.keyCodes[t]||n;return i&&r&&!V.keyCodes[t]?_n(i,r):o?_n(o,e):r?O(r)!==t:void 0}function $n(e,t,n,r,i){if(n)if(s(n)){var o;Array.isArray(n)&&(n=M(n));var a=function(a){if("class"===a||"style"===a||g(a))o=e;else{var s=e.attrs&&e.attrs.type;o=r||V.mustUseProp(t,s,a)?e.domProps||(e.domProps={}):e.attrs||(e.attrs={})}var c=C(a),u=O(a);c in o||u in o||(o[a]=n[a],i&&((e.on||(e.on={}))["update:"+a]=function(e){n[a]=e}))};for(var c in n)a(c)}else;return e}function wn(e,t){var n=this._staticTrees||(this._staticTrees=[]),r=n[e];return r&&!t?r:(Cn(r=n[e]=this.$options.staticRenderFns[e].call(this._renderProxy,null,this),"__static__"+e,!1),r)}function xn(e,t,n){return Cn(e,"__once__"+t+(n?"_"+n:""),!0),e}function Cn(e,t,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]&&"string"!=typeof e[r]&&An(e[r],t+"_"+r,n);else An(e,t,n)}function An(e,t,n){e.isStatic=!0,e.key=t,e.isOnce=n}function kn(e,t){if(t)if(l(t)){var n=e.on=e.on?E({},e.on):{};for(var r in t){var i=n[r],o=t[r];n[r]=i?[].concat(i,o):o}}else;return e}function On(e,t,n,r){t=t||{$stable:!n};for(var i=0;i<e.length;i++){var o=e[i];Array.isArray(o)?On(o,t,n):o&&(o.proxy&&(o.fn.proxy=!0),t[o.key]=o.fn)}return r&&(t.$key=r),t}function Sn(e,t){for(var n=0;n<t.length;n+=2){var r=t[n];"string"==typeof r&&r&&(e[t[n]]=t[n+1])}return e}function Tn(e,t){return"string"==typeof e?t+e:e}function Nn(e){e._o=xn,e._n=h,e._s=v,e._l=mn,e._t=yn,e._q=P,e._i=R,e._m=wn,e._f=gn,e._k=bn,e._b=$n,e._v=De,e._e=Me,e._u=On,e._g=kn,e._d=Sn,e._p=Tn}function jn(e,n,r,o,a){var s,c=this,u=a.options;$(o,"_uid")?(s=Object.create(o))._original=o:(s=o,o=o._original);var l=i(u._compiled),f=!l;this.data=e,this.props=n,this.children=r,this.parent=o,this.listeners=e.on||t,this.injections=ln(u.inject,o),this.slots=function(){return c.$slots||dn(e.scopedSlots,c.$slots=fn(r,o)),c.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return dn(e.scopedSlots,this.slots())}}),l&&(this.$options=u,this.$slots=this.slots(),this.$scopedSlots=dn(e.scopedSlots,this.$slots)),u._scopeId?this._c=function(e,t,n,r){var i=Vn(s,e,t,n,r,f);return i&&!Array.isArray(i)&&(i.fnScopeId=u._scopeId,i.fnContext=o),i}:this._c=function(e,t,n,r){return Vn(s,e,t,n,r,f)}}function En(e,n,i,o,a){var s=e.options,c={},u=s.props;if(r(u))for(var l in u)c[l]=ft(l,u,n||t);else r(i.attrs)&&Dn(c,i.attrs),r(i.props)&&Dn(c,i.props);var f=new jn(i,c,a,o,e),p=s.render.call(null,f._c,f);if(p instanceof je)return Mn(p,i,f.parent,s,f);if(Array.isArray(p)){for(var d=on(p)||[],v=new Array(d.length),h=0;h<d.length;h++)v[h]=Mn(d[h],i,f.parent,s,f);return v}}function Mn(e,t,n,r,i){var o=Le(e);return o.fnContext=n,o.fnOptions=r,t.slot&&((o.data||(o.data={})).slot=t.slot),o}function Dn(e,t){for(var n in t)e[C(n)]=t[n]}Nn(jn.prototype);var Ln={init:function(e,t){if(e.componentInstance&&!e.componentInstance._isDestroyed&&e.data.keepAlive){var n=e;Ln.prepatch(n,n)}else{(e.componentInstance=Pn(e,ur)).$mount(t?e.elm:void 0,t)}},prepatch:function(e,t){var n=t.componentOptions;hr(t.componentInstance=e.componentInstance,n.propsData,n.listeners,t,n.children)},insert:function(e){var t=e.context,n=e.componentInstance;n._isMounted||(n._isMounted=!0,_r(n,"mounted")),e.data.keepAlive&&(t._isMounted?Dr(n):yr(n,!0))},destroy:function(e){var t=e.componentInstance;t._isDestroyed||(e.data.keepAlive?gr(t,!0):t.$destroy())}},In=Object.keys(Ln);function Fn(e,t,o,a,c){if(!n(e)){var u=o.$options._base;if(s(e)&&(e=u.extend(e)),"function"==typeof e){var l;if(n(e.cid)&&void 0===(e=er(l=e,u)))return Qn(l,t,o,a,c);t=t||{},ri(e),r(t.model)&&Bn(e.options,t);var f=tn(t,e,c);if(i(e.options.functional))return En(e,f,t,o,a);var p=t.on;if(t.on=t.nativeOn,i(e.options.abstract)){var d=t.slot;t={},d&&(t.slot=d)}Rn(t);var v=e.options.name||c;return new je("vue-component-"+e.cid+(v?"-"+v:""),t,void 0,void 0,void 0,o,{Ctor:e,propsData:f,listeners:p,tag:c,children:a},l)}}}function Pn(e,t){var n={_isComponent:!0,_parentVnode:e,parent:t},i=e.data.inlineTemplate;return r(i)&&(n.render=i.render,n.staticRenderFns=i.staticRenderFns),new e.componentOptions.Ctor(n)}function Rn(e){for(var t=e.hook||(e.hook={}),n=0;n<In.length;n++){var r=In[n],i=t[r],o=Ln[r];i===o||i&&i._merged||(t[r]=i?Hn(o,i):o)}}function Hn(e,t){var n=function(n,r){e(n,r),t(n,r)};return n._merged=!0,n}function Bn(e,t){var n=e.model&&e.model.prop||"value",i=e.model&&e.model.event||"input";(t.attrs||(t.attrs={}))[n]=t.model.value;var o=t.on||(t.on={}),a=o[i],s=t.model.callback;r(a)?(Array.isArray(a)?-1===a.indexOf(s):a!==s)&&(o[i]=[s].concat(a)):o[i]=s}var Un=1,zn=2;function Vn(e,t,n,r,o,s){return(Array.isArray(n)||a(n))&&(o=r,r=n,n=void 0),i(s)&&(o=zn),Jn(e,t,n,r,o)}function Jn(e,t,n,i,o){if(r(n)&&r(n.__ob__))return Me();if(r(n)&&r(n.is)&&(t=n.is),!t)return Me();var a,s,c;(Array.isArray(i)&&"function"==typeof i[0]&&((n=n||{}).scopedSlots={default:i[0]},i.length=0),o===zn?i=on(i):o===Un&&(i=rn(i)),"string"==typeof t)?(s=e.$vnode&&e.$vnode.ns||V.getTagNamespace(t),a=V.isReservedTag(t)?new je(V.parsePlatformTagName(t),n,i,void 0,void 0,e):n&&n.pre||!r(c=lt(e.$options,"components",t))?new je(t,n,i,void 0,void 0,e):Fn(c,n,e,i,t)):a=Fn(t,n,e,i);return Array.isArray(a)?a:r(a)?(r(s)&&Kn(a,s),r(n)&&qn(n),a):Me()}function Kn(e,t,o){if(e.ns=t,"foreignObject"===e.tag&&(t=void 0,o=!0),r(e.children))for(var a=0,s=e.children.length;a<s;a++){var c=e.children[a];r(c.tag)&&(n(c.ns)||i(o)&&"svg"!==c.tag)&&Kn(c,t,o)}}function qn(e){s(e.style)&&Zt(e.style),s(e.class)&&Zt(e.class)}function Wn(e){e._vnode=null,e._staticTrees=null;var n=e.$options,r=e.$vnode=n._parentVnode,i=r&&r.context;e.$slots=fn(n._renderChildren,i),e.$scopedSlots=t,e._c=function(t,n,r,i){return Vn(e,t,n,r,i,!1)},e.$createElement=function(t,n,r,i){return Vn(e,t,n,r,i,!0)};var o=r&&r.data;Ke(e,"$attrs",o&&o.attrs||t,null,!0),Ke(e,"$listeners",n._parentListeners||t,null,!0)}var Zn,Gn=null;function Xn(e){Nn(e.prototype),e.prototype.$nextTick=function(e){return qt(e,this)},e.prototype._render=function(){var e,t=this,n=t.$options,r=n.render,i=n._parentVnode;i&&(t.$scopedSlots=dn(i.data.scopedSlots,t.$slots,t.$scopedSlots)),t.$vnode=i;try{Gn=t,e=r.call(t._renderProxy,t.$createElement)}catch(Xl){xt(Xl,t,"render"),e=t._vnode}finally{Gn=null}return Array.isArray(e)&&1===e.length&&(e=e[0]),e instanceof je||(e=Me()),e.parent=i,e}}function Yn(e,t){return(e.__esModule||ye&&"Module"===e[Symbol.toStringTag])&&(e=e.default),s(e)?t.extend(e):e}function Qn(e,t,n,r,i){var o=Me();return o.asyncFactory=e,o.asyncMeta={data:t,context:n,children:r,tag:i},o}function er(e,t){if(i(e.error)&&r(e.errorComp))return e.errorComp;if(r(e.resolved))return e.resolved;var o=Gn;if(o&&r(e.owners)&&-1===e.owners.indexOf(o)&&e.owners.push(o),i(e.loading)&&r(e.loadingComp))return e.loadingComp;if(o&&!r(e.owners)){var a=e.owners=[o],c=!0,u=null,l=null;o.$on("hook:destroyed",function(){return _(a,o)});var f=function(e){for(var t=0,n=a.length;t<n;t++)a[t].$forceUpdate();e&&(a.length=0,null!==u&&(clearTimeout(u),u=null),null!==l&&(clearTimeout(l),l=null))},p=H(function(n){e.resolved=Yn(n,t),c?a.length=0:f(!0)}),v=H(function(t){r(e.errorComp)&&(e.error=!0,f(!0))}),h=e(p,v);return s(h)&&(d(h)?n(e.resolved)&&h.then(p,v):d(h.component)&&(h.component.then(p,v),r(h.error)&&(e.errorComp=Yn(h.error,t)),r(h.loading)&&(e.loadingComp=Yn(h.loading,t),0===h.delay?e.loading=!0:u=setTimeout(function(){u=null,n(e.resolved)&&n(e.error)&&(e.loading=!0,f(!1))},h.delay||200)),r(h.timeout)&&(l=setTimeout(function(){l=null,n(e.resolved)&&v(null)},h.timeout)))),c=!1,e.loading?e.loadingComp:e.resolved}}function tr(e){return e.isComment&&e.asyncFactory}function nr(e){if(Array.isArray(e))for(var t=0;t<e.length;t++){var n=e[t];if(r(n)&&(r(n.componentOptions)||tr(n)))return n}}function rr(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&sr(e,t)}function ir(e,t){Zn.$on(e,t)}function or(e,t){Zn.$off(e,t)}function ar(e,t){var n=Zn;return function r(){null!==t.apply(null,arguments)&&n.$off(e,r)}}function sr(e,t,n){Zn=e,Qt(t,n||{},ir,or,ar,e),Zn=void 0}function cr(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i<o;i++)r.$on(e[i],n);else(r._events[e]||(r._events[e]=[])).push(n),t.test(e)&&(r._hasHookEvent=!0);return r},e.prototype.$once=function(e,t){var n=this;function r(){n.$off(e,r),t.apply(n,arguments)}return r.fn=t,n.$on(e,r),n},e.prototype.$off=function(e,t){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(Array.isArray(e)){for(var r=0,i=e.length;r<i;r++)n.$off(e[r],t);return n}var o,a=n._events[e];if(!a)return n;if(!t)return n._events[e]=null,n;for(var s=a.length;s--;)if((o=a[s])===t||o.fn===t){a.splice(s,1);break}return n},e.prototype.$emit=function(e){var t=this,n=t._events[e];if(n){n=n.length>1?j(n):n;for(var r=j(arguments,1),i='event handler for "'+e+'"',o=0,a=n.length;o<a;o++)Ct(n[o],t,r,t,i)}return t}}var ur=null,lr=!1;function fr(e){var t=ur;return ur=e,function(){ur=t}}function pr(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}function dr(e){e.prototype._update=function(e,t){var n=this,r=n.$el,i=n._vnode,o=fr(n);n._vnode=e,n.$el=i?n.__patch__(i,e):n.__patch__(n.$el,e,t,!1),o(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},e.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},e.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){_r(e,"beforeDestroy"),e._isBeingDestroyed=!0;var t=e.$parent;!t||t._isBeingDestroyed||e.$options.abstract||_(t.$children,e),e._watcher&&e._watcher.teardown();for(var n=e._watchers.length;n--;)e._watchers[n].teardown();e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),_r(e,"destroyed"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}}function vr(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=Me),_r(e,"beforeMount"),r=function(){e._update(e._render(),n)},new Pr(e,r,D,{before:function(){e._isMounted&&!e._isDestroyed&&_r(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,_r(e,"mounted")),e}function hr(e,n,r,i,o){var a=i.data.scopedSlots,s=e.$scopedSlots,c=!!(a&&!a.$stable||s!==t&&!s.$stable||a&&e.$scopedSlots.$key!==a.$key),u=!!(o||e.$options._renderChildren||c);if(e.$options._parentVnode=i,e.$vnode=i,e._vnode&&(e._vnode.parent=i),e.$options._renderChildren=o,e.$attrs=i.data.attrs||t,e.$listeners=r||t,n&&e.$options.props){Be(!1);for(var l=e._props,f=e.$options._propKeys||[],p=0;p<f.length;p++){var d=f[p],v=e.$options.props;l[d]=ft(d,v,n,e)}Be(!0),e.$options.propsData=n}r=r||t;var h=e.$options._parentListeners;e.$options._parentListeners=r,sr(e,r,h),u&&(e.$slots=fn(o,i.context),e.$forceUpdate())}function mr(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}function yr(e,t){if(t){if(e._directInactive=!1,mr(e))return}else if(e._directInactive)return;if(e._inactive||null===e._inactive){e._inactive=!1;for(var n=0;n<e.$children.length;n++)yr(e.$children[n]);_r(e,"activated")}}function gr(e,t){if(!(t&&(e._directInactive=!0,mr(e))||e._inactive)){e._inactive=!0;for(var n=0;n<e.$children.length;n++)gr(e.$children[n]);_r(e,"deactivated")}}function _r(e,t){Te();var n=e.$options[t],r=t+" hook";if(n)for(var i=0,o=n.length;i<o;i++)Ct(n[i],e,null,e,r);e._hasHookEvent&&e.$emit("hook:"+t),Ne()}var br=100,$r=[],wr=[],xr={},Cr={},Ar=!1,kr=!1,Or=0;function Sr(){Or=$r.length=wr.length=0,xr={},Ar=kr=!1}var Tr=0,Nr=Date.now;if(Y&&!ne){var jr=window.performance;jr&&"function"==typeof jr.now&&Nr()>document.createEvent("Event").timeStamp&&(Nr=function(){return jr.now()})}function Er(){var e,t;for(Tr=Nr(),kr=!0,$r.sort(function(e,t){return e.id-t.id}),Or=0;Or<$r.length;Or++)(e=$r[Or]).before&&e.before(),t=e.id,xr[t]=null,e.run();var n=wr.slice(),r=$r.slice();Sr(),Lr(n),Mr(r),ve&&V.devtools&&ve.emit("flush")}function Mr(e){for(var t=e.length;t--;){var n=e[t],r=n.vm;r._watcher===n&&r._isMounted&&!r._isDestroyed&&_r(r,"updated")}}function Dr(e){e._inactive=!1,wr.push(e)}function Lr(e){for(var t=0;t<e.length;t++)e[t]._inactive=!0,yr(e[t],!0)}function Ir(e){var t=e.id;if(null==xr[t]){if(xr[t]=!0,kr){for(var n=$r.length-1;n>Or&&$r[n].id>e.id;)n--;$r.splice(n+1,0,e)}else $r.push(e);Ar||(Ar=!0,qt(Er))}}var Fr=0,Pr=function(e,t,n,r,i){this.vm=e,i&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++Fr,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new me,this.newDepIds=new me,this.expression="","function"==typeof t?this.getter=t:(this.getter=Z(t),this.getter||(this.getter=D)),this.value=this.lazy?void 0:this.get()};Pr.prototype.get=function(){var e;Te(this);var t=this.vm;try{e=this.getter.call(t,t)}catch(Xl){if(!this.user)throw Xl;xt(Xl,t,'getter for watcher "'+this.expression+'"')}finally{this.deep&&Zt(e),Ne(),this.cleanupDeps()}return e},Pr.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},Pr.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},Pr.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():Ir(this)},Pr.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||s(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(Xl){xt(Xl,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},Pr.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},Pr.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},Pr.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||_(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Rr={enumerable:!0,configurable:!0,get:D,set:D};function Hr(e,t,n){Rr.get=function(){return this[t][n]},Rr.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Rr)}function Br(e){e._watchers=[];var t=e.$options;t.props&&Ur(e,t.props),t.methods&&Gr(e,t.methods),t.data?zr(e):Je(e._data={},!0),t.computed&&Kr(e,t.computed),t.watch&&t.watch!==le&&Xr(e,t.watch)}function Ur(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[],o=!e.$parent;o||Be(!1);var a=function(o){i.push(o);var a=ft(o,t,n,e);Ke(r,o,a),o in e||Hr(e,"_props",o)};for(var s in t)a(s);Be(!0)}function zr(e){var t=e.$options.data;l(t=e._data="function"==typeof t?Vr(t,e):t||{})||(t={});for(var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);i--;){var o=n[i];0,r&&$(r,o)||K(o)||Hr(e,"_data",o)}Je(t,!0)}function Vr(e,t){Te();try{return e.call(t,t)}catch(Xl){return xt(Xl,t,"data()"),{}}finally{Ne()}}var Jr={lazy:!0};function Kr(e,t){var n=e._computedWatchers=Object.create(null),r=de();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;0,r||(n[i]=new Pr(e,a||D,D,Jr)),i in e||qr(e,i,o)}}function qr(e,t,n){var r=!de();"function"==typeof n?(Rr.get=r?Wr(t):Zr(n),Rr.set=D):(Rr.get=n.get?r&&!1!==n.cache?Wr(t):Zr(n.get):D,Rr.set=n.set||D),Object.defineProperty(e,t,Rr)}function Wr(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),Oe.target&&t.depend(),t.value}}function Zr(e){return function(){return e.call(this,this)}}function Gr(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?D:N(t[n],e)}function Xr(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)Yr(e,n,r[i]);else Yr(e,n,r)}}function Yr(e,t,n,r){return l(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=e[n]),e.$watch(t,n,r)}function Qr(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=qe,e.prototype.$delete=We,e.prototype.$watch=function(e,t,n){if(l(t))return Yr(this,e,t,n);(n=n||{}).user=!0;var r=new Pr(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(i){xt(i,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}var ei=0;function ti(e){e.prototype._init=function(e){var t=this;t._uid=ei++,t._isVue=!0,e&&e._isComponent?ni(t,e):t.$options=ut(ri(t.constructor),e||{},t),t._renderProxy=t,t._self=t,pr(t),rr(t),Wn(t),_r(t,"beforeCreate"),un(t),Br(t),cn(t),_r(t,"created"),t.$options.el&&t.$mount(t.$options.el)}}function ni(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}function ri(e){var t=e.options;if(e.super){var n=ri(e.super);if(n!==e.superOptions){e.superOptions=n;var r=ii(e);r&&E(e.extendOptions,r),(t=e.options=ut(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function ii(e){var t,n=e.options,r=e.sealedOptions;for(var i in n)n[i]!==r[i]&&(t||(t={}),t[i]=n[i]);return t}function oi(e){this._init(e)}function ai(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=j(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}function si(e){e.mixin=function(e){return this.options=ut(this.options,e),this}}function ci(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,i=e._Ctor||(e._Ctor={});if(i[r])return i[r];var o=e.name||n.options.name;var a=function(e){this._init(e)};return(a.prototype=Object.create(n.prototype)).constructor=a,a.cid=t++,a.options=ut(n.options,e),a.super=n,a.options.props&&ui(a),a.options.computed&&li(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,U.forEach(function(e){a[e]=n[e]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=e,a.sealedOptions=E({},a.options),i[r]=a,a}}function ui(e){var t=e.options.props;for(var n in t)Hr(e.prototype,"_props",n)}function li(e){var t=e.options.computed;for(var n in t)qr(e.prototype,n,t[n])}function fi(e){U.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&l(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}function pi(e){return e&&(e.Ctor.options.name||e.tag)}function di(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!f(e)&&e.test(t)}function vi(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=pi(a.componentOptions);s&&!t(s)&&hi(n,o,r,i)}}}function hi(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,_(n,t)}ti(oi),Qr(oi),cr(oi),dr(oi),Xn(oi);var mi=[String,RegExp,Array],yi={name:"keep-alive",abstract:!0,props:{include:mi,exclude:mi,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)hi(this.cache,e,this.keys)},mounted:function(){var e=this;this.$watch("include",function(t){vi(e,function(e){return di(t,e)})}),this.$watch("exclude",function(t){vi(e,function(e){return!di(t,e)})})},render:function(){var e=this.$slots.default,t=nr(e),n=t&&t.componentOptions;if(n){var r=pi(n),i=this.include,o=this.exclude;if(i&&(!r||!di(i,r))||o&&r&&di(o,r))return t;var a=this.cache,s=this.keys,c=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;a[c]?(t.componentInstance=a[c].componentInstance,_(s,c),s.push(c)):(a[c]=t,s.push(c),this.max&&s.length>parseInt(this.max)&&hi(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}},gi={KeepAlive:yi};function _i(e){var t={get:function(){return V}};Object.defineProperty(e,"config",t),e.util={warn:we,extend:E,mergeOptions:ut,defineReactive:Ke},e.set=qe,e.delete=We,e.nextTick=qt,e.observable=function(e){return Je(e),e},e.options=Object.create(null),U.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,E(e.options.components,gi),ai(e),si(e),ci(e),fi(e)}_i(oi),Object.defineProperty(oi.prototype,"$isServer",{get:de}),Object.defineProperty(oi.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(oi,"FunctionalRenderContext",{value:jn}),oi.version="2.6.11";var bi=m("style,class"),$i=m("input,textarea,option,select,progress"),wi=function(e,t,n){return"value"===n&&$i(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},xi=m("contenteditable,draggable,spellcheck"),Ci=m("events,caret,typing,plaintext-only"),Ai=function(e,t){return Ni(t)||"false"===t?"false":"contenteditable"===e&&Ci(t)?t:"true"},ki=m("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Oi="http://www.w3.org/1999/xlink",Si=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Ti=function(e){return Si(e)?e.slice(6,e.length):""},Ni=function(e){return null==e||!1===e};function ji(e){for(var t=e.data,n=e,i=e;r(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=Ei(i.data,t));for(;r(n=n.parent);)n&&n.data&&(t=Ei(t,n.data));return Mi(t.staticClass,t.class)}function Ei(e,t){return{staticClass:Di(e.staticClass,t.staticClass),class:r(e.class)?[e.class,t.class]:t.class}}function Mi(e,t){return r(e)||r(t)?Di(e,Li(t)):""}function Di(e,t){return e?t?e+" "+t:e:t||""}function Li(e){return Array.isArray(e)?Ii(e):s(e)?Fi(e):"string"==typeof e?e:""}function Ii(e){for(var t,n="",i=0,o=e.length;i<o;i++)r(t=Li(e[i]))&&""!==t&&(n&&(n+=" "),n+=t);return n}function Fi(e){var t="";for(var n in e)e[n]&&(t&&(t+=" "),t+=n);return t}var Pi={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Ri=m("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),Hi=m("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Bi=function(e){return"pre"===e},Ui=function(e){return Ri(e)||Hi(e)};function zi(e){return Hi(e)?"svg":"math"===e?"math":void 0}var Vi=Object.create(null);function Ji(e){if(!Y)return!0;if(Ui(e))return!1;if(e=e.toLowerCase(),null!=Vi[e])return Vi[e];var t=document.createElement(e);return e.indexOf("-")>-1?Vi[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Vi[e]=/HTMLUnknownElement/.test(t.toString())}var Ki=m("text,number,password,search,email,tel,url");function qi(e){if("string"==typeof e){var t=document.querySelector(e);return t||document.createElement("div")}return e}function Wi(e,t){var n=document.createElement(e);return"select"!==e?n:(t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)}function Zi(e,t){return document.createElementNS(Pi[e],t)}function Gi(e){return document.createTextNode(e)}function Xi(e){return document.createComment(e)}function Yi(e,t,n){e.insertBefore(t,n)}function Qi(e,t){e.removeChild(t)}function eo(e,t){e.appendChild(t)}function to(e){return e.parentNode}function no(e){return e.nextSibling}function ro(e){return e.tagName}function io(e,t){e.textContent=t}function oo(e,t){e.setAttribute(t,"")}var ao=Object.freeze({createElement:Wi,createElementNS:Zi,createTextNode:Gi,createComment:Xi,insertBefore:Yi,removeChild:Qi,appendChild:eo,parentNode:to,nextSibling:no,tagName:ro,setTextContent:io,setStyleScope:oo}),so={create:function(e,t){co(t)},update:function(e,t){e.data.ref!==t.data.ref&&(co(e,!0),co(t))},destroy:function(e){co(e,!0)}};function co(e,t){var n=e.data.ref;if(r(n)){var i=e.context,o=e.componentInstance||e.elm,a=i.$refs;t?Array.isArray(a[n])?_(a[n],o):a[n]===o&&(a[n]=void 0):e.data.refInFor?Array.isArray(a[n])?a[n].indexOf(o)<0&&a[n].push(o):a[n]=[o]:a[n]=o}}var uo=new je("",{},[]),lo=["create","activate","update","remove","destroy"];function fo(e,t){return e.key===t.key&&(e.tag===t.tag&&e.isComment===t.isComment&&r(e.data)===r(t.data)&&po(e,t)||i(e.isAsyncPlaceholder)&&e.asyncFactory===t.asyncFactory&&n(t.asyncFactory.error))}function po(e,t){if("input"!==e.tag)return!0;var n,i=r(n=e.data)&&r(n=n.attrs)&&n.type,o=r(n=t.data)&&r(n=n.attrs)&&n.type;return i===o||Ki(i)&&Ki(o)}function vo(e,t,n){var i,o,a={};for(i=t;i<=n;++i)r(o=e[i].key)&&(a[o]=i);return a}function ho(e){var t,o,s={},c=e.modules,u=e.nodeOps;for(t=0;t<lo.length;++t)for(s[lo[t]]=[],o=0;o<c.length;++o)r(c[o][lo[t]])&&s[lo[t]].push(c[o][lo[t]]);function l(e){var t=u.parentNode(e);r(t)&&u.removeChild(t,e)}function f(e,t,n,o,a,c,l){if(r(e.elm)&&r(c)&&(e=c[l]=Le(e)),e.isRootInsert=!a,!function(e,t,n,o){var a=e.data;if(r(a)){var c=r(e.componentInstance)&&a.keepAlive;if(r(a=a.hook)&&r(a=a.init)&&a(e,!1),r(e.componentInstance))return p(e,t),d(n,e.elm,o),i(c)&&function(e,t,n,i){var o,a=e;for(;a.componentInstance;)if(a=a.componentInstance._vnode,r(o=a.data)&&r(o=o.transition)){for(o=0;o<s.activate.length;++o)s.activate[o](uo,a);t.push(a);break}d(n,e.elm,i)}(e,t,n,o),!0}}(e,t,n,o)){var f=e.data,h=e.children,m=e.tag;r(m)?(e.elm=e.ns?u.createElementNS(e.ns,m):u.createElement(m,e),g(e),v(e,h,t),r(f)&&y(e,t),d(n,e.elm,o)):i(e.isComment)?(e.elm=u.createComment(e.text),d(n,e.elm,o)):(e.elm=u.createTextNode(e.text),d(n,e.elm,o))}}function p(e,t){r(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,h(e)?(y(e,t),g(e)):(co(e),t.push(e))}function d(e,t,n){r(e)&&(r(n)?u.parentNode(n)===e&&u.insertBefore(e,t,n):u.appendChild(e,t))}function v(e,t,n){if(Array.isArray(t)){0;for(var r=0;r<t.length;++r)f(t[r],n,e.elm,null,!0,t,r)}else a(e.text)&&u.appendChild(e.elm,u.createTextNode(String(e.text)))}function h(e){for(;e.componentInstance;)e=e.componentInstance._vnode;return r(e.tag)}function y(e,n){for(var i=0;i<s.create.length;++i)s.create[i](uo,e);r(t=e.data.hook)&&(r(t.create)&&t.create(uo,e),r(t.insert)&&n.push(e))}function g(e){var t;if(r(t=e.fnScopeId))u.setStyleScope(e.elm,t);else for(var n=e;n;)r(t=n.context)&&r(t=t.$options._scopeId)&&u.setStyleScope(e.elm,t),n=n.parent;r(t=ur)&&t!==e.context&&t!==e.fnContext&&r(t=t.$options._scopeId)&&u.setStyleScope(e.elm,t)}function _(e,t,n,r,i,o){for(;r<=i;++r)f(n[r],o,e,t,!1,n,r)}function b(e){var t,n,i=e.data;if(r(i))for(r(t=i.hook)&&r(t=t.destroy)&&t(e),t=0;t<s.destroy.length;++t)s.destroy[t](e);if(r(t=e.children))for(n=0;n<e.children.length;++n)b(e.children[n])}function $(e,t,n){for(;t<=n;++t){var i=e[t];r(i)&&(r(i.tag)?(w(i),b(i)):l(i.elm))}}function w(e,t){if(r(t)||r(e.data)){var n,i=s.remove.length+1;for(r(t)?t.listeners+=i:t=function(e,t){function n(){0==--n.listeners&&l(e)}return n.listeners=t,n}(e.elm,i),r(n=e.componentInstance)&&r(n=n._vnode)&&r(n.data)&&w(n,t),n=0;n<s.remove.length;++n)s.remove[n](e,t);r(n=e.data.hook)&&r(n=n.remove)?n(e,t):t()}else l(e.elm)}function x(e,t,n,i){for(var o=n;o<i;o++){var a=t[o];if(r(a)&&fo(e,a))return o}}function C(e,t,o,a,c,l){if(e!==t){r(t.elm)&&r(a)&&(t=a[c]=Le(t));var p=t.elm=e.elm;if(i(e.isAsyncPlaceholder))r(t.asyncFactory.resolved)?O(e.elm,t,o):t.isAsyncPlaceholder=!0;else if(i(t.isStatic)&&i(e.isStatic)&&t.key===e.key&&(i(t.isCloned)||i(t.isOnce)))t.componentInstance=e.componentInstance;else{var d,v=t.data;r(v)&&r(d=v.hook)&&r(d=d.prepatch)&&d(e,t);var m=e.children,y=t.children;if(r(v)&&h(t)){for(d=0;d<s.update.length;++d)s.update[d](e,t);r(d=v.hook)&&r(d=d.update)&&d(e,t)}n(t.text)?r(m)&&r(y)?m!==y&&function(e,t,i,o,a){var s,c,l,p=0,d=0,v=t.length-1,h=t[0],m=t[v],y=i.length-1,g=i[0],b=i[y],w=!a;for(;p<=v&&d<=y;)n(h)?h=t[++p]:n(m)?m=t[--v]:fo(h,g)?(C(h,g,o,i,d),h=t[++p],g=i[++d]):fo(m,b)?(C(m,b,o,i,y),m=t[--v],b=i[--y]):fo(h,b)?(C(h,b,o,i,y),w&&u.insertBefore(e,h.elm,u.nextSibling(m.elm)),h=t[++p],b=i[--y]):fo(m,g)?(C(m,g,o,i,d),w&&u.insertBefore(e,m.elm,h.elm),m=t[--v],g=i[++d]):(n(s)&&(s=vo(t,p,v)),n(c=r(g.key)?s[g.key]:x(g,t,p,v))?f(g,o,e,h.elm,!1,i,d):fo(l=t[c],g)?(C(l,g,o,i,d),t[c]=void 0,w&&u.insertBefore(e,l.elm,h.elm)):f(g,o,e,h.elm,!1,i,d),g=i[++d]);p>v?_(e,n(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(t,p,v)}(p,m,y,o,l):r(y)?(r(e.text)&&u.setTextContent(p,""),_(p,null,y,0,y.length-1,o)):r(m)?$(m,0,m.length-1):r(e.text)&&u.setTextContent(p,""):e.text!==t.text&&u.setTextContent(p,t.text),r(v)&&r(d=v.hook)&&r(d=d.postpatch)&&d(e,t)}}}function A(e,t,n){if(i(n)&&r(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o<t.length;++o)t[o].data.hook.insert(t[o])}var k=m("attrs,class,staticClass,staticStyle,key");function O(e,t,n,o){var a,s=t.tag,c=t.data,u=t.children;if(o=o||c&&c.pre,t.elm=e,i(t.isComment)&&r(t.asyncFactory))return t.isAsyncPlaceholder=!0,!0;if(r(c)&&(r(a=c.hook)&&r(a=a.init)&&a(t,!0),r(a=t.componentInstance)))return p(t,n),!0;if(r(s)){if(r(u))if(e.hasChildNodes())if(r(a=c)&&r(a=a.domProps)&&r(a=a.innerHTML)){if(a!==e.innerHTML)return!1}else{for(var l=!0,f=e.firstChild,d=0;d<u.length;d++){if(!f||!O(f,u[d],n,o)){l=!1;break}f=f.nextSibling}if(!l||f)return!1}else v(t,u,n);if(r(c)){var h=!1;for(var m in c)if(!k(m)){h=!0,y(t,n);break}!h&&c.class&&Zt(c.class)}}else e.data!==t.text&&(e.data=t.text);return!0}return function(e,t,o,a){if(!n(t)){var c,l=!1,p=[];if(n(e))l=!0,f(t,p);else{var d=r(e.nodeType);if(!d&&fo(e,t))C(e,t,p,null,null,a);else{if(d){if(1===e.nodeType&&e.hasAttribute(B)&&(e.removeAttribute(B),o=!0),i(o)&&O(e,t,p))return A(t,p,!0),e;c=e,e=new je(u.tagName(c).toLowerCase(),{},[],void 0,c)}var v=e.elm,m=u.parentNode(v);if(f(t,p,v._leaveCb?null:m,u.nextSibling(v)),r(t.parent))for(var y=t.parent,g=h(t);y;){for(var _=0;_<s.destroy.length;++_)s.destroy[_](y);if(y.elm=t.elm,g){for(var w=0;w<s.create.length;++w)s.create[w](uo,y);var x=y.data.hook.insert;if(x.merged)for(var k=1;k<x.fns.length;k++)x.fns[k]()}else co(y);y=y.parent}r(m)?$([e],0,0):r(e.tag)&&b(e)}}return A(t,p,l),t.elm}r(e)&&b(e)}}var mo={create:yo,update:yo,destroy:function(e){yo(e,uo)}};function yo(e,t){(e.data.directives||t.data.directives)&&go(e,t)}function go(e,t){var n,r,i,o=e===uo,a=t===uo,s=bo(e.data.directives,e.context),c=bo(t.data.directives,t.context),u=[],l=[];for(n in c)r=s[n],i=c[n],r?(i.oldValue=r.value,i.oldArg=r.arg,wo(i,"update",t,e),i.def&&i.def.componentUpdated&&l.push(i)):(wo(i,"bind",t,e),i.def&&i.def.inserted&&u.push(i));if(u.length){var f=function(){for(var n=0;n<u.length;n++)wo(u[n],"inserted",t,e)};o?en(t,"insert",f):f()}if(l.length&&en(t,"postpatch",function(){for(var n=0;n<l.length;n++)wo(l[n],"componentUpdated",t,e)}),!o)for(n in s)c[n]||wo(s[n],"unbind",e,e,a)}var _o=Object.create(null);function bo(e,t){var n,r,i=Object.create(null);if(!e)return i;for(n=0;n<e.length;n++)(r=e[n]).modifiers||(r.modifiers=_o),i[$o(r)]=r,r.def=lt(t.$options,"directives",r.name,!0);return i}function $o(e){return e.rawName||e.name+"."+Object.keys(e.modifiers||{}).join(".")}function wo(e,t,n,r,i){var o=e.def&&e.def[t];if(o)try{o(n.elm,e,n,r,i)}catch(Xl){xt(Xl,n.context,"directive "+e.name+" "+t+" hook")}}var xo=[so,mo];function Co(e,t){var i=t.componentOptions;if(!(r(i)&&!1===i.Ctor.options.inheritAttrs||n(e.data.attrs)&&n(t.data.attrs))){var o,a,s=t.elm,c=e.data.attrs||{},u=t.data.attrs||{};for(o in r(u.__ob__)&&(u=t.data.attrs=E({},u)),u)a=u[o],c[o]!==a&&Ao(s,o,a);for(o in(ne||ie)&&u.value!==c.value&&Ao(s,"value",u.value),c)n(u[o])&&(Si(o)?s.removeAttributeNS(Oi,Ti(o)):xi(o)||s.removeAttribute(o))}}function Ao(e,t,n){e.tagName.indexOf("-")>-1?ko(e,t,n):ki(t)?Ni(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):xi(t)?e.setAttribute(t,Ai(t,n)):Si(t)?Ni(n)?e.removeAttributeNS(Oi,Ti(t)):e.setAttributeNS(Oi,t,n):ko(e,t,n)}function ko(e,t,n){if(Ni(n))e.removeAttribute(t);else{if(ne&&!re&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var Oo={create:Co,update:Co};function So(e,t){var i=t.elm,o=t.data,a=e.data;if(!(n(o.staticClass)&&n(o.class)&&(n(a)||n(a.staticClass)&&n(a.class)))){var s=ji(t),c=i._transitionClasses;r(c)&&(s=Di(s,Li(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var To,No,jo,Eo,Mo,Do,Lo,Io={create:So,update:So},Fo=/[\w).+\-_$\]]/;function Po(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r<e.length;r++)if(n=t,t=e.charCodeAt(r),a)39===t&&92!==n&&(a=!1);else if(s)34===t&&92!==n&&(s=!1);else if(c)96===t&&92!==n&&(c=!1);else if(u)47===t&&92!==n&&(u=!1);else if(124!==t||124===e.charCodeAt(r+1)||124===e.charCodeAt(r-1)||l||f||p){switch(t){case 34:s=!0;break;case 39:a=!0;break;case 96:c=!0;break;case 40:p++;break;case 41:p--;break;case 91:f++;break;case 93:f--;break;case 123:l++;break;case 125:l--}if(47===t){for(var v=r-1,h=void 0;v>=0&&" "===(h=e.charAt(v));v--);h&&Fo.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r<o.length;r++)i=Ro(i,o[r]);return i}function Ro(e,t){var n=t.indexOf("(");if(n<0)return'_f("'+t+'")('+e+")";var r=t.slice(0,n),i=t.slice(n+1);return'_f("'+r+'")('+e+(")"!==i?","+i:i)}function Ho(e,t){console.error("[Vue compiler]: "+e)}function Bo(e,t){return e?e.map(function(e){return e[t]}).filter(function(e){return e}):[]}function Uo(e,t,n,r,i){(e.props||(e.props=[])).push(Yo({name:t,value:n,dynamic:i},r)),e.plain=!1}function zo(e,t,n,r,i){(i?e.dynamicAttrs||(e.dynamicAttrs=[]):e.attrs||(e.attrs=[])).push(Yo({name:t,value:n,dynamic:i},r)),e.plain=!1}function Vo(e,t,n,r){e.attrsMap[t]=n,e.attrsList.push(Yo({name:t,value:n},r))}function Jo(e,t,n,r,i,o,a,s){(e.directives||(e.directives=[])).push(Yo({name:t,rawName:n,value:r,arg:i,isDynamicArg:o,modifiers:a},s)),e.plain=!1}function Ko(e,t,n){return n?"_p("+t+',"'+e+'")':e+t}function qo(e,n,r,i,o,a,s,c){var u;(i=i||t).right?c?n="("+n+")==='click'?'contextmenu':("+n+")":"click"===n&&(n="contextmenu",delete i.right):i.middle&&(c?n="("+n+")==='click'?'mouseup':("+n+")":"click"===n&&(n="mouseup")),i.capture&&(delete i.capture,n=Ko("!",n,c)),i.once&&(delete i.once,n=Ko("~",n,c)),i.passive&&(delete i.passive,n=Ko("&",n,c)),i.native?(delete i.native,u=e.nativeEvents||(e.nativeEvents={})):u=e.events||(e.events={});var l=Yo({value:r.trim(),dynamic:c},s);i!==t&&(l.modifiers=i);var f=u[n];Array.isArray(f)?o?f.unshift(l):f.push(l):u[n]=f?o?[l,f]:[f,l]:l,e.plain=!1}function Wo(e,t){return e.rawAttrsMap[":"+t]||e.rawAttrsMap["v-bind:"+t]||e.rawAttrsMap[t]}function Zo(e,t,n){var r=Go(e,":"+t)||Go(e,"v-bind:"+t);if(null!=r)return Po(r);if(!1!==n){var i=Go(e,t);if(null!=i)return JSON.stringify(i)}}function Go(e,t,n){var r;if(null!=(r=e.attrsMap[t]))for(var i=e.attrsList,o=0,a=i.length;o<a;o++)if(i[o].name===t){i.splice(o,1);break}return n&&delete e.attrsMap[t],r}function Xo(e,t){for(var n=e.attrsList,r=0,i=n.length;r<i;r++){var o=n[r];if(t.test(o.name))return n.splice(r,1),o}}function Yo(e,t){return t&&(null!=t.start&&(e.start=t.start),null!=t.end&&(e.end=t.end)),e}function Qo(e,t,n){var r=n||{},i=r.number,o="$$v";r.trim&&(o="(typeof $$v === 'string'? $$v.trim(): $$v)"),i&&(o="_n("+o+")");var a=ea(t,o);e.model={value:"("+t+")",expression:JSON.stringify(t),callback:"function ($$v) {"+a+"}"}}function ea(e,t){var n=ta(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function ta(e){if(e=e.trim(),To=e.length,e.indexOf("[")<0||e.lastIndexOf("]")<To-1)return(Eo=e.lastIndexOf("."))>-1?{exp:e.slice(0,Eo),key:'"'+e.slice(Eo+1)+'"'}:{exp:e,key:null};for(No=e,Eo=Mo=Do=0;!ra();)ia(jo=na())?aa(jo):91===jo&&oa(jo);return{exp:e.slice(0,Mo),key:e.slice(Mo+1,Do)}}function na(){return No.charCodeAt(++Eo)}function ra(){return Eo>=To}function ia(e){return 34===e||39===e}function oa(e){var t=1;for(Mo=Eo;!ra();)if(ia(e=na()))aa(e);else if(91===e&&t++,93===e&&t--,0===t){Do=Eo;break}}function aa(e){for(var t=e;!ra()&&(e=na())!==t;);}var sa,ca="__r",ua="__c";function la(e,t,n){Lo=n;var r=t.value,i=t.modifiers,o=e.tag,a=e.attrsMap.type;if(e.component)return Qo(e,r,i),!1;if("select"===o)da(e,r,i);else if("input"===o&&"checkbox"===a)fa(e,r,i);else if("input"===o&&"radio"===a)pa(e,r,i);else if("input"===o||"textarea"===o)va(e,r,i);else{if(!V.isReservedTag(o))return Qo(e,r,i),!1}return!0}function fa(e,t,n){var r=n&&n.number,i=Zo(e,"value")||"null",o=Zo(e,"true-value")||"true",a=Zo(e,"false-value")||"false";Uo(e,"checked","Array.isArray("+t+")?_i("+t+","+i+")>-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),qo(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+ea(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+ea(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+ea(t,"$$c")+"}",null,!0)}function pa(e,t,n){var r=n&&n.number,i=Zo(e,"value")||"null";Uo(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),qo(e,"change",ea(t,i),null,!0)}function da(e,t,n){var r="var $$selectedVal = "+('Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(n&&n.number?"_n(val)":"val")+"})")+";";qo(e,"change",r=r+" "+ea(t,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),null,!0)}function va(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?ca:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=ea(t,l);c&&(f="if($event.target.composing)return;"+f),Uo(e,"value","("+t+")"),qo(e,u,f,null,!0),(s||a)&&qo(e,"blur","$forceUpdate()")}function ha(e){if(r(e[ca])){var t=ne?"change":"input";e[t]=[].concat(e[ca],e[t]||[]),delete e[ca]}r(e[ua])&&(e.change=[].concat(e[ua],e.change||[]),delete e[ua])}function ma(e,t,n){var r=sa;return function i(){null!==t.apply(null,arguments)&&_a(e,i,n,r)}}var ya=Rt&&!(ue&&Number(ue[1])<=53);function ga(e,t,n,r){if(ya){var i=Tr,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}sa.addEventListener(e,t,fe?{capture:n,passive:r}:n)}function _a(e,t,n,r){(r||sa).removeEventListener(e,t._wrapper||t,n)}function ba(e,t){if(!n(e.data.on)||!n(t.data.on)){var r=t.data.on||{},i=e.data.on||{};sa=t.elm,ha(r),Qt(r,i,ga,_a,ma,t.context),sa=void 0}}var $a,wa={create:ba,update:ba};function xa(e,t){if(!n(e.data.domProps)||!n(t.data.domProps)){var i,o,a=t.elm,s=e.data.domProps||{},c=t.data.domProps||{};for(i in r(c.__ob__)&&(c=t.data.domProps=E({},c)),s)i in c||(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(t.children&&(t.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i&&"PROGRESS"!==a.tagName){a._value=o;var u=n(o)?"":String(o);Ca(a,u)&&(a.value=u)}else if("innerHTML"===i&&Hi(a.tagName)&&n(a.innerHTML)){($a=$a||document.createElement("div")).innerHTML="<svg>"+o+"</svg>";for(var l=$a.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else if(o!==s[i])try{a[i]=o}catch(Xl){}}}}function Ca(e,t){return!e.composing&&("OPTION"===e.tagName||Aa(e,t)||ka(e,t))}function Aa(e,t){var n=!0;try{n=document.activeElement!==e}catch(Xl){}return n&&e.value!==t}function ka(e,t){var n=e.value,i=e._vModifiers;if(r(i)){if(i.number)return h(n)!==h(t);if(i.trim)return n.trim()!==t.trim()}return n!==t}var Oa={create:xa,update:xa},Sa=w(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function Ta(e){var t=Na(e.style);return e.staticStyle?E(e.staticStyle,t):t}function Na(e){return Array.isArray(e)?M(e):"string"==typeof e?Sa(e):e}function ja(e,t){var n,r={};if(t)for(var i=e;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=Ta(i.data))&&E(r,n);(n=Ta(e.data))&&E(r,n);for(var o=e;o=o.parent;)o.data&&(n=Ta(o.data))&&E(r,n);return r}var Ea,Ma=/^--/,Da=/\s*!important$/,La=function(e,t,n){if(Ma.test(t))e.style.setProperty(t,n);else if(Da.test(n))e.style.setProperty(O(t),n.replace(Da,""),"important");else{var r=Fa(t);if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++)e.style[r]=n[i];else e.style[r]=n}},Ia=["Webkit","Moz","ms"],Fa=w(function(e){if(Ea=Ea||document.createElement("div").style,"filter"!==(e=C(e))&&e in Ea)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<Ia.length;n++){var r=Ia[n]+t;if(r in Ea)return r}});function Pa(e,t){var i=t.data,o=e.data;if(!(n(i.staticStyle)&&n(i.style)&&n(o.staticStyle)&&n(o.style))){var a,s,c=t.elm,u=o.staticStyle,l=o.normalizedStyle||o.style||{},f=u||l,p=Na(t.data.style)||{};t.data.normalizedStyle=r(p.__ob__)?E({},p):p;var d=ja(t,!0);for(s in f)n(d[s])&&La(c,s,"");for(s in d)(a=d[s])!==f[s]&&La(c,s,null==a?"":a)}}var Ra={create:Pa,update:Pa},Ha=/\s+/;function Ba(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(Ha).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Ua(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(Ha).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function za(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&E(t,Va(e.name||"v")),E(t,e),t}return"string"==typeof e?Va(e):void 0}}var Va=w(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),Ja=Y&&!re,Ka="transition",qa="animation",Wa="transition",Za="transitionend",Ga="animation",Xa="animationend";Ja&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Wa="WebkitTransition",Za="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Ga="WebkitAnimation",Xa="webkitAnimationEnd"));var Ya=Y?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Qa(e){Ya(function(){Ya(e)})}function es(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),Ba(e,t))}function ts(e,t){e._transitionClasses&&_(e._transitionClasses,t),Ua(e,t)}function ns(e,t,n){var r=is(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===Ka?Za:Xa,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c<a&&u()},o+1),e.addEventListener(s,l)}var rs=/\b(transform|all)(,|$)/;function is(e,t){var n,r=window.getComputedStyle(e),i=(r[Wa+"Delay"]||"").split(", "),o=(r[Wa+"Duration"]||"").split(", "),a=os(i,o),s=(r[Ga+"Delay"]||"").split(", "),c=(r[Ga+"Duration"]||"").split(", "),u=os(s,c),l=0,f=0;return t===Ka?a>0&&(n=Ka,l=a,f=o.length):t===qa?u>0&&(n=qa,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?Ka:qa:null)?n===Ka?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===Ka&&rs.test(r[Wa+"Property"])}}function os(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max.apply(null,t.map(function(t,n){return as(t)+as(e[n])}))}function as(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}function ss(e,t){var i=e.elm;r(i._leaveCb)&&(i._leaveCb.cancelled=!0,i._leaveCb());var o=za(e.data.transition);if(!n(o)&&!r(i._enterCb)&&1===i.nodeType){for(var a=o.css,c=o.type,u=o.enterClass,l=o.enterToClass,f=o.enterActiveClass,p=o.appearClass,d=o.appearToClass,v=o.appearActiveClass,m=o.beforeEnter,y=o.enter,g=o.afterEnter,_=o.enterCancelled,b=o.beforeAppear,$=o.appear,w=o.afterAppear,x=o.appearCancelled,C=o.duration,A=ur,k=ur.$vnode;k&&k.parent;)A=k.context,k=k.parent;var O=!A._isMounted||!e.isRootInsert;if(!O||$||""===$){var S=O&&p?p:u,T=O&&v?v:f,N=O&&d?d:l,j=O&&b||m,E=O&&"function"==typeof $?$:y,M=O&&w||g,D=O&&x||_,L=h(s(C)?C.enter:C);0;var I=!1!==a&&!re,F=fs(E),P=i._enterCb=H(function(){I&&(ts(i,N),ts(i,T)),P.cancelled?(I&&ts(i,S),D&&D(i)):M&&M(i),i._enterCb=null});e.data.show||en(e,"insert",function(){var t=i.parentNode,n=t&&t._pending&&t._pending[e.key];n&&n.tag===e.tag&&n.elm._leaveCb&&n.elm._leaveCb(),E&&E(i,P)}),j&&j(i),I&&(es(i,S),es(i,T),Qa(function(){ts(i,S),P.cancelled||(es(i,N),F||(ls(L)?setTimeout(P,L):ns(i,c,P)))})),e.data.show&&(t&&t(),E&&E(i,P)),I||F||P()}}}function cs(e,t){var i=e.elm;r(i._enterCb)&&(i._enterCb.cancelled=!0,i._enterCb());var o=za(e.data.transition);if(n(o)||1!==i.nodeType)return t();if(!r(i._leaveCb)){var a=o.css,c=o.type,u=o.leaveClass,l=o.leaveToClass,f=o.leaveActiveClass,p=o.beforeLeave,d=o.leave,v=o.afterLeave,m=o.leaveCancelled,y=o.delayLeave,g=o.duration,_=!1!==a&&!re,b=fs(d),$=h(s(g)?g.leave:g);0;var w=i._leaveCb=H(function(){i.parentNode&&i.parentNode._pending&&(i.parentNode._pending[e.key]=null),_&&(ts(i,l),ts(i,f)),w.cancelled?(_&&ts(i,u),m&&m(i)):(t(),v&&v(i)),i._leaveCb=null});y?y(x):x()}function x(){w.cancelled||(!e.data.show&&i.parentNode&&((i.parentNode._pending||(i.parentNode._pending={}))[e.key]=e),p&&p(i),_&&(es(i,u),es(i,f),Qa(function(){ts(i,u),w.cancelled||(es(i,l),b||(ls($)?setTimeout(w,$):ns(i,c,w)))})),d&&d(i,w),_||b||w())}}function us(e,t,n){"number"!=typeof e?we("<transition> explicit "+t+" duration is not a valid number - got "+JSON.stringify(e)+".",n.context):isNaN(e)&&we("<transition> explicit "+t+" duration is NaN - the duration expression might be incorrect.",n.context)}function ls(e){return"number"==typeof e&&!isNaN(e)}function fs(e){if(n(e))return!1;var t=e.fns;return r(t)?fs(Array.isArray(t)?t[0]:t):(e._length||e.length)>1}function ps(e,t){!0!==t.data.show&&ss(t)}var ds=Y?{create:ps,activate:ps,remove:function(e,t){!0!==e.data.show?cs(e,t):t()}}:{},vs=[Oo,Io,wa,Oa,Ra,ds],hs=vs.concat(xo),ms=ho({nodeOps:ao,modules:hs});re&&document.addEventListener("selectionchange",function(){var e=document.activeElement;e&&e.vmodel&&Cs(e,"input")});var ys={inserted:function(e,t,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?en(n,"postpatch",function(){ys.componentUpdated(e,t,n)}):gs(e,t,n.context),e._vOptions=[].map.call(e.options,$s)):("textarea"===n.tag||Ki(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener("compositionstart",ws),e.addEventListener("compositionend",xs),e.addEventListener("change",xs),re&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){gs(e,t,n.context);var r=e._vOptions,i=e._vOptions=[].map.call(e.options,$s);if(i.some(function(e,t){return!P(e,r[t])}))(e.multiple?t.value.some(function(e){return bs(e,i)}):t.value!==t.oldValue&&bs(t.value,i))&&Cs(e,"change")}}};function gs(e,t,n){_s(e,t,n),(ne||ie)&&setTimeout(function(){_s(e,t,n)},0)}function _s(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=e.options.length;s<c;s++)if(a=e.options[s],i)o=R(r,$s(a))>-1,a.selected!==o&&(a.selected=o);else if(P($s(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function bs(e,t){return t.every(function(t){return!P(t,e)})}function $s(e){return"_value"in e?e._value:e.value}function ws(e){e.target.composing=!0}function xs(e){e.target.composing&&(e.target.composing=!1,Cs(e.target,"input"))}function Cs(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function As(e){return!e.componentInstance||e.data&&e.data.transition?e:As(e.componentInstance._vnode)}var ks={bind:function(e,t,n){var r=t.value,i=(n=As(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,ss(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=As(n)).data&&n.data.transition?(n.data.show=!0,r?ss(n,function(){e.style.display=e.__vOriginalDisplay}):cs(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}},Os={model:ys,show:ks},Ss={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Ts(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Ts(nr(t.children)):e}function Ns(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[C(o)]=i[o];return t}function js(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}function Es(e){for(;e=e.parent;)if(e.data.transition)return!0}function Ms(e,t){return t.key===e.key&&t.tag===e.tag}var Ds=function(e){return e.tag||tr(e)},Ls=function(e){return"show"===e.name},Is={name:"transition",props:Ss,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(Ds)).length){0;var r=this.mode;0;var i=n[0];if(Es(this.$vnode))return i;var o=Ts(i);if(!o)return i;if(this._leaving)return js(e,i);var s="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?s+"comment":s+o.tag:a(o.key)?0===String(o.key).indexOf(s)?o.key:s+o.key:o.key;var c=(o.data||(o.data={})).transition=Ns(this),u=this._vnode,l=Ts(u);if(o.data.directives&&o.data.directives.some(Ls)&&(o.data.show=!0),l&&l.data&&!Ms(o,l)&&!tr(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=E({},c);if("out-in"===r)return this._leaving=!0,en(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),js(e,i);if("in-out"===r){if(tr(o))return u;var p,d=function(){p()};en(c,"afterEnter",d),en(c,"enterCancelled",d),en(f,"delayLeave",function(e){p=e})}}return i}}},Fs=E({tag:String,moveClass:String},Ss);delete Fs.mode;var Ps={props:Fs,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=fr(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Ns(this),s=0;s<i.length;s++){var c=i[s];if(c.tag)if(null!=c.key&&0!==String(c.key).indexOf("__vlist"))o.push(c),n[c.key]=c,(c.data||(c.data={})).transition=a;else;}if(r){for(var u=[],l=[],f=0;f<r.length;f++){var p=r[f];p.data.transition=a,p.data.pos=p.elm.getBoundingClientRect(),n[p.key]?u.push(p):l.push(p)}this.kept=e(t,null,u),this.removed=l}return e(t,null,o)},updated:function(){var e=this.prevChildren,t=this.moveClass||(this.name||"v")+"-move";e.length&&this.hasMove(e[0].elm,t)&&(e.forEach(Rs),e.forEach(Hs),e.forEach(Bs),this._reflow=document.body.offsetHeight,e.forEach(function(e){if(e.data.moved){var n=e.elm,r=n.style;es(n,t),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(Za,n._moveCb=function e(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(Za,e),n._moveCb=null,ts(n,t))})}}))},methods:{hasMove:function(e,t){if(!Ja)return!1;if(this._hasMove)return this._hasMove;var n=e.cloneNode();e._transitionClasses&&e._transitionClasses.forEach(function(e){Ua(n,e)}),Ba(n,t),n.style.display="none",this.$el.appendChild(n);var r=is(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}};function Rs(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function Hs(e){e.data.newPos=e.elm.getBoundingClientRect()}function Bs(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}var Us={Transition:Is,TransitionGroup:Ps};oi.config.mustUseProp=wi,oi.config.isReservedTag=Ui,oi.config.isReservedAttr=bi,oi.config.getTagNamespace=zi,oi.config.isUnknownElement=Ji,E(oi.options.directives,Os),E(oi.options.components,Us),oi.prototype.__patch__=Y?ms:D,oi.prototype.$mount=function(e,t){return vr(this,e=e&&Y?qi(e):void 0,t)},Y&&setTimeout(function(){V.devtools&&ve&&ve.emit("init",oi)},0);var zs=/\{\{((?:.|\r?\n)+?)\}\}/g,Vs=/[-.*+?^${}()|[\]\/\\]/g,Js=w(function(e){var t=e[0].replace(Vs,"\\$&"),n=e[1].replace(Vs,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});function Ks(e,t){var n=t?Js(t):zs;if(n.test(e)){for(var r,i,o,a=[],s=[],c=n.lastIndex=0;r=n.exec(e);){(i=r.index)>c&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=Po(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c<e.length&&(s.push(o=e.slice(c)),a.push(JSON.stringify(o))),{expression:a.join("+"),tokens:s}}}function qs(e,t){t.warn;var n=Go(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Zo(e,"class",!1);r&&(e.classBinding=r)}function Ws(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}var Zs={staticKeys:["staticClass"],transformNode:qs,genData:Ws};function Gs(e,t){t.warn;var n=Go(e,"style");n&&(e.staticStyle=JSON.stringify(Sa(n)));var r=Zo(e,"style",!1);r&&(e.styleBinding=r)}function Xs(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}var Ys,Qs={staticKeys:["staticStyle"],transformNode:Gs,genData:Xs},ec={decode:function(e){return(Ys=Ys||document.createElement("div")).innerHTML=e,Ys.textContent}},tc=m("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),nc=m("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),rc=m("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),ic=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,oc=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ac="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+J.source+"]*",sc="((?:"+ac+"\\:)?"+ac+")",cc=new RegExp("^<"+sc),uc=/^\s*(\/?)>/,lc=new RegExp("^<\\/"+sc+"[^>]*>"),fc=/^<!DOCTYPE [^>]+>/i,pc=/^<!\--/,dc=/^<!\[/,vc=m("script,style,textarea",!0),hc={},mc={"&lt;":"<","&gt;":">","&quot;":'"',"&amp;":"&","&#10;":"\n","&#9;":"\t","&#39;":"'"},yc=/&(?:lt|gt|quot|amp|#39);/g,gc=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,_c=m("pre,textarea",!0),bc=function(e,t){return e&&_c(e)&&"\n"===t[0]};function $c(e,t){var n=t?gc:yc;return e.replace(n,function(e){return mc[e]})}function wc(e,t){for(var n,r,i=[],o=t.expectHTML,a=t.isUnaryTag||L,s=t.canBeLeftOpenTag||L,c=0;e;){if(n=e,r&&vc(r)){var u=0,l=r.toLowerCase(),f=hc[l]||(hc[l]=new RegExp("([\\s\\S]*?)(</"+l+"[^>]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,vc(l)||"noscript"===l||(n=n.replace(/<!\--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),bc(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,k(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(pc.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v),c,c+v+3),x(v+3);continue}}if(dc.test(e)){var h=e.indexOf("]>");if(h>=0){x(h+2);continue}}var m=e.match(fc);if(m){x(m[0].length);continue}var y=e.match(lc);if(y){var g=c;x(y[0].length),k(y[1],g,c);continue}var _=C();if(_){A(_),bc(_.tagName,e)&&x(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(lc.test($)||cc.test($)||pc.test($)||dc.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d)}d<0&&(b=e),b&&x(b.length),t.chars&&b&&t.chars(b,c-b.length,c)}if(e===n){t.chars&&t.chars(e);break}}function x(t){c+=t,e=e.substring(t)}function C(){var t=e.match(cc);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(x(t[0].length);!(n=e.match(uc))&&(r=e.match(oc)||e.match(ic));)r.start=c,x(r[0].length),r.end=c,i.attrs.push(r);if(n)return i.unarySlash=n[1],x(n[0].length),i.end=c,i}}function A(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&rc(n)&&k(r),s(n)&&r===n&&k(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p<l;p++){var d=e.attrs[p],v=d[3]||d[4]||d[5]||"",h="a"===n&&"href"===d[1]?t.shouldDecodeNewlinesForHref:t.shouldDecodeNewlines;f[p]={name:d[1],value:$c(v,h)}}u||(i.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:f,start:e.start,end:e.end}),r=n),t.start&&t.start(n,f,u,e.start,e.end)}function k(e,n,o){var a,s;if(null==n&&(n=c),null==o&&(o=c),e)for(s=e.toLowerCase(),a=i.length-1;a>=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}k()}var xc,Cc,Ac,kc,Oc,Sc,Tc,Nc,jc,Ec=/^@|^v-on:/,Mc=/^v-|^@|^:|^#/,Dc=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Lc=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Ic=/^\(|\)$/g,Fc=/^\[.*\]$/,Pc=/:(.*)$/,Rc=/^:|^\.|^v-bind:/,Hc=/\.[^.\]]+(?=[^\]]*$)/g,Bc=/^v-slot(:|$)|^#/,Uc=/[\r\n]/,zc=/\s+/g,Vc=/[\s"'<>\/=]/,Jc=w(ec.decode),Kc="_empty_";function qc(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:vu(t),rawAttrsMap:{},parent:n,children:[]}}function Wc(e,t){xc=t.warn||Ho,Sc=t.isPreTag||L,Tc=t.mustUseProp||L,Nc=t.getTagNamespace||L;var n=t.isReservedTag||L;jc=function(e){return!!e.component||!n(e.tag)},Ac=Bo(t.modules,"transformNode"),kc=Bo(t.modules,"preTransformNode"),Oc=Bo(t.modules,"postTransformNode"),Cc=t.delimiters;var r,i,o=[],a=!1!==t.preserveWhitespace,s=t.whitespace,c=!1,u=!1;function l(e){if(f(e),c||e.processed||(e=Xc(e,t)),o.length||e===r||r.if&&(e.elseif||e.else)&&ou(r,{exp:e.elseif,block:e}),i&&!e.forbidden)if(e.elseif||e.else)ru(e,i);else{if(e.slotScope){var n=e.slotTarget||'"default"';(i.scopedSlots||(i.scopedSlots={}))[n]=e}i.children.push(e),e.parent=i}e.children=e.children.filter(function(e){return!e.slotScope}),f(e),e.pre&&(c=!1),Sc(e.tag)&&(u=!1);for(var a=0;a<Oc.length;a++)Oc[a](e,t)}function f(e){if(!u)for(var t;(t=e.children[e.children.length-1])&&3===t.type&&" "===t.text;)e.children.pop()}return wc(e,{warn:xc,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,n,a,s,f){var p=i&&i.ns||Nc(e);ne&&"svg"===p&&(n=_u(n));var d=qc(e,n,i);p&&(d.ns=p),mu(d)&&!de()&&(d.forbidden=!0);for(var v=0;v<kc.length;v++)d=kc[v](d,t)||d;c||(Zc(d),d.pre&&(c=!0)),Sc(d.tag)&&(u=!0),c?Gc(d):d.processed||(eu(d),nu(d),au(d)),r||(r=d),a?l(d):(i=d,o.push(d))},end:function(e,t,n){var r=o[o.length-1];o.length-=1,i=o[o.length-1],l(r)},chars:function(e,t,n){if(i&&(!ne||"textarea"!==i.tag||i.attrsMap.placeholder!==e)){var r,o,l=i.children;if(e=u||e.trim()?hu(i)?e:Jc(e):l.length?s?"condense"===s&&Uc.test(e)?"":" ":a?" ":"":"")u||"condense"!==s||(e=e.replace(zc," ")),!c&&" "!==e&&(r=Ks(e,Cc))?o={type:2,expression:r.expression,tokens:r.tokens,text:e}:" "===e&&l.length&&" "===l[l.length-1].text||(o={type:3,text:e}),o&&l.push(o)}},comment:function(e,t,n){if(i){var r={type:3,text:e,isComment:!0};0,i.children.push(r)}}}),r}function Zc(e){null!=Go(e,"v-pre")&&(e.pre=!0)}function Gc(e){var t=e.attrsList,n=t.length;if(n)for(var r=e.attrs=new Array(n),i=0;i<n;i++)r[i]={name:t[i].name,value:JSON.stringify(t[i].value)},null!=t[i].start&&(r[i].start=t[i].start,r[i].end=t[i].end);else e.pre||(e.plain=!0)}function Xc(e,t){Yc(e),e.plain=!e.key&&!e.scopedSlots&&!e.attrsList.length,Qc(e),su(e),uu(e),lu(e);for(var n=0;n<Ac.length;n++)e=Ac[n](e,t)||e;return fu(e),e}function Yc(e){var t=Zo(e,"key");t&&(e.key=t)}function Qc(e){var t=Zo(e,"ref");t&&(e.ref=t,e.refInFor=pu(e))}function eu(e){var t;if(t=Go(e,"v-for")){var n=tu(t);n&&E(e,n)}}function tu(e){var t=e.match(Dc);if(t){var n={};n.for=t[2].trim();var r=t[1].trim().replace(Ic,""),i=r.match(Lc);return i?(n.alias=r.replace(Lc,"").trim(),n.iterator1=i[1].trim(),i[2]&&(n.iterator2=i[2].trim())):n.alias=r,n}}function nu(e){var t=Go(e,"v-if");if(t)e.if=t,ou(e,{exp:t,block:e});else{null!=Go(e,"v-else")&&(e.else=!0);var n=Go(e,"v-else-if");n&&(e.elseif=n)}}function ru(e,t){var n=iu(t.children);n&&n.if&&ou(n,{exp:e.elseif,block:e})}function iu(e){for(var t=e.length;t--;){if(1===e[t].type)return e[t];e.pop()}}function ou(e,t){e.ifConditions||(e.ifConditions=[]),e.ifConditions.push(t)}function au(e){null!=Go(e,"v-once")&&(e.once=!0)}function su(e){var t;"template"===e.tag?(t=Go(e,"scope"),e.slotScope=t||Go(e,"slot-scope")):(t=Go(e,"slot-scope"))&&(e.slotScope=t);var n=Zo(e,"slot");if(n&&(e.slotTarget='""'===n?'"default"':n,e.slotTargetDynamic=!(!e.attrsMap[":slot"]&&!e.attrsMap["v-bind:slot"]),"template"===e.tag||e.slotScope||zo(e,"slot",n,Wo(e,"slot"))),"template"===e.tag){var r=Xo(e,Bc);if(r){0;var i=cu(r),o=i.name,a=i.dynamic;e.slotTarget=o,e.slotTargetDynamic=a,e.slotScope=r.value||Kc}}else{var s=Xo(e,Bc);if(s){0;var c=e.scopedSlots||(e.scopedSlots={}),u=cu(s),l=u.name,f=u.dynamic,p=c[l]=qc("template",[],e);p.slotTarget=l,p.slotTargetDynamic=f,p.children=e.children.filter(function(e){if(!e.slotScope)return e.parent=p,!0}),p.slotScope=s.value||Kc,e.children=[],e.plain=!1}}}function cu(e){var t=e.name.replace(Bc,"");return t||"#"!==e.name[0]&&(t="default"),Fc.test(t)?{name:t.slice(1,-1),dynamic:!0}:{name:'"'+t+'"',dynamic:!1}}function uu(e){"slot"===e.tag&&(e.slotName=Zo(e,"name"))}function lu(e){var t;(t=Zo(e,"is"))&&(e.component=t),null!=Go(e,"inline-template")&&(e.inlineTemplate=!0)}function fu(e){var t,n,r,i,o,a,s,c,u=e.attrsList;for(t=0,n=u.length;t<n;t++){if(r=i=u[t].name,o=u[t].value,Mc.test(r))if(e.hasBindings=!0,(a=du(r.replace(Mc,"")))&&(r=r.replace(Hc,"")),Rc.test(r))r=r.replace(Rc,""),o=Po(o),(c=Fc.test(r))&&(r=r.slice(1,-1)),a&&(a.prop&&!c&&"innerHtml"===(r=C(r))&&(r="innerHTML"),a.camel&&!c&&(r=C(r)),a.sync&&(s=ea(o,"$event"),c?qo(e,'"update:"+('+r+")",s,null,!1,xc,u[t],!0):(qo(e,"update:"+C(r),s,null,!1,xc,u[t]),O(r)!==C(r)&&qo(e,"update:"+O(r),s,null,!1,xc,u[t])))),a&&a.prop||!e.component&&Tc(e.tag,e.attrsMap.type,r)?Uo(e,r,o,u[t],c):zo(e,r,o,u[t],c);else if(Ec.test(r))r=r.replace(Ec,""),(c=Fc.test(r))&&(r=r.slice(1,-1)),qo(e,r,o,a,!1,xc,u[t],c);else{var l=(r=r.replace(Mc,"")).match(Pc),f=l&&l[1];c=!1,f&&(r=r.slice(0,-(f.length+1)),Fc.test(f)&&(f=f.slice(1,-1),c=!0)),Jo(e,r,i,o,f,c,a,u[t])}else zo(e,r,JSON.stringify(o),u[t]),!e.component&&"muted"===r&&Tc(e.tag,e.attrsMap.type,r)&&Uo(e,r,"true",u[t])}}function pu(e){for(var t=e;t;){if(void 0!==t.for)return!0;t=t.parent}return!1}function du(e){var t=e.match(Hc);if(t){var n={};return t.forEach(function(e){n[e.slice(1)]=!0}),n}}function vu(e){for(var t={},n=0,r=e.length;n<r;n++)t[e[n].name]=e[n].value;return t}function hu(e){return"script"===e.tag||"style"===e.tag}function mu(e){return"style"===e.tag||"script"===e.tag&&(!e.attrsMap.type||"text/javascript"===e.attrsMap.type)}var yu=/^xmlns:NS\d+/,gu=/^NS\d+:/;function _u(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];yu.test(r.name)||(r.name=r.name.replace(gu,""),t.push(r))}return t}function bu(e,t){for(var n=e;n;)n.for&&n.alias===t&&xc("<"+e.tag+' v-model="'+t+'">: You are binding v-model directly to a v-for iteration alias. This will not be able to modify the v-for source array because writing to the alias is like modifying a function local variable. Consider using an array of objects and use v-model on an object property instead.',e.rawAttrsMap["v-model"]),n=n.parent}function $u(e,t){if("input"===e.tag){var n,r=e.attrsMap;if(!r["v-model"])return;if((r[":type"]||r["v-bind:type"])&&(n=Zo(e,"type")),r.type||n||!r["v-bind"]||(n="("+r["v-bind"]+").type"),n){var i=Go(e,"v-if",!0),o=i?"&&("+i+")":"",a=null!=Go(e,"v-else",!0),s=Go(e,"v-else-if",!0),c=wu(e);eu(c),Vo(c,"type","checkbox"),Xc(c,t),c.processed=!0,c.if="("+n+")==='checkbox'"+o,ou(c,{exp:c.if,block:c});var u=wu(e);Go(u,"v-for",!0),Vo(u,"type","radio"),Xc(u,t),ou(c,{exp:"("+n+")==='radio'"+o,block:u});var l=wu(e);return Go(l,"v-for",!0),Vo(l,":type",n),Xc(l,t),ou(c,{exp:i,block:l}),a?c.else=!0:s&&(c.elseif=s),c}}}function wu(e){return qc(e.tag,e.attrsList.slice(),e.parent)}var xu={preTransformNode:$u},Cu=[Zs,Qs,xu];function Au(e,t){t.value&&Uo(e,"textContent","_s("+t.value+")",t)}function ku(e,t){t.value&&Uo(e,"innerHTML","_s("+t.value+")",t)}var Ou,Su,Tu={model:la,text:Au,html:ku},Nu={expectHTML:!0,modules:Cu,directives:Tu,isPreTag:Bi,isUnaryTag:tc,mustUseProp:wi,canBeLeftOpenTag:nc,isReservedTag:Ui,getTagNamespace:zi,staticKeys:F(Cu)},ju=w(Mu);function Eu(e,t){e&&(Ou=ju(t.staticKeys||""),Su=t.isReservedTag||L,Du(e),Lu(e,!1))}function Mu(e){return m("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))}function Du(e){if(e.static=Iu(e),1===e.type){if(!Su(e.tag)&&"slot"!==e.tag&&null==e.attrsMap["inline-template"])return;for(var t=0,n=e.children.length;t<n;t++){var r=e.children[t];Du(r),r.static||(e.static=!1)}if(e.ifConditions)for(var i=1,o=e.ifConditions.length;i<o;i++){var a=e.ifConditions[i].block;Du(a),a.static||(e.static=!1)}}}function Lu(e,t){if(1===e.type){if((e.static||e.once)&&(e.staticInFor=t),e.static&&e.children.length&&(1!==e.children.length||3!==e.children[0].type))return void(e.staticRoot=!0);if(e.staticRoot=!1,e.children)for(var n=0,r=e.children.length;n<r;n++)Lu(e.children[n],t||!!e.for);if(e.ifConditions)for(var i=1,o=e.ifConditions.length;i<o;i++)Lu(e.ifConditions[i].block,t)}}function Iu(e){return 2!==e.type&&(3===e.type||!(!e.pre&&(e.hasBindings||e.if||e.for||y(e.tag)||!Su(e.tag)||Fu(e)||!Object.keys(e).every(Ou))))}function Fu(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}var Pu=/^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/,Ru=/\([^)]*?\);*$/,Hu=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Bu={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Uu={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},zu=function(e){return"if("+e+")return null;"},Vu={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:zu("$event.target !== $event.currentTarget"),ctrl:zu("!$event.ctrlKey"),shift:zu("!$event.shiftKey"),alt:zu("!$event.altKey"),meta:zu("!$event.metaKey"),left:zu("'button' in $event && $event.button !== 0"),middle:zu("'button' in $event && $event.button !== 1"),right:zu("'button' in $event && $event.button !== 2")};function Ju(e,t){var n=t?"nativeOn:":"on:",r="",i="";for(var o in e){var a=Ku(e[o]);e[o]&&e[o].dynamic?i+=o+","+a+",":r+='"'+o+'":'+a+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function Ku(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return Ku(e)}).join(",")+"]";var t=Hu.test(e.value),n=Pu.test(e.value),r=Hu.test(e.value.replace(Ru,""));if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(Vu[s])o+=Vu[s],Bu[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=zu(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=qu(a)),o&&(i+=o),"function($event){"+i+(t?"return "+e.value+"($event)":n?"return ("+e.value+")($event)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function qu(e){return"if(!$event.type.indexOf('key')&&"+e.map(Wu).join("&&")+")return null;"}function Wu(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Bu[e],r=Uu[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}function Zu(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}}function Gu(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}}var Xu={on:Zu,bind:Gu,cloak:D},Yu=function(e){this.options=e,this.warn=e.warn||Ho,this.transforms=Bo(e.modules,"transformCode"),this.dataGenFns=Bo(e.modules,"genData"),this.directives=E(E({},Xu),e.directives);var t=e.isReservedTag||L;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Qu(e,t){var n=new Yu(t);return{render:"with(this){return "+(e?el(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function el(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return tl(e,t);if(e.once&&!e.onceProcessed)return nl(e,t);if(e.for&&!e.forProcessed)return ol(e,t);if(e.if&&!e.ifProcessed)return rl(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return _l(e,t);var n;if(e.component)n=bl(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=al(e,t));var i=e.inlineTemplate?null:dl(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o<t.transforms.length;o++)n=t.transforms[o](e,n);return n}return dl(e,t)||"void 0"}function tl(e,t){e.staticProcessed=!0;var n=t.pre;return e.pre&&(t.pre=e.pre),t.staticRenderFns.push("with(this){return "+el(e,t)+"}"),t.pre=n,"_m("+(t.staticRenderFns.length-1)+(e.staticInFor?",true":"")+")"}function nl(e,t){if(e.onceProcessed=!0,e.if&&!e.ifProcessed)return rl(e,t);if(e.staticInFor){for(var n="",r=e.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?"_o("+el(e,t)+","+t.onceId+++","+n+")":el(e,t)}return tl(e,t)}function rl(e,t,n,r){return e.ifProcessed=!0,il(e.ifConditions.slice(),t,n,r)}function il(e,t,n,r){if(!e.length)return r||"_e()";var i=e.shift();return i.exp?"("+i.exp+")?"+o(i.block)+":"+il(e,t,n,r):""+o(i.block);function o(e){return n?n(e,t):e.once?nl(e,t):el(e,t)}}function ol(e,t,n,r){var i=e.for,o=e.alias,a=e.iterator1?","+e.iterator1:"",s=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+a+s+"){return "+(n||el)(e,t)+"})"}function al(e,t){var n="{",r=sl(e,t);r&&(n+=r+","),e.key&&(n+="key:"+e.key+","),e.ref&&(n+="ref:"+e.ref+","),e.refInFor&&(n+="refInFor:true,"),e.pre&&(n+="pre:true,"),e.component&&(n+='tag:"'+e.tag+'",');for(var i=0;i<t.dataGenFns.length;i++)n+=t.dataGenFns[i](e);if(e.attrs&&(n+="attrs:"+$l(e.attrs)+","),e.props&&(n+="domProps:"+$l(e.props)+","),e.events&&(n+=Ju(e.events,!1)+","),e.nativeEvents&&(n+=Ju(e.nativeEvents,!0)+","),e.slotTarget&&!e.slotScope&&(n+="slot:"+e.slotTarget+","),e.scopedSlots&&(n+=ul(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var o=cl(e,t);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+$l(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function sl(e,t){var n=e.directives;if(n){var r,i,o,a,s="directives:[",c=!1;for(r=0,i=n.length;r<i;r++){o=n[r],a=!0;var u=t.directives[o.name];u&&(a=!!u(e,o,t.warn)),a&&(c=!0,s+='{name:"'+o.name+'",rawName:"'+o.rawName+'"'+(o.value?",value:("+o.value+"),expression:"+JSON.stringify(o.value):"")+(o.arg?",arg:"+(o.isDynamicArg?o.arg:'"'+o.arg+'"'):"")+(o.modifiers?",modifiers:"+JSON.stringify(o.modifiers):"")+"},")}return c?s.slice(0,-1)+"]":void 0}}function cl(e,t){var n=e.children[0];if(n&&1===n.type){var r=Qu(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map(function(e){return"function(){"+e+"}"}).join(",")+"]}"}}function ul(e,t,n){var r=e.for||Object.keys(t).some(function(e){var n=t[e];return n.slotTargetDynamic||n.if||n.for||fl(n)}),i=!!e.if;if(!r)for(var o=e.parent;o;){if(o.slotScope&&o.slotScope!==Kc||o.for){r=!0;break}o.if&&(i=!0),o=o.parent}var a=Object.keys(t).map(function(e){return pl(t[e],n)}).join(",");return"scopedSlots:_u(["+a+"]"+(r?",null,true":"")+(!r&&i?",null,false,"+ll(a):"")+")"}function ll(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0}function fl(e){return 1===e.type&&("slot"===e.tag||e.children.some(fl))}function pl(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return rl(e,t,pl,"null");if(e.for&&!e.forProcessed)return ol(e,t,pl);var r=e.slotScope===Kc?"":String(e.slotScope),i="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(dl(e,t)||"undefined")+":undefined":dl(e,t)||"undefined":el(e,t))+"}",o=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+i+o+"}"}function dl(e,t,n,r,i){var o=e.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?t.maybeComponent(a)?",1":",0":"";return""+(r||el)(a,t)+s}var c=n?vl(o,t.maybeComponent):0,u=i||ml;return"["+o.map(function(e){return u(e,t)}).join(",")+"]"+(c?","+c:"")}}function vl(e,t){for(var n=0,r=0;r<e.length;r++){var i=e[r];if(1===i.type){if(hl(i)||i.ifConditions&&i.ifConditions.some(function(e){return hl(e.block)})){n=2;break}(t(i)||i.ifConditions&&i.ifConditions.some(function(e){return t(e.block)}))&&(n=1)}}return n}function hl(e){return void 0!==e.for||"template"===e.tag||"slot"===e.tag}function ml(e,t){return 1===e.type?el(e,t):3===e.type&&e.isComment?gl(e):yl(e)}function yl(e){return"_v("+(2===e.type?e.expression:wl(JSON.stringify(e.text)))+")"}function gl(e){return"_e("+JSON.stringify(e.text)+")"}function _l(e,t){var n=e.slotName||'"default"',r=dl(e,t),i="_t("+n+(r?","+r:""),o=e.attrs||e.dynamicAttrs?$l((e.attrs||[]).concat(e.dynamicAttrs||[]).map(function(e){return{name:C(e.name),value:e.value,dynamic:e.dynamic}})):null,a=e.attrsMap["v-bind"];return!o&&!a||r||(i+=",null"),o&&(i+=","+o),a&&(i+=(o?"":",null")+","+a),i+")"}function bl(e,t,n){var r=t.inlineTemplate?null:dl(t,n,!0);return"_c("+e+","+al(t,n)+(r?","+r:"")+")"}function $l(e){for(var t="",n="",r=0;r<e.length;r++){var i=e[r],o=wl(i.value);i.dynamic?n+=i.name+","+o+",":t+='"'+i.name+'":'+o+","}return t="{"+t.slice(0,-1)+"}",n?"_d("+t+",["+n.slice(0,-1)+"])":t}function wl(e){return e.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}var xl=new RegExp("\\b"+"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments".split(",").join("\\b|\\b")+"\\b"),Cl=new RegExp("\\b"+"delete,typeof,void".split(",").join("\\s*\\([^\\)]*\\)|\\b")+"\\s*\\([^\\)]*\\)"),Al=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;function kl(e,t){e&&Ol(e,t)}function Ol(e,t){if(1===e.type){for(var n in e.attrsMap)if(Mc.test(n)){var r=e.attrsMap[n];if(r){var i=e.rawAttrsMap[n];"v-for"===n?Tl(e,'v-for="'+r+'"',t,i):"v-slot"===n||"#"===n[0]?El(r,n+'="'+r+'"',t,i):Ec.test(n)?Sl(r,n+'="'+r+'"',t,i):jl(r,n+'="'+r+'"',t,i)}}if(e.children)for(var o=0;o<e.children.length;o++)Ol(e.children[o],t)}else 2===e.type&&jl(e.expression,e.text,t,e)}function Sl(e,t,n,r){var i=e.replace(Al,""),o=i.match(Cl);o&&"$"!==i.charAt(o.index-1)&&n('avoid using JavaScript unary operator as property name: "'+o[0]+'" in expression '+t.trim(),r),jl(e,t,n,r)}function Tl(e,t,n,r){jl(e.for||"",t,n,r),Nl(e.alias,"v-for alias",t,n,r),Nl(e.iterator1,"v-for iterator",t,n,r),Nl(e.iterator2,"v-for iterator",t,n,r)}function Nl(e,t,n,r,i){if("string"==typeof e)try{new Function("var "+e+"=_")}catch(Xl){r("invalid "+t+' "'+e+'" in expression: '+n.trim(),i)}}function jl(e,t,n,r){try{new Function("return "+e)}catch(Xl){var i=e.replace(Al,"").match(xl);n(i?'avoid using JavaScript keyword as property name: "'+i[0]+'"\n Raw expression: '+t.trim():"invalid expression: "+Xl.message+" in\n\n "+e+"\n\n Raw expression: "+t.trim()+"\n",r)}}function El(e,t,n,r){try{new Function(e,"")}catch(Xl){n("invalid function parameter expression: "+Xl.message+" in\n\n "+e+"\n\n Raw expression: "+t.trim()+"\n",r)}}var Ml=2;function Dl(e,t,n){void 0===t&&(t=0),void 0===n&&(n=e.length);for(var r=e.split(/\r?\n/),i=0,o=[],a=0;a<r.length;a++)if((i+=r[a].length+1)>=t){for(var s=a-Ml;s<=a+Ml||n>i;s++)if(!(s<0||s>=r.length)){o.push(""+(s+1)+Ll(" ",3-String(s+1).length)+"| "+r[s]);var c=r[s].length;if(s===a){var u=t-(i-c)+1,l=n>i?c-u:n-t;o.push(" | "+Ll(" ",u)+Ll("^",l))}else if(s>a){if(n>i){var f=Math.min(n-i,c);o.push(" | "+Ll("^",f))}i+=c+1}}break}return o.join("\n")}function Ll(e,t){var n="";if(t>0)for(;1&t&&(n+=e),!((t>>>=1)<=0);)e+=e;return n}function Il(e,t){try{return new Function(e)}catch(n){return t.push({err:n,code:e}),D}}function Fl(e){var t=Object.create(null);return function(n,r,i){(r=E({},r)).warn;delete r.warn;var o=r.delimiters?String(r.delimiters)+n:n;if(t[o])return t[o];var a=e(n,r);var s={},c=[];return s.render=Il(a.render,c),s.staticRenderFns=a.staticRenderFns.map(function(e){return Il(e,c)}),t[o]=s}}function Pl(e){return function(t){function n(n,r){var i=Object.create(t),o=[],a=[],s=function(e,t,n){(n?a:o).push(e)};if(r)for(var c in r.modules&&(i.modules=(t.modules||[]).concat(r.modules)),r.directives&&(i.directives=E(Object.create(t.directives||null),r.directives)),r)"modules"!==c&&"directives"!==c&&(i[c]=r[c]);i.warn=s;var u=e(n.trim(),i);return u.errors=o,u.tips=a,u}return{compile:n,compileToFunctions:Fl(n)}}}var Rl,Hl=Pl(function(e,t){var n=Wc(e.trim(),t);!1!==t.optimize&&Eu(n,t);var r=Qu(n,t);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}}),Bl=Hl(Nu),Ul=Bl.compile,zl=Bl.compileToFunctions;function Vl(e){return(Rl=Rl||document.createElement("div")).innerHTML=e?'<a href="\n"/>':'<div a="\n"/>',Rl.innerHTML.indexOf("&#10;")>0}var Jl=!!Y&&Vl(!1),Kl=!!Y&&Vl(!0),ql=w(function(e){var t=qi(e);return t&&t.innerHTML}),Wl=oi.prototype.$mount;function Zl(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}oi.prototype.$mount=function(e,t){if((e=e&&qi(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=ql(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=Zl(e));if(r){0;var i=zl(r,{outputSourceRange:!1,shouldDecodeNewlines:Jl,shouldDecodeNewlinesForHref:Kl,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return Wl.call(this,e,t)},oi.compile=zl;var Gl=oi;exports.default=Gl;
4
  },{}],"WZJa":[function(require,module,exports) {
5
  "use strict";function t(){var t={},o={};return{addControlScript:function(o,r){t[o]=r},callControlScript:function(o,r){if(!t[o])throw new Error("Called control element not found: [".concat(o,"]"));t[o](r)},setControlData:function(t,r){o[t]=r},getControlData:function(t){if(!o[t])throw new Error("Control data for [".concat(t,"] not found."));return o[t]}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var o=t();exports.default=o;
6
+ },{}],"aJOh":[function(require,module,exports) {
7
+ var e,n,o=Object.create(null);"undefined"!=typeof window&&(window.__VUE_HOT_MAP__=o);var t=!1,r=!1,i="beforeCreate";function s(e,n){if(n.functional){var t=n.render;n.render=function(n,r){var i=o[e].instances;return r&&i.indexOf(r.parent)<0&&i.push(r.parent),t(n,r)}}else c(n,i,function(){var n=o[e];n.Ctor||(n.Ctor=this.constructor),n.instances.push(this)}),c(n,"beforeDestroy",function(){var n=o[e].instances;n.splice(n.indexOf(this),1)})}function c(e,n,o){var t=e[n];e[n]=t?Array.isArray(t)?t.concat(o):[t,o]:[o]}function a(e){return function(n,o){try{e(n,o)}catch(t){console.error(t),console.warn("Something went wrong during Vue component hot-reload. Full reload required.")}}}function f(e,n){for(var o in e)o in n||delete e[o];for(var t in n)e[t]=n[t]}function u(e){if(e._u){var n=e._u;return e._u=function(e){try{return n(e,!0)}catch(o){return n(e,null,!0)}},function(){e._u=n}}}exports.install=function(o,s){t||(t=!0,e=o.__esModule?o.default:o,n=e.version.split(".").map(Number),r=s,e.config._lifecycleHooks.indexOf("init")>-1&&(i="init"),exports.compatible=n[0]>=2,exports.compatible||console.warn("[HMR] You are using a version of vue-hot-reload-api that is only compatible with Vue.js core ^2.0.0."))},exports.createRecord=function(e,n){if(!o[e]){var t=null;"function"==typeof n&&(n=(t=n).options),s(e,n),o[e]={Ctor:t,options:n,instances:[]}}},exports.isRecorded=function(e){return void 0!==o[e]},exports.rerender=a(function(e,n){var t=o[e];if(n){if("function"==typeof n&&(n=n.options),t.Ctor)t.Ctor.options.render=n.render,t.Ctor.options.staticRenderFns=n.staticRenderFns,t.instances.slice().forEach(function(e){e.$options.render=n.render,e.$options.staticRenderFns=n.staticRenderFns,e._staticTrees&&(e._staticTrees=[]),Array.isArray(t.Ctor.options.cached)&&(t.Ctor.options.cached=[]),Array.isArray(e.$options.cached)&&(e.$options.cached=[]);var o=u(e);e.$forceUpdate(),e.$nextTick(o)});else if(t.options.render=n.render,t.options.staticRenderFns=n.staticRenderFns,t.options.functional){if(Object.keys(n).length>2)f(t.options,n);else{var r=t.options._injectStyles;if(r){var i=n.render;t.options.render=function(e,n){return r.call(n),i(e,n)}}}t.options._Ctor=null,Array.isArray(t.options.cached)&&(t.options.cached=[]),t.instances.slice().forEach(function(e){e.$forceUpdate()})}}else t.instances.slice().forEach(function(e){e.$forceUpdate()})}),exports.reload=a(function(e,t){var r=o[e];if(t)if("function"==typeof t&&(t=t.options),s(e,t),r.Ctor){n[1]<2&&(r.Ctor.extendOptions=t);var i=r.Ctor.super.extend(t);i.options._Ctor=r.options._Ctor,r.Ctor.options=i.options,r.Ctor.cid=i.cid,r.Ctor.prototype=i.prototype,i.release&&i.release()}else f(r.options,t);r.instances.slice().forEach(function(e){e.$vnode&&e.$vnode.context?e.$vnode.context.$forceUpdate():console.warn("Root or manually mounted instance modified. Full reload required.")})});
8
  },{}],"WV0h":[function(require,module,exports) {
9
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:["relativeElement","forceHide"],data:function(){return{listening:!1}},watch:{relativeElement:function(){this.relativeElement&&!this.listening&&(this.relativeElement.addEventListener("scroll",this.handleScroll),this.handleScroll(),this.listening=!0)}},methods:{handleScroll:function(){if(!this.forceHide){var e=this.relativeElement.scrollTop,t=this.$refs.observerElement.offsetTop;e+this.relativeElement.clientHeight>=t&&this.$emit("visible")}}}};exports.default=e;
10
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this.$createElement;return(this._self._c||e)("div",{ref:"observerElement"},[this._t("default")],2)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$b5e884",e):t.createRecord("$b5e884",e))}}();})();
11
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"wvh1":[function(require,module,exports) {
12
  "use strict";function e(e,t){var u=null;switch(t){case"dataset":default:u=e.dataset}return u}function t(t){var u=t.query,a=t.type,r=t.key,n=document.querySelector(u),l=e(n,a);if(l)return{element:n,value:l[r],type:a,key:r};throw new Error("no related operation found with a type of [".concat(a,"]"))}function u(t,u){var a=t.element,r=t.type,n=t.key;e(a,r)[n]=u}function a(e,t){e.map(function(e){u(e,t)})}function r(e){var u={elements:[],startupValue:null};return e.map(function(e){var a=t(e);u.elements.push(t(e)),e.useAsStartup&&(u.startupValue=a)}),u.startupValue||(u.startupValue=u.elements[0].value),u}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var n={getTargetValue:t,getAllValues:r,setTargetValue:u,setAllValues:a};exports.default=n;
13
  },{}],"LTB1":[function(require,module,exports) {
14
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("../functions/selector"));function t(e){return e&&e.__esModule?e:{default:e}}var a={props:{label:String,selectors:{type:Array,required:!1,default:function(){return[]}}},data:function(){return{startupValue:null,targetElements:[],elementMainValue:"",mountedDataUpdate:!1}},mounted:function(){if(this.selectors.length>0){var t=e.default.getAllValues(this.selectors);this.targetElements=t.elements,this.startupValue=t.startupValue}},methods:{assignDefaultValue:function(){this.startupValue&&(this.mountedDataUpdate=!0,this.elementMainValue=this.startupValue)},setTargetValue:function(t,a){e.default.setTargetValue(t,a)},setAllValues:function(t){e.default.setAllValues(this.targetElements,t)},setTableDirty:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.mountedDataUpdate||(new WPTB_TableStateSaveManager).tableStateSet(),this.mountedDataUpdate=!1}}},u=a;exports.default=u;
15
  },{"../functions/selector":"wvh1"}],"DTps":[function(require,module,exports) {
16
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("../components/IntersectionObserver")),t=n(require("../mixins/ControlBase"));function n(e){return e&&e.__esModule?e:{default:e}}var r={props:{label:String,icons:Object,perPage:{type:Number,default:20}},mixins:[t.default],components:{IntersectionObserver:e.default},data:function(){return{selectedIcon:{url:null,name:null},openDrawer:!1,innerDrawerRef:null,paginationIndex:1,observerHide:!1,debunkedFilterText:"",debunkId:-1,filterText:"",drawerPosition:{left:0}}},mounted:function(){var e=this;document.addEventListener("keyup",function(t){"Escape"===t.code&&e.openDrawer&&e.setDrawerState(!1)});var t=this.startupValue;this.selectedIcon.name=""===t?null:t,this.selectedIcon.url=""===t?null:this.icons[t]},watch:{debunkedFilterText:function(e){var t=this;clearTimeout(this.debunkId),this.debunkId=setTimeout(function(){t.filterText=e},500)},selectedIcon:{handler:function(){var e=this,t=this.targetElements[0].element;t&&(this.selectedIcon.url?fetch(this.selectedIcon.url).then(function(e){return e.text()}).then(function(n){e.setTargetValue(e.targetElements[0],e.selectedIcon.name),t.innerHTML="";var r=document.createRange();r.setStart(t,0);var i=r.createContextualFragment(n);t.appendChild(i)}):(this.setTargetValue(this.targetElements[0],""),t.innerHTML=""))},deep:!0}},methods:{setDrawerState:function(e){this.openDrawer=e},fullIconList:function(){var e=this;return Object.keys(this.icons).filter(function(t){return t.includes(e.filterText)}).slice(0,this.paginationIndex*this.perPage).reduce(function(t,n){return t[n]=e.icons[n],t},{})},toggleIconDrawer:function(){this.calculateDrawerPosition(),this.openDrawer=!this.openDrawer,this.innerDrawerRef=this.$refs.drawerRefElement},setIcon:function(e,t){this.selectedIcon.url=t,this.selectedIcon.name=e,this.toggleIconDrawer(),this.setTableDirty()},observerVisible:function(){this.paginationIndex+=1},calculateDrawerPosition:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=this.$refs.iconSelectButton.getBoundingClientRect(),n=t.x+t.width+e,r=t.y;this.drawerPosition.top=this.toPx(r),this.drawerPosition.left=this.toPx(n)},toPx:function(e){return"".concat(e,"px")}}};exports.default=r;
17
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"wptb-settings-row wptb-settings-middle-xs"},[i("div",{staticClass:"wptb-settings-space-between"},[i("p",{staticClass:"wptb-settings-item-title"},[e._v(e._s(e.label))]),e._v(" "),i("div",{staticClass:"wptb-icon-select-wrapper"},[i("div",{staticClass:"wptb-icon-select-display"},[i("div",{ref:"iconSelectButton",staticClass:"wptb-icon-select-preview",on:{click:e.toggleIconDrawer}},[i("img",{attrs:{src:e.selectedIcon.url}})]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.openDrawer,expression:"openDrawer"}],staticClass:"wptb-icon-select-drawer wptb-plugin-box-shadow-md",style:e.drawerPosition},[i("div",{staticClass:"wptb-icon-search-wrapper"},[i("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.debunkedFilterText,expression:"debunkedFilterText",modifiers:{trim:!0}}],attrs:{type:"text",placeholder:"Search for icons..."},domProps:{value:e.debunkedFilterText},on:{input:function(t){t.target.composing||(e.debunkedFilterText=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),i("div",{ref:"drawerRefElement",staticClass:"wptb-icon-previews"},[i("div",{staticClass:"wptb-icon-select-drawer-preview wptb-icon-reset",on:{click:function(t){return e.setIcon("","")}}}),e._v(" "),e._l(e.fullIconList(),function(t,s){return i("div",{key:s,staticClass:"wptb-icon-select-drawer-preview",class:{"wptb-icon-preview-active":e.selectedIcon.name===s}},[i("img",{attrs:{src:t,title:s,draggable:!1},on:{click:function(i){return e.setIcon(s,t)}}})])}),e._v(" "),i("intersection-observer",{attrs:{"relative-element":e.innerDrawerRef,"force-hide":e.observerHide},on:{visible:e.observerVisible}},[i("div",{staticClass:"wptb-icon-select-drawer-end"})])],2)])])])])])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$9691bd",e):t.createRecord("$9691bd",e))}}();})();
18
+ },{"../components/IntersectionObserver":"WV0h","../mixins/ControlBase":"LTB1","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"Pn7d":[function(require,module,exports) {
19
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("vue")),t=n(require("../functions/WPTB_ControlsManager")),o=n(require("../containers/IconSelectControl"));function n(e){return e&&e.__esModule?e:{default:e}}var r={name:"ControlIconSelect",handler:function(n){var r=t.default.getControlData(n);new e.default({data:r,components:{IconSelectControl:o.default}}).$mount("#".concat(n))}};exports.default=r;
20
  },{"vue":"HYXJ","../functions/WPTB_ControlsManager":"WZJa","../containers/IconSelectControl":"DTps"}],"W4BN":[function(require,module,exports) {
21
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("../mixins/ControlBase"));function t(e){return e&&e.__esModule?e:{default:e}}var u={props:{min:{type:Number,default:1,required:!1},max:{type:Number,default:10,required:!1},step:{type:Number,default:1,required:!1},defaultValue:{type:Number,default:1,required:!1}},mixins:[e.default],data:function(){return{elementMainValue:this.defaultValue}},mounted:function(){this.assignDefaultValue()},watch:{elementMainValue:function(e){var t=this.clampValue(e);this.setTargetValue(this.targetElements[0],t),this.setTableDirty(!0)}},methods:{clampValue:function(e){return e<this.min?this.min:e>this.max?this.max:e}}};exports.default=u;
22
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("div",{staticClass:"wptb-settings-item-header"},[e._v(e._s(e.label))]),e._v(" "),a("div",{staticClass:"wptb-settings-row wptb-settings-middle-xs"},[a("div",{staticClass:"wptb-settings-col-xs-8"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.elementMainValue,expression:"elementMainValue"}],staticClass:"wptb-element-property wptb-size-slider",attrs:{type:"range",min:e.min,max:e.max,step:e.step},domProps:{value:e.elementMainValue},on:{__r:function(t){e.elementMainValue=t.target.value}}})]),e._v(" "),a("div",{staticClass:"wptb-settings-col-xs-4"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.elementMainValue,expression:"elementMainValue"}],staticClass:"wptb-size-number wptb-number-input wptb-element-property",attrs:{type:"number",min:e.min,max:e.max,step:e.step},domProps:{value:e.elementMainValue},on:{input:function(t){t.target.composing||(e.elementMainValue=t.target.value)}}})])])])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$e4f75e",e):t.createRecord("$e4f75e",e))}}();})();
23
+ },{"../mixins/ControlBase":"LTB1","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"YVYX":[function(require,module,exports) {
24
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("vue")),t=o(require("../containers/RangeControl")),n=o(require("../functions/WPTB_ControlsManager"));function o(e){return e&&e.__esModule?e:{default:e}}var r={name:"ControlRange",handler:function(o){var r=n.default.getControlData(o);new e.default({data:r,components:{RangeControl:t.default}}).$mount("#".concat(o))}};exports.default=r;
25
  },{"vue":"HYXJ","../containers/RangeControl":"W4BN","../functions/WPTB_ControlsManager":"WZJa"}],"qsi5":[function(require,module,exports) {
26
  "use strict";function e(){var e={};return function(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2e3;Object.keys(e).includes(t)&&clearTimeout(e[t]),e[t]=setTimeout(r,o)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e();exports.default=t;
27
  },{}],"cW6v":[function(require,module,exports) {
28
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("../functions/DeBouncer"));function t(e){return e&&e.__esModule?e:{default:e}}var i={props:{clone:{type:Boolean,default:!1,required:!1},cloneQuery:{type:String,required:!0},tableDirectives:{type:String,default:""},tableStyle:{type:Object,default:function(){}}},inheritAttrs:!1,data:function(){return{cloneInner:!1,clonedTable:null,mainTable:null,tableDirectiveDatasetId:"wptbResponsiveDirectives",tableHaveDirectives:!1}},mounted:function(){this.cloneInner=this.clone},watch:{clone:function(e){this.cloneInner=e},cloneInner:function(e){e&&(this.startClone(),this.cloneInner=!1)},tableDirectives:function(e){e&&this.addDirectivesToTable(e)},"appOptions.identifyCells":{handler:function(e){e&&(this.showCellIdentification(),this.appOptions.identifyCells=!1)}},"directives.responsiveEnabled":{handler:function(e){e&&(this.mainTable.dataset.wptbAdaptiveTable=0)}}},methods:{startClone:function(){if(this.mainTable=document.querySelector(this.cloneQuery),!this.mainTable)throw new Error("no clone target is found with a query value of ".concat(this.cloneQuery));this.appOptions.hasLegacyResponsive="1"===this.mainTable.dataset.wptbAdaptiveTable,this.clonedTable=this.mainTable.cloneNode(!0),this.clonedTable.classList.add("wptb-plugin-box-shadow-xl"),this.$refs.tableClone.appendChild(this.clonedTable);var e=this.mainTable.dataset[this.tableDirectiveDatasetId];this.tableDirectives&&this.addDirectivesToTable(this.tableDirectives),this.tableHaveDirectives=void 0!==e,this.setupCellIdentification(this.clonedTable),this.$emit("tableCloned",e)},addDirectivesToTable:function(e){this.clonedTable&&this.mainTable&&(this.clonedTable.dataset[this.tableDirectiveDatasetId]=e,this.mainTable.dataset[this.tableDirectiveDatasetId]=e,this.$emit("directivesCopied",this.tableHaveDirectives),this.tableHaveDirectives=!1)},setupCellIdentification:function(e){Array.from(e.querySelectorAll("td")).map(function(e,t){"relative"!==getComputedStyle(e).position&&(e.style.position="relative");var i=document.createRange();i.setStart(e,0);var a="background-color: hsla(211, 25%, ".concat(t%2==0?70:90,"%, 80%)"),n='<div class="wptb-responsive-cell-identifier" style="'.concat(a,'">').concat(t+1,"</div>"),l=i.createContextualFragment(n);e.appendChild(l.childNodes[0])})},showCellIdentification:function(){var t=this;this.clonedTable.classList.add("wptb-responsive-show-cell-identifier"),(0,e.default)("cellIdentification",function(){t.clonedTable.classList.remove("wptb-responsive-show-cell-identifier")},2e3)}}};exports.default=i;
29
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"wptb-responsive-clone-wrapper"},[t("div",{staticClass:"wptb-responsive-clone-inner-wrapper"},[t("div",{ref:"tableClone",style:this.tableStyle})])])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$f93384",e):t.createRecord("$f93384",e))}}();})();
30
+ },{"../functions/DeBouncer":"qsi5","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"h0P7":[function(require,module,exports) {
31
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={inheritAttrs:!1,props:{postFix:{type:String,default:""},value:{type:null,default:0},enableDynamicWidth:{type:Boolean,default:!1},dynamicWidthPadding:{type:Number,default:3},onlyEnter:{type:Boolean,default:!1},min:{type:Number,default:0},max:{type:Number,default:1e3},enableLimit:{type:Boolean,default:!1}},model:{prop:"value",event:"valueChanged"},watch:{value:function(t){this.innerValue=t}},data:function(){return{innerValue:0}},mounted:function(){this.innerValue=this.value},computed:{postFixIt:function(){return"".concat(this.innerValue).concat(this.postFix)},dynamicWidth:function(){return this.enableDynamicWidth?{width:"calc(".concat(this.innerValue.toString().length+this.postFix.length+this.dynamicWidthPadding,"ch) !important")}:{}}},methods:{getValue:function(t){var e=Number.parseInt(t,10);return e=isNaN(e)?0:e,this.enableLimit?this.limitValue(e):e},limitValue:function(t){return t<this.min?this.min:t>this.max?this.max:t},handleOnInput:function(t){this.onlyEnter||this.$emit("valueChanged",this.getValue(t.target.value))},handleEnterInput:function(t){this.onlyEnter&&this.$emit("valueChanged",this.getValue(t.target.value))},handleKeyPress:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"up",e=this.getValue(this.innerValue);switch(t){case"up":e+=1;break;case"down":e-=1;break;default:e+=1}e=this.getValue(e),this.$emit("valueChanged",e)}}};exports.default=t;
32
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("input",{style:e.dynamicWidth,attrs:{type:"text",disabled:e.$attrs.disabled},domProps:{value:e.postFixIt},on:{input:e.handleOnInput,keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.preventDefault(),e.handleKeyPress("up"))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.preventDefault(),e.handleKeyPress("down"))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),e.handleEnterInput(t))}]}})},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$f1bb94",e):t.createRecord("$f1bb94",e))}}();})();
33
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"y8Jx":[function(require,module,exports) {
34
+ var t=null;function e(){return t||(t=n()),t}function n(){try{throw new Error}catch(e){var t=(""+e.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(t)return r(t[0])}return"/"}function r(t){return(""+t).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)\/[^\/]+$/,"$1")+"/"}exports.getBundleURL=e,exports.getBaseURL=r;
35
+ },{}],"uNEb":[function(require,module,exports) {
36
+ var e=require("./bundle-url");function n(e){var n=e.cloneNode();n.onload=function(){e.remove()},n.href=e.href.split("?")[0]+"?"+Date.now(),e.parentNode.insertBefore(n,e.nextSibling)}var l=null;function r(){l||(l=setTimeout(function(){for(var r=document.querySelectorAll('link[rel="stylesheet"]'),t=0;t<r.length;t++)e.getBaseURL(r[t].href)===e.getBundleURL()&&n(r[t]);l=null},50))}module.exports=r;
37
+ },{"./bundle-url":"y8Jx"}],"xi3E":[function(require,module,exports) {
38
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e(require("./NumberPostfixInput"));function e(t){return t&&t.__esModule?t:{default:t}}var a={props:{value:{type:Number,default:0},rawValue:{type:Number,default:0},active:{type:Boolean,default:!1},stopId:String,enableBreakpointCustomization:{type:Boolean,default:!1}},components:{NumberPostfixInput:t.default},data:function(){return{wrapperStyle:{left:0,top:0},innerRawValue:this.rawValue}},watch:{rawValue:function(t){this.innerRawValue=t},value:function(){this.calculateStyle()},innerRawValue:function(t){this.$emit("breakpointChange",t,this.stopId)}},mounted:function(){var t=this;this.$nextTick(function(){t.calculateStyle()})},methods:{clickEvent:function(){this.$emit("click",this.rawValue)},calculateStyle:function(){var t=this.$refs.wrapper,e=this.$refs.knob;if(t){var a=t.getBoundingClientRect().width;this.wrapperStyle.left="calc(".concat(this.value,"% - ").concat(a/2,"px)")}if(e){var n=e.getBoundingClientRect().height;this.wrapperStyle.top="-".concat(n/2,"px")}}}};exports.default=a;
39
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{ref:"wrapper",staticClass:"wptb-slider-stop",class:{"wptb-slider-stop-active":e.active},style:e.wrapperStyle,on:{"!click":function(t){return t.preventDefault(),e.clickEvent(t)}}},[a("div",{ref:"knob",staticClass:"wptb-slider-stop-knob"}),e._v(" "),a("div",{staticClass:"wptb-slider-stop-label"},[e._t("default")],2),e._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:e.enableBreakpointCustomization,expression:"enableBreakpointCustomization"}]},[a("number-postfix-input",{staticClass:"wptb-size-input",staticStyle:{"font-size":"90%"},attrs:{"enable-dynamic-width":!0,"only-enter":!0,"post-fix":"px"},model:{value:e.innerRawValue,callback:function(t){e.innerRawValue=t},expression:"innerRawValue"}})],1)])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$0b619f",e):t.createRecord("$0b619f",e))}}();})();
40
+ },{"./NumberPostfixInput":"h0P7","_css_loader":"uNEb","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"ooD9":[function(require,module,exports) {
41
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={props:{amount:{type:Number,default:0}},computed:{calculateStyle:function(){return{width:"".concat(this.amount,"%")}}}};exports.default=t;
42
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"wptb-screen-size-slider-fill",style:this.calculateStyle})},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$fac9ec",e):t.createRecord("$fac9ec",e))}}();})();
43
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"q8F8":[function(require,module,exports) {
44
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:{positionPercentage:{type:Number,default:0}},data:function(){return{style:{left:0}}},watch:{positionPercentage:{handler:function(){this.calculateStyle()},deep:!0}},mounted:function(){this.calculateStyle()},methods:{calculateStyle:function(){var e=this.$refs.arrowWrapper.getBoundingClientRect().width;this.style.left="calc(".concat(this.positionPercentage,"% - ").concat(e/2,"px)")},handleDrag:function(e){var t=e.screenX,a=e.screenY;0===t&&0===a||this.$emit("arrowDrag",e)}}};exports.default=e;
45
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{ref:"arrowWrapper",staticClass:"wptb-screen-size-slider-arrow",style:e.style,attrs:{draggable:"true"},on:{drag:function(t){return t.preventDefault(),e.handleDrag(t)},dragover:function(e){e.preventDefault()},dragend:function(t){return t.preventDefault(),e.$emit("arrowDragEnd")},drop:function(e){e.preventDefault()},dragexit:function(e){e.preventDefault()},dragleave:function(e){e.preventDefault()}}},[r("svg",{attrs:{width:"17",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[r("path",{attrs:{d:"M8.5 16L0 0h17L8.5 16z",fill:"var(--wptb-plugin-logo-color)"}})])])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$20294b",e):t.createRecord("$20294b",e))}}();})();
46
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"V4gv":[function(require,module,exports) {
47
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=n(require("./SliderStop")),e=n(require("./SliderFill")),i=n(require("./SliderArrow"));function n(t){return t&&t.__esModule?t:{default:t}}var r={props:{stops:Object,endPadding:{type:Number,default:0},modelVal:{type:Number,default:0},enableBreakpointCustomization:{type:Boolean,default:!1}},components:{SliderStop:t.default,SliderFill:e.default,SliderArrow:i.default},data:function(){return{min:0,max:100,currentVal:0,isDragging:!1,minSizeBetweenBreakpoints:100,repaintId:0}},beforeMount:function(){this.calculateMinMax()},watch:{currentVal:function(){this.$emit("slide",this.currentVal)},modelVal:function(t){this.currentVal=Math.floor(t)}},methods:{handleBreakpointChange:function(t,e){var i=this.directives.breakpoints;if(!i[e])throw new Error("no breakpoint found with the given ID: [".concat(e,"]"));var n=Object.keys(i).sort(function(t,e){return i[t].width-i[e].width}),r=n.indexOf(e),a=n[r-1],s=n[r+1];a&&i[a].width>=t&&(t=i[a].width+this.minSizeBetweenBreakpoints),s&&i[s].width<=t&&(t=i[s].width-this.minSizeBetweenBreakpoints),i[e].width=t,this.calculateMinMax(),this.repaintId+=1},calculateMinMax:function(){var t=Object.values(this.stops).sort(function(t,e){return-1*(e.width-t.width)});this.min=t[0].width-this.endPadding,this.max=t[t.length-1].width+this.endPadding,this.currentVal=t[t.length-1].width},translateIntoPercent:function(t){var e=this.max-this.min;return 100*(t-this.min)/e},slide:function(t){this.currentVal=t},handleArrowDrag:function(t){this.isDragging=!0;var e=this.$refs.sliderWrapper.getBoundingClientRect(),i=e.left,n=e.width,r=(t.clientX-i)*(this.max-this.min)/n;this.currentVal=this.limitToRange(this.min+r)},limitToRange:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=t;return t<this.min&&(i=this.min),t>this.max&&(i=this.max),e&&(i=Math.floor(i)),i},isStopActive:function(t){var e=this;return this.currentVal>=t&&Object.values(this.stops).filter(function(t){return t<=e.currentVal}).every(function(e){return e<=t})}}};exports.default=r;
48
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{key:e.repaintId,ref:"sliderWrapper",staticClass:"wptb-screen-size-slider-wrapper",class:{"wptb-drag-active":e.isDragging}},[r("div",{staticClass:"wptb-screen-size-slider-empty"},[r("slider-arrow",{attrs:{"position-percentage":e.translateIntoPercent(e.limitToRange(e.currentVal))},on:{arrowDrag:e.handleArrowDrag,arrowDragEnd:function(t){e.isDragging=!1}}}),e._v(" "),r("slider-fill",{attrs:{amount:e.translateIntoPercent(e.limitToRange(e.currentVal))}}),e._v(" "),e._l(e.stops,function(t,a){var n=t.name,i=t.width;return r("slider-stop",{key:a,attrs:{active:e.isStopActive(i),value:e.translateIntoPercent(i),"raw-value":i,"stop-id":a,enableBreakpointCustomization:e.enableBreakpointCustomization},on:{click:e.slide,breakpointChange:e.handleBreakpointChange}},[e._v(e._s(n))])})],2)])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$5f3f51",e):t.createRecord("$5f3f51",e))}}();})();
49
+ },{"./SliderStop":"xi3E","./SliderFill":"ooD9","./SliderArrow":"q8F8","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"phKF":[function(require,module,exports) {
50
 
51
  var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(n){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(n){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};
52
  },{}],"Q6f0":[function(require,module,exports) {
55
  var e=arguments[3],t=require("process");function n(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 r(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){o(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){return(a="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(e,t,n){"object"===("undefined"==typeof exports?"undefined":a(exports))&&"undefined"!=typeof module?module.exports=n():t[e]=n()}("WPTB_ResponsiveFrontend",self||e,function(){function e(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]}function t(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.element=e,this.referenceObject=n,this.mergedRenderStatus=!0,this.mergedCells={row:[],column:[]},this.getMergedRenderStatus=function(){return t.mergedRenderStatus},this.setMergedRenderStatus=function(e){t.mergedRenderStatus=e},this.addToMergedCells=function(e,n){t.mergedCells[e].push(n)},this.isReference=function(){return null!==t.referenceObject},this.isReference()&&(this.element=e.cloneNode(!0)),this.modifications={},this.spans={row:1,col:1},this.remainingSpans={row:0,col:0},this.cacheSpanValues=function(){Object.keys(t.spans).map(function(e){if(Object.prototype.hasOwnProperty.call(t.spans,e)){var n=t.spans[e];t.spans[e]=t.element.getAttribute("".concat(e,"Span"))||n}})},this.cacheSpanValues(),this.getSpan=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?t.getElement().getAttribute("".concat(e,"Span")):t.spans[e];if(n)return n;throw new Error("no span value found with the given type of [".concat(e,"]"))},this.getRemainingSpans=function(e){return t.remainingSpans[e]},this.setRemainingSpans=function(e,n){t.remainingSpans[e]=n},this.getElement=function(){return t.element},this.createCellElement=function(){return document.createElement("td")},e||(this.element=this.createCellElement()),this.setAttribute=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:",",s=t.getElement()[e];"function"!=typeof s&&"object"!==a(s)||(s=t.getElement().getAttribute(e)),t.modifications[e]&&(s=t.modifications[e].default);var i=s;r?i+="".concat(i).concat(o).concat(n):i=n,t.modifications[e]={value:i,default:s},t.getElement()[e]=i},this.setSpan=function(e,n){if(!t.isReference()){var r=t.getSpan(e)-n<0?t.getSpan(e):n;t.setAttribute("".concat(e,"Span"),r),t.setRemainingSpans(e,t.getSpan(e)-r);for(var o=0;o<r-1;o+=1)t.mergedCells[e][o].setMergedRenderStatus(!1);return!0}if(!t.getMergedRenderStatus())return!1;var a=t.referenceObject.getRemainingSpans(e);if(0===a)return!1;var s=a-n<0?a:n,i=a-s;if(t.referenceObject.setRemainingSpans(e,i),t.setAttribute("".concat(e,"Span"),s),0!==i)for(var l=t.referenceObject.mergedCells[e].length-a+1,d=l+s-1,u=l;u<d;u+=1)t.mergedCells[e][u].setMergedRenderStatus(!1);return!0},this.resetAttribute=function(e){t.modifications[e]&&(t.getElement()[e]=t.modifications[e].default,t.modifications[e]=void 0)},this.resetAllAttributes=function(){Object.keys(t.modifications).map(function(e){Object.prototype.hasOwnProperty.call(t.modifications,e)&&t.resetAttribute(e)})},{getElement:this.getElement,el:this.element,setAttribute:this.setAttribute,resetAllAttributes:this.resetAllAttributes,getSpan:this.getSpan,setSpan:this.setSpan,getRemainingSpans:this.getRemainingSpans,setRemainingSpans:this.setRemainingSpans,isReference:this.isReference,addToMergedCells:this.addToMergedCells,mergedCells:this.mergedCells,setMergedRenderStatus:this.setMergedRenderStatus,getMergedRenderStatus:this.getMergedRenderStatus}}function n(n){var r=this;return this.tableElement=n,this.parsedTable=[],this.rowCache=[],this.originals={rows:[]},this.rowColors={header:null,even:null,odd:null},this.addToParsed=function(e,t,n){r.parsedTable[e]||(r.parsedTable[e]=[]),r.parsedTable[e][t]=n},this.parseTable=function(){var e=Array.from(r.tableElement.querySelectorAll("tr"));e.map(function(e,n){r.originals.rows.push(e),Array.from(e.querySelectorAll("td")).map(function(e,o){var a=new t(e);r.addToParsed(n,o,a);var s=a.getSpan(t.spanTypes.row),i=a.getSpan(t.spanTypes.column);if(s>1)for(var l=1;l<s;l+=1){var d=new t(e,a);a.addToMergedCells("row",d),r.addToParsed(n+l,o,d)}if(i>1)for(var u=1;u<i;u+=1){var c=new t(e,a);a.addToMergedCells("column",c),r.addToParsed(n,o+u,c)}})}),r.parseRowColors(e)},this.parseRowColors=function(t){(!t||t.length<=0)&&e("no rows are found to parse their colors","error"),r.rowColors.header=""===t[0].style.backgroundColor?null:t[0].style.backgroundColor;for(var n=t.length/3>=1?0:1===t.length?2:(t.length-1)%2,o=0;o<n;o+=1){var a=document.createElement("tr");r.tableElement.querySelector("tbody").appendChild(a),t.push(a)}r.rowColors.even=getComputedStyle(t[1]).backgroundColor,r.rowColors.odd=getComputedStyle(t[2]).backgroundColor;for(var s=0;s<n;s+=1)t[t.length-(s+1)].remove()},this.addRow=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;Array.isArray(e)||(e=[e]);var o,a=r.tableElement.querySelector("tbody");if(t)o=r.originals.rows[n];else{var s=document.createRange();s.setStart(a,0),o=s.createContextualFragment('<tr class="'.concat(e.join(" "),'"></tr>')).childNodes[0]}return a.appendChild(o),r.rowCache.push(o),{el:o,id:r.rowCache.length-1}},this.clearTable=function(){r.rowCache=[],r.tableElement.querySelector("tbody").innerHTML=""},this.getRow=function(t){return r.rowCache[t]?r.rowCache[t]:(e("no row with id [".concat(t,"] found in the cache."),"warn"),null)},this.maxRows=function(){return r.parsedTable.length},this.maxColumns=function(){return r.parsedTable.reduce(function(e,t){return t.length>e&&(e=t.length),e},0)},this.getCell=function(t,n){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{if(r.parsedTable[t][n])return o?r.parsedTable[t][n]:r.parsedTable[t][n].el}catch(a){return e("no cell found at the given address of [".concat(t,"-").concat(n,"]"),"warn"),null}return e("no cell found at the given address of [".concat(t,"-").concat(n,"]"),"warn"),null},this.getCellsAtRow=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],o=0;o<r.maxColumns();o+=1){var a=r.getCell(e,o,t);a&&n.push(a)}return n},this.appendToRow=function(e,t,n){var o=r.getRow(n),a=r.getCell(e,t,!0);return a&&o&&o.appendChild(a.getElement()),a},this.appendElementToRow=function(e,t){var n=r.getRow(t);e&&n&&n.appendChild(e)},this.appendObjectToRow=function(e,t){var n=r.getRow(t);e&&n&&n.appendChild(e.getElement())},this.parseTable(),{maxRows:this.maxRows,maxColumns:this.maxColumns,addRow:this.addRow,clearTable:this.clearTable,getCell:this.getCell,appendToRow:this.appendToRow,appendElementToRow:this.appendElementToRow,appendObjectToRow:this.appendObjectToRow,getCellsAtRow:this.getCellsAtRow,el:this.tableElement,rowColors:this.rowColors}}t.spanTypes={row:"row",column:"col"};var o={query:".wptb-preview-table",defaultClasses:["wptb-plugin-responsive-base"],bindToResize:!1};return function(){var e=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.options=r({},o,{},a),this.elements=Array.from(document.querySelectorAll(this.options.query)),this.elementObjects=this.elements.map(function(e){return{el:e,tableObject:new n(e)}}),this.bindRebuildToResize=function(){window.addEventListener("resize",function(t){e.rebuildTables(t.target.innerWidth)})},this.getDirective=function(e){var t=e.dataset.wptbResponsiveDirectives;return t?JSON.parse(atob(t)):null},this.addDefaultClasses=function(t){t.classList.add(e.options.defaultClasses)},this.removeDefaultClasses=function(t){t.classList.remove(e.options.defaultClasses)},this.autoBuild=function(t,n,r,o){var a=r.cellStackDirection[n],s=r.topRowAsHeader[n],i=r.cellsPerRow[n];o.clearTable(),"desktop"===n?(e.buildDefault(o),e.removeDefaultClasses(t)):(e.autoDirectionBuild(o,a,s,i),e.addDefaultClasses(t))},this.autoDirectionBuild=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=t.maxRows(),s=t.maxColumns(),i="row"===n;if(r)e.headerBuild(t,n,o);else if(i)!function(){for(var e=[],n=0;n<a;n+=1)t.getCellsAtRow(n,!0).forEach(function(t){return e.push(t)});for(var r=e.length,s=0,i=0;s<r;s+=o,i+=1){var l=t.addRow("wptb-row");l.el.style.backgroundColor=t.rowColors[i%2==0?"odd":"even"];for(var d=0;d<o;d+=1){var u=e[s+d];u&&(t.appendElementToRow(u.getElement(),l.id),u.resetAllAttributes(),u.setAttribute("style","width: 100% !important",!0,";"),u.setAttribute("colSpan",1),u.setAttribute("rowSpan",1))}}}();else{for(var l=[],d=0;d<s;d+=1)for(var u=0;u<a;u+=1){var c=t.getCell(u,d,!0);c&&l.push(c)}for(var p=l.length,f=0,h=0;f<p;f+=o,h+=1){var g=t.addRow("wptb-row");g.el.style.backgroundColor=t.rowColors[h%2==0?"odd":"even"];for(var b=0;b<o;b+=1){var m=l[f+b];m&&(t.appendElementToRow(m.getElement(),g.id),m.resetAllAttributes(),m.setAttribute("style","width: 100% !important",!0,";"),m.setAttribute("colSpan",1),m.setAttribute("rowSpan",1))}}}},this.headerBuild=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=e.getCellsAtRow(0,!0).map(function(t){return t.setAttribute("style","background-color: ".concat(e.rowColors.header),!0,";"),t}),a="column"===n,s=e.maxRows(),i=e.maxColumns();if(a)for(var l=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=e.addRow("wptb-row");t&&(n.el.style.borderTop="3px solid gray"),o.map(function(t){e.appendElementToRow(t.el.cloneNode(!0),n.id)})},d=Math.ceil((s-1)/r),u=1,c=0;c<d;c+=1){l(c>0);for(var p=0;p<r&&!(u>=s);p+=1){var f=e.addRow("wptb-row");f.el.style.backgroundColor=e.rowColors[p%2==0?"even":"odd"];for(var h=0;h<i;h+=1){var g=e.getCell(u,h,!0);if(g){g.resetAllAttributes();var b=!0,m=g.getSpan(t.spanTypes.row);if(g.getSpan(t.spanTypes.column),m>1){var w=r-p,v=Math.min(m,w);b=g.setSpan(t.spanTypes.row,v),g.setMergedRenderStatus(!0)}b&&e.appendObjectToRow(g,f.id)}}u+=1}}else for(var R=Math.ceil((s-1)/r),C=1,y=0;y<R;y+=1){for(var S=0;S<i;S+=1){var T=e.addRow("wptb-row");T.el.style.backgroundColor="none",y>0&&0===S&&(T.el.style.borderTop="3px solid gray");var A=o[S].el.cloneNode(!0);A.style.backgroundColor="".concat(e.rowColors.header," !important"),e.appendElementToRow(A,T.id);for(var O=0;O<r&&!(C+O>=s);O+=1){var E=e.getCell(C+O,S,!0);if(E){E.resetAllAttributes();var j=!0,M=E.getSpan(t.spanTypes.row);if(E.getSpan(t.spanTypes.column),M>1){var x=r-O,k=Math.min(M,x);j=E.setSpan(t.spanTypes.row,k);var P=E.el.getAttribute("rowSpan"),D=E.el.getAttribute("colSpan");E.setAttribute("rowSpan",D),E.setAttribute("colSpan",P),E.setMergedRenderStatus(!0)}if(j){var q=(C+O+y)%2==0?"even":"odd";1===r&&(q=C%2==0?"even":"odd"),E.setAttribute("style","background-color: ".concat(e.rowColors[q]),!0,";"),e.appendObjectToRow(E,T.id)}}}}C+=r}},this.buildDefault=function(e){for(var t=e.maxRows(),n=e.maxColumns(),r=0;r<t;r+=1)for(var o=e.addRow("",!0,r).id,a=0;a<n;a+=1){var s=e.getCell(r,a,!0);s&&!s.isReference()&&(s.resetAllAttributes(),e.appendElementToRow(s.getElement(),o))}},this.calculateRangeId=function(e,t){var n=Object.keys(t).sort(function(e,n){return t[e].width-t[n].width}),r=n[0];return n.map(function(n){e>=t[n].width&&(r=n)}),r},this.rebuildTable=function(t,n,r){var o=e.getDirective(t);if(o){if(!o.responsiveEnabled)return;var a=o.responsiveMode,s=e["".concat(a,"Build")];n||(n=t.getBoundingClientRect().width);var i=e.calculateRangeId(n,o.breakpoints);if(!s)throw new Error("No build mode named as [".concat(a,"] found."));var l=o.modeOptions[a];s.call(e,t,i,l,r)}},this.rebuildTables=function(t){t||(t=window.innerWidth),e.elementObjects.map(function(n){e.rebuildTable(n.el,t,n.tableObject)})},this.options.bindToResize&&this.bindRebuildToResize(),{rebuildTables:this.rebuildTables}}});
56
  },{"process":"phKF"}],"ATQh":[function(require,module,exports) {
57
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={props:{click:{type:Function,default:function(){console.log("Material button clicked")}},size:{type:String,default:"fit-content"}},computed:{buttonClass:function(){return["wptb-plugin-button-material-".concat(this.size)]}}};exports.default=t;
58
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{staticClass:"wptb-plugin-button-material",class:e.buttonClass,on:{click:function(t){return t.preventDefault(),e.click(t)}}},[e._t("default")],2)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$56eef3",e):t.createRecord("$56eef3",e))}}();})();
59
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"vCKs":[function(require,module,exports) {
60
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./MaterialButton"));function t(e){return e&&e.__esModule?e:{default:e}}var o={props:{message:{type:String,default:"This is a default message for modal window."},visible:{type:Boolean,default:!1},relativeRef:{type:HTMLElement,required:!0},callback:{type:Function,default:function(){console.log("modal button clicked")}}},components:{MaterialButton:e.default},mounted:function(){this.relativeRef.appendChild(this.$refs.mainWrapper)},beforeDestroy:function(){this.$refs.mainWrapper.remove()}};exports.default=o;
61
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],ref:"mainWrapper",staticClass:"wptb-plugin-modal-window"},[i("div",{staticClass:"wptb-plugin-modal-inner-window"},[e._m(0),e._v(" "),i("div",{staticClass:"wptb-plugin-modal-message"},[e._v(e._s(e.message))]),e._v(" "),i("div",{staticClass:"wptb-plugin-modal-button-container"},[i("material-button",{attrs:{size:"full-size",click:e.callback}},[e._v(e._s(e.strings.okay))])],1)])])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"wptb-plugin-modal-icon"},[t("span",{staticClass:"dashicons dashicons-warning"})])}],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$3d3366",e):t.createRecord("$3d3366",e))}}();})();
62
+ },{"./MaterialButton":"ATQh","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"waBm":[function(require,module,exports) {
63
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=c(require("../components/TableClone")),t=c(require("../components/ScreenSizeSlider")),i=c(require("../../../WPTB_ResponsiveFrontend")),n=c(require("../functions/DeBouncer")),r=c(require("../components/ModalWindow")),o=c(require("../components/MaterialButton")),s=c(require("../components/NumberPostfixInput"));function c(e){return e&&e.__esModule?e:{default:e}}function u(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function a(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?u(Object(i),!0).forEach(function(t){l(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):u(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function l(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var d={props:{cloneQuery:{type:String,required:!0},screenSizes:Object,compareSizes:Object},components:{TableClone:e.default,ScreenSizeSlider:t.default,ModalWindow:r.default,MaterialButton:o.default,NumberPostfixInput:s.default},data:function(){return{isVisible:!0,currentSize:0,currentDirectives:null,currentSizeRangeName:"desktop",sliderPadding:20,sizeStops:{},responsiveFrontend:null,rebuilding:!1,debounceTime:1e3,sizeLimitMin:100,sizeLimitMax:0}},watch:{currentSizeRangeName:function(e){this.appOptions.currentBreakpoint=e},directives:{handler:function(){this.currentDirectives=this.encodeResponsiveDirectives()},deep:!0},"appOptions.currentSize":{handler:function(e){var t=this,i=this.currentSizeRangeName;this.currentSizeRangeName=this.calculateSizeRangeName(e),i!==this.currentSizeRangeName&&this.directives.responsiveEnabled&&(this.rebuilding=!0,(0,n.default)("currentSize",function(){t.responsiveFrontend.rebuildTables(t.appOptions.currentSize),t.rebuilding=!1},this.debounceTime))}}},beforeMount:function(){},mounted:function(){var e=this;document.addEventListener("wptbSectionChanged",function(t){e.isVisible="table_responsive_menu"===t.detail}),this.sizeLimitMax=this.$refs.builderResponsive.getBoundingClientRect().width},computed:{tableStyle:function(){if(!this.directives.responsiveEnabled)return{};var e=this.limitToRange(this.appOptions.currentSize,Math.min(this.sizeLimitMin,this.sizeLimitMax),Math.max(this.sizeLimitMin,this.sizeLimitMax));return{width:"".concat(e,"px")}},modalRelative:function(){return document.querySelector(".wptb-builder-panel")}},methods:{limitToRange:function(e,t,i){return e>i?i:e<t?t:e},tableCloned:function(e){if(this.responsiveFrontend=new i.default({query:".wptb-builder-responsive table"}),e){var t=this.decodeResponsiveDirectives(e);try{var n=JSON.parse(t);this.deepMergeObject(this.directives,n)}catch(r){console.warn("[WPTB]: invalid directive found at main table")}}},deepMergeObject:function(e,t){Object.keys(t).map(function(i){Object.prototype.hasOwnProperty.call(t,i)&&void 0!==e[i]&&("object"===p(e[i])?e[i]=a({},e[i],{},t[i]):e[i]=t[i])})},directivesCopied:function(e){this.responsiveFrontend.rebuildTables(this.appOptions.currentSize),e||(new WPTB_TableStateSaveManager).tableStateSet(),this.rebuilding=!1},sliderSizeStops:function(){var e=this,t=Object.keys(this.screenSizes).reduce(function(t,i){return Object.prototype.hasOwnProperty.call(e.screenSizes,i)&&(t[e.screenSizes[i].name]=e.screenSizes[i].width),t},{});return this.directives.stops=t,t},calculateSizeRangeName:function(e){var t=this.directives.breakpoints,i=Object.keys(t).filter(function(i){return!!Object.prototype.hasOwnProperty.call(t,i)&&t[i].width<=e}).sort(function(e,i){return t[e].width-t[i].width});return 0===i.length?"mobile":i[i.length-1]},handleSizeSlideChange:function(e){this.appOptions.currentSize=e},encodeResponsiveDirectives:function(){var e=JSON.stringify(this.directives);return btoa(e)},decodeResponsiveDirectives:function(e){return atob(e)},showCellIdentifications:function(){this.appOptions.identifyCells=!0}}};exports.default=d;
64
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"wptb-fade"}},[e.isVisible?i("div",{ref:"builderResponsive",staticClass:"wptb-builder-responsive"},[i("div",{staticClass:"wptb-responsive-menu-tools"},[i("screen-size-slider",{attrs:{"end-padding":e.sliderPadding,stops:e.directives.breakpoints,"model-val":e.appOptions.currentSize,"enable-breakpoint-customization":!1},on:{slide:e.handleSizeSlideChange}})],1),e._v(" "),i("div",{staticClass:"wptb-responsive-builder-main wptb-checkerboard-pattern wptb-plugin-inset-shadow-md"},[i("div",{staticClass:"wptb-responsive-builder-toolbox-float"},[i("number-postfix-input",{staticClass:"wptb-size-input wptb-plugin-box-shadow-xl",attrs:{"post-fix":"px","only-enter":!0},model:{value:e.appOptions.currentSize,callback:function(t){e.$set(e.appOptions,"currentSize",t)},expression:"appOptions.currentSize"}}),e._v(" "),i("material-button",{staticClass:"wptb-plugin-box-shadow-xl",attrs:{size:"fit-content",click:e.showCellIdentifications}},[e._v(e._s(e._f("cap")(e.strings.identifyCells))+" ")])],1),e._v(" "),i("table-clone",{ref:"tableClone",attrs:{clone:e.isVisible,"clone-query":e.cloneQuery,"table-directives":e.currentDirectives,"table-style":e.tableStyle},on:{tableCloned:e.tableCloned,directivesCopied:e.directivesCopied}}),e._v(" "),i("transition",{attrs:{name:"wptb-fade"}},[e.directives.responsiveEnabled?e._e():i("div",{staticClass:"wptb-responsive-disabled-table-overlay"})]),e._v(" "),i("transition",{attrs:{name:"wptb-fade"}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.rebuilding,expression:"rebuilding"}],staticClass:"wptb-responsive-wait-overlay"},[e._v(e._s(e.strings.rebuilding))])]),e._v(" "),i("modal-window",{attrs:{visible:e.appOptions.hasLegacyResponsive,message:e.strings.legacyResponsiveWarning,"relative-ref":e.modalRelative,callback:function(){e.appOptions.hasLegacyResponsive=!1}}})],1)]):e._e()])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$4bc76e",e):t.createRecord("$4bc76e",e))}}();})();
65
+ },{"../components/TableClone":"cW6v","../components/ScreenSizeSlider":"V4gv","../../../WPTB_ResponsiveFrontend":"Q6f0","../functions/DeBouncer":"qsi5","../components/ModalWindow":"vCKs","../components/MaterialButton":"ATQh","../components/NumberPostfixInput":"h0P7","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"TuCQ":[function(require,module,exports) {
66
 
67
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"wptb-controls-flex-row"},[this._t("default")],2)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$63bc72",e):t.createRecord("$63bc72",e))}}();})();
68
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"GZC0":[function(require,module,exports) {
69
  "use strict";function e(e,t){e.filter("cap",function(e){return e.split(" ").map(function(e){return e[0].toUpperCase()+e.slice(1)}).join(" ")})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={install:e};exports.default=t;
70
  },{}],"yEip":[function(require,module,exports) {
71
  "use strict";function t(t,e){t.mixin({data:function(){return{strings:e.strings}}})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={install:t};exports.default=e;
75
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:{label:String,value:{type:null},disabled:{type:Boolean,default:!1}},data:function(){return{innerValue:""}},model:{prop:"value",event:"valueChanged"},watch:{value:function(e){this.innerValue=e},innerValue:function(e){this.$emit("valueChanged",e)}},mounted:function(){this.innerValue=this.value}},t=e;exports.default=t;
76
  },{}],"osOD":[function(require,module,exports) {
77
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("../mixins/PanelControlBase"));function t(e){return e&&e.__esModule?e:{default:e}}var r={mixins:[e.default]};exports.default=r;
78
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"wptb-element-option wptb-settings-items wptb-plugin-width-full"},[i("div",{staticClass:"wptb-settings-row wptb-settings-middle-xs"},[i("label",{staticClass:"wptb-toggle"},[i("span",{staticStyle:{"font-size":"16px"}},[e._v(" "+e._s(e.label)+" ")]),e._v(" "),i("input",{directives:[{name:"model",rawName:"v-model",value:e.innerValue,expression:"innerValue"}],staticClass:"wptb-element-property",attrs:{type:"checkbox",disabled:e.disabled},domProps:{checked:Array.isArray(e.innerValue)?e._i(e.innerValue,null)>-1:e.innerValue},on:{change:function(t){var i=e.innerValue,n=t.target,a=!!n.checked;if(Array.isArray(i)){var l=e._i(i,null);n.checked?l<0&&(e.innerValue=i.concat([null])):l>-1&&(e.innerValue=i.slice(0,l).concat(i.slice(l+1)))}else e.innerValue=a}}}),e._v(" "),i("i")])])])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$7e4992",e):t.createRecord("$7e4992",e))}}();})();
79
+ },{"../mixins/PanelControlBase":"vpWQ","_css_loader":"uNEb","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"fI53":[function(require,module,exports) {
80
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("../mixins/PanelControlBase"));function t(e){return e&&e.__esModule?e:{default:e}}var o={props:{options:{type:Object,default:function(){}}},mixins:[e.default]};exports.default=o;
81
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("div",{staticClass:"wptb-element-option wptb-settings-items wptb-plugin-width-full"},[l("div",{staticClass:"wptb-settings-row wptb-settings-middle-xs"},[l("label",{staticClass:"wptb-control-row wptb-flex wptb-flex-row wptb-flex-align-center wptb-flex-justify-space-between"},[l("span",{staticStyle:{"font-size":"16px"}},[e._v(" "+e._s(e.label)+" ")]),e._v(" "),l("select",{directives:[{name:"model",rawName:"v-model",value:e.innerValue,expression:"innerValue"}],attrs:{disabled:e.disabled},on:{change:function(t){var l=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.innerValue=t.target.multiple?l:l[0]}}},e._l(e.options,function(t,n){return l("option",{key:n,domProps:{value:n}},[e._v(e._s(e._f("cap")(t)))])}),0)])])])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$ed1125",e):t.createRecord("$ed1125",e))}}();})();
82
+ },{"../mixins/PanelControlBase":"vpWQ","_css_loader":"uNEb","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"DmVJ":[function(require,module,exports) {
83
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("vue-fragment"),r=t(require("./PanelToggleControl")),o=t(require("./PanelDropdownControl"));function t(e){return e&&e.__esModule?e:{default:e}}var n={components:{PanelToggleControl:r.default,PanelDropdownControl:o.default,Fragment:e.Fragment}};exports.default=n;
84
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,o=e.$createElement,t=e._self._c||o;return t("fragment",[t("panel-toggle-control",{attrs:{label:e._f("cap")(e.strings.enableResponsive)},model:{value:e.directives.responsiveEnabled,callback:function(o){e.$set(e.directives,"responsiveEnabled",o)},expression:"directives.responsiveEnabled"}}),e._v(" "),t("panel-dropdown-control",{attrs:{label:e._f("cap")(e.strings.mode),options:{auto:"auto"},disabled:!e.directives.responsiveEnabled},model:{value:e.directives.responsiveMode,callback:function(o){e.$set(e.directives,"responsiveMode",o)},expression:"directives.responsiveMode"}})],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var o=require("vue-hot-reload-api");o.install(require("vue")),o.compatible&&(module.hot.accept(),module.hot.data?o.reload("$412844",e):o.createRecord("$412844",e))}}();})();
85
+ },{"vue-fragment":"CDb8","./PanelToggleControl":"osOD","./PanelDropdownControl":"fI53","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"UchZ":[function(require,module,exports) {
86
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:{header:{type:String,default:"Tab Header"},tabs:{type:Object,default:function(){return{default:"Default"}}},currentTab:{type:String,default:"default"}},methods:{isActiveTab:function(e){return this.currentTab===e},handleTabClick:function(e){this.$emit("tabClicked",e)}}};exports.default=e;
87
+ (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"wptb-section-group-tabbed wptb-plugin-box-shadow-md wptb-plugin-width-full"},[a("div",{staticClass:"wptb-panel-toggle wptb-section-group-tabbed-header"},[a("div",{staticClass:"header"},[t._v(t._s(t.header))])]),t._v(" "),a("div",{staticClass:"wptb-section-group-tabbed-tabs-buttons"},t._l(t.tabs,function(e,i){return a("div",{key:i,staticClass:"wptb-settings-section-item static-active",class:{active:t.isActiveTab(i),disabled:!t.isActiveTab(i)},on:{"!click":function(e){return e.preventDefault(),t.handleTabClick(i)}}},[t._v(" "+t._s(e)+" ")])}),0),t._v(" "),a("div",{staticClass:"wptb-section-group-tab-content"},[t._t("default")],2)])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var e=require("vue-hot-reload-api");e.install(require("vue")),e.compatible&&(module.hot.accept(),module.hot.data?e.reload("$480f41",t):e.createRecord("$480f41",t))}}();})();
88
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"bOKu":[function(require,module,exports) {
89
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("../mixins/PanelControlBase")),t=r(require("./NumberPostfixInput"));function r(e){return e&&e.__esModule?e:{default:e}}var u={components:{NumberPostfixInput:t.default},mixins:[e.default]};exports.default=u;
90
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"wptb-element-option wptb-settings-items wptb-plugin-width-full"},[i("div",{staticClass:"wptb-settings-row wptb-settings-middle-xs"},[i("label",{staticClass:"wptb-control-row wptb-flex wptb-flex-row wptb-flex-align-center wptb-flex-justify-space-between"},[i("span",{staticStyle:{"font-size":"16px"}},[e._v(" "+e._s(e.label)+" ")]),e._v(" "),i("number-postfix-input",{staticClass:"wptb-size-input",attrs:{"enable-dynamic-width":!0,min:1,max:100,"enable-limit":!0,disabled:e.disabled},model:{value:e.innerValue,callback:function(t){e.innerValue=t},expression:"innerValue"}})],1)])])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$aa2c63",e):t.createRecord("$aa2c63",e))}}();})();
91
+ },{"../mixins/PanelControlBase":"vpWQ","./NumberPostfixInput":"h0P7","_css_loader":"uNEb","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"rfRR":[function(require,module,exports) {
92
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("vue-fragment"),t=n(require("./PanelToggleControl")),r=n(require("./PanelDropdownControl")),o=n(require("./PanelInputControl"));function n(e){return e&&e.__esModule?e:{default:e}}var i={components:{Fragment:e.Fragment,PanelToggleControl:t.default,PanelDropdownControl:r.default,PanelInputControl:o.default},methods:{isDisabled:function(){return"desktop"===this.appOptions.currentBreakpoint||!this.directives.responsiveEnabled}},computed:{perLabelString:function(){return this.directives.modeOptions.auto.topRowAsHeader[this.appOptions.currentBreakpoint]?this.strings.itemsPerHeader:this.strings.cellsPerRow}}};exports.default=i;
93
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("fragment",[o("panel-toggle-control",{attrs:{label:e._f("cap")(e.strings.topRowHeader),disabled:e.isDisabled()},model:{value:e.directives.modeOptions.auto.topRowAsHeader[e.appOptions.currentBreakpoint],callback:function(t){e.$set(e.directives.modeOptions.auto.topRowAsHeader,e.appOptions.currentBreakpoint,t)},expression:"directives.modeOptions.auto.topRowAsHeader[appOptions.currentBreakpoint]"}}),e._v(" "),o("panel-dropdown-control",{attrs:{label:e._f("cap")(e.strings.stackDirection),options:{row:e.strings.row,column:e.strings.column},disabled:e.isDisabled()},model:{value:e.directives.modeOptions.auto.cellStackDirection[e.appOptions.currentBreakpoint],callback:function(t){e.$set(e.directives.modeOptions.auto.cellStackDirection,e.appOptions.currentBreakpoint,t)},expression:"directives.modeOptions.auto.cellStackDirection[appOptions.currentBreakpoint]"}}),e._v(" "),o("panel-input-control",{attrs:{label:e._f("cap")(e.perLabelString),disabled:e.isDisabled()},model:{value:e.directives.modeOptions.auto.cellsPerRow[e.appOptions.currentBreakpoint],callback:function(t){e.$set(e.directives.modeOptions.auto.cellsPerRow,e.appOptions.currentBreakpoint,t)},expression:"directives.modeOptions.auto.cellsPerRow[appOptions.currentBreakpoint]"}})],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$a40c8a",e):t.createRecord("$a40c8a",e))}}();})();
94
+ },{"vue-fragment":"CDb8","./PanelToggleControl":"osOD","./PanelDropdownControl":"fI53","./PanelInputControl":"bOKu","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"BxO6":[function(require,module,exports) {
95
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("./PanelSectionGroupTabbed")),t=r(require("./AutoModePanelControls"));function r(e){return e&&e.__esModule?e:{default:e}}var o={components:{PanelSectionGroupTabbed:e.default,AutoModePanelControls:t.default},computed:{breakpointsObject:function(){var e=this;return Object.keys(this.directives.breakpoints).sort(function(t,r){return e.directives.breakpoints[t].width-e.directives.breakpoints[r].width}).reduce(function(t,r){return Object.prototype.hasOwnProperty.call(e.directives.breakpoints,r)&&(t[r]=e.directives.breakpoints[r].name),t},{})},currentPanelControls:function(){return"".concat(this.directives.responsiveMode[0].toUpperCase()+this.directives.responsiveMode.slice(1),"ModePanelControls")}},methods:{handleTabChange:function(e){this.appOptions.currentBreakpoint=e,this.appOptions.currentSize=this.directives.breakpoints[e].width}}};exports.default=o;
96
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this.$createElement,t=this._self._c||e;return t("panel-section-group-tabbed",{attrs:{"current-tab":this.appOptions.currentBreakpoint,tabs:this.breakpointsObject,header:this.strings[this.directives.responsiveMode]},on:{tabClicked:this.handleTabChange}},[t(this.currentPanelControls,{tag:"component"})],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$8f1cbb",e):t.createRecord("$8f1cbb",e))}}();})();
97
+ },{"./PanelSectionGroupTabbed":"UchZ","./AutoModePanelControls":"rfRR","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"Ub7O":[function(require,module,exports) {
98
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=l(require("vue")),n=l(require("../containers/ResponsiveApp")),t=l(require("../components/ResponsiveControlsRow")),o=l(require("../functions/WPTB_ControlsManager")),r=l(require("../plugins/filters")),s=l(require("../plugins/strings")),a=l(require("../components/ResponsivePanelGeneralControls")),i=l(require("../components/ResponsivePanelModeControls"));function l(e){return e&&e.__esModule?e:{default:e}}function p(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function u(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?p(Object(t),!0).forEach(function(n){c(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function c(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var d={name:"ResponsiveTable",handler:function(l){var p=o.default.getControlData("responsiveMenuData"),c={responsiveEnabled:!1,responsiveMode:"auto",preserveRowColor:!1,modeOptions:{auto:{topRowAsHeader:{desktop:!1,tablet:!1,mobile:!1},cellStackDirection:{desktop:"row",tablet:"row",mobile:"row"},cellsPerRow:{desktop:1,tablet:1,mobile:1}}},breakpoints:p.screenSizes};e.default.use({install:function(e,n){var t=n.components;e.mixin({components:t})}},{components:{ResponsiveControlsRow:t.default}}),e.default.use({install:function(e,n){e.mixin({data:function(){return n.data}})}},{data:{appOptions:{identifyCells:!1,hasLegacyResponsive:!1,currentBreakpoint:"desktop",currentSize:0},directives:c}}),e.default.use(r.default),e.default.use(s.default,p),new e.default({components:{ResponsiveApp:n.default},data:u({mainTableQuery:".wptb-preview-table"},p),template:'<responsive-app :clone-query="mainTableQuery" :screen-sizes="screenSizes" :compare-sizes="compareSizes"></responsive-app>'}).$mount("#".concat(l)),new e.default({components:{ResponsivePanelGeneralControls:a.default},template:"<responsive-panel-general-controls></responsive-panel-general-controls>"}).$mount("#responsiveBuilderLeftPanelGeneralControls"),new e.default({components:{ResponsivePanelModeControls:i.default},data:u({},p),template:"<responsive-panel-mode-controls></responsive-panel-mode-controls>"}).$mount("#responsiveBuilderLeftPanelModeOptions")}};exports.default=d;
99
  },{"vue":"HYXJ","../containers/ResponsiveApp":"waBm","../components/ResponsiveControlsRow":"TuCQ","../functions/WPTB_ControlsManager":"WZJa","../plugins/filters":"GZC0","../plugins/strings":"yEip","../components/ResponsivePanelGeneralControls":"DmVJ","../components/ResponsivePanelModeControls":"BxO6"}],"Zn1h":[function(require,module,exports) {
100
 
101
  "use strict";var e=u(require("vue")),t=u(require("./mountPoints/WPTB_IconSelectControl")),n=u(require("./mountPoints/WPTB_RangeControl")),o=u(require("./functions/WPTB_ControlsManager")),r=u(require("./mountPoints/WPTB_ResponsiveTable"));function u(e){return e&&e.__esModule?e:{default:e}}e.default.config.productionTip=!1;var a=self||void 0;a.WPTB_ControlsManager=o.default;var i=[t.default,n.default,o.default,r.default];function l(e){o.default.addControlScript(e.name,e.handler)}i.map(l);
102
+ },{"vue":"HYXJ","./mountPoints/WPTB_IconSelectControl":"Pn7d","./mountPoints/WPTB_RangeControl":"YVYX","./functions/WPTB_ControlsManager":"WZJa","./mountPoints/WPTB_ResponsiveTable":"Ub7O"}],"PMBU":[function(require,module,exports) {
103
+ var global = arguments[3];
104
+ var e,t,o=arguments[3],a="__parcel__error__overlay__",r=module.bundle.Module;function n(e){r.call(this,e),this.hot={data:module.bundle.hotData,_acceptCallbacks:[],_disposeCallbacks:[],accept:function(e){this._acceptCallbacks.push(e||function(){})},dispose:function(e){this._disposeCallbacks.push(e)}},module.bundle.hotData=null}module.bundle.Module=n;var c=module.bundle.parent;if(!(c&&c.isParcelRequire||"undefined"==typeof WebSocket)){var i=location.hostname,l="https:"===location.protocol?"wss":"ws",s=new WebSocket(l+"://"+i+":3488/");s.onmessage=function(a){e={},t=[];var r=JSON.parse(a.data);if("update"===r.type){var n=!1;r.assets.forEach(function(e){e.isNew||h(o.parcelRequire,e.id)&&(n=!0)}),(n=n||r.assets.every(function(e){return"css"===e.type&&e.generated.js}))?(console.clear(),r.assets.forEach(function(e){f(o.parcelRequire,e)}),t.forEach(function(e){m(e[0],e[1])})):location.reload&&location.reload()}if("reload"===r.type&&(s.close(),s.onclose=function(){location.reload()}),"error-resolved"===r.type&&(console.log("[parcel] ✨ Error resolved"),p()),"error"===r.type){console.error("[parcel] 🚨 "+r.error.message+"\n"+r.error.stack),p();var c=d(r);document.body.appendChild(c)}}}function p(){var e=document.getElementById(a);e&&e.remove()}function d(e){var t=document.createElement("div");t.id=a;var o=document.createElement("div"),r=document.createElement("pre");return o.innerText=e.error.message,r.innerText=e.error.stack,t.innerHTML='<div style="background: black; font-size: 16px; color: white; position: fixed; height: 100%; width: 100%; top: 0px; left: 0px; padding: 30px; opacity: 0.85; font-family: Menlo, Consolas, monospace; z-index: 9999;"><span style="background: red; padding: 2px 4px; border-radius: 2px;">ERROR</span><span style="top: 2px; margin-left: 5px; position: relative;">🚨</span><div style="font-size: 18px; font-weight: bold; margin-top: 20px;">'+o.innerHTML+"</div><pre>"+r.innerHTML+"</pre></div>",t}function u(e,t){var o=e.modules;if(!o)return[];var a,r,n,c=[];for(a in o)for(r in o[a][1])((n=o[a][1][r])===t||Array.isArray(n)&&n[n.length-1]===t)&&c.push(a);return e.parent&&(c=c.concat(u(e.parent,t))),c}function f(e,t){var o=e.modules;if(o)if(o[t.id]||!e.parent){var a=new Function("require","module","exports",t.generated.js);t.isNew=!o[t.id],o[t.id]=[a,t.deps]}else e.parent&&f(e.parent,t)}function h(a,r){var n=a.modules;if(n){if(!n[r]&&a.parent)return h(a.parent,r);if(!e[r]){e[r]=!0;var c=a.cache[r];return t.push([a,r]),!!(c&&c.hot&&c.hot._acceptCallbacks.length)||u(o.parcelRequire,r).some(function(e){return h(o.parcelRequire,e)})}}}function m(e,t){var o=e.cache[t];if(e.hotData={},o&&(o.hot.data=e.hotData),o&&o.hot&&o.hot._disposeCallbacks.length&&o.hot._disposeCallbacks.forEach(function(t){t(e.hotData)}),delete e.cache[t],e(t),(o=e.cache[t])&&o.hot&&o.hot._acceptCallbacks.length)return o.hot._acceptCallbacks.forEach(function(e){e()}),!0}
105
+ },{}]},{},["PMBU","Zn1h"], null)
inc/admin/js/WPTB_Import_Menu.js CHANGED
@@ -3,44 +3,50 @@ var global = arguments[3];
3
  var e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=Object.freeze({});function n(e){return null==e}function r(e){return null!=e}function i(e){return!0===e}function o(e){return!1===e}function a(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function s(e){return null!==e&&"object"==typeof e}var c=Object.prototype.toString;function u(e){return c.call(e).slice(8,-1)}function l(e){return"[object Object]"===c.call(e)}function f(e){return"[object RegExp]"===c.call(e)}function p(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function d(e){return r(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function v(e){return null==e?"":Array.isArray(e)||l(e)&&e.toString===c?JSON.stringify(e,null,2):String(e)}function h(e){var t=parseFloat(e);return isNaN(t)?e:t}function m(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}var y=m("slot,component",!0),g=m("key,ref,slot,slot-scope,is");function _(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}var b=Object.prototype.hasOwnProperty;function $(e,t){return b.call(e,t)}function w(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var x=/-(\w)/g,C=w(function(e){return e.replace(x,function(e,t){return t?t.toUpperCase():""})}),A=w(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),k=/\B([A-Z])/g,O=w(function(e){return e.replace(k,"-$1").toLowerCase()});function S(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function T(e,t){return e.bind(t)}var N=Function.prototype.bind?T:S;function j(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function E(e,t){for(var n in t)e[n]=t[n];return e}function M(e){for(var t={},n=0;n<e.length;n++)e[n]&&E(t,e[n]);return t}function D(e,t,n){}var L=function(e,t,n){return!1},I=function(e){return e};function F(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}function P(e,t){if(e===t)return!0;var n=s(e),r=s(t);if(!n||!r)return!n&&!r&&String(e)===String(t);try{var i=Array.isArray(e),o=Array.isArray(t);if(i&&o)return e.length===t.length&&e.every(function(e,n){return P(e,t[n])});if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(i||o)return!1;var a=Object.keys(e),c=Object.keys(t);return a.length===c.length&&a.every(function(n){return P(e[n],t[n])})}catch(u){return!1}}function R(e,t){for(var n=0;n<e.length;n++)if(P(e[n],t))return n;return-1}function H(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}var B="data-server-rendered",U=["component","directive","filter"],z=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch"],V={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:L,isReservedAttr:L,isUnknownElement:L,getTagNamespace:D,parsePlatformTagName:I,mustUseProp:L,async:!0,_lifecycleHooks:z},J=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function K(e){var t=(e+"").charCodeAt(0);return 36===t||95===t}function q(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var W=new RegExp("[^"+J.source+".$_\\d]");function Z(e){if(!W.test(e)){var t=e.split(".");return function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e}}}var G,X="__proto__"in{},Y="undefined"!=typeof window,Q="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,ee=Q&&WXEnvironment.platform.toLowerCase(),te=Y&&window.navigator.userAgent.toLowerCase(),ne=te&&/msie|trident/.test(te),re=te&&te.indexOf("msie 9.0")>0,ie=te&&te.indexOf("edge/")>0,oe=te&&te.indexOf("android")>0||"android"===ee,ae=te&&/iphone|ipad|ipod|ios/.test(te)||"ios"===ee,se=te&&/chrome\/\d+/.test(te)&&!ie,ce=te&&/phantomjs/.test(te),ue=te&&te.match(/firefox\/(\d+)/),le={}.watch,fe=!1;if(Y)try{var pe={};Object.defineProperty(pe,"passive",{get:function(){fe=!0}}),window.addEventListener("test-passive",null,pe)}catch(Xl){}var de=function(){return void 0===G&&(G=!Y&&!Q&&void 0!==e&&(e.process&&"server"===e.process.env.VUE_ENV)),G},ve=Y&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function he(e){return"function"==typeof e&&/native code/.test(e.toString())}var me,ye="undefined"!=typeof Symbol&&he(Symbol)&&"undefined"!=typeof Reflect&&he(Reflect.ownKeys);me="undefined"!=typeof Set&&he(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ge,_e,be,$e,we=D,xe=D,Ce=D,Ae=D,ke=0,Oe=function(){this.id=ke++,this.subs=[]};Oe.prototype.addSub=function(e){this.subs.push(e)},Oe.prototype.removeSub=function(e){_(this.subs,e)},Oe.prototype.depend=function(){Oe.target&&Oe.target.addDep(this)},Oe.prototype.notify=function(){var e=this.subs.slice();for(var t=0,n=e.length;t<n;t++)e[t].update()},Oe.target=null;var Se=[];function Te(e){Se.push(e),Oe.target=e}function Ne(){Se.pop(),Oe.target=Se[Se.length-1]}var je=function(e,t,n,r,i,o,a,s){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},Ee={child:{configurable:!0}};Ee.child.get=function(){return this.componentInstance},Object.defineProperties(je.prototype,Ee);var Me=function(e){void 0===e&&(e="");var t=new je;return t.text=e,t.isComment=!0,t};function De(e){return new je(void 0,void 0,void 0,String(e))}function Le(e){var t=new je(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}var Ie=Array.prototype,Fe=Object.create(Ie),Pe=["push","pop","shift","unshift","splice","sort","reverse"];Pe.forEach(function(e){var t=Ie[e];q(Fe,e,function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var i,o=t.apply(this,n),a=this.__ob__;switch(e){case"push":case"unshift":i=n;break;case"splice":i=n.slice(2)}return i&&a.observeArray(i),a.dep.notify(),o})});var Re=Object.getOwnPropertyNames(Fe),He=!0;function Be(e){He=e}var Ue=function(e){this.value=e,this.dep=new Oe,this.vmCount=0,q(e,"__ob__",this),Array.isArray(e)?(X?ze(e,Fe):Ve(e,Fe,Re),this.observeArray(e)):this.walk(e)};function ze(e,t){e.__proto__=t}function Ve(e,t,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];q(e,o,t[o])}}function Je(e,t){var n;if(s(e)&&!(e instanceof je))return $(e,"__ob__")&&e.__ob__ instanceof Ue?n=e.__ob__:He&&!de()&&(Array.isArray(e)||l(e))&&Object.isExtensible(e)&&!e._isVue&&(n=new Ue(e)),t&&n&&n.vmCount++,n}function Ke(e,t,n,r,i){var o=new Oe,a=Object.getOwnPropertyDescriptor(e,t);if(!a||!1!==a.configurable){var s=a&&a.get,c=a&&a.set;s&&!c||2!==arguments.length||(n=e[t]);var u=!i&&Je(n);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=s?s.call(e):n;return Oe.target&&(o.depend(),u&&(u.dep.depend(),Array.isArray(t)&&Ze(t))),t},set:function(t){var r=s?s.call(e):n;t===r||t!=t&&r!=r||s&&!c||(c?c.call(e,t):n=t,u=!i&&Je(t),o.notify())}})}}function qe(e,t,n){if(Array.isArray(e)&&p(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var r=e.__ob__;return e._isVue||r&&r.vmCount?n:r?(Ke(r.value,t,n),r.dep.notify(),n):(e[t]=n,n)}function We(e,t){if(Array.isArray(e)&&p(t))e.splice(t,1);else{var n=e.__ob__;e._isVue||n&&n.vmCount||$(e,t)&&(delete e[t],n&&n.dep.notify())}}function Ze(e){for(var t=void 0,n=0,r=e.length;n<r;n++)(t=e[n])&&t.__ob__&&t.__ob__.dep.depend(),Array.isArray(t)&&Ze(t)}Ue.prototype.walk=function(e){for(var t=Object.keys(e),n=0;n<t.length;n++)Ke(e,t[n])},Ue.prototype.observeArray=function(e){for(var t=0,n=e.length;t<n;t++)Je(e[t])};var Ge=V.optionMergeStrategies;function Xe(e,t){if(!t)return e;for(var n,r,i,o=ye?Reflect.ownKeys(t):Object.keys(t),a=0;a<o.length;a++)"__ob__"!==(n=o[a])&&(r=e[n],i=t[n],$(e,n)?r!==i&&l(r)&&l(i)&&Xe(r,i):qe(e,n,i));return e}function Ye(e,t,n){return n?function(){var r="function"==typeof t?t.call(n,n):t,i="function"==typeof e?e.call(n,n):e;return r?Xe(r,i):i}:t?e?function(){return Xe("function"==typeof t?t.call(this,this):t,"function"==typeof e?e.call(this,this):e)}:t:e}function Qe(e,t){var n=t?e?e.concat(t):Array.isArray(t)?t:[t]:e;return n?et(n):n}function et(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}function tt(e,t,n,r){var i=Object.create(e||null);return t?E(i,t):i}Ge.data=function(e,t,n){return n?Ye(e,t,n):t&&"function"!=typeof t?e:Ye(e,t)},z.forEach(function(e){Ge[e]=Qe}),U.forEach(function(e){Ge[e+"s"]=tt}),Ge.watch=function(e,t,n,r){if(e===le&&(e=void 0),t===le&&(t=void 0),!t)return Object.create(e||null);if(!e)return t;var i={};for(var o in E(i,e),t){var a=i[o],s=t[o];a&&!Array.isArray(a)&&(a=[a]),i[o]=a?a.concat(s):Array.isArray(s)?s:[s]}return i},Ge.props=Ge.methods=Ge.inject=Ge.computed=function(e,t,n,r){if(!e)return t;var i=Object.create(null);return E(i,e),t&&E(i,t),i},Ge.provide=Ye;var nt=function(e,t){return void 0===t?e:t};function rt(e){for(var t in e.components)it(t)}function it(e){new RegExp("^[a-zA-Z][\\-\\.0-9_"+J.source+"]*$").test(e)||we('Invalid component name: "'+e+'". Component names should conform to valid custom element name in html5 specification.'),(y(e)||V.isReservedTag(e))&&we("Do not use built-in or reserved HTML elements as component id: "+e)}function ot(e,t){var n=e.props;if(n){var r,i,o={};if(Array.isArray(n))for(r=n.length;r--;)"string"==typeof(i=n[r])&&(o[C(i)]={type:null});else if(l(n))for(var a in n)i=n[a],o[C(a)]=l(i)?i:{type:i};else 0;e.props=o}}function at(e,t){var n=e.inject;if(n){var r=e.inject={};if(Array.isArray(n))for(var i=0;i<n.length;i++)r[n[i]]={from:n[i]};else if(l(n))for(var o in n){var a=n[o];r[o]=l(a)?E({from:o},a):{from:a}}else 0}}function st(e){var t=e.directives;if(t)for(var n in t){var r=t[n];"function"==typeof r&&(t[n]={bind:r,update:r})}}function ct(e,t,n){l(t)||we('Invalid value for option "'+e+'": expected an Object, but got '+u(t)+".",n)}function ut(e,t,n){if("function"==typeof t&&(t=t.options),ot(t,n),at(t,n),st(t),!t._base&&(t.extends&&(e=ut(e,t.extends,n)),t.mixins))for(var r=0,i=t.mixins.length;r<i;r++)e=ut(e,t.mixins[r],n);var o,a={};for(o in e)s(o);for(o in t)$(e,o)||s(o);function s(r){var i=Ge[r]||nt;a[r]=i(e[r],t[r],n,r)}return a}function lt(e,t,n,r){if("string"==typeof n){var i=e[t];if($(i,n))return i[n];var o=C(n);if($(i,o))return i[o];var a=A(o);if($(i,a))return i[a];var s=i[n]||i[o]||i[a];return s}}function ft(e,t,n,r){var i=t[e],o=!$(n,e),a=n[e],s=gt(Boolean,i.type);if(s>-1)if(o&&!$(i,"default"))a=!1;else if(""===a||a===O(e)){var c=gt(String,i.type);(c<0||s<c)&&(a=!0)}if(void 0===a){a=pt(r,i,e);var u=He;Be(!0),Je(a),Be(u)}return a}function pt(e,t,n){if($(t,"default")){var r=t.default;return e&&e.$options.propsData&&void 0===e.$options.propsData[n]&&void 0!==e._props[n]?e._props[n]:"function"==typeof r&&"Function"!==mt(t.type)?r.call(e):r}}function dt(e,t,n,r,i){if(e.required&&i)we('Missing required prop: "'+t+'"',r);else if(null!=n||e.required){var o=e.type,a=!o||!0===o,s=[];if(o){Array.isArray(o)||(o=[o]);for(var c=0;c<o.length&&!a;c++){var u=ht(n,o[c]);s.push(u.expectedType||""),a=u.valid}}if(a){var l=e.validator;l&&(l(n)||we('Invalid prop: custom validator check failed for prop "'+t+'".',r))}else we(_t(t,n,s),r)}}var vt=/^(String|Number|Boolean|Function|Symbol)$/;function ht(e,t){var n,r=mt(t);if(vt.test(r)){var i=typeof e;(n=i===r.toLowerCase())||"object"!==i||(n=e instanceof t)}else n="Object"===r?l(e):"Array"===r?Array.isArray(e):e instanceof t;return{valid:n,expectedType:r}}function mt(e){var t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:""}function yt(e,t){return mt(e)===mt(t)}function gt(e,t){if(!Array.isArray(t))return yt(t,e)?0:-1;for(var n=0,r=t.length;n<r;n++)if(yt(t[n],e))return n;return-1}function _t(e,t,n){var r='Invalid prop: type check failed for prop "'+e+'". Expected '+n.map(A).join(", "),i=n[0],o=u(t),a=bt(t,i),s=bt(t,o);return 1===n.length&&$t(i)&&!wt(i,o)&&(r+=" with value "+a),r+=", got "+o+" ",$t(o)&&(r+="with value "+s+"."),r}function bt(e,t){return"String"===t?'"'+e+'"':"Number"===t?""+Number(e):""+e}function $t(e){return["string","number","boolean"].some(function(t){return e.toLowerCase()===t})}function wt(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return e.some(function(e){return"boolean"===e.toLowerCase()})}function xt(e,t,n){Te();try{if(t)for(var r=t;r=r.$parent;){var i=r.$options.errorCaptured;if(i)for(var o=0;o<i.length;o++)try{if(!1===i[o].call(r,e,t,n))return}catch(Xl){At(Xl,r,"errorCaptured hook")}}At(e,t,n)}finally{Ne()}}function Ct(e,t,n,r,i){var o;try{(o=n?e.apply(t,n):e.call(t))&&!o._isVue&&d(o)&&!o._handled&&(o.catch(function(e){return xt(e,r,i+" (Promise/async)")}),o._handled=!0)}catch(Xl){xt(Xl,r,i)}return o}function At(e,t,n){if(V.errorHandler)try{return V.errorHandler.call(null,e,t,n)}catch(Xl){Xl!==e&&kt(Xl,null,"config.errorHandler")}kt(e,t,n)}function kt(e,t,n){if(!Y&&!Q||"undefined"==typeof console)throw e;console.error(e)}var Ot,St,Tt,Nt,jt,Et,Mt,Dt,Lt,It,Ft,Pt,Rt=!1,Ht=[],Bt=!1;function Ut(){Bt=!1;var e=Ht.slice(0);Ht.length=0;for(var t=0;t<e.length;t++)e[t]()}if("undefined"!=typeof Promise&&he(Promise)){var zt=Promise.resolve();Ot=function(){zt.then(Ut),ae&&setTimeout(D)},Rt=!0}else if(ne||"undefined"==typeof MutationObserver||!he(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())Ot="undefined"!=typeof setImmediate&&he(setImmediate)?function(){setImmediate(Ut)}:function(){setTimeout(Ut,0)};else{var Vt=1,Jt=new MutationObserver(Ut),Kt=document.createTextNode(String(Vt));Jt.observe(Kt,{characterData:!0}),Ot=function(){Vt=(Vt+1)%2,Kt.data=String(Vt)},Rt=!0}function qt(e,t){var n;if(Ht.push(function(){if(e)try{e.call(t)}catch(Xl){xt(Xl,t,"nextTick")}else n&&n(t)}),Bt||(Bt=!0,Ot()),!e&&"undefined"!=typeof Promise)return new Promise(function(e){n=e})}var Wt=new me;function Zt(e){Gt(e,Wt),Wt.clear()}function Gt(e,t){var n,r,i=Array.isArray(e);if(!(!i&&!s(e)||Object.isFrozen(e)||e instanceof je)){if(e.__ob__){var o=e.__ob__.dep.id;if(t.has(o))return;t.add(o)}if(i)for(n=e.length;n--;)Gt(e[n],t);else for(n=(r=Object.keys(e)).length;n--;)Gt(e[r[n]],t)}}var Xt=w(function(e){var t="&"===e.charAt(0),n="~"===(e=t?e.slice(1):e).charAt(0),r="!"===(e=n?e.slice(1):e).charAt(0);return{name:e=r?e.slice(1):e,once:n,capture:r,passive:t}});function Yt(e,t){function n(){var e=arguments,r=n.fns;if(!Array.isArray(r))return Ct(r,null,arguments,t,"v-on handler");for(var i=r.slice(),o=0;o<i.length;o++)Ct(i[o],null,e,t,"v-on handler")}return n.fns=e,n}function Qt(e,t,r,o,a,s){var c,u,l,f;for(c in e)u=e[c],l=t[c],f=Xt(c),n(u)||(n(l)?(n(u.fns)&&(u=e[c]=Yt(u,s)),i(f.once)&&(u=e[c]=a(f.name,u,f.capture)),r(f.name,u,f.capture,f.passive,f.params)):u!==l&&(l.fns=u,e[c]=l));for(c in t)n(e[c])&&o((f=Xt(c)).name,t[c],f.capture)}function en(e,t,o){var a;e instanceof je&&(e=e.data.hook||(e.data.hook={}));var s=e[t];function c(){o.apply(this,arguments),_(a.fns,c)}n(s)?a=Yt([c]):r(s.fns)&&i(s.merged)?(a=s).fns.push(c):a=Yt([s,c]),a.merged=!0,e[t]=a}function tn(e,t,i){var o=t.options.props;if(!n(o)){var a={},s=e.attrs,c=e.props;if(r(s)||r(c))for(var u in o){var l=O(u);nn(a,c,u,l,!0)||nn(a,s,u,l,!1)}return a}}function nn(e,t,n,i,o){if(r(t)){if($(t,n))return e[n]=t[n],o||delete t[n],!0;if($(t,i))return e[n]=t[i],o||delete t[i],!0}return!1}function rn(e){for(var t=0;t<e.length;t++)if(Array.isArray(e[t]))return Array.prototype.concat.apply([],e);return e}function on(e){return a(e)?[De(e)]:Array.isArray(e)?sn(e):void 0}function an(e){return r(e)&&r(e.text)&&o(e.isComment)}function sn(e,t){var o,s,c,u,l=[];for(o=0;o<e.length;o++)n(s=e[o])||"boolean"==typeof s||(u=l[c=l.length-1],Array.isArray(s)?s.length>0&&(an((s=sn(s,(t||"")+"_"+o))[0])&&an(u)&&(l[c]=De(u.text+s[0].text),s.shift()),l.push.apply(l,s)):a(s)?an(u)?l[c]=De(u.text+s):""!==s&&l.push(De(s)):an(s)&&an(u)?l[c]=De(u.text+s.text):(i(e._isVList)&&r(s.tag)&&n(s.key)&&r(t)&&(s.key="__vlist"+t+"_"+o+"__"),l.push(s)));return l}function cn(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}function un(e){var t=ln(e.$options.inject,e);t&&(Be(!1),Object.keys(t).forEach(function(n){Ke(e,n,t[n])}),Be(!0))}function ln(e,t){if(e){for(var n=Object.create(null),r=ye?Reflect.ownKeys(e):Object.keys(e),i=0;i<r.length;i++){var o=r[i];if("__ob__"!==o){for(var a=e[o].from,s=t;s;){if(s._provided&&$(s._provided,a)){n[o]=s._provided[a];break}s=s.$parent}if(!s)if("default"in e[o]){var c=e[o].default;n[o]="function"==typeof c?c.call(t):c}else 0}}return n}}function fn(e,t){if(!e||!e.length)return{};for(var n={},r=0,i=e.length;r<i;r++){var o=e[r],a=o.data;if(a&&a.attrs&&a.attrs.slot&&delete a.attrs.slot,o.context!==t&&o.fnContext!==t||!a||null==a.slot)(n.default||(n.default=[])).push(o);else{var s=a.slot,c=n[s]||(n[s]=[]);"template"===o.tag?c.push.apply(c,o.children||[]):c.push(o)}}for(var u in n)n[u].every(pn)&&delete n[u];return n}function pn(e){return e.isComment&&!e.asyncFactory||" "===e.text}function dn(e,n,r){var i,o=Object.keys(n).length>0,a=e?!!e.$stable:!o,s=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(a&&r&&r!==t&&s===r.$key&&!o&&!r.$hasNormal)return r;for(var c in i={},e)e[c]&&"$"!==c[0]&&(i[c]=vn(n,c,e[c]))}else i={};for(var u in n)u in i||(i[u]=hn(n,u));return e&&Object.isExtensible(e)&&(e._normalized=i),q(i,"$stable",a),q(i,"$key",s),q(i,"$hasNormal",o),i}function vn(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({});return(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:on(e))&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function hn(e,t){return function(){return e[t]}}function mn(e,t){var n,i,o,a,c;if(Array.isArray(e)||"string"==typeof e)for(n=new Array(e.length),i=0,o=e.length;i<o;i++)n[i]=t(e[i],i);else if("number"==typeof e)for(n=new Array(e),i=0;i<e;i++)n[i]=t(i+1,i);else if(s(e))if(ye&&e[Symbol.iterator]){n=[];for(var u=e[Symbol.iterator](),l=u.next();!l.done;)n.push(t(l.value,n.length)),l=u.next()}else for(a=Object.keys(e),n=new Array(a.length),i=0,o=a.length;i<o;i++)c=a[i],n[i]=t(e[c],c,i);return r(n)||(n=[]),n._isVList=!0,n}function yn(e,t,n,r){var i,o=this.$scopedSlots[e];o?(n=n||{},r&&(n=E(E({},r),n)),i=o(n)||t):i=this.$slots[e]||t;var a=n&&n.slot;return a?this.$createElement("template",{slot:a},i):i}function gn(e){return lt(this.$options,"filters",e,!0)||I}function _n(e,t){return Array.isArray(e)?-1===e.indexOf(t):e!==t}function bn(e,t,n,r,i){var o=V.keyCodes[t]||n;return i&&r&&!V.keyCodes[t]?_n(i,r):o?_n(o,e):r?O(r)!==t:void 0}function $n(e,t,n,r,i){if(n)if(s(n)){var o;Array.isArray(n)&&(n=M(n));var a=function(a){if("class"===a||"style"===a||g(a))o=e;else{var s=e.attrs&&e.attrs.type;o=r||V.mustUseProp(t,s,a)?e.domProps||(e.domProps={}):e.attrs||(e.attrs={})}var c=C(a),u=O(a);c in o||u in o||(o[a]=n[a],i&&((e.on||(e.on={}))["update:"+a]=function(e){n[a]=e}))};for(var c in n)a(c)}else;return e}function wn(e,t){var n=this._staticTrees||(this._staticTrees=[]),r=n[e];return r&&!t?r:(Cn(r=n[e]=this.$options.staticRenderFns[e].call(this._renderProxy,null,this),"__static__"+e,!1),r)}function xn(e,t,n){return Cn(e,"__once__"+t+(n?"_"+n:""),!0),e}function Cn(e,t,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]&&"string"!=typeof e[r]&&An(e[r],t+"_"+r,n);else An(e,t,n)}function An(e,t,n){e.isStatic=!0,e.key=t,e.isOnce=n}function kn(e,t){if(t)if(l(t)){var n=e.on=e.on?E({},e.on):{};for(var r in t){var i=n[r],o=t[r];n[r]=i?[].concat(i,o):o}}else;return e}function On(e,t,n,r){t=t||{$stable:!n};for(var i=0;i<e.length;i++){var o=e[i];Array.isArray(o)?On(o,t,n):o&&(o.proxy&&(o.fn.proxy=!0),t[o.key]=o.fn)}return r&&(t.$key=r),t}function Sn(e,t){for(var n=0;n<t.length;n+=2){var r=t[n];"string"==typeof r&&r&&(e[t[n]]=t[n+1])}return e}function Tn(e,t){return"string"==typeof e?t+e:e}function Nn(e){e._o=xn,e._n=h,e._s=v,e._l=mn,e._t=yn,e._q=P,e._i=R,e._m=wn,e._f=gn,e._k=bn,e._b=$n,e._v=De,e._e=Me,e._u=On,e._g=kn,e._d=Sn,e._p=Tn}function jn(e,n,r,o,a){var s,c=this,u=a.options;$(o,"_uid")?(s=Object.create(o))._original=o:(s=o,o=o._original);var l=i(u._compiled),f=!l;this.data=e,this.props=n,this.children=r,this.parent=o,this.listeners=e.on||t,this.injections=ln(u.inject,o),this.slots=function(){return c.$slots||dn(e.scopedSlots,c.$slots=fn(r,o)),c.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return dn(e.scopedSlots,this.slots())}}),l&&(this.$options=u,this.$slots=this.slots(),this.$scopedSlots=dn(e.scopedSlots,this.$slots)),u._scopeId?this._c=function(e,t,n,r){var i=Vn(s,e,t,n,r,f);return i&&!Array.isArray(i)&&(i.fnScopeId=u._scopeId,i.fnContext=o),i}:this._c=function(e,t,n,r){return Vn(s,e,t,n,r,f)}}function En(e,n,i,o,a){var s=e.options,c={},u=s.props;if(r(u))for(var l in u)c[l]=ft(l,u,n||t);else r(i.attrs)&&Dn(c,i.attrs),r(i.props)&&Dn(c,i.props);var f=new jn(i,c,a,o,e),p=s.render.call(null,f._c,f);if(p instanceof je)return Mn(p,i,f.parent,s,f);if(Array.isArray(p)){for(var d=on(p)||[],v=new Array(d.length),h=0;h<d.length;h++)v[h]=Mn(d[h],i,f.parent,s,f);return v}}function Mn(e,t,n,r,i){var o=Le(e);return o.fnContext=n,o.fnOptions=r,t.slot&&((o.data||(o.data={})).slot=t.slot),o}function Dn(e,t){for(var n in t)e[C(n)]=t[n]}Nn(jn.prototype);var Ln={init:function(e,t){if(e.componentInstance&&!e.componentInstance._isDestroyed&&e.data.keepAlive){var n=e;Ln.prepatch(n,n)}else{(e.componentInstance=Pn(e,ur)).$mount(t?e.elm:void 0,t)}},prepatch:function(e,t){var n=t.componentOptions;hr(t.componentInstance=e.componentInstance,n.propsData,n.listeners,t,n.children)},insert:function(e){var t=e.context,n=e.componentInstance;n._isMounted||(n._isMounted=!0,_r(n,"mounted")),e.data.keepAlive&&(t._isMounted?Dr(n):yr(n,!0))},destroy:function(e){var t=e.componentInstance;t._isDestroyed||(e.data.keepAlive?gr(t,!0):t.$destroy())}},In=Object.keys(Ln);function Fn(e,t,o,a,c){if(!n(e)){var u=o.$options._base;if(s(e)&&(e=u.extend(e)),"function"==typeof e){var l;if(n(e.cid)&&void 0===(e=er(l=e,u)))return Qn(l,t,o,a,c);t=t||{},ri(e),r(t.model)&&Bn(e.options,t);var f=tn(t,e,c);if(i(e.options.functional))return En(e,f,t,o,a);var p=t.on;if(t.on=t.nativeOn,i(e.options.abstract)){var d=t.slot;t={},d&&(t.slot=d)}Rn(t);var v=e.options.name||c;return new je("vue-component-"+e.cid+(v?"-"+v:""),t,void 0,void 0,void 0,o,{Ctor:e,propsData:f,listeners:p,tag:c,children:a},l)}}}function Pn(e,t){var n={_isComponent:!0,_parentVnode:e,parent:t},i=e.data.inlineTemplate;return r(i)&&(n.render=i.render,n.staticRenderFns=i.staticRenderFns),new e.componentOptions.Ctor(n)}function Rn(e){for(var t=e.hook||(e.hook={}),n=0;n<In.length;n++){var r=In[n],i=t[r],o=Ln[r];i===o||i&&i._merged||(t[r]=i?Hn(o,i):o)}}function Hn(e,t){var n=function(n,r){e(n,r),t(n,r)};return n._merged=!0,n}function Bn(e,t){var n=e.model&&e.model.prop||"value",i=e.model&&e.model.event||"input";(t.attrs||(t.attrs={}))[n]=t.model.value;var o=t.on||(t.on={}),a=o[i],s=t.model.callback;r(a)?(Array.isArray(a)?-1===a.indexOf(s):a!==s)&&(o[i]=[s].concat(a)):o[i]=s}var Un=1,zn=2;function Vn(e,t,n,r,o,s){return(Array.isArray(n)||a(n))&&(o=r,r=n,n=void 0),i(s)&&(o=zn),Jn(e,t,n,r,o)}function Jn(e,t,n,i,o){if(r(n)&&r(n.__ob__))return Me();if(r(n)&&r(n.is)&&(t=n.is),!t)return Me();var a,s,c;(Array.isArray(i)&&"function"==typeof i[0]&&((n=n||{}).scopedSlots={default:i[0]},i.length=0),o===zn?i=on(i):o===Un&&(i=rn(i)),"string"==typeof t)?(s=e.$vnode&&e.$vnode.ns||V.getTagNamespace(t),a=V.isReservedTag(t)?new je(V.parsePlatformTagName(t),n,i,void 0,void 0,e):n&&n.pre||!r(c=lt(e.$options,"components",t))?new je(t,n,i,void 0,void 0,e):Fn(c,n,e,i,t)):a=Fn(t,n,e,i);return Array.isArray(a)?a:r(a)?(r(s)&&Kn(a,s),r(n)&&qn(n),a):Me()}function Kn(e,t,o){if(e.ns=t,"foreignObject"===e.tag&&(t=void 0,o=!0),r(e.children))for(var a=0,s=e.children.length;a<s;a++){var c=e.children[a];r(c.tag)&&(n(c.ns)||i(o)&&"svg"!==c.tag)&&Kn(c,t,o)}}function qn(e){s(e.style)&&Zt(e.style),s(e.class)&&Zt(e.class)}function Wn(e){e._vnode=null,e._staticTrees=null;var n=e.$options,r=e.$vnode=n._parentVnode,i=r&&r.context;e.$slots=fn(n._renderChildren,i),e.$scopedSlots=t,e._c=function(t,n,r,i){return Vn(e,t,n,r,i,!1)},e.$createElement=function(t,n,r,i){return Vn(e,t,n,r,i,!0)};var o=r&&r.data;Ke(e,"$attrs",o&&o.attrs||t,null,!0),Ke(e,"$listeners",n._parentListeners||t,null,!0)}var Zn,Gn=null;function Xn(e){Nn(e.prototype),e.prototype.$nextTick=function(e){return qt(e,this)},e.prototype._render=function(){var e,t=this,n=t.$options,r=n.render,i=n._parentVnode;i&&(t.$scopedSlots=dn(i.data.scopedSlots,t.$slots,t.$scopedSlots)),t.$vnode=i;try{Gn=t,e=r.call(t._renderProxy,t.$createElement)}catch(Xl){xt(Xl,t,"render"),e=t._vnode}finally{Gn=null}return Array.isArray(e)&&1===e.length&&(e=e[0]),e instanceof je||(e=Me()),e.parent=i,e}}function Yn(e,t){return(e.__esModule||ye&&"Module"===e[Symbol.toStringTag])&&(e=e.default),s(e)?t.extend(e):e}function Qn(e,t,n,r,i){var o=Me();return o.asyncFactory=e,o.asyncMeta={data:t,context:n,children:r,tag:i},o}function er(e,t){if(i(e.error)&&r(e.errorComp))return e.errorComp;if(r(e.resolved))return e.resolved;var o=Gn;if(o&&r(e.owners)&&-1===e.owners.indexOf(o)&&e.owners.push(o),i(e.loading)&&r(e.loadingComp))return e.loadingComp;if(o&&!r(e.owners)){var a=e.owners=[o],c=!0,u=null,l=null;o.$on("hook:destroyed",function(){return _(a,o)});var f=function(e){for(var t=0,n=a.length;t<n;t++)a[t].$forceUpdate();e&&(a.length=0,null!==u&&(clearTimeout(u),u=null),null!==l&&(clearTimeout(l),l=null))},p=H(function(n){e.resolved=Yn(n,t),c?a.length=0:f(!0)}),v=H(function(t){r(e.errorComp)&&(e.error=!0,f(!0))}),h=e(p,v);return s(h)&&(d(h)?n(e.resolved)&&h.then(p,v):d(h.component)&&(h.component.then(p,v),r(h.error)&&(e.errorComp=Yn(h.error,t)),r(h.loading)&&(e.loadingComp=Yn(h.loading,t),0===h.delay?e.loading=!0:u=setTimeout(function(){u=null,n(e.resolved)&&n(e.error)&&(e.loading=!0,f(!1))},h.delay||200)),r(h.timeout)&&(l=setTimeout(function(){l=null,n(e.resolved)&&v(null)},h.timeout)))),c=!1,e.loading?e.loadingComp:e.resolved}}function tr(e){return e.isComment&&e.asyncFactory}function nr(e){if(Array.isArray(e))for(var t=0;t<e.length;t++){var n=e[t];if(r(n)&&(r(n.componentOptions)||tr(n)))return n}}function rr(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&sr(e,t)}function ir(e,t){Zn.$on(e,t)}function or(e,t){Zn.$off(e,t)}function ar(e,t){var n=Zn;return function r(){null!==t.apply(null,arguments)&&n.$off(e,r)}}function sr(e,t,n){Zn=e,Qt(t,n||{},ir,or,ar,e),Zn=void 0}function cr(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i<o;i++)r.$on(e[i],n);else(r._events[e]||(r._events[e]=[])).push(n),t.test(e)&&(r._hasHookEvent=!0);return r},e.prototype.$once=function(e,t){var n=this;function r(){n.$off(e,r),t.apply(n,arguments)}return r.fn=t,n.$on(e,r),n},e.prototype.$off=function(e,t){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(Array.isArray(e)){for(var r=0,i=e.length;r<i;r++)n.$off(e[r],t);return n}var o,a=n._events[e];if(!a)return n;if(!t)return n._events[e]=null,n;for(var s=a.length;s--;)if((o=a[s])===t||o.fn===t){a.splice(s,1);break}return n},e.prototype.$emit=function(e){var t=this,n=t._events[e];if(n){n=n.length>1?j(n):n;for(var r=j(arguments,1),i='event handler for "'+e+'"',o=0,a=n.length;o<a;o++)Ct(n[o],t,r,t,i)}return t}}var ur=null,lr=!1;function fr(e){var t=ur;return ur=e,function(){ur=t}}function pr(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}function dr(e){e.prototype._update=function(e,t){var n=this,r=n.$el,i=n._vnode,o=fr(n);n._vnode=e,n.$el=i?n.__patch__(i,e):n.__patch__(n.$el,e,t,!1),o(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},e.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},e.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){_r(e,"beforeDestroy"),e._isBeingDestroyed=!0;var t=e.$parent;!t||t._isBeingDestroyed||e.$options.abstract||_(t.$children,e),e._watcher&&e._watcher.teardown();for(var n=e._watchers.length;n--;)e._watchers[n].teardown();e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),_r(e,"destroyed"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}}function vr(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=Me),_r(e,"beforeMount"),r=function(){e._update(e._render(),n)},new Pr(e,r,D,{before:function(){e._isMounted&&!e._isDestroyed&&_r(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,_r(e,"mounted")),e}function hr(e,n,r,i,o){var a=i.data.scopedSlots,s=e.$scopedSlots,c=!!(a&&!a.$stable||s!==t&&!s.$stable||a&&e.$scopedSlots.$key!==a.$key),u=!!(o||e.$options._renderChildren||c);if(e.$options._parentVnode=i,e.$vnode=i,e._vnode&&(e._vnode.parent=i),e.$options._renderChildren=o,e.$attrs=i.data.attrs||t,e.$listeners=r||t,n&&e.$options.props){Be(!1);for(var l=e._props,f=e.$options._propKeys||[],p=0;p<f.length;p++){var d=f[p],v=e.$options.props;l[d]=ft(d,v,n,e)}Be(!0),e.$options.propsData=n}r=r||t;var h=e.$options._parentListeners;e.$options._parentListeners=r,sr(e,r,h),u&&(e.$slots=fn(o,i.context),e.$forceUpdate())}function mr(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}function yr(e,t){if(t){if(e._directInactive=!1,mr(e))return}else if(e._directInactive)return;if(e._inactive||null===e._inactive){e._inactive=!1;for(var n=0;n<e.$children.length;n++)yr(e.$children[n]);_r(e,"activated")}}function gr(e,t){if(!(t&&(e._directInactive=!0,mr(e))||e._inactive)){e._inactive=!0;for(var n=0;n<e.$children.length;n++)gr(e.$children[n]);_r(e,"deactivated")}}function _r(e,t){Te();var n=e.$options[t],r=t+" hook";if(n)for(var i=0,o=n.length;i<o;i++)Ct(n[i],e,null,e,r);e._hasHookEvent&&e.$emit("hook:"+t),Ne()}var br=100,$r=[],wr=[],xr={},Cr={},Ar=!1,kr=!1,Or=0;function Sr(){Or=$r.length=wr.length=0,xr={},Ar=kr=!1}var Tr=0,Nr=Date.now;if(Y&&!ne){var jr=window.performance;jr&&"function"==typeof jr.now&&Nr()>document.createEvent("Event").timeStamp&&(Nr=function(){return jr.now()})}function Er(){var e,t;for(Tr=Nr(),kr=!0,$r.sort(function(e,t){return e.id-t.id}),Or=0;Or<$r.length;Or++)(e=$r[Or]).before&&e.before(),t=e.id,xr[t]=null,e.run();var n=wr.slice(),r=$r.slice();Sr(),Lr(n),Mr(r),ve&&V.devtools&&ve.emit("flush")}function Mr(e){for(var t=e.length;t--;){var n=e[t],r=n.vm;r._watcher===n&&r._isMounted&&!r._isDestroyed&&_r(r,"updated")}}function Dr(e){e._inactive=!1,wr.push(e)}function Lr(e){for(var t=0;t<e.length;t++)e[t]._inactive=!0,yr(e[t],!0)}function Ir(e){var t=e.id;if(null==xr[t]){if(xr[t]=!0,kr){for(var n=$r.length-1;n>Or&&$r[n].id>e.id;)n--;$r.splice(n+1,0,e)}else $r.push(e);Ar||(Ar=!0,qt(Er))}}var Fr=0,Pr=function(e,t,n,r,i){this.vm=e,i&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++Fr,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new me,this.newDepIds=new me,this.expression="","function"==typeof t?this.getter=t:(this.getter=Z(t),this.getter||(this.getter=D)),this.value=this.lazy?void 0:this.get()};Pr.prototype.get=function(){var e;Te(this);var t=this.vm;try{e=this.getter.call(t,t)}catch(Xl){if(!this.user)throw Xl;xt(Xl,t,'getter for watcher "'+this.expression+'"')}finally{this.deep&&Zt(e),Ne(),this.cleanupDeps()}return e},Pr.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},Pr.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},Pr.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():Ir(this)},Pr.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||s(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(Xl){xt(Xl,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},Pr.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},Pr.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},Pr.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||_(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Rr={enumerable:!0,configurable:!0,get:D,set:D};function Hr(e,t,n){Rr.get=function(){return this[t][n]},Rr.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Rr)}function Br(e){e._watchers=[];var t=e.$options;t.props&&Ur(e,t.props),t.methods&&Gr(e,t.methods),t.data?zr(e):Je(e._data={},!0),t.computed&&Kr(e,t.computed),t.watch&&t.watch!==le&&Xr(e,t.watch)}function Ur(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[],o=!e.$parent;o||Be(!1);var a=function(o){i.push(o);var a=ft(o,t,n,e);Ke(r,o,a),o in e||Hr(e,"_props",o)};for(var s in t)a(s);Be(!0)}function zr(e){var t=e.$options.data;l(t=e._data="function"==typeof t?Vr(t,e):t||{})||(t={});for(var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);i--;){var o=n[i];0,r&&$(r,o)||K(o)||Hr(e,"_data",o)}Je(t,!0)}function Vr(e,t){Te();try{return e.call(t,t)}catch(Xl){return xt(Xl,t,"data()"),{}}finally{Ne()}}var Jr={lazy:!0};function Kr(e,t){var n=e._computedWatchers=Object.create(null),r=de();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;0,r||(n[i]=new Pr(e,a||D,D,Jr)),i in e||qr(e,i,o)}}function qr(e,t,n){var r=!de();"function"==typeof n?(Rr.get=r?Wr(t):Zr(n),Rr.set=D):(Rr.get=n.get?r&&!1!==n.cache?Wr(t):Zr(n.get):D,Rr.set=n.set||D),Object.defineProperty(e,t,Rr)}function Wr(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),Oe.target&&t.depend(),t.value}}function Zr(e){return function(){return e.call(this,this)}}function Gr(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?D:N(t[n],e)}function Xr(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)Yr(e,n,r[i]);else Yr(e,n,r)}}function Yr(e,t,n,r){return l(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=e[n]),e.$watch(t,n,r)}function Qr(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=qe,e.prototype.$delete=We,e.prototype.$watch=function(e,t,n){if(l(t))return Yr(this,e,t,n);(n=n||{}).user=!0;var r=new Pr(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(i){xt(i,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}var ei=0;function ti(e){e.prototype._init=function(e){var t=this;t._uid=ei++,t._isVue=!0,e&&e._isComponent?ni(t,e):t.$options=ut(ri(t.constructor),e||{},t),t._renderProxy=t,t._self=t,pr(t),rr(t),Wn(t),_r(t,"beforeCreate"),un(t),Br(t),cn(t),_r(t,"created"),t.$options.el&&t.$mount(t.$options.el)}}function ni(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}function ri(e){var t=e.options;if(e.super){var n=ri(e.super);if(n!==e.superOptions){e.superOptions=n;var r=ii(e);r&&E(e.extendOptions,r),(t=e.options=ut(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function ii(e){var t,n=e.options,r=e.sealedOptions;for(var i in n)n[i]!==r[i]&&(t||(t={}),t[i]=n[i]);return t}function oi(e){this._init(e)}function ai(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=j(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}function si(e){e.mixin=function(e){return this.options=ut(this.options,e),this}}function ci(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,i=e._Ctor||(e._Ctor={});if(i[r])return i[r];var o=e.name||n.options.name;var a=function(e){this._init(e)};return(a.prototype=Object.create(n.prototype)).constructor=a,a.cid=t++,a.options=ut(n.options,e),a.super=n,a.options.props&&ui(a),a.options.computed&&li(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,U.forEach(function(e){a[e]=n[e]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=e,a.sealedOptions=E({},a.options),i[r]=a,a}}function ui(e){var t=e.options.props;for(var n in t)Hr(e.prototype,"_props",n)}function li(e){var t=e.options.computed;for(var n in t)qr(e.prototype,n,t[n])}function fi(e){U.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&l(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}function pi(e){return e&&(e.Ctor.options.name||e.tag)}function di(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!f(e)&&e.test(t)}function vi(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=pi(a.componentOptions);s&&!t(s)&&hi(n,o,r,i)}}}function hi(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,_(n,t)}ti(oi),Qr(oi),cr(oi),dr(oi),Xn(oi);var mi=[String,RegExp,Array],yi={name:"keep-alive",abstract:!0,props:{include:mi,exclude:mi,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)hi(this.cache,e,this.keys)},mounted:function(){var e=this;this.$watch("include",function(t){vi(e,function(e){return di(t,e)})}),this.$watch("exclude",function(t){vi(e,function(e){return!di(t,e)})})},render:function(){var e=this.$slots.default,t=nr(e),n=t&&t.componentOptions;if(n){var r=pi(n),i=this.include,o=this.exclude;if(i&&(!r||!di(i,r))||o&&r&&di(o,r))return t;var a=this.cache,s=this.keys,c=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;a[c]?(t.componentInstance=a[c].componentInstance,_(s,c),s.push(c)):(a[c]=t,s.push(c),this.max&&s.length>parseInt(this.max)&&hi(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}},gi={KeepAlive:yi};function _i(e){var t={get:function(){return V}};Object.defineProperty(e,"config",t),e.util={warn:we,extend:E,mergeOptions:ut,defineReactive:Ke},e.set=qe,e.delete=We,e.nextTick=qt,e.observable=function(e){return Je(e),e},e.options=Object.create(null),U.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,E(e.options.components,gi),ai(e),si(e),ci(e),fi(e)}_i(oi),Object.defineProperty(oi.prototype,"$isServer",{get:de}),Object.defineProperty(oi.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(oi,"FunctionalRenderContext",{value:jn}),oi.version="2.6.11";var bi=m("style,class"),$i=m("input,textarea,option,select,progress"),wi=function(e,t,n){return"value"===n&&$i(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},xi=m("contenteditable,draggable,spellcheck"),Ci=m("events,caret,typing,plaintext-only"),Ai=function(e,t){return Ni(t)||"false"===t?"false":"contenteditable"===e&&Ci(t)?t:"true"},ki=m("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Oi="http://www.w3.org/1999/xlink",Si=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Ti=function(e){return Si(e)?e.slice(6,e.length):""},Ni=function(e){return null==e||!1===e};function ji(e){for(var t=e.data,n=e,i=e;r(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=Ei(i.data,t));for(;r(n=n.parent);)n&&n.data&&(t=Ei(t,n.data));return Mi(t.staticClass,t.class)}function Ei(e,t){return{staticClass:Di(e.staticClass,t.staticClass),class:r(e.class)?[e.class,t.class]:t.class}}function Mi(e,t){return r(e)||r(t)?Di(e,Li(t)):""}function Di(e,t){return e?t?e+" "+t:e:t||""}function Li(e){return Array.isArray(e)?Ii(e):s(e)?Fi(e):"string"==typeof e?e:""}function Ii(e){for(var t,n="",i=0,o=e.length;i<o;i++)r(t=Li(e[i]))&&""!==t&&(n&&(n+=" "),n+=t);return n}function Fi(e){var t="";for(var n in e)e[n]&&(t&&(t+=" "),t+=n);return t}var Pi={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Ri=m("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),Hi=m("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Bi=function(e){return"pre"===e},Ui=function(e){return Ri(e)||Hi(e)};function zi(e){return Hi(e)?"svg":"math"===e?"math":void 0}var Vi=Object.create(null);function Ji(e){if(!Y)return!0;if(Ui(e))return!1;if(e=e.toLowerCase(),null!=Vi[e])return Vi[e];var t=document.createElement(e);return e.indexOf("-")>-1?Vi[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Vi[e]=/HTMLUnknownElement/.test(t.toString())}var Ki=m("text,number,password,search,email,tel,url");function qi(e){if("string"==typeof e){var t=document.querySelector(e);return t||document.createElement("div")}return e}function Wi(e,t){var n=document.createElement(e);return"select"!==e?n:(t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)}function Zi(e,t){return document.createElementNS(Pi[e],t)}function Gi(e){return document.createTextNode(e)}function Xi(e){return document.createComment(e)}function Yi(e,t,n){e.insertBefore(t,n)}function Qi(e,t){e.removeChild(t)}function eo(e,t){e.appendChild(t)}function to(e){return e.parentNode}function no(e){return e.nextSibling}function ro(e){return e.tagName}function io(e,t){e.textContent=t}function oo(e,t){e.setAttribute(t,"")}var ao=Object.freeze({createElement:Wi,createElementNS:Zi,createTextNode:Gi,createComment:Xi,insertBefore:Yi,removeChild:Qi,appendChild:eo,parentNode:to,nextSibling:no,tagName:ro,setTextContent:io,setStyleScope:oo}),so={create:function(e,t){co(t)},update:function(e,t){e.data.ref!==t.data.ref&&(co(e,!0),co(t))},destroy:function(e){co(e,!0)}};function co(e,t){var n=e.data.ref;if(r(n)){var i=e.context,o=e.componentInstance||e.elm,a=i.$refs;t?Array.isArray(a[n])?_(a[n],o):a[n]===o&&(a[n]=void 0):e.data.refInFor?Array.isArray(a[n])?a[n].indexOf(o)<0&&a[n].push(o):a[n]=[o]:a[n]=o}}var uo=new je("",{},[]),lo=["create","activate","update","remove","destroy"];function fo(e,t){return e.key===t.key&&(e.tag===t.tag&&e.isComment===t.isComment&&r(e.data)===r(t.data)&&po(e,t)||i(e.isAsyncPlaceholder)&&e.asyncFactory===t.asyncFactory&&n(t.asyncFactory.error))}function po(e,t){if("input"!==e.tag)return!0;var n,i=r(n=e.data)&&r(n=n.attrs)&&n.type,o=r(n=t.data)&&r(n=n.attrs)&&n.type;return i===o||Ki(i)&&Ki(o)}function vo(e,t,n){var i,o,a={};for(i=t;i<=n;++i)r(o=e[i].key)&&(a[o]=i);return a}function ho(e){var t,o,s={},c=e.modules,u=e.nodeOps;for(t=0;t<lo.length;++t)for(s[lo[t]]=[],o=0;o<c.length;++o)r(c[o][lo[t]])&&s[lo[t]].push(c[o][lo[t]]);function l(e){var t=u.parentNode(e);r(t)&&u.removeChild(t,e)}function f(e,t,n,o,a,c,l){if(r(e.elm)&&r(c)&&(e=c[l]=Le(e)),e.isRootInsert=!a,!function(e,t,n,o){var a=e.data;if(r(a)){var c=r(e.componentInstance)&&a.keepAlive;if(r(a=a.hook)&&r(a=a.init)&&a(e,!1),r(e.componentInstance))return p(e,t),d(n,e.elm,o),i(c)&&function(e,t,n,i){var o,a=e;for(;a.componentInstance;)if(a=a.componentInstance._vnode,r(o=a.data)&&r(o=o.transition)){for(o=0;o<s.activate.length;++o)s.activate[o](uo,a);t.push(a);break}d(n,e.elm,i)}(e,t,n,o),!0}}(e,t,n,o)){var f=e.data,h=e.children,m=e.tag;r(m)?(e.elm=e.ns?u.createElementNS(e.ns,m):u.createElement(m,e),g(e),v(e,h,t),r(f)&&y(e,t),d(n,e.elm,o)):i(e.isComment)?(e.elm=u.createComment(e.text),d(n,e.elm,o)):(e.elm=u.createTextNode(e.text),d(n,e.elm,o))}}function p(e,t){r(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,h(e)?(y(e,t),g(e)):(co(e),t.push(e))}function d(e,t,n){r(e)&&(r(n)?u.parentNode(n)===e&&u.insertBefore(e,t,n):u.appendChild(e,t))}function v(e,t,n){if(Array.isArray(t)){0;for(var r=0;r<t.length;++r)f(t[r],n,e.elm,null,!0,t,r)}else a(e.text)&&u.appendChild(e.elm,u.createTextNode(String(e.text)))}function h(e){for(;e.componentInstance;)e=e.componentInstance._vnode;return r(e.tag)}function y(e,n){for(var i=0;i<s.create.length;++i)s.create[i](uo,e);r(t=e.data.hook)&&(r(t.create)&&t.create(uo,e),r(t.insert)&&n.push(e))}function g(e){var t;if(r(t=e.fnScopeId))u.setStyleScope(e.elm,t);else for(var n=e;n;)r(t=n.context)&&r(t=t.$options._scopeId)&&u.setStyleScope(e.elm,t),n=n.parent;r(t=ur)&&t!==e.context&&t!==e.fnContext&&r(t=t.$options._scopeId)&&u.setStyleScope(e.elm,t)}function _(e,t,n,r,i,o){for(;r<=i;++r)f(n[r],o,e,t,!1,n,r)}function b(e){var t,n,i=e.data;if(r(i))for(r(t=i.hook)&&r(t=t.destroy)&&t(e),t=0;t<s.destroy.length;++t)s.destroy[t](e);if(r(t=e.children))for(n=0;n<e.children.length;++n)b(e.children[n])}function $(e,t,n){for(;t<=n;++t){var i=e[t];r(i)&&(r(i.tag)?(w(i),b(i)):l(i.elm))}}function w(e,t){if(r(t)||r(e.data)){var n,i=s.remove.length+1;for(r(t)?t.listeners+=i:t=function(e,t){function n(){0==--n.listeners&&l(e)}return n.listeners=t,n}(e.elm,i),r(n=e.componentInstance)&&r(n=n._vnode)&&r(n.data)&&w(n,t),n=0;n<s.remove.length;++n)s.remove[n](e,t);r(n=e.data.hook)&&r(n=n.remove)?n(e,t):t()}else l(e.elm)}function x(e,t,n,i){for(var o=n;o<i;o++){var a=t[o];if(r(a)&&fo(e,a))return o}}function C(e,t,o,a,c,l){if(e!==t){r(t.elm)&&r(a)&&(t=a[c]=Le(t));var p=t.elm=e.elm;if(i(e.isAsyncPlaceholder))r(t.asyncFactory.resolved)?O(e.elm,t,o):t.isAsyncPlaceholder=!0;else if(i(t.isStatic)&&i(e.isStatic)&&t.key===e.key&&(i(t.isCloned)||i(t.isOnce)))t.componentInstance=e.componentInstance;else{var d,v=t.data;r(v)&&r(d=v.hook)&&r(d=d.prepatch)&&d(e,t);var m=e.children,y=t.children;if(r(v)&&h(t)){for(d=0;d<s.update.length;++d)s.update[d](e,t);r(d=v.hook)&&r(d=d.update)&&d(e,t)}n(t.text)?r(m)&&r(y)?m!==y&&function(e,t,i,o,a){var s,c,l,p=0,d=0,v=t.length-1,h=t[0],m=t[v],y=i.length-1,g=i[0],b=i[y],w=!a;for(;p<=v&&d<=y;)n(h)?h=t[++p]:n(m)?m=t[--v]:fo(h,g)?(C(h,g,o,i,d),h=t[++p],g=i[++d]):fo(m,b)?(C(m,b,o,i,y),m=t[--v],b=i[--y]):fo(h,b)?(C(h,b,o,i,y),w&&u.insertBefore(e,h.elm,u.nextSibling(m.elm)),h=t[++p],b=i[--y]):fo(m,g)?(C(m,g,o,i,d),w&&u.insertBefore(e,m.elm,h.elm),m=t[--v],g=i[++d]):(n(s)&&(s=vo(t,p,v)),n(c=r(g.key)?s[g.key]:x(g,t,p,v))?f(g,o,e,h.elm,!1,i,d):fo(l=t[c],g)?(C(l,g,o,i,d),t[c]=void 0,w&&u.insertBefore(e,l.elm,h.elm)):f(g,o,e,h.elm,!1,i,d),g=i[++d]);p>v?_(e,n(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(t,p,v)}(p,m,y,o,l):r(y)?(r(e.text)&&u.setTextContent(p,""),_(p,null,y,0,y.length-1,o)):r(m)?$(m,0,m.length-1):r(e.text)&&u.setTextContent(p,""):e.text!==t.text&&u.setTextContent(p,t.text),r(v)&&r(d=v.hook)&&r(d=d.postpatch)&&d(e,t)}}}function A(e,t,n){if(i(n)&&r(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o<t.length;++o)t[o].data.hook.insert(t[o])}var k=m("attrs,class,staticClass,staticStyle,key");function O(e,t,n,o){var a,s=t.tag,c=t.data,u=t.children;if(o=o||c&&c.pre,t.elm=e,i(t.isComment)&&r(t.asyncFactory))return t.isAsyncPlaceholder=!0,!0;if(r(c)&&(r(a=c.hook)&&r(a=a.init)&&a(t,!0),r(a=t.componentInstance)))return p(t,n),!0;if(r(s)){if(r(u))if(e.hasChildNodes())if(r(a=c)&&r(a=a.domProps)&&r(a=a.innerHTML)){if(a!==e.innerHTML)return!1}else{for(var l=!0,f=e.firstChild,d=0;d<u.length;d++){if(!f||!O(f,u[d],n,o)){l=!1;break}f=f.nextSibling}if(!l||f)return!1}else v(t,u,n);if(r(c)){var h=!1;for(var m in c)if(!k(m)){h=!0,y(t,n);break}!h&&c.class&&Zt(c.class)}}else e.data!==t.text&&(e.data=t.text);return!0}return function(e,t,o,a){if(!n(t)){var c,l=!1,p=[];if(n(e))l=!0,f(t,p);else{var d=r(e.nodeType);if(!d&&fo(e,t))C(e,t,p,null,null,a);else{if(d){if(1===e.nodeType&&e.hasAttribute(B)&&(e.removeAttribute(B),o=!0),i(o)&&O(e,t,p))return A(t,p,!0),e;c=e,e=new je(u.tagName(c).toLowerCase(),{},[],void 0,c)}var v=e.elm,m=u.parentNode(v);if(f(t,p,v._leaveCb?null:m,u.nextSibling(v)),r(t.parent))for(var y=t.parent,g=h(t);y;){for(var _=0;_<s.destroy.length;++_)s.destroy[_](y);if(y.elm=t.elm,g){for(var w=0;w<s.create.length;++w)s.create[w](uo,y);var x=y.data.hook.insert;if(x.merged)for(var k=1;k<x.fns.length;k++)x.fns[k]()}else co(y);y=y.parent}r(m)?$([e],0,0):r(e.tag)&&b(e)}}return A(t,p,l),t.elm}r(e)&&b(e)}}var mo={create:yo,update:yo,destroy:function(e){yo(e,uo)}};function yo(e,t){(e.data.directives||t.data.directives)&&go(e,t)}function go(e,t){var n,r,i,o=e===uo,a=t===uo,s=bo(e.data.directives,e.context),c=bo(t.data.directives,t.context),u=[],l=[];for(n in c)r=s[n],i=c[n],r?(i.oldValue=r.value,i.oldArg=r.arg,wo(i,"update",t,e),i.def&&i.def.componentUpdated&&l.push(i)):(wo(i,"bind",t,e),i.def&&i.def.inserted&&u.push(i));if(u.length){var f=function(){for(var n=0;n<u.length;n++)wo(u[n],"inserted",t,e)};o?en(t,"insert",f):f()}if(l.length&&en(t,"postpatch",function(){for(var n=0;n<l.length;n++)wo(l[n],"componentUpdated",t,e)}),!o)for(n in s)c[n]||wo(s[n],"unbind",e,e,a)}var _o=Object.create(null);function bo(e,t){var n,r,i=Object.create(null);if(!e)return i;for(n=0;n<e.length;n++)(r=e[n]).modifiers||(r.modifiers=_o),i[$o(r)]=r,r.def=lt(t.$options,"directives",r.name,!0);return i}function $o(e){return e.rawName||e.name+"."+Object.keys(e.modifiers||{}).join(".")}function wo(e,t,n,r,i){var o=e.def&&e.def[t];if(o)try{o(n.elm,e,n,r,i)}catch(Xl){xt(Xl,n.context,"directive "+e.name+" "+t+" hook")}}var xo=[so,mo];function Co(e,t){var i=t.componentOptions;if(!(r(i)&&!1===i.Ctor.options.inheritAttrs||n(e.data.attrs)&&n(t.data.attrs))){var o,a,s=t.elm,c=e.data.attrs||{},u=t.data.attrs||{};for(o in r(u.__ob__)&&(u=t.data.attrs=E({},u)),u)a=u[o],c[o]!==a&&Ao(s,o,a);for(o in(ne||ie)&&u.value!==c.value&&Ao(s,"value",u.value),c)n(u[o])&&(Si(o)?s.removeAttributeNS(Oi,Ti(o)):xi(o)||s.removeAttribute(o))}}function Ao(e,t,n){e.tagName.indexOf("-")>-1?ko(e,t,n):ki(t)?Ni(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):xi(t)?e.setAttribute(t,Ai(t,n)):Si(t)?Ni(n)?e.removeAttributeNS(Oi,Ti(t)):e.setAttributeNS(Oi,t,n):ko(e,t,n)}function ko(e,t,n){if(Ni(n))e.removeAttribute(t);else{if(ne&&!re&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var Oo={create:Co,update:Co};function So(e,t){var i=t.elm,o=t.data,a=e.data;if(!(n(o.staticClass)&&n(o.class)&&(n(a)||n(a.staticClass)&&n(a.class)))){var s=ji(t),c=i._transitionClasses;r(c)&&(s=Di(s,Li(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var To,No,jo,Eo,Mo,Do,Lo,Io={create:So,update:So},Fo=/[\w).+\-_$\]]/;function Po(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r<e.length;r++)if(n=t,t=e.charCodeAt(r),a)39===t&&92!==n&&(a=!1);else if(s)34===t&&92!==n&&(s=!1);else if(c)96===t&&92!==n&&(c=!1);else if(u)47===t&&92!==n&&(u=!1);else if(124!==t||124===e.charCodeAt(r+1)||124===e.charCodeAt(r-1)||l||f||p){switch(t){case 34:s=!0;break;case 39:a=!0;break;case 96:c=!0;break;case 40:p++;break;case 41:p--;break;case 91:f++;break;case 93:f--;break;case 123:l++;break;case 125:l--}if(47===t){for(var v=r-1,h=void 0;v>=0&&" "===(h=e.charAt(v));v--);h&&Fo.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r<o.length;r++)i=Ro(i,o[r]);return i}function Ro(e,t){var n=t.indexOf("(");if(n<0)return'_f("'+t+'")('+e+")";var r=t.slice(0,n),i=t.slice(n+1);return'_f("'+r+'")('+e+(")"!==i?","+i:i)}function Ho(e,t){console.error("[Vue compiler]: "+e)}function Bo(e,t){return e?e.map(function(e){return e[t]}).filter(function(e){return e}):[]}function Uo(e,t,n,r,i){(e.props||(e.props=[])).push(Yo({name:t,value:n,dynamic:i},r)),e.plain=!1}function zo(e,t,n,r,i){(i?e.dynamicAttrs||(e.dynamicAttrs=[]):e.attrs||(e.attrs=[])).push(Yo({name:t,value:n,dynamic:i},r)),e.plain=!1}function Vo(e,t,n,r){e.attrsMap[t]=n,e.attrsList.push(Yo({name:t,value:n},r))}function Jo(e,t,n,r,i,o,a,s){(e.directives||(e.directives=[])).push(Yo({name:t,rawName:n,value:r,arg:i,isDynamicArg:o,modifiers:a},s)),e.plain=!1}function Ko(e,t,n){return n?"_p("+t+',"'+e+'")':e+t}function qo(e,n,r,i,o,a,s,c){var u;(i=i||t).right?c?n="("+n+")==='click'?'contextmenu':("+n+")":"click"===n&&(n="contextmenu",delete i.right):i.middle&&(c?n="("+n+")==='click'?'mouseup':("+n+")":"click"===n&&(n="mouseup")),i.capture&&(delete i.capture,n=Ko("!",n,c)),i.once&&(delete i.once,n=Ko("~",n,c)),i.passive&&(delete i.passive,n=Ko("&",n,c)),i.native?(delete i.native,u=e.nativeEvents||(e.nativeEvents={})):u=e.events||(e.events={});var l=Yo({value:r.trim(),dynamic:c},s);i!==t&&(l.modifiers=i);var f=u[n];Array.isArray(f)?o?f.unshift(l):f.push(l):u[n]=f?o?[l,f]:[f,l]:l,e.plain=!1}function Wo(e,t){return e.rawAttrsMap[":"+t]||e.rawAttrsMap["v-bind:"+t]||e.rawAttrsMap[t]}function Zo(e,t,n){var r=Go(e,":"+t)||Go(e,"v-bind:"+t);if(null!=r)return Po(r);if(!1!==n){var i=Go(e,t);if(null!=i)return JSON.stringify(i)}}function Go(e,t,n){var r;if(null!=(r=e.attrsMap[t]))for(var i=e.attrsList,o=0,a=i.length;o<a;o++)if(i[o].name===t){i.splice(o,1);break}return n&&delete e.attrsMap[t],r}function Xo(e,t){for(var n=e.attrsList,r=0,i=n.length;r<i;r++){var o=n[r];if(t.test(o.name))return n.splice(r,1),o}}function Yo(e,t){return t&&(null!=t.start&&(e.start=t.start),null!=t.end&&(e.end=t.end)),e}function Qo(e,t,n){var r=n||{},i=r.number,o="$$v";r.trim&&(o="(typeof $$v === 'string'? $$v.trim(): $$v)"),i&&(o="_n("+o+")");var a=ea(t,o);e.model={value:"("+t+")",expression:JSON.stringify(t),callback:"function ($$v) {"+a+"}"}}function ea(e,t){var n=ta(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function ta(e){if(e=e.trim(),To=e.length,e.indexOf("[")<0||e.lastIndexOf("]")<To-1)return(Eo=e.lastIndexOf("."))>-1?{exp:e.slice(0,Eo),key:'"'+e.slice(Eo+1)+'"'}:{exp:e,key:null};for(No=e,Eo=Mo=Do=0;!ra();)ia(jo=na())?aa(jo):91===jo&&oa(jo);return{exp:e.slice(0,Mo),key:e.slice(Mo+1,Do)}}function na(){return No.charCodeAt(++Eo)}function ra(){return Eo>=To}function ia(e){return 34===e||39===e}function oa(e){var t=1;for(Mo=Eo;!ra();)if(ia(e=na()))aa(e);else if(91===e&&t++,93===e&&t--,0===t){Do=Eo;break}}function aa(e){for(var t=e;!ra()&&(e=na())!==t;);}var sa,ca="__r",ua="__c";function la(e,t,n){Lo=n;var r=t.value,i=t.modifiers,o=e.tag,a=e.attrsMap.type;if(e.component)return Qo(e,r,i),!1;if("select"===o)da(e,r,i);else if("input"===o&&"checkbox"===a)fa(e,r,i);else if("input"===o&&"radio"===a)pa(e,r,i);else if("input"===o||"textarea"===o)va(e,r,i);else{if(!V.isReservedTag(o))return Qo(e,r,i),!1}return!0}function fa(e,t,n){var r=n&&n.number,i=Zo(e,"value")||"null",o=Zo(e,"true-value")||"true",a=Zo(e,"false-value")||"false";Uo(e,"checked","Array.isArray("+t+")?_i("+t+","+i+")>-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),qo(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+ea(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+ea(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+ea(t,"$$c")+"}",null,!0)}function pa(e,t,n){var r=n&&n.number,i=Zo(e,"value")||"null";Uo(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),qo(e,"change",ea(t,i),null,!0)}function da(e,t,n){var r="var $$selectedVal = "+('Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(n&&n.number?"_n(val)":"val")+"})")+";";qo(e,"change",r=r+" "+ea(t,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),null,!0)}function va(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?ca:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=ea(t,l);c&&(f="if($event.target.composing)return;"+f),Uo(e,"value","("+t+")"),qo(e,u,f,null,!0),(s||a)&&qo(e,"blur","$forceUpdate()")}function ha(e){if(r(e[ca])){var t=ne?"change":"input";e[t]=[].concat(e[ca],e[t]||[]),delete e[ca]}r(e[ua])&&(e.change=[].concat(e[ua],e.change||[]),delete e[ua])}function ma(e,t,n){var r=sa;return function i(){null!==t.apply(null,arguments)&&_a(e,i,n,r)}}var ya=Rt&&!(ue&&Number(ue[1])<=53);function ga(e,t,n,r){if(ya){var i=Tr,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}sa.addEventListener(e,t,fe?{capture:n,passive:r}:n)}function _a(e,t,n,r){(r||sa).removeEventListener(e,t._wrapper||t,n)}function ba(e,t){if(!n(e.data.on)||!n(t.data.on)){var r=t.data.on||{},i=e.data.on||{};sa=t.elm,ha(r),Qt(r,i,ga,_a,ma,t.context),sa=void 0}}var $a,wa={create:ba,update:ba};function xa(e,t){if(!n(e.data.domProps)||!n(t.data.domProps)){var i,o,a=t.elm,s=e.data.domProps||{},c=t.data.domProps||{};for(i in r(c.__ob__)&&(c=t.data.domProps=E({},c)),s)i in c||(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(t.children&&(t.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i&&"PROGRESS"!==a.tagName){a._value=o;var u=n(o)?"":String(o);Ca(a,u)&&(a.value=u)}else if("innerHTML"===i&&Hi(a.tagName)&&n(a.innerHTML)){($a=$a||document.createElement("div")).innerHTML="<svg>"+o+"</svg>";for(var l=$a.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else if(o!==s[i])try{a[i]=o}catch(Xl){}}}}function Ca(e,t){return!e.composing&&("OPTION"===e.tagName||Aa(e,t)||ka(e,t))}function Aa(e,t){var n=!0;try{n=document.activeElement!==e}catch(Xl){}return n&&e.value!==t}function ka(e,t){var n=e.value,i=e._vModifiers;if(r(i)){if(i.number)return h(n)!==h(t);if(i.trim)return n.trim()!==t.trim()}return n!==t}var Oa={create:xa,update:xa},Sa=w(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function Ta(e){var t=Na(e.style);return e.staticStyle?E(e.staticStyle,t):t}function Na(e){return Array.isArray(e)?M(e):"string"==typeof e?Sa(e):e}function ja(e,t){var n,r={};if(t)for(var i=e;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=Ta(i.data))&&E(r,n);(n=Ta(e.data))&&E(r,n);for(var o=e;o=o.parent;)o.data&&(n=Ta(o.data))&&E(r,n);return r}var Ea,Ma=/^--/,Da=/\s*!important$/,La=function(e,t,n){if(Ma.test(t))e.style.setProperty(t,n);else if(Da.test(n))e.style.setProperty(O(t),n.replace(Da,""),"important");else{var r=Fa(t);if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++)e.style[r]=n[i];else e.style[r]=n}},Ia=["Webkit","Moz","ms"],Fa=w(function(e){if(Ea=Ea||document.createElement("div").style,"filter"!==(e=C(e))&&e in Ea)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<Ia.length;n++){var r=Ia[n]+t;if(r in Ea)return r}});function Pa(e,t){var i=t.data,o=e.data;if(!(n(i.staticStyle)&&n(i.style)&&n(o.staticStyle)&&n(o.style))){var a,s,c=t.elm,u=o.staticStyle,l=o.normalizedStyle||o.style||{},f=u||l,p=Na(t.data.style)||{};t.data.normalizedStyle=r(p.__ob__)?E({},p):p;var d=ja(t,!0);for(s in f)n(d[s])&&La(c,s,"");for(s in d)(a=d[s])!==f[s]&&La(c,s,null==a?"":a)}}var Ra={create:Pa,update:Pa},Ha=/\s+/;function Ba(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(Ha).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Ua(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(Ha).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function za(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&E(t,Va(e.name||"v")),E(t,e),t}return"string"==typeof e?Va(e):void 0}}var Va=w(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),Ja=Y&&!re,Ka="transition",qa="animation",Wa="transition",Za="transitionend",Ga="animation",Xa="animationend";Ja&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Wa="WebkitTransition",Za="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Ga="WebkitAnimation",Xa="webkitAnimationEnd"));var Ya=Y?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Qa(e){Ya(function(){Ya(e)})}function es(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),Ba(e,t))}function ts(e,t){e._transitionClasses&&_(e._transitionClasses,t),Ua(e,t)}function ns(e,t,n){var r=is(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===Ka?Za:Xa,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c<a&&u()},o+1),e.addEventListener(s,l)}var rs=/\b(transform|all)(,|$)/;function is(e,t){var n,r=window.getComputedStyle(e),i=(r[Wa+"Delay"]||"").split(", "),o=(r[Wa+"Duration"]||"").split(", "),a=os(i,o),s=(r[Ga+"Delay"]||"").split(", "),c=(r[Ga+"Duration"]||"").split(", "),u=os(s,c),l=0,f=0;return t===Ka?a>0&&(n=Ka,l=a,f=o.length):t===qa?u>0&&(n=qa,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?Ka:qa:null)?n===Ka?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===Ka&&rs.test(r[Wa+"Property"])}}function os(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max.apply(null,t.map(function(t,n){return as(t)+as(e[n])}))}function as(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}function ss(e,t){var i=e.elm;r(i._leaveCb)&&(i._leaveCb.cancelled=!0,i._leaveCb());var o=za(e.data.transition);if(!n(o)&&!r(i._enterCb)&&1===i.nodeType){for(var a=o.css,c=o.type,u=o.enterClass,l=o.enterToClass,f=o.enterActiveClass,p=o.appearClass,d=o.appearToClass,v=o.appearActiveClass,m=o.beforeEnter,y=o.enter,g=o.afterEnter,_=o.enterCancelled,b=o.beforeAppear,$=o.appear,w=o.afterAppear,x=o.appearCancelled,C=o.duration,A=ur,k=ur.$vnode;k&&k.parent;)A=k.context,k=k.parent;var O=!A._isMounted||!e.isRootInsert;if(!O||$||""===$){var S=O&&p?p:u,T=O&&v?v:f,N=O&&d?d:l,j=O&&b||m,E=O&&"function"==typeof $?$:y,M=O&&w||g,D=O&&x||_,L=h(s(C)?C.enter:C);0;var I=!1!==a&&!re,F=fs(E),P=i._enterCb=H(function(){I&&(ts(i,N),ts(i,T)),P.cancelled?(I&&ts(i,S),D&&D(i)):M&&M(i),i._enterCb=null});e.data.show||en(e,"insert",function(){var t=i.parentNode,n=t&&t._pending&&t._pending[e.key];n&&n.tag===e.tag&&n.elm._leaveCb&&n.elm._leaveCb(),E&&E(i,P)}),j&&j(i),I&&(es(i,S),es(i,T),Qa(function(){ts(i,S),P.cancelled||(es(i,N),F||(ls(L)?setTimeout(P,L):ns(i,c,P)))})),e.data.show&&(t&&t(),E&&E(i,P)),I||F||P()}}}function cs(e,t){var i=e.elm;r(i._enterCb)&&(i._enterCb.cancelled=!0,i._enterCb());var o=za(e.data.transition);if(n(o)||1!==i.nodeType)return t();if(!r(i._leaveCb)){var a=o.css,c=o.type,u=o.leaveClass,l=o.leaveToClass,f=o.leaveActiveClass,p=o.beforeLeave,d=o.leave,v=o.afterLeave,m=o.leaveCancelled,y=o.delayLeave,g=o.duration,_=!1!==a&&!re,b=fs(d),$=h(s(g)?g.leave:g);0;var w=i._leaveCb=H(function(){i.parentNode&&i.parentNode._pending&&(i.parentNode._pending[e.key]=null),_&&(ts(i,l),ts(i,f)),w.cancelled?(_&&ts(i,u),m&&m(i)):(t(),v&&v(i)),i._leaveCb=null});y?y(x):x()}function x(){w.cancelled||(!e.data.show&&i.parentNode&&((i.parentNode._pending||(i.parentNode._pending={}))[e.key]=e),p&&p(i),_&&(es(i,u),es(i,f),Qa(function(){ts(i,u),w.cancelled||(es(i,l),b||(ls($)?setTimeout(w,$):ns(i,c,w)))})),d&&d(i,w),_||b||w())}}function us(e,t,n){"number"!=typeof e?we("<transition> explicit "+t+" duration is not a valid number - got "+JSON.stringify(e)+".",n.context):isNaN(e)&&we("<transition> explicit "+t+" duration is NaN - the duration expression might be incorrect.",n.context)}function ls(e){return"number"==typeof e&&!isNaN(e)}function fs(e){if(n(e))return!1;var t=e.fns;return r(t)?fs(Array.isArray(t)?t[0]:t):(e._length||e.length)>1}function ps(e,t){!0!==t.data.show&&ss(t)}var ds=Y?{create:ps,activate:ps,remove:function(e,t){!0!==e.data.show?cs(e,t):t()}}:{},vs=[Oo,Io,wa,Oa,Ra,ds],hs=vs.concat(xo),ms=ho({nodeOps:ao,modules:hs});re&&document.addEventListener("selectionchange",function(){var e=document.activeElement;e&&e.vmodel&&Cs(e,"input")});var ys={inserted:function(e,t,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?en(n,"postpatch",function(){ys.componentUpdated(e,t,n)}):gs(e,t,n.context),e._vOptions=[].map.call(e.options,$s)):("textarea"===n.tag||Ki(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener("compositionstart",ws),e.addEventListener("compositionend",xs),e.addEventListener("change",xs),re&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){gs(e,t,n.context);var r=e._vOptions,i=e._vOptions=[].map.call(e.options,$s);if(i.some(function(e,t){return!P(e,r[t])}))(e.multiple?t.value.some(function(e){return bs(e,i)}):t.value!==t.oldValue&&bs(t.value,i))&&Cs(e,"change")}}};function gs(e,t,n){_s(e,t,n),(ne||ie)&&setTimeout(function(){_s(e,t,n)},0)}function _s(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=e.options.length;s<c;s++)if(a=e.options[s],i)o=R(r,$s(a))>-1,a.selected!==o&&(a.selected=o);else if(P($s(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function bs(e,t){return t.every(function(t){return!P(t,e)})}function $s(e){return"_value"in e?e._value:e.value}function ws(e){e.target.composing=!0}function xs(e){e.target.composing&&(e.target.composing=!1,Cs(e.target,"input"))}function Cs(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function As(e){return!e.componentInstance||e.data&&e.data.transition?e:As(e.componentInstance._vnode)}var ks={bind:function(e,t,n){var r=t.value,i=(n=As(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,ss(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=As(n)).data&&n.data.transition?(n.data.show=!0,r?ss(n,function(){e.style.display=e.__vOriginalDisplay}):cs(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}},Os={model:ys,show:ks},Ss={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Ts(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Ts(nr(t.children)):e}function Ns(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[C(o)]=i[o];return t}function js(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}function Es(e){for(;e=e.parent;)if(e.data.transition)return!0}function Ms(e,t){return t.key===e.key&&t.tag===e.tag}var Ds=function(e){return e.tag||tr(e)},Ls=function(e){return"show"===e.name},Is={name:"transition",props:Ss,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(Ds)).length){0;var r=this.mode;0;var i=n[0];if(Es(this.$vnode))return i;var o=Ts(i);if(!o)return i;if(this._leaving)return js(e,i);var s="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?s+"comment":s+o.tag:a(o.key)?0===String(o.key).indexOf(s)?o.key:s+o.key:o.key;var c=(o.data||(o.data={})).transition=Ns(this),u=this._vnode,l=Ts(u);if(o.data.directives&&o.data.directives.some(Ls)&&(o.data.show=!0),l&&l.data&&!Ms(o,l)&&!tr(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=E({},c);if("out-in"===r)return this._leaving=!0,en(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),js(e,i);if("in-out"===r){if(tr(o))return u;var p,d=function(){p()};en(c,"afterEnter",d),en(c,"enterCancelled",d),en(f,"delayLeave",function(e){p=e})}}return i}}},Fs=E({tag:String,moveClass:String},Ss);delete Fs.mode;var Ps={props:Fs,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=fr(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Ns(this),s=0;s<i.length;s++){var c=i[s];if(c.tag)if(null!=c.key&&0!==String(c.key).indexOf("__vlist"))o.push(c),n[c.key]=c,(c.data||(c.data={})).transition=a;else;}if(r){for(var u=[],l=[],f=0;f<r.length;f++){var p=r[f];p.data.transition=a,p.data.pos=p.elm.getBoundingClientRect(),n[p.key]?u.push(p):l.push(p)}this.kept=e(t,null,u),this.removed=l}return e(t,null,o)},updated:function(){var e=this.prevChildren,t=this.moveClass||(this.name||"v")+"-move";e.length&&this.hasMove(e[0].elm,t)&&(e.forEach(Rs),e.forEach(Hs),e.forEach(Bs),this._reflow=document.body.offsetHeight,e.forEach(function(e){if(e.data.moved){var n=e.elm,r=n.style;es(n,t),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(Za,n._moveCb=function e(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(Za,e),n._moveCb=null,ts(n,t))})}}))},methods:{hasMove:function(e,t){if(!Ja)return!1;if(this._hasMove)return this._hasMove;var n=e.cloneNode();e._transitionClasses&&e._transitionClasses.forEach(function(e){Ua(n,e)}),Ba(n,t),n.style.display="none",this.$el.appendChild(n);var r=is(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}};function Rs(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function Hs(e){e.data.newPos=e.elm.getBoundingClientRect()}function Bs(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}var Us={Transition:Is,TransitionGroup:Ps};oi.config.mustUseProp=wi,oi.config.isReservedTag=Ui,oi.config.isReservedAttr=bi,oi.config.getTagNamespace=zi,oi.config.isUnknownElement=Ji,E(oi.options.directives,Os),E(oi.options.components,Us),oi.prototype.__patch__=Y?ms:D,oi.prototype.$mount=function(e,t){return vr(this,e=e&&Y?qi(e):void 0,t)},Y&&setTimeout(function(){V.devtools&&ve&&ve.emit("init",oi)},0);var zs=/\{\{((?:.|\r?\n)+?)\}\}/g,Vs=/[-.*+?^${}()|[\]\/\\]/g,Js=w(function(e){var t=e[0].replace(Vs,"\\$&"),n=e[1].replace(Vs,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});function Ks(e,t){var n=t?Js(t):zs;if(n.test(e)){for(var r,i,o,a=[],s=[],c=n.lastIndex=0;r=n.exec(e);){(i=r.index)>c&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=Po(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c<e.length&&(s.push(o=e.slice(c)),a.push(JSON.stringify(o))),{expression:a.join("+"),tokens:s}}}function qs(e,t){t.warn;var n=Go(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Zo(e,"class",!1);r&&(e.classBinding=r)}function Ws(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}var Zs={staticKeys:["staticClass"],transformNode:qs,genData:Ws};function Gs(e,t){t.warn;var n=Go(e,"style");n&&(e.staticStyle=JSON.stringify(Sa(n)));var r=Zo(e,"style",!1);r&&(e.styleBinding=r)}function Xs(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}var Ys,Qs={staticKeys:["staticStyle"],transformNode:Gs,genData:Xs},ec={decode:function(e){return(Ys=Ys||document.createElement("div")).innerHTML=e,Ys.textContent}},tc=m("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),nc=m("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),rc=m("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),ic=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,oc=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ac="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+J.source+"]*",sc="((?:"+ac+"\\:)?"+ac+")",cc=new RegExp("^<"+sc),uc=/^\s*(\/?)>/,lc=new RegExp("^<\\/"+sc+"[^>]*>"),fc=/^<!DOCTYPE [^>]+>/i,pc=/^<!\--/,dc=/^<!\[/,vc=m("script,style,textarea",!0),hc={},mc={"&lt;":"<","&gt;":">","&quot;":'"',"&amp;":"&","&#10;":"\n","&#9;":"\t","&#39;":"'"},yc=/&(?:lt|gt|quot|amp|#39);/g,gc=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,_c=m("pre,textarea",!0),bc=function(e,t){return e&&_c(e)&&"\n"===t[0]};function $c(e,t){var n=t?gc:yc;return e.replace(n,function(e){return mc[e]})}function wc(e,t){for(var n,r,i=[],o=t.expectHTML,a=t.isUnaryTag||L,s=t.canBeLeftOpenTag||L,c=0;e;){if(n=e,r&&vc(r)){var u=0,l=r.toLowerCase(),f=hc[l]||(hc[l]=new RegExp("([\\s\\S]*?)(</"+l+"[^>]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,vc(l)||"noscript"===l||(n=n.replace(/<!\--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),bc(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,k(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(pc.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v),c,c+v+3),x(v+3);continue}}if(dc.test(e)){var h=e.indexOf("]>");if(h>=0){x(h+2);continue}}var m=e.match(fc);if(m){x(m[0].length);continue}var y=e.match(lc);if(y){var g=c;x(y[0].length),k(y[1],g,c);continue}var _=C();if(_){A(_),bc(_.tagName,e)&&x(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(lc.test($)||cc.test($)||pc.test($)||dc.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d)}d<0&&(b=e),b&&x(b.length),t.chars&&b&&t.chars(b,c-b.length,c)}if(e===n){t.chars&&t.chars(e);break}}function x(t){c+=t,e=e.substring(t)}function C(){var t=e.match(cc);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(x(t[0].length);!(n=e.match(uc))&&(r=e.match(oc)||e.match(ic));)r.start=c,x(r[0].length),r.end=c,i.attrs.push(r);if(n)return i.unarySlash=n[1],x(n[0].length),i.end=c,i}}function A(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&rc(n)&&k(r),s(n)&&r===n&&k(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p<l;p++){var d=e.attrs[p],v=d[3]||d[4]||d[5]||"",h="a"===n&&"href"===d[1]?t.shouldDecodeNewlinesForHref:t.shouldDecodeNewlines;f[p]={name:d[1],value:$c(v,h)}}u||(i.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:f,start:e.start,end:e.end}),r=n),t.start&&t.start(n,f,u,e.start,e.end)}function k(e,n,o){var a,s;if(null==n&&(n=c),null==o&&(o=c),e)for(s=e.toLowerCase(),a=i.length-1;a>=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}k()}var xc,Cc,Ac,kc,Oc,Sc,Tc,Nc,jc,Ec=/^@|^v-on:/,Mc=/^v-|^@|^:|^#/,Dc=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Lc=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Ic=/^\(|\)$/g,Fc=/^\[.*\]$/,Pc=/:(.*)$/,Rc=/^:|^\.|^v-bind:/,Hc=/\.[^.\]]+(?=[^\]]*$)/g,Bc=/^v-slot(:|$)|^#/,Uc=/[\r\n]/,zc=/\s+/g,Vc=/[\s"'<>\/=]/,Jc=w(ec.decode),Kc="_empty_";function qc(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:vu(t),rawAttrsMap:{},parent:n,children:[]}}function Wc(e,t){xc=t.warn||Ho,Sc=t.isPreTag||L,Tc=t.mustUseProp||L,Nc=t.getTagNamespace||L;var n=t.isReservedTag||L;jc=function(e){return!!e.component||!n(e.tag)},Ac=Bo(t.modules,"transformNode"),kc=Bo(t.modules,"preTransformNode"),Oc=Bo(t.modules,"postTransformNode"),Cc=t.delimiters;var r,i,o=[],a=!1!==t.preserveWhitespace,s=t.whitespace,c=!1,u=!1;function l(e){if(f(e),c||e.processed||(e=Xc(e,t)),o.length||e===r||r.if&&(e.elseif||e.else)&&ou(r,{exp:e.elseif,block:e}),i&&!e.forbidden)if(e.elseif||e.else)ru(e,i);else{if(e.slotScope){var n=e.slotTarget||'"default"';(i.scopedSlots||(i.scopedSlots={}))[n]=e}i.children.push(e),e.parent=i}e.children=e.children.filter(function(e){return!e.slotScope}),f(e),e.pre&&(c=!1),Sc(e.tag)&&(u=!1);for(var a=0;a<Oc.length;a++)Oc[a](e,t)}function f(e){if(!u)for(var t;(t=e.children[e.children.length-1])&&3===t.type&&" "===t.text;)e.children.pop()}return wc(e,{warn:xc,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,n,a,s,f){var p=i&&i.ns||Nc(e);ne&&"svg"===p&&(n=_u(n));var d=qc(e,n,i);p&&(d.ns=p),mu(d)&&!de()&&(d.forbidden=!0);for(var v=0;v<kc.length;v++)d=kc[v](d,t)||d;c||(Zc(d),d.pre&&(c=!0)),Sc(d.tag)&&(u=!0),c?Gc(d):d.processed||(eu(d),nu(d),au(d)),r||(r=d),a?l(d):(i=d,o.push(d))},end:function(e,t,n){var r=o[o.length-1];o.length-=1,i=o[o.length-1],l(r)},chars:function(e,t,n){if(i&&(!ne||"textarea"!==i.tag||i.attrsMap.placeholder!==e)){var r,o,l=i.children;if(e=u||e.trim()?hu(i)?e:Jc(e):l.length?s?"condense"===s&&Uc.test(e)?"":" ":a?" ":"":"")u||"condense"!==s||(e=e.replace(zc," ")),!c&&" "!==e&&(r=Ks(e,Cc))?o={type:2,expression:r.expression,tokens:r.tokens,text:e}:" "===e&&l.length&&" "===l[l.length-1].text||(o={type:3,text:e}),o&&l.push(o)}},comment:function(e,t,n){if(i){var r={type:3,text:e,isComment:!0};0,i.children.push(r)}}}),r}function Zc(e){null!=Go(e,"v-pre")&&(e.pre=!0)}function Gc(e){var t=e.attrsList,n=t.length;if(n)for(var r=e.attrs=new Array(n),i=0;i<n;i++)r[i]={name:t[i].name,value:JSON.stringify(t[i].value)},null!=t[i].start&&(r[i].start=t[i].start,r[i].end=t[i].end);else e.pre||(e.plain=!0)}function Xc(e,t){Yc(e),e.plain=!e.key&&!e.scopedSlots&&!e.attrsList.length,Qc(e),su(e),uu(e),lu(e);for(var n=0;n<Ac.length;n++)e=Ac[n](e,t)||e;return fu(e),e}function Yc(e){var t=Zo(e,"key");t&&(e.key=t)}function Qc(e){var t=Zo(e,"ref");t&&(e.ref=t,e.refInFor=pu(e))}function eu(e){var t;if(t=Go(e,"v-for")){var n=tu(t);n&&E(e,n)}}function tu(e){var t=e.match(Dc);if(t){var n={};n.for=t[2].trim();var r=t[1].trim().replace(Ic,""),i=r.match(Lc);return i?(n.alias=r.replace(Lc,"").trim(),n.iterator1=i[1].trim(),i[2]&&(n.iterator2=i[2].trim())):n.alias=r,n}}function nu(e){var t=Go(e,"v-if");if(t)e.if=t,ou(e,{exp:t,block:e});else{null!=Go(e,"v-else")&&(e.else=!0);var n=Go(e,"v-else-if");n&&(e.elseif=n)}}function ru(e,t){var n=iu(t.children);n&&n.if&&ou(n,{exp:e.elseif,block:e})}function iu(e){for(var t=e.length;t--;){if(1===e[t].type)return e[t];e.pop()}}function ou(e,t){e.ifConditions||(e.ifConditions=[]),e.ifConditions.push(t)}function au(e){null!=Go(e,"v-once")&&(e.once=!0)}function su(e){var t;"template"===e.tag?(t=Go(e,"scope"),e.slotScope=t||Go(e,"slot-scope")):(t=Go(e,"slot-scope"))&&(e.slotScope=t);var n=Zo(e,"slot");if(n&&(e.slotTarget='""'===n?'"default"':n,e.slotTargetDynamic=!(!e.attrsMap[":slot"]&&!e.attrsMap["v-bind:slot"]),"template"===e.tag||e.slotScope||zo(e,"slot",n,Wo(e,"slot"))),"template"===e.tag){var r=Xo(e,Bc);if(r){0;var i=cu(r),o=i.name,a=i.dynamic;e.slotTarget=o,e.slotTargetDynamic=a,e.slotScope=r.value||Kc}}else{var s=Xo(e,Bc);if(s){0;var c=e.scopedSlots||(e.scopedSlots={}),u=cu(s),l=u.name,f=u.dynamic,p=c[l]=qc("template",[],e);p.slotTarget=l,p.slotTargetDynamic=f,p.children=e.children.filter(function(e){if(!e.slotScope)return e.parent=p,!0}),p.slotScope=s.value||Kc,e.children=[],e.plain=!1}}}function cu(e){var t=e.name.replace(Bc,"");return t||"#"!==e.name[0]&&(t="default"),Fc.test(t)?{name:t.slice(1,-1),dynamic:!0}:{name:'"'+t+'"',dynamic:!1}}function uu(e){"slot"===e.tag&&(e.slotName=Zo(e,"name"))}function lu(e){var t;(t=Zo(e,"is"))&&(e.component=t),null!=Go(e,"inline-template")&&(e.inlineTemplate=!0)}function fu(e){var t,n,r,i,o,a,s,c,u=e.attrsList;for(t=0,n=u.length;t<n;t++){if(r=i=u[t].name,o=u[t].value,Mc.test(r))if(e.hasBindings=!0,(a=du(r.replace(Mc,"")))&&(r=r.replace(Hc,"")),Rc.test(r))r=r.replace(Rc,""),o=Po(o),(c=Fc.test(r))&&(r=r.slice(1,-1)),a&&(a.prop&&!c&&"innerHtml"===(r=C(r))&&(r="innerHTML"),a.camel&&!c&&(r=C(r)),a.sync&&(s=ea(o,"$event"),c?qo(e,'"update:"+('+r+")",s,null,!1,xc,u[t],!0):(qo(e,"update:"+C(r),s,null,!1,xc,u[t]),O(r)!==C(r)&&qo(e,"update:"+O(r),s,null,!1,xc,u[t])))),a&&a.prop||!e.component&&Tc(e.tag,e.attrsMap.type,r)?Uo(e,r,o,u[t],c):zo(e,r,o,u[t],c);else if(Ec.test(r))r=r.replace(Ec,""),(c=Fc.test(r))&&(r=r.slice(1,-1)),qo(e,r,o,a,!1,xc,u[t],c);else{var l=(r=r.replace(Mc,"")).match(Pc),f=l&&l[1];c=!1,f&&(r=r.slice(0,-(f.length+1)),Fc.test(f)&&(f=f.slice(1,-1),c=!0)),Jo(e,r,i,o,f,c,a,u[t])}else zo(e,r,JSON.stringify(o),u[t]),!e.component&&"muted"===r&&Tc(e.tag,e.attrsMap.type,r)&&Uo(e,r,"true",u[t])}}function pu(e){for(var t=e;t;){if(void 0!==t.for)return!0;t=t.parent}return!1}function du(e){var t=e.match(Hc);if(t){var n={};return t.forEach(function(e){n[e.slice(1)]=!0}),n}}function vu(e){for(var t={},n=0,r=e.length;n<r;n++)t[e[n].name]=e[n].value;return t}function hu(e){return"script"===e.tag||"style"===e.tag}function mu(e){return"style"===e.tag||"script"===e.tag&&(!e.attrsMap.type||"text/javascript"===e.attrsMap.type)}var yu=/^xmlns:NS\d+/,gu=/^NS\d+:/;function _u(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];yu.test(r.name)||(r.name=r.name.replace(gu,""),t.push(r))}return t}function bu(e,t){for(var n=e;n;)n.for&&n.alias===t&&xc("<"+e.tag+' v-model="'+t+'">: You are binding v-model directly to a v-for iteration alias. This will not be able to modify the v-for source array because writing to the alias is like modifying a function local variable. Consider using an array of objects and use v-model on an object property instead.',e.rawAttrsMap["v-model"]),n=n.parent}function $u(e,t){if("input"===e.tag){var n,r=e.attrsMap;if(!r["v-model"])return;if((r[":type"]||r["v-bind:type"])&&(n=Zo(e,"type")),r.type||n||!r["v-bind"]||(n="("+r["v-bind"]+").type"),n){var i=Go(e,"v-if",!0),o=i?"&&("+i+")":"",a=null!=Go(e,"v-else",!0),s=Go(e,"v-else-if",!0),c=wu(e);eu(c),Vo(c,"type","checkbox"),Xc(c,t),c.processed=!0,c.if="("+n+")==='checkbox'"+o,ou(c,{exp:c.if,block:c});var u=wu(e);Go(u,"v-for",!0),Vo(u,"type","radio"),Xc(u,t),ou(c,{exp:"("+n+")==='radio'"+o,block:u});var l=wu(e);return Go(l,"v-for",!0),Vo(l,":type",n),Xc(l,t),ou(c,{exp:i,block:l}),a?c.else=!0:s&&(c.elseif=s),c}}}function wu(e){return qc(e.tag,e.attrsList.slice(),e.parent)}var xu={preTransformNode:$u},Cu=[Zs,Qs,xu];function Au(e,t){t.value&&Uo(e,"textContent","_s("+t.value+")",t)}function ku(e,t){t.value&&Uo(e,"innerHTML","_s("+t.value+")",t)}var Ou,Su,Tu={model:la,text:Au,html:ku},Nu={expectHTML:!0,modules:Cu,directives:Tu,isPreTag:Bi,isUnaryTag:tc,mustUseProp:wi,canBeLeftOpenTag:nc,isReservedTag:Ui,getTagNamespace:zi,staticKeys:F(Cu)},ju=w(Mu);function Eu(e,t){e&&(Ou=ju(t.staticKeys||""),Su=t.isReservedTag||L,Du(e),Lu(e,!1))}function Mu(e){return m("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))}function Du(e){if(e.static=Iu(e),1===e.type){if(!Su(e.tag)&&"slot"!==e.tag&&null==e.attrsMap["inline-template"])return;for(var t=0,n=e.children.length;t<n;t++){var r=e.children[t];Du(r),r.static||(e.static=!1)}if(e.ifConditions)for(var i=1,o=e.ifConditions.length;i<o;i++){var a=e.ifConditions[i].block;Du(a),a.static||(e.static=!1)}}}function Lu(e,t){if(1===e.type){if((e.static||e.once)&&(e.staticInFor=t),e.static&&e.children.length&&(1!==e.children.length||3!==e.children[0].type))return void(e.staticRoot=!0);if(e.staticRoot=!1,e.children)for(var n=0,r=e.children.length;n<r;n++)Lu(e.children[n],t||!!e.for);if(e.ifConditions)for(var i=1,o=e.ifConditions.length;i<o;i++)Lu(e.ifConditions[i].block,t)}}function Iu(e){return 2!==e.type&&(3===e.type||!(!e.pre&&(e.hasBindings||e.if||e.for||y(e.tag)||!Su(e.tag)||Fu(e)||!Object.keys(e).every(Ou))))}function Fu(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}var Pu=/^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/,Ru=/\([^)]*?\);*$/,Hu=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Bu={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Uu={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},zu=function(e){return"if("+e+")return null;"},Vu={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:zu("$event.target !== $event.currentTarget"),ctrl:zu("!$event.ctrlKey"),shift:zu("!$event.shiftKey"),alt:zu("!$event.altKey"),meta:zu("!$event.metaKey"),left:zu("'button' in $event && $event.button !== 0"),middle:zu("'button' in $event && $event.button !== 1"),right:zu("'button' in $event && $event.button !== 2")};function Ju(e,t){var n=t?"nativeOn:":"on:",r="",i="";for(var o in e){var a=Ku(e[o]);e[o]&&e[o].dynamic?i+=o+","+a+",":r+='"'+o+'":'+a+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function Ku(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return Ku(e)}).join(",")+"]";var t=Hu.test(e.value),n=Pu.test(e.value),r=Hu.test(e.value.replace(Ru,""));if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(Vu[s])o+=Vu[s],Bu[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=zu(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=qu(a)),o&&(i+=o),"function($event){"+i+(t?"return "+e.value+"($event)":n?"return ("+e.value+")($event)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function qu(e){return"if(!$event.type.indexOf('key')&&"+e.map(Wu).join("&&")+")return null;"}function Wu(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Bu[e],r=Uu[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}function Zu(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}}function Gu(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}}var Xu={on:Zu,bind:Gu,cloak:D},Yu=function(e){this.options=e,this.warn=e.warn||Ho,this.transforms=Bo(e.modules,"transformCode"),this.dataGenFns=Bo(e.modules,"genData"),this.directives=E(E({},Xu),e.directives);var t=e.isReservedTag||L;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Qu(e,t){var n=new Yu(t);return{render:"with(this){return "+(e?el(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function el(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return tl(e,t);if(e.once&&!e.onceProcessed)return nl(e,t);if(e.for&&!e.forProcessed)return ol(e,t);if(e.if&&!e.ifProcessed)return rl(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return _l(e,t);var n;if(e.component)n=bl(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=al(e,t));var i=e.inlineTemplate?null:dl(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o<t.transforms.length;o++)n=t.transforms[o](e,n);return n}return dl(e,t)||"void 0"}function tl(e,t){e.staticProcessed=!0;var n=t.pre;return e.pre&&(t.pre=e.pre),t.staticRenderFns.push("with(this){return "+el(e,t)+"}"),t.pre=n,"_m("+(t.staticRenderFns.length-1)+(e.staticInFor?",true":"")+")"}function nl(e,t){if(e.onceProcessed=!0,e.if&&!e.ifProcessed)return rl(e,t);if(e.staticInFor){for(var n="",r=e.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?"_o("+el(e,t)+","+t.onceId+++","+n+")":el(e,t)}return tl(e,t)}function rl(e,t,n,r){return e.ifProcessed=!0,il(e.ifConditions.slice(),t,n,r)}function il(e,t,n,r){if(!e.length)return r||"_e()";var i=e.shift();return i.exp?"("+i.exp+")?"+o(i.block)+":"+il(e,t,n,r):""+o(i.block);function o(e){return n?n(e,t):e.once?nl(e,t):el(e,t)}}function ol(e,t,n,r){var i=e.for,o=e.alias,a=e.iterator1?","+e.iterator1:"",s=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+a+s+"){return "+(n||el)(e,t)+"})"}function al(e,t){var n="{",r=sl(e,t);r&&(n+=r+","),e.key&&(n+="key:"+e.key+","),e.ref&&(n+="ref:"+e.ref+","),e.refInFor&&(n+="refInFor:true,"),e.pre&&(n+="pre:true,"),e.component&&(n+='tag:"'+e.tag+'",');for(var i=0;i<t.dataGenFns.length;i++)n+=t.dataGenFns[i](e);if(e.attrs&&(n+="attrs:"+$l(e.attrs)+","),e.props&&(n+="domProps:"+$l(e.props)+","),e.events&&(n+=Ju(e.events,!1)+","),e.nativeEvents&&(n+=Ju(e.nativeEvents,!0)+","),e.slotTarget&&!e.slotScope&&(n+="slot:"+e.slotTarget+","),e.scopedSlots&&(n+=ul(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var o=cl(e,t);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+$l(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function sl(e,t){var n=e.directives;if(n){var r,i,o,a,s="directives:[",c=!1;for(r=0,i=n.length;r<i;r++){o=n[r],a=!0;var u=t.directives[o.name];u&&(a=!!u(e,o,t.warn)),a&&(c=!0,s+='{name:"'+o.name+'",rawName:"'+o.rawName+'"'+(o.value?",value:("+o.value+"),expression:"+JSON.stringify(o.value):"")+(o.arg?",arg:"+(o.isDynamicArg?o.arg:'"'+o.arg+'"'):"")+(o.modifiers?",modifiers:"+JSON.stringify(o.modifiers):"")+"},")}return c?s.slice(0,-1)+"]":void 0}}function cl(e,t){var n=e.children[0];if(n&&1===n.type){var r=Qu(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map(function(e){return"function(){"+e+"}"}).join(",")+"]}"}}function ul(e,t,n){var r=e.for||Object.keys(t).some(function(e){var n=t[e];return n.slotTargetDynamic||n.if||n.for||fl(n)}),i=!!e.if;if(!r)for(var o=e.parent;o;){if(o.slotScope&&o.slotScope!==Kc||o.for){r=!0;break}o.if&&(i=!0),o=o.parent}var a=Object.keys(t).map(function(e){return pl(t[e],n)}).join(",");return"scopedSlots:_u(["+a+"]"+(r?",null,true":"")+(!r&&i?",null,false,"+ll(a):"")+")"}function ll(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0}function fl(e){return 1===e.type&&("slot"===e.tag||e.children.some(fl))}function pl(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return rl(e,t,pl,"null");if(e.for&&!e.forProcessed)return ol(e,t,pl);var r=e.slotScope===Kc?"":String(e.slotScope),i="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(dl(e,t)||"undefined")+":undefined":dl(e,t)||"undefined":el(e,t))+"}",o=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+i+o+"}"}function dl(e,t,n,r,i){var o=e.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?t.maybeComponent(a)?",1":",0":"";return""+(r||el)(a,t)+s}var c=n?vl(o,t.maybeComponent):0,u=i||ml;return"["+o.map(function(e){return u(e,t)}).join(",")+"]"+(c?","+c:"")}}function vl(e,t){for(var n=0,r=0;r<e.length;r++){var i=e[r];if(1===i.type){if(hl(i)||i.ifConditions&&i.ifConditions.some(function(e){return hl(e.block)})){n=2;break}(t(i)||i.ifConditions&&i.ifConditions.some(function(e){return t(e.block)}))&&(n=1)}}return n}function hl(e){return void 0!==e.for||"template"===e.tag||"slot"===e.tag}function ml(e,t){return 1===e.type?el(e,t):3===e.type&&e.isComment?gl(e):yl(e)}function yl(e){return"_v("+(2===e.type?e.expression:wl(JSON.stringify(e.text)))+")"}function gl(e){return"_e("+JSON.stringify(e.text)+")"}function _l(e,t){var n=e.slotName||'"default"',r=dl(e,t),i="_t("+n+(r?","+r:""),o=e.attrs||e.dynamicAttrs?$l((e.attrs||[]).concat(e.dynamicAttrs||[]).map(function(e){return{name:C(e.name),value:e.value,dynamic:e.dynamic}})):null,a=e.attrsMap["v-bind"];return!o&&!a||r||(i+=",null"),o&&(i+=","+o),a&&(i+=(o?"":",null")+","+a),i+")"}function bl(e,t,n){var r=t.inlineTemplate?null:dl(t,n,!0);return"_c("+e+","+al(t,n)+(r?","+r:"")+")"}function $l(e){for(var t="",n="",r=0;r<e.length;r++){var i=e[r],o=wl(i.value);i.dynamic?n+=i.name+","+o+",":t+='"'+i.name+'":'+o+","}return t="{"+t.slice(0,-1)+"}",n?"_d("+t+",["+n.slice(0,-1)+"])":t}function wl(e){return e.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}var xl=new RegExp("\\b"+"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments".split(",").join("\\b|\\b")+"\\b"),Cl=new RegExp("\\b"+"delete,typeof,void".split(",").join("\\s*\\([^\\)]*\\)|\\b")+"\\s*\\([^\\)]*\\)"),Al=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;function kl(e,t){e&&Ol(e,t)}function Ol(e,t){if(1===e.type){for(var n in e.attrsMap)if(Mc.test(n)){var r=e.attrsMap[n];if(r){var i=e.rawAttrsMap[n];"v-for"===n?Tl(e,'v-for="'+r+'"',t,i):"v-slot"===n||"#"===n[0]?El(r,n+'="'+r+'"',t,i):Ec.test(n)?Sl(r,n+'="'+r+'"',t,i):jl(r,n+'="'+r+'"',t,i)}}if(e.children)for(var o=0;o<e.children.length;o++)Ol(e.children[o],t)}else 2===e.type&&jl(e.expression,e.text,t,e)}function Sl(e,t,n,r){var i=e.replace(Al,""),o=i.match(Cl);o&&"$"!==i.charAt(o.index-1)&&n('avoid using JavaScript unary operator as property name: "'+o[0]+'" in expression '+t.trim(),r),jl(e,t,n,r)}function Tl(e,t,n,r){jl(e.for||"",t,n,r),Nl(e.alias,"v-for alias",t,n,r),Nl(e.iterator1,"v-for iterator",t,n,r),Nl(e.iterator2,"v-for iterator",t,n,r)}function Nl(e,t,n,r,i){if("string"==typeof e)try{new Function("var "+e+"=_")}catch(Xl){r("invalid "+t+' "'+e+'" in expression: '+n.trim(),i)}}function jl(e,t,n,r){try{new Function("return "+e)}catch(Xl){var i=e.replace(Al,"").match(xl);n(i?'avoid using JavaScript keyword as property name: "'+i[0]+'"\n Raw expression: '+t.trim():"invalid expression: "+Xl.message+" in\n\n "+e+"\n\n Raw expression: "+t.trim()+"\n",r)}}function El(e,t,n,r){try{new Function(e,"")}catch(Xl){n("invalid function parameter expression: "+Xl.message+" in\n\n "+e+"\n\n Raw expression: "+t.trim()+"\n",r)}}var Ml=2;function Dl(e,t,n){void 0===t&&(t=0),void 0===n&&(n=e.length);for(var r=e.split(/\r?\n/),i=0,o=[],a=0;a<r.length;a++)if((i+=r[a].length+1)>=t){for(var s=a-Ml;s<=a+Ml||n>i;s++)if(!(s<0||s>=r.length)){o.push(""+(s+1)+Ll(" ",3-String(s+1).length)+"| "+r[s]);var c=r[s].length;if(s===a){var u=t-(i-c)+1,l=n>i?c-u:n-t;o.push(" | "+Ll(" ",u)+Ll("^",l))}else if(s>a){if(n>i){var f=Math.min(n-i,c);o.push(" | "+Ll("^",f))}i+=c+1}}break}return o.join("\n")}function Ll(e,t){var n="";if(t>0)for(;1&t&&(n+=e),!((t>>>=1)<=0);)e+=e;return n}function Il(e,t){try{return new Function(e)}catch(n){return t.push({err:n,code:e}),D}}function Fl(e){var t=Object.create(null);return function(n,r,i){(r=E({},r)).warn;delete r.warn;var o=r.delimiters?String(r.delimiters)+n:n;if(t[o])return t[o];var a=e(n,r);var s={},c=[];return s.render=Il(a.render,c),s.staticRenderFns=a.staticRenderFns.map(function(e){return Il(e,c)}),t[o]=s}}function Pl(e){return function(t){function n(n,r){var i=Object.create(t),o=[],a=[],s=function(e,t,n){(n?a:o).push(e)};if(r)for(var c in r.modules&&(i.modules=(t.modules||[]).concat(r.modules)),r.directives&&(i.directives=E(Object.create(t.directives||null),r.directives)),r)"modules"!==c&&"directives"!==c&&(i[c]=r[c]);i.warn=s;var u=e(n.trim(),i);return u.errors=o,u.tips=a,u}return{compile:n,compileToFunctions:Fl(n)}}}var Rl,Hl=Pl(function(e,t){var n=Wc(e.trim(),t);!1!==t.optimize&&Eu(n,t);var r=Qu(n,t);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}}),Bl=Hl(Nu),Ul=Bl.compile,zl=Bl.compileToFunctions;function Vl(e){return(Rl=Rl||document.createElement("div")).innerHTML=e?'<a href="\n"/>':'<div a="\n"/>',Rl.innerHTML.indexOf("&#10;")>0}var Jl=!!Y&&Vl(!1),Kl=!!Y&&Vl(!0),ql=w(function(e){var t=qi(e);return t&&t.innerHTML}),Wl=oi.prototype.$mount;function Zl(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}oi.prototype.$mount=function(e,t){if((e=e&&qi(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=ql(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=Zl(e));if(r){0;var i=zl(r,{outputSourceRange:!1,shouldDecodeNewlines:Jl,shouldDecodeNewlinesForHref:Kl,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return Wl.call(this,e,t)},oi.compile=zl;var Gl=oi;exports.default=Gl;
4
  },{}],"Lue2":[function(require,module,exports) {
5
  "use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=t(require("vue"));function r(t){return(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})(t)}function n(t){return o(t)||s(t)||i()}function o(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}function s(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function i(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var a="undefined"!=typeof window;function u(t){return Array.isArray(t)||"object"===r(t)?Object.freeze(t):t}function l(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.reduce(function(t,r){var n=r.passengers[0],o="function"==typeof n?n(e):r.passengers;return t.concat(o)},[])}function c(t,e){return t.map(function(t,e){return[e,t]}).sort(function(t,r){return e(t[1],r[1])||t[0]-r[0]}).map(function(t){return t[1]})}function p(t,e){return e.reduce(function(e,r){return t.hasOwnProperty(r)&&(e[r]=t[r]),e},{})}var h={},d={},f={},g=e.extend({data:function(){return{transports:h,targets:d,sources:f,trackInstances:a}},methods:{open:function(t){if(a){var r=t.to,n=t.from,o=t.passengers,s=t.order,i=void 0===s?1/0:s;if(r&&n&&o){var l={to:r,from:n,passengers:u(o),order:i};-1===Object.keys(this.transports).indexOf(r)&&e.set(this.transports,r,[]);var p=this.$_getTransportIndex(l),h=this.transports[r].slice(0);-1===p?h.push(l):h[p]=l,this.transports[r]=c(h,function(t,e){return t.order-e.order})}}},close:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.to,n=t.from;if(r&&(n||!1!==e)&&this.transports[r])if(e)this.transports[r]=[];else{var o=this.$_getTransportIndex(t);if(o>=0){var s=this.transports[r].slice(0);s.splice(o,1),this.transports[r]=s}}},registerTarget:function(t,e,r){a&&(this.trackInstances&&!r&&this.targets[t]&&console.warn("[portal-vue]: Target ".concat(t," already exists")),this.$set(this.targets,t,Object.freeze([e])))},unregisterTarget:function(t){this.$delete(this.targets,t)},registerSource:function(t,e,r){a&&(this.trackInstances&&!r&&this.sources[t]&&console.warn("[portal-vue]: source ".concat(t," already exists")),this.$set(this.sources,t,Object.freeze([e])))},unregisterSource:function(t){this.$delete(this.sources,t)},hasTarget:function(t){return!(!this.targets[t]||!this.targets[t][0])},hasSource:function(t){return!(!this.sources[t]||!this.sources[t][0])},hasContentFor:function(t){return!!this.transports[t]&&!!this.transports[t].length},$_getTransportIndex:function(t){var e=t.to,r=t.from;for(var n in this.transports[e])if(this.transports[e][n].from===r)return+n;return-1}}}),m=new g(h),y=1,v=e.extend({name:"portal",props:{disabled:{type:Boolean},name:{type:String,default:function(){return String(y++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}}},created:function(){var t=this;this.$nextTick(function(){m.registerSource(t.name,t)})},mounted:function(){this.disabled||this.sendUpdate()},updated:function(){this.disabled?this.clear():this.sendUpdate()},beforeDestroy:function(){m.unregisterSource(this.name),this.clear()},watch:{to:function(t,e){e&&e!==t&&this.clear(e),this.sendUpdate()}},methods:{clear:function(t){var e={from:this.name,to:t||this.to};m.close(e)},normalizeSlots:function(){return this.$scopedSlots.default?[this.$scopedSlots.default]:this.$slots.default},normalizeOwnChildren:function(t){return"function"==typeof t?t(this.slotProps):t},sendUpdate:function(){var t=this.normalizeSlots();if(t){var e={from:this.name,to:this.to,passengers:n(t),order:this.order};m.open(e)}else this.clear()}},render:function(t){var e=this.$slots.default||this.$scopedSlots.default||[],r=this.tag;return e&&this.disabled?e.length<=1&&this.slim?this.normalizeOwnChildren(e)[0]:t(r,[this.normalizeOwnChildren(e)]):this.slim?t():t(r,{class:{"v-portal":!0},style:{display:"none"},key:"v-portal-placeholder"})}}),S=e.extend({name:"portalTarget",props:{multiple:{type:Boolean,default:!1},name:{type:String,required:!0},slim:{type:Boolean,default:!1},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},data:function(){return{transports:m.transports,firstRender:!0}},created:function(){var t=this;this.$nextTick(function(){m.registerTarget(t.name,t)})},watch:{ownTransports:function(){this.$emit("change",this.children().length>0)},name:function(t,e){m.unregisterTarget(e),m.registerTarget(t,this)}},mounted:function(){var t=this;this.transition&&this.$nextTick(function(){t.firstRender=!1})},beforeDestroy:function(){m.unregisterTarget(this.name)},computed:{ownTransports:function(){var t=this.transports[this.name]||[];return this.multiple?t:0===t.length?[]:[t[t.length-1]]},passengers:function(){return l(this.ownTransports,this.slotProps)}},methods:{children:function(){return 0!==this.passengers.length?this.passengers:this.$scopedSlots.default?this.$scopedSlots.default(this.slotProps):this.$slots.default||[]},noWrapper:function(){var t=this.slim&&!this.transition;return t&&this.children().length>1&&console.warn("[portal-vue]: PortalTarget with `slim` option received more than one child element."),t}},render:function(t){var e=this.noWrapper(),r=this.children(),n=this.transition||this.tag;return e?r[0]:this.slim&&!n?t():t(n,{props:{tag:this.transition&&this.tag?this.tag:void 0},class:{"vue-portal-target":!0}},r)}}),b=0,T=["disabled","name","order","slim","slotProps","tag","to"],$=["multiple","transition"],w=e.extend({name:"MountingPortal",inheritAttrs:!1,props:{append:{type:[Boolean,String]},bail:{type:Boolean},mountTo:{type:String,required:!0},disabled:{type:Boolean},name:{type:String,default:function(){return"mounted_"+String(b++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}},multiple:{type:Boolean,default:!1},targetSlim:{type:Boolean},targetSlotProps:{type:Object,default:function(){return{}}},targetTag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},created:function(){if("undefined"!=typeof document){var t=document.querySelector(this.mountTo);if(t){var e=this.$props;if(m.targets[e.name])e.bail?console.warn("[portal-vue]: Target ".concat(e.name," is already mounted.\n Aborting because 'bail: true' is set")):this.portalTarget=m.targets[e.name];else{var r=e.append;if(r){var n="string"==typeof r?r:"DIV",o=document.createElement(n);t.appendChild(o),t=o}var s=p(this.$props,$);s.slim=this.targetSlim,s.tag=this.targetTag,s.slotProps=this.targetSlotProps,s.name=this.to,this.portalTarget=new S({el:t,parent:this.$parent||this,propsData:s})}}else console.error("[portal-vue]: Mount Point '".concat(this.mountTo,"' not found in document"))}},beforeDestroy:function(){var t=this.portalTarget;if(this.append){var e=t.$el;e.parentNode.removeChild(e)}t.$destroy()},render:function(t){if(!this.portalTarget)return console.warn("[portal-vue] Target wasn't mounted"),t();if(!this.$scopedSlots.manual){var e=p(this.$props,T);return t(v,{props:e,attrs:this.$attrs,on:this.$listeners,scopedSlots:this.$scopedSlots},this.$slots.default)}var r=this.$scopedSlots.manual({to:this.to});return Array.isArray(r)&&(r=r[0]),r||t()}});function P(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.component(e.portalName||"Portal",v),t.component(e.portalTargetName||"PortalTarget",S),t.component(e.MountingPortalName||"MountingPortal",w)}var x={install:P};exports.default=x,exports.Portal=v,exports.PortalTarget=S,exports.MountingPortal=w,exports.Wormhole=m;
6
- },{"vue":"HYXJ"}],"vi91":[function(require,module,exports) {
 
 
7
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:["logoSrc","logoAlt","pluginName"]};exports.default=e;
8
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"wptb-settings-header"},[e("div",{staticClass:"wptb-settings-brand"},[e("img",{attrs:{src:t.logoSrc,alt:t.logoAlt}}),t._v(" "),e("span",{staticClass:"wptb-settings-header-name"},[t._v(" "+t._s(t.pluginName)+" ")])]),t._v(" "),e("div",{staticClass:"wptb-settings-links"},[t._t("default")],2)])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
9
- },{}],"bosS":[function(require,module,exports) {
10
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={props:["name","current"],methods:{activePosition:function(){void 0!==this.current&&this.current!==this.name||this.$emit("activeSectionElement",this.$refs.sectionItem)}},computed:{isActive:function(){return this.activePosition(),void 0===this.current||this.current===this.name}}};exports.default=t;
11
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{ref:"sectionItem",staticClass:"wptb-settings-section-item",class:{disabled:!e.isActive},on:{click:function(t){return e.$emit("sectionchange",e.name,t.target)}}},[e._v(" "+e._s(e.name)+"\n")])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
12
- },{}],"jLHe":[function(require,module,exports) {
13
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={props:["activeItem","relativeParent"],methods:{toPx:function(t){return"".concat(t,"px")}},computed:{styleCalculations:function(){if(this.activeItem){var t=this.activeItem.getBoundingClientRect(),e=this.relativeParent.getBoundingClientRect(),i=Math.abs(t.left-e.left);return{width:this.toPx(t.width),height:"2px",bottom:0,left:this.toPx(i)}}return{}}}};exports.default=t;
14
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"wptb-menu-active-section-indicator",style:this.styleCalculations})},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
15
- },{}],"yPIx":[function(require,module,exports) {
16
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("./SectionItem")),t=n(require("./ActiveSectionIndicator"));function n(e){return e&&e.__esModule?e:{default:e}}var i={model:{prop:"currentSection",event:"updateSection"},props:{child:{type:Boolean,default:!1},items:Array,currentSection:String},components:{SectionItem:e.default,ActiveSectionIndicator:t.default},data:function(){return{innerCurrentSection:"",activeSectionElement:null}},mounted:function(){this.innerCurrentSection=this.currentSection||this.items[0]},watch:{innerCurrentSection:function(e){this.$emit("updateSection",e)}},methods:{handleSectionChange:function(e){this.innerCurrentSection=e},handleActiveSectionElement:function(e){this.activeSectionElement=e}}};exports.default=i;
17
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{ref:"wrapper",staticClass:"wptb-settings-sections-wrapper",class:{child:e.child}},[e._l(e.items,function(t){return n("section-item",{key:t,attrs:{name:t,current:e.innerCurrentSection},on:{sectionchange:e.handleSectionChange,activeSectionElement:e.handleActiveSectionElement}})}),e._v(" "),n("active-section-indicator",{attrs:{"relative-parent":e.$refs.wrapper,"active-item":e.activeSectionElement}})],2),e._v(" "),e._t("default")],2)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
18
- },{"./SectionItem":"bosS","./ActiveSectionIndicator":"jLHe"}],"wm3G":[function(require,module,exports) {
19
  "use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,s)}return r}function t(t){for(var s=1;s<arguments.length;s++){var a=null!=arguments[s]?arguments[s]:{};s%2?e(Object(a),!0).forEach(function(e){r(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var s={withMessageData:{busy:!1,show:!1,message:"",type:"ok",intervalId:-1,intervalTime:5e3}},a=t({},s.withMessageData),i={data:function(){return s},methods:{isBusy:function(){return this.withMessageData.busy},setMessage:function(e){var r=this,s=t({},a,{},e);this.withMessageData.message=s.message,this.withMessageData.type=s.type,this.withMessageData.show=!0,clearInterval(this.withMessageData.intervalId),this.withMessageData.intervalId=setInterval(function(){r.withMessageData.show=!1},s.intervalTime)},setBusy:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.withMessageData.busy=e}}},n=i;exports.default=n;
20
  },{}],"P9T4":[function(require,module,exports) {
21
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("../mixins/withMessage"));function t(e){return e&&e.__esModule?e:{default:e}}var r={mixins:[e.default]};exports.default=r;
22
- (function(){var s=exports.default||module.exports;"function"==typeof s&&(s=s.options),Object.assign(s,{render:function(){var s=this,t=s.$createElement,e=s._self._c||t;return e("div",{staticClass:"wptb-settings-messages"},[s.withMessageData.busy?e("span",{staticClass:"dashicons dashicons-image-rotate wptb-settings-fetching"}):s._e(),s._v(" "),e("transition",{attrs:{name:"wptb-fade"}},[s.withMessageData.show?e("span",{staticClass:"wptb-settings-message",class:[s.withMessageData.type]},[s._v(s._s(s.withMessageData.message))]):s._e()])],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
23
- },{"../mixins/withMessage":"wm3G"}],"ksMR":[function(require,module,exports) {
24
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:{disabled:Boolean,type:{type:String,default:"primary"},size:{type:String,default:"normal"}},methods:{handleClick:function(){this.disabled||this.$emit("click")}}};exports.default=e;
25
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"wptb-settings-button",class:[{disabled:this.disabled},this.type,this.size],on:{click:this.handleClick}},[this._t("default")],2)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
26
- },{}],"nwtb":[function(require,module,exports) {
 
 
 
 
27
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./MessageDisplay.vue")),s=t(require("./MenuButton"));function t(e){return e&&e.__esModule?e:{default:e}}var u={props:["messageType","messageShow","messageBody","messageBusy"],components:{MessageDisplay:e.default,MenuButton:s.default}};exports.default=u;
28
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"wptb-settings-footer"},[s("message-display",{attrs:{busy:e.messageBusy,message:e.messageBody,show:e.messageShow,type:e.messageType}}),e._v(" "),s("div",{staticClass:"wptb-settings-button-container"},[s("menu-button",{staticStyle:{visibility:"hidden"}},[e._v("dummy")]),e._v(" "),e._t("default")],2)],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
29
- },{"./MessageDisplay.vue":"P9T4","./MenuButton":"ksMR"}],"vTRD":[function(require,module,exports) {
30
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:{center:{type:Boolean,default:!1}}};exports.default=e;
31
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"wptb-settings-controls-wrapper",class:[this.center?"center":"grid"]},[e("transition",{attrs:{name:"wptb-fade",mode:"out-in"}},[this._t("default")],2)],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
32
- },{}],"vU4o":[function(require,module,exports) {
33
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:["texts","file","allowedFormats"],model:{prop:"file",event:"fileChanged"},data:function(){return{dragActive:!1,currentFile:null}},mounted:function(){this.currentFile=this.file},watch:{currentFile:function(e){this.$emit("fileChanged",e)},file:function(e){this.currentFile=e}},computed:{eventClass:function(){return this.dragActive?"dragenter":""}},methods:{handleDrop:function(e){this.dragActive=!0;var t=e.dataTransfer;t.files[0]&&this.isTypeAllowed(t.files[0])&&(this.currentFile=t.files[0]),this.dragActive=!1},isTypeAllowed:function(e){var t=e.name.split(".").pop();return this.allowedFormats.includes(t)},openFileSelect:function(){this.$refs.fileSelect.click()},handleFileSelect:function(e){e.target.files.length>0&&this.isTypeAllowed(e.target.files[0])&&(this.currentFile=e.target.files[0])},clearCurrentFile:function(){this.currentFile=null}}};exports.default=e;
34
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"wptb-menu-file-drop",class:e.eventClass,on:{dragenter:function(t){t.stopPropagation(),t.preventDefault(),e.dragActive=!0},dragleave:function(t){t.stopPropagation(),t.preventDefault(),e.dragActive=!1},drop:function(t){return t.stopPropagation(),t.preventDefault(),e.handleDrop(t)},dragover:function(t){t.stopPropagation(),t.preventDefault(),e.dragActive=!0}}},[n("transition",{attrs:{name:"wptb-fade",mode:"out-in"}},[e.dragActive?n("div",{key:"fileLogo",staticClass:"file-icon"},[n("span",{staticClass:"dashicons dashicons-media-spreadsheet"})]):n("div",{key:"controls"},[n("transition",{attrs:{name:"wptb-fade",mode:"out-in"}},[null===e.currentFile?n("div",{key:"selection",staticClass:"wptb-flex wptb-flex-col wptb-flex-align-center"},[n("div",{staticClass:"hint"},[e._v(e._s(e.texts.hint))]),e._v(" "),n("div",{staticClass:"supported wptb-text-transform-none"},[e._v("("+e._s(e.allowedFormats.join(", "))+")")]),e._v(" "),n("div",[n("a",{on:{click:function(t){return t.preventDefault(),e.openFileSelect(t)}}},[e._v(e._s(e.texts.browse))]),e._v(" "),n("input",{ref:"fileSelect",staticStyle:{display:"none"},attrs:{type:"file"},on:{change:e.handleFileSelect}})])]):n("div",{key:"selected",staticClass:"wptb-flex wptb-flex-col wptb-flex-align-center"},[n("div",{staticClass:"file"},[e._v(e._s(e.currentFile.name))]),e._v(" "),n("div",[n("a",{on:{click:function(t){return t.preventDefault(),e.clearCurrentFile(t)}}},[e._v(e._s(e.texts.clear))])])])])],1)])],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
35
- },{}],"yXWm":[function(require,module,exports) {
36
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:["fieldData","modelBind"],methods:{isType:function(e){return this.fieldData.type===e}}};exports.default=e;
37
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,i=e.$createElement,d=e._self._c||i;return d("div",[e.isType("multiCheckbox")?d("div",e._l(e.fieldData.options,function(i,a){return d("div",{key:i,staticClass:"wptb-setting-control-row"},[d("input",{directives:[{name:"model",rawName:"v-model",value:e.modelBind[e.fieldData.id],expression:"modelBind[fieldData.id]"}],attrs:{id:e.fieldData.id,type:"checkbox"},domProps:{value:a,checked:Array.isArray(e.modelBind[e.fieldData.id])?e._i(e.modelBind[e.fieldData.id],a)>-1:e.modelBind[e.fieldData.id]},on:{change:function(i){var d=e.modelBind[e.fieldData.id],t=i.target,l=!!t.checked;if(Array.isArray(d)){var o=a,n=e._i(d,o);t.checked?n<0&&e.$set(e.modelBind,e.fieldData.id,d.concat([o])):n>-1&&e.$set(e.modelBind,e.fieldData.id,d.slice(0,n).concat(d.slice(n+1)))}else e.$set(e.modelBind,e.fieldData.id,l)}}}),e._v(" "),d("label",{attrs:{for:e.fieldData.id}},[e._v(e._s(i))])])}),0):e.isType("checkbox")?d("div",[d("div",{staticClass:"wptb-setting-control-row"},[d("input",{directives:[{name:"model",rawName:"v-model",value:e.modelBind[e.fieldData.id],expression:"modelBind[fieldData.id]"}],attrs:{id:e.fieldData.id,type:"checkbox"},domProps:{checked:Array.isArray(e.modelBind[e.fieldData.id])?e._i(e.modelBind[e.fieldData.id],null)>-1:e.modelBind[e.fieldData.id]},on:{change:function(i){var d=e.modelBind[e.fieldData.id],a=i.target,t=!!a.checked;if(Array.isArray(d)){var l=e._i(d,null);a.checked?l<0&&e.$set(e.modelBind,e.fieldData.id,d.concat([null])):l>-1&&e.$set(e.modelBind,e.fieldData.id,d.slice(0,l).concat(d.slice(l+1)))}else e.$set(e.modelBind,e.fieldData.id,t)}}}),e._v(" "),d("label",{attrs:{for:e.fieldData.id}},[e._v(e._s(e.fieldData.label))])])]):e.isType("dropdown")?d("div",[d("div",{staticClass:"wptb-setting-control-row"},[d("select",{directives:[{name:"model",rawName:"v-model",value:e.modelBind[e.fieldData.id],expression:"modelBind[fieldData.id]"}],attrs:{id:e.fieldData.id},on:{change:function(i){var d=Array.prototype.filter.call(i.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.$set(e.modelBind,e.fieldData.id,i.target.multiple?d:d[0])}}},e._l(e.fieldData.options,function(i){return d("option",{key:i.label,domProps:{value:i.value}},[e._v(" "+e._s(i.label)+" ")])}),0),e._v(" "),d("label",{attrs:{for:e.fieldData.id}},[e._v(e._s(e.fieldData.label))]),e._v(" "),e._t("default")],2)]):e._e()])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
38
- },{}],"bsz0":[function(require,module,exports) {
39
  "use strict";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e){return a(e)||n(e)||o(e)||r()}function r(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}function n(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function a(e){if(Array.isArray(e))return i(e)}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function l(r){function o(e){e.map(function(e){var t=document.createElement("div");t.innerHTML=e,a(t.querySelector("table"))})}function n(e,o){if(e&&Array.isArray(e)){var l=r.delimiter;if("tab"==l&&(l="\t"),!l&&!(l=function(e){for(var t={},r=!1,o=0,n=e.length,a=0;a<n;a++){var i=a-1>=0?e[a-1]:"",l=e[a],s=a+1<n?e[a+1]:"";if('"'===l)r&&'"'===s?r&&a++:r=!r;else if(("\n"!==l||"\r"===i)&&"\r"!==l||r)r||-1!==";,\t".indexOf(l)&&(void 0===t[l]&&(t[l]={}),void 0===t[l][o]&&(t[l][o]=0),t[l][o]++);else if(++o>=15)break}var c="";for(var d in t){var p=t[d],u=0;for(var m in p)u++;if(u===o){var b=!1,w=void 0;for(var v in p)b?w=!(p[v]!==b||!w&&void 0!==w):b=p[v];if(!(o>1)||w){if(c){c=!1;break}c=d}}}return c}(e[o])))return void alert("The delimiter could not be determined");document.addEventListener("table:imported:saved",function t(){e.length-o>1&&n(e,o+1),document.removeEventListener("table:imported:saved",t)}),""===e[o]&&(e[o]=" "),a(function(e){if(e&&Array.isArray(e)&&e.length>0){var r=e.length,o=r>0&&e[0]&&Array.isArray(e[0])?e[0].length:0;if(0===r&&0===o)return!1;var n={imageElemIndex:1,textElemIndex:1,customHtmlElemIndex:1},a=new Array(r);a.fill(1);var l=new Array(o);l.fill(1);for(var s=document.createElement("tbody"),c=r-1,p=o-1,u=c;u>=0;u--){var m=document.createElement("tr");m.classList.add("wptb-row");for(var b=p;b>=0;b--){var w=e[u][b];if("#rowspan#"===w){if(u>0){a[b]||(a[b]=1),a[b]++,l[u]=1;continue}w=""}else if("#colspan#"===w){if(b>0){l[u]||(l[u]=1),l[u]++,a[b]=1;continue}w=""}var v=document.createElement("td");v.classList.add("wptb-droppable","wptb-cell"),v.dataset.wptbCssTdAutoWidth="true",v.style.padding="15px",v.style.width=null,v.style.height=null,v.style.borderStyle="solid",v.style.borderWidth="1px",v.innerHTML=w,l[u]>1&&(v.colSpan=l[u]),a[b]>1&&(v.rowSpan=a[b]),m.insertBefore(v,m.firstChild),l[u]=1,a[b]=1}s.insertBefore(m,s.firstChild)}var y=document.createElement("table");y.classList.add("wptb-preview-table","wptb-element-main-table_setting-startedid-0"),y.style.borderStyle="solid",y.style.borderWidth="1px",y.appendChild(s);for(var f=y.querySelectorAll("td"),h=0;h<f.length;h++){var S=t(f[h].childNodes),T=d(S,n),g=void 0;if(T&&Array.isArray(T)&&(g=T[0],n=T[1]),f[h].innerHTML="",g&&Array.isArray(g))for(var H=0;H<g.length;H++)f[h].appendChild(g[H])}return WPTB_Helper.recalculateIndexes(y),i(y),y}return!1}(function(e,t){for(var r=[],o=!1,n=0,a=0,i=0;i<e.length;i++){var l=e[i],s=e[i+1];r[n]=r[n]||[],r[n][a]=r[n][a]||"",'"'==l&&o&&'"'==s?(r[n][a]+=l,++i):'"'!=l?l!=t||o?"\n"!=l||o?r[n][a]+=l:(++n,a=0):++a:o=!o}return r}(e[o],l)))}}function a(e,t){var o=new XMLHttpRequest,n="".concat(r.ajaxUrl,"?action=save_table");t&&e.classList.contains("wptb-element-main-table_setting-startedid-0")&&(e.classList.remove("wptb-element-main-table_setting-startedid-0"),e.classList.add("wptb-element-main-table_setting-".concat(t)));var i={content:WPTB_Stringifier(e).outerHTML,security_code:r.nonce};t&&(i.id=t),i=JSON.stringify(i),o.open("POST",n,!0),o.setRequestHeader("Content-type","application/json; charset=utf-8"),o.onreadystatechange=function(t){if(4==this.readyState&&200==this.status){if("security_problem"===JSON.parse(o.responseText)[0])return void WPTB_Helper.wptbDocumentEventGenerate("table:imported:error",document);var r=JSON.parse(o.responseText);"saved"==r[0]?a(e,r[1]):"edited"==r[0]&&WPTB_Helper.wptbDocumentEventGenerate("table:imported:saved",document)}},o.send(i)}function i(e){r.tableResponsive?e.dataset.wptbAdaptiveTable="1":e.dataset.wptbAdaptiveTable="0",r.topRowAsHeader&&e.classList.add("wptb-table-preview-head"),e.dataset.wptbFixedWidthSize="0",e.dataset.wptbCellsWidthAutoCount=e.maxCols;var t=e.querySelector("td"),o=t&&t.style.paddingTop?t.style.paddingTop:15;e.dataset.wptbTableTdsSumMaxWidth=String(parseInt(e.maxCols)*(101+2*parseInt(o))+1)}function l(o,n){if(n&&Array.isArray(n)&&n.length>0){var a=n.shift();if(a&&Array.isArray(a)&&a.length>0){var c=a[0];window.wptbImportConvertationShortcodes||(window.wptbImportConvertationShortcodes=[]);var p=[];p.push(c),window.wptbImportConvertationShortcodes.push(p);var u=a[1],m="".concat(r.import_iframe_url,"&_wpnonce=").concat(r.security_code,"&shortcode=").concat(c);o.src=m,o.onload=function(o,n,a){var c=o.contentDocument||o.contentWindow.document,p=c.querySelector(".dataTables_length select");if(p){var u=t(p.options);if(Array.isArray(u)){var m=u.reduce(function(e,t){var r=e?Number(e.value):"",o=t?Number(t.value):"";return r<o&&(e=t),e});m&&(p.value=m.value,WPTB_Helper.wptbDocumentEventGenerate("change",p))}}!function(o,n,a,c){if(o){o.style.borderStyle="solid",o.style.borderWidth="1px",WPTB_Helper.checkSetGetStyleColorValue(o,"border-color","border-top-color",!0);var p=WPTB_Helper.checkSetGetStyleValue(o,"float","float");p&&"none"!=p&&(o.dataset.wptbTableAlignment=p);var u=o.querySelector("caption");u&&o.removeChild(u);var m=o.querySelector("tbody");m&&m.removeAttribute("class");var b=o.querySelector("thead");if(b){var w=b.innerHTML;if(w&&(w=WPTB_Helper.replaceAll(w,"<th","<td"),w=WPTB_Helper.replaceAll(w,"th>","td>"),m)){var v=m.innerHTML;v=w+v,m.innerHTML=v}o.removeChild(b)}var y=o.querySelector("tfoot");if(y){var f=y.innerHTML;if(f&&m){var h=m.innerHTML;h+=f,m.innerHTML=h}o.removeChild(y)}WPTB_Helper.recalculateIndexes(o);var S=o.querySelectorAll("tr");if(S.length>0)for(var T={imageElemIndex:1,textElemIndex:1,customHtmlElemIndex:1},g=0;g<S.length;g++){S[g].removeAttribute("class"),S[g].removeAttribute("role"),S[g].classList.add("wptb-row");var H=!0,_=WPTB_Helper.checkSetGetStyleColorValue(S[g],"background-color","background-color");_&&(WPTB_Helper.isHex(_)||(_=WPTB_Helper.rgbToHex(_)),S[g].style.tdsBackgroundColor=_,H=!1);for(var A=t(S[g].children),C=void 0,x="",L=0;L<A.length;L++){H&&(L>0&&C!=WPTB_Helper.checkSetGetStyleColorValue(trChildNodes[g],"background-color","background-color")?(C="",H=!1):C=WPTB_Helper.checkSetGetStyleColorValue(trChildNodes[g],"background-color","background-color")),A[L].style.width=null,A[L].style.height=null,A[L].style.borderStyle="solid",A[L].style.borderWidth="1px";var P=WPTB_Helper.checkSetGetStyleColorValue(A[L],"border-color","border-top-color"),B=WPTB_Helper.checkSetGetStyleColorValue(A[L],"border-color","border-left-color"),I=WPTB_Helper.checkSetGetStyleColorValue(A[L],"border-color","border-right-color"),W=WPTB_Helper.checkSetGetStyleColorValue(A[L],"border-color","border-bottom-color"),E=WPTB_Helper.getValueMaxCountSameElementsInArray([P,B,I,W]);E&&(WPTB_Helper.isHex(E)||(E=WPTB_Helper.rgbToHex(E)),A[L].style.borderColor=E),WPTB_Helper.checkSetGetStyleSizeValue(A[L],"padding","padding-top","px"),A[L].dataset.wptbCssTdAutoWidth="true",A[L].removeAttribute("class"),A[L].removeAttribute("role"),A[L].classList.add("wptb-droppable","wptb-cell");var M=A[L].dataset.xIndex,q=A[L].dataset.yIndex;if(M&&q&&Array.isArray(n)&&n[q]&&Array.isArray(n[q])&&n[q][M]){A[L].innerHTML=n[q][M];var k=t(A[L].childNodes),R=d(k,T),N=void 0;R&&Array.isArray(R)&&(N=R[0],T=R[1]),A[L].innerHTML="";for(var G=0;G<N.length;G++)A[L].appendChild(N[G])}x+=A[L].outerHTML}S[g].innerHTML=x,S[g].style.backgroundColor=WPTB_Helper.rgbToHex(C)}o.removeAttribute("class"),o.removeAttribute("role"),o.removeAttribute("id"),o.removeAttribute("aria-describedby"),o.classList.add("wptb-preview-table","wptb-element-main-table_setting-startedid-0"),i(o),function t(o,n,a,i){var c=new XMLHttpRequest;var d="".concat(r.ajaxUrl,"?action=save_table");var p;var u;var m=n.contentDocument||n.contentWindow.document;var b=m.querySelector(".tablepress-table-name");p=b?b.innerText:"";i&&o.classList.contains("wptb-element-main-table_setting-startedid-0")&&(o.classList.remove("wptb-element-main-table_setting-startedid-0"),o.classList.add("wptb-element-main-table_setting-".concat(i)));u=WPTB_Stringifier(o);u=u.outerHTML;var w={title:p,content:u,security_code:r.security_code};i&&(w.id=i);w=JSON.stringify(w);c.open("POST",d,!0);c.setRequestHeader("Content-type","application/json; charset=utf-8");c.onreadystatechange=function(i){if(4==this.readyState&&200==this.status){var d=JSON.parse(c.responseText);if("saved"==d[0])t(o,n,a,d[1]);else if("edited"==d[0]){if(d[1]&&window.wptbImportConvertationShortcodes&&Array.isArray(window.wptbImportConvertationShortcodes)&&window.wptbImportConvertationShortcodes.length>0&&window.wptbImportConvertationShortcodes[window.wptbImportConvertationShortcodes.length-1].push("[wptb id=".concat(d[1],"]")),window.wptbImportCommonCountTables){var p=window.wptbImportCommonCountTables,u=window.wptbImportCommonCountTables-a.length,m=s(u,p,"import");if(100==m){var b=document.querySelector(".wptb-importPBarContainer");b&&b.addEventListener("wptb-import:progressBar:full:import",function(){WPTB_Helper.wptbDocumentEventGenerate("table:imported:saved",document),WPTB_Helper.wptbDocumentEventGenerate("table:imported:list",document,e({},r.type,window.wptbImportConvertationShortcodes))},!1)}}else s(100,100,"import");l(n,a)}}};c.send(w)}(o,a,c)}}(c.querySelector("table.tablepress"),n,o,a)}.bind(this,o,u,n)}}}function s(e,t,r){var o=document.querySelector(".wptb-importPBarContainer"),n=document.querySelector("#wptb-pBarPercent"),a=document.querySelector("#wptb-pBarPercent span");if(o&&n&&a&&(e||0===e)&&t&&(e=Number(e),(t=Number(t))>0)){o.classList.add("wptb-importPBarContainerActive");var i=o.querySelector(".wptb-nameProcessInBarProgress");if(i){var l,s="";"import"==r?l=document.querySelector(".wptb-importFromPlugin"):"replace"==r&&(l=document.querySelector(".wptb-importTableReplaceShortcodes")),l&&(s=l.dataset.name)&&(i.innerHTML=s),s||(i.innerHTML="")}var c=(e/t*100).toFixed(2);return c>100&&(c=100),a.innerHTML="".concat(c,"%"),n.style.width=c<3?"3%":"".concat(c,"%"),100==c&&setTimeout(function(){o.classList.remove("wptb-importPBarContainerActive"),r=r?":".concat(r):"",WPTB_Helper.wptbDocumentEventGenerate("wptb-import:progressBar:full".concat(r),o)},2e3),c}}function c(e,t){if(e&&Array.isArray(e)&&e.length>0){t&&(window.wptbImportShortcodesNecessaryReplace=e.length,window.wptbImportShortcodesReplacedCount=0,s(0,window.wptbImportShortcodesNecessaryReplace,"replace"));var o=new XMLHttpRequest,n="".concat(r.ajaxUrl,"?action=shortcodes_replace"),a={replacing_shortcodes:e.shift(),security_code:r.security_code};a=JSON.stringify(a),o.open("POST",n,!0),o.setRequestHeader("Content-type","application/json; charset=utf-8"),o.onreadystatechange=function(t){if(4==this.readyState&&200==this.status){var r=JSON.parse(o.responseText),n=window.wptbImportShortcodesNecessaryReplace,a=window.wptbImportShortcodesNecessaryReplace-e.length,i=0;if(r&&Array.isArray(r)&&"success"==r[0]?(i=s(a,n,"replace"),window.wptbImportShortcodesReplacedCount?window.wptbImportShortcodesReplacedCount+=r[1]:window.wptbImportShortcodesReplacedCount=r[1]):i=s(n,n,"replace"),100==i){WPTB_Helper.wptbDocumentEventGenerate("table:shortcode:replace",document,window.wptbImportShortcodesReplacedCount);var l=document.querySelector(".wptb-importPBarContainer");l&&l.addEventListener("wptb-import:progressBar:full:replace",function(){var e=document.querySelector(".wptb-importedTablesShortcodesReplaced");if(e){e.style.display="block";var t=document.querySelector(".wptb-importedShortcodesReplaceCount span");t&&(window.wptbImportShortcodesReplacedCount?t.innerHTML=window.wptbImportShortcodesReplacedCount:t.innerHTML="0")}},!1)}else c(e)}},o.send(a)}}function d(e,t){for(var r=[],o=0;o<e.length;o++)if(1==e[o].nodeType||3==e[o].nodeType){var n=document.createElement("div");if(1==e[o].nodeType)if("img"===e[o].nodeName.toLowerCase()){e[o].style.width="100%",e[o].removeAttribute("class"),n.classList.add("wptb-image-container","wptb-ph-element","wptb-element-image-".concat(t.imageElemIndex)),n.innerHTML="".concat('<div class="wptb-image-wrapper"><a style="display: block;" target="_blank" rel="nofollow">').concat(e[o].outerHTML,"</a>")+"</div>";var a=n.querySelector("img");a&&(a.style.width="100%"),t.imageElemIndex++}else"wptb_shortcode_container_element"===e[o].nodeName.toLowerCase()?(n.classList.add("wptb-shortcode-container","wptb-ph-element","wptb-element-shortcode-".concat(t.customHtmlElemIndex)),n.innerHTML="<wptb_shortcode_container_element><div>".concat(e[o].innerHTML,"</div></wptb_shortcode_container_element>"),t.customHtmlElemIndex++):(n.classList.add("wptb-html-container","wptb-ph-element","wptb-element-custom_html-".concat(t.customHtmlElemIndex)),n.innerHTML='<div class="wptb-custom-html-wrapper" data-wptb-new-element="1">'.concat(e[o].outerHTML,"</div>"),t.customHtmlElemIndex++);else if(3==e[o].nodeType){n.classList.add("wptb-text-container","wptb-ph-element","wptb-element-text-".concat(t.textElemIndex)),n.innerHTML="<div><p>".concat(e[o].nodeValue,"</p></div>");var i=n.querySelector("p");if(i){var l=WPTB_Helper.checkSetGetStyleSizeValue(i,"font-size","font-size");l&&WPTB_Helper.checkingDimensionValue(l,"px")&&(i.style.fontSize=null,n.style.fontSize=l);var s=WPTB_Helper.checkSetGetStyleColorValue(i,"color","color");s&&(WPTB_Helper.isHex(s)?(i.style.color=null,n.style.color=s):WPTB_Helper.rgbToHex(s)&&(i.style.color=null,s=WPTB_Helper.rgbToHex(s),n.style.color=s))}t.textElemIndex++}r.push(n)}return[r,t]}return{importFromFile:function(){if(r.file){var e=/^([a-zA-Z0-9()\s_\\.\-:])+(.csv)$/.test(r.file.name.toLowerCase()),t=/^([a-zA-Z0-9()\s_\\.\-:])+(.xml)$/.test(r.file.name.toLowerCase()),a=(/^([a-zA-Z0-9()\s_\\.\-:])+(.html)$/.test(r.file.name.toLowerCase()),/^([a-zA-Z0-9()\s_\\.\-:])+(.zip)$/.test(r.file.name.toLowerCase())),i=r.file;if(a){var l=new XMLHttpRequest,s="".concat(r.ajaxUrl,"?action=zip_unpacker"),c=new FormData;c.append("file",i,"csv_zip.zip"),c.append("security_code",r.nonce),l.open("POST",s,!0),l.onreadystatechange=function(e){if(4==this.readyState&&200==this.status){var t=l.responseText;if("unsuccess"===JSON.parse(t)[0])return void WPTB_Helper.wptbDocumentEventGenerate("table:imported:error",document);if(t&&(t=JSON.parse(t)),t&&Array.isArray(t)&&"success"==t[0]&&t[1]&&Array.isArray(t[1])){for(var r=[],a=[],i=0;i<t[1].length;i++)switch(t[1][i][0]){case"csv":r.push(t[1][i][1]);break;case"xml":a.push(t[1][i][1])}r.length>0?n(r,0):a.length>0?o(a):WPTB_Helper.wptbDocumentEventGenerate("table:imported:error",document,{message:"invalid file type"})}}},l.send(c)}else if(e||t)if("undefined"!=typeof FileReader){var d,p=new FileReader;p.onload=function(r){d=r.target.result,e?n([d],0):t&&o([d])},p.readAsText(i)}else alert("This browser does not support HTML5.");else alert("Please upload a valid file.")}},importFromPlugin:function(e){var t,o,n;e&&"table-press"===e&&(t=new XMLHttpRequest,o="".concat(r.ajaxUrl,"?action=import_tables"),n={import_plugin_name:"table-press",security_code:r.security_code},n=JSON.stringify(n),t.open("POST",o,!0),t.setRequestHeader("Content-type","application/json; charset=utf-8"),t.onreadystatechange=function(e){if(4==this.readyState&&200==this.status){var r=JSON.parse(t.responseText);if(r&&Array.isArray(r))if("success"==r[0]){if(r[1]&&Array.isArray(r[1])){var o=document.getElementById("wptb-importIframeSection");if(o){var n=document.createElement("iframe");o.innerHTML="",o.appendChild(n),window.wptbImportCommonCountTables=r[1].length,window.wptbImportConvertationShortcodes&&delete window.wptbImportConvertationShortcodes,l(n,r[1])}}}else r[1]&&WPTB_Helper.wptbDocumentEventGenerate("table:imported:error",document,r[1])}},t.send(n))},replaceShortcodesAjax:c}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var s=l;exports.default=s;
40
  },{}],"ACYA":[function(require,module,exports) {
41
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("../components/DragDrop.vue")),t=o(require("../components/ControlItem.vue")),s=o(require("../components/MenuButton.vue")),i=o(require("../functions/importOperations.js")),r=o(require("../mixins/withMessage"));function o(e){return e&&e.__esModule?e:{default:e}}var n={props:["options"],mixins:[r.default],components:{DragDrop:e.default,ControlItem:t.default,MenuButton:s.default},data:function(){return{settings:{responsiveTables:!1,topRowAsHeader:!1,csvDelimiter:","},fieldsData:[],currentFile:null,fetching:!1}},mounted:function(){var e=this;document.addEventListener("table:imported:saved",function(){e.currentFile=null,e.setMessage({type:"ok",message:e.strings.tableImported}),e.setBusy(!1)}),document.addEventListener("table:imported:error",function(){e.currentFile=null,e.setMessage({type:"error",message:e.strings.errorOccured}),e.setBusy(!1)}),this.fieldsData.push({type:"dropdown",id:"csvDelimiter",modelBind:this.settings,label:this.strings.csvDelimiter,options:[{value:",",label:", (comma)"},{value:";",label:"; (semicolon)"},{value:"tab",label:"\\t (tabular)"}]},{type:"checkbox",id:"responsiveTables",modelBind:this.settings,label:this.strings.tableResponsive},{type:"checkbox",id:"topRowAsHeader",modelBind:this.settings,label:this.strings.topRowHeader})},computed:{isImportDisabled:function(){return null===this.currentFile||this.fetching}},methods:{importFromFile:function(){if(null!==this.currentFile){var e={file:this.currentFile,ajaxUrl:this.options.ajaxUrl,nonce:this.options.security_code,delimiter:this.settings.csvDelimiter,tableResponsive:this.settings.responsiveTables,topRowAsHeader:this.settings.topRowAsHeader},t=(0,i.default)(e);this.setBusy(),t.importFromFile()}}}};exports.default=n;
42
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("drag-drop",{attrs:{texts:{hint:t.strings.fileDropHint,browse:t.strings.browse,clear:t.strings.clear},"allowed-formats":["csv","xml","zip"]},model:{value:t.currentFile,callback:function(e){t.currentFile=e},expression:"currentFile"}}),t._v(" "),r("div",t._l(t.fieldsData,function(t){return r("control-item",{key:t.id,attrs:{"field-data":t,"model-bind":t.modelBind}})}),1),t._v(" "),r("portal",{attrs:{to:"footerButtons"}},[r("menu-button",{attrs:{disabled:t.isImportDisabled},on:{click:t.importFromFile}},[t._v(t._s(t.strings.importSection)+" ")])],1)],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
43
- },{"../components/DragDrop.vue":"vU4o","../components/ControlItem.vue":"yXWm","../components/MenuButton.vue":"ksMR","../functions/importOperations.js":"bsz0","../mixins/withMessage":"wm3G"}],"CDb8":[function(require,module,exports) {
44
  "use strict";function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(n){e(t,n,r[n])})}return t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Plugin=exports.SSR=exports.Fragment=exports.default=void 0;var n=function(e,t,n){Object.defineProperty(e,t,{configurable:!0,get:function(){return n},set:function(e){console.warn("tried to set frozen property ".concat(t," with ").concat(e))}})},r=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;Object.defineProperty(e,t,{configurable:!0,writable:!0,value:n})},o={abstract:!0,name:"Fragment",props:{name:{type:String,default:function(){return Math.floor(Date.now()*Math.random()).toString(16)}}},mounted:function(){var e=this.$el,t=e.parentNode,o=document.createComment("fragment#".concat(this.name,"#head")),i=document.createComment("fragment#".concat(this.name,"#tail"));t.insertBefore(o,e),t.insertBefore(i,e),e.appendChild=function(r){t.insertBefore(r,i),n(r,"parentNode",e)},e.insertBefore=function(r,o){t.insertBefore(r,o),n(r,"parentNode",e)},e.removeChild=function(e){t.removeChild(e),r(e,"parentNode")},Array.from(e.childNodes).forEach(function(t){return e.appendChild(t)}),t.removeChild(e),n(e,"parentNode",t),n(e,"nextSibling",i.nextSibling);var a=t.insertBefore;t.insertBefore=function(n,r){a.call(t,n,r!==e?r:o)};var c=t.removeChild;t.removeChild=function(n){if(n===e){for(;o.nextSibling!==i;)e.removeChild(o.nextSibling);t.removeChild(o),t.removeChild(i),r(e,"parentNode"),t.insertBefore=a,t.removeChild=c}else c.call(t,n)}},render:function(e){var n=this,r=this.$slots.default;return r&&r.length&&r.forEach(function(e){return e.data=t({},e.data,{attrs:t({fragment:n.name},(e.data||{}).attrs)})}),e("div",{attrs:{fragment:this.name}},r)}};function i(e,t){}var a=o,c=i,f={install:function(e){e.component("fragment",o)}},l={Fragment:o,Plugin:f,SSR:i};exports.Plugin=f,exports.SSR=c,exports.Fragment=a;var u=l;exports.default=u;
45
  },{}],"pxbx":[function(require,module,exports) {
46
  function e(e,n){var r,t,l=0;function u(){var u,v,a=r,p=arguments.length;e:for(;a;){if(a.args.length===arguments.length){for(v=0;v<p;v++)if(a.args[v]!==arguments[v]){a=a.next;continue e}return a!==r&&(a===t&&(t=a.prev),a.prev.next=a.next,a.next&&(a.next.prev=a.prev),a.next=r,a.prev=null,r.prev=a,r=a),a.val}a=a.next}for(u=new Array(p),v=0;v<p;v++)u[v]=arguments[v];return a={args:u,val:e.apply(null,u)},r?(r.prev=a,a.next=r):t=a,l===n.maxSize?(t=t.prev).next=null:l++,r=a,a.val}return n=n||{},u.clear=function(){r=null,t=null,l=0},u}module.exports=e;
@@ -69,32 +75,35 @@ var e;!function(){"use strict";var r={not_string:/[^s]/,not_bool:/[^t]/,not_type
69
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={sprintf:!0,setLocaleData:!0,__:!0,_x:!0,_n:!0,_nx:!0,isRTL:!0};Object.defineProperty(exports,"sprintf",{enumerable:!0,get:function(){return t.sprintf}}),Object.defineProperty(exports,"setLocaleData",{enumerable:!0,get:function(){return n.setLocaleData}}),Object.defineProperty(exports,"__",{enumerable:!0,get:function(){return n.__}}),Object.defineProperty(exports,"_x",{enumerable:!0,get:function(){return n._x}}),Object.defineProperty(exports,"_n",{enumerable:!0,get:function(){return n._n}}),Object.defineProperty(exports,"_nx",{enumerable:!0,get:function(){return n._nx}}),Object.defineProperty(exports,"isRTL",{enumerable:!0,get:function(){return n.isRTL}});var t=require("./sprintf"),r=require("./create-i18n");Object.keys(r).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return r[t]}}))});var n=require("./default-i18n");
70
  },{"./sprintf":"jmTT","./create-i18n":"bf97","./default-i18n":"C7H9"}],"FPuA":[function(require,module,exports) {
71
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("vue-fragment"),t=require("@wordpress/i18n"),r=s(require("../components/MenuButton.vue")),n=s(require("../functions/importOperations.js")),o=s(require("../mixins/withMessage"));function s(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){u(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var c={props:["options"],mixins:[o.default],components:{MenuButton:r.default,Fragment:e.Fragment},data:function(){return{supportedPlugins:{"table-press":"TablePress"},importedTables:{},selectedReplaceRows:[]}},watch:{fetching:function(e){this.$emit("fetching",e)}},mounted:function(){var e=this;document.addEventListener("table:imported:saved",function(t){var r=t.detail;e.setMessage({type:"ok",message:e.isDocumentEventPoorlyImplemented(r)?e.strings.operationSuccess:r}),e.setBusy(!1)}),document.addEventListener("table:imported:error",function(t){var r=t.detail;e.setMessage({type:"error",message:e.isDocumentEventPoorlyImplemented(r)?e.strings.errorOccured:r}),e.setBusy(!1)}),document.addEventListener("table:imported:list",function(t){var r=t.detail;e.setBusy(!1),e.importedTables=r}),document.addEventListener("table:shortcode:replace",function(t){var r=t.detail;e.setMessage({type:"ok",message:"".concat(e.strings.replacedShortcodes,": ").concat(!0===r?0:r)}),e.setBusy(!1)})},methods:{isDocumentEventPoorlyImplemented:function(e){return"boolean"==typeof e},handleImportFromPlugin:function(e){var t=(0,n.default)(a({},this.options,{type:e}));this.setBusy(),t.importFromPlugin(e)},selectAllCheckbox:function(e){this.selectedReplaceRows===this.importedTables[e]?this.selectedReplaceRows=[]:this.selectedReplaceRows=this.importedTables[e]},replaceShortcodes:function(){if(0!==this.selectedReplaceRows.length){var e=this.selectedReplaceRows.map(function(e){return{search:e[0],replace:e[1]}}),t=(0,n.default)(this.options);this.setBusy(),t.replaceShortcodesAjax(e,!0)}},importButtonText:function(e){return(0,t.sprintf)((0,t._x)("import from %s","%s is a format variable for a name of WordPress plugin",this.options.textDomain),e)},importedTablesCountInfo:function(e){return(0,t.sprintf)((0,t._nx)("%u table imported","%u tables imported","number of tables imported",this.options.textDomain),this.importedTables[e].length)},isPluginInstalled:function(e){return this.options.installedSupportedPlugins.includes(e)}},computed:{showImportedTables:function(){var e=this,t=Object.keys(this.importedTables).map(function(t){return Object.prototype.hasOwnProperty.call(e.importedTables,t)?t:null});return!!Array.isArray(t)&&t.length>0}}};exports.default=c;
72
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[t._l(t.supportedPlugins,function(e,a){return s("menu-button",{key:a,staticClass:"wptb-text-transform-cap",attrs:{disabled:!t.isPluginInstalled(e)||t.isBusy(),title:t.isPluginInstalled(e)?"":t.getTranslation("plugin not installed")},on:{click:function(e){return t.handleImportFromPlugin(a)}}},[t._v(" "+t._s(t.importButtonText(e))+" ")])}),t._v(" "),s("div",{staticStyle:{display:"none"},attrs:{id:"wptb-importIframeSection"}}),t._v(" "),s("transition",{attrs:{name:"wptb-fade",mode:"out-in"}},[t.showImportedTables?s("div",{staticClass:"wptb-flex wptb-flex-align-center wptb-flex-col"},[s("div",{staticClass:"wptb-import-tables-wrapper"},t._l(t.importedTables,function(e,a){return s("div",{key:a,staticClass:"wptb-import-tables-list"},[s("div",{staticClass:"wptb-import-table-count-info"},[t._v(t._s(t.importedTablesCountInfo(a)))]),t._v(" "),s("table",{staticClass:"wptb-import-table"},[s("thead",[s("tr",[s("th",[s("input",{attrs:{type:"checkbox"},on:{click:function(e){return t.selectAllCheckbox(a)}}})]),t._v(" "),s("th",{staticClass:"wptb-text-transform-cap"},[t._v(" "+t._s(t.supportedPlugins[a])+" ")]),t._v(" "),s("th",{staticClass:"wptb-text-transform-cap"},[t._v(" wp table builder ")])])]),t._v(" "),s("tbody",t._l(e,function(e){return s("fragment",{key:e[0]},[s("tr",[s("td",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.selectedReplaceRows,expression:"selectedReplaceRows"}],attrs:{type:"checkbox"},domProps:{value:e,checked:Array.isArray(t.selectedReplaceRows)?t._i(t.selectedReplaceRows,e)>-1:t.selectedReplaceRows},on:{change:function(s){var a=t.selectedReplaceRows,i=s.target,l=!!i.checked;if(Array.isArray(a)){var r=e,c=t._i(a,r);i.checked?c<0&&(t.selectedReplaceRows=a.concat([r])):c>-1&&(t.selectedReplaceRows=a.slice(0,c).concat(a.slice(c+1)))}else t.selectedReplaceRows=l}}})]),t._v(" "),s("td",[t._v(" "+t._s(e[0])+" ")]),t._v(" "),s("td",[t._v(" "+t._s(e[1])+" ")])])])}),1)])])}),0),t._v(" "),s("menu-button",{staticClass:"wptb-text-transform-cap",attrs:{disabled:0===t.selectedReplaceRows.length,size:"small"},on:{click:t.replaceShortcodes}},[t._v(" "+t._s(t.getTranslation("replace short codes"))+" ")])],1):t._e()]),t._v(" "),t._m(0)],2)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"wptb-importPBarContainer",staticStyle:{visibility:"hidden"}},[e("div",{staticClass:"wptb-importPBarProgress"},[e("div",{staticClass:"wptb-nameProcessInBarProgress"}),this._v(" "),e("div",{attrs:{id:"wptb-pBarPercent"}},[e("span",[this._v("0%")])])])])}],_compiled:!0,_scopeId:null,functional:void 0});})();
73
- },{"vue-fragment":"CDb8","@wordpress/i18n":"e20f","../components/MenuButton.vue":"ksMR","../functions/importOperations.js":"bsz0","../mixins/withMessage":"wm3G"}],"qRIs":[function(require,module,exports) {
74
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("../components/Sections.vue")),t=r(require("../components/SectionItem.vue")),n=r(require("../components/MenuContent.vue")),u=r(require("./CSVImportMenu.vue")),o=r(require("./PluginsImportMenu.vue"));function r(e){return e&&e.__esModule?e:{default:e}}var c={props:["options"],components:{Sections:e.default,SectionItem:t.default,MenuContent:n.default},data:function(){return{currentSection:"csv"}},methods:{setSection:function(e){this.currentSection!==e&&(this.currentSection=e)}},computed:{currentTemplate:function(){return"csv"===this.currentSection?u.default:o.default}}};exports.default=c;
75
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("portal",{attrs:{to:"childSections"}},[n("sections",{attrs:{child:!0,items:["csv",t.strings.plugins]},model:{value:t.currentSection,callback:function(e){t.currentSection=e},expression:"currentSection"}})],1),t._v(" "),n("menu-content",{attrs:{center:!0}},[n(t.currentTemplate,{tag:"component",staticClass:"wptb-flex wptb-flex-col wptb-flex-align-center",attrs:{options:t.options}})],1)],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
76
- },{"../components/Sections.vue":"yPIx","../components/SectionItem.vue":"bosS","../components/MenuContent.vue":"vTRD","./CSVImportMenu.vue":"ACYA","./PluginsImportMenu.vue":"FPuA"}],"BOOO":[function(require,module,exports) {
77
 
78
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"wptb-menu-empty-cover"},[this._t("default")],2)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
79
- },{}],"UuSu":[function(require,module,exports) {
80
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={props:["message"],data:function(){return{top:0,left:0}},mounted:function(){this.calculatePopupPosition()},methods:{toPx:function(t){return"".concat(t,"px")},calculatePopupPosition:function(){var t=this.$refs.wrapper.getBoundingClientRect(),e=this.$refs.popup.getBoundingClientRect(),o=this.$refs.arrow.getBoundingClientRect();this.left=this.toPx(t.left-e.width/2+t.width/2),this.top=this.toPx(t.top-(e.height+o.height/2))}}};exports.default=t;
81
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,p=e._self._c||t;return p("div",[p("div",{ref:"wrapper",staticClass:"wptb-menu-popup-wrapper",on:{mouseover:e.calculatePopupPosition}},[e._t("default")],2),e._v(" "),p("div",{ref:"popup",staticClass:"wptb-menu-popup-message",style:{top:e.top,left:e.left}},[p("div",{staticClass:"wptb-menu-popup-inner-holder"},[p("div",{ref:"arrow",staticClass:"wptb-menu-popup-arrow"}),e._v(" "),p("span",{domProps:{innerHTML:e._s(e.message)}})])])])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
82
- },{}],"hl0g":[function(require,module,exports) {
83
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={props:["label","index"],data:function(){return{currentDirection:1}},methods:{sort:function(){this.currentDirection*=-1,this.$emit("sort",this.index,this.currentDirection)}}};exports.default=t;
84
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("td",{on:{click:function(t){return t.preventDefault(),e.sort(t)}}},[e._v(" "+e._s(e.label)+"\n")])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
85
- },{}],"AF9R":[function(require,module,exports) {
86
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e(require("./ColumnSort"));function e(t){return t&&t.__esModule?t:{default:t}}var o={props:{rowLabels:Array,rowData:Array,modelBind:Object,sortType:Object},components:{ColumnSort:t.default},data:function(){return{innerRowData:[],sortOptions:{index:0,direction:1}}},watch:{rowData:function(t){this.innerRowData=t,this.sortOptions&&this.sort(this.sortOptions.index,this.sortOptions.direction)}},methods:{sort:function(t,e){this.sortOptions.index=t,this.sortOptions.direction=e;var o,r={dateSort:function(o,r){var a=0,s=new Date(o.fieldDatas[t].toLowerCase()).getTime(),i=new Date(r.fieldDatas[t].toLowerCase()).getTime();return s<i&&(a=1),s>i&&(a=-1),a*e},defaultSort:function(o,r){var a=0,s=o.fieldDatas[t].toLowerCase(),i=r.fieldDatas[t].toLowerCase();return s<i&&(a=1),s>i&&(a=-1),a*e}},a=this.sortType[t];o=a&&r["".concat(a,"Sort")]?r["".concat(a,"Sort")]:r.defaultSort,this.innerRowData.sort(o)}}};exports.default=o;
87
- (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("table",{staticClass:"wptb-menu-list-table"},[n("thead",[n("tr",[n("td"),e._v(" "),e._l(e.rowLabels,function(t,o){return n("column-sort",{key:t,attrs:{label:t,index:o},on:{sort:e.sort}})})],2)]),e._v(" "),n("transition-group",{attrs:{tag:"tbody",name:"wptb-fade",mode:"out-in"}},e._l(e.innerRowData,function(t){return n("tr",{key:t.ID},[n("td",[n("input",{directives:[{name:"model",rawName:"v-model",value:e.modelBind[t.ID],expression:"modelBind[row.ID]"}],attrs:{id:t.ID,type:"checkbox"},domProps:{checked:Array.isArray(e.modelBind[t.ID])?e._i(e.modelBind[t.ID],null)>-1:e.modelBind[t.ID]},on:{change:function(n){var o=e.modelBind[t.ID],r=n.target,d=!!r.checked;if(Array.isArray(o)){var i=e._i(o,null);r.checked?i<0&&e.$set(e.modelBind,t.ID,o.concat([null])):i>-1&&e.$set(e.modelBind,t.ID,o.slice(0,i).concat(o.slice(i+1)))}else e.$set(e.modelBind,t.ID,d)}}})]),e._v(" "),e._l(t.fieldDatas,function(o){return n("td",{key:o},[n("label",{attrs:{for:t.ID}},[e._v(e._s(o))])])})],2)}),0)],1)])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
88
- },{"./ColumnSort":"hl0g"}],"UipM":[function(require,module,exports) {
89
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=i(require("../components/MenuButton")),t=i(require("../components/ControlItem")),r=i(require("../components/EmptyCover")),n=i(require("../components/PopUp")),o=i(require("../components/ListTable")),s=i(require("../mixins/withMessage"));function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach(function(t){c(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var u={props:["options","pluginInfo"],mixins:[s.default],components:{ListTable:o.default,PopUp:n.default,MenuButton:e.default,ControlItem:t.default,EmptyCover:r.default},data:function(){return{userTables:[],selectedTables:{},exportType:"CSV",exportTypeControlOptions:{id:"exportType",type:"dropdown",label:"export type",options:[{label:"csv",value:"CSV"},{label:"xml",value:"XML"}]},filename:""}},mounted:function(){this.getUserTables()},computed:{exportTypeDescription:function(){var e={csvDescription:"<b>CSV:</b> ".concat(this.getTranslation("only text content of your tables will be exported, ideal for usage within other apps/plugins.")),xmlDescription:"<b>XML:</b> ".concat(this.getTranslation("an exact copy of your tables will be exported, ideal for backing up and sharing your tables with your other WordPress sites that uses WP Table Builder."))};return this.getTranslation(e["".concat(this.exportType.toLowerCase(),"Description")])},remainingTables:function(){var e=this;return this.userTables.filter(function(t){return!e.selectedTables[t.ID]})},parsedSelectedTables:function(){var e=this;return this.userTables.filter(function(t){return e.selectedTables[t.ID]})},exportDisabled:function(){return this.isBusy()||this.isSelectedEmpty()}},methods:{selectAll:function(){var e={};this.userTables.map(function(t){e[t.ID]=!0}),this.selectedTables=l({},this.selectedTables,{},e)},deselectAll:function(){this.selectedTables={}},isSelectedEmpty:function(){var e=this;return!Object.keys(this.selectedTables).filter(function(t){return!!Object.prototype.hasOwnProperty.call(e.selectedTables,t)&&e.selectedTables[t]}).length>0},getSelectedIds:function(){var e=this,t=[];return Object.keys(this.selectedTables).map(function(r){Object.prototype.hasOwnProperty.call(e.selectedTables,r)&&e.selectedTables[r]&&t.push(r)}),t},fieldLabel:function(e){return""===e.post_title?"Table #".concat(e.ID):e.post_title},getUserTables:function(){var e=this,t=this.options,r=t.ajaxUrl,n=t.fetchNonce,o=t.fetchAjaxAction,s=new FormData;s.append("nonce",n),s.append("action",o),this.setBusy(),fetch(r,{method:"POST",body:s}).then(function(t){if(t.ok)return t.json();throw new Error(e.getTranslation("an error occurred, try again later"))}).then(function(t){if(t.error)throw new Error(t.error);var r=[];e.userTables=t.data.userTables.map(function(t){var n=new Intl.DateTimeFormat("default",{year:"numeric",month:"long",day:"numeric"}).format(new Date(t.post_date)),o={ID:t.ID,fieldDatas:[e.fieldLabel(t),n,t.ID]};r.push(o)}),e.userTables=r}).catch(function(t){e.setMessage({type:"error",message:t})}).finally(function(){e.setBusy(!1)})},parseFilename:function(e){var t=new RegExp(/filename="(.+\..+)"/,"g").exec(e);if(null===t)throw new Error(this.getTranslation("invalid file name header"));return t[1]},exportTables:function(){var e=this,t=this.options,r=t.ajaxUrl,n=t.exportAjaxAction,o=t.exportNonce,s=new FormData;s.append("nonce",o),s.append("action",n),s.append("ids",JSON.stringify(this.getSelectedIds())),s.append("export_type",this.exportType),this.setBusy(),fetch(r,{method:"POST",body:s}).then(function(t){if(t.ok)return"application/octet-stream"===t.headers.get("content-type")?(e.filename=e.parseFilename(t.headers.get("content-disposition")),t.blob()):t.json();throw new Error(e.getTranslation("an error occurred, try again later"))}).then(function(t){if(t.error)throw new Error(t.error);var r=window.URL.createObjectURL(t);e.$refs.filesave.href=r,e.$refs.filesave.click(),window.URL.revokeObjectURL(r),e.resetSelections()}).catch(function(t){e.setMessage({type:"error",message:t})}).finally(function(){e.setBusy(!1)})},resetSelections:function(){this.selectedTables=[]}}};exports.default=u;
90
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"wptb-menu-export-wrapper"},[s("div",{staticClass:"wptb-menu-export-card"},[s("div",{staticClass:"wptb-menu-export-control-title"},[t._v(t._s(t.getTranslation("all tables")))]),t._v(" "),s("list-table",{attrs:{"row-labels":["Title","Created","ID"].map(t.getTranslation),"row-data":t.remainingTables,"model-bind":t.selectedTables,"sort-type":{1:"date"}}}),t._v(" "),s("empty-cover",{directives:[{name:"show",rawName:"v-show",value:!t.userTables.length>0,expression:"!userTables.length > 0"}]},[t._v(" "+t._s(t.getTranslation("no tables found"))+" ")])],1),t._v(" "),s("div",{staticClass:"wptb-menu-export-middle-section"},[s("div",{staticClass:"arrow-holder"},[s("img",{attrs:{src:t.pluginInfo.plainArrow,title:t.getTranslation("select all"),alt:t.getTranslation("arrow")},on:{click:function(e){return e.preventDefault(),t.selectAll(e)}}})]),t._v(" "),s("div",[s("control-item",{staticClass:"wptb-flex wptb-flex-align-center wptb-flex-justify-center",attrs:{"field-data":t.exportTypeControlOptions,"model-bind":this}},[s("pop-up",{attrs:{message:t.exportTypeDescription}},[t._v("?")])],1)],1),t._v(" "),s("div",{staticClass:"arrow-holder flip"},[s("img",{attrs:{src:t.pluginInfo.plainArrow,title:t.getTranslation("deselect all"),alt:t.getTranslation("arrow")},on:{click:function(e){return e.preventDefault(),t.deselectAll(e)}}})])]),t._v(" "),s("div",{staticClass:"wptb-menu-export-card"},[s("div",{staticClass:"wptb-menu-export-control-title",staticStyle:{"text-align":"end"}},[t._v(" "+t._s(t.getTranslation("selected tables"))+" ")]),t._v(" "),s("list-table",{attrs:{"row-labels":["Title","Created","ID"].map(t.getTranslation),"row-data":t.parsedSelectedTables,"model-bind":t.selectedTables,"sort-type":{1:"date"}}}),t._v(" "),s("empty-cover",{directives:[{name:"show",rawName:"v-show",value:t.isSelectedEmpty(),expression:"isSelectedEmpty()"}]},[t._v(" "+t._s(t.getTranslation("no table selected"))+" ")])],1),t._v(" "),s("portal",{attrs:{to:"footerButtons"}},[s("a",{ref:"filesave",staticStyle:{display:"none"},attrs:{download:t.filename}},[t._v("_filesave")]),t._v(" "),s("div",{staticClass:"wptb-settings-button-container"},[s("menu-button",{attrs:{disabled:t.isBusy()},on:{click:t.getUserTables}},[t._v(t._s(t.getTranslation("refresh")))]),t._v(" "),s("menu-button",{attrs:{disabled:t.exportDisabled},on:{click:t.exportTables}},[t._v(t._s(t.strings.exportSection))])],1)])],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
91
- },{"../components/MenuButton":"ksMR","../components/ControlItem":"yXWm","../components/EmptyCover":"BOOO","../components/PopUp":"UuSu","../components/ListTable":"AF9R","../mixins/withMessage":"wm3G"}],"l9Oj":[function(require,module,exports) {
92
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=c(require("../components/MenuHeader")),t=c(require("../components/Sections")),n=c(require("../components/SectionItem")),r=c(require("../components/MenuFooter")),o=c(require("../mixins/withMessage")),u=c(require("./ImportApp")),p=c(require("./ExportApp")),i=c(require("../components/MenuContent"));function c(e){return e&&e.__esModule?e:{default:e}}var s={props:["pluginInfo","options"],mixins:[o.default],components:{ExportApp:p.default,MenuContent:i.default,ImportApp:u.default,MenuHeader:e.default,SectionItem:n.default,Sections:t.default,MenuFooter:r.default},data:function(){return{currentSection:"Import"}},computed:{currentTemplate:function(){return"".concat(this.currentSection,"App")}}};exports.default=s;
93
- (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"wptb-settings-wrapper"},[n("menu-header",{attrs:{"logo-src":t.pluginInfo.logo,"logo-alt":t.strings.logoAlt,"plugin-name":t.pluginInfo.pluginName}},[n("a",{attrs:{href:t.pluginInfo.pluginHomepage}},[t._v(t._s(t.strings.homepage))])]),t._v(" "),n("sections",{attrs:{items:[t.strings.importSection,t.strings.exportSection]},model:{value:t.currentSection,callback:function(e){t.currentSection=e},expression:"currentSection"}},[n("portal-target",{attrs:{name:"childSections"}})],1),t._v(" "),n("menu-content",{attrs:{center:!0}},[n(t.currentTemplate,{tag:"component",attrs:{options:t.options,"plugin-info":t.pluginInfo}})],1),t._v(" "),n("menu-footer",[n("portal-target",{attrs:{name:"footerButtons"}})],1)],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0});})();
94
- },{"../components/MenuHeader":"vi91","../components/Sections":"yPIx","../components/SectionItem":"bosS","../components/MenuFooter":"nwtb","../mixins/withMessage":"wm3G","./ImportApp":"qRIs","./ExportApp":"UipM","../components/MenuContent":"vTRD"}],"yEip":[function(require,module,exports) {
95
  "use strict";function t(t,e){t.mixin({data:function(){return{strings:e.strings}}})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={install:t};exports.default=e;
96
  },{}],"XomE":[function(require,module,exports) {
97
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@wordpress/i18n");function t(t,r){var i=r.textDomain;t.mixin({methods:{getTranslation:function(t){return(0,e.__)(t,i)}}})}var r={install:t};exports.default=r;
98
  },{"@wordpress/i18n":"e20f"}],"NIwa":[function(require,module,exports) {
99
  "use strict";var e=u(require("vue")),t=u(require("portal-vue")),r=u(require("./containers/ImportExportApp")),n=u(require("./plugins/strings")),o=u(require("./plugins/translations"));function u(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=p({},wptbImportMenuData);wptbImportMenuData=void 0,e.default.config.productionTip=!1,e.default.use(n.default,{strings:s.strings}),e.default.use(o.default,{textDomain:s.options.textDomain}),e.default.use(t.default),new e.default({components:{ImportExportApp:r.default},data:{pluginInfo:s.pluginInfo,options:s.options}}).$mount("#wptb-import-menu");
100
- },{"vue":"HYXJ","portal-vue":"Lue2","./containers/ImportExportApp":"l9Oj","./plugins/strings":"yEip","./plugins/translations":"XomE"}]},{},["NIwa"], null)
 
 
 
3
  var e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=Object.freeze({});function n(e){return null==e}function r(e){return null!=e}function i(e){return!0===e}function o(e){return!1===e}function a(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function s(e){return null!==e&&"object"==typeof e}var c=Object.prototype.toString;function u(e){return c.call(e).slice(8,-1)}function l(e){return"[object Object]"===c.call(e)}function f(e){return"[object RegExp]"===c.call(e)}function p(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function d(e){return r(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function v(e){return null==e?"":Array.isArray(e)||l(e)&&e.toString===c?JSON.stringify(e,null,2):String(e)}function h(e){var t=parseFloat(e);return isNaN(t)?e:t}function m(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}var y=m("slot,component",!0),g=m("key,ref,slot,slot-scope,is");function _(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}var b=Object.prototype.hasOwnProperty;function $(e,t){return b.call(e,t)}function w(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var x=/-(\w)/g,C=w(function(e){return e.replace(x,function(e,t){return t?t.toUpperCase():""})}),A=w(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),k=/\B([A-Z])/g,O=w(function(e){return e.replace(k,"-$1").toLowerCase()});function S(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function T(e,t){return e.bind(t)}var N=Function.prototype.bind?T:S;function j(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function E(e,t){for(var n in t)e[n]=t[n];return e}function M(e){for(var t={},n=0;n<e.length;n++)e[n]&&E(t,e[n]);return t}function D(e,t,n){}var L=function(e,t,n){return!1},I=function(e){return e};function F(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}function P(e,t){if(e===t)return!0;var n=s(e),r=s(t);if(!n||!r)return!n&&!r&&String(e)===String(t);try{var i=Array.isArray(e),o=Array.isArray(t);if(i&&o)return e.length===t.length&&e.every(function(e,n){return P(e,t[n])});if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(i||o)return!1;var a=Object.keys(e),c=Object.keys(t);return a.length===c.length&&a.every(function(n){return P(e[n],t[n])})}catch(u){return!1}}function R(e,t){for(var n=0;n<e.length;n++)if(P(e[n],t))return n;return-1}function H(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}var B="data-server-rendered",U=["component","directive","filter"],z=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch"],V={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:L,isReservedAttr:L,isUnknownElement:L,getTagNamespace:D,parsePlatformTagName:I,mustUseProp:L,async:!0,_lifecycleHooks:z},J=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function K(e){var t=(e+"").charCodeAt(0);return 36===t||95===t}function q(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var W=new RegExp("[^"+J.source+".$_\\d]");function Z(e){if(!W.test(e)){var t=e.split(".");return function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e}}}var G,X="__proto__"in{},Y="undefined"!=typeof window,Q="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,ee=Q&&WXEnvironment.platform.toLowerCase(),te=Y&&window.navigator.userAgent.toLowerCase(),ne=te&&/msie|trident/.test(te),re=te&&te.indexOf("msie 9.0")>0,ie=te&&te.indexOf("edge/")>0,oe=te&&te.indexOf("android")>0||"android"===ee,ae=te&&/iphone|ipad|ipod|ios/.test(te)||"ios"===ee,se=te&&/chrome\/\d+/.test(te)&&!ie,ce=te&&/phantomjs/.test(te),ue=te&&te.match(/firefox\/(\d+)/),le={}.watch,fe=!1;if(Y)try{var pe={};Object.defineProperty(pe,"passive",{get:function(){fe=!0}}),window.addEventListener("test-passive",null,pe)}catch(Xl){}var de=function(){return void 0===G&&(G=!Y&&!Q&&void 0!==e&&(e.process&&"server"===e.process.env.VUE_ENV)),G},ve=Y&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function he(e){return"function"==typeof e&&/native code/.test(e.toString())}var me,ye="undefined"!=typeof Symbol&&he(Symbol)&&"undefined"!=typeof Reflect&&he(Reflect.ownKeys);me="undefined"!=typeof Set&&he(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ge,_e,be,$e,we=D,xe=D,Ce=D,Ae=D,ke=0,Oe=function(){this.id=ke++,this.subs=[]};Oe.prototype.addSub=function(e){this.subs.push(e)},Oe.prototype.removeSub=function(e){_(this.subs,e)},Oe.prototype.depend=function(){Oe.target&&Oe.target.addDep(this)},Oe.prototype.notify=function(){var e=this.subs.slice();for(var t=0,n=e.length;t<n;t++)e[t].update()},Oe.target=null;var Se=[];function Te(e){Se.push(e),Oe.target=e}function Ne(){Se.pop(),Oe.target=Se[Se.length-1]}var je=function(e,t,n,r,i,o,a,s){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},Ee={child:{configurable:!0}};Ee.child.get=function(){return this.componentInstance},Object.defineProperties(je.prototype,Ee);var Me=function(e){void 0===e&&(e="");var t=new je;return t.text=e,t.isComment=!0,t};function De(e){return new je(void 0,void 0,void 0,String(e))}function Le(e){var t=new je(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}var Ie=Array.prototype,Fe=Object.create(Ie),Pe=["push","pop","shift","unshift","splice","sort","reverse"];Pe.forEach(function(e){var t=Ie[e];q(Fe,e,function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var i,o=t.apply(this,n),a=this.__ob__;switch(e){case"push":case"unshift":i=n;break;case"splice":i=n.slice(2)}return i&&a.observeArray(i),a.dep.notify(),o})});var Re=Object.getOwnPropertyNames(Fe),He=!0;function Be(e){He=e}var Ue=function(e){this.value=e,this.dep=new Oe,this.vmCount=0,q(e,"__ob__",this),Array.isArray(e)?(X?ze(e,Fe):Ve(e,Fe,Re),this.observeArray(e)):this.walk(e)};function ze(e,t){e.__proto__=t}function Ve(e,t,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];q(e,o,t[o])}}function Je(e,t){var n;if(s(e)&&!(e instanceof je))return $(e,"__ob__")&&e.__ob__ instanceof Ue?n=e.__ob__:He&&!de()&&(Array.isArray(e)||l(e))&&Object.isExtensible(e)&&!e._isVue&&(n=new Ue(e)),t&&n&&n.vmCount++,n}function Ke(e,t,n,r,i){var o=new Oe,a=Object.getOwnPropertyDescriptor(e,t);if(!a||!1!==a.configurable){var s=a&&a.get,c=a&&a.set;s&&!c||2!==arguments.length||(n=e[t]);var u=!i&&Je(n);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=s?s.call(e):n;return Oe.target&&(o.depend(),u&&(u.dep.depend(),Array.isArray(t)&&Ze(t))),t},set:function(t){var r=s?s.call(e):n;t===r||t!=t&&r!=r||s&&!c||(c?c.call(e,t):n=t,u=!i&&Je(t),o.notify())}})}}function qe(e,t,n){if(Array.isArray(e)&&p(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var r=e.__ob__;return e._isVue||r&&r.vmCount?n:r?(Ke(r.value,t,n),r.dep.notify(),n):(e[t]=n,n)}function We(e,t){if(Array.isArray(e)&&p(t))e.splice(t,1);else{var n=e.__ob__;e._isVue||n&&n.vmCount||$(e,t)&&(delete e[t],n&&n.dep.notify())}}function Ze(e){for(var t=void 0,n=0,r=e.length;n<r;n++)(t=e[n])&&t.__ob__&&t.__ob__.dep.depend(),Array.isArray(t)&&Ze(t)}Ue.prototype.walk=function(e){for(var t=Object.keys(e),n=0;n<t.length;n++)Ke(e,t[n])},Ue.prototype.observeArray=function(e){for(var t=0,n=e.length;t<n;t++)Je(e[t])};var Ge=V.optionMergeStrategies;function Xe(e,t){if(!t)return e;for(var n,r,i,o=ye?Reflect.ownKeys(t):Object.keys(t),a=0;a<o.length;a++)"__ob__"!==(n=o[a])&&(r=e[n],i=t[n],$(e,n)?r!==i&&l(r)&&l(i)&&Xe(r,i):qe(e,n,i));return e}function Ye(e,t,n){return n?function(){var r="function"==typeof t?t.call(n,n):t,i="function"==typeof e?e.call(n,n):e;return r?Xe(r,i):i}:t?e?function(){return Xe("function"==typeof t?t.call(this,this):t,"function"==typeof e?e.call(this,this):e)}:t:e}function Qe(e,t){var n=t?e?e.concat(t):Array.isArray(t)?t:[t]:e;return n?et(n):n}function et(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}function tt(e,t,n,r){var i=Object.create(e||null);return t?E(i,t):i}Ge.data=function(e,t,n){return n?Ye(e,t,n):t&&"function"!=typeof t?e:Ye(e,t)},z.forEach(function(e){Ge[e]=Qe}),U.forEach(function(e){Ge[e+"s"]=tt}),Ge.watch=function(e,t,n,r){if(e===le&&(e=void 0),t===le&&(t=void 0),!t)return Object.create(e||null);if(!e)return t;var i={};for(var o in E(i,e),t){var a=i[o],s=t[o];a&&!Array.isArray(a)&&(a=[a]),i[o]=a?a.concat(s):Array.isArray(s)?s:[s]}return i},Ge.props=Ge.methods=Ge.inject=Ge.computed=function(e,t,n,r){if(!e)return t;var i=Object.create(null);return E(i,e),t&&E(i,t),i},Ge.provide=Ye;var nt=function(e,t){return void 0===t?e:t};function rt(e){for(var t in e.components)it(t)}function it(e){new RegExp("^[a-zA-Z][\\-\\.0-9_"+J.source+"]*$").test(e)||we('Invalid component name: "'+e+'". Component names should conform to valid custom element name in html5 specification.'),(y(e)||V.isReservedTag(e))&&we("Do not use built-in or reserved HTML elements as component id: "+e)}function ot(e,t){var n=e.props;if(n){var r,i,o={};if(Array.isArray(n))for(r=n.length;r--;)"string"==typeof(i=n[r])&&(o[C(i)]={type:null});else if(l(n))for(var a in n)i=n[a],o[C(a)]=l(i)?i:{type:i};else 0;e.props=o}}function at(e,t){var n=e.inject;if(n){var r=e.inject={};if(Array.isArray(n))for(var i=0;i<n.length;i++)r[n[i]]={from:n[i]};else if(l(n))for(var o in n){var a=n[o];r[o]=l(a)?E({from:o},a):{from:a}}else 0}}function st(e){var t=e.directives;if(t)for(var n in t){var r=t[n];"function"==typeof r&&(t[n]={bind:r,update:r})}}function ct(e,t,n){l(t)||we('Invalid value for option "'+e+'": expected an Object, but got '+u(t)+".",n)}function ut(e,t,n){if("function"==typeof t&&(t=t.options),ot(t,n),at(t,n),st(t),!t._base&&(t.extends&&(e=ut(e,t.extends,n)),t.mixins))for(var r=0,i=t.mixins.length;r<i;r++)e=ut(e,t.mixins[r],n);var o,a={};for(o in e)s(o);for(o in t)$(e,o)||s(o);function s(r){var i=Ge[r]||nt;a[r]=i(e[r],t[r],n,r)}return a}function lt(e,t,n,r){if("string"==typeof n){var i=e[t];if($(i,n))return i[n];var o=C(n);if($(i,o))return i[o];var a=A(o);if($(i,a))return i[a];var s=i[n]||i[o]||i[a];return s}}function ft(e,t,n,r){var i=t[e],o=!$(n,e),a=n[e],s=gt(Boolean,i.type);if(s>-1)if(o&&!$(i,"default"))a=!1;else if(""===a||a===O(e)){var c=gt(String,i.type);(c<0||s<c)&&(a=!0)}if(void 0===a){a=pt(r,i,e);var u=He;Be(!0),Je(a),Be(u)}return a}function pt(e,t,n){if($(t,"default")){var r=t.default;return e&&e.$options.propsData&&void 0===e.$options.propsData[n]&&void 0!==e._props[n]?e._props[n]:"function"==typeof r&&"Function"!==mt(t.type)?r.call(e):r}}function dt(e,t,n,r,i){if(e.required&&i)we('Missing required prop: "'+t+'"',r);else if(null!=n||e.required){var o=e.type,a=!o||!0===o,s=[];if(o){Array.isArray(o)||(o=[o]);for(var c=0;c<o.length&&!a;c++){var u=ht(n,o[c]);s.push(u.expectedType||""),a=u.valid}}if(a){var l=e.validator;l&&(l(n)||we('Invalid prop: custom validator check failed for prop "'+t+'".',r))}else we(_t(t,n,s),r)}}var vt=/^(String|Number|Boolean|Function|Symbol)$/;function ht(e,t){var n,r=mt(t);if(vt.test(r)){var i=typeof e;(n=i===r.toLowerCase())||"object"!==i||(n=e instanceof t)}else n="Object"===r?l(e):"Array"===r?Array.isArray(e):e instanceof t;return{valid:n,expectedType:r}}function mt(e){var t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:""}function yt(e,t){return mt(e)===mt(t)}function gt(e,t){if(!Array.isArray(t))return yt(t,e)?0:-1;for(var n=0,r=t.length;n<r;n++)if(yt(t[n],e))return n;return-1}function _t(e,t,n){var r='Invalid prop: type check failed for prop "'+e+'". Expected '+n.map(A).join(", "),i=n[0],o=u(t),a=bt(t,i),s=bt(t,o);return 1===n.length&&$t(i)&&!wt(i,o)&&(r+=" with value "+a),r+=", got "+o+" ",$t(o)&&(r+="with value "+s+"."),r}function bt(e,t){return"String"===t?'"'+e+'"':"Number"===t?""+Number(e):""+e}function $t(e){return["string","number","boolean"].some(function(t){return e.toLowerCase()===t})}function wt(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return e.some(function(e){return"boolean"===e.toLowerCase()})}function xt(e,t,n){Te();try{if(t)for(var r=t;r=r.$parent;){var i=r.$options.errorCaptured;if(i)for(var o=0;o<i.length;o++)try{if(!1===i[o].call(r,e,t,n))return}catch(Xl){At(Xl,r,"errorCaptured hook")}}At(e,t,n)}finally{Ne()}}function Ct(e,t,n,r,i){var o;try{(o=n?e.apply(t,n):e.call(t))&&!o._isVue&&d(o)&&!o._handled&&(o.catch(function(e){return xt(e,r,i+" (Promise/async)")}),o._handled=!0)}catch(Xl){xt(Xl,r,i)}return o}function At(e,t,n){if(V.errorHandler)try{return V.errorHandler.call(null,e,t,n)}catch(Xl){Xl!==e&&kt(Xl,null,"config.errorHandler")}kt(e,t,n)}function kt(e,t,n){if(!Y&&!Q||"undefined"==typeof console)throw e;console.error(e)}var Ot,St,Tt,Nt,jt,Et,Mt,Dt,Lt,It,Ft,Pt,Rt=!1,Ht=[],Bt=!1;function Ut(){Bt=!1;var e=Ht.slice(0);Ht.length=0;for(var t=0;t<e.length;t++)e[t]()}if("undefined"!=typeof Promise&&he(Promise)){var zt=Promise.resolve();Ot=function(){zt.then(Ut),ae&&setTimeout(D)},Rt=!0}else if(ne||"undefined"==typeof MutationObserver||!he(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())Ot="undefined"!=typeof setImmediate&&he(setImmediate)?function(){setImmediate(Ut)}:function(){setTimeout(Ut,0)};else{var Vt=1,Jt=new MutationObserver(Ut),Kt=document.createTextNode(String(Vt));Jt.observe(Kt,{characterData:!0}),Ot=function(){Vt=(Vt+1)%2,Kt.data=String(Vt)},Rt=!0}function qt(e,t){var n;if(Ht.push(function(){if(e)try{e.call(t)}catch(Xl){xt(Xl,t,"nextTick")}else n&&n(t)}),Bt||(Bt=!0,Ot()),!e&&"undefined"!=typeof Promise)return new Promise(function(e){n=e})}var Wt=new me;function Zt(e){Gt(e,Wt),Wt.clear()}function Gt(e,t){var n,r,i=Array.isArray(e);if(!(!i&&!s(e)||Object.isFrozen(e)||e instanceof je)){if(e.__ob__){var o=e.__ob__.dep.id;if(t.has(o))return;t.add(o)}if(i)for(n=e.length;n--;)Gt(e[n],t);else for(n=(r=Object.keys(e)).length;n--;)Gt(e[r[n]],t)}}var Xt=w(function(e){var t="&"===e.charAt(0),n="~"===(e=t?e.slice(1):e).charAt(0),r="!"===(e=n?e.slice(1):e).charAt(0);return{name:e=r?e.slice(1):e,once:n,capture:r,passive:t}});function Yt(e,t){function n(){var e=arguments,r=n.fns;if(!Array.isArray(r))return Ct(r,null,arguments,t,"v-on handler");for(var i=r.slice(),o=0;o<i.length;o++)Ct(i[o],null,e,t,"v-on handler")}return n.fns=e,n}function Qt(e,t,r,o,a,s){var c,u,l,f;for(c in e)u=e[c],l=t[c],f=Xt(c),n(u)||(n(l)?(n(u.fns)&&(u=e[c]=Yt(u,s)),i(f.once)&&(u=e[c]=a(f.name,u,f.capture)),r(f.name,u,f.capture,f.passive,f.params)):u!==l&&(l.fns=u,e[c]=l));for(c in t)n(e[c])&&o((f=Xt(c)).name,t[c],f.capture)}function en(e,t,o){var a;e instanceof je&&(e=e.data.hook||(e.data.hook={}));var s=e[t];function c(){o.apply(this,arguments),_(a.fns,c)}n(s)?a=Yt([c]):r(s.fns)&&i(s.merged)?(a=s).fns.push(c):a=Yt([s,c]),a.merged=!0,e[t]=a}function tn(e,t,i){var o=t.options.props;if(!n(o)){var a={},s=e.attrs,c=e.props;if(r(s)||r(c))for(var u in o){var l=O(u);nn(a,c,u,l,!0)||nn(a,s,u,l,!1)}return a}}function nn(e,t,n,i,o){if(r(t)){if($(t,n))return e[n]=t[n],o||delete t[n],!0;if($(t,i))return e[n]=t[i],o||delete t[i],!0}return!1}function rn(e){for(var t=0;t<e.length;t++)if(Array.isArray(e[t]))return Array.prototype.concat.apply([],e);return e}function on(e){return a(e)?[De(e)]:Array.isArray(e)?sn(e):void 0}function an(e){return r(e)&&r(e.text)&&o(e.isComment)}function sn(e,t){var o,s,c,u,l=[];for(o=0;o<e.length;o++)n(s=e[o])||"boolean"==typeof s||(u=l[c=l.length-1],Array.isArray(s)?s.length>0&&(an((s=sn(s,(t||"")+"_"+o))[0])&&an(u)&&(l[c]=De(u.text+s[0].text),s.shift()),l.push.apply(l,s)):a(s)?an(u)?l[c]=De(u.text+s):""!==s&&l.push(De(s)):an(s)&&an(u)?l[c]=De(u.text+s.text):(i(e._isVList)&&r(s.tag)&&n(s.key)&&r(t)&&(s.key="__vlist"+t+"_"+o+"__"),l.push(s)));return l}function cn(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}function un(e){var t=ln(e.$options.inject,e);t&&(Be(!1),Object.keys(t).forEach(function(n){Ke(e,n,t[n])}),Be(!0))}function ln(e,t){if(e){for(var n=Object.create(null),r=ye?Reflect.ownKeys(e):Object.keys(e),i=0;i<r.length;i++){var o=r[i];if("__ob__"!==o){for(var a=e[o].from,s=t;s;){if(s._provided&&$(s._provided,a)){n[o]=s._provided[a];break}s=s.$parent}if(!s)if("default"in e[o]){var c=e[o].default;n[o]="function"==typeof c?c.call(t):c}else 0}}return n}}function fn(e,t){if(!e||!e.length)return{};for(var n={},r=0,i=e.length;r<i;r++){var o=e[r],a=o.data;if(a&&a.attrs&&a.attrs.slot&&delete a.attrs.slot,o.context!==t&&o.fnContext!==t||!a||null==a.slot)(n.default||(n.default=[])).push(o);else{var s=a.slot,c=n[s]||(n[s]=[]);"template"===o.tag?c.push.apply(c,o.children||[]):c.push(o)}}for(var u in n)n[u].every(pn)&&delete n[u];return n}function pn(e){return e.isComment&&!e.asyncFactory||" "===e.text}function dn(e,n,r){var i,o=Object.keys(n).length>0,a=e?!!e.$stable:!o,s=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(a&&r&&r!==t&&s===r.$key&&!o&&!r.$hasNormal)return r;for(var c in i={},e)e[c]&&"$"!==c[0]&&(i[c]=vn(n,c,e[c]))}else i={};for(var u in n)u in i||(i[u]=hn(n,u));return e&&Object.isExtensible(e)&&(e._normalized=i),q(i,"$stable",a),q(i,"$key",s),q(i,"$hasNormal",o),i}function vn(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({});return(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:on(e))&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function hn(e,t){return function(){return e[t]}}function mn(e,t){var n,i,o,a,c;if(Array.isArray(e)||"string"==typeof e)for(n=new Array(e.length),i=0,o=e.length;i<o;i++)n[i]=t(e[i],i);else if("number"==typeof e)for(n=new Array(e),i=0;i<e;i++)n[i]=t(i+1,i);else if(s(e))if(ye&&e[Symbol.iterator]){n=[];for(var u=e[Symbol.iterator](),l=u.next();!l.done;)n.push(t(l.value,n.length)),l=u.next()}else for(a=Object.keys(e),n=new Array(a.length),i=0,o=a.length;i<o;i++)c=a[i],n[i]=t(e[c],c,i);return r(n)||(n=[]),n._isVList=!0,n}function yn(e,t,n,r){var i,o=this.$scopedSlots[e];o?(n=n||{},r&&(n=E(E({},r),n)),i=o(n)||t):i=this.$slots[e]||t;var a=n&&n.slot;return a?this.$createElement("template",{slot:a},i):i}function gn(e){return lt(this.$options,"filters",e,!0)||I}function _n(e,t){return Array.isArray(e)?-1===e.indexOf(t):e!==t}function bn(e,t,n,r,i){var o=V.keyCodes[t]||n;return i&&r&&!V.keyCodes[t]?_n(i,r):o?_n(o,e):r?O(r)!==t:void 0}function $n(e,t,n,r,i){if(n)if(s(n)){var o;Array.isArray(n)&&(n=M(n));var a=function(a){if("class"===a||"style"===a||g(a))o=e;else{var s=e.attrs&&e.attrs.type;o=r||V.mustUseProp(t,s,a)?e.domProps||(e.domProps={}):e.attrs||(e.attrs={})}var c=C(a),u=O(a);c in o||u in o||(o[a]=n[a],i&&((e.on||(e.on={}))["update:"+a]=function(e){n[a]=e}))};for(var c in n)a(c)}else;return e}function wn(e,t){var n=this._staticTrees||(this._staticTrees=[]),r=n[e];return r&&!t?r:(Cn(r=n[e]=this.$options.staticRenderFns[e].call(this._renderProxy,null,this),"__static__"+e,!1),r)}function xn(e,t,n){return Cn(e,"__once__"+t+(n?"_"+n:""),!0),e}function Cn(e,t,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]&&"string"!=typeof e[r]&&An(e[r],t+"_"+r,n);else An(e,t,n)}function An(e,t,n){e.isStatic=!0,e.key=t,e.isOnce=n}function kn(e,t){if(t)if(l(t)){var n=e.on=e.on?E({},e.on):{};for(var r in t){var i=n[r],o=t[r];n[r]=i?[].concat(i,o):o}}else;return e}function On(e,t,n,r){t=t||{$stable:!n};for(var i=0;i<e.length;i++){var o=e[i];Array.isArray(o)?On(o,t,n):o&&(o.proxy&&(o.fn.proxy=!0),t[o.key]=o.fn)}return r&&(t.$key=r),t}function Sn(e,t){for(var n=0;n<t.length;n+=2){var r=t[n];"string"==typeof r&&r&&(e[t[n]]=t[n+1])}return e}function Tn(e,t){return"string"==typeof e?t+e:e}function Nn(e){e._o=xn,e._n=h,e._s=v,e._l=mn,e._t=yn,e._q=P,e._i=R,e._m=wn,e._f=gn,e._k=bn,e._b=$n,e._v=De,e._e=Me,e._u=On,e._g=kn,e._d=Sn,e._p=Tn}function jn(e,n,r,o,a){var s,c=this,u=a.options;$(o,"_uid")?(s=Object.create(o))._original=o:(s=o,o=o._original);var l=i(u._compiled),f=!l;this.data=e,this.props=n,this.children=r,this.parent=o,this.listeners=e.on||t,this.injections=ln(u.inject,o),this.slots=function(){return c.$slots||dn(e.scopedSlots,c.$slots=fn(r,o)),c.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return dn(e.scopedSlots,this.slots())}}),l&&(this.$options=u,this.$slots=this.slots(),this.$scopedSlots=dn(e.scopedSlots,this.$slots)),u._scopeId?this._c=function(e,t,n,r){var i=Vn(s,e,t,n,r,f);return i&&!Array.isArray(i)&&(i.fnScopeId=u._scopeId,i.fnContext=o),i}:this._c=function(e,t,n,r){return Vn(s,e,t,n,r,f)}}function En(e,n,i,o,a){var s=e.options,c={},u=s.props;if(r(u))for(var l in u)c[l]=ft(l,u,n||t);else r(i.attrs)&&Dn(c,i.attrs),r(i.props)&&Dn(c,i.props);var f=new jn(i,c,a,o,e),p=s.render.call(null,f._c,f);if(p instanceof je)return Mn(p,i,f.parent,s,f);if(Array.isArray(p)){for(var d=on(p)||[],v=new Array(d.length),h=0;h<d.length;h++)v[h]=Mn(d[h],i,f.parent,s,f);return v}}function Mn(e,t,n,r,i){var o=Le(e);return o.fnContext=n,o.fnOptions=r,t.slot&&((o.data||(o.data={})).slot=t.slot),o}function Dn(e,t){for(var n in t)e[C(n)]=t[n]}Nn(jn.prototype);var Ln={init:function(e,t){if(e.componentInstance&&!e.componentInstance._isDestroyed&&e.data.keepAlive){var n=e;Ln.prepatch(n,n)}else{(e.componentInstance=Pn(e,ur)).$mount(t?e.elm:void 0,t)}},prepatch:function(e,t){var n=t.componentOptions;hr(t.componentInstance=e.componentInstance,n.propsData,n.listeners,t,n.children)},insert:function(e){var t=e.context,n=e.componentInstance;n._isMounted||(n._isMounted=!0,_r(n,"mounted")),e.data.keepAlive&&(t._isMounted?Dr(n):yr(n,!0))},destroy:function(e){var t=e.componentInstance;t._isDestroyed||(e.data.keepAlive?gr(t,!0):t.$destroy())}},In=Object.keys(Ln);function Fn(e,t,o,a,c){if(!n(e)){var u=o.$options._base;if(s(e)&&(e=u.extend(e)),"function"==typeof e){var l;if(n(e.cid)&&void 0===(e=er(l=e,u)))return Qn(l,t,o,a,c);t=t||{},ri(e),r(t.model)&&Bn(e.options,t);var f=tn(t,e,c);if(i(e.options.functional))return En(e,f,t,o,a);var p=t.on;if(t.on=t.nativeOn,i(e.options.abstract)){var d=t.slot;t={},d&&(t.slot=d)}Rn(t);var v=e.options.name||c;return new je("vue-component-"+e.cid+(v?"-"+v:""),t,void 0,void 0,void 0,o,{Ctor:e,propsData:f,listeners:p,tag:c,children:a},l)}}}function Pn(e,t){var n={_isComponent:!0,_parentVnode:e,parent:t},i=e.data.inlineTemplate;return r(i)&&(n.render=i.render,n.staticRenderFns=i.staticRenderFns),new e.componentOptions.Ctor(n)}function Rn(e){for(var t=e.hook||(e.hook={}),n=0;n<In.length;n++){var r=In[n],i=t[r],o=Ln[r];i===o||i&&i._merged||(t[r]=i?Hn(o,i):o)}}function Hn(e,t){var n=function(n,r){e(n,r),t(n,r)};return n._merged=!0,n}function Bn(e,t){var n=e.model&&e.model.prop||"value",i=e.model&&e.model.event||"input";(t.attrs||(t.attrs={}))[n]=t.model.value;var o=t.on||(t.on={}),a=o[i],s=t.model.callback;r(a)?(Array.isArray(a)?-1===a.indexOf(s):a!==s)&&(o[i]=[s].concat(a)):o[i]=s}var Un=1,zn=2;function Vn(e,t,n,r,o,s){return(Array.isArray(n)||a(n))&&(o=r,r=n,n=void 0),i(s)&&(o=zn),Jn(e,t,n,r,o)}function Jn(e,t,n,i,o){if(r(n)&&r(n.__ob__))return Me();if(r(n)&&r(n.is)&&(t=n.is),!t)return Me();var a,s,c;(Array.isArray(i)&&"function"==typeof i[0]&&((n=n||{}).scopedSlots={default:i[0]},i.length=0),o===zn?i=on(i):o===Un&&(i=rn(i)),"string"==typeof t)?(s=e.$vnode&&e.$vnode.ns||V.getTagNamespace(t),a=V.isReservedTag(t)?new je(V.parsePlatformTagName(t),n,i,void 0,void 0,e):n&&n.pre||!r(c=lt(e.$options,"components",t))?new je(t,n,i,void 0,void 0,e):Fn(c,n,e,i,t)):a=Fn(t,n,e,i);return Array.isArray(a)?a:r(a)?(r(s)&&Kn(a,s),r(n)&&qn(n),a):Me()}function Kn(e,t,o){if(e.ns=t,"foreignObject"===e.tag&&(t=void 0,o=!0),r(e.children))for(var a=0,s=e.children.length;a<s;a++){var c=e.children[a];r(c.tag)&&(n(c.ns)||i(o)&&"svg"!==c.tag)&&Kn(c,t,o)}}function qn(e){s(e.style)&&Zt(e.style),s(e.class)&&Zt(e.class)}function Wn(e){e._vnode=null,e._staticTrees=null;var n=e.$options,r=e.$vnode=n._parentVnode,i=r&&r.context;e.$slots=fn(n._renderChildren,i),e.$scopedSlots=t,e._c=function(t,n,r,i){return Vn(e,t,n,r,i,!1)},e.$createElement=function(t,n,r,i){return Vn(e,t,n,r,i,!0)};var o=r&&r.data;Ke(e,"$attrs",o&&o.attrs||t,null,!0),Ke(e,"$listeners",n._parentListeners||t,null,!0)}var Zn,Gn=null;function Xn(e){Nn(e.prototype),e.prototype.$nextTick=function(e){return qt(e,this)},e.prototype._render=function(){var e,t=this,n=t.$options,r=n.render,i=n._parentVnode;i&&(t.$scopedSlots=dn(i.data.scopedSlots,t.$slots,t.$scopedSlots)),t.$vnode=i;try{Gn=t,e=r.call(t._renderProxy,t.$createElement)}catch(Xl){xt(Xl,t,"render"),e=t._vnode}finally{Gn=null}return Array.isArray(e)&&1===e.length&&(e=e[0]),e instanceof je||(e=Me()),e.parent=i,e}}function Yn(e,t){return(e.__esModule||ye&&"Module"===e[Symbol.toStringTag])&&(e=e.default),s(e)?t.extend(e):e}function Qn(e,t,n,r,i){var o=Me();return o.asyncFactory=e,o.asyncMeta={data:t,context:n,children:r,tag:i},o}function er(e,t){if(i(e.error)&&r(e.errorComp))return e.errorComp;if(r(e.resolved))return e.resolved;var o=Gn;if(o&&r(e.owners)&&-1===e.owners.indexOf(o)&&e.owners.push(o),i(e.loading)&&r(e.loadingComp))return e.loadingComp;if(o&&!r(e.owners)){var a=e.owners=[o],c=!0,u=null,l=null;o.$on("hook:destroyed",function(){return _(a,o)});var f=function(e){for(var t=0,n=a.length;t<n;t++)a[t].$forceUpdate();e&&(a.length=0,null!==u&&(clearTimeout(u),u=null),null!==l&&(clearTimeout(l),l=null))},p=H(function(n){e.resolved=Yn(n,t),c?a.length=0:f(!0)}),v=H(function(t){r(e.errorComp)&&(e.error=!0,f(!0))}),h=e(p,v);return s(h)&&(d(h)?n(e.resolved)&&h.then(p,v):d(h.component)&&(h.component.then(p,v),r(h.error)&&(e.errorComp=Yn(h.error,t)),r(h.loading)&&(e.loadingComp=Yn(h.loading,t),0===h.delay?e.loading=!0:u=setTimeout(function(){u=null,n(e.resolved)&&n(e.error)&&(e.loading=!0,f(!1))},h.delay||200)),r(h.timeout)&&(l=setTimeout(function(){l=null,n(e.resolved)&&v(null)},h.timeout)))),c=!1,e.loading?e.loadingComp:e.resolved}}function tr(e){return e.isComment&&e.asyncFactory}function nr(e){if(Array.isArray(e))for(var t=0;t<e.length;t++){var n=e[t];if(r(n)&&(r(n.componentOptions)||tr(n)))return n}}function rr(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&sr(e,t)}function ir(e,t){Zn.$on(e,t)}function or(e,t){Zn.$off(e,t)}function ar(e,t){var n=Zn;return function r(){null!==t.apply(null,arguments)&&n.$off(e,r)}}function sr(e,t,n){Zn=e,Qt(t,n||{},ir,or,ar,e),Zn=void 0}function cr(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i<o;i++)r.$on(e[i],n);else(r._events[e]||(r._events[e]=[])).push(n),t.test(e)&&(r._hasHookEvent=!0);return r},e.prototype.$once=function(e,t){var n=this;function r(){n.$off(e,r),t.apply(n,arguments)}return r.fn=t,n.$on(e,r),n},e.prototype.$off=function(e,t){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(Array.isArray(e)){for(var r=0,i=e.length;r<i;r++)n.$off(e[r],t);return n}var o,a=n._events[e];if(!a)return n;if(!t)return n._events[e]=null,n;for(var s=a.length;s--;)if((o=a[s])===t||o.fn===t){a.splice(s,1);break}return n},e.prototype.$emit=function(e){var t=this,n=t._events[e];if(n){n=n.length>1?j(n):n;for(var r=j(arguments,1),i='event handler for "'+e+'"',o=0,a=n.length;o<a;o++)Ct(n[o],t,r,t,i)}return t}}var ur=null,lr=!1;function fr(e){var t=ur;return ur=e,function(){ur=t}}function pr(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}function dr(e){e.prototype._update=function(e,t){var n=this,r=n.$el,i=n._vnode,o=fr(n);n._vnode=e,n.$el=i?n.__patch__(i,e):n.__patch__(n.$el,e,t,!1),o(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},e.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},e.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){_r(e,"beforeDestroy"),e._isBeingDestroyed=!0;var t=e.$parent;!t||t._isBeingDestroyed||e.$options.abstract||_(t.$children,e),e._watcher&&e._watcher.teardown();for(var n=e._watchers.length;n--;)e._watchers[n].teardown();e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),_r(e,"destroyed"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}}function vr(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=Me),_r(e,"beforeMount"),r=function(){e._update(e._render(),n)},new Pr(e,r,D,{before:function(){e._isMounted&&!e._isDestroyed&&_r(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,_r(e,"mounted")),e}function hr(e,n,r,i,o){var a=i.data.scopedSlots,s=e.$scopedSlots,c=!!(a&&!a.$stable||s!==t&&!s.$stable||a&&e.$scopedSlots.$key!==a.$key),u=!!(o||e.$options._renderChildren||c);if(e.$options._parentVnode=i,e.$vnode=i,e._vnode&&(e._vnode.parent=i),e.$options._renderChildren=o,e.$attrs=i.data.attrs||t,e.$listeners=r||t,n&&e.$options.props){Be(!1);for(var l=e._props,f=e.$options._propKeys||[],p=0;p<f.length;p++){var d=f[p],v=e.$options.props;l[d]=ft(d,v,n,e)}Be(!0),e.$options.propsData=n}r=r||t;var h=e.$options._parentListeners;e.$options._parentListeners=r,sr(e,r,h),u&&(e.$slots=fn(o,i.context),e.$forceUpdate())}function mr(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}function yr(e,t){if(t){if(e._directInactive=!1,mr(e))return}else if(e._directInactive)return;if(e._inactive||null===e._inactive){e._inactive=!1;for(var n=0;n<e.$children.length;n++)yr(e.$children[n]);_r(e,"activated")}}function gr(e,t){if(!(t&&(e._directInactive=!0,mr(e))||e._inactive)){e._inactive=!0;for(var n=0;n<e.$children.length;n++)gr(e.$children[n]);_r(e,"deactivated")}}function _r(e,t){Te();var n=e.$options[t],r=t+" hook";if(n)for(var i=0,o=n.length;i<o;i++)Ct(n[i],e,null,e,r);e._hasHookEvent&&e.$emit("hook:"+t),Ne()}var br=100,$r=[],wr=[],xr={},Cr={},Ar=!1,kr=!1,Or=0;function Sr(){Or=$r.length=wr.length=0,xr={},Ar=kr=!1}var Tr=0,Nr=Date.now;if(Y&&!ne){var jr=window.performance;jr&&"function"==typeof jr.now&&Nr()>document.createEvent("Event").timeStamp&&(Nr=function(){return jr.now()})}function Er(){var e,t;for(Tr=Nr(),kr=!0,$r.sort(function(e,t){return e.id-t.id}),Or=0;Or<$r.length;Or++)(e=$r[Or]).before&&e.before(),t=e.id,xr[t]=null,e.run();var n=wr.slice(),r=$r.slice();Sr(),Lr(n),Mr(r),ve&&V.devtools&&ve.emit("flush")}function Mr(e){for(var t=e.length;t--;){var n=e[t],r=n.vm;r._watcher===n&&r._isMounted&&!r._isDestroyed&&_r(r,"updated")}}function Dr(e){e._inactive=!1,wr.push(e)}function Lr(e){for(var t=0;t<e.length;t++)e[t]._inactive=!0,yr(e[t],!0)}function Ir(e){var t=e.id;if(null==xr[t]){if(xr[t]=!0,kr){for(var n=$r.length-1;n>Or&&$r[n].id>e.id;)n--;$r.splice(n+1,0,e)}else $r.push(e);Ar||(Ar=!0,qt(Er))}}var Fr=0,Pr=function(e,t,n,r,i){this.vm=e,i&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++Fr,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new me,this.newDepIds=new me,this.expression="","function"==typeof t?this.getter=t:(this.getter=Z(t),this.getter||(this.getter=D)),this.value=this.lazy?void 0:this.get()};Pr.prototype.get=function(){var e;Te(this);var t=this.vm;try{e=this.getter.call(t,t)}catch(Xl){if(!this.user)throw Xl;xt(Xl,t,'getter for watcher "'+this.expression+'"')}finally{this.deep&&Zt(e),Ne(),this.cleanupDeps()}return e},Pr.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},Pr.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},Pr.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():Ir(this)},Pr.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||s(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(Xl){xt(Xl,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},Pr.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},Pr.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},Pr.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||_(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Rr={enumerable:!0,configurable:!0,get:D,set:D};function Hr(e,t,n){Rr.get=function(){return this[t][n]},Rr.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Rr)}function Br(e){e._watchers=[];var t=e.$options;t.props&&Ur(e,t.props),t.methods&&Gr(e,t.methods),t.data?zr(e):Je(e._data={},!0),t.computed&&Kr(e,t.computed),t.watch&&t.watch!==le&&Xr(e,t.watch)}function Ur(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[],o=!e.$parent;o||Be(!1);var a=function(o){i.push(o);var a=ft(o,t,n,e);Ke(r,o,a),o in e||Hr(e,"_props",o)};for(var s in t)a(s);Be(!0)}function zr(e){var t=e.$options.data;l(t=e._data="function"==typeof t?Vr(t,e):t||{})||(t={});for(var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);i--;){var o=n[i];0,r&&$(r,o)||K(o)||Hr(e,"_data",o)}Je(t,!0)}function Vr(e,t){Te();try{return e.call(t,t)}catch(Xl){return xt(Xl,t,"data()"),{}}finally{Ne()}}var Jr={lazy:!0};function Kr(e,t){var n=e._computedWatchers=Object.create(null),r=de();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;0,r||(n[i]=new Pr(e,a||D,D,Jr)),i in e||qr(e,i,o)}}function qr(e,t,n){var r=!de();"function"==typeof n?(Rr.get=r?Wr(t):Zr(n),Rr.set=D):(Rr.get=n.get?r&&!1!==n.cache?Wr(t):Zr(n.get):D,Rr.set=n.set||D),Object.defineProperty(e,t,Rr)}function Wr(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),Oe.target&&t.depend(),t.value}}function Zr(e){return function(){return e.call(this,this)}}function Gr(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?D:N(t[n],e)}function Xr(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)Yr(e,n,r[i]);else Yr(e,n,r)}}function Yr(e,t,n,r){return l(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=e[n]),e.$watch(t,n,r)}function Qr(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=qe,e.prototype.$delete=We,e.prototype.$watch=function(e,t,n){if(l(t))return Yr(this,e,t,n);(n=n||{}).user=!0;var r=new Pr(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(i){xt(i,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}var ei=0;function ti(e){e.prototype._init=function(e){var t=this;t._uid=ei++,t._isVue=!0,e&&e._isComponent?ni(t,e):t.$options=ut(ri(t.constructor),e||{},t),t._renderProxy=t,t._self=t,pr(t),rr(t),Wn(t),_r(t,"beforeCreate"),un(t),Br(t),cn(t),_r(t,"created"),t.$options.el&&t.$mount(t.$options.el)}}function ni(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}function ri(e){var t=e.options;if(e.super){var n=ri(e.super);if(n!==e.superOptions){e.superOptions=n;var r=ii(e);r&&E(e.extendOptions,r),(t=e.options=ut(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function ii(e){var t,n=e.options,r=e.sealedOptions;for(var i in n)n[i]!==r[i]&&(t||(t={}),t[i]=n[i]);return t}function oi(e){this._init(e)}function ai(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=j(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}function si(e){e.mixin=function(e){return this.options=ut(this.options,e),this}}function ci(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,i=e._Ctor||(e._Ctor={});if(i[r])return i[r];var o=e.name||n.options.name;var a=function(e){this._init(e)};return(a.prototype=Object.create(n.prototype)).constructor=a,a.cid=t++,a.options=ut(n.options,e),a.super=n,a.options.props&&ui(a),a.options.computed&&li(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,U.forEach(function(e){a[e]=n[e]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=e,a.sealedOptions=E({},a.options),i[r]=a,a}}function ui(e){var t=e.options.props;for(var n in t)Hr(e.prototype,"_props",n)}function li(e){var t=e.options.computed;for(var n in t)qr(e.prototype,n,t[n])}function fi(e){U.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&l(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}function pi(e){return e&&(e.Ctor.options.name||e.tag)}function di(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!f(e)&&e.test(t)}function vi(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=pi(a.componentOptions);s&&!t(s)&&hi(n,o,r,i)}}}function hi(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,_(n,t)}ti(oi),Qr(oi),cr(oi),dr(oi),Xn(oi);var mi=[String,RegExp,Array],yi={name:"keep-alive",abstract:!0,props:{include:mi,exclude:mi,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)hi(this.cache,e,this.keys)},mounted:function(){var e=this;this.$watch("include",function(t){vi(e,function(e){return di(t,e)})}),this.$watch("exclude",function(t){vi(e,function(e){return!di(t,e)})})},render:function(){var e=this.$slots.default,t=nr(e),n=t&&t.componentOptions;if(n){var r=pi(n),i=this.include,o=this.exclude;if(i&&(!r||!di(i,r))||o&&r&&di(o,r))return t;var a=this.cache,s=this.keys,c=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;a[c]?(t.componentInstance=a[c].componentInstance,_(s,c),s.push(c)):(a[c]=t,s.push(c),this.max&&s.length>parseInt(this.max)&&hi(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}},gi={KeepAlive:yi};function _i(e){var t={get:function(){return V}};Object.defineProperty(e,"config",t),e.util={warn:we,extend:E,mergeOptions:ut,defineReactive:Ke},e.set=qe,e.delete=We,e.nextTick=qt,e.observable=function(e){return Je(e),e},e.options=Object.create(null),U.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,E(e.options.components,gi),ai(e),si(e),ci(e),fi(e)}_i(oi),Object.defineProperty(oi.prototype,"$isServer",{get:de}),Object.defineProperty(oi.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(oi,"FunctionalRenderContext",{value:jn}),oi.version="2.6.11";var bi=m("style,class"),$i=m("input,textarea,option,select,progress"),wi=function(e,t,n){return"value"===n&&$i(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},xi=m("contenteditable,draggable,spellcheck"),Ci=m("events,caret,typing,plaintext-only"),Ai=function(e,t){return Ni(t)||"false"===t?"false":"contenteditable"===e&&Ci(t)?t:"true"},ki=m("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Oi="http://www.w3.org/1999/xlink",Si=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Ti=function(e){return Si(e)?e.slice(6,e.length):""},Ni=function(e){return null==e||!1===e};function ji(e){for(var t=e.data,n=e,i=e;r(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=Ei(i.data,t));for(;r(n=n.parent);)n&&n.data&&(t=Ei(t,n.data));return Mi(t.staticClass,t.class)}function Ei(e,t){return{staticClass:Di(e.staticClass,t.staticClass),class:r(e.class)?[e.class,t.class]:t.class}}function Mi(e,t){return r(e)||r(t)?Di(e,Li(t)):""}function Di(e,t){return e?t?e+" "+t:e:t||""}function Li(e){return Array.isArray(e)?Ii(e):s(e)?Fi(e):"string"==typeof e?e:""}function Ii(e){for(var t,n="",i=0,o=e.length;i<o;i++)r(t=Li(e[i]))&&""!==t&&(n&&(n+=" "),n+=t);return n}function Fi(e){var t="";for(var n in e)e[n]&&(t&&(t+=" "),t+=n);return t}var Pi={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Ri=m("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),Hi=m("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Bi=function(e){return"pre"===e},Ui=function(e){return Ri(e)||Hi(e)};function zi(e){return Hi(e)?"svg":"math"===e?"math":void 0}var Vi=Object.create(null);function Ji(e){if(!Y)return!0;if(Ui(e))return!1;if(e=e.toLowerCase(),null!=Vi[e])return Vi[e];var t=document.createElement(e);return e.indexOf("-")>-1?Vi[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Vi[e]=/HTMLUnknownElement/.test(t.toString())}var Ki=m("text,number,password,search,email,tel,url");function qi(e){if("string"==typeof e){var t=document.querySelector(e);return t||document.createElement("div")}return e}function Wi(e,t){var n=document.createElement(e);return"select"!==e?n:(t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)}function Zi(e,t){return document.createElementNS(Pi[e],t)}function Gi(e){return document.createTextNode(e)}function Xi(e){return document.createComment(e)}function Yi(e,t,n){e.insertBefore(t,n)}function Qi(e,t){e.removeChild(t)}function eo(e,t){e.appendChild(t)}function to(e){return e.parentNode}function no(e){return e.nextSibling}function ro(e){return e.tagName}function io(e,t){e.textContent=t}function oo(e,t){e.setAttribute(t,"")}var ao=Object.freeze({createElement:Wi,createElementNS:Zi,createTextNode:Gi,createComment:Xi,insertBefore:Yi,removeChild:Qi,appendChild:eo,parentNode:to,nextSibling:no,tagName:ro,setTextContent:io,setStyleScope:oo}),so={create:function(e,t){co(t)},update:function(e,t){e.data.ref!==t.data.ref&&(co(e,!0),co(t))},destroy:function(e){co(e,!0)}};function co(e,t){var n=e.data.ref;if(r(n)){var i=e.context,o=e.componentInstance||e.elm,a=i.$refs;t?Array.isArray(a[n])?_(a[n],o):a[n]===o&&(a[n]=void 0):e.data.refInFor?Array.isArray(a[n])?a[n].indexOf(o)<0&&a[n].push(o):a[n]=[o]:a[n]=o}}var uo=new je("",{},[]),lo=["create","activate","update","remove","destroy"];function fo(e,t){return e.key===t.key&&(e.tag===t.tag&&e.isComment===t.isComment&&r(e.data)===r(t.data)&&po(e,t)||i(e.isAsyncPlaceholder)&&e.asyncFactory===t.asyncFactory&&n(t.asyncFactory.error))}function po(e,t){if("input"!==e.tag)return!0;var n,i=r(n=e.data)&&r(n=n.attrs)&&n.type,o=r(n=t.data)&&r(n=n.attrs)&&n.type;return i===o||Ki(i)&&Ki(o)}function vo(e,t,n){var i,o,a={};for(i=t;i<=n;++i)r(o=e[i].key)&&(a[o]=i);return a}function ho(e){var t,o,s={},c=e.modules,u=e.nodeOps;for(t=0;t<lo.length;++t)for(s[lo[t]]=[],o=0;o<c.length;++o)r(c[o][lo[t]])&&s[lo[t]].push(c[o][lo[t]]);function l(e){var t=u.parentNode(e);r(t)&&u.removeChild(t,e)}function f(e,t,n,o,a,c,l){if(r(e.elm)&&r(c)&&(e=c[l]=Le(e)),e.isRootInsert=!a,!function(e,t,n,o){var a=e.data;if(r(a)){var c=r(e.componentInstance)&&a.keepAlive;if(r(a=a.hook)&&r(a=a.init)&&a(e,!1),r(e.componentInstance))return p(e,t),d(n,e.elm,o),i(c)&&function(e,t,n,i){var o,a=e;for(;a.componentInstance;)if(a=a.componentInstance._vnode,r(o=a.data)&&r(o=o.transition)){for(o=0;o<s.activate.length;++o)s.activate[o](uo,a);t.push(a);break}d(n,e.elm,i)}(e,t,n,o),!0}}(e,t,n,o)){var f=e.data,h=e.children,m=e.tag;r(m)?(e.elm=e.ns?u.createElementNS(e.ns,m):u.createElement(m,e),g(e),v(e,h,t),r(f)&&y(e,t),d(n,e.elm,o)):i(e.isComment)?(e.elm=u.createComment(e.text),d(n,e.elm,o)):(e.elm=u.createTextNode(e.text),d(n,e.elm,o))}}function p(e,t){r(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,h(e)?(y(e,t),g(e)):(co(e),t.push(e))}function d(e,t,n){r(e)&&(r(n)?u.parentNode(n)===e&&u.insertBefore(e,t,n):u.appendChild(e,t))}function v(e,t,n){if(Array.isArray(t)){0;for(var r=0;r<t.length;++r)f(t[r],n,e.elm,null,!0,t,r)}else a(e.text)&&u.appendChild(e.elm,u.createTextNode(String(e.text)))}function h(e){for(;e.componentInstance;)e=e.componentInstance._vnode;return r(e.tag)}function y(e,n){for(var i=0;i<s.create.length;++i)s.create[i](uo,e);r(t=e.data.hook)&&(r(t.create)&&t.create(uo,e),r(t.insert)&&n.push(e))}function g(e){var t;if(r(t=e.fnScopeId))u.setStyleScope(e.elm,t);else for(var n=e;n;)r(t=n.context)&&r(t=t.$options._scopeId)&&u.setStyleScope(e.elm,t),n=n.parent;r(t=ur)&&t!==e.context&&t!==e.fnContext&&r(t=t.$options._scopeId)&&u.setStyleScope(e.elm,t)}function _(e,t,n,r,i,o){for(;r<=i;++r)f(n[r],o,e,t,!1,n,r)}function b(e){var t,n,i=e.data;if(r(i))for(r(t=i.hook)&&r(t=t.destroy)&&t(e),t=0;t<s.destroy.length;++t)s.destroy[t](e);if(r(t=e.children))for(n=0;n<e.children.length;++n)b(e.children[n])}function $(e,t,n){for(;t<=n;++t){var i=e[t];r(i)&&(r(i.tag)?(w(i),b(i)):l(i.elm))}}function w(e,t){if(r(t)||r(e.data)){var n,i=s.remove.length+1;for(r(t)?t.listeners+=i:t=function(e,t){function n(){0==--n.listeners&&l(e)}return n.listeners=t,n}(e.elm,i),r(n=e.componentInstance)&&r(n=n._vnode)&&r(n.data)&&w(n,t),n=0;n<s.remove.length;++n)s.remove[n](e,t);r(n=e.data.hook)&&r(n=n.remove)?n(e,t):t()}else l(e.elm)}function x(e,t,n,i){for(var o=n;o<i;o++){var a=t[o];if(r(a)&&fo(e,a))return o}}function C(e,t,o,a,c,l){if(e!==t){r(t.elm)&&r(a)&&(t=a[c]=Le(t));var p=t.elm=e.elm;if(i(e.isAsyncPlaceholder))r(t.asyncFactory.resolved)?O(e.elm,t,o):t.isAsyncPlaceholder=!0;else if(i(t.isStatic)&&i(e.isStatic)&&t.key===e.key&&(i(t.isCloned)||i(t.isOnce)))t.componentInstance=e.componentInstance;else{var d,v=t.data;r(v)&&r(d=v.hook)&&r(d=d.prepatch)&&d(e,t);var m=e.children,y=t.children;if(r(v)&&h(t)){for(d=0;d<s.update.length;++d)s.update[d](e,t);r(d=v.hook)&&r(d=d.update)&&d(e,t)}n(t.text)?r(m)&&r(y)?m!==y&&function(e,t,i,o,a){var s,c,l,p=0,d=0,v=t.length-1,h=t[0],m=t[v],y=i.length-1,g=i[0],b=i[y],w=!a;for(;p<=v&&d<=y;)n(h)?h=t[++p]:n(m)?m=t[--v]:fo(h,g)?(C(h,g,o,i,d),h=t[++p],g=i[++d]):fo(m,b)?(C(m,b,o,i,y),m=t[--v],b=i[--y]):fo(h,b)?(C(h,b,o,i,y),w&&u.insertBefore(e,h.elm,u.nextSibling(m.elm)),h=t[++p],b=i[--y]):fo(m,g)?(C(m,g,o,i,d),w&&u.insertBefore(e,m.elm,h.elm),m=t[--v],g=i[++d]):(n(s)&&(s=vo(t,p,v)),n(c=r(g.key)?s[g.key]:x(g,t,p,v))?f(g,o,e,h.elm,!1,i,d):fo(l=t[c],g)?(C(l,g,o,i,d),t[c]=void 0,w&&u.insertBefore(e,l.elm,h.elm)):f(g,o,e,h.elm,!1,i,d),g=i[++d]);p>v?_(e,n(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(t,p,v)}(p,m,y,o,l):r(y)?(r(e.text)&&u.setTextContent(p,""),_(p,null,y,0,y.length-1,o)):r(m)?$(m,0,m.length-1):r(e.text)&&u.setTextContent(p,""):e.text!==t.text&&u.setTextContent(p,t.text),r(v)&&r(d=v.hook)&&r(d=d.postpatch)&&d(e,t)}}}function A(e,t,n){if(i(n)&&r(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o<t.length;++o)t[o].data.hook.insert(t[o])}var k=m("attrs,class,staticClass,staticStyle,key");function O(e,t,n,o){var a,s=t.tag,c=t.data,u=t.children;if(o=o||c&&c.pre,t.elm=e,i(t.isComment)&&r(t.asyncFactory))return t.isAsyncPlaceholder=!0,!0;if(r(c)&&(r(a=c.hook)&&r(a=a.init)&&a(t,!0),r(a=t.componentInstance)))return p(t,n),!0;if(r(s)){if(r(u))if(e.hasChildNodes())if(r(a=c)&&r(a=a.domProps)&&r(a=a.innerHTML)){if(a!==e.innerHTML)return!1}else{for(var l=!0,f=e.firstChild,d=0;d<u.length;d++){if(!f||!O(f,u[d],n,o)){l=!1;break}f=f.nextSibling}if(!l||f)return!1}else v(t,u,n);if(r(c)){var h=!1;for(var m in c)if(!k(m)){h=!0,y(t,n);break}!h&&c.class&&Zt(c.class)}}else e.data!==t.text&&(e.data=t.text);return!0}return function(e,t,o,a){if(!n(t)){var c,l=!1,p=[];if(n(e))l=!0,f(t,p);else{var d=r(e.nodeType);if(!d&&fo(e,t))C(e,t,p,null,null,a);else{if(d){if(1===e.nodeType&&e.hasAttribute(B)&&(e.removeAttribute(B),o=!0),i(o)&&O(e,t,p))return A(t,p,!0),e;c=e,e=new je(u.tagName(c).toLowerCase(),{},[],void 0,c)}var v=e.elm,m=u.parentNode(v);if(f(t,p,v._leaveCb?null:m,u.nextSibling(v)),r(t.parent))for(var y=t.parent,g=h(t);y;){for(var _=0;_<s.destroy.length;++_)s.destroy[_](y);if(y.elm=t.elm,g){for(var w=0;w<s.create.length;++w)s.create[w](uo,y);var x=y.data.hook.insert;if(x.merged)for(var k=1;k<x.fns.length;k++)x.fns[k]()}else co(y);y=y.parent}r(m)?$([e],0,0):r(e.tag)&&b(e)}}return A(t,p,l),t.elm}r(e)&&b(e)}}var mo={create:yo,update:yo,destroy:function(e){yo(e,uo)}};function yo(e,t){(e.data.directives||t.data.directives)&&go(e,t)}function go(e,t){var n,r,i,o=e===uo,a=t===uo,s=bo(e.data.directives,e.context),c=bo(t.data.directives,t.context),u=[],l=[];for(n in c)r=s[n],i=c[n],r?(i.oldValue=r.value,i.oldArg=r.arg,wo(i,"update",t,e),i.def&&i.def.componentUpdated&&l.push(i)):(wo(i,"bind",t,e),i.def&&i.def.inserted&&u.push(i));if(u.length){var f=function(){for(var n=0;n<u.length;n++)wo(u[n],"inserted",t,e)};o?en(t,"insert",f):f()}if(l.length&&en(t,"postpatch",function(){for(var n=0;n<l.length;n++)wo(l[n],"componentUpdated",t,e)}),!o)for(n in s)c[n]||wo(s[n],"unbind",e,e,a)}var _o=Object.create(null);function bo(e,t){var n,r,i=Object.create(null);if(!e)return i;for(n=0;n<e.length;n++)(r=e[n]).modifiers||(r.modifiers=_o),i[$o(r)]=r,r.def=lt(t.$options,"directives",r.name,!0);return i}function $o(e){return e.rawName||e.name+"."+Object.keys(e.modifiers||{}).join(".")}function wo(e,t,n,r,i){var o=e.def&&e.def[t];if(o)try{o(n.elm,e,n,r,i)}catch(Xl){xt(Xl,n.context,"directive "+e.name+" "+t+" hook")}}var xo=[so,mo];function Co(e,t){var i=t.componentOptions;if(!(r(i)&&!1===i.Ctor.options.inheritAttrs||n(e.data.attrs)&&n(t.data.attrs))){var o,a,s=t.elm,c=e.data.attrs||{},u=t.data.attrs||{};for(o in r(u.__ob__)&&(u=t.data.attrs=E({},u)),u)a=u[o],c[o]!==a&&Ao(s,o,a);for(o in(ne||ie)&&u.value!==c.value&&Ao(s,"value",u.value),c)n(u[o])&&(Si(o)?s.removeAttributeNS(Oi,Ti(o)):xi(o)||s.removeAttribute(o))}}function Ao(e,t,n){e.tagName.indexOf("-")>-1?ko(e,t,n):ki(t)?Ni(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):xi(t)?e.setAttribute(t,Ai(t,n)):Si(t)?Ni(n)?e.removeAttributeNS(Oi,Ti(t)):e.setAttributeNS(Oi,t,n):ko(e,t,n)}function ko(e,t,n){if(Ni(n))e.removeAttribute(t);else{if(ne&&!re&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var Oo={create:Co,update:Co};function So(e,t){var i=t.elm,o=t.data,a=e.data;if(!(n(o.staticClass)&&n(o.class)&&(n(a)||n(a.staticClass)&&n(a.class)))){var s=ji(t),c=i._transitionClasses;r(c)&&(s=Di(s,Li(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var To,No,jo,Eo,Mo,Do,Lo,Io={create:So,update:So},Fo=/[\w).+\-_$\]]/;function Po(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r<e.length;r++)if(n=t,t=e.charCodeAt(r),a)39===t&&92!==n&&(a=!1);else if(s)34===t&&92!==n&&(s=!1);else if(c)96===t&&92!==n&&(c=!1);else if(u)47===t&&92!==n&&(u=!1);else if(124!==t||124===e.charCodeAt(r+1)||124===e.charCodeAt(r-1)||l||f||p){switch(t){case 34:s=!0;break;case 39:a=!0;break;case 96:c=!0;break;case 40:p++;break;case 41:p--;break;case 91:f++;break;case 93:f--;break;case 123:l++;break;case 125:l--}if(47===t){for(var v=r-1,h=void 0;v>=0&&" "===(h=e.charAt(v));v--);h&&Fo.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r<o.length;r++)i=Ro(i,o[r]);return i}function Ro(e,t){var n=t.indexOf("(");if(n<0)return'_f("'+t+'")('+e+")";var r=t.slice(0,n),i=t.slice(n+1);return'_f("'+r+'")('+e+(")"!==i?","+i:i)}function Ho(e,t){console.error("[Vue compiler]: "+e)}function Bo(e,t){return e?e.map(function(e){return e[t]}).filter(function(e){return e}):[]}function Uo(e,t,n,r,i){(e.props||(e.props=[])).push(Yo({name:t,value:n,dynamic:i},r)),e.plain=!1}function zo(e,t,n,r,i){(i?e.dynamicAttrs||(e.dynamicAttrs=[]):e.attrs||(e.attrs=[])).push(Yo({name:t,value:n,dynamic:i},r)),e.plain=!1}function Vo(e,t,n,r){e.attrsMap[t]=n,e.attrsList.push(Yo({name:t,value:n},r))}function Jo(e,t,n,r,i,o,a,s){(e.directives||(e.directives=[])).push(Yo({name:t,rawName:n,value:r,arg:i,isDynamicArg:o,modifiers:a},s)),e.plain=!1}function Ko(e,t,n){return n?"_p("+t+',"'+e+'")':e+t}function qo(e,n,r,i,o,a,s,c){var u;(i=i||t).right?c?n="("+n+")==='click'?'contextmenu':("+n+")":"click"===n&&(n="contextmenu",delete i.right):i.middle&&(c?n="("+n+")==='click'?'mouseup':("+n+")":"click"===n&&(n="mouseup")),i.capture&&(delete i.capture,n=Ko("!",n,c)),i.once&&(delete i.once,n=Ko("~",n,c)),i.passive&&(delete i.passive,n=Ko("&",n,c)),i.native?(delete i.native,u=e.nativeEvents||(e.nativeEvents={})):u=e.events||(e.events={});var l=Yo({value:r.trim(),dynamic:c},s);i!==t&&(l.modifiers=i);var f=u[n];Array.isArray(f)?o?f.unshift(l):f.push(l):u[n]=f?o?[l,f]:[f,l]:l,e.plain=!1}function Wo(e,t){return e.rawAttrsMap[":"+t]||e.rawAttrsMap["v-bind:"+t]||e.rawAttrsMap[t]}function Zo(e,t,n){var r=Go(e,":"+t)||Go(e,"v-bind:"+t);if(null!=r)return Po(r);if(!1!==n){var i=Go(e,t);if(null!=i)return JSON.stringify(i)}}function Go(e,t,n){var r;if(null!=(r=e.attrsMap[t]))for(var i=e.attrsList,o=0,a=i.length;o<a;o++)if(i[o].name===t){i.splice(o,1);break}return n&&delete e.attrsMap[t],r}function Xo(e,t){for(var n=e.attrsList,r=0,i=n.length;r<i;r++){var o=n[r];if(t.test(o.name))return n.splice(r,1),o}}function Yo(e,t){return t&&(null!=t.start&&(e.start=t.start),null!=t.end&&(e.end=t.end)),e}function Qo(e,t,n){var r=n||{},i=r.number,o="$$v";r.trim&&(o="(typeof $$v === 'string'? $$v.trim(): $$v)"),i&&(o="_n("+o+")");var a=ea(t,o);e.model={value:"("+t+")",expression:JSON.stringify(t),callback:"function ($$v) {"+a+"}"}}function ea(e,t){var n=ta(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function ta(e){if(e=e.trim(),To=e.length,e.indexOf("[")<0||e.lastIndexOf("]")<To-1)return(Eo=e.lastIndexOf("."))>-1?{exp:e.slice(0,Eo),key:'"'+e.slice(Eo+1)+'"'}:{exp:e,key:null};for(No=e,Eo=Mo=Do=0;!ra();)ia(jo=na())?aa(jo):91===jo&&oa(jo);return{exp:e.slice(0,Mo),key:e.slice(Mo+1,Do)}}function na(){return No.charCodeAt(++Eo)}function ra(){return Eo>=To}function ia(e){return 34===e||39===e}function oa(e){var t=1;for(Mo=Eo;!ra();)if(ia(e=na()))aa(e);else if(91===e&&t++,93===e&&t--,0===t){Do=Eo;break}}function aa(e){for(var t=e;!ra()&&(e=na())!==t;);}var sa,ca="__r",ua="__c";function la(e,t,n){Lo=n;var r=t.value,i=t.modifiers,o=e.tag,a=e.attrsMap.type;if(e.component)return Qo(e,r,i),!1;if("select"===o)da(e,r,i);else if("input"===o&&"checkbox"===a)fa(e,r,i);else if("input"===o&&"radio"===a)pa(e,r,i);else if("input"===o||"textarea"===o)va(e,r,i);else{if(!V.isReservedTag(o))return Qo(e,r,i),!1}return!0}function fa(e,t,n){var r=n&&n.number,i=Zo(e,"value")||"null",o=Zo(e,"true-value")||"true",a=Zo(e,"false-value")||"false";Uo(e,"checked","Array.isArray("+t+")?_i("+t+","+i+")>-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),qo(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+ea(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+ea(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+ea(t,"$$c")+"}",null,!0)}function pa(e,t,n){var r=n&&n.number,i=Zo(e,"value")||"null";Uo(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),qo(e,"change",ea(t,i),null,!0)}function da(e,t,n){var r="var $$selectedVal = "+('Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(n&&n.number?"_n(val)":"val")+"})")+";";qo(e,"change",r=r+" "+ea(t,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),null,!0)}function va(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?ca:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=ea(t,l);c&&(f="if($event.target.composing)return;"+f),Uo(e,"value","("+t+")"),qo(e,u,f,null,!0),(s||a)&&qo(e,"blur","$forceUpdate()")}function ha(e){if(r(e[ca])){var t=ne?"change":"input";e[t]=[].concat(e[ca],e[t]||[]),delete e[ca]}r(e[ua])&&(e.change=[].concat(e[ua],e.change||[]),delete e[ua])}function ma(e,t,n){var r=sa;return function i(){null!==t.apply(null,arguments)&&_a(e,i,n,r)}}var ya=Rt&&!(ue&&Number(ue[1])<=53);function ga(e,t,n,r){if(ya){var i=Tr,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}sa.addEventListener(e,t,fe?{capture:n,passive:r}:n)}function _a(e,t,n,r){(r||sa).removeEventListener(e,t._wrapper||t,n)}function ba(e,t){if(!n(e.data.on)||!n(t.data.on)){var r=t.data.on||{},i=e.data.on||{};sa=t.elm,ha(r),Qt(r,i,ga,_a,ma,t.context),sa=void 0}}var $a,wa={create:ba,update:ba};function xa(e,t){if(!n(e.data.domProps)||!n(t.data.domProps)){var i,o,a=t.elm,s=e.data.domProps||{},c=t.data.domProps||{};for(i in r(c.__ob__)&&(c=t.data.domProps=E({},c)),s)i in c||(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(t.children&&(t.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i&&"PROGRESS"!==a.tagName){a._value=o;var u=n(o)?"":String(o);Ca(a,u)&&(a.value=u)}else if("innerHTML"===i&&Hi(a.tagName)&&n(a.innerHTML)){($a=$a||document.createElement("div")).innerHTML="<svg>"+o+"</svg>";for(var l=$a.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else if(o!==s[i])try{a[i]=o}catch(Xl){}}}}function Ca(e,t){return!e.composing&&("OPTION"===e.tagName||Aa(e,t)||ka(e,t))}function Aa(e,t){var n=!0;try{n=document.activeElement!==e}catch(Xl){}return n&&e.value!==t}function ka(e,t){var n=e.value,i=e._vModifiers;if(r(i)){if(i.number)return h(n)!==h(t);if(i.trim)return n.trim()!==t.trim()}return n!==t}var Oa={create:xa,update:xa},Sa=w(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function Ta(e){var t=Na(e.style);return e.staticStyle?E(e.staticStyle,t):t}function Na(e){return Array.isArray(e)?M(e):"string"==typeof e?Sa(e):e}function ja(e,t){var n,r={};if(t)for(var i=e;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=Ta(i.data))&&E(r,n);(n=Ta(e.data))&&E(r,n);for(var o=e;o=o.parent;)o.data&&(n=Ta(o.data))&&E(r,n);return r}var Ea,Ma=/^--/,Da=/\s*!important$/,La=function(e,t,n){if(Ma.test(t))e.style.setProperty(t,n);else if(Da.test(n))e.style.setProperty(O(t),n.replace(Da,""),"important");else{var r=Fa(t);if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++)e.style[r]=n[i];else e.style[r]=n}},Ia=["Webkit","Moz","ms"],Fa=w(function(e){if(Ea=Ea||document.createElement("div").style,"filter"!==(e=C(e))&&e in Ea)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<Ia.length;n++){var r=Ia[n]+t;if(r in Ea)return r}});function Pa(e,t){var i=t.data,o=e.data;if(!(n(i.staticStyle)&&n(i.style)&&n(o.staticStyle)&&n(o.style))){var a,s,c=t.elm,u=o.staticStyle,l=o.normalizedStyle||o.style||{},f=u||l,p=Na(t.data.style)||{};t.data.normalizedStyle=r(p.__ob__)?E({},p):p;var d=ja(t,!0);for(s in f)n(d[s])&&La(c,s,"");for(s in d)(a=d[s])!==f[s]&&La(c,s,null==a?"":a)}}var Ra={create:Pa,update:Pa},Ha=/\s+/;function Ba(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(Ha).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Ua(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(Ha).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function za(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&E(t,Va(e.name||"v")),E(t,e),t}return"string"==typeof e?Va(e):void 0}}var Va=w(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),Ja=Y&&!re,Ka="transition",qa="animation",Wa="transition",Za="transitionend",Ga="animation",Xa="animationend";Ja&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Wa="WebkitTransition",Za="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Ga="WebkitAnimation",Xa="webkitAnimationEnd"));var Ya=Y?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Qa(e){Ya(function(){Ya(e)})}function es(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),Ba(e,t))}function ts(e,t){e._transitionClasses&&_(e._transitionClasses,t),Ua(e,t)}function ns(e,t,n){var r=is(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===Ka?Za:Xa,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c<a&&u()},o+1),e.addEventListener(s,l)}var rs=/\b(transform|all)(,|$)/;function is(e,t){var n,r=window.getComputedStyle(e),i=(r[Wa+"Delay"]||"").split(", "),o=(r[Wa+"Duration"]||"").split(", "),a=os(i,o),s=(r[Ga+"Delay"]||"").split(", "),c=(r[Ga+"Duration"]||"").split(", "),u=os(s,c),l=0,f=0;return t===Ka?a>0&&(n=Ka,l=a,f=o.length):t===qa?u>0&&(n=qa,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?Ka:qa:null)?n===Ka?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===Ka&&rs.test(r[Wa+"Property"])}}function os(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max.apply(null,t.map(function(t,n){return as(t)+as(e[n])}))}function as(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}function ss(e,t){var i=e.elm;r(i._leaveCb)&&(i._leaveCb.cancelled=!0,i._leaveCb());var o=za(e.data.transition);if(!n(o)&&!r(i._enterCb)&&1===i.nodeType){for(var a=o.css,c=o.type,u=o.enterClass,l=o.enterToClass,f=o.enterActiveClass,p=o.appearClass,d=o.appearToClass,v=o.appearActiveClass,m=o.beforeEnter,y=o.enter,g=o.afterEnter,_=o.enterCancelled,b=o.beforeAppear,$=o.appear,w=o.afterAppear,x=o.appearCancelled,C=o.duration,A=ur,k=ur.$vnode;k&&k.parent;)A=k.context,k=k.parent;var O=!A._isMounted||!e.isRootInsert;if(!O||$||""===$){var S=O&&p?p:u,T=O&&v?v:f,N=O&&d?d:l,j=O&&b||m,E=O&&"function"==typeof $?$:y,M=O&&w||g,D=O&&x||_,L=h(s(C)?C.enter:C);0;var I=!1!==a&&!re,F=fs(E),P=i._enterCb=H(function(){I&&(ts(i,N),ts(i,T)),P.cancelled?(I&&ts(i,S),D&&D(i)):M&&M(i),i._enterCb=null});e.data.show||en(e,"insert",function(){var t=i.parentNode,n=t&&t._pending&&t._pending[e.key];n&&n.tag===e.tag&&n.elm._leaveCb&&n.elm._leaveCb(),E&&E(i,P)}),j&&j(i),I&&(es(i,S),es(i,T),Qa(function(){ts(i,S),P.cancelled||(es(i,N),F||(ls(L)?setTimeout(P,L):ns(i,c,P)))})),e.data.show&&(t&&t(),E&&E(i,P)),I||F||P()}}}function cs(e,t){var i=e.elm;r(i._enterCb)&&(i._enterCb.cancelled=!0,i._enterCb());var o=za(e.data.transition);if(n(o)||1!==i.nodeType)return t();if(!r(i._leaveCb)){var a=o.css,c=o.type,u=o.leaveClass,l=o.leaveToClass,f=o.leaveActiveClass,p=o.beforeLeave,d=o.leave,v=o.afterLeave,m=o.leaveCancelled,y=o.delayLeave,g=o.duration,_=!1!==a&&!re,b=fs(d),$=h(s(g)?g.leave:g);0;var w=i._leaveCb=H(function(){i.parentNode&&i.parentNode._pending&&(i.parentNode._pending[e.key]=null),_&&(ts(i,l),ts(i,f)),w.cancelled?(_&&ts(i,u),m&&m(i)):(t(),v&&v(i)),i._leaveCb=null});y?y(x):x()}function x(){w.cancelled||(!e.data.show&&i.parentNode&&((i.parentNode._pending||(i.parentNode._pending={}))[e.key]=e),p&&p(i),_&&(es(i,u),es(i,f),Qa(function(){ts(i,u),w.cancelled||(es(i,l),b||(ls($)?setTimeout(w,$):ns(i,c,w)))})),d&&d(i,w),_||b||w())}}function us(e,t,n){"number"!=typeof e?we("<transition> explicit "+t+" duration is not a valid number - got "+JSON.stringify(e)+".",n.context):isNaN(e)&&we("<transition> explicit "+t+" duration is NaN - the duration expression might be incorrect.",n.context)}function ls(e){return"number"==typeof e&&!isNaN(e)}function fs(e){if(n(e))return!1;var t=e.fns;return r(t)?fs(Array.isArray(t)?t[0]:t):(e._length||e.length)>1}function ps(e,t){!0!==t.data.show&&ss(t)}var ds=Y?{create:ps,activate:ps,remove:function(e,t){!0!==e.data.show?cs(e,t):t()}}:{},vs=[Oo,Io,wa,Oa,Ra,ds],hs=vs.concat(xo),ms=ho({nodeOps:ao,modules:hs});re&&document.addEventListener("selectionchange",function(){var e=document.activeElement;e&&e.vmodel&&Cs(e,"input")});var ys={inserted:function(e,t,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?en(n,"postpatch",function(){ys.componentUpdated(e,t,n)}):gs(e,t,n.context),e._vOptions=[].map.call(e.options,$s)):("textarea"===n.tag||Ki(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener("compositionstart",ws),e.addEventListener("compositionend",xs),e.addEventListener("change",xs),re&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){gs(e,t,n.context);var r=e._vOptions,i=e._vOptions=[].map.call(e.options,$s);if(i.some(function(e,t){return!P(e,r[t])}))(e.multiple?t.value.some(function(e){return bs(e,i)}):t.value!==t.oldValue&&bs(t.value,i))&&Cs(e,"change")}}};function gs(e,t,n){_s(e,t,n),(ne||ie)&&setTimeout(function(){_s(e,t,n)},0)}function _s(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=e.options.length;s<c;s++)if(a=e.options[s],i)o=R(r,$s(a))>-1,a.selected!==o&&(a.selected=o);else if(P($s(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function bs(e,t){return t.every(function(t){return!P(t,e)})}function $s(e){return"_value"in e?e._value:e.value}function ws(e){e.target.composing=!0}function xs(e){e.target.composing&&(e.target.composing=!1,Cs(e.target,"input"))}function Cs(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function As(e){return!e.componentInstance||e.data&&e.data.transition?e:As(e.componentInstance._vnode)}var ks={bind:function(e,t,n){var r=t.value,i=(n=As(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,ss(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=As(n)).data&&n.data.transition?(n.data.show=!0,r?ss(n,function(){e.style.display=e.__vOriginalDisplay}):cs(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}},Os={model:ys,show:ks},Ss={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Ts(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Ts(nr(t.children)):e}function Ns(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[C(o)]=i[o];return t}function js(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}function Es(e){for(;e=e.parent;)if(e.data.transition)return!0}function Ms(e,t){return t.key===e.key&&t.tag===e.tag}var Ds=function(e){return e.tag||tr(e)},Ls=function(e){return"show"===e.name},Is={name:"transition",props:Ss,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(Ds)).length){0;var r=this.mode;0;var i=n[0];if(Es(this.$vnode))return i;var o=Ts(i);if(!o)return i;if(this._leaving)return js(e,i);var s="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?s+"comment":s+o.tag:a(o.key)?0===String(o.key).indexOf(s)?o.key:s+o.key:o.key;var c=(o.data||(o.data={})).transition=Ns(this),u=this._vnode,l=Ts(u);if(o.data.directives&&o.data.directives.some(Ls)&&(o.data.show=!0),l&&l.data&&!Ms(o,l)&&!tr(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=E({},c);if("out-in"===r)return this._leaving=!0,en(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),js(e,i);if("in-out"===r){if(tr(o))return u;var p,d=function(){p()};en(c,"afterEnter",d),en(c,"enterCancelled",d),en(f,"delayLeave",function(e){p=e})}}return i}}},Fs=E({tag:String,moveClass:String},Ss);delete Fs.mode;var Ps={props:Fs,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=fr(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Ns(this),s=0;s<i.length;s++){var c=i[s];if(c.tag)if(null!=c.key&&0!==String(c.key).indexOf("__vlist"))o.push(c),n[c.key]=c,(c.data||(c.data={})).transition=a;else;}if(r){for(var u=[],l=[],f=0;f<r.length;f++){var p=r[f];p.data.transition=a,p.data.pos=p.elm.getBoundingClientRect(),n[p.key]?u.push(p):l.push(p)}this.kept=e(t,null,u),this.removed=l}return e(t,null,o)},updated:function(){var e=this.prevChildren,t=this.moveClass||(this.name||"v")+"-move";e.length&&this.hasMove(e[0].elm,t)&&(e.forEach(Rs),e.forEach(Hs),e.forEach(Bs),this._reflow=document.body.offsetHeight,e.forEach(function(e){if(e.data.moved){var n=e.elm,r=n.style;es(n,t),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(Za,n._moveCb=function e(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(Za,e),n._moveCb=null,ts(n,t))})}}))},methods:{hasMove:function(e,t){if(!Ja)return!1;if(this._hasMove)return this._hasMove;var n=e.cloneNode();e._transitionClasses&&e._transitionClasses.forEach(function(e){Ua(n,e)}),Ba(n,t),n.style.display="none",this.$el.appendChild(n);var r=is(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}};function Rs(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function Hs(e){e.data.newPos=e.elm.getBoundingClientRect()}function Bs(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}var Us={Transition:Is,TransitionGroup:Ps};oi.config.mustUseProp=wi,oi.config.isReservedTag=Ui,oi.config.isReservedAttr=bi,oi.config.getTagNamespace=zi,oi.config.isUnknownElement=Ji,E(oi.options.directives,Os),E(oi.options.components,Us),oi.prototype.__patch__=Y?ms:D,oi.prototype.$mount=function(e,t){return vr(this,e=e&&Y?qi(e):void 0,t)},Y&&setTimeout(function(){V.devtools&&ve&&ve.emit("init",oi)},0);var zs=/\{\{((?:.|\r?\n)+?)\}\}/g,Vs=/[-.*+?^${}()|[\]\/\\]/g,Js=w(function(e){var t=e[0].replace(Vs,"\\$&"),n=e[1].replace(Vs,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});function Ks(e,t){var n=t?Js(t):zs;if(n.test(e)){for(var r,i,o,a=[],s=[],c=n.lastIndex=0;r=n.exec(e);){(i=r.index)>c&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=Po(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c<e.length&&(s.push(o=e.slice(c)),a.push(JSON.stringify(o))),{expression:a.join("+"),tokens:s}}}function qs(e,t){t.warn;var n=Go(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Zo(e,"class",!1);r&&(e.classBinding=r)}function Ws(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}var Zs={staticKeys:["staticClass"],transformNode:qs,genData:Ws};function Gs(e,t){t.warn;var n=Go(e,"style");n&&(e.staticStyle=JSON.stringify(Sa(n)));var r=Zo(e,"style",!1);r&&(e.styleBinding=r)}function Xs(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}var Ys,Qs={staticKeys:["staticStyle"],transformNode:Gs,genData:Xs},ec={decode:function(e){return(Ys=Ys||document.createElement("div")).innerHTML=e,Ys.textContent}},tc=m("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),nc=m("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),rc=m("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),ic=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,oc=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ac="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+J.source+"]*",sc="((?:"+ac+"\\:)?"+ac+")",cc=new RegExp("^<"+sc),uc=/^\s*(\/?)>/,lc=new RegExp("^<\\/"+sc+"[^>]*>"),fc=/^<!DOCTYPE [^>]+>/i,pc=/^<!\--/,dc=/^<!\[/,vc=m("script,style,textarea",!0),hc={},mc={"&lt;":"<","&gt;":">","&quot;":'"',"&amp;":"&","&#10;":"\n","&#9;":"\t","&#39;":"'"},yc=/&(?:lt|gt|quot|amp|#39);/g,gc=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,_c=m("pre,textarea",!0),bc=function(e,t){return e&&_c(e)&&"\n"===t[0]};function $c(e,t){var n=t?gc:yc;return e.replace(n,function(e){return mc[e]})}function wc(e,t){for(var n,r,i=[],o=t.expectHTML,a=t.isUnaryTag||L,s=t.canBeLeftOpenTag||L,c=0;e;){if(n=e,r&&vc(r)){var u=0,l=r.toLowerCase(),f=hc[l]||(hc[l]=new RegExp("([\\s\\S]*?)(</"+l+"[^>]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,vc(l)||"noscript"===l||(n=n.replace(/<!\--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),bc(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,k(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(pc.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v),c,c+v+3),x(v+3);continue}}if(dc.test(e)){var h=e.indexOf("]>");if(h>=0){x(h+2);continue}}var m=e.match(fc);if(m){x(m[0].length);continue}var y=e.match(lc);if(y){var g=c;x(y[0].length),k(y[1],g,c);continue}var _=C();if(_){A(_),bc(_.tagName,e)&&x(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(lc.test($)||cc.test($)||pc.test($)||dc.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d)}d<0&&(b=e),b&&x(b.length),t.chars&&b&&t.chars(b,c-b.length,c)}if(e===n){t.chars&&t.chars(e);break}}function x(t){c+=t,e=e.substring(t)}function C(){var t=e.match(cc);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(x(t[0].length);!(n=e.match(uc))&&(r=e.match(oc)||e.match(ic));)r.start=c,x(r[0].length),r.end=c,i.attrs.push(r);if(n)return i.unarySlash=n[1],x(n[0].length),i.end=c,i}}function A(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&rc(n)&&k(r),s(n)&&r===n&&k(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p<l;p++){var d=e.attrs[p],v=d[3]||d[4]||d[5]||"",h="a"===n&&"href"===d[1]?t.shouldDecodeNewlinesForHref:t.shouldDecodeNewlines;f[p]={name:d[1],value:$c(v,h)}}u||(i.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:f,start:e.start,end:e.end}),r=n),t.start&&t.start(n,f,u,e.start,e.end)}function k(e,n,o){var a,s;if(null==n&&(n=c),null==o&&(o=c),e)for(s=e.toLowerCase(),a=i.length-1;a>=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}k()}var xc,Cc,Ac,kc,Oc,Sc,Tc,Nc,jc,Ec=/^@|^v-on:/,Mc=/^v-|^@|^:|^#/,Dc=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Lc=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Ic=/^\(|\)$/g,Fc=/^\[.*\]$/,Pc=/:(.*)$/,Rc=/^:|^\.|^v-bind:/,Hc=/\.[^.\]]+(?=[^\]]*$)/g,Bc=/^v-slot(:|$)|^#/,Uc=/[\r\n]/,zc=/\s+/g,Vc=/[\s"'<>\/=]/,Jc=w(ec.decode),Kc="_empty_";function qc(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:vu(t),rawAttrsMap:{},parent:n,children:[]}}function Wc(e,t){xc=t.warn||Ho,Sc=t.isPreTag||L,Tc=t.mustUseProp||L,Nc=t.getTagNamespace||L;var n=t.isReservedTag||L;jc=function(e){return!!e.component||!n(e.tag)},Ac=Bo(t.modules,"transformNode"),kc=Bo(t.modules,"preTransformNode"),Oc=Bo(t.modules,"postTransformNode"),Cc=t.delimiters;var r,i,o=[],a=!1!==t.preserveWhitespace,s=t.whitespace,c=!1,u=!1;function l(e){if(f(e),c||e.processed||(e=Xc(e,t)),o.length||e===r||r.if&&(e.elseif||e.else)&&ou(r,{exp:e.elseif,block:e}),i&&!e.forbidden)if(e.elseif||e.else)ru(e,i);else{if(e.slotScope){var n=e.slotTarget||'"default"';(i.scopedSlots||(i.scopedSlots={}))[n]=e}i.children.push(e),e.parent=i}e.children=e.children.filter(function(e){return!e.slotScope}),f(e),e.pre&&(c=!1),Sc(e.tag)&&(u=!1);for(var a=0;a<Oc.length;a++)Oc[a](e,t)}function f(e){if(!u)for(var t;(t=e.children[e.children.length-1])&&3===t.type&&" "===t.text;)e.children.pop()}return wc(e,{warn:xc,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,n,a,s,f){var p=i&&i.ns||Nc(e);ne&&"svg"===p&&(n=_u(n));var d=qc(e,n,i);p&&(d.ns=p),mu(d)&&!de()&&(d.forbidden=!0);for(var v=0;v<kc.length;v++)d=kc[v](d,t)||d;c||(Zc(d),d.pre&&(c=!0)),Sc(d.tag)&&(u=!0),c?Gc(d):d.processed||(eu(d),nu(d),au(d)),r||(r=d),a?l(d):(i=d,o.push(d))},end:function(e,t,n){var r=o[o.length-1];o.length-=1,i=o[o.length-1],l(r)},chars:function(e,t,n){if(i&&(!ne||"textarea"!==i.tag||i.attrsMap.placeholder!==e)){var r,o,l=i.children;if(e=u||e.trim()?hu(i)?e:Jc(e):l.length?s?"condense"===s&&Uc.test(e)?"":" ":a?" ":"":"")u||"condense"!==s||(e=e.replace(zc," ")),!c&&" "!==e&&(r=Ks(e,Cc))?o={type:2,expression:r.expression,tokens:r.tokens,text:e}:" "===e&&l.length&&" "===l[l.length-1].text||(o={type:3,text:e}),o&&l.push(o)}},comment:function(e,t,n){if(i){var r={type:3,text:e,isComment:!0};0,i.children.push(r)}}}),r}function Zc(e){null!=Go(e,"v-pre")&&(e.pre=!0)}function Gc(e){var t=e.attrsList,n=t.length;if(n)for(var r=e.attrs=new Array(n),i=0;i<n;i++)r[i]={name:t[i].name,value:JSON.stringify(t[i].value)},null!=t[i].start&&(r[i].start=t[i].start,r[i].end=t[i].end);else e.pre||(e.plain=!0)}function Xc(e,t){Yc(e),e.plain=!e.key&&!e.scopedSlots&&!e.attrsList.length,Qc(e),su(e),uu(e),lu(e);for(var n=0;n<Ac.length;n++)e=Ac[n](e,t)||e;return fu(e),e}function Yc(e){var t=Zo(e,"key");t&&(e.key=t)}function Qc(e){var t=Zo(e,"ref");t&&(e.ref=t,e.refInFor=pu(e))}function eu(e){var t;if(t=Go(e,"v-for")){var n=tu(t);n&&E(e,n)}}function tu(e){var t=e.match(Dc);if(t){var n={};n.for=t[2].trim();var r=t[1].trim().replace(Ic,""),i=r.match(Lc);return i?(n.alias=r.replace(Lc,"").trim(),n.iterator1=i[1].trim(),i[2]&&(n.iterator2=i[2].trim())):n.alias=r,n}}function nu(e){var t=Go(e,"v-if");if(t)e.if=t,ou(e,{exp:t,block:e});else{null!=Go(e,"v-else")&&(e.else=!0);var n=Go(e,"v-else-if");n&&(e.elseif=n)}}function ru(e,t){var n=iu(t.children);n&&n.if&&ou(n,{exp:e.elseif,block:e})}function iu(e){for(var t=e.length;t--;){if(1===e[t].type)return e[t];e.pop()}}function ou(e,t){e.ifConditions||(e.ifConditions=[]),e.ifConditions.push(t)}function au(e){null!=Go(e,"v-once")&&(e.once=!0)}function su(e){var t;"template"===e.tag?(t=Go(e,"scope"),e.slotScope=t||Go(e,"slot-scope")):(t=Go(e,"slot-scope"))&&(e.slotScope=t);var n=Zo(e,"slot");if(n&&(e.slotTarget='""'===n?'"default"':n,e.slotTargetDynamic=!(!e.attrsMap[":slot"]&&!e.attrsMap["v-bind:slot"]),"template"===e.tag||e.slotScope||zo(e,"slot",n,Wo(e,"slot"))),"template"===e.tag){var r=Xo(e,Bc);if(r){0;var i=cu(r),o=i.name,a=i.dynamic;e.slotTarget=o,e.slotTargetDynamic=a,e.slotScope=r.value||Kc}}else{var s=Xo(e,Bc);if(s){0;var c=e.scopedSlots||(e.scopedSlots={}),u=cu(s),l=u.name,f=u.dynamic,p=c[l]=qc("template",[],e);p.slotTarget=l,p.slotTargetDynamic=f,p.children=e.children.filter(function(e){if(!e.slotScope)return e.parent=p,!0}),p.slotScope=s.value||Kc,e.children=[],e.plain=!1}}}function cu(e){var t=e.name.replace(Bc,"");return t||"#"!==e.name[0]&&(t="default"),Fc.test(t)?{name:t.slice(1,-1),dynamic:!0}:{name:'"'+t+'"',dynamic:!1}}function uu(e){"slot"===e.tag&&(e.slotName=Zo(e,"name"))}function lu(e){var t;(t=Zo(e,"is"))&&(e.component=t),null!=Go(e,"inline-template")&&(e.inlineTemplate=!0)}function fu(e){var t,n,r,i,o,a,s,c,u=e.attrsList;for(t=0,n=u.length;t<n;t++){if(r=i=u[t].name,o=u[t].value,Mc.test(r))if(e.hasBindings=!0,(a=du(r.replace(Mc,"")))&&(r=r.replace(Hc,"")),Rc.test(r))r=r.replace(Rc,""),o=Po(o),(c=Fc.test(r))&&(r=r.slice(1,-1)),a&&(a.prop&&!c&&"innerHtml"===(r=C(r))&&(r="innerHTML"),a.camel&&!c&&(r=C(r)),a.sync&&(s=ea(o,"$event"),c?qo(e,'"update:"+('+r+")",s,null,!1,xc,u[t],!0):(qo(e,"update:"+C(r),s,null,!1,xc,u[t]),O(r)!==C(r)&&qo(e,"update:"+O(r),s,null,!1,xc,u[t])))),a&&a.prop||!e.component&&Tc(e.tag,e.attrsMap.type,r)?Uo(e,r,o,u[t],c):zo(e,r,o,u[t],c);else if(Ec.test(r))r=r.replace(Ec,""),(c=Fc.test(r))&&(r=r.slice(1,-1)),qo(e,r,o,a,!1,xc,u[t],c);else{var l=(r=r.replace(Mc,"")).match(Pc),f=l&&l[1];c=!1,f&&(r=r.slice(0,-(f.length+1)),Fc.test(f)&&(f=f.slice(1,-1),c=!0)),Jo(e,r,i,o,f,c,a,u[t])}else zo(e,r,JSON.stringify(o),u[t]),!e.component&&"muted"===r&&Tc(e.tag,e.attrsMap.type,r)&&Uo(e,r,"true",u[t])}}function pu(e){for(var t=e;t;){if(void 0!==t.for)return!0;t=t.parent}return!1}function du(e){var t=e.match(Hc);if(t){var n={};return t.forEach(function(e){n[e.slice(1)]=!0}),n}}function vu(e){for(var t={},n=0,r=e.length;n<r;n++)t[e[n].name]=e[n].value;return t}function hu(e){return"script"===e.tag||"style"===e.tag}function mu(e){return"style"===e.tag||"script"===e.tag&&(!e.attrsMap.type||"text/javascript"===e.attrsMap.type)}var yu=/^xmlns:NS\d+/,gu=/^NS\d+:/;function _u(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];yu.test(r.name)||(r.name=r.name.replace(gu,""),t.push(r))}return t}function bu(e,t){for(var n=e;n;)n.for&&n.alias===t&&xc("<"+e.tag+' v-model="'+t+'">: You are binding v-model directly to a v-for iteration alias. This will not be able to modify the v-for source array because writing to the alias is like modifying a function local variable. Consider using an array of objects and use v-model on an object property instead.',e.rawAttrsMap["v-model"]),n=n.parent}function $u(e,t){if("input"===e.tag){var n,r=e.attrsMap;if(!r["v-model"])return;if((r[":type"]||r["v-bind:type"])&&(n=Zo(e,"type")),r.type||n||!r["v-bind"]||(n="("+r["v-bind"]+").type"),n){var i=Go(e,"v-if",!0),o=i?"&&("+i+")":"",a=null!=Go(e,"v-else",!0),s=Go(e,"v-else-if",!0),c=wu(e);eu(c),Vo(c,"type","checkbox"),Xc(c,t),c.processed=!0,c.if="("+n+")==='checkbox'"+o,ou(c,{exp:c.if,block:c});var u=wu(e);Go(u,"v-for",!0),Vo(u,"type","radio"),Xc(u,t),ou(c,{exp:"("+n+")==='radio'"+o,block:u});var l=wu(e);return Go(l,"v-for",!0),Vo(l,":type",n),Xc(l,t),ou(c,{exp:i,block:l}),a?c.else=!0:s&&(c.elseif=s),c}}}function wu(e){return qc(e.tag,e.attrsList.slice(),e.parent)}var xu={preTransformNode:$u},Cu=[Zs,Qs,xu];function Au(e,t){t.value&&Uo(e,"textContent","_s("+t.value+")",t)}function ku(e,t){t.value&&Uo(e,"innerHTML","_s("+t.value+")",t)}var Ou,Su,Tu={model:la,text:Au,html:ku},Nu={expectHTML:!0,modules:Cu,directives:Tu,isPreTag:Bi,isUnaryTag:tc,mustUseProp:wi,canBeLeftOpenTag:nc,isReservedTag:Ui,getTagNamespace:zi,staticKeys:F(Cu)},ju=w(Mu);function Eu(e,t){e&&(Ou=ju(t.staticKeys||""),Su=t.isReservedTag||L,Du(e),Lu(e,!1))}function Mu(e){return m("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))}function Du(e){if(e.static=Iu(e),1===e.type){if(!Su(e.tag)&&"slot"!==e.tag&&null==e.attrsMap["inline-template"])return;for(var t=0,n=e.children.length;t<n;t++){var r=e.children[t];Du(r),r.static||(e.static=!1)}if(e.ifConditions)for(var i=1,o=e.ifConditions.length;i<o;i++){var a=e.ifConditions[i].block;Du(a),a.static||(e.static=!1)}}}function Lu(e,t){if(1===e.type){if((e.static||e.once)&&(e.staticInFor=t),e.static&&e.children.length&&(1!==e.children.length||3!==e.children[0].type))return void(e.staticRoot=!0);if(e.staticRoot=!1,e.children)for(var n=0,r=e.children.length;n<r;n++)Lu(e.children[n],t||!!e.for);if(e.ifConditions)for(var i=1,o=e.ifConditions.length;i<o;i++)Lu(e.ifConditions[i].block,t)}}function Iu(e){return 2!==e.type&&(3===e.type||!(!e.pre&&(e.hasBindings||e.if||e.for||y(e.tag)||!Su(e.tag)||Fu(e)||!Object.keys(e).every(Ou))))}function Fu(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}var Pu=/^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/,Ru=/\([^)]*?\);*$/,Hu=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Bu={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Uu={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},zu=function(e){return"if("+e+")return null;"},Vu={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:zu("$event.target !== $event.currentTarget"),ctrl:zu("!$event.ctrlKey"),shift:zu("!$event.shiftKey"),alt:zu("!$event.altKey"),meta:zu("!$event.metaKey"),left:zu("'button' in $event && $event.button !== 0"),middle:zu("'button' in $event && $event.button !== 1"),right:zu("'button' in $event && $event.button !== 2")};function Ju(e,t){var n=t?"nativeOn:":"on:",r="",i="";for(var o in e){var a=Ku(e[o]);e[o]&&e[o].dynamic?i+=o+","+a+",":r+='"'+o+'":'+a+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function Ku(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return Ku(e)}).join(",")+"]";var t=Hu.test(e.value),n=Pu.test(e.value),r=Hu.test(e.value.replace(Ru,""));if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(Vu[s])o+=Vu[s],Bu[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=zu(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=qu(a)),o&&(i+=o),"function($event){"+i+(t?"return "+e.value+"($event)":n?"return ("+e.value+")($event)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function qu(e){return"if(!$event.type.indexOf('key')&&"+e.map(Wu).join("&&")+")return null;"}function Wu(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Bu[e],r=Uu[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}function Zu(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}}function Gu(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}}var Xu={on:Zu,bind:Gu,cloak:D},Yu=function(e){this.options=e,this.warn=e.warn||Ho,this.transforms=Bo(e.modules,"transformCode"),this.dataGenFns=Bo(e.modules,"genData"),this.directives=E(E({},Xu),e.directives);var t=e.isReservedTag||L;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Qu(e,t){var n=new Yu(t);return{render:"with(this){return "+(e?el(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function el(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return tl(e,t);if(e.once&&!e.onceProcessed)return nl(e,t);if(e.for&&!e.forProcessed)return ol(e,t);if(e.if&&!e.ifProcessed)return rl(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return _l(e,t);var n;if(e.component)n=bl(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=al(e,t));var i=e.inlineTemplate?null:dl(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o<t.transforms.length;o++)n=t.transforms[o](e,n);return n}return dl(e,t)||"void 0"}function tl(e,t){e.staticProcessed=!0;var n=t.pre;return e.pre&&(t.pre=e.pre),t.staticRenderFns.push("with(this){return "+el(e,t)+"}"),t.pre=n,"_m("+(t.staticRenderFns.length-1)+(e.staticInFor?",true":"")+")"}function nl(e,t){if(e.onceProcessed=!0,e.if&&!e.ifProcessed)return rl(e,t);if(e.staticInFor){for(var n="",r=e.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?"_o("+el(e,t)+","+t.onceId+++","+n+")":el(e,t)}return tl(e,t)}function rl(e,t,n,r){return e.ifProcessed=!0,il(e.ifConditions.slice(),t,n,r)}function il(e,t,n,r){if(!e.length)return r||"_e()";var i=e.shift();return i.exp?"("+i.exp+")?"+o(i.block)+":"+il(e,t,n,r):""+o(i.block);function o(e){return n?n(e,t):e.once?nl(e,t):el(e,t)}}function ol(e,t,n,r){var i=e.for,o=e.alias,a=e.iterator1?","+e.iterator1:"",s=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+a+s+"){return "+(n||el)(e,t)+"})"}function al(e,t){var n="{",r=sl(e,t);r&&(n+=r+","),e.key&&(n+="key:"+e.key+","),e.ref&&(n+="ref:"+e.ref+","),e.refInFor&&(n+="refInFor:true,"),e.pre&&(n+="pre:true,"),e.component&&(n+='tag:"'+e.tag+'",');for(var i=0;i<t.dataGenFns.length;i++)n+=t.dataGenFns[i](e);if(e.attrs&&(n+="attrs:"+$l(e.attrs)+","),e.props&&(n+="domProps:"+$l(e.props)+","),e.events&&(n+=Ju(e.events,!1)+","),e.nativeEvents&&(n+=Ju(e.nativeEvents,!0)+","),e.slotTarget&&!e.slotScope&&(n+="slot:"+e.slotTarget+","),e.scopedSlots&&(n+=ul(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var o=cl(e,t);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+$l(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function sl(e,t){var n=e.directives;if(n){var r,i,o,a,s="directives:[",c=!1;for(r=0,i=n.length;r<i;r++){o=n[r],a=!0;var u=t.directives[o.name];u&&(a=!!u(e,o,t.warn)),a&&(c=!0,s+='{name:"'+o.name+'",rawName:"'+o.rawName+'"'+(o.value?",value:("+o.value+"),expression:"+JSON.stringify(o.value):"")+(o.arg?",arg:"+(o.isDynamicArg?o.arg:'"'+o.arg+'"'):"")+(o.modifiers?",modifiers:"+JSON.stringify(o.modifiers):"")+"},")}return c?s.slice(0,-1)+"]":void 0}}function cl(e,t){var n=e.children[0];if(n&&1===n.type){var r=Qu(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map(function(e){return"function(){"+e+"}"}).join(",")+"]}"}}function ul(e,t,n){var r=e.for||Object.keys(t).some(function(e){var n=t[e];return n.slotTargetDynamic||n.if||n.for||fl(n)}),i=!!e.if;if(!r)for(var o=e.parent;o;){if(o.slotScope&&o.slotScope!==Kc||o.for){r=!0;break}o.if&&(i=!0),o=o.parent}var a=Object.keys(t).map(function(e){return pl(t[e],n)}).join(",");return"scopedSlots:_u(["+a+"]"+(r?",null,true":"")+(!r&&i?",null,false,"+ll(a):"")+")"}function ll(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0}function fl(e){return 1===e.type&&("slot"===e.tag||e.children.some(fl))}function pl(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return rl(e,t,pl,"null");if(e.for&&!e.forProcessed)return ol(e,t,pl);var r=e.slotScope===Kc?"":String(e.slotScope),i="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(dl(e,t)||"undefined")+":undefined":dl(e,t)||"undefined":el(e,t))+"}",o=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+i+o+"}"}function dl(e,t,n,r,i){var o=e.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?t.maybeComponent(a)?",1":",0":"";return""+(r||el)(a,t)+s}var c=n?vl(o,t.maybeComponent):0,u=i||ml;return"["+o.map(function(e){return u(e,t)}).join(",")+"]"+(c?","+c:"")}}function vl(e,t){for(var n=0,r=0;r<e.length;r++){var i=e[r];if(1===i.type){if(hl(i)||i.ifConditions&&i.ifConditions.some(function(e){return hl(e.block)})){n=2;break}(t(i)||i.ifConditions&&i.ifConditions.some(function(e){return t(e.block)}))&&(n=1)}}return n}function hl(e){return void 0!==e.for||"template"===e.tag||"slot"===e.tag}function ml(e,t){return 1===e.type?el(e,t):3===e.type&&e.isComment?gl(e):yl(e)}function yl(e){return"_v("+(2===e.type?e.expression:wl(JSON.stringify(e.text)))+")"}function gl(e){return"_e("+JSON.stringify(e.text)+")"}function _l(e,t){var n=e.slotName||'"default"',r=dl(e,t),i="_t("+n+(r?","+r:""),o=e.attrs||e.dynamicAttrs?$l((e.attrs||[]).concat(e.dynamicAttrs||[]).map(function(e){return{name:C(e.name),value:e.value,dynamic:e.dynamic}})):null,a=e.attrsMap["v-bind"];return!o&&!a||r||(i+=",null"),o&&(i+=","+o),a&&(i+=(o?"":",null")+","+a),i+")"}function bl(e,t,n){var r=t.inlineTemplate?null:dl(t,n,!0);return"_c("+e+","+al(t,n)+(r?","+r:"")+")"}function $l(e){for(var t="",n="",r=0;r<e.length;r++){var i=e[r],o=wl(i.value);i.dynamic?n+=i.name+","+o+",":t+='"'+i.name+'":'+o+","}return t="{"+t.slice(0,-1)+"}",n?"_d("+t+",["+n.slice(0,-1)+"])":t}function wl(e){return e.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}var xl=new RegExp("\\b"+"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments".split(",").join("\\b|\\b")+"\\b"),Cl=new RegExp("\\b"+"delete,typeof,void".split(",").join("\\s*\\([^\\)]*\\)|\\b")+"\\s*\\([^\\)]*\\)"),Al=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;function kl(e,t){e&&Ol(e,t)}function Ol(e,t){if(1===e.type){for(var n in e.attrsMap)if(Mc.test(n)){var r=e.attrsMap[n];if(r){var i=e.rawAttrsMap[n];"v-for"===n?Tl(e,'v-for="'+r+'"',t,i):"v-slot"===n||"#"===n[0]?El(r,n+'="'+r+'"',t,i):Ec.test(n)?Sl(r,n+'="'+r+'"',t,i):jl(r,n+'="'+r+'"',t,i)}}if(e.children)for(var o=0;o<e.children.length;o++)Ol(e.children[o],t)}else 2===e.type&&jl(e.expression,e.text,t,e)}function Sl(e,t,n,r){var i=e.replace(Al,""),o=i.match(Cl);o&&"$"!==i.charAt(o.index-1)&&n('avoid using JavaScript unary operator as property name: "'+o[0]+'" in expression '+t.trim(),r),jl(e,t,n,r)}function Tl(e,t,n,r){jl(e.for||"",t,n,r),Nl(e.alias,"v-for alias",t,n,r),Nl(e.iterator1,"v-for iterator",t,n,r),Nl(e.iterator2,"v-for iterator",t,n,r)}function Nl(e,t,n,r,i){if("string"==typeof e)try{new Function("var "+e+"=_")}catch(Xl){r("invalid "+t+' "'+e+'" in expression: '+n.trim(),i)}}function jl(e,t,n,r){try{new Function("return "+e)}catch(Xl){var i=e.replace(Al,"").match(xl);n(i?'avoid using JavaScript keyword as property name: "'+i[0]+'"\n Raw expression: '+t.trim():"invalid expression: "+Xl.message+" in\n\n "+e+"\n\n Raw expression: "+t.trim()+"\n",r)}}function El(e,t,n,r){try{new Function(e,"")}catch(Xl){n("invalid function parameter expression: "+Xl.message+" in\n\n "+e+"\n\n Raw expression: "+t.trim()+"\n",r)}}var Ml=2;function Dl(e,t,n){void 0===t&&(t=0),void 0===n&&(n=e.length);for(var r=e.split(/\r?\n/),i=0,o=[],a=0;a<r.length;a++)if((i+=r[a].length+1)>=t){for(var s=a-Ml;s<=a+Ml||n>i;s++)if(!(s<0||s>=r.length)){o.push(""+(s+1)+Ll(" ",3-String(s+1).length)+"| "+r[s]);var c=r[s].length;if(s===a){var u=t-(i-c)+1,l=n>i?c-u:n-t;o.push(" | "+Ll(" ",u)+Ll("^",l))}else if(s>a){if(n>i){var f=Math.min(n-i,c);o.push(" | "+Ll("^",f))}i+=c+1}}break}return o.join("\n")}function Ll(e,t){var n="";if(t>0)for(;1&t&&(n+=e),!((t>>>=1)<=0);)e+=e;return n}function Il(e,t){try{return new Function(e)}catch(n){return t.push({err:n,code:e}),D}}function Fl(e){var t=Object.create(null);return function(n,r,i){(r=E({},r)).warn;delete r.warn;var o=r.delimiters?String(r.delimiters)+n:n;if(t[o])return t[o];var a=e(n,r);var s={},c=[];return s.render=Il(a.render,c),s.staticRenderFns=a.staticRenderFns.map(function(e){return Il(e,c)}),t[o]=s}}function Pl(e){return function(t){function n(n,r){var i=Object.create(t),o=[],a=[],s=function(e,t,n){(n?a:o).push(e)};if(r)for(var c in r.modules&&(i.modules=(t.modules||[]).concat(r.modules)),r.directives&&(i.directives=E(Object.create(t.directives||null),r.directives)),r)"modules"!==c&&"directives"!==c&&(i[c]=r[c]);i.warn=s;var u=e(n.trim(),i);return u.errors=o,u.tips=a,u}return{compile:n,compileToFunctions:Fl(n)}}}var Rl,Hl=Pl(function(e,t){var n=Wc(e.trim(),t);!1!==t.optimize&&Eu(n,t);var r=Qu(n,t);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}}),Bl=Hl(Nu),Ul=Bl.compile,zl=Bl.compileToFunctions;function Vl(e){return(Rl=Rl||document.createElement("div")).innerHTML=e?'<a href="\n"/>':'<div a="\n"/>',Rl.innerHTML.indexOf("&#10;")>0}var Jl=!!Y&&Vl(!1),Kl=!!Y&&Vl(!0),ql=w(function(e){var t=qi(e);return t&&t.innerHTML}),Wl=oi.prototype.$mount;function Zl(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}oi.prototype.$mount=function(e,t){if((e=e&&qi(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=ql(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=Zl(e));if(r){0;var i=zl(r,{outputSourceRange:!1,shouldDecodeNewlines:Jl,shouldDecodeNewlinesForHref:Kl,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return Wl.call(this,e,t)},oi.compile=zl;var Gl=oi;exports.default=Gl;
4
  },{}],"Lue2":[function(require,module,exports) {
5
  "use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=t(require("vue"));function r(t){return(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})(t)}function n(t){return o(t)||s(t)||i()}function o(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}function s(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function i(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var a="undefined"!=typeof window;function u(t){return Array.isArray(t)||"object"===r(t)?Object.freeze(t):t}function l(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.reduce(function(t,r){var n=r.passengers[0],o="function"==typeof n?n(e):r.passengers;return t.concat(o)},[])}function c(t,e){return t.map(function(t,e){return[e,t]}).sort(function(t,r){return e(t[1],r[1])||t[0]-r[0]}).map(function(t){return t[1]})}function p(t,e){return e.reduce(function(e,r){return t.hasOwnProperty(r)&&(e[r]=t[r]),e},{})}var h={},d={},f={},g=e.extend({data:function(){return{transports:h,targets:d,sources:f,trackInstances:a}},methods:{open:function(t){if(a){var r=t.to,n=t.from,o=t.passengers,s=t.order,i=void 0===s?1/0:s;if(r&&n&&o){var l={to:r,from:n,passengers:u(o),order:i};-1===Object.keys(this.transports).indexOf(r)&&e.set(this.transports,r,[]);var p=this.$_getTransportIndex(l),h=this.transports[r].slice(0);-1===p?h.push(l):h[p]=l,this.transports[r]=c(h,function(t,e){return t.order-e.order})}}},close:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.to,n=t.from;if(r&&(n||!1!==e)&&this.transports[r])if(e)this.transports[r]=[];else{var o=this.$_getTransportIndex(t);if(o>=0){var s=this.transports[r].slice(0);s.splice(o,1),this.transports[r]=s}}},registerTarget:function(t,e,r){a&&(this.trackInstances&&!r&&this.targets[t]&&console.warn("[portal-vue]: Target ".concat(t," already exists")),this.$set(this.targets,t,Object.freeze([e])))},unregisterTarget:function(t){this.$delete(this.targets,t)},registerSource:function(t,e,r){a&&(this.trackInstances&&!r&&this.sources[t]&&console.warn("[portal-vue]: source ".concat(t," already exists")),this.$set(this.sources,t,Object.freeze([e])))},unregisterSource:function(t){this.$delete(this.sources,t)},hasTarget:function(t){return!(!this.targets[t]||!this.targets[t][0])},hasSource:function(t){return!(!this.sources[t]||!this.sources[t][0])},hasContentFor:function(t){return!!this.transports[t]&&!!this.transports[t].length},$_getTransportIndex:function(t){var e=t.to,r=t.from;for(var n in this.transports[e])if(this.transports[e][n].from===r)return+n;return-1}}}),m=new g(h),y=1,v=e.extend({name:"portal",props:{disabled:{type:Boolean},name:{type:String,default:function(){return String(y++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}}},created:function(){var t=this;this.$nextTick(function(){m.registerSource(t.name,t)})},mounted:function(){this.disabled||this.sendUpdate()},updated:function(){this.disabled?this.clear():this.sendUpdate()},beforeDestroy:function(){m.unregisterSource(this.name),this.clear()},watch:{to:function(t,e){e&&e!==t&&this.clear(e),this.sendUpdate()}},methods:{clear:function(t){var e={from:this.name,to:t||this.to};m.close(e)},normalizeSlots:function(){return this.$scopedSlots.default?[this.$scopedSlots.default]:this.$slots.default},normalizeOwnChildren:function(t){return"function"==typeof t?t(this.slotProps):t},sendUpdate:function(){var t=this.normalizeSlots();if(t){var e={from:this.name,to:this.to,passengers:n(t),order:this.order};m.open(e)}else this.clear()}},render:function(t){var e=this.$slots.default||this.$scopedSlots.default||[],r=this.tag;return e&&this.disabled?e.length<=1&&this.slim?this.normalizeOwnChildren(e)[0]:t(r,[this.normalizeOwnChildren(e)]):this.slim?t():t(r,{class:{"v-portal":!0},style:{display:"none"},key:"v-portal-placeholder"})}}),S=e.extend({name:"portalTarget",props:{multiple:{type:Boolean,default:!1},name:{type:String,required:!0},slim:{type:Boolean,default:!1},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},data:function(){return{transports:m.transports,firstRender:!0}},created:function(){var t=this;this.$nextTick(function(){m.registerTarget(t.name,t)})},watch:{ownTransports:function(){this.$emit("change",this.children().length>0)},name:function(t,e){m.unregisterTarget(e),m.registerTarget(t,this)}},mounted:function(){var t=this;this.transition&&this.$nextTick(function(){t.firstRender=!1})},beforeDestroy:function(){m.unregisterTarget(this.name)},computed:{ownTransports:function(){var t=this.transports[this.name]||[];return this.multiple?t:0===t.length?[]:[t[t.length-1]]},passengers:function(){return l(this.ownTransports,this.slotProps)}},methods:{children:function(){return 0!==this.passengers.length?this.passengers:this.$scopedSlots.default?this.$scopedSlots.default(this.slotProps):this.$slots.default||[]},noWrapper:function(){var t=this.slim&&!this.transition;return t&&this.children().length>1&&console.warn("[portal-vue]: PortalTarget with `slim` option received more than one child element."),t}},render:function(t){var e=this.noWrapper(),r=this.children(),n=this.transition||this.tag;return e?r[0]:this.slim&&!n?t():t(n,{props:{tag:this.transition&&this.tag?this.tag:void 0},class:{"vue-portal-target":!0}},r)}}),b=0,T=["disabled","name","order","slim","slotProps","tag","to"],$=["multiple","transition"],w=e.extend({name:"MountingPortal",inheritAttrs:!1,props:{append:{type:[Boolean,String]},bail:{type:Boolean},mountTo:{type:String,required:!0},disabled:{type:Boolean},name:{type:String,default:function(){return"mounted_"+String(b++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}},multiple:{type:Boolean,default:!1},targetSlim:{type:Boolean},targetSlotProps:{type:Object,default:function(){return{}}},targetTag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},created:function(){if("undefined"!=typeof document){var t=document.querySelector(this.mountTo);if(t){var e=this.$props;if(m.targets[e.name])e.bail?console.warn("[portal-vue]: Target ".concat(e.name," is already mounted.\n Aborting because 'bail: true' is set")):this.portalTarget=m.targets[e.name];else{var r=e.append;if(r){var n="string"==typeof r?r:"DIV",o=document.createElement(n);t.appendChild(o),t=o}var s=p(this.$props,$);s.slim=this.targetSlim,s.tag=this.targetTag,s.slotProps=this.targetSlotProps,s.name=this.to,this.portalTarget=new S({el:t,parent:this.$parent||this,propsData:s})}}else console.error("[portal-vue]: Mount Point '".concat(this.mountTo,"' not found in document"))}},beforeDestroy:function(){var t=this.portalTarget;if(this.append){var e=t.$el;e.parentNode.removeChild(e)}t.$destroy()},render:function(t){if(!this.portalTarget)return console.warn("[portal-vue] Target wasn't mounted"),t();if(!this.$scopedSlots.manual){var e=p(this.$props,T);return t(v,{props:e,attrs:this.$attrs,on:this.$listeners,scopedSlots:this.$scopedSlots},this.$slots.default)}var r=this.$scopedSlots.manual({to:this.to});return Array.isArray(r)&&(r=r[0]),r||t()}});function P(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.component(e.portalName||"Portal",v),t.component(e.portalTargetName||"PortalTarget",S),t.component(e.MountingPortalName||"MountingPortal",w)}var x={install:P};exports.default=x,exports.Portal=v,exports.PortalTarget=S,exports.MountingPortal=w,exports.Wormhole=m;
6
+ },{"vue":"HYXJ"}],"aJOh":[function(require,module,exports) {
7
+ var e,n,o=Object.create(null);"undefined"!=typeof window&&(window.__VUE_HOT_MAP__=o);var t=!1,r=!1,i="beforeCreate";function s(e,n){if(n.functional){var t=n.render;n.render=function(n,r){var i=o[e].instances;return r&&i.indexOf(r.parent)<0&&i.push(r.parent),t(n,r)}}else c(n,i,function(){var n=o[e];n.Ctor||(n.Ctor=this.constructor),n.instances.push(this)}),c(n,"beforeDestroy",function(){var n=o[e].instances;n.splice(n.indexOf(this),1)})}function c(e,n,o){var t=e[n];e[n]=t?Array.isArray(t)?t.concat(o):[t,o]:[o]}function a(e){return function(n,o){try{e(n,o)}catch(t){console.error(t),console.warn("Something went wrong during Vue component hot-reload. Full reload required.")}}}function f(e,n){for(var o in e)o in n||delete e[o];for(var t in n)e[t]=n[t]}function u(e){if(e._u){var n=e._u;return e._u=function(e){try{return n(e,!0)}catch(o){return n(e,null,!0)}},function(){e._u=n}}}exports.install=function(o,s){t||(t=!0,e=o.__esModule?o.default:o,n=e.version.split(".").map(Number),r=s,e.config._lifecycleHooks.indexOf("init")>-1&&(i="init"),exports.compatible=n[0]>=2,exports.compatible||console.warn("[HMR] You are using a version of vue-hot-reload-api that is only compatible with Vue.js core ^2.0.0."))},exports.createRecord=function(e,n){if(!o[e]){var t=null;"function"==typeof n&&(n=(t=n).options),s(e,n),o[e]={Ctor:t,options:n,instances:[]}}},exports.isRecorded=function(e){return void 0!==o[e]},exports.rerender=a(function(e,n){var t=o[e];if(n){if("function"==typeof n&&(n=n.options),t.Ctor)t.Ctor.options.render=n.render,t.Ctor.options.staticRenderFns=n.staticRenderFns,t.instances.slice().forEach(function(e){e.$options.render=n.render,e.$options.staticRenderFns=n.staticRenderFns,e._staticTrees&&(e._staticTrees=[]),Array.isArray(t.Ctor.options.cached)&&(t.Ctor.options.cached=[]),Array.isArray(e.$options.cached)&&(e.$options.cached=[]);var o=u(e);e.$forceUpdate(),e.$nextTick(o)});else if(t.options.render=n.render,t.options.staticRenderFns=n.staticRenderFns,t.options.functional){if(Object.keys(n).length>2)f(t.options,n);else{var r=t.options._injectStyles;if(r){var i=n.render;t.options.render=function(e,n){return r.call(n),i(e,n)}}}t.options._Ctor=null,Array.isArray(t.options.cached)&&(t.options.cached=[]),t.instances.slice().forEach(function(e){e.$forceUpdate()})}}else t.instances.slice().forEach(function(e){e.$forceUpdate()})}),exports.reload=a(function(e,t){var r=o[e];if(t)if("function"==typeof t&&(t=t.options),s(e,t),r.Ctor){n[1]<2&&(r.Ctor.extendOptions=t);var i=r.Ctor.super.extend(t);i.options._Ctor=r.options._Ctor,r.Ctor.options=i.options,r.Ctor.cid=i.cid,r.Ctor.prototype=i.prototype,i.release&&i.release()}else f(r.options,t);r.instances.slice().forEach(function(e){e.$vnode&&e.$vnode.context?e.$vnode.context.$forceUpdate():console.warn("Root or manually mounted instance modified. Full reload required.")})});
8
+ },{}],"vi91":[function(require,module,exports) {
9
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:["logoSrc","logoAlt","pluginName"]};exports.default=e;
10
+ (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"wptb-settings-header"},[a("div",{staticClass:"wptb-settings-brand"},[a("img",{attrs:{src:t.logoSrc,alt:t.logoAlt}}),t._v(" "),a("span",{staticClass:"wptb-settings-header-name"},[t._v(" "+t._s(t.pluginName)+" ")])]),t._v(" "),a("div",{staticClass:"wptb-settings-links"},[t._t("default")],2)])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var e=require("vue-hot-reload-api");e.install(require("vue")),e.compatible&&(module.hot.accept(),module.hot.data?e.reload("$b57d2a",t):e.createRecord("$b57d2a",t))}}();})();
11
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"bosS":[function(require,module,exports) {
12
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={props:["name","current"],methods:{activePosition:function(){void 0!==this.current&&this.current!==this.name||this.$emit("activeSectionElement",this.$refs.sectionItem)}},computed:{isActive:function(){return this.activePosition(),void 0===this.current||this.current===this.name}}};exports.default=t;
13
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{ref:"sectionItem",staticClass:"wptb-settings-section-item",class:{disabled:!e.isActive},on:{click:function(t){return e.$emit("sectionchange",e.name,t.target)}}},[e._v(" "+e._s(e.name)+"\n")])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$354c7f",e):t.createRecord("$354c7f",e))}}();})();
14
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"jLHe":[function(require,module,exports) {
15
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={props:["activeItem","relativeParent"],methods:{toPx:function(t){return"".concat(t,"px")}},computed:{styleCalculations:function(){if(this.activeItem){var t=this.activeItem.getBoundingClientRect(),e=this.relativeParent.getBoundingClientRect(),i=Math.abs(t.left-e.left);return{width:this.toPx(t.width),height:"2px",bottom:0,left:this.toPx(i)}}return{}}}};exports.default=t;
16
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"wptb-menu-active-section-indicator",style:this.styleCalculations})},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$d41ec1",e):t.createRecord("$d41ec1",e))}}();})();
17
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"yPIx":[function(require,module,exports) {
18
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("./SectionItem")),t=n(require("./ActiveSectionIndicator"));function n(e){return e&&e.__esModule?e:{default:e}}var i={model:{prop:"currentSection",event:"updateSection"},props:{child:{type:Boolean,default:!1},items:Array,currentSection:String},components:{SectionItem:e.default,ActiveSectionIndicator:t.default},data:function(){return{innerCurrentSection:"",activeSectionElement:null}},mounted:function(){this.innerCurrentSection=this.currentSection||this.items[0]},watch:{innerCurrentSection:function(e){this.$emit("updateSection",e)}},methods:{handleSectionChange:function(e){this.innerCurrentSection=e},handleActiveSectionElement:function(e){this.activeSectionElement=e}}};exports.default=i;
19
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{ref:"wrapper",staticClass:"wptb-settings-sections-wrapper",class:{child:e.child}},[e._l(e.items,function(t){return n("section-item",{key:t,attrs:{name:t,current:e.innerCurrentSection},on:{sectionchange:e.handleSectionChange,activeSectionElement:e.handleActiveSectionElement}})}),e._v(" "),n("active-section-indicator",{attrs:{"relative-parent":e.$refs.wrapper,"active-item":e.activeSectionElement}})],2),e._v(" "),e._t("default")],2)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$07c866",e):t.createRecord("$07c866",e))}}();})();
20
+ },{"./SectionItem":"bosS","./ActiveSectionIndicator":"jLHe","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"wm3G":[function(require,module,exports) {
21
  "use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,s)}return r}function t(t){for(var s=1;s<arguments.length;s++){var a=null!=arguments[s]?arguments[s]:{};s%2?e(Object(a),!0).forEach(function(e){r(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var s={withMessageData:{busy:!1,show:!1,message:"",type:"ok",intervalId:-1,intervalTime:5e3}},a=t({},s.withMessageData),i={data:function(){return s},methods:{isBusy:function(){return this.withMessageData.busy},setMessage:function(e){var r=this,s=t({},a,{},e);this.withMessageData.message=s.message,this.withMessageData.type=s.type,this.withMessageData.show=!0,clearInterval(this.withMessageData.intervalId),this.withMessageData.intervalId=setInterval(function(){r.withMessageData.show=!1},s.intervalTime)},setBusy:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.withMessageData.busy=e}}},n=i;exports.default=n;
22
  },{}],"P9T4":[function(require,module,exports) {
23
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("../mixins/withMessage"));function t(e){return e&&e.__esModule?e:{default:e}}var r={mixins:[e.default]};exports.default=r;
24
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"wptb-settings-messages"},[e.withMessageData.busy?s("span",{staticClass:"dashicons dashicons-image-rotate wptb-settings-fetching"}):e._e(),e._v(" "),s("transition",{attrs:{name:"wptb-fade"}},[e.withMessageData.show?s("span",{staticClass:"wptb-settings-message",class:[e.withMessageData.type]},[e._v(e._s(e.withMessageData.message))]):e._e()])],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$08e206",e):t.createRecord("$08e206",e))}}();})();
25
+ },{"../mixins/withMessage":"wm3G","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"ksMR":[function(require,module,exports) {
26
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:{disabled:Boolean,type:{type:String,default:"primary"},size:{type:String,default:"normal"}},methods:{handleClick:function(){this.disabled||this.$emit("click")}}};exports.default=e;
27
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"wptb-settings-button",class:[{disabled:this.disabled},this.type,this.size],on:{click:this.handleClick}},[this._t("default")],2)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$201995",e):t.createRecord("$201995",e))}}();})();
28
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"y8Jx":[function(require,module,exports) {
29
+ var t=null;function e(){return t||(t=n()),t}function n(){try{throw new Error}catch(e){var t=(""+e.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(t)return r(t[0])}return"/"}function r(t){return(""+t).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)\/[^\/]+$/,"$1")+"/"}exports.getBundleURL=e,exports.getBaseURL=r;
30
+ },{}],"uNEb":[function(require,module,exports) {
31
+ var e=require("./bundle-url");function n(e){var n=e.cloneNode();n.onload=function(){e.remove()},n.href=e.href.split("?")[0]+"?"+Date.now(),e.parentNode.insertBefore(n,e.nextSibling)}var l=null;function r(){l||(l=setTimeout(function(){for(var r=document.querySelectorAll('link[rel="stylesheet"]'),t=0;t<r.length;t++)e.getBaseURL(r[t].href)===e.getBundleURL()&&n(r[t]);l=null},50))}module.exports=r;
32
+ },{"./bundle-url":"y8Jx"}],"nwtb":[function(require,module,exports) {
33
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./MessageDisplay.vue")),s=t(require("./MenuButton"));function t(e){return e&&e.__esModule?e:{default:e}}var u={props:["messageType","messageShow","messageBody","messageBusy"],components:{MessageDisplay:e.default,MenuButton:s.default}};exports.default=u;
34
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"wptb-settings-footer"},[s("message-display",{attrs:{busy:e.messageBusy,message:e.messageBody,show:e.messageShow,type:e.messageType}}),e._v(" "),s("div",{staticClass:"wptb-settings-button-container"},[s("menu-button",{staticStyle:{visibility:"hidden"}},[e._v("dummy")]),e._v(" "),e._t("default")],2)],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$3ebe93",e):t.createRecord("$3ebe93",e))}}();})();
35
+ },{"./MessageDisplay.vue":"P9T4","./MenuButton":"ksMR","_css_loader":"uNEb","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"vTRD":[function(require,module,exports) {
36
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:{center:{type:Boolean,default:!1}}};exports.default=e;
37
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"wptb-settings-controls-wrapper",class:[this.center?"center":"grid"]},[t("transition",{attrs:{name:"wptb-fade",mode:"out-in"}},[this._t("default")],2)],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$ef5f07",e):t.createRecord("$ef5f07",e))}}();})();
38
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"vU4o":[function(require,module,exports) {
39
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:["texts","file","allowedFormats"],model:{prop:"file",event:"fileChanged"},data:function(){return{dragActive:!1,currentFile:null}},mounted:function(){this.currentFile=this.file},watch:{currentFile:function(e){this.$emit("fileChanged",e)},file:function(e){this.currentFile=e}},computed:{eventClass:function(){return this.dragActive?"dragenter":""}},methods:{handleDrop:function(e){this.dragActive=!0;var t=e.dataTransfer;t.files[0]&&this.isTypeAllowed(t.files[0])&&(this.currentFile=t.files[0]),this.dragActive=!1},isTypeAllowed:function(e){var t=e.name.split(".").pop();return this.allowedFormats.includes(t)},openFileSelect:function(){this.$refs.fileSelect.click()},handleFileSelect:function(e){e.target.files.length>0&&this.isTypeAllowed(e.target.files[0])&&(this.currentFile=e.target.files[0])},clearCurrentFile:function(){this.currentFile=null}}};exports.default=e;
40
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"wptb-menu-file-drop",class:e.eventClass,on:{dragenter:function(t){t.stopPropagation(),t.preventDefault(),e.dragActive=!0},dragleave:function(t){t.stopPropagation(),t.preventDefault(),e.dragActive=!1},drop:function(t){return t.stopPropagation(),t.preventDefault(),e.handleDrop(t)},dragover:function(t){t.stopPropagation(),t.preventDefault(),e.dragActive=!0}}},[a("transition",{attrs:{name:"wptb-fade",mode:"out-in"}},[e.dragActive?a("div",{key:"fileLogo",staticClass:"file-icon"},[a("span",{staticClass:"dashicons dashicons-media-spreadsheet"})]):a("div",{key:"controls"},[a("transition",{attrs:{name:"wptb-fade",mode:"out-in"}},[null===e.currentFile?a("div",{key:"selection",staticClass:"wptb-flex wptb-flex-col wptb-flex-align-center"},[a("div",{staticClass:"hint"},[e._v(e._s(e.texts.hint))]),e._v(" "),a("div",{staticClass:"supported wptb-text-transform-none"},[e._v("("+e._s(e.allowedFormats.join(", "))+")")]),e._v(" "),a("div",[a("a",{on:{click:function(t){return t.preventDefault(),e.openFileSelect(t)}}},[e._v(e._s(e.texts.browse))]),e._v(" "),a("input",{ref:"fileSelect",staticStyle:{display:"none"},attrs:{type:"file"},on:{change:e.handleFileSelect}})])]):a("div",{key:"selected",staticClass:"wptb-flex wptb-flex-col wptb-flex-align-center"},[a("div",{staticClass:"file"},[e._v(e._s(e.currentFile.name))]),e._v(" "),a("div",[a("a",{on:{click:function(t){return t.preventDefault(),e.clearCurrentFile(t)}}},[e._v(e._s(e.texts.clear))])])])])],1)])],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$3fa9c3",e):t.createRecord("$3fa9c3",e))}}();})();
41
+ },{"_css_loader":"uNEb","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"yXWm":[function(require,module,exports) {
42
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={props:["fieldData","modelBind"],methods:{isType:function(e){return this.fieldData.type===e}}};exports.default=e;
43
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,i=e.$createElement,d=e._self._c||i;return d("div",[e.isType("multiCheckbox")?d("div",e._l(e.fieldData.options,function(i,a){return d("div",{key:i,staticClass:"wptb-setting-control-row"},[d("input",{directives:[{name:"model",rawName:"v-model",value:e.modelBind[e.fieldData.id],expression:"modelBind[fieldData.id]"}],attrs:{id:e.fieldData.id,type:"checkbox"},domProps:{value:a,checked:Array.isArray(e.modelBind[e.fieldData.id])?e._i(e.modelBind[e.fieldData.id],a)>-1:e.modelBind[e.fieldData.id]},on:{change:function(i){var d=e.modelBind[e.fieldData.id],t=i.target,l=!!t.checked;if(Array.isArray(d)){var o=a,n=e._i(d,o);t.checked?n<0&&e.$set(e.modelBind,e.fieldData.id,d.concat([o])):n>-1&&e.$set(e.modelBind,e.fieldData.id,d.slice(0,n).concat(d.slice(n+1)))}else e.$set(e.modelBind,e.fieldData.id,l)}}}),e._v(" "),d("label",{attrs:{for:e.fieldData.id}},[e._v(e._s(i))])])}),0):e.isType("checkbox")?d("div",[d("div",{staticClass:"wptb-setting-control-row"},[d("input",{directives:[{name:"model",rawName:"v-model",value:e.modelBind[e.fieldData.id],expression:"modelBind[fieldData.id]"}],attrs:{id:e.fieldData.id,type:"checkbox"},domProps:{checked:Array.isArray(e.modelBind[e.fieldData.id])?e._i(e.modelBind[e.fieldData.id],null)>-1:e.modelBind[e.fieldData.id]},on:{change:function(i){var d=e.modelBind[e.fieldData.id],a=i.target,t=!!a.checked;if(Array.isArray(d)){var l=e._i(d,null);a.checked?l<0&&e.$set(e.modelBind,e.fieldData.id,d.concat([null])):l>-1&&e.$set(e.modelBind,e.fieldData.id,d.slice(0,l).concat(d.slice(l+1)))}else e.$set(e.modelBind,e.fieldData.id,t)}}}),e._v(" "),d("label",{attrs:{for:e.fieldData.id}},[e._v(e._s(e.fieldData.label))])])]):e.isType("dropdown")?d("div",[d("div",{staticClass:"wptb-setting-control-row"},[d("select",{directives:[{name:"model",rawName:"v-model",value:e.modelBind[e.fieldData.id],expression:"modelBind[fieldData.id]"}],attrs:{id:e.fieldData.id},on:{change:function(i){var d=Array.prototype.filter.call(i.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.$set(e.modelBind,e.fieldData.id,i.target.multiple?d:d[0])}}},e._l(e.fieldData.options,function(i){return d("option",{key:i.label,domProps:{value:i.value}},[e._v(" "+e._s(i.label)+" ")])}),0),e._v(" "),d("label",{attrs:{for:e.fieldData.id}},[e._v(e._s(e.fieldData.label))]),e._v(" "),e._t("default")],2)]):e._e()])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var i=require("vue-hot-reload-api");i.install(require("vue")),i.compatible&&(module.hot.accept(),module.hot.data?i.reload("$d317c2",e):i.createRecord("$d317c2",e))}}();})();
44
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"bsz0":[function(require,module,exports) {
45
  "use strict";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e){return a(e)||n(e)||o(e)||r()}function r(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}function n(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function a(e){if(Array.isArray(e))return i(e)}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function l(r){function o(e){e.map(function(e){var t=document.createElement("div");t.innerHTML=e,a(t.querySelector("table"))})}function n(e,o){if(e&&Array.isArray(e)){var l=r.delimiter;if("tab"==l&&(l="\t"),!l&&!(l=function(e){for(var t={},r=!1,o=0,n=e.length,a=0;a<n;a++){var i=a-1>=0?e[a-1]:"",l=e[a],s=a+1<n?e[a+1]:"";if('"'===l)r&&'"'===s?r&&a++:r=!r;else if(("\n"!==l||"\r"===i)&&"\r"!==l||r)r||-1!==";,\t".indexOf(l)&&(void 0===t[l]&&(t[l]={}),void 0===t[l][o]&&(t[l][o]=0),t[l][o]++);else if(++o>=15)break}var c="";for(var d in t){var p=t[d],u=0;for(var m in p)u++;if(u===o){var b=!1,w=void 0;for(var v in p)b?w=!(p[v]!==b||!w&&void 0!==w):b=p[v];if(!(o>1)||w){if(c){c=!1;break}c=d}}}return c}(e[o])))return void alert("The delimiter could not be determined");document.addEventListener("table:imported:saved",function t(){e.length-o>1&&n(e,o+1),document.removeEventListener("table:imported:saved",t)}),""===e[o]&&(e[o]=" "),a(function(e){if(e&&Array.isArray(e)&&e.length>0){var r=e.length,o=r>0&&e[0]&&Array.isArray(e[0])?e[0].length:0;if(0===r&&0===o)return!1;var n={imageElemIndex:1,textElemIndex:1,customHtmlElemIndex:1},a=new Array(r);a.fill(1);var l=new Array(o);l.fill(1);for(var s=document.createElement("tbody"),c=r-1,p=o-1,u=c;u>=0;u--){var m=document.createElement("tr");m.classList.add("wptb-row");for(var b=p;b>=0;b--){var w=e[u][b];if("#rowspan#"===w){if(u>0){a[b]||(a[b]=1),a[b]++,l[u]=1;continue}w=""}else if("#colspan#"===w){if(b>0){l[u]||(l[u]=1),l[u]++,a[b]=1;continue}w=""}var v=document.createElement("td");v.classList.add("wptb-droppable","wptb-cell"),v.dataset.wptbCssTdAutoWidth="true",v.style.padding="15px",v.style.width=null,v.style.height=null,v.style.borderStyle="solid",v.style.borderWidth="1px",v.innerHTML=w,l[u]>1&&(v.colSpan=l[u]),a[b]>1&&(v.rowSpan=a[b]),m.insertBefore(v,m.firstChild),l[u]=1,a[b]=1}s.insertBefore(m,s.firstChild)}var y=document.createElement("table");y.classList.add("wptb-preview-table","wptb-element-main-table_setting-startedid-0"),y.style.borderStyle="solid",y.style.borderWidth="1px",y.appendChild(s);for(var f=y.querySelectorAll("td"),h=0;h<f.length;h++){var S=t(f[h].childNodes),T=d(S,n),g=void 0;if(T&&Array.isArray(T)&&(g=T[0],n=T[1]),f[h].innerHTML="",g&&Array.isArray(g))for(var H=0;H<g.length;H++)f[h].appendChild(g[H])}return WPTB_Helper.recalculateIndexes(y),i(y),y}return!1}(function(e,t){for(var r=[],o=!1,n=0,a=0,i=0;i<e.length;i++){var l=e[i],s=e[i+1];r[n]=r[n]||[],r[n][a]=r[n][a]||"",'"'==l&&o&&'"'==s?(r[n][a]+=l,++i):'"'!=l?l!=t||o?"\n"!=l||o?r[n][a]+=l:(++n,a=0):++a:o=!o}return r}(e[o],l)))}}function a(e,t){var o=new XMLHttpRequest,n="".concat(r.ajaxUrl,"?action=save_table");t&&e.classList.contains("wptb-element-main-table_setting-startedid-0")&&(e.classList.remove("wptb-element-main-table_setting-startedid-0"),e.classList.add("wptb-element-main-table_setting-".concat(t)));var i={content:WPTB_Stringifier(e).outerHTML,security_code:r.nonce};t&&(i.id=t),i=JSON.stringify(i),o.open("POST",n,!0),o.setRequestHeader("Content-type","application/json; charset=utf-8"),o.onreadystatechange=function(t){if(4==this.readyState&&200==this.status){if("security_problem"===JSON.parse(o.responseText)[0])return void WPTB_Helper.wptbDocumentEventGenerate("table:imported:error",document);var r=JSON.parse(o.responseText);"saved"==r[0]?a(e,r[1]):"edited"==r[0]&&WPTB_Helper.wptbDocumentEventGenerate("table:imported:saved",document)}},o.send(i)}function i(e){r.tableResponsive?e.dataset.wptbAdaptiveTable="1":e.dataset.wptbAdaptiveTable="0",r.topRowAsHeader&&e.classList.add("wptb-table-preview-head"),e.dataset.wptbFixedWidthSize="0",e.dataset.wptbCellsWidthAutoCount=e.maxCols;var t=e.querySelector("td"),o=t&&t.style.paddingTop?t.style.paddingTop:15;e.dataset.wptbTableTdsSumMaxWidth=String(parseInt(e.maxCols)*(101+2*parseInt(o))+1)}function l(o,n){if(n&&Array.isArray(n)&&n.length>0){var a=n.shift();if(a&&Array.isArray(a)&&a.length>0){var c=a[0];window.wptbImportConvertationShortcodes||(window.wptbImportConvertationShortcodes=[]);var p=[];p.push(c),window.wptbImportConvertationShortcodes.push(p);var u=a[1],m="".concat(r.import_iframe_url,"&_wpnonce=").concat(r.security_code,"&shortcode=").concat(c);o.src=m,o.onload=function(o,n,a){var c=o.contentDocument||o.contentWindow.document,p=c.querySelector(".dataTables_length select");if(p){var u=t(p.options);if(Array.isArray(u)){var m=u.reduce(function(e,t){var r=e?Number(e.value):"",o=t?Number(t.value):"";return r<o&&(e=t),e});m&&(p.value=m.value,WPTB_Helper.wptbDocumentEventGenerate("change",p))}}!function(o,n,a,c){if(o){o.style.borderStyle="solid",o.style.borderWidth="1px",WPTB_Helper.checkSetGetStyleColorValue(o,"border-color","border-top-color",!0);var p=WPTB_Helper.checkSetGetStyleValue(o,"float","float");p&&"none"!=p&&(o.dataset.wptbTableAlignment=p);var u=o.querySelector("caption");u&&o.removeChild(u);var m=o.querySelector("tbody");m&&m.removeAttribute("class");var b=o.querySelector("thead");if(b){var w=b.innerHTML;if(w&&(w=WPTB_Helper.replaceAll(w,"<th","<td"),w=WPTB_Helper.replaceAll(w,"th>","td>"),m)){var v=m.innerHTML;v=w+v,m.innerHTML=v}o.removeChild(b)}var y=o.querySelector("tfoot");if(y){var f=y.innerHTML;if(f&&m){var h=m.innerHTML;h+=f,m.innerHTML=h}o.removeChild(y)}WPTB_Helper.recalculateIndexes(o);var S=o.querySelectorAll("tr");if(S.length>0)for(var T={imageElemIndex:1,textElemIndex:1,customHtmlElemIndex:1},g=0;g<S.length;g++){S[g].removeAttribute("class"),S[g].removeAttribute("role"),S[g].classList.add("wptb-row");var H=!0,_=WPTB_Helper.checkSetGetStyleColorValue(S[g],"background-color","background-color");_&&(WPTB_Helper.isHex(_)||(_=WPTB_Helper.rgbToHex(_)),S[g].style.tdsBackgroundColor=_,H=!1);for(var A=t(S[g].children),C=void 0,x="",L=0;L<A.length;L++){H&&(L>0&&C!=WPTB_Helper.checkSetGetStyleColorValue(trChildNodes[g],"background-color","background-color")?(C="",H=!1):C=WPTB_Helper.checkSetGetStyleColorValue(trChildNodes[g],"background-color","background-color")),A[L].style.width=null,A[L].style.height=null,A[L].style.borderStyle="solid",A[L].style.borderWidth="1px";var P=WPTB_Helper.checkSetGetStyleColorValue(A[L],"border-color","border-top-color"),B=WPTB_Helper.checkSetGetStyleColorValue(A[L],"border-color","border-left-color"),I=WPTB_Helper.checkSetGetStyleColorValue(A[L],"border-color","border-right-color"),W=WPTB_Helper.checkSetGetStyleColorValue(A[L],"border-color","border-bottom-color"),E=WPTB_Helper.getValueMaxCountSameElementsInArray([P,B,I,W]);E&&(WPTB_Helper.isHex(E)||(E=WPTB_Helper.rgbToHex(E)),A[L].style.borderColor=E),WPTB_Helper.checkSetGetStyleSizeValue(A[L],"padding","padding-top","px"),A[L].dataset.wptbCssTdAutoWidth="true",A[L].removeAttribute("class"),A[L].removeAttribute("role"),A[L].classList.add("wptb-droppable","wptb-cell");var M=A[L].dataset.xIndex,q=A[L].dataset.yIndex;if(M&&q&&Array.isArray(n)&&n[q]&&Array.isArray(n[q])&&n[q][M]){A[L].innerHTML=n[q][M];var k=t(A[L].childNodes),R=d(k,T),N=void 0;R&&Array.isArray(R)&&(N=R[0],T=R[1]),A[L].innerHTML="";for(var G=0;G<N.length;G++)A[L].appendChild(N[G])}x+=A[L].outerHTML}S[g].innerHTML=x,S[g].style.backgroundColor=WPTB_Helper.rgbToHex(C)}o.removeAttribute("class"),o.removeAttribute("role"),o.removeAttribute("id"),o.removeAttribute("aria-describedby"),o.classList.add("wptb-preview-table","wptb-element-main-table_setting-startedid-0"),i(o),function t(o,n,a,i){var c=new XMLHttpRequest;var d="".concat(r.ajaxUrl,"?action=save_table");var p;var u;var m=n.contentDocument||n.contentWindow.document;var b=m.querySelector(".tablepress-table-name");p=b?b.innerText:"";i&&o.classList.contains("wptb-element-main-table_setting-startedid-0")&&(o.classList.remove("wptb-element-main-table_setting-startedid-0"),o.classList.add("wptb-element-main-table_setting-".concat(i)));u=WPTB_Stringifier(o);u=u.outerHTML;var w={title:p,content:u,security_code:r.security_code};i&&(w.id=i);w=JSON.stringify(w);c.open("POST",d,!0);c.setRequestHeader("Content-type","application/json; charset=utf-8");c.onreadystatechange=function(i){if(4==this.readyState&&200==this.status){var d=JSON.parse(c.responseText);if("saved"==d[0])t(o,n,a,d[1]);else if("edited"==d[0]){if(d[1]&&window.wptbImportConvertationShortcodes&&Array.isArray(window.wptbImportConvertationShortcodes)&&window.wptbImportConvertationShortcodes.length>0&&window.wptbImportConvertationShortcodes[window.wptbImportConvertationShortcodes.length-1].push("[wptb id=".concat(d[1],"]")),window.wptbImportCommonCountTables){var p=window.wptbImportCommonCountTables,u=window.wptbImportCommonCountTables-a.length,m=s(u,p,"import");if(100==m){var b=document.querySelector(".wptb-importPBarContainer");b&&b.addEventListener("wptb-import:progressBar:full:import",function(){WPTB_Helper.wptbDocumentEventGenerate("table:imported:saved",document),WPTB_Helper.wptbDocumentEventGenerate("table:imported:list",document,e({},r.type,window.wptbImportConvertationShortcodes))},!1)}}else s(100,100,"import");l(n,a)}}};c.send(w)}(o,a,c)}}(c.querySelector("table.tablepress"),n,o,a)}.bind(this,o,u,n)}}}function s(e,t,r){var o=document.querySelector(".wptb-importPBarContainer"),n=document.querySelector("#wptb-pBarPercent"),a=document.querySelector("#wptb-pBarPercent span");if(o&&n&&a&&(e||0===e)&&t&&(e=Number(e),(t=Number(t))>0)){o.classList.add("wptb-importPBarContainerActive");var i=o.querySelector(".wptb-nameProcessInBarProgress");if(i){var l,s="";"import"==r?l=document.querySelector(".wptb-importFromPlugin"):"replace"==r&&(l=document.querySelector(".wptb-importTableReplaceShortcodes")),l&&(s=l.dataset.name)&&(i.innerHTML=s),s||(i.innerHTML="")}var c=(e/t*100).toFixed(2);return c>100&&(c=100),a.innerHTML="".concat(c,"%"),n.style.width=c<3?"3%":"".concat(c,"%"),100==c&&setTimeout(function(){o.classList.remove("wptb-importPBarContainerActive"),r=r?":".concat(r):"",WPTB_Helper.wptbDocumentEventGenerate("wptb-import:progressBar:full".concat(r),o)},2e3),c}}function c(e,t){if(e&&Array.isArray(e)&&e.length>0){t&&(window.wptbImportShortcodesNecessaryReplace=e.length,window.wptbImportShortcodesReplacedCount=0,s(0,window.wptbImportShortcodesNecessaryReplace,"replace"));var o=new XMLHttpRequest,n="".concat(r.ajaxUrl,"?action=shortcodes_replace"),a={replacing_shortcodes:e.shift(),security_code:r.security_code};a=JSON.stringify(a),o.open("POST",n,!0),o.setRequestHeader("Content-type","application/json; charset=utf-8"),o.onreadystatechange=function(t){if(4==this.readyState&&200==this.status){var r=JSON.parse(o.responseText),n=window.wptbImportShortcodesNecessaryReplace,a=window.wptbImportShortcodesNecessaryReplace-e.length,i=0;if(r&&Array.isArray(r)&&"success"==r[0]?(i=s(a,n,"replace"),window.wptbImportShortcodesReplacedCount?window.wptbImportShortcodesReplacedCount+=r[1]:window.wptbImportShortcodesReplacedCount=r[1]):i=s(n,n,"replace"),100==i){WPTB_Helper.wptbDocumentEventGenerate("table:shortcode:replace",document,window.wptbImportShortcodesReplacedCount);var l=document.querySelector(".wptb-importPBarContainer");l&&l.addEventListener("wptb-import:progressBar:full:replace",function(){var e=document.querySelector(".wptb-importedTablesShortcodesReplaced");if(e){e.style.display="block";var t=document.querySelector(".wptb-importedShortcodesReplaceCount span");t&&(window.wptbImportShortcodesReplacedCount?t.innerHTML=window.wptbImportShortcodesReplacedCount:t.innerHTML="0")}},!1)}else c(e)}},o.send(a)}}function d(e,t){for(var r=[],o=0;o<e.length;o++)if(1==e[o].nodeType||3==e[o].nodeType){var n=document.createElement("div");if(1==e[o].nodeType)if("img"===e[o].nodeName.toLowerCase()){e[o].style.width="100%",e[o].removeAttribute("class"),n.classList.add("wptb-image-container","wptb-ph-element","wptb-element-image-".concat(t.imageElemIndex)),n.innerHTML="".concat('<div class="wptb-image-wrapper"><a style="display: block;" target="_blank" rel="nofollow">').concat(e[o].outerHTML,"</a>")+"</div>";var a=n.querySelector("img");a&&(a.style.width="100%"),t.imageElemIndex++}else"wptb_shortcode_container_element"===e[o].nodeName.toLowerCase()?(n.classList.add("wptb-shortcode-container","wptb-ph-element","wptb-element-shortcode-".concat(t.customHtmlElemIndex)),n.innerHTML="<wptb_shortcode_container_element><div>".concat(e[o].innerHTML,"</div></wptb_shortcode_container_element>"),t.customHtmlElemIndex++):(n.classList.add("wptb-html-container","wptb-ph-element","wptb-element-custom_html-".concat(t.customHtmlElemIndex)),n.innerHTML='<div class="wptb-custom-html-wrapper" data-wptb-new-element="1">'.concat(e[o].outerHTML,"</div>"),t.customHtmlElemIndex++);else if(3==e[o].nodeType){n.classList.add("wptb-text-container","wptb-ph-element","wptb-element-text-".concat(t.textElemIndex)),n.innerHTML="<div><p>".concat(e[o].nodeValue,"</p></div>");var i=n.querySelector("p");if(i){var l=WPTB_Helper.checkSetGetStyleSizeValue(i,"font-size","font-size");l&&WPTB_Helper.checkingDimensionValue(l,"px")&&(i.style.fontSize=null,n.style.fontSize=l);var s=WPTB_Helper.checkSetGetStyleColorValue(i,"color","color");s&&(WPTB_Helper.isHex(s)?(i.style.color=null,n.style.color=s):WPTB_Helper.rgbToHex(s)&&(i.style.color=null,s=WPTB_Helper.rgbToHex(s),n.style.color=s))}t.textElemIndex++}r.push(n)}return[r,t]}return{importFromFile:function(){if(r.file){var e=/^([a-zA-Z0-9()\s_\\.\-:])+(.csv)$/.test(r.file.name.toLowerCase()),t=/^([a-zA-Z0-9()\s_\\.\-:])+(.xml)$/.test(r.file.name.toLowerCase()),a=(/^([a-zA-Z0-9()\s_\\.\-:])+(.html)$/.test(r.file.name.toLowerCase()),/^([a-zA-Z0-9()\s_\\.\-:])+(.zip)$/.test(r.file.name.toLowerCase())),i=r.file;if(a){var l=new XMLHttpRequest,s="".concat(r.ajaxUrl,"?action=zip_unpacker"),c=new FormData;c.append("file",i,"csv_zip.zip"),c.append("security_code",r.nonce),l.open("POST",s,!0),l.onreadystatechange=function(e){if(4==this.readyState&&200==this.status){var t=l.responseText;if("unsuccess"===JSON.parse(t)[0])return void WPTB_Helper.wptbDocumentEventGenerate("table:imported:error",document);if(t&&(t=JSON.parse(t)),t&&Array.isArray(t)&&"success"==t[0]&&t[1]&&Array.isArray(t[1])){for(var r=[],a=[],i=0;i<t[1].length;i++)switch(t[1][i][0]){case"csv":r.push(t[1][i][1]);break;case"xml":a.push(t[1][i][1])}r.length>0?n(r,0):a.length>0?o(a):WPTB_Helper.wptbDocumentEventGenerate("table:imported:error",document,{message:"invalid file type"})}}},l.send(c)}else if(e||t)if("undefined"!=typeof FileReader){var d,p=new FileReader;p.onload=function(r){d=r.target.result,e?n([d],0):t&&o([d])},p.readAsText(i)}else alert("This browser does not support HTML5.");else alert("Please upload a valid file.")}},importFromPlugin:function(e){var t,o,n;e&&"table-press"===e&&(t=new XMLHttpRequest,o="".concat(r.ajaxUrl,"?action=import_tables"),n={import_plugin_name:"table-press",security_code:r.security_code},n=JSON.stringify(n),t.open("POST",o,!0),t.setRequestHeader("Content-type","application/json; charset=utf-8"),t.onreadystatechange=function(e){if(4==this.readyState&&200==this.status){var r=JSON.parse(t.responseText);if(r&&Array.isArray(r))if("success"==r[0]){if(r[1]&&Array.isArray(r[1])){var o=document.getElementById("wptb-importIframeSection");if(o){var n=document.createElement("iframe");o.innerHTML="",o.appendChild(n),window.wptbImportCommonCountTables=r[1].length,window.wptbImportConvertationShortcodes&&delete window.wptbImportConvertationShortcodes,l(n,r[1])}}}else r[1]&&WPTB_Helper.wptbDocumentEventGenerate("table:imported:error",document,r[1])}},t.send(n))},replaceShortcodesAjax:c}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var s=l;exports.default=s;
46
  },{}],"ACYA":[function(require,module,exports) {
47
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("../components/DragDrop.vue")),t=o(require("../components/ControlItem.vue")),s=o(require("../components/MenuButton.vue")),i=o(require("../functions/importOperations.js")),r=o(require("../mixins/withMessage"));function o(e){return e&&e.__esModule?e:{default:e}}var n={props:["options"],mixins:[r.default],components:{DragDrop:e.default,ControlItem:t.default,MenuButton:s.default},data:function(){return{settings:{responsiveTables:!1,topRowAsHeader:!1,csvDelimiter:","},fieldsData:[],currentFile:null,fetching:!1}},mounted:function(){var e=this;document.addEventListener("table:imported:saved",function(){e.currentFile=null,e.setMessage({type:"ok",message:e.strings.tableImported}),e.setBusy(!1)}),document.addEventListener("table:imported:error",function(){e.currentFile=null,e.setMessage({type:"error",message:e.strings.errorOccured}),e.setBusy(!1)}),this.fieldsData.push({type:"dropdown",id:"csvDelimiter",modelBind:this.settings,label:this.strings.csvDelimiter,options:[{value:",",label:", (comma)"},{value:";",label:"; (semicolon)"},{value:"tab",label:"\\t (tabular)"}]},{type:"checkbox",id:"responsiveTables",modelBind:this.settings,label:this.strings.tableResponsive},{type:"checkbox",id:"topRowAsHeader",modelBind:this.settings,label:this.strings.topRowHeader})},computed:{isImportDisabled:function(){return null===this.currentFile||this.fetching}},methods:{importFromFile:function(){if(null!==this.currentFile){var e={file:this.currentFile,ajaxUrl:this.options.ajaxUrl,nonce:this.options.security_code,delimiter:this.settings.csvDelimiter,tableResponsive:this.settings.responsiveTables,topRowAsHeader:this.settings.topRowAsHeader},t=(0,i.default)(e);this.setBusy(),t.importFromFile()}}}};exports.default=n;
48
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("drag-drop",{attrs:{texts:{hint:e.strings.fileDropHint,browse:e.strings.browse,clear:e.strings.clear},"allowed-formats":["csv","xml","zip"]},model:{value:e.currentFile,callback:function(t){e.currentFile=t},expression:"currentFile"}}),e._v(" "),r("div",e._l(e.fieldsData,function(e){return r("control-item",{key:e.id,attrs:{"field-data":e,"model-bind":e.modelBind}})}),1),e._v(" "),r("portal",{attrs:{to:"footerButtons"}},[r("menu-button",{attrs:{disabled:e.isImportDisabled},on:{click:e.importFromFile}},[e._v(e._s(e.strings.importSection)+" ")])],1)],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$ff89a6",e):t.createRecord("$ff89a6",e))}}();})();
49
+ },{"../components/DragDrop.vue":"vU4o","../components/ControlItem.vue":"yXWm","../components/MenuButton.vue":"ksMR","../functions/importOperations.js":"bsz0","../mixins/withMessage":"wm3G","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"CDb8":[function(require,module,exports) {
50
  "use strict";function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(n){e(t,n,r[n])})}return t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Plugin=exports.SSR=exports.Fragment=exports.default=void 0;var n=function(e,t,n){Object.defineProperty(e,t,{configurable:!0,get:function(){return n},set:function(e){console.warn("tried to set frozen property ".concat(t," with ").concat(e))}})},r=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;Object.defineProperty(e,t,{configurable:!0,writable:!0,value:n})},o={abstract:!0,name:"Fragment",props:{name:{type:String,default:function(){return Math.floor(Date.now()*Math.random()).toString(16)}}},mounted:function(){var e=this.$el,t=e.parentNode,o=document.createComment("fragment#".concat(this.name,"#head")),i=document.createComment("fragment#".concat(this.name,"#tail"));t.insertBefore(o,e),t.insertBefore(i,e),e.appendChild=function(r){t.insertBefore(r,i),n(r,"parentNode",e)},e.insertBefore=function(r,o){t.insertBefore(r,o),n(r,"parentNode",e)},e.removeChild=function(e){t.removeChild(e),r(e,"parentNode")},Array.from(e.childNodes).forEach(function(t){return e.appendChild(t)}),t.removeChild(e),n(e,"parentNode",t),n(e,"nextSibling",i.nextSibling);var a=t.insertBefore;t.insertBefore=function(n,r){a.call(t,n,r!==e?r:o)};var c=t.removeChild;t.removeChild=function(n){if(n===e){for(;o.nextSibling!==i;)e.removeChild(o.nextSibling);t.removeChild(o),t.removeChild(i),r(e,"parentNode"),t.insertBefore=a,t.removeChild=c}else c.call(t,n)}},render:function(e){var n=this,r=this.$slots.default;return r&&r.length&&r.forEach(function(e){return e.data=t({},e.data,{attrs:t({fragment:n.name},(e.data||{}).attrs)})}),e("div",{attrs:{fragment:this.name}},r)}};function i(e,t){}var a=o,c=i,f={install:function(e){e.component("fragment",o)}},l={Fragment:o,Plugin:f,SSR:i};exports.Plugin=f,exports.SSR=c,exports.Fragment=a;var u=l;exports.default=u;
51
  },{}],"pxbx":[function(require,module,exports) {
52
  function e(e,n){var r,t,l=0;function u(){var u,v,a=r,p=arguments.length;e:for(;a;){if(a.args.length===arguments.length){for(v=0;v<p;v++)if(a.args[v]!==arguments[v]){a=a.next;continue e}return a!==r&&(a===t&&(t=a.prev),a.prev.next=a.next,a.next&&(a.next.prev=a.prev),a.next=r,a.prev=null,r.prev=a,r=a),a.val}a=a.next}for(u=new Array(p),v=0;v<p;v++)u[v]=arguments[v];return a={args:u,val:e.apply(null,u)},r?(r.prev=a,a.next=r):t=a,l===n.maxSize?(t=t.prev).next=null:l++,r=a,a.val}return n=n||{},u.clear=function(){r=null,t=null,l=0},u}module.exports=e;
75
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={sprintf:!0,setLocaleData:!0,__:!0,_x:!0,_n:!0,_nx:!0,isRTL:!0};Object.defineProperty(exports,"sprintf",{enumerable:!0,get:function(){return t.sprintf}}),Object.defineProperty(exports,"setLocaleData",{enumerable:!0,get:function(){return n.setLocaleData}}),Object.defineProperty(exports,"__",{enumerable:!0,get:function(){return n.__}}),Object.defineProperty(exports,"_x",{enumerable:!0,get:function(){return n._x}}),Object.defineProperty(exports,"_n",{enumerable:!0,get:function(){return n._n}}),Object.defineProperty(exports,"_nx",{enumerable:!0,get:function(){return n._nx}}),Object.defineProperty(exports,"isRTL",{enumerable:!0,get:function(){return n.isRTL}});var t=require("./sprintf"),r=require("./create-i18n");Object.keys(r).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return r[t]}}))});var n=require("./default-i18n");
76
  },{"./sprintf":"jmTT","./create-i18n":"bf97","./default-i18n":"C7H9"}],"FPuA":[function(require,module,exports) {
77
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("vue-fragment"),t=require("@wordpress/i18n"),r=s(require("../components/MenuButton.vue")),n=s(require("../functions/importOperations.js")),o=s(require("../mixins/withMessage"));function s(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){u(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var c={props:["options"],mixins:[o.default],components:{MenuButton:r.default,Fragment:e.Fragment},data:function(){return{supportedPlugins:{"table-press":"TablePress"},importedTables:{},selectedReplaceRows:[]}},watch:{fetching:function(e){this.$emit("fetching",e)}},mounted:function(){var e=this;document.addEventListener("table:imported:saved",function(t){var r=t.detail;e.setMessage({type:"ok",message:e.isDocumentEventPoorlyImplemented(r)?e.strings.operationSuccess:r}),e.setBusy(!1)}),document.addEventListener("table:imported:error",function(t){var r=t.detail;e.setMessage({type:"error",message:e.isDocumentEventPoorlyImplemented(r)?e.strings.errorOccured:r}),e.setBusy(!1)}),document.addEventListener("table:imported:list",function(t){var r=t.detail;e.setBusy(!1),e.importedTables=r}),document.addEventListener("table:shortcode:replace",function(t){var r=t.detail;e.setMessage({type:"ok",message:"".concat(e.strings.replacedShortcodes,": ").concat(!0===r?0:r)}),e.setBusy(!1)})},methods:{isDocumentEventPoorlyImplemented:function(e){return"boolean"==typeof e},handleImportFromPlugin:function(e){var t=(0,n.default)(a({},this.options,{type:e}));this.setBusy(),t.importFromPlugin(e)},selectAllCheckbox:function(e){this.selectedReplaceRows===this.importedTables[e]?this.selectedReplaceRows=[]:this.selectedReplaceRows=this.importedTables[e]},replaceShortcodes:function(){if(0!==this.selectedReplaceRows.length){var e=this.selectedReplaceRows.map(function(e){return{search:e[0],replace:e[1]}}),t=(0,n.default)(this.options);this.setBusy(),t.replaceShortcodesAjax(e,!0)}},importButtonText:function(e){return(0,t.sprintf)((0,t._x)("import from %s","%s is a format variable for a name of WordPress plugin",this.options.textDomain),e)},importedTablesCountInfo:function(e){return(0,t.sprintf)((0,t._nx)("%u table imported","%u tables imported","number of tables imported",this.options.textDomain),this.importedTables[e].length)},isPluginInstalled:function(e){return this.options.installedSupportedPlugins.includes(e)}},computed:{showImportedTables:function(){var e=this,t=Object.keys(this.importedTables).map(function(t){return Object.prototype.hasOwnProperty.call(e.importedTables,t)?t:null});return!!Array.isArray(t)&&t.length>0}}};exports.default=c;
78
+ (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[t._l(t.supportedPlugins,function(e,a){return s("menu-button",{key:a,staticClass:"wptb-text-transform-cap",attrs:{disabled:!t.isPluginInstalled(e)||t.isBusy(),title:t.isPluginInstalled(e)?"":t.getTranslation("plugin not installed")},on:{click:function(e){return t.handleImportFromPlugin(a)}}},[t._v(" "+t._s(t.importButtonText(e))+" ")])}),t._v(" "),s("div",{staticStyle:{display:"none"},attrs:{id:"wptb-importIframeSection"}}),t._v(" "),s("transition",{attrs:{name:"wptb-fade",mode:"out-in"}},[t.showImportedTables?s("div",{staticClass:"wptb-flex wptb-flex-align-center wptb-flex-col"},[s("div",{staticClass:"wptb-import-tables-wrapper"},t._l(t.importedTables,function(e,a){return s("div",{key:a,staticClass:"wptb-import-tables-list"},[s("div",{staticClass:"wptb-import-table-count-info"},[t._v(t._s(t.importedTablesCountInfo(a)))]),t._v(" "),s("table",{staticClass:"wptb-import-table"},[s("thead",[s("tr",[s("th",[s("input",{attrs:{type:"checkbox"},on:{click:function(e){return t.selectAllCheckbox(a)}}})]),t._v(" "),s("th",{staticClass:"wptb-text-transform-cap"},[t._v(" "+t._s(t.supportedPlugins[a])+" ")]),t._v(" "),s("th",{staticClass:"wptb-text-transform-cap"},[t._v(" wp table builder ")])])]),t._v(" "),s("tbody",t._l(e,function(e){return s("fragment",{key:e[0]},[s("tr",[s("td",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.selectedReplaceRows,expression:"selectedReplaceRows"}],attrs:{type:"checkbox"},domProps:{value:e,checked:Array.isArray(t.selectedReplaceRows)?t._i(t.selectedReplaceRows,e)>-1:t.selectedReplaceRows},on:{change:function(s){var a=t.selectedReplaceRows,i=s.target,l=!!i.checked;if(Array.isArray(a)){var r=e,o=t._i(a,r);i.checked?o<0&&(t.selectedReplaceRows=a.concat([r])):o>-1&&(t.selectedReplaceRows=a.slice(0,o).concat(a.slice(o+1)))}else t.selectedReplaceRows=l}}})]),t._v(" "),s("td",[t._v(" "+t._s(e[0])+" ")]),t._v(" "),s("td",[t._v(" "+t._s(e[1])+" ")])])])}),1)])])}),0),t._v(" "),s("menu-button",{staticClass:"wptb-text-transform-cap",attrs:{disabled:0===t.selectedReplaceRows.length,size:"small"},on:{click:t.replaceShortcodes}},[t._v(" "+t._s(t.getTranslation("replace short codes"))+" ")])],1):t._e()]),t._v(" "),t._m(0)],2)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"wptb-importPBarContainer",staticStyle:{visibility:"hidden"}},[e("div",{staticClass:"wptb-importPBarProgress"},[e("div",{staticClass:"wptb-nameProcessInBarProgress"}),this._v(" "),e("div",{attrs:{id:"wptb-pBarPercent"}},[e("span",[this._v("0%")])])])])}],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var e=require("vue-hot-reload-api");e.install(require("vue")),e.compatible&&(module.hot.accept(),module.hot.data?e.reload("$67df01",t):e.createRecord("$67df01",t))}}();})();
79
+ },{"vue-fragment":"CDb8","@wordpress/i18n":"e20f","../components/MenuButton.vue":"ksMR","../functions/importOperations.js":"bsz0","../mixins/withMessage":"wm3G","_css_loader":"uNEb","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"qRIs":[function(require,module,exports) {
80
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("../components/Sections.vue")),t=r(require("../components/SectionItem.vue")),n=r(require("../components/MenuContent.vue")),u=r(require("./CSVImportMenu.vue")),o=r(require("./PluginsImportMenu.vue"));function r(e){return e&&e.__esModule?e:{default:e}}var c={props:["options"],components:{Sections:e.default,SectionItem:t.default,MenuContent:n.default},data:function(){return{currentSection:"csv"}},methods:{setSection:function(e){this.currentSection!==e&&(this.currentSection=e)}},computed:{currentTemplate:function(){return"csv"===this.currentSection?u.default:o.default}}};exports.default=c;
81
+ (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("portal",{attrs:{to:"childSections"}},[o("sections",{attrs:{child:!0,items:["csv",t.strings.plugins]},model:{value:t.currentSection,callback:function(e){t.currentSection=e},expression:"currentSection"}})],1),t._v(" "),o("menu-content",{attrs:{center:!0}},[o(t.currentTemplate,{tag:"component",staticClass:"wptb-flex wptb-flex-col wptb-flex-align-center",attrs:{options:t.options}})],1)],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var e=require("vue-hot-reload-api");e.install(require("vue")),e.compatible&&(module.hot.accept(),module.hot.data?e.reload("$613c2d",t):e.createRecord("$613c2d",t))}}();})();
82
+ },{"../components/Sections.vue":"yPIx","../components/SectionItem.vue":"bosS","../components/MenuContent.vue":"vTRD","./CSVImportMenu.vue":"ACYA","./PluginsImportMenu.vue":"FPuA","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"BOOO":[function(require,module,exports) {
83
 
84
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"wptb-menu-empty-cover"},[this._t("default")],2)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$12b0af",e):t.createRecord("$12b0af",e))}}();})();
85
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"UuSu":[function(require,module,exports) {
86
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={props:["message"],data:function(){return{top:0,left:0}},mounted:function(){this.calculatePopupPosition()},methods:{toPx:function(t){return"".concat(t,"px")},calculatePopupPosition:function(){var t=this.$refs.wrapper.getBoundingClientRect(),e=this.$refs.popup.getBoundingClientRect(),o=this.$refs.arrow.getBoundingClientRect();this.left=this.toPx(t.left-e.width/2+t.width/2),this.top=this.toPx(t.top-(e.height+o.height/2))}}};exports.default=t;
87
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("div",{ref:"wrapper",staticClass:"wptb-menu-popup-wrapper",on:{mouseover:e.calculatePopupPosition}},[e._t("default")],2),e._v(" "),o("div",{ref:"popup",staticClass:"wptb-menu-popup-message",style:{top:e.top,left:e.left}},[o("div",{staticClass:"wptb-menu-popup-inner-holder"},[o("div",{ref:"arrow",staticClass:"wptb-menu-popup-arrow"}),e._v(" "),o("span",{domProps:{innerHTML:e._s(e.message)}})])])])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$73a01e",e):t.createRecord("$73a01e",e))}}();})();
88
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"hl0g":[function(require,module,exports) {
89
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={props:["label","index"],data:function(){return{currentDirection:1}},methods:{sort:function(){this.currentDirection*=-1,this.$emit("sort",this.index,this.currentDirection)}}};exports.default=t;
90
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("td",{on:{click:function(t){return t.preventDefault(),e.sort(t)}}},[e._v(" "+e._s(e.label)+"\n")])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$3860eb",e):t.createRecord("$3860eb",e))}}();})();
91
+ },{"vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"AF9R":[function(require,module,exports) {
92
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e(require("./ColumnSort"));function e(t){return t&&t.__esModule?t:{default:t}}var o={props:{rowLabels:Array,rowData:Array,modelBind:Object,sortType:Object},components:{ColumnSort:t.default},data:function(){return{innerRowData:[],sortOptions:{index:0,direction:1}}},watch:{rowData:function(t){this.innerRowData=t,this.sortOptions&&this.sort(this.sortOptions.index,this.sortOptions.direction)}},methods:{sort:function(t,e){this.sortOptions.index=t,this.sortOptions.direction=e;var o,r={dateSort:function(o,r){var a=0,s=new Date(o.fieldDatas[t].toLowerCase()).getTime(),i=new Date(r.fieldDatas[t].toLowerCase()).getTime();return s<i&&(a=1),s>i&&(a=-1),a*e},defaultSort:function(o,r){var a=0,s=o.fieldDatas[t].toLowerCase(),i=r.fieldDatas[t].toLowerCase();return s<i&&(a=1),s>i&&(a=-1),a*e}},a=this.sortType[t];o=a&&r["".concat(a,"Sort")]?r["".concat(a,"Sort")]:r.defaultSort,this.innerRowData.sort(o)}}};exports.default=o;
93
+ (function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("table",{staticClass:"wptb-menu-list-table"},[o("thead",[o("tr",[o("td"),e._v(" "),e._l(e.rowLabels,function(t,n){return o("column-sort",{key:t,attrs:{label:t,index:n},on:{sort:e.sort}})})],2)]),e._v(" "),o("transition-group",{attrs:{tag:"tbody",name:"wptb-fade",mode:"out-in"}},e._l(e.innerRowData,function(t){return o("tr",{key:t.ID},[o("td",[o("input",{directives:[{name:"model",rawName:"v-model",value:e.modelBind[t.ID],expression:"modelBind[row.ID]"}],attrs:{id:t.ID,type:"checkbox"},domProps:{checked:Array.isArray(e.modelBind[t.ID])?e._i(e.modelBind[t.ID],null)>-1:e.modelBind[t.ID]},on:{change:function(o){var n=e.modelBind[t.ID],r=o.target,a=!!r.checked;if(Array.isArray(n)){var l=e._i(n,null);r.checked?l<0&&e.$set(e.modelBind,t.ID,n.concat([null])):l>-1&&e.$set(e.modelBind,t.ID,n.slice(0,l).concat(n.slice(l+1)))}else e.$set(e.modelBind,t.ID,a)}}})]),e._v(" "),e._l(t.fieldDatas,function(n){return o("td",{key:n},[o("label",{attrs:{for:t.ID}},[e._v(e._s(n))])])})],2)}),0)],1)])},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var t=require("vue-hot-reload-api");t.install(require("vue")),t.compatible&&(module.hot.accept(),module.hot.data?t.reload("$e91867",e):t.createRecord("$e91867",e))}}();})();
94
+ },{"./ColumnSort":"hl0g","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"UipM":[function(require,module,exports) {
95
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=i(require("../components/MenuButton")),t=i(require("../components/ControlItem")),r=i(require("../components/EmptyCover")),n=i(require("../components/PopUp")),o=i(require("../components/ListTable")),s=i(require("../mixins/withMessage"));function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach(function(t){c(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var u={props:["options","pluginInfo"],mixins:[s.default],components:{ListTable:o.default,PopUp:n.default,MenuButton:e.default,ControlItem:t.default,EmptyCover:r.default},data:function(){return{userTables:[],selectedTables:{},exportType:"CSV",exportTypeControlOptions:{id:"exportType",type:"dropdown",label:"export type",options:[{label:"csv",value:"CSV"},{label:"xml",value:"XML"}]},filename:""}},mounted:function(){this.getUserTables()},computed:{exportTypeDescription:function(){var e={csvDescription:"<b>CSV:</b> ".concat(this.getTranslation("only text content of your tables will be exported, ideal for usage within other apps/plugins.")),xmlDescription:"<b>XML:</b> ".concat(this.getTranslation("an exact copy of your tables will be exported, ideal for backing up and sharing your tables with your other WordPress sites that uses WP Table Builder."))};return this.getTranslation(e["".concat(this.exportType.toLowerCase(),"Description")])},remainingTables:function(){var e=this;return this.userTables.filter(function(t){return!e.selectedTables[t.ID]})},parsedSelectedTables:function(){var e=this;return this.userTables.filter(function(t){return e.selectedTables[t.ID]})},exportDisabled:function(){return this.isBusy()||this.isSelectedEmpty()}},methods:{selectAll:function(){var e={};this.userTables.map(function(t){e[t.ID]=!0}),this.selectedTables=l({},this.selectedTables,{},e)},deselectAll:function(){this.selectedTables={}},isSelectedEmpty:function(){var e=this;return!Object.keys(this.selectedTables).filter(function(t){return!!Object.prototype.hasOwnProperty.call(e.selectedTables,t)&&e.selectedTables[t]}).length>0},getSelectedIds:function(){var e=this,t=[];return Object.keys(this.selectedTables).map(function(r){Object.prototype.hasOwnProperty.call(e.selectedTables,r)&&e.selectedTables[r]&&t.push(r)}),t},fieldLabel:function(e){return""===e.post_title?"Table #".concat(e.ID):e.post_title},getUserTables:function(){var e=this,t=this.options,r=t.ajaxUrl,n=t.fetchNonce,o=t.fetchAjaxAction,s=new FormData;s.append("nonce",n),s.append("action",o),this.setBusy(),fetch(r,{method:"POST",body:s}).then(function(t){if(t.ok)return t.json();throw new Error(e.getTranslation("an error occurred, try again later"))}).then(function(t){if(t.error)throw new Error(t.error);var r=[];e.userTables=t.data.userTables.map(function(t){var n=new Intl.DateTimeFormat("default",{year:"numeric",month:"long",day:"numeric"}).format(new Date(t.post_date)),o={ID:t.ID,fieldDatas:[e.fieldLabel(t),n,t.ID]};r.push(o)}),e.userTables=r}).catch(function(t){e.setMessage({type:"error",message:t})}).finally(function(){e.setBusy(!1)})},parseFilename:function(e){var t=new RegExp(/filename="(.+\..+)"/,"g").exec(e);if(null===t)throw new Error(this.getTranslation("invalid file name header"));return t[1]},exportTables:function(){var e=this,t=this.options,r=t.ajaxUrl,n=t.exportAjaxAction,o=t.exportNonce,s=new FormData;s.append("nonce",o),s.append("action",n),s.append("ids",JSON.stringify(this.getSelectedIds())),s.append("export_type",this.exportType),this.setBusy(),fetch(r,{method:"POST",body:s}).then(function(t){if(t.ok)return"application/octet-stream"===t.headers.get("content-type")?(e.filename=e.parseFilename(t.headers.get("content-disposition")),t.blob()):t.json();throw new Error(e.getTranslation("an error occurred, try again later"))}).then(function(t){if(t.error)throw new Error(t.error);var r=window.URL.createObjectURL(t);e.$refs.filesave.href=r,e.$refs.filesave.click(),window.URL.revokeObjectURL(r),e.resetSelections()}).catch(function(t){e.setMessage({type:"error",message:t})}).finally(function(){e.setBusy(!1)})},resetSelections:function(){this.selectedTables=[]}}};exports.default=u;
96
+ (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"wptb-menu-export-wrapper"},[a("div",{staticClass:"wptb-menu-export-card"},[a("div",{staticClass:"wptb-menu-export-control-title"},[t._v(t._s(t.getTranslation("all tables")))]),t._v(" "),a("list-table",{attrs:{"row-labels":["Title","Created","ID"].map(t.getTranslation),"row-data":t.remainingTables,"model-bind":t.selectedTables,"sort-type":{1:"date"}}}),t._v(" "),a("empty-cover",{directives:[{name:"show",rawName:"v-show",value:!t.userTables.length>0,expression:"!userTables.length > 0"}]},[t._v(" "+t._s(t.getTranslation("no tables found"))+" ")])],1),t._v(" "),a("div",{staticClass:"wptb-menu-export-middle-section"},[a("div",{staticClass:"arrow-holder"},[a("img",{attrs:{src:t.pluginInfo.plainArrow,title:t.getTranslation("select all"),alt:t.getTranslation("arrow")},on:{click:function(e){return e.preventDefault(),t.selectAll(e)}}})]),t._v(" "),a("div",[a("control-item",{staticClass:"wptb-flex wptb-flex-align-center wptb-flex-justify-center",attrs:{"field-data":t.exportTypeControlOptions,"model-bind":this}},[a("pop-up",{attrs:{message:t.exportTypeDescription}},[t._v("?")])],1)],1),t._v(" "),a("div",{staticClass:"arrow-holder flip"},[a("img",{attrs:{src:t.pluginInfo.plainArrow,title:t.getTranslation("deselect all"),alt:t.getTranslation("arrow")},on:{click:function(e){return e.preventDefault(),t.deselectAll(e)}}})])]),t._v(" "),a("div",{staticClass:"wptb-menu-export-card"},[a("div",{staticClass:"wptb-menu-export-control-title",staticStyle:{"text-align":"end"}},[t._v(" "+t._s(t.getTranslation("selected tables"))+" ")]),t._v(" "),a("list-table",{attrs:{"row-labels":["Title","Created","ID"].map(t.getTranslation),"row-data":t.parsedSelectedTables,"model-bind":t.selectedTables,"sort-type":{1:"date"}}}),t._v(" "),a("empty-cover",{directives:[{name:"show",rawName:"v-show",value:t.isSelectedEmpty(),expression:"isSelectedEmpty()"}]},[t._v(" "+t._s(t.getTranslation("no table selected"))+" ")])],1),t._v(" "),a("portal",{attrs:{to:"footerButtons"}},[a("a",{ref:"filesave",staticStyle:{display:"none"},attrs:{download:t.filename}},[t._v("_filesave")]),t._v(" "),a("div",{staticClass:"wptb-settings-button-container"},[a("menu-button",{attrs:{disabled:t.isBusy()},on:{click:t.getUserTables}},[t._v(t._s(t.getTranslation("refresh")))]),t._v(" "),a("menu-button",{attrs:{disabled:t.exportDisabled},on:{click:t.exportTables}},[t._v(t._s(t.strings.exportSection))])],1)])],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var e=require("vue-hot-reload-api");e.install(require("vue")),e.compatible&&(module.hot.accept(),module.hot.data?e.reload("$fa882b",t):e.createRecord("$fa882b",t))}}();})();
97
+ },{"../components/MenuButton":"ksMR","../components/ControlItem":"yXWm","../components/EmptyCover":"BOOO","../components/PopUp":"UuSu","../components/ListTable":"AF9R","../mixins/withMessage":"wm3G","_css_loader":"uNEb","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"l9Oj":[function(require,module,exports) {
98
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=c(require("../components/MenuHeader")),t=c(require("../components/Sections")),n=c(require("../components/SectionItem")),r=c(require("../components/MenuFooter")),o=c(require("../mixins/withMessage")),u=c(require("./ImportApp")),p=c(require("./ExportApp")),i=c(require("../components/MenuContent"));function c(e){return e&&e.__esModule?e:{default:e}}var s={props:["pluginInfo","options"],mixins:[o.default],components:{ExportApp:p.default,MenuContent:i.default,ImportApp:u.default,MenuHeader:e.default,SectionItem:n.default,Sections:t.default,MenuFooter:r.default},data:function(){return{currentSection:"Import"}},computed:{currentTemplate:function(){return"".concat(this.currentSection,"App")}}};exports.default=s;
99
+ (function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"wptb-settings-wrapper"},[o("menu-header",{attrs:{"logo-src":t.pluginInfo.logo,"logo-alt":t.strings.logoAlt,"plugin-name":t.pluginInfo.pluginName}},[o("a",{attrs:{href:t.pluginInfo.pluginHomepage}},[t._v(t._s(t.strings.homepage))])]),t._v(" "),o("sections",{attrs:{items:[t.strings.importSection,t.strings.exportSection]},model:{value:t.currentSection,callback:function(e){t.currentSection=e},expression:"currentSection"}},[o("portal-target",{attrs:{name:"childSections"}})],1),t._v(" "),o("menu-content",{attrs:{center:!0}},[o(t.currentTemplate,{tag:"component",attrs:{options:t.options,"plugin-info":t.pluginInfo}})],1),t._v(" "),o("menu-footer",[o("portal-target",{attrs:{name:"footerButtons"}})],1)],1)},staticRenderFns:[],_compiled:!0,_scopeId:null,functional:void 0}),function(){if(module.hot){var e=require("vue-hot-reload-api");e.install(require("vue")),e.compatible&&(module.hot.accept(),module.hot.data?e.reload("$8e2ae3",t):e.createRecord("$8e2ae3",t))}}();})();
100
+ },{"../components/MenuHeader":"vi91","../components/Sections":"yPIx","../components/SectionItem":"bosS","../components/MenuFooter":"nwtb","../mixins/withMessage":"wm3G","./ImportApp":"qRIs","./ExportApp":"UipM","../components/MenuContent":"vTRD","vue-hot-reload-api":"aJOh","vue":"HYXJ"}],"yEip":[function(require,module,exports) {
101
  "use strict";function t(t,e){t.mixin({data:function(){return{strings:e.strings}}})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={install:t};exports.default=e;
102
  },{}],"XomE":[function(require,module,exports) {
103
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("@wordpress/i18n");function t(t,r){var i=r.textDomain;t.mixin({methods:{getTranslation:function(t){return(0,e.__)(t,i)}}})}var r={install:t};exports.default=r;
104
  },{"@wordpress/i18n":"e20f"}],"NIwa":[function(require,module,exports) {
105
  "use strict";var e=u(require("vue")),t=u(require("portal-vue")),r=u(require("./containers/ImportExportApp")),n=u(require("./plugins/strings")),o=u(require("./plugins/translations"));function u(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=p({},wptbImportMenuData);wptbImportMenuData=void 0,e.default.config.productionTip=!1,e.default.use(n.default,{strings:s.strings}),e.default.use(o.default,{textDomain:s.options.textDomain}),e.default.use(t.default),new e.default({components:{ImportExportApp:r.default},data:{pluginInfo:s.pluginInfo,options:s.options}}).$mount("#wptb-import-menu");
106
+ },{"vue":"HYXJ","portal-vue":"Lue2","./containers/ImportExportApp":"l9Oj","./plugins/strings":"yEip","./plugins/translations":"XomE"}],"PMBU":[function(require,module,exports) {
107
+ var global = arguments[3];
108
+ var e,t,o=arguments[3],a="__parcel__error__overlay__",r=module.bundle.Module;function n(e){r.call(this,e),this.hot={data:module.bundle.hotData,_acceptCallbacks:[],_disposeCallbacks:[],accept:function(e){this._acceptCallbacks.push(e||function(){})},dispose:function(e){this._disposeCallbacks.push(e)}},module.bundle.hotData=null}module.bundle.Module=n;var c=module.bundle.parent;if(!(c&&c.isParcelRequire||"undefined"==typeof WebSocket)){var i=location.hostname,l="https:"===location.protocol?"wss":"ws",s=new WebSocket(l+"://"+i+":3488/");s.onmessage=function(a){e={},t=[];var r=JSON.parse(a.data);if("update"===r.type){var n=!1;r.assets.forEach(function(e){e.isNew||h(o.parcelRequire,e.id)&&(n=!0)}),(n=n||r.assets.every(function(e){return"css"===e.type&&e.generated.js}))?(console.clear(),r.assets.forEach(function(e){f(o.parcelRequire,e)}),t.forEach(function(e){m(e[0],e[1])})):location.reload&&location.reload()}if("reload"===r.type&&(s.close(),s.onclose=function(){location.reload()}),"error-resolved"===r.type&&(console.log("[parcel] ✨ Error resolved"),p()),"error"===r.type){console.error("[parcel] 🚨 "+r.error.message+"\n"+r.error.stack),p();var c=d(r);document.body.appendChild(c)}}}function p(){var e=document.getElementById(a);e&&e.remove()}function d(e){var t=document.createElement("div");t.id=a;var o=document.createElement("div"),r=document.createElement("pre");return o.innerText=e.error.message,r.innerText=e.error.stack,t.innerHTML='<div style="background: black; font-size: 16px; color: white; position: fixed; height: 100%; width: 100%; top: 0px; left: 0px; padding: 30px; opacity: 0.85; font-family: Menlo, Consolas, monospace; z-index: 9999;"><span style="background: red; padding: 2px 4px; border-radius: 2px;">ERROR</span><span style="top: 2px; margin-left: 5px; position: relative;">🚨</span><div style="font-size: 18px; font-weight: bold; margin-top: 20px;">'+o.innerHTML+"</div><pre>"+r.innerHTML+"</pre></div>",t}function u(e,t){var o=e.modules;if(!o)return[];var a,r,n,c=[];for(a in o)for(r in o[a][1])((n=o[a][1][r])===t||Array.isArray(n)&&n[n.length-1]===t)&&c.push(a);return e.parent&&(c=c.concat(u(e.parent,t))),c}function f(e,t){var o=e.modules;if(o)if(o[t.id]||!e.parent){var a=new Function("require","module","exports",t.generated.js);t.isNew=!o[t.id],o[t.id]=[a,t.deps]}else e.parent&&f(e.parent,t)}function h(a,r){var n=a.modules;if(n){if(!n[r]&&a.parent)return h(a.parent,r);if(!e[r]){e[r]=!0;var c=a.cache[r];return t.push([a,r]),!!(c&&c.hot&&c.hot._acceptCallbacks.length)||u(o.parcelRequire,r).some(function(e){return h(o.parcelRequire,e)})}}}function m(e,t){var o=e.cache[t];if(e.hotData={},o&&(o.hot.data=e.hotData),o&&o.hot&&o.hot._disposeCallbacks.length&&o.hot._disposeCallbacks.forEach(function(t){t(e.hotData)}),delete e.cache[t],e(t),(o=e.cache[t])&&o.hot&&o.hot._acceptCallbacks.length)return o.hot._acceptCallbacks.forEach(function(e){e()}),!0}
109
+ },{}]},{},["PMBU","NIwa"], null)
inc/admin/js/core/WPTB_Helper.js CHANGED
@@ -975,7 +975,6 @@ var WPTB_Helper = {
975
  data.elemContainer = elementContainerClass;
976
  data.elementControlTargetUnicClass = 'wptb-el-' + elementOptionClassIndic + '-' + data.controlKey;
977
  let controlTemplate = tmplControlTemplate( data );
978
-
979
  if( 'appearDependOnControl' in data ) {
980
  if( Array.isArray( data.appearDependOnControl ) ) {
981
  controlappearDependOnControl.push( [data.appearDependOnControl, data.elementControlTargetUnicClass] );
975
  data.elemContainer = elementContainerClass;
976
  data.elementControlTargetUnicClass = 'wptb-el-' + elementOptionClassIndic + '-' + data.controlKey;
977
  let controlTemplate = tmplControlTemplate( data );
 
978
  if( 'appearDependOnControl' in data ) {
979
  if( Array.isArray( data.appearDependOnControl ) ) {
980
  controlappearDependOnControl.push( [data.appearDependOnControl, data.elementControlTargetUnicClass] );
inc/admin/js/core/rollup-source/containers/IconSelectControl.vue CHANGED
@@ -23,7 +23,7 @@
23
  :class="{ 'wptb-icon-preview-active': selectedIcon.name === name }"
24
  :key="name"
25
  >
26
- <img :src="iconUrl" :title="name" @click="setIcon(name, iconUrl)" />
27
  </div>
28
  <intersection-observer
29
  :relative-element="innerDrawerRef"
@@ -110,7 +110,7 @@ export default {
110
  targetObj.appendChild(newSvgElement);
111
  });
112
  } else {
113
- targetObj.dataset.wptbButtonIconSrc = '';
114
  targetObj.innerHTML = '';
115
  }
116
  }
23
  :class="{ 'wptb-icon-preview-active': selectedIcon.name === name }"
24
  :key="name"
25
  >
26
+ <img :src="iconUrl" :title="name" :draggable="false" @click="setIcon(name, iconUrl)" />
27
  </div>
28
  <intersection-observer
29
  :relative-element="innerDrawerRef"
110
  targetObj.appendChild(newSvgElement);
111
  });
112
  } else {
113
+ this.setTargetValue(this.targetElements[0], '');
114
  targetObj.innerHTML = '';
115
  }
116
  }
inc/core/freemius/LICENSE.txt ADDED
@@ -0,0 +1,674 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
622
+
623
+ How to Apply These Terms to Your New Programs
624
+
625
+ If you develop a new program, and you want it to be of the greatest
626
+ possible use to the public, the best way to achieve this is to make it
627
+ free software which everyone can redistribute and change under these terms.
628
+
629
+ To do so, attach the following notices to the program. It is safest
630
+ to attach them to the start of each source file to most effectively
631
+ state the exclusion of warranty; and each file should have at least
632
+ the "copyright" line and a pointer to where the full notice is found.
633
+
634
+ {one line to give the program's name and a brief idea of what it does.}
635
+ Copyright (C) {year} {name of author}
636
+
637
+ This program is free software: you can redistribute it and/or modify
638
+ it under the terms of the GNU General Public License as published by
639
+ the Free Software Foundation, either version 3 of the License, or
640
+ (at your option) any later version.
641
+
642
+ This program is distributed in the hope that it will be useful,
643
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
+ GNU General Public License for more details.
646
+
647
+ You should have received a copy of the GNU General Public License
648
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
649
+
650
+ Also add information on how to contact you by electronic and paper mail.
651
+
652
+ If the program does terminal interaction, make it output a short
653
+ notice like this when it starts in an interactive mode:
654
+
655
+ {project} Copyright (C) {year} {fullname}
656
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+ This is free software, and you are welcome to redistribute it
658
+ under certain conditions; type `show c' for details.
659
+
660
+ The hypothetical commands `show w' and `show c' should show the appropriate
661
+ parts of the General Public License. Of course, your program's commands
662
+ might be different; for a GUI interface, you would use an "about box".
663
+
664
+ You should also get your employer (if you work as a programmer) or school,
665
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+ For more information on this, and how to apply and follow the GNU GPL, see
667
+ <http://www.gnu.org/licenses/>.
668
+
669
+ The GNU General Public License does not permit incorporating your program
670
+ into proprietary programs. If your program is a subroutine library, you
671
+ may consider it more useful to permit linking proprietary applications with
672
+ the library. If this is what you want to do, use the GNU Lesser General
673
+ Public License instead of this License. But first, please read
674
+ <http://www.gnu.org/philosophy/why-not-lgpl.html>.
inc/core/freemius/README.md ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Freemius WordPress SDK
2
+ ======================
3
+
4
+ [Monetization](https://freemius.com/wordpress/), [analytics](https://freemius.com/wordpress/insights/), and marketing automation platform for plugin & theme developers. Freemius empower developers to create prosperous subscription based businesses.
5
+
6
+ You can see some of the WordPress.org plugins & themes that are utilizing the power of Freemius here:
7
+
8
+ https://includewp.com/freemius/#focus
9
+
10
+ If you are a WordPress plugin or theme developer and you are interested to monetize with Freemius you can [sign-up here for free](https://dashboard.freemius.com/register/):
11
+
12
+ https://dashboard.freemius.com/register/
13
+
14
+ **Below you'll find the integration instructions for our WordPress SDK.**
15
+
16
+ ## Code Documentation
17
+
18
+ You can find the SDK's documentation here:
19
+ https://freemius.com/help/documentation/wordpress-sdk/
20
+
21
+ ## Initializing the SDK
22
+
23
+ Copy the code below and paste it into the top of your main plugin's PHP file, right after the plugin's header comment:
24
+
25
+ ```php
26
+ <?php
27
+ // Create a helper function for easy SDK access.
28
+ function my_prefix_fs() {
29
+ global $my_prefix_fs;
30
+ if ( ! isset( $my_prefix_fs ) ) {
31
+ // Include Freemius SDK.
32
+ require_once dirname(__FILE__) . '/freemius/start.php';
33
+
34
+ $my_prefix_fs = fs_dynamic_init( array(
35
+ 'id' => '1234',
36
+ 'slug' => 'my-plugin-slug',
37
+ 'menu_slug' => 'my_menu_slug', // You can also use __FILE__
38
+ 'public_key' => 'pk_MY_PUBLIC_KEY',
39
+ 'is_live' => true,
40
+ 'is_premium' => true,
41
+ 'has_addons' => false,
42
+ 'has_paid_plans' => false,
43
+ // Set the SDK to work in a sandbox mode (for development & testing).
44
+ // IMPORTANT: MAKE SURE TO REMOVE SECRET KEY BEFORE DEPLOYMENT.
45
+ 'secret_key' => 'sk_MY_SECRET_KEY',
46
+ ) );
47
+ }
48
+
49
+ return $my_prefix_fs;
50
+ }
51
+
52
+ // Init Freemius.
53
+ my_prefix_fs();
54
+ ?>
55
+ ```
56
+
57
+ - **1234** - Replace with your plugin's ID.
58
+ - **pk_MY_PUBLIC_KEY** - Replace with your plugin's public key.
59
+ - **sk_MY_SECRET_KEY** - Replace with your plugin's secret key.
60
+ - **my-plugin-slug** - Replace with your plugin's WordPress.org slug.
61
+ - **my_menu_slug** - Replace with your admin dashboard settings menu slug.
62
+
63
+
64
+ ## Usage example
65
+
66
+ You can call the SDK by using the shortcode function:
67
+
68
+ ```php
69
+ <?php my_prefix_fs()->get_upgrade_url(); ?>
70
+ ```
71
+
72
+ Or when calling Freemius multiple times in a scope, it's recommended to use it with the global variable:
73
+
74
+ ```php
75
+ <?php
76
+ global $my_prefix_fs;
77
+ $my_prefix_fs->get_account_url();
78
+ ?>
79
+ ```
80
+
81
+ ## Adding license based logic examples
82
+
83
+ Add marketing content to encourage your users to upgrade for your paid version:
84
+
85
+ ```php
86
+ <?php
87
+ if ( my_prefix_fs()->is_not_paying() ) {
88
+ echo '<section><h1>' . esc_html__('Awesome Premium Features', 'my-plugin-slug') . '</h1>';
89
+ echo '<a href="' . my_prefix_fs()->get_upgrade_url() . '">' .
90
+ esc_html__('Upgrade Now!', 'my-plugin-slug') .
91
+ '</a>';
92
+ echo '</section>';
93
+ }
94
+ ?>
95
+ ```
96
+
97
+ Add logic which will only be available in your premium plugin version:
98
+
99
+ ```php
100
+ <?php
101
+ // This "if" block will be auto removed from the Free version.
102
+ if ( my_prefix_fs()->is__premium_only() ) {
103
+
104
+ // ... premium only logic ...
105
+
106
+ }
107
+ ?>
108
+ ```
109
+
110
+ To add a function which will only be available in your premium plugin version, simply add __premium_only as the suffix of the function name. Just make sure that all lines that call that method directly or by hooks, are also wrapped in premium only logic:
111
+
112
+ ```php
113
+ <?php
114
+ class My_Plugin {
115
+ function init() {
116
+ ...
117
+
118
+ // This "if" block will be auto removed from the free version.
119
+ if ( my_prefix_fs()->is__premium_only() ) {
120
+ // Init premium version.
121
+ $this->admin_init__premium_only();
122
+
123
+ add_action( 'admin_init', array( &$this, 'admin_init_hook__premium_only' );
124
+ }
125
+
126
+ ...
127
+ }
128
+
129
+ // This method will be only included in the premium version.
130
+ function admin_init__premium_only() {
131
+ ...
132
+ }
133
+
134
+ // This method will be only included in the premium version.
135
+ function admin_init_hook__premium_only() {
136
+ ...
137
+ }
138
+ }
139
+ ?>
140
+ ```
141
+
142
+ Add logic which will only be executed for customers in your 'professional' plan:
143
+
144
+ ```php
145
+ <?php
146
+ if ( my_prefix_fs()->is_plan('professional', true) ) {
147
+ // .. logic related to Professional plan only ...
148
+ }
149
+ ?>
150
+ ```
151
+
152
+ Add logic which will only be executed for customers in your 'professional' plan or higher plans:
153
+
154
+ ```php
155
+ <?php
156
+ if ( my_prefix_fs()->is_plan('professional') ) {
157
+ // ... logic related to Professional plan and higher plans ...
158
+ }
159
+ ?>
160
+ ```
161
+
162
+ Add logic which will only be available in your premium plugin version AND will only be executed for customers in your 'professional' plan (and higher plans):
163
+
164
+ ```php
165
+ <?php
166
+ // This "if" block will be auto removed from the Free version.
167
+ if ( my_prefix_fs()->is_plan__premium_only('professional') ) {
168
+ // ... logic related to Professional plan and higher plans ...
169
+ }
170
+ ?>
171
+ ```
172
+
173
+ Add logic only for users in trial:
174
+
175
+ ```php
176
+ <?php
177
+ if ( my_prefix_fs()->is_trial() ) {
178
+ // ... logic for users in trial ...
179
+ }
180
+ ?>
181
+ ```
182
+
183
+ Add logic for specified paid plan:
184
+
185
+ ```php
186
+ <?php
187
+ // This "if" block will be auto removed from the Free version.
188
+ if ( my_prefix_fs()->is__premium_only() ) {
189
+ if ( my_prefix_fs()->is_plan( 'professional', true ) ) {
190
+
191
+ // ... logic related to Professional plan only ...
192
+
193
+ } else if ( my_prefix_fs()->is_plan( 'business' ) ) {
194
+
195
+ // ... logic related to Business plan and higher plans ...
196
+
197
+ }
198
+ }
199
+ ?>
200
+ ```
201
+
202
+ ## Excluding files and folders from the free plugin version
203
+ There are two ways to exclude files from your free version.
204
+
205
+ 1. Add `__premium_only` just before the file extension. For example, functions__premium_only.php will be only included in the premium plugin version. This works for all type of files, not only PHP.
206
+ 2. Add `@fs_premium_only` a sepcial meta tag to the plugin's main PHP file header. Example:
207
+ ```php
208
+ <?php
209
+ /**
210
+ * Plugin Name: My Very Awesome Plugin
211
+ * Plugin URI: http://my-awesome-plugin.com
212
+ * Description: Create and manage Awesomeness right in WordPress.
213
+ * Version: 1.0.0
214
+ * Author: Awesomattic
215
+ * Author URI: http://my-awesome-plugin.com/me/
216
+ * License: GPLv2
217
+ * Text Domain: myplugin
218
+ * Domain Path: /langs
219
+ *
220
+ * @fs_premium_only /lib/functions.php, /premium-files/
221
+ */
222
+
223
+ if ( ! defined( 'ABSPATH' ) ) {
224
+ exit;
225
+ }
226
+
227
+ // ... my code ...
228
+ ?>
229
+ ```
230
+ The file `/lib/functions.php` and the directory `/premium-files/` will be removed from the free plugin version.
231
+
232
+ # WordPress.org Compliance
233
+ Based on [WordPress.org Guidelines](https://wordpress.org/plugins/about/guidelines/) you are not allowed to submit a plugin that has premium code in it:
234
+ > All code hosted by WordPress.org servers must be free and fully-functional. If you want to sell advanced features for a plugin (such as a "pro" version), then you must sell and serve that code from your own site, we will not host it on our servers.
235
+
236
+ Therefore, if you want to deploy your free plugin's version to WordPress.org, make sure you wrap all your premium code with `if ( my_prefix_fs()->{{ method }}__premium_only() )` or the other methods provided to exclude premium features & files from the free version.
237
+
238
+ ## Deployment
239
+ Zip your plugin's root folder and upload it in the Deployment section in the *Freemius Developer's Dashboard*.
240
+ The plugin will be scanned and processed by a custom developed *PHP Processor* which will auto-generate two versions of your plugin:
241
+
242
+ 1. **Premium version**: Identical to your uploaded version, including all code (except your `secret_key`). Will be enabled for download ONLY for your paying or in trial customers.
243
+ 2. **Free version**: The code stripped from all your paid features (based on the logic added wrapped in `{ method }__premium_only()`).
244
+
245
+ The free version is the one that you should give your users to download. Therefore, download the free generated version and upload to your site. Or, if your plugin was WordPress.org complaint and you made sure to exclude all your premium code with the different provided techniques, you can deploy the downloaded free version to the .org repo.
246
+
247
+ ## Reporting Bugs
248
+ Email dev [at] freemius [dot] com
249
+
250
+ ## FAQ
251
+
252
+ ## Copyright
253
+ Freemius, Inc.
inc/core/freemius/assets/css/admin/account.css ADDED
@@ -0,0 +1 @@
 
1
+ label.fs-tag,span.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn,span.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-info,span.fs-tag.fs-info{background:#00a0d2}label.fs-tag.fs-success,span.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error,span.fs-tag.fs-error{background:#dc3232}#fs_account .postbox,#fs_account .widefat{max-width:800px}#fs_account h3{font-size:1.3em;padding:12px 15px;margin:0 0 12px 0;line-height:1.4;border-bottom:1px solid #F1F1F1}#fs_account h3 .dashicons{width:26px;height:26px;font-size:1.3em}#fs_account i.dashicons{font-size:1.2em;height:1.2em;width:1.2em}#fs_account .dashicons{vertical-align:middle}#fs_account .fs-header-actions{position:absolute;top:17px;right:15px;font-size:0.9em}#fs_account .fs-header-actions ul{margin:0}#fs_account .fs-header-actions li{float:left}#fs_account .fs-header-actions li form{display:inline-block}#fs_account .fs-header-actions li a{text-decoration:none}#fs_account_details .button-group{float:right}.rtl #fs_account .fs-header-actions{left:15px;right:auto}.fs-key-value-table{width:100%}.fs-key-value-table form{display:inline-block}.fs-key-value-table tr td:first-child{text-align:right}.fs-key-value-table tr td:first-child nobr{font-weight:bold}.fs-key-value-table tr td:first-child form{display:block}.fs-key-value-table tr td.fs-right{text-align:right}.fs-key-value-table tr.fs-odd{background:#ebebeb}.fs-key-value-table td,.fs-key-value-table th{padding:10px}.fs-key-value-table code{line-height:28px}.fs-key-value-table var,.fs-key-value-table code,.fs-key-value-table input[type="text"]{color:#0073AA;font-size:16px;background:none}.fs-key-value-table input[type="text"]{width:100%;font-weight:bold}.fs-field-beta_program label{margin-left:7px}label.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error{background:#dc3232}#fs_sites .fs-scrollable-table .fs-table-body{max-height:200px;overflow:auto;border:1px solid #e5e5e5}#fs_sites .fs-scrollable-table .fs-table-body>table.widefat{border:none !important}#fs_sites .fs-scrollable-table .fs-main-column{width:100%}#fs_sites .fs-scrollable-table .fs-site-details td:first-of-type{text-align:right;color:grey;width:1px}#fs_sites .fs-scrollable-table .fs-site-details td:last-of-type{text-align:right}#fs_sites .fs-scrollable-table .fs-install-details table tr td{width:1px;white-space:nowrap}#fs_sites .fs-scrollable-table .fs-install-details table tr td:last-of-type{width:auto}#fs_addons h3{border:none;margin-bottom:0;padding:4px 5px}#fs_addons td{vertical-align:middle}#fs_addons thead{white-space:nowrap}#fs_addons td:first-child,#fs_addons th:first-child{text-align:left;font-weight:bold}#fs_addons td:last-child,#fs_addons th:last-child{text-align:right}#fs_addons th{font-weight:bold}#fs_billing_address{width:100%}#fs_billing_address tr td{width:50%;padding:5px}#fs_billing_address tr:first-of-type td{padding-top:0}#fs_billing_address span{font-weight:bold}#fs_billing_address input,#fs_billing_address select{display:block;width:100%;margin-top:5px}#fs_billing_address input::-moz-placeholder,#fs_billing_address select::-moz-placeholder{color:transparent;opacity:1}#fs_billing_address input:-ms-input-placeholder,#fs_billing_address select:-ms-input-placeholder{color:transparent}#fs_billing_address input::-webkit-input-placeholder,#fs_billing_address select::-webkit-input-placeholder{color:transparent}#fs_billing_address input.fs-read-mode,#fs_billing_address select.fs-read-mode{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode td span{display:none}#fs_billing_address.fs-read-mode input,#fs_billing_address.fs-read-mode select{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode input::-moz-placeholder,#fs_billing_address.fs-read-mode select::-moz-placeholder{color:#ccc;opacity:1}#fs_billing_address.fs-read-mode input:-ms-input-placeholder,#fs_billing_address.fs-read-mode select:-ms-input-placeholder{color:#ccc}#fs_billing_address.fs-read-mode input::-webkit-input-placeholder,#fs_billing_address.fs-read-mode select::-webkit-input-placeholder{color:#ccc}#fs_billing_address button{display:block;width:100%}
inc/core/freemius/assets/css/admin/add-ons.css ADDED
@@ -0,0 +1,2 @@
 
 
1
+ .fs-badge{position:absolute;top:10px;right:0;background:#71ae00;color:white;text-transform:uppercase;padding:5px 10px;-moz-border-radius:3px 0 0 3px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;font-weight:bold;border-right:0;-moz-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);-webkit-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);box-shadow:0 2px 1px -1px rgba(0,0,0,0.3)}#fs_addons .fs-cards-list{list-style:none}#fs_addons .fs-cards-list .fs-card{float:left;height:152px;width:310px;padding:0;margin:0 0 30px 30px;font-size:14px;list-style:none;border:1px solid #ddd;cursor:pointer;position:relative}#fs_addons .fs-cards-list .fs-card .fs-overlay{position:absolute;left:0;right:0;bottom:0;top:0;z-index:9}#fs_addons .fs-cards-list .fs-card .fs-inner{background-color:#fff;overflow:hidden;height:100%;position:relative}#fs_addons .fs-cards-list .fs-card .fs-inner>ul{-moz-transition:all,0.15s;-o-transition:all,0.15s;-ms-transition:all,0.15s;-webkit-transition:all,0.15s;transition:all,0.15s;left:0;right:0;top:0;position:absolute}#fs_addons .fs-cards-list .fs-card .fs-inner>ul>li{list-style:none;line-height:18px;padding:0 15px;width:100%;display:block;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-card-banner{padding:0;margin:0;line-height:0;display:block;height:100px;background-repeat:repeat-x;background-size:100% 100%;-moz-transition:all,0.15s;-o-transition:all,0.15s;-ms-transition:all,0.15s;-webkit-transition:all,0.15s;transition:all,0.15s}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-card-banner .fs-badge.fs-installed-addon-badge{font-size:1.02em;line-height:1.3em}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-title{margin:10px 0 0 0;height:18px;overflow:hidden;color:#000;white-space:nowrap;text-overflow:ellipsis;font-weight:bold}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-offer{font-size:0.9em}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-description{background-color:#f9f9f9;padding:10px 15px 100px 15px;border-top:1px solid #eee;margin:0 0 10px 0;color:#777}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-tag{position:absolute;top:10px;right:0px;background:greenyellow;display:block;padding:2px 10px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.3);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.3);box-shadow:1px 1px 1px rgba(0,0,0,0.3);text-transform:uppercase;font-size:0.9em;font-weight:bold}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-cta .button,#fs_addons .fs-cards-list .fs-card .fs-inner .fs-cta .button-group{position:absolute;top:112px;right:10px}@media screen and (min-width: 960px){#fs_addons .fs-cards-list .fs-card:hover .fs-overlay{border:2px solid #29abe1;margin-left:-1px;margin-top:-1px}#fs_addons .fs-cards-list .fs-card:hover .fs-inner ul{top:-100px}#fs_addons .fs-cards-list .fs-card:hover .fs-inner .fs-title,#fs_addons .fs-cards-list .fs-card:hover .fs-inner .fs-offer{color:#29abe1}}
2
+ #TB_window,#TB_window iframe{width:821px !important}#plugin-information .fyi{width:266px !important}#plugin-information #section-holder{margin-right:299px}#plugin-information #section-description h2,#plugin-information #section-description h3,#plugin-information #section-description p,#plugin-information #section-description b,#plugin-information #section-description i,#plugin-information #section-description blockquote,#plugin-information #section-description li,#plugin-information #section-description ul,#plugin-information #section-description ol{clear:none}#plugin-information #section-description .fs-selling-points{padding-bottom:10px;border-bottom:1px solid #ddd}#plugin-information #section-description .fs-selling-points ul{margin:0}#plugin-information #section-description .fs-selling-points ul li{padding:0;list-style:none outside none}#plugin-information #section-description .fs-selling-points ul li i.dashicons{color:#71ae00;font-size:3em;vertical-align:middle;line-height:30px;float:left;margin:0 0 0 -15px}#plugin-information #section-description .fs-selling-points ul li h3{margin:1em 30px !important}#plugin-information #section-description .fs-screenshots:after{content:"";display:table;clear:both}#plugin-information #section-description .fs-screenshots ul{list-style:none;margin:0}#plugin-information #section-description .fs-screenshots ul li{width:225px;height:225px;float:left;margin-bottom:20px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}#plugin-information #section-description .fs-screenshots ul li a{display:block;width:100%;height:100%;border:1px solid;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.2);box-shadow:1px 1px 1px rgba(0,0,0,0.2);background-size:cover}#plugin-information #section-description .fs-screenshots ul li.odd{margin-right:20px}#plugin-information .plugin-information-pricing{margin:-16px;border-bottom:1px solid #ddd}#plugin-information .plugin-information-pricing .fs-plan h3{margin-top:0;padding:20px;font-size:16px}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper{border-bottom:1px solid #ddd}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab{cursor:pointer;position:relative;padding:0 10px;font-size:0.9em}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab label{text-transform:uppercase;color:green;background:greenyellow;position:absolute;left:-1px;right:-1px;bottom:100%;border:1px solid darkgreen;padding:2px;text-align:center;font-size:0.9em;line-height:1em}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab.nav-tab-active{cursor:default;background:#fffeec;border-bottom-color:#fffeec}#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle h3{background:#fffeec;margin:0;padding-bottom:0;color:#0073aa}#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle .nav-tab-wrapper,#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle .fs-billing-frequency{display:none}#plugin-information .plugin-information-pricing .fs-plan .fs-pricing-body{background:#fffeec;padding:20px}#plugin-information .plugin-information-pricing .fs-plan .button{width:100%;text-align:center;font-weight:bold;text-transform:uppercase;font-size:1.1em}#plugin-information .plugin-information-pricing .fs-plan label{white-space:nowrap}#plugin-information .plugin-information-pricing .fs-plan var{font-style:normal}#plugin-information .plugin-information-pricing .fs-plan .fs-billing-frequency,#plugin-information .plugin-information-pricing .fs-plan .fs-annual-discount{text-align:center;display:block;font-weight:bold;margin-bottom:10px;text-transform:uppercase;background:#F3F3F3;padding:2px;border:1px solid #ccc}#plugin-information .plugin-information-pricing .fs-plan .fs-annual-discount{text-transform:none;color:green;background:greenyellow}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms{font-size:0.9em}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms i{float:left;margin:0 0 0 -15px}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms li{margin:10px 0 0 0}#plugin-information #section-features .fs-features{margin:-20px -26px}#plugin-information #section-features table{width:100%;border-spacing:0;border-collapse:separate}#plugin-information #section-features table thead th{padding:10px 0}#plugin-information #section-features table thead .fs-price{color:#71ae00;font-weight:normal;display:block;text-align:center}#plugin-information #section-features table tbody td{border-top:1px solid #ccc;padding:10px 0;text-align:center;width:100px;color:#71ae00}#plugin-information #section-features table tbody td:first-child{text-align:left;width:auto;color:inherit;padding-left:26px}#plugin-information #section-features table tbody tr.fs-odd td{background:#fefefe}#plugin-information #section-features .dashicons-yes{width:30px;height:30px;font-size:30px}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .button-group .button,#plugin-information .fs-dropdown .button-group .button{position:relative;width:auto;top:0;right:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .button-group .button:focus,#plugin-information .fs-dropdown .button-group .button:focus{z-index:10}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .button-group .fs-dropdown-arrow,#plugin-information .fs-dropdown .button-group .fs-dropdown-arrow{border-top:6px solid white;border-right:4px solid transparent;border-left:4px solid transparent;top:12px;position:relative}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active:not(.up) .button:not(.fs-dropdown-arrow-button),#plugin-information .fs-dropdown.active:not(.up) .button:not(.fs-dropdown-arrow-button){border-bottom-left-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active:not(.up) .fs-dropdown-arrow-button,#plugin-information .fs-dropdown.active:not(.up) .fs-dropdown-arrow-button{border-bottom-right-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active.up .button:not(.fs-dropdown-arrow-button),#plugin-information .fs-dropdown.active.up .button:not(.fs-dropdown-arrow-button){border-top-left-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active.up .fs-dropdown-arrow-button,#plugin-information .fs-dropdown.active.up .fs-dropdown-arrow-button{border-top-right-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list,#plugin-information .fs-dropdown .fs-dropdown-list{position:absolute;right:-1px;top:100%;margin-left:auto;padding:3px 0;border:1px solid #bfbfbf;background-color:#fff;z-index:1;width:230px;text-align:left;-moz-box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12);-webkit-box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12);box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li,#plugin-information .fs-dropdown .fs-dropdown-list li{margin:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li a,#plugin-information .fs-dropdown .fs-dropdown-list li a{display:block;padding:5px 10px;text-decoration:none;text-shadow:none}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li:hover,#plugin-information .fs-dropdown .fs-dropdown-list li:hover{background-color:#0074a3;color:#fff}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li:hover a,#plugin-information .fs-dropdown .fs-dropdown-list li:hover a{color:#fff}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown:not(.up) .fs-dropdown-list,#plugin-information .fs-dropdown:not(.up) .fs-dropdown-list{-moz-border-radius:3px 0 3px 3px;-webkit-border-radius:3px 0 3px 3px;border-radius:3px 0 3px 3px}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.up .fs-dropdown-list,#plugin-information .fs-dropdown.up .fs-dropdown-list{-moz-border-radius:3px 3px 0 3px;-webkit-border-radius:3px 3px 0 3px;border-radius:3px 3px 0 3px}#plugin-information .fs-dropdown .button-group{width:100%}#plugin-information .fs-dropdown .button-group .button{float:none;font-size:14px;font-weight:normal;text-transform:none}#plugin-information .fs-dropdown .fs-dropdown-list{margin-top:1px}#plugin-information .fs-dropdown.up .fs-dropdown-list{top:auto;bottom:100%;margin-bottom:2px}#plugin-information.wp-core-ui .fs-pricing-body .fs-dropdown .button-group{text-align:center;display:table}#plugin-information.wp-core-ui .fs-pricing-body .fs-dropdown .button-group .button{display:table-cell}#plugin-information.wp-core-ui .fs-pricing-body .fs-dropdown .button-group .button:not(.fs-dropdown-arrow-button){left:1px;width:100%}#plugin-information-footer>.button,#plugin-information-footer .fs-dropdown{position:relative;top:3px}#plugin-information-footer>.button.left,#plugin-information-footer .fs-dropdown.left{float:left}#plugin-information-footer>.right,#plugin-information-footer .fs-dropdown{float:right}@media screen and (max-width: 961px){#fs_addons .fs-cards-list .fs-card{height:265px}}
inc/core/freemius/assets/css/admin/affiliation.css ADDED
@@ -0,0 +1 @@
 
1
+ @charset "UTF-8";#fs_affiliation_content_wrapper #messages{margin-top:25px}#fs_affiliation_content_wrapper h3{font-size:24px;padding:0;margin-left:0}#fs_affiliation_content_wrapper ul li{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;list-style-type:none}#fs_affiliation_content_wrapper ul li:before{content:'✓';margin-right:10px;font-weight:bold}#fs_affiliation_content_wrapper p:not(.description),#fs_affiliation_content_wrapper li,#fs_affiliation_content_wrapper label{font-size:16px !important;line-height:26px !important}#fs_affiliation_content_wrapper .button{margin-top:20px;margin-bottom:7px;line-height:35px;height:40px;font-size:16px}#fs_affiliation_content_wrapper .button#cancel_button{margin-right:5px}#fs_affiliation_content_wrapper form .input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form .input-container .input-label{font-weight:bold;display:block;width:100%}#fs_affiliation_content_wrapper form .input-container.input-container-text label,#fs_affiliation_content_wrapper form .input-container.input-container-text input,#fs_affiliation_content_wrapper form .input-container.input-container-text textarea{display:block}#fs_affiliation_content_wrapper form .input-container #add_domain,#fs_affiliation_content_wrapper form .input-container .remove-domain{text-decoration:none;display:inline-block;margin-top:3px}#fs_affiliation_content_wrapper form .input-container #add_domain:focus,#fs_affiliation_content_wrapper form .input-container .remove-domain:focus{box-shadow:none}#fs_affiliation_content_wrapper form .input-container #add_domain.disabled,#fs_affiliation_content_wrapper form .input-container .remove-domain.disabled{color:#aaa;cursor:default}#fs_affiliation_content_wrapper form #extra_domains_container .description{margin-top:0;position:relative;top:-4px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain{display:inline-block;margin-right:5px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain:last-of-type{margin-bottom:0}
inc/core/freemius/assets/css/admin/checkout.css ADDED
@@ -0,0 +1 @@
 
1
+ @media screen and (max-width: 782px){#wpbody-content{padding-bottom:0 !important}}
inc/core/freemius/assets/css/admin/common.css ADDED
@@ -0,0 +1,2 @@
 
 
1
+ .fs-badge{position:absolute;top:10px;right:0;background:#71ae00;color:white;text-transform:uppercase;padding:5px 10px;-moz-border-radius:3px 0 0 3px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;font-weight:bold;border-right:0;-moz-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);-webkit-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);box-shadow:0 2px 1px -1px rgba(0,0,0,0.3)}.theme-browser .theme .fs-premium-theme-badge-container{position:absolute;right:0;top:0}.theme-browser .theme .fs-premium-theme-badge-container .fs-badge{position:relative;top:0;margin-top:10px;text-align:center}.theme-browser .theme .fs-premium-theme-badge-container .fs-badge.fs-premium-theme-badge{font-size:1.1em}.theme-browser .theme .fs-premium-theme-badge-container .fs-badge.fs-beta-theme-badge{background:#00a0d2}.fs-switch{position:relative;display:inline-block;color:#ccc;text-shadow:0 1px 1px rgba(255,255,255,0.8);height:18px;padding:6px 6px 5px 6px;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);background:#ececec;box-shadow:0 0 4px rgba(0,0,0,0.1),inset 0 1px 3px 0 rgba(0,0,0,0.1);cursor:pointer}.fs-switch span{display:inline-block;width:35px;text-transform:uppercase}.fs-switch .fs-toggle{position:absolute;top:1px;width:37px;height:25px;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.3);border-radius:4px;background:#fff;background-color:#fff;background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #ececec), color-stop(1, #fff));background-image:-webkit-linear-gradient(top, #ececec, #fff);background-image:-moz-linear-gradient(top, #ececec, #fff);background-image:-ms-linear-gradient(top, #ececec, #fff);background-image:-o-linear-gradient(top, #ececec, #fff);background-image:linear-gradient(top, bottom, #ececec, #fff);box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.5);z-index:999;-moz-transition:0.4s cubic-bezier(0.54, 1.6, 0.5, 1);-o-transition:0.4s cubic-bezier(0.54, 1.6, 0.5, 1);-ms-transition:0.4s cubic-bezier(0.54, 1.6, 0.5, 1);-webkit-transition:0.4s cubic-bezier(0.54, 1.6, 0.5, 1);transition:0.4s cubic-bezier(0.54, 1.6, 0.5, 1)}.fs-switch.fs-off .fs-toggle{left:2%}.fs-switch.fs-on .fs-toggle{left:54%}.fs-switch.fs-round{top:8px;padding:4px 25px;-moz-border-radius:24px;-webkit-border-radius:24px;border-radius:24px}.fs-switch.fs-round .fs-toggle{top:0;width:24px;height:24px;-moz-border-radius:24px;-webkit-border-radius:24px;border-radius:24px}.fs-switch.fs-round.fs-off .fs-toggle{left:-1px}.fs-switch.fs-round.fs-on{background:#0085ba}.fs-switch.fs-round.fs-on .fs-toggle{left:25px}.fs-switch.fs-small.fs-round{padding:1px 19px}.fs-switch.fs-small.fs-round .fs-toggle{top:0;width:18px;height:18px;-moz-border-radius:18px;-webkit-border-radius:18px;border-radius:18px}.fs-switch.fs-small.fs-round.fs-on .fs-toggle{left:19px}.fs-switch-feedback{margin-left:10px}.fs-switch-feedback.success{color:#71ae00}.rtl .fs-switch-feedback{margin-left:0;margin-right:10px}#fs_frame{line-height:0;font-size:0}.fs-full-size-wrapper{margin:40px 0 -65px -20px}@media (max-width: 600px){.fs-full-size-wrapper{margin:0 0 -65px -10px}}
2
+ .fs-notice{position:relative}.fs-notice.fs-has-title{margin-bottom:30px !important}.fs-notice.success{color:green}.fs-notice.promotion{border-color:#00a0d2 !important;background-color:#f2fcff !important}.fs-notice .fs-notice-body{margin:.5em 0;padding:2px}.fs-notice .fs-close{cursor:pointer;color:#aaa;float:right}.fs-notice .fs-close:hover{color:#666}.fs-notice .fs-close>*{margin-top:7px;display:inline-block}.fs-notice label.fs-plugin-title{background:rgba(0,0,0,0.3);color:#fff;padding:2px 10px;position:absolute;top:100%;bottom:auto;right:auto;-moz-border-radius:0 0 3px 3px;-webkit-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;left:10px;font-size:12px;font-weight:bold;cursor:auto}div.fs-notice.updated,div.fs-notice.success,div.fs-notice.promotion{display:block !important}.rtl .fs-notice .fs-close{float:left}.fs-secure-notice{position:fixed;top:32px;left:160px;right:0;background:#ebfdeb;padding:10px 20px;color:green;z-index:9999;-moz-box-shadow:0 2px 2px rgba(6,113,6,0.3);-webkit-box-shadow:0 2px 2px rgba(6,113,6,0.3);box-shadow:0 2px 2px rgba(6,113,6,0.3);opacity:0.95;filter:alpha(opacity=95)}.fs-secure-notice:hover{opacity:1;filter:alpha(opacity=100)}.fs-secure-notice a.fs-security-proof{color:green;text-decoration:none}@media screen and (max-width: 960px){.fs-secure-notice{left:36px}}@media screen and (max-width: 600px){.fs-secure-notice{display:none}}@media screen and (max-width: 500px){#fs_promo_tab{display:none}}@media screen and (max-width: 782px){.fs-secure-notice{left:0;top:46px;text-align:center}}span.fs-submenu-item.fs-sub:before{content:'\21B3';padding:0 5px}.rtl span.fs-submenu-item.fs-sub:before{content:'\21B2'}.fs-submenu-item.pricing.upgrade-mode{color:greenyellow}.fs-submenu-item.pricing.trial-mode{color:#83e2ff}#adminmenu .update-plugins.fs-trial{background-color:#00b9eb}.fs-ajax-spinner{border:0;width:20px;height:20px;margin-right:5px;vertical-align:sub;display:inline-block;background:url("/wp-admin/images/wpspin_light-2x.gif");background-size:contain;margin-bottom:-2px}.wrap.fs-section h2{text-align:left}.plugins p.fs-upgrade-notice{border:0;background-color:#d54e21;padding:10px;color:#f9f9f9;margin-top:10px}
inc/core/freemius/assets/css/admin/connect.css ADDED
@@ -0,0 +1 @@
 
1
+ #fs_connect{width:480px;-moz-box-shadow:0px 1px 2px rgba(0,0,0,0.3);-webkit-box-shadow:0px 1px 2px rgba(0,0,0,0.3);box-shadow:0px 1px 2px rgba(0,0,0,0.3);margin:20px 0}@media screen and (max-width: 479px){#fs_connect{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;width:auto;margin:0 0 0 -10px}}#fs_connect .fs-content{background:#fff;padding:15px 20px}#fs_connect .fs-content .fs-error{background:snow;color:#d3135a;border:1px solid #d3135a;-moz-box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);text-align:center;padding:5px;margin-bottom:10px}#fs_connect .fs-content p{margin:0;padding:0;font-size:1.2em}#fs_connect .fs-license-key-container{position:relative;width:280px;margin:10px auto 0 auto}#fs_connect .fs-license-key-container input{width:100%}#fs_connect .fs-license-key-container .dashicons{position:absolute;top:5px;right:5px}#fs_connect.require-license-key .fs-sites-list-container td{cursor:pointer}#fs_connect #delegate_to_site_admins{margin-right:15px;float:right;height:26px;vertical-align:middle;line-height:37px;font-weight:bold;border-bottom:1px dashed;text-decoration:none}#fs_connect #delegate_to_site_admins.rtl{margin-left:15px;margin-right:0}#fs_connect .fs-actions{padding:10px 20px;background:#C0C7CA}#fs_connect .fs-actions .button{padding:0 10px 1px;line-height:35px;height:37px;font-size:16px;margin-bottom:0}#fs_connect .fs-actions .button .dashicons{font-size:37px;margin-left:-8px;margin-right:12px}#fs_connect .fs-actions .button.button-primary{padding-right:15px;padding-left:15px}#fs_connect .fs-actions .button.button-primary:after{content:' \279C'}#fs_connect .fs-actions .button.button-primary.fs-loading:after{content:''}#fs_connect .fs-actions .button.button-secondary{float:right}#fs_connect.fs-anonymous-disabled .fs-actions .button.button-primary{width:100%}#fs_connect .fs-permissions{padding:10px 20px;background:#FEFEFE;-moz-transition:background 0.5s ease;-o-transition:background 0.5s ease;-ms-transition:background 0.5s ease;-webkit-transition:background 0.5s ease;transition:background 0.5s ease}#fs_connect .fs-permissions .fs-license-sync-disclaimer{text-align:center;margin-top:0}#fs_connect .fs-permissions .fs-trigger{font-size:0.9em;text-decoration:none;text-align:center;display:block}#fs_connect .fs-permissions ul{height:0;overflow:hidden;margin:0}#fs_connect .fs-permissions ul li{margin-bottom:12px}#fs_connect .fs-permissions ul li:last-child{margin-bottom:0}#fs_connect .fs-permissions ul li i.dashicons{float:left;font-size:40px;width:40px;height:40px}#fs_connect .fs-permissions ul li .fs-switch{float:right}#fs_connect .fs-permissions ul li .fs-permission-description{margin-left:55px}#fs_connect .fs-permissions ul li .fs-permission-description span{font-weight:bold;text-transform:uppercase;color:#23282d}#fs_connect .fs-permissions ul li .fs-permission-description p{margin:2px 0 0 0}#fs_connect .fs-permissions.fs-open{background:#fff}#fs_connect .fs-permissions.fs-open ul{height:auto;margin:20px 20px 10px 20px}@media screen and (max-width: 479px){#fs_connect .fs-permissions{background:#fff}#fs_connect .fs-permissions .fs-trigger{display:none}#fs_connect .fs-permissions ul{height:auto;margin:20px}}#fs_connect .fs-freemium-licensing{padding:8px;background:#777;color:#fff}#fs_connect .fs-freemium-licensing p{text-align:center;display:block;margin:0;padding:0}#fs_connect .fs-freemium-licensing a{color:#C2EEFF;text-decoration:underline}#fs_connect .fs-visual{padding:12px;line-height:0;background:#fafafa;height:80px;position:relative}#fs_connect .fs-visual .fs-site-icon{position:absolute;left:20px;top:10px}#fs_connect .fs-visual .fs-connect-logo{position:absolute;right:20px;top:10px}#fs_connect .fs-visual .fs-plugin-icon{position:absolute;top:10px;left:50%;margin-left:-40px}#fs_connect .fs-visual .fs-plugin-icon,#fs_connect .fs-visual .fs-site-icon,#fs_connect .fs-visual img,#fs_connect .fs-visual object{width:80px;height:80px}#fs_connect .fs-visual .dashicons-wordpress{font-size:64px;background:#01749a;color:#fff;width:64px;height:64px;padding:8px}#fs_connect .fs-visual .dashicons-plus{position:absolute;top:50%;font-size:30px;margin-top:-10px;color:#bbb}#fs_connect .fs-visual .dashicons-plus.fs-first{left:28%}#fs_connect .fs-visual .dashicons-plus.fs-second{left:65%}#fs_connect .fs-visual .fs-plugin-icon,#fs_connect .fs-visual .fs-connect-logo,#fs_connect .fs-visual .fs-site-icon{border:1px solid #ccc;padding:1px;background:#fff}#fs_connect .fs-terms{text-align:center;font-size:0.85em;padding:5px;background:rgba(0,0,0,0.05)}#fs_connect .fs-terms,#fs_connect .fs-terms a{color:#999}#fs_connect .fs-terms a{text-decoration:none}.fs-multisite-options-container{margin-top:10px;border:1px solid #ccc;padding:5px}.fs-multisite-options-container a{text-decoration:none}.fs-multisite-options-container a:focus{box-shadow:none}.fs-multisite-options-container a.selected{font-weight:bold}.fs-multisite-options-container.fs-apply-on-all-sites{border:0 none;padding:0}.fs-multisite-options-container.fs-apply-on-all-sites .fs-all-sites-options{border-spacing:0}.fs-multisite-options-container.fs-apply-on-all-sites .fs-all-sites-options td:not(:first-child){display:none}.fs-multisite-options-container .fs-sites-list-container{display:none;overflow:auto}.fs-multisite-options-container .fs-sites-list-container table td{border-top:1px solid #ccc;padding:4px 2px}.fs-tooltip-trigger{position:relative}.fs-tooltip-trigger:not(a){cursor:help}.fs-tooltip-trigger .fs-tooltip{opacity:0;visibility:hidden;-moz-transition:opacity 0.3s ease-in-out;-o-transition:opacity 0.3s ease-in-out;-ms-transition:opacity 0.3s ease-in-out;-webkit-transition:opacity 0.3s ease-in-out;transition:opacity 0.3s ease-in-out;position:absolute;background:rgba(0,0,0,0.8);color:#fff;font-family:'arial', serif;font-size:12px;padding:10px;z-index:999999;bottom:100%;margin-bottom:5px;left:0;right:0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.2);box-shadow:1px 1px 1px rgba(0,0,0,0.2);line-height:1.3em;font-weight:bold;text-align:left}.rtl .fs-tooltip-trigger .fs-tooltip{text-align:right}.fs-tooltip-trigger .fs-tooltip::after{content:' ';display:block;width:0;height:0;border-style:solid;border-width:5px 5px 0 5px;border-color:rgba(0,0,0,0.8) transparent transparent transparent;position:absolute;top:100%;left:21px}.rtl .fs-tooltip-trigger .fs-tooltip::after{right:21px;left:auto}.fs-tooltip-trigger:hover .fs-tooltip{visibility:visible;opacity:1}#fs_marketing_optin{display:none;margin-top:10px;border:1px solid #ccc;padding:10px;line-height:1.5em}#fs_marketing_optin .fs-message{display:block;margin-bottom:5px;font-size:1.05em;font-weight:600}#fs_marketing_optin.error{border:1px solid #d3135a;background:#fee}#fs_marketing_optin.error .fs-message{color:#d3135a}#fs_marketing_optin .fs-input-container{margin-top:5px}#fs_marketing_optin .fs-input-container label{margin-top:5px;display:block}#fs_marketing_optin .fs-input-container label input{float:left;margin:1px 0 0 0}#fs_marketing_optin .fs-input-container label:first-child{display:block;margin-bottom:2px}#fs_marketing_optin .fs-input-label{display:block;margin-left:20px}#fs_marketing_optin .fs-input-label .underlined{text-decoration:underline}.rtl #fs_marketing_optin .fs-input-container label input{float:right}.rtl #fs_marketing_optin .fs-input-label{margin-left:0;margin-right:20px}.rtl #fs_connect .fs-actions{padding:10px 20px;background:#C0C7CA}.rtl #fs_connect .fs-actions .button .dashicons{font-size:37px;margin-left:-8px;margin-right:12px}.rtl #fs_connect .fs-actions .button.button-primary:after{content:' \000bb'}.rtl #fs_connect .fs-actions .button.button-primary.fs-loading:after{content:''}.rtl #fs_connect .fs-actions .button.button-secondary{float:left}.rtl #fs_connect .fs-permissions ul li .fs-permission-description{margin-right:55px;margin-left:0}.rtl #fs_connect .fs-permissions ul li .fs-switch{float:left}.rtl #fs_connect .fs-permissions ul li i.dashicons{float:right}.rtl #fs_connect .fs-visual .fs-site-icon{right:20px;left:auto}.rtl #fs_connect .fs-visual .fs-connect-logo{right:auto;left:20px}#fs_theme_connect_wrapper{position:fixed;top:0;height:100%;width:100%;z-index:99990;background:rgba(0,0,0,0.75);text-align:center;overflow-y:auto}#fs_theme_connect_wrapper:before{content:"";display:inline-block;vertical-align:middle;height:100%}#fs_theme_connect_wrapper>button.close{color:white;cursor:pointer;height:40px;width:40px;position:absolute;right:0;border:0;background-color:transparent;top:32px}#fs_theme_connect_wrapper #fs_connect{top:0;text-align:left;display:inline-block;vertical-align:middle;margin-top:52px;margin-bottom:20px}#fs_theme_connect_wrapper #fs_connect .fs-terms{background:rgba(140,140,140,0.64)}#fs_theme_connect_wrapper #fs_connect .fs-terms,#fs_theme_connect_wrapper #fs_connect .fs-terms a{color:#c5c5c5}.wp-pointer-content #fs_connect{margin:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.fs-opt-in-pointer .wp-pointer-content{padding:0}.fs-opt-in-pointer.wp-pointer-top .wp-pointer-arrow{border-bottom-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-top .wp-pointer-arrow-inner{border-bottom-color:#fafafa}.fs-opt-in-pointer.wp-pointer-bottom .wp-pointer-arrow{border-top-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-bottom .wp-pointer-arrow-inner{border-top-color:#fafafa}.fs-opt-in-pointer.wp-pointer-left .wp-pointer-arrow{border-right-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-left .wp-pointer-arrow-inner{border-right-color:#fafafa}.fs-opt-in-pointer.wp-pointer-right .wp-pointer-arrow{border-left-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-right .wp-pointer-arrow-inner{border-left-color:#fafafa}
inc/core/freemius/assets/css/admin/debug.css ADDED
@@ -0,0 +1 @@
 
1
+ .fs-switch-label{font-size:20px;line-height:31px;margin:0 5px}#fs_log_book table{font-family:Consolas,Monaco,monospace;font-size:12px}#fs_log_book table th{color:#ccc}#fs_log_book table tr{background:#232525}#fs_log_book table tr.alternate{background:#2b2b2b}#fs_log_book table tr td.fs-col--logger{color:#5a7435}#fs_log_book table tr td.fs-col--type{color:#ffc861}#fs_log_book table tr td.fs-col--function{color:#a7b7b1;font-weight:bold}#fs_log_book table tr td.fs-col--message,#fs_log_book table tr td.fs-col--message a{color:#9a73ac !important}#fs_log_book table tr td.fs-col--file{color:#d07922}#fs_log_book table tr td.fs-col--timestamp{color:#6596be}
inc/core/freemius/assets/css/admin/dialog-boxes.css ADDED
@@ -0,0 +1,2 @@
 
 
1
+ .fs-modal{position:fixed;overflow:auto;height:100%;width:100%;top:0;z-index:100000;display:none;background:rgba(0,0,0,0.6)}.fs-modal .dashicons{vertical-align:middle}.fs-modal .fs-modal-dialog{background:transparent;position:absolute;left:50%;margin-left:-298px;padding-bottom:30px;top:-100%;z-index:100001;width:596px}@media (max-width: 650px){.fs-modal .fs-modal-dialog{margin-left:-50%;box-sizing:border-box;padding-left:10px;padding-right:10px;width:100%}.fs-modal .fs-modal-dialog .fs-modal-panel>h3>strong{font-size:1.3em}}.fs-modal.active{display:block}.fs-modal.active:before{display:block}.fs-modal.active .fs-modal-dialog{top:10%}.fs-modal.fs-success .fs-modal-header{border-bottom-color:#46b450}.fs-modal.fs-success .fs-modal-body{background-color:#f7fff7}.fs-modal.fs-warn .fs-modal-header{border-bottom-color:#ffb900}.fs-modal.fs-warn .fs-modal-body{background-color:#fff8e5}.fs-modal.fs-error .fs-modal-header{border-bottom-color:#dc3232}.fs-modal.fs-error .fs-modal-body{background-color:#ffeaea}.fs-modal .fs-modal-body,.fs-modal .fs-modal-footer{border:0;background:#fefefe;padding:20px}.fs-modal .fs-modal-header{border-bottom:#eeeeee solid 1px;background:#fbfbfb;padding:15px 20px;position:relative;margin-bottom:-10px}.fs-modal .fs-modal-header h4{margin:0;padding:0;text-transform:uppercase;font-size:1.2em;font-weight:bold;color:#cacaca;text-shadow:1px 1px 1px #fff;letter-spacing:0.6px;-webkit-font-smoothing:antialiased}.fs-modal .fs-modal-header .fs-close{position:absolute;right:10px;top:12px;cursor:pointer;color:#bbb;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;padding:3px;-moz-transition:all 0.2s ease-in-out;-o-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.fs-modal .fs-modal-header .fs-close:hover{color:#fff;background:#aaa}.fs-modal .fs-modal-header .fs-close .dashicons,.fs-modal .fs-modal-header .fs-close:hover .dashicons{text-decoration:none}.fs-modal .fs-modal-body{border-bottom:0}.fs-modal .fs-modal-body p{font-size:14px}.fs-modal .fs-modal-body h2{font-size:20px;line-height:1.5em}.fs-modal .fs-modal-body>div{margin-top:10px}.fs-modal .fs-modal-body>div h2{font-weight:bold;font-size:20px;margin-top:0}.fs-modal .fs-modal-footer{border-top:#eeeeee solid 1px;text-align:right}.fs-modal .fs-modal-footer>.button{margin:0 7px}.fs-modal .fs-modal-footer>.button:first-child{margin:0}.fs-modal .fs-modal-panel>.notice.inline{margin:0;display:none}.fs-modal .fs-modal-panel:not(.active){display:none}.rtl .fs-modal .fs-modal-header .fs-close{right:auto;left:20px}body.has-fs-modal{overflow:hidden}.fs-modal.fs-modal-deactivation-feedback .reason-input,.fs-modal.fs-modal-deactivation-feedback .internal-message{margin:3px 0 3px 22px}.fs-modal.fs-modal-deactivation-feedback .reason-input input,.fs-modal.fs-modal-deactivation-feedback .reason-input textarea,.fs-modal.fs-modal-deactivation-feedback .internal-message input,.fs-modal.fs-modal-deactivation-feedback .internal-message textarea{width:100%}.fs-modal.fs-modal-deactivation-feedback li.reason.has-internal-message .internal-message{border:1px solid #ccc;padding:7px;display:none}@media (max-width: 650px){.fs-modal.fs-modal-deactivation-feedback li.reason li.reason{margin-bottom:10px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .reason-input,.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .internal-message{margin-left:29px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label{display:table}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label>span{display:table-cell;font-size:1.3em}}.fs-modal.fs-modal-deactivation-feedback .anonymous-feedback-label{float:left}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel{margin-top:0 !important}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel h3{margin-top:0;line-height:1.5em}#the-list .deactivate>.fs-slug{display:none}.fs-modal.fs-modal-subscription-cancellation .fs-price-increase-warning{color:red;font-weight:bold;padding:0 25px;margin-bottom:0}.fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label input{float:left;top:5px;position:relative}.rtl .fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label input{float:right}.fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label span{display:block;margin-left:24px}.rtl .fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label span{margin-left:0;margin-right:24px}.fs-modal.fs-modal-license-activation .fs-modal-body input.fs-license-key{width:100%}.fs-license-options-container table,.fs-license-options-container table select,.fs-license-options-container table .fs-available-license-key{width:100%}.fs-license-options-container table td:first-child{width:1%}.fs-license-options-container table .fs-other-license-key-container label{position:relative;top:6px;float:left;margin-right:5px}.fs-license-options-container table .fs-other-license-key-container div{overflow:hidden;width:auto;height:30px;display:block;top:2px;position:relative}.fs-license-options-container table .fs-other-license-key-container div input{margin:0}.fs-sites-list-container td{cursor:pointer}.fs-modal.fs-modal-user-change .fs-modal-body input#fs_other_email_address{width:100%}.fs-user-change-options-container table{width:100%;border-collapse:collapse}.fs-user-change-options-container table tr{display:block;margin-bottom:2px}.fs-user-change-options-container table .fs-email-address-container td{display:inline-block}.fs-user-change-options-container table .fs-email-address-container input[type="radio"]{margin-bottom:0;margin-top:0}.fs-user-change-options-container table .fs-other-email-address-container{width:100%}.fs-user-change-options-container table .fs-other-email-address-container>div{display:table;width:100%}.fs-user-change-options-container table .fs-other-email-address-container>div label,.fs-user-change-options-container table .fs-other-email-address-container>div>div{display:table-cell}.fs-user-change-options-container table .fs-other-email-address-container>div label{width:1%;padding-left:3px;padding-right:3px}.fs-user-change-options-container table .fs-other-email-address-container>div>div{width:auto}.fs-user-change-options-container table .fs-other-email-address-container>div>div input{width:100%}.fs-modal.fs-modal-developer-license-debug-mode .fs-modal-body input.fs-license-or-user-key{width:100%}.fs-multisite-options-container{margin-top:10px;border:1px solid #ccc;padding:5px}.fs-multisite-options-container a{text-decoration:none}.fs-multisite-options-container a:focus{box-shadow:none}.fs-multisite-options-container a.selected{font-weight:bold}.fs-multisite-options-container.fs-apply-on-all-sites{border:0 none;padding:0}.fs-multisite-options-container.fs-apply-on-all-sites .fs-all-sites-options{border-spacing:0}.fs-multisite-options-container.fs-apply-on-all-sites .fs-all-sites-options td:not(:first-child){display:none}.fs-multisite-options-container .fs-sites-list-container{display:none;overflow:auto}.fs-multisite-options-container .fs-sites-list-container table td{border-top:1px solid #ccc;padding:4px 2px}.fs-modal.fs-modal-license-key-resend .email-address-container{overflow:hidden;padding-right:2px}.fs-modal.fs-modal-license-key-resend.fs-freemium input.email-address{width:300px}.fs-modal.fs-modal-license-key-resend.fs-freemium label{display:block;margin-bottom:10px}.fs-modal.fs-modal-license-key-resend.fs-premium input.email-address{width:100%}.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{float:right;margin-left:7px}@media (max-width: 650px){.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{margin-top:2px}}
2
+ .rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .input-container>.email-address-container{padding-left:2px;padding-right:0}.rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .button-container{float:left;margin-right:7px;margin-left:0}a.show-license-resend-modal{margin-top:4px;display:inline-block}.fs-ajax-loader{position:relative;width:170px;height:20px;margin:auto}.fs-ajax-loader .fs-ajax-loader-bar{position:absolute;top:0;background-color:#0074a3;width:20px;height:20px;-webkit-animation-name:bounce_ajaxLoader;-moz-animation-name:bounce_ajaxLoader;-ms-animation-name:bounce_ajaxLoader;-o-animation-name:bounce_ajaxLoader;animation-name:bounce_ajaxLoader;-webkit-animation-duration:1.5s;-moz-animation-duration:1.5s;-ms-animation-duration:1.5s;-o-animation-duration:1.5s;animation-duration:1.5s;animation-iteration-count:infinite;-o-animation-iteration-count:infinite;-ms-animation-iteration-count:infinite;-webkit-animation-iteration-count:infinite;-moz-animation-iteration-count:infinite;-webkit-animation-direction:normal;-moz-animation-direction:normal;-ms-animation-direction:normal;-o-animation-direction:normal;animation-direction:normal;-moz-transform:0.3;-o-transform:0.3;-ms-transform:0.3;-webkit-transform:0.3;transform:0.3}.fs-ajax-loader .fs-ajax-loader-bar-1{left:0px;animation-delay:0.6s;-o-animation-delay:0.6s;-ms-animation-delay:0.6s;-webkit-animation-delay:0.6s;-moz-animation-delay:0.6s}.fs-ajax-loader .fs-ajax-loader-bar-2{left:19px;animation-delay:0.75s;-o-animation-delay:0.75s;-ms-animation-delay:0.75s;-webkit-animation-delay:0.75s;-moz-animation-delay:0.75s}.fs-ajax-loader .fs-ajax-loader-bar-3{left:38px;animation-delay:0.9s;-o-animation-delay:0.9s;-ms-animation-delay:0.9s;-webkit-animation-delay:0.9s;-moz-animation-delay:0.9s}.fs-ajax-loader .fs-ajax-loader-bar-4{left:57px;animation-delay:1.05s;-o-animation-delay:1.05s;-ms-animation-delay:1.05s;-webkit-animation-delay:1.05s;-moz-animation-delay:1.05s}.fs-ajax-loader .fs-ajax-loader-bar-5{left:76px;animation-delay:1.2s;-o-animation-delay:1.2s;-ms-animation-delay:1.2s;-webkit-animation-delay:1.2s;-moz-animation-delay:1.2s}.fs-ajax-loader .fs-ajax-loader-bar-6{left:95px;animation-delay:1.35s;-o-animation-delay:1.35s;-ms-animation-delay:1.35s;-webkit-animation-delay:1.35s;-moz-animation-delay:1.35s}.fs-ajax-loader .fs-ajax-loader-bar-7{left:114px;animation-delay:1.5s;-o-animation-delay:1.5s;-ms-animation-delay:1.5s;-webkit-animation-delay:1.5s;-moz-animation-delay:1.5s}.fs-ajax-loader .fs-ajax-loader-bar-8{left:133px;animation-delay:1.65s;-o-animation-delay:1.65s;-ms-animation-delay:1.65s;-webkit-animation-delay:1.65s;-moz-animation-delay:1.65s}@-moz-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-ms-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-o-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-webkit-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}.fs-modal-auto-install #request-filesystem-credentials-form h2,.fs-modal-auto-install #request-filesystem-credentials-form .request-filesystem-credentials-action-buttons{display:none}.fs-modal-auto-install #request-filesystem-credentials-form input[type=password],.fs-modal-auto-install #request-filesystem-credentials-form input[type=email],.fs-modal-auto-install #request-filesystem-credentials-form input[type=text]{-webkit-appearance:none;padding:10px 10px 5px 10px;width:300px;max-width:100%}.fs-modal-auto-install #request-filesystem-credentials-form>div,.fs-modal-auto-install #request-filesystem-credentials-form label,.fs-modal-auto-install #request-filesystem-credentials-form fieldset{width:300px;max-width:100%;margin:0 auto;display:block}.button-primary.warn{box-shadow:0 1px 0 #d2593c;text-shadow:0 -1px 1px #d2593c,1px 0 1px #d2593c,0 1px 1px #d2593c,-1px 0 1px #d2593c;background:#f56a48;border-color:#ec6544 #d2593c #d2593c}.button-primary.warn:hover{background:#fd6d4a;border-color:#d2593c}.button-primary.warn:focus{box-shadow:0 1px 0 #dd6041,0 0 2px 1px #e4a796}.button-primary.warn:active{background:#dd6041;border-color:#d2593c;box-shadow:inset 0 2px 0 #d2593c}.button-primary.warn.disabled{color:#f5b3a1 !important;background:#e76444 !important;border-color:#d85e40 !important;text-shadow:0 -1px 0 rgba(0,0,0,0.1) !important}
inc/core/freemius/assets/css/admin/gdpr-optin-notice.css ADDED
@@ -0,0 +1 @@
 
1
+ .fs-notice[data-id^="gdpr_optin_actions"] .underlined{text-decoration:underline}.fs-notice[data-id^="gdpr_optin_actions"] ul .button,.fs-notice[data-id^="gdpr_optin_actions"] ul .action-description{vertical-align:middle}.fs-notice[data-id^="gdpr_optin_actions"] ul .action-description{display:inline-block;margin-left:3px}
inc/core/freemius/assets/css/admin/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // Silence is golden.
3
+ // Hide file structure from users on unprotected servers.
inc/core/freemius/assets/css/admin/plugins.css ADDED
@@ -0,0 +1 @@
 
1
+ label.fs-tag,span.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn,span.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-info,span.fs-tag.fs-info{background:#00a0d2}label.fs-tag.fs-success,span.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error,span.fs-tag.fs-error{background:#dc3232}.wp-list-table.plugins .plugin-title span.fs-tag{display:inline-block;margin-left:5px;line-height:10px}
inc/core/freemius/assets/css/customizer.css ADDED
@@ -0,0 +1 @@
 
1
+ #fs_customizer_upsell .fs-customizer-plan{padding:10px 20px 20px 20px;border-radius:3px;background:#fff}#fs_customizer_upsell .fs-customizer-plan h2{position:relative;margin:0;line-height:2em;text-transform:uppercase}#fs_customizer_upsell .fs-customizer-plan h2 .button-link{top:-2px}#fs_customizer_upsell .fs-feature{position:relative}#fs_customizer_upsell .dashicons-yes{color:#0085ba;font-size:2em;vertical-align:bottom;margin-left:-7px;margin-right:10px}.rtl #fs_customizer_upsell .dashicons-yes{margin-left:10px;margin-right:-7px}#fs_customizer_upsell .dashicons-editor-help{color:#bbb;cursor:help}#fs_customizer_upsell .dashicons-editor-help .fs-feature-desc{opacity:0;visibility:hidden;-moz-transition:opacity 0.3s ease-in-out;-o-transition:opacity 0.3s ease-in-out;-ms-transition:opacity 0.3s ease-in-out;-webkit-transition:opacity 0.3s ease-in-out;transition:opacity 0.3s ease-in-out;position:absolute;background:#000;color:#fff;font-family:'arial', serif;font-size:12px;padding:10px;z-index:999999;bottom:100%;margin-bottom:5px;left:0;right:0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.2);box-shadow:1px 1px 1px rgba(0,0,0,0.2);line-height:1.3em;font-weight:bold;text-align:left}.rtl #fs_customizer_upsell .dashicons-editor-help .fs-feature-desc{text-align:right}#fs_customizer_upsell .dashicons-editor-help .fs-feature-desc::after{content:' ';display:block;width:0;height:0;border-style:solid;border-width:5px 5px 0 5px;border-color:#000 transparent transparent transparent;position:absolute;top:100%;left:21px}.rtl #fs_customizer_upsell .dashicons-editor-help .fs-feature-desc::after{right:21px;left:auto}#fs_customizer_upsell .dashicons-editor-help:hover .fs-feature-desc{visibility:visible;opacity:1}#fs_customizer_upsell .button-primary{display:block;text-align:center;margin-top:10px}#fs_customizer_support{display:block !important}#fs_customizer_support .button{float:right}#fs_customizer_support .button-group{width:100%;display:block;margin-top:10px}#fs_customizer_support .button-group .button{float:none;width:50%;text-align:center}#customize-theme-controls #accordion-section-freemius_upsell{border-top:1px solid #0085ba !important;border-bottom:1px solid #0085ba !important}#customize-theme-controls #accordion-section-freemius_upsell h3.accordion-section-title{color:#fff;background-color:#0085ba;border-left:4px solid #0085ba;transition:.15s background-color ease-in-out, .15s border-color ease-in-out;outline:none;border-bottom:none !important}#customize-theme-controls #accordion-section-freemius_upsell h3.accordion-section-title:hover{background-color:#008ec2;border-left-color:#0073aa}#customize-theme-controls #accordion-section-freemius_upsell h3.accordion-section-title:after{color:#fff}#customize-theme-controls #accordion-section-freemius_upsell .rtl h3.accordion-section-title{border-left:none;border-right:4px solid #0085ba}#customize-theme-controls #accordion-section-freemius_upsell .rtl h3.accordion-section-title:hover{border-right-color:#0073aa}
inc/core/freemius/assets/css/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // Silence is golden.
3
+ // Hide file structure from users on unprotected servers.
inc/core/freemius/assets/img/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // Silence is golden.
3
+ // Hide file structure from users on unprotected servers.
inc/core/freemius/assets/img/plugin-icon.png ADDED
Binary file
inc/core/freemius/assets/img/theme-icon.png ADDED
Binary file
inc/core/freemius/assets/img/wp-table-builder.png ADDED
Binary file
inc/core/freemius/assets/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // Silence is golden.
3
+ // Hide file structure from users on unprotected servers.
inc/core/freemius/assets/js/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // Silence is golden.
3
+ // Hide file structure from users on unprotected servers.
inc/core/freemius/assets/js/nojquery.ba-postmessage.js ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery postMessage - v0.5 - 9/11/2009
3
+ * http://benalman.com/projects/jquery-postmessage-plugin/
4
+ *
5
+ * Copyright (c) 2009 "Cowboy" Ben Alman
6
+ * Dual licensed under the MIT and GPL licenses.
7
+ * http://benalman.com/about/license/
8
+ *
9
+ * Non-jQuery fork by Jeff Lee
10
+ *
11
+ * This fork consists of the following changes:
12
+ * 1. Basic code cleanup and restructuring, for legibility.
13
+ * 2. The `postMessage` and `receiveMessage` functions can be bound arbitrarily,
14
+ * in terms of both function names and object scope. Scope is specified by
15
+ * the the "this" context of NoJQueryPostMessageMixin();
16
+ * 3. I've removed the check for Opera 9.64, which used `$.browser`. There were
17
+ * at least three different GitHub users requesting the removal of this
18
+ * "Opera sniff" on the original project's Issues page, so I figured this
19
+ * would be a relatively safe change.
20
+ * 4. `postMessage` no longer uses `$.param` to serialize messages that are not
21
+ * strings. I actually prefer this structure anyway. `receiveMessage` does
22
+ * not implement a corresponding deserialization step, and as such it seems
23
+ * cleaner and more symmetric to leave both data serialization and
24
+ * deserialization to the client.
25
+ * 5. The use of `$.isFunction` is replaced by a functionally-identical check.
26
+ * 6. The `$:nomunge` YUI option is no longer necessary.
27
+ */
28
+
29
+ function NoJQueryPostMessageMixin(postBinding, receiveBinding) {
30
+
31
+ var setMessageCallback, unsetMessageCallback, currentMsgCallback,
32
+ intervalId, lastHash, cacheBust = 1;
33
+
34
+ if (window.postMessage) {
35
+
36
+ if (window.addEventListener) {
37
+ setMessageCallback = function(callback) {
38
+ window.addEventListener('message', callback, false);
39
+ }
40
+
41
+ unsetMessageCallback = function(callback) {
42
+ window.removeEventListener('message', callback, false);
43
+ }
44
+ } else {
45
+ setMessageCallback = function(callback) {
46
+ window.attachEvent('onmessage', callback);
47
+ }
48
+
49
+ unsetMessageCallback = function(callback) {
50
+ window.detachEvent('onmessage', callback);
51
+ }
52
+ }
53
+
54
+ this[postBinding] = function(message, targetUrl, target) {
55
+ if (!targetUrl) {
56
+ return;
57
+ }
58
+
59
+ // The browser supports window.postMessage, so call it with a targetOrigin
60
+ // set appropriately, based on the targetUrl parameter.
61
+ target.postMessage( message, targetUrl.replace( /([^:]+:\/\/[^\/]+).*/, '$1' ) );
62
+ }
63
+
64
+ // Since the browser supports window.postMessage, the callback will be
65
+ // bound to the actual event associated with window.postMessage.
66
+ this[receiveBinding] = function(callback, sourceOrigin, delay) {
67
+ // Unbind an existing callback if it exists.
68
+ if (currentMsgCallback) {
69
+ unsetMessageCallback(currentMsgCallback);
70
+ currentMsgCallback = null;
71
+ }
72
+
73
+ if (!callback) {
74
+ return false;
75
+ }
76
+
77
+ // Bind the callback. A reference to the callback is stored for ease of
78
+ // unbinding.
79
+ currentMsgCallback = setMessageCallback(function(e) {
80
+ switch(Object.prototype.toString.call(sourceOrigin)) {
81
+ case '[object String]':
82
+ if (sourceOrigin !== e.origin) {
83
+ return false;
84
+ }
85
+ break;
86
+ case '[object Function]':
87
+ if (sourceOrigin(e.origin)) {
88
+ return false;
89
+ }
90
+ break;
91
+ }
92
+
93
+ callback(e);
94
+ });
95
+ };
96
+
97
+ } else {
98
+
99
+ this[postBinding] = function(message, targetUrl, target) {
100
+ if (!targetUrl) {
101
+ return;
102
+ }
103
+
104
+ // The browser does not support window.postMessage, so set the location
105
+ // of the target to targetUrl#message. A bit ugly, but it works! A cache
106
+ // bust parameter is added to ensure that repeat messages trigger the
107
+ // callback.
108
+ target.location = targetUrl.replace( /#.*$/, '' ) + '#' + (+new Date) + (cacheBust++) + '&' + message;
109
+ }
110
+
111
+ // Since the browser sucks, a polling loop will be started, and the
112
+ // callback will be called whenever the location.hash changes.
113
+ this[receiveBinding] = function(callback, sourceOrigin, delay) {
114
+ if (intervalId) {
115
+ clearInterval(intervalId);
116
+ intervalId = null;
117
+ }
118
+
119
+ if (callback) {
120
+ delay = typeof sourceOrigin === 'number'
121
+ ? sourceOrigin
122
+ : typeof delay === 'number'
123
+ ? delay
124
+ : 100;
125
+
126
+ intervalId = setInterval(function(){
127
+ var hash = document.location.hash,
128
+ re = /^#?\d+&/;
129
+ if ( hash !== lastHash && re.test( hash ) ) {
130
+ lastHash = hash;
131
+ callback({ data: hash.replace( re, '' ) });
132
+ }
133
+ }, delay );
134
+ }
135
+ };
136
+
137
+ }
138
+
139
+ return this;
140
+ }
inc/core/freemius/assets/js/nojquery.ba-postmessage.min.js ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * nojquery-postmessage by Jeff Lee
3
+ * a non-jQuery fork of:
4
+ *
5
+ * jQuery postMessage - v0.5 - 9/11/2009
6
+ * http://benalman.com/projects/jquery-postmessage-plugin/
7
+ *
8
+ * Copyright (c) 2009 "Cowboy" Ben Alman
9
+ * Dual licensed under the MIT and GPL licenses.
10
+ * http://benalman.com/about/license/
11
+ */
12
+ function NoJQueryPostMessageMixin(g,a){var b,h,e,d,f,c=1;if(window.postMessage){if(window.addEventListener){b=function(i){window.addEventListener("message",i,false)};h=function(i){window.removeEventListener("message",i,false)}}else{b=function(i){window.attachEvent("onmessage",i)};h=function(i){window.detachEvent("onmessage",i)}}this[g]=function(i,k,j){if(!k){return}j.postMessage(i,k.replace(/([^:]+:\/\/[^\/]+).*/,"$1"))};this[a]=function(k,j,i){if(e){h(e);e=null}if(!k){return false}e=b(function(l){switch(Object.prototype.toString.call(j)){case"[object String]":if(j!==l.origin){return false}break;case"[object Function]":if(j(l.origin)){return false}break}k(l)})}}else{this[g]=function(i,k,j){if(!k){return}j.location=k.replace(/#.*$/,"")+"#"+(+new Date)+(c++)+"&"+i};this[a]=function(k,j,i){if(d){clearInterval(d);d=null}if(k){i=typeof j==="number"?j:typeof i==="number"?i:100;d=setInterval(function(){var m=document.location.hash,l=/^#?\d+&/;if(m!==f&&l.test(m)){f=m;k({data:m.replace(l,"")})}},i)}}}return this};
inc/core/freemius/assets/js/postmessage.js ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($, undef) {
2
+ var global = this;
3
+
4
+ // Namespace.
5
+ global.FS = global.FS || {};
6
+
7
+ global.FS.PostMessage = function ()
8
+ {
9
+ var
10
+ _is_child = false,
11
+ _postman = new NoJQueryPostMessageMixin('postMessage', 'receiveMessage'),
12
+ _callbacks = {},
13
+ _base_url,
14
+ _parent_url = decodeURIComponent(document.location.hash.replace(/^#/, '')),
15
+ _parent_subdomain = _parent_url.substring(0, _parent_url.indexOf('/', ('https://' === _parent_url.substring(0, ('https://').length)) ? 8 : 7)),
16
+ _init = function () {
17
+ _postman.receiveMessage(function (e) {
18
+ var data = JSON.parse(e.data);
19
+
20
+ if (_callbacks[data.type]) {
21
+ for (var i = 0; i < _callbacks[data.type].length; i++) {
22
+ // Execute type callbacks.
23
+ _callbacks[data.type][i](data.data);
24
+ }
25
+ }
26
+ }, _base_url);
27
+ },
28
+ _hasParent = ('' !== _parent_url),
29
+ $window = $(window),
30
+ $html = $('html');
31
+
32
+ return {
33
+ init : function (url, iframes)
34
+ {
35
+ _base_url = url;
36
+ _init();
37
+
38
+ // Automatically receive forward messages.
39
+ FS.PostMessage.receiveOnce('forward', function (data){
40
+ window.location = data.url;
41
+ });
42
+
43
+ iframes = iframes || [];
44
+
45
+ if (iframes.length > 0) {
46
+ $window.on('scroll', function () {
47
+ for (var i = 0; i < iframes.length; i++) {
48
+ FS.PostMessage.postScroll(iframes[i]);
49
+ }
50
+ });
51
+ }
52
+ },
53
+ init_child : function ()
54
+ {
55
+ this.init(_parent_subdomain);
56
+
57
+ _is_child = true;
58
+
59
+ // Post height of a child right after window is loaded.
60
+ $(window).bind('load', function () {
61
+ FS.PostMessage.postHeight();
62
+
63
+ // Post message that window was loaded.
64
+ FS.PostMessage.post('loaded');
65
+ });
66
+ },
67
+ hasParent : function ()
68
+ {
69
+ return _hasParent;
70
+ },
71
+ postHeight : function (diff, wrapper) {
72
+ diff = diff || 0;
73
+ wrapper = wrapper || '#wrap_section';
74
+ this.post('height', {
75
+ height: diff + $(wrapper).outerHeight(true)
76
+ });
77
+ },
78
+ postScroll : function (iframe) {
79
+ this.post('scroll', {
80
+ top: $window.scrollTop(),
81
+ height: ($window.height() - parseFloat($html.css('paddingTop')) - parseFloat($html.css('marginTop')))
82
+ }, iframe);
83
+ },
84
+ post : function (type, data, iframe)
85
+ {
86
+ console.debug('PostMessage.post', type);
87
+
88
+ if (iframe)
89
+ {
90
+ // Post to iframe.
91
+ _postman.postMessage(JSON.stringify({
92
+ type: type,
93
+ data: data
94
+ }), iframe.src, iframe.contentWindow);
95
+ }
96
+ else {
97
+ // Post to parent.
98
+ _postman.postMessage(JSON.stringify({
99
+ type: type,
100
+ data: data
101
+ }), _parent_url, window.parent);
102
+ }
103
+ },
104
+ receive: function (type, callback)
105
+ {
106
+ console.debug('PostMessage.receive', type);
107
+
108
+ if (undef === _callbacks[type])
109
+ _callbacks[type] = [];
110
+
111
+ _callbacks[type].push(callback);
112
+ },
113
+ receiveOnce: function (type, callback)
114
+ {
115
+ if (this.is_set(type))
116
+ return;
117
+
118
+ this.receive(type, callback);
119
+ },
120
+ // Check if any callbacks assigned to a specified message type.
121
+ is_set: function (type)
122
+ {
123
+ return (undef != _callbacks[type]);
124
+ },
125
+ parent_url: function ()
126
+ {
127
+ return _parent_url;
128
+ },
129
+ parent_subdomain: function ()
130
+ {
131
+ return _parent_subdomain;
132
+ }
133
+ };
134
+ }();
135
+ })(jQuery);
inc/core/freemius/config.php ADDED
@@ -0,0 +1,388 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.4
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ if ( ! defined( 'WP_FS__SLUG' ) ) {
14
+ define( 'WP_FS__SLUG', 'freemius' );
15
+ }
16
+ if ( ! defined( 'WP_FS__DEV_MODE' ) ) {
17
+ define( 'WP_FS__DEV_MODE', false );
18
+ }
19
+
20
+ #--------------------------------------------------------------------------------
21
+ #region API Connectivity Issues Simulation
22
+ #--------------------------------------------------------------------------------
23
+
24
+ if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY' ) ) {
25
+ define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY', false );
26
+ }
27
+ if ( ! defined( 'WP_FS__SIMULATE_NO_CURL' ) ) {
28
+ define( 'WP_FS__SIMULATE_NO_CURL', false );
29
+ }
30
+ if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE' ) ) {
31
+ define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', false );
32
+ }
33
+ if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL' ) ) {
34
+ define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', false );
35
+ }
36
+ if ( WP_FS__SIMULATE_NO_CURL ) {
37
+ define( 'FS_SDK__SIMULATE_NO_CURL', true );
38
+ }
39
+ if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE ) {
40
+ define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', true );
41
+ }
42
+ if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL ) {
43
+ define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', true );
44
+ }
45
+
46
+ #endregion
47
+
48
+ if ( ! defined( 'WP_FS__SIMULATE_FREEMIUS_OFF' ) ) {
49
+ define( 'WP_FS__SIMULATE_FREEMIUS_OFF', false );
50
+ }
51
+
52
+ if ( ! defined( 'WP_FS__PING_API_ON_IP_OR_HOST_CHANGES' ) ) {
53
+ /**
54
+ * @since 1.1.7.3
55
+ * @author Vova Feldman (@svovaf)
56
+ *
57
+ * I'm not sure if shared servers periodically change IP, or the subdomain of the
58
+ * admin dashboard. Also, I've seen sites that have strange loop of switching
59
+ * between domains on a daily basis. Therefore, to eliminate the risk of
60
+ * multiple unwanted connectivity test pings, temporary ignore domain or
61
+ * server IP changes.
62
+ */
63
+ define( 'WP_FS__PING_API_ON_IP_OR_HOST_CHANGES', false );
64
+ }
65
+
66
+ /**
67
+ * If your dev environment supports custom public network IP setup
68
+ * like VVV, please update WP_FS__LOCALHOST_IP with your public IP
69
+ * and uncomment it during dev.
70
+ */
71
+ if ( ! defined( 'WP_FS__LOCALHOST_IP' ) ) {
72
+ // VVV default public network IP.
73
+ define( 'WP_FS__VVV_DEFAULT_PUBLIC_IP', '192.168.50.4' );
74
+
75
+ // define( 'WP_FS__LOCALHOST_IP', WP_FS__VVV_DEFAULT_PUBLIC_IP );
76
+ }
77
+
78
+ /**
79
+ * If true and running with secret key, the opt-in process
80
+ * will skip the email activation process which is invoked
81
+ * when the email of the context user already exist in Freemius
82
+ * database (as a security precaution, to prevent sharing user
83
+ * secret with unauthorized entity).
84
+ *
85
+ * IMPORTANT:
86
+ * AS A SECURITY PRECAUTION, WE VALIDATE THE TIMESTAMP OF THE OPT-IN REQUEST.
87
+ * THEREFORE, MAKE SURE THAT WHEN USING THIS PARAMETER,YOUR TESTING ENVIRONMENT'S
88
+ * CLOCK IS SYNCED.
89
+ */
90
+ if ( ! defined( 'WP_FS__SKIP_EMAIL_ACTIVATION' ) ) {
91
+ define( 'WP_FS__SKIP_EMAIL_ACTIVATION', false );
92
+ }
93
+
94
+
95
+ #--------------------------------------------------------------------------------
96
+ #region Directories
97
+ #--------------------------------------------------------------------------------
98
+
99
+ if ( ! defined( 'WP_FS__DIR' ) ) {
100
+ define( 'WP_FS__DIR', dirname( __FILE__ ) );
101
+ }
102
+ if ( ! defined( 'WP_FS__DIR_INCLUDES' ) ) {
103
+ define( 'WP_FS__DIR_INCLUDES', WP_FS__DIR . '/includes' );
104
+ }
105
+ if ( ! defined( 'WP_FS__DIR_TEMPLATES' ) ) {
106
+ define( 'WP_FS__DIR_TEMPLATES', WP_FS__DIR . '/templates' );
107
+ }
108
+ if ( ! defined( 'WP_FS__DIR_ASSETS' ) ) {
109
+ define( 'WP_FS__DIR_ASSETS', WP_FS__DIR . '/assets' );
110
+ }
111
+ if ( ! defined( 'WP_FS__DIR_CSS' ) ) {
112
+ define( 'WP_FS__DIR_CSS', WP_FS__DIR_ASSETS . '/css' );
113
+ }
114
+ if ( ! defined( 'WP_FS__DIR_JS' ) ) {
115
+ define( 'WP_FS__DIR_JS', WP_FS__DIR_ASSETS . '/js' );
116
+ }
117
+ if ( ! defined( 'WP_FS__DIR_IMG' ) ) {
118
+ define( 'WP_FS__DIR_IMG', WP_FS__DIR_ASSETS . '/img' );
119
+ }
120
+ if ( ! defined( 'WP_FS__DIR_SDK' ) ) {
121
+ define( 'WP_FS__DIR_SDK', WP_FS__DIR_INCLUDES . '/sdk' );
122
+ }
123
+
124
+ #endregion
125
+
126
+ /**
127
+ * Domain / URL / Address
128
+ */
129
+ define( 'WP_FS__ROOT_DOMAIN_PRODUCTION', 'freemius.com' );
130
+ define( 'WP_FS__DOMAIN_PRODUCTION', 'wp.freemius.com' );
131
+ define( 'WP_FS__ADDRESS_PRODUCTION', 'https://' . WP_FS__DOMAIN_PRODUCTION );
132
+
133
+ if ( ! defined( 'WP_FS__DOMAIN_LOCALHOST' ) ) {
134
+ define( 'WP_FS__DOMAIN_LOCALHOST', 'wp.freemius' );
135
+ }
136
+ if ( ! defined( 'WP_FS__ADDRESS_LOCALHOST' ) ) {
137
+ define( 'WP_FS__ADDRESS_LOCALHOST', 'http://' . WP_FS__DOMAIN_LOCALHOST . ':8080' );
138
+ }
139
+
140
+ if ( ! defined( 'WP_FS__TESTING_DOMAIN' ) ) {
141
+ define( 'WP_FS__TESTING_DOMAIN', 'fswp' );
142
+ }
143
+
144
+ #--------------------------------------------------------------------------------
145
+ #region HTTP
146
+ #--------------------------------------------------------------------------------
147
+
148
+ if ( ! defined( 'WP_FS__IS_HTTP_REQUEST' ) ) {
149
+ define( 'WP_FS__IS_HTTP_REQUEST', isset( $_SERVER['HTTP_HOST'] ) );
150
+ }
151
+
152
+ if ( ! defined( 'WP_FS__IS_HTTPS' ) ) {
153
+ define( 'WP_FS__IS_HTTPS', ( WP_FS__IS_HTTP_REQUEST &&
154
+ // Checks if CloudFlare's HTTPS (Flexible SSL support).
155
+ isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) &&
156
+ 'https' === strtolower( $_SERVER['HTTP_X_FORWARDED_PROTO'] )
157
+ ) ||
158
+ // Check if HTTPS request.
159
+ ( isset( $_SERVER['HTTPS'] ) && 'on' == $_SERVER['HTTPS'] ) ||
160
+ ( isset( $_SERVER['SERVER_PORT'] ) && 443 == $_SERVER['SERVER_PORT'] )
161
+ );
162
+ }
163
+
164
+ if ( ! defined( 'WP_FS__IS_POST_REQUEST' ) ) {
165
+ define( 'WP_FS__IS_POST_REQUEST', ( WP_FS__IS_HTTP_REQUEST &&
166
+ strtoupper( $_SERVER['REQUEST_METHOD'] ) == 'POST' ) );
167
+ }
168
+
169
+ if ( ! defined( 'WP_FS__REMOTE_ADDR' ) ) {
170
+ define( 'WP_FS__REMOTE_ADDR', fs_get_ip() );
171
+ }
172
+
173
+ if ( ! defined( 'WP_FS__IS_LOCALHOST' ) ) {
174
+ if ( defined( 'WP_FS__LOCALHOST_IP' ) ) {
175
+ define( 'WP_FS__IS_LOCALHOST', ( WP_FS__LOCALHOST_IP === WP_FS__REMOTE_ADDR ) );
176
+ } else {
177
+ define( 'WP_FS__IS_LOCALHOST', WP_FS__IS_HTTP_REQUEST &&
178
+ is_string( WP_FS__REMOTE_ADDR ) &&
179
+ ( substr( WP_FS__REMOTE_ADDR, 0, 4 ) === '127.' ||
180
+ WP_FS__REMOTE_ADDR === '::1' )
181
+ );
182
+ }
183
+ }
184
+
185
+ if ( ! defined( 'WP_FS__IS_LOCALHOST_FOR_SERVER' ) ) {
186
+ define( 'WP_FS__IS_LOCALHOST_FOR_SERVER', ( ! WP_FS__IS_HTTP_REQUEST ||
187
+ false !== strpos( $_SERVER['HTTP_HOST'], 'localhost' ) ) );
188
+ }
189
+
190
+ #endregion
191
+
192
+ if ( ! defined( 'WP_FS__IS_PRODUCTION_MODE' ) ) {
193
+ // By default, run with Freemius production servers.
194
+ define( 'WP_FS__IS_PRODUCTION_MODE', true );
195
+ }
196
+
197
+ if ( ! defined( 'WP_FS__ADDRESS' ) ) {
198
+ define( 'WP_FS__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? WP_FS__ADDRESS_PRODUCTION : WP_FS__ADDRESS_LOCALHOST ) );
199
+ }
200
+
201
+
202
+ #--------------------------------------------------------------------------------
203
+ #region API
204
+ #--------------------------------------------------------------------------------
205
+
206
+ if ( ! defined( 'WP_FS__API_ADDRESS_LOCALHOST' ) ) {
207
+ define( 'WP_FS__API_ADDRESS_LOCALHOST', 'http://api.freemius-local.com:8080' );
208
+ }
209
+ if ( ! defined( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST' ) ) {
210
+ define( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST', 'http://sandbox-api.freemius:8080' );
211
+ }
212
+
213
+ // Set API address for local testing.
214
+ if ( ! WP_FS__IS_PRODUCTION_MODE ) {
215
+ if ( ! defined( 'FS_API__ADDRESS' ) ) {
216
+ define( 'FS_API__ADDRESS', WP_FS__API_ADDRESS_LOCALHOST );
217
+ }
218
+ if ( ! defined( 'FS_API__SANDBOX_ADDRESS' ) ) {
219
+ define( 'FS_API__SANDBOX_ADDRESS', WP_FS__API_SANDBOX_ADDRESS_LOCALHOST );
220
+ }
221
+ }
222
+
223
+ #endregion
224
+
225
+ #--------------------------------------------------------------------------------
226
+ #region Checkout
227
+ #--------------------------------------------------------------------------------
228
+
229
+ if ( ! defined( 'FS_CHECKOUT__ADDRESS_PRODUCTION' ) ) {
230
+ define( 'FS_CHECKOUT__ADDRESS_PRODUCTION', 'https://checkout.freemius.com' );
231
+ }
232
+
233
+ if ( ! defined( 'FS_CHECKOUT__ADDRESS_LOCALHOST' ) ) {
234
+ define( 'FS_CHECKOUT__ADDRESS_LOCALHOST', 'http://checkout.freemius-local.com:8080' );
235
+ }
236
+
237
+ if ( ! defined( 'FS_CHECKOUT__ADDRESS' ) ) {
238
+ define( 'FS_CHECKOUT__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? FS_CHECKOUT__ADDRESS_PRODUCTION : FS_CHECKOUT__ADDRESS_LOCALHOST ) );
239
+ }
240
+
241
+ #endregion
242
+
243
+ define( 'WP_FS___OPTION_PREFIX', 'fs' . ( WP_FS__IS_PRODUCTION_MODE ? '' : '_dbg' ) . '_' );
244
+
245
+ if ( ! defined( 'WP_FS__ACCOUNTS_OPTION_NAME' ) ) {
246
+ define( 'WP_FS__ACCOUNTS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'accounts' );
247
+ }
248
+ if ( ! defined( 'WP_FS__API_CACHE_OPTION_NAME' ) ) {
249
+ define( 'WP_FS__API_CACHE_OPTION_NAME', WP_FS___OPTION_PREFIX . 'api_cache' );
250
+ }
251
+ if ( ! defined( 'WP_FS__GDPR_OPTION_NAME' ) ) {
252
+ define( 'WP_FS__GDPR_OPTION_NAME', WP_FS___OPTION_PREFIX . 'gdpr' );
253
+ }
254
+ define( 'WP_FS__OPTIONS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'options' );
255
+
256
+ /**
257
+ * Module types
258
+ *
259
+ * @since 1.2.2
260
+ */
261
+ define( 'WP_FS__MODULE_TYPE_PLUGIN', 'plugin' );
262
+ define( 'WP_FS__MODULE_TYPE_THEME', 'theme' );
263
+
264
+ /**
265
+ * Billing Frequencies
266
+ */
267
+ define( 'WP_FS__PERIOD_ANNUALLY', 'annual' );
268
+ define( 'WP_FS__PERIOD_MONTHLY', 'monthly' );
269
+ define( 'WP_FS__PERIOD_LIFETIME', 'lifetime' );
270
+
271
+ /**
272
+ * Plans
273
+ */
274
+ define( 'WP_FS__PLAN_DEFAULT_PAID', false );
275
+ define( 'WP_FS__PLAN_FREE', 'free' );
276
+ define( 'WP_FS__PLAN_TRIAL', 'trial' );
277
+
278
+ /**
279
+ * Times in seconds
280
+ */
281
+ if ( ! defined( 'WP_FS__TIME_5_MIN_IN_SEC' ) ) {
282
+ define( 'WP_FS__TIME_5_MIN_IN_SEC', 300 );
283
+ }
284
+ if ( ! defined( 'WP_FS__TIME_10_MIN_IN_SEC' ) ) {
285
+ define( 'WP_FS__TIME_10_MIN_IN_SEC', 600 );
286
+ }
287
+ // define( 'WP_FS__TIME_15_MIN_IN_SEC', 900 );
288
+ if ( ! defined( 'WP_FS__TIME_12_HOURS_IN_SEC' ) ) {
289
+ define( 'WP_FS__TIME_12_HOURS_IN_SEC', 43200 );
290
+ }
291
+ if ( ! defined( 'WP_FS__TIME_24_HOURS_IN_SEC' ) ) {
292
+ define( 'WP_FS__TIME_24_HOURS_IN_SEC', WP_FS__TIME_12_HOURS_IN_SEC * 2 );
293
+ }
294
+ if ( ! defined( 'WP_FS__TIME_WEEK_IN_SEC' ) ) {
295
+ define( 'WP_FS__TIME_WEEK_IN_SEC', 7 * WP_FS__TIME_24_HOURS_IN_SEC );
296
+ }
297
+
298
+ #--------------------------------------------------------------------------------
299
+ #region Debugging
300
+ #--------------------------------------------------------------------------------
301
+
302
+ if ( ! defined( 'WP_FS__DEBUG_SDK' ) ) {
303
+ $debug_mode = get_option( 'fs_debug_mode', null );
304
+
305
+ if ( $debug_mode === null ) {
306
+ $debug_mode = false;
307
+ add_option( 'fs_debug_mode', $debug_mode );
308
+ }
309
+
310
+ define( 'WP_FS__DEBUG_SDK', is_numeric( $debug_mode ) ? ( 0 < $debug_mode ) : WP_FS__DEV_MODE );
311
+ }
312
+
313
+ if ( ! defined( 'WP_FS__ECHO_DEBUG_SDK' ) ) {
314
+ define( 'WP_FS__ECHO_DEBUG_SDK', WP_FS__DEV_MODE && ! empty( $_GET['fs_dbg_echo'] ) );
315
+ }
316
+ if ( ! defined( 'WP_FS__LOG_DATETIME_FORMAT' ) ) {
317
+ define( 'WP_FS__LOG_DATETIME_FORMAT', 'Y-m-d H:i:s' );
318
+ }
319
+ if ( ! defined( 'FS_API__LOGGER_ON' ) ) {
320
+ define( 'FS_API__LOGGER_ON', WP_FS__DEBUG_SDK );
321
+ }
322
+
323
+ if ( WP_FS__ECHO_DEBUG_SDK ) {
324
+ error_reporting( E_ALL );
325
+ }
326
+
327
+ #endregion
328
+
329
+ if ( ! defined( 'WP_FS__SCRIPT_START_TIME' ) ) {
330
+ define( 'WP_FS__SCRIPT_START_TIME', time() );
331
+ }
332
+ if ( ! defined( 'WP_FS__DEFAULT_PRIORITY' ) ) {
333
+ define( 'WP_FS__DEFAULT_PRIORITY', 10 );
334
+ }
335
+ if ( ! defined( 'WP_FS__LOWEST_PRIORITY' ) ) {
336
+ define( 'WP_FS__LOWEST_PRIORITY', 999999999 );
337
+ }
338
+
339
+ #--------------------------------------------------------------------------------
340
+ #region Multisite Network
341
+ #--------------------------------------------------------------------------------
342
+
343
+ /**
344
+ * Do not use this define directly, it will have the wrong value
345
+ * during plugin uninstall/deletion when the inclusion of the plugin
346
+ * is triggered due to registration with register_uninstall_hook().
347
+ *
348
+ * Instead, use fs_is_network_admin().
349
+ *
350
+ * @author Vova Feldman (@svovaf)
351
+ */
352
+ if ( ! defined( 'WP_FS__IS_NETWORK_ADMIN' ) ) {
353
+ define( 'WP_FS__IS_NETWORK_ADMIN',
354
+ is_multisite() &&
355
+ ( is_network_admin() ||
356
+ ( ( defined( 'DOING_AJAX' ) && DOING_AJAX &&
357
+ ( isset( $_REQUEST['_fs_network_admin'] ) /*||
358
+ ( ! empty( $_REQUEST['action'] ) && 'delete-plugin' === $_REQUEST['action'] )*/ )
359
+ ) ||
360
+ // Plugin uninstall.
361
+ defined( 'WP_UNINSTALL_PLUGIN' ) )
362
+ )
363
+ );
364
+ }
365
+
366
+ /**
367
+ * Do not use this define directly, it will have the wrong value
368
+ * during plugin uninstall/deletion when the inclusion of the plugin
369
+ * is triggered due to registration with register_uninstall_hook().
370
+ *
371
+ * Instead, use fs_is_blog_admin().
372
+ *
373
+ * @author Vova Feldman (@svovaf)
374
+ */
375
+ if ( ! defined( 'WP_FS__IS_BLOG_ADMIN' ) ) {
376
+ define( 'WP_FS__IS_BLOG_ADMIN', is_blog_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && isset( $_REQUEST['_fs_blog_admin'] ) ) );
377
+ }
378
+
379
+ if ( ! defined( 'WP_FS__SHOW_NETWORK_EVEN_WHEN_DELEGATED' ) ) {
380
+ // Set to true to show network level settings even if delegated to site admins.
381
+ define( 'WP_FS__SHOW_NETWORK_EVEN_WHEN_DELEGATED', false );
382
+ }
383
+
384
+ #endregion
385
+
386
+ if ( ! defined( 'WP_FS__DEMO_MODE' ) ) {
387
+ define( 'WP_FS__DEMO_MODE', false );
388
+ }
inc/core/freemius/includes/class-freemius-abstract.php ADDED
@@ -0,0 +1,597 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.7
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+
14
+ /**
15
+ * - Each instance of Freemius class represents a single plugin
16
+ * install by a single user (the installer of the plugin).
17
+ *
18
+ * - Each website can only have one install of the same plugin.
19
+ *
20
+ * - Install entity is only created after a user connects his account with Freemius.
21
+ *
22
+ * Class Freemius_Abstract
23
+ */
24
+ abstract class Freemius_Abstract {
25
+
26
+ #----------------------------------------------------------------------------------
27
+ #region Identity
28
+ #----------------------------------------------------------------------------------
29
+
30
+ /**
31
+ * Check if user has connected his account (opted-in).
32
+ *
33
+ * Note:
34
+ * If the user opted-in and opted-out on a later stage,
35
+ * this will still return true. If you want to check if the
36
+ * user is currently opted-in, use:
37
+ * `$fs->is_registered() && $fs->is_tracking_allowed()`
38
+ *
39
+ * @since 1.0.1
40
+ * @return bool
41
+ */
42
+ abstract function is_registered();
43
+
44
+ /**
45
+ * Check if the user skipped connecting the account with Freemius.
46
+ *
47
+ * @since 1.0.7
48
+ *
49
+ * @return bool
50
+ */
51
+ abstract function is_anonymous();
52
+
53
+ /**
54
+ * Check if the user currently in activation mode.
55
+ *
56
+ * @since 1.0.7
57
+ *
58
+ * @return bool
59
+ */
60
+ abstract function is_activation_mode();
61
+
62
+ #endregion
63
+
64
+ #----------------------------------------------------------------------------------
65
+ #region Usage Tracking
66
+ #----------------------------------------------------------------------------------
67
+
68
+ /**
69
+ * Returns TRUE if the user opted-in and didn't disconnect (opt-out).
70
+ *
71
+ * @author Leo Fajardo (@leorw)
72
+ * @since 1.2.1.5
73
+ *
74
+ * @return bool
75
+ */
76
+ abstract function is_tracking_allowed();
77
+
78
+ /**
79
+ * Returns TRUE if the user never opted-in or manually opted-out.
80
+ *
81
+ * @author Vova Feldman (@svovaf)
82
+ * @since 1.2.1.5
83
+ *
84
+ * @return bool
85
+ */
86
+ function is_tracking_prohibited() {
87
+ return ! $this->is_registered() || ! $this->is_tracking_allowed();
88
+ }
89
+
90
+ /**
91
+ * Opt-out from usage tracking.
92
+ *
93
+ * Note: This will not delete the account information but will stop all tracking.
94
+ *
95
+ * Returns:
96
+ * 1. FALSE - If the user never opted-in.
97
+ * 2. TRUE - If successfully opted-out.
98
+ * 3. object - API Result on failure.
99
+ *
100
+ * @author Leo Fajardo (@leorw)
101
+ * @since 1.2.1.5
102
+ *
103
+ * @return bool|object
104
+ */
105
+ abstract function stop_tracking();
106
+
107
+ /**
108
+ * Opt-in back into usage tracking.
109
+ *
110
+ * Note: This will only work if the user opted-in previously.
111
+ *
112
+ * Returns:
113
+ * 1. FALSE - If the user never opted-in.
114
+ * 2. TRUE - If successfully opted-in back to usage tracking.
115
+ * 3. object - API result on failure.
116
+ *
117
+ * @author Leo Fajardo (@leorw)
118
+ * @since 1.2.1.5
119
+ *
120
+ * @return bool|object
121
+ */
122
+ abstract function allow_tracking();
123
+
124
+ #endregion
125
+
126
+ #----------------------------------------------------------------------------------
127
+ #region Module Type
128
+ #----------------------------------------------------------------------------------
129
+
130
+ /**
131
+ * Checks if the plugin's type is "plugin". The other type is "theme".
132
+ *
133
+ * @author Leo Fajardo (@leorw)
134
+ * @since 1.2.2
135
+ *
136
+ * @return bool
137
+ */
138
+ abstract function is_plugin();
139
+
140
+ /**
141
+ * Checks if the module type is "theme". The other type is "plugin".
142
+ *
143
+ * @author Leo Fajardo (@leorw)
144
+ * @since 1.2.2
145
+ *
146
+ * @return bool
147
+ */
148
+ function is_theme() {
149
+ return ( ! $this->is_plugin() );
150
+ }
151
+
152
+ #endregion
153
+
154
+ #----------------------------------------------------------------------------------
155
+ #region Permissions
156
+ #----------------------------------------------------------------------------------
157
+
158
+ /**
159
+ * Check if plugin must be WordPress.org compliant.
160
+ *
161
+ * @since 1.0.7
162
+ *
163
+ * @return bool
164
+ */
165
+ abstract function is_org_repo_compliant();
166
+
167
+ /**
168
+ * Check if plugin is allowed to install executable files.
169
+ *
170
+ * @author Vova Feldman (@svovaf)
171
+ * @since 1.0.5
172
+ *
173
+ * @return bool
174
+ */
175
+ function is_allowed_to_install() {
176
+ return ( $this->is_premium() || ! $this->is_org_repo_compliant() );
177
+ }
178
+
179
+ #endregion
180
+
181
+ /**
182
+ * Check if user in trial or in free plan (not paying).
183
+ *
184
+ * @author Vova Feldman (@svovaf)
185
+ * @since 1.0.4
186
+ *
187
+ * @return bool
188
+ */
189
+ function is_not_paying() {
190
+ return ( $this->is_trial() || $this->is_free_plan() );
191
+ }
192
+
193
+ /**
194
+ * Check if the user has an activated and valid paid license on current plugin's install.
195
+ *
196
+ * @since 1.0.9
197
+ *
198
+ * @return bool
199
+ */
200
+ abstract function is_paying();
201
+
202
+ /**
203
+ * Check if the user is paying or in trial.
204
+ *
205
+ * @since 1.0.9
206
+ *
207
+ * @return bool
208
+ */
209
+ function is_paying_or_trial() {
210
+ return ( $this->is_paying() || $this->is_trial() );
211
+ }
212
+
213
+ /**
214
+ * Check if user in a trial or have feature enabled license.
215
+ *
216
+ * @author Vova Feldman (@svovaf)
217
+ * @since 1.1.7
218
+ *
219
+ * @return bool
220
+ */
221
+ abstract function can_use_premium_code();
222
+
223
+ #----------------------------------------------------------------------------------
224
+ #region Premium Only
225
+ #----------------------------------------------------------------------------------
226
+
227
+ /**
228
+ * All logic wrapped in methods with "__premium_only()" suffix will be only
229
+ * included in the premium code.
230
+ *
231
+ * Example:
232
+ * if ( freemius()->is__premium_only() ) {
233
+ * ...
234
+ * }
235
+ */
236
+
237
+ /**
238
+ * Returns true when running premium plugin code.
239
+ *
240
+ * @since 1.0.9
241
+ *
242
+ * @return bool
243
+ */
244
+ function is__premium_only() {
245
+ return $this->is_premium();
246
+ }
247
+
248
+ /**
249
+ * Check if the user has an activated and valid paid license on current plugin's install.
250
+ *
251
+ * @since 1.0.9
252
+ *
253
+ * @return bool
254
+ *
255
+ */
256
+ function is_paying__premium_only() {
257
+ return ( $this->is__premium_only() && $this->is_paying() );
258
+ }
259
+
260
+ /**
261
+ * All code wrapped in this statement will be only included in the premium code.
262
+ *
263
+ * @since 1.0.9
264
+ *
265
+ * @param string $plan Plan name.
266
+ * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
267
+ *
268
+ * @return bool
269
+ */
270
+ function is_plan__premium_only( $plan, $exact = false ) {
271
+ return ( $this->is_premium() && $this->is_plan( $plan, $exact ) );
272
+ }
273
+
274
+ /**
275
+ * Check if plan matches active license' plan or active trial license' plan.
276
+ *
277
+ * All code wrapped in this statement will be only included in the premium code.
278
+ *
279
+ * @since 1.0.9
280
+ *
281
+ * @param string $plan Plan name.
282
+ * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
283
+ *
284
+ * @return bool
285
+ */
286
+ function is_plan_or_trial__premium_only( $plan, $exact = false ) {
287
+ return ( $this->is_premium() && $this->is_plan_or_trial( $plan, $exact ) );
288
+ }
289
+
290
+ /**
291
+ * Check if the user is paying or in trial.
292
+ *
293
+ * All code wrapped in this statement will be only included in the premium code.
294
+ *
295
+ * @since 1.0.9
296
+ *
297
+ * @return bool
298
+ */
299
+ function is_paying_or_trial__premium_only() {
300
+ return $this->is_premium() && $this->is_paying_or_trial();
301
+ }
302
+
303
+ /**
304
+ * Check if the user has an activated and valid paid license on current plugin's install.
305
+ *
306
+ * @since 1.0.4
307
+ *
308
+ * @return bool
309
+ *
310
+ * @deprecated Method name is confusing since it's not clear from the name the code will be removed.
311
+ * @using Alias to is_paying__premium_only()
312
+ */
313
+ function is_paying__fs__() {
314
+ return $this->is_paying__premium_only();
315
+ }
316
+
317
+ /**
318
+ * Check if user in a trial or have feature enabled license.
319
+ *
320
+ * All code wrapped in this statement will be only included in the premium code.
321
+ *
322
+ * @author Vova Feldman (@svovaf)
323
+ * @since 1.1.9
324
+ *
325
+ * @return bool
326
+ */
327
+ function can_use_premium_code__premium_only() {
328
+ return $this->is_premium() && $this->can_use_premium_code();
329
+ }
330
+
331
+ #endregion
332
+
333
+ #----------------------------------------------------------------------------------
334
+ #region Trial
335
+ #----------------------------------------------------------------------------------
336
+
337
+ /**
338
+ * Check if the user in a trial.
339
+ *
340
+ * @since 1.0.3
341
+ *
342
+ * @return bool
343
+ */
344
+ abstract function is_trial();
345
+
346
+ /**
347
+ * Check if trial already utilized.
348
+ *
349
+ * @since 1.0.9
350
+ *
351
+ * @return bool
352
+ */
353
+ abstract function is_trial_utilized();
354
+
355
+ #endregion
356
+
357
+ #----------------------------------------------------------------------------------
358
+ #region Plans
359
+ #----------------------------------------------------------------------------------
360
+
361
+ /**
362
+ * Check if the user is on the free plan of the product.
363
+ *
364
+ * @since 1.0.4
365
+ *
366
+ * @return bool
367
+ */
368
+ abstract function is_free_plan();
369
+
370
+ /**
371
+ * @since 1.0.2
372
+ *
373
+ * @param string $plan Plan name.
374
+ * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
375
+ *
376
+ * @return bool
377
+ */
378
+ abstract function is_plan( $plan, $exact = false );
379
+
380
+ /**
381
+ * Check if plan based on trial. If not in trial mode, should return false.
382
+ *
383
+ * @since 1.0.9
384
+ *
385
+ * @param string $plan Plan name.
386
+ * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
387
+ *
388
+ * @return bool
389
+ */
390
+ abstract function is_trial_plan( $plan, $exact = false );
391
+
392
+ /**
393
+ * Check if plan matches active license' plan or active trial license' plan.
394
+ *
395
+ * @since 1.0.9
396
+ *
397
+ * @param string $plan Plan name.
398
+ * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
399
+ *
400
+ * @return bool
401
+ */
402
+ function is_plan_or_trial( $plan, $exact = false ) {
403
+ return $this->is_plan( $plan, $exact ) ||
404
+ $this->is_trial_plan( $plan, $exact );
405
+ }
406
+
407
+ /**
408
+ * Check if plugin has any paid plans.
409
+ *
410
+ * @author Vova Feldman (@svovaf)
411
+ * @since 1.0.7
412
+ *
413
+ * @return bool
414
+ */
415
+ abstract function has_paid_plan();
416
+
417
+ /**
418
+ * Check if plugin has any free plan, or is it premium only.
419
+ *
420
+ * Note: If no plans configured, assume plugin is free.
421
+ *
422
+ * @author Vova Feldman (@svovaf)
423
+ * @since 1.0.7
424
+ *
425
+ * @return bool
426
+ */
427
+ abstract function has_free_plan();
428
+
429
+ /**
430
+ * Check if plugin is premium only (no free plans).
431
+ *
432
+ * NOTE: is__premium_only() is very different method, don't get confused.
433
+ *
434
+ * @author Vova Feldman (@svovaf)
435
+ * @since 1.1.9
436
+ *
437
+ * @return bool
438
+ */
439
+ abstract function is_only_premium();
440
+
441
+ /**
442
+ * Check if module has a premium code version.
443
+ *
444
+ * Serviceware module might be freemium without any
445
+ * premium code version, where the paid features
446
+ * are all part of the service.
447
+ *
448
+ * @author Vova Feldman (@svovaf)
449
+ * @since 1.2.1.6
450
+ *
451
+ * @return bool
452
+ */
453
+ abstract function has_premium_version();
454
+
455
+ /**
456
+ * Check if module has any release on Freemius,
457
+ * or all plugin's code is on WordPress.org (Serviceware).
458
+ *
459
+ * @return bool
460
+ */
461
+ function has_release_on_freemius() {
462
+ return ! $this->is_org_repo_compliant() ||
463
+ $this->has_premium_version();
464
+ }
465
+
466
+ /**
467
+ * Checks if it's a freemium plugin.
468
+ *
469
+ * @author Vova Feldman (@svovaf)
470
+ * @since 1.1.9
471
+ *
472
+ * @return bool
473
+ */
474
+ function is_freemium() {
475
+ return $this->has_paid_plan() &&
476
+ $this->has_free_plan();
477
+ }
478
+
479
+ /**
480
+ * Check if module has only one plan.
481
+ *
482
+ * @author Vova Feldman (@svovaf)
483
+ * @since 1.2.1.7
484
+ *
485
+ * @return bool
486
+ */
487
+ abstract function is_single_plan();
488
+
489
+ #endregion
490
+
491
+ /**
492
+ * Check if running payments in sandbox mode.
493
+ *
494
+ * @since 1.0.4
495
+ *
496
+ * @return bool
497
+ */
498
+ abstract function is_payments_sandbox();
499
+
500
+ /**
501
+ * Check if running test vs. live plugin.
502
+ *
503
+ * @since 1.0.5
504
+ *
505
+ * @return bool
506
+ */
507
+ abstract function is_live();
508
+
509
+ /**
510
+ * Check if running premium plugin code.
511
+ *
512
+ * @since 1.0.5
513
+ *
514
+ * @return bool
515
+ */
516
+ abstract function is_premium();
517
+
518
+ /**
519
+ * Get upgrade URL.
520
+ *
521
+ * @author Vova Feldman (@svovaf)
522
+ * @since 1.0.2
523
+ *
524
+ * @param string $period Billing cycle.
525
+ *
526
+ * @return string
527
+ */
528
+ abstract function get_upgrade_url( $period = WP_FS__PERIOD_ANNUALLY );
529
+
530
+ /**
531
+ * Check if Freemius was first added in a plugin update.
532
+ *
533
+ * @author Vova Feldman (@svovaf)
534
+ * @since 1.1.5
535
+ *
536
+ * @return bool
537
+ */
538
+ function is_plugin_update() {
539
+ return ! $this->is_plugin_new_install();
540
+ }
541
+
542
+ /**
543
+ * Check if Freemius was part of the plugin when the user installed it first.
544
+ *
545
+ * @author Vova Feldman (@svovaf)
546
+ * @since 1.1.5
547
+ *
548
+ * @return bool
549
+ */
550
+ abstract function is_plugin_new_install();
551
+
552
+ #----------------------------------------------------------------------------------
553
+ #region Marketing
554
+ #----------------------------------------------------------------------------------
555
+
556
+ /**
557
+ * Check if current user purchased any other plugins before.
558
+ *
559
+ * @author Vova Feldman (@svovaf)
560
+ * @since 1.0.9
561
+ *
562
+ * @return bool
563
+ */
564
+ abstract function has_purchased_before();
565
+
566
+ /**
567
+ * Check if current user classified as an agency.
568
+ *
569
+ * @author Vova Feldman (@svovaf)
570
+ * @since 1.0.9
571
+ *
572
+ * @return bool
573
+ */
574
+ abstract function is_agency();
575
+
576
+ /**
577
+ * Check if current user classified as a developer.
578
+ *
579
+ * @author Vova Feldman (@svovaf)
580
+ * @since 1.0.9
581
+ *
582
+ * @return bool
583
+ */
584
+ abstract function is_developer();
585
+
586
+ /**
587
+ * Check if current user classified as a business.
588
+ *
589
+ * @author Vova Feldman (@svovaf)
590
+ * @since 1.0.9
591
+ *
592
+ * @return bool
593
+ */
594
+ abstract function is_business();
595
+
596
+ #endregion
597
+ }
inc/core/freemius/includes/class-freemius.php ADDED
@@ -0,0 +1,24591 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.3
7
+ */
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+
12
+ // "final class"
13
+ class Freemius extends Freemius_Abstract {
14
+ /**
15
+ * SDK Version
16
+ *
17
+ * @var string
18
+ */
19
+ public $version = WP_FS__SDK_VERSION;
20
+
21
+ #region Plugin Info
22
+
23
+ /**
24
+ * @since 1.0.1
25
+ *
26
+ * @var string
27
+ */
28
+ private $_slug;
29
+
30
+ /**
31
+ * @since 1.0.0
32
+ *
33
+ * @var string
34
+ */
35
+ private $_plugin_basename;
36
+ /**
37
+ * @since 2.2.1
38
+ *
39
+ * @var string
40
+ */
41
+ private $_premium_plugin_basename;
42
+ /**
43
+ * @since 1.0.0
44
+ *
45
+ * @var string
46
+ */
47
+ private $_free_plugin_basename;
48
+ /**
49
+ * @since 1.0.0
50
+ *
51
+ * @var string
52
+ */
53
+ private $_plugin_dir_path;
54
+ /**
55
+ * @since 1.0.0
56
+ *
57
+ * @var string
58
+ */
59
+ private $_plugin_dir_name;
60
+ /**
61
+ * @since 1.0.0
62
+ *
63
+ * @var string
64
+ */
65
+ private $_plugin_main_file_path;
66
+ /**
67
+ * @var string[]
68
+ */
69
+ private $_plugin_data;
70
+ /**
71
+ * @since 1.0.9
72
+ *
73
+ * @var string
74
+ */
75
+ private $_plugin_name;
76
+ /**
77
+ * @since 1.2.2
78
+ *
79
+ * @var string
80
+ */
81
+ private $_module_type;
82
+
83
+ #endregion Plugin Info
84
+
85
+ /**
86
+ * @since 1.0.9
87
+ *
88
+ * @var bool If false, don't turn Freemius on.
89
+ */
90
+ private $_is_on;
91
+
92
+ /**
93
+ * @since 1.1.3
94
+ *
95
+ * @var bool If false, don't turn Freemius on.
96
+ */
97
+ private $_is_anonymous;
98
+
99
+ /**
100
+ * @since 1.0.9
101
+ * @var bool If false, issues with connectivity to Freemius API.
102
+ */
103
+ private $_has_api_connection;
104
+
105
+ /**
106
+ * @since 1.0.9
107
+ * @since 2.0.0 Default to true since we need the property during the instance construction, prior to the dynamic_init() execution.
108
+ * @var bool Hints the SDK if plugin can support anonymous mode (if skip connect is visible).
109
+ */
110
+ private $_enable_anonymous = true;
111
+
112
+ /**
113
+ * @since 1.1.7.5
114
+ * @var bool Hints the SDK if plugin should run in anonymous mode (only adds feedback form).
115
+ */
116
+ private $_anonymous_mode;
117
+
118
+ /**
119
+ * @since 1.1.9
120
+ * @var bool Hints the SDK if plugin have any free plans.
121
+ */
122
+ private $_is_premium_only;
123
+
124
+ /**
125
+ * @since 1.2.1.6
126
+ * @var bool Hints the SDK if plugin have premium code version at all.
127
+ */
128
+ private $_has_premium_version;
129
+
130
+ /**
131
+ * @since 1.2.1.6
132
+ * @var bool Hints the SDK if plugin should ignore pending mode by simulating a skip.
133
+ */
134
+ private $_ignore_pending_mode;
135
+
136
+ /**
137
+ * @since 1.0.8
138
+ * @var bool Hints the SDK if the plugin has any paid plans.
139
+ */
140
+ private $_has_paid_plans;
141
+
142
+ /**
143
+ * @since 1.2.1.5
144
+ * @var int Hints the SDK if the plugin offers a trial period. If negative, no trial, if zero - has a trial but
145
+ * without a specified period, if positive - the number of trial days.
146
+ */
147
+ private $_trial_days = - 1;
148
+
149
+ /**
150
+ * @since 1.2.1.5
151
+ * @var bool Hints the SDK if the trial requires a payment method or not.
152
+ */
153
+ private $_is_trial_require_payment = false;
154
+
155
+ /**
156
+ * @since 1.0.7
157
+ * @var bool Hints the SDK if the plugin is WordPress.org compliant.
158
+ */
159
+ private $_is_org_compliant;
160
+
161
+ /**
162
+ * @since 1.0.7
163
+ * @var bool Hints the SDK if the plugin is has add-ons.
164
+ */
165
+ private $_has_addons;
166
+
167
+ /**
168
+ * @since 2.4.5
169
+ * @var string Navigation type: 'menu' or 'tabs'.
170
+ */
171
+ private $_navigation;
172
+
173
+ const NAVIGATION_MENU = 'menu';
174
+ const NAVIGATION_TABS = 'tabs';
175
+
176
+ /**
177
+ * @since 1.1.6
178
+ * @var string[]bool.
179
+ */
180
+ private $_permissions;
181
+
182
+ /**
183
+ * @var FS_Storage
184
+ */
185
+ private $_storage;
186
+
187
+ /**
188
+ * @since 1.2.2.7
189
+ * @var FS_Cache_Manager
190
+ */
191
+ private $_cache;
192
+
193
+ /**
194
+ * @since 1.0.0
195
+ *
196
+ * @var FS_Logger
197
+ */
198
+ private $_logger;
199
+ /**
200
+ * @since 1.0.4
201
+ *
202
+ * @var FS_Plugin
203
+ */
204
+ private $_plugin = false;
205
+ /**
206
+ * @since 1.0.4
207
+ *
208
+ * @var FS_Plugin|false
209
+ */
210
+ private $_parent_plugin = false;
211
+ /**
212
+ * @since 1.1.1
213
+ *
214
+ * @var Freemius
215
+ */
216
+ private $_parent = false;
217
+ /**
218
+ * @since 1.0.1
219
+ *
220
+ * @var FS_User
221
+ */
222
+ private $_user = false;
223
+ /**
224
+ * @since 1.0.1
225
+ *
226
+ * @var FS_Site
227
+ */
228
+ private $_site = false;
229
+ /**
230
+ * @since 1.0.1
231
+ *
232
+ * @var FS_Plugin_License
233
+ */
234
+ private $_license;
235
+ /**
236
+ * @since 1.0.2
237
+ *
238
+ * @var FS_Plugin_Plan[]
239
+ */
240
+ private $_plans = false;
241
+ /**
242
+ * @var FS_Plugin_License[]
243
+ * @since 1.0.5
244
+ */
245
+ private $_licenses = false;
246
+
247
+ /**
248
+ * @since 1.0.1
249
+ *
250
+ * @var FS_Admin_Menu_Manager
251
+ */
252
+ private $_menu;
253
+
254
+ /**
255
+ * @var FS_Admin_Notices
256
+ */
257
+ private $_admin_notices;
258
+
259
+ /**
260
+ * @since 1.1.6
261
+ *
262
+ * @var FS_Admin_Notices
263
+ */
264
+ private static $_global_admin_notices;
265
+
266
+ /**
267
+ * @var FS_Logger
268
+ * @since 1.0.0
269
+ */
270
+ private static $_static_logger;
271
+
272
+ /**
273
+ * @var FS_Options
274
+ * @since 1.0.2
275
+ */
276
+ private static $_accounts;
277
+
278
+ /**
279
+ * @since 1.2.2
280
+ *
281
+ * @var number
282
+ */
283
+ private $_module_id;
284
+
285
+ /**
286
+ * @var Freemius[]
287
+ */
288
+ private static $_instances = array();
289
+
290
+ /**
291
+ * @since 1.2.3
292
+ *
293
+ * @var FS_Affiliate
294
+ */
295
+ private $affiliate = null;
296
+
297
+ /**
298
+ * @since 1.2.3
299
+ *
300
+ * @var FS_AffiliateTerms
301
+ */
302
+ private $plugin_affiliate_terms = null;
303
+
304
+ /**
305
+ * @since 1.2.3
306
+ *
307
+ * @var FS_AffiliateTerms
308
+ */
309
+ private $custom_affiliate_terms = null;
310
+
311
+ /**
312
+ * @since 2.0.0
313
+ *
314
+ * @var bool
315
+ */
316
+ private $_is_multisite_integrated;
317
+
318
+ /**
319
+ * @since 2.0.0
320
+ *
321
+ * @var bool True if the current request is for a network admin screen and the plugin is network active.
322
+ */
323
+ private $_is_network_active;
324
+
325
+ /**
326
+ * @since 2.0.0
327
+ *
328
+ * @var int|null The original blog ID the plugin was loaded with.
329
+ */
330
+ private $_blog_id = null;
331
+
332
+ /**
333
+ * @since 2.0.0
334
+ *
335
+ * @var int|null The current execution context. When true, run on network context. When int, run on the specified blog context.
336
+ */
337
+ private $_context_is_network_or_blog_id = null;
338
+
339
+ /**
340
+ * @since 2.0.0
341
+ *
342
+ * @var string
343
+ */
344
+ private $_dynamically_added_top_level_page_hook_name = '';
345
+
346
+ /**
347
+ * @author Leo Fajardo (@leorw)
348
+ * @since 2.3.1
349
+ *
350
+ * @var bool
351
+ */
352
+ private $is_whitelabeled;
353
+
354
+ #region Uninstall Reasons IDs
355
+
356
+ const REASON_NO_LONGER_NEEDED = 1;
357
+ const REASON_FOUND_A_BETTER_PLUGIN = 2;
358
+ const REASON_NEEDED_FOR_A_SHORT_PERIOD = 3;
359
+ const REASON_BROKE_MY_SITE = 4;
360
+ const REASON_SUDDENLY_STOPPED_WORKING = 5;
361
+ const REASON_CANT_PAY_ANYMORE = 6;
362
+ const REASON_OTHER = 7;
363
+ const REASON_DIDNT_WORK = 8;
364
+ const REASON_DONT_LIKE_TO_SHARE_MY_INFORMATION = 9;
365
+ const REASON_COULDNT_MAKE_IT_WORK = 10;
366
+ const REASON_GREAT_BUT_NEED_SPECIFIC_FEATURE = 11;
367
+ const REASON_NOT_WORKING = 12;
368
+ const REASON_NOT_WHAT_I_WAS_LOOKING_FOR = 13;
369
+ const REASON_DIDNT_WORK_AS_EXPECTED = 14;
370
+ const REASON_TEMPORARY_DEACTIVATION = 15;
371
+
372
+ #endregion
373
+
374
+ /* Ctor
375
+ ------------------------------------------------------------------------------------------------------------------*/
376
+
377
+ /**
378
+ * Main singleton instance.
379
+ *
380
+ * @author Vova Feldman (@svovaf)
381
+ * @since 1.0.0
382
+ *
383
+ * @param number $module_id
384
+ * @param string|bool $slug
385
+ * @param bool $is_init Since 1.2.1 Is initiation sequence.
386
+ */
387
+ private function __construct( $module_id, $slug = false, $is_init = false ) {
388
+ if ( $is_init && is_numeric( $module_id ) && is_string( $slug ) ) {
389
+ $this->store_id_slug_type_path_map( $module_id, $slug );
390
+ }
391
+
392
+ $this->_module_id = $module_id;
393
+ $this->_slug = $this->get_slug();
394
+ $this->_module_type = $this->get_module_type();
395
+
396
+ $this->_blog_id = is_multisite() ? get_current_blog_id() : null;
397
+
398
+ $this->_storage = FS_Storage::instance( $this->_module_type, $this->_slug );
399
+
400
+ $this->_cache = FS_Cache_Manager::get_manager( WP_FS___OPTION_PREFIX . "cache_{$module_id}" );
401
+
402
+ $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $this->get_unique_affix(), WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
403
+
404
+ $this->_plugin_main_file_path = $this->_find_caller_plugin_file( $is_init );
405
+ $this->_plugin_dir_path = plugin_dir_path( $this->_plugin_main_file_path );
406
+ $this->_plugin_basename = $this->get_plugin_basename();
407
+ $this->_free_plugin_basename = str_replace( '-premium/', '/', $this->_plugin_basename );
408
+
409
+ $this->_is_multisite_integrated = (
410
+ defined( "WP_FS__PRODUCT_{$module_id}_MULTISITE" ) &&
411
+ ( true === constant( "WP_FS__PRODUCT_{$module_id}_MULTISITE" ) )
412
+ );
413
+
414
+ $this->_is_network_active = (
415
+ is_multisite() &&
416
+ $this->_is_multisite_integrated &&
417
+ // Themes are always network activated, but the ACTUAL activation is per site.
418
+ $this->is_plugin() &&
419
+ (
420
+ is_plugin_active_for_network( $this->_plugin_basename ) ||
421
+ // Plugin network level activation or uninstall.
422
+ ( fs_is_network_admin() && is_plugin_inactive( $this->_plugin_basename ) )
423
+ )
424
+ );
425
+
426
+ $this->_storage->set_network_active(
427
+ $this->_is_network_active,
428
+ $this->is_delegated_connection()
429
+ );
430
+
431
+ if ( ! isset( $this->_storage->is_network_activated ) ) {
432
+ $this->_storage->is_network_activated = $this->_is_network_active;
433
+ }
434
+
435
+ if ( $this->_storage->is_network_activated != $this->_is_network_active ) {
436
+ // Update last activation level.
437
+ $this->_storage->is_network_activated = $this->_is_network_active;
438
+
439
+ $this->maybe_adjust_storage();
440
+ }
441
+
442
+ #region Migration
443
+
444
+ if ( is_multisite() ) {
445
+ /**
446
+ * If the install_timestamp exists on the site level but doesn't exist on the
447
+ * network level storage, it means that we need to process the storage with migration.
448
+ *
449
+ * The code in this `if` scope will only be executed once and only for the first site that will execute it because once we migrate the storage data, install_timestamp will be already set in the network level storage.
450
+ *
451
+ * @author Vova Feldman (@svovaf)
452
+ * @since 2.0.0
453
+ */
454
+ if ( false === $this->_storage->get( 'install_timestamp', false, true ) &&
455
+ false !== $this->_storage->get( 'install_timestamp', false, false )
456
+ ) {
457
+ // Initiate storage migration.
458
+ $this->_storage->migrate_to_network();
459
+
460
+ // Migrate module cache to network level storage.
461
+ $this->_cache->migrate_to_network();
462
+ }
463
+ }
464
+
465
+ #endregion
466
+
467
+ $base_name_split = explode( '/', $this->_plugin_basename );
468
+ $this->_plugin_dir_name = $base_name_split[0];
469
+
470
+ if ( $this->_logger->is_on() ) {
471
+ $this->_logger->info( 'plugin_main_file_path = ' . $this->_plugin_main_file_path );
472
+ $this->_logger->info( 'plugin_dir_path = ' . $this->_plugin_dir_path );
473
+ $this->_logger->info( 'plugin_basename = ' . $this->_plugin_basename );
474
+ $this->_logger->info( 'free_plugin_basename = ' . $this->_free_plugin_basename );
475
+ $this->_logger->info( 'plugin_dir_name = ' . $this->_plugin_dir_name );
476
+ }
477
+
478
+ // Remember link between file to slug.
479
+ $this->store_file_slug_map();
480
+
481
+ // Store plugin's initial install timestamp.
482
+ if ( ! isset( $this->_storage->install_timestamp ) ) {
483
+ $this->_storage->install_timestamp = WP_FS__SCRIPT_START_TIME;
484
+ }
485
+
486
+ if ( ! is_object( $this->_plugin ) ) {
487
+ $this->_plugin = FS_Plugin_Manager::instance( $this->_module_id )->get();
488
+ }
489
+
490
+ $this->_admin_notices = FS_Admin_Notices::instance(
491
+ $this->_slug . ( $this->is_theme() ? ':theme' : '' ),
492
+ /**
493
+ * Ensure that the admin notice will always have a title by using the stored plugin title if available and
494
+ * retrieving the title via the "get_plugin_name" method if there is no stored plugin title available.
495
+ *
496
+ * @author Leo Fajardo (@leorw)
497
+ * @since 1.2.2
498
+ */
499
+ ( is_object( $this->_plugin ) ? $this->_plugin->title : $this->get_plugin_name() ),
500
+ $this->get_unique_affix()
501
+ );
502
+
503
+ if ( 'true' === fs_request_get( 'fs_clear_api_cache' ) ||
504
+ fs_request_is_action( 'restart_freemius' )
505
+ ) {
506
+ FS_Api::clear_cache();
507
+ $this->_cache->clear();
508
+ }
509
+
510
+ $this->register_constructor_hooks();
511
+
512
+ /**
513
+ * Starting from version 2.0.0, `FS_Site` entities no longer have the `plan` property and have `plan_id`
514
+ * instead. This should be called before calling `_load_account()`, otherwise, `$this->_site` will not be
515
+ * loaded in `_load_account` for versions of SDK starting from 2.0.0.
516
+ *
517
+ * @author Leo Fajardo (@leorw)
518
+ */
519
+ self::migrate_install_plan_to_plan_id( $this->_storage );
520
+
521
+ $this->_load_account();
522
+
523
+ $this->_version_updates_handler();
524
+ }
525
+
526
+ /**
527
+ * @author Leo Fajardo (@leorw)
528
+ * @since 2.3.0
529
+ */
530
+ private function maybe_adjust_storage() {
531
+ $install_timestamp = null;
532
+ $prev_is_premium = null;
533
+
534
+ $options_to_update = array();
535
+
536
+ $is_network_admin = fs_is_network_admin();
537
+
538
+ $network_install_timestamp = $this->_storage->get( 'install_timestamp', null, true );
539
+
540
+ if ( ! $is_network_admin ) {
541
+ if ( is_null( $network_install_timestamp ) ) {
542
+ // Plugin was not network-activated before.
543
+ return;
544
+ }
545
+
546
+ if ( is_null( $this->_storage->get( 'install_timestamp', null, false ) ) ) {
547
+ // Set the `install_timestamp` only if it's not yet set.
548
+ $install_timestamp = $network_install_timestamp;
549
+ }
550
+
551
+ $prev_is_premium = $this->_storage->get( 'prev_is_premium', null, true );
552
+ } else {
553
+ $current_wp_user = self::_get_current_wp_user();
554
+ $current_fs_user = self::_get_user_by_email( $current_wp_user->user_email );
555
+ $network_user_info = array();
556
+
557
+ $skips_count = 0;
558
+
559
+ $sites = self::get_sites();
560
+ $sites_count = count( $sites );
561
+
562
+ $blog_id_2_install_map = array();
563
+
564
+ $is_first_non_ignored_blog = true;
565
+
566
+ foreach ( $sites as $site ) {
567
+ $blog_id = self::get_site_blog_id( $site );
568
+
569
+ $blog_install_timestamp = $this->_storage->get( 'install_timestamp', null, $blog_id );
570
+
571
+ if ( is_null( $blog_install_timestamp ) ) {
572
+ // Plugin has not been installed on this blog.
573
+ continue;
574
+ }
575
+
576
+ $is_earlier_install = (
577
+ ! is_null( $install_timestamp ) &&
578
+ $blog_install_timestamp < $install_timestamp
579
+ );
580
+
581
+ $install = $this->get_install_by_blog_id( $blog_id );
582
+
583
+ $update_network_user_info = false;
584
+
585
+ if ( ! is_object( $install ) ) {
586
+ if ( ! $this->_storage->get( 'is_anonymous', false, $blog_id ) ) {
587
+ // The opt-in decision (whether to skip or opt in) is yet to be made.
588
+ continue;
589
+ }
590
+
591
+ $skips_count ++;
592
+ } else {
593
+ $blog_id_2_install_map[ $blog_id ] = $install;
594
+
595
+ if ( empty( $network_user_info ) ) {
596
+ // Set the network user info for the 1st time. Choose any user information whether or not it is for the current WP user.
597
+ $update_network_user_info = true;
598
+ }
599
+
600
+ if ( ! $update_network_user_info &&
601
+ is_object( $current_fs_user ) &&
602
+ $network_user_info['user_id'] != $current_fs_user->id &&
603
+ $install->user_id == $current_fs_user->id
604
+ ) {
605
+ // If an install that is owned by the current WP user is found, use its user information instead.
606
+ $update_network_user_info = true;
607
+ }
608
+
609
+ if ( ! $update_network_user_info &&
610
+ $is_earlier_install &&
611
+ ( ! is_object( $current_fs_user ) || $current_fs_user->id == $install->user_id )
612
+ ) {
613
+ // Update to the earliest install info if there's no install found so far that is owned by the current WP user; OR only if the found install is owned by the current WP user.
614
+ $update_network_user_info = true;
615
+ }
616
+ }
617
+
618
+ if ( $update_network_user_info ) {
619
+ $network_user_info = array(
620
+ 'user_id' => $install->user_id,
621
+ 'blog_id' => $blog_id
622
+ );
623
+ }
624
+
625
+ $site_prev_is_premium = $this->_storage->get( 'prev_is_premium', null, $blog_id );
626
+
627
+ if ( $is_first_non_ignored_blog ) {
628
+ $prev_is_premium = $site_prev_is_premium;
629
+
630
+ if ( is_null( $network_install_timestamp ) ) {
631
+ $install_timestamp = $blog_install_timestamp;
632
+ }
633
+
634
+ $is_first_non_ignored_blog = false;
635
+
636
+ continue;
637
+ }
638
+
639
+ if ( ! is_null( $prev_is_premium ) && $prev_is_premium !== $site_prev_is_premium ) {
640
+ // If a different `$site_prev_is_premium` value is found, do not include the option in the collection of options to update.
641
+ $prev_is_premium = null;
642
+ }
643
+
644
+ if ( $is_earlier_install ) {
645
+ // If an earlier install timestamp is found.
646
+ $install_timestamp = $blog_install_timestamp;
647
+ }
648
+ }
649
+
650
+ $installs_count = count( $blog_id_2_install_map );
651
+
652
+ if ( $sites_count === ( $installs_count + $skips_count ) ) {
653
+ if ( ! empty( $network_user_info ) ) {
654
+ $options_to_update['network_user_id'] = $network_user_info['user_id'];
655
+ $options_to_update['network_install_blog_id'] = $network_user_info['blog_id'];
656
+
657
+ foreach ( $blog_id_2_install_map as $blog_id => $install ) {
658
+ if ( $install->user_id == $network_user_info['user_id'] ) {
659
+ continue;
660
+ }
661
+
662
+ $this->_storage->store( 'is_delegated_connection', true, $blog_id );
663
+ }
664
+ }
665
+
666
+ if ( $sites_count === $skips_count ) {
667
+ /**
668
+ * Assume network-level skipping as the intended action if all actions identified were only
669
+ * skipping of the connection (i.e., no opt-ins and delegated connections so far).
670
+ */
671
+ $options_to_update['is_anonymous_ms'] = true;
672
+ } else if ( $sites_count === $installs_count ) {
673
+ /**
674
+ * Assume network-level opt-in as the intended action if all actions identified were only opt-ins
675
+ * (i.e., no delegation and skipping of the connections so far).
676
+ */
677
+ $options_to_update['is_network_connected'] = true;
678
+ }
679
+ }
680
+ }
681
+
682
+ if ( ! is_null( $install_timestamp ) ) {
683
+ $options_to_update['install_timestamp'] = $install_timestamp;
684
+ }
685
+
686
+ if ( ! is_null( $prev_is_premium ) ) {
687
+ $options_to_update['prev_is_premium'] = $prev_is_premium;
688
+ }
689
+
690
+ if ( ! empty( $options_to_update ) ) {
691
+ $this->adjust_storage( $options_to_update, $is_network_admin );
692
+ }
693
+ }
694
+
695
+ /**
696
+ * @author Leo Fajardo (@leorw)
697
+ * @since 2.3.0
698
+ *
699
+ * @param array $options
700
+ * @param bool $is_network_admin
701
+ */
702
+ private function adjust_storage( $options, $is_network_admin ) {
703
+ foreach ( $options as $name => $value ) {
704
+ $this->_storage->store( $name, $value, $is_network_admin ? true : null );
705
+ }
706
+ }
707
+
708
+ /**
709
+ * Checks whether this module has a settings menu.
710
+ *
711
+ * @author Leo Fajardo (@leorw)
712
+ * @since 1.2.2
713
+ *
714
+ * @return bool
715
+ */
716
+ function has_settings_menu() {
717
+ return ( $this->_is_network_active && fs_is_network_admin() ) ?
718
+ $this->_menu->has_network_menu() :
719
+ $this->_menu->has_menu();
720
+ }
721
+
722
+ /**
723
+ * If `true` the opt-in should be shown as a modal dialog box on the themes.php page. WordPress.org themes guidelines prohibit from redirecting the user from the themes.php page after activating a theme.
724
+ *
725
+ * @author Vova Feldman (@svovaf)
726
+ * @since 2.4.5
727
+ *
728
+ * @return bool
729
+ */
730
+ function show_opt_in_on_themes_page() {
731
+ if ( ! $this->is_free_wp_org_theme() ) {
732
+ return false;
733
+ }
734
+
735
+ if ( ! $this->has_settings_menu() ) {
736
+ return true;
737
+ }
738
+
739
+ return $this->show_settings_with_tabs();
740
+ }
741
+
742
+ /**
743
+ * If `true` the opt-in should be shown on the product's main setting page.
744
+ *
745
+ * @author Vova Feldman (@svovaf)
746
+ * @since 2.4.5
747
+ *
748
+ * @return bool
749
+ *
750
+ * @uses show_opt_in_on_themes_page();
751
+ */
752
+ function show_opt_in_on_setting_page() {
753
+ return ! $this->show_opt_in_on_themes_page();
754
+ }
755
+
756
+ /**
757
+ * If `true` the settings should be shown using tabs.
758
+ *
759
+ * @author Vova Feldman (@svovaf)
760
+ * @since 2.4.5
761
+ *
762
+ * @return bool
763
+ */
764
+ function show_settings_with_tabs() {
765
+ return ( self::NAVIGATION_TABS === $this->_navigation );
766
+ }
767
+
768
+ /**
769
+ * Check if the context module is free wp.org theme.
770
+ *
771
+ * This method is helpful because:
772
+ * 1. wp.org themes are limited to a single submenu item,
773
+ * and sub-submenu items are most likely not allowed (never verified).
774
+ * 2. wp.org themes are not allowed to redirect the user
775
+ * after the theme activation, therefore, the agreed UX
776
+ * is showing the opt-in as a modal dialog box after
777
+ * activation (approved by @otto42, @emiluzelac, @greenshady, @grapplerulrich).
778
+ *
779
+ * @author Vova Feldman (@svovaf)
780
+ * @since 1.2.2.7
781
+ *
782
+ * @return bool
783
+ */
784
+ function is_free_wp_org_theme() {
785
+ return (
786
+ $this->is_theme() &&
787
+ $this->is_org_repo_compliant() &&
788
+ ! $this->is_premium()
789
+ );
790
+ }
791
+
792
+ /**
793
+ * Checks whether this a submenu item is visible.
794
+ *
795
+ * @author Vova Feldman (@svovaf)
796
+ * @since 1.2.2.6
797
+ * @since 1.2.2.7 Even if the menu item was specified to be hidden, when it is the context page, then show the submenu item so the user will have the right context page.
798
+ *
799
+ * @param string $slug
800
+ * @param bool $is_tabs_visibility_check This is used to decide if the associated tab should be shown or hidden.
801
+ *
802
+ * @return bool
803
+ */
804
+ function is_submenu_item_visible( $slug, $is_tabs_visibility_check = false ) {
805
+ if ( $this->is_admin_page( $slug ) ) {
806
+ /**
807
+ * It is the current context page, so show the submenu item
808
+ * so the user will have the right context page, even if it
809
+ * was set to hidden.
810
+ */
811
+ return true;
812
+ }
813
+
814
+ if ( ! $this->has_settings_menu() ) {
815
+ // No menu settings at all.
816
+ return false;
817
+ }
818
+
819
+ if ( ! $is_tabs_visibility_check && $this->show_settings_with_tabs() ) {
820
+ /**
821
+ * wp.org themes are limited to a single submenu item, and
822
+ * sub-submenu items are most likely not allowed (never verified).
823
+ */
824
+ return false;
825
+ }
826
+
827
+ return $this->_menu->is_submenu_item_visible( $slug );
828
+ }
829
+
830
+ /**
831
+ * Check if a Freemius page should be accessible via the UI.
832
+ *
833
+ * @author Vova Feldman (@svovaf)
834
+ * @since 1.2.2.7
835
+ *
836
+ * @param string $slug
837
+ *
838
+ * @return bool
839
+ */
840
+ function is_page_visible( $slug ) {
841
+ if ( $this->is_admin_page( $slug ) ) {
842
+ return true;
843
+ }
844
+
845
+ return $this->_menu->is_submenu_item_visible( $slug, true, true );
846
+ }
847
+
848
+ /**
849
+ * @author Vova Feldman (@svovaf)
850
+ * @since 1.0.9
851
+ */
852
+ private function _version_updates_handler() {
853
+ if ( ! isset( $this->_storage->sdk_version ) || $this->_storage->sdk_version != $this->version ) {
854
+ // Freemius version upgrade mode.
855
+ $this->_storage->sdk_last_version = $this->_storage->sdk_version;
856
+ $this->_storage->sdk_version = $this->version;
857
+
858
+ if ( empty( $this->_storage->sdk_last_version ) ||
859
+ version_compare( $this->_storage->sdk_last_version, $this->version, '<' )
860
+ ) {
861
+ $this->_storage->sdk_upgrade_mode = true;
862
+ $this->_storage->sdk_downgrade_mode = false;
863
+ } else {
864
+ $this->_storage->sdk_downgrade_mode = true;
865
+ $this->_storage->sdk_upgrade_mode = false;
866
+
867
+ }
868
+
869
+ $this->do_action( 'sdk_version_update', $this->_storage->sdk_last_version, $this->version );
870
+ }
871
+
872
+ $plugin_version = $this->get_plugin_version();
873
+ if ( ! isset( $this->_storage->plugin_version ) || $this->_storage->plugin_version != $plugin_version ) {
874
+ // Plugin version upgrade mode.
875
+ $this->_storage->plugin_last_version = $this->_storage->plugin_version;
876
+ $this->_storage->plugin_version = $plugin_version;
877
+
878
+ if ( empty( $this->_storage->plugin_last_version ) ||
879
+ version_compare( $this->_storage->plugin_last_version, $plugin_version, '<' )
880
+ ) {
881
+ $this->_storage->plugin_upgrade_mode = true;
882
+ $this->_storage->plugin_downgrade_mode = false;
883
+ } else {
884
+ $this->_storage->plugin_downgrade_mode = true;
885
+ $this->_storage->plugin_upgrade_mode = false;
886
+ }
887
+
888
+ if ( ! empty( $this->_storage->plugin_last_version ) ) {
889
+ // Different version of the plugin was installed before, therefore it's an update.
890
+ $this->_storage->is_plugin_new_install = false;
891
+ }
892
+
893
+ $this->do_action( 'plugin_version_update', $this->_storage->plugin_last_version, $plugin_version );
894
+ }
895
+ }
896
+
897
+ #--------------------------------------------------------------------------------
898
+ #region Data Migration on SDK Update
899
+ #--------------------------------------------------------------------------------
900
+
901
+ /**
902
+ * @author Vova Feldman (@svovaf)
903
+ * @since 1.1.5
904
+ *
905
+ * @param string $sdk_prev_version
906
+ * @param string $sdk_version
907
+ */
908
+ function _sdk_version_update( $sdk_prev_version, $sdk_version ) {
909
+ /**
910
+ * @since 1.1.7.3 Fixed unwanted connectivity test cleanup.
911
+ */
912
+ if ( empty( $sdk_prev_version ) ) {
913
+ return;
914
+ }
915
+
916
+ if ( version_compare( $sdk_prev_version, '2.1.0', '<' ) &&
917
+ version_compare( $sdk_version, '2.1.0', '>=' )
918
+ ) {
919
+ $this->_storage->handle_gdpr_admin_notice = true;
920
+ }
921
+
922
+ if ( version_compare( $sdk_prev_version, '2.0.0', '<' ) &&
923
+ version_compare( $sdk_version, '2.0.0', '>=' )
924
+ ) {
925
+ $this->migrate_to_subscriptions_collection();
926
+
927
+ $this->consolidate_licenses();
928
+
929
+ // Clear trial_plan since it's now loaded from the plans collection when needed.
930
+ $this->_storage->remove( 'trial_plan', true, false );
931
+ }
932
+
933
+ if ( version_compare( $sdk_prev_version, '1.2.3', '<' ) &&
934
+ version_compare( $sdk_version, '1.2.3', '>=' )
935
+ ) {
936
+ /**
937
+ * Starting from version 1.2.3, paths are stored as relative instead of absolute and some of them can be
938
+ * invalid.
939
+ *
940
+ * @author Leo Fajardo (@leorw)
941
+ */
942
+ $this->remove_invalid_paths();
943
+ }
944
+
945
+ if ( version_compare( $sdk_prev_version, '1.1.5', '<' ) &&
946
+ version_compare( $sdk_version, '1.1.5', '>=' )
947
+ ) {
948
+ // On version 1.1.5 merged connectivity and is_on data.
949
+ if ( isset( $this->_storage->connectivity_test ) ) {
950
+ if ( ! isset( $this->_storage->is_on ) ) {
951
+ unset( $this->_storage->connectivity_test );
952
+ } else {
953
+ $connectivity_data = $this->_storage->connectivity_test;
954
+ $connectivity_data['is_active'] = $this->_storage->is_on['is_active'];
955
+ $connectivity_data['timestamp'] = $this->_storage->is_on['timestamp'];
956
+
957
+ // Override.
958
+ $this->_storage->connectivity_test = $connectivity_data;
959
+
960
+ // Remove previous structure.
961
+ unset( $this->_storage->is_on );
962
+ }
963
+
964
+ }
965
+ }
966
+
967
+ if (
968
+ version_compare( $sdk_prev_version, '2.2.1', '<' ) &&
969
+ version_compare( $sdk_version, '2.2.1', '>=' )
970
+ ) {
971
+ /**
972
+ * Clear the file cache without storing the previous path since it could be a wrong path. For example,
973
+ * in the versions of the SDK lower than 2.2.1, it's possible for the path of an add-on to be the same
974
+ * as the parent plugin's when the add-on was auto-installed since the relevant method names were not
975
+ * skipped in the logic that determines the right path in the `get_caller_main_file_and_type` method
976
+ * (e.g. `try_activate_plugin`). Since it was an auto-installation, the caller was the parent plugin
977
+ * and so its path was used. In case the stored path is wrong, clearing the cache will resolve issues
978
+ * related to data mix-up between plugins (e.g. titles and versions of an add-on and its parent plugin).
979
+ *
980
+ * @author Leo Fajardo (@leorw)
981
+ * @since 2.2.1
982
+ */
983
+ $this->clear_module_main_file_cache( false );
984
+ }
985
+ }
986
+
987
+ /**
988
+ * @author Leo Fajardo (@leorw)
989
+ * @since 2.0.0
990
+ *
991
+ * @param \FS_Storage $storage
992
+ * @param bool|int|null $blog_id
993
+ */
994
+ private static function migrate_install_plan_to_plan_id( FS_Storage $storage, $blog_id = null ) {
995
+ if ( empty( $storage->sdk_version ) ) {
996
+ // New installation of the plugin, no need to upgrade.
997
+ return;
998
+ }
999
+
1000
+ if ( ! version_compare( $storage->sdk_version, '2.0.0', '<' ) ) {
1001
+ // Previous version is >= 2.0.0, so no need to migrate.
1002
+ return;
1003
+ }
1004
+
1005
+ // Alias.
1006
+ $module_type = $storage->get_module_type();
1007
+ $module_slug = $storage->get_module_slug();
1008
+
1009
+ $installs = self::get_all_sites( $module_type, $blog_id );
1010
+ $install = isset( $installs[ $module_slug ] ) ? $installs[ $module_slug ] : null;
1011
+
1012
+ if ( ! is_object( $install ) ) {
1013
+ return;
1014
+ }
1015
+
1016
+ if ( isset( $install->plan ) && is_object( $install->plan ) ) {
1017
+ if ( isset( $install->plan->id ) && ! empty( $install->plan->id ) ) {
1018
+ $install->plan_id = self::_decrypt( $install->plan->id );
1019
+ }
1020
+
1021
+ unset( $install->plan );
1022
+
1023
+ $installs[ $module_slug ] = clone $install;
1024
+
1025
+ self::set_account_option_by_module(
1026
+ $module_type,
1027
+ 'sites',
1028
+ $installs,
1029
+ true,
1030
+ $blog_id
1031
+ );
1032
+ }
1033
+ }
1034
+
1035
+ /**
1036
+ * @author Leo Fajardo (@leorw)
1037
+ * @since 2.0.0
1038
+ */
1039
+ private function migrate_to_subscriptions_collection() {
1040
+ if ( ! is_object( $this->_site ) ) {
1041
+ return;
1042
+ }
1043
+
1044
+ if ( isset( $this->_storage->subscription ) && is_object( $this->_storage->subscription ) ) {
1045
+ $this->_storage->subscriptions = array( fs_get_entity( $this->_storage->subscription, FS_Subscription::get_class_name() ) );
1046
+ }
1047
+ }
1048
+
1049
+ /**
1050
+ * @author Leo Fajardo (@leorw)
1051
+ * @since 2.0.0
1052
+ */
1053
+ private function consolidate_licenses() {
1054
+ $plugin_licenses = self::get_account_option( 'licenses', WP_FS__MODULE_TYPE_PLUGIN );
1055
+ if ( isset( $plugin_licenses[ $this->_slug ] ) ) {
1056
+ $plugin_licenses = $plugin_licenses[ $this->_slug ];
1057
+ } else {
1058
+ $plugin_licenses = array();
1059
+ }
1060
+
1061
+ $theme_licenses = self::get_account_option( 'licenses', WP_FS__MODULE_TYPE_THEME );
1062
+ if ( isset( $theme_licenses[ $this->_slug ] ) ) {
1063
+ $theme_licenses = $theme_licenses[ $this->_slug ];
1064
+ } else {
1065
+ $theme_licenses = array();
1066
+ }
1067
+
1068
+ if ( empty( $plugin_licenses ) && empty( $theme_licenses ) ) {
1069
+ return;
1070
+ }
1071
+
1072
+ $all_licenses = array();
1073
+ $user_id_license_ids_map = array();
1074
+
1075
+ foreach ( $plugin_licenses as $user_id => $user_licenses ) {
1076
+ if ( is_array( $user_licenses ) ) {
1077
+ if ( ! isset( $user_license_ids[ $user_id ] ) ) {
1078
+ $user_id_license_ids_map[ $user_id ] = array();
1079
+ }
1080
+
1081
+ foreach ( $user_licenses as $user_license ) {
1082
+ $all_licenses[] = $user_license;
1083
+ $user_id_license_ids_map[ $user_id ][] = $user_license->id;
1084
+ }
1085
+ }
1086
+ }
1087
+
1088
+ foreach ( $theme_licenses as $user_id => $user_licenses ) {
1089
+ if ( is_array( $user_licenses ) ) {
1090
+ if ( ! isset( $user_license_ids[ $user_id ] ) ) {
1091
+ $user_id_license_ids_map[ $user_id ] = array();
1092
+ }
1093
+
1094
+ foreach ( $user_licenses as $user_license ) {
1095
+ $all_licenses[] = $user_license;
1096
+ $user_id_license_ids_map[ $user_id ][] = $user_license->id;
1097
+ }
1098
+ }
1099
+ }
1100
+
1101
+ self::store_user_id_license_ids_map(
1102
+ $user_id_license_ids_map,
1103
+ $this->_module_id
1104
+ );
1105
+
1106
+ $this->_store_licenses( true, $this->_module_id, $all_licenses );
1107
+ }
1108
+
1109
+ /**
1110
+ * Remove invalid paths.
1111
+ *
1112
+ * @author Leo Fajardo (@leorw)
1113
+ * @since 1.2.3
1114
+ */
1115
+ private function remove_invalid_paths() {
1116
+ // Remove invalid path that is still associated with the current slug if there's any.
1117
+ $file_slug_map = self::$_accounts->get_option( 'file_slug_map', array() );
1118
+ foreach ( $file_slug_map as $plugin_basename => $slug ) {
1119
+ if ( $slug === $this->_slug &&
1120
+ $plugin_basename !== $this->_plugin_basename &&
1121
+ ! file_exists( $this->get_absolute_path( $plugin_basename ) )
1122
+ ) {
1123
+ unset( $file_slug_map[ $plugin_basename ] );
1124
+ self::$_accounts->set_option( 'file_slug_map', $file_slug_map, true );
1125
+
1126
+ break;
1127
+ }
1128
+ }
1129
+ }
1130
+
1131
+ /**
1132
+ * @author Vova Feldman (@svovaf)
1133
+ * @since 1.2.2.7
1134
+ *
1135
+ * @param string $plugin_prev_version
1136
+ * @param string $plugin_version
1137
+ */
1138
+ function _after_version_update( $plugin_prev_version, $plugin_version ) {
1139
+ if ( $this->is_theme() ) {
1140
+ // Expire the cache of the previous tabs since the theme may
1141
+ // have setting updates.
1142
+ $this->_cache->expire( 'tabs' );
1143
+ $this->_cache->expire( 'tabs_stylesheets' );
1144
+ }
1145
+ }
1146
+
1147
+ /**
1148
+ * A special migration logic for the $_accounts, executed for all the plugins in the system:
1149
+ * - Moves some data to the network level storage.
1150
+ * - If the plugin's connection was skipped for all sites, set the plugin as if it was network skipped.
1151
+ * - If the plugin's connection was ignored for all sites, don't do anything in terms of the network connection.
1152
+ * - If the plugin was connected to all sites by the same super-admin, set the plugin as if was network opted-in for all sites.
1153
+ * - If there's at least one site that was connected by a super-admin, find the "main super-admin" (the one that installed the majority of the plugin installs) and set the plugin as if was network activated with the main super-admin, set all the sites that were skipped or opted-in with a different user to delegated mode. Then, prompt the currently logged super-admin to choose what to do with the ignored sites.
1154
+ * - If there are any sites in the network which the connection decision was not yet taken for, set this plugin into network activation mode so a super-admin can choose what to do with the rest of the sites.
1155
+ *
1156
+ * @author Vova Feldman (@svovaf)
1157
+ * @since 2.0.0
1158
+ */
1159
+ private static function migrate_accounts_to_network() {
1160
+ $sites = self::get_sites();
1161
+ $sites_count = count( $sites );
1162
+ $connection_status = array();
1163
+ $plugin_slugs = array();
1164
+ foreach ( $sites as $site ) {
1165
+ $blog_id = self::get_site_blog_id( $site );
1166
+
1167
+ self::$_accounts->migrate_to_network( $blog_id );
1168
+
1169
+ /**
1170
+ * Build a list of all Freemius powered plugins slugs.
1171
+ */
1172
+ $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array(), $blog_id );
1173
+ foreach ( $id_slug_type_path_map as $module_id => $data ) {
1174
+ if ( WP_FS__MODULE_TYPE_PLUGIN === $data['type'] ) {
1175
+ $plugin_slugs[ $data['slug'] ] = true;
1176
+ }
1177
+ }
1178
+
1179
+ $installs = self::get_account_option( 'sites', WP_FS__MODULE_TYPE_PLUGIN, $blog_id );
1180
+
1181
+ if ( is_array( $installs ) ) {
1182
+ foreach ( $installs as $slug => $install ) {
1183
+ if ( ! isset( $connection_status[ $slug ] ) ) {
1184
+ $connection_status[ $slug ] = array();
1185
+ }
1186
+
1187
+ if ( is_object( $install ) &&
1188
+ FS_Site::is_valid_id( $install->id ) &&
1189
+ FS_User::is_valid_id( $install->user_id )
1190
+ ) {
1191
+ $connection_status[ $slug ][ $blog_id ] = $install->user_id;
1192
+ }
1193
+ }
1194
+ }
1195
+ }
1196
+
1197
+ foreach ( $plugin_slugs as $slug => $true ) {
1198
+ if ( ! isset( $connection_status[ $slug ] ) ) {
1199
+ $connection_status[ $slug ] = array();
1200
+ }
1201
+
1202
+ foreach ( $sites as $site ) {
1203
+ $blog_id = self::get_site_blog_id( $site );
1204
+
1205
+ if ( isset( $connection_status[ $slug ][ $blog_id ] ) ) {
1206
+ continue;
1207
+ }
1208
+
1209
+ $storage = FS_Storage::instance( WP_FS__MODULE_TYPE_PLUGIN, $slug );
1210
+
1211
+ $is_anonymous = $storage->get( 'is_anonymous', null, $blog_id );
1212
+
1213
+ if ( ! is_null( $is_anonymous ) ) {
1214
+ // Since 1.1.3 is_anonymous is an array.
1215
+ if ( is_array( $is_anonymous ) && isset( $is_anonymous['is'] ) ) {
1216
+ $is_anonymous = $is_anonymous['is'];
1217
+ }
1218
+
1219
+ if ( is_bool( $is_anonymous ) && true === $is_anonymous ) {
1220
+ $connection_status[ $slug ][ $blog_id ] = 'skipped';
1221
+ }
1222
+ }
1223
+
1224
+ if ( ! isset( $connection_status[ $slug ][ $blog_id ] ) ) {
1225
+ $connection_status[ $slug ][ $blog_id ] = 'ignored';
1226
+ }
1227
+ }
1228
+ }
1229
+
1230
+ $super_admins = array();
1231
+
1232
+ foreach ( $connection_status as $slug => $blogs_status ) {
1233
+ $skips = 0;
1234
+ $ignores = 0;
1235
+ $connections = 0;
1236
+ $opted_in_users = array();
1237
+ $opted_in_super_admins = array();
1238
+
1239
+ $storage = FS_Storage::instance( WP_FS__MODULE_TYPE_PLUGIN, $slug );
1240
+
1241
+ foreach ( $blogs_status as $blog_id => $status_or_user_id ) {
1242
+ if ( 'skipped' === $status_or_user_id ) {
1243
+ $skips ++;
1244
+ } else if ( 'ignored' === $status_or_user_id ) {
1245
+ $ignores ++;
1246
+ } else if ( FS_User::is_valid_id( $status_or_user_id ) ) {
1247
+ $connections ++;
1248
+
1249
+ if ( ! isset( $opted_in_users[ $status_or_user_id ] ) ) {
1250
+ $opted_in_users[ $status_or_user_id ] = array();
1251
+ }
1252
+
1253
+ $opted_in_users[ $status_or_user_id ][] = $blog_id;
1254
+
1255
+ if ( isset( $super_admins[ $status_or_user_id ] ) ||
1256
+ self::is_super_admin( $status_or_user_id )
1257
+ ) {
1258
+ // Cache super-admin data.
1259
+ $super_admins[ $status_or_user_id ] = true;
1260
+
1261
+ // Remember opted-in super-admins for the plugin.
1262
+ $opted_in_super_admins[ $status_or_user_id ] = true;
1263
+ }
1264
+ }
1265
+ }
1266
+
1267
+ $main_super_admin_user_id = null;
1268
+ $all_migrated = false;
1269
+ if ( $sites_count == $skips ) {
1270
+ // All sites were skipped -> network skip by copying the anonymous mode from any of the sites.
1271
+ $storage->is_anonymous_ms = $storage->is_anonymous;
1272
+
1273
+ $all_migrated = true;
1274
+ } else if ( $sites_count == $ignores ) {
1275
+ // Don't do anything, still in activation mode.
1276
+
1277
+ $all_migrated = true;
1278
+ } else if ( 0 < count( $opted_in_super_admins ) ) {
1279
+ // Find the super-admin with the majority of installs.
1280
+ $max_installs_by_super_admin = 0;
1281
+ foreach ( $opted_in_super_admins as $user_id => $true ) {
1282
+ $installs_count = count( $opted_in_users[ $user_id ] );
1283
+
1284
+ if ( $installs_count > $max_installs_by_super_admin ) {
1285
+ $max_installs_by_super_admin = $installs_count;
1286
+ $main_super_admin_user_id = $user_id;
1287
+ }
1288
+ }
1289
+
1290
+ if ( $sites_count == $connections && 1 == count( $opted_in_super_admins ) ) {
1291
+ // Super-admin opted-in for all sites in the network.
1292
+ $storage->is_network_connected = true;
1293
+
1294
+ $all_migrated = true;
1295
+ }
1296
+
1297
+ // Store network user.
1298
+ $storage->network_user_id = $main_super_admin_user_id;
1299
+
1300
+ $storage->network_install_blog_id = ( $sites_count == $connections ) ?
1301
+ // Since all sites are opted-in, associating with the main site.
1302
+ get_current_blog_id() :
1303
+ // Associating with the 1st found opted-in site.
1304
+ $opted_in_users[ $main_super_admin_user_id ][0];
1305
+
1306
+ /**
1307
+ * Make sure we migrate the plan ID of the network install, otherwise, if after the migration
1308
+ * the 1st page that will be loaded is the network level WP Admin and $storage->network_install_blog_id
1309
+ * is different than the main site of the network, the $this->_site will not be set since the plan_id
1310
+ * will be empty.
1311
+ */
1312
+ $storage->migrate_to_network();
1313
+ self::migrate_install_plan_to_plan_id( $storage, $storage->network_install_blog_id );
1314
+ } else {
1315
+ // At least one opt-in. All the opt-in were created by a non-super-admin.
1316
+ if ( 0 == $ignores ) {
1317
+ // All sites were opted-in or skipped, all by non-super-admin. So delegate all.
1318
+ $storage->store( 'is_delegated_connection', true, true );
1319
+
1320
+ $all_migrated = true;
1321
+ }
1322
+ }
1323
+
1324
+ if ( ! $all_migrated ) {
1325
+ /**
1326
+ * Delegate all sites that were:
1327
+ * 1) Opted-in by a user that is NOT the main-super-admin.
1328
+ * 2) Skipped and non of the sites was opted-in by a super-admin. If any site was opted-in by a super-admin, there will be a main-super-admin, and we consider the skip as if it was done by that user.
1329
+ */
1330
+ foreach ( $blogs_status as $blog_id => $status_or_user_id ) {
1331
+ if ( $status_or_user_id == $main_super_admin_user_id ) {
1332
+ continue;
1333
+ }
1334
+
1335
+ if ( FS_User::is_valid_id( $status_or_user_id ) ||
1336
+ ( 'skipped' === $status_or_user_id && is_null( $main_super_admin_user_id ) )
1337
+ ) {
1338
+ $storage->store( 'is_delegated_connection', true, $blog_id );
1339
+ }
1340
+ }
1341
+ }
1342
+
1343
+
1344
+ if ( ( $connections + $skips > 0 ) ) {
1345
+ if ( $ignores > 0 ) {
1346
+ /**
1347
+ * If admin already opted-in or skipped in any of the network sites, and also
1348
+ * have sites which the connection decision was not yet taken, set this plugin
1349
+ * into network activation mode so the super-admin can choose what to do with
1350
+ * the rest of the sites.
1351
+ */
1352
+ self::set_network_upgrade_mode( $storage );
1353
+ }
1354
+ }
1355
+ }
1356
+ }
1357
+
1358
+ /**
1359
+ * Set a module into network upgrade mode.
1360
+ *
1361
+ * @author Vova Feldman (@svovaf)
1362
+ * @since 2.0.0
1363
+ *
1364
+ * @param \FS_Storage $storage
1365
+ *
1366
+ * @return bool
1367
+ */
1368
+ private static function set_network_upgrade_mode( FS_Storage $storage ) {
1369
+ return $storage->is_network_activation = true;
1370
+ }
1371
+
1372
+ /**
1373
+ * Will return true after upgrading to the SDK with the network level integration,
1374
+ * when the super-admin involvement is required regarding the rest of the sites.
1375
+ *
1376
+ * @author Vova Feldman (@svovaf)
1377
+ * @since 2.0.0
1378
+ *
1379
+ * @return bool
1380
+ */
1381
+ function is_network_upgrade_mode() {
1382
+ return $this->_storage->get( 'is_network_activation' );
1383
+ }
1384
+
1385
+ /**
1386
+ * Clear flag after the upgrade mode completion.
1387
+ *
1388
+ * @author Vova Feldman (@svovaf)
1389
+ * @since 2.0.0
1390
+ *
1391
+ * @return bool True if network activation was on and now completed.
1392
+ */
1393
+ private function network_upgrade_mode_completed() {
1394
+ if ( fs_is_network_admin() && $this->is_network_upgrade_mode() ) {
1395
+ $this->_storage->remove( 'is_network_activation' );
1396
+
1397
+ return true;
1398
+ }
1399
+
1400
+ return false;
1401
+ }
1402
+
1403
+ #endregion
1404
+
1405
+ /**
1406
+ * This action is connected to the 'plugins_loaded' hook and helps to determine
1407
+ * if this is a new plugin installation or a plugin update.
1408
+ *
1409
+ * There are 3 different use-cases:
1410
+ * 1) New plugin installation right with Freemius:
1411
+ * 1.1 _activate_plugin_event_hook() will be executed first
1412
+ * 1.2 Since $this->_storage->is_plugin_new_install is not set,
1413
+ * and $this->_storage->plugin_last_version is not set,
1414
+ * $this->_storage->is_plugin_new_install will be set to TRUE.
1415
+ * 1.3 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install will
1416
+ * be already set to TRUE.
1417
+ *
1418
+ * 2) Plugin update, didn't have Freemius before, and now have the SDK:
1419
+ * 2.1 _activate_plugin_event_hook() will not be executed, because
1420
+ * the activation hook do NOT fires on updates since WP 3.1.
1421
+ * 2.2 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install will
1422
+ * be empty, therefore, it will be set to FALSE.
1423
+ *
1424
+ * 3) Plugin update, had Freemius in prev version as well:
1425
+ * 3.1 _version_updates_handler() will be executed 1st, since FS was installed
1426
+ * before, $this->_storage->plugin_last_version will NOT be empty,
1427
+ * therefore, $this->_storage->is_plugin_new_install will be set to FALSE.
1428
+ * 3.2 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install is
1429
+ * already set, therefore, it will not be modified.
1430
+ *
1431
+ * Use-case #3 is backward compatible, #3.1 will be executed since 1.0.9.
1432
+ *
1433
+ * NOTE:
1434
+ * The only fallback of this mechanism is if an admin updates a plugin based on use-case #2,
1435
+ * and then, the next immediate PageView is the plugin's main settings page, it will not
1436
+ * show the opt-in right away. The reason it will happen is because Freemius execution
1437
+ * will be turned off till the plugin is fully loaded at least once
1438
+ * (till $this->_storage->was_plugin_loaded is TRUE).
1439
+ *
1440
+ * @author Vova Feldman (@svovaf)
1441
+ * @since 1.1.9
1442
+ *
1443
+ */
1444
+ function _plugins_loaded() {
1445
+ // Update flag that plugin was loaded with Freemius at least once.
1446
+ $this->_storage->was_plugin_loaded = true;
1447
+
1448
+ /**
1449
+ * Bug fix - only set to false when it's a plugin, due to the
1450
+ * execution sequence of the theme hooks and our methods, if
1451
+ * this will be set for themes, Freemius will always assume
1452
+ * it's a theme update.
1453
+ *
1454
+ * @author Vova Feldman (@svovaf)
1455
+ * @since 1.2.2.2
1456
+ */
1457
+ if ( $this->is_plugin() &&
1458
+ ! isset( $this->_storage->is_plugin_new_install )
1459
+ ) {
1460
+ $this->_storage->is_plugin_new_install = false;
1461
+ }
1462
+ }
1463
+
1464
+ /**
1465
+ * Add special parameter to WP admin AJAX calls so when we
1466
+ * process AJAX calls we can identify its source properly.
1467
+ *
1468
+ * @author Leo Fajardo (@leorw)
1469
+ * @since 2.0.0
1470
+ */
1471
+ static function _enrich_ajax_url() {
1472
+ $admin_param = is_network_admin() ?
1473
+ '_fs_network_admin' :
1474
+ '_fs_blog_admin';
1475
+ ?>
1476
+ <script type="text/javascript">
1477
+ (function ($) {
1478
+ $(document).ajaxSend(function (event, jqxhr, settings) {
1479
+ if (settings.url &&
1480
+ -1 < settings.url.indexOf('admin-ajax.php') &&
1481
+ ! ( settings.url.indexOf( '<?php echo $admin_param ?>' ) > 0 )
1482
+ ) {
1483
+ if (settings.url.indexOf('?') > 0) {
1484
+ settings.url += '&';
1485
+ } else {
1486
+ settings.url += '?';
1487
+ }
1488
+
1489
+ settings.url += '<?php echo $admin_param ?>=true';
1490
+
1491
+ }
1492
+ });
1493
+ })(jQuery);
1494
+ </script>
1495
+ <?php
1496
+ }
1497
+
1498
+ /**
1499
+ * Opens the support forum subemenu item in a new browser page.
1500
+ *
1501
+ * @author Vova Feldman (@svovaf)
1502
+ * @since 2.1.4
1503
+ */
1504
+ static function _open_support_forum_in_new_page() {
1505
+ ?>
1506
+ <script type="text/javascript">
1507
+ (function ($) {
1508
+ $('.fs-submenu-item.wp-support-forum').parent().attr('target', '_blank');
1509
+ })(jQuery);
1510
+ </script>
1511
+ <?php
1512
+ }
1513
+
1514
+ /**
1515
+ * @author Vova Feldman (@svovaf)
1516
+ * @since 1.0.9
1517
+ */
1518
+ private function register_constructor_hooks() {
1519
+ $this->_logger->entrance();
1520
+
1521
+ if ( is_admin() ) {
1522
+ add_action( 'admin_init', array( &$this, '_hook_action_links_and_register_account_hooks' ) );
1523
+
1524
+ if ( $this->is_plugin() ) {
1525
+ if ( self::is_plugin_install_page() && true !== fs_request_get_bool( 'fs_allow_updater_and_dialog' ) ) {
1526
+ /**
1527
+ * Unless the `fs_allow_updater_and_dialog` URL param exists and its value is `true`, make
1528
+ * Freemius-related updates unavailable on the "Add Plugins" admin page (/plugin-install.php)
1529
+ * so that they won't interfere with the .org plugins' functionalities on that page (e.g.
1530
+ * updating of a .org plugin).
1531
+ */
1532
+ add_filter( 'site_transient_update_plugins', array( 'Freemius', '_remove_fs_updates_from_plugin_install_page' ), 10, 2 );
1533
+ } else if ( self::is_plugins_page() || self::is_updates_page() ) {
1534
+ /**
1535
+ * On the "Plugins" and "Updates" admin pages, if there are premium or non–org-compliant plugins, modify their details dialog URLs (add a Freemius-specific param) so that the SDK can determine if the plugin information dialog should show information from Freemius.
1536
+ *
1537
+ * @author Leo Fajardo (@leorw)
1538
+ * @since 2.2.3
1539
+ */
1540
+ add_action( 'admin_footer', array( 'Freemius', '_prepend_fs_allow_updater_and_dialog_flag_url_param' ) );
1541
+ }
1542
+
1543
+ $plugin_dir = dirname( $this->_plugin_dir_path ) . '/';
1544
+
1545
+ /**
1546
+ * @since 1.2.2
1547
+ *
1548
+ * Hook to both free and premium version activations to support
1549
+ * auto deactivation on the other version activation.
1550
+ */
1551
+ register_activation_hook(
1552
+ $plugin_dir . $this->_free_plugin_basename,
1553
+ array( &$this, '_activate_plugin_event_hook' )
1554
+ );
1555
+
1556
+ register_activation_hook(
1557
+ $plugin_dir . $this->premium_plugin_basename(),
1558
+ array( &$this, '_activate_plugin_event_hook' )
1559
+ );
1560
+ } else {
1561
+ add_action( 'after_switch_theme', array( &$this, '_activate_theme_event_hook' ), 10, 2 );
1562
+
1563
+ add_action( 'admin_footer', array( &$this, '_style_premium_theme' ) );
1564
+ }
1565
+
1566
+ /**
1567
+ * Part of the mechanism to identify new plugin install vs. plugin update.
1568
+ *
1569
+ * @author Vova Feldman (@svovaf)
1570
+ * @since 1.1.9
1571
+ */
1572
+ if ( empty( $this->_storage->was_plugin_loaded ) ) {
1573
+ /**
1574
+ * During the plugin activation (not theme), 'plugins_loaded' will be already executed
1575
+ * when the logic gets here since the activation logic first add the activate plugins,
1576
+ * then triggers 'plugins_loaded', and only then include the code of the plugin that
1577
+ * is activated. Which means that _plugins_loaded() will NOT be executed during the
1578
+ * plugin activation, and that IS intentional.
1579
+ *
1580
+ * @author Vova Feldman (@svovaf)
1581
+ */
1582
+ if ( $this->is_plugin() &&
1583
+ $this->is_activation_mode( false ) &&
1584
+ 0 == did_action( 'plugins_loaded' )
1585
+ ) {
1586
+ add_action( 'plugins_loaded', array( &$this, '_plugins_loaded' ) );
1587
+ } else {
1588
+ // If was activated before, then it was already loaded before.
1589
+ $this->_plugins_loaded();
1590
+ }
1591
+ }
1592
+
1593
+ if ( ! self::is_ajax() ) {
1594
+ if ( ! $this->is_addon() ) {
1595
+ add_action( 'init', array( &$this, '_add_default_submenu_items' ), WP_FS__LOWEST_PRIORITY );
1596
+ }
1597
+ }
1598
+
1599
+ if ( $this->_storage->handle_gdpr_admin_notice ) {
1600
+ add_action( 'init', array( &$this, '_maybe_show_gdpr_admin_notice' ) );
1601
+ }
1602
+
1603
+ add_action( 'init', array( &$this, '_maybe_add_gdpr_optin_ajax_handler') );
1604
+ }
1605
+
1606
+ if ( $this->is_plugin() ) {
1607
+ if ( $this->_is_network_active ) {
1608
+ add_action( 'wpmu_new_blog', array( $this, '_after_new_blog_callback' ), 10, 6 );
1609
+ }
1610
+
1611
+ register_deactivation_hook( $this->_plugin_main_file_path, array( &$this, '_deactivate_plugin_hook' ) );
1612
+ }
1613
+
1614
+ if ( is_multisite() ) {
1615
+ add_action( 'deactivate_blog', array( &$this, '_after_site_deactivated_callback' ) );
1616
+ add_action( 'archive_blog', array( &$this, '_after_site_deactivated_callback' ) );
1617
+ add_action( 'make_spam_blog', array( &$this, '_after_site_deactivated_callback' ) );
1618
+ add_action( 'deleted_blog', array( &$this, '_after_site_deleted_callback' ), 10, 2 );
1619
+
1620
+ add_action( 'activate_blog', array( &$this, '_after_site_reactivated_callback' ) );
1621
+ add_action( 'unarchive_blog', array( &$this, '_after_site_reactivated_callback' ) );
1622
+ add_action( 'make_ham_blog', array( &$this, '_after_site_reactivated_callback' ) );
1623
+ }
1624
+
1625
+ if ( $this->is_theme() &&
1626
+ self::is_customizer() &&
1627
+ $this->apply_filters( 'show_customizer_upsell', true )
1628
+ ) {
1629
+ // Register customizer upsell.
1630
+ add_action( 'customize_register', array( &$this, '_customizer_register' ) );
1631
+ }
1632
+
1633
+ add_action( 'admin_init', array( &$this, '_redirect_on_clicked_menu_link' ), WP_FS__LOWEST_PRIORITY );
1634
+
1635
+ if ( $this->is_theme() ) {
1636
+ add_action( 'admin_init', array( &$this, '_add_tracking_links' ) );
1637
+ }
1638
+
1639
+ add_action( 'admin_init', array( &$this, '_add_license_activation' ) );
1640
+ add_action( 'admin_init', array( &$this, '_add_premium_version_upgrade_selection' ) );
1641
+ add_action( 'admin_init', array( &$this, '_add_beta_mode_update_handler' ) );
1642
+ add_action( 'admin_init', array( &$this, '_add_user_change_option' ) );
1643
+
1644
+ $this->add_ajax_action( 'update_billing', array( &$this, '_update_billing_ajax_action' ) );
1645
+ $this->add_ajax_action( 'start_trial', array( &$this, '_start_trial_ajax_action' ) );
1646
+ $this->add_ajax_action( 'set_data_debug_mode', array( &$this, '_set_data_debug_mode' ) );
1647
+
1648
+ if ( $this->_is_network_active && fs_is_network_admin() ) {
1649
+ $this->add_ajax_action( 'network_activate', array( &$this, '_network_activate_ajax_action' ) );
1650
+ }
1651
+
1652
+ $this->add_ajax_action( 'install_premium_version', array(
1653
+ &$this,
1654
+ '_install_premium_version_ajax_action'
1655
+ ) );
1656
+
1657
+ $this->add_ajax_action( 'submit_affiliate_application', array( &$this, '_submit_affiliate_application' ) );
1658
+
1659
+ $this->add_action( 'after_plans_sync', array( &$this, '_check_for_trial_plans' ) );
1660
+
1661
+ $this->add_action( 'sdk_version_update', array( &$this, '_sdk_version_update' ), WP_FS__DEFAULT_PRIORITY, 2 );
1662
+
1663
+ $this->add_action(
1664
+ 'plugin_version_update',
1665
+ array( &$this, '_after_version_update' ),
1666
+ WP_FS__DEFAULT_PRIORITY,
1667
+ 2
1668
+ );
1669
+ $this->add_filter( 'after_code_type_change', array( &$this, '_after_code_type_change' ) );
1670
+
1671
+ add_action( 'admin_init', array( &$this, '_add_trial_notice' ) );
1672
+ add_action( 'admin_init', array( &$this, '_add_affiliate_program_notice' ) );
1673
+ add_action( 'admin_enqueue_scripts', array( &$this, '_enqueue_common_css' ) );
1674
+
1675
+ /**
1676
+ * Handle request to reset anonymous mode for `get_reconnect_url()`.
1677
+ *
1678
+ * @author Vova Feldman (@svovaf)
1679
+ * @since 1.2.1.5
1680
+ */
1681
+ if ( fs_request_is_action( 'reset_anonymous_mode' ) &&
1682
+ $this->get_unique_affix() === fs_request_get( 'fs_unique_affix' )
1683
+ ) {
1684
+ add_action( 'admin_init', array( &$this, 'connect_again' ) );
1685
+ }
1686
+ }
1687
+
1688
+ /**
1689
+ * Register the required hooks right after the settings parse is completed.
1690
+ *
1691
+ * @author Vova Feldman (@svovaf)
1692
+ * @since 2.3.1
1693
+ */
1694
+ private function register_after_settings_parse_hooks() {
1695
+ if ( is_admin() &&
1696
+ $this->is_theme() &&
1697
+ $this->is_premium() &&
1698
+ ! $this->has_active_valid_license()
1699
+ ) {
1700
+ $this->add_ajax_action(
1701
+ 'delete_theme_update_data',
1702
+ array( &$this, '_delete_theme_update_data_action' )
1703
+ );
1704
+ }
1705
+
1706
+ if ( $this->show_settings_with_tabs() ) {
1707
+ /**
1708
+ * Include the required hooks to capture the theme settings' page tabs
1709
+ * and cache them.
1710
+ *
1711
+ * @author Vova Feldman (@svovaf)
1712
+ * @since 1.2.2.7
1713
+ */
1714
+ if ( ! $this->_cache->has_valid( 'tabs' ) ) {
1715
+ add_action( 'admin_footer', array( &$this, '_tabs_capture' ) );
1716
+ // Add license activation AJAX callback.
1717
+ $this->add_ajax_action( 'store_tabs', array( &$this, '_store_tabs_ajax_action' ) );
1718
+
1719
+ add_action( 'admin_enqueue_scripts', array( &$this, '_store_tabs_styles' ), 9999999 );
1720
+ }
1721
+
1722
+ add_action(
1723
+ 'admin_footer',
1724
+ array( &$this, '_add_freemius_tabs' ),
1725
+ /**
1726
+ * The tabs JS code must be executed after the tabs capture logic (_tabs_capture()).
1727
+ * That's why the priority is 11 while the tabs capture logic is added
1728
+ * with priority 10.
1729
+ *
1730
+ * @author Vova Feldman (@svovaf)
1731
+ */
1732
+ 11
1733
+ );
1734
+ }
1735
+
1736
+ if ( ! self::is_ajax() ) {
1737
+ if ( ! $this->is_addon() || $this->is_only_premium() ) {
1738
+ add_action(
1739
+ ( $this->_is_network_active && fs_is_network_admin() ? 'network_' : '' ) . 'admin_menu',
1740
+ array( &$this, '_prepare_admin_menu' ),
1741
+ WP_FS__LOWEST_PRIORITY
1742
+ );
1743
+ }
1744
+ }
1745
+ }
1746
+
1747
+ /**
1748
+ * Makes Freemius-related updates unavailable on the "Add Plugins" admin page (/plugin-install.php) so that
1749
+ * they won't interfere with the .org plugins' functionalities on that page (e.g. updating of a .org plugin).
1750
+ *
1751
+ * @author Leo Fajardo (@leorw)
1752
+ * @since 2.2.3
1753
+ *
1754
+ * @param object $updates
1755
+ * @param string|null $transient
1756
+ *
1757
+ * @return object
1758
+ */
1759
+ static function _remove_fs_updates_from_plugin_install_page( $updates, $transient = null ) {
1760
+ if ( is_object( $updates ) && isset( $updates->response ) ) {
1761
+ foreach ( $updates->response as $file => $plugin ) {
1762
+ if ( isset( $plugin->package ) && false !== strpos( $plugin->package, 'api.freemius' ) ) {
1763
+ unset( $updates->response[ $file ] );
1764
+ }
1765
+ }
1766
+ }
1767
+
1768
+ return $updates;
1769
+ }
1770
+
1771
+ /**
1772
+ * Prepends the `fs_allow_updater_and_dialog` param to the plugin information URLs to tell the SDK to handle
1773
+ * the information that is shown on the plugin details dialog that is shown when the relevant link is clicked.
1774
+ *
1775
+ * @author Leo Fajardo (@leorw)
1776
+ * @since 2.2.3
1777
+ *
1778
+ * @return string
1779
+ */
1780
+ static function _prepend_fs_allow_updater_and_dialog_flag_url_param() {
1781
+ $slug_basename_map = array();
1782
+ foreach ( self::$_instances as $instance ) {
1783
+ if ( ! $instance->is_plugin() ) {
1784
+ continue;
1785
+ }
1786
+
1787
+ $slug_basename_map[ $instance->get_slug() ] = $instance->premium_plugin_basename();
1788
+ }
1789
+ ?>
1790
+ <script type="text/javascript">
1791
+ (function( $ ) {
1792
+ var slugBasenameMap = <?php echo json_encode( $slug_basename_map ) ?>;
1793
+ for ( var slug in slugBasenameMap ) {
1794
+ var basename = slugBasenameMap[ slug ];
1795
+
1796
+ // Try to get the plugin rows if on the "Plugins" page.
1797
+ var $pluginRows = $( '.wp-list-table.plugins tr[data-plugin="' + basename + '"]');
1798
+
1799
+ if ( 0 === $pluginRows.length ) {
1800
+ // Try to get the plugin rows if on the "Updates" page.
1801
+ var $pluginCheckbox = $( '#update-plugins-table input[type="checkbox"][value="' + basename + '"]' );
1802
+ if ( 0 !== $pluginCheckbox.length ) {
1803
+ $pluginRows = $pluginCheckbox.parents( 'tr:first' );
1804
+ }
1805
+ }
1806
+
1807
+ if ( 0 === $pluginRows.length ) {
1808
+ // No plugin rows found.
1809
+ continue;
1810
+ }
1811
+
1812
+ // Find the "View details" links and add the `fs_allow_updater_and_dialog` param to the URL.
1813
+ $pluginRows.find( 'a[href*="plugin-install.php?tab=plugin-information"]' ).each(function() {
1814
+ var $this = $( this ),
1815
+ href = $this.attr( 'href' ).replace( '?tab=', '?fs_allow_updater_and_dialog=true&tab=');
1816
+
1817
+ $this.attr( 'href', href );
1818
+ });
1819
+ }
1820
+ })( jQuery );
1821
+ </script>
1822
+ <?php
1823
+ }
1824
+
1825
+ /**
1826
+ * @author Leo Fajardo (@leorw)
1827
+ * @since 2.3.0
1828
+ */
1829
+ static function _maybe_add_beta_label_styles() {
1830
+ $has_any_beta_version = false;
1831
+
1832
+ foreach ( self::$_instances as $instance ) {
1833
+ if ( $instance->is_beta() ) {
1834
+ $has_any_beta_version = true;
1835
+ break;
1836
+ }
1837
+ }
1838
+
1839
+ if ( $has_any_beta_version ) {
1840
+ fs_enqueue_local_style( 'fs_plugins', '/admin/plugins.css' );
1841
+ }
1842
+ }
1843
+
1844
+ /**
1845
+ * @author Leo Fajardo (@leorw)
1846
+ * @since 2.3.0
1847
+ */
1848
+ static function _maybe_add_beta_label_to_plugins_and_handle_confirmation() {
1849
+ $beta_data = array();
1850
+
1851
+ foreach ( self::$_instances as $instance ) {
1852
+ if ( ! $instance->is_premium() ) {
1853
+ continue;
1854
+ }
1855
+
1856
+ /**
1857
+ * If there's an available beta version update, a confirmation message will be shown when the
1858
+ * "Update now" link on the "Plugins" or "Themes" page is clicked.
1859
+ */
1860
+ $has_beta_update = $instance->has_beta_update();
1861
+
1862
+ $is_beta = (
1863
+ // The "Beta" label is added separately for themes.
1864
+ $instance->is_plugin() &&
1865
+ $instance->is_beta()
1866
+ );
1867
+
1868
+ if ( ! $is_beta && ! $has_beta_update ) {
1869
+ continue;
1870
+ }
1871
+
1872
+ $beta_data[ $instance->get_plugin_basename() ] = array( 'is_installed_version_beta' => $is_beta );
1873
+
1874
+ if ( ! $has_beta_update ) {
1875
+ continue;
1876
+ }
1877
+
1878
+ $beta_data[ $instance->get_plugin_basename() ]['beta_version_update_confirmation_message'] = sprintf(
1879
+ '%s %s',
1880
+ sprintf(
1881
+ fs_esc_attr_inline(
1882
+ 'An update to a Beta version will replace your installed version of %s with the latest Beta release - use with caution, and not on production sites. You have been warned.',
1883
+ 'beta-version-update-caution',
1884
+ $instance->get_slug()
1885
+ ),
1886
+ $instance->get_plugin_title()
1887
+ ),
1888
+ fs_esc_attr_inline( 'Would you like to proceed with the update?', 'update-confirmation', $instance->get_slug() )
1889
+ );
1890
+ }
1891
+
1892
+ if ( empty( $beta_data ) ) {
1893
+ return;
1894
+ }
1895
+ ?>
1896
+ <script type="text/javascript">
1897
+ ( function( $ ) {
1898
+ var betaData = <?php echo json_encode( $beta_data ) ?>;
1899
+
1900
+ for ( var pluginBasename in betaData ) {
1901
+ if ( ! betaData.hasOwnProperty( pluginBasename ) ) {
1902
+ continue;
1903
+ }
1904
+
1905
+ if ( ! betaData[ pluginBasename ].is_installed_version_beta ) {
1906
+ continue;
1907
+ }
1908
+
1909
+ var $parentContainer = $( '.wp-list-table.plugins tr[data-plugin="' + pluginBasename + '"]' );
1910
+ if ( 0 === $parentContainer.length ) {
1911
+ continue;
1912
+ }
1913
+
1914
+ $parentContainer.find( '.plugin-title > strong:first-child').append(
1915
+ '<span class="fs-tag fs-info"><?php fs_esc_js_echo_inline( 'Beta', 'beta' ) ?></span>'
1916
+ );
1917
+ }
1918
+
1919
+ setTimeout( function() {
1920
+ // Wait a little bit before adding the event handler, otherwise, it will be overridden by the core WP logic.
1921
+ $( '.plugins .update-message .update-link, .themes .theme .update-message' ).on( 'click', function() {
1922
+ var $parentContainer = $( this ).parents( 'tr:first' );
1923
+ pluginBasename = ( 0 !== $parentContainer.length ) ?
1924
+ $parentContainer.data( 'plugin' ) :
1925
+ $( this ).parents( '.theme:first' ).data( 'slug' );
1926
+
1927
+ if (
1928
+ betaData[ pluginBasename ] &&
1929
+ betaData[ pluginBasename ].beta_version_update_confirmation_message &&
1930
+ ! confirm( betaData[ pluginBasename ].beta_version_update_confirmation_message )
1931
+ ) {
1932
+ return false;
1933
+ }
1934
+ } );
1935
+ }, 20 );
1936
+ } )( jQuery );
1937
+ </script>
1938
+ <?php
1939
+ }
1940
+
1941
+ /**
1942
+ * Keeping the uninstall hook registered for free or premium plugin version may result to a fatal error that
1943
+ * could happen when a user tries to uninstall either version while one of them is still active. Uninstalling a
1944
+ * plugin will trigger inclusion of the free or premium version and if one of them is active during the
1945
+ * uninstallation, a fatal error may occur in case the plugin's class or functions are already defined.
1946
+ *
1947
+ * @author Leo Fajardo (@leorw)
1948
+ *
1949
+ * @since 1.2.0
1950
+ */
1951
+ private function unregister_uninstall_hook() {
1952
+ $uninstallable_plugins = (array) get_option( 'uninstall_plugins' );
1953
+ unset( $uninstallable_plugins[ $this->_free_plugin_basename ] );
1954
+ unset( $uninstallable_plugins[ $this->premium_plugin_basename() ] );
1955
+
1956
+ update_option( 'uninstall_plugins', $uninstallable_plugins );
1957
+ }
1958
+
1959
+ /**
1960
+ * @since 1.2.0 Invalidate module's main file cache, otherwise, FS_Plugin_Updater will not fetch updates.
1961
+ *
1962
+ * @param bool $store_prev_path
1963
+ */
1964
+ private function clear_module_main_file_cache( $store_prev_path = true ) {
1965
+ if ( ! isset( $this->_storage->plugin_main_file ) ||
1966
+ empty( $this->_storage->plugin_main_file->path )
1967
+ ) {
1968
+ return;
1969
+ }
1970
+
1971
+ if ( ! $store_prev_path ) {
1972
+ /**
1973
+ * Storing the previous path is not needed when clearing the cache after an SDK version update since
1974
+ * the main purpose of the cache clearing in that event is to correct a wrong plugin main file path
1975
+ * which causes data mix-up between plugins (e.g. titles and versions of an add-on and its parent plugin).
1976
+ *
1977
+ * @author Leo Fajardo (@leorw)
1978
+ * @since 2.2.1
1979
+ */
1980
+ unset( $this->_storage->plugin_main_file->path );
1981
+ } else {
1982
+ $plugin_main_file = clone $this->_storage->plugin_main_file;
1983
+
1984
+ // Store cached path (2nd layer cache).
1985
+ $plugin_main_file->prev_path = $plugin_main_file->path;
1986
+
1987
+ // Clear cached path.
1988
+ unset( $plugin_main_file->path );
1989
+
1990
+ $this->_storage->plugin_main_file = $plugin_main_file;
1991
+ }
1992
+
1993
+ /**
1994
+ * Clear global cached path.
1995
+ *
1996
+ * @author Leo Fajardo (@leorw)
1997
+ * @since 1.2.2
1998
+ */
1999
+ $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map' );
2000
+ unset( $id_slug_type_path_map[ $this->_module_id ]['path'] );
2001
+ self::$_accounts->set_option( 'id_slug_type_path_map', $id_slug_type_path_map, true );
2002
+ }
2003
+
2004
+ /**
2005
+ * @author Leo Fajardo (@leorw)
2006
+ * @since 2.0.0
2007
+ */
2008
+ function _hook_action_links_and_register_account_hooks() {
2009
+ $this->_add_tracking_links();
2010
+
2011
+ if ( self::is_plugins_page() && $this->is_plugin() ) {
2012
+ $this->hook_plugin_action_links();
2013
+ }
2014
+
2015
+ $this->_register_account_hooks();
2016
+ }
2017
+
2018
+ /**
2019
+ * @author Vova Feldman (@svovaf)
2020
+ * @since 1.0.9
2021
+ */
2022
+ private function _register_account_hooks() {
2023
+ if ( ! is_admin() ) {
2024
+ return;
2025
+ }
2026
+
2027
+ /**
2028
+ * Always show the deactivation feedback form since we added
2029
+ * automatic free version deactivation upon premium code activation.
2030
+ *
2031
+ * @since 1.2.1.6
2032
+ */
2033
+ $this->add_ajax_action(
2034
+ 'submit_uninstall_reason',
2035
+ array( &$this, '_submit_uninstall_reason_action' )
2036
+ );
2037
+
2038
+ $this->add_ajax_action(
2039
+ 'cancel_subscription_or_trial',
2040
+ array( &$this, 'cancel_subscription_or_trial_ajax_action' )
2041
+ );
2042
+
2043
+ if ( ! $this->is_addon() || $this->is_parent_plugin_installed() ) {
2044
+ if ( ( $this->is_plugin() && self::is_plugins_page() ) ||
2045
+ ( $this->is_theme() && self::is_themes_page() )
2046
+ ) {
2047
+ add_action( 'admin_footer', array( &$this, '_add_deactivation_feedback_dialog_box' ) );
2048
+ }
2049
+ }
2050
+ }
2051
+
2052
+ /**
2053
+ * Leverage backtrace to find caller plugin file path.
2054
+ *
2055
+ * @author Vova Feldman (@svovaf)
2056
+ * @since 1.0.6
2057
+ *
2058
+ * @param bool $is_init Is initiation sequence.
2059
+ *
2060
+ * @return string
2061
+ */
2062
+ private function _find_caller_plugin_file( $is_init = false ) {
2063
+ // Try to load the cached value of the file path.
2064
+ if ( isset( $this->_storage->plugin_main_file ) ) {
2065
+ $plugin_main_file = $this->_storage->plugin_main_file;
2066
+ if ( ! empty( $plugin_main_file->path ) ) {
2067
+ $absolute_path = $this->get_absolute_path( $plugin_main_file->path );
2068
+ if ( file_exists( $absolute_path ) ) {
2069
+ return $absolute_path;
2070
+ }
2071
+ }
2072
+ }
2073
+
2074
+ /**
2075
+ * @since 1.2.1
2076
+ *
2077
+ * `clear_module_main_file_cache()` is clearing the plugin's cached path on
2078
+ * deactivation. Therefore, if any plugin/theme was initiating `Freemius`
2079
+ * with that plugin's slug, it was overriding the empty plugin path with a wrong path.
2080
+ *
2081
+ * So, we've added a special mechanism with a 2nd layer of cache that uses `prev_path`
2082
+ * when the class instantiator isn't the module.
2083
+ */
2084
+ if ( ! $is_init ) {
2085
+ // Fetch prev path cache.
2086
+ if ( isset( $this->_storage->plugin_main_file ) &&
2087
+ ! empty( $this->_storage->plugin_main_file->prev_path )
2088
+ ) {
2089
+ $absolute_path = $this->get_absolute_path( $this->_storage->plugin_main_file->prev_path );
2090
+ if ( file_exists( $absolute_path ) ) {
2091
+ return $absolute_path;
2092
+ }
2093
+ }
2094
+
2095
+ wp_die(
2096
+ $this->get_text_inline( 'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.', 'failed-finding-main-path' ) .
2097
+ " Module: {$this->_slug}; SDK: " . WP_FS__SDK_VERSION . ";",
2098
+ $this->get_text_inline( 'Error', 'error' ),
2099
+ array( 'back_link' => true )
2100
+ );
2101
+ }
2102
+
2103
+ /**
2104
+ * @since 1.2.1
2105
+ *
2106
+ * Only the original instantiator that calls dynamic_init can modify the module's path.
2107
+ */
2108
+ // Find caller module.
2109
+ $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array() );
2110
+ $this->_storage->plugin_main_file = (object) array(
2111
+ 'path' => $id_slug_type_path_map[ $this->_module_id ]['path'],
2112
+ );
2113
+
2114
+ return $this->get_absolute_path( $id_slug_type_path_map[ $this->_module_id ]['path'] );
2115
+ }
2116
+
2117
+ /**
2118
+ * @author Leo Fajardo (@leorw)
2119
+ * @since 1.2.3
2120
+ *
2121
+ * @param string $path
2122
+ *
2123
+ * @return string
2124
+ */
2125
+ private function get_relative_path( $path ) {
2126
+ $module_root_dir = $this->get_module_root_dir_path();
2127
+ if ( 0 === strpos( $path, $module_root_dir ) ) {
2128
+ $path = substr( $path, strlen( $module_root_dir ) );
2129
+ }
2130
+
2131
+ return $path;
2132
+ }
2133
+
2134
+ /**
2135
+ * @author Leo Fajardo (@leorw)
2136
+ * @since 1.2.3
2137
+ *
2138
+ * @param string $path
2139
+ * @param string|bool $module_type
2140
+ *
2141
+ * @return string
2142
+ */
2143
+ private function get_absolute_path( $path, $module_type = false ) {
2144
+ $module_root_dir = $this->get_module_root_dir_path( $module_type );
2145
+ if ( 0 !== strpos( $path, $module_root_dir ) ) {
2146
+ $path = fs_normalize_path( $module_root_dir . $path );
2147
+ }
2148
+
2149
+ return $path;
2150
+ }
2151
+
2152
+ /**
2153
+ * @author Leo Fajardo (@leorw)
2154
+ * @since 1.2.3
2155
+ *
2156
+ * @param string|bool $module_type
2157
+ *
2158
+ * @return string
2159
+ */
2160
+ private function get_module_root_dir_path( $module_type = false ) {
2161
+ $is_plugin = empty( $module_type ) ?
2162
+ $this->is_plugin() :
2163
+ ( WP_FS__MODULE_TYPE_PLUGIN === $module_type );
2164
+
2165
+ return fs_normalize_path( trailingslashit( $is_plugin ?
2166
+ WP_PLUGIN_DIR :
2167
+ get_theme_root( get_stylesheet() ) ) );
2168
+ }
2169
+
2170
+ /**
2171
+ * @author Leo Fajardo (@leorw)
2172
+ *
2173
+ * @param number $module_id
2174
+ * @param string $slug
2175
+ *
2176
+ * @since 1.2.2
2177
+ */
2178
+ private function store_id_slug_type_path_map( $module_id, $slug ) {
2179
+ $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array() );
2180
+
2181
+ $store_option = false;
2182
+
2183
+ if ( ! isset( $id_slug_type_path_map[ $module_id ] ) ) {
2184
+ $id_slug_type_path_map[ $module_id ] = array(
2185
+ 'slug' => $slug
2186
+ );
2187
+
2188
+ $store_option = true;
2189
+ }
2190
+
2191
+ if ( empty( $id_slug_type_path_map[ $module_id ]['path'] ) ||
2192
+ /**
2193
+ * This verification is for cases when suddenly the same module
2194
+ * is installed but with a different folder name.
2195
+ *
2196
+ * @author Vova Feldman (@svovaf)
2197
+ * @since 1.2.3
2198
+ */
2199
+ ! file_exists( $this->get_absolute_path(
2200
+ $id_slug_type_path_map[ $module_id ]['path'],
2201
+ $id_slug_type_path_map[ $module_id ]['type']
2202
+ ) )
2203
+ ) {
2204
+ $caller_main_file_and_type = $this->get_caller_main_file_and_type();
2205
+
2206
+ $id_slug_type_path_map[ $module_id ]['type'] = $caller_main_file_and_type->module_type;
2207
+ $id_slug_type_path_map[ $module_id ]['path'] = $caller_main_file_and_type->path;
2208
+
2209
+ $store_option = true;
2210
+ }
2211
+
2212
+ if ( $store_option ) {
2213
+ self::$_accounts->set_option( 'id_slug_type_path_map', $id_slug_type_path_map, true );
2214
+ }
2215
+ }
2216
+
2217
+ /**
2218
+ * Identifies the caller type: plugin or theme.
2219
+ *
2220
+ * @author Leo Fajardo (@leorw)
2221
+ * @since 1.2.2
2222
+ *
2223
+ * @author Vova Feldman (@svovaf)
2224
+ * @since 1.2.2.3 Find the earliest module in the call stack that calls to the SDK. This fix is for cases when
2225
+ * add-ons are relying on loading the SDK from the parent module, and also allows themes including the
2226
+ * SDK an internal file instead of directly from functions.php.
2227
+ * @since 1.2.1.7 Knows how to handle cases when an add-on includes the parent module logic.
2228
+ */
2229
+ private function get_caller_main_file_and_type() {
2230
+ self::require_plugin_essentials();
2231
+
2232
+ $all_plugins = fs_get_plugins( true );
2233
+ $all_plugins_paths = array();
2234
+
2235
+ // Get active plugin's main files real full names (might be symlinks).
2236
+ foreach ( $all_plugins as $relative_path => $data ) {
2237
+ if ( false === strpos( fs_normalize_path( $relative_path ), '/' ) ) {
2238
+ /**
2239
+ * Ignore plugins that don't have a folder (e.g. Hello Dolly) since they
2240
+ * can't really include the SDK.
2241
+ *
2242
+ * @author Vova Feldman
2243
+ * @since 1.2.1.7
2244
+ */
2245
+ continue;
2246
+ }
2247
+
2248
+ $all_plugins_paths[] = fs_normalize_path( realpath( WP_PLUGIN_DIR . '/' . $relative_path ) );
2249
+ }
2250
+
2251
+ $caller_file_candidate = false;
2252
+ $caller_map = array();
2253
+ $module_type = WP_FS__MODULE_TYPE_PLUGIN;
2254
+ $themes_dir = fs_normalize_path( get_theme_root( get_stylesheet() ) );
2255
+ $plugin_dir_to_skip = false;
2256
+
2257
+ for ( $i = 1, $bt = debug_backtrace(), $len = count( $bt ); $i < $len; $i ++ ) {
2258
+ if ( empty( $bt[ $i ]['file'] ) ) {
2259
+ continue;
2260
+ }
2261
+
2262
+ if ( $i > 1 && ! empty( $bt[ $i - 1 ]['file'] ) && $bt[ $i ]['file'] === $bt[ $i - 1 ]['file'] ) {
2263
+ // If file same as the prev file in the stack, skip it.
2264
+ continue;
2265
+ }
2266
+
2267
+ if ( ! empty( $bt[ $i ]['function'] ) && in_array( $bt[ $i ]['function'], array(
2268
+ 'do_action',
2269
+ 'apply_filter',
2270
+ // The string split is stupid, but otherwise, theme check
2271
+ // throws info notices.
2272
+ 'requir' . 'e_once',
2273
+ 'requir' . 'e',
2274
+ 'includ' . 'e_once',
2275
+ 'includ' . 'e',
2276
+ 'install_and_activate_plugin',
2277
+ 'try_activate_plugin',
2278
+ 'activate_plugin'
2279
+ ) )
2280
+ ) {
2281
+ if ( 'activate_plugin' === $bt[ $i ]['function'] ) {
2282
+ /**
2283
+ * Store the directory of the activator plugin so that any other file that starts with it
2284
+ * cannot be mistakenly chosen as a candidate caller file.
2285
+ *
2286
+ * @author Leo Fajardo
2287
+ *
2288
+ * @since 2.3.0
2289
+ */
2290
+ $caller_file_path = fs_normalize_path( $bt[ $i ]['file'] );
2291
+
2292
+ foreach ( $all_plugins_paths as $plugin_path ) {
2293
+ $plugin_dir = fs_normalize_path( dirname( $plugin_path ) . '/' );
2294
+ if ( false !== strpos( $caller_file_path, $plugin_dir ) ) {
2295
+ $plugin_dir_to_skip = $plugin_dir;
2296
+
2297
+ break;
2298
+ }
2299
+ }
2300
+ }
2301
+
2302
+ // Ignore call stack hooks and files inclusion.
2303
+ continue;
2304
+ }
2305
+
2306
+ $caller_file_path = fs_normalize_path( $bt[ $i ]['file'] );
2307
+
2308
+ if ( ! empty( $plugin_dir_to_skip ) ) {
2309
+ /**
2310
+ * Skip if it's an activator plugin file to avoid mistakenly choosing it as a candidate caller file.
2311
+ *
2312
+ * @author Leo Fajardo
2313
+ *
2314
+ * @since 2.3.0
2315
+ */
2316
+ if ( 0 === strpos( $caller_file_path, $plugin_dir_to_skip ) ) {
2317
+ continue;
2318
+ }
2319
+ }
2320
+
2321
+ if ( 'functions.php' === basename( $caller_file_path ) ) {
2322
+ /**
2323
+ * 1. Assumes that theme's starting execution file is functions.php.
2324
+ * 2. This complex logic fixes symlink issues (e.g. with Vargant).
2325
+ *
2326
+ * @author Vova Feldman (@svovaf)
2327
+ * @since 1.2.2.5
2328
+ */
2329
+
2330
+ if ( $caller_file_path == fs_normalize_path( realpath( trailingslashit( $themes_dir ) . basename( dirname( $caller_file_path ) ) . '/' . basename( $caller_file_path ) ) ) ) {
2331
+ $module_type = WP_FS__MODULE_TYPE_THEME;
2332
+
2333
+ /**
2334
+ * Relative path of the theme, e.g.:
2335
+ * `my-theme/functions.php`
2336
+ *
2337
+ * @author Leo Fajardo (@leorw)
2338
+ */
2339
+ $caller_file_candidate = basename( dirname( $caller_file_path ) ) .
2340
+ '/' .
2341
+ basename( $caller_file_path );
2342
+
2343
+ continue;
2344
+ }
2345
+ }
2346
+
2347
+ $caller_file_hash = md5( $caller_file_path );
2348
+
2349
+ if ( ! isset( $caller_map[ $caller_file_hash ] ) ) {
2350
+ foreach ( $all_plugins_paths as $plugin_path ) {
2351
+ if ( empty( $plugin_path ) ) {
2352
+ continue;
2353
+ }
2354
+
2355
+ if ( false !== strpos( $caller_file_path, fs_normalize_path( dirname( $plugin_path ) . '/' ) ) ) {
2356
+ $caller_map[ $caller_file_hash ] = fs_normalize_path( $plugin_path );
2357
+ break;
2358
+ }
2359
+ }
2360
+ }
2361
+
2362
+ if ( isset( $caller_map[ $caller_file_hash ] ) ) {
2363
+ $module_type = WP_FS__MODULE_TYPE_PLUGIN;
2364
+ $caller_file_candidate = plugin_basename( $caller_map[ $caller_file_hash ] );
2365
+ }
2366
+ }
2367
+
2368
+ return (object) array(
2369
+ 'module_type' => $module_type,
2370
+ 'path' => $caller_file_candidate
2371
+ );
2372
+ }
2373
+
2374
+ #----------------------------------------------------------------------------------
2375
+ #region Deactivation Feedback Form
2376
+ #----------------------------------------------------------------------------------
2377
+
2378
+ /**
2379
+ * Displays a confirmation and feedback dialog box when the user clicks on the "Deactivate" link on the plugins
2380
+ * page.
2381
+ *
2382
+ * @author Vova Feldman (@svovaf)
2383
+ * @author Leo Fajardo (@leorw)
2384
+ *
2385
+ * @since 1.1.2
2386
+ */
2387
+ function _add_deactivation_feedback_dialog_box() {
2388
+ $subscription_cancellation_dialog_box_template_params = $this->apply_filters( 'show_deactivation_subscription_cancellation', true ) ?
2389
+ $this->_get_subscription_cancellation_dialog_box_template_params() :
2390
+ array();
2391
+
2392
+ /**
2393
+ * @since 2.3.0 Developers can optionally hide the deactivation feedback form using the 'show_deactivation_feedback_form' filter.
2394
+ */
2395
+ $show_deactivation_feedback_form = true;
2396
+ if ( $this->has_filter( 'show_deactivation_feedback_form' ) ) {
2397
+ $show_deactivation_feedback_form = $this->apply_filters( 'show_deactivation_feedback_form', true );
2398
+ } else if ( $this->is_addon() ) {
2399
+ /**
2400
+ * If the add-on's 'show_deactivation_feedback_form' is not set, try to inherit the value from the parent.
2401
+ */
2402
+ $show_deactivation_feedback_form = $this->get_parent_instance()->apply_filters( 'show_deactivation_feedback_form', true );
2403
+ }
2404
+
2405
+ $uninstall_confirmation_message = $this->apply_filters( 'uninstall_confirmation_message', '' );
2406
+
2407
+ if (
2408
+ empty( $subscription_cancellation_dialog_box_template_params ) &&
2409
+ ! $show_deactivation_feedback_form &&
2410
+ empty( $uninstall_confirmation_message )
2411
+ ) {
2412
+ return;
2413
+ }
2414
+
2415
+ $vars = array( 'id' => $this->_module_id );
2416
+
2417
+ if ( $show_deactivation_feedback_form ) {
2418
+ /* Check the type of user:
2419
+ * 1. Long-term (long-term)
2420
+ * 2. Non-registered and non-anonymous short-term (non-registered-and-non-anonymous-short-term).
2421
+ * 3. Short-term (short-term)
2422
+ */
2423
+ $is_long_term_user = true;
2424
+
2425
+ // Check if the site is at least 2 days old.
2426
+ $time_installed = $this->_storage->install_timestamp;
2427
+
2428
+ // Difference in seconds.
2429
+ $date_diff = time() - $time_installed;
2430
+
2431
+ // Convert seconds to days.
2432
+ $date_diff_days = floor( $date_diff / ( 60 * 60 * 24 ) );
2433
+
2434
+ if ( $date_diff_days < 2 ) {
2435
+ $is_long_term_user = false;
2436
+ }
2437
+
2438
+ $is_long_term_user = $this->apply_filters( 'is_long_term_user', $is_long_term_user );
2439
+
2440
+ if ( $is_long_term_user ) {
2441
+ $user_type = 'long-term';
2442
+ } else {
2443
+ if ( ! $this->is_registered() && ! $this->is_anonymous() ) {
2444
+ $user_type = 'non-registered-and-non-anonymous-short-term';
2445
+ } else {
2446
+ $user_type = 'short-term';
2447
+ }
2448
+ }
2449
+
2450
+ $uninstall_reasons = $this->_get_uninstall_reasons( $user_type );
2451
+
2452
+ $vars['reasons'] = $uninstall_reasons;
2453
+ }
2454
+
2455
+ $vars['subscription_cancellation_dialog_box_template_params'] = &$subscription_cancellation_dialog_box_template_params;
2456
+ $vars['show_deactivation_feedback_form'] = $show_deactivation_feedback_form;
2457
+ $vars['uninstall_confirmation_message'] = $uninstall_confirmation_message;
2458
+
2459
+ /**
2460
+ * Load the HTML template for the deactivation feedback dialog box.
2461
+ *
2462
+ * @todo Deactivation form core functions should be loaded only once! Otherwise, when there are multiple Freemius powered plugins the same code is loaded multiple times. The only thing that should be loaded differently is the various deactivation reasons object based on the state of the plugin.
2463
+ */
2464
+ fs_require_template( 'forms/deactivation/form.php', $vars );
2465
+ }
2466
+
2467
+ /**
2468
+ * @author Leo Fajardo (@leorw)
2469
+ * @since 1.1.2
2470
+ *
2471
+ * @param string $user_type
2472
+ *
2473
+ * @return array The uninstall reasons for the specified user type.
2474
+ */
2475
+ function _get_uninstall_reasons( $user_type = 'long-term' ) {
2476
+ $module_type = $this->_module_type;
2477
+
2478
+ $internal_message_template_var = array(
2479
+ 'id' => $this->_module_id
2480
+ );
2481
+
2482
+ $plan = $this->get_plan();
2483
+
2484
+ if ( $this->is_registered() && is_object( $plan ) && $plan->has_technical_support() ) {
2485
+ $contact_support_template = fs_get_template( 'forms/deactivation/contact.php', $internal_message_template_var );
2486
+ } else {
2487
+ $contact_support_template = '';
2488
+ }
2489
+
2490
+ $reason_found_better_plugin = array(
2491
+ 'id' => self::REASON_FOUND_A_BETTER_PLUGIN,
2492
+ 'text' => sprintf( $this->get_text_inline( 'I found a better %s', 'reason-found-a-better-plugin' ), $module_type ),
2493
+ 'input_type' => 'textfield',
2494
+ 'input_placeholder' => sprintf( $this->get_text_inline( "What's the %s's name?", 'placeholder-plugin-name' ), $module_type ),
2495
+ );
2496
+
2497
+ $reason_temporary_deactivation = array(
2498
+ 'id' => self::REASON_TEMPORARY_DEACTIVATION,
2499
+ 'text' => sprintf(
2500
+ $this->get_text_inline( "It's a temporary %s. I'm just debugging an issue.", 'reason-temporary-x' ),
2501
+ strtolower( $this->is_plugin() ?
2502
+ $this->get_text_inline( 'Deactivation', 'deactivation' ) :
2503
+ $this->get_text_inline( 'Theme Switch', 'theme-switch' )
2504
+ )
2505
+ ),
2506
+ 'input_type' => '',
2507
+ 'input_placeholder' => ''
2508
+ );
2509
+
2510
+ $reason_other = array(
2511
+ 'id' => self::REASON_OTHER,
2512
+ 'text' => $this->get_text_inline( 'Other', 'reason-other' ),
2513
+ 'input_type' => 'textfield',
2514
+ 'input_placeholder' => ''
2515
+ );
2516
+
2517
+ $long_term_user_reasons = array(
2518
+ array(
2519
+ 'id' => self::REASON_NO_LONGER_NEEDED,
2520
+ 'text' => sprintf( $this->get_text_inline( 'I no longer need the %s', 'reason-no-longer-needed' ), $module_type ),
2521
+ 'input_type' => '',
2522
+ 'input_placeholder' => ''
2523
+ ),
2524
+ $reason_found_better_plugin,
2525
+ array(
2526
+ 'id' => self::REASON_NEEDED_FOR_A_SHORT_PERIOD,
2527
+ 'text' => sprintf( $this->get_text_inline( 'I only needed the %s for a short period', 'reason-needed-for-a-short-period' ), $module_type ),
2528
+ 'input_type' => '',
2529
+ 'input_placeholder' => ''
2530
+ ),
2531
+ array(
2532
+ 'id' => self::REASON_BROKE_MY_SITE,
2533
+ 'text' => sprintf( $this->get_text_inline( 'The %s broke my site', 'reason-broke-my-site' ), $module_type ),
2534
+ 'input_type' => '',
2535
+ 'input_placeholder' => '',
2536
+ 'internal_message' => $contact_support_template
2537
+ ),
2538
+ array(
2539
+ 'id' => self::REASON_SUDDENLY_STOPPED_WORKING,
2540
+ 'text' => sprintf( $this->get_text_inline( 'The %s suddenly stopped working', 'reason-suddenly-stopped-working' ), $module_type ),
2541
+ 'input_type' => '',
2542
+ 'input_placeholder' => '',
2543
+ 'internal_message' => $contact_support_template
2544
+ )
2545
+ );
2546
+
2547
+ if ( $this->is_paying() ) {
2548
+ $long_term_user_reasons[] = array(
2549
+ 'id' => self::REASON_CANT_PAY_ANYMORE,
2550
+ 'text' => $this->get_text_inline( "I can't pay for it anymore", 'reason-cant-pay-anymore' ),
2551
+ 'input_type' => 'textfield',
2552
+ 'input_placeholder' => $this->get_text_inline( 'What price would you feel comfortable paying?', 'placeholder-comfortable-price' )
2553
+ );
2554
+ }
2555
+
2556
+ $reason_dont_share_info = array(
2557
+ 'id' => self::REASON_DONT_LIKE_TO_SHARE_MY_INFORMATION,
2558
+ 'text' => $this->get_text_inline( "I don't like to share my information with you", 'reason-dont-like-to-share-my-information' ),
2559
+ 'input_type' => '',
2560
+ 'input_placeholder' => ''
2561
+ );
2562
+
2563
+ /**
2564
+ * If the current user has selected the "don't share data" reason in the deactivation feedback modal, inform the
2565
+ * user by showing additional message that he doesn't have to share data and can just choose to skip the opt-in
2566
+ * (the Skip button is included in the message to show). This message will only be shown if anonymous mode is
2567
+ * enabled and the user's account is currently not in pending activation state (similar to the way the Skip
2568
+ * button in the opt-in form is shown/hidden).
2569
+ */
2570
+ if ( $this->is_enable_anonymous() && ! $this->is_pending_activation() ) {
2571
+ $reason_dont_share_info['internal_message'] = fs_get_template( 'forms/deactivation/retry-skip.php', $internal_message_template_var );
2572
+ }
2573
+
2574
+ $uninstall_reasons = array(
2575
+ 'long-term' => $long_term_user_reasons,
2576
+ 'non-registered-and-non-anonymous-short-term' => array(
2577
+ array(
2578
+ 'id' => self::REASON_DIDNT_WORK,
2579
+ 'text' => sprintf( $this->get_text_inline( "The %s didn't work", 'reason-didnt-work' ), $module_type ),
2580
+ 'input_type' => '',
2581
+ 'input_placeholder' => ''
2582
+ ),
2583
+ $reason_dont_share_info,
2584
+ $reason_found_better_plugin
2585
+ ),
2586
+ 'short-term' => array(
2587
+ array(
2588
+ 'id' => self::REASON_COULDNT_MAKE_IT_WORK,
2589
+ 'text' => $this->get_text_inline( "I couldn't understand how to make it work", 'reason-couldnt-make-it-work' ),
2590
+ 'input_type' => '',
2591
+ 'input_placeholder' => '',
2592
+ 'internal_message' => $contact_support_template
2593
+ ),
2594
+ $reason_found_better_plugin,
2595
+ array(
2596
+ 'id' => self::REASON_GREAT_BUT_NEED_SPECIFIC_FEATURE,
2597
+ 'text' => sprintf( $this->get_text_inline( "The %s is great, but I need specific feature that you don't support", 'reason-great-but-need-specific-feature' ), $module_type ),
2598
+ 'input_type' => 'textarea',
2599
+ 'input_placeholder' => $this->get_text_inline( 'What feature?', 'placeholder-feature' )
2600
+ ),
2601
+ array(
2602
+ 'id' => self::REASON_NOT_WORKING,
2603
+ 'text' => sprintf( $this->get_text_inline( 'The %s is not working', 'reason-not-working' ), $module_type ),
2604
+ 'input_type' => 'textarea',
2605
+ 'input_placeholder' => $this->get_text_inline( "Kindly share what didn't work so we can fix it for future users...", 'placeholder-share-what-didnt-work' )
2606
+ ),
2607
+ array(
2608
+ 'id' => self::REASON_NOT_WHAT_I_WAS_LOOKING_FOR,
2609
+ 'text' => $this->get_text_inline( "It's not what I was looking for", 'reason-not-what-i-was-looking-for' ),
2610
+ 'input_type' => 'textarea',
2611
+ 'input_placeholder' => $this->get_text_inline( "What you've been looking for?", 'placeholder-what-youve-been-looking-for' )
2612
+ ),
2613
+ array(
2614
+ 'id' => self::REASON_DIDNT_WORK_AS_EXPECTED,
2615
+ 'text' => sprintf( $this->get_text_inline( "The %s didn't work as expected", 'reason-didnt-work-as-expected' ), $module_type ),
2616
+ 'input_type' => 'textarea',
2617
+ 'input_placeholder' => $this->get_text_inline( 'What did you expect?', 'placeholder-what-did-you-expect' )
2618
+ )
2619
+ )
2620
+ );
2621
+
2622
+ // Randomize the reasons for the current user type.
2623
+ shuffle( $uninstall_reasons[ $user_type ] );
2624
+
2625
+ // Keep the following reasons as the last items in the list.
2626
+ $uninstall_reasons[ $user_type ][] = $reason_temporary_deactivation;
2627
+ $uninstall_reasons[ $user_type ][] = $reason_other;
2628
+
2629
+ $uninstall_reasons = $this->apply_filters( 'uninstall_reasons', $uninstall_reasons );
2630
+
2631
+ return $uninstall_reasons[ $user_type ];
2632
+ }
2633
+
2634
+ /**
2635
+ * Called after the user has submitted his reason for deactivating the plugin.
2636
+ *
2637
+ * @author Leo Fajardo (@leorw)
2638
+ * @since 1.1.2
2639
+ */
2640
+ function _submit_uninstall_reason_action() {
2641
+ $this->_logger->entrance();
2642
+
2643
+ $this->check_ajax_referer( 'submit_uninstall_reason' );
2644
+
2645
+ $reason_id = fs_request_get( 'reason_id' );
2646
+
2647
+ // Check if the given reason ID is an unsigned integer.
2648
+ if ( ! ctype_digit( $reason_id ) ) {
2649
+ exit;
2650
+ }
2651
+
2652
+ $reason_info = trim( fs_request_get( 'reason_info', '' ) );
2653
+ if ( ! empty( $reason_info ) ) {
2654
+ $reason_info = substr( $reason_info, 0, 128 );
2655
+ }
2656
+
2657
+ $reason = (object) array(
2658
+ 'id' => $reason_id,
2659
+ 'info' => $reason_info,
2660
+ 'is_anonymous' => fs_request_get_bool( 'is_anonymous' )
2661
+ );
2662
+
2663
+ $this->_storage->store( 'uninstall_reason', $reason );
2664
+
2665
+ /**
2666
+ * If the module type is "theme", trigger the uninstall event here (on theme deactivation) since themes do
2667
+ * not support uninstall hook.
2668
+ *
2669
+ * @author Leo Fajardo (@leorw)
2670
+ * @since 1.2.2
2671
+ */
2672
+ if ( $this->is_theme() ) {
2673
+ if ( $this->is_premium() && ! $this->has_active_valid_license() ) {
2674
+ FS_Plugin_Updater::instance( $this )->delete_update_data();
2675
+ }
2676
+
2677
+ $this->_uninstall_plugin_event( false );
2678
+ $this->remove_sdk_reference();
2679
+ }
2680
+
2681
+ // Print '1' for successful operation.
2682
+ echo 1;
2683
+ exit;
2684
+ }
2685
+
2686
+ /**
2687
+ * @author Leo Fajardo (@leorw)
2688
+ * @since 2.1.4
2689
+ */
2690
+ function cancel_subscription_or_trial_ajax_action() {
2691
+ $this->_logger->entrance();
2692
+
2693
+ $this->check_ajax_referer( 'cancel_subscription_or_trial' );
2694
+
2695
+ $result = $this->cancel_subscription_or_trial( fs_request_get( 'plugin_id', $this->get_id() ), false );
2696
+
2697
+ if ( $this->is_api_error( $result ) ) {
2698
+ $this->shoot_ajax_failure( $result->error->message );
2699
+ }
2700
+
2701
+ $this->shoot_ajax_success();
2702
+ }
2703
+
2704
+ /**
2705
+ * @author Leo Fajardo (@leorw)
2706
+ * @since 2.1.4
2707
+ *
2708
+ * @param number $plugin_id
2709
+ *
2710
+ * @return object
2711
+ */
2712
+ private function cancel_subscription_or_trial( $plugin_id ) {
2713
+ $fs = null;
2714
+ if ( $plugin_id == $this->get_id() ) {
2715
+ $fs = $this;
2716
+ } else if ( $this->is_addon_activated( $plugin_id ) ) {
2717
+ $fs = self::get_instance_by_id( $plugin_id );
2718
+ }
2719
+
2720
+ $result = null;
2721
+
2722
+ if ( ! is_null( $fs ) ) {
2723
+ $result = $fs->is_paid_trial() ?
2724
+ $fs->_cancel_trial() :
2725
+ $fs->_downgrade_site();
2726
+ }
2727
+
2728
+ return $result;
2729
+ }
2730
+
2731
+ /**
2732
+ * @author Leo Fajardo (@leorw)
2733
+ * @since 2.0.2
2734
+ */
2735
+ function _delete_theme_update_data_action() {
2736
+ FS_Plugin_Updater::instance( $this )->delete_update_data();
2737
+ }
2738
+
2739
+ #endregion
2740
+
2741
+ #----------------------------------------------------------------------------------
2742
+ #region Instance
2743
+ #----------------------------------------------------------------------------------
2744
+
2745
+ /**
2746
+ * Main singleton instance.
2747
+ *
2748
+ * @author Vova Feldman (@svovaf)
2749
+ * @since 1.0.0
2750
+ *
2751
+ * @param number $module_id
2752
+ * @param string|bool $slug
2753
+ * @param bool $is_init Is initiation sequence.
2754
+ *
2755
+ * @return Freemius|false
2756
+ */
2757
+ static function instance( $module_id, $slug = false, $is_init = false ) {
2758
+ if ( empty( $module_id ) ) {
2759
+ return false;
2760
+ }
2761
+
2762
+ /**
2763
+ * Load the essential static data prior to initiating FS_Plugin_Manager since there's an essential MS network migration logic that needs to be executed prior to the initiation.
2764
+ */
2765
+ self::_load_required_static();
2766
+
2767
+ if ( ! is_numeric( $module_id ) ) {
2768
+ if ( ! $is_init && true === $slug ) {
2769
+ $is_init = true;
2770
+ }
2771
+
2772
+ $slug = $module_id;
2773
+
2774
+ $module = FS_Plugin_Manager::instance( $slug )->get();
2775
+
2776
+ if ( is_object( $module ) ) {
2777
+ $module_id = $module->id;
2778
+ }
2779
+ }
2780
+
2781
+ $key = 'm_' . $module_id;
2782
+
2783
+ if ( ! isset( self::$_instances[ $key ] ) ) {
2784
+ self::$_instances[ $key ] = new Freemius( $module_id, $slug, $is_init );
2785
+ }
2786
+
2787
+ return self::$_instances[ $key ];
2788
+ }
2789
+
2790
+ /**
2791
+ * @author Vova Feldman (@svovaf)
2792
+ * @since 1.0.6
2793
+ *
2794
+ * @param number $addon_id
2795
+ *
2796
+ * @return bool
2797
+ */
2798
+ private static function has_instance( $addon_id ) {
2799
+ return isset( self::$_instances[ 'm_' . $addon_id ] );
2800
+ }
2801
+
2802
+ /**
2803
+ * @author Leo Fajardo (@leorw)
2804
+ * @since 1.2.2
2805
+ *
2806
+ * @param string|number $id_or_slug
2807
+ * @param string $module_type
2808
+ *
2809
+ * @return number|false
2810
+ */
2811
+ private static function get_module_id( $id_or_slug, $module_type = WP_FS__MODULE_TYPE_PLUGIN ) {
2812
+ if ( is_numeric( $id_or_slug ) ) {
2813
+ return $id_or_slug;
2814
+ }
2815
+
2816
+ foreach ( self::$_instances as $instance ) {
2817
+ // Also check the module type since there can be a plugin and a theme with the same slug.
2818
+ if ( ( $module_type === $instance->get_module_type() ) && ( $id_or_slug === $instance->get_slug() ) ) {
2819
+ return $instance->get_id();
2820
+ }
2821
+ }
2822
+
2823
+ return false;
2824
+ }
2825
+
2826
+ /**
2827
+ * @author Vova Feldman (@svovaf)
2828
+ * @since 1.0.6
2829
+ *
2830
+ * @param number $id
2831
+ *
2832
+ * @return false|Freemius
2833
+ */
2834
+ static function get_instance_by_id( $id ) {
2835
+ return isset ( self::$_instances[ 'm_' . $id ] ) ?
2836
+ self::$_instances[ 'm_' . $id ] :
2837
+ false;
2838
+ }
2839
+
2840
+ /**
2841
+ *
2842
+ * @author Vova Feldman (@svovaf)
2843
+ * @since 1.0.1
2844
+ *
2845
+ * @param string $plugin_file
2846
+ * @param string $module_type
2847
+ *
2848
+ * @return false|Freemius
2849
+ */
2850
+ static function get_instance_by_file( $plugin_file, $module_type = WP_FS__MODULE_TYPE_PLUGIN ) {
2851
+ $slug = self::find_slug_by_basename( $plugin_file );
2852
+
2853
+ return ( false !== $slug ) ?
2854
+ self::instance( self::get_module_id( $slug, $module_type ) ) :
2855
+ false;
2856
+ }
2857
+
2858
+ /**
2859
+ * @author Vova Feldman (@svovaf)
2860
+ * @since 1.0.6
2861
+ *
2862
+ * @return false|Freemius
2863
+ */
2864
+ function get_parent_instance() {
2865
+ return self::get_instance_by_id( $this->_plugin->parent_plugin_id );
2866
+ }
2867
+
2868
+ /**
2869
+ * @author Vova Feldman (@svovaf)
2870
+ * @since 1.0.6
2871
+ *
2872
+ * @param string|number $id_or_slug
2873
+ *
2874
+ * @return false|Freemius
2875
+ */
2876
+ function get_addon_instance( $id_or_slug ) {
2877
+ $addon_id = self::get_module_id( $id_or_slug );
2878
+
2879
+ return self::instance( $addon_id );
2880
+ }
2881
+
2882
+ #endregion ------------------------------------------------------------------
2883
+
2884
+ /**
2885
+ * @author Vova Feldman (@svovaf)
2886
+ * @since 1.0.6
2887
+ *
2888
+ * @return bool
2889
+ */
2890
+ function is_parent_plugin_installed() {
2891
+ $is_active = self::has_instance( $this->_plugin->parent_plugin_id );
2892
+
2893
+ if ( $is_active ) {
2894
+ return true;
2895
+ }
2896
+
2897
+ /**
2898
+ * Parent module might be a theme. If that's the case, the add-on's FS
2899
+ * instance will be loaded prior to the theme's FS instance, therefore,
2900
+ * we need to check if it's active with a "look ahead".
2901
+ *
2902
+ * @author Vova Feldman
2903
+ * @since 1.2.2.3
2904
+ */
2905
+ global $fs_active_plugins;
2906
+ if ( is_object( $fs_active_plugins ) && is_array( $fs_active_plugins->plugins ) ) {
2907
+ $active_theme = wp_get_theme();
2908
+
2909
+ foreach ( $fs_active_plugins->plugins as $sdk => $module ) {
2910
+ if ( WP_FS__MODULE_TYPE_THEME === $module->type ) {
2911
+ if ( $module->plugin_path == $active_theme->get_stylesheet() ) {
2912
+ // Parent module is a theme and it's currently active.
2913
+ return true;
2914
+ }
2915
+ }
2916
+ }
2917
+ }
2918
+
2919
+ return false;
2920
+ }
2921
+
2922
+ /**
2923
+ * Check if add-on parent plugin in activation mode.
2924
+ *
2925
+ * @author Vova Feldman (@svovaf)
2926
+ * @since 1.0.7
2927
+ *
2928
+ * @return bool
2929
+ */
2930
+ function is_parent_in_activation() {
2931
+ $parent_fs = $this->get_parent_instance();
2932
+ if ( ! is_object( $parent_fs ) ) {
2933
+ return false;
2934
+ }
2935
+
2936
+ return ( $parent_fs->is_activation_mode() );
2937
+ }
2938
+
2939
+ /**
2940
+ * Is plugin in activation mode.
2941
+ *
2942
+ * @author Vova Feldman (@svovaf)
2943
+ * @since 1.0.7
2944
+ *
2945
+ * @param bool $and_on
2946
+ *
2947
+ * @return bool
2948
+ */
2949
+ function is_activation_mode( $and_on = true ) {
2950
+ return fs_is_network_admin() ?
2951
+ $this->is_network_activation_mode( $and_on ) :
2952
+ $this->is_site_activation_mode( $and_on );
2953
+ }
2954
+
2955
+ /**
2956
+ * Is plugin in activation mode.
2957
+ *
2958
+ * @author Vova Feldman (@svovaf)
2959
+ * @since 1.0.7
2960
+ *
2961
+ * @param bool $and_on
2962
+ *
2963
+ * @return bool
2964
+ */
2965
+ function is_site_activation_mode( $and_on = true ) {
2966
+ return (
2967
+ ( $this->is_on() || ! $and_on ) &&
2968
+ (
2969
+ ( $this->is_premium() && true === $this->_storage->require_license_activation ) ||
2970
+ (
2971
+ ( ! $this->is_registered() ||
2972
+ ( $this->is_only_premium() && ! $this->has_features_enabled_license() ) ) &&
2973
+ ( ! $this->is_enable_anonymous() ||
2974
+ ( ! $this->is_anonymous() && ! $this->is_pending_activation() ) )
2975
+ )
2976
+ )
2977
+ );
2978
+ }
2979
+
2980
+ /**
2981
+ * Checks if the SDK in network activation mode.
2982
+ *
2983
+ * @author Leo Fajardo (@leorw)
2984
+ * @since 2.0.0
2985
+ *
2986
+ * @param bool $and_on
2987
+ *
2988
+ * @return bool
2989
+ */
2990
+ private function is_network_activation_mode( $and_on = true ) {
2991
+ if ( ! $this->_is_network_active ) {
2992
+ // Not network activated.
2993
+ return false;
2994
+ }
2995
+
2996
+ if ( $this->is_network_upgrade_mode() ) {
2997
+ // Special flag to enforce network activation mode to decide what to do with the sites that are not yet opted-in nor skipped.
2998
+ return true;
2999
+ }
3000
+
3001
+ if ( ! $this->is_site_activation_mode( $and_on ) ) {
3002
+ // Whether the context is single site or the network, if the plugin is no longer in activation mode then it is not in network activation mode as well.
3003
+ return false;
3004
+ }
3005
+
3006
+ if ( $this->is_network_delegated_connection() ) {
3007
+ // Super-admin delegated the connection to the site admins -> not activation mode.
3008
+ return false;
3009
+ }
3010
+
3011
+ if ( $this->is_network_anonymous() && true !== $this->_storage->require_license_activation ) {
3012
+ // Super-admin skipped the connection network wide -> not activation mode.
3013
+ return false;
3014
+ }
3015
+
3016
+ if ( $this->is_network_registered() ) {
3017
+ // Super-admin connected at least one site -> not activation mode.
3018
+ return false;
3019
+ }
3020
+
3021
+ return true;
3022
+ }
3023
+
3024
+ /**
3025
+ * Check if current page is the opt-in/pending-activation page.
3026
+ *
3027
+ * @author Vova Feldman (@svovaf)
3028
+ * @since 1.2.1.7
3029
+ *
3030
+ * @return bool
3031
+ */
3032
+ function is_activation_page() {
3033
+ if ( $this->_menu->is_activation_page( $this->show_opt_in_on_themes_page() ) ) {
3034
+ return true;
3035
+ }
3036
+
3037
+ if ( ! $this->is_activation_mode() ) {
3038
+ return false;
3039
+ }
3040
+
3041
+ // Check if current page is matching the activation page.
3042
+ return $this->is_matching_url( $this->get_activation_url() );
3043
+ }
3044
+
3045
+ /**
3046
+ * Check if URL path's are matching and that all querystring
3047
+ * arguments of the $sub_url exist in the $url with the same values.
3048
+ *
3049
+ * WARNING:
3050
+ * 1. This method doesn't check if the sub/domain are matching.
3051
+ * 2. Ignore case sensitivity.
3052
+ *
3053
+ * @author Vova Feldman (@svovaf)
3054
+ * @since 1.2.1.7
3055
+ *
3056
+ * @param string $sub_url
3057
+ * @param string $url If argument is not set, check if the sub_url matching the current's page URL.
3058
+ *
3059
+ * @return bool
3060
+ */
3061
+ private function is_matching_url( $sub_url, $url = '' ) {
3062
+ if ( empty( $url ) ) {
3063
+ $url = $_SERVER['REQUEST_URI'];
3064
+ }
3065
+
3066
+ $url = strtolower( $url );
3067
+ $sub_url = strtolower( $sub_url );
3068
+
3069
+ if ( parse_url( $sub_url, PHP_URL_PATH ) !== parse_url( $url, PHP_URL_PATH ) ) {
3070
+ // Different path - DO NOT OVERRIDE PAGE.
3071
+ return false;
3072
+ }
3073
+
3074
+ $url_params = array();
3075
+ parse_str( parse_url( $url, PHP_URL_QUERY ), $url_params );
3076
+
3077
+ $sub_url_params = array();
3078
+ parse_str( parse_url( $sub_url, PHP_URL_QUERY ), $sub_url_params );
3079
+
3080
+ foreach ( $sub_url_params as $key => $val ) {
3081
+ if ( ! isset( $url_params[ $key ] ) || $val != $url_params[ $key ] ) {
3082
+ // Not matching query string - DO NOT OVERRIDE PAGE.
3083
+ return false;
3084
+ }
3085
+ }
3086
+
3087
+ return true;
3088
+ }
3089
+
3090
+ /**
3091
+ * Get the basenames of all active plugins for specific blog. Including network activated plugins.
3092
+ *
3093
+ * @author Vova Feldman (@svovaf)
3094
+ * @since 2.0.0
3095
+ *
3096
+ * @param int $blog_id
3097
+ *
3098
+ * @return string[]
3099
+ */
3100
+ private static function get_active_plugins_basenames( $blog_id = 0 ) {
3101
+ if ( is_multisite() && $blog_id > 0 ) {
3102
+ $active_basenames = get_blog_option( $blog_id, 'active_plugins' );
3103
+ } else {
3104
+ $active_basenames = get_option( 'active_plugins' );
3105
+ }
3106
+
3107
+ if ( ! is_array( $active_basenames ) ) {
3108
+ $active_basenames = array();
3109
+ }
3110
+
3111
+ if ( is_multisite() ) {
3112
+ $network_active_basenames = get_site_option( 'active_sitewide_plugins' );
3113
+
3114
+ if ( is_array( $network_active_basenames ) && ! empty( $network_active_basenames ) ) {
3115
+ $active_basenames = array_merge( $active_basenames, array_keys( $network_active_basenames ) );
3116
+ }
3117
+ }
3118
+
3119
+ return $active_basenames;
3120
+ }
3121
+
3122
+ /**
3123
+ * @author Leo Fajardo (@leorw)
3124
+ * @since 2.3.0
3125
+ *
3126
+ * @param int $blog_id
3127
+ *
3128
+ * @return array
3129
+ */
3130
+ static function get_active_plugins_directories_map( $blog_id = 0 ) {
3131
+ $active_basenames = self::get_active_plugins_basenames( $blog_id );
3132
+
3133
+ $map = array();
3134
+
3135
+ foreach ( $active_basenames as $active_basename ) {
3136
+ $active_basename = fs_normalize_path( $active_basename );
3137
+
3138
+ if ( false === strpos( $active_basename, '/' ) ) {
3139
+ continue;
3140
+ }
3141
+
3142
+ $map[ dirname( $active_basename ) ] = true;
3143
+ }
3144
+
3145
+ return $map;
3146
+ }
3147
+
3148
+ /**
3149
+ * Get collection of all active plugins. Including network activated plugins.
3150
+ *
3151
+ * @author Vova Feldman (@svovaf)
3152
+ * @since 1.0.9
3153
+ *
3154
+ * @param int $blog_id Since 2.0.0
3155
+ *
3156
+ * @return array[string]array
3157
+ */
3158
+ private static function get_active_plugins( $blog_id = 0 ) {
3159
+ self::require_plugin_essentials();
3160
+
3161
+ $active_plugin = array();
3162
+ $all_plugins = fs_get_plugins();
3163
+ $active_plugins_basenames = self::get_active_plugins_basenames( $blog_id );
3164
+
3165
+ foreach ( $active_plugins_basenames as $plugin_basename ) {
3166
+ $active_plugin[ $plugin_basename ] = $all_plugins[ $plugin_basename ];
3167
+ }
3168
+
3169
+ return $active_plugin;
3170
+ }
3171
+
3172
+ /**
3173
+ * Get collection of all site active plugins for a specified blog.
3174
+ *
3175
+ * @author Vova Feldman (@svovaf)
3176
+ * @since 2.0.0
3177
+ *
3178
+ * @param int $blog_id
3179
+ *
3180
+ * @return array[string]array
3181
+ */
3182
+ private static function get_site_active_plugins( $blog_id = 0 ) {
3183
+ $active_basenames = ( is_multisite() && $blog_id > 0 ) ?
3184
+ get_blog_option( $blog_id, 'active_plugins' ) :
3185
+ get_option( 'active_plugins' );
3186
+
3187
+ $active = array();
3188
+
3189
+ if ( ! is_array( $active_basenames ) ) {
3190
+ return $active;
3191
+ }
3192
+
3193
+ foreach ( $active_basenames as $basename ) {
3194
+ $active[ $basename ] = array(
3195
+ 'is_active' => true,
3196
+ 'Version' => '1.0', // Dummy version.
3197
+ 'slug' => self::get_plugin_slug( $basename ),
3198
+ );
3199
+ }
3200
+
3201
+ return $active;
3202
+ }
3203
+
3204
+ /**
3205
+ * Get collection of all plugins with their activation status for a specified blog.
3206
+ *
3207
+ * @author Vova Feldman (@svovaf)
3208
+ * @since 1.1.8
3209
+ *
3210
+ * @param int $blog_id Since 2.0.0
3211
+ *
3212
+ * @return array Key is the plugin file path and the value is an array of the plugin data.
3213
+ */
3214
+ private static function get_all_plugins( $blog_id = 0 ) {
3215
+ self::require_plugin_essentials();
3216
+
3217
+ $all_plugins = fs_get_plugins();
3218
+
3219
+ $active_plugins_basenames = self::get_active_plugins_basenames( $blog_id );
3220
+
3221
+ foreach ( $all_plugins as $basename => &$data ) {
3222
+ // By default set to inactive (next foreach update the active plugins).
3223
+ $data['is_active'] = false;
3224
+ // Enrich with plugin slug.
3225
+ $data['slug'] = self::get_plugin_slug( $basename );
3226
+ }
3227
+
3228
+ // Flag active plugins.
3229
+ foreach ( $active_plugins_basenames as $basename ) {
3230
+ if ( isset( $all_plugins[ $basename ] ) ) {
3231
+ $all_plugins[ $basename ]['is_active'] = true;
3232
+ }
3233
+ }
3234
+
3235
+ return $all_plugins;
3236
+ }
3237
+
3238
+ /**
3239
+ * Get collection of all plugins and if they are network level activated.
3240
+ *
3241
+ * @author Vova Feldman (@svovaf)
3242
+ * @since 2.0.0
3243
+ *
3244
+ * @return array Key is the plugin basename and the value is an array of the plugin data.
3245
+ */
3246
+ private static function get_network_plugins() {
3247
+ self::require_plugin_essentials();
3248
+
3249
+ $all_plugins = fs_get_plugins();
3250
+
3251
+ $network_active_basenames = is_multisite() ?
3252
+ get_site_option( 'active_sitewide_plugins' ) :
3253
+ array();
3254
+
3255
+ foreach ( $all_plugins as $basename => &$data ) {
3256
+ // By default set to inactive (next foreach update the active plugins).
3257
+ $data['is_active'] = false;
3258
+ // Enrich with plugin slug.
3259
+ $data['slug'] = self::get_plugin_slug( $basename );
3260
+ }
3261
+
3262
+ // Flag active plugins.
3263
+ foreach ( $network_active_basenames as $basename ) {
3264
+ if ( isset( $all_plugins[ $basename ] ) ) {
3265
+ $all_plugins[ $basename ]['is_active'] = true;
3266
+ }
3267
+ }
3268
+
3269
+ return $all_plugins;
3270
+ }
3271
+
3272
+ /**
3273
+ * Cached result of get_site_transient( 'update_plugins' )
3274
+ *
3275
+ * @author Vova Feldman (@svovaf)
3276
+ * @since 1.1.8
3277
+ *
3278
+ * @var object
3279
+ */
3280
+ private static $_plugins_info;
3281
+
3282
+ /**
3283
+ * Helper function to get specified plugin's slug.
3284
+ *
3285
+ * @author Vova Feldman (@svovaf)
3286
+ * @since 1.1.8
3287
+ *
3288
+ * @param $basename
3289
+ *
3290
+ * @return string
3291
+ */
3292
+ private static function get_plugin_slug( $basename ) {
3293
+ if ( ! isset( self::$_plugins_info ) ) {
3294
+ self::$_plugins_info = get_site_transient( 'update_plugins' );
3295
+ }
3296
+
3297
+ $slug = '';
3298
+
3299
+ if ( is_object( self::$_plugins_info ) ) {
3300
+ if ( isset( self::$_plugins_info->no_update ) &&
3301
+ isset( self::$_plugins_info->no_update[ $basename ] ) &&
3302
+ ! empty( self::$_plugins_info->no_update[ $basename ]->slug )
3303
+ ) {
3304
+ $slug = self::$_plugins_info->no_update[ $basename ]->slug;
3305
+ } else if ( isset( self::$_plugins_info->response ) &&
3306
+ isset( self::$_plugins_info->response[ $basename ] ) &&
3307
+ ! empty( self::$_plugins_info->response[ $basename ]->slug )
3308
+ ) {
3309
+ $slug = self::$_plugins_info->response[ $basename ]->slug;
3310
+ }
3311
+ }
3312
+
3313
+ if ( empty( $slug ) ) {
3314
+ // Try to find slug from FS data.
3315
+ $slug = self::find_slug_by_basename( $basename );
3316
+ }
3317
+
3318
+ if ( empty( $slug ) ) {
3319
+ // Fallback to plugin's folder name.
3320
+ $slug = dirname( $basename );
3321
+ }
3322
+
3323
+ return $slug;
3324
+ }
3325
+
3326
+ private static $_statics_loaded = false;
3327
+
3328
+ /**
3329
+ * Load static resources.
3330
+ *
3331
+ * @author Vova Feldman (@svovaf)
3332
+ * @since 1.0.1
3333
+ */
3334
+ private static function _load_required_static() {
3335
+ if ( self::$_statics_loaded ) {
3336
+ return;
3337
+ }
3338
+
3339
+ self::$_static_logger = FS_Logger::get_logger( WP_FS__SLUG, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
3340
+
3341
+ self::$_static_logger->entrance();
3342
+
3343
+ self::$_accounts = FS_Options::instance( WP_FS__ACCOUNTS_OPTION_NAME, true );
3344
+
3345
+ if ( is_multisite() ) {
3346
+ $has_skipped_migration = (
3347
+ // 'id_slug_type_path_map' - was never stored on older versions, therefore, not exists on the site level.
3348
+ null === self::$_accounts->get_option( 'id_slug_type_path_map', null, false ) &&
3349
+ // 'file_slug_map' stored on the site level, so it was running an SDK version before it was integrated with MS-network.
3350
+ null !== self::$_accounts->get_option( 'file_slug_map', null, false )
3351
+ );
3352
+
3353
+ /**
3354
+ * If the file_slug_map exists on the site level but doesn't exist on the
3355
+ * network level storage, it means that we need to process the storage with migration.
3356
+ *
3357
+ * The code in this `if` scope will only be executed once and only for the first site that will execute it because once we migrate the storage data, file_slug_map will be already set in the network level storage.
3358
+ *
3359
+ * @author Vova Feldman (@svovaf)
3360
+ * @since 2.0.0
3361
+ */
3362
+ if (
3363
+ ( $has_skipped_migration && true !== self::$_accounts->get_option( 'ms_migration_complete', false, true ) ) ||
3364
+ ( null === self::$_accounts->get_option( 'file_slug_map', null, true ) &&
3365
+ null !== self::$_accounts->get_option( 'file_slug_map', null, false ) )
3366
+ ) {
3367
+ self::migrate_options_to_network();
3368
+ }
3369
+ }
3370
+
3371
+ self::$_global_admin_notices = FS_Admin_Notices::instance( 'global' );
3372
+
3373
+ if ( ! WP_FS__DEMO_MODE ) {
3374
+ add_action( ( fs_is_network_admin() ? 'network_' : '' ) . 'admin_menu', array(
3375
+ 'Freemius',
3376
+ '_add_debug_section'
3377
+ ) );
3378
+ }
3379
+
3380
+ add_action( "wp_ajax_fs_toggle_debug_mode", array( 'Freemius', '_toggle_debug_mode' ) );
3381
+
3382
+ self::add_ajax_action_static( 'get_debug_log', array( 'Freemius', '_get_debug_log' ) );
3383
+
3384
+ self::add_ajax_action_static( 'get_db_option', array( 'Freemius', '_get_db_option' ) );
3385
+
3386
+ self::add_ajax_action_static( 'set_db_option', array( 'Freemius', '_set_db_option' ) );
3387
+
3388
+ if ( 0 == did_action( 'plugins_loaded' ) ) {
3389
+ add_action( 'plugins_loaded', array( 'Freemius', '_load_textdomain' ), 1 );
3390
+ }
3391
+
3392
+ add_action( 'admin_footer', array( 'Freemius', '_enrich_ajax_url' ) );
3393
+ add_action( 'admin_footer', array( 'Freemius', '_open_support_forum_in_new_page' ) );
3394
+
3395
+ if ( self::is_plugins_page() || self::is_themes_page() ) {
3396
+ add_action( 'admin_print_footer_scripts', array( 'Freemius', '_maybe_add_beta_label_styles' ), 9 );
3397
+
3398
+ /**
3399
+ * Specifically use this hook so that the JS event handlers will work properly on the "Themes"
3400
+ * page.
3401
+ *
3402
+ * @author Leo Fajardo (@leorw)
3403
+ * @since 2.3.0
3404
+ */
3405
+ add_action( 'admin_footer-' . self::get_current_page(), array( 'Freemius', '_maybe_add_beta_label_to_plugins_and_handle_confirmation') );
3406
+ }
3407
+
3408
+ self::$_statics_loaded = true;
3409
+ }
3410
+
3411
+ /**
3412
+ * @author Leo Fajardo (@leorw)
3413
+ *
3414
+ * @since 2.1.3
3415
+ */
3416
+ private static function migrate_options_to_network() {
3417
+ self::migrate_accounts_to_network();
3418
+
3419
+ // Migrate API options from site level to network level.
3420
+ $api_network_options = FS_Option_Manager::get_manager( WP_FS__OPTIONS_OPTION_NAME, true, true );
3421
+ $api_network_options->migrate_to_network();
3422
+
3423
+ // Migrate API cache to network level storage.
3424
+ FS_Cache_Manager::get_manager( WP_FS__API_CACHE_OPTION_NAME )->migrate_to_network();
3425
+
3426
+ self::$_accounts->set_option( 'ms_migration_complete', true, true );
3427
+ }
3428
+
3429
+ #----------------------------------------------------------------------------------
3430
+ #region Localization
3431
+ #----------------------------------------------------------------------------------
3432
+
3433
+ /**
3434
+ * Load framework's text domain.
3435
+ *
3436
+ * @author Vova Feldman (@svovaf)
3437
+ * @since 1.2.1
3438
+ */
3439
+ static function _load_textdomain() {
3440
+ if ( ! is_admin() ) {
3441
+ return;
3442
+ }
3443
+
3444
+ global $fs_active_plugins;
3445
+
3446
+ // Works both for plugins and themes.
3447
+ load_plugin_textdomain(
3448
+ 'freemius',
3449
+ false,
3450
+ $fs_active_plugins->newest->sdk_path . '/languages/'
3451
+ );
3452
+ }
3453
+
3454
+ #endregion
3455
+
3456
+ #----------------------------------------------------------------------------------
3457
+ #region Debugging
3458
+ #----------------------------------------------------------------------------------
3459
+
3460
+ /**
3461
+ * @author Vova Feldman (@svovaf)
3462
+ * @since 1.0.8
3463
+ */
3464
+ static function _add_debug_section() {
3465
+ if ( ! is_super_admin() ) {
3466
+ // Add debug page only for super-admins.
3467
+ return;
3468
+ }
3469
+
3470
+ self::$_static_logger->entrance();
3471
+
3472
+ $title = sprintf( '%s [v.%s]', fs_text_inline( 'Freemius Debug' ), WP_FS__SDK_VERSION );
3473
+
3474
+ if ( WP_FS__DEV_MODE ) {
3475
+ // Add top-level debug menu item.
3476
+ $hook = FS_Admin_Menu_Manager::add_page(
3477
+ $title,
3478
+ $title,
3479
+ 'manage_options',
3480
+ 'freemius',
3481
+ array( 'Freemius', '_debug_page_render' )
3482
+ );
3483
+ } else {
3484
+ // Add hidden debug page.
3485
+ $hook = FS_Admin_Menu_Manager::add_subpage(
3486
+ null,
3487
+ $title,
3488
+ $title,
3489
+ 'manage_options',
3490
+ 'freemius',
3491
+ array( 'Freemius', '_debug_page_render' )
3492
+ );
3493
+ }
3494
+
3495
+ if ( ! empty( $hook ) ) {
3496
+ add_action( "load-$hook", array( 'Freemius', '_debug_page_actions' ) );
3497
+ }
3498
+ }
3499
+
3500
+ /**
3501
+ * @author Vova Feldman (@svovaf)
3502
+ * @since 1.1.7.3
3503
+ */
3504
+ static function _toggle_debug_mode() {
3505
+ if ( ! is_super_admin() ) {
3506
+ return;
3507
+ }
3508
+
3509
+ $is_on = fs_request_get( 'is_on', false, 'post' );
3510
+
3511
+ if ( fs_request_is_post() && in_array( $is_on, array( 0, 1 ) ) ) {
3512
+ update_option( 'fs_debug_mode', $is_on );
3513
+
3514
+ // Turn on/off storage logging.
3515
+ FS_Logger::_set_storage_logging( ( 1 == $is_on ) );
3516
+ }
3517
+
3518
+ exit;
3519
+ }
3520
+
3521
+ /**
3522
+ * @author Vova Feldman (@svovaf)
3523
+ * @since 1.2.1.6
3524
+ */
3525
+ static function _get_debug_log() {
3526
+ $logs = FS_Logger::load_db_logs(
3527
+ fs_request_get( 'filters', false, 'post' ),
3528
+ ! empty( $_POST['limit'] ) && is_numeric( $_POST['limit'] ) ? $_POST['limit'] : 200,
3529
+ ! empty( $_POST['offset'] ) && is_numeric( $_POST['offset'] ) ? $_POST['offset'] : 0
3530
+ );
3531
+
3532
+ self::shoot_ajax_success( $logs );
3533
+ }
3534
+
3535
+ /**
3536
+ * @author Vova Feldman (@svovaf)
3537
+ * @since 1.2.1.7
3538
+ */
3539
+ static function _get_db_option() {
3540
+ check_admin_referer( 'fs_get_db_option' );
3541
+
3542
+ $option_name = fs_request_get( 'option_name' );
3543
+
3544
+ if ( ! is_super_admin() ||
3545
+ ! fs_starts_with( $option_name, 'fs_' )
3546
+ ) {
3547
+ self::shoot_ajax_failure();
3548
+ }
3549
+
3550
+ $value = get_option( $option_name );
3551
+
3552
+ $result = array(
3553
+ 'name' => $option_name,
3554
+ );
3555
+
3556
+ if ( false !== $value ) {
3557
+ if ( ! is_string( $value ) ) {
3558
+ $value = json_encode( $value );
3559
+ }
3560
+
3561
+ $result['value'] = $value;
3562
+ }
3563
+
3564
+ self::shoot_ajax_success( $result );
3565
+ }
3566
+
3567
+ /**
3568
+ * @author Vova Feldman (@svovaf)
3569
+ * @since 1.2.1.7
3570
+ */
3571
+ static function _set_db_option() {
3572
+ check_admin_referer( 'fs_set_db_option' );
3573
+
3574
+ $option_name = fs_request_get( 'option_name' );
3575
+
3576
+ if ( ! is_super_admin() ||
3577
+ ! fs_starts_with( $option_name, 'fs_' )
3578
+ ) {
3579
+ self::shoot_ajax_failure();
3580
+ }
3581
+
3582
+ $option_value = fs_request_get( 'option_value' );
3583
+
3584
+ if ( ! empty( $option_value ) ) {
3585
+ update_option( $option_name, $option_value );
3586
+ }
3587
+
3588
+ self::shoot_ajax_success();
3589
+ }
3590
+
3591
+ /**
3592
+ * @author Vova Feldman (@svovaf)
3593
+ * @since 1.0.8
3594
+ */
3595
+ static function _debug_page_actions() {
3596
+ self::_clean_admin_content_section();
3597
+
3598
+ if ( fs_request_is_action( 'restart_freemius' ) ) {
3599
+ check_admin_referer( 'restart_freemius' );
3600
+
3601
+ if ( ! is_multisite() ) {
3602
+ // Clear accounts data.
3603
+ self::$_accounts->clear( null, true );
3604
+ } else {
3605
+ $sites = self::get_sites();
3606
+ foreach ( $sites as $site ) {
3607
+ $blog_id = self::get_site_blog_id( $site );
3608
+ self::$_accounts->clear( $blog_id, true );
3609
+ }
3610
+
3611
+ // Clear network level storage.
3612
+ self::$_accounts->clear( true, true );
3613
+ }
3614
+
3615
+ // Clear SDK reference cache.
3616
+ delete_option( 'fs_active_plugins' );
3617
+ } else if ( fs_request_is_action( 'clear_updates_data' ) ) {
3618
+ check_admin_referer( 'clear_updates_data' );
3619
+
3620
+ if ( ! is_multisite() ) {
3621
+ set_site_transient( 'update_plugins', null );
3622
+ set_site_transient( 'update_themes', null );
3623
+ } else {
3624
+ $current_blog_id = get_current_blog_id();
3625
+
3626
+ $sites = self::get_sites();
3627
+ foreach ( $sites as $site ) {
3628
+ switch_to_blog( self::get_site_blog_id( $site ) );
3629
+
3630
+ set_site_transient( 'update_plugins', null );
3631
+ set_site_transient( 'update_themes', null );
3632
+ }
3633
+
3634
+ switch_to_blog( $current_blog_id );
3635
+ }
3636
+ } else if ( fs_request_is_action( 'simulate_trial' ) ) {
3637
+ check_admin_referer( 'simulate_trial' );
3638
+
3639
+ $fs = freemius( fs_request_get( 'module_id' ) );
3640
+
3641
+ // Update SDK install to at least 24 hours before.
3642
+ $fs->_storage->install_timestamp = ( time() - WP_FS__TIME_24_HOURS_IN_SEC );
3643
+ // Unset the trial shown timestamp.
3644
+ unset( $fs->_storage->trial_promotion_shown );
3645
+ } else if ( fs_request_is_action( 'simulate_network_upgrade' ) ) {
3646
+ check_admin_referer( 'simulate_network_upgrade' );
3647
+
3648
+ $fs = freemius( fs_request_get( 'module_id' ) );
3649
+
3650
+ self::set_network_upgrade_mode( $fs->_storage );
3651
+ } else if ( fs_request_is_action( 'delete_install' ) ) {
3652
+ check_admin_referer( 'delete_install' );
3653
+
3654
+ self::_delete_site_by_slug(
3655
+ fs_request_get( 'slug' ),
3656
+ fs_request_get( 'module_type' ),
3657
+ true,
3658
+ fs_request_get( 'blog_id', null )
3659
+ );
3660
+ } else if ( fs_request_is_action( 'delete_user' ) ) {
3661
+ check_admin_referer( 'delete_user' );
3662
+
3663
+ self::delete_user( fs_request_get( 'user_id' ) );
3664
+ } else if ( fs_request_is_action( 'download_logs' ) ) {
3665
+ check_admin_referer( 'download_logs' );
3666
+
3667
+ $download_url = FS_Logger::download_db_logs(
3668
+ fs_request_get( 'filters', false, 'post' )
3669
+ );
3670
+
3671
+ if ( false === $download_url ) {
3672
+ wp_die( 'Oops... there was an error while generating the logs download file. Please try again and if it doesn\'t work contact support@freemius.com.' );
3673
+ }
3674
+
3675
+ fs_redirect( $download_url );
3676
+ } else if ( fs_request_is_action( 'migrate_options_to_network' ) ) {
3677
+ check_admin_referer( 'migrate_options_to_network' );
3678
+
3679
+ self::migrate_options_to_network();
3680
+ }
3681
+ }
3682
+
3683
+ /**
3684
+ * @author Vova Feldman (@svovaf)
3685
+ * @since 1.0.8
3686
+ */
3687
+ static function _debug_page_render() {
3688
+ self::$_static_logger->entrance();
3689
+
3690
+ if ( ! is_multisite() ) {
3691
+ $all_plugins_installs = self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN );
3692
+ $all_themes_installs = self::get_all_sites( WP_FS__MODULE_TYPE_THEME );
3693
+ } else {
3694
+ $sites = self::get_sites();
3695
+
3696
+ $all_plugins_installs = array();
3697
+ $all_themes_installs = array();
3698
+
3699
+ foreach ( $sites as $site ) {
3700
+ $blog_id = self::get_site_blog_id( $site );
3701
+
3702
+ $plugins_installs = self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN, $blog_id );
3703
+
3704
+ foreach ( $plugins_installs as $slug => $install ) {
3705
+ if ( ! isset( $all_plugins_installs[ $slug ] ) ) {
3706
+ $all_plugins_installs[ $slug ] = array();
3707
+ }
3708
+
3709
+ $install->blog_id = $blog_id;
3710
+
3711
+ $all_plugins_installs[ $slug ][] = $install;
3712
+ }
3713
+
3714
+ $themes_installs = self::get_all_sites( WP_FS__MODULE_TYPE_THEME, $blog_id );
3715
+
3716
+ foreach ( $themes_installs as $slug => $install ) {
3717
+ if ( ! isset( $all_themes_installs[ $slug ] ) ) {
3718
+ $all_themes_installs[ $slug ] = array();
3719
+ }
3720
+
3721
+ $install->blog_id = $blog_id;
3722
+
3723
+ $all_themes_installs[ $slug ][] = $install;
3724
+ }
3725
+ }
3726
+ }
3727
+
3728
+ $licenses_by_module_type = self::get_all_licenses_by_module_type();
3729
+
3730
+ $vars = array(
3731
+ 'plugin_sites' => $all_plugins_installs,
3732
+ 'theme_sites' => $all_themes_installs,
3733
+ 'users' => self::get_all_users(),
3734
+ 'addons' => self::get_all_addons(),
3735
+ 'account_addons' => self::get_all_account_addons(),
3736
+ 'plugin_licenses' => $licenses_by_module_type[ WP_FS__MODULE_TYPE_PLUGIN ],
3737
+ 'theme_licenses' => $licenses_by_module_type[ WP_FS__MODULE_TYPE_THEME ]
3738
+ );
3739
+
3740
+ fs_enqueue_local_style( 'fs_debug', '/admin/debug.css' );
3741
+ fs_require_once_template( 'debug.php', $vars );
3742
+ }
3743
+
3744
+ #endregion
3745
+
3746
+ #----------------------------------------------------------------------------------
3747
+ #region Connectivity Issues
3748
+ #----------------------------------------------------------------------------------
3749
+
3750
+ /**
3751
+ * Check if Freemius should be turned on for the current plugin install.
3752
+ *
3753
+ * Note:
3754
+ * $this->_is_on is updated in has_api_connectivity()
3755
+ *
3756
+ * @author Vova Feldman (@svovaf)
3757
+ * @since 1.0.9
3758
+ *
3759
+ * @return bool
3760
+ */
3761
+ function is_on() {
3762
+ self::$_static_logger->entrance();
3763
+
3764
+ if ( isset( $this->_is_on ) ) {
3765
+ return $this->_is_on;
3766
+ }
3767
+
3768
+ // If already installed or pending then sure it's on :)
3769
+ if ( $this->is_registered() || $this->is_pending_activation() ) {
3770
+ $this->_is_on = true;
3771
+
3772
+ return true;
3773
+ }
3774
+
3775
+ return false;
3776
+ }
3777
+
3778
+ /**
3779
+ * @author Vova Feldman (@svovaf)
3780
+ * @since 1.1.7.3
3781
+ *
3782
+ * @param bool $flush_if_no_connectivity
3783
+ *
3784
+ * @return bool
3785
+ */
3786
+ private function should_run_connectivity_test( $flush_if_no_connectivity = false ) {
3787
+ if ( ! isset( $this->_storage->connectivity_test ) ) {
3788
+ // Connectivity test was never executed, or cache was cleared.
3789
+ return true;
3790
+ }
3791
+
3792
+ if ( WP_FS__PING_API_ON_IP_OR_HOST_CHANGES ) {
3793
+ if ( WP_FS__IS_HTTP_REQUEST ) {
3794
+ if ( $_SERVER['HTTP_HOST'] != $this->_storage->connectivity_test['host'] ) {
3795
+ // Domain changed.
3796
+ return true;
3797
+ }
3798
+
3799
+ if ( WP_FS__REMOTE_ADDR != $this->_storage->connectivity_test['server_ip'] ) {
3800
+ // Server IP changed.
3801
+ return true;
3802
+ }
3803
+ }
3804
+ }
3805
+
3806
+ if ( $this->_storage->connectivity_test['is_connected'] &&
3807
+ $this->_storage->connectivity_test['is_active']
3808
+ ) {
3809
+ // API connected and Freemius is active - no need to run connectivity check.
3810
+ return false;
3811
+ }
3812
+
3813
+ if ( $flush_if_no_connectivity ) {
3814
+ /**
3815
+ * If explicitly asked to flush when no connectivity - do it only
3816
+ * if at least 10 sec passed from the last API connectivity test.
3817
+ */
3818
+ return ( isset( $this->_storage->connectivity_test['timestamp'] ) &&
3819
+ ( WP_FS__SCRIPT_START_TIME - $this->_storage->connectivity_test['timestamp'] ) > 10 );
3820
+ }
3821
+
3822
+ /**
3823
+ * @since 1.1.7 Don't check for connectivity on plugin downgrade.
3824
+ */
3825
+ $version = $this->get_plugin_version();
3826
+ if ( version_compare( $version, $this->_storage->connectivity_test['version'], '>' ) ) {
3827
+ // If it's a plugin version upgrade and Freemius is off or no connectivity, run connectivity test.
3828
+ return true;
3829
+ }
3830
+
3831
+ return false;
3832
+ }
3833
+
3834
+ /**
3835
+ * @author Vova Feldman (@svovaf)
3836
+ * @since 1.1.7.4
3837
+ *
3838
+ * @param int|null $blog_id Since 2.0.0.
3839
+ * @param bool $is_gdpr_test Since 2.0.2. Perform only the GDPR test.
3840
+ *
3841
+ * @return object|false
3842
+ */
3843
+ private function ping( $blog_id = null, $is_gdpr_test = false ) {
3844
+ if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY ) {
3845
+ return false;
3846
+ }
3847
+
3848
+ $version = $this->get_plugin_version();
3849
+
3850
+ $is_update = $this->apply_filters( 'is_plugin_update', $this->is_plugin_update() );
3851
+
3852
+ return $this->get_api_plugin_scope()->ping(
3853
+ $this->get_anonymous_id( $blog_id ),
3854
+ array(
3855
+ 'is_update' => json_encode( $is_update ),
3856
+ 'version' => $version,
3857
+ 'sdk' => $this->version,
3858
+ 'is_admin' => json_encode( is_admin() ),
3859
+ 'is_ajax' => json_encode( self::is_ajax() ),
3860
+ 'is_cron' => json_encode( self::is_cron() ),
3861
+ 'is_gdpr_test' => $is_gdpr_test,
3862
+ 'is_http' => json_encode( WP_FS__IS_HTTP_REQUEST ),
3863
+ )
3864
+ );
3865
+ }
3866
+
3867
+ /**
3868
+ * Check if there's any connectivity issue to Freemius API.
3869
+ *
3870
+ * @author Vova Feldman (@svovaf)
3871
+ * @since 1.0.9
3872
+ *
3873
+ * @param bool $flush_if_no_connectivity
3874
+ *
3875
+ * @return bool
3876
+ */
3877
+ function has_api_connectivity( $flush_if_no_connectivity = false ) {
3878
+ $this->_logger->entrance();
3879
+
3880
+ if ( isset( $this->_has_api_connection ) && ( $this->_has_api_connection || ! $flush_if_no_connectivity ) ) {
3881
+ return $this->_has_api_connection;
3882
+ }
3883
+
3884
+ if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY &&
3885
+ isset( $this->_storage->connectivity_test ) &&
3886
+ true === $this->_storage->connectivity_test['is_connected']
3887
+ ) {
3888
+ unset( $this->_storage->connectivity_test );
3889
+ }
3890
+
3891
+ if ( ! $this->should_run_connectivity_test( $flush_if_no_connectivity ) ) {
3892
+ $this->_has_api_connection = $this->_storage->connectivity_test['is_connected'];
3893
+ /**
3894
+ * @since 1.1.6 During dev mode, if there's connectivity - turn Freemius on regardless the configuration.
3895
+ *
3896
+ * @since 1.2.1.5 If the user running the premium version then ignore the 'is_active' flag and turn Freemius on to enable license key activation.
3897
+ */
3898
+ $this->_is_on = $this->_storage->connectivity_test['is_active'] ||
3899
+ $this->is_premium() ||
3900
+ ( WP_FS__DEV_MODE && $this->_has_api_connection && ! WP_FS__SIMULATE_FREEMIUS_OFF );
3901
+
3902
+ return $this->_has_api_connection;
3903
+ }
3904
+
3905
+ $pong = $this->ping();
3906
+ $is_connected = $this->get_api_plugin_scope()->is_valid_ping( $pong );
3907
+
3908
+ if ( ! $is_connected ) {
3909
+ // API failure.
3910
+ $this->_add_connectivity_issue_message( $pong );
3911
+ }
3912
+
3913
+ if ( $is_connected ) {
3914
+ FS_GDPR_Manager::instance()->store_is_required( $pong->is_gdpr_required );
3915
+ }
3916
+
3917
+ $this->store_connectivity_info( $pong, $is_connected );
3918
+
3919
+ return $this->_has_api_connection;
3920
+ }
3921
+
3922
+ /**
3923
+ * @author Vova Feldman (@svovaf)
3924
+ * @since 1.1.7.4
3925
+ *
3926
+ * @param object $pong
3927
+ * @param bool $is_connected
3928
+ */
3929
+ private function store_connectivity_info( $pong, $is_connected ) {
3930
+ $this->_logger->entrance();
3931
+
3932
+ $version = $this->get_plugin_version();
3933
+
3934
+ if ( ! $is_connected || WP_FS__SIMULATE_FREEMIUS_OFF ) {
3935
+ $is_active = false;
3936
+ } else {
3937
+ $is_active = ( isset( $pong->is_active ) && true == $pong->is_active );
3938
+ }
3939
+
3940
+ $is_active = $this->apply_filters(
3941
+ 'is_on',
3942
+ $is_active,
3943
+ $this->is_plugin_update(),
3944
+ $version
3945
+ );
3946
+
3947
+ $this->_storage->connectivity_test = array(
3948
+ 'is_connected' => $is_connected,
3949
+ 'host' => $_SERVER['HTTP_HOST'],
3950
+ 'server_ip' => WP_FS__REMOTE_ADDR,
3951
+ 'is_active' => $is_active,
3952
+ 'timestamp' => WP_FS__SCRIPT_START_TIME,
3953
+ // Last version with connectivity attempt.
3954
+ 'version' => $version,
3955
+ );
3956
+
3957
+ $this->_has_api_connection = $is_connected;
3958
+ $this->_is_on = $is_active || ( WP_FS__DEV_MODE && $is_connected && ! WP_FS__SIMULATE_FREEMIUS_OFF );
3959
+ }
3960
+
3961
+ /**
3962
+ * Force turning Freemius on.
3963
+ *
3964
+ * @author Vova Feldman (@svovaf)
3965
+ * @since 1.1.8.1
3966
+ *
3967
+ * @return bool TRUE if successfully turned on.
3968
+ */
3969
+ private function turn_on() {
3970
+ $this->_logger->entrance();
3971
+
3972
+ if ( $this->is_on() || ! isset( $this->_storage->connectivity_test['is_active'] ) ) {
3973
+ return false;
3974
+ }
3975
+
3976
+ $updated_connectivity = $this->_storage->connectivity_test;
3977
+ $updated_connectivity['is_active'] = true;
3978
+ $updated_connectivity['timestamp'] = WP_FS__SCRIPT_START_TIME;
3979
+ $this->_storage->connectivity_test = $updated_connectivity;
3980
+
3981
+ $this->_is_on = true;
3982
+
3983
+ return true;
3984
+ }
3985
+
3986
+ /**
3987
+ * Anonymous and unique site identifier (Hash).
3988
+ *
3989
+ * @author Vova Feldman (@svovaf)
3990
+ * @since 1.1.0
3991
+ *
3992
+ * @param null|int $blog_id Since 2.0.0
3993
+ *
3994
+ * @return string
3995
+ */
3996
+ function get_anonymous_id( $blog_id = null ) {
3997
+ $unique_id = self::$_accounts->get_option( 'unique_id', null, $blog_id );
3998
+
3999
+ if ( empty( $unique_id ) || ! is_string( $unique_id ) ) {
4000
+ $key = fs_strip_url_protocol( get_site_url( $blog_id ) );
4001
+
4002
+ $secure_auth = SECURE_AUTH_KEY;
4003
+ if ( empty( $secure_auth ) ||
4004
+ false !== strpos( $secure_auth, ' ' ) ||
4005
+ 'put your unique phrase here' === $secure_auth
4006
+ ) {
4007
+ // Protect against default auth key.
4008
+ $secure_auth = md5( microtime() );
4009
+ }
4010
+
4011
+ /**
4012
+ * Base the unique identifier on the WP secure authentication key. Which
4013
+ * turns the key into a secret anonymous identifier. This will help us
4014
+ * to avoid duplicate installs generation on the backend upon opt-in.
4015
+ *
4016
+ * @author Vova Feldman (@svovaf)
4017
+ * @since 1.2.3
4018
+ */
4019
+ $unique_id = md5( $key . $secure_auth );
4020
+
4021
+ self::$_accounts->set_option( 'unique_id', $unique_id, true, $blog_id );
4022
+ }
4023
+
4024
+ $this->_logger->departure( $unique_id );
4025
+
4026
+ return $unique_id;
4027
+ }
4028
+
4029
+ /**
4030
+ * @author Vova Feldman (@svovaf)
4031
+ * @since 1.1.7.4
4032
+ *
4033
+ * @return \WP_User
4034
+ */
4035
+ static function _get_current_wp_user() {
4036
+ self::require_pluggable_essentials();
4037
+ self::wp_cookie_constants();
4038
+
4039
+ return wp_get_current_user();
4040
+ }
4041
+
4042
+ /**
4043
+ * Define cookie constants which are required by Freemius::_get_current_wp_user() since
4044
+ * it uses wp_get_current_user() which needs the cookie constants set. When a plugin
4045
+ * is network activated the cookie constants are only configured after the network
4046
+ * plugins activation, therefore, if we don't define those constants WP will throw
4047
+ * PHP warnings/notices.
4048
+ *
4049
+ * @author Vova Feldman (@svovaf)
4050
+ * @since 2.1.1
4051
+ */
4052
+ private static function wp_cookie_constants() {
4053
+ if ( defined( 'LOGGED_IN_COOKIE' ) &&
4054
+ ( defined( 'AUTH_COOKIE' ) || defined( 'SECURE_AUTH_COOKIE' ) )
4055
+ ) {
4056
+ return;
4057
+ }
4058
+
4059
+ /**
4060
+ * Used to guarantee unique hash cookies
4061
+ *
4062
+ * @since 1.5.0
4063
+ */
4064
+ if ( ! defined( 'COOKIEHASH' ) ) {
4065
+ $siteurl = get_site_option( 'siteurl' );
4066
+ if ( $siteurl ) {
4067
+ define( 'COOKIEHASH', md5( $siteurl ) );
4068
+ } else {
4069
+ define( 'COOKIEHASH', '' );
4070
+ }
4071
+ }
4072
+
4073
+ if ( ! defined( 'LOGGED_IN_COOKIE' ) ) {
4074
+ define( 'LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH );
4075
+ }
4076
+
4077
+ /**
4078
+ * @since 2.5.0
4079
+ */
4080
+ if ( ! defined( 'AUTH_COOKIE' ) ) {
4081
+ define( 'AUTH_COOKIE', 'wordpress_' . COOKIEHASH );
4082
+ }
4083
+
4084
+ /**
4085
+ * @since 2.6.0
4086
+ */
4087
+ if ( ! defined( 'SECURE_AUTH_COOKIE' ) ) {
4088
+ define( 'SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH );
4089
+ }
4090
+ }
4091
+
4092
+ /**
4093
+ * @author Vova Feldman (@svovaf)
4094
+ * @since 2.1.0
4095
+ *
4096
+ * @return int
4097
+ */
4098
+ static function get_current_wp_user_id() {
4099
+ $wp_user = self::_get_current_wp_user();
4100
+
4101
+ return $wp_user->ID;
4102
+ }
4103
+
4104
+ /**
4105
+ * @author Vova Feldman (@svovaf)
4106
+ * @since 1.2.1.7
4107
+ *
4108
+ * @param string $email
4109
+ *
4110
+ * @return bool
4111
+ */
4112
+ static function is_valid_email( $email ) {
4113
+ if ( false === filter_var( $email, FILTER_VALIDATE_EMAIL ) ) {
4114
+ return false;
4115
+ }
4116
+
4117
+ $parts = explode( '@', $email );
4118
+
4119
+ if ( 2 !== count( $parts ) || empty( $parts[1] ) ) {
4120
+ return false;
4121
+ }
4122
+
4123
+ $blacklist = array(
4124
+ 'admin.',
4125
+ 'webmaster.',
4126
+ 'localhost.',
4127
+ 'dev.',
4128
+ 'development.',
4129
+ 'test.',
4130
+ 'stage.',
4131
+ 'staging.',
4132
+ );
4133
+
4134
+ // Make sure domain is not one of the blacklisted.
4135
+ foreach ( $blacklist as $invalid ) {
4136
+ if ( 0 === strpos( $parts[1], $invalid ) ) {
4137
+ return false;
4138
+ }
4139
+ }
4140
+
4141
+ // Get the UTF encoded domain name.
4142
+ $domain = idn_to_ascii( $parts[1] ) . '.';
4143
+
4144
+ return ( checkdnsrr( $domain, 'MX' ) || checkdnsrr( $domain, 'A' ) );
4145
+ }
4146
+
4147
+ /**
4148
+ * Generate API connectivity issue message.
4149
+ *
4150
+ * @author Vova Feldman (@svovaf)
4151
+ * @since 1.0.9
4152
+ *
4153
+ * @param mixed $api_result
4154
+ * @param bool $is_first_failure
4155
+ */
4156
+ function _add_connectivity_issue_message( $api_result, $is_first_failure = true ) {
4157
+ if ( ! $this->is_premium() && $this->_enable_anonymous ) {
4158
+ // Don't add message if it's the free version and can run anonymously.
4159
+ return;
4160
+ }
4161
+
4162
+ if ( ! function_exists( 'wp_nonce_url' ) ) {
4163
+ require_once ABSPATH . 'wp-includes/functions.php';
4164
+ }
4165
+
4166
+ $current_user = self::_get_current_wp_user();
4167
+ // $admin_email = get_option( 'admin_email' );
4168
+ $admin_email = $current_user->user_email;
4169
+
4170
+ // Aliases.
4171
+ $deactivate_plugin_title = $this->esc_html_inline( 'That\'s exhausting, please deactivate', 'deactivate-plugin-title' );
4172
+ $deactivate_plugin_desc = $this->esc_html_inline( 'We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future.', 'deactivate-plugin-desc' );
4173
+ $install_previous_title = $this->esc_html_inline( 'Let\'s try your previous version', 'install-previous-title' );
4174
+ $install_previous_desc = $this->esc_html_inline( 'Uninstall this version and install the previous one.', 'install-previous-desc' );
4175
+ $fix_issue_title = $this->esc_html_inline( 'Yes - I\'m giving you a chance to fix it', 'fix-issue-title' );
4176
+ $fix_issue_desc = $this->esc_html_inline( 'We will do our best to whitelist your server and resolve this issue ASAP. You will get a follow-up email to %s once we have an update.', 'fix-issue-desc' );
4177
+ /* translators: %s: product title (e.g. "Awesome Plugin" requires an access to...) */
4178
+ $x_requires_access_to_api = $this->esc_html_inline( '%s requires an access to our API.', 'x-requires-access-to-api' );
4179
+ $sysadmin_title = $this->esc_html_inline( 'I\'m a system administrator', 'sysadmin-title' );
4180
+ $happy_to_resolve_issue_asap = $this->esc_html_inline( 'We are sure it\'s an issue on our side and more than happy to resolve it for you ASAP if you give us a chance.', 'happy-to-resolve-issue-asap' );
4181
+
4182
+ $message = false;
4183
+ if ( is_object( $api_result ) &&
4184
+ isset( $api_result->error ) &&
4185
+ isset( $api_result->error->code )
4186
+ ) {
4187
+ switch ( $api_result->error->code ) {
4188
+ case 'curl_missing':
4189
+ $missing_methods = '';
4190
+ if ( is_array( $api_result->missing_methods ) &&
4191
+ ! empty( $api_result->missing_methods )
4192
+ ) {
4193
+ foreach ( $api_result->missing_methods as $m ) {
4194
+ if ( 'curl_version' === $m ) {
4195
+ continue;
4196
+ }
4197
+
4198
+ if ( ! empty( $missing_methods ) ) {
4199
+ $missing_methods .= ', ';
4200
+ }
4201
+
4202
+ $missing_methods .= sprintf( '<code>%s</code>', $m );
4203
+ }
4204
+
4205
+ if ( ! empty( $missing_methods ) ) {
4206
+ $missing_methods = sprintf(
4207
+ '<br><br><b>%s</b> %s',
4208
+ $this->esc_html_inline( 'Disabled method(s):', 'curl-disabled-methods' ),
4209
+ $missing_methods
4210
+ );
4211
+ }
4212
+ }
4213
+
4214
+ $message = sprintf(
4215
+ $x_requires_access_to_api . ' ' .
4216
+ $this->esc_html_inline( 'We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server.', 'curl-missing-message' ) . ' ' .
4217
+ $missing_methods .
4218
+ ' %s',
4219
+ '<b>' . $this->get_plugin_name() . '</b>',
4220
+ sprintf(
4221
+ '<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
4222
+ sprintf(
4223
+ '<a class="fs-resolve" data-type="curl" href="#"><b>%s</b></a>%s',
4224
+ $this->get_text_inline( 'I don\'t know what is cURL or how to install it, help me!', 'curl-missing-no-clue-title' ),
4225
+ ' - ' . sprintf(
4226
+ $this->get_text_inline( 'We\'ll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update.', 'curl-missing-no-clue-desc' ),
4227
+ '<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
4228
+ )
4229
+ ),
4230
+ sprintf(
4231
+ '<b>%s</b> - %s',
4232
+ $sysadmin_title,
4233
+ esc_html( sprintf( $this->get_text_inline( 'Great, please install cURL and enable it in your php.ini file. In addition, search for the \'disable_functions\' directive in your php.ini file and remove any disabled methods starting with \'curl_\'. To make sure it was successfully activated, use \'phpinfo()\'. Once activated, deactivate the %s and reactivate it back again.', 'curl-missing-sysadmin-desc' ), $this->get_module_label( true ) ) )
4234
+ ),
4235
+ sprintf(
4236
+ '<a href="%s"><b>%s</b></a> - %s',
4237
+ wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . $this->_plugin_basename . '&amp;plugin_status=all&amp;paged=1&amp;s=', 'deactivate-plugin_' . $this->_plugin_basename ),
4238
+ $deactivate_plugin_title,
4239
+ $deactivate_plugin_desc
4240
+ )
4241
+ )
4242
+ );
4243
+ break;
4244
+ case 'cloudflare_ddos_protection':
4245
+ $message = sprintf(
4246
+ $x_requires_access_to_api . ' ' .
4247
+ $this->esc_html_inline( 'From unknown reason, CloudFlare, the firewall we use, blocks the connection.', 'cloudflare-blocks-connection-message' ) . ' ' .
4248
+ $happy_to_resolve_issue_asap .
4249
+ ' %s',
4250
+ '<b>' . $this->get_plugin_name() . '</b>',
4251
+ sprintf(
4252
+ '<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
4253
+ sprintf(
4254
+ '<a class="fs-resolve" data-type="cloudflare" href="#"><b>%s</b></a>%s',
4255
+ $fix_issue_title,
4256
+ ' - ' . sprintf(
4257
+ $fix_issue_desc,
4258
+ '<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
4259
+ )
4260
+ ),
4261
+ sprintf(
4262
+ '<a href="%s" target="_blank"><b>%s</b></a> - %s',
4263
+ sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ),
4264
+ $install_previous_title,
4265
+ $install_previous_desc
4266
+ ),
4267
+ sprintf(
4268
+ '<a href="%s"><b>%s</b></a> - %s',
4269
+ wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . $this->_plugin_basename . '&amp;plugin_status=all&amp;paged=1&amp;s=' . '', 'deactivate-plugin_' . $this->_plugin_basename ),
4270
+ $deactivate_plugin_title,
4271
+ $deactivate_plugin_desc
4272
+ )
4273
+ )
4274
+ );
4275
+ break;
4276
+ case 'squid_cache_block':
4277
+ $message = sprintf(
4278
+ $x_requires_access_to_api . ' ' .
4279
+ $this->esc_html_inline( 'It looks like your server is using Squid ACL (access control lists), which blocks the connection.', 'squid-blocks-connection-message' ) .
4280
+ ' %s',
4281
+ '<b>' . $this->get_plugin_name() . '</b>',
4282
+ sprintf(
4283
+ '<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
4284
+ sprintf(
4285
+ '<a class="fs-resolve" data-type="squid" href="#"><b>%s</b></a> - %s',
4286
+ $this->esc_html_inline( 'I don\'t know what is Squid or ACL, help me!', 'squid-no-clue-title' ),
4287
+ sprintf(
4288
+ $this->esc_html_inline( 'We\'ll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update.', 'squid-no-clue-desc' ),
4289
+ '<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
4290
+ )
4291
+ ),
4292
+ sprintf(
4293
+ '<b>%s</b> - %s',
4294
+ $sysadmin_title,
4295
+ sprintf(
4296
+ $this->esc_html_inline( 'Great, please whitelist the following domains: %s. Once you are done, deactivate the %s and activate it again.', 'squid-sysadmin-desc' ),
4297
+ // We use a filter since the plugin might require additional API connectivity.
4298
+ '<b>' . implode( ', ', $this->apply_filters( 'api_domains', array(
4299
+ 'api.freemius.com',
4300
+ 'wp.freemius.com'
4301
+ ) ) ) . '</b>',
4302
+ $this->_module_type
4303
+ )
4304
+ ),
4305
+ sprintf(
4306
+ '<a href="%s"><b>%s</b></a> - %s',
4307
+ wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . $this->_plugin_basename . '&amp;plugin_status=all&amp;paged=1&amp;s=', 'deactivate-plugin_' . $this->_plugin_basename ),
4308
+ $deactivate_plugin_title,
4309
+ $deactivate_plugin_desc
4310
+ )
4311
+ )
4312
+ );
4313
+ break;
4314
+ // default:
4315
+ // $message = $this->get_text_inline( 'connectivity-test-fails-message' );
4316
+ // break;
4317
+ }
4318
+ }
4319
+
4320
+ $message_id = 'failed_connect_api';
4321
+ $type = 'error';
4322
+
4323
+ $connectivity_test_fails_message = $this->esc_html_inline( 'From unknown reason, the API connectivity test failed.', 'connectivity-test-fails-message' );
4324
+
4325
+ if ( false === $message ) {
4326
+ if ( $is_first_failure ) {
4327
+ // First attempt failed.
4328
+ $message = sprintf(
4329
+ $x_requires_access_to_api . ' ' .
4330
+ $connectivity_test_fails_message . ' ' .
4331
+ $this->esc_html_inline( 'It\'s probably a temporary issue on our end. Just to be sure, with your permission, would it be o.k to run another connectivity test?', 'connectivity-test-maybe-temporary' ) . '<br><br>' .
4332
+ '%s',
4333
+ '<b>' . $this->get_plugin_name() . '</b>',
4334
+ sprintf(
4335
+ '<div id="fs_firewall_issue_options">%s %s</div>',
4336
+ sprintf(
4337
+ '<a class="button button-primary fs-resolve" data-type="retry_ping" href="#">%s</a>',
4338
+ $this->get_text_inline( 'Yes - do your thing', 'yes-do-your-thing' )
4339
+ ),
4340
+ sprintf(
4341
+ '<a href="%s" class="button">%s</a>',
4342
+ wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . $this->_plugin_basename . '&amp;plugin_status=all&amp;paged=1&amp;s=', 'deactivate-plugin_' . $this->_plugin_basename ),
4343
+ $this->get_text_inline( 'No - just deactivate', 'no-deactivate' )
4344
+ )
4345
+ )
4346
+ );
4347
+
4348
+ $message_id = 'failed_connect_api_first';
4349
+ $type = 'promotion';
4350
+ } else {
4351
+ // Second connectivity attempt failed.
4352
+ $message = sprintf(
4353
+ $x_requires_access_to_api . ' ' .
4354
+ $connectivity_test_fails_message . ' ' .
4355
+ $happy_to_resolve_issue_asap .
4356
+ ' %s',
4357
+ '<b>' . $this->get_plugin_name() . '</b>',
4358
+ sprintf(
4359
+ '<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
4360
+ sprintf(
4361
+ '<a class="fs-resolve" data-type="general" href="#"><b>%s</b></a>%s',
4362
+ $fix_issue_title,
4363
+ ' - ' . sprintf(
4364
+ $fix_issue_desc,
4365
+ '<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
4366
+ )
4367
+ ),
4368
+ sprintf(
4369
+ '<a href="%s" target="_blank"><b>%s</b></a> - %s',
4370
+ sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ),
4371
+ $install_previous_title,
4372
+ $install_previous_desc
4373
+ ),
4374
+ sprintf(
4375
+ '<a href="%s"><b>%s</b></a> - %s',
4376
+ wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . $this->_plugin_basename . '&amp;plugin_status=all&amp;paged=1&amp;s=', 'deactivate-plugin_' . $this->_plugin_basename ),
4377
+ $deactivate_plugin_title,
4378
+ $deactivate_plugin_desc
4379
+ )
4380
+ )
4381
+ );
4382
+ }
4383
+ }
4384
+
4385
+ $this->_admin_notices->add_sticky(
4386
+ $message,
4387
+ $message_id,
4388
+ $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
4389
+ $type
4390
+ );
4391
+ }
4392
+
4393
+ /**
4394
+ * Handle user request to resolve connectivity issue.
4395
+ * This method will send an email to Freemius API technical staff for resolution.
4396
+ * The email will contain server's info and installed plugins (might be caching issue).
4397
+ *
4398
+ * @author Vova Feldman (@svovaf)
4399
+ * @since 1.0.9
4400
+ */
4401
+ function _email_about_firewall_issue() {
4402
+ $this->_admin_notices->remove_sticky( 'failed_connect_api' );
4403
+
4404
+ $pong = $this->ping();
4405
+
4406
+ $is_connected = $this->get_api_plugin_scope()->is_valid_ping( $pong );
4407
+
4408
+ if ( $is_connected ) {
4409
+ FS_GDPR_Manager::instance()->store_is_required( $pong->is_gdpr_required );
4410
+
4411
+ $this->store_connectivity_info( $pong, $is_connected );
4412
+
4413
+ echo $this->get_after_plugin_activation_redirect_url();
4414
+ exit;
4415
+ }
4416
+
4417
+ $current_user = self::_get_current_wp_user();
4418
+ $admin_email = $current_user->user_email;
4419
+
4420
+ $error_type = fs_request_get( 'error_type', 'general' );
4421
+
4422
+ switch ( $error_type ) {
4423
+ case 'squid':
4424
+ $title = 'Squid ACL Blocking Issue';
4425
+ break;
4426
+ case 'cloudflare':
4427
+ $title = 'CloudFlare Blocking Issue';
4428
+ break;
4429
+ default:
4430
+ $title = 'API Connectivity Issue';
4431
+ break;
4432
+ }
4433
+
4434
+ $custom_email_sections = array();
4435
+
4436
+ // Add 'API Error' custom email section.
4437
+ $custom_email_sections['api_error'] = array(
4438
+ 'title' => 'API Error',
4439
+ 'rows' => array(
4440
+ 'ping' => array(
4441
+ 'API Error',
4442
+ is_string( $pong ) ? htmlentities( $pong ) : json_encode( $pong )
4443
+ ),
4444
+ )
4445
+ );
4446
+
4447
+ // Send email with technical details to resolve API connectivity issues.
4448
+ $this->send_email(
4449
+ 'api@freemius.com', // recipient
4450
+ $title . ' [' . $this->get_plugin_name() . ']', // subject
4451
+ $custom_email_sections,
4452
+ array( "Reply-To: $admin_email <$admin_email>" ) // headers
4453
+ );
4454
+
4455
+ $this->_admin_notices->add_sticky(
4456
+ sprintf(
4457
+ $this->get_text_inline( 'Thank for giving us the chance to fix it! A message was just sent to our technical staff. We will get back to you as soon as we have an update to %s. Appreciate your patience.', 'fix-request-sent-message' ),
4458
+ '<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
4459
+ ),
4460
+ 'server_details_sent'
4461
+ );
4462
+
4463
+ // Action was taken, tell that API connectivity troubleshooting should be off now.
4464
+
4465
+ echo "1";
4466
+ exit;
4467
+ }
4468
+
4469
+ /**
4470
+ * Handle connectivity test retry approved by the user.
4471
+ *
4472
+ * @author Vova Feldman (@svovaf)
4473
+ * @since 1.1.7.4
4474
+ */
4475
+ function _retry_connectivity_test() {
4476
+ $this->_admin_notices->remove_sticky( 'failed_connect_api_first' );
4477
+
4478
+ $pong = $this->ping();
4479
+
4480
+ $is_connected = $this->get_api_plugin_scope()->is_valid_ping( $pong );
4481
+
4482
+ if ( $is_connected ) {
4483
+ FS_GDPR_Manager::instance()->store_is_required( $pong->is_gdpr_required );
4484
+
4485
+ $this->store_connectivity_info( $pong, $is_connected );
4486
+
4487
+ echo $this->get_after_plugin_activation_redirect_url();
4488
+ } else {
4489
+ // Add connectivity issue message after 2nd failed attempt.
4490
+ $this->_add_connectivity_issue_message( $pong, false );
4491
+
4492
+ echo "1";
4493
+ }
4494
+
4495
+ exit;
4496
+ }
4497
+
4498
+ static function _add_firewall_issues_javascript() {
4499
+ $params = array();
4500
+ fs_require_once_template( 'firewall-issues-js.php', $params );
4501
+ }
4502
+
4503
+ #endregion
4504
+
4505
+ #----------------------------------------------------------------------------------
4506
+ #region Email
4507
+ #----------------------------------------------------------------------------------
4508
+
4509
+ /**
4510
+ * Generates and sends an HTML email with customizable sections.
4511
+ *
4512
+ * @author Leo Fajardo (@leorw)
4513
+ * @since 1.1.2
4514
+ *
4515
+ * @param string $to_address
4516
+ * @param string $subject
4517
+ * @param array $sections
4518
+ * @param array $headers
4519
+ *
4520
+ * @return bool Whether the email contents were sent successfully.
4521
+ */
4522
+ private function send_email(
4523
+ $to_address,
4524
+ $subject,
4525
+ $sections = array(),
4526
+ $headers = array()
4527
+ ) {
4528
+ $default_sections = $this->get_email_sections();
4529
+
4530
+ // Insert new sections or replace the default email sections.
4531
+ if ( is_array( $sections ) && ! empty( $sections ) ) {
4532
+ foreach ( $sections as $section_id => $custom_section ) {
4533
+ if ( ! isset( $default_sections[ $section_id ] ) ) {
4534
+ // If the section does not exist, add it.
4535
+ $default_sections[ $section_id ] = $custom_section;
4536
+ } else {
4537
+ // If the section already exists, override it.
4538
+ $current_section = $default_sections[ $section_id ];
4539
+
4540
+ // Replace the current section's title if a custom section title exists.
4541
+ if ( isset( $custom_section['title'] ) ) {
4542
+ $current_section['title'] = $custom_section['title'];
4543
+ }
4544
+
4545
+ // Insert new rows under the current section or replace the default rows.
4546
+ if ( isset( $custom_section['rows'] ) && is_array( $custom_section['rows'] ) && ! empty( $custom_section['rows'] ) ) {
4547
+ foreach ( $custom_section['rows'] as $row_id => $row ) {
4548
+ $current_section['rows'][ $row_id ] = $row;
4549
+ }
4550
+ }
4551
+
4552
+ $default_sections[ $section_id ] = $current_section;
4553
+ }
4554
+ }
4555
+ }
4556
+
4557
+ $vars = array( 'sections' => $default_sections );
4558
+ $message = fs_get_template( 'email.php', $vars );
4559
+
4560
+ // Set the type of email to HTML.
4561
+ $headers[] = 'Content-type: text/html; charset=UTF-8';
4562
+
4563
+ $header_string = implode( "\r\n", $headers );
4564
+
4565
+ return wp_mail(
4566
+ $to_address,
4567
+ $subject,
4568
+ $message,
4569
+ $header_string
4570
+ );
4571
+ }
4572
+
4573
+ /**
4574
+ * Generates the data for the sections of the email content.
4575
+ *
4576
+ * @author Leo Fajardo (@leorw)
4577
+ * @since 1.1.2
4578
+ *
4579
+ * @return array
4580
+ */
4581
+ private function get_email_sections() {
4582
+ // Retrieve the current user's information so that we can get the user's email, first name, and last name below.
4583
+ $current_user = self::_get_current_wp_user();
4584
+
4585
+ // Retrieve the cURL version information so that we can get the version number below.
4586
+ $curl_version_information = curl_version();
4587
+
4588
+ $active_plugin = self::get_active_plugins();
4589
+
4590
+ // Generate the list of active plugins separated by new line.
4591
+ $active_plugin_string = '';
4592
+ foreach ( $active_plugin as $plugin ) {
4593
+ $active_plugin_string .= sprintf(
4594
+ '<a href="%s">%s</a> [v%s]<br>',
4595
+ $plugin['PluginURI'],
4596
+ $plugin['Name'],
4597
+ $plugin['Version']
4598
+ );
4599
+ }
4600
+
4601
+ $server_ip = WP_FS__REMOTE_ADDR;
4602
+
4603
+ // Add PHP info for deeper investigation.
4604
+ ob_start();
4605
+ phpinfo();
4606
+ $php_info = ob_get_clean();
4607
+
4608
+ $api_domain = substr( FS_API__ADDRESS, strpos( FS_API__ADDRESS, ':' ) + 3 );
4609
+
4610
+ // Generate the default email sections.
4611
+ $sections = array(
4612
+ 'sdk' => array(
4613
+ 'title' => 'SDK',
4614
+ 'rows' => array(
4615
+ 'fs_version' => array( 'FS Version', $this->version ),
4616
+ 'curl_version' => array( 'cURL Version', $curl_version_information['version'] )
4617
+ )
4618
+ ),
4619
+ 'plugin' => array(
4620
+ 'title' => ucfirst( $this->get_module_type() ),
4621
+ 'rows' => array(
4622
+ 'name' => array( 'Name', $this->get_plugin_name() ),
4623
+ 'version' => array( 'Version', $this->get_plugin_version() )
4624
+ )
4625
+ ),
4626
+ 'api' => array(
4627
+ 'title' => 'API Subdomain',
4628
+ 'rows' => array(
4629
+ 'dns' => array(
4630
+ 'DNS_CNAME',
4631
+ function_exists( 'dns_get_record' ) ?
4632
+ var_export( dns_get_record( $api_domain, DNS_CNAME ), true ) :
4633
+ 'dns_get_record() disabled/blocked'
4634
+ ),
4635
+ 'ip' => array(
4636
+ 'IP',
4637
+ function_exists( 'gethostbyname' ) ?
4638
+ gethostbyname( $api_domain ) :
4639
+ 'gethostbyname() disabled/blocked'
4640
+ ),
4641
+ ),
4642
+ ),
4643
+ 'site' => array(
4644
+ 'title' => 'Site',
4645
+ 'rows' => array(
4646
+ 'unique_id' => array( 'Unique ID', $this->get_anonymous_id() ),
4647
+ 'address' => array( 'Address', site_url() ),
4648
+ 'host' => array(
4649
+ 'HTTP_HOST',
4650
+ ( ! empty( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : '' )
4651
+ ),
4652
+ 'hosting' => array(
4653
+ 'Hosting Company' => fs_request_has( 'hosting_company' ) ?
4654
+ fs_request_get( 'hosting_company' ) :
4655
+ 'Unknown',
4656
+ ),
4657
+ 'server_addr' => array(
4658
+ 'SERVER_ADDR',
4659
+ '<a href="http://www.projecthoneypot.org/ip_' . $server_ip . '">' . $server_ip . '</a>'
4660
+ )
4661
+ )
4662
+ ),
4663
+ 'user' => array(
4664
+ 'title' => 'User',
4665
+ 'rows' => array(
4666
+ 'email' => array( 'Email', $current_user->user_email ),
4667
+ 'first' => array( 'First', $current_user->user_firstname ),
4668
+ 'last' => array( 'Last', $current_user->user_lastname )
4669
+ )
4670
+ ),
4671
+ 'plugins' => array(
4672
+ 'title' => 'Plugins',
4673
+ 'rows' => array(
4674
+ 'active_plugins' => array( 'Active Plugins', $active_plugin_string )
4675
+ )
4676
+ ),
4677
+ 'php_info' => array(
4678
+ 'title' => 'PHP Info',
4679
+ 'rows' => array(
4680
+ 'info' => array( $php_info )
4681
+ ),
4682
+ )
4683
+ );
4684
+
4685
+ // Allow the sections to be modified by other code.
4686
+ $sections = $this->apply_filters( 'email_template_sections', $sections );
4687
+
4688
+ return $sections;
4689
+ }
4690
+
4691
+ #endregion
4692
+
4693
+ #----------------------------------------------------------------------------------
4694
+ #region Initialization
4695
+ #----------------------------------------------------------------------------------
4696
+
4697
+ /**
4698
+ * Init plugin's Freemius instance.
4699
+ *
4700
+ * @author Vova Feldman (@svovaf)
4701
+ * @since 1.0.1
4702
+ *
4703
+ * @param number $id
4704
+ * @param string $public_key
4705
+ * @param bool $is_live
4706
+ * @param bool $is_premium
4707
+ */
4708
+ function init( $id, $public_key, $is_live = true, $is_premium = true ) {
4709
+ $this->_logger->entrance();
4710
+
4711
+ $this->dynamic_init( array(
4712
+ 'id' => $id,
4713
+ 'public_key' => $public_key,
4714
+ 'is_live' => $is_live,
4715
+ 'is_premium' => $is_premium,
4716
+ ) );
4717
+ }
4718
+
4719
+ /**
4720
+ * Dynamic initiator, originally created to support initiation
4721
+ * with parent_id for add-ons.
4722
+ *
4723
+ * @author Vova Feldman (@svovaf)
4724
+ * @since 1.0.6
4725
+ *
4726
+ * @param array $plugin_info
4727
+ *
4728
+ * @throws Freemius_Exception
4729
+ */
4730
+ function dynamic_init( array $plugin_info ) {
4731
+ $this->_logger->entrance();
4732
+
4733
+ $this->parse_settings( $plugin_info );
4734
+
4735
+ $this->register_after_settings_parse_hooks();
4736
+
4737
+ if ( $this->should_stop_execution() ) {
4738
+ return;
4739
+ }
4740
+
4741
+ if ( ! $this->is_registered() ) {
4742
+ if ( $this->is_anonymous() ) {
4743
+ // If user skipped, no need to test connectivity.
4744
+ $this->_has_api_connection = true;
4745
+ $this->_is_on = true;
4746
+ } else {
4747
+ if ( ! $this->has_api_connectivity() ) {
4748
+ if ( $this->_admin_notices->has_sticky( 'failed_connect_api_first' ) ||
4749
+ $this->_admin_notices->has_sticky( 'failed_connect_api' )
4750
+ ) {
4751
+ if ( ! $this->_enable_anonymous || $this->is_premium() ) {
4752
+ // If anonymous mode is disabled, add firewall admin-notice message.
4753
+ add_action( 'admin_footer', array( 'Freemius', '_add_firewall_issues_javascript' ) );
4754
+
4755
+ $ajax_action_suffix = $this->_slug . ( $this->is_theme() ? ':theme' : '' );
4756
+ add_action( "wp_ajax_fs_resolve_firewall_issues_{$ajax_action_suffix}", array(
4757
+ &$this,
4758
+ '_email_about_firewall_issue'
4759
+ ) );
4760
+
4761
+ add_action( "wp_ajax_fs_retry_connectivity_test_{$ajax_action_suffix}", array(
4762
+ &$this,
4763
+ '_retry_connectivity_test'
4764
+ ) );
4765
+
4766
+ /**
4767
+ * Currently the admin notice manager relies on the module's type and slug. The new AJAX actions manager uses module IDs, hence, consider to replace the if block above with the commented code below after adjusting the admin notices manager to work with module IDs.
4768
+ *
4769
+ * @author Vova Feldman (@svovaf)
4770
+ * @since 2.0.0
4771
+ */
4772
+ /*$this->add_ajax_action( 'resolve_firewall_issues', array(
4773
+ &$this,
4774
+ '_email_about_firewall_issue'
4775
+ ) );
4776
+
4777
+ $this->add_ajax_action( 'retry_connectivity_test', array(
4778
+ &$this,
4779
+ '_retry_connectivity_test'
4780
+ ) );*/
4781
+ }
4782
+ }
4783
+
4784
+ return;
4785
+ } else {
4786
+ $this->_admin_notices->remove_sticky( array(
4787
+ 'failed_connect_api_first',
4788
+ 'failed_connect_api',
4789
+ ) );
4790
+
4791
+ if ( $this->_anonymous_mode ) {
4792
+ // Simulate anonymous mode.
4793
+ $this->_is_anonymous = true;
4794
+ }
4795
+ }
4796
+ }
4797
+ }
4798
+
4799
+ /**
4800
+ * This should be executed even if Freemius is off for the core module,
4801
+ * otherwise, the add-ons dialogbox won't work properly. This is esepcially
4802
+ * relevant when the developer decided to turn FS off for existing users.
4803
+ *
4804
+ * @author Vova Feldman (@svovaf)
4805
+ */
4806
+ if ( $this->is_user_in_admin() &&
4807
+ 'plugin-information' === fs_request_get( 'tab', false ) &&
4808
+ $this->should_use_freemius_updater_and_dialog() &&
4809
+ (
4810
+ ( $this->is_addon() && $this->get_slug() == fs_request_get( 'plugin', false ) ) ||
4811
+ ( $this->has_addons() && $this->get_id() == fs_request_get( 'parent_plugin_id', false ) )
4812
+ )
4813
+ ) {
4814
+ require_once WP_FS__DIR_INCLUDES . '/fs-plugin-info-dialog.php';
4815
+
4816
+ new FS_Plugin_Info_Dialog( $this->is_addon() ? $this->get_parent_instance() : $this );
4817
+ }
4818
+
4819
+ // Check if Freemius is on for the current plugin.
4820
+ // This MUST be executed after all the plugin variables has been loaded.
4821
+ if ( ! $this->is_registered() && ! $this->is_on() ) {
4822
+ return;
4823
+ }
4824
+
4825
+ if ( $this->has_api_connectivity() ) {
4826
+ if ( self::is_cron() ) {
4827
+ $this->hook_callback_to_sync_cron();
4828
+ } else if ( $this->is_user_in_admin() ) {
4829
+ /**
4830
+ * Schedule daily data sync cron if:
4831
+ *
4832
+ * 1. User opted-in (for tracking).
4833
+ * 2. If skipped, but later upgraded (opted-in via upgrade).
4834
+ *
4835
+ * @author Vova Feldman (@svovaf)
4836
+ * @since 1.1.7.3
4837
+ *
4838
+ */
4839
+ if ( $this->is_registered() ) {
4840
+ if ( ! $this->is_sync_cron_on() && $this->is_tracking_allowed() ) {
4841
+ $this->schedule_sync_cron();
4842
+ }
4843
+ }
4844
+
4845
+ /**
4846
+ * Check if requested for manual blocking background sync.
4847
+ */
4848
+ if ( fs_request_has( 'background_sync' ) ) {
4849
+ $this->run_manual_sync();
4850
+ }
4851
+ }
4852
+ }
4853
+
4854
+ if ( $this->is_registered() ) {
4855
+ $this->hook_callback_to_install_sync();
4856
+ }
4857
+
4858
+ if ( $this->is_addon() ) {
4859
+ if ( $this->is_parent_plugin_installed() ) {
4860
+ // Link to parent FS.
4861
+ $this->_parent = self::get_instance_by_id( $this->_plugin->parent_plugin_id );
4862
+
4863
+ // Get parent plugin reference.
4864
+ $this->_parent_plugin = $this->_parent->get_plugin();
4865
+ }
4866
+ }
4867
+
4868
+ if ( $this->is_user_in_admin() ) {
4869
+ if ( $this->is_addon() ) {
4870
+ if ( ! $this->is_parent_plugin_installed() ) {
4871
+ $parent_name = $this->get_option( $plugin_info, 'parent_name', null );
4872
+
4873
+ if ( isset( $plugin_info['parent'] ) ) {
4874
+ $parent_name = $this->get_option( $plugin_info['parent'], 'name', null );
4875
+ }
4876
+
4877
+ $this->_admin_notices->add(
4878
+ ( ! empty( $parent_name ) ?
4879
+ sprintf( $this->get_text_x_inline( '%s cannot run without %s.', 'addonX cannot run without pluginY', 'addon-x-cannot-run-without-y' ), $this->get_plugin_name(), $parent_name ) :
4880
+ sprintf( $this->get_text_x_inline( '%s cannot run without the plugin.', 'addonX cannot run...', 'addon-x-cannot-run-without-parent' ), $this->get_plugin_name() )
4881
+ ),
4882
+ $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
4883
+ 'error'
4884
+ );
4885
+
4886
+ return;
4887
+ } else {
4888
+ $is_network_admin = fs_is_network_admin();
4889
+
4890
+ if (
4891
+ $this->_parent->is_registered() &&
4892
+ ! $this->is_registered() &&
4893
+ $this->has_free_plan() &&
4894
+ /**
4895
+ * If not registered for add-on and the following conditions for the add-on are met, activate add-on account.
4896
+ * * Network active and in network admin - network activate add-on account.
4897
+ * * Network active and not in network admin - activate add-on account for the current blog.
4898
+ * * Not network active and not in network admin - activate add-on account for the current blog.
4899
+ *
4900
+ * If not registered for add-on, not network active, and in network admin, do not handle the add-on activation.
4901
+ *
4902
+ * @author Leo Fajardo (@leorw)
4903
+ * @since 2.3.0
4904
+ */
4905
+ ( $this->is_network_active() || ! $is_network_admin )
4906
+ ) {
4907
+ // If parent plugin activated, automatically install add-on for the user.
4908
+ $this->_activate_addon_account(
4909
+ $this->_parent,
4910
+ ( $this->is_network_active() && $is_network_admin ) ?
4911
+ true :
4912
+ get_current_blog_id()
4913
+ );
4914
+ } else if ( ! $this->_parent->is_registered() && $this->is_registered() ) {
4915
+ // If add-on activated and parent not, automatically install parent for the user.
4916
+ $this->activate_parent_account( $this->_parent );
4917
+ }
4918
+
4919
+ // @todo This should be only executed on activation. It should be migrated to register_activation_hook() together with other activation related logic.
4920
+ if ( $this->is_premium() ) {
4921
+ // Remove add-on download admin-notice.
4922
+ $this->_parent->_admin_notices->remove_sticky( array(
4923
+ 'addon_plan_upgraded_' . $this->_slug,
4924
+ 'no_addon_license_' . $this->_slug,
4925
+ ) );
4926
+ }
4927
+
4928
+ // $this->deactivate_premium_only_addon_without_license();
4929
+ }
4930
+ }
4931
+
4932
+ add_action( 'admin_init', array( &$this, '_admin_init_action' ) );
4933
+
4934
+ // if ( $this->is_registered() ||
4935
+ // $this->is_anonymous() ||
4936
+ // $this->is_pending_activation()
4937
+ // ) {
4938
+ // $this->_init_admin();
4939
+ // }
4940
+ }
4941
+
4942
+ /**
4943
+ * Should be called outside `$this->is_user_in_admin()` scope
4944
+ * because the updater has some logic that needs to be executed
4945
+ * during AJAX calls.
4946
+ *
4947
+ * Currently we need to hook to the `http_request_host_is_external` filter.
4948
+ * In the future, there might be additional logic added.
4949
+ *
4950
+ * @author Vova Feldman
4951
+ * @since 1.2.1.6
4952
+ */
4953
+ if (
4954
+ $this->should_use_freemius_updater_and_dialog() &&
4955
+ (
4956
+ $this->is_premium() ||
4957
+ /**
4958
+ * If not premium but the premium version is installed, also instantiate the updater so that the
4959
+ * plugin information dialog of the premium version will have the information from the server.
4960
+ *
4961
+ * @author Leo Fajardo (@leorw)
4962
+ * @since 2.2.3
4963
+ */
4964
+ ( file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $this->premium_plugin_basename() ) ) )
4965
+ ) &&
4966
+ $this->has_release_on_freemius()
4967
+ ) {
4968
+ FS_Plugin_Updater::instance( $this );
4969
+ }
4970
+
4971
+ $this->do_action( 'initiated' );
4972
+
4973
+ if ( $this->_storage->prev_is_premium !== $this->_plugin->is_premium ) {
4974
+ if ( isset( $this->_storage->prev_is_premium ) ) {
4975
+ $this->apply_filters(
4976
+ 'after_code_type_change',
4977
+ // New code type.
4978
+ $this->_plugin->is_premium
4979
+ );
4980
+ } else {
4981
+ // Set for code type for the first time.
4982
+ $this->_storage->prev_is_premium = $this->_plugin->is_premium;
4983
+ }
4984
+ }
4985
+
4986
+ if ( ! $this->is_addon() ) {
4987
+ if ( $this->is_registered() ) {
4988
+ // Fix for upgrade from versions < 1.0.9.
4989
+ if ( ! isset( $this->_storage->activation_timestamp ) ) {
4990
+ $this->_storage->activation_timestamp = WP_FS__SCRIPT_START_TIME;
4991
+ }
4992
+
4993
+ $this->do_action( 'after_init_plugin_registered' );
4994
+ } else if ( $this->is_anonymous() ) {
4995
+ $this->do_action( 'after_init_plugin_anonymous' );
4996
+ } else if ( $this->is_pending_activation() ) {
4997
+ $this->do_action( 'after_init_plugin_pending_activations' );
4998
+ }
4999
+ } else {
5000
+ if ( $this->is_registered() ) {
5001
+ $this->do_action( 'after_init_addon_registered' );
5002
+ } else if ( $this->is_anonymous() ) {
5003
+ $this->do_action( 'after_init_addon_anonymous' );
5004
+ } else if ( $this->is_pending_activation() ) {
5005
+ $this->do_action( 'after_init_addon_pending_activations' );
5006
+ }
5007
+ }
5008
+ }
5009
+
5010
+ /**
5011
+ * @author Leo Fajardo (@leorw)
5012
+ * @since 2.2.3
5013
+ *
5014
+ * @return bool
5015
+ */
5016
+ private function should_use_freemius_updater_and_dialog() {
5017
+ return (
5018
+ /**
5019
+ * Allow updater and dialog when the `fs_allow_updater_and_dialog` URL query param exists and has `true`
5020
+ * value, or when the current page is not the "Add Plugins" page (/plugin-install.php) and the `action`
5021
+ * URL query param doesn't exist or its value is not `install-plugin` so that there will be no conflicts
5022
+ * with the .org plugins' functionalities (e.g. installation from the "Add Plugins" page and viewing
5023
+ * plugin details from .org).
5024
+ */
5025
+ ( true === fs_request_get_bool( 'fs_allow_updater_and_dialog' ) ) ||
5026
+ (
5027
+ ! self::is_plugin_install_page() &&
5028
+ // Disallow updater and dialog when installing a plugin, otherwise .org "add-on" plugins will be affected.
5029
+ ( 'install-plugin' !== fs_request_get( 'action' ) )
5030
+ )
5031
+ );
5032
+ }
5033
+
5034
+ /**
5035
+ * @author Leo Fajardo (@leorw)
5036
+ *
5037
+ * @since 1.2.1.5
5038
+ */
5039
+ function _stop_tracking_callback() {
5040
+ $this->_logger->entrance();
5041
+
5042
+ $this->check_ajax_referer( 'stop_tracking' );
5043
+
5044
+ $result = $this->stop_tracking( fs_is_network_admin() );
5045
+
5046
+ if ( true === $result ) {
5047
+ self::shoot_ajax_success();
5048
+ }
5049
+
5050
+ $this->_logger->api_error( $result );
5051
+
5052
+ self::shoot_ajax_failure(
5053
+ sprintf( $this->get_text_inline( 'Unexpected API error. Please contact the %s\'s author with the following error.', 'unexpected-api-error' ), $this->_module_type ) .
5054
+ ( $this->is_api_error( $result ) && isset( $result->error ) ?
5055
+ $result->error->message :
5056
+ var_export( $result, true ) )
5057
+ );
5058
+ }
5059
+
5060
+ /**
5061
+ * @author Leo Fajardo (@leorw)
5062
+ * @since 1.2.1.5
5063
+ */
5064
+ function _allow_tracking_callback() {
5065
+ $this->_logger->entrance();
5066
+
5067
+ $this->check_ajax_referer( 'allow_tracking' );
5068
+
5069
+ $result = $this->allow_tracking( fs_is_network_admin() );
5070
+
5071
+ if ( true === $result ) {
5072
+ self::shoot_ajax_success();
5073
+ }
5074
+
5075
+ $this->_logger->api_error( $result );
5076
+
5077
+ self::shoot_ajax_failure(
5078
+ sprintf( $this->get_text_inline( 'Unexpected API error. Please contact the %s\'s author with the following error.', 'unexpected-api-error' ), $this->_module_type ) .
5079
+ ( $this->is_api_error( $result ) && isset( $result->error ) ?
5080
+ $result->error->message :
5081
+ var_export( $result, true ) )
5082
+ );
5083
+ }
5084
+
5085
+ /**
5086
+ * Opt-out from usage tracking.
5087
+ *
5088
+ * Note: This will not delete the account information but will stop all tracking.
5089
+ *
5090
+ * Returns:
5091
+ * 1. FALSE - If the user never opted-in.
5092
+ * 2. TRUE - If successfully opted-out.
5093
+ * 3. object - API result on failure.
5094
+ *
5095
+ * @author Leo Fajardo (@leorw)
5096
+ * @since 1.2.1.5
5097
+ *
5098
+ * @return bool|object
5099
+ */
5100
+ function stop_site_tracking() {
5101
+ $this->_logger->entrance();
5102
+
5103
+ if ( ! $this->is_registered() ) {
5104
+ // User never opted-in.
5105
+ return false;
5106
+ }
5107
+
5108
+ if ( $this->is_tracking_prohibited() ) {
5109
+ // Already disconnected.
5110
+ return true;
5111
+ }
5112
+
5113
+ // Send update to FS.
5114
+ $result = $this->get_api_site_scope()->call( '/?fields=is_disconnected', 'put', array(
5115
+ 'is_disconnected' => true
5116
+ ) );
5117
+
5118
+ if ( ! $this->is_api_result_entity( $result ) ||
5119
+ ! isset( $result->is_disconnected ) ||
5120
+ ! $result->is_disconnected
5121
+ ) {
5122
+ $this->_logger->api_error( $result );
5123
+
5124
+ return $result;
5125
+ }
5126
+
5127
+ $this->_site->is_disconnected = $result->is_disconnected;
5128
+ $this->_store_site();
5129
+
5130
+ $this->clear_sync_cron();
5131
+
5132
+ // Successfully disconnected.
5133
+ return true;
5134
+ }
5135
+
5136
+ /**
5137
+ * Opt-out network from usage tracking.
5138
+ *
5139
+ * Note: This will not delete the account information but will stop all tracking.
5140
+ *
5141
+ * Returns:
5142
+ * 1. FALSE - If the user never opted-in.
5143
+ * 2. TRUE - If successfully opted-out.
5144
+ * 3. object - API result on failure.
5145
+ *
5146
+ * @author Leo Fajardo (@leorw)
5147
+ * @since 1.2.1.5
5148
+ *
5149
+ * @return bool|object
5150
+ */
5151
+ function stop_network_tracking() {
5152
+ $this->_logger->entrance();
5153
+
5154
+ if ( ! $this->is_registered() ) {
5155
+ // User never opted-in.
5156
+ return false;
5157
+ }
5158
+
5159
+ $install_id_2_blog_id = array();
5160
+ $installs_map = $this->get_blog_install_map();
5161
+
5162
+ $opt_out_all = true;
5163
+
5164
+ $params = array();
5165
+ foreach ( $installs_map as $blog_id => $install ) {
5166
+ if ( $install->is_tracking_prohibited() ) {
5167
+ // Already opted-out.
5168
+ continue;
5169
+ }
5170
+
5171
+ if ( $this->is_site_delegated_connection( $blog_id ) ) {
5172
+ // Opt-out only from non-delegated installs.
5173
+ $opt_out_all = false;
5174
+ continue;
5175
+ }
5176
+
5177
+ $params[] = array( 'id' => $install->id );
5178
+
5179
+ $install_id_2_blog_id[ $install->id ] = $blog_id;
5180
+ }
5181
+
5182
+ if ( empty( $install_id_2_blog_id ) ) {
5183
+ return true;
5184
+ }
5185
+
5186
+ $params[] = array( 'is_disconnected' => true );
5187
+
5188
+ // Send update to FS.
5189
+ $result = $this->get_current_or_network_user_api_scope()->call( "/plugins/{$this->_module_id}/installs.json", 'put', $params );
5190
+
5191
+ if ( ! $this->is_api_result_object( $result, 'installs' ) ) {
5192
+ $this->_logger->api_error( $result );
5193
+
5194
+ return $result;
5195
+ }
5196
+
5197
+ foreach ( $result->installs as $r_install ) {
5198
+ $blog_id = $install_id_2_blog_id[ $r_install->id ];
5199
+ $install = $installs_map[ $blog_id ];
5200
+ $install->is_disconnected = $r_install->is_disconnected;
5201
+ $this->_store_site( true, $blog_id, $install );
5202
+ }
5203
+
5204
+ $this->clear_sync_cron( $opt_out_all );
5205
+
5206
+ // Successfully disconnected.
5207
+ return true;
5208
+ }
5209
+
5210
+ /**
5211
+ * Opt-out from usage tracking.
5212
+ *
5213
+ * Note: This will not delete the account information but will stop all tracking.
5214
+ *
5215
+ * Returns:
5216
+ * 1. FALSE - If the user never opted-in.
5217
+ * 2. TRUE - If successfully opted-out.
5218
+ * 3. object - API result on failure.
5219
+ *
5220
+ * @author Leo Fajardo (@leorw)
5221
+ * @since 1.2.1.5
5222
+ *
5223
+ * @param bool $is_network_action
5224
+ *
5225
+ * @return bool|object
5226
+ */
5227
+ function stop_tracking( $is_network_action = false ) {
5228
+ $this->_logger->entrance();
5229
+
5230
+ return $is_network_action ?
5231
+ $this->stop_network_tracking() :
5232
+ $this->stop_site_tracking();
5233
+ }
5234
+
5235
+ /**
5236
+ * Opt-in back into usage tracking.
5237
+ *
5238
+ * Note: This will only work if the user opted-in previously.
5239
+ *
5240
+ * Returns:
5241
+ * 1. FALSE - If the user never opted-in.
5242
+ * 2. TRUE - If successfully opted-in back to usage tracking.
5243
+ * 3. object - API result on failure.
5244
+ *
5245
+ * @author Leo Fajardo (@leorw)
5246
+ * @since 1.2.1.5
5247
+ *
5248
+ * @return bool|object
5249
+ */
5250
+ function allow_site_tracking() {
5251
+ $this->_logger->entrance();
5252
+
5253
+ if ( ! $this->is_registered() ) {
5254
+ // User never opted-in.
5255
+ return false;
5256
+ }
5257
+
5258
+ if ( $this->is_tracking_allowed() ) {
5259
+ // Tracking already allowed.
5260
+ return true;
5261
+ }
5262
+
5263
+ $result = $this->get_api_site_scope()->call( '/?is_disconnected', 'put', array(
5264
+ 'is_disconnected' => false
5265
+ ) );
5266
+
5267
+ if ( ! $this->is_api_result_entity( $result ) ||
5268
+ ! isset( $result->is_disconnected ) ||
5269
+ $result->is_disconnected
5270
+ ) {
5271
+ $this->_logger->api_error( $result );
5272
+
5273
+ return $result;
5274
+ }
5275
+
5276
+ $this->_site->is_disconnected = $result->is_disconnected;
5277
+ $this->_store_site();
5278
+
5279
+ $this->schedule_sync_cron();
5280
+
5281
+ // Successfully reconnected.
5282
+ return true;
5283
+ }
5284
+
5285
+ /**
5286
+ * Opt-in network back into usage tracking.
5287
+ *
5288
+ * Note: This will only work if the user opted-in previously.
5289
+ *
5290
+ * Returns:
5291
+ * 1. FALSE - If the user never opted-in.
5292
+ * 2. TRUE - If successfully opted-in back to usage tracking.
5293
+ * 3. object - API result on failure.
5294
+ *
5295
+ * @author Leo Fajardo (@leorw)
5296
+ * @since 1.2.1.5
5297
+ *
5298
+ * @return bool|object
5299
+ */
5300
+ function allow_network_tracking() {
5301
+ $this->_logger->entrance();
5302
+
5303
+ if ( ! $this->is_registered() ) {
5304
+ // User never opted-in.
5305
+ return false;
5306
+ }
5307
+
5308
+ $install_id_2_blog_id = array();
5309
+ $installs_map = $this->get_blog_install_map();
5310
+
5311
+ $params = array();
5312
+ foreach ( $installs_map as $blog_id => $install ) {
5313
+ if ( $install->is_tracking_allowed() ) {
5314
+ continue;
5315
+ }
5316
+
5317
+ $params[] = array( 'id' => $install->id );
5318
+
5319
+ $install_id_2_blog_id[ $install->id ] = $blog_id;
5320
+ }
5321
+
5322
+ if ( empty( $install_id_2_blog_id ) ) {
5323
+ return true;
5324
+ }
5325
+
5326
+ $params[] = array( 'is_disconnected' => false );
5327
+
5328
+ // Send update to FS.
5329
+ $result = $this->get_current_or_network_user_api_scope()->call( "/plugins/{$this->_module_id}/installs.json", 'put', $params );
5330
+
5331
+
5332
+ if ( ! $this->is_api_result_object( $result, 'installs' ) ) {
5333
+ $this->_logger->api_error( $result );
5334
+
5335
+ return $result;
5336
+ }
5337
+
5338
+ foreach ( $result->installs as $r_install ) {
5339
+ $blog_id = $install_id_2_blog_id[ $r_install->id ];
5340
+ $install = $installs_map[ $blog_id ];
5341
+ $install->is_disconnected = $r_install->is_disconnected;
5342
+ $this->_store_site( true, $blog_id, $install );
5343
+ }
5344
+
5345
+ $this->schedule_sync_cron();
5346
+
5347
+ // Successfully reconnected.
5348
+ return true;
5349
+ }
5350
+
5351
+ /**
5352
+ * Opt-in back into usage tracking.
5353
+ *
5354
+ * Note: This will only work if the user opted-in previously.
5355
+ *
5356
+ * Returns:
5357
+ * 1. FALSE - If the user never opted-in.
5358
+ * 2. TRUE - If successfully opted-in back to usage tracking.
5359
+ * 3. object - API result on failure.
5360
+ *
5361
+ * @author Leo Fajardo (@leorw)
5362
+ * @since 1.2.1.5
5363
+ *
5364
+ * @param bool $is_network_action
5365
+ *
5366
+ * @return bool|object
5367
+ */
5368
+ function allow_tracking( $is_network_action = false ) {
5369
+ $this->_logger->entrance();
5370
+
5371
+ return $is_network_action ?
5372
+ $this->allow_network_tracking() :
5373
+ $this->allow_site_tracking();
5374
+ }
5375
+
5376
+ /**
5377
+ * If user opted-in and later disabled usage-tracking,
5378
+ * re-allow tracking for licensing and updates.
5379
+ *
5380
+ * @author Leo Fajardo (@leorw)
5381
+ * @since 1.2.1.5
5382
+ *
5383
+ * @param bool $is_context_single_site
5384
+ */
5385
+ private function reconnect_locally( $is_context_single_site = false ) {
5386
+ $this->_logger->entrance();
5387
+
5388
+ if ( ! $this->is_registered() ) {
5389
+ return;
5390
+ }
5391
+
5392
+ if ( ! fs_is_network_admin() || $is_context_single_site ) {
5393
+ if ( $this->is_tracking_prohibited() ) {
5394
+ $this->_site->is_disconnected = false;
5395
+ $this->_store_site();
5396
+ }
5397
+ } else {
5398
+ $installs_map = $this->get_blog_install_map();
5399
+ foreach ( $installs_map as $blog_id => $install ) {
5400
+ /**
5401
+ * @var FS_Site $install
5402
+ */
5403
+ if ( $install->is_tracking_prohibited() ) {
5404
+ $install->is_disconnected = false;
5405
+ $this->_store_site( true, $blog_id, $install );
5406
+ }
5407
+ }
5408
+ }
5409
+ }
5410
+
5411
+ /**
5412
+ * @author Vova Feldman (@svovaf)
5413
+ * @since 2.3.2
5414
+ *
5415
+ * @return bool
5416
+ */
5417
+ function is_extensions_tracking_allowed() {
5418
+ return (true === $this->_storage->get( 'is_extensions_tracking_allowed', true ) );
5419
+ }
5420
+
5421
+ /**
5422
+ * @author Vova Feldman (@svovaf)
5423
+ * @since 2.3.2
5424
+ */
5425
+ function _update_tracking_permission_callback() {
5426
+ $this->_logger->entrance();
5427
+
5428
+ $this->check_ajax_referer( 'update_tracking_permission' );
5429
+
5430
+ $is_enabled = fs_request_get_bool( 'is_enabled', null );
5431
+
5432
+ if ( ! is_bool( $is_enabled ) ) {
5433
+ self::shoot_ajax_failure();
5434
+ }
5435
+
5436
+ $permission = fs_request_get( 'permission' );
5437
+
5438
+ switch ( $permission ) {
5439
+ case 'extensions':
5440
+ $this->update_extensions_tracking_flag( $is_enabled );
5441
+ break;
5442
+ default:
5443
+ $permission = 'no_match';
5444
+ }
5445
+
5446
+ if ( 'no_match' === $permission ) {
5447
+ self::shoot_ajax_failure();
5448
+ }
5449
+
5450
+ self::shoot_ajax_success( array(
5451
+ 'permissions' => array(
5452
+ $permission => $is_enabled,
5453
+ )
5454
+ ) );
5455
+ }
5456
+
5457
+ /**
5458
+ * @author Leo Fajardo (@leorw)
5459
+ * @since 2.3.2
5460
+ *
5461
+ * @param bool $is_enabled
5462
+ */
5463
+ private function update_extensions_tracking_flag( $is_enabled ) {
5464
+ $this->_storage->store( 'is_extensions_tracking_allowed', $is_enabled );
5465
+ }
5466
+
5467
+ /**
5468
+ * Parse plugin's settings (as defined by the plugin dev).
5469
+ *
5470
+ * @author Vova Feldman (@svovaf)
5471
+ * @since 1.1.7.3
5472
+ *
5473
+ * @param array $plugin_info
5474
+ *
5475
+ * @throws \Freemius_Exception
5476
+ */
5477
+ private function parse_settings( &$plugin_info ) {
5478
+ $this->_logger->entrance();
5479
+
5480
+ $id = $this->get_numeric_option( $plugin_info, 'id', false );
5481
+ $public_key = $this->get_option( $plugin_info, 'public_key', false );
5482
+ $secret_key = $this->get_option( $plugin_info, 'secret_key', null );
5483
+ $parent_id = $this->get_numeric_option( $plugin_info, 'parent_id', null );
5484
+ $parent_name = $this->get_option( $plugin_info, 'parent_name', null );
5485
+
5486
+ /**
5487
+ * @author Vova Feldman (@svovaf)
5488
+ * @since 1.1.9 Try to pull secret key from external config.
5489
+ */
5490
+ if ( is_null( $secret_key ) && defined( "WP_FS__{$this->_slug}_SECRET_KEY" ) ) {
5491
+ $secret_key = constant( "WP_FS__{$this->_slug}_SECRET_KEY" );
5492
+ }
5493
+
5494
+ if ( isset( $plugin_info['parent'] ) ) {
5495
+ $parent_id = $this->get_numeric_option( $plugin_info['parent'], 'id', null );
5496
+ // $parent_slug = $this->get_option( $plugin_info['parent'], 'slug', null );
5497
+ // $parent_public_key = $this->get_option( $plugin_info['parent'], 'public_key', null );
5498
+ // $parent_name = $this->get_option( $plugin_info['parent'], 'name', null );
5499
+ }
5500
+
5501
+ if ( false === $id ) {
5502
+ throw new Freemius_Exception( array(
5503
+ 'error' => array(
5504
+ 'type' => 'ParameterNotSet',
5505
+ 'message' => 'Plugin id parameter is not set.',
5506
+ 'code' => 'plugin_id_not_set',
5507
+ 'http' => 500,
5508
+ )
5509
+ ) );
5510
+ }
5511
+ if ( false === $public_key ) {
5512
+ throw new Freemius_Exception( array(
5513
+ 'error' => array(
5514
+ 'type' => 'ParameterNotSet',
5515
+ 'message' => 'Plugin public_key parameter is not set.',
5516
+ 'code' => 'plugin_public_key_not_set',
5517
+ 'http' => 500,
5518
+ )
5519
+ ) );
5520
+ }
5521
+
5522
+ $plugin = ( $this->_plugin instanceof FS_Plugin ) ?
5523
+ $this->_plugin :
5524
+ new FS_Plugin();
5525
+
5526
+ $premium_suffix = $this->get_option( $plugin_info, 'premium_suffix', '(Premium)' );
5527
+
5528
+ $plugin->update( array(
5529
+ 'id' => $id,
5530
+ 'type' => $this->get_option( $plugin_info, 'type', $this->_module_type ),
5531
+ 'public_key' => $public_key,
5532
+ 'slug' => $this->_slug,
5533
+ 'premium_slug' => $this->get_option( $plugin_info, 'premium_slug', "{$this->_slug}-premium" ),
5534
+ 'parent_plugin_id' => $parent_id,
5535
+ 'version' => $this->get_plugin_version(),
5536
+ 'title' => $this->get_plugin_name( $premium_suffix ),
5537
+ 'file' => $this->_plugin_basename,
5538
+ 'is_premium' => $this->get_bool_option( $plugin_info, 'is_premium', true ),
5539
+ 'premium_suffix' => $premium_suffix,
5540
+ 'is_live' => $this->get_bool_option( $plugin_info, 'is_live', true ),
5541
+ 'affiliate_moderation' => $this->get_option( $plugin_info, 'has_affiliation' ),
5542
+ 'bundle_id' => $this->get_option( $plugin_info, 'bundle_id', null ),
5543
+ 'bundle_public_key' => $this->get_option( $plugin_info, 'bundle_public_key', null ),
5544
+ ) );
5545
+
5546
+ if ( $plugin->is_updated() ) {
5547
+ // Update plugin details.
5548
+ $this->_plugin = FS_Plugin_Manager::instance( $this->_module_id )->store( $plugin );
5549
+ }
5550
+ // Set the secret key after storing the plugin, we don't want to store the key in the storage.
5551
+ $this->_plugin->secret_key = $secret_key;
5552
+
5553
+ /**
5554
+ * If the product is network integrated and activated and the current view is in the network level Admin dashboard, if the product's network-level menu located differently from the sub-site level, then use the network menu details (when set).
5555
+ *
5556
+ * @author Vova Feldman
5557
+ * @since 2.4.5
5558
+ */
5559
+ if ( $this->is_network_active() && fs_is_network_admin() ) {
5560
+ if ( isset( $plugin_info['menu_network'] ) &&
5561
+ is_array( $plugin_info['menu_network'] ) &&
5562
+ ! empty( $plugin_info['menu_network'] )
5563
+ ) {
5564
+ $plugin_info['menu'] = $plugin_info['menu_network'];
5565
+ }
5566
+ }
5567
+
5568
+ if ( ! isset( $plugin_info['menu'] ) ) {
5569
+ $plugin_info['menu'] = array();
5570
+
5571
+ if ( ! empty( $this->_storage->sdk_last_version ) &&
5572
+ version_compare( $this->_storage->sdk_last_version, '1.1.2', '<=' )
5573
+ ) {
5574
+ // Backward compatibility to 1.1.2
5575
+ $plugin_info['menu']['slug'] = isset( $plugin_info['menu_slug'] ) ?
5576
+ $plugin_info['menu_slug'] :
5577
+ $this->_slug;
5578
+ }
5579
+ }
5580
+
5581
+ $this->_menu = FS_Admin_Menu_Manager::instance(
5582
+ $this->_module_id,
5583
+ $this->_module_type,
5584
+ $this->get_unique_affix()
5585
+ );
5586
+
5587
+ $this->_menu->init( $plugin_info['menu'], $this->is_addon() );
5588
+
5589
+ $this->_has_addons = $this->get_bool_option( $plugin_info, 'has_addons', false );
5590
+ $this->_has_paid_plans = $this->get_bool_option( $plugin_info, 'has_paid_plans', true );
5591
+ $this->_has_premium_version = $this->get_bool_option( $plugin_info, 'has_premium_version', $this->_has_paid_plans );
5592
+ $this->_ignore_pending_mode = $this->get_bool_option( $plugin_info, 'ignore_pending_mode', false );
5593
+ $this->_is_org_compliant = $this->get_bool_option( $plugin_info, 'is_org_compliant', true );
5594
+ $this->_is_premium_only = $this->get_bool_option( $plugin_info, 'is_premium_only', false );
5595
+ if ( $this->_is_premium_only ) {
5596
+ // If premium only plugin, disable anonymous mode.
5597
+ $this->_enable_anonymous = false;
5598
+ $this->_anonymous_mode = false;
5599
+ } else {
5600
+ $this->_enable_anonymous = $this->get_bool_option( $plugin_info, 'enable_anonymous', true );
5601
+ $this->_anonymous_mode = $this->get_bool_option( $plugin_info, 'anonymous_mode', false );
5602
+ }
5603
+ $this->_permissions = $this->get_option( $plugin_info, 'permissions', array() );
5604
+
5605
+ if ( ! empty( $plugin_info['trial'] ) ) {
5606
+ $this->_trial_days = $this->get_numeric_option(
5607
+ $plugin_info['trial'],
5608
+ 'days',
5609
+ // Default to 0 - trial without days specification.
5610
+ 0
5611
+ );
5612
+
5613
+ $this->_is_trial_require_payment = $this->get_bool_option( $plugin_info['trial'], 'is_require_payment', false );
5614
+ }
5615
+
5616
+ $this->_navigation = $this->get_option(
5617
+ $plugin_info,
5618
+ 'navigation',
5619
+ $this->is_free_wp_org_theme() ?
5620
+ self::NAVIGATION_TABS :
5621
+ self::NAVIGATION_MENU
5622
+ );
5623
+ }
5624
+
5625
+ /**
5626
+ * @param string[] $options
5627
+ * @param string $key
5628
+ * @param mixed $default
5629
+ *
5630
+ * @return bool
5631
+ */
5632
+ private function get_option( &$options, $key, $default = false ) {
5633
+ return ! empty( $options[ $key ] ) ? $options[ $key ] : $default;
5634
+ }
5635
+
5636
+ private function get_bool_option( &$options, $key, $default = false ) {
5637
+ return isset( $options[ $key ] ) && is_bool( $options[ $key ] ) ? $options[ $key ] : $default;
5638
+ }
5639
+
5640
+ private function get_numeric_option( &$options, $key, $default = false ) {
5641
+ return isset( $options[ $key ] ) && is_numeric( $options[ $key ] ) ? $options[ $key ] : $default;
5642
+ }
5643
+
5644
+ /**
5645
+ * Gate keeper.
5646
+ *
5647
+ * @author Vova Feldman (@svovaf)
5648
+ * @since 1.1.7.3
5649
+ *
5650
+ * @return bool
5651
+ */
5652
+ private function should_stop_execution() {
5653
+ if ( empty( $this->_storage->was_plugin_loaded ) ) {
5654
+ /**
5655
+ * Don't execute Freemius until plugin was fully loaded at least once,
5656
+ * to give the opportunity for the activation hook to run before pinging
5657
+ * the API for connectivity test. This logic is relevant for the
5658
+ * identification of new plugin install vs. plugin update.
5659
+ *
5660
+ * @author Vova Feldman (@svovaf)
5661
+ * @since 1.1.9
5662
+ */
5663
+ return true;
5664
+ }
5665
+
5666
+ if ( $this->is_activation_mode() ) {
5667
+ if ( ! is_admin() ) {
5668
+ /**
5669
+ * If in activation mode, don't execute Freemius outside of the
5670
+ * admin dashboard.
5671
+ *
5672
+ * @author Vova Feldman (@svovaf)
5673
+ * @since 1.1.7.3
5674
+ */
5675
+ return true;
5676
+ }
5677
+
5678
+ if ( ! WP_FS__IS_HTTP_REQUEST ) {
5679
+ /**
5680
+ * If in activation and executed without HTTP context (e.g. CLI, Cronjob),
5681
+ * then don't start Freemius.
5682
+ *
5683
+ * @author Vova Feldman (@svovaf)
5684
+ * @since 1.1.6.3
5685
+ *
5686
+ * @link https://wordpress.org/support/topic/errors-in-the-freemius-class-when-running-in-wordpress-in-cli
5687
+ */
5688
+ return true;
5689
+ }
5690
+
5691
+ if ( self::is_cron() ) {
5692
+ /**
5693
+ * If in activation mode, don't execute Freemius during wp crons
5694
+ * (wp crons have HTTP context - called as HTTP request).
5695
+ *
5696
+ * @author Vova Feldman (@svovaf)
5697
+ * @since 1.1.7.3
5698
+ */
5699
+ return true;
5700
+ }
5701
+
5702
+ if ( self::is_ajax() &&
5703
+ ! $this->_admin_notices->has_sticky( 'failed_connect_api_first' ) &&
5704
+ ! $this->_admin_notices->has_sticky( 'failed_connect_api' )
5705
+ ) {
5706
+ /**
5707
+ * During activation, if running in AJAX mode, unless there's a sticky
5708
+ * connectivity issue notice, don't run Freemius.
5709
+ *
5710
+ * @author Vova Feldman (@svovaf)
5711
+ * @since 1.1.7.3
5712
+ */
5713
+ return true;
5714
+ }
5715
+ }
5716
+
5717
+ return false;
5718
+ }
5719
+
5720
+ /**
5721
+ * Triggered after code type has changed.
5722
+ *
5723
+ * @author Vova Feldman (@svovaf)
5724
+ * @since 1.1.9.1
5725
+ */
5726
+ function _after_code_type_change() {
5727
+ $this->_logger->entrance();
5728
+
5729
+ if ( $this->is_theme() ) {
5730
+ // Expire the cache of the previous tabs since the theme may
5731
+ // have setting updates after code type has changed.
5732
+ $this->_cache->expire( 'tabs' );
5733
+ $this->_cache->expire( 'tabs_stylesheets' );
5734
+ }
5735
+
5736
+ if ( $this->is_registered() ) {
5737
+ if ( ! $this->is_addon() ) {
5738
+ add_action(
5739
+ is_admin() ? 'admin_init' : 'init',
5740
+ array( &$this, '_plugin_code_type_changed' )
5741
+ );
5742
+ }
5743
+
5744
+ if ( $this->is_premium() ) {
5745
+ // Purge cached payments after switching to the premium version.
5746
+ // @todo This logic doesn't handle purging the cache for serviceware module upgrade.
5747
+ $this->get_api_user_scope()->purge_cache( "/plugins/{$this->_module_id}/payments.json?include_addons=true" );
5748
+ }
5749
+ }
5750
+ }
5751
+
5752
+ /**
5753
+ * Handles plugin's code type change (free <--> premium).
5754
+ *
5755
+ * @author Vova Feldman (@svovaf)
5756
+ * @since 1.0.9
5757
+ */
5758
+ function _plugin_code_type_changed() {
5759
+ $this->_logger->entrance();
5760
+
5761
+ if ( $this->is_premium() ) {
5762
+ $this->reconnect_locally();
5763
+
5764
+ // Activated premium code.
5765
+ $this->do_action( 'after_premium_version_activation' );
5766
+
5767
+ // Remove all sticky messages related to download of the premium version.
5768
+ $this->_admin_notices->remove_sticky( array(
5769
+ 'trial_started',
5770
+ 'plan_upgraded',
5771
+ 'plan_changed',
5772
+ 'license_activated',
5773
+ ) );
5774
+
5775
+ $notice = '';
5776
+ if ( ! $this->is_only_premium() ) {
5777
+ $notice = sprintf( $this->get_text_inline( 'Premium %s version was successfully activated.', 'premium-activated-message' ), $this->_module_type );
5778
+ }
5779
+
5780
+ $license_notice = $this->get_license_network_activation_notice();
5781
+ if ( ! empty( $license_notice ) ) {
5782
+ $notice .= ' ' . $license_notice;
5783
+ }
5784
+
5785
+ if ( ! empty( $notice ) ) {
5786
+ $this->_admin_notices->add_sticky(
5787
+ trim( $notice ),
5788
+ 'premium_activated',
5789
+ $this->get_text_x_inline( 'W00t',
5790
+ 'Used to express elation, enthusiasm, or triumph (especially in electronic communication).', 'woot' ) . '!'
5791
+ );
5792
+ }
5793
+ } else {
5794
+ // Remove sticky message related to premium code activation.
5795
+ $this->_admin_notices->remove_sticky( 'premium_activated' );
5796
+
5797
+ // Activated free code (after had the premium before).
5798
+ $this->do_action( 'after_free_version_reactivation' );
5799
+
5800
+ if ( $this->is_paying() && ! $this->is_premium() ) {
5801
+ $this->_admin_notices->add_sticky(
5802
+ sprintf(
5803
+ /* translators: %s: License type (e.g. you have a professional license) */
5804
+ $this->get_text_inline( 'You have a %s license.', 'you-have-x-license' ),
5805
+ $this->get_plan_title()
5806
+ ) . $this->get_complete_upgrade_instructions(),
5807
+ 'plan_upgraded',
5808
+ $this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!'
5809
+ );
5810
+ }
5811
+ }
5812
+
5813
+ // Schedule code type changes event.
5814
+ $this->schedule_install_sync();
5815
+
5816
+ /**
5817
+ * Unregister the uninstall hook for the other version of the plugin (with different code type) to avoid
5818
+ * triggering a fatal error when uninstalling that plugin. For example, after deactivating the "free" version
5819
+ * of a specific plugin, its uninstall hook should be unregistered after the "premium" version has been
5820
+ * activated. If we don't do that, a fatal error will occur when we try to uninstall the "free" version since
5821
+ * the main file of the "free" version will be loaded first before calling the hooked callback. Since the
5822
+ * free and premium versions are almost identical (same class or have same functions), a fatal error like
5823
+ * "Cannot redeclare class MyClass" or "Cannot redeclare my_function()" will occur.
5824
+ */
5825
+ $this->unregister_uninstall_hook();
5826
+
5827
+ $this->clear_module_main_file_cache();
5828
+
5829
+ // Update is_premium of latest version.
5830
+ $this->_storage->prev_is_premium = $this->_plugin->is_premium;
5831
+ }
5832
+
5833
+ #endregion
5834
+
5835
+ #----------------------------------------------------------------------------------
5836
+ #region Add-ons
5837
+ #----------------------------------------------------------------------------------
5838
+
5839
+ /**
5840
+ * Check if add-on installed and activated on site.
5841
+ *
5842
+ * @author Vova Feldman (@svovaf)
5843
+ * @since 1.0.6
5844
+ *
5845
+ * @param string|number $id_or_slug
5846
+ * @param bool|null $is_premium Since 1.2.1.7 can check for specified add-on version.
5847
+ *
5848
+ * @return bool
5849
+ */
5850
+ function is_addon_activated( $id_or_slug, $is_premium = null ) {
5851
+ $this->_logger->entrance();
5852
+
5853
+ $addon_id = self::get_module_id( $id_or_slug );
5854
+ $is_activated = self::has_instance( $addon_id );
5855
+
5856
+ if ( ! $is_activated ) {
5857
+ return false;
5858
+ }
5859
+
5860
+ if ( is_bool( $is_premium ) ) {
5861
+ // Check if the specified code version is activate.
5862
+ $addon = $this->get_addon_instance( $addon_id );
5863
+ $is_activated = ( $is_premium === $addon->is_premium() );
5864
+ }
5865
+
5866
+ return $is_activated;
5867
+ }
5868
+
5869
+ /**
5870
+ * Check if add-on was connected to install
5871
+ *
5872
+ * @author Vova Feldman (@svovaf)
5873
+ * @since 1.1.7
5874
+ *
5875
+ * @param string|number $id_or_slug
5876
+ *
5877
+ * @return bool
5878
+ */
5879
+ function is_addon_connected( $id_or_slug ) {
5880
+ $this->_logger->entrance();
5881
+
5882
+ $sites = self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN );
5883
+
5884
+ $addon_id = self::get_module_id( $id_or_slug );
5885
+ $addon = $this->get_addon( $addon_id );
5886
+ $slug = $addon->slug;
5887
+ if ( ! isset( $sites[ $slug ] ) ) {
5888
+ return false;
5889
+ }
5890
+
5891
+ $site = $sites[ $slug ];
5892
+
5893
+ $plugin = FS_Plugin_Manager::instance( $addon_id )->get();
5894
+
5895
+ if ( $plugin->parent_plugin_id != $this->_plugin->id ) {
5896
+ // The given slug do NOT belong to any of the plugin's add-ons.
5897
+ return false;
5898
+ }
5899
+
5900
+ return ( is_object( $site ) &&
5901
+ is_numeric( $site->id ) &&
5902
+ is_numeric( $site->user_id ) &&
5903
+ FS_Plugin_Plan::is_valid_id( $site->plan_id )
5904
+ );
5905
+ }
5906
+
5907
+ /**
5908
+ * Determines if add-on installed.
5909
+ *
5910
+ * NOTE: This is a heuristic and only works if the folder/file named as the slug.
5911
+ *
5912
+ * @author Vova Feldman (@svovaf)
5913
+ * @since 1.0.6
5914
+ *
5915
+ * @param string|number $id_or_slug
5916
+ *
5917
+ * @return bool
5918
+ */
5919
+ function is_addon_installed( $id_or_slug ) {
5920
+ $this->_logger->entrance();
5921
+
5922
+ $addon_id = self::get_module_id( $id_or_slug );
5923
+
5924
+ return file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $this->get_addon_basename( $addon_id ) ) );
5925
+ }
5926
+
5927
+ /**
5928
+ * Get add-on basename.
5929
+ *
5930
+ * @author Vova Feldman (@svovaf)
5931
+ * @since 1.0.6
5932
+ *
5933
+ * @param string|number $id_or_slug
5934
+ *
5935
+ * @return string
5936
+ */
5937
+ function get_addon_basename( $id_or_slug ) {
5938
+ $addon_id = self::get_module_id( $id_or_slug );
5939
+
5940
+ if ( $this->is_addon_activated( $addon_id ) ) {
5941
+ return self::instance( $addon_id )->get_plugin_basename();
5942
+ }
5943
+
5944
+ $addon = $this->get_addon( $addon_id );
5945
+ $premium_basename = "{$addon->premium_slug}/{$addon->slug}.php";
5946
+
5947
+ if ( file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $premium_basename ) ) ) {
5948
+ return $premium_basename;
5949
+ }
5950
+
5951
+ $all_plugins = $this->get_all_plugins();
5952
+
5953
+ foreach ( $all_plugins as $basename => $data ) {
5954
+ if ( $addon->slug === $data['slug'] ||
5955
+ $addon->premium_slug === $data['slug']
5956
+ ) {
5957
+ return $basename;
5958
+ }
5959
+ }
5960
+
5961
+ $free_basename = "{$addon->slug}/{$addon->slug}.php";
5962
+
5963
+ return $free_basename;
5964
+ }
5965
+
5966
+ /**
5967
+ * Get installed add-ons instances.
5968
+ *
5969
+ * @author Vova Feldman (@svovaf)
5970
+ * @since 1.0.6
5971
+ *
5972
+ * @return Freemius[]
5973
+ */
5974
+ function get_installed_addons() {
5975
+ if ( $this->is_addon() ) {
5976
+ // Add-on cannot have add-ons.
5977
+ return array();
5978
+ }
5979
+
5980
+ $installed_addons = array();
5981
+
5982
+ foreach ( self::$_instances as $instance ) {
5983
+ if ( $instance->is_addon_of( $this->_plugin->id ) ) {
5984
+ $installed_addons[] = $instance;
5985
+ }
5986
+ }
5987
+
5988
+ return $installed_addons;
5989
+ }
5990
+
5991
+ /**
5992
+ * Check if any add-ons of the plugin are installed.
5993
+ *
5994
+ * @author Leo Fajardo (@leorw)
5995
+ * @since 1.1.1
5996
+ *
5997
+ * @return bool
5998
+ */
5999
+ function has_installed_addons() {
6000
+ if ( ! $this->has_addons() ) {
6001
+ return false;
6002
+ }
6003
+
6004
+ foreach ( self::$_instances as $instance ) {
6005
+ if ( $instance->is_addon() && is_object( $instance->_parent_plugin ) ) {
6006
+ if ( $this->_plugin->id == $instance->_parent_plugin->id ) {
6007
+ return true;
6008
+ }
6009
+ }
6010
+ }
6011
+
6012
+ return false;
6013
+ }
6014
+
6015
+ /**
6016
+ * Tell Freemius that the current plugin is an add-on.
6017
+ *
6018
+ * @author Vova Feldman (@svovaf)
6019
+ * @since 1.0.6
6020
+ *
6021
+ * @param number $parent_plugin_id The parent plugin ID
6022
+ */
6023
+ function init_addon( $parent_plugin_id ) {
6024
+ $this->_plugin->parent_plugin_id = $parent_plugin_id;
6025
+ }
6026
+
6027
+ /**
6028
+ * @author Vova Feldman (@svovaf)
6029
+ * @since 1.0.6
6030
+ *
6031
+ * @return bool
6032
+ */
6033
+ function is_addon() {
6034
+ return (
6035
+ isset( $this->_plugin->parent_plugin_id ) &&
6036
+ is_numeric( $this->_plugin->parent_plugin_id )
6037
+ );
6038
+ }
6039
+
6040
+ /**
6041
+ * @author Vova Feldman (@svovaf)
6042
+ * @since 2.3.2
6043
+ *
6044
+ * @param number $parent_product_id
6045
+ *
6046
+ * @return bool
6047
+ */
6048
+ function is_addon_of( $parent_product_id ) {
6049
+ return (
6050
+ $this->is_addon() &&
6051
+ $parent_product_id == $this->_plugin->parent_plugin_id
6052
+ );
6053
+ }
6054
+
6055
+ /**
6056
+ * Deactivate add-on if it's premium only and the user does't have a valid license.
6057
+ *
6058
+ * @param bool $is_after_trial_cancel
6059
+ *
6060
+ * @return bool If add-on was deactivated.
6061
+ */
6062
+ private function deactivate_premium_only_addon_without_license( $is_after_trial_cancel = false ) {
6063
+ if ( ! $this->has_free_plan() &&
6064
+ ! $this->has_features_enabled_license() &&
6065
+ ! $this->_has_premium_license()
6066
+ ) {
6067
+ if ( $this->is_registered() ) {
6068
+ // IF wrapper is turned off because activation_timestamp is currently only stored for plugins (not addons).
6069
+ // if (empty($this->_storage->activation_timestamp) ||
6070
+ // (WP_FS__SCRIPT_START_TIME - $this->_storage->activation_timestamp) > 30
6071
+ // ) {
6072
+ /**
6073
+ * @todo When it's first fail, there's no reason to try and re-sync because the licenses were just synced after initial activation.
6074
+ *
6075
+ * Retry syncing the user add-on licenses.
6076
+ */
6077
+ // Sync licenses.
6078
+ $this->_sync_licenses();
6079
+ // }
6080
+
6081
+ // Try to activate premium license.
6082
+ $this->_activate_license( true );
6083
+ }
6084
+
6085
+ if ( ! $this->has_free_plan() &&
6086
+ ! $this->has_features_enabled_license() &&
6087
+ ! $this->_has_premium_license()
6088
+ ) {
6089
+ // @todo Check if deactivate plugins also call the deactivation hook.
6090
+
6091
+ $this->_parent->_admin_notices->add_sticky(
6092
+ sprintf(
6093
+ ( $is_after_trial_cancel ?
6094
+ $this->_parent->get_text_inline(
6095
+ '%s free trial was successfully cancelled. Since the add-on is premium only it was automatically deactivated. If you like to use it in the future, you\'ll have to purchase a license.',
6096
+ 'addon-trial-cancelled-message'
6097
+ ) :
6098
+ $this->_parent->get_text_inline(
6099
+ '%s is a premium only add-on. You have to purchase a license first before activating the plugin.',
6100
+ 'addon-no-license-message'
6101
+ )
6102
+ ),
6103
+ '<b>' . $this->_plugin->title . '</b>'
6104
+ ) . ' ' . sprintf(
6105
+ '<a href="%s" aria-label="%s" class="button button-primary" style="margin-left: 10px; vertical-align: middle;">%s &nbsp;&#10140;</a>',
6106
+ $this->_parent->addon_url( $this->_slug ),
6107
+ esc_attr( sprintf( $this->_parent->get_text_inline( 'More information about %s', 'more-information-about-x' ), $this->_plugin->title ) ),
6108
+ $this->_parent->get_text_inline( 'Purchase License', 'purchase-license' )
6109
+ ),
6110
+ 'no_addon_license_' . $this->_slug,
6111
+ ( $is_after_trial_cancel ? '' : $this->_parent->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...' ),
6112
+ ( $is_after_trial_cancel ? 'success' : 'error' )
6113
+ );
6114
+
6115
+ deactivate_plugins( array( $this->_plugin_basename ), true );
6116
+
6117
+ return true;
6118
+ }
6119
+ }
6120
+
6121
+ return false;
6122
+ }
6123
+
6124
+ #endregion
6125
+
6126
+ #----------------------------------------------------------------------------------
6127
+ #region Sandbox
6128
+ #----------------------------------------------------------------------------------
6129
+
6130
+ /**
6131
+ * Set Freemius into sandbox mode for debugging.
6132
+ *
6133
+ * @author Vova Feldman (@svovaf)
6134
+ * @since 1.0.4
6135
+ *
6136
+ * @param string $secret_key
6137
+ */
6138
+ function init_sandbox( $secret_key ) {
6139
+ $this->_plugin->secret_key = $secret_key;
6140
+
6141
+ // Update plugin details.
6142
+ FS_Plugin_Manager::instance( $this->_module_id )->update( $this->_plugin, true );
6143
+ }
6144
+
6145
+ /**
6146
+ * Check if running payments in sandbox mode.
6147
+ *
6148
+ * @author Vova Feldman (@svovaf)
6149
+ * @since 1.0.4
6150
+ *
6151
+ * @return bool
6152
+ */
6153
+ function is_payments_sandbox() {
6154
+ return ( ! $this->is_live() ) || isset( $this->_plugin->secret_key );
6155
+ }
6156
+
6157
+ #endregion
6158
+
6159
+ /**
6160
+ * Check if running test vs. live plugin.
6161
+ *
6162
+ * @author Vova Feldman (@svovaf)
6163
+ * @since 1.0.5
6164
+ *
6165
+ * @return bool
6166
+ */
6167
+ function is_live() {
6168
+ return $this->_plugin->is_live;
6169
+ }
6170
+
6171
+ /**
6172
+ * Check if super-admin skipped connection for all sites in the network.
6173
+ *
6174
+ * @author Vova Feldman (@svovaf)
6175
+ * @since 2.0.0
6176
+ */
6177
+ function is_network_anonymous() {
6178
+ if ( ! $this->_is_network_active ) {
6179
+ return false;
6180
+ }
6181
+
6182
+ $is_anonymous_ms = $this->_storage->get( 'is_anonymous_ms' );
6183
+
6184
+ if ( empty( $is_anonymous_ms ) ) {
6185
+ return false;
6186
+ }
6187
+
6188
+ return $is_anonymous_ms['is'];
6189
+ }
6190
+
6191
+ /**
6192
+ * Check if super-admin opted-in for all sites in the network.
6193
+ *
6194
+ * @author Vova Feldman (@svovaf)
6195
+ * @since 2.0.0
6196
+ */
6197
+ function is_network_connected() {
6198
+ if ( ! $this->_is_network_active ) {
6199
+ return false;
6200
+ }
6201
+
6202
+ return $this->_storage->get( 'is_network_connected' );
6203
+ }
6204
+
6205
+ /**
6206
+ * Check if the user skipped connecting the account with Freemius.
6207
+ *
6208
+ * @author Vova Feldman (@svovaf)
6209
+ * @since 1.0.7
6210
+ *
6211
+ * @return bool
6212
+ */
6213
+ function is_anonymous() {
6214
+ if ( ! isset( $this->_is_anonymous ) ) {
6215
+ if ( $this->is_network_anonymous() ) {
6216
+ $this->_is_anonymous = true;
6217
+ } else if ( ! fs_is_network_admin() ) {
6218
+ if ( ! isset( $this->_storage->is_anonymous ) ) {
6219
+ // Not skipped.
6220
+ $this->_is_anonymous = false;
6221
+ } else if ( is_bool( $this->_storage->is_anonymous ) ) {
6222
+ // For back compatibility, since the variable was boolean before.
6223
+ $this->_is_anonymous = $this->_storage->is_anonymous;
6224
+
6225
+ // Upgrade stored data format to 1.1.3 format.
6226
+ $this->set_anonymous_mode( $this->_storage->is_anonymous );
6227
+ } else {
6228
+ // Version 1.1.3 and later.
6229
+ $this->_is_anonymous = $this->_storage->is_anonymous['is'];
6230
+ }
6231
+ }
6232
+ }
6233
+
6234
+ return $this->_is_anonymous;
6235
+ }
6236
+
6237
+ /**
6238
+ * Check if the user skipped the connection of a specified site.
6239
+ *
6240
+ * @author Vova Feldman (@svovaf)
6241
+ * @since 2.0.0
6242
+ *
6243
+ * @param int $blog_id
6244
+ *
6245
+ * @return bool
6246
+ */
6247
+ function is_anonymous_site( $blog_id = 0 ) {
6248
+ if ( $this->is_network_anonymous() ) {
6249
+ return true;
6250
+ }
6251
+
6252
+ $is_anonymous = $this->_storage->get( 'is_anonymous', false, $blog_id );
6253
+
6254
+ if ( empty( $is_anonymous ) ) {
6255
+ return false;
6256
+ }
6257
+
6258
+ return $is_anonymous['is'];
6259
+ }
6260
+
6261
+ /**
6262
+ * Check if user connected his account and install pending email activation.
6263
+ *
6264
+ * @author Vova Feldman (@svovaf)
6265
+ * @since 1.0.7
6266
+ *
6267
+ * @return bool
6268
+ */
6269
+ function is_pending_activation() {
6270
+ return $this->_storage->get( 'is_pending_activation', false );
6271
+ }
6272
+
6273
+ /**
6274
+ * Check if plugin must be WordPress.org compliant.
6275
+ *
6276
+ * @since 1.0.7
6277
+ *
6278
+ * @return bool
6279
+ */
6280
+ function is_org_repo_compliant() {
6281
+ return $this->_is_org_compliant;
6282
+ }
6283
+
6284
+ #--------------------------------------------------------------------------------
6285
+ #region WP Cron Common
6286
+ #--------------------------------------------------------------------------------
6287
+
6288
+ /**
6289
+ * @author Vova Feldman (@svovaf)
6290
+ * @since 2.0.0
6291
+ *
6292
+ * @param string $name Cron name.
6293
+ *
6294
+ * @return object
6295
+ */
6296
+ private function get_cron_data( $name ) {
6297
+ $this->_logger->entrance( $name );
6298
+
6299
+ /**
6300
+ * @var object $cron_data
6301
+ */
6302
+ return $this->_storage->get( "{$name}_cron", null );
6303
+ }
6304
+
6305
+ /**
6306
+ * @author Vova Feldman (@svovaf)
6307
+ * @since 2.0.0
6308
+ *
6309
+ * @param string $name Cron name.
6310
+ */
6311
+ private function clear_cron_data( $name ) {
6312
+ $this->_logger->entrance( $name );
6313
+
6314
+ $this->_storage->remove( "{$name}_cron" );
6315
+ }
6316
+
6317
+ /**
6318
+ * @author Vova Feldman (@svovaf)
6319
+ * @since 2.0.0
6320
+ *
6321
+ * @param string $name Cron name.
6322
+ * @param int $cron_blog_id The cron executing blog ID.
6323
+ */
6324
+ private function set_cron_data( $name, $cron_blog_id = 0 ) {
6325
+ $this->_logger->entrance( $name );
6326
+
6327
+ $this->_storage->store( "{$name}_cron", (object) array(
6328
+ 'version' => $this->get_plugin_version(),
6329
+ 'blog_id' => $cron_blog_id,
6330
+ 'sdk_version' => $this->version,
6331
+ 'timestamp' => WP_FS__SCRIPT_START_TIME,
6332
+ 'on' => true,
6333
+ ) );
6334
+ }
6335
+
6336
+ /**
6337
+ * Get the cron's executing blog ID.
6338
+ *
6339
+ * @author Vova Feldman (@svovaf)
6340
+ * @since 2.0.0
6341
+ *
6342
+ * @param string $name Cron name.
6343
+ *
6344
+ * @return int
6345
+ */
6346
+ private function get_cron_blog_id( $name ) {
6347
+ $this->_logger->entrance( $name );
6348
+
6349
+ /**
6350
+ * @var object $cron_data
6351
+ */
6352
+ $cron_data = $this->get_cron_data( $name );
6353
+
6354
+ return ( is_object( $cron_data ) && is_numeric( $cron_data->blog_id ) ) ?
6355
+ $cron_data->blog_id :
6356
+ 0;
6357
+ }
6358
+
6359
+ /**
6360
+ * @author Vova Feldman (@svovaf)
6361
+ * @since 2.0.0
6362
+ *
6363
+ * @param string $name Cron name.
6364
+ *
6365
+ * @return bool
6366
+ */
6367
+ private function is_cron_on( $name ) {
6368
+ $this->_logger->entrance( $name );
6369
+
6370
+ /**
6371
+ * @var object $cron_data
6372
+ */
6373
+ $cron_data = $this->get_cron_data( $name );
6374
+
6375
+ return ( ! is_null( $cron_data ) && true === $cron_data->on );
6376
+ }
6377
+
6378
+ /**
6379
+ * Unix timestamp for previous cron execution or false if never executed.
6380
+ *
6381
+ * @author Vova Feldman (@svovaf)
6382
+ * @since 2.0.0
6383
+ *
6384
+ * @param string $name Cron name.
6385
+ *
6386
+ * @return int|false
6387
+ */
6388
+ private function cron_last_execution( $name ) {
6389
+ $this->_logger->entrance( $name );
6390
+
6391
+ return $this->_storage->get( "{$name}_timestamp" );
6392
+ }
6393
+
6394
+ /**
6395
+ * Set cron execution time to now.
6396
+ *
6397
+ * @author Vova Feldman (@svovaf)
6398
+ * @since 2.0.0
6399
+ *
6400
+ * @param string $name Cron name.
6401
+ */
6402
+ private function set_cron_execution_timestamp( $name ) {
6403
+ $this->_logger->entrance( $name );
6404
+
6405
+ $this->_storage->store( "{$name}_timestamp", time() );
6406
+ }
6407
+
6408
+ /**
6409
+ * Sets the keepalive time to now.
6410
+ *
6411
+ * @author Leo Fajardo (@leorw)
6412
+ * @since 2.2.3
6413
+ *
6414
+ * @param bool|null $use_network_level_storage
6415
+ */
6416
+ private function set_keepalive_timestamp( $use_network_level_storage = null ) {
6417
+ $this->_logger->entrance();
6418
+
6419
+ $this->_storage->store( 'keepalive_timestamp', time(), $use_network_level_storage );
6420
+ }
6421
+
6422
+ /**
6423
+ * Check if cron was executed in the last $period of seconds.
6424
+ *
6425
+ * @author Vova Feldman (@svovaf)
6426
+ * @since 2.0.0
6427
+ *
6428
+ * @param string $name Cron name.
6429
+ * @param int $period In seconds
6430
+ *
6431
+ * @return bool
6432
+ */
6433
+ private function is_cron_executed( $name, $period = WP_FS__TIME_24_HOURS_IN_SEC ) {
6434
+ $this->_logger->entrance( $name );
6435
+
6436
+ $last_execution = $this->cron_last_execution( $name );
6437
+
6438
+ if ( ! is_numeric( $last_execution ) ) {
6439
+ return false;
6440
+ }
6441
+
6442
+ return ( $last_execution > ( WP_FS__SCRIPT_START_TIME - $period ) );
6443
+ }
6444
+
6445
+ /**
6446
+ * WP Cron is executed on a site level. When running in a multisite network environment
6447
+ * with the network integration activated, for optimization reasons, we are consolidating
6448
+ * the installs data sync cron to be executed only from a single site.
6449
+ *
6450
+ * @author Vova Feldman (@svovaf)
6451
+ * @since 2.0.0
6452
+ *
6453
+ * @param int $except_blog_id Target any except the excluded blog ID.
6454
+ *
6455
+ * @return int
6456
+ */
6457
+ private function get_cron_target_blog_id( $except_blog_id = 0 ) {
6458
+ if ( ! is_multisite() ) {
6459
+ return 0;
6460
+ }
6461
+
6462
+ if ( $this->_is_network_active &&
6463
+ is_numeric( $this->_storage->network_install_blog_id ) &&
6464
+ $except_blog_id != $this->_storage->network_install_blog_id &&
6465
+ self::is_site_active( $this->_storage->network_install_blog_id )
6466
+ ) {
6467
+ // Try to run cron from the main network blog.
6468
+ $install = $this->get_install_by_blog_id( $this->_storage->network_install_blog_id );
6469
+
6470
+ if ( is_object( $install ) &&
6471
+ ( $this->is_premium() || $install->is_tracking_allowed() )
6472
+ ) {
6473
+ return $this->_storage->network_install_blog_id;
6474
+ }
6475
+ }
6476
+
6477
+ // Get first opted-in blog ID with active tracking.
6478
+ $installs = $this->get_blog_install_map();
6479
+ foreach ( $installs as $blog_id => $install ) {
6480
+ if ( $except_blog_id != $blog_id &&
6481
+ self::is_site_active( $blog_id ) &&
6482
+ ( $this->is_premium() || $install->is_tracking_allowed() )
6483
+ ) {
6484
+ return $blog_id;
6485
+ }
6486
+ }
6487
+
6488
+ return 0;
6489
+ }
6490
+
6491
+ /**
6492
+ * @author Vova Feldman (@svovaf)
6493
+ * @since 2.0.0
6494
+ *
6495
+ * @param string $name Cron name.
6496
+ * @param string $action_tag Callback action tag.
6497
+ * @param bool $is_network_clear If set to TRUE, clear sync cron even if there are installs that are still connected.
6498
+ */
6499
+ private function clear_cron( $name, $action_tag = '', $is_network_clear = false ) {
6500
+ $this->_logger->entrance( $name );
6501
+
6502
+ if ( ! $this->is_cron_on( $name ) ) {
6503
+ return;
6504
+ }
6505
+
6506
+ $clear_cron = true;
6507
+ if ( ! $is_network_clear && $this->_is_network_active ) {
6508
+ $installs = $this->get_blog_install_map();
6509
+
6510
+ foreach ( $installs as $blog_id => $install ) {
6511
+ /**
6512
+ * @var FS_Site $install
6513
+ */
6514
+ if ( $install->is_tracking_allowed() ) {
6515
+ $clear_cron = false;
6516
+ break;
6517
+ }
6518
+ }
6519
+ }
6520
+
6521
+ if ( ! $clear_cron ) {
6522
+ return;
6523
+ }
6524
+
6525
+ /**
6526
+ * @var object $cron_data
6527
+ */
6528
+ $cron_data = $this->get_cron_data( $name );
6529
+
6530
+ $cron_blog_id = is_object( $cron_data ) && isset( $cron_data->blog_id ) ?
6531
+ $cron_data->blog_id :
6532
+ 0;
6533
+
6534
+ $this->clear_cron_data( $name );
6535
+
6536
+ if ( 0 < $cron_blog_id ) {
6537
+ switch_to_blog( $cron_blog_id );
6538
+ }
6539
+
6540
+ if ( empty( $action_tag ) ) {
6541
+ $action_tag = $name;
6542
+ }
6543
+
6544
+ wp_clear_scheduled_hook( $this->get_action_tag( $action_tag ) );
6545
+
6546
+ if ( 0 < $cron_blog_id ) {
6547
+ restore_current_blog();
6548
+ }
6549
+ }
6550
+
6551
+ /**
6552
+ * Unix timestamp for next cron execution or false if not scheduled.
6553
+ *
6554
+ * @author Vova Feldman (@svovaf)
6555
+ * @since 2.0.0
6556
+ *
6557
+ * @param string $name Cron name.
6558
+ * @param string $action_tag Callback action tag.
6559
+ *
6560
+ * @return int|false
6561
+ */
6562
+ private function get_next_scheduled_cron( $name, $action_tag = '' ) {
6563
+ $this->_logger->entrance( $name );
6564
+
6565
+ if ( ! $this->is_cron_on( $name ) ) {
6566
+ return false;
6567
+ }
6568
+
6569
+ /**
6570
+ * @var object $cron_data
6571
+ */
6572
+ $cron_data = $this->get_cron_data( $name );
6573
+
6574
+ $cron_blog_id = is_object( $cron_data ) && isset( $cron_data->blog_id ) ?
6575
+ $cron_data->blog_id :
6576
+ 0;
6577
+
6578
+ if ( 0 < $cron_blog_id ) {
6579
+ switch_to_blog( $cron_blog_id );
6580
+ }
6581
+
6582
+ if ( empty( $action_tag ) ) {
6583
+ $action_tag = $name;
6584
+ }
6585
+
6586
+ $next_scheduled = wp_next_scheduled( $this->get_action_tag( $action_tag ) );
6587
+
6588
+ if ( 0 < $cron_blog_id ) {
6589
+ restore_current_blog();
6590
+ }
6591
+
6592
+ return $next_scheduled;
6593
+ }
6594
+
6595
+ /**
6596
+ * @author Vova Feldman (@svovaf)
6597
+ * @since 2.0.0
6598
+ *
6599
+ * @param string $name Cron name.
6600
+ * @param string $action_tag Callback action tag.
6601
+ * @param string $recurrence 'single' or 'daily'.
6602
+ * @param int $start_at Defaults to now.
6603
+ * @param bool $randomize_start If true, schedule first job randomly during the next 12 hours. Otherwise, schedule job to start right away.
6604
+ * @param int $except_blog_id Target any except the excluded blog ID.
6605
+ */
6606
+ private function schedule_cron(
6607
+ $name,
6608
+ $action_tag = '',
6609
+ $recurrence = 'single',
6610
+ $start_at = WP_FS__SCRIPT_START_TIME,
6611
+ $randomize_start = true,
6612
+ $except_blog_id = 0
6613
+ ) {
6614
+ $this->_logger->entrance( $name );
6615
+
6616
+ $this->clear_cron( $name, $action_tag, true );
6617
+
6618
+ $cron_blog_id = $this->get_cron_target_blog_id( $except_blog_id );
6619
+
6620
+ if ( is_multisite() && 0 == $cron_blog_id ) {
6621
+ // Don't schedule cron since couldn't find a target blog.
6622
+ return;
6623
+ }
6624
+
6625
+ if ( 0 < $cron_blog_id ) {
6626
+ switch_to_blog( $cron_blog_id );
6627
+ }
6628
+
6629
+ if ( 'daily' === $recurrence ) {
6630
+ if ( $randomize_start ) {
6631
+ // Schedule first sync with a random 12 hour time range from now.
6632
+ $start_at += rand( 0, ( WP_FS__TIME_24_HOURS_IN_SEC / 2 ) );
6633
+ }
6634
+
6635
+ // Schedule daily WP cron.
6636
+ wp_schedule_event(
6637
+ $start_at,
6638
+ 'daily',
6639
+ $this->get_action_tag( $action_tag )
6640
+ );
6641
+ } else if ( 'single' === $recurrence ) {
6642
+ // Schedule single cron.
6643
+ wp_schedule_single_event(
6644
+ $start_at,
6645
+ $this->get_action_tag( $action_tag )
6646
+ );
6647
+ }
6648
+
6649
+ $this->set_cron_data( $name, $cron_blog_id );
6650
+
6651
+ if ( 0 < $cron_blog_id ) {
6652
+ restore_current_blog();
6653
+ }
6654
+ }
6655
+
6656
+ /**
6657
+ * Consolidated cron execution for performance optimization. The max number of API requests is based on the number of unique opted-in users.
6658
+ * that doesn't halt page loading.
6659
+ *
6660
+ * @author Vova Feldman (@svovaf)
6661
+ * @since 2.0.0
6662
+ *
6663
+ * @param string $name Cron name.
6664
+ * @param callable $callable The function that should be executed.
6665
+ */
6666
+ private function execute_cron( $name, $callable ) {
6667
+ $this->_logger->entrance( $name );
6668
+
6669
+ // Store the last time data sync was executed.
6670
+ $this->set_cron_execution_timestamp( $name );
6671
+
6672
+ // Check if API is temporary down.
6673
+ if ( FS_Api::is_temporary_down() ) {
6674
+ return;
6675
+ }
6676
+
6677
+ // @todo Add logic that identifies API latency, and reschedule the next background sync randomly between 8-16 hours.
6678
+
6679
+ $users_2_blog_ids = array();
6680
+
6681
+ if ( ! is_multisite() ) {
6682
+ // Add dummy blog.
6683
+ $users_2_blog_ids[0] = array( 0 );
6684
+ } else {
6685
+ $installs = $this->get_blog_install_map();
6686
+ foreach ( $installs as $blog_id => $install ) {
6687
+ if ( $this->is_premium() || $install->is_tracking_allowed() ) {
6688
+ if ( ! isset( $users_2_blog_ids[ $install->user_id ] ) ) {
6689
+ $users_2_blog_ids[ $install->user_id ] = array();
6690
+ }
6691
+
6692
+ $users_2_blog_ids[ $install->user_id ][] = $blog_id;
6693
+ }
6694
+ }
6695
+ }
6696
+
6697
+ $current_blog_id = get_current_blog_id();
6698
+
6699
+ foreach ( $users_2_blog_ids as $user_id => $blog_ids ) {
6700
+ if ( 0 < $blog_ids[0] ) {
6701
+ $this->switch_to_blog( $blog_ids[0] );
6702
+ }
6703
+
6704
+ call_user_func_array( $callable, array( $blog_ids, ( is_multisite() ? $current_blog_id : null ) ) );
6705
+
6706
+ foreach ( $blog_ids as $blog_id ) {
6707
+ $this->do_action( "after_{$name}_cron", $blog_id );
6708
+ }
6709
+ }
6710
+
6711
+ if ( is_multisite() ) {
6712
+ $this->switch_to_blog( $current_blog_id, fs_is_network_admin() ? $this->get_network_install() : null );
6713
+
6714
+ $this->do_action( "after_{$name}_cron_multisite" );
6715
+ }
6716
+ }
6717
+
6718
+ #endregion
6719
+
6720
+ #----------------------------------------------------------------------------------
6721
+ #region Daily Sync Cron
6722
+ #----------------------------------------------------------------------------------
6723
+
6724
+
6725
+ /**
6726
+ * @author Vova Feldman (@svovaf)
6727
+ * @since 2.0.0
6728
+ *
6729
+ * @return bool
6730
+ */
6731
+ private function is_sync_cron_scheduled() {
6732
+ return $this->is_cron_on( 'sync' );
6733
+ }
6734
+
6735
+ /**
6736
+ * Get the sync cron's executing blog ID.
6737
+ *
6738
+ * @author Vova Feldman (@svovaf)
6739
+ * @since 2.0.0
6740
+ *
6741
+ * @return int
6742
+ */
6743
+ private function get_sync_cron_blog_id() {
6744
+ return $this->get_cron_blog_id( 'sync' );
6745
+ }
6746
+
6747
+ /**
6748
+ * @author Vova Feldman (@svovaf)
6749
+ * @since 1.1.7.3
6750
+ */
6751
+ private function run_manual_sync() {
6752
+ self::require_pluggable_essentials();
6753
+
6754
+ if ( ! $this->is_user_admin() ) {
6755
+ return;
6756
+ }
6757
+
6758
+ // Run manual sync.
6759
+ $this->_sync_cron();
6760
+
6761
+ // Reschedule next cron to run 24 hours from now (performance optimization).
6762
+ $this->schedule_sync_cron( time() + WP_FS__TIME_24_HOURS_IN_SEC, false );
6763
+ }
6764
+
6765
+ /**
6766
+ * Data sync cron job. Replaces the background sync non blocking HTTP request
6767
+ * that doesn't halt page loading.
6768
+ *
6769
+ * @author Vova Feldman (@svovaf)
6770
+ * @since 1.1.7.3
6771
+ * @since 2.0.0 Consolidate all the data sync into the same cron for performance optimization. The max number of API requests is based on the number of unique opted-in users.
6772
+ */
6773
+ function _sync_cron() {
6774
+ $this->_logger->entrance();
6775
+
6776
+ $this->execute_cron( 'sync', array( &$this, '_sync_cron_method' ) );
6777
+ }
6778
+
6779
+ /**
6780
+ * The actual data sync cron logic.
6781
+ *
6782
+ * @author Vova Feldman (@svovaf)
6783
+ * @since 2.0.0
6784
+ *
6785
+ * @param int[] $blog_ids
6786
+ * @param int|null $current_blog_id @since 2.2.3. This is passed from the `execute_cron` method and used by the
6787
+ * `_sync_plugin_license` method in order to switch to the previous blog when sending
6788
+ * updates for a single site in case `execute_cron` has switched to a different blog.
6789
+ */
6790
+ function _sync_cron_method( array $blog_ids, $current_blog_id = null ) {
6791
+ if ( $this->is_registered() ) {
6792
+ $this->sync_user_beta_mode();
6793
+
6794
+ if ( $this->has_paid_plan() ) {
6795
+ // Initiate background plan sync.
6796
+ $this->_sync_license( true, false, $current_blog_id );
6797
+
6798
+ if ( $this->is_paying() ) {
6799
+ // Check for premium plugin updates.
6800
+ $this->check_updates( true );
6801
+ }
6802
+ } else {
6803
+ // Sync install(s) (only if something changed locally).
6804
+ if ( 1 < count( $blog_ids ) ) {
6805
+ $this->sync_installs();
6806
+ } else {
6807
+ $this->sync_install();
6808
+ }
6809
+
6810
+ $this->maybe_sync_install_user();
6811
+ }
6812
+ }
6813
+ }
6814
+
6815
+ /**
6816
+ * Check if sync was executed in the last $period of seconds.
6817
+ *
6818
+ * @author Vova Feldman (@svovaf)
6819
+ * @since 1.1.7.3
6820
+ *
6821
+ * @param int $period In seconds
6822
+ *
6823
+ * @return bool
6824
+ */
6825
+ private function is_sync_executed( $period = WP_FS__TIME_24_HOURS_IN_SEC ) {
6826
+ return $this->is_cron_executed( 'sync', $period );
6827
+ }
6828
+
6829
+ /**
6830
+ * @author Vova Feldman (@svovaf)
6831
+ * @since 1.1.7.3
6832
+ *
6833
+ * @return bool
6834
+ */
6835
+ private function is_sync_cron_on() {
6836
+ return $this->is_cron_on( 'sync' );
6837
+ }
6838
+
6839
+ /**
6840
+ * @author Vova Feldman (@svovaf)
6841
+ * @since 1.1.7.3
6842
+ *
6843
+ * @param int $start_at Defaults to now.
6844
+ * @param bool $randomize_start If true, schedule first job randomly during the next 12 hours. Otherwise, schedule job to start right away.
6845
+ * @param int $except_blog_id Since 2.0.0 when running in a multisite network environment, the cron execution is consolidated. This param allows excluding excluded specified blog ID from being the cron executor.
6846
+ */
6847
+ private function schedule_sync_cron(
6848
+ $start_at = WP_FS__SCRIPT_START_TIME,
6849
+ $randomize_start = true,
6850
+ $except_blog_id = 0
6851
+ ) {
6852
+ $this->schedule_cron(
6853
+ 'sync',
6854
+ 'data_sync',
6855
+ 'daily',
6856
+ $start_at,
6857
+ $randomize_start,
6858
+ $except_blog_id
6859
+ );
6860
+ }
6861
+
6862
+ /**
6863
+ * Add the actual sync function to the cron job hook.
6864
+ *
6865
+ * @author Vova Feldman (@svovaf)
6866
+ * @since 1.1.7.3
6867
+ */
6868
+ private function hook_callback_to_sync_cron() {
6869
+ $this->add_action( 'data_sync', array( &$this, '_sync_cron' ) );
6870
+ }
6871
+
6872
+ /**
6873
+ * @author Vova Feldman (@svovaf)
6874
+ * @since 1.1.7.3
6875
+ *
6876
+ * @param bool $is_network_clear Since 2.0.0 If set to TRUE, clear sync cron even if there are installs that are still connected.
6877
+ */
6878
+ private function clear_sync_cron( $is_network_clear = false ) {
6879
+ $this->_logger->entrance();
6880
+
6881
+ $this->clear_cron( 'sync', 'data_sync', $is_network_clear );
6882
+ }
6883
+
6884
+ /**
6885
+ * Unix timestamp for next sync cron execution or false if not scheduled.
6886
+ *
6887
+ * @author Vova Feldman (@svovaf)
6888
+ * @since 1.1.7.3
6889
+ *
6890
+ * @return int|false
6891
+ */
6892
+ function next_sync_cron() {
6893
+ return $this->get_next_scheduled_cron( 'sync', 'data_sync' );
6894
+ }
6895
+
6896
+ /**
6897
+ * Unix timestamp for previous sync cron execution or false if never executed.
6898
+ *
6899
+ * @author Vova Feldman (@svovaf)
6900
+ * @since 1.1.7.3
6901
+ *
6902
+ * @return int|false
6903
+ */
6904
+ function last_sync_cron() {
6905
+ return $this->cron_last_execution( 'sync' );
6906
+ }
6907
+
6908
+ #endregion Daily Sync Cron ------------------------------------------------------------------
6909
+
6910
+ #----------------------------------------------------------------------------------
6911
+ #region Async Install Sync
6912
+ #----------------------------------------------------------------------------------
6913
+
6914
+ /**
6915
+ * @author Vova Feldman (@svovaf)
6916
+ * @since 1.1.7.3
6917
+ *
6918
+ * @return bool
6919
+ */
6920
+ private function is_install_sync_scheduled() {
6921
+ return $this->is_cron_on( 'install_sync' );
6922
+ }
6923
+
6924
+ /**
6925
+ * Get the sync cron's executing blog ID.
6926
+ *
6927
+ * @author Vova Feldman (@svovaf)
6928
+ * @since 2.0.0
6929
+ *
6930
+ * @return int
6931
+ */
6932
+ private function get_install_sync_cron_blog_id() {
6933
+ return $this->get_cron_blog_id( 'install_sync' );
6934
+ }
6935
+
6936
+ /**
6937
+ * Instead of running blocking install sync event, execute non blocking scheduled wp-cron.
6938
+ *
6939
+ * @author Vova Feldman (@svovaf)
6940
+ * @since 1.1.7.3
6941
+ *
6942
+ * @param int $except_blog_id Since 2.0.0 when running in a multisite network environment, the cron execution is consolidated. This param allows excluding excluded specified blog ID from being the cron executor.
6943
+ */
6944
+ private function schedule_install_sync( $except_blog_id = 0 ) {
6945
+ $this->schedule_cron( 'install_sync', 'install_sync', 'single', WP_FS__SCRIPT_START_TIME, false, $except_blog_id );
6946
+ }
6947
+
6948
+ /**
6949
+ * Unix timestamp for previous install sync cron execution or false if never executed.
6950
+ *
6951
+ * @todo There's some very strange bug that $this->_storage->install_sync_timestamp value is not being updated. But for sure the sync event is working.
6952
+ *
6953
+ * @author Vova Feldman (@svovaf)
6954
+ * @since 1.1.7.3
6955
+ *
6956
+ * @return int|false
6957
+ */
6958
+ function last_install_sync() {
6959
+ return $this->cron_last_execution( 'install_sync' );
6960
+ }
6961
+
6962
+ /**
6963
+ * Unix timestamp for next install sync cron execution or false if not scheduled.
6964
+ *
6965
+ * @author Vova Feldman (@svovaf)
6966
+ * @since 1.1.7.3
6967
+ *
6968
+ * @return int|false
6969
+ */
6970
+ function next_install_sync() {
6971
+ return $this->get_next_scheduled_cron( 'install_sync', 'install_sync' );
6972
+ }
6973
+
6974
+ /**
6975
+ * Add the actual install sync function to the cron job hook.
6976
+ *
6977
+ * @author Vova Feldman (@svovaf)
6978
+ * @since 1.1.7.3
6979
+ */
6980
+ private function hook_callback_to_install_sync() {
6981
+ $this->add_action( 'install_sync', array( &$this, '_run_sync_install' ) );
6982
+ }
6983
+
6984
+ /**
6985
+ * @author Vova Feldman (@svovaf)
6986
+ * @since 1.1.7.3
6987
+ *
6988
+ * @param bool $is_network_clear Since 2.0.0 If set to TRUE, clear sync cron even if there are installs that are still connected.
6989
+ */
6990
+ private function clear_install_sync_cron( $is_network_clear = false ) {
6991
+ $this->_logger->entrance();
6992
+
6993
+ $this->clear_cron( 'install_sync', 'install_sync', $is_network_clear );
6994
+ }
6995
+
6996
+ /**
6997
+ * @author Vova Feldman (@svovaf)
6998
+ * @since 1.1.7.3
6999
+ * @since 2.0.0 Consolidate all the data sync into the same cron for performance optimization. The max number of API requests is based on the number of unique opted-in users.
7000
+ */
7001
+ public function _run_sync_install() {
7002
+ $this->_logger->entrance();
7003
+
7004
+ $this->execute_cron( 'sync', array( &$this, '_sync_install_cron_method' ) );
7005
+ }
7006
+
7007
+ /**
7008
+ * The actual install(s) sync cron logic.
7009
+ *
7010
+ * @author Vova Feldman (@svovaf)
7011
+ * @since 2.0.0
7012
+ *
7013
+ * @param int[] $blog_ids
7014
+ * @param int|null $current_blog_id
7015
+ */
7016
+ function _sync_install_cron_method( array $blog_ids, $current_blog_id = null ) {
7017
+ if ( $this->is_registered() ) {
7018
+ if ( 1 < count( $blog_ids ) ) {
7019
+ $this->sync_installs( array(), true );
7020
+ } else {
7021
+ $this->sync_install( array(), true );
7022
+ }
7023
+
7024
+ $this->maybe_sync_install_user();
7025
+ }
7026
+ }
7027
+
7028
+ #endregion Async Install Sync ------------------------------------------------------------------
7029
+
7030
+ /**
7031
+ * Show a notice that activation is currently pending.
7032
+ *
7033
+ * @author Vova Feldman (@svovaf)
7034
+ * @since 1.0.7
7035
+ *
7036
+ * @param bool|string $email
7037
+ * @param bool $is_pending_trial Since 1.2.1.5
7038
+ */
7039
+ function _add_pending_activation_notice( $email = false, $is_pending_trial = false ) {
7040
+ if ( ! is_string( $email ) ) {
7041
+ $current_user = self::_get_current_wp_user();
7042
+ $email = $current_user->user_email;
7043
+ }
7044
+
7045
+ $this->_admin_notices->add_sticky(
7046
+ sprintf(
7047
+ $this->get_text_inline( 'You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s.', 'pending-activation-message' ),
7048
+ '<b>' . $this->get_plugin_name() . '</b>',
7049
+ '<b>' . $email . '</b>',
7050
+ ( $is_pending_trial ?
7051
+ $this->get_text_inline( 'start the trial', 'start-the-trial' ) :
7052
+ $this->get_text_inline( 'complete the install', 'complete-the-install' ) )
7053
+ ),
7054
+ 'activation_pending',
7055
+ 'Thanks!'
7056
+ );
7057
+ }
7058
+
7059
+ /**
7060
+ * Check if currently in plugin activation.
7061
+ *
7062
+ * @author Vova Feldman (@svovaf)
7063
+ * @since 1.1.4
7064
+ *
7065
+ * @return bool
7066
+ */
7067
+ function is_plugin_activation() {
7068
+ $result = get_transient( "fs_{$this->_module_type}_{$this->_slug}_activated" );
7069
+
7070
+ return !empty($result);
7071
+ }
7072
+
7073
+ /**
7074
+ *
7075
+ * NOTE: admin_menu action executed before admin_init.
7076
+ *
7077
+ * @author Vova Feldman (@svovaf)
7078
+ * @since 1.0.7
7079
+ */
7080
+ function _admin_init_action() {
7081
+ /**
7082
+ * Automatically redirect to connect/activation page after plugin activation.
7083
+ *
7084
+ * @since 1.1.7 Do NOT redirect to opt-in when running in network admin mode.
7085
+ */
7086
+ if ( $this->is_plugin_activation() ) {
7087
+ delete_transient( "fs_{$this->_module_type}_{$this->_slug}_activated" );
7088
+
7089
+ if ( isset( $_GET['activate-multi'] ) ) {
7090
+ /**
7091
+ * Don't redirect if activating multiple plugins at once (bulk activation).
7092
+ */
7093
+ } else {
7094
+ $this->_redirect_on_activation_hook();
7095
+ return;
7096
+ }
7097
+ }
7098
+
7099
+ if ( fs_request_is_action( $this->get_unique_affix() . '_skip_activation' ) ) {
7100
+ check_admin_referer( $this->get_unique_affix() . '_skip_activation' );
7101
+
7102
+ $this->skip_connection( null, fs_is_network_admin() );
7103
+
7104
+ fs_redirect( $this->get_after_activation_url( 'after_skip_url' ) );
7105
+ }
7106
+
7107
+ if ( $this->is_network_activation_mode() &&
7108
+ fs_request_is_action( $this->get_unique_affix() . '_delegate_activation' )
7109
+ ) {
7110
+ check_admin_referer( $this->get_unique_affix() . '_delegate_activation' );
7111
+
7112
+ $this->delegate_connection();
7113
+
7114
+ fs_redirect( $this->get_after_activation_url( 'after_delegation_url' ) );
7115
+ }
7116
+
7117
+ $this->_add_upgrade_action_link();
7118
+
7119
+ if ( ! ( ! $this->_is_network_active && fs_is_network_admin() ) &&
7120
+ (
7121
+ ( true === $this->_storage->require_license_activation ) ||
7122
+ // Not registered nor anonymous.
7123
+ ( ! $this->is_registered() && ! $this->is_anonymous() ) ||
7124
+ // OR, network level and in network upgrade mode.
7125
+ ( fs_is_network_admin() && $this->_is_network_active && $this->is_network_upgrade_mode() )
7126
+ )
7127
+ ) {
7128
+ if ( ! $this->is_pending_activation() ) {
7129
+ if ( ! $this->_menu->is_activation_page( $this->show_opt_in_on_themes_page() ) ) {
7130
+ /**
7131
+ * If a user visits any other admin page before activating the premium-only theme with a valid
7132
+ * license, reactivate the previous theme.
7133
+ *
7134
+ * @author Leo Fajardo (@leorw)
7135
+ * @since 1.2.2
7136
+ */
7137
+ if ( $this->is_theme() &&
7138
+ ! $this->has_settings_menu() &&
7139
+ ! isset( $_REQUEST['fs_action'] ) &&
7140
+ $this->can_activate_previous_theme()
7141
+ ) {
7142
+ if ( $this->is_only_premium() ) {
7143
+ $this->activate_previous_theme();
7144
+ return;
7145
+ }
7146
+
7147
+ if ( true === $this->_storage->require_license_activation ) {
7148
+ $this->_storage->require_license_activation = false;
7149
+ }
7150
+ }
7151
+
7152
+ if ( ! fs_is_network_admin() &&
7153
+ $this->is_network_activation_mode() &&
7154
+ ! $this->is_delegated_connection()
7155
+ ) {
7156
+ return;
7157
+ }
7158
+
7159
+ if ( $this->is_plugin_new_install() || $this->is_only_premium() ) {
7160
+ if ( ! $this->_anonymous_mode ) {
7161
+ // Show notice for new plugin installations.
7162
+ $this->_admin_notices->add(
7163
+ sprintf(
7164
+ $this->get_text_inline( 'You are just one step away - %s', 'you-are-step-away' ),
7165
+ sprintf( '<b><a href="%s">%s</a></b>',
7166
+ $this->get_activation_url( array(), ! $this->is_delegated_connection() ),
7167
+ sprintf( $this->get_text_x_inline( 'Complete "%s" Activation Now',
7168
+ '%s - plugin name. As complete "PluginX" activation now', 'activate-x-now' ), $this->get_plugin_name() )
7169
+ )
7170
+ ),
7171
+ '',
7172
+ 'update-nag'
7173
+ );
7174
+ }
7175
+ } else {
7176
+ if ( $this->should_add_sticky_optin_notice() ) {
7177
+ $this->add_sticky_optin_admin_notice();
7178
+ }
7179
+
7180
+ if ( $this->has_filter( 'optin_pointer_element' ) ) {
7181
+ // Don't show admin nag if plugin update.
7182
+ wp_enqueue_script( 'wp-pointer' );
7183
+ wp_enqueue_style( 'wp-pointer' );
7184
+
7185
+ $this->_enqueue_connect_essentials();
7186
+
7187
+ add_action( 'admin_print_footer_scripts', array(
7188
+ $this,
7189
+ '_add_connect_pointer_script'
7190
+ ) );
7191
+ }
7192
+ }
7193
+ }
7194
+ }
7195
+
7196
+ if ( $this->show_opt_in_on_themes_page() &&
7197
+ $this->is_activation_page()
7198
+ ) {
7199
+ $this->_show_theme_activation_optin_dialog();
7200
+ }
7201
+ }
7202
+ }
7203
+
7204
+ /**
7205
+ * @author Vova Feldman (@svovaf)
7206
+ * @since 2.0.0
7207
+ *
7208
+ * @return bool
7209
+ */
7210
+ private function should_add_sticky_optin_notice() {
7211
+ if ( fs_is_network_admin() ) {
7212
+ if ( ! $this->_is_network_active ) {
7213
+ return false;
7214
+ }
7215
+
7216
+ if ( ! $this->is_network_activation_mode() ) {
7217
+ return false;
7218
+ }
7219
+
7220
+ return ! isset( $this->_storage->sticky_optin_added_ms );
7221
+ }
7222
+
7223
+ if ( ! $this->is_activation_mode() ) {
7224
+ return false;
7225
+ }
7226
+
7227
+ // If running from a blog admin and delegated the connection.
7228
+ return ! isset( $this->_storage->sticky_optin_added );
7229
+ }
7230
+
7231
+ /**
7232
+ * @author Leo Fajardo (@leorw)
7233
+ * @since 2.0.0
7234
+ */
7235
+ private function add_sticky_optin_admin_notice() {
7236
+ if ( ! $this->_is_network_active || ! fs_is_network_admin() ) {
7237
+ $this->_storage->sticky_optin_added = true;
7238
+ } else {
7239
+ $this->_storage->sticky_optin_added_ms = true;
7240
+ }
7241
+
7242
+ // Show notice for new plugin installations.
7243
+ $this->_admin_notices->add_sticky(
7244
+ sprintf(
7245
+ $this->get_text_inline( 'We made a few tweaks to the %s, %s', 'few-plugin-tweaks' ),
7246
+ $this->_module_type,
7247
+ sprintf( '<b><a href="%s">%s</a></b>',
7248
+ $this->get_activation_url(),
7249
+ sprintf( $this->get_text_inline( 'Opt in to make "%s" better!', 'optin-x-now' ), $this->get_plugin_name() )
7250
+ )
7251
+ ),
7252
+ 'connect_account',
7253
+ '',
7254
+ 'update-nag'
7255
+ );
7256
+ }
7257
+
7258
+ /**
7259
+ * Enqueue connect requires scripts and styles.
7260
+ *
7261
+ * @author Vova Feldman (@svovaf)
7262
+ * @since 1.1.4
7263
+ */
7264
+ function _enqueue_connect_essentials() {
7265
+ wp_enqueue_script( 'jquery' );
7266
+ wp_enqueue_script( 'json2' );
7267
+
7268
+ fs_enqueue_local_script( 'postmessage', 'nojquery.ba-postmessage.min.js' );
7269
+ fs_enqueue_local_script( 'fs-postmessage', 'postmessage.js' );
7270
+
7271
+ fs_enqueue_local_style( 'fs_connect', '/admin/connect.css' );
7272
+ }
7273
+
7274
+ /**
7275
+ * Add connect / opt-in pointer.
7276
+ *
7277
+ * @author Vova Feldman (@svovaf)
7278
+ * @since 1.1.4
7279
+ */
7280
+ function _add_connect_pointer_script() {
7281
+ $vars = array( 'id' => $this->_module_id );
7282
+ $pointer_content = fs_get_template( 'connect.php', $vars );
7283
+ ?>
7284
+ <script type="text/javascript">// <![CDATA[
7285
+ jQuery(document).ready(function ($) {
7286
+ if ('undefined' !== typeof(jQuery().pointer)) {
7287
+
7288
+ var element = <?php echo $this->apply_filters( 'optin_pointer_element', '$("#non_existing_element");' ) ?>;
7289
+
7290
+ if (element.length > 0) {
7291
+ var optin = $(element).pointer($.extend(true, {}, {
7292
+ content : <?php echo json_encode( $pointer_content ) ?>,
7293
+ position : {
7294
+ edge : 'left',
7295
+ align: 'center'
7296
+ },
7297
+ buttons : function () {
7298
+ // Don't show pointer buttons.
7299
+ return '';
7300
+ },
7301
+ pointerWidth: 482
7302
+ }, <?php echo $this->apply_filters( 'optin_pointer_options_json', '{}' ) ?>));
7303
+
7304
+ <?php
7305
+ echo $this->apply_filters( 'optin_pointer_execute', "
7306
+
7307
+ optin.pointer('open');
7308
+
7309
+ // Tag the opt-in pointer with custom class.
7310
+ $('.wp-pointer #fs_connect')
7311
+ .parents('.wp-pointer.wp-pointer-top')
7312
+ .addClass('fs-opt-in-pointer');
7313
+
7314
+ ", 'element', 'optin' ) ?>
7315
+ }
7316
+ }
7317
+ });
7318
+ // ]]></script>
7319
+ <?php
7320
+ }
7321
+
7322
+ /**
7323
+ * Return current page's URL.
7324
+ *
7325
+ * @author Vova Feldman (@svovaf)
7326
+ * @since 1.0.7
7327
+ *
7328
+ * @return string
7329
+ */
7330
+ function current_page_url() {
7331
+ $url = 'http';
7332
+
7333
+ if ( isset( $_SERVER["HTTPS"] ) ) {
7334
+ if ( $_SERVER["HTTPS"] == "on" ) {
7335
+ $url .= "s";
7336
+ }
7337
+ }
7338
+ $url .= "://";
7339
+ if ( $_SERVER["SERVER_PORT"] != "80" ) {
7340
+ $url .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
7341
+ } else {
7342
+ $url .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
7343
+ }
7344
+
7345
+ return esc_url( $url );
7346
+ }
7347
+
7348
+ /**
7349
+ * Check if the current page is the plugin's main admin settings page.
7350
+ *
7351
+ * @author Vova Feldman (@svovaf)
7352
+ * @since 1.0.7
7353
+ *
7354
+ * @return bool
7355
+ */
7356
+ function _is_plugin_page() {
7357
+ return fs_is_plugin_page( $this->_menu->get_raw_slug() ) ||
7358
+ fs_is_plugin_page( $this->_slug );
7359
+ }
7360
+
7361
+ /* Events
7362
+ ------------------------------------------------------------------------------------------------------------------*/
7363
+ /**
7364
+ * Delete site install from Database.
7365
+ *
7366
+ * @author Vova Feldman (@svovaf)
7367
+ * @since 1.0.1
7368
+ *
7369
+ * @param bool $store
7370
+ * @param int|null $blog_id Since 2.0.0
7371
+ *
7372
+ * @return false|int The install ID if deleted. Otherwise, FALSE (when install not exist).
7373
+ */
7374
+ function _delete_site( $store = true, $blog_id = null ) {
7375
+ return self::_delete_site_by_slug( $this->_slug, $this->_module_type, $store, $blog_id );
7376
+ }
7377
+
7378
+ /**
7379
+ * Delete site install from Database.
7380
+ *
7381
+ * @author Vova Feldman (@svovaf)
7382
+ * @since 1.2.2.7
7383
+ *
7384
+ * @param string $slug
7385
+ * @param string $module_type
7386
+ * @param bool $store
7387
+ * @param int|null $blog_id Since 2.0.0
7388
+ *
7389
+ * @return false|int The install ID if deleted. Otherwise, FALSE (when install not exist).
7390
+ */
7391
+ static function _delete_site_by_slug( $slug, $module_type, $store = true, $blog_id = null ) {
7392
+ $sites = self::get_all_sites( $module_type, $blog_id );
7393
+
7394
+ $install_id = false;
7395
+
7396
+ if ( isset( $sites[ $slug ] ) ) {
7397
+ if ( is_object( $sites[ $slug ] ) ) {
7398
+ $install_id = $sites[ $slug ]->id;
7399
+ }
7400
+
7401
+ unset( $sites[ $slug ] );
7402
+
7403
+ self::set_account_option_by_module( $module_type, 'sites', $sites, $store, $blog_id );
7404
+ }
7405
+
7406
+ return $install_id;
7407
+ }
7408
+
7409
+ /**
7410
+ * Delete user.
7411
+ *
7412
+ * @author Vova Feldman (@svovaf)
7413
+ * @since 2.0.0
7414
+ *
7415
+ * @param number $user_id
7416
+ * @param bool $store
7417
+ *
7418
+ * @return false|int The user ID if deleted. Otherwise, FALSE (when install not exist).
7419
+ */
7420
+ private static function delete_user( $user_id, $store = true ) {
7421
+ $users = self::get_all_users();
7422
+
7423
+ if ( ! is_array( $users ) || ! isset( $users[ $user_id ] ) ) {
7424
+ return false;
7425
+ }
7426
+
7427
+ unset( $users[ $user_id ] );
7428
+
7429
+ self::$_accounts->set_option( 'users', $users, $store );
7430
+
7431
+ return $user_id;
7432
+ }
7433
+
7434
+ /**
7435
+ * Delete plugin's plans information.
7436
+ *
7437
+ * @param bool $store Flush to Database if true.
7438
+ * @param bool $keep_associated_plans If set to false, delete all plans, even if a plan is associated with an install.
7439
+ *
7440
+ * @author Vova Feldman (@svovaf)
7441
+ * @since 1.0.9
7442
+ */
7443
+ private function _delete_plans( $store = true, $keep_associated_plans = true ) {
7444
+ $this->_logger->entrance();
7445
+
7446
+ $plans = self::get_all_plans( $this->_module_type );
7447
+
7448
+ $plans_to_keep = array();
7449
+
7450
+ if ( $keep_associated_plans ) {
7451
+ $plans_ids_to_keep = $this->get_plans_ids_associated_with_installs();
7452
+ foreach ( $plans_ids_to_keep as $plan_id ) {
7453
+ $plan = self::_get_plan_by_id( $plan_id );
7454
+ if ( is_object( $plan ) ) {
7455
+ $plans_to_keep[] = self::_encrypt_entity( $plan );
7456
+ }
7457
+ }
7458
+ }
7459
+
7460
+ if ( ! empty( $plans_to_keep ) ) {
7461
+ $plans[ $this->_slug ] = $plans_to_keep;
7462
+ } else {
7463
+ unset( $plans[ $this->_slug ] );
7464
+ }
7465
+
7466
+ $this->set_account_option( 'plans', $plans, $store );
7467
+ }
7468
+
7469
+ /**
7470
+ * Delete all plugin licenses.
7471
+ *
7472
+ * @author Vova Feldman (@svovaf)
7473
+ * @since 1.0.9
7474
+ *
7475
+ * @param bool $store
7476
+ */
7477
+ private function _delete_licenses( $store = true ) {
7478
+ $this->_logger->entrance();
7479
+
7480
+ $all_licenses = self::get_all_licenses();
7481
+
7482
+ unset( $all_licenses[ $this->_module_id ] );
7483
+
7484
+ self::$_accounts->set_option( 'all_licenses', $all_licenses, $store );
7485
+ }
7486
+
7487
+ /**
7488
+ * Check if Freemius was added on new plugin installation.
7489
+ *
7490
+ * @author Vova Feldman (@svovaf)
7491
+ * @since 1.1.5
7492
+ *
7493
+ * @return bool
7494
+ */
7495
+ function is_plugin_new_install() {
7496
+ return isset( $this->_storage->is_plugin_new_install ) &&
7497
+ $this->_storage->is_plugin_new_install;
7498
+ }
7499
+
7500
+ /**
7501
+ * Check if it's the first plugin release that is running Freemius.
7502
+ *
7503
+ * @author Vova Feldman (@svovaf)
7504
+ * @since 1.2.1.5
7505
+ *
7506
+ * @return bool
7507
+ */
7508
+ function is_first_freemius_powered_version() {
7509
+ return empty( $this->_storage->plugin_last_version );
7510
+ }
7511
+
7512
+ /**
7513
+ * @author Leo Fajardo (@leorw)
7514
+ * @since 1.2.2
7515
+ *
7516
+ * @return bool|string
7517
+ */
7518
+ private function get_previous_theme_slug() {
7519
+ return isset( $this->_storage->previous_theme ) ?
7520
+ $this->_storage->previous_theme :
7521
+ false;
7522
+ }
7523
+
7524
+ /**
7525
+ * @author Leo Fajardo (@leorw)
7526
+ * @since 1.2.2
7527
+ *
7528
+ * @return string
7529
+ */
7530
+ private function can_activate_previous_theme() {
7531
+ $slug = $this->get_previous_theme_slug();
7532
+ if ( false !== $slug && current_user_can( 'switch_themes' ) ) {
7533
+ $theme_instance = wp_get_theme( $slug );
7534
+
7535
+ return $theme_instance->exists();
7536
+ }
7537
+
7538
+ return false;
7539
+ }
7540
+
7541
+ /**
7542
+ * @author Leo Fajardo (@leorw)
7543
+ * @since 1.2.2
7544
+ */
7545
+ private function activate_previous_theme() {
7546
+ switch_theme( $this->get_previous_theme_slug() );
7547
+ unset( $this->_storage->previous_theme );
7548
+
7549
+ global $pagenow;
7550
+ if ( 'themes.php' === $pagenow ) {
7551
+ /**
7552
+ * Refresh the active theme information.
7553
+ *
7554
+ * @author Leo Fajardo (@leorw)
7555
+ * @since 1.2.2
7556
+ */
7557
+ fs_redirect( $this->admin_url( $pagenow ) );
7558
+ }
7559
+ }
7560
+
7561
+ /**
7562
+ * @author Leo Fajardo (@leorw)
7563
+ * @since 1.2.2
7564
+ *
7565
+ * @return string
7566
+ */
7567
+ function get_previous_theme_activation_url() {
7568
+ if ( ! $this->can_activate_previous_theme() ) {
7569
+ return '';
7570
+ }
7571
+
7572
+ /**
7573
+ * Activation URL
7574
+ *
7575
+ * @author Leo Fajardo (@leorw)
7576
+ * @since 1.2.2
7577
+ */
7578
+ return wp_nonce_url(
7579
+ $this->admin_url( 'themes.php?action=activate&stylesheet=' . urlencode( $this->get_previous_theme_slug() ) ),
7580
+ 'switch-theme_' . $this->get_previous_theme_slug()
7581
+ );
7582
+ }
7583
+
7584
+ /**
7585
+ * Saves the slug of the previous theme if it still exists so that it can be used by the logic in the opt-in
7586
+ * form that decides whether to add a close button to the opt-in dialog or not. So after a premium-only theme is
7587
+ * activated, the close button will appear and will reactivate the previous theme if clicked. If the previous
7588
+ * theme doesn't exist, then there will be no close button.
7589
+ *
7590
+ * @author Leo Fajardo (@leorw)
7591
+ * @since 1.2.2
7592
+ *
7593
+ * @param string $slug_or_name Old theme's slug or name.
7594
+ * @param bool|WP_Theme $old_theme WP_Theme instance of the old theme if it still exists.
7595
+ */
7596
+ function _activate_theme_event_hook( $slug_or_name, $old_theme = false ) {
7597
+ $this->_storage->previous_theme = ( false !== $old_theme ) ?
7598
+ $old_theme->get_stylesheet() :
7599
+ $slug_or_name;
7600
+
7601
+ $this->_activate_plugin_event_hook();
7602
+ }
7603
+
7604
+ /**
7605
+ * Plugin activated hook.
7606
+ *
7607
+ * @author Vova Feldman (@svovaf)
7608
+ * @since 1.0.1
7609
+ *
7610
+ * @uses FS_Api
7611
+ */
7612
+ function _activate_plugin_event_hook() {
7613
+ $this->_logger->entrance( 'slug = ' . $this->_slug );
7614
+
7615
+ if ( ! $this->is_user_admin() ) {
7616
+ return;
7617
+ }
7618
+
7619
+ $this->unregister_uninstall_hook();
7620
+
7621
+ // Clear API cache on activation.
7622
+ FS_Api::clear_cache();
7623
+
7624
+ $is_premium_version_activation = $this->is_plugin() ?
7625
+ ( current_filter() !== ( 'activate_' . $this->_free_plugin_basename ) ) :
7626
+ $this->is_premium();
7627
+
7628
+ $this->_logger->info( 'Activating ' . ( $is_premium_version_activation ? 'premium' : 'free' ) . ' plugin version.' );
7629
+
7630
+ if ( $this->is_plugin() ) {
7631
+ // This logic is relevant only to plugins since both the free and premium versions of a plugin can be active at the same time.
7632
+ // 1. If running in the activation of the FREE module, get the basename of the PREMIUM.
7633
+ // 2. If running in the activation of the PREMIUM module, get the basename of the FREE.
7634
+ $other_version_basename = $is_premium_version_activation ?
7635
+ $this->_free_plugin_basename :
7636
+ $this->premium_plugin_basename();
7637
+
7638
+ if ( ! $this->_is_network_active ) {
7639
+ /**
7640
+ * Themes are always network activated, but the ACTUAL activation is per site.
7641
+ *
7642
+ * During the activation, the plugin isn't yet active, therefore,
7643
+ * _is_network_active will be set to false even if it's a network level
7644
+ * activation. So we need to fix that by looking at the is_network_admin() value.
7645
+ *
7646
+ * @author Vova Feldman
7647
+ */
7648
+ $this->_is_network_active = (
7649
+ $this->_is_multisite_integrated &&
7650
+ fs_is_network_admin()
7651
+ );
7652
+ }
7653
+
7654
+ /**
7655
+ * If the other module version is active, deactivate it.
7656
+ *
7657
+ * is_plugin_active() checks if the plugin is active on the site or the network level and
7658
+ * deactivate_plugins() deactivates the plugin whether it's activated on the site or network level.
7659
+ *
7660
+ * @author Leo Fajardo (@leorw)
7661
+ * @since 1.2.2
7662
+ */
7663
+ if ( is_plugin_active( $other_version_basename ) ) {
7664
+ deactivate_plugins( $other_version_basename );
7665
+ }
7666
+ }
7667
+
7668
+ if ( $this->is_registered() ) {
7669
+ if ( $is_premium_version_activation ) {
7670
+ $this->reconnect_locally();
7671
+ }
7672
+
7673
+
7674
+ // Schedule re-activation event and sync.
7675
+ // $this->sync_install( array(), true );
7676
+ $this->schedule_install_sync();
7677
+
7678
+ // If activating the premium module version, add an admin notice to congratulate for an upgrade completion.
7679
+ if ( $is_premium_version_activation ) {
7680
+ $this->_admin_notices->add(
7681
+ sprintf( $this->get_text_inline( 'The upgrade of %s was successfully completed.', 'successful-version-upgrade-message' ), sprintf( '<b>%s</b>', $this->_plugin->title ) ),
7682
+ $this->get_text_x_inline( 'W00t',
7683
+ 'Used to express elation, enthusiasm, or triumph (especially in electronic communication).', 'woot' ) . '!'
7684
+ );
7685
+ }
7686
+ } else if ( $this->is_anonymous() ) {
7687
+ if ( isset( $this->_storage->is_anonymous_ms ) && $this->_storage->is_anonymous_ms['is'] ) {
7688
+ $plugin_version = $this->_storage->is_anonymous_ms['version'];
7689
+ $network = true;
7690
+ } else {
7691
+ $plugin_version = $this->_storage->is_anonymous['version'];
7692
+ $network = false;
7693
+ }
7694
+
7695
+ /**
7696
+ * Reset "skipped" click cache on the following:
7697
+ * 1. Freemius DEV mode.
7698
+ * 2. WordPress DEBUG mode.
7699
+ * 3. If a plugin and the user skipped the exact same version before.
7700
+ *
7701
+ * @since 1.2.2.7 Ulrich Pogson (@grapplerulrich) asked to not reset the SKIPPED flag if the exact same THEME version was activated before unless the developer is running with WP_DEBUG on, or Freemius debug mode on (WP_FS__DEV_MODE).
7702
+ *
7703
+ * @todo 4. If explicitly asked to retry after every activation.
7704
+ */
7705
+ if ( WP_FS__DEV_MODE ||
7706
+ (
7707
+ ( $this->is_plugin() || ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ) &&
7708
+ $this->get_plugin_version() == $plugin_version
7709
+ )
7710
+ ) {
7711
+ $this->reset_anonymous_mode( $network );
7712
+ }
7713
+ }
7714
+
7715
+ $is_trial_or_has_features_enabled_license = ( $this->is_trial() || $this->has_features_enabled_license() );
7716
+
7717
+ if ( $this->is_addon() && ! $is_trial_or_has_features_enabled_license ) {
7718
+ /**
7719
+ * When activating an add-on, try to also activate a license.
7720
+ *
7721
+ * @author Leo Fajardo (@leorw)
7722
+ * @since 2.3.0
7723
+ */
7724
+ if ( ! $this->_is_network_active ) {
7725
+ $this->maybe_activate_addon_license();
7726
+ } else {
7727
+ $this->maybe_network_activate_addon_license();
7728
+ }
7729
+
7730
+ /**
7731
+ * Avoid redirecting to the license activation screen after automatically activating an add-on license.
7732
+ *
7733
+ * @author Leo Fajardo (@leorw)
7734
+ * @since 2.3.0
7735
+ */
7736
+ $is_trial_or_has_features_enabled_license = ( $this->is_trial() || $this->has_features_enabled_license() );
7737
+
7738
+ if ( $is_trial_or_has_features_enabled_license && true === $this->_storage->require_license_activation ) {
7739
+ $this->_storage->require_license_activation = false;
7740
+ }
7741
+ }
7742
+
7743
+ if (
7744
+ $is_premium_version_activation &&
7745
+ (
7746
+ ( ! $this->is_registered() && $this->is_anonymous() ) ||
7747
+ (
7748
+ $this->is_registered() &&
7749
+ ! $is_trial_or_has_features_enabled_license
7750
+ )
7751
+ )
7752
+ ) {
7753
+ $this->_storage->require_license_activation = true;
7754
+ }
7755
+
7756
+ if ( ! isset( $this->_storage->is_plugin_new_install ) ) {
7757
+ /**
7758
+ * If no previous version of plugin's version exist, it means that it's either
7759
+ * the first time that the plugin installed on the site, or the plugin was installed
7760
+ * before but didn't have Freemius integrated.
7761
+ *
7762
+ * Since register_activation_hook() do NOT fires on updates since 3.1, and only fires
7763
+ * on manual activation via the dashboard, is_plugin_activation() is TRUE
7764
+ * only after immediate activation.
7765
+ *
7766
+ * @since 1.1.4
7767
+ * @link https://make.wordpress.org/core/2010/10/27/plugin-activation-hooks-no-longer-fire-for-updates/
7768
+ */
7769
+ $this->_storage->is_plugin_new_install = empty( $this->_storage->plugin_last_version );
7770
+ }
7771
+
7772
+ if ( ! $this->_anonymous_mode &&
7773
+ $this->has_api_connectivity( WP_FS__DEV_MODE ) &&
7774
+ ! $this->_isAutoInstall
7775
+ ) {
7776
+ // Store hint that the plugin was just activated to enable auto-redirection to settings.
7777
+ set_transient( "fs_{$this->_module_type}_{$this->_slug}_activated", true, 60 );
7778
+ }
7779
+
7780
+ /**
7781
+ * Activation hook is executed after the plugin's main file is loaded, therefore,
7782
+ * after the plugin was loaded. The logic is located at activate_plugin()
7783
+ * ./wp-admin/includes/plugin.php.
7784
+ *
7785
+ * @author Vova Feldman (@svovaf)
7786
+ * @since 1.1.9
7787
+ */
7788
+ $this->_storage->was_plugin_loaded = true;
7789
+ }
7790
+
7791
+ /**
7792
+ * @author Leo Fajardo (@leorw)
7793
+ * @since 2.3.0
7794
+ */
7795
+ private function maybe_activate_addon_license() {
7796
+ $parent_fs = $this->get_parent_instance();
7797
+
7798
+ if (
7799
+ ! is_object( $parent_fs ) ||
7800
+ ( ! $parent_fs->is_registered() && ! $parent_fs->is_network_registered() )
7801
+ ) {
7802
+ // Try to activate a license only if the parent plugin is active and has a valid `install`.
7803
+ return;
7804
+ }
7805
+
7806
+ $license = $this->get_addon_active_parent_license();
7807
+ if ( ! is_object( $license ) ) {
7808
+ return;
7809
+ }
7810
+
7811
+ if ( ! $this->is_registered() ) {
7812
+ // Opt in with a license key.
7813
+ $this->opt_in(
7814
+ $parent_fs->get_current_or_network_user()->email,
7815
+ false,
7816
+ false,
7817
+ $license->secret_key
7818
+ );
7819
+ } else {
7820
+ // Activate the license.
7821
+ $install = $this->get_api_site_scope()->call(
7822
+ '/',
7823
+ 'put',
7824
+ array( 'license_key' => $this->apply_filters( 'license_key', $license->secret_key ) )
7825
+ );
7826
+
7827
+ if ( ! FS_Api::is_api_error( $install ) ) {
7828
+ $this->_sync_addon_license( $this->get_id(), true );
7829
+ }
7830
+ }
7831
+ }
7832
+
7833
+
7834
+ /**
7835
+ * @author Leo Fajardo (@leorw)
7836
+ * @since 2.3.0
7837
+ *
7838
+ * @param FS_Plugin_License $license
7839
+ */
7840
+ private function maybe_network_activate_addon_license( $license = null ) {
7841
+ $parent_fs = $this->get_parent_instance();
7842
+ if ( ! is_object( $parent_fs ) || ( ! $parent_fs->is_registered() && ! $parent_fs->is_network_registered() ) ) {
7843
+ // Try to activate a license only if the parent plugin is active and has a valid `install`.
7844
+ return;
7845
+ }
7846
+
7847
+ $license = ( ! is_null( $license ) ) ?
7848
+ $license :
7849
+ $this->get_addon_active_parent_license();
7850
+
7851
+ if ( ! is_object( $license ) ) {
7852
+ return;
7853
+ }
7854
+
7855
+ if ( ! $this->is_network_registered() ) {
7856
+ $sites = $this->get_sites_for_network_level_optin();
7857
+
7858
+ if ( count( $sites ) > $license->left() ) {
7859
+ // If the add-on is network active, try to activate the license only if it can be activated on all sites.
7860
+ return;
7861
+ }
7862
+
7863
+ // Opt in with a license key.
7864
+ $this->opt_in(
7865
+ $parent_fs->get_user()->email,
7866
+ false,
7867
+ false,
7868
+ $license->secret_key,
7869
+ false,
7870
+ false,
7871
+ false,
7872
+ null,
7873
+ $sites
7874
+ );
7875
+ } else {
7876
+ $blog_2_install_map = array();
7877
+ $site_ids = array();
7878
+
7879
+ $all_sites = Freemius::get_sites();
7880
+
7881
+ foreach ( $all_sites as $site ) {
7882
+ $blog_id = Freemius::get_site_blog_id( $site );
7883
+ $install = $this->get_install_by_blog_id( $blog_id );
7884
+
7885
+ if ( is_object( $install ) && FS_Plugin_License::is_valid_id( $install->license_id ) ) {
7886
+ // Skip license activation for installs that are already associated with a license.
7887
+ continue;
7888
+ }
7889
+
7890
+ if ( is_object( $install ) ) {
7891
+ $blog_2_install_map[ $blog_id ] = $install;
7892
+ } else {
7893
+ $site_ids[] = $blog_id;
7894
+ }
7895
+ }
7896
+
7897
+ if ( ( count( $blog_2_install_map ) + count( $site_ids ) ) > $license->left() ) {
7898
+ return;
7899
+ }
7900
+
7901
+ $user = $this->get_current_or_network_user();
7902
+
7903
+ if ( ! empty( $blog_2_install_map ) ) {
7904
+ $result = $this->activate_license_on_many_installs( $user, $license->secret_key, $blog_2_install_map );
7905
+
7906
+ if ( true !== $result ) {
7907
+ return;
7908
+ }
7909
+ }
7910
+
7911
+ if ( ! empty( $site_ids ) ) {
7912
+ $this->activate_license_on_many_sites( $user, $license->secret_key, $site_ids );
7913
+ }
7914
+ }
7915
+ }
7916
+
7917
+ /**
7918
+ * @author Leo Fajardo (@leorw)
7919
+ * @since 2.3.0
7920
+ *
7921
+ * @return FS_Plugin_License
7922
+ */
7923
+ private function get_addon_active_parent_license() {
7924
+ $parent_licenses_endpoint = "/plugins/{$this->get_id()}/parent_licenses.json?filter=activatable";
7925
+ $parent_instance = $this->get_parent_instance();
7926
+
7927
+ $foreign_licenses = $parent_instance->get_foreign_licenses_info(
7928
+ self::get_all_licenses( $this->get_parent_id() )
7929
+ );
7930
+
7931
+ if ( ! empty ( $foreign_licenses ) ) {
7932
+ $foreign_licenses = array(
7933
+ // Prefix with `+` to tell the server to include foreign licenses in the licenses collection.
7934
+ 'ids' => ( urlencode( '+' ) . implode( ',', $foreign_licenses['ids'] ) ),
7935
+ 'license_keys' => implode( ',', array_map( 'urlencode', $foreign_licenses['license_keys'] ) )
7936
+ );
7937
+
7938
+ $parent_licenses_endpoint = add_query_arg( $foreign_licenses, $parent_licenses_endpoint );
7939
+ }
7940
+
7941
+ $result = $parent_instance->get_current_or_network_user_api_scope()->get( $parent_licenses_endpoint, true );
7942
+
7943
+ if (
7944
+ ! $this->is_api_result_object( $result, 'licenses' ) ||
7945
+ ! is_array( $result->licenses ) ||
7946
+ empty( $result->licenses )
7947
+ ) {
7948
+ return null;
7949
+ }
7950
+
7951
+ $license = new FS_Plugin_License( $result->licenses[ 0 ] );
7952
+
7953
+ return $license;
7954
+ }
7955
+
7956
+ /**
7957
+ * @author Leo Fajardo (@leorw)
7958
+ * @since 2.3.0
7959
+ *
7960
+ * @return array
7961
+ */
7962
+ function get_sites_for_network_level_optin() {
7963
+ $sites = array();
7964
+ $all_sites = self::get_sites();
7965
+
7966
+ foreach ( $all_sites as $site ) {
7967
+ $blog_id = self::get_site_blog_id( $site );
7968
+
7969
+ if ( ! $this->is_site_delegated_connection( $blog_id ) &&
7970
+ ! $this->is_installed_on_site( $blog_id )
7971
+ ) {
7972
+ $sites[] = $this->get_site_info( $site );
7973
+ }
7974
+ }
7975
+
7976
+ return $sites;
7977
+ }
7978
+
7979
+ /**
7980
+ * Delete account.
7981
+ *
7982
+ * @author Vova Feldman (@svovaf)
7983
+ * @since 1.0.3
7984
+ *
7985
+ * @param bool $check_user Enforce checking if user have plugins activation privileges.
7986
+ */
7987
+ function delete_account_event( $check_user = true ) {
7988
+ $this->_logger->entrance( 'slug = ' . $this->_slug );
7989
+
7990
+ if ( $check_user && ! $this->is_user_admin() ) {
7991
+ return;
7992
+ }
7993
+
7994
+ $this->do_action( 'before_account_delete' );
7995
+
7996
+ // Clear all admin notices.
7997
+ $this->_admin_notices->clear_all_sticky( false );
7998
+
7999
+ $this->_delete_site( false );
8000
+
8001
+ $delete_network_common_data = true;
8002
+
8003
+ if ( $this->_is_network_active ) {
8004
+ $installs = $this->get_blog_install_map();
8005
+
8006
+ // Don't delete common network data unless no other installs left.
8007
+ $delete_network_common_data = empty( $installs );
8008
+ }
8009
+
8010
+ if ( $delete_network_common_data ) {
8011
+ $this->_delete_plans( false );
8012
+
8013
+ $this->_delete_licenses( false );
8014
+
8015
+ // Delete add-ons related to plugin's account.
8016
+ $this->_delete_account_addons( false );
8017
+ }
8018
+
8019
+ // @todo Delete plans and licenses of add-ons.
8020
+
8021
+ self::$_accounts->store();
8022
+
8023
+ /**
8024
+ * IMPORTANT:
8025
+ * Clear crons must be executed before clearing all storage.
8026
+ * Otherwise, the cron will not be cleared.
8027
+ */
8028
+ if ( $delete_network_common_data ) {
8029
+ $this->clear_sync_cron();
8030
+ }
8031
+
8032
+ $this->clear_install_sync_cron();
8033
+
8034
+ // Clear all storage data.
8035
+ $this->_storage->clear_all( true, array(
8036
+ 'is_delegated_connection',
8037
+ 'connectivity_test',
8038
+ 'is_on',
8039
+ ), false );
8040
+
8041
+ // Send delete event.
8042
+ $this->get_api_site_scope()->call( '/', 'delete' );
8043
+
8044
+ $this->do_action( 'after_account_delete' );
8045
+ }
8046
+
8047
+ /**
8048
+ * Delete network level account.
8049
+ *
8050
+ * @author Vova Feldman (@svovaf)
8051
+ * @since 2.0.0
8052
+ *
8053
+ * @param bool $check_user Enforce checking if user have plugins activation privileges.
8054
+ */
8055
+ function delete_network_account_event( $check_user = true ) {
8056
+ $this->_logger->entrance( 'slug = ' . $this->_slug );
8057
+
8058
+ if ( $check_user && ! $this->is_user_admin() ) {
8059
+ return;
8060
+ }
8061
+
8062
+ $this->do_action( 'before_network_account_delete' );
8063
+
8064
+ // Clear all admin notices.
8065
+ $this->_admin_notices->clear_all_sticky();
8066
+
8067
+ $this->_delete_plans( false, false );
8068
+
8069
+ $this->_delete_licenses( false );
8070
+
8071
+ // Delete add-ons related to plugin's account.
8072
+ $this->_delete_account_addons( false );
8073
+
8074
+ // @todo Delete plans and licenses of add-ons.
8075
+
8076
+ self::$_accounts->store( true );
8077
+
8078
+ /**
8079
+ * IMPORTANT:
8080
+ * Clear crons must be executed before clearing all storage.
8081
+ * Otherwise, the cron will not be cleared.
8082
+ */
8083
+ $this->clear_sync_cron( true );
8084
+ $this->clear_install_sync_cron( true );
8085
+
8086
+ $sites = self::get_sites();
8087
+
8088
+ $install_ids = array();
8089
+ foreach ( $sites as $site ) {
8090
+ $blog_id = self::get_site_blog_id( $site );
8091
+
8092
+ if ( $this->is_site_delegated_connection( $blog_id ) ) {
8093
+ continue;
8094
+ }
8095
+
8096
+ $install_id = $this->_delete_site( true, $blog_id );
8097
+
8098
+ // Clear all storage data.
8099
+ $this->_storage->clear_all( true, array( 'connectivity_test' ), $blog_id );
8100
+
8101
+ if ( FS_Site::is_valid_id( $install_id ) ) {
8102
+ $install_ids[] = $install_id;
8103
+ }
8104
+
8105
+ switch_to_blog( $blog_id );
8106
+
8107
+ $this->do_action( 'after_account_delete' );
8108
+
8109
+ restore_current_blog();
8110
+ }
8111
+
8112
+ $this->_storage->clear_all( true, array(
8113
+ 'connectivity_test',
8114
+ 'is_on',
8115
+ ), true );
8116
+
8117
+ // Send delete event.
8118
+ if ( ! empty( $install_ids ) ) {
8119
+ $result = $this->get_current_or_network_user_api_scope()->call( "/plugins/{$this->_module_id}/installs.json?ids=" . implode( ',', $install_ids ), 'delete' );
8120
+ }
8121
+
8122
+ $this->do_action( 'after_network_account_delete' );
8123
+ }
8124
+
8125
+ /**
8126
+ * Plugin deactivation hook.
8127
+ *
8128
+ * @author Vova Feldman (@svovaf)
8129
+ * @since 1.0.1
8130
+ */
8131
+ function _deactivate_plugin_hook() {
8132
+ $this->_logger->entrance( 'slug = ' . $this->_slug );
8133
+
8134
+ if ( ! $this->is_user_admin() ) {
8135
+ return;
8136
+ }
8137
+
8138
+ $is_network_deactivation = fs_is_network_admin();
8139
+ $storage_keys_for_removal = array();
8140
+
8141
+ $this->_admin_notices->clear_all_sticky();
8142
+
8143
+ $storage_keys_for_removal[] = 'sticky_optin_added';
8144
+ if ( isset( $this->_storage->sticky_optin_added ) ) {
8145
+ unset( $this->_storage->sticky_optin_added );
8146
+ }
8147
+
8148
+ if ( ! isset( $this->_storage->is_plugin_new_install ) ) {
8149
+ // Remember that plugin was already installed.
8150
+ $this->_storage->is_plugin_new_install = false;
8151
+ }
8152
+
8153
+ // Hook to plugin uninstall.
8154
+ register_uninstall_hook( $this->_plugin_main_file_path, array( 'Freemius', '_uninstall_plugin_hook' ) );
8155
+
8156
+ $this->clear_module_main_file_cache();
8157
+ $this->clear_sync_cron( $this->_is_network_active );
8158
+ $this->clear_install_sync_cron();
8159
+
8160
+ if ( $this->is_registered() ) {
8161
+ if ( $this->is_premium() && ! $this->has_active_valid_license() ) {
8162
+ FS_Plugin_Updater::instance( $this )->delete_update_data();
8163
+ }
8164
+
8165
+ if ( $is_network_deactivation ) {
8166
+ // Send deactivation event.
8167
+ $this->sync_installs( array(
8168
+ 'is_active' => false,
8169
+ ) );
8170
+ } else {
8171
+ // Send deactivation event.
8172
+ $this->sync_install( array(
8173
+ 'is_active' => false,
8174
+ ) );
8175
+ }
8176
+ } else {
8177
+ if ( ! $this->has_api_connectivity() ) {
8178
+ // Reset connectivity test cache.
8179
+ unset( $this->_storage->connectivity_test );
8180
+
8181
+ $storage_keys_for_removal[] = 'connectivity_test';
8182
+ }
8183
+ }
8184
+
8185
+ if ( $is_network_deactivation ) {
8186
+ if ( isset( $this->_storage->sticky_optin_added_ms ) ) {
8187
+ unset( $this->_storage->sticky_optin_added_ms );
8188
+ }
8189
+
8190
+ if ( ! empty( $storage_keys_for_removal ) ) {
8191
+ $sites = self::get_sites();
8192
+
8193
+ foreach ( $sites as $site ) {
8194
+ $blog_id = self::get_site_blog_id( $site );
8195
+
8196
+ foreach ( $storage_keys_for_removal as $key ) {
8197
+ $this->_storage->remove( $key, false, $blog_id );
8198
+ }
8199
+
8200
+ $this->_storage->save( $blog_id );
8201
+ }
8202
+ }
8203
+ }
8204
+
8205
+ // Clear API cache on deactivation.
8206
+ FS_Api::clear_cache();
8207
+
8208
+ $this->remove_sdk_reference();
8209
+ }
8210
+
8211
+ /**
8212
+ * @author Vova Feldman (@svovaf)
8213
+ * @since 1.1.6
8214
+ */
8215
+ private function remove_sdk_reference() {
8216
+ global $fs_active_plugins;
8217
+
8218
+ foreach ( $fs_active_plugins->plugins as $sdk_path => $data ) {
8219
+ if ( $this->_plugin_basename == $data->plugin_path ) {
8220
+ unset( $fs_active_plugins->plugins[ $sdk_path ] );
8221
+ break;
8222
+ }
8223
+ }
8224
+
8225
+ fs_fallback_to_newest_active_sdk();
8226
+ }
8227
+
8228
+ /**
8229
+ * @author Vova Feldman (@svovaf)
8230
+ * @since 1.1.3
8231
+ *
8232
+ * @param bool $is_anonymous
8233
+ * @param bool|int $network_or_blog_id Since 2.0.0
8234
+ */
8235
+ private function set_anonymous_mode( $is_anonymous = true, $network_or_blog_id = 0 ) {
8236
+ // Store information regarding skip to try and opt-in the user
8237
+ // again in the future.
8238
+ $skip_info = array(
8239
+ 'is' => $is_anonymous,
8240
+ 'timestamp' => WP_FS__SCRIPT_START_TIME,
8241
+ 'version' => $this->get_plugin_version(),
8242
+ );
8243
+
8244
+ if ( true === $network_or_blog_id ) {
8245
+ $this->_storage->is_anonymous_ms = $skip_info;
8246
+ } else {
8247
+ $this->_storage->store( 'is_anonymous', $skip_info, $network_or_blog_id );
8248
+ }
8249
+
8250
+ $this->network_upgrade_mode_completed();
8251
+
8252
+ // Update anonymous mode cache.
8253
+ $this->_is_anonymous = $is_anonymous;
8254
+ }
8255
+
8256
+ /**
8257
+ * @author Vova Feldman (@svovaf)
8258
+ * @since 2.0.0
8259
+ *
8260
+ * @param int $blog_id Site ID.
8261
+ * @param int $user_id User ID.
8262
+ * @param string $domain Site domain.
8263
+ * @param string $path Site path.
8264
+ * @param int $network_id Network ID. Only relevant on multi-network installations.
8265
+ * @param array $meta Metadata. Used to set initial site options.
8266
+ *
8267
+ * @uses Freemius::is_license_network_active() to check if the context license was network activated by the super-admin.
8268
+ * @uses Freemius::is_network_connected() to check if the super-admin network opted-in.
8269
+ * @uses Freemius::is_network_anonymous() to check if the super-admin network skipped.
8270
+ * @uses Freemius::is_network_delegated_connection() to check if the super-admin network delegated the connection to the site admins.
8271
+ */
8272
+ function _after_new_blog_callback( $blog_id, $user_id, $domain, $path, $network_id, $meta ) {
8273
+ $this->_logger->entrance();
8274
+
8275
+ if ( $this->is_premium() &&
8276
+ $this->is_network_connected() &&
8277
+ is_object( $this->_license ) &&
8278
+ $this->_license->can_activate( FS_Site::is_localhost_by_address( $domain ) ) &&
8279
+ $this->is_license_network_active( $blog_id )
8280
+ ) {
8281
+ /**
8282
+ * Running the premium version, the license was network activated, and the license can also be activated on the current site -> so try to opt-in with the license key.
8283
+ */
8284
+ $current_blog_id = get_current_blog_id();
8285
+ $license = clone $this->_license;
8286
+
8287
+ $this->switch_to_blog( $blog_id );
8288
+
8289
+ // Opt-in with network user.
8290
+ $this->install_with_user(
8291
+ $this->get_network_user(),
8292
+ $license->secret_key,
8293
+ false,
8294
+ false,
8295
+ false
8296
+ );
8297
+
8298
+ if ( is_object( $this->_site ) ) {
8299
+ if ( $this->_site->license_id == $license->id ) {
8300
+ /**
8301
+ * If the license was activated successfully, sync the license data from the remote server.
8302
+ */
8303
+ $this->_license = $license;
8304
+ $this->sync_site_license();
8305
+ }
8306
+ }
8307
+
8308
+ $this->switch_to_blog( $current_blog_id );
8309
+
8310
+ if ( is_object( $this->_site ) ) {
8311
+ // Already connected (with or without a license), so no need to continue.
8312
+ return;
8313
+ }
8314
+ }
8315
+
8316
+ if ( $this->is_network_anonymous() ) {
8317
+ /**
8318
+ * Opt-in was network skipped so automatically skip the opt-in for the new site.
8319
+ */
8320
+ $this->skip_site_connection( $blog_id );
8321
+ } else if ( $this->is_network_delegated_connection() ) {
8322
+ /**
8323
+ * Opt-in was network delegated so automatically delegate the opt-in for the new site's admin.
8324
+ */
8325
+ $this->delegate_site_connection( $blog_id );
8326
+ } else if ( $this->is_network_connected() ) {
8327
+ /**
8328
+ * Opt-in was network activated so automatically opt-in with the network user and new site admin.
8329
+ */
8330
+ $current_blog_id = get_current_blog_id();
8331
+
8332
+ $this->switch_to_blog( $blog_id );
8333
+
8334
+ // Opt-in with network user.
8335
+ $this->install_with_user(
8336
+ $this->get_network_user(),
8337
+ false,
8338
+ false,
8339
+ false,
8340
+ false
8341
+ );
8342
+
8343
+ $this->switch_to_blog( $current_blog_id );
8344
+ } else {
8345
+ /**
8346
+ * If the super-admin mixed different options (connect, skip, delegated):
8347
+ * a) If at least one site connection was delegated, then automatically delegate connection.
8348
+ * b) Otherwise, it means that at least one site was skipped and at least one site was connected. For a simplified UX in the initial release of the multisite network integration, skip the connection for the newly created site. If the super-admin will want to opt-in they can still do that from the network level Account page.
8349
+ */
8350
+ $has_delegated_site = false;
8351
+
8352
+ $sites = self::get_sites();
8353
+ foreach ( $sites as $site ) {
8354
+ $blog_id = self::get_site_blog_id( $site );
8355
+
8356
+ if ( $this->is_site_delegated_connection( $blog_id ) ) {
8357
+ $has_delegated_site = true;
8358
+ break;
8359
+ }
8360
+ }
8361
+
8362
+ if ( $has_delegated_site ) {
8363
+ $this->delegate_site_connection( $blog_id );
8364
+ } else {
8365
+ $this->skip_site_connection( $blog_id );
8366
+ }
8367
+ }
8368
+ }
8369
+
8370
+ /**
8371
+ * @author Vova Feldman (@svovaf)
8372
+ * @since 1.1.3
8373
+ *
8374
+ * @param bool|int $network_or_blog_id Since 2.0.0.
8375
+ */
8376
+ private function reset_anonymous_mode( $network_or_blog_id = 0 ) {
8377
+ if ( true === $network_or_blog_id ) {
8378
+ unset( $this->_storage->is_anonymous_ms );
8379
+ } else {
8380
+ $this->_storage->remove( 'is_anonymous', true, $network_or_blog_id );
8381
+ }
8382
+
8383
+ /**
8384
+ * Ensure that this field is also "false", otherwise, if the current module's type is "theme" and the module
8385
+ * has no menus, the opt-in popup will not be shown immediately (in this case, the user will have to click
8386
+ * on the admin notice that contains the opt-in link in order to trigger the opt-in popup).
8387
+ *
8388
+ * @author Leo Fajardo (@leorw)
8389
+ * @since 1.2.2
8390
+ */
8391
+ if ( ! $this->_is_network_active ||
8392
+ 0 === $network_or_blog_id ||
8393
+ get_current_blog_id() == $network_or_blog_id ||
8394
+ ( true === $network_or_blog_id && fs_is_network_admin() )
8395
+ ) {
8396
+ $this->_is_anonymous = null;
8397
+ }
8398
+ }
8399
+
8400
+ /**
8401
+ * This is used to ensure that before redirecting to the opt-in page after resetting the anonymous mode or
8402
+ * deleting the account in the network level, the URL of the page to redirect to is correct.
8403
+ *
8404
+ * @author Leo Fajardo (@leorw)
8405
+ *
8406
+ * @since 2.1.3
8407
+ */
8408
+ private function maybe_set_slug_and_network_menu_exists_flag() {
8409
+ if ( ! empty( $this->_dynamically_added_top_level_page_hook_name ) ) {
8410
+ $this->_menu->set_slug_and_network_menu_exists_flag( $this->_menu->has_menu() ?
8411
+ $this->_menu->get_slug() :
8412
+ $this->_slug
8413
+ );
8414
+ }
8415
+ }
8416
+
8417
+ /**
8418
+ * Clears the anonymous mode and redirects to the opt-in screen.
8419
+ *
8420
+ * @author Vova Feldman (@svovaf)
8421
+ * @since 1.1.7
8422
+ */
8423
+ function connect_again() {
8424
+ if ( ! $this->is_anonymous() ) {
8425
+ return;
8426
+ }
8427
+
8428
+ $this->reset_anonymous_mode( fs_is_network_admin() );
8429
+
8430
+ $this->maybe_set_slug_and_network_menu_exists_flag();
8431
+
8432
+ fs_redirect( $this->get_activation_url() );
8433
+ }
8434
+
8435
+ /**
8436
+ * Skip account connect, and set anonymous mode.
8437
+ *
8438
+ * @author Vova Feldman (@svovaf)
8439
+ * @since 1.1.1
8440
+ *
8441
+ * @param array|null $sites Since 2.0.0. Specific sites.
8442
+ * @param bool $skip_all_network Since 2.0.0. If true, skip connection for all sites.
8443
+ */
8444
+ function skip_connection( $sites = null, $skip_all_network = false ) {
8445
+ $this->_logger->entrance();
8446
+
8447
+ $this->_admin_notices->remove_sticky( 'connect_account' );
8448
+
8449
+ if ( $skip_all_network ) {
8450
+ $this->set_anonymous_mode( true, true );
8451
+ }
8452
+
8453
+ if ( ! $skip_all_network && empty( $sites ) ) {
8454
+ $this->skip_site_connection();
8455
+ } else {
8456
+ $uids = array();
8457
+
8458
+ if ( $skip_all_network ) {
8459
+ $this->set_anonymous_mode( true, true );
8460
+
8461
+ $sites = self::get_sites();
8462
+ foreach ( $sites as $site ) {
8463
+ $blog_id = self::get_site_blog_id( $site );
8464
+ $this->skip_site_connection( $blog_id, false );
8465
+ $uids[] = $this->get_anonymous_id( $blog_id );
8466
+ }
8467
+ } else if ( ! empty( $sites ) ) {
8468
+ foreach ( $sites as $site ) {
8469
+ $uids[] = $site['uid'];
8470
+ $this->skip_site_connection( $site['blog_id'], false );
8471
+ }
8472
+ }
8473
+
8474
+ // Send anonymous skip event.
8475
+ // No user identified info nor any tracking will be sent after the user skips the opt-in.
8476
+ $this->get_api_plugin_scope()->call( 'skip.json', 'put', array(
8477
+ 'uids' => $uids,
8478
+ ) );
8479
+ }
8480
+
8481
+ $this->network_upgrade_mode_completed();
8482
+ }
8483
+
8484
+ /**
8485
+ * Skip connection for specific site in the network.
8486
+ *
8487
+ * @author Vova Feldman (@svovaf)
8488
+ * @since 2.0.0
8489
+ *
8490
+ * @param int|null $blog_id
8491
+ * @param bool $send_skip
8492
+ */
8493
+ private function skip_site_connection( $blog_id = null, $send_skip = true ) {
8494
+ $this->_logger->entrance();
8495
+
8496
+ $this->_admin_notices->remove_sticky( 'connect_account', $blog_id );
8497
+
8498
+ $this->set_anonymous_mode( true, $blog_id );
8499
+
8500
+ if ( $send_skip ) {
8501
+ $this->get_api_plugin_scope()->call( 'skip.json', 'put', array(
8502
+ 'uids' => array( $this->get_anonymous_id( $blog_id ) ),
8503
+ ) );
8504
+ }
8505
+ }
8506
+
8507
+ /**
8508
+ * Plugin version update hook.
8509
+ *
8510
+ * @author Vova Feldman (@svovaf)
8511
+ * @since 1.0.4
8512
+ */
8513
+ private function update_plugin_version_event() {
8514
+ $this->_logger->entrance();
8515
+
8516
+ if ( ! $this->is_registered() ) {
8517
+ return;
8518
+ }
8519
+
8520
+ $this->schedule_install_sync();
8521
+ // $this->sync_install( array(), true );
8522
+ }
8523
+
8524
+ /**
8525
+ * Generate an MD5 signature of a plugins collection.
8526
+ * This helper methods used to identify changes in a plugins collection.
8527
+ *
8528
+ * @author Vova Feldman (@svovaf)
8529
+ * @since 2.0.0
8530
+ *
8531
+ * @param array [string]array $plugins
8532
+ *
8533
+ * @return string
8534
+ */
8535
+ private function get_plugins_thumbprint( $plugins ) {
8536
+ ksort( $plugins );
8537
+
8538
+ $thumbprint = '';
8539
+ foreach ( $plugins as $basename => $data ) {
8540
+ $thumbprint .= $data['slug'] . ',' .
8541
+ $data['Version'] . ',' .
8542
+ ( $data['is_active'] ? '1' : '0' ) . ';';
8543
+ }
8544
+
8545
+ return md5( $thumbprint );
8546
+ }
8547
+
8548
+ /**
8549
+ * Return a list of modified plugins since the last sync.
8550
+ *
8551
+ * Note:
8552
+ * There's no point to store a plugins counter since even if the number of
8553
+ * plugins didn't change, we still need to check if the versions are all the
8554
+ * same and the activity state is similar.
8555
+ *
8556
+ * @author Vova Feldman (@svovaf)
8557
+ * @since 1.1.8
8558
+ *
8559
+ * @return array|false
8560
+ */
8561
+ private function get_plugins_data_for_api() {
8562
+ // Alias.
8563
+ $site_active_plugins_option_name = 'active_plugins';
8564
+ $network_plugins_option_name = 'all_plugins';
8565
+
8566
+ /**
8567
+ * Collection of all site level active plugins.
8568
+ */
8569
+ $site_active_plugins_cache = self::$_accounts->get_option( $site_active_plugins_option_name );
8570
+
8571
+ if ( ! is_object( $site_active_plugins_cache ) ) {
8572
+ $site_active_plugins_cache = (object) array(
8573
+ 'timestamp' => '',
8574
+ 'md5' => '',
8575
+ 'plugins' => array(),
8576
+ );
8577
+ }
8578
+
8579
+ $time = time();
8580
+
8581
+ if ( ! empty( $site_active_plugins_cache->timestamp ) &&
8582
+ ( $time - $site_active_plugins_cache->timestamp ) < WP_FS__TIME_5_MIN_IN_SEC
8583
+ ) {
8584
+ // Don't send plugin updates if last update was in the past 5 min.
8585
+ return false;
8586
+ }
8587
+
8588
+ // Write timestamp to lock the logic.
8589
+ $site_active_plugins_cache->timestamp = $time;
8590
+ self::$_accounts->set_option( $site_active_plugins_option_name, $site_active_plugins_cache, true );
8591
+
8592
+ // Reload options from DB.
8593
+ self::$_accounts->load( true );
8594
+ $site_active_plugins_cache = self::$_accounts->get_option( $site_active_plugins_option_name );
8595
+
8596
+ if ( $time != $site_active_plugins_cache->timestamp ) {
8597
+ // If timestamp is different, then another thread captured the lock.
8598
+ return false;
8599
+ }
8600
+
8601
+ /**
8602
+ * Collection of all plugins (network level).
8603
+ */
8604
+ $network_plugins_cache = self::$_accounts->get_option( $network_plugins_option_name );
8605
+
8606
+ if ( ! is_object( $network_plugins_cache ) ) {
8607
+ $network_plugins_cache = (object) array(
8608
+ 'timestamp' => '',
8609
+ 'md5' => '',
8610
+ 'plugins' => array(),
8611
+ );
8612
+ }
8613
+
8614
+ // Check if there's a change in plugins.
8615
+ $network_plugins = self::get_network_plugins();
8616
+ $site_active_plugins = self::get_site_active_plugins();
8617
+
8618
+ $network_plugins_thumbprint = $this->get_plugins_thumbprint( $network_plugins );
8619
+ $site_active_plugins_thumbprint = $this->get_plugins_thumbprint( $site_active_plugins );
8620
+
8621
+ // Check if plugins status changed (version or active/inactive).
8622
+ $network_plugins_changed = ( $network_plugins_cache->md5 !== $network_plugins_thumbprint );
8623
+ $site_active_plugins_changed = ( $site_active_plugins_cache->md5 !== $site_active_plugins_thumbprint );
8624
+
8625
+ if ( ! $network_plugins_changed &&
8626
+ ! $site_active_plugins_changed
8627
+ ) {
8628
+ // No changes.
8629
+ return array();
8630
+ }
8631
+
8632
+ $plugins_update_data = array();
8633
+
8634
+ foreach ( $network_plugins_cache->plugins as $basename => $data ) {
8635
+ if ( ! isset( $network_plugins[ $basename ] ) ) {
8636
+ // Plugin uninstalled.
8637
+ $uninstalled_plugin_data = $data;
8638
+ $uninstalled_plugin_data['is_active'] = false;
8639
+ $uninstalled_plugin_data['is_uninstalled'] = true;
8640
+ $plugins_update_data[] = $uninstalled_plugin_data;
8641
+
8642
+ unset( $network_plugins[ $basename ] );
8643
+
8644
+ unset( $network_plugins_cache->plugins[ $basename ] );
8645
+ unset( $site_active_plugins_cache->plugins[ $basename ] );
8646
+
8647
+ continue;
8648
+ }
8649
+
8650
+ $was_active = $data['is_active'] ||
8651
+ ( isset( $site_active_plugins_cache->plugins[ $basename ] ) &&
8652
+ true === $site_active_plugins_cache->plugins[ $basename ]['is_active'] );
8653
+ $is_active = $network_plugins[ $basename ]['is_active'] ||
8654
+ ( isset( $site_active_plugins[ $basename ] ) &&
8655
+ $site_active_plugins[ $basename ]['is_active'] );
8656
+
8657
+ if ( ! isset( $site_active_plugins_cache->plugins[ $basename ] ) &&
8658
+ isset( $site_active_plugins[ $basename ] )
8659
+ ) {
8660
+ // Plugin was site level activated.
8661
+ $site_active_plugins_cache->plugins[ $basename ] = $network_plugins[ $basename ];
8662
+ $site_active_plugins_cache->plugins[ $basename ]['is_active'] = true;
8663
+ } else if ( isset( $site_active_plugins_cache->plugins[ $basename ] ) &&
8664
+ ! isset( $site_active_plugins[ $basename ] )
8665
+ ) {
8666
+ // Plugin was site level deactivated.
8667
+ unset( $site_active_plugins_cache->plugins[ $basename ] );
8668
+ }
8669
+
8670
+ $prev_version = $data['version'];
8671
+ $current_version = $network_plugins[ $basename ]['Version'];
8672
+
8673
+ if ( $was_active !== $is_active || $prev_version !== $current_version ) {
8674
+ // Plugin activated or deactivated, or version changed.
8675
+
8676
+ if ( $was_active !== $is_active ) {
8677
+ if ( $data['is_active'] != $network_plugins[ $basename ]['is_active'] ) {
8678
+ $network_plugins_cache->plugins[ $basename ]['is_active'] = $data['is_active'];
8679
+ }
8680
+ }
8681
+
8682
+ if ( $prev_version !== $current_version ) {
8683
+ $network_plugins_cache->plugins[ $basename ]['Version'] = $current_version;
8684
+ }
8685
+
8686
+ $updated_plugin_data = $data;
8687
+ $updated_plugin_data['is_active'] = $is_active;
8688
+ $updated_plugin_data['version'] = $current_version;
8689
+ $updated_plugin_data['title'] = $network_plugins[ $basename ]['Name'];
8690
+ $plugins_update_data[] = $updated_plugin_data;
8691
+ }
8692
+ }
8693
+
8694
+ // Find new plugins that weren't yet seen before.
8695
+ foreach ( $network_plugins as $basename => $data ) {
8696
+ if ( ! isset( $network_plugins_cache->plugins[ $basename ] ) ) {
8697
+ // New plugin.
8698
+ $new_plugin = array(
8699
+ 'slug' => $data['slug'],
8700
+ 'version' => $data['Version'],
8701
+ 'title' => $data['Name'],
8702
+ 'is_active' => $data['is_active'],
8703
+ 'is_uninstalled' => false,
8704
+ );
8705
+
8706
+ $plugins_update_data[] = $new_plugin;
8707
+ $network_plugins_cache->plugins[ $basename ] = $new_plugin;
8708
+
8709
+ if ( isset( $site_active_plugins[ $basename ] ) ) {
8710
+ $site_active_plugins_cache->plugins[ $basename ] = $new_plugin;
8711
+ $site_active_plugins_cache->plugins[ $basename ]['is_active'] = true;
8712
+ }
8713
+ }
8714
+ }
8715
+
8716
+ $site_active_plugins_cache->md5 = $site_active_plugins_thumbprint;
8717
+ $site_active_plugins_cache->timestamp = $time;
8718
+ self::$_accounts->set_option( $site_active_plugins_option_name, $site_active_plugins_cache, true );
8719
+
8720
+ $network_plugins_cache->md5 = $network_plugins_thumbprint;
8721
+ $network_plugins_cache->timestamp = $time;
8722
+ self::$_accounts->set_option( $network_plugins_option_name, $network_plugins_cache, true );
8723
+
8724
+ return $plugins_update_data;
8725
+ }
8726
+
8727
+ /**
8728
+ * Return a list of modified themes since the last sync.
8729
+ *
8730
+ * Note:
8731
+ * There's no point to store a themes counter since even if the number of
8732
+ * themes didn't change, we still need to check if the versions are all the
8733
+ * same and the activity state is similar.
8734
+ *
8735
+ * @author Vova Feldman (@svovaf)
8736
+ * @since 1.1.8
8737
+ *
8738
+ * @return array|false
8739
+ */
8740
+ private function get_themes_data_for_api() {
8741
+ // Alias.
8742
+ $option_name = 'all_themes';
8743
+
8744
+ $all_cached_themes = self::$_accounts->get_option( $option_name );
8745
+
8746
+ if ( ! is_object( $all_cached_themes ) ) {
8747
+ $all_cached_themes = (object) array(
8748
+ 'timestamp' => '',
8749
+ 'md5' => '',
8750
+ 'themes' => array(),
8751
+ );
8752
+ }
8753
+
8754
+ $time = time();
8755
+
8756
+ if ( ! empty( $all_cached_themes->timestamp ) &&
8757
+ ( $time - $all_cached_themes->timestamp ) < WP_FS__TIME_5_MIN_IN_SEC
8758
+ ) {
8759
+ // Don't send theme updates if last update was in the past 5 min.
8760
+ return false;
8761
+ }
8762
+
8763
+ // Write timestamp to lock the logic.
8764
+ $all_cached_themes->timestamp = $time;
8765
+ self::$_accounts->set_option( $option_name, $all_cached_themes, true );
8766
+
8767
+ // Reload options from DB.
8768
+ self::$_accounts->load( true );
8769
+ $all_cached_themes = self::$_accounts->get_option( $option_name );
8770
+
8771
+ if ( $time != $all_cached_themes->timestamp ) {
8772
+ // If timestamp is different, then another thread captured the lock.
8773
+ return false;
8774
+ }
8775
+
8776
+ // Get active theme.
8777
+ $active_theme = wp_get_theme();
8778
+ $active_theme_stylesheet = $active_theme->get_stylesheet();
8779
+
8780
+ // Check if there's a change in themes.
8781
+ $all_themes = wp_get_themes();
8782
+
8783
+ // Check if themes changed.
8784
+ ksort( $all_themes );
8785
+
8786
+ $themes_signature = '';
8787
+ foreach ( $all_themes as $slug => $data ) {
8788
+ $is_active = ( $slug === $active_theme_stylesheet );
8789
+ $themes_signature .= $slug . ',' .
8790
+ $data->version . ',' .
8791
+ ( $is_active ? '1' : '0' ) . ';';
8792
+ }
8793
+
8794
+ // Check if themes status changed (version or active/inactive).
8795
+ $themes_changed = ( $all_cached_themes->md5 !== md5( $themes_signature ) );
8796
+
8797
+ $themes_update_data = array();
8798
+
8799
+ if ( $themes_changed ) {
8800
+ // Change in themes, report changes.
8801
+
8802
+ // Update existing themes info.
8803
+ foreach ( $all_cached_themes->themes as $slug => $data ) {
8804
+ $is_active = ( $slug === $active_theme_stylesheet );
8805
+
8806
+ if ( ! isset( $all_themes[ $slug ] ) ) {
8807
+ // Plugin uninstalled.
8808
+ $uninstalled_theme_data = $data;
8809
+ $uninstalled_theme_data['is_active'] = false;
8810
+ $uninstalled_theme_data['is_uninstalled'] = true;
8811
+ $themes_update_data[] = $uninstalled_theme_data;
8812
+
8813
+ unset( $all_themes[ $slug ] );
8814
+ unset( $all_cached_themes->themes[ $slug ] );
8815
+ } else if ( $data['is_active'] !== $is_active ||
8816
+ $data['version'] !== $all_themes[ $slug ]->version
8817
+ ) {
8818
+ // Plugin activated or deactivated, or version changed.
8819
+
8820
+ $all_cached_themes->themes[ $slug ]['is_active'] = $is_active;
8821
+ $all_cached_themes->themes[ $slug ]['version'] = $all_themes[ $slug ]->version;
8822
+
8823
+ $themes_update_data[] = $all_cached_themes->themes[ $slug ];
8824
+ }
8825
+ }
8826
+
8827
+ // Find new themes that weren't yet seen before.
8828
+ foreach ( $all_themes as $slug => $data ) {
8829
+ if ( ! isset( $all_cached_themes->themes[ $slug ] ) ) {
8830
+ $is_active = ( $slug === $active_theme_stylesheet );
8831
+
8832
+ // New plugin.
8833
+ $new_plugin = array(
8834
+ 'slug' => $slug,
8835
+ 'version' => $data->version,
8836
+ 'title' => $data->name,
8837
+ 'is_active' => $is_active,
8838
+ 'is_uninstalled' => false,
8839
+ );
8840
+
8841
+ $themes_update_data[] = $new_plugin;
8842
+ $all_cached_themes->themes[ $slug ] = $new_plugin;
8843
+ }
8844
+ }
8845
+
8846
+ $all_cached_themes->md5 = md5( $themes_signature );
8847
+ $all_cached_themes->timestamp = time();
8848
+ self::$_accounts->set_option( $option_name, $all_cached_themes, true );
8849
+ }
8850
+
8851
+ return $themes_update_data;
8852
+ }
8853
+
8854
+ /**
8855
+ * Get site data for API install request.
8856
+ *
8857
+ * @author Vova Feldman (@svovaf)
8858
+ * @since 1.1.2
8859
+ *
8860
+ * @param string[] $override
8861
+ * @param bool $include_plugins Since 1.1.8 by default include plugin changes.
8862
+ * @param bool $include_themes Since 1.1.8 by default include plugin changes.
8863
+ * @param bool $include_blog_data Since 2.3.0 by default include the current blog's data (language, charset, title, and URL).
8864
+ *
8865
+ * @return array
8866
+ */
8867
+ private function get_install_data_for_api(
8868
+ array $override,
8869
+ $include_plugins = true,
8870
+ $include_themes = true,
8871
+ $include_blog_data = true
8872
+ ) {
8873
+ if ( $this->is_extensions_tracking_allowed() ) {
8874
+ if ( ! defined( 'WP_FS__TRACK_PLUGINS' ) || false !== WP_FS__TRACK_PLUGINS ) {
8875
+ /**
8876
+ * @since 1.1.8 Also send plugin updates.
8877
+ */
8878
+ if ( $include_plugins && ! isset( $override['plugins'] ) ) {
8879
+ $plugins = $this->get_plugins_data_for_api();
8880
+ if ( ! empty( $plugins ) ) {
8881
+ $override['plugins'] = $plugins;
8882
+ }
8883
+ }
8884
+ }
8885
+
8886
+ if ( ! defined( 'WP_FS__TRACK_THEMES' ) || false !== WP_FS__TRACK_THEMES ) {
8887
+ /**
8888
+ * @since 1.1.8 Also send themes updates.
8889
+ */
8890
+ if ( $include_themes && ! isset( $override['themes'] ) ) {
8891
+ $themes = $this->get_themes_data_for_api();
8892
+ if ( ! empty( $themes ) ) {
8893
+ $override['themes'] = $themes;
8894
+ }
8895
+ }
8896
+ }
8897
+ }
8898
+
8899
+ $versions = $this->get_versions();
8900
+
8901
+ $blog_data = $include_blog_data ?
8902
+ array(
8903
+ 'language' => get_bloginfo( 'language' ),
8904
+ 'charset' => get_bloginfo( 'charset' ),
8905
+ 'title' => get_bloginfo( 'name' ),
8906
+ 'url' => get_site_url(),
8907
+ ) :
8908
+ array();
8909
+
8910
+ return array_merge( $versions, $blog_data, array(
8911
+ 'version' => $this->get_plugin_version(),
8912
+ 'is_premium' => $this->is_premium(),
8913
+ // Special params.
8914
+ 'is_active' => true,
8915
+ 'is_disconnected' => $this->is_tracking_prohibited(),
8916
+ 'is_uninstalled' => false,
8917
+ ), $override );
8918
+ }
8919
+
8920
+ /**
8921
+ * Update installs details.
8922
+ *
8923
+ * @todo V1 of multiste network support doesn't support plugin and theme data sending.
8924
+ *
8925
+ * @author Vova Feldman (@svovaf)
8926
+ * @since 2.0.0
8927
+ *
8928
+ * @param string[] string $override
8929
+ * @param bool $only_diff
8930
+ * @param bool $include_plugins Since 1.1.8 by default include plugin changes.
8931
+ * @param bool $include_themes Since 1.1.8 by default include plugin changes.
8932
+ *
8933
+ * @return array
8934
+ */
8935
+ private function get_installs_data_for_api(
8936
+ array $override,
8937
+ $only_diff = false,
8938
+ $include_plugins = true,
8939
+ $include_themes = true
8940
+ ) {
8941
+ /**
8942
+ * @since 1.1.8 Also send plugin updates.
8943
+ */
8944
+ // if ( $include_plugins && ! isset( $override['plugins'] ) ) {
8945
+ // $plugins = $this->get_plugins_data_for_api();
8946
+ // if ( ! empty( $plugins ) ) {
8947
+ // $override['plugins'] = $plugins;
8948
+ // }
8949
+ // }
8950
+ /**
8951
+ * @since 1.1.8 Also send themes updates.
8952
+ */
8953
+ // if ( $include_themes && ! isset( $override['themes'] ) ) {
8954
+ // $themes = $this->get_themes_data_for_api();
8955
+ // if ( ! empty( $themes ) ) {
8956
+ // $override['themes'] = $themes;
8957
+ // }
8958
+ // }
8959
+
8960
+ // Common properties.
8961
+ $versions = $this->get_versions();
8962
+ $common = array_merge( $versions, array(
8963
+ 'version' => $this->get_plugin_version(),
8964
+ 'is_premium' => $this->is_premium(),
8965
+ ), $override );
8966
+
8967
+
8968
+ $is_common_diff_for_any_site = false;
8969
+ $common_diff_union = array();
8970
+
8971
+ $installs_data = array();
8972
+
8973
+ $sites = self::get_sites();
8974
+
8975
+ foreach ( $sites as $site ) {
8976
+ $blog_id = self::get_site_blog_id( $site );
8977
+
8978
+ $install = $this->get_install_by_blog_id( $blog_id );
8979
+
8980
+ if ( is_object( $install ) ) {
8981
+ if ( $install->user_id != $this->_user->id ) {
8982
+ // Install belongs to a different owner.
8983
+ continue;
8984
+ }
8985
+
8986
+ if ( ! $this->is_premium() && $install->is_tracking_prohibited() ) {
8987
+ // Don't send updates regarding opted-out installs.
8988
+ continue;
8989
+ }
8990
+
8991
+ $install_data = $this->get_site_info( $site );
8992
+
8993
+ $uid = $install_data['uid'];
8994
+
8995
+ unset( $install_data['blog_id'] );
8996
+ unset( $install_data['uid'] );
8997
+
8998
+ $install_data['is_disconnected'] = $install->is_disconnected;
8999
+ $install_data['is_active'] = $this->is_active_for_site( $blog_id );
9000
+ $install_data['is_uninstalled'] = $install->is_uninstalled;
9001
+
9002
+ $common_diff = null;
9003
+ $is_common_diff = false;
9004
+ if ( $only_diff ) {
9005
+ $install_data = $this->get_install_diff_for_api( $install_data, $install, $override );
9006
+ $common_diff = $this->get_install_diff_for_api( $common, $install, $override );
9007
+
9008
+ $is_common_diff = ! empty( $common_diff );
9009
+
9010
+ if ( $is_common_diff ) {
9011
+ foreach ( $common_diff as $k => $v ) {
9012
+ if ( ! isset( $common_diff_union[ $k ] ) ) {
9013
+ $common_diff_union[ $k ] = $v;
9014
+ }
9015
+ }
9016
+ }
9017
+
9018
+ $is_common_diff_for_any_site = $is_common_diff_for_any_site || $is_common_diff;
9019
+ }
9020
+
9021
+ if ( ! empty( $install_data ) || $is_common_diff ) {
9022
+ // Add install ID and site unique ID.
9023
+ $install_data['id'] = $install->id;
9024
+ $install_data['uid'] = $uid;
9025
+
9026
+ $installs_data[] = $install_data;
9027
+ }
9028
+ }
9029
+ }
9030
+
9031
+ restore_current_blog();
9032
+
9033
+ if ( 0 < count( $installs_data ) && ( $is_common_diff_for_any_site || ! $only_diff ) ) {
9034
+ if ( ! $only_diff ) {
9035
+ $installs_data[] = $common;
9036
+ } else if ( ! empty( $common_diff_union ) ) {
9037
+ $installs_data[] = $common_diff_union;
9038
+ }
9039
+ }
9040
+
9041
+ foreach ( $installs_data as &$data ) {
9042
+ $data = (object) $data;
9043
+ }
9044
+
9045
+ return $installs_data;
9046
+ }
9047
+
9048
+ /**
9049
+ * Compare site actual data to the stored install data and return the differences for an API data sync.
9050
+ *
9051
+ * @author Vova Feldman (@svovaf)
9052
+ * @since 2.0.0
9053
+ *
9054
+ * @param array $site
9055
+ * @param FS_Site $install
9056
+ * @param string[] string $override
9057
+ *
9058
+ * @return array
9059
+ */
9060
+ private function get_install_diff_for_api( $site, $install, $override = array() ) {
9061
+ $diff = array();
9062
+ $special = array();
9063
+ $special_override = false;
9064
+
9065
+ foreach ( $site as $p => $v ) {
9066
+ if ( property_exists( $install, $p ) ) {
9067
+ if ( ( is_bool( $install->{$p} ) || ! empty( $install->{$p} ) ) &&
9068
+ $install->{$p} != $v
9069
+ ) {
9070
+ $install->{$p} = $v;
9071
+ $diff[ $p ] = $v;
9072
+ }
9073
+ } else {
9074
+ $special[ $p ] = $v;
9075
+
9076
+ if ( isset( $override[ $p ] ) ||
9077
+ 'plugins' === $p ||
9078
+ 'themes' === $p
9079
+ ) {
9080
+ $special_override = true;
9081
+ }
9082
+ }
9083
+ }
9084
+
9085
+ if ( $special_override || 0 < count( $diff ) ) {
9086
+ // Add special params only if has at least one
9087
+ // standard param, or if explicitly requested to
9088
+ // override a special param or a param which is not exist
9089
+ // in the install object.
9090
+ $diff = array_merge( $diff, $special );
9091
+ }
9092
+
9093
+ return $diff;
9094
+ }
9095
+
9096
+ /**
9097
+ * Update install only if changed.
9098
+ *
9099
+ * @author Vova Feldman (@svovaf)
9100
+ * @since 1.0.9
9101
+ *
9102
+ * @param string[] string $override
9103
+ * @param bool $flush
9104
+ *
9105
+ * @return false|object|string
9106
+ */
9107
+ private function send_install_update( $override = array(), $flush = false ) {
9108
+ $this->_logger->entrance();
9109
+
9110
+ $check_properties = $this->get_install_data_for_api( $override );
9111
+
9112
+ if ( $flush ) {
9113
+ $params = $check_properties;
9114
+ } else {
9115
+ $params = $this->get_install_diff_for_api( $check_properties, $this->_site, $override );
9116
+ }
9117
+
9118
+ $keepalive_only_update = false;
9119
+ if ( empty( $params ) ) {
9120
+ $keepalive_only_update = $this->should_send_keepalive_update();
9121
+
9122
+ if ( ! $keepalive_only_update ) {
9123
+ /**
9124
+ * There are no updates to send including keepalive.
9125
+ *
9126
+ * @author Leo Fajardo (@leorw)
9127
+ * @since 2.2.3
9128
+ */
9129
+ return false;
9130
+ }
9131
+ }
9132
+
9133
+ if ( ! $keepalive_only_update ) {
9134
+ /**
9135
+ * Do not update the last install sync timestamp after a keepalive-only call since there were no actual
9136
+ * updates sent.
9137
+ *
9138
+ * @author Leo Fajardo (@leorw)
9139
+ * @since 2.2.3
9140
+ */
9141
+ if ( ! is_multisite() ) {
9142
+ // Update last install sync timestamp.
9143
+ $this->set_cron_execution_timestamp( 'install_sync' );
9144
+ }
9145
+
9146
+ $params['uid'] = $this->get_anonymous_id();
9147
+ }
9148
+
9149
+ $this->set_keepalive_timestamp();
9150
+
9151
+ // Send updated values to FS.
9152
+ $site = $this->get_api_site_scope()->call( '/', 'put', $params );
9153
+
9154
+ if ( ! $keepalive_only_update && $this->is_api_result_entity( $site ) ) {
9155
+ /**
9156
+ * Do not clear scheduled sync after a keepalive-only call since there were no actual updates sent.
9157
+ *
9158
+ * @author Leo Fajardo (@leorw)
9159
+ * @since 2.2.3
9160
+ */
9161
+ if ( ! is_multisite() ) {
9162
+ // I successfully sent install update, clear scheduled sync if exist.
9163
+ $this->clear_install_sync_cron();
9164
+ }
9165
+ }
9166
+
9167
+ return $site;
9168
+ }
9169
+
9170
+ /**
9171
+ * Update installs only if changed.
9172
+ *
9173
+ * @author Vova Feldman (@svovaf)
9174
+ * @since 2.0.0
9175
+ *
9176
+ * @param string[] string $override
9177
+ * @param bool $flush
9178
+ *
9179
+ * @return false|object|string
9180
+ */
9181
+ private function send_installs_update( $override = array(), $flush = false ) {
9182
+ $this->_logger->entrance();
9183
+
9184
+ $installs_data = $this->get_installs_data_for_api( $override, ! $flush );
9185
+
9186
+ $keepalive_only_update = false;
9187
+ if ( empty( $installs_data ) ) {
9188
+ /**
9189
+ * Pass `true` to use the network level storage since the update is for many installs.
9190
+ *
9191
+ * @author Leo Fajardo (@leorw)
9192
+ * @since 2.2.3
9193
+ */
9194
+ $keepalive_only_update = $this->should_send_keepalive_update( true );
9195
+
9196
+ if ( ! $keepalive_only_update ) {
9197
+ /**
9198
+ * There are no updates to send including keepalive.
9199
+ *
9200
+ * @author Leo Fajardo (@leorw)
9201
+ * @since 2.2.3
9202
+ */
9203
+ return false;
9204
+ }
9205
+ }
9206
+
9207
+ if ( ! $keepalive_only_update ) {
9208
+ // Update last install sync timestamp if there were actual updates sent (i.e., not a keepalive-only call).
9209
+ $this->set_cron_execution_timestamp( 'install_sync' );
9210
+ }
9211
+
9212
+ /**
9213
+ * Pass `true` to use the network level storage since the update is for many installs.
9214
+ *
9215
+ * @author Leo Fajardo (@leorw)
9216
+ * @since 2.2.3
9217
+ */
9218
+ $this->set_keepalive_timestamp( true );
9219
+
9220
+ // Send updated values to FS.
9221
+ $result = $this->get_api_user_scope()->call( "/plugins/{$this->_plugin->id}/installs.json", 'put', $installs_data );
9222
+
9223
+ if ( ! $keepalive_only_update && $this->is_api_result_object( $result, 'installs' ) ) {
9224
+ // I successfully sent installs update (there was an actual update sent and it's not just a keepalive-only call), clear scheduled sync if exist.
9225
+ $this->clear_install_sync_cron();
9226
+ }
9227
+
9228
+ return $result;
9229
+ }
9230
+
9231
+ /**
9232
+ * @author Leo Fajardo (@leorw)
9233
+ *
9234
+ * @param bool|null $use_network_level_storage
9235
+ *
9236
+ * @return bool
9237
+ */
9238
+ private function should_send_keepalive_update( $use_network_level_storage = null ) {
9239
+ $keepalive_timestamp = $this->_storage->get( 'keepalive_timestamp', 0, $use_network_level_storage );
9240
+
9241
+ if ( $keepalive_timestamp < ( time() - WP_FS__TIME_WEEK_IN_SEC ) ) {
9242
+ // If updated more than 7 days ago, trigger a keepalive and update the time it was triggered.
9243
+ return true;
9244
+ } else {
9245
+ // If updated 7 days ago or less, "flip a coin", if the value is 7 trigger a keepalive and update the last time it was triggered.
9246
+ return ( 7 == rand( 1, 7 ) );
9247
+ }
9248
+ }
9249
+
9250
+ /**
9251
+ * Syncs the install owner's data if needed (i.e., if the install owner is different from the loaded user).
9252
+ *
9253
+ * @author Leo Fajardo (@leorw)
9254
+ * @since 2.3.2
9255
+ */
9256
+ private function maybe_sync_install_user() {
9257
+ if ( $this->_user->id == $this->_site->user_id ) {
9258
+ return;
9259
+ }
9260
+
9261
+ // Fetch user data and store if found.
9262
+ $this->sync_user_by_current_install();
9263
+ }
9264
+
9265
+ /**
9266
+ * Update install only if changed.
9267
+ *
9268
+ * @author Vova Feldman (@svovaf)
9269
+ * @since 1.0.9
9270
+ *
9271
+ * @param string[] string $override
9272
+ * @param bool $flush
9273
+ */
9274
+ private function sync_install( $override = array(), $flush = false ) {
9275
+ $this->_logger->entrance();
9276
+
9277
+ $site = $this->send_install_update( $override, $flush );
9278
+
9279
+ if ( false === $site ) {
9280
+ // No sync required.
9281
+ return;
9282
+ }
9283
+
9284
+ if ( ! $this->is_api_result_entity( $site ) ) {
9285
+ // Failed to sync, don't update locally.
9286
+ return;
9287
+ }
9288
+
9289
+ $this->_site = new FS_Site( $site );
9290
+
9291
+ $this->_store_site( true );
9292
+ }
9293
+
9294
+ /**
9295
+ * Update install only if changed.
9296
+ *
9297
+ * @author Vova Feldman (@svovaf)
9298
+ * @since 1.0.9
9299
+ *
9300
+ * @param string[] string $override
9301
+ * @param bool $flush
9302
+ */
9303
+ private function sync_installs( $override = array(), $flush = false ) {
9304
+ $this->_logger->entrance();
9305
+
9306
+ $result = $this->send_installs_update( $override, $flush );
9307
+
9308
+ if ( false === $result ) {
9309
+ // No sync required.
9310
+ return;
9311
+ }
9312
+
9313
+ if ( ! $this->is_api_result_object( $result, 'installs' ) ) {
9314
+ // Failed to sync, don't update locally.
9315
+ return;
9316
+ }
9317
+
9318
+ $address_to_blog_map = $this->get_address_to_blog_map();
9319
+
9320
+ foreach ( $result->installs as $install ) {
9321
+ $this->_site = new FS_Site( $install );
9322
+
9323
+ $address = trailingslashit( fs_strip_url_protocol( $install->url ) );
9324
+ $blog_id = $address_to_blog_map[ $address ];
9325
+
9326
+ $this->_store_site( true, $blog_id );
9327
+ }
9328
+ }
9329
+
9330
+ /**
9331
+ * Track install's custom event.
9332
+ *
9333
+ * IMPORTANT:
9334
+ * Custom event tracking is currently only supported for specific clients.
9335
+ * If you are not one of them, please don't use this method. If you will,
9336
+ * the API will simply ignore your request based on the plugin ID.
9337
+ *
9338
+ * Need custom tracking for your plugin or theme?
9339
+ * If you are interested in custom event tracking please contact yo@freemius.com
9340
+ * for further details.
9341
+ *
9342
+ * @author Vova Feldman (@svovaf)
9343
+ * @since 1.2.1
9344
+ *
9345
+ * @param string $name Event name.
9346
+ * @param array $properties Associative key/value array with primitive values only
9347
+ * @param bool $process_at A valid future date-time in the following format Y-m-d H:i:s.
9348
+ * @param bool $once If true, event will be tracked only once. IMPORTANT: Still trigger the API call.
9349
+ *
9350
+ * @return object|false Event data or FALSE on failure.
9351
+ *
9352
+ * @throws \Freemius_InvalidArgumentException
9353
+ */
9354
+ public function track_event( $name, $properties = array(), $process_at = false, $once = false ) {
9355
+ $this->_logger->entrance( http_build_query( array( 'name' => $name, 'once' => $once ) ) );
9356
+
9357
+ if ( ! $this->is_registered() ) {
9358
+ return false;
9359
+ }
9360
+
9361
+ $event = array( 'type' => $name );
9362
+
9363
+ if ( is_numeric( $process_at ) && $process_at > time() ) {
9364
+ $event['process_at'] = $process_at;
9365
+ }
9366
+
9367
+ if ( $once ) {
9368
+ $event['once'] = true;
9369
+ }
9370
+
9371
+ if ( ! empty( $properties ) ) {
9372
+ // Verify associative array values are primitive.
9373
+ foreach ( $properties as $k => $v ) {
9374
+ if ( ! is_scalar( $v ) ) {
9375
+ throw new Freemius_InvalidArgumentException( 'The $properties argument must be an associative key/value array with primitive values only.' );
9376
+ }
9377
+ }
9378
+
9379
+ $event['properties'] = $properties;
9380
+ }
9381
+
9382
+ $result = $this->get_api_site_scope()->call( 'events.json', 'post', $event );
9383
+
9384
+ return $this->is_api_error( $result ) ?
9385
+ false :
9386
+ $result;
9387
+ }
9388
+
9389
+ /**
9390
+ * Track install's custom event only once, but it still triggers the API call.
9391
+ *
9392
+ * IMPORTANT:
9393
+ * Custom event tracking is currently only supported for specific clients.
9394
+ * If you are not one of them, please don't use this method. If you will,
9395
+ * the API will simply ignore your request based on the plugin ID.
9396
+ *
9397
+ * Need custom tracking for your plugin or theme?
9398
+ * If you are interested in custom event tracking please contact yo@freemius.com
9399
+ * for further details.
9400
+ *
9401
+ * @author Vova Feldman (@svovaf)
9402
+ * @since 1.2.1
9403
+ *
9404
+ * @param string $name Event name.
9405
+ * @param array $properties Associative key/value array with primitive values only
9406
+ * @param bool $process_at A valid future date-time in the following format Y-m-d H:i:s.
9407
+ *
9408
+ * @return object|false Event data or FALSE on failure.
9409
+ *
9410
+ * @throws \Freemius_InvalidArgumentException
9411
+ *
9412
+ * @user Freemius::track_event()
9413
+ */
9414
+ public function track_event_once( $name, $properties = array(), $process_at = false ) {
9415
+ return $this->track_event( $name, $properties, $process_at, true );
9416
+ }
9417
+
9418
+ /**
9419
+ * Plugin uninstall hook.
9420
+ *
9421
+ * @author Vova Feldman (@svovaf)
9422
+ * @since 1.0.1
9423
+ *
9424
+ * @param bool $check_user Enforce checking if user have plugins activation privileges.
9425
+ */
9426
+ function _uninstall_plugin_event( $check_user = true ) {
9427
+ $this->_logger->entrance( 'slug = ' . $this->_slug );
9428
+
9429
+ if ( $check_user && ! current_user_can( 'activate_plugins' ) ) {
9430
+ return;
9431
+ }
9432
+
9433
+ $params = array();
9434
+ $uninstall_reason = null;
9435
+ if ( isset( $this->_storage->uninstall_reason ) ) {
9436
+ $uninstall_reason = $this->_storage->uninstall_reason;
9437
+ $params['reason_id'] = $uninstall_reason->id;
9438
+ $params['reason_info'] = $uninstall_reason->info;
9439
+ }
9440
+
9441
+ if ( ! $this->is_registered() ) {
9442
+ // Send anonymous uninstall event only if user submitted a feedback.
9443
+ if ( isset( $uninstall_reason ) ) {
9444
+ if ( isset( $uninstall_reason->is_anonymous ) && ! $uninstall_reason->is_anonymous ) {
9445
+ $this->opt_in( false, false, false, false, true );
9446
+ } else {
9447
+ $params['uid'] = $this->get_anonymous_id();
9448
+ $this->get_api_plugin_scope()->call( 'uninstall.json', 'put', $params );
9449
+ }
9450
+ }
9451
+ } else {
9452
+ $params = array_merge( $params, array(
9453
+ 'is_active' => false,
9454
+ 'is_uninstalled' => true,
9455
+ ) );
9456
+
9457
+ if ( $this->_is_network_active ) {
9458
+ // Send uninstall event.
9459
+ $this->send_installs_update( $params );
9460
+ } else {
9461
+ // Send uninstall event.
9462
+ $this->send_install_update( $params );
9463
+ }
9464
+ }
9465
+
9466
+ // @todo Decide if we want to delete plugin information from db.
9467
+ }
9468
+
9469
+ /**
9470
+ * Set the basename of the current product and hook _activate_plugin_event_hook() to the activation action.
9471
+ *
9472
+ * @author Vova Feldman (@svovaf)
9473
+ * @since 2.2.1
9474
+ *
9475
+ * @param string $is_premium
9476
+ * @param string $caller
9477
+ *
9478
+ * @return string
9479
+ */
9480
+ function set_basename( $is_premium, $caller ) {
9481
+ $basename = plugin_basename( $caller );
9482
+
9483
+ $current_basename = $is_premium ?
9484
+ $this->_premium_plugin_basename :
9485
+ $this->_free_plugin_basename;
9486
+
9487
+ if ( $current_basename == $basename ) {
9488
+ // Basename value set correctly.
9489
+ return;
9490
+ }
9491
+
9492
+ if ( $is_premium ) {
9493
+ $this->_premium_plugin_basename = $basename;
9494
+ } else {
9495
+ $this->_free_plugin_basename = $basename;
9496
+ }
9497
+
9498
+ $plugin_dir = dirname( $this->_plugin_dir_path ) . '/';
9499
+
9500
+ register_activation_hook(
9501
+ $plugin_dir . $basename,
9502
+ array( &$this, '_activate_plugin_event_hook' )
9503
+ );
9504
+ }
9505
+
9506
+ /**
9507
+ * @author Vova Feldman (@svovaf)
9508
+ * @since 1.1.1
9509
+ * @since 2.2.1 If the context product is in its premium version, use the current module's basename, even if it was renamed.
9510
+ *
9511
+ * @return string
9512
+ */
9513
+ function premium_plugin_basename() {
9514
+ if ( ! isset( $this->_premium_plugin_basename ) ) {
9515
+ $this->_premium_plugin_basename = $this->is_premium() ?
9516
+ // The product is premium, so use the current basename.
9517
+ $this->_plugin_basename :
9518
+ $this->get_premium_slug() . '/' . basename( $this->_free_plugin_basename );
9519
+ }
9520
+
9521
+ return $this->_premium_plugin_basename;
9522
+ }
9523
+
9524
+ /**
9525
+ * Uninstall plugin hook. Called only when connected his account with Freemius for active sites tracking.
9526
+ *
9527
+ * @author Vova Feldman (@svovaf)
9528
+ * @since 1.0.2
9529
+ */
9530
+ public static function _uninstall_plugin_hook() {
9531
+ self::_load_required_static();
9532
+
9533
+ self::$_static_logger->entrance();
9534
+
9535
+ if ( ! current_user_can( 'activate_plugins' ) ) {
9536
+ return;
9537
+ }
9538
+
9539
+ $plugin_file = substr( current_filter(), strlen( 'uninstall_' ) );
9540
+
9541
+ self::$_static_logger->info( 'plugin = ' . $plugin_file );
9542
+
9543
+ define( 'WP_FS__UNINSTALL_MODE', true );
9544
+
9545
+ $fs = self::get_instance_by_file( $plugin_file );
9546
+
9547
+ if ( is_object( $fs ) ) {
9548
+ $fs->remove_sdk_reference();
9549
+
9550
+ self::require_plugin_essentials();
9551
+
9552
+ if ( is_plugin_active( $fs->_free_plugin_basename ) ||
9553
+ is_plugin_active( $fs->premium_plugin_basename() )
9554
+ ) {
9555
+ // Deleting Free or Premium plugin version while the other version still installed.
9556
+ return;
9557
+ }
9558
+
9559
+ $fs->_uninstall_plugin_event();
9560
+
9561
+ $fs->do_action( 'after_uninstall' );
9562
+ }
9563
+ }
9564
+
9565
+ #----------------------------------------------------------------------------------
9566
+ #region Plugin Information
9567
+ #----------------------------------------------------------------------------------
9568
+
9569
+ /**
9570
+ * Load WordPress core plugin.php essential module.
9571
+ *
9572
+ * @author Vova Feldman (@svovaf)
9573
+ * @since 1.1.1
9574
+ */
9575
+ private static function require_plugin_essentials() {
9576
+ if ( ! function_exists( 'get_plugins' ) ) {
9577
+ self::$_static_logger->log( 'Including wp-admin/includes/plugin.php...' );
9578
+
9579
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
9580
+ }
9581
+ }
9582
+
9583
+ /**
9584
+ * Load WordPress core pluggable.php module.
9585
+ *
9586
+ * @author Vova Feldman (@svovaf)
9587
+ * @since 1.1.2
9588
+ */
9589
+ private static function require_pluggable_essentials() {
9590
+ if ( ! function_exists( 'wp_get_current_user' ) ) {
9591
+ require_once ABSPATH . 'wp-includes/pluggable.php';
9592
+ }
9593
+ }
9594
+
9595
+ /**
9596
+ * Return plugin data.
9597
+ *
9598
+ * @author Vova Feldman (@svovaf)
9599
+ * @since 1.0.1
9600
+ *
9601
+ * @param bool $reparse_plugin_metadata
9602
+ *
9603
+ * @return array
9604
+ */
9605
+ function get_plugin_data( $reparse_plugin_metadata = false ) {
9606
+ if ( ! isset( $this->_plugin_data ) || $reparse_plugin_metadata ) {
9607
+ self::require_plugin_essentials();
9608
+
9609
+ if ( $this->is_plugin() ) {
9610
+ /**
9611
+ * @author Vova Feldman (@svovaf)
9612
+ * @since 1.2.0 When using get_plugin_data() do NOT translate plugin data.
9613
+ *
9614
+ * @link https://github.com/Freemius/wordpress-sdk/issues/77
9615
+ */
9616
+ $plugin_data = get_plugin_data(
9617
+ $this->_plugin_main_file_path,
9618
+ false,
9619
+ false
9620
+ );
9621
+ } else {
9622
+ $theme_data = wp_get_theme();
9623
+
9624
+ if ( $this->_plugin_basename !== $theme_data->get_stylesheet() && is_child_theme() ) {
9625
+ $parent_theme = $theme_data->parent();
9626
+
9627
+ if ( ( $parent_theme instanceof WP_Theme ) && $this->_plugin_basename === $parent_theme->get_stylesheet() ) {
9628
+ $theme_data = $parent_theme;
9629
+ }
9630
+ }
9631
+
9632
+ $plugin_data = array(
9633
+ 'Name' => $theme_data->get( 'Name' ),
9634
+ 'Version' => $theme_data->get( 'Version' ),
9635
+ 'Author' => $theme_data->get( 'Author' ),
9636
+ 'Description' => $theme_data->get( 'Description' ),
9637
+ 'PluginURI' => $theme_data->get( 'ThemeURI' ),
9638
+ );
9639
+ }
9640
+
9641
+ $this->_plugin_data = $plugin_data;
9642
+ }
9643
+
9644
+ return $this->_plugin_data;
9645
+ }
9646
+
9647
+ /**
9648
+ * @author Vova Feldman (@svovaf)
9649
+ * @since 1.0.1
9650
+ * @since 1.2.2.5 If slug not set load slug by module ID.
9651
+ *
9652
+ * @return string Plugin slug.
9653
+ */
9654
+ function get_slug() {
9655
+ if ( ! isset( $this->_slug ) ) {
9656
+ $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array() );
9657
+ $this->_slug = $id_slug_type_path_map[ $this->_module_id ]['slug'];
9658
+ }
9659
+
9660
+ return $this->_slug;
9661
+ }
9662
+
9663
+ /**
9664
+ * @author Leo Fajardo (@leorw)
9665
+ * @since 2.2.1
9666
+ *
9667
+ * @return string
9668
+ */
9669
+ function get_premium_slug() {
9670
+ return is_object( $this->_plugin ) ?
9671
+ $this->_plugin->premium_slug :
9672
+ "{$this->_slug}-premium";
9673
+ }
9674
+
9675
+ /**
9676
+ * Retrieve the desired folder name for the product.
9677
+ *
9678
+ * @author Vova Feldman (@svovaf)
9679
+ * @since 1.2.1.7
9680
+ *
9681
+ * @return string Plugin slug.
9682
+ */
9683
+ function get_target_folder_name() {
9684
+ return $this->can_use_premium_code() ?
9685
+ $this->_plugin->premium_slug :
9686
+ $this->_slug;
9687
+ }
9688
+
9689
+ /**
9690
+ * @author Vova Feldman (@svovaf)
9691
+ * @since 1.0.1
9692
+ *
9693
+ * @return number Plugin ID.
9694
+ */
9695
+ function get_id() {
9696
+ return $this->_plugin->id;
9697
+ }
9698
+
9699
+ /**
9700
+ * @author Leo Fajardo (@leorw)
9701
+ * @since 2.2.4
9702
+ *
9703
+ * @return number|null Bundle ID.
9704
+ */
9705
+ function get_bundle_id() {
9706
+ return ( isset( $this->_plugin->bundle_id ) && FS_Plugin::is_valid_id( $this->_plugin->bundle_id ) ) ?
9707
+ $this->_plugin->bundle_id :
9708
+ null;
9709
+ }
9710
+
9711
+ /**
9712
+ * @author Vova Feldman (@svovaf)
9713
+ * @since 2.3.1
9714
+ *
9715
+ * @return string|null Bundle public key.
9716
+ */
9717
+ function get_bundle_public_key() {
9718
+ return isset( $this->_plugin->bundle_public_key ) ?
9719
+ $this->_plugin->bundle_public_key :
9720
+ null;
9721
+ }
9722
+
9723
+ /**
9724
+ * @author Vova Feldman (@svovaf)
9725
+ * @since 1.2.1.5
9726
+ *
9727
+ * @return string Freemius SDK version
9728
+ */
9729
+ function get_sdk_version() {
9730
+ return $this->version;
9731
+ }
9732
+
9733
+ /**
9734
+ * @author Vova Feldman (@svovaf)
9735
+ * @since 1.2.1.5
9736
+ *
9737
+ * @return number Parent plugin ID (if parent exist).
9738
+ */
9739
+ function get_parent_id() {
9740
+ return $this->is_addon() ?
9741
+ $this->get_parent_instance()->get_id() :
9742
+ $this->_plugin->id;
9743
+ }
9744
+
9745
+ /**
9746
+ * @author Vova Feldman (@svovaf)
9747
+ * @since 2.3.1
9748
+ *
9749
+ * @return string
9750
+ */
9751
+ function get_usage_tracking_terms_url() {
9752
+ return $this->apply_filters(
9753
+ 'usage_tracking_terms_url',
9754
+ "https://freemius.com/wordpress/usage-tracking/{$this->_plugin->id}/{$this->_slug}/"
9755
+ );
9756
+ }
9757
+
9758
+ /**
9759
+ * @author Vova Feldman (@svovaf)
9760
+ * @since 2.3.1
9761
+ *
9762
+ * @return string
9763
+ */
9764
+ function get_eula_url() {
9765
+ return $this->apply_filters(
9766
+ 'eula_url',
9767
+ "https://freemius.com/terms/{$this->_plugin->id}/{$this->_slug}/"
9768
+ );
9769
+ }
9770
+
9771
+ /**
9772
+ * @author Vova Feldman (@svovaf)
9773
+ * @since 1.0.1
9774
+ *
9775
+ * @return string Plugin public key.
9776
+ */
9777
+ function get_public_key() {
9778
+ return $this->_plugin->public_key;
9779
+ }
9780
+
9781
+ /**
9782
+ * Will be available only on sandbox mode.
9783
+ *
9784
+ * @author Vova Feldman (@svovaf)
9785
+ * @since 1.0.4
9786
+ *
9787
+ * @return mixed Plugin secret key.
9788
+ */
9789
+ function get_secret_key() {
9790
+ return $this->_plugin->secret_key;
9791
+ }
9792
+
9793
+ /**
9794
+ * @author Vova Feldman (@svovaf)
9795
+ * @since 1.1.1
9796
+ *
9797
+ * @return bool
9798
+ */
9799
+ function has_secret_key() {
9800
+ return ! empty( $this->_plugin->secret_key );
9801
+ }
9802
+
9803
+ /**
9804
+ * @author Vova Feldman (@svovaf)
9805
+ * @since 1.0.9
9806
+ *
9807
+ * @param string|bool $premium_suffix
9808
+ *
9809
+ * @return string
9810
+ */
9811
+ function get_plugin_name( $premium_suffix = false ) {
9812
+ $this->_logger->entrance();
9813
+
9814
+ /**
9815
+ * This `if-else` can be squeezed into a single `if` but I intentionally split it for code readability.
9816
+ *
9817
+ * @author Vova Feldman
9818
+ */
9819
+ if ( ! isset( $this->_plugin_name ) ) {
9820
+ // Name is not yet set.
9821
+ $this->set_name( $premium_suffix );
9822
+ } else if (
9823
+ ! empty( $premium_suffix ) &&
9824
+ ( ! is_object( $this->_plugin ) || $this->_plugin->premium_suffix !== $premium_suffix )
9825
+ ) {
9826
+ // Name is already set, but there's a change in the premium suffix.
9827
+ $this->set_name( $premium_suffix );
9828
+ }
9829
+
9830
+ return $this->_plugin_name;
9831
+ }
9832
+
9833
+ /**
9834
+ * Calculates and stores the product's name. This helper function was created specifically for get_plugin_name() just to make the code clearer.
9835
+ *
9836
+ * @author Vova Feldman (@svovaf)
9837
+ * @since 2.2.1
9838
+ *
9839
+ * @param string $premium_suffix
9840
+ */
9841
+ private function set_name( $premium_suffix = '' ) {
9842
+ $plugin_data = $this->get_plugin_data();
9843
+
9844
+ // Get name.
9845
+ $this->_plugin_name = $plugin_data['Name'];
9846
+
9847
+ if ( is_string( $premium_suffix ) ) {
9848
+ $premium_suffix = trim( $premium_suffix );
9849
+
9850
+ if ( ! empty( $premium_suffix ) ) {
9851
+ // Check if plugin name contains " (premium)" or a custom suffix and remove it.
9852
+ $suffix = ( ' ' . strtolower( $premium_suffix ) );
9853
+ $suffix_len = strlen( $suffix );
9854
+
9855
+ if ( strlen( $plugin_data['Name'] ) > $suffix_len &&
9856
+ $suffix === substr( strtolower( $plugin_data['Name'] ), - $suffix_len )
9857
+ ) {
9858
+ $this->_plugin_name = substr( $plugin_data['Name'], 0, - $suffix_len );
9859
+ }
9860
+ }
9861
+ }
9862
+
9863
+ $this->_logger->departure( 'Name = ' . $this->_plugin_name );
9864
+ }
9865
+
9866
+ /**
9867
+ * @author Vova Feldman (@svovaf)
9868
+ * @since 1.0.0
9869
+ *
9870
+ * @param bool $reparse_plugin_metadata
9871
+ *
9872
+ * @return string
9873
+ */
9874
+ function get_plugin_version( $reparse_plugin_metadata = false ) {
9875
+ $this->_logger->entrance();
9876
+
9877
+ $plugin_data = $this->get_plugin_data( $reparse_plugin_metadata );
9878
+
9879
+ $this->_logger->departure( 'Version = ' . $plugin_data['Version'] );
9880
+
9881
+ return $this->apply_filters( 'plugin_version', $plugin_data['Version'] );
9882
+ }
9883
+
9884
+ /**
9885
+ * @author Vova Feldman (@svovaf)
9886
+ * @since 1.2.1.7
9887
+ *
9888
+ * @return string
9889
+ */
9890
+ function get_plugin_title() {
9891
+ $this->_logger->entrance();
9892
+
9893
+ $title = $this->_plugin->title;
9894
+
9895
+ return $this->apply_filters( 'plugin_title', $title );
9896
+ }
9897
+
9898
+ /**
9899
+ * @author Vova Feldman (@svovaf)
9900
+ * @since 1.2.2.7
9901
+ *
9902
+ * @param bool $lowercase
9903
+ *
9904
+ * @return string
9905
+ */
9906
+ function get_module_label( $lowercase = false ) {
9907
+ $label = $this->is_addon() ?
9908
+ $this->get_text_inline( 'Add-On', 'addon' ) :
9909
+ ( $this->is_plugin() ?
9910
+ $this->get_text_inline( 'Plugin', 'plugin' ) :
9911
+ $this->get_text_inline( 'Theme', 'theme' ) );
9912
+
9913
+ if ( $lowercase ) {
9914
+ $label = strtolower( $label );
9915
+ }
9916
+
9917
+ return $label;
9918
+ }
9919
+
9920
+ /**
9921
+ * @author Vova Feldman (@svovaf)
9922
+ * @since 1.0.4
9923
+ *
9924
+ * @return string
9925
+ */
9926
+ function get_plugin_basename() {
9927
+ if ( ! isset( $this->_plugin_basename ) ) {
9928
+ if ( $this->is_plugin() ) {
9929
+ $this->_plugin_basename = plugin_basename( $this->_plugin_main_file_path );
9930
+ } else {
9931
+ $this->_plugin_basename = basename( dirname( $this->_plugin_main_file_path ) );
9932
+ }
9933
+ }
9934
+
9935
+ return $this->_plugin_basename;
9936
+ }
9937
+
9938
+ function get_plugin_folder_name() {
9939
+ $this->_logger->entrance();
9940
+
9941
+ $plugin_folder = $this->_plugin_basename;
9942
+
9943
+ while ( '.' !== dirname( $plugin_folder ) ) {
9944
+ $plugin_folder = dirname( $plugin_folder );
9945
+ }
9946
+
9947
+ $this->_logger->departure( 'Folder Name = ' . $plugin_folder );
9948
+
9949
+ return $plugin_folder;
9950
+ }
9951
+
9952
+ #endregion ------------------------------------------------------------------
9953
+
9954
+ /* Account
9955
+ ------------------------------------------------------------------------------------------------------------------*/
9956
+
9957
+ /**
9958
+ * Find plugin's slug by plugin's basename.
9959
+ *
9960
+ * @author Vova Feldman (@svovaf)
9961
+ * @since 1.0.9
9962
+ *
9963
+ * @param string $plugin_base_name
9964
+ *
9965
+ * @return false|string
9966
+ */
9967
+ private static function find_slug_by_basename( $plugin_base_name ) {
9968
+ $file_slug_map = self::$_accounts->get_option( 'file_slug_map', array() );
9969
+
9970
+ if ( ! array( $file_slug_map ) || ! isset( $file_slug_map[ $plugin_base_name ] ) ) {
9971
+ return false;
9972
+ }
9973
+
9974
+ return $file_slug_map[ $plugin_base_name ];
9975
+ }
9976
+
9977
+ /**
9978
+ * Store the map between the plugin's basename to the slug.
9979
+ *
9980
+ * @author Vova Feldman (@svovaf)
9981
+ * @since 1.0.9
9982
+ */
9983
+ private function store_file_slug_map() {
9984
+ $file_slug_map = self::$_accounts->get_option( 'file_slug_map', array() );
9985
+
9986
+ if ( ! array( $file_slug_map ) ) {
9987
+ $file_slug_map = array();
9988
+ }
9989
+
9990
+ if ( ! isset( $file_slug_map[ $this->_plugin_basename ] ) ||
9991
+ $file_slug_map[ $this->_plugin_basename ] !== $this->_slug
9992
+ ) {
9993
+ $file_slug_map[ $this->_plugin_basename ] = $this->_slug;
9994
+ self::$_accounts->set_option( 'file_slug_map', $file_slug_map, true );
9995
+ }
9996
+ }
9997
+
9998
+ /**
9999
+ * @return array[number]FS_User
10000
+ */
10001
+ static function get_all_users() {
10002
+ $users = self::maybe_get_entities_account_option( 'users', array() );
10003
+
10004
+ if ( ! is_array( $users ) ) {
10005
+ $users = array();
10006
+ }
10007
+
10008
+ return $users;
10009
+ }
10010
+
10011
+ /**
10012
+ * @param string $module_type
10013
+ * @param null|int $blog_id Since 2.0.0
10014
+ *
10015
+ * @return array[string]FS_Site
10016
+ */
10017
+ private static function get_all_sites(
10018
+ $module_type = WP_FS__MODULE_TYPE_PLUGIN,
10019
+ $blog_id = null
10020
+ ) {
10021
+ $sites = self::get_account_option( 'sites', $module_type, $blog_id );
10022
+
10023
+ if ( ! is_array( $sites ) ) {
10024
+ $sites = array();
10025
+ }
10026
+
10027
+ return $sites;
10028
+ }
10029
+
10030
+ /**
10031
+ * @author Leo Fajardo (@leorw)
10032
+ *
10033
+ * @since 1.2.2
10034
+ *
10035
+ * @param string $option_name
10036
+ * @param string $module_type
10037
+ * @param null|int $network_level_or_blog_id Since 2.0.0
10038
+ *
10039
+ * @return mixed
10040
+ */
10041
+ private static function get_account_option( $option_name, $module_type = null, $network_level_or_blog_id = null ) {
10042
+ if ( ! is_null( $module_type ) && WP_FS__MODULE_TYPE_PLUGIN !== $module_type ) {
10043
+ $option_name = $module_type . '_' . $option_name;
10044
+ }
10045
+
10046
+ return self::maybe_get_entities_account_option( $option_name, array(), $network_level_or_blog_id );
10047
+ }
10048
+
10049
+ /**
10050
+ * @author Leo Fajardo (@leorw)
10051
+ *
10052
+ * @since 1.2.2
10053
+ *
10054
+ * @param string $option_name
10055
+ * @param mixed $option_value
10056
+ * @param bool $store
10057
+ * @param null|int $network_level_or_blog_id Since 2.0.0
10058
+ */
10059
+ private function set_account_option( $option_name, $option_value, $store, $network_level_or_blog_id = null ) {
10060
+ self::set_account_option_by_module(
10061
+ $this->_module_type,
10062
+ $option_name,
10063
+ $option_value,
10064
+ $store,
10065
+ $network_level_or_blog_id
10066
+ );
10067
+ }
10068
+
10069
+ /**
10070
+ * @author Vova Feldman (@svovaf)
10071
+ *
10072
+ * @since 1.2.2.7
10073
+ *
10074
+ * @param string $module_type
10075
+ * @param string $option_name
10076
+ * @param mixed $option_value
10077
+ * @param bool $store
10078
+ * @param null|int $network_level_or_blog_id Since 2.0.0
10079
+ */
10080
+ private static function set_account_option_by_module(
10081
+ $module_type,
10082
+ $option_name,
10083
+ $option_value,
10084
+ $store,
10085
+ $network_level_or_blog_id = null
10086
+ ) {
10087
+ if ( WP_FS__MODULE_TYPE_PLUGIN != $module_type ) {
10088
+ $option_name = $module_type . '_' . $option_name;
10089
+ }
10090
+
10091
+ self::$_accounts->set_option( $option_name, $option_value, $store, $network_level_or_blog_id );
10092
+ }
10093
+
10094
+ /**
10095
+ * This method can also return non-entity or non-entities collection option like the `user_id_license_ids_map` option.
10096
+ *
10097
+ * @author Leo Fajardo (@leorw)
10098
+ * @since 2.3.1
10099
+ *
10100
+ * @param string $option_name
10101
+ * @param mixed $default
10102
+ * @param null|bool|int $network_level_or_blog_id When an integer, use the given blog storage. When `true` use the multisite storage (if there's a network). When `false`, use the current context blog storage. When `null`, the decision which storage to use (MS vs. Current S) will be handled internally and determined based on the $option (based on self::$_SITE_LEVEL_PARAMS).
10103
+ *
10104
+ * @return mixed|FS_Plugin[]|FS_User[]|FS_Site[]|FS_Plugin_License[]|FS_Plugin_Plan[]|FS_Plugin_Tag[]
10105
+ */
10106
+ private static function maybe_get_entities_account_option( $option_name, $default = null, $network_level_or_blog_id = null ) {
10107
+ $option = self::$_accounts->get_option( $option_name, $default, $network_level_or_blog_id );
10108
+
10109
+ $class_name = '';
10110
+
10111
+ switch ( $option_name ) {
10112
+ case 'plugins':
10113
+ case 'themes':
10114
+ case 'addons':
10115
+ $class_name = FS_Plugin::get_class_name();
10116
+ break;
10117
+ case 'users':
10118
+ $class_name = FS_User::get_class_name();
10119
+ break;
10120
+ case 'sites':
10121
+ $class_name = FS_Site::get_class_name();
10122
+ break;
10123
+ case 'licenses':
10124
+ case 'all_licenses':
10125
+ $class_name = FS_Plugin_License::get_class_name();
10126
+ break;
10127
+ case 'plans':
10128
+ $class_name = FS_Plugin_Plan::get_class_name();
10129
+ break;
10130
+ case 'updates':
10131
+ $class_name = FS_Plugin_Tag::get_class_name();
10132
+ break;
10133
+ }
10134
+
10135
+ if ( empty( $class_name ) ) {
10136
+ return $option;
10137
+ }
10138
+
10139
+ return fs_get_entities( $option, $class_name );
10140
+ }
10141
+
10142
+ /**
10143
+ * @author Vova Feldman (@svovaf)
10144
+ * @since 1.0.6
10145
+ *
10146
+ * @param number|null $module_id
10147
+ *
10148
+ * @return FS_Plugin_License[]
10149
+ */
10150
+ private static function get_all_licenses( $module_id = null ) {
10151
+ $licenses = self::get_account_option( 'all_licenses' );
10152
+
10153
+ if ( ! is_array( $licenses ) ) {
10154
+ $licenses = array();
10155
+ }
10156
+
10157
+ if ( is_null( $module_id ) ) {
10158
+ return $licenses;
10159
+ }
10160
+
10161
+ $licenses = isset( $licenses[ $module_id ] ) ?
10162
+ $licenses[ $module_id ] :
10163
+ array();
10164
+
10165
+ return $licenses;
10166
+ }
10167
+
10168
+ /**
10169
+ * @author Leo Fajardo (@leorw)
10170
+ * @since 2.0.0
10171
+ *
10172
+ * @return array
10173
+ */
10174
+ private static function get_all_licenses_by_module_type() {
10175
+ $licenses = self::get_account_option( 'all_licenses' );
10176
+
10177
+ $licenses_by_module_type = array(
10178
+ WP_FS__MODULE_TYPE_PLUGIN => array(),
10179
+ WP_FS__MODULE_TYPE_THEME => array()
10180
+ );
10181
+
10182
+ if ( ! is_array( $licenses ) ) {
10183
+ return $licenses_by_module_type;
10184
+ }
10185
+
10186
+ foreach ( $licenses as $module_id => $module_licenses ) {
10187
+ $fs = self::get_instance_by_id( $module_id );
10188
+ if ( false === $fs ) {
10189
+ continue;
10190
+ }
10191
+
10192
+ $licenses_by_module_type[ $fs->_module_type ] = array_merge( $licenses_by_module_type[ $fs->_module_type ], $module_licenses );
10193
+ }
10194
+
10195
+ return $licenses_by_module_type;
10196
+ }
10197
+
10198
+ /**
10199
+ * @author Leo Fajardo (@leorw)
10200
+ * @since 2.0.0
10201
+ *
10202
+ * @param number $module_id
10203
+ * @param number|null $user_id
10204
+ *
10205
+ * @return array
10206
+ */
10207
+ private static function get_user_id_license_ids_map( $module_id, $user_id = null ) {
10208
+ $all_modules_user_id_license_ids_map = self::get_account_option( 'user_id_license_ids_map' );
10209
+
10210
+ if ( ! is_array( $all_modules_user_id_license_ids_map ) ) {
10211
+ $all_modules_user_id_license_ids_map = array();
10212
+ }
10213
+
10214
+ $user_id_license_ids_map = isset( $all_modules_user_id_license_ids_map[ $module_id ] ) ?
10215
+ $all_modules_user_id_license_ids_map[ $module_id ] :
10216
+ array();
10217
+
10218
+ if ( FS_User::is_valid_id( $user_id ) ) {
10219
+ $user_id_license_ids_map = isset( $user_id_license_ids_map[ $user_id ] ) ?
10220
+ $user_id_license_ids_map[ $user_id ] :
10221
+ array();
10222
+ }
10223
+
10224
+ return $user_id_license_ids_map;
10225
+ }
10226
+
10227
+ /**
10228
+ * @author Leo Fajardo (@leorw)
10229
+ * @since 2.0.0
10230
+ *
10231
+ * @param array $new_user_id_license_ids_map
10232
+ * @param number $module_id
10233
+ * @param number|null $user_id
10234
+ */
10235
+ private static function store_user_id_license_ids_map( $new_user_id_license_ids_map, $module_id, $user_id = null ) {
10236
+ $all_modules_user_id_license_ids_map = self::get_account_option( 'user_id_license_ids_map' );
10237
+ if ( ! is_array( $all_modules_user_id_license_ids_map ) ) {
10238
+ $all_modules_user_id_license_ids_map = array();
10239
+ }
10240
+
10241
+ if ( ! isset( $all_modules_user_id_license_ids_map[ $module_id ] ) ) {
10242
+ $all_modules_user_id_license_ids_map[ $module_id ] = array();
10243
+ }
10244
+
10245
+ if ( FS_User::is_valid_id( $user_id ) ) {
10246
+ $all_modules_user_id_license_ids_map[ $module_id ][ $user_id ] = $new_user_id_license_ids_map;
10247
+ } else {
10248
+ $all_modules_user_id_license_ids_map[ $module_id ] = $new_user_id_license_ids_map;
10249
+ }
10250
+
10251
+ self::$_accounts->set_option( 'user_id_license_ids_map', $all_modules_user_id_license_ids_map, true );
10252
+ }
10253
+
10254
+ /**
10255
+ * Get a collection of the user's linked license IDs.
10256
+ *
10257
+ * @author Vova Feldman (@svovaf)
10258
+ * @since 2.0.0
10259
+ *
10260
+ * @param number $user_id
10261
+ *
10262
+ * @return number[]
10263
+ */
10264
+ private function get_user_linked_license_ids( $user_id ) {
10265
+ return self::get_user_id_license_ids_map( $this->_module_id, $user_id );
10266
+ }
10267
+
10268
+ /**
10269
+ * Override the user's linked license IDs with a new IDs collection.
10270
+ *
10271
+ * @author Vova Feldman (@svovaf)
10272
+ * @since 2.0.0
10273
+ *
10274
+ * @param number $user_id
10275
+ * @param number[] $license_ids
10276
+ */
10277
+ private function set_user_linked_license_ids( $user_id, array $license_ids ) {
10278
+ self::store_user_id_license_ids_map( $license_ids, $this->_module_id, $user_id );
10279
+ }
10280
+
10281
+ /**
10282
+ * Link a specified license ID to a given user.
10283
+ *
10284
+ * @author Vova Feldman (@svovaf)
10285
+ * @since 2.0.0
10286
+ *
10287
+ * @param number $license_id
10288
+ * @param number $user_id
10289
+ */
10290
+ private function link_license_2_user( $license_id, $user_id ) {
10291
+ $license_ids = $this->get_user_linked_license_ids( $user_id );
10292
+
10293
+ if ( in_array( $license_id, $license_ids ) ) {
10294
+ // License already linked.
10295
+ return;
10296
+ }
10297
+
10298
+ $license_ids[] = $license_id;
10299
+
10300
+ $this->set_user_linked_license_ids( $user_id, $license_ids );
10301
+ }
10302
+
10303
+ /**
10304
+ * @param string|bool $module_type
10305
+ *
10306
+ * @return FS_Plugin_Plan[]
10307
+ */
10308
+ private static function get_all_plans( $module_type = false ) {
10309
+ $plans = self::get_account_option( 'plans', $module_type );
10310
+
10311
+ if ( ! is_array( $plans ) ) {
10312
+ $plans = array();
10313
+ }
10314
+
10315
+ return $plans;
10316
+ }
10317
+
10318
+ /**
10319
+ * @author Vova Feldman (@svovaf)
10320
+ * @since 1.0.4
10321
+ *
10322
+ * @return FS_Plugin_Tag[]
10323
+ */
10324
+ private static function get_all_updates() {
10325
+ $updates = self::maybe_get_entities_account_option( 'updates', array() );
10326
+
10327
+ if ( ! is_array( $updates ) ) {
10328
+ $updates = array();
10329
+ }
10330
+
10331
+ return $updates;
10332
+ }
10333
+
10334
+ /**
10335
+ * @author Vova Feldman (@svovaf)
10336
+ * @since 1.0.6
10337
+ *
10338
+ * @return array<number,FS_Plugin[]>|false
10339
+ */
10340
+ private static function get_all_addons() {
10341
+ $addons = self::maybe_get_entities_account_option( 'addons', array() );
10342
+
10343
+ if ( ! is_array( $addons ) ) {
10344
+ $addons = array();
10345
+ }
10346
+
10347
+ return $addons;
10348
+ }
10349
+
10350
+ /**
10351
+ * @author Vova Feldman (@svovaf)
10352
+ * @since 1.0.6
10353
+ *
10354
+ * @return number[]|false
10355
+ */
10356
+ private static function get_all_account_addons() {
10357
+ $addons = self::$_accounts->get_option( 'account_addons', array() );
10358
+
10359
+ if ( ! is_array( $addons ) ) {
10360
+ $addons = array();
10361
+ }
10362
+
10363
+ return $addons;
10364
+ }
10365
+
10366
+ /**
10367
+ * Check if user has connected his account (opted-in).
10368
+ *
10369
+ * Note:
10370
+ * If the user opted-in and opted-out on a later stage,
10371
+ * this will still return true. If you want to check if the
10372
+ * user is currently opted-in, use:
10373
+ * `$fs->is_registered() && $fs->is_tracking_allowed()`
10374
+ *
10375
+ * @author Vova Feldman (@svovaf)
10376
+ * @since 1.0.1
10377
+ * @return bool
10378
+ */
10379
+ function is_registered() {
10380
+ return is_object( $this->_user );
10381
+ }
10382
+
10383
+ /**
10384
+ * Returns TRUE if the user opted-in and didn't disconnect (opt-out).
10385
+ *
10386
+ * @author Leo Fajardo (@leorw)
10387
+ * @since 1.2.1.5
10388
+ *
10389
+ * @return bool
10390
+ */
10391
+ function is_tracking_allowed() {
10392
+ return ( is_object( $this->_site ) && $this->_site->is_tracking_allowed() );
10393
+ }
10394
+
10395
+ /**
10396
+ * @author Vova Feldman (@svovaf)
10397
+ * @since 1.0.4
10398
+ *
10399
+ * @return FS_Plugin
10400
+ */
10401
+ function get_plugin() {
10402
+ return $this->_plugin;
10403
+ }
10404
+
10405
+ /**
10406
+ * @author Vova Feldman (@svovaf)
10407
+ * @since 1.0.3
10408
+ *
10409
+ * @return FS_User
10410
+ */
10411
+ function get_user() {
10412
+ return $this->_user;
10413
+ }
10414
+
10415
+ /**
10416
+ * @author Vova Feldman (@svovaf)
10417
+ * @since 1.0.3
10418
+ *
10419
+ * @return FS_Site
10420
+ */
10421
+ function get_site() {
10422
+ return $this->_site;
10423
+ }
10424
+
10425
+ /**
10426
+ * Get plugin add-ons.
10427
+ *
10428
+ * @author Vova Feldman (@svovaf)
10429
+ * @since 1.0.6
10430
+ *
10431
+ * @since 1.1.7.3 If not yet loaded, fetch data from the API.
10432
+ *
10433
+ * @param bool $flush
10434
+ *
10435
+ * @return FS_Plugin[]|false
10436
+ */
10437
+ function get_addons( $flush = false ) {
10438
+ $this->_logger->entrance();
10439
+
10440
+ if ( ! $this->_has_addons ) {
10441
+ return false;
10442
+ }
10443
+
10444
+ $addons = $this->sync_addons( $flush );
10445
+
10446
+ return ( ! is_array( $addons ) || empty( $addons ) ) ?
10447
+ false :
10448
+ $addons;
10449
+ }
10450
+
10451
+ /**
10452
+ * @author Vova Feldman (@svovaf)
10453
+ * @since 1.0.6
10454
+ *
10455
+ * @return number[]|false
10456
+ */
10457
+ function get_account_addons() {
10458
+ $this->_logger->entrance();
10459
+
10460
+ $addons = self::get_all_account_addons();
10461
+
10462
+ if ( ! is_array( $addons ) ||
10463
+ ! isset( $addons[ $this->_plugin->id ] ) ||
10464
+ ! is_array( $addons[ $this->_plugin->id ] ) ||
10465
+ 0 === count( $addons[ $this->_plugin->id ] )
10466
+ ) {
10467
+ return false;
10468
+ }
10469
+
10470
+ return $addons[ $this->_plugin->id ];
10471
+ }
10472
+
10473
+ /**
10474
+ * Check if user has any
10475
+ *
10476
+ * @author Vova Feldman (@svovaf)
10477
+ * @since 1.1.6
10478
+ *
10479
+ * @return bool
10480
+ */
10481
+ function has_account_addons() {
10482
+ $addons = $this->get_account_addons();
10483
+
10484
+ return is_array( $addons ) && ( 0 < count( $addons ) );
10485
+ }
10486
+
10487
+
10488
+ /**
10489
+ * Get add-on by ID (from local data).
10490
+ *
10491
+ * @author Vova Feldman (@svovaf)
10492
+ * @since 1.0.6
10493
+ *
10494
+ * @param number $id
10495
+ *
10496
+ * @return FS_Plugin|false
10497
+ */
10498
+ function get_addon( $id ) {
10499
+ $this->_logger->entrance();
10500
+
10501
+ $addons = $this->get_addons();
10502
+
10503
+ if ( is_array( $addons ) ) {
10504
+ foreach ( $addons as $addon ) {
10505
+ if ( $id == $addon->id ) {
10506
+ return $addon;
10507
+ }
10508
+ }
10509
+ }
10510
+
10511
+ return false;
10512
+ }
10513
+
10514
+ /**
10515
+ * Get add-on by slug (from local data).
10516
+ *
10517
+ * @author Vova Feldman (@svovaf)
10518
+ * @since 1.0.6
10519
+ *
10520
+ * @param string $slug
10521
+ *
10522
+ * @param bool $flush
10523
+ *
10524
+ * @return FS_Plugin|false
10525
+ */
10526
+ function get_addon_by_slug( $slug, $flush = false ) {
10527
+ $this->_logger->entrance();
10528
+
10529
+ $addons = $this->get_addons( $flush );
10530
+
10531
+ if ( is_array( $addons ) ) {
10532
+ foreach ( $addons as $addon ) {
10533
+ if ( $slug === $addon->slug ) {
10534
+ return $addon;
10535
+ }
10536
+ }
10537
+ }
10538
+
10539
+ return false;
10540
+ }
10541
+
10542
+ /**
10543
+ * @var array<number,object[]> {
10544
+ * @key number Add-on ID.
10545
+ * @val object[] The add-on's plans and prices object.
10546
+ * }
10547
+ */
10548
+ private $plans_and_pricing_by_addon_id;
10549
+
10550
+ /**
10551
+ * @author Leo Fajardo (@leorw)
10552
+ * @since 2.3.0
10553
+ *
10554
+ * @return array<number,object[]> {
10555
+ * @key number Add-on ID.
10556
+ * @val object[] The add-on's plans and prices object.
10557
+ * }
10558
+ */
10559
+ function _get_addons_plans_and_pricing_map_by_id() {
10560
+ if ( ! isset( $this->plans_and_pricing_by_addon_id ) ) {
10561
+ $result = $this->get_api_plugin_scope()->get( $this->add_show_pending( "/addons/pricing.json?type=visible" ) );
10562
+
10563
+ $plans_and_pricing_by_addon_id = array();
10564
+ if ( $this->is_api_result_object( $result, 'addons' ) ) {
10565
+ foreach ( $result->addons as $addon ) {
10566
+ $plans_and_pricing_by_addon_id[ $addon->id ] = $addon->plans;
10567
+ }
10568
+ }
10569
+
10570
+ $this->plans_and_pricing_by_addon_id = $plans_and_pricing_by_addon_id;
10571
+ }
10572
+
10573
+ return $this->plans_and_pricing_by_addon_id;
10574
+ }
10575
+
10576
+ /**
10577
+ * @author Leo Fajardo (@leorw)
10578
+ * @since 2.3.0
10579
+ *
10580
+ * @param number $addon_id
10581
+ * @param bool $is_installed
10582
+ *
10583
+ * @return array
10584
+ */
10585
+ function _get_addon_info( $addon_id, $is_installed ) {
10586
+ $addon = $this->get_addon( $addon_id );
10587
+
10588
+ if ( ! is_object( $addon ) ) {
10589
+ // Unexpected call.
10590
+ return array();
10591
+ }
10592
+
10593
+ $slug = $addon->slug;
10594
+
10595
+ $addon_storage = FS_Storage::instance( WP_FS__MODULE_TYPE_PLUGIN, $slug );
10596
+
10597
+ if ( ! fs_is_network_admin() ) {
10598
+ // Get blog-level activated installations.
10599
+ $sites = self::maybe_get_entities_account_option( 'sites', array() );
10600
+ } else {
10601
+ $sites = null;
10602
+
10603
+ if ( $this->is_addon_activated( $addon_id ) &&
10604
+ $this->get_addon_instance( $addon_id )->is_network_active()
10605
+ ) {
10606
+ if ( FS_Site::is_valid_id( $addon_storage->network_install_blog_id ) ) {
10607
+ // Get network-level activated installations.
10608
+ $sites = self::maybe_get_entities_account_option(
10609
+ 'sites',
10610
+ array(),
10611
+ $addon_storage->network_install_blog_id
10612
+ );
10613
+ }
10614
+ }
10615
+ }
10616
+
10617
+ $addon_info = array(
10618
+ 'is_connected' => false,
10619
+ 'slug' => $slug,
10620
+ 'title' => $addon->title,
10621
+ 'is_whitelabeled' => $addon_storage->is_whitelabeled
10622
+ );
10623
+
10624
+ if ( ! $is_installed ) {
10625
+ $plans_and_pricing_by_addon_id = $this->_get_addons_plans_and_pricing_map_by_id();
10626
+
10627
+ if ( isset( $plans_and_pricing_by_addon_id[ $addon_id ] ) ) {
10628
+ $has_paid_plan = false;
10629
+ $plans = $plans_and_pricing_by_addon_id[ $addon_id ];
10630
+
10631
+ if ( is_array( $plans ) && count( $plans ) > 0 ) {
10632
+ foreach ( $plans as $plan ) {
10633
+ if ( isset( $plan->pricing ) &&
10634
+ is_array( $plan->pricing ) &&
10635
+ count( $plan->pricing ) > 0
10636
+ ) {
10637
+ $has_paid_plan = true;
10638
+ break;
10639
+ }
10640
+ }
10641
+ }
10642
+
10643
+ $addon_info['has_paid_plan'] = $has_paid_plan;
10644
+ }
10645
+ }
10646
+
10647
+ if ( ! is_array( $sites ) || ! isset( $sites[ $slug ] ) ) {
10648
+ return $addon_info;
10649
+ }
10650
+
10651
+ $site = $sites[ $slug ];
10652
+
10653
+ $addon_info['is_connected'] = (
10654
+ ( $addon->parent_plugin_id == $this->get_id() ) &&
10655
+ is_object( $site ) &&
10656
+ FS_Site::is_valid_id( $site->id ) &&
10657
+ FS_User::is_valid_id( $site->user_id ) &&
10658
+ FS_Plugin_Plan::is_valid_id( $site->plan_id )
10659
+ );
10660
+
10661
+ if ( $addon_info['is_connected'] && $is_installed ) {
10662
+ return $addon_info;
10663
+ }
10664
+
10665
+ $addon_info['site'] = $site;
10666
+
10667
+ $plugins_data = self::maybe_get_entities_account_option( WP_FS__MODULE_TYPE_PLUGIN . 's', array() );
10668
+ if ( isset( $plugins_data[ $slug ] ) ) {
10669
+ $plugin_data = $plugins_data[ $slug ];
10670
+
10671
+ $addon_info['version'] = $plugin_data->version;
10672
+ }
10673
+
10674
+ $all_plans = self::maybe_get_entities_account_option( 'plans', array() );
10675
+ if ( isset( $all_plans[ $slug ] ) ) {
10676
+ $plans = $all_plans[ $slug ];
10677
+
10678
+ foreach ( $plans as $plan ) {
10679
+ if ( $site->plan_id == Freemius::_decrypt( $plan->id ) ) {
10680
+ $addon_info['plan_name'] = Freemius::_decrypt( $plan->name );
10681
+ $addon_info['plan_title'] = Freemius::_decrypt( $plan->title );
10682
+ break;
10683
+ }
10684
+ }
10685
+ }
10686
+
10687
+ $licenses = self::maybe_get_entities_account_option( 'all_licenses', array() );
10688
+ if ( is_array( $licenses ) && isset( $licenses[ $addon_id ] ) ) {
10689
+ foreach ( $licenses[ $addon_id ] as $license ) {
10690
+ if ( $license->id == $site->license_id ) {
10691
+ $addon_info['license'] = $license;
10692
+ break;
10693
+ }
10694
+ }
10695
+ }
10696
+
10697
+ if ( isset( $addon_info['license'] ) ) {
10698
+ if ( isset( $addon_storage->subscriptions ) &&
10699
+ ! empty( $addon_storage->subscriptions )
10700
+ ) {
10701
+ $addon_subscriptions = fs_get_entities( $addon_storage->subscriptions, FS_Subscription::get_class_name() );
10702
+
10703
+ foreach ( $addon_subscriptions as $subscription ) {
10704
+ if ( $subscription->license_id == $site->license_id ) {
10705
+ $addon_info['subscription'] = $subscription;
10706
+ break;
10707
+ }
10708
+ }
10709
+ }
10710
+ }
10711
+
10712
+ return $addon_info;
10713
+ }
10714
+
10715
+ /**
10716
+ * @author Vova Feldman (@svovaf)
10717
+ * @since 2.0.0
10718
+ *
10719
+ * @param number $user_id
10720
+ *
10721
+ * @return FS_User
10722
+ */
10723
+ static function _get_user_by_id( $user_id ) {
10724
+ self::$_static_logger->entrance( "user_id = {$user_id}" );
10725
+
10726
+ $users = self::get_all_users();
10727
+
10728
+ if ( is_array( $users ) ) {
10729
+ if ( isset( $users[ $user_id ] ) &&
10730
+ $users[ $user_id ] instanceof FS_User &&
10731
+ $user_id == $users[ $user_id ]->id
10732
+ ) {
10733
+ return $users[ $user_id ];
10734
+ }
10735
+
10736
+ // If user wasn't found by the key, iterate over all the users collection.
10737
+ foreach ( $users as $user ) {
10738
+ /**
10739
+ * @var FS_User $user
10740
+ */
10741
+ if ( $user_id == $user->id ) {
10742
+ return $user;
10743
+ }
10744
+ }
10745
+ }
10746
+
10747
+ return null;
10748
+ }
10749
+
10750
+ /**
10751
+ * Checks if a Freemius user_id is associated with a super-admin.
10752
+ *
10753
+ * @author Vova Feldman (@svovaf)
10754
+ * @since 2.0.0
10755
+ *
10756
+ * @param number $user_id
10757
+ *
10758
+ * @return bool
10759
+ */
10760
+ private static function is_super_admin( $user_id ) {
10761
+ $is_super_admin = false;
10762
+
10763
+ $user = self::_get_user_by_id( $user_id );
10764
+
10765
+ if ( $user instanceof FS_User && ! empty( $user->email ) ) {
10766
+ self::require_pluggable_essentials();
10767
+
10768
+ $wp_user = get_user_by( 'email', $user->email );
10769
+
10770
+ if ( $wp_user instanceof WP_User ) {
10771
+ $super_admins = get_super_admins();
10772
+ $is_super_admin = ( is_array( $super_admins ) && in_array( $wp_user->user_login, $super_admins ) );
10773
+ }
10774
+ }
10775
+
10776
+ return $is_super_admin;
10777
+ }
10778
+
10779
+ #----------------------------------------------------------------------------------
10780
+ #region Plans & Licensing
10781
+ #----------------------------------------------------------------------------------
10782
+
10783
+ /**
10784
+ * Check if running premium plugin code.
10785
+ *
10786
+ * @author Vova Feldman (@svovaf)
10787
+ * @since 1.0.5
10788
+ *
10789
+ * @return bool
10790
+ */
10791
+ function is_premium() {
10792
+ /**
10793
+ * `$this->_plugin` will be `false` when `is_activation_mode` calls this method directly from the
10794
+ * `register_constructor_hooks` method.
10795
+ *
10796
+ * @author Leo Fajardo (@leorw)
10797
+ * @since 2.2.3
10798
+ */
10799
+ return is_object( $this->_plugin ) ?
10800
+ $this->_plugin->is_premium :
10801
+ false;
10802
+ }
10803
+
10804
+ /**
10805
+ * Get site's plan ID.
10806
+ *
10807
+ * @author Vova Feldman (@svovaf)
10808
+ * @since 1.0.2
10809
+ *
10810
+ * @return number
10811
+ */
10812
+ function get_plan_id() {
10813
+ return $this->_site->plan_id;
10814
+ }
10815
+
10816
+ /**
10817
+ * Get site's plan title.
10818
+ *
10819
+ * @author Vova Feldman (@svovaf)
10820
+ * @since 1.0.2
10821
+ *
10822
+ * @return string
10823
+ */
10824
+ function get_plan_title() {
10825
+ $plan = $this->get_plan();
10826
+
10827
+ return is_object( $plan ) ? $plan->title : 'PLAN_TITLE';
10828
+ }
10829
+
10830
+ /**
10831
+ * Get site's plan name.
10832
+ *
10833
+ * @author Vova Feldman (@svovaf)
10834
+ * @since 2.0.0
10835
+ *
10836
+ * @return string
10837
+ */
10838
+ function get_plan_name() {
10839
+ $plan = $this->get_plan();
10840
+
10841
+ return is_object( $plan ) ? $plan->name : 'PLAN_NAME';
10842
+ }
10843
+
10844
+ /**
10845
+ * @author Vova Feldman (@svovaf)
10846
+ * @since 1.0.9
10847
+ *
10848
+ * @return FS_Plugin_Plan|false
10849
+ */
10850
+ function get_plan() {
10851
+ if ( ! is_object( $this->_site ) ) {
10852
+ return false;
10853
+ }
10854
+
10855
+ return FS_Plugin_Plan::is_valid_id( $this->_site->plan_id ) ?
10856
+ $this->_get_plan_by_id( $this->_site->plan_id ) :
10857
+ false;
10858
+ }
10859
+
10860
+ /**
10861
+ * @author Vova Feldman (@svovaf)
10862
+ * @since 1.0.3
10863
+ *
10864
+ * @return bool
10865
+ */
10866
+ function is_trial() {
10867
+ $this->_logger->entrance();
10868
+
10869
+ if ( ! $this->is_registered() || ! is_object( $this->_site ) ) {
10870
+ return false;
10871
+ }
10872
+
10873
+ return $this->_site->is_trial();
10874
+ }
10875
+
10876
+ /**
10877
+ * Check if currently in a trial with payment method (credit card or paypal).
10878
+ *
10879
+ * @author Vova Feldman (@svovaf)
10880
+ * @since 1.1.7
10881
+ *
10882
+ * @return bool
10883
+ */
10884
+ function is_paid_trial() {
10885
+ $this->_logger->entrance();
10886
+
10887
+ if ( ! $this->is_trial() ) {
10888
+ return false;
10889
+ }
10890
+
10891
+ if ( ! $this->has_active_valid_license() ) {
10892
+ return false;
10893
+ }
10894
+
10895
+ if ( $this->_site->trial_plan_id != $this->_license->plan_id ) {
10896
+ return false;
10897
+ }
10898
+
10899
+ /**
10900
+ * @var FS_Subscription $subscription
10901
+ */
10902
+ $subscription = $this->_get_subscription( $this->_license->id );
10903
+
10904
+ return ( is_object( $subscription ) && $subscription->is_active() );
10905
+ }
10906
+
10907
+ /**
10908
+ * Check if trial already utilized.
10909
+ *
10910
+ * @since 1.0.9
10911
+ *
10912
+ * @return bool
10913
+ */
10914
+ function is_trial_utilized() {
10915
+ $this->_logger->entrance();
10916
+
10917
+ if ( ! $this->is_registered() ) {
10918
+ return false;
10919
+ }
10920
+
10921
+ return $this->_site->is_trial_utilized();
10922
+ }
10923
+
10924
+ /**
10925
+ * Get trial plan information (if in trial).
10926
+ *
10927
+ * @author Vova Feldman (@svovaf)
10928
+ * @since 1.0.9
10929
+ *
10930
+ * @return bool|FS_Plugin_Plan
10931
+ */
10932
+ function get_trial_plan() {
10933
+ $this->_logger->entrance();
10934
+
10935
+ if ( ! $this->is_trial() ) {
10936
+ return false;
10937
+ }
10938
+
10939
+ // Try to load plan from local cache.
10940
+ $trial_plan = $this->_get_plan_by_id( $this->_site->trial_plan_id );
10941
+
10942
+ if ( ! is_object( $trial_plan ) ) {
10943
+ $trial_plan = $this->_fetch_site_plan( $this->_site->trial_plan_id );
10944
+
10945
+ /**
10946
+ * If managed to fetch the plan, add it to the plans collection.
10947
+ */
10948
+ if ( $trial_plan instanceof FS_Plugin_Plan ) {
10949
+ if ( ! is_array( $this->_plans ) ) {
10950
+ $this->_plans = array();
10951
+ }
10952
+
10953
+ $this->_plans[] = $trial_plan;
10954
+ $this->_store_plans();
10955
+ }
10956
+ }
10957
+
10958
+ if ( $trial_plan instanceof FS_Plugin_Plan ) {
10959
+ return $trial_plan;
10960
+ }
10961
+
10962
+ /**
10963
+ * If for some reason failed to get the trial plan, fallback to a dummy name and title.
10964
+ */
10965
+ $trial_plan = new FS_Plugin_Plan();
10966
+ $trial_plan->id = $this->_site->trial_plan_id;
10967
+ $trial_plan->name = 'pro';
10968
+ $trial_plan->title = 'Pro';
10969
+
10970
+ return $trial_plan;
10971
+ }
10972
+
10973
+ /**
10974
+ * Check if the user has an activate, non-expired license on current plugin's install.
10975
+ *
10976
+ * @since 1.0.9
10977
+ *
10978
+ * @return bool
10979
+ */
10980
+ function is_paying() {
10981
+ $this->_logger->entrance();
10982
+
10983
+ if ( ! $this->is_registered() ) {
10984
+ return false;
10985
+ }
10986
+
10987
+ if ( ! $this->has_paid_plan() ) {
10988
+ return false;
10989
+ }
10990
+
10991
+ return (
10992
+ ! $this->is_trial() &&
10993
+ 'free' !== $this->get_plan_name() &&
10994
+ $this->has_active_valid_license()
10995
+ );
10996
+ }
10997
+
10998
+ /**
10999
+ * @author Vova Feldman (@svovaf)
11000
+ * @since 1.0.4
11001
+ *
11002
+ * @return bool
11003
+ */
11004
+ function is_free_plan() {
11005
+ if ( ! $this->is_registered() ) {
11006
+ return true;
11007
+ }
11008
+
11009
+ if ( ! $this->has_paid_plan() ) {
11010
+ return true;
11011
+ }
11012
+
11013
+ return (
11014
+ 'free' === $this->get_plan_name() ||
11015
+ ! $this->has_features_enabled_license()
11016
+ );
11017
+ }
11018
+
11019
+ /**
11020
+ * @author Vova Feldman (@svovaf)
11021
+ * @since 1.0.5
11022
+ *
11023
+ * @return bool
11024
+ */
11025
+ function _has_premium_license() {
11026
+ $this->_logger->entrance();
11027
+
11028
+ $premium_license = $this->_get_available_premium_license();
11029
+
11030
+ return ( false !== $premium_license );
11031
+ }
11032
+
11033
+ /**
11034
+ * Check if user has any licenses associated with the plugin (including expired or blocking).
11035
+ *
11036
+ * @author Vova Feldman (@svovaf)
11037
+ * @since 1.1.7.3
11038
+ *
11039
+ * @param bool $including_foreign
11040
+ *
11041
+ * @return bool
11042
+ */
11043
+ function has_any_license( $including_foreign = true ) {
11044
+ if ( ! is_array( $this->_licenses ) || 0 === count( $this->_licenses ) ) {
11045
+ return false;
11046
+ }
11047
+
11048
+ if ( $including_foreign ) {
11049
+ return true;
11050
+ }
11051
+
11052
+ foreach ( $this->_licenses as $license ) {
11053
+ if ( $this->_user->id == $license->user_id ) {
11054
+ return true;
11055
+ }
11056
+ }
11057
+
11058
+ return false;
11059
+ }
11060
+
11061
+ /**
11062
+ * @author Vova Feldman (@svovaf)
11063
+ * @since 1.0.5
11064
+ *
11065
+ * @param bool|null $is_localhost
11066
+ *
11067
+ * @return FS_Plugin_License|false
11068
+ */
11069
+ function _get_available_premium_license( $is_localhost = null ) {
11070
+ $this->_logger->entrance();
11071
+
11072
+ $licenses = $this->get_available_premium_licenses( $is_localhost );
11073
+ if ( ! empty( $licenses ) ) {
11074
+ return $licenses[0];
11075
+ }
11076
+
11077
+ return false;
11078
+ }
11079
+
11080
+ /**
11081
+ * @author Vova Feldman (@svovaf)
11082
+ * @since 1.0.5
11083
+ *
11084
+ * @param bool|null $is_localhost
11085
+ *
11086
+ * @return FS_Plugin_License[]
11087
+ */
11088
+ function get_available_premium_licenses( $is_localhost = null ) {
11089
+ $this->_logger->entrance();
11090
+
11091
+ $licenses = array();
11092
+ if ( ! $this->has_paid_plan() ) {
11093
+ return $licenses;
11094
+ }
11095
+
11096
+ if ( is_array( $this->_licenses ) ) {
11097
+ foreach ( $this->_licenses as $license ) {
11098
+ if ( ! $license->can_activate( $is_localhost ) ) {
11099
+ continue;
11100
+ }
11101
+
11102
+ $licenses[] = $license;
11103
+ }
11104
+ }
11105
+
11106
+ return $licenses;
11107
+ }
11108
+
11109
+ /**
11110
+ * Sync local plugin plans with remote server.
11111
+ *
11112
+ * IMPORTANT: If for some reason a site is associated with deleted plan, we'll preserve the plan's information and append it as the last plan. This means that if plan is deleted, the is_plan() method will ALWAYS return true for any given argument (it becomes the most inclusive plan).
11113
+ *
11114
+ * @author Vova Feldman (@svovaf)
11115
+ * @since 1.0.5
11116
+ *
11117
+ * @return FS_Plugin_Plan[]|object
11118
+ */
11119
+ function _sync_plans() {
11120
+ $plans = $this->_fetch_plugin_plans();
11121
+
11122
+ if ( $this->is_array_instanceof( $plans, 'FS_Plugin_Plan' ) ) {
11123
+ $plans_map = array();
11124
+ foreach ( $plans as $plan ) {
11125
+ $plans_map[ $plan->id ] = true;
11126
+ }
11127
+
11128
+ $plans_ids_to_keep = $this->get_plans_ids_associated_with_installs();
11129
+
11130
+ foreach ( $plans_ids_to_keep as $plan_id ) {
11131
+ if ( isset( $plans_map[ $plan_id ] ) ) {
11132
+ continue;
11133
+ }
11134
+
11135
+ $missing_plan = self::_get_plan_by_id( $plan_id );
11136
+
11137
+ if ( is_object( $missing_plan ) ) {
11138
+ $plans[] = $missing_plan;
11139
+ }
11140
+ }
11141
+
11142
+ $this->_plans = $plans;
11143
+ $this->_store_plans();
11144
+ }
11145
+
11146
+ $this->do_action( 'after_plans_sync', $plans );
11147
+
11148
+ return $this->_plans;
11149
+ }
11150
+
11151
+ /**
11152
+ * Check if specified plan exists locally. If not, fetch it and store it.
11153
+ *
11154
+ * @author Vova Feldman (@svovaf)
11155
+ * @since 2.0.0
11156
+ *
11157
+ * @param number $plan_id
11158
+ *
11159
+ * @return \FS_Plugin_Plan|object The plan entity or the API error object on failure.
11160
+ */
11161
+ private function sync_plan_if_not_exist( $plan_id ) {
11162
+ $plan = self::_get_plan_by_id( $plan_id );
11163
+
11164
+ if ( is_object( $plan ) ) {
11165
+ // Plan already exists.
11166
+ return $plan;
11167
+ }
11168
+
11169
+ $plan = $this->fetch_plan_by_id( $plan_id );
11170
+
11171
+ if ( $plan instanceof FS_Plugin_Plan ) {
11172
+ $this->_plans[] = $plan;
11173
+ $this->_store_plans();
11174
+
11175
+ return $plan;
11176
+ }
11177
+
11178
+ return $plan;
11179
+ }
11180
+
11181
+ /**
11182
+ * Check if specified license exists locally. If not, fetch it and store it.
11183
+ *
11184
+ * @author Vova Feldman (@svovaf)
11185
+ * @since 2.0.0
11186
+ *
11187
+ * @param number $license_id
11188
+ * @param string $license_key
11189
+ *
11190
+ * @return \FS_Plugin_Plan|object The plan entity or the API error object on failure.
11191
+ */
11192
+ private function sync_license_if_not_exist( $license_id, $license_key ) {
11193
+ $license = $this->_get_license_by_id( $license_id );
11194
+
11195
+ if ( is_object( $license ) ) {
11196
+ // License already exists.
11197
+ return $license;
11198
+ }
11199
+
11200
+ $license = $this->fetch_license_by_key( $license_id, $license_key );
11201
+
11202
+ if ( $license instanceof FS_Plugin_License ) {
11203
+ $this->_licenses[] = $license;
11204
+
11205
+ $this->set_license( $license );
11206
+
11207
+ $this->_store_licenses();
11208
+
11209
+ return $license;
11210
+ }
11211
+
11212
+ return $license;
11213
+ }
11214
+
11215
+ /**
11216
+ * Get a collection of unique plan IDs that are associated with any installs in the network.
11217
+ *
11218
+ * @author Leo Fajardo (@leorw)
11219
+ * @since 2.0.0
11220
+ *
11221
+ * @return number[]
11222
+ */
11223
+ private function get_plans_ids_associated_with_installs() {
11224
+ if ( ! is_multisite() ) {
11225
+ if ( ! is_object( $this->_site ) ||
11226
+ ! FS_Plugin_Plan::is_valid_id( $this->_site->plan_id )
11227
+ ) {
11228
+ return array();
11229
+ }
11230
+
11231
+ return array( $this->_site->plan_id );
11232
+ }
11233
+
11234
+ $plan_ids = array();
11235
+ $sites = self::get_sites();
11236
+ foreach ( $sites as $site ) {
11237
+ $blog_id = self::get_site_blog_id( $site );
11238
+ $install = $this->get_install_by_blog_id( $blog_id );
11239
+
11240
+ if ( ! is_object( $install ) ||
11241
+ ! FS_Plugin_Plan::is_valid_id( $install->plan_id )
11242
+ ) {
11243
+ continue;
11244
+ }
11245
+
11246
+ $plan_ids[ $install->plan_id ] = true;
11247
+ }
11248
+
11249
+ return array_keys( $plan_ids );
11250
+ }
11251
+
11252
+ /**
11253
+ * Get a collection of unique license IDs that are associated with any installs in the network.
11254
+ *
11255
+ * @author Leo Fajardo (@leorw)
11256
+ * @since 2.0.0
11257
+ *
11258
+ * @return number[]
11259
+ */
11260
+ private function get_license_ids_associated_with_installs() {
11261
+ if ( ! $this->_is_network_active ) {
11262
+ if ( ! is_object( $this->_site ) ||
11263
+ ! FS_Plugin_License::is_valid_id( $this->_site->license_id )
11264
+ ) {
11265
+ return array();
11266
+ }
11267
+
11268
+ return array( $this->_site->license_id );
11269
+ }
11270
+
11271
+ $license_ids = array();
11272
+ $sites = self::get_sites();
11273
+ foreach ( $sites as $site ) {
11274
+ $blog_id = self::get_site_blog_id( $site );
11275
+ $install = $this->get_install_by_blog_id( $blog_id );
11276
+
11277
+ if ( ! is_object( $install ) ||
11278
+ ! FS_Plugin_License::is_valid_id( $install->license_id )
11279
+ ) {
11280
+ continue;
11281
+ }
11282
+
11283
+ $license_ids[ $install->license_id ] = true;
11284
+ }
11285
+
11286
+ return array_keys( $license_ids );
11287
+ }
11288
+
11289
+ /**
11290
+ * @author Vova Feldman (@svovaf)
11291
+ * @since 1.0.5
11292
+ *
11293
+ * @param number $id
11294
+ *
11295
+ * @return FS_Plugin_Plan|false
11296
+ */
11297
+ function _get_plan_by_id( $id ) {
11298
+ $this->_logger->entrance();
11299
+
11300
+ if ( ! is_array( $this->_plans ) || 0 === count( $this->_plans ) ) {
11301
+ $this->_sync_plans();
11302
+ }
11303
+
11304
+ foreach ( $this->_plans as $plan ) {
11305
+ if ( $id == $plan->id ) {
11306
+ return $plan;
11307
+ }
11308
+ }
11309
+
11310
+ return false;
11311
+ }
11312
+
11313
+ /**
11314
+ * @author Vova Feldman (@svovaf)
11315
+ * @since 1.1.8.1
11316
+ *
11317
+ * @param string $name
11318
+ *
11319
+ * @return FS_Plugin_Plan|false
11320
+ */
11321
+ private function get_plan_by_name( $name ) {
11322
+ $this->_logger->entrance();
11323
+
11324
+ if ( ! is_array( $this->_plans ) || 0 === count( $this->_plans ) ) {
11325
+ $this->_sync_plans();
11326
+ }
11327
+
11328
+ foreach ( $this->_plans as $plan ) {
11329
+ if ( $name == $plan->name ) {
11330
+ return $plan;
11331
+ }
11332
+ }
11333
+
11334
+ return false;
11335
+ }
11336
+
11337
+ /**
11338
+ * Sync local licenses with remote server.
11339
+ *
11340
+ * @author Vova Feldman (@svovaf)
11341
+ * @since 1.0.6
11342
+ *
11343
+ * @param number|bool $site_license_id
11344
+ * @param number|null $blog_id
11345
+ *
11346
+ * @return FS_Plugin_License[]|object
11347
+ */
11348
+ function _sync_licenses( $site_license_id = false, $blog_id = null ) {
11349
+ $this->_logger->entrance();
11350
+
11351
+ $is_network_admin = fs_is_network_admin();
11352
+
11353
+ if ( $is_network_admin && is_null( $blog_id ) ) {
11354
+ $all_licenses = self::get_all_licenses( $this->_module_id );
11355
+ } else {
11356
+ $all_licenses = $this->get_user_licenses( $this->_user->id );
11357
+ }
11358
+
11359
+ $foreign_licenses = $this->get_foreign_licenses_info( $all_licenses, $site_license_id );
11360
+
11361
+ $all_licenses_map = array();
11362
+ foreach ( $all_licenses as $license ) {
11363
+ $all_licenses_map[ $license->id ] = true;
11364
+ }
11365
+
11366
+ $licenses = $this->_fetch_licenses( false, $site_license_id, $foreign_licenses, $blog_id );
11367
+
11368
+ if ( $this->is_array_instanceof( $licenses, 'FS_Plugin_License' ) ) {
11369
+ $licenses_map = array();
11370
+ foreach ( $licenses as $license ) {
11371
+ $licenses_map[ $license->id ] = true;
11372
+ }
11373
+
11374
+ // $license_ids_to_keep = $this->get_license_ids_associated_with_installs();
11375
+ // foreach ( $license_ids_to_keep as $license_id ) {
11376
+ // if ( isset( $licenses_map[ $license_id ] ) ) {
11377
+ // continue;
11378
+ // }
11379
+ //
11380
+ // $missing_license = self::_get_license_by_id( $license_id, false );
11381
+ // if ( is_object( $missing_license ) ) {
11382
+ // $licenses[] = $missing_license;
11383
+ // $licenses_map[ $missing_license->id ] = true;
11384
+ // }
11385
+ // }
11386
+
11387
+ $user_license_ids = $this->get_user_linked_license_ids( $this->_user->id );
11388
+
11389
+ foreach ( $user_license_ids as $key => $license_id ) {
11390
+ if ( ! isset( $licenses_map[ $license_id ] ) ) {
11391
+ // Remove access to licenses that no longer exist.
11392
+ unset( $user_license_ids[ $key ] );
11393
+ }
11394
+ }
11395
+
11396
+ if ( ! empty( $user_license_ids ) ) {
11397
+ foreach ( $licenses_map as $license_id => $value ) {
11398
+ if ( ! isset( $all_licenses_map[ $license_id ] ) ) {
11399
+ // Associate new licenses with the user who triggered the license syncing.
11400
+ $user_license_ids[] = $license_id;
11401
+ }
11402
+ }
11403
+
11404
+ $user_license_ids = array_unique( $user_license_ids );
11405
+ } else {
11406
+ $user_license_ids = array_keys( $licenses_map );
11407
+ }
11408
+
11409
+ if ( ! $is_network_admin || ! is_null( $blog_id ) ) {
11410
+ $user_licenses = array();
11411
+ foreach ( $licenses as $license ) {
11412
+ if ( ! in_array( $license->id, $user_license_ids ) ) {
11413
+ continue;
11414
+ }
11415
+
11416
+ $user_licenses[] = $license;
11417
+ }
11418
+
11419
+ $this->_licenses = $user_licenses;
11420
+ } else {
11421
+ $this->_licenses = $licenses;
11422
+ }
11423
+
11424
+ $this->set_user_linked_license_ids( $this->_user->id, $user_license_ids );
11425
+
11426
+ $this->_store_licenses( true, $this->_module_id, $licenses );
11427
+ }
11428
+
11429
+ // Update current license.
11430
+ if ( is_object( $this->_license ) ) {
11431
+ $license = $this->_get_license_by_id( $this->_license->id );
11432
+
11433
+ if ( is_object( $license ) ) {
11434
+ /**
11435
+ * `$license` can be `false` in case a user change action has just been completed and this method
11436
+ * has synced the `$this->_licenses` collection for the new user. In this case, the
11437
+ * `$this->_licenses` collection may have only the newly activated license that is associated with
11438
+ * the new user. `set_license` will eventually be called in the same request by the logic that
11439
+ * follows outside this method which will detect that the install's license has been updated, and
11440
+ * then `_update_site_license` will be called which in turn will call `set_license`.
11441
+ *
11442
+ * @author Leo Fajardo (@leorw)
11443
+ * @since 2.3.2
11444
+ */
11445
+ $this->set_license( $license );
11446
+ }
11447
+ }
11448
+
11449
+ return $this->_licenses;
11450
+ }
11451
+
11452
+ /**
11453
+ * @author Vova Feldman (@svovaf)
11454
+ * @since 1.0.5
11455
+ *
11456
+ * @param number $id
11457
+ * @param bool $sync_licenses
11458
+ *
11459
+ * @return FS_Plugin_License|false
11460
+ */
11461
+ function _get_license_by_id( $id, $sync_licenses = true ) {
11462
+ $this->_logger->entrance();
11463
+
11464
+ if ( ! FS_Plugin_License::is_valid_id( $id ) ) {
11465
+ return false;
11466
+ }
11467
+
11468
+ /**
11469
+ * When running from the network level admin and opted-in from the network,
11470
+ * check if the license exists in the network user licenses collection.
11471
+ *
11472
+ * @author Vova Feldman (@svovaf)
11473
+ * @since 2.0.0
11474
+ */
11475
+ if ( fs_is_network_admin() &&
11476
+ $this->is_network_registered() &&
11477
+ ( ! is_object( $this->_user ) || $this->_storage->network_user_id != $this->_user->id )
11478
+ ) {
11479
+ $licenses = $this->get_user_licenses( $this->_storage->network_user_id );
11480
+
11481
+ foreach ( $licenses as $license ) {
11482
+ if ( $id == $license->id ) {
11483
+ return $license;
11484
+ }
11485
+ }
11486
+ }
11487
+
11488
+ if ( ! $this->has_any_license() && $sync_licenses ) {
11489
+ $this->_sync_licenses( $id );
11490
+ }
11491
+
11492
+ if ( is_array( $this->_licenses ) ) {
11493
+ foreach ( $this->_licenses as $license ) {
11494
+ if ( $id == $license->id ) {
11495
+ return $license;
11496
+ }
11497
+ }
11498
+ }
11499
+
11500
+ return false;
11501
+ }
11502
+
11503
+ /**
11504
+ * Get license by ID. Unlike _get_license_by_id(), this method only checks the local storage and return any license, whether it's associated with the current context user/install or not.
11505
+ *
11506
+ * @author Vova Feldman (@svovaf)
11507
+ * @since 2.0.0
11508
+ *
11509
+ * @param number $id
11510
+ *
11511
+ * @return FS_Plugin_License
11512
+ */
11513
+ private function get_license_by_id( $id ) {
11514
+ $licenses = self::get_all_licenses( $this->_module_id );
11515
+
11516
+ if ( is_array( $licenses ) && ! empty( $licenses ) ) {
11517
+ foreach ( $licenses as $license ) {
11518
+ if ( $id == $license->id ) {
11519
+ return $license;
11520
+ }
11521
+ }
11522
+ }
11523
+
11524
+ return null;
11525
+ }
11526
+
11527
+ /**
11528
+ * Synchronize the site's context license by fetching the license form the API and updating the local data with it.
11529
+ *
11530
+ * @author Vova Feldman (@svovaf)
11531
+ * @since 2.0.0
11532
+ *
11533
+ * @return \FS_Plugin_License|mixed
11534
+ */
11535
+ private function sync_site_license() {
11536
+ $api = $this->get_api_user_scope();
11537
+
11538
+ $result = $api->get( "/licenses/{$this->_license->id}.json?license_key=" . urlencode( $this->_license->secret_key ), true );
11539
+
11540
+ if ( ! $this->is_api_result_entity( $result ) ) {
11541
+ return $result;
11542
+ }
11543
+
11544
+ $license = $this->_update_site_license( new FS_Plugin_License( $result ) );
11545
+ $this->_store_licenses();
11546
+
11547
+ return $license;
11548
+ }
11549
+
11550
+ /**
11551
+ * Get all user's available licenses for the current module.
11552
+ *
11553
+ * @author Vova Feldman (@svovaf)
11554
+ * @since 2.0.0
11555
+ *
11556
+ * @param number $user_id
11557
+ *
11558
+ * @return FS_Plugin_License[]
11559
+ */
11560
+ private function get_user_licenses( $user_id ) {
11561
+ $all_licenses = self::get_all_licenses( $this->_module_id );
11562
+ if ( empty( $all_licenses ) ) {
11563
+ return array();
11564
+ }
11565
+
11566
+ $user_license_ids = $this->get_user_linked_license_ids( $user_id );
11567
+ if ( empty( $user_license_ids ) ) {
11568
+ return array();
11569
+ }
11570
+
11571
+ $licenses = array();
11572
+ foreach ( $all_licenses as $license ) {
11573
+ if ( in_array( $license->id, $user_license_ids ) ) {
11574
+ $licenses[] = $license;
11575
+ }
11576
+ }
11577
+
11578
+ return $licenses;
11579
+ }
11580
+
11581
+ /**
11582
+ * Checks if the context license is network activated except on the given blog ID.
11583
+ *
11584
+ * @author Vova Feldman (@svovaf)
11585
+ * @since 2.0.0
11586
+ *
11587
+ * @param int $except_blog_id
11588
+ *
11589
+