UpdraftPlus WordPress Backup Plugin - Version 1.16.13

Version Description

  • 29/Apr/2019 =

  • TWEAK: Add support to translation updates

  • TWEAK: Add WP 5.2 support in UpdraftClone

  • TWEAK: Prevent PHP notice in remotesend method

  • TWEAK: Restorations are now started over AJAX instead of in-page. This is preparing the way for future UX improvements.

  • TWEAK: Upgraded the 'site-to-site' remote sending code to use the more recent UDRPC message format

  • TWEAK: Make the UpdraftClone suggestion sentences dismissible

  • TWEAK: Improve JSON-reparser to cope with even more exotic junk from some setups with problems elsewhere in their stack

Download this release

Release Info

Developer DavidAnderson
Plugin Icon 128x128 UpdraftPlus WordPress Backup Plugin
Version 1.16.13
Comparing to
See all releases

Code changes from version 1.16.12 to 1.16.13

admin.php CHANGED
@@ -19,7 +19,7 @@ class UpdraftPlus_Admin {
19
 
20
  private $php_versions = array('5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3');
21
 
22
- private $wp_versions = array('3.2', '3.3', '3.4', '3.5', '3.6', '3.7', '3.8', '3.9', '4.0', '4.1', '4.2', '4.3', '4.4', '4.5', '4.6', '4.7', '4.8', '4.9', '5.0', '5.1');
23
 
24
  private $regions = array('London', 'New York', 'San Francisco', 'Amsterdam', 'Singapore', 'Frankfurt', 'Toronto', 'Bangalore');
25
 
@@ -574,7 +574,8 @@ class UpdraftPlus_Admin {
574
  * @return String - filtered value
575
  */
576
  public function woocommerce_in_plugin_update_message($msg) {
577
- return '<br><strong>'.__('You can test upgrading your site on an instant copy using UpdraftClone credits', 'updraftplus').' - <a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus&amp;tab=migrate#updraft-navtab-migrate-content">'.__('go here', 'updraftplus').'</a></strong>'.$msg;
 
578
  }
579
 
580
  /**
@@ -585,7 +586,8 @@ class UpdraftPlus_Admin {
585
  <script>
586
  jQuery(document).ready(function($) {
587
  if ($('#dashboard-widgets #dashboard_php_nag').length < 1) return;
588
- $('#dashboard-widgets #dashboard_php_nag .button-container').before('<a href="<?php echo UpdraftPlus_Options::admin_page_url(); ?>?page=updraftplus&amp;tab=migrate#updraft-navtab-migrate-content"><?php echo esc_js(__('You can test running your site on a different PHP (or WordPress) version using UpdraftClone credits.', 'updraftplus')); ?></a>');
 
589
  });
590
  </script>
591
  <?php
@@ -628,90 +630,14 @@ class UpdraftPlus_Admin {
628
  <?php
629
  }
630
 
 
 
 
 
 
631
  public function updraft_ajaxrestore() {
632
- // TODO: All needs testing with restricted filesystem permissions. Those credentials need to be POST-ed too - currently not.
633
- // TODO
634
- // error_log(serialize($_POST));
635
-
636
- if (empty($_POST['subaction']) || 'restore' != $_POST['subaction']) {
637
- echo json_encode(array('e' => 'Illegitimate data sent (0)'));
638
- die();
639
- }
640
-
641
- if (empty($_POST['restorenonce'])) {
642
- echo json_encode(array('e' => 'Illegitimate data sent (1)'));
643
- die();
644
- }
645
-
646
- $restore_nonce = (string) $_POST['restorenonce'];
647
-
648
- if (empty($_POST['ajaxauth'])) {
649
- echo json_encode(array('e' => 'Illegitimate data sent (2)'));
650
- die();
651
- }
652
-
653
- global $updraftplus;
654
-
655
- $ajax_auth = get_site_option('updraft_ajax_restore_'.$restore_nonce);
656
-
657
- if (!$ajax_auth) {
658
- echo json_encode(array('e' => 'Illegitimate data sent (3)'));
659
- die();
660
- }
661
-
662
- if (!preg_match('/^([0-9a-f]+):(\d+)/i', $ajax_auth, $matches)) {
663
- echo json_encode(array('e' => 'Illegitimate data sent (4)'));
664
- die();
665
- }
666
-
667
- $nonce_time = $matches[2];
668
- $auth_code_sent = $matches[1];
669
- if (time() > $nonce_time + 600) {
670
- echo json_encode(array('e' => 'Illegitimate data sent (5)'));
671
- die();
672
- }
673
-
674
- // TODO: Deactivate the auth code whilst the operation is underway
675
-
676
- $last_one = empty($_POST['lastone']) ? false : true;
677
-
678
- @set_time_limit(UPDRAFTPLUS_SET_TIME_LIMIT);
679
-
680
- $updraftplus->backup_time_nonce($restore_nonce);
681
- $updraftplus->logfile_open($restore_nonce);
682
-
683
- $timestamp = empty($_POST['timestamp']) ? false : (int) $_POST['timestamp'];
684
- $multisite = empty($_POST['multisite']) ? false : (bool) $_POST['multisite'];
685
- $created_by_version = empty($_POST['created_by_version']) ? false : (int) $_POST['created_by_version'];
686
-
687
- // TODO: We need to know about first_one (not yet sent), as well as last_one
688
-
689
- // TODO: Verify the values of these
690
- $type = empty($_POST['type']) ? false : (int) $_POST['type'];
691
- $backupfile = empty($_POST['backupfile']) ? false : (string) $_POST['backupfile'];
692
-
693
- $updraftplus->log("Deferred restore resumption: $type: $backupfile (timestamp=$timestamp, last_one=$last_one)");
694
-
695
-
696
-
697
- $backupable_entities = $updraftplus->get_backupable_file_entities(true);
698
-
699
- if (!isset($backupable_entities[$type])) {
700
- echo json_encode(array('e' => 'Illegitimate data sent (6 - no such entity)', 'data' => $type));
701
- die();
702
- }
703
-
704
-
705
- if ($last_one) {
706
- // Remove the auth nonce from the DB to prevent abuse
707
- delete_site_option('updraft_ajax_restore_'.$restore_nonce);
708
- } else {
709
- // Reset the counter after a successful operation
710
- update_site_option('updraft_ajax_restore_'.$restore_nonce, $auth_code_sent.':'.time());
711
- }
712
-
713
- echo json_encode(array('e' => 'TODO', 'd' => $_POST));
714
- die;
715
  }
716
 
717
  /**
@@ -1033,6 +959,7 @@ class UpdraftPlus_Admin {
1033
  'clone_key_required' => __('UpdraftClone key is required.', 'updraftplus'),
1034
  'files_new_backup' => __('Include your files in the backup', 'updraftplus'),
1035
  'files_incremental_backup' => __('File backup options', 'updraftplus'),
 
1036
  ));
1037
  }
1038
 
@@ -2889,6 +2816,7 @@ class UpdraftPlus_Admin {
2889
  <form method="post" action="<?php echo UpdraftPlus_Options::admin_page_url().'?page=updraftplus'; ?>">
2890
  <?php wp_nonce_field('updraftplus-credentialtest-nonce'); ?>
2891
  <input id="updraft_restore_continue_action" type="hidden" name="action" value="updraft_restore_continue">
 
2892
  <input type="hidden" name="job_id" value="<?php echo $restore_jobdata['jobid'];?>" value="<?php echo esc_attr($restore_jobdata['jobid']);?>">
2893
  <button onclick="jQuery('#updraft_restore_continue_action').val('updraft_restore_continue'); jQuery(this).parent('form').submit();" type="submit" class="button-primary"><?php _e('Continue restoration', 'updraftplus'); ?></button>
2894
  <button onclick="jQuery('#updraft_restore_continue_action').val('updraft_restore_abort'); jQuery(this).parent('form').submit();" class="button-secondary"><?php _e('Dismiss', 'updraftplus');?></button>
@@ -4461,6 +4389,36 @@ ENDHERE;
4461
  update_site_option('updraft_restore_in_progress', $updraftplus->nonce);
4462
  }
4463
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4464
 
4465
  $is_continuation = ('updraft_restore_continue' == $_REQUEST['action']) ? true : false;
4466
 
@@ -4479,7 +4437,20 @@ ENDHERE;
4479
  $updraftplus->log(__('Sufficient information about the in-progress restoration operation could not be found.', 'updraftplus') . ' (job_id_nojobdata)', 'error', 'job_id_nojobdata');
4480
  }
4481
  }
4482
-
 
 
 
 
 
 
 
 
 
 
 
 
 
4483
  } else {
4484
  $backup_timestamp = $_REQUEST['backup_timestamp'];
4485
  $continuation_data = null;
@@ -4529,6 +4500,28 @@ ENDHERE;
4529
  }
4530
  }
4531
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4532
  /**
4533
  * Processes the jobdata to build an array of entities to restore.
4534
  *
@@ -4603,16 +4596,24 @@ ENDHERE;
4603
  $backup_set['timestamp'] = $timestamp;
4604
 
4605
  $second_loop_entities = empty($continuation_data['second_loop_entities']) ? array() : $continuation_data['second_loop_entities'];
 
 
 
 
 
 
 
 
 
4606
 
4607
  // This will print HTML and die() if necessary
4608
- UpdraftPlus_Filesystem_Functions::ensure_wp_filesystem_set_up_for_restore(array('backup_timestamp' => $timestamp, 'job_id' => $updraftplus->nonce));
 
 
4609
 
4610
  // The <div> is closed by Updraft_Restorer::post_restore_clean_up()
4611
  echo '<h1>'.__('UpdraftPlus Restoration: Progress', 'updraftplus').'</h1><div id="updraft-restore-progress">';
4612
 
4613
- // Provide download link for the log file
4614
- $this->show_admin_warning('<a target="_blank" href="?action=downloadlog&page=updraftplus&updraftplus_backup_nonce='.htmlspecialchars($updraftplus->nonce).'">'.__('Follow this link to download the log file for this restoration (needed for any support requests).', 'updraftplus').'</a>');
4615
-
4616
  $entities_to_restore = $this->get_entities_to_restore_from_jobdata($backup_set);
4617
 
4618
  if (empty($entities_to_restore)) {
19
 
20
  private $php_versions = array('5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3');
21
 
22
+ private $wp_versions = array('3.2', '3.3', '3.4', '3.5', '3.6', '3.7', '3.8', '3.9', '4.0', '4.1', '4.2', '4.3', '4.4', '4.5', '4.6', '4.7', '4.8', '4.9', '5.0', '5.1', '5.2');
23
 
24
  private $regions = array('London', 'New York', 'San Francisco', 'Amsterdam', 'Singapore', 'Frankfurt', 'Toronto', 'Bangalore');
25
 
574
  * @return String - filtered value
575
  */
576
  public function woocommerce_in_plugin_update_message($msg) {
577
+ if (time() < UpdraftPlus_Options::get_updraft_option('dismissed_clone_wc_notices_until', 0)) return $msg;
578
+ return '<div class="updraft-ad-container"><br><strong>'.__('You can test upgrading your site on an instant copy using UpdraftClone credits', 'updraftplus').' - <a href="'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus&amp;tab=migrate#updraft-navtab-migrate-content">'.__('go here to learn more', 'updraftplus').'</a></strong><a href="#" onclick="jQuery(\'.updraft-ad-container\').slideUp(); jQuery.post(ajaxurl, {action: \'updraft_ajax\', subaction: \'dismiss_clone_wc_notice\', nonce: \''. wp_create_nonce('updraftplus-credentialtest-nonce') .'\' });return false;"> - '. __('dismiss notice', 'updraftplus') .'</a></div>'.$msg;
579
  }
580
 
581
  /**
586
  <script>
587
  jQuery(document).ready(function($) {
588
  if ($('#dashboard-widgets #dashboard_php_nag').length < 1) return;
589
+ if (time() < UpdraftPlus_Options::get_updraft_option('dismissed_clone_php_notices_until', 0)) return;
590
+ $('#dashboard-widgets #dashboard_php_nag .button-container').before('<div class="updraft-ad-container"><a href="<?php echo UpdraftPlus_Options::admin_page_url(); ?>?page=updraftplus&amp;tab=migrate#updraft-navtab-migrate-content"><?php echo esc_js(__('You can test running your site on a different PHP (or WordPress) version using UpdraftClone credits.', 'updraftplus')); ?></a> (<a href="#" onclick="jQuery(\'.updraft-ad-container\').slideUp(); jQuery.post(ajaxurl, {action: \'updraft_ajax\', subaction: \'dismiss_clone_php_notice\', nonce: \'<?php echo wp_create_nonce('updraftplus-credentialtest-nonce'); ?>\' });return false;"> <?php _e('Dismiss notice', 'updraftplus'); ?></a>)</div>');
591
  });
592
  </script>
593
  <?php
630
  <?php
631
  }
632
 
633
+ /**
634
+ * Called via the ajax_restore actions to prepare the restore over AJAX
635
+ *
636
+ * @return void
637
+ */
638
  public function updraft_ajaxrestore() {
639
+ $this->prepare_restore();
640
+ die();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
641
  }
642
 
643
  /**
959
  'clone_key_required' => __('UpdraftClone key is required.', 'updraftplus'),
960
  'files_new_backup' => __('Include your files in the backup', 'updraftplus'),
961
  'files_incremental_backup' => __('File backup options', 'updraftplus'),
962
+ 'ajax_restore_invalid_response' => __('Restore error: HTML was detected in the response. You may have a security module on your webserver blocking the restoration operation.', 'updraftplus'),
963
  ));
964
  }
965
 
2816
  <form method="post" action="<?php echo UpdraftPlus_Options::admin_page_url().'?page=updraftplus'; ?>">
2817
  <?php wp_nonce_field('updraftplus-credentialtest-nonce'); ?>
2818
  <input id="updraft_restore_continue_action" type="hidden" name="action" value="updraft_restore_continue">
2819
+ <input type="hidden" name="updraftplus_ajax_restore" value="continue_ajax_restore">
2820
  <input type="hidden" name="job_id" value="<?php echo $restore_jobdata['jobid'];?>" value="<?php echo esc_attr($restore_jobdata['jobid']);?>">
2821
  <button onclick="jQuery('#updraft_restore_continue_action').val('updraft_restore_continue'); jQuery(this).parent('form').submit();" type="submit" class="button-primary"><?php _e('Continue restoration', 'updraftplus'); ?></button>
2822
  <button onclick="jQuery('#updraft_restore_continue_action').val('updraft_restore_abort'); jQuery(this).parent('form').submit();" class="button-secondary"><?php _e('Dismiss', 'updraftplus');?></button>
4389
  update_site_option('updraft_restore_in_progress', $updraftplus->nonce);
4390
  }
4391
  }
4392
+
4393
+ // If this is the start of an ajax restore then end execution here so it can then be booted over ajax
4394
+ if (isset($_REQUEST['updraftplus_ajax_restore']) && 'start_ajax_restore' == $_REQUEST['updraftplus_ajax_restore']) {
4395
+ // return to prevent any more code from running
4396
+ return $this->prepare_ajax_restore();
4397
+
4398
+ } elseif (isset($_REQUEST['updraftplus_ajax_restore']) && 'continue_ajax_restore' == $_REQUEST['updraftplus_ajax_restore']) {
4399
+ // If we enter here then in order to restore we needed to require the filesystem credentials we should save these before returning back to the browser and load them back after the AJAX call, this prevents us asking for the filesystem credentials again
4400
+ $filesystem_credentials = array(
4401
+ 'hostname' => '',
4402
+ 'username' => '',
4403
+ 'password' => '',
4404
+ 'connection_type' => '',
4405
+ 'upgrade' => '',
4406
+ );
4407
+
4408
+ $credentials_found = false;
4409
+
4410
+ foreach ($_REQUEST as $key => $value) {
4411
+ if (array_key_exists($key, $filesystem_credentials)) {
4412
+ $filesystem_credentials[$key] = stripslashes($value);
4413
+ $credentials_found = true;
4414
+ }
4415
+ }
4416
+
4417
+ if ($credentials_found) $updraftplus->jobdata_set('filesystem_credentials', $filesystem_credentials);
4418
+
4419
+ // return to prevent any more code from running
4420
+ return $this->prepare_ajax_restore();
4421
+ }
4422
 
4423
  $is_continuation = ('updraft_restore_continue' == $_REQUEST['action']) ? true : false;
4424
 
4437
  $updraftplus->log(__('Sufficient information about the in-progress restoration operation could not be found.', 'updraftplus') . ' (job_id_nojobdata)', 'error', 'job_id_nojobdata');
4438
  }
4439
  }
4440
+ } elseif (isset($_REQUEST['updraftplus_ajax_restore']) && 'do_ajax_restore' == $_REQUEST['updraftplus_ajax_restore']) {
4441
+ $backup_timestamp = $updraftplus->jobdata_get('backup_timestamp');
4442
+ $filesystem_credentials = $updraftplus->jobdata_get('filesystem_credentials', array());
4443
+
4444
+ if (empty($filesystem_credentials)) {
4445
+ $continuation_data = array('updraftplus_ajax_restore' => 'continue_ajax_restore');
4446
+ } else {
4447
+ $continuation_data = null;
4448
+ // If the filesystem credentials are not empty then we now need to load these back into $_POST so that WP_Filesystem can access them
4449
+ foreach ($filesystem_credentials as $key => $value) {
4450
+ $_POST[$key] = $value;
4451
+ }
4452
+ }
4453
+
4454
  } else {
4455
  $backup_timestamp = $_REQUEST['backup_timestamp'];
4456
  $continuation_data = null;
4500
  }
4501
  }
4502
 
4503
+ /**
4504
+ * This function will load the required ajax and output any relevant html for the ajax restore
4505
+ *
4506
+ * @return void
4507
+ */
4508
+ private function prepare_ajax_restore() {
4509
+ global $updraftplus;
4510
+
4511
+ $enqueue_version = $updraftplus->use_unminified_scripts() ? $updraftplus->version . '.' . time() : $updraftplus->version;
4512
+ $min_or_not = $updraftplus->use_unminified_scripts() ? '' : '.min';
4513
+
4514
+ wp_enqueue_script('updraft-admin-restore', UPDRAFTPLUS_URL . '/js/updraft-admin-restore' . $min_or_not . '.js', array(), $enqueue_version);
4515
+
4516
+ $this->show_admin_warning('<p>'.__('Starting restore job:', 'updraftplus').' '.$updraftplus->nonce.'</p><p>'.__('The restore operation has begun. Do not press stop or close your browser until it reports itself as having finished.', 'updraftplus').'</p>');
4517
+
4518
+ // Provide download link for the log file
4519
+ $this->show_admin_warning('<a target="_blank" href="?action=downloadlog&page=updraftplus&updraftplus_backup_nonce='.htmlspecialchars($updraftplus->nonce).'">'.__('Follow this link to download the log file for this restoration (needed for any support requests).', 'updraftplus').'</a>');
4520
+
4521
+ echo '<input type="hidden" id="updraftplus_ajax_restore_job_id" name="updraftplus_restore_job_id" value="' . $updraftplus->nonce . '">';
4522
+ echo '<div id="updraftplus_ajax_restore_output"></div>';
4523
+ }
4524
+
4525
  /**
4526
  * Processes the jobdata to build an array of entities to restore.
4527
  *
4596
  $backup_set['timestamp'] = $timestamp;
4597
 
4598
  $second_loop_entities = empty($continuation_data['second_loop_entities']) ? array() : $continuation_data['second_loop_entities'];
4599
+
4600
+ $url_parameters = array(
4601
+ 'backup_timestamp' => $timestamp,
4602
+ 'job_id' => $updraftplus->nonce
4603
+ );
4604
+
4605
+ if (!empty($continuation_data['updraftplus_ajax_restore'])) $url_parameters['updraftplus_ajax_restore'] = $continuation_data['updraftplus_ajax_restore'];
4606
+
4607
+ $updraftplus->log("Ensuring WP_Filesystem is setup for a restore");
4608
 
4609
  // This will print HTML and die() if necessary
4610
+ UpdraftPlus_Filesystem_Functions::ensure_wp_filesystem_set_up_for_restore($url_parameters);
4611
+
4612
+ $updraftplus->log("WP_Filesystem is setup and ready for a restore");
4613
 
4614
  // The <div> is closed by Updraft_Restorer::post_restore_clean_up()
4615
  echo '<h1>'.__('UpdraftPlus Restoration: Progress', 'updraftplus').'</h1><div id="updraft-restore-progress">';
4616
 
 
 
 
4617
  $entities_to_restore = $this->get_entities_to_restore_from_jobdata($backup_set);
4618
 
4619
  if (empty($entities_to_restore)) {
central/modules/updates.php CHANGED
@@ -14,6 +14,8 @@ class UpdraftCentral_Updates_Commands extends UpdraftCentral_Commands {
14
 
15
  if (!empty($updates['core']) && !current_user_can('update_core')) return $this->_generic_error_response('updates_permission_denied', 'update_core');
16
 
 
 
17
  $this->_admin_include('plugin.php', 'update.php', 'file.php', 'template.php');
18
  $this->_frontend_include('update.php');
19
 
@@ -49,10 +51,16 @@ class UpdraftCentral_Updates_Commands extends UpdraftCentral_Commands {
49
  break;
50
  }
51
 
 
 
 
 
 
52
  return $this->_response(array(
53
  'plugins' => $plugin_updates,
54
  'themes' => $theme_updates,
55
  'core' => $core_updates,
 
56
  ));
57
 
58
  }
@@ -400,6 +408,44 @@ class UpdraftCentral_Updates_Commands extends UpdraftCentral_Commands {
400
 
401
  }
402
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
403
  private function get_theme_version($theme) {
404
 
405
  if (function_exists('wp_get_theme')) {
@@ -588,6 +634,25 @@ class UpdraftCentral_Updates_Commands extends UpdraftCentral_Commands {
588
  return $items;
589
  }
590
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
591
  public function get_updates($options) {
592
 
593
  // Forcing Elegant Themes (Divi) updates component to load if it exist.
@@ -746,6 +811,14 @@ class UpdraftCentral_Updates_Commands extends UpdraftCentral_Commands {
746
 
747
  }
748
 
 
 
 
 
 
 
 
 
749
 
750
  // Do we need to ask the user for filesystem credentials?
751
  $request_filesystem_credentials = array();
@@ -755,6 +828,16 @@ class UpdraftCentral_Updates_Commands extends UpdraftCentral_Commands {
755
  'core' => untrailingslashit(ABSPATH)
756
  );
757
 
 
 
 
 
 
 
 
 
 
 
758
  foreach ($check_fs as $entity => $dir) {
759
  $filesystem_method = get_filesystem_method(array(), $dir);
760
  ob_start();
@@ -770,6 +853,7 @@ class UpdraftCentral_Updates_Commands extends UpdraftCentral_Commands {
770
  'plugins' => $plugin_updates,
771
  'themes' => $theme_updates,
772
  'core' => $core_updates,
 
773
  'meta' => array(
774
  'request_filesystem_credentials' => $request_filesystem_credentials,
775
  'filesystem_form' => $filesystem_form,
14
 
15
  if (!empty($updates['core']) && !current_user_can('update_core')) return $this->_generic_error_response('updates_permission_denied', 'update_core');
16
 
17
+ if (!empty($updates['translations']) && !$this->user_can_update_translations()) return $this->_generic_error_response('updates_permission_denied', 'update_translations');
18
+
19
  $this->_admin_include('plugin.php', 'update.php', 'file.php', 'template.php');
20
  $this->_frontend_include('update.php');
21
 
51
  break;
52
  }
53
 
54
+ $translation_updates = array();
55
+ if (!empty($updates['translations'])) {
56
+ $translation_updates[] = $this->_update_translation();
57
+ }
58
+
59
  return $this->_response(array(
60
  'plugins' => $plugin_updates,
61
  'themes' => $theme_updates,
62
  'core' => $core_updates,
63
+ 'translations' => $translation_updates,
64
  ));
65
 
66
  }
408
 
409
  }
410
 
411
+ /**
412
+ * Updates available translations for this website
413
+ *
414
+ * @return Array
415
+ */
416
+ private function _update_translation() {
417
+ global $wp_filesystem;
418
+
419
+ include_once(ABSPATH . 'wp-admin/includes/class-wp-upgrader.php');
420
+ if (!class_exists('Automatic_Upgrader_Skin')) include_once(UPDRAFTCENTRAL_CLIENT_DIR.'/classes/class-automatic-upgrader-skin.php');
421
+
422
+ $skin = new Automatic_Upgrader_Skin();
423
+ $upgrader = new Language_Pack_Upgrader($skin);
424
+ $result = $upgrader->bulk_upgrade();
425
+
426
+ if (is_array($result) && !empty($result)) {
427
+ $status['success'] = true;
428
+ } elseif (is_wp_error($result)) {
429
+ $status['error'] = $result->get_error_code();
430
+ $status['error_message'] = $result->get_error_message();
431
+ } elseif (is_bool($result) && !$result) {
432
+ $status['error'] = 'unable_to_connect_to_filesystem';
433
+
434
+ // Pass through the error from WP_Filesystem if one was raised
435
+ if (is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code()) {
436
+ $status['error'] = $wp_filesystem->errors->get_error_code();
437
+ $status['error_message'] = $wp_filesystem->errors->get_error_message();
438
+ }
439
+ } elseif (is_bool($result) && $result) {
440
+ $status['error'] = 'up_to_date';
441
+ } else {
442
+ // An unhandled error occured
443
+ $status['error'] = 'update_failed';
444
+ }
445
+
446
+ return $status;
447
+ }
448
+
449
  private function get_theme_version($theme) {
450
 
451
  if (function_exists('wp_get_theme')) {
634
  return $items;
635
  }
636
 
637
+ /**
638
+ * Custom validation for translation permission. Since the 'install_languages' capability insn't available until 4.9
639
+ * therefore, we wrapped the validation check in this block to support older version of WP.
640
+ *
641
+ * @return Boolean
642
+ */
643
+ private function user_can_update_translations() {
644
+ global $updraftplus;
645
+ $wp_version = $updraftplus->get_wordpress_version();
646
+
647
+ if (version_compare($wp_version, '4.9', '<')) {
648
+ if (current_user_can('update_core') || current_user_can('update_plugins') || current_user_can('update_themes')) return true;
649
+ } else {
650
+ if (current_user_can('install_languages')) return true;
651
+ }
652
+
653
+ return false;
654
+ }
655
+
656
  public function get_updates($options) {
657
 
658
  // Forcing Elegant Themes (Divi) updates component to load if it exist.
811
 
812
  }
813
 
814
+ $translation_updates = array();
815
+ if (function_exists('wp_get_translation_updates') && $this->user_can_update_translations()) {
816
+ $translations = wp_get_translation_updates();
817
+
818
+ $translation_updates = array(
819
+ 'items' => $translations
820
+ );
821
+ }
822
 
823
  // Do we need to ask the user for filesystem credentials?
824
  $request_filesystem_credentials = array();
828
  'core' => untrailingslashit(ABSPATH)
829
  );
830
 
831
+ if (!empty($translation_updates)) {
832
+ // 'en_US' don't usually have the "languages" folder, thus, we
833
+ // check if there's a need to ask for filesystem credentials for that
834
+ // folder if it exists, most especially for locale other than 'en_US'.
835
+ $language_dir = WP_CONTENT_DIR.'/languages';
836
+ if ('en_US' !== get_locale() && is_dir($language_dir)) {
837
+ $check_fs['translations'] = $language_dir;
838
+ }
839
+ }
840
+
841
  foreach ($check_fs as $entity => $dir) {
842
  $filesystem_method = get_filesystem_method(array(), $dir);
843
  ob_start();
853
  'plugins' => $plugin_updates,
854
  'themes' => $theme_updates,
855
  'core' => $core_updates,
856
+ 'translations' => $translation_updates,
857
  'meta' => array(
858
  'request_filesystem_credentials' => $request_filesystem_credentials,
859
  'filesystem_form' => $filesystem_form,
class-updraftplus.php CHANGED
@@ -4663,6 +4663,8 @@ class UpdraftPlus {
4663
  'updraftplus_tmp_googledrive_access_token',
4664
  'updraftplus_dismissedautobackup',
4665
  'dismissed_general_notices_until',
 
 
4666
  'dismissed_season_notices_until',
4667
  'updraftplus_dismissedexpiry',
4668
  'updraftplus_dismisseddashnotice',
4663
  'updraftplus_tmp_googledrive_access_token',
4664
  'updraftplus_dismissedautobackup',
4665
  'dismissed_general_notices_until',
4666
+ 'dismissed_clone_php_notices_until',
4667
+ 'dismissed_clone_wc_notices_until',
4668
  'dismissed_season_notices_until',
4669
  'updraftplus_dismissedexpiry',
4670
  'updraftplus_dismisseddashnotice',
includes/class-filesystem-functions.php CHANGED
@@ -67,16 +67,21 @@ class UpdraftPlus_Filesystem_Functions {
67
  $build_url .= '&'.$k.'='.$v;
68
  }
69
 
70
- $credentials = request_filesystem_credentials($build_url, '', false, false);
71
 
72
- WP_Filesystem($credentials);
73
-
74
- if ($wp_filesystem->errors->get_error_code()) {
75
- echo '<p><em><a href="'.apply_filters('updraftplus_com_link', "https://updraftplus.com/faqs/asked-ftp-details-upon-restorationmigration-updates/").'" target="_blank">'.__('Why am I seeing this?', 'updraftplus').'</a></em></p>';
76
- foreach ($wp_filesystem->errors->get_error_messages() as $message) show_message($message);
77
- exit;
 
 
 
 
 
 
 
78
  }
79
-
80
  }
81
 
82
  /**
67
  $build_url .= '&'.$k.'='.$v;
68
  }
69
 
 
70
 
71
+ if (false === ($credentials = request_filesystem_credentials($build_url, '', false, false))) exit;
72
+
73
+ if (!WP_Filesystem($credentials)) {
74
+
75
+ $updraftplus->log("Filesystem credentials are required for WP_Filesystem");
76
+
77
+ request_filesystem_credentials($build_url, '', true, false);
78
+
79
+ if ($wp_filesystem->errors->get_error_code()) {
80
+ echo '<p><em><a href="' . apply_filters('updraftplus_com_link', "https://updraftplus.com/faqs/asked-ftp-details-upon-restorationmigration-updates/") . '" target="_blank">' . __('Why am I seeing this?', 'updraftplus') . '</a></em></p>';
81
+ foreach ($wp_filesystem->errors->get_error_messages() as $message) show_message($message);
82
+ exit;
83
+ }
84
  }
 
85
  }
86
 
87
  /**
includes/class-remote-send.php CHANGED
@@ -23,7 +23,7 @@ abstract class UpdraftPlus_RemoteSend {
23
  }
24
 
25
  /**
26
- * Runs upon the WP action plugins_loaded
27
  */
28
  public function plugins_loaded() {
29
 
@@ -42,9 +42,15 @@ abstract class UpdraftPlus_RemoteSend {
42
  foreach ($our_keys as $name_hash => $key) {
43
  if (!is_array($key)) return;
44
  $ud_rpc = $updraftplus->get_udrpc($name_hash.'.migrator.updraftplus.com');
45
- $ud_rpc->set_message_format(1);
 
 
 
 
 
 
 
46
  $this->receivers[$name_hash] = $ud_rpc;
47
- $ud_rpc->set_key_local($key['key']);
48
  // Create listener (which causes WP actions to be fired when messages are received)
49
  $ud_rpc->activate_replay_protection();
50
  $ud_rpc->create_listener();
@@ -52,9 +58,37 @@ abstract class UpdraftPlus_RemoteSend {
52
  add_filter('udrpc_command_send_chunk', array($this, 'udrpc_command_send_chunk'), 10, 3);
53
  add_filter('udrpc_command_get_file_status', array($this, 'udrpc_command_get_file_status'), 10, 3);
54
  add_filter('udrpc_command_upload_complete', array($this, 'udrpc_command_upload_complete'), 10, 3);
 
55
  }
56
  }
57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  protected function initialise_listener_error_handling($hash) {
59
  global $updraftplus;
60
  $updraftplus->error_reporting_stop_when_logged = true;
@@ -218,7 +252,7 @@ abstract class UpdraftPlus_RemoteSend {
218
  public function udrpc_command_upload_complete($response, $data, $name_indicator) {// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found
219
  if (!preg_match('/^([a-f0-9]+)\.migrator.updraftplus.com$/', $name_indicator, $matches)) return $response;
220
 
221
- if (defined('UPDRAFTPLUS_THIS_IS_CLONE')) {
222
  $job_id = (is_array($data) && !empty($data['job_id'])) ? $data['job_id'] : null;
223
  do_action('updraftplus_temporary_clone_ready_for_restore', $job_id);
224
  }
@@ -262,16 +296,33 @@ abstract class UpdraftPlus_RemoteSend {
262
 
263
  public function updraft_remote_ping_test($data) {
264
 
265
- global $updraftplus;
266
-
267
  if (!isset($data['id']) || !is_numeric($data['id']) || empty($data['url'])) die;
268
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
269
  $remotesites = UpdraftPlus_Options::get_updraft_option('updraft_remotesites');
270
  if (!is_array($remotesites)) $remotesites = array();
271
 
272
- if (empty($remotesites[$data['id']]) || $data['url'] != $remotesites[$data['id']]['url'] || empty($remotesites[$data['id']]['key']) || empty($remotesites[$data['id']]['name_indicator'])) {
273
- echo json_encode(array('e' => 1, 'r' => __('Error:', 'updraftplus').' '.__('site not found', 'updraftplus')));
274
- die();
275
  }
276
 
277
  try {
@@ -281,17 +332,37 @@ abstract class UpdraftPlus_RemoteSend {
281
  $this->php_events = array();
282
  add_filter('updraftplus_logline', array($this, 'updraftplus_logline'), 10, 4);
283
 
284
- $opts = $remotesites[$data['id']];
285
-
286
  $ud_rpc = $updraftplus->get_udrpc($opts['name_indicator']);
287
- $ud_rpc->set_message_format(1);
288
- $ud_rpc->set_key_local($opts['key']);
289
- $ud_rpc->set_destination_url($data['url']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  $ud_rpc->activate_replay_protection();
291
 
292
  do_action('updraftplus_remotesend_udrpc_object_obtained', $ud_rpc, $opts);
293
-
294
- $response = $ud_rpc->send_message('ping');
295
 
296
  restore_error_handler();
297
 
@@ -307,18 +378,21 @@ abstract class UpdraftPlus_RemoteSend {
307
  $err_data = $response;
308
  $err_code = 'no_pong';
309
 
 
 
 
310
  }
311
 
312
  if (isset($err_msg)) {
313
 
314
  $res = array('e' => 1, 'r' => $err_msg);
315
 
316
- if ($this->url_looks_internal($data['url'])) {
317
- $res['moreinfo'] = '<p>'.sprintf(__('The site URL you are sending to (%s) looks like a local development website. If you are sending from an external network, it is likely that a firewall will be blocking this.', 'updraftplus'), htmlspecialchars($data['url'])).'</p>';
318
  }
319
 
320
  // We got several support requests from people who didn't seem to be aware of other methods
321
- $msg_try_other_method = '<p>'.__('If sending directly from site to site does not work for you, then there are three other methods - please try one of these instead.', 'updraftplus').'<a href="https://updraftplus.com/faqs/how-do-i-migrate-to-a-new-site-location/#importing" target="_blank">'.__('For longer help, including screenshots, follow this link.', 'updraftplus').'</a></p>';
322
 
323
  $res['moreinfo'] = isset($res['moreinfo']) ? $res['moreinfo'].$msg_try_other_method : $msg_try_other_method;
324
 
@@ -327,13 +401,12 @@ abstract class UpdraftPlus_RemoteSend {
327
 
328
  if (!empty($this->php_events)) $res['php_events'] = $this->php_events;
329
 
330
- echo json_encode($res);
331
- die;
332
  }
333
 
334
  $ret = '<p>'.__('Testing connection...', 'updraftplus').' '.__('OK', 'updraftplus').'</p>';
335
 
336
- global $updraftplus, $updraftplus_admin;
337
 
338
  $ret .= '<input type="checkbox" checked="checked" id="remotesend_backupnow_db"> <label for="remotesend_backupnow_db">'.__("Database", 'updraftplus').'</label><br>';
339
  $ret .= $updraftplus_admin->files_selector_widgetry('remotesend_', false, false);
@@ -364,11 +437,10 @@ abstract class UpdraftPlus_RemoteSend {
364
  $ret .= apply_filters('updraft_backupnow_modal_afteroptions', '', 'remotesend_');
365
  $ret .= '<button class="button-primary" style="height:30px; font-size:16px; margin-left: 3px; width:85px;" id="updraft_migrate_send_button" onclick="updraft_migrate_go_backup();">'.__('Send', 'updraftplus').'</button>';
366
 
367
- echo json_encode(array('success' => 1, 'r' => $ret));
368
  } catch (Exception $e) {
369
- echo json_encode(array('e' => 1, 'r' => __('Error:', 'updraftplus').' '.$e->getMessage().' (line: '.$e->getLine().', file: '.$e->getFile().')'));
370
  }
371
- die;
372
  }
373
 
374
  /**
@@ -469,7 +541,12 @@ abstract class UpdraftPlus_RemoteSend {
469
  if (empty($data['key'])) {
470
  $ret['e'] = sprintf(__("Failure: No %s was given.", 'updraftplus'), __('key', 'updraftplus'));
471
  } else {
472
- $ud_rpc = $updraftplus->get_udrpc();
 
 
 
 
 
473
 
474
  // A bundle has these keys: key, name_indicator, url
475
  $decode_bundle = $ud_rpc->decode_portable_bundle($data['key'], 'base64_with_count');
@@ -500,13 +577,22 @@ abstract class UpdraftPlus_RemoteSend {
500
  if (!is_array($rsite)) continue;
501
  if ($rsite['url'] == $decode_bundle['url']) unset($remotesites[$k]);
502
  }
503
- $remotesites[] = $decode_bundle;
504
- UpdraftPlus_Options::update_updraft_option('updraft_remotesites', $remotesites);
505
 
506
- $ret['selector'] = $this->get_remotesites_selector($remotesites);
 
 
 
 
 
 
 
 
507
 
508
- // Return the new HTML widget to the front end
509
- $ret['r'] = __('The key was successfully added.', 'updraftplus').' '.__('It is for sending backups to the following site: ', 'updraftplus').htmlspecialchars($decode_bundle['url']);
 
 
 
510
 
511
  }
512
  }
23
  }
24
 
25
  /**
26
+ * Runs upon the WP action plugins_loaded; sets up UDRPC listeners for site-to-site migration
27
  */
28
  public function plugins_loaded() {
29
 
42
  foreach ($our_keys as $name_hash => $key) {
43
  if (!is_array($key)) return;
44
  $ud_rpc = $updraftplus->get_udrpc($name_hash.'.migrator.updraftplus.com');
45
+ if (!empty($key['sender_public'])) {
46
+ $ud_rpc->set_message_format(2);
47
+ $ud_rpc->set_key_local($key['key']);
48
+ $ud_rpc->set_key_remote($key['sender_public']);
49
+ } else {
50
+ $ud_rpc->set_message_format(1);
51
+ $ud_rpc->set_key_local($key['key']);
52
+ }
53
  $this->receivers[$name_hash] = $ud_rpc;
 
54
  // Create listener (which causes WP actions to be fired when messages are received)
55
  $ud_rpc->activate_replay_protection();
56
  $ud_rpc->create_listener();
58
  add_filter('udrpc_command_send_chunk', array($this, 'udrpc_command_send_chunk'), 10, 3);
59
  add_filter('udrpc_command_get_file_status', array($this, 'udrpc_command_get_file_status'), 10, 3);
60
  add_filter('udrpc_command_upload_complete', array($this, 'udrpc_command_upload_complete'), 10, 3);
61
+ add_filter('udrpc_action', array($this, 'udrpc_action'), 10, 4);
62
  }
63
  }
64
 
65
+ /**
66
+ * This function will return a response to the remote site on any action
67
+ *
68
+ * @param string $response - a string response
69
+ * @param string $command - the incoming command
70
+ * @param array $data - an array of response data
71
+ * @param string $name_indicator - a string to identify the request
72
+ *
73
+ * @return array - the array response
74
+ */
75
+ public function udrpc_action($response, $command, $data, $name_indicator) {// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found
76
+
77
+ if (is_array($data) && isset($data['sender_public'])) {
78
+ // Do we already know the sender's public key?
79
+ $our_keys = UpdraftPlus_Options::get_updraft_option('updraft_migrator_localkeys');
80
+ if (is_array($our_keys) && preg_match('/^([a-f0-9]+)\.migrator.updraftplus.com$/', $name_indicator, $matches) && !empty($our_keys[$matches[1]]) && empty($our_keys[$matches[1]]['sender_public'])) {
81
+ // N.B. When the sender sends a public key, that indicates that *all* future communications will use it
82
+ $our_keys[$matches[1]]['sender_public'] = $data['sender_public'];
83
+ UpdraftPlus_Options::update_updraft_option('updraft_migrator_localkeys', $our_keys);
84
+ if (!is_array($response['data'])) $response['data'] = array();
85
+ $response['data']['got_public'] = 1;
86
+ }
87
+ }
88
+
89
+ return $response;
90
+ }
91
+
92
  protected function initialise_listener_error_handling($hash) {
93
  global $updraftplus;
94
  $updraftplus->error_reporting_stop_when_logged = true;
252
  public function udrpc_command_upload_complete($response, $data, $name_indicator) {// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found
253
  if (!preg_match('/^([a-f0-9]+)\.migrator.updraftplus.com$/', $name_indicator, $matches)) return $response;
254
 
255
+ if (defined('UPDRAFTPLUS_THIS_IS_CLONE') && UPDRAFTPLUS_THIS_IS_CLONE) {
256
  $job_id = (is_array($data) && !empty($data['job_id'])) ? $data['job_id'] : null;
257
  do_action('updraftplus_temporary_clone_ready_for_restore', $job_id);
258
  }
296
 
297
  public function updraft_remote_ping_test($data) {
298
 
 
 
299
  if (!isset($data['id']) || !is_numeric($data['id']) || empty($data['url'])) die;
300
 
301
+ $remote_indicator = $data['id'];
302
+
303
+ $ping_result = $this->do_ping_test($remote_indicator, $data['url']);
304
+
305
+ die(json_encode($ping_result));
306
+
307
+ }
308
+
309
+ /**
310
+ * Do an RPC ping test
311
+ *
312
+ * @param String $remote_indicator
313
+ * @param String $url
314
+ *
315
+ * @return Array - results
316
+ */
317
+ public function do_ping_test($remote_indicator, $url) {
318
+
319
+ global $updraftplus;
320
+
321
  $remotesites = UpdraftPlus_Options::get_updraft_option('updraft_remotesites');
322
  if (!is_array($remotesites)) $remotesites = array();
323
 
324
+ if (empty($remotesites[$remote_indicator]) || $url != $remotesites[$remote_indicator]['url'] || empty($remotesites[$remote_indicator]['key']) || empty($remotesites[$remote_indicator]['name_indicator'])) {
325
+ return array('e' => 1, 'r' => __('Error:', 'updraftplus').' '.__('site not found', 'updraftplus'));
 
326
  }
327
 
328
  try {
332
  $this->php_events = array();
333
  add_filter('updraftplus_logline', array($this, 'updraftplus_logline'), 10, 4);
334
 
335
+ $opts = $remotesites[$remote_indicator];
 
336
  $ud_rpc = $updraftplus->get_udrpc($opts['name_indicator']);
337
+ $send_data = null;
338
+
339
+ if (!empty($opts['format_support']) && 2 == $opts['format_support']) {
340
+ if (empty($opts['remote_got_public'])) {
341
+ // Can't upgrade to format 2 until we know the other end has our public key
342
+ $use_format = 1;
343
+ $send_data = array('sender_public' => $opts['local_public']);
344
+ } else {
345
+ $use_format = 2;
346
+ }
347
+ } else {
348
+ $use_format = 1;
349
+ }
350
+
351
+ $ud_rpc->set_message_format($use_format);
352
+
353
+ if (2 == $use_format) {
354
+ $ud_rpc->set_key_remote($opts['key']);
355
+ $ud_rpc->set_key_local($opts['local_private']);
356
+ } else {
357
+ $ud_rpc->set_key_local($opts['key']);
358
+ }
359
+
360
+ $ud_rpc->set_destination_url($url);
361
  $ud_rpc->activate_replay_protection();
362
 
363
  do_action('updraftplus_remotesend_udrpc_object_obtained', $ud_rpc, $opts);
364
+
365
+ $response = $ud_rpc->send_message('ping', $send_data);
366
 
367
  restore_error_handler();
368
 
378
  $err_data = $response;
379
  $err_code = 'no_pong';
380
 
381
+ } elseif (!empty($response['data']['got_public'])) {
382
+ $remotesites[$remote_indicator]['remote_got_public'] = 1;
383
+ UpdraftPlus_Options::update_updraft_option('updraft_remotesites', $remotesites);
384
  }
385
 
386
  if (isset($err_msg)) {
387
 
388
  $res = array('e' => 1, 'r' => $err_msg);
389
 
390
+ if ($this->url_looks_internal($url)) {
391
+ $res['moreinfo'] = '<p>'.sprintf(__('The site URL you are sending to (%s) looks like a local development website. If you are sending from an external network, it is likely that a firewall will be blocking this.', 'updraftplus'), htmlspecialchars($url)).'</p>';
392
  }
393
 
394
  // We got several support requests from people who didn't seem to be aware of other methods
395
+ $msg_try_other_method = '<p>'.__('If sending directly from site to site does not work for you, then there are three other methods - please try one of these instead.', 'updraftplus').' <a href="https://updraftplus.com/faqs/how-do-i-migrate-to-a-new-site-location/#importing" target="_blank">'.__('For longer help, including screenshots, follow this link.', 'updraftplus').'</a></p>';
396
 
397
  $res['moreinfo'] = isset($res['moreinfo']) ? $res['moreinfo'].$msg_try_other_method : $msg_try_other_method;
398
 
401
 
402
  if (!empty($this->php_events)) $res['php_events'] = $this->php_events;
403
 
404
+ return $res;
 
405
  }
406
 
407
  $ret = '<p>'.__('Testing connection...', 'updraftplus').' '.__('OK', 'updraftplus').'</p>';
408
 
409
+ global $updraftplus_admin;
410
 
411
  $ret .= '<input type="checkbox" checked="checked" id="remotesend_backupnow_db"> <label for="remotesend_backupnow_db">'.__("Database", 'updraftplus').'</label><br>';
412
  $ret .= $updraftplus_admin->files_selector_widgetry('remotesend_', false, false);
437
  $ret .= apply_filters('updraft_backupnow_modal_afteroptions', '', 'remotesend_');
438
  $ret .= '<button class="button-primary" style="height:30px; font-size:16px; margin-left: 3px; width:85px;" id="updraft_migrate_send_button" onclick="updraft_migrate_go_backup();">'.__('Send', 'updraftplus').'</button>';
439
 
440
+ return array('success' => 1, 'r' => $ret);
441
  } catch (Exception $e) {
442
+ return array('e' => 1, 'r' => __('Error:', 'updraftplus').' '.$e->getMessage().' (line: '.$e->getLine().', file: '.$e->getFile().')');
443
  }
 
444
  }
445
 
446
  /**
541
  if (empty($data['key'])) {
542
  $ret['e'] = sprintf(__("Failure: No %s was given.", 'updraftplus'), __('key', 'updraftplus'));
543
  } else {
544
+
545
+ // The indicator isn't really needed - we won't be receiving on it
546
+ $our_indicator = md5(network_site_url()).'.migrator.updraftplus.com';
547
+ $ud_rpc = $updraftplus->get_udrpc($our_indicator);
548
+
549
+ $ud_rpc->set_can_generate(true);
550
 
551
  // A bundle has these keys: key, name_indicator, url
552
  $decode_bundle = $ud_rpc->decode_portable_bundle($data['key'], 'base64_with_count');
577
  if (!is_array($rsite)) continue;
578
  if ($rsite['url'] == $decode_bundle['url']) unset($remotesites[$k]);
579
  }
 
 
580
 
581
+ if (false == $ud_rpc->generate_new_keypair()) {
582
+ $ret['e'] = __('Error:', 'updraftplus').' An error occurred when attempting to generate a new key-pair';
583
+ } else {
584
+
585
+ $decode_bundle['local_private'] = $ud_rpc->get_key_local();
586
+ $decode_bundle['local_public'] = $ud_rpc->get_key_remote();
587
+
588
+ $remotesites[] = $decode_bundle;
589
+ UpdraftPlus_Options::update_updraft_option('updraft_remotesites', $remotesites);
590
 
591
+ $ret['selector'] = $this->get_remotesites_selector($remotesites);
592
+
593
+ // Return the new HTML widget to the front end
594
+ $ret['r'] = __('The key was successfully added.', 'updraftplus').' '.__('It is for sending backups to the following site: ', 'updraftplus').htmlspecialchars($decode_bundle['url']);
595
+ }
596
 
597
  }
598
  }
includes/class-udrpc.php CHANGED
@@ -59,7 +59,7 @@ if (!class_exists('UpdraftPlus_Remote_Communications')) :
59
  class UpdraftPlus_Remote_Communications {
60
 
61
  // Version numbers relate to versions of this PHP library only (i.e. it's not a protocol support number, and version numbers of other compatible libraries (e.g. JavaScript) are not comparable)
62
- public $version = '1.4.17';
63
 
64
  private $key_name_indicator;
65
 
@@ -220,7 +220,7 @@ class UpdraftPlus_Remote_Communications {
220
  /**
221
  * Method to get the remote key
222
  *
223
- * @return array
224
  */
225
  public function get_key_remote() {
226
  if (empty($this->key_remote) && $this->can_generate) {
@@ -248,10 +248,19 @@ class UpdraftPlus_Remote_Communications {
248
  $this->format = $format;
249
  }
250
 
 
 
 
 
 
 
 
 
 
251
  /**
252
  * Method to get the local key
253
  *
254
- * @return array
255
  */
256
  public function get_key_local() {
257
  if (empty($this->key_local)) {
@@ -310,6 +319,7 @@ class UpdraftPlus_Remote_Communications {
310
  'url' => trailingslashit(network_site_url()),
311
  'admin_url' => trailingslashit(admin_url()),
312
  'network_admin_url' => trailingslashit(network_admin_url()),
 
313
  ));
314
 
315
  if ('base64_with_count' == $format) {
@@ -934,7 +944,7 @@ class UpdraftPlus_Remote_Communications {
934
  }
935
 
936
  // Do this after the extra replay protection, as that checks hashes within the maximum time window - so don't check the maximum time window until afterwards, to avoid a tiny window (race) in between.
937
- $time_difference = absint(($udrpc_message['time'] - time()));
938
  if ($time_difference > $this->maximum_replay_time_difference) {
939
  $this->log("Time in incoming message is outside of allowed window ($time_difference > ".$this->maximum_replay_time_difference.')', 'error');
940
  die;
@@ -1007,7 +1017,7 @@ class UpdraftPlus_Remote_Communications {
1007
  $data = empty($udrpc_message['data']) ? null : $udrpc_message['data'];
1008
 
1009
  // @codingStandardsIgnoreLine
1010
- if ($http_origin && !empty($udrpc_message['cors_headers_wanted']) && !@constant('UDRPC_DO_NOT_SEND_CORS_HEADERS')) {
1011
  header("Access-Control-Allow-Origin: $http_origin");
1012
  header('Access-Control-Allow-Credentials: true');
1013
  }
@@ -1015,7 +1025,7 @@ class UpdraftPlus_Remote_Communications {
1015
  $this->log('Command received: '.$command, 'info');
1016
 
1017
  if ('ping' == $command) {
1018
- echo json_encode($this->create_message('pong', null, true));
1019
  } else {
1020
  if (has_filter('udrpc_command_'.$command)) {
1021
  $command_action_hooked = true;
@@ -1023,19 +1033,18 @@ class UpdraftPlus_Remote_Communications {
1023
  } else {
1024
  $response = array('response' => 'rpcerror', 'data' => array('code' => 'unknown_rpc_command', 'data' => $command));
1025
  }
 
1026
 
1027
- $response = apply_filters('udrpc_action', $response, $command, $data, $this->key_name_indicator, $this);
1028
-
1029
- if (is_array($response)) {
1030
 
1031
- if ($this->debug) {
1032
- $this->log('UDRPC response (pre-encoding/encryption): '.serialize($response));
1033
- }
1034
 
1035
- $data = isset($response['data']) ? $response['data'] : null;
1036
- echo json_encode($this->create_message($response['response'], $data, true));
1037
  }
1038
 
 
 
1039
  }
1040
 
1041
  die;
59
  class UpdraftPlus_Remote_Communications {
60
 
61
  // Version numbers relate to versions of this PHP library only (i.e. it's not a protocol support number, and version numbers of other compatible libraries (e.g. JavaScript) are not comparable)
62
+ public $version = '1.4.18';
63
 
64
  private $key_name_indicator;
65
 
220
  /**
221
  * Method to get the remote key
222
  *
223
+ * @return string
224
  */
225
  public function get_key_remote() {
226
  if (empty($this->key_remote) && $this->can_generate) {
248
  $this->format = $format;
249
  }
250
 
251
+ /**
252
+ * Used for sending - when receiving, the format is part of the message
253
+ *
254
+ * @return integer
255
+ */
256
+ public function get_message_format() {
257
+ return $this->format;
258
+ }
259
+
260
  /**
261
  * Method to get the local key
262
  *
263
+ * @return string
264
  */
265
  public function get_key_local() {
266
  if (empty($this->key_local)) {
319
  'url' => trailingslashit(network_site_url()),
320
  'admin_url' => trailingslashit(admin_url()),
321
  'network_admin_url' => trailingslashit(network_admin_url()),
322
+ 'format_support' => 2,
323
  ));
324
 
325
  if ('base64_with_count' == $format) {
944
  }
945
 
946
  // Do this after the extra replay protection, as that checks hashes within the maximum time window - so don't check the maximum time window until afterwards, to avoid a tiny window (race) in between.
947
+ $time_difference = absint($udrpc_message['time'] - time());
948
  if ($time_difference > $this->maximum_replay_time_difference) {
949
  $this->log("Time in incoming message is outside of allowed window ($time_difference > ".$this->maximum_replay_time_difference.')', 'error');
950
  die;
1017
  $data = empty($udrpc_message['data']) ? null : $udrpc_message['data'];
1018
 
1019
  // @codingStandardsIgnoreLine
1020
+ if ($http_origin && !empty($udrpc_message['cors_headers_wanted']) && (!defined('UDRPC_DO_NOT_SEND_CORS_HEADERS') || !UDRPC_DO_NOT_SEND_CORS_HEADERS)) {
1021
  header("Access-Control-Allow-Origin: $http_origin");
1022
  header('Access-Control-Allow-Credentials: true');
1023
  }
1025
  $this->log('Command received: '.$command, 'info');
1026
 
1027
  if ('ping' == $command) {
1028
+ $response = array('response' => 'pong', 'data' => null);
1029
  } else {
1030
  if (has_filter('udrpc_command_'.$command)) {
1031
  $command_action_hooked = true;
1033
  } else {
1034
  $response = array('response' => 'rpcerror', 'data' => array('code' => 'unknown_rpc_command', 'data' => $command));
1035
  }
1036
+ }
1037
 
1038
+ $response = apply_filters('udrpc_action', $response, $command, $data, $this->key_name_indicator, $this);
 
 
1039
 
1040
+ if (is_array($response)) {
 
 
1041
 
1042
+ if ($this->debug) {
1043
+ $this->log('UDRPC response (pre-encoding/encryption): '.serialize($response));
1044
  }
1045
 
1046
+ $data = isset($response['data']) ? $response['data'] : null;
1047
+ echo json_encode($this->create_message($response['response'], $data, true));
1048
  }
1049
 
1050
  die;
includes/class-wpadmin-commands.php CHANGED
@@ -276,20 +276,55 @@ class UpdraftPlus_WPAdmin_Commands extends UpdraftPlus_Commands {
276
  return 'pong';
277
  }
278
 
 
 
 
 
 
279
  public function dismissautobackup() {
280
  UpdraftPlus_Options::update_updraft_option('updraftplus_dismissedautobackup', time() + 84*86400);
281
  return array();
282
  }
283
-
 
 
 
 
 
284
  public function dismiss_notice() {
285
  UpdraftPlus_Options::update_updraft_option('dismissed_general_notices_until', time() + 84*86400);
286
  return array();
287
  }
288
-
 
 
 
 
 
289
  public function dismiss_season() {
290
  UpdraftPlus_Options::update_updraft_option('dismissed_season_notices_until', time() + 366*86400);
291
  return array();
292
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293
 
294
  public function set_autobackup_default($params) {
295
  $default = empty($params['default']) ? 0 : 1;
276
  return 'pong';
277
  }
278
 
279
+ /**
280
+ * This function is called via ajax and will update the autobackup notice dismiss time
281
+ *
282
+ * @return array - an empty array
283
+ */
284
  public function dismissautobackup() {
285
  UpdraftPlus_Options::update_updraft_option('updraftplus_dismissedautobackup', time() + 84*86400);
286
  return array();
287
  }
288
+
289
+ /**
290
+ * This function is called via ajax and will update the general notice dismiss time
291
+ *
292
+ * @return array - an empty array
293
+ */
294
  public function dismiss_notice() {
295
  UpdraftPlus_Options::update_updraft_option('dismissed_general_notices_until', time() + 84*86400);
296
  return array();
297
  }
298
+
299
+ /**
300
+ * This function is called via ajax and will update the season notice dismiss time
301
+ *
302
+ * @return array - an empty array
303
+ */
304
  public function dismiss_season() {
305
  UpdraftPlus_Options::update_updraft_option('dismissed_season_notices_until', time() + 366*86400);
306
  return array();
307
  }
308
+
309
+ /**
310
+ * This function is called via ajax and will update the clone php notice dismiss time
311
+ *
312
+ * @return array - an empty array
313
+ */
314
+ public function dismiss_clone_php_notice() {
315
+ UpdraftPlus_Options::update_updraft_option('dismissed_clone_php_notices_until', time() + 180 * 86400);
316
+ return array();
317
+ }
318
+
319
+ /**
320
+ * This function is called via ajax and will update the WooCommerce clone notice dismiss time
321
+ *
322
+ * @return array - an empty array
323
+ */
324
+ public function dismiss_clone_wc_notice() {
325
+ UpdraftPlus_Options::update_updraft_option('dismissed_clone_wc_notices_until', time() + 90 * 86400);
326
+ return array();
327
+ }
328
 
329
  public function set_autobackup_default($params) {
330
  $default = empty($params['default']) ? 0 : 1;
includes/jstree/jstree.js CHANGED
@@ -13,7 +13,7 @@
13
  }(function ($, undefined) {
14
  "use strict";
15
  /*!
16
- * jsTree 3.3.7
17
  * http://jstree.com/
18
  *
19
  * Copyright (c) 2014 Ivan Bozhanov (http://vakata.com)
@@ -54,7 +54,7 @@
54
  * specifies the jstree version in use
55
  * @name $.jstree.version
56
  */
57
- version : '3.3.7',
58
  /**
59
  * holds all the default options used when creating new instances
60
  * @name $.jstree.defaults
@@ -654,7 +654,7 @@
654
  },
655
  _kbevent_to_func : function (e) {
656
  var keys = {
657
- 8: "Backspace", 9: "Tab", 13: "Return", 19: "Pause", 27: "Esc",
658
  32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", 36: "Home",
659
  37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "Print", 45: "Insert",
660
  46: "Delete", 96: "Numpad0", 97: "Numpad1", 98: "Numpad2", 99 : "Numpad3",
@@ -889,7 +889,7 @@
889
  }, this))
890
  .on('blur.jstree', '.jstree-anchor', $.proxy(function (e) {
891
  this._data.core.focused = null;
892
- $(e.currentTarget).filter('.jstree-hovered').mouseleave();
893
  this.element.attr('tabindex', '0');
894
  }, this))
895
  .on('focus.jstree', '.jstree-anchor', $.proxy(function (e) {
@@ -897,8 +897,8 @@
897
  if(tmp && tmp.id) {
898
  this._data.core.focused = tmp.id;
899
  }
900
- this.element.find('.jstree-hovered').not(e.currentTarget).mouseleave();
901
- $(e.currentTarget).mouseenter();
902
  this.element.attr('tabindex', '-1');
903
  }, this))
904
  .on('focus.jstree', $.proxy(function () {
@@ -1023,7 +1023,7 @@
1023
  if(obj && obj.id) {
1024
  obj = obj.id;
1025
  }
1026
- if (obj instanceof jQuery && obj.length && obj[0].id) {
1027
  obj = obj[0].id;
1028
  }
1029
  var dom;
@@ -1605,6 +1605,7 @@
1605
  't_cnt' : this._cnt,
1606
  'sel' : this._data.core.selected
1607
  },
 
1608
  func = function (data, undefined) {
1609
  if(data.data) { data = data.data; }
1610
  var dat = data.dat,
@@ -1823,8 +1824,10 @@
1823
  // 2) populate children (foreach)
1824
  for(i = 0, j = dat.length; i < j; i++) {
1825
  if (!m[dat[i].parent.toString()]) {
1826
- this._data.core.last_error = { 'error' : 'parse', 'plugin' : 'core', 'id' : 'core_07', 'reason' : 'Node with invalid parent', 'data' : JSON.stringify({ 'id' : dat[i].id.toString(), 'parent' : dat[i].parent.toString() }) };
1827
- this.settings.core.error.call(this, this._data.core.last_error);
 
 
1828
  continue;
1829
  }
1830
 
@@ -2291,7 +2294,7 @@
2291
  tmp.children_d = tmp.children_d.concat(e.children_d);
2292
  }
2293
  }
2294
- tmp.children_d = tmp.children_d.concat(tmp.children);
2295
  }
2296
  if(d && d.children && d.children === true) {
2297
  tmp.state.loaded = false;
@@ -4022,6 +4025,10 @@
4022
  var tmp = chk.match(/^move_node|copy_node|create_node$/i) ? par : obj,
4023
  chc = this.settings.core.check_callback;
4024
  if(chk === "move_node" || chk === "copy_node") {
 
 
 
 
4025
  if((!more || !more.is_multi) && (obj.id === par.id || (chk === "move_node" && $.inArray(obj.id, par.children) === pos) || $.inArray(par.id, obj.children_d) !== -1)) {
4026
  this._data.core.last_error = { 'error' : 'check', 'plugin' : 'core', 'id' : 'core_01', 'reason' : 'Moving parent inside child', 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) };
4027
  return false;
@@ -5234,7 +5241,7 @@
5234
  if(s.indexOf('down') !== -1) {
5235
  var selectedIds = this._cascade_new_checked_state(obj.id, false);
5236
 
5237
- cur = cur.filter(function(id) {
5238
  return allIds.indexOf(id) === -1 || selectedIds.indexOf(id) > -1;
5239
  });
5240
  }
@@ -5254,7 +5261,7 @@
5254
  }
5255
  }
5256
 
5257
- cur = cur.filter(function(id) {
5258
  return obj.parents.indexOf(id) === -1;
5259
  });
5260
  }
@@ -5540,7 +5547,7 @@
5540
  };
5541
  /**
5542
  * enable a node's checkbox
5543
- * @name disable_checkbox(obj)
5544
  * @param {mixed} obj an array can be used too
5545
  * @trigger enable_checkbox.jstree
5546
  * @plugin checkbox
@@ -5680,7 +5687,7 @@
5680
  var t = self.settings.checkbox.tie_selection;
5681
  var node = self._model.data[id];
5682
 
5683
- return node.children_d.filter(function(_id) {
5684
  return self._model.data[_id].state[ t ? 'selected' : 'checked' ];
5685
  });
5686
  };
@@ -5839,7 +5846,7 @@
5839
  */
5840
  this.get_checked = function (full) {
5841
  if(this.settings.checkbox.tie_selection) { return this.get_selected(full); }
5842
- return full ? $.map(this._data.checkbox.selected, $.proxy(function (i) { return this.get_node(i); }, this)) : this._data.checkbox.selected;
5843
  };
5844
  /**
5845
  * get an array of all top level checked nodes (ignoring children of checked nodes) (if tie_selection is on in the settings this function will return the same as get_top_selected)
13
  }(function ($, undefined) {
14
  "use strict";
15
  /*!
16
+ * jsTree 3.3.8
17
  * http://jstree.com/
18
  *
19
  * Copyright (c) 2014 Ivan Bozhanov (http://vakata.com)
54
  * specifies the jstree version in use
55
  * @name $.jstree.version
56
  */
57
+ version : '3.3.8',
58
  /**
59
  * holds all the default options used when creating new instances
60
  * @name $.jstree.defaults
654
  },
655
  _kbevent_to_func : function (e) {
656
  var keys = {
657
+ 8: "Backspace", 9: "Tab", 13: "Enter", 19: "Pause", 27: "Esc",
658
  32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", 36: "Home",
659
  37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "Print", 45: "Insert",
660
  46: "Delete", 96: "Numpad0", 97: "Numpad1", 98: "Numpad2", 99 : "Numpad3",
889
  }, this))
890
  .on('blur.jstree', '.jstree-anchor', $.proxy(function (e) {
891
  this._data.core.focused = null;
892
+ $(e.currentTarget).filter('.jstree-hovered').trigger('mouseleave');
893
  this.element.attr('tabindex', '0');
894
  }, this))
895
  .on('focus.jstree', '.jstree-anchor', $.proxy(function (e) {
897
  if(tmp && tmp.id) {
898
  this._data.core.focused = tmp.id;
899
  }
900
+ this.element.find('.jstree-hovered').not(e.currentTarget).trigger('mouseleave');
901
+ $(e.currentTarget).trigger('mouseenter');
902
  this.element.attr('tabindex', '-1');
903
  }, this))
904
  .on('focus.jstree', $.proxy(function () {
1023
  if(obj && obj.id) {
1024
  obj = obj.id;
1025
  }
1026
+ if (obj instanceof $ && obj.length && obj[0].id) {
1027
  obj = obj[0].id;
1028
  }
1029
  var dom;
1605
  't_cnt' : this._cnt,
1606
  'sel' : this._data.core.selected
1607
  },
1608
+ inst = this,
1609
  func = function (data, undefined) {
1610
  if(data.data) { data = data.data; }
1611
  var dat = data.dat,
1824
  // 2) populate children (foreach)
1825
  for(i = 0, j = dat.length; i < j; i++) {
1826
  if (!m[dat[i].parent.toString()]) {
1827
+ if (typeof inst !== "undefined") {
1828
+ inst._data.core.last_error = { 'error' : 'parse', 'plugin' : 'core', 'id' : 'core_07', 'reason' : 'Node with invalid parent', 'data' : JSON.stringify({ 'id' : dat[i].id.toString(), 'parent' : dat[i].parent.toString() }) };
1829
+ inst.settings.core.error.call(inst, inst._data.core.last_error);
1830
+ }
1831
  continue;
1832
  }
1833
 
2294
  tmp.children_d = tmp.children_d.concat(e.children_d);
2295
  }
2296
  }
2297
+ tmp.children_d = tmp.children.concat(tmp.children_d);
2298
  }
2299
  if(d && d.children && d.children === true) {
2300
  tmp.state.loaded = false;
4025
  var tmp = chk.match(/^move_node|copy_node|create_node$/i) ? par : obj,
4026
  chc = this.settings.core.check_callback;
4027
  if(chk === "move_node" || chk === "copy_node") {
4028
+ if((!more || !more.is_multi) && (chk === "move_node" && $.inArray(obj.id, par.children) === pos)) {
4029
+ this._data.core.last_error = { 'error' : 'check', 'plugin' : 'core', 'id' : 'core_08', 'reason' : 'Moving node to its current position', 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) };
4030
+ return false;
4031
+ }
4032
  if((!more || !more.is_multi) && (obj.id === par.id || (chk === "move_node" && $.inArray(obj.id, par.children) === pos) || $.inArray(par.id, obj.children_d) !== -1)) {
4033
  this._data.core.last_error = { 'error' : 'check', 'plugin' : 'core', 'id' : 'core_01', 'reason' : 'Moving parent inside child', 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) };
4034
  return false;
5241
  if(s.indexOf('down') !== -1) {
5242
  var selectedIds = this._cascade_new_checked_state(obj.id, false);
5243
 
5244
+ cur = $.vakata.array_filter(cur, function(id) {
5245
  return allIds.indexOf(id) === -1 || selectedIds.indexOf(id) > -1;
5246
  });
5247
  }
5261
  }
5262
  }
5263
 
5264
+ cur = $.vakata.array_filter(cur, function(id) {
5265
  return obj.parents.indexOf(id) === -1;
5266
  });
5267
  }
5547
  };
5548
  /**
5549
  * enable a node's checkbox
5550
+ * @name enable_checkbox(obj)
5551
  * @param {mixed} obj an array can be used too
5552
  * @trigger enable_checkbox.jstree
5553
  * @plugin checkbox
5687
  var t = self.settings.checkbox.tie_selection;
5688
  var node = self._model.data[id];
5689
 
5690
+ return $.vakata.array_filter(node.children_d, function(_id) {
5691
  return self._model.data[_id].state[ t ? 'selected' : 'checked' ];
5692
  });
5693
  };
5846
  */
5847
  this.get_checked = function (full) {
5848
  if(this.settings.checkbox.tie_selection) { return this.get_selected(full); }
5849
+ return full ? $.map(this._data.checkbox.selected, $.proxy(function (i) { return this.get_node(i); }, this)) : this._data.checkbox.selected.slice();
5850
  };
5851
  /**
5852
  * get an array of all top level checked nodes (ignoring children of checked nodes) (if tie_selection is on in the settings this function will return the same as get_top_selected)
includes/jstree/jstree.min.js CHANGED
@@ -1,6 +1,6 @@
1
- /*! jsTree - v3.3.7 - 2018-11-06 - (MIT) */
2
- !function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"undefined"!=typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a,b){"use strict";if(!a.jstree){var c=0,d=!1,e=!1,f=!1,g=[],h=a("script:last").attr("src"),i=window.document;a.jstree={version:"3.3.7",defaults:{plugins:[]},plugins:{},path:h&&-1!==h.indexOf("/")?h.replace(/\/[^\/]+$/,""):"",idregex:/[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g,root:"#"},a.jstree.create=function(b,d){var e=new a.jstree.core(++c),f=d;return d=a.extend(!0,{},a.jstree.defaults,d),f&&f.plugins&&(d.plugins=f.plugins),a.each(d.plugins,function(a,b){"core"!==a&&(e=e.plugin(b,d[b]))}),a(b).data("jstree",e),e.init(b,d),e},a.jstree.destroy=function(){a(".jstree:jstree").jstree("destroy"),a(i).off(".jstree")},a.jstree.core=function(a){this._id=a,this._cnt=0,this._wrk=null,this._data={core:{themes:{name:!1,dots:!1,icons:!1,ellipsis:!1},selected:[],last_error:{},working:!1,worker_queue:[],focused:null}}},a.jstree.reference=function(b){var c=null,d=null;if(!b||!b.id||b.tagName&&b.nodeType||(b=b.id),!d||!d.length)try{d=a(b)}catch(e){}if(!d||!d.length)try{d=a("#"+b.replace(a.jstree.idregex,"\\$&"))}catch(e){}return d&&d.length&&(d=d.closest(".jstree")).length&&(d=d.data("jstree"))?c=d:a(".jstree").each(function(){var d=a(this).data("jstree");return d&&d._model.data[b]?(c=d,!1):void 0}),c},a.fn.jstree=function(c){var d="string"==typeof c,e=Array.prototype.slice.call(arguments,1),f=null;return c!==!0||this.length?(this.each(function(){var g=a.jstree.reference(this),h=d&&g?g[c]:null;return f=d&&h?h.apply(g,e):null,g||d||c!==b&&!a.isPlainObject(c)||a.jstree.create(this,c),(g&&!d||c===!0)&&(f=g||!1),null!==f&&f!==b?!1:void 0}),null!==f&&f!==b?f:this):!1},a.expr.pseudos.jstree=a.expr.createPseudo(function(c){return function(c){return a(c).hasClass("jstree")&&a(c).data("jstree")!==b}}),a.jstree.defaults.core={data:!1,strings:!1,check_callback:!1,error:a.noop,animation:200,multiple:!0,themes:{name:!1,url:!1,dir:!1,dots:!0,icons:!0,ellipsis:!1,stripes:!1,variant:!1,responsive:!1},expand_selected_onload:!0,worker:!0,force_text:!1,dblclick_toggle:!0,loaded_state:!1,restore_focus:!0,keyboard:{"ctrl-space":function(b){b.type="click",a(b.currentTarget).trigger(b)},enter:function(b){b.type="click",a(b.currentTarget).trigger(b)},left:function(b){if(b.preventDefault(),this.is_open(b.currentTarget))this.close_node(b.currentTarget);else{var c=this.get_parent(b.currentTarget);c&&c.id!==a.jstree.root&&this.get_node(c,!0).children(".jstree-anchor").focus()}},up:function(a){a.preventDefault();var b=this.get_prev_dom(a.currentTarget);b&&b.length&&b.children(".jstree-anchor").focus()},right:function(b){if(b.preventDefault(),this.is_closed(b.currentTarget))this.open_node(b.currentTarget,function(a){this.get_node(a,!0).children(".jstree-anchor").focus()});else if(this.is_open(b.currentTarget)){var c=this.get_node(b.currentTarget,!0).children(".jstree-children")[0];c&&a(this._firstChild(c)).children(".jstree-anchor").focus()}},down:function(a){a.preventDefault();var b=this.get_next_dom(a.currentTarget);b&&b.length&&b.children(".jstree-anchor").focus()},"*":function(a){this.open_all()},home:function(b){b.preventDefault();var c=this._firstChild(this.get_container_ul()[0]);c&&a(c).children(".jstree-anchor").filter(":visible").focus()},end:function(a){a.preventDefault(),this.element.find(".jstree-anchor").filter(":visible").last().focus()},f2:function(a){a.preventDefault(),this.edit(a.currentTarget)}}},a.jstree.core.prototype={plugin:function(b,c){var d=a.jstree.plugins[b];return d?(this._data[b]={},d.prototype=this,new d(c,this)):this},init:function(b,c){this._model={data:{},changed:[],force_full_redraw:!1,redraw_timeout:!1,default_state:{loaded:!0,opened:!1,selected:!1,disabled:!1}},this._model.data[a.jstree.root]={id:a.jstree.root,parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}},this.element=a(b).addClass("jstree jstree-"+this._id),this.settings=c,this._data.core.ready=!1,this._data.core.loaded=!1,this._data.core.rtl="rtl"===this.element.css("direction"),this.element[this._data.core.rtl?"addClass":"removeClass"]("jstree-rtl"),this.element.attr("role","tree"),this.settings.core.multiple&&this.element.attr("aria-multiselectable",!0),this.element.attr("tabindex")||this.element.attr("tabindex","0"),this.bind(),this.trigger("init"),this._data.core.original_container_html=this.element.find(" > ul > li").clone(!0),this._data.core.original_container_html.find("li").addBack().contents().filter(function(){return 3===this.nodeType&&(!this.nodeValue||/^\s+$/.test(this.nodeValue))}).remove(),this.element.html("<ul class='jstree-container-ul jstree-children' role='group'><li id='j"+this._id+"_loading' class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='tree-item'><i class='jstree-icon jstree-ocl'></i><a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'></i>"+this.get_string("Loading ...")+"</a></li></ul>"),this.element.attr("aria-activedescendant","j"+this._id+"_loading"),this._data.core.li_height=this.get_container_ul().children("li").first().outerHeight()||24,this._data.core.node=this._create_prototype_node(),this.trigger("loading"),this.load_node(a.jstree.root)},destroy:function(a){if(this.trigger("destroy"),this._wrk)try{window.URL.revokeObjectURL(this._wrk),this._wrk=null}catch(b){}a||this.element.empty(),this.teardown()},_create_prototype_node:function(){var a=i.createElement("LI"),b,c;return a.setAttribute("role","treeitem"),b=i.createElement("I"),b.className="jstree-icon jstree-ocl",b.setAttribute("role","presentation"),a.appendChild(b),b=i.createElement("A"),b.className="jstree-anchor",b.setAttribute("href","#"),b.setAttribute("tabindex","-1"),c=i.createElement("I"),c.className="jstree-icon jstree-themeicon",c.setAttribute("role","presentation"),b.appendChild(c),a.appendChild(b),b=c=null,a},_kbevent_to_func:function(a){var b={8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock",16:"Shift",17:"Ctrl",18:"Alt",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*",173:"-"},c=[];a.ctrlKey&&c.push("ctrl"),a.altKey&&c.push("alt"),a.shiftKey&&c.push("shift"),c.push(b[a.which]||a.which),c=c.sort().join("-").toLowerCase();var d=this.settings.core.keyboard,e,f;for(e in d)if(d.hasOwnProperty(e)&&(f=e,"-"!==f&&"+"!==f&&(f=f.replace("--","-MINUS").replace("+-","-MINUS").replace("++","-PLUS").replace("-+","-PLUS"),f=f.split(/-|\+/).sort().join("-").replace("MINUS","-").replace("PLUS","+").toLowerCase()),f===c))return d[e];return null},teardown:function(){this.unbind(),this.element.removeClass("jstree").removeData("jstree").find("[class^='jstree']").addBack().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/gi,"")}),this.element=null},bind:function(){var b="",c=null,d=0;this.element.on("dblclick.jstree",function(a){if(a.target.tagName&&"input"===a.target.tagName.toLowerCase())return!0;if(i.selection&&i.selection.empty)i.selection.empty();else if(window.getSelection){var b=window.getSelection();try{b.removeAllRanges(),b.collapse()}catch(c){}}}).on("mousedown.jstree",a.proxy(function(a){a.target===this.element[0]&&(a.preventDefault(),d=+new Date)},this)).on("mousedown.jstree",".jstree-ocl",function(a){a.preventDefault()}).on("click.jstree",".jstree-ocl",a.proxy(function(a){this.toggle_node(a.target)},this)).on("dblclick.jstree",".jstree-anchor",a.proxy(function(a){return a.target.tagName&&"input"===a.target.tagName.toLowerCase()?!0:void(this.settings.core.dblclick_toggle&&this.toggle_node(a.target))},this)).on("click.jstree",".jstree-anchor",a.proxy(function(b){b.preventDefault(),b.currentTarget!==i.activeElement&&a(b.currentTarget).focus(),this.activate_node(b.currentTarget,b)},this)).on("keydown.jstree",".jstree-anchor",a.proxy(function(a){if(a.target.tagName&&"input"===a.target.tagName.toLowerCase())return!0;this._data.core.rtl&&(37===a.which?a.which=39:39===a.which&&(a.which=37));var b=this._kbevent_to_func(a);if(b){var c=b.call(this,a);if(c===!1||c===!0)return c}},this)).on("load_node.jstree",a.proxy(function(b,c){c.status&&(c.node.id!==a.jstree.root||this._data.core.loaded||(this._data.core.loaded=!0,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.trigger("loaded")),this._data.core.ready||setTimeout(a.proxy(function(){if(this.element&&!this.get_container_ul().find(".jstree-loading").length){if(this._data.core.ready=!0,this._data.core.selected.length){if(this.settings.core.expand_selected_onload){var b=[],c,d;for(c=0,d=this._data.core.selected.length;d>c;c++)b=b.concat(this._model.data[this._data.core.selected[c]].parents);for(b=a.vakata.array_unique(b),c=0,d=b.length;d>c;c++)this.open_node(b[c],!1,0)}this.trigger("changed",{action:"ready",selected:this._data.core.selected})}this.trigger("ready")}},this),0))},this)).on("keypress.jstree",a.proxy(function(d){if(d.target.tagName&&"input"===d.target.tagName.toLowerCase())return!0;c&&clearTimeout(c),c=setTimeout(function(){b=""},500);var e=String.fromCharCode(d.which).toLowerCase(),f=this.element.find(".jstree-anchor").filter(":visible"),g=f.index(i.activeElement)||0,h=!1;if(b+=e,b.length>1){if(f.slice(g).each(a.proxy(function(c,d){return 0===a(d).text().toLowerCase().indexOf(b)?(a(d).focus(),h=!0,!1):void 0},this)),h)return;if(f.slice(0,g).each(a.proxy(function(c,d){return 0===a(d).text().toLowerCase().indexOf(b)?(a(d).focus(),h=!0,!1):void 0},this)),h)return}if(new RegExp("^"+e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+"+$").test(b)){if(f.slice(g+1).each(a.proxy(function(b,c){return a(c).text().toLowerCase().charAt(0)===e?(a(c).focus(),h=!0,!1):void 0},this)),h)return;if(f.slice(0,g+1).each(a.proxy(function(b,c){return a(c).text().toLowerCase().charAt(0)===e?(a(c).focus(),h=!0,!1):void 0},this)),h)return}},this)).on("init.jstree",a.proxy(function(){var a=this.settings.core.themes;this._data.core.themes.dots=a.dots,this._data.core.themes.stripes=a.stripes,this._data.core.themes.icons=a.icons,this._data.core.themes.ellipsis=a.ellipsis,this.set_theme(a.name||"default",a.url),this.set_theme_variant(a.variant)},this)).on("loading.jstree",a.proxy(function(){this[this._data.core.themes.dots?"show_dots":"hide_dots"](),this[this._data.core.themes.icons?"show_icons":"hide_icons"](),this[this._data.core.themes.stripes?"show_stripes":"hide_stripes"](),this[this._data.core.themes.ellipsis?"show_ellipsis":"hide_ellipsis"]()},this)).on("blur.jstree",".jstree-anchor",a.proxy(function(b){this._data.core.focused=null,a(b.currentTarget).filter(".jstree-hovered").mouseleave(),this.element.attr("tabindex","0")},this)).on("focus.jstree",".jstree-anchor",a.proxy(function(b){var c=this.get_node(b.currentTarget);c&&c.id&&(this._data.core.focused=c.id),this.element.find(".jstree-hovered").not(b.currentTarget).mouseleave(),a(b.currentTarget).mouseenter(),this.element.attr("tabindex","-1")},this)).on("focus.jstree",a.proxy(function(){if(+new Date-d>500&&!this._data.core.focused&&this.settings.core.restore_focus){d=0;var a=this.get_node(this.element.attr("aria-activedescendant"),!0);a&&a.find("> .jstree-anchor").focus()}},this)).on("mouseenter.jstree",".jstree-anchor",a.proxy(function(a){this.hover_node(a.currentTarget)},this)).on("mouseleave.jstree",".jstree-anchor",a.proxy(function(a){this.dehover_node(a.currentTarget)},this))},unbind:function(){this.element.off(".jstree"),a(i).off(".jstree-"+this._id)},trigger:function(a,b){b||(b={}),b.instance=this,this.element.triggerHandler(a.replace(".jstree","")+".jstree",b)},get_container:function(){return this.element},get_container_ul:function(){return this.element.children(".jstree-children").first()},get_string:function(b){var c=this.settings.core.strings;return a.isFunction(c)?c.call(this,b):c&&c[b]?c[b]:b},_firstChild:function(a){a=a?a.firstChild:null;while(null!==a&&1!==a.nodeType)a=a.nextSibling;return a},_nextSibling:function(a){a=a?a.nextSibling:null;while(null!==a&&1!==a.nodeType)a=a.nextSibling;return a},_previousSibling:function(a){a=a?a.previousSibling:null;while(null!==a&&1!==a.nodeType)a=a.previousSibling;return a},get_node:function(b,c){b&&b.id&&(b=b.id),b instanceof jQuery&&b.length&&b[0].id&&(b=b[0].id);var d;try{if(this._model.data[b])b=this._model.data[b];else if("string"==typeof b&&this._model.data[b.replace(/^#/,"")])b=this._model.data[b.replace(/^#/,"")];else if("string"==typeof b&&(d=a("#"+b.replace(a.jstree.idregex,"\\$&"),this.element)).length&&this._model.data[d.closest(".jstree-node").attr("id")])b=this._model.data[d.closest(".jstree-node").attr("id")];else if((d=this.element.find(b)).length&&this._model.data[d.closest(".jstree-node").attr("id")])b=this._model.data[d.closest(".jstree-node").attr("id")];else{if(!(d=this.element.find(b)).length||!d.hasClass("jstree"))return!1;b=this._model.data[a.jstree.root]}return c&&(b=b.id===a.jstree.root?this.element:a("#"+b.id.replace(a.jstree.idregex,"\\$&"),this.element)),b}catch(e){return!1}},get_path:function(b,c,d){if(b=b.parents?b:this.get_node(b),!b||b.id===a.jstree.root||!b.parents)return!1;var e,f,g=[];for(g.push(d?b.id:b.text),e=0,f=b.parents.length;f>e;e++)g.push(d?b.parents[e]:this.get_text(b.parents[e]));return g=g.reverse().slice(1),c?g.join(c):g},get_next_dom:function(b,c){var d;if(b=this.get_node(b,!0),b[0]===this.element[0]){d=this._firstChild(this.get_container_ul()[0]);while(d&&0===d.offsetHeight)d=this._nextSibling(d);return d?a(d):!1}if(!b||!b.length)return!1;if(c){d=b[0];do d=this._nextSibling(d);while(d&&0===d.offsetHeight);return d?a(d):!1}if(b.hasClass("jstree-open")){d=this._firstChild(b.children(".jstree-children")[0]);while(d&&0===d.offsetHeight)d=this._nextSibling(d);if(null!==d)return a(d)}d=b[0];do d=this._nextSibling(d);while(d&&0===d.offsetHeight);return null!==d?a(d):b.parentsUntil(".jstree",".jstree-node").nextAll(".jstree-node:visible").first()},get_prev_dom:function(b,c){var d;if(b=this.get_node(b,!0),b[0]===this.element[0]){d=this.get_container_ul()[0].lastChild;while(d&&0===d.offsetHeight)d=this._previousSibling(d);return d?a(d):!1}if(!b||!b.length)return!1;if(c){d=b[0];do d=this._previousSibling(d);while(d&&0===d.offsetHeight);return d?a(d):!1}d=b[0];do d=this._previousSibling(d);while(d&&0===d.offsetHeight);if(null!==d){b=a(d);while(b.hasClass("jstree-open"))b=b.children(".jstree-children").first().children(".jstree-node:visible:last");return b}return d=b[0].parentNode.parentNode,d&&d.className&&-1!==d.className.indexOf("jstree-node")?a(d):!1},get_parent:function(b){return b=this.get_node(b),b&&b.id!==a.jstree.root?b.parent:!1},get_children_dom:function(a){return a=this.get_node(a,!0),a[0]===this.element[0]?this.get_container_ul().children(".jstree-node"):a&&a.length?a.children(".jstree-children").children(".jstree-node"):!1},is_parent:function(a){return a=this.get_node(a),a&&(a.state.loaded===!1||a.children.length>0)},is_loaded:function(a){return a=this.get_node(a),a&&a.state.loaded},is_loading:function(a){return a=this.get_node(a),a&&a.state&&a.state.loading},is_open:function(a){return a=this.get_node(a),a&&a.state.opened},is_closed:function(a){return a=this.get_node(a),a&&this.is_parent(a)&&!a.state.opened},is_leaf:function(a){return!this.is_parent(a)},load_node:function(b,c){var d,e,f,g,h;if(a.isArray(b))return this._load_nodes(b.slice(),c),!0;if(b=this.get_node(b),!b)return c&&c.call(this,b,!1),!1;if(b.state.loaded){for(b.state.loaded=!1,f=0,g=b.parents.length;g>f;f++)this._model.data[b.parents[f]].children_d=a.vakata.array_filter(this._model.data[b.parents[f]].children_d,function(c){return-1===a.inArray(c,b.children_d)});for(d=0,e=b.children_d.length;e>d;d++)this._model.data[b.children_d[d]].state.selected&&(h=!0),delete this._model.data[b.children_d[d]];h&&(this._data.core.selected=a.vakata.array_filter(this._data.core.selected,function(c){return-1===a.inArray(c,b.children_d)})),b.children=[],b.children_d=[],h&&this.trigger("changed",{action:"load_node",node:b,selected:this._data.core.selected})}return b.state.failed=!1,b.state.loading=!0,this.get_node(b,!0).addClass("jstree-loading").attr("aria-busy",!0),this._load_node(b,a.proxy(function(a){b=this._model.data[b.id],b.state.loading=!1,b.state.loaded=a,b.state.failed=!b.state.loaded;var d=this.get_node(b,!0),e=0,f=0,g=this._model.data,h=!1;for(e=0,f=b.children.length;f>e;e++)if(g[b.children[e]]&&!g[b.children[e]].state.hidden){h=!0;break}b.state.loaded&&d&&d.length&&(d.removeClass("jstree-closed jstree-open jstree-leaf"),h?"#"!==b.id&&d.addClass(b.state.opened?"jstree-open":"jstree-closed"):d.addClass("jstree-leaf")),d.removeClass("jstree-loading").attr("aria-busy",!1),this.trigger("load_node",{node:b,status:a}),c&&c.call(this,b,a)},this)),!0},_load_nodes:function(a,b,c,d){var e=!0,f=function(){this._load_nodes(a,b,!0)},g=this._model.data,h,i,j=[];for(h=0,i=a.length;i>h;h++)g[a[h]]&&(!g[a[h]].state.loaded&&!g[a[h]].state.failed||!c&&d)&&(this.is_loading(a[h])||this.load_node(a[h],f),e=!1);if(e){for(h=0,i=a.length;i>h;h++)g[a[h]]&&g[a[h]].state.loaded&&j.push(a[h]);b&&!b.done&&(b.call(this,j),b.done=!0)}},load_all:function(b,c){if(b||(b=a.jstree.root),b=this.get_node(b),!b)return!1;var d=[],e=this._model.data,f=e[b.id].children_d,g,h;for(b.state&&!b.state.loaded&&d.push(b.id),g=0,h=f.length;h>g;g++)e[f[g]]&&e[f[g]].state&&!e[f[g]].state.loaded&&d.push(f[g]);d.length?this._load_nodes(d,function(){this.load_all(b,c)}):(c&&c.call(this,b),this.trigger("load_all",{node:b}))},_load_node:function(b,c){var d=this.settings.core.data,e,f=function g(){return 3!==this.nodeType&&8!==this.nodeType};return d?a.isFunction(d)?d.call(this,b,a.proxy(function(d){d===!1?c.call(this,!1):this["string"==typeof d?"_append_html_data":"_append_json_data"](b,"string"==typeof d?a(a.parseHTML(d)).filter(f):d,function(a){c.call(this,a)})},this)):"object"==typeof d?d.url?(d=a.extend(!0,{},d),a.isFunction(d.url)&&(d.url=d.url.call(this,b)),a.isFunction(d.data)&&(d.data=d.data.call(this,b)),a.ajax(d).done(a.proxy(function(d,e,g){var h=g.getResponseHeader("Content-Type");return h&&-1!==h.indexOf("json")||"object"==typeof d?this._append_json_data(b,d,function(a){c.call(this,a)}):h&&-1!==h.indexOf("html")||"string"==typeof d?this._append_html_data(b,a(a.parseHTML(d)).filter(f),function(a){c.call(this,a)}):(this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:b.id,xhr:g})},this.settings.core.error.call(this,this._data.core.last_error),c.call(this,!1))},this)).fail(a.proxy(function(a){this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:b.id,xhr:a})},c.call(this,!1),this.settings.core.error.call(this,this._data.core.last_error)},this))):(e=a.isArray(d)?a.extend(!0,[],d):a.isPlainObject(d)?a.extend(!0,{},d):d,b.id===a.jstree.root?this._append_json_data(b,e,function(a){c.call(this,a)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_05",reason:"Could not load node",data:JSON.stringify({id:b.id})},this.settings.core.error.call(this,this._data.core.last_error),c.call(this,!1))):"string"==typeof d?b.id===a.jstree.root?this._append_html_data(b,a(a.parseHTML(d)).filter(f),function(a){c.call(this,a)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_06",reason:"Could not load node",data:JSON.stringify({id:b.id})},this.settings.core.error.call(this,this._data.core.last_error),c.call(this,!1)):c.call(this,!1):b.id===a.jstree.root?this._append_html_data(b,this._data.core.original_container_html.clone(!0),function(a){c.call(this,a)}):c.call(this,!1)},_node_changed:function(b){b=this.get_node(b),b&&-1===a.inArray(b.id,this._model.changed)&&this._model.changed.push(b.id)},_append_html_data:function(b,c,d){b=this.get_node(b),b.children=[],b.children_d=[];var e=c.is("ul")?c.children():c,f=b.id,g=[],h=[],i=this._model.data,j=i[f],k=this._data.core.selected.length,l,m,n;for(e.each(a.proxy(function(b,c){l=this._parse_model_from_html(a(c),f,j.parents.concat()),l&&(g.push(l),h.push(l),i[l].children_d.length&&(h=h.concat(i[l].children_d)))},this)),j.children=g,j.children_d=h,m=0,n=j.parents.length;n>m;m++)i[j.parents[m]].children_d=i[j.parents[m]].children_d.concat(h);this.trigger("model",{nodes:h,parent:f}),f!==a.jstree.root?(this._node_changed(f),this.redraw()):(this.get_container_ul().children(".jstree-initial-node").remove(),this.redraw(!0)),this._data.core.selected.length!==k&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),d.call(this,!0)},_append_json_data:function(b,c,d,e){if(null!==this.element){b=this.get_node(b),b.children=[],b.children_d=[],c.d&&(c=c.d,"string"==typeof c&&(c=JSON.parse(c))),a.isArray(c)||(c=[c]);var f=null,g={df:this._model.default_state,dat:c,par:b.id,m:this._model.data,t_id:this._id,t_cnt:this._cnt,sel:this._data.core.selected},h=function(a,b){a.data&&(a=a.data);var c=a.dat,d=a.par,e=[],f=[],g=[],h=a.df,i=a.t_id,j=a.t_cnt,k=a.m,l=k[d],m=a.sel,n,o,p,q,r=function(a,c,d){d=d?d.concat():[],c&&d.unshift(c);var e=a.id.toString(),f,i,j,l,m={id:e,text:a.text||"",icon:a.icon!==b?a.icon:!0,parent:c,parents:d,children:a.children||[],children_d:a.children_d||[],data:a.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(f in h)h.hasOwnProperty(f)&&(m.state[f]=h[f]);if(a&&a.data&&a.data.jstree&&a.data.jstree.icon&&(m.icon=a.data.jstree.icon),(m.icon===b||null===m.icon||""===m.icon)&&(m.icon=!0),a&&a.data&&(m.data=a.data,a.data.jstree))for(f in a.data.jstree)a.data.jstree.hasOwnProperty(f)&&(m.state[f]=a.data.jstree[f]);if(a&&"object"==typeof a.state)for(f in a.state)a.state.hasOwnProperty(f)&&(m.state[f]=a.state[f]);if(a&&"object"==typeof a.li_attr)for(f in a.li_attr)a.li_attr.hasOwnProperty(f)&&(m.li_attr[f]=a.li_attr[f]);if(m.li_attr.id||(m.li_attr.id=e),a&&"object"==typeof a.a_attr)for(f in a.a_attr)a.a_attr.hasOwnProperty(f)&&(m.a_attr[f]=a.a_attr[f]);for(a&&a.children&&a.children===!0&&(m.state.loaded=!1,m.children=[],m.children_d=[]),k[m.id]=m,f=0,i=m.children.length;i>f;f++)j=r(k[m.children[f]],m.id,d),l=k[j],m.children_d.push(j),l.children_d.length&&(m.children_d=m.children_d.concat(l.children_d));return delete a.data,delete a.children,k[m.id].original=a,m.state.selected&&g.push(m.id),m.id},s=function(a,c,d){d=d?d.concat():[],c&&d.unshift(c);var e=!1,f,l,m,n,o;do e="j"+i+"_"+ ++j;while(k[e]);o={id:!1,text:"string"==typeof a?a:"",icon:"object"==typeof a&&a.icon!==b?a.icon:!0,parent:c,parents:d,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(f in h)h.hasOwnProperty(f)&&(o.state[f]=h[f]);if(a&&a.id&&(o.id=a.id.toString()),a&&a.text&&(o.text=a.text),a&&a.data&&a.data.jstree&&a.data.jstree.icon&&(o.icon=a.data.jstree.icon),(o.icon===b||null===o.icon||""===o.icon)&&(o.icon=!0),a&&a.data&&(o.data=a.data,a.data.jstree))for(f in a.data.jstree)a.data.jstree.hasOwnProperty(f)&&(o.state[f]=a.data.jstree[f]);if(a&&"object"==typeof a.state)for(f in a.state)a.state.hasOwnProperty(f)&&(o.state[f]=a.state[f]);if(a&&"object"==typeof a.li_attr)for(f in a.li_attr)a.li_attr.hasOwnProperty(f)&&(o.li_attr[f]=a.li_attr[f]);if(o.li_attr.id&&!o.id&&(o.id=o.li_attr.id.toString()),o.id||(o.id=e),o.li_attr.id||(o.li_attr.id=o.id),a&&"object"==typeof a.a_attr)for(f in a.a_attr)a.a_attr.hasOwnProperty(f)&&(o.a_attr[f]=a.a_attr[f]);if(a&&a.children&&a.children.length){for(f=0,l=a.children.length;l>f;f++)m=s(a.children[f],o.id,d),n=k[m],o.children.push(m),n.children_d.length&&(o.children_d=o.children_d.concat(n.children_d));o.children_d=o.children_d.concat(o.children)}return a&&a.children&&a.children===!0&&(o.state.loaded=!1,o.children=[],o.children_d=[]),delete a.data,delete a.children,o.original=a,k[o.id]=o,o.state.selected&&g.push(o.id),o.id};if(c.length&&c[0].id!==b&&c[0].parent!==b){for(o=0,p=c.length;p>o;o++)c[o].children||(c[o].children=[]),c[o].state||(c[o].state={}),k[c[o].id.toString()]=c[o];for(o=0,p=c.length;p>o;o++)k[c[o].parent.toString()]?(k[c[o].parent.toString()].children.push(c[o].id.toString()),l.children_d.push(c[o].id.toString())):(this._data.core.last_error={error:"parse",plugin:"core",id:"core_07",reason:"Node with invalid parent",data:JSON.stringify({id:c[o].id.toString(),parent:c[o].parent.toString()})},this.settings.core.error.call(this,this._data.core.last_error));for(o=0,p=l.children.length;p>o;o++)n=r(k[l.children[o]],d,l.parents.concat()),f.push(n),k[n].children_d.length&&(f=f.concat(k[n].children_d));for(o=0,p=l.parents.length;p>o;o++)k[l.parents[o]].children_d=k[l.parents[o]].children_d.concat(f);q={cnt:j,mod:k,sel:m,par:d,dpc:f,add:g}}else{for(o=0,p=c.length;p>o;o++)n=s(c[o],d,l.parents.concat()),n&&(e.push(n),f.push(n),k[n].children_d.length&&(f=f.concat(k[n].children_d)));for(l.children=e,l.children_d=f,o=0,p=l.parents.length;p>o;o++)k[l.parents[o]].children_d=k[l.parents[o]].children_d.concat(f);q={cnt:j,mod:k,sel:m,par:d,dpc:f,add:g}}return"undefined"!=typeof window&&"undefined"!=typeof window.document?q:void postMessage(q)},i=function(b,c){if(null!==this.element){this._cnt=b.cnt;var e,f=this._model.data;for(e in f)f.hasOwnProperty(e)&&f[e].state&&f[e].state.loading&&b.mod[e]&&(b.mod[e].state.loading=!0);if(this._model.data=b.mod,c){var g,h=b.add,i=b.sel,j=this._data.core.selected.slice();if(f=this._model.data,i.length!==j.length||a.vakata.array_unique(i.concat(j)).length!==i.length){for(e=0,g=i.length;g>e;e++)-1===a.inArray(i[e],h)&&-1===a.inArray(i[e],j)&&(f[i[e]].state.selected=!1);for(e=0,g=j.length;g>e;e++)-1===a.inArray(j[e],i)&&(f[j[e]].state.selected=!0)}}b.add.length&&(this._data.core.selected=this._data.core.selected.concat(b.add)),this.trigger("model",{nodes:b.dpc,parent:b.par}),b.par!==a.jstree.root?(this._node_changed(b.par),this.redraw()):this.redraw(!0),b.add.length&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),d.call(this,!0)}};if(this.settings.core.worker&&window.Blob&&window.URL&&window.Worker)try{null===this._wrk&&(this._wrk=window.URL.createObjectURL(new window.Blob(["self.onmessage = "+h.toString()],{type:"text/javascript"}))),!this._data.core.working||e?(this._data.core.working=!0,f=new window.Worker(this._wrk),f.onmessage=a.proxy(function(a){i.call(this,a.data,!0);try{f.terminate(),f=null}catch(b){}this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1},this),g.par?f.postMessage(g):this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1):this._data.core.worker_queue.push([b,c,d,!0])}catch(j){i.call(this,h(g),!1),this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1}else i.call(this,h(g),!1)}},_parse_model_from_html:function(c,d,e){e=e?[].concat(e):[],d&&e.unshift(d);var f,g,h=this._model.data,i={id:!1,text:!1,icon:!0,parent:d,parents:e,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1},j,k,l;for(j in this._model.default_state)this._model.default_state.hasOwnProperty(j)&&(i.state[j]=this._model.default_state[j]);if(k=a.vakata.attributes(c,!0),a.each(k,function(b,c){return c=a.trim(c),c.length?(i.li_attr[b]=c,void("id"===b&&(i.id=c.toString()))):!0}),k=c.children("a").first(),k.length&&(k=a.vakata.attributes(k,!0),a.each(k,function(b,c){c=a.trim(c),c.length&&(i.a_attr[b]=c)})),k=c.children("a").first().length?c.children("a").first().clone():c.clone(),k.children("ins, i, ul").remove(),k=k.html(),k=a("<div />").html(k),i.text=this.settings.core.force_text?k.text():k.html(),k=c.data(),i.data=k?a.extend(!0,{},k):null,i.state.opened=c.hasClass("jstree-open"),i.state.selected=c.children("a").hasClass("jstree-clicked"),i.state.disabled=c.children("a").hasClass("jstree-disabled"),i.data&&i.data.jstree)for(j in i.data.jstree)i.data.jstree.hasOwnProperty(j)&&(i.state[j]=i.data.jstree[j]);k=c.children("a").children(".jstree-themeicon"),k.length&&(i.icon=k.hasClass("jstree-themeicon-hidden")?!1:k.attr("rel")),i.state.icon!==b&&(i.icon=i.state.icon),(i.icon===b||null===i.icon||""===i.icon)&&(i.icon=!0),k=c.children("ul").children("li");do l="j"+this._id+"_"+ ++this._cnt;while(h[l]);return i.id=i.li_attr.id?i.li_attr.id.toString():l,k.length?(k.each(a.proxy(function(b,c){f=this._parse_model_from_html(a(c),i.id,e),g=this._model.data[f],i.children.push(f),g.children_d.length&&(i.children_d=i.children_d.concat(g.children_d))},this)),i.children_d=i.children_d.concat(i.children)):c.hasClass("jstree-closed")&&(i.state.loaded=!1),i.li_attr["class"]&&(i.li_attr["class"]=i.li_attr["class"].replace("jstree-closed","").replace("jstree-open","")),i.a_attr["class"]&&(i.a_attr["class"]=i.a_attr["class"].replace("jstree-clicked","").replace("jstree-disabled","")),h[i.id]=i,i.state.selected&&this._data.core.selected.push(i.id),i.id},_parse_model_from_flat_json:function(a,c,d){d=d?d.concat():[],c&&d.unshift(c);var e=a.id.toString(),f=this._model.data,g=this._model.default_state,h,i,j,k,l={id:e,text:a.text||"",icon:a.icon!==b?a.icon:!0,parent:c,parents:d,children:a.children||[],children_d:a.children_d||[],data:a.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(h in g)g.hasOwnProperty(h)&&(l.state[h]=g[h]);if(a&&a.data&&a.data.jstree&&a.data.jstree.icon&&(l.icon=a.data.jstree.icon),(l.icon===b||null===l.icon||""===l.icon)&&(l.icon=!0),a&&a.data&&(l.data=a.data,a.data.jstree))for(h in a.data.jstree)a.data.jstree.hasOwnProperty(h)&&(l.state[h]=a.data.jstree[h]);if(a&&"object"==typeof a.state)for(h in a.state)a.state.hasOwnProperty(h)&&(l.state[h]=a.state[h]);if(a&&"object"==typeof a.li_attr)for(h in a.li_attr)a.li_attr.hasOwnProperty(h)&&(l.li_attr[h]=a.li_attr[h]);if(l.li_attr.id||(l.li_attr.id=e),a&&"object"==typeof a.a_attr)for(h in a.a_attr)a.a_attr.hasOwnProperty(h)&&(l.a_attr[h]=a.a_attr[h]);for(a&&a.children&&a.children===!0&&(l.state.loaded=!1,l.children=[],l.children_d=[]),f[l.id]=l,h=0,i=l.children.length;i>h;h++)j=this._parse_model_from_flat_json(f[l.children[h]],l.id,d),k=f[j],l.children_d.push(j),k.children_d.length&&(l.children_d=l.children_d.concat(k.children_d));return delete a.data,delete a.children,f[l.id].original=a,l.state.selected&&this._data.core.selected.push(l.id),l.id},_parse_model_from_json:function(a,c,d){d=d?d.concat():[],c&&d.unshift(c);var e=!1,f,g,h,i,j=this._model.data,k=this._model.default_state,l;do e="j"+this._id+"_"+ ++this._cnt;while(j[e]);l={id:!1,text:"string"==typeof a?a:"",icon:"object"==typeof a&&a.icon!==b?a.icon:!0,parent:c,parents:d,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(f in k)k.hasOwnProperty(f)&&(l.state[f]=k[f]);if(a&&a.id&&(l.id=a.id.toString()),a&&a.text&&(l.text=a.text),a&&a.data&&a.data.jstree&&a.data.jstree.icon&&(l.icon=a.data.jstree.icon),(l.icon===b||null===l.icon||""===l.icon)&&(l.icon=!0),a&&a.data&&(l.data=a.data,a.data.jstree))for(f in a.data.jstree)a.data.jstree.hasOwnProperty(f)&&(l.state[f]=a.data.jstree[f]);if(a&&"object"==typeof a.state)for(f in a.state)a.state.hasOwnProperty(f)&&(l.state[f]=a.state[f]);if(a&&"object"==typeof a.li_attr)for(f in a.li_attr)a.li_attr.hasOwnProperty(f)&&(l.li_attr[f]=a.li_attr[f]);if(l.li_attr.id&&!l.id&&(l.id=l.li_attr.id.toString()),
3
- l.id||(l.id=e),l.li_attr.id||(l.li_attr.id=l.id),a&&"object"==typeof a.a_attr)for(f in a.a_attr)a.a_attr.hasOwnProperty(f)&&(l.a_attr[f]=a.a_attr[f]);if(a&&a.children&&a.children.length){for(f=0,g=a.children.length;g>f;f++)h=this._parse_model_from_json(a.children[f],l.id,d),i=j[h],l.children.push(h),i.children_d.length&&(l.children_d=l.children_d.concat(i.children_d));l.children_d=l.children_d.concat(l.children)}return a&&a.children&&a.children===!0&&(l.state.loaded=!1,l.children=[],l.children_d=[]),delete a.data,delete a.children,l.original=a,j[l.id]=l,l.state.selected&&this._data.core.selected.push(l.id),l.id},_redraw:function(){var b=this._model.force_full_redraw?this._model.data[a.jstree.root].children.concat([]):this._model.changed.concat([]),c=i.createElement("UL"),d,e,f,g=this._data.core.focused;for(e=0,f=b.length;f>e;e++)d=this.redraw_node(b[e],!0,this._model.force_full_redraw),d&&this._model.force_full_redraw&&c.appendChild(d);this._model.force_full_redraw&&(c.className=this.get_container_ul()[0].className,c.setAttribute("role","group"),this.element.empty().append(c)),null!==g&&this.settings.core.restore_focus&&(d=this.get_node(g,!0),d&&d.length&&d.children(".jstree-anchor")[0]!==i.activeElement?d.children(".jstree-anchor").focus():this._data.core.focused=null),this._model.force_full_redraw=!1,this._model.changed=[],this.trigger("redraw",{nodes:b})},redraw:function(a){a&&(this._model.force_full_redraw=!0),this._redraw()},draw_children:function(b){var c=this.get_node(b),d=!1,e=!1,f=!1,g=i;if(!c)return!1;if(c.id===a.jstree.root)return this.redraw(!0);if(b=this.get_node(b,!0),!b||!b.length)return!1;if(b.children(".jstree-children").remove(),b=b[0],c.children.length&&c.state.loaded){for(f=g.createElement("UL"),f.setAttribute("role","group"),f.className="jstree-children",d=0,e=c.children.length;e>d;d++)f.appendChild(this.redraw_node(c.children[d],!0,!0));b.appendChild(f)}},redraw_node:function(b,c,d,e){var f=this.get_node(b),g=!1,h=!1,j=!1,k=!1,l=!1,m=!1,n="",o=i,p=this._model.data,q=!1,r=!1,s=null,t=0,u=0,v=!1,w=!1;if(!f)return!1;if(f.id===a.jstree.root)return this.redraw(!0);if(c=c||0===f.children.length,b=i.querySelector?this.element[0].querySelector("#"+(-1!=="0123456789".indexOf(f.id[0])?"\\3"+f.id[0]+" "+f.id.substr(1).replace(a.jstree.idregex,"\\$&"):f.id.replace(a.jstree.idregex,"\\$&"))):i.getElementById(f.id))b=a(b),d||(g=b.parent().parent()[0],g===this.element[0]&&(g=null),h=b.index()),c||!f.children.length||b.children(".jstree-children").length||(c=!0),c||(j=b.children(".jstree-children")[0]),q=b.children(".jstree-anchor")[0]===i.activeElement,b.remove();else if(c=!0,!d){if(g=f.parent!==a.jstree.root?a("#"+f.parent.replace(a.jstree.idregex,"\\$&"),this.element)[0]:null,!(null===g||g&&p[f.parent].state.opened))return!1;h=a.inArray(f.id,null===g?p[a.jstree.root].children:p[f.parent].children)}b=this._data.core.node.cloneNode(!0),n="jstree-node ";for(k in f.li_attr)if(f.li_attr.hasOwnProperty(k)){if("id"===k)continue;"class"!==k?b.setAttribute(k,f.li_attr[k]):n+=f.li_attr[k]}for(f.a_attr.id||(f.a_attr.id=f.id+"_anchor"),b.setAttribute("aria-selected",!!f.state.selected),b.setAttribute("aria-level",f.parents.length),b.setAttribute("aria-labelledby",f.a_attr.id),f.state.disabled&&b.setAttribute("aria-disabled",!0),k=0,l=f.children.length;l>k;k++)if(!p[f.children[k]].state.hidden){v=!0;break}if(null!==f.parent&&p[f.parent]&&!f.state.hidden&&(k=a.inArray(f.id,p[f.parent].children),w=f.id,-1!==k))for(k++,l=p[f.parent].children.length;l>k;k++)if(p[p[f.parent].children[k]].state.hidden||(w=p[f.parent].children[k]),w!==f.id)break;f.state.hidden&&(n+=" jstree-hidden"),f.state.loading&&(n+=" jstree-loading"),f.state.loaded&&!v?n+=" jstree-leaf":(n+=f.state.opened&&f.state.loaded?" jstree-open":" jstree-closed",b.setAttribute("aria-expanded",f.state.opened&&f.state.loaded)),w===f.id&&(n+=" jstree-last"),b.id=f.id,b.className=n,n=(f.state.selected?" jstree-clicked":"")+(f.state.disabled?" jstree-disabled":"");for(l in f.a_attr)if(f.a_attr.hasOwnProperty(l)){if("href"===l&&"#"===f.a_attr[l])continue;"class"!==l?b.childNodes[1].setAttribute(l,f.a_attr[l]):n+=" "+f.a_attr[l]}if(n.length&&(b.childNodes[1].className="jstree-anchor "+n),(f.icon&&f.icon!==!0||f.icon===!1)&&(f.icon===!1?b.childNodes[1].childNodes[0].className+=" jstree-themeicon-hidden":-1===f.icon.indexOf("/")&&-1===f.icon.indexOf(".")?b.childNodes[1].childNodes[0].className+=" "+f.icon+" jstree-themeicon-custom":(b.childNodes[1].childNodes[0].style.backgroundImage='url("'+f.icon+'")',b.childNodes[1].childNodes[0].style.backgroundPosition="center center",b.childNodes[1].childNodes[0].style.backgroundSize="auto",b.childNodes[1].childNodes[0].className+=" jstree-themeicon-custom")),this.settings.core.force_text?b.childNodes[1].appendChild(o.createTextNode(f.text)):b.childNodes[1].innerHTML+=f.text,c&&f.children.length&&(f.state.opened||e)&&f.state.loaded){for(m=o.createElement("UL"),m.setAttribute("role","group"),m.className="jstree-children",k=0,l=f.children.length;l>k;k++)m.appendChild(this.redraw_node(f.children[k],c,!0));b.appendChild(m)}if(j&&b.appendChild(j),!d){for(g||(g=this.element[0]),k=0,l=g.childNodes.length;l>k;k++)if(g.childNodes[k]&&g.childNodes[k].className&&-1!==g.childNodes[k].className.indexOf("jstree-children")){s=g.childNodes[k];break}s||(s=o.createElement("UL"),s.setAttribute("role","group"),s.className="jstree-children",g.appendChild(s)),g=s,h<g.childNodes.length?g.insertBefore(b,g.childNodes[h]):g.appendChild(b),q&&(t=this.element[0].scrollTop,u=this.element[0].scrollLeft,b.childNodes[1].focus(),this.element[0].scrollTop=t,this.element[0].scrollLeft=u)}return f.state.opened&&!f.state.loaded&&(f.state.opened=!1,setTimeout(a.proxy(function(){this.open_node(f.id,!1,0)},this),0)),b},open_node:function(c,d,e){var f,g,h,i;if(a.isArray(c)){for(c=c.slice(),f=0,g=c.length;g>f;f++)this.open_node(c[f],d,e);return!0}return c=this.get_node(c),c&&c.id!==a.jstree.root?(e=e===b?this.settings.core.animation:e,this.is_closed(c)?this.is_loaded(c)?(h=this.get_node(c,!0),i=this,h.length&&(e&&h.children(".jstree-children").length&&h.children(".jstree-children").stop(!0,!0),c.children.length&&!this._firstChild(h.children(".jstree-children")[0])&&this.draw_children(c),e?(this.trigger("before_open",{node:c}),h.children(".jstree-children").css("display","none").end().removeClass("jstree-closed").addClass("jstree-open").attr("aria-expanded",!0).children(".jstree-children").stop(!0,!0).slideDown(e,function(){this.style.display="",i.element&&i.trigger("after_open",{node:c})})):(this.trigger("before_open",{node:c}),h[0].className=h[0].className.replace("jstree-closed","jstree-open"),h[0].setAttribute("aria-expanded",!0))),c.state.opened=!0,d&&d.call(this,c,!0),h.length||this.trigger("before_open",{node:c}),this.trigger("open_node",{node:c}),e&&h.length||this.trigger("after_open",{node:c}),!0):this.is_loading(c)?setTimeout(a.proxy(function(){this.open_node(c,d,e)},this),500):void this.load_node(c,function(a,b){return b?this.open_node(a,d,e):d?d.call(this,a,!1):!1}):(d&&d.call(this,c,!1),!1)):!1},_open_to:function(b){if(b=this.get_node(b),!b||b.id===a.jstree.root)return!1;var c,d,e=b.parents;for(c=0,d=e.length;d>c;c+=1)c!==a.jstree.root&&this.open_node(e[c],!1,0);return a("#"+b.id.replace(a.jstree.idregex,"\\$&"),this.element)},close_node:function(c,d){var e,f,g,h;if(a.isArray(c)){for(c=c.slice(),e=0,f=c.length;f>e;e++)this.close_node(c[e],d);return!0}return c=this.get_node(c),c&&c.id!==a.jstree.root?this.is_closed(c)?!1:(d=d===b?this.settings.core.animation:d,g=this,h=this.get_node(c,!0),c.state.opened=!1,this.trigger("close_node",{node:c}),void(h.length?d?h.children(".jstree-children").attr("style","display:block !important").end().removeClass("jstree-open").addClass("jstree-closed").attr("aria-expanded",!1).children(".jstree-children").stop(!0,!0).slideUp(d,function(){this.style.display="",h.children(".jstree-children").remove(),g.element&&g.trigger("after_close",{node:c})}):(h[0].className=h[0].className.replace("jstree-open","jstree-closed"),h.attr("aria-expanded",!1).children(".jstree-children").remove(),this.trigger("after_close",{node:c})):this.trigger("after_close",{node:c}))):!1},toggle_node:function(b){var c,d;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.toggle_node(b[c]);return!0}return this.is_closed(b)?this.open_node(b):this.is_open(b)?this.close_node(b):void 0},open_all:function(b,c,d){if(b||(b=a.jstree.root),b=this.get_node(b),!b)return!1;var e=b.id===a.jstree.root?this.get_container_ul():this.get_node(b,!0),f,g,h;if(!e.length){for(f=0,g=b.children_d.length;g>f;f++)this.is_closed(this._model.data[b.children_d[f]])&&(this._model.data[b.children_d[f]].state.opened=!0);return this.trigger("open_all",{node:b})}d=d||e,h=this,e=this.is_closed(b)?e.find(".jstree-closed").addBack():e.find(".jstree-closed"),e.each(function(){h.open_node(this,function(a,b){b&&this.is_parent(a)&&this.open_all(a,c,d)},c||0)}),0===d.find(".jstree-closed").length&&this.trigger("open_all",{node:this.get_node(d)})},close_all:function(b,c){if(b||(b=a.jstree.root),b=this.get_node(b),!b)return!1;var d=b.id===a.jstree.root?this.get_container_ul():this.get_node(b,!0),e=this,f,g;for(d.length&&(d=this.is_open(b)?d.find(".jstree-open").addBack():d.find(".jstree-open"),a(d.get().reverse()).each(function(){e.close_node(this,c||0)})),f=0,g=b.children_d.length;g>f;f++)this._model.data[b.children_d[f]].state.opened=!1;this.trigger("close_all",{node:b})},is_disabled:function(a){return a=this.get_node(a),a&&a.state&&a.state.disabled},enable_node:function(b){var c,d;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.enable_node(b[c]);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(b.state.disabled=!1,this.get_node(b,!0).children(".jstree-anchor").removeClass("jstree-disabled").attr("aria-disabled",!1),void this.trigger("enable_node",{node:b})):!1},disable_node:function(b){var c,d;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.disable_node(b[c]);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(b.state.disabled=!0,this.get_node(b,!0).children(".jstree-anchor").addClass("jstree-disabled").attr("aria-disabled",!0),void this.trigger("disable_node",{node:b})):!1},is_hidden:function(a){return a=this.get_node(a),a.state.hidden===!0},hide_node:function(b,c){var d,e;if(a.isArray(b)){for(b=b.slice(),d=0,e=b.length;e>d;d++)this.hide_node(b[d],!0);return c||this.redraw(),!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?void(b.state.hidden||(b.state.hidden=!0,this._node_changed(b.parent),c||this.redraw(),this.trigger("hide_node",{node:b}))):!1},show_node:function(b,c){var d,e;if(a.isArray(b)){for(b=b.slice(),d=0,e=b.length;e>d;d++)this.show_node(b[d],!0);return c||this.redraw(),!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?void(b.state.hidden&&(b.state.hidden=!1,this._node_changed(b.parent),c||this.redraw(),this.trigger("show_node",{node:b}))):!1},hide_all:function(b){var c,d=this._model.data,e=[];for(c in d)d.hasOwnProperty(c)&&c!==a.jstree.root&&!d[c].state.hidden&&(d[c].state.hidden=!0,e.push(c));return this._model.force_full_redraw=!0,b||this.redraw(),this.trigger("hide_all",{nodes:e}),e},show_all:function(b){var c,d=this._model.data,e=[];for(c in d)d.hasOwnProperty(c)&&c!==a.jstree.root&&d[c].state.hidden&&(d[c].state.hidden=!1,e.push(c));return this._model.force_full_redraw=!0,b||this.redraw(),this.trigger("show_all",{nodes:e}),e},activate_node:function(a,c){if(this.is_disabled(a))return!1;if(c&&"object"==typeof c||(c={}),this._data.core.last_clicked=this._data.core.last_clicked&&this._data.core.last_clicked.id!==b?this.get_node(this._data.core.last_clicked.id):null,this._data.core.last_clicked&&!this._data.core.last_clicked.state.selected&&(this._data.core.last_clicked=null),!this._data.core.last_clicked&&this._data.core.selected.length&&(this._data.core.last_clicked=this.get_node(this._data.core.selected[this._data.core.selected.length-1])),this.settings.core.multiple&&(c.metaKey||c.ctrlKey||c.shiftKey)&&(!c.shiftKey||this._data.core.last_clicked&&this.get_parent(a)&&this.get_parent(a)===this._data.core.last_clicked.parent))if(c.shiftKey){var d=this.get_node(a).id,e=this._data.core.last_clicked.id,f=this.get_node(this._data.core.last_clicked.parent).children,g=!1,h,i;for(h=0,i=f.length;i>h;h+=1)f[h]===d&&(g=!g),f[h]===e&&(g=!g),this.is_disabled(f[h])||!g&&f[h]!==d&&f[h]!==e?this.deselect_node(f[h],!0,c):this.is_hidden(f[h])||this.select_node(f[h],!0,!1,c);this.trigger("changed",{action:"select_node",node:this.get_node(a),selected:this._data.core.selected,event:c})}else this.is_selected(a)?this.deselect_node(a,!1,c):this.select_node(a,!1,!1,c);else!this.settings.core.multiple&&(c.metaKey||c.ctrlKey||c.shiftKey)&&this.is_selected(a)?this.deselect_node(a,!1,c):(this.deselect_all(!0),this.select_node(a,!1,!1,c),this._data.core.last_clicked=this.get_node(a));this.trigger("activate_node",{node:this.get_node(a),event:c})},hover_node:function(a){if(a=this.get_node(a,!0),!a||!a.length||a.children(".jstree-hovered").length)return!1;var b=this.element.find(".jstree-hovered"),c=this.element;b&&b.length&&this.dehover_node(b),a.children(".jstree-anchor").addClass("jstree-hovered"),this.trigger("hover_node",{node:this.get_node(a)}),setTimeout(function(){c.attr("aria-activedescendant",a[0].id)},0)},dehover_node:function(a){return a=this.get_node(a,!0),a&&a.length&&a.children(".jstree-hovered").length?(a.children(".jstree-anchor").removeClass("jstree-hovered"),void this.trigger("dehover_node",{node:this.get_node(a)})):!1},select_node:function(b,c,d,e){var f,g,h,i;if(a.isArray(b)){for(b=b.slice(),g=0,h=b.length;h>g;g++)this.select_node(b[g],c,d,e);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(f=this.get_node(b,!0),void(b.state.selected||(b.state.selected=!0,this._data.core.selected.push(b.id),d||(f=this._open_to(b)),f&&f.length&&f.attr("aria-selected",!0).children(".jstree-anchor").addClass("jstree-clicked"),this.trigger("select_node",{node:b,selected:this._data.core.selected,event:e}),c||this.trigger("changed",{action:"select_node",node:b,selected:this._data.core.selected,event:e})))):!1},deselect_node:function(b,c,d){var e,f,g;if(a.isArray(b)){for(b=b.slice(),e=0,f=b.length;f>e;e++)this.deselect_node(b[e],c,d);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(g=this.get_node(b,!0),void(b.state.selected&&(b.state.selected=!1,this._data.core.selected=a.vakata.array_remove_item(this._data.core.selected,b.id),g.length&&g.attr("aria-selected",!1).children(".jstree-anchor").removeClass("jstree-clicked"),this.trigger("deselect_node",{node:b,selected:this._data.core.selected,event:d}),c||this.trigger("changed",{action:"deselect_node",node:b,selected:this._data.core.selected,event:d})))):!1},select_all:function(b){var c=this._data.core.selected.concat([]),d,e;for(this._data.core.selected=this._model.data[a.jstree.root].children_d.concat(),d=0,e=this._data.core.selected.length;e>d;d++)this._model.data[this._data.core.selected[d]]&&(this._model.data[this._data.core.selected[d]].state.selected=!0);this.redraw(!0),this.trigger("select_all",{selected:this._data.core.selected}),b||this.trigger("changed",{action:"select_all",selected:this._data.core.selected,old_selection:c})},deselect_all:function(a){var b=this._data.core.selected.concat([]),c,d;for(c=0,d=this._data.core.selected.length;d>c;c++)this._model.data[this._data.core.selected[c]]&&(this._model.data[this._data.core.selected[c]].state.selected=!1);this._data.core.selected=[],this.element.find(".jstree-clicked").removeClass("jstree-clicked").parent().attr("aria-selected",!1),this.trigger("deselect_all",{selected:this._data.core.selected,node:b}),a||this.trigger("changed",{action:"deselect_all",selected:this._data.core.selected,old_selection:b})},is_selected:function(b){return b=this.get_node(b),b&&b.id!==a.jstree.root?b.state.selected:!1},get_selected:function(b){return b?a.map(this._data.core.selected,a.proxy(function(a){return this.get_node(a)},this)):this._data.core.selected.slice()},get_top_selected:function(b){var c=this.get_selected(!0),d={},e,f,g,h;for(e=0,f=c.length;f>e;e++)d[c[e].id]=c[e];for(e=0,f=c.length;f>e;e++)for(g=0,h=c[e].children_d.length;h>g;g++)d[c[e].children_d[g]]&&delete d[c[e].children_d[g]];c=[];for(e in d)d.hasOwnProperty(e)&&c.push(e);return b?a.map(c,a.proxy(function(a){return this.get_node(a)},this)):c},get_bottom_selected:function(b){var c=this.get_selected(!0),d=[],e,f;for(e=0,f=c.length;f>e;e++)c[e].children.length||d.push(c[e].id);return b?a.map(d,a.proxy(function(a){return this.get_node(a)},this)):d},get_state:function(){var b={core:{open:[],loaded:[],scroll:{left:this.element.scrollLeft(),top:this.element.scrollTop()},selected:[]}},c;for(c in this._model.data)this._model.data.hasOwnProperty(c)&&c!==a.jstree.root&&(this._model.data[c].state.loaded&&this.settings.core.loaded_state&&b.core.loaded.push(c),this._model.data[c].state.opened&&b.core.open.push(c),this._model.data[c].state.selected&&b.core.selected.push(c));return b},set_state:function(c,d){if(c){if(c.core&&c.core.selected&&c.core.initial_selection===b&&(c.core.initial_selection=this._data.core.selected.concat([]).sort().join(",")),c.core){var e,f,g,h,i;if(c.core.loaded)return this.settings.core.loaded_state&&a.isArray(c.core.loaded)&&c.core.loaded.length?this._load_nodes(c.core.loaded,function(a){delete c.core.loaded,this.set_state(c,d)}):(delete c.core.loaded,this.set_state(c,d)),!1;if(c.core.open)return a.isArray(c.core.open)&&c.core.open.length?this._load_nodes(c.core.open,function(a){this.open_node(a,!1,0),delete c.core.open,this.set_state(c,d)}):(delete c.core.open,this.set_state(c,d)),!1;if(c.core.scroll)return c.core.scroll&&c.core.scroll.left!==b&&this.element.scrollLeft(c.core.scroll.left),c.core.scroll&&c.core.scroll.top!==b&&this.element.scrollTop(c.core.scroll.top),delete c.core.scroll,this.set_state(c,d),!1;if(c.core.selected)return h=this,(c.core.initial_selection===b||c.core.initial_selection===this._data.core.selected.concat([]).sort().join(","))&&(this.deselect_all(),a.each(c.core.selected,function(a,b){h.select_node(b,!1,!0)})),delete c.core.initial_selection,delete c.core.selected,this.set_state(c,d),!1;for(i in c)c.hasOwnProperty(i)&&"core"!==i&&-1===a.inArray(i,this.settings.plugins)&&delete c[i];if(a.isEmptyObject(c.core))return delete c.core,this.set_state(c,d),!1}return a.isEmptyObject(c)?(c=null,d&&d.call(this),this.trigger("set_state"),!1):!0}return!1},refresh:function(b,c){this._data.core.state=c===!0?{}:this.get_state(),c&&a.isFunction(c)&&(this._data.core.state=c.call(this,this._data.core.state)),this._cnt=0,this._model.data={},this._model.data[a.jstree.root]={id:a.jstree.root,parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}},this._data.core.selected=[],this._data.core.last_clicked=null,this._data.core.focused=null;var d=this.get_container_ul()[0].className;b||(this.element.html("<ul class='"+d+"' role='group'><li class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='treeitem' id='j"+this._id+"_loading'><i class='jstree-icon jstree-ocl'></i><a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'></i>"+this.get_string("Loading ...")+"</a></li></ul>"),this.element.attr("aria-activedescendant","j"+this._id+"_loading")),this.load_node(a.jstree.root,function(b,c){c&&(this.get_container_ul()[0].className=d,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.set_state(a.extend(!0,{},this._data.core.state),function(){this.trigger("refresh")})),this._data.core.state=null})},refresh_node:function(b){if(b=this.get_node(b),!b||b.id===a.jstree.root)return!1;var c=[],d=[],e=this._data.core.selected.concat([]);d.push(b.id),b.state.opened===!0&&c.push(b.id),this.get_node(b,!0).find(".jstree-open").each(function(){d.push(this.id),c.push(this.id)}),this._load_nodes(d,a.proxy(function(a){this.open_node(c,!1,0),this.select_node(e),this.trigger("refresh_node",{node:b,nodes:a})},this),!1,!0)},set_id:function(b,c){if(b=this.get_node(b),!b||b.id===a.jstree.root)return!1;var d,e,f=this._model.data,g=b.id;for(c=c.toString(),f[b.parent].children[a.inArray(b.id,f[b.parent].children)]=c,d=0,e=b.parents.length;e>d;d++)f[b.parents[d]].children_d[a.inArray(b.id,f[b.parents[d]].children_d)]=c;for(d=0,e=b.children.length;e>d;d++)f[b.children[d]].parent=c;for(d=0,e=b.children_d.length;e>d;d++)f[b.children_d[d]].parents[a.inArray(b.id,f[b.children_d[d]].parents)]=c;return d=a.inArray(b.id,this._data.core.selected),-1!==d&&(this._data.core.selected[d]=c),d=this.get_node(b.id,!0),d&&(d.attr("id",c),this.element.attr("aria-activedescendant")===b.id&&this.element.attr("aria-activedescendant",c)),delete f[b.id],b.id=c,b.li_attr.id=c,f[c]=b,this.trigger("set_id",{node:b,"new":b.id,old:g}),!0},get_text:function(b){return b=this.get_node(b),b&&b.id!==a.jstree.root?b.text:!1},set_text:function(b,c){var d,e;if(a.isArray(b)){for(b=b.slice(),d=0,e=b.length;e>d;d++)this.set_text(b[d],c);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(b.text=c,this.get_node(b,!0).length&&this.redraw_node(b.id),this.trigger("set_text",{obj:b,text:c}),!0):!1},get_json:function(b,c,d){if(b=this.get_node(b||a.jstree.root),!b)return!1;c&&c.flat&&!d&&(d=[]);var e={id:b.id,text:b.text,icon:this.get_icon(b),li_attr:a.extend(!0,{},b.li_attr),a_attr:a.extend(!0,{},b.a_attr),state:{},data:c&&c.no_data?!1:a.extend(!0,a.isArray(b.data)?[]:{},b.data)},f,g;if(c&&c.flat?e.parent=b.parent:e.children=[],c&&c.no_state)delete e.state;else for(f in b.state)b.state.hasOwnProperty(f)&&(e.state[f]=b.state[f]);if(c&&c.no_li_attr&&delete e.li_attr,c&&c.no_a_attr&&delete e.a_attr,c&&c.no_id&&(delete e.id,e.li_attr&&e.li_attr.id&&delete e.li_attr.id,e.a_attr&&e.a_attr.id&&delete e.a_attr.id),c&&c.flat&&b.id!==a.jstree.root&&d.push(e),!c||!c.no_children)for(f=0,g=b.children.length;g>f;f++)c&&c.flat?this.get_json(b.children[f],c,d):e.children.push(this.get_json(b.children[f],c));return c&&c.flat?d:b.id===a.jstree.root?e.children:e},create_node:function(c,d,e,f,g){if(null===c&&(c=a.jstree.root),c=this.get_node(c),!c)return!1;if(e=e===b?"last":e,!e.toString().match(/^(before|after)$/)&&!g&&!this.is_loaded(c))return this.load_node(c,function(){this.create_node(c,d,e,f,!0)});d||(d={text:this.get_string("New node")}),d="string"==typeof d?{text:d}:a.extend(!0,{},d),d.text===b&&(d.text=this.get_string("New node"));var h,i,j,k;switch(c.id===a.jstree.root&&("before"===e&&(e="first"),"after"===e&&(e="last")),e){case"before":h=this.get_node(c.parent),e=a.inArray(c.id,h.children),c=h;break;case"after":h=this.get_node(c.parent),e=a.inArray(c.id,h.children)+1,c=h;break;case"inside":case"first":e=0;break;case"last":e=c.children.length;break;default:e||(e=0)}if(e>c.children.length&&(e=c.children.length),d.id||(d.id=!0),!this.check("create_node",d,c,e))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(d.id===!0&&delete d.id,d=this._parse_model_from_json(d,c.id,c.parents.concat()),!d)return!1;for(h=this.get_node(d),i=[],i.push(d),i=i.concat(h.children_d),this.trigger("model",{nodes:i,parent:c.id}),c.children_d=c.children_d.concat(i),j=0,k=c.parents.length;k>j;j++)this._model.data[c.parents[j]].children_d=this._model.data[c.parents[j]].children_d.concat(i);for(d=h,h=[],j=0,k=c.children.length;k>j;j++)h[j>=e?j+1:j]=c.children[j];return h[e]=d.id,c.children=h,this.redraw_node(c,!0),this.trigger("create_node",{node:this.get_node(d),parent:c.id,position:e}),f&&f.call(this,this.get_node(d)),d.id},rename_node:function(b,c){var d,e,f;if(a.isArray(b)){for(b=b.slice(),d=0,e=b.length;e>d;d++)this.rename_node(b[d],c);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(f=b.text,this.check("rename_node",b,this.get_parent(b),c)?(this.set_text(b,c),this.trigger("rename_node",{node:b,text:c,old:f}),!0):(this.settings.core.error.call(this,this._data.core.last_error),!1)):!1},delete_node:function(b){var c,d,e,f,g,h,i,j,k,l,m,n;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.delete_node(b[c]);return!0}if(b=this.get_node(b),!b||b.id===a.jstree.root)return!1;if(e=this.get_node(b.parent),f=a.inArray(b.id,e.children),l=!1,!this.check("delete_node",b,e,f))return this.settings.core.error.call(this,this._data.core.last_error),!1;for(-1!==f&&(e.children=a.vakata.array_remove(e.children,f)),g=b.children_d.concat([]),g.push(b.id),h=0,i=b.parents.length;i>h;h++)this._model.data[b.parents[h]].children_d=a.vakata.array_filter(this._model.data[b.parents[h]].children_d,function(b){return-1===a.inArray(b,g)});for(j=0,k=g.length;k>j;j++)if(this._model.data[g[j]].state.selected){l=!0;break}for(l&&(this._data.core.selected=a.vakata.array_filter(this._data.core.selected,function(b){return-1===a.inArray(b,g)})),this.trigger("delete_node",{node:b,parent:e.id}),l&&this.trigger("changed",{action:"delete_node",node:b,selected:this._data.core.selected,parent:e.id}),j=0,k=g.length;k>j;j++)delete this._model.data[g[j]];return-1!==a.inArray(this._data.core.focused,g)&&(this._data.core.focused=null,m=this.element[0].scrollTop,n=this.element[0].scrollLeft,e.id===a.jstree.root?this._model.data[a.jstree.root].children[0]&&this.get_node(this._model.data[a.jstree.root].children[0],!0).children(".jstree-anchor").focus():this.get_node(e,!0).children(".jstree-anchor").focus(),this.element[0].scrollTop=m,this.element[0].scrollLeft=n),this.redraw_node(e,!0),!0},check:function(b,c,d,e,f){c=c&&c.id?c:this.get_node(c),d=d&&d.id?d:this.get_node(d);var g=b.match(/^move_node|copy_node|create_node$/i)?d:c,h=this.settings.core.check_callback;return"move_node"!==b&&"copy_node"!==b||f&&f.is_multi||c.id!==d.id&&("move_node"!==b||a.inArray(c.id,d.children)!==e)&&-1===a.inArray(d.id,c.children_d)?(g&&g.data&&(g=g.data),g&&g.functions&&(g.functions[b]===!1||g.functions[b]===!0)?(g.functions[b]===!1&&(this._data.core.last_error={error:"check",plugin:"core",id:"core_02",reason:"Node data prevents function: "+b,data:JSON.stringify({chk:b,pos:e,obj:c&&c.id?c.id:!1,par:d&&d.id?d.id:!1})}),g.functions[b]):h===!1||a.isFunction(h)&&h.call(this,b,c,d,e,f)===!1||h&&h[b]===!1?(this._data.core.last_error={error:"check",plugin:"core",id:"core_03",reason:"User config for core.check_callback prevents function: "+b,data:JSON.stringify({chk:b,pos:e,obj:c&&c.id?c.id:!1,par:d&&d.id?d.id:!1})},!1):!0):(this._data.core.last_error={error:"check",plugin:"core",id:"core_01",reason:"Moving parent inside child",data:JSON.stringify({chk:b,pos:e,obj:c&&c.id?c.id:!1,par:d&&d.id?d.id:!1})},!1)},last_error:function(){return this._data.core.last_error},move_node:function(c,d,e,f,g,h,i){var j,k,l,m,n,o,p,q,r,s,t,u,v,w;if(d=this.get_node(d),e=e===b?0:e,!d)return!1;if(!e.toString().match(/^(before|after)$/)&&!g&&!this.is_loaded(d))return this.load_node(d,function(){this.move_node(c,d,e,f,!0,!1,i)});if(a.isArray(c)){if(1!==c.length){for(j=0,k=c.length;k>j;j++)(r=this.move_node(c[j],d,e,f,g,!1,i))&&(d=r,e="after");return this.redraw(),!0}c=c[0]}if(c=c&&c.id?c:this.get_node(c),!c||c.id===a.jstree.root)return!1;if(l=(c.parent||a.jstree.root).toString(),n=e.toString().match(/^(before|after)$/)&&d.id!==a.jstree.root?this.get_node(d.parent):d,o=i?i:this._model.data[c.id]?this:a.jstree.reference(c.id),p=!o||!o._id||this._id!==o._id,m=o&&o._id&&l&&o._model.data[l]&&o._model.data[l].children?a.inArray(c.id,o._model.data[l].children):-1,o&&o._id&&(c=o._model.data[c.id]),p)return(r=this.copy_node(c,d,e,f,g,!1,i))?(o&&o.delete_node(c),r):!1;switch(d.id===a.jstree.root&&("before"===e&&(e="first"),"after"===e&&(e="last")),e){case"before":e=a.inArray(d.id,n.children);break;case"after":e=a.inArray(d.id,n.children)+1;break;case"inside":case"first":e=0;break;case"last":e=n.children.length;break;default:e||(e=0)}if(e>n.children.length&&(e=n.children.length),!this.check("move_node",c,n,e,{core:!0,origin:i,is_multi:o&&o._id&&o._id!==this._id,is_foreign:!o||!o._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(c.parent===n.id){for(q=n.children.concat(),r=a.inArray(c.id,q),-1!==r&&(q=a.vakata.array_remove(q,r),e>r&&e--),r=[],s=0,t=q.length;t>s;s++)r[s>=e?s+1:s]=q[s];r[e]=c.id,n.children=r,this._node_changed(n.id),this.redraw(n.id===a.jstree.root)}else{for(r=c.children_d.concat(),r.push(c.id),s=0,t=c.parents.length;t>s;s++){for(q=[],w=o._model.data[c.parents[s]].children_d,u=0,v=w.length;v>u;u++)-1===a.inArray(w[u],r)&&q.push(w[u]);o._model.data[c.parents[s]].children_d=q}for(o._model.data[l].children=a.vakata.array_remove_item(o._model.data[l].children,c.id),s=0,t=n.parents.length;t>s;s++)this._model.data[n.parents[s]].children_d=this._model.data[n.parents[s]].children_d.concat(r);for(q=[],s=0,t=n.children.length;t>s;s++)q[s>=e?s+1:s]=n.children[s];for(q[e]=c.id,n.children=q,n.children_d.push(c.id),n.children_d=n.children_d.concat(c.children_d),c.parent=n.id,r=n.parents.concat(),r.unshift(n.id),w=c.parents.length,c.parents=r,r=r.concat(),s=0,t=c.children_d.length;t>s;s++)this._model.data[c.children_d[s]].parents=this._model.data[c.children_d[s]].parents.slice(0,-1*w),Array.prototype.push.apply(this._model.data[c.children_d[s]].parents,r);(l===a.jstree.root||n.id===a.jstree.root)&&(this._model.force_full_redraw=!0),this._model.force_full_redraw||(this._node_changed(l),this._node_changed(n.id)),h||this.redraw()}return f&&f.call(this,c,n,e),this.trigger("move_node",{node:c,parent:n.id,position:e,old_parent:l,old_position:m,is_multi:o&&o._id&&o._id!==this._id,is_foreign:!o||!o._id,old_instance:o,new_instance:this}),c.id},copy_node:function(c,d,e,f,g,h,i){var j,k,l,m,n,o,p,q,r,s,t;if(d=this.get_node(d),e=e===b?0:e,!d)return!1;if(!e.toString().match(/^(before|after)$/)&&!g&&!this.is_loaded(d))return this.load_node(d,function(){this.copy_node(c,d,e,f,!0,!1,i)});if(a.isArray(c)){if(1!==c.length){for(j=0,k=c.length;k>j;j++)(m=this.copy_node(c[j],d,e,f,g,!0,i))&&(d=m,e="after");return this.redraw(),!0}c=c[0]}if(c=c&&c.id?c:this.get_node(c),!c||c.id===a.jstree.root)return!1;switch(q=(c.parent||a.jstree.root).toString(),r=e.toString().match(/^(before|after)$/)&&d.id!==a.jstree.root?this.get_node(d.parent):d,s=i?i:this._model.data[c.id]?this:a.jstree.reference(c.id),t=!s||!s._id||this._id!==s._id,s&&s._id&&(c=s._model.data[c.id]),d.id===a.jstree.root&&("before"===e&&(e="first"),"after"===e&&(e="last")),e){case"before":e=a.inArray(d.id,r.children);break;case"after":e=a.inArray(d.id,r.children)+1;break;case"inside":case"first":e=0;break;case"last":e=r.children.length;break;default:e||(e=0)}if(e>r.children.length&&(e=r.children.length),!this.check("copy_node",c,r,e,{core:!0,origin:i,is_multi:s&&s._id&&s._id!==this._id,is_foreign:!s||!s._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(p=s?s.get_json(c,{no_id:!0,no_data:!0,no_state:!0}):c,!p)return!1;if(p.id===!0&&delete p.id,p=this._parse_model_from_json(p,r.id,r.parents.concat()),!p)return!1;for(m=this.get_node(p),c&&c.state&&c.state.loaded===!1&&(m.state.loaded=!1),l=[],l.push(p),l=l.concat(m.children_d),this.trigger("model",{nodes:l,parent:r.id}),n=0,o=r.parents.length;o>n;n++)this._model.data[r.parents[n]].children_d=this._model.data[r.parents[n]].children_d.concat(l);for(l=[],n=0,o=r.children.length;o>n;n++)l[n>=e?n+1:n]=r.children[n];return l[e]=m.id,r.children=l,r.children_d.push(m.id),r.children_d=r.children_d.concat(m.children_d),r.id===a.jstree.root&&(this._model.force_full_redraw=!0),this._model.force_full_redraw||this._node_changed(r.id),h||this.redraw(r.id===a.jstree.root),f&&f.call(this,m,r,e),this.trigger("copy_node",{node:m,original:c,parent:r.id,position:e,old_parent:q,old_position:s&&s._id&&q&&s._model.data[q]&&s._model.data[q].children?a.inArray(c.id,s._model.data[q].children):-1,is_multi:s&&s._id&&s._id!==this._id,is_foreign:!s||!s._id,old_instance:s,new_instance:this}),m.id},cut:function(b){if(b||(b=this._data.core.selected.concat()),a.isArray(b)||(b=[b]),!b.length)return!1;var c=[],g,h,i;for(h=0,i=b.length;i>h;h++)g=this.get_node(b[h]),g&&g.id&&g.id!==a.jstree.root&&c.push(g);
4
- return c.length?(d=c,f=this,e="move_node",void this.trigger("cut",{node:b})):!1},copy:function(b){if(b||(b=this._data.core.selected.concat()),a.isArray(b)||(b=[b]),!b.length)return!1;var c=[],g,h,i;for(h=0,i=b.length;i>h;h++)g=this.get_node(b[h]),g&&g.id&&g.id!==a.jstree.root&&c.push(g);return c.length?(d=c,f=this,e="copy_node",void this.trigger("copy",{node:b})):!1},get_buffer:function(){return{mode:e,node:d,inst:f}},can_paste:function(){return e!==!1&&d!==!1},paste:function(a,b){return a=this.get_node(a),a&&e&&e.match(/^(copy_node|move_node)$/)&&d?(this[e](d,a,b,!1,!1,!1,f)&&this.trigger("paste",{parent:a.id,node:d,mode:e}),d=!1,e=!1,void(f=!1)):!1},clear_buffer:function(){d=!1,e=!1,f=!1,this.trigger("clear_buffer")},edit:function(b,c,d){var e,f,g,h,j,k,l,m,n,o=!1;return(b=this.get_node(b))?this.check("edit",b,this.get_parent(b))?(n=b,c="string"==typeof c?c:b.text,this.set_text(b,""),b=this._open_to(b),n.text=c,e=this._data.core.rtl,f=this.element.width(),this._data.core.focused=n.id,g=b.children(".jstree-anchor").focus(),h=a("<span>"),j=c,k=a("<div />",{css:{position:"absolute",top:"-200px",left:e?"0px":"-1000px",visibility:"hidden"}}).appendTo(i.body),l=a("<input />",{value:j,"class":"jstree-rename-input",css:{padding:"0",border:"1px solid silver","box-sizing":"border-box",display:"inline-block",height:this._data.core.li_height+"px",lineHeight:this._data.core.li_height+"px",width:"150px"},blur:a.proxy(function(c){c.stopImmediatePropagation(),c.preventDefault();var e=h.children(".jstree-rename-input"),f=e.val(),i=this.settings.core.force_text,m;""===f&&(f=j),k.remove(),h.replaceWith(g),h.remove(),j=i?j:a("<div></div>").append(a.parseHTML(j)).html(),b=this.get_node(b),this.set_text(b,j),m=!!this.rename_node(b,i?a("<div></div>").text(f).text():a("<div></div>").append(a.parseHTML(f)).html()),m||this.set_text(b,j),this._data.core.focused=n.id,setTimeout(a.proxy(function(){var a=this.get_node(n.id,!0);a.length&&(this._data.core.focused=n.id,a.children(".jstree-anchor").focus())},this),0),d&&d.call(this,n,m,o),l=null},this),keydown:function(a){var b=a.which;27===b&&(o=!0,this.value=j),(27===b||13===b||37===b||38===b||39===b||40===b||32===b)&&a.stopImmediatePropagation(),(27===b||13===b)&&(a.preventDefault(),this.blur())},click:function(a){a.stopImmediatePropagation()},mousedown:function(a){a.stopImmediatePropagation()},keyup:function(a){l.width(Math.min(k.text("pW"+this.value).width(),f))},keypress:function(a){return 13===a.which?!1:void 0}}),m={fontFamily:g.css("fontFamily")||"",fontSize:g.css("fontSize")||"",fontWeight:g.css("fontWeight")||"",fontStyle:g.css("fontStyle")||"",fontStretch:g.css("fontStretch")||"",fontVariant:g.css("fontVariant")||"",letterSpacing:g.css("letterSpacing")||"",wordSpacing:g.css("wordSpacing")||""},h.attr("class",g.attr("class")).append(g.contents().clone()).append(l),g.replaceWith(h),k.css(m),l.css(m).width(Math.min(k.text("pW"+l[0].value).width(),f))[0].select(),void a(i).one("mousedown.jstree touchstart.jstree dnd_start.vakata",function(b){l&&b.target!==l&&a(l).blur()})):(this.settings.core.error.call(this,this._data.core.last_error),!1):!1},set_theme:function(b,c){if(!b)return!1;if(c===!0){var d=this.settings.core.themes.dir;d||(d=a.jstree.path+"/themes"),c=d+"/"+b+"/style.css"}c&&-1===a.inArray(c,g)&&(a("head").append('<link rel="stylesheet" href="'+c+'" type="text/css" />'),g.push(c)),this._data.core.themes.name&&this.element.removeClass("jstree-"+this._data.core.themes.name),this._data.core.themes.name=b,this.element.addClass("jstree-"+b),this.element[this.settings.core.themes.responsive?"addClass":"removeClass"]("jstree-"+b+"-responsive"),this.trigger("set_theme",{theme:b})},get_theme:function(){return this._data.core.themes.name},set_theme_variant:function(a){this._data.core.themes.variant&&this.element.removeClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant),this._data.core.themes.variant=a,a&&this.element.addClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant)},get_theme_variant:function(){return this._data.core.themes.variant},show_stripes:function(){this._data.core.themes.stripes=!0,this.get_container_ul().addClass("jstree-striped"),this.trigger("show_stripes")},hide_stripes:function(){this._data.core.themes.stripes=!1,this.get_container_ul().removeClass("jstree-striped"),this.trigger("hide_stripes")},toggle_stripes:function(){this._data.core.themes.stripes?this.hide_stripes():this.show_stripes()},show_dots:function(){this._data.core.themes.dots=!0,this.get_container_ul().removeClass("jstree-no-dots"),this.trigger("show_dots")},hide_dots:function(){this._data.core.themes.dots=!1,this.get_container_ul().addClass("jstree-no-dots"),this.trigger("hide_dots")},toggle_dots:function(){this._data.core.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this._data.core.themes.icons=!0,this.get_container_ul().removeClass("jstree-no-icons"),this.trigger("show_icons")},hide_icons:function(){this._data.core.themes.icons=!1,this.get_container_ul().addClass("jstree-no-icons"),this.trigger("hide_icons")},toggle_icons:function(){this._data.core.themes.icons?this.hide_icons():this.show_icons()},show_ellipsis:function(){this._data.core.themes.ellipsis=!0,this.get_container_ul().addClass("jstree-ellipsis"),this.trigger("show_ellipsis")},hide_ellipsis:function(){this._data.core.themes.ellipsis=!1,this.get_container_ul().removeClass("jstree-ellipsis"),this.trigger("hide_ellipsis")},toggle_ellipsis:function(){this._data.core.themes.ellipsis?this.hide_ellipsis():this.show_ellipsis()},set_icon:function(c,d){var e,f,g,h;if(a.isArray(c)){for(c=c.slice(),e=0,f=c.length;f>e;e++)this.set_icon(c[e],d);return!0}return c=this.get_node(c),c&&c.id!==a.jstree.root?(h=c.icon,c.icon=d===!0||null===d||d===b||""===d?!0:d,g=this.get_node(c,!0).children(".jstree-anchor").children(".jstree-themeicon"),d===!1?(g.removeClass("jstree-themeicon-custom "+h).css("background","").removeAttr("rel"),this.hide_icon(c)):d===!0||null===d||d===b||""===d?(g.removeClass("jstree-themeicon-custom "+h).css("background","").removeAttr("rel"),h===!1&&this.show_icon(c)):-1===d.indexOf("/")&&-1===d.indexOf(".")?(g.removeClass(h).css("background",""),g.addClass(d+" jstree-themeicon-custom").attr("rel",d),h===!1&&this.show_icon(c)):(g.removeClass(h).css("background",""),g.addClass("jstree-themeicon-custom").css("background","url('"+d+"') center center no-repeat").attr("rel",d),h===!1&&this.show_icon(c)),!0):!1},get_icon:function(b){return b=this.get_node(b),b&&b.id!==a.jstree.root?b.icon:!1},hide_icon:function(b){var c,d;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.hide_icon(b[c]);return!0}return b=this.get_node(b),b&&b!==a.jstree.root?(b.icon=!1,this.get_node(b,!0).children(".jstree-anchor").children(".jstree-themeicon").addClass("jstree-themeicon-hidden"),!0):!1},show_icon:function(b){var c,d,e;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.show_icon(b[c]);return!0}return b=this.get_node(b),b&&b!==a.jstree.root?(e=this.get_node(b,!0),b.icon=e.length?e.children(".jstree-anchor").children(".jstree-themeicon").attr("rel"):!0,b.icon||(b.icon=!0),e.children(".jstree-anchor").children(".jstree-themeicon").removeClass("jstree-themeicon-hidden"),!0):!1}},a.vakata={},a.vakata.attributes=function(b,c){b=a(b)[0];var d=c?{}:[];return b&&b.attributes&&a.each(b.attributes,function(b,e){-1===a.inArray(e.name.toLowerCase(),["style","contenteditable","hasfocus","tabindex"])&&null!==e.value&&""!==a.trim(e.value)&&(c?d[e.name]=e.value:d.push(e.name))}),d},a.vakata.array_unique=function(a){var c=[],d,e,f,g={};for(d=0,f=a.length;f>d;d++)g[a[d]]===b&&(c.push(a[d]),g[a[d]]=!0);return c},a.vakata.array_remove=function(a,b){return a.splice(b,1),a},a.vakata.array_remove_item=function(b,c){var d=a.inArray(c,b);return-1!==d?a.vakata.array_remove(b,d):b},a.vakata.array_filter=function(a,b,c,d,e){if(a.filter)return a.filter(b,c);d=[];for(e in a)~~e+""==e+""&&e>=0&&b.call(c,a[e],+e,a)&&d.push(a[e]);return d},a.jstree.plugins.changed=function(a,b){var c=[];this.trigger=function(a,d){var e,f;if(d||(d={}),"changed"===a.replace(".jstree","")){d.changed={selected:[],deselected:[]};var g={};for(e=0,f=c.length;f>e;e++)g[c[e]]=1;for(e=0,f=d.selected.length;f>e;e++)g[d.selected[e]]?g[d.selected[e]]=2:d.changed.selected.push(d.selected[e]);for(e=0,f=c.length;f>e;e++)1===g[c[e]]&&d.changed.deselected.push(c[e]);c=d.selected.slice()}b.trigger.call(this,a,d)},this.refresh=function(a,d){return c=[],b.refresh.apply(this,arguments)}};var j=i.createElement("I");j.className="jstree-icon jstree-checkbox",j.setAttribute("role","presentation"),a.jstree.defaults.checkbox={visible:!0,three_state:!0,whole_node:!0,keep_selected_style:!0,cascade:"",tie_selection:!0,cascade_to_disabled:!0,cascade_to_hidden:!0},a.jstree.plugins.checkbox=function(c,d){this.bind=function(){d.bind.call(this),this._data.checkbox.uto=!1,this._data.checkbox.selected=[],this.settings.checkbox.three_state&&(this.settings.checkbox.cascade="up+down+undetermined"),this.element.on("init.jstree",a.proxy(function(){this._data.checkbox.visible=this.settings.checkbox.visible,this.settings.checkbox.keep_selected_style||this.element.addClass("jstree-checkbox-no-clicked"),this.settings.checkbox.tie_selection&&this.element.addClass("jstree-checkbox-selection")},this)).on("loading.jstree",a.proxy(function(){this[this._data.checkbox.visible?"show_checkboxes":"hide_checkboxes"]()},this)),-1!==this.settings.checkbox.cascade.indexOf("undetermined")&&this.element.on("changed.jstree uncheck_node.jstree check_node.jstree uncheck_all.jstree check_all.jstree move_node.jstree copy_node.jstree redraw.jstree open_node.jstree",a.proxy(function(){this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(a.proxy(this._undetermined,this),50)},this)),this.settings.checkbox.tie_selection||this.element.on("model.jstree",a.proxy(function(a,b){var c=this._model.data,d=c[b.parent],e=b.nodes,f,g;for(f=0,g=e.length;g>f;f++)c[e[f]].state.checked=c[e[f]].state.checked||c[e[f]].original&&c[e[f]].original.state&&c[e[f]].original.state.checked,c[e[f]].state.checked&&this._data.checkbox.selected.push(e[f])},this)),(-1!==this.settings.checkbox.cascade.indexOf("up")||-1!==this.settings.checkbox.cascade.indexOf("down"))&&this.element.on("model.jstree",a.proxy(function(b,c){var d=this._model.data,e=d[c.parent],f=c.nodes,g=[],h,i,j,k,l,m,n=this.settings.checkbox.cascade,o=this.settings.checkbox.tie_selection;if(-1!==n.indexOf("down"))if(e.state[o?"selected":"checked"]){for(i=0,j=f.length;j>i;i++)d[f[i]].state[o?"selected":"checked"]=!0;this._data[o?"core":"checkbox"].selected=this._data[o?"core":"checkbox"].selected.concat(f)}else for(i=0,j=f.length;j>i;i++)if(d[f[i]].state[o?"selected":"checked"]){for(k=0,l=d[f[i]].children_d.length;l>k;k++)d[d[f[i]].children_d[k]].state[o?"selected":"checked"]=!0;this._data[o?"core":"checkbox"].selected=this._data[o?"core":"checkbox"].selected.concat(d[f[i]].children_d)}if(-1!==n.indexOf("up")){for(i=0,j=e.children_d.length;j>i;i++)d[e.children_d[i]].children.length||g.push(d[e.children_d[i]].parent);for(g=a.vakata.array_unique(g),k=0,l=g.length;l>k;k++){e=d[g[k]];while(e&&e.id!==a.jstree.root){for(h=0,i=0,j=e.children.length;j>i;i++)h+=d[e.children[i]].state[o?"selected":"checked"];if(h!==j)break;e.state[o?"selected":"checked"]=!0,this._data[o?"core":"checkbox"].selected.push(e.id),m=this.get_node(e,!0),m&&m.length&&m.attr("aria-selected",!0).children(".jstree-anchor").addClass(o?"jstree-clicked":"jstree-checked"),e=this.get_node(e.parent)}}}this._data[o?"core":"checkbox"].selected=a.vakata.array_unique(this._data[o?"core":"checkbox"].selected)},this)).on(this.settings.checkbox.tie_selection?"select_node.jstree":"check_node.jstree",a.proxy(function(b,c){var d=this,e=c.node,f=this._model.data,g=this.get_node(e.parent),h,i,j,k,l=this.settings.checkbox.cascade,m=this.settings.checkbox.tie_selection,n={},o=this._data[m?"core":"checkbox"].selected;for(h=0,i=o.length;i>h;h++)n[o[h]]=!0;if(-1!==l.indexOf("down")){var p=this._cascade_new_checked_state(e.id,!0),q=e.children_d.concat(e.id);for(h=0,i=q.length;i>h;h++)p.indexOf(q[h])>-1?n[q[h]]=!0:delete n[q[h]]}if(-1!==l.indexOf("up"))while(g&&g.id!==a.jstree.root){for(j=0,h=0,i=g.children.length;i>h;h++)j+=f[g.children[h]].state[m?"selected":"checked"];if(j!==i)break;g.state[m?"selected":"checked"]=!0,n[g.id]=!0,k=this.get_node(g,!0),k&&k.length&&k.attr("aria-selected",!0).children(".jstree-anchor").addClass(m?"jstree-clicked":"jstree-checked"),g=this.get_node(g.parent)}o=[];for(h in n)n.hasOwnProperty(h)&&o.push(h);this._data[m?"core":"checkbox"].selected=o},this)).on(this.settings.checkbox.tie_selection?"deselect_all.jstree":"uncheck_all.jstree",a.proxy(function(b,c){var d=this.get_node(a.jstree.root),e=this._model.data,f,g,h;for(f=0,g=d.children_d.length;g>f;f++)h=e[d.children_d[f]],h&&h.original&&h.original.state&&h.original.state.undetermined&&(h.original.state.undetermined=!1)},this)).on(this.settings.checkbox.tie_selection?"deselect_node.jstree":"uncheck_node.jstree",a.proxy(function(a,b){var c=this,d=b.node,e=this.get_node(d,!0),f,g,h,i=this.settings.checkbox.cascade,j=this.settings.checkbox.tie_selection,k=this._data[j?"core":"checkbox"].selected,l={},m=[],n=d.children_d.concat(d.id);if(-1!==i.indexOf("down")){var o=this._cascade_new_checked_state(d.id,!1);k=k.filter(function(a){return-1===n.indexOf(a)||o.indexOf(a)>-1})}if(-1!==i.indexOf("up")&&-1===k.indexOf(d.id)){for(f=0,g=d.parents.length;g>f;f++)h=this._model.data[d.parents[f]],h.state[j?"selected":"checked"]=!1,h&&h.original&&h.original.state&&h.original.state.undetermined&&(h.original.state.undetermined=!1),h=this.get_node(d.parents[f],!0),h&&h.length&&h.attr("aria-selected",!1).children(".jstree-anchor").removeClass(j?"jstree-clicked":"jstree-checked");k=k.filter(function(a){return-1===d.parents.indexOf(a)})}this._data[j?"core":"checkbox"].selected=k},this)),-1!==this.settings.checkbox.cascade.indexOf("up")&&this.element.on("delete_node.jstree",a.proxy(function(b,c){var d=this.get_node(c.parent),e=this._model.data,f,g,h,i,j=this.settings.checkbox.tie_selection;while(d&&d.id!==a.jstree.root&&!d.state[j?"selected":"checked"]){for(h=0,f=0,g=d.children.length;g>f;f++)h+=e[d.children[f]].state[j?"selected":"checked"];if(!(g>0&&h===g))break;d.state[j?"selected":"checked"]=!0,this._data[j?"core":"checkbox"].selected.push(d.id),i=this.get_node(d,!0),i&&i.length&&i.attr("aria-selected",!0).children(".jstree-anchor").addClass(j?"jstree-clicked":"jstree-checked"),d=this.get_node(d.parent)}},this)).on("move_node.jstree",a.proxy(function(b,c){var d=c.is_multi,e=c.old_parent,f=this.get_node(c.parent),g=this._model.data,h,i,j,k,l,m=this.settings.checkbox.tie_selection;if(!d){h=this.get_node(e);while(h&&h.id!==a.jstree.root&&!h.state[m?"selected":"checked"]){for(i=0,j=0,k=h.children.length;k>j;j++)i+=g[h.children[j]].state[m?"selected":"checked"];if(!(k>0&&i===k))break;h.state[m?"selected":"checked"]=!0,this._data[m?"core":"checkbox"].selected.push(h.id),l=this.get_node(h,!0),l&&l.length&&l.attr("aria-selected",!0).children(".jstree-anchor").addClass(m?"jstree-clicked":"jstree-checked"),h=this.get_node(h.parent)}}h=f;while(h&&h.id!==a.jstree.root){for(i=0,j=0,k=h.children.length;k>j;j++)i+=g[h.children[j]].state[m?"selected":"checked"];if(i===k)h.state[m?"selected":"checked"]||(h.state[m?"selected":"checked"]=!0,this._data[m?"core":"checkbox"].selected.push(h.id),l=this.get_node(h,!0),l&&l.length&&l.attr("aria-selected",!0).children(".jstree-anchor").addClass(m?"jstree-clicked":"jstree-checked"));else{if(!h.state[m?"selected":"checked"])break;h.state[m?"selected":"checked"]=!1,this._data[m?"core":"checkbox"].selected=a.vakata.array_remove_item(this._data[m?"core":"checkbox"].selected,h.id),l=this.get_node(h,!0),l&&l.length&&l.attr("aria-selected",!1).children(".jstree-anchor").removeClass(m?"jstree-clicked":"jstree-checked")}h=this.get_node(h.parent)}},this))},this.get_undetermined=function(c){if(-1===this.settings.checkbox.cascade.indexOf("undetermined"))return[];var d,e,f,g,h={},i=this._model.data,j=this.settings.checkbox.tie_selection,k=this._data[j?"core":"checkbox"].selected,l=[],m=this,n=[];for(d=0,e=k.length;e>d;d++)if(i[k[d]]&&i[k[d]].parents)for(f=0,g=i[k[d]].parents.length;g>f;f++){if(h[i[k[d]].parents[f]]!==b)break;i[k[d]].parents[f]!==a.jstree.root&&(h[i[k[d]].parents[f]]=!0,l.push(i[k[d]].parents[f]))}for(this.element.find(".jstree-closed").not(":has(.jstree-children)").each(function(){var c=m.get_node(this),j;if(c)if(c.state.loaded){for(d=0,e=c.children_d.length;e>d;d++)if(j=i[c.children_d[d]],!j.state.loaded&&j.original&&j.original.state&&j.original.state.undetermined&&j.original.state.undetermined===!0)for(h[j.id]===b&&j.id!==a.jstree.root&&(h[j.id]=!0,l.push(j.id)),f=0,g=j.parents.length;g>f;f++)h[j.parents[f]]===b&&j.parents[f]!==a.jstree.root&&(h[j.parents[f]]=!0,l.push(j.parents[f]))}else if(c.original&&c.original.state&&c.original.state.undetermined&&c.original.state.undetermined===!0)for(h[c.id]===b&&c.id!==a.jstree.root&&(h[c.id]=!0,l.push(c.id)),f=0,g=c.parents.length;g>f;f++)h[c.parents[f]]===b&&c.parents[f]!==a.jstree.root&&(h[c.parents[f]]=!0,l.push(c.parents[f]))}),d=0,e=l.length;e>d;d++)i[l[d]].state[j?"selected":"checked"]||n.push(c?i[l[d]]:l[d]);return n},this._undetermined=function(){if(null!==this.element){var a=this.get_undetermined(!1),b,c,d;for(this.element.find(".jstree-undetermined").removeClass("jstree-undetermined"),b=0,c=a.length;c>b;b++)d=this.get_node(a[b],!0),d&&d.length&&d.children(".jstree-anchor").children(".jstree-checkbox").addClass("jstree-undetermined")}},this.redraw_node=function(b,c,e,f){if(b=d.redraw_node.apply(this,arguments)){var g,h,i=null,k=null;for(g=0,h=b.childNodes.length;h>g;g++)if(b.childNodes[g]&&b.childNodes[g].className&&-1!==b.childNodes[g].className.indexOf("jstree-anchor")){i=b.childNodes[g];break}i&&(!this.settings.checkbox.tie_selection&&this._model.data[b.id].state.checked&&(i.className+=" jstree-checked"),k=j.cloneNode(!1),this._model.data[b.id].state.checkbox_disabled&&(k.className+=" jstree-checkbox-disabled"),i.insertBefore(k,i.childNodes[0]))}return e||-1===this.settings.checkbox.cascade.indexOf("undetermined")||(this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(a.proxy(this._undetermined,this),50)),b},this.show_checkboxes=function(){this._data.core.themes.checkboxes=!0,this.get_container_ul().removeClass("jstree-no-checkboxes")},this.hide_checkboxes=function(){this._data.core.themes.checkboxes=!1,this.get_container_ul().addClass("jstree-no-checkboxes")},this.toggle_checkboxes=function(){this._data.core.themes.checkboxes?this.hide_checkboxes():this.show_checkboxes()},this.is_undetermined=function(b){b=this.get_node(b);var c=this.settings.checkbox.cascade,d,e,f=this.settings.checkbox.tie_selection,g=this._data[f?"core":"checkbox"].selected,h=this._model.data;if(!b||b.state[f?"selected":"checked"]===!0||-1===c.indexOf("undetermined")||-1===c.indexOf("down")&&-1===c.indexOf("up"))return!1;if(!b.state.loaded&&b.original.state.undetermined===!0)return!0;for(d=0,e=b.children_d.length;e>d;d++)if(-1!==a.inArray(b.children_d[d],g)||!h[b.children_d[d]].state.loaded&&h[b.children_d[d]].original.state.undetermined)return!0;return!1},this.disable_checkbox=function(b){var c,d,e;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.disable_checkbox(b[c]);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(e=this.get_node(b,!0),void(b.state.checkbox_disabled||(b.state.checkbox_disabled=!0,e&&e.length&&e.children(".jstree-anchor").children(".jstree-checkbox").addClass("jstree-checkbox-disabled"),this.trigger("disable_checkbox",{node:b})))):!1},this.enable_checkbox=function(b){var c,d,e;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.enable_checkbox(b[c]);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(e=this.get_node(b,!0),void(b.state.checkbox_disabled&&(b.state.checkbox_disabled=!1,e&&e.length&&e.children(".jstree-anchor").children(".jstree-checkbox").removeClass("jstree-checkbox-disabled"),this.trigger("enable_checkbox",{node:b})))):!1},this.activate_node=function(b,c){return a(c.target).hasClass("jstree-checkbox-disabled")?!1:(this.settings.checkbox.tie_selection&&(this.settings.checkbox.whole_node||a(c.target).hasClass("jstree-checkbox"))&&(c.ctrlKey=!0),this.settings.checkbox.tie_selection||!this.settings.checkbox.whole_node&&!a(c.target).hasClass("jstree-checkbox")?d.activate_node.call(this,b,c):this.is_disabled(b)?!1:(this.is_checked(b)?this.uncheck_node(b,c):this.check_node(b,c),void this.trigger("activate_node",{node:this.get_node(b)})))},this._cascade_new_checked_state=function(a,b){var c=this,d=this.settings.checkbox.tie_selection,e=this._model.data[a],f=[],g=[],h,i,j;if(!this.settings.checkbox.cascade_to_disabled&&e.state.disabled||!this.settings.checkbox.cascade_to_hidden&&e.state.hidden)j=this.get_checked_descendants(a),e.state[d?"selected":"checked"]&&j.push(e.id),f=f.concat(j);else{if(e.children)for(h=0,i=e.children.length;i>h;h++){var k=e.children[h];j=c._cascade_new_checked_state(k,b),f=f.concat(j),j.indexOf(k)>-1&&g.push(k)}var l=c.get_node(e,!0),m=g.length>0&&g.length<e.children.length;e.original&&e.original.state&&e.original.state.undetermined&&(e.original.state.undetermined=m),m?(e.state[d?"selected":"checked"]=!1,l.attr("aria-selected",!1).children(".jstree-anchor").removeClass(d?"jstree-clicked":"jstree-checked")):b&&g.length===e.children.length?(e.state[d?"selected":"checked"]=b,f.push(e.id),l.attr("aria-selected",!0).children(".jstree-anchor").addClass(d?"jstree-clicked":"jstree-checked")):(e.state[d?"selected":"checked"]=!1,l.attr("aria-selected",!1).children(".jstree-anchor").removeClass(d?"jstree-clicked":"jstree-checked"))}return f},this.get_checked_descendants=function(a){var b=this,c=b.settings.checkbox.tie_selection,d=b._model.data[a];return d.children_d.filter(function(a){return b._model.data[a].state[c?"selected":"checked"]})},this.check_node=function(b,c){if(this.settings.checkbox.tie_selection)return this.select_node(b,!1,!0,c);var d,e,f,g;if(a.isArray(b)){for(b=b.slice(),e=0,f=b.length;f>e;e++)this.check_node(b[e],c);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(d=this.get_node(b,!0),void(b.state.checked||(b.state.checked=!0,this._data.checkbox.selected.push(b.id),d&&d.length&&d.children(".jstree-anchor").addClass("jstree-checked"),this.trigger("check_node",{node:b,selected:this._data.checkbox.selected,event:c})))):!1},this.uncheck_node=function(b,c){if(this.settings.checkbox.tie_selection)return this.deselect_node(b,!1,c);var d,e,f;if(a.isArray(b)){for(b=b.slice(),d=0,e=b.length;e>d;d++)this.uncheck_node(b[d],c);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(f=this.get_node(b,!0),void(b.state.checked&&(b.state.checked=!1,this._data.checkbox.selected=a.vakata.array_remove_item(this._data.checkbox.selected,b.id),f.length&&f.children(".jstree-anchor").removeClass("jstree-checked"),this.trigger("uncheck_node",{node:b,selected:this._data.checkbox.selected,event:c})))):!1},this.check_all=function(){if(this.settings.checkbox.tie_selection)return this.select_all();var b=this._data.checkbox.selected.concat([]),c,d;for(this._data.checkbox.selected=this._model.data[a.jstree.root].children_d.concat(),c=0,d=this._data.checkbox.selected.length;d>c;c++)this._model.data[this._data.checkbox.selected[c]]&&(this._model.data[this._data.checkbox.selected[c]].state.checked=!0);this.redraw(!0),this.trigger("check_all",{selected:this._data.checkbox.selected})},this.uncheck_all=function(){if(this.settings.checkbox.tie_selection)return this.deselect_all();var a=this._data.checkbox.selected.concat([]),b,c;for(b=0,c=this._data.checkbox.selected.length;c>b;b++)this._model.data[this._data.checkbox.selected[b]]&&(this._model.data[this._data.checkbox.selected[b]].state.checked=!1);this._data.checkbox.selected=[],this.element.find(".jstree-checked").removeClass("jstree-checked"),this.trigger("uncheck_all",{selected:this._data.checkbox.selected,node:a})},this.is_checked=function(b){return this.settings.checkbox.tie_selection?this.is_selected(b):(b=this.get_node(b),b&&b.id!==a.jstree.root?b.state.checked:!1)},this.get_checked=function(b){return this.settings.checkbox.tie_selection?this.get_selected(b):b?a.map(this._data.checkbox.selected,a.proxy(function(a){return this.get_node(a)},this)):this._data.checkbox.selected},this.get_top_checked=function(b){if(this.settings.checkbox.tie_selection)return this.get_top_selected(b);var c=this.get_checked(!0),d={},e,f,g,h;for(e=0,f=c.length;f>e;e++)d[c[e].id]=c[e];for(e=0,f=c.length;f>e;e++)for(g=0,h=c[e].children_d.length;h>g;g++)d[c[e].children_d[g]]&&delete d[c[e].children_d[g]];c=[];for(e in d)d.hasOwnProperty(e)&&c.push(e);return b?a.map(c,a.proxy(function(a){return this.get_node(a)},this)):c},this.get_bottom_checked=function(b){if(this.settings.checkbox.tie_selection)return this.get_bottom_selected(b);var c=this.get_checked(!0),d=[],e,f;for(e=0,f=c.length;f>e;e++)c[e].children.length||d.push(c[e].id);return b?a.map(d,a.proxy(function(a){return this.get_node(a)},this)):d},this.load_node=function(b,c){var e,f,g,h,i,j;if(!a.isArray(b)&&!this.settings.checkbox.tie_selection&&(j=this.get_node(b),j&&j.state.loaded))for(e=0,f=j.children_d.length;f>e;e++)this._model.data[j.children_d[e]].state.checked&&(i=!0,this._data.checkbox.selected=a.vakata.array_remove_item(this._data.checkbox.selected,j.children_d[e]));return d.load_node.apply(this,arguments)},this.get_state=function(){var a=d.get_state.apply(this,arguments);return this.settings.checkbox.tie_selection?a:(a.checkbox=this._data.checkbox.selected.slice(),a)},this.set_state=function(b,c){var e=d.set_state.apply(this,arguments);if(e&&b.checkbox){if(!this.settings.checkbox.tie_selection){this.uncheck_all();var f=this;a.each(b.checkbox,function(a,b){f.check_node(b)})}return delete b.checkbox,this.set_state(b,c),!1}return e},this.refresh=function(a,b){return this.settings.checkbox.tie_selection&&(this._data.checkbox.selected=[]),d.refresh.apply(this,arguments)}},a.jstree.defaults.conditionalselect=function(){return!0},a.jstree.plugins.conditionalselect=function(a,b){this.activate_node=function(a,c){return this.settings.conditionalselect.call(this,this.get_node(a),c)?b.activate_node.call(this,a,c):void 0}},a.jstree.defaults.contextmenu={select_node:!0,show_at_node:!0,items:function(b,c){return{create:{separator_before:!1,separator_after:!0,_disabled:!1,label:"Create",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.create_node(d,{},"last",function(a){try{c.edit(a)}catch(b){setTimeout(function(){c.edit(a)},0)}})}},rename:{separator_before:!1,separator_after:!1,_disabled:!1,label:"Rename",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.edit(d)}},remove:{separator_before:!1,icon:!1,separator_after:!1,_disabled:!1,label:"Delete",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.is_selected(d)?c.delete_node(c.get_selected()):c.delete_node(d)}},ccp:{separator_before:!0,icon:!1,separator_after:!1,label:"Edit",action:!1,submenu:{cut:{separator_before:!1,separator_after:!1,label:"Cut",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.is_selected(d)?c.cut(c.get_top_selected()):c.cut(d)}},copy:{separator_before:!1,icon:!1,separator_after:!1,label:"Copy",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.is_selected(d)?c.copy(c.get_top_selected()):c.copy(d)}},paste:{separator_before:!1,icon:!1,_disabled:function(b){return!a.jstree.reference(b.reference).can_paste()},separator_after:!1,label:"Paste",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.paste(d)}}}}}}},a.jstree.plugins.contextmenu=function(c,d){this.bind=function(){d.bind.call(this);var b=0,c=null,e,f;this.element.on("init.jstree loading.jstree ready.jstree",a.proxy(function(){this.get_container_ul().addClass("jstree-contextmenu")},this)).on("contextmenu.jstree",".jstree-anchor",a.proxy(function(a,d){"input"!==a.target.tagName.toLowerCase()&&(a.preventDefault(),b=a.ctrlKey?+new Date:0,(d||c)&&(b=+new Date+1e4),c&&clearTimeout(c),this.is_loading(a.currentTarget)||this.show_contextmenu(a.currentTarget,a.pageX,a.pageY,a))},this)).on("click.jstree",".jstree-anchor",a.proxy(function(c){this._data.contextmenu.visible&&(!b||+new Date-b>250)&&a.vakata.context.hide(),b=0},this)).on("touchstart.jstree",".jstree-anchor",function(b){b.originalEvent&&b.originalEvent.changedTouches&&b.originalEvent.changedTouches[0]&&(e=b.originalEvent.changedTouches[0].clientX,f=b.originalEvent.changedTouches[0].clientY,c=setTimeout(function(){a(b.currentTarget).trigger("contextmenu",!0)},750))}).on("touchmove.vakata.jstree",function(b){c&&b.originalEvent&&b.originalEvent.changedTouches&&b.originalEvent.changedTouches[0]&&(Math.abs(e-b.originalEvent.changedTouches[0].clientX)>10||Math.abs(f-b.originalEvent.changedTouches[0].clientY)>10)&&(clearTimeout(c),a.vakata.context.hide())}).on("touchend.vakata.jstree",function(a){c&&clearTimeout(c)}),a(i).on("context_hide.vakata.jstree",a.proxy(function(b,c){this._data.contextmenu.visible=!1,a(c.reference).removeClass("jstree-context")},this))},this.teardown=function(){this._data.contextmenu.visible&&a.vakata.context.hide(),d.teardown.call(this)},this.show_contextmenu=function(c,d,e,f){if(c=this.get_node(c),!c||c.id===a.jstree.root)return!1;var g=this.settings.contextmenu,h=this.get_node(c,!0),i=h.children(".jstree-anchor"),j=!1,k=!1;(g.show_at_node||d===b||e===b)&&(j=i.offset(),d=j.left,e=j.top+this._data.core.li_height),this.settings.contextmenu.select_node&&!this.is_selected(c)&&this.activate_node(c,f),k=g.items,a.isFunction(k)&&(k=k.call(this,c,a.proxy(function(a){this._show_contextmenu(c,d,e,a)},this))),a.isPlainObject(k)&&this._show_contextmenu(c,d,e,k)},this._show_contextmenu=function(b,c,d,e){var f=this.get_node(b,!0),g=f.children(".jstree-anchor");a(i).one("context_show.vakata.jstree",a.proxy(function(b,c){var d="jstree-contextmenu jstree-"+this.get_theme()+"-contextmenu";a(c.element).addClass(d),g.addClass("jstree-context")},this)),this._data.contextmenu.visible=!0,a.vakata.context.show(g,{x:c,y:d},e),this.trigger("show_contextmenu",{node:b,x:c,y:d})}},function(a){var b=!1,c={element:!1,reference:!1,position_x:0,position_y:0,items:[],html:"",is_visible:!1};a.vakata.context={settings:{hide_onmouseleave:0,icons:!0},_trigger:function(b){a(i).triggerHandler("context_"+b+".vakata",{reference:c.reference,element:c.element,position:{x:c.position_x,y:c.position_y}})},_execute:function(b){return b=c.items[b],b&&(!b._disabled||a.isFunction(b._disabled)&&!b._disabled({item:b,reference:c.reference,element:c.element}))&&b.action?b.action.call(null,{item:b,reference:c.reference,element:c.element,position:{x:c.position_x,y:c.position_y}}):!1},_parse:function(b,d){if(!b)return!1;d||(c.html="",c.items=[]);var e="",f=!1,g;return d&&(e+="<ul>"),a.each(b,function(b,d){return d?(c.items.push(d),!f&&d.separator_before&&(e+="<li class='vakata-context-separator'><a href='#' "+(a.vakata.context.settings.icons?"":'style="margin-left:0px;"')+">&#160;</a></li>"),f=!1,e+="<li class='"+(d._class||"")+(d._disabled===!0||a.isFunction(d._disabled)&&d._disabled({item:d,reference:c.reference,element:c.element})?" vakata-contextmenu-disabled ":"")+"' "+(d.shortcut?" data-shortcut='"+d.shortcut+"' ":"")+">",e+="<a href='#' rel='"+(c.items.length-1)+"' "+(d.title?"title='"+d.title+"'":"")+">",a.vakata.context.settings.icons&&(e+="<i ",d.icon&&(e+=-1!==d.icon.indexOf("/")||-1!==d.icon.indexOf(".")?" style='background:url(\""+d.icon+"\") center center no-repeat' ":" class='"+d.icon+"' "),e+="></i><span class='vakata-contextmenu-sep'>&#160;</span>"),e+=(a.isFunction(d.label)?d.label({item:b,reference:c.reference,element:c.element}):d.label)+(d.shortcut?' <span class="vakata-contextmenu-shortcut vakata-contextmenu-shortcut-'+d.shortcut+'">'+(d.shortcut_label||"")+"</span>":"")+"</a>",
5
- d.submenu&&(g=a.vakata.context._parse(d.submenu,!0),g&&(e+=g)),e+="</li>",void(d.separator_after&&(e+="<li class='vakata-context-separator'><a href='#' "+(a.vakata.context.settings.icons?"":'style="margin-left:0px;"')+">&#160;</a></li>",f=!0))):!0}),e=e.replace(/<li class\='vakata-context-separator'\><\/li\>$/,""),d&&(e+="</ul>"),d||(c.html=e,a.vakata.context._trigger("parse")),e.length>10?e:!1},_show_submenu:function(c){if(c=a(c),c.length&&c.children("ul").length){var d=c.children("ul"),e=c.offset().left,f=e+c.outerWidth(),g=c.offset().top,h=d.width(),i=d.height(),j=a(window).width()+a(window).scrollLeft(),k=a(window).height()+a(window).scrollTop();b?c[f-(h+10+c.outerWidth())<0?"addClass":"removeClass"]("vakata-context-left"):c[f+h>j&&e>j-f?"addClass":"removeClass"]("vakata-context-right"),g+i+10>k&&d.css("bottom","-1px"),c.hasClass("vakata-context-right")?h>e&&d.css("margin-right",e-h):h>j-f&&d.css("margin-left",j-f-h),d.show()}},show:function(d,e,f){var g,h,j,k,l,m,n,o,p=!0;switch(c.element&&c.element.length&&c.element.width(""),p){case!e&&!d:return!1;case!!e&&!!d:c.reference=d,c.position_x=e.x,c.position_y=e.y;break;case!e&&!!d:c.reference=d,g=d.offset(),c.position_x=g.left+d.outerHeight(),c.position_y=g.top;break;case!!e&&!d:c.position_x=e.x,c.position_y=e.y}d&&!f&&a(d).data("vakata_contextmenu")&&(f=a(d).data("vakata_contextmenu")),a.vakata.context._parse(f)&&c.element.html(c.html),c.items.length&&(c.element.appendTo(i.body),h=c.element,j=c.position_x,k=c.position_y,l=h.width(),m=h.height(),n=a(window).width()+a(window).scrollLeft(),o=a(window).height()+a(window).scrollTop(),b&&(j-=h.outerWidth()-a(d).outerWidth(),j<a(window).scrollLeft()+20&&(j=a(window).scrollLeft()+20)),j+l+20>n&&(j=n-(l+20)),k+m+20>o&&(k=o-(m+20)),c.element.css({left:j,top:k}).show().find("a").first().focus().parent().addClass("vakata-context-hover"),c.is_visible=!0,a.vakata.context._trigger("show"))},hide:function(){c.is_visible&&(c.element.hide().find("ul").hide().end().find(":focus").blur().end().detach(),c.is_visible=!1,a.vakata.context._trigger("hide"))}},a(function(){b="rtl"===a(i.body).css("direction");var d=!1;c.element=a("<ul class='vakata-context'></ul>"),c.element.on("mouseenter","li",function(b){b.stopImmediatePropagation(),a.contains(this,b.relatedTarget)||(d&&clearTimeout(d),c.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(),a(this).siblings().find("ul").hide().end().end().parentsUntil(".vakata-context","li").addBack().addClass("vakata-context-hover"),a.vakata.context._show_submenu(this))}).on("mouseleave","li",function(b){a.contains(this,b.relatedTarget)||a(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover")}).on("mouseleave",function(b){a(this).find(".vakata-context-hover").removeClass("vakata-context-hover"),a.vakata.context.settings.hide_onmouseleave&&(d=setTimeout(function(b){return function(){a.vakata.context.hide()}}(this),a.vakata.context.settings.hide_onmouseleave))}).on("click","a",function(b){b.preventDefault(),a(this).blur().parent().hasClass("vakata-context-disabled")||a.vakata.context._execute(a(this).attr("rel"))===!1||a.vakata.context.hide()}).on("keydown","a",function(b){var d=null;switch(b.which){case 13:case 32:b.type="click",b.preventDefault(),a(b.currentTarget).trigger(b);break;case 37:c.is_visible&&(c.element.find(".vakata-context-hover").last().closest("li").first().find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children("a").focus(),b.stopImmediatePropagation(),b.preventDefault());break;case 38:c.is_visible&&(d=c.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first(),d.length||(d=c.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last()),d.addClass("vakata-context-hover").children("a").focus(),b.stopImmediatePropagation(),b.preventDefault());break;case 39:c.is_visible&&(c.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children("a").focus(),b.stopImmediatePropagation(),b.preventDefault());break;case 40:c.is_visible&&(d=c.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first(),d.length||(d=c.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first()),d.addClass("vakata-context-hover").children("a").focus(),b.stopImmediatePropagation(),b.preventDefault());break;case 27:a.vakata.context.hide(),b.preventDefault()}}).on("keydown",function(a){a.preventDefault();var b=c.element.find(".vakata-contextmenu-shortcut-"+a.which).parent();b.parent().not(".vakata-context-disabled")&&b.click()}),a(i).on("mousedown.vakata.jstree",function(b){c.is_visible&&c.element[0]!==b.target&&!a.contains(c.element[0],b.target)&&a.vakata.context.hide()}).on("context_show.vakata.jstree",function(a,d){c.element.find("li:has(ul)").children("a").addClass("vakata-context-parent"),b&&c.element.addClass("vakata-context-rtl").css("direction","rtl"),c.element.find("ul").hide().end()})})}(a),a.jstree.defaults.dnd={copy:!0,open_timeout:500,is_draggable:!0,check_while_dragging:!0,always_copy:!1,inside_pos:0,drag_selection:!0,touch:!0,large_drop_target:!1,large_drag_target:!1,use_html5:!1};var k,l;a.jstree.plugins.dnd=function(b,c){this.init=function(a,b){c.init.call(this,a,b),this.settings.dnd.use_html5=this.settings.dnd.use_html5&&"draggable"in i.createElement("span")},this.bind=function(){c.bind.call(this),this.element.on(this.settings.dnd.use_html5?"dragstart.jstree":"mousedown.jstree touchstart.jstree",this.settings.dnd.large_drag_target?".jstree-node":".jstree-anchor",a.proxy(function(b){if(this.settings.dnd.large_drag_target&&a(b.target).closest(".jstree-node")[0]!==b.currentTarget)return!0;if("touchstart"===b.type&&(!this.settings.dnd.touch||"selected"===this.settings.dnd.touch&&!a(b.currentTarget).closest(".jstree-node").children(".jstree-anchor").hasClass("jstree-clicked")))return!0;var c=this.get_node(b.target),d=this.is_selected(c)&&this.settings.dnd.drag_selection?this.get_top_selected().length:1,e=d>1?d+" "+this.get_string("nodes"):this.get_text(b.currentTarget);if(this.settings.core.force_text&&(e=a.vakata.html.escape(e)),c&&c.id&&c.id!==a.jstree.root&&(1===b.which||"touchstart"===b.type||"dragstart"===b.type)&&(this.settings.dnd.is_draggable===!0||a.isFunction(this.settings.dnd.is_draggable)&&this.settings.dnd.is_draggable.call(this,d>1?this.get_top_selected(!0):[c],b))){if(k={jstree:!0,origin:this,obj:this.get_node(c,!0),nodes:d>1?this.get_top_selected():[c.id]},l=b.currentTarget,!this.settings.dnd.use_html5)return this.element.trigger("mousedown.jstree"),a.vakata.dnd.start(b,k,'<div id="jstree-dnd" class="jstree-'+this.get_theme()+" jstree-"+this.get_theme()+"-"+this.get_theme_variant()+" "+(this.settings.core.themes.responsive?" jstree-dnd-responsive":"")+'"><i class="jstree-icon jstree-er"></i>'+e+'<ins class="jstree-copy" style="display:none;">+</ins></div>');a.vakata.dnd._trigger("start",b,{helper:a(),element:l,data:k})}},this)),this.settings.dnd.use_html5&&this.element.on("dragover.jstree",function(b){return b.preventDefault(),a.vakata.dnd._trigger("move",b,{helper:a(),element:l,data:k}),!1}).on("drop.jstree",a.proxy(function(b){return b.preventDefault(),a.vakata.dnd._trigger("stop",b,{helper:a(),element:l,data:k}),!1},this))},this.redraw_node=function(a,b,d,e){if(a=c.redraw_node.apply(this,arguments),a&&this.settings.dnd.use_html5)if(this.settings.dnd.large_drag_target)a.setAttribute("draggable",!0);else{var f,g,h=null;for(f=0,g=a.childNodes.length;g>f;f++)if(a.childNodes[f]&&a.childNodes[f].className&&-1!==a.childNodes[f].className.indexOf("jstree-anchor")){h=a.childNodes[f];break}h&&h.setAttribute("draggable",!0)}return a}},a(function(){var c=!1,d=!1,e=!1,f=!1,g=a('<div id="jstree-marker">&#160;</div>').hide();a(i).on("dragover.vakata.jstree",function(b){l&&a.vakata.dnd._trigger("move",b,{helper:a(),element:l,data:k})}).on("drop.vakata.jstree",function(b){l&&(a.vakata.dnd._trigger("stop",b,{helper:a(),element:l,data:k}),l=null,k=null)}).on("dnd_start.vakata.jstree",function(a,b){c=!1,e=!1,b&&b.data&&b.data.jstree&&g.appendTo(i.body)}).on("dnd_move.vakata.jstree",function(h,i){var j=i.event.target!==e.target;if(f&&(!i.event||"dragover"!==i.event.type||j)&&clearTimeout(f),i&&i.data&&i.data.jstree&&(!i.event.target.id||"jstree-marker"!==i.event.target.id)){e=i.event;var k=a.jstree.reference(i.event.target),l=!1,m=!1,n=!1,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E;if(k&&k._data&&k._data.dnd)if(g.attr("class","jstree-"+k.get_theme()+(k.settings.core.themes.responsive?" jstree-dnd-responsive":"")),D=i.data.origin&&(i.data.origin.settings.dnd.always_copy||i.data.origin.settings.dnd.copy&&(i.event.metaKey||i.event.ctrlKey)),i.helper.children().attr("class","jstree-"+k.get_theme()+" jstree-"+k.get_theme()+"-"+k.get_theme_variant()+" "+(k.settings.core.themes.responsive?" jstree-dnd-responsive":"")).find(".jstree-copy").first()[D?"show":"hide"](),i.event.target!==k.element[0]&&i.event.target!==k.get_container_ul()[0]||0!==k.get_container_ul().children().length){if(l=k.settings.dnd.large_drop_target?a(i.event.target).closest(".jstree-node").children(".jstree-anchor"):a(i.event.target).closest(".jstree-anchor"),l&&l.length&&l.parent().is(".jstree-closed, .jstree-open, .jstree-leaf")&&(m=l.offset(),n=(i.event.pageY!==b?i.event.pageY:i.event.originalEvent.pageY)-m.top,r=l.outerHeight(),u=r/3>n?["b","i","a"]:n>r-r/3?["a","i","b"]:n>r/2?["i","a","b"]:["i","b","a"],a.each(u,function(b,e){switch(e){case"b":p=m.left-6,q=m.top,s=k.get_parent(l),t=l.parent().index();break;case"i":B=k.settings.dnd.inside_pos,C=k.get_node(l.parent()),p=m.left-2,q=m.top+r/2+1,s=C.id,t="first"===B?0:"last"===B?C.children.length:Math.min(B,C.children.length);break;case"a":p=m.left-6,q=m.top+r,s=k.get_parent(l),t=l.parent().index()+1}for(v=!0,w=0,x=i.data.nodes.length;x>w;w++)if(y=i.data.origin&&(i.data.origin.settings.dnd.always_copy||i.data.origin.settings.dnd.copy&&(i.event.metaKey||i.event.ctrlKey))?"copy_node":"move_node",z=t,"move_node"===y&&"a"===e&&i.data.origin&&i.data.origin===k&&s===k.get_parent(i.data.nodes[w])&&(A=k.get_node(s),z>a.inArray(i.data.nodes[w],A.children)&&(z-=1)),v=v&&(k&&k.settings&&k.settings.dnd&&k.settings.dnd.check_while_dragging===!1||k.check(y,i.data.origin&&i.data.origin!==k?i.data.origin.get_node(i.data.nodes[w]):i.data.nodes[w],s,z,{dnd:!0,ref:k.get_node(l.parent()),pos:e,origin:i.data.origin,is_multi:i.data.origin&&i.data.origin!==k,is_foreign:!i.data.origin})),!v){k&&k.last_error&&(d=k.last_error());break}return"i"===e&&l.parent().is(".jstree-closed")&&k.settings.dnd.open_timeout&&(!i.event||"dragover"!==i.event.type||j)&&(f&&clearTimeout(f),f=setTimeout(function(a,b){return function(){a.open_node(b)}}(k,l),k.settings.dnd.open_timeout)),v?(E=k.get_node(s,!0),E.hasClass(".jstree-dnd-parent")||(a(".jstree-dnd-parent").removeClass("jstree-dnd-parent"),E.addClass("jstree-dnd-parent")),c={ins:k,par:s,pos:"i"!==e||"last"!==B||0!==t||k.is_loaded(C)?t:"last"},g.css({left:p+"px",top:q+"px"}).show(),i.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok"),i.event.originalEvent&&i.event.originalEvent.dataTransfer&&(i.event.originalEvent.dataTransfer.dropEffect=D?"copy":"move"),d={},u=!0,!1):void 0}),u===!0))return}else{for(v=!0,w=0,x=i.data.nodes.length;x>w;w++)if(v=v&&k.check(i.data.origin&&(i.data.origin.settings.dnd.always_copy||i.data.origin.settings.dnd.copy&&(i.event.metaKey||i.event.ctrlKey))?"copy_node":"move_node",i.data.origin&&i.data.origin!==k?i.data.origin.get_node(i.data.nodes[w]):i.data.nodes[w],a.jstree.root,"last",{dnd:!0,ref:k.get_node(a.jstree.root),pos:"i",origin:i.data.origin,is_multi:i.data.origin&&i.data.origin!==k,is_foreign:!i.data.origin}),!v)break;if(v)return c={ins:k,par:a.jstree.root,pos:"last"},g.hide(),i.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok"),void(i.event.originalEvent&&i.event.originalEvent.dataTransfer&&(i.event.originalEvent.dataTransfer.dropEffect=D?"copy":"move"))}a(".jstree-dnd-parent").removeClass("jstree-dnd-parent"),c=!1,i.helper.find(".jstree-icon").removeClass("jstree-ok").addClass("jstree-er"),i.event.originalEvent&&i.event.originalEvent.dataTransfer,g.hide()}}).on("dnd_scroll.vakata.jstree",function(a,b){b&&b.data&&b.data.jstree&&(g.hide(),c=!1,e=!1,b.helper.find(".jstree-icon").first().removeClass("jstree-ok").addClass("jstree-er"))}).on("dnd_stop.vakata.jstree",function(b,h){if(a(".jstree-dnd-parent").removeClass("jstree-dnd-parent"),f&&clearTimeout(f),h&&h.data&&h.data.jstree){g.hide().detach();var i,j,k=[];if(c){for(i=0,j=h.data.nodes.length;j>i;i++)k[i]=h.data.origin?h.data.origin.get_node(h.data.nodes[i]):h.data.nodes[i];c.ins[h.data.origin&&(h.data.origin.settings.dnd.always_copy||h.data.origin.settings.dnd.copy&&(h.event.metaKey||h.event.ctrlKey))?"copy_node":"move_node"](k,c.par,c.pos,!1,!1,!1,h.data.origin)}else i=a(h.event.target).closest(".jstree"),i.length&&d&&d.error&&"check"===d.error&&(i=i.jstree(!0),i&&i.settings.core.error.call(this,d));e=!1,c=!1}}).on("keyup.jstree keydown.jstree",function(b,h){h=a.vakata.dnd._get(),h&&h.data&&h.data.jstree&&("keyup"===b.type&&27===b.which?(f&&clearTimeout(f),c=!1,d=!1,e=!1,f=!1,g.hide().detach(),a.vakata.dnd._clean()):(h.helper.find(".jstree-copy").first()[h.data.origin&&(h.data.origin.settings.dnd.always_copy||h.data.origin.settings.dnd.copy&&(b.metaKey||b.ctrlKey))?"show":"hide"](),e&&(e.metaKey=b.metaKey,e.ctrlKey=b.ctrlKey,a.vakata.dnd._trigger("move",e))))})}),function(a){a.vakata.html={div:a("<div />"),escape:function(b){return a.vakata.html.div.text(b).html()},strip:function(b){return a.vakata.html.div.empty().append(a.parseHTML(b)).text()}};var c={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1};a.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5,threshold_touch:10},_trigger:function(c,d,e){e===b&&(e=a.vakata.dnd._get()),e.event=d,a(i).triggerHandler("dnd_"+c+".vakata",e)},_get:function(){return{data:c.data,element:c.element,helper:c.helper}},_clean:function(){c.helper&&c.helper.remove(),c.scroll_i&&(clearInterval(c.scroll_i),c.scroll_i=!1),c={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1},a(i).off("mousemove.vakata.jstree touchmove.vakata.jstree",a.vakata.dnd.drag),a(i).off("mouseup.vakata.jstree touchend.vakata.jstree",a.vakata.dnd.stop)},_scroll:function(b){if(!c.scroll_e||!c.scroll_l&&!c.scroll_t)return c.scroll_i&&(clearInterval(c.scroll_i),c.scroll_i=!1),!1;if(!c.scroll_i)return c.scroll_i=setInterval(a.vakata.dnd._scroll,100),!1;if(b===!0)return!1;var d=c.scroll_e.scrollTop(),e=c.scroll_e.scrollLeft();c.scroll_e.scrollTop(d+c.scroll_t*a.vakata.dnd.settings.scroll_speed),c.scroll_e.scrollLeft(e+c.scroll_l*a.vakata.dnd.settings.scroll_speed),(d!==c.scroll_e.scrollTop()||e!==c.scroll_e.scrollLeft())&&a.vakata.dnd._trigger("scroll",c.scroll_e)},start:function(b,d,e){"touchstart"===b.type&&b.originalEvent&&b.originalEvent.changedTouches&&b.originalEvent.changedTouches[0]&&(b.pageX=b.originalEvent.changedTouches[0].pageX,b.pageY=b.originalEvent.changedTouches[0].pageY,b.target=i.elementFromPoint(b.originalEvent.changedTouches[0].pageX-window.pageXOffset,b.originalEvent.changedTouches[0].pageY-window.pageYOffset)),c.is_drag&&a.vakata.dnd.stop({});try{b.currentTarget.unselectable="on",b.currentTarget.onselectstart=function(){return!1},b.currentTarget.style&&(b.currentTarget.style.touchAction="none",b.currentTarget.style.msTouchAction="none",b.currentTarget.style.MozUserSelect="none")}catch(f){}return c.init_x=b.pageX,c.init_y=b.pageY,c.data=d,c.is_down=!0,c.element=b.currentTarget,c.target=b.target,c.is_touch="touchstart"===b.type,e!==!1&&(c.helper=a("<div id='vakata-dnd'></div>").html(e).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),a(i).on("mousemove.vakata.jstree touchmove.vakata.jstree",a.vakata.dnd.drag),a(i).on("mouseup.vakata.jstree touchend.vakata.jstree",a.vakata.dnd.stop),!1},drag:function(b){if("touchmove"===b.type&&b.originalEvent&&b.originalEvent.changedTouches&&b.originalEvent.changedTouches[0]&&(b.pageX=b.originalEvent.changedTouches[0].pageX,b.pageY=b.originalEvent.changedTouches[0].pageY,b.target=i.elementFromPoint(b.originalEvent.changedTouches[0].pageX-window.pageXOffset,b.originalEvent.changedTouches[0].pageY-window.pageYOffset)),c.is_down){if(!c.is_drag){if(!(Math.abs(b.pageX-c.init_x)>(c.is_touch?a.vakata.dnd.settings.threshold_touch:a.vakata.dnd.settings.threshold)||Math.abs(b.pageY-c.init_y)>(c.is_touch?a.vakata.dnd.settings.threshold_touch:a.vakata.dnd.settings.threshold)))return;c.helper&&(c.helper.appendTo(i.body),c.helper_w=c.helper.outerWidth()),c.is_drag=!0,a(c.target).one("click.vakata",!1),a.vakata.dnd._trigger("start",b)}var d=!1,e=!1,f=!1,g=!1,h=!1,j=!1,k=!1,l=!1,m=!1,n=!1;return c.scroll_t=0,c.scroll_l=0,c.scroll_e=!1,a(a(b.target).parentsUntil("body").addBack().get().reverse()).filter(function(){return/^auto|scroll$/.test(a(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var d=a(this),e=d.offset();return this.scrollHeight>this.offsetHeight&&(e.top+d.height()-b.pageY<a.vakata.dnd.settings.scroll_proximity&&(c.scroll_t=1),b.pageY-e.top<a.vakata.dnd.settings.scroll_proximity&&(c.scroll_t=-1)),this.scrollWidth>this.offsetWidth&&(e.left+d.width()-b.pageX<a.vakata.dnd.settings.scroll_proximity&&(c.scroll_l=1),b.pageX-e.left<a.vakata.dnd.settings.scroll_proximity&&(c.scroll_l=-1)),c.scroll_t||c.scroll_l?(c.scroll_e=a(this),!1):void 0}),c.scroll_e||(d=a(i),e=a(window),f=d.height(),g=e.height(),h=d.width(),j=e.width(),k=d.scrollTop(),l=d.scrollLeft(),f>g&&b.pageY-k<a.vakata.dnd.settings.scroll_proximity&&(c.scroll_t=-1),f>g&&g-(b.pageY-k)<a.vakata.dnd.settings.scroll_proximity&&(c.scroll_t=1),h>j&&b.pageX-l<a.vakata.dnd.settings.scroll_proximity&&(c.scroll_l=-1),h>j&&j-(b.pageX-l)<a.vakata.dnd.settings.scroll_proximity&&(c.scroll_l=1),(c.scroll_t||c.scroll_l)&&(c.scroll_e=d)),c.scroll_e&&a.vakata.dnd._scroll(!0),c.helper&&(m=parseInt(b.pageY+a.vakata.dnd.settings.helper_top,10),n=parseInt(b.pageX+a.vakata.dnd.settings.helper_left,10),f&&m+25>f&&(m=f-50),h&&n+c.helper_w>h&&(n=h-(c.helper_w+2)),c.helper.css({left:n+"px",top:m+"px"})),a.vakata.dnd._trigger("move",b),!1}},stop:function(b){if("touchend"===b.type&&b.originalEvent&&b.originalEvent.changedTouches&&b.originalEvent.changedTouches[0]&&(b.pageX=b.originalEvent.changedTouches[0].pageX,b.pageY=b.originalEvent.changedTouches[0].pageY,b.target=i.elementFromPoint(b.originalEvent.changedTouches[0].pageX-window.pageXOffset,b.originalEvent.changedTouches[0].pageY-window.pageYOffset)),c.is_drag)b.target!==c.target&&a(c.target).off("click.vakata"),a.vakata.dnd._trigger("stop",b);else if("touchend"===b.type&&b.target===c.target){var d=setTimeout(function(){a(b.target).click()},100);a(b.target).one("click",function(){d&&clearTimeout(d)})}return a.vakata.dnd._clean(),!1}}}(a),a.jstree.defaults.massload=null,a.jstree.plugins.massload=function(b,c){this.init=function(a,b){this._data.massload={},c.init.call(this,a,b)},this._load_nodes=function(b,d,e,f){var g=this.settings.massload,h=JSON.stringify(b),i=[],j=this._model.data,k,l,m;if(!e){for(k=0,l=b.length;l>k;k++)(!j[b[k]]||!j[b[k]].state.loaded&&!j[b[k]].state.failed||f)&&(i.push(b[k]),m=this.get_node(b[k],!0),m&&m.length&&m.addClass("jstree-loading").attr("aria-busy",!0));if(this._data.massload={},i.length){if(a.isFunction(g))return g.call(this,i,a.proxy(function(a){var g,h;if(a)for(g in a)a.hasOwnProperty(g)&&(this._data.massload[g]=a[g]);for(g=0,h=b.length;h>g;g++)m=this.get_node(b[g],!0),m&&m.length&&m.removeClass("jstree-loading").attr("aria-busy",!1);c._load_nodes.call(this,b,d,e,f)},this));if("object"==typeof g&&g&&g.url)return g=a.extend(!0,{},g),a.isFunction(g.url)&&(g.url=g.url.call(this,i)),a.isFunction(g.data)&&(g.data=g.data.call(this,i)),a.ajax(g).done(a.proxy(function(a,g,h){var i,j;if(a)for(i in a)a.hasOwnProperty(i)&&(this._data.massload[i]=a[i]);for(i=0,j=b.length;j>i;i++)m=this.get_node(b[i],!0),m&&m.length&&m.removeClass("jstree-loading").attr("aria-busy",!1);c._load_nodes.call(this,b,d,e,f)},this)).fail(a.proxy(function(a){c._load_nodes.call(this,b,d,e,f)},this))}}return c._load_nodes.call(this,b,d,e,f)},this._load_node=function(b,d){var e=this._data.massload[b.id],f=null,g;return e?(f=this["string"==typeof e?"_append_html_data":"_append_json_data"](b,"string"==typeof e?a(a.parseHTML(e)).filter(function(){return 3!==this.nodeType}):e,function(a){d.call(this,a)}),g=this.get_node(b.id,!0),g&&g.length&&g.removeClass("jstree-loading").attr("aria-busy",!1),delete this._data.massload[b.id],f):c._load_node.call(this,b,d)}},a.jstree.defaults.search={ajax:!1,fuzzy:!1,case_sensitive:!1,show_only_matches:!1,show_only_matches_children:!1,close_opened_onclear:!0,search_leaves_only:!1,search_callback:!1},a.jstree.plugins.search=function(c,d){this.bind=function(){d.bind.call(this),this._data.search.str="",this._data.search.dom=a(),this._data.search.res=[],this._data.search.opn=[],this._data.search.som=!1,this._data.search.smc=!1,this._data.search.hdn=[],this.element.on("search.jstree",a.proxy(function(b,c){if(this._data.search.som&&c.res.length){var d=this._model.data,e,f,g=[],h,i;for(e=0,f=c.res.length;f>e;e++)if(d[c.res[e]]&&!d[c.res[e]].state.hidden&&(g.push(c.res[e]),g=g.concat(d[c.res[e]].parents),this._data.search.smc))for(h=0,i=d[c.res[e]].children_d.length;i>h;h++)d[d[c.res[e]].children_d[h]]&&!d[d[c.res[e]].children_d[h]].state.hidden&&g.push(d[c.res[e]].children_d[h]);g=a.vakata.array_remove_item(a.vakata.array_unique(g),a.jstree.root),this._data.search.hdn=this.hide_all(!0),this.show_node(g,!0),this.redraw(!0)}},this)).on("clear_search.jstree",a.proxy(function(a,b){this._data.search.som&&b.res.length&&(this.show_node(this._data.search.hdn,!0),this.redraw(!0))},this))},this.search=function(c,d,e,f,g,h){if(c===!1||""===a.trim(c.toString()))return this.clear_search();f=this.get_node(f),f=f&&f.id?f.id:null,c=c.toString();var i=this.settings.search,j=i.ajax?i.ajax:!1,k=this._model.data,l=null,m=[],n=[],o,p;if(this._data.search.res.length&&!g&&this.clear_search(),e===b&&(e=i.show_only_matches),h===b&&(h=i.show_only_matches_children),!d&&j!==!1)return a.isFunction(j)?j.call(this,c,a.proxy(function(b){b&&b.d&&(b=b.d),this._load_nodes(a.isArray(b)?a.vakata.array_unique(b):[],function(){this.search(c,!0,e,f,g,h)})},this),f):(j=a.extend({},j),j.data||(j.data={}),j.data.str=c,f&&(j.data.inside=f),this._data.search.lastRequest&&this._data.search.lastRequest.abort(),this._data.search.lastRequest=a.ajax(j).fail(a.proxy(function(){this._data.core.last_error={error:"ajax",plugin:"search",id:"search_01",reason:"Could not load search parents",data:JSON.stringify(j)},this.settings.core.error.call(this,this._data.core.last_error)},this)).done(a.proxy(function(b){b&&b.d&&(b=b.d),this._load_nodes(a.isArray(b)?a.vakata.array_unique(b):[],function(){this.search(c,!0,e,f,g,h)})},this)),this._data.search.lastRequest);if(g||(this._data.search.str=c,this._data.search.dom=a(),this._data.search.res=[],this._data.search.opn=[],this._data.search.som=e,this._data.search.smc=h),l=new a.vakata.search(c,!0,{caseSensitive:i.case_sensitive,fuzzy:i.fuzzy}),a.each(k[f?f:a.jstree.root].children_d,function(a,b){var d=k[b];d.text&&!d.state.hidden&&(!i.search_leaves_only||d.state.loaded&&0===d.children.length)&&(i.search_callback&&i.search_callback.call(this,c,d)||!i.search_callback&&l.search(d.text).isMatch)&&(m.push(b),n=n.concat(d.parents))}),m.length){for(n=a.vakata.array_unique(n),o=0,p=n.length;p>o;o++)n[o]!==a.jstree.root&&k[n[o]]&&this.open_node(n[o],null,0)===!0&&this._data.search.opn.push(n[o]);g?(this._data.search.dom=this._data.search.dom.add(a(this.element[0].querySelectorAll("#"+a.map(m,function(b){return-1!=="0123456789".indexOf(b[0])?"\\3"+b[0]+" "+b.substr(1).replace(a.jstree.idregex,"\\$&"):b.replace(a.jstree.idregex,"\\$&")}).join(", #")))),this._data.search.res=a.vakata.array_unique(this._data.search.res.concat(m))):(this._data.search.dom=a(this.element[0].querySelectorAll("#"+a.map(m,function(b){return-1!=="0123456789".indexOf(b[0])?"\\3"+b[0]+" "+b.substr(1).replace(a.jstree.idregex,"\\$&"):b.replace(a.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.res=m),this._data.search.dom.children(".jstree-anchor").addClass("jstree-search")}this.trigger("search",{nodes:this._data.search.dom,str:c,res:this._data.search.res,show_only_matches:e})},this.clear_search=function(){this.settings.search.close_opened_onclear&&this.close_node(this._data.search.opn,0),this.trigger("clear_search",{nodes:this._data.search.dom,str:this._data.search.str,res:this._data.search.res}),this._data.search.res.length&&(this._data.search.dom=a(this.element[0].querySelectorAll("#"+a.map(this._data.search.res,function(b){return-1!=="0123456789".indexOf(b[0])?"\\3"+b[0]+" "+b.substr(1).replace(a.jstree.idregex,"\\$&"):b.replace(a.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.dom.children(".jstree-anchor").removeClass("jstree-search")),this._data.search.str="",this._data.search.res=[],this._data.search.opn=[],this._data.search.dom=a()},this.redraw_node=function(b,c,e,f){if(b=d.redraw_node.apply(this,arguments),b&&-1!==a.inArray(b.id,this._data.search.res)){var g,h,i=null;for(g=0,h=b.childNodes.length;h>g;g++)if(b.childNodes[g]&&b.childNodes[g].className&&-1!==b.childNodes[g].className.indexOf("jstree-anchor")){i=b.childNodes[g];break}i&&(i.className+=" jstree-search")}return b}},function(a){a.vakata.search=function(b,c,d){d=d||{},d=a.extend({},a.vakata.search.defaults,d),d.fuzzy!==!1&&(d.fuzzy=!0),b=d.caseSensitive?b:b.toLowerCase();var e=d.location,f=d.distance,g=d.threshold,h=b.length,i,j,k,l;return h>32&&(d.fuzzy=!1),d.fuzzy&&(i=1<<h-1,j=function(){var a={},c=0;for(c=0;h>c;c++)a[b.charAt(c)]=0;for(c=0;h>c;c++)a[b.charAt(c)]|=1<<h-c-1;return a}(),k=function(a,b){var c=a/h,d=Math.abs(e-b);return f?c+d/f:d?1:c}),l=function(a){if(a=d.caseSensitive?a:a.toLowerCase(),b===a||-1!==a.indexOf(b))return{isMatch:!0,score:0};if(!d.fuzzy)return{isMatch:!1,score:1};var c,f,l=a.length,m=g,n=a.indexOf(b,e),o,p,q=h+l,r,s,t,u,v,w=1,x=[];for(-1!==n&&(m=Math.min(k(0,n),m),n=a.lastIndexOf(b,e+h),-1!==n&&(m=Math.min(k(0,n),m))),n=-1,c=0;h>c;c++){o=0,p=q;while(p>o)k(c,e+p)<=m?o=p:q=p,p=Math.floor((q-o)/2+o);for(q=p,s=Math.max(1,e-p+1),t=Math.min(e+p,l)+h,u=new Array(t+2),u[t+1]=(1<<c)-1,f=t;f>=s;f--)if(v=j[a.charAt(f-1)],0===c?u[f]=(u[f+1]<<1|1)&v:u[f]=(u[f+1]<<1|1)&v|((r[f+1]|r[f])<<1|1)|r[f+1],u[f]&i&&(w=k(c,f-1),m>=w)){if(m=w,n=f-1,x.push(n),!(n>e))break;s=Math.max(1,2*e-n)}if(k(c+1,e)>m)break;r=u}return{isMatch:n>=0,score:w}},c===!0?{search:l}:l(c)},a.vakata.search.defaults={location:0,distance:100,threshold:.6,fuzzy:!1,caseSensitive:!1}}(a),a.jstree.defaults.sort=function(a,b){return this.get_text(a)>this.get_text(b)?1:-1},a.jstree.plugins.sort=function(b,c){this.bind=function(){c.bind.call(this),this.element.on("model.jstree",a.proxy(function(a,b){this.sort(b.parent,!0)},this)).on("rename_node.jstree create_node.jstree",a.proxy(function(a,b){this.sort(b.parent||b.node.parent,!1),this.redraw_node(b.parent||b.node.parent,!0)},this)).on("move_node.jstree copy_node.jstree",a.proxy(function(a,b){this.sort(b.parent,!1),this.redraw_node(b.parent,!0)},this))},this.sort=function(b,c){var d,e;if(b=this.get_node(b),b&&b.children&&b.children.length&&(b.children.sort(a.proxy(this.settings.sort,this)),c))for(d=0,e=b.children_d.length;e>d;d++)this.sort(b.children_d[d],!1)}};var m=!1;a.jstree.defaults.state={key:"jstree",events:"changed.jstree open_node.jstree close_node.jstree check_node.jstree uncheck_node.jstree",ttl:!1,filter:!1,preserve_loaded:!1},a.jstree.plugins.state=function(b,c){this.bind=function(){c.bind.call(this);var b=a.proxy(function(){this.element.on(this.settings.state.events,a.proxy(function(){m&&clearTimeout(m),m=setTimeout(a.proxy(function(){this.save_state()},this),100)},this)),this.trigger("state_ready")},this);this.element.on("ready.jstree",a.proxy(function(a,c){this.element.one("restore_state.jstree",b),this.restore_state()||b()},this))},this.save_state=function(){var b=this.get_state();this.settings.state.preserve_loaded||delete b.core.loaded;var c={state:b,ttl:this.settings.state.ttl,sec:+new Date};a.vakata.storage.set(this.settings.state.key,JSON.stringify(c))},this.restore_state=function(){var b=a.vakata.storage.get(this.settings.state.key);if(b)try{b=JSON.parse(b)}catch(c){return!1}return b&&b.ttl&&b.sec&&+new Date-b.sec>b.ttl?!1:(b&&b.state&&(b=b.state),b&&a.isFunction(this.settings.state.filter)&&(b=this.settings.state.filter.call(this,b)),b?(this.settings.state.preserve_loaded||delete b.core.loaded,this.element.one("set_state.jstree",function(c,d){d.instance.trigger("restore_state",{state:a.extend(!0,{},b)})}),this.set_state(b),!0):!1)},this.clear_state=function(){return a.vakata.storage.del(this.settings.state.key)}},function(a,b){a.vakata.storage={set:function(a,b){return window.localStorage.setItem(a,b)},get:function(a){return window.localStorage.getItem(a)},del:function(a){return window.localStorage.removeItem(a)}}}(a),a.jstree.defaults.types={"default":{}},a.jstree.defaults.types[a.jstree.root]={},a.jstree.plugins.types=function(c,d){this.init=function(c,e){var f,g;if(e&&e.types&&e.types["default"])for(f in e.types)if("default"!==f&&f!==a.jstree.root&&e.types.hasOwnProperty(f))for(g in e.types["default"])e.types["default"].hasOwnProperty(g)&&e.types[f][g]===b&&(e.types[f][g]=e.types["default"][g]);d.init.call(this,c,e),this._model.data[a.jstree.root].type=a.jstree.root},this.refresh=function(b,c){d.refresh.call(this,b,c),this._model.data[a.jstree.root].type=a.jstree.root},this.bind=function(){this.element.on("model.jstree",a.proxy(function(c,d){var e=this._model.data,f=d.nodes,g=this.settings.types,h,i,j="default",k;for(h=0,i=f.length;i>h;h++){if(j="default",e[f[h]].original&&e[f[h]].original.type&&g[e[f[h]].original.type]&&(j=e[f[h]].original.type),e[f[h]].data&&e[f[h]].data.jstree&&e[f[h]].data.jstree.type&&g[e[f[h]].data.jstree.type]&&(j=e[f[h]].data.jstree.type),e[f[h]].type=j,e[f[h]].icon===!0&&g[j].icon!==b&&(e[f[h]].icon=g[j].icon),g[j].li_attr!==b&&"object"==typeof g[j].li_attr)for(k in g[j].li_attr)if(g[j].li_attr.hasOwnProperty(k)){if("id"===k)continue;e[f[h]].li_attr[k]===b?e[f[h]].li_attr[k]=g[j].li_attr[k]:"class"===k&&(e[f[h]].li_attr["class"]=g[j].li_attr["class"]+" "+e[f[h]].li_attr["class"])}if(g[j].a_attr!==b&&"object"==typeof g[j].a_attr)for(k in g[j].a_attr)if(g[j].a_attr.hasOwnProperty(k)){if("id"===k)continue;e[f[h]].a_attr[k]===b?e[f[h]].a_attr[k]=g[j].a_attr[k]:"href"===k&&"#"===e[f[h]].a_attr[k]?e[f[h]].a_attr.href=g[j].a_attr.href:"class"===k&&(e[f[h]].a_attr["class"]=g[j].a_attr["class"]+" "+e[f[h]].a_attr["class"])}}e[a.jstree.root].type=a.jstree.root},this)),d.bind.call(this)},this.get_json=function(b,c,e){var f,g,h=this._model.data,i=c?a.extend(!0,{},c,{no_id:!1}):{},j=d.get_json.call(this,b,i,e);if(j===!1)return!1;if(a.isArray(j))for(f=0,g=j.length;g>f;f++)j[f].type=j[f].id&&h[j[f].id]&&h[j[f].id].type?h[j[f].id].type:"default",c&&c.no_id&&(delete j[f].id,j[f].li_attr&&j[f].li_attr.id&&delete j[f].li_attr.id,j[f].a_attr&&j[f].a_attr.id&&delete j[f].a_attr.id);else j.type=j.id&&h[j.id]&&h[j.id].type?h[j.id].type:"default",c&&c.no_id&&(j=this._delete_ids(j));return j},this._delete_ids=function(b){if(a.isArray(b)){for(var c=0,d=b.length;d>c;c++)b[c]=this._delete_ids(b[c]);return b}return delete b.id,
6
- b.li_attr&&b.li_attr.id&&delete b.li_attr.id,b.a_attr&&b.a_attr.id&&delete b.a_attr.id,b.children&&a.isArray(b.children)&&(b.children=this._delete_ids(b.children)),b},this.check=function(c,e,f,g,h){if(d.check.call(this,c,e,f,g,h)===!1)return!1;e=e&&e.id?e:this.get_node(e),f=f&&f.id?f:this.get_node(f);var i=e&&e.id?h&&h.origin?h.origin:a.jstree.reference(e.id):null,j,k,l,m;switch(i=i&&i._model&&i._model.data?i._model.data:null,c){case"create_node":case"move_node":case"copy_node":if("move_node"!==c||-1===a.inArray(e.id,f.children)){if(j=this.get_rules(f),j.max_children!==b&&-1!==j.max_children&&j.max_children===f.children.length)return this._data.core.last_error={error:"check",plugin:"types",id:"types_01",reason:"max_children prevents function: "+c,data:JSON.stringify({chk:c,pos:g,obj:e&&e.id?e.id:!1,par:f&&f.id?f.id:!1})},!1;if(j.valid_children!==b&&-1!==j.valid_children&&-1===a.inArray(e.type||"default",j.valid_children))return this._data.core.last_error={error:"check",plugin:"types",id:"types_02",reason:"valid_children prevents function: "+c,data:JSON.stringify({chk:c,pos:g,obj:e&&e.id?e.id:!1,par:f&&f.id?f.id:!1})},!1;if(i&&e.children_d&&e.parents){for(k=0,l=0,m=e.children_d.length;m>l;l++)k=Math.max(k,i[e.children_d[l]].parents.length);k=k-e.parents.length+1}(0>=k||k===b)&&(k=1);do{if(j.max_depth!==b&&-1!==j.max_depth&&j.max_depth<k)return this._data.core.last_error={error:"check",plugin:"types",id:"types_03",reason:"max_depth prevents function: "+c,data:JSON.stringify({chk:c,pos:g,obj:e&&e.id?e.id:!1,par:f&&f.id?f.id:!1})},!1;f=this.get_node(f.parent),j=this.get_rules(f),k++}while(f)}}return!0},this.get_rules=function(a){if(a=this.get_node(a),!a)return!1;var c=this.get_type(a,!0);return c.max_depth===b&&(c.max_depth=-1),c.max_children===b&&(c.max_children=-1),c.valid_children===b&&(c.valid_children=-1),c},this.get_type=function(b,c){return b=this.get_node(b),b?c?a.extend({type:b.type},this.settings.types[b.type]):b.type:!1},this.set_type=function(c,d){var e=this._model.data,f,g,h,i,j,k,l,m;if(a.isArray(c)){for(c=c.slice(),g=0,h=c.length;h>g;g++)this.set_type(c[g],d);return!0}if(f=this.settings.types,c=this.get_node(c),!f[d]||!c)return!1;if(l=this.get_node(c,!0),l&&l.length&&(m=l.children(".jstree-anchor")),i=c.type,j=this.get_icon(c),c.type=d,(j===!0||!f[i]||f[i].icon!==b&&j===f[i].icon)&&this.set_icon(c,f[d].icon!==b?f[d].icon:!0),f[i]&&f[i].li_attr!==b&&"object"==typeof f[i].li_attr)for(k in f[i].li_attr)if(f[i].li_attr.hasOwnProperty(k)){if("id"===k)continue;"class"===k?(e[c.id].li_attr["class"]=(e[c.id].li_attr["class"]||"").replace(f[i].li_attr[k],""),l&&l.removeClass(f[i].li_attr[k])):e[c.id].li_attr[k]===f[i].li_attr[k]&&(e[c.id].li_attr[k]=null,l&&l.removeAttr(k))}if(f[i]&&f[i].a_attr!==b&&"object"==typeof f[i].a_attr)for(k in f[i].a_attr)if(f[i].a_attr.hasOwnProperty(k)){if("id"===k)continue;"class"===k?(e[c.id].a_attr["class"]=(e[c.id].a_attr["class"]||"").replace(f[i].a_attr[k],""),m&&m.removeClass(f[i].a_attr[k])):e[c.id].a_attr[k]===f[i].a_attr[k]&&("href"===k?(e[c.id].a_attr[k]="#",m&&m.attr("href","#")):(delete e[c.id].a_attr[k],m&&m.removeAttr(k)))}if(f[d].li_attr!==b&&"object"==typeof f[d].li_attr)for(k in f[d].li_attr)if(f[d].li_attr.hasOwnProperty(k)){if("id"===k)continue;e[c.id].li_attr[k]===b?(e[c.id].li_attr[k]=f[d].li_attr[k],l&&("class"===k?l.addClass(f[d].li_attr[k]):l.attr(k,f[d].li_attr[k]))):"class"===k&&(e[c.id].li_attr["class"]=f[d].li_attr[k]+" "+e[c.id].li_attr["class"],l&&l.addClass(f[d].li_attr[k]))}if(f[d].a_attr!==b&&"object"==typeof f[d].a_attr)for(k in f[d].a_attr)if(f[d].a_attr.hasOwnProperty(k)){if("id"===k)continue;e[c.id].a_attr[k]===b?(e[c.id].a_attr[k]=f[d].a_attr[k],m&&("class"===k?m.addClass(f[d].a_attr[k]):m.attr(k,f[d].a_attr[k]))):"href"===k&&"#"===e[c.id].a_attr[k]?(e[c.id].a_attr.href=f[d].a_attr.href,m&&m.attr("href",f[d].a_attr.href)):"class"===k&&(e[c.id].a_attr["class"]=f[d].a_attr["class"]+" "+e[c.id].a_attr["class"],m&&m.addClass(f[d].a_attr[k]))}return!0}},a.jstree.defaults.unique={case_sensitive:!1,trim_whitespace:!1,duplicate:function(a,b){return a+" ("+b+")"}},a.jstree.plugins.unique=function(c,d){this.check=function(b,c,e,f,g){if(d.check.call(this,b,c,e,f,g)===!1)return!1;if(c=c&&c.id?c:this.get_node(c),e=e&&e.id?e:this.get_node(e),!e||!e.children)return!0;var h="rename_node"===b?f:c.text,i=[],j=this.settings.unique.case_sensitive,k=this.settings.unique.trim_whitespace,l=this._model.data,m,n,o;for(m=0,n=e.children.length;n>m;m++)o=l[e.children[m]].text,j||(o=o.toLowerCase()),k&&(o=o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")),i.push(o);switch(j||(h=h.toLowerCase()),k&&(h=h.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")),b){case"delete_node":return!0;case"rename_node":return o=c.text||"",j||(o=o.toLowerCase()),k&&(o=o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")),m=-1===a.inArray(h,i)||c.text&&o===h,m||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_01",reason:"Child with name "+h+" already exists. Preventing: "+b,data:JSON.stringify({chk:b,pos:f,obj:c&&c.id?c.id:!1,par:e&&e.id?e.id:!1})}),m;case"create_node":return m=-1===a.inArray(h,i),m||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_04",reason:"Child with name "+h+" already exists. Preventing: "+b,data:JSON.stringify({chk:b,pos:f,obj:c&&c.id?c.id:!1,par:e&&e.id?e.id:!1})}),m;case"copy_node":return m=-1===a.inArray(h,i),m||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_02",reason:"Child with name "+h+" already exists. Preventing: "+b,data:JSON.stringify({chk:b,pos:f,obj:c&&c.id?c.id:!1,par:e&&e.id?e.id:!1})}),m;case"move_node":return m=c.parent===e.id&&(!g||!g.is_multi)||-1===a.inArray(h,i),m||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_03",reason:"Child with name "+h+" already exists. Preventing: "+b,data:JSON.stringify({chk:b,pos:f,obj:c&&c.id?c.id:!1,par:e&&e.id?e.id:!1})}),m}return!0},this.create_node=function(c,e,f,g,h){if(!e||e.text===b){if(null===c&&(c=a.jstree.root),c=this.get_node(c),!c)return d.create_node.call(this,c,e,f,g,h);if(f=f===b?"last":f,!f.toString().match(/^(before|after)$/)&&!h&&!this.is_loaded(c))return d.create_node.call(this,c,e,f,g,h);e||(e={});var i,j,k,l,m,n=this._model.data,o=this.settings.unique.case_sensitive,p=this.settings.unique.trim_whitespace,q=this.settings.unique.duplicate,r;for(j=i=this.get_string("New node"),k=[],l=0,m=c.children.length;m>l;l++)r=n[c.children[l]].text,o||(r=r.toLowerCase()),p&&(r=r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")),k.push(r);l=1,r=j,o||(r=r.toLowerCase()),p&&(r=r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""));while(-1!==a.inArray(r,k))j=q.call(this,i,++l).toString(),r=j,o||(r=r.toLowerCase()),p&&(r=r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""));e.text=j}return d.create_node.call(this,c,e,f,g,h)}};var n=i.createElement("DIV");if(n.setAttribute("unselectable","on"),n.setAttribute("role","presentation"),n.className="jstree-wholerow",n.innerHTML="&#160;",a.jstree.plugins.wholerow=function(b,c){this.bind=function(){c.bind.call(this),this.element.on("ready.jstree set_state.jstree",a.proxy(function(){this.hide_dots()},this)).on("init.jstree loading.jstree ready.jstree",a.proxy(function(){this.get_container_ul().addClass("jstree-wholerow-ul")},this)).on("deselect_all.jstree",a.proxy(function(a,b){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked")},this)).on("changed.jstree",a.proxy(function(a,b){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked");var c=!1,d,e;for(d=0,e=b.selected.length;e>d;d++)c=this.get_node(b.selected[d],!0),c&&c.length&&c.children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("open_node.jstree",a.proxy(function(a,b){this.get_node(b.node,!0).find(".jstree-clicked").parent().children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("hover_node.jstree dehover_node.jstree",a.proxy(function(a,b){"hover_node"===a.type&&this.is_disabled(b.node)||this.get_node(b.node,!0).children(".jstree-wholerow")["hover_node"===a.type?"addClass":"removeClass"]("jstree-wholerow-hovered")},this)).on("contextmenu.jstree",".jstree-wholerow",a.proxy(function(b){if(this._data.contextmenu){b.preventDefault();var c=a.Event("contextmenu",{metaKey:b.metaKey,ctrlKey:b.ctrlKey,altKey:b.altKey,shiftKey:b.shiftKey,pageX:b.pageX,pageY:b.pageY});a(b.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(c)}},this)).on("click.jstree",".jstree-wholerow",function(b){b.stopImmediatePropagation();var c=a.Event("click",{metaKey:b.metaKey,ctrlKey:b.ctrlKey,altKey:b.altKey,shiftKey:b.shiftKey});a(b.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(c).focus()}).on("dblclick.jstree",".jstree-wholerow",function(b){b.stopImmediatePropagation();var c=a.Event("dblclick",{metaKey:b.metaKey,ctrlKey:b.ctrlKey,altKey:b.altKey,shiftKey:b.shiftKey});a(b.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(c).focus()}).on("click.jstree",".jstree-leaf > .jstree-ocl",a.proxy(function(b){b.stopImmediatePropagation();var c=a.Event("click",{metaKey:b.metaKey,ctrlKey:b.ctrlKey,altKey:b.altKey,shiftKey:b.shiftKey});a(b.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(c).focus()},this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",a.proxy(function(a){return a.stopImmediatePropagation(),this.is_disabled(a.currentTarget)||this.hover_node(a.currentTarget),!1},this)).on("mouseleave.jstree",".jstree-node",a.proxy(function(a){this.dehover_node(a.currentTarget)},this))},this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove(),c.teardown.call(this)},this.redraw_node=function(b,d,e,f){if(b=c.redraw_node.apply(this,arguments)){var g=n.cloneNode(!0);-1!==a.inArray(b.id,this._data.core.selected)&&(g.className+=" jstree-wholerow-clicked"),this._data.core.focused&&this._data.core.focused===b.id&&(g.className+=" jstree-wholerow-hovered"),b.insertBefore(g,b.childNodes[0])}return b}},window.customElements&&Object&&Object.create){var o=Object.create(HTMLElement.prototype);o.createdCallback=function(){var b={core:{},plugins:[]},c;for(c in a.jstree.plugins)a.jstree.plugins.hasOwnProperty(c)&&this.attributes[c]&&(b.plugins.push(c),this.getAttribute(c)&&JSON.parse(this.getAttribute(c))&&(b[c]=JSON.parse(this.getAttribute(c))));for(c in a.jstree.defaults.core)a.jstree.defaults.core.hasOwnProperty(c)&&this.attributes[c]&&(b.core[c]=JSON.parse(this.getAttribute(c))||this.getAttribute(c));a(this).jstree(b)};try{window.customElements.define("vakata-jstree",function(){},{prototype:o})}catch(p){}}}});
1
+ /*! jsTree - v3.3.8 - 2019-04-29 - (MIT) */
2
+ !function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"undefined"!=typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a,b){"use strict";if(!a.jstree){var c=0,d=!1,e=!1,f=!1,g=[],h=a("script:last").attr("src"),i=window.document;a.jstree={version:"3.3.8",defaults:{plugins:[]},plugins:{},path:h&&-1!==h.indexOf("/")?h.replace(/\/[^\/]+$/,""):"",idregex:/[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g,root:"#"},a.jstree.create=function(b,d){var e=new a.jstree.core(++c),f=d;return d=a.extend(!0,{},a.jstree.defaults,d),f&&f.plugins&&(d.plugins=f.plugins),a.each(d.plugins,function(a,b){"core"!==a&&(e=e.plugin(b,d[b]))}),a(b).data("jstree",e),e.init(b,d),e},a.jstree.destroy=function(){a(".jstree:jstree").jstree("destroy"),a(i).off(".jstree")},a.jstree.core=function(a){this._id=a,this._cnt=0,this._wrk=null,this._data={core:{themes:{name:!1,dots:!1,icons:!1,ellipsis:!1},selected:[],last_error:{},working:!1,worker_queue:[],focused:null}}},a.jstree.reference=function(b){var c=null,d=null;if(!b||!b.id||b.tagName&&b.nodeType||(b=b.id),!d||!d.length)try{d=a(b)}catch(e){}if(!d||!d.length)try{d=a("#"+b.replace(a.jstree.idregex,"\\$&"))}catch(e){}return d&&d.length&&(d=d.closest(".jstree")).length&&(d=d.data("jstree"))?c=d:a(".jstree").each(function(){var d=a(this).data("jstree");return d&&d._model.data[b]?(c=d,!1):void 0}),c},a.fn.jstree=function(c){var d="string"==typeof c,e=Array.prototype.slice.call(arguments,1),f=null;return c!==!0||this.length?(this.each(function(){var g=a.jstree.reference(this),h=d&&g?g[c]:null;return f=d&&h?h.apply(g,e):null,g||d||c!==b&&!a.isPlainObject(c)||a.jstree.create(this,c),(g&&!d||c===!0)&&(f=g||!1),null!==f&&f!==b?!1:void 0}),null!==f&&f!==b?f:this):!1},a.expr.pseudos.jstree=a.expr.createPseudo(function(c){return function(c){return a(c).hasClass("jstree")&&a(c).data("jstree")!==b}}),a.jstree.defaults.core={data:!1,strings:!1,check_callback:!1,error:a.noop,animation:200,multiple:!0,themes:{name:!1,url:!1,dir:!1,dots:!0,icons:!0,ellipsis:!1,stripes:!1,variant:!1,responsive:!1},expand_selected_onload:!0,worker:!0,force_text:!1,dblclick_toggle:!0,loaded_state:!1,restore_focus:!0,keyboard:{"ctrl-space":function(b){b.type="click",a(b.currentTarget).trigger(b)},enter:function(b){b.type="click",a(b.currentTarget).trigger(b)},left:function(b){if(b.preventDefault(),this.is_open(b.currentTarget))this.close_node(b.currentTarget);else{var c=this.get_parent(b.currentTarget);c&&c.id!==a.jstree.root&&this.get_node(c,!0).children(".jstree-anchor").focus()}},up:function(a){a.preventDefault();var b=this.get_prev_dom(a.currentTarget);b&&b.length&&b.children(".jstree-anchor").focus()},right:function(b){if(b.preventDefault(),this.is_closed(b.currentTarget))this.open_node(b.currentTarget,function(a){this.get_node(a,!0).children(".jstree-anchor").focus()});else if(this.is_open(b.currentTarget)){var c=this.get_node(b.currentTarget,!0).children(".jstree-children")[0];c&&a(this._firstChild(c)).children(".jstree-anchor").focus()}},down:function(a){a.preventDefault();var b=this.get_next_dom(a.currentTarget);b&&b.length&&b.children(".jstree-anchor").focus()},"*":function(a){this.open_all()},home:function(b){b.preventDefault();var c=this._firstChild(this.get_container_ul()[0]);c&&a(c).children(".jstree-anchor").filter(":visible").focus()},end:function(a){a.preventDefault(),this.element.find(".jstree-anchor").filter(":visible").last().focus()},f2:function(a){a.preventDefault(),this.edit(a.currentTarget)}}},a.jstree.core.prototype={plugin:function(b,c){var d=a.jstree.plugins[b];return d?(this._data[b]={},d.prototype=this,new d(c,this)):this},init:function(b,c){this._model={data:{},changed:[],force_full_redraw:!1,redraw_timeout:!1,default_state:{loaded:!0,opened:!1,selected:!1,disabled:!1}},this._model.data[a.jstree.root]={id:a.jstree.root,parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}},this.element=a(b).addClass("jstree jstree-"+this._id),this.settings=c,this._data.core.ready=!1,this._data.core.loaded=!1,this._data.core.rtl="rtl"===this.element.css("direction"),this.element[this._data.core.rtl?"addClass":"removeClass"]("jstree-rtl"),this.element.attr("role","tree"),this.settings.core.multiple&&this.element.attr("aria-multiselectable",!0),this.element.attr("tabindex")||this.element.attr("tabindex","0"),this.bind(),this.trigger("init"),this._data.core.original_container_html=this.element.find(" > ul > li").clone(!0),this._data.core.original_container_html.find("li").addBack().contents().filter(function(){return 3===this.nodeType&&(!this.nodeValue||/^\s+$/.test(this.nodeValue))}).remove(),this.element.html("<ul class='jstree-container-ul jstree-children' role='group'><li id='j"+this._id+"_loading' class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='tree-item'><i class='jstree-icon jstree-ocl'></i><a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'></i>"+this.get_string("Loading ...")+"</a></li></ul>"),this.element.attr("aria-activedescendant","j"+this._id+"_loading"),this._data.core.li_height=this.get_container_ul().children("li").first().outerHeight()||24,this._data.core.node=this._create_prototype_node(),this.trigger("loading"),this.load_node(a.jstree.root)},destroy:function(a){if(this.trigger("destroy"),this._wrk)try{window.URL.revokeObjectURL(this._wrk),this._wrk=null}catch(b){}a||this.element.empty(),this.teardown()},_create_prototype_node:function(){var a=i.createElement("LI"),b,c;return a.setAttribute("role","treeitem"),b=i.createElement("I"),b.className="jstree-icon jstree-ocl",b.setAttribute("role","presentation"),a.appendChild(b),b=i.createElement("A"),b.className="jstree-anchor",b.setAttribute("href","#"),b.setAttribute("tabindex","-1"),c=i.createElement("I"),c.className="jstree-icon jstree-themeicon",c.setAttribute("role","presentation"),b.appendChild(c),a.appendChild(b),b=c=null,a},_kbevent_to_func:function(a){var b={8:"Backspace",9:"Tab",13:"Enter",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock",16:"Shift",17:"Ctrl",18:"Alt",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*",173:"-"},c=[];a.ctrlKey&&c.push("ctrl"),a.altKey&&c.push("alt"),a.shiftKey&&c.push("shift"),c.push(b[a.which]||a.which),c=c.sort().join("-").toLowerCase();var d=this.settings.core.keyboard,e,f;for(e in d)if(d.hasOwnProperty(e)&&(f=e,"-"!==f&&"+"!==f&&(f=f.replace("--","-MINUS").replace("+-","-MINUS").replace("++","-PLUS").replace("-+","-PLUS"),f=f.split(/-|\+/).sort().join("-").replace("MINUS","-").replace("PLUS","+").toLowerCase()),f===c))return d[e];return null},teardown:function(){this.unbind(),this.element.removeClass("jstree").removeData("jstree").find("[class^='jstree']").addBack().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/gi,"")}),this.element=null},bind:function(){var b="",c=null,d=0;this.element.on("dblclick.jstree",function(a){if(a.target.tagName&&"input"===a.target.tagName.toLowerCase())return!0;if(i.selection&&i.selection.empty)i.selection.empty();else if(window.getSelection){var b=window.getSelection();try{b.removeAllRanges(),b.collapse()}catch(c){}}}).on("mousedown.jstree",a.proxy(function(a){a.target===this.element[0]&&(a.preventDefault(),d=+new Date)},this)).on("mousedown.jstree",".jstree-ocl",function(a){a.preventDefault()}).on("click.jstree",".jstree-ocl",a.proxy(function(a){this.toggle_node(a.target)},this)).on("dblclick.jstree",".jstree-anchor",a.proxy(function(a){return a.target.tagName&&"input"===a.target.tagName.toLowerCase()?!0:void(this.settings.core.dblclick_toggle&&this.toggle_node(a.target))},this)).on("click.jstree",".jstree-anchor",a.proxy(function(b){b.preventDefault(),b.currentTarget!==i.activeElement&&a(b.currentTarget).focus(),this.activate_node(b.currentTarget,b)},this)).on("keydown.jstree",".jstree-anchor",a.proxy(function(a){if(a.target.tagName&&"input"===a.target.tagName.toLowerCase())return!0;this._data.core.rtl&&(37===a.which?a.which=39:39===a.which&&(a.which=37));var b=this._kbevent_to_func(a);if(b){var c=b.call(this,a);if(c===!1||c===!0)return c}},this)).on("load_node.jstree",a.proxy(function(b,c){c.status&&(c.node.id!==a.jstree.root||this._data.core.loaded||(this._data.core.loaded=!0,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.trigger("loaded")),this._data.core.ready||setTimeout(a.proxy(function(){if(this.element&&!this.get_container_ul().find(".jstree-loading").length){if(this._data.core.ready=!0,this._data.core.selected.length){if(this.settings.core.expand_selected_onload){var b=[],c,d;for(c=0,d=this._data.core.selected.length;d>c;c++)b=b.concat(this._model.data[this._data.core.selected[c]].parents);for(b=a.vakata.array_unique(b),c=0,d=b.length;d>c;c++)this.open_node(b[c],!1,0)}this.trigger("changed",{action:"ready",selected:this._data.core.selected})}this.trigger("ready")}},this),0))},this)).on("keypress.jstree",a.proxy(function(d){if(d.target.tagName&&"input"===d.target.tagName.toLowerCase())return!0;c&&clearTimeout(c),c=setTimeout(function(){b=""},500);var e=String.fromCharCode(d.which).toLowerCase(),f=this.element.find(".jstree-anchor").filter(":visible"),g=f.index(i.activeElement)||0,h=!1;if(b+=e,b.length>1){if(f.slice(g).each(a.proxy(function(c,d){return 0===a(d).text().toLowerCase().indexOf(b)?(a(d).focus(),h=!0,!1):void 0},this)),h)return;if(f.slice(0,g).each(a.proxy(function(c,d){return 0===a(d).text().toLowerCase().indexOf(b)?(a(d).focus(),h=!0,!1):void 0},this)),h)return}if(new RegExp("^"+e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+"+$").test(b)){if(f.slice(g+1).each(a.proxy(function(b,c){return a(c).text().toLowerCase().charAt(0)===e?(a(c).focus(),h=!0,!1):void 0},this)),h)return;if(f.slice(0,g+1).each(a.proxy(function(b,c){return a(c).text().toLowerCase().charAt(0)===e?(a(c).focus(),h=!0,!1):void 0},this)),h)return}},this)).on("init.jstree",a.proxy(function(){var a=this.settings.core.themes;this._data.core.themes.dots=a.dots,this._data.core.themes.stripes=a.stripes,this._data.core.themes.icons=a.icons,this._data.core.themes.ellipsis=a.ellipsis,this.set_theme(a.name||"default",a.url),this.set_theme_variant(a.variant)},this)).on("loading.jstree",a.proxy(function(){this[this._data.core.themes.dots?"show_dots":"hide_dots"](),this[this._data.core.themes.icons?"show_icons":"hide_icons"](),this[this._data.core.themes.stripes?"show_stripes":"hide_stripes"](),this[this._data.core.themes.ellipsis?"show_ellipsis":"hide_ellipsis"]()},this)).on("blur.jstree",".jstree-anchor",a.proxy(function(b){this._data.core.focused=null,a(b.currentTarget).filter(".jstree-hovered").trigger("mouseleave"),this.element.attr("tabindex","0")},this)).on("focus.jstree",".jstree-anchor",a.proxy(function(b){var c=this.get_node(b.currentTarget);c&&c.id&&(this._data.core.focused=c.id),this.element.find(".jstree-hovered").not(b.currentTarget).trigger("mouseleave"),a(b.currentTarget).trigger("mouseenter"),this.element.attr("tabindex","-1")},this)).on("focus.jstree",a.proxy(function(){if(+new Date-d>500&&!this._data.core.focused&&this.settings.core.restore_focus){d=0;var a=this.get_node(this.element.attr("aria-activedescendant"),!0);a&&a.find("> .jstree-anchor").focus()}},this)).on("mouseenter.jstree",".jstree-anchor",a.proxy(function(a){this.hover_node(a.currentTarget)},this)).on("mouseleave.jstree",".jstree-anchor",a.proxy(function(a){this.dehover_node(a.currentTarget)},this))},unbind:function(){this.element.off(".jstree"),a(i).off(".jstree-"+this._id)},trigger:function(a,b){b||(b={}),b.instance=this,this.element.triggerHandler(a.replace(".jstree","")+".jstree",b)},get_container:function(){return this.element},get_container_ul:function(){return this.element.children(".jstree-children").first()},get_string:function(b){var c=this.settings.core.strings;return a.isFunction(c)?c.call(this,b):c&&c[b]?c[b]:b},_firstChild:function(a){a=a?a.firstChild:null;while(null!==a&&1!==a.nodeType)a=a.nextSibling;return a},_nextSibling:function(a){a=a?a.nextSibling:null;while(null!==a&&1!==a.nodeType)a=a.nextSibling;return a},_previousSibling:function(a){a=a?a.previousSibling:null;while(null!==a&&1!==a.nodeType)a=a.previousSibling;return a},get_node:function(b,c){b&&b.id&&(b=b.id),b instanceof a&&b.length&&b[0].id&&(b=b[0].id);var d;try{if(this._model.data[b])b=this._model.data[b];else if("string"==typeof b&&this._model.data[b.replace(/^#/,"")])b=this._model.data[b.replace(/^#/,"")];else if("string"==typeof b&&(d=a("#"+b.replace(a.jstree.idregex,"\\$&"),this.element)).length&&this._model.data[d.closest(".jstree-node").attr("id")])b=this._model.data[d.closest(".jstree-node").attr("id")];else if((d=this.element.find(b)).length&&this._model.data[d.closest(".jstree-node").attr("id")])b=this._model.data[d.closest(".jstree-node").attr("id")];else{if(!(d=this.element.find(b)).length||!d.hasClass("jstree"))return!1;b=this._model.data[a.jstree.root]}return c&&(b=b.id===a.jstree.root?this.element:a("#"+b.id.replace(a.jstree.idregex,"\\$&"),this.element)),b}catch(e){return!1}},get_path:function(b,c,d){if(b=b.parents?b:this.get_node(b),!b||b.id===a.jstree.root||!b.parents)return!1;var e,f,g=[];for(g.push(d?b.id:b.text),e=0,f=b.parents.length;f>e;e++)g.push(d?b.parents[e]:this.get_text(b.parents[e]));return g=g.reverse().slice(1),c?g.join(c):g},get_next_dom:function(b,c){var d;if(b=this.get_node(b,!0),b[0]===this.element[0]){d=this._firstChild(this.get_container_ul()[0]);while(d&&0===d.offsetHeight)d=this._nextSibling(d);return d?a(d):!1}if(!b||!b.length)return!1;if(c){d=b[0];do d=this._nextSibling(d);while(d&&0===d.offsetHeight);return d?a(d):!1}if(b.hasClass("jstree-open")){d=this._firstChild(b.children(".jstree-children")[0]);while(d&&0===d.offsetHeight)d=this._nextSibling(d);if(null!==d)return a(d)}d=b[0];do d=this._nextSibling(d);while(d&&0===d.offsetHeight);return null!==d?a(d):b.parentsUntil(".jstree",".jstree-node").nextAll(".jstree-node:visible").first()},get_prev_dom:function(b,c){var d;if(b=this.get_node(b,!0),b[0]===this.element[0]){d=this.get_container_ul()[0].lastChild;while(d&&0===d.offsetHeight)d=this._previousSibling(d);return d?a(d):!1}if(!b||!b.length)return!1;if(c){d=b[0];do d=this._previousSibling(d);while(d&&0===d.offsetHeight);return d?a(d):!1}d=b[0];do d=this._previousSibling(d);while(d&&0===d.offsetHeight);if(null!==d){b=a(d);while(b.hasClass("jstree-open"))b=b.children(".jstree-children").first().children(".jstree-node:visible:last");return b}return d=b[0].parentNode.parentNode,d&&d.className&&-1!==d.className.indexOf("jstree-node")?a(d):!1},get_parent:function(b){return b=this.get_node(b),b&&b.id!==a.jstree.root?b.parent:!1},get_children_dom:function(a){return a=this.get_node(a,!0),a[0]===this.element[0]?this.get_container_ul().children(".jstree-node"):a&&a.length?a.children(".jstree-children").children(".jstree-node"):!1},is_parent:function(a){return a=this.get_node(a),a&&(a.state.loaded===!1||a.children.length>0)},is_loaded:function(a){return a=this.get_node(a),a&&a.state.loaded},is_loading:function(a){return a=this.get_node(a),a&&a.state&&a.state.loading},is_open:function(a){return a=this.get_node(a),a&&a.state.opened},is_closed:function(a){return a=this.get_node(a),a&&this.is_parent(a)&&!a.state.opened},is_leaf:function(a){return!this.is_parent(a)},load_node:function(b,c){var d,e,f,g,h;if(a.isArray(b))return this._load_nodes(b.slice(),c),!0;if(b=this.get_node(b),!b)return c&&c.call(this,b,!1),!1;if(b.state.loaded){for(b.state.loaded=!1,f=0,g=b.parents.length;g>f;f++)this._model.data[b.parents[f]].children_d=a.vakata.array_filter(this._model.data[b.parents[f]].children_d,function(c){return-1===a.inArray(c,b.children_d)});for(d=0,e=b.children_d.length;e>d;d++)this._model.data[b.children_d[d]].state.selected&&(h=!0),delete this._model.data[b.children_d[d]];h&&(this._data.core.selected=a.vakata.array_filter(this._data.core.selected,function(c){return-1===a.inArray(c,b.children_d)})),b.children=[],b.children_d=[],h&&this.trigger("changed",{action:"load_node",node:b,selected:this._data.core.selected})}return b.state.failed=!1,b.state.loading=!0,this.get_node(b,!0).addClass("jstree-loading").attr("aria-busy",!0),this._load_node(b,a.proxy(function(a){b=this._model.data[b.id],b.state.loading=!1,b.state.loaded=a,b.state.failed=!b.state.loaded;var d=this.get_node(b,!0),e=0,f=0,g=this._model.data,h=!1;for(e=0,f=b.children.length;f>e;e++)if(g[b.children[e]]&&!g[b.children[e]].state.hidden){h=!0;break}b.state.loaded&&d&&d.length&&(d.removeClass("jstree-closed jstree-open jstree-leaf"),h?"#"!==b.id&&d.addClass(b.state.opened?"jstree-open":"jstree-closed"):d.addClass("jstree-leaf")),d.removeClass("jstree-loading").attr("aria-busy",!1),this.trigger("load_node",{node:b,status:a}),c&&c.call(this,b,a)},this)),!0},_load_nodes:function(a,b,c,d){var e=!0,f=function(){this._load_nodes(a,b,!0)},g=this._model.data,h,i,j=[];for(h=0,i=a.length;i>h;h++)g[a[h]]&&(!g[a[h]].state.loaded&&!g[a[h]].state.failed||!c&&d)&&(this.is_loading(a[h])||this.load_node(a[h],f),e=!1);if(e){for(h=0,i=a.length;i>h;h++)g[a[h]]&&g[a[h]].state.loaded&&j.push(a[h]);b&&!b.done&&(b.call(this,j),b.done=!0)}},load_all:function(b,c){if(b||(b=a.jstree.root),b=this.get_node(b),!b)return!1;var d=[],e=this._model.data,f=e[b.id].children_d,g,h;for(b.state&&!b.state.loaded&&d.push(b.id),g=0,h=f.length;h>g;g++)e[f[g]]&&e[f[g]].state&&!e[f[g]].state.loaded&&d.push(f[g]);d.length?this._load_nodes(d,function(){this.load_all(b,c)}):(c&&c.call(this,b),this.trigger("load_all",{node:b}))},_load_node:function(b,c){var d=this.settings.core.data,e,f=function g(){return 3!==this.nodeType&&8!==this.nodeType};return d?a.isFunction(d)?d.call(this,b,a.proxy(function(d){d===!1?c.call(this,!1):this["string"==typeof d?"_append_html_data":"_append_json_data"](b,"string"==typeof d?a(a.parseHTML(d)).filter(f):d,function(a){c.call(this,a)})},this)):"object"==typeof d?d.url?(d=a.extend(!0,{},d),a.isFunction(d.url)&&(d.url=d.url.call(this,b)),a.isFunction(d.data)&&(d.data=d.data.call(this,b)),a.ajax(d).done(a.proxy(function(d,e,g){var h=g.getResponseHeader("Content-Type");return h&&-1!==h.indexOf("json")||"object"==typeof d?this._append_json_data(b,d,function(a){c.call(this,a)}):h&&-1!==h.indexOf("html")||"string"==typeof d?this._append_html_data(b,a(a.parseHTML(d)).filter(f),function(a){c.call(this,a)}):(this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:b.id,xhr:g})},this.settings.core.error.call(this,this._data.core.last_error),c.call(this,!1))},this)).fail(a.proxy(function(a){this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:b.id,xhr:a})},c.call(this,!1),this.settings.core.error.call(this,this._data.core.last_error)},this))):(e=a.isArray(d)?a.extend(!0,[],d):a.isPlainObject(d)?a.extend(!0,{},d):d,b.id===a.jstree.root?this._append_json_data(b,e,function(a){c.call(this,a)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_05",reason:"Could not load node",data:JSON.stringify({id:b.id})},this.settings.core.error.call(this,this._data.core.last_error),c.call(this,!1))):"string"==typeof d?b.id===a.jstree.root?this._append_html_data(b,a(a.parseHTML(d)).filter(f),function(a){c.call(this,a)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_06",reason:"Could not load node",data:JSON.stringify({id:b.id})},this.settings.core.error.call(this,this._data.core.last_error),c.call(this,!1)):c.call(this,!1):b.id===a.jstree.root?this._append_html_data(b,this._data.core.original_container_html.clone(!0),function(a){c.call(this,a)}):c.call(this,!1)},_node_changed:function(b){b=this.get_node(b),b&&-1===a.inArray(b.id,this._model.changed)&&this._model.changed.push(b.id)},_append_html_data:function(b,c,d){b=this.get_node(b),b.children=[],b.children_d=[];var e=c.is("ul")?c.children():c,f=b.id,g=[],h=[],i=this._model.data,j=i[f],k=this._data.core.selected.length,l,m,n;for(e.each(a.proxy(function(b,c){l=this._parse_model_from_html(a(c),f,j.parents.concat()),l&&(g.push(l),h.push(l),i[l].children_d.length&&(h=h.concat(i[l].children_d)))},this)),j.children=g,j.children_d=h,m=0,n=j.parents.length;n>m;m++)i[j.parents[m]].children_d=i[j.parents[m]].children_d.concat(h);this.trigger("model",{nodes:h,parent:f}),f!==a.jstree.root?(this._node_changed(f),this.redraw()):(this.get_container_ul().children(".jstree-initial-node").remove(),this.redraw(!0)),this._data.core.selected.length!==k&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),d.call(this,!0)},_append_json_data:function(b,c,d,e){if(null!==this.element){b=this.get_node(b),b.children=[],b.children_d=[],c.d&&(c=c.d,"string"==typeof c&&(c=JSON.parse(c))),a.isArray(c)||(c=[c]);var f=null,g={df:this._model.default_state,dat:c,par:b.id,m:this._model.data,t_id:this._id,t_cnt:this._cnt,sel:this._data.core.selected},h=this,i=function(a,b){a.data&&(a=a.data);var c=a.dat,d=a.par,e=[],f=[],g=[],i=a.df,j=a.t_id,k=a.t_cnt,l=a.m,m=l[d],n=a.sel,o,p,q,r,s=function(a,c,d){d=d?d.concat():[],c&&d.unshift(c);var e=a.id.toString(),f,h,j,k,m={id:e,text:a.text||"",icon:a.icon!==b?a.icon:!0,parent:c,parents:d,children:a.children||[],children_d:a.children_d||[],data:a.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(f in i)i.hasOwnProperty(f)&&(m.state[f]=i[f]);if(a&&a.data&&a.data.jstree&&a.data.jstree.icon&&(m.icon=a.data.jstree.icon),(m.icon===b||null===m.icon||""===m.icon)&&(m.icon=!0),a&&a.data&&(m.data=a.data,a.data.jstree))for(f in a.data.jstree)a.data.jstree.hasOwnProperty(f)&&(m.state[f]=a.data.jstree[f]);if(a&&"object"==typeof a.state)for(f in a.state)a.state.hasOwnProperty(f)&&(m.state[f]=a.state[f]);if(a&&"object"==typeof a.li_attr)for(f in a.li_attr)a.li_attr.hasOwnProperty(f)&&(m.li_attr[f]=a.li_attr[f]);if(m.li_attr.id||(m.li_attr.id=e),a&&"object"==typeof a.a_attr)for(f in a.a_attr)a.a_attr.hasOwnProperty(f)&&(m.a_attr[f]=a.a_attr[f]);for(a&&a.children&&a.children===!0&&(m.state.loaded=!1,m.children=[],m.children_d=[]),l[m.id]=m,f=0,h=m.children.length;h>f;f++)j=s(l[m.children[f]],m.id,d),k=l[j],m.children_d.push(j),k.children_d.length&&(m.children_d=m.children_d.concat(k.children_d));return delete a.data,delete a.children,l[m.id].original=a,m.state.selected&&g.push(m.id),m.id},t=function(a,c,d){d=d?d.concat():[],c&&d.unshift(c);var e=!1,f,h,m,n,o;do e="j"+j+"_"+ ++k;while(l[e]);o={id:!1,text:"string"==typeof a?a:"",icon:"object"==typeof a&&a.icon!==b?a.icon:!0,parent:c,parents:d,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(f in i)i.hasOwnProperty(f)&&(o.state[f]=i[f]);if(a&&a.id&&(o.id=a.id.toString()),a&&a.text&&(o.text=a.text),a&&a.data&&a.data.jstree&&a.data.jstree.icon&&(o.icon=a.data.jstree.icon),(o.icon===b||null===o.icon||""===o.icon)&&(o.icon=!0),a&&a.data&&(o.data=a.data,a.data.jstree))for(f in a.data.jstree)a.data.jstree.hasOwnProperty(f)&&(o.state[f]=a.data.jstree[f]);if(a&&"object"==typeof a.state)for(f in a.state)a.state.hasOwnProperty(f)&&(o.state[f]=a.state[f]);if(a&&"object"==typeof a.li_attr)for(f in a.li_attr)a.li_attr.hasOwnProperty(f)&&(o.li_attr[f]=a.li_attr[f]);if(o.li_attr.id&&!o.id&&(o.id=o.li_attr.id.toString()),o.id||(o.id=e),o.li_attr.id||(o.li_attr.id=o.id),a&&"object"==typeof a.a_attr)for(f in a.a_attr)a.a_attr.hasOwnProperty(f)&&(o.a_attr[f]=a.a_attr[f]);if(a&&a.children&&a.children.length){for(f=0,h=a.children.length;h>f;f++)m=t(a.children[f],o.id,d),n=l[m],o.children.push(m),n.children_d.length&&(o.children_d=o.children_d.concat(n.children_d));o.children_d=o.children_d.concat(o.children)}return a&&a.children&&a.children===!0&&(o.state.loaded=!1,o.children=[],o.children_d=[]),delete a.data,delete a.children,o.original=a,l[o.id]=o,o.state.selected&&g.push(o.id),o.id};if(c.length&&c[0].id!==b&&c[0].parent!==b){for(p=0,q=c.length;q>p;p++)c[p].children||(c[p].children=[]),c[p].state||(c[p].state={}),l[c[p].id.toString()]=c[p];for(p=0,q=c.length;q>p;p++)l[c[p].parent.toString()]?(l[c[p].parent.toString()].children.push(c[p].id.toString()),m.children_d.push(c[p].id.toString())):"undefined"!=typeof h&&(h._data.core.last_error={error:"parse",plugin:"core",id:"core_07",reason:"Node with invalid parent",data:JSON.stringify({id:c[p].id.toString(),parent:c[p].parent.toString()})},h.settings.core.error.call(h,h._data.core.last_error));for(p=0,q=m.children.length;q>p;p++)o=s(l[m.children[p]],d,m.parents.concat()),f.push(o),l[o].children_d.length&&(f=f.concat(l[o].children_d));for(p=0,q=m.parents.length;q>p;p++)l[m.parents[p]].children_d=l[m.parents[p]].children_d.concat(f);r={cnt:k,mod:l,sel:n,par:d,dpc:f,add:g}}else{for(p=0,q=c.length;q>p;p++)o=t(c[p],d,m.parents.concat()),o&&(e.push(o),f.push(o),l[o].children_d.length&&(f=f.concat(l[o].children_d)));for(m.children=e,m.children_d=f,p=0,q=m.parents.length;q>p;p++)l[m.parents[p]].children_d=l[m.parents[p]].children_d.concat(f);r={cnt:k,mod:l,sel:n,par:d,dpc:f,add:g}}return"undefined"!=typeof window&&"undefined"!=typeof window.document?r:void postMessage(r)},j=function(b,c){if(null!==this.element){this._cnt=b.cnt;var e,f=this._model.data;for(e in f)f.hasOwnProperty(e)&&f[e].state&&f[e].state.loading&&b.mod[e]&&(b.mod[e].state.loading=!0);if(this._model.data=b.mod,c){var g,h=b.add,i=b.sel,j=this._data.core.selected.slice();if(f=this._model.data,i.length!==j.length||a.vakata.array_unique(i.concat(j)).length!==i.length){for(e=0,g=i.length;g>e;e++)-1===a.inArray(i[e],h)&&-1===a.inArray(i[e],j)&&(f[i[e]].state.selected=!1);for(e=0,g=j.length;g>e;e++)-1===a.inArray(j[e],i)&&(f[j[e]].state.selected=!0)}}b.add.length&&(this._data.core.selected=this._data.core.selected.concat(b.add)),this.trigger("model",{nodes:b.dpc,parent:b.par}),b.par!==a.jstree.root?(this._node_changed(b.par),this.redraw()):this.redraw(!0),b.add.length&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),d.call(this,!0)}};if(this.settings.core.worker&&window.Blob&&window.URL&&window.Worker)try{null===this._wrk&&(this._wrk=window.URL.createObjectURL(new window.Blob(["self.onmessage = "+i.toString()],{type:"text/javascript"}))),!this._data.core.working||e?(this._data.core.working=!0,f=new window.Worker(this._wrk),f.onmessage=a.proxy(function(a){j.call(this,a.data,!0);try{f.terminate(),f=null}catch(b){}this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1},this),g.par?f.postMessage(g):this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1):this._data.core.worker_queue.push([b,c,d,!0])}catch(k){j.call(this,i(g),!1),this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1}else j.call(this,i(g),!1)}},_parse_model_from_html:function(c,d,e){e=e?[].concat(e):[],d&&e.unshift(d);var f,g,h=this._model.data,i={id:!1,text:!1,icon:!0,parent:d,parents:e,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1},j,k,l;for(j in this._model.default_state)this._model.default_state.hasOwnProperty(j)&&(i.state[j]=this._model.default_state[j]);if(k=a.vakata.attributes(c,!0),a.each(k,function(b,c){return c=a.trim(c),c.length?(i.li_attr[b]=c,void("id"===b&&(i.id=c.toString()))):!0}),k=c.children("a").first(),k.length&&(k=a.vakata.attributes(k,!0),a.each(k,function(b,c){c=a.trim(c),c.length&&(i.a_attr[b]=c)})),k=c.children("a").first().length?c.children("a").first().clone():c.clone(),k.children("ins, i, ul").remove(),k=k.html(),k=a("<div />").html(k),i.text=this.settings.core.force_text?k.text():k.html(),k=c.data(),i.data=k?a.extend(!0,{},k):null,i.state.opened=c.hasClass("jstree-open"),i.state.selected=c.children("a").hasClass("jstree-clicked"),i.state.disabled=c.children("a").hasClass("jstree-disabled"),i.data&&i.data.jstree)for(j in i.data.jstree)i.data.jstree.hasOwnProperty(j)&&(i.state[j]=i.data.jstree[j]);k=c.children("a").children(".jstree-themeicon"),k.length&&(i.icon=k.hasClass("jstree-themeicon-hidden")?!1:k.attr("rel")),i.state.icon!==b&&(i.icon=i.state.icon),(i.icon===b||null===i.icon||""===i.icon)&&(i.icon=!0),k=c.children("ul").children("li");do l="j"+this._id+"_"+ ++this._cnt;while(h[l]);return i.id=i.li_attr.id?i.li_attr.id.toString():l,k.length?(k.each(a.proxy(function(b,c){f=this._parse_model_from_html(a(c),i.id,e),g=this._model.data[f],i.children.push(f),g.children_d.length&&(i.children_d=i.children_d.concat(g.children_d))},this)),i.children_d=i.children_d.concat(i.children)):c.hasClass("jstree-closed")&&(i.state.loaded=!1),i.li_attr["class"]&&(i.li_attr["class"]=i.li_attr["class"].replace("jstree-closed","").replace("jstree-open","")),i.a_attr["class"]&&(i.a_attr["class"]=i.a_attr["class"].replace("jstree-clicked","").replace("jstree-disabled","")),h[i.id]=i,i.state.selected&&this._data.core.selected.push(i.id),i.id},_parse_model_from_flat_json:function(a,c,d){d=d?d.concat():[],c&&d.unshift(c);var e=a.id.toString(),f=this._model.data,g=this._model.default_state,h,i,j,k,l={id:e,text:a.text||"",icon:a.icon!==b?a.icon:!0,parent:c,parents:d,children:a.children||[],children_d:a.children_d||[],data:a.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(h in g)g.hasOwnProperty(h)&&(l.state[h]=g[h]);if(a&&a.data&&a.data.jstree&&a.data.jstree.icon&&(l.icon=a.data.jstree.icon),(l.icon===b||null===l.icon||""===l.icon)&&(l.icon=!0),a&&a.data&&(l.data=a.data,a.data.jstree))for(h in a.data.jstree)a.data.jstree.hasOwnProperty(h)&&(l.state[h]=a.data.jstree[h]);if(a&&"object"==typeof a.state)for(h in a.state)a.state.hasOwnProperty(h)&&(l.state[h]=a.state[h]);if(a&&"object"==typeof a.li_attr)for(h in a.li_attr)a.li_attr.hasOwnProperty(h)&&(l.li_attr[h]=a.li_attr[h]);if(l.li_attr.id||(l.li_attr.id=e),a&&"object"==typeof a.a_attr)for(h in a.a_attr)a.a_attr.hasOwnProperty(h)&&(l.a_attr[h]=a.a_attr[h]);for(a&&a.children&&a.children===!0&&(l.state.loaded=!1,l.children=[],l.children_d=[]),f[l.id]=l,h=0,i=l.children.length;i>h;h++)j=this._parse_model_from_flat_json(f[l.children[h]],l.id,d),k=f[j],l.children_d.push(j),k.children_d.length&&(l.children_d=l.children_d.concat(k.children_d));return delete a.data,delete a.children,f[l.id].original=a,l.state.selected&&this._data.core.selected.push(l.id),l.id},_parse_model_from_json:function(a,c,d){d=d?d.concat():[],c&&d.unshift(c);var e=!1,f,g,h,i,j=this._model.data,k=this._model.default_state,l;do e="j"+this._id+"_"+ ++this._cnt;while(j[e]);l={id:!1,text:"string"==typeof a?a:"",icon:"object"==typeof a&&a.icon!==b?a.icon:!0,parent:c,parents:d,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(f in k)k.hasOwnProperty(f)&&(l.state[f]=k[f]);if(a&&a.id&&(l.id=a.id.toString()),a&&a.text&&(l.text=a.text),a&&a.data&&a.data.jstree&&a.data.jstree.icon&&(l.icon=a.data.jstree.icon),(l.icon===b||null===l.icon||""===l.icon)&&(l.icon=!0),a&&a.data&&(l.data=a.data,a.data.jstree))for(f in a.data.jstree)a.data.jstree.hasOwnProperty(f)&&(l.state[f]=a.data.jstree[f]);if(a&&"object"==typeof a.state)for(f in a.state)a.state.hasOwnProperty(f)&&(l.state[f]=a.state[f]);if(a&&"object"==typeof a.li_attr)for(f in a.li_attr)a.li_attr.hasOwnProperty(f)&&(l.li_attr[f]=a.li_attr[f]);
3
+ if(l.li_attr.id&&!l.id&&(l.id=l.li_attr.id.toString()),l.id||(l.id=e),l.li_attr.id||(l.li_attr.id=l.id),a&&"object"==typeof a.a_attr)for(f in a.a_attr)a.a_attr.hasOwnProperty(f)&&(l.a_attr[f]=a.a_attr[f]);if(a&&a.children&&a.children.length){for(f=0,g=a.children.length;g>f;f++)h=this._parse_model_from_json(a.children[f],l.id,d),i=j[h],l.children.push(h),i.children_d.length&&(l.children_d=l.children_d.concat(i.children_d));l.children_d=l.children.concat(l.children_d)}return a&&a.children&&a.children===!0&&(l.state.loaded=!1,l.children=[],l.children_d=[]),delete a.data,delete a.children,l.original=a,j[l.id]=l,l.state.selected&&this._data.core.selected.push(l.id),l.id},_redraw:function(){var b=this._model.force_full_redraw?this._model.data[a.jstree.root].children.concat([]):this._model.changed.concat([]),c=i.createElement("UL"),d,e,f,g=this._data.core.focused;for(e=0,f=b.length;f>e;e++)d=this.redraw_node(b[e],!0,this._model.force_full_redraw),d&&this._model.force_full_redraw&&c.appendChild(d);this._model.force_full_redraw&&(c.className=this.get_container_ul()[0].className,c.setAttribute("role","group"),this.element.empty().append(c)),null!==g&&this.settings.core.restore_focus&&(d=this.get_node(g,!0),d&&d.length&&d.children(".jstree-anchor")[0]!==i.activeElement?d.children(".jstree-anchor").focus():this._data.core.focused=null),this._model.force_full_redraw=!1,this._model.changed=[],this.trigger("redraw",{nodes:b})},redraw:function(a){a&&(this._model.force_full_redraw=!0),this._redraw()},draw_children:function(b){var c=this.get_node(b),d=!1,e=!1,f=!1,g=i;if(!c)return!1;if(c.id===a.jstree.root)return this.redraw(!0);if(b=this.get_node(b,!0),!b||!b.length)return!1;if(b.children(".jstree-children").remove(),b=b[0],c.children.length&&c.state.loaded){for(f=g.createElement("UL"),f.setAttribute("role","group"),f.className="jstree-children",d=0,e=c.children.length;e>d;d++)f.appendChild(this.redraw_node(c.children[d],!0,!0));b.appendChild(f)}},redraw_node:function(b,c,d,e){var f=this.get_node(b),g=!1,h=!1,j=!1,k=!1,l=!1,m=!1,n="",o=i,p=this._model.data,q=!1,r=!1,s=null,t=0,u=0,v=!1,w=!1;if(!f)return!1;if(f.id===a.jstree.root)return this.redraw(!0);if(c=c||0===f.children.length,b=i.querySelector?this.element[0].querySelector("#"+(-1!=="0123456789".indexOf(f.id[0])?"\\3"+f.id[0]+" "+f.id.substr(1).replace(a.jstree.idregex,"\\$&"):f.id.replace(a.jstree.idregex,"\\$&"))):i.getElementById(f.id))b=a(b),d||(g=b.parent().parent()[0],g===this.element[0]&&(g=null),h=b.index()),c||!f.children.length||b.children(".jstree-children").length||(c=!0),c||(j=b.children(".jstree-children")[0]),q=b.children(".jstree-anchor")[0]===i.activeElement,b.remove();else if(c=!0,!d){if(g=f.parent!==a.jstree.root?a("#"+f.parent.replace(a.jstree.idregex,"\\$&"),this.element)[0]:null,!(null===g||g&&p[f.parent].state.opened))return!1;h=a.inArray(f.id,null===g?p[a.jstree.root].children:p[f.parent].children)}b=this._data.core.node.cloneNode(!0),n="jstree-node ";for(k in f.li_attr)if(f.li_attr.hasOwnProperty(k)){if("id"===k)continue;"class"!==k?b.setAttribute(k,f.li_attr[k]):n+=f.li_attr[k]}for(f.a_attr.id||(f.a_attr.id=f.id+"_anchor"),b.setAttribute("aria-selected",!!f.state.selected),b.setAttribute("aria-level",f.parents.length),b.setAttribute("aria-labelledby",f.a_attr.id),f.state.disabled&&b.setAttribute("aria-disabled",!0),k=0,l=f.children.length;l>k;k++)if(!p[f.children[k]].state.hidden){v=!0;break}if(null!==f.parent&&p[f.parent]&&!f.state.hidden&&(k=a.inArray(f.id,p[f.parent].children),w=f.id,-1!==k))for(k++,l=p[f.parent].children.length;l>k;k++)if(p[p[f.parent].children[k]].state.hidden||(w=p[f.parent].children[k]),w!==f.id)break;f.state.hidden&&(n+=" jstree-hidden"),f.state.loading&&(n+=" jstree-loading"),f.state.loaded&&!v?n+=" jstree-leaf":(n+=f.state.opened&&f.state.loaded?" jstree-open":" jstree-closed",b.setAttribute("aria-expanded",f.state.opened&&f.state.loaded)),w===f.id&&(n+=" jstree-last"),b.id=f.id,b.className=n,n=(f.state.selected?" jstree-clicked":"")+(f.state.disabled?" jstree-disabled":"");for(l in f.a_attr)if(f.a_attr.hasOwnProperty(l)){if("href"===l&&"#"===f.a_attr[l])continue;"class"!==l?b.childNodes[1].setAttribute(l,f.a_attr[l]):n+=" "+f.a_attr[l]}if(n.length&&(b.childNodes[1].className="jstree-anchor "+n),(f.icon&&f.icon!==!0||f.icon===!1)&&(f.icon===!1?b.childNodes[1].childNodes[0].className+=" jstree-themeicon-hidden":-1===f.icon.indexOf("/")&&-1===f.icon.indexOf(".")?b.childNodes[1].childNodes[0].className+=" "+f.icon+" jstree-themeicon-custom":(b.childNodes[1].childNodes[0].style.backgroundImage='url("'+f.icon+'")',b.childNodes[1].childNodes[0].style.backgroundPosition="center center",b.childNodes[1].childNodes[0].style.backgroundSize="auto",b.childNodes[1].childNodes[0].className+=" jstree-themeicon-custom")),this.settings.core.force_text?b.childNodes[1].appendChild(o.createTextNode(f.text)):b.childNodes[1].innerHTML+=f.text,c&&f.children.length&&(f.state.opened||e)&&f.state.loaded){for(m=o.createElement("UL"),m.setAttribute("role","group"),m.className="jstree-children",k=0,l=f.children.length;l>k;k++)m.appendChild(this.redraw_node(f.children[k],c,!0));b.appendChild(m)}if(j&&b.appendChild(j),!d){for(g||(g=this.element[0]),k=0,l=g.childNodes.length;l>k;k++)if(g.childNodes[k]&&g.childNodes[k].className&&-1!==g.childNodes[k].className.indexOf("jstree-children")){s=g.childNodes[k];break}s||(s=o.createElement("UL"),s.setAttribute("role","group"),s.className="jstree-children",g.appendChild(s)),g=s,h<g.childNodes.length?g.insertBefore(b,g.childNodes[h]):g.appendChild(b),q&&(t=this.element[0].scrollTop,u=this.element[0].scrollLeft,b.childNodes[1].focus(),this.element[0].scrollTop=t,this.element[0].scrollLeft=u)}return f.state.opened&&!f.state.loaded&&(f.state.opened=!1,setTimeout(a.proxy(function(){this.open_node(f.id,!1,0)},this),0)),b},open_node:function(c,d,e){var f,g,h,i;if(a.isArray(c)){for(c=c.slice(),f=0,g=c.length;g>f;f++)this.open_node(c[f],d,e);return!0}return c=this.get_node(c),c&&c.id!==a.jstree.root?(e=e===b?this.settings.core.animation:e,this.is_closed(c)?this.is_loaded(c)?(h=this.get_node(c,!0),i=this,h.length&&(e&&h.children(".jstree-children").length&&h.children(".jstree-children").stop(!0,!0),c.children.length&&!this._firstChild(h.children(".jstree-children")[0])&&this.draw_children(c),e?(this.trigger("before_open",{node:c}),h.children(".jstree-children").css("display","none").end().removeClass("jstree-closed").addClass("jstree-open").attr("aria-expanded",!0).children(".jstree-children").stop(!0,!0).slideDown(e,function(){this.style.display="",i.element&&i.trigger("after_open",{node:c})})):(this.trigger("before_open",{node:c}),h[0].className=h[0].className.replace("jstree-closed","jstree-open"),h[0].setAttribute("aria-expanded",!0))),c.state.opened=!0,d&&d.call(this,c,!0),h.length||this.trigger("before_open",{node:c}),this.trigger("open_node",{node:c}),e&&h.length||this.trigger("after_open",{node:c}),!0):this.is_loading(c)?setTimeout(a.proxy(function(){this.open_node(c,d,e)},this),500):void this.load_node(c,function(a,b){return b?this.open_node(a,d,e):d?d.call(this,a,!1):!1}):(d&&d.call(this,c,!1),!1)):!1},_open_to:function(b){if(b=this.get_node(b),!b||b.id===a.jstree.root)return!1;var c,d,e=b.parents;for(c=0,d=e.length;d>c;c+=1)c!==a.jstree.root&&this.open_node(e[c],!1,0);return a("#"+b.id.replace(a.jstree.idregex,"\\$&"),this.element)},close_node:function(c,d){var e,f,g,h;if(a.isArray(c)){for(c=c.slice(),e=0,f=c.length;f>e;e++)this.close_node(c[e],d);return!0}return c=this.get_node(c),c&&c.id!==a.jstree.root?this.is_closed(c)?!1:(d=d===b?this.settings.core.animation:d,g=this,h=this.get_node(c,!0),c.state.opened=!1,this.trigger("close_node",{node:c}),void(h.length?d?h.children(".jstree-children").attr("style","display:block !important").end().removeClass("jstree-open").addClass("jstree-closed").attr("aria-expanded",!1).children(".jstree-children").stop(!0,!0).slideUp(d,function(){this.style.display="",h.children(".jstree-children").remove(),g.element&&g.trigger("after_close",{node:c})}):(h[0].className=h[0].className.replace("jstree-open","jstree-closed"),h.attr("aria-expanded",!1).children(".jstree-children").remove(),this.trigger("after_close",{node:c})):this.trigger("after_close",{node:c}))):!1},toggle_node:function(b){var c,d;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.toggle_node(b[c]);return!0}return this.is_closed(b)?this.open_node(b):this.is_open(b)?this.close_node(b):void 0},open_all:function(b,c,d){if(b||(b=a.jstree.root),b=this.get_node(b),!b)return!1;var e=b.id===a.jstree.root?this.get_container_ul():this.get_node(b,!0),f,g,h;if(!e.length){for(f=0,g=b.children_d.length;g>f;f++)this.is_closed(this._model.data[b.children_d[f]])&&(this._model.data[b.children_d[f]].state.opened=!0);return this.trigger("open_all",{node:b})}d=d||e,h=this,e=this.is_closed(b)?e.find(".jstree-closed").addBack():e.find(".jstree-closed"),e.each(function(){h.open_node(this,function(a,b){b&&this.is_parent(a)&&this.open_all(a,c,d)},c||0)}),0===d.find(".jstree-closed").length&&this.trigger("open_all",{node:this.get_node(d)})},close_all:function(b,c){if(b||(b=a.jstree.root),b=this.get_node(b),!b)return!1;var d=b.id===a.jstree.root?this.get_container_ul():this.get_node(b,!0),e=this,f,g;for(d.length&&(d=this.is_open(b)?d.find(".jstree-open").addBack():d.find(".jstree-open"),a(d.get().reverse()).each(function(){e.close_node(this,c||0)})),f=0,g=b.children_d.length;g>f;f++)this._model.data[b.children_d[f]].state.opened=!1;this.trigger("close_all",{node:b})},is_disabled:function(a){return a=this.get_node(a),a&&a.state&&a.state.disabled},enable_node:function(b){var c,d;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.enable_node(b[c]);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(b.state.disabled=!1,this.get_node(b,!0).children(".jstree-anchor").removeClass("jstree-disabled").attr("aria-disabled",!1),void this.trigger("enable_node",{node:b})):!1},disable_node:function(b){var c,d;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.disable_node(b[c]);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(b.state.disabled=!0,this.get_node(b,!0).children(".jstree-anchor").addClass("jstree-disabled").attr("aria-disabled",!0),void this.trigger("disable_node",{node:b})):!1},is_hidden:function(a){return a=this.get_node(a),a.state.hidden===!0},hide_node:function(b,c){var d,e;if(a.isArray(b)){for(b=b.slice(),d=0,e=b.length;e>d;d++)this.hide_node(b[d],!0);return c||this.redraw(),!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?void(b.state.hidden||(b.state.hidden=!0,this._node_changed(b.parent),c||this.redraw(),this.trigger("hide_node",{node:b}))):!1},show_node:function(b,c){var d,e;if(a.isArray(b)){for(b=b.slice(),d=0,e=b.length;e>d;d++)this.show_node(b[d],!0);return c||this.redraw(),!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?void(b.state.hidden&&(b.state.hidden=!1,this._node_changed(b.parent),c||this.redraw(),this.trigger("show_node",{node:b}))):!1},hide_all:function(b){var c,d=this._model.data,e=[];for(c in d)d.hasOwnProperty(c)&&c!==a.jstree.root&&!d[c].state.hidden&&(d[c].state.hidden=!0,e.push(c));return this._model.force_full_redraw=!0,b||this.redraw(),this.trigger("hide_all",{nodes:e}),e},show_all:function(b){var c,d=this._model.data,e=[];for(c in d)d.hasOwnProperty(c)&&c!==a.jstree.root&&d[c].state.hidden&&(d[c].state.hidden=!1,e.push(c));return this._model.force_full_redraw=!0,b||this.redraw(),this.trigger("show_all",{nodes:e}),e},activate_node:function(a,c){if(this.is_disabled(a))return!1;if(c&&"object"==typeof c||(c={}),this._data.core.last_clicked=this._data.core.last_clicked&&this._data.core.last_clicked.id!==b?this.get_node(this._data.core.last_clicked.id):null,this._data.core.last_clicked&&!this._data.core.last_clicked.state.selected&&(this._data.core.last_clicked=null),!this._data.core.last_clicked&&this._data.core.selected.length&&(this._data.core.last_clicked=this.get_node(this._data.core.selected[this._data.core.selected.length-1])),this.settings.core.multiple&&(c.metaKey||c.ctrlKey||c.shiftKey)&&(!c.shiftKey||this._data.core.last_clicked&&this.get_parent(a)&&this.get_parent(a)===this._data.core.last_clicked.parent))if(c.shiftKey){var d=this.get_node(a).id,e=this._data.core.last_clicked.id,f=this.get_node(this._data.core.last_clicked.parent).children,g=!1,h,i;for(h=0,i=f.length;i>h;h+=1)f[h]===d&&(g=!g),f[h]===e&&(g=!g),this.is_disabled(f[h])||!g&&f[h]!==d&&f[h]!==e?this.deselect_node(f[h],!0,c):this.is_hidden(f[h])||this.select_node(f[h],!0,!1,c);this.trigger("changed",{action:"select_node",node:this.get_node(a),selected:this._data.core.selected,event:c})}else this.is_selected(a)?this.deselect_node(a,!1,c):this.select_node(a,!1,!1,c);else!this.settings.core.multiple&&(c.metaKey||c.ctrlKey||c.shiftKey)&&this.is_selected(a)?this.deselect_node(a,!1,c):(this.deselect_all(!0),this.select_node(a,!1,!1,c),this._data.core.last_clicked=this.get_node(a));this.trigger("activate_node",{node:this.get_node(a),event:c})},hover_node:function(a){if(a=this.get_node(a,!0),!a||!a.length||a.children(".jstree-hovered").length)return!1;var b=this.element.find(".jstree-hovered"),c=this.element;b&&b.length&&this.dehover_node(b),a.children(".jstree-anchor").addClass("jstree-hovered"),this.trigger("hover_node",{node:this.get_node(a)}),setTimeout(function(){c.attr("aria-activedescendant",a[0].id)},0)},dehover_node:function(a){return a=this.get_node(a,!0),a&&a.length&&a.children(".jstree-hovered").length?(a.children(".jstree-anchor").removeClass("jstree-hovered"),void this.trigger("dehover_node",{node:this.get_node(a)})):!1},select_node:function(b,c,d,e){var f,g,h,i;if(a.isArray(b)){for(b=b.slice(),g=0,h=b.length;h>g;g++)this.select_node(b[g],c,d,e);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(f=this.get_node(b,!0),void(b.state.selected||(b.state.selected=!0,this._data.core.selected.push(b.id),d||(f=this._open_to(b)),f&&f.length&&f.attr("aria-selected",!0).children(".jstree-anchor").addClass("jstree-clicked"),this.trigger("select_node",{node:b,selected:this._data.core.selected,event:e}),c||this.trigger("changed",{action:"select_node",node:b,selected:this._data.core.selected,event:e})))):!1},deselect_node:function(b,c,d){var e,f,g;if(a.isArray(b)){for(b=b.slice(),e=0,f=b.length;f>e;e++)this.deselect_node(b[e],c,d);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(g=this.get_node(b,!0),void(b.state.selected&&(b.state.selected=!1,this._data.core.selected=a.vakata.array_remove_item(this._data.core.selected,b.id),g.length&&g.attr("aria-selected",!1).children(".jstree-anchor").removeClass("jstree-clicked"),this.trigger("deselect_node",{node:b,selected:this._data.core.selected,event:d}),c||this.trigger("changed",{action:"deselect_node",node:b,selected:this._data.core.selected,event:d})))):!1},select_all:function(b){var c=this._data.core.selected.concat([]),d,e;for(this._data.core.selected=this._model.data[a.jstree.root].children_d.concat(),d=0,e=this._data.core.selected.length;e>d;d++)this._model.data[this._data.core.selected[d]]&&(this._model.data[this._data.core.selected[d]].state.selected=!0);this.redraw(!0),this.trigger("select_all",{selected:this._data.core.selected}),b||this.trigger("changed",{action:"select_all",selected:this._data.core.selected,old_selection:c})},deselect_all:function(a){var b=this._data.core.selected.concat([]),c,d;for(c=0,d=this._data.core.selected.length;d>c;c++)this._model.data[this._data.core.selected[c]]&&(this._model.data[this._data.core.selected[c]].state.selected=!1);this._data.core.selected=[],this.element.find(".jstree-clicked").removeClass("jstree-clicked").parent().attr("aria-selected",!1),this.trigger("deselect_all",{selected:this._data.core.selected,node:b}),a||this.trigger("changed",{action:"deselect_all",selected:this._data.core.selected,old_selection:b})},is_selected:function(b){return b=this.get_node(b),b&&b.id!==a.jstree.root?b.state.selected:!1},get_selected:function(b){return b?a.map(this._data.core.selected,a.proxy(function(a){return this.get_node(a)},this)):this._data.core.selected.slice()},get_top_selected:function(b){var c=this.get_selected(!0),d={},e,f,g,h;for(e=0,f=c.length;f>e;e++)d[c[e].id]=c[e];for(e=0,f=c.length;f>e;e++)for(g=0,h=c[e].children_d.length;h>g;g++)d[c[e].children_d[g]]&&delete d[c[e].children_d[g]];c=[];for(e in d)d.hasOwnProperty(e)&&c.push(e);return b?a.map(c,a.proxy(function(a){return this.get_node(a)},this)):c},get_bottom_selected:function(b){var c=this.get_selected(!0),d=[],e,f;for(e=0,f=c.length;f>e;e++)c[e].children.length||d.push(c[e].id);return b?a.map(d,a.proxy(function(a){return this.get_node(a)},this)):d},get_state:function(){var b={core:{open:[],loaded:[],scroll:{left:this.element.scrollLeft(),top:this.element.scrollTop()},selected:[]}},c;for(c in this._model.data)this._model.data.hasOwnProperty(c)&&c!==a.jstree.root&&(this._model.data[c].state.loaded&&this.settings.core.loaded_state&&b.core.loaded.push(c),this._model.data[c].state.opened&&b.core.open.push(c),this._model.data[c].state.selected&&b.core.selected.push(c));return b},set_state:function(c,d){if(c){if(c.core&&c.core.selected&&c.core.initial_selection===b&&(c.core.initial_selection=this._data.core.selected.concat([]).sort().join(",")),c.core){var e,f,g,h,i;if(c.core.loaded)return this.settings.core.loaded_state&&a.isArray(c.core.loaded)&&c.core.loaded.length?this._load_nodes(c.core.loaded,function(a){delete c.core.loaded,this.set_state(c,d)}):(delete c.core.loaded,this.set_state(c,d)),!1;if(c.core.open)return a.isArray(c.core.open)&&c.core.open.length?this._load_nodes(c.core.open,function(a){this.open_node(a,!1,0),delete c.core.open,this.set_state(c,d)}):(delete c.core.open,this.set_state(c,d)),!1;if(c.core.scroll)return c.core.scroll&&c.core.scroll.left!==b&&this.element.scrollLeft(c.core.scroll.left),c.core.scroll&&c.core.scroll.top!==b&&this.element.scrollTop(c.core.scroll.top),delete c.core.scroll,this.set_state(c,d),!1;if(c.core.selected)return h=this,(c.core.initial_selection===b||c.core.initial_selection===this._data.core.selected.concat([]).sort().join(","))&&(this.deselect_all(),a.each(c.core.selected,function(a,b){h.select_node(b,!1,!0)})),delete c.core.initial_selection,delete c.core.selected,this.set_state(c,d),!1;for(i in c)c.hasOwnProperty(i)&&"core"!==i&&-1===a.inArray(i,this.settings.plugins)&&delete c[i];if(a.isEmptyObject(c.core))return delete c.core,this.set_state(c,d),!1}return a.isEmptyObject(c)?(c=null,d&&d.call(this),this.trigger("set_state"),!1):!0}return!1},refresh:function(b,c){this._data.core.state=c===!0?{}:this.get_state(),c&&a.isFunction(c)&&(this._data.core.state=c.call(this,this._data.core.state)),this._cnt=0,this._model.data={},this._model.data[a.jstree.root]={id:a.jstree.root,parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}},this._data.core.selected=[],this._data.core.last_clicked=null,this._data.core.focused=null;var d=this.get_container_ul()[0].className;b||(this.element.html("<ul class='"+d+"' role='group'><li class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='treeitem' id='j"+this._id+"_loading'><i class='jstree-icon jstree-ocl'></i><a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'></i>"+this.get_string("Loading ...")+"</a></li></ul>"),this.element.attr("aria-activedescendant","j"+this._id+"_loading")),this.load_node(a.jstree.root,function(b,c){c&&(this.get_container_ul()[0].className=d,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.set_state(a.extend(!0,{},this._data.core.state),function(){this.trigger("refresh")})),this._data.core.state=null})},refresh_node:function(b){if(b=this.get_node(b),!b||b.id===a.jstree.root)return!1;var c=[],d=[],e=this._data.core.selected.concat([]);d.push(b.id),b.state.opened===!0&&c.push(b.id),this.get_node(b,!0).find(".jstree-open").each(function(){d.push(this.id),c.push(this.id)}),this._load_nodes(d,a.proxy(function(a){this.open_node(c,!1,0),this.select_node(e),this.trigger("refresh_node",{node:b,nodes:a})},this),!1,!0)},set_id:function(b,c){if(b=this.get_node(b),!b||b.id===a.jstree.root)return!1;var d,e,f=this._model.data,g=b.id;for(c=c.toString(),f[b.parent].children[a.inArray(b.id,f[b.parent].children)]=c,d=0,e=b.parents.length;e>d;d++)f[b.parents[d]].children_d[a.inArray(b.id,f[b.parents[d]].children_d)]=c;for(d=0,e=b.children.length;e>d;d++)f[b.children[d]].parent=c;for(d=0,e=b.children_d.length;e>d;d++)f[b.children_d[d]].parents[a.inArray(b.id,f[b.children_d[d]].parents)]=c;return d=a.inArray(b.id,this._data.core.selected),-1!==d&&(this._data.core.selected[d]=c),d=this.get_node(b.id,!0),d&&(d.attr("id",c),this.element.attr("aria-activedescendant")===b.id&&this.element.attr("aria-activedescendant",c)),delete f[b.id],b.id=c,b.li_attr.id=c,f[c]=b,this.trigger("set_id",{node:b,"new":b.id,old:g}),!0},get_text:function(b){return b=this.get_node(b),b&&b.id!==a.jstree.root?b.text:!1},set_text:function(b,c){var d,e;if(a.isArray(b)){for(b=b.slice(),d=0,e=b.length;e>d;d++)this.set_text(b[d],c);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(b.text=c,this.get_node(b,!0).length&&this.redraw_node(b.id),this.trigger("set_text",{obj:b,text:c}),!0):!1},get_json:function(b,c,d){if(b=this.get_node(b||a.jstree.root),!b)return!1;c&&c.flat&&!d&&(d=[]);var e={id:b.id,text:b.text,icon:this.get_icon(b),li_attr:a.extend(!0,{},b.li_attr),a_attr:a.extend(!0,{},b.a_attr),state:{},data:c&&c.no_data?!1:a.extend(!0,a.isArray(b.data)?[]:{},b.data)},f,g;if(c&&c.flat?e.parent=b.parent:e.children=[],c&&c.no_state)delete e.state;else for(f in b.state)b.state.hasOwnProperty(f)&&(e.state[f]=b.state[f]);if(c&&c.no_li_attr&&delete e.li_attr,c&&c.no_a_attr&&delete e.a_attr,c&&c.no_id&&(delete e.id,e.li_attr&&e.li_attr.id&&delete e.li_attr.id,e.a_attr&&e.a_attr.id&&delete e.a_attr.id),c&&c.flat&&b.id!==a.jstree.root&&d.push(e),!c||!c.no_children)for(f=0,g=b.children.length;g>f;f++)c&&c.flat?this.get_json(b.children[f],c,d):e.children.push(this.get_json(b.children[f],c));return c&&c.flat?d:b.id===a.jstree.root?e.children:e},create_node:function(c,d,e,f,g){if(null===c&&(c=a.jstree.root),c=this.get_node(c),!c)return!1;if(e=e===b?"last":e,!e.toString().match(/^(before|after)$/)&&!g&&!this.is_loaded(c))return this.load_node(c,function(){this.create_node(c,d,e,f,!0)});d||(d={text:this.get_string("New node")}),d="string"==typeof d?{text:d}:a.extend(!0,{},d),d.text===b&&(d.text=this.get_string("New node"));var h,i,j,k;switch(c.id===a.jstree.root&&("before"===e&&(e="first"),"after"===e&&(e="last")),e){case"before":h=this.get_node(c.parent),e=a.inArray(c.id,h.children),c=h;break;case"after":h=this.get_node(c.parent),e=a.inArray(c.id,h.children)+1,c=h;break;case"inside":case"first":e=0;break;case"last":e=c.children.length;break;default:e||(e=0)}if(e>c.children.length&&(e=c.children.length),d.id||(d.id=!0),!this.check("create_node",d,c,e))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(d.id===!0&&delete d.id,d=this._parse_model_from_json(d,c.id,c.parents.concat()),!d)return!1;for(h=this.get_node(d),i=[],i.push(d),i=i.concat(h.children_d),this.trigger("model",{nodes:i,parent:c.id}),c.children_d=c.children_d.concat(i),j=0,k=c.parents.length;k>j;j++)this._model.data[c.parents[j]].children_d=this._model.data[c.parents[j]].children_d.concat(i);for(d=h,h=[],j=0,k=c.children.length;k>j;j++)h[j>=e?j+1:j]=c.children[j];return h[e]=d.id,c.children=h,this.redraw_node(c,!0),this.trigger("create_node",{node:this.get_node(d),parent:c.id,position:e}),f&&f.call(this,this.get_node(d)),d.id},rename_node:function(b,c){var d,e,f;if(a.isArray(b)){for(b=b.slice(),d=0,e=b.length;e>d;d++)this.rename_node(b[d],c);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(f=b.text,this.check("rename_node",b,this.get_parent(b),c)?(this.set_text(b,c),this.trigger("rename_node",{node:b,text:c,old:f}),!0):(this.settings.core.error.call(this,this._data.core.last_error),!1)):!1},delete_node:function(b){var c,d,e,f,g,h,i,j,k,l,m,n;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.delete_node(b[c]);return!0}if(b=this.get_node(b),!b||b.id===a.jstree.root)return!1;if(e=this.get_node(b.parent),f=a.inArray(b.id,e.children),l=!1,!this.check("delete_node",b,e,f))return this.settings.core.error.call(this,this._data.core.last_error),!1;for(-1!==f&&(e.children=a.vakata.array_remove(e.children,f)),g=b.children_d.concat([]),g.push(b.id),h=0,i=b.parents.length;i>h;h++)this._model.data[b.parents[h]].children_d=a.vakata.array_filter(this._model.data[b.parents[h]].children_d,function(b){return-1===a.inArray(b,g)});for(j=0,k=g.length;k>j;j++)if(this._model.data[g[j]].state.selected){l=!0;break}for(l&&(this._data.core.selected=a.vakata.array_filter(this._data.core.selected,function(b){return-1===a.inArray(b,g)})),this.trigger("delete_node",{node:b,parent:e.id}),l&&this.trigger("changed",{action:"delete_node",node:b,selected:this._data.core.selected,parent:e.id}),j=0,k=g.length;k>j;j++)delete this._model.data[g[j]];return-1!==a.inArray(this._data.core.focused,g)&&(this._data.core.focused=null,m=this.element[0].scrollTop,n=this.element[0].scrollLeft,e.id===a.jstree.root?this._model.data[a.jstree.root].children[0]&&this.get_node(this._model.data[a.jstree.root].children[0],!0).children(".jstree-anchor").focus():this.get_node(e,!0).children(".jstree-anchor").focus(),this.element[0].scrollTop=m,this.element[0].scrollLeft=n),this.redraw_node(e,!0),!0},check:function(b,c,d,e,f){c=c&&c.id?c:this.get_node(c),d=d&&d.id?d:this.get_node(d);var g=b.match(/^move_node|copy_node|create_node$/i)?d:c,h=this.settings.core.check_callback;if("move_node"===b||"copy_node"===b){if(!(f&&f.is_multi||"move_node"!==b||a.inArray(c.id,d.children)!==e))return this._data.core.last_error={error:"check",plugin:"core",id:"core_08",reason:"Moving node to its current position",data:JSON.stringify({chk:b,pos:e,obj:c&&c.id?c.id:!1,par:d&&d.id?d.id:!1})},!1;if(!(f&&f.is_multi||c.id!==d.id&&("move_node"!==b||a.inArray(c.id,d.children)!==e)&&-1===a.inArray(d.id,c.children_d)))return this._data.core.last_error={error:"check",plugin:"core",id:"core_01",reason:"Moving parent inside child",data:JSON.stringify({chk:b,pos:e,obj:c&&c.id?c.id:!1,par:d&&d.id?d.id:!1})},!1}return g&&g.data&&(g=g.data),g&&g.functions&&(g.functions[b]===!1||g.functions[b]===!0)?(g.functions[b]===!1&&(this._data.core.last_error={error:"check",plugin:"core",id:"core_02",reason:"Node data prevents function: "+b,data:JSON.stringify({chk:b,pos:e,obj:c&&c.id?c.id:!1,par:d&&d.id?d.id:!1})}),g.functions[b]):h===!1||a.isFunction(h)&&h.call(this,b,c,d,e,f)===!1||h&&h[b]===!1?(this._data.core.last_error={error:"check",plugin:"core",id:"core_03",reason:"User config for core.check_callback prevents function: "+b,data:JSON.stringify({chk:b,pos:e,obj:c&&c.id?c.id:!1,par:d&&d.id?d.id:!1})},!1):!0},last_error:function(){return this._data.core.last_error},move_node:function(c,d,e,f,g,h,i){var j,k,l,m,n,o,p,q,r,s,t,u,v,w;if(d=this.get_node(d),e=e===b?0:e,!d)return!1;if(!e.toString().match(/^(before|after)$/)&&!g&&!this.is_loaded(d))return this.load_node(d,function(){this.move_node(c,d,e,f,!0,!1,i)});if(a.isArray(c)){if(1!==c.length){for(j=0,k=c.length;k>j;j++)(r=this.move_node(c[j],d,e,f,g,!1,i))&&(d=r,e="after");return this.redraw(),!0}c=c[0]}if(c=c&&c.id?c:this.get_node(c),!c||c.id===a.jstree.root)return!1;if(l=(c.parent||a.jstree.root).toString(),n=e.toString().match(/^(before|after)$/)&&d.id!==a.jstree.root?this.get_node(d.parent):d,o=i?i:this._model.data[c.id]?this:a.jstree.reference(c.id),p=!o||!o._id||this._id!==o._id,m=o&&o._id&&l&&o._model.data[l]&&o._model.data[l].children?a.inArray(c.id,o._model.data[l].children):-1,o&&o._id&&(c=o._model.data[c.id]),p)return(r=this.copy_node(c,d,e,f,g,!1,i))?(o&&o.delete_node(c),r):!1;switch(d.id===a.jstree.root&&("before"===e&&(e="first"),"after"===e&&(e="last")),e){case"before":e=a.inArray(d.id,n.children);break;case"after":e=a.inArray(d.id,n.children)+1;break;case"inside":case"first":e=0;break;case"last":e=n.children.length;break;default:e||(e=0)}if(e>n.children.length&&(e=n.children.length),!this.check("move_node",c,n,e,{core:!0,origin:i,is_multi:o&&o._id&&o._id!==this._id,is_foreign:!o||!o._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(c.parent===n.id){for(q=n.children.concat(),r=a.inArray(c.id,q),-1!==r&&(q=a.vakata.array_remove(q,r),e>r&&e--),r=[],s=0,t=q.length;t>s;s++)r[s>=e?s+1:s]=q[s];r[e]=c.id,n.children=r,this._node_changed(n.id),this.redraw(n.id===a.jstree.root)}else{for(r=c.children_d.concat(),r.push(c.id),s=0,t=c.parents.length;t>s;s++){for(q=[],w=o._model.data[c.parents[s]].children_d,u=0,v=w.length;v>u;u++)-1===a.inArray(w[u],r)&&q.push(w[u]);o._model.data[c.parents[s]].children_d=q}for(o._model.data[l].children=a.vakata.array_remove_item(o._model.data[l].children,c.id),s=0,t=n.parents.length;t>s;s++)this._model.data[n.parents[s]].children_d=this._model.data[n.parents[s]].children_d.concat(r);for(q=[],s=0,t=n.children.length;t>s;s++)q[s>=e?s+1:s]=n.children[s];for(q[e]=c.id,n.children=q,n.children_d.push(c.id),n.children_d=n.children_d.concat(c.children_d),c.parent=n.id,r=n.parents.concat(),r.unshift(n.id),w=c.parents.length,c.parents=r,r=r.concat(),s=0,t=c.children_d.length;t>s;s++)this._model.data[c.children_d[s]].parents=this._model.data[c.children_d[s]].parents.slice(0,-1*w),Array.prototype.push.apply(this._model.data[c.children_d[s]].parents,r);(l===a.jstree.root||n.id===a.jstree.root)&&(this._model.force_full_redraw=!0),this._model.force_full_redraw||(this._node_changed(l),this._node_changed(n.id)),h||this.redraw()}return f&&f.call(this,c,n,e),this.trigger("move_node",{node:c,parent:n.id,position:e,old_parent:l,old_position:m,is_multi:o&&o._id&&o._id!==this._id,is_foreign:!o||!o._id,old_instance:o,new_instance:this}),c.id},copy_node:function(c,d,e,f,g,h,i){var j,k,l,m,n,o,p,q,r,s,t;if(d=this.get_node(d),e=e===b?0:e,!d)return!1;if(!e.toString().match(/^(before|after)$/)&&!g&&!this.is_loaded(d))return this.load_node(d,function(){this.copy_node(c,d,e,f,!0,!1,i)});if(a.isArray(c)){if(1!==c.length){for(j=0,k=c.length;k>j;j++)(m=this.copy_node(c[j],d,e,f,g,!0,i))&&(d=m,e="after");return this.redraw(),!0}c=c[0]}if(c=c&&c.id?c:this.get_node(c),!c||c.id===a.jstree.root)return!1;switch(q=(c.parent||a.jstree.root).toString(),r=e.toString().match(/^(before|after)$/)&&d.id!==a.jstree.root?this.get_node(d.parent):d,s=i?i:this._model.data[c.id]?this:a.jstree.reference(c.id),t=!s||!s._id||this._id!==s._id,s&&s._id&&(c=s._model.data[c.id]),d.id===a.jstree.root&&("before"===e&&(e="first"),"after"===e&&(e="last")),e){case"before":e=a.inArray(d.id,r.children);break;case"after":e=a.inArray(d.id,r.children)+1;break;case"inside":case"first":e=0;break;case"last":e=r.children.length;break;default:e||(e=0)}if(e>r.children.length&&(e=r.children.length),!this.check("copy_node",c,r,e,{core:!0,origin:i,is_multi:s&&s._id&&s._id!==this._id,is_foreign:!s||!s._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(p=s?s.get_json(c,{no_id:!0,no_data:!0,no_state:!0}):c,!p)return!1;if(p.id===!0&&delete p.id,p=this._parse_model_from_json(p,r.id,r.parents.concat()),!p)return!1;for(m=this.get_node(p),c&&c.state&&c.state.loaded===!1&&(m.state.loaded=!1),l=[],l.push(p),l=l.concat(m.children_d),this.trigger("model",{nodes:l,parent:r.id}),n=0,o=r.parents.length;o>n;n++)this._model.data[r.parents[n]].children_d=this._model.data[r.parents[n]].children_d.concat(l);for(l=[],n=0,o=r.children.length;o>n;n++)l[n>=e?n+1:n]=r.children[n];return l[e]=m.id,r.children=l,r.children_d.push(m.id),r.children_d=r.children_d.concat(m.children_d),r.id===a.jstree.root&&(this._model.force_full_redraw=!0),this._model.force_full_redraw||this._node_changed(r.id),h||this.redraw(r.id===a.jstree.root),f&&f.call(this,m,r,e),this.trigger("copy_node",{node:m,original:c,parent:r.id,position:e,old_parent:q,old_position:s&&s._id&&q&&s._model.data[q]&&s._model.data[q].children?a.inArray(c.id,s._model.data[q].children):-1,
4
+ is_multi:s&&s._id&&s._id!==this._id,is_foreign:!s||!s._id,old_instance:s,new_instance:this}),m.id},cut:function(b){if(b||(b=this._data.core.selected.concat()),a.isArray(b)||(b=[b]),!b.length)return!1;var c=[],g,h,i;for(h=0,i=b.length;i>h;h++)g=this.get_node(b[h]),g&&g.id&&g.id!==a.jstree.root&&c.push(g);return c.length?(d=c,f=this,e="move_node",void this.trigger("cut",{node:b})):!1},copy:function(b){if(b||(b=this._data.core.selected.concat()),a.isArray(b)||(b=[b]),!b.length)return!1;var c=[],g,h,i;for(h=0,i=b.length;i>h;h++)g=this.get_node(b[h]),g&&g.id&&g.id!==a.jstree.root&&c.push(g);return c.length?(d=c,f=this,e="copy_node",void this.trigger("copy",{node:b})):!1},get_buffer:function(){return{mode:e,node:d,inst:f}},can_paste:function(){return e!==!1&&d!==!1},paste:function(a,b){return a=this.get_node(a),a&&e&&e.match(/^(copy_node|move_node)$/)&&d?(this[e](d,a,b,!1,!1,!1,f)&&this.trigger("paste",{parent:a.id,node:d,mode:e}),d=!1,e=!1,void(f=!1)):!1},clear_buffer:function(){d=!1,e=!1,f=!1,this.trigger("clear_buffer")},edit:function(b,c,d){var e,f,g,h,j,k,l,m,n,o=!1;return(b=this.get_node(b))?this.check("edit",b,this.get_parent(b))?(n=b,c="string"==typeof c?c:b.text,this.set_text(b,""),b=this._open_to(b),n.text=c,e=this._data.core.rtl,f=this.element.width(),this._data.core.focused=n.id,g=b.children(".jstree-anchor").focus(),h=a("<span>"),j=c,k=a("<div />",{css:{position:"absolute",top:"-200px",left:e?"0px":"-1000px",visibility:"hidden"}}).appendTo(i.body),l=a("<input />",{value:j,"class":"jstree-rename-input",css:{padding:"0",border:"1px solid silver","box-sizing":"border-box",display:"inline-block",height:this._data.core.li_height+"px",lineHeight:this._data.core.li_height+"px",width:"150px"},blur:a.proxy(function(c){c.stopImmediatePropagation(),c.preventDefault();var e=h.children(".jstree-rename-input"),f=e.val(),i=this.settings.core.force_text,m;""===f&&(f=j),k.remove(),h.replaceWith(g),h.remove(),j=i?j:a("<div></div>").append(a.parseHTML(j)).html(),b=this.get_node(b),this.set_text(b,j),m=!!this.rename_node(b,i?a("<div></div>").text(f).text():a("<div></div>").append(a.parseHTML(f)).html()),m||this.set_text(b,j),this._data.core.focused=n.id,setTimeout(a.proxy(function(){var a=this.get_node(n.id,!0);a.length&&(this._data.core.focused=n.id,a.children(".jstree-anchor").focus())},this),0),d&&d.call(this,n,m,o),l=null},this),keydown:function(a){var b=a.which;27===b&&(o=!0,this.value=j),(27===b||13===b||37===b||38===b||39===b||40===b||32===b)&&a.stopImmediatePropagation(),(27===b||13===b)&&(a.preventDefault(),this.blur())},click:function(a){a.stopImmediatePropagation()},mousedown:function(a){a.stopImmediatePropagation()},keyup:function(a){l.width(Math.min(k.text("pW"+this.value).width(),f))},keypress:function(a){return 13===a.which?!1:void 0}}),m={fontFamily:g.css("fontFamily")||"",fontSize:g.css("fontSize")||"",fontWeight:g.css("fontWeight")||"",fontStyle:g.css("fontStyle")||"",fontStretch:g.css("fontStretch")||"",fontVariant:g.css("fontVariant")||"",letterSpacing:g.css("letterSpacing")||"",wordSpacing:g.css("wordSpacing")||""},h.attr("class",g.attr("class")).append(g.contents().clone()).append(l),g.replaceWith(h),k.css(m),l.css(m).width(Math.min(k.text("pW"+l[0].value).width(),f))[0].select(),void a(i).one("mousedown.jstree touchstart.jstree dnd_start.vakata",function(b){l&&b.target!==l&&a(l).blur()})):(this.settings.core.error.call(this,this._data.core.last_error),!1):!1},set_theme:function(b,c){if(!b)return!1;if(c===!0){var d=this.settings.core.themes.dir;d||(d=a.jstree.path+"/themes"),c=d+"/"+b+"/style.css"}c&&-1===a.inArray(c,g)&&(a("head").append('<link rel="stylesheet" href="'+c+'" type="text/css" />'),g.push(c)),this._data.core.themes.name&&this.element.removeClass("jstree-"+this._data.core.themes.name),this._data.core.themes.name=b,this.element.addClass("jstree-"+b),this.element[this.settings.core.themes.responsive?"addClass":"removeClass"]("jstree-"+b+"-responsive"),this.trigger("set_theme",{theme:b})},get_theme:function(){return this._data.core.themes.name},set_theme_variant:function(a){this._data.core.themes.variant&&this.element.removeClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant),this._data.core.themes.variant=a,a&&this.element.addClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant)},get_theme_variant:function(){return this._data.core.themes.variant},show_stripes:function(){this._data.core.themes.stripes=!0,this.get_container_ul().addClass("jstree-striped"),this.trigger("show_stripes")},hide_stripes:function(){this._data.core.themes.stripes=!1,this.get_container_ul().removeClass("jstree-striped"),this.trigger("hide_stripes")},toggle_stripes:function(){this._data.core.themes.stripes?this.hide_stripes():this.show_stripes()},show_dots:function(){this._data.core.themes.dots=!0,this.get_container_ul().removeClass("jstree-no-dots"),this.trigger("show_dots")},hide_dots:function(){this._data.core.themes.dots=!1,this.get_container_ul().addClass("jstree-no-dots"),this.trigger("hide_dots")},toggle_dots:function(){this._data.core.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this._data.core.themes.icons=!0,this.get_container_ul().removeClass("jstree-no-icons"),this.trigger("show_icons")},hide_icons:function(){this._data.core.themes.icons=!1,this.get_container_ul().addClass("jstree-no-icons"),this.trigger("hide_icons")},toggle_icons:function(){this._data.core.themes.icons?this.hide_icons():this.show_icons()},show_ellipsis:function(){this._data.core.themes.ellipsis=!0,this.get_container_ul().addClass("jstree-ellipsis"),this.trigger("show_ellipsis")},hide_ellipsis:function(){this._data.core.themes.ellipsis=!1,this.get_container_ul().removeClass("jstree-ellipsis"),this.trigger("hide_ellipsis")},toggle_ellipsis:function(){this._data.core.themes.ellipsis?this.hide_ellipsis():this.show_ellipsis()},set_icon:function(c,d){var e,f,g,h;if(a.isArray(c)){for(c=c.slice(),e=0,f=c.length;f>e;e++)this.set_icon(c[e],d);return!0}return c=this.get_node(c),c&&c.id!==a.jstree.root?(h=c.icon,c.icon=d===!0||null===d||d===b||""===d?!0:d,g=this.get_node(c,!0).children(".jstree-anchor").children(".jstree-themeicon"),d===!1?(g.removeClass("jstree-themeicon-custom "+h).css("background","").removeAttr("rel"),this.hide_icon(c)):d===!0||null===d||d===b||""===d?(g.removeClass("jstree-themeicon-custom "+h).css("background","").removeAttr("rel"),h===!1&&this.show_icon(c)):-1===d.indexOf("/")&&-1===d.indexOf(".")?(g.removeClass(h).css("background",""),g.addClass(d+" jstree-themeicon-custom").attr("rel",d),h===!1&&this.show_icon(c)):(g.removeClass(h).css("background",""),g.addClass("jstree-themeicon-custom").css("background","url('"+d+"') center center no-repeat").attr("rel",d),h===!1&&this.show_icon(c)),!0):!1},get_icon:function(b){return b=this.get_node(b),b&&b.id!==a.jstree.root?b.icon:!1},hide_icon:function(b){var c,d;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.hide_icon(b[c]);return!0}return b=this.get_node(b),b&&b!==a.jstree.root?(b.icon=!1,this.get_node(b,!0).children(".jstree-anchor").children(".jstree-themeicon").addClass("jstree-themeicon-hidden"),!0):!1},show_icon:function(b){var c,d,e;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.show_icon(b[c]);return!0}return b=this.get_node(b),b&&b!==a.jstree.root?(e=this.get_node(b,!0),b.icon=e.length?e.children(".jstree-anchor").children(".jstree-themeicon").attr("rel"):!0,b.icon||(b.icon=!0),e.children(".jstree-anchor").children(".jstree-themeicon").removeClass("jstree-themeicon-hidden"),!0):!1}},a.vakata={},a.vakata.attributes=function(b,c){b=a(b)[0];var d=c?{}:[];return b&&b.attributes&&a.each(b.attributes,function(b,e){-1===a.inArray(e.name.toLowerCase(),["style","contenteditable","hasfocus","tabindex"])&&null!==e.value&&""!==a.trim(e.value)&&(c?d[e.name]=e.value:d.push(e.name))}),d},a.vakata.array_unique=function(a){var c=[],d,e,f,g={};for(d=0,f=a.length;f>d;d++)g[a[d]]===b&&(c.push(a[d]),g[a[d]]=!0);return c},a.vakata.array_remove=function(a,b){return a.splice(b,1),a},a.vakata.array_remove_item=function(b,c){var d=a.inArray(c,b);return-1!==d?a.vakata.array_remove(b,d):b},a.vakata.array_filter=function(a,b,c,d,e){if(a.filter)return a.filter(b,c);d=[];for(e in a)~~e+""==e+""&&e>=0&&b.call(c,a[e],+e,a)&&d.push(a[e]);return d},a.jstree.plugins.changed=function(a,b){var c=[];this.trigger=function(a,d){var e,f;if(d||(d={}),"changed"===a.replace(".jstree","")){d.changed={selected:[],deselected:[]};var g={};for(e=0,f=c.length;f>e;e++)g[c[e]]=1;for(e=0,f=d.selected.length;f>e;e++)g[d.selected[e]]?g[d.selected[e]]=2:d.changed.selected.push(d.selected[e]);for(e=0,f=c.length;f>e;e++)1===g[c[e]]&&d.changed.deselected.push(c[e]);c=d.selected.slice()}b.trigger.call(this,a,d)},this.refresh=function(a,d){return c=[],b.refresh.apply(this,arguments)}};var j=i.createElement("I");j.className="jstree-icon jstree-checkbox",j.setAttribute("role","presentation"),a.jstree.defaults.checkbox={visible:!0,three_state:!0,whole_node:!0,keep_selected_style:!0,cascade:"",tie_selection:!0,cascade_to_disabled:!0,cascade_to_hidden:!0},a.jstree.plugins.checkbox=function(c,d){this.bind=function(){d.bind.call(this),this._data.checkbox.uto=!1,this._data.checkbox.selected=[],this.settings.checkbox.three_state&&(this.settings.checkbox.cascade="up+down+undetermined"),this.element.on("init.jstree",a.proxy(function(){this._data.checkbox.visible=this.settings.checkbox.visible,this.settings.checkbox.keep_selected_style||this.element.addClass("jstree-checkbox-no-clicked"),this.settings.checkbox.tie_selection&&this.element.addClass("jstree-checkbox-selection")},this)).on("loading.jstree",a.proxy(function(){this[this._data.checkbox.visible?"show_checkboxes":"hide_checkboxes"]()},this)),-1!==this.settings.checkbox.cascade.indexOf("undetermined")&&this.element.on("changed.jstree uncheck_node.jstree check_node.jstree uncheck_all.jstree check_all.jstree move_node.jstree copy_node.jstree redraw.jstree open_node.jstree",a.proxy(function(){this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(a.proxy(this._undetermined,this),50)},this)),this.settings.checkbox.tie_selection||this.element.on("model.jstree",a.proxy(function(a,b){var c=this._model.data,d=c[b.parent],e=b.nodes,f,g;for(f=0,g=e.length;g>f;f++)c[e[f]].state.checked=c[e[f]].state.checked||c[e[f]].original&&c[e[f]].original.state&&c[e[f]].original.state.checked,c[e[f]].state.checked&&this._data.checkbox.selected.push(e[f])},this)),(-1!==this.settings.checkbox.cascade.indexOf("up")||-1!==this.settings.checkbox.cascade.indexOf("down"))&&this.element.on("model.jstree",a.proxy(function(b,c){var d=this._model.data,e=d[c.parent],f=c.nodes,g=[],h,i,j,k,l,m,n=this.settings.checkbox.cascade,o=this.settings.checkbox.tie_selection;if(-1!==n.indexOf("down"))if(e.state[o?"selected":"checked"]){for(i=0,j=f.length;j>i;i++)d[f[i]].state[o?"selected":"checked"]=!0;this._data[o?"core":"checkbox"].selected=this._data[o?"core":"checkbox"].selected.concat(f)}else for(i=0,j=f.length;j>i;i++)if(d[f[i]].state[o?"selected":"checked"]){for(k=0,l=d[f[i]].children_d.length;l>k;k++)d[d[f[i]].children_d[k]].state[o?"selected":"checked"]=!0;this._data[o?"core":"checkbox"].selected=this._data[o?"core":"checkbox"].selected.concat(d[f[i]].children_d)}if(-1!==n.indexOf("up")){for(i=0,j=e.children_d.length;j>i;i++)d[e.children_d[i]].children.length||g.push(d[e.children_d[i]].parent);for(g=a.vakata.array_unique(g),k=0,l=g.length;l>k;k++){e=d[g[k]];while(e&&e.id!==a.jstree.root){for(h=0,i=0,j=e.children.length;j>i;i++)h+=d[e.children[i]].state[o?"selected":"checked"];if(h!==j)break;e.state[o?"selected":"checked"]=!0,this._data[o?"core":"checkbox"].selected.push(e.id),m=this.get_node(e,!0),m&&m.length&&m.attr("aria-selected",!0).children(".jstree-anchor").addClass(o?"jstree-clicked":"jstree-checked"),e=this.get_node(e.parent)}}}this._data[o?"core":"checkbox"].selected=a.vakata.array_unique(this._data[o?"core":"checkbox"].selected)},this)).on(this.settings.checkbox.tie_selection?"select_node.jstree":"check_node.jstree",a.proxy(function(b,c){var d=this,e=c.node,f=this._model.data,g=this.get_node(e.parent),h,i,j,k,l=this.settings.checkbox.cascade,m=this.settings.checkbox.tie_selection,n={},o=this._data[m?"core":"checkbox"].selected;for(h=0,i=o.length;i>h;h++)n[o[h]]=!0;if(-1!==l.indexOf("down")){var p=this._cascade_new_checked_state(e.id,!0),q=e.children_d.concat(e.id);for(h=0,i=q.length;i>h;h++)p.indexOf(q[h])>-1?n[q[h]]=!0:delete n[q[h]]}if(-1!==l.indexOf("up"))while(g&&g.id!==a.jstree.root){for(j=0,h=0,i=g.children.length;i>h;h++)j+=f[g.children[h]].state[m?"selected":"checked"];if(j!==i)break;g.state[m?"selected":"checked"]=!0,n[g.id]=!0,k=this.get_node(g,!0),k&&k.length&&k.attr("aria-selected",!0).children(".jstree-anchor").addClass(m?"jstree-clicked":"jstree-checked"),g=this.get_node(g.parent)}o=[];for(h in n)n.hasOwnProperty(h)&&o.push(h);this._data[m?"core":"checkbox"].selected=o},this)).on(this.settings.checkbox.tie_selection?"deselect_all.jstree":"uncheck_all.jstree",a.proxy(function(b,c){var d=this.get_node(a.jstree.root),e=this._model.data,f,g,h;for(f=0,g=d.children_d.length;g>f;f++)h=e[d.children_d[f]],h&&h.original&&h.original.state&&h.original.state.undetermined&&(h.original.state.undetermined=!1)},this)).on(this.settings.checkbox.tie_selection?"deselect_node.jstree":"uncheck_node.jstree",a.proxy(function(b,c){var d=this,e=c.node,f=this.get_node(e,!0),g,h,i,j=this.settings.checkbox.cascade,k=this.settings.checkbox.tie_selection,l=this._data[k?"core":"checkbox"].selected,m={},n=[],o=e.children_d.concat(e.id);if(-1!==j.indexOf("down")){var p=this._cascade_new_checked_state(e.id,!1);l=a.vakata.array_filter(l,function(a){return-1===o.indexOf(a)||p.indexOf(a)>-1})}if(-1!==j.indexOf("up")&&-1===l.indexOf(e.id)){for(g=0,h=e.parents.length;h>g;g++)i=this._model.data[e.parents[g]],i.state[k?"selected":"checked"]=!1,i&&i.original&&i.original.state&&i.original.state.undetermined&&(i.original.state.undetermined=!1),i=this.get_node(e.parents[g],!0),i&&i.length&&i.attr("aria-selected",!1).children(".jstree-anchor").removeClass(k?"jstree-clicked":"jstree-checked");l=a.vakata.array_filter(l,function(a){return-1===e.parents.indexOf(a)})}this._data[k?"core":"checkbox"].selected=l},this)),-1!==this.settings.checkbox.cascade.indexOf("up")&&this.element.on("delete_node.jstree",a.proxy(function(b,c){var d=this.get_node(c.parent),e=this._model.data,f,g,h,i,j=this.settings.checkbox.tie_selection;while(d&&d.id!==a.jstree.root&&!d.state[j?"selected":"checked"]){for(h=0,f=0,g=d.children.length;g>f;f++)h+=e[d.children[f]].state[j?"selected":"checked"];if(!(g>0&&h===g))break;d.state[j?"selected":"checked"]=!0,this._data[j?"core":"checkbox"].selected.push(d.id),i=this.get_node(d,!0),i&&i.length&&i.attr("aria-selected",!0).children(".jstree-anchor").addClass(j?"jstree-clicked":"jstree-checked"),d=this.get_node(d.parent)}},this)).on("move_node.jstree",a.proxy(function(b,c){var d=c.is_multi,e=c.old_parent,f=this.get_node(c.parent),g=this._model.data,h,i,j,k,l,m=this.settings.checkbox.tie_selection;if(!d){h=this.get_node(e);while(h&&h.id!==a.jstree.root&&!h.state[m?"selected":"checked"]){for(i=0,j=0,k=h.children.length;k>j;j++)i+=g[h.children[j]].state[m?"selected":"checked"];if(!(k>0&&i===k))break;h.state[m?"selected":"checked"]=!0,this._data[m?"core":"checkbox"].selected.push(h.id),l=this.get_node(h,!0),l&&l.length&&l.attr("aria-selected",!0).children(".jstree-anchor").addClass(m?"jstree-clicked":"jstree-checked"),h=this.get_node(h.parent)}}h=f;while(h&&h.id!==a.jstree.root){for(i=0,j=0,k=h.children.length;k>j;j++)i+=g[h.children[j]].state[m?"selected":"checked"];if(i===k)h.state[m?"selected":"checked"]||(h.state[m?"selected":"checked"]=!0,this._data[m?"core":"checkbox"].selected.push(h.id),l=this.get_node(h,!0),l&&l.length&&l.attr("aria-selected",!0).children(".jstree-anchor").addClass(m?"jstree-clicked":"jstree-checked"));else{if(!h.state[m?"selected":"checked"])break;h.state[m?"selected":"checked"]=!1,this._data[m?"core":"checkbox"].selected=a.vakata.array_remove_item(this._data[m?"core":"checkbox"].selected,h.id),l=this.get_node(h,!0),l&&l.length&&l.attr("aria-selected",!1).children(".jstree-anchor").removeClass(m?"jstree-clicked":"jstree-checked")}h=this.get_node(h.parent)}},this))},this.get_undetermined=function(c){if(-1===this.settings.checkbox.cascade.indexOf("undetermined"))return[];var d,e,f,g,h={},i=this._model.data,j=this.settings.checkbox.tie_selection,k=this._data[j?"core":"checkbox"].selected,l=[],m=this,n=[];for(d=0,e=k.length;e>d;d++)if(i[k[d]]&&i[k[d]].parents)for(f=0,g=i[k[d]].parents.length;g>f;f++){if(h[i[k[d]].parents[f]]!==b)break;i[k[d]].parents[f]!==a.jstree.root&&(h[i[k[d]].parents[f]]=!0,l.push(i[k[d]].parents[f]))}for(this.element.find(".jstree-closed").not(":has(.jstree-children)").each(function(){var c=m.get_node(this),j;if(c)if(c.state.loaded){for(d=0,e=c.children_d.length;e>d;d++)if(j=i[c.children_d[d]],!j.state.loaded&&j.original&&j.original.state&&j.original.state.undetermined&&j.original.state.undetermined===!0)for(h[j.id]===b&&j.id!==a.jstree.root&&(h[j.id]=!0,l.push(j.id)),f=0,g=j.parents.length;g>f;f++)h[j.parents[f]]===b&&j.parents[f]!==a.jstree.root&&(h[j.parents[f]]=!0,l.push(j.parents[f]))}else if(c.original&&c.original.state&&c.original.state.undetermined&&c.original.state.undetermined===!0)for(h[c.id]===b&&c.id!==a.jstree.root&&(h[c.id]=!0,l.push(c.id)),f=0,g=c.parents.length;g>f;f++)h[c.parents[f]]===b&&c.parents[f]!==a.jstree.root&&(h[c.parents[f]]=!0,l.push(c.parents[f]))}),d=0,e=l.length;e>d;d++)i[l[d]].state[j?"selected":"checked"]||n.push(c?i[l[d]]:l[d]);return n},this._undetermined=function(){if(null!==this.element){var a=this.get_undetermined(!1),b,c,d;for(this.element.find(".jstree-undetermined").removeClass("jstree-undetermined"),b=0,c=a.length;c>b;b++)d=this.get_node(a[b],!0),d&&d.length&&d.children(".jstree-anchor").children(".jstree-checkbox").addClass("jstree-undetermined")}},this.redraw_node=function(b,c,e,f){if(b=d.redraw_node.apply(this,arguments)){var g,h,i=null,k=null;for(g=0,h=b.childNodes.length;h>g;g++)if(b.childNodes[g]&&b.childNodes[g].className&&-1!==b.childNodes[g].className.indexOf("jstree-anchor")){i=b.childNodes[g];break}i&&(!this.settings.checkbox.tie_selection&&this._model.data[b.id].state.checked&&(i.className+=" jstree-checked"),k=j.cloneNode(!1),this._model.data[b.id].state.checkbox_disabled&&(k.className+=" jstree-checkbox-disabled"),i.insertBefore(k,i.childNodes[0]))}return e||-1===this.settings.checkbox.cascade.indexOf("undetermined")||(this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(a.proxy(this._undetermined,this),50)),b},this.show_checkboxes=function(){this._data.core.themes.checkboxes=!0,this.get_container_ul().removeClass("jstree-no-checkboxes")},this.hide_checkboxes=function(){this._data.core.themes.checkboxes=!1,this.get_container_ul().addClass("jstree-no-checkboxes")},this.toggle_checkboxes=function(){this._data.core.themes.checkboxes?this.hide_checkboxes():this.show_checkboxes()},this.is_undetermined=function(b){b=this.get_node(b);var c=this.settings.checkbox.cascade,d,e,f=this.settings.checkbox.tie_selection,g=this._data[f?"core":"checkbox"].selected,h=this._model.data;if(!b||b.state[f?"selected":"checked"]===!0||-1===c.indexOf("undetermined")||-1===c.indexOf("down")&&-1===c.indexOf("up"))return!1;if(!b.state.loaded&&b.original.state.undetermined===!0)return!0;for(d=0,e=b.children_d.length;e>d;d++)if(-1!==a.inArray(b.children_d[d],g)||!h[b.children_d[d]].state.loaded&&h[b.children_d[d]].original.state.undetermined)return!0;return!1},this.disable_checkbox=function(b){var c,d,e;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.disable_checkbox(b[c]);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(e=this.get_node(b,!0),void(b.state.checkbox_disabled||(b.state.checkbox_disabled=!0,e&&e.length&&e.children(".jstree-anchor").children(".jstree-checkbox").addClass("jstree-checkbox-disabled"),this.trigger("disable_checkbox",{node:b})))):!1},this.enable_checkbox=function(b){var c,d,e;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.enable_checkbox(b[c]);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(e=this.get_node(b,!0),void(b.state.checkbox_disabled&&(b.state.checkbox_disabled=!1,e&&e.length&&e.children(".jstree-anchor").children(".jstree-checkbox").removeClass("jstree-checkbox-disabled"),this.trigger("enable_checkbox",{node:b})))):!1},this.activate_node=function(b,c){return a(c.target).hasClass("jstree-checkbox-disabled")?!1:(this.settings.checkbox.tie_selection&&(this.settings.checkbox.whole_node||a(c.target).hasClass("jstree-checkbox"))&&(c.ctrlKey=!0),this.settings.checkbox.tie_selection||!this.settings.checkbox.whole_node&&!a(c.target).hasClass("jstree-checkbox")?d.activate_node.call(this,b,c):this.is_disabled(b)?!1:(this.is_checked(b)?this.uncheck_node(b,c):this.check_node(b,c),void this.trigger("activate_node",{node:this.get_node(b)})))},this._cascade_new_checked_state=function(a,b){var c=this,d=this.settings.checkbox.tie_selection,e=this._model.data[a],f=[],g=[],h,i,j;if(!this.settings.checkbox.cascade_to_disabled&&e.state.disabled||!this.settings.checkbox.cascade_to_hidden&&e.state.hidden)j=this.get_checked_descendants(a),e.state[d?"selected":"checked"]&&j.push(e.id),f=f.concat(j);else{if(e.children)for(h=0,i=e.children.length;i>h;h++){var k=e.children[h];j=c._cascade_new_checked_state(k,b),f=f.concat(j),j.indexOf(k)>-1&&g.push(k)}var l=c.get_node(e,!0),m=g.length>0&&g.length<e.children.length;e.original&&e.original.state&&e.original.state.undetermined&&(e.original.state.undetermined=m),m?(e.state[d?"selected":"checked"]=!1,l.attr("aria-selected",!1).children(".jstree-anchor").removeClass(d?"jstree-clicked":"jstree-checked")):b&&g.length===e.children.length?(e.state[d?"selected":"checked"]=b,f.push(e.id),l.attr("aria-selected",!0).children(".jstree-anchor").addClass(d?"jstree-clicked":"jstree-checked")):(e.state[d?"selected":"checked"]=!1,l.attr("aria-selected",!1).children(".jstree-anchor").removeClass(d?"jstree-clicked":"jstree-checked"))}return f},this.get_checked_descendants=function(b){var c=this,d=c.settings.checkbox.tie_selection,e=c._model.data[b];return a.vakata.array_filter(e.children_d,function(a){return c._model.data[a].state[d?"selected":"checked"]})},this.check_node=function(b,c){if(this.settings.checkbox.tie_selection)return this.select_node(b,!1,!0,c);var d,e,f,g;if(a.isArray(b)){for(b=b.slice(),e=0,f=b.length;f>e;e++)this.check_node(b[e],c);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(d=this.get_node(b,!0),void(b.state.checked||(b.state.checked=!0,this._data.checkbox.selected.push(b.id),d&&d.length&&d.children(".jstree-anchor").addClass("jstree-checked"),this.trigger("check_node",{node:b,selected:this._data.checkbox.selected,event:c})))):!1},this.uncheck_node=function(b,c){if(this.settings.checkbox.tie_selection)return this.deselect_node(b,!1,c);var d,e,f;if(a.isArray(b)){for(b=b.slice(),d=0,e=b.length;e>d;d++)this.uncheck_node(b[d],c);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(f=this.get_node(b,!0),void(b.state.checked&&(b.state.checked=!1,this._data.checkbox.selected=a.vakata.array_remove_item(this._data.checkbox.selected,b.id),f.length&&f.children(".jstree-anchor").removeClass("jstree-checked"),this.trigger("uncheck_node",{node:b,selected:this._data.checkbox.selected,event:c})))):!1},this.check_all=function(){if(this.settings.checkbox.tie_selection)return this.select_all();var b=this._data.checkbox.selected.concat([]),c,d;for(this._data.checkbox.selected=this._model.data[a.jstree.root].children_d.concat(),c=0,d=this._data.checkbox.selected.length;d>c;c++)this._model.data[this._data.checkbox.selected[c]]&&(this._model.data[this._data.checkbox.selected[c]].state.checked=!0);this.redraw(!0),this.trigger("check_all",{selected:this._data.checkbox.selected})},this.uncheck_all=function(){if(this.settings.checkbox.tie_selection)return this.deselect_all();var a=this._data.checkbox.selected.concat([]),b,c;for(b=0,c=this._data.checkbox.selected.length;c>b;b++)this._model.data[this._data.checkbox.selected[b]]&&(this._model.data[this._data.checkbox.selected[b]].state.checked=!1);this._data.checkbox.selected=[],this.element.find(".jstree-checked").removeClass("jstree-checked"),this.trigger("uncheck_all",{selected:this._data.checkbox.selected,node:a})},this.is_checked=function(b){return this.settings.checkbox.tie_selection?this.is_selected(b):(b=this.get_node(b),b&&b.id!==a.jstree.root?b.state.checked:!1)},this.get_checked=function(b){return this.settings.checkbox.tie_selection?this.get_selected(b):b?a.map(this._data.checkbox.selected,a.proxy(function(a){return this.get_node(a)},this)):this._data.checkbox.selected.slice()},this.get_top_checked=function(b){if(this.settings.checkbox.tie_selection)return this.get_top_selected(b);var c=this.get_checked(!0),d={},e,f,g,h;for(e=0,f=c.length;f>e;e++)d[c[e].id]=c[e];for(e=0,f=c.length;f>e;e++)for(g=0,h=c[e].children_d.length;h>g;g++)d[c[e].children_d[g]]&&delete d[c[e].children_d[g]];c=[];for(e in d)d.hasOwnProperty(e)&&c.push(e);return b?a.map(c,a.proxy(function(a){return this.get_node(a)},this)):c},this.get_bottom_checked=function(b){if(this.settings.checkbox.tie_selection)return this.get_bottom_selected(b);var c=this.get_checked(!0),d=[],e,f;for(e=0,f=c.length;f>e;e++)c[e].children.length||d.push(c[e].id);return b?a.map(d,a.proxy(function(a){return this.get_node(a)},this)):d},this.load_node=function(b,c){var e,f,g,h,i,j;if(!a.isArray(b)&&!this.settings.checkbox.tie_selection&&(j=this.get_node(b),j&&j.state.loaded))for(e=0,f=j.children_d.length;f>e;e++)this._model.data[j.children_d[e]].state.checked&&(i=!0,this._data.checkbox.selected=a.vakata.array_remove_item(this._data.checkbox.selected,j.children_d[e]));return d.load_node.apply(this,arguments)},this.get_state=function(){var a=d.get_state.apply(this,arguments);return this.settings.checkbox.tie_selection?a:(a.checkbox=this._data.checkbox.selected.slice(),a)},this.set_state=function(b,c){var e=d.set_state.apply(this,arguments);if(e&&b.checkbox){if(!this.settings.checkbox.tie_selection){this.uncheck_all();var f=this;a.each(b.checkbox,function(a,b){f.check_node(b)})}return delete b.checkbox,this.set_state(b,c),!1}return e},this.refresh=function(a,b){return this.settings.checkbox.tie_selection&&(this._data.checkbox.selected=[]),d.refresh.apply(this,arguments)}},a.jstree.defaults.conditionalselect=function(){return!0},a.jstree.plugins.conditionalselect=function(a,b){this.activate_node=function(a,c){return this.settings.conditionalselect.call(this,this.get_node(a),c)?b.activate_node.call(this,a,c):void 0}},a.jstree.defaults.contextmenu={select_node:!0,show_at_node:!0,items:function(b,c){return{create:{separator_before:!1,separator_after:!0,_disabled:!1,label:"Create",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.create_node(d,{},"last",function(a){try{c.edit(a)}catch(b){setTimeout(function(){c.edit(a)},0)}})}},rename:{separator_before:!1,separator_after:!1,_disabled:!1,label:"Rename",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.edit(d)}},remove:{separator_before:!1,icon:!1,separator_after:!1,_disabled:!1,label:"Delete",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.is_selected(d)?c.delete_node(c.get_selected()):c.delete_node(d)}},ccp:{separator_before:!0,icon:!1,separator_after:!1,label:"Edit",action:!1,submenu:{cut:{separator_before:!1,separator_after:!1,label:"Cut",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.is_selected(d)?c.cut(c.get_top_selected()):c.cut(d)}},copy:{separator_before:!1,icon:!1,separator_after:!1,label:"Copy",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.is_selected(d)?c.copy(c.get_top_selected()):c.copy(d)}},paste:{separator_before:!1,icon:!1,_disabled:function(b){return!a.jstree.reference(b.reference).can_paste()},separator_after:!1,label:"Paste",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.paste(d)}}}}}}},a.jstree.plugins.contextmenu=function(c,d){this.bind=function(){d.bind.call(this);var b=0,c=null,e,f;this.element.on("init.jstree loading.jstree ready.jstree",a.proxy(function(){this.get_container_ul().addClass("jstree-contextmenu")},this)).on("contextmenu.jstree",".jstree-anchor",a.proxy(function(a,d){"input"!==a.target.tagName.toLowerCase()&&(a.preventDefault(),b=a.ctrlKey?+new Date:0,(d||c)&&(b=+new Date+1e4),c&&clearTimeout(c),this.is_loading(a.currentTarget)||this.show_contextmenu(a.currentTarget,a.pageX,a.pageY,a))},this)).on("click.jstree",".jstree-anchor",a.proxy(function(c){this._data.contextmenu.visible&&(!b||+new Date-b>250)&&a.vakata.context.hide(),b=0},this)).on("touchstart.jstree",".jstree-anchor",function(b){b.originalEvent&&b.originalEvent.changedTouches&&b.originalEvent.changedTouches[0]&&(e=b.originalEvent.changedTouches[0].clientX,f=b.originalEvent.changedTouches[0].clientY,c=setTimeout(function(){a(b.currentTarget).trigger("contextmenu",!0)},750))}).on("touchmove.vakata.jstree",function(b){c&&b.originalEvent&&b.originalEvent.changedTouches&&b.originalEvent.changedTouches[0]&&(Math.abs(e-b.originalEvent.changedTouches[0].clientX)>10||Math.abs(f-b.originalEvent.changedTouches[0].clientY)>10)&&(clearTimeout(c),a.vakata.context.hide())}).on("touchend.vakata.jstree",function(a){c&&clearTimeout(c)}),a(i).on("context_hide.vakata.jstree",a.proxy(function(b,c){this._data.contextmenu.visible=!1,a(c.reference).removeClass("jstree-context")},this))},this.teardown=function(){this._data.contextmenu.visible&&a.vakata.context.hide(),d.teardown.call(this)},this.show_contextmenu=function(c,d,e,f){if(c=this.get_node(c),!c||c.id===a.jstree.root)return!1;var g=this.settings.contextmenu,h=this.get_node(c,!0),i=h.children(".jstree-anchor"),j=!1,k=!1;(g.show_at_node||d===b||e===b)&&(j=i.offset(),d=j.left,e=j.top+this._data.core.li_height),this.settings.contextmenu.select_node&&!this.is_selected(c)&&this.activate_node(c,f),k=g.items,a.isFunction(k)&&(k=k.call(this,c,a.proxy(function(a){this._show_contextmenu(c,d,e,a)},this))),a.isPlainObject(k)&&this._show_contextmenu(c,d,e,k)},this._show_contextmenu=function(b,c,d,e){var f=this.get_node(b,!0),g=f.children(".jstree-anchor");a(i).one("context_show.vakata.jstree",a.proxy(function(b,c){var d="jstree-contextmenu jstree-"+this.get_theme()+"-contextmenu";a(c.element).addClass(d),g.addClass("jstree-context")},this)),this._data.contextmenu.visible=!0,a.vakata.context.show(g,{x:c,y:d},e),this.trigger("show_contextmenu",{node:b,x:c,y:d})}},function(a){var b=!1,c={element:!1,reference:!1,position_x:0,position_y:0,items:[],html:"",is_visible:!1};a.vakata.context={settings:{hide_onmouseleave:0,icons:!0},_trigger:function(b){a(i).triggerHandler("context_"+b+".vakata",{reference:c.reference,element:c.element,position:{x:c.position_x,y:c.position_y}})},_execute:function(b){return b=c.items[b],b&&(!b._disabled||a.isFunction(b._disabled)&&!b._disabled({item:b,reference:c.reference,element:c.element}))&&b.action?b.action.call(null,{item:b,reference:c.reference,element:c.element,position:{x:c.position_x,y:c.position_y}}):!1},_parse:function(b,d){if(!b)return!1;d||(c.html="",c.items=[]);var e="",f=!1,g;return d&&(e+="<ul>"),a.each(b,function(b,d){return d?(c.items.push(d),!f&&d.separator_before&&(e+="<li class='vakata-context-separator'><a href='#' "+(a.vakata.context.settings.icons?"":'style="margin-left:0px;"')+">&#160;</a></li>"),f=!1,e+="<li class='"+(d._class||"")+(d._disabled===!0||a.isFunction(d._disabled)&&d._disabled({item:d,reference:c.reference,element:c.element})?" vakata-contextmenu-disabled ":"")+"' "+(d.shortcut?" data-shortcut='"+d.shortcut+"' ":"")+">",e+="<a href='#' rel='"+(c.items.length-1)+"' "+(d.title?"title='"+d.title+"'":"")+">",a.vakata.context.settings.icons&&(e+="<i ",
5
+ d.icon&&(e+=-1!==d.icon.indexOf("/")||-1!==d.icon.indexOf(".")?" style='background:url(\""+d.icon+"\") center center no-repeat' ":" class='"+d.icon+"' "),e+="></i><span class='vakata-contextmenu-sep'>&#160;</span>"),e+=(a.isFunction(d.label)?d.label({item:b,reference:c.reference,element:c.element}):d.label)+(d.shortcut?' <span class="vakata-contextmenu-shortcut vakata-contextmenu-shortcut-'+d.shortcut+'">'+(d.shortcut_label||"")+"</span>":"")+"</a>",d.submenu&&(g=a.vakata.context._parse(d.submenu,!0),g&&(e+=g)),e+="</li>",void(d.separator_after&&(e+="<li class='vakata-context-separator'><a href='#' "+(a.vakata.context.settings.icons?"":'style="margin-left:0px;"')+">&#160;</a></li>",f=!0))):!0}),e=e.replace(/<li class\='vakata-context-separator'\><\/li\>$/,""),d&&(e+="</ul>"),d||(c.html=e,a.vakata.context._trigger("parse")),e.length>10?e:!1},_show_submenu:function(c){if(c=a(c),c.length&&c.children("ul").length){var d=c.children("ul"),e=c.offset().left,f=e+c.outerWidth(),g=c.offset().top,h=d.width(),i=d.height(),j=a(window).width()+a(window).scrollLeft(),k=a(window).height()+a(window).scrollTop();b?c[f-(h+10+c.outerWidth())<0?"addClass":"removeClass"]("vakata-context-left"):c[f+h>j&&e>j-f?"addClass":"removeClass"]("vakata-context-right"),g+i+10>k&&d.css("bottom","-1px"),c.hasClass("vakata-context-right")?h>e&&d.css("margin-right",e-h):h>j-f&&d.css("margin-left",j-f-h),d.show()}},show:function(d,e,f){var g,h,j,k,l,m,n,o,p=!0;switch(c.element&&c.element.length&&c.element.width(""),p){case!e&&!d:return!1;case!!e&&!!d:c.reference=d,c.position_x=e.x,c.position_y=e.y;break;case!e&&!!d:c.reference=d,g=d.offset(),c.position_x=g.left+d.outerHeight(),c.position_y=g.top;break;case!!e&&!d:c.position_x=e.x,c.position_y=e.y}d&&!f&&a(d).data("vakata_contextmenu")&&(f=a(d).data("vakata_contextmenu")),a.vakata.context._parse(f)&&c.element.html(c.html),c.items.length&&(c.element.appendTo(i.body),h=c.element,j=c.position_x,k=c.position_y,l=h.width(),m=h.height(),n=a(window).width()+a(window).scrollLeft(),o=a(window).height()+a(window).scrollTop(),b&&(j-=h.outerWidth()-a(d).outerWidth(),j<a(window).scrollLeft()+20&&(j=a(window).scrollLeft()+20)),j+l+20>n&&(j=n-(l+20)),k+m+20>o&&(k=o-(m+20)),c.element.css({left:j,top:k}).show().find("a").first().focus().parent().addClass("vakata-context-hover"),c.is_visible=!0,a.vakata.context._trigger("show"))},hide:function(){c.is_visible&&(c.element.hide().find("ul").hide().end().find(":focus").blur().end().detach(),c.is_visible=!1,a.vakata.context._trigger("hide"))}},a(function(){b="rtl"===a(i.body).css("direction");var d=!1;c.element=a("<ul class='vakata-context'></ul>"),c.element.on("mouseenter","li",function(b){b.stopImmediatePropagation(),a.contains(this,b.relatedTarget)||(d&&clearTimeout(d),c.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(),a(this).siblings().find("ul").hide().end().end().parentsUntil(".vakata-context","li").addBack().addClass("vakata-context-hover"),a.vakata.context._show_submenu(this))}).on("mouseleave","li",function(b){a.contains(this,b.relatedTarget)||a(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover")}).on("mouseleave",function(b){a(this).find(".vakata-context-hover").removeClass("vakata-context-hover"),a.vakata.context.settings.hide_onmouseleave&&(d=setTimeout(function(b){return function(){a.vakata.context.hide()}}(this),a.vakata.context.settings.hide_onmouseleave))}).on("click","a",function(b){b.preventDefault(),a(this).blur().parent().hasClass("vakata-context-disabled")||a.vakata.context._execute(a(this).attr("rel"))===!1||a.vakata.context.hide()}).on("keydown","a",function(b){var d=null;switch(b.which){case 13:case 32:b.type="click",b.preventDefault(),a(b.currentTarget).trigger(b);break;case 37:c.is_visible&&(c.element.find(".vakata-context-hover").last().closest("li").first().find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children("a").focus(),b.stopImmediatePropagation(),b.preventDefault());break;case 38:c.is_visible&&(d=c.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first(),d.length||(d=c.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last()),d.addClass("vakata-context-hover").children("a").focus(),b.stopImmediatePropagation(),b.preventDefault());break;case 39:c.is_visible&&(c.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children("a").focus(),b.stopImmediatePropagation(),b.preventDefault());break;case 40:c.is_visible&&(d=c.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first(),d.length||(d=c.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first()),d.addClass("vakata-context-hover").children("a").focus(),b.stopImmediatePropagation(),b.preventDefault());break;case 27:a.vakata.context.hide(),b.preventDefault()}}).on("keydown",function(a){a.preventDefault();var b=c.element.find(".vakata-contextmenu-shortcut-"+a.which).parent();b.parent().not(".vakata-context-disabled")&&b.click()}),a(i).on("mousedown.vakata.jstree",function(b){c.is_visible&&c.element[0]!==b.target&&!a.contains(c.element[0],b.target)&&a.vakata.context.hide()}).on("context_show.vakata.jstree",function(a,d){c.element.find("li:has(ul)").children("a").addClass("vakata-context-parent"),b&&c.element.addClass("vakata-context-rtl").css("direction","rtl"),c.element.find("ul").hide().end()})})}(a),a.jstree.defaults.dnd={copy:!0,open_timeout:500,is_draggable:!0,check_while_dragging:!0,always_copy:!1,inside_pos:0,drag_selection:!0,touch:!0,large_drop_target:!1,large_drag_target:!1,use_html5:!1};var k,l;a.jstree.plugins.dnd=function(b,c){this.init=function(a,b){c.init.call(this,a,b),this.settings.dnd.use_html5=this.settings.dnd.use_html5&&"draggable"in i.createElement("span")},this.bind=function(){c.bind.call(this),this.element.on(this.settings.dnd.use_html5?"dragstart.jstree":"mousedown.jstree touchstart.jstree",this.settings.dnd.large_drag_target?".jstree-node":".jstree-anchor",a.proxy(function(b){if(this.settings.dnd.large_drag_target&&a(b.target).closest(".jstree-node")[0]!==b.currentTarget)return!0;if("touchstart"===b.type&&(!this.settings.dnd.touch||"selected"===this.settings.dnd.touch&&!a(b.currentTarget).closest(".jstree-node").children(".jstree-anchor").hasClass("jstree-clicked")))return!0;var c=this.get_node(b.target),d=this.is_selected(c)&&this.settings.dnd.drag_selection?this.get_top_selected().length:1,e=d>1?d+" "+this.get_string("nodes"):this.get_text(b.currentTarget);if(this.settings.core.force_text&&(e=a.vakata.html.escape(e)),c&&c.id&&c.id!==a.jstree.root&&(1===b.which||"touchstart"===b.type||"dragstart"===b.type)&&(this.settings.dnd.is_draggable===!0||a.isFunction(this.settings.dnd.is_draggable)&&this.settings.dnd.is_draggable.call(this,d>1?this.get_top_selected(!0):[c],b))){if(k={jstree:!0,origin:this,obj:this.get_node(c,!0),nodes:d>1?this.get_top_selected():[c.id]},l=b.currentTarget,!this.settings.dnd.use_html5)return this.element.trigger("mousedown.jstree"),a.vakata.dnd.start(b,k,'<div id="jstree-dnd" class="jstree-'+this.get_theme()+" jstree-"+this.get_theme()+"-"+this.get_theme_variant()+" "+(this.settings.core.themes.responsive?" jstree-dnd-responsive":"")+'"><i class="jstree-icon jstree-er"></i>'+e+'<ins class="jstree-copy" style="display:none;">+</ins></div>');a.vakata.dnd._trigger("start",b,{helper:a(),element:l,data:k})}},this)),this.settings.dnd.use_html5&&this.element.on("dragover.jstree",function(b){return b.preventDefault(),a.vakata.dnd._trigger("move",b,{helper:a(),element:l,data:k}),!1}).on("drop.jstree",a.proxy(function(b){return b.preventDefault(),a.vakata.dnd._trigger("stop",b,{helper:a(),element:l,data:k}),!1},this))},this.redraw_node=function(a,b,d,e){if(a=c.redraw_node.apply(this,arguments),a&&this.settings.dnd.use_html5)if(this.settings.dnd.large_drag_target)a.setAttribute("draggable",!0);else{var f,g,h=null;for(f=0,g=a.childNodes.length;g>f;f++)if(a.childNodes[f]&&a.childNodes[f].className&&-1!==a.childNodes[f].className.indexOf("jstree-anchor")){h=a.childNodes[f];break}h&&h.setAttribute("draggable",!0)}return a}},a(function(){var c=!1,d=!1,e=!1,f=!1,g=a('<div id="jstree-marker">&#160;</div>').hide();a(i).on("dragover.vakata.jstree",function(b){l&&a.vakata.dnd._trigger("move",b,{helper:a(),element:l,data:k})}).on("drop.vakata.jstree",function(b){l&&(a.vakata.dnd._trigger("stop",b,{helper:a(),element:l,data:k}),l=null,k=null)}).on("dnd_start.vakata.jstree",function(a,b){c=!1,e=!1,b&&b.data&&b.data.jstree&&g.appendTo(i.body)}).on("dnd_move.vakata.jstree",function(h,i){var j=i.event.target!==e.target;if(f&&(!i.event||"dragover"!==i.event.type||j)&&clearTimeout(f),i&&i.data&&i.data.jstree&&(!i.event.target.id||"jstree-marker"!==i.event.target.id)){e=i.event;var k=a.jstree.reference(i.event.target),l=!1,m=!1,n=!1,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E;if(k&&k._data&&k._data.dnd)if(g.attr("class","jstree-"+k.get_theme()+(k.settings.core.themes.responsive?" jstree-dnd-responsive":"")),D=i.data.origin&&(i.data.origin.settings.dnd.always_copy||i.data.origin.settings.dnd.copy&&(i.event.metaKey||i.event.ctrlKey)),i.helper.children().attr("class","jstree-"+k.get_theme()+" jstree-"+k.get_theme()+"-"+k.get_theme_variant()+" "+(k.settings.core.themes.responsive?" jstree-dnd-responsive":"")).find(".jstree-copy").first()[D?"show":"hide"](),i.event.target!==k.element[0]&&i.event.target!==k.get_container_ul()[0]||0!==k.get_container_ul().children().length){if(l=k.settings.dnd.large_drop_target?a(i.event.target).closest(".jstree-node").children(".jstree-anchor"):a(i.event.target).closest(".jstree-anchor"),l&&l.length&&l.parent().is(".jstree-closed, .jstree-open, .jstree-leaf")&&(m=l.offset(),n=(i.event.pageY!==b?i.event.pageY:i.event.originalEvent.pageY)-m.top,r=l.outerHeight(),u=r/3>n?["b","i","a"]:n>r-r/3?["a","i","b"]:n>r/2?["i","a","b"]:["i","b","a"],a.each(u,function(b,e){switch(e){case"b":p=m.left-6,q=m.top,s=k.get_parent(l),t=l.parent().index();break;case"i":B=k.settings.dnd.inside_pos,C=k.get_node(l.parent()),p=m.left-2,q=m.top+r/2+1,s=C.id,t="first"===B?0:"last"===B?C.children.length:Math.min(B,C.children.length);break;case"a":p=m.left-6,q=m.top+r,s=k.get_parent(l),t=l.parent().index()+1}for(v=!0,w=0,x=i.data.nodes.length;x>w;w++)if(y=i.data.origin&&(i.data.origin.settings.dnd.always_copy||i.data.origin.settings.dnd.copy&&(i.event.metaKey||i.event.ctrlKey))?"copy_node":"move_node",z=t,"move_node"===y&&"a"===e&&i.data.origin&&i.data.origin===k&&s===k.get_parent(i.data.nodes[w])&&(A=k.get_node(s),z>a.inArray(i.data.nodes[w],A.children)&&(z-=1)),v=v&&(k&&k.settings&&k.settings.dnd&&k.settings.dnd.check_while_dragging===!1||k.check(y,i.data.origin&&i.data.origin!==k?i.data.origin.get_node(i.data.nodes[w]):i.data.nodes[w],s,z,{dnd:!0,ref:k.get_node(l.parent()),pos:e,origin:i.data.origin,is_multi:i.data.origin&&i.data.origin!==k,is_foreign:!i.data.origin})),!v){k&&k.last_error&&(d=k.last_error());break}return"i"===e&&l.parent().is(".jstree-closed")&&k.settings.dnd.open_timeout&&(!i.event||"dragover"!==i.event.type||j)&&(f&&clearTimeout(f),f=setTimeout(function(a,b){return function(){a.open_node(b)}}(k,l),k.settings.dnd.open_timeout)),v?(E=k.get_node(s,!0),E.hasClass(".jstree-dnd-parent")||(a(".jstree-dnd-parent").removeClass("jstree-dnd-parent"),E.addClass("jstree-dnd-parent")),c={ins:k,par:s,pos:"i"!==e||"last"!==B||0!==t||k.is_loaded(C)?t:"last"},g.css({left:p+"px",top:q+"px"}).show(),i.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok"),i.event.originalEvent&&i.event.originalEvent.dataTransfer&&(i.event.originalEvent.dataTransfer.dropEffect=D?"copy":"move"),d={},u=!0,!1):void 0}),u===!0))return}else{for(v=!0,w=0,x=i.data.nodes.length;x>w;w++)if(v=v&&k.check(i.data.origin&&(i.data.origin.settings.dnd.always_copy||i.data.origin.settings.dnd.copy&&(i.event.metaKey||i.event.ctrlKey))?"copy_node":"move_node",i.data.origin&&i.data.origin!==k?i.data.origin.get_node(i.data.nodes[w]):i.data.nodes[w],a.jstree.root,"last",{dnd:!0,ref:k.get_node(a.jstree.root),pos:"i",origin:i.data.origin,is_multi:i.data.origin&&i.data.origin!==k,is_foreign:!i.data.origin}),!v)break;if(v)return c={ins:k,par:a.jstree.root,pos:"last"},g.hide(),i.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok"),void(i.event.originalEvent&&i.event.originalEvent.dataTransfer&&(i.event.originalEvent.dataTransfer.dropEffect=D?"copy":"move"))}a(".jstree-dnd-parent").removeClass("jstree-dnd-parent"),c=!1,i.helper.find(".jstree-icon").removeClass("jstree-ok").addClass("jstree-er"),i.event.originalEvent&&i.event.originalEvent.dataTransfer,g.hide()}}).on("dnd_scroll.vakata.jstree",function(a,b){b&&b.data&&b.data.jstree&&(g.hide(),c=!1,e=!1,b.helper.find(".jstree-icon").first().removeClass("jstree-ok").addClass("jstree-er"))}).on("dnd_stop.vakata.jstree",function(b,h){if(a(".jstree-dnd-parent").removeClass("jstree-dnd-parent"),f&&clearTimeout(f),h&&h.data&&h.data.jstree){g.hide().detach();var i,j,k=[];if(c){for(i=0,j=h.data.nodes.length;j>i;i++)k[i]=h.data.origin?h.data.origin.get_node(h.data.nodes[i]):h.data.nodes[i];c.ins[h.data.origin&&(h.data.origin.settings.dnd.always_copy||h.data.origin.settings.dnd.copy&&(h.event.metaKey||h.event.ctrlKey))?"copy_node":"move_node"](k,c.par,c.pos,!1,!1,!1,h.data.origin)}else i=a(h.event.target).closest(".jstree"),i.length&&d&&d.error&&"check"===d.error&&(i=i.jstree(!0),i&&i.settings.core.error.call(this,d));e=!1,c=!1}}).on("keyup.jstree keydown.jstree",function(b,h){h=a.vakata.dnd._get(),h&&h.data&&h.data.jstree&&("keyup"===b.type&&27===b.which?(f&&clearTimeout(f),c=!1,d=!1,e=!1,f=!1,g.hide().detach(),a.vakata.dnd._clean()):(h.helper.find(".jstree-copy").first()[h.data.origin&&(h.data.origin.settings.dnd.always_copy||h.data.origin.settings.dnd.copy&&(b.metaKey||b.ctrlKey))?"show":"hide"](),e&&(e.metaKey=b.metaKey,e.ctrlKey=b.ctrlKey,a.vakata.dnd._trigger("move",e))))})}),function(a){a.vakata.html={div:a("<div />"),escape:function(b){return a.vakata.html.div.text(b).html()},strip:function(b){return a.vakata.html.div.empty().append(a.parseHTML(b)).text()}};var c={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1};a.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5,threshold_touch:10},_trigger:function(c,d,e){e===b&&(e=a.vakata.dnd._get()),e.event=d,a(i).triggerHandler("dnd_"+c+".vakata",e)},_get:function(){return{data:c.data,element:c.element,helper:c.helper}},_clean:function(){c.helper&&c.helper.remove(),c.scroll_i&&(clearInterval(c.scroll_i),c.scroll_i=!1),c={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1},a(i).off("mousemove.vakata.jstree touchmove.vakata.jstree",a.vakata.dnd.drag),a(i).off("mouseup.vakata.jstree touchend.vakata.jstree",a.vakata.dnd.stop)},_scroll:function(b){if(!c.scroll_e||!c.scroll_l&&!c.scroll_t)return c.scroll_i&&(clearInterval(c.scroll_i),c.scroll_i=!1),!1;if(!c.scroll_i)return c.scroll_i=setInterval(a.vakata.dnd._scroll,100),!1;if(b===!0)return!1;var d=c.scroll_e.scrollTop(),e=c.scroll_e.scrollLeft();c.scroll_e.scrollTop(d+c.scroll_t*a.vakata.dnd.settings.scroll_speed),c.scroll_e.scrollLeft(e+c.scroll_l*a.vakata.dnd.settings.scroll_speed),(d!==c.scroll_e.scrollTop()||e!==c.scroll_e.scrollLeft())&&a.vakata.dnd._trigger("scroll",c.scroll_e)},start:function(b,d,e){"touchstart"===b.type&&b.originalEvent&&b.originalEvent.changedTouches&&b.originalEvent.changedTouches[0]&&(b.pageX=b.originalEvent.changedTouches[0].pageX,b.pageY=b.originalEvent.changedTouches[0].pageY,b.target=i.elementFromPoint(b.originalEvent.changedTouches[0].pageX-window.pageXOffset,b.originalEvent.changedTouches[0].pageY-window.pageYOffset)),c.is_drag&&a.vakata.dnd.stop({});try{b.currentTarget.unselectable="on",b.currentTarget.onselectstart=function(){return!1},b.currentTarget.style&&(b.currentTarget.style.touchAction="none",b.currentTarget.style.msTouchAction="none",b.currentTarget.style.MozUserSelect="none")}catch(f){}return c.init_x=b.pageX,c.init_y=b.pageY,c.data=d,c.is_down=!0,c.element=b.currentTarget,c.target=b.target,c.is_touch="touchstart"===b.type,e!==!1&&(c.helper=a("<div id='vakata-dnd'></div>").html(e).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),a(i).on("mousemove.vakata.jstree touchmove.vakata.jstree",a.vakata.dnd.drag),a(i).on("mouseup.vakata.jstree touchend.vakata.jstree",a.vakata.dnd.stop),!1},drag:function(b){if("touchmove"===b.type&&b.originalEvent&&b.originalEvent.changedTouches&&b.originalEvent.changedTouches[0]&&(b.pageX=b.originalEvent.changedTouches[0].pageX,b.pageY=b.originalEvent.changedTouches[0].pageY,b.target=i.elementFromPoint(b.originalEvent.changedTouches[0].pageX-window.pageXOffset,b.originalEvent.changedTouches[0].pageY-window.pageYOffset)),c.is_down){if(!c.is_drag){if(!(Math.abs(b.pageX-c.init_x)>(c.is_touch?a.vakata.dnd.settings.threshold_touch:a.vakata.dnd.settings.threshold)||Math.abs(b.pageY-c.init_y)>(c.is_touch?a.vakata.dnd.settings.threshold_touch:a.vakata.dnd.settings.threshold)))return;c.helper&&(c.helper.appendTo(i.body),c.helper_w=c.helper.outerWidth()),c.is_drag=!0,a(c.target).one("click.vakata",!1),a.vakata.dnd._trigger("start",b)}var d=!1,e=!1,f=!1,g=!1,h=!1,j=!1,k=!1,l=!1,m=!1,n=!1;return c.scroll_t=0,c.scroll_l=0,c.scroll_e=!1,a(a(b.target).parentsUntil("body").addBack().get().reverse()).filter(function(){return/^auto|scroll$/.test(a(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var d=a(this),e=d.offset();return this.scrollHeight>this.offsetHeight&&(e.top+d.height()-b.pageY<a.vakata.dnd.settings.scroll_proximity&&(c.scroll_t=1),b.pageY-e.top<a.vakata.dnd.settings.scroll_proximity&&(c.scroll_t=-1)),this.scrollWidth>this.offsetWidth&&(e.left+d.width()-b.pageX<a.vakata.dnd.settings.scroll_proximity&&(c.scroll_l=1),b.pageX-e.left<a.vakata.dnd.settings.scroll_proximity&&(c.scroll_l=-1)),c.scroll_t||c.scroll_l?(c.scroll_e=a(this),!1):void 0}),c.scroll_e||(d=a(i),e=a(window),f=d.height(),g=e.height(),h=d.width(),j=e.width(),k=d.scrollTop(),l=d.scrollLeft(),f>g&&b.pageY-k<a.vakata.dnd.settings.scroll_proximity&&(c.scroll_t=-1),f>g&&g-(b.pageY-k)<a.vakata.dnd.settings.scroll_proximity&&(c.scroll_t=1),h>j&&b.pageX-l<a.vakata.dnd.settings.scroll_proximity&&(c.scroll_l=-1),h>j&&j-(b.pageX-l)<a.vakata.dnd.settings.scroll_proximity&&(c.scroll_l=1),(c.scroll_t||c.scroll_l)&&(c.scroll_e=d)),c.scroll_e&&a.vakata.dnd._scroll(!0),c.helper&&(m=parseInt(b.pageY+a.vakata.dnd.settings.helper_top,10),n=parseInt(b.pageX+a.vakata.dnd.settings.helper_left,10),f&&m+25>f&&(m=f-50),h&&n+c.helper_w>h&&(n=h-(c.helper_w+2)),c.helper.css({left:n+"px",top:m+"px"})),a.vakata.dnd._trigger("move",b),!1}},stop:function(b){if("touchend"===b.type&&b.originalEvent&&b.originalEvent.changedTouches&&b.originalEvent.changedTouches[0]&&(b.pageX=b.originalEvent.changedTouches[0].pageX,b.pageY=b.originalEvent.changedTouches[0].pageY,b.target=i.elementFromPoint(b.originalEvent.changedTouches[0].pageX-window.pageXOffset,b.originalEvent.changedTouches[0].pageY-window.pageYOffset)),c.is_drag)b.target!==c.target&&a(c.target).off("click.vakata"),a.vakata.dnd._trigger("stop",b);else if("touchend"===b.type&&b.target===c.target){var d=setTimeout(function(){a(b.target).click()},100);a(b.target).one("click",function(){d&&clearTimeout(d)})}return a.vakata.dnd._clean(),!1}}}(a),a.jstree.defaults.massload=null,a.jstree.plugins.massload=function(b,c){this.init=function(a,b){this._data.massload={},c.init.call(this,a,b)},this._load_nodes=function(b,d,e,f){var g=this.settings.massload,h=JSON.stringify(b),i=[],j=this._model.data,k,l,m;if(!e){for(k=0,l=b.length;l>k;k++)(!j[b[k]]||!j[b[k]].state.loaded&&!j[b[k]].state.failed||f)&&(i.push(b[k]),m=this.get_node(b[k],!0),m&&m.length&&m.addClass("jstree-loading").attr("aria-busy",!0));if(this._data.massload={},i.length){if(a.isFunction(g))return g.call(this,i,a.proxy(function(a){var g,h;if(a)for(g in a)a.hasOwnProperty(g)&&(this._data.massload[g]=a[g]);for(g=0,h=b.length;h>g;g++)m=this.get_node(b[g],!0),m&&m.length&&m.removeClass("jstree-loading").attr("aria-busy",!1);c._load_nodes.call(this,b,d,e,f)},this));if("object"==typeof g&&g&&g.url)return g=a.extend(!0,{},g),a.isFunction(g.url)&&(g.url=g.url.call(this,i)),a.isFunction(g.data)&&(g.data=g.data.call(this,i)),a.ajax(g).done(a.proxy(function(a,g,h){var i,j;if(a)for(i in a)a.hasOwnProperty(i)&&(this._data.massload[i]=a[i]);for(i=0,j=b.length;j>i;i++)m=this.get_node(b[i],!0),m&&m.length&&m.removeClass("jstree-loading").attr("aria-busy",!1);c._load_nodes.call(this,b,d,e,f)},this)).fail(a.proxy(function(a){c._load_nodes.call(this,b,d,e,f)},this))}}return c._load_nodes.call(this,b,d,e,f)},this._load_node=function(b,d){var e=this._data.massload[b.id],f=null,g;return e?(f=this["string"==typeof e?"_append_html_data":"_append_json_data"](b,"string"==typeof e?a(a.parseHTML(e)).filter(function(){return 3!==this.nodeType}):e,function(a){d.call(this,a)}),g=this.get_node(b.id,!0),g&&g.length&&g.removeClass("jstree-loading").attr("aria-busy",!1),delete this._data.massload[b.id],f):c._load_node.call(this,b,d)}},a.jstree.defaults.search={ajax:!1,fuzzy:!1,case_sensitive:!1,show_only_matches:!1,show_only_matches_children:!1,close_opened_onclear:!0,search_leaves_only:!1,search_callback:!1},a.jstree.plugins.search=function(c,d){this.bind=function(){d.bind.call(this),this._data.search.str="",this._data.search.dom=a(),this._data.search.res=[],this._data.search.opn=[],this._data.search.som=!1,this._data.search.smc=!1,this._data.search.hdn=[],this.element.on("search.jstree",a.proxy(function(b,c){if(this._data.search.som&&c.res.length){var d=this._model.data,e,f,g=[],h,i;for(e=0,f=c.res.length;f>e;e++)if(d[c.res[e]]&&!d[c.res[e]].state.hidden&&(g.push(c.res[e]),g=g.concat(d[c.res[e]].parents),this._data.search.smc))for(h=0,i=d[c.res[e]].children_d.length;i>h;h++)d[d[c.res[e]].children_d[h]]&&!d[d[c.res[e]].children_d[h]].state.hidden&&g.push(d[c.res[e]].children_d[h]);g=a.vakata.array_remove_item(a.vakata.array_unique(g),a.jstree.root),this._data.search.hdn=this.hide_all(!0),this.show_node(g,!0),this.redraw(!0)}},this)).on("clear_search.jstree",a.proxy(function(a,b){this._data.search.som&&b.res.length&&(this.show_node(this._data.search.hdn,!0),this.redraw(!0))},this))},this.search=function(c,d,e,f,g,h){if(c===!1||""===a.trim(c.toString()))return this.clear_search();f=this.get_node(f),f=f&&f.id?f.id:null,c=c.toString();var i=this.settings.search,j=i.ajax?i.ajax:!1,k=this._model.data,l=null,m=[],n=[],o,p;if(this._data.search.res.length&&!g&&this.clear_search(),e===b&&(e=i.show_only_matches),h===b&&(h=i.show_only_matches_children),!d&&j!==!1)return a.isFunction(j)?j.call(this,c,a.proxy(function(b){b&&b.d&&(b=b.d),this._load_nodes(a.isArray(b)?a.vakata.array_unique(b):[],function(){this.search(c,!0,e,f,g,h)})},this),f):(j=a.extend({},j),j.data||(j.data={}),j.data.str=c,f&&(j.data.inside=f),this._data.search.lastRequest&&this._data.search.lastRequest.abort(),this._data.search.lastRequest=a.ajax(j).fail(a.proxy(function(){this._data.core.last_error={error:"ajax",plugin:"search",id:"search_01",reason:"Could not load search parents",data:JSON.stringify(j)},this.settings.core.error.call(this,this._data.core.last_error)},this)).done(a.proxy(function(b){b&&b.d&&(b=b.d),this._load_nodes(a.isArray(b)?a.vakata.array_unique(b):[],function(){this.search(c,!0,e,f,g,h)})},this)),this._data.search.lastRequest);if(g||(this._data.search.str=c,this._data.search.dom=a(),this._data.search.res=[],this._data.search.opn=[],this._data.search.som=e,this._data.search.smc=h),l=new a.vakata.search(c,!0,{caseSensitive:i.case_sensitive,fuzzy:i.fuzzy}),a.each(k[f?f:a.jstree.root].children_d,function(a,b){var d=k[b];d.text&&!d.state.hidden&&(!i.search_leaves_only||d.state.loaded&&0===d.children.length)&&(i.search_callback&&i.search_callback.call(this,c,d)||!i.search_callback&&l.search(d.text).isMatch)&&(m.push(b),n=n.concat(d.parents))}),m.length){for(n=a.vakata.array_unique(n),o=0,p=n.length;p>o;o++)n[o]!==a.jstree.root&&k[n[o]]&&this.open_node(n[o],null,0)===!0&&this._data.search.opn.push(n[o]);g?(this._data.search.dom=this._data.search.dom.add(a(this.element[0].querySelectorAll("#"+a.map(m,function(b){return-1!=="0123456789".indexOf(b[0])?"\\3"+b[0]+" "+b.substr(1).replace(a.jstree.idregex,"\\$&"):b.replace(a.jstree.idregex,"\\$&")}).join(", #")))),this._data.search.res=a.vakata.array_unique(this._data.search.res.concat(m))):(this._data.search.dom=a(this.element[0].querySelectorAll("#"+a.map(m,function(b){return-1!=="0123456789".indexOf(b[0])?"\\3"+b[0]+" "+b.substr(1).replace(a.jstree.idregex,"\\$&"):b.replace(a.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.res=m),this._data.search.dom.children(".jstree-anchor").addClass("jstree-search")}this.trigger("search",{nodes:this._data.search.dom,str:c,res:this._data.search.res,show_only_matches:e})},this.clear_search=function(){this.settings.search.close_opened_onclear&&this.close_node(this._data.search.opn,0),this.trigger("clear_search",{nodes:this._data.search.dom,str:this._data.search.str,res:this._data.search.res}),this._data.search.res.length&&(this._data.search.dom=a(this.element[0].querySelectorAll("#"+a.map(this._data.search.res,function(b){return-1!=="0123456789".indexOf(b[0])?"\\3"+b[0]+" "+b.substr(1).replace(a.jstree.idregex,"\\$&"):b.replace(a.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.dom.children(".jstree-anchor").removeClass("jstree-search")),this._data.search.str="",this._data.search.res=[],this._data.search.opn=[],this._data.search.dom=a()},this.redraw_node=function(b,c,e,f){if(b=d.redraw_node.apply(this,arguments),b&&-1!==a.inArray(b.id,this._data.search.res)){var g,h,i=null;for(g=0,h=b.childNodes.length;h>g;g++)if(b.childNodes[g]&&b.childNodes[g].className&&-1!==b.childNodes[g].className.indexOf("jstree-anchor")){i=b.childNodes[g];break}i&&(i.className+=" jstree-search")}return b}},function(a){a.vakata.search=function(b,c,d){d=d||{},d=a.extend({},a.vakata.search.defaults,d),d.fuzzy!==!1&&(d.fuzzy=!0),b=d.caseSensitive?b:b.toLowerCase();var e=d.location,f=d.distance,g=d.threshold,h=b.length,i,j,k,l;return h>32&&(d.fuzzy=!1),d.fuzzy&&(i=1<<h-1,j=function(){var a={},c=0;for(c=0;h>c;c++)a[b.charAt(c)]=0;for(c=0;h>c;c++)a[b.charAt(c)]|=1<<h-c-1;return a}(),k=function(a,b){var c=a/h,d=Math.abs(e-b);return f?c+d/f:d?1:c}),l=function(a){if(a=d.caseSensitive?a:a.toLowerCase(),b===a||-1!==a.indexOf(b))return{isMatch:!0,score:0};if(!d.fuzzy)return{isMatch:!1,score:1};var c,f,l=a.length,m=g,n=a.indexOf(b,e),o,p,q=h+l,r,s,t,u,v,w=1,x=[];for(-1!==n&&(m=Math.min(k(0,n),m),n=a.lastIndexOf(b,e+h),-1!==n&&(m=Math.min(k(0,n),m))),n=-1,c=0;h>c;c++){o=0,p=q;while(p>o)k(c,e+p)<=m?o=p:q=p,p=Math.floor((q-o)/2+o);for(q=p,s=Math.max(1,e-p+1),t=Math.min(e+p,l)+h,u=new Array(t+2),u[t+1]=(1<<c)-1,f=t;f>=s;f--)if(v=j[a.charAt(f-1)],0===c?u[f]=(u[f+1]<<1|1)&v:u[f]=(u[f+1]<<1|1)&v|((r[f+1]|r[f])<<1|1)|r[f+1],u[f]&i&&(w=k(c,f-1),m>=w)){if(m=w,n=f-1,x.push(n),!(n>e))break;s=Math.max(1,2*e-n)}if(k(c+1,e)>m)break;r=u}return{isMatch:n>=0,score:w}},c===!0?{search:l}:l(c)},a.vakata.search.defaults={location:0,distance:100,threshold:.6,fuzzy:!1,caseSensitive:!1}}(a),a.jstree.defaults.sort=function(a,b){return this.get_text(a)>this.get_text(b)?1:-1},a.jstree.plugins.sort=function(b,c){this.bind=function(){c.bind.call(this),this.element.on("model.jstree",a.proxy(function(a,b){this.sort(b.parent,!0)},this)).on("rename_node.jstree create_node.jstree",a.proxy(function(a,b){this.sort(b.parent||b.node.parent,!1),this.redraw_node(b.parent||b.node.parent,!0)},this)).on("move_node.jstree copy_node.jstree",a.proxy(function(a,b){this.sort(b.parent,!1),this.redraw_node(b.parent,!0)},this))},this.sort=function(b,c){var d,e;if(b=this.get_node(b),b&&b.children&&b.children.length&&(b.children.sort(a.proxy(this.settings.sort,this)),c))for(d=0,e=b.children_d.length;e>d;d++)this.sort(b.children_d[d],!1)}};var m=!1;a.jstree.defaults.state={key:"jstree",events:"changed.jstree open_node.jstree close_node.jstree check_node.jstree uncheck_node.jstree",ttl:!1,filter:!1,preserve_loaded:!1},a.jstree.plugins.state=function(b,c){this.bind=function(){c.bind.call(this);var b=a.proxy(function(){this.element.on(this.settings.state.events,a.proxy(function(){m&&clearTimeout(m),m=setTimeout(a.proxy(function(){this.save_state()},this),100)},this)),this.trigger("state_ready")},this);this.element.on("ready.jstree",a.proxy(function(a,c){this.element.one("restore_state.jstree",b),this.restore_state()||b()},this))},this.save_state=function(){var b=this.get_state();this.settings.state.preserve_loaded||delete b.core.loaded;var c={state:b,ttl:this.settings.state.ttl,sec:+new Date};a.vakata.storage.set(this.settings.state.key,JSON.stringify(c))},this.restore_state=function(){var b=a.vakata.storage.get(this.settings.state.key);if(b)try{b=JSON.parse(b)}catch(c){return!1}return b&&b.ttl&&b.sec&&+new Date-b.sec>b.ttl?!1:(b&&b.state&&(b=b.state),b&&a.isFunction(this.settings.state.filter)&&(b=this.settings.state.filter.call(this,b)),b?(this.settings.state.preserve_loaded||delete b.core.loaded,this.element.one("set_state.jstree",function(c,d){d.instance.trigger("restore_state",{state:a.extend(!0,{},b)})}),this.set_state(b),!0):!1)},this.clear_state=function(){return a.vakata.storage.del(this.settings.state.key)}},function(a,b){a.vakata.storage={set:function(a,b){return window.localStorage.setItem(a,b)},get:function(a){return window.localStorage.getItem(a)},del:function(a){return window.localStorage.removeItem(a)}}}(a),a.jstree.defaults.types={"default":{}},a.jstree.defaults.types[a.jstree.root]={},a.jstree.plugins.types=function(c,d){this.init=function(c,e){var f,g;if(e&&e.types&&e.types["default"])for(f in e.types)if("default"!==f&&f!==a.jstree.root&&e.types.hasOwnProperty(f))for(g in e.types["default"])e.types["default"].hasOwnProperty(g)&&e.types[f][g]===b&&(e.types[f][g]=e.types["default"][g]);d.init.call(this,c,e),this._model.data[a.jstree.root].type=a.jstree.root},this.refresh=function(b,c){d.refresh.call(this,b,c),this._model.data[a.jstree.root].type=a.jstree.root},this.bind=function(){this.element.on("model.jstree",a.proxy(function(c,d){var e=this._model.data,f=d.nodes,g=this.settings.types,h,i,j="default",k;for(h=0,i=f.length;i>h;h++){if(j="default",e[f[h]].original&&e[f[h]].original.type&&g[e[f[h]].original.type]&&(j=e[f[h]].original.type),e[f[h]].data&&e[f[h]].data.jstree&&e[f[h]].data.jstree.type&&g[e[f[h]].data.jstree.type]&&(j=e[f[h]].data.jstree.type),e[f[h]].type=j,e[f[h]].icon===!0&&g[j].icon!==b&&(e[f[h]].icon=g[j].icon),g[j].li_attr!==b&&"object"==typeof g[j].li_attr)for(k in g[j].li_attr)if(g[j].li_attr.hasOwnProperty(k)){if("id"===k)continue;e[f[h]].li_attr[k]===b?e[f[h]].li_attr[k]=g[j].li_attr[k]:"class"===k&&(e[f[h]].li_attr["class"]=g[j].li_attr["class"]+" "+e[f[h]].li_attr["class"])}if(g[j].a_attr!==b&&"object"==typeof g[j].a_attr)for(k in g[j].a_attr)if(g[j].a_attr.hasOwnProperty(k)){if("id"===k)continue;e[f[h]].a_attr[k]===b?e[f[h]].a_attr[k]=g[j].a_attr[k]:"href"===k&&"#"===e[f[h]].a_attr[k]?e[f[h]].a_attr.href=g[j].a_attr.href:"class"===k&&(e[f[h]].a_attr["class"]=g[j].a_attr["class"]+" "+e[f[h]].a_attr["class"])}}e[a.jstree.root].type=a.jstree.root},this)),d.bind.call(this)},this.get_json=function(b,c,e){var f,g,h=this._model.data,i=c?a.extend(!0,{},c,{no_id:!1}):{},j=d.get_json.call(this,b,i,e);if(j===!1)return!1;if(a.isArray(j))for(f=0,g=j.length;g>f;f++)j[f].type=j[f].id&&h[j[f].id]&&h[j[f].id].type?h[j[f].id].type:"default",
6
+ c&&c.no_id&&(delete j[f].id,j[f].li_attr&&j[f].li_attr.id&&delete j[f].li_attr.id,j[f].a_attr&&j[f].a_attr.id&&delete j[f].a_attr.id);else j.type=j.id&&h[j.id]&&h[j.id].type?h[j.id].type:"default",c&&c.no_id&&(j=this._delete_ids(j));return j},this._delete_ids=function(b){if(a.isArray(b)){for(var c=0,d=b.length;d>c;c++)b[c]=this._delete_ids(b[c]);return b}return delete b.id,b.li_attr&&b.li_attr.id&&delete b.li_attr.id,b.a_attr&&b.a_attr.id&&delete b.a_attr.id,b.children&&a.isArray(b.children)&&(b.children=this._delete_ids(b.children)),b},this.check=function(c,e,f,g,h){if(d.check.call(this,c,e,f,g,h)===!1)return!1;e=e&&e.id?e:this.get_node(e),f=f&&f.id?f:this.get_node(f);var i=e&&e.id?h&&h.origin?h.origin:a.jstree.reference(e.id):null,j,k,l,m;switch(i=i&&i._model&&i._model.data?i._model.data:null,c){case"create_node":case"move_node":case"copy_node":if("move_node"!==c||-1===a.inArray(e.id,f.children)){if(j=this.get_rules(f),j.max_children!==b&&-1!==j.max_children&&j.max_children===f.children.length)return this._data.core.last_error={error:"check",plugin:"types",id:"types_01",reason:"max_children prevents function: "+c,data:JSON.stringify({chk:c,pos:g,obj:e&&e.id?e.id:!1,par:f&&f.id?f.id:!1})},!1;if(j.valid_children!==b&&-1!==j.valid_children&&-1===a.inArray(e.type||"default",j.valid_children))return this._data.core.last_error={error:"check",plugin:"types",id:"types_02",reason:"valid_children prevents function: "+c,data:JSON.stringify({chk:c,pos:g,obj:e&&e.id?e.id:!1,par:f&&f.id?f.id:!1})},!1;if(i&&e.children_d&&e.parents){for(k=0,l=0,m=e.children_d.length;m>l;l++)k=Math.max(k,i[e.children_d[l]].parents.length);k=k-e.parents.length+1}(0>=k||k===b)&&(k=1);do{if(j.max_depth!==b&&-1!==j.max_depth&&j.max_depth<k)return this._data.core.last_error={error:"check",plugin:"types",id:"types_03",reason:"max_depth prevents function: "+c,data:JSON.stringify({chk:c,pos:g,obj:e&&e.id?e.id:!1,par:f&&f.id?f.id:!1})},!1;f=this.get_node(f.parent),j=this.get_rules(f),k++}while(f)}}return!0},this.get_rules=function(a){if(a=this.get_node(a),!a)return!1;var c=this.get_type(a,!0);return c.max_depth===b&&(c.max_depth=-1),c.max_children===b&&(c.max_children=-1),c.valid_children===b&&(c.valid_children=-1),c},this.get_type=function(b,c){return b=this.get_node(b),b?c?a.extend({type:b.type},this.settings.types[b.type]):b.type:!1},this.set_type=function(c,d){var e=this._model.data,f,g,h,i,j,k,l,m;if(a.isArray(c)){for(c=c.slice(),g=0,h=c.length;h>g;g++)this.set_type(c[g],d);return!0}if(f=this.settings.types,c=this.get_node(c),!f[d]||!c)return!1;if(l=this.get_node(c,!0),l&&l.length&&(m=l.children(".jstree-anchor")),i=c.type,j=this.get_icon(c),c.type=d,(j===!0||!f[i]||f[i].icon!==b&&j===f[i].icon)&&this.set_icon(c,f[d].icon!==b?f[d].icon:!0),f[i]&&f[i].li_attr!==b&&"object"==typeof f[i].li_attr)for(k in f[i].li_attr)if(f[i].li_attr.hasOwnProperty(k)){if("id"===k)continue;"class"===k?(e[c.id].li_attr["class"]=(e[c.id].li_attr["class"]||"").replace(f[i].li_attr[k],""),l&&l.removeClass(f[i].li_attr[k])):e[c.id].li_attr[k]===f[i].li_attr[k]&&(e[c.id].li_attr[k]=null,l&&l.removeAttr(k))}if(f[i]&&f[i].a_attr!==b&&"object"==typeof f[i].a_attr)for(k in f[i].a_attr)if(f[i].a_attr.hasOwnProperty(k)){if("id"===k)continue;"class"===k?(e[c.id].a_attr["class"]=(e[c.id].a_attr["class"]||"").replace(f[i].a_attr[k],""),m&&m.removeClass(f[i].a_attr[k])):e[c.id].a_attr[k]===f[i].a_attr[k]&&("href"===k?(e[c.id].a_attr[k]="#",m&&m.attr("href","#")):(delete e[c.id].a_attr[k],m&&m.removeAttr(k)))}if(f[d].li_attr!==b&&"object"==typeof f[d].li_attr)for(k in f[d].li_attr)if(f[d].li_attr.hasOwnProperty(k)){if("id"===k)continue;e[c.id].li_attr[k]===b?(e[c.id].li_attr[k]=f[d].li_attr[k],l&&("class"===k?l.addClass(f[d].li_attr[k]):l.attr(k,f[d].li_attr[k]))):"class"===k&&(e[c.id].li_attr["class"]=f[d].li_attr[k]+" "+e[c.id].li_attr["class"],l&&l.addClass(f[d].li_attr[k]))}if(f[d].a_attr!==b&&"object"==typeof f[d].a_attr)for(k in f[d].a_attr)if(f[d].a_attr.hasOwnProperty(k)){if("id"===k)continue;e[c.id].a_attr[k]===b?(e[c.id].a_attr[k]=f[d].a_attr[k],m&&("class"===k?m.addClass(f[d].a_attr[k]):m.attr(k,f[d].a_attr[k]))):"href"===k&&"#"===e[c.id].a_attr[k]?(e[c.id].a_attr.href=f[d].a_attr.href,m&&m.attr("href",f[d].a_attr.href)):"class"===k&&(e[c.id].a_attr["class"]=f[d].a_attr["class"]+" "+e[c.id].a_attr["class"],m&&m.addClass(f[d].a_attr[k]))}return!0}},a.jstree.defaults.unique={case_sensitive:!1,trim_whitespace:!1,duplicate:function(a,b){return a+" ("+b+")"}},a.jstree.plugins.unique=function(c,d){this.check=function(b,c,e,f,g){if(d.check.call(this,b,c,e,f,g)===!1)return!1;if(c=c&&c.id?c:this.get_node(c),e=e&&e.id?e:this.get_node(e),!e||!e.children)return!0;var h="rename_node"===b?f:c.text,i=[],j=this.settings.unique.case_sensitive,k=this.settings.unique.trim_whitespace,l=this._model.data,m,n,o;for(m=0,n=e.children.length;n>m;m++)o=l[e.children[m]].text,j||(o=o.toLowerCase()),k&&(o=o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")),i.push(o);switch(j||(h=h.toLowerCase()),k&&(h=h.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")),b){case"delete_node":return!0;case"rename_node":return o=c.text||"",j||(o=o.toLowerCase()),k&&(o=o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")),m=-1===a.inArray(h,i)||c.text&&o===h,m||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_01",reason:"Child with name "+h+" already exists. Preventing: "+b,data:JSON.stringify({chk:b,pos:f,obj:c&&c.id?c.id:!1,par:e&&e.id?e.id:!1})}),m;case"create_node":return m=-1===a.inArray(h,i),m||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_04",reason:"Child with name "+h+" already exists. Preventing: "+b,data:JSON.stringify({chk:b,pos:f,obj:c&&c.id?c.id:!1,par:e&&e.id?e.id:!1})}),m;case"copy_node":return m=-1===a.inArray(h,i),m||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_02",reason:"Child with name "+h+" already exists. Preventing: "+b,data:JSON.stringify({chk:b,pos:f,obj:c&&c.id?c.id:!1,par:e&&e.id?e.id:!1})}),m;case"move_node":return m=c.parent===e.id&&(!g||!g.is_multi)||-1===a.inArray(h,i),m||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_03",reason:"Child with name "+h+" already exists. Preventing: "+b,data:JSON.stringify({chk:b,pos:f,obj:c&&c.id?c.id:!1,par:e&&e.id?e.id:!1})}),m}return!0},this.create_node=function(c,e,f,g,h){if(!e||e.text===b){if(null===c&&(c=a.jstree.root),c=this.get_node(c),!c)return d.create_node.call(this,c,e,f,g,h);if(f=f===b?"last":f,!f.toString().match(/^(before|after)$/)&&!h&&!this.is_loaded(c))return d.create_node.call(this,c,e,f,g,h);e||(e={});var i,j,k,l,m,n=this._model.data,o=this.settings.unique.case_sensitive,p=this.settings.unique.trim_whitespace,q=this.settings.unique.duplicate,r;for(j=i=this.get_string("New node"),k=[],l=0,m=c.children.length;m>l;l++)r=n[c.children[l]].text,o||(r=r.toLowerCase()),p&&(r=r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")),k.push(r);l=1,r=j,o||(r=r.toLowerCase()),p&&(r=r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""));while(-1!==a.inArray(r,k))j=q.call(this,i,++l).toString(),r=j,o||(r=r.toLowerCase()),p&&(r=r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""));e.text=j}return d.create_node.call(this,c,e,f,g,h)}};var n=i.createElement("DIV");if(n.setAttribute("unselectable","on"),n.setAttribute("role","presentation"),n.className="jstree-wholerow",n.innerHTML="&#160;",a.jstree.plugins.wholerow=function(b,c){this.bind=function(){c.bind.call(this),this.element.on("ready.jstree set_state.jstree",a.proxy(function(){this.hide_dots()},this)).on("init.jstree loading.jstree ready.jstree",a.proxy(function(){this.get_container_ul().addClass("jstree-wholerow-ul")},this)).on("deselect_all.jstree",a.proxy(function(a,b){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked")},this)).on("changed.jstree",a.proxy(function(a,b){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked");var c=!1,d,e;for(d=0,e=b.selected.length;e>d;d++)c=this.get_node(b.selected[d],!0),c&&c.length&&c.children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("open_node.jstree",a.proxy(function(a,b){this.get_node(b.node,!0).find(".jstree-clicked").parent().children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("hover_node.jstree dehover_node.jstree",a.proxy(function(a,b){"hover_node"===a.type&&this.is_disabled(b.node)||this.get_node(b.node,!0).children(".jstree-wholerow")["hover_node"===a.type?"addClass":"removeClass"]("jstree-wholerow-hovered")},this)).on("contextmenu.jstree",".jstree-wholerow",a.proxy(function(b){if(this._data.contextmenu){b.preventDefault();var c=a.Event("contextmenu",{metaKey:b.metaKey,ctrlKey:b.ctrlKey,altKey:b.altKey,shiftKey:b.shiftKey,pageX:b.pageX,pageY:b.pageY});a(b.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(c)}},this)).on("click.jstree",".jstree-wholerow",function(b){b.stopImmediatePropagation();var c=a.Event("click",{metaKey:b.metaKey,ctrlKey:b.ctrlKey,altKey:b.altKey,shiftKey:b.shiftKey});a(b.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(c).focus()}).on("dblclick.jstree",".jstree-wholerow",function(b){b.stopImmediatePropagation();var c=a.Event("dblclick",{metaKey:b.metaKey,ctrlKey:b.ctrlKey,altKey:b.altKey,shiftKey:b.shiftKey});a(b.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(c).focus()}).on("click.jstree",".jstree-leaf > .jstree-ocl",a.proxy(function(b){b.stopImmediatePropagation();var c=a.Event("click",{metaKey:b.metaKey,ctrlKey:b.ctrlKey,altKey:b.altKey,shiftKey:b.shiftKey});a(b.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(c).focus()},this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",a.proxy(function(a){return a.stopImmediatePropagation(),this.is_disabled(a.currentTarget)||this.hover_node(a.currentTarget),!1},this)).on("mouseleave.jstree",".jstree-node",a.proxy(function(a){this.dehover_node(a.currentTarget)},this))},this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove(),c.teardown.call(this)},this.redraw_node=function(b,d,e,f){if(b=c.redraw_node.apply(this,arguments)){var g=n.cloneNode(!0);-1!==a.inArray(b.id,this._data.core.selected)&&(g.className+=" jstree-wholerow-clicked"),this._data.core.focused&&this._data.core.focused===b.id&&(g.className+=" jstree-wholerow-hovered"),b.insertBefore(g,b.childNodes[0])}return b}},window.customElements&&Object&&Object.create){var o=Object.create(HTMLElement.prototype);o.createdCallback=function(){var b={core:{},plugins:[]},c;for(c in a.jstree.plugins)a.jstree.plugins.hasOwnProperty(c)&&this.attributes[c]&&(b.plugins.push(c),this.getAttribute(c)&&JSON.parse(this.getAttribute(c))&&(b[c]=JSON.parse(this.getAttribute(c))));for(c in a.jstree.defaults.core)a.jstree.defaults.core.hasOwnProperty(c)&&this.attributes[c]&&(b.core[c]=JSON.parse(this.getAttribute(c))||this.getAttribute(c));a(this).jstree(b)};try{window.customElements.define("vakata-jstree",function(){},{prototype:o})}catch(p){}}}});
includes/updraft-admin-common.js CHANGED
@@ -1441,6 +1441,7 @@ function updraft_downloader(base, backup_timestamp, what, whicharea, set_content
1441
  * @returns Mixed parsed JSON object. Will only return if parsing is successful (otherwise, will throw)
1442
  */
1443
  function ud_parse_json(json_mix_str) {
 
1444
  // Here taking first and last char in variable, because these are used more than once in this function
1445
  var first_char = json_mix_str.charAt(0);
1446
  var last_char = json_mix_str.charAt(json_mix_str.length - 1);
@@ -1450,7 +1451,7 @@ function ud_parse_json(json_mix_str) {
1450
  var result = JSON.parse(json_mix_str);
1451
  return result;
1452
  } catch (e) {
1453
- console.log("UpdraftPlus: Exception when trying to parse JSON (1) - will attempt to fix/re-parse");
1454
  console.log(json_mix_str);
1455
  }
1456
 
@@ -1462,12 +1463,43 @@ function ud_parse_json(json_mix_str) {
1462
  var json_str = json_mix_str.slice(json_start_pos, json_last_pos + 1);
1463
  try {
1464
  var parsed = JSON.parse(json_str);
1465
- console.log("UpdraftPlus: JSON re-parse successful");
1466
  return parsed;
1467
  } catch (e) {
1468
- console.log("UpdraftPlus: Exception when trying to parse JSON (2)");
1469
- // Throw it again, so that our function works just like JSON.parse() in its behaviour.
1470
- throw e;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1471
  }
1472
  }
1473
 
1441
  * @returns Mixed parsed JSON object. Will only return if parsing is successful (otherwise, will throw)
1442
  */
1443
  function ud_parse_json(json_mix_str) {
1444
+
1445
  // Here taking first and last char in variable, because these are used more than once in this function
1446
  var first_char = json_mix_str.charAt(0);
1447
  var last_char = json_mix_str.charAt(json_mix_str.length - 1);
1451
  var result = JSON.parse(json_mix_str);
1452
  return result;
1453
  } catch (e) {
1454
+ console.log('UpdraftPlus: Exception when trying to parse JSON (1) - will attempt to fix/re-parse based upon first/last curly brackets');
1455
  console.log(json_mix_str);
1456
  }
1457
 
1463
  var json_str = json_mix_str.slice(json_start_pos, json_last_pos + 1);
1464
  try {
1465
  var parsed = JSON.parse(json_str);
1466
+ console.log('UpdraftPlus: JSON re-parse successful');
1467
  return parsed;
1468
  } catch (e) {
1469
+ console.log('UpdraftPlus: Exception when trying to parse JSON (2) - will attempt to fix/re-parse based upon bracket counting');
1470
+
1471
+ var cursor = json_start_pos;
1472
+ var open_count = 0;
1473
+ var last_character = '';
1474
+ var inside_string = false;
1475
+
1476
+ // Don't mistake this for a real JSON parser. Its aim is to improve the odds in real-world cases seen, not to arrive at universal perfection.
1477
+ while ((open_count > 0 || cursor == json_start_pos) && cursor <= json_last_pos) {
1478
+
1479
+ var current_character = json_mix_str.charAt(cursor);
1480
+
1481
+ if (!inside_string && '{' == current_character) {
1482
+ open_count++;
1483
+ } else if (!inside_string && '}' == current_character) {
1484
+ open_count--;
1485
+ } else if ('"' == current_character && '\\' != last_character) {
1486
+ inside_string = inside_string ? false : true;
1487
+ }
1488
+
1489
+ last_character = current_character;
1490
+ cursor++;
1491
+ }
1492
+ console.log("Started at cursor="+json_start_pos+", ended at cursor="+cursor+" with result following:");
1493
+ console.log(json_mix_str.substring(json_start_pos, cursor));
1494
+
1495
+ try {
1496
+ var parsed = JSON.parse(json_mix_str.substring(json_start_pos, cursor));
1497
+ console.log('UpdraftPlus: JSON re-parse successful');
1498
+ return parsed;
1499
+ } catch (e) {
1500
+ // Throw it again, so that our function works just like JSON.parse() in its behaviour.
1501
+ throw e;
1502
+ }
1503
  }
1504
  }
1505
 
includes/updraft-admin-common.min.js CHANGED
@@ -1,4 +1,4 @@
1
- function updraft_send_command(t,e,a,r){default_options={json_parse:!0,alert_on_error:!0,action:"updraft_ajax",nonce:updraft_credentialtest_nonce,nonce_key:"nonce",timeout:null,async:!0,type:"POST"},"undefined"==typeof r&&(r={});for(var n in default_options)r.hasOwnProperty(n)||(r[n]=default_options[n]);var o={action:r.action,subaction:t};if(o[r.nonce_key]=r.nonce,"object"==typeof e)for(var d in e)o[d]=e[d];else o.action_data=e;var u={type:r.type,url:ajaxurl,data:o,success:function(t,e){if(r.json_parse){try{var n=ud_parse_json(t)}catch(o){return"function"==typeof r.error_callback?r.error_callback(t,o,502,n):(console.log(o),console.log(t),void(r.alert_on_error&&alert(updraftlion.unexpectedresponse+" "+t)))}if(n.hasOwnProperty("fatal_error"))return"function"==typeof r.error_callback?r.error_callback(t,e,500,n):(console.error(n.fatal_error_message),r.alert_on_error&&alert(n.fatal_error_message),!1);"function"==typeof a&&a(n,e,t)}else"function"==typeof a&&a(t,e)},error:function(t,e,a){"function"==typeof r.error_callback?r.error_callback(t,e,a):(console.log("updraft_send_command: error: "+e+" ("+a+")"),console.log(t))},dataType:"text",async:r.async};null!=r.timeout&&(u.timeout=r.timeout),jQuery.ajax(u)}function updraft_delete(t,e,a){jQuery("#updraft_delete_timestamp").val(t),jQuery("#updraft_delete_nonce").val(e),a?jQuery("#updraft-delete-remote-section, #updraft_delete_remote").removeAttr("disabled").show():jQuery("#updraft-delete-remote-section, #updraft_delete_remote").hide().attr("disabled","disabled"),t.indexOf(",")>-1?(jQuery("#updraft_delete_question_singular").hide(),jQuery("#updraft_delete_question_plural").show()):(jQuery("#updraft_delete_question_plural").hide(),jQuery("#updraft_delete_question_singular").show()),jQuery("#updraft-delete-modal").dialog("open")}function updraft_remote_storage_tab_activation(t){jQuery(".updraftplusmethod").hide(),jQuery(".remote-tab").data("active",!1),jQuery(".remote-tab").removeClass("nav-tab-active"),jQuery(".updraftplusmethod."+t).show(),jQuery(".remote-tab-"+t).data("active",!0),jQuery(".remote-tab-"+t).addClass("nav-tab-active")}function updraft_check_overduecrons(){updraft_send_command("check_overdue_crons",null,function(t){t&&t.hasOwnProperty("m")&&jQuery("#updraft-insert-admin-warning").html(t.m)},{alert_on_error:!1})}function updraft_remote_storage_tabs_setup(){var t=0,e=jQuery(".updraft_servicecheckbox:checked");jQuery(e).each(function(a,r){var n=jQuery(r).val();"updraft_servicecheckbox_none"!=jQuery(r).attr("id")&&t++,jQuery(".remote-tab-"+n).show(),a==jQuery(e).length-1&&updraft_remote_storage_tab_activation(n)}),t>0?(jQuery(".updraftplusmethod.none").hide(),jQuery("#remote_storage_tabs").show()):jQuery("#remote_storage_tabs").hide(),jQuery(document).keyup(function(t){if((32===t.keyCode||13===t.keyCode)&&jQuery(document.activeElement).is("input.labelauty + label")){var e=jQuery(document.activeElement).attr("for");e&&jQuery("#"+e).change()}}),jQuery(".updraft_servicecheckbox").change(function(){var e=jQuery(this).attr("id");if("updraft_servicecheckbox_"==e.substring(0,24)){var a=e.substring(24);null!=a&&""!=a&&(jQuery(this).is(":checked")?(t++,jQuery(".remote-tab-"+a).fadeIn(),updraft_remote_storage_tab_activation(a)):(t--,jQuery(".remote-tab-"+a).hide(),1==jQuery(".remote-tab-"+a).data("active")&&updraft_remote_storage_tab_activation(jQuery(".remote-tab:visible").last().attr("name"))))}t<=0?(jQuery(".updraftplusmethod.none").fadeIn(),jQuery("#remote_storage_tabs").hide()):(jQuery(".updraftplusmethod.none").hide(),jQuery("#remote_storage_tabs").show())}),jQuery(".updraft_servicecheckbox:not(.multi)").change(function(){var t=jQuery(this).attr("value");jQuery(this).is(":not(:checked)")?(jQuery(".updraftplusmethod."+t).hide(),jQuery(".updraftplusmethod.none").fadeIn()):jQuery(".updraft_servicecheckbox").not(this).prop("checked",!1)});var a=jQuery(".updraft_servicecheckbox");"function"==typeof a.labelauty&&a.labelauty()}function updraft_remote_storage_test(t,e,a){var r,n;a?(r=jQuery("#updraft-"+t+"-test-"+a),n=".updraftplusmethod."+t+"-"+a):(r=jQuery("#updraft-"+t+"-test"),n=".updraftplusmethod."+t);var o=r.data("method_label");r.html(updraftlion.testing_settings.replace("%s",o));var d={method:t};jQuery("#updraft-navtab-settings-content "+n+" input[data-updraft_settings_test], #updraft-navtab-settings-content .expertmode input[data-updraft_settings_test]").each(function(t,e){var a=jQuery(e).data("updraft_settings_test"),r=jQuery(e).attr("type");if(a){r||(console.log("UpdraftPlus: settings test input item with no type found"),console.log(e),r="text");var n=null;"checkbox"==r?n=jQuery(e).is(":checked")?1:0:"text"==r||"password"==r?n=jQuery(e).val():(console.log("UpdraftPlus: settings test input item with unrecognised type ("+r+") found"),console.log(e)),d[a]=n}}),jQuery("#updraft-navtab-settings-content "+n+" textarea[data-updraft_settings_test], #updraft-navtab-settings-content "+n+" select[data-updraft_settings_test]").each(function(t,e){var a=jQuery(e).data("updraft_settings_test");d[a]=jQuery(e).val()}),updraft_send_command("test_storage_settings",d,function(t,a){r.html(updraftlion.test_settings.replace("%s",o)),"undefined"!=typeof e&&0!=e&&(e=e.call(this,t,a,d)),"undefined"!=typeof e&&!1===e&&(alert(updraftlion.settings_test_result.replace("%s",o)+" "+t.output),t.hasOwnProperty("data")&&console.log(t.data))},{error_callback:function(t,e,a,n){if(r.html(updraftlion.test_settings.replace("%s",o)),"undefined"!=typeof n&&n.hasOwnProperty("fatal_error"))console.error(n.fatal_error_message),alert(n.fatal_error_message);else{var d="updraft_send_command: error: "+e+" ("+a+")";console.log(d),alert(d),console.log(t)}}})}function backupnow_whichfiles_checked(t){return jQuery('#backupnow_includefiles_moreoptions input[type="checkbox"]').each(function(e){if(jQuery(this).is(":checked")){var a=jQuery(this).attr("name");if("updraft_include_"==a.substring(0,16)){var r=a.substring(16);""!=t&&(t+=","),t+=r}}}),t}function backupnow_whichtables_checked(t){var e=!1;return jQuery('#backupnow_database_moreoptions input[type="checkbox"]').each(function(t){if(!jQuery(this).is(":checked"))return void(e=!0)}),t=jQuery("input[name^='updraft_include_tables_']").serializeArray(),!e||t}function updraft_deleteallselected(){var t=0,e="",a="",r=0;jQuery("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row.backuprowselected").each(function(n){t++;var o=jQuery(this).data("nonce");a&&(a+=","),a+=o;var d=jQuery(this).data("key");e&&(e+=","),e+=d;var u=jQuery(this).find(".updraftplus-remove").data("hasremote");u&&r++}),updraft_delete(e,a,r)}function updraft_open_main_tab(t){updraftlion.main_tabs_keys.forEach(function(e){t==e?(jQuery("#updraft-navtab-"+e+"-content").show(),jQuery("#updraft-navtab-"+e).addClass("nav-tab-active")):(jQuery("#updraft-navtab-"+e+"-content").hide(),jQuery("#updraft-navtab-"+e).removeClass("nav-tab-active")),updraft_console_focussed_tab=t})}function updraft_openrestorepanel(t){updraft_historytimertoggle(t),updraft_open_main_tab("backups")}function updraft_delete_old_dirs(){return!0}function updraft_initiate_restore(t){jQuery('#updraft-navtab-backups-content .updraft_existing_backups button[data-backup_timestamp="'+t+'"]').click()}function updraft_restore_setoptions(t){var e=0;jQuery('input[name="updraft_restore[]"]').each(function(a,r){var n=jQuery(r).val(),o=n+"=([0-9,]+)",d=new RegExp(o),u=t.match(d);u?(jQuery(r).removeAttr("disabled").data("howmany",u[1]).parent().show(),e++,"db"==n&&(e+=4.5),jQuery(r).is(":checked")&&jQuery("#updraft_restorer_"+n+"options").show()):jQuery(r).attr("disabled","disabled").parent().hide()});var a=t.match(/dbcrypted=1/);a?(jQuery("#updraft_restore_db").data("encrypted",1),jQuery(".updraft_restore_crypteddb").show()):(jQuery("#updraft_restore_db").data("encrypted",0),jQuery(".updraft_restore_crypteddb").hide()),jQuery("#updraft_restore_db").trigger("change");var r=t.match(/meta_foreign=([12])/);r?jQuery("#updraft_restore_meta_foreign").val(r[1]):jQuery("#updraft_restore_meta_foreign").val("0");var n=336+20*e;jQuery("#updraft-restore-modal").dialog("option","height",n)}function updraft_backup_dialog_open(t){t="undefined"==typeof t?"new":t,0==jQuery("#updraftplus_incremental_backup_link").data("incremental")&&"incremental"==t?(jQuery("#updraft-backupnow-modal .incremental-free-only").show(),t="new"):jQuery("#updraft-backupnow-modal .incremental-backups-only").hide(),jQuery("#backupnow_includefiles_moreoptions").hide(),updraft_settings_form_changed&&!window.confirm(updraftlion.unsavedsettingsbackup)||(jQuery("#backupnow_label").val(""),"incremental"==t?(update_file_entities_checkboxes(!0,impossible_increment_entities),jQuery("#backupnow_includedb").prop("checked",!1),jQuery("#backupnow_includefiles").prop("checked",!0),jQuery("#backupnow_includefiles_label").text(updraftlion.files_incremental_backup),jQuery("#updraft-backupnow-modal .new-backups-only").hide(),jQuery("#updraft-backupnow-modal .incremental-backups-only").show()):(update_file_entities_checkboxes(!1,impossible_increment_entities),jQuery("#backupnow_includedb").prop("checked",!0),jQuery("#backupnow_includefiles_label").text(updraftlion.files_new_backup),jQuery("#updraft-backupnow-modal .new-backups-only").show(),jQuery("#updraft-backupnow-modal .incremental-backups-only").hide()),jQuery("#updraft-backupnow-modal").data("backup-type",t),jQuery("#updraft-backupnow-modal").dialog("open"))}function update_file_entities_checkboxes(t,e){t?jQuery(e).each(function(t,e){jQuery("#backupnow_files_updraft_include_"+e).prop("checked",!1),jQuery("#backupnow_files_updraft_include_"+e).prop("disabled",!0)}):jQuery('#backupnow_includefiles_moreoptions input[type="checkbox"]').each(function(t){var e=jQuery(this).attr("name");if("updraft_include_"==e.substring(0,16)){var a=e.substring(16);jQuery("#backupnow_files_updraft_include_"+a).prop("disabled",!1),jQuery(this).is(":checked")&&jQuery("#backupnow_files_updraft_include_"+a).prop("checked",!0)}})}function updraft_check_page_visibility(t){"hidden"==document.visibilityState?updraft_page_is_visible=0:(updraft_page_is_visible=1,1!==t&&jQuery("#updraft-navtab-backups-content").length&&updraft_activejobs_update(!0))}function setup_migrate_tabs(){jQuery("#updraft_migrate .updraft_migrate_widget_module_content").each(function(t,e){var a=jQuery(e).find("h3").first().html(),r=jQuery(".updraft_migrate_intro"),n=jQuery('<button class="button button-primary button-hero" />').html(a).appendTo(r);n.on("click",function(t){t.preventDefault(),jQuery(e).show(),r.hide()})})}function updraft_backupnow_inpage_go(t,e,a,r,n,o,d){r="undefined"==typeof r?0:r,n="undefined"==typeof n?0:n,o="undefined"==typeof o?0:o,d="undefined"==typeof d?updraftlion.automaticbackupbeforeupdate:d,updraft_console_focussed_tab="backups",updraft_inpage_success_callback=t,updraft_activejobs_update_timer=setInterval(function(){updraft_activejobs_update(!1)},1250);var u={},s=jQuery("#updraft-backupnow-inpage-modal").length;s&&jQuery("#updraft-backupnow-inpage-modal").dialog("option","buttons",u),jQuery("#updraft_inpage_prebackup").hide(),s&&jQuery("#updraft-backupnow-inpage-modal").dialog("open"),jQuery("#updraft_inpage_backup").show(),updraft_activejobslist_backupnownonce_only=1,updraft_inpage_hasbegun=0,updraft_backupnow_go(r,n,o,e,a,d,"")}function updraft_get_downloaders(){var t="";return jQuery(".ud_downloadstatus .updraftplus_downloader, #ud_downloadstatus2 .updraftplus_downloader").each(function(e,a){var r=jQuery(a).data("downloaderfor");"object"==typeof r&&(""!=t&&(t+=":"),t=t+r.base+","+r.nonce+","+r.what+","+r.index)}),t}function updraft_poll_get_parameters(){var t={downloaders:updraft_get_downloaders()};try{jQuery("#updraft-poplog").dialog("isOpen")&&(t.log_fetch=1,t.log_nonce=updraft_poplog_log_nonce,t.log_pointer=updraft_poplog_log_pointer)}catch(e){console.log(e)}return updraft_activejobslist_backupnownonce_only&&"undefined"!=typeof updraft_backupnow_nonce&&""!=updraft_backupnow_nonce&&(t.thisjobonly=updraft_backupnow_nonce),t}function updraft_activejobs_update(t){var e=(jQuery,(new Date).getTime());if(!(0==t&&e<updraft_activejobs_nextupdate)){updraft_activejobs_nextupdate=e+5500;var a=updraft_poll_get_parameters();updraft_send_command("activejobs_list",a,function(t,e,r){updraft_process_status_check(t,r,a)},{type:"GET",error_callback:function(t,e,a,r){if("undefined"!=typeof r&&r.hasOwnProperty("fatal_error"))console.error(r.fatal_error_message),!0===updraftplus_activejobs_list_fatal_error_alert&&(updraftplus_activejobs_list_fatal_error_alert=!1,alert(this.alert_done+" "+r.fatal_error_message));else{var n=e==a?a:a+" ("+e+")";console.error(n),console.log(t)}return!1}})}}function updraft_show_success_modal(t){"string"==typeof t&&(t={message:t});var e=jQuery.extend({icon:"yes",close:updraftlion.close,message:"",classes:"success"},t);jQuery.blockUI({css:{width:"300px",border:"none","border-radius":"10px",left:"calc(50% - 150px)"},message:'<div class="updraft_success_popup '+e.classes+'"><span class="dashicons dashicons-'+e.icon+'"></span><div class="updraft_success_popup--message">'+e.message+'</div><button class="button updraft-close-overlay"><span class="dashicons dashicons-no-alt"></span>'+e.close+"</button></div>"}),setTimeout(jQuery.unblockUI,5e3),jQuery(".blockUI .updraft-close-overlay").on("click",function(){jQuery.unblockUI()})}function updraft_popuplog(t){var e=updraftlion.loading_log_file;t&&(e+=" (log."+t+".txt)"),jQuery("#updraft-poplog").dialog("option","title",e),jQuery("#updraft-poplog-content").html("<em>"+e+" ...</em> "),jQuery("#updraft-poplog").dialog("open"),updraft_send_command("get_log",t,function(t){updraft_poplog_log_pointer=t.pointer,updraft_poplog_log_nonce=t.nonce;var e="?page=updraftplus&action=downloadlog&force_download=1&updraftplus_backup_nonce="+t.nonce;jQuery("#updraft-poplog-content").html(t.log);var a={};a[updraftlion.downloadlogfile]=function(){window.location.href=e},a[updraftlion.close]=function(){jQuery(this).dialog("close")},jQuery("#updraft-poplog").dialog("option","buttons",a),jQuery("#updraft-poplog").dialog("option","title","log."+t.nonce+".txt"),updraft_poplog_lastscroll=-1},{type:"GET",timeout:6e4,error_callback:function(t,e,a,r){if("undefined"!=typeof r&&r.hasOwnProperty("fatal_error"))console.error(r.fatal_error_message),jQuery("#updraft-poplog-content").append(r.fatal_error_message);else{var n=e==a?a:a+" ("+e+")";jQuery("#updraft-poplog-content").append(n),console.log(t)}}})}function updraft_showlastbackup(){updraft_send_command("get_fragment","last_backup_html",function(t){response=t.output,lastbackup_laststatus==response?setTimeout(function(){updraft_showlastbackup()},7e3):jQuery("#updraft_last_backup").html(response),lastbackup_laststatus=response},{type:"GET"})}function updraft_historytimertoggle(t){updraft_historytimer&&1!=t?(clearTimeout(updraft_historytimer),updraft_historytimer=0):(updraft_updatehistory(0,0),updraft_historytimer=setInterval(function(){updraft_updatehistory(0,0)},3e4),calculated_diskspace||(updraftplus_diskspace(),calculated_diskspace=1))}function updraft_updatehistory(t,e,a){"undefined"==typeof a&&(a=jQuery("#updraft_debug_mode").is(":checked")?1:0);var r=Math.round((new Date).getTime()/1e3);if(1==t||1==e)updraft_historytimer_notbefore=r+30;else if(r<updraft_historytimer_notbefore)return void console.log("Update history skipped: "+r.toString()+" < "+updraft_historytimer_notbefore.toString());1==t&&(1==e?(updraft_history_lastchecksum=!1,jQuery("#updraft-navtab-backups-content .updraft_existing_backups").html('<p style="text-align:center;"><em>'+updraftlion.rescanningremote+"</em></p>")):(updraft_history_lastchecksum=!1,jQuery("#updraft-navtab-backups-content .updraft_existing_backups").html('<p style="text-align:center;"><em>'+updraftlion.rescanning+"</em></p>")));var n=e?"remotescan":!!t&&"rescan",o={operation:n,debug:a};updraft_send_command("rescan",o,function(t){if(t.hasOwnProperty("logs_exist")&&t.logs_exist&&jQuery("#updraft_lastlogmessagerow .updraft-log-link").show(),t.hasOwnProperty("migrate_tab")&&t.migrate_tab&&(jQuery("#updraft-navtab-migrate").hasClass("nav-tab-active")||(jQuery("#updraft_migrate_tab_alt").html(""),jQuery("#updraft_migrate").replaceWith(jQuery(t.migrate_tab).find("#updraft_migrate")),setup_migrate_tabs())),t.hasOwnProperty("web_server_disk_space")&&(""==t.web_server_disk_space?(console.log("UpdraftPlus: web_server_disk_space is empty"),jQuery("#updraft-navtab-backups-content .updraft-server-disk-space").length&&jQuery("#updraft-navtab-backups-content .updraft-server-disk-space").slideUp("slow",function(){jQuery(this).remove()})):jQuery("#updraft-navtab-backups-content .updraft-server-disk-space").length?jQuery("#updraft-navtab-backups-content .updraft-server-disk-space").replaceWith(t.web_server_disk_space):jQuery("#updraft-navtab-backups-content .updraft-disk-space-actions").prepend(t.web_server_disk_space)),update_backupnow_modal(t),t.hasOwnProperty("backupnow_file_entities")&&(impossible_increment_entities=t.backupnow_file_entities),null!=t.n&&jQuery("#updraft-existing-backups-heading").html(t.n),null!=t.t){if(null!=t.cksum){if(t.cksum==updraft_history_lastchecksum)return;updraft_history_lastchecksum=t.cksum}jQuery("#updraft-navtab-backups-content .updraft_existing_backups").html(t.t),updraft_backups_selection.checkSelectionStatus(),t.data&&console.log(t.data)}})}function update_backupnow_modal(t){t.hasOwnProperty("modal_afterfileoptions")&&jQuery(".backupnow_modal_afterfileoptions").html(t.modal_afterfileoptions)}function updraft_exclude_entity_update(t){var e=[];jQuery("#updraft_include_"+t+"_exclude_container .updraft_exclude_entity_wrapper .updraft_exclude_entity_field").each(function(){var t=jQuery.trim(jQuery(this).data("val"));""!=t&&e.push(t)}),jQuery("#updraft_include_"+t+"_exclude").val(e.join(","))}function updraft_is_unique_exclude_rule(t,e){return existing_exclude_rules_str=jQuery("#updraft_include_"+e+"_exclude").val(),existing_exclude_rules=existing_exclude_rules_str.split(","),!(jQuery.inArray(t,existing_exclude_rules)>-1)||(alert(updraftlion.duplicate_exclude_rule_error_msg),!1)}function updraft_intervals_monthly_or_not(t,e){var a="#updraft-navtab-settings-content #"+t,r=jQuery(a+" option").length,n="monthly"==e,o=!1;if(r>10&&(o=!0),n||o){if(n&&o)return void("monthly"==e&&(jQuery(".updraft_monthly_extra_words_"+t).remove(),jQuery(a).before('<span class="updraft_monthly_extra_words_'+t+'">'+updraftlion.day+" </span>").after('<span class="updraft_monthly_extra_words_'+t+'"> '+updraftlion.inthemonth+" </span>")));if(jQuery(".updraft_monthly_extra_words_"+t).remove(),n){updraft_interval_week_val=jQuery(a+" option:selected").val(),jQuery(a).html(updraftlion.mdayselector).before('<span class="updraft_monthly_extra_words_'+t+'">'+updraftlion.day+" </span>").after('<span class="updraft_monthly_extra_words_'+t+'"> '+updraftlion.inthemonth+" </span>");var d=updraft_interval_month_val===!1?1:updraft_interval_month_val;d-=1,jQuery(a+" option:eq("+d+")").prop("selected",!0)}else{updraft_interval_month_val=jQuery(a+" option:selected").val(),jQuery(a).html(updraftlion.dayselector);var u=updraft_interval_week_val===!1?1:updraft_interval_week_val;jQuery(a+" option:eq("+u+")").prop("selected",!0)}}}function updraft_check_same_times(){var t=0,e=jQuery("#updraft-navtab-settings-content .updraft_interval").val();"manual"==e?jQuery("#updraft-navtab-settings-content .updraft_files_timings").hide():jQuery("#updraft-navtab-settings-content .updraft_files_timings").show(),"weekly"==e||"fortnightly"==e||"monthly"==e?(updraft_intervals_monthly_or_not("updraft_startday_files",e),jQuery("#updraft-navtab-settings-content #updraft_startday_files").show()):(jQuery(".updraft_monthly_extra_words_updraft_startday_files").remove(),jQuery("#updraft-navtab-settings-content #updraft_startday_files").hide());var a=jQuery("#updraft-navtab-settings-content .updraft_interval_database").val();"manual"==a&&(t=1,jQuery("#updraft-navtab-settings-content .updraft_db_timings").hide()),"weekly"==a||"fortnightly"==a||"monthly"==a?(updraft_intervals_monthly_or_not("updraft_startday_db",a),jQuery("#updraft-navtab-settings-content #updraft_startday_db").show()):(jQuery(".updraft_monthly_extra_words_updraft_startday_db").remove(),jQuery("#updraft-navtab-settings-content #updraft_startday_db").hide()),a==e?(jQuery("#updraft-navtab-settings-content .updraft_db_timings").hide(),0==t?jQuery("#updraft-navtab-settings-content .updraft_same_schedules_message").show():jQuery("#updraft-navtab-settings-content .updraft_same_schedules_message").hide()):(jQuery("#updraft-navtab-settings-content .updraft_same_schedules_message").hide(),0==t&&jQuery("#updraft-navtab-settings-content .updraft_db_timings").show())}function updraft_activejobs_delete(t){updraft_aborted_jobs[t]=1,jQuery("#updraft-jobid-"+t).closest(".updraft_row").addClass("deleting"),updraft_send_command("activejobs_delete",t,function(e){var a=jQuery("#updraft-jobid-"+t).closest(".updraft_row");a.addClass("deleting"),"Y"==e.ok?(jQuery("#updraft-jobid-"+t).html(e.m),a.remove(),jQuery("#updraft-backupnow-inpage-modal").dialog("isOpen")&&jQuery("#updraft-backupnow-inpage-modal").dialog("close"),updraft_show_success_modal({message:updraft_active_job_is_clone(t)?updraftlion.clone_backup_aborted:updraftlion.backup_aborted,icon:"no-alt",classes:"warning"})):"N"==e.ok?(a.removeClass("deleting"),alert(e.m)):(a.removeClass("deleting"),alert(updraftlion.unexpectedresponse),console.log(e))})}function updraftplus_diskspace_entity(t){jQuery("#updraft_diskspaceused_"+t).html("<em>"+updraftlion.calculating+"</em>"),updraft_send_command("get_fragment",{fragment:"disk_usage",data:t},function(e){jQuery("#updraft_diskspaceused_"+t).html(e.output)},{type:"GET"})}function updraft_active_job_is_clone(t){return updraft_clone_jobs.filter(function(e){return e==t}).length}function updraft_iframe_modal(t,e){var a=780,r=500;jQuery("#updraft-iframe-modal-innards").html('<iframe width="100%" height="430px" src="'+ajaxurl+"?action=updraft_ajax&subaction="+t+"&nonce="+updraft_credentialtest_nonce+'"></iframe>'),jQuery("#updraft-iframe-modal").dialog("option","title",e).dialog("option","width",a).dialog("option","height",r).dialog("open")}function updraft_html_modal(t,e,a,r){jQuery("#updraft-iframe-modal-innards").html(t);var n={};a<450&&(n[updraftlion.close]=function(){jQuery(this).dialog("close")}),jQuery("#updraft-iframe-modal").dialog("option","title",e).dialog("option","width",a).dialog("option","height",r).dialog("option","buttons",n).dialog("open")}function updraftplus_diskspace(){jQuery("#updraft-navtab-backups-content .updraft_diskspaceused").html("<em>"+updraftlion.calculating+"</em>"),updraft_send_command("get_fragment",{fragment:"disk_usage",data:"updraft"},function(t){jQuery("#updraft-navtab-backups-content .updraft_diskspaceused").html(t.output)},{type:"GET"})}function updraftplus_deletefromserver(t,e,a){a||(a=0);var r={stage:"delete",timestamp:t,type:e,findex:a};updraft_send_command("updraft_download_backup",r,null,{action:"updraft_download_backup",nonce:updraft_download_nonce,nonce_key:"_wpnonce"})}function updraftplus_downloadstage2(t,e,a){location.href=ajaxurl+"?_wpnonce="+updraft_download_nonce+"&timestamp="+t+"&type="+e+"&stage=2&findex="+a+"&action=updraft_download_backup"}function updraftplus_show_contents(t,e,a){var r='<div id="updraft_zip_files_container" class="hidden-in-updraftcentral" style="clear:left;"><div id="updraft_zip_info_container" class="updraft_jstree_info_container"><p><span id="updraft_zip_path_text">'+updraftlion.zip_file_contents_info+'</span> - <span id="updraft_zip_size_text"></span></p>'+updraftlion.browse_download_link+'</div><div id="updraft_zip_files_jstree_container"><input type="search" id="zip_files_jstree_search" name="zip_files_jstree_search" placeholder="'+updraftlion.search+'"><div id="updraft_zip_files_jstree" class="updraft_jstree"></div></div></div>';updraft_html_modal(r,updraftlion.zip_file_contents,780,500),zip_files_jstree("zipbrowser",t,e,a)}function zip_files_jstree(t,e,a,r){jQuery("#updraft_zip_files_jstree").jstree({core:{multiple:!1,data:function(n,o){updraft_send_command("get_jstree_directory_nodes",{entity:t,node:n,timestamp:e,type:a,findex:r},function(t){t.hasOwnProperty("error")?alert(t.error):o.call(this,t.nodes)},{error_callback:function(t,e,a,r){if("undefined"!=typeof r&&r.hasOwnProperty("fatal_error"))console.error(r.fatal_error_message),jQuery("#updraft_zip_files_jstree").html('<p style="color:red; margin: 5px;">'+r.fatal_error_message+"</p>"),alert(r.fatal_error_message);else{var n="updraft_send_command: error: "+e+" ("+a+")";jQuery("#updraft_zip_files_jstree").html('<p style="color:red; margin: 5px;">'+n+"</p>"),console.log(n),alert(n),console.log(t)}}})},error:function(t){alert(t),console.log(t)}},search:{show_only_matches:!0},plugins:["search","sort"]}),jQuery("#updraft_zip_files_jstree").on("ready.jstree",function(t,e){jQuery("#updraft-iframe-modal").dialog("option","title",updraftlion.zip_file_contents+": "+e.instance.get_node("#").children[0])});var n=!1;jQuery("#zip_files_jstree_search").keyup(function(){n&&clearTimeout(n),n=setTimeout(function(){var t=jQuery("#zip_files_jstree_search").val();jQuery("#updraft_zip_files_jstree").jstree(!0).search(t)},250)}),jQuery("#updraft_zip_files_jstree").on("changed.jstree",function(t,e){jQuery("#updraft_zip_path_text").text(e.node.li_attr.path),e.node.li_attr.size?(jQuery("#updraft_zip_size_text").text(e.node.li_attr.size),jQuery("#updraft_zip_download_item").show()):(jQuery("#updraft_zip_size_text").text(""),jQuery("#updraft_zip_download_item").hide())}),jQuery("#updraft_zip_download_item").click(function(t){t.preventDefault();var n=jQuery("#updraft_zip_path_text").text();updraft_send_command("get_zipfile_download",{path:n,timestamp:e,type:a,findex:r},function(t){t.hasOwnProperty("error")?alert(t.error):t.hasOwnProperty("path")?location.href=ajaxurl+"?_wpnonce="+updraft_download_nonce+"&timestamp="+e+"&type="+a+"&stage=2&findex="+r+"&filepath="+t.path+"&action=updraft_download_backup":alert(updraftlion.download_timeout)},{error_callback:function(t,e,a,r){if("undefined"!=typeof r&&r.hasOwnProperty("fatal_error"))console.error(r.fatal_error_message),alert(r.fatal_error_message);else{var n="updraft_send_command: error: "+e+" ("+a+")";console.log(n),alert(n),console.log(t)}}})})}function remove_updraft_downloader(t,e){jQuery(t).closest(".updraftplus_downloader").fadeOut().remove(),0==jQuery(".updraftplus_downloader_container_"+e+" .updraftplus_downloader").length&&jQuery(".updraftplus_downloader_container_"+e).remove()}function updraft_downloader(t,e,a,r,n,o,d){"string"!=typeof n&&(n=n.toString()),jQuery(".ud_downloadstatus").show();var n=n.split(","),u=o?o:e,s=jQuery("#updraft-navtab-backups-content .uddownloadform_"+a+"_"+e+"_"+n[0]).data("wp_nonce").toString();jQuery(".updraftplus_downloader_container_"+a).length||(jQuery(r).append('<div class="updraftplus_downloader_container_'+a+' postbox"></div>'),jQuery(".updraftplus_downloader_container_"+a).append('<strong style="clear:left; padding: 8px; margin-top: 4px;">'+updraftlion.download+" "+a+" ("+u+"):</strong>"));for(var i=0;i<n.length;i++){var l=t+e+"_"+a+"_"+n[i],p="."+l,_=parseInt(n[i]);_++;var c=0==n[i]?"":" ("+_+")";jQuery(p).length||(jQuery(".updraftplus_downloader_container_"+a).append('<div style="clear:left; padding: 8px; margin-top: 4px;" class="'+l+' updraftplus_downloader"><button onclick="remove_updraft_downloader(this, \''+a+'\');" type="button" style="float:right; margin-bottom: 8px;" class="ud_downloadstatus__close" aria-label="Close"><span class="dashicons dashicons-no-alt"></span></button><strong>'+a+c+'</strong>:<div class="raw">'+updraftlion.begunlooking+'</div><div class="file '+l+'_st"><div class="dlfileprogress" style="width: 0;"></div></div></div>'),jQuery(p).data("downloaderfor",{base:t,nonce:e,what:a,index:n[i]}),setTimeout(function(){updraft_activejobs_update(!0)},1500)),jQuery(p).data("lasttimebegan",(new Date).getTime())}d=!!d;var f={type:a,timestamp:e,findex:n},m={action:"updraft_download_backup",nonce_key:"_wpnonce",nonce:s,timeout:1e4,async:d};return updraft_send_command("updraft_download_backup",f,function(t){},m),!1}function ud_parse_json(t){t.charAt(0),t.charAt(t.length-1);try{var e=JSON.parse(t);return e}catch(a){console.log("UpdraftPlus: Exception when trying to parse JSON (1) - will attempt to fix/re-parse"),console.log(t)}var r=t.indexOf("{"),n=t.lastIndexOf("}");if(r>-1&&n>-1){var o=t.slice(r,n+1);try{var d=JSON.parse(o);return console.log("UpdraftPlus: JSON re-parse successful"),d}catch(a){throw console.log("UpdraftPlus: Exception when trying to parse JSON (2)"),a}}throw"UpdraftPlus: could not parse the JSON"}function updraft_restorer_checkstage2(t){var e=jQuery("#ud_downloadstatus2 .file").length;return e>0?void(t&&alert(updraftlion.stilldownloading)):(jQuery("#updraft-restore-modal-stage2a").html(updraftlion.processing),void updraft_send_command("restore_alldownloaded",{timestamp:jQuery("#updraft_restore_timestamp").val(),restoreopts:jQuery("#updraft_restore_form").serialize()},function(t,e,a){var r=null;jQuery("#updraft_restorer_restore_options").val("");try{if(null==t)return void jQuery("#updraft-restore-modal-stage2a").html(updraftlion.emptyresponse);var n=t.m;if(""!=t.w&&(n=n+"<p><strong>"+updraftlion.warnings+"</strong><br>"+t.w+"</p>"),""!=t.e?n=n+"<p><strong>"+updraftlion.errors+"</strong><br>"+t.e+"</p>":updraft_restore_stage=3,t.hasOwnProperty("i")){try{if(r=ud_parse_json(t.i),r.hasOwnProperty("addui")){console.log("Further UI options are being displayed");var o=r.addui;n+='<div id="updraft_restoreoptions_ui" style="clear:left; padding-top:10px;">'+o+"</div>","object"==typeof JSON&&"function"==typeof JSON.stringify&&(delete r.addui,t.i=JSON.stringify(r))}}catch(d){console.log(d),console.log(t)}jQuery("#updraft_restorer_backup_info").val(t.i)}else jQuery("#updraft_restorer_backup_info").val();jQuery("#updraft-restore-modal-stage2a").html(n),jQuery("#updraft-restore-modal-stage2a .updraft_select2").length>0&&jQuery("#updraft-restore-modal-stage2a .updraft_select2").select2()}catch(d){console.log(a),console.log(d),jQuery("#updraft-restore-modal-stage2a").text(updraftlion.jsonnotunderstood+" "+updraftlion.errordata+": "+a).html()}},{error_callback:function(t,e,a,r){if("undefined"!=typeof r&&r.hasOwnProperty("fatal_error"))console.error(r.fatal_error_message),jQuery("#updraft-restore-modal-stage2a").html('<p style="color: red;">'+r.fatal_error_message+"</p>"),alert(r.fatal_error_message);else{var n="updraft_send_command: error: "+e+" ("+a+")";jQuery("#updraft-restore-modal-stage2a").html('<p style="color: red;">'+n+"</p>"),console.log(n),alert(n),console.log(t)}}}))}function updraft_downloader_status(t,e,a,r){}function updraft_downloader_status_update(t,e){var a=0;return jQuery(t).each(function(t,r){if(""!=r.base){var n=r.base+r.timestamp+"_"+r.what+"_"+r.findex,o="."+n;if(null!=r.e)jQuery(o+" .raw").html("<strong>"+updraftlion.error+"</strong> "+r.e),console.log(r);else if(null!=r.p){if(jQuery(o+"_st .dlfileprogress").width(r.p+"%"),null!=r.a&&r.a>0){var d=(new Date).getTime(),u=jQuery(o).data("lasttimebegan"),s=d-u;if(r.a>90&&s>6e4){console.log(r.timestamp+" "+r.what+" "+r.findex+": restarting download: file_age="+r.a+", sincelastrestart_ms="+s),jQuery(o).data("lasttimebegan",(new Date).getTime());var i=jQuery("#updraft-navtab-backups-content .uddownloadform_"+r.what+"_"+r.timestamp+"_"+r.findex),l={type:r.what,timestamp:r.timestamp,findex:r.findex},p={action:"updraft_download_backup",nonce_key:"_wpnonce",nonce:i.data("wp_nonce").toString(),timeout:1e4};updraft_send_command("updraft_download_backup",l,function(t){},p),jQuery(o).data("lasttimebegan",(new Date).getTime())}}if(null!=r.m)if(r.p>=100&&"udrestoredlstatus_"==r.base)jQuery(o+" .raw").html(r.m),jQuery(o).fadeOut("slow",function(){remove_updraft_downloader(this,r.what),updraft_restorer_checkstage2(0)});else if(r.p<100||"uddlstatus_"!=r.base)jQuery(o+" .raw").html(r.m);else{var _=updraftlion.fileready+" "+updraftlion.actions+': \t\t\t\t<button class="button" type="button" onclick="updraftplus_downloadstage2(\''+r.timestamp+"', '"+r.what+"', '"+r.findex+"')\">"+updraftlion.downloadtocomputer+'</button> \t\t\t\t<button class="button" id="uddownloaddelete_'+r.timestamp+"_"+r.what+'" type="button" onclick="updraftplus_deletefromserver(\''+r.timestamp+"', '"+r.what+"', '"+r.findex+"')\">"+updraftlion.deletefromserver+"</button>";
2
- r.hasOwnProperty("can_show_contents")&&r.can_show_contents&&(_+=' <button class="button" type="button" onclick="updraftplus_show_contents(\''+r.timestamp+"', '"+r.what+"', '"+r.findex+"')\">"+updraftlion.browse_contents+"</button>"),jQuery(o+" .raw").html(_),jQuery(o+"_st").remove()}}else null!=r.m?jQuery(o+" .raw").html(r.m):(jQuery(o+" .raw").html(updraftlion.jsonnotunderstood+" ("+e+")"),a=1)}}),a}function updraft_backupnow_go(t,e,a,r,n,o,d){var u={backupnow_nodb:t,backupnow_nofiles:e,backupnow_nocloud:a,backupnow_label:o,extradata:n};if(""!=r&&(u.onlythisfileentity=r),""!=d&&(u.onlythesetableentities=d),u.always_keep="undefined"!=typeof n.always_keep?n.always_keep:0,delete n.always_keep,u.incremental="undefined"!=typeof n.incremental?n.incremental:0,delete n.incremental,!jQuery(".updraft_requeststart").length){var s=jQuery('<div class="updraft_requeststart" />').html('<span class="spinner"></span>'+updraftlion.requeststart);s.data("remove",!1),setTimeout(function(){s.data("remove",!0)},3e3),setTimeout(function(){s.remove()},75e3),jQuery("#updraft_activejobsrow").before(s)}updraft_activejobslist_backupnownonce_only=1,updraft_send_command("backupnow",u,function(t){return t.hasOwnProperty("error")?(jQuery(".updraft_requeststart").remove(),void alert(t.error)):(jQuery("#updraft_backup_started").html(t.m),t.hasOwnProperty("nonce")&&(updraft_backupnow_nonce=t.nonce,console.log("UpdraftPlus: ID of started job: "+updraft_backupnow_nonce)),void setTimeout(function(){updraft_activejobs_update(!0)},500))})}function updraft_process_status_check(t,e,a){if(t.hasOwnProperty("fatal_error"))return console.error(t.fatal_error_message),void(!0===updraftplus_activejobs_list_fatal_error_alert&&(updraftplus_activejobs_list_fatal_error_alert=!1,alert(this.alert_done+" "+t.fatal_error_message)));try{t.hasOwnProperty("l")&&(t.l?(jQuery("#updraft_lastlogmessagerow").show(),jQuery("#updraft_lastlogcontainer").html(t.l)):(jQuery("#updraft_lastlogmessagerow").hide(),jQuery("#updraft_lastlogcontainer").html("("+updraftlion.nothing_yet_logged+")")));var r=-1,n=jQuery(".updraft_requeststart");t.j&&n.length&&n.data("remove")&&n.remove();var o=jQuery(t.j);o.find(".updraft_jobtimings").each(function(t,e){var a=jQuery(e);if(a.data("jobid")){var r=a.data("jobid"),n=a.closest(".updraft_row");updraft_aborted_jobs[r]&&n.hide()}}),jQuery("#updraft_activejobsrow").html(o);var d=o.find('.job-id[data-isclone="1"]');if(d.length>0){if(0==jQuery(".updraftclone_action_box .updraftclone_network_info").length&&jQuery("#updraft_activejobsrow .job-id .updraft_clone_url").length>0){var u=jQuery("#updraft_activejobsrow .job-id .updraft_clone_url").data("clone_url");updraft_send_command("get_clone_network_info",{clone_url:u},function(t){t.hasOwnProperty("html")&&jQuery(".updraftclone_action_box").html(t.html)})}jQuery("#updraft_clone_activejobsrow").empty(),d.each(function(t,e){var a=jQuery(e);a.closest(".updraft_row").appendTo(jQuery("#updraft_clone_activejobsrow"))})}if(jQuery("#updraft_activejobs .updraft_jobtimings").each(function(t,e){var a=jQuery(e);if(a.data("lastactivity")&&a.data("jobid")){var n=a.data("jobid"),o=a.data("lastactivity");(r==-1||o<r)&&(r=o);var d=a.data("nextresumptionafter"),u=a.data("nextresumption");timenow=(new Date).getTime(),o>50&&u>0&&d<-30&&timenow>updraft_last_forced_when+1e5&&(updraft_last_forced_jobid!=n||u!=updraft_last_forced_resumption)&&(updraft_last_forced_resumption=u,updraft_last_forced_jobid=n,updraft_last_forced_when=timenow,console.log("UpdraftPlus: force resumption: job_id="+n+", resumption="+u),updraft_send_command("forcescheduledresumption",{resumption:u,job_id:n},function(t){console.log(t)},{json_parse:!1,alert_on_error:!1}))}}),timenow=(new Date).getTime(),updraft_activejobs_nextupdate=timenow+18e4,1==updraft_page_is_visible&&"backups"==updraft_console_focussed_tab&&(updraft_activejobs_nextupdate=r>-1?r<5?timenow+1750:timenow+5e3:lastlog_lastdata==e?timenow+7500:timenow+1750),d.length>0&&(updraft_activejobs_nextupdate=timenow+6e3),lastlog_lastdata=e,null!=t.j&&""!=t.j){if(jQuery("#updraft_activejobsrow").show(),d.length>0&&jQuery("#updraft_clone_activejobsrow").show(),a.hasOwnProperty("thisjobonly")&&!updraft_inpage_hasbegun&&jQuery("#updraft-jobid-"+a.thisjobonly).length?(updraft_inpage_hasbegun=1,console.log("UpdraftPlus: the start of the requested backup job has been detected")):!updraft_inpage_hasbegun&&updraft_activejobslist_backupnownonce_only&&jQuery(".updraft_jobtimings.isautobackup").length?(autobackup_nonce=jQuery(".updraft_jobtimings.isautobackup").first().data("jobid"),autobackup_nonce&&(updraft_inpage_hasbegun=1,updraft_backupnow_nonce=autobackup_nonce,a.thisjobonly=autobackup_nonce,console.log("UpdraftPlus: the start of the requested backup job has been detected; id: "+autobackup_nonce))):1==updraft_inpage_hasbegun&&jQuery("#updraft-jobid-"+a.thisjobonly+".updraft_finished").length&&(updraft_inpage_hasbegun=2,console.log("UpdraftPlus: the end of the requested backup job has been detected"),updraft_activejobs_update_timer&&clearInterval(updraft_activejobs_update_timer),"undefined"!=typeof updraft_inpage_success_callback&&""!=updraft_inpage_success_callback?updraft_inpage_success_callback.call(!1):jQuery("#updraft-backupnow-inpage-modal").dialog("close")),""==lastlog_jobs&&setTimeout(function(){jQuery("#updraft_backup_started").slideUp()},3500),a.hasOwnProperty("thisjobonly")&&updraft_backupnow_nonce&&a.thisjobonly===updraft_backupnow_nonce){jQuery(".updraft_requeststart").remove();var s=jQuery("#updraft-jobid-"+updraft_backupnow_nonce);s.is(".updraft_finished")&&(updraft_activejobslist_backupnownonce_only=0,updraft_aborted_jobs[updraft_backupnow_nonce]?updraft_aborted_jobs=updraft_aborted_jobs.filter(function(t,e){return t!=updraft_backupnow_nonce}):updraft_active_job_is_clone(updraft_backupnow_nonce)?(updraft_show_success_modal(updraftlion.clone_backup_complete),updraft_clone_jobs=updraft_clone_jobs.filter(function(t){return t!=updraft_backupnow_nonce})):updraft_show_success_modal(updraftlion.backup_complete),updraft_backupnow_nonce="",updraft_activejobs_update(!0))}}else jQuery("#updraft_activejobsrow").is(":hidden")||("undefined"!=typeof lastbackup_laststatus&&updraft_showlastbackup(),updraft_updatehistory(0,0),jQuery("#updraft_activejobsrow").hide());if(lastlog_jobs=t.j,null!=t.ds&&""!=t.ds&&updraft_downloader_status_update(t.ds,e),null!=t.u&&""!=t.u&&jQuery("#updraft-poplog").dialog("isOpen")){var i=t.u;if(i.nonce==updraft_poplog_log_nonce&&(updraft_poplog_log_pointer=i.pointer,null!=i.log&&""!=i.log)){var l=jQuery("#updraft-poplog").scrollTop();jQuery("#updraft-poplog-content").append(i.log),updraft_poplog_lastscroll!=l&&updraft_poplog_lastscroll!=-1||(jQuery("#updraft-poplog").scrollTop(jQuery("#updraft-poplog-content").prop("scrollHeight")),updraft_poplog_lastscroll=jQuery("#updraft-poplog").scrollTop())}}}catch(p){console.log(updraftlion.unexpectedresponse+" "+e),console.log(p)}}var onlythesefileentities=backupnow_whichfiles_checked("");""==onlythesefileentities?jQuery("#backupnow_includefiles_moreoptions").show():jQuery("#backupnow_includefiles_moreoptions").hide();var impossible_increment_entities,updraft_restore_stage=1,lastlog_lastmessage="",lastlog_lastdata="",lastlog_jobs="",updraft_activejobs_nextupdate=(new Date).getTime()+1e3,updraft_page_is_visible=1,updraft_console_focussed_tab=updraftlion.tab,updraft_settings_form_changed=!1;window.onbeforeunload=function(t){if(updraft_settings_form_changed)return updraftlion.unsavedsettings},"undefined"!=typeof document.hidden&&document.addEventListener("visibilitychange",function(){updraft_check_page_visibility(0)},!1),updraft_check_page_visibility(1);var updraft_poplog_log_nonce,updraft_poplog_log_pointer=0,updraft_poplog_lastscroll=-1,updraft_last_forced_jobid=-1,updraft_last_forced_resumption=-1,updraft_last_forced_when=-1,updraft_backupnow_nonce="",updraft_activejobslist_backupnownonce_only=0,updraft_inpage_hasbegun=0,updraft_activejobs_update_timer,updraft_aborted_jobs=[],updraft_clone_jobs=[],updraft_backups_selection={};!function(t){updraft_backups_selection.toggle=function(e){var a=t(e);a.is(".backuprowselected")?this.deselect(e):this.select(e)},updraft_backups_selection.select=function(e){t(e).addClass("backuprowselected"),t(e).find(".backup-select input").prop("checked",!0),this.checkSelectionStatus()},updraft_backups_selection.deselect=function(e){t(e).removeClass("backuprowselected"),t(e).find(".backup-select input").prop("checked",!1),this.checkSelectionStatus()},updraft_backups_selection.selectAll=function(){t("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row").each(function(t,e){updraft_backups_selection.select(e)})},updraft_backups_selection.deselectAll=function(){t("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row").each(function(t,e){updraft_backups_selection.deselect(e)})},updraft_backups_selection.checkSelectionStatus=function(){var e=t("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row").length,a=t("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row.backuprowselected").length;a>0?(t("#ud_massactions").addClass("active"),t(".js--deselect-all-backups, .js--delete-selected-backups").prop("disabled",!1)):(t("#ud_massactions").removeClass("active"),t(".js--deselect-all-backups, .js--delete-selected-backups").prop("disabled",!0)),e===a?t("#cb-select-all").prop("checked",!0):t("#cb-select-all").prop("checked",!1),e?t("#ud_massactions").show():t("#ud_massactions").hide()}}(jQuery);var updraftplus_activejobs_list_fatal_error_alert=!0,updraft_historytimer=0,calculated_diskspace=0,updraft_historytimer_notbefore=0,updraft_history_lastchecksum=!1,updraft_interval_week_val=!1,updraft_interval_month_val=!1;"undefined"!=typeof updraft_siteurl&&setInterval(function(){jQuery.get(updraft_siteurl+"/wp-cron.php")},21e4);var lastlog_lastmessage="";jQuery(document).ajaxError(function(t,e,a,r){if(null!=r&&""!=r&&null!=e.responseText&&""!=e.responseText&&(console.log("Error caught by UpdraftPlus ajaxError handler (follows) for "+a.url),console.log(r),0==a.url.search(ajaxurl)))if(a.url.search("subaction=downloadstatus")>=0){var n=a.url.match(/timestamp=\d+/),o=a.url.match(/type=[a-z]+/),d=a.url.match(/findex=\d+/),u=a.url.match(/base=[a-z_]+/);if(d=d instanceof Array?parseInt(d[0].substr(7)):0,o=o instanceof Array?o[0].substr(5):"",u=u instanceof Array?u[0].substr(5):"",n=n instanceof Array?parseInt(n[0].substr(10)):0,""!=u&&""!=o&&n>0){var s=u+n+"_"+o+"_"+d;jQuery("."+s+" .raw").html("<strong>"+updraftlion.error+"</strong> "+updraftlion.servererrorcode)}}else a.url.search("subaction=restore_alldownloaded")>=0&&jQuery("#updraft-restore-modal-stage2a").append("<br><strong>"+updraftlion.error+"</strong> "+updraftlion.servererrorcode+": "+r)}),jQuery(document).ready(function(t){function e(e){t('.expertmode .advanced_settings_container .advanced_tools:not(".'+e+'")').hide(),t(".expertmode .advanced_settings_container .advanced_tools."+e).fadeIn("slow"),t(".expertmode .advanced_settings_container .advanced_tools_button:not(#"+e+")").removeClass("active"),t(".expertmode .advanced_settings_container .advanced_tools_button#"+e).addClass("active")}function a(e){t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login_status").html("").hide(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login .updraftplus_spinner.spinner").addClass("visible"),updraft_send_command("process_updraftplus_clone_login",e,function(e){try{if(t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login .updraftplus_spinner.spinner").removeClass("visible"),e.hasOwnProperty("status")&&"error"==e.status)return t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login_status").html(e.message).show(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 .tfa_fields").hide(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 .non_tfa_fields").show(),void t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_two_factor_code").val("");e.hasOwnProperty("tfa_enabled")&&1==e.tfa_enabled&&(t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 .non_tfa_fields").hide(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 .tfa_fields").show(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 input#temporary_clone_options_two_factor_code").focus()),"authenticated"===e.status&&(t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1").hide(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 .non_tfa_fields").show(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 .tfa_fields").hide(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 input#temporary_clone_options_two_factor_code").val(""),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage2").show(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage2").html(e.html))}catch(a){console.log(a)}})}function r(e){t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key_status").html("").hide(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key .updraftplus_spinner.spinner").addClass("visible"),updraft_send_command("process_updraftplus_clone_login",e,function(e){try{if(t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key .updraftplus_spinner.spinner").removeClass("visible"),e.hasOwnProperty("status")&&"error"==e.status)return void t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key_status").html(e.message).show();"authenticated"===e.status&&(t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1").hide(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage2").show(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage2").html(e.html))}catch(a){console.log(a)}})}function n(t,e,a,r){var n={updraftplus_clone_backup:1,backupnow_nodb:0,backupnow_nofiles:0,backupnow_nocloud:0,backupnow_label:"UpdraftPlus Clone",extradata:"",onlythisfileentity:"plugins,themes,uploads,others",clone_id:t,secret_token:e,clone_url:a,key:r};updraft_activejobslist_backupnownonce_only=1,updraft_send_command("backupnow",n,function(t){jQuery("#updraft_clone_progress .updraftplus_spinner.spinner").removeClass("visible"),jQuery("#updraft_backup_started").html(t.m),t.hasOwnProperty("nonce")&&(updraft_backupnow_nonce=t.nonce,updraft_clone_jobs.push(updraft_backupnow_nonce),updraft_inpage_success_callback=function(){jQuery("#updraft_clone_activejobsrow").hide(),updraft_aborted_jobs[updraft_backupnow_nonce]?jQuery("#updraft_clone_progress").html(updraftlion.clone_backup_aborted):jQuery("#updraft_clone_progress").html(updraftlion.clone_backup_complete)},console.log("UpdraftPlus: ID of started job: "+updraft_backupnow_nonce)),updraft_activejobs_update(!0)})}function o(t){var e=Handlebars.compile(updraftlion.remote_storage_templates[t]),a=updraftlion.remote_storage_options[t]["default"];a.instance_id="s-"+d(32),a.instance_enabled=1;var r=e(a);jQuery(r).hide().insertAfter("."+t+"_add_instance_container:first").show("slow")}function d(t){for(var e="",a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<t;r++)e+=a.charAt(Math.floor(Math.random()*a.length));return e}function u(t){var e=!!jQuery("#updraftcentral_mothership_other").is(":checked");e?(jQuery("#updraftcentral_keycreate_mothership").prop("disabled",!1),t?jQuery("#updraftcentral_keycreate_mothership_firewalled_container").show():(jQuery(".updraftcentral_wizard_self_hosted_stage2").show(),jQuery("#updraftcentral_keycreate_mothership_firewalled_container").slideDown(),jQuery("#updraftcentral_keycreate_mothership").focus())):(jQuery("#updraftcentral_keycreate_mothership").prop("disabled",!0),t||(jQuery(".updraftcentral_wizard_self_hosted_stage2").hide(),s()))}function s(){jQuery("#updraftcentral_wizard_stage1_error").text("");var t="";if(jQuery("#updraftcentral_mothership_updraftpluscom").is(":checked"))jQuery(".updraftcentral_keycreate_description").hide(),t="updraftplus.com";else if(jQuery("#updraftcentral_mothership_other").is(":checked")){jQuery(".updraftcentral_keycreate_description").show();var e=jQuery("#updraftcentral_keycreate_mothership").val();if(""==e)return void jQuery("#updraftcentral_wizard_stage1_error").text(updraftlion.updraftcentral_wizard_empty_url);try{var a=new URL(e);t=a.hostname}catch(r){if("undefined"==typeof URL&&(t=jQuery("<a>").prop("href",e).prop("hostname")),!t||"undefined"!=typeof URL)return void jQuery("#updraftcentral_wizard_stage1_error").text(updraftlion.updraftcentral_wizard_invalid_url)}}jQuery("#updraftcentral_keycreate_description").val(t),jQuery(".updraftcentral_wizard_stage1").hide(),jQuery(".updraftcentral_wizard_stage2").show()}function i(e,a,r,n){jQuery("#updraft-delete-modal").dialog("close");var o=e,d=a,u=r,s=n,l=jQuery("#updraft_delete_timestamp").val().split(","),p=jQuery("#updraft_delete_form").serializeArray(),_={};t.each(p,function(){void 0!==_[this.name]?(_[this.name].push||(_[this.name]=[_[this.name]]),_[this.name].push(this.value||"")):_[this.name]=this.value||""}),_.delete_remote?jQuery("#updraft-delete-waitwarning").find(".updraft-deleting-remote").show():jQuery("#updraft-delete-waitwarning").find(".updraft-deleting-remote").hide(),jQuery("#updraft-delete-waitwarning").slideDown().addClass("active"),_.remote_delete_limit=updraftlion.remote_delete_limit,delete _.action,delete _.subaction,delete _.nonce,updraft_send_command("deleteset",_,function(t){if(!t.hasOwnProperty("result")||null==t.result)return void jQuery("#updraft-delete-waitwarning").slideUp();if("error"==t.result)jQuery("#updraft-delete-waitwarning").slideUp(),alert(updraftlion.error+" "+t.message);else if("continue"==t.result){o=o+t.backup_local+t.backup_remote,d+=t.backup_local,u+=t.backup_remote,s+=t.backup_sets;for(var e=t.deleted_timestamps.split(","),a=0;a<e.length;a++){var r=e[a];jQuery("#updraft-navtab-backups-content .updraft_existing_backups_row_"+r).slideUp().remove()}jQuery("#updraft_delete_timestamp").val(t.timestamps),jQuery("#updraft-deleted-files-total").text(o+" "+updraftlion.remote_files_deleted),i(o,d,u,s)}else if("success"==t.result){setTimeout(function(){jQuery("#updraft-deleted-files-total").text(""),jQuery("#updraft-delete-waitwarning").slideUp()},500),update_backupnow_modal(t),t.hasOwnProperty("backupnow_file_entities")&&(impossible_increment_entities=t.backupnow_file_entities),t.hasOwnProperty("count_backups")&&jQuery("#updraft-existing-backups-heading").html(updraftlion.existing_backups+' <span class="updraft_existing_backups_count">'+t.count_backups+"</span>");for(var a=0;a<l.length;a++){var r=l[a];jQuery("#updraft-navtab-backups-content .updraft_existing_backups_row_"+r).slideUp().remove()}updraft_backups_selection.checkSelectionStatus(),updraft_history_lastchecksum=!1,d+=t.backup_local,u+=t.backup_remote,s+=t.backup_sets,setTimeout(function(){alert(t.set_message+" "+s+"\n"+t.local_message+" "+d+"\n"+t.remote_message+" "+u)},900)}})}function l(t,e){jQuery("#updraft-navtab-settings-content #updraft_include_"+t).is(":checked")?e?jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude_container").show():jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude_container").slideDown():e?jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude").hide():jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude_container").slideUp()}function p(){var t=new plupload.Uploader(updraft_plupload_config);t.bind("Init",function(t){var e=jQuery("#plupload-upload-ui");t.features.dragdrop?(e.addClass("drag-drop"),jQuery("#drag-drop-area").bind("dragover.wp-uploader",function(){e.addClass("drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){e.removeClass("drag-over")})):(e.removeClass("drag-drop"),jQuery("#drag-drop-area").unbind(".wp-uploader"))}),t.init(),t.bind("FilesAdded",function(e,a){plupload.each(a,function(e){if(!/^backup_([\-0-9]{15})_.*_([0-9a-f]{12})-[\-a-z]+([0-9]+?)?(\.(zip|gz|gz\.crypt))?$/i.test(e.name)&&!/^log\.([0-9a-f]{12})\.txt$/.test(e.name)){for(var a=!1,r=0;r<updraft_accept_archivename.length;r++)if(updraft_accept_archivename[r].test(e.name))var a=!0;if(!a)return/\.(zip|tar|tar\.gz|tar\.bz2)$/i.test(e.name)||/\.sql(\.gz)?$/i.test(e.name)?(jQuery("#updraft-message-modal-innards").html("<p><strong>"+e.name+"</strong></p> "+updraftlion.notarchive2),jQuery("#updraft-message-modal").dialog("open")):alert(e.name+": "+updraftlion.notarchive),void t.removeFile(e)}jQuery("#filelist").append('<div class="file" id="'+e.id+'"><b>'+e.name+"</b> (<span>"+plupload.formatSize(0)+"</span>/"+plupload.formatSize(e.size)+') <div class="fileprogress"></div></div>')}),e.refresh(),e.start()}),t.bind("UploadProgress",function(t,e){jQuery("#"+e.id+" .fileprogress").width(e.percent+"%"),jQuery("#"+e.id+" span").html(plupload.formatSize(parseInt(e.size*e.percent/100))),e.size==e.loaded&&(jQuery("#"+e.id).html('<div class="file" id="'+e.id+'"><b>'+e.name+"</b> (<span>"+plupload.formatSize(parseInt(e.size*e.percent/100))+"</span>/"+plupload.formatSize(e.size)+") - "+updraftlion.complete+"</div>"),jQuery("#"+e.id+" .fileprogress").width(e.percent+"%"))}),t.bind("Error",function(t,e){console.log(e);var a;a="-200"==e.code?"\n"+updraftlion.makesure2:updraftlion.makesure;var r=updraftlion.uploaderr+" (code "+e.code+") : "+e.message;e.hasOwnProperty("status")&&e.status&&(r+=" ("+updraftlion.http_code+" "+e.status+")"),e.hasOwnProperty("response")&&(console.log("UpdraftPlus: plupload error: "+e.response),e.response.length<100&&(r+=" "+updraftlion.error+" "+e.response+"\n")),r+=" "+a,alert(r)}),t.bind("FileUploaded",function(t,e,a){if("200"==a.status)try{resp=ud_parse_json(a.response),resp.e?alert(updraftlion.uploaderror+" "+resp.e):resp.dm?(alert(resp.dm),updraft_updatehistory(1,0)):resp.m?updraft_updatehistory(1,0):alert("Unknown server response: "+a.response)}catch(r){console.log(a),alert(updraftlion.jsonnotunderstood)}else alert("Unknown server response status: "+a.code),console.log(a)})}function _(t){params={uri:jQuery("#updraftplus_httpget_uri").val()},params.curl=t,updraft_send_command("httpget",params,function(t){t.e&&alert(t.e),t.r?jQuery("#updraftplus_httpget_results").html("<pre>"+t.r+"</pre>"):console.log(t)},{type:"GET"})}function c(t,e,a){updraft_restore_setoptions(t),jQuery("#updraft_restore_timestamp").val(e),jQuery(".updraft_restore_date").html(a),updraft_restore_stage=1,jQuery("#updraft-restore-modal").dialog("open"),jQuery("#updraft-restore-modal-stage1").show(),jQuery("#updraft-restore-modal-stage2").hide(),jQuery("#updraft-restore-modal-stage2a").html(""),updraft_activejobs_update(!0)}function f(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e="[\\?&]"+t+"=([^&#]*)",a=new RegExp(e),r=a.exec(window.location.href);return null==r?"":decodeURIComponent(r[1].replace(/\+/g," "))}function m(e,a,r){jQuery("#updraft_upload_timestamp").val(e),jQuery("#updraft_upload_nonce").val(a);var n=r.split(",");jQuery(".updraft_remote_storage_destination").each(function(e){var a=jQuery(this).val();if(jQuery.inArray(a,n)==-1){jQuery(this).prop("checked",!1),jQuery(this).prop("disabled",!0);var r=t(this).prop("labels");jQuery(r).append(" "+updraftlion.already_uploaded)}}),jQuery("#updraft-upload-modal").dialog("open")}if(t(document).on("udp/checkout/done",function(e,a){a.hasOwnProperty("product")&&"updraftpremium"===a.product&&"complete"===a.status&&(t(".premium-upgrade-purchase-success").show(),t(".updraft_feat_table").closest("section").hide(),t(".updraft_premium_cta__action").hide())}),t(".expertmode .advanced_settings_container .advanced_tools_button").click(function(){e(t(this).attr("id"))}),jQuery.ui&&jQuery.ui.dialog&&jQuery.ui.dialog.prototype._allowInteraction){var g=jQuery.ui.dialog.prototype._allowInteraction;jQuery.ui.dialog.prototype._allowInteraction=function(t){return!!jQuery(t.target).closest(".select2-dropdown").length||g.apply(this,arguments)}}t("#updraftcentral_keys").on("click","a.updraftcentral_keys_show",function(e){e.preventDefault(),t(this).remove(),t("#updraftcentral_keys_table").slideDown()}),t("#updraftcentral_keycreate_altmethod_moreinfo_get").click(function(e){e.preventDefault(),t(this).remove(),t("#updraftcentral_keycreate_altmethod_moreinfo").slideDown()}),t("#updraft-navtab-settings-content #remote-storage-holder").on("change keyup paste",".updraft_webdav_settings",function(){var e=[];t(".updraft_webdav_settings").each(function(a,r){var n=t(r).attr("id");if(n&&"updraft_webdav_"==n.substring(0,15)){var o=n.substring(15);id_split=o.split("_"),o=id_split[0];var d=id_split[1];"undefined"==typeof e[d]&&(e[d]=[]),e[d][o]=this.value}});var a="",r="@",n="/",o=":",d=":";for(var u in e)(e[u].host.indexOf("@")>=0||""===e[u].host)&&(r=""),e[u].host.indexOf("/")>=0?t("#updraft_webdav_host_error").show():t("#updraft_webdav_host_error").hide(),0!=e[u].path.indexOf("/")&&""!==e[u].path||(n=""),""!==e[u].user&&""!==e[u].pass||(o=""),""!==e[u].host&&""!==e[u].port||(d=""),a=e[u].webdav+e[u].user+o+e[u].pass+r+encodeURIComponent(e[u].host)+d+e[u].port+n+e[u].path,t("#updraft_webdav_url_"+u).val(a)}),t("#updraft-navtab-backups-content").on("click",".js--delete-selected-backups",function(t){t.preventDefault(),updraft_deleteallselected()}),t("#updraft-navtab-backups-content").on("click",".updraft_existing_backups .backup-select input",function(e){updraft_backups_selection.toggle(t(this).closest(".updraft_existing_backups_row"))}),t("#updraft-navtab-backups-content").on("click","#cb-select-all",function(e){t(this).is(":checked")?updraft_backups_selection.selectAll():updraft_backups_selection.deselectAll()}),t("#updraft-navtab-backups-content").on("click",".js--select-all-backups",function(t){updraft_backups_selection.selectAll()}),t("#updraft-navtab-backups-content").on("click",".js--deselect-all-backups",function(t){updraft_backups_selection.deselectAll()}),t("#updraft-navtab-backups-content").on("click",".updraft_existing_backups .updraft_existing_backups_row",function(t){(t.ctrlKey||t.metaKey)&&updraft_backups_selection.toggle(this)}),updraft_backups_selection.checkSelectionStatus(),t("#updraft-navtab-addons-content .wrap").on("click",".updraftplus_com_login .ud_connectsubmit",function(e){e.preventDefault();var a=t("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_email").val(),r=t("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_password").val(),n=t("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_auto_updates").is(":checked")?1:0,o=t("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_auto_udc_connect").is(":checked")?1:0,d={email:a,password:r,auto_update:n,auto_udc_connect:o};h.submit(d)}),t("#updraft-navtab-addons-content .wrap").on("keydown",".updraftplus_com_login input",function(e){if(13==e.which){e.preventDefault();var a=t("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_email").val(),r=t("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_password").val(),n=t("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_auto_updates").is(":checked")?1:0,o=t("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_auto_udc_connect").is(":checked")?1:0,d={email:a,password:r,auto_update:n,auto_udc_connect:o};h.submit(d)}}),t("#updraft-navtab-migrate-content").on("click",".updraftclone_show_step_1",function(e){t(".updraftplus-clone").addClass("opened"),t(".updraftclone_show_step_1").hide(),t(".updraft_migrate_widget_temporary_clone_stage1").show(),t(".updraft_migrate_widget_temporary_clone_stage0").hide()}),t("#updraft-navtab-migrate-content").on("click",".updraft_migrate_widget_temporary_clone_show_stage0",function(e){e.preventDefault(),t(".updraft_migrate_widget_temporary_clone_stage0").toggle()}),setup_migrate_tabs(),t("#updraft-navtab-migrate-content").on("click",".updraft_migrate_widget_module_content .close",function(e){t(".updraft_migrate_intro").show(),t(this).closest(".updraft_migrate_widget_module_content").hide()}),t("#updraft-navtab-migrate-content").on("click",".updraft_migrate_add_site--trigger",function(e){e.preventDefault(),t(".updraft_migrate_add_site").toggle()}),t("#updraft-navtab-migrate-content").on("click",".updraft_migrate_widget_module_content .updraftplus_com_login .ud_connectsubmit",function(e){e.preventDefault();var r=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_email").val(),n=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_password").val(),o=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_two_factor_code").val(),d=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login .temporary_clone_terms_and_conditions").is(":checked")?1:0,u={form_data:{email:r,password:n,two_factor_code:o,consent:d}};r&&n?a(u):t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login_status").html("<b>"+updraftlion.error+"</b> "+updraftlion.username_password_required).show()}),t("#updraft-navtab-migrate-content").on("keydown",".updraft_migrate_widget_module_content .updraftplus_com_login input",function(e){if(13==e.which){e.preventDefault();var r=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_email").val(),n=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_password").val(),o=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_two_factor_code").val(),d=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login .temporary_clone_terms_and_conditions").is(":checked")?1:0,u={form_data:{email:r,password:n,two_factor_code:o,consent:d}};r&&n?a(u):t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login_status").html("<b>"+updraftlion.error+"</b> "+updraftlion.username_password_required).show()}}),t("#updraft-navtab-migrate-content").on("click",".updraft_migrate_widget_module_content .updraftplus_com_key .ud_key_connectsubmit",function(e){e.preventDefault();var a=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key #temporary_clone_options_key").val(),n=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key .temporary_clone_terms_and_conditions").is(":checked")?1:0,o={
3
- form_data:{clone_key:a,consent:n}};a?r(o):t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key_status").html("<b>"+updraftlion.error+"</b> "+updraftlion.clone_key_required).show()}),t("#updraft-navtab-migrate-content").on("keydown",".updraft_migrate_widget_module_content .updraftplus_com_key input",function(e){if(13==e.which){e.preventDefault();var a=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key #temporary_clone_options_key").val(),n=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key .temporary_clone_terms_and_conditions").is(":checked")?1:0,o={form_data:{clone_key:a,consent:n}};a?r(o):t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key_status").html("<b>"+updraftlion.error+"</b> "+updraftlion.clone_key_required).show()}}),t("#updraft-navtab-migrate-content").on("change",".updraft_migrate_widget_module_content #updraftplus_clone_php_options",function(){var e=t(this).data("php_version"),a=t(this).val();a<e?t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_clone_status").html(updraftlion.clone_version_warning):t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_clone_status").html("")}),t("#updraft-navtab-migrate-content").on("change",".updraft_migrate_widget_module_content #updraftplus_clone_wp_options",function(){var e=t(this).data("wp_version"),a=t(this).val();a<e?t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_clone_status").html(updraftlion.clone_version_warning):t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_clone_status").html("")}),t("#updraft-navtab-migrate-content").on("click",".updraft_migrate_widget_module_content #updraft_migrate_createclone",function(e){e.preventDefault(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraft_migrate_createclone").prop("disabled",!0),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_clone_status").html(""),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_spinner.spinner").addClass("visible");var a=t(this).data("clone_id"),r=t(this).data("secret_token"),o=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_php_options").val(),d=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_wp_options").val(),u=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_region_options").val(),s=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_updraftclone_branch").val(),i=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_updraftplus_branch").val(),l=t(".updraftplus_clone_admin_login_options").is(":checked"),p={form_data:{clone_id:a,secret_token:r,install_info:{php_version:o,wp_version:d,region:u,admin_only:l,updraftclone_branch:"undefined"==typeof s?"":s,updraftplus_branch:"undefined"==typeof i?"":i}}};updraft_send_command("process_updraftplus_clone_create",p,function(e){try{if(t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraft_migrate_createclone").prop("disabled",!1),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_spinner.spinner").removeClass("visible"),e.hasOwnProperty("status")&&"error"==e.status)return void t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_clone_status").html(updraftlion.error+" "+e.message).show();"success"===e.status&&(t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage2").hide(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage3").show(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage3").html(e.html),jQuery("#updraft_clone_progress .updraftplus_spinner.spinner").addClass("visible"),n(a,r,e.url,e.key))}catch(o){t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraft_migrate_createclone").prop("disabled",!1),console.log("Error when processing the response of process_updraftplus_clone_create (as follows)"),console.log(o)}})});var h={};h.set_status=function(e){t("#updraft-navtab-addons-content .wrap").find(".updraftplus_spinner.spinner").text(e)},h.show_loader=function(){t("#updraft-navtab-addons-content .wrap").find(".updraftplus_spinner.spinner").addClass("visible"),t("#updraft-navtab-addons-content .wrap").find(".ud_connectsubmit").prop("disabled","disabled")},h.hide_loader=function(){t("#updraft-navtab-addons-content .wrap").find(".updraftplus_spinner.spinner").removeClass("visible").text(updraftlion.processing),t("#updraft-navtab-addons-content .wrap").find(".ud_connectsubmit").removeProp("disabled")},h.submit=function(e){if(t("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html("").hide(),this.stage)switch(this.stage){case"connect_udc":case"connect_udc_TFA":var a=t("#updraftplus-addons_options_email").val(),r=t("#updraftplus-addons_options_password").val();this.login_data.email=a,this.login_data.password=r,this.connect_udc();break;case"create_key":this.create_key();break;default:this.stage=null,h.submit()}else this.set_status(updraftlion.connecting),this.show_loader(),updraft_send_command("updraftplus_com_login_submit",{data:e},function(a){a.hasOwnProperty("success")?t("#updraftplus-addons_options_auto_udc_connect").is(":checked")?(this.login_data={email:e.email,password:e.password,i_consent:1,two_factor_code:""},h.create_key()):(h.hide_loader(),t("#updraft-navtab-addons-content .wrap .updraftplus_com_login").submit()):a.hasOwnProperty("error")&&(h.hide_loader(),t("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html(a.message).show())}.bind(this))},h.create_key=function(){this.stage="create_key",this.set_status(updraftlion.udc_cloud_connected),this.show_loader();var e={where_send:"__updraftpluscom",key_description:"",key_size:null,mothership_firewalled:0};updraft_send_command("updraftcentral_create_key",e,function(e){try{var a=ud_parse_json(e);if(a.hasOwnProperty("error"))return void console.log(a);a.hasOwnProperty("bundle")?(console.log("bundle",a.bundle),this.login_data.key=a.bundle,this.stage="connect_udc",h.connect_udc()):(a.hasOwnProperty("r")?(t("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html(updraftlion.trouble_connecting).show(),alert(a.r)):(t("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html(updraftlion.trouble_connecting).show(),console.log(a)),h.hide_loader())}catch(r){console.log(r),h.hide_loader()}}.bind(this),{json_parse:!1})},h.connect_udc=function(){var e=t("#updraft-navtab-addons-content .wrap");h.set_status(updraftlion.udc_cloud_key_created),h.show_loader(),"connect_udc_TFA"==this.stage&&(this.login_data.two_factor_code=e.find("input#updraftplus-addons_options_two_factor_code").val(),h.set_status(updraftlion.checking_tfa_code));var a={form_data:this.login_data};a.form_data.addons_options_connect=1,updraft_send_command("process_updraftcentral_login",a,function(a){try{var r=ud_parse_json(a);if(r.hasOwnProperty("error"))return"incorrect_password"===r.code&&(e.find(".tfa_fields").hide(),e.find(".non_tfa_fields").show(),e.find("input#updraftplus-addons_options_two_factor_code").val(""),e.find("input#updraftplus-addons_options_password").val("").focus()),"no_key_found"===r.code&&(this.stage="create_key"),t("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html(r.message).show(),t("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").find("a").attr("target","_blank"),console.log(r),void h.hide_loader();r.hasOwnProperty("tfa_enabled")&&1==r.tfa_enabled&&(t("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html("").hide(),e.find(".non_tfa_fields").hide(),e.find(".tfa_fields").show(),e.find("input#updraftplus-addons_options_two_factor_code").focus(),this.stage="connect_udc_TFA"),"authenticated"===r.status&&(e.find(".non_tfa_fields").hide(),e.find(".tfa_fields").hide(),e.find(".updraft-after-form-table").hide(),this.stage=null,t("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html(updraftlion.login_successful_short).show().addClass("success"),setTimeout(function(){t("#updraft-navtab-addons-content .wrap form.updraftplus_com_login").submit()},1e3))}catch(n){console.log(n)}h.hide_loader()}.bind(this),{json_parse:!1})},t("#updraft-navtab-settings-content #remote-storage-holder").on("click",".updraftplusmethod a.updraft_add_instance",function(e){e.preventDefault(),updraft_settings_form_changed=!0;var a=t(this).data("method");o(a)}),t("#updraft-navtab-settings-content #remote-storage-holder").on("click",".updraftplusmethod a.updraft_delete_instance",function(e){e.preventDefault(),updraft_settings_form_changed=!0;var a=t(this).data("method"),r=t(this).data("instance_id");1===t("."+a+"_updraft_remote_storage_border").length&&o(a),t("."+a+"-"+r).hide("slow",function(){t(this).remove()})}),t("#updraft-navtab-settings-content #remote-storage-holder").on("click",".updraftplusmethod .updraft_edit_label_instance",function(e){t(this).find("span").hide(),t(this).attr("contentEditable",!0).focus()}),t("#updraft-navtab-settings-content #remote-storage-holder").on("keyup",".updraftplusmethod .updraft_edit_label_instance",function(e){var a=jQuery(this).data("method"),r=jQuery(this).data("instance_id"),n=jQuery(this).text();t("#updraft_"+a+"_instance_label_"+r).val(n)}),t("#updraft-navtab-settings-content #remote-storage-holder").on("blur",".updraftplusmethod .updraft_edit_label_instance",function(e){t(this).attr("contentEditable",!1),t(this).find("span").show()}),t("#updraft-navtab-settings-content #remote-storage-holder").on("keypress",".updraftplusmethod .updraft_edit_label_instance",function(e){13===e.which&&(t(this).attr("contentEditable",!1),t(this).find("span").show(),t(this).blur())}),jQuery("#updraft-navtab-settings-content #remote-storage-holder").on("change","input[class='updraft_instance_toggle']",function(){updraft_settings_form_changed=!0,jQuery(this).is(":checked")?jQuery(this).siblings("label").html(updraftlion.instance_enabled):jQuery(this).siblings("label").html(updraftlion.instance_disabled)}),jQuery("#updraft-navtab-settings-content #remote-storage-holder").on("click",".updraftplusmethod button.updraft-test-button",function(){var e=jQuery(this).data("method"),a=jQuery(this).data("instance_id");updraft_remote_storage_test(e,function(r,n,o){return"sftp"==e&&(o.hasOwnProperty("scp")&&o.scp?alert(updraftlion.settings_test_result.replace("%s","SCP")+" "+r.output):alert(updraftlion.settings_test_result.replace("%s","SFTP")+" "+r.output),r.hasOwnProperty("data")&&r.data&&r.data.hasOwnProperty("valid_md5_fingerprint")&&r.data.valid_md5_fingerprint&&t("#updraft_sftp_fingerprint_"+a).val(r.data.valid_md5_fingerprint),!0)},a)}),t("#updraft-navtab-settings-content select.updraft_interval, #updraft-navtab-settings-content select.updraft_interval_database").change(function(){updraft_check_same_times()}),t("#backupnow_includefiles_showmoreoptions").click(function(e){e.preventDefault(),t("#backupnow_includefiles_moreoptions").toggle()}),t("#backupnow_database_showmoreoptions").click(function(e){e.preventDefault(),t("#backupnow_database_moreoptions").toggle()}),t("#updraft-navtab-backups-content").on("click","a.updraft_diskspaceused_update",function(t){t.preventDefault(),updraftplus_diskspace()}),t(".advanced_settings_content a.updraft_diskspaceused_update").click(function(t){t.preventDefault(),jQuery(".advanced_settings_content .updraft_diskspaceused").html("<em>"+updraftlion.calculating+"</em>"),updraft_send_command("get_fragment",{fragment:"disk_usage",data:"updraft"},function(t){jQuery(".advanced_settings_content .updraft_diskspaceused").html(t.output)},{type:"GET"})}),t("#updraft-navtab-backups-content a.updraft_uploader_toggle").click(function(e){e.preventDefault(),t("#updraft-plupload-modal").slideToggle()}),t("#updraft-navtab-backups-content a.updraft_rescan_local").click(function(t){t.preventDefault(),updraft_updatehistory(1,0)}),t("#updraft-navtab-backups-content a.updraft_rescan_remote").click(function(t){t.preventDefault(),updraft_updatehistory(1,1)}),t("#updraftplus-remote-rescan-debug").click(function(t){t.preventDefault(),updraft_updatehistory(1,1,1)}),jQuery("#updraftcentral_keys").on("click",'input[type="radio"]',function(){u(!1)}),u(!0),jQuery("#updraftcentral_keys").on("click","#updraftcentral_view_log",function(t){t.preventDefault(),jQuery("#updraftcentral_view_log_container").block({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.fetching+"</div>"});try{updraft_send_command("updraftcentral_get_log",null,function(t){jQuery("#updraftcentral_view_log_container").unblock(),t.hasOwnProperty("log_contents")?jQuery("#updraftcentral_view_log_contents").html('<div style="border:1px solid;padding: 2px;max-height: 400px; overflow-y:scroll;">'+t.log_contents+"</div>"):console.response(resp)},{error_callback:function(t,e,a,r){if(jQuery("#updraftcentral_view_log_container").unblock(),"undefined"!=typeof r&&r.hasOwnProperty("fatal_error"))console.error(r.fatal_error_message),alert(r.fatal_error_message);else{var n="updraft_send_command: error: "+e+" ("+a+")";console.log(n),alert(n),console.log(t)}}})}catch(e){jQuery("#updraft_central_key").html(),console.log(e)}}),jQuery("#updraftcentral_keys").on("click","#updraftcentral_wizard_go",function(t){jQuery("#updraftcentral_wizard_go").hide(),jQuery(".updraftcentral_wizard_success").remove(),jQuery(".create_key_container").show()}),jQuery("#updraftcentral_keys").on("click","#updraftcentral_stage1_go",function(t){t.preventDefault(),jQuery(".updraftcentral_wizard_stage2").hide(),jQuery(".updraftcentral_wizard_stage1").show()}),jQuery("#updraftcentral_keys").on("click","#updraftcentral_stage2_go",function(t){t.preventDefault(),s()}),jQuery("#updraftcentral_keys").on("click","#updraftcentral_keycreate_go",function(t){t.preventDefault();var e=!!jQuery("#updraftcentral_mothership_other").is(":checked"),a=jQuery("#updraftcentral_keycreate_description").val(),r=jQuery("#updraftcentral_keycreate_keysize").val(),n="__updraftpluscom";if(data={key_description:a,key_size:r},e&&(n=jQuery("#updraftcentral_keycreate_mothership").val(),"http"!=n.substring(0,4)))return void alert(updraftlion.enter_mothership_url);data.mothership_firewalled=jQuery("#updraftcentral_keycreate_mothership_firewalled").is(":checked")?1:0,data.where_send=n,jQuery(".create_key_container").hide(),jQuery(".updraftcentral_wizard_stage1").show(),jQuery(".updraftcentral_wizard_stage2").hide(),jQuery("#updraftcentral_keys").block({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.creating_please_allow+"</div>"});try{updraft_send_command("updraftcentral_create_key",data,function(t){jQuery("#updraftcentral_keys").unblock();try{if(t.hasOwnProperty("error"))return alert(t.error),void console.log(t);alert(t.r),t.hasOwnProperty("bundle")&&t.hasOwnProperty("keys_guide")?(jQuery("#updraftcentral_keys_content").html(t.keys_guide),jQuery("#updraftcentral_keys_content").append('<div class="updraftcentral_wizard_success">'+t.r+'<br><textarea onclick="this.select();" style="width:620px; height:165px; word-wrap:break-word; border: 1px solid #aaa; border-radius: 3px; padding:4px;">'+t.bundle+"</textarea></div>")):console.log(t),t.hasOwnProperty("keys_table")&&jQuery("#updraftcentral_keys_content").append(t.keys_table),jQuery("#updraftcentral_wizard_go").show()}catch(e){alert(updraftlion.unexpectedresponse+" "+response),console.log(e)}},{error_callback:function(t,e,a,r){if(jQuery("#updraftcentral_keys").unblock(),"undefined"!=typeof r&&r.hasOwnProperty("fatal_error"))console.error(r.fatal_error_message),alert(r.fatal_error_message);else{var n="updraft_send_command: error: "+e+" ("+a+")";console.log(n),alert(n),console.log(t)}}})}catch(o){jQuery("#updraft_central_key").html(),console.log(o)}}),jQuery("#updraftcentral_keys").on("click",".updraftcentral_key_delete",function(t){t.preventDefault();var e=jQuery(this).data("key_id");return"undefined"==typeof e?void console.log("UpdraftPlus: .updraftcentral_key_delete clicked, but no key ID found"):(jQuery("#updraftcentral_keys").block({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.deleting+"</div>"}),void updraft_send_command("updraftcentral_delete_key",{key_id:e},function(t){jQuery("#updraftcentral_keys").unblock(),t.hasOwnProperty("keys_table")&&jQuery("#updraftcentral_keys_content").html(t.keys_table)},{error_callback:function(t,e,a,r){if(jQuery("#updraftcentral_keys").unblock(),"undefined"!=typeof r&&r.hasOwnProperty("fatal_error"))console.error(r.fatal_error_message),alert(r.fatal_error_message);else{var n="updraft_send_command: error: "+e+" ("+a+")";console.log(n),alert(n),console.log(t)}}}))}),jQuery("#updraft_reset_sid").click(function(t){t.preventDefault(),updraft_send_command("reset_site_id",null,function(t){jQuery("#updraft_show_sid").html(t)},{json_parse:!1})}),jQuery("#updraft-navtab-settings-content form input:not('.udignorechange'), #updraft-navtab-settings-content form select").change(function(t){updraft_settings_form_changed=!0}),jQuery("#updraft-navtab-settings-content form input[type='submit']").click(function(t){updraft_settings_form_changed=!1});var y=180;jQuery(".updraft-bigbutton").each(function(t,e){var a=jQuery(e).width();a>y&&(y=a)}),y>180&&jQuery(".updraft-bigbutton").width(y),jQuery("#updraft-navtab-backups-content").length&&setInterval(function(){updraft_activejobs_update(!1)},1250),setTimeout(function(){jQuery("#setting-error-settings_updated").slideUp()},5e3),jQuery("#updraft_restore_db").change(function(){jQuery("#updraft_restore_db").is(":checked")&&1==jQuery(this).data("encrypted")?jQuery("#updraft_restorer_dboptions").slideDown():jQuery("#updraft_restorer_dboptions").slideUp()}),updraft_check_same_times();var b={};b[updraftlion.close]=function(){jQuery(this).dialog("close")},jQuery("#updraft-message-modal").dialog({autoOpen:!1,height:350,width:520,modal:!0,buttons:b});var v={};v[updraftlion.deletebutton]=function(){i(0,0,0,0)},v[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-delete-modal").dialog({autoOpen:!1,height:322,width:430,modal:!0,buttons:v});var w={};w[updraftlion.restore]=function(){var t=0,e=[],a=0,r=jQuery("#updraft_restore_meta_foreign").val();if(jQuery('input[name="updraft_restore[]"]').each(function(n,o){if(jQuery(o).is(":checked")&&!jQuery(o).is(":disabled")){t=1;var d=jQuery(o).data("howmany"),u=jQuery(o).val();if((1==r||2==r&&"db"!=u)&&("wpcore"!=u&&(d=jQuery("#updraft_restore_form #updraft_restore_wpcore").data("howmany")),u="wpcore"),"wpcore"!=u||0==a){var s=[u,d];e.push(s),"wpcore"==u&&(a=1)}}}),1==t){if(1==updraft_restore_stage){jQuery("#updraft-restore-modal-stage1").slideUp("slow"),jQuery("#updraft-restore-modal-stage2").show(),updraft_restore_stage=2;var n=jQuery(".updraft_restore_date").first().text(),o=e,d=jQuery("#updraft_restore_timestamp").val();try{updraft_send_command("whichdownloadsneeded",{downloads:e,timestamp:d},function(t){if(t.hasOwnProperty("downloads")&&(console.log("UpdraftPlus: items which still require downloading follow"),o=t.downloads,console.log(o)),0==o.length)updraft_restorer_checkstage2(0);else for(var e=0;e<o.length;e++)updraft_downloader("udrestoredlstatus_",d,o[e][0],"#ud_downloadstatus2",o[e][1],n,!1)},{alert_on_error:!1,error_callback:function(t,e,a,r){if("undefined"!=typeof r&&r.hasOwnProperty("fatal_error"))console.error(r.fatal_error_message),jQuery("#updraft-restore-modal-stage2a").html('<p style="color:red;">'+r.fatal_error_message+"</p>");else{var n="updraft_send_command: error: "+e+" ("+a+")";jQuery("#updraft-restore-modal-stage2a").html('<p style="color:red; margin: 5px;">'+n+"</p>"),console.log(n),console.log(t)}}})}catch(u){console.log("UpdraftPlus: error (follows) when looking for items needing downloading"),console.log(u),alert(updraftlion.jsonnotunderstood)}}else if(2==updraft_restore_stage)updraft_restorer_checkstage2(1);else if(3==updraft_restore_stage){var s=1;if(jQuery("#updraft_restoreoptions_ui input.required").each(function(t){if(0!=s){var e=jQuery(this).val();if(""==e)alert(updraftlion.pleasefillinrequired),s=0;else if(""!=jQuery(this).attr("pattern")){var a=jQuery(this).attr("pattern"),r=new RegExp(a,"g");r.test(e)||(alert(jQuery(this).data("invalidpattern")),s=0)}}}),!s)return;var i=jQuery("#updraft_restoreoptions_ui select, #updraft_restoreoptions_ui input").serialize();console.log("Restore options: "+i),jQuery("#updraft_restorer_restore_options").val(i),jQuery("#updraft-restore-modal-stage2a").html(updraftlion.restore_proceeding),jQuery("#updraft_restore_form").submit(),updraft_restore_stage=4}}else alert(updraftlion.youdidnotselectany)},w[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-restore-modal").dialog({autoOpen:!1,height:505,width:590,modal:!0,buttons:w}),jQuery("#updraft-iframe-modal").dialog({autoOpen:!1,height:500,width:780,modal:!0}),jQuery("#updraft-backupnow-inpage-modal").dialog({autoOpen:!1,height:380,width:580,modal:!0});var j={};j[updraftlion.backupnow]=function(){var t=jQuery("#backupnow_includedb").is(":checked")?0:1,e=jQuery("#backupnow_includefiles").is(":checked")?0:1,a=jQuery("#backupnow_includecloud").is(":checked")?0:1,r=backupnow_whichtables_checked(""),n=jQuery("#always_keep").is(":checked")?1:0,o="incremental"==jQuery("#updraft-backupnow-modal").data("backup-type")?1:0;if(""==r&&0==t)return alert(updraftlion.notableschosen),void jQuery("#backupnow_includefiles_moreoptions").show();"boolean"==typeof r&&(r=null);var d=backupnow_whichfiles_checked("");return""==d&&0==e?(alert(updraftlion.nofileschosen),void jQuery("#backupnow_includefiles_moreoptions").show()):t&&e?void alert(updraftlion.excludedeverything):(jQuery(this).dialog("close"),setTimeout(function(){jQuery("#updraft_lastlogmessagerow").fadeOut("slow",function(){jQuery(this).fadeIn("slow")})},1700),void updraft_backupnow_go(t,e,a,d,{always_keep:n,incremental:o},jQuery("#backupnow_label").val(),r))},j[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-backupnow-modal").dialog({autoOpen:!1,height:472,width:610,modal:!0,buttons:j,create:function(){t(this).closest(".ui-dialog").find(".ui-dialog-buttonpane .ui-button:first").addClass("js-tour-backup-now-button")}}),jQuery("#updraft-poplog").dialog({autoOpen:!1,height:600,width:"75%",modal:!0}),jQuery("#updraft-navtab-settings-content .enableexpertmode").click(function(){return jQuery("#updraft-navtab-settings-content .expertmode").fadeIn(),jQuery("#updraft-navtab-settings-content .enableexpertmode").off("click"),!1}),jQuery("#updraft-navtab-settings-content .backupdirrow").on("click","a.updraft_backup_dir_reset",function(){return jQuery("#updraft_dir").val("updraft"),!1}),jQuery("#updraft-navtab-settings-content .updraft_include_entity").click(function(){var t=jQuery(this).data("toggle_exclude_field");t&&l(t,!1)}),jQuery(".updraft_exclude_entity_container").on("click",".updraft_exclude_entity_delete",function(t){if(t.preventDefault(),confirm(updraftlion.exclude_rule_remove_conformation_msg)){var e=jQuery(this).data("include-backup-file");jQuery.when(jQuery(this).closest(".updraft_exclude_entity_wrapper").remove()).then(updraft_exclude_entity_update(e))}}),jQuery(".updraft_exclude_entity_container").on("click",".updraft_exclude_entity_edit",function(t){t.preventDefault();var e=jQuery(this).hide().closest(".updraft_exclude_entity_wrapper"),a=e.find("input");a.removeProp("readonly").focus();var r=a.val();a.val(""),a.val(r),e.find(".updraft_exclude_entity_update").addClass("is-active").show()}),jQuery(".updraft_exclude_entity_container").on("click",".updraft_exclude_entity_update",function(t){t.preventDefault();var e=jQuery(this).closest(".updraft_exclude_entity_wrapper"),a=jQuery(this).data("include-backup-file"),r=jQuery.trim(e.find("input").val()),n=!1;r==e.find("input").data("val")?n=!0:updraft_is_unique_exclude_rule(r,a)&&(n=!0),n&&(jQuery(this).hide().removeClass("is-active"),jQuery.when(e.find("input").prop("readonly","readonly").data("val",r)).then(function(){e.find(".updraft_exclude_entity_edit").show(),updraft_exclude_entity_update(a)}))}),jQuery("#updraft_exclude_modal").dialog({autoOpen:!1,modal:!0,width:520,height:"auto",open:function(e,a){t(this).parent().focus()}}),jQuery(".updraft_exclude_container .updraft_add_exclude_item").click(function(t){t.preventDefault();var e=jQuery(this).data("include-backup-file");jQuery("#updraft_exclude_modal_for").val(e),jQuery("#updraft_exclude_modal_path").val(jQuery(this).data("path")),"uploads"==e&&jQuery("#updraft-exclude-file-dir-prefix").html(jQuery("#updraft-exclude-upload-base-dir").val()),jQuery(".updraft-exclude-modal-reset").trigger("click"),jQuery("#updraft_exclude_modal").dialog("open")}),jQuery(".updraft-exclude-link").click(function(t){t.preventDefault();var e=jQuery(this).data("panel");"file-dir"==e&&jQuery("#updraft_exclude_files_folders_jstree").jstree({core:{multiple:!1,data:function(t,e){updraft_send_command("get_jstree_directory_nodes",{entity:"filebrowser",node:t,path:jQuery("#updraft_exclude_modal_path").val(),findex:0,skip_root_node:!0},function(t){t.hasOwnProperty("error")?alert(t.error):e.call(this,t.nodes)},{error_callback:function(t,e,a,r){if("undefined"!=typeof r&&r.hasOwnProperty("fatal_error"))console.error(r.fatal_error_message),jQuery("#updraft_zip_files_jstree").html('<p style="color:red; margin: 5px;">'+r.fatal_error_message+"</p>"),alert(r.fatal_error_message);else{var n="updraft_send_command: error: "+e+" ("+a+")";jQuery("#updraft_zip_files_jstree").html('<p style="color:red; margin: 5px;">'+n+"</p>"),console.log(n),alert(n),console.log(t)}}})},error:function(t){alert(t),console.log(t)}},search:{show_only_matches:!0},plugins:["sort"]}),jQuery("#updraft_exclude_modal_main").slideUp(),jQuery(".updraft-exclude-panel").hide(),jQuery(".updraft-exclude-panel[data-panel="+e+"]").slideDown()}),jQuery(".updraft-exclude-modal-reset").click(function(t){t.preventDefault(),jQuery("#updraft_exclude_files_folders_jstree").jstree("destroy"),jQuery("#updraft_exclude_extension_field").val(""),jQuery("#updraft_exclude_prefix_field").val(""),jQuery(".updraft-exclude-panel").slideUp(),jQuery("#updraft_exclude_modal_main").slideDown()}),jQuery(".updraft-exclude-submit").click(function(){var t=jQuery(this).data("panel"),e="";switch(t){case"file-dir":var a=jQuery("#updraft_exclude_files_folders_jstree").jstree("get_selected");if(0==a.length)return void alert(updraftlion.exclude_select_file_or_folder_msg);var r=a[0],n=jQuery("#updraft_exclude_modal_path").val();r.substr(0,n.length)==n&&(r=r.substr(n.length,r.length)),"/"==r.charAt(0)&&(r=r.substr(1)),"/"==r.charAt(r.length-1)&&(r=r.substr(0,r.length-1)),e=r;break;case"extension":var o=jQuery("#updraft_exclude_extension_field").val();if(""==o)return void alert(updraftlion.exclude_type_ext_msg);if(!o.match(/^[0-9a-zA-Z]+$/))return void alert(updraftlion.exclude_ext_error_msg);e="ext:"+o;break;case"begin-with":var d=jQuery("#updraft_exclude_prefix_field").val();if(""==d)return void alert(updraftlion.exclude_type_prefix_msg);if(!d.match(/^\s*[a-z-_\d,\s]+\s*$/i))return void alert(updraftlion.exclude_prefix_error_msg);e="prefix:"+d;break;default:return}var u=jQuery("#updraft_exclude_modal_for").val();if(updraft_is_unique_exclude_rule(e,u)){var s='<div class="updraft_exclude_entity_wrapper"><input type="text" class="updraft_exclude_entity_field updraft_include_'+u+'_exclude_entity" name="updraft_include_'+u+'_exclude_entity[]" value="'+e+'" data-val="'+e+'" data-include-backup-file="'+u+'" readonly="readonly"><a href="#" class="updraft_exclude_entity_edit dashicons dashicons-edit" data-include-backup-file="'+u+'"></a><a href="#" class="updraft_exclude_entity_update dashicons dashicons-yes" data-include-backup-file="'+u+'" style="display: none;"></a><a href="#" class="updraft_exclude_entity_delete dashicons dashicons-no" data-include-backup-file="'+u+'"></a></div>';jQuery('.updraft_exclude_entity_container[data-include-backup-file="'+u+'"]').append(s),updraft_exclude_entity_update(u),jQuery("#updraft_exclude_modal").dialog("close")}}),jQuery("#updraft-navtab-settings-content .updraft-service").change(function(){var t=jQuery(this).val();jQuery("#updraft-navtab-settings-content .updraftplusmethod").hide(),jQuery("#updraft-navtab-settings-content ."+t).show()}),jQuery("#updraft-navtab-settings-content a.updraft_show_decryption_widget").click(function(t){t.preventDefault(),jQuery("#updraftplus_db_decrypt").val(jQuery("#updraft_encryptionphrase").val()),jQuery("#updraft-manualdecrypt-modal").slideToggle()}),jQuery("#updraftplus-phpinfo").click(function(t){t.preventDefault(),updraft_iframe_modal("phpinfo",updraftlion.phpinfo)}),jQuery("#updraftplus-rawbackuphistory").click(function(t){t.preventDefault(),updraft_iframe_modal("rawbackuphistory",updraftlion.raw)}),jQuery("#updraft-navtab-status").click(function(t){t.preventDefault(),updraft_open_main_tab("status"),updraft_page_is_visible=1,updraft_console_focussed_tab="status",updraft_activejobs_update(!0)}),jQuery("#updraft-navtab-expert").click(function(t){t.preventDefault(),updraft_open_main_tab("expert"),updraft_page_is_visible=1}),jQuery("#updraft-navtab-settings, #updraft-navtab-settings2, #updraft_backupnow_gotosettings").click(function(t){t.preventDefault(),jQuery(this).parents(".updraftmessage").remove(),jQuery("#updraft-backupnow-modal").dialog("close"),updraft_open_main_tab("settings"),updraft_page_is_visible=1}),jQuery("#updraft-navtab-addons").click(function(t){t.preventDefault(),jQuery(this).addClass("b#nav-tab-active"),updraft_open_main_tab("addons"),updraft_page_is_visible=1}),jQuery("#updraft-navtab-backups").click(function(t){t.preventDefault(),updraft_console_focussed_tab="backups",updraft_historytimertoggle(1),updraft_open_main_tab("backups")}),jQuery("#updraft-navtab-migrate").click(function(t){t.preventDefault(),jQuery("#updraft_migrate_tab_alt").html("").hide(),updraft_open_main_tab("migrate"),updraft_page_is_visible=1,jQuery("#updraft_migrate .updraft_migrate_widget_module_content").is(":visible")||jQuery(".updraft_migrate_intro").show()}),"migrate"==updraftlion.tab&&jQuery("#updraft-navtab-migrate").trigger("click"),updraft_send_command("ping",null,function(t,e){"success"==e&&"pong"!=t&&t.indexOf("pong")>=0&&(jQuery("#updraft-navtab-backups-content .ud-whitespace-warning").show(),console.log("UpdraftPlus: Extra output warning: response (which should be just (string)'pong') follows."),console.log(t))},{json_parse:!1,type:"GET"});try{"undefined"!=typeof updraft_plupload_config&&p()}catch(k){console.log(k)}if(jQuery("#updraftplus_httpget_go").click(function(t){t.preventDefault(),_(0)}),jQuery("#updraftplus_httpget_gocurl").click(function(t){t.preventDefault(),_(1)}),jQuery("#updraftplus_callwpaction_go").click(function(t){t.preventDefault(),params={wpaction:jQuery("#updraftplus_callwpaction").val()},updraft_send_command("call_wordpress_action",params,function(t){t.e?alert(t.e):t.s||(t.r?jQuery("#updraftplus_callwpaction_results").html(t.r):(console.log(t),alert(updraftlion.jsonnotunderstood)))})}),jQuery("#updraft_activejobs_table, #updraft-navtab-migrate-content").on("click",".updraft_jobinfo_delete",function(e){
4
- e.preventDefault();var a=jQuery(this).data("jobid");a?(t(this).addClass("disabled"),updraft_activejobs_delete(a)):console.log("UpdraftPlus: A stop job link was clicked, but the Job ID could not be found")}),jQuery("#updraft_activejobs_table, #updraft-navtab-backups-content .updraft_existing_backups, #updraft-backupnow-inpage-modal, #updraft-navtab-migrate-content").on("click",".updraft-log-link",function(t){t.preventDefault();var e=jQuery(this).data("fileid"),a=jQuery(this).data("jobid");e?updraft_popuplog(e):a?updraft_popuplog(a):console.log("UpdraftPlus: A log link was clicked, but the Job ID could not be found")}),jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("click","button.choose-components-button",function(t){var e=jQuery(this).data("entities"),a=jQuery(this).data("backup_timestamp"),r=jQuery(this).data("showdata");c(e,a,r)}),"initiate_restore"==f("udaction")){var Q=f("entities"),x=f("backup_timestamp"),O=f("showdata");c(Q,x,O)}var P={};P[updraftlion.uploadbutton]=function(){var t=jQuery("#updraft_upload_timestamp").val(),e=jQuery("#updraft_upload_nonce").val(),a="",r=!1;return jQuery(".updraft_remote_storage_destination").each(function(t){jQuery(this).is(":checked")&&(r=!0)}),r?(a=jQuery("input[name^='updraft_remote_storage_destination_']").serializeArray(),jQuery(this).dialog("close"),alert(updraftlion.local_upload_started),void updraft_send_command("upload_local_backup",{use_nonce:e,use_timestamp:t,services:a},function(t){})):void jQuery("#updraft-upload-modal-error").html(updraftlion.local_upload_error)},P[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-upload-modal").dialog({autoOpen:!1,height:322,width:430,modal:!0,buttons:P}),jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("click","button.updraft-upload-link",function(t){t.preventDefault();var e=jQuery(this).data("nonce").toString(),a=jQuery(this).data("key").toString(),r=jQuery(this).data("services").toString();e?m(a,e,r):console.log("UpdraftPlus: A upload link was clicked, but the Job ID could not be found")}),jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("click",".updraft-delete-link",function(t){t.preventDefault();var e=jQuery(this).data("hasremote"),a=jQuery(this).data("nonce").toString(),r=jQuery(this).data("key").toString();a?updraft_delete(r,a,e):console.log("UpdraftPlus: A delete link was clicked, but the Job ID could not be found")}),jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("click","button.updraft_download_button",function(t){t.preventDefault();var e="uddlstatus_",a=jQuery(this).data("backup_timestamp"),r=jQuery(this).data("what"),n=".ud_downloadstatus",o=jQuery(this).data("set_contents"),d=jQuery(this).data("prettydate"),u=!0;updraft_downloader(e,a,r,n,o,d,u)}),jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("dblclick",".updraft_existingbackup_date",function(t){t.preventDefault();var e=jQuery(this).data("rawbackup");null!=e&&""!=e&&updraft_html_modal(e,updraftlion.raw,780,500)})}),jQuery(document).ready(function(t){var e="#updraft-navtab-settings-content ";t(e+"#remote-storage-holder").on("click",".updraftvault_backtostart",function(a){a.preventDefault(),t(e+"#updraftvault_settings_showoptions").slideUp(),t(e+"#updraftvault_settings_connect").slideUp(),t(e+"#updraftvault_settings_connected").slideUp(),t(e+"#updraftvault_settings_default").slideDown()}),t(e).on("keypress","#updraftvault_settings_connect input",function(a){if(13==a.which)return t(e+"#updraftvault_connect_go").click(),!1}),t(e+"#remote-storage-holder").on("click","#updraftvault_recountquota",function(a){a.preventDefault(),t(e+"#updraftvault_recountquota").html(updraftlion.counting);try{updraft_send_command("vault_recountquota",{instance_id:t("#updraftvault_settings_connect").data("instance_id")},function(a){t(e+"#updraftvault_recountquota").html(updraftlion.updatequotacount),a.hasOwnProperty("html")&&(t(e+"#updraftvault_settings_connected").html(a.html),a.hasOwnProperty("connected")&&(a.connected?(t(e+"#updraftvault_settings_default").hide(),t(e+"#updraftvault_settings_connected").show()):(t(e+"#updraftvault_settings_connected").hide(),t(e+"#updraftvault_settings_default").show())))},{error_callback:function(a,r,n,o){if(t(e+"#updraftvault_recountquota").html(updraftlion.updatequotacount),"undefined"!=typeof o&&o.hasOwnProperty("fatal_error"))console.error(o.fatal_error_message),alert(o.fatal_error_message);else{var d="updraft_send_command: error: "+r+" ("+n+")";console.log(d),alert(d),console.log(a)}}})}catch(r){t(e+"#updraftvault_recountquota").html(updraftlion.updatequotacount),console.log(r)}}),t(e+"#remote-storage-holder").on("click","#updraftvault_disconnect",function(a){a.preventDefault(),t(e+"#updraftvault_disconnect").html(updraftlion.disconnecting);try{updraft_send_command("vault_disconnect",{immediate_echo:!0,instance_id:t("#updraftvault_settings_connect").data("instance_id")},function(a){t(e+"#updraftvault_disconnect").html(updraftlion.disconnect),a.hasOwnProperty("html")&&(t(e+"#updraftvault_settings_connected").html(a.html).slideUp(),t(e+"#updraftvault_settings_default").slideDown())},{error_callback:function(a,r,n,o){if(t(e+"#updraftvault_disconnect").html(updraftlion.disconnect),"undefined"!=typeof o&&o.hasOwnProperty("fatal_error"))console.error(o.fatal_error_message),alert(o.fatal_error_message);else{var d="updraft_send_command: error: "+r+" ("+n+")";console.log(d),alert(d),console.log(a)}}})}catch(r){t(e+"#updraftvault_disconnect").html(updraftlion.disconnect),console.log(r)}}),t(e+"#remote-storage-holder").on("click","#updraftvault_connect",function(a){a.preventDefault(),t(e+"#updraftvault_settings_default").slideUp(),t(e+"#updraftvault_settings_connect").slideDown()}),t(e+"#remote-storage-holder").on("click","#updraftvault_showoptions",function(a){a.preventDefault(),t(e+"#updraftvault_settings_default").slideUp(),t(e+"#updraftvault_settings_showoptions").slideDown()}),t("#remote-storage-holder").on("keyup",".updraftplus_onedrive_folder_input",function(e){var a=t(this).val(),r=t(this).closest("td");0==a.indexOf("https:")||0==a.indexOf("http:")?r.find(".onedrive_folder_error").length||r.append('<div class="onedrive_folder_error">'+updraftlion.onedrive_folder_url_warning+"</div>"):r.find(".onedrive_folder_error").slideUp("slow",function(){r.find(".onedrive_folder_error").remove()})}),t(e+"#remote-storage-holder").on("click","#updraftvault_connect_go",function(a){return t(e+"#updraftvault_connect_go").html(updraftlion.connecting),updraft_send_command("vault_connect",{email:t("#updraftvault_email").val(),pass:t("#updraftvault_pass").val(),instance_id:t("#updraftvault_settings_connect").data("instance_id")},function(a,r,n){t(e+"#updraftvault_connect_go").html(updraftlion.connect),a.hasOwnProperty("e")?(updraft_html_modal('<h4 style="margin-top:0px; padding-top:0px;">'+updraftlion.errornocolon+"</h4><p>"+a.e+"</p>",updraftlion.disconnect,400,250),a.hasOwnProperty("code")&&"no_quota"==a.code&&(t(e+"#updraftvault_settings_connect").slideUp(),t(e+"#updraftvault_settings_default").slideDown())):a.hasOwnProperty("connected")&&a.connected&&a.hasOwnProperty("html")?(t(e+"#updraftvault_settings_connect").slideUp(),t(e+"#updraftvault_settings_connected").html(a.html).slideDown()):(console.log(a),alert(updraftlion.unexpectedresponse+" "+n))},{error_callback:function(a,r,n,o){if(t(e+"#updraftvault_connect_go").html(updraftlion.connect),"undefined"!=typeof o&&o.hasOwnProperty("fatal_error"))console.error(o.fatal_error_message),alert(o.fatal_error_message);else{var d="updraft_send_command: error: "+r+" ("+n+")";console.log(d),alert(d),console.log(a)}}}),!1}),t("#updraft-iframe-modal").on("change","#always_keep_this_backup",function(){var e=t(this).data("backup_key"),a={backup_key:e,always_keep:t(this).is(":checked")?1:0};updraft_send_command("always_keep_this_backup",a,function(t){t.hasOwnProperty("rawbackup")&&(jQuery("#updraft-iframe-modal").dialog("close"),jQuery(".updraft_existing_backups_row_"+e+" .updraft_existingbackup_date").data("rawbackup",t.rawbackup),updraft_html_modal(jQuery(".updraft_existing_backups_row_"+e+" .updraft_existingbackup_date").data("rawbackup"),updraftlion.raw,780,500))})})}),jQuery(document).ready(function(t){function e(){var t=new plupload.Uploader(updraft_plupload_config2);t.bind("Init",function(t){var e=jQuery("#plupload-upload-ui2");t.features.dragdrop?(e.addClass("drag-drop"),jQuery("#drag-drop-area2").bind("dragover.wp-uploader",function(){e.addClass("drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){e.removeClass("drag-over")})):(e.removeClass("drag-drop"),jQuery("#drag-drop-area2").unbind(".wp-uploader"))}),t.init(),t.bind("FilesAdded",function(e,a){plupload.each(a,function(e){return/^backup_([\-0-9]{15})_.*_([0-9a-f]{12})-db([0-9]+)?\.(gz\.crypt)$/i.test(e.name)?void jQuery("#filelist2").append('<div class="file" id="'+e.id+'"><b>'+e.name+"</b> (<span>"+plupload.formatSize(0)+"</span>/"+plupload.formatSize(e.size)+') <div class="fileprogress"></div></div>'):(alert(e.name+": "+updraftlion.notdba),void t.removeFile(e))}),e.refresh(),e.start()}),t.bind("UploadProgress",function(t,e){jQuery("#"+e.id+" .fileprogress").width(e.percent+"%"),jQuery("#"+e.id+" span").html(plupload.formatSize(parseInt(e.size*e.percent/100)))}),t.bind("Error",function(t,e){"-200"==e.code?err_makesure="\n"+updraftlion.makesure2:err_makesure=updraftlion.makesure,alert(updraftlion.uploaderr+" (code "+e.code+") : "+e.message+" "+err_makesure)}),t.bind("FileUploaded",function(t,e,a){"200"==a.status?"ERROR:"==a.response.substring(0,6)?alert(updraftlion.uploaderror+" "+a.response.substring(6)):"OK:"==a.response.substring(0,3)?(bkey=a.response.substring(3),jQuery("#"+e.id+" .fileprogress").hide(),jQuery("#"+e.id).append(updraftlion.uploaded+' <a href="?page=updraftplus&action=downloadfile&updraftplus_file='+bkey+"&decrypt_key="+encodeURIComponent(jQuery("#updraftplus_db_decrypt").val())+'">'+updraftlion.followlink+"</a> "+updraftlion.thiskey+" "+jQuery("#updraftplus_db_decrypt").val().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"))):alert(updraftlion.unknownresp+" "+a.response):alert(updraftlion.ukrespstatus+" "+a.code)})}try{"undefined"!=typeof updraft_plupload_config2&&e()}catch(a){console.log(a)}if(jQuery("#updraft-hidethis").remove(),Handlebars.registerHelper("ifeq",function(t,e,a){return"string"!=typeof t&&"undefined"!=typeof t&&null!==t&&(t=t.toString()),"string"!=typeof e&&"undefined"!=typeof e&&null!==e&&(e=e.toString()),t===e?a.fn(this):a.inverse(this)}),t("#remote-storage-holder").length){var r="";for(var n in updraftlion.remote_storage_templates)if("undefined"!=typeof updraftlion.remote_storage_options[n]&&1<Object.keys(updraftlion.remote_storage_options[n]).length){var o=Handlebars.compile(updraftlion.remote_storage_templates[n]),d=!0;for(var u in updraftlion.remote_storage_options[n])if("default"!==u){var s=updraftlion.remote_storage_options[n][u];s.first_instance=d,"undefined"==typeof s.instance_enabled&&(s.instance_enabled=1),r+=o(s),d=!1}}else r+=updraftlion.remote_storage_templates[n];t("#remote-storage-holder").append(r).ready(function(){t(".updraftplusmethod").not(".none").hide(),updraft_remote_storage_tabs_setup(),t("#remote-storage-holder .updraftplus_onedrive_folder_input").trigger("keyup")})}}),jQuery(document).ready(function(t){function e(){var t=r("object"),e=new Date;t=JSON.stringify({version:"1.12.40",epoch_date:e.getTime(),local_date:e.toLocaleString(),network_site_url:updraftlion.network_site_url,data:t});var a=document.body.appendChild(document.createElement("a"));a.setAttribute("download",updraftlion.export_settings_file_name),a.setAttribute("style","display:none;"),a.setAttribute("href","data:text/json;charset=UTF-8,"+encodeURIComponent(t)),a.click()}function a(e){var a,r=decodeURIComponent(e);try{a=ud_parse_json(r)}catch(o){return t.unblockUI(),jQuery("#import_settings").val(""),console.log(r),console.log(o),void alert(updraftlion.import_invalid_json_file)}if(window.confirm(updraftlion.importing_data_from+" "+r.network_site_url+"\n"+updraftlion.exported_on+" "+r.local_date+"\n"+updraftlion.continue_import)){var d=JSON.stringify(a.data);updraft_send_command("importsettings",{settings:d,updraftplus_version:updraftlion.updraftplus_version},function(e,a,r){var o=n(e);!o.hasOwnProperty("saved")||o.saved?(updraft_settings_form_changed=!1,location.replace(updraftlion.updraft_settings_url)):(t.unblockUI(),o.hasOwnProperty("error_message")&&o.error_message&&alert(o.error_message))},{action:"updraft_importsettings",nonce:updraftplus_settings_nonce,error_callback:function(e,a,r,n){if(t.unblockUI(),"undefined"!=typeof n&&n.hasOwnProperty("fatal_error"))console.error(n.fatal_error_message),alert(n.fatal_error_message);else{var o="updraft_send_command: error: "+a+" ("+r+")";console.log(o),console.log(e),alert(o)}}})}else t.unblockUI()}function r(e){var a="",e="undefined"==typeof e?"string":e;return"object"==e?a=t("#updraft-navtab-settings-content form input[name!='action'][name!='option_page'][name!='_wpnonce'][name!='_wp_http_referer'], #updraft-navtab-settings-content form textarea, #updraft-navtab-settings-content form select, #updraft-navtab-settings-content form input[type=checkbox]").serializeJSON({checkboxUncheckedValue:"0",useIntKeysAsArrayIndex:!0}):(a=t("#updraft-navtab-settings-content form input[name!='action'], #updraft-navtab-settings-content form textarea, #updraft-navtab-settings-content form select").serialize(),t.each(t("#updraft-navtab-settings-content form input[type=checkbox]").filter(function(e){return 0==t(this).prop("checked")}),function(e,r){var n="0";a+="&"+t(r).attr("name")+"="+n})),a}function n(e,a){try{var r=(e.messages,e.backup_dir.writable),n=e.backup_dir.message,o=e.backup_dir.button_title}catch(d){return console.log(d),console.log(a),alert(updraftlion.jsonnotunderstood),t.unblockUI(),{}}if(e.hasOwnProperty("changed")){console.log("UpdraftPlus: savesettings: some values were changed after being filtered"),console.log(e.changed);for(prop in e.changed)if("object"==typeof e.changed[prop])for(innerprop in e.changed[prop])t("[name='"+innerprop+"']").is(":checkbox")||t("[name='"+prop+"["+innerprop+"]']").val(e.changed[prop][innerprop]);else t("[name='"+prop+"']").is(":checkbox")||t("[name='"+prop+"']").val(e.changed[prop])}return t("#updraft_writable_mess").html(n),0==r?(t("#updraft-backupnow-button").attr("disabled","disabled"),t("#updraft-backupnow-button").attr("title",o),t(".backupdirrow").css("display","table-row")):(t("#updraft-backupnow-button").removeAttr("disabled"),t("#updraft-backupnow-button").removeAttr("title")),e.hasOwnProperty("updraft_include_more_path")&&t("#backupnow_includefiles_moreoptions").html(e.updraft_include_more_path),e.hasOwnProperty("backup_now_message")&&t("#backupnow_remote_container").html(e.backup_now_message),t(".updraftmessage").remove(),t("#updraft_backup_started").before(e.messages),console.log(e),t("#updraft-next-files-backup-inner").html(e.files_scheduled),t("#updraft-next-database-backup-inner").html(e.database_scheduled),e}function o(){var t=!1;if(jQuery("#updraft-authenticate-modal-innards").html(""),jQuery("div[class*=updraft_authenticate_] a.updraft_authlink").each(function(){jQuery("#updraft-authenticate-modal-innards").append('<p><a href="'+jQuery(this).attr("href")+'">'+jQuery(this).html()+"</a></p>"),t=!0}),t){var e={};e[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-authenticate-modal").dialog({autoOpen:!0,modal:!0,resizable:!1,draggable:!1,buttons:e,width:"auto"}).dialog("open")}}var d=new Image;d.src=updraftlion.ud_url+"/images/notices/updraft_logo.png",t("#updraft-navtab-settings-content input.updraft_include_entity").change(function(e){var a=t(this).attr("id"),r=t(this).is(":checked"),n="#backupnow_files_"+a;t(n).prop("checked",r)}),t("#updraftplus-settings-save").click(function(e){e.preventDefault(),t.blockUI({css:{width:"300px",border:"none","border-radius":"10px",left:"calc(50% - 150px)",padding:"20px"},message:'<div style="margin: 8px; font-size:150%;" class="updraft_saving_popup"><img src="'+updraftlion.ud_url+'/images/notices/updraft_logo.png" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.saving+"</div>"});var a=r("string");updraft_send_command("savesettings",{settings:a,updraftplus_version:updraftlion.updraftplus_version},function(e,a,r){n(e,r),t("#updraft-wrap .fade").delay(6e3).fadeOut(2e3),window.updraft_main_tour&&!window.updraft_main_tour.canceled?(window.updraft_main_tour.show("settings_saved"),o()):t("html, body").animate({scrollTop:t("#updraft-wrap").offset().top},1e3,function(){o()}),t.unblockUI()},{action:"updraft_savesettings",error_callback:function(e,a,r,n){if(t.unblockUI(),"undefined"!=typeof n&&n.hasOwnProperty("fatal_error"))console.error(n.fatal_error_message),alert(n.fatal_error_message);else{var o="updraft_send_command: error: "+a+" ("+r+")";console.log(o),alert(o),console.log(e)}},nonce:updraftplus_settings_nonce})}),t("#updraftplus-settings-export").click(function(){updraft_settings_form_changed&&alert(updraftlion.unsaved_settings_export),e()}),t("#updraftplus-settings-import").click(function(){t.blockUI({css:{width:"300px",border:"none","border-radius":"10px",left:"calc(50% - 150px)",padding:"20px"},message:'<div style="margin: 8px; font-size:150%;" class="updraft_saving_popup"><img src="'+updraftlion.ud_url+'/images/notices/updraft_logo.png" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.importing+"</div>"});var e=document.getElementById("import_settings");if(0==e.files.length)return alert(updraftlion.import_select_file),void t.unblockUI();var r=e.files[0],n=new FileReader;n.onload=function(){a(this.result)},n.readAsText(r)}),t(".udp-replace-with-iframe--js").on("click",function(e){e.preventDefault();var a=t(this).prop("href"),r=t('<iframe width="356" height="200" allowfullscreen webkitallowfullscreen mozallowfullscreen>').attr("src",a);r.insertAfter(t(this)),t(this).remove()})}),jQuery(document).ready(function(t){function e(e,n,o,d){if("function"==typeof o){var u=t(d).find("#updraftcentral_cloud_form"),s=u.find('.form_hidden_fields input[name="key"]');if(s.length&&""!==s.val())return void o.apply(this,[s.val()]);var i={where_send:"__updraftpluscom",key_description:"",key_size:e,mothership_firewalled:n};a(d),updraft_send_command("updraftcentral_create_key",i,function(e){r(d);try{if(i=ud_parse_json(e),i.hasOwnProperty("error"))return void console.log(i);i.hasOwnProperty("bundle")?o.apply(this,[i.bundle]):i.hasOwnProperty("r")?(t(d).find(".updraftcentral_cloud_notices").html(updraftlion.trouble_connecting).addClass("updraftcentral_cloud_info"),alert(i.r)):console.log(i)}catch(a){console.log(a)}},{json_parse:!1})}}function a(e){t(e).find(".updraftplus_spinner.spinner").addClass("visible")}function r(e){t(e).find(".updraftplus_spinner.spinner").removeClass("visible")}function n(e,n){a(n),updraft_send_command("process_updraftcentral_registration",e,function(a){r(n);try{if(e=ud_parse_json(a),e.hasOwnProperty("error")){var o=e.message,u=["existing_user_email","email_exists"];return-1!==t.inArray(e.code,u)&&(o=e.message+" "+updraftlion.perhaps_login),t(n).find(".updraftcentral_cloud_notices").html(o).addClass("updraftcentral_cloud_error"),t(n).find(".updraftcentral_cloud_notices a").attr("target","_blank"),void console.log(e)}"registered"===e.status&&(t(n).find(".updraftcentral_cloud_form_container").hide(),t(n).find(".updraftcentral-subheading").hide(),t(n).find(".updraftcentral_cloud_notices").removeClass("updraftcentral_cloud_error"),d(n,e,updraftlion.registration_successful))}catch(s){console.log(s)}},{json_parse:!1})}function o(e,o){a(o),updraft_send_command("process_updraftcentral_login",e,function(a){r(o);try{if(data=ud_parse_json(a),data.hasOwnProperty("error")){if("incorrect_password"===data.code&&(t(o).find(".updraftcentral_cloud_form_container .tfa_fields").hide(),t(o).find(".updraftcentral_cloud_form_container .non_tfa_fields").show(),t(o).find("input#two_factor_code").val(""),t(o).find("input#password").val("").focus()),"email_not_registered"!==data.code)return t(o).find(".updraftcentral_cloud_notices").html(data.message).addClass("updraftcentral_cloud_error"),t(o).find(".updraftcentral_cloud_notices a").attr("target","_blank"),void console.log(data);n(e,o)}data.hasOwnProperty("tfa_enabled")&&1==data.tfa_enabled&&(t(o).find(".updraftcentral_cloud_notices").html("").removeClass("updraftcentral_cloud_error"),t(o).find(".updraftcentral_cloud_form_container .non_tfa_fields").hide(),t(o).find(".updraftcentral_cloud_form_container .tfa_fields").show(),t(o).find("input#two_factor_code").focus()),"authenticated"===data.status&&(t(o).find(".updraftcentral_cloud_form_container").hide(),t(o).find(".updraftcentral_cloud_notices").removeClass("updraftcentral_cloud_error"),d(o,data,updraftlion.login_successful))}catch(u){console.log(u)}},{json_parse:!1})}function d(e,a,r){var n=t(e).find("form#updraftcentral_cloud_redirect_form");n.attr("action",a.redirect_url),n.attr("target","_blank"),"undefined"!=typeof a.redirect_token&&n.append('<input type="hidden" name="redirect_token" value="'+a.redirect_token+'">'),a.hasOwnProperty("keys_table")&&a.keys_table&&t("#updraftcentral_keys_content").html(a.keys_table),t(".updraftplus-addons-connect-to-udc").remove(),$redirect_lnk='<a href="'+updraftlion.current_clean_url+'" class="updraftcentral_cloud_redirect_link">'+updraftlion.updraftcentral_cloud+"</a>",$close_lnk='<a href="'+updraftlion.current_clean_url+'" class="updraftcentral_cloud_close_link">'+updraftlion.close_wizard+"</a>",t(e).find(".updraftcentral_cloud_notices").html(r.replace("%s",$redirect_lnk)+" "+$close_lnk+"<br/><br/>"+updraftlion.control_udc_connections),t(e).find(".updraftcentral_cloud_notices .updraftcentral_cloud_redirect_link").off("click").on("click",function(a){a.preventDefault(),n.submit(),t(e).find(".updraftcentral_cloud_notices .updraftcentral_cloud_close_link").trigger("click")}),t(e).find(".updraftcentral_cloud_notices .updraftcentral_cloud_close_link").off("click").on("click",function(a){a.preventDefault(),t(e).dialog("close"),t("#updraftcentral_cloud_connect_container").hide()})}function u(e){var a=t(e).find("#updraftcentral_cloud_form"),r=a.find("input#email").val(),n=a.find("input#password").val(),o=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;t(e).find(".updraftcentral_cloud_notices").html("").removeClass("updraftcentral_cloud_error updraftcentral_cloud_info");var d=a.find('.updraftcentral-data-consent > input[name="i_consent"]').is(":checked");return d?0===r.length||0===n.length?(t(e).find(".updraftcentral_cloud_notices").html(updraftlion.username_password_required).addClass("updraftcentral_cloud_error"),!1):null!==r.match(o)||(t(e).find(".updraftcentral_cloud_notices").html(updraftlion.valid_email_required).addClass("updraftcentral_cloud_error"),!1):(t(e).find(".updraftcentral_cloud_notices").html(updraftlion.data_consent_required).addClass("updraftcentral_cloud_error"),!1)}function s(a,r){var d=t(a).find("#updraft_central_keysize").val(),u=t(a).find("#updraft_central_firewalled").is(":checked")?1:0;e(d,u,function(e){var d=t(a).find("#updraftcentral_cloud_form"),u=d.find('.form_hidden_fields input[name="key"]');0===u.length&&d.find(".form_hidden_fields").append('<input type="hidden" name="key" value="'+e+'">');var s=d.find("input").serialize(),i={form_data:s};"undefined"!=typeof r&&r?n(i,a):o(i,a)},a)}function i(){var e=t("#updraftcentral_cloud_login_form");if(e.length){t("#updraft-iframe-modal-innards").html(e.html());var a=t("#updraft-iframe-modal").dialog("option","title",updraftlion.updraftcentral_cloud).dialog("option","width",520).dialog("option","height",450).dialog("option","buttons",{});a.dialog("open");var r=a.find(".updraftcentral-data-consent"),n=r.find("input").attr("name");"undefined"!=typeof n&&n&&(r.find("input").attr("id",n),r.find("label").attr("for",n))}}jQuery("#updraft-restore-modal").on("change","#updraft_restorer_charset",function(e){if(t("#updraft_restorer_charset").length&&t("#updraft_restorer_collate").length&&t("#collate_change_on_charset_selection_data").length){var a=t("#updraft_restorer_charset").val();t("#updraft_restorer_collate option").show(),t("#updraft_restorer_collate option[data-charset!="+a+"]").hide(),updraft_send_command("collate_change_on_charset_selection",{collate_change_on_charset_selection_data:t("#collate_change_on_charset_selection_data").val(),updraft_restorer_charset:a,updraft_restorer_collate:t("#updraft_restorer_collate").val()},function(e){e.hasOwnProperty("is_action_required")&&1==e.is_action_required&&e.hasOwnProperty("similar_type_collate")&&t("#updraft_restorer_collate").val(e.similar_type_collate)})}}),t("#updraft-wrap #btn_cloud_connect").on("click",function(){i()}),t("#updraft-wrap a#self_hosted_connect").on("click",function(e){e.preventDefault(),t("h2.nav-tab-wrapper > a#updraft-navtab-expert").trigger("click"),t("div.advanced_settings_menu > #updraft_central").trigger("click")}),t("#updraft-iframe-modal").on("click","#updraftcentral_cloud_login",function(e){e.preventDefault();var a=t(this).closest("#updraft-iframe-modal");u(a)&&s(a)});var l={};t(document).on("heartbeat-send",function(t,e){l=updraft_poll_get_parameters(),e.updraftplus=l}),t(document).on("heartbeat-tick",function(t,e){if(null!==e&&e.hasOwnProperty("updraftplus")){var a=e.updraftplus,r=JSON.stringify(a);updraft_process_status_check(a,r,l)}})});
1
+ function updraft_send_command(t,e,a,r){default_options={json_parse:!0,alert_on_error:!0,action:"updraft_ajax",nonce:updraft_credentialtest_nonce,nonce_key:"nonce",timeout:null,async:!0,type:"POST"},"undefined"==typeof r&&(r={});for(var n in default_options)r.hasOwnProperty(n)||(r[n]=default_options[n]);var o={action:r.action,subaction:t};if(o[r.nonce_key]=r.nonce,"object"==typeof e)for(var u in e)o[u]=e[u];else o.action_data=e;var d={type:r.type,url:ajaxurl,data:o,success:function(t,e){if(r.json_parse){try{var n=ud_parse_json(t)}catch(o){return"function"==typeof r.error_callback?r.error_callback(t,o,502,n):(console.log(o),console.log(t),void(r.alert_on_error&&alert(updraftlion.unexpectedresponse+" "+t)))}if(n.hasOwnProperty("fatal_error"))return"function"==typeof r.error_callback?r.error_callback(t,e,500,n):(console.error(n.fatal_error_message),r.alert_on_error&&alert(n.fatal_error_message),!1);"function"==typeof a&&a(n,e,t)}else"function"==typeof a&&a(t,e)},error:function(t,e,a){"function"==typeof r.error_callback?r.error_callback(t,e,a):(console.log("updraft_send_command: error: "+e+" ("+a+")"),console.log(t))},dataType:"text",async:r.async};null!=r.timeout&&(d.timeout=r.timeout),jQuery.ajax(d)}function updraft_delete(t,e,a){jQuery("#updraft_delete_timestamp").val(t),jQuery("#updraft_delete_nonce").val(e),a?jQuery("#updraft-delete-remote-section, #updraft_delete_remote").removeAttr("disabled").show():jQuery("#updraft-delete-remote-section, #updraft_delete_remote").hide().attr("disabled","disabled"),t.indexOf(",")>-1?(jQuery("#updraft_delete_question_singular").hide(),jQuery("#updraft_delete_question_plural").show()):(jQuery("#updraft_delete_question_plural").hide(),jQuery("#updraft_delete_question_singular").show()),jQuery("#updraft-delete-modal").dialog("open")}function updraft_remote_storage_tab_activation(t){jQuery(".updraftplusmethod").hide(),jQuery(".remote-tab").data("active",!1),jQuery(".remote-tab").removeClass("nav-tab-active"),jQuery(".updraftplusmethod."+t).show(),jQuery(".remote-tab-"+t).data("active",!0),jQuery(".remote-tab-"+t).addClass("nav-tab-active")}function updraft_check_overduecrons(){updraft_send_command("check_overdue_crons",null,function(t){t&&t.hasOwnProperty("m")&&jQuery("#updraft-insert-admin-warning").html(t.m)},{alert_on_error:!1})}function updraft_remote_storage_tabs_setup(){var t=0,e=jQuery(".updraft_servicecheckbox:checked");jQuery(e).each(function(a,r){var n=jQuery(r).val();"updraft_servicecheckbox_none"!=jQuery(r).attr("id")&&t++,jQuery(".remote-tab-"+n).show(),a==jQuery(e).length-1&&updraft_remote_storage_tab_activation(n)}),t>0?(jQuery(".updraftplusmethod.none").hide(),jQuery("#remote_storage_tabs").show()):jQuery("#remote_storage_tabs").hide(),jQuery(document).keyup(function(t){if((32===t.keyCode||13===t.keyCode)&&jQuery(document.activeElement).is("input.labelauty + label")){var e=jQuery(document.activeElement).attr("for");e&&jQuery("#"+e).change()}}),jQuery(".updraft_servicecheckbox").change(function(){var e=jQuery(this).attr("id");if("updraft_servicecheckbox_"==e.substring(0,24)){var a=e.substring(24);null!=a&&""!=a&&(jQuery(this).is(":checked")?(t++,jQuery(".remote-tab-"+a).fadeIn(),updraft_remote_storage_tab_activation(a)):(t--,jQuery(".remote-tab-"+a).hide(),1==jQuery(".remote-tab-"+a).data("active")&&updraft_remote_storage_tab_activation(jQuery(".remote-tab:visible").last().attr("name"))))}t<=0?(jQuery(".updraftplusmethod.none").fadeIn(),jQuery("#remote_storage_tabs").hide()):(jQuery(".updraftplusmethod.none").hide(),jQuery("#remote_storage_tabs").show())}),jQuery(".updraft_servicecheckbox:not(.multi)").change(function(){var t=jQuery(this).attr("value");jQuery(this).is(":not(:checked)")?(jQuery(".updraftplusmethod."+t).hide(),jQuery(".updraftplusmethod.none").fadeIn()):jQuery(".updraft_servicecheckbox").not(this).prop("checked",!1)});var a=jQuery(".updraft_servicecheckbox");"function"==typeof a.labelauty&&a.labelauty()}function updraft_remote_storage_test(t,e,a){var r,n;a?(r=jQuery("#updraft-"+t+"-test-"+a),n=".updraftplusmethod."+t+"-"+a):(r=jQuery("#updraft-"+t+"-test"),n=".updraftplusmethod."+t);var o=r.data("method_label");r.html(updraftlion.testing_settings.replace("%s",o));var u={method:t};jQuery("#updraft-navtab-settings-content "+n+" input[data-updraft_settings_test], #updraft-navtab-settings-content .expertmode input[data-updraft_settings_test]").each(function(t,e){var a=jQuery(e).data("updraft_settings_test"),r=jQuery(e).attr("type");if(a){r||(console.log("UpdraftPlus: settings test input item with no type found"),console.log(e),r="text");var n=null;"checkbox"==r?n=jQuery(e).is(":checked")?1:0:"text"==r||"password"==r?n=jQuery(e).val():(console.log("UpdraftPlus: settings test input item with unrecognised type ("+r+") found"),console.log(e)),u[a]=n}}),jQuery("#updraft-navtab-settings-content "+n+" textarea[data-updraft_settings_test], #updraft-navtab-settings-content "+n+" select[data-updraft_settings_test]").each(function(t,e){var a=jQuery(e).data("updraft_settings_test");u[a]=jQuery(e).val()}),updraft_send_command("test_storage_settings",u,function(t,a){r.html(updraftlion.test_settings.replace("%s",o)),"undefined"!=typeof e&&0!=e&&(e=e.call(this,t,a,u)),"undefined"!=typeof e&&!1===e&&(alert(updraftlion.settings_test_result.replace("%s",o)+" "+t.output),t.hasOwnProperty("data")&&console.log(t.data))},{error_callback:function(t,e,a,n){if(r.html(updraftlion.test_settings.replace("%s",o)),"undefined"!=typeof n&&n.hasOwnProperty("fatal_error"))console.error(n.fatal_error_message),alert(n.fatal_error_message);else{var u="updraft_send_command: error: "+e+" ("+a+")";console.log(u),alert(u),console.log(t)}}})}function backupnow_whichfiles_checked(t){return jQuery('#backupnow_includefiles_moreoptions input[type="checkbox"]').each(function(e){if(jQuery(this).is(":checked")){var a=jQuery(this).attr("name");if("updraft_include_"==a.substring(0,16)){var r=a.substring(16);""!=t&&(t+=","),t+=r}}}),t}function backupnow_whichtables_checked(t){var e=!1;return jQuery('#backupnow_database_moreoptions input[type="checkbox"]').each(function(t){if(!jQuery(this).is(":checked"))return void(e=!0)}),t=jQuery("input[name^='updraft_include_tables_']").serializeArray(),!e||t}function updraft_deleteallselected(){var t=0,e="",a="",r=0;jQuery("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row.backuprowselected").each(function(n){t++;var o=jQuery(this).data("nonce");a&&(a+=","),a+=o;var u=jQuery(this).data("key");e&&(e+=","),e+=u;var d=jQuery(this).find(".updraftplus-remove").data("hasremote");d&&r++}),updraft_delete(e,a,r)}function updraft_open_main_tab(t){updraftlion.main_tabs_keys.forEach(function(e){t==e?(jQuery("#updraft-navtab-"+e+"-content").show(),jQuery("#updraft-navtab-"+e).addClass("nav-tab-active")):(jQuery("#updraft-navtab-"+e+"-content").hide(),jQuery("#updraft-navtab-"+e).removeClass("nav-tab-active")),updraft_console_focussed_tab=t})}function updraft_openrestorepanel(t){updraft_historytimertoggle(t),updraft_open_main_tab("backups")}function updraft_delete_old_dirs(){return!0}function updraft_initiate_restore(t){jQuery('#updraft-navtab-backups-content .updraft_existing_backups button[data-backup_timestamp="'+t+'"]').click()}function updraft_restore_setoptions(t){var e=0;jQuery('input[name="updraft_restore[]"]').each(function(a,r){var n=jQuery(r).val(),o=n+"=([0-9,]+)",u=new RegExp(o),d=t.match(u);d?(jQuery(r).removeAttr("disabled").data("howmany",d[1]).parent().show(),e++,"db"==n&&(e+=4.5),jQuery(r).is(":checked")&&jQuery("#updraft_restorer_"+n+"options").show()):jQuery(r).attr("disabled","disabled").parent().hide()});var a=t.match(/dbcrypted=1/);a?(jQuery("#updraft_restore_db").data("encrypted",1),jQuery(".updraft_restore_crypteddb").show()):(jQuery("#updraft_restore_db").data("encrypted",0),jQuery(".updraft_restore_crypteddb").hide()),jQuery("#updraft_restore_db").trigger("change");var r=t.match(/meta_foreign=([12])/);r?jQuery("#updraft_restore_meta_foreign").val(r[1]):jQuery("#updraft_restore_meta_foreign").val("0");var n=336+20*e;jQuery("#updraft-restore-modal").dialog("option","height",n)}function updraft_backup_dialog_open(t){t="undefined"==typeof t?"new":t,0==jQuery("#updraftplus_incremental_backup_link").data("incremental")&&"incremental"==t?(jQuery("#updraft-backupnow-modal .incremental-free-only").show(),t="new"):jQuery("#updraft-backupnow-modal .incremental-backups-only").hide(),jQuery("#backupnow_includefiles_moreoptions").hide(),updraft_settings_form_changed&&!window.confirm(updraftlion.unsavedsettingsbackup)||(jQuery("#backupnow_label").val(""),"incremental"==t?(update_file_entities_checkboxes(!0,impossible_increment_entities),jQuery("#backupnow_includedb").prop("checked",!1),jQuery("#backupnow_includefiles").prop("checked",!0),jQuery("#backupnow_includefiles_label").text(updraftlion.files_incremental_backup),jQuery("#updraft-backupnow-modal .new-backups-only").hide(),jQuery("#updraft-backupnow-modal .incremental-backups-only").show()):(update_file_entities_checkboxes(!1,impossible_increment_entities),jQuery("#backupnow_includedb").prop("checked",!0),jQuery("#backupnow_includefiles_label").text(updraftlion.files_new_backup),jQuery("#updraft-backupnow-modal .new-backups-only").show(),jQuery("#updraft-backupnow-modal .incremental-backups-only").hide()),jQuery("#updraft-backupnow-modal").data("backup-type",t),jQuery("#updraft-backupnow-modal").dialog("open"))}function update_file_entities_checkboxes(t,e){t?jQuery(e).each(function(t,e){jQuery("#backupnow_files_updraft_include_"+e).prop("checked",!1),jQuery("#backupnow_files_updraft_include_"+e).prop("disabled",!0)}):jQuery('#backupnow_includefiles_moreoptions input[type="checkbox"]').each(function(t){var e=jQuery(this).attr("name");if("updraft_include_"==e.substring(0,16)){var a=e.substring(16);jQuery("#backupnow_files_updraft_include_"+a).prop("disabled",!1),jQuery(this).is(":checked")&&jQuery("#backupnow_files_updraft_include_"+a).prop("checked",!0)}})}function updraft_check_page_visibility(t){"hidden"==document.visibilityState?updraft_page_is_visible=0:(updraft_page_is_visible=1,1!==t&&jQuery("#updraft-navtab-backups-content").length&&updraft_activejobs_update(!0))}function setup_migrate_tabs(){jQuery("#updraft_migrate .updraft_migrate_widget_module_content").each(function(t,e){var a=jQuery(e).find("h3").first().html(),r=jQuery(".updraft_migrate_intro"),n=jQuery('<button class="button button-primary button-hero" />').html(a).appendTo(r);n.on("click",function(t){t.preventDefault(),jQuery(e).show(),r.hide()})})}function updraft_backupnow_inpage_go(t,e,a,r,n,o,u){r="undefined"==typeof r?0:r,n="undefined"==typeof n?0:n,o="undefined"==typeof o?0:o,u="undefined"==typeof u?updraftlion.automaticbackupbeforeupdate:u,updraft_console_focussed_tab="backups",updraft_inpage_success_callback=t,updraft_activejobs_update_timer=setInterval(function(){updraft_activejobs_update(!1)},1250);var d={},s=jQuery("#updraft-backupnow-inpage-modal").length;s&&jQuery("#updraft-backupnow-inpage-modal").dialog("option","buttons",d),jQuery("#updraft_inpage_prebackup").hide(),s&&jQuery("#updraft-backupnow-inpage-modal").dialog("open"),jQuery("#updraft_inpage_backup").show(),updraft_activejobslist_backupnownonce_only=1,updraft_inpage_hasbegun=0,updraft_backupnow_go(r,n,o,e,a,u,"")}function updraft_get_downloaders(){var t="";return jQuery(".ud_downloadstatus .updraftplus_downloader, #ud_downloadstatus2 .updraftplus_downloader").each(function(e,a){var r=jQuery(a).data("downloaderfor");"object"==typeof r&&(""!=t&&(t+=":"),t=t+r.base+","+r.nonce+","+r.what+","+r.index)}),t}function updraft_poll_get_parameters(){var t={downloaders:updraft_get_downloaders()};try{jQuery("#updraft-poplog").dialog("isOpen")&&(t.log_fetch=1,t.log_nonce=updraft_poplog_log_nonce,t.log_pointer=updraft_poplog_log_pointer)}catch(e){console.log(e)}return updraft_activejobslist_backupnownonce_only&&"undefined"!=typeof updraft_backupnow_nonce&&""!=updraft_backupnow_nonce&&(t.thisjobonly=updraft_backupnow_nonce),t}function updraft_activejobs_update(t){var e=(jQuery,(new Date).getTime());if(!(0==t&&e<updraft_activejobs_nextupdate)){updraft_activejobs_nextupdate=e+5500;var a=updraft_poll_get_parameters();updraft_send_command("activejobs_list",a,function(t,e,r){updraft_process_status_check(t,r,a)},{type:"GET",error_callback:function(t,e,a,r){if("undefined"!=typeof r&&r.hasOwnProperty("fatal_error"))console.error(r.fatal_error_message),!0===updraftplus_activejobs_list_fatal_error_alert&&(updraftplus_activejobs_list_fatal_error_alert=!1,alert(this.alert_done+" "+r.fatal_error_message));else{var n=e==a?a:a+" ("+e+")";console.error(n),console.log(t)}return!1}})}}function updraft_show_success_modal(t){"string"==typeof t&&(t={message:t});var e=jQuery.extend({icon:"yes",close:updraftlion.close,message:"",classes:"success"},t);jQuery.blockUI({css:{width:"300px",border:"none","border-radius":"10px",left:"calc(50% - 150px)"},message:'<div class="updraft_success_popup '+e.classes+'"><span class="dashicons dashicons-'+e.icon+'"></span><div class="updraft_success_popup--message">'+e.message+'</div><button class="button updraft-close-overlay"><span class="dashicons dashicons-no-alt"></span>'+e.close+"</button></div>"}),setTimeout(jQuery.unblockUI,5e3),jQuery(".blockUI .updraft-close-overlay").on("click",function(){jQuery.unblockUI()})}function updraft_popuplog(t){var e=updraftlion.loading_log_file;t&&(e+=" (log."+t+".txt)"),jQuery("#updraft-poplog").dialog("option","title",e),jQuery("#updraft-poplog-content").html("<em>"+e+" ...</em> "),jQuery("#updraft-poplog").dialog("open"),updraft_send_command("get_log",t,function(t){updraft_poplog_log_pointer=t.pointer,updraft_poplog_log_nonce=t.nonce;var e="?page=updraftplus&action=downloadlog&force_download=1&updraftplus_backup_nonce="+t.nonce;jQuery("#updraft-poplog-content").html(t.log);var a={};a[updraftlion.downloadlogfile]=function(){window.location.href=e},a[updraftlion.close]=function(){jQuery(this).dialog("close")},jQuery("#updraft-poplog").dialog("option","buttons",a),jQuery("#updraft-poplog").dialog("option","title","log."+t.nonce+".txt"),updraft_poplog_lastscroll=-1},{type:"GET",timeout:6e4,error_callback:function(t,e,a,r){if("undefined"!=typeof r&&r.hasOwnProperty("fatal_error"))console.error(r.fatal_error_message),jQuery("#updraft-poplog-content").append(r.fatal_error_message);else{var n=e==a?a:a+" ("+e+")";jQuery("#updraft-poplog-content").append(n),console.log(t)}}})}function updraft_showlastbackup(){updraft_send_command("get_fragment","last_backup_html",function(t){response=t.output,lastbackup_laststatus==response?setTimeout(function(){updraft_showlastbackup()},7e3):jQuery("#updraft_last_backup").html(response),lastbackup_laststatus=response},{type:"GET"})}function updraft_historytimertoggle(t){updraft_historytimer&&1!=t?(clearTimeout(updraft_historytimer),updraft_historytimer=0):(updraft_updatehistory(0,0),updraft_historytimer=setInterval(function(){updraft_updatehistory(0,0)},3e4),calculated_diskspace||(updraftplus_diskspace(),calculated_diskspace=1))}function updraft_updatehistory(t,e,a){"undefined"==typeof a&&(a=jQuery("#updraft_debug_mode").is(":checked")?1:0);var r=Math.round((new Date).getTime()/1e3);if(1==t||1==e)updraft_historytimer_notbefore=r+30;else if(r<updraft_historytimer_notbefore)return void console.log("Update history skipped: "+r.toString()+" < "+updraft_historytimer_notbefore.toString());1==t&&(1==e?(updraft_history_lastchecksum=!1,jQuery("#updraft-navtab-backups-content .updraft_existing_backups").html('<p style="text-align:center;"><em>'+updraftlion.rescanningremote+"</em></p>")):(updraft_history_lastchecksum=!1,jQuery("#updraft-navtab-backups-content .updraft_existing_backups").html('<p style="text-align:center;"><em>'+updraftlion.rescanning+"</em></p>")));var n=e?"remotescan":!!t&&"rescan",o={operation:n,debug:a};updraft_send_command("rescan",o,function(t){if(t.hasOwnProperty("logs_exist")&&t.logs_exist&&jQuery("#updraft_lastlogmessagerow .updraft-log-link").show(),t.hasOwnProperty("migrate_tab")&&t.migrate_tab&&(jQuery("#updraft-navtab-migrate").hasClass("nav-tab-active")||(jQuery("#updraft_migrate_tab_alt").html(""),jQuery("#updraft_migrate").replaceWith(jQuery(t.migrate_tab).find("#updraft_migrate")),setup_migrate_tabs())),t.hasOwnProperty("web_server_disk_space")&&(""==t.web_server_disk_space?(console.log("UpdraftPlus: web_server_disk_space is empty"),jQuery("#updraft-navtab-backups-content .updraft-server-disk-space").length&&jQuery("#updraft-navtab-backups-content .updraft-server-disk-space").slideUp("slow",function(){jQuery(this).remove()})):jQuery("#updraft-navtab-backups-content .updraft-server-disk-space").length?jQuery("#updraft-navtab-backups-content .updraft-server-disk-space").replaceWith(t.web_server_disk_space):jQuery("#updraft-navtab-backups-content .updraft-disk-space-actions").prepend(t.web_server_disk_space)),update_backupnow_modal(t),t.hasOwnProperty("backupnow_file_entities")&&(impossible_increment_entities=t.backupnow_file_entities),null!=t.n&&jQuery("#updraft-existing-backups-heading").html(t.n),null!=t.t){if(null!=t.cksum){if(t.cksum==updraft_history_lastchecksum)return;updraft_history_lastchecksum=t.cksum}jQuery("#updraft-navtab-backups-content .updraft_existing_backups").html(t.t),updraft_backups_selection.checkSelectionStatus(),t.data&&console.log(t.data)}})}function update_backupnow_modal(t){t.hasOwnProperty("modal_afterfileoptions")&&jQuery(".backupnow_modal_afterfileoptions").html(t.modal_afterfileoptions)}function updraft_exclude_entity_update(t){var e=[];jQuery("#updraft_include_"+t+"_exclude_container .updraft_exclude_entity_wrapper .updraft_exclude_entity_field").each(function(){var t=jQuery.trim(jQuery(this).data("val"));""!=t&&e.push(t)}),jQuery("#updraft_include_"+t+"_exclude").val(e.join(","))}function updraft_is_unique_exclude_rule(t,e){return existing_exclude_rules_str=jQuery("#updraft_include_"+e+"_exclude").val(),existing_exclude_rules=existing_exclude_rules_str.split(","),!(jQuery.inArray(t,existing_exclude_rules)>-1)||(alert(updraftlion.duplicate_exclude_rule_error_msg),!1)}function updraft_intervals_monthly_or_not(t,e){var a="#updraft-navtab-settings-content #"+t,r=jQuery(a+" option").length,n="monthly"==e,o=!1;if(r>10&&(o=!0),n||o){if(n&&o)return void("monthly"==e&&(jQuery(".updraft_monthly_extra_words_"+t).remove(),jQuery(a).before('<span class="updraft_monthly_extra_words_'+t+'">'+updraftlion.day+" </span>").after('<span class="updraft_monthly_extra_words_'+t+'"> '+updraftlion.inthemonth+" </span>")));if(jQuery(".updraft_monthly_extra_words_"+t).remove(),n){updraft_interval_week_val=jQuery(a+" option:selected").val(),jQuery(a).html(updraftlion.mdayselector).before('<span class="updraft_monthly_extra_words_'+t+'">'+updraftlion.day+" </span>").after('<span class="updraft_monthly_extra_words_'+t+'"> '+updraftlion.inthemonth+" </span>");var u=updraft_interval_month_val===!1?1:updraft_interval_month_val;u-=1,jQuery(a+" option:eq("+u+")").prop("selected",!0)}else{updraft_interval_month_val=jQuery(a+" option:selected").val(),jQuery(a).html(updraftlion.dayselector);var d=updraft_interval_week_val===!1?1:updraft_interval_week_val;jQuery(a+" option:eq("+d+")").prop("selected",!0)}}}function updraft_check_same_times(){var t=0,e=jQuery("#updraft-navtab-settings-content .updraft_interval").val();"manual"==e?jQuery("#updraft-navtab-settings-content .updraft_files_timings").hide():jQuery("#updraft-navtab-settings-content .updraft_files_timings").show(),"weekly"==e||"fortnightly"==e||"monthly"==e?(updraft_intervals_monthly_or_not("updraft_startday_files",e),jQuery("#updraft-navtab-settings-content #updraft_startday_files").show()):(jQuery(".updraft_monthly_extra_words_updraft_startday_files").remove(),jQuery("#updraft-navtab-settings-content #updraft_startday_files").hide());var a=jQuery("#updraft-navtab-settings-content .updraft_interval_database").val();"manual"==a&&(t=1,jQuery("#updraft-navtab-settings-content .updraft_db_timings").hide()),"weekly"==a||"fortnightly"==a||"monthly"==a?(updraft_intervals_monthly_or_not("updraft_startday_db",a),jQuery("#updraft-navtab-settings-content #updraft_startday_db").show()):(jQuery(".updraft_monthly_extra_words_updraft_startday_db").remove(),jQuery("#updraft-navtab-settings-content #updraft_startday_db").hide()),a==e?(jQuery("#updraft-navtab-settings-content .updraft_db_timings").hide(),0==t?jQuery("#updraft-navtab-settings-content .updraft_same_schedules_message").show():jQuery("#updraft-navtab-settings-content .updraft_same_schedules_message").hide()):(jQuery("#updraft-navtab-settings-content .updraft_same_schedules_message").hide(),0==t&&jQuery("#updraft-navtab-settings-content .updraft_db_timings").show())}function updraft_activejobs_delete(t){updraft_aborted_jobs[t]=1,jQuery("#updraft-jobid-"+t).closest(".updraft_row").addClass("deleting"),updraft_send_command("activejobs_delete",t,function(e){var a=jQuery("#updraft-jobid-"+t).closest(".updraft_row");a.addClass("deleting"),"Y"==e.ok?(jQuery("#updraft-jobid-"+t).html(e.m),a.remove(),jQuery("#updraft-backupnow-inpage-modal").dialog("isOpen")&&jQuery("#updraft-backupnow-inpage-modal").dialog("close"),updraft_show_success_modal({message:updraft_active_job_is_clone(t)?updraftlion.clone_backup_aborted:updraftlion.backup_aborted,icon:"no-alt",classes:"warning"})):"N"==e.ok?(a.removeClass("deleting"),alert(e.m)):(a.removeClass("deleting"),alert(updraftlion.unexpectedresponse),console.log(e))})}function updraftplus_diskspace_entity(t){jQuery("#updraft_diskspaceused_"+t).html("<em>"+updraftlion.calculating+"</em>"),updraft_send_command("get_fragment",{fragment:"disk_usage",data:t},function(e){jQuery("#updraft_diskspaceused_"+t).html(e.output)},{type:"GET"})}function updraft_active_job_is_clone(t){return updraft_clone_jobs.filter(function(e){return e==t}).length}function updraft_iframe_modal(t,e){var a=780,r=500;jQuery("#updraft-iframe-modal-innards").html('<iframe width="100%" height="430px" src="'+ajaxurl+"?action=updraft_ajax&subaction="+t+"&nonce="+updraft_credentialtest_nonce+'"></iframe>'),jQuery("#updraft-iframe-modal").dialog("option","title",e).dialog("option","width",a).dialog("option","height",r).dialog("open")}function updraft_html_modal(t,e,a,r){jQuery("#updraft-iframe-modal-innards").html(t);var n={};a<450&&(n[updraftlion.close]=function(){jQuery(this).dialog("close")}),jQuery("#updraft-iframe-modal").dialog("option","title",e).dialog("option","width",a).dialog("option","height",r).dialog("option","buttons",n).dialog("open")}function updraftplus_diskspace(){jQuery("#updraft-navtab-backups-content .updraft_diskspaceused").html("<em>"+updraftlion.calculating+"</em>"),updraft_send_command("get_fragment",{fragment:"disk_usage",data:"updraft"},function(t){jQuery("#updraft-navtab-backups-content .updraft_diskspaceused").html(t.output)},{type:"GET"})}function updraftplus_deletefromserver(t,e,a){a||(a=0);var r={stage:"delete",timestamp:t,type:e,findex:a};updraft_send_command("updraft_download_backup",r,null,{action:"updraft_download_backup",nonce:updraft_download_nonce,nonce_key:"_wpnonce"})}function updraftplus_downloadstage2(t,e,a){location.href=ajaxurl+"?_wpnonce="+updraft_download_nonce+"&timestamp="+t+"&type="+e+"&stage=2&findex="+a+"&action=updraft_download_backup"}function updraftplus_show_contents(t,e,a){var r='<div id="updraft_zip_files_container" class="hidden-in-updraftcentral" style="clear:left;"><div id="updraft_zip_info_container" class="updraft_jstree_info_container"><p><span id="updraft_zip_path_text">'+updraftlion.zip_file_contents_info+'</span> - <span id="updraft_zip_size_text"></span></p>'+updraftlion.browse_download_link+'</div><div id="updraft_zip_files_jstree_container"><input type="search" id="zip_files_jstree_search" name="zip_files_jstree_search" placeholder="'+updraftlion.search+'"><div id="updraft_zip_files_jstree" class="updraft_jstree"></div></div></div>';updraft_html_modal(r,updraftlion.zip_file_contents,780,500),zip_files_jstree("zipbrowser",t,e,a)}function zip_files_jstree(t,e,a,r){jQuery("#updraft_zip_files_jstree").jstree({core:{multiple:!1,data:function(n,o){updraft_send_command("get_jstree_directory_nodes",{entity:t,node:n,timestamp:e,type:a,findex:r},function(t){t.hasOwnProperty("error")?alert(t.error):o.call(this,t.nodes)},{error_callback:function(t,e,a,r){if("undefined"!=typeof r&&r.hasOwnProperty("fatal_error"))console.error(r.fatal_error_message),jQuery("#updraft_zip_files_jstree").html('<p style="color:red; margin: 5px;">'+r.fatal_error_message+"</p>"),alert(r.fatal_error_message);else{var n="updraft_send_command: error: "+e+" ("+a+")";jQuery("#updraft_zip_files_jstree").html('<p style="color:red; margin: 5px;">'+n+"</p>"),console.log(n),alert(n),console.log(t)}}})},error:function(t){alert(t),console.log(t)}},search:{show_only_matches:!0},plugins:["search","sort"]}),jQuery("#updraft_zip_files_jstree").on("ready.jstree",function(t,e){jQuery("#updraft-iframe-modal").dialog("option","title",updraftlion.zip_file_contents+": "+e.instance.get_node("#").children[0])});var n=!1;jQuery("#zip_files_jstree_search").keyup(function(){n&&clearTimeout(n),n=setTimeout(function(){var t=jQuery("#zip_files_jstree_search").val();jQuery("#updraft_zip_files_jstree").jstree(!0).search(t)},250)}),jQuery("#updraft_zip_files_jstree").on("changed.jstree",function(t,e){jQuery("#updraft_zip_path_text").text(e.node.li_attr.path),e.node.li_attr.size?(jQuery("#updraft_zip_size_text").text(e.node.li_attr.size),jQuery("#updraft_zip_download_item").show()):(jQuery("#updraft_zip_size_text").text(""),jQuery("#updraft_zip_download_item").hide())}),jQuery("#updraft_zip_download_item").click(function(t){t.preventDefault();var n=jQuery("#updraft_zip_path_text").text();updraft_send_command("get_zipfile_download",{path:n,timestamp:e,type:a,findex:r},function(t){t.hasOwnProperty("error")?alert(t.error):t.hasOwnProperty("path")?location.href=ajaxurl+"?_wpnonce="+updraft_download_nonce+"&timestamp="+e+"&type="+a+"&stage=2&findex="+r+"&filepath="+t.path+"&action=updraft_download_backup":alert(updraftlion.download_timeout)},{error_callback:function(t,e,a,r){if("undefined"!=typeof r&&r.hasOwnProperty("fatal_error"))console.error(r.fatal_error_message),alert(r.fatal_error_message);else{var n="updraft_send_command: error: "+e+" ("+a+")";console.log(n),alert(n),console.log(t)}}})})}function remove_updraft_downloader(t,e){jQuery(t).closest(".updraftplus_downloader").fadeOut().remove(),0==jQuery(".updraftplus_downloader_container_"+e+" .updraftplus_downloader").length&&jQuery(".updraftplus_downloader_container_"+e).remove()}function updraft_downloader(t,e,a,r,n,o,u){"string"!=typeof n&&(n=n.toString()),jQuery(".ud_downloadstatus").show();var n=n.split(","),d=o?o:e,s=jQuery("#updraft-navtab-backups-content .uddownloadform_"+a+"_"+e+"_"+n[0]).data("wp_nonce").toString();jQuery(".updraftplus_downloader_container_"+a).length||(jQuery(r).append('<div class="updraftplus_downloader_container_'+a+' postbox"></div>'),jQuery(".updraftplus_downloader_container_"+a).append('<strong style="clear:left; padding: 8px; margin-top: 4px;">'+updraftlion.download+" "+a+" ("+d+"):</strong>"));for(var i=0;i<n.length;i++){var l=t+e+"_"+a+"_"+n[i],p="."+l,_=parseInt(n[i]);_++;var c=0==n[i]?"":" ("+_+")";jQuery(p).length||(jQuery(".updraftplus_downloader_container_"+a).append('<div style="clear:left; padding: 8px; margin-top: 4px;" class="'+l+' updraftplus_downloader"><button onclick="remove_updraft_downloader(this, \''+a+'\');" type="button" style="float:right; margin-bottom: 8px;" class="ud_downloadstatus__close" aria-label="Close"><span class="dashicons dashicons-no-alt"></span></button><strong>'+a+c+'</strong>:<div class="raw">'+updraftlion.begunlooking+'</div><div class="file '+l+'_st"><div class="dlfileprogress" style="width: 0;"></div></div></div>'),jQuery(p).data("downloaderfor",{base:t,nonce:e,what:a,index:n[i]}),setTimeout(function(){updraft_activejobs_update(!0)},1500)),jQuery(p).data("lasttimebegan",(new Date).getTime())}u=!!u;var f={type:a,timestamp:e,findex:n},m={action:"updraft_download_backup",nonce_key:"_wpnonce",nonce:s,timeout:1e4,async:u};return updraft_send_command("updraft_download_backup",f,function(t){},m),!1}function ud_parse_json(t){t.charAt(0),t.charAt(t.length-1);try{var e=JSON.parse(t);return e}catch(a){console.log("UpdraftPlus: Exception when trying to parse JSON (1) - will attempt to fix/re-parse based upon first/last curly brackets"),console.log(t)}var r=t.indexOf("{"),n=t.lastIndexOf("}");if(r>-1&&n>-1){var o=t.slice(r,n+1);try{var u=JSON.parse(o);return console.log("UpdraftPlus: JSON re-parse successful"),u}catch(a){console.log("UpdraftPlus: Exception when trying to parse JSON (2) - will attempt to fix/re-parse based upon bracket counting");for(var d=r,s=0,i="",l=!1;(s>0||d==r)&&d<=n;){var p=t.charAt(d);l||"{"!=p?l||"}"!=p?'"'==p&&"\\"!=i&&(l=!l):s--:s++,i=p,d++}console.log("Started at cursor="+r+", ended at cursor="+d+" with result following:"),console.log(t.substring(r,d));try{var u=JSON.parse(t.substring(r,d));return console.log("UpdraftPlus: JSON re-parse successful"),u}catch(a){throw a}}}throw"UpdraftPlus: could not parse the JSON"}function updraft_restorer_checkstage2(t){var e=jQuery("#ud_downloadstatus2 .file").length;return e>0?void(t&&alert(updraftlion.stilldownloading)):(jQuery("#updraft-restore-modal-stage2a").html(updraftlion.processing),void updraft_send_command("restore_alldownloaded",{timestamp:jQuery("#updraft_restore_timestamp").val(),restoreopts:jQuery("#updraft_restore_form").serialize()},function(t,e,a){var r=null;jQuery("#updraft_restorer_restore_options").val("");try{if(null==t)return void jQuery("#updraft-restore-modal-stage2a").html(updraftlion.emptyresponse);var n=t.m;if(""!=t.w&&(n=n+"<p><strong>"+updraftlion.warnings+"</strong><br>"+t.w+"</p>"),""!=t.e?n=n+"<p><strong>"+updraftlion.errors+"</strong><br>"+t.e+"</p>":updraft_restore_stage=3,t.hasOwnProperty("i")){try{if(r=ud_parse_json(t.i),r.hasOwnProperty("addui")){console.log("Further UI options are being displayed");var o=r.addui;n+='<div id="updraft_restoreoptions_ui" style="clear:left; padding-top:10px;">'+o+"</div>","object"==typeof JSON&&"function"==typeof JSON.stringify&&(delete r.addui,t.i=JSON.stringify(r))}}catch(u){console.log(u),console.log(t)}jQuery("#updraft_restorer_backup_info").val(t.i)}else jQuery("#updraft_restorer_backup_info").val();jQuery("#updraft-restore-modal-stage2a").html(n),jQuery("#updraft-restore-modal-stage2a .updraft_select2").length>0&&jQuery("#updraft-restore-modal-stage2a .updraft_select2").select2()}catch(u){console.log(a),console.log(u),jQuery("#updraft-restore-modal-stage2a").text(updraftlion.jsonnotunderstood+" "+updraftlion.errordata+": "+a).html()}},{error_callback:function(t,e,a,r){if("undefined"!=typeof r&&r.hasOwnProperty("fatal_error"))console.error(r.fatal_error_message),jQuery("#updraft-restore-modal-stage2a").html('<p style="color: red;">'+r.fatal_error_message+"</p>"),alert(r.fatal_error_message);else{var n="updraft_send_command: error: "+e+" ("+a+")";jQuery("#updraft-restore-modal-stage2a").html('<p style="color: red;">'+n+"</p>"),console.log(n),alert(n),console.log(t)}}}))}function updraft_downloader_status(t,e,a,r){}function updraft_downloader_status_update(t,e){var a=0;return jQuery(t).each(function(t,r){if(""!=r.base){var n=r.base+r.timestamp+"_"+r.what+"_"+r.findex,o="."+n;if(null!=r.e)jQuery(o+" .raw").html("<strong>"+updraftlion.error+"</strong> "+r.e),console.log(r);else if(null!=r.p){if(jQuery(o+"_st .dlfileprogress").width(r.p+"%"),null!=r.a&&r.a>0){var u=(new Date).getTime(),d=jQuery(o).data("lasttimebegan"),s=u-d;if(r.a>90&&s>6e4){console.log(r.timestamp+" "+r.what+" "+r.findex+": restarting download: file_age="+r.a+", sincelastrestart_ms="+s),jQuery(o).data("lasttimebegan",(new Date).getTime());var i=jQuery("#updraft-navtab-backups-content .uddownloadform_"+r.what+"_"+r.timestamp+"_"+r.findex),l={type:r.what,timestamp:r.timestamp,findex:r.findex},p={action:"updraft_download_backup",nonce_key:"_wpnonce",
2
+ nonce:i.data("wp_nonce").toString(),timeout:1e4};updraft_send_command("updraft_download_backup",l,function(t){},p),jQuery(o).data("lasttimebegan",(new Date).getTime())}}if(null!=r.m)if(r.p>=100&&"udrestoredlstatus_"==r.base)jQuery(o+" .raw").html(r.m),jQuery(o).fadeOut("slow",function(){remove_updraft_downloader(this,r.what),updraft_restorer_checkstage2(0)});else if(r.p<100||"uddlstatus_"!=r.base)jQuery(o+" .raw").html(r.m);else{var _=updraftlion.fileready+" "+updraftlion.actions+': \t\t\t\t<button class="button" type="button" onclick="updraftplus_downloadstage2(\''+r.timestamp+"', '"+r.what+"', '"+r.findex+"')\">"+updraftlion.downloadtocomputer+'</button> \t\t\t\t<button class="button" id="uddownloaddelete_'+r.timestamp+"_"+r.what+'" type="button" onclick="updraftplus_deletefromserver(\''+r.timestamp+"', '"+r.what+"', '"+r.findex+"')\">"+updraftlion.deletefromserver+"</button>";r.hasOwnProperty("can_show_contents")&&r.can_show_contents&&(_+=' <button class="button" type="button" onclick="updraftplus_show_contents(\''+r.timestamp+"', '"+r.what+"', '"+r.findex+"')\">"+updraftlion.browse_contents+"</button>"),jQuery(o+" .raw").html(_),jQuery(o+"_st").remove()}}else null!=r.m?jQuery(o+" .raw").html(r.m):(jQuery(o+" .raw").html(updraftlion.jsonnotunderstood+" ("+e+")"),a=1)}}),a}function updraft_backupnow_go(t,e,a,r,n,o,u){var d={backupnow_nodb:t,backupnow_nofiles:e,backupnow_nocloud:a,backupnow_label:o,extradata:n};if(""!=r&&(d.onlythisfileentity=r),""!=u&&(d.onlythesetableentities=u),d.always_keep="undefined"!=typeof n.always_keep?n.always_keep:0,delete n.always_keep,d.incremental="undefined"!=typeof n.incremental?n.incremental:0,delete n.incremental,!jQuery(".updraft_requeststart").length){var s=jQuery('<div class="updraft_requeststart" />').html('<span class="spinner"></span>'+updraftlion.requeststart);s.data("remove",!1),setTimeout(function(){s.data("remove",!0)},3e3),setTimeout(function(){s.remove()},75e3),jQuery("#updraft_activejobsrow").before(s)}updraft_activejobslist_backupnownonce_only=1,updraft_send_command("backupnow",d,function(t){return t.hasOwnProperty("error")?(jQuery(".updraft_requeststart").remove(),void alert(t.error)):(jQuery("#updraft_backup_started").html(t.m),t.hasOwnProperty("nonce")&&(updraft_backupnow_nonce=t.nonce,console.log("UpdraftPlus: ID of started job: "+updraft_backupnow_nonce)),void setTimeout(function(){updraft_activejobs_update(!0)},500))})}function updraft_process_status_check(t,e,a){if(t.hasOwnProperty("fatal_error"))return console.error(t.fatal_error_message),void(!0===updraftplus_activejobs_list_fatal_error_alert&&(updraftplus_activejobs_list_fatal_error_alert=!1,alert(this.alert_done+" "+t.fatal_error_message)));try{t.hasOwnProperty("l")&&(t.l?(jQuery("#updraft_lastlogmessagerow").show(),jQuery("#updraft_lastlogcontainer").html(t.l)):(jQuery("#updraft_lastlogmessagerow").hide(),jQuery("#updraft_lastlogcontainer").html("("+updraftlion.nothing_yet_logged+")")));var r=-1,n=jQuery(".updraft_requeststart");t.j&&n.length&&n.data("remove")&&n.remove();var o=jQuery(t.j);o.find(".updraft_jobtimings").each(function(t,e){var a=jQuery(e);if(a.data("jobid")){var r=a.data("jobid"),n=a.closest(".updraft_row");updraft_aborted_jobs[r]&&n.hide()}}),jQuery("#updraft_activejobsrow").html(o);var u=o.find('.job-id[data-isclone="1"]');if(u.length>0){if(0==jQuery(".updraftclone_action_box .updraftclone_network_info").length&&jQuery("#updraft_activejobsrow .job-id .updraft_clone_url").length>0){var d=jQuery("#updraft_activejobsrow .job-id .updraft_clone_url").data("clone_url");updraft_send_command("get_clone_network_info",{clone_url:d},function(t){t.hasOwnProperty("html")&&jQuery(".updraftclone_action_box").html(t.html)})}jQuery("#updraft_clone_activejobsrow").empty(),u.each(function(t,e){var a=jQuery(e);a.closest(".updraft_row").appendTo(jQuery("#updraft_clone_activejobsrow"))})}if(jQuery("#updraft_activejobs .updraft_jobtimings").each(function(t,e){var a=jQuery(e);if(a.data("lastactivity")&&a.data("jobid")){var n=a.data("jobid"),o=a.data("lastactivity");(r==-1||o<r)&&(r=o);var u=a.data("nextresumptionafter"),d=a.data("nextresumption");timenow=(new Date).getTime(),o>50&&d>0&&u<-30&&timenow>updraft_last_forced_when+1e5&&(updraft_last_forced_jobid!=n||d!=updraft_last_forced_resumption)&&(updraft_last_forced_resumption=d,updraft_last_forced_jobid=n,updraft_last_forced_when=timenow,console.log("UpdraftPlus: force resumption: job_id="+n+", resumption="+d),updraft_send_command("forcescheduledresumption",{resumption:d,job_id:n},function(t){console.log(t)},{json_parse:!1,alert_on_error:!1}))}}),timenow=(new Date).getTime(),updraft_activejobs_nextupdate=timenow+18e4,1==updraft_page_is_visible&&"backups"==updraft_console_focussed_tab&&(updraft_activejobs_nextupdate=r>-1?r<5?timenow+1750:timenow+5e3:lastlog_lastdata==e?timenow+7500:timenow+1750),u.length>0&&(updraft_activejobs_nextupdate=timenow+6e3),lastlog_lastdata=e,null!=t.j&&""!=t.j){if(jQuery("#updraft_activejobsrow").show(),u.length>0&&jQuery("#updraft_clone_activejobsrow").show(),a.hasOwnProperty("thisjobonly")&&!updraft_inpage_hasbegun&&jQuery("#updraft-jobid-"+a.thisjobonly).length?(updraft_inpage_hasbegun=1,console.log("UpdraftPlus: the start of the requested backup job has been detected")):!updraft_inpage_hasbegun&&updraft_activejobslist_backupnownonce_only&&jQuery(".updraft_jobtimings.isautobackup").length?(autobackup_nonce=jQuery(".updraft_jobtimings.isautobackup").first().data("jobid"),autobackup_nonce&&(updraft_inpage_hasbegun=1,updraft_backupnow_nonce=autobackup_nonce,a.thisjobonly=autobackup_nonce,console.log("UpdraftPlus: the start of the requested backup job has been detected; id: "+autobackup_nonce))):1==updraft_inpage_hasbegun&&jQuery("#updraft-jobid-"+a.thisjobonly+".updraft_finished").length&&(updraft_inpage_hasbegun=2,console.log("UpdraftPlus: the end of the requested backup job has been detected"),updraft_activejobs_update_timer&&clearInterval(updraft_activejobs_update_timer),"undefined"!=typeof updraft_inpage_success_callback&&""!=updraft_inpage_success_callback?updraft_inpage_success_callback.call(!1):jQuery("#updraft-backupnow-inpage-modal").dialog("close")),""==lastlog_jobs&&setTimeout(function(){jQuery("#updraft_backup_started").slideUp()},3500),a.hasOwnProperty("thisjobonly")&&updraft_backupnow_nonce&&a.thisjobonly===updraft_backupnow_nonce){jQuery(".updraft_requeststart").remove();var s=jQuery("#updraft-jobid-"+updraft_backupnow_nonce);s.is(".updraft_finished")&&(updraft_activejobslist_backupnownonce_only=0,updraft_aborted_jobs[updraft_backupnow_nonce]?updraft_aborted_jobs=updraft_aborted_jobs.filter(function(t,e){return t!=updraft_backupnow_nonce}):updraft_active_job_is_clone(updraft_backupnow_nonce)?(updraft_show_success_modal(updraftlion.clone_backup_complete),updraft_clone_jobs=updraft_clone_jobs.filter(function(t){return t!=updraft_backupnow_nonce})):updraft_show_success_modal(updraftlion.backup_complete),updraft_backupnow_nonce="",updraft_activejobs_update(!0))}}else jQuery("#updraft_activejobsrow").is(":hidden")||("undefined"!=typeof lastbackup_laststatus&&updraft_showlastbackup(),updraft_updatehistory(0,0),jQuery("#updraft_activejobsrow").hide());if(lastlog_jobs=t.j,null!=t.ds&&""!=t.ds&&updraft_downloader_status_update(t.ds,e),null!=t.u&&""!=t.u&&jQuery("#updraft-poplog").dialog("isOpen")){var i=t.u;if(i.nonce==updraft_poplog_log_nonce&&(updraft_poplog_log_pointer=i.pointer,null!=i.log&&""!=i.log)){var l=jQuery("#updraft-poplog").scrollTop();jQuery("#updraft-poplog-content").append(i.log),updraft_poplog_lastscroll!=l&&updraft_poplog_lastscroll!=-1||(jQuery("#updraft-poplog").scrollTop(jQuery("#updraft-poplog-content").prop("scrollHeight")),updraft_poplog_lastscroll=jQuery("#updraft-poplog").scrollTop())}}}catch(p){console.log(updraftlion.unexpectedresponse+" "+e),console.log(p)}}var onlythesefileentities=backupnow_whichfiles_checked("");""==onlythesefileentities?jQuery("#backupnow_includefiles_moreoptions").show():jQuery("#backupnow_includefiles_moreoptions").hide();var impossible_increment_entities,updraft_restore_stage=1,lastlog_lastmessage="",lastlog_lastdata="",lastlog_jobs="",updraft_activejobs_nextupdate=(new Date).getTime()+1e3,updraft_page_is_visible=1,updraft_console_focussed_tab=updraftlion.tab,updraft_settings_form_changed=!1;window.onbeforeunload=function(t){if(updraft_settings_form_changed)return updraftlion.unsavedsettings},"undefined"!=typeof document.hidden&&document.addEventListener("visibilitychange",function(){updraft_check_page_visibility(0)},!1),updraft_check_page_visibility(1);var updraft_poplog_log_nonce,updraft_poplog_log_pointer=0,updraft_poplog_lastscroll=-1,updraft_last_forced_jobid=-1,updraft_last_forced_resumption=-1,updraft_last_forced_when=-1,updraft_backupnow_nonce="",updraft_activejobslist_backupnownonce_only=0,updraft_inpage_hasbegun=0,updraft_activejobs_update_timer,updraft_aborted_jobs=[],updraft_clone_jobs=[],updraft_backups_selection={};!function(t){updraft_backups_selection.toggle=function(e){var a=t(e);a.is(".backuprowselected")?this.deselect(e):this.select(e)},updraft_backups_selection.select=function(e){t(e).addClass("backuprowselected"),t(e).find(".backup-select input").prop("checked",!0),this.checkSelectionStatus()},updraft_backups_selection.deselect=function(e){t(e).removeClass("backuprowselected"),t(e).find(".backup-select input").prop("checked",!1),this.checkSelectionStatus()},updraft_backups_selection.selectAll=function(){t("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row").each(function(t,e){updraft_backups_selection.select(e)})},updraft_backups_selection.deselectAll=function(){t("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row").each(function(t,e){updraft_backups_selection.deselect(e)})},updraft_backups_selection.checkSelectionStatus=function(){var e=t("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row").length,a=t("#updraft-navtab-backups-content .updraft_existing_backups .updraft_existing_backups_row.backuprowselected").length;a>0?(t("#ud_massactions").addClass("active"),t(".js--deselect-all-backups, .js--delete-selected-backups").prop("disabled",!1)):(t("#ud_massactions").removeClass("active"),t(".js--deselect-all-backups, .js--delete-selected-backups").prop("disabled",!0)),e===a?t("#cb-select-all").prop("checked",!0):t("#cb-select-all").prop("checked",!1),e?t("#ud_massactions").show():t("#ud_massactions").hide()}}(jQuery);var updraftplus_activejobs_list_fatal_error_alert=!0,updraft_historytimer=0,calculated_diskspace=0,updraft_historytimer_notbefore=0,updraft_history_lastchecksum=!1,updraft_interval_week_val=!1,updraft_interval_month_val=!1;"undefined"!=typeof updraft_siteurl&&setInterval(function(){jQuery.get(updraft_siteurl+"/wp-cron.php")},21e4);var lastlog_lastmessage="";jQuery(document).ajaxError(function(t,e,a,r){if(null!=r&&""!=r&&null!=e.responseText&&""!=e.responseText&&(console.log("Error caught by UpdraftPlus ajaxError handler (follows) for "+a.url),console.log(r),0==a.url.search(ajaxurl)))if(a.url.search("subaction=downloadstatus")>=0){var n=a.url.match(/timestamp=\d+/),o=a.url.match(/type=[a-z]+/),u=a.url.match(/findex=\d+/),d=a.url.match(/base=[a-z_]+/);if(u=u instanceof Array?parseInt(u[0].substr(7)):0,o=o instanceof Array?o[0].substr(5):"",d=d instanceof Array?d[0].substr(5):"",n=n instanceof Array?parseInt(n[0].substr(10)):0,""!=d&&""!=o&&n>0){var s=d+n+"_"+o+"_"+u;jQuery("."+s+" .raw").html("<strong>"+updraftlion.error+"</strong> "+updraftlion.servererrorcode)}}else a.url.search("subaction=restore_alldownloaded")>=0&&jQuery("#updraft-restore-modal-stage2a").append("<br><strong>"+updraftlion.error+"</strong> "+updraftlion.servererrorcode+": "+r)}),jQuery(document).ready(function(t){function e(e){t('.expertmode .advanced_settings_container .advanced_tools:not(".'+e+'")').hide(),t(".expertmode .advanced_settings_container .advanced_tools."+e).fadeIn("slow"),t(".expertmode .advanced_settings_container .advanced_tools_button:not(#"+e+")").removeClass("active"),t(".expertmode .advanced_settings_container .advanced_tools_button#"+e).addClass("active")}function a(e){t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login_status").html("").hide(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login .updraftplus_spinner.spinner").addClass("visible"),updraft_send_command("process_updraftplus_clone_login",e,function(e){try{if(t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login .updraftplus_spinner.spinner").removeClass("visible"),e.hasOwnProperty("status")&&"error"==e.status)return t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login_status").html(e.message).show(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 .tfa_fields").hide(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 .non_tfa_fields").show(),void t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_two_factor_code").val("");e.hasOwnProperty("tfa_enabled")&&1==e.tfa_enabled&&(t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 .non_tfa_fields").hide(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 .tfa_fields").show(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 input#temporary_clone_options_two_factor_code").focus()),"authenticated"===e.status&&(t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1").hide(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 .non_tfa_fields").show(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 .tfa_fields").hide(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1 input#temporary_clone_options_two_factor_code").val(""),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage2").show(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage2").html(e.html))}catch(a){console.log(a)}})}function r(e){t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key_status").html("").hide(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key .updraftplus_spinner.spinner").addClass("visible"),updraft_send_command("process_updraftplus_clone_login",e,function(e){try{if(t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key .updraftplus_spinner.spinner").removeClass("visible"),e.hasOwnProperty("status")&&"error"==e.status)return void t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key_status").html(e.message).show();"authenticated"===e.status&&(t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage1").hide(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage2").show(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage2").html(e.html))}catch(a){console.log(a)}})}function n(t,e,a,r){var n={updraftplus_clone_backup:1,backupnow_nodb:0,backupnow_nofiles:0,backupnow_nocloud:0,backupnow_label:"UpdraftPlus Clone",extradata:"",onlythisfileentity:"plugins,themes,uploads,others",clone_id:t,secret_token:e,clone_url:a,key:r};updraft_activejobslist_backupnownonce_only=1,updraft_send_command("backupnow",n,function(t){jQuery("#updraft_clone_progress .updraftplus_spinner.spinner").removeClass("visible"),jQuery("#updraft_backup_started").html(t.m),t.hasOwnProperty("nonce")&&(updraft_backupnow_nonce=t.nonce,updraft_clone_jobs.push(updraft_backupnow_nonce),updraft_inpage_success_callback=function(){jQuery("#updraft_clone_activejobsrow").hide(),updraft_aborted_jobs[updraft_backupnow_nonce]?jQuery("#updraft_clone_progress").html(updraftlion.clone_backup_aborted):jQuery("#updraft_clone_progress").html(updraftlion.clone_backup_complete)},console.log("UpdraftPlus: ID of started job: "+updraft_backupnow_nonce)),updraft_activejobs_update(!0)})}function o(t){var e=Handlebars.compile(updraftlion.remote_storage_templates[t]),a=updraftlion.remote_storage_options[t]["default"];a.instance_id="s-"+u(32),a.instance_enabled=1;var r=e(a);jQuery(r).hide().insertAfter("."+t+"_add_instance_container:first").show("slow")}function u(t){for(var e="",a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<t;r++)e+=a.charAt(Math.floor(Math.random()*a.length));return e}function d(t){var e=!!jQuery("#updraftcentral_mothership_other").is(":checked");e?(jQuery("#updraftcentral_keycreate_mothership").prop("disabled",!1),t?jQuery("#updraftcentral_keycreate_mothership_firewalled_container").show():(jQuery(".updraftcentral_wizard_self_hosted_stage2").show(),jQuery("#updraftcentral_keycreate_mothership_firewalled_container").slideDown(),jQuery("#updraftcentral_keycreate_mothership").focus())):(jQuery("#updraftcentral_keycreate_mothership").prop("disabled",!0),t||(jQuery(".updraftcentral_wizard_self_hosted_stage2").hide(),s()))}function s(){jQuery("#updraftcentral_wizard_stage1_error").text("");var t="";if(jQuery("#updraftcentral_mothership_updraftpluscom").is(":checked"))jQuery(".updraftcentral_keycreate_description").hide(),t="updraftplus.com";else if(jQuery("#updraftcentral_mothership_other").is(":checked")){jQuery(".updraftcentral_keycreate_description").show();var e=jQuery("#updraftcentral_keycreate_mothership").val();if(""==e)return void jQuery("#updraftcentral_wizard_stage1_error").text(updraftlion.updraftcentral_wizard_empty_url);try{var a=new URL(e);t=a.hostname}catch(r){if("undefined"==typeof URL&&(t=jQuery("<a>").prop("href",e).prop("hostname")),!t||"undefined"!=typeof URL)return void jQuery("#updraftcentral_wizard_stage1_error").text(updraftlion.updraftcentral_wizard_invalid_url)}}jQuery("#updraftcentral_keycreate_description").val(t),jQuery(".updraftcentral_wizard_stage1").hide(),jQuery(".updraftcentral_wizard_stage2").show()}function i(e,a,r,n){jQuery("#updraft-delete-modal").dialog("close");var o=e,u=a,d=r,s=n,l=jQuery("#updraft_delete_timestamp").val().split(","),p=jQuery("#updraft_delete_form").serializeArray(),_={};t.each(p,function(){void 0!==_[this.name]?(_[this.name].push||(_[this.name]=[_[this.name]]),_[this.name].push(this.value||"")):_[this.name]=this.value||""}),_.delete_remote?jQuery("#updraft-delete-waitwarning").find(".updraft-deleting-remote").show():jQuery("#updraft-delete-waitwarning").find(".updraft-deleting-remote").hide(),jQuery("#updraft-delete-waitwarning").slideDown().addClass("active"),_.remote_delete_limit=updraftlion.remote_delete_limit,delete _.action,delete _.subaction,delete _.nonce,updraft_send_command("deleteset",_,function(t){if(!t.hasOwnProperty("result")||null==t.result)return void jQuery("#updraft-delete-waitwarning").slideUp();if("error"==t.result)jQuery("#updraft-delete-waitwarning").slideUp(),alert(updraftlion.error+" "+t.message);else if("continue"==t.result){o=o+t.backup_local+t.backup_remote,u+=t.backup_local,d+=t.backup_remote,s+=t.backup_sets;for(var e=t.deleted_timestamps.split(","),a=0;a<e.length;a++){var r=e[a];jQuery("#updraft-navtab-backups-content .updraft_existing_backups_row_"+r).slideUp().remove()}jQuery("#updraft_delete_timestamp").val(t.timestamps),jQuery("#updraft-deleted-files-total").text(o+" "+updraftlion.remote_files_deleted),i(o,u,d,s)}else if("success"==t.result){setTimeout(function(){jQuery("#updraft-deleted-files-total").text(""),jQuery("#updraft-delete-waitwarning").slideUp()},500),update_backupnow_modal(t),t.hasOwnProperty("backupnow_file_entities")&&(impossible_increment_entities=t.backupnow_file_entities),t.hasOwnProperty("count_backups")&&jQuery("#updraft-existing-backups-heading").html(updraftlion.existing_backups+' <span class="updraft_existing_backups_count">'+t.count_backups+"</span>");for(var a=0;a<l.length;a++){var r=l[a];jQuery("#updraft-navtab-backups-content .updraft_existing_backups_row_"+r).slideUp().remove()}updraft_backups_selection.checkSelectionStatus(),updraft_history_lastchecksum=!1,u+=t.backup_local,d+=t.backup_remote,s+=t.backup_sets,setTimeout(function(){alert(t.set_message+" "+s+"\n"+t.local_message+" "+u+"\n"+t.remote_message+" "+d)},900)}})}function l(t,e){jQuery("#updraft-navtab-settings-content #updraft_include_"+t).is(":checked")?e?jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude_container").show():jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude_container").slideDown():e?jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude").hide():jQuery("#updraft-navtab-settings-content #updraft_include_"+t+"_exclude_container").slideUp()}function p(){var t=new plupload.Uploader(updraft_plupload_config);t.bind("Init",function(t){var e=jQuery("#plupload-upload-ui");t.features.dragdrop?(e.addClass("drag-drop"),jQuery("#drag-drop-area").bind("dragover.wp-uploader",function(){e.addClass("drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){e.removeClass("drag-over")})):(e.removeClass("drag-drop"),jQuery("#drag-drop-area").unbind(".wp-uploader"))}),t.init(),t.bind("FilesAdded",function(e,a){plupload.each(a,function(e){if(!/^backup_([\-0-9]{15})_.*_([0-9a-f]{12})-[\-a-z]+([0-9]+?)?(\.(zip|gz|gz\.crypt))?$/i.test(e.name)&&!/^log\.([0-9a-f]{12})\.txt$/.test(e.name)){for(var a=!1,r=0;r<updraft_accept_archivename.length;r++)if(updraft_accept_archivename[r].test(e.name))var a=!0;if(!a)return/\.(zip|tar|tar\.gz|tar\.bz2)$/i.test(e.name)||/\.sql(\.gz)?$/i.test(e.name)?(jQuery("#updraft-message-modal-innards").html("<p><strong>"+e.name+"</strong></p> "+updraftlion.notarchive2),jQuery("#updraft-message-modal").dialog("open")):alert(e.name+": "+updraftlion.notarchive),void t.removeFile(e)}jQuery("#filelist").append('<div class="file" id="'+e.id+'"><b>'+e.name+"</b> (<span>"+plupload.formatSize(0)+"</span>/"+plupload.formatSize(e.size)+') <div class="fileprogress"></div></div>')}),e.refresh(),e.start()}),t.bind("UploadProgress",function(t,e){jQuery("#"+e.id+" .fileprogress").width(e.percent+"%"),jQuery("#"+e.id+" span").html(plupload.formatSize(parseInt(e.size*e.percent/100))),e.size==e.loaded&&(jQuery("#"+e.id).html('<div class="file" id="'+e.id+'"><b>'+e.name+"</b> (<span>"+plupload.formatSize(parseInt(e.size*e.percent/100))+"</span>/"+plupload.formatSize(e.size)+") - "+updraftlion.complete+"</div>"),jQuery("#"+e.id+" .fileprogress").width(e.percent+"%"))}),t.bind("Error",function(t,e){console.log(e);var a;a="-200"==e.code?"\n"+updraftlion.makesure2:updraftlion.makesure;var r=updraftlion.uploaderr+" (code "+e.code+") : "+e.message;e.hasOwnProperty("status")&&e.status&&(r+=" ("+updraftlion.http_code+" "+e.status+")"),e.hasOwnProperty("response")&&(console.log("UpdraftPlus: plupload error: "+e.response),e.response.length<100&&(r+=" "+updraftlion.error+" "+e.response+"\n")),r+=" "+a,alert(r)}),t.bind("FileUploaded",function(t,e,a){if("200"==a.status)try{resp=ud_parse_json(a.response),resp.e?alert(updraftlion.uploaderror+" "+resp.e):resp.dm?(alert(resp.dm),updraft_updatehistory(1,0)):resp.m?updraft_updatehistory(1,0):alert("Unknown server response: "+a.response)}catch(r){console.log(a),alert(updraftlion.jsonnotunderstood)}else alert("Unknown server response status: "+a.code),console.log(a)})}function _(t){params={uri:jQuery("#updraftplus_httpget_uri").val()},params.curl=t,updraft_send_command("httpget",params,function(t){t.e&&alert(t.e),t.r?jQuery("#updraftplus_httpget_results").html("<pre>"+t.r+"</pre>"):console.log(t)},{type:"GET"})}function c(t,e,a){updraft_restore_setoptions(t),jQuery("#updraft_restore_timestamp").val(e),jQuery(".updraft_restore_date").html(a),updraft_restore_stage=1,jQuery("#updraft-restore-modal").dialog("open"),jQuery("#updraft-restore-modal-stage1").show(),jQuery("#updraft-restore-modal-stage2").hide(),jQuery("#updraft-restore-modal-stage2a").html(""),updraft_activejobs_update(!0)}function f(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e="[\\?&]"+t+"=([^&#]*)",a=new RegExp(e),r=a.exec(window.location.href);return null==r?"":decodeURIComponent(r[1].replace(/\+/g," "))}function m(e,a,r){jQuery("#updraft_upload_timestamp").val(e),jQuery("#updraft_upload_nonce").val(a);var n=r.split(",");jQuery(".updraft_remote_storage_destination").each(function(e){var a=jQuery(this).val();if(jQuery.inArray(a,n)==-1){jQuery(this).prop("checked",!1),jQuery(this).prop("disabled",!0);var r=t(this).prop("labels");jQuery(r).append(" "+updraftlion.already_uploaded)}}),jQuery("#updraft-upload-modal").dialog("open")}if(t(document).on("udp/checkout/done",function(e,a){a.hasOwnProperty("product")&&"updraftpremium"===a.product&&"complete"===a.status&&(t(".premium-upgrade-purchase-success").show(),t(".updraft_feat_table").closest("section").hide(),t(".updraft_premium_cta__action").hide())}),t(".expertmode .advanced_settings_container .advanced_tools_button").click(function(){e(t(this).attr("id"))}),jQuery.ui&&jQuery.ui.dialog&&jQuery.ui.dialog.prototype._allowInteraction){var g=jQuery.ui.dialog.prototype._allowInteraction;jQuery.ui.dialog.prototype._allowInteraction=function(t){return!!jQuery(t.target).closest(".select2-dropdown").length||g.apply(this,arguments)}}t("#updraftcentral_keys").on("click","a.updraftcentral_keys_show",function(e){e.preventDefault(),t(this).remove(),t("#updraftcentral_keys_table").slideDown()}),t("#updraftcentral_keycreate_altmethod_moreinfo_get").click(function(e){e.preventDefault(),t(this).remove(),t("#updraftcentral_keycreate_altmethod_moreinfo").slideDown()}),t("#updraft-navtab-settings-content #remote-storage-holder").on("change keyup paste",".updraft_webdav_settings",function(){var e=[];t(".updraft_webdav_settings").each(function(a,r){var n=t(r).attr("id");if(n&&"updraft_webdav_"==n.substring(0,15)){var o=n.substring(15);id_split=o.split("_"),o=id_split[0];var u=id_split[1];"undefined"==typeof e[u]&&(e[u]=[]),e[u][o]=this.value}});var a="",r="@",n="/",o=":",u=":";for(var d in e)(e[d].host.indexOf("@")>=0||""===e[d].host)&&(r=""),e[d].host.indexOf("/")>=0?t("#updraft_webdav_host_error").show():t("#updraft_webdav_host_error").hide(),0!=e[d].path.indexOf("/")&&""!==e[d].path||(n=""),""!==e[d].user&&""!==e[d].pass||(o=""),""!==e[d].host&&""!==e[d].port||(u=""),a=e[d].webdav+e[d].user+o+e[d].pass+r+encodeURIComponent(e[d].host)+u+e[d].port+n+e[d].path,t("#updraft_webdav_url_"+d).val(a)}),t("#updraft-navtab-backups-content").on("click",".js--delete-selected-backups",function(t){t.preventDefault(),updraft_deleteallselected()}),t("#updraft-navtab-backups-content").on("click",".updraft_existing_backups .backup-select input",function(e){updraft_backups_selection.toggle(t(this).closest(".updraft_existing_backups_row"))}),t("#updraft-navtab-backups-content").on("click","#cb-select-all",function(e){t(this).is(":checked")?updraft_backups_selection.selectAll():updraft_backups_selection.deselectAll()}),t("#updraft-navtab-backups-content").on("click",".js--select-all-backups",function(t){updraft_backups_selection.selectAll()}),t("#updraft-navtab-backups-content").on("click",".js--deselect-all-backups",function(t){updraft_backups_selection.deselectAll()}),t("#updraft-navtab-backups-content").on("click",".updraft_existing_backups .updraft_existing_backups_row",function(t){(t.ctrlKey||t.metaKey)&&updraft_backups_selection.toggle(this)}),updraft_backups_selection.checkSelectionStatus(),t("#updraft-navtab-addons-content .wrap").on("click",".updraftplus_com_login .ud_connectsubmit",function(e){e.preventDefault();var a=t("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_email").val(),r=t("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_password").val(),n=t("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_auto_updates").is(":checked")?1:0,o=t("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_auto_udc_connect").is(":checked")?1:0,u={email:a,password:r,auto_update:n,auto_udc_connect:o};h.submit(u)}),t("#updraft-navtab-addons-content .wrap").on("keydown",".updraftplus_com_login input",function(e){if(13==e.which){e.preventDefault();var a=t("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_email").val(),r=t("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_password").val(),n=t("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_auto_updates").is(":checked")?1:0,o=t("#updraft-navtab-addons-content .wrap .updraftplus_com_login #updraftplus-addons_options_auto_udc_connect").is(":checked")?1:0,u={email:a,password:r,auto_update:n,auto_udc_connect:o};h.submit(u)}}),t("#updraft-navtab-migrate-content").on("click",".updraftclone_show_step_1",function(e){t(".updraftplus-clone").addClass("opened"),t(".updraftclone_show_step_1").hide(),t(".updraft_migrate_widget_temporary_clone_stage1").show(),t(".updraft_migrate_widget_temporary_clone_stage0").hide()}),t("#updraft-navtab-migrate-content").on("click",".updraft_migrate_widget_temporary_clone_show_stage0",function(e){e.preventDefault(),t(".updraft_migrate_widget_temporary_clone_stage0").toggle()}),setup_migrate_tabs(),t("#updraft-navtab-migrate-content").on("click",".updraft_migrate_widget_module_content .close",function(e){t(".updraft_migrate_intro").show(),t(this).closest(".updraft_migrate_widget_module_content").hide()}),t("#updraft-navtab-migrate-content").on("click",".updraft_migrate_add_site--trigger",function(e){e.preventDefault(),t(".updraft_migrate_add_site").toggle()}),t("#updraft-navtab-migrate-content").on("click",".updraft_migrate_widget_module_content .updraftplus_com_login .ud_connectsubmit",function(e){e.preventDefault();var r=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_email").val(),n=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_password").val(),o=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_two_factor_code").val(),u=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login .temporary_clone_terms_and_conditions").is(":checked")?1:0,d={form_data:{email:r,password:n,two_factor_code:o,consent:u}};r&&n?a(d):t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login_status").html("<b>"+updraftlion.error+"</b> "+updraftlion.username_password_required).show()}),t("#updraft-navtab-migrate-content").on("keydown",".updraft_migrate_widget_module_content .updraftplus_com_login input",function(e){if(13==e.which){e.preventDefault();var r=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_email").val(),n=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_password").val(),o=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login #temporary_clone_options_two_factor_code").val(),u=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login .temporary_clone_terms_and_conditions").is(":checked")?1:0,d={
3
+ form_data:{email:r,password:n,two_factor_code:o,consent:u}};r&&n?a(d):t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_login_status").html("<b>"+updraftlion.error+"</b> "+updraftlion.username_password_required).show()}}),t("#updraft-navtab-migrate-content").on("click",".updraft_migrate_widget_module_content .updraftplus_com_key .ud_key_connectsubmit",function(e){e.preventDefault();var a=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key #temporary_clone_options_key").val(),n=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key .temporary_clone_terms_and_conditions").is(":checked")?1:0,o={form_data:{clone_key:a,consent:n}};a?r(o):t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key_status").html("<b>"+updraftlion.error+"</b> "+updraftlion.clone_key_required).show()}),t("#updraft-navtab-migrate-content").on("keydown",".updraft_migrate_widget_module_content .updraftplus_com_key input",function(e){if(13==e.which){e.preventDefault();var a=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key #temporary_clone_options_key").val(),n=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key .temporary_clone_terms_and_conditions").is(":checked")?1:0,o={form_data:{clone_key:a,consent:n}};a?r(o):t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_com_key_status").html("<b>"+updraftlion.error+"</b> "+updraftlion.clone_key_required).show()}}),t("#updraft-navtab-migrate-content").on("change",".updraft_migrate_widget_module_content #updraftplus_clone_php_options",function(){var e=t(this).data("php_version"),a=t(this).val();a<e?t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_clone_status").html(updraftlion.clone_version_warning):t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_clone_status").html("")}),t("#updraft-navtab-migrate-content").on("change",".updraft_migrate_widget_module_content #updraftplus_clone_wp_options",function(){var e=t(this).data("wp_version"),a=t(this).val();a<e?t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_clone_status").html(updraftlion.clone_version_warning):t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_clone_status").html("")}),t("#updraft-navtab-migrate-content").on("click",".updraft_migrate_widget_module_content #updraft_migrate_createclone",function(e){e.preventDefault(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraft_migrate_createclone").prop("disabled",!0),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_clone_status").html(""),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_spinner.spinner").addClass("visible");var a=t(this).data("clone_id"),r=t(this).data("secret_token"),o=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_php_options").val(),u=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_wp_options").val(),d=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_region_options").val(),s=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_updraftclone_branch").val(),i=t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraftplus_clone_updraftplus_branch").val(),l=t(".updraftplus_clone_admin_login_options").is(":checked"),p={form_data:{clone_id:a,secret_token:r,install_info:{php_version:o,wp_version:u,region:d,admin_only:l,updraftclone_branch:"undefined"==typeof s?"":s,updraftplus_branch:"undefined"==typeof i?"":i}}};updraft_send_command("process_updraftplus_clone_create",p,function(e){try{if(t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraft_migrate_createclone").prop("disabled",!1),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_spinner.spinner").removeClass("visible"),e.hasOwnProperty("status")&&"error"==e.status)return void t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraftplus_clone_status").html(updraftlion.error+" "+e.message).show();"success"===e.status&&(t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage2").hide(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage3").show(),t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content .updraft_migrate_widget_temporary_clone_stage3").html(e.html),jQuery("#updraft_clone_progress .updraftplus_spinner.spinner").addClass("visible"),n(a,r,e.url,e.key))}catch(o){t("#updraft-navtab-migrate-content .updraft_migrate_widget_module_content #updraft_migrate_createclone").prop("disabled",!1),console.log("Error when processing the response of process_updraftplus_clone_create (as follows)"),console.log(o)}})});var h={};h.set_status=function(e){t("#updraft-navtab-addons-content .wrap").find(".updraftplus_spinner.spinner").text(e)},h.show_loader=function(){t("#updraft-navtab-addons-content .wrap").find(".updraftplus_spinner.spinner").addClass("visible"),t("#updraft-navtab-addons-content .wrap").find(".ud_connectsubmit").prop("disabled","disabled")},h.hide_loader=function(){t("#updraft-navtab-addons-content .wrap").find(".updraftplus_spinner.spinner").removeClass("visible").text(updraftlion.processing),t("#updraft-navtab-addons-content .wrap").find(".ud_connectsubmit").removeProp("disabled")},h.submit=function(e){if(t("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html("").hide(),this.stage)switch(this.stage){case"connect_udc":case"connect_udc_TFA":var a=t("#updraftplus-addons_options_email").val(),r=t("#updraftplus-addons_options_password").val();this.login_data.email=a,this.login_data.password=r,this.connect_udc();break;case"create_key":this.create_key();break;default:this.stage=null,h.submit()}else this.set_status(updraftlion.connecting),this.show_loader(),updraft_send_command("updraftplus_com_login_submit",{data:e},function(a){a.hasOwnProperty("success")?t("#updraftplus-addons_options_auto_udc_connect").is(":checked")?(this.login_data={email:e.email,password:e.password,i_consent:1,two_factor_code:""},h.create_key()):(h.hide_loader(),t("#updraft-navtab-addons-content .wrap .updraftplus_com_login").submit()):a.hasOwnProperty("error")&&(h.hide_loader(),t("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html(a.message).show())}.bind(this))},h.create_key=function(){this.stage="create_key",this.set_status(updraftlion.udc_cloud_connected),this.show_loader();var e={where_send:"__updraftpluscom",key_description:"",key_size:null,mothership_firewalled:0};updraft_send_command("updraftcentral_create_key",e,function(e){try{var a=ud_parse_json(e);if(a.hasOwnProperty("error"))return void console.log(a);a.hasOwnProperty("bundle")?(console.log("bundle",a.bundle),this.login_data.key=a.bundle,this.stage="connect_udc",h.connect_udc()):(a.hasOwnProperty("r")?(t("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html(updraftlion.trouble_connecting).show(),alert(a.r)):(t("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html(updraftlion.trouble_connecting).show(),console.log(a)),h.hide_loader())}catch(r){console.log(r),h.hide_loader()}}.bind(this),{json_parse:!1})},h.connect_udc=function(){var e=t("#updraft-navtab-addons-content .wrap");h.set_status(updraftlion.udc_cloud_key_created),h.show_loader(),"connect_udc_TFA"==this.stage&&(this.login_data.two_factor_code=e.find("input#updraftplus-addons_options_two_factor_code").val(),h.set_status(updraftlion.checking_tfa_code));var a={form_data:this.login_data};a.form_data.addons_options_connect=1,updraft_send_command("process_updraftcentral_login",a,function(a){try{var r=ud_parse_json(a);if(r.hasOwnProperty("error"))return"incorrect_password"===r.code&&(e.find(".tfa_fields").hide(),e.find(".non_tfa_fields").show(),e.find("input#updraftplus-addons_options_two_factor_code").val(""),e.find("input#updraftplus-addons_options_password").val("").focus()),"no_key_found"===r.code&&(this.stage="create_key"),t("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html(r.message).show(),t("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").find("a").attr("target","_blank"),console.log(r),void h.hide_loader();r.hasOwnProperty("tfa_enabled")&&1==r.tfa_enabled&&(t("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html("").hide(),e.find(".non_tfa_fields").hide(),e.find(".tfa_fields").show(),e.find("input#updraftplus-addons_options_two_factor_code").focus(),this.stage="connect_udc_TFA"),"authenticated"===r.status&&(e.find(".non_tfa_fields").hide(),e.find(".tfa_fields").hide(),e.find(".updraft-after-form-table").hide(),this.stage=null,t("#updraft-navtab-addons-content .wrap .updraftplus_com_login_status").html(updraftlion.login_successful_short).show().addClass("success"),setTimeout(function(){t("#updraft-navtab-addons-content .wrap form.updraftplus_com_login").submit()},1e3))}catch(n){console.log(n)}h.hide_loader()}.bind(this),{json_parse:!1})},t("#updraft-navtab-settings-content #remote-storage-holder").on("click",".updraftplusmethod a.updraft_add_instance",function(e){e.preventDefault(),updraft_settings_form_changed=!0;var a=t(this).data("method");o(a)}),t("#updraft-navtab-settings-content #remote-storage-holder").on("click",".updraftplusmethod a.updraft_delete_instance",function(e){e.preventDefault(),updraft_settings_form_changed=!0;var a=t(this).data("method"),r=t(this).data("instance_id");1===t("."+a+"_updraft_remote_storage_border").length&&o(a),t("."+a+"-"+r).hide("slow",function(){t(this).remove()})}),t("#updraft-navtab-settings-content #remote-storage-holder").on("click",".updraftplusmethod .updraft_edit_label_instance",function(e){t(this).find("span").hide(),t(this).attr("contentEditable",!0).focus()}),t("#updraft-navtab-settings-content #remote-storage-holder").on("keyup",".updraftplusmethod .updraft_edit_label_instance",function(e){var a=jQuery(this).data("method"),r=jQuery(this).data("instance_id"),n=jQuery(this).text();t("#updraft_"+a+"_instance_label_"+r).val(n)}),t("#updraft-navtab-settings-content #remote-storage-holder").on("blur",".updraftplusmethod .updraft_edit_label_instance",function(e){t(this).attr("contentEditable",!1),t(this).find("span").show()}),t("#updraft-navtab-settings-content #remote-storage-holder").on("keypress",".updraftplusmethod .updraft_edit_label_instance",function(e){13===e.which&&(t(this).attr("contentEditable",!1),t(this).find("span").show(),t(this).blur())}),jQuery("#updraft-navtab-settings-content #remote-storage-holder").on("change","input[class='updraft_instance_toggle']",function(){updraft_settings_form_changed=!0,jQuery(this).is(":checked")?jQuery(this).siblings("label").html(updraftlion.instance_enabled):jQuery(this).siblings("label").html(updraftlion.instance_disabled)}),jQuery("#updraft-navtab-settings-content #remote-storage-holder").on("click",".updraftplusmethod button.updraft-test-button",function(){var e=jQuery(this).data("method"),a=jQuery(this).data("instance_id");updraft_remote_storage_test(e,function(r,n,o){return"sftp"==e&&(o.hasOwnProperty("scp")&&o.scp?alert(updraftlion.settings_test_result.replace("%s","SCP")+" "+r.output):alert(updraftlion.settings_test_result.replace("%s","SFTP")+" "+r.output),r.hasOwnProperty("data")&&r.data&&r.data.hasOwnProperty("valid_md5_fingerprint")&&r.data.valid_md5_fingerprint&&t("#updraft_sftp_fingerprint_"+a).val(r.data.valid_md5_fingerprint),!0)},a)}),t("#updraft-navtab-settings-content select.updraft_interval, #updraft-navtab-settings-content select.updraft_interval_database").change(function(){updraft_check_same_times()}),t("#backupnow_includefiles_showmoreoptions").click(function(e){e.preventDefault(),t("#backupnow_includefiles_moreoptions").toggle()}),t("#backupnow_database_showmoreoptions").click(function(e){e.preventDefault(),t("#backupnow_database_moreoptions").toggle()}),t("#updraft-navtab-backups-content").on("click","a.updraft_diskspaceused_update",function(t){t.preventDefault(),updraftplus_diskspace()}),t(".advanced_settings_content a.updraft_diskspaceused_update").click(function(t){t.preventDefault(),jQuery(".advanced_settings_content .updraft_diskspaceused").html("<em>"+updraftlion.calculating+"</em>"),updraft_send_command("get_fragment",{fragment:"disk_usage",data:"updraft"},function(t){jQuery(".advanced_settings_content .updraft_diskspaceused").html(t.output)},{type:"GET"})}),t("#updraft-navtab-backups-content a.updraft_uploader_toggle").click(function(e){e.preventDefault(),t("#updraft-plupload-modal").slideToggle()}),t("#updraft-navtab-backups-content a.updraft_rescan_local").click(function(t){t.preventDefault(),updraft_updatehistory(1,0)}),t("#updraft-navtab-backups-content a.updraft_rescan_remote").click(function(t){t.preventDefault(),updraft_updatehistory(1,1)}),t("#updraftplus-remote-rescan-debug").click(function(t){t.preventDefault(),updraft_updatehistory(1,1,1)}),jQuery("#updraftcentral_keys").on("click",'input[type="radio"]',function(){d(!1)}),d(!0),jQuery("#updraftcentral_keys").on("click","#updraftcentral_view_log",function(t){t.preventDefault(),jQuery("#updraftcentral_view_log_container").block({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.fetching+"</div>"});try{updraft_send_command("updraftcentral_get_log",null,function(t){jQuery("#updraftcentral_view_log_container").unblock(),t.hasOwnProperty("log_contents")?jQuery("#updraftcentral_view_log_contents").html('<div style="border:1px solid;padding: 2px;max-height: 400px; overflow-y:scroll;">'+t.log_contents+"</div>"):console.response(resp)},{error_callback:function(t,e,a,r){if(jQuery("#updraftcentral_view_log_container").unblock(),"undefined"!=typeof r&&r.hasOwnProperty("fatal_error"))console.error(r.fatal_error_message),alert(r.fatal_error_message);else{var n="updraft_send_command: error: "+e+" ("+a+")";console.log(n),alert(n),console.log(t)}}})}catch(e){jQuery("#updraft_central_key").html(),console.log(e)}}),jQuery("#updraftcentral_keys").on("click","#updraftcentral_wizard_go",function(t){jQuery("#updraftcentral_wizard_go").hide(),jQuery(".updraftcentral_wizard_success").remove(),jQuery(".create_key_container").show()}),jQuery("#updraftcentral_keys").on("click","#updraftcentral_stage1_go",function(t){t.preventDefault(),jQuery(".updraftcentral_wizard_stage2").hide(),jQuery(".updraftcentral_wizard_stage1").show()}),jQuery("#updraftcentral_keys").on("click","#updraftcentral_stage2_go",function(t){t.preventDefault(),s()}),jQuery("#updraftcentral_keys").on("click","#updraftcentral_keycreate_go",function(t){t.preventDefault();var e=!!jQuery("#updraftcentral_mothership_other").is(":checked"),a=jQuery("#updraftcentral_keycreate_description").val(),r=jQuery("#updraftcentral_keycreate_keysize").val(),n="__updraftpluscom";if(data={key_description:a,key_size:r},e&&(n=jQuery("#updraftcentral_keycreate_mothership").val(),"http"!=n.substring(0,4)))return void alert(updraftlion.enter_mothership_url);data.mothership_firewalled=jQuery("#updraftcentral_keycreate_mothership_firewalled").is(":checked")?1:0,data.where_send=n,jQuery(".create_key_container").hide(),jQuery(".updraftcentral_wizard_stage1").show(),jQuery(".updraftcentral_wizard_stage2").hide(),jQuery("#updraftcentral_keys").block({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.creating_please_allow+"</div>"});try{updraft_send_command("updraftcentral_create_key",data,function(t){jQuery("#updraftcentral_keys").unblock();try{if(t.hasOwnProperty("error"))return alert(t.error),void console.log(t);alert(t.r),t.hasOwnProperty("bundle")&&t.hasOwnProperty("keys_guide")?(jQuery("#updraftcentral_keys_content").html(t.keys_guide),jQuery("#updraftcentral_keys_content").append('<div class="updraftcentral_wizard_success">'+t.r+'<br><textarea onclick="this.select();" style="width:620px; height:165px; word-wrap:break-word; border: 1px solid #aaa; border-radius: 3px; padding:4px;">'+t.bundle+"</textarea></div>")):console.log(t),t.hasOwnProperty("keys_table")&&jQuery("#updraftcentral_keys_content").append(t.keys_table),jQuery("#updraftcentral_wizard_go").show()}catch(e){alert(updraftlion.unexpectedresponse+" "+response),console.log(e)}},{error_callback:function(t,e,a,r){if(jQuery("#updraftcentral_keys").unblock(),"undefined"!=typeof r&&r.hasOwnProperty("fatal_error"))console.error(r.fatal_error_message),alert(r.fatal_error_message);else{var n="updraft_send_command: error: "+e+" ("+a+")";console.log(n),alert(n),console.log(t)}}})}catch(o){jQuery("#updraft_central_key").html(),console.log(o)}}),jQuery("#updraftcentral_keys").on("click",".updraftcentral_key_delete",function(t){t.preventDefault();var e=jQuery(this).data("key_id");return"undefined"==typeof e?void console.log("UpdraftPlus: .updraftcentral_key_delete clicked, but no key ID found"):(jQuery("#updraftcentral_keys").block({message:'<div style="margin: 8px; font-size:150%;"><img src="'+updraftlion.ud_url+'/images/udlogo-rotating.gif" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.deleting+"</div>"}),void updraft_send_command("updraftcentral_delete_key",{key_id:e},function(t){jQuery("#updraftcentral_keys").unblock(),t.hasOwnProperty("keys_table")&&jQuery("#updraftcentral_keys_content").html(t.keys_table)},{error_callback:function(t,e,a,r){if(jQuery("#updraftcentral_keys").unblock(),"undefined"!=typeof r&&r.hasOwnProperty("fatal_error"))console.error(r.fatal_error_message),alert(r.fatal_error_message);else{var n="updraft_send_command: error: "+e+" ("+a+")";console.log(n),alert(n),console.log(t)}}}))}),jQuery("#updraft_reset_sid").click(function(t){t.preventDefault(),updraft_send_command("reset_site_id",null,function(t){jQuery("#updraft_show_sid").html(t)},{json_parse:!1})}),jQuery("#updraft-navtab-settings-content form input:not('.udignorechange'), #updraft-navtab-settings-content form select").change(function(t){updraft_settings_form_changed=!0}),jQuery("#updraft-navtab-settings-content form input[type='submit']").click(function(t){updraft_settings_form_changed=!1});var y=180;jQuery(".updraft-bigbutton").each(function(t,e){var a=jQuery(e).width();a>y&&(y=a)}),y>180&&jQuery(".updraft-bigbutton").width(y),jQuery("#updraft-navtab-backups-content").length&&setInterval(function(){updraft_activejobs_update(!1)},1250),setTimeout(function(){jQuery("#setting-error-settings_updated").slideUp()},5e3),jQuery("#updraft_restore_db").change(function(){jQuery("#updraft_restore_db").is(":checked")&&1==jQuery(this).data("encrypted")?jQuery("#updraft_restorer_dboptions").slideDown():jQuery("#updraft_restorer_dboptions").slideUp()}),updraft_check_same_times();var b={};b[updraftlion.close]=function(){jQuery(this).dialog("close")},jQuery("#updraft-message-modal").dialog({autoOpen:!1,height:350,width:520,modal:!0,buttons:b});var v={};v[updraftlion.deletebutton]=function(){i(0,0,0,0)},v[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-delete-modal").dialog({autoOpen:!1,height:322,width:430,modal:!0,buttons:v});var w={};w[updraftlion.restore]=function(){var t=0,e=[],a=0,r=jQuery("#updraft_restore_meta_foreign").val();if(jQuery('input[name="updraft_restore[]"]').each(function(n,o){if(jQuery(o).is(":checked")&&!jQuery(o).is(":disabled")){t=1;var u=jQuery(o).data("howmany"),d=jQuery(o).val();if((1==r||2==r&&"db"!=d)&&("wpcore"!=d&&(u=jQuery("#updraft_restore_form #updraft_restore_wpcore").data("howmany")),d="wpcore"),"wpcore"!=d||0==a){var s=[d,u];e.push(s),"wpcore"==d&&(a=1)}}}),1==t){if(1==updraft_restore_stage){jQuery("#updraft-restore-modal-stage1").slideUp("slow"),jQuery("#updraft-restore-modal-stage2").show(),updraft_restore_stage=2;var n=jQuery(".updraft_restore_date").first().text(),o=e,u=jQuery("#updraft_restore_timestamp").val();try{updraft_send_command("whichdownloadsneeded",{downloads:e,timestamp:u},function(t){if(t.hasOwnProperty("downloads")&&(console.log("UpdraftPlus: items which still require downloading follow"),o=t.downloads,console.log(o)),0==o.length)updraft_restorer_checkstage2(0);else for(var e=0;e<o.length;e++)updraft_downloader("udrestoredlstatus_",u,o[e][0],"#ud_downloadstatus2",o[e][1],n,!1)},{alert_on_error:!1,error_callback:function(t,e,a,r){if("undefined"!=typeof r&&r.hasOwnProperty("fatal_error"))console.error(r.fatal_error_message),jQuery("#updraft-restore-modal-stage2a").html('<p style="color:red;">'+r.fatal_error_message+"</p>");else{var n="updraft_send_command: error: "+e+" ("+a+")";jQuery("#updraft-restore-modal-stage2a").html('<p style="color:red; margin: 5px;">'+n+"</p>"),console.log(n),console.log(t)}}})}catch(d){console.log("UpdraftPlus: error (follows) when looking for items needing downloading"),console.log(d),alert(updraftlion.jsonnotunderstood)}}else if(2==updraft_restore_stage)updraft_restorer_checkstage2(1);else if(3==updraft_restore_stage){var s=1;if(jQuery("#updraft_restoreoptions_ui input.required").each(function(t){if(0!=s){var e=jQuery(this).val();if(""==e)alert(updraftlion.pleasefillinrequired),s=0;else if(""!=jQuery(this).attr("pattern")){var a=jQuery(this).attr("pattern"),r=new RegExp(a,"g");r.test(e)||(alert(jQuery(this).data("invalidpattern")),s=0)}}}),!s)return;var i=jQuery("#updraft_restoreoptions_ui select, #updraft_restoreoptions_ui input").serialize();console.log("Restore options: "+i),jQuery("#updraft_restorer_restore_options").val(i),jQuery("#updraft-restore-modal-stage2a").html(updraftlion.restore_proceeding),jQuery("#updraft_restore_form").submit(),updraft_restore_stage=4}}else alert(updraftlion.youdidnotselectany)},w[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-restore-modal").dialog({autoOpen:!1,height:505,width:590,modal:!0,buttons:w}),jQuery("#updraft-iframe-modal").dialog({autoOpen:!1,height:500,width:780,modal:!0}),jQuery("#updraft-backupnow-inpage-modal").dialog({autoOpen:!1,height:380,width:580,modal:!0});var j={};j[updraftlion.backupnow]=function(){var t=jQuery("#backupnow_includedb").is(":checked")?0:1,e=jQuery("#backupnow_includefiles").is(":checked")?0:1,a=jQuery("#backupnow_includecloud").is(":checked")?0:1,r=backupnow_whichtables_checked(""),n=jQuery("#always_keep").is(":checked")?1:0,o="incremental"==jQuery("#updraft-backupnow-modal").data("backup-type")?1:0;if(""==r&&0==t)return alert(updraftlion.notableschosen),void jQuery("#backupnow_includefiles_moreoptions").show();"boolean"==typeof r&&(r=null);var u=backupnow_whichfiles_checked("");return""==u&&0==e?(alert(updraftlion.nofileschosen),void jQuery("#backupnow_includefiles_moreoptions").show()):t&&e?void alert(updraftlion.excludedeverything):(jQuery(this).dialog("close"),setTimeout(function(){jQuery("#updraft_lastlogmessagerow").fadeOut("slow",function(){jQuery(this).fadeIn("slow")})},1700),void updraft_backupnow_go(t,e,a,u,{always_keep:n,incremental:o},jQuery("#backupnow_label").val(),r))},j[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-backupnow-modal").dialog({autoOpen:!1,height:472,width:610,modal:!0,buttons:j,create:function(){t(this).closest(".ui-dialog").find(".ui-dialog-buttonpane .ui-button:first").addClass("js-tour-backup-now-button")}}),jQuery("#updraft-poplog").dialog({autoOpen:!1,height:600,width:"75%",modal:!0}),jQuery("#updraft-navtab-settings-content .enableexpertmode").click(function(){return jQuery("#updraft-navtab-settings-content .expertmode").fadeIn(),jQuery("#updraft-navtab-settings-content .enableexpertmode").off("click"),!1}),jQuery("#updraft-navtab-settings-content .backupdirrow").on("click","a.updraft_backup_dir_reset",function(){return jQuery("#updraft_dir").val("updraft"),!1}),jQuery("#updraft-navtab-settings-content .updraft_include_entity").click(function(){var t=jQuery(this).data("toggle_exclude_field");t&&l(t,!1)}),jQuery(".updraft_exclude_entity_container").on("click",".updraft_exclude_entity_delete",function(t){if(t.preventDefault(),confirm(updraftlion.exclude_rule_remove_conformation_msg)){var e=jQuery(this).data("include-backup-file");jQuery.when(jQuery(this).closest(".updraft_exclude_entity_wrapper").remove()).then(updraft_exclude_entity_update(e))}}),jQuery(".updraft_exclude_entity_container").on("click",".updraft_exclude_entity_edit",function(t){t.preventDefault();var e=jQuery(this).hide().closest(".updraft_exclude_entity_wrapper"),a=e.find("input");a.removeProp("readonly").focus();var r=a.val();a.val(""),a.val(r),e.find(".updraft_exclude_entity_update").addClass("is-active").show()}),jQuery(".updraft_exclude_entity_container").on("click",".updraft_exclude_entity_update",function(t){t.preventDefault();var e=jQuery(this).closest(".updraft_exclude_entity_wrapper"),a=jQuery(this).data("include-backup-file"),r=jQuery.trim(e.find("input").val()),n=!1;r==e.find("input").data("val")?n=!0:updraft_is_unique_exclude_rule(r,a)&&(n=!0),n&&(jQuery(this).hide().removeClass("is-active"),jQuery.when(e.find("input").prop("readonly","readonly").data("val",r)).then(function(){e.find(".updraft_exclude_entity_edit").show(),updraft_exclude_entity_update(a)}))}),jQuery("#updraft_exclude_modal").dialog({autoOpen:!1,modal:!0,width:520,height:"auto",open:function(e,a){t(this).parent().focus()}}),jQuery(".updraft_exclude_container .updraft_add_exclude_item").click(function(t){t.preventDefault();var e=jQuery(this).data("include-backup-file");jQuery("#updraft_exclude_modal_for").val(e),jQuery("#updraft_exclude_modal_path").val(jQuery(this).data("path")),"uploads"==e&&jQuery("#updraft-exclude-file-dir-prefix").html(jQuery("#updraft-exclude-upload-base-dir").val()),jQuery(".updraft-exclude-modal-reset").trigger("click"),jQuery("#updraft_exclude_modal").dialog("open")}),jQuery(".updraft-exclude-link").click(function(t){t.preventDefault();var e=jQuery(this).data("panel");"file-dir"==e&&jQuery("#updraft_exclude_files_folders_jstree").jstree({core:{multiple:!1,data:function(t,e){updraft_send_command("get_jstree_directory_nodes",{entity:"filebrowser",node:t,path:jQuery("#updraft_exclude_modal_path").val(),findex:0,skip_root_node:!0},function(t){t.hasOwnProperty("error")?alert(t.error):e.call(this,t.nodes)},{error_callback:function(t,e,a,r){if("undefined"!=typeof r&&r.hasOwnProperty("fatal_error"))console.error(r.fatal_error_message),jQuery("#updraft_zip_files_jstree").html('<p style="color:red; margin: 5px;">'+r.fatal_error_message+"</p>"),alert(r.fatal_error_message);else{var n="updraft_send_command: error: "+e+" ("+a+")";jQuery("#updraft_zip_files_jstree").html('<p style="color:red; margin: 5px;">'+n+"</p>"),console.log(n),alert(n),console.log(t)}}})},error:function(t){alert(t),console.log(t)}},search:{show_only_matches:!0},plugins:["sort"]}),jQuery("#updraft_exclude_modal_main").slideUp(),jQuery(".updraft-exclude-panel").hide(),jQuery(".updraft-exclude-panel[data-panel="+e+"]").slideDown()}),jQuery(".updraft-exclude-modal-reset").click(function(t){t.preventDefault(),jQuery("#updraft_exclude_files_folders_jstree").jstree("destroy"),jQuery("#updraft_exclude_extension_field").val(""),jQuery("#updraft_exclude_prefix_field").val(""),jQuery(".updraft-exclude-panel").slideUp(),jQuery("#updraft_exclude_modal_main").slideDown()}),jQuery(".updraft-exclude-submit").click(function(){var t=jQuery(this).data("panel"),e="";switch(t){case"file-dir":var a=jQuery("#updraft_exclude_files_folders_jstree").jstree("get_selected");if(0==a.length)return void alert(updraftlion.exclude_select_file_or_folder_msg);var r=a[0],n=jQuery("#updraft_exclude_modal_path").val();r.substr(0,n.length)==n&&(r=r.substr(n.length,r.length)),"/"==r.charAt(0)&&(r=r.substr(1)),"/"==r.charAt(r.length-1)&&(r=r.substr(0,r.length-1)),e=r;break;case"extension":var o=jQuery("#updraft_exclude_extension_field").val();if(""==o)return void alert(updraftlion.exclude_type_ext_msg);if(!o.match(/^[0-9a-zA-Z]+$/))return void alert(updraftlion.exclude_ext_error_msg);e="ext:"+o;break;case"begin-with":var u=jQuery("#updraft_exclude_prefix_field").val();if(""==u)return void alert(updraftlion.exclude_type_prefix_msg);if(!u.match(/^\s*[a-z-_\d,\s]+\s*$/i))return void alert(updraftlion.exclude_prefix_error_msg);e="prefix:"+u;break;default:return}var d=jQuery("#updraft_exclude_modal_for").val();if(updraft_is_unique_exclude_rule(e,d)){var s='<div class="updraft_exclude_entity_wrapper"><input type="text" class="updraft_exclude_entity_field updraft_include_'+d+'_exclude_entity" name="updraft_include_'+d+'_exclude_entity[]" value="'+e+'" data-val="'+e+'" data-include-backup-file="'+d+'" readonly="readonly"><a href="#" class="updraft_exclude_entity_edit dashicons dashicons-edit" data-include-backup-file="'+d+'"></a><a href="#" class="updraft_exclude_entity_update dashicons dashicons-yes" data-include-backup-file="'+d+'" style="display: none;"></a><a href="#" class="updraft_exclude_entity_delete dashicons dashicons-no" data-include-backup-file="'+d+'"></a></div>';jQuery('.updraft_exclude_entity_container[data-include-backup-file="'+d+'"]').append(s),updraft_exclude_entity_update(d),jQuery("#updraft_exclude_modal").dialog("close")}}),jQuery("#updraft-navtab-settings-content .updraft-service").change(function(){var t=jQuery(this).val();jQuery("#updraft-navtab-settings-content .updraftplusmethod").hide(),jQuery("#updraft-navtab-settings-content ."+t).show()}),jQuery("#updraft-navtab-settings-content a.updraft_show_decryption_widget").click(function(t){t.preventDefault(),jQuery("#updraftplus_db_decrypt").val(jQuery("#updraft_encryptionphrase").val()),jQuery("#updraft-manualdecrypt-modal").slideToggle()}),jQuery("#updraftplus-phpinfo").click(function(t){t.preventDefault(),updraft_iframe_modal("phpinfo",updraftlion.phpinfo)}),jQuery("#updraftplus-rawbackuphistory").click(function(t){t.preventDefault(),updraft_iframe_modal("rawbackuphistory",updraftlion.raw)}),jQuery("#updraft-navtab-status").click(function(t){t.preventDefault(),updraft_open_main_tab("status"),updraft_page_is_visible=1,updraft_console_focussed_tab="status",updraft_activejobs_update(!0)}),jQuery("#updraft-navtab-expert").click(function(t){t.preventDefault(),updraft_open_main_tab("expert"),updraft_page_is_visible=1}),jQuery("#updraft-navtab-settings, #updraft-navtab-settings2, #updraft_backupnow_gotosettings").click(function(t){t.preventDefault(),jQuery(this).parents(".updraftmessage").remove(),jQuery("#updraft-backupnow-modal").dialog("close"),updraft_open_main_tab("settings"),updraft_page_is_visible=1}),jQuery("#updraft-navtab-addons").click(function(t){t.preventDefault(),jQuery(this).addClass("b#nav-tab-active"),updraft_open_main_tab("addons"),updraft_page_is_visible=1}),jQuery("#updraft-navtab-backups").click(function(t){t.preventDefault(),updraft_console_focussed_tab="backups",updraft_historytimertoggle(1),updraft_open_main_tab("backups")}),jQuery("#updraft-navtab-migrate").click(function(t){t.preventDefault(),jQuery("#updraft_migrate_tab_alt").html("").hide(),updraft_open_main_tab("migrate"),updraft_page_is_visible=1,jQuery("#updraft_migrate .updraft_migrate_widget_module_content").is(":visible")||jQuery(".updraft_migrate_intro").show()}),"migrate"==updraftlion.tab&&jQuery("#updraft-navtab-migrate").trigger("click"),updraft_send_command("ping",null,function(t,e){"success"==e&&"pong"!=t&&t.indexOf("pong")>=0&&(jQuery("#updraft-navtab-backups-content .ud-whitespace-warning").show(),console.log("UpdraftPlus: Extra output warning: response (which should be just (string)'pong') follows."),
4
+ console.log(t))},{json_parse:!1,type:"GET"});try{"undefined"!=typeof updraft_plupload_config&&p()}catch(k){console.log(k)}if(jQuery("#updraftplus_httpget_go").click(function(t){t.preventDefault(),_(0)}),jQuery("#updraftplus_httpget_gocurl").click(function(t){t.preventDefault(),_(1)}),jQuery("#updraftplus_callwpaction_go").click(function(t){t.preventDefault(),params={wpaction:jQuery("#updraftplus_callwpaction").val()},updraft_send_command("call_wordpress_action",params,function(t){t.e?alert(t.e):t.s||(t.r?jQuery("#updraftplus_callwpaction_results").html(t.r):(console.log(t),alert(updraftlion.jsonnotunderstood)))})}),jQuery("#updraft_activejobs_table, #updraft-navtab-migrate-content").on("click",".updraft_jobinfo_delete",function(e){e.preventDefault();var a=jQuery(this).data("jobid");a?(t(this).addClass("disabled"),updraft_activejobs_delete(a)):console.log("UpdraftPlus: A stop job link was clicked, but the Job ID could not be found")}),jQuery("#updraft_activejobs_table, #updraft-navtab-backups-content .updraft_existing_backups, #updraft-backupnow-inpage-modal, #updraft-navtab-migrate-content").on("click",".updraft-log-link",function(t){t.preventDefault();var e=jQuery(this).data("fileid"),a=jQuery(this).data("jobid");e?updraft_popuplog(e):a?updraft_popuplog(a):console.log("UpdraftPlus: A log link was clicked, but the Job ID could not be found")}),jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("click","button.choose-components-button",function(t){var e=jQuery(this).data("entities"),a=jQuery(this).data("backup_timestamp"),r=jQuery(this).data("showdata");c(e,a,r)}),"initiate_restore"==f("udaction")){var Q=f("entities"),x=f("backup_timestamp"),O=f("showdata");c(Q,x,O)}var P={};P[updraftlion.uploadbutton]=function(){var t=jQuery("#updraft_upload_timestamp").val(),e=jQuery("#updraft_upload_nonce").val(),a="",r=!1;return jQuery(".updraft_remote_storage_destination").each(function(t){jQuery(this).is(":checked")&&(r=!0)}),r?(a=jQuery("input[name^='updraft_remote_storage_destination_']").serializeArray(),jQuery(this).dialog("close"),alert(updraftlion.local_upload_started),void updraft_send_command("upload_local_backup",{use_nonce:e,use_timestamp:t,services:a},function(t){})):void jQuery("#updraft-upload-modal-error").html(updraftlion.local_upload_error)},P[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-upload-modal").dialog({autoOpen:!1,height:322,width:430,modal:!0,buttons:P}),jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("click","button.updraft-upload-link",function(t){t.preventDefault();var e=jQuery(this).data("nonce").toString(),a=jQuery(this).data("key").toString(),r=jQuery(this).data("services").toString();e?m(a,e,r):console.log("UpdraftPlus: A upload link was clicked, but the Job ID could not be found")}),jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("click",".updraft-delete-link",function(t){t.preventDefault();var e=jQuery(this).data("hasremote"),a=jQuery(this).data("nonce").toString(),r=jQuery(this).data("key").toString();a?updraft_delete(r,a,e):console.log("UpdraftPlus: A delete link was clicked, but the Job ID could not be found")}),jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("click","button.updraft_download_button",function(t){t.preventDefault();var e="uddlstatus_",a=jQuery(this).data("backup_timestamp"),r=jQuery(this).data("what"),n=".ud_downloadstatus",o=jQuery(this).data("set_contents"),u=jQuery(this).data("prettydate"),d=!0;updraft_downloader(e,a,r,n,o,u,d)}),jQuery("#updraft-navtab-backups-content .updraft_existing_backups").on("dblclick",".updraft_existingbackup_date",function(t){t.preventDefault();var e=jQuery(this).data("rawbackup");null!=e&&""!=e&&updraft_html_modal(e,updraftlion.raw,780,500)})}),jQuery(document).ready(function(t){var e="#updraft-navtab-settings-content ";t(e+"#remote-storage-holder").on("click",".updraftvault_backtostart",function(a){a.preventDefault(),t(e+"#updraftvault_settings_showoptions").slideUp(),t(e+"#updraftvault_settings_connect").slideUp(),t(e+"#updraftvault_settings_connected").slideUp(),t(e+"#updraftvault_settings_default").slideDown()}),t(e).on("keypress","#updraftvault_settings_connect input",function(a){if(13==a.which)return t(e+"#updraftvault_connect_go").click(),!1}),t(e+"#remote-storage-holder").on("click","#updraftvault_recountquota",function(a){a.preventDefault(),t(e+"#updraftvault_recountquota").html(updraftlion.counting);try{updraft_send_command("vault_recountquota",{instance_id:t("#updraftvault_settings_connect").data("instance_id")},function(a){t(e+"#updraftvault_recountquota").html(updraftlion.updatequotacount),a.hasOwnProperty("html")&&(t(e+"#updraftvault_settings_connected").html(a.html),a.hasOwnProperty("connected")&&(a.connected?(t(e+"#updraftvault_settings_default").hide(),t(e+"#updraftvault_settings_connected").show()):(t(e+"#updraftvault_settings_connected").hide(),t(e+"#updraftvault_settings_default").show())))},{error_callback:function(a,r,n,o){if(t(e+"#updraftvault_recountquota").html(updraftlion.updatequotacount),"undefined"!=typeof o&&o.hasOwnProperty("fatal_error"))console.error(o.fatal_error_message),alert(o.fatal_error_message);else{var u="updraft_send_command: error: "+r+" ("+n+")";console.log(u),alert(u),console.log(a)}}})}catch(r){t(e+"#updraftvault_recountquota").html(updraftlion.updatequotacount),console.log(r)}}),t(e+"#remote-storage-holder").on("click","#updraftvault_disconnect",function(a){a.preventDefault(),t(e+"#updraftvault_disconnect").html(updraftlion.disconnecting);try{updraft_send_command("vault_disconnect",{immediate_echo:!0,instance_id:t("#updraftvault_settings_connect").data("instance_id")},function(a){t(e+"#updraftvault_disconnect").html(updraftlion.disconnect),a.hasOwnProperty("html")&&(t(e+"#updraftvault_settings_connected").html(a.html).slideUp(),t(e+"#updraftvault_settings_default").slideDown())},{error_callback:function(a,r,n,o){if(t(e+"#updraftvault_disconnect").html(updraftlion.disconnect),"undefined"!=typeof o&&o.hasOwnProperty("fatal_error"))console.error(o.fatal_error_message),alert(o.fatal_error_message);else{var u="updraft_send_command: error: "+r+" ("+n+")";console.log(u),alert(u),console.log(a)}}})}catch(r){t(e+"#updraftvault_disconnect").html(updraftlion.disconnect),console.log(r)}}),t(e+"#remote-storage-holder").on("click","#updraftvault_connect",function(a){a.preventDefault(),t(e+"#updraftvault_settings_default").slideUp(),t(e+"#updraftvault_settings_connect").slideDown()}),t(e+"#remote-storage-holder").on("click","#updraftvault_showoptions",function(a){a.preventDefault(),t(e+"#updraftvault_settings_default").slideUp(),t(e+"#updraftvault_settings_showoptions").slideDown()}),t("#remote-storage-holder").on("keyup",".updraftplus_onedrive_folder_input",function(e){var a=t(this).val(),r=t(this).closest("td");0==a.indexOf("https:")||0==a.indexOf("http:")?r.find(".onedrive_folder_error").length||r.append('<div class="onedrive_folder_error">'+updraftlion.onedrive_folder_url_warning+"</div>"):r.find(".onedrive_folder_error").slideUp("slow",function(){r.find(".onedrive_folder_error").remove()})}),t(e+"#remote-storage-holder").on("click","#updraftvault_connect_go",function(a){return t(e+"#updraftvault_connect_go").html(updraftlion.connecting),updraft_send_command("vault_connect",{email:t("#updraftvault_email").val(),pass:t("#updraftvault_pass").val(),instance_id:t("#updraftvault_settings_connect").data("instance_id")},function(a,r,n){t(e+"#updraftvault_connect_go").html(updraftlion.connect),a.hasOwnProperty("e")?(updraft_html_modal('<h4 style="margin-top:0px; padding-top:0px;">'+updraftlion.errornocolon+"</h4><p>"+a.e+"</p>",updraftlion.disconnect,400,250),a.hasOwnProperty("code")&&"no_quota"==a.code&&(t(e+"#updraftvault_settings_connect").slideUp(),t(e+"#updraftvault_settings_default").slideDown())):a.hasOwnProperty("connected")&&a.connected&&a.hasOwnProperty("html")?(t(e+"#updraftvault_settings_connect").slideUp(),t(e+"#updraftvault_settings_connected").html(a.html).slideDown()):(console.log(a),alert(updraftlion.unexpectedresponse+" "+n))},{error_callback:function(a,r,n,o){if(t(e+"#updraftvault_connect_go").html(updraftlion.connect),"undefined"!=typeof o&&o.hasOwnProperty("fatal_error"))console.error(o.fatal_error_message),alert(o.fatal_error_message);else{var u="updraft_send_command: error: "+r+" ("+n+")";console.log(u),alert(u),console.log(a)}}}),!1}),t("#updraft-iframe-modal").on("change","#always_keep_this_backup",function(){var e=t(this).data("backup_key"),a={backup_key:e,always_keep:t(this).is(":checked")?1:0};updraft_send_command("always_keep_this_backup",a,function(t){t.hasOwnProperty("rawbackup")&&(jQuery("#updraft-iframe-modal").dialog("close"),jQuery(".updraft_existing_backups_row_"+e+" .updraft_existingbackup_date").data("rawbackup",t.rawbackup),updraft_html_modal(jQuery(".updraft_existing_backups_row_"+e+" .updraft_existingbackup_date").data("rawbackup"),updraftlion.raw,780,500))})})}),jQuery(document).ready(function(t){function e(){var t=new plupload.Uploader(updraft_plupload_config2);t.bind("Init",function(t){var e=jQuery("#plupload-upload-ui2");t.features.dragdrop?(e.addClass("drag-drop"),jQuery("#drag-drop-area2").bind("dragover.wp-uploader",function(){e.addClass("drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){e.removeClass("drag-over")})):(e.removeClass("drag-drop"),jQuery("#drag-drop-area2").unbind(".wp-uploader"))}),t.init(),t.bind("FilesAdded",function(e,a){plupload.each(a,function(e){return/^backup_([\-0-9]{15})_.*_([0-9a-f]{12})-db([0-9]+)?\.(gz\.crypt)$/i.test(e.name)?void jQuery("#filelist2").append('<div class="file" id="'+e.id+'"><b>'+e.name+"</b> (<span>"+plupload.formatSize(0)+"</span>/"+plupload.formatSize(e.size)+') <div class="fileprogress"></div></div>'):(alert(e.name+": "+updraftlion.notdba),void t.removeFile(e))}),e.refresh(),e.start()}),t.bind("UploadProgress",function(t,e){jQuery("#"+e.id+" .fileprogress").width(e.percent+"%"),jQuery("#"+e.id+" span").html(plupload.formatSize(parseInt(e.size*e.percent/100)))}),t.bind("Error",function(t,e){"-200"==e.code?err_makesure="\n"+updraftlion.makesure2:err_makesure=updraftlion.makesure,alert(updraftlion.uploaderr+" (code "+e.code+") : "+e.message+" "+err_makesure)}),t.bind("FileUploaded",function(t,e,a){"200"==a.status?"ERROR:"==a.response.substring(0,6)?alert(updraftlion.uploaderror+" "+a.response.substring(6)):"OK:"==a.response.substring(0,3)?(bkey=a.response.substring(3),jQuery("#"+e.id+" .fileprogress").hide(),jQuery("#"+e.id).append(updraftlion.uploaded+' <a href="?page=updraftplus&action=downloadfile&updraftplus_file='+bkey+"&decrypt_key="+encodeURIComponent(jQuery("#updraftplus_db_decrypt").val())+'">'+updraftlion.followlink+"</a> "+updraftlion.thiskey+" "+jQuery("#updraftplus_db_decrypt").val().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"))):alert(updraftlion.unknownresp+" "+a.response):alert(updraftlion.ukrespstatus+" "+a.code)})}try{"undefined"!=typeof updraft_plupload_config2&&e()}catch(a){console.log(a)}if(jQuery("#updraft-hidethis").remove(),Handlebars.registerHelper("ifeq",function(t,e,a){return"string"!=typeof t&&"undefined"!=typeof t&&null!==t&&(t=t.toString()),"string"!=typeof e&&"undefined"!=typeof e&&null!==e&&(e=e.toString()),t===e?a.fn(this):a.inverse(this)}),t("#remote-storage-holder").length){var r="";for(var n in updraftlion.remote_storage_templates)if("undefined"!=typeof updraftlion.remote_storage_options[n]&&1<Object.keys(updraftlion.remote_storage_options[n]).length){var o=Handlebars.compile(updraftlion.remote_storage_templates[n]),u=!0;for(var d in updraftlion.remote_storage_options[n])if("default"!==d){var s=updraftlion.remote_storage_options[n][d];s.first_instance=u,"undefined"==typeof s.instance_enabled&&(s.instance_enabled=1),r+=o(s),u=!1}}else r+=updraftlion.remote_storage_templates[n];t("#remote-storage-holder").append(r).ready(function(){t(".updraftplusmethod").not(".none").hide(),updraft_remote_storage_tabs_setup(),t("#remote-storage-holder .updraftplus_onedrive_folder_input").trigger("keyup")})}}),jQuery(document).ready(function(t){function e(){var t=r("object"),e=new Date;t=JSON.stringify({version:"1.12.40",epoch_date:e.getTime(),local_date:e.toLocaleString(),network_site_url:updraftlion.network_site_url,data:t});var a=document.body.appendChild(document.createElement("a"));a.setAttribute("download",updraftlion.export_settings_file_name),a.setAttribute("style","display:none;"),a.setAttribute("href","data:text/json;charset=UTF-8,"+encodeURIComponent(t)),a.click()}function a(e){var a,r=decodeURIComponent(e);try{a=ud_parse_json(r)}catch(o){return t.unblockUI(),jQuery("#import_settings").val(""),console.log(r),console.log(o),void alert(updraftlion.import_invalid_json_file)}if(window.confirm(updraftlion.importing_data_from+" "+r.network_site_url+"\n"+updraftlion.exported_on+" "+r.local_date+"\n"+updraftlion.continue_import)){var u=JSON.stringify(a.data);updraft_send_command("importsettings",{settings:u,updraftplus_version:updraftlion.updraftplus_version},function(e,a,r){var o=n(e);!o.hasOwnProperty("saved")||o.saved?(updraft_settings_form_changed=!1,location.replace(updraftlion.updraft_settings_url)):(t.unblockUI(),o.hasOwnProperty("error_message")&&o.error_message&&alert(o.error_message))},{action:"updraft_importsettings",nonce:updraftplus_settings_nonce,error_callback:function(e,a,r,n){if(t.unblockUI(),"undefined"!=typeof n&&n.hasOwnProperty("fatal_error"))console.error(n.fatal_error_message),alert(n.fatal_error_message);else{var o="updraft_send_command: error: "+a+" ("+r+")";console.log(o),console.log(e),alert(o)}}})}else t.unblockUI()}function r(e){var a="",e="undefined"==typeof e?"string":e;return"object"==e?a=t("#updraft-navtab-settings-content form input[name!='action'][name!='option_page'][name!='_wpnonce'][name!='_wp_http_referer'], #updraft-navtab-settings-content form textarea, #updraft-navtab-settings-content form select, #updraft-navtab-settings-content form input[type=checkbox]").serializeJSON({checkboxUncheckedValue:"0",useIntKeysAsArrayIndex:!0}):(a=t("#updraft-navtab-settings-content form input[name!='action'], #updraft-navtab-settings-content form textarea, #updraft-navtab-settings-content form select").serialize(),t.each(t("#updraft-navtab-settings-content form input[type=checkbox]").filter(function(e){return 0==t(this).prop("checked")}),function(e,r){var n="0";a+="&"+t(r).attr("name")+"="+n})),a}function n(e,a){try{var r=(e.messages,e.backup_dir.writable),n=e.backup_dir.message,o=e.backup_dir.button_title}catch(u){return console.log(u),console.log(a),alert(updraftlion.jsonnotunderstood),t.unblockUI(),{}}if(e.hasOwnProperty("changed")){console.log("UpdraftPlus: savesettings: some values were changed after being filtered"),console.log(e.changed);for(prop in e.changed)if("object"==typeof e.changed[prop])for(innerprop in e.changed[prop])t("[name='"+innerprop+"']").is(":checkbox")||t("[name='"+prop+"["+innerprop+"]']").val(e.changed[prop][innerprop]);else t("[name='"+prop+"']").is(":checkbox")||t("[name='"+prop+"']").val(e.changed[prop])}return t("#updraft_writable_mess").html(n),0==r?(t("#updraft-backupnow-button").attr("disabled","disabled"),t("#updraft-backupnow-button").attr("title",o),t(".backupdirrow").css("display","table-row")):(t("#updraft-backupnow-button").removeAttr("disabled"),t("#updraft-backupnow-button").removeAttr("title")),e.hasOwnProperty("updraft_include_more_path")&&t("#backupnow_includefiles_moreoptions").html(e.updraft_include_more_path),e.hasOwnProperty("backup_now_message")&&t("#backupnow_remote_container").html(e.backup_now_message),t(".updraftmessage").remove(),t("#updraft_backup_started").before(e.messages),console.log(e),t("#updraft-next-files-backup-inner").html(e.files_scheduled),t("#updraft-next-database-backup-inner").html(e.database_scheduled),e}function o(){var t=!1;if(jQuery("#updraft-authenticate-modal-innards").html(""),jQuery("div[class*=updraft_authenticate_] a.updraft_authlink").each(function(){jQuery("#updraft-authenticate-modal-innards").append('<p><a href="'+jQuery(this).attr("href")+'">'+jQuery(this).html()+"</a></p>"),t=!0}),t){var e={};e[updraftlion.cancel]=function(){jQuery(this).dialog("close")},jQuery("#updraft-authenticate-modal").dialog({autoOpen:!0,modal:!0,resizable:!1,draggable:!1,buttons:e,width:"auto"}).dialog("open")}}var u=new Image;u.src=updraftlion.ud_url+"/images/notices/updraft_logo.png",t("#updraft-navtab-settings-content input.updraft_include_entity").change(function(e){var a=t(this).attr("id"),r=t(this).is(":checked"),n="#backupnow_files_"+a;t(n).prop("checked",r)}),t("#updraftplus-settings-save").click(function(e){e.preventDefault(),t.blockUI({css:{width:"300px",border:"none","border-radius":"10px",left:"calc(50% - 150px)",padding:"20px"},message:'<div style="margin: 8px; font-size:150%;" class="updraft_saving_popup"><img src="'+updraftlion.ud_url+'/images/notices/updraft_logo.png" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.saving+"</div>"});var a=r("string");updraft_send_command("savesettings",{settings:a,updraftplus_version:updraftlion.updraftplus_version},function(e,a,r){n(e,r),t("#updraft-wrap .fade").delay(6e3).fadeOut(2e3),window.updraft_main_tour&&!window.updraft_main_tour.canceled?(window.updraft_main_tour.show("settings_saved"),o()):t("html, body").animate({scrollTop:t("#updraft-wrap").offset().top},1e3,function(){o()}),t.unblockUI()},{action:"updraft_savesettings",error_callback:function(e,a,r,n){if(t.unblockUI(),"undefined"!=typeof n&&n.hasOwnProperty("fatal_error"))console.error(n.fatal_error_message),alert(n.fatal_error_message);else{var o="updraft_send_command: error: "+a+" ("+r+")";console.log(o),alert(o),console.log(e)}},nonce:updraftplus_settings_nonce})}),t("#updraftplus-settings-export").click(function(){updraft_settings_form_changed&&alert(updraftlion.unsaved_settings_export),e()}),t("#updraftplus-settings-import").click(function(){t.blockUI({css:{width:"300px",border:"none","border-radius":"10px",left:"calc(50% - 150px)",padding:"20px"},message:'<div style="margin: 8px; font-size:150%;" class="updraft_saving_popup"><img src="'+updraftlion.ud_url+'/images/notices/updraft_logo.png" height="80" width="80" style="padding-bottom:10px;"><br>'+updraftlion.importing+"</div>"});var e=document.getElementById("import_settings");if(0==e.files.length)return alert(updraftlion.import_select_file),void t.unblockUI();var r=e.files[0],n=new FileReader;n.onload=function(){a(this.result)},n.readAsText(r)}),t(".udp-replace-with-iframe--js").on("click",function(e){e.preventDefault();var a=t(this).prop("href"),r=t('<iframe width="356" height="200" allowfullscreen webkitallowfullscreen mozallowfullscreen>').attr("src",a);r.insertAfter(t(this)),t(this).remove()})}),jQuery(document).ready(function(t){function e(e,n,o,u){if("function"==typeof o){var d=t(u).find("#updraftcentral_cloud_form"),s=d.find('.form_hidden_fields input[name="key"]');if(s.length&&""!==s.val())return void o.apply(this,[s.val()]);var i={where_send:"__updraftpluscom",key_description:"",key_size:e,mothership_firewalled:n};a(u),updraft_send_command("updraftcentral_create_key",i,function(e){r(u);try{if(i=ud_parse_json(e),i.hasOwnProperty("error"))return void console.log(i);i.hasOwnProperty("bundle")?o.apply(this,[i.bundle]):i.hasOwnProperty("r")?(t(u).find(".updraftcentral_cloud_notices").html(updraftlion.trouble_connecting).addClass("updraftcentral_cloud_info"),alert(i.r)):console.log(i)}catch(a){console.log(a)}},{json_parse:!1})}}function a(e){t(e).find(".updraftplus_spinner.spinner").addClass("visible")}function r(e){t(e).find(".updraftplus_spinner.spinner").removeClass("visible")}function n(e,n){a(n),updraft_send_command("process_updraftcentral_registration",e,function(a){r(n);try{if(e=ud_parse_json(a),e.hasOwnProperty("error")){var o=e.message,d=["existing_user_email","email_exists"];return-1!==t.inArray(e.code,d)&&(o=e.message+" "+updraftlion.perhaps_login),t(n).find(".updraftcentral_cloud_notices").html(o).addClass("updraftcentral_cloud_error"),t(n).find(".updraftcentral_cloud_notices a").attr("target","_blank"),void console.log(e)}"registered"===e.status&&(t(n).find(".updraftcentral_cloud_form_container").hide(),t(n).find(".updraftcentral-subheading").hide(),t(n).find(".updraftcentral_cloud_notices").removeClass("updraftcentral_cloud_error"),u(n,e,updraftlion.registration_successful))}catch(s){console.log(s)}},{json_parse:!1})}function o(e,o){a(o),updraft_send_command("process_updraftcentral_login",e,function(a){r(o);try{if(data=ud_parse_json(a),data.hasOwnProperty("error")){if("incorrect_password"===data.code&&(t(o).find(".updraftcentral_cloud_form_container .tfa_fields").hide(),t(o).find(".updraftcentral_cloud_form_container .non_tfa_fields").show(),t(o).find("input#two_factor_code").val(""),t(o).find("input#password").val("").focus()),"email_not_registered"!==data.code)return t(o).find(".updraftcentral_cloud_notices").html(data.message).addClass("updraftcentral_cloud_error"),t(o).find(".updraftcentral_cloud_notices a").attr("target","_blank"),void console.log(data);n(e,o)}data.hasOwnProperty("tfa_enabled")&&1==data.tfa_enabled&&(t(o).find(".updraftcentral_cloud_notices").html("").removeClass("updraftcentral_cloud_error"),t(o).find(".updraftcentral_cloud_form_container .non_tfa_fields").hide(),t(o).find(".updraftcentral_cloud_form_container .tfa_fields").show(),t(o).find("input#two_factor_code").focus()),"authenticated"===data.status&&(t(o).find(".updraftcentral_cloud_form_container").hide(),t(o).find(".updraftcentral_cloud_notices").removeClass("updraftcentral_cloud_error"),u(o,data,updraftlion.login_successful))}catch(d){console.log(d)}},{json_parse:!1})}function u(e,a,r){var n=t(e).find("form#updraftcentral_cloud_redirect_form");n.attr("action",a.redirect_url),n.attr("target","_blank"),"undefined"!=typeof a.redirect_token&&n.append('<input type="hidden" name="redirect_token" value="'+a.redirect_token+'">'),a.hasOwnProperty("keys_table")&&a.keys_table&&t("#updraftcentral_keys_content").html(a.keys_table),t(".updraftplus-addons-connect-to-udc").remove(),$redirect_lnk='<a href="'+updraftlion.current_clean_url+'" class="updraftcentral_cloud_redirect_link">'+updraftlion.updraftcentral_cloud+"</a>",$close_lnk='<a href="'+updraftlion.current_clean_url+'" class="updraftcentral_cloud_close_link">'+updraftlion.close_wizard+"</a>",t(e).find(".updraftcentral_cloud_notices").html(r.replace("%s",$redirect_lnk)+" "+$close_lnk+"<br/><br/>"+updraftlion.control_udc_connections),t(e).find(".updraftcentral_cloud_notices .updraftcentral_cloud_redirect_link").off("click").on("click",function(a){a.preventDefault(),n.submit(),t(e).find(".updraftcentral_cloud_notices .updraftcentral_cloud_close_link").trigger("click")}),t(e).find(".updraftcentral_cloud_notices .updraftcentral_cloud_close_link").off("click").on("click",function(a){a.preventDefault(),t(e).dialog("close"),t("#updraftcentral_cloud_connect_container").hide()})}function d(e){var a=t(e).find("#updraftcentral_cloud_form"),r=a.find("input#email").val(),n=a.find("input#password").val(),o=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;t(e).find(".updraftcentral_cloud_notices").html("").removeClass("updraftcentral_cloud_error updraftcentral_cloud_info");var u=a.find('.updraftcentral-data-consent > input[name="i_consent"]').is(":checked");return u?0===r.length||0===n.length?(t(e).find(".updraftcentral_cloud_notices").html(updraftlion.username_password_required).addClass("updraftcentral_cloud_error"),!1):null!==r.match(o)||(t(e).find(".updraftcentral_cloud_notices").html(updraftlion.valid_email_required).addClass("updraftcentral_cloud_error"),!1):(t(e).find(".updraftcentral_cloud_notices").html(updraftlion.data_consent_required).addClass("updraftcentral_cloud_error"),!1)}function s(a,r){var u=t(a).find("#updraft_central_keysize").val(),d=t(a).find("#updraft_central_firewalled").is(":checked")?1:0;e(u,d,function(e){var u=t(a).find("#updraftcentral_cloud_form"),d=u.find('.form_hidden_fields input[name="key"]');0===d.length&&u.find(".form_hidden_fields").append('<input type="hidden" name="key" value="'+e+'">');var s=u.find("input").serialize(),i={form_data:s};"undefined"!=typeof r&&r?n(i,a):o(i,a)},a)}function i(){var e=t("#updraftcentral_cloud_login_form");if(e.length){t("#updraft-iframe-modal-innards").html(e.html());var a=t("#updraft-iframe-modal").dialog("option","title",updraftlion.updraftcentral_cloud).dialog("option","width",520).dialog("option","height",450).dialog("option","buttons",{});a.dialog("open");var r=a.find(".updraftcentral-data-consent"),n=r.find("input").attr("name");"undefined"!=typeof n&&n&&(r.find("input").attr("id",n),r.find("label").attr("for",n))}}jQuery("#updraft-restore-modal").on("change","#updraft_restorer_charset",function(e){if(t("#updraft_restorer_charset").length&&t("#updraft_restorer_collate").length&&t("#collate_change_on_charset_selection_data").length){var a=t("#updraft_restorer_charset").val();t("#updraft_restorer_collate option").show(),t("#updraft_restorer_collate option[data-charset!="+a+"]").hide(),updraft_send_command("collate_change_on_charset_selection",{collate_change_on_charset_selection_data:t("#collate_change_on_charset_selection_data").val(),updraft_restorer_charset:a,updraft_restorer_collate:t("#updraft_restorer_collate").val()},function(e){e.hasOwnProperty("is_action_required")&&1==e.is_action_required&&e.hasOwnProperty("similar_type_collate")&&t("#updraft_restorer_collate").val(e.similar_type_collate)})}}),t("#updraft-wrap #btn_cloud_connect").on("click",function(){i()}),t("#updraft-wrap a#self_hosted_connect").on("click",function(e){e.preventDefault(),t("h2.nav-tab-wrapper > a#updraft-navtab-expert").trigger("click"),t("div.advanced_settings_menu > #updraft_central").trigger("click")}),t("#updraft-iframe-modal").on("click","#updraftcentral_cloud_login",function(e){e.preventDefault();var a=t(this).closest("#updraft-iframe-modal");d(a)&&s(a)});var l={};t(document).on("heartbeat-send",function(t,e){l=updraft_poll_get_parameters(),e.updraftplus=l}),t(document).on("heartbeat-tick",function(t,e){if(null!==e&&e.hasOwnProperty("updraftplus")){var a=e.updraftplus,r=JSON.stringify(a);updraft_process_status_check(a,r,l)}})});
includes/updraftplus-clone.php CHANGED
@@ -104,6 +104,7 @@ class UpdraftPlus_Clone extends UpdraftPlus_Login {
104
 
105
  $action = 'updraftplus_clone_create';
106
  if (empty($data['site_url'])) $data['site_url'] = trailingslashit(network_site_url());
 
107
  if (empty($data['install_info']['table_prefix'])) $data['install_info']['table_prefix'] = $table_prefix;
108
  $subdirectory = parse_url(network_site_url(), PHP_URL_PATH);
109
  if (empty($data['install_info']['subdirectory'])) $data['install_info']['subdirectory'] = !empty($subdirectory) ? $subdirectory : '/';
104
 
105
  $action = 'updraftplus_clone_create';
106
  if (empty($data['site_url'])) $data['site_url'] = trailingslashit(network_site_url());
107
+ if (empty($data['label'])) $data['label'] = sprintf(__('Clone of %s', 'updraftplus'), trailingslashit(network_site_url()));
108
  if (empty($data['install_info']['table_prefix'])) $data['install_info']['table_prefix'] = $table_prefix;
109
  $subdirectory = parse_url(network_site_url(), PHP_URL_PATH);
110
  if (empty($data['install_info']['subdirectory'])) $data['install_info']['subdirectory'] = !empty($subdirectory) ? $subdirectory : '/';
js/updraft-admin-restore.js ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($) {
2
+
3
+ /**
4
+ * This function will start the restore over ajax for the passed in job_id.
5
+ *
6
+ * @param {string} job_id - the restore job id
7
+ */
8
+ function updraft_restore_command(job_id) {
9
+ var xhttp = new XMLHttpRequest();
10
+
11
+ var xhttp_data = 'action=updraft_ajaxrestore&updraftplus_ajax_restore=do_ajax_restore&job_id=' + job_id;
12
+ var previous_data_length = 0;
13
+ var show_alert = true;
14
+
15
+ xhttp.open("POST", ajaxurl, true);
16
+ xhttp.onprogress = function(response) {
17
+ if (response.currentTarget.status >= 200 && response.currentTarget.status < 300) {
18
+ if (-1 !== response.currentTarget.responseText.indexOf('<html')) {
19
+ if (show_alert) {
20
+ show_alert = false;
21
+ alert("UpdraftPlus " + updraftlion.ajax_restore_invalid_response);
22
+ }
23
+ $('#updraftplus_ajax_restore_output').append("UpdraftPlus " + updraftlion.ajax_restore_invalid_response);
24
+ console.log("UpdraftPlus restore error: HTML detected in response could be a copy of the WordPress front page caused by mod_security");
25
+ console.log(response.currentTarget.responseText);
26
+ return;
27
+ }
28
+ if (previous_data_length == response.currentTarget.responseText.length) return;
29
+ var responseText = response.currentTarget.responseText.substr(previous_data_length);
30
+ $('#updraftplus_ajax_restore_output').append(responseText);
31
+ previous_data_length = response.currentTarget.responseText.length;
32
+ } else {
33
+ $('#updraftplus_ajax_restore_output').append("UpdraftPlus restore error: " + response.currentTarget.status + ' ' + response.currentTarget.statusText);
34
+ console.log("UpdraftPlus restore error: " + response.currentTarget.status + ' ' + response.currentTarget.statusText);
35
+ console.log(response.currentTarget);
36
+ }
37
+ }
38
+ xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
39
+ xhttp.send(xhttp_data);
40
+ }
41
+
42
+ var job_id = $('#updraftplus_ajax_restore_job_id').val();
43
+ updraft_restore_command(job_id);
44
+ });
js/updraft-admin-restore.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(e){function r(r){var t=new XMLHttpRequest,a="action=updraft_ajaxrestore&updraftplus_ajax_restore=do_ajax_restore&job_id="+r,s=0,o=!0;t.open("POST",ajaxurl,!0),t.onprogress=function(r){if(r.currentTarget.status>=200&&r.currentTarget.status<300){if(-1!==r.currentTarget.responseText.indexOf("<html"))return o&&(o=!1,alert("UpdraftPlus "+updraftlion.ajax_restore_invalid_response)),e("#updraftplus_ajax_restore_output").append("UpdraftPlus "+updraftlion.ajax_restore_invalid_response),console.log("UpdraftPlus restore error: HTML detected in response could be a copy of the WordPress front page caused by mod_security"),void console.log(r.currentTarget.responseText);if(s==r.currentTarget.responseText.length)return;var t=r.currentTarget.responseText.substr(s);e("#updraftplus_ajax_restore_output").append(t),s=r.currentTarget.responseText.length}else e("#updraftplus_ajax_restore_output").append("UpdraftPlus restore error: "+r.currentTarget.status+" "+r.currentTarget.statusText),console.log("UpdraftPlus restore error: "+r.currentTarget.status+" "+r.currentTarget.statusText),console.log(r.currentTarget)},t.setRequestHeader("Content-type","application/x-www-form-urlencoded"),t.send(a)}var t=e("#updraftplus_ajax_restore_job_id").val();r(t)});
languages/updraftplus.pot CHANGED
@@ -25,7 +25,7 @@ msgstr ""
25
  msgid "UpdraftPlus Automatic Backups"
26
  msgstr ""
27
 
28
- #: src/addons/autobackup.php:157, src/addons/autobackup.php:1026, src/admin.php:928
29
  msgid "Automatic backup before update"
30
  msgstr ""
31
 
@@ -49,7 +49,7 @@ msgstr ""
49
  msgid "(logs can be found in the UpdraftPlus settings page as normal)..."
50
  msgstr ""
51
 
52
- #: src/addons/autobackup.php:344, src/addons/autobackup.php:439, src/admin.php:3104, src/admin.php:3110, src/templates/wp-admin/settings/take-backup.php:69
53
  msgid "Last log message"
54
  msgstr ""
55
 
@@ -57,7 +57,7 @@ msgstr ""
57
  msgid "Starting automatic backup..."
58
  msgstr ""
59
 
60
- #: src/addons/autobackup.php:349, src/addons/autobackup.php:441, src/admin.php:879, src/methods/remotesend.php:71, src/methods/remotesend.php:79, src/methods/remotesend.php:245, src/methods/remotesend.php:262, src/methods/remotesend.php:310
61
  msgid "Unexpected response:"
62
  msgstr ""
63
 
@@ -97,7 +97,7 @@ msgstr ""
97
  msgid "now proceeding with the updates..."
98
  msgstr ""
99
 
100
- #: src/addons/autobackup.php:1072, src/admin.php:1058
101
  msgid "Be safe with an automatic backup"
102
  msgstr ""
103
 
@@ -109,7 +109,7 @@ msgstr ""
109
  msgid "Do not abort after pressing Proceed below - wait for the backup to complete."
110
  msgstr ""
111
 
112
- #: src/addons/autobackup.php:1104, src/admin.php:924
113
  msgid "Proceed with update"
114
  msgstr ""
115
 
@@ -145,11 +145,11 @@ msgstr ""
145
  msgid "You must add the following as the authorised redirect URI in your Azure console (under \"API Settings\") when asked"
146
  msgstr ""
147
 
148
- #: src/addons/azure.php:608, src/addons/migrator.php:948, src/admin.php:1235, src/admin.php:1239, src/admin.php:1243, src/admin.php:1247, src/admin.php:1251, src/admin.php:1260, src/admin.php:3960, src/admin.php:3967, src/admin.php:3969, src/admin.php:5328, src/methods/cloudfiles-new.php:100, src/methods/cloudfiles.php:440, src/methods/ftp.php:335, src/methods/openstack-base.php:571, src/methods/s3.php:865, src/methods/s3.php:869, src/methods/updraftvault.php:324, src/templates/wp-admin/settings/downloading-and-restoring.php:27, src/templates/wp-admin/settings/tab-backups.php:27, src/udaddons/updraftplus-addons.php:269
149
  msgid "Warning"
150
  msgstr ""
151
 
152
- #: src/addons/azure.php:608, src/admin.php:3960, src/methods/updraftvault.php:324
153
  msgid "Your web server's PHP installation does not included a <strong>required</strong> (for %s) module (%s). Please contact your web hosting provider's support and ask for them to enable it."
154
  msgstr ""
155
 
@@ -157,7 +157,7 @@ msgstr ""
157
  msgid "Create Azure credentials in your Azure developer console."
158
  msgstr ""
159
 
160
- #: src/addons/azure.php:612, src/addons/onedrive.php:1142, src/includes/class-remote-send.php:321
161
  msgid "For longer help, including screenshots, follow this link."
162
  msgstr ""
163
 
@@ -229,11 +229,11 @@ msgstr ""
229
  msgid "Azure China"
230
  msgstr ""
231
 
232
- #: src/addons/backblaze.php:205, src/admin.php:2220
233
  msgid "Error: unexpected file read fail"
234
  msgstr ""
235
 
236
- #: src/addons/backblaze.php:225, src/addons/cloudfiles-enhanced.php:117, src/addons/migrator.php:893, src/addons/migrator.php:1190, src/addons/migrator.php:1271, src/addons/migrator.php:1320, src/addons/migrator.php:1558, src/addons/s3-enhanced.php:161, src/addons/s3-enhanced.php:166, src/addons/s3-enhanced.php:168, src/addons/sftp.php:919, src/addons/webdav.php:203, src/admin.php:93, src/admin.php:893, src/includes/class-remote-send.php:273, src/includes/class-remote-send.php:300, src/includes/class-remote-send.php:306, src/includes/class-remote-send.php:369, src/includes/class-remote-send.php:428, src/includes/class-remote-send.php:455, src/includes/class-remote-send.php:478, src/includes/class-remote-send.php:488, src/includes/class-remote-send.php:493, src/methods/remotesend.php:76, src/methods/remotesend.php:259, src/methods/updraftvault.php:560, src/restorer.php:332, src/restorer.php:360, src/restorer.php:2104
237
  msgid "Error:"
238
  msgstr ""
239
 
@@ -601,7 +601,7 @@ msgstr ""
601
  msgid "You do not have access to this bucket"
602
  msgstr ""
603
 
604
- #: src/addons/googlecloud.php:329, src/addons/sftp.php:50, src/methods/addon-base-v2.php:74, src/methods/addon-base-v2.php:115, src/methods/addon-base-v2.php:149, src/methods/addon-base-v2.php:195, src/methods/addon-base-v2.php:285, src/methods/ftp.php:42, src/methods/googledrive.php:202, src/methods/googledrive.php:204, src/methods/remotesend.php:295, src/methods/stream-base.php:27, src/methods/stream-base.php:163, src/methods/stream-base.php:169, src/methods/stream-base.php:203, src/methods/stream-base.php:278
605
  msgid "No %s settings were found"
606
  msgstr ""
607
 
@@ -613,7 +613,7 @@ msgstr ""
613
  msgid "No refresh token was received from Google. This often means that you entered your client secret wrongly, or that you have not yet re-authenticated (below) since correcting it. Re-check it, then follow the link to authenticate again. Finally, if that does not work, then use expert mode to wipe all your settings, create a new Google client ID/secret, and start again."
614
  msgstr ""
615
 
616
- #: src/addons/googlecloud.php:445, src/addons/migrator.php:590, src/admin.php:2403, src/admin.php:2424, src/admin.php:2432, src/class-updraftplus.php:1015, src/class-updraftplus.php:1021, src/class-updraftplus.php:4138, src/class-updraftplus.php:4140, src/class-updraftplus.php:4305, src/class-updraftplus.php:4312, src/class-updraftplus.php:4383, src/methods/googledrive.php:401, src/methods/s3.php:344
617
  msgid "Error: %s"
618
  msgstr ""
619
 
@@ -657,7 +657,7 @@ msgstr ""
657
  msgid "You must save and authenticate before you can test your settings."
658
  msgstr ""
659
 
660
- #: src/addons/googlecloud.php:783, src/addons/googlecloud.php:817, src/addons/googlecloud.php:823, src/addons/sftp.php:549, src/admin.php:3514, src/admin.php:3550, src/admin.php:3560, src/methods/addon-base-v2.php:313, src/methods/stream-base.php:356
661
  msgid "Failed"
662
  msgstr ""
663
 
@@ -733,7 +733,7 @@ msgstr ""
733
  msgid "Otherwise, you can leave it blank."
734
  msgstr ""
735
 
736
- #: src/addons/googlecloud.php:1041, src/addons/migrator.php:493, src/addons/migrator.php:496, src/addons/migrator.php:499, src/admin.php:1239, src/admin.php:2642, src/backup.php:3296, src/class-updraftplus.php:4404, src/class-updraftplus.php:4404, src/updraftplus.php:157
737
  msgid "Go here for more information."
738
  msgstr ""
739
 
@@ -789,7 +789,7 @@ msgstr ""
789
  msgid "Supported backup plugins: %s"
790
  msgstr ""
791
 
792
- #: src/addons/importer.php:276, src/admin.php:4121, src/includes/class-backup-history.php:499
793
  msgid "Backup created by: %s."
794
  msgstr ""
795
 
@@ -813,7 +813,7 @@ msgstr ""
813
  msgid "No incremental backup of your files is possible, as no suitable existing backup was found to add increments to."
814
  msgstr ""
815
 
816
- #: src/addons/incremental.php:342, src/addons/reporting.php:261, src/admin.php:4053
817
  msgid "None"
818
  msgstr ""
819
 
@@ -821,23 +821,23 @@ msgstr ""
821
  msgid "Every hour"
822
  msgstr ""
823
 
824
- #: src/addons/incremental.php:344, src/addons/incremental.php:345, src/addons/incremental.php:346, src/addons/incremental.php:347, src/admin.php:3768, src/admin.php:3769, src/admin.php:3770, src/updraftplus.php:100, src/updraftplus.php:101, src/updraftplus.php:102
825
  msgid "Every %s hours"
826
  msgstr ""
827
 
828
- #: src/addons/incremental.php:348, src/admin.php:3771
829
  msgid "Daily"
830
  msgstr ""
831
 
832
- #: src/addons/incremental.php:349, src/admin.php:3772
833
  msgid "Weekly"
834
  msgstr ""
835
 
836
- #: src/addons/incremental.php:350, src/admin.php:3773
837
  msgid "Fortnightly"
838
  msgstr ""
839
 
840
- #: src/addons/incremental.php:351, src/admin.php:3774
841
  msgid "Monthly"
842
  msgstr ""
843
 
@@ -869,7 +869,7 @@ msgstr ""
869
  msgid "Please make sure that you have made a note of the password!"
870
  msgstr ""
871
 
872
- #: src/addons/lockadmin.php:171, src/addons/moredatabase.php:241, src/addons/sftp.php:455, src/addons/webdav.php:193, src/admin.php:2997, src/methods/openstack2.php:164, src/methods/updraftvault.php:382, src/templates/wp-admin/settings/updraftcentral-connect.php:50
873
  msgid "Password"
874
  msgstr ""
875
 
@@ -961,7 +961,7 @@ msgstr ""
961
  msgid "After pressing this button, you will be given the option to choose which components you wish to migrate"
962
  msgstr ""
963
 
964
- #: src/addons/migrator.php:274, src/admin.php:739, src/admin.php:926, src/admin.php:4219
965
  msgid "Restore"
966
  msgstr ""
967
 
@@ -985,7 +985,7 @@ msgstr ""
985
  msgid "Replace with"
986
  msgstr ""
987
 
988
- #: src/addons/migrator.php:340, src/addons/moredatabase.php:89, src/addons/moredatabase.php:91, src/addons/moredatabase.php:93, src/addons/sftp.php:518, src/addons/sftp.php:522, src/addons/sftp.php:526, src/addons/webdav.php:253, src/admin.php:945, src/includes/class-remote-send.php:470, src/methods/addon-base-v2.php:305, src/methods/cloudfiles-new.php:184, src/methods/cloudfiles-new.php:189, src/methods/cloudfiles.php:519, src/methods/cloudfiles.php:524, src/methods/ftp.php:417, src/methods/ftp.php:421, src/methods/openstack2.php:180, src/methods/openstack2.php:185, src/methods/openstack2.php:190, src/methods/openstack2.php:195, src/methods/s3.php:1139, src/methods/s3.php:1143
989
  msgid "Failure: No %s was given."
990
  msgstr ""
991
 
@@ -1057,7 +1057,7 @@ msgstr ""
1057
  msgid "other content from wp-content"
1058
  msgstr ""
1059
 
1060
- #: src/addons/migrator.php:499, src/addons/multisite.php:692
1061
  msgid "Must-use plugins"
1062
  msgstr ""
1063
 
@@ -1187,7 +1187,7 @@ msgstr ""
1187
  msgid "SQL update commands run:"
1188
  msgstr ""
1189
 
1190
- #: src/addons/migrator.php:1305, src/admin.php:890
1191
  msgid "Errors:"
1192
  msgstr ""
1193
 
@@ -1195,7 +1195,7 @@ msgstr ""
1195
  msgid "Time taken (seconds):"
1196
  msgstr ""
1197
 
1198
- #: src/addons/migrator.php:1320, src/restorer.php:3015
1199
  msgid "the database query being run was:"
1200
  msgstr ""
1201
 
@@ -1239,7 +1239,7 @@ msgstr ""
1239
  msgid "Paste key here"
1240
  msgstr ""
1241
 
1242
- #: src/addons/migrator.php:1748, src/admin.php:938
1243
  msgid "Add site"
1244
  msgstr ""
1245
 
@@ -1259,7 +1259,7 @@ msgstr ""
1259
  msgid "Enter your chosen name"
1260
  msgstr ""
1261
 
1262
- #: src/addons/migrator.php:1761, src/addons/sftp.php:463, src/admin.php:944, src/admin.php:5176, src/templates/wp-admin/settings/temporary-clone.php:63
1263
  msgid "Key"
1264
  msgstr ""
1265
 
@@ -1331,7 +1331,7 @@ msgstr ""
1331
  msgid "%s total table(s) found; %s with the indicated prefix."
1332
  msgstr ""
1333
 
1334
- #: src/addons/moredatabase.php:144, src/admin.php:1730
1335
  msgid "Messages:"
1336
  msgstr ""
1337
 
@@ -1375,7 +1375,7 @@ msgstr ""
1375
  msgid "Username"
1376
  msgstr ""
1377
 
1378
- #: src/addons/moredatabase.php:242, src/addons/reporting.php:276, src/addons/wp-cli.php:432, src/admin.php:360, src/admin.php:4028, src/admin.php:4081, src/includes/class-remote-send.php:338, src/includes/class-wpadmin-commands.php:157, src/includes/class-wpadmin-commands.php:521, src/restorer.php:466, src/templates/wp-admin/settings/delete-and-restore-modals.php:74, src/templates/wp-admin/settings/delete-and-restore-modals.php:75, src/templates/wp-admin/settings/take-backup.php:34
1379
  msgid "Database"
1380
  msgstr ""
1381
 
@@ -1427,7 +1427,7 @@ msgstr ""
1427
  msgid "(None configured)"
1428
  msgstr ""
1429
 
1430
- #: src/addons/morefiles.php:71, src/admin.php:953
1431
  msgctxt "(verb)"
1432
  msgid "Download"
1433
  msgstr ""
@@ -1436,11 +1436,11 @@ msgstr ""
1436
  msgid "Contains:"
1437
  msgstr ""
1438
 
1439
- #: src/addons/morefiles.php:137, src/templates/wp-admin/settings/delete-and-restore-modals.php:75
1440
  msgid "%s restoration options:"
1441
  msgstr ""
1442
 
1443
- #: src/addons/morefiles.php:137, src/includes/class-wpadmin-commands.php:523
1444
  msgid "WordPress Core"
1445
  msgstr ""
1446
 
@@ -1512,7 +1512,7 @@ msgstr ""
1512
  msgid "Go up a directory"
1513
  msgstr ""
1514
 
1515
- #: src/addons/morefiles.php:311, src/admin.php:919
1516
  msgid "Cancel"
1517
  msgstr ""
1518
 
@@ -1528,7 +1528,7 @@ msgstr ""
1528
  msgid "Exclude these:"
1529
  msgstr ""
1530
 
1531
- #: src/addons/morefiles.php:476, src/admin.php:3882
1532
  msgid "If entering multiple files/directories, then separate them with commas. For entities at the top level, you can use a * at the start or end of the entry as a wildcard."
1533
  msgstr ""
1534
 
@@ -1544,11 +1544,11 @@ msgstr ""
1544
  msgid "(as many as you like)"
1545
  msgstr ""
1546
 
1547
- #: src/addons/morestorage.php:81, src/admin.php:999
1548
  msgid "Currently enabled"
1549
  msgstr ""
1550
 
1551
- #: src/addons/morestorage.php:81, src/admin.php:1000
1552
  msgid "Currently disabled"
1553
  msgstr ""
1554
 
@@ -1568,35 +1568,35 @@ msgstr ""
1568
  msgid "(Nothing has been logged yet)"
1569
  msgstr ""
1570
 
1571
- #: src/addons/multisite.php:96, src/addons/multisite.php:736, src/options.php:74
1572
  msgid "UpdraftPlus Backups"
1573
  msgstr ""
1574
 
1575
- #: src/addons/multisite.php:207
1576
  msgid "Multisite Install"
1577
  msgstr ""
1578
 
1579
- #: src/addons/multisite.php:500, src/class-updraftplus.php:1799
1580
  msgid "Uploads"
1581
  msgstr ""
1582
 
1583
- #: src/addons/multisite.php:601
1584
  msgid "Which site to restore"
1585
  msgstr ""
1586
 
1587
- #: src/addons/multisite.php:605
1588
  msgid "All sites"
1589
  msgstr ""
1590
 
1591
- #: src/addons/multisite.php:610
1592
  msgid "may include some site-wide data"
1593
  msgstr ""
1594
 
1595
- #: src/addons/multisite.php:619
1596
  msgid "Read more..."
1597
  msgstr ""
1598
 
1599
- #: src/addons/multisite.php:699
1600
  msgid "Blog uploads"
1601
  msgstr ""
1602
 
@@ -1700,7 +1700,7 @@ msgstr ""
1700
  msgid "If OneDrive later shows you the message \"unauthorized_client\", then you did not enter a valid client ID here."
1701
  msgstr ""
1702
 
1703
- #: src/addons/onedrive.php:1180, src/restorer.php:1249
1704
  msgid "folder"
1705
  msgstr ""
1706
 
@@ -1780,7 +1780,7 @@ msgstr ""
1780
  msgid "Time taken:"
1781
  msgstr ""
1782
 
1783
- #: src/addons/reporting.php:239, src/admin.php:4041
1784
  msgid "Uploaded to:"
1785
  msgstr ""
1786
 
@@ -1816,11 +1816,11 @@ msgstr ""
1816
  msgid "Log all messages to syslog (only server admins are likely to want this)"
1817
  msgstr ""
1818
 
1819
- #: src/addons/reporting.php:539, src/admin.php:874
1820
  msgid "To send to more than one address, separate each address with a comma."
1821
  msgstr ""
1822
 
1823
- #: src/addons/reporting.php:541, src/admin.php:868
1824
  msgid "Send a report only when there are warnings/errors"
1825
  msgstr ""
1826
 
@@ -1828,7 +1828,7 @@ msgstr ""
1828
  msgid "Be aware that mail servers tend to have size limits; typically around %s MB; backups larger than any limits will likely not arrive."
1829
  msgstr ""
1830
 
1831
- #: src/addons/reporting.php:543, src/admin.php:869
1832
  msgid "When the Email storage method is enabled, also send the backup"
1833
  msgstr ""
1834
 
@@ -1840,7 +1840,7 @@ msgstr ""
1840
  msgid "Use this option to only send database backups when sending to email, and skip other components."
1841
  msgstr ""
1842
 
1843
- #: src/addons/reporting.php:545, src/admin.php:872
1844
  msgid "Only email the database backup"
1845
  msgstr ""
1846
 
@@ -2229,11 +2229,11 @@ msgstr ""
2229
  msgid "No previous backup found to add an increment to."
2230
  msgstr ""
2231
 
2232
- #: src/addons/wp-cli.php:110, src/admin.php:877
2233
  msgid "You have chosen to backup a database, but no tables have been selected"
2234
  msgstr ""
2235
 
2236
- #: src/addons/wp-cli.php:116, src/admin.php:875
2237
  msgid "If you exclude both the database and the files, then you have excluded everything!"
2238
  msgstr ""
2239
 
@@ -2265,27 +2265,27 @@ msgstr ""
2265
  msgid "Latest full backup found; identifier:"
2266
  msgstr ""
2267
 
2268
- #: src/addons/wp-cli.php:430, src/admin.php:4075, src/admin.php:4123
2269
  msgid "unknown source"
2270
  msgstr ""
2271
 
2272
- #: src/addons/wp-cli.php:432, src/admin.php:4081
2273
  msgid "Database (created by %s)"
2274
  msgstr ""
2275
 
2276
- #: src/addons/wp-cli.php:438, src/admin.php:4083
2277
  msgid "External database"
2278
  msgstr ""
2279
 
2280
- #: src/addons/wp-cli.php:450, src/admin.php:4127
2281
  msgid "Files and database WordPress backup (created by %s)"
2282
  msgstr ""
2283
 
2284
- #: src/addons/wp-cli.php:450, src/admin.php:4127
2285
  msgid "Files backup (created by %s)"
2286
  msgstr ""
2287
 
2288
- #: src/addons/wp-cli.php:519, src/admin.php:894, src/class-updraftplus.php:1316, src/class-updraftplus.php:1360, src/includes/class-filesystem-functions.php:409, src/includes/class-storage-methods-interface.php:324, src/methods/addon-base-v2.php:93, src/methods/addon-base-v2.php:98, src/methods/addon-base-v2.php:205, src/methods/addon-base-v2.php:225, src/methods/googledrive.php:1118, src/methods/remotesend.php:315, src/methods/stream-base.php:219, src/restorer.php:3165, src/restorer.php:3190, src/restorer.php:3271, src/udaddons/options.php:227, src/updraftplus.php:157
2289
  msgid "Error"
2290
  msgstr ""
2291
 
@@ -2305,11 +2305,11 @@ msgstr ""
2305
  msgid "No valid components found, please select different components or a backup set with components that can be restored."
2306
  msgstr ""
2307
 
2308
- #: src/addons/wp-cli.php:650, src/admin.php:4611
2309
  msgid "UpdraftPlus Restoration: Progress"
2310
  msgstr ""
2311
 
2312
- #: src/addons/wp-cli.php:664, src/admin.php:4614
2313
  msgid "Follow this link to download the log file for this restoration (needed for any support requests)."
2314
  msgstr ""
2315
 
@@ -2325,7 +2325,7 @@ msgstr ""
2325
  msgid "You have given the %1$s option. The %1$s is working with \"%2$s\" addon. Get the \"%2$s\" addon: %3$s"
2326
  msgstr ""
2327
 
2328
- #: src/addons/wp-cli.php:872, src/includes/class-filesystem-functions.php:75
2329
  msgid "Why am I seeing this?"
2330
  msgstr ""
2331
 
@@ -2349,7 +2349,7 @@ msgstr ""
2349
  msgid "At the same time as the files backup"
2350
  msgstr ""
2351
 
2352
- #: src/admin.php:350, src/admin.php:5145, src/templates/wp-admin/settings/take-backup.php:24
2353
  msgid "Files"
2354
  msgstr ""
2355
 
@@ -2373,1254 +2373,1270 @@ msgstr ""
2373
  msgid "Are you sure you want to dismiss all UpdraftPlus news forever?"
2374
  msgstr ""
2375
 
2376
- #: src/admin.php:577
2377
  msgid "You can test upgrading your site on an instant copy using UpdraftClone credits"
2378
  msgstr ""
2379
 
2380
- #: src/admin.php:577, src/udaddons/updraftplus-addons.php:278, src/udaddons/updraftplus-addons.php:290
2381
- msgid "go here"
 
 
 
 
2382
  msgstr ""
2383
 
2384
- #: src/admin.php:588
2385
  msgid "You can test running your site on a different PHP (or WordPress) version using UpdraftClone credits."
2386
  msgstr ""
2387
 
2388
- #: src/admin.php:739
 
 
 
 
2389
  msgid "Backup"
2390
  msgstr ""
2391
 
2392
- #: src/admin.php:747, src/admin.php:2845
2393
  msgid "Migrate / Clone"
2394
  msgstr ""
2395
 
2396
- #: src/admin.php:755, src/admin.php:1172, src/admin.php:2846
2397
  msgid "Settings"
2398
  msgstr ""
2399
 
2400
- #: src/admin.php:763, src/admin.php:2847
2401
  msgid "Advanced Tools"
2402
  msgstr ""
2403
 
2404
- #: src/admin.php:771
2405
  msgid "Extensions"
2406
  msgstr ""
2407
 
2408
- #: src/admin.php:870
2409
  msgid "Be aware that mail servers tend to have size limits; typically around %s Mb; backups larger than any limits will likely not arrive."
2410
  msgstr ""
2411
 
2412
- #: src/admin.php:871
2413
  msgid "Rescanning (looking for backups that you have uploaded manually into the internal backup store)..."
2414
  msgstr ""
2415
 
2416
- #: src/admin.php:873
2417
  msgid "Rescanning remote and local storage for backup sets..."
2418
  msgstr ""
2419
 
2420
- #: src/admin.php:876
2421
  msgid "You have chosen to backup files, but no file entities have been selected"
2422
  msgstr ""
2423
 
2424
- #: src/admin.php:878
2425
  msgid "The restore operation has begun. Do not press stop or close your browser until it reports itself as having finished."
2426
  msgstr ""
2427
 
2428
- #: src/admin.php:880
2429
  msgid "The web server returned an error code (try again, or check your web server logs)"
2430
  msgstr ""
2431
 
2432
- #: src/admin.php:881
2433
  msgid "The new user's RackSpace console password is (this will not be shown again):"
2434
  msgstr ""
2435
 
2436
- #: src/admin.php:882
2437
  msgid "Trying..."
2438
  msgstr ""
2439
 
2440
- #: src/admin.php:883
2441
  msgid "Fetching..."
2442
  msgstr ""
2443
 
2444
- #: src/admin.php:884
2445
  msgid "calculating..."
2446
  msgstr ""
2447
 
2448
- #: src/admin.php:885
2449
  msgid "Begun looking for this entity"
2450
  msgstr ""
2451
 
2452
- #: src/admin.php:886
2453
  msgid "Some files are still downloading or being processed - please wait."
2454
  msgstr ""
2455
 
2456
- #: src/admin.php:887
2457
  msgid "Processing files - please wait..."
2458
  msgstr ""
2459
 
2460
- #: src/admin.php:888
2461
  msgid "Error: the server sent an empty response."
2462
  msgstr ""
2463
 
2464
- #: src/admin.php:889
2465
  msgid "Warnings:"
2466
  msgstr ""
2467
 
2468
- #: src/admin.php:891
2469
  msgid "Error: the server sent us a response which we did not understand."
2470
  msgstr ""
2471
 
2472
- #: src/admin.php:892, src/restorer.php:180
2473
  msgid "Error data:"
2474
  msgstr ""
2475
 
2476
- #: src/admin.php:895, src/admin.php:2006, src/includes/deprecated-actions.php:29, src/templates/wp-admin/settings/downloading-and-restoring.php:21, src/templates/wp-admin/settings/tab-backups.php:21, src/templates/wp-admin/settings/tab-backups.php:44
2477
  msgid "Existing Backups"
2478
  msgstr ""
2479
 
2480
- #: src/admin.php:896, src/admin.php:2298
2481
  msgid "File ready."
2482
  msgstr ""
2483
 
2484
- #: src/admin.php:897, src/admin.php:2625, src/admin.php:3483, src/admin.php:4508, src/admin.php:4518, src/admin.php:4527, src/templates/wp-admin/settings/existing-backups-table.php:19, src/templates/wp-admin/settings/existing-backups-table.php:137
2485
  msgid "Actions"
2486
  msgstr ""
2487
 
2488
- #: src/admin.php:898
2489
  msgid "Delete from your web server"
2490
  msgstr ""
2491
 
2492
- #: src/admin.php:899
2493
  msgid "Download to your computer"
2494
  msgstr ""
2495
 
2496
- #: src/admin.php:900
2497
  msgid "Browse contents"
2498
  msgstr ""
2499
 
2500
- #: src/admin.php:901
2501
  msgid "Download error: the server sent us a response which we did not understand."
2502
  msgstr ""
2503
 
2504
- #: src/admin.php:902
2505
  msgid "Requesting start of backup..."
2506
  msgstr ""
2507
 
2508
- #: src/admin.php:903
2509
  msgid "PHP information"
2510
  msgstr ""
2511
 
2512
- #: src/admin.php:904, src/admin.php:3197
2513
  msgid "Delete Old Directories"
2514
  msgstr ""
2515
 
2516
- #: src/admin.php:905
2517
  msgid "Raw backup history"
2518
  msgstr ""
2519
 
2520
- #: src/admin.php:906, src/admin.php:907, src/includes/class-backup-history.php:506
2521
  msgid "This file does not appear to be an UpdraftPlus backup archive (such files are .zip or .gz files which have a name like: backup_(time)_(site name)_(code)_(type).(zip|gz))."
2522
  msgstr ""
2523
 
2524
- #: src/admin.php:906
2525
  msgid "However, UpdraftPlus archives are standard zip/SQL files - so if you are sure that your file has the right format, then you can rename it to match that pattern."
2526
  msgstr ""
2527
 
2528
- #: src/admin.php:907, src/includes/class-backup-history.php:506
2529
  msgid "If this is a backup created by a different backup plugin, then UpdraftPlus Premium may be able to help you."
2530
  msgstr ""
2531
 
2532
- #: src/admin.php:908
2533
  msgid "(make sure that you were trying to upload a zip file previously created by UpdraftPlus)"
2534
  msgstr ""
2535
 
2536
- #: src/admin.php:909
2537
  msgid "Upload error:"
2538
  msgstr ""
2539
 
2540
- #: src/admin.php:910
2541
  msgid "This file does not appear to be an UpdraftPlus encrypted database archive (such files are .gz.crypt files which have a name like: backup_(time)_(site name)_(code)_db.crypt.gz)."
2542
  msgstr ""
2543
 
2544
- #: src/admin.php:911
2545
  msgid "Upload error"
2546
  msgstr ""
2547
 
2548
- #: src/admin.php:912
2549
  msgid "Follow this link to attempt decryption and download the database file to your computer."
2550
  msgstr ""
2551
 
2552
- #: src/admin.php:913
2553
  msgid "This decryption key will be attempted:"
2554
  msgstr ""
2555
 
2556
- #: src/admin.php:914
2557
  msgid "Unknown server response:"
2558
  msgstr ""
2559
 
2560
- #: src/admin.php:915
2561
  msgid "Unknown server response status:"
2562
  msgstr ""
2563
 
2564
- #: src/admin.php:916
2565
  msgid "The file was uploaded."
2566
  msgstr ""
2567
 
2568
- #: src/admin.php:918, src/templates/wp-admin/settings/take-backup.php:51
2569
  msgid "Backup Now"
2570
  msgstr ""
2571
 
2572
- #: src/admin.php:920, src/admin.php:3511, src/admin.php:3545, src/admin.php:4318, src/includes/class-remote-send.php:560, src/templates/wp-admin/settings/existing-backups-table.php:153, src/templates/wp-admin/settings/file-backup-exclude.php:11
2573
  msgid "Delete"
2574
  msgstr ""
2575
 
2576
- #: src/admin.php:921, src/central/bootstrap.php:565
2577
  msgid "Create"
2578
  msgstr ""
2579
 
2580
- #: src/admin.php:922, src/admin.php:4298
2581
  msgid "Upload"
2582
  msgstr ""
2583
 
2584
- #: src/admin.php:923
2585
  msgid "You did not select any components to restore. Please select at least one, and then try again."
2586
  msgstr ""
2587
 
2588
- #: src/admin.php:925, src/includes/updraftplus-tour.php:89
2589
  msgid "Close"
2590
  msgstr ""
2591
 
2592
- #: src/admin.php:927, src/admin.php:3749
2593
  msgid "Download log file"
2594
  msgstr ""
2595
 
2596
- #: src/admin.php:929, src/admin.php:955, src/admin.php:956
2597
  msgid "You have made changes to your settings, and not saved."
2598
  msgstr ""
2599
 
2600
- #: src/admin.php:930
2601
  msgid "Saving..."
2602
  msgstr ""
2603
 
2604
- #: src/admin.php:931, src/admin.php:2928, src/methods/updraftvault.php:337, src/methods/updraftvault.php:383, src/templates/wp-admin/settings/temporary-clone.php:82
2605
  msgid "Connect"
2606
  msgstr ""
2607
 
2608
- #: src/admin.php:932
2609
  msgid "Connecting..."
2610
  msgstr ""
2611
 
2612
- #: src/admin.php:933, src/methods/updraftvault.php:413, src/methods/updraftvault.php:483
2613
  msgid "Disconnect"
2614
  msgstr ""
2615
 
2616
- #: src/admin.php:934
2617
  msgid "Disconnecting..."
2618
  msgstr ""
2619
 
2620
- #: src/admin.php:935
2621
  msgid "Counting..."
2622
  msgstr ""
2623
 
2624
- #: src/admin.php:936
2625
  msgid "Update quota count"
2626
  msgstr ""
2627
 
2628
- #: src/admin.php:937
2629
  msgid "Adding..."
2630
  msgstr ""
2631
 
2632
- #: src/admin.php:939
2633
  msgid "Resetting..."
2634
  msgstr ""
2635
 
2636
- #: src/admin.php:940
2637
  msgid "Creating..."
2638
  msgstr ""
2639
 
2640
- #: src/admin.php:940
2641
  msgid "your PHP install lacks the openssl module; as a result, this can take minutes; if nothing has happened by then, then you should either try a smaller key size, or ask your web hosting company how to enable this PHP module on your setup."
2642
  msgstr ""
2643
 
2644
- #: src/admin.php:941, src/includes/class-remote-send.php:530
2645
  msgid "Send to site:"
2646
  msgstr ""
2647
 
2648
- #: src/admin.php:942, src/includes/class-remote-send.php:306
2649
  msgid "You should check that the remote site is online, not firewalled, does not have security modules that may be blocking access, has UpdraftPlus version %s or later active and that the keys have been entered correctly."
2650
  msgstr ""
2651
 
2652
- #: src/admin.php:943
2653
  msgid "Please give this key a name (e.g. indicate the site it is for):"
2654
  msgstr ""
2655
 
2656
- #: src/admin.php:945
2657
  msgid "key name"
2658
  msgstr ""
2659
 
2660
- #: src/admin.php:946, src/templates/wp-admin/settings/existing-backups-table.php:159
2661
  msgid "Deleting..."
2662
  msgstr ""
2663
 
2664
- #: src/admin.php:947
2665
  msgid "Please enter a valid URL"
2666
  msgstr ""
2667
 
2668
- #: src/admin.php:948
2669
  msgid "We requested to delete the file, but could not understand the server's response"
2670
  msgstr ""
2671
 
2672
- #: src/admin.php:949, src/includes/class-remote-send.php:334
2673
  msgid "Testing connection..."
2674
  msgstr ""
2675
 
2676
- #: src/admin.php:950, src/includes/class-remote-send.php:365, src/includes/class-remote-send.php:536
2677
  msgid "Send"
2678
  msgstr ""
2679
 
2680
- #: src/admin.php:954
2681
  msgid "With UpdraftPlus Premium, you can directly download individual files from here."
2682
  msgstr ""
2683
 
2684
- #: src/admin.php:955
2685
  msgid "You should save your changes to ensure that they are used for making your backup."
2686
  msgstr ""
2687
 
2688
- #: src/admin.php:956
2689
  msgid "Your export file will be of your displayed settings, not your saved ones."
2690
  msgstr ""
2691
 
2692
- #: src/admin.php:959
2693
  msgid "day"
2694
  msgstr ""
2695
 
2696
- #: src/admin.php:960
2697
  msgid "in the month"
2698
  msgstr ""
2699
 
2700
- #: src/admin.php:961
2701
  msgid "day(s)"
2702
  msgstr ""
2703
 
2704
- #: src/admin.php:962
2705
  msgid "hour(s)"
2706
  msgstr ""
2707
 
2708
- #: src/admin.php:963
2709
  msgid "week(s)"
2710
  msgstr ""
2711
 
2712
- #: src/admin.php:964
2713
  msgid "For backups older than"
2714
  msgstr ""
2715
 
2716
- #: src/admin.php:966
2717
  msgid "Processing..."
2718
  msgstr ""
2719
 
2720
- #: src/admin.php:967
2721
  msgid "Please fill in the required information."
2722
  msgstr ""
2723
 
2724
- #: src/admin.php:968, src/methods/backup-module.php:317
2725
  msgid "Test %s Settings"
2726
  msgstr ""
2727
 
2728
- #: src/admin.php:969
2729
  msgid "Testing %s Settings..."
2730
  msgstr ""
2731
 
2732
- #: src/admin.php:970
2733
  msgid "%s settings test result:"
2734
  msgstr ""
2735
 
2736
- #: src/admin.php:971
2737
  msgid "Nothing yet logged"
2738
  msgstr ""
2739
 
2740
- #: src/admin.php:972
2741
  msgid "You have not yet selected a file to import."
2742
  msgstr ""
2743
 
2744
- #: src/admin.php:973
2745
  msgid "Error: The chosen file is corrupt. Please choose a valid UpdraftPlus export file."
2746
  msgstr ""
2747
 
2748
- #: src/admin.php:976
2749
  msgid "Importing..."
2750
  msgstr ""
2751
 
2752
- #: src/admin.php:977
2753
  msgid "This will import data from:"
2754
  msgstr ""
2755
 
2756
- #: src/admin.php:978
2757
  msgid "Which was exported on:"
2758
  msgstr ""
2759
 
2760
- #: src/admin.php:979
2761
  msgid "Do you want to carry out the import?"
2762
  msgstr ""
2763
 
2764
- #: src/admin.php:980
2765
  msgid "Complete"
2766
  msgstr ""
2767
 
2768
- #: src/admin.php:981, src/admin.php:3256
2769
  msgid "The backup has finished running"
2770
  msgstr ""
2771
 
2772
- #: src/admin.php:982
2773
  msgid "The backup was aborted"
2774
  msgstr ""
2775
 
2776
- #: src/admin.php:984
2777
  msgid "remote files deleted"
2778
  msgstr ""
2779
 
2780
- #: src/admin.php:985
2781
  msgid "HTTP code:"
2782
  msgstr ""
2783
 
2784
- #: src/admin.php:986
2785
  msgid "The file failed to upload. Please check the following:"
2786
  msgstr ""
2787
 
2788
- #: src/admin.php:986
2789
  msgid "Any settings in your .htaccess or web.config file that affects the maximum upload or post size."
2790
  msgstr ""
2791
 
2792
- #: src/admin.php:986
2793
  msgid "The available memory on the server."
2794
  msgstr ""
2795
 
2796
- #: src/admin.php:986
2797
  msgid "That you are attempting to upload a zip file previously created by UpdraftPlus."
2798
  msgstr ""
2799
 
2800
- #: src/admin.php:986
2801
  msgid "Further information may be found in the browser JavaScript console, and the server PHP error logs."
2802
  msgstr ""
2803
 
2804
- #: src/admin.php:987
2805
  msgid "Browsing zip file"
2806
  msgstr ""
2807
 
2808
- #: src/admin.php:988
2809
  msgid "Select a file to view information about it"
2810
  msgstr ""
2811
 
2812
- #: src/admin.php:989
2813
  msgid "Search"
2814
  msgstr ""
2815
 
2816
- #: src/admin.php:990
2817
  msgid "Unable to download file. This could be caused by a timeout. It would be best to download the zip to your computer."
2818
  msgstr ""
2819
 
2820
- #: src/admin.php:991
2821
  msgid "Loading log file"
2822
  msgstr ""
2823
 
2824
- #: src/admin.php:994
2825
  msgid "Please enter a valid URL e.g http://example.com"
2826
  msgstr ""
2827
 
2828
- #: src/admin.php:1001
2829
  msgid "Local backup upload has started; please check the log file to see the upload progress"
2830
  msgstr ""
2831
 
2832
- #: src/admin.php:1002
2833
  msgid "You must select at least one remote storage destination to upload this backup set to."
2834
  msgstr ""
2835
 
2836
- #: src/admin.php:1003
2837
  msgid "(already uploaded)"
2838
  msgstr ""
2839
 
2840
- #: src/admin.php:1004
2841
  msgid "Please specify the Microsoft OneDrive folder name, not the URL."
2842
  msgstr ""
2843
 
2844
- #: src/admin.php:1005, src/templates/wp-admin/settings/updraftcentral-connect.php:9
2845
  msgid "UpdraftCentral Cloud"
2846
  msgstr ""
2847
 
2848
- #: src/admin.php:1006
2849
  msgid "Connected. Requesting UpdraftCentral Key."
2850
  msgstr ""
2851
 
2852
- #: src/admin.php:1007
2853
  msgid "Key created. Adding site to UpdraftCentral Cloud."
2854
  msgstr ""
2855
 
2856
- #: src/admin.php:1008
2857
  msgid "Login successful."
2858
  msgstr ""
2859
 
2860
- #: src/admin.php:1008, src/admin.php:1010
2861
  msgid "Please follow this link to open %s in a new window."
2862
  msgstr ""
2863
 
2864
- #: src/admin.php:1009
2865
  msgid "Login successful; reloading information."
2866
  msgstr ""
2867
 
2868
- #: src/admin.php:1010
2869
  msgid "Registration successful."
2870
  msgstr ""
2871
 
2872
- #: src/admin.php:1011
2873
  msgid "Both email and password fields are required."
2874
  msgstr ""
2875
 
2876
- #: src/admin.php:1012
2877
  msgid "An email is required and needs to be in a valid format."
2878
  msgstr ""
2879
 
2880
- #: src/admin.php:1013
2881
  msgid "Trouble connecting? Try using an alternative method in the advanced security options."
2882
  msgstr ""
2883
 
2884
- #: src/admin.php:1014
2885
  msgid "Verifying one-time password..."
2886
  msgstr ""
2887
 
2888
- #: src/admin.php:1015
2889
  msgid "Perhaps you would want to login instead."
2890
  msgstr ""
2891
 
2892
- #: src/admin.php:1016
2893
  msgid "Please wait while the system generates and registers an encryption key for your website with UpdraftCentral Cloud."
2894
  msgstr ""
2895
 
2896
- #: src/admin.php:1017
2897
  msgid "Please wait while you are redirected to UpdraftCentral Cloud."
2898
  msgstr ""
2899
 
2900
- #: src/admin.php:1018
2901
  msgid "You need to read and accept the UpdraftCentral Cloud data and privacy policies before you can proceed."
2902
  msgstr ""
2903
 
2904
- #: src/admin.php:1019
2905
  msgid "You can also close this wizard."
2906
  msgstr ""
2907
 
2908
- #: src/admin.php:1020
2909
  msgid "For future control of all your UpdraftCentral connections, go to the \"Advanced Tools\" tab."
2910
  msgstr ""
2911
 
2912
- #: src/admin.php:1022
2913
  msgid "Warning: you have selected a lower version than your currently installed version. This may fail if you have components that are incompatible with earlier versions."
2914
  msgstr ""
2915
 
2916
- #: src/admin.php:1023
2917
  msgid "The clone has been provisioned, and its data has been sent to it. Once the clone has finished deploying it, you will receive an email."
2918
  msgstr ""
2919
 
2920
- #: src/admin.php:1024
2921
  msgid "The preparation of the clone data has been aborted."
2922
  msgstr ""
2923
 
2924
- #: src/admin.php:1026
2925
  msgid "Are you sure you want to remove this exclusion rule?"
2926
  msgstr ""
2927
 
2928
- #: src/admin.php:1027
2929
  msgid "Please select a file/folder which you would like to exclude"
2930
  msgstr ""
2931
 
2932
- #: src/admin.php:1028
2933
  msgid "Please enter a file extension, like zip"
2934
  msgstr ""
2935
 
2936
- #: src/admin.php:1029
2937
  msgid "Please enter a valid file extension"
2938
  msgstr ""
2939
 
2940
- #: src/admin.php:1030
2941
  msgid "Please enter characters that begin the filename which you would like to exclude"
2942
  msgstr ""
2943
 
2944
- #: src/admin.php:1031
2945
  msgid "Please enter a valid file name prefix"
2946
  msgstr ""
2947
 
2948
- #: src/admin.php:1032
2949
  msgid "The exclusion rule which you are trying to add already exists"
2950
  msgstr ""
2951
 
2952
- #: src/admin.php:1033
2953
  msgid "UpdraftClone key is required."
2954
  msgstr ""
2955
 
2956
- #: src/admin.php:1034, src/templates/wp-admin/settings/backupnow-modal.php:40
2957
  msgid "Include your files in the backup"
2958
  msgstr ""
2959
 
2960
- #: src/admin.php:1035
2961
  msgid "File backup options"
2962
  msgstr ""
2963
 
2964
- #: src/admin.php:1174
 
 
 
 
2965
  msgid "Add-Ons / Pro Support"
2966
  msgstr ""
2967
 
2968
- #: src/admin.php:1221
2969
  msgid "An error occurred when fetching storage module options: "
2970
  msgstr ""
2971
 
2972
- #: src/admin.php:1226, src/includes/class-commands.php:466, src/templates/wp-admin/settings/take-backup.php:13
2973
  msgid "The 'Backup Now' button is disabled as your backup directory is not writable (go to the 'Settings' tab and find the relevant option)."
2974
  msgstr ""
2975
 
2976
- #: src/admin.php:1231
2977
  msgid "Welcome to UpdraftPlus!"
2978
  msgstr ""
2979
 
2980
- #: src/admin.php:1231
2981
  msgid "To make a backup, just press the Backup Now button."
2982
  msgstr ""
2983
 
2984
- #: src/admin.php:1231
2985
  msgid "To change any of the default settings of what is backed up, to configure scheduled backups, to send your backups to remote storage (recommended), and more, go to the settings tab."
2986
  msgstr ""
2987
 
2988
- #: src/admin.php:1235, src/class-updraftplus.php:864
2989
  msgid "The amount of time allowed for WordPress plugins to run is very low (%s seconds) - you should increase it to avoid backup failures due to time-outs (consult your web hosting company for more help - it is the max_execution_time PHP setting; the recommended value is %s seconds or more)"
2990
  msgstr ""
2991
 
2992
- #: src/admin.php:1239
2993
  msgid "The scheduler is disabled in your WordPress install, via the DISABLE_WP_CRON setting. No backups can run (even &quot;Backup Now&quot;) unless either you have set up a facility to call the scheduler manually, or until it is enabled."
2994
  msgstr ""
2995
 
2996
- #: src/admin.php:1243
2997
  msgid "You have less than %s of free disk space on the disk which UpdraftPlus is configured to use to create backups. UpdraftPlus could well run out of space. Contact your the operator of your server (e.g. your web hosting company) to resolve this issue."
2998
  msgstr ""
2999
 
3000
- #: src/admin.php:1247
3001
  msgid "UpdraftPlus does not officially support versions of WordPress before %s. It may work for you, but if it does not, then please be aware that no support is available until you upgrade WordPress."
3002
  msgstr ""
3003
 
3004
- #: src/admin.php:1251
3005
  msgid "Your website is hosted using the %s web server."
3006
  msgstr ""
3007
 
3008
- #: src/admin.php:1251
3009
  msgid "Please consult this FAQ if you have problems backing up."
3010
  msgstr ""
3011
 
3012
- #: src/admin.php:1255
3013
  msgid "Notice"
3014
  msgstr ""
3015
 
3016
- #: src/admin.php:1255
3017
  msgid "UpdraftPlus's debug mode is on. You may see debugging notices on this page not just from UpdraftPlus, but from any other plugin installed. Please try to make sure that the notice you are seeing is from UpdraftPlus before you raise a support request."
3018
  msgstr ""
3019
 
3020
- #: src/admin.php:1260
3021
  msgid "WordPress has a number (%d) of scheduled tasks which are overdue. Unless this is a development site, this probably means that the scheduler in your WordPress install is not working."
3022
  msgstr ""
3023
 
3024
- #: src/admin.php:1260
3025
  msgid "Read this page for a guide to possible causes and how to fix it."
3026
  msgstr ""
3027
 
3028
- #: src/admin.php:1280, src/admin.php:1301, src/admin.php:1320, src/class-updraftplus.php:600, src/class-updraftplus.php:635, src/class-updraftplus.php:640, src/class-updraftplus.php:645
3029
  msgid "UpdraftPlus notice:"
3030
  msgstr ""
3031
 
3032
- #: src/admin.php:1280
3033
  msgid "%s has been chosen for remote storage, but you are not currently connected."
3034
  msgstr ""
3035
 
3036
- #: src/admin.php:1280
3037
  msgid "Go to the remote storage settings in order to connect."
3038
  msgstr ""
3039
 
3040
- #: src/admin.php:1422, src/admin.php:1432
3041
  msgid "Error: invalid path"
3042
  msgstr ""
3043
 
3044
- #: src/admin.php:1783, src/includes/class-wpadmin-commands.php:506
3045
  msgid "Backup set not found"
3046
  msgstr ""
3047
 
3048
- #: src/admin.php:1869
3049
  msgid "Did not know how to delete from this cloud service."
3050
  msgstr ""
3051
 
3052
- #: src/admin.php:1950
3053
  msgid "Backup sets removed:"
3054
  msgstr ""
3055
 
3056
- #: src/admin.php:1951
3057
  msgid "Local files deleted:"
3058
  msgstr ""
3059
 
3060
- #: src/admin.php:1952
3061
  msgid "Remote files deleted:"
3062
  msgstr ""
3063
 
3064
- #: src/admin.php:2039
3065
  msgid "Job deleted"
3066
  msgstr ""
3067
 
3068
- #: src/admin.php:2047
3069
  msgid "Could not find that job - perhaps it has already finished?"
3070
  msgstr ""
3071
 
3072
- #: src/admin.php:2145, src/admin.php:2166, src/includes/class-commands.php:836
3073
  msgid "Start backup"
3074
  msgstr ""
3075
 
3076
- #: src/admin.php:2145, src/includes/class-commands.php:836
3077
  msgid "OK. You should soon see activity in the \"Last log message\" field below."
3078
  msgstr ""
3079
 
3080
- #: src/admin.php:2228, src/admin.php:2232, src/class-updraftplus.php:635
3081
  msgid "The log file could not be read."
3082
  msgstr ""
3083
 
3084
- #: src/admin.php:2279
3085
  msgid "Download failed"
3086
  msgstr ""
3087
 
3088
- #: src/admin.php:2309
3089
  msgid "Download in progress"
3090
  msgstr ""
3091
 
3092
- #: src/admin.php:2312
3093
  msgid "No local copy present."
3094
  msgstr ""
3095
 
3096
- #: src/admin.php:2366, src/backup.php:1197
3097
  msgid "Backup directory (%s) is not writable, or does not exist."
3098
  msgstr ""
3099
 
3100
- #: src/admin.php:2366
3101
  msgid "You will find more information about this in the Settings section."
3102
  msgstr ""
3103
 
3104
- #: src/admin.php:2403
3105
  msgid "This file could not be uploaded"
3106
  msgstr ""
3107
 
3108
- #: src/admin.php:2418
3109
  msgid "This backup was created by %s, and can be imported."
3110
  msgstr ""
3111
 
3112
- #: src/admin.php:2424
3113
  msgid "Bad filename format - this does not look like a file created by UpdraftPlus"
3114
  msgstr ""
3115
 
3116
- #: src/admin.php:2432
3117
  msgid "This looks like a file created by UpdraftPlus, but this install does not know about this type of object: %s. Perhaps you need to install an add-on?"
3118
  msgstr ""
3119
 
3120
- #: src/admin.php:2524
3121
  msgid "Bad filename format - this does not look like an encrypted database file created by UpdraftPlus"
3122
  msgstr ""
3123
 
3124
- #: src/admin.php:2616
3125
  msgid "Backup directory could not be created"
3126
  msgstr ""
3127
 
3128
- #: src/admin.php:2623
3129
  msgid "Backup directory successfully created."
3130
  msgstr ""
3131
 
3132
- #: src/admin.php:2625, src/admin.php:3483, src/admin.php:4508, src/admin.php:4518, src/admin.php:4527, src/admin.php:5492
3133
  msgid "Return to UpdraftPlus configuration"
3134
  msgstr ""
3135
 
3136
- #: src/admin.php:2637, src/class-updraftplus.php:4316, src/restorer.php:2872
3137
  msgid "Warning:"
3138
  msgstr ""
3139
 
3140
- #: src/admin.php:2637
3141
  msgid "If you can still read these words after the page finishes loading, then there is a JavaScript or jQuery problem in the site."
3142
  msgstr ""
3143
 
3144
- #: src/admin.php:2640
3145
  msgid "The UpdraftPlus directory in wp-content/plugins has white-space in it; WordPress does not like this. You should rename the directory to wp-content/plugins/updraftplus to fix this problem."
3146
  msgstr ""
3147
 
3148
- #: src/admin.php:2655
3149
  msgid "OptimizePress 2.0 encodes its contents, so search/replace does not work."
3150
  msgstr ""
3151
 
3152
- #: src/admin.php:2655
3153
  msgid "To fix this problem go here."
3154
  msgstr ""
3155
 
3156
- #: src/admin.php:2657
3157
  msgid "For even more features and personal support, check out "
3158
  msgstr ""
3159
 
3160
- #: src/admin.php:2659
3161
  msgid "Your backup has been restored."
3162
  msgstr ""
3163
 
3164
- #: src/admin.php:2684
3165
  msgid "Your PHP memory limit (set by your web hosting company) is very low. UpdraftPlus attempted to raise it but was unsuccessful. This plugin may struggle with a memory limit of less than 64 Mb - especially if you have very large files uploaded (though on the other hand, many sites will be successful with a 32Mb limit - your experience may vary)."
3166
  msgstr ""
3167
 
3168
- #: src/admin.php:2684
3169
  msgid "Current limit is:"
3170
  msgstr ""
3171
 
3172
- #: src/admin.php:2745
3173
  msgid "Backup Contents And Schedule"
3174
  msgstr ""
3175
 
3176
- #: src/admin.php:2844
3177
  msgid "Backup / Restore"
3178
  msgstr ""
3179
 
3180
- #: src/admin.php:2848
3181
  msgid "Premium / Extensions"
3182
  msgstr ""
3183
 
3184
- #: src/admin.php:2885
3185
  msgid "%s minutes, %s seconds"
3186
  msgstr ""
3187
 
3188
- #: src/admin.php:2887
3189
  msgid "Unfinished restoration"
3190
  msgstr ""
3191
 
3192
- #: src/admin.php:2888
3193
  msgid "You have an unfinished restoration operation, begun %s ago."
3194
  msgstr ""
3195
 
3196
- #: src/admin.php:2893
3197
  msgid "Continue restoration"
3198
  msgstr ""
3199
 
3200
- #: src/admin.php:2894, src/templates/wp-admin/notices/autobackup-notice.php:16, src/templates/wp-admin/notices/autobackup-notice.php:18, src/templates/wp-admin/notices/horizontal-notice.php:16, src/templates/wp-admin/notices/horizontal-notice.php:18
3201
  msgid "Dismiss"
3202
  msgstr ""
3203
 
3204
- #: src/admin.php:2915
3205
  msgid "Not yet got an account (it's free)? Go get one!"
3206
  msgstr ""
3207
 
3208
- #: src/admin.php:2926
3209
  msgid "Interested in knowing about your UpdraftPlus.Com password security? Read about it here."
3210
  msgstr ""
3211
 
3212
- #: src/admin.php:2938, src/includes/class-commands.php:905, src/includes/class-commands.php:953, src/templates/wp-admin/settings/temporary-clone.php:83, src/templates/wp-admin/settings/updraftcentral-connect.php:71
3213
  msgid "Processing"
3214
  msgstr ""
3215
 
3216
- #: src/admin.php:2981
3217
  msgid "Connect with your UpdraftPlus.Com account"
3218
  msgstr ""
3219
 
3220
- #: src/admin.php:2987, src/templates/wp-admin/settings/form-contents.php:255, src/templates/wp-admin/settings/updraftcentral-connect.php:44
3221
  msgid "Email"
3222
  msgstr ""
3223
 
3224
- #: src/admin.php:3002
3225
  msgid "Forgotten your details?"
3226
  msgstr ""
3227
 
3228
- #: src/admin.php:3014
3229
  msgid "Ask WordPress to update UpdraftPlus automatically when an update is available"
3230
  msgstr ""
3231
 
3232
- #: src/admin.php:3025
3233
  msgid "Add this website to UpdraftCentral (remote, centralised control) - free for up to 5 sites."
3234
  msgstr ""
3235
 
3236
- #: src/admin.php:3025
3237
  msgid "Learn more about UpdraftCentral"
3238
  msgstr ""
3239
 
3240
- #: src/admin.php:3051, src/templates/wp-admin/settings/updraftcentral-connect.php:56
3241
  msgid "One Time Password (check your OTP app to get this password)"
3242
  msgstr ""
3243
 
3244
- #: src/admin.php:3121
3245
  msgid "Latest UpdraftPlus.com news:"
3246
  msgstr ""
3247
 
3248
- #: src/admin.php:3148
3249
  msgid "Download most recently modified log file"
3250
  msgstr ""
3251
 
3252
- #: src/admin.php:3191
3253
  msgid "Your WordPress install has old directories from its state before you restored/migrated (technical information: these are suffixed with -old). You should press this button to delete them as soon as you have verified that the restoration worked."
3254
  msgstr ""
3255
 
3256
- #: src/admin.php:3256, src/admin.php:4328
3257
  msgid "View Log"
3258
  msgstr ""
3259
 
3260
- #: src/admin.php:3295
3261
  msgid "Backup begun"
3262
  msgstr ""
3263
 
3264
- #: src/admin.php:3300
3265
  msgid "Creating file backup zips"
3266
  msgstr ""
3267
 
3268
- #: src/admin.php:3313
3269
  msgid "Created file backup zips"
3270
  msgstr ""
3271
 
3272
- #: src/admin.php:3318
3273
  msgid "Clone server being provisioned and booted (can take several minutes)"
3274
  msgstr ""
3275
 
3276
- #: src/admin.php:3322
3277
  msgid "Uploading files to remote storage"
3278
  msgstr ""
3279
 
3280
- #: src/admin.php:3323
3281
  msgid "Sending files to remote site"
3282
  msgstr ""
3283
 
3284
- #: src/admin.php:3330
3285
  msgid "(%s%%, file %s of %s)"
3286
  msgstr ""
3287
 
3288
- #: src/admin.php:3335
3289
  msgid "Pruning old backup sets"
3290
  msgstr ""
3291
 
3292
- #: src/admin.php:3339
3293
  msgid "Waiting until scheduled time to retry because of errors"
3294
  msgstr ""
3295
 
3296
- #: src/admin.php:3344
3297
  msgid "Backup finished"
3298
  msgstr ""
3299
 
3300
- #: src/admin.php:3357
3301
  msgid "Created database backup"
3302
  msgstr ""
3303
 
3304
- #: src/admin.php:3368
3305
  msgid "Creating database backup"
3306
  msgstr ""
3307
 
3308
- #: src/admin.php:3370
3309
  msgid "table: %s"
3310
  msgstr ""
3311
 
3312
- #: src/admin.php:3383
3313
  msgid "Encrypting database"
3314
  msgstr ""
3315
 
3316
- #: src/admin.php:3391
3317
  msgid "Encrypted database"
3318
  msgstr ""
3319
 
3320
- #: src/admin.php:3393, src/central/bootstrap.php:444, src/central/bootstrap.php:451, src/methods/updraftvault.php:431, src/methods/updraftvault.php:477, src/methods/updraftvault.php:562
3321
  msgid "Unknown"
3322
  msgstr ""
3323
 
3324
- #: src/admin.php:3410
3325
  msgid "next resumption: %d (after %ss)"
3326
  msgstr ""
3327
 
3328
- #: src/admin.php:3411
3329
  msgid "last activity: %ss ago"
3330
  msgstr ""
3331
 
3332
- #: src/admin.php:3431
3333
  msgid "Job ID: %s"
3334
  msgstr ""
3335
 
3336
- #: src/admin.php:3445, src/admin.php:3735
3337
  msgid "Warning: %s"
3338
  msgstr ""
3339
 
3340
- #: src/admin.php:3465
3341
  msgid "show log"
3342
  msgstr ""
3343
 
3344
- #: src/admin.php:3466
3345
  msgid "Note: the progress bar below is based on stages, NOT time. Do not stop the backup simply because it seems to have remained in the same place for a while - that is normal."
3346
  msgstr ""
3347
 
3348
- #: src/admin.php:3466
3349
  msgid "stop"
3350
  msgstr ""
3351
 
3352
- #: src/admin.php:3476, src/admin.php:3476
3353
  msgid "Remove old directories"
3354
  msgstr ""
3355
 
3356
- #: src/admin.php:3479
3357
  msgid "Old directories successfully removed."
3358
  msgstr ""
3359
 
3360
- #: src/admin.php:3481
3361
  msgid "Old directory removal failed for some reason. You may want to do this manually."
3362
  msgstr ""
3363
 
3364
- #: src/admin.php:3518, src/admin.php:3553, src/admin.php:3557, src/includes/class-remote-send.php:334, src/includes/class-storage-methods-interface.php:315, src/restorer.php:330, src/restorer.php:3169, src/restorer.php:3274
3365
  msgid "OK"
3366
  msgstr ""
3367
 
3368
- #: src/admin.php:3602
3369
  msgid "The request to the filesystem to create the directory failed."
3370
  msgstr ""
3371
 
3372
- #: src/admin.php:3616
3373
  msgid "The folder was created, but we had to change its file permissions to 777 (world-writable) to be able to write to it. You should check with your hosting provider that this will not cause any problems"
3374
  msgstr ""
3375
 
3376
- #: src/admin.php:3621
3377
  msgid "The folder exists, but your webserver does not have permission to write to it."
3378
  msgstr ""
3379
 
3380
- #: src/admin.php:3621
3381
  msgid "You will need to consult with your web hosting provider to find out how to set permissions for a WordPress plugin to write to the directory."
3382
  msgstr ""
3383
 
3384
- #: src/admin.php:3723
3385
  msgid "incremental backup; base backup: %s"
3386
  msgstr ""
3387
 
3388
- #: src/admin.php:3753
3389
  msgid "No backup has been completed"
3390
  msgstr ""
3391
 
3392
- #: src/admin.php:3767
3393
  msgctxt "i.e. Non-automatic"
3394
  msgid "Manual"
3395
  msgstr ""
3396
 
3397
- #: src/admin.php:3780
3398
  msgid "Backup directory specified is writable, which is good."
3399
  msgstr ""
3400
 
3401
- #: src/admin.php:3784
3402
  msgid "Backup directory specified does <b>not</b> exist."
3403
  msgstr ""
3404
 
3405
- #: src/admin.php:3786
3406
  msgid "Backup directory specified exists, but is <b>not</b> writable."
3407
  msgstr ""
3408
 
3409
- #: src/admin.php:3788
3410
  msgid "Follow this link to attempt to create the directory and set the permissions"
3411
  msgstr ""
3412
 
3413
- #: src/admin.php:3788
3414
  msgid "or, to reset this option"
3415
  msgstr ""
3416
 
3417
- #: src/admin.php:3788
3418
  msgid "press here"
3419
  msgstr ""
3420
 
3421
- #: src/admin.php:3788
3422
  msgid "If that is unsuccessful check the permissions on your server or change it to another directory that is writable by your web server process."
3423
  msgstr ""
3424
 
3425
- #: src/admin.php:3868
3426
  msgid "Your wp-content directory server path: %s"
3427
  msgstr ""
3428
 
3429
- #: src/admin.php:3868
3430
  msgid "Any other directories found inside wp-content"
3431
  msgstr ""
3432
 
3433
- #: src/admin.php:3879
3434
  msgid "Exclude these from"
3435
  msgstr ""
3436
 
3437
- #: src/admin.php:3967
3438
  msgid "Your web server's PHP/Curl installation does not support https access. Communications with %s will be unencrypted. Ask your web host to install Curl/SSL in order to gain the ability for encryption (via an add-on)."
3439
  msgstr ""
3440
 
3441
- #: src/admin.php:3969
3442
  msgid "Your web server's PHP/Curl installation does not support https access. We cannot access %s without this support. Please contact your web hosting provider's support. %s <strong>requires</strong> Curl+https. Please do not file any support requests; there is no alternative."
3443
  msgstr ""
3444
 
3445
- #: src/admin.php:3972
3446
  msgid "Good news: Your site's communications with %s can be encrypted. If you see any errors to do with encryption, then look in the 'Expert Settings' for more help."
3447
  msgstr ""
3448
 
3449
- #: src/admin.php:4010, src/templates/wp-admin/settings/backupnow-modal.php:60, src/templates/wp-admin/settings/existing-backups-table.php:71, src/templates/wp-admin/settings/existing-backups-table.php:74
3450
  msgid "Only allow this backup to be deleted manually (i.e. keep it even if retention limits are hit)."
3451
  msgstr ""
3452
 
3453
- #: src/admin.php:4058
3454
  msgid "Total backup size:"
3455
  msgstr ""
3456
 
3457
- #: src/admin.php:4124, src/includes/class-wpadmin-commands.php:162, src/restorer.php:2179
3458
  msgid "Backup created by unknown source (%s) - cannot be restored."
3459
  msgstr ""
3460
 
3461
- #: src/admin.php:4153
3462
  msgid "Press here to download or browse"
3463
  msgstr ""
3464
 
3465
- #: src/admin.php:4158
3466
  msgid "(%d archive(s) in set)."
3467
  msgstr ""
3468
 
3469
- #: src/admin.php:4161
3470
  msgid "You appear to be missing one or more archives from this multi-archive set."
3471
  msgstr ""
3472
 
3473
- #: src/admin.php:4189, src/admin.php:4191
3474
  msgid "(Not finished)"
3475
  msgstr ""
3476
 
3477
- #: src/admin.php:4191
3478
  msgid "If you are seeing more backups than you expect, then it is probably because the deletion of old backup sets does not happen until a fresh backup completes."
3479
  msgstr ""
3480
 
3481
- #: src/admin.php:4216
3482
  msgid "(backup set imported from remote location)"
3483
  msgstr ""
3484
 
3485
- #: src/admin.php:4219
3486
  msgid "After pressing this button, you will be given the option to choose which components you wish to restore"
3487
  msgstr ""
3488
 
3489
- #: src/admin.php:4298
3490
  msgid "After pressing this button, you can select where to upload your backup from a list of your currently saved remote storage locations"
3491
  msgstr ""
3492
 
3493
- #: src/admin.php:4318
3494
  msgid "Delete this backup set"
3495
  msgstr ""
3496
 
3497
- #: src/admin.php:4471, src/admin.php:4479
3498
  msgid "Sufficient information about the in-progress restoration operation could not be found."
3499
  msgstr ""
3500
 
3501
- #: src/admin.php:4599
 
 
 
 
3502
  msgid "This backup does not exist in the backup history - restoration aborted. Timestamp:"
3503
  msgstr ""
3504
 
3505
- #: src/admin.php:4600
3506
  msgid "Backup does not exist in the backup history"
3507
  msgstr ""
3508
 
3509
- #: src/admin.php:4620
3510
  msgid "ABORT: Could not find the information on which entities to restore."
3511
  msgstr ""
3512
 
3513
- #: src/admin.php:4620
3514
  msgid "If making a request for support, please include this information:"
3515
  msgstr ""
3516
 
3517
- #: src/admin.php:4785
3518
  msgid "Backup won't be sent to any remote storage - none has been saved in the %s"
3519
  msgstr ""
3520
 
3521
- #: src/admin.php:4785
3522
  msgid "settings"
3523
  msgstr ""
3524
 
3525
- #: src/admin.php:4785
3526
  msgid "Not got any remote storage?"
3527
  msgstr ""
3528
 
3529
- #: src/admin.php:4785
3530
  msgid "Check out UpdraftPlus Vault."
3531
  msgstr ""
3532
 
3533
- #: src/admin.php:4787
3534
  msgid "Send this backup to remote storage"
3535
  msgstr ""
3536
 
3537
- #: src/admin.php:4877
3538
  msgid "UpdraftPlus seems to have been updated to version (%s), which is different to the version running when this settings page was loaded. Please reload the settings page before trying to save settings."
3539
  msgstr ""
3540
 
3541
- #: src/admin.php:4884, src/templates/wp-admin/settings/take-backup.php:51
3542
  msgid "This button is disabled because your backup directory is not writable (see the settings)."
3543
  msgstr ""
3544
 
3545
- #: src/admin.php:4913
3546
  msgid "Your settings have been saved."
3547
  msgstr ""
3548
 
3549
- #: src/admin.php:4918
3550
  msgid "Your settings failed to save. Please refresh the settings page and try again"
3551
  msgstr ""
3552
 
3553
- #: src/admin.php:4966
3554
  msgid "authentication error"
3555
  msgstr ""
3556
 
3557
- #: src/admin.php:4970
3558
  msgid "Remote storage method and instance id are required for authentication."
3559
  msgstr ""
3560
 
3561
- #: src/admin.php:5037
3562
  msgid "Your settings have been wiped."
3563
  msgstr ""
3564
 
3565
- #: src/admin.php:5138
3566
  msgid "Known backups (raw)"
3567
  msgstr ""
3568
 
3569
- #: src/admin.php:5173
3570
  msgid "Options (raw)"
3571
  msgstr ""
3572
 
3573
- #: src/admin.php:5176
3574
  msgid "Value"
3575
  msgstr ""
3576
 
3577
- #: src/admin.php:5328
3578
  msgid "The file %s has a \"byte order mark\" (BOM) at its beginning."
3579
  msgid_plural "The files %s have a \"byte order mark\" (BOM) at their beginning."
3580
  msgstr[0] ""
3581
  msgstr[1] ""
3582
 
3583
- #: src/admin.php:5328, src/methods/openstack2.php:144, src/restorer.php:183, src/restorer.php:185, src/templates/wp-admin/settings/downloading-and-restoring.php:27, src/templates/wp-admin/settings/tab-backups.php:27, src/templates/wp-admin/settings/updraftcentral-connect.php:14
3584
  msgid "Follow this link for more information"
3585
  msgstr ""
3586
 
3587
- #: src/admin.php:5352, src/admin.php:5356, src/templates/wp-admin/advanced/site-info.php:45, src/templates/wp-admin/advanced/site-info.php:51, src/templates/wp-admin/advanced/site-info.php:58, src/templates/wp-admin/advanced/site-info.php:59
3588
  msgid "%s version:"
3589
  msgstr ""
3590
 
3591
- #: src/admin.php:5360
3592
  msgid "Clone region:"
3593
  msgstr ""
3594
 
3595
- #: src/admin.php:5375
3596
  msgid "Forbid non-administrators to login to WordPress on your clone"
3597
  msgstr ""
3598
 
3599
- #: src/admin.php:5398
3600
  msgid "(current version)"
3601
  msgstr ""
3602
 
3603
- #: src/admin.php:5418
3604
  msgid "Your clone has started and will be available at the following URLs once it is ready."
3605
  msgstr ""
3606
 
3607
- #: src/admin.php:5419
3608
  msgid "Front page:"
3609
  msgstr ""
3610
 
3611
- #: src/admin.php:5420
3612
  msgid "Dashboard:"
3613
  msgstr ""
3614
 
3615
- #: src/admin.php:5422, src/admin.php:5425
3616
  msgid "You can find your temporary clone information in your updraftplus.com account here."
3617
  msgstr ""
3618
 
3619
- #: src/admin.php:5424
3620
  msgid "Your clone has started, network information is not yet available but will be displayed here and at your updraftplus.com account once it is ready."
3621
  msgstr ""
3622
 
3623
- #: src/admin.php:5490, src/admin.php:5492
3624
  msgid "You have requested saving to remote storage (%s), but without entering any settings for that storage."
3625
  msgstr ""
3626
 
@@ -3796,7 +3812,7 @@ msgstr ""
3796
  msgid "A key was created, but the attempt to register it with %s was unsuccessful - please try again later."
3797
  msgstr ""
3798
 
3799
- #: src/central/bootstrap.php:403, src/includes/class-remote-send.php:445
3800
  msgid "Key created successfully."
3801
  msgstr ""
3802
 
@@ -4092,7 +4108,7 @@ msgstr ""
4092
  msgid "Could not save backup history because we have no backup array. Backup probably failed."
4093
  msgstr ""
4094
 
4095
- #: src/class-updraftplus.php:4138, src/includes/class-updraftplus-encryption.php:336, src/restorer.php:929
4096
  msgid "Decryption failed. The database file is encrypted, but you have no encryption key entered."
4097
  msgstr ""
4098
 
@@ -4100,7 +4116,7 @@ msgstr ""
4100
  msgid "Decryption failed. The database file is encrypted."
4101
  msgstr ""
4102
 
4103
- #: src/class-updraftplus.php:4150, src/includes/class-updraftplus-encryption.php:354, src/restorer.php:942
4104
  msgid "Decryption failed. The most likely cause is that you used the wrong key."
4105
  msgstr ""
4106
 
@@ -4144,11 +4160,11 @@ msgstr ""
4144
  msgid "You can search and replace your database (for migrating a website to a new location/URL) with the Migrator add-on - follow this link for more information"
4145
  msgstr ""
4146
 
4147
- #: src/class-updraftplus.php:4260, src/restorer.php:1616
4148
  msgid "You are using the %s webserver, but do not seem to have the %s module loaded."
4149
  msgstr ""
4150
 
4151
- #: src/class-updraftplus.php:4260, src/restorer.php:1616
4152
  msgid "You should enable %s to make any pretty permalinks (e.g. %s) work"
4153
  msgstr ""
4154
 
@@ -4176,7 +4192,7 @@ msgstr ""
4176
  msgid "Any support requests to do with %s should be raised with your web hosting company."
4177
  msgstr ""
4178
 
4179
- #: src/class-updraftplus.php:4294, src/restorer.php:2434, src/restorer.php:2523, src/restorer.php:2549
4180
  msgid "Old table prefix:"
4181
  msgstr ""
4182
 
@@ -4184,7 +4200,7 @@ msgstr ""
4184
  msgid "Backup label:"
4185
  msgstr ""
4186
 
4187
- #: src/class-updraftplus.php:4305, src/class-updraftplus.php:4308, src/restorer.php:643
4188
  msgid "You are running on WordPress multisite - but your backup is not of a multisite site."
4189
  msgstr ""
4190
 
@@ -4196,7 +4212,7 @@ msgstr ""
4196
  msgid "Please read this link for important information on this process."
4197
  msgstr ""
4198
 
4199
- #: src/class-updraftplus.php:4312, src/restorer.php:2446
4200
  msgid "To import an ordinary WordPress site into a multisite installation requires %s."
4201
  msgstr ""
4202
 
@@ -4208,7 +4224,7 @@ msgstr ""
4208
  msgid "If you want to restore a multisite backup, you should first set up your WordPress installation as a multisite."
4209
  msgstr ""
4210
 
4211
- #: src/class-updraftplus.php:4323, src/restorer.php:2452
4212
  msgid "Site information:"
4213
  msgstr ""
4214
 
@@ -4304,115 +4320,115 @@ msgstr ""
4304
  msgid "The creation of your data for creating the clone should now begin. N.B. You will be charged one token once the clone is ready. If the clone fails to boot, then no token will be taken."
4305
  msgstr ""
4306
 
4307
- #: src/includes/class-filesystem-functions.php:94, src/templates/wp-admin/advanced/site-info.php:38
4308
  msgid "refresh"
4309
  msgstr ""
4310
 
4311
- #: src/includes/class-filesystem-functions.php:101
4312
  msgid "calculate"
4313
  msgstr ""
4314
 
4315
- #: src/includes/class-filesystem-functions.php:115
4316
  msgid "This is a count of the contents of your Updraft directory"
4317
  msgstr ""
4318
 
4319
- #: src/includes/class-filesystem-functions.php:115, src/templates/wp-admin/advanced/site-info.php:38
4320
  msgid "Web-server disk space in use by UpdraftPlus"
4321
  msgstr ""
4322
 
4323
- #: src/includes/class-filesystem-functions.php:274, src/methods/ftp.php:335
4324
  msgid "Your web server's PHP installation has these functions disabled: %s."
4325
  msgstr ""
4326
 
4327
- #: src/includes/class-filesystem-functions.php:274, src/methods/ftp.php:335, src/restorer.php:2210
4328
  msgid "Your hosting company must enable these functions before %s can work."
4329
  msgstr ""
4330
 
4331
- #: src/includes/class-filesystem-functions.php:274, src/restorer.php:2210
4332
  msgid "restoration"
4333
  msgstr ""
4334
 
4335
- #: src/includes/class-filesystem-functions.php:294
4336
  msgid "The database file appears to have been compressed twice - probably the website you downloaded it from had a mis-configured webserver."
4337
  msgstr ""
4338
 
4339
- #: src/includes/class-filesystem-functions.php:301, src/includes/class-filesystem-functions.php:323
4340
  msgid "The attempt to undo the double-compression failed."
4341
  msgstr ""
4342
 
4343
- #: src/includes/class-filesystem-functions.php:325
4344
  msgid "The attempt to undo the double-compression succeeded."
4345
  msgstr ""
4346
 
4347
- #: src/includes/class-filesystem-functions.php:523
4348
  msgid "Unzip progress: %d out of %d files"
4349
  msgstr ""
4350
 
4351
- #: src/includes/class-remote-send.php:258
4352
  msgid "Backup data will be sent to:"
4353
  msgstr ""
4354
 
4355
- #: src/includes/class-remote-send.php:273
4356
  msgid "site not found"
4357
  msgstr ""
4358
 
4359
- #: src/includes/class-remote-send.php:317
4360
  msgid "The site URL you are sending to (%s) looks like a local development website. If you are sending from an external network, it is likely that a firewall will be blocking this."
4361
  msgstr ""
4362
 
4363
- #: src/includes/class-remote-send.php:321
4364
  msgid "If sending directly from site to site does not work for you, then there are three other methods - please try one of these instead."
4365
  msgstr ""
4366
 
4367
- #: src/includes/class-remote-send.php:352
4368
  msgid "Also send this backup to the active remote storage locations"
4369
  msgstr ""
4370
 
4371
- #: src/includes/class-remote-send.php:428
4372
  msgid "A key with this name already exists; you must use a unique name."
4373
  msgstr ""
4374
 
4375
- #: src/includes/class-remote-send.php:445
4376
  msgid "You must copy and paste this key on the sending site now - it cannot be shown again."
4377
  msgstr ""
4378
 
4379
- #: src/includes/class-remote-send.php:455
4380
  msgid "The setting %s is turned on in your PHP settings. It is deprecated, causes encryption to malfunction, and should be turned off."
4381
  msgstr ""
4382
 
4383
- #: src/includes/class-remote-send.php:470
4384
  msgid "key"
4385
  msgstr ""
4386
 
4387
- #: src/includes/class-remote-send.php:480
4388
  msgid "The entered key was the wrong length - please try again."
4389
  msgstr ""
4390
 
4391
- #: src/includes/class-remote-send.php:482, src/includes/class-remote-send.php:484, src/includes/class-remote-send.php:488
4392
  msgid "The entered key was corrupt - please try again."
4393
  msgstr ""
4394
 
4395
- #: src/includes/class-remote-send.php:493
4396
  msgid "The entered key does not belong to a remote site (it belongs to this one)."
4397
  msgstr ""
4398
 
4399
- #: src/includes/class-remote-send.php:509
4400
  msgid "The key was successfully added."
4401
  msgstr ""
4402
 
4403
- #: src/includes/class-remote-send.php:509
4404
  msgid "It is for sending backups to the following site: "
4405
  msgstr ""
4406
 
4407
- #: src/includes/class-remote-send.php:528
4408
  msgid "No receiving sites have yet been added."
4409
  msgstr ""
4410
 
4411
- #: src/includes/class-remote-send.php:548
4412
  msgid "No keys to allow remote sites to send backup data here have yet been created."
4413
  msgstr ""
4414
 
4415
- #: src/includes/class-remote-send.php:557
4416
  msgid "Existing keys"
4417
  msgstr ""
4418
 
@@ -4476,15 +4492,15 @@ msgstr ""
4476
  msgid "The backup archive files have been processed, but with some errors. You will need to cancel and correct any problems before retrying."
4477
  msgstr ""
4478
 
4479
- #: src/includes/class-wpadmin-commands.php:328
4480
  msgid "Constants"
4481
  msgstr ""
4482
 
4483
- #: src/includes/class-wpadmin-commands.php:520
4484
  msgid "Extra database"
4485
  msgstr ""
4486
 
4487
- #: src/includes/class-wpadmin-commands.php:529
4488
  msgid "archive"
4489
  msgstr ""
4490
 
@@ -4588,6 +4604,10 @@ msgstr ""
4588
  msgid "Allow only administrators to log in"
4589
  msgstr ""
4590
 
 
 
 
 
4591
  #: src/includes/updraftplus-login.php:57, src/methods/updraftvault.php:715, src/udaddons/updraftplus-addons.php:991
4592
  msgid "UpdraftPlus.Com returned a response which we could not understand (data: %s)"
4593
  msgstr ""
@@ -5789,254 +5809,254 @@ msgstr ""
5789
  msgid "Error message"
5790
  msgstr ""
5791
 
5792
- #: src/restorer.php:628
5793
  msgid "UpdraftPlus is not able to directly restore this kind of entity. It must be restored manually."
5794
  msgstr ""
5795
 
5796
- #: src/restorer.php:629
5797
  msgid "Backup file not available."
5798
  msgstr ""
5799
 
5800
- #: src/restorer.php:630
5801
  msgid "Copying this entity failed."
5802
  msgstr ""
5803
 
5804
- #: src/restorer.php:631
5805
  msgid "Unpacking backup..."
5806
  msgstr ""
5807
 
5808
- #: src/restorer.php:632
5809
  msgid "Decrypting database (can take a while)..."
5810
  msgstr ""
5811
 
5812
- #: src/restorer.php:633
5813
  msgid "Database successfully decrypted."
5814
  msgstr ""
5815
 
5816
- #: src/restorer.php:634
5817
  msgid "Moving old data out of the way..."
5818
  msgstr ""
5819
 
5820
- #: src/restorer.php:635
5821
  msgid "Moving unpacked backup into place..."
5822
  msgstr ""
5823
 
5824
- #: src/restorer.php:636
5825
  msgid "Restoring the database (on a large site this can take a long time - if it times out (which can happen if your web hosting company has configured your hosting to limit resources) then you should use a different method, such as phpMyAdmin)..."
5826
  msgstr ""
5827
 
5828
- #: src/restorer.php:637
5829
  msgid "Cleaning up rubbish..."
5830
  msgstr ""
5831
 
5832
- #: src/restorer.php:638
5833
  msgid "Could not move old files out of the way."
5834
  msgstr ""
5835
 
5836
- #: src/restorer.php:638
5837
  msgid "You should check the file ownerships and permissions in your WordPress installation"
5838
  msgstr ""
5839
 
5840
- #: src/restorer.php:639
5841
  msgid "Could not delete old directory."
5842
  msgstr ""
5843
 
5844
- #: src/restorer.php:640
5845
  msgid "Could not move new files into place. Check your wp-content/upgrade folder."
5846
  msgstr ""
5847
 
5848
- #: src/restorer.php:641
5849
  msgid "Could not move the files into place. Check your file permissions."
5850
  msgstr ""
5851
 
5852
- #: src/restorer.php:642
5853
  msgid "Failed to delete working directory after restoring."
5854
  msgstr ""
5855
 
5856
- #: src/restorer.php:644
5857
  msgid "Failed to unpack the archive"
5858
  msgstr ""
5859
 
5860
- #: src/restorer.php:645
5861
  msgid "Failed to read the manifest file from backup."
5862
  msgstr ""
5863
 
5864
- #: src/restorer.php:646
5865
  msgid "Failed to find a manifest file in the backup."
5866
  msgstr ""
5867
 
5868
- #: src/restorer.php:647
5869
  msgid "Failed to read from the working directory."
5870
  msgstr ""
5871
 
5872
- #: src/restorer.php:921
5873
  msgid "Failed to create a temporary directory"
5874
  msgstr ""
5875
 
5876
- #: src/restorer.php:937
5877
  msgid "Failed to write out the decrypted database to the filesystem"
5878
  msgstr ""
5879
 
5880
- #: src/restorer.php:1015
5881
  msgid "The directory does not exist, and the attempt to create it failed"
5882
  msgstr ""
5883
 
5884
- #: src/restorer.php:1018
5885
  msgid "The directory does not exist"
5886
  msgstr ""
5887
 
5888
- #: src/restorer.php:1059
5889
  msgid "wp-config.php from backup: will restore as wp-config-backup.php"
5890
  msgstr ""
5891
 
5892
- #: src/restorer.php:1066
5893
  msgid "wp-config.php from backup: restoring (as per user's request)"
5894
  msgstr ""
5895
 
5896
- #: src/restorer.php:1249, src/restorer.php:1257
5897
  msgid "UpdraftPlus needed to create a %s in your content directory, but failed - please check your file permissions and enable the access (%s)"
5898
  msgstr ""
5899
 
5900
- #: src/restorer.php:1257
5901
  msgid "file"
5902
  msgstr ""
5903
 
5904
- #: src/restorer.php:1272
5905
  msgid "Existing unremoved folders from a previous restore exist (please use the \"Delete Old Directories\" button to delete them before trying again): %s"
5906
  msgstr ""
5907
 
5908
- #: src/restorer.php:1279
5909
  msgid "This version of UpdraftPlus does not know how to handle this type of foreign backup"
5910
  msgstr ""
5911
 
5912
- #: src/restorer.php:1386
5913
  msgid "Deferring..."
5914
  msgstr ""
5915
 
5916
- #: src/restorer.php:1429, src/restorer.php:1477
5917
  msgid "The WordPress content folder (wp-content) was not found in this zip file."
5918
  msgstr ""
5919
 
5920
- #: src/restorer.php:1570
5921
  msgid "Files found:"
5922
  msgstr ""
5923
 
5924
- #: src/restorer.php:2099
5925
  msgid "Please supply the requested information, and then continue."
5926
  msgstr ""
5927
 
5928
- #: src/restorer.php:2172
5929
  msgid "Warning: PHP safe_mode is active on your server. Timeouts are much more likely. If these happen, then you will need to manually restore the file via phpMyAdmin or another method."
5930
  msgstr ""
5931
 
5932
- #: src/restorer.php:2195
5933
  msgid "Failed to find database file"
5934
  msgstr ""
5935
 
5936
- #: src/restorer.php:2216
5937
  msgid "Failed to open database file"
5938
  msgstr ""
5939
 
5940
- #: src/restorer.php:2311, src/restorer.php:2353
5941
  msgid "Your database user does not have permission to drop tables"
5942
  msgstr ""
5943
 
5944
- #: src/restorer.php:2314
5945
  msgid "Your database user does not have permission to create tables. We will attempt to restore by simply emptying the tables; this should work as long as a) you are restoring from a WordPress version with the same database structure, and b) Your imported database does not contain any tables which are not already present on the importing site."
5946
  msgstr ""
5947
 
5948
- #: src/restorer.php:2358
5949
  msgid "Your database user does not have permission to drop tables. We will attempt to restore by simply emptying the tables; this should work as long as you are restoring from a WordPress version with the same database structure (%s)"
5950
  msgstr ""
5951
 
5952
- #: src/restorer.php:2404
5953
  msgid "Backup of: %s"
5954
  msgstr ""
5955
 
5956
- #: src/restorer.php:2411
5957
  msgid "Backup created by:"
5958
  msgstr ""
5959
 
5960
- #: src/restorer.php:2416
5961
  msgid "Site home:"
5962
  msgstr ""
5963
 
5964
- #: src/restorer.php:2422
5965
  msgid "Content URL:"
5966
  msgstr ""
5967
 
5968
- #: src/restorer.php:2427
5969
  msgid "Uploads URL:"
5970
  msgstr ""
5971
 
5972
- #: src/restorer.php:2438
5973
  msgid "Skipped tables:"
5974
  msgstr ""
5975
 
5976
- #: src/restorer.php:2478
5977
  msgid "Split line to avoid exceeding maximum packet size"
5978
  msgstr ""
5979
 
5980
- #: src/restorer.php:2503, src/restorer.php:2978, src/restorer.php:3025, src/restorer.php:3038
5981
  msgid "An error occurred on the first %s command - aborting run"
5982
  msgstr ""
5983
 
5984
- #: src/restorer.php:2604
5985
  msgid "Requested table engine (%s) is not present - changing to MyISAM."
5986
  msgstr ""
5987
 
5988
- #: src/restorer.php:2617
5989
  msgid "Requested table character set (%s) is not present - changing to %s."
5990
  msgstr ""
5991
 
5992
- #: src/restorer.php:2667
5993
  msgid "Requested table collation (%1$s) is not present - changing to %2$s."
5994
  msgid_plural "Requested table collations (%1$s) are not present - changing to %2$s."
5995
  msgstr[0] ""
5996
  msgstr[1] ""
5997
 
5998
- #: src/restorer.php:2669
5999
  msgid "Processing table (%s)"
6000
  msgstr ""
6001
 
6002
- #: src/restorer.php:2673
6003
  msgid "will restore as:"
6004
  msgstr ""
6005
 
6006
- #: src/restorer.php:2712
6007
  msgid "Found SET NAMES %s, but changing to %s as suggested by WPDB::determine_charset()."
6008
  msgstr ""
6009
 
6010
- #: src/restorer.php:2718
6011
  msgid "Requested character set (%s) is not present - changing to %s."
6012
  msgstr ""
6013
 
6014
- #: src/restorer.php:2872
6015
  msgid "An SQL line that is larger than the maximum packet size and cannot be split was found; this line will not be processed, but will be dropped: %s"
6016
  msgstr ""
6017
 
6018
- #: src/restorer.php:3015
6019
  msgctxt "The user is being told the number of times an error has happened, e.g. An error (27) occurred"
6020
  msgid "An error (%s) occurred:"
6021
  msgstr ""
6022
 
6023
- #: src/restorer.php:3036
6024
  msgid "This problem is caused by trying to restore a database on a very old MySQL version that is incompatible with the source database."
6025
  msgstr ""
6026
 
6027
- #: src/restorer.php:3036
6028
  msgid "This database needs to be deployed on MySQL version %s or later."
6029
  msgstr ""
6030
 
6031
- #: src/restorer.php:3038
6032
  msgid "To use this backup, your database server needs to support the %s character set."
6033
  msgstr ""
6034
 
6035
- #: src/restorer.php:3043
6036
  msgid "Too many database errors have occurred - aborting"
6037
  msgstr ""
6038
 
6039
- #: src/restorer.php:3163, src/restorer.php:3238
6040
  msgid "Table prefix has changed: changing %s table field(s) accordingly:"
6041
  msgstr ""
6042
 
@@ -6380,27 +6400,27 @@ msgstr ""
6380
  msgid "Choose the components to restore"
6381
  msgstr ""
6382
 
6383
- #: src/templates/wp-admin/settings/delete-and-restore-modals.php:54
6384
  msgid "Your web server has PHP's so-called safe_mode active."
6385
  msgstr ""
6386
 
6387
- #: src/templates/wp-admin/settings/delete-and-restore-modals.php:54
6388
  msgid "This makes time-outs much more likely. You are recommended to turn safe_mode off, or to restore only one entity at a time"
6389
  msgstr ""
6390
 
6391
- #: src/templates/wp-admin/settings/delete-and-restore-modals.php:54
6392
  msgid "or to restore manually"
6393
  msgstr ""
6394
 
6395
- #: src/templates/wp-admin/settings/delete-and-restore-modals.php:68
6396
  msgid "The following entity cannot be restored automatically: \"%s\"."
6397
  msgstr ""
6398
 
6399
- #: src/templates/wp-admin/settings/delete-and-restore-modals.php:68
6400
  msgid "You will need to restore it manually."
6401
  msgstr ""
6402
 
6403
- #: src/templates/wp-admin/settings/delete-and-restore-modals.php:83
6404
  msgid "Do read this helpful article of useful things to know before restoring."
6405
  msgstr ""
6406
 
@@ -7425,6 +7445,10 @@ msgstr ""
7425
  msgid "If you have already renewed, then you need to allocate a licence to this site - %s"
7426
  msgstr ""
7427
 
 
 
 
 
7428
  #: src/udaddons/updraftplus-addons.php:282
7429
  msgid "Your paid access to UpdraftPlus updates for %s add-ons on this site has expired."
7430
  msgstr ""
25
  msgid "UpdraftPlus Automatic Backups"
26
  msgstr ""
27
 
28
+ #: src/addons/autobackup.php:157, src/addons/autobackup.php:1026, src/admin.php:854
29
  msgid "Automatic backup before update"
30
  msgstr ""
31
 
49
  msgid "(logs can be found in the UpdraftPlus settings page as normal)..."
50
  msgstr ""
51
 
52
+ #: src/addons/autobackup.php:344, src/addons/autobackup.php:439, src/admin.php:3032, src/admin.php:3038, src/templates/wp-admin/settings/take-backup.php:69
53
  msgid "Last log message"
54
  msgstr ""
55
 
57
  msgid "Starting automatic backup..."
58
  msgstr ""
59
 
60
+ #: src/addons/autobackup.php:349, src/addons/autobackup.php:441, src/admin.php:805, src/methods/remotesend.php:73, src/methods/remotesend.php:81, src/methods/remotesend.php:247, src/methods/remotesend.php:264, src/methods/remotesend.php:310
61
  msgid "Unexpected response:"
62
  msgstr ""
63
 
97
  msgid "now proceeding with the updates..."
98
  msgstr ""
99
 
100
+ #: src/addons/autobackup.php:1072, src/admin.php:985
101
  msgid "Be safe with an automatic backup"
102
  msgstr ""
103
 
109
  msgid "Do not abort after pressing Proceed below - wait for the backup to complete."
110
  msgstr ""
111
 
112
+ #: src/addons/autobackup.php:1104, src/admin.php:850
113
  msgid "Proceed with update"
114
  msgstr ""
115
 
145
  msgid "You must add the following as the authorised redirect URI in your Azure console (under \"API Settings\") when asked"
146
  msgstr ""
147
 
148
+ #: src/addons/azure.php:608, src/addons/migrator.php:948, src/admin.php:1162, src/admin.php:1166, src/admin.php:1170, src/admin.php:1174, src/admin.php:1178, src/admin.php:1187, src/admin.php:3888, src/admin.php:3895, src/admin.php:3897, src/admin.php:5329, src/methods/cloudfiles-new.php:100, src/methods/cloudfiles.php:440, src/methods/ftp.php:335, src/methods/openstack-base.php:571, src/methods/s3.php:865, src/methods/s3.php:869, src/methods/updraftvault.php:324, src/templates/wp-admin/settings/downloading-and-restoring.php:27, src/templates/wp-admin/settings/tab-backups.php:27, src/udaddons/updraftplus-addons.php:269
149
  msgid "Warning"
150
  msgstr ""
151
 
152
+ #: src/addons/azure.php:608, src/admin.php:3888, src/methods/updraftvault.php:324
153
  msgid "Your web server's PHP installation does not included a <strong>required</strong> (for %s) module (%s). Please contact your web hosting provider's support and ask for them to enable it."
154
  msgstr ""
155
 
157
  msgid "Create Azure credentials in your Azure developer console."
158
  msgstr ""
159
 
160
+ #: src/addons/azure.php:612, src/addons/onedrive.php:1142, src/includes/class-remote-send.php:395
161
  msgid "For longer help, including screenshots, follow this link."
162
  msgstr ""
163
 
229
  msgid "Azure China"
230
  msgstr ""
231
 
232
+ #: src/addons/backblaze.php:205, src/admin.php:2147
233
  msgid "Error: unexpected file read fail"
234
  msgstr ""
235
 
236
+ #: src/addons/backblaze.php:225, src/addons/cloudfiles-enhanced.php:117, src/addons/migrator.php:893, src/addons/migrator.php:1190, src/addons/migrator.php:1271, src/addons/migrator.php:1320, src/addons/migrator.php:1558, src/addons/s3-enhanced.php:161, src/addons/s3-enhanced.php:166, src/addons/s3-enhanced.php:168, src/addons/sftp.php:919, src/addons/webdav.php:203, src/admin.php:93, src/admin.php:819, src/includes/class-remote-send.php:325, src/includes/class-remote-send.php:371, src/includes/class-remote-send.php:377, src/includes/class-remote-send.php:442, src/includes/class-remote-send.php:500, src/includes/class-remote-send.php:527, src/includes/class-remote-send.php:555, src/includes/class-remote-send.php:565, src/includes/class-remote-send.php:570, src/includes/class-remote-send.php:582, src/methods/remotesend.php:78, src/methods/remotesend.php:261, src/methods/updraftvault.php:560, src/restorer.php:332, src/restorer.php:360, src/restorer.php:2111
237
  msgid "Error:"
238
  msgstr ""
239
 
601
  msgid "You do not have access to this bucket"
602
  msgstr ""
603
 
604
+ #: src/addons/googlecloud.php:329, src/addons/sftp.php:50, src/methods/addon-base-v2.php:74, src/methods/addon-base-v2.php:115, src/methods/addon-base-v2.php:149, src/methods/addon-base-v2.php:195, src/methods/addon-base-v2.php:285, src/methods/ftp.php:42, src/methods/googledrive.php:202, src/methods/googledrive.php:204, src/methods/stream-base.php:27, src/methods/stream-base.php:163, src/methods/stream-base.php:169, src/methods/stream-base.php:203, src/methods/stream-base.php:278
605
  msgid "No %s settings were found"
606
  msgstr ""
607
 
613
  msgid "No refresh token was received from Google. This often means that you entered your client secret wrongly, or that you have not yet re-authenticated (below) since correcting it. Re-check it, then follow the link to authenticate again. Finally, if that does not work, then use expert mode to wipe all your settings, create a new Google client ID/secret, and start again."
614
  msgstr ""
615
 
616
+ #: src/addons/googlecloud.php:445, src/addons/migrator.php:590, src/admin.php:2330, src/admin.php:2351, src/admin.php:2359, src/class-updraftplus.php:1015, src/class-updraftplus.php:1021, src/class-updraftplus.php:4138, src/class-updraftplus.php:4140, src/class-updraftplus.php:4305, src/class-updraftplus.php:4312, src/class-updraftplus.php:4383, src/methods/googledrive.php:401, src/methods/s3.php:344
617
  msgid "Error: %s"
618
  msgstr ""
619
 
657
  msgid "You must save and authenticate before you can test your settings."
658
  msgstr ""
659
 
660
+ #: src/addons/googlecloud.php:783, src/addons/googlecloud.php:817, src/addons/googlecloud.php:823, src/addons/sftp.php:549, src/admin.php:3442, src/admin.php:3478, src/admin.php:3488, src/methods/addon-base-v2.php:313, src/methods/stream-base.php:356
661
  msgid "Failed"
662
  msgstr ""
663
 
733
  msgid "Otherwise, you can leave it blank."
734
  msgstr ""
735
 
736
+ #: src/addons/googlecloud.php:1041, src/addons/migrator.php:493, src/addons/migrator.php:496, src/addons/migrator.php:499, src/admin.php:1166, src/admin.php:2569, src/backup.php:3296, src/class-updraftplus.php:4404, src/class-updraftplus.php:4404, src/updraftplus.php:157
737
  msgid "Go here for more information."
738
  msgstr ""
739
 
789
  msgid "Supported backup plugins: %s"
790
  msgstr ""
791
 
792
+ #: src/addons/importer.php:276, src/admin.php:4049, src/includes/class-backup-history.php:499
793
  msgid "Backup created by: %s."
794
  msgstr ""
795
 
813
  msgid "No incremental backup of your files is possible, as no suitable existing backup was found to add increments to."
814
  msgstr ""
815
 
816
+ #: src/addons/incremental.php:342, src/addons/reporting.php:261, src/admin.php:3981
817
  msgid "None"
818
  msgstr ""
819
 
821
  msgid "Every hour"
822
  msgstr ""
823
 
824
+ #: src/addons/incremental.php:344, src/addons/incremental.php:345, src/addons/incremental.php:346, src/addons/incremental.php:347, src/admin.php:3696, src/admin.php:3697, src/admin.php:3698, src/updraftplus.php:100, src/updraftplus.php:101, src/updraftplus.php:102
825
  msgid "Every %s hours"
826
  msgstr ""
827
 
828
+ #: src/addons/incremental.php:348, src/admin.php:3699
829
  msgid "Daily"
830
  msgstr ""
831
 
832
+ #: src/addons/incremental.php:349, src/admin.php:3700
833
  msgid "Weekly"
834
  msgstr ""
835
 
836
+ #: src/addons/incremental.php:350, src/admin.php:3701
837
  msgid "Fortnightly"
838
  msgstr ""
839
 
840
+ #: src/addons/incremental.php:351, src/admin.php:3702
841
  msgid "Monthly"
842
  msgstr ""
843
 
869
  msgid "Please make sure that you have made a note of the password!"
870
  msgstr ""
871
 
872
+ #: src/addons/lockadmin.php:171, src/addons/moredatabase.php:241, src/addons/sftp.php:455, src/addons/webdav.php:193, src/admin.php:2925, src/methods/openstack2.php:164, src/methods/updraftvault.php:382, src/templates/wp-admin/settings/updraftcentral-connect.php:50
873
  msgid "Password"
874
  msgstr ""
875
 
961
  msgid "After pressing this button, you will be given the option to choose which components you wish to migrate"
962
  msgstr ""
963
 
964
+ #: src/addons/migrator.php:274, src/admin.php:665, src/admin.php:852, src/admin.php:4147
965
  msgid "Restore"
966
  msgstr ""
967
 
985
  msgid "Replace with"
986
  msgstr ""
987
 
988
+ #: src/addons/migrator.php:340, src/addons/moredatabase.php:89, src/addons/moredatabase.php:91, src/addons/moredatabase.php:93, src/addons/sftp.php:518, src/addons/sftp.php:522, src/addons/sftp.php:526, src/addons/webdav.php:253, src/admin.php:871, src/includes/class-remote-send.php:542, src/methods/addon-base-v2.php:305, src/methods/cloudfiles-new.php:184, src/methods/cloudfiles-new.php:189, src/methods/cloudfiles.php:519, src/methods/cloudfiles.php:524, src/methods/ftp.php:417, src/methods/ftp.php:421, src/methods/openstack2.php:180, src/methods/openstack2.php:185, src/methods/openstack2.php:190, src/methods/openstack2.php:195, src/methods/s3.php:1139, src/methods/s3.php:1143
989
  msgid "Failure: No %s was given."
990
  msgstr ""
991
 
1057
  msgid "other content from wp-content"
1058
  msgstr ""
1059
 
1060
+ #: src/addons/migrator.php:499, src/addons/multisite.php:694
1061
  msgid "Must-use plugins"
1062
  msgstr ""
1063
 
1187
  msgid "SQL update commands run:"
1188
  msgstr ""
1189
 
1190
+ #: src/addons/migrator.php:1305, src/admin.php:816
1191
  msgid "Errors:"
1192
  msgstr ""
1193
 
1195
  msgid "Time taken (seconds):"
1196
  msgstr ""
1197
 
1198
+ #: src/addons/migrator.php:1320, src/restorer.php:3022
1199
  msgid "the database query being run was:"
1200
  msgstr ""
1201
 
1239
  msgid "Paste key here"
1240
  msgstr ""
1241
 
1242
+ #: src/addons/migrator.php:1748, src/admin.php:864
1243
  msgid "Add site"
1244
  msgstr ""
1245
 
1259
  msgid "Enter your chosen name"
1260
  msgstr ""
1261
 
1262
+ #: src/addons/migrator.php:1761, src/addons/sftp.php:463, src/admin.php:870, src/admin.php:5177, src/templates/wp-admin/settings/temporary-clone.php:63
1263
  msgid "Key"
1264
  msgstr ""
1265
 
1331
  msgid "%s total table(s) found; %s with the indicated prefix."
1332
  msgstr ""
1333
 
1334
+ #: src/addons/moredatabase.php:144, src/admin.php:1657
1335
  msgid "Messages:"
1336
  msgstr ""
1337
 
1375
  msgid "Username"
1376
  msgstr ""
1377
 
1378
+ #: src/addons/moredatabase.php:242, src/addons/reporting.php:276, src/addons/wp-cli.php:432, src/admin.php:360, src/admin.php:3956, src/admin.php:4009, src/includes/class-remote-send.php:411, src/includes/class-wpadmin-commands.php:157, src/includes/class-wpadmin-commands.php:556, src/restorer.php:466, src/templates/wp-admin/settings/delete-and-restore-modals.php:75, src/templates/wp-admin/settings/delete-and-restore-modals.php:76, src/templates/wp-admin/settings/take-backup.php:34
1379
  msgid "Database"
1380
  msgstr ""
1381
 
1427
  msgid "(None configured)"
1428
  msgstr ""
1429
 
1430
+ #: src/addons/morefiles.php:71, src/admin.php:879
1431
  msgctxt "(verb)"
1432
  msgid "Download"
1433
  msgstr ""
1436
  msgid "Contains:"
1437
  msgstr ""
1438
 
1439
+ #: src/addons/morefiles.php:137, src/templates/wp-admin/settings/delete-and-restore-modals.php:76
1440
  msgid "%s restoration options:"
1441
  msgstr ""
1442
 
1443
+ #: src/addons/morefiles.php:137, src/includes/class-wpadmin-commands.php:558
1444
  msgid "WordPress Core"
1445
  msgstr ""
1446
 
1512
  msgid "Go up a directory"
1513
  msgstr ""
1514
 
1515
+ #: src/addons/morefiles.php:311, src/admin.php:845
1516
  msgid "Cancel"
1517
  msgstr ""
1518
 
1528
  msgid "Exclude these:"
1529
  msgstr ""
1530
 
1531
+ #: src/addons/morefiles.php:476, src/admin.php:3810
1532
  msgid "If entering multiple files/directories, then separate them with commas. For entities at the top level, you can use a * at the start or end of the entry as a wildcard."
1533
  msgstr ""
1534
 
1544
  msgid "(as many as you like)"
1545
  msgstr ""
1546
 
1547
+ #: src/addons/morestorage.php:81, src/admin.php:925
1548
  msgid "Currently enabled"
1549
  msgstr ""
1550
 
1551
+ #: src/addons/morestorage.php:81, src/admin.php:926
1552
  msgid "Currently disabled"
1553
  msgstr ""
1554
 
1568
  msgid "(Nothing has been logged yet)"
1569
  msgstr ""
1570
 
1571
+ #: src/addons/multisite.php:96, src/addons/multisite.php:738, src/options.php:74
1572
  msgid "UpdraftPlus Backups"
1573
  msgstr ""
1574
 
1575
+ #: src/addons/multisite.php:209
1576
  msgid "Multisite Install"
1577
  msgstr ""
1578
 
1579
+ #: src/addons/multisite.php:502, src/class-updraftplus.php:1799
1580
  msgid "Uploads"
1581
  msgstr ""
1582
 
1583
+ #: src/addons/multisite.php:603
1584
  msgid "Which site to restore"
1585
  msgstr ""
1586
 
1587
+ #: src/addons/multisite.php:607
1588
  msgid "All sites"
1589
  msgstr ""
1590
 
1591
+ #: src/addons/multisite.php:612
1592
  msgid "may include some site-wide data"
1593
  msgstr ""
1594
 
1595
+ #: src/addons/multisite.php:621
1596
  msgid "Read more..."
1597
  msgstr ""
1598
 
1599
+ #: src/addons/multisite.php:701
1600
  msgid "Blog uploads"
1601
  msgstr ""
1602
 
1700
  msgid "If OneDrive later shows you the message \"unauthorized_client\", then you did not enter a valid client ID here."
1701
  msgstr ""
1702
 
1703
+ #: src/addons/onedrive.php:1180, src/restorer.php:1256
1704
  msgid "folder"
1705
  msgstr ""
1706
 
1780
  msgid "Time taken:"
1781
  msgstr ""
1782
 
1783
+ #: src/addons/reporting.php:239, src/admin.php:3969
1784
  msgid "Uploaded to:"
1785
  msgstr ""
1786
 
1816
  msgid "Log all messages to syslog (only server admins are likely to want this)"
1817
  msgstr ""
1818
 
1819
+ #: src/addons/reporting.php:539, src/admin.php:800
1820
  msgid "To send to more than one address, separate each address with a comma."
1821
  msgstr ""
1822
 
1823
+ #: src/addons/reporting.php:541, src/admin.php:794
1824
  msgid "Send a report only when there are warnings/errors"
1825
  msgstr ""
1826
 
1828
  msgid "Be aware that mail servers tend to have size limits; typically around %s MB; backups larger than any limits will likely not arrive."
1829
  msgstr ""
1830
 
1831
+ #: src/addons/reporting.php:543, src/admin.php:795
1832
  msgid "When the Email storage method is enabled, also send the backup"
1833
  msgstr ""
1834
 
1840
  msgid "Use this option to only send database backups when sending to email, and skip other components."
1841
  msgstr ""
1842
 
1843
+ #: src/addons/reporting.php:545, src/admin.php:798
1844
  msgid "Only email the database backup"
1845
  msgstr ""
1846
 
2229
  msgid "No previous backup found to add an increment to."
2230
  msgstr ""
2231
 
2232
+ #: src/addons/wp-cli.php:110, src/admin.php:803
2233
  msgid "You have chosen to backup a database, but no tables have been selected"
2234
  msgstr ""
2235
 
2236
+ #: src/addons/wp-cli.php:116, src/admin.php:801
2237
  msgid "If you exclude both the database and the files, then you have excluded everything!"
2238
  msgstr ""
2239
 
2265
  msgid "Latest full backup found; identifier:"
2266
  msgstr ""
2267
 
2268
+ #: src/addons/wp-cli.php:430, src/admin.php:4003, src/admin.php:4051
2269
  msgid "unknown source"
2270
  msgstr ""
2271
 
2272
+ #: src/addons/wp-cli.php:432, src/admin.php:4009
2273
  msgid "Database (created by %s)"
2274
  msgstr ""
2275
 
2276
+ #: src/addons/wp-cli.php:438, src/admin.php:4011
2277
  msgid "External database"
2278
  msgstr ""
2279
 
2280
+ #: src/addons/wp-cli.php:450, src/admin.php:4055
2281
  msgid "Files and database WordPress backup (created by %s)"
2282
  msgstr ""
2283
 
2284
+ #: src/addons/wp-cli.php:450, src/admin.php:4055
2285
  msgid "Files backup (created by %s)"
2286
  msgstr ""
2287
 
2288
+ #: src/addons/wp-cli.php:519, src/admin.php:820, src/class-updraftplus.php:1316, src/class-updraftplus.php:1360, src/includes/class-filesystem-functions.php:414, src/includes/class-storage-methods-interface.php:324, src/methods/addon-base-v2.php:93, src/methods/addon-base-v2.php:98, src/methods/addon-base-v2.php:205, src/methods/addon-base-v2.php:225, src/methods/googledrive.php:1118, src/methods/remotesend.php:315, src/methods/stream-base.php:219, src/restorer.php:3172, src/restorer.php:3197, src/restorer.php:3278, src/udaddons/options.php:227, src/updraftplus.php:157
2289
  msgid "Error"
2290
  msgstr ""
2291
 
2305
  msgid "No valid components found, please select different components or a backup set with components that can be restored."
2306
  msgstr ""
2307
 
2308
+ #: src/addons/wp-cli.php:650, src/admin.php:4615
2309
  msgid "UpdraftPlus Restoration: Progress"
2310
  msgstr ""
2311
 
2312
+ #: src/addons/wp-cli.php:664, src/admin.php:4519
2313
  msgid "Follow this link to download the log file for this restoration (needed for any support requests)."
2314
  msgstr ""
2315
 
2325
  msgid "You have given the %1$s option. The %1$s is working with \"%2$s\" addon. Get the \"%2$s\" addon: %3$s"
2326
  msgstr ""
2327
 
2328
+ #: src/addons/wp-cli.php:872, src/includes/class-filesystem-functions.php:80
2329
  msgid "Why am I seeing this?"
2330
  msgstr ""
2331
 
2349
  msgid "At the same time as the files backup"
2350
  msgstr ""
2351
 
2352
+ #: src/admin.php:350, src/admin.php:5146, src/templates/wp-admin/settings/take-backup.php:24
2353
  msgid "Files"
2354
  msgstr ""
2355
 
2373
  msgid "Are you sure you want to dismiss all UpdraftPlus news forever?"
2374
  msgstr ""
2375
 
2376
+ #: src/admin.php:578
2377
  msgid "You can test upgrading your site on an instant copy using UpdraftClone credits"
2378
  msgstr ""
2379
 
2380
+ #: src/admin.php:578
2381
+ msgid "go here to learn more"
2382
+ msgstr ""
2383
+
2384
+ #: src/admin.php:578
2385
+ msgid "dismiss notice"
2386
  msgstr ""
2387
 
2388
+ #: src/admin.php:590
2389
  msgid "You can test running your site on a different PHP (or WordPress) version using UpdraftClone credits."
2390
  msgstr ""
2391
 
2392
+ #: src/admin.php:590
2393
+ msgid "Dismiss notice"
2394
+ msgstr ""
2395
+
2396
+ #: src/admin.php:665
2397
  msgid "Backup"
2398
  msgstr ""
2399
 
2400
+ #: src/admin.php:673, src/admin.php:2772
2401
  msgid "Migrate / Clone"
2402
  msgstr ""
2403
 
2404
+ #: src/admin.php:681, src/admin.php:1099, src/admin.php:2773
2405
  msgid "Settings"
2406
  msgstr ""
2407
 
2408
+ #: src/admin.php:689, src/admin.php:2774
2409
  msgid "Advanced Tools"
2410
  msgstr ""
2411
 
2412
+ #: src/admin.php:697
2413
  msgid "Extensions"
2414
  msgstr ""
2415
 
2416
+ #: src/admin.php:796
2417
  msgid "Be aware that mail servers tend to have size limits; typically around %s Mb; backups larger than any limits will likely not arrive."
2418
  msgstr ""
2419
 
2420
+ #: src/admin.php:797
2421
  msgid "Rescanning (looking for backups that you have uploaded manually into the internal backup store)..."
2422
  msgstr ""
2423
 
2424
+ #: src/admin.php:799
2425
  msgid "Rescanning remote and local storage for backup sets..."
2426
  msgstr ""
2427
 
2428
+ #: src/admin.php:802
2429
  msgid "You have chosen to backup files, but no file entities have been selected"
2430
  msgstr ""
2431
 
2432
+ #: src/admin.php:804, src/admin.php:4516
2433
  msgid "The restore operation has begun. Do not press stop or close your browser until it reports itself as having finished."
2434
  msgstr ""
2435
 
2436
+ #: src/admin.php:806
2437
  msgid "The web server returned an error code (try again, or check your web server logs)"
2438
  msgstr ""
2439
 
2440
+ #: src/admin.php:807
2441
  msgid "The new user's RackSpace console password is (this will not be shown again):"
2442
  msgstr ""
2443
 
2444
+ #: src/admin.php:808
2445
  msgid "Trying..."
2446
  msgstr ""
2447
 
2448
+ #: src/admin.php:809
2449
  msgid "Fetching..."
2450
  msgstr ""
2451
 
2452
+ #: src/admin.php:810
2453
  msgid "calculating..."
2454
  msgstr ""
2455
 
2456
+ #: src/admin.php:811
2457
  msgid "Begun looking for this entity"
2458
  msgstr ""
2459
 
2460
+ #: src/admin.php:812
2461
  msgid "Some files are still downloading or being processed - please wait."
2462
  msgstr ""
2463
 
2464
+ #: src/admin.php:813
2465
  msgid "Processing files - please wait..."
2466
  msgstr ""
2467
 
2468
+ #: src/admin.php:814
2469
  msgid "Error: the server sent an empty response."
2470
  msgstr ""
2471
 
2472
+ #: src/admin.php:815
2473
  msgid "Warnings:"
2474
  msgstr ""
2475
 
2476
+ #: src/admin.php:817
2477
  msgid "Error: the server sent us a response which we did not understand."
2478
  msgstr ""
2479
 
2480
+ #: src/admin.php:818, src/restorer.php:180
2481
  msgid "Error data:"
2482
  msgstr ""
2483
 
2484
+ #: src/admin.php:821, src/admin.php:1933, src/includes/deprecated-actions.php:29, src/templates/wp-admin/settings/downloading-and-restoring.php:21, src/templates/wp-admin/settings/tab-backups.php:21, src/templates/wp-admin/settings/tab-backups.php:44
2485
  msgid "Existing Backups"
2486
  msgstr ""
2487
 
2488
+ #: src/admin.php:822, src/admin.php:2225
2489
  msgid "File ready."
2490
  msgstr ""
2491
 
2492
+ #: src/admin.php:823, src/admin.php:2552, src/admin.php:3411, src/admin.php:4479, src/admin.php:4489, src/admin.php:4498, src/templates/wp-admin/settings/existing-backups-table.php:19, src/templates/wp-admin/settings/existing-backups-table.php:137
2493
  msgid "Actions"
2494
  msgstr ""
2495
 
2496
+ #: src/admin.php:824
2497
  msgid "Delete from your web server"
2498
  msgstr ""
2499
 
2500
+ #: src/admin.php:825
2501
  msgid "Download to your computer"
2502
  msgstr ""
2503
 
2504
+ #: src/admin.php:826
2505
  msgid "Browse contents"
2506
  msgstr ""
2507
 
2508
+ #: src/admin.php:827
2509
  msgid "Download error: the server sent us a response which we did not understand."
2510
  msgstr ""
2511
 
2512
+ #: src/admin.php:828
2513
  msgid "Requesting start of backup..."
2514
  msgstr ""
2515
 
2516
+ #: src/admin.php:829
2517
  msgid "PHP information"
2518
  msgstr ""
2519
 
2520
+ #: src/admin.php:830, src/admin.php:3125
2521
  msgid "Delete Old Directories"
2522
  msgstr ""
2523
 
2524
+ #: src/admin.php:831
2525
  msgid "Raw backup history"
2526
  msgstr ""
2527
 
2528
+ #: src/admin.php:832, src/admin.php:833, src/includes/class-backup-history.php:506
2529
  msgid "This file does not appear to be an UpdraftPlus backup archive (such files are .zip or .gz files which have a name like: backup_(time)_(site name)_(code)_(type).(zip|gz))."
2530
  msgstr ""
2531
 
2532
+ #: src/admin.php:832
2533
  msgid "However, UpdraftPlus archives are standard zip/SQL files - so if you are sure that your file has the right format, then you can rename it to match that pattern."
2534
  msgstr ""
2535
 
2536
+ #: src/admin.php:833, src/includes/class-backup-history.php:506
2537
  msgid "If this is a backup created by a different backup plugin, then UpdraftPlus Premium may be able to help you."
2538
  msgstr ""
2539
 
2540
+ #: src/admin.php:834
2541
  msgid "(make sure that you were trying to upload a zip file previously created by UpdraftPlus)"
2542
  msgstr ""
2543
 
2544
+ #: src/admin.php:835
2545
  msgid "Upload error:"
2546
  msgstr ""
2547
 
2548
+ #: src/admin.php:836
2549
  msgid "This file does not appear to be an UpdraftPlus encrypted database archive (such files are .gz.crypt files which have a name like: backup_(time)_(site name)_(code)_db.crypt.gz)."
2550
  msgstr ""
2551
 
2552
+ #: src/admin.php:837
2553
  msgid "Upload error"
2554
  msgstr ""
2555
 
2556
+ #: src/admin.php:838
2557
  msgid "Follow this link to attempt decryption and download the database file to your computer."
2558
  msgstr ""
2559
 
2560
+ #: src/admin.php:839
2561
  msgid "This decryption key will be attempted:"
2562
  msgstr ""
2563
 
2564
+ #: src/admin.php:840
2565
  msgid "Unknown server response:"
2566
  msgstr ""
2567
 
2568
+ #: src/admin.php:841
2569
  msgid "Unknown server response status:"
2570
  msgstr ""
2571
 
2572
+ #: src/admin.php:842
2573
  msgid "The file was uploaded."
2574
  msgstr ""
2575
 
2576
+ #: src/admin.php:844, src/templates/wp-admin/settings/take-backup.php:51
2577
  msgid "Backup Now"
2578
  msgstr ""
2579
 
2580
+ #: src/admin.php:846, src/admin.php:3439, src/admin.php:3473, src/admin.php:4246, src/includes/class-remote-send.php:646, src/templates/wp-admin/settings/existing-backups-table.php:153, src/templates/wp-admin/settings/file-backup-exclude.php:11
2581
  msgid "Delete"
2582
  msgstr ""
2583
 
2584
+ #: src/admin.php:847, src/central/bootstrap.php:565
2585
  msgid "Create"
2586
  msgstr ""
2587
 
2588
+ #: src/admin.php:848, src/admin.php:4226
2589
  msgid "Upload"
2590
  msgstr ""
2591
 
2592
+ #: src/admin.php:849
2593
  msgid "You did not select any components to restore. Please select at least one, and then try again."
2594
  msgstr ""
2595
 
2596
+ #: src/admin.php:851, src/includes/updraftplus-tour.php:89
2597
  msgid "Close"
2598
  msgstr ""
2599
 
2600
+ #: src/admin.php:853, src/admin.php:3677
2601
  msgid "Download log file"
2602
  msgstr ""
2603
 
2604
+ #: src/admin.php:855, src/admin.php:881, src/admin.php:882
2605
  msgid "You have made changes to your settings, and not saved."
2606
  msgstr ""
2607
 
2608
+ #: src/admin.php:856
2609
  msgid "Saving..."
2610
  msgstr ""
2611
 
2612
+ #: src/admin.php:857, src/admin.php:2856, src/methods/updraftvault.php:337, src/methods/updraftvault.php:383, src/templates/wp-admin/settings/temporary-clone.php:82
2613
  msgid "Connect"
2614
  msgstr ""
2615
 
2616
+ #: src/admin.php:858
2617
  msgid "Connecting..."
2618
  msgstr ""
2619
 
2620
+ #: src/admin.php:859, src/methods/updraftvault.php:413, src/methods/updraftvault.php:483
2621
  msgid "Disconnect"
2622
  msgstr ""
2623
 
2624
+ #: src/admin.php:860
2625
  msgid "Disconnecting..."
2626
  msgstr ""
2627
 
2628
+ #: src/admin.php:861
2629
  msgid "Counting..."
2630
  msgstr ""
2631
 
2632
+ #: src/admin.php:862
2633
  msgid "Update quota count"
2634
  msgstr ""
2635
 
2636
+ #: src/admin.php:863
2637
  msgid "Adding..."
2638
  msgstr ""
2639
 
2640
+ #: src/admin.php:865
2641
  msgid "Resetting..."
2642
  msgstr ""
2643
 
2644
+ #: src/admin.php:866
2645
  msgid "Creating..."
2646
  msgstr ""
2647
 
2648
+ #: src/admin.php:866
2649
  msgid "your PHP install lacks the openssl module; as a result, this can take minutes; if nothing has happened by then, then you should either try a smaller key size, or ask your web hosting company how to enable this PHP module on your setup."
2650
  msgstr ""
2651
 
2652
+ #: src/admin.php:867, src/includes/class-remote-send.php:616
2653
  msgid "Send to site:"
2654
  msgstr ""
2655
 
2656
+ #: src/admin.php:868, src/includes/class-remote-send.php:377
2657
  msgid "You should check that the remote site is online, not firewalled, does not have security modules that may be blocking access, has UpdraftPlus version %s or later active and that the keys have been entered correctly."
2658
  msgstr ""
2659
 
2660
+ #: src/admin.php:869
2661
  msgid "Please give this key a name (e.g. indicate the site it is for):"
2662
  msgstr ""
2663
 
2664
+ #: src/admin.php:871
2665
  msgid "key name"
2666
  msgstr ""
2667
 
2668
+ #: src/admin.php:872, src/templates/wp-admin/settings/existing-backups-table.php:159
2669
  msgid "Deleting..."
2670
  msgstr ""
2671
 
2672
+ #: src/admin.php:873
2673
  msgid "Please enter a valid URL"
2674
  msgstr ""
2675
 
2676
+ #: src/admin.php:874
2677
  msgid "We requested to delete the file, but could not understand the server's response"
2678
  msgstr ""
2679
 
2680
+ #: src/admin.php:875, src/includes/class-remote-send.php:407
2681
  msgid "Testing connection..."
2682
  msgstr ""
2683
 
2684
+ #: src/admin.php:876, src/includes/class-remote-send.php:438, src/includes/class-remote-send.php:622
2685
  msgid "Send"
2686
  msgstr ""
2687
 
2688
+ #: src/admin.php:880
2689
  msgid "With UpdraftPlus Premium, you can directly download individual files from here."
2690
  msgstr ""
2691
 
2692
+ #: src/admin.php:881
2693
  msgid "You should save your changes to ensure that they are used for making your backup."
2694
  msgstr ""
2695
 
2696
+ #: src/admin.php:882
2697
  msgid "Your export file will be of your displayed settings, not your saved ones."
2698
  msgstr ""
2699
 
2700
+ #: src/admin.php:885
2701
  msgid "day"
2702
  msgstr ""
2703
 
2704
+ #: src/admin.php:886
2705
  msgid "in the month"
2706
  msgstr ""
2707
 
2708
+ #: src/admin.php:887
2709
  msgid "day(s)"
2710
  msgstr ""
2711
 
2712
+ #: src/admin.php:888
2713
  msgid "hour(s)"
2714
  msgstr ""
2715
 
2716
+ #: src/admin.php:889
2717
  msgid "week(s)"
2718
  msgstr ""
2719
 
2720
+ #: src/admin.php:890
2721
  msgid "For backups older than"
2722
  msgstr ""
2723
 
2724
+ #: src/admin.php:892
2725
  msgid "Processing..."
2726
  msgstr ""
2727
 
2728
+ #: src/admin.php:893
2729
  msgid "Please fill in the required information."
2730
  msgstr ""
2731
 
2732
+ #: src/admin.php:894, src/methods/backup-module.php:317
2733
  msgid "Test %s Settings"
2734
  msgstr ""
2735
 
2736
+ #: src/admin.php:895
2737
  msgid "Testing %s Settings..."
2738
  msgstr ""
2739
 
2740
+ #: src/admin.php:896
2741
  msgid "%s settings test result:"
2742
  msgstr ""
2743
 
2744
+ #: src/admin.php:897
2745
  msgid "Nothing yet logged"
2746
  msgstr ""
2747
 
2748
+ #: src/admin.php:898
2749
  msgid "You have not yet selected a file to import."
2750
  msgstr ""
2751
 
2752
+ #: src/admin.php:899
2753
  msgid "Error: The chosen file is corrupt. Please choose a valid UpdraftPlus export file."
2754
  msgstr ""
2755
 
2756
+ #: src/admin.php:902
2757
  msgid "Importing..."
2758
  msgstr ""
2759
 
2760
+ #: src/admin.php:903
2761
  msgid "This will import data from:"
2762
  msgstr ""
2763
 
2764
+ #: src/admin.php:904
2765
  msgid "Which was exported on:"
2766
  msgstr ""
2767
 
2768
+ #: src/admin.php:905
2769
  msgid "Do you want to carry out the import?"
2770
  msgstr ""
2771
 
2772
+ #: src/admin.php:906
2773
  msgid "Complete"
2774
  msgstr ""
2775
 
2776
+ #: src/admin.php:907, src/admin.php:3184
2777
  msgid "The backup has finished running"
2778
  msgstr ""
2779
 
2780
+ #: src/admin.php:908
2781
  msgid "The backup was aborted"
2782
  msgstr ""
2783
 
2784
+ #: src/admin.php:910
2785
  msgid "remote files deleted"
2786
  msgstr ""
2787
 
2788
+ #: src/admin.php:911
2789
  msgid "HTTP code:"
2790
  msgstr ""
2791
 
2792
+ #: src/admin.php:912
2793
  msgid "The file failed to upload. Please check the following:"
2794
  msgstr ""
2795
 
2796
+ #: src/admin.php:912
2797
  msgid "Any settings in your .htaccess or web.config file that affects the maximum upload or post size."
2798
  msgstr ""
2799
 
2800
+ #: src/admin.php:912
2801
  msgid "The available memory on the server."
2802
  msgstr ""
2803
 
2804
+ #: src/admin.php:912
2805
  msgid "That you are attempting to upload a zip file previously created by UpdraftPlus."
2806
  msgstr ""
2807
 
2808
+ #: src/admin.php:912
2809
  msgid "Further information may be found in the browser JavaScript console, and the server PHP error logs."
2810
  msgstr ""
2811
 
2812
+ #: src/admin.php:913
2813
  msgid "Browsing zip file"
2814
  msgstr ""
2815
 
2816
+ #: src/admin.php:914
2817
  msgid "Select a file to view information about it"
2818
  msgstr ""
2819
 
2820
+ #: src/admin.php:915
2821
  msgid "Search"
2822
  msgstr ""
2823
 
2824
+ #: src/admin.php:916
2825
  msgid "Unable to download file. This could be caused by a timeout. It would be best to download the zip to your computer."
2826
  msgstr ""
2827
 
2828
+ #: src/admin.php:917
2829
  msgid "Loading log file"
2830
  msgstr ""
2831
 
2832
+ #: src/admin.php:920
2833
  msgid "Please enter a valid URL e.g http://example.com"
2834
  msgstr ""
2835
 
2836
+ #: src/admin.php:927
2837
  msgid "Local backup upload has started; please check the log file to see the upload progress"
2838
  msgstr ""
2839
 
2840
+ #: src/admin.php:928
2841
  msgid "You must select at least one remote storage destination to upload this backup set to."
2842
  msgstr ""
2843
 
2844
+ #: src/admin.php:929
2845
  msgid "(already uploaded)"
2846
  msgstr ""
2847
 
2848
+ #: src/admin.php:930
2849
  msgid "Please specify the Microsoft OneDrive folder name, not the URL."
2850
  msgstr ""
2851
 
2852
+ #: src/admin.php:931, src/templates/wp-admin/settings/updraftcentral-connect.php:9
2853
  msgid "UpdraftCentral Cloud"
2854
  msgstr ""
2855
 
2856
+ #: src/admin.php:932
2857
  msgid "Connected. Requesting UpdraftCentral Key."
2858
  msgstr ""
2859
 
2860
+ #: src/admin.php:933
2861
  msgid "Key created. Adding site to UpdraftCentral Cloud."
2862
  msgstr ""
2863
 
2864
+ #: src/admin.php:934
2865
  msgid "Login successful."
2866
  msgstr ""
2867
 
2868
+ #: src/admin.php:934, src/admin.php:936
2869
  msgid "Please follow this link to open %s in a new window."
2870
  msgstr ""
2871
 
2872
+ #: src/admin.php:935
2873
  msgid "Login successful; reloading information."
2874
  msgstr ""
2875
 
2876
+ #: src/admin.php:936
2877
  msgid "Registration successful."
2878
  msgstr ""
2879
 
2880
+ #: src/admin.php:937
2881
  msgid "Both email and password fields are required."
2882
  msgstr ""
2883
 
2884
+ #: src/admin.php:938
2885
  msgid "An email is required and needs to be in a valid format."
2886
  msgstr ""
2887
 
2888
+ #: src/admin.php:939
2889
  msgid "Trouble connecting? Try using an alternative method in the advanced security options."
2890
  msgstr ""
2891
 
2892
+ #: src/admin.php:940
2893
  msgid "Verifying one-time password..."
2894
  msgstr ""
2895
 
2896
+ #: src/admin.php:941
2897
  msgid "Perhaps you would want to login instead."
2898
  msgstr ""
2899
 
2900
+ #: src/admin.php:942
2901
  msgid "Please wait while the system generates and registers an encryption key for your website with UpdraftCentral Cloud."
2902
  msgstr ""
2903
 
2904
+ #: src/admin.php:943
2905
  msgid "Please wait while you are redirected to UpdraftCentral Cloud."
2906
  msgstr ""
2907
 
2908
+ #: src/admin.php:944
2909
  msgid "You need to read and accept the UpdraftCentral Cloud data and privacy policies before you can proceed."
2910
  msgstr ""
2911
 
2912
+ #: src/admin.php:945
2913
  msgid "You can also close this wizard."
2914
  msgstr ""
2915
 
2916
+ #: src/admin.php:946
2917
  msgid "For future control of all your UpdraftCentral connections, go to the \"Advanced Tools\" tab."
2918
  msgstr ""
2919
 
2920
+ #: src/admin.php:948
2921
  msgid "Warning: you have selected a lower version than your currently installed version. This may fail if you have components that are incompatible with earlier versions."
2922
  msgstr ""
2923
 
2924
+ #: src/admin.php:949
2925
  msgid "The clone has been provisioned, and its data has been sent to it. Once the clone has finished deploying it, you will receive an email."
2926
  msgstr ""
2927
 
2928
+ #: src/admin.php:950
2929
  msgid "The preparation of the clone data has been aborted."
2930
  msgstr ""
2931
 
2932
+ #: src/admin.php:952
2933
  msgid "Are you sure you want to remove this exclusion rule?"
2934
  msgstr ""
2935
 
2936
+ #: src/admin.php:953
2937
  msgid "Please select a file/folder which you would like to exclude"
2938
  msgstr ""
2939
 
2940
+ #: src/admin.php:954
2941
  msgid "Please enter a file extension, like zip"
2942
  msgstr ""
2943
 
2944
+ #: src/admin.php:955
2945
  msgid "Please enter a valid file extension"
2946
  msgstr ""
2947
 
2948
+ #: src/admin.php:956
2949
  msgid "Please enter characters that begin the filename which you would like to exclude"
2950
  msgstr ""
2951
 
2952
+ #: src/admin.php:957
2953
  msgid "Please enter a valid file name prefix"
2954
  msgstr ""
2955
 
2956
+ #: src/admin.php:958
2957
  msgid "The exclusion rule which you are trying to add already exists"
2958
  msgstr ""
2959
 
2960
+ #: src/admin.php:959
2961
  msgid "UpdraftClone key is required."
2962
  msgstr ""
2963
 
2964
+ #: src/admin.php:960, src/templates/wp-admin/settings/backupnow-modal.php:40
2965
  msgid "Include your files in the backup"
2966
  msgstr ""
2967
 
2968
+ #: src/admin.php:961
2969
  msgid "File backup options"
2970
  msgstr ""
2971
 
2972
+ #: src/admin.php:962
2973
+ msgid "Restore error: HTML was detected in the response. You may have a security module on your webserver blocking the restoration operation."
2974
+ msgstr ""
2975
+
2976
+ #: src/admin.php:1101
2977
  msgid "Add-Ons / Pro Support"
2978
  msgstr ""
2979
 
2980
+ #: src/admin.php:1148
2981
  msgid "An error occurred when fetching storage module options: "
2982
  msgstr ""
2983
 
2984
+ #: src/admin.php:1153, src/includes/class-commands.php:466, src/templates/wp-admin/settings/take-backup.php:13
2985
  msgid "The 'Backup Now' button is disabled as your backup directory is not writable (go to the 'Settings' tab and find the relevant option)."
2986
  msgstr ""
2987
 
2988
+ #: src/admin.php:1158
2989
  msgid "Welcome to UpdraftPlus!"
2990
  msgstr ""
2991
 
2992
+ #: src/admin.php:1158
2993
  msgid "To make a backup, just press the Backup Now button."
2994
  msgstr ""
2995
 
2996
+ #: src/admin.php:1158
2997
  msgid "To change any of the default settings of what is backed up, to configure scheduled backups, to send your backups to remote storage (recommended), and more, go to the settings tab."
2998
  msgstr ""
2999
 
3000
+ #: src/admin.php:1162, src/class-updraftplus.php:864
3001
  msgid "The amount of time allowed for WordPress plugins to run is very low (%s seconds) - you should increase it to avoid backup failures due to time-outs (consult your web hosting company for more help - it is the max_execution_time PHP setting; the recommended value is %s seconds or more)"
3002
  msgstr ""
3003
 
3004
+ #: src/admin.php:1166
3005
  msgid "The scheduler is disabled in your WordPress install, via the DISABLE_WP_CRON setting. No backups can run (even &quot;Backup Now&quot;) unless either you have set up a facility to call the scheduler manually, or until it is enabled."
3006
  msgstr ""
3007
 
3008
+ #: src/admin.php:1170
3009
  msgid "You have less than %s of free disk space on the disk which UpdraftPlus is configured to use to create backups. UpdraftPlus could well run out of space. Contact your the operator of your server (e.g. your web hosting company) to resolve this issue."
3010
  msgstr ""
3011
 
3012
+ #: src/admin.php:1174
3013
  msgid "UpdraftPlus does not officially support versions of WordPress before %s. It may work for you, but if it does not, then please be aware that no support is available until you upgrade WordPress."
3014
  msgstr ""
3015
 
3016
+ #: src/admin.php:1178
3017
  msgid "Your website is hosted using the %s web server."
3018
  msgstr ""
3019
 
3020
+ #: src/admin.php:1178
3021
  msgid "Please consult this FAQ if you have problems backing up."
3022
  msgstr ""
3023
 
3024
+ #: src/admin.php:1182
3025
  msgid "Notice"
3026
  msgstr ""
3027
 
3028
+ #: src/admin.php:1182
3029
  msgid "UpdraftPlus's debug mode is on. You may see debugging notices on this page not just from UpdraftPlus, but from any other plugin installed. Please try to make sure that the notice you are seeing is from UpdraftPlus before you raise a support request."
3030
  msgstr ""
3031
 
3032
+ #: src/admin.php:1187
3033
  msgid "WordPress has a number (%d) of scheduled tasks which are overdue. Unless this is a development site, this probably means that the scheduler in your WordPress install is not working."
3034
  msgstr ""
3035
 
3036
+ #: src/admin.php:1187
3037
  msgid "Read this page for a guide to possible causes and how to fix it."
3038
  msgstr ""
3039
 
3040
+ #: src/admin.php:1207, src/admin.php:1228, src/admin.php:1247, src/class-updraftplus.php:600, src/class-updraftplus.php:635, src/class-updraftplus.php:640, src/class-updraftplus.php:645
3041
  msgid "UpdraftPlus notice:"
3042
  msgstr ""
3043
 
3044
+ #: src/admin.php:1207
3045
  msgid "%s has been chosen for remote storage, but you are not currently connected."
3046
  msgstr ""
3047
 
3048
+ #: src/admin.php:1207
3049
  msgid "Go to the remote storage settings in order to connect."
3050
  msgstr ""
3051
 
3052
+ #: src/admin.php:1349, src/admin.php:1359
3053
  msgid "Error: invalid path"
3054
  msgstr ""
3055
 
3056
+ #: src/admin.php:1710, src/includes/class-wpadmin-commands.php:541
3057
  msgid "Backup set not found"
3058
  msgstr ""
3059
 
3060
+ #: src/admin.php:1796
3061
  msgid "Did not know how to delete from this cloud service."
3062
  msgstr ""
3063
 
3064
+ #: src/admin.php:1877
3065
  msgid "Backup sets removed:"
3066
  msgstr ""
3067
 
3068
+ #: src/admin.php:1878
3069
  msgid "Local files deleted:"
3070
  msgstr ""
3071
 
3072
+ #: src/admin.php:1879
3073
  msgid "Remote files deleted:"
3074
  msgstr ""
3075
 
3076
+ #: src/admin.php:1966
3077
  msgid "Job deleted"
3078
  msgstr ""
3079
 
3080
+ #: src/admin.php:1974
3081
  msgid "Could not find that job - perhaps it has already finished?"
3082
  msgstr ""
3083
 
3084
+ #: src/admin.php:2072, src/admin.php:2093, src/includes/class-commands.php:836
3085
  msgid "Start backup"
3086
  msgstr ""
3087
 
3088
+ #: src/admin.php:2072, src/includes/class-commands.php:836
3089
  msgid "OK. You should soon see activity in the \"Last log message\" field below."
3090
  msgstr ""
3091
 
3092
+ #: src/admin.php:2155, src/admin.php:2159, src/class-updraftplus.php:635
3093
  msgid "The log file could not be read."
3094
  msgstr ""
3095
 
3096
+ #: src/admin.php:2206
3097
  msgid "Download failed"
3098
  msgstr ""
3099
 
3100
+ #: src/admin.php:2236
3101
  msgid "Download in progress"
3102
  msgstr ""
3103
 
3104
+ #: src/admin.php:2239
3105
  msgid "No local copy present."
3106
  msgstr ""
3107
 
3108
+ #: src/admin.php:2293, src/backup.php:1197
3109
  msgid "Backup directory (%s) is not writable, or does not exist."
3110
  msgstr ""
3111
 
3112
+ #: src/admin.php:2293
3113
  msgid "You will find more information about this in the Settings section."
3114
  msgstr ""
3115
 
3116
+ #: src/admin.php:2330
3117
  msgid "This file could not be uploaded"
3118
  msgstr ""
3119
 
3120
+ #: src/admin.php:2345
3121
  msgid "This backup was created by %s, and can be imported."
3122
  msgstr ""
3123
 
3124
+ #: src/admin.php:2351
3125
  msgid "Bad filename format - this does not look like a file created by UpdraftPlus"
3126
  msgstr ""
3127
 
3128
+ #: src/admin.php:2359
3129
  msgid "This looks like a file created by UpdraftPlus, but this install does not know about this type of object: %s. Perhaps you need to install an add-on?"
3130
  msgstr ""
3131
 
3132
+ #: src/admin.php:2451
3133
  msgid "Bad filename format - this does not look like an encrypted database file created by UpdraftPlus"
3134
  msgstr ""
3135
 
3136
+ #: src/admin.php:2543
3137
  msgid "Backup directory could not be created"
3138
  msgstr ""
3139
 
3140
+ #: src/admin.php:2550
3141
  msgid "Backup directory successfully created."
3142
  msgstr ""
3143
 
3144
+ #: src/admin.php:2552, src/admin.php:3411, src/admin.php:4479, src/admin.php:4489, src/admin.php:4498, src/admin.php:5493
3145
  msgid "Return to UpdraftPlus configuration"
3146
  msgstr ""
3147
 
3148
+ #: src/admin.php:2564, src/class-updraftplus.php:4316, src/restorer.php:2879
3149
  msgid "Warning:"
3150
  msgstr ""
3151
 
3152
+ #: src/admin.php:2564
3153
  msgid "If you can still read these words after the page finishes loading, then there is a JavaScript or jQuery problem in the site."
3154
  msgstr ""
3155
 
3156
+ #: src/admin.php:2567
3157
  msgid "The UpdraftPlus directory in wp-content/plugins has white-space in it; WordPress does not like this. You should rename the directory to wp-content/plugins/updraftplus to fix this problem."
3158
  msgstr ""
3159
 
3160
+ #: src/admin.php:2582
3161
  msgid "OptimizePress 2.0 encodes its contents, so search/replace does not work."
3162
  msgstr ""
3163
 
3164
+ #: src/admin.php:2582
3165
  msgid "To fix this problem go here."
3166
  msgstr ""
3167
 
3168
+ #: src/admin.php:2584
3169
  msgid "For even more features and personal support, check out "
3170
  msgstr ""
3171
 
3172
+ #: src/admin.php:2586
3173
  msgid "Your backup has been restored."
3174
  msgstr ""
3175
 
3176
+ #: src/admin.php:2611
3177
  msgid "Your PHP memory limit (set by your web hosting company) is very low. UpdraftPlus attempted to raise it but was unsuccessful. This plugin may struggle with a memory limit of less than 64 Mb - especially if you have very large files uploaded (though on the other hand, many sites will be successful with a 32Mb limit - your experience may vary)."
3178
  msgstr ""
3179
 
3180
+ #: src/admin.php:2611
3181
  msgid "Current limit is:"
3182
  msgstr ""
3183
 
3184
+ #: src/admin.php:2672
3185
  msgid "Backup Contents And Schedule"
3186
  msgstr ""
3187
 
3188
+ #: src/admin.php:2771
3189
  msgid "Backup / Restore"
3190
  msgstr ""
3191
 
3192
+ #: src/admin.php:2775
3193
  msgid "Premium / Extensions"
3194
  msgstr ""
3195
 
3196
+ #: src/admin.php:2812
3197
  msgid "%s minutes, %s seconds"
3198
  msgstr ""
3199
 
3200
+ #: src/admin.php:2814
3201
  msgid "Unfinished restoration"
3202
  msgstr ""
3203
 
3204
+ #: src/admin.php:2815
3205
  msgid "You have an unfinished restoration operation, begun %s ago."
3206
  msgstr ""
3207
 
3208
+ #: src/admin.php:2821
3209
  msgid "Continue restoration"
3210
  msgstr ""
3211
 
3212
+ #: src/admin.php:2822, src/templates/wp-admin/notices/autobackup-notice.php:16, src/templates/wp-admin/notices/autobackup-notice.php:18, src/templates/wp-admin/notices/horizontal-notice.php:16, src/templates/wp-admin/notices/horizontal-notice.php:18
3213
  msgid "Dismiss"
3214
  msgstr ""
3215
 
3216
+ #: src/admin.php:2843
3217
  msgid "Not yet got an account (it's free)? Go get one!"
3218
  msgstr ""
3219
 
3220
+ #: src/admin.php:2854
3221
  msgid "Interested in knowing about your UpdraftPlus.Com password security? Read about it here."
3222
  msgstr ""
3223
 
3224
+ #: src/admin.php:2866, src/includes/class-commands.php:905, src/includes/class-commands.php:953, src/templates/wp-admin/settings/temporary-clone.php:83, src/templates/wp-admin/settings/updraftcentral-connect.php:71
3225
  msgid "Processing"
3226
  msgstr ""
3227
 
3228
+ #: src/admin.php:2909
3229
  msgid "Connect with your UpdraftPlus.Com account"
3230
  msgstr ""
3231
 
3232
+ #: src/admin.php:2915, src/templates/wp-admin/settings/form-contents.php:255, src/templates/wp-admin/settings/updraftcentral-connect.php:44
3233
  msgid "Email"
3234
  msgstr ""
3235
 
3236
+ #: src/admin.php:2930
3237
  msgid "Forgotten your details?"
3238
  msgstr ""
3239
 
3240
+ #: src/admin.php:2942
3241
  msgid "Ask WordPress to update UpdraftPlus automatically when an update is available"
3242
  msgstr ""
3243
 
3244
+ #: src/admin.php:2953
3245
  msgid "Add this website to UpdraftCentral (remote, centralised control) - free for up to 5 sites."
3246
  msgstr ""
3247
 
3248
+ #: src/admin.php:2953
3249
  msgid "Learn more about UpdraftCentral"
3250
  msgstr ""
3251
 
3252
+ #: src/admin.php:2979, src/templates/wp-admin/settings/updraftcentral-connect.php:56
3253
  msgid "One Time Password (check your OTP app to get this password)"
3254
  msgstr ""
3255
 
3256
+ #: src/admin.php:3049
3257
  msgid "Latest UpdraftPlus.com news:"
3258
  msgstr ""
3259
 
3260
+ #: src/admin.php:3076
3261
  msgid "Download most recently modified log file"
3262
  msgstr ""
3263
 
3264
+ #: src/admin.php:3119
3265
  msgid "Your WordPress install has old directories from its state before you restored/migrated (technical information: these are suffixed with -old). You should press this button to delete them as soon as you have verified that the restoration worked."
3266
  msgstr ""
3267
 
3268
+ #: src/admin.php:3184, src/admin.php:4256
3269
  msgid "View Log"
3270
  msgstr ""
3271
 
3272
+ #: src/admin.php:3223
3273
  msgid "Backup begun"
3274
  msgstr ""
3275
 
3276
+ #: src/admin.php:3228
3277
  msgid "Creating file backup zips"
3278
  msgstr ""
3279
 
3280
+ #: src/admin.php:3241
3281
  msgid "Created file backup zips"
3282
  msgstr ""
3283
 
3284
+ #: src/admin.php:3246
3285
  msgid "Clone server being provisioned and booted (can take several minutes)"
3286
  msgstr ""
3287
 
3288
+ #: src/admin.php:3250
3289
  msgid "Uploading files to remote storage"
3290
  msgstr ""
3291
 
3292
+ #: src/admin.php:3251
3293
  msgid "Sending files to remote site"
3294
  msgstr ""
3295
 
3296
+ #: src/admin.php:3258
3297
  msgid "(%s%%, file %s of %s)"
3298
  msgstr ""
3299
 
3300
+ #: src/admin.php:3263
3301
  msgid "Pruning old backup sets"
3302
  msgstr ""
3303
 
3304
+ #: src/admin.php:3267
3305
  msgid "Waiting until scheduled time to retry because of errors"
3306
  msgstr ""
3307
 
3308
+ #: src/admin.php:3272
3309
  msgid "Backup finished"
3310
  msgstr ""
3311
 
3312
+ #: src/admin.php:3285
3313
  msgid "Created database backup"
3314
  msgstr ""
3315
 
3316
+ #: src/admin.php:3296
3317
  msgid "Creating database backup"
3318
  msgstr ""
3319
 
3320
+ #: src/admin.php:3298
3321
  msgid "table: %s"
3322
  msgstr ""
3323
 
3324
+ #: src/admin.php:3311
3325
  msgid "Encrypting database"
3326
  msgstr ""
3327
 
3328
+ #: src/admin.php:3319
3329
  msgid "Encrypted database"
3330
  msgstr ""
3331
 
3332
+ #: src/admin.php:3321, src/central/bootstrap.php:444, src/central/bootstrap.php:451, src/methods/updraftvault.php:431, src/methods/updraftvault.php:477, src/methods/updraftvault.php:562
3333
  msgid "Unknown"
3334
  msgstr ""
3335
 
3336
+ #: src/admin.php:3338
3337
  msgid "next resumption: %d (after %ss)"
3338
  msgstr ""
3339
 
3340
+ #: src/admin.php:3339
3341
  msgid "last activity: %ss ago"
3342
  msgstr ""
3343
 
3344
+ #: src/admin.php:3359
3345
  msgid "Job ID: %s"
3346
  msgstr ""
3347
 
3348
+ #: src/admin.php:3373, src/admin.php:3663
3349
  msgid "Warning: %s"
3350
  msgstr ""
3351
 
3352
+ #: src/admin.php:3393
3353
  msgid "show log"
3354
  msgstr ""
3355
 
3356
+ #: src/admin.php:3394
3357
  msgid "Note: the progress bar below is based on stages, NOT time. Do not stop the backup simply because it seems to have remained in the same place for a while - that is normal."
3358
  msgstr ""
3359
 
3360
+ #: src/admin.php:3394
3361
  msgid "stop"
3362
  msgstr ""
3363
 
3364
+ #: src/admin.php:3404, src/admin.php:3404
3365
  msgid "Remove old directories"
3366
  msgstr ""
3367
 
3368
+ #: src/admin.php:3407
3369
  msgid "Old directories successfully removed."
3370
  msgstr ""
3371
 
3372
+ #: src/admin.php:3409
3373
  msgid "Old directory removal failed for some reason. You may want to do this manually."
3374
  msgstr ""
3375
 
3376
+ #: src/admin.php:3446, src/admin.php:3481, src/admin.php:3485, src/includes/class-remote-send.php:407, src/includes/class-storage-methods-interface.php:315, src/restorer.php:330, src/restorer.php:3176, src/restorer.php:3281
3377
  msgid "OK"
3378
  msgstr ""
3379
 
3380
+ #: src/admin.php:3530
3381
  msgid "The request to the filesystem to create the directory failed."
3382
  msgstr ""
3383
 
3384
+ #: src/admin.php:3544
3385
  msgid "The folder was created, but we had to change its file permissions to 777 (world-writable) to be able to write to it. You should check with your hosting provider that this will not cause any problems"
3386
  msgstr ""
3387
 
3388
+ #: src/admin.php:3549
3389
  msgid "The folder exists, but your webserver does not have permission to write to it."
3390
  msgstr ""
3391
 
3392
+ #: src/admin.php:3549
3393
  msgid "You will need to consult with your web hosting provider to find out how to set permissions for a WordPress plugin to write to the directory."
3394
  msgstr ""
3395
 
3396
+ #: src/admin.php:3651
3397
  msgid "incremental backup; base backup: %s"
3398
  msgstr ""
3399
 
3400
+ #: src/admin.php:3681
3401
  msgid "No backup has been completed"
3402
  msgstr ""
3403
 
3404
+ #: src/admin.php:3695
3405
  msgctxt "i.e. Non-automatic"
3406
  msgid "Manual"
3407
  msgstr ""
3408
 
3409
+ #: src/admin.php:3708
3410
  msgid "Backup directory specified is writable, which is good."
3411
  msgstr ""
3412
 
3413
+ #: src/admin.php:3712
3414
  msgid "Backup directory specified does <b>not</b> exist."
3415
  msgstr ""
3416
 
3417
+ #: src/admin.php:3714
3418
  msgid "Backup directory specified exists, but is <b>not</b> writable."
3419
  msgstr ""
3420
 
3421
+ #: src/admin.php:3716
3422
  msgid "Follow this link to attempt to create the directory and set the permissions"
3423
  msgstr ""
3424
 
3425
+ #: src/admin.php:3716
3426
  msgid "or, to reset this option"
3427
  msgstr ""
3428
 
3429
+ #: src/admin.php:3716
3430
  msgid "press here"
3431
  msgstr ""
3432
 
3433
+ #: src/admin.php:3716
3434
  msgid "If that is unsuccessful check the permissions on your server or change it to another directory that is writable by your web server process."
3435
  msgstr ""
3436
 
3437
+ #: src/admin.php:3796
3438
  msgid "Your wp-content directory server path: %s"
3439
  msgstr ""
3440
 
3441
+ #: src/admin.php:3796
3442
  msgid "Any other directories found inside wp-content"
3443
  msgstr ""
3444
 
3445
+ #: src/admin.php:3807
3446
  msgid "Exclude these from"
3447
  msgstr ""
3448
 
3449
+ #: src/admin.php:3895
3450
  msgid "Your web server's PHP/Curl installation does not support https access. Communications with %s will be unencrypted. Ask your web host to install Curl/SSL in order to gain the ability for encryption (via an add-on)."
3451
  msgstr ""
3452
 
3453
+ #: src/admin.php:3897
3454
  msgid "Your web server's PHP/Curl installation does not support https access. We cannot access %s without this support. Please contact your web hosting provider's support. %s <strong>requires</strong> Curl+https. Please do not file any support requests; there is no alternative."
3455
  msgstr ""
3456
 
3457
+ #: src/admin.php:3900
3458
  msgid "Good news: Your site's communications with %s can be encrypted. If you see any errors to do with encryption, then look in the 'Expert Settings' for more help."
3459
  msgstr ""
3460
 
3461
+ #: src/admin.php:3938, src/templates/wp-admin/settings/backupnow-modal.php:60, src/templates/wp-admin/settings/existing-backups-table.php:71, src/templates/wp-admin/settings/existing-backups-table.php:74
3462
  msgid "Only allow this backup to be deleted manually (i.e. keep it even if retention limits are hit)."
3463
  msgstr ""
3464
 
3465
+ #: src/admin.php:3986
3466
  msgid "Total backup size:"
3467
  msgstr ""
3468
 
3469
+ #: src/admin.php:4052, src/includes/class-wpadmin-commands.php:162, src/restorer.php:2186
3470
  msgid "Backup created by unknown source (%s) - cannot be restored."
3471
  msgstr ""
3472
 
3473
+ #: src/admin.php:4081
3474
  msgid "Press here to download or browse"
3475
  msgstr ""
3476
 
3477
+ #: src/admin.php:4086
3478
  msgid "(%d archive(s) in set)."
3479
  msgstr ""
3480
 
3481
+ #: src/admin.php:4089
3482
  msgid "You appear to be missing one or more archives from this multi-archive set."
3483
  msgstr ""
3484
 
3485
+ #: src/admin.php:4117, src/admin.php:4119
3486
  msgid "(Not finished)"
3487
  msgstr ""
3488
 
3489
+ #: src/admin.php:4119
3490
  msgid "If you are seeing more backups than you expect, then it is probably because the deletion of old backup sets does not happen until a fresh backup completes."
3491
  msgstr ""
3492
 
3493
+ #: src/admin.php:4144
3494
  msgid "(backup set imported from remote location)"
3495
  msgstr ""
3496
 
3497
+ #: src/admin.php:4147
3498
  msgid "After pressing this button, you will be given the option to choose which components you wish to restore"
3499
  msgstr ""
3500
 
3501
+ #: src/admin.php:4226
3502
  msgid "After pressing this button, you can select where to upload your backup from a list of your currently saved remote storage locations"
3503
  msgstr ""
3504
 
3505
+ #: src/admin.php:4246
3506
  msgid "Delete this backup set"
3507
  msgstr ""
3508
 
3509
+ #: src/admin.php:4429, src/admin.php:4437
3510
  msgid "Sufficient information about the in-progress restoration operation could not be found."
3511
  msgstr ""
3512
 
3513
+ #: src/admin.php:4516
3514
+ msgid "Starting restore job:"
3515
+ msgstr ""
3516
+
3517
+ #: src/admin.php:4592
3518
  msgid "This backup does not exist in the backup history - restoration aborted. Timestamp:"
3519
  msgstr ""
3520
 
3521
+ #: src/admin.php:4593
3522
  msgid "Backup does not exist in the backup history"
3523
  msgstr ""
3524
 
3525
+ #: src/admin.php:4621
3526
  msgid "ABORT: Could not find the information on which entities to restore."
3527
  msgstr ""
3528
 
3529
+ #: src/admin.php:4621
3530
  msgid "If making a request for support, please include this information:"
3531
  msgstr ""
3532
 
3533
+ #: src/admin.php:4786
3534
  msgid "Backup won't be sent to any remote storage - none has been saved in the %s"
3535
  msgstr ""
3536
 
3537
+ #: src/admin.php:4786
3538
  msgid "settings"
3539
  msgstr ""
3540
 
3541
+ #: src/admin.php:4786
3542
  msgid "Not got any remote storage?"
3543
  msgstr ""
3544
 
3545
+ #: src/admin.php:4786
3546
  msgid "Check out UpdraftPlus Vault."
3547
  msgstr ""
3548
 
3549
+ #: src/admin.php:4788
3550
  msgid "Send this backup to remote storage"
3551
  msgstr ""
3552
 
3553
+ #: src/admin.php:4878
3554
  msgid "UpdraftPlus seems to have been updated to version (%s), which is different to the version running when this settings page was loaded. Please reload the settings page before trying to save settings."
3555
  msgstr ""
3556
 
3557
+ #: src/admin.php:4885, src/templates/wp-admin/settings/take-backup.php:51
3558
  msgid "This button is disabled because your backup directory is not writable (see the settings)."
3559
  msgstr ""
3560
 
3561
+ #: src/admin.php:4914
3562
  msgid "Your settings have been saved."
3563
  msgstr ""
3564
 
3565
+ #: src/admin.php:4919
3566
  msgid "Your settings failed to save. Please refresh the settings page and try again"
3567
  msgstr ""
3568
 
3569
+ #: src/admin.php:4967
3570
  msgid "authentication error"
3571
  msgstr ""
3572
 
3573
+ #: src/admin.php:4971
3574
  msgid "Remote storage method and instance id are required for authentication."
3575
  msgstr ""
3576
 
3577
+ #: src/admin.php:5038
3578
  msgid "Your settings have been wiped."
3579
  msgstr ""
3580
 
3581
+ #: src/admin.php:5139
3582
  msgid "Known backups (raw)"
3583
  msgstr ""
3584
 
3585
+ #: src/admin.php:5174
3586
  msgid "Options (raw)"
3587
  msgstr ""
3588
 
3589
+ #: src/admin.php:5177
3590
  msgid "Value"
3591
  msgstr ""
3592
 
3593
+ #: src/admin.php:5329
3594
  msgid "The file %s has a \"byte order mark\" (BOM) at its beginning."
3595
  msgid_plural "The files %s have a \"byte order mark\" (BOM) at their beginning."
3596
  msgstr[0] ""
3597
  msgstr[1] ""
3598
 
3599
+ #: src/admin.php:5329, src/methods/openstack2.php:144, src/restorer.php:183, src/restorer.php:185, src/templates/wp-admin/settings/downloading-and-restoring.php:27, src/templates/wp-admin/settings/tab-backups.php:27, src/templates/wp-admin/settings/updraftcentral-connect.php:14
3600
  msgid "Follow this link for more information"
3601
  msgstr ""
3602
 
3603
+ #: src/admin.php:5353, src/admin.php:5357, src/templates/wp-admin/advanced/site-info.php:45, src/templates/wp-admin/advanced/site-info.php:51, src/templates/wp-admin/advanced/site-info.php:58, src/templates/wp-admin/advanced/site-info.php:59
3604
  msgid "%s version:"
3605
  msgstr ""
3606
 
3607
+ #: src/admin.php:5361
3608
  msgid "Clone region:"
3609
  msgstr ""
3610
 
3611
+ #: src/admin.php:5376
3612
  msgid "Forbid non-administrators to login to WordPress on your clone"
3613
  msgstr ""
3614
 
3615
+ #: src/admin.php:5399
3616
  msgid "(current version)"
3617
  msgstr ""
3618
 
3619
+ #: src/admin.php:5419
3620
  msgid "Your clone has started and will be available at the following URLs once it is ready."
3621
  msgstr ""
3622
 
3623
+ #: src/admin.php:5420
3624
  msgid "Front page:"
3625
  msgstr ""
3626
 
3627
+ #: src/admin.php:5421
3628
  msgid "Dashboard:"
3629
  msgstr ""
3630
 
3631
+ #: src/admin.php:5423, src/admin.php:5426
3632
  msgid "You can find your temporary clone information in your updraftplus.com account here."
3633
  msgstr ""
3634
 
3635
+ #: src/admin.php:5425
3636
  msgid "Your clone has started, network information is not yet available but will be displayed here and at your updraftplus.com account once it is ready."
3637
  msgstr ""
3638
 
3639
+ #: src/admin.php:5491, src/admin.php:5493
3640
  msgid "You have requested saving to remote storage (%s), but without entering any settings for that storage."
3641
  msgstr ""
3642
 
3812
  msgid "A key was created, but the attempt to register it with %s was unsuccessful - please try again later."
3813
  msgstr ""
3814
 
3815
+ #: src/central/bootstrap.php:403, src/includes/class-remote-send.php:517
3816
  msgid "Key created successfully."
3817
  msgstr ""
3818
 
4108
  msgid "Could not save backup history because we have no backup array. Backup probably failed."
4109
  msgstr ""
4110
 
4111
+ #: src/class-updraftplus.php:4138, src/includes/class-updraftplus-encryption.php:336, src/restorer.php:936
4112
  msgid "Decryption failed. The database file is encrypted, but you have no encryption key entered."
4113
  msgstr ""
4114
 
4116
  msgid "Decryption failed. The database file is encrypted."
4117
  msgstr ""
4118
 
4119
+ #: src/class-updraftplus.php:4150, src/includes/class-updraftplus-encryption.php:354, src/restorer.php:949
4120
  msgid "Decryption failed. The most likely cause is that you used the wrong key."
4121
  msgstr ""
4122
 
4160
  msgid "You can search and replace your database (for migrating a website to a new location/URL) with the Migrator add-on - follow this link for more information"
4161
  msgstr ""
4162
 
4163
+ #: src/class-updraftplus.php:4260, src/restorer.php:1623
4164
  msgid "You are using the %s webserver, but do not seem to have the %s module loaded."
4165
  msgstr ""
4166
 
4167
+ #: src/class-updraftplus.php:4260, src/restorer.php:1623
4168
  msgid "You should enable %s to make any pretty permalinks (e.g. %s) work"
4169
  msgstr ""
4170
 
4192
  msgid "Any support requests to do with %s should be raised with your web hosting company."
4193
  msgstr ""
4194
 
4195
+ #: src/class-updraftplus.php:4294, src/restorer.php:2441, src/restorer.php:2530, src/restorer.php:2556
4196
  msgid "Old table prefix:"
4197
  msgstr ""
4198
 
4200
  msgid "Backup label:"
4201
  msgstr ""
4202
 
4203
+ #: src/class-updraftplus.php:4305, src/class-updraftplus.php:4308, src/restorer.php:650
4204
  msgid "You are running on WordPress multisite - but your backup is not of a multisite site."
4205
  msgstr ""
4206
 
4212
  msgid "Please read this link for important information on this process."
4213
  msgstr ""
4214
 
4215
+ #: src/class-updraftplus.php:4312, src/restorer.php:2453
4216
  msgid "To import an ordinary WordPress site into a multisite installation requires %s."
4217
  msgstr ""
4218
 
4224
  msgid "If you want to restore a multisite backup, you should first set up your WordPress installation as a multisite."
4225
  msgstr ""
4226
 
4227
+ #: src/class-updraftplus.php:4323, src/restorer.php:2459
4228
  msgid "Site information:"
4229
  msgstr ""
4230
 
4320
  msgid "The creation of your data for creating the clone should now begin. N.B. You will be charged one token once the clone is ready. If the clone fails to boot, then no token will be taken."
4321
  msgstr ""
4322
 
4323
+ #: src/includes/class-filesystem-functions.php:99, src/templates/wp-admin/advanced/site-info.php:38
4324
  msgid "refresh"
4325
  msgstr ""
4326
 
4327
+ #: src/includes/class-filesystem-functions.php:106
4328
  msgid "calculate"
4329
  msgstr ""
4330
 
4331
+ #: src/includes/class-filesystem-functions.php:120
4332
  msgid "This is a count of the contents of your Updraft directory"
4333
  msgstr ""
4334
 
4335
+ #: src/includes/class-filesystem-functions.php:120, src/templates/wp-admin/advanced/site-info.php:38
4336
  msgid "Web-server disk space in use by UpdraftPlus"
4337
  msgstr ""
4338
 
4339
+ #: src/includes/class-filesystem-functions.php:279, src/methods/ftp.php:335
4340
  msgid "Your web server's PHP installation has these functions disabled: %s."
4341
  msgstr ""
4342
 
4343
+ #: src/includes/class-filesystem-functions.php:279, src/methods/ftp.php:335, src/restorer.php:2217
4344
  msgid "Your hosting company must enable these functions before %s can work."
4345
  msgstr ""
4346
 
4347
+ #: src/includes/class-filesystem-functions.php:279, src/restorer.php:2217
4348
  msgid "restoration"
4349
  msgstr ""
4350
 
4351
+ #: src/includes/class-filesystem-functions.php:299
4352
  msgid "The database file appears to have been compressed twice - probably the website you downloaded it from had a mis-configured webserver."
4353
  msgstr ""
4354
 
4355
+ #: src/includes/class-filesystem-functions.php:306, src/includes/class-filesystem-functions.php:328
4356
  msgid "The attempt to undo the double-compression failed."
4357
  msgstr ""
4358
 
4359
+ #: src/includes/class-filesystem-functions.php:330
4360
  msgid "The attempt to undo the double-compression succeeded."
4361
  msgstr ""
4362
 
4363
+ #: src/includes/class-filesystem-functions.php:528
4364
  msgid "Unzip progress: %d out of %d files"
4365
  msgstr ""
4366
 
4367
+ #: src/includes/class-remote-send.php:292
4368
  msgid "Backup data will be sent to:"
4369
  msgstr ""
4370
 
4371
+ #: src/includes/class-remote-send.php:325
4372
  msgid "site not found"
4373
  msgstr ""
4374
 
4375
+ #: src/includes/class-remote-send.php:391
4376
  msgid "The site URL you are sending to (%s) looks like a local development website. If you are sending from an external network, it is likely that a firewall will be blocking this."
4377
  msgstr ""
4378
 
4379
+ #: src/includes/class-remote-send.php:395
4380
  msgid "If sending directly from site to site does not work for you, then there are three other methods - please try one of these instead."
4381
  msgstr ""
4382
 
4383
+ #: src/includes/class-remote-send.php:425
4384
  msgid "Also send this backup to the active remote storage locations"
4385
  msgstr ""
4386
 
4387
+ #: src/includes/class-remote-send.php:500
4388
  msgid "A key with this name already exists; you must use a unique name."
4389
  msgstr ""
4390
 
4391
+ #: src/includes/class-remote-send.php:517
4392
  msgid "You must copy and paste this key on the sending site now - it cannot be shown again."
4393
  msgstr ""
4394
 
4395
+ #: src/includes/class-remote-send.php:527
4396
  msgid "The setting %s is turned on in your PHP settings. It is deprecated, causes encryption to malfunction, and should be turned off."
4397
  msgstr ""
4398
 
4399
+ #: src/includes/class-remote-send.php:542
4400
  msgid "key"
4401
  msgstr ""
4402
 
4403
+ #: src/includes/class-remote-send.php:557
4404
  msgid "The entered key was the wrong length - please try again."
4405
  msgstr ""
4406
 
4407
+ #: src/includes/class-remote-send.php:559, src/includes/class-remote-send.php:561, src/includes/class-remote-send.php:565
4408
  msgid "The entered key was corrupt - please try again."
4409
  msgstr ""
4410
 
4411
+ #: src/includes/class-remote-send.php:570
4412
  msgid "The entered key does not belong to a remote site (it belongs to this one)."
4413
  msgstr ""
4414
 
4415
+ #: src/includes/class-remote-send.php:594
4416
  msgid "The key was successfully added."
4417
  msgstr ""
4418
 
4419
+ #: src/includes/class-remote-send.php:594
4420
  msgid "It is for sending backups to the following site: "
4421
  msgstr ""
4422
 
4423
+ #: src/includes/class-remote-send.php:614
4424
  msgid "No receiving sites have yet been added."
4425
  msgstr ""
4426
 
4427
+ #: src/includes/class-remote-send.php:634
4428
  msgid "No keys to allow remote sites to send backup data here have yet been created."
4429
  msgstr ""
4430
 
4431
+ #: src/includes/class-remote-send.php:643
4432
  msgid "Existing keys"
4433
  msgstr ""
4434
 
4492
  msgid "The backup archive files have been processed, but with some errors. You will need to cancel and correct any problems before retrying."
4493
  msgstr ""
4494
 
4495
+ #: src/includes/class-wpadmin-commands.php:363
4496
  msgid "Constants"
4497
  msgstr ""
4498
 
4499
+ #: src/includes/class-wpadmin-commands.php:555
4500
  msgid "Extra database"
4501
  msgstr ""
4502
 
4503
+ #: src/includes/class-wpadmin-commands.php:564
4504
  msgid "archive"
4505
  msgstr ""
4506
 
4604
  msgid "Allow only administrators to log in"
4605
  msgstr ""
4606
 
4607
+ #: src/includes/updraftplus-clone.php:107
4608
+ msgid "Clone of %s"
4609
+ msgstr ""
4610
+
4611
  #: src/includes/updraftplus-login.php:57, src/methods/updraftvault.php:715, src/udaddons/updraftplus-addons.php:991
4612
  msgid "UpdraftPlus.Com returned a response which we could not understand (data: %s)"
4613
  msgstr ""
5809
  msgid "Error message"
5810
  msgstr ""
5811
 
5812
+ #: src/restorer.php:635
5813
  msgid "UpdraftPlus is not able to directly restore this kind of entity. It must be restored manually."
5814
  msgstr ""
5815
 
5816
+ #: src/restorer.php:636
5817
  msgid "Backup file not available."
5818
  msgstr ""
5819
 
5820
+ #: src/restorer.php:637
5821
  msgid "Copying this entity failed."
5822
  msgstr ""
5823
 
5824
+ #: src/restorer.php:638
5825
  msgid "Unpacking backup..."
5826
  msgstr ""
5827
 
5828
+ #: src/restorer.php:639
5829
  msgid "Decrypting database (can take a while)..."
5830
  msgstr ""
5831
 
5832
+ #: src/restorer.php:640
5833
  msgid "Database successfully decrypted."
5834
  msgstr ""
5835
 
5836
+ #: src/restorer.php:641
5837
  msgid "Moving old data out of the way..."
5838
  msgstr ""
5839
 
5840
+ #: src/restorer.php:642
5841
  msgid "Moving unpacked backup into place..."
5842
  msgstr ""
5843
 
5844
+ #: src/restorer.php:643
5845
  msgid "Restoring the database (on a large site this can take a long time - if it times out (which can happen if your web hosting company has configured your hosting to limit resources) then you should use a different method, such as phpMyAdmin)..."
5846
  msgstr ""
5847
 
5848
+ #: src/restorer.php:644
5849
  msgid "Cleaning up rubbish..."
5850
  msgstr ""
5851
 
5852
+ #: src/restorer.php:645
5853
  msgid "Could not move old files out of the way."
5854
  msgstr ""
5855
 
5856
+ #: src/restorer.php:645
5857
  msgid "You should check the file ownerships and permissions in your WordPress installation"
5858
  msgstr ""
5859
 
5860
+ #: src/restorer.php:646
5861
  msgid "Could not delete old directory."
5862
  msgstr ""
5863
 
5864
+ #: src/restorer.php:647
5865
  msgid "Could not move new files into place. Check your wp-content/upgrade folder."
5866
  msgstr ""
5867
 
5868
+ #: src/restorer.php:648
5869
  msgid "Could not move the files into place. Check your file permissions."
5870
  msgstr ""
5871
 
5872
+ #: src/restorer.php:649
5873
  msgid "Failed to delete working directory after restoring."
5874
  msgstr ""
5875
 
5876
+ #: src/restorer.php:651
5877
  msgid "Failed to unpack the archive"
5878
  msgstr ""
5879
 
5880
+ #: src/restorer.php:652
5881
  msgid "Failed to read the manifest file from backup."
5882
  msgstr ""
5883
 
5884
+ #: src/restorer.php:653
5885
  msgid "Failed to find a manifest file in the backup."
5886
  msgstr ""
5887
 
5888
+ #: src/restorer.php:654
5889
  msgid "Failed to read from the working directory."
5890
  msgstr ""
5891
 
5892
+ #: src/restorer.php:928
5893
  msgid "Failed to create a temporary directory"
5894
  msgstr ""
5895
 
5896
+ #: src/restorer.php:944
5897
  msgid "Failed to write out the decrypted database to the filesystem"
5898
  msgstr ""
5899
 
5900
+ #: src/restorer.php:1022
5901
  msgid "The directory does not exist, and the attempt to create it failed"
5902
  msgstr ""
5903
 
5904
+ #: src/restorer.php:1025
5905
  msgid "The directory does not exist"
5906
  msgstr ""
5907
 
5908
+ #: src/restorer.php:1066
5909
  msgid "wp-config.php from backup: will restore as wp-config-backup.php"
5910
  msgstr ""
5911
 
5912
+ #: src/restorer.php:1073
5913
  msgid "wp-config.php from backup: restoring (as per user's request)"
5914
  msgstr ""
5915
 
5916
+ #: src/restorer.php:1256, src/restorer.php:1264
5917
  msgid "UpdraftPlus needed to create a %s in your content directory, but failed - please check your file permissions and enable the access (%s)"
5918
  msgstr ""
5919
 
5920
+ #: src/restorer.php:1264
5921
  msgid "file"
5922
  msgstr ""
5923
 
5924
+ #: src/restorer.php:1279
5925
  msgid "Existing unremoved folders from a previous restore exist (please use the \"Delete Old Directories\" button to delete them before trying again): %s"
5926
  msgstr ""
5927
 
5928
+ #: src/restorer.php:1286
5929
  msgid "This version of UpdraftPlus does not know how to handle this type of foreign backup"
5930
  msgstr ""
5931
 
5932
+ #: src/restorer.php:1393
5933
  msgid "Deferring..."
5934
  msgstr ""
5935
 
5936
+ #: src/restorer.php:1436, src/restorer.php:1484
5937
  msgid "The WordPress content folder (wp-content) was not found in this zip file."
5938
  msgstr ""
5939
 
5940
+ #: src/restorer.php:1577
5941
  msgid "Files found:"
5942
  msgstr ""
5943
 
5944
+ #: src/restorer.php:2106
5945
  msgid "Please supply the requested information, and then continue."
5946
  msgstr ""
5947
 
5948
+ #: src/restorer.php:2179
5949
  msgid "Warning: PHP safe_mode is active on your server. Timeouts are much more likely. If these happen, then you will need to manually restore the file via phpMyAdmin or another method."
5950
  msgstr ""
5951
 
5952
+ #: src/restorer.php:2202
5953
  msgid "Failed to find database file"
5954
  msgstr ""
5955
 
5956
+ #: src/restorer.php:2223
5957
  msgid "Failed to open database file"
5958
  msgstr ""
5959
 
5960
+ #: src/restorer.php:2318, src/restorer.php:2360
5961
  msgid "Your database user does not have permission to drop tables"
5962
  msgstr ""
5963
 
5964
+ #: src/restorer.php:2321
5965
  msgid "Your database user does not have permission to create tables. We will attempt to restore by simply emptying the tables; this should work as long as a) you are restoring from a WordPress version with the same database structure, and b) Your imported database does not contain any tables which are not already present on the importing site."
5966
  msgstr ""
5967
 
5968
+ #: src/restorer.php:2365
5969
  msgid "Your database user does not have permission to drop tables. We will attempt to restore by simply emptying the tables; this should work as long as you are restoring from a WordPress version with the same database structure (%s)"
5970
  msgstr ""
5971
 
5972
+ #: src/restorer.php:2411
5973
  msgid "Backup of: %s"
5974
  msgstr ""
5975
 
5976
+ #: src/restorer.php:2418
5977
  msgid "Backup created by:"
5978
  msgstr ""
5979
 
5980
+ #: src/restorer.php:2423
5981
  msgid "Site home:"
5982
  msgstr ""
5983
 
5984
+ #: src/restorer.php:2429
5985
  msgid "Content URL:"
5986
  msgstr ""
5987
 
5988
+ #: src/restorer.php:2434
5989
  msgid "Uploads URL:"
5990
  msgstr ""
5991
 
5992
+ #: src/restorer.php:2445
5993
  msgid "Skipped tables:"
5994
  msgstr ""
5995
 
5996
+ #: src/restorer.php:2485
5997
  msgid "Split line to avoid exceeding maximum packet size"
5998
  msgstr ""
5999
 
6000
+ #: src/restorer.php:2510, src/restorer.php:2985, src/restorer.php:3032, src/restorer.php:3045
6001
  msgid "An error occurred on the first %s command - aborting run"
6002
  msgstr ""
6003
 
6004
+ #: src/restorer.php:2611
6005
  msgid "Requested table engine (%s) is not present - changing to MyISAM."
6006
  msgstr ""
6007
 
6008
+ #: src/restorer.php:2624
6009
  msgid "Requested table character set (%s) is not present - changing to %s."
6010
  msgstr ""
6011
 
6012
+ #: src/restorer.php:2674
6013
  msgid "Requested table collation (%1$s) is not present - changing to %2$s."
6014
  msgid_plural "Requested table collations (%1$s) are not present - changing to %2$s."
6015
  msgstr[0] ""
6016
  msgstr[1] ""
6017
 
6018
+ #: src/restorer.php:2676
6019
  msgid "Processing table (%s)"
6020
  msgstr ""
6021
 
6022
+ #: src/restorer.php:2680
6023
  msgid "will restore as:"
6024
  msgstr ""
6025
 
6026
+ #: src/restorer.php:2719
6027
  msgid "Found SET NAMES %s, but changing to %s as suggested by WPDB::determine_charset()."
6028
  msgstr ""
6029
 
6030
+ #: src/restorer.php:2725
6031
  msgid "Requested character set (%s) is not present - changing to %s."
6032
  msgstr ""
6033
 
6034
+ #: src/restorer.php:2879
6035
  msgid "An SQL line that is larger than the maximum packet size and cannot be split was found; this line will not be processed, but will be dropped: %s"
6036
  msgstr ""
6037
 
6038
+ #: src/restorer.php:3022
6039
  msgctxt "The user is being told the number of times an error has happened, e.g. An error (27) occurred"
6040
  msgid "An error (%s) occurred:"
6041
  msgstr ""
6042
 
6043
+ #: src/restorer.php:3043
6044
  msgid "This problem is caused by trying to restore a database on a very old MySQL version that is incompatible with the source database."
6045
  msgstr ""
6046
 
6047
+ #: src/restorer.php:3043
6048
  msgid "This database needs to be deployed on MySQL version %s or later."
6049
  msgstr ""
6050
 
6051
+ #: src/restorer.php:3045
6052
  msgid "To use this backup, your database server needs to support the %s character set."
6053
  msgstr ""
6054
 
6055
+ #: src/restorer.php:3050
6056
  msgid "Too many database errors have occurred - aborting"
6057
  msgstr ""
6058
 
6059
+ #: src/restorer.php:3170, src/restorer.php:3245
6060
  msgid "Table prefix has changed: changing %s table field(s) accordingly:"
6061
  msgstr ""
6062
 
6400
  msgid "Choose the components to restore"
6401
  msgstr ""
6402
 
6403
+ #: src/templates/wp-admin/settings/delete-and-restore-modals.php:55
6404
  msgid "Your web server has PHP's so-called safe_mode active."
6405
  msgstr ""
6406
 
6407
+ #: src/templates/wp-admin/settings/delete-and-restore-modals.php:55
6408
  msgid "This makes time-outs much more likely. You are recommended to turn safe_mode off, or to restore only one entity at a time"
6409
  msgstr ""
6410
 
6411
+ #: src/templates/wp-admin/settings/delete-and-restore-modals.php:55
6412
  msgid "or to restore manually"
6413
  msgstr ""
6414
 
6415
+ #: src/templates/wp-admin/settings/delete-and-restore-modals.php:69
6416
  msgid "The following entity cannot be restored automatically: \"%s\"."
6417
  msgstr ""
6418
 
6419
+ #: src/templates/wp-admin/settings/delete-and-restore-modals.php:69
6420
  msgid "You will need to restore it manually."
6421
  msgstr ""
6422
 
6423
+ #: src/templates/wp-admin/settings/delete-and-restore-modals.php:84
6424
  msgid "Do read this helpful article of useful things to know before restoring."
6425
  msgstr ""
6426
 
7445
  msgid "If you have already renewed, then you need to allocate a licence to this site - %s"
7446
  msgstr ""
7447
 
7448
+ #: src/udaddons/updraftplus-addons.php:278, src/udaddons/updraftplus-addons.php:290
7449
+ msgid "go here"
7450
+ msgstr ""
7451
+
7452
  #: src/udaddons/updraftplus-addons.php:282
7453
  msgid "Your paid access to UpdraftPlus updates for %s add-ons on this site has expired."
7454
  msgstr ""
methods/backup-module.php CHANGED
@@ -343,7 +343,7 @@ abstract class UpdraftPlus_BackupModule {
343
 
344
  $id = $this->get_id();
345
 
346
- return $methods[$id];
347
  }
348
 
349
  /**
343
 
344
  $id = $this->get_id();
345
 
346
+ return isset($methods[$id]) ? $methods[$id] : $id;
347
  }
348
 
349
  /**
methods/remotesend.php CHANGED
@@ -12,6 +12,8 @@ class UpdraftPlus_Addons_RemoteStorage_remotesend extends UpdraftPlus_RemoteStor
12
 
13
  private $remotesend_chunked_wp_error;
14
 
 
 
15
  /**
16
  * Class constructor
17
  */
@@ -277,30 +279,28 @@ class UpdraftPlus_Addons_RemoteStorage_remotesend extends UpdraftPlus_RemoteStor
277
 
278
  /**
279
  * This function is called via an action and will send a message to the remote site to inform it that the backup has finished sending
280
- *
281
- * @return void
282
  */
283
  public function upload_complete() {
284
  global $updraftplus;
285
 
286
  $service = $updraftplus->jobdata_get('service');
287
- $remote_sent = (!empty($service) && ((is_array($service) && in_array('remotesend', $service)) || 'remotesend' === $service)) ? true : false;
288
 
289
  if (!$remote_sent) return;
290
 
291
- $this->options = $this->get_options();
292
-
293
- if (!$this->options_exist($this->options)) {
294
- $this->log('No '.$this->method.' settings were found');
295
- $this->log(sprintf(__('No %s settings were found', 'updraftplus'), $this->description), 'error');
 
 
 
296
  return false;
297
  }
298
-
299
- $storage = $this->bootstrap();
300
  if (is_wp_error($storage)) return $updraftplus->log_wp_error($storage, false, true);
301
 
302
- $this->set_storage($storage);
303
-
304
  $response = $this->send_message('upload_complete', array('job_id' => $updraftplus->nonce), 30);
305
 
306
  if (is_wp_error($response)) {
@@ -316,6 +316,11 @@ class UpdraftPlus_Addons_RemoteStorage_remotesend extends UpdraftPlus_RemoteStor
316
  }
317
  }
318
 
 
 
 
 
 
319
  private function remotesend_set_new_chunk_size($new_chunk_size) {
320
  global $updraftplus;
321
  $this->remotesend_use_chunk_size = $new_chunk_size;
@@ -326,14 +331,42 @@ class UpdraftPlus_Addons_RemoteStorage_remotesend extends UpdraftPlus_RemoteStor
326
 
327
  private function send_message($message, $data = null, $timeout = 30) {
328
  $storage = $this->get_storage();
 
 
 
 
 
329
  $response = $storage->send_message($message, $data, $timeout);
330
- if (is_array($response) && !empty($response['data']) && is_array($response['data']) && !empty($response['data']['php_events']) && !empty($response['data']['previous_data'])) {
331
- global $updraftplus;
332
- foreach ($response['data']['php_events'] as $logline) {
333
- $this->log("From remote side: ".$logline);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
334
  }
335
- $response['data'] = $response['data']['previous_data'];
336
  }
 
337
  return $response;
338
  }
339
 
@@ -347,9 +380,18 @@ class UpdraftPlus_Addons_RemoteStorage_remotesend extends UpdraftPlus_RemoteStor
347
 
348
  try {
349
  $ud_rpc = new UpdraftPlus_Remote_Communications($opts['name_indicator']);
350
- // Enforce the legacy communications protocol (which is only suitable for when only one side only sends, and the other only receives - which is what we happen to do)
351
- $ud_rpc->set_message_format(1);
352
- $ud_rpc->set_key_local($opts['key']);
 
 
 
 
 
 
 
 
 
353
  $ud_rpc->set_destination_url($opts['url']);
354
  $ud_rpc->activate_replay_protection();
355
  } catch (Exception $e) {
@@ -372,6 +414,7 @@ class UpdraftPlus_Addons_RemoteStorage_remotesend extends UpdraftPlus_RemoteStor
372
  global $updraftplus;
373
  $opts = $updraftplus->jobdata_get('remotesend_info');
374
  $opts = apply_filters('updraftplus_clone_remotesend_options', $opts);
 
375
  return is_array($opts) ? $opts : array();
376
  }
377
 
12
 
13
  private $remotesend_chunked_wp_error;
14
 
15
+ private $try_format_upgrade = false;
16
+
17
  /**
18
  * Class constructor
19
  */
279
 
280
  /**
281
  * This function is called via an action and will send a message to the remote site to inform it that the backup has finished sending
 
 
282
  */
283
  public function upload_complete() {
284
  global $updraftplus;
285
 
286
  $service = $updraftplus->jobdata_get('service');
287
+ $remote_sent = (!empty($service) && ((is_array($service) && in_array('remotesend', $service)) || 'remotesend' === $service));
288
 
289
  if (!$remote_sent) return;
290
 
291
+ try {
292
+ $storage = $this->bootstrap();
293
+ if (is_wp_error($storage)) throw new Exception($storage->get_error_message());
294
+ if (!is_object($storage)) throw new Exception("RPC service error");
295
+ } catch (Exception $e) {
296
+ $message = $e->getMessage().' ('.get_class($e).') (line: '.$e->getLine().', file: '.$e->getFile().')';
297
+ $this->log("RPC service error: ".$message);
298
+ $this->log($message, 'error');
299
  return false;
300
  }
301
+
 
302
  if (is_wp_error($storage)) return $updraftplus->log_wp_error($storage, false, true);
303
 
 
 
304
  $response = $this->send_message('upload_complete', array('job_id' => $updraftplus->nonce), 30);
305
 
306
  if (is_wp_error($response)) {
316
  }
317
  }
318
 
319
+ /**
320
+ * Change the chunk size
321
+ *
322
+ * @param Integer $new_chunk_size - in bytes
323
+ */
324
  private function remotesend_set_new_chunk_size($new_chunk_size) {
325
  global $updraftplus;
326
  $this->remotesend_use_chunk_size = $new_chunk_size;
331
 
332
  private function send_message($message, $data = null, $timeout = 30) {
333
  $storage = $this->get_storage();
334
+
335
+ if (is_array($this->try_format_upgrade) && is_array($data)) {
336
+ $data['sender_public'] = $this->try_format_upgrade['local_public'];
337
+ }
338
+
339
  $response = $storage->send_message($message, $data, $timeout);
340
+
341
+ if (is_array($response) && !empty($response['data']) && is_array($response['data'])) {
342
+
343
+ if (!empty($response['data']['php_events']) && !empty($response['data']['previous_data'])) {
344
+ foreach ($response['data']['php_events'] as $logline) {
345
+ $this->log("From remote side: ".$logline);
346
+ }
347
+ $response['data'] = $response['data']['previous_data'];
348
+ }
349
+
350
+ if (is_array($response) && is_array($response['data']) && !empty($response['data']['got_public'])) {
351
+ $name_indicator = $this->try_format_upgrade['name_indicator'];
352
+
353
+ $remotesites = UpdraftPlus_Options::get_updraft_option('updraft_remotesites');
354
+
355
+ foreach ($remotesites as $key => $site) {
356
+ if (!is_array($site) || empty($site['name_indicator']) || $site['name_indicator'] != $name_indicator) continue;
357
+ // This means 'format 2'
358
+ $this->try_format_upgrade = true;
359
+ $remotesites[$key]['remote_got_public'] = 1;
360
+ // If this DB save fails, they'll have to recreate the key
361
+ UpdraftPlus_Options::update_updraft_option('updraft_remotesites', $remotesites);
362
+ // Now we need to get a fresh storage object, because the remote end will no longer accept messages with format=1
363
+ $this->set_storage(null);
364
+ $this->do_bootstrap(null);
365
+ break;
366
+ }
367
  }
 
368
  }
369
+
370
  return $response;
371
  }
372
 
380
 
381
  try {
382
  $ud_rpc = new UpdraftPlus_Remote_Communications($opts['name_indicator']);
383
+ if (!empty($opts['format_support']) && 2 == $opts['format_support'] && !empty($opts['local_private']) && !empty($opts['local_public']) && !empty($opts['remote_got_public'])) {
384
+ $ud_rpc->set_message_format(2);
385
+ $ud_rpc->set_key_remote($opts['key']);
386
+ $ud_rpc->set_key_local($opts['local_private']);
387
+ } else {
388
+ // Enforce the legacy communications protocol (which is only suitable for when only one side only sends, and the other only receives - which is what we happen to do)
389
+ $ud_rpc->set_message_format(1);
390
+ $ud_rpc->set_key_local($opts['key']);
391
+ if (!empty($opts['format_support']) && 2 == $opts['format_support'] && !empty($opts['local_public']) && !empty($opts['local_private'])) {
392
+ $this->try_format_upgrade = array('name_indicator' => $opts['name_indicator'], 'local_public' => $opts['local_public']);
393
+ }
394
+ }
395
  $ud_rpc->set_destination_url($opts['url']);
396
  $ud_rpc->activate_replay_protection();
397
  } catch (Exception $e) {
414
  global $updraftplus;
415
  $opts = $updraftplus->jobdata_get('remotesend_info');
416
  $opts = apply_filters('updraftplus_clone_remotesend_options', $opts);
417
+ if (true === $this->try_format_upgrade && is_array($opts)) $opts['remote_got_public'] = 1;
418
  return is_array($opts) ? $opts : array();
419
  }
420
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Backup with UpdraftPlus, DavidAnderson, DNutbourne, aporter, snigh
3
  Tags: backup, restore, database backup, wordpress backup, cloud backup, s3, dropbox, google drive, onedrive, ftp, backups
4
  Requires at least: 3.2
5
  Tested up to: 5.2
6
- Stable tag: 1.16.12
7
  Author URI: https://updraftplus.com
8
  Donate link: https://david.dw-perspective.org.uk/donate
9
  License: GPLv3 or later
@@ -166,7 +166,17 @@ Unfortunately not; since this is free software, there’s no warranty and no gua
166
 
167
  The <a href="https://updraftplus.com/news/">UpdraftPlus backup blog</a> is the best place to learn in more detail about any important changes.
168
 
169
- N.B. Paid versions of UpdraftPlus Backup / Restore have a version number which is 1 higher in the first digit, and has an extra component on the end, but the changelog below still applies. i.e. changes listed for 1.16.11.x of the free version correspond to changes made in 2.16.11.x of the paid version.
 
 
 
 
 
 
 
 
 
 
170
 
171
  = 1.16.12 - 16/Apr/2019 =
172
 
@@ -836,4 +846,4 @@ Furthermore, reliance upon any non-English translation is at your own risk. Updr
836
  We recognise and thank the following for code and/or libraries used and/or modified under the terms of their open source licences; see: https://updraftplus.com/acknowledgements/
837
 
838
  == Upgrade Notice ==
839
- * 1.16.12: Fix slowness in Pclzip unzips. A recommended update for all.
3
  Tags: backup, restore, database backup, wordpress backup, cloud backup, s3, dropbox, google drive, onedrive, ftp, backups
4
  Requires at least: 3.2
5
  Tested up to: 5.2
6
+ Stable tag: 1.16.13
7
  Author URI: https://updraftplus.com
8
  Donate link: https://david.dw-perspective.org.uk/donate
9
  License: GPLv3 or later
166
 
167
  The <a href="https://updraftplus.com/news/">UpdraftPlus backup blog</a> is the best place to learn in more detail about any important changes.
168
 
169
+ N.B. Paid versions of UpdraftPlus Backup / Restore have a version number which is 1 higher in the first digit, and has an extra component on the end, but the changelog below still applies. i.e. changes listed for 1.16.12.x of the free version correspond to changes made in 2.16.12.x of the paid version.
170
+
171
+ = 1.16.13 - 29/Apr/2019 =
172
+
173
+ * TWEAK: Add support to translation updates
174
+ * TWEAK: Add WP 5.2 support in UpdraftClone
175
+ * TWEAK: Prevent PHP notice in remotesend method
176
+ * TWEAK: Restorations are now started over AJAX instead of in-page. This is preparing the way for future UX improvements.
177
+ * TWEAK: Upgraded the 'site-to-site' remote sending code to use the more recent UDRPC message format
178
+ * TWEAK: Make the UpdraftClone suggestion sentences dismissible
179
+ * TWEAK: Improve JSON-reparser to cope with even more exotic junk from some setups with problems elsewhere in their stack
180
 
181
  = 1.16.12 - 16/Apr/2019 =
182
 
846
  We recognise and thank the following for code and/or libraries used and/or modified under the terms of their open source licences; see: https://updraftplus.com/acknowledgements/
847
 
848
  == Upgrade Notice ==
849
+ * 1.16.13: Various small tweaks and improvements. A recommended update for all.
restorer.php CHANGED
@@ -585,6 +585,13 @@ class Updraft_Restorer {
585
  global $updraftplus;
586
  static $logfile_handle;
587
  static $opened_log_time;
 
 
 
 
 
 
 
588
 
589
  if (empty($logfile_handle)) {
590
  $logfile_name = $updraftplus->backups_dir_location()."/log.$nonce-browser.txt";
585
  global $updraftplus;
586
  static $logfile_handle;
587
  static $opened_log_time;
588
+ static $last_buffer_flush;
589
+
590
+ // If more than 2 seconds has past then flush the buffer
591
+ if ($last_buffer_flush + 2 < time()) {
592
+ flush();
593
+ $last_buffer_flush = time();
594
+ }
595
 
596
  if (empty($logfile_handle)) {
597
  $logfile_name = $updraftplus->backups_dir_location()."/log.$nonce-browser.txt";
templates/wp-admin/settings/delete-and-restore-modals.php CHANGED
@@ -43,6 +43,7 @@
43
  <form id="updraft_restore_form" method="post">
44
  <fieldset>
45
  <input type="hidden" name="action" value="updraft_restore">
 
46
  <input type="hidden" name="backup_timestamp" value="0" id="updraft_restore_timestamp">
47
  <input type="hidden" name="meta_foreign" value="0" id="updraft_restore_meta_foreign">
48
  <input type="hidden" name="updraft_restorer_backup_info" value="" id="updraft_restorer_backup_info">
43
  <form id="updraft_restore_form" method="post">
44
  <fieldset>
45
  <input type="hidden" name="action" value="updraft_restore">
46
+ <input type="hidden" name="updraftplus_ajax_restore" value="start_ajax_restore">
47
  <input type="hidden" name="backup_timestamp" value="0" id="updraft_restore_timestamp">
48
  <input type="hidden" name="meta_foreign" value="0" id="updraft_restore_meta_foreign">
49
  <input type="hidden" name="updraft_restorer_backup_info" value="" id="updraft_restorer_backup_info">
updraftplus.php CHANGED
@@ -5,7 +5,7 @@ Plugin Name: UpdraftPlus - Backup/Restore
5
  Plugin URI: https://updraftplus.com
6
  Description: Backup and restore: take backups locally, or backup to Amazon S3, Dropbox, Google Drive, Rackspace, (S)FTP, WebDAV & email, on automatic schedules.
7
  Author: UpdraftPlus.Com, DavidAnderson
8
- Version: 1.16.12
9
  Donate link: https://david.dw-perspective.org.uk/donate
10
  License: GPLv3 or later
11
  Text Domain: updraftplus
5
  Plugin URI: https://updraftplus.com
6
  Description: Backup and restore: take backups locally, or backup to Amazon S3, Dropbox, Google Drive, Rackspace, (S)FTP, WebDAV & email, on automatic schedules.
7
  Author: UpdraftPlus.Com, DavidAnderson
8
+ Version: 1.16.13
9
  Donate link: https://david.dw-perspective.org.uk/donate
10
  License: GPLv3 or later
11
  Text Domain: updraftplus
vendor/composer/installed.json CHANGED
@@ -646,8 +646,8 @@
646
  },
647
  {
648
  "name": "symfony/event-dispatcher",
649
- "version": "v2.8.49",
650
- "version_normalized": "2.8.49.0",
651
  "source": {
652
  "type": "git",
653
  "url": "https://github.com/symfony/event-dispatcher.git",
@@ -708,8 +708,8 @@
708
  },
709
  {
710
  "name": "symfony/process",
711
- "version": "v3.4.25",
712
- "version_normalized": "3.4.25.0",
713
  "source": {
714
  "type": "git",
715
  "url": "https://github.com/symfony/process.git",
646
  },
647
  {
648
  "name": "symfony/event-dispatcher",
649
+ "version": "v2.8.50",
650
+ "version_normalized": "2.8.50.0",
651
  "source": {
652
  "type": "git",
653
  "url": "https://github.com/symfony/event-dispatcher.git",
708
  },
709
  {
710
  "name": "symfony/process",
711
+ "version": "v3.4.26",
712
+ "version_normalized": "3.4.26.0",
713
  "source": {
714
  "type": "git",
715
  "url": "https://github.com/symfony/process.git",