Smush Image Compression and Optimization - Version 3.9.5

Version Description

( 2022-01-25 ) =

  • Fix: Translation strings
  • Fix: Remove upsells
  • Enhance: Update admin menu icon
Download this release

Release Info

Developer vanyukov
Plugin Icon 128x128 Smush Image Compression and Optimization
Version 3.9.5
Comparing to
See all releases

Code changes from version 3.9.4 to 3.9.5

_src/js/modules/black-friday.js DELETED
@@ -1,52 +0,0 @@
1
- /* global ajaxurl */
2
-
3
- /**
4
- * External dependencies
5
- */
6
- import React from 'react';
7
- import ReactDOM from 'react-dom';
8
-
9
- /**
10
- * SUI dependencies
11
- */
12
- import { NoticeBlack } from '@wpmudev/shared-notifications-black-friday';
13
-
14
- /**
15
- * WordPress dependencies
16
- */
17
- import domReady from '@wordpress/dom-ready';
18
-
19
- /**
20
- * Hide notice.
21
- *
22
- * @since 3.9.2
23
- */
24
- function hideNotice() {
25
- const xhr = new XMLHttpRequest();
26
- xhr.open('POST', ajaxurl + '?action=smush_hide_black_friday', true);
27
- xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
28
- xhr.send('_ajax_nonce=' + window.wp_smush_msgs.nonce);
29
- }
30
-
31
- /**
32
- * Render the "Black Friday" component.
33
- *
34
- * @since 3.9.2
35
- */
36
- domReady(function () {
37
- const blackFridayDiv = document.getElementById('smush-black-friday');
38
- if (blackFridayDiv) {
39
- ReactDOM.render(
40
- <NoticeBlack link={window.smush_bf.link} onCloseClick={hideNotice}>
41
- <p>
42
- <strong>{window.smush_bf.header}</strong>{' '}
43
- {window.smush_bf.message}
44
- </p>
45
- <p>
46
- <small>{window.smush_bf.notice}</small>
47
- </p>
48
- </NoticeBlack>,
49
- blackFridayDiv
50
- );
51
- }
52
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/assets/js/smush-admin.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){var e={9478:function(){jQuery((function(e){"use strict";e("body").on("click","a.smush-stats-details",(function(t){if(e(this).prop("disabled"))return!1;t.preventDefault();var s=e(this).find(".stats-toggle");e(this).parents().eq(1).find(".smush-stats-wrapper").slideToggle(),s.text("+"==s.text()?"-":"+")}))}))},6111:function(e,t,s){"use strict";s.r(t);var i=s(9446),n=function(e,t){void 0===t&&(t=100),e.fadeTo(t,0,(function(){e.slideUp(t,(function(){e.remove()}))}))};jQuery((function(e){var t=function(t,s,n,o){if(!s.prop("disabled")){t.preventDefault(),e(".wp-smush-error").remove(),e(".smush-stats-wrapper").hide();var a="grid";"smush_restore_image"===n&&(a=e(document).find("div.media-modal.wp-core-ui").length>0||window.location.search.indexOf("item")>-1?"grid":"list");var r={action:n,attachment_id:s.data("id"),mode:a,_nonce:s.data("nonce")};!function(e){var t=e.parent();t.css({opacity:"0.5"}),t.find("a").prop("disabled",!0)}(s),s.html('<span class="spinner wp-smush-progress">'+wp_smush_msgs[o]+"</span>"),e.post(ajaxurl,r,(function(t){!function(e){var t=e.parent();t.css({opacity:"1"}),t.find("a").prop("disabled",!1)}(s),t.success&&void 0!==t.data?(void 0!==this.data&&this.data.indexOf("nextgen")>-1||"restore"===o?s.parents().eq(1).html(t.data.stats):s.parents().eq(1).html(t.data),void 0!==t.data&&"restore"===o&&i.Z.updateImageStats(t.data.new_size)):t.data&&t.data.error_msg&&(-1===this.data.indexOf("nextgen")&&"restore"===o?e(".smush-status").addClass("error").html(t.data.error_msg):s.parent().append(t.data.error_msg))}))}},s=function(e){var t=jQuery(".bulk-smush-wrapper .wp-smush-bulk-wrapper, #wp-smush-pending-to-smush-text"),s=jQuery(".bulk-smush-wrapper .wp-smush-all-done, .bulk-smush-wrapper .wp-smush-pagespeed-recommendation, #smush-box-bulk-upgrade, #wp-smush-all-smushed-text");if(t.length&&s.length)if(0===e)t.addClass("sui-hidden"),s.removeClass("sui-hidden");else{t.removeClass("sui-hidden"),s.addClass("sui-hidden");var i=jQuery(".sui-summary-smush .sui-summary-details .sui-tooltip");if(i.length){var n=1===e?"singular":"plural",o=i.data(n).replace("{count}",e);i.attr("data-tooltip",o)}}jQuery(".wp-smush-total-count").text(e)},o=function(t){e(t).length>0&&e("html, body").animate({scrollTop:e(t).offset().top-100},"slow")};if(e("#all-image-sizes").on("change",(function(){e('input[name^="wp-smush-image_sizes"]').prop("checked",!0)})),e(".sui-mobile-nav").on("change",(function(t){window.location.assign(e(t.currentTarget).val())})),e("#update-api-status").on("click",(function(t){t.preventDefault(),e(this).addClass("sui-button-onload"),e.post(ajaxurl,{action:"recheck_api_status"},(function(){location.reload()}))})),e("body").on("click",".wp-smush-send:not(.wp-smush-resmush)",(function(t){t.preventDefault(),new i.Z(e(this),!1)})),e("body").on("click",".wp-smush-remove-skipped",(function(t){t.preventDefault();var s=e(this);e.post(ajaxurl,{action:"remove_from_skip_list",id:s.attr("data-id")}).done((function(e){e.success&&void 0!==e.data.links&&(s.parent().parent().find(".smush-status").text(wp_smush_msgs.not_processed),t.target.closest(".smush-status-links").innerHTML=e.data.links)}))})),e("body").on("click",".wp-smush-nextgen-send",(function(t){t.preventDefault(),new i.Z(e(this),!1,"nextgen")})),e("body").on("click",".wp-smush-nextgen-bulk",(function(t){if(t.preventDefault(),e(".wp-smush-resmush-notice").remove(),"undefined"==typeof wp_smushit_data||0===wp_smushit_data.unsmushed.length&&0===wp_smushit_data.resmush.length)return!1;jQuery(".wp-smush-all, .wp-smush-scan").prop("disabled",!0),e(".wp-smush-notice.wp-smush-remaining").hide(),new i.Z(e(this),!0,"nextgen")})),e("body").on("click",".wp-smush-action.wp-smush-restore",(function(s){var i=e(this);t(s,i,"smush_restore_image","restore")})),e("body").on("click",".wp-smush-action.wp-smush-resmush",(function(s){t(s,e(this),"smush_resmush_image","smushing")})),e("body").on("click",".wp-smush-action.wp-smush-nextgen-restore",(function(s){t(s,e(this),"smush_restore_nextgen_image","restore")})),e("body").on("click",".wp-smush-action.wp-smush-nextgen-resmush",(function(s){t(s,e(this),"smush_resmush_nextgen_image","smushing")})),e(".wp-smush-scan").on("click",(function(t){t.preventDefault(),function(t){var n=e(".wp-smush-scan");n.addClass("sui-button-onload");var o=n.data("type");o=void 0===o?"media":o,e(".wp-smush-all").removeAttr("data-smush");var a=e(".sui-notice-top.sui-notice-success");a.slideUp(100,(function(){a.remove()})),e(".wp-smush-all").prop("disabled",!0),e(".wp-smush-settings-changed").hide();var r={action:"scan_for_resmush",type:o,get_ui:!0,process_settings:t,wp_smush_options_nonce:jQuery("#wp_smush_options_nonce").val()};e.get(ajaxurl,r,(function(t){if(void 0!==t.data){if(void 0!==t.data.resmush_ids){wp_smushit_data.resmush=t.data.resmush_ids,"undefined"!=typeof wp_smushit_data&&(wp_smushit_data.count_smushed=void 0!==t.data.count_smushed?t.data.count_smushed:wp_smushit_data.count_smushed,wp_smushit_data.count_supersmushed=void 0!==t.data.count_supersmushed?t.data.count_supersmushed:wp_smushit_data.count_supersmushed,wp_smushit_data.count_images=void 0!==t.data.count_image?t.data.count_image:wp_smushit_data.count_images,wp_smushit_data.size_before=void 0!==t.data.size_before?t.data.size_before:wp_smushit_data.size_before,wp_smushit_data.size_after=void 0!==t.data.size_after?t.data.size_after:wp_smushit_data.size_after,wp_smushit_data.savings_resize=void 0!==t.data.savings_resize?t.data.savings_resize:wp_smushit_data.savings_resize,wp_smushit_data.savings_conversion=void 0!==t.data.savings_conversion?t.data.savings_conversion:wp_smushit_data.savings_conversion,wp_smushit_data.count_resize=void 0!==t.data.count_resize?t.data.count_resize:wp_smushit_data.count_resize,wp_smushit_data.unsmushed=void 0!==t.data.unsmushed?t.data.unsmushed:wp_smushit_data.unsmushed),"nextgen"===o&&(wp_smushit_data.bytes=parseInt(wp_smushit_data.size_before)-parseInt(wp_smushit_data.size_after));var n=e(".bulk-smush-wrapper .sui-notice:not(.smush-upsell-notice)");n.length>0&&(n.addClass("sui-hidden"),e(".wp-smush-pagespeed-recommendation").addClass("sui-hidden")),e(".wp-smush-resmush-notice").remove(),e(".wp-smush-bulk-wrapper").removeClass("sui-hidden")}if(void 0!==t.data.content&&e("#wp-smush-bulk-content").html(t.data.content),void 0!==t.data.notice){var a="success";void 0!==t.data.noticeType&&(a=t.data.noticeType),window.SUI.openNotice("wp-smush-ajax-notice","<p>"+t.data.notice+"</p>",{type:a,icon:"check-tick"})}e("div.smush-final-log").hide(),void 0!==t.data.super_smush&&t.data.super_smush&&"undefined"!==t.data.super_smush_stat&&e(".super-smush-attachments .wp-smush-stats").html(t.data.super_smush_stats),i.Z.updateStats(o);var r=t.data.count||0;i.Z.updateRemainingCount(r),s(r)}})).always((function(){jQuery(".bulk-smush-wrapper .wp-smush-bulk-progress-bar-wrapper").addClass("sui-hidden"),n.removeClass("sui-button-onload").addClass("smush-button-check-success");var t=n.find(".wp-smush-default-text"),s=n.find(".wp-smush-completed-text");t.addClass("sui-hidden-important"),s.removeClass("sui-hidden"),setTimeout((function(){n.removeClass("smush-button-check-success"),t.removeClass("sui-hidden-important"),s.addClass("sui-hidden")}),2e3),e(".wp-smush-all").prop("disabled",!1)}))}(!1)})),e("#wp-smush-welcome-box .smush-dismiss-welcome").on("click",(function(t){t.preventDefault();var s=e(this).parents().eq(1);n(s);e.post(ajaxurl,{action:"dismiss_welcome_notice"})})),e("body").on("click",".wp-smush-notice .icon-fi-close",(function(t){t.preventDefault();var s=e(this).parent();n(s)})),e("body").on("click",".wp-smush-skip-resmush",(function(t){t.preventDefault();var s=jQuery(this),o=s.parents().eq(1),a=s.parent();n(a),e(".sui-notice-top.sui-notice-success").remove(),o.find(".wp-smush-all").attr("data-smush","skip_resmush"),wp_smushit_data.count_smushed=parseInt(wp_smushit_data.count_smushed)+wp_smushit_data.resmush.length,wp_smushit_data.count_supersmushed=parseInt(wp_smushit_data.count_supersmushed)+wp_smushit_data.resmush.length,wp_smushit_data.count_smushed===wp_smushit_data.count_total&&(e(".wp-smush-notice.wp-smush-all-done, .wp-smush-pagespeed-recommendation").removeClass("sui-hidden"),e(".wp-smush-bulk-wrapper ").addClass("sui-hidden")),e(".wp-smush-resmush-notice").remove();var r=e(".wp-smush-scan").data("type");r=void 0===r?"media":r;var u=(void 0!==wp_smushit_data.count_smushed?wp_smushit_data.count_smushed:0)/wp_smushit_data.count_total*100;u=WP_Smush.helpers.precise_round(u,1),e(".wp-smush-images-percent").html(u);var d=jQuery(".bulk-smush-wrapper .wp-smush-progress-inner");if(!(d.length<1)){d.css("width",u+"%"),e(".wp-smush-bulk-wrapper").removeClass("sui-hidden"),e(".wp-smush-bulk-wrapper .sui-notice").removeClass("sui-hidden");var l={action:"delete_resmush_list",type:r};e.post(ajaxurl,l,(function(t){if(t.success&&void 0!==t.data.stats){var s=t.data.stats;"undefined"!=typeof wp_smushit_data&&(wp_smushit_data.count_images=void 0!==s.count_images?parseInt(wp_smushit_data.count_images)+s.count_images:wp_smushit_data.count_images,wp_smushit_data.size_before=void 0!==s.size_before?parseInt(wp_smushit_data.size_before)+s.size_before:wp_smushit_data.size_before,wp_smushit_data.size_after=void 0!==s.size_after?parseInt(wp_smushit_data.size_after)+s.size_after:wp_smushit_data.size_after,wp_smushit_data.savings_resize=void 0!==s.savings_resize?parseInt(wp_smushit_data.savings_resize)+s.savings_resize:wp_smushit_data.savings_resize,wp_smushit_data.savings_conversion=void 0!==s.savings_conversion?parseInt(wp_smushit_data.savings_conversion)+s.savings_conversion:wp_smushit_data.savings_conversion,void 0!==wp_smushit_data.savings_dir_smush&&void 0!==wp_smushit_data.savings_dir_smush.orig_size&&(wp_smushit_data.size_before=void 0!==wp_smushit_data.savings_dir_smush?parseInt(wp_smushit_data.size_before)+parseInt(wp_smushit_data.savings_dir_smush.orig_size):wp_smushit_data.size_before,wp_smushit_data.size_after=void 0!==wp_smushit_data.savings_dir_smush?parseInt(wp_smushit_data.size_after)+parseInt(wp_smushit_data.savings_dir_smush.image_size):wp_smushit_data.size_after),wp_smushit_data.count_resize=void 0!==s.count_resize?parseInt(wp_smushit_data.count_resize)+s.count_resize:wp_smushit_data.count_resize);var n=e(".bulk-smush-wrapper .wp-smush-remaining-count");n.length&&void 0!==wp_smushit_data.unsmushed&&n.html(wp_smushit_data.unsmushed.length),void 0===wp_smushit_data.unsmushed&&0!==wp_smushit_data.unsmushed.length||(e(".wp-smush-bulk-wrapper .sui-notice").removeClass("sui-hidden"),e(".sui-notice-success.wp-smush-all-done").addClass("sui-hidden")),i.Z.updateStats()}}))}})),e("a.wp-smush-lossy-enable").on("click",(function(e){e.preventDefault(),o("#column-lossy")})),e(".wp-smush-resize-enable").on("click",(function(e){e.preventDefault(),o("#column-resize")})),window.location.hash){var a="";switch(window.location.hash.substring(1)){case"enable-resize":a="#column-resize";break;case"backup-label":a="#backup";break;case"original-label":a="#original";break;case"enable-lossy":a="#column-lossy"}""!==a&&(o(a),document.getElementById(a.replace("#","")).focus())}if(e("body").on("click",".wp-smush-trigger-bulk",(function(t){t.preventDefault(),void 0!==t.target.dataset.type&&"nextgen"===t.target.dataset.type?e(".wp-smush-nextgen-bulk").trigger("click"):e(".wp-smush-all").trigger("click"),e("span.sui-notice-dismiss").trigger("click")})),e("body").on("click","#bulk-smush-top-notice-close",(function(t){t.preventDefault(),e(this).parent().parent().slideUp("slow")})),e(".wp-smush-setting-row .toggle-checkbox").on("focus",(function(){e(this).keypress((function(t){32==t.keyCode&&(t.preventDefault(),e(this).find(".toggle-checkbox").trigger("click"))}))})),e("body").on("blur",".wp-smush-resize-input",(function(){!function(e,t,s){var i=e.find("#resize");if(!s)var n=e.find("#wp-smush-resize_width"),o=e.find(".sui-notice-info.wp-smush-update-width");if(!t)var a=e.find("#wp-smush-resize_height"),r=e.find(".sui-notice-info.wp-smush-update-height");var u=!1,d=!1;!i.is(":checked")||void 0===wp_smushit_data.resize_sizes||void 0===wp_smushit_data.resize_sizes.width||(!s&&void 0!==n&&parseInt(wp_smushit_data.resize_sizes.width)>parseInt(n.val())?(n.parent().addClass("sui-form-field-error"),o.show("slow"),u=!0):(n.parent().removeClass("sui-form-field-error"),o.hide(),a.hasClass("error")&&r.show("slow")),!t&&void 0!==a&&parseInt(wp_smushit_data.resize_sizes.height)>parseInt(a.val())?(a.parent().addClass("sui-form-field-error"),u||r.show("slow"),d=!0):(a.parent().removeClass("sui-form-field-error"),r.hide(),n.hasClass("error")&&o.show("slow")))}(e(this).parents().eq(4),!1,!1)})),e("body").on("click","#resize",(function(){var t=e(this),s=e("#smush-resize-settings-wrap");t.is(":checked")?s.show():s.hide()})),e("#wp-smush-revalidate-member").on("click",(function(t){t.preventDefault();var s=e(this).parents().eq(1);s.addClass("loading-notice"),e.get(ajaxurl,{action:"smush_show_warning"},(function(e){s.removeClass("loading-notice").addClass("loaded-notice"),0==e?(s.attr("data-message",wp_smush_msgs.membership_valid),n(s,1e3)):(s.attr("data-message",wp_smush_msgs.membership_invalid),setTimeout((function(){s.removeClass("loaded-notice")}),1e3))}))})),e("li.smush-dir-savings").length>0){e.get(ajaxurl,{action:"get_dir_smush_stats"},(function(t){e("li.smush-dir-savings .sui-icon-loader").hide(),t.success||void 0===t.data.message?void 0===t.data||void 0===t.data.dir_smush?(e("li.smush-dir-savings span.wp-smush-stats").append(wp_smush_msgs.ajax_error),e("li.smush-dir-savings span.wp-smush-stats span").hide()):function(t){if(void 0!==t.dir_smush){var s=e("li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-human"),i=e("li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-percent");t.dir_smush.bytes>0?(e(".wp-smush-dir-link").addClass("sui-hidden"),e("li.smush-dir-savings .wp-smush-stats-label-message").hide(),s.length>0?s.html(t.dir_smush.human):t.dir_smush.bytes,t.dir_smush.percent>0&&(e("li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-sep").removeClass("sui-hidden"),i.length>0?i.html(t.dir_smush.percent+"%"):t.dir_smush.percent)):e(".wp-smush-dir-link").removeClass("sui-hidden")}if(void 0!==t.combined_stats&&t.combined_stats.length>0){var n=t.combined_stats,o=n.smushed/n.total_count*100;(o=WP_Smush.helpers.precise_round(o,1))&&e("div.wp-smush-count-total span.wp-smush-images-percent").html(o),n.total_count&&e("span.wp-smush-count-total span.wp-smush-total-optimised").html(n.total_count),n.savings&&e("span.wp-smush-savings span.wp-smush-stats-human").html(n.savings),n.percent&&e("span.wp-smush-savings span.wp-smush-stats-percent").html(n.percent)}}(t.data):e("div.wp-smush-scan-result div.content").prepend(t.data.message)}))}e("span.dismiss-recommendation").on("click",(function(t){t.preventDefault();var s=e(this).parent();s.hide("slow",(function(){s.remove()})),e.ajax({type:"POST",url:ajaxurl,data:{action:"hide_pagespeed_suggestion"}})})),e("#smush-updated-dialog").length&&window.SUI.openModal("smush-updated-dialog","wpbody-content",void 0,!1),e("input#original").on("change",(function(){e("#backup-notice").toggleClass("sui-hidden",e(this).is(":checked"))}))}))},7447:function(){!function(){"use strict";WP_Smush.restore={modal:document.getElementById("smush-restore-images-dialog"),contentContainer:document.getElementById("smush-bulk-restore-content"),settings:{slide:"start",success:0,errors:[]},items:[],success:[],errors:[],currentStep:0,totalSteps:0,init:function(){this.modal&&(this.settings={slide:"start",success:0,errors:[]},this.resetModalWidth(),this.renderTemplate(),window.SUI.openModal("smush-restore-images-dialog","wpbody-content",void 0,!1))},renderTemplate:function(){var e=WP_Smush.onboarding.template("smush-bulk-restore")(this.settings);e&&(this.contentContainer.innerHTML=e),this.bindSubmit()},resetModalWidth:function(){this.modal.style.maxWidth="460px",this.modal.querySelector(".sui-box").style.maxWidth="460px"},bindSubmit:function(){var e=this.modal.querySelector('button[id="smush-bulk-restore-button"]'),t=this;e&&e.addEventListener("click",(function(e){e.preventDefault(),t.resetModalWidth(),t.settings={slide:"progress"},t.errors=[],t.renderTemplate(),t.initScan()}))},cancel:function(){"start"===this.settings.slide||"finish"===this.settings.slide?window.SUI.closeModal():(this.updateProgressBar(!0),window.location.reload())},updateProgressBar:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=0;0<this.currentStep&&(t=Math.min(Math.round(100*this.currentStep/this.totalSteps),99)),t>100&&(t=100),this.modal.querySelector(".sui-progress-text span").innerHTML=t+"%",this.modal.querySelector(".sui-progress-bar span").style.width=t+"%";var s=this.modal.querySelector(".sui-progress-state-text");s.innerHTML=t>=90?"Finalizing...":e?"Cancelling...":this.currentStep+"/"+this.totalSteps+" images restored"},initScan:function(){var e=this,t=document.getElementById("_wpnonce"),s=new XMLHttpRequest;s.open("POST",ajaxurl+"?action=get_image_count",!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.onload=function(){if(200===s.status){var t=JSON.parse(s.response);void 0!==t.data.items&&(e.items=t.data.items,e.totalSteps=t.data.items.length,e.step())}else window.console.log("Request failed. Returned status of "+s.status)},s.send("_ajax_nonce="+t.value)},step:function(){var e=this,t=this,s=document.getElementById("_wpnonce");if(0<this.items.length){var i=this.items.pop(),n=new XMLHttpRequest;n.open("POST",ajaxurl+"?action=restore_step",!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.onload=function(){if(e.currentStep++,200===n.status){var s=JSON.parse(n.response);void 0!==s.data.success&&s.data.success?t.success.push(i):t.errors.push({id:i,src:s.data.src,thumb:s.data.thumb,link:s.data.link})}t.updateProgressBar(),t.step()},n.send("item="+i+"&_ajax_nonce="+s.value)}else this.settings={slide:"finish",success:this.success.length,errors:this.errors,total:this.totalSteps},t.renderTemplate(),0<this.errors.length&&(this.modal.style.maxWidth="660px",this.modal.querySelector(".sui-box").style.maxWidth="660px")}},WP_Smush.restore.template=_.memoize((function(e){var t,s={evaluate:/<#([\s\S]+?)#>/g,interpolate:/{{{([\s\S]+?)}}}/g,escape:/{{([^}]+?)}}(?!})/g,variable:"data"};return function(i){return _.templateSettings=s,(t=t||_.template(document.getElementById(e).innerHTML))(i)}}))}()},7413:function(e,t,s){"use strict";s.r(t);var i,n=s(9446);i=jQuery,WP_Smush.bulk={init:function(){i(".wp-smush-all").on("click",(function(e){e.preventDefault(),i(".sui-notice-top.sui-notice-success").remove();var t=document.getElementById("bulk_smush_warning");t.classList.add("sui-hidden");var s=i(".wp-smush-bulk-progress-bar-wrapper");if(s.removeClass("wp-smush-exceed-limit"),s.find(".sui-progress-block .wp-smush-all").addClass("sui-hidden"),s.find(".sui-progress-block .wp-smush-cancel-bulk").removeClass("sui-hidden"),t&&document.getElementById("bulk-smush-resume-button").classList.add("sui-hidden"),i(".wp-resmush.wp-smush-action, .wp-smush-scan, .wp-smush-all:not(.sui-progress-close), a.wp-smush-lossy-enable, button.wp-smush-resize-enable, button#save-settings-button").prop("disabled",!0),void 0===window.wp_smushit_data||0===window.wp_smushit_data.unsmushed.length&&0===window.wp_smushit_data.resmush.length)return!1;i(".wp-smush-remaining").addClass("sui-hidden"),s.find(".sui-progress-block i.sui-icon-info").removeClass("sui-icon-info").addClass("sui-loading").addClass("sui-icon-loader"),new n.Z(i(this),!0)})),i("body").on("click",".smush-ignore-image",(function(e){e.preventDefault();var t=i(this);t.prop("disabled",!0),t.attr("data-tooltip"),t.removeClass("sui-tooltip"),i.post(ajaxurl,{action:"ignore_bulk_image",id:t.attr("data-id")}).done((function(s){t.is("a")&&s.success&&void 0!==s.data.links&&(t.parent().parent().find(".smush-status").text(wp_smush_msgs.ignored),e.target.closest(".smush-status-links").innerHTML=s.data.links)}))}));var e=document.getElementById("smush-box-bulk-upgrade");!e||window.wp_smushit_data.unsmushed.length||window.wp_smushit_data.resmush.length||e.classList.remove("sui-hidden")}},WP_Smush.bulk.init()},2140:function(e,t,s){"use strict";s.r(t);var i,n=s(5445),o=function(e,t){e=parseInt(e),t=parseInt(t);var s=!1,i=0,n=0,o={scan:function(){var s=this,i=e-t;0!==t?a(i).fail(this.showScanError):jQuery.post(ajaxurl,{action:"directory_smush_start"},(function(){return a(i).fail(s.showScanError)})).fail(this.showScanError)},cancel:function(){return s=!0,jQuery.post(ajaxurl,{action:"directory_smush_cancel"})},getProgress:function(){if(s)return 0;var i=e-t;return Math.min(Math.round(100*parseInt(e-i)/e),99)},onFinishStep:function(s){jQuery(".wp-smush-progress-dialog .sui-progress-state-text").html(t-i+"/"+e+" "+window.wp_smush_msgs.progress_smushed),WP_Smush.directory.updateProgressBar(s)},onFinish:function(){WP_Smush.directory.updateProgressBar(100),window.location.href=window.wp_smush_msgs.directory_url+"&scan=done"},showScanError:function(e){var t=jQuery("#wp-smush-progress-dialog");t.removeClass("wp-smush-exceed-limit").addClass("wp-smush-scan-error"),t.find("#smush-scan-error").text("".concat(e.status," ").concat(e.statusText));var s=t.find(".smush-403-error-message");403!==e.status?s.addClass("sui-hidden"):s.removeClass("sui-hidden")},limitReached:function(){var e=jQuery("#wp-smush-progress-dialog");e.addClass("wp-smush-exceed-limit"),e.find("#cancel-directory-smush").attr("data-tooltip",window.wp_smush_msgs.bulk_resume),e.find(".sui-box-body .sui-icon-close").removeClass("sui-icon-close").addClass("sui-icon-play"),e.find("#cancel-directory-smush").attr("id","cancel-directory-smush-disabled")},resume:function(){var e=jQuery("#wp-smush-progress-dialog"),t=e.find("#cancel-directory-smush-disabled");e.removeClass("wp-smush-exceed-limit"),e.find(".sui-box-body .sui-icon-play").removeClass("sui-icon-play").addClass("sui-icon-close"),t.attr("data-tooltip","Cancel"),t.attr("id","cancel-directory-smush"),o.scan()}},a=function s(a){return a>=0?(t=e-a,jQuery.post(ajaxurl,{action:"directory_smush_check_step",step:t},(function(e){void 0!==e.success&&e.success?(void 0!==e.data&&void 0!==e.data.skipped&&!0===e.data.skipped&&n++,t++,a-=1,o.onFinishStep(o.getProgress()),s(a).fail(o.showScanError)):void 0!==e.data.error&&"dir_smush_limit_exceeded"===e.data.error?o.limitReached():(i++,t++,a-=1,o.onFinishStep(o.getProgress()),s(a).fail(o.showScanError))}))):jQuery.post(ajaxurl,{action:"directory_smush_finish",items:e-(i+n),failed:i,skipped:n},(function(e){return o.onFinish(e)}))};return o};i=jQuery,WP_Smush.directory={selected:[],tree:[],wp_smush_msgs:[],triggered:!1,init:function(){var e=this,t=i("#wp-smush-progress-dialog"),s=0,n=0;void 0!==window.wp_smushit_data.dir_smush&&(s=window.wp_smushit_data.dir_smush.totalSteps,n=window.wp_smushit_data.dir_smush.currentScanStep),this.scanner=new o(s,n),this.wp_smush_msgs=window.wp_smush_msgs||{},i("button.wp-smush-browse, a#smush-directory-open-modal").on("click",(function(t){t.preventDefault(),i(t.currentTarget).hasClass("wp-smush-browse")&&(i("div.wp-smush-scan-result div.wp-smush-notice").hide(),i("div.wp-smush-info").remove()),window.SUI.openModal("wp-smush-list-dialog",t.currentTarget,i("#wp-smush-list-dialog .sui-box-header [data-modal-close]")[0],!0),e.initFileTree()})),i("#wp-smush-select-dir").on("click",(function(t){if(t.preventDefault(),!i(this).prop("disabled")){var s=i(this);i("div.wp-smush-list-dialog div.sui-box-body").css({opacity:"0.8"}),i("div.wp-smush-list-dialog div.sui-box-body a").off("click"),s.prop("disabled",!0),s.addClass("sui-button-onload");var n=e.tree.getSelectedNodes(),a=[];n.forEach((function(e){a.push(e.key)}));var r={action:"image_list",smush_path:a,image_list_nonce:i('input[name="image_list_nonce"]').val()};i.post(ajaxurl,r,(function(t){window.SUI.closeModal(),t.success?(e.scanner=new o(t.data,0),e.showProgressDialog(t.data),e.scanner.scan()):window.SUI.openNotice("wp-smush-ajax-notice",t.data.message,{type:"warning"})}))}})),t.on("click","#cancel-directory-smush, #dialog-close-div, .wp-smush-cancel-dir",(function(t){t.preventDefault(),i(".wp-smush-cancel-dir").addClass("sui-button-onload"),e.scanner.cancel().done((function(){return window.location.href=e.wp_smush_msgs.directory_url}))})),t.on("click",".sui-icon-play, .wp-smush-resume-scan",(function(t){t.preventDefault(),e.scanner.resume()}));var a=window.location.search;new URLSearchParams(a).has("start")&&!this.triggered&&(this.triggered=!0,i("button.wp-smush-browse").trigger("click"))},initFileTree:function(){var e=this,t=i("button#wp-smush-select-dir"),s={type:"GET",url:ajaxurl,data:{action:"smush_get_directory_list",list_nonce:i('input[name="list_nonce"]').val()},cache:!1};Object.entries(e.tree).length>0||(e.tree=(0,n.createTree)(".wp-smush-list-dialog .content",{autoCollapse:!0,clickFolderMode:3,checkbox:!0,debugLevel:0,selectMode:3,tabindex:"0",keyboard:!0,quicksearch:!0,source:s,lazyLoad:function(e,t){t.result=new Promise((function(e,n){s.data.dir=t.node.key,i.ajax(s).done((function(t){return e(t)})).fail(n)}))},loadChildren:function(e,t){return t.node.fixSelection3AfterClick()},select:function(){return t.prop("disabled",!+e.tree.getSelectedNodes().length)},init:function(){return t.prop("disabled",!0)}}))},showProgressDialog:function(e){i(".wp-smush-progress-dialog .sui-progress-state-text").html("0/"+e+" "+self.wp_smush_msgs.progress_smushed),window.SUI.openModal("wp-smush-progress-dialog","dialog-close-div",void 0,!1)},updateProgressBar:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e>100&&(e=100),i(".sui-progress-block .sui-progress-text span").text(e+"%"),i(".sui-progress-block .sui-progress-bar span").width(e+"%"),e>=90&&i(".sui-progress-state .sui-progress-state-text").text("Finalizing..."),t&&i(".sui-progress-state .sui-progress-state-text").text("Cancelling...")}},WP_Smush.directory.init()},3065:function(){!function(){"use strict";WP_Smush.helpers={init:function(){},formatBytes:function(e,t){var s=1024,i=["KB","MB","GB","TB","PB"];if(Math.abs(e)<s)return e+" B";var n=-1;do{e/=s,++n}while(Math.abs(e)>=s&&n<i.length-1);return e.toFixed(t)+" "+i[n]},getSizeFromString:function(e){return e.replace(/[a-zA-Z]/g,"").trim()},getFormatFromString:function(e){return e.replace(/[0-9.]/g,"").trim()},precise_round:function(e,t){var s=e>=0?1:-1;return e=e>100?100:e,Math.round(e*Math.pow(10,t)+.001*s)/Math.pow(10,t)},showErrorNotice:function(e){if(void 0!==e){var t="<p>".concat(e,"</p>");SUI.openNotice("wp-smush-ajax-notice",t,{type:"error",icon:"info"});var s=document.querySelector(".sui-button-onload");s&&s.classList.remove("sui-button-onload")}},resetSettings:function(){var e=document.getElementById("wp_smush_reset"),t=new XMLHttpRequest;t.open("POST",ajaxurl+"?action=reset_settings",!0),t.setRequestHeader("Content-type","application/x-www-form-urlencoded"),t.onload=function(){if(200===t.status){var e=JSON.parse(t.response);void 0!==e.success&&e.success&&(window.location.href=wp_smush_msgs.smush_url)}else window.console.log("Request failed. Returned status of "+t.status)},t.send("_ajax_nonce="+e.value)}},WP_Smush.helpers.init()}()},206:function(){!function(e){"use strict";if(e("#wp-smush-s3support-alert").length){var t={type:"warning",icon:"info",dismiss:{show:!0,label:wp_smush_msgs.noticeDismiss,tooltip:wp_smush_msgs.noticeDismissTooltip}};window.SUI.openNotice("wp-smush-s3support-alert",e("#wp-smush-s3support-alert").data("message"),t)}function s(t){var s=e(t.currentTarget).closest(".smush-notice");s.fadeTo(100,0,(function(){return s.slideUp(100,(function(){return s.remove()}))}))}e("#wp-smush-s3support-alert").on("click","button",(function(){e.post(ajaxurl,{action:"dismiss_s3support_alert"})})),e("#wp-smush-api-message button.sui-button-icon").on("click",(function(t){t.preventDefault();var s=e("#wp-smush-api-message");s.slideUp("slow",(function(){s.remove()})),e.post(ajaxurl,{action:"hide_api_message"})})),e(".smush-notice .smush-notice-act").on("click",(function(e){s(e)})),e(".smush-notice .smush-notice-dismiss").on("click",(function(t){s(t),e.post(ajaxurl,{action:"dismiss_upgrade_notice"})})),e(".wp-smush-update-info").on("click",".notice-dismiss",(function(t){t.preventDefault(),s(t),e.post(ajaxurl,{action:"dismiss_update_info"})}))}(jQuery)},3579:function(){!function(){"use strict";WP_Smush.onboarding={membership:"free",onboardingModal:document.getElementById("smush-onboarding-dialog"),scanFilesModal:document.getElementById("checking-files-dialog"),settings:{first:!0,last:!1,slide:"start",value:!1},selection:{auto:!0,lossy:!0,strip_exif:!0,original:!1,lazy_load:!0,usage:!1},contentContainer:document.getElementById("smush-onboarding-content"),onboardingSlides:["start","auto","lossy","strip_exif","original","lazy_load","usage"],touchX:null,touchY:null,init:function(){if(this.onboardingModal){var e=document.getElementById("smush-onboarding");this.membership=e.dataset.type,"pro"!==this.membership&&(this.onboardingSlides=["start","auto","strip_exif","lazy_load","usage"],this.selection.lossy=!1),"false"===e.dataset.tracking&&this.onboardingSlides.pop(),this.renderTemplate();var t=this.onboardingModal.querySelector(".smush-onboarding-skip-link");t&&t.addEventListener("click",this.skipSetup),window.SUI.openModal("smush-onboarding-dialog","checking-files-dialog",void 0,!1)}},handleTouchStart:function(e){var t=e.touches[0];this.touchX=t.clientX,this.touchY=t.clientY},handleTouchMove:function(e){if(this.touchX&&this.touchY){var t=e.touches[0].clientX,s=e.touches[0].clientY,i=this.touchX-t,n=this.touchY-s;Math.abs(i)>Math.abs(n)&&(i>0?!1===WP_Smush.onboarding.settings.last&&WP_Smush.onboarding.next(null,"next"):!1===WP_Smush.onboarding.settings.first&&WP_Smush.onboarding.next(null,"prev")),this.touchX=null,this.touchY=null}},renderTemplate:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none",s=this.onboardingModal.querySelector('input[type="checkbox"]');s&&(this.selection[s.id]=s.checked);var i=WP_Smush.onboarding.template("smush-onboarding"),n=i(this.settings);n&&(this.contentContainer.innerHTML=n,"none"===t?this.contentContainer.classList.add("loaded"):(this.contentContainer.classList.remove("loaded"),this.contentContainer.classList.add(t),setTimeout((function(){e.contentContainer.classList.add("loaded"),e.contentContainer.classList.remove(t)}),600))),this.onboardingModal.addEventListener("touchstart",this.handleTouchStart,!1),this.onboardingModal.addEventListener("touchmove",this.handleTouchMove,!1),this.bindSubmit()},bindSubmit:function(){var e=this.onboardingModal.querySelector('button[type="submit"]'),t=this;e&&e.addEventListener("click",(function(e){e.preventDefault();var s=t.onboardingModal.querySelector('input[type="checkbox"]');s&&(t.selection[s.id]=s.checked);var i=document.getElementById("smush_quick_setup_nonce"),n=new XMLHttpRequest;n.open("POST",ajaxurl+"?action=smush_setup",!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.onload=function(){200===n.status?WP_Smush.onboarding.showScanDialog():window.console.log("Request failed. Returned status of "+n.status)},n.send("smush_settings="+JSON.stringify(t.selection)+"&_ajax_nonce="+i.value)}))},next:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=this.onboardingSlides.indexOf(this.settings.slide),i=0;i=t?"next"===t?s+1:s-1:null!==e&&e.classList.contains("next")?s+1:s-1;var n=null!==e&&e.classList.contains("next")?"fadeInRight":"fadeInLeft";this.settings={first:0===i,last:i+1===this.onboardingSlides.length,slide:this.onboardingSlides[i],value:this.selection[this.onboardingSlides[i]]},this.renderTemplate(n)},goTo:function(e){var t=this.onboardingSlides.indexOf(e);this.settings={first:0===t,last:t+1===this.onboardingSlides.length,slide:e,value:this.selection[e]},this.renderTemplate()},skipSetup:function(){var e=document.getElementById("smush_quick_setup_nonce"),t=new XMLHttpRequest;t.open("POST",ajaxurl+"?action=skip_smush_setup&_ajax_nonce="+e.value),t.onload=function(){200===t.status?WP_Smush.onboarding.showScanDialog():window.console.log("Request failed. Returned status of "+t.status)},t.send()},showScanDialog:function(){window.SUI.closeModal(),window.SUI.openModal("checking-files-dialog","wpbody-content",void 0,!1);var e=document.getElementById("wp_smush_options_nonce");setTimeout((function(){var t=new XMLHttpRequest;t.open("POST",ajaxurl+"?action=scan_for_resmush",!0),t.setRequestHeader("Content-type","application/x-www-form-urlencoded"),t.onload=function(){var e=document.querySelector("#smush-onboarding-dialog");e.parentNode.removeChild(e),200===t.status?setTimeout((function(){window.location.search="page=smush-bulk"}),1e3):window.console.log("Request failed. Returned status of "+t.status)},t.send("type=media&get_ui=false&process_settings=false&wp_smush_options_nonce="+e.value)}),3e3)},hideUpgradeModal:function(){var e=new XMLHttpRequest;e.open("POST",ajaxurl+"?action=hide_new_features"),e.send()}},WP_Smush.onboarding.template=_.memoize((function(e){var t,s={evaluate:/<#([\s\S]+?)#>/g,interpolate:/{{{([\s\S]+?)}}}/g,escape:/{{([^}]+?)}}(?!})/g,variable:"data"};return function(i){return _.templateSettings=s,(t=t||_.template(document.getElementById(e).innerHTML))(i)}})),window.addEventListener("load",(function(){return WP_Smush.onboarding.init()}))}()},1110:function(){!function(){"use strict";WP_Smush.CDN={cdnEnableButton:document.getElementById("smush-enable-cdn"),cdnDisableButton:document.getElementById("smush-cancel-cdn"),cdnStatsBox:document.querySelector(".smush-cdn-stats"),init:function(){var e=this;this.cdnEnableButton&&this.cdnEnableButton.addEventListener("click",(function(t){t.preventDefault(),t.currentTarget.classList.add("sui-button-onload"),e.toggle_cdn(!0)})),this.cdnDisableButton&&this.cdnDisableButton.addEventListener("click",(function(t){t.preventDefault(),t.currentTarget.classList.add("sui-button-onload"),e.toggle_cdn(!1)})),this.updateStatsBox()},toggle_cdn:function(e){var t=document.getElementsByName("wp_smush_options_nonce"),s=new XMLHttpRequest;s.open("POST",ajaxurl+"?action=smush_toggle_cdn",!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.onload=function(){if(200===s.status){var e=JSON.parse(s.response);void 0!==e.success&&e.success?window.location.search="page=smush-cdn":void 0!==e.data.message&&WP_Smush.helpers.showErrorNotice(e.data.message)}else WP_Smush.helpers.showErrorNotice("Request failed. Returned status of "+s.status)},s.send("param="+e+"&_ajax_nonce="+t[0].value)},updateStatsBox:function(){var e=this;if(void 0!==this.cdnStatsBox&&this.cdnStatsBox&&window.location.search.includes("view=cdn")){this.toggleElements();var t=new XMLHttpRequest;t.open("POST",ajaxurl+"?action=get_cdn_stats",!0),t.onload=function(){if(200===t.status){var s=JSON.parse(t.response);void 0!==s.success&&s.success?e.toggleElements():void 0!==s.data.message&&WP_Smush.helpers.showErrorNotice(s.data.message)}else WP_Smush.helpers.showErrorNotice("Request failed. Returned status of "+t.status)},t.send()}},toggleElements:function(){for(var e=this.cdnStatsBox.querySelector(".sui-icon-loader"),t=this.cdnStatsBox.querySelectorAll(".wp-smush-stats > :not(.sui-icon-loader)"),s=0;s<t.length;s++)t[s].classList.toggle("sui-hidden");e.classList.toggle("sui-hidden")}},WP_Smush.CDN.init()}()},5972:function(){!function(){"use strict";WP_Smush.Lazyload={lazyloadEnableButton:document.getElementById("smush-enable-lazyload"),lazyloadDisableButton:document.getElementById("smush-cancel-lazyload"),init:function(){var e=this,t=this;this.lazyloadEnableButton&&this.lazyloadEnableButton.addEventListener("click",(function(t){t.preventDefault(),t.currentTarget.classList.add("sui-button-onload"),e.toggle_lazy_load(!0)})),this.lazyloadDisableButton&&this.lazyloadDisableButton.addEventListener("click",(function(t){t.preventDefault(),t.currentTarget.classList.add("sui-button-onload"),e.toggle_lazy_load(!1)}));var s=document.getElementById("smush-remove-spinner");s&&s.addEventListener("click",(function(t){t.preventDefault(),e.removeLoaderIcon()}));var i=document.getElementById("smush-remove-placeholder");i&&i.addEventListener("click",(function(t){t.preventDefault(),e.removeLoaderIcon("placeholder")}));var n=document.querySelectorAll(".smush-ll-remove");n&&0<n.length&&n.forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault(),e.target.closest("li").style.display="none",t.remove(e.target.dataset.id,e.target.dataset.type)}))})),this.handlePredefinedPlaceholders()},handlePredefinedPlaceholders:function(){var e=this,t=document.getElementById("placeholder-icon-1");t&&t.addEventListener("click",(function(){return e.changeColor("#F3F3F3")}));var s=document.getElementById("placeholder-icon-2");s&&s.addEventListener("click",(function(){return e.changeColor("#333333")}))},changeColor:function(e){document.getElementById("smush-color-picker").value=e,document.querySelector(".sui-colorpicker-hex .sui-colorpicker-value > span > span").style.backgroundColor=e,document.querySelector(".sui-colorpicker-hex .sui-colorpicker-value > input").value=e},toggle_lazy_load:function(e){var t=document.getElementsByName("wp_smush_options_nonce"),s=new XMLHttpRequest;s.open("POST",ajaxurl+"?action=smush_toggle_lazy_load",!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.onload=function(){if(200===s.status){var e=JSON.parse(s.response);void 0!==e.success&&e.success?window.location.search="page=smush-lazy-load":void 0!==e.data.message&&(WP_Smush.helpers.showErrorNotice(e.data.message),document.querySelector(".sui-button-onload").classList.remove("sui-button-onload"))}else WP_Smush.helpers.showErrorNotice("Request failed. Returned status of "+s.status),document.querySelector(".sui-button-onload").classList.remove("sui-button-onload")},s.send("param="+e+"&_ajax_nonce="+t[0].value)},addLoaderIcon:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"spinner";e||(e=wp.media({title:"Select or upload an icon",button:{text:"Select icon"},multiple:!1})).on("select",(function(){var s=e.state().get("selection").first().toJSON(),i=document.getElementById("smush-"+t+"-icon-preview");i.style.backgroundImage='url("'+s.url+'")',i.style.display="block",document.getElementById("smush-"+t+"-icon-file").setAttribute("value",s.id),document.getElementById("smush-upload-"+t).style.display="none";var n=document.getElementById("smush-remove-"+t);n.querySelector("span").innerHTML=s.filename,n.style.display="block"})),e.open()},removeLoaderIcon:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"spinner",t=document.getElementById("smush-"+e+"-icon-preview");t.style.backgroundImage="",t.style.display="none",document.getElementById("smush-upload-"+e).style.display="block",document.getElementById("smush-remove-"+e).style.display="none",document.getElementById("smush-"+e+"-icon-file").setAttribute("value","")},remove:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"spinner",s=document.getElementsByName("wp_smush_options_nonce"),i=new XMLHttpRequest;i.open("POST",ajaxurl+"?action=smush_remove_icon",!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.send("id="+e+"&type="+t+"&_ajax_nonce="+s[0].value)}},WP_Smush.Lazyload.init()}()},4933:function(){!function(e){"use strict";function t(t,s){var i=new XMLHttpRequest;i.open("POST",ajaxurl+"?action=smush_save_settings",!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.onload=function(){if(e("#save-settings-button").removeClass("sui-button-onload-text sui-button-onload"),200===i.status){var t=JSON.parse(i.response);void 0!==t.success&&t.success?function(e){var t="<p>".concat(e,"</p>"),s={type:"success",icon:"check"};SUI.openNotice("wp-smush-ajax-notice",t,s);var i=document.querySelector(".sui-button-onload");i&&i.classList.remove("sui-button-onload")}(wp_smush_msgs.settingsUpdated):t.data&&t.data.message?WP_Smush.helpers.showErrorNotice(t.data.message):WP_Smush.helpers.showErrorNotice("Request failed.")}else WP_Smush.helpers.showErrorNotice("Request failed. Returned status of "+i.status)},i.send("page="+s+"&"+t+"&_ajax_nonce="+wp_smush_msgs.nonce)}e("form#smush-bulk-form").on("submit",(function(s){s.preventDefault(),e("#save-settings-button").addClass("sui-button-onload"),t(e(this).serialize(),"bulk"),function(){e("#save-settings-button").addClass("sui-button-onload");var t={action:"scan_for_resmush",wp_smush_options_nonce:e("#wp_smush_options_nonce").val(),type:"media"};e.post(ajaxurl,e.param(t)).done((function(){e("#save-settings-button").removeClass("sui-button-onload")}))}()})),e("form#smush-lazy-load-form").on("submit",(function(s){s.preventDefault(),e("#save-settings-button").addClass("sui-button-onload-text"),t(e(this).serialize(),"lazy-load")})),e("form#smush-cdn-form").on("submit",(function(s){s.preventDefault(),e("#save-settings-button").addClass("sui-button-onload-text"),t(e(this).serialize(),"cdn")})),e("form#smush-integrations-form").on("submit",(function(s){s.preventDefault(),e("#save-settings-button").addClass("sui-button-onload-text"),t(e(this).serialize(),"integrations")})),e("form#smush-tools-form").on("submit",(function(s){s.preventDefault(),e("#save-settings-button").addClass("sui-button-onload-text"),t(e(this).serialize(),"tools")})),e("form#smush-settings-form").on("submit",(function(s){s.preventDefault(),e("#save-settings-button").addClass("sui-button-onload-text"),t(e(this).serialize(),"settings")})),e("input[name=keep_data]").on("change",(function(e){var t="keep_data-true"===e.target.id?"keep_data-false":"keep_data-true";e.target.parentNode.classList.add("active"),document.getElementById(t).parentNode.classList.remove("active")})),e("input#detection").on("click",(function(){var t=e(".smush-highlighting-notice"),s=e(".smush-highlighting-warning");e(this).is(":checked")?t.length>0?t.show():s.show():(t.hide(),s.hide())}))}(jQuery)},9446:function(e,t){"use strict";function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var s=0;s<t.length;s++){var i=t[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var o=0,a=function(){function e(t,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"media";i(this,e),this.errors=[];var a=jQuery(".bulk-smush-wrapper .sui-progress-state-text");return this.smushed=parseInt(a.find("span:first-child").html()),this.total=parseInt(a.find("span:last-child").html()),this.skip_resmush=!(void 0===t.data("smush")||!t.data("smush")),this.button=jQuery(t[0]),this.is_bulk=!!s(n)&&n,this.url=ajaxurl,this.log=jQuery(".smush-final-log"),this.deferred=jQuery.Deferred(),this.deferred.errors=[],this.setIds(),this.is_bulk_resmush=0<wp_smushit_data.resmush.length&&!this.skip_resmush,this.status=this.button.parent().prev(".smush-status"),this.smush_type=o,this.single_ajax_suffix="nextgen"===this.smush_type?"smush_manual_nextgen":"wp_smushit_manual",this.bulk_ajax_suffix="nextgen"===this.smush_type?"wp_smushit_nextgen_bulk":"wp_smushit_bulk",this.url=this.is_bulk?e.smushAddParams(this.url,{action:this.bulk_ajax_suffix}):e.smushAddParams(this.url,{action:this.single_ajax_suffix}),this.start(),this.run(),this.bindDeferredEvents(),this.cancelAjax(),this.deferred}var t,a,r;return t=e,r=[{key:"smushAddParams",value:function(e,t){return jQuery.isEmptyObject(t)||(e+=(e.indexOf("?")>=0?"&":"?")+jQuery.param(t)),e}},{key:"membershipValidity",value:function(e){var t=jQuery("#wp-smush-invalid-member");void 0!==e&&void 0!==e.show_warning&&t.length>0&&(e.show_warning?t.show():t.hide())}},{key:"ajax",value:function(e,t,s,i){var n=jQuery.param({is_bulk_resmush:e,attachment_id:t,_nonce:i});return jQuery.ajax({type:"GET",data:n,url:s,timeout:wp_smushit_data.timeout,dataType:"json"})}},{key:"setProSavings",value:function(){var e=wp_smushit_data.savings_percent>0?wp_smushit_data.savings_percent:0,t=wp_smushit_data.savings_bytes>0?wp_smushit_data.savings_bytes:0,s=2.22058824;e>49&&(s=1.22054412),e>0&&(e*=s,t*=s),wp_smushit_data.pro_savings={percent:WP_Smush.helpers.precise_round(e,1),savings_bytes:WP_Smush.helpers.formatBytes(t,1)}}},{key:"updateStats",value:function(t){var s=void 0!==t&&"nextgen"===t,i=0;wp_smushit_data.savings_bytes=parseInt(wp_smushit_data.size_before)-parseInt(wp_smushit_data.size_after);var n=WP_Smush.helpers.formatBytes(wp_smushit_data.savings_bytes,1),o=jQuery(".wp-smush-savings .wp-smush-stats-human");s?o.html(n):(o.html(WP_Smush.helpers.getFormatFromString(n)),jQuery(".sui-summary-large.wp-smush-stats-human").html(WP_Smush.helpers.getSizeFromString(n))),wp_smushit_data.savings_percent=WP_Smush.helpers.precise_round(parseInt(wp_smushit_data.savings_bytes)/parseInt(wp_smushit_data.size_before)*100,1),isNaN(wp_smushit_data.savings_percent)||jQuery(".wp-smush-savings .wp-smush-stats-percent").html(wp_smushit_data.savings_percent),void 0!==wp_smushit_data.savings_bytes&&void 0!==wp_smushit_data.savings_resize&&(i=parseInt(wp_smushit_data.savings_bytes)-parseInt(wp_smushit_data.savings_resize))>0&&jQuery("li.super-smush-attachments span.smushed-savings").html(WP_Smush.helpers.formatBytes(i,1)),s?jQuery(".sui-summary-details span.wp-smush-total-optimised").html(wp_smushit_data.count_images):jQuery("span.smushed-items-count span.wp-smush-count-total span.wp-smush-total-optimised").html(wp_smushit_data.count_images),jQuery("span.smushed-items-count span.wp-smush-count-resize-total span.wp-smush-total-optimised").html(wp_smushit_data.count_resize);var a=jQuery("li.super-smush-attachments .smushed-count");a.length&&void 0!==wp_smushit_data.count_supersmushed&&a.html(wp_smushit_data.count_supersmushed);var r=jQuery(".smush-conversion-savings");if(r.length>0&&void 0!==wp_smushit_data.savings_conversion&&""!==wp_smushit_data.savings_conversion){var u=r.find(".wp-smush-stats");u.length>0&&u.html(WP_Smush.helpers.formatBytes(wp_smushit_data.savings_conversion,1))}var d=jQuery(".smush-resize-savings");if(d.length>0&&void 0!==wp_smushit_data.savings_resize&&""!==wp_smushit_data.savings_resize){var l=parseInt(wp_smushit_data.savings_resize),c=d.find(".wp-smush-stats"),h=d.find(".wp-smush-stats-label-message");l>0&&c.length>0&&(h.length>0&&h.hide(),c.html(WP_Smush.helpers.formatBytes(wp_smushit_data.savings_resize,1)))}if(e.setProSavings(),void 0!==wp_smushit_data.pro_savings){var p=jQuery(".smush-avg-pro-savings");if(p.length>0){var m=p.find(".wp-smush-stats-percent"),f=p.find(".wp-smush-stats-human");m.length>0&&void 0!==wp_smushit_data.pro_savings.percent&&""!==wp_smushit_data.pro_savings.percent&&m.html(wp_smushit_data.pro_savings.percent),f.length>0&&void 0!==wp_smushit_data.pro_savings.savings_bytes&&""!==wp_smushit_data.pro_savings.savings_bytes&&f.html(wp_smushit_data.pro_savings.savings_bytes)}}if(jQuery(".smush-sidenav .wp-smush-remaining-count").length){var g=0;void 0!==wp_smushit_data.unsmushed&&wp_smushit_data.unsmushed.length>0&&(g+=wp_smushit_data.unsmushed.length),void 0!==wp_smushit_data.resmush&&wp_smushit_data.resmush.length>0&&(g+=wp_smushit_data.resmush.length),e.updateRemainingCount(g)}}},{key:"updateImageStats",value:function(e){if(0!==e){var t=jQuery(".attachment-info .file-size");if(t.contents().filter((function(){return 3===this.nodeType})).text()!==" "+e){var s=t.contents().filter((function(){return 1===this.nodeType})).text();t.html("<strong>"+s+"</strong> "+e)}}}},{key:"updateRemainingCount",value:function(e){var t=jQuery(".wp-smush-remaining-count");t.length&&t.html(e);var s=jQuery(".smush-sidenav .wp-smush-remaining-count"),i=jQuery(".smush-sidenav .smush-bulk .sui-icon-check-tick");s.length&&i.length&&(e>0?(s.removeClass("sui-hidden"),i.addClass("sui-hidden")):(jQuery(".sui-summary-smush .smush-stats-icon").addClass("sui-hidden"),i.removeClass("sui-hidden"),s.addClass("sui-hidden")))}},{key:"updateLocalizedStats",value:function(e,t){void 0!==window.wp_smushit_data&&("media"===t?(wp_smushit_data.count_images=parseInt(wp_smushit_data.count_images)+parseInt(e.count),e.is_lossy&&(wp_smushit_data.count_supersmushed=parseInt(wp_smushit_data.count_supersmushed)+1),wp_smushit_data.savings_resize=void 0!==e.savings_resize.bytes?parseInt(wp_smushit_data.savings_resize)+parseInt(e.savings_resize.bytes):parseInt(wp_smushit_data.savings_resize),wp_smushit_data.count_resize=void 0!==e.savings_resize.bytes?parseInt(wp_smushit_data.count_resize)+1:wp_smushit_data.count_resize,wp_smushit_data.savings_conversion=void 0!==e.savings_conversion&&void 0!==e.savings_conversion.bytes?parseInt(wp_smushit_data.savings_conversion)+parseInt(e.savings_conversion.bytes):parseInt(wp_smushit_data.savings_conversion)):"directory_smush"===t?wp_smushit_data.count_images=parseInt(wp_smushit_data.count_images)+1:"nextgen"===t&&(wp_smushit_data.count_supersmushed=parseInt(wp_smushit_data.count_supersmushed)+1,wp_smushit_data.count_images=parseInt(wp_smushit_data.count_images)+parseInt(e.count)),e.size_before>e.size_after&&(wp_smushit_data.size_before=void 0!==e.size_before?parseInt(wp_smushit_data.size_before)+parseInt(e.size_before):parseInt(wp_smushit_data.size_before),wp_smushit_data.size_after=void 0!==e.size_after?parseInt(wp_smushit_data.size_after)+parseInt(e.size_after):parseInt(wp_smushit_data.size_after)),void 0!==e.savings_resize&&(wp_smushit_data.size_before=void 0!==e.savings_resize.size_before?parseInt(wp_smushit_data.size_before)+parseInt(e.savings_resize.size_before):parseInt(wp_smushit_data.size_before),wp_smushit_data.size_after=void 0!==e.savings_resize.size_after?parseInt(wp_smushit_data.size_after)+parseInt(e.savings_resize.size_after):parseInt(wp_smushit_data.size_after)),void 0!==e.savings_conversion&&(wp_smushit_data.size_before=void 0!==e.savings_conversion.size_before?parseInt(wp_smushit_data.size_before)+parseInt(e.savings_conversion.size_before):parseInt(wp_smushit_data.size_before),wp_smushit_data.size_after=void 0!==e.savings_conversion.size_after?parseInt(wp_smushit_data.size_after)+parseInt(e.savings_conversion.size_after):parseInt(wp_smushit_data.size_after)))}},{key:"prepareErrorRow",value:function(e,t,s,i,n){var o='<div class="smush-bulk-error-row"><div class="smush-bulk-image-data">'+(void 0===s?'<i class="sui-icon-photo-picture" aria-hidden="true"></i>':s)+'<span class="smush-image-name">'+("undefined"===t||void 0===t?"undefined":t)+'</span><span class="smush-image-error">'+e+"</span></div>";return"media"===n&&(o=o+'<div class="smush-bulk-image-actions"><button type="button" class="sui-button-icon sui-tooltip sui-tooltip-constrained sui-tooltip-top-right smush-ignore-image" data-tooltip="'+window.wp_smush_msgs.error_ignore+'" data-id="'+i+'"><i class="sui-icon-eye-hide" aria-hidden="true"></i></button></div>'),o+="</div>"}},{key:"updateSmushIds",value:function(e){if(void 0!==wp_smushit_data.unsmushed&&wp_smushit_data.unsmushed.length>0){var t=wp_smushit_data.unsmushed.indexOf(e);t>-1&&wp_smushit_data.unsmushed.splice(t,1)}if(void 0!==wp_smushit_data.resmush&&wp_smushit_data.resmush.length>0){var s=wp_smushit_data.resmush.indexOf(e);s>-1&&wp_smushit_data.resmush.splice(s,1)}}}],(a=[{key:"setIds",value:function(){var e=[];"object"===s(e=0<wp_smushit_data.resmush.length&&!this.skip_resmush?0<wp_smushit_data.unsmushed.length?wp_smushit_data.resmush.concat(wp_smushit_data.unsmushed):wp_smushit_data.resmush:wp_smushit_data.unsmushed)?this.ids=e.filter((function(e,t,s){return t===s.indexOf(e)})):this.ids=e}},{key:"start",value:function(){this.button.prop("disabled",!0),this.button.addClass("wp-smush-started"),this.bulkStart(),this.singleStart()}},{key:"bulkStart",value:function(){this.is_bulk&&(jQuery(".wp-smush-bulk-wrapper").addClass("sui-hidden"),jQuery(".sui-notice-top").remove(),jQuery(".wp-smush-bulk-progress-bar-wrapper .sui-notice-warning:first-of-type").hide(),0>=jQuery("div.smush-final-log .smush-bulk-error-row").length&&jQuery("div.smush-final-log").hide(),jQuery(".bulk-smush-wrapper .wp-smush-bulk-progress-bar-wrapper, #wp-smush-running-notice").removeClass("sui-hidden"))}},{key:"singleStart",value:function(){this.is_bulk||(this.button.html('<span class="spinner wp-smush-progress">'+window.wp_smush_msgs.smushing+"</span>"),this.status.removeClass("error"))}},{key:"enableButton",value:function(){this.button.prop("disabled",!1),jQuery(".wp-smush-all").prop("disabled",!1),jQuery("button.wp-smush-scan, a.wp-smush-lossy-enable, button.wp-smush-resize-enable, button#save-settings-button").prop("disabled",!1)}},{key:"singleDone",value:function(){if(!this.is_bulk){var t=this;this.button.html(window.wp_smush_msgs.all_done),this.request.done((function(s){if(void 0!==s.data){var i=t.status.parent();e.membershipValidity(s.data),s.success?i.html(s.data):(t.status.addClass("error"),t.status.html(s.data.error_msg),t.button.html(window.smush_vars.strings.stats_label)),e.updateImageStats(s.data.new_size)}t.enableButton()})).fail((function(e){t.status.html(e.data),t.status.addClass("error"),t.enableButton()}))}}},{key:"syncStats",value:function(){var t=jQuery("div.wp-smush-bulk-progress-bar-wrapper div.wp-smush-count.tc"),s=t.html();t.html(window.wp_smush_msgs.sync_stats),jQuery.ajax({type:"GET",url:this.url,data:{action:"get_stats"},success:function(t){t&&void 0!==t&&(t=t.data,jQuery.extend(wp_smushit_data,{count_images:t.count_images,count_smushed:t.count_smushed,count_total:t.count_total,count_resize:t.count_resize,count_supersmushed:t.count_supersmushed,savings_bytes:t.savings_bytes,savings_conversion:t.savings_conversion,savings_resize:t.savings_resize,size_before:t.size_before,size_after:t.size_after}),e.updateStats(this.smush_type))}}).always((function(){return t.html(s)}))}},{key:"bulkDone",value:function(){if(this.is_bulk){this.enableButton();var e=jQuery(".sui-summary-smush .smush-stats-icon");if(0===this.ids.length)e.addClass("sui-hidden"),jQuery(".bulk-smush-wrapper .wp-smush-all-done, .wp-smush-pagespeed-recommendation").removeClass("sui-hidden"),jQuery(".wp-smush-bulk-wrapper").addClass("sui-hidden"),jQuery(".wp-smush-bulk-progress-bar-wrapper").addClass("sui-hidden"),document.getElementById("smush-box-bulk-upgrade")&&(document.getElementById("smush-box-bulk-upgrade").classList.remove("sui-hidden"),document.getElementById("wp-smush-all-smushed-text").classList.remove("sui-hidden"),document.getElementById("wp-smush-pending-to-smush-text").classList.add("sui-hidden")),this._updateProgress(0,0);else{e.removeClass("sui-icon-loader sui-loading sui-hidden").addClass("sui-icon-info sui-warning");var t=jQuery(".bulk-smush-wrapper .wp-smush-resmush-notice");t.length>0?t.show():jQuery(".bulk-smush-wrapper .wp-smush-remaining").removeClass("sui-hidden")}jQuery(".wp-resmush.wp-smush-action, .wp-smush-scan").removeProp("disabled")}}},{key:"freeExceeded",value:function(){var e=jQuery(".wp-smush-bulk-progress-bar-wrapper");e.addClass("wp-smush-exceed-limit"),e.find(".sui-progress-block .wp-smush-cancel-bulk").addClass("sui-hidden"),e.find(".sui-progress-block .wp-smush-all").removeClass("sui-hidden"),e.find("i.sui-icon-loader").addClass("sui-icon-info").removeClass("sui-icon-loader").removeClass("sui-loading"),document.getElementById("bulk-smush-resume-button").classList.remove("sui-hidden"),document.getElementById("smush-box-bulk-upgrade")&&document.getElementById("smush-box-bulk-upgrade").classList.remove("sui-hidden")}},{key:"updateProgress",value:function(t){if(this.is_bulk_resmush||this.is_bulk){var s=0;t&&void 0!==t.data&&void 0!==t.data.stats&&e.updateLocalizedStats(t.data.stats,this.smush_type),this.is_bulk_resmush?(t.success&&(wp_smushit_data.resmush.length>0?jQuery(".wp-smush-images-remaining").html(wp_smushit_data.resmush.length):0===wp_smushit_data.resmush.length&&0===this.ids.length&&(jQuery(".bulk-resmush-wrapper .wp-smush-all-done, .wp-smush-pagespeed-recommendation").removeClass("sui-hidden"),jQuery(".wp-smush-resmush-wrap, .wp-smush-bulk-progress-bar-wrapper").addClass("sui-hidden"))),void 0!==this.ids&&void 0!==this.total&&this.total>0&&(s=(this.smushed+this.errors.length)/this.total*100)):s=(this.smushed+this.errors.length)/this.total*100,"nextgen"===this.smush_type&&wp_smushit_data.resmush.length>0&&this.smushed+this.errors.length<=1&&(wp_smushit_data.count_images-=wp_smushit_data.resmush.length+1),0===this.ids.length&&("nextgen"!==this.smush_type&&this.syncStats(),jQuery(".bulk-smush-wrapper .wp-smush-all-done, .wp-smush-pagespeed-recommendation").removeClass("sui-hidden"),jQuery(".wp-smush-bulk-wrapper").addClass("sui-hidden")),void 0!==this.ids&&e.updateRemainingCount(this.ids.length),this._updateProgress(this.smushed+this.errors.length,WP_Smush.helpers.precise_round(s,1)),0===this.ids.length&&"nextgen"!==this.smush_type||e.updateStats(this.smush_type)}}},{key:"_updateProgress",value:function(e,t){(this.is_bulk||this.is_bulk_resmush)&&(jQuery("span.wp-smush-images-percent").html(t+"%"),jQuery(".bulk-smush-wrapper .wp-smush-progress-inner").css("width",t+"%"),jQuery(".bulk-smush-wrapper .sui-progress-state-text").find("span:first-child").html(e).find("span:last-child").html(this.total))}},{key:"continue",value:function(){var e=this.button.attr("continue_smush");return void 0===e&&(e=!0),"false"!==e&&e||(e=!1),e&&this.ids.length>0&&this.is_bulk}},{key:"callAjax",value:function(){if(0!==o&&void 0!==o&&10>performance.now()-o)return this.freeExceeded(),this.deferred;var t="";this.current_id=this.is_bulk?this.ids.shift():this.button.data("id"),e.updateSmushIds(this.current_id);var s=this.button.parent().find("#_wp_smush_nonce");s&&(t=s.val());var i=this;return this.request=e.ajax(this.is_bulk_resmush,this.current_id,this.url,t).done((function(t){if(void 0===t.success||void 0!==t.success&&!1===t.success&&void 0!==t.data&&"limit_exceeded"!==t.data.error){i.errors.push(i.current_id);var s=e.prepareErrorRow(t.data.error_message,t.data.file_name,t.data.thumbnail,i.current_id,i.smush_type);i.log.show(),i.errors.length>5?jQuery(".smush-bulk-errors-actions").removeClass("sui-hidden"):i.log.find(".smush-bulk-errors").append(s)}else void 0!==t.success&&t.success&&i.smushed++;e.membershipValidity(t.data),void 0!==t.data&&"limit_exceeded"===t.data.error&&"resolved"!==i.deferred.state()?(document.getElementById("bulk_smush_warning").classList.remove("sui-hidden"),i.button.attr("continue_smush",!1),wp_smushit_data.unsmushed.unshift(i.current_id),i.ids.unshift(i.current_id),o=performance.now(),i.freeExceeded()):i.is_bulk?i.updateProgress(t):0===i.ids.length&&i.syncStats(),i.singleDone()})).always((function(){i.continue()&&i.is_bulk?i.callAjax():i.deferred.resolve()})),this.deferred.errors=this.errors,this.deferred}},{key:"run",value:function(){this.is_bulk&&this.ids.length>0&&this.callAjax(),this.is_bulk||this.callAjax()}},{key:"bindDeferredEvents",value:function(){var e=this;this.deferred.done((function(){if(e.button.removeAttr("continue_smush"),e.errors.length){var t=window.wp_smush_msgs.error_in_bulk.replace("{{errors}}",e.errors.length).replace("{{total}}",e.total).replace("{{smushed}}",e.smushed);jQuery(".wp-smush-all-done").addClass("sui-notice-warning").removeClass("sui-notice-success").find("p").html(t)}e.bulkDone(),jQuery(".wp-smush-all:not(.wp-smush-finished), .wp-smush-scan").prop("disabled",!1)}))}},{key:"cancelAjax",value:function(){var e=this;jQuery(".wp-smush-cancel-bulk").on("click",(function(){e.button.attr("continue_smush",!1),e.syncStats(),e.request.abort(),e.enableButton(),e.button.removeClass("wp-smush-started"),wp_smushit_data.unsmushed.unshift(e.current_id),jQuery(".wp-smush-bulk-wrapper").removeClass("sui-hidden"),jQuery(".wp-smush-bulk-progress-bar-wrapper").addClass("sui-hidden")}))}}])&&n(t.prototype,a),r&&n(t,r),e}();t.Z=a},1442:function(){!function(){"use strict";WP_Smush.WebP={nonceField:document.getElementsByName("wp_smush_options_nonce"),toggleModuleButton:document.getElementById("smush-toggle-webp-button"),recheckStatusButton:document.getElementById("smush-webp-recheck"),recheckStatusLink:document.getElementById("smush-webp-recheck-link"),showWizardButton:document.getElementById("smush-webp-toggle-wizard"),init:function(){var e=this;this.maybeShowDeleteAllSuccessNotice(),this.toggleModuleButton&&this.toggleModuleButton.addEventListener("click",(function(t){return e.toggleWebp(t)})),this.recheckStatusButton&&this.recheckStatusButton.addEventListener("click",(function(t){t.preventDefault(),e.recheckStatus()})),this.recheckStatusLink&&this.recheckStatusLink.addEventListener("click",(function(t){t.preventDefault(),e.recheckStatus()})),document.getElementById("wp-smush-webp-delete-all")&&document.getElementById("wp-smush-webp-delete-all").addEventListener("click",(function(t){return e.deleteAll(t)})),this.showWizardButton&&this.showWizardButton.addEventListener("click",this.toggleWizard)},toggleWebp:function(e){var t=this;e.preventDefault();var s=e.currentTarget,i="enable"===s.dataset.action;s.classList.add("sui-button-onload");var n=new XMLHttpRequest;n.open("POST",ajaxurl+"?action=smush_webp_toggle",!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.onload=function(){var e=JSON.parse(n.response);if(200===n.status){if(void 0!==e.success&&e.success)t.runScan().onload=function(){window.location.href=window.wp_smush_msgs.localWebpURL};else void 0!==e.data.message&&(t.showNotice(e.data.message),s.classList.remove("sui-button-onload"))}else{var i=window.wp_smush_msgs.generic_ajax_error;e&&void 0!==e.data.message&&(i=e.data.message),t.showNotice(i),s.classList.remove("sui-button-onload")}},n.send("param="+i+"&_ajax_nonce="+this.nonceField[0].value)},recheckStatus:function(){var e=this;this.recheckStatusButton.classList.add("sui-button-onload");var t=new XMLHttpRequest;t.open("POST",ajaxurl+"?action=smush_webp_get_status",!0),t.setRequestHeader("Content-type","application/x-www-form-urlencoded"),t.onload=function(){e.recheckStatusButton.classList.remove("sui-button-onload");var s=!1,i=JSON.parse(t.response);200===t.status?(i.success?"1":"0")!==e.recheckStatusButton.dataset.isConfigured&&location.reload():s=window.wp_smush_msgs.generic_ajax_error;i&&i.data&&(s=i.data),s&&e.showNotice(s)},t.send("_ajax_nonce="+window.wp_smush_msgs.webp_nonce)},deleteAll:function(e){var t=this,s=e.currentTarget;s.classList.add("sui-button-onload");var i=!1,n=new XMLHttpRequest;n.open("POST",ajaxurl+"?action=smush_webp_delete_all",!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.onload=function(){var e=JSON.parse(n.response);200===n.status?void 0!==e.success&&e.success?t.runScan().onload=function(){location.search=location.search+"&notice=webp-deleted"}:i=window.wp_smush_msgs.generic_ajax_error:i=window.wp_smush_msgs.generic_ajax_error;if(e&&e.data&&e.data.message&&(i=e.data.message),i){s.classList.remove("sui-button-onload");var o='<p style="text-align: left;">'.concat(i,"</p>");window.SUI.openNotice("wp-smush-webp-delete-all-error-notice",o,{type:"error",icon:"info",autoclose:{show:!1}})}},n.send("_ajax_nonce="+this.nonceField[0].value)},toggleWizard:function(e){e.currentTarget.classList.add("sui-button-onload");var t=new XMLHttpRequest;t.open("GET",ajaxurl+"?action=smush_toggle_webp_wizard&_ajax_nonce="+window.wp_smush_msgs.webp_nonce,!0),t.onload=function(){return location.reload()},t.send()},runScan:function(){var e=new XMLHttpRequest,t=document.getElementsByName("wp_smush_options_nonce");return e.open("POST",ajaxurl+"?action=scan_for_resmush",!0),e.setRequestHeader("Content-type","application/x-www-form-urlencoded"),e.send("_ajax_nonce="+t[0].value),e},showNotice:function(e,t){if(void 0!==e){var s="<p>".concat(e,"</p>"),i={type:t||"error",icon:"info",dismiss:{show:!0,label:window.wp_smush_msgs.noticeDismiss,tooltip:window.wp_smush_msgs.noticeDismissTooltip},autoclose:{show:!1}};window.SUI.openNotice("wp-smush-ajax-notice",s,i)}},maybeShowDeleteAllSuccessNotice:function(){if(document.getElementById("wp-smush-webp-delete-all-notice")){var e="<p>".concat(document.getElementById("wp-smush-webp-delete-all-notice").dataset.message,"</p>");window.SUI.openNotice("wp-smush-webp-delete-all-notice",e,{type:"success",icon:"check-tick",dismiss:{show:!0}})}}},WP_Smush.WebP.init()}()},5445:function(e,t,s){var i,n,o;n=[s(5311),s(3860)],i=function(e){"use strict";if(!e.ui||!e.ui.fancytree){var t,s,i=null,n=new RegExp(/\.|\//),o=/[&<>"'/]/g,a=/[<>"'/]/g,r="$recursive_request",u="$request_target_invalid",d={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},l={16:!0,17:!0,18:!0},c={8:"backspace",9:"tab",10:"return",13:"return",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",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:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},h={16:"shift",17:"ctrl",18:"alt",91:"meta",93:"meta"},p={0:"",1:"left",2:"middle",3:"right"},m="active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore".split(" "),f={},g="columns types".split(" "),v="checkbox expanded extraClasses folder icon iconTooltip key lazy partsel radiogroup refKey selected statusNodeType title tooltip type unselectable unselectableIgnore unselectableStatus".split(" "),_={},w={},y={active:!0,children:!0,data:!0,focus:!0};for(t=0;t<m.length;t++)f[m[t]]=!0;for(t=0;t<v.length;t++)s=v[t],_[s]=!0,s!==s.toLowerCase()&&(w[s.toLowerCase()]=s);var b=Array.isArray;return k(e.ui,"Fancytree requires jQuery UI (http://jqueryui.com)"),Date.now||(Date.now=function(){return(new Date).getTime()}),A.prototype={_findDirectChild:function(e){var t,s,i=this.children;if(i)if("string"==typeof e){for(t=0,s=i.length;t<s;t++)if(i[t].key===e)return i[t]}else{if("number"==typeof e)return this.children[e];if(e.parent===this)return e}return null},_setChildren:function(e){k(e&&(!this.children||0===this.children.length),"only init supported"),this.children=[];for(var t=0,s=e.length;t<s;t++)this.children.push(new A(this,e[t]));this.tree._callHook("treeStructureChanged",this.tree,"setChildren")},addChildren:function(t,s){var i,n,o,a=this.getFirstChild(),r=this.getLastChild(),u=null,d=[];for(e.isPlainObject(t)&&(t=[t]),this.children||(this.children=[]),i=0,n=t.length;i<n;i++)d.push(new A(this,t[i]));if(u=d[0],null==s?this.children=this.children.concat(d):(s=this._findDirectChild(s),k((o=e.inArray(s,this.children))>=0,"insertBefore must be an existing child"),this.children.splice.apply(this.children,[o,0].concat(d))),a&&!s){for(i=0,n=d.length;i<n;i++)d[i].render();a!==this.getFirstChild()&&a.renderStatus(),r!==this.getLastChild()&&r.renderStatus()}else(!this.parent||this.parent.ul||this.tr)&&this.render();return 3===this.tree.options.selectMode&&this.fixSelection3FromEndNodes(),this.triggerModifyChild("add",1===d.length?d[0]:null),u},addClass:function(e){return this.toggleClass(e,!0)},addNode:function(e,t){switch(void 0!==t&&"over"!==t||(t="child"),t){case"after":return this.getParent().addChildren(e,this.getNextSibling());case"before":return this.getParent().addChildren(e,this);case"firstChild":var s=this.children?this.children[0]:null;return this.addChildren(e,s);case"child":case"over":return this.addChildren(e)}k(!1,"Invalid mode: "+t)},addPagingNode:function(t,s){var i,n;if(s=s||"child",!1!==t)return t=e.extend({title:this.tree.options.strings.moreData,statusNodeType:"paging",icon:!1},t),this.partload=!0,this.addNode(t,s);for(i=this.children.length-1;i>=0;i--)"paging"===(n=this.children[i]).statusNodeType&&this.removeChild(n);this.partload=!1},appendSibling:function(e){return this.addNode(e,"after")},applyCommand:function(e,t){return this.tree.applyCommand(e,this,t)},applyPatch:function(e){if(null===e)return this.remove(),L(this);var t,s,i={children:!0,expanded:!0,parent:!0};for(t in e)x(e,t)&&(s=e[t],i[t]||S(s)||(_[t]?this[t]=s:this.data[t]=s));return x(e,"children")&&(this.removeChildren(),e.children&&this._setChildren(e.children)),this.isVisible()&&(this.renderTitle(),this.renderStatus()),x(e,"expanded")?this.setExpanded(e.expanded):L(this)},collapseSiblings:function(){return this.tree._callHook("nodeCollapseSiblings",this)},copyTo:function(e,t,s){return e.addNode(this.toDict(!0,s),t)},countChildren:function(e){var t,s,i,n=this.children;if(!n)return 0;if(i=n.length,!1!==e)for(t=0,s=i;t<s;t++)i+=n[t].countChildren();return i},debug:function(e){this.tree.options.debugLevel>=4&&(Array.prototype.unshift.call(arguments,this.toString()),N("log",arguments))},discard:function(){return this.warn("FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead."),this.resetLazy()},discardMarkup:function(e){var t=e?"nodeRemoveMarkup":"nodeRemoveChildMarkup";this.tree._callHook(t,this)},error:function(e){this.tree.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),N("error",arguments))},findAll:function(e){e=S(e)?e:R(e);var t=[];return this.visit((function(s){e(s)&&t.push(s)})),t},findFirst:function(e){e=S(e)?e:R(e);var t=null;return this.visit((function(s){if(e(s))return t=s,!1})),t},findRelatedNode:function(e,t){return this.tree.findRelatedNode(this,e,t)},_changeSelectStatusAttrs:function(e){var t=!1,s=this.tree.options,n=i.evalOption("unselectable",this,this,s,!1),o=i.evalOption("unselectableStatus",this,this,s,void 0);switch(n&&null!=o&&(e=o),e){case!1:t=this.selected||this.partsel,this.selected=!1,this.partsel=!1;break;case!0:t=!this.selected||!this.partsel,this.selected=!0,this.partsel=!0;break;case void 0:t=this.selected||!this.partsel,this.selected=!1,this.partsel=!0;break;default:k(!1,"invalid state: "+e)}return t&&this.renderStatus(),t},fixSelection3AfterClick:function(e){var t=this.isSelected();this.visit((function(e){if(e._changeSelectStatusAttrs(t),e.radiogroup)return"skip"})),this.fixSelection3FromEndNodes(e)},fixSelection3FromEndNodes:function(e){var t=this.tree.options;function s(e){var n,o,a,r,u,d,l,c,h=e.children;if(h&&h.length){for(d=!0,l=!1,n=0,o=h.length;n<o;n++)r=s(a=h[n]),i.evalOption("unselectableIgnore",a,a,t,!1)||(!1!==r&&(l=!0),!0!==r&&(d=!1));u=!!d||!!l&&void 0}else u=null==(c=i.evalOption("unselectableStatus",e,e,t,void 0))?!!e.selected:!!c;return e.partsel&&!e.selected&&e.lazy&&null==e.children&&(u=void 0),e._changeSelectStatusAttrs(u),u}k(3===t.selectMode,"expected selectMode 3"),s(this),this.visitParents((function(e){var s,n,o,a,r,u=e.children,d=!0,l=!1;for(s=0,n=u.length;s<n;s++)o=u[s],i.evalOption("unselectableIgnore",o,o,t,!1)||(((a=null==(r=i.evalOption("unselectableStatus",o,o,t,void 0))?!!o.selected:!!r)||o.partsel)&&(l=!0),a||(d=!1));a=!!d||!!l&&void 0,e._changeSelectStatusAttrs(a)}))},fromDict:function(t){for(var s in t)_[s]?this[s]=t[s]:"data"===s?e.extend(this.data,t.data):S(t[s])||y[s]||(this.data[s]=t[s]);t.children&&(this.removeChildren(),this.addChildren(t.children)),this.renderTitle()},getChildren:function(){if(void 0!==this.hasChildren())return this.children},getFirstChild:function(){return this.children?this.children[0]:null},getIndex:function(){return e.inArray(this,this.parent.children)},getIndexHier:function(t,s){t=t||".";var i,n=[];return e.each(this.getParentList(!1,!0),(function(e,t){i=""+(t.getIndex()+1),s&&(i=("0000000"+i).substr(-s)),n.push(i)})),n.join(t)},getKeyPath:function(e){var t=this.tree.options.keyPathSeparator;return t+this.getPath(!e,"key",t)},getLastChild:function(){return this.children?this.children[this.children.length-1]:null},getLevel:function(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e},getNextSibling:function(){if(this.parent){var e,t,s=this.parent.children;for(e=0,t=s.length-1;e<t;e++)if(s[e]===this)return s[e+1]}return null},getParent:function(){return this.parent},getParentList:function(e,t){for(var s=[],i=t?this:this.parent;i;)(e||i.parent)&&s.unshift(i),i=i.parent;return s},getPath:function(e,t,s){e=!1!==e,s=s||"/";var i,n=[],o=S(t=t||"title");return this.visitParents((function(e){e.parent&&(i=o?t(e):e[t],n.unshift(i))}),e),n.join(s)},getPrevSibling:function(){if(this.parent){var e,t,s=this.parent.children;for(e=1,t=s.length;e<t;e++)if(s[e]===this)return s[e-1]}return null},getSelectedNodes:function(e){var t=[];return this.visit((function(s){if(s.selected&&(t.push(s),!0===e))return"skip"})),t},hasChildren:function(){if(this.lazy){if(null==this.children)return;if(0===this.children.length)return!1;if(1===this.children.length&&this.children[0].isStatusNode())return;return!0}return!(!this.children||!this.children.length)},hasClass:function(e){return(" "+(this.extraClasses||"")+" ").indexOf(" "+e+" ")>=0},hasFocus:function(){return this.tree.hasFocus()&&this.tree.focusNode===this},info:function(e){this.tree.options.debugLevel>=3&&(Array.prototype.unshift.call(arguments,this.toString()),N("info",arguments))},isActive:function(){return this.tree.activeNode===this},isBelowOf:function(e){return this.getIndexHier(".",5)>e.getIndexHier(".",5)},isChildOf:function(e){return this.parent&&this.parent===e},isDescendantOf:function(t){if(!t||t.tree!==this.tree)return!1;for(var s=this.parent;s;){if(s===t)return!0;s===s.parent&&e.error("Recursive parent link: "+s),s=s.parent}return!1},isExpanded:function(){return!!this.expanded},isFirstSibling:function(){var e=this.parent;return!e||e.children[0]===this},isFolder:function(){return!!this.folder},isLastSibling:function(){var e=this.parent;return!e||e.children[e.children.length-1]===this},isLazy:function(){return!!this.lazy},isLoaded:function(){return!this.lazy||void 0!==this.hasChildren()},isLoading:function(){return!!this._isLoading},isRoot:function(){return this.isRootNode()},isPartsel:function(){return!this.selected&&!!this.partsel},isPartload:function(){return!!this.partload},isRootNode:function(){return this.tree.rootNode===this},isSelected:function(){return!!this.selected},isStatusNode:function(){return!!this.statusNodeType},isPagingNode:function(){return"paging"===this.statusNodeType},isTopLevel:function(){return this.tree.rootNode===this.parent},isUndefined:function(){return void 0===this.hasChildren()},isVisible:function(){var e,t,s=this.tree.enableFilter,i=this.getParentList(!1,!1);if(s&&!this.match&&!this.subMatchCount)return!1;for(e=0,t=i.length;e<t;e++)if(!i[e].expanded)return!1;return!0},lazyLoad:function(t){e.error("FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead.")},load:function(e){var t,s,i=this,n=this.isExpanded();return k(this.isLazy(),"load() requires a lazy node"),e||this.isUndefined()?(this.isLoaded()&&this.resetLazy(),!1===(s=this.tree._triggerNodeEvent("lazyLoad",this))?L(this):(k("boolean"!=typeof s,"lazyLoad event must return source in data.result"),t=this.tree._callHook("nodeLoadChildren",this,s),n?(this.expanded=!0,t.always((function(){i.render()}))):t.always((function(){i.renderStatus()})),t)):L(this)},makeVisible:function(t){var s,i=this,n=[],o=new e.Deferred,a=this.getParentList(!1,!1),r=a.length,u=!(t&&!0===t.noAnimation),d=!(t&&!1===t.scrollIntoView);for(s=r-1;s>=0;s--)n.push(a[s].setExpanded(!0,t));return e.when.apply(e,n).done((function(){d?i.scrollIntoView(u).done((function(){o.resolve()})):o.resolve()})),o.promise()},moveTo:function(t,s,i){void 0===s||"over"===s?s="child":"firstChild"===s&&(t.children&&t.children.length?(s="before",t=t.children[0]):s="child");var n,o=this.tree,a=this.parent,r="child"===s?t:t.parent;if(this!==t){if(this.parent?r.isDescendantOf(this)&&e.error("Cannot move a node to its own descendant"):e.error("Cannot move system root"),r!==a&&a.triggerModifyChild("remove",this),1===this.parent.children.length){if(this.parent===r)return;this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1}else k((n=e.inArray(this,this.parent.children))>=0,"invalid source parent"),this.parent.children.splice(n,1);if(this.parent=r,r.hasChildren())switch(s){case"child":r.children.push(this);break;case"before":k((n=e.inArray(t,r.children))>=0,"invalid target parent"),r.children.splice(n,0,this);break;case"after":k((n=e.inArray(t,r.children))>=0,"invalid target parent"),r.children.splice(n+1,0,this);break;default:e.error("Invalid mode "+s)}else r.children=[this];i&&t.visit(i,!0),r===a?r.triggerModifyChild("move",this):r.triggerModifyChild("add",this),o!==t.tree&&(this.warn("Cross-tree moveTo is experimental!"),this.visit((function(e){e.tree=t.tree}),!0)),o._callHook("treeStructureChanged",o,"moveTo"),a.isDescendantOf(r)||a.render(),r.isDescendantOf(a)||r===a||r.render()}},navigate:function(t,s){var i,n=e.ui.keyCode;switch(t){case"left":case n.LEFT:if(this.expanded)return this.setExpanded(!1);break;case"right":case n.RIGHT:if(!this.expanded&&(this.children||this.lazy))return this.setExpanded()}if(i=this.findRelatedNode(t)){try{i.makeVisible({scrollIntoView:!1})}catch(e){}return!1===s?(i.setFocus(),L()):i.setActive()}return this.warn("Could not find related node '"+t+"'."),L()},remove:function(){return this.parent.removeChild(this)},removeChild:function(e){return this.tree._callHook("nodeRemoveChild",this,e)},removeChildren:function(){return this.tree._callHook("nodeRemoveChildren",this)},removeClass:function(e){return this.toggleClass(e,!1)},render:function(e,t){return this.tree._callHook("nodeRender",this,e,t)},renderTitle:function(){return this.tree._callHook("nodeRenderTitle",this)},renderStatus:function(){return this.tree._callHook("nodeRenderStatus",this)},replaceWith:function(s){var i,n=this.parent,o=e.inArray(this,n.children),a=this;return k(this.isPagingNode(),"replaceWith() currently requires a paging status node"),(i=this.tree._callHook("nodeLoadChildren",this,s)).done((function(e){var s=a.children;for(t=0;t<s.length;t++)s[t].parent=n;n.children.splice.apply(n.children,[o+1,0].concat(s)),a.children=null,a.remove(),n.render()})).fail((function(){a.setExpanded()})),i},resetLazy:function(){this.removeChildren(),this.expanded=!1,this.lazy=!0,this.children=void 0,this.renderStatus()},scheduleAction:function(t,s){this.tree.timer&&(clearTimeout(this.tree.timer),this.tree.debug("clearTimeout(%o)",this.tree.timer)),this.tree.timer=null;var i=this;switch(t){case"cancel":break;case"expand":this.tree.timer=setTimeout((function(){i.tree.debug("setTimeout: trigger expand"),i.setExpanded(!0)}),s);break;case"activate":this.tree.timer=setTimeout((function(){i.tree.debug("setTimeout: trigger activate"),i.setActive(!0)}),s);break;default:e.error("Invalid mode "+t)}},scrollIntoView:function(t,s){if(void 0!==s&&E(s))throw Error("scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' instead.");var i=e.extend({effects:!0===t?{duration:200,queue:!1}:t,scrollOfs:this.tree.options.scrollOfs,scrollParent:this.tree.options.scrollParent,topNode:null},s),n=i.scrollParent,o=this.tree.$container,a=o.css("overflow-y");n?n.jquery||(n=e(n)):n=this.tree.tbody?o.scrollParent():"scroll"===a||"auto"===a?o:o.scrollParent(),n[0]!==document&&n[0]!==document.body||(this.debug("scrollIntoView(): normalizing scrollParent to 'window':",n[0]),n=e(window));var r,u,d,l=new e.Deferred,c=this,h=e(this.span).height(),p=i.scrollOfs.top||0,m=i.scrollOfs.bottom||0,f=n.height(),g=n.scrollTop(),v=n,_=n[0]===window,w=i.topNode||null,y=null;return this.isRootNode()||!this.isVisible()?(this.info("scrollIntoView(): node is invisible."),L()):(_?(u=e(this.span).offset().top,r=w&&w.span?e(w.span).offset().top:0,v=e("html,body")):(k(n[0]!==document&&n[0]!==document.body,"scrollParent should be a simple element or `window`, not document or body."),d=n.offset().top,u=e(this.span).offset().top-d+g,r=w?e(w.span).offset().top-d+g:0,f-=Math.max(0,n.innerHeight()-n[0].clientHeight)),u<g+p?y=u-p:u+h>g+f-m&&(y=u+h-f+m,w&&(k(w.isRootNode()||w.isVisible(),"topNode must be visible"),r<y&&(y=r-p))),null===y?l.resolveWith(this):i.effects?(i.effects.complete=function(){l.resolveWith(c)},v.stop(!0).animate({scrollTop:y},i.effects)):(v[0].scrollTop=y,l.resolveWith(this)),l.promise())},setActive:function(e,t){return this.tree._callHook("nodeSetActive",this,e,t)},setExpanded:function(e,t){return this.tree._callHook("nodeSetExpanded",this,e,t)},setFocus:function(e){return this.tree._callHook("nodeSetFocus",this,e)},setSelected:function(e,t){return this.tree._callHook("nodeSetSelected",this,e,t)},setStatus:function(e,t,s){return this.tree._callHook("nodeSetStatus",this,e,t,s)},setTitle:function(e){this.title=e,this.renderTitle(),this.triggerModify("rename")},sortChildren:function(e,t){var s,i,n=this.children;if(n){if(e=e||function(e,t){var s=e.title.toLowerCase(),i=t.title.toLowerCase();return s===i?0:s>i?1:-1},n.sort(e),t)for(s=0,i=n.length;s<i;s++)n[s].children&&n[s].sortChildren(e,"$norender$");"$norender$"!==t&&this.render(),this.triggerModifyChild("sort")}},toDict:function(t,s){var i,n,o,a,r={},u=this;if(e.each(v,(function(e,t){(u[t]||!1===u[t])&&(r[t]=u[t])})),e.isEmptyObject(this.data)||(r.data=e.extend({},this.data),e.isEmptyObject(r.data)&&delete r.data),s){if(!1===(a=s(r,u)))return!1;"skip"===a&&(t=!1)}if(t&&b(this.children))for(r.children=[],i=0,n=this.children.length;i<n;i++)(o=this.children[i]).isStatusNode()||!1!==(a=o.toDict(!0,s))&&r.children.push(a);return r},toggleClass:function(t,s){var i,n,o=/\S+/g,a=t.match(o)||[],r=0,u=!1,d=this[this.tree.statusClassPropName],l=" "+(this.extraClasses||"")+" ";for(d&&e(d).toggleClass(t,s);i=a[r++];)if(n=l.indexOf(" "+i+" ")>=0,s=void 0===s?!n:!!s)n||(l+=i+" ",u=!0);else for(;l.indexOf(" "+i+" ")>-1;)l=l.replace(" "+i+" "," ");return this.extraClasses=C(l),u},toggleExpanded:function(){return this.tree._callHook("nodeToggleExpanded",this)},toggleSelected:function(){return this.tree._callHook("nodeToggleSelected",this)},toString:function(){return"FancytreeNode@"+this.key+"[title='"+this.title+"']"},triggerModifyChild:function(t,s,i){var n,o=this.tree.options.modifyChild;o&&(s&&s.parent!==this&&e.error("childNode "+s+" is not a child of "+this),n={node:this,tree:this.tree,operation:t,childNode:s||null},i&&e.extend(n,i),o({type:"modifyChild"},n))},triggerModify:function(e,t){this.parent.triggerModifyChild(e,this,t)},visit:function(e,t){var s,i,n=!0,o=this.children;if(!0===t&&(!1===(n=e(this))||"skip"===n))return n;if(o)for(s=0,i=o.length;s<i&&!1!==(n=o[s].visit(e,!0));s++);return n},visitAndLoad:function(t,s,i){var n,o,a,r=this;return!t||!0!==s||!1!==(o=t(r))&&"skip"!==o?r.children||r.lazy?(n=new e.Deferred,a=[],r.load().done((function(){for(var s=0,i=r.children.length;s<i;s++){if(!1===(o=r.children[s].visitAndLoad(t,!0,!0))){n.reject();break}"skip"!==o&&a.push(o)}e.when.apply(this,a).then((function(){n.resolve()}))})),n.promise()):L():i?o:L()},visitParents:function(e,t){if(t&&!1===e(this))return!1;for(var s=this.parent;s;){if(!1===e(s))return!1;s=s.parent}return!0},visitSiblings:function(e,t){var s,i,n,o=this.parent.children;for(s=0,i=o.length;s<i;s++)if(n=o[s],(t||n!==this)&&!1===e(n))return!1;return!0},warn:function(e){this.tree.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),N("warn",arguments))}},B.prototype={_makeHookContext:function(t,s,i){var n,o;return void 0!==t.node?(s&&t.originalEvent!==s&&e.error("invalid args"),n=t):t.tree?n={node:t,tree:o=t.tree,widget:o.widget,options:o.widget.options,originalEvent:s,typeInfo:o.types[t.type]||{}}:t.widget?n={node:null,tree:t,widget:t.widget,options:t.widget.options,originalEvent:s}:e.error("invalid args"),i&&e.extend(n,i),n},_callHook:function(t,s,i){var n=this._makeHookContext(s),o=this[t],a=Array.prototype.slice.call(arguments,2);return S(o)||e.error("_callHook('"+t+"') is not a function"),a.unshift(n),o.apply(this,a)},_setExpiringValue:function(e,t,s){this._tempCache[e]={value:t,expire:Date.now()+(+s||50)}},_getExpiringValue:function(e){var t=this._tempCache[e];return t&&t.expire>Date.now()?t.value:(delete this._tempCache[e],null)},_usesExtension:function(t){return e.inArray(t,this.options.extensions)>=0},_requireExtension:function(t,s,i,n){null!=i&&(i=!!i);var o=this._local.name,a=this.options.extensions,r=e.inArray(t,a)<e.inArray(o,a),u=s&&null==this.ext[t],d=!u&&null!=i&&i!==r;return k(o&&o!==t,"invalid or same name '"+o+"' (require yourself?)"),!u&&!d||(n||(u||s?(n="'"+o+"' extension requires '"+t+"'",d&&(n+=" to be registered "+(i?"before":"after")+" itself")):n="If used together, `"+t+"` must be registered "+(i?"before":"after")+" `"+o+"`"),e.error(n),!1)},activateKey:function(e,t){var s=this.getNodeByKey(e);return s?s.setActive(!0,t):this.activeNode&&this.activeNode.setActive(!1,t),s},addPagingNode:function(e,t){return this.rootNode.addPagingNode(e,t)},applyCommand:function(t,s,i){var n;switch(s=s||this.getActiveNode(),t){case"moveUp":(n=s.getPrevSibling())&&(s.moveTo(n,"before"),s.setActive());break;case"moveDown":(n=s.getNextSibling())&&(s.moveTo(n,"after"),s.setActive());break;case"indent":(n=s.getPrevSibling())&&(s.moveTo(n,"child"),n.setExpanded(),s.setActive());break;case"outdent":s.isTopLevel()||(s.moveTo(s.getParent(),"after"),s.setActive());break;case"remove":n=s.getPrevSibling()||s.getParent(),s.remove(),n&&n.setActive();break;case"addChild":s.editCreateNode("child","");break;case"addSibling":s.editCreateNode("after","");break;case"rename":s.editStart();break;case"down":case"first":case"last":case"left":case"parent":case"right":case"up":return s.navigate(t);default:e.error("Unhandled command: '"+t+"'")}},applyPatch:function(t){var s,i,n,o,a,r,u=t.length,d=[];for(i=0;i<u;i++)k(2===(n=t[i]).length,"patchList must be an array of length-2-arrays"),o=n[0],a=n[1],(r=null===o?this.rootNode:this.getNodeByKey(o))?(s=new e.Deferred,d.push(s),r.applyPatch(a).always(D(s,r))):this.warn("could not find node with key '"+o+"'");return e.when.apply(e,d).promise()},clear:function(e){this._callHook("treeClear",this)},count:function(){return this.rootNode.countChildren()},debug:function(e){this.options.debugLevel>=4&&(Array.prototype.unshift.call(arguments,this.toString()),N("log",arguments))},destroy:function(){this.widget.destroy()},enable:function(e){!1===e?this.widget.disable():this.widget.enable()},enableUpdate:function(e){return e=!1!==e,!!this._enableUpdate==!!e?e:(this._enableUpdate=e,e?(this.debug("enableUpdate(true): redraw "),this._callHook("treeStructureChanged",this,"enableUpdate"),this.render()):this.debug("enableUpdate(false)..."),!e)},error:function(e){this.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),N("error",arguments))},expandAll:function(e,t){var s=this.enableUpdate(!1);e=!1!==e,this.visit((function(s){!1!==s.hasChildren()&&s.isExpanded()!==e&&s.setExpanded(e,t)})),this.enableUpdate(s)},findAll:function(e){return this.rootNode.findAll(e)},findFirst:function(e){return this.rootNode.findFirst(e)},findNextNode:function(e,t){var s=null,i=this.getFirstChild();function n(i){if(e(i)&&(s=i),s||i===t)return!1}return e="string"==typeof e?O(e):e,t=t||i,this.visitRows(n,{start:t,includeSelf:!1}),s||t===i||this.visitRows(n,{start:i,includeSelf:!0}),s},findRelatedNode:function(t,s,i){var n=null,o=e.ui.keyCode;switch(s){case"parent":case o.BACKSPACE:t.parent&&t.parent.parent&&(n=t.parent);break;case"first":case o.HOME:this.visit((function(e){if(e.isVisible())return n=e,!1}));break;case"last":case o.END:this.visit((function(e){e.isVisible()&&(n=e)}));break;case"left":case o.LEFT:t.expanded?t.setExpanded(!1):t.parent&&t.parent.parent&&(n=t.parent);break;case"right":case o.RIGHT:t.expanded||!t.children&&!t.lazy?t.children&&t.children.length&&(n=t.children[0]):(t.setExpanded(),n=t);break;case"up":case o.UP:this.visitRows((function(e){return n=e,!1}),{start:t,reverse:!0,includeSelf:!1});break;case"down":case o.DOWN:this.visitRows((function(e){return n=e,!1}),{start:t,includeSelf:!1});break;default:this.tree.warn("Unknown relation '"+s+"'.")}return n},generateFormElements:function(t,s,i){i=i||{};var n,o="string"==typeof t?t:"ft_"+this._id+"[]",a="string"==typeof s?s:"ft_"+this._id+"_active",r="fancytree_result_"+this._id,u=e("#"+r),d=3===this.options.selectMode&&!1!==i.stopOnParents;function l(t){u.append(e("<input>",{type:"checkbox",name:o,value:t.key,checked:!0}))}u.length?u.empty():u=e("<div>",{id:r}).hide().insertAfter(this.$container),!1!==s&&this.activeNode&&u.append(e("<input>",{type:"radio",name:a,value:this.activeNode.key,checked:!0})),i.filter?this.visit((function(e){var t=i.filter(e);if("skip"===t)return t;!1!==t&&l(e)})):!1!==t&&(n=this.getSelectedNodes(d),e.each(n,(function(e,t){l(t)})))},getActiveNode:function(){return this.activeNode},getFirstChild:function(){return this.rootNode.getFirstChild()},getFocusNode:function(){return this.focusNode},getOption:function(e){return this.widget.option(e)},getNodeByKey:function(e,t){var s,i;return!t&&(s=document.getElementById(this.options.idPrefix+e))?s.ftnode?s.ftnode:null:(t=t||this.rootNode,i=null,e=""+e,t.visit((function(t){if(t.key===e)return i=t,!1}),!0),i)},getRootNode:function(){return this.rootNode},getSelectedNodes:function(e){return this.rootNode.getSelectedNodes(e)},hasFocus:function(){return!!this._hasFocus},info:function(e){this.options.debugLevel>=3&&(Array.prototype.unshift.call(arguments,this.toString()),N("info",arguments))},isLoading:function(){var e=!1;return this.rootNode.visit((function(t){if(t._isLoading||t._requestId)return e=!0,!1}),!0),e},loadKeyPath:function(t,s){var i,n,o,a=this,r=new e.Deferred,u=this.getRootNode(),d=this.options.keyPathSeparator,l=[],c=e.extend({},s);for("function"==typeof s?i=s:s&&s.callback&&(i=s.callback),c.callback=function(e,t,s){i&&i.call(e,t,s),r.notifyWith(e,[{node:t,status:s}])},null==c.matchKey&&(c.matchKey=function(e,t){return e.key===t}),b(t)||(t=[t]),n=0;n<t.length;n++)(o=t[n]).charAt(0)===d&&(o=o.substr(1)),l.push(o.split(d));return setTimeout((function(){a._loadKeyPathImpl(r,c,u,l).done((function(){r.resolve()}))}),0),r.promise()},_loadKeyPathImpl:function(t,s,i,n){var o,a,r,u,d,l,c,h,p,m,f=this;function g(e,t){var i,n,o=e.children;if(o)for(i=0,n=o.length;i<n;i++)if(s.matchKey(o[i],t))return o[i];return null}for(c={},a=0;a<n.length;a++)for(p=n[a],h=i;p.length;){if(r=p.shift(),!(u=g(h,r))){this.warn("loadKeyPath: key not found: "+r+" (parent: "+h+")"),s.callback(this,r,"error");break}if(0===p.length){s.callback(this,u,"ok");break}if(u.lazy&&void 0===u.hasChildren()){s.callback(this,u,"loaded"),c[r=u.key]?c[r].pathSegList.push(p):c[r]={parent:u,pathSegList:[p]};break}s.callback(this,u,"loaded"),h=u}function v(e,t,i){s.callback(f,t,"loading"),t.load().done((function(){f._loadKeyPathImpl.call(f,e,s,t,i).always(D(e,f))})).fail((function(i){f.warn("loadKeyPath: error loading lazy "+t),s.callback(f,u,"error"),e.rejectWith(f)}))}for(d in o=[],c)x(c,d)&&(l=c[d],m=new e.Deferred,o.push(m),v(m,l.parent,l.pathSegList));return e.when.apply(e,o).promise()},reactivate:function(e){var t,s=this.activeNode;return s?(this.activeNode=null,t=s.setActive(!0,{noFocus:!0}),e&&s.setFocus(),t):L()},reload:function(e){return this._callHook("treeClear",this),this._callHook("treeLoad",this,e)},render:function(e,t){return this.rootNode.render(e,t)},selectAll:function(e){this.visit((function(t){t.setSelected(e)}))},setFocus:function(e){return this._callHook("treeSetFocus",this,e)},setOption:function(e,t){return this.widget.option(e,t)},debugTime:function(e){this.options.debugLevel>=4&&window.console.time(this+" - "+e)},debugTimeEnd:function(e){this.options.debugLevel>=4&&window.console.timeEnd(this+" - "+e)},toDict:function(e,t){var s=this.rootNode.toDict(!0,t);return e?s:s.children},toString:function(){return"Fancytree@"+this._id},_triggerNodeEvent:function(e,t,s,i){var n=this._makeHookContext(t,s,i),o=this.widget._trigger(e,s,n);return!1!==o&&void 0!==n.result?n.result:o},_triggerTreeEvent:function(e,t,s){var i=this._makeHookContext(this,t,s),n=this.widget._trigger(e,t,i);return!1!==n&&void 0!==i.result?i.result:n},visit:function(e){return this.rootNode.visit(e,!1)},visitRows:function(e,t){if(!this.rootNode.hasChildren())return!1;if(t&&t.reverse)return delete t.reverse,this._visitRowsUp(e,t);var s,i,n,o,a=0,r=!1===(t=t||{}).includeSelf,u=!!t.includeHidden,d=!u&&this.enableFilter,l=t.start||this.rootNode.children[0];for(n=l.parent;n;){for(k((i=(o=n.children).indexOf(l)+a)>=0,"Could not find "+l+" in parent's children: "+n),s=i;s<o.length;s++)if(l=o[s],!d||l.match||l.subMatchCount){if(!r&&!1===e(l))return!1;if(r=!1,l.children&&l.children.length&&(u||l.expanded)&&!1===l.visit((function(t){return!d||t.match||t.subMatchCount?!1!==e(t)&&(u||!t.children||t.expanded?void 0:"skip"):"skip"}),!1))return!1}l=n,n=n.parent,a=1}return!0},_visitRowsUp:function(e,t){for(var s,i,n,o=!!t.includeHidden,a=t.start||this.rootNode.children[0];;){if((s=(n=a.parent).children)[0]===a){if(!(a=n).parent)break;s=n.children}else for(i=s.indexOf(a),a=s[i-1];(o||a.expanded)&&a.children&&a.children.length;)n=a,a=(s=a.children)[s.length-1];if((o||a.isVisible())&&!1===e(a))return!1}},warn:function(e){this.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),N("warn",arguments))}},e.extend(B.prototype,{nodeClick:function(e){var t,s,i=e.targetType,n=e.node;if("expander"===i){if(n.isLoading())return void n.debug("Got 2nd click while loading: ignored");this._callHook("nodeToggleExpanded",e)}else if("checkbox"===i)this._callHook("nodeToggleSelected",e),e.options.focusOnSelect&&this._callHook("nodeSetFocus",e,!0);else{if(s=!1,t=!0,n.folder)switch(e.options.clickFolderMode){case 2:s=!0,t=!1;break;case 3:t=!0,s=!0}t&&(this.nodeSetFocus(e),this._callHook("nodeSetActive",e,!0)),s&&this._callHook("nodeToggleExpanded",e)}},nodeCollapseSiblings:function(e,t){var s,i,n,o=e.node;if(o.parent)for(i=0,n=(s=o.parent.children).length;i<n;i++)s[i]!==o&&s[i].expanded&&this._callHook("nodeSetExpanded",s[i],!1,t)},nodeDblclick:function(e){"title"===e.targetType&&4===e.options.clickFolderMode&&this._callHook("nodeToggleExpanded",e),"title"===e.targetType&&e.originalEvent.preventDefault()},nodeKeydown:function(t){var s,n,o,a=t.originalEvent,r=t.node,u=t.tree,d=t.options,l=a.which,p=a.key||String.fromCharCode(l),m=!!(a.altKey||a.ctrlKey||a.metaKey),f=!h[l]&&!c[l]&&!m,g=e(a.target),v=!0,_=!(a.ctrlKey||!d.autoActivate);if(r||(o=this.getActiveNode()||this.getFirstChild())&&(o.setFocus(),(r=t.node=this.focusNode).debug("Keydown force focus on active node")),d.quicksearch&&f&&!g.is(":input:enabled"))return(n=Date.now())-u.lastQuicksearchTime>500&&(u.lastQuicksearchTerm=""),u.lastQuicksearchTime=n,u.lastQuicksearchTerm+=p,(s=u.findNextNode(u.lastQuicksearchTerm,u.getActiveNode()))&&s.setActive(),void a.preventDefault();switch(i.eventToString(a)){case"+":case"=":u.nodeSetExpanded(t,!0);break;case"-":u.nodeSetExpanded(t,!1);break;case"space":r.isPagingNode()?u._triggerNodeEvent("clickPaging",t,a):i.evalOption("checkbox",r,r,d,!1)?u.nodeToggleSelected(t):u.nodeSetActive(t,!0);break;case"return":u.nodeSetActive(t,!0);break;case"home":case"end":case"backspace":case"left":case"right":case"up":case"down":r.navigate(a.which,_);break;default:v=!1}v&&a.preventDefault()},nodeLoadChildren:function(t,s){var i,n,o,a=null,d=!0,l=t.tree,c=t.node,h=c.parent,p="nodeLoadChildren",m=Date.now();return S(s)&&k(!S(s=s.call(l,{type:"source"},t)),"source callback must not return another function"),S(s.then)?a=s:s.url?(i=e.extend({},t.options.ajax,s)).debugDelay?(n=i.debugDelay,delete i.debugDelay,b(n)&&(n=n[0]+Math.random()*(n[1]-n[0])),c.warn("nodeLoadChildren waiting debugDelay "+Math.round(n)+" ms ..."),a=e.Deferred((function(t){setTimeout((function(){e.ajax(i).done((function(){t.resolveWith(this,arguments)})).fail((function(){t.rejectWith(this,arguments)}))}),n)}))):a=e.ajax(i):e.isPlainObject(s)||b(s)?(a={then:function(e,t){e(s,null,null)}},d=!1):e.error("Invalid source type: "+s),c._requestId&&(c.warn("Recursive load request #"+m+" while #"+c._requestId+" is pending."),c._requestId=m),d&&(l.debugTime(p),l.nodeSetStatus(t,"loading")),o=new e.Deferred,a.then((function(i,n,a){var d,p;if("json"!==s.dataType&&"jsonp"!==s.dataType||"string"!=typeof i||e.error("Ajax request returned a string (did you get the JSON dataType wrong?)."),c._requestId&&c._requestId>m)o.rejectWith(this,[r]);else if(null!==c.parent||null===h){if(t.options.postProcess){try{(p=l._triggerNodeEvent("postProcess",t,t.originalEvent,{response:i,error:null,dataType:s.dataType})).error&&l.warn("postProcess returned error:",p)}catch(e){p={error:e,message:""+e,details:"postProcess failed"}}if(p.error)return d=e.isPlainObject(p.error)?p.error:{message:p.error},d=l._makeHookContext(c,null,d),void o.rejectWith(this,[d]);(b(p)||e.isPlainObject(p)&&b(p.children))&&(i=p)}else i&&x(i,"d")&&t.options.enableAspx&&(42===t.options.enableAspx&&l.warn("The default for enableAspx will change to `false` in the fututure. Pass `enableAspx: true` or implement postProcess to silence this warning."),i="string"==typeof i.d?e.parseJSON(i.d):i.d);o.resolveWith(this,[i])}else o.rejectWith(this,[u])}),(function(e,t,s){var i=l._makeHookContext(c,null,{error:e,args:Array.prototype.slice.call(arguments),message:s,details:e.status+": "+s});o.rejectWith(this,[i])})),o.done((function(s){var i,n,o;l.nodeSetStatus(t,"ok"),e.isPlainObject(s)?(k(c.isRootNode(),"source may only be an object for root nodes (expecting an array of child objects otherwise)"),k(b(s.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),n=s,i=s.children,delete n.children,e.each(g,(function(e,t){void 0!==n[t]&&(l[t]=n[t],delete n[t])})),e.extend(l.data,n)):i=s,k(b(i),"expected array of children"),c._setChildren(i),l.options.nodata&&0===i.length&&(S(l.options.nodata)?o=l.options.nodata.call(l,{type:"nodata"},t):!0===l.options.nodata&&c.isRootNode()?o=l.options.strings.noData:"string"==typeof l.options.nodata&&c.isRootNode()&&(o=l.options.nodata),o&&c.setStatus("nodata",o)),l._triggerNodeEvent("loadChildren",c)})).fail((function(e){var s;e!==r?e!==u?(e.node&&e.error&&e.message?s=e:"[object Object]"===(s=l._makeHookContext(c,null,{error:e,args:Array.prototype.slice.call(arguments),message:e?e.message||e.toString():""})).message&&(s.message=""),c.warn("Load children failed ("+s.message+")",s),!1!==l._triggerNodeEvent("loadError",s,null)&&l.nodeSetStatus(t,"error",s.message,s.details)):c.warn("Lazy parent node was removed while loading: discarding response."):c.warn("Ignored response for obsolete load request #"+m+" (expected #"+c._requestId+")")})).always((function(){c._requestId=null,d&&l.debugTimeEnd(p)})),o.promise()},nodeLoadKeyPath:function(e,t){},nodeRemoveChild:function(t,s){var i,n=t.node,o=e.extend({},t,{node:s}),a=n.children;if(1===a.length)return k(s===a[0],"invalid single child"),this.nodeRemoveChildren(t);this.activeNode&&(s===this.activeNode||this.activeNode.isDescendantOf(s))&&this.activeNode.setActive(!1),this.focusNode&&(s===this.focusNode||this.focusNode.isDescendantOf(s))&&(this.focusNode=null),this.nodeRemoveMarkup(o),this.nodeRemoveChildren(o),k((i=e.inArray(s,a))>=0,"invalid child"),n.triggerModifyChild("remove",s),s.visit((function(e){e.parent=null}),!0),this._callHook("treeRegisterNode",this,!1,s),a.splice(i,1)},nodeRemoveChildMarkup:function(t){var s=t.node;s.ul&&(s.isRootNode()?e(s.ul).empty():(e(s.ul).remove(),s.ul=null),s.visit((function(e){e.li=e.ul=null})))},nodeRemoveChildren:function(e){var t=e.tree,s=e.node;s.children&&(this.activeNode&&this.activeNode.isDescendantOf(s)&&this.activeNode.setActive(!1),this.focusNode&&this.focusNode.isDescendantOf(s)&&(this.focusNode=null),this.nodeRemoveChildMarkup(e),s.triggerModifyChild("remove",null),s.visit((function(e){e.parent=null,t._callHook("treeRegisterNode",t,!1,e)})),s.lazy?s.children=[]:s.children=null,s.isRootNode()||(s.expanded=!1),this.nodeRenderStatus(e))},nodeRemoveMarkup:function(t){var s=t.node;s.li&&(e(s.li).remove(),s.li=null),this.nodeRemoveChildMarkup(t)},nodeRender:function(t,s,i,n,o){var a,r,u,d,l,c,h,p=t.node,m=t.tree,f=t.options,g=f.aria,v=!1,_=p.parent,w=!_,y=p.children,b=null;if(!1!==m._enableUpdate&&(w||_.ul)){if(k(w||_.ul,"parent UL must exist"),w||(p.li&&(s||p.li.parentNode!==p.parent.ul)&&(p.li.parentNode===p.parent.ul?b=p.li.nextSibling:this.debug("Unlinking "+p+" (must be child of "+p.parent+")"),this.nodeRemoveMarkup(t)),p.li?this.nodeRenderStatus(t):(v=!0,p.li=document.createElement("li"),p.li.ftnode=p,p.key&&f.generateIds&&(p.li.id=f.idPrefix+p.key),p.span=document.createElement("span"),p.span.className="fancytree-node",g&&!p.tr&&e(p.li).attr("role","treeitem"),p.li.appendChild(p.span),this.nodeRenderTitle(t),f.createNode&&f.createNode.call(m,{type:"createNode"},t)),f.renderNode&&f.renderNode.call(m,{type:"renderNode"},t)),y){if(w||p.expanded||!0===i){for(p.ul||(p.ul=document.createElement("ul"),(!0!==n||o)&&p.expanded||(p.ul.style.display="none"),g&&e(p.ul).attr("role","group"),p.li?p.li.appendChild(p.ul):p.tree.$div.append(p.ul)),d=0,l=y.length;d<l;d++)h=e.extend({},t,{node:y[d]}),this.nodeRender(h,s,i,!1,!0);for(a=p.ul.firstChild;a;)(u=a.ftnode)&&u.parent!==p?(p.debug("_fixParent: remove missing "+u,a),c=a.nextSibling,a.parentNode.removeChild(a),a=c):a=a.nextSibling;for(a=p.ul.firstChild,d=0,l=y.length-1;d<l;d++)(r=y[d])===(u=a.ftnode)?a=a.nextSibling:p.ul.insertBefore(r.li,u.li)}}else p.ul&&(this.warn("remove child markup for "+p),this.nodeRemoveChildMarkup(t));w||v&&_.ul.insertBefore(p.li,b)}},nodeRenderTitle:function(t,s){var o,a,r,u,d,l,c,h=t.node,p=t.tree,m=t.options,f=m.aria,g=h.getLevel(),v=[];void 0!==s&&(h.title=s),h.span&&!1!==p._enableUpdate&&(d=f&&!1!==h.hasChildren()?" role='button'":"",g<m.minExpandLevel?(h.lazy||(h.expanded=!0),g>1&&v.push("<span "+d+" class='fancytree-expander fancytree-expander-fixed'></span>")):v.push("<span "+d+" class='fancytree-expander'></span>"),(o=i.evalOption("checkbox",h,h,m,!1))&&!h.isStatusNode()&&(d=f?" role='checkbox'":"",a="fancytree-checkbox",("radio"===o||h.parent&&h.parent.radiogroup)&&(a+=" fancytree-radio"),v.push("<span "+d+" class='"+a+"'></span>")),void 0!==h.data.iconClass&&(h.icon?e.error("'iconClass' node option is deprecated since v2.14.0: use 'icon' only instead"):(h.warn("'iconClass' node option is deprecated since v2.14.0: use 'icon' instead"),h.icon=h.data.iconClass)),!1!==(r=i.evalOption("icon",h,h,m,!0))&&(d=f?" role='presentation'":"",c=(c=i.evalOption("iconTooltip",h,h,m,null))?" title='"+W(c)+"'":"","string"==typeof r?n.test(r)?(r="/"===r.charAt(0)?r:(m.imagePath||"")+r,v.push("<img src='"+r+"' class='fancytree-icon'"+c+" alt='' />")):v.push("<span "+d+" class='fancytree-custom-icon "+r+"'"+c+"></span>"):r.text?v.push("<span "+d+" class='fancytree-custom-icon "+(r.addClass||"")+"'"+c+">"+i.escapeHtml(r.text)+"</span>"):r.html?v.push("<span "+d+" class='fancytree-custom-icon "+(r.addClass||"")+"'"+c+">"+r.html+"</span>"):v.push("<span "+d+" class='fancytree-icon'"+c+"></span>")),u="",m.renderTitle&&(u=m.renderTitle.call(p,{type:"renderTitle"},t)||""),u||(!0===(l=i.evalOption("tooltip",h,h,m,null))&&(l=h.title),u="<span class='fancytree-title'"+(l=l?" title='"+W(l)+"'":"")+(m.titlesTabbable?" tabindex='0'":"")+">"+(m.escapeTitles?i.escapeHtml(h.title):h.title)+"</span>"),v.push(u),h.span.innerHTML=v.join(""),this.nodeRenderStatus(t),m.enhanceTitle&&(t.$title=e(">span.fancytree-title",h.span),u=m.enhanceTitle.call(p,{type:"enhanceTitle"},t)||""))},nodeRenderStatus:function(t){var s,n=t.node,o=t.tree,a=t.options,r=n.hasChildren(),u=n.isLastSibling(),d=a.aria,l=a._classNames,c=[],h=n[o.statusClassPropName];h&&!1!==o._enableUpdate&&(d&&(s=e(n.tr||n.li)),c.push(l.node),o.activeNode===n&&c.push(l.active),o.focusNode===n&&c.push(l.focused),n.expanded&&c.push(l.expanded),d&&(!1===r?s.removeAttr("aria-expanded"):s.attr("aria-expanded",Boolean(n.expanded))),n.folder&&c.push(l.folder),!1!==r&&c.push(l.hasChildren),u&&c.push(l.lastsib),n.lazy&&null==n.children&&c.push(l.lazy),n.partload&&c.push(l.partload),n.partsel&&c.push(l.partsel),i.evalOption("unselectable",n,n,a,!1)&&c.push(l.unselectable),n._isLoading&&c.push(l.loading),n._error&&c.push(l.error),n.statusNodeType&&c.push(l.statusNodePrefix+n.statusNodeType),n.selected?(c.push(l.selected),d&&s.attr("aria-selected",!0)):d&&s.attr("aria-selected",!1),n.extraClasses&&c.push(n.extraClasses),!1===r?c.push(l.combinedExpanderPrefix+"n"+(u?"l":"")):c.push(l.combinedExpanderPrefix+(n.expanded?"e":"c")+(n.lazy&&null==n.children?"d":"")+(u?"l":"")),c.push(l.combinedIconPrefix+(n.expanded?"e":"c")+(n.folder?"f":"")),h.className=c.join(" "),n.li&&e(n.li).toggleClass(l.lastsib,u))},nodeSetActive:function(t,s,i){i=i||{};var n,o=t.node,a=t.tree,r=t.options,u=!0===i.noEvents,d=!0===i.noFocus,l=!1!==i.scrollIntoView;return o===a.activeNode==(s=!1!==s)?L(o):(l&&t.originalEvent&&e(t.originalEvent.target).is("a,:checkbox")&&(o.info("Not scrolling while clicking an embedded link."),l=!1),s&&!u&&!1===this._triggerNodeEvent("beforeActivate",o,t.originalEvent)?P(o,["rejected"]):(s?(a.activeNode&&(k(a.activeNode!==o,"node was active (inconsistency)"),n=e.extend({},t,{node:a.activeNode}),a.nodeSetActive(n,!1),k(null===a.activeNode,"deactivate was out of sync?")),r.activeVisible&&o.makeVisible({scrollIntoView:l}),a.activeNode=o,a.nodeRenderStatus(t),d||a.nodeSetFocus(t),u||a._triggerNodeEvent("activate",o,t.originalEvent)):(k(a.activeNode===o,"node was not active (inconsistency)"),a.activeNode=null,this.nodeRenderStatus(t),u||t.tree._triggerNodeEvent("deactivate",o,t.originalEvent)),L(o)))},nodeSetExpanded:function(t,s,i){i=i||{};var n,o,a,r,u,d,l=t.node,c=t.tree,h=t.options,p=!0===i.noAnimation,m=!0===i.noEvents;if(s=!1!==s,e(l.li).hasClass(h._classNames.animating))return l.warn("setExpanded("+s+") while animating: ignored."),P(l,["recursion"]);if(l.expanded&&s||!l.expanded&&!s)return L(l);if(s&&!l.lazy&&!l.hasChildren())return L(l);if(!s&&l.getLevel()<h.minExpandLevel)return P(l,["locked"]);if(!m&&!1===this._triggerNodeEvent("beforeExpand",l,t.originalEvent))return P(l,["rejected"]);if(p||l.isVisible()||(p=i.noAnimation=!0),o=new e.Deferred,s&&!l.expanded&&h.autoCollapse){u=l.getParentList(!1,!0),d=h.autoCollapse;try{for(h.autoCollapse=!1,a=0,r=u.length;a<r;a++)this._callHook("nodeCollapseSiblings",u[a],i)}finally{h.autoCollapse=d}}return o.done((function(){var e=l.getLastChild();s&&h.autoScroll&&!p&&e&&c._enableUpdate?e.scrollIntoView(!0,{topNode:l}).always((function(){m||t.tree._triggerNodeEvent(s?"expand":"collapse",t)})):m||t.tree._triggerNodeEvent(s?"expand":"collapse",t)})),n=function(i){var n=h._classNames,o=h.toggleEffect;if(l.expanded=s,c._callHook("treeStructureChanged",t,s?"expand":"collapse"),c._callHook("nodeRender",t,!1,!1,!0),l.ul)if("none"!==l.ul.style.display==!!l.expanded)l.warn("nodeSetExpanded: UL.style.display already set");else{if(o&&!p)return e(l.li).addClass(n.animating),void(S(e(l.ul)[o.effect])?e(l.ul)[o.effect]({duration:o.duration,always:function(){e(this).removeClass(n.animating),e(l.li).removeClass(n.animating),i()}}):(e(l.ul).stop(!0,!0),e(l.ul).parent().find(".ui-effects-placeholder").remove(),e(l.ul).toggle(o.effect,o.options,o.duration,(function(){e(this).removeClass(n.animating),e(l.li).removeClass(n.animating),i()}))));l.ul.style.display=l.expanded||!parent?"":"none"}i()},s&&l.lazy&&void 0===l.hasChildren()?l.load().done((function(){o.notifyWith&&o.notifyWith(l,["loaded"]),n((function(){o.resolveWith(l)}))})).fail((function(e){n((function(){o.rejectWith(l,["load failed ("+e+")"])}))})):n((function(){o.resolveWith(l)})),o.promise()},nodeSetFocus:function(t,s){var i,n=t.tree,o=t.node,a=n.options,r=!!t.originalEvent&&e(t.originalEvent.target).is(":input");if(s=!1!==s,n.focusNode){if(n.focusNode===o&&s)return;i=e.extend({},t,{node:n.focusNode}),n.focusNode=null,this._triggerNodeEvent("blur",i),this._callHook("nodeRenderStatus",i)}s&&(this.hasFocus()||(o.debug("nodeSetFocus: forcing container focus"),this._callHook("treeSetFocus",t,!0,{calledByNode:!0})),o.makeVisible({scrollIntoView:!1}),n.focusNode=o,a.titlesTabbable&&(r||e(o.span).find(".fancytree-title").focus()),a.aria&&e(n.$container).attr("aria-activedescendant",e(o.tr||o.li).uniqueId().attr("id")),this._triggerNodeEvent("focus",t),document.activeElement===n.$container.get(0)||e(document.activeElement,n.$container).length>=1||e(n.$container).focus(),a.autoScroll&&o.scrollIntoView(),this._callHook("nodeRenderStatus",t))},nodeSetSelected:function(e,t,s){s=s||{};var n=e.node,o=e.tree,a=e.options,r=!0===s.noEvents,u=n.parent;if(t=!1!==t,!i.evalOption("unselectable",n,n,a,!1)){if(n._lastSelectIntent=t,!!n.selected===t&&(3!==a.selectMode||!n.partsel||t))return t;if(!r&&!1===this._triggerNodeEvent("beforeSelect",n,e.originalEvent))return!!n.selected;t&&1===a.selectMode?(o.lastSelectedNode&&o.lastSelectedNode.setSelected(!1),n.selected=t):3!==a.selectMode||!u||u.radiogroup||n.radiogroup?u&&u.radiogroup?n.visitSiblings((function(e){e._changeSelectStatusAttrs(t&&e===n)}),!0):n.selected=t:(n.selected=t,n.fixSelection3AfterClick(s)),this.nodeRenderStatus(e),o.lastSelectedNode=t?n:null,r||o._triggerNodeEvent("select",e)}},nodeSetStatus:function(t,s,i,n){var o=t.node,a=t.tree;function r(){var e=o.children?o.children[0]:null;if(e&&e.isStatusNode()){try{o.ul&&(o.ul.removeChild(e.li),e.li=null)}catch(e){}1===o.children.length?o.children=[]:o.children.shift(),a._callHook("treeStructureChanged",t,"clearStatusNode")}}function u(s,i){var n=o.children?o.children[0]:null;return n&&n.isStatusNode()?(e.extend(n,s),n.statusNodeType=i,a._callHook("nodeRenderTitle",n)):(o._setChildren([s]),a._callHook("treeStructureChanged",t,"setStatusNode"),o.children[0].statusNodeType=i,a.render()),o.children[0]}switch(s){case"ok":r(),o._isLoading=!1,o._error=null,o.renderStatus();break;case"loading":o.parent||u({title:a.options.strings.loading+(i?" ("+i+")":""),checkbox:!1,tooltip:n},s),o._isLoading=!0,o._error=null,o.renderStatus();break;case"error":u({title:a.options.strings.loadError+(i?" ("+i+")":""),checkbox:!1,tooltip:n},s),o._isLoading=!1,o._error={message:i,details:n},o.renderStatus();break;case"nodata":u({title:i||a.options.strings.noData,checkbox:!1,tooltip:n},s),o._isLoading=!1,o._error=null,o.renderStatus();break;default:e.error("invalid node status "+s)}},nodeToggleExpanded:function(e){return this.nodeSetExpanded(e,!e.node.expanded)},nodeToggleSelected:function(e){var t=e.node,s=!t.selected;return t.partsel&&!t.selected&&!0===t._lastSelectIntent&&(s=!1,t.selected=!0),t._lastSelectIntent=s,this.nodeSetSelected(e,s)},treeClear:function(e){var t=e.tree;t.activeNode=null,t.focusNode=null,t.$div.find(">ul.fancytree-container").empty(),t.rootNode.children=null,t._callHook("treeStructureChanged",e,"clear")},treeCreate:function(e){},treeDestroy:function(e){this.$div.find(">ul.fancytree-container").remove(),this.$source&&this.$source.removeClass("fancytree-helper-hidden")},treeInit:function(t){var s=t.tree,i=s.options;s.$container.attr("tabindex",i.tabindex),e.each(g,(function(e,t){void 0!==i[t]&&(s.info("Move option "+t+" to tree"),s[t]=i[t],delete i[t])})),i.checkboxAutoHide&&s.$container.addClass("fancytree-checkbox-auto-hide"),i.rtl?s.$container.attr("DIR","RTL").addClass("fancytree-rtl"):s.$container.removeAttr("DIR").removeClass("fancytree-rtl"),i.aria&&(s.$container.attr("role","tree"),1!==i.selectMode&&s.$container.attr("aria-multiselectable",!0)),this.treeLoad(t)},treeLoad:function(t,s){var n,o,a,r=t.tree,u=t.widget.element,d=e.extend({},t,{node:this.rootNode});if(r.rootNode.children&&this.treeClear(t),s=s||this.options.source)"string"==typeof s&&e.error("Not implemented");else switch(o=u.data("type")||"html"){case"html":(a=u.find(">ul").not(".fancytree-container").first()).length?(a.addClass("ui-fancytree-source fancytree-helper-hidden"),s=e.ui.fancytree.parseHtml(a),this.data=e.extend(this.data,H(a))):(i.warn("No `source` option was passed and container does not contain `<ul>`: assuming `source: []`."),s=[]);break;case"json":s=e.parseJSON(u.text()),u.contents().filter((function(){return 3===this.nodeType})).remove(),e.isPlainObject(s)&&(k(b(s.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),n=s,s=s.children,delete n.children,e.each(g,(function(e,t){void 0!==n[t]&&(r[t]=n[t],delete n[t])})),e.extend(r.data,n));break;default:e.error("Invalid data-type: "+o)}return r._triggerTreeEvent("preInit",null),this.nodeLoadChildren(d,s).done((function(){r._callHook("treeStructureChanged",t,"loadChildren"),r.render(),3===t.options.selectMode&&r.rootNode.fixSelection3FromEndNodes(),r.activeNode&&r.options.activeVisible&&r.activeNode.makeVisible(),r._triggerTreeEvent("init",null,{status:!0})})).fail((function(){r.render(),r._triggerTreeEvent("init",null,{status:!1})}))},treeRegisterNode:function(e,t,s){e.tree._callHook("treeStructureChanged",e,t?"addNode":"removeNode")},treeSetFocus:function(t,s,i){var n;(s=!1!==s)!==this.hasFocus()&&(this._hasFocus=s,!s&&this.focusNode?this.focusNode.setFocus(!1):!s||i&&i.calledByNode||e(this.$container).focus(),this.$container.toggleClass("fancytree-treefocus",s),this._triggerTreeEvent(s?"focusTree":"blurTree"),s&&!this.activeNode&&(n=this._lastMousedownNode||this.getFirstChild())&&n.setFocus())},treeSetOption:function(t,s,i){var n=t.tree,o=!0,a=!1,r=!1;switch(s){case"aria":case"checkbox":case"icon":case"minExpandLevel":case"tabindex":a=!0,r=!0;break;case"checkboxAutoHide":n.$container.toggleClass("fancytree-checkbox-auto-hide",!!i);break;case"escapeTitles":case"tooltip":r=!0;break;case"rtl":!1===i?n.$container.removeAttr("DIR").removeClass("fancytree-rtl"):n.$container.attr("DIR","RTL").addClass("fancytree-rtl"),r=!0;break;case"source":o=!1,n._callHook("treeLoad",n,i),r=!0}n.debug("set option "+s+"="+i+" <"+typeof i+">"),o&&(this.widget._super?this.widget._super.call(this.widget,s,i):e.Widget.prototype._setOption.call(this.widget,s,i)),a&&n._callHook("treeCreate",n),r&&n.render(!0,!1)},treeStructureChanged:function(e,t){}}),e.widget("ui.fancytree",{options:{activeVisible:!0,ajax:{type:"GET",cache:!1,dataType:"json"},aria:!0,autoActivate:!0,autoCollapse:!1,autoScroll:!1,checkbox:!1,clickFolderMode:4,copyFunctionsToData:!1,debugLevel:null,disabled:!1,enableAspx:42,escapeTitles:!1,extensions:[],focusOnSelect:!1,generateIds:!1,icon:!0,idPrefix:"ft_",keyboard:!0,keyPathSeparator:"/",minExpandLevel:1,nodata:!0,quicksearch:!1,rtl:!1,scrollOfs:{top:0,bottom:0},scrollParent:null,selectMode:2,strings:{loading:"Loading...",loadError:"Load error!",moreData:"More...",noData:"No data."},tabindex:"0",titlesTabbable:!1,toggleEffect:{effect:"slideToggle",duration:200},tooltip:!1,treeId:null,_classNames:{active:"fancytree-active",animating:"fancytree-animating",combinedExpanderPrefix:"fancytree-exp-",combinedIconPrefix:"fancytree-ico-",error:"fancytree-error",expanded:"fancytree-expanded",focused:"fancytree-focused",folder:"fancytree-folder",hasChildren:"fancytree-has-children",lastsib:"fancytree-lastsib",lazy:"fancytree-lazy",loading:"fancytree-loading",node:"fancytree-node",partload:"fancytree-partload",partsel:"fancytree-partsel",radio:"fancytree-radio",selected:"fancytree-selected",statusNodePrefix:"fancytree-statusnode-",unselectable:"fancytree-unselectable"},lazyLoad:null,postProcess:null},_deprecationWarning:function(e){var t=this.tree;t&&t.options.debugLevel>=3&&t.warn("$().fancytree('"+e+"') is deprecated (see https://wwwendt.de/tech/fancytree/doc/jsdoc/Fancytree_Widget.html")},_create:function(){this.tree=new B(this),this.$source=this.source||"json"===this.element.data("type")?this.element:this.element.find(">ul").first();var t,s,i,n=this.options,o=n.extensions,a=this.tree;for(i=0;i<o.length;i++)s=o[i],(t=e.ui.fancytree._extensions[s])||e.error("Could not apply extension '"+s+"' (it is not registered, did you forget to include it?)"),this.tree.options[s]=j({},t.options,this.tree.options[s]),k(void 0===this.tree.ext[s],"Extension name must not exist as Fancytree.ext attribute: '"+s+"'"),this.tree.ext[s]={},z(this.tree,a,t,s),a=t;void 0!==n.icons&&(!0===n.icon?(this.tree.warn("'icons' tree option is deprecated since v2.14.0: use 'icon' instead"),n.icon=n.icons):e.error("'icons' tree option is deprecated since v2.14.0: use 'icon' only instead")),void 0!==n.iconClass&&(n.icon?e.error("'iconClass' tree option is deprecated since v2.14.0: use 'icon' only instead"):(this.tree.warn("'iconClass' tree option is deprecated since v2.14.0: use 'icon' instead"),n.icon=n.iconClass)),void 0!==n.tabbable&&(n.tabindex=n.tabbable?"0":"-1",this.tree.warn("'tabbable' tree option is deprecated since v2.17.0: use 'tabindex='"+n.tabindex+"' instead")),this.tree._callHook("treeCreate",this.tree)},_init:function(){this.tree._callHook("treeInit",this.tree),this._bind()},_setOption:function(e,t){return this.tree._callHook("treeSetOption",this.tree,e,t)},_destroy:function(){this._unbind(),this.tree._callHook("treeDestroy",this.tree)},_unbind:function(){var t=this.tree._ns;this.element.off(t),this.tree.$container.off(t),e(document).off(t)},_bind:function(){var t=this,s=this.options,n=this.tree,o=n._ns;this._unbind(),n.$container.on("focusin"+o+" focusout"+o,(function(t){var s=i.getNode(t),o="focusin"===t.type;if(!o&&s&&e(t.target).is("a"))s.debug("Ignored focusout on embedded <a> element.");else{if(o){if(n._getExpiringValue("focusin"))return void n.debug("Ignored double focusin.");n._setExpiringValue("focusin",!0,50),s||(s=n._getExpiringValue("mouseDownNode"))&&n.debug("Reconstruct mouse target for focusin from recent event.")}s?n._callHook("nodeSetFocus",n._makeHookContext(s,t),o):n.tbody&&e(t.target).parents("table.fancytree-container > thead").length?n.debug("Ignore focus event outside table body.",t):n._callHook("treeSetFocus",n,o)}})).on("selectstart"+o,"span.fancytree-title",(function(e){e.preventDefault()})).on("keydown"+o,(function(e){if(s.disabled||!1===s.keyboard)return!0;var t,i=n.focusNode,o=n._makeHookContext(i||n,e),a=n.phase;try{return n.phase="userEvent","preventNav"===(t=i?n._triggerNodeEvent("keydown",i,e):n._triggerTreeEvent("keydown",e))?t=!0:!1!==t&&(t=n._callHook("nodeKeydown",o)),t}finally{n.phase=a}})).on("mousedown"+o,(function(e){var t=i.getEventTarget(e);n._lastMousedownNode=t?t.node:null,n._setExpiringValue("mouseDownNode",n._lastMousedownNode)})).on("click"+o+" dblclick"+o,(function(e){if(s.disabled)return!0;var n,o=i.getEventTarget(e),a=o.node,r=t.tree,u=r.phase;if(!a)return!0;n=r._makeHookContext(a,e);try{switch(r.phase="userEvent",e.type){case"click":return n.targetType=o.type,a.isPagingNode()?!0===r._triggerNodeEvent("clickPaging",n,e):!1!==r._triggerNodeEvent("click",n,e)&&r._callHook("nodeClick",n);case"dblclick":return n.targetType=o.type,!1!==r._triggerNodeEvent("dblclick",n,e)&&r._callHook("nodeDblclick",n)}}finally{r.phase=u}}))},getActiveNode:function(){return this._deprecationWarning("getActiveNode"),this.tree.activeNode},getNodeByKey:function(e){return this._deprecationWarning("getNodeByKey"),this.tree.getNodeByKey(e)},getRootNode:function(){return this._deprecationWarning("getRootNode"),this.tree.rootNode},getTree:function(){return this._deprecationWarning("getTree"),this.tree}}),i=e.ui.fancytree,e.extend(e.ui.fancytree,{version:"2.38.1-0",buildType:"production",debugLevel:3,_nextId:1,_nextNodeKey:1,_extensions:{},_FancytreeClass:B,_FancytreeNodeClass:A,jquerySupports:{positionMyOfs:T(e.ui.version,1,9)},assert:function(e,t){return k(e,t)},createTree:function(t,s){var n=e(t).fancytree(s);return i.getTree(n)},debounce:function(e,t,s,i){var n;return 3===arguments.length&&"boolean"!=typeof s&&(i=s,s=!1),function(){var o=arguments;i=i||this,s&&!n&&t.apply(i,o),clearTimeout(n),n=setTimeout((function(){s||t.apply(i,o),n=null}),e)}},debug:function(t){e.ui.fancytree.debugLevel>=4&&N("log",arguments)},error:function(t){e.ui.fancytree.debugLevel>=1&&N("error",arguments)},escapeHtml:function(e){return(""+e).replace(o,(function(e){return d[e]}))},fixPositionOptions:function(t){if((t.offset||(""+t.my+t.at).indexOf("%")>=0)&&e.error("expected new position syntax (but '%' is not supported)"),!e.ui.fancytree.jquerySupports.positionMyOfs){var s=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.my),i=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.at),n=(s[2]?+s[2]:0)+(i[2]?+i[2]:0),o=(s[4]?+s[4]:0)+(i[4]?+i[4]:0);t=e.extend({},t,{my:s[1]+" "+s[3],at:i[1]+" "+i[3]}),(n||o)&&(t.offset=n+" "+o)}return t},getEventTarget:function(t){var s,n=t&&t.target?t.target.className:"",o={node:this.getNode(t.target),type:void 0};return/\bfancytree-title\b/.test(n)?o.type="title":/\bfancytree-expander\b/.test(n)?o.type=!1===o.node.hasChildren()?"prefix":"expander":/\bfancytree-checkbox\b/.test(n)?o.type="checkbox":/\bfancytree(-custom)?-icon\b/.test(n)?o.type="icon":/\bfancytree-node\b/.test(n)?o.type="title":t&&t.target&&((s=e(t.target)).is("ul[role=group]")?((o.node&&o.node.tree||i).debug("Ignoring click on outer UL."),o.node=null):s.closest(".fancytree-title").length?o.type="title":s.closest(".fancytree-checkbox").length?o.type="checkbox":s.closest(".fancytree-expander").length&&(o.type="expander")),o},getEventTargetType:function(e){return this.getEventTarget(e).type},getNode:function(t){if(t instanceof A)return t;for(t instanceof e?t=t[0]:void 0!==t.originalEvent&&(t=t.target);t;){if(t.ftnode)return t.ftnode;t=t.parentNode}return null},getTree:function(t){var s,i=t;return t instanceof B?t:(void 0===t&&(t=0),"number"==typeof t?t=e(".fancytree-container").eq(t):"string"==typeof t?(t=e("#ft-id-"+i).eq(0)).length||(t=e(i).eq(0)):t instanceof Element||t instanceof HTMLDocument?t=e(t):t instanceof e?t=t.eq(0):void 0!==t.originalEvent&&(t=e(t.target)),(s=(t=t.closest(":ui-fancytree")).data("ui-fancytree")||t.data("fancytree"))?s.tree:null)},evalOption:function(e,t,s,i,n){var o,a,r=t.tree,u=i[e],d=s[e];return S(u)?(o={node:t,tree:r,widget:r.widget,options:r.widget.options,typeInfo:r.types[t.type]||{}},null==(a=u.call(r,{type:e},o))&&(a=d)):a=null==d?u:d,null==a&&(a=n),a},setSpanIcon:function(t,s,i){var n=e(t);"string"==typeof i?n.attr("class",s+" "+i):(i.text?n.text(""+i.text):i.html&&(t.innerHTML=i.html),n.attr("class",s+" "+(i.addClass||"")))},eventToString:function(e){var t=e.which,s=e.type,i=[];return e.altKey&&i.push("alt"),e.ctrlKey&&i.push("ctrl"),e.metaKey&&i.push("meta"),e.shiftKey&&i.push("shift"),"click"===s||"dblclick"===s?i.push(p[e.button]+s):"wheel"===s?i.push(s):l[t]||i.push(c[t]||String.fromCharCode(t).toLowerCase()),i.join("+")},info:function(t){e.ui.fancytree.debugLevel>=3&&N("info",arguments)},keyEventToString:function(e){return this.warn("keyEventToString() is deprecated: use eventToString()"),this.eventToString(e)},overrideMethod:function(t,s,i,n){var o,a=t[s]||e.noop;t[s]=function(){var e=n||this;try{return o=e._super,e._super=a,i.apply(e,arguments)}finally{e._super=o}}},parseHtml:function(t){var s,i,n,o,a,r,u,d,l=t.find(">li"),c=[];return l.each((function(){var l,h,p=e(this),g=p.find(">span",this).first(),_=g.length?null:p.find(">a").first(),y={tooltip:null,data:{}};for(g.length?y.title=g.html():_&&_.length?(y.title=_.html(),y.data.href=_.attr("href"),y.data.target=_.attr("target"),y.tooltip=_.attr("title")):(y.title=p.html(),(a=y.title.search(/<ul/i))>=0&&(y.title=y.title.substring(0,a))),y.title=C(y.title),o=0,r=m.length;o<r;o++)y[m[o]]=void 0;for(s=this.className.split(" "),n=[],o=0,r=s.length;o<r;o++)i=s[o],f[i]?y[i]=!0:n.push(i);if(y.extraClasses=n.join(" "),(u=p.attr("title"))&&(y.tooltip=u),(u=p.attr("id"))&&(y.key=u),p.attr("hideCheckbox")&&(y.checkbox=!1),(l=H(p))&&!e.isEmptyObject(l)){for(h in w)x(l,h)&&(l[w[h]]=l[h],delete l[h]);for(o=0,r=v.length;o<r;o++)u=v[o],null!=(d=l[u])&&(delete l[u],y[u]=d);e.extend(y.data,l)}(t=p.find(">ul").first()).length?y.children=e.ui.fancytree.parseHtml(t):y.children=y.lazy?void 0:null,c.push(y)})),c},registerExtension:function(t){k(null!=t.name,"extensions must have a `name` property."),k(null!=t.version,"extensions must have a `version` property."),e.ui.fancytree._extensions[t.name]=t},trim:C,unescapeHtml:function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue},warn:function(t){e.ui.fancytree.debugLevel>=2&&N("warn",arguments)}}),e.ui.fancytree}function k(t,s){t||(s="Fancytree assertion failed"+(s=s?": "+s:""),e.ui.fancytree.error(s),e.error(s))}function x(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function S(e){return"function"==typeof e}function C(e){return null==e?"":e.trim()}function N(e,t){var s,i,n=window.console?window.console[e]:null;if(n)try{n.apply(window.console,t)}catch(e){for(i="",s=0;s<t.length;s++)i+=t[s];n(i)}}function E(e){return!(!e.tree||void 0===e.statusNodeType)}function T(t,s,i,n){var o,a,r,u=e.map(C(t).split("."),(function(e){return parseInt(e,10)})),d=e.map(Array.prototype.slice.call(arguments,1),(function(e){return parseInt(e,10)}));for(o=0;o<d.length;o++)if((a=u[o]||0)!==(r=d[o]||0))return a>r;return!0}function j(){var t,s,i,n,o,a=arguments[0]||{},r=1,u=arguments.length;if("object"==typeof a||S(a)||(a={}),r===u)throw Error("need at least two args");for(;r<u;r++)if(null!=(t=arguments[r]))for(s in t)if(x(t,s)){if(i=a[s],a===(n=t[s]))continue;n&&e.isPlainObject(n)?(o=i&&e.isPlainObject(i)?i:{},a[s]=j(o,n)):void 0!==n&&(a[s]=n)}return a}function I(e,t,s,i,n){var o,a,r,u,d,l=(o=t[e],a=i[e],r=t.ext[n],u=function(){return o.apply(t,arguments)},d=function(e){return o.apply(t,e)},function(){var e=t._local,s=t._super,i=t._superApply;try{return t._local=r,t._super=u,t._superApply=d,a.apply(t,arguments)}finally{t._local=e,t._super=s,t._superApply=i}});return l}function z(t,s,i,n){for(var o in i)"function"==typeof i[o]?"function"==typeof t[o]?t[o]=I(o,t,s,i,n):"_"===o.charAt(0)?t.ext[n][o]=I(o,t,s,i,n):e.error("Could not override tree."+o+". Use prefix '_' to create tree."+n+"._"+o):"options"!==o&&(t.ext[n][o]=i[o])}function L(t,s){return void 0===t?e.Deferred((function(){this.resolve()})).promise():e.Deferred((function(){this.resolveWith(t,s)})).promise()}function P(t,s){return void 0===t?e.Deferred((function(){this.reject()})).promise():e.Deferred((function(){this.rejectWith(t,s)})).promise()}function D(e,t){return function(){e.resolveWith(t)}}function H(t){var s=e.extend({},t.data()),i=s.json;return delete s.fancytree,delete s.uiFancytree,i&&(delete s.json,s=e.extend(s,i)),s}function W(e){return(""+e).replace(a,(function(e){return d[e]}))}function R(e){return e=e.toLowerCase(),function(t){return t.title.toLowerCase().indexOf(e)>=0}}function O(e){var t=new RegExp("^"+e,"i");return function(e){return t.test(e.title)}}function A(t,s){var n,o,a,r;for(this.parent=t,this.tree=t.tree,this.ul=null,this.li=null,this.statusNodeType=null,this._isLoading=!1,this._error=null,this.data={},n=0,o=v.length;n<o;n++)this[a=v[n]]=s[a];for(a in null==this.unselectableIgnore&&null==this.unselectableStatus||(this.unselectable=!0),s.hideCheckbox&&e.error("'hideCheckbox' node option was removed in v2.23.0: use 'checkbox: false'"),s.data&&e.extend(this.data,s.data),s)_[a]||!this.tree.options.copyFunctionsToData&&S(s[a])||y[a]||(this.data[a]=s[a]);null==this.key?this.tree.options.defaultKey?(this.key=""+this.tree.options.defaultKey(this),k(this.key,"defaultKey() must return a unique key")):this.key="_"+i._nextNodeKey++:this.key=""+this.key,s.active&&(k(null===this.tree.activeNode,"only one active node allowed"),this.tree.activeNode=this),s.selected&&(this.tree.lastSelectedNode=this),(r=s.children)?r.length?this._setChildren(r):this.children=this.lazy?[]:null:this.children=null,this.tree._callHook("treeRegisterNode",this.tree,!0,this)}function B(t){this.widget=t,this.$div=t.element,this.options=t.options,this.options&&(void 0!==this.options.lazyload&&e.error("The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead."),void 0!==this.options.loaderror&&e.error("The 'loaderror' event was renamed since 2014-07-03. Use 'loadError' (with uppercase E) instead."),void 0!==this.options.fx&&e.error("The 'fx' option was replaced by 'toggleEffect' since 2014-11-30."),void 0!==this.options.removeNode&&e.error("The 'removeNode' event was replaced by 'modifyChild' since 2.20 (2016-09-10).")),this.ext={},this.types={},this.columns={},this.data=H(this.$div),this._id=""+(this.options.treeId||e.ui.fancytree._nextId++),this._ns=".fancytree-"+this._id,this.activeNode=null,this.focusNode=null,this._hasFocus=null,this._tempCache={},this._lastMousedownNode=null,this._enableUpdate=!0,this.lastSelectedNode=null,this.systemFocusElement=null,this.lastQuicksearchTerm="",this.lastQuicksearchTime=0,this.viewport=null,this.statusClassPropName="span",this.ariaPropName="li",this.nodeContainerAttrName="li",this.$div.find(">ul.fancytree-container").remove();var s,n={tree:this};this.rootNode=new A(n,{title:"root",key:"root_"+this._id,children:null,expanded:!0}),this.rootNode.parent=null,s=e("<ul>",{id:"ft-id-"+this._id,class:"ui-fancytree fancytree-container fancytree-plain"}).appendTo(this.$div),this.$container=s,this.rootNode.ul=s[0],null==this.options.debugLevel&&(this.options.debugLevel=i.debugLevel)}e.ui.fancytree.warn("Fancytree: ignored duplicate include")},void 0===(o="function"==typeof i?i.apply(t,n):i)||(e.exports=o)},3860:function(e,t,s){var i,n,o;n=[s(5311)],i=function(e){e.ui=e.ui||{},e.ui.version="1.12.1";var t,s,i=0,n=Array.prototype.slice;e.cleanData=e.cleanData||(t=e.cleanData,function(s){var i,n,o;for(o=0;null!=(n=s[o]);o++)try{(i=e._data(n,"events"))&&i.remove&&e(n).triggerHandler("remove")}catch(e){}t(s)}),e.widget=e.widget||function(t,s,i){var n,o,a,r={},u=t.split(".")[0],d=u+"-"+(t=t.split(".")[1]);return i||(i=s,s=e.Widget),e.isArray(i)&&(i=e.extend.apply(null,[{}].concat(i))),e.expr[":"][d.toLowerCase()]=function(t){return!!e.data(t,d)},e[u]=e[u]||{},n=e[u][t],o=e[u][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,n,{version:i.version,_proto:e.extend({},i),_childConstructors:[]}),(a=new s).options=e.widget.extend({},a.options),e.each(i,(function(t,i){e.isFunction(i)?r[t]=function(){function e(){return s.prototype[t].apply(this,arguments)}function n(e){return s.prototype[t].apply(this,e)}return function(){var t,s=this._super,o=this._superApply;return this._super=e,this._superApply=n,t=i.apply(this,arguments),this._super=s,this._superApply=o,t}}():r[t]=i})),o.prototype=e.widget.extend(a,{widgetEventPrefix:n&&a.widgetEventPrefix||t},r,{constructor:o,namespace:u,widgetName:t,widgetFullName:d}),n?(e.each(n._childConstructors,(function(t,s){var i=s.prototype;e.widget(i.namespace+"."+i.widgetName,o,s._proto)})),delete n._childConstructors):s._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var s,i,o=n.call(arguments,1),a=0,r=o.length;a<r;a++)for(s in o[a])i=o[a][s],o[a].hasOwnProperty(s)&&void 0!==i&&(e.isPlainObject(i)?t[s]=e.isPlainObject(t[s])?e.widget.extend({},t[s],i):e.widget.extend({},i):t[s]=i);return t},e.widget.bridge=function(t,s){var i=s.prototype.widgetFullName||t;e.fn[t]=function(o){var a="string"==typeof o,r=n.call(arguments,1),u=this;return a?this.length||"instance"!==o?this.each((function(){var s,n=e.data(this,i);return"instance"===o?(u=n,!1):n?e.isFunction(n[o])&&"_"!==o.charAt(0)?(s=n[o].apply(n,r))!==n&&void 0!==s?(u=s&&s.jquery?u.pushStack(s.get()):s,!1):void 0:e.error("no such method '"+o+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+o+"'")})):u=void 0:(r.length&&(o=e.widget.extend.apply(null,[o].concat(r))),this.each((function(){var t=e.data(this,i);t?(t.option(o||{}),t._init&&t._init()):e.data(this,i,new s(o,this))}))),u}},e.Widget=e.Widget||function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){var t=this;this._destroy(),e.each(this.classesElementLookup,(function(e,s){t._removeClass(s,e)})),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:e.noop,widget:function(){return this.element},option:function(t,s){var i,n,o,a=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(a={},i=t.split("."),t=i.shift(),i.length){for(n=a[t]=e.widget.extend({},this.options[t]),o=0;o<i.length-1;o++)n[i[o]]=n[i[o]]||{},n=n[i[o]];if(t=i.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=s}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];a[t]=s}return this._setOptions(a),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return"classes"===e&&this._setOptionClasses(t),this.options[e]=t,"disabled"===e&&this._setOptionDisabled(t),this},_setOptionClasses:function(t){var s,i,n;for(s in t)n=this.classesElementLookup[s],t[s]!==this.options.classes[s]&&n&&n.length&&(i=e(n.get()),this._removeClass(n,s),i.addClass(this._classes({element:i,keys:s,classes:t,add:!0})))},_setOptionDisabled:function(e){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!e),e&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(t){var s=[],i=this;function n(n,o){var a,r;for(r=0;r<n.length;r++)a=i.classesElementLookup[n[r]]||e(),a=t.add?e(e.unique(a.get().concat(t.element.get()))):e(a.not(t.element).get()),i.classesElementLookup[n[r]]=a,s.push(n[r]),o&&t.classes[n[r]]&&s.push(t.classes[n[r]])}return t=e.extend({element:this.element,classes:this.options.classes||{}},t),this._on(t.element,{remove:"_untrackClassesElement"}),t.keys&&n(t.keys.match(/\S+/g)||[],!0),t.extra&&n(t.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(t){var s=this;e.each(s.classesElementLookup,(function(i,n){-1!==e.inArray(t.target,n)&&(s.classesElementLookup[i]=e(n.not(t.target).get()))}))},_removeClass:function(e,t,s){return this._toggleClass(e,t,s,!1)},_addClass:function(e,t,s){return this._toggleClass(e,t,s,!0)},_toggleClass:function(e,t,s,i){i="boolean"==typeof i?i:s;var n="string"==typeof e||null===e,o={extra:n?t:s,keys:n?e:t,element:n?this.element:e,add:i};return o.element.toggleClass(this._classes(o),i),this},_on:function(t,s,i){var n,o=this;"boolean"!=typeof t&&(i=s,s=t,t=!1),i?(s=n=e(s),this.bindings=this.bindings.add(s)):(i=s,s=this.element,n=this.widget()),e.each(i,(function(i,a){function r(){if(t||!0!==o.options.disabled&&!e(this).hasClass("ui-state-disabled"))return("string"==typeof a?o[a]:a).apply(o,arguments)}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||e.guid++);var u=i.match(/^([\w:-]*)\s*(.*)$/),d=u[1]+o.eventNamespace,l=u[2];l?n.on(d,l,r):s.on(d,r)}))},_off:function(t,s){s=(s||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(s).off(s),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function s(){return("string"==typeof e?i[e]:e).apply(i,arguments)}var i=this;return setTimeout(s,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(e(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(e(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,s,i){var n,o,a=this.options[t];if(i=i||{},(s=e.Event(s)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),s.target=this.element[0],o=s.originalEvent)for(n in o)n in s||(s[n]=o[n]);return this.element.trigger(s,i),!(e.isFunction(a)&&!1===a.apply(this.element[0],[s].concat(i))||s.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},(function(t,s){e.Widget.prototype["_"+t]=function(i,n,o){var a;"string"==typeof n&&(n={effect:n});var r=n?!0===n||"number"==typeof n?s:n.effect||s:t;"number"==typeof(n=n||{})&&(n={duration:n}),a=!e.isEmptyObject(n),n.complete=o,n.delay&&i.delay(n.delay),a&&e.effects&&e.effects.effect[r]?i[t](n):r!==t&&i[r]?i[r](n.duration,n.easing,o):i.queue((function(s){e(this)[t](),o&&o.call(i[0]),s()}))}})),e.widget,function(){var t,s=Math.max,i=Math.abs,n=/left|center|right/,o=/top|center|bottom/,a=/[\+\-]\d+(\.[\d]+)?%?/,r=/^\w+/,u=/%$/,d=e.fn.position;function l(e,t,s){return[parseFloat(e[0])*(u.test(e[0])?t/100:1),parseFloat(e[1])*(u.test(e[1])?s/100:1)]}function c(t,s){return parseInt(e.css(t,s),10)||0}function h(t){var s=t[0];return 9===s.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(s)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:s.preventDefault?{width:0,height:0,offset:{top:s.pageY,left:s.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.position=e.position||{scrollbarWidth:function(){if(void 0!==t)return t;var s,i,n=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=n.children()[0];return e("body").append(n),s=o.offsetWidth,n.css("overflow","scroll"),s===(i=o.offsetWidth)&&(i=n[0].clientWidth),n.remove(),t=s-i},getScrollInfo:function(t){var s=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===s||"auto"===s&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?e.position.scrollbarWidth():0,height:n?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var s=e(t||window),i=e.isWindow(s[0]),n=!!s[0]&&9===s[0].nodeType;return{element:s,isWindow:i,isDocument:n,offset:i||n?{left:0,top:0}:e(t).offset(),scrollLeft:s.scrollLeft(),scrollTop:s.scrollTop(),width:s.outerWidth(),height:s.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return d.apply(this,arguments);t=e.extend({},t);var u,p,m,f,g,v,_=e(t.of),w=e.position.getWithinInfo(t.within),y=e.position.getScrollInfo(w),b=(t.collision||"flip").split(" "),k={};return v=h(_),_[0].preventDefault&&(t.at="left top"),p=v.width,m=v.height,f=v.offset,g=e.extend({},f),e.each(["my","at"],(function(){var e,s,i=(t[this]||"").split(" ");1===i.length&&(i=n.test(i[0])?i.concat(["center"]):o.test(i[0])?["center"].concat(i):["center","center"]),i[0]=n.test(i[0])?i[0]:"center",i[1]=o.test(i[1])?i[1]:"center",e=a.exec(i[0]),s=a.exec(i[1]),k[this]=[e?e[0]:0,s?s[0]:0],t[this]=[r.exec(i[0])[0],r.exec(i[1])[0]]})),1===b.length&&(b[1]=b[0]),"right"===t.at[0]?g.left+=p:"center"===t.at[0]&&(g.left+=p/2),"bottom"===t.at[1]?g.top+=m:"center"===t.at[1]&&(g.top+=m/2),u=l(k.at,p,m),g.left+=u[0],g.top+=u[1],this.each((function(){var n,o,a=e(this),r=a.outerWidth(),d=a.outerHeight(),h=c(this,"marginLeft"),v=c(this,"marginTop"),x=r+h+c(this,"marginRight")+y.width,S=d+v+c(this,"marginBottom")+y.height,C=e.extend({},g),N=l(k.my,a.outerWidth(),a.outerHeight());"right"===t.my[0]?C.left-=r:"center"===t.my[0]&&(C.left-=r/2),"bottom"===t.my[1]?C.top-=d:"center"===t.my[1]&&(C.top-=d/2),C.left+=N[0],C.top+=N[1],n={marginLeft:h,marginTop:v},e.each(["left","top"],(function(s,i){e.ui.position[b[s]]&&e.ui.position[b[s]][i](C,{targetWidth:p,targetHeight:m,elemWidth:r,elemHeight:d,collisionPosition:n,collisionWidth:x,collisionHeight:S,offset:[u[0]+N[0],u[1]+N[1]],my:t.my,at:t.at,within:w,elem:a})})),t.using&&(o=function(e){var n=f.left-C.left,o=n+p-r,u=f.top-C.top,l=u+m-d,c={target:{element:_,left:f.left,top:f.top,width:p,height:m},element:{element:a,left:C.left,top:C.top,width:r,height:d},horizontal:o<0?"left":n>0?"right":"center",vertical:l<0?"top":u>0?"bottom":"middle"};p<r&&i(n+o)<p&&(c.horizontal="center"),m<d&&i(u+l)<m&&(c.vertical="middle"),s(i(n),i(o))>s(i(u),i(l))?c.important="horizontal":c.important="vertical",t.using.call(this,e,c)}),a.offset(e.extend(C,{using:o}))}))},e.ui.position={fit:{left:function(e,t){var i,n=t.within,o=n.isWindow?n.scrollLeft:n.offset.left,a=n.width,r=e.left-t.collisionPosition.marginLeft,u=o-r,d=r+t.collisionWidth-a-o;t.collisionWidth>a?u>0&&d<=0?(i=e.left+u+t.collisionWidth-a-o,e.left+=u-i):e.left=d>0&&u<=0?o:u>d?o+a-t.collisionWidth:o:u>0?e.left+=u:d>0?e.left-=d:e.left=s(e.left-r,e.left)},top:function(e,t){var i,n=t.within,o=n.isWindow?n.scrollTop:n.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,u=o-r,d=r+t.collisionHeight-a-o;t.collisionHeight>a?u>0&&d<=0?(i=e.top+u+t.collisionHeight-a-o,e.top+=u-i):e.top=d>0&&u<=0?o:u>d?o+a-t.collisionHeight:o:u>0?e.top+=u:d>0?e.top-=d:e.top=s(e.top-r,e.top)}},flip:{left:function(e,t){var s,n,o=t.within,a=o.offset.left+o.scrollLeft,r=o.width,u=o.isWindow?o.scrollLeft:o.offset.left,d=e.left-t.collisionPosition.marginLeft,l=d-u,c=d+t.collisionWidth-r-u,h="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,m=-2*t.offset[0];l<0?((s=e.left+h+p+m+t.collisionWidth-r-a)<0||s<i(l))&&(e.left+=h+p+m):c>0&&((n=e.left-t.collisionPosition.marginLeft+h+p+m-u)>0||i(n)<c)&&(e.left+=h+p+m)},top:function(e,t){var s,n,o=t.within,a=o.offset.top+o.scrollTop,r=o.height,u=o.isWindow?o.scrollTop:o.offset.top,d=e.top-t.collisionPosition.marginTop,l=d-u,c=d+t.collisionHeight-r-u,h="top"===t.my[1]?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,p="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];l<0?((n=e.top+h+p+m+t.collisionHeight-r-a)<0||n<i(l))&&(e.top+=h+p+m):c>0&&((s=e.top-t.collisionPosition.marginTop+h+p+m-u)>0||i(s)<c)&&(e.top+=h+p+m)}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}}}(),e.ui.position,e.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},e.fn.scrollParent=function(t){var s=this.css("position"),i="absolute"===s,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter((function(){var t=e(this);return(!i||"static"!==t.css("position"))&&n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))})).eq(0);return"fixed"!==s&&o.length?o:e(this[0].ownerDocument||document)},e.fn.extend({uniqueId:(s=0,function(){return this.each((function(){this.id||(this.id="ui-id-"+ ++s)}))}),removeUniqueId:function(){return this.each((function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")}))}})},void 0===(o="function"==typeof i?i.apply(t,n):i)||(e.exports=o)},5311:function(e){"use strict";e.exports=jQuery}},t={};function s(i){var n=t[i];if(void 0!==n)return n.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,s),o.exports}s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){"use strict";var e=e||{};window.WP_Smush=e,String.prototype.includes||(String.prototype.includes=function(e,t){return"number"!=typeof t&&(t=0),!(t+e.length>this.length)&&-1!==this.indexOf(e,t)}),s(3065),s(6111),s(9478),s(7413),s(3579),s(2140),s(1110),s(1442),s(5972),s(7447),s(4933),s(206)}()}();
2
  //# sourceMappingURL=smush-admin.min.js.map
1
+ !function(){var e={9478:function(){jQuery((function(e){"use strict";e("body").on("click","a.smush-stats-details",(function(t){if(e(this).prop("disabled"))return!1;t.preventDefault();var s=e(this).find(".stats-toggle");e(this).parents().eq(1).find(".smush-stats-wrapper").slideToggle(),s.text("+"==s.text()?"-":"+")}))}))},6111:function(e,t,s){"use strict";s.r(t);var i=s(9446),n=function(e,t){void 0===t&&(t=100),e.fadeTo(t,0,(function(){e.slideUp(t,(function(){e.remove()}))}))};jQuery((function(e){var t=function(t,s,n,o){if(!s.prop("disabled")){t.preventDefault(),e(".wp-smush-error").remove(),e(".smush-stats-wrapper").hide();var a="grid";"smush_restore_image"===n&&(a=e(document).find("div.media-modal.wp-core-ui").length>0||window.location.search.indexOf("item")>-1?"grid":"list");var r={action:n,attachment_id:s.data("id"),mode:a,_nonce:s.data("nonce")};!function(e){var t=e.parent();t.css({opacity:"0.5"}),t.find("a").prop("disabled",!0)}(s),s.html('<span class="spinner wp-smush-progress">'+wp_smush_msgs[o]+"</span>"),e.post(ajaxurl,r,(function(t){!function(e){var t=e.parent();t.css({opacity:"1"}),t.find("a").prop("disabled",!1)}(s),t.success&&void 0!==t.data?(void 0!==this.data&&this.data.indexOf("nextgen")>-1||"restore"===o?s.parents().eq(1).html(t.data.stats):s.parents().eq(1).html(t.data),void 0!==t.data&&"restore"===o&&i.Z.updateImageStats(t.data.new_size)):t.data&&t.data.error_msg&&(-1===this.data.indexOf("nextgen")&&"restore"===o?e(".smush-status").addClass("error").html(t.data.error_msg):s.parent().append(t.data.error_msg))}))}},s=function(e){var t=jQuery(".bulk-smush-wrapper .wp-smush-bulk-wrapper, #wp-smush-pending-to-smush-text"),s=jQuery(".bulk-smush-wrapper .wp-smush-all-done, .bulk-smush-wrapper .wp-smush-pagespeed-recommendation, #smush-box-bulk-upgrade, #wp-smush-all-smushed-text");if(t.length&&s.length)if(0===e)t.addClass("sui-hidden"),s.removeClass("sui-hidden");else{t.removeClass("sui-hidden"),s.addClass("sui-hidden");var i=jQuery(".sui-summary-smush .sui-summary-details .sui-tooltip");if(i.length){var n=1===e?"singular":"plural",o=i.data(n).replace("{count}",e);i.attr("data-tooltip",o)}}jQuery(".wp-smush-total-count").text(e)},o=function(t){e(t).length>0&&e("html, body").animate({scrollTop:e(t).offset().top-100},"slow")};if(e("#all-image-sizes").on("change",(function(){e('input[name^="wp-smush-image_sizes"]').prop("checked",!0)})),e(".sui-mobile-nav").on("change",(function(t){window.location.assign(e(t.currentTarget).val())})),e("#update-api-status").on("click",(function(t){t.preventDefault(),e(this).addClass("sui-button-onload"),e.post(ajaxurl,{action:"recheck_api_status"},(function(){location.reload()}))})),e("body").on("click",".wp-smush-send:not(.wp-smush-resmush)",(function(t){t.preventDefault(),new i.Z(e(this),!1)})),e("body").on("click",".wp-smush-remove-skipped",(function(t){t.preventDefault();var s=e(this);e.post(ajaxurl,{action:"remove_from_skip_list",id:s.attr("data-id")}).done((function(e){e.success&&void 0!==e.data.links&&(s.parent().parent().find(".smush-status").text(wp_smush_msgs.not_processed),t.target.closest(".smush-status-links").innerHTML=e.data.links)}))})),e("body").on("click",".wp-smush-nextgen-send",(function(t){t.preventDefault(),new i.Z(e(this),!1,"nextgen")})),e("body").on("click",".wp-smush-nextgen-bulk",(function(t){if(t.preventDefault(),e(".wp-smush-resmush-notice").remove(),"undefined"==typeof wp_smushit_data||0===wp_smushit_data.unsmushed.length&&0===wp_smushit_data.resmush.length)return!1;jQuery(".wp-smush-all, .wp-smush-scan").prop("disabled",!0),e(".wp-smush-notice.wp-smush-remaining").hide(),new i.Z(e(this),!0,"nextgen")})),e("body").on("click",".wp-smush-action.wp-smush-restore",(function(s){var i=e(this);t(s,i,"smush_restore_image","restore")})),e("body").on("click",".wp-smush-action.wp-smush-resmush",(function(s){t(s,e(this),"smush_resmush_image","smushing")})),e("body").on("click",".wp-smush-action.wp-smush-nextgen-restore",(function(s){t(s,e(this),"smush_restore_nextgen_image","restore")})),e("body").on("click",".wp-smush-action.wp-smush-nextgen-resmush",(function(s){t(s,e(this),"smush_resmush_nextgen_image","smushing")})),e(".wp-smush-scan").on("click",(function(t){t.preventDefault(),function(t){var n=e(".wp-smush-scan");n.addClass("sui-button-onload");var o=n.data("type");o=void 0===o?"media":o,e(".wp-smush-all").removeAttr("data-smush");var a=e(".sui-notice-top.sui-notice-success");a.slideUp(100,(function(){a.remove()})),e(".wp-smush-all").prop("disabled",!0),e(".wp-smush-settings-changed").hide();var r={action:"scan_for_resmush",type:o,get_ui:!0,process_settings:t,wp_smush_options_nonce:jQuery("#wp_smush_options_nonce").val()};e.get(ajaxurl,r,(function(t){if(void 0!==t.data){if(void 0!==t.data.resmush_ids){wp_smushit_data.resmush=t.data.resmush_ids,"undefined"!=typeof wp_smushit_data&&(wp_smushit_data.count_smushed=void 0!==t.data.count_smushed?t.data.count_smushed:wp_smushit_data.count_smushed,wp_smushit_data.count_supersmushed=void 0!==t.data.count_supersmushed?t.data.count_supersmushed:wp_smushit_data.count_supersmushed,wp_smushit_data.count_images=void 0!==t.data.count_image?t.data.count_image:wp_smushit_data.count_images,wp_smushit_data.size_before=void 0!==t.data.size_before?t.data.size_before:wp_smushit_data.size_before,wp_smushit_data.size_after=void 0!==t.data.size_after?t.data.size_after:wp_smushit_data.size_after,wp_smushit_data.savings_resize=void 0!==t.data.savings_resize?t.data.savings_resize:wp_smushit_data.savings_resize,wp_smushit_data.savings_conversion=void 0!==t.data.savings_conversion?t.data.savings_conversion:wp_smushit_data.savings_conversion,wp_smushit_data.count_resize=void 0!==t.data.count_resize?t.data.count_resize:wp_smushit_data.count_resize,wp_smushit_data.unsmushed=void 0!==t.data.unsmushed?t.data.unsmushed:wp_smushit_data.unsmushed),"nextgen"===o&&(wp_smushit_data.bytes=parseInt(wp_smushit_data.size_before)-parseInt(wp_smushit_data.size_after));var n=e(".bulk-smush-wrapper .sui-notice:not(.smush-upsell-notice)");n.length>0&&(n.addClass("sui-hidden"),e(".wp-smush-pagespeed-recommendation").addClass("sui-hidden")),e(".wp-smush-resmush-notice").remove(),e(".wp-smush-bulk-wrapper").removeClass("sui-hidden")}if(void 0!==t.data.content&&e("#wp-smush-bulk-content").html(t.data.content),void 0!==t.data.notice){var a="success";void 0!==t.data.noticeType&&(a=t.data.noticeType),window.SUI.openNotice("wp-smush-ajax-notice","<p>"+t.data.notice+"</p>",{type:a,icon:"check-tick"})}e("div.smush-final-log").hide(),void 0!==t.data.super_smush&&t.data.super_smush&&"undefined"!==t.data.super_smush_stat&&e(".super-smush-attachments .wp-smush-stats").html(t.data.super_smush_stats),i.Z.updateStats(o);var r=t.data.count||0;i.Z.updateRemainingCount(r),s(r)}})).always((function(){jQuery(".bulk-smush-wrapper .wp-smush-bulk-progress-bar-wrapper").addClass("sui-hidden"),n.removeClass("sui-button-onload").addClass("smush-button-check-success");var t=n.find(".wp-smush-default-text"),s=n.find(".wp-smush-completed-text");t.addClass("sui-hidden-important"),s.removeClass("sui-hidden"),setTimeout((function(){n.removeClass("smush-button-check-success"),t.removeClass("sui-hidden-important"),s.addClass("sui-hidden")}),2e3),e(".wp-smush-all").prop("disabled",!1)}))}(!1)})),e("#wp-smush-welcome-box .smush-dismiss-welcome").on("click",(function(t){t.preventDefault();var s=e(this).parents().eq(1);n(s);e.post(ajaxurl,{action:"dismiss_welcome_notice"})})),e("body").on("click",".wp-smush-notice .icon-fi-close",(function(t){t.preventDefault();var s=e(this).parent();n(s)})),e("body").on("click",".wp-smush-skip-resmush",(function(t){t.preventDefault();var s=jQuery(this),o=s.parents().eq(1),a=s.parent();n(a),e(".sui-notice-top.sui-notice-success").remove(),o.find(".wp-smush-all").attr("data-smush","skip_resmush"),wp_smushit_data.count_smushed=parseInt(wp_smushit_data.count_smushed)+wp_smushit_data.resmush.length,wp_smushit_data.count_supersmushed=parseInt(wp_smushit_data.count_supersmushed)+wp_smushit_data.resmush.length,wp_smushit_data.count_smushed===wp_smushit_data.count_total&&(e(".wp-smush-notice.wp-smush-all-done, .wp-smush-pagespeed-recommendation").removeClass("sui-hidden"),e(".wp-smush-bulk-wrapper ").addClass("sui-hidden")),e(".wp-smush-resmush-notice").remove();var r=e(".wp-smush-scan").data("type");r=void 0===r?"media":r;var u=(void 0!==wp_smushit_data.count_smushed?wp_smushit_data.count_smushed:0)/wp_smushit_data.count_total*100;u=WP_Smush.helpers.precise_round(u,1),e(".wp-smush-images-percent").html(u);var d=jQuery(".bulk-smush-wrapper .wp-smush-progress-inner");if(!(d.length<1)){d.css("width",u+"%"),e(".wp-smush-bulk-wrapper").removeClass("sui-hidden"),e(".wp-smush-bulk-wrapper .sui-notice").removeClass("sui-hidden");var l={action:"delete_resmush_list",type:r};e.post(ajaxurl,l,(function(t){if(t.success&&void 0!==t.data.stats){var s=t.data.stats;"undefined"!=typeof wp_smushit_data&&(wp_smushit_data.count_images=void 0!==s.count_images?parseInt(wp_smushit_data.count_images)+s.count_images:wp_smushit_data.count_images,wp_smushit_data.size_before=void 0!==s.size_before?parseInt(wp_smushit_data.size_before)+s.size_before:wp_smushit_data.size_before,wp_smushit_data.size_after=void 0!==s.size_after?parseInt(wp_smushit_data.size_after)+s.size_after:wp_smushit_data.size_after,wp_smushit_data.savings_resize=void 0!==s.savings_resize?parseInt(wp_smushit_data.savings_resize)+s.savings_resize:wp_smushit_data.savings_resize,wp_smushit_data.savings_conversion=void 0!==s.savings_conversion?parseInt(wp_smushit_data.savings_conversion)+s.savings_conversion:wp_smushit_data.savings_conversion,void 0!==wp_smushit_data.savings_dir_smush&&void 0!==wp_smushit_data.savings_dir_smush.orig_size&&(wp_smushit_data.size_before=void 0!==wp_smushit_data.savings_dir_smush?parseInt(wp_smushit_data.size_before)+parseInt(wp_smushit_data.savings_dir_smush.orig_size):wp_smushit_data.size_before,wp_smushit_data.size_after=void 0!==wp_smushit_data.savings_dir_smush?parseInt(wp_smushit_data.size_after)+parseInt(wp_smushit_data.savings_dir_smush.image_size):wp_smushit_data.size_after),wp_smushit_data.count_resize=void 0!==s.count_resize?parseInt(wp_smushit_data.count_resize)+s.count_resize:wp_smushit_data.count_resize);var n=e(".bulk-smush-wrapper .wp-smush-remaining-count");n.length&&void 0!==wp_smushit_data.unsmushed&&n.html(wp_smushit_data.unsmushed.length),void 0===wp_smushit_data.unsmushed&&0!==wp_smushit_data.unsmushed.length||(e(".wp-smush-bulk-wrapper .sui-notice").removeClass("sui-hidden"),e(".sui-notice-success.wp-smush-all-done").addClass("sui-hidden")),i.Z.updateStats()}}))}})),e("a.wp-smush-lossy-enable").on("click",(function(e){e.preventDefault(),o("#column-lossy")})),e(".wp-smush-resize-enable").on("click",(function(e){e.preventDefault(),o("#column-resize")})),window.location.hash){var a="";switch(window.location.hash.substring(1)){case"enable-resize":a="#column-resize";break;case"backup-label":a="#backup";break;case"original-label":a="#original";break;case"enable-lossy":a="#column-lossy"}""!==a&&(o(a),document.getElementById(a.replace("#","")).focus())}if(e("body").on("click",".wp-smush-trigger-bulk",(function(t){t.preventDefault(),void 0!==t.target.dataset.type&&"nextgen"===t.target.dataset.type?e(".wp-smush-nextgen-bulk").trigger("click"):e(".wp-smush-all").trigger("click"),e("span.sui-notice-dismiss").trigger("click")})),e("body").on("click","#bulk-smush-top-notice-close",(function(t){t.preventDefault(),e(this).parent().parent().slideUp("slow")})),e(".wp-smush-setting-row .toggle-checkbox").on("focus",(function(){e(this).keypress((function(t){32==t.keyCode&&(t.preventDefault(),e(this).find(".toggle-checkbox").trigger("click"))}))})),e("body").on("blur",".wp-smush-resize-input",(function(){!function(e,t,s){var i=e.find("#resize");if(!s)var n=e.find("#wp-smush-resize_width"),o=e.find(".sui-notice-info.wp-smush-update-width");if(!t)var a=e.find("#wp-smush-resize_height"),r=e.find(".sui-notice-info.wp-smush-update-height");var u=!1,d=!1;!i.is(":checked")||void 0===wp_smushit_data.resize_sizes||void 0===wp_smushit_data.resize_sizes.width||(!s&&void 0!==n&&parseInt(wp_smushit_data.resize_sizes.width)>parseInt(n.val())?(n.parent().addClass("sui-form-field-error"),o.show("slow"),u=!0):(n.parent().removeClass("sui-form-field-error"),o.hide(),a.hasClass("error")&&r.show("slow")),!t&&void 0!==a&&parseInt(wp_smushit_data.resize_sizes.height)>parseInt(a.val())?(a.parent().addClass("sui-form-field-error"),u||r.show("slow"),d=!0):(a.parent().removeClass("sui-form-field-error"),r.hide(),n.hasClass("error")&&o.show("slow")))}(e(this).parents().eq(4),!1,!1)})),e("body").on("click","#resize",(function(){var t=e(this),s=e("#smush-resize-settings-wrap");t.is(":checked")?s.show():s.hide()})),e("#wp-smush-revalidate-member").on("click",(function(t){t.preventDefault();var s=e(this).parents().eq(1);s.addClass("loading-notice"),e.get(ajaxurl,{action:"smush_show_warning"},(function(e){s.removeClass("loading-notice").addClass("loaded-notice"),0==e?(s.attr("data-message",wp_smush_msgs.membership_valid),n(s,1e3)):(s.attr("data-message",wp_smush_msgs.membership_invalid),setTimeout((function(){s.removeClass("loaded-notice")}),1e3))}))})),e("li.smush-dir-savings").length>0){e.get(ajaxurl,{action:"get_dir_smush_stats"},(function(t){e("li.smush-dir-savings .sui-icon-loader").hide(),t.success||void 0===t.data.message?void 0===t.data||void 0===t.data.dir_smush?(e("li.smush-dir-savings span.wp-smush-stats").append(wp_smush_msgs.ajax_error),e("li.smush-dir-savings span.wp-smush-stats span").hide()):function(t){if(void 0!==t.dir_smush){var s=e("li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-human"),i=e("li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-percent");t.dir_smush.bytes>0?(e(".wp-smush-dir-link").addClass("sui-hidden"),e("li.smush-dir-savings .wp-smush-stats-label-message").hide(),s.length>0?s.html(t.dir_smush.human):t.dir_smush.bytes,t.dir_smush.percent>0&&(e("li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-sep").removeClass("sui-hidden"),i.length>0?i.html(t.dir_smush.percent+"%"):t.dir_smush.percent)):e(".wp-smush-dir-link").removeClass("sui-hidden")}if(void 0!==t.combined_stats&&t.combined_stats.length>0){var n=t.combined_stats,o=n.smushed/n.total_count*100;(o=WP_Smush.helpers.precise_round(o,1))&&e("div.wp-smush-count-total span.wp-smush-images-percent").html(o),n.total_count&&e("span.wp-smush-count-total span.wp-smush-total-optimised").html(n.total_count),n.savings&&e("span.wp-smush-savings span.wp-smush-stats-human").html(n.savings),n.percent&&e("span.wp-smush-savings span.wp-smush-stats-percent").html(n.percent)}}(t.data):e("div.wp-smush-scan-result div.content").prepend(t.data.message)}))}e("span.dismiss-recommendation").on("click",(function(t){t.preventDefault();var s=e(this).parent();s.hide("slow",(function(){s.remove()})),e.ajax({type:"POST",url:ajaxurl,data:{action:"hide_pagespeed_suggestion"}})})),e("#smush-updated-dialog").length&&window.SUI.openModal("smush-updated-dialog","wpbody-content",void 0,!1),e("input#original").on("change",(function(){e("#backup-notice").toggleClass("sui-hidden",e(this).is(":checked"))}))}))},7447:function(){!function(){"use strict";WP_Smush.restore={modal:document.getElementById("smush-restore-images-dialog"),contentContainer:document.getElementById("smush-bulk-restore-content"),settings:{slide:"start",success:0,errors:[]},items:[],success:[],errors:[],currentStep:0,totalSteps:0,init:function(){this.modal&&(this.settings={slide:"start",success:0,errors:[]},this.resetModalWidth(),this.renderTemplate(),window.SUI.openModal("smush-restore-images-dialog","wpbody-content",void 0,!1))},renderTemplate:function(){var e=WP_Smush.onboarding.template("smush-bulk-restore")(this.settings);e&&(this.contentContainer.innerHTML=e),this.bindSubmit()},resetModalWidth:function(){this.modal.style.maxWidth="460px",this.modal.querySelector(".sui-box").style.maxWidth="460px"},bindSubmit:function(){var e=this.modal.querySelector('button[id="smush-bulk-restore-button"]'),t=this;e&&e.addEventListener("click",(function(e){e.preventDefault(),t.resetModalWidth(),t.settings={slide:"progress"},t.errors=[],t.renderTemplate(),t.initScan()}))},cancel:function(){"start"===this.settings.slide||"finish"===this.settings.slide?window.SUI.closeModal():(this.updateProgressBar(!0),window.location.reload())},updateProgressBar:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=0;0<this.currentStep&&(t=Math.min(Math.round(100*this.currentStep/this.totalSteps),99)),t>100&&(t=100),this.modal.querySelector(".sui-progress-text span").innerHTML=t+"%",this.modal.querySelector(".sui-progress-bar span").style.width=t+"%";var s=this.modal.querySelector(".sui-progress-state-text");s.innerHTML=t>=90?"Finalizing...":e?"Cancelling...":this.currentStep+"/"+this.totalSteps+" images restored"},initScan:function(){var e=this,t=document.getElementById("_wpnonce"),s=new XMLHttpRequest;s.open("POST",ajaxurl+"?action=get_image_count",!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.onload=function(){if(200===s.status){var t=JSON.parse(s.response);void 0!==t.data.items&&(e.items=t.data.items,e.totalSteps=t.data.items.length,e.step())}else window.console.log("Request failed. Returned status of "+s.status)},s.send("_ajax_nonce="+t.value)},step:function(){var e=this,t=this,s=document.getElementById("_wpnonce");if(0<this.items.length){var i=this.items.pop(),n=new XMLHttpRequest;n.open("POST",ajaxurl+"?action=restore_step",!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.onload=function(){if(e.currentStep++,200===n.status){var s=JSON.parse(n.response);void 0!==s.data.success&&s.data.success?t.success.push(i):t.errors.push({id:i,src:s.data.src,thumb:s.data.thumb,link:s.data.link})}t.updateProgressBar(),t.step()},n.send("item="+i+"&_ajax_nonce="+s.value)}else this.settings={slide:"finish",success:this.success.length,errors:this.errors,total:this.totalSteps},t.renderTemplate(),0<this.errors.length&&(this.modal.style.maxWidth="660px",this.modal.querySelector(".sui-box").style.maxWidth="660px")}},WP_Smush.restore.template=_.memoize((function(e){var t,s={evaluate:/<#([\s\S]+?)#>/g,interpolate:/{{{([\s\S]+?)}}}/g,escape:/{{([^}]+?)}}(?!})/g,variable:"data"};return function(i){return _.templateSettings=s,(t=t||_.template(document.getElementById(e).innerHTML))(i)}}))}()},7413:function(e,t,s){"use strict";s.r(t);var i,n=s(9446);i=jQuery,WP_Smush.bulk={init:function(){i(".wp-smush-all").on("click",(function(e){e.preventDefault(),i(".sui-notice-top.sui-notice-success").remove();var t=document.getElementById("bulk_smush_warning");t.classList.add("sui-hidden");var s=i(".wp-smush-bulk-progress-bar-wrapper");if(s.removeClass("wp-smush-exceed-limit"),s.find(".sui-progress-block .wp-smush-all").addClass("sui-hidden"),s.find(".sui-progress-block .wp-smush-cancel-bulk").removeClass("sui-hidden"),t&&document.getElementById("bulk-smush-resume-button").classList.add("sui-hidden"),i(".wp-resmush.wp-smush-action, .wp-smush-scan, .wp-smush-all:not(.sui-progress-close), a.wp-smush-lossy-enable, button.wp-smush-resize-enable, button#save-settings-button").prop("disabled",!0),void 0===window.wp_smushit_data||0===window.wp_smushit_data.unsmushed.length&&0===window.wp_smushit_data.resmush.length)return!1;i(".wp-smush-remaining").addClass("sui-hidden"),s.find(".sui-progress-block i.sui-icon-info").removeClass("sui-icon-info").addClass("sui-loading").addClass("sui-icon-loader"),new n.Z(i(this),!0)})),i("body").on("click",".smush-ignore-image",(function(e){e.preventDefault();var t=i(this);t.prop("disabled",!0),t.attr("data-tooltip"),t.removeClass("sui-tooltip"),i.post(ajaxurl,{action:"ignore_bulk_image",id:t.attr("data-id")}).done((function(s){t.is("a")&&s.success&&void 0!==s.data.links&&(t.parent().parent().find(".smush-status").text(wp_smush_msgs.ignored),e.target.closest(".smush-status-links").innerHTML=s.data.links)}))}));var e=document.getElementById("smush-box-bulk-upgrade");!e||window.wp_smushit_data.unsmushed.length||window.wp_smushit_data.resmush.length||e.classList.remove("sui-hidden")}},WP_Smush.bulk.init()},2140:function(e,t,s){"use strict";s.r(t);var i,n=s(5445),o=function(e,t){e=parseInt(e),t=parseInt(t);var s=!1,i=0,n=0,o={scan:function(){var s=this,i=e-t;0!==t?a(i).fail(this.showScanError):jQuery.post(ajaxurl,{action:"directory_smush_start"},(function(){return a(i).fail(s.showScanError)})).fail(this.showScanError)},cancel:function(){return s=!0,jQuery.post(ajaxurl,{action:"directory_smush_cancel"})},getProgress:function(){if(s)return 0;var i=e-t;return Math.min(Math.round(100*parseInt(e-i)/e),99)},onFinishStep:function(s){jQuery(".wp-smush-progress-dialog .sui-progress-state-text").html(t-i+"/"+e+" "+window.wp_smush_msgs.progress_smushed),WP_Smush.directory.updateProgressBar(s)},onFinish:function(){WP_Smush.directory.updateProgressBar(100),window.location.href=window.wp_smush_msgs.directory_url+"&scan=done"},showScanError:function(e){var t=jQuery("#wp-smush-progress-dialog");t.removeClass("wp-smush-exceed-limit").addClass("wp-smush-scan-error"),t.find("#smush-scan-error").text("".concat(e.status," ").concat(e.statusText));var s=t.find(".smush-403-error-message");403!==e.status?s.addClass("sui-hidden"):s.removeClass("sui-hidden")},limitReached:function(){var e=jQuery("#wp-smush-progress-dialog");e.addClass("wp-smush-exceed-limit"),e.find("#cancel-directory-smush").attr("data-tooltip",window.wp_smush_msgs.bulk_resume),e.find(".sui-box-body .sui-icon-close").removeClass("sui-icon-close").addClass("sui-icon-play"),e.find("#cancel-directory-smush").attr("id","cancel-directory-smush-disabled")},resume:function(){var e=jQuery("#wp-smush-progress-dialog"),t=e.find("#cancel-directory-smush-disabled");e.removeClass("wp-smush-exceed-limit"),e.find(".sui-box-body .sui-icon-play").removeClass("sui-icon-play").addClass("sui-icon-close"),t.attr("data-tooltip","Cancel"),t.attr("id","cancel-directory-smush"),o.scan()}},a=function s(a){return a>=0?(t=e-a,jQuery.post(ajaxurl,{action:"directory_smush_check_step",step:t},(function(e){void 0!==e.success&&e.success?(void 0!==e.data&&void 0!==e.data.skipped&&!0===e.data.skipped&&n++,t++,a-=1,o.onFinishStep(o.getProgress()),s(a).fail(o.showScanError)):void 0!==e.data.error&&"dir_smush_limit_exceeded"===e.data.error?o.limitReached():(i++,t++,a-=1,o.onFinishStep(o.getProgress()),s(a).fail(o.showScanError))}))):jQuery.post(ajaxurl,{action:"directory_smush_finish",items:e-(i+n),failed:i,skipped:n},(function(e){return o.onFinish(e)}))};return o};i=jQuery,WP_Smush.directory={selected:[],tree:[],wp_smush_msgs:[],triggered:!1,init:function(){var e=this,t=i("#wp-smush-progress-dialog"),s=0,n=0;void 0!==window.wp_smushit_data.dir_smush&&(s=window.wp_smushit_data.dir_smush.totalSteps,n=window.wp_smushit_data.dir_smush.currentScanStep),this.scanner=new o(s,n),this.wp_smush_msgs=window.wp_smush_msgs||{},i("button.wp-smush-browse, a#smush-directory-open-modal").on("click",(function(t){t.preventDefault(),i(t.currentTarget).hasClass("wp-smush-browse")&&(i("div.wp-smush-scan-result div.wp-smush-notice").hide(),i("div.wp-smush-info").remove()),window.SUI.openModal("wp-smush-list-dialog",t.currentTarget,i("#wp-smush-list-dialog .sui-box-header [data-modal-close]")[0],!0),e.initFileTree()})),i("#wp-smush-select-dir").on("click",(function(t){if(t.preventDefault(),!i(this).prop("disabled")){var s=i(this);i("div.wp-smush-list-dialog div.sui-box-body").css({opacity:"0.8"}),i("div.wp-smush-list-dialog div.sui-box-body a").off("click"),s.prop("disabled",!0),s.addClass("sui-button-onload");var n=e.tree.getSelectedNodes(),a=[];n.forEach((function(e){a.push(e.key)}));var r={action:"image_list",smush_path:a,image_list_nonce:i('input[name="image_list_nonce"]').val()};i.post(ajaxurl,r,(function(t){window.SUI.closeModal(),t.success?(e.scanner=new o(t.data,0),e.showProgressDialog(t.data),e.scanner.scan()):window.SUI.openNotice("wp-smush-ajax-notice",t.data.message,{type:"warning"})}))}})),t.on("click","#cancel-directory-smush, #dialog-close-div, .wp-smush-cancel-dir",(function(t){t.preventDefault(),i(".wp-smush-cancel-dir").addClass("sui-button-onload"),e.scanner.cancel().done((function(){return window.location.href=e.wp_smush_msgs.directory_url}))})),t.on("click",".sui-icon-play, .wp-smush-resume-scan",(function(t){t.preventDefault(),e.scanner.resume()}));var a=window.location.search;new URLSearchParams(a).has("start")&&!this.triggered&&(this.triggered=!0,i("button.wp-smush-browse").trigger("click"))},initFileTree:function(){var e=this,t=i("button#wp-smush-select-dir"),s={type:"GET",url:ajaxurl,data:{action:"smush_get_directory_list",list_nonce:i('input[name="list_nonce"]').val()},cache:!1};Object.entries(e.tree).length>0||(e.tree=(0,n.createTree)(".wp-smush-list-dialog .content",{autoCollapse:!0,clickFolderMode:3,checkbox:!0,debugLevel:0,selectMode:3,tabindex:"0",keyboard:!0,quicksearch:!0,source:s,lazyLoad:function(e,t){t.result=new Promise((function(e,n){s.data.dir=t.node.key,i.ajax(s).done((function(t){return e(t)})).fail(n)}))},loadChildren:function(e,t){return t.node.fixSelection3AfterClick()},select:function(){return t.prop("disabled",!+e.tree.getSelectedNodes().length)},init:function(){return t.prop("disabled",!0)}}))},showProgressDialog:function(e){i(".wp-smush-progress-dialog .sui-progress-state-text").html("0/"+e+" "+self.wp_smush_msgs.progress_smushed),window.SUI.openModal("wp-smush-progress-dialog","dialog-close-div",void 0,!1)},updateProgressBar:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e>100&&(e=100),i(".sui-progress-block .sui-progress-text span").text(e+"%"),i(".sui-progress-block .sui-progress-bar span").width(e+"%"),e>=90&&i(".sui-progress-state .sui-progress-state-text").text("Finalizing..."),t&&i(".sui-progress-state .sui-progress-state-text").text("Cancelling...")}},WP_Smush.directory.init()},3065:function(){!function(){"use strict";WP_Smush.helpers={init:function(){},formatBytes:function(e,t){var s=1024,i=["KB","MB","GB","TB","PB"];if(Math.abs(e)<s)return e+" B";var n=-1;do{e/=s,++n}while(Math.abs(e)>=s&&n<i.length-1);return e.toFixed(t)+" "+i[n]},getSizeFromString:function(e){return e.replace(/[a-zA-Z]/g,"").trim()},getFormatFromString:function(e){return e.replace(/[0-9.]/g,"").trim()},precise_round:function(e,t){var s=e>=0?1:-1;return e=e>100?100:e,Math.round(e*Math.pow(10,t)+.001*s)/Math.pow(10,t)},showErrorNotice:function(e){if(void 0!==e){var t="<p>".concat(e,"</p>");SUI.openNotice("wp-smush-ajax-notice",t,{type:"error",icon:"info"});var s=document.querySelector(".sui-button-onload");s&&s.classList.remove("sui-button-onload")}},resetSettings:function(){var e=document.getElementById("wp_smush_reset"),t=new XMLHttpRequest;t.open("POST",ajaxurl+"?action=reset_settings",!0),t.setRequestHeader("Content-type","application/x-www-form-urlencoded"),t.onload=function(){if(200===t.status){var e=JSON.parse(t.response);void 0!==e.success&&e.success&&(window.location.href=wp_smush_msgs.smush_url)}else window.console.log("Request failed. Returned status of "+t.status)},t.send("_ajax_nonce="+e.value)}},WP_Smush.helpers.init()}()},206:function(){!function(e){"use strict";if(e("#wp-smush-s3support-alert").length){var t={type:"warning",icon:"info",dismiss:{show:!0,label:wp_smush_msgs.noticeDismiss,tooltip:wp_smush_msgs.noticeDismissTooltip}};window.SUI.openNotice("wp-smush-s3support-alert",e("#wp-smush-s3support-alert").data("message"),t)}function s(t){var s=e(t.currentTarget).closest(".smush-notice");s.fadeTo(100,0,(function(){return s.slideUp(100,(function(){return s.remove()}))}))}e("#wp-smush-s3support-alert").on("click","button",(function(){e.post(ajaxurl,{action:"dismiss_s3support_alert"})})),e("#wp-smush-api-message button.sui-button-icon").on("click",(function(t){t.preventDefault();var s=e("#wp-smush-api-message");s.slideUp("slow",(function(){s.remove()})),e.post(ajaxurl,{action:"hide_api_message"})})),e(".smush-notice .smush-notice-act").on("click",(function(e){s(e)})),e(".smush-notice .smush-notice-dismiss").on("click",(function(t){s(t),e.post(ajaxurl,{action:"dismiss_upgrade_notice"})})),e(".wp-smush-update-info").on("click",".notice-dismiss",(function(t){t.preventDefault(),s(t),e.post(ajaxurl,{action:"dismiss_update_info"})}))}(jQuery)},3579:function(){!function(){"use strict";WP_Smush.onboarding={membership:"free",onboardingModal:document.getElementById("smush-onboarding-dialog"),scanFilesModal:document.getElementById("checking-files-dialog"),settings:{first:!0,last:!1,slide:"start",value:!1},selection:{auto:!0,lossy:!0,strip_exif:!0,original:!1,lazy_load:!0,usage:!1},contentContainer:document.getElementById("smush-onboarding-content"),onboardingSlides:["start","auto","lossy","strip_exif","original","lazy_load","usage"],touchX:null,touchY:null,init:function(){if(this.onboardingModal){var e=document.getElementById("smush-onboarding");this.membership=e.dataset.type,"pro"!==this.membership&&(this.onboardingSlides=["start","auto","strip_exif","lazy_load","usage"],this.selection.lossy=!1),"false"===e.dataset.tracking&&this.onboardingSlides.pop(),this.renderTemplate();var t=this.onboardingModal.querySelector(".smush-onboarding-skip-link");t&&t.addEventListener("click",this.skipSetup),window.SUI.openModal("smush-onboarding-dialog","checking-files-dialog",void 0,!1)}},handleTouchStart:function(e){var t=e.touches[0];this.touchX=t.clientX,this.touchY=t.clientY},handleTouchMove:function(e){if(this.touchX&&this.touchY){var t=e.touches[0].clientX,s=e.touches[0].clientY,i=this.touchX-t,n=this.touchY-s;Math.abs(i)>Math.abs(n)&&(i>0?!1===WP_Smush.onboarding.settings.last&&WP_Smush.onboarding.next(null,"next"):!1===WP_Smush.onboarding.settings.first&&WP_Smush.onboarding.next(null,"prev")),this.touchX=null,this.touchY=null}},renderTemplate:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none",s=this.onboardingModal.querySelector('input[type="checkbox"]');s&&(this.selection[s.id]=s.checked);var i=WP_Smush.onboarding.template("smush-onboarding"),n=i(this.settings);n&&(this.contentContainer.innerHTML=n,"none"===t?this.contentContainer.classList.add("loaded"):(this.contentContainer.classList.remove("loaded"),this.contentContainer.classList.add(t),setTimeout((function(){e.contentContainer.classList.add("loaded"),e.contentContainer.classList.remove(t)}),600))),this.onboardingModal.addEventListener("touchstart",this.handleTouchStart,!1),this.onboardingModal.addEventListener("touchmove",this.handleTouchMove,!1),this.bindSubmit()},bindSubmit:function(){var e=this.onboardingModal.querySelector('button[type="submit"]'),t=this;e&&e.addEventListener("click",(function(e){e.preventDefault();var s=t.onboardingModal.querySelector('input[type="checkbox"]');s&&(t.selection[s.id]=s.checked);var i=document.getElementById("smush_quick_setup_nonce"),n=new XMLHttpRequest;n.open("POST",ajaxurl+"?action=smush_setup",!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.onload=function(){200===n.status?WP_Smush.onboarding.showScanDialog():window.console.log("Request failed. Returned status of "+n.status)},n.send("smush_settings="+JSON.stringify(t.selection)+"&_ajax_nonce="+i.value)}))},next:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=this.onboardingSlides.indexOf(this.settings.slide),i=0;i=t?"next"===t?s+1:s-1:null!==e&&e.classList.contains("next")?s+1:s-1;var n=null!==e&&e.classList.contains("next")?"fadeInRight":"fadeInLeft";this.settings={first:0===i,last:i+1===this.onboardingSlides.length,slide:this.onboardingSlides[i],value:this.selection[this.onboardingSlides[i]]},this.renderTemplate(n)},goTo:function(e){var t=this.onboardingSlides.indexOf(e);this.settings={first:0===t,last:t+1===this.onboardingSlides.length,slide:e,value:this.selection[e]},this.renderTemplate()},skipSetup:function(){var e=document.getElementById("smush_quick_setup_nonce"),t=new XMLHttpRequest;t.open("POST",ajaxurl+"?action=skip_smush_setup&_ajax_nonce="+e.value),t.onload=function(){200===t.status?WP_Smush.onboarding.showScanDialog():window.console.log("Request failed. Returned status of "+t.status)},t.send()},showScanDialog:function(){window.SUI.closeModal(),window.SUI.openModal("checking-files-dialog","wpbody-content",void 0,!1);var e=document.getElementById("wp_smush_options_nonce");setTimeout((function(){var t=new XMLHttpRequest;t.open("POST",ajaxurl+"?action=scan_for_resmush",!0),t.setRequestHeader("Content-type","application/x-www-form-urlencoded"),t.onload=function(){var e=document.querySelector("#smush-onboarding-dialog");e.parentNode.removeChild(e),200===t.status?setTimeout((function(){window.location.search="page=smush-bulk"}),1e3):window.console.log("Request failed. Returned status of "+t.status)},t.send("type=media&get_ui=false&process_settings=false&wp_smush_options_nonce="+e.value)}),3e3)},hideUpgradeModal:function(){var e=new XMLHttpRequest;e.open("POST",ajaxurl+"?action=hide_new_features"),e.send()}},WP_Smush.onboarding.template=_.memoize((function(e){var t,s={evaluate:/<#([\s\S]+?)#>/g,interpolate:/{{{([\s\S]+?)}}}/g,escape:/{{([^}]+?)}}(?!})/g,variable:"data"};return function(i){return _.templateSettings=s,(t=t||_.template(document.getElementById(e).innerHTML))(i)}})),window.addEventListener("load",(function(){return WP_Smush.onboarding.init()}))}()},1110:function(){!function(){"use strict";WP_Smush.CDN={cdnEnableButton:document.getElementById("smush-enable-cdn"),cdnDisableButton:document.getElementById("smush-cancel-cdn"),cdnStatsBox:document.querySelector(".smush-cdn-stats"),init:function(){var e=this;this.cdnEnableButton&&this.cdnEnableButton.addEventListener("click",(function(t){t.preventDefault(),t.currentTarget.classList.add("sui-button-onload"),e.toggle_cdn(!0)})),this.cdnDisableButton&&this.cdnDisableButton.addEventListener("click",(function(t){t.preventDefault(),t.currentTarget.classList.add("sui-button-onload"),e.toggle_cdn(!1)})),this.updateStatsBox()},toggle_cdn:function(e){var t=document.getElementsByName("wp_smush_options_nonce"),s=new XMLHttpRequest;s.open("POST",ajaxurl+"?action=smush_toggle_cdn",!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.onload=function(){if(200===s.status){var e=JSON.parse(s.response);void 0!==e.success&&e.success?window.location.search="page=smush-cdn":void 0!==e.data.message&&WP_Smush.helpers.showErrorNotice(e.data.message)}else WP_Smush.helpers.showErrorNotice("Request failed. Returned status of "+s.status)},s.send("param="+e+"&_ajax_nonce="+t[0].value)},updateStatsBox:function(){var e=this;if(void 0!==this.cdnStatsBox&&this.cdnStatsBox&&window.location.search.includes("view=cdn")){this.toggleElements();var t=new XMLHttpRequest;t.open("POST",ajaxurl+"?action=get_cdn_stats",!0),t.onload=function(){if(200===t.status){var s=JSON.parse(t.response);void 0!==s.success&&s.success?e.toggleElements():void 0!==s.data.message&&WP_Smush.helpers.showErrorNotice(s.data.message)}else WP_Smush.helpers.showErrorNotice("Request failed. Returned status of "+t.status)},t.send()}},toggleElements:function(){for(var e=this.cdnStatsBox.querySelector(".sui-icon-loader"),t=this.cdnStatsBox.querySelectorAll(".wp-smush-stats > :not(.sui-icon-loader)"),s=0;s<t.length;s++)t[s].classList.toggle("sui-hidden");e.classList.toggle("sui-hidden")}},WP_Smush.CDN.init()}()},5972:function(){!function(){"use strict";WP_Smush.Lazyload={lazyloadEnableButton:document.getElementById("smush-enable-lazyload"),lazyloadDisableButton:document.getElementById("smush-cancel-lazyload"),init:function(){var e=this,t=this;this.lazyloadEnableButton&&this.lazyloadEnableButton.addEventListener("click",(function(t){t.preventDefault(),t.currentTarget.classList.add("sui-button-onload"),e.toggle_lazy_load(!0)})),this.lazyloadDisableButton&&this.lazyloadDisableButton.addEventListener("click",(function(t){t.preventDefault(),t.currentTarget.classList.add("sui-button-onload"),e.toggle_lazy_load(!1)}));var s=document.getElementById("smush-remove-spinner");s&&s.addEventListener("click",(function(t){t.preventDefault(),e.removeLoaderIcon()}));var i=document.getElementById("smush-remove-placeholder");i&&i.addEventListener("click",(function(t){t.preventDefault(),e.removeLoaderIcon("placeholder")}));var n=document.querySelectorAll(".smush-ll-remove");n&&0<n.length&&n.forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault(),e.target.closest("li").style.display="none",t.remove(e.target.dataset.id,e.target.dataset.type)}))})),this.handlePredefinedPlaceholders()},handlePredefinedPlaceholders:function(){var e=this,t=document.getElementById("placeholder-icon-1");t&&t.addEventListener("click",(function(){return e.changeColor("#F3F3F3")}));var s=document.getElementById("placeholder-icon-2");s&&s.addEventListener("click",(function(){return e.changeColor("#333333")}))},changeColor:function(e){document.getElementById("smush-color-picker").value=e,document.querySelector(".sui-colorpicker-hex .sui-colorpicker-value > span > span").style.backgroundColor=e,document.querySelector(".sui-colorpicker-hex .sui-colorpicker-value > input").value=e},toggle_lazy_load:function(e){var t=document.getElementsByName("wp_smush_options_nonce"),s=new XMLHttpRequest;s.open("POST",ajaxurl+"?action=smush_toggle_lazy_load",!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.onload=function(){if(200===s.status){var e=JSON.parse(s.response);void 0!==e.success&&e.success?window.location.search="page=smush-lazy-load":void 0!==e.data.message&&(WP_Smush.helpers.showErrorNotice(e.data.message),document.querySelector(".sui-button-onload").classList.remove("sui-button-onload"))}else WP_Smush.helpers.showErrorNotice("Request failed. Returned status of "+s.status),document.querySelector(".sui-button-onload").classList.remove("sui-button-onload")},s.send("param="+e+"&_ajax_nonce="+t[0].value)},addLoaderIcon:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"spinner";e||(e=wp.media({title:"Select or upload an icon",button:{text:"Select icon"},multiple:!1})).on("select",(function(){var s=e.state().get("selection").first().toJSON(),i=document.getElementById("smush-"+t+"-icon-preview");i.style.backgroundImage='url("'+s.url+'")',i.style.display="block",document.getElementById("smush-"+t+"-icon-file").setAttribute("value",s.id),document.getElementById("smush-upload-"+t).style.display="none";var n=document.getElementById("smush-remove-"+t);n.querySelector("span").innerHTML=s.filename,n.style.display="block"})),e.open()},removeLoaderIcon:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"spinner",t=document.getElementById("smush-"+e+"-icon-preview");t.style.backgroundImage="",t.style.display="none",document.getElementById("smush-upload-"+e).style.display="block",document.getElementById("smush-remove-"+e).style.display="none",document.getElementById("smush-"+e+"-icon-file").setAttribute("value","")},remove:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"spinner",s=document.getElementsByName("wp_smush_options_nonce"),i=new XMLHttpRequest;i.open("POST",ajaxurl+"?action=smush_remove_icon",!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.send("id="+e+"&type="+t+"&_ajax_nonce="+s[0].value)}},WP_Smush.Lazyload.init()}()},4933:function(){!function(e){"use strict";function t(t,s){var i=new XMLHttpRequest;i.open("POST",ajaxurl+"?action=smush_save_settings",!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.onload=function(){if(e("#save-settings-button").removeClass("sui-button-onload-text sui-button-onload"),200===i.status){var t=JSON.parse(i.response);void 0!==t.success&&t.success?function(e){var t="<p>".concat(e,"</p>"),s={type:"success",icon:"check"};SUI.openNotice("wp-smush-ajax-notice",t,s);var i=document.querySelector(".sui-button-onload");i&&i.classList.remove("sui-button-onload")}(wp_smush_msgs.settingsUpdated):t.data&&t.data.message?WP_Smush.helpers.showErrorNotice(t.data.message):WP_Smush.helpers.showErrorNotice("Request failed.")}else WP_Smush.helpers.showErrorNotice("Request failed. Returned status of "+i.status)},i.send("page="+s+"&"+t+"&_ajax_nonce="+wp_smush_msgs.nonce)}e("form#smush-bulk-form").on("submit",(function(s){s.preventDefault(),e("#save-settings-button").addClass("sui-button-onload"),t(e(this).serialize(),"bulk"),function(){e("#save-settings-button").addClass("sui-button-onload");var t={action:"scan_for_resmush",wp_smush_options_nonce:e("#wp_smush_options_nonce").val(),type:"media"};e.post(ajaxurl,e.param(t)).done((function(){e("#save-settings-button").removeClass("sui-button-onload")}))}()})),e("form#smush-lazy-load-form").on("submit",(function(s){s.preventDefault(),e("#save-settings-button").addClass("sui-button-onload-text"),t(e(this).serialize(),"lazy-load")})),e("form#smush-cdn-form").on("submit",(function(s){s.preventDefault(),e("#save-settings-button").addClass("sui-button-onload-text"),t(e(this).serialize(),"cdn")})),e("form#smush-integrations-form").on("submit",(function(s){s.preventDefault(),e("#save-settings-button").addClass("sui-button-onload-text"),t(e(this).serialize(),"integrations")})),e("form#smush-tools-form").on("submit",(function(s){s.preventDefault(),e("#save-settings-button").addClass("sui-button-onload-text"),t(e(this).serialize(),"tools")})),e("form#smush-settings-form").on("submit",(function(s){s.preventDefault(),e("#save-settings-button").addClass("sui-button-onload-text"),t(e(this).serialize(),"settings")})),e("input[name=keep_data]").on("change",(function(e){var t="keep_data-true"===e.target.id?"keep_data-false":"keep_data-true";e.target.parentNode.classList.add("active"),document.getElementById(t).parentNode.classList.remove("active")})),e("input#detection").on("click",(function(){var t=e(".smush-highlighting-notice"),s=e(".smush-highlighting-warning");e(this).is(":checked")?t.length>0?t.show():s.show():(t.hide(),s.hide())}))}(jQuery)},9446:function(e,t){"use strict";function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var s=0;s<t.length;s++){var i=t[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var o=0,a=function(){function e(t,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"media";i(this,e),this.errors=[];var a=jQuery(".bulk-smush-wrapper .sui-progress-state-text");return this.smushed=parseInt(a.find("span:first-child").html()),this.total=parseInt(a.find("span:last-child").html()),this.skip_resmush=!(void 0===t.data("smush")||!t.data("smush")),this.button=jQuery(t[0]),this.is_bulk=!!s(n)&&n,this.url=ajaxurl,this.log=jQuery(".smush-final-log"),this.deferred=jQuery.Deferred(),this.deferred.errors=[],this.setIds(),this.is_bulk_resmush=0<wp_smushit_data.resmush.length&&!this.skip_resmush,this.status=this.button.parent().prev(".smush-status"),this.smush_type=o,this.single_ajax_suffix="nextgen"===this.smush_type?"smush_manual_nextgen":"wp_smushit_manual",this.bulk_ajax_suffix="nextgen"===this.smush_type?"wp_smushit_nextgen_bulk":"wp_smushit_bulk",this.url=this.is_bulk?e.smushAddParams(this.url,{action:this.bulk_ajax_suffix}):e.smushAddParams(this.url,{action:this.single_ajax_suffix}),this.start(),this.run(),this.bindDeferredEvents(),this.cancelAjax(),this.deferred}var t,a,r;return t=e,r=[{key:"smushAddParams",value:function(e,t){return jQuery.isEmptyObject(t)||(e+=(e.indexOf("?")>=0?"&":"?")+jQuery.param(t)),e}},{key:"membershipValidity",value:function(e){var t=jQuery("#wp-smush-invalid-member");void 0!==e&&void 0!==e.show_warning&&t.length>0&&(e.show_warning?t.show():t.hide())}},{key:"ajax",value:function(e,t,s,i){var n=jQuery.param({is_bulk_resmush:e,attachment_id:t,_nonce:i});return jQuery.ajax({type:"GET",data:n,url:s,timeout:wp_smushit_data.timeout,dataType:"json"})}},{key:"setProSavings",value:function(){var e=wp_smushit_data.savings_percent>0?wp_smushit_data.savings_percent:0,t=wp_smushit_data.savings_bytes>0?wp_smushit_data.savings_bytes:0,s=2.22058824;e>49&&(s=1.22054412),e>0&&(e*=s,t*=s),wp_smushit_data.pro_savings={percent:WP_Smush.helpers.precise_round(e,1),savings_bytes:WP_Smush.helpers.formatBytes(t,1)}}},{key:"updateStats",value:function(t){var s=void 0!==t&&"nextgen"===t,i=0;wp_smushit_data.savings_bytes=parseInt(wp_smushit_data.size_before)-parseInt(wp_smushit_data.size_after);var n=WP_Smush.helpers.formatBytes(wp_smushit_data.savings_bytes,1),o=jQuery(".wp-smush-savings .wp-smush-stats-human");s?o.html(n):(o.html(WP_Smush.helpers.getFormatFromString(n)),jQuery(".sui-summary-large.wp-smush-stats-human").html(WP_Smush.helpers.getSizeFromString(n))),wp_smushit_data.savings_percent=WP_Smush.helpers.precise_round(parseInt(wp_smushit_data.savings_bytes)/parseInt(wp_smushit_data.size_before)*100,1),isNaN(wp_smushit_data.savings_percent)||jQuery(".wp-smush-savings .wp-smush-stats-percent").html(wp_smushit_data.savings_percent),void 0!==wp_smushit_data.savings_bytes&&void 0!==wp_smushit_data.savings_resize&&(i=parseInt(wp_smushit_data.savings_bytes)-parseInt(wp_smushit_data.savings_resize))>0&&jQuery("li.super-smush-attachments span.smushed-savings").html(WP_Smush.helpers.formatBytes(i,1)),s?jQuery(".sui-summary-details span.wp-smush-total-optimised").html(wp_smushit_data.count_images):jQuery("span.smushed-items-count span.wp-smush-count-total span.wp-smush-total-optimised").html(wp_smushit_data.count_images),jQuery("span.smushed-items-count span.wp-smush-count-resize-total span.wp-smush-total-optimised").html(wp_smushit_data.count_resize);var a=jQuery("li.super-smush-attachments .smushed-count");a.length&&void 0!==wp_smushit_data.count_supersmushed&&a.html(wp_smushit_data.count_supersmushed);var r=jQuery(".smush-conversion-savings");if(r.length>0&&void 0!==wp_smushit_data.savings_conversion&&""!==wp_smushit_data.savings_conversion){var u=r.find(".wp-smush-stats");u.length>0&&u.html(WP_Smush.helpers.formatBytes(wp_smushit_data.savings_conversion,1))}var d=jQuery(".smush-resize-savings");if(d.length>0&&void 0!==wp_smushit_data.savings_resize&&""!==wp_smushit_data.savings_resize){var l=parseInt(wp_smushit_data.savings_resize),c=d.find(".wp-smush-stats"),h=d.find(".wp-smush-stats-label-message");l>0&&c.length>0&&(h.length>0&&h.hide(),c.html(WP_Smush.helpers.formatBytes(wp_smushit_data.savings_resize,1)))}if(e.setProSavings(),void 0!==wp_smushit_data.pro_savings){var p=jQuery(".smush-avg-pro-savings");if(p.length>0){var m=p.find(".wp-smush-stats-percent"),f=p.find(".wp-smush-stats-human");m.length>0&&void 0!==wp_smushit_data.pro_savings.percent&&""!==wp_smushit_data.pro_savings.percent&&m.html(wp_smushit_data.pro_savings.percent),f.length>0&&void 0!==wp_smushit_data.pro_savings.savings_bytes&&""!==wp_smushit_data.pro_savings.savings_bytes&&f.html(wp_smushit_data.pro_savings.savings_bytes)}}if(jQuery(".smush-sidenav .wp-smush-remaining-count").length){var g=0;void 0!==wp_smushit_data.unsmushed&&wp_smushit_data.unsmushed.length>0&&(g+=wp_smushit_data.unsmushed.length),void 0!==wp_smushit_data.resmush&&wp_smushit_data.resmush.length>0&&(g+=wp_smushit_data.resmush.length),e.updateRemainingCount(g)}}},{key:"updateImageStats",value:function(e){if(0!==e){var t=jQuery(".attachment-info .file-size");if(t.contents().filter((function(){return 3===this.nodeType})).text()!==" "+e){var s=t.contents().filter((function(){return 1===this.nodeType})).text();t.html("<strong>"+s+"</strong> "+e)}}}},{key:"updateRemainingCount",value:function(e){var t=jQuery(".wp-smush-remaining-count");t.length&&t.html(e);var s=jQuery(".smush-sidenav .wp-smush-remaining-count"),i=jQuery(".smush-sidenav .smush-bulk .sui-icon-check-tick");s.length&&i.length&&(e>0?(s.removeClass("sui-hidden"),i.addClass("sui-hidden")):(jQuery(".sui-summary-smush .smush-stats-icon").addClass("sui-hidden"),i.removeClass("sui-hidden"),s.addClass("sui-hidden")))}},{key:"updateLocalizedStats",value:function(e,t){void 0!==window.wp_smushit_data&&("media"===t?(wp_smushit_data.count_images=parseInt(wp_smushit_data.count_images)+parseInt(e.count),e.is_lossy&&(wp_smushit_data.count_supersmushed=parseInt(wp_smushit_data.count_supersmushed)+1),wp_smushit_data.savings_resize=void 0!==e.savings_resize.bytes?parseInt(wp_smushit_data.savings_resize)+parseInt(e.savings_resize.bytes):parseInt(wp_smushit_data.savings_resize),wp_smushit_data.count_resize=void 0!==e.savings_resize.bytes?parseInt(wp_smushit_data.count_resize)+1:wp_smushit_data.count_resize,wp_smushit_data.savings_conversion=void 0!==e.savings_conversion&&void 0!==e.savings_conversion.bytes?parseInt(wp_smushit_data.savings_conversion)+parseInt(e.savings_conversion.bytes):parseInt(wp_smushit_data.savings_conversion)):"directory_smush"===t?wp_smushit_data.count_images=parseInt(wp_smushit_data.count_images)+1:"nextgen"===t&&(wp_smushit_data.count_supersmushed=parseInt(wp_smushit_data.count_supersmushed)+1,wp_smushit_data.count_images=parseInt(wp_smushit_data.count_images)+parseInt(e.count)),e.size_before>e.size_after&&(wp_smushit_data.size_before=void 0!==e.size_before?parseInt(wp_smushit_data.size_before)+parseInt(e.size_before):parseInt(wp_smushit_data.size_before),wp_smushit_data.size_after=void 0!==e.size_after?parseInt(wp_smushit_data.size_after)+parseInt(e.size_after):parseInt(wp_smushit_data.size_after)),void 0!==e.savings_resize&&(wp_smushit_data.size_before=void 0!==e.savings_resize.size_before?parseInt(wp_smushit_data.size_before)+parseInt(e.savings_resize.size_before):parseInt(wp_smushit_data.size_before),wp_smushit_data.size_after=void 0!==e.savings_resize.size_after?parseInt(wp_smushit_data.size_after)+parseInt(e.savings_resize.size_after):parseInt(wp_smushit_data.size_after)),void 0!==e.savings_conversion&&(wp_smushit_data.size_before=void 0!==e.savings_conversion.size_before?parseInt(wp_smushit_data.size_before)+parseInt(e.savings_conversion.size_before):parseInt(wp_smushit_data.size_before),wp_smushit_data.size_after=void 0!==e.savings_conversion.size_after?parseInt(wp_smushit_data.size_after)+parseInt(e.savings_conversion.size_after):parseInt(wp_smushit_data.size_after)))}},{key:"prepareErrorRow",value:function(e,t,s,i,n){var o='<div class="smush-bulk-error-row"><div class="smush-bulk-image-data">'+(void 0===s?'<i class="sui-icon-photo-picture" aria-hidden="true"></i>':s)+'<span class="smush-image-name">'+("undefined"===t||void 0===t?"undefined":t)+'</span><span class="smush-image-error">'+e+"</span></div>";return"media"===n&&(o=o+'<div class="smush-bulk-image-actions"><button type="button" class="sui-button-icon sui-tooltip sui-tooltip-constrained sui-tooltip-top-right smush-ignore-image" data-tooltip="'+window.wp_smush_msgs.error_ignore+'" data-id="'+i+'"><i class="sui-icon-eye-hide" aria-hidden="true"></i></button></div>'),o+="</div>"}},{key:"updateSmushIds",value:function(e){if(void 0!==wp_smushit_data.unsmushed&&wp_smushit_data.unsmushed.length>0){var t=wp_smushit_data.unsmushed.indexOf(e);t>-1&&wp_smushit_data.unsmushed.splice(t,1)}if(void 0!==wp_smushit_data.resmush&&wp_smushit_data.resmush.length>0){var s=wp_smushit_data.resmush.indexOf(e);s>-1&&wp_smushit_data.resmush.splice(s,1)}}}],(a=[{key:"setIds",value:function(){var e=[];"object"===s(e=0<wp_smushit_data.resmush.length&&!this.skip_resmush?0<wp_smushit_data.unsmushed.length?wp_smushit_data.resmush.concat(wp_smushit_data.unsmushed):wp_smushit_data.resmush:wp_smushit_data.unsmushed)?this.ids=e.filter((function(e,t,s){return t===s.indexOf(e)})):this.ids=e}},{key:"start",value:function(){this.button.prop("disabled",!0),this.button.addClass("wp-smush-started"),this.bulkStart(),this.singleStart()}},{key:"bulkStart",value:function(){this.is_bulk&&(jQuery(".wp-smush-bulk-wrapper").addClass("sui-hidden"),jQuery(".sui-notice-top").remove(),jQuery(".wp-smush-bulk-progress-bar-wrapper .sui-notice-warning:first-of-type").hide(),0>=jQuery("div.smush-final-log .smush-bulk-error-row").length&&jQuery("div.smush-final-log").hide(),jQuery(".bulk-smush-wrapper .wp-smush-bulk-progress-bar-wrapper, #wp-smush-running-notice").removeClass("sui-hidden"))}},{key:"singleStart",value:function(){this.is_bulk||(this.button.html('<span class="spinner wp-smush-progress">'+window.wp_smush_msgs.smushing+"</span>"),this.status.removeClass("error"))}},{key:"enableButton",value:function(){this.button.prop("disabled",!1),jQuery(".wp-smush-all").prop("disabled",!1),jQuery("button.wp-smush-scan, a.wp-smush-lossy-enable, button.wp-smush-resize-enable, button#save-settings-button").prop("disabled",!1)}},{key:"singleDone",value:function(){if(!this.is_bulk){var t=this;this.button.html(window.wp_smush_msgs.all_done),this.request.done((function(s){if(void 0!==s.data){var i=t.status.parent();e.membershipValidity(s.data),s.success?i.html(s.data):(t.status.addClass("error"),t.status.html(s.data.error_msg),t.button.html(window.smush_vars.strings.stats_label)),e.updateImageStats(s.data.new_size)}t.enableButton()})).fail((function(e){t.status.html(e.data),t.status.addClass("error"),t.enableButton()}))}}},{key:"syncStats",value:function(){var t=jQuery("div.wp-smush-bulk-progress-bar-wrapper div.wp-smush-count.tc"),s=t.html();t.html(window.wp_smush_msgs.sync_stats),jQuery.ajax({type:"GET",url:this.url,data:{action:"get_stats"},success:function(t){t&&void 0!==t&&(t=t.data,jQuery.extend(wp_smushit_data,{count_images:t.count_images,count_smushed:t.count_smushed,count_total:t.count_total,count_resize:t.count_resize,count_supersmushed:t.count_supersmushed,savings_bytes:t.savings_bytes,savings_conversion:t.savings_conversion,savings_resize:t.savings_resize,size_before:t.size_before,size_after:t.size_after}),e.updateStats(this.smush_type))}}).always((function(){return t.html(s)}))}},{key:"bulkDone",value:function(){if(this.is_bulk){this.enableButton();var e=jQuery(".sui-summary-smush .smush-stats-icon");if(0===this.ids.length)e.addClass("sui-hidden"),jQuery(".bulk-smush-wrapper .wp-smush-all-done, .wp-smush-pagespeed-recommendation").removeClass("sui-hidden"),jQuery(".wp-smush-bulk-wrapper").addClass("sui-hidden"),jQuery(".wp-smush-bulk-progress-bar-wrapper").addClass("sui-hidden"),document.getElementById("smush-box-bulk-upgrade")&&(document.getElementById("smush-box-bulk-upgrade").classList.remove("sui-hidden"),document.getElementById("wp-smush-all-smushed-text").classList.remove("sui-hidden"),document.getElementById("wp-smush-pending-to-smush-text").classList.add("sui-hidden")),this._updateProgress(0,0);else{e.removeClass("sui-icon-loader sui-loading sui-hidden").addClass("sui-icon-info sui-warning");var t=jQuery(".bulk-smush-wrapper .wp-smush-resmush-notice");t.length>0?t.show():jQuery(".bulk-smush-wrapper .wp-smush-remaining").removeClass("sui-hidden")}jQuery(".wp-resmush.wp-smush-action, .wp-smush-scan").removeProp("disabled")}}},{key:"freeExceeded",value:function(){var e=jQuery(".wp-smush-bulk-progress-bar-wrapper");e.addClass("wp-smush-exceed-limit"),e.find(".sui-progress-block .wp-smush-cancel-bulk").addClass("sui-hidden"),e.find(".sui-progress-block .wp-smush-all").removeClass("sui-hidden"),e.find("i.sui-icon-loader").addClass("sui-icon-info").removeClass("sui-icon-loader").removeClass("sui-loading"),document.getElementById("bulk-smush-resume-button").classList.remove("sui-hidden"),document.getElementById("smush-box-bulk-upgrade")&&document.getElementById("smush-box-bulk-upgrade").classList.remove("sui-hidden")}},{key:"updateProgress",value:function(t){if(this.is_bulk_resmush||this.is_bulk){var s=0;t&&void 0!==t.data&&void 0!==t.data.stats&&e.updateLocalizedStats(t.data.stats,this.smush_type),this.is_bulk_resmush?(t.success&&(wp_smushit_data.resmush.length>0?jQuery(".wp-smush-images-remaining").html(wp_smushit_data.resmush.length):0===wp_smushit_data.resmush.length&&0===this.ids.length&&(jQuery(".bulk-resmush-wrapper .wp-smush-all-done, .wp-smush-pagespeed-recommendation").removeClass("sui-hidden"),jQuery(".wp-smush-resmush-wrap, .wp-smush-bulk-progress-bar-wrapper").addClass("sui-hidden"))),void 0!==this.ids&&void 0!==this.total&&this.total>0&&(s=(this.smushed+this.errors.length)/this.total*100)):s=(this.smushed+this.errors.length)/this.total*100,"nextgen"===this.smush_type&&wp_smushit_data.resmush.length>0&&this.smushed+this.errors.length<=1&&(wp_smushit_data.count_images-=wp_smushit_data.resmush.length+1),0===this.ids.length&&("nextgen"!==this.smush_type&&this.syncStats(),jQuery(".bulk-smush-wrapper .wp-smush-all-done, .wp-smush-pagespeed-recommendation").removeClass("sui-hidden"),jQuery(".wp-smush-bulk-wrapper").addClass("sui-hidden")),void 0!==this.ids&&e.updateRemainingCount(this.ids.length),this._updateProgress(this.smushed+this.errors.length,WP_Smush.helpers.precise_round(s,1)),0===this.ids.length&&"nextgen"!==this.smush_type||e.updateStats(this.smush_type)}}},{key:"_updateProgress",value:function(e,t){(this.is_bulk||this.is_bulk_resmush)&&(jQuery("span.wp-smush-images-percent").html(t+"%"),jQuery(".bulk-smush-wrapper .wp-smush-progress-inner").css("width",t+"%"),jQuery(".bulk-smush-wrapper .sui-progress-state-text").find("span:first-child").html(e).find("span:last-child").html(this.total))}},{key:"continue",value:function(){var e=this.button.attr("continue_smush");return void 0===e&&(e=!0),"false"!==e&&e||(e=!1),e&&this.ids.length>0&&this.is_bulk}},{key:"callAjax",value:function(){if(0!==o&&void 0!==o&&10>performance.now()-o)return this.freeExceeded(),this.deferred;var t="";this.current_id=this.is_bulk?this.ids.shift():this.button.data("id"),e.updateSmushIds(this.current_id);var s=this.button.parent().find("#_wp_smush_nonce");s&&(t=s.val());var i=this;return this.request=e.ajax(this.is_bulk_resmush,this.current_id,this.url,t).done((function(t){if(void 0===t.success||void 0!==t.success&&!1===t.success&&void 0!==t.data&&"limit_exceeded"!==t.data.error){i.errors.push(i.current_id);var s=e.prepareErrorRow(t.data.error_message,t.data.file_name,t.data.thumbnail,i.current_id,i.smush_type);i.log.show(),i.errors.length>5?jQuery(".smush-bulk-errors-actions").removeClass("sui-hidden"):i.log.find(".smush-bulk-errors").append(s)}else void 0!==t.success&&t.success&&i.smushed++;e.membershipValidity(t.data),void 0!==t.data&&"limit_exceeded"===t.data.error&&"resolved"!==i.deferred.state()?(document.getElementById("bulk_smush_warning").classList.remove("sui-hidden"),i.button.attr("continue_smush",!1),wp_smushit_data.unsmushed.unshift(i.current_id),i.ids.unshift(i.current_id),o=performance.now(),i.freeExceeded()):i.is_bulk?i.updateProgress(t):0===i.ids.length&&i.syncStats(),i.singleDone()})).always((function(){i.continue()&&i.is_bulk?i.callAjax():i.deferred.resolve()})),this.deferred.errors=this.errors,this.deferred}},{key:"run",value:function(){this.is_bulk&&this.ids.length>0&&this.callAjax(),this.is_bulk||this.callAjax()}},{key:"bindDeferredEvents",value:function(){var e=this;this.deferred.done((function(){if(e.button.removeAttr("continue_smush"),e.errors.length){var t=window.wp_smush_msgs.error_in_bulk.replace("{{errors}}",e.errors.length).replace("{{total}}",e.total).replace("{{smushed}}",e.smushed);jQuery(".wp-smush-all-done").addClass("sui-notice-warning").removeClass("sui-notice-success").find("p").html(t)}e.bulkDone(),jQuery(".wp-smush-all:not(.wp-smush-finished), .wp-smush-scan").prop("disabled",!1)}))}},{key:"cancelAjax",value:function(){var e=this;jQuery(".wp-smush-cancel-bulk").on("click",(function(){e.button.attr("continue_smush",!1),e.syncStats(),e.request.abort(),e.enableButton(),e.button.removeClass("wp-smush-started"),wp_smushit_data.unsmushed.unshift(e.current_id),jQuery(".wp-smush-bulk-wrapper").removeClass("sui-hidden"),jQuery(".wp-smush-bulk-progress-bar-wrapper").addClass("sui-hidden")}))}}])&&n(t.prototype,a),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.Z=a},1442:function(){!function(){"use strict";WP_Smush.WebP={nonceField:document.getElementsByName("wp_smush_options_nonce"),toggleModuleButton:document.getElementById("smush-toggle-webp-button"),recheckStatusButton:document.getElementById("smush-webp-recheck"),recheckStatusLink:document.getElementById("smush-webp-recheck-link"),showWizardButton:document.getElementById("smush-webp-toggle-wizard"),init:function(){var e=this;this.maybeShowDeleteAllSuccessNotice(),this.toggleModuleButton&&this.toggleModuleButton.addEventListener("click",(function(t){return e.toggleWebp(t)})),this.recheckStatusButton&&this.recheckStatusButton.addEventListener("click",(function(t){t.preventDefault(),e.recheckStatus()})),this.recheckStatusLink&&this.recheckStatusLink.addEventListener("click",(function(t){t.preventDefault(),e.recheckStatus()})),document.getElementById("wp-smush-webp-delete-all")&&document.getElementById("wp-smush-webp-delete-all").addEventListener("click",(function(t){return e.deleteAll(t)})),this.showWizardButton&&this.showWizardButton.addEventListener("click",this.toggleWizard)},toggleWebp:function(e){var t=this;e.preventDefault();var s=e.currentTarget,i="enable"===s.dataset.action;s.classList.add("sui-button-onload");var n=new XMLHttpRequest;n.open("POST",ajaxurl+"?action=smush_webp_toggle",!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.onload=function(){var e=JSON.parse(n.response);if(200===n.status){if(void 0!==e.success&&e.success)t.runScan().onload=function(){window.location.href=window.wp_smush_msgs.localWebpURL};else void 0!==e.data.message&&(t.showNotice(e.data.message),s.classList.remove("sui-button-onload"))}else{var i=window.wp_smush_msgs.generic_ajax_error;e&&void 0!==e.data.message&&(i=e.data.message),t.showNotice(i),s.classList.remove("sui-button-onload")}},n.send("param="+i+"&_ajax_nonce="+this.nonceField[0].value)},recheckStatus:function(){var e=this;this.recheckStatusButton.classList.add("sui-button-onload");var t=new XMLHttpRequest;t.open("POST",ajaxurl+"?action=smush_webp_get_status",!0),t.setRequestHeader("Content-type","application/x-www-form-urlencoded"),t.onload=function(){e.recheckStatusButton.classList.remove("sui-button-onload");var s=!1,i=JSON.parse(t.response);200===t.status?(i.success?"1":"0")!==e.recheckStatusButton.dataset.isConfigured&&location.reload():s=window.wp_smush_msgs.generic_ajax_error;i&&i.data&&(s=i.data),s&&e.showNotice(s)},t.send("_ajax_nonce="+window.wp_smush_msgs.webp_nonce)},deleteAll:function(e){var t=this,s=e.currentTarget;s.classList.add("sui-button-onload");var i=!1,n=new XMLHttpRequest;n.open("POST",ajaxurl+"?action=smush_webp_delete_all",!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.onload=function(){var e=JSON.parse(n.response);200===n.status?void 0!==e.success&&e.success?t.runScan().onload=function(){location.search=location.search+"&notice=webp-deleted"}:i=window.wp_smush_msgs.generic_ajax_error:i=window.wp_smush_msgs.generic_ajax_error;if(e&&e.data&&e.data.message&&(i=e.data.message),i){s.classList.remove("sui-button-onload");var o='<p style="text-align: left;">'.concat(i,"</p>");window.SUI.openNotice("wp-smush-webp-delete-all-error-notice",o,{type:"error",icon:"info",autoclose:{show:!1}})}},n.send("_ajax_nonce="+this.nonceField[0].value)},toggleWizard:function(e){e.currentTarget.classList.add("sui-button-onload");var t=new XMLHttpRequest;t.open("GET",ajaxurl+"?action=smush_toggle_webp_wizard&_ajax_nonce="+window.wp_smush_msgs.webp_nonce,!0),t.onload=function(){return location.reload()},t.send()},runScan:function(){var e=new XMLHttpRequest,t=document.getElementsByName("wp_smush_options_nonce");return e.open("POST",ajaxurl+"?action=scan_for_resmush",!0),e.setRequestHeader("Content-type","application/x-www-form-urlencoded"),e.send("_ajax_nonce="+t[0].value),e},showNotice:function(e,t){if(void 0!==e){var s="<p>".concat(e,"</p>"),i={type:t||"error",icon:"info",dismiss:{show:!0,label:window.wp_smush_msgs.noticeDismiss,tooltip:window.wp_smush_msgs.noticeDismissTooltip},autoclose:{show:!1}};window.SUI.openNotice("wp-smush-ajax-notice",s,i)}},maybeShowDeleteAllSuccessNotice:function(){if(document.getElementById("wp-smush-webp-delete-all-notice")){var e="<p>".concat(document.getElementById("wp-smush-webp-delete-all-notice").dataset.message,"</p>");window.SUI.openNotice("wp-smush-webp-delete-all-notice",e,{type:"success",icon:"check-tick",dismiss:{show:!0}})}}},WP_Smush.WebP.init()}()},5445:function(e,t,s){var i,n,o;n=[s(5311),s(3860)],i=function(e){"use strict";if(!e.ui||!e.ui.fancytree){var t,s,i=null,n=new RegExp(/\.|\//),o=/[&<>"'/]/g,a=/[<>"'/]/g,r="$recursive_request",u="$request_target_invalid",d={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},l={16:!0,17:!0,18:!0},c={8:"backspace",9:"tab",10:"return",13:"return",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",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:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},h={16:"shift",17:"ctrl",18:"alt",91:"meta",93:"meta"},p={0:"",1:"left",2:"middle",3:"right"},m="active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore".split(" "),f={},g="columns types".split(" "),v="checkbox expanded extraClasses folder icon iconTooltip key lazy partsel radiogroup refKey selected statusNodeType title tooltip type unselectable unselectableIgnore unselectableStatus".split(" "),_={},w={},y={active:!0,children:!0,data:!0,focus:!0};for(t=0;t<m.length;t++)f[m[t]]=!0;for(t=0;t<v.length;t++)s=v[t],_[s]=!0,s!==s.toLowerCase()&&(w[s.toLowerCase()]=s);var b=Array.isArray;return k(e.ui,"Fancytree requires jQuery UI (http://jqueryui.com)"),Date.now||(Date.now=function(){return(new Date).getTime()}),A.prototype={_findDirectChild:function(e){var t,s,i=this.children;if(i)if("string"==typeof e){for(t=0,s=i.length;t<s;t++)if(i[t].key===e)return i[t]}else{if("number"==typeof e)return this.children[e];if(e.parent===this)return e}return null},_setChildren:function(e){k(e&&(!this.children||0===this.children.length),"only init supported"),this.children=[];for(var t=0,s=e.length;t<s;t++)this.children.push(new A(this,e[t]));this.tree._callHook("treeStructureChanged",this.tree,"setChildren")},addChildren:function(t,s){var i,n,o,a=this.getFirstChild(),r=this.getLastChild(),u=null,d=[];for(e.isPlainObject(t)&&(t=[t]),this.children||(this.children=[]),i=0,n=t.length;i<n;i++)d.push(new A(this,t[i]));if(u=d[0],null==s?this.children=this.children.concat(d):(s=this._findDirectChild(s),k((o=e.inArray(s,this.children))>=0,"insertBefore must be an existing child"),this.children.splice.apply(this.children,[o,0].concat(d))),a&&!s){for(i=0,n=d.length;i<n;i++)d[i].render();a!==this.getFirstChild()&&a.renderStatus(),r!==this.getLastChild()&&r.renderStatus()}else(!this.parent||this.parent.ul||this.tr)&&this.render();return 3===this.tree.options.selectMode&&this.fixSelection3FromEndNodes(),this.triggerModifyChild("add",1===d.length?d[0]:null),u},addClass:function(e){return this.toggleClass(e,!0)},addNode:function(e,t){switch(void 0!==t&&"over"!==t||(t="child"),t){case"after":return this.getParent().addChildren(e,this.getNextSibling());case"before":return this.getParent().addChildren(e,this);case"firstChild":var s=this.children?this.children[0]:null;return this.addChildren(e,s);case"child":case"over":return this.addChildren(e)}k(!1,"Invalid mode: "+t)},addPagingNode:function(t,s){var i,n;if(s=s||"child",!1!==t)return t=e.extend({title:this.tree.options.strings.moreData,statusNodeType:"paging",icon:!1},t),this.partload=!0,this.addNode(t,s);for(i=this.children.length-1;i>=0;i--)"paging"===(n=this.children[i]).statusNodeType&&this.removeChild(n);this.partload=!1},appendSibling:function(e){return this.addNode(e,"after")},applyCommand:function(e,t){return this.tree.applyCommand(e,this,t)},applyPatch:function(e){if(null===e)return this.remove(),L(this);var t,s,i={children:!0,expanded:!0,parent:!0};for(t in e)x(e,t)&&(s=e[t],i[t]||S(s)||(_[t]?this[t]=s:this.data[t]=s));return x(e,"children")&&(this.removeChildren(),e.children&&this._setChildren(e.children)),this.isVisible()&&(this.renderTitle(),this.renderStatus()),x(e,"expanded")?this.setExpanded(e.expanded):L(this)},collapseSiblings:function(){return this.tree._callHook("nodeCollapseSiblings",this)},copyTo:function(e,t,s){return e.addNode(this.toDict(!0,s),t)},countChildren:function(e){var t,s,i,n=this.children;if(!n)return 0;if(i=n.length,!1!==e)for(t=0,s=i;t<s;t++)i+=n[t].countChildren();return i},debug:function(e){this.tree.options.debugLevel>=4&&(Array.prototype.unshift.call(arguments,this.toString()),N("log",arguments))},discard:function(){return this.warn("FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead."),this.resetLazy()},discardMarkup:function(e){var t=e?"nodeRemoveMarkup":"nodeRemoveChildMarkup";this.tree._callHook(t,this)},error:function(e){this.tree.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),N("error",arguments))},findAll:function(e){e=S(e)?e:R(e);var t=[];return this.visit((function(s){e(s)&&t.push(s)})),t},findFirst:function(e){e=S(e)?e:R(e);var t=null;return this.visit((function(s){if(e(s))return t=s,!1})),t},findRelatedNode:function(e,t){return this.tree.findRelatedNode(this,e,t)},_changeSelectStatusAttrs:function(e){var t=!1,s=this.tree.options,n=i.evalOption("unselectable",this,this,s,!1),o=i.evalOption("unselectableStatus",this,this,s,void 0);switch(n&&null!=o&&(e=o),e){case!1:t=this.selected||this.partsel,this.selected=!1,this.partsel=!1;break;case!0:t=!this.selected||!this.partsel,this.selected=!0,this.partsel=!0;break;case void 0:t=this.selected||!this.partsel,this.selected=!1,this.partsel=!0;break;default:k(!1,"invalid state: "+e)}return t&&this.renderStatus(),t},fixSelection3AfterClick:function(e){var t=this.isSelected();this.visit((function(e){if(e._changeSelectStatusAttrs(t),e.radiogroup)return"skip"})),this.fixSelection3FromEndNodes(e)},fixSelection3FromEndNodes:function(e){var t=this.tree.options;function s(e){var n,o,a,r,u,d,l,c,h=e.children;if(h&&h.length){for(d=!0,l=!1,n=0,o=h.length;n<o;n++)r=s(a=h[n]),i.evalOption("unselectableIgnore",a,a,t,!1)||(!1!==r&&(l=!0),!0!==r&&(d=!1));u=!!d||!!l&&void 0}else u=null==(c=i.evalOption("unselectableStatus",e,e,t,void 0))?!!e.selected:!!c;return e.partsel&&!e.selected&&e.lazy&&null==e.children&&(u=void 0),e._changeSelectStatusAttrs(u),u}k(3===t.selectMode,"expected selectMode 3"),s(this),this.visitParents((function(e){var s,n,o,a,r,u=e.children,d=!0,l=!1;for(s=0,n=u.length;s<n;s++)o=u[s],i.evalOption("unselectableIgnore",o,o,t,!1)||(((a=null==(r=i.evalOption("unselectableStatus",o,o,t,void 0))?!!o.selected:!!r)||o.partsel)&&(l=!0),a||(d=!1));a=!!d||!!l&&void 0,e._changeSelectStatusAttrs(a)}))},fromDict:function(t){for(var s in t)_[s]?this[s]=t[s]:"data"===s?e.extend(this.data,t.data):S(t[s])||y[s]||(this.data[s]=t[s]);t.children&&(this.removeChildren(),this.addChildren(t.children)),this.renderTitle()},getChildren:function(){if(void 0!==this.hasChildren())return this.children},getFirstChild:function(){return this.children?this.children[0]:null},getIndex:function(){return e.inArray(this,this.parent.children)},getIndexHier:function(t,s){t=t||".";var i,n=[];return e.each(this.getParentList(!1,!0),(function(e,t){i=""+(t.getIndex()+1),s&&(i=("0000000"+i).substr(-s)),n.push(i)})),n.join(t)},getKeyPath:function(e){var t=this.tree.options.keyPathSeparator;return t+this.getPath(!e,"key",t)},getLastChild:function(){return this.children?this.children[this.children.length-1]:null},getLevel:function(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e},getNextSibling:function(){if(this.parent){var e,t,s=this.parent.children;for(e=0,t=s.length-1;e<t;e++)if(s[e]===this)return s[e+1]}return null},getParent:function(){return this.parent},getParentList:function(e,t){for(var s=[],i=t?this:this.parent;i;)(e||i.parent)&&s.unshift(i),i=i.parent;return s},getPath:function(e,t,s){e=!1!==e,s=s||"/";var i,n=[],o=S(t=t||"title");return this.visitParents((function(e){e.parent&&(i=o?t(e):e[t],n.unshift(i))}),e),n.join(s)},getPrevSibling:function(){if(this.parent){var e,t,s=this.parent.children;for(e=1,t=s.length;e<t;e++)if(s[e]===this)return s[e-1]}return null},getSelectedNodes:function(e){var t=[];return this.visit((function(s){if(s.selected&&(t.push(s),!0===e))return"skip"})),t},hasChildren:function(){if(this.lazy){if(null==this.children)return;if(0===this.children.length)return!1;if(1===this.children.length&&this.children[0].isStatusNode())return;return!0}return!(!this.children||!this.children.length)},hasClass:function(e){return(" "+(this.extraClasses||"")+" ").indexOf(" "+e+" ")>=0},hasFocus:function(){return this.tree.hasFocus()&&this.tree.focusNode===this},info:function(e){this.tree.options.debugLevel>=3&&(Array.prototype.unshift.call(arguments,this.toString()),N("info",arguments))},isActive:function(){return this.tree.activeNode===this},isBelowOf:function(e){return this.getIndexHier(".",5)>e.getIndexHier(".",5)},isChildOf:function(e){return this.parent&&this.parent===e},isDescendantOf:function(t){if(!t||t.tree!==this.tree)return!1;for(var s=this.parent;s;){if(s===t)return!0;s===s.parent&&e.error("Recursive parent link: "+s),s=s.parent}return!1},isExpanded:function(){return!!this.expanded},isFirstSibling:function(){var e=this.parent;return!e||e.children[0]===this},isFolder:function(){return!!this.folder},isLastSibling:function(){var e=this.parent;return!e||e.children[e.children.length-1]===this},isLazy:function(){return!!this.lazy},isLoaded:function(){return!this.lazy||void 0!==this.hasChildren()},isLoading:function(){return!!this._isLoading},isRoot:function(){return this.isRootNode()},isPartsel:function(){return!this.selected&&!!this.partsel},isPartload:function(){return!!this.partload},isRootNode:function(){return this.tree.rootNode===this},isSelected:function(){return!!this.selected},isStatusNode:function(){return!!this.statusNodeType},isPagingNode:function(){return"paging"===this.statusNodeType},isTopLevel:function(){return this.tree.rootNode===this.parent},isUndefined:function(){return void 0===this.hasChildren()},isVisible:function(){var e,t,s=this.tree.enableFilter,i=this.getParentList(!1,!1);if(s&&!this.match&&!this.subMatchCount)return!1;for(e=0,t=i.length;e<t;e++)if(!i[e].expanded)return!1;return!0},lazyLoad:function(t){e.error("FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead.")},load:function(e){var t,s,i=this,n=this.isExpanded();return k(this.isLazy(),"load() requires a lazy node"),e||this.isUndefined()?(this.isLoaded()&&this.resetLazy(),!1===(s=this.tree._triggerNodeEvent("lazyLoad",this))?L(this):(k("boolean"!=typeof s,"lazyLoad event must return source in data.result"),t=this.tree._callHook("nodeLoadChildren",this,s),n?(this.expanded=!0,t.always((function(){i.render()}))):t.always((function(){i.renderStatus()})),t)):L(this)},makeVisible:function(t){var s,i=this,n=[],o=new e.Deferred,a=this.getParentList(!1,!1),r=a.length,u=!(t&&!0===t.noAnimation),d=!(t&&!1===t.scrollIntoView);for(s=r-1;s>=0;s--)n.push(a[s].setExpanded(!0,t));return e.when.apply(e,n).done((function(){d?i.scrollIntoView(u).done((function(){o.resolve()})):o.resolve()})),o.promise()},moveTo:function(t,s,i){void 0===s||"over"===s?s="child":"firstChild"===s&&(t.children&&t.children.length?(s="before",t=t.children[0]):s="child");var n,o=this.tree,a=this.parent,r="child"===s?t:t.parent;if(this!==t){if(this.parent?r.isDescendantOf(this)&&e.error("Cannot move a node to its own descendant"):e.error("Cannot move system root"),r!==a&&a.triggerModifyChild("remove",this),1===this.parent.children.length){if(this.parent===r)return;this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1}else k((n=e.inArray(this,this.parent.children))>=0,"invalid source parent"),this.parent.children.splice(n,1);if(this.parent=r,r.hasChildren())switch(s){case"child":r.children.push(this);break;case"before":k((n=e.inArray(t,r.children))>=0,"invalid target parent"),r.children.splice(n,0,this);break;case"after":k((n=e.inArray(t,r.children))>=0,"invalid target parent"),r.children.splice(n+1,0,this);break;default:e.error("Invalid mode "+s)}else r.children=[this];i&&t.visit(i,!0),r===a?r.triggerModifyChild("move",this):r.triggerModifyChild("add",this),o!==t.tree&&(this.warn("Cross-tree moveTo is experimental!"),this.visit((function(e){e.tree=t.tree}),!0)),o._callHook("treeStructureChanged",o,"moveTo"),a.isDescendantOf(r)||a.render(),r.isDescendantOf(a)||r===a||r.render()}},navigate:function(t,s){var i,n=e.ui.keyCode;switch(t){case"left":case n.LEFT:if(this.expanded)return this.setExpanded(!1);break;case"right":case n.RIGHT:if(!this.expanded&&(this.children||this.lazy))return this.setExpanded()}if(i=this.findRelatedNode(t)){try{i.makeVisible({scrollIntoView:!1})}catch(e){}return!1===s?(i.setFocus(),L()):i.setActive()}return this.warn("Could not find related node '"+t+"'."),L()},remove:function(){return this.parent.removeChild(this)},removeChild:function(e){return this.tree._callHook("nodeRemoveChild",this,e)},removeChildren:function(){return this.tree._callHook("nodeRemoveChildren",this)},removeClass:function(e){return this.toggleClass(e,!1)},render:function(e,t){return this.tree._callHook("nodeRender",this,e,t)},renderTitle:function(){return this.tree._callHook("nodeRenderTitle",this)},renderStatus:function(){return this.tree._callHook("nodeRenderStatus",this)},replaceWith:function(s){var i,n=this.parent,o=e.inArray(this,n.children),a=this;return k(this.isPagingNode(),"replaceWith() currently requires a paging status node"),(i=this.tree._callHook("nodeLoadChildren",this,s)).done((function(e){var s=a.children;for(t=0;t<s.length;t++)s[t].parent=n;n.children.splice.apply(n.children,[o+1,0].concat(s)),a.children=null,a.remove(),n.render()})).fail((function(){a.setExpanded()})),i},resetLazy:function(){this.removeChildren(),this.expanded=!1,this.lazy=!0,this.children=void 0,this.renderStatus()},scheduleAction:function(t,s){this.tree.timer&&(clearTimeout(this.tree.timer),this.tree.debug("clearTimeout(%o)",this.tree.timer)),this.tree.timer=null;var i=this;switch(t){case"cancel":break;case"expand":this.tree.timer=setTimeout((function(){i.tree.debug("setTimeout: trigger expand"),i.setExpanded(!0)}),s);break;case"activate":this.tree.timer=setTimeout((function(){i.tree.debug("setTimeout: trigger activate"),i.setActive(!0)}),s);break;default:e.error("Invalid mode "+t)}},scrollIntoView:function(t,s){if(void 0!==s&&E(s))throw Error("scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' instead.");var i=e.extend({effects:!0===t?{duration:200,queue:!1}:t,scrollOfs:this.tree.options.scrollOfs,scrollParent:this.tree.options.scrollParent,topNode:null},s),n=i.scrollParent,o=this.tree.$container,a=o.css("overflow-y");n?n.jquery||(n=e(n)):n=this.tree.tbody?o.scrollParent():"scroll"===a||"auto"===a?o:o.scrollParent(),n[0]!==document&&n[0]!==document.body||(this.debug("scrollIntoView(): normalizing scrollParent to 'window':",n[0]),n=e(window));var r,u,d,l=new e.Deferred,c=this,h=e(this.span).height(),p=i.scrollOfs.top||0,m=i.scrollOfs.bottom||0,f=n.height(),g=n.scrollTop(),v=n,_=n[0]===window,w=i.topNode||null,y=null;return this.isRootNode()||!this.isVisible()?(this.info("scrollIntoView(): node is invisible."),L()):(_?(u=e(this.span).offset().top,r=w&&w.span?e(w.span).offset().top:0,v=e("html,body")):(k(n[0]!==document&&n[0]!==document.body,"scrollParent should be a simple element or `window`, not document or body."),d=n.offset().top,u=e(this.span).offset().top-d+g,r=w?e(w.span).offset().top-d+g:0,f-=Math.max(0,n.innerHeight()-n[0].clientHeight)),u<g+p?y=u-p:u+h>g+f-m&&(y=u+h-f+m,w&&(k(w.isRootNode()||w.isVisible(),"topNode must be visible"),r<y&&(y=r-p))),null===y?l.resolveWith(this):i.effects?(i.effects.complete=function(){l.resolveWith(c)},v.stop(!0).animate({scrollTop:y},i.effects)):(v[0].scrollTop=y,l.resolveWith(this)),l.promise())},setActive:function(e,t){return this.tree._callHook("nodeSetActive",this,e,t)},setExpanded:function(e,t){return this.tree._callHook("nodeSetExpanded",this,e,t)},setFocus:function(e){return this.tree._callHook("nodeSetFocus",this,e)},setSelected:function(e,t){return this.tree._callHook("nodeSetSelected",this,e,t)},setStatus:function(e,t,s){return this.tree._callHook("nodeSetStatus",this,e,t,s)},setTitle:function(e){this.title=e,this.renderTitle(),this.triggerModify("rename")},sortChildren:function(e,t){var s,i,n=this.children;if(n){if(e=e||function(e,t){var s=e.title.toLowerCase(),i=t.title.toLowerCase();return s===i?0:s>i?1:-1},n.sort(e),t)for(s=0,i=n.length;s<i;s++)n[s].children&&n[s].sortChildren(e,"$norender$");"$norender$"!==t&&this.render(),this.triggerModifyChild("sort")}},toDict:function(t,s){var i,n,o,a,r={},u=this;if(e.each(v,(function(e,t){(u[t]||!1===u[t])&&(r[t]=u[t])})),e.isEmptyObject(this.data)||(r.data=e.extend({},this.data),e.isEmptyObject(r.data)&&delete r.data),s){if(!1===(a=s(r,u)))return!1;"skip"===a&&(t=!1)}if(t&&b(this.children))for(r.children=[],i=0,n=this.children.length;i<n;i++)(o=this.children[i]).isStatusNode()||!1!==(a=o.toDict(!0,s))&&r.children.push(a);return r},toggleClass:function(t,s){var i,n,o=/\S+/g,a=t.match(o)||[],r=0,u=!1,d=this[this.tree.statusClassPropName],l=" "+(this.extraClasses||"")+" ";for(d&&e(d).toggleClass(t,s);i=a[r++];)if(n=l.indexOf(" "+i+" ")>=0,s=void 0===s?!n:!!s)n||(l+=i+" ",u=!0);else for(;l.indexOf(" "+i+" ")>-1;)l=l.replace(" "+i+" "," ");return this.extraClasses=C(l),u},toggleExpanded:function(){return this.tree._callHook("nodeToggleExpanded",this)},toggleSelected:function(){return this.tree._callHook("nodeToggleSelected",this)},toString:function(){return"FancytreeNode@"+this.key+"[title='"+this.title+"']"},triggerModifyChild:function(t,s,i){var n,o=this.tree.options.modifyChild;o&&(s&&s.parent!==this&&e.error("childNode "+s+" is not a child of "+this),n={node:this,tree:this.tree,operation:t,childNode:s||null},i&&e.extend(n,i),o({type:"modifyChild"},n))},triggerModify:function(e,t){this.parent.triggerModifyChild(e,this,t)},visit:function(e,t){var s,i,n=!0,o=this.children;if(!0===t&&(!1===(n=e(this))||"skip"===n))return n;if(o)for(s=0,i=o.length;s<i&&!1!==(n=o[s].visit(e,!0));s++);return n},visitAndLoad:function(t,s,i){var n,o,a,r=this;return!t||!0!==s||!1!==(o=t(r))&&"skip"!==o?r.children||r.lazy?(n=new e.Deferred,a=[],r.load().done((function(){for(var s=0,i=r.children.length;s<i;s++){if(!1===(o=r.children[s].visitAndLoad(t,!0,!0))){n.reject();break}"skip"!==o&&a.push(o)}e.when.apply(this,a).then((function(){n.resolve()}))})),n.promise()):L():i?o:L()},visitParents:function(e,t){if(t&&!1===e(this))return!1;for(var s=this.parent;s;){if(!1===e(s))return!1;s=s.parent}return!0},visitSiblings:function(e,t){var s,i,n,o=this.parent.children;for(s=0,i=o.length;s<i;s++)if(n=o[s],(t||n!==this)&&!1===e(n))return!1;return!0},warn:function(e){this.tree.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),N("warn",arguments))}},B.prototype={_makeHookContext:function(t,s,i){var n,o;return void 0!==t.node?(s&&t.originalEvent!==s&&e.error("invalid args"),n=t):t.tree?n={node:t,tree:o=t.tree,widget:o.widget,options:o.widget.options,originalEvent:s,typeInfo:o.types[t.type]||{}}:t.widget?n={node:null,tree:t,widget:t.widget,options:t.widget.options,originalEvent:s}:e.error("invalid args"),i&&e.extend(n,i),n},_callHook:function(t,s,i){var n=this._makeHookContext(s),o=this[t],a=Array.prototype.slice.call(arguments,2);return S(o)||e.error("_callHook('"+t+"') is not a function"),a.unshift(n),o.apply(this,a)},_setExpiringValue:function(e,t,s){this._tempCache[e]={value:t,expire:Date.now()+(+s||50)}},_getExpiringValue:function(e){var t=this._tempCache[e];return t&&t.expire>Date.now()?t.value:(delete this._tempCache[e],null)},_usesExtension:function(t){return e.inArray(t,this.options.extensions)>=0},_requireExtension:function(t,s,i,n){null!=i&&(i=!!i);var o=this._local.name,a=this.options.extensions,r=e.inArray(t,a)<e.inArray(o,a),u=s&&null==this.ext[t],d=!u&&null!=i&&i!==r;return k(o&&o!==t,"invalid or same name '"+o+"' (require yourself?)"),!u&&!d||(n||(u||s?(n="'"+o+"' extension requires '"+t+"'",d&&(n+=" to be registered "+(i?"before":"after")+" itself")):n="If used together, `"+t+"` must be registered "+(i?"before":"after")+" `"+o+"`"),e.error(n),!1)},activateKey:function(e,t){var s=this.getNodeByKey(e);return s?s.setActive(!0,t):this.activeNode&&this.activeNode.setActive(!1,t),s},addPagingNode:function(e,t){return this.rootNode.addPagingNode(e,t)},applyCommand:function(t,s,i){var n;switch(s=s||this.getActiveNode(),t){case"moveUp":(n=s.getPrevSibling())&&(s.moveTo(n,"before"),s.setActive());break;case"moveDown":(n=s.getNextSibling())&&(s.moveTo(n,"after"),s.setActive());break;case"indent":(n=s.getPrevSibling())&&(s.moveTo(n,"child"),n.setExpanded(),s.setActive());break;case"outdent":s.isTopLevel()||(s.moveTo(s.getParent(),"after"),s.setActive());break;case"remove":n=s.getPrevSibling()||s.getParent(),s.remove(),n&&n.setActive();break;case"addChild":s.editCreateNode("child","");break;case"addSibling":s.editCreateNode("after","");break;case"rename":s.editStart();break;case"down":case"first":case"last":case"left":case"parent":case"right":case"up":return s.navigate(t);default:e.error("Unhandled command: '"+t+"'")}},applyPatch:function(t){var s,i,n,o,a,r,u=t.length,d=[];for(i=0;i<u;i++)k(2===(n=t[i]).length,"patchList must be an array of length-2-arrays"),o=n[0],a=n[1],(r=null===o?this.rootNode:this.getNodeByKey(o))?(s=new e.Deferred,d.push(s),r.applyPatch(a).always(D(s,r))):this.warn("could not find node with key '"+o+"'");return e.when.apply(e,d).promise()},clear:function(e){this._callHook("treeClear",this)},count:function(){return this.rootNode.countChildren()},debug:function(e){this.options.debugLevel>=4&&(Array.prototype.unshift.call(arguments,this.toString()),N("log",arguments))},destroy:function(){this.widget.destroy()},enable:function(e){!1===e?this.widget.disable():this.widget.enable()},enableUpdate:function(e){return e=!1!==e,!!this._enableUpdate==!!e?e:(this._enableUpdate=e,e?(this.debug("enableUpdate(true): redraw "),this._callHook("treeStructureChanged",this,"enableUpdate"),this.render()):this.debug("enableUpdate(false)..."),!e)},error:function(e){this.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),N("error",arguments))},expandAll:function(e,t){var s=this.enableUpdate(!1);e=!1!==e,this.visit((function(s){!1!==s.hasChildren()&&s.isExpanded()!==e&&s.setExpanded(e,t)})),this.enableUpdate(s)},findAll:function(e){return this.rootNode.findAll(e)},findFirst:function(e){return this.rootNode.findFirst(e)},findNextNode:function(e,t){var s=null,i=this.getFirstChild();function n(i){if(e(i)&&(s=i),s||i===t)return!1}return e="string"==typeof e?O(e):e,t=t||i,this.visitRows(n,{start:t,includeSelf:!1}),s||t===i||this.visitRows(n,{start:i,includeSelf:!0}),s},findRelatedNode:function(t,s,i){var n=null,o=e.ui.keyCode;switch(s){case"parent":case o.BACKSPACE:t.parent&&t.parent.parent&&(n=t.parent);break;case"first":case o.HOME:this.visit((function(e){if(e.isVisible())return n=e,!1}));break;case"last":case o.END:this.visit((function(e){e.isVisible()&&(n=e)}));break;case"left":case o.LEFT:t.expanded?t.setExpanded(!1):t.parent&&t.parent.parent&&(n=t.parent);break;case"right":case o.RIGHT:t.expanded||!t.children&&!t.lazy?t.children&&t.children.length&&(n=t.children[0]):(t.setExpanded(),n=t);break;case"up":case o.UP:this.visitRows((function(e){return n=e,!1}),{start:t,reverse:!0,includeSelf:!1});break;case"down":case o.DOWN:this.visitRows((function(e){return n=e,!1}),{start:t,includeSelf:!1});break;default:this.tree.warn("Unknown relation '"+s+"'.")}return n},generateFormElements:function(t,s,i){i=i||{};var n,o="string"==typeof t?t:"ft_"+this._id+"[]",a="string"==typeof s?s:"ft_"+this._id+"_active",r="fancytree_result_"+this._id,u=e("#"+r),d=3===this.options.selectMode&&!1!==i.stopOnParents;function l(t){u.append(e("<input>",{type:"checkbox",name:o,value:t.key,checked:!0}))}u.length?u.empty():u=e("<div>",{id:r}).hide().insertAfter(this.$container),!1!==s&&this.activeNode&&u.append(e("<input>",{type:"radio",name:a,value:this.activeNode.key,checked:!0})),i.filter?this.visit((function(e){var t=i.filter(e);if("skip"===t)return t;!1!==t&&l(e)})):!1!==t&&(n=this.getSelectedNodes(d),e.each(n,(function(e,t){l(t)})))},getActiveNode:function(){return this.activeNode},getFirstChild:function(){return this.rootNode.getFirstChild()},getFocusNode:function(){return this.focusNode},getOption:function(e){return this.widget.option(e)},getNodeByKey:function(e,t){var s,i;return!t&&(s=document.getElementById(this.options.idPrefix+e))?s.ftnode?s.ftnode:null:(t=t||this.rootNode,i=null,e=""+e,t.visit((function(t){if(t.key===e)return i=t,!1}),!0),i)},getRootNode:function(){return this.rootNode},getSelectedNodes:function(e){return this.rootNode.getSelectedNodes(e)},hasFocus:function(){return!!this._hasFocus},info:function(e){this.options.debugLevel>=3&&(Array.prototype.unshift.call(arguments,this.toString()),N("info",arguments))},isLoading:function(){var e=!1;return this.rootNode.visit((function(t){if(t._isLoading||t._requestId)return e=!0,!1}),!0),e},loadKeyPath:function(t,s){var i,n,o,a=this,r=new e.Deferred,u=this.getRootNode(),d=this.options.keyPathSeparator,l=[],c=e.extend({},s);for("function"==typeof s?i=s:s&&s.callback&&(i=s.callback),c.callback=function(e,t,s){i&&i.call(e,t,s),r.notifyWith(e,[{node:t,status:s}])},null==c.matchKey&&(c.matchKey=function(e,t){return e.key===t}),b(t)||(t=[t]),n=0;n<t.length;n++)(o=t[n]).charAt(0)===d&&(o=o.substr(1)),l.push(o.split(d));return setTimeout((function(){a._loadKeyPathImpl(r,c,u,l).done((function(){r.resolve()}))}),0),r.promise()},_loadKeyPathImpl:function(t,s,i,n){var o,a,r,u,d,l,c,h,p,m,f=this;function g(e,t){var i,n,o=e.children;if(o)for(i=0,n=o.length;i<n;i++)if(s.matchKey(o[i],t))return o[i];return null}for(c={},a=0;a<n.length;a++)for(p=n[a],h=i;p.length;){if(r=p.shift(),!(u=g(h,r))){this.warn("loadKeyPath: key not found: "+r+" (parent: "+h+")"),s.callback(this,r,"error");break}if(0===p.length){s.callback(this,u,"ok");break}if(u.lazy&&void 0===u.hasChildren()){s.callback(this,u,"loaded"),c[r=u.key]?c[r].pathSegList.push(p):c[r]={parent:u,pathSegList:[p]};break}s.callback(this,u,"loaded"),h=u}function v(e,t,i){s.callback(f,t,"loading"),t.load().done((function(){f._loadKeyPathImpl.call(f,e,s,t,i).always(D(e,f))})).fail((function(i){f.warn("loadKeyPath: error loading lazy "+t),s.callback(f,u,"error"),e.rejectWith(f)}))}for(d in o=[],c)x(c,d)&&(l=c[d],m=new e.Deferred,o.push(m),v(m,l.parent,l.pathSegList));return e.when.apply(e,o).promise()},reactivate:function(e){var t,s=this.activeNode;return s?(this.activeNode=null,t=s.setActive(!0,{noFocus:!0}),e&&s.setFocus(),t):L()},reload:function(e){return this._callHook("treeClear",this),this._callHook("treeLoad",this,e)},render:function(e,t){return this.rootNode.render(e,t)},selectAll:function(e){this.visit((function(t){t.setSelected(e)}))},setFocus:function(e){return this._callHook("treeSetFocus",this,e)},setOption:function(e,t){return this.widget.option(e,t)},debugTime:function(e){this.options.debugLevel>=4&&window.console.time(this+" - "+e)},debugTimeEnd:function(e){this.options.debugLevel>=4&&window.console.timeEnd(this+" - "+e)},toDict:function(e,t){var s=this.rootNode.toDict(!0,t);return e?s:s.children},toString:function(){return"Fancytree@"+this._id},_triggerNodeEvent:function(e,t,s,i){var n=this._makeHookContext(t,s,i),o=this.widget._trigger(e,s,n);return!1!==o&&void 0!==n.result?n.result:o},_triggerTreeEvent:function(e,t,s){var i=this._makeHookContext(this,t,s),n=this.widget._trigger(e,t,i);return!1!==n&&void 0!==i.result?i.result:n},visit:function(e){return this.rootNode.visit(e,!1)},visitRows:function(e,t){if(!this.rootNode.hasChildren())return!1;if(t&&t.reverse)return delete t.reverse,this._visitRowsUp(e,t);var s,i,n,o,a=0,r=!1===(t=t||{}).includeSelf,u=!!t.includeHidden,d=!u&&this.enableFilter,l=t.start||this.rootNode.children[0];for(n=l.parent;n;){for(k((i=(o=n.children).indexOf(l)+a)>=0,"Could not find "+l+" in parent's children: "+n),s=i;s<o.length;s++)if(l=o[s],!d||l.match||l.subMatchCount){if(!r&&!1===e(l))return!1;if(r=!1,l.children&&l.children.length&&(u||l.expanded)&&!1===l.visit((function(t){return!d||t.match||t.subMatchCount?!1!==e(t)&&(u||!t.children||t.expanded?void 0:"skip"):"skip"}),!1))return!1}l=n,n=n.parent,a=1}return!0},_visitRowsUp:function(e,t){for(var s,i,n,o=!!t.includeHidden,a=t.start||this.rootNode.children[0];;){if((s=(n=a.parent).children)[0]===a){if(!(a=n).parent)break;s=n.children}else for(i=s.indexOf(a),a=s[i-1];(o||a.expanded)&&a.children&&a.children.length;)n=a,a=(s=a.children)[s.length-1];if((o||a.isVisible())&&!1===e(a))return!1}},warn:function(e){this.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),N("warn",arguments))}},e.extend(B.prototype,{nodeClick:function(e){var t,s,i=e.targetType,n=e.node;if("expander"===i){if(n.isLoading())return void n.debug("Got 2nd click while loading: ignored");this._callHook("nodeToggleExpanded",e)}else if("checkbox"===i)this._callHook("nodeToggleSelected",e),e.options.focusOnSelect&&this._callHook("nodeSetFocus",e,!0);else{if(s=!1,t=!0,n.folder)switch(e.options.clickFolderMode){case 2:s=!0,t=!1;break;case 3:t=!0,s=!0}t&&(this.nodeSetFocus(e),this._callHook("nodeSetActive",e,!0)),s&&this._callHook("nodeToggleExpanded",e)}},nodeCollapseSiblings:function(e,t){var s,i,n,o=e.node;if(o.parent)for(i=0,n=(s=o.parent.children).length;i<n;i++)s[i]!==o&&s[i].expanded&&this._callHook("nodeSetExpanded",s[i],!1,t)},nodeDblclick:function(e){"title"===e.targetType&&4===e.options.clickFolderMode&&this._callHook("nodeToggleExpanded",e),"title"===e.targetType&&e.originalEvent.preventDefault()},nodeKeydown:function(t){var s,n,o,a=t.originalEvent,r=t.node,u=t.tree,d=t.options,l=a.which,p=a.key||String.fromCharCode(l),m=!!(a.altKey||a.ctrlKey||a.metaKey),f=!h[l]&&!c[l]&&!m,g=e(a.target),v=!0,_=!(a.ctrlKey||!d.autoActivate);if(r||(o=this.getActiveNode()||this.getFirstChild())&&(o.setFocus(),(r=t.node=this.focusNode).debug("Keydown force focus on active node")),d.quicksearch&&f&&!g.is(":input:enabled"))return(n=Date.now())-u.lastQuicksearchTime>500&&(u.lastQuicksearchTerm=""),u.lastQuicksearchTime=n,u.lastQuicksearchTerm+=p,(s=u.findNextNode(u.lastQuicksearchTerm,u.getActiveNode()))&&s.setActive(),void a.preventDefault();switch(i.eventToString(a)){case"+":case"=":u.nodeSetExpanded(t,!0);break;case"-":u.nodeSetExpanded(t,!1);break;case"space":r.isPagingNode()?u._triggerNodeEvent("clickPaging",t,a):i.evalOption("checkbox",r,r,d,!1)?u.nodeToggleSelected(t):u.nodeSetActive(t,!0);break;case"return":u.nodeSetActive(t,!0);break;case"home":case"end":case"backspace":case"left":case"right":case"up":case"down":r.navigate(a.which,_);break;default:v=!1}v&&a.preventDefault()},nodeLoadChildren:function(t,s){var i,n,o,a=null,d=!0,l=t.tree,c=t.node,h=c.parent,p="nodeLoadChildren",m=Date.now();return S(s)&&k(!S(s=s.call(l,{type:"source"},t)),"source callback must not return another function"),S(s.then)?a=s:s.url?(i=e.extend({},t.options.ajax,s)).debugDelay?(n=i.debugDelay,delete i.debugDelay,b(n)&&(n=n[0]+Math.random()*(n[1]-n[0])),c.warn("nodeLoadChildren waiting debugDelay "+Math.round(n)+" ms ..."),a=e.Deferred((function(t){setTimeout((function(){e.ajax(i).done((function(){t.resolveWith(this,arguments)})).fail((function(){t.rejectWith(this,arguments)}))}),n)}))):a=e.ajax(i):e.isPlainObject(s)||b(s)?(a={then:function(e,t){e(s,null,null)}},d=!1):e.error("Invalid source type: "+s),c._requestId&&(c.warn("Recursive load request #"+m+" while #"+c._requestId+" is pending."),c._requestId=m),d&&(l.debugTime(p),l.nodeSetStatus(t,"loading")),o=new e.Deferred,a.then((function(i,n,a){var d,p;if("json"!==s.dataType&&"jsonp"!==s.dataType||"string"!=typeof i||e.error("Ajax request returned a string (did you get the JSON dataType wrong?)."),c._requestId&&c._requestId>m)o.rejectWith(this,[r]);else if(null!==c.parent||null===h){if(t.options.postProcess){try{(p=l._triggerNodeEvent("postProcess",t,t.originalEvent,{response:i,error:null,dataType:s.dataType})).error&&l.warn("postProcess returned error:",p)}catch(e){p={error:e,message:""+e,details:"postProcess failed"}}if(p.error)return d=e.isPlainObject(p.error)?p.error:{message:p.error},d=l._makeHookContext(c,null,d),void o.rejectWith(this,[d]);(b(p)||e.isPlainObject(p)&&b(p.children))&&(i=p)}else i&&x(i,"d")&&t.options.enableAspx&&(42===t.options.enableAspx&&l.warn("The default for enableAspx will change to `false` in the fututure. Pass `enableAspx: true` or implement postProcess to silence this warning."),i="string"==typeof i.d?e.parseJSON(i.d):i.d);o.resolveWith(this,[i])}else o.rejectWith(this,[u])}),(function(e,t,s){var i=l._makeHookContext(c,null,{error:e,args:Array.prototype.slice.call(arguments),message:s,details:e.status+": "+s});o.rejectWith(this,[i])})),o.done((function(s){var i,n,o;l.nodeSetStatus(t,"ok"),e.isPlainObject(s)?(k(c.isRootNode(),"source may only be an object for root nodes (expecting an array of child objects otherwise)"),k(b(s.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),n=s,i=s.children,delete n.children,e.each(g,(function(e,t){void 0!==n[t]&&(l[t]=n[t],delete n[t])})),e.extend(l.data,n)):i=s,k(b(i),"expected array of children"),c._setChildren(i),l.options.nodata&&0===i.length&&(S(l.options.nodata)?o=l.options.nodata.call(l,{type:"nodata"},t):!0===l.options.nodata&&c.isRootNode()?o=l.options.strings.noData:"string"==typeof l.options.nodata&&c.isRootNode()&&(o=l.options.nodata),o&&c.setStatus("nodata",o)),l._triggerNodeEvent("loadChildren",c)})).fail((function(e){var s;e!==r?e!==u?(e.node&&e.error&&e.message?s=e:"[object Object]"===(s=l._makeHookContext(c,null,{error:e,args:Array.prototype.slice.call(arguments),message:e?e.message||e.toString():""})).message&&(s.message=""),c.warn("Load children failed ("+s.message+")",s),!1!==l._triggerNodeEvent("loadError",s,null)&&l.nodeSetStatus(t,"error",s.message,s.details)):c.warn("Lazy parent node was removed while loading: discarding response."):c.warn("Ignored response for obsolete load request #"+m+" (expected #"+c._requestId+")")})).always((function(){c._requestId=null,d&&l.debugTimeEnd(p)})),o.promise()},nodeLoadKeyPath:function(e,t){},nodeRemoveChild:function(t,s){var i,n=t.node,o=e.extend({},t,{node:s}),a=n.children;if(1===a.length)return k(s===a[0],"invalid single child"),this.nodeRemoveChildren(t);this.activeNode&&(s===this.activeNode||this.activeNode.isDescendantOf(s))&&this.activeNode.setActive(!1),this.focusNode&&(s===this.focusNode||this.focusNode.isDescendantOf(s))&&(this.focusNode=null),this.nodeRemoveMarkup(o),this.nodeRemoveChildren(o),k((i=e.inArray(s,a))>=0,"invalid child"),n.triggerModifyChild("remove",s),s.visit((function(e){e.parent=null}),!0),this._callHook("treeRegisterNode",this,!1,s),a.splice(i,1)},nodeRemoveChildMarkup:function(t){var s=t.node;s.ul&&(s.isRootNode()?e(s.ul).empty():(e(s.ul).remove(),s.ul=null),s.visit((function(e){e.li=e.ul=null})))},nodeRemoveChildren:function(e){var t=e.tree,s=e.node;s.children&&(this.activeNode&&this.activeNode.isDescendantOf(s)&&this.activeNode.setActive(!1),this.focusNode&&this.focusNode.isDescendantOf(s)&&(this.focusNode=null),this.nodeRemoveChildMarkup(e),s.triggerModifyChild("remove",null),s.visit((function(e){e.parent=null,t._callHook("treeRegisterNode",t,!1,e)})),s.lazy?s.children=[]:s.children=null,s.isRootNode()||(s.expanded=!1),this.nodeRenderStatus(e))},nodeRemoveMarkup:function(t){var s=t.node;s.li&&(e(s.li).remove(),s.li=null),this.nodeRemoveChildMarkup(t)},nodeRender:function(t,s,i,n,o){var a,r,u,d,l,c,h,p=t.node,m=t.tree,f=t.options,g=f.aria,v=!1,_=p.parent,w=!_,y=p.children,b=null;if(!1!==m._enableUpdate&&(w||_.ul)){if(k(w||_.ul,"parent UL must exist"),w||(p.li&&(s||p.li.parentNode!==p.parent.ul)&&(p.li.parentNode===p.parent.ul?b=p.li.nextSibling:this.debug("Unlinking "+p+" (must be child of "+p.parent+")"),this.nodeRemoveMarkup(t)),p.li?this.nodeRenderStatus(t):(v=!0,p.li=document.createElement("li"),p.li.ftnode=p,p.key&&f.generateIds&&(p.li.id=f.idPrefix+p.key),p.span=document.createElement("span"),p.span.className="fancytree-node",g&&!p.tr&&e(p.li).attr("role","treeitem"),p.li.appendChild(p.span),this.nodeRenderTitle(t),f.createNode&&f.createNode.call(m,{type:"createNode"},t)),f.renderNode&&f.renderNode.call(m,{type:"renderNode"},t)),y){if(w||p.expanded||!0===i){for(p.ul||(p.ul=document.createElement("ul"),(!0!==n||o)&&p.expanded||(p.ul.style.display="none"),g&&e(p.ul).attr("role","group"),p.li?p.li.appendChild(p.ul):p.tree.$div.append(p.ul)),d=0,l=y.length;d<l;d++)h=e.extend({},t,{node:y[d]}),this.nodeRender(h,s,i,!1,!0);for(a=p.ul.firstChild;a;)(u=a.ftnode)&&u.parent!==p?(p.debug("_fixParent: remove missing "+u,a),c=a.nextSibling,a.parentNode.removeChild(a),a=c):a=a.nextSibling;for(a=p.ul.firstChild,d=0,l=y.length-1;d<l;d++)(r=y[d])===(u=a.ftnode)?a=a.nextSibling:p.ul.insertBefore(r.li,u.li)}}else p.ul&&(this.warn("remove child markup for "+p),this.nodeRemoveChildMarkup(t));w||v&&_.ul.insertBefore(p.li,b)}},nodeRenderTitle:function(t,s){var o,a,r,u,d,l,c,h=t.node,p=t.tree,m=t.options,f=m.aria,g=h.getLevel(),v=[];void 0!==s&&(h.title=s),h.span&&!1!==p._enableUpdate&&(d=f&&!1!==h.hasChildren()?" role='button'":"",g<m.minExpandLevel?(h.lazy||(h.expanded=!0),g>1&&v.push("<span "+d+" class='fancytree-expander fancytree-expander-fixed'></span>")):v.push("<span "+d+" class='fancytree-expander'></span>"),(o=i.evalOption("checkbox",h,h,m,!1))&&!h.isStatusNode()&&(d=f?" role='checkbox'":"",a="fancytree-checkbox",("radio"===o||h.parent&&h.parent.radiogroup)&&(a+=" fancytree-radio"),v.push("<span "+d+" class='"+a+"'></span>")),void 0!==h.data.iconClass&&(h.icon?e.error("'iconClass' node option is deprecated since v2.14.0: use 'icon' only instead"):(h.warn("'iconClass' node option is deprecated since v2.14.0: use 'icon' instead"),h.icon=h.data.iconClass)),!1!==(r=i.evalOption("icon",h,h,m,!0))&&(d=f?" role='presentation'":"",c=(c=i.evalOption("iconTooltip",h,h,m,null))?" title='"+W(c)+"'":"","string"==typeof r?n.test(r)?(r="/"===r.charAt(0)?r:(m.imagePath||"")+r,v.push("<img src='"+r+"' class='fancytree-icon'"+c+" alt='' />")):v.push("<span "+d+" class='fancytree-custom-icon "+r+"'"+c+"></span>"):r.text?v.push("<span "+d+" class='fancytree-custom-icon "+(r.addClass||"")+"'"+c+">"+i.escapeHtml(r.text)+"</span>"):r.html?v.push("<span "+d+" class='fancytree-custom-icon "+(r.addClass||"")+"'"+c+">"+r.html+"</span>"):v.push("<span "+d+" class='fancytree-icon'"+c+"></span>")),u="",m.renderTitle&&(u=m.renderTitle.call(p,{type:"renderTitle"},t)||""),u||(!0===(l=i.evalOption("tooltip",h,h,m,null))&&(l=h.title),u="<span class='fancytree-title'"+(l=l?" title='"+W(l)+"'":"")+(m.titlesTabbable?" tabindex='0'":"")+">"+(m.escapeTitles?i.escapeHtml(h.title):h.title)+"</span>"),v.push(u),h.span.innerHTML=v.join(""),this.nodeRenderStatus(t),m.enhanceTitle&&(t.$title=e(">span.fancytree-title",h.span),u=m.enhanceTitle.call(p,{type:"enhanceTitle"},t)||""))},nodeRenderStatus:function(t){var s,n=t.node,o=t.tree,a=t.options,r=n.hasChildren(),u=n.isLastSibling(),d=a.aria,l=a._classNames,c=[],h=n[o.statusClassPropName];h&&!1!==o._enableUpdate&&(d&&(s=e(n.tr||n.li)),c.push(l.node),o.activeNode===n&&c.push(l.active),o.focusNode===n&&c.push(l.focused),n.expanded&&c.push(l.expanded),d&&(!1===r?s.removeAttr("aria-expanded"):s.attr("aria-expanded",Boolean(n.expanded))),n.folder&&c.push(l.folder),!1!==r&&c.push(l.hasChildren),u&&c.push(l.lastsib),n.lazy&&null==n.children&&c.push(l.lazy),n.partload&&c.push(l.partload),n.partsel&&c.push(l.partsel),i.evalOption("unselectable",n,n,a,!1)&&c.push(l.unselectable),n._isLoading&&c.push(l.loading),n._error&&c.push(l.error),n.statusNodeType&&c.push(l.statusNodePrefix+n.statusNodeType),n.selected?(c.push(l.selected),d&&s.attr("aria-selected",!0)):d&&s.attr("aria-selected",!1),n.extraClasses&&c.push(n.extraClasses),!1===r?c.push(l.combinedExpanderPrefix+"n"+(u?"l":"")):c.push(l.combinedExpanderPrefix+(n.expanded?"e":"c")+(n.lazy&&null==n.children?"d":"")+(u?"l":"")),c.push(l.combinedIconPrefix+(n.expanded?"e":"c")+(n.folder?"f":"")),h.className=c.join(" "),n.li&&e(n.li).toggleClass(l.lastsib,u))},nodeSetActive:function(t,s,i){i=i||{};var n,o=t.node,a=t.tree,r=t.options,u=!0===i.noEvents,d=!0===i.noFocus,l=!1!==i.scrollIntoView;return o===a.activeNode==(s=!1!==s)?L(o):(l&&t.originalEvent&&e(t.originalEvent.target).is("a,:checkbox")&&(o.info("Not scrolling while clicking an embedded link."),l=!1),s&&!u&&!1===this._triggerNodeEvent("beforeActivate",o,t.originalEvent)?P(o,["rejected"]):(s?(a.activeNode&&(k(a.activeNode!==o,"node was active (inconsistency)"),n=e.extend({},t,{node:a.activeNode}),a.nodeSetActive(n,!1),k(null===a.activeNode,"deactivate was out of sync?")),r.activeVisible&&o.makeVisible({scrollIntoView:l}),a.activeNode=o,a.nodeRenderStatus(t),d||a.nodeSetFocus(t),u||a._triggerNodeEvent("activate",o,t.originalEvent)):(k(a.activeNode===o,"node was not active (inconsistency)"),a.activeNode=null,this.nodeRenderStatus(t),u||t.tree._triggerNodeEvent("deactivate",o,t.originalEvent)),L(o)))},nodeSetExpanded:function(t,s,i){i=i||{};var n,o,a,r,u,d,l=t.node,c=t.tree,h=t.options,p=!0===i.noAnimation,m=!0===i.noEvents;if(s=!1!==s,e(l.li).hasClass(h._classNames.animating))return l.warn("setExpanded("+s+") while animating: ignored."),P(l,["recursion"]);if(l.expanded&&s||!l.expanded&&!s)return L(l);if(s&&!l.lazy&&!l.hasChildren())return L(l);if(!s&&l.getLevel()<h.minExpandLevel)return P(l,["locked"]);if(!m&&!1===this._triggerNodeEvent("beforeExpand",l,t.originalEvent))return P(l,["rejected"]);if(p||l.isVisible()||(p=i.noAnimation=!0),o=new e.Deferred,s&&!l.expanded&&h.autoCollapse){u=l.getParentList(!1,!0),d=h.autoCollapse;try{for(h.autoCollapse=!1,a=0,r=u.length;a<r;a++)this._callHook("nodeCollapseSiblings",u[a],i)}finally{h.autoCollapse=d}}return o.done((function(){var e=l.getLastChild();s&&h.autoScroll&&!p&&e&&c._enableUpdate?e.scrollIntoView(!0,{topNode:l}).always((function(){m||t.tree._triggerNodeEvent(s?"expand":"collapse",t)})):m||t.tree._triggerNodeEvent(s?"expand":"collapse",t)})),n=function(i){var n=h._classNames,o=h.toggleEffect;if(l.expanded=s,c._callHook("treeStructureChanged",t,s?"expand":"collapse"),c._callHook("nodeRender",t,!1,!1,!0),l.ul)if("none"!==l.ul.style.display==!!l.expanded)l.warn("nodeSetExpanded: UL.style.display already set");else{if(o&&!p)return e(l.li).addClass(n.animating),void(S(e(l.ul)[o.effect])?e(l.ul)[o.effect]({duration:o.duration,always:function(){e(this).removeClass(n.animating),e(l.li).removeClass(n.animating),i()}}):(e(l.ul).stop(!0,!0),e(l.ul).parent().find(".ui-effects-placeholder").remove(),e(l.ul).toggle(o.effect,o.options,o.duration,(function(){e(this).removeClass(n.animating),e(l.li).removeClass(n.animating),i()}))));l.ul.style.display=l.expanded||!parent?"":"none"}i()},s&&l.lazy&&void 0===l.hasChildren()?l.load().done((function(){o.notifyWith&&o.notifyWith(l,["loaded"]),n((function(){o.resolveWith(l)}))})).fail((function(e){n((function(){o.rejectWith(l,["load failed ("+e+")"])}))})):n((function(){o.resolveWith(l)})),o.promise()},nodeSetFocus:function(t,s){var i,n=t.tree,o=t.node,a=n.options,r=!!t.originalEvent&&e(t.originalEvent.target).is(":input");if(s=!1!==s,n.focusNode){if(n.focusNode===o&&s)return;i=e.extend({},t,{node:n.focusNode}),n.focusNode=null,this._triggerNodeEvent("blur",i),this._callHook("nodeRenderStatus",i)}s&&(this.hasFocus()||(o.debug("nodeSetFocus: forcing container focus"),this._callHook("treeSetFocus",t,!0,{calledByNode:!0})),o.makeVisible({scrollIntoView:!1}),n.focusNode=o,a.titlesTabbable&&(r||e(o.span).find(".fancytree-title").focus()),a.aria&&e(n.$container).attr("aria-activedescendant",e(o.tr||o.li).uniqueId().attr("id")),this._triggerNodeEvent("focus",t),document.activeElement===n.$container.get(0)||e(document.activeElement,n.$container).length>=1||e(n.$container).focus(),a.autoScroll&&o.scrollIntoView(),this._callHook("nodeRenderStatus",t))},nodeSetSelected:function(e,t,s){s=s||{};var n=e.node,o=e.tree,a=e.options,r=!0===s.noEvents,u=n.parent;if(t=!1!==t,!i.evalOption("unselectable",n,n,a,!1)){if(n._lastSelectIntent=t,!!n.selected===t&&(3!==a.selectMode||!n.partsel||t))return t;if(!r&&!1===this._triggerNodeEvent("beforeSelect",n,e.originalEvent))return!!n.selected;t&&1===a.selectMode?(o.lastSelectedNode&&o.lastSelectedNode.setSelected(!1),n.selected=t):3!==a.selectMode||!u||u.radiogroup||n.radiogroup?u&&u.radiogroup?n.visitSiblings((function(e){e._changeSelectStatusAttrs(t&&e===n)}),!0):n.selected=t:(n.selected=t,n.fixSelection3AfterClick(s)),this.nodeRenderStatus(e),o.lastSelectedNode=t?n:null,r||o._triggerNodeEvent("select",e)}},nodeSetStatus:function(t,s,i,n){var o=t.node,a=t.tree;function r(){var e=o.children?o.children[0]:null;if(e&&e.isStatusNode()){try{o.ul&&(o.ul.removeChild(e.li),e.li=null)}catch(e){}1===o.children.length?o.children=[]:o.children.shift(),a._callHook("treeStructureChanged",t,"clearStatusNode")}}function u(s,i){var n=o.children?o.children[0]:null;return n&&n.isStatusNode()?(e.extend(n,s),n.statusNodeType=i,a._callHook("nodeRenderTitle",n)):(o._setChildren([s]),a._callHook("treeStructureChanged",t,"setStatusNode"),o.children[0].statusNodeType=i,a.render()),o.children[0]}switch(s){case"ok":r(),o._isLoading=!1,o._error=null,o.renderStatus();break;case"loading":o.parent||u({title:a.options.strings.loading+(i?" ("+i+")":""),checkbox:!1,tooltip:n},s),o._isLoading=!0,o._error=null,o.renderStatus();break;case"error":u({title:a.options.strings.loadError+(i?" ("+i+")":""),checkbox:!1,tooltip:n},s),o._isLoading=!1,o._error={message:i,details:n},o.renderStatus();break;case"nodata":u({title:i||a.options.strings.noData,checkbox:!1,tooltip:n},s),o._isLoading=!1,o._error=null,o.renderStatus();break;default:e.error("invalid node status "+s)}},nodeToggleExpanded:function(e){return this.nodeSetExpanded(e,!e.node.expanded)},nodeToggleSelected:function(e){var t=e.node,s=!t.selected;return t.partsel&&!t.selected&&!0===t._lastSelectIntent&&(s=!1,t.selected=!0),t._lastSelectIntent=s,this.nodeSetSelected(e,s)},treeClear:function(e){var t=e.tree;t.activeNode=null,t.focusNode=null,t.$div.find(">ul.fancytree-container").empty(),t.rootNode.children=null,t._callHook("treeStructureChanged",e,"clear")},treeCreate:function(e){},treeDestroy:function(e){this.$div.find(">ul.fancytree-container").remove(),this.$source&&this.$source.removeClass("fancytree-helper-hidden")},treeInit:function(t){var s=t.tree,i=s.options;s.$container.attr("tabindex",i.tabindex),e.each(g,(function(e,t){void 0!==i[t]&&(s.info("Move option "+t+" to tree"),s[t]=i[t],delete i[t])})),i.checkboxAutoHide&&s.$container.addClass("fancytree-checkbox-auto-hide"),i.rtl?s.$container.attr("DIR","RTL").addClass("fancytree-rtl"):s.$container.removeAttr("DIR").removeClass("fancytree-rtl"),i.aria&&(s.$container.attr("role","tree"),1!==i.selectMode&&s.$container.attr("aria-multiselectable",!0)),this.treeLoad(t)},treeLoad:function(t,s){var n,o,a,r=t.tree,u=t.widget.element,d=e.extend({},t,{node:this.rootNode});if(r.rootNode.children&&this.treeClear(t),s=s||this.options.source)"string"==typeof s&&e.error("Not implemented");else switch(o=u.data("type")||"html"){case"html":(a=u.find(">ul").not(".fancytree-container").first()).length?(a.addClass("ui-fancytree-source fancytree-helper-hidden"),s=e.ui.fancytree.parseHtml(a),this.data=e.extend(this.data,H(a))):(i.warn("No `source` option was passed and container does not contain `<ul>`: assuming `source: []`."),s=[]);break;case"json":s=e.parseJSON(u.text()),u.contents().filter((function(){return 3===this.nodeType})).remove(),e.isPlainObject(s)&&(k(b(s.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),n=s,s=s.children,delete n.children,e.each(g,(function(e,t){void 0!==n[t]&&(r[t]=n[t],delete n[t])})),e.extend(r.data,n));break;default:e.error("Invalid data-type: "+o)}return r._triggerTreeEvent("preInit",null),this.nodeLoadChildren(d,s).done((function(){r._callHook("treeStructureChanged",t,"loadChildren"),r.render(),3===t.options.selectMode&&r.rootNode.fixSelection3FromEndNodes(),r.activeNode&&r.options.activeVisible&&r.activeNode.makeVisible(),r._triggerTreeEvent("init",null,{status:!0})})).fail((function(){r.render(),r._triggerTreeEvent("init",null,{status:!1})}))},treeRegisterNode:function(e,t,s){e.tree._callHook("treeStructureChanged",e,t?"addNode":"removeNode")},treeSetFocus:function(t,s,i){var n;(s=!1!==s)!==this.hasFocus()&&(this._hasFocus=s,!s&&this.focusNode?this.focusNode.setFocus(!1):!s||i&&i.calledByNode||e(this.$container).focus(),this.$container.toggleClass("fancytree-treefocus",s),this._triggerTreeEvent(s?"focusTree":"blurTree"),s&&!this.activeNode&&(n=this._lastMousedownNode||this.getFirstChild())&&n.setFocus())},treeSetOption:function(t,s,i){var n=t.tree,o=!0,a=!1,r=!1;switch(s){case"aria":case"checkbox":case"icon":case"minExpandLevel":case"tabindex":a=!0,r=!0;break;case"checkboxAutoHide":n.$container.toggleClass("fancytree-checkbox-auto-hide",!!i);break;case"escapeTitles":case"tooltip":r=!0;break;case"rtl":!1===i?n.$container.removeAttr("DIR").removeClass("fancytree-rtl"):n.$container.attr("DIR","RTL").addClass("fancytree-rtl"),r=!0;break;case"source":o=!1,n._callHook("treeLoad",n,i),r=!0}n.debug("set option "+s+"="+i+" <"+typeof i+">"),o&&(this.widget._super?this.widget._super.call(this.widget,s,i):e.Widget.prototype._setOption.call(this.widget,s,i)),a&&n._callHook("treeCreate",n),r&&n.render(!0,!1)},treeStructureChanged:function(e,t){}}),e.widget("ui.fancytree",{options:{activeVisible:!0,ajax:{type:"GET",cache:!1,dataType:"json"},aria:!0,autoActivate:!0,autoCollapse:!1,autoScroll:!1,checkbox:!1,clickFolderMode:4,copyFunctionsToData:!1,debugLevel:null,disabled:!1,enableAspx:42,escapeTitles:!1,extensions:[],focusOnSelect:!1,generateIds:!1,icon:!0,idPrefix:"ft_",keyboard:!0,keyPathSeparator:"/",minExpandLevel:1,nodata:!0,quicksearch:!1,rtl:!1,scrollOfs:{top:0,bottom:0},scrollParent:null,selectMode:2,strings:{loading:"Loading...",loadError:"Load error!",moreData:"More...",noData:"No data."},tabindex:"0",titlesTabbable:!1,toggleEffect:{effect:"slideToggle",duration:200},tooltip:!1,treeId:null,_classNames:{active:"fancytree-active",animating:"fancytree-animating",combinedExpanderPrefix:"fancytree-exp-",combinedIconPrefix:"fancytree-ico-",error:"fancytree-error",expanded:"fancytree-expanded",focused:"fancytree-focused",folder:"fancytree-folder",hasChildren:"fancytree-has-children",lastsib:"fancytree-lastsib",lazy:"fancytree-lazy",loading:"fancytree-loading",node:"fancytree-node",partload:"fancytree-partload",partsel:"fancytree-partsel",radio:"fancytree-radio",selected:"fancytree-selected",statusNodePrefix:"fancytree-statusnode-",unselectable:"fancytree-unselectable"},lazyLoad:null,postProcess:null},_deprecationWarning:function(e){var t=this.tree;t&&t.options.debugLevel>=3&&t.warn("$().fancytree('"+e+"') is deprecated (see https://wwwendt.de/tech/fancytree/doc/jsdoc/Fancytree_Widget.html")},_create:function(){this.tree=new B(this),this.$source=this.source||"json"===this.element.data("type")?this.element:this.element.find(">ul").first();var t,s,i,n=this.options,o=n.extensions,a=this.tree;for(i=0;i<o.length;i++)s=o[i],(t=e.ui.fancytree._extensions[s])||e.error("Could not apply extension '"+s+"' (it is not registered, did you forget to include it?)"),this.tree.options[s]=j({},t.options,this.tree.options[s]),k(void 0===this.tree.ext[s],"Extension name must not exist as Fancytree.ext attribute: '"+s+"'"),this.tree.ext[s]={},z(this.tree,a,t,s),a=t;void 0!==n.icons&&(!0===n.icon?(this.tree.warn("'icons' tree option is deprecated since v2.14.0: use 'icon' instead"),n.icon=n.icons):e.error("'icons' tree option is deprecated since v2.14.0: use 'icon' only instead")),void 0!==n.iconClass&&(n.icon?e.error("'iconClass' tree option is deprecated since v2.14.0: use 'icon' only instead"):(this.tree.warn("'iconClass' tree option is deprecated since v2.14.0: use 'icon' instead"),n.icon=n.iconClass)),void 0!==n.tabbable&&(n.tabindex=n.tabbable?"0":"-1",this.tree.warn("'tabbable' tree option is deprecated since v2.17.0: use 'tabindex='"+n.tabindex+"' instead")),this.tree._callHook("treeCreate",this.tree)},_init:function(){this.tree._callHook("treeInit",this.tree),this._bind()},_setOption:function(e,t){return this.tree._callHook("treeSetOption",this.tree,e,t)},_destroy:function(){this._unbind(),this.tree._callHook("treeDestroy",this.tree)},_unbind:function(){var t=this.tree._ns;this.element.off(t),this.tree.$container.off(t),e(document).off(t)},_bind:function(){var t=this,s=this.options,n=this.tree,o=n._ns;this._unbind(),n.$container.on("focusin"+o+" focusout"+o,(function(t){var s=i.getNode(t),o="focusin"===t.type;if(!o&&s&&e(t.target).is("a"))s.debug("Ignored focusout on embedded <a> element.");else{if(o){if(n._getExpiringValue("focusin"))return void n.debug("Ignored double focusin.");n._setExpiringValue("focusin",!0,50),s||(s=n._getExpiringValue("mouseDownNode"))&&n.debug("Reconstruct mouse target for focusin from recent event.")}s?n._callHook("nodeSetFocus",n._makeHookContext(s,t),o):n.tbody&&e(t.target).parents("table.fancytree-container > thead").length?n.debug("Ignore focus event outside table body.",t):n._callHook("treeSetFocus",n,o)}})).on("selectstart"+o,"span.fancytree-title",(function(e){e.preventDefault()})).on("keydown"+o,(function(e){if(s.disabled||!1===s.keyboard)return!0;var t,i=n.focusNode,o=n._makeHookContext(i||n,e),a=n.phase;try{return n.phase="userEvent","preventNav"===(t=i?n._triggerNodeEvent("keydown",i,e):n._triggerTreeEvent("keydown",e))?t=!0:!1!==t&&(t=n._callHook("nodeKeydown",o)),t}finally{n.phase=a}})).on("mousedown"+o,(function(e){var t=i.getEventTarget(e);n._lastMousedownNode=t?t.node:null,n._setExpiringValue("mouseDownNode",n._lastMousedownNode)})).on("click"+o+" dblclick"+o,(function(e){if(s.disabled)return!0;var n,o=i.getEventTarget(e),a=o.node,r=t.tree,u=r.phase;if(!a)return!0;n=r._makeHookContext(a,e);try{switch(r.phase="userEvent",e.type){case"click":return n.targetType=o.type,a.isPagingNode()?!0===r._triggerNodeEvent("clickPaging",n,e):!1!==r._triggerNodeEvent("click",n,e)&&r._callHook("nodeClick",n);case"dblclick":return n.targetType=o.type,!1!==r._triggerNodeEvent("dblclick",n,e)&&r._callHook("nodeDblclick",n)}}finally{r.phase=u}}))},getActiveNode:function(){return this._deprecationWarning("getActiveNode"),this.tree.activeNode},getNodeByKey:function(e){return this._deprecationWarning("getNodeByKey"),this.tree.getNodeByKey(e)},getRootNode:function(){return this._deprecationWarning("getRootNode"),this.tree.rootNode},getTree:function(){return this._deprecationWarning("getTree"),this.tree}}),i=e.ui.fancytree,e.extend(e.ui.fancytree,{version:"2.38.1-0",buildType:"production",debugLevel:3,_nextId:1,_nextNodeKey:1,_extensions:{},_FancytreeClass:B,_FancytreeNodeClass:A,jquerySupports:{positionMyOfs:T(e.ui.version,1,9)},assert:function(e,t){return k(e,t)},createTree:function(t,s){var n=e(t).fancytree(s);return i.getTree(n)},debounce:function(e,t,s,i){var n;return 3===arguments.length&&"boolean"!=typeof s&&(i=s,s=!1),function(){var o=arguments;i=i||this,s&&!n&&t.apply(i,o),clearTimeout(n),n=setTimeout((function(){s||t.apply(i,o),n=null}),e)}},debug:function(t){e.ui.fancytree.debugLevel>=4&&N("log",arguments)},error:function(t){e.ui.fancytree.debugLevel>=1&&N("error",arguments)},escapeHtml:function(e){return(""+e).replace(o,(function(e){return d[e]}))},fixPositionOptions:function(t){if((t.offset||(""+t.my+t.at).indexOf("%")>=0)&&e.error("expected new position syntax (but '%' is not supported)"),!e.ui.fancytree.jquerySupports.positionMyOfs){var s=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.my),i=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.at),n=(s[2]?+s[2]:0)+(i[2]?+i[2]:0),o=(s[4]?+s[4]:0)+(i[4]?+i[4]:0);t=e.extend({},t,{my:s[1]+" "+s[3],at:i[1]+" "+i[3]}),(n||o)&&(t.offset=n+" "+o)}return t},getEventTarget:function(t){var s,n=t&&t.target?t.target.className:"",o={node:this.getNode(t.target),type:void 0};return/\bfancytree-title\b/.test(n)?o.type="title":/\bfancytree-expander\b/.test(n)?o.type=!1===o.node.hasChildren()?"prefix":"expander":/\bfancytree-checkbox\b/.test(n)?o.type="checkbox":/\bfancytree(-custom)?-icon\b/.test(n)?o.type="icon":/\bfancytree-node\b/.test(n)?o.type="title":t&&t.target&&((s=e(t.target)).is("ul[role=group]")?((o.node&&o.node.tree||i).debug("Ignoring click on outer UL."),o.node=null):s.closest(".fancytree-title").length?o.type="title":s.closest(".fancytree-checkbox").length?o.type="checkbox":s.closest(".fancytree-expander").length&&(o.type="expander")),o},getEventTargetType:function(e){return this.getEventTarget(e).type},getNode:function(t){if(t instanceof A)return t;for(t instanceof e?t=t[0]:void 0!==t.originalEvent&&(t=t.target);t;){if(t.ftnode)return t.ftnode;t=t.parentNode}return null},getTree:function(t){var s,i=t;return t instanceof B?t:(void 0===t&&(t=0),"number"==typeof t?t=e(".fancytree-container").eq(t):"string"==typeof t?(t=e("#ft-id-"+i).eq(0)).length||(t=e(i).eq(0)):t instanceof Element||t instanceof HTMLDocument?t=e(t):t instanceof e?t=t.eq(0):void 0!==t.originalEvent&&(t=e(t.target)),(s=(t=t.closest(":ui-fancytree")).data("ui-fancytree")||t.data("fancytree"))?s.tree:null)},evalOption:function(e,t,s,i,n){var o,a,r=t.tree,u=i[e],d=s[e];return S(u)?(o={node:t,tree:r,widget:r.widget,options:r.widget.options,typeInfo:r.types[t.type]||{}},null==(a=u.call(r,{type:e},o))&&(a=d)):a=null==d?u:d,null==a&&(a=n),a},setSpanIcon:function(t,s,i){var n=e(t);"string"==typeof i?n.attr("class",s+" "+i):(i.text?n.text(""+i.text):i.html&&(t.innerHTML=i.html),n.attr("class",s+" "+(i.addClass||"")))},eventToString:function(e){var t=e.which,s=e.type,i=[];return e.altKey&&i.push("alt"),e.ctrlKey&&i.push("ctrl"),e.metaKey&&i.push("meta"),e.shiftKey&&i.push("shift"),"click"===s||"dblclick"===s?i.push(p[e.button]+s):"wheel"===s?i.push(s):l[t]||i.push(c[t]||String.fromCharCode(t).toLowerCase()),i.join("+")},info:function(t){e.ui.fancytree.debugLevel>=3&&N("info",arguments)},keyEventToString:function(e){return this.warn("keyEventToString() is deprecated: use eventToString()"),this.eventToString(e)},overrideMethod:function(t,s,i,n){var o,a=t[s]||e.noop;t[s]=function(){var e=n||this;try{return o=e._super,e._super=a,i.apply(e,arguments)}finally{e._super=o}}},parseHtml:function(t){var s,i,n,o,a,r,u,d,l=t.find(">li"),c=[];return l.each((function(){var l,h,p=e(this),g=p.find(">span",this).first(),_=g.length?null:p.find(">a").first(),y={tooltip:null,data:{}};for(g.length?y.title=g.html():_&&_.length?(y.title=_.html(),y.data.href=_.attr("href"),y.data.target=_.attr("target"),y.tooltip=_.attr("title")):(y.title=p.html(),(a=y.title.search(/<ul/i))>=0&&(y.title=y.title.substring(0,a))),y.title=C(y.title),o=0,r=m.length;o<r;o++)y[m[o]]=void 0;for(s=this.className.split(" "),n=[],o=0,r=s.length;o<r;o++)i=s[o],f[i]?y[i]=!0:n.push(i);if(y.extraClasses=n.join(" "),(u=p.attr("title"))&&(y.tooltip=u),(u=p.attr("id"))&&(y.key=u),p.attr("hideCheckbox")&&(y.checkbox=!1),(l=H(p))&&!e.isEmptyObject(l)){for(h in w)x(l,h)&&(l[w[h]]=l[h],delete l[h]);for(o=0,r=v.length;o<r;o++)u=v[o],null!=(d=l[u])&&(delete l[u],y[u]=d);e.extend(y.data,l)}(t=p.find(">ul").first()).length?y.children=e.ui.fancytree.parseHtml(t):y.children=y.lazy?void 0:null,c.push(y)})),c},registerExtension:function(t){k(null!=t.name,"extensions must have a `name` property."),k(null!=t.version,"extensions must have a `version` property."),e.ui.fancytree._extensions[t.name]=t},trim:C,unescapeHtml:function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue},warn:function(t){e.ui.fancytree.debugLevel>=2&&N("warn",arguments)}}),e.ui.fancytree}function k(t,s){t||(s="Fancytree assertion failed"+(s=s?": "+s:""),e.ui.fancytree.error(s),e.error(s))}function x(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function S(e){return"function"==typeof e}function C(e){return null==e?"":e.trim()}function N(e,t){var s,i,n=window.console?window.console[e]:null;if(n)try{n.apply(window.console,t)}catch(e){for(i="",s=0;s<t.length;s++)i+=t[s];n(i)}}function E(e){return!(!e.tree||void 0===e.statusNodeType)}function T(t,s,i,n){var o,a,r,u=e.map(C(t).split("."),(function(e){return parseInt(e,10)})),d=e.map(Array.prototype.slice.call(arguments,1),(function(e){return parseInt(e,10)}));for(o=0;o<d.length;o++)if((a=u[o]||0)!==(r=d[o]||0))return a>r;return!0}function j(){var t,s,i,n,o,a=arguments[0]||{},r=1,u=arguments.length;if("object"==typeof a||S(a)||(a={}),r===u)throw Error("need at least two args");for(;r<u;r++)if(null!=(t=arguments[r]))for(s in t)if(x(t,s)){if(i=a[s],a===(n=t[s]))continue;n&&e.isPlainObject(n)?(o=i&&e.isPlainObject(i)?i:{},a[s]=j(o,n)):void 0!==n&&(a[s]=n)}return a}function I(e,t,s,i,n){var o,a,r,u,d,l=(o=t[e],a=i[e],r=t.ext[n],u=function(){return o.apply(t,arguments)},d=function(e){return o.apply(t,e)},function(){var e=t._local,s=t._super,i=t._superApply;try{return t._local=r,t._super=u,t._superApply=d,a.apply(t,arguments)}finally{t._local=e,t._super=s,t._superApply=i}});return l}function z(t,s,i,n){for(var o in i)"function"==typeof i[o]?"function"==typeof t[o]?t[o]=I(o,t,s,i,n):"_"===o.charAt(0)?t.ext[n][o]=I(o,t,s,i,n):e.error("Could not override tree."+o+". Use prefix '_' to create tree."+n+"._"+o):"options"!==o&&(t.ext[n][o]=i[o])}function L(t,s){return void 0===t?e.Deferred((function(){this.resolve()})).promise():e.Deferred((function(){this.resolveWith(t,s)})).promise()}function P(t,s){return void 0===t?e.Deferred((function(){this.reject()})).promise():e.Deferred((function(){this.rejectWith(t,s)})).promise()}function D(e,t){return function(){e.resolveWith(t)}}function H(t){var s=e.extend({},t.data()),i=s.json;return delete s.fancytree,delete s.uiFancytree,i&&(delete s.json,s=e.extend(s,i)),s}function W(e){return(""+e).replace(a,(function(e){return d[e]}))}function R(e){return e=e.toLowerCase(),function(t){return t.title.toLowerCase().indexOf(e)>=0}}function O(e){var t=new RegExp("^"+e,"i");return function(e){return t.test(e.title)}}function A(t,s){var n,o,a,r;for(this.parent=t,this.tree=t.tree,this.ul=null,this.li=null,this.statusNodeType=null,this._isLoading=!1,this._error=null,this.data={},n=0,o=v.length;n<o;n++)this[a=v[n]]=s[a];for(a in null==this.unselectableIgnore&&null==this.unselectableStatus||(this.unselectable=!0),s.hideCheckbox&&e.error("'hideCheckbox' node option was removed in v2.23.0: use 'checkbox: false'"),s.data&&e.extend(this.data,s.data),s)_[a]||!this.tree.options.copyFunctionsToData&&S(s[a])||y[a]||(this.data[a]=s[a]);null==this.key?this.tree.options.defaultKey?(this.key=""+this.tree.options.defaultKey(this),k(this.key,"defaultKey() must return a unique key")):this.key="_"+i._nextNodeKey++:this.key=""+this.key,s.active&&(k(null===this.tree.activeNode,"only one active node allowed"),this.tree.activeNode=this),s.selected&&(this.tree.lastSelectedNode=this),(r=s.children)?r.length?this._setChildren(r):this.children=this.lazy?[]:null:this.children=null,this.tree._callHook("treeRegisterNode",this.tree,!0,this)}function B(t){this.widget=t,this.$div=t.element,this.options=t.options,this.options&&(void 0!==this.options.lazyload&&e.error("The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead."),void 0!==this.options.loaderror&&e.error("The 'loaderror' event was renamed since 2014-07-03. Use 'loadError' (with uppercase E) instead."),void 0!==this.options.fx&&e.error("The 'fx' option was replaced by 'toggleEffect' since 2014-11-30."),void 0!==this.options.removeNode&&e.error("The 'removeNode' event was replaced by 'modifyChild' since 2.20 (2016-09-10).")),this.ext={},this.types={},this.columns={},this.data=H(this.$div),this._id=""+(this.options.treeId||e.ui.fancytree._nextId++),this._ns=".fancytree-"+this._id,this.activeNode=null,this.focusNode=null,this._hasFocus=null,this._tempCache={},this._lastMousedownNode=null,this._enableUpdate=!0,this.lastSelectedNode=null,this.systemFocusElement=null,this.lastQuicksearchTerm="",this.lastQuicksearchTime=0,this.viewport=null,this.statusClassPropName="span",this.ariaPropName="li",this.nodeContainerAttrName="li",this.$div.find(">ul.fancytree-container").remove();var s,n={tree:this};this.rootNode=new A(n,{title:"root",key:"root_"+this._id,children:null,expanded:!0}),this.rootNode.parent=null,s=e("<ul>",{id:"ft-id-"+this._id,class:"ui-fancytree fancytree-container fancytree-plain"}).appendTo(this.$div),this.$container=s,this.rootNode.ul=s[0],null==this.options.debugLevel&&(this.options.debugLevel=i.debugLevel)}e.ui.fancytree.warn("Fancytree: ignored duplicate include")},void 0===(o="function"==typeof i?i.apply(t,n):i)||(e.exports=o)},3860:function(e,t,s){var i,n,o;n=[s(5311)],i=function(e){e.ui=e.ui||{},e.ui.version="1.12.1";var t,s,i=0,n=Array.prototype.slice;e.cleanData=e.cleanData||(t=e.cleanData,function(s){var i,n,o;for(o=0;null!=(n=s[o]);o++)try{(i=e._data(n,"events"))&&i.remove&&e(n).triggerHandler("remove")}catch(e){}t(s)}),e.widget=e.widget||function(t,s,i){var n,o,a,r={},u=t.split(".")[0],d=u+"-"+(t=t.split(".")[1]);return i||(i=s,s=e.Widget),e.isArray(i)&&(i=e.extend.apply(null,[{}].concat(i))),e.expr[":"][d.toLowerCase()]=function(t){return!!e.data(t,d)},e[u]=e[u]||{},n=e[u][t],o=e[u][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,n,{version:i.version,_proto:e.extend({},i),_childConstructors:[]}),(a=new s).options=e.widget.extend({},a.options),e.each(i,(function(t,i){e.isFunction(i)?r[t]=function(){function e(){return s.prototype[t].apply(this,arguments)}function n(e){return s.prototype[t].apply(this,e)}return function(){var t,s=this._super,o=this._superApply;return this._super=e,this._superApply=n,t=i.apply(this,arguments),this._super=s,this._superApply=o,t}}():r[t]=i})),o.prototype=e.widget.extend(a,{widgetEventPrefix:n&&a.widgetEventPrefix||t},r,{constructor:o,namespace:u,widgetName:t,widgetFullName:d}),n?(e.each(n._childConstructors,(function(t,s){var i=s.prototype;e.widget(i.namespace+"."+i.widgetName,o,s._proto)})),delete n._childConstructors):s._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var s,i,o=n.call(arguments,1),a=0,r=o.length;a<r;a++)for(s in o[a])i=o[a][s],o[a].hasOwnProperty(s)&&void 0!==i&&(e.isPlainObject(i)?t[s]=e.isPlainObject(t[s])?e.widget.extend({},t[s],i):e.widget.extend({},i):t[s]=i);return t},e.widget.bridge=function(t,s){var i=s.prototype.widgetFullName||t;e.fn[t]=function(o){var a="string"==typeof o,r=n.call(arguments,1),u=this;return a?this.length||"instance"!==o?this.each((function(){var s,n=e.data(this,i);return"instance"===o?(u=n,!1):n?e.isFunction(n[o])&&"_"!==o.charAt(0)?(s=n[o].apply(n,r))!==n&&void 0!==s?(u=s&&s.jquery?u.pushStack(s.get()):s,!1):void 0:e.error("no such method '"+o+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+o+"'")})):u=void 0:(r.length&&(o=e.widget.extend.apply(null,[o].concat(r))),this.each((function(){var t=e.data(this,i);t?(t.option(o||{}),t._init&&t._init()):e.data(this,i,new s(o,this))}))),u}},e.Widget=e.Widget||function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){var t=this;this._destroy(),e.each(this.classesElementLookup,(function(e,s){t._removeClass(s,e)})),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:e.noop,widget:function(){return this.element},option:function(t,s){var i,n,o,a=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(a={},i=t.split("."),t=i.shift(),i.length){for(n=a[t]=e.widget.extend({},this.options[t]),o=0;o<i.length-1;o++)n[i[o]]=n[i[o]]||{},n=n[i[o]];if(t=i.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=s}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];a[t]=s}return this._setOptions(a),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return"classes"===e&&this._setOptionClasses(t),this.options[e]=t,"disabled"===e&&this._setOptionDisabled(t),this},_setOptionClasses:function(t){var s,i,n;for(s in t)n=this.classesElementLookup[s],t[s]!==this.options.classes[s]&&n&&n.length&&(i=e(n.get()),this._removeClass(n,s),i.addClass(this._classes({element:i,keys:s,classes:t,add:!0})))},_setOptionDisabled:function(e){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!e),e&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(t){var s=[],i=this;function n(n,o){var a,r;for(r=0;r<n.length;r++)a=i.classesElementLookup[n[r]]||e(),a=t.add?e(e.unique(a.get().concat(t.element.get()))):e(a.not(t.element).get()),i.classesElementLookup[n[r]]=a,s.push(n[r]),o&&t.classes[n[r]]&&s.push(t.classes[n[r]])}return t=e.extend({element:this.element,classes:this.options.classes||{}},t),this._on(t.element,{remove:"_untrackClassesElement"}),t.keys&&n(t.keys.match(/\S+/g)||[],!0),t.extra&&n(t.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(t){var s=this;e.each(s.classesElementLookup,(function(i,n){-1!==e.inArray(t.target,n)&&(s.classesElementLookup[i]=e(n.not(t.target).get()))}))},_removeClass:function(e,t,s){return this._toggleClass(e,t,s,!1)},_addClass:function(e,t,s){return this._toggleClass(e,t,s,!0)},_toggleClass:function(e,t,s,i){i="boolean"==typeof i?i:s;var n="string"==typeof e||null===e,o={extra:n?t:s,keys:n?e:t,element:n?this.element:e,add:i};return o.element.toggleClass(this._classes(o),i),this},_on:function(t,s,i){var n,o=this;"boolean"!=typeof t&&(i=s,s=t,t=!1),i?(s=n=e(s),this.bindings=this.bindings.add(s)):(i=s,s=this.element,n=this.widget()),e.each(i,(function(i,a){function r(){if(t||!0!==o.options.disabled&&!e(this).hasClass("ui-state-disabled"))return("string"==typeof a?o[a]:a).apply(o,arguments)}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||e.guid++);var u=i.match(/^([\w:-]*)\s*(.*)$/),d=u[1]+o.eventNamespace,l=u[2];l?n.on(d,l,r):s.on(d,r)}))},_off:function(t,s){s=(s||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(s).off(s),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function s(){return("string"==typeof e?i[e]:e).apply(i,arguments)}var i=this;return setTimeout(s,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(e(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(e(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,s,i){var n,o,a=this.options[t];if(i=i||{},(s=e.Event(s)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),s.target=this.element[0],o=s.originalEvent)for(n in o)n in s||(s[n]=o[n]);return this.element.trigger(s,i),!(e.isFunction(a)&&!1===a.apply(this.element[0],[s].concat(i))||s.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},(function(t,s){e.Widget.prototype["_"+t]=function(i,n,o){var a;"string"==typeof n&&(n={effect:n});var r=n?!0===n||"number"==typeof n?s:n.effect||s:t;"number"==typeof(n=n||{})&&(n={duration:n}),a=!e.isEmptyObject(n),n.complete=o,n.delay&&i.delay(n.delay),a&&e.effects&&e.effects.effect[r]?i[t](n):r!==t&&i[r]?i[r](n.duration,n.easing,o):i.queue((function(s){e(this)[t](),o&&o.call(i[0]),s()}))}})),e.widget,function(){var t,s=Math.max,i=Math.abs,n=/left|center|right/,o=/top|center|bottom/,a=/[\+\-]\d+(\.[\d]+)?%?/,r=/^\w+/,u=/%$/,d=e.fn.position;function l(e,t,s){return[parseFloat(e[0])*(u.test(e[0])?t/100:1),parseFloat(e[1])*(u.test(e[1])?s/100:1)]}function c(t,s){return parseInt(e.css(t,s),10)||0}function h(t){var s=t[0];return 9===s.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(s)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:s.preventDefault?{width:0,height:0,offset:{top:s.pageY,left:s.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.position=e.position||{scrollbarWidth:function(){if(void 0!==t)return t;var s,i,n=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=n.children()[0];return e("body").append(n),s=o.offsetWidth,n.css("overflow","scroll"),s===(i=o.offsetWidth)&&(i=n[0].clientWidth),n.remove(),t=s-i},getScrollInfo:function(t){var s=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===s||"auto"===s&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?e.position.scrollbarWidth():0,height:n?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var s=e(t||window),i=e.isWindow(s[0]),n=!!s[0]&&9===s[0].nodeType;return{element:s,isWindow:i,isDocument:n,offset:i||n?{left:0,top:0}:e(t).offset(),scrollLeft:s.scrollLeft(),scrollTop:s.scrollTop(),width:s.outerWidth(),height:s.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return d.apply(this,arguments);t=e.extend({},t);var u,p,m,f,g,v,_=e(t.of),w=e.position.getWithinInfo(t.within),y=e.position.getScrollInfo(w),b=(t.collision||"flip").split(" "),k={};return v=h(_),_[0].preventDefault&&(t.at="left top"),p=v.width,m=v.height,f=v.offset,g=e.extend({},f),e.each(["my","at"],(function(){var e,s,i=(t[this]||"").split(" ");1===i.length&&(i=n.test(i[0])?i.concat(["center"]):o.test(i[0])?["center"].concat(i):["center","center"]),i[0]=n.test(i[0])?i[0]:"center",i[1]=o.test(i[1])?i[1]:"center",e=a.exec(i[0]),s=a.exec(i[1]),k[this]=[e?e[0]:0,s?s[0]:0],t[this]=[r.exec(i[0])[0],r.exec(i[1])[0]]})),1===b.length&&(b[1]=b[0]),"right"===t.at[0]?g.left+=p:"center"===t.at[0]&&(g.left+=p/2),"bottom"===t.at[1]?g.top+=m:"center"===t.at[1]&&(g.top+=m/2),u=l(k.at,p,m),g.left+=u[0],g.top+=u[1],this.each((function(){var n,o,a=e(this),r=a.outerWidth(),d=a.outerHeight(),h=c(this,"marginLeft"),v=c(this,"marginTop"),x=r+h+c(this,"marginRight")+y.width,S=d+v+c(this,"marginBottom")+y.height,C=e.extend({},g),N=l(k.my,a.outerWidth(),a.outerHeight());"right"===t.my[0]?C.left-=r:"center"===t.my[0]&&(C.left-=r/2),"bottom"===t.my[1]?C.top-=d:"center"===t.my[1]&&(C.top-=d/2),C.left+=N[0],C.top+=N[1],n={marginLeft:h,marginTop:v},e.each(["left","top"],(function(s,i){e.ui.position[b[s]]&&e.ui.position[b[s]][i](C,{targetWidth:p,targetHeight:m,elemWidth:r,elemHeight:d,collisionPosition:n,collisionWidth:x,collisionHeight:S,offset:[u[0]+N[0],u[1]+N[1]],my:t.my,at:t.at,within:w,elem:a})})),t.using&&(o=function(e){var n=f.left-C.left,o=n+p-r,u=f.top-C.top,l=u+m-d,c={target:{element:_,left:f.left,top:f.top,width:p,height:m},element:{element:a,left:C.left,top:C.top,width:r,height:d},horizontal:o<0?"left":n>0?"right":"center",vertical:l<0?"top":u>0?"bottom":"middle"};p<r&&i(n+o)<p&&(c.horizontal="center"),m<d&&i(u+l)<m&&(c.vertical="middle"),s(i(n),i(o))>s(i(u),i(l))?c.important="horizontal":c.important="vertical",t.using.call(this,e,c)}),a.offset(e.extend(C,{using:o}))}))},e.ui.position={fit:{left:function(e,t){var i,n=t.within,o=n.isWindow?n.scrollLeft:n.offset.left,a=n.width,r=e.left-t.collisionPosition.marginLeft,u=o-r,d=r+t.collisionWidth-a-o;t.collisionWidth>a?u>0&&d<=0?(i=e.left+u+t.collisionWidth-a-o,e.left+=u-i):e.left=d>0&&u<=0?o:u>d?o+a-t.collisionWidth:o:u>0?e.left+=u:d>0?e.left-=d:e.left=s(e.left-r,e.left)},top:function(e,t){var i,n=t.within,o=n.isWindow?n.scrollTop:n.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,u=o-r,d=r+t.collisionHeight-a-o;t.collisionHeight>a?u>0&&d<=0?(i=e.top+u+t.collisionHeight-a-o,e.top+=u-i):e.top=d>0&&u<=0?o:u>d?o+a-t.collisionHeight:o:u>0?e.top+=u:d>0?e.top-=d:e.top=s(e.top-r,e.top)}},flip:{left:function(e,t){var s,n,o=t.within,a=o.offset.left+o.scrollLeft,r=o.width,u=o.isWindow?o.scrollLeft:o.offset.left,d=e.left-t.collisionPosition.marginLeft,l=d-u,c=d+t.collisionWidth-r-u,h="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,m=-2*t.offset[0];l<0?((s=e.left+h+p+m+t.collisionWidth-r-a)<0||s<i(l))&&(e.left+=h+p+m):c>0&&((n=e.left-t.collisionPosition.marginLeft+h+p+m-u)>0||i(n)<c)&&(e.left+=h+p+m)},top:function(e,t){var s,n,o=t.within,a=o.offset.top+o.scrollTop,r=o.height,u=o.isWindow?o.scrollTop:o.offset.top,d=e.top-t.collisionPosition.marginTop,l=d-u,c=d+t.collisionHeight-r-u,h="top"===t.my[1]?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,p="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];l<0?((n=e.top+h+p+m+t.collisionHeight-r-a)<0||n<i(l))&&(e.top+=h+p+m):c>0&&((s=e.top-t.collisionPosition.marginTop+h+p+m-u)>0||i(s)<c)&&(e.top+=h+p+m)}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}}}(),e.ui.position,e.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},e.fn.scrollParent=function(t){var s=this.css("position"),i="absolute"===s,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter((function(){var t=e(this);return(!i||"static"!==t.css("position"))&&n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))})).eq(0);return"fixed"!==s&&o.length?o:e(this[0].ownerDocument||document)},e.fn.extend({uniqueId:(s=0,function(){return this.each((function(){this.id||(this.id="ui-id-"+ ++s)}))}),removeUniqueId:function(){return this.each((function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")}))}})},void 0===(o="function"==typeof i?i.apply(t,n):i)||(e.exports=o)},5311:function(e){"use strict";e.exports=jQuery}},t={};function s(i){var n=t[i];if(void 0!==n)return n.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,s),o.exports}s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){"use strict";var e=e||{};window.WP_Smush=e,String.prototype.includes||(String.prototype.includes=function(e,t){return"number"!=typeof t&&(t=0),!(t+e.length>this.length)&&-1!==this.indexOf(e,t)}),s(3065),s(6111),s(9478),s(7413),s(3579),s(2140),s(1110),s(1442),s(5972),s(7447),s(4933),s(206)}()}();
2
  //# sourceMappingURL=smush-admin.min.js.map
app/assets/js/smush-admin.min.js.map CHANGED
@@ -1 +1 @@
1
-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QCpBfE,EAAoB71C,EAAI,SAAS21C,GACX,oBAAXM,QAA0BA,OAAOC,aAC1CrmC,OAAOsmC,eAAeR,EAASM,OAAOC,YAAa,CAAE9qC,MAAO,WAE7DyE,OAAOsmC,eAAeR,EAAS,aAAc,CAAEvqC,OAAO,K,wBCCvD,IAAMlG,EAAWA,GAAY,GAC7BnG,OAAOmG,SAAWA,EAYX+0B,OAAO/W,UAAU3M,WACvB0jB,OAAO/W,UAAU3M,SAAW,SAAUtX,EAAQgb,GAK7C,MAJsB,iBAAVA,IACXA,EAAQ,KAGJA,EAAQhb,EAAOH,OAAStB,KAAKsB,UAGQ,IAAnCtB,KAAK0B,QAASD,EAAQgb,KAI/Bm8B,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MAaTA,EAAS,K","sources":["webpack://wp-smushit/./_src/js/modules/admin-common.js","webpack://wp-smushit/./_src/js/modules/admin.js","webpack://wp-smushit/./_src/js/modules/bulk-restore.js","webpack://wp-smushit/./_src/js/modules/bulk-smush.js","webpack://wp-smushit/./_src/js/modules/directory-smush.js","webpack://wp-smushit/./_src/js/smush/directory-scanner.js","webpack://wp-smushit/./_src/js/modules/helpers.js","webpack://wp-smushit/./_src/js/modules/notice.js","webpack://wp-smushit/./_src/js/modules/onboarding.js","webpack://wp-smushit/./_src/js/smush/cdn.js","webpack://wp-smushit/./_src/js/smush/lazy-load.js","webpack://wp-smushit/./_src/js/smush/settings.js","webpack://wp-smushit/./_src/js/smush/smush.js","webpack://wp-smushit/./_src/js/smush/webp.js","webpack://wp-smushit/./node_modules/jquery.fancytree/dist/modules/jquery.fancytree.js","webpack://wp-smushit/./node_modules/jquery.fancytree/dist/modules/jquery.fancytree.ui-deps.js","webpack://wp-smushit/external var \"jQuery\"","webpack://wp-smushit/webpack/bootstrap","webpack://wp-smushit/webpack/runtime/make namespace object","webpack://wp-smushit/./_src/js/app.js"],"sourcesContent":["jQuery(function ($) {\n\t'use strict';\n\n /**\n\t * Handle the Smush Stats link click\n\t */\n $('body').on('click', 'a.smush-stats-details', function (e) {\n //If disabled\n if ($(this).prop('disabled')) {\n return false;\n }\n\n // prevent the default action\n e.preventDefault();\n //Replace the `+` with a `-`\n const slide_symbol = $(this).find('.stats-toggle');\n $(this).parents().eq(1).find('.smush-stats-wrapper').slideToggle();\n slide_symbol.text(slide_symbol.text() == '+' ? '-' : '+');\n });\n});","import Smush from '../smush/smush';\n\nconst remove_element = function (el, timeout) {\n\tif (typeof timeout === 'undefined') {\n\t\ttimeout = 100;\n\t}\n\tel.fadeTo(timeout, 0, function () {\n\t\tel.slideUp(timeout, function () {\n\t\t\tel.remove();\n\t\t});\n\t});\n};\n\njQuery(function ($) {\n\t'use strict';\n\n\t/**\n\t * Disable the action links *\n\t *\n\t * @param c_element\n\t */\n\tconst disable_links = function (c_element) {\n\t\tconst parent = c_element.parent();\n\t\t//reduce parent opacity\n\t\tparent.css({ opacity: '0.5' });\n\t\t//Disable Links\n\t\tparent.find('a').prop('disabled', true);\n\t};\n\n\t/**\n\t * Enable the Action Links *\n\t *\n\t * @param c_element\n\t */\n\tconst enable_links = function (c_element) {\n\t\tconst parent = c_element.parent();\n\n\t\t//reduce parent opacity\n\t\tparent.css({ opacity: '1' });\n\t\t//Disable Links\n\t\tparent.find('a').prop('disabled', false);\n\t};\n\n\t/**\n\t * Restore image request with a specified action for Media Library / NextGen Gallery\n\t *\n\t * @param {Object} e\n\t * @param {string} currentButton\n\t * @param {string} smushAction\n\t * @param {string} action\n\t */\n\tconst process_smush_action = function (\n\t\te,\n\t\tcurrentButton,\n\t\tsmushAction,\n\t\taction\n\t) {\n\t\t// If disabled.\n\t\tif (currentButton.prop('disabled')) {\n\t\t\treturn;\n\t\t}\n\n\t\te.preventDefault();\n\n\t\t// Remove Error.\n\t\t$('.wp-smush-error').remove();\n\n\t\t// Hide stats.\n\t\t$('.smush-stats-wrapper').hide();\n\n\t\tlet mode = 'grid';\n\t\tif ('smush_restore_image' === smushAction) {\n\t\t\tif ($(document).find('div.media-modal.wp-core-ui').length > 0) {\n\t\t\t\tmode = 'grid';\n\t\t\t} else {\n\t\t\t\tmode =\n\t\t\t\t\twindow.location.search.indexOf('item') > -1\n\t\t\t\t\t\t? 'grid'\n\t\t\t\t\t\t: 'list';\n\t\t\t}\n\t\t}\n\n\t\t// Get the image ID and nonce.\n\t\tconst params = {\n\t\t\taction: smushAction,\n\t\t\tattachment_id: currentButton.data('id'),\n\t\t\tmode,\n\t\t\t_nonce: currentButton.data('nonce'),\n\t\t};\n\n\t\t// Reduce the opacity of stats and disable the click.\n\t\tdisable_links(currentButton);\n\n\t\tcurrentButton.html(\n\t\t\t'<span class=\"spinner wp-smush-progress\">' +\n\t\t\t\twp_smush_msgs[action] +\n\t\t\t\t'</span>'\n\t\t);\n\n\t\t// Restore the image.\n\t\t$.post(ajaxurl, params, function (r) {\n\t\t\t// Reset all functionality.\n\t\t\tenable_links(currentButton);\n\n\t\t\tif (r.success && 'undefined' !== typeof r.data) {\n\t\t\t\t// Replace in immediate parent for NextGEN.\n\t\t\t\tif (\n\t\t\t\t\t'undefined' !== typeof this.data &&\n\t\t\t\t\tthis.data.indexOf('nextgen') > -1\n\t\t\t\t) {\n\t\t\t\t\t// Show the smush button, and remove stats and restore option.\n\t\t\t\t\tcurrentButton.parents().eq(1).html(r.data.stats);\n\t\t\t\t} else if ('restore' === action) {\n\t\t\t\t\t// Show the smush button, and remove stats and restore option.\n\t\t\t\t\tcurrentButton.parents().eq(1).html(r.data.stats);\n\t\t\t\t} else {\n\t\t\t\t\tcurrentButton.parents().eq(1).html(r.data);\n\t\t\t\t}\n\n\t\t\t\tif ('undefined' !== typeof r.data && 'restore' === action) {\n\t\t\t\t\tSmush.updateImageStats(r.data.new_size);\n\t\t\t\t}\n\t\t\t} else if (r.data && r.data.error_msg) {\n\t\t\t\tif (\n\t\t\t\t\t-1 === this.data.indexOf('nextgen') &&\n\t\t\t\t\t'restore' === action\n\t\t\t\t) {\n\t\t\t\t\t$('.smush-status').addClass('error').html(r.data.error_msg);\n\t\t\t\t} else {\n\t\t\t\t\t// Show error.\n\t\t\t\t\tcurrentButton.parent().append(r.data.error_msg);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t};\n\n\t/**\n\t * Validates the Resize Width and Height against the Largest Thumbnail Width and Height\n\t *\n\t * @param wrapper_div jQuery object for the whole setting row wrapper div\n\t * @param width_only Whether to validate only width\n\t * @param height_only Validate only Height\n\t * @return {boolean} All Good or not\n\t */\n\tconst validate_resize_settings = function (\n\t\twrapper_div,\n\t\twidth_only,\n\t\theight_only\n\t) {\n\t\tconst resize_checkbox = wrapper_div.find('#resize');\n\n\t\tif (!height_only) {\n\t\t\tvar width_input = wrapper_div.find('#wp-smush-resize_width');\n\t\t\tvar width_error_note = wrapper_div.find(\n\t\t\t\t'.sui-notice-info.wp-smush-update-width'\n\t\t\t);\n\t\t}\n\t\tif (!width_only) {\n\t\t\tvar height_input = wrapper_div.find('#wp-smush-resize_height');\n\t\t\tvar height_error_note = wrapper_div.find(\n\t\t\t\t'.sui-notice-info.wp-smush-update-height'\n\t\t\t);\n\t\t}\n\n\t\tlet width_error = false;\n\t\tlet height_error = false;\n\n\t\t//If resize settings is not enabled, return true\n\t\tif (!resize_checkbox.is(':checked')) {\n\t\t\treturn true;\n\t\t}\n\n\t\t//Check if we have localised width and height\n\t\tif (\n\t\t\t'undefined' === typeof wp_smushit_data.resize_sizes ||\n\t\t\t'undefined' === typeof wp_smushit_data.resize_sizes.width\n\t\t) {\n\t\t\t//Rely on server validation\n\t\t\treturn true;\n\t\t}\n\n\t\t//Check for width\n\t\tif (\n\t\t\t!height_only &&\n\t\t\t'undefined' !== typeof width_input &&\n\t\t\tparseInt(wp_smushit_data.resize_sizes.width) >\n\t\t\t\tparseInt(width_input.val())\n\t\t) {\n\t\t\twidth_input.parent().addClass('sui-form-field-error');\n\t\t\twidth_error_note.show('slow');\n\t\t\twidth_error = true;\n\t\t} else {\n\t\t\t//Remove error class\n\t\t\twidth_input.parent().removeClass('sui-form-field-error');\n\t\t\twidth_error_note.hide();\n\t\t\tif (height_input.hasClass('error')) {\n\t\t\t\theight_error_note.show('slow');\n\t\t\t}\n\t\t}\n\n\t\t//Check for height\n\t\tif (\n\t\t\t!width_only &&\n\t\t\t'undefined' !== typeof height_input &&\n\t\t\tparseInt(wp_smushit_data.resize_sizes.height) >\n\t\t\t\tparseInt(height_input.val())\n\t\t) {\n\t\t\theight_input.parent().addClass('sui-form-field-error');\n\t\t\t//If we are not showing the width error already\n\t\t\tif (!width_error) {\n\t\t\t\theight_error_note.show('slow');\n\t\t\t}\n\t\t\theight_error = true;\n\t\t} else {\n\t\t\t//Remove error class\n\t\t\theight_input.parent().removeClass('sui-form-field-error');\n\t\t\theight_error_note.hide();\n\t\t\tif (width_input.hasClass('error')) {\n\t\t\t\twidth_error_note.show('slow');\n\t\t\t}\n\t\t}\n\n\t\tif (width_error || height_error) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t};\n\n\t/**\n\t * Update the progress bar width if we have images that needs to be resmushed\n\t *\n\t * @param unsmushed_count\n\t * @return {boolean}\n\t */\n\tconst update_progress_bar_resmush = function (unsmushed_count) {\n\t\tif ('undefined' === typeof unsmushed_count) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst smushed_count = wp_smushit_data.count_total - unsmushed_count;\n\n\t\t//Update the Progress Bar Width\n\t\t// get the progress bar\n\t\tconst $progress_bar = jQuery(\n\t\t\t'.bulk-smush-wrapper .wp-smush-progress-inner'\n\t\t);\n\t\tif ($progress_bar.length < 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst width = (smushed_count / wp_smushit_data.count_total) * 100;\n\n\t\t// increase progress\n\t\t$progress_bar.css('width', width + '%');\n\t};\n\n\tconst runRecheck = function (process_settings) {\n\t\tconst button = $('.wp-smush-scan');\n\n\t\t// Add a \"loading\" state to the button.\n\t\tbutton.addClass('sui-button-onload');\n\n\t\t// Check if type is set in data attributes.\n\t\tlet scan_type = button.data('type');\n\t\tscan_type = 'undefined' === typeof scan_type ? 'media' : scan_type;\n\n\t\t// Remove the Skip resmush attribute from button.\n\t\t$('.wp-smush-all').removeAttr('data-smush');\n\n\t\t// Remove notices.\n\t\tconst notices = $('.sui-notice-top.sui-notice-success');\n\t\tnotices.slideUp(100, function () {\n\t\t\tnotices.remove();\n\t\t});\n\n\t\t// Disable Bulk smush button and itself.\n\t\t$('.wp-smush-all').prop('disabled', true);\n\n\t\t// Hide Settings changed Notice.\n\t\t$('.wp-smush-settings-changed').hide();\n\n\t\t// Ajax params.\n\t\tconst params = {\n\t\t\taction: 'scan_for_resmush',\n\t\t\ttype: scan_type,\n\t\t\tget_ui: true,\n\t\t\tprocess_settings,\n\t\t\twp_smush_options_nonce: jQuery('#wp_smush_options_nonce').val(),\n\t\t};\n\n\t\t// Send ajax request and get ids if any.\n\t\t$.get(ajaxurl, params, function (r) {\n\t\t\t// Check if we have the ids, initialize the local variable.\n\t\t\tif ('undefined' !== typeof r.data) {\n\t\t\t\t// Update Resmush id list.\n\t\t\t\tif ('undefined' !== typeof r.data.resmush_ids) {\n\t\t\t\t\twp_smushit_data.resmush = r.data.resmush_ids;\n\n\t\t\t\t\t// Update wp_smushit_data ( Smushed count, Smushed Percent, Image count, Super smush count, resize savings, conversion savings ).\n\t\t\t\t\tif ('undefined' !== typeof wp_smushit_data) {\n\t\t\t\t\t\twp_smushit_data.count_smushed =\n\t\t\t\t\t\t\t'undefined' !== typeof r.data.count_smushed\n\t\t\t\t\t\t\t\t? r.data.count_smushed\n\t\t\t\t\t\t\t\t: wp_smushit_data.count_smushed;\n\t\t\t\t\t\twp_smushit_data.count_supersmushed =\n\t\t\t\t\t\t\t'undefined' !== typeof r.data.count_supersmushed\n\t\t\t\t\t\t\t\t? r.data.count_supersmushed\n\t\t\t\t\t\t\t\t: wp_smushit_data.count_supersmushed;\n\t\t\t\t\t\twp_smushit_data.count_images =\n\t\t\t\t\t\t\t'undefined' !== typeof r.data.count_image\n\t\t\t\t\t\t\t\t? r.data.count_image\n\t\t\t\t\t\t\t\t: wp_smushit_data.count_images;\n\t\t\t\t\t\twp_smushit_data.size_before =\n\t\t\t\t\t\t\t'undefined' !== typeof r.data.size_before\n\t\t\t\t\t\t\t\t? r.data.size_before\n\t\t\t\t\t\t\t\t: wp_smushit_data.size_before;\n\t\t\t\t\t\twp_smushit_data.size_after =\n\t\t\t\t\t\t\t'undefined' !== typeof r.data.size_after\n\t\t\t\t\t\t\t\t? r.data.size_after\n\t\t\t\t\t\t\t\t: wp_smushit_data.size_after;\n\t\t\t\t\t\twp_smushit_data.savings_resize =\n\t\t\t\t\t\t\t'undefined' !== typeof r.data.savings_resize\n\t\t\t\t\t\t\t\t? r.data.savings_resize\n\t\t\t\t\t\t\t\t: wp_smushit_data.savings_resize;\n\t\t\t\t\t\twp_smushit_data.savings_conversion =\n\t\t\t\t\t\t\t'undefined' !== typeof r.data.savings_conversion\n\t\t\t\t\t\t\t\t? r.data.savings_conversion\n\t\t\t\t\t\t\t\t: wp_smushit_data.savings_conversion;\n\t\t\t\t\t\twp_smushit_data.count_resize =\n\t\t\t\t\t\t\t'undefined' !== typeof r.data.count_resize\n\t\t\t\t\t\t\t\t? r.data.count_resize\n\t\t\t\t\t\t\t\t: wp_smushit_data.count_resize;\n\t\t\t\t\t\twp_smushit_data.unsmushed =\n\t\t\t\t\t\t\t'undefined' !== typeof r.data.unsmushed\n\t\t\t\t\t\t\t\t? r.data.unsmushed\n\t\t\t\t\t\t\t\t: wp_smushit_data.unsmushed;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ('nextgen' === scan_type) {\n\t\t\t\t\t\twp_smushit_data.bytes =\n\t\t\t\t\t\t\tparseInt(wp_smushit_data.size_before) -\n\t\t\t\t\t\t\tparseInt(wp_smushit_data.size_after);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Hide the Existing wrapper.\n\t\t\t\t\tconst notices = $(\n\t\t\t\t\t\t'.bulk-smush-wrapper .sui-notice:not(.smush-upsell-notice)'\n\t\t\t\t\t);\n\t\t\t\t\tif (notices.length > 0) {\n\t\t\t\t\t\tnotices.addClass('sui-hidden');\n\t\t\t\t\t\t$('.wp-smush-pagespeed-recommendation').addClass(\n\t\t\t\t\t\t\t'sui-hidden'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t// Remove existing Re-Smush notices.\n\t\t\t\t\t$('.wp-smush-resmush-notice').remove();\n\n\t\t\t\t\t// Show Bulk wrapper.\n\t\t\t\t\t$('.wp-smush-bulk-wrapper').removeClass('sui-hidden');\n\t\t\t\t}\n\t\t\t\t// If content is received, Prepend it.\n\t\t\t\tif ('undefined' !== typeof r.data.content) {\n\t\t\t\t\t$('#wp-smush-bulk-content').html(r.data.content);\n\t\t\t\t}\n\t\t\t\t// If we have any notice to show.\n\t\t\t\tif ('undefined' !== typeof r.data.notice) {\n\t\t\t\t\tlet type = 'success';\n\t\t\t\t\tif ('undefined' !== typeof r.data.noticeType) {\n\t\t\t\t\t\ttype = r.data.noticeType;\n\t\t\t\t\t}\n\t\t\t\t\twindow.SUI.openNotice(\n\t\t\t\t\t\t'wp-smush-ajax-notice',\n\t\t\t\t\t\t'<p>' + r.data.notice + '</p>',\n\t\t\t\t\t\t{ type, icon: 'check-tick' }\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// Hide errors.\n\t\t\t\t$('div.smush-final-log').hide();\n\n\t\t\t\t// Hide Super Smush notice if it's enabled in media settings.\n\t\t\t\tif (\n\t\t\t\t\t'undefined' !== typeof r.data.super_smush &&\n\t\t\t\t\tr.data.super_smush &&\n\t\t\t\t\t'undefined' !== r.data.super_smush_stat\n\t\t\t\t) {\n\t\t\t\t\t$('.super-smush-attachments .wp-smush-stats').html(\n\t\t\t\t\t\tr.data.super_smush_stats\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tSmush.updateStats(scan_type);\n\n\t\t\t\tconst remainingCount = r.data.count || 0;\n\t\t\t\tSmush.updateRemainingCount(remainingCount);\n\t\t\t\tupdateDisplayedContentAfterReCheck(remainingCount);\n\t\t\t}\n\t\t}).always(function () {\n\t\t\t// Hide the progress bar.\n\t\t\tjQuery(\n\t\t\t\t'.bulk-smush-wrapper .wp-smush-bulk-progress-bar-wrapper'\n\t\t\t).addClass('sui-hidden');\n\n\t\t\t// Add check complete status to button.\n\t\t\tbutton\n\t\t\t\t.removeClass('sui-button-onload')\n\t\t\t\t.addClass('smush-button-check-success');\n\n\t\t\tconst $defaultText = button.find('.wp-smush-default-text'),\n\t\t\t\t$completedText = button.find('.wp-smush-completed-text');\n\n\t\t\t$defaultText.addClass('sui-hidden-important');\n\t\t\t$completedText.removeClass('sui-hidden');\n\n\t\t\t// Remove success message from button.\n\t\t\tsetTimeout(function () {\n\t\t\t\tbutton.removeClass('smush-button-check-success');\n\n\t\t\t\t$defaultText.removeClass('sui-hidden-important');\n\t\t\t\t$completedText.addClass('sui-hidden');\n\t\t\t}, 2000);\n\n\t\t\t$('.wp-smush-all').prop('disabled', false);\n\t\t});\n\t};\n\n\tconst updateDisplayedContentAfterReCheck = function (count) {\n\t\tconst $pendingImagesWrappers = jQuery(\n\t\t\t'.bulk-smush-wrapper .wp-smush-bulk-wrapper, #wp-smush-pending-to-smush-text'\n\t\t);\n\t\tconst $allDoneWrappers = jQuery(\n\t\t\t'.bulk-smush-wrapper .wp-smush-all-done, .bulk-smush-wrapper .wp-smush-pagespeed-recommendation, #smush-box-bulk-upgrade, #wp-smush-all-smushed-text'\n\t\t);\n\n\t\tif ($pendingImagesWrappers.length && $allDoneWrappers.length) {\n\t\t\tif (count === 0) {\n\t\t\t\t$pendingImagesWrappers.addClass('sui-hidden');\n\t\t\t\t$allDoneWrappers.removeClass('sui-hidden');\n\t\t\t} else {\n\t\t\t\t$pendingImagesWrappers.removeClass('sui-hidden');\n\t\t\t\t$allDoneWrappers.addClass('sui-hidden');\n\n\t\t\t\t// Update texts mentioning the amount of unsmushed imagesin the summary icon tooltip.\n\t\t\t\tconst $unsmushedTooltip = jQuery(\n\t\t\t\t\t'.sui-summary-smush .sui-summary-details .sui-tooltip'\n\t\t\t\t);\n\n\t\t\t\t// The tooltip doesn't exist in the NextGen page.\n\t\t\t\tif ($unsmushedTooltip.length) {\n\t\t\t\t\tconst textForm = 1 === count ? 'singular' : 'plural',\n\t\t\t\t\t\ttooltipText = $unsmushedTooltip\n\t\t\t\t\t\t\t.data(textForm)\n\t\t\t\t\t\t\t.replace('{count}', count);\n\t\t\t\t\t$unsmushedTooltip.attr('data-tooltip', tooltipText);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Total count in the progress bar.\n\t\tjQuery('.wp-smush-total-count').text(count);\n\t};\n\n\t// Scroll the element to top of the page.\n\tconst goToByScroll = function (selector) {\n\t\t// Scroll if element found.\n\t\tif ($(selector).length > 0) {\n\t\t\t$('html, body').animate(\n\t\t\t\t{\n\t\t\t\t\tscrollTop: $(selector).offset().top - 100,\n\t\t\t\t},\n\t\t\t\t'slow'\n\t\t\t);\n\t\t}\n\t};\n\n\tconst update_cummulative_stats = function (stats) {\n\t\t//Update Directory Smush Stats\n\t\tif ('undefined' !== typeof stats.dir_smush) {\n\t\t\tconst stats_human = $(\n\t\t\t\t'li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-human'\n\t\t\t);\n\t\t\tconst stats_percent = $(\n\t\t\t\t'li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-percent'\n\t\t\t);\n\n\t\t\t// Do not replace if 0 savings.\n\t\t\tif (stats.dir_smush.bytes > 0) {\n\t\t\t\t$('.wp-smush-dir-link').addClass('sui-hidden');\n\n\t\t\t\t// Hide selector.\n\t\t\t\t$('li.smush-dir-savings .wp-smush-stats-label-message').hide();\n\t\t\t\t//Update Savings in bytes\n\t\t\t\tif (stats_human.length > 0) {\n\t\t\t\t\tstats_human.html(stats.dir_smush.human);\n\t\t\t\t} else {\n\t\t\t\t\tvar span =\n\t\t\t\t\t\t'<span class=\"wp-smush-stats-human\">' +\n\t\t\t\t\t\tstats.dir_smush.bytes +\n\t\t\t\t\t\t'</span>';\n\t\t\t\t}\n\n\t\t\t\t//Percentage section\n\t\t\t\tif (stats.dir_smush.percent > 0) {\n\t\t\t\t\t// Show size and percentage separator.\n\t\t\t\t\t$(\n\t\t\t\t\t\t'li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-sep'\n\t\t\t\t\t).removeClass('sui-hidden');\n\t\t\t\t\t//Update Optimisation percentage\n\t\t\t\t\tif (stats_percent.length > 0) {\n\t\t\t\t\t\tstats_percent.html(stats.dir_smush.percent + '%');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar span =\n\t\t\t\t\t\t\t'<span class=\"wp-smush-stats-percent\">' +\n\t\t\t\t\t\t\tstats.dir_smush.percent +\n\t\t\t\t\t\t\t'%' +\n\t\t\t\t\t\t\t'</span>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$('.wp-smush-dir-link').removeClass('sui-hidden');\n\t\t\t}\n\t\t}\n\n\t\t//Update Combined stats\n\t\tif (\n\t\t\t'undefined' !== typeof stats.combined_stats &&\n\t\t\tstats.combined_stats.length > 0\n\t\t) {\n\t\t\tconst c_stats = stats.combined_stats;\n\n\t\t\tlet smush_percent = (c_stats.smushed / c_stats.total_count) * 100;\n\t\t\tsmush_percent = WP_Smush.helpers.precise_round(smush_percent, 1);\n\n\t\t\t//Smushed Percent\n\t\t\tif (smush_percent) {\n\t\t\t\t$('div.wp-smush-count-total span.wp-smush-images-percent').html(\n\t\t\t\t\tsmush_percent\n\t\t\t\t);\n\t\t\t}\n\t\t\t//Update Total Attachment Count\n\t\t\tif (c_stats.total_count) {\n\t\t\t\t$(\n\t\t\t\t\t'span.wp-smush-count-total span.wp-smush-total-optimised'\n\t\t\t\t).html(c_stats.total_count);\n\t\t\t}\n\t\t\t//Update Savings and Percent\n\t\t\tif (c_stats.savings) {\n\t\t\t\t$('span.wp-smush-savings span.wp-smush-stats-human').html(\n\t\t\t\t\tc_stats.savings\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (c_stats.percent) {\n\t\t\t\t$('span.wp-smush-savings span.wp-smush-stats-percent').html(\n\t\t\t\t\tc_stats.percent\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * When 'All' is selected for the Image Sizes setting, select all available sizes.\n\t *\n\t * @since 3.2.1\n\t */\n\t$('#all-image-sizes').on('change', function () {\n\t\t$('input[name^=\"wp-smush-image_sizes\"]').prop('checked', true);\n\t});\n\n\t/**\n\t * Handles the tabs navigation on mobile.\n\t *\n\t * @since 3.8.4\n\t */\n\t$('.sui-mobile-nav').on('change', (e) => {\n\t\twindow.location.assign($(e.currentTarget).val());\n\t});\n\n\t/**\n\t * Handle re-check api status button click (Settings)\n\t *\n\t * @since 3.2.0.2\n\t */\n\t$('#update-api-status').on('click', function (e) {\n\t\te.preventDefault();\n\n\t\t//$(this).prop('disabled', true);\n\t\t$(this).addClass('sui-button-onload');\n\n\t\t$.post(ajaxurl, { action: 'recheck_api_status' }, function () {\n\t\t\tlocation.reload();\n\t\t});\n\t});\n\n\t/** Handle smush button click **/\n\t$('body').on(\n\t\t'click',\n\t\t'.wp-smush-send:not(.wp-smush-resmush)',\n\t\tfunction (e) {\n\t\t\t// prevent the default action\n\t\t\te.preventDefault();\n\t\t\tnew Smush($(this), false);\n\t\t}\n\t);\n\n\t/** Handle show in bulk smush button click **/\n\t$('body').on('click', '.wp-smush-remove-skipped', function (e) {\n\t\te.preventDefault();\n\n\t\tconst self = $(this);\n\n\t\t// Send Ajax request to remove the image from the skip list.\n\t\t$.post(ajaxurl, {\n\t\t\taction: 'remove_from_skip_list',\n\t\t\tid: self.attr('data-id'),\n\t\t}).done((response) => {\n\t\t\tif (\n\t\t\t\tresponse.success &&\n\t\t\t\t'undefined' !== typeof response.data.links\n\t\t\t) {\n\t\t\t\tself.parent()\n\t\t\t\t\t.parent()\n\t\t\t\t\t.find('.smush-status')\n\t\t\t\t\t.text(wp_smush_msgs.not_processed);\n\t\t\t\te.target.closest('.smush-status-links').innerHTML =\n\t\t\t\t\tresponse.data.links;\n\t\t\t}\n\t\t});\n\t});\n\n\t/** Handle NextGen Gallery smush button click **/\n\t$('body').on('click', '.wp-smush-nextgen-send', function (e) {\n\t\t// prevent the default action\n\t\te.preventDefault();\n\t\tnew Smush($(this), false, 'nextgen');\n\t});\n\n\t/** Handle NextGen Gallery Bulk smush button click **/\n\t$('body').on('click', '.wp-smush-nextgen-bulk', function (e) {\n\t\t// prevent the default action\n\t\te.preventDefault();\n\n\t\t// Remove existing Re-Smush notices.\n\t\t$('.wp-smush-resmush-notice').remove();\n\n\t\t//Check for ids, if there is none (Unsmushed or lossless), don't call smush function\n\t\tif (\n\t\t\t'undefined' === typeof wp_smushit_data ||\n\t\t\t(wp_smushit_data.unsmushed.length === 0 &&\n\t\t\t\twp_smushit_data.resmush.length === 0)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tjQuery('.wp-smush-all, .wp-smush-scan').prop('disabled', true);\n\t\t$('.wp-smush-notice.wp-smush-remaining').hide();\n\t\tnew Smush($(this), true, 'nextgen');\n\t});\n\n\t/** Restore: Media Library **/\n\t$('body').on('click', '.wp-smush-action.wp-smush-restore', function (e) {\n\t\tconst current_button = $(this);\n\t\tprocess_smush_action(\n\t\t\te,\n\t\t\tcurrent_button,\n\t\t\t'smush_restore_image',\n\t\t\t'restore'\n\t\t);\n\t});\n\n\t/** Resmush: Media Library **/\n\t$('body').on('click', '.wp-smush-action.wp-smush-resmush', function (e) {\n\t\tprocess_smush_action(e, $(this), 'smush_resmush_image', 'smushing');\n\t});\n\n\t/** Restore: NextGen Gallery **/\n\t$('body').on(\n\t\t'click',\n\t\t'.wp-smush-action.wp-smush-nextgen-restore',\n\t\tfunction (e) {\n\t\t\tprocess_smush_action(\n\t\t\t\te,\n\t\t\t\t$(this),\n\t\t\t\t'smush_restore_nextgen_image',\n\t\t\t\t'restore'\n\t\t\t);\n\t\t}\n\t);\n\n\t/** Resmush: NextGen Gallery **/\n\t$('body').on(\n\t\t'click',\n\t\t'.wp-smush-action.wp-smush-nextgen-resmush',\n\t\tfunction (e) {\n\t\t\tprocess_smush_action(\n\t\t\t\te,\n\t\t\t\t$(this),\n\t\t\t\t'smush_resmush_nextgen_image',\n\t\t\t\t'smushing'\n\t\t\t);\n\t\t}\n\t);\n\n\t//Scan For resmushing images\n\t$('.wp-smush-scan').on('click', function (e) {\n\t\te.preventDefault();\n\t\trunRecheck(false);\n\t});\n\n\t//Dismiss Welcome notice\n\t//@todo: Use it for popup\n\t$('#wp-smush-welcome-box .smush-dismiss-welcome').on('click', function (e) {\n\t\te.preventDefault();\n\t\tconst $el = $(this).parents().eq(1);\n\t\tremove_element($el);\n\n\t\t//Send a ajax request to save the dismissed notice option\n\t\tconst param = {\n\t\t\taction: 'dismiss_welcome_notice',\n\t\t};\n\t\t$.post(ajaxurl, param);\n\t});\n\n\t//Remove Notice\n\t$('body').on('click', '.wp-smush-notice .icon-fi-close', function (e) {\n\t\te.preventDefault();\n\t\tconst $el = $(this).parent();\n\t\tremove_element($el);\n\t});\n\n\t// On re-Smush click.\n\t$('body').on('click', '.wp-smush-skip-resmush', function (e) {\n\t\te.preventDefault();\n\n\t\tconst self = jQuery(this),\n\t\t\tcontainer = self.parents().eq(1),\n\t\t\tel = self.parent();\n\n\t\t// Remove Parent div.\n\t\tremove_element(el);\n\n\t\t// Remove Settings Notice.\n\t\t$('.sui-notice-top.sui-notice-success').remove();\n\n\t\t// Set button attribute to skip re-smush ids.\n\t\tcontainer.find('.wp-smush-all').attr('data-smush', 'skip_resmush');\n\n\t\t// Update Smushed count.\n\t\twp_smushit_data.count_smushed =\n\t\t\tparseInt(wp_smushit_data.count_smushed) +\n\t\t\twp_smushit_data.resmush.length;\n\t\twp_smushit_data.count_supersmushed =\n\t\t\tparseInt(wp_smushit_data.count_supersmushed) +\n\t\t\twp_smushit_data.resmush.length;\n\n\t\t// Update stats.\n\t\tif (wp_smushit_data.count_smushed === wp_smushit_data.count_total) {\n\t\t\t// Show all done notice.\n\t\t\t$(\n\t\t\t\t'.wp-smush-notice.wp-smush-all-done, .wp-smush-pagespeed-recommendation'\n\t\t\t).removeClass('sui-hidden');\n\n\t\t\t// Hide Smush button.\n\t\t\t$('.wp-smush-bulk-wrapper ').addClass('sui-hidden');\n\t\t}\n\n\t\t// Remove re-Smush notice.\n\t\t$('.wp-smush-resmush-notice').remove();\n\n\t\tlet type = $('.wp-smush-scan').data('type');\n\t\ttype = 'undefined' === typeof type ? 'media' : type;\n\n\t\tconst smushed_count =\n\t\t\t'undefined' !== typeof wp_smushit_data.count_smushed\n\t\t\t\t? wp_smushit_data.count_smushed\n\t\t\t\t: 0;\n\n\t\tlet smush_percent = (smushed_count / wp_smushit_data.count_total) * 100;\n\t\tsmush_percent = WP_Smush.helpers.precise_round(smush_percent, 1);\n\n\t\t$('.wp-smush-images-percent').html(smush_percent);\n\n\t\t// Update the progress bar width. Get the progress bar.\n\t\tconst progress_bar = jQuery(\n\t\t\t'.bulk-smush-wrapper .wp-smush-progress-inner'\n\t\t);\n\t\tif (progress_bar.length < 1) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Increase progress.\n\t\tprogress_bar.css('width', smush_percent + '%');\n\n\t\t// Show the default bulk smush notice.\n\t\t$('.wp-smush-bulk-wrapper').removeClass('sui-hidden');\n\t\t$('.wp-smush-bulk-wrapper .sui-notice').removeClass('sui-hidden');\n\n\t\tconst params = {\n\t\t\taction: 'delete_resmush_list',\n\t\t\ttype,\n\t\t};\n\n\t\t//Delete resmush list, @todo: update stats from the ajax response\n\t\t$.post(ajaxurl, params, function (res) {\n\t\t\t// Remove the whole li element on success\n\t\t\tif (res.success && 'undefined' !== typeof res.data.stats) {\n\t\t\t\tconst stats = res.data.stats;\n\t\t\t\t// Update wp_smushit_data ( Smushed count, Smushed Percent, Image count, Super smush count, resize savings, conversion savings )\n\t\t\t\tif ('undefined' !== typeof wp_smushit_data) {\n\t\t\t\t\twp_smushit_data.count_images =\n\t\t\t\t\t\t'undefined' !== typeof stats.count_images\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.count_images) +\n\t\t\t\t\t\t\t stats.count_images\n\t\t\t\t\t\t\t: wp_smushit_data.count_images;\n\t\t\t\t\twp_smushit_data.size_before =\n\t\t\t\t\t\t'undefined' !== typeof stats.size_before\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.size_before) +\n\t\t\t\t\t\t\t stats.size_before\n\t\t\t\t\t\t\t: wp_smushit_data.size_before;\n\t\t\t\t\twp_smushit_data.size_after =\n\t\t\t\t\t\t'undefined' !== typeof stats.size_after\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.size_after) +\n\t\t\t\t\t\t\t stats.size_after\n\t\t\t\t\t\t\t: wp_smushit_data.size_after;\n\t\t\t\t\twp_smushit_data.savings_resize =\n\t\t\t\t\t\t'undefined' !== typeof stats.savings_resize\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.savings_resize) +\n\t\t\t\t\t\t\t stats.savings_resize\n\t\t\t\t\t\t\t: wp_smushit_data.savings_resize;\n\t\t\t\t\twp_smushit_data.savings_conversion =\n\t\t\t\t\t\t'undefined' !== typeof stats.savings_conversion\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.savings_conversion) +\n\t\t\t\t\t\t\t stats.savings_conversion\n\t\t\t\t\t\t\t: wp_smushit_data.savings_conversion;\n\n\t\t\t\t\t// Add directory smush stats.\n\t\t\t\t\tif (\n\t\t\t\t\t\t'undefined' !==\n\t\t\t\t\t\t\ttypeof wp_smushit_data.savings_dir_smush &&\n\t\t\t\t\t\t'undefined' !==\n\t\t\t\t\t\t\ttypeof wp_smushit_data.savings_dir_smush.orig_size\n\t\t\t\t\t) {\n\t\t\t\t\t\twp_smushit_data.size_before =\n\t\t\t\t\t\t\t'undefined' !==\n\t\t\t\t\t\t\ttypeof wp_smushit_data.savings_dir_smush\n\t\t\t\t\t\t\t\t? parseInt(wp_smushit_data.size_before) +\n\t\t\t\t\t\t\t\t parseInt(\n\t\t\t\t\t\t\t\t\t\twp_smushit_data.savings_dir_smush\n\t\t\t\t\t\t\t\t\t\t\t.orig_size\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: wp_smushit_data.size_before;\n\t\t\t\t\t\twp_smushit_data.size_after =\n\t\t\t\t\t\t\t'undefined' !==\n\t\t\t\t\t\t\ttypeof wp_smushit_data.savings_dir_smush\n\t\t\t\t\t\t\t\t? parseInt(wp_smushit_data.size_after) +\n\t\t\t\t\t\t\t\t parseInt(\n\t\t\t\t\t\t\t\t\t\twp_smushit_data.savings_dir_smush\n\t\t\t\t\t\t\t\t\t\t\t.image_size\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: wp_smushit_data.size_after;\n\t\t\t\t\t}\n\n\t\t\t\t\twp_smushit_data.count_resize =\n\t\t\t\t\t\t'undefined' !== typeof stats.count_resize\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.count_resize) +\n\t\t\t\t\t\t\t stats.count_resize\n\t\t\t\t\t\t\t: wp_smushit_data.count_resize;\n\t\t\t\t}\n\t\t\t\t// Smush notice.\n\t\t\t\tconst remainingCountDiv = $(\n\t\t\t\t\t'.bulk-smush-wrapper .wp-smush-remaining-count'\n\t\t\t\t);\n\t\t\t\tif (\n\t\t\t\t\tremainingCountDiv.length &&\n\t\t\t\t\t'undefined' !== typeof wp_smushit_data.unsmushed\n\t\t\t\t) {\n\t\t\t\t\tremainingCountDiv.html(wp_smushit_data.unsmushed.length);\n\t\t\t\t}\n\n\t\t\t\t// If no images left, hide the notice, show all success notice.\n\t\t\t\tif (\n\t\t\t\t\t'undefined' !== typeof wp_smushit_data.unsmushed ||\n\t\t\t\t\twp_smushit_data.unsmushed.length === 0\n\t\t\t\t) {\n\t\t\t\t\t$('.wp-smush-bulk-wrapper .sui-notice').removeClass(\n\t\t\t\t\t\t'sui-hidden'\n\t\t\t\t\t);\n\t\t\t\t\t$('.sui-notice-success.wp-smush-all-done').addClass(\n\t\t\t\t\t\t'sui-hidden'\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tSmush.updateStats();\n\t\t\t}\n\t\t});\n\t});\n\n\t// Enable super smush on clicking link from stats area.\n\t$('a.wp-smush-lossy-enable').on('click', function (e) {\n\t\te.preventDefault();\n\t\t// Scroll down to settings area.\n\t\tgoToByScroll('#column-lossy');\n\t});\n\n\t// Enable resize on clicking link from stats area.\n\t$('.wp-smush-resize-enable').on('click', function (e) {\n\t\te.preventDefault();\n\t\t// Scroll down to settings area.\n\t\tgoToByScroll('#column-resize');\n\t});\n\n\t// If settings string is found in url, enable and scroll.\n\tif ( window.location.hash ) {\n\t\tconst setting_hash = window.location.hash.substring( 1 );\n\t\tlet scrollTo = '';\n\n\t\tswitch ( setting_hash ) {\n\t\t\tcase 'enable-resize':\n\t\t\t\tscrollTo = '#column-resize';\n\t\t\t\tbreak;\n\n\t\t\tcase 'backup-label':\n\t\t\t\tscrollTo = '#backup';\n\t\t\t\tbreak;\n\n\t\t\tcase 'original-label':\n\t\t\t\tscrollTo = '#original';\n\t\t\t\tbreak;\n\n\t\t\tcase 'enable-lossy':\n\t\t\t\tscrollTo = '#column-lossy';\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( '' !== scrollTo ) {\n\t\t\tgoToByScroll( scrollTo );\n\t\t\tdocument.getElementById( scrollTo.replace( '#', '' ) ).focus();\n\t\t}\n\t}\n\n\t//Trigger Bulk\n\t$('body').on('click', '.wp-smush-trigger-bulk', function (e) {\n\t\te.preventDefault();\n\n\t\t//Induce Setting button save click\n\t\tif (\n\t\t\t'undefined' !== typeof e.target.dataset.type &&\n\t\t\t'nextgen' === e.target.dataset.type\n\t\t) {\n\t\t\t$('.wp-smush-nextgen-bulk').trigger('click');\n\t\t} else {\n\t\t\t$('.wp-smush-all').trigger('click');\n\t\t}\n\n\t\t$('span.sui-notice-dismiss').trigger('click');\n\t});\n\n\t//Trigger Bulk\n\t$('body').on('click', '#bulk-smush-top-notice-close', function (e) {\n\t\te.preventDefault();\n\t\t$(this).parent().parent().slideUp('slow');\n\t});\n\n\t//Allow the checkboxes to be Keyboard Accessible\n\t$('.wp-smush-setting-row .toggle-checkbox').on('focus', function () {\n\t\t//If Space is pressed\n\t\t$(this).keypress(function (e) {\n\t\t\tif (e.keyCode == 32) {\n\t\t\t\te.preventDefault();\n\t\t\t\t$(this).find('.toggle-checkbox').trigger('click');\n\t\t\t}\n\t\t});\n\t});\n\n\t// Re-Validate Resize Width And Height.\n\t$('body').on('blur', '.wp-smush-resize-input', function () {\n\t\tconst self = $(this);\n\n\t\tconst wrapper_div = self.parents().eq(4);\n\n\t\t// Initiate the check.\n\t\tvalidate_resize_settings(wrapper_div, false, false); // run the validation.\n\t});\n\n\t// Handle Resize Checkbox toggle, to show/hide width, height settings.\n\t$('body').on('click', '#resize', function () {\n\t\tconst self = $(this);\n\t\tconst settings_wrap = $('#smush-resize-settings-wrap');\n\n\t\tif (self.is(':checked')) {\n\t\t\tsettings_wrap.show();\n\t\t} else {\n\t\t\tsettings_wrap.hide();\n\t\t}\n\t});\n\n\t//Handle Re-check button functionality\n\t$('#wp-smush-revalidate-member').on('click', function (e) {\n\t\te.preventDefault();\n\t\t//Ajax Params\n\t\tconst params = {\n\t\t\taction: 'smush_show_warning',\n\t\t};\n\t\tconst link = $(this);\n\t\tconst parent = link.parents().eq(1);\n\t\tparent.addClass('loading-notice');\n\t\t$.get(ajaxurl, params, function (r) {\n\t\t\t//remove the warning\n\t\t\tparent.removeClass('loading-notice').addClass('loaded-notice');\n\t\t\tif (0 == r) {\n\t\t\t\tparent.attr('data-message', wp_smush_msgs.membership_valid);\n\t\t\t\tremove_element(parent, 1000);\n\t\t\t} else {\n\t\t\t\tparent.attr('data-message', wp_smush_msgs.membership_invalid);\n\t\t\t\tsetTimeout(function remove_loader() {\n\t\t\t\t\tparent.removeClass('loaded-notice');\n\t\t\t\t}, 1000);\n\t\t\t}\n\t\t});\n\t});\n\n\tif ($('li.smush-dir-savings').length > 0) {\n\t\t// Update Directory Smush, as soon as the page loads.\n\t\tconst stats_param = {\n\t\t\taction: 'get_dir_smush_stats',\n\t\t};\n\t\t$.get(ajaxurl, stats_param, function (r) {\n\t\t\t//Hide the spinner\n\t\t\t$('li.smush-dir-savings .sui-icon-loader').hide();\n\n\t\t\t//If there are no errors, and we have a message to display\n\t\t\tif (!r.success && 'undefined' !== typeof r.data.message) {\n\t\t\t\t$('div.wp-smush-scan-result div.content').prepend(\n\t\t\t\t\tr.data.message\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//If there is no value in r\n\t\t\tif (\n\t\t\t\t'undefined' === typeof r.data ||\n\t\t\t\t'undefined' === typeof r.data.dir_smush\n\t\t\t) {\n\t\t\t\t//Append the text\n\t\t\t\t$('li.smush-dir-savings span.wp-smush-stats').append(\n\t\t\t\t\twp_smush_msgs.ajax_error\n\t\t\t\t);\n\t\t\t\t$('li.smush-dir-savings span.wp-smush-stats span').hide();\n\t\t\t} else {\n\t\t\t\t//Update the stats\n\t\t\t\tupdate_cummulative_stats(r.data);\n\t\t\t}\n\t\t});\n\t}\n\n\t//Dismiss Smush recommendation\n\t$('span.dismiss-recommendation').on('click', function (e) {\n\t\te.preventDefault();\n\t\tconst parent = $(this).parent();\n\t\t//remove div and save preference in db\n\t\tparent.hide('slow', function () {\n\t\t\tparent.remove();\n\t\t});\n\t\t$.ajax({\n\t\t\ttype: 'POST',\n\t\t\turl: ajaxurl,\n\t\t\tdata: {\n\t\t\t\taction: 'hide_pagespeed_suggestion',\n\t\t\t},\n\t\t});\n\t});\n\n\t// Display dialogs that show up with no user action.\n\tif ($('#smush-updated-dialog').length) {\n\t\t// Displays the modal with the release's higlights if it exists.\n\t\twindow.SUI.openModal(\n\t\t\t'smush-updated-dialog',\n\t\t\t'wpbody-content',\n\t\t\tundefined,\n\t\t\tfalse\n\t\t);\n\t}\n\n\t/**\n\t * Toggle backup notice based on \"Compress uploaded images\" setting.\n\t * @since 3.9.1\n\t */\n\t$( 'input#original' ).on( 'change', function() {\n\t\t$( '#backup-notice' ).toggleClass( 'sui-hidden', $( this ).is(':checked') );\n\t} );\n});\n","/* global WP_Smush */\n/* global ajaxurl */\n/* global _ */\n\n/**\n * Bulk restore JavaScript code.\n *\n * @since 3.2.2\n */\n(function () {\n\t'use strict';\n\n\t/**\n\t * Bulk restore modal.\n\t *\n\t * @since 3.2.2\n\t */\n\tWP_Smush.restore = {\n\t\tmodal: document.getElementById('smush-restore-images-dialog'),\n\t\tcontentContainer: document.getElementById('smush-bulk-restore-content'),\n\t\tsettings: {\n\t\t\tslide: 'start', // start, progress or finish.\n\t\t\tsuccess: 0,\n\t\t\terrors: [],\n\t\t},\n\t\titems: [], // total items, 1 item = 1 step.\n\t\tsuccess: [], // successful items restored.\n\t\terrors: [], // failed items.\n\t\tcurrentStep: 0,\n\t\ttotalSteps: 0,\n\n\t\t/**\n\t\t * Init module.\n\t\t */\n\t\tinit() {\n\t\t\tif (!this.modal) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.settings = {\n\t\t\t\tslide: 'start',\n\t\t\t\tsuccess: 0,\n\t\t\t\terrors: [],\n\t\t\t};\n\n\t\t\tthis.resetModalWidth();\n\t\t\tthis.renderTemplate();\n\n\t\t\t// Show the modal.\n\n\t\t\twindow.SUI.openModal(\n\t\t\t\t'smush-restore-images-dialog',\n\t\t\t\t'wpbody-content',\n\t\t\t\tundefined,\n\t\t\t\tfalse\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update the template, register new listeners.\n\t\t */\n\t\trenderTemplate() {\n\t\t\tconst template = WP_Smush.onboarding.template('smush-bulk-restore');\n\t\t\tconst content = template(this.settings);\n\n\t\t\tif (content) {\n\t\t\t\tthis.contentContainer.innerHTML = content;\n\t\t\t}\n\n\t\t\tthis.bindSubmit();\n\t\t},\n\n\t\t/**\n\t\t * Reset modal width.\n\t\t *\n\t\t * @since 3.6.0\n\t\t */\n\t\tresetModalWidth() {\n\t\t\tthis.modal.style.maxWidth = '460px';\n\t\t\tthis.modal.querySelector('.sui-box').style.maxWidth = '460px';\n\t\t},\n\n\t\t/**\n\t\t * Catch \"Finish setup wizard\" button click.\n\t\t */\n\t\tbindSubmit() {\n\t\t\tconst confirmButton = this.modal.querySelector(\n\t\t\t\t'button[id=\"smush-bulk-restore-button\"]'\n\t\t\t);\n\t\t\tconst self = this;\n\n\t\t\tif (confirmButton) {\n\t\t\t\tconfirmButton.addEventListener('click', function (e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tself.resetModalWidth();\n\n\t\t\t\t\tself.settings = { slide: 'progress' };\n\t\t\t\t\tself.errors = [];\n\n\t\t\t\t\tself.renderTemplate();\n\t\t\t\t\tself.initScan();\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Cancel the bulk restore.\n\t\t */\n\t\tcancel() {\n\t\t\tif (\n\t\t\t\t'start' === this.settings.slide ||\n\t\t\t\t'finish' === this.settings.slide\n\t\t\t) {\n\t\t\t\t// Hide the modal.\n\t\t\t\twindow.SUI.closeModal();\n\t\t\t} else {\n\t\t\t\tthis.updateProgressBar(true);\n\t\t\t\twindow.location.reload();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Update progress bar during directory smush.\n\t\t *\n\t\t * @param {boolean} cancel Cancel status.\n\t\t */\n\t\tupdateProgressBar(cancel = false) {\n\t\t\tlet progress = 0;\n\t\t\tif (0 < this.currentStep) {\n\t\t\t\tprogress = Math.min(\n\t\t\t\t\tMath.round((this.currentStep * 100) / this.totalSteps),\n\t\t\t\t\t99\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (progress > 100) {\n\t\t\t\tprogress = 100;\n\t\t\t}\n\n\t\t\t// Update progress bar\n\t\t\tthis.modal.querySelector('.sui-progress-text span').innerHTML =\n\t\t\t\tprogress + '%';\n\t\t\tthis.modal.querySelector('.sui-progress-bar span').style.width =\n\t\t\t\tprogress + '%';\n\n\t\t\tconst statusDiv = this.modal.querySelector(\n\t\t\t\t'.sui-progress-state-text'\n\t\t\t);\n\t\t\tif (progress >= 90) {\n\t\t\t\tstatusDiv.innerHTML = 'Finalizing...';\n\t\t\t} else if (cancel) {\n\t\t\t\tstatusDiv.innerHTML = 'Cancelling...';\n\t\t\t} else {\n\t\t\t\tstatusDiv.innerHTML =\n\t\t\t\t\tthis.currentStep +\n\t\t\t\t\t'/' +\n\t\t\t\t\tthis.totalSteps +\n\t\t\t\t\t' ' +\n\t\t\t\t\t'images restored';\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * First step in bulk restore - get the bulk attachment count.\n\t\t */\n\t\tinitScan() {\n\t\t\tconst self = this;\n\t\t\tconst _nonce = document.getElementById('_wpnonce');\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', ajaxurl + '?action=get_image_count', true);\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tif (200 === xhr.status) {\n\t\t\t\t\tconst res = JSON.parse(xhr.response);\n\t\t\t\t\tif ('undefined' !== typeof res.data.items) {\n\t\t\t\t\t\tself.items = res.data.items;\n\t\t\t\t\t\tself.totalSteps = res.data.items.length;\n\t\t\t\t\t\tself.step();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twindow.console.log(\n\t\t\t\t\t\t'Request failed. Returned status of ' + xhr.status\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send('_ajax_nonce=' + _nonce.value);\n\t\t},\n\n\t\t/**\n\t\t * Execute a scan step recursively\n\t\t */\n\t\tstep() {\n\t\t\tconst self = this;\n\t\t\tconst _nonce = document.getElementById('_wpnonce');\n\n\t\t\tif (0 < this.items.length) {\n\t\t\t\tconst item = this.items.pop();\n\t\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\t\txhr.open('POST', ajaxurl + '?action=restore_step', true);\n\t\t\t\txhr.setRequestHeader(\n\t\t\t\t\t'Content-type',\n\t\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t\t);\n\t\t\t\txhr.onload = () => {\n\t\t\t\t\tthis.currentStep++;\n\n\t\t\t\t\tif (200 === xhr.status) {\n\t\t\t\t\t\tconst res = JSON.parse(xhr.response);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t'undefined' !== typeof res.data.success &&\n\t\t\t\t\t\t\tres.data.success\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tself.success.push(item);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tself.errors.push({\n\t\t\t\t\t\t\t\tid: item,\n\t\t\t\t\t\t\t\tsrc: res.data.src,\n\t\t\t\t\t\t\t\tthumb: res.data.thumb,\n\t\t\t\t\t\t\t\tlink: res.data.link,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tself.updateProgressBar();\n\t\t\t\t\tself.step();\n\t\t\t\t};\n\t\t\t\txhr.send('item=' + item + '&_ajax_nonce=' + _nonce.value);\n\t\t\t} else {\n\t\t\t\t// Finish.\n\t\t\t\tthis.settings = {\n\t\t\t\t\tslide: 'finish',\n\t\t\t\t\tsuccess: this.success.length,\n\t\t\t\t\terrors: this.errors,\n\t\t\t\t\ttotal: this.totalSteps,\n\t\t\t\t};\n\n\t\t\t\tself.renderTemplate();\n\t\t\t\tif (0 < this.errors.length) {\n\t\t\t\t\tthis.modal.style.maxWidth = '660px';\n\t\t\t\t\tthis.modal.querySelector('.sui-box').style.maxWidth =\n\t\t\t\t\t\t'660px';\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t};\n\n\t/**\n\t * Template function (underscores based).\n\t *\n\t * @type {Function}\n\t */\n\tWP_Smush.restore.template = _.memoize((id) => {\n\t\tlet compiled;\n\t\tconst options = {\n\t\t\tevaluate: /<#([\\s\\S]+?)#>/g,\n\t\t\tinterpolate: /{{{([\\s\\S]+?)}}}/g,\n\t\t\tescape: /{{([^}]+?)}}(?!})/g,\n\t\t\tvariable: 'data',\n\t\t};\n\n\t\treturn (data) => {\n\t\t\t_.templateSettings = options;\n\t\t\tcompiled =\n\t\t\t\tcompiled || _.template(document.getElementById(id).innerHTML);\n\t\t\treturn compiled(data);\n\t\t};\n\t});\n})();\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * Bulk Smush functionality.\n *\n * @since 2.9.0 Moved from admin.js\n */\n\nimport Smush from '../smush/smush';\n\n( function( $ ) {\n\t'use strict';\n\n\tWP_Smush.bulk = {\n\t\tinit: () => {\n\t\t\t/**\n\t\t\t * Handle the Bulk Smush/Bulk re-Smush button click.\n\t\t\t */\n\t\t\t$( '.wp-smush-all' ).on( 'click', function( e ) {\n\t\t\t\te.preventDefault();\n\n\t\t\t\t$( '.sui-notice-top.sui-notice-success' ).remove();\n\n\t\t\t\tconst bulkWarning = document.getElementById(\n\t\t\t\t\t'bulk_smush_warning'\n\t\t\t\t);\n\t\t\t\tbulkWarning.classList.add( 'sui-hidden' );\n\n\t\t\t\t// Remove limit exceeded styles.\n\t\t\t\tconst progress = $( '.wp-smush-bulk-progress-bar-wrapper' );\n\t\t\t\tprogress.removeClass( 'wp-smush-exceed-limit' );\n\t\t\t\tprogress\n\t\t\t\t\t.find( '.sui-progress-block .wp-smush-all' )\n\t\t\t\t\t.addClass( 'sui-hidden' );\n\t\t\t\tprogress\n\t\t\t\t\t.find( '.sui-progress-block .wp-smush-cancel-bulk' )\n\t\t\t\t\t.removeClass( 'sui-hidden' );\n\t\t\t\tif ( bulkWarning ) {\n\t\t\t\t\tdocument\n\t\t\t\t\t\t.getElementById( 'bulk-smush-resume-button' )\n\t\t\t\t\t\t.classList.add( 'sui-hidden' );\n\t\t\t\t}\n\n\t\t\t\t// Disable re-Smush and scan button.\n\t\t\t\t// TODO: refine what is disabled.\n\t\t\t\t$(\n\t\t\t\t\t'.wp-resmush.wp-smush-action, .wp-smush-scan, .wp-smush-all:not(.sui-progress-close), a.wp-smush-lossy-enable, button.wp-smush-resize-enable, button#save-settings-button'\n\t\t\t\t).prop( 'disabled', true );\n\n\t\t\t\t// Check for IDs, if there is none (unsmushed or lossless), don't call Smush function.\n\t\t\t\t/** @param {Array} wp_smushit_data.unsmushed */\n\t\t\t\tif (\n\t\t\t\t\t'undefined' === typeof window.wp_smushit_data ||\n\t\t\t\t\t( 0 === window.wp_smushit_data.unsmushed.length &&\n\t\t\t\t\t\t0 === window.wp_smushit_data.resmush.length )\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t$( '.wp-smush-remaining' ).addClass( 'sui-hidden' );\n\n\t\t\t\t// Show loader.\n\t\t\t\tprogress\n\t\t\t\t\t.find( '.sui-progress-block i.sui-icon-info' )\n\t\t\t\t\t.removeClass( 'sui-icon-info' )\n\t\t\t\t\t.addClass( 'sui-loading' )\n\t\t\t\t\t.addClass( 'sui-icon-loader' );\n\n\t\t\t\tnew Smush( $( this ), true );\n\t\t\t} );\n\n\t\t\t/**\n\t\t\t * Ignore file from bulk Smush.\n\t\t\t *\n\t\t\t * @since 2.9.0\n\t\t\t */\n\t\t\t$( 'body' ).on( 'click', '.smush-ignore-image', function( e ) {\n\t\t\t\te.preventDefault();\n\n\t\t\t\tconst self = $( this );\n\n\t\t\t\tself.prop( 'disabled', true );\n\t\t\t\tself.attr( 'data-tooltip' );\n\t\t\t\tself.removeClass( 'sui-tooltip' );\n\t\t\t\t$.post( ajaxurl, {\n\t\t\t\t\taction: 'ignore_bulk_image',\n\t\t\t\t\tid: self.attr( 'data-id' ),\n\t\t\t\t} ).done( ( response ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tself.is( 'a' ) &&\n\t\t\t\t\t\tresponse.success &&\n\t\t\t\t\t\t'undefined' !== typeof response.data.links\n\t\t\t\t\t) {\n\t\t\t\t\t\tself.parent()\n\t\t\t\t\t\t\t.parent()\n\t\t\t\t\t\t\t.find( '.smush-status' )\n\t\t\t\t\t\t\t.text( wp_smush_msgs.ignored );\n\t\t\t\t\t\te.target.closest( '.smush-status-links' ).innerHTML =\n\t\t\t\t\t\t\tresponse.data.links;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} );\n\n\t\t\t/**\n\t\t\t * Show upsell on free version and when there are no images to compress.\n\t\t\t *\n\t\t\t * @since 3.7.2\n\t\t\t */\n\t\t\tconst upsellBox = document.getElementById( 'smush-box-bulk-upgrade' );\n\t\t\tif (\n\t\t\t\tupsellBox &&\n\t\t\t\t!window.wp_smushit_data.unsmushed.length &&\n\t\t\t\t!window.wp_smushit_data.resmush.length\n\t\t\t) {\n\t\t\t\tupsellBox.classList.remove( 'sui-hidden' );\n\t\t\t}\n\t\t},\n\t};\n\n\tWP_Smush.bulk.init();\n} )( jQuery );\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * Directory Smush module JavaScript code.\n *\n * @since 2.8.1 Separated from admin.js into dedicated file.\n */\n\nimport { createTree } from 'jquery.fancytree';\nimport Scanner from '../smush/directory-scanner';\n\n( function( $ ) {\n\t'use strict';\n\n\tWP_Smush.directory = {\n\t\tselected: [],\n\t\ttree: [],\n\t\twp_smush_msgs: [],\n\t\ttriggered: false,\n\n\t\tinit() {\n\t\t\tconst self = this,\n\t\t\t\tprogressDialog = $( '#wp-smush-progress-dialog' );\n\n\t\t\tlet totalSteps = 0,\n\t\t\t\tcurrentScanStep = 0;\n\n\t\t\t// Make sure directory smush vars are set.\n\t\t\tif ( typeof window.wp_smushit_data.dir_smush !== 'undefined' ) {\n\t\t\t\ttotalSteps = window.wp_smushit_data.dir_smush.totalSteps;\n\t\t\t\tcurrentScanStep =\n\t\t\t\t\twindow.wp_smushit_data.dir_smush.currentScanStep;\n\t\t\t}\n\n\t\t\t// Init image scanner.\n\t\t\tthis.scanner = new Scanner( totalSteps, currentScanStep );\n\n\t\t\t/**\n\t\t\t * Smush translation strings.\n\t\t\t *\n\t\t\t * @param {Array} wp_smush_msgs\n\t\t\t */\n\t\t\tthis.wp_smush_msgs = window.wp_smush_msgs || {};\n\n\t\t\t/**\n\t\t\t * Open the \"Select Smush directory\" modal.\n\t\t\t */\n\t\t\t$('button.wp-smush-browse, a#smush-directory-open-modal').on(\n\t\t\t\t'click',\n\t\t\t\tfunction (e) {\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tif ( $( e.currentTarget ).hasClass( 'wp-smush-browse' ) ) {\n\t\t\t\t\t\t// Hide all the notices.\n\t\t\t\t\t\t$( 'div.wp-smush-scan-result div.wp-smush-notice' ).hide();\n\n\t\t\t\t\t\t// Remove notice.\n\t\t\t\t\t\t$( 'div.wp-smush-info' ).remove();\n\t\t\t\t\t}\n\n\t\t\t\t\twindow.SUI.openModal(\n\t\t\t\t\t\t'wp-smush-list-dialog',\n\t\t\t\t\t\te.currentTarget,\n\t\t\t\t\t\t$(\n\t\t\t\t\t\t\t'#wp-smush-list-dialog .sui-box-header [data-modal-close]'\n\t\t\t\t\t\t)[0],\n\t\t\t\t\t\ttrue\n\t\t\t\t\t);\n\t\t\t\t\t//Display File tree for Directory Smush\n\t\t\t\t\tself.initFileTree();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Smush images: Smush in Choose Directory modal clicked\n\t\t\t */\n\t\t\t$( '#wp-smush-select-dir' ).on( 'click', function( e ) {\n\t\t\t\te.preventDefault();\n\n\t\t\t\t// If disabled, do not process\n\t\t\t\tif ( $( this ).prop( 'disabled' ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst button = $( this );\n\n\t\t\t\t$( 'div.wp-smush-list-dialog div.sui-box-body' ).css( {\n\t\t\t\t\topacity: '0.8',\n\t\t\t\t} );\n\t\t\t\t$( 'div.wp-smush-list-dialog div.sui-box-body a' ).off(\n\t\t\t\t\t'click'\n\t\t\t\t);\n\n\t\t\t\t// Disable button\n\t\t\t\tbutton.prop( 'disabled', true );\n\n\t\t\t\t// Display the spinner.\n\t\t\t\tbutton.addClass('sui-button-onload');\n\n\t\t\t\tconst selectedFolders = self.tree.getSelectedNodes();\n\n\t\t\t\tconst paths = [];\n\t\t\t\tselectedFolders.forEach( function( folder ) {\n\t\t\t\t\tpaths.push( folder.key );\n\t\t\t\t} );\n\n\t\t\t\t// Send a ajax request to get a list of all the image files\n\t\t\t\tconst param = {\n\t\t\t\t\taction: 'image_list',\n\t\t\t\t\tsmush_path: paths,\n\t\t\t\t\timage_list_nonce: $(\n\t\t\t\t\t\t'input[name=\"image_list_nonce\"]'\n\t\t\t\t\t).val(),\n\t\t\t\t};\n\n\t\t\t\t$.post( ajaxurl, param, function( response ) {\n\t\t\t\t\twindow.SUI.closeModal();\n\n\t\t\t\t\tif ( response.success ) {\n\t\t\t\t\t\tself.scanner = new Scanner( response.data, 0 );\n\t\t\t\t\t\tself.showProgressDialog( response.data );\n\t\t\t\t\t\tself.scanner.scan();\n\t\t\t\t\t} else {\n\t\t\t\t\t\twindow.SUI.openNotice(\n\t\t\t\t\t\t\t'wp-smush-ajax-notice',\n\t\t\t\t\t\t\tresponse.data.message,\n\t\t\t\t\t\t\t{ type: 'warning' }\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} );\n\n\t\t\t/**\n\t\t\t * Cancel scan.\n\t\t\t */\n\t\t\tprogressDialog.on(\n\t\t\t\t'click',\n\t\t\t\t'#cancel-directory-smush, #dialog-close-div, .wp-smush-cancel-dir',\n\t\t\t\tfunction (e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t// Display the spinner\n\t\t\t\t\t$('.wp-smush-cancel-dir').addClass('sui-button-onload');\n\t\t\t\t\tself.scanner\n\t\t\t\t\t\t.cancel()\n\t\t\t\t\t\t.done(\n\t\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\t\t( window.location.href =\n\t\t\t\t\t\t\t\t\tself.wp_smush_msgs.directory_url )\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Continue scan.\n\t\t\t */\n\t\t\tprogressDialog.on(\n\t\t\t\t'click',\n\t\t\t\t'.sui-icon-play, .wp-smush-resume-scan',\n\t\t\t\tfunction( e ) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tself.scanner.resume();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Check to see if we should open the directory module.\n\t\t\t * Used to redirect from dashboard page.\n\t\t\t *\n\t\t\t * @since 3.8.6\n\t\t\t */\n\t\t\tconst queryString = window.location.search;\n\t\t\tconst urlParams = new URLSearchParams(queryString);\n\t\t\tif (urlParams.has('start') && !this.triggered) {\n\t\t\t\tthis.triggered = true;\n\t\t\t\t$('button.wp-smush-browse').trigger('click');\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Init fileTree.\n\t\t */\n\t\tinitFileTree() {\n\t\t\tconst self = this,\n\t\t\t\tsmushButton = $( 'button#wp-smush-select-dir' ),\n\t\t\t\tajaxSettings = {\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\turl: ajaxurl,\n\t\t\t\t\tdata: {\n\t\t\t\t\t\taction: 'smush_get_directory_list',\n\t\t\t\t\t\tlist_nonce: $( 'input[name=\"list_nonce\"]' ).val(),\n\t\t\t\t\t},\n\t\t\t\t\tcache: false,\n\t\t\t\t};\n\n\t\t\t// Object already defined.\n\t\t\tif ( Object.entries( self.tree ).length > 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tself.tree = createTree( '.wp-smush-list-dialog .content', {\n\t\t\t\tautoCollapse: true, // Automatically collapse all siblings, when a node is expanded\n\t\t\t\tclickFolderMode: 3, // 1:activate, 2:expand, 3:activate and expand, 4:activate (dblclick expands)\n\t\t\t\tcheckbox: true, // Show checkboxes\n\t\t\t\tdebugLevel: 0, // 0:quiet, 1:errors, 2:warnings, 3:infos, 4:debug\n\t\t\t\tselectMode: 3, // 1:single, 2:multi, 3:multi-hier\n\t\t\t\ttabindex: '0', // Whole tree behaves as one single control\n\t\t\t\tkeyboard: true, // Support keyboard navigation\n\t\t\t\tquicksearch: true, // Navigate to next node by typing the first letters\n\t\t\t\tsource: ajaxSettings,\n\t\t\t\tlazyLoad: ( event, data ) => {\n\t\t\t\t\tdata.result = new Promise( function( resolve, reject ) {\n\t\t\t\t\t\tajaxSettings.data.dir = data.node.key;\n\t\t\t\t\t\t$.ajax( ajaxSettings )\n\t\t\t\t\t\t\t.done( ( response ) => resolve( response ) )\n\t\t\t\t\t\t\t.fail( reject );\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t\tloadChildren: ( event, data ) =>\n\t\t\t\t\tdata.node.fixSelection3AfterClick(), // Apply parent's state to new child nodes:\n\t\t\t\tselect: () =>\n\t\t\t\t\tsmushButton.prop(\n\t\t\t\t\t\t'disabled',\n\t\t\t\t\t\t! +self.tree.getSelectedNodes().length\n\t\t\t\t\t),\n\t\t\t\tinit: () => smushButton.prop( 'disabled', true ),\n\t\t\t} );\n\t\t},\n\n\t\t/**\n\t\t * Show progress dialog.\n\t\t *\n\t\t * @param {number} items Number of items in the scan.\n\t\t */\n\t\tshowProgressDialog( items ) {\n\t\t\t// Update items status and show the progress dialog..\n\t\t\t$( '.wp-smush-progress-dialog .sui-progress-state-text' ).html(\n\t\t\t\t'0/' + items + ' ' + self.wp_smush_msgs.progress_smushed\n\t\t\t);\n\n\t\t\twindow.SUI.openModal(\n\t\t\t\t'wp-smush-progress-dialog',\n\t\t\t\t'dialog-close-div',\n\t\t\t\tundefined,\n\t\t\t\tfalse\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update progress bar during directory smush.\n\t\t *\n\t\t * @param {number} progress Current progress in percent.\n\t\t * @param {boolean} cancel Cancel status.\n\t\t */\n\t\tupdateProgressBar( progress, cancel = false ) {\n\t\t\tif ( progress > 100 ) {\n\t\t\t\tprogress = 100;\n\t\t\t}\n\n\t\t\t// Update progress bar\n\t\t\t$( '.sui-progress-block .sui-progress-text span' ).text(\n\t\t\t\tprogress + '%'\n\t\t\t);\n\t\t\t$( '.sui-progress-block .sui-progress-bar span' ).width(\n\t\t\t\tprogress + '%'\n\t\t\t);\n\n\t\t\tif ( progress >= 90 ) {\n\t\t\t\t$( '.sui-progress-state .sui-progress-state-text' ).text(\n\t\t\t\t\t'Finalizing...'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( cancel ) {\n\t\t\t\t$( '.sui-progress-state .sui-progress-state-text' ).text(\n\t\t\t\t\t'Cancelling...'\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t};\n\n\tWP_Smush.directory.init();\n} )( jQuery );\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * Directory scanner module that will Smush images in the Directory Smush modal.\n *\n * @since 2.8.1\n *\n * @param {string|number} totalSteps\n * @param {string|number} currentStep\n * @return {Object} Scan object.\n * @class\n */\nconst DirectoryScanner = ( totalSteps, currentStep ) => {\n\ttotalSteps = parseInt( totalSteps );\n\tcurrentStep = parseInt( currentStep );\n\n\tlet cancelling = false,\n\t\tfailedItems = 0,\n\t\tskippedItems = 0;\n\n\tconst obj = {\n\t\tscan() {\n\t\t\tconst remainingSteps = totalSteps - currentStep;\n\t\t\tif ( currentStep !== 0 ) {\n\t\t\t\t// Scan started on a previous page load.\n\t\t\t\tstep(remainingSteps).fail(this.showScanError);\n\t\t\t} else {\n\t\t\t\tjQuery\n\t\t\t\t\t.post(ajaxurl, { action: 'directory_smush_start' }, () =>\n\t\t\t\t\t\tstep(remainingSteps).fail(this.showScanError)\n\t\t\t\t\t)\n\t\t\t\t\t.fail(this.showScanError);\n\t\t\t}\n\t\t},\n\n\t\tcancel() {\n\t\t\tcancelling = true;\n\t\t\treturn jQuery.post( ajaxurl, { action: 'directory_smush_cancel' } );\n\t\t},\n\n\t\tgetProgress() {\n\t\t\tif ( cancelling ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t// O M G ... Logic at it's finest!\n\t\t\tconst remainingSteps = totalSteps - currentStep;\n\t\t\treturn Math.min(\n\t\t\t\tMath.round(\n\t\t\t\t\t( parseInt( totalSteps - remainingSteps ) * 100 ) /\n\t\t\t\t\t\ttotalSteps\n\t\t\t\t),\n\t\t\t\t99\n\t\t\t);\n\t\t},\n\n\t\tonFinishStep( progress ) {\n\t\t\tjQuery( '.wp-smush-progress-dialog .sui-progress-state-text' ).html(\n\t\t\t\tcurrentStep -\n\t\t\t\t\tfailedItems +\n\t\t\t\t\t'/' +\n\t\t\t\t\ttotalSteps +\n\t\t\t\t\t' ' +\n\t\t\t\t\twindow.wp_smush_msgs.progress_smushed\n\t\t\t);\n\t\t\tWP_Smush.directory.updateProgressBar( progress );\n\t\t},\n\n\t\tonFinish() {\n\t\t\tWP_Smush.directory.updateProgressBar( 100 );\n\t\t\twindow.location.href =\n\t\t\t\twindow.wp_smush_msgs.directory_url + '&scan=done';\n\t\t},\n\n\t\t/**\n\t\t * Displays an error when the scan request fails.\n\t\t *\n\t\t * @param {Object} res XHR object.\n\t\t */\n\t\tshowScanError(res) {\n\t\t\tconst dialog = jQuery('#wp-smush-progress-dialog');\n\n\t\t\t// Add the error class to show/hide elements in the dialog.\n\t\t\tdialog\n\t\t\t\t.removeClass('wp-smush-exceed-limit')\n\t\t\t\t.addClass('wp-smush-scan-error');\n\n\t\t\t// Add the error status and description to the error message.\n\t\t\tdialog\n\t\t\t\t.find('#smush-scan-error')\n\t\t\t\t.text(`${res.status} ${res.statusText}`);\n\n\t\t\t// Show/hide the 403 error specific instructions.\n\t\t\tconst forbiddenMessage = dialog.find('.smush-403-error-message');\n\t\t\tif (403 !== res.status) {\n\t\t\t\tforbiddenMessage.addClass('sui-hidden');\n\t\t\t} else {\n\t\t\t\tforbiddenMessage.removeClass('sui-hidden');\n\t\t\t}\n\t\t},\n\n\t\tlimitReached() {\n\t\t\tconst dialog = jQuery( '#wp-smush-progress-dialog' );\n\n\t\t\tdialog.addClass( 'wp-smush-exceed-limit' );\n\t\t\tdialog\n\t\t\t\t.find( '#cancel-directory-smush' )\n\t\t\t\t.attr( 'data-tooltip', window.wp_smush_msgs.bulk_resume );\n\t\t\tdialog\n\t\t\t\t.find( '.sui-box-body .sui-icon-close' )\n\t\t\t\t.removeClass( 'sui-icon-close' )\n\t\t\t\t.addClass( 'sui-icon-play' );\n\t\t\tdialog\n\t\t\t\t.find( '#cancel-directory-smush' )\n\t\t\t\t.attr( 'id', 'cancel-directory-smush-disabled' );\n\t\t},\n\n\t\tresume() {\n\t\t\tconst dialog = jQuery( '#wp-smush-progress-dialog' );\n\t\t\tconst resume = dialog.find( '#cancel-directory-smush-disabled' );\n\n\t\t\tdialog.removeClass( 'wp-smush-exceed-limit' );\n\t\t\tdialog\n\t\t\t\t.find( '.sui-box-body .sui-icon-play' )\n\t\t\t\t.removeClass( 'sui-icon-play' )\n\t\t\t\t.addClass( 'sui-icon-close' );\n\t\t\tresume.attr( 'data-tooltip', 'Cancel' );\n\t\t\tresume.attr( 'id', 'cancel-directory-smush' );\n\n\t\t\tobj.scan();\n\t\t},\n\t};\n\n\t/**\n\t * Execute a scan step recursively\n\t *\n\t * Private to avoid overriding\n\t *\n\t * @param {number} remainingSteps\n\t */\n\tconst step = function( remainingSteps ) {\n\t\tif ( remainingSteps >= 0 ) {\n\t\t\tcurrentStep = totalSteps - remainingSteps;\n\t\t\treturn jQuery.post(\n\t\t\t\tajaxurl,\n\t\t\t\t{\n\t\t\t\t\taction: 'directory_smush_check_step',\n\t\t\t\t\tstep: currentStep,\n\t\t\t\t},\n\t\t\t\t( response ) => {\n\t\t\t\t\t// We're good - continue on.\n\t\t\t\t\tif (\n\t\t\t\t\t\t'undefined' !== typeof response.success &&\n\t\t\t\t\t\tresponse.success\n\t\t\t\t\t) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t'undefined' !== typeof response.data &&\n\t\t\t\t\t\t\t'undefined' !== typeof response.data.skipped &&\n\t\t\t\t\t\t\ttrue === response.data.skipped\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tskippedItems++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrentStep++;\n\t\t\t\t\t\tremainingSteps = remainingSteps - 1;\n\t\t\t\t\t\tobj.onFinishStep( obj.getProgress() );\n\t\t\t\t\t\tstep(remainingSteps).fail(obj.showScanError);\n\t\t\t\t\t} else if (\n\t\t\t\t\t\t'undefined' !== typeof response.data.error &&\n\t\t\t\t\t\t'dir_smush_limit_exceeded' === response.data.error\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Limit reached. Stop.\n\t\t\t\t\t\tobj.limitReached();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Error? never mind, continue, but count them.\n\t\t\t\t\t\tfailedItems++;\n\t\t\t\t\t\tcurrentStep++;\n\t\t\t\t\t\tremainingSteps = remainingSteps - 1;\n\t\t\t\t\t\tobj.onFinishStep( obj.getProgress() );\n\t\t\t\t\t\tstep(remainingSteps).fail(obj.showScanError);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\treturn jQuery.post(\n\t\t\tajaxurl,\n\t\t\t{\n\t\t\t\taction: 'directory_smush_finish',\n\t\t\t\titems: totalSteps - ( failedItems + skippedItems ),\n\t\t\t\tfailed: failedItems,\n\t\t\t\tskipped: skippedItems,\n\t\t\t},\n\t\t\t( response ) => obj.onFinish( response )\n\t\t);\n\t};\n\n\treturn obj;\n};\n\nexport default DirectoryScanner;\n","/* global WP_Smush */\n/* global ajaxurl */\n/* global wp_smush_msgs */\n\n/**\n * Helpers functions.\n *\n * @since 2.9.0 Moved from admin.js\n */\n( function() {\n\t'use strict';\n\n\tWP_Smush.helpers = {\n\t\tinit: () => {},\n\n\t\t/**\n\t\t * Convert bytes to human readable form.\n\t\t *\n\t\t * @param {number} a Bytes\n\t\t * @param {number} b Number of digits\n\t\t * @return {*} Formatted Bytes\n\t\t */\n\t\tformatBytes: ( a, b ) => {\n\t\t\tconst thresh = 1024,\n\t\t\t\tunits = [ 'KB', 'MB', 'GB', 'TB', 'PB' ];\n\n\t\t\tif ( Math.abs( a ) < thresh ) {\n\t\t\t\treturn a + ' B';\n\t\t\t}\n\n\t\t\tlet u = -1;\n\n\t\t\tdo {\n\t\t\t\ta /= thresh;\n\t\t\t\t++u;\n\t\t\t} while ( Math.abs( a ) >= thresh && u < units.length - 1 );\n\n\t\t\treturn a.toFixed( b ) + ' ' + units[ u ];\n\t\t},\n\n\t\t/**\n\t\t * Get size from a string.\n\t\t *\n\t\t * @param {string} formattedSize Formatter string\n\t\t * @return {*} Formatted Bytes\n\t\t */\n\t\tgetSizeFromString: ( formattedSize ) => {\n\t\t\treturn formattedSize.replace( /[a-zA-Z]/g, '' ).trim();\n\t\t},\n\n\t\t/**\n\t\t * Get type from formatted string.\n\t\t *\n\t\t * @param {string} formattedSize Formatted string\n\t\t * @return {*} Formatted Bytes\n\t\t */\n\t\tgetFormatFromString: ( formattedSize ) => {\n\t\t\treturn formattedSize.replace( /[0-9.]/g, '' ).trim();\n\t\t},\n\n\t\t/**\n\t\t * Stackoverflow: http://stackoverflow.com/questions/1726630/formatting-a-number-with-exactly-two-decimals-in-javascript\n\t\t *\n\t\t * @param {number} num\n\t\t * @param {number} decimals\n\t\t * @return {number} Number\n\t\t */\n\t\tprecise_round: ( num, decimals ) => {\n\t\t\tconst sign = num >= 0 ? 1 : -1;\n\t\t\t// Keep the percentage below 100.\n\t\t\tnum = num > 100 ? 100 : num;\n\t\t\treturn (\n\t\t\t\tMath.round( num * Math.pow( 10, decimals ) + sign * 0.001 ) /\n\t\t\t\tMath.pow( 10, decimals )\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Displays a floating error message using the #wp-smush-ajax-notice container.\n\t\t *\n\t\t * @since 3.8.0\n\t\t *\n\t\t * @param {string} message\n\t\t */\n\t\tshowErrorNotice: ( message ) => {\n\t\t\tif ( 'undefined' === typeof message ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst noticeMessage = `<p>${ message }</p>`,\n\t\t\t\tnoticeOptions = {\n\t\t\t\t\ttype: 'error',\n\t\t\t\t\ticon: 'info',\n\t\t\t\t};\n\n\t\t\tSUI.openNotice( 'wp-smush-ajax-notice', noticeMessage, noticeOptions );\n\n\t\t\tconst loadingButton = document.querySelector( '.sui-button-onload' );\n\t\t\tif ( loadingButton ) {\n\t\t\t\tloadingButton.classList.remove( 'sui-button-onload' );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Reset settings.\n\t\t *\n\t\t * @since 3.2.0\n\t\t */\n\t\tresetSettings: () => {\n\t\t\tconst _nonce = document.getElementById( 'wp_smush_reset' );\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open( 'POST', ajaxurl + '?action=reset_settings', true );\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tconst res = JSON.parse( xhr.response );\n\t\t\t\t\tif ( 'undefined' !== typeof res.success && res.success ) {\n\t\t\t\t\t\twindow.location.href = wp_smush_msgs.smush_url;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twindow.console.log(\n\t\t\t\t\t\t'Request failed. Returned status of ' + xhr.status\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send( '_ajax_nonce=' + _nonce.value );\n\t\t},\n\t};\n\n\tWP_Smush.helpers.init();\n} )();\n","/* global ajaxurl */\n/* global wp_smush_msgs */\n\n/**\n * @typedef {Object} jQuery\n * @property\n */\n( function( $ ) {\n\t'use strict';\n\n\t/**\n\t * S3 support alert.\n\t *\n\t * @since 3.6.2 Moved from class-s3.php\n\t */\n\tif ( $( '#wp-smush-s3support-alert' ).length ) {\n\t\tconst noticeOptions = {\n\t\t\ttype: 'warning',\n\t\t\ticon: 'info',\n\t\t\tdismiss: {\n\t\t\t\tshow: true,\n\t\t\t\tlabel: wp_smush_msgs.noticeDismiss,\n\t\t\t\ttooltip: wp_smush_msgs.noticeDismissTooltip,\n\t\t\t},\n\t\t};\n\n\t\twindow.SUI.openNotice(\n\t\t\t'wp-smush-s3support-alert',\n\t\t\t$( '#wp-smush-s3support-alert' ).data( 'message' ),\n\t\t\tnoticeOptions\n\t\t);\n\t}\n\n\t// Dismiss S3 support alert.\n\t$( '#wp-smush-s3support-alert' ).on( 'click', 'button', () => {\n\t\t$.post( ajaxurl, { action: 'dismiss_s3support_alert' } );\n\t} );\n\n\t// Remove API message.\n\t$( '#wp-smush-api-message button.sui-button-icon' ).on( 'click', function(\n\t\te\n\t) {\n\t\te.preventDefault();\n\t\tconst notice = $( '#wp-smush-api-message' );\n\t\tnotice.slideUp( 'slow', function() {\n\t\t\tnotice.remove();\n\t\t} );\n\t\t$.post( ajaxurl, { action: 'hide_api_message' } );\n\t} );\n\n\t// Hide the notice after a CTA button was clicked\n\tfunction removeNotice(e) {\n\t\tconst $notice = $(e.currentTarget).closest('.smush-notice');\n\t\t$notice.fadeTo(100, 0, () =>\n\t\t\t$notice.slideUp(100, () => $notice.remove())\n\t\t);\n\t}\n\n\t// Only used for the Dashboard notification for now.\n\t$('.smush-notice .smush-notice-act').on('click', (e) => {\n\t\tremoveNotice(e);\n\t});\n\n\t// Only used for the upgrade notice.\n\t$('.smush-notice .smush-notice-dismiss').on('click', (e) => {\n\t\tremoveNotice(e);\n\t\t$.post(ajaxurl, { action: 'dismiss_upgrade_notice' });\n\t});\n\n\t// Dismiss the update notice.\n\t$( '.wp-smush-update-info' ).on( 'click', '.notice-dismiss', ( e ) => {\n\t\te.preventDefault();\n\t\tremoveNotice(e);\n\t\t$.post( ajaxurl, { action: 'dismiss_update_info' } );\n\t} );\n} )( jQuery );\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * Modals JavaScript code.\n */\n( function() {\n\t'use strict';\n\n\t/**\n\t * Onboarding modal.\n\t *\n\t * @since 3.1\n\t */\n\tWP_Smush.onboarding = {\n\t\tmembership: 'free', // Assume free by default.\n\t\tonboardingModal: document.getElementById( 'smush-onboarding-dialog' ),\n\t\tscanFilesModal: document.getElementById( 'checking-files-dialog' ),\n\t\tsettings: {\n\t\t\tfirst: true,\n\t\t\tlast: false,\n\t\t\tslide: 'start',\n\t\t\tvalue: false,\n\t\t},\n\t\tselection: {\n\t\t\tauto: true,\n\t\t\tlossy: true,\n\t\t\tstrip_exif: true,\n\t\t\toriginal: false,\n\t\t\tlazy_load: true,\n\t\t\tusage: false,\n\t\t},\n\t\tcontentContainer: document.getElementById( 'smush-onboarding-content' ),\n\t\tonboardingSlides: [\n\t\t\t'start',\n\t\t\t'auto',\n\t\t\t'lossy',\n\t\t\t'strip_exif',\n\t\t\t'original',\n\t\t\t'lazy_load',\n\t\t\t'usage',\n\t\t],\n\t\ttouchX: null,\n\t\ttouchY: null,\n\n\t\t/**\n\t\t * Init module.\n\t\t */\n\t\tinit() {\n\t\t\tif ( ! this.onboardingModal ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst dialog = document.getElementById( 'smush-onboarding' );\n\n\t\t\tthis.membership = dialog.dataset.type;\n\n\t\t\tif ( 'pro' !== this.membership ) {\n\t\t\t\tthis.onboardingSlides = [\n\t\t\t\t\t'start',\n\t\t\t\t\t'auto',\n\t\t\t\t\t'strip_exif',\n\t\t\t\t\t'lazy_load',\n\t\t\t\t\t'usage',\n\t\t\t\t];\n\t\t\t\tthis.selection.lossy = false;\n\t\t\t}\n\n\t\t\tif ( 'false' === dialog.dataset.tracking ) {\n\t\t\t\tthis.onboardingSlides.pop();\n\t\t\t}\n\n\t\t\tthis.renderTemplate();\n\n\t\t\t// Skip setup.\n\t\t\tconst skipButton = this.onboardingModal.querySelector(\n\t\t\t\t'.smush-onboarding-skip-link'\n\t\t\t);\n\t\t\tif ( skipButton ) {\n\t\t\t\tskipButton.addEventListener( 'click', this.skipSetup );\n\t\t\t}\n\n\t\t\t// Show the modal.\n\t\t\twindow.SUI.openModal(\n\t\t\t\t'smush-onboarding-dialog',\n\t\t\t\t'checking-files-dialog',\n\t\t\t\tundefined,\n\t\t\t\tfalse\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Get swipe coordinates.\n\t\t *\n\t\t * @param {Object} e\n\t\t */\n\t\thandleTouchStart( e ) {\n\t\t\tconst firstTouch = e.touches[ 0 ];\n\t\t\tthis.touchX = firstTouch.clientX;\n\t\t\tthis.touchY = firstTouch.clientY;\n\t\t},\n\n\t\t/**\n\t\t * Process swipe left/right.\n\t\t *\n\t\t * @param {Object} e\n\t\t */\n\t\thandleTouchMove( e ) {\n\t\t\tif ( ! this.touchX || ! this.touchY ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst xUp = e.touches[ 0 ].clientX,\n\t\t\t\tyUp = e.touches[ 0 ].clientY,\n\t\t\t\txDiff = this.touchX - xUp,\n\t\t\t\tyDiff = this.touchY - yUp;\n\n\t\t\tif ( Math.abs( xDiff ) > Math.abs( yDiff ) ) {\n\t\t\t\tif ( xDiff > 0 ) {\n\t\t\t\t\tif ( false === WP_Smush.onboarding.settings.last ) {\n\t\t\t\t\t\tWP_Smush.onboarding.next( null, 'next' );\n\t\t\t\t\t}\n\t\t\t\t} else if ( false === WP_Smush.onboarding.settings.first ) {\n\t\t\t\t\tWP_Smush.onboarding.next( null, 'prev' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.touchX = null;\n\t\t\tthis.touchY = null;\n\t\t},\n\n\t\t/**\n\t\t * Update the template, register new listeners.\n\t\t *\n\t\t * @param {string} directionClass Accepts: fadeInRight, fadeInLeft, none.\n\t\t */\n\t\trenderTemplate( directionClass = 'none' ) {\n\t\t\t// Grab the selected value.\n\t\t\tconst input = this.onboardingModal.querySelector(\n\t\t\t\t'input[type=\"checkbox\"]'\n\t\t\t);\n\t\t\tif ( input ) {\n\t\t\t\tthis.selection[ input.id ] = input.checked;\n\t\t\t}\n\n\t\t\tconst template = WP_Smush.onboarding.template( 'smush-onboarding' );\n\t\t\tconst content = template( this.settings );\n\n\t\t\tif ( content ) {\n\t\t\t\tthis.contentContainer.innerHTML = content;\n\n\t\t\t\tif ( 'none' === directionClass ) {\n\t\t\t\t\tthis.contentContainer.classList.add( 'loaded' );\n\t\t\t\t} else {\n\t\t\t\t\tthis.contentContainer.classList.remove( 'loaded' );\n\t\t\t\t\tthis.contentContainer.classList.add( directionClass );\n\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\tthis.contentContainer.classList.add( 'loaded' );\n\t\t\t\t\t\tthis.contentContainer.classList.remove(\n\t\t\t\t\t\t\tdirectionClass\n\t\t\t\t\t\t);\n\t\t\t\t\t}, 600 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.onboardingModal.addEventListener(\n\t\t\t\t'touchstart',\n\t\t\t\tthis.handleTouchStart,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tthis.onboardingModal.addEventListener(\n\t\t\t\t'touchmove',\n\t\t\t\tthis.handleTouchMove,\n\t\t\t\tfalse\n\t\t\t);\n\n\t\t\tthis.bindSubmit();\n\t\t},\n\n\t\t/**\n\t\t * Catch \"Finish setup wizard\" button click.\n\t\t */\n\t\tbindSubmit() {\n\t\t\tconst submitButton = this.onboardingModal.querySelector(\n\t\t\t\t'button[type=\"submit\"]'\n\t\t\t);\n\t\t\tconst self = this;\n\n\t\t\tif ( submitButton ) {\n\t\t\t\tsubmitButton.addEventListener( 'click', function( e ) {\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t// Because we are not rendering the template, we need to update the last element value.\n\t\t\t\t\tconst input = self.onboardingModal.querySelector(\n\t\t\t\t\t\t'input[type=\"checkbox\"]'\n\t\t\t\t\t);\n\t\t\t\t\tif ( input ) {\n\t\t\t\t\t\tself.selection[ input.id ] = input.checked;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst _nonce = document.getElementById(\n\t\t\t\t\t\t'smush_quick_setup_nonce'\n\t\t\t\t\t);\n\n\t\t\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\t\t\txhr.open( 'POST', ajaxurl + '?action=smush_setup', true );\n\t\t\t\t\txhr.setRequestHeader(\n\t\t\t\t\t\t'Content-type',\n\t\t\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t\t\t);\n\t\t\t\t\txhr.onload = () => {\n\t\t\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\t\t\tWP_Smush.onboarding.showScanDialog();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twindow.console.log(\n\t\t\t\t\t\t\t\t'Request failed. Returned status of ' +\n\t\t\t\t\t\t\t\t\txhr.status\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\txhr.send(\n\t\t\t\t\t\t'smush_settings=' +\n\t\t\t\t\t\t\tJSON.stringify( self.selection ) +\n\t\t\t\t\t\t\t'&_ajax_nonce=' +\n\t\t\t\t\t\t\t_nonce.value\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Handle navigation.\n\t\t *\n\t\t * @param {Object} e\n\t\t * @param {null|string} whereTo\n\t\t */\n\t\tnext( e, whereTo = null ) {\n\t\t\tconst index = this.onboardingSlides.indexOf( this.settings.slide );\n\t\t\tlet newIndex = 0;\n\n\t\t\tif ( ! whereTo ) {\n\t\t\t\tnewIndex =\n\t\t\t\t\tnull !== e && e.classList.contains( 'next' )\n\t\t\t\t\t\t? index + 1\n\t\t\t\t\t\t: index - 1;\n\t\t\t} else {\n\t\t\t\tnewIndex = 'next' === whereTo ? index + 1 : index - 1;\n\t\t\t}\n\n\t\t\tconst directionClass =\n\t\t\t\tnull !== e && e.classList.contains( 'next' )\n\t\t\t\t\t? 'fadeInRight'\n\t\t\t\t\t: 'fadeInLeft';\n\n\t\t\tthis.settings = {\n\t\t\t\tfirst: 0 === newIndex,\n\t\t\t\tlast: newIndex + 1 === this.onboardingSlides.length, // length !== index\n\t\t\t\tslide: this.onboardingSlides[ newIndex ],\n\t\t\t\tvalue: this.selection[ this.onboardingSlides[ newIndex ] ],\n\t\t\t};\n\n\t\t\tthis.renderTemplate( directionClass );\n\t\t},\n\n\t\t/**\n\t\t * Handle circle navigation.\n\t\t *\n\t\t * @param {string} target\n\t\t */\n\t\tgoTo( target ) {\n\t\t\tconst newIndex = this.onboardingSlides.indexOf( target );\n\n\t\t\tthis.settings = {\n\t\t\t\tfirst: 0 === newIndex,\n\t\t\t\tlast: newIndex + 1 === this.onboardingSlides.length, // length !== index\n\t\t\t\tslide: target,\n\t\t\t\tvalue: this.selection[ target ],\n\t\t\t};\n\n\t\t\tthis.renderTemplate();\n\t\t},\n\n\t\t/**\n\t\t * Skip onboarding experience.\n\t\t */\n\t\tskipSetup: () => {\n\t\t\tconst _nonce = document.getElementById( 'smush_quick_setup_nonce' );\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open(\n\t\t\t\t'POST',\n\t\t\t\tajaxurl + '?action=skip_smush_setup&_ajax_nonce=' + _nonce.value\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tWP_Smush.onboarding.showScanDialog();\n\t\t\t\t} else {\n\t\t\t\t\twindow.console.log(\n\t\t\t\t\t\t'Request failed. Returned status of ' + xhr.status\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send();\n\t\t},\n\n\t\t/**\n\t\t * Show checking files dialog.\n\t\t */\n\t\tshowScanDialog() {\n\t\t\twindow.SUI.closeModal();\n\t\t\twindow.SUI.openModal(\n\t\t\t\t'checking-files-dialog',\n\t\t\t\t'wpbody-content',\n\t\t\t\tundefined,\n\t\t\t\tfalse\n\t\t\t);\n\n\t\t\tconst nonce = document.getElementById( 'wp_smush_options_nonce' );\n\n\t\t\tsetTimeout( () => {\n\t\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\t\txhr.open( 'POST', ajaxurl + '?action=scan_for_resmush', true );\n\t\t\t\txhr.setRequestHeader(\n\t\t\t\t\t'Content-type',\n\t\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t\t);\n\t\t\t\txhr.onload = () => {\n\t\t\t\t\tconst elem = document.querySelector(\n\t\t\t\t\t\t'#smush-onboarding-dialog'\n\t\t\t\t\t);\n\t\t\t\t\telem.parentNode.removeChild( elem );\n\n\t\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t\t\twindow.location.search = 'page=smush-bulk';\n\t\t\t\t\t\t}, 1000 );\n\t\t\t\t\t} else {\n\t\t\t\t\t\twindow.console.log(\n\t\t\t\t\t\t\t'Request failed. Returned status of ' + xhr.status\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\txhr.send(\n\t\t\t\t\t'type=media&get_ui=false&process_settings=false&wp_smush_options_nonce=' +\n\t\t\t\t\t\tnonce.value\n\t\t\t\t);\n\t\t\t}, 3000 );\n\t\t},\n\n\t\t/**\n\t\t * Hide new features modal.\n\t\t *\n\t\t * @since 3.7.0\n\t\t */\n\t\thideUpgradeModal: () => {\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', ajaxurl + '?action=hide_new_features');\n\t\t\txhr.send();\n\t\t},\n\t};\n\n\t/**\n\t * Template function (underscores based).\n\t *\n\t * @type {Function}\n\t */\n\tWP_Smush.onboarding.template = _.memoize( ( id ) => {\n\t\tlet compiled;\n\t\tconst options = {\n\t\t\tevaluate: /<#([\\s\\S]+?)#>/g,\n\t\t\tinterpolate: /{{{([\\s\\S]+?)}}}/g,\n\t\t\tescape: /{{([^}]+?)}}(?!})/g,\n\t\t\tvariable: 'data',\n\t\t};\n\n\t\treturn ( data ) => {\n\t\t\t_.templateSettings = options;\n\t\t\tcompiled =\n\t\t\t\tcompiled ||\n\t\t\t\t_.template( document.getElementById( id ).innerHTML );\n\t\t\treturn compiled( data );\n\t\t};\n\t} );\n\n\twindow.addEventListener( 'load', () => WP_Smush.onboarding.init() );\n} )();\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * CDN functionality.\n *\n * @since 3.0\n */\n( function() {\n\t'use strict';\n\n\tWP_Smush.CDN = {\n\t\tcdnEnableButton: document.getElementById( 'smush-enable-cdn' ),\n\t\tcdnDisableButton: document.getElementById( 'smush-cancel-cdn' ),\n\t\tcdnStatsBox: document.querySelector( '.smush-cdn-stats' ),\n\n\t\tinit() {\n\t\t\t/**\n\t\t\t * Handle \"Get Started\" button click on disabled CDN page.\n\t\t\t */\n\t\t\tif ( this.cdnEnableButton ) {\n\t\t\t\tthis.cdnEnableButton.addEventListener( 'click', ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.currentTarget.classList.add( 'sui-button-onload' );\n\t\t\t\t\tthis.toggle_cdn( true );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handle \"Deactivate' button click on CDN page.\n\t\t\t */\n\t\t\tif ( this.cdnDisableButton ) {\n\t\t\t\tthis.cdnDisableButton.addEventListener( 'click', ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.currentTarget.classList.add( 'sui-button-onload' );\n\n\t\t\t\t\tthis.toggle_cdn( false );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tthis.updateStatsBox();\n\t\t},\n\n\t\t/**\n\t\t * Toggle CDN.\n\t\t *\n\t\t * @since 3.0\n\t\t *\n\t\t * @param {boolean} enable\n\t\t */\n\t\ttoggle_cdn( enable ) {\n\t\t\tconst nonceField = document.getElementsByName(\n\t\t\t\t'wp_smush_options_nonce'\n\t\t\t);\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open( 'POST', ajaxurl + '?action=smush_toggle_cdn', true );\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tconst res = JSON.parse( xhr.response );\n\t\t\t\t\tif ( 'undefined' !== typeof res.success && res.success ) {\n\t\t\t\t\t\twindow.location.search = 'page=smush-cdn';\n\t\t\t\t\t} else if ( 'undefined' !== typeof res.data.message ) {\n\t\t\t\t\t\tWP_Smush.helpers.showErrorNotice( res.data.message );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tWP_Smush.helpers.showErrorNotice( 'Request failed. Returned status of ' + xhr.status );\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send(\n\t\t\t\t'param=' + enable + '&_ajax_nonce=' + nonceField[ 0 ].value\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update the CDN stats box in summary meta box. Only fetch new data when on CDN page.\n\t\t *\n\t\t * @since 3.0\n\t\t */\n\t\tupdateStatsBox() {\n\t\t\tif (\n\t\t\t\t'undefined' === typeof this.cdnStatsBox ||\n\t\t\t\t! this.cdnStatsBox\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Only fetch the new stats, when user is on CDN page.\n\t\t\tif ( ! window.location.search.includes( 'view=cdn' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.toggleElements();\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open( 'POST', ajaxurl + '?action=get_cdn_stats', true );\n\t\t\txhr.onload = () => {\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tconst res = JSON.parse( xhr.response );\n\t\t\t\t\tif ( 'undefined' !== typeof res.success && res.success ) {\n\t\t\t\t\t\tthis.toggleElements();\n\t\t\t\t\t} else if ( 'undefined' !== typeof res.data.message ) {\n\t\t\t\t\t\tWP_Smush.helpers.showErrorNotice( res.data.message );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tWP_Smush.helpers.showErrorNotice( 'Request failed. Returned status of ' + xhr.status );\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send();\n\t\t},\n\n\t\t/**\n\t\t * Show/hide elements during status update in the updateStatsBox()\n\t\t *\n\t\t * @since 3.1 Moved out from updateStatsBox()\n\t\t */\n\t\ttoggleElements() {\n\t\t\tconst spinner = this.cdnStatsBox.querySelector(\n\t\t\t\t'.sui-icon-loader'\n\t\t\t);\n\t\t\tconst elements = this.cdnStatsBox.querySelectorAll(\n\t\t\t\t'.wp-smush-stats > :not(.sui-icon-loader)'\n\t\t\t);\n\n\t\t\tfor ( let i = 0; i < elements.length; i++ ) {\n\t\t\t\telements[ i ].classList.toggle( 'sui-hidden' );\n\t\t\t}\n\n\t\t\tspinner.classList.toggle( 'sui-hidden' );\n\t\t},\n\t};\n\n\tWP_Smush.CDN.init();\n} )();\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * Lazy loading functionality.\n *\n * @since 3.0\n */\n( function() {\n\t'use strict';\n\n\tWP_Smush.Lazyload = {\n\t\tlazyloadEnableButton: document.getElementById(\n\t\t\t'smush-enable-lazyload'\n\t\t),\n\t\tlazyloadDisableButton: document.getElementById(\n\t\t\t'smush-cancel-lazyload'\n\t\t),\n\n\t\tinit() {\n\t\t\tconst self = this;\n\n\t\t\t/**\n\t\t\t * Handle \"Activate\" button click on disabled Lazy load page.\n\t\t\t */\n\t\t\tif ( this.lazyloadEnableButton ) {\n\t\t\t\tthis.lazyloadEnableButton.addEventListener( 'click', ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.currentTarget.classList.add( 'sui-button-onload' );\n\n\t\t\t\t\tthis.toggle_lazy_load( true );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handle \"Deactivate' button click on Lazy load page.\n\t\t\t */\n\t\t\tif ( this.lazyloadDisableButton ) {\n\t\t\t\tthis.lazyloadDisableButton.addEventListener( 'click', ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.currentTarget.classList.add( 'sui-button-onload' );\n\n\t\t\t\t\tthis.toggle_lazy_load( false );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handle \"Remove icon\" button click on Lazy load page.\n\t\t\t *\n\t\t\t * This removes the image from the upload placeholder.\n\t\t\t *\n\t\t\t * @since 3.2.2\n\t\t\t */\n\t\t\tconst removeSpinner = document.getElementById(\n\t\t\t\t'smush-remove-spinner'\n\t\t\t);\n\t\t\tif ( removeSpinner ) {\n\t\t\t\tremoveSpinner.addEventListener( 'click', ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tthis.removeLoaderIcon();\n\t\t\t\t} );\n\t\t\t}\n\t\t\tconst removePlaceholder = document.getElementById(\n\t\t\t\t'smush-remove-placeholder'\n\t\t\t);\n\t\t\tif ( removePlaceholder ) {\n\t\t\t\tremovePlaceholder.addEventListener( 'click', ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tthis.removeLoaderIcon( 'placeholder' );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handle \"Remove\" icon click.\n\t\t\t *\n\t\t\t * This removes the select icon from the list (not same as above functions).\n\t\t\t *\n\t\t\t * @since 3.2.2\n\t\t\t */\n\t\t\tconst items = document.querySelectorAll( '.smush-ll-remove' );\n\t\t\tif ( items && 0 < items.length ) {\n\t\t\t\titems.forEach( function( el ) {\n\t\t\t\t\tel.addEventListener( 'click', ( e ) => {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\te.target.closest( 'li' ).style.display = 'none';\n\t\t\t\t\t\tself.remove(\n\t\t\t\t\t\t\te.target.dataset.id,\n\t\t\t\t\t\t\te.target.dataset.type\n\t\t\t\t\t\t);\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tthis.handlePredefinedPlaceholders();\n\t\t},\n\n\t\t/**\n\t\t * Handle background color changes for the two predefined placeholders.\n\t\t *\n\t\t * @since 3.7.1\n\t\t */\n\t\thandlePredefinedPlaceholders() {\n\t\t\tconst pl1 = document.getElementById( 'placeholder-icon-1' );\n\t\t\tif ( pl1 ) {\n\t\t\t\tpl1.addEventListener( 'click', () => this.changeColor( '#F3F3F3' ) );\n\t\t\t}\n\n\t\t\tconst pl2 = document.getElementById( 'placeholder-icon-2' );\n\t\t\tif ( pl2 ) {\n\t\t\t\tpl2.addEventListener( 'click', () => this.changeColor( '#333333' ) );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Set color.\n\t\t *\n\t\t * @since 3.7.1\n\t\t * @param {string} color\n\t\t */\n\t\tchangeColor( color ) {\n\t\t\tdocument.getElementById( 'smush-color-picker' ).value = color;\n\t\t\tdocument.querySelector( '.sui-colorpicker-hex .sui-colorpicker-value > span > span' ).style.backgroundColor = color;\n\t\t\tdocument.querySelector( '.sui-colorpicker-hex .sui-colorpicker-value > input' ).value = color;\n\t\t},\n\n\t\t/**\n\t\t * Toggle lazy loading.\n\t\t *\n\t\t * @since 3.2.0\n\t\t *\n\t\t * @param {string} enable\n\t\t */\n\t\ttoggle_lazy_load( enable ) {\n\t\t\tconst nonceField = document.getElementsByName(\n\t\t\t\t'wp_smush_options_nonce'\n\t\t\t);\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open(\n\t\t\t\t'POST',\n\t\t\t\tajaxurl + '?action=smush_toggle_lazy_load',\n\t\t\t\ttrue\n\t\t\t);\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tconst res = JSON.parse( xhr.response );\n\t\t\t\t\tif ( 'undefined' !== typeof res.success && res.success ) {\n\t\t\t\t\t\twindow.location.search = 'page=smush-lazy-load';\n\t\t\t\t\t} else if ( 'undefined' !== typeof res.data.message ) {\n\t\t\t\t\t\tWP_Smush.helpers.showErrorNotice( res.data.message );\n\t\t\t\t\t\tdocument.querySelector( '.sui-button-onload' ).classList.remove( 'sui-button-onload' );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tWP_Smush.helpers.showErrorNotice( 'Request failed. Returned status of ' + xhr.status );\n\t\t\t\t\tdocument.querySelector( '.sui-button-onload' ).classList.remove( 'sui-button-onload' );\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send(\n\t\t\t\t'param=' + enable + '&_ajax_nonce=' + nonceField[ 0 ].value\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Add lazy load spinner icon.\n\t\t *\n\t\t * @since 3.2.2\n\t\t * @param {string} type Accepts: spinner, placeholder.\n\t\t */\n\t\taddLoaderIcon( type = 'spinner' ) {\n\t\t\tlet frame;\n\n\t\t\t// If the media frame already exists, reopen it.\n\t\t\tif ( frame ) {\n\t\t\t\tframe.open();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Create a new media frame\n\t\t\tframe = wp.media( {\n\t\t\t\ttitle: 'Select or upload an icon',\n\t\t\t\tbutton: {\n\t\t\t\t\ttext: 'Select icon',\n\t\t\t\t},\n\t\t\t\tmultiple: false, // Set to true to allow multiple files to be selected\n\t\t\t} );\n\n\t\t\t// When an image is selected in the media frame...\n\t\t\tframe.on( 'select', function() {\n\t\t\t\t// Get media attachment details from the frame state\n\t\t\t\tconst attachment = frame\n\t\t\t\t\t.state()\n\t\t\t\t\t.get( 'selection' )\n\t\t\t\t\t.first()\n\t\t\t\t\t.toJSON();\n\n\t\t\t\t// Send the attachment URL to our custom image input field.\n\t\t\t\tconst imageIcon = document.getElementById(\n\t\t\t\t\t'smush-' + type + '-icon-preview'\n\t\t\t\t);\n\t\t\t\timageIcon.style.backgroundImage =\n\t\t\t\t\t'url(\"' + attachment.url + '\")';\n\t\t\t\timageIcon.style.display = 'block';\n\n\t\t\t\t// Send the attachment id to our hidden input\n\t\t\t\tdocument\n\t\t\t\t\t.getElementById( 'smush-' + type + '-icon-file' )\n\t\t\t\t\t.setAttribute( 'value', attachment.id );\n\n\t\t\t\t// Hide the add image link\n\t\t\t\tdocument.getElementById(\n\t\t\t\t\t'smush-upload-' + type\n\t\t\t\t).style.display = 'none';\n\n\t\t\t\t// Unhide the remove image link\n\t\t\t\tconst removeDiv = document.getElementById(\n\t\t\t\t\t'smush-remove-' + type\n\t\t\t\t);\n\t\t\t\tremoveDiv.querySelector( 'span' ).innerHTML =\n\t\t\t\t\tattachment.filename;\n\t\t\t\tremoveDiv.style.display = 'block';\n\t\t\t} );\n\n\t\t\t// Finally, open the modal on click\n\t\t\tframe.open();\n\t\t},\n\n\t\t/**\n\t\t * Remove lazy load spinner icon.\n\t\t *\n\t\t * @since 3.2.2\n\t\t * @param {string} type Accepts: spinner, placeholder.\n\t\t */\n\t\tremoveLoaderIcon: ( type = 'spinner' ) => {\n\t\t\t// Clear out the preview image\n\t\t\tconst imageIcon = document.getElementById(\n\t\t\t\t'smush-' + type + '-icon-preview'\n\t\t\t);\n\t\t\timageIcon.style.backgroundImage = '';\n\t\t\timageIcon.style.display = 'none';\n\n\t\t\t// Un-hide the add image link\n\t\t\tdocument.getElementById( 'smush-upload-' + type ).style.display =\n\t\t\t\t'block';\n\n\t\t\t// Hide the delete image link\n\t\t\tdocument.getElementById( 'smush-remove-' + type ).style.display =\n\t\t\t\t'none';\n\n\t\t\t// Delete the image id from the hidden input\n\t\t\tdocument\n\t\t\t\t.getElementById( 'smush-' + type + '-icon-file' )\n\t\t\t\t.setAttribute( 'value', '' );\n\t\t},\n\n\t\t/**\n\t\t * Remove item.\n\t\t *\n\t\t * @param {number} id Image ID.\n\t\t * @param {string} type Accepts: spinner, placeholder.\n\t\t */\n\t\tremove: ( id, type = 'spinner' ) => {\n\t\t\tconst nonceField = document.getElementsByName(\n\t\t\t\t'wp_smush_options_nonce'\n\t\t\t);\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open( 'POST', ajaxurl + '?action=smush_remove_icon', true );\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\t\t\txhr.send(\n\t\t\t\t'id=' +\n\t\t\t\t\tid +\n\t\t\t\t\t'&type=' +\n\t\t\t\t\ttype +\n\t\t\t\t\t'&_ajax_nonce=' +\n\t\t\t\t\tnonceField[ 0 ].value\n\t\t\t);\n\t\t},\n\t};\n\n\tWP_Smush.Lazyload.init();\n} )();\n","/* global ajaxurl */\n/* global wp_smush_msgs */\n/* global WP_Smush */\n/* global SUI */\n\n(function ($) {\n\t'use strict';\n\n\t/**\n\t * Bulk compress page.\n\t */\n\t$('form#smush-bulk-form').on('submit', function (e) {\n\t\te.preventDefault();\n\t\t$('#save-settings-button').addClass('sui-button-onload');\n\t\t// TODO: this might be a problem, if we can't recalculate on larger installs.\n\t\tsaveSettings($(this).serialize(), 'bulk');\n\t\trunReCheck();\n\t});\n\n\t/**\n\t * Lazy load page.\n\t */\n\t$('form#smush-lazy-load-form').on('submit', function (e) {\n\t\te.preventDefault();\n\t\t$('#save-settings-button').addClass('sui-button-onload-text');\n\t\tsaveSettings($(this).serialize(), 'lazy-load');\n\t});\n\n\t/**\n\t * CDN page.\n\t */\n\t$('form#smush-cdn-form').on('submit', function (e) {\n\t\te.preventDefault();\n\t\t$('#save-settings-button').addClass('sui-button-onload-text');\n\t\tsaveSettings($(this).serialize(), 'cdn');\n\t});\n\n\t/**\n\t * Integrations page.\n\t */\n\t$('form#smush-integrations-form').on('submit', function (e) {\n\t\te.preventDefault();\n\t\t$('#save-settings-button').addClass('sui-button-onload-text');\n\t\tsaveSettings($(this).serialize(), 'integrations');\n\t});\n\n\t/**\n\t * Tools page.\n\t */\n\t$('form#smush-tools-form').on('submit', function (e) {\n\t\te.preventDefault();\n\t\t$('#save-settings-button').addClass('sui-button-onload-text');\n\t\tsaveSettings($(this).serialize(), 'tools');\n\t});\n\n\t/**\n\t * Settings page.\n\t */\n\t$('form#smush-settings-form').on('submit', function (e) {\n\t\te.preventDefault();\n\t\t$('#save-settings-button').addClass('sui-button-onload-text');\n\t\tsaveSettings($(this).serialize(), 'settings');\n\t});\n\n\t/**\n\t * Save settings.\n\t *\n\t * @param {string} settings JSON string of settings.\n\t * @param {string} page Settings page.\n\t */\n\tfunction saveSettings(settings, page) {\n\t\tconst xhr = new XMLHttpRequest();\n\n\t\txhr.open('POST', ajaxurl + '?action=smush_save_settings', true);\n\t\txhr.setRequestHeader(\n\t\t\t'Content-type',\n\t\t\t'application/x-www-form-urlencoded'\n\t\t);\n\n\t\txhr.onload = () => {\n\t\t\t$('#save-settings-button').removeClass(\n\t\t\t\t'sui-button-onload-text sui-button-onload'\n\t\t\t);\n\n\t\t\tif (200 === xhr.status) {\n\t\t\t\tconst res = JSON.parse(xhr.response);\n\t\t\t\tif ('undefined' !== typeof res.success && res.success) {\n\t\t\t\t\tshowSuccessNotice(wp_smush_msgs.settingsUpdated);\n\t\t\t\t} else if (res.data && res.data.message) {\n\t\t\t\t\tWP_Smush.helpers.showErrorNotice(res.data.message);\n\t\t\t\t} else {\n\t\t\t\t\tWP_Smush.helpers.showErrorNotice('Request failed.');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tWP_Smush.helpers.showErrorNotice(\n\t\t\t\t\t'Request failed. Returned status of ' + xhr.status\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\n\t\txhr.send(\n\t\t\t'page=' +\n\t\t\t\tpage +\n\t\t\t\t'&' +\n\t\t\t\tsettings +\n\t\t\t\t'&_ajax_nonce=' +\n\t\t\t\twp_smush_msgs.nonce\n\t\t);\n\t}\n\n\t/**\n\t * Show successful update notice.\n\t *\n\t * @param {string} msg Notice message.\n\t */\n\tfunction showSuccessNotice(msg) {\n\t\tconst noticeMessage = `<p>${msg}</p>`,\n\t\t\tnoticeOptions = {\n\t\t\t\ttype: 'success',\n\t\t\t\ticon: 'check',\n\t\t\t};\n\n\t\tSUI.openNotice('wp-smush-ajax-notice', noticeMessage, noticeOptions);\n\n\t\tconst loadingButton = document.querySelector('.sui-button-onload');\n\t\tif (loadingButton) {\n\t\t\tloadingButton.classList.remove('sui-button-onload');\n\t\t}\n\t}\n\n\t/**\n\t * Re-check images from bulk smush and integrations pages.\n\t */\n\tfunction runReCheck() {\n\t\t$('#save-settings-button').addClass('sui-button-onload');\n\n\t\tconst param = {\n\t\t\taction: 'scan_for_resmush',\n\t\t\twp_smush_options_nonce: $('#wp_smush_options_nonce').val(),\n\t\t\ttype: 'media',\n\t\t};\n\n\t\t// Send ajax, Update Settings, And Check For resmush.\n\t\t$.post(ajaxurl, $.param(param)).done(function () {\n\t\t\t//showSuccessNotice(r.data.notice);\n\t\t\t$('#save-settings-button').removeClass('sui-button-onload');\n\t\t});\n\t}\n\n\t/**\n\t * Parse remove data change.\n\t */\n\t$('input[name=keep_data]').on('change', function (e) {\n\t\tconst otherClass =\n\t\t\t'keep_data-true' === e.target.id\n\t\t\t\t? 'keep_data-false'\n\t\t\t\t: 'keep_data-true';\n\t\te.target.parentNode.classList.add('active');\n\t\tdocument\n\t\t\t.getElementById(otherClass)\n\t\t\t.parentNode.classList.remove('active');\n\t});\n\n\t/**\n\t * Handle auto detect checkbox toggle, to show/hide highlighting notice.\n\t */\n\t$('input#detection').on('click', function () {\n\t\tconst noticeDiv = $('.smush-highlighting-notice');\n\t\tconst warningDiv = $('.smush-highlighting-warning');\n\n\t\t// Setting enabled.\n\t\tif ($(this).is(':checked')) {\n\t\t\t// Highlighting is already active and setting not saved.\n\t\t\tif (noticeDiv.length > 0) {\n\t\t\t\tnoticeDiv.show();\n\t\t\t} else {\n\t\t\t\twarningDiv.show();\n\t\t\t}\n\t\t} else {\n\t\t\tnoticeDiv.hide();\n\t\t\twarningDiv.hide();\n\t\t}\n\t});\n})(jQuery);\n","/* global WP_Smush */\n/* global ajaxurl */\n/* global wp_smushit_data */\n\nlet perf = 0;\n\n/**\n * Smush class.\n *\n * @since 2.9.0 Moved from admin.js into a dedicated ES6 class.\n */\nclass Smush {\n\t/**\n\t * Class constructor.\n\t *\n\t * @param {Object} button Button object that made the call.\n\t * @param {boolean} bulk Bulk smush or not.\n\t * @param {string} type Accepts: 'nextgen', 'media'.\n\t */\n\tconstructor( button, bulk, type = 'media' ) {\n\t\t// TODO: errors will reset after bulk smush limit is reached and user clicks continue.\n\t\tthis.errors = [];\n\t\t// Smushed and total we take from the progress bar... I don't like this :-(\n\t\tconst progressBar = jQuery(\n\t\t\t'.bulk-smush-wrapper .sui-progress-state-text'\n\t\t);\n\t\tthis.smushed = parseInt(\n\t\t\tprogressBar.find( 'span:first-child' ).html()\n\t\t);\n\t\tthis.total = parseInt( progressBar.find( 'span:last-child' ).html() );\n\n\t\t//If smush attribute is not defined, Need not skip re-Smush IDs.\n\t\tthis.skip_resmush = ! (\n\t\t\t'undefined' === typeof button.data( 'smush' ) ||\n\t\t\t! button.data( 'smush' )\n\t\t);\n\t\tthis.button = jQuery( button[ 0 ] );\n\t\tthis.is_bulk = typeof bulk ? bulk : false;\n\t\tthis.url = ajaxurl;\n\t\tthis.log = jQuery( '.smush-final-log' );\n\t\tthis.deferred = jQuery.Deferred();\n\t\tthis.deferred.errors = [];\n\n\t\tthis.setIds();\n\n\t\tthis.is_bulk_resmush =\n\t\t\t0 < wp_smushit_data.resmush.length && ! this.skip_resmush;\n\t\tthis.status = this.button.parent().prev( '.smush-status' );\n\n\t\t// Added for NextGen support.\n\t\tthis.smush_type = type;\n\t\tthis.single_ajax_suffix =\n\t\t\t'nextgen' === this.smush_type\n\t\t\t\t? 'smush_manual_nextgen'\n\t\t\t\t: 'wp_smushit_manual';\n\t\tthis.bulk_ajax_suffix =\n\t\t\t'nextgen' === this.smush_type\n\t\t\t\t? 'wp_smushit_nextgen_bulk'\n\t\t\t\t: 'wp_smushit_bulk';\n\t\tthis.url = this.is_bulk\n\t\t\t? Smush.smushAddParams( this.url, {\n\t\t\t\t\taction: this.bulk_ajax_suffix,\n\t\t\t } )\n\t\t\t: Smush.smushAddParams( this.url, {\n\t\t\t\t\taction: this.single_ajax_suffix,\n\t\t\t } );\n\n\t\tthis.start();\n\t\tthis.run();\n\t\tthis.bindDeferredEvents();\n\n\t\t// Handle cancel ajax.\n\t\tthis.cancelAjax();\n\n\t\treturn this.deferred;\n\t}\n\n\t/**\n\t * Add params to the URL.\n\t *\n\t * @param {string} url URL to add the params to.\n\t * @param {Object} data Object with params.\n\t * @return {string} URL with params.\n\t */\n\tstatic smushAddParams( url, data ) {\n\t\tif ( ! jQuery.isEmptyObject( data ) ) {\n\t\t\turl +=\n\t\t\t\t( url.indexOf( '?' ) >= 0 ? '&' : '?' ) + jQuery.param( data );\n\t\t}\n\n\t\treturn url;\n\t}\n\n\t/**\n\t * Check membership validity.\n\t *\n\t * @param {Object} data\n\t * @param {number} data.show_warning\n\t */\n\tstatic membershipValidity( data ) {\n\t\tconst memberValidityNotice = jQuery( '#wp-smush-invalid-member' );\n\n\t\t// Check for membership warning.\n\t\tif (\n\t\t\t'undefined' !== typeof data &&\n\t\t\t'undefined' !== typeof data.show_warning &&\n\t\t\tmemberValidityNotice.length > 0\n\t\t) {\n\t\t\tif ( data.show_warning ) {\n\t\t\t\tmemberValidityNotice.show();\n\t\t\t} else {\n\t\t\t\tmemberValidityNotice.hide();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Send Ajax request for compressing the image.\n\t *\n\t * @param {boolean} isBulkResmush\n\t * @param {number} id\n\t * @param {string} sendUrl\n\t * @param {string} nonce\n\t * @return {*|jQuery.promise|void} Compression results.\n\t */\n\tstatic ajax( isBulkResmush, id, sendUrl, nonce ) {\n\t\tconst param = jQuery.param( {\n\t\t\tis_bulk_resmush: isBulkResmush,\n\t\t\tattachment_id: id,\n\t\t\t_nonce: nonce,\n\t\t} );\n\n\t\treturn jQuery.ajax( {\n\t\t\ttype: 'GET',\n\t\t\tdata: param,\n\t\t\turl: sendUrl,\n\t\t\t/** @param {Array} wp_smushit_data */\n\t\t\ttimeout: wp_smushit_data.timeout,\n\t\t\tdataType: 'json',\n\t\t} );\n\t}\n\n\t/**\n\t * Sets this.ids.\n\t */\n\tsetIds() {\n\t\tlet ids = [];\n\t\tif ( 0 < wp_smushit_data.resmush.length && ! this.skip_resmush ) {\n\t\t\tif ( 0 < wp_smushit_data.unsmushed.length ) {\n\t\t\t\tids = wp_smushit_data.resmush.concat( wp_smushit_data.unsmushed );\n\t\t\t} else {\n\t\t\t\tids = wp_smushit_data.resmush;\n\t\t\t}\n\t\t} else {\n\t\t\tids = wp_smushit_data.unsmushed;\n\t\t}\n\n\t\tif ( 'object' === typeof ids ) {\n\t\t\t// If button has re-Smush class, and we do have ids that needs to re-Smushed, put them in the list.\n\t\t\tthis.ids = ids.filter( function( itm, i, a ) {\n\t\t\t\treturn i === a.indexOf( itm );\n\t\t\t} );\n\t\t} else {\n\t\t\tthis.ids = ids;\n\t\t}\n\t}\n\n\t/**\n\t * Show loader in button for single and bulk Smush.\n\t */\n\tstart() {\n\t\tthis.button.prop( 'disabled', true );\n\t\tthis.button.addClass( 'wp-smush-started' );\n\n\t\tthis.bulkStart();\n\t\tthis.singleStart();\n\t}\n\n\t/**\n\t * Start bulk Smush.\n\t */\n\tbulkStart() {\n\t\tif ( ! this.is_bulk ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Hide the bulk div.\n\t\tjQuery( '.wp-smush-bulk-wrapper' ).addClass( 'sui-hidden' );\n\n\t\t// Remove any global notices if there.\n\t\tjQuery( '.sui-notice-top' ).remove();\n\n\t\t// Hide the bulk limit message.\n\t\tjQuery(\n\t\t\t'.wp-smush-bulk-progress-bar-wrapper .sui-notice-warning:first-of-type'\n\t\t).hide();\n\n\t\t// Hide parent wrapper, if there are no other messages.\n\t\tif (\n\t\t\t0 >= jQuery( 'div.smush-final-log .smush-bulk-error-row' ).length\n\t\t) {\n\t\t\tjQuery( 'div.smush-final-log' ).hide();\n\t\t}\n\n\t\t// Show the progress bar.\n\t\tjQuery(\n\t\t\t'.bulk-smush-wrapper .wp-smush-bulk-progress-bar-wrapper, #wp-smush-running-notice'\n\t\t).removeClass( 'sui-hidden' );\n\t}\n\n\t/**\n\t * Start single image Smush.\n\t */\n\tsingleStart() {\n\t\tif ( this.is_bulk ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.button.html(\n\t\t\t'<span class=\"spinner wp-smush-progress\">' +\n\t\t\t\twindow.wp_smush_msgs.smushing +\n\t\t\t\t'</span>'\n\t\t);\n\t\tthis.status.removeClass( 'error' );\n\t}\n\n\t/**\n\t * Enable button.\n\t */\n\tenableButton() {\n\t\tthis.button.prop( 'disabled', false );\n\t\tjQuery('.wp-smush-all').prop('disabled', false);\n\t\t// For bulk process, enable other buttons.\n\t\tjQuery(\n\t\t\t'button.wp-smush-scan, a.wp-smush-lossy-enable, button.wp-smush-resize-enable, button#save-settings-button'\n\t\t).prop('disabled', false);\n\t}\n\n\t/**\n\t * Finish single image Smush.\n\t */\n\tsingleDone() {\n\t\tif ( this.is_bulk ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst self = this;\n\n\t\tthis.button.html( window.wp_smush_msgs.all_done );\n\n\t\tthis.request\n\t\t\t.done( function( response ) {\n\t\t\t\tif ( 'undefined' !== typeof response.data ) {\n\t\t\t\t\t// Check if stats div exists.\n\t\t\t\t\tconst parent = self.status.parent();\n\n\t\t\t\t\t// Check whether to show membership validity notice or not.\n\t\t\t\t\tSmush.membershipValidity( response.data );\n\n\t\t\t\t\tif ( ! response.success ) {\n\t\t\t\t\t\tself.status.addClass( 'error' );\n\t\t\t\t\t\t/** @param {string} response.data.error_msg */\n\t\t\t\t\t\tself.status.html( response.data.error_msg );\n\t\t\t\t\t\tself.button.html(\n\t\t\t\t\t\t\twindow.smush_vars.strings.stats_label\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If we've updated status, replace the content.\n\t\t\t\t\t\tparent.html( response.data );\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Update image size in attachment info panel.\n\t\t\t\t\t *\n\t\t\t\t\t * @param {string|number} response.data.new_size\n\t\t\t\t\t */\n\t\t\t\t\tSmush.updateImageStats( response.data.new_size );\n\t\t\t\t}\n\t\t\t\tself.enableButton();\n\t\t\t} )\n\t\t\t.fail( function( response ) {\n\t\t\t\tself.status.html( response.data );\n\t\t\t\tself.status.addClass( 'error' );\n\t\t\t\tself.enableButton();\n\t\t\t} );\n\t}\n\n\t/**\n\t * Set pro savings stats if not premium user.\n\t *\n\t * For non-premium users, show expected average savings based\n\t * on the free version savings.\n\t */\n\tstatic setProSavings() {\n\t\t// Default values.\n\t\tlet savings =\n\t\t\t\twp_smushit_data.savings_percent > 0\n\t\t\t\t\t? wp_smushit_data.savings_percent\n\t\t\t\t\t: 0,\n\t\t\tsavingsBytes =\n\t\t\t\twp_smushit_data.savings_bytes > 0\n\t\t\t\t\t? wp_smushit_data.savings_bytes\n\t\t\t\t\t: 0,\n\t\t\torigDiff = 2.22058824;\n\n\t\tif ( savings > 49 ) {\n\t\t\torigDiff = 1.22054412;\n\t\t}\n\n\t\t// Calculate Pro savings.\n\t\tif ( savings > 0 ) {\n\t\t\tsavings = origDiff * savings;\n\t\t\tsavingsBytes = origDiff * savingsBytes;\n\t\t}\n\n\t\twp_smushit_data.pro_savings = {\n\t\t\tpercent: WP_Smush.helpers.precise_round( savings, 1 ),\n\t\t\tsavings_bytes: WP_Smush.helpers.formatBytes( savingsBytes, 1 ),\n\t\t};\n\t}\n\n\t/**\n\t * Update all stats sections based on the response.\n\t *\n\t * @param {string} scanType Current scan type.\n\t */\n\tstatic updateStats( scanType ) {\n\t\tconst isNextgen =\n\t\t\t'undefined' !== typeof scanType && 'nextgen' === scanType;\n\t\tlet superSavings = 0;\n\n\t\t// Calculate updated savings in bytes.\n\t\twp_smushit_data.savings_bytes =\n\t\t\tparseInt( wp_smushit_data.size_before ) -\n\t\t\tparseInt( wp_smushit_data.size_after );\n\n\t\tconst formattedSize = WP_Smush.helpers.formatBytes(\n\t\t\twp_smushit_data.savings_bytes,\n\t\t\t1\n\t\t);\n\t\tconst statsHuman = jQuery( '.wp-smush-savings .wp-smush-stats-human' );\n\n\t\tif ( isNextgen ) {\n\t\t\tstatsHuman.html( formattedSize );\n\t\t} else {\n\t\t\tstatsHuman.html(\n\t\t\t\tWP_Smush.helpers.getFormatFromString( formattedSize )\n\t\t\t);\n\t\t\tjQuery( '.sui-summary-large.wp-smush-stats-human' ).html(\n\t\t\t\tWP_Smush.helpers.getSizeFromString( formattedSize )\n\t\t\t);\n\t\t}\n\n\t\t// Update the savings percent.\n\t\twp_smushit_data.savings_percent = WP_Smush.helpers.precise_round(\n\t\t\t( parseInt( wp_smushit_data.savings_bytes ) /\n\t\t\t\tparseInt( wp_smushit_data.size_before ) ) *\n\t\t\t\t100,\n\t\t\t1\n\t\t);\n\t\tif ( ! isNaN( wp_smushit_data.savings_percent ) ) {\n\t\t\tjQuery( '.wp-smush-savings .wp-smush-stats-percent' ).html(\n\t\t\t\twp_smushit_data.savings_percent\n\t\t\t);\n\t\t}\n\n\t\t// Super-Smush savings.\n\t\tif (\n\t\t\t'undefined' !== typeof wp_smushit_data.savings_bytes &&\n\t\t\t'undefined' !== typeof wp_smushit_data.savings_resize\n\t\t) {\n\t\t\tsuperSavings =\n\t\t\t\tparseInt( wp_smushit_data.savings_bytes ) -\n\t\t\t\tparseInt( wp_smushit_data.savings_resize );\n\t\t\tif ( superSavings > 0 ) {\n\t\t\t\tjQuery(\n\t\t\t\t\t'li.super-smush-attachments span.smushed-savings'\n\t\t\t\t).html( WP_Smush.helpers.formatBytes( superSavings, 1 ) );\n\t\t\t}\n\t\t}\n\n\t\t// Update image count.\n\t\tif ( isNextgen ) {\n\t\t\tjQuery( '.sui-summary-details span.wp-smush-total-optimised' ).html(\n\t\t\t\twp_smushit_data.count_images\n\t\t\t);\n\t\t} else {\n\t\t\tjQuery(\n\t\t\t\t'span.smushed-items-count span.wp-smush-count-total span.wp-smush-total-optimised'\n\t\t\t).html( wp_smushit_data.count_images );\n\t\t}\n\n\t\t// Update resize image count.\n\t\tjQuery(\n\t\t\t'span.smushed-items-count span.wp-smush-count-resize-total span.wp-smush-total-optimised'\n\t\t).html( wp_smushit_data.count_resize );\n\n\t\t// Update super-Smushed image count.\n\t\tconst smushedCountDiv = jQuery(\n\t\t\t'li.super-smush-attachments .smushed-count'\n\t\t);\n\t\tif (\n\t\t\tsmushedCountDiv.length &&\n\t\t\t'undefined' !== typeof wp_smushit_data.count_supersmushed\n\t\t) {\n\t\t\tsmushedCountDiv.html( wp_smushit_data.count_supersmushed );\n\t\t}\n\n\t\t// Update conversion savings.\n\t\tconst smushConversionSavings = jQuery( '.smush-conversion-savings' );\n\t\tif (\n\t\t\tsmushConversionSavings.length > 0 &&\n\t\t\t'undefined' !== typeof wp_smushit_data.savings_conversion &&\n\t\t\twp_smushit_data.savings_conversion !== ''\n\t\t) {\n\t\t\tconst conversionSavings = smushConversionSavings.find(\n\t\t\t\t'.wp-smush-stats'\n\t\t\t);\n\t\t\tif ( conversionSavings.length > 0 ) {\n\t\t\t\tconversionSavings.html(\n\t\t\t\t\tWP_Smush.helpers.formatBytes(\n\t\t\t\t\t\twp_smushit_data.savings_conversion,\n\t\t\t\t\t\t1\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Update resize savings.\n\t\tconst smushResizeSavings = jQuery( '.smush-resize-savings' );\n\t\tif (\n\t\t\tsmushResizeSavings.length > 0 &&\n\t\t\t'undefined' !== typeof wp_smushit_data.savings_resize &&\n\t\t\twp_smushit_data.savings_resize !== ''\n\t\t) {\n\t\t\t// Get the resize savings in number.\n\t\t\tconst savingsValue = parseInt( wp_smushit_data.savings_resize );\n\t\t\tconst resizeSavings = smushResizeSavings.find( '.wp-smush-stats' );\n\t\t\tconst resizeMessage = smushResizeSavings.find(\n\t\t\t\t'.wp-smush-stats-label-message'\n\t\t\t);\n\t\t\t// Replace only if value is grater than 0.\n\t\t\tif ( savingsValue > 0 && resizeSavings.length > 0 ) {\n\t\t\t\t// Hide message.\n\t\t\t\tif ( resizeMessage.length > 0 ) {\n\t\t\t\t\tresizeMessage.hide();\n\t\t\t\t}\n\t\t\t\tresizeSavings.html(\n\t\t\t\t\tWP_Smush.helpers.formatBytes(\n\t\t\t\t\t\twp_smushit_data.savings_resize,\n\t\t\t\t\t\t1\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t//Update pro Savings\n\t\tSmush.setProSavings();\n\n\t\t// Updating pro savings stats.\n\t\tif ( 'undefined' !== typeof wp_smushit_data.pro_savings ) {\n\t\t\t// Pro stats section.\n\t\t\tconst smushProSavings = jQuery( '.smush-avg-pro-savings' );\n\t\t\tif ( smushProSavings.length > 0 ) {\n\t\t\t\tconst proSavingsPercent = smushProSavings.find(\n\t\t\t\t\t'.wp-smush-stats-percent'\n\t\t\t\t);\n\t\t\t\tconst proSavingsBytes = smushProSavings.find(\n\t\t\t\t\t'.wp-smush-stats-human'\n\t\t\t\t);\n\t\t\t\tif (\n\t\t\t\t\tproSavingsPercent.length > 0 &&\n\t\t\t\t\t'undefined' !==\n\t\t\t\t\t\ttypeof wp_smushit_data.pro_savings.percent &&\n\t\t\t\t\twp_smushit_data.pro_savings.percent !== ''\n\t\t\t\t) {\n\t\t\t\t\tproSavingsPercent.html(\n\t\t\t\t\t\twp_smushit_data.pro_savings.percent\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\tproSavingsBytes.length > 0 &&\n\t\t\t\t\t'undefined' !==\n\t\t\t\t\t\ttypeof wp_smushit_data.pro_savings.savings_bytes &&\n\t\t\t\t\twp_smushit_data.pro_savings.savings_bytes !== ''\n\t\t\t\t) {\n\t\t\t\t\tproSavingsBytes.html(\n\t\t\t\t\t\twp_smushit_data.pro_savings.savings_bytes\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Update remaining count.\n\t\t// Update sidebar count.\n\t\tconst sidenavCountDiv = jQuery(\n\t\t\t'.smush-sidenav .wp-smush-remaining-count'\n\t\t);\n\t\tif ( sidenavCountDiv.length ) {\n\t\t\tlet count = 0;\n\n\t\t\t// Unsmushed\n\t\t\tif (\n\t\t\t\t'undefined' !== typeof wp_smushit_data.unsmushed &&\n\t\t\t\twp_smushit_data.unsmushed.length > 0\n\t\t\t) {\n\t\t\t\tcount += wp_smushit_data.unsmushed.length;\n\t\t\t}\n\n\t\t\t// Re-smush\n\t\t\tif (\n\t\t\t\t'undefined' !== typeof wp_smushit_data.resmush &&\n\t\t\t\twp_smushit_data.resmush.length > 0\n\t\t\t) {\n\t\t\t\tcount += wp_smushit_data.resmush.length;\n\t\t\t}\n\n\t\t\tSmush.updateRemainingCount( count );\n\t\t}\n\t}\n\n\t/**\n\t * Update image size in attachment info panel.\n\t *\n\t * @since 2.8\n\t *\n\t * @param {number} newSize\n\t */\n\tstatic updateImageStats( newSize ) {\n\t\tif ( 0 === newSize ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst attachmentSize = jQuery( '.attachment-info .file-size' );\n\t\tconst currentSize = attachmentSize\n\t\t\t.contents()\n\t\t\t.filter( function() {\n\t\t\t\treturn this.nodeType === 3;\n\t\t\t} )\n\t\t\t.text();\n\n\t\t// There is a space before the size.\n\t\tif ( currentSize !== ' ' + newSize ) {\n\t\t\tconst sizeStrongEl = attachmentSize\n\t\t\t\t.contents()\n\t\t\t\t.filter( function() {\n\t\t\t\t\treturn this.nodeType === 1;\n\t\t\t\t} )\n\t\t\t\t.text();\n\t\t\tattachmentSize.html(\n\t\t\t\t'<strong>' + sizeStrongEl + '</strong> ' + newSize\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Sync stats.\n\t */\n\tsyncStats() {\n\t\tconst messageHolder = jQuery(\n\t\t\t'div.wp-smush-bulk-progress-bar-wrapper div.wp-smush-count.tc'\n\t\t);\n\t\t// Store the existing content in a variable.\n\t\tconst progressMessage = messageHolder.html();\n\t\t/** @param {string} wp_smush_msgs.sync_stats */\n\t\tmessageHolder.html( window.wp_smush_msgs.sync_stats );\n\n\t\t// Send ajax.\n\t\tjQuery\n\t\t\t.ajax( {\n\t\t\t\ttype: 'GET',\n\t\t\t\turl: this.url,\n\t\t\t\tdata: {\n\t\t\t\t\taction: 'get_stats',\n\t\t\t\t},\n\t\t\t\tsuccess( response ) {\n\t\t\t\t\tif ( response && 'undefined' !== typeof response ) {\n\t\t\t\t\t\tresponse = response.data;\n\t\t\t\t\t\tjQuery.extend( wp_smushit_data, {\n\t\t\t\t\t\t\tcount_images: response.count_images,\n\t\t\t\t\t\t\tcount_smushed: response.count_smushed,\n\t\t\t\t\t\t\tcount_total: response.count_total,\n\t\t\t\t\t\t\tcount_resize: response.count_resize,\n\t\t\t\t\t\t\tcount_supersmushed: response.count_supersmushed,\n\t\t\t\t\t\t\tsavings_bytes: response.savings_bytes,\n\t\t\t\t\t\t\tsavings_conversion: response.savings_conversion,\n\t\t\t\t\t\t\tsavings_resize: response.savings_resize,\n\t\t\t\t\t\t\tsize_before: response.size_before,\n\t\t\t\t\t\t\tsize_after: response.size_after,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\t// Got the stats, update it.\n\t\t\t\t\t\tSmush.updateStats( this.smush_type );\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t} )\n\t\t\t.always( () => messageHolder.html( progressMessage ) );\n\t}\n\n\t/**\n\t * After the bulk optimization has been finished.\n\t */\n\tbulkDone() {\n\t\tif ( ! this.is_bulk ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Enable the button.\n\t\tthis.enableButton();\n\n\t\tconst statusIcon = jQuery( '.sui-summary-smush .smush-stats-icon' );\n\n\t\t// Show notice.\n\t\tif ( 0 === this.ids.length ) {\n\t\t\tstatusIcon.addClass( 'sui-hidden' );\n\t\t\tjQuery(\n\t\t\t\t'.bulk-smush-wrapper .wp-smush-all-done, .wp-smush-pagespeed-recommendation'\n\t\t\t).removeClass( 'sui-hidden' );\n\t\t\tjQuery( '.wp-smush-bulk-wrapper' ).addClass( 'sui-hidden' );\n\t\t\t// Hide the progress bar if scan is finished.\n\t\t\tjQuery( '.wp-smush-bulk-progress-bar-wrapper' ).addClass( 'sui-hidden' );\n\n\t\t\t// Display the upsell metabox.\n\t\t\tif (document.getElementById('smush-box-bulk-upgrade')) {\n\t\t\t\tdocument\n\t\t\t\t\t.getElementById('smush-box-bulk-upgrade')\n\t\t\t\t\t.classList.remove('sui-hidden');\n\n\t\t\t\tdocument\n\t\t\t\t\t.getElementById('wp-smush-all-smushed-text')\n\t\t\t\t\t.classList.remove('sui-hidden');\n\n\t\t\t\tdocument\n\t\t\t\t\t.getElementById('wp-smush-pending-to-smush-text')\n\t\t\t\t\t.classList.add('sui-hidden');\n\t\t\t}\n\n\t\t\t// Reset the progress when we finish so the next smushing starts from zero.\n\t\t\tthis._updateProgress(0, 0);\n\t\t} else {\n\t\t\t// Show loader.\n\t\t\tstatusIcon\n\t\t\t\t.removeClass( 'sui-icon-loader sui-loading sui-hidden' )\n\t\t\t\t.addClass( 'sui-icon-info sui-warning' );\n\n\t\t\tconst notice = jQuery(\n\t\t\t\t'.bulk-smush-wrapper .wp-smush-resmush-notice'\n\t\t\t);\n\n\t\t\tif ( notice.length > 0 ) {\n\t\t\t\tnotice.show();\n\t\t\t} else {\n\t\t\t\tjQuery( '.bulk-smush-wrapper .wp-smush-remaining' ).removeClass( 'sui-hidden' );\n\t\t\t}\n\t\t}\n\n\t\t// Enable re-Smush and scan button.\n\t\tjQuery( '.wp-resmush.wp-smush-action, .wp-smush-scan' ).removeProp(\n\t\t\t'disabled'\n\t\t);\n\t}\n\n\t/**\n\t * Free Smush limit exceeded.\n\t */\n\tfreeExceeded() {\n\t\tconst progress = jQuery( '.wp-smush-bulk-progress-bar-wrapper' );\n\t\tprogress.addClass( 'wp-smush-exceed-limit' );\n\t\tprogress\n\t\t\t.find( '.sui-progress-block .wp-smush-cancel-bulk' )\n\t\t\t.addClass( 'sui-hidden' );\n\t\tprogress\n\t\t\t.find( '.sui-progress-block .wp-smush-all' )\n\t\t\t.removeClass( 'sui-hidden' );\n\n\t\tprogress\n\t\t\t.find( 'i.sui-icon-loader' )\n\t\t\t.addClass( 'sui-icon-info' )\n\t\t\t.removeClass( 'sui-icon-loader' )\n\t\t\t.removeClass( 'sui-loading' );\n\n\t\tdocument\n\t\t\t.getElementById( 'bulk-smush-resume-button' )\n\t\t\t.classList.remove( 'sui-hidden' );\n\n\t\tif (document.getElementById('smush-box-bulk-upgrade')) {\n\t\t\tdocument\n\t\t\t\t.getElementById('smush-box-bulk-upgrade')\n\t\t\t\t.classList.remove('sui-hidden');\n\t\t}\n\t}\n\n\t/**\n\t * Update remaining count.\n\t */\n\tstatic updateRemainingCount( count ) {\n\t\tconst remainingCountContainers = jQuery( '.wp-smush-remaining-count' );\n\t\tif ( remainingCountContainers.length ) {\n\t\t\tremainingCountContainers.html( count );\n\t\t}\n\n\t\t// Update sidebar count.\n\t\tconst sidenavCountDiv = jQuery( '.smush-sidenav .wp-smush-remaining-count' ),\n\t\t\tsidenavCheckTag = jQuery( '.smush-sidenav .smush-bulk .sui-icon-check-tick' );\n\t\tif ( sidenavCountDiv.length && sidenavCheckTag.length ) {\n\t\t\tif ( count > 0 ) {\n\t\t\t\tsidenavCountDiv.removeClass( 'sui-hidden' );\n\t\t\t\tsidenavCheckTag.addClass( 'sui-hidden' );\n\t\t\t} else {\n\t\t\t\tjQuery( '.sui-summary-smush .smush-stats-icon' ).addClass( 'sui-hidden' );\n\t\t\t\tsidenavCheckTag.removeClass( 'sui-hidden' );\n\t\t\t\tsidenavCountDiv.addClass( 'sui-hidden' );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Adds the stats for the current image to existing stats.\n\t *\n\t * @param {Array} imageStats\n\t * @param {string} imageStats.count\n\t * @param {boolean} imageStats.is_lossy\n\t * @param {Array} imageStats.savings_resize\n\t * @param {Array} imageStats.savings_conversion\n\t * @param {string} imageStats.size_before\n\t * @param {string} imageStats.size_after\n\t * @param {string} type\n\t */\n\tstatic updateLocalizedStats( imageStats, type ) {\n\t\t// Increase the Smush count.\n\t\tif ( 'undefined' === typeof window.wp_smushit_data ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// No need to increase attachment count, resize, conversion savings for directory Smush.\n\t\tif ( 'media' === type ) {\n\t\t\t// Increase Smushed image count.\n\t\t\twp_smushit_data.count_images =\n\t\t\t\tparseInt( wp_smushit_data.count_images ) +\n\t\t\t\tparseInt( imageStats.count );\n\n\t\t\t// Increase super Smush count, if applicable.\n\t\t\tif ( imageStats.is_lossy ) {\n\t\t\t\twp_smushit_data.count_supersmushed =\n\t\t\t\t\tparseInt( wp_smushit_data.count_supersmushed ) + 1;\n\t\t\t}\n\n\t\t\t// Add to resize savings.\n\t\t\twp_smushit_data.savings_resize =\n\t\t\t\t'undefined' !== typeof imageStats.savings_resize.bytes\n\t\t\t\t\t? parseInt( wp_smushit_data.savings_resize ) +\n\t\t\t\t\t parseInt( imageStats.savings_resize.bytes )\n\t\t\t\t\t: parseInt( wp_smushit_data.savings_resize );\n\n\t\t\t// Update resize count.\n\t\t\twp_smushit_data.count_resize =\n\t\t\t\t'undefined' !== typeof imageStats.savings_resize.bytes\n\t\t\t\t\t? parseInt( wp_smushit_data.count_resize ) + 1\n\t\t\t\t\t: wp_smushit_data.count_resize;\n\n\t\t\t// Add to conversion savings.\n\t\t\twp_smushit_data.savings_conversion =\n\t\t\t\t'undefined' !== typeof imageStats.savings_conversion &&\n\t\t\t\t'undefined' !== typeof imageStats.savings_conversion.bytes\n\t\t\t\t\t? parseInt( wp_smushit_data.savings_conversion ) +\n\t\t\t\t\t parseInt( imageStats.savings_conversion.bytes )\n\t\t\t\t\t: parseInt( wp_smushit_data.savings_conversion );\n\t\t} else if ( 'directory_smush' === type ) {\n\t\t\t//Increase smushed image count\n\t\t\twp_smushit_data.count_images =\n\t\t\t\tparseInt( wp_smushit_data.count_images ) + 1;\n\t\t} else if ( 'nextgen' === type ) {\n\t\t\twp_smushit_data.count_supersmushed =\n\t\t\t\tparseInt( wp_smushit_data.count_supersmushed ) + 1;\n\n\t\t\t// Increase Smushed image count.\n\t\t\twp_smushit_data.count_images =\n\t\t\t\tparseInt( wp_smushit_data.count_images ) +\n\t\t\t\tparseInt( imageStats.count );\n\t\t}\n\n\t\t// If we have savings. Update savings.\n\t\tif ( imageStats.size_before > imageStats.size_after ) {\n\t\t\twp_smushit_data.size_before =\n\t\t\t\t'undefined' !== typeof imageStats.size_before\n\t\t\t\t\t? parseInt( wp_smushit_data.size_before ) +\n\t\t\t\t\t parseInt( imageStats.size_before )\n\t\t\t\t\t: parseInt( wp_smushit_data.size_before );\n\t\t\twp_smushit_data.size_after =\n\t\t\t\t'undefined' !== typeof imageStats.size_after\n\t\t\t\t\t? parseInt( wp_smushit_data.size_after ) +\n\t\t\t\t\t parseInt( imageStats.size_after )\n\t\t\t\t\t: parseInt( wp_smushit_data.size_after );\n\t\t}\n\n\t\t// Add stats for resizing. Update savings.\n\t\tif ( 'undefined' !== typeof imageStats.savings_resize ) {\n\t\t\twp_smushit_data.size_before =\n\t\t\t\t'undefined' !== typeof imageStats.savings_resize.size_before\n\t\t\t\t\t? parseInt( wp_smushit_data.size_before ) +\n\t\t\t\t\t parseInt( imageStats.savings_resize.size_before )\n\t\t\t\t\t: parseInt( wp_smushit_data.size_before );\n\t\t\twp_smushit_data.size_after =\n\t\t\t\t'undefined' !== typeof imageStats.savings_resize.size_after\n\t\t\t\t\t? parseInt( wp_smushit_data.size_after ) +\n\t\t\t\t\t parseInt( imageStats.savings_resize.size_after )\n\t\t\t\t\t: parseInt( wp_smushit_data.size_after );\n\t\t}\n\n\t\t// Add stats for conversion. Update savings.\n\t\tif ( 'undefined' !== typeof imageStats.savings_conversion ) {\n\t\t\twp_smushit_data.size_before =\n\t\t\t\t'undefined' !== typeof imageStats.savings_conversion.size_before\n\t\t\t\t\t? parseInt( wp_smushit_data.size_before ) +\n\t\t\t\t\t parseInt( imageStats.savings_conversion.size_before )\n\t\t\t\t\t: parseInt( wp_smushit_data.size_before );\n\t\t\twp_smushit_data.size_after =\n\t\t\t\t'undefined' !== typeof imageStats.savings_conversion.size_after\n\t\t\t\t\t? parseInt( wp_smushit_data.size_after ) +\n\t\t\t\t\t parseInt( imageStats.savings_conversion.size_after )\n\t\t\t\t\t: parseInt( wp_smushit_data.size_after );\n\t\t}\n\t}\n\n\t/**\n\t * Update progress.\n\t *\n\t * @param {Object} _res\n\t */\n\tupdateProgress( _res ) {\n\t\tif ( ! this.is_bulk_resmush && ! this.is_bulk ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet progress = 0;\n\n\t\t// Update localized stats.\n\t\tif (\n\t\t\t_res &&\n\t\t\t'undefined' !== typeof _res.data &&\n\t\t\t'undefined' !== typeof _res.data.stats\n\t\t) {\n\t\t\tSmush.updateLocalizedStats( _res.data.stats, this.smush_type );\n\t\t}\n\n\t\tif ( ! this.is_bulk_resmush ) {\n\t\t\t// Handle progress for normal bulk smush.\n\t\t\tprogress =\n\t\t\t\t( ( this.smushed + this.errors.length ) / this.total ) * 100;\n\t\t} else {\n\t\t\t// If the request was successful, update the progress bar.\n\t\t\tif ( _res.success ) {\n\t\t\t\t// Handle progress for super Smush progress bar.\n\t\t\t\tif ( wp_smushit_data.resmush.length > 0 ) {\n\t\t\t\t\t// Update the count.\n\t\t\t\t\tjQuery( '.wp-smush-images-remaining' ).html(\n\t\t\t\t\t\twp_smushit_data.resmush.length\n\t\t\t\t\t);\n\t\t\t\t} else if (\n\t\t\t\t\t0 === wp_smushit_data.resmush.length &&\n\t\t\t\t\t0 === this.ids.length\n\t\t\t\t) {\n\t\t\t\t\t// If all images are re-Smushed, show the All Smushed message.\n\t\t\t\t\tjQuery(\n\t\t\t\t\t\t'.bulk-resmush-wrapper .wp-smush-all-done, .wp-smush-pagespeed-recommendation'\n\t\t\t\t\t).removeClass( 'sui-hidden' );\n\n\t\t\t\t\t// Hide everything else.\n\t\t\t\t\tjQuery(\n\t\t\t\t\t\t'.wp-smush-resmush-wrap, .wp-smush-bulk-progress-bar-wrapper'\n\t\t\t\t\t).addClass( 'sui-hidden' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Handle progress for normal bulk Smush. Set progress bar width.\n\t\t\tif (\n\t\t\t\t'undefined' !== typeof this.ids &&\n\t\t\t\t'undefined' !== typeof this.total &&\n\t\t\t\tthis.total > 0\n\t\t\t) {\n\t\t\t\tprogress =\n\t\t\t\t\t( ( this.smushed + this.errors.length ) / this.total ) *\n\t\t\t\t\t100;\n\t\t\t}\n\t\t}\n\n\t\t// Reset the lossless images count in case of pending images for resmush ( Nextgen only ).\n\t\tif (\n\t\t\t'nextgen' === this.smush_type &&\n\t\t\twp_smushit_data.resmush.length > 0 && \n\t\t\t(this.smushed + this.errors.length <= 1)\n\t\t) {\n\t\t\twp_smushit_data.count_images -= (wp_smushit_data.resmush.length + 1);\n\t\t}\n\n\t\t// No more images left. Show bulk wrapper and Smush notice.\n\t\tif ( 0 === this.ids.length ) {\n\t\t\t// Sync stats for bulk Smush media library ( skip for Nextgen ).\n\t\t\tif ( 'nextgen' !== this.smush_type ) {\n\t\t\t\tthis.syncStats();\n\t\t\t}\n\t\t\tjQuery(\n\t\t\t\t'.bulk-smush-wrapper .wp-smush-all-done, .wp-smush-pagespeed-recommendation'\n\t\t\t).removeClass( 'sui-hidden' );\n\t\t\tjQuery( '.wp-smush-bulk-wrapper' ).addClass( 'sui-hidden' );\n\t\t}\n\n\t\t// Update remaining count.\n\t\tif ( 'undefined' !== typeof this.ids ) {\n\t\t\tSmush.updateRemainingCount( this.ids.length );\n\t\t}\n\n\t\t// Increase the progress bar and counter.\n\t\tthis._updateProgress(\n\t\t\tthis.smushed + this.errors.length,\n\t\t\tWP_Smush.helpers.precise_round( progress, 1 )\n\t\t);\n\n\t\t// Avoid updating the stats twice when the bulk smush ends on Smush's page.\n\t\tif (0 !== this.ids.length || 'nextgen' === this.smush_type) {\n\t\t\t// Update stats and counts.\n\t\t\tSmush.updateStats(this.smush_type);\n\t\t}\n\t}\n\n\t/**\n\t * Update progress.\n\t *\n\t * @param {number} count Number of images optimized.\n\t * @param {string} width Percentage complete.\n\t * @private\n\t */\n\t_updateProgress( count, width ) {\n\t\tif ( ! this.is_bulk && ! this.is_bulk_resmush ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Progress bar label.\n\t\tjQuery( 'span.wp-smush-images-percent' ).html( width + '%' );\n\t\t// Progress bar.\n\t\tjQuery( '.bulk-smush-wrapper .wp-smush-progress-inner' ).css(\n\t\t\t'width',\n\t\t\twidth + '%'\n\t\t);\n\n\t\t// Progress bar status.\n\t\tjQuery( '.bulk-smush-wrapper .sui-progress-state-text' )\n\t\t\t.find( 'span:first-child' )\n\t\t\t.html( count )\n\t\t\t.find( 'span:last-child' )\n\t\t\t.html( this.total );\n\t}\n\n\t/**\n\t * Whether to send the ajax requests further or not.\n\t *\n\t * @return {*|boolean} Should continue or not.\n\t */\n\tcontinue() {\n\t\tlet continueSmush = this.button.attr( 'continue_smush' );\n\n\t\tif ( 'undefined' === typeof continueSmush ) {\n\t\t\tcontinueSmush = true;\n\t\t}\n\n\t\tif ( 'false' === continueSmush || ! continueSmush ) {\n\t\t\tcontinueSmush = false;\n\t\t}\n\n\t\treturn continueSmush && this.ids.length > 0 && this.is_bulk;\n\t}\n\n\t/**\n\t * Send ajax request for optimizing single and bulk, call update_progress on ajax response.\n\t *\n\t * @return {*} Ajax call response.\n\t */\n\tcallAjax() {\n\t\t/**\n\t\t * This here little piece of code allows to track auto continue clicks and halts bulk Smush until the page\n\t\t * is reloaded.\n\t\t *\n\t\t * @since 3.5.0\n\t\t * @see https://wordpress.org/plugins/wp-nonstop-smushit/\n\t\t */\n\t\tif (\n\t\t\t0 !== perf &&\n\t\t\t'undefined' !== typeof perf &&\n\t\t\t10 > performance.now() - perf\n\t\t) {\n\t\t\tthis.freeExceeded();\n\t\t\treturn this.deferred;\n\t\t}\n\n\t\tlet nonceValue = '';\n\t\t// Remove from array while processing so we can continue where left off.\n\t\tthis.current_id = this.is_bulk\n\t\t\t? this.ids.shift()\n\t\t\t: this.button.data( 'id' );\n\n\t\t// Remove the ID from respective variable as well.\n\t\tSmush.updateSmushIds( this.current_id );\n\n\t\tconst nonceField = this.button.parent().find( '#_wp_smush_nonce' );\n\t\tif ( nonceField ) {\n\t\t\tnonceValue = nonceField.val();\n\t\t}\n\n\t\tconst self = this;\n\n\t\tthis.request = Smush.ajax(\n\t\t\tthis.is_bulk_resmush,\n\t\t\tthis.current_id,\n\t\t\tthis.url,\n\t\t\tnonceValue\n\t\t)\n\t\t\t.done( function( res ) {\n\t\t\t\t// If no response or success is false, do not process further. Increase the error count except if bulk request limit exceeded.\n\t\t\t\tif (\n\t\t\t\t\t'undefined' === typeof res.success ||\n\t\t\t\t\t( 'undefined' !== typeof res.success &&\n\t\t\t\t\t\tfalse === res.success &&\n\t\t\t\t\t\t'undefined' !== typeof res.data &&\n\t\t\t\t\t\t'limit_exceeded' !== res.data.error )\n\t\t\t\t) {\n\t\t\t\t\tself.errors.push( self.current_id );\n\n\t\t\t\t\t/** @param {string} res.data.file_name */\n\t\t\t\t\tconst errorMsg = Smush.prepareErrorRow(\n\t\t\t\t\t\tres.data.error_message,\n\t\t\t\t\t\tres.data.file_name,\n\t\t\t\t\t\tres.data.thumbnail,\n\t\t\t\t\t\tself.current_id,\n\t\t\t\t\t\tself.smush_type\n\t\t\t\t\t);\n\n\t\t\t\t\tself.log.show();\n\n\t\t\t\t\tif ( self.errors.length > 5 ) {\n\t\t\t\t\t\tjQuery( '.smush-bulk-errors-actions' ).removeClass(\n\t\t\t\t\t\t\t'sui-hidden'\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Print the error on screen.\n\t\t\t\t\t\tself.log\n\t\t\t\t\t\t\t.find( '.smush-bulk-errors' )\n\t\t\t\t\t\t\t.append( errorMsg );\n\t\t\t\t\t}\n\t\t\t\t} else if (\n\t\t\t\t\t'undefined' !== typeof res.success &&\n\t\t\t\t\tres.success\n\t\t\t\t) {\n\t\t\t\t\t// Increment the smushed count if image smushed without errors.\n\t\t\t\t\tself.smushed++;\n\t\t\t\t}\n\n\t\t\t\t// Check whether to show the warning notice or not.\n\t\t\t\tSmush.membershipValidity( res.data );\n\n\t\t\t\t/**\n\t\t\t\t * Bulk Smush limit exceeded: Stop ajax requests, remove progress bar, append the last image ID\n\t\t\t\t * back to Smush variable, and reset variables to allow the user to continue bulk Smush.\n\t\t\t\t */\n\t\t\t\tif (\n\t\t\t\t\t'undefined' !== typeof res.data &&\n\t\t\t\t\t'limit_exceeded' === res.data.error &&\n\t\t\t\t\t'resolved' !== self.deferred.state()\n\t\t\t\t) {\n\t\t\t\t\t// Show error message.\n\t\t\t\t\tconst bulkWarning = document.getElementById(\n\t\t\t\t\t\t'bulk_smush_warning'\n\t\t\t\t\t);\n\t\t\t\t\tbulkWarning.classList.remove( 'sui-hidden' );\n\n\t\t\t\t\t// Add a data attribute to the Smush button, to stop sending ajax.\n\t\t\t\t\tself.button.attr( 'continue_smush', false );\n\n\t\t\t\t\t// Reinsert the current ID.\n\t\t\t\t\twp_smushit_data.unsmushed.unshift( self.current_id );\n\t\t\t\t\tself.ids.unshift( self.current_id );\n\n\t\t\t\t\tperf = performance.now();\n\t\t\t\t\tself.freeExceeded();\n\t\t\t\t} else if ( self.is_bulk ) {\n\t\t\t\t\tself.updateProgress( res );\n\t\t\t\t} else if ( 0 === self.ids.length ) {\n\t\t\t\t\t// Sync stats anyway.\n\t\t\t\t\tself.syncStats();\n\t\t\t\t}\n\n\t\t\t\tself.singleDone();\n\t\t\t} )\n\t\t\t.always( function() {\n\t\t\t\tif ( ! self.continue() || ! self.is_bulk ) {\n\t\t\t\t\t// Calls deferred.done()\n\t\t\t\t\tself.deferred.resolve();\n\t\t\t\t} else {\n\t\t\t\t\tself.callAjax();\n\t\t\t\t}\n\t\t\t} );\n\n\t\tthis.deferred.errors = this.errors;\n\t\treturn this.deferred;\n\t}\n\n\t/**\n\t * Prepare error row. Will only allow to hide errors for WP media attachments (not nextgen).\n\t *\n\t * @since 1.9.0\n\t *\n\t * @param {string} errorMsg Error message.\n\t * @param {string} fileName File name.\n\t * @param {string} thumbnail Thumbnail for image (if available).\n\t * @param {number} id Image ID.\n\t * @param {string} type Smush type: media or netxgen.\n\t *\n\t * @return {string} Row with error.\n\t */\n\tstatic prepareErrorRow( errorMsg, fileName, thumbnail, id, type ) {\n\t\tconst thumbDiv =\n\t\t\t'undefined' === typeof thumbnail\n\t\t\t\t? '<i class=\"sui-icon-photo-picture\" aria-hidden=\"true\"></i>'\n\t\t\t\t: thumbnail;\n\t\tconst fileLink =\n\t\t\t'undefined' === fileName || 'undefined' === typeof fileName\n\t\t\t\t? 'undefined'\n\t\t\t\t: fileName;\n\n\t\tlet tableDiv =\n\t\t\t'<div class=\"smush-bulk-error-row\">' +\n\t\t\t'<div class=\"smush-bulk-image-data\">' +\n\t\t\tthumbDiv +\n\t\t\t'<span class=\"smush-image-name\">' +\n\t\t\tfileLink +\n\t\t\t'</span>' +\n\t\t\t'<span class=\"smush-image-error\">' +\n\t\t\terrorMsg +\n\t\t\t'</span>' +\n\t\t\t'</div>';\n\n\t\tif ( 'media' === type ) {\n\t\t\ttableDiv =\n\t\t\t\ttableDiv +\n\t\t\t\t'<div class=\"smush-bulk-image-actions\">' +\n\t\t\t\t'<button type=\"button\" class=\"sui-button-icon sui-tooltip sui-tooltip-constrained sui-tooltip-top-right smush-ignore-image\" data-tooltip=\"' +\n\t\t\t\twindow.wp_smush_msgs.error_ignore +\n\t\t\t\t'\" data-id=\"' +\n\t\t\t\tid +\n\t\t\t\t'\">' +\n\t\t\t\t'<i class=\"sui-icon-eye-hide\" aria-hidden=\"true\"></i>' +\n\t\t\t\t'</button>' +\n\t\t\t\t'</div>';\n\t\t}\n\n\t\ttableDiv = tableDiv + '</div>';\n\n\t\treturn tableDiv;\n\t}\n\n\t/**\n\t * Send ajax request for single and bulk Smushing.\n\t */\n\trun() {\n\t\t// If bulk and we have a definite number of IDs.\n\t\tif ( this.is_bulk && this.ids.length > 0 ) {\n\t\t\tthis.callAjax();\n\t\t}\n\n\t\tif ( ! this.is_bulk ) {\n\t\t\tthis.callAjax();\n\t\t}\n\t}\n\n\t/**\n\t * Show bulk Smush errors, and disable bulk Smush button on completion.\n\t */\n\tbindDeferredEvents() {\n\t\tconst self = this;\n\n\t\tthis.deferred.done( function() {\n\t\t\tself.button.removeAttr( 'continue_smush' );\n\n\t\t\tif ( self.errors.length ) {\n\t\t\t\t/** @param {string} wp_smush_msgs.error_in_bulk */\n\t\t\t\tconst msg = window.wp_smush_msgs.error_in_bulk\n\t\t\t\t\t.replace( '{{errors}}', self.errors.length )\n\t\t\t\t\t.replace( '{{total}}', self.total )\n\t\t\t\t\t.replace( '{{smushed}}', self.smushed );\n\n\t\t\t\tjQuery( '.wp-smush-all-done' )\n\t\t\t\t\t.addClass( 'sui-notice-warning' )\n\t\t\t\t\t.removeClass( 'sui-notice-success' )\n\t\t\t\t\t.find( 'p' )\n\t\t\t\t\t.html( msg );\n\t\t\t}\n\n\t\t\tself.bulkDone();\n\n\t\t\t// Re-enable the buttons.\n\t\t\tjQuery(\n\t\t\t\t'.wp-smush-all:not(.wp-smush-finished), .wp-smush-scan'\n\t\t\t).prop('disabled', false);\n\t\t} );\n\t}\n\n\t/**\n\t * Handles the cancel button click.\n\t * Update the UI, and enable the bulk Smush button.\n\t */\n\tcancelAjax() {\n\t\tconst self = this;\n\n\t\tjQuery( '.wp-smush-cancel-bulk' ).on( 'click', function() {\n\t\t\t// Add a data attribute to the Smush button, to stop sending ajax.\n\t\t\tself.button.attr( 'continue_smush', false );\n\t\t\t// Sync and update stats.\n\t\t\tself.syncStats();\n\n\t\t\tself.request.abort();\n\t\t\tself.enableButton();\n\t\t\tself.button.removeClass( 'wp-smush-started' );\n\t\t\twp_smushit_data.unsmushed.unshift( self.current_id );\n\t\t\tjQuery( '.wp-smush-bulk-wrapper' ).removeClass( 'sui-hidden' );\n\n\t\t\t// Hide the progress bar.\n\t\t\tjQuery( '.wp-smush-bulk-progress-bar-wrapper' ).addClass( 'sui-hidden' );\n\t\t} );\n\t}\n\n\t/**\n\t * Remove the current ID from the unSmushed/re-Smush variable.\n\t *\n\t * @param {number} currentId\n\t */\n\tstatic updateSmushIds( currentId ) {\n\t\tif (\n\t\t\t'undefined' !== typeof wp_smushit_data.unsmushed &&\n\t\t\twp_smushit_data.unsmushed.length > 0\n\t\t) {\n\t\t\tconst uIndex = wp_smushit_data.unsmushed.indexOf( currentId );\n\t\t\tif ( uIndex > -1 ) {\n\t\t\t\twp_smushit_data.unsmushed.splice( uIndex, 1 );\n\t\t\t}\n\t\t}\n\n\t\t// Remove from the re-Smush list.\n\t\tif (\n\t\t\t'undefined' !== typeof wp_smushit_data.resmush &&\n\t\t\twp_smushit_data.resmush.length > 0\n\t\t) {\n\t\t\tconst index = wp_smushit_data.resmush.indexOf( currentId );\n\t\t\tif ( index > -1 ) {\n\t\t\t\twp_smushit_data.resmush.splice( index, 1 );\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport default Smush;\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * WebP functionality.\n *\n * @since 3.8.0\n */\n\n(function () {\n\t'use strict';\n\n\tWP_Smush.WebP = {\n\t\tnonceField: document.getElementsByName('wp_smush_options_nonce'),\n\t\ttoggleModuleButton: document.getElementById('smush-toggle-webp-button'),\n\t\trecheckStatusButton: document.getElementById('smush-webp-recheck'),\n\t\trecheckStatusLink: document.getElementById('smush-webp-recheck-link'),\n\t\tshowWizardButton: document.getElementById('smush-webp-toggle-wizard'),\n\n\t\tinit() {\n\t\t\tthis.maybeShowDeleteAllSuccessNotice();\n\n\t\t\t/**\n\t\t\t * Handles the \"Deactivate\" and \"Get Started\" buttons on the WebP page.\n\t\t\t */\n\t\t\tif (this.toggleModuleButton) {\n\t\t\t\tthis.toggleModuleButton.addEventListener('click', (e) =>\n\t\t\t\t\tthis.toggleWebp(e)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handle \"RE-CHECK STATUS' button click on WebP page.\n\t\t\t */\n\t\t\tif (this.recheckStatusButton) {\n\t\t\t\tthis.recheckStatusButton.addEventListener('click', (e) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tthis.recheckStatus();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handle \"RE-CHECK STATUS' link click on WebP page.\n\t\t\t */\n\t\t\tif (this.recheckStatusLink) {\n\t\t\t\tthis.recheckStatusLink.addEventListener('click', (e) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tthis.recheckStatus();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles the \"Delete WebP images\" button.\n\t\t\t */\n\t\t\tif (document.getElementById('wp-smush-webp-delete-all')) {\n\t\t\t\tdocument\n\t\t\t\t\t.getElementById('wp-smush-webp-delete-all')\n\t\t\t\t\t.addEventListener('click', (e) => this.deleteAll(e));\n\t\t\t}\n\n\t\t\tif (this.showWizardButton) {\n\t\t\t\tthis.showWizardButton.addEventListener(\n\t\t\t\t\t'click',\n\t\t\t\t\tthis.toggleWizard\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Toggle WebP module.\n\t\t *\n\t\t * @param {Event} e\n\t\t */\n\t\ttoggleWebp(e) {\n\t\t\te.preventDefault();\n\n\t\t\tconst button = e.currentTarget,\n\t\t\t\tdoEnable = 'enable' === button.dataset.action;\n\n\t\t\tbutton.classList.add('sui-button-onload');\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', ajaxurl + '?action=smush_webp_toggle', true);\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\n\t\t\txhr.onload = () => {\n\t\t\t\tconst res = JSON.parse(xhr.response);\n\n\t\t\t\tif (200 === xhr.status) {\n\t\t\t\t\tif ('undefined' !== typeof res.success && res.success) {\n\t\t\t\t\t\tconst scanPromise = this.runScan();\n\t\t\t\t\t\tscanPromise.onload = () => {\n\t\t\t\t\t\t\twindow.location.href =\n\t\t\t\t\t\t\t\twindow.wp_smush_msgs.localWebpURL;\n\t\t\t\t\t\t};\n\t\t\t\t\t} else if ('undefined' !== typeof res.data.message) {\n\t\t\t\t\t\tthis.showNotice(res.data.message);\n\t\t\t\t\t\tbutton.classList.remove('sui-button-onload');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlet message = window.wp_smush_msgs.generic_ajax_error;\n\t\t\t\t\tif (res && 'undefined' !== typeof res.data.message) {\n\t\t\t\t\t\tmessage = res.data.message;\n\t\t\t\t\t}\n\t\t\t\t\tthis.showNotice(message);\n\t\t\t\t\tbutton.classList.remove('sui-button-onload');\n\t\t\t\t}\n\t\t\t};\n\n\t\t\txhr.send(\n\t\t\t\t'param=' + doEnable + '&_ajax_nonce=' + this.nonceField[0].value\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * re-check server configuration for WebP.\n\t\t */\n\t\trecheckStatus() {\n\t\t\tthis.recheckStatusButton.classList.add('sui-button-onload');\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', ajaxurl + '?action=smush_webp_get_status', true);\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tthis.recheckStatusButton.classList.remove('sui-button-onload');\n\t\t\t\tlet message = false;\n\t\t\t\tconst res = JSON.parse(xhr.response);\n\t\t\t\tif (200 === xhr.status) {\n\t\t\t\t\tconst isConfigured = res.success ? '1' : '0';\n\t\t\t\t\tif (\n\t\t\t\t\t\tisConfigured !==\n\t\t\t\t\t\tthis.recheckStatusButton.dataset.isConfigured\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Reload the page when the configuration status changed.\n\t\t\t\t\t\tlocation.reload();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmessage = window.wp_smush_msgs.generic_ajax_error;\n\t\t\t\t}\n\n\t\t\t\tif (res && res.data) {\n\t\t\t\t\tmessage = res.data;\n\t\t\t\t}\n\n\t\t\t\tif (message) {\n\t\t\t\t\tthis.showNotice(message);\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send('_ajax_nonce=' + window.wp_smush_msgs.webp_nonce);\n\t\t},\n\n\t\tdeleteAll(e) {\n\t\t\tconst button = e.currentTarget;\n\t\t\tbutton.classList.add('sui-button-onload');\n\n\t\t\tlet message = false;\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', ajaxurl + '?action=smush_webp_delete_all', true);\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\n\t\t\txhr.onload = () => {\n\t\t\t\tconst res = JSON.parse(xhr.response);\n\t\t\t\tif (200 === xhr.status) {\n\t\t\t\t\tif ('undefined' !== typeof res.success && res.success) {\n\t\t\t\t\t\tconst scanPromise = this.runScan();\n\t\t\t\t\t\tscanPromise.onload = () => {\n\t\t\t\t\t\t\tlocation.search =\n\t\t\t\t\t\t\t\tlocation.search + '&notice=webp-deleted';\n\t\t\t\t\t\t};\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmessage = window.wp_smush_msgs.generic_ajax_error;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmessage = window.wp_smush_msgs.generic_ajax_error;\n\t\t\t\t}\n\n\t\t\t\tif (res && res.data && res.data.message) {\n\t\t\t\t\tmessage = res.data.message;\n\t\t\t\t}\n\n\t\t\t\tif (message) {\n\t\t\t\t\tbutton.classList.remove('sui-button-onload');\n\n\t\t\t\t\tconst noticeMessage = `<p style=\"text-align: left;\">${message}</p>`;\n\t\t\t\t\tconst noticeOptions = {\n\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\ticon: 'info',\n\t\t\t\t\t\tautoclose: {\n\t\t\t\t\t\t\tshow: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\n\t\t\t\t\twindow.SUI.openNotice(\n\t\t\t\t\t\t'wp-smush-webp-delete-all-error-notice',\n\t\t\t\t\t\tnoticeMessage,\n\t\t\t\t\t\tnoticeOptions\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\txhr.send('_ajax_nonce=' + this.nonceField[0].value);\n\t\t},\n\n\t\ttoggleWizard(e) {\n\t\t\te.currentTarget.classList.add('sui-button-onload');\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open(\n\t\t\t\t'GET',\n\t\t\t\tajaxurl +\n\t\t\t\t\t'?action=smush_toggle_webp_wizard&_ajax_nonce=' +\n\t\t\t\t\twindow.wp_smush_msgs.webp_nonce,\n\t\t\t\ttrue\n\t\t\t);\n\t\t\txhr.onload = () => location.reload();\n\t\t\txhr.send();\n\t\t},\n\n\t\t/**\n\t\t * Triggers the scanning of images for updating the images to re-smush.\n\t\t *\n\t\t * @since 3.8.0\n\t\t */\n\t\trunScan() {\n\t\t\tconst xhr = new XMLHttpRequest(),\n\t\t\t\tnonceField = document.getElementsByName(\n\t\t\t\t\t'wp_smush_options_nonce'\n\t\t\t\t);\n\n\t\t\txhr.open('POST', ajaxurl + '?action=scan_for_resmush', true);\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\n\t\t\txhr.send('_ajax_nonce=' + nonceField[0].value);\n\n\t\t\treturn xhr;\n\t\t},\n\n\t\t/**\n\t\t * Show message (notice).\n\t\t *\n\t\t * @param {string} message\n\t\t * @param {string} type\n\t\t */\n\t\tshowNotice(message, type) {\n\t\t\tif ('undefined' === typeof message) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst noticeMessage = `<p>${message}</p>`;\n\t\t\tconst noticeOptions = {\n\t\t\t\ttype: type || 'error',\n\t\t\t\ticon: 'info',\n\t\t\t\tdismiss: {\n\t\t\t\t\tshow: true,\n\t\t\t\t\tlabel: window.wp_smush_msgs.noticeDismiss,\n\t\t\t\t\ttooltip: window.wp_smush_msgs.noticeDismissTooltip,\n\t\t\t\t},\n\t\t\t\tautoclose: {\n\t\t\t\t\tshow: false,\n\t\t\t\t},\n\t\t\t};\n\n\t\t\twindow.SUI.openNotice(\n\t\t\t\t'wp-smush-ajax-notice',\n\t\t\t\tnoticeMessage,\n\t\t\t\tnoticeOptions\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Show delete all webp success notice.\n\t\t */\n\t\tmaybeShowDeleteAllSuccessNotice() {\n\t\t\tif (!document.getElementById('wp-smush-webp-delete-all-notice')) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst noticeMessage = `<p>${\n\t\t\t\tdocument.getElementById('wp-smush-webp-delete-all-notice')\n\t\t\t\t\t.dataset.message\n\t\t\t}</p>`;\n\n\t\t\tconst noticeOptions = {\n\t\t\t\ttype: 'success',\n\t\t\t\ticon: 'check-tick',\n\t\t\t\tdismiss: {\n\t\t\t\t\tshow: true,\n\t\t\t\t},\n\t\t\t};\n\n\t\t\twindow.SUI.openNotice(\n\t\t\t\t'wp-smush-webp-delete-all-notice',\n\t\t\t\tnoticeMessage,\n\t\t\t\tnoticeOptions\n\t\t\t);\n\t\t},\n\t};\n\n\tWP_Smush.WebP.init();\n})();\n","/*!\n * jquery.fancytree.js\n * Tree view control with support for lazy loading and much more.\n * https://github.com/mar10/fancytree/\n *\n * Copyright (c) 2008-2021, Martin Wendt (https://wwWendt.de)\n * Released under the MIT license\n * https://github.com/mar10/fancytree/wiki/LicenseInfo\n *\n * @version 2.38.1-0\n * @date 2021-09-09T01:07:22Z\n */\n\n/** Core Fancytree module.\n */\n\n// UMD wrapper for the Fancytree core module\n(function (factory) {\n\tif (typeof define === \"function\" && define.amd) {\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine([\"jquery\", \"./jquery.fancytree.ui-deps\"], factory);\n\t} else if (typeof module === \"object\" && module.exports) {\n\t\t// Node/CommonJS\n\t\trequire(\"./jquery.fancytree.ui-deps\");\n\t\tmodule.exports = factory(require(\"jquery\"));\n\t} else {\n\t\t// Browser globals\n\t\tfactory(jQuery);\n\t}\n})(function ($) {\n\t\"use strict\";\n\n\t// prevent duplicate loading\n\tif ($.ui && $.ui.fancytree) {\n\t\t$.ui.fancytree.warn(\"Fancytree: ignored duplicate include\");\n\t\treturn;\n\t}\n\n\t/******************************************************************************\n\t * Private functions and variables\n\t */\n\n\tvar i,\n\t\tattr,\n\t\tFT = null, // initialized below\n\t\tTEST_IMG = new RegExp(/\\.|\\//), // strings are considered image urls if they contain '.' or '/'\n\t\tREX_HTML = /[&<>\"'/]/g, // Escape those characters\n\t\tREX_TOOLTIP = /[<>\"'/]/g, // Don't escape `&` in tooltips\n\t\tRECURSIVE_REQUEST_ERROR = \"$recursive_request\",\n\t\tINVALID_REQUEST_TARGET_ERROR = \"$request_target_invalid\",\n\t\tENTITY_MAP = {\n\t\t\t\"&\": \"&amp;\",\n\t\t\t\"<\": \"&lt;\",\n\t\t\t\">\": \"&gt;\",\n\t\t\t'\"': \"&quot;\",\n\t\t\t\"'\": \"&#39;\",\n\t\t\t\"/\": \"&#x2F;\",\n\t\t},\n\t\tIGNORE_KEYCODES = { 16: true, 17: true, 18: true },\n\t\tSPECIAL_KEYCODES = {\n\t\t\t8: \"backspace\",\n\t\t\t9: \"tab\",\n\t\t\t10: \"return\",\n\t\t\t13: \"return\",\n\t\t\t// 16: null, 17: null, 18: null, // ignore shift, ctrl, alt\n\t\t\t19: \"pause\",\n\t\t\t20: \"capslock\",\n\t\t\t27: \"esc\",\n\t\t\t32: \"space\",\n\t\t\t33: \"pageup\",\n\t\t\t34: \"pagedown\",\n\t\t\t35: \"end\",\n\t\t\t36: \"home\",\n\t\t\t37: \"left\",\n\t\t\t38: \"up\",\n\t\t\t39: \"right\",\n\t\t\t40: \"down\",\n\t\t\t45: \"insert\",\n\t\t\t46: \"del\",\n\t\t\t59: \";\",\n\t\t\t61: \"=\",\n\t\t\t// 91: null, 93: null, // ignore left and right meta\n\t\t\t96: \"0\",\n\t\t\t97: \"1\",\n\t\t\t98: \"2\",\n\t\t\t99: \"3\",\n\t\t\t100: \"4\",\n\t\t\t101: \"5\",\n\t\t\t102: \"6\",\n\t\t\t103: \"7\",\n\t\t\t104: \"8\",\n\t\t\t105: \"9\",\n\t\t\t106: \"*\",\n\t\t\t107: \"+\",\n\t\t\t109: \"-\",\n\t\t\t110: \".\",\n\t\t\t111: \"/\",\n\t\t\t112: \"f1\",\n\t\t\t113: \"f2\",\n\t\t\t114: \"f3\",\n\t\t\t115: \"f4\",\n\t\t\t116: \"f5\",\n\t\t\t117: \"f6\",\n\t\t\t118: \"f7\",\n\t\t\t119: \"f8\",\n\t\t\t120: \"f9\",\n\t\t\t121: \"f10\",\n\t\t\t122: \"f11\",\n\t\t\t123: \"f12\",\n\t\t\t144: \"numlock\",\n\t\t\t145: \"scroll\",\n\t\t\t173: \"-\",\n\t\t\t186: \";\",\n\t\t\t187: \"=\",\n\t\t\t188: \",\",\n\t\t\t189: \"-\",\n\t\t\t190: \".\",\n\t\t\t191: \"/\",\n\t\t\t192: \"`\",\n\t\t\t219: \"[\",\n\t\t\t220: \"\\\\\",\n\t\t\t221: \"]\",\n\t\t\t222: \"'\",\n\t\t},\n\t\tMODIFIERS = {\n\t\t\t16: \"shift\",\n\t\t\t17: \"ctrl\",\n\t\t\t18: \"alt\",\n\t\t\t91: \"meta\",\n\t\t\t93: \"meta\",\n\t\t},\n\t\tMOUSE_BUTTONS = { 0: \"\", 1: \"left\", 2: \"middle\", 3: \"right\" },\n\t\t// Boolean attributes that can be set with equivalent class names in the LI tags\n\t\t// Note: v2.23: checkbox and hideCheckbox are *not* in this list\n\t\tCLASS_ATTRS =\n\t\t\t\"active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore\".split(\n\t\t\t\t\" \"\n\t\t\t),\n\t\tCLASS_ATTR_MAP = {},\n\t\t// Top-level Fancytree attributes, that can be set by dict\n\t\tTREE_ATTRS = \"columns types\".split(\" \"),\n\t\t// TREE_ATTR_MAP = {},\n\t\t// Top-level FancytreeNode attributes, that can be set by dict\n\t\tNODE_ATTRS =\n\t\t\t\"checkbox expanded extraClasses folder icon iconTooltip key lazy partsel radiogroup refKey selected statusNodeType title tooltip type unselectable unselectableIgnore unselectableStatus\".split(\n\t\t\t\t\" \"\n\t\t\t),\n\t\tNODE_ATTR_MAP = {},\n\t\t// Mapping of lowercase -> real name (because HTML5 data-... attribute only supports lowercase)\n\t\tNODE_ATTR_LOWERCASE_MAP = {},\n\t\t// Attribute names that should NOT be added to node.data\n\t\tNONE_NODE_DATA_MAP = {\n\t\t\tactive: true,\n\t\t\tchildren: true,\n\t\t\tdata: true,\n\t\t\tfocus: true,\n\t\t};\n\n\tfor (i = 0; i < CLASS_ATTRS.length; i++) {\n\t\tCLASS_ATTR_MAP[CLASS_ATTRS[i]] = true;\n\t}\n\tfor (i = 0; i < NODE_ATTRS.length; i++) {\n\t\tattr = NODE_ATTRS[i];\n\t\tNODE_ATTR_MAP[attr] = true;\n\t\tif (attr !== attr.toLowerCase()) {\n\t\t\tNODE_ATTR_LOWERCASE_MAP[attr.toLowerCase()] = attr;\n\t\t}\n\t}\n\t// for(i=0; i<TREE_ATTRS.length; i++) {\n\t// \tTREE_ATTR_MAP[TREE_ATTRS[i]] = true;\n\t// }\n\n\tfunction _assert(cond, msg) {\n\t\t// TODO: see qunit.js extractStacktrace()\n\t\tif (!cond) {\n\t\t\tmsg = msg ? \": \" + msg : \"\";\n\t\t\tmsg = \"Fancytree assertion failed\" + msg;\n\n\t\t\t// consoleApply(\"assert\", [!!cond, msg]);\n\n\t\t\t// #1041: Raised exceptions may not be visible in the browser\n\t\t\t// console if inside promise chains, so we also print directly:\n\t\t\t$.ui.fancytree.error(msg);\n\n\t\t\t// Throw exception:\n\t\t\t$.error(msg);\n\t\t}\n\t}\n\n\tfunction _hasProp(object, property) {\n\t\treturn Object.prototype.hasOwnProperty.call(object, property);\n\t}\n\n\t/* Replacement for the deprecated `jQuery.isFunction()`. */\n\tfunction _isFunction(obj) {\n\t\treturn typeof obj === \"function\";\n\t}\n\n\t/* Replacement for the deprecated `jQuery.trim()`. */\n\tfunction _trim(text) {\n\t\treturn text == null ? \"\" : text.trim();\n\t}\n\n\t/* Replacement for the deprecated `jQuery.isArray()`. */\n\tvar _isArray = Array.isArray;\n\n\t_assert($.ui, \"Fancytree requires jQuery UI (http://jqueryui.com)\");\n\n\tfunction consoleApply(method, args) {\n\t\tvar i,\n\t\t\ts,\n\t\t\tfn = window.console ? window.console[method] : null;\n\n\t\tif (fn) {\n\t\t\ttry {\n\t\t\t\tfn.apply(window.console, args);\n\t\t\t} catch (e) {\n\t\t\t\t// IE 8?\n\t\t\t\ts = \"\";\n\t\t\t\tfor (i = 0; i < args.length; i++) {\n\t\t\t\t\ts += args[i];\n\t\t\t\t}\n\t\t\t\tfn(s);\n\t\t\t}\n\t\t}\n\t}\n\n\t/* support: IE8 Polyfil for Date.now() */\n\tif (!Date.now) {\n\t\tDate.now = function now() {\n\t\t\treturn new Date().getTime();\n\t\t};\n\t}\n\n\t/*Return true if x is a FancytreeNode.*/\n\tfunction _isNode(x) {\n\t\treturn !!(x.tree && x.statusNodeType !== undefined);\n\t}\n\n\t/** Return true if dotted version string is equal or higher than requested version.\n\t *\n\t * See http://jsfiddle.net/mar10/FjSAN/\n\t */\n\tfunction isVersionAtLeast(dottedVersion, major, minor, patch) {\n\t\tvar i,\n\t\t\tv,\n\t\t\tt,\n\t\t\tverParts = $.map(_trim(dottedVersion).split(\".\"), function (e) {\n\t\t\t\treturn parseInt(e, 10);\n\t\t\t}),\n\t\t\ttestParts = $.map(\n\t\t\t\tArray.prototype.slice.call(arguments, 1),\n\t\t\t\tfunction (e) {\n\t\t\t\t\treturn parseInt(e, 10);\n\t\t\t\t}\n\t\t\t);\n\n\t\tfor (i = 0; i < testParts.length; i++) {\n\t\t\tv = verParts[i] || 0;\n\t\t\tt = testParts[i] || 0;\n\t\t\tif (v !== t) {\n\t\t\t\treturn v > t;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Deep-merge a list of objects (but replace array-type options).\n\t *\n\t * jQuery's $.extend(true, ...) method does a deep merge, that also merges Arrays.\n\t * This variant is used to merge extension defaults with user options, and should\n\t * merge objects, but override arrays (for example the `triggerStart: [...]` option\n\t * of ext-edit). Also `null` values are copied over and not skipped.\n\t *\n\t * See issue #876\n\t *\n\t * Example:\n\t * _simpleDeepMerge({}, o1, o2);\n\t */\n\tfunction _simpleDeepMerge() {\n\t\tvar options,\n\t\t\tname,\n\t\t\tsrc,\n\t\t\tcopy,\n\t\t\tclone,\n\t\t\ttarget = arguments[0] || {},\n\t\t\ti = 1,\n\t\t\tlength = arguments.length;\n\n\t\t// Handle case when target is a string or something (possible in deep copy)\n\t\tif (typeof target !== \"object\" && !_isFunction(target)) {\n\t\t\ttarget = {};\n\t\t}\n\t\tif (i === length) {\n\t\t\tthrow Error(\"need at least two args\");\n\t\t}\n\t\tfor (; i < length; i++) {\n\t\t\t// Only deal with non-null/undefined values\n\t\t\tif ((options = arguments[i]) != null) {\n\t\t\t\t// Extend the base object\n\t\t\t\tfor (name in options) {\n\t\t\t\t\tif (_hasProp(options, name)) {\n\t\t\t\t\t\tsrc = target[name];\n\t\t\t\t\t\tcopy = options[name];\n\t\t\t\t\t\t// Prevent never-ending loop\n\t\t\t\t\t\tif (target === copy) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Recurse if we're merging plain objects\n\t\t\t\t\t\t// (NOTE: unlike $.extend, we don't merge arrays, but replace them)\n\t\t\t\t\t\tif (copy && $.isPlainObject(copy)) {\n\t\t\t\t\t\t\tclone = src && $.isPlainObject(src) ? src : {};\n\t\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\t\ttarget[name] = _simpleDeepMerge(clone, copy);\n\t\t\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t\t} else if (copy !== undefined) {\n\t\t\t\t\t\t\ttarget[name] = copy;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Return the modified object\n\t\treturn target;\n\t}\n\n\t/** Return a wrapper that calls sub.methodName() and exposes\n\t * this : tree\n\t * this._local : tree.ext.EXTNAME\n\t * this._super : base.methodName.call()\n\t * this._superApply : base.methodName.apply()\n\t */\n\tfunction _makeVirtualFunction(methodName, tree, base, extension, extName) {\n\t\t// $.ui.fancytree.debug(\"_makeVirtualFunction\", methodName, tree, base, extension, extName);\n\t\t// if(rexTestSuper && !rexTestSuper.test(func)){\n\t\t// // extension.methodName() doesn't call _super(), so no wrapper required\n\t\t// return func;\n\t\t// }\n\t\t// Use an immediate function as closure\n\t\tvar proxy = (function () {\n\t\t\tvar prevFunc = tree[methodName], // org. tree method or prev. proxy\n\t\t\t\tbaseFunc = extension[methodName], //\n\t\t\t\t_local = tree.ext[extName],\n\t\t\t\t_super = function () {\n\t\t\t\t\treturn prevFunc.apply(tree, arguments);\n\t\t\t\t},\n\t\t\t\t_superApply = function (args) {\n\t\t\t\t\treturn prevFunc.apply(tree, args);\n\t\t\t\t};\n\n\t\t\t// Return the wrapper function\n\t\t\treturn function () {\n\t\t\t\tvar prevLocal = tree._local,\n\t\t\t\t\tprevSuper = tree._super,\n\t\t\t\t\tprevSuperApply = tree._superApply;\n\n\t\t\t\ttry {\n\t\t\t\t\ttree._local = _local;\n\t\t\t\t\ttree._super = _super;\n\t\t\t\t\ttree._superApply = _superApply;\n\t\t\t\t\treturn baseFunc.apply(tree, arguments);\n\t\t\t\t} finally {\n\t\t\t\t\ttree._local = prevLocal;\n\t\t\t\t\ttree._super = prevSuper;\n\t\t\t\t\ttree._superApply = prevSuperApply;\n\t\t\t\t}\n\t\t\t};\n\t\t})(); // end of Immediate Function\n\t\treturn proxy;\n\t}\n\n\t/**\n\t * Subclass `base` by creating proxy functions\n\t */\n\tfunction _subclassObject(tree, base, extension, extName) {\n\t\t// $.ui.fancytree.debug(\"_subclassObject\", tree, base, extension, extName);\n\t\tfor (var attrName in extension) {\n\t\t\tif (typeof extension[attrName] === \"function\") {\n\t\t\t\tif (typeof tree[attrName] === \"function\") {\n\t\t\t\t\t// override existing method\n\t\t\t\t\ttree[attrName] = _makeVirtualFunction(\n\t\t\t\t\t\tattrName,\n\t\t\t\t\t\ttree,\n\t\t\t\t\t\tbase,\n\t\t\t\t\t\textension,\n\t\t\t\t\t\textName\n\t\t\t\t\t);\n\t\t\t\t} else if (attrName.charAt(0) === \"_\") {\n\t\t\t\t\t// Create private methods in tree.ext.EXTENSION namespace\n\t\t\t\t\ttree.ext[extName][attrName] = _makeVirtualFunction(\n\t\t\t\t\t\tattrName,\n\t\t\t\t\t\ttree,\n\t\t\t\t\t\tbase,\n\t\t\t\t\t\textension,\n\t\t\t\t\t\textName\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$.error(\n\t\t\t\t\t\t\"Could not override tree.\" +\n\t\t\t\t\t\t\tattrName +\n\t\t\t\t\t\t\t\". Use prefix '_' to create tree.\" +\n\t\t\t\t\t\t\textName +\n\t\t\t\t\t\t\t\"._\" +\n\t\t\t\t\t\t\tattrName\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Create member variables in tree.ext.EXTENSION namespace\n\t\t\t\tif (attrName !== \"options\") {\n\t\t\t\t\ttree.ext[extName][attrName] = extension[attrName];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction _getResolvedPromise(context, argArray) {\n\t\tif (context === undefined) {\n\t\t\treturn $.Deferred(function () {\n\t\t\t\tthis.resolve();\n\t\t\t}).promise();\n\t\t}\n\t\treturn $.Deferred(function () {\n\t\t\tthis.resolveWith(context, argArray);\n\t\t}).promise();\n\t}\n\n\tfunction _getRejectedPromise(context, argArray) {\n\t\tif (context === undefined) {\n\t\t\treturn $.Deferred(function () {\n\t\t\t\tthis.reject();\n\t\t\t}).promise();\n\t\t}\n\t\treturn $.Deferred(function () {\n\t\t\tthis.rejectWith(context, argArray);\n\t\t}).promise();\n\t}\n\n\tfunction _makeResolveFunc(deferred, context) {\n\t\treturn function () {\n\t\t\tdeferred.resolveWith(context);\n\t\t};\n\t}\n\n\tfunction _getElementDataAsDict($el) {\n\t\t// Evaluate 'data-NAME' attributes with special treatment for 'data-json'.\n\t\tvar d = $.extend({}, $el.data()),\n\t\t\tjson = d.json;\n\n\t\tdelete d.fancytree; // added to container by widget factory (old jQuery UI)\n\t\tdelete d.uiFancytree; // added to container by widget factory\n\n\t\tif (json) {\n\t\t\tdelete d.json;\n\t\t\t// <li data-json='...'> is already returned as object (http://api.jquery.com/data/#data-html5)\n\t\t\td = $.extend(d, json);\n\t\t}\n\t\treturn d;\n\t}\n\n\tfunction _escapeTooltip(s) {\n\t\treturn (\"\" + s).replace(REX_TOOLTIP, function (s) {\n\t\t\treturn ENTITY_MAP[s];\n\t\t});\n\t}\n\n\t// TODO: use currying\n\tfunction _makeNodeTitleMatcher(s) {\n\t\ts = s.toLowerCase();\n\t\treturn function (node) {\n\t\t\treturn node.title.toLowerCase().indexOf(s) >= 0;\n\t\t};\n\t}\n\n\tfunction _makeNodeTitleStartMatcher(s) {\n\t\tvar reMatch = new RegExp(\"^\" + s, \"i\");\n\t\treturn function (node) {\n\t\t\treturn reMatch.test(node.title);\n\t\t};\n\t}\n\n\t/******************************************************************************\n\t * FancytreeNode\n\t */\n\n\t/**\n\t * Creates a new FancytreeNode\n\t *\n\t * @class FancytreeNode\n\t * @classdesc A FancytreeNode represents the hierarchical data model and operations.\n\t *\n\t * @param {FancytreeNode} parent\n\t * @param {NodeData} obj\n\t *\n\t * @property {Fancytree} tree The tree instance\n\t * @property {FancytreeNode} parent The parent node\n\t * @property {string} key Node id (must be unique inside the tree)\n\t * @property {string} title Display name (may contain HTML)\n\t * @property {object} data Contains all extra data that was passed on node creation\n\t * @property {FancytreeNode[] | null | undefined} children Array of child nodes.<br>\n\t * For lazy nodes, null or undefined means 'not yet loaded'. Use an empty array\n\t * to define a node that has no children.\n\t * @property {boolean} expanded Use isExpanded(), setExpanded() to access this property.\n\t * @property {string} extraClasses Additional CSS classes, added to the node's `<span>`.<br>\n\t * Note: use `node.add/remove/toggleClass()` to modify.\n\t * @property {boolean} folder Folder nodes have different default icons and click behavior.<br>\n\t * Note: Also non-folders may have children.\n\t * @property {string} statusNodeType null for standard nodes. Otherwise type of special system node: 'error', 'loading', 'nodata', or 'paging'.\n\t * @property {boolean} lazy True if this node is loaded on demand, i.e. on first expansion.\n\t * @property {boolean} selected Use isSelected(), setSelected() to access this property.\n\t * @property {string} tooltip Alternative description used as hover popup\n\t * @property {string} iconTooltip Description used as hover popup for icon. @since 2.27\n\t * @property {string} type Node type, used with tree.types map. @since 2.27\n\t */\n\tfunction FancytreeNode(parent, obj) {\n\t\tvar i, l, name, cl;\n\n\t\tthis.parent = parent;\n\t\tthis.tree = parent.tree;\n\t\tthis.ul = null;\n\t\tthis.li = null; // <li id='key' ftnode=this> tag\n\t\tthis.statusNodeType = null; // if this is a temp. node to display the status of its parent\n\t\tthis._isLoading = false; // if this node itself is loading\n\t\tthis._error = null; // {message: '...'} if a load error occurred\n\t\tthis.data = {};\n\n\t\t// TODO: merge this code with node.toDict()\n\t\t// copy attributes from obj object\n\t\tfor (i = 0, l = NODE_ATTRS.length; i < l; i++) {\n\t\t\tname = NODE_ATTRS[i];\n\t\t\tthis[name] = obj[name];\n\t\t}\n\t\t// unselectableIgnore and unselectableStatus imply unselectable\n\t\tif (\n\t\t\tthis.unselectableIgnore != null ||\n\t\t\tthis.unselectableStatus != null\n\t\t) {\n\t\t\tthis.unselectable = true;\n\t\t}\n\t\tif (obj.hideCheckbox) {\n\t\t\t$.error(\n\t\t\t\t\"'hideCheckbox' node option was removed in v2.23.0: use 'checkbox: false'\"\n\t\t\t);\n\t\t}\n\t\t// node.data += obj.data\n\t\tif (obj.data) {\n\t\t\t$.extend(this.data, obj.data);\n\t\t}\n\t\t// Copy all other attributes to this.data.NAME\n\t\tfor (name in obj) {\n\t\t\tif (\n\t\t\t\t!NODE_ATTR_MAP[name] &&\n\t\t\t\t(this.tree.options.copyFunctionsToData ||\n\t\t\t\t\t!_isFunction(obj[name])) &&\n\t\t\t\t!NONE_NODE_DATA_MAP[name]\n\t\t\t) {\n\t\t\t\t// node.data.NAME = obj.NAME\n\t\t\t\tthis.data[name] = obj[name];\n\t\t\t}\n\t\t}\n\n\t\t// Fix missing key\n\t\tif (this.key == null) {\n\t\t\t// test for null OR undefined\n\t\t\tif (this.tree.options.defaultKey) {\n\t\t\t\tthis.key = \"\" + this.tree.options.defaultKey(this);\n\t\t\t\t_assert(this.key, \"defaultKey() must return a unique key\");\n\t\t\t} else {\n\t\t\t\tthis.key = \"_\" + FT._nextNodeKey++;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.key = \"\" + this.key; // Convert to string (#217)\n\t\t}\n\n\t\t// Fix tree.activeNode\n\t\t// TODO: not elegant: we use obj.active as marker to set tree.activeNode\n\t\t// when loading from a dictionary.\n\t\tif (obj.active) {\n\t\t\t_assert(\n\t\t\t\tthis.tree.activeNode === null,\n\t\t\t\t\"only one active node allowed\"\n\t\t\t);\n\t\t\tthis.tree.activeNode = this;\n\t\t}\n\t\tif (obj.selected) {\n\t\t\t// #186\n\t\t\tthis.tree.lastSelectedNode = this;\n\t\t}\n\t\t// TODO: handle obj.focus = true\n\n\t\t// Create child nodes\n\t\tcl = obj.children;\n\t\tif (cl) {\n\t\t\tif (cl.length) {\n\t\t\t\tthis._setChildren(cl);\n\t\t\t} else {\n\t\t\t\t// if an empty array was passed for a lazy node, keep it, in order to mark it 'loaded'\n\t\t\t\tthis.children = this.lazy ? [] : null;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.children = null;\n\t\t}\n\t\t// Add to key/ref map (except for root node)\n\t\t//\tif( parent ) {\n\t\tthis.tree._callHook(\"treeRegisterNode\", this.tree, true, this);\n\t\t//\t}\n\t}\n\n\tFancytreeNode.prototype = /** @lends FancytreeNode# */ {\n\t\t/* Return the direct child FancytreeNode with a given key, index. */\n\t\t_findDirectChild: function (ptr) {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tcl = this.children;\n\n\t\t\tif (cl) {\n\t\t\t\tif (typeof ptr === \"string\") {\n\t\t\t\t\tfor (i = 0, l = cl.length; i < l; i++) {\n\t\t\t\t\t\tif (cl[i].key === ptr) {\n\t\t\t\t\t\t\treturn cl[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (typeof ptr === \"number\") {\n\t\t\t\t\treturn this.children[ptr];\n\t\t\t\t} else if (ptr.parent === this) {\n\t\t\t\t\treturn ptr;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\t// TODO: activate()\n\t\t// TODO: activateSilently()\n\t\t/* Internal helper called in recursive addChildren sequence.*/\n\t\t_setChildren: function (children) {\n\t\t\t_assert(\n\t\t\t\tchildren && (!this.children || this.children.length === 0),\n\t\t\t\t\"only init supported\"\n\t\t\t);\n\t\t\tthis.children = [];\n\t\t\tfor (var i = 0, l = children.length; i < l; i++) {\n\t\t\t\tthis.children.push(new FancytreeNode(this, children[i]));\n\t\t\t}\n\t\t\tthis.tree._callHook(\n\t\t\t\t\"treeStructureChanged\",\n\t\t\t\tthis.tree,\n\t\t\t\t\"setChildren\"\n\t\t\t);\n\t\t},\n\t\t/**\n\t\t * Append (or insert) a list of child nodes.\n\t\t *\n\t\t * @param {NodeData[]} children array of child node definitions (also single child accepted)\n\t\t * @param {FancytreeNode | string | Integer} [insertBefore] child node (or key or index of such).\n\t\t * If omitted, the new children are appended.\n\t\t * @returns {FancytreeNode} first child added\n\t\t *\n\t\t * @see FancytreeNode#applyPatch\n\t\t */\n\t\taddChildren: function (children, insertBefore) {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tpos,\n\t\t\t\torigFirstChild = this.getFirstChild(),\n\t\t\t\torigLastChild = this.getLastChild(),\n\t\t\t\tfirstNode = null,\n\t\t\t\tnodeList = [];\n\n\t\t\tif ($.isPlainObject(children)) {\n\t\t\t\tchildren = [children];\n\t\t\t}\n\t\t\tif (!this.children) {\n\t\t\t\tthis.children = [];\n\t\t\t}\n\t\t\tfor (i = 0, l = children.length; i < l; i++) {\n\t\t\t\tnodeList.push(new FancytreeNode(this, children[i]));\n\t\t\t}\n\t\t\tfirstNode = nodeList[0];\n\t\t\tif (insertBefore == null) {\n\t\t\t\tthis.children = this.children.concat(nodeList);\n\t\t\t} else {\n\t\t\t\t// Returns null if insertBefore is not a direct child:\n\t\t\t\tinsertBefore = this._findDirectChild(insertBefore);\n\t\t\t\tpos = $.inArray(insertBefore, this.children);\n\t\t\t\t_assert(pos >= 0, \"insertBefore must be an existing child\");\n\t\t\t\t// insert nodeList after children[pos]\n\t\t\t\tthis.children.splice.apply(\n\t\t\t\t\tthis.children,\n\t\t\t\t\t[pos, 0].concat(nodeList)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (origFirstChild && !insertBefore) {\n\t\t\t\t// #708: Fast path -- don't render every child of root, just the new ones!\n\t\t\t\t// #723, #729: but only if it's appended to an existing child list\n\t\t\t\tfor (i = 0, l = nodeList.length; i < l; i++) {\n\t\t\t\t\tnodeList[i].render(); // New nodes were never rendered before\n\t\t\t\t}\n\t\t\t\t// Adjust classes where status may have changed\n\t\t\t\t// Has a first child\n\t\t\t\tif (origFirstChild !== this.getFirstChild()) {\n\t\t\t\t\t// Different first child -- recompute classes\n\t\t\t\t\torigFirstChild.renderStatus();\n\t\t\t\t}\n\t\t\t\tif (origLastChild !== this.getLastChild()) {\n\t\t\t\t\t// Different last child -- recompute classes\n\t\t\t\t\torigLastChild.renderStatus();\n\t\t\t\t}\n\t\t\t} else if (!this.parent || this.parent.ul || this.tr) {\n\t\t\t\t// render if the parent was rendered (or this is a root node)\n\t\t\t\tthis.render();\n\t\t\t}\n\t\t\tif (this.tree.options.selectMode === 3) {\n\t\t\t\tthis.fixSelection3FromEndNodes();\n\t\t\t}\n\t\t\tthis.triggerModifyChild(\n\t\t\t\t\"add\",\n\t\t\t\tnodeList.length === 1 ? nodeList[0] : null\n\t\t\t);\n\t\t\treturn firstNode;\n\t\t},\n\t\t/**\n\t\t * Add class to node's span tag and to .extraClasses.\n\t\t *\n\t\t * @param {string} className class name\n\t\t *\n\t\t * @since 2.17\n\t\t */\n\t\taddClass: function (className) {\n\t\t\treturn this.toggleClass(className, true);\n\t\t},\n\t\t/**\n\t\t * Append or prepend a node, or append a child node.\n\t\t *\n\t\t * This a convenience function that calls addChildren()\n\t\t *\n\t\t * @param {NodeData} node node definition\n\t\t * @param {string} [mode=child] 'before', 'after', 'firstChild', or 'child' ('over' is a synonym for 'child')\n\t\t * @returns {FancytreeNode} new node\n\t\t */\n\t\taddNode: function (node, mode) {\n\t\t\tif (mode === undefined || mode === \"over\") {\n\t\t\t\tmode = \"child\";\n\t\t\t}\n\t\t\tswitch (mode) {\n\t\t\t\tcase \"after\":\n\t\t\t\t\treturn this.getParent().addChildren(\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tthis.getNextSibling()\n\t\t\t\t\t);\n\t\t\t\tcase \"before\":\n\t\t\t\t\treturn this.getParent().addChildren(node, this);\n\t\t\t\tcase \"firstChild\":\n\t\t\t\t\t// Insert before the first child if any\n\t\t\t\t\tvar insertBefore = this.children ? this.children[0] : null;\n\t\t\t\t\treturn this.addChildren(node, insertBefore);\n\t\t\t\tcase \"child\":\n\t\t\t\tcase \"over\":\n\t\t\t\t\treturn this.addChildren(node);\n\t\t\t}\n\t\t\t_assert(false, \"Invalid mode: \" + mode);\n\t\t},\n\t\t/**Add child status nodes that indicate 'More...', etc.\n\t\t *\n\t\t * This also maintains the node's `partload` property.\n\t\t * @param {boolean|object} node optional node definition. Pass `false` to remove all paging nodes.\n\t\t * @param {string} [mode='child'] 'child'|firstChild'\n\t\t * @since 2.15\n\t\t */\n\t\taddPagingNode: function (node, mode) {\n\t\t\tvar i, n;\n\n\t\t\tmode = mode || \"child\";\n\t\t\tif (node === false) {\n\t\t\t\tfor (i = this.children.length - 1; i >= 0; i--) {\n\t\t\t\t\tn = this.children[i];\n\t\t\t\t\tif (n.statusNodeType === \"paging\") {\n\t\t\t\t\t\tthis.removeChild(n);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.partload = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tnode = $.extend(\n\t\t\t\t{\n\t\t\t\t\ttitle: this.tree.options.strings.moreData,\n\t\t\t\t\tstatusNodeType: \"paging\",\n\t\t\t\t\ticon: false,\n\t\t\t\t},\n\t\t\t\tnode\n\t\t\t);\n\t\t\tthis.partload = true;\n\t\t\treturn this.addNode(node, mode);\n\t\t},\n\t\t/**\n\t\t * Append new node after this.\n\t\t *\n\t\t * This a convenience function that calls addNode(node, 'after')\n\t\t *\n\t\t * @param {NodeData} node node definition\n\t\t * @returns {FancytreeNode} new node\n\t\t */\n\t\tappendSibling: function (node) {\n\t\t\treturn this.addNode(node, \"after\");\n\t\t},\n\t\t/**\n\t\t * (experimental) Apply a modification (or navigation) operation.\n\t\t *\n\t\t * @param {string} cmd\n\t\t * @param {object} [opts]\n\t\t * @see Fancytree#applyCommand\n\t\t * @since 2.32\n\t\t */\n\t\tapplyCommand: function (cmd, opts) {\n\t\t\treturn this.tree.applyCommand(cmd, this, opts);\n\t\t},\n\t\t/**\n\t\t * Modify existing child nodes.\n\t\t *\n\t\t * @param {NodePatch} patch\n\t\t * @returns {$.Promise}\n\t\t * @see FancytreeNode#addChildren\n\t\t */\n\t\tapplyPatch: function (patch) {\n\t\t\t// patch [key, null] means 'remove'\n\t\t\tif (patch === null) {\n\t\t\t\tthis.remove();\n\t\t\t\treturn _getResolvedPromise(this);\n\t\t\t}\n\t\t\t// TODO: make sure that root node is not collapsed or modified\n\t\t\t// copy (most) attributes to node.ATTR or node.data.ATTR\n\t\t\tvar name,\n\t\t\t\tpromise,\n\t\t\t\tv,\n\t\t\t\tIGNORE_MAP = { children: true, expanded: true, parent: true }; // TODO: should be global\n\n\t\t\tfor (name in patch) {\n\t\t\t\tif (_hasProp(patch, name)) {\n\t\t\t\t\tv = patch[name];\n\t\t\t\t\tif (!IGNORE_MAP[name] && !_isFunction(v)) {\n\t\t\t\t\t\tif (NODE_ATTR_MAP[name]) {\n\t\t\t\t\t\t\tthis[name] = v;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.data[name] = v;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Remove and/or create children\n\t\t\tif (_hasProp(patch, \"children\")) {\n\t\t\t\tthis.removeChildren();\n\t\t\t\tif (patch.children) {\n\t\t\t\t\t// only if not null and not empty list\n\t\t\t\t\t// TODO: addChildren instead?\n\t\t\t\t\tthis._setChildren(patch.children);\n\t\t\t\t}\n\t\t\t\t// TODO: how can we APPEND or INSERT child nodes?\n\t\t\t}\n\t\t\tif (this.isVisible()) {\n\t\t\t\tthis.renderTitle();\n\t\t\t\tthis.renderStatus();\n\t\t\t}\n\t\t\t// Expand collapse (final step, since this may be async)\n\t\t\tif (_hasProp(patch, \"expanded\")) {\n\t\t\t\tpromise = this.setExpanded(patch.expanded);\n\t\t\t} else {\n\t\t\t\tpromise = _getResolvedPromise(this);\n\t\t\t}\n\t\t\treturn promise;\n\t\t},\n\t\t/** Collapse all sibling nodes.\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tcollapseSiblings: function () {\n\t\t\treturn this.tree._callHook(\"nodeCollapseSiblings\", this);\n\t\t},\n\t\t/** Copy this node as sibling or child of `node`.\n\t\t *\n\t\t * @param {FancytreeNode} node source node\n\t\t * @param {string} [mode=child] 'before' | 'after' | 'child'\n\t\t * @param {Function} [map] callback function(NodeData, FancytreeNode) that could modify the new node\n\t\t * @returns {FancytreeNode} new\n\t\t */\n\t\tcopyTo: function (node, mode, map) {\n\t\t\treturn node.addNode(this.toDict(true, map), mode);\n\t\t},\n\t\t/** Count direct and indirect children.\n\t\t *\n\t\t * @param {boolean} [deep=true] pass 'false' to only count direct children\n\t\t * @returns {int} number of child nodes\n\t\t */\n\t\tcountChildren: function (deep) {\n\t\t\tvar cl = this.children,\n\t\t\t\ti,\n\t\t\t\tl,\n\t\t\t\tn;\n\t\t\tif (!cl) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tn = cl.length;\n\t\t\tif (deep !== false) {\n\t\t\t\tfor (i = 0, l = n; i < l; i++) {\n\t\t\t\t\tn += cl[i].countChildren();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn n;\n\t\t},\n\t\t// TODO: deactivate()\n\t\t/** Write to browser console if debugLevel >= 4 (prepending node info)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\tdebug: function (msg) {\n\t\t\tif (this.tree.options.debugLevel >= 4) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"log\", arguments);\n\t\t\t}\n\t\t},\n\t\t/** Deprecated.\n\t\t * @deprecated since 2014-02-16. Use resetLazy() instead.\n\t\t */\n\t\tdiscard: function () {\n\t\t\tthis.warn(\n\t\t\t\t\"FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead.\"\n\t\t\t);\n\t\t\treturn this.resetLazy();\n\t\t},\n\t\t/** Remove DOM elements for all descendents. May be called on .collapse event\n\t\t * to keep the DOM small.\n\t\t * @param {boolean} [includeSelf=false]\n\t\t */\n\t\tdiscardMarkup: function (includeSelf) {\n\t\t\tvar fn = includeSelf ? \"nodeRemoveMarkup\" : \"nodeRemoveChildMarkup\";\n\t\t\tthis.tree._callHook(fn, this);\n\t\t},\n\t\t/** Write error to browser console if debugLevel >= 1 (prepending tree info)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\terror: function (msg) {\n\t\t\tif (this.tree.options.debugLevel >= 1) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"error\", arguments);\n\t\t\t}\n\t\t},\n\t\t/**Find all nodes that match condition (excluding self).\n\t\t *\n\t\t * @param {string | function(node)} match title string to search for, or a\n\t\t * callback function that returns `true` if a node is matched.\n\t\t * @returns {FancytreeNode[]} array of nodes (may be empty)\n\t\t */\n\t\tfindAll: function (match) {\n\t\t\tmatch = _isFunction(match) ? match : _makeNodeTitleMatcher(match);\n\t\t\tvar res = [];\n\t\t\tthis.visit(function (n) {\n\t\t\t\tif (match(n)) {\n\t\t\t\t\tres.push(n);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn res;\n\t\t},\n\t\t/**Find first node that matches condition (excluding self).\n\t\t *\n\t\t * @param {string | function(node)} match title string to search for, or a\n\t\t * callback function that returns `true` if a node is matched.\n\t\t * @returns {FancytreeNode} matching node or null\n\t\t * @see FancytreeNode#findAll\n\t\t */\n\t\tfindFirst: function (match) {\n\t\t\tmatch = _isFunction(match) ? match : _makeNodeTitleMatcher(match);\n\t\t\tvar res = null;\n\t\t\tthis.visit(function (n) {\n\t\t\t\tif (match(n)) {\n\t\t\t\t\tres = n;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn res;\n\t\t},\n\t\t/** Find a node relative to self.\n\t\t *\n\t\t * @param {number|string} where The keyCode that would normally trigger this move,\n\t\t *\t\tor a keyword ('down', 'first', 'last', 'left', 'parent', 'right', 'up').\n\t\t * @returns {FancytreeNode}\n\t\t * @since v2.31\n\t\t */\n\t\tfindRelatedNode: function (where, includeHidden) {\n\t\t\treturn this.tree.findRelatedNode(this, where, includeHidden);\n\t\t},\n\t\t/* Apply selection state (internal use only) */\n\t\t_changeSelectStatusAttrs: function (state) {\n\t\t\tvar changed = false,\n\t\t\t\topts = this.tree.options,\n\t\t\t\tunselectable = FT.evalOption(\n\t\t\t\t\t\"unselectable\",\n\t\t\t\t\tthis,\n\t\t\t\t\tthis,\n\t\t\t\t\topts,\n\t\t\t\t\tfalse\n\t\t\t\t),\n\t\t\t\tunselectableStatus = FT.evalOption(\n\t\t\t\t\t\"unselectableStatus\",\n\t\t\t\t\tthis,\n\t\t\t\t\tthis,\n\t\t\t\t\topts,\n\t\t\t\t\tundefined\n\t\t\t\t);\n\n\t\t\tif (unselectable && unselectableStatus != null) {\n\t\t\t\tstate = unselectableStatus;\n\t\t\t}\n\t\t\tswitch (state) {\n\t\t\t\tcase false:\n\t\t\t\t\tchanged = this.selected || this.partsel;\n\t\t\t\t\tthis.selected = false;\n\t\t\t\t\tthis.partsel = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase true:\n\t\t\t\t\tchanged = !this.selected || !this.partsel;\n\t\t\t\t\tthis.selected = true;\n\t\t\t\t\tthis.partsel = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase undefined:\n\t\t\t\t\tchanged = this.selected || !this.partsel;\n\t\t\t\t\tthis.selected = false;\n\t\t\t\t\tthis.partsel = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t_assert(false, \"invalid state: \" + state);\n\t\t\t}\n\t\t\t// this.debug(\"fixSelection3AfterLoad() _changeSelectStatusAttrs()\", state, changed);\n\t\t\tif (changed) {\n\t\t\t\tthis.renderStatus();\n\t\t\t}\n\t\t\treturn changed;\n\t\t},\n\t\t/**\n\t\t * Fix selection status, after this node was (de)selected in multi-hier mode.\n\t\t * This includes (de)selecting all children.\n\t\t */\n\t\tfixSelection3AfterClick: function (callOpts) {\n\t\t\tvar flag = this.isSelected();\n\n\t\t\t// this.debug(\"fixSelection3AfterClick()\");\n\n\t\t\tthis.visit(function (node) {\n\t\t\t\tnode._changeSelectStatusAttrs(flag);\n\t\t\t\tif (node.radiogroup) {\n\t\t\t\t\t// #931: don't (de)select this branch\n\t\t\t\t\treturn \"skip\";\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.fixSelection3FromEndNodes(callOpts);\n\t\t},\n\t\t/**\n\t\t * Fix selection status for multi-hier mode.\n\t\t * Only end-nodes are considered to update the descendants branch and parents.\n\t\t * Should be called after this node has loaded new children or after\n\t\t * children have been modified using the API.\n\t\t */\n\t\tfixSelection3FromEndNodes: function (callOpts) {\n\t\t\tvar opts = this.tree.options;\n\n\t\t\t// this.debug(\"fixSelection3FromEndNodes()\");\n\t\t\t_assert(opts.selectMode === 3, \"expected selectMode 3\");\n\n\t\t\t// Visit all end nodes and adjust their parent's `selected` and `partsel`\n\t\t\t// attributes. Return selection state true, false, or undefined.\n\t\t\tfunction _walk(node) {\n\t\t\t\tvar i,\n\t\t\t\t\tl,\n\t\t\t\t\tchild,\n\t\t\t\t\ts,\n\t\t\t\t\tstate,\n\t\t\t\t\tallSelected,\n\t\t\t\t\tsomeSelected,\n\t\t\t\t\tunselIgnore,\n\t\t\t\t\tunselState,\n\t\t\t\t\tchildren = node.children;\n\n\t\t\t\tif (children && children.length) {\n\t\t\t\t\t// check all children recursively\n\t\t\t\t\tallSelected = true;\n\t\t\t\t\tsomeSelected = false;\n\n\t\t\t\t\tfor (i = 0, l = children.length; i < l; i++) {\n\t\t\t\t\t\tchild = children[i];\n\t\t\t\t\t\t// the selection state of a node is not relevant; we need the end-nodes\n\t\t\t\t\t\ts = _walk(child);\n\t\t\t\t\t\t// if( !child.unselectableIgnore ) {\n\t\t\t\t\t\tunselIgnore = FT.evalOption(\n\t\t\t\t\t\t\t\"unselectableIgnore\",\n\t\t\t\t\t\t\tchild,\n\t\t\t\t\t\t\tchild,\n\t\t\t\t\t\t\topts,\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (!unselIgnore) {\n\t\t\t\t\t\t\tif (s !== false) {\n\t\t\t\t\t\t\t\tsomeSelected = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (s !== true) {\n\t\t\t\t\t\t\t\tallSelected = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// eslint-disable-next-line no-nested-ternary\n\t\t\t\t\tstate = allSelected\n\t\t\t\t\t\t? true\n\t\t\t\t\t\t: someSelected\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: false;\n\t\t\t\t} else {\n\t\t\t\t\t// This is an end-node: simply report the status\n\t\t\t\t\tunselState = FT.evalOption(\n\t\t\t\t\t\t\"unselectableStatus\",\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\topts,\n\t\t\t\t\t\tundefined\n\t\t\t\t\t);\n\t\t\t\t\tstate = unselState == null ? !!node.selected : !!unselState;\n\t\t\t\t}\n\t\t\t\t// #939: Keep a `partsel` flag that was explicitly set on a lazy node\n\t\t\t\tif (\n\t\t\t\t\tnode.partsel &&\n\t\t\t\t\t!node.selected &&\n\t\t\t\t\tnode.lazy &&\n\t\t\t\t\tnode.children == null\n\t\t\t\t) {\n\t\t\t\t\tstate = undefined;\n\t\t\t\t}\n\t\t\t\tnode._changeSelectStatusAttrs(state);\n\t\t\t\treturn state;\n\t\t\t}\n\t\t\t_walk(this);\n\n\t\t\t// Update parent's state\n\t\t\tthis.visitParents(function (node) {\n\t\t\t\tvar i,\n\t\t\t\t\tl,\n\t\t\t\t\tchild,\n\t\t\t\t\tstate,\n\t\t\t\t\tunselIgnore,\n\t\t\t\t\tunselState,\n\t\t\t\t\tchildren = node.children,\n\t\t\t\t\tallSelected = true,\n\t\t\t\t\tsomeSelected = false;\n\n\t\t\t\tfor (i = 0, l = children.length; i < l; i++) {\n\t\t\t\t\tchild = children[i];\n\t\t\t\t\tunselIgnore = FT.evalOption(\n\t\t\t\t\t\t\"unselectableIgnore\",\n\t\t\t\t\t\tchild,\n\t\t\t\t\t\tchild,\n\t\t\t\t\t\topts,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t);\n\t\t\t\t\tif (!unselIgnore) {\n\t\t\t\t\t\tunselState = FT.evalOption(\n\t\t\t\t\t\t\t\"unselectableStatus\",\n\t\t\t\t\t\t\tchild,\n\t\t\t\t\t\t\tchild,\n\t\t\t\t\t\t\topts,\n\t\t\t\t\t\t\tundefined\n\t\t\t\t\t\t);\n\t\t\t\t\t\tstate =\n\t\t\t\t\t\t\tunselState == null\n\t\t\t\t\t\t\t\t? !!child.selected\n\t\t\t\t\t\t\t\t: !!unselState;\n\t\t\t\t\t\t// When fixing the parents, we trust the sibling status (i.e.\n\t\t\t\t\t\t// we don't recurse)\n\t\t\t\t\t\tif (state || child.partsel) {\n\t\t\t\t\t\t\tsomeSelected = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!state) {\n\t\t\t\t\t\t\tallSelected = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// eslint-disable-next-line no-nested-ternary\n\t\t\t\tstate = allSelected ? true : someSelected ? undefined : false;\n\t\t\t\tnode._changeSelectStatusAttrs(state);\n\t\t\t});\n\t\t},\n\t\t// TODO: focus()\n\t\t/**\n\t\t * Update node data. If dict contains 'children', then also replace\n\t\t * the hole sub tree.\n\t\t * @param {NodeData} dict\n\t\t *\n\t\t * @see FancytreeNode#addChildren\n\t\t * @see FancytreeNode#applyPatch\n\t\t */\n\t\tfromDict: function (dict) {\n\t\t\t// copy all other attributes to this.data.xxx\n\t\t\tfor (var name in dict) {\n\t\t\t\tif (NODE_ATTR_MAP[name]) {\n\t\t\t\t\t// node.NAME = dict.NAME\n\t\t\t\t\tthis[name] = dict[name];\n\t\t\t\t} else if (name === \"data\") {\n\t\t\t\t\t// node.data += dict.data\n\t\t\t\t\t$.extend(this.data, dict.data);\n\t\t\t\t} else if (\n\t\t\t\t\t!_isFunction(dict[name]) &&\n\t\t\t\t\t!NONE_NODE_DATA_MAP[name]\n\t\t\t\t) {\n\t\t\t\t\t// node.data.NAME = dict.NAME\n\t\t\t\t\tthis.data[name] = dict[name];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (dict.children) {\n\t\t\t\t// recursively set children and render\n\t\t\t\tthis.removeChildren();\n\t\t\t\tthis.addChildren(dict.children);\n\t\t\t}\n\t\t\tthis.renderTitle();\n\t\t\t/*\n\t\t\tvar children = dict.children;\n\t\t\tif(children === undefined){\n\t\t\t\tthis.data = $.extend(this.data, dict);\n\t\t\t\tthis.render();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdict = $.extend({}, dict);\n\t\t\tdict.children = undefined;\n\t\t\tthis.data = $.extend(this.data, dict);\n\t\t\tthis.removeChildren();\n\t\t\tthis.addChild(children);\n\t\t\t*/\n\t\t},\n\t\t/** Return the list of child nodes (undefined for unexpanded lazy nodes).\n\t\t * @returns {FancytreeNode[] | undefined}\n\t\t */\n\t\tgetChildren: function () {\n\t\t\tif (this.hasChildren() === undefined) {\n\t\t\t\t// TODO: only required for lazy nodes?\n\t\t\t\treturn undefined; // Lazy node: unloaded, currently loading, or load error\n\t\t\t}\n\t\t\treturn this.children;\n\t\t},\n\t\t/** Return the first child node or null.\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetFirstChild: function () {\n\t\t\treturn this.children ? this.children[0] : null;\n\t\t},\n\t\t/** Return the 0-based child index.\n\t\t * @returns {int}\n\t\t */\n\t\tgetIndex: function () {\n\t\t\t// return this.parent.children.indexOf(this);\n\t\t\treturn $.inArray(this, this.parent.children); // indexOf doesn't work in IE7\n\t\t},\n\t\t/** Return the hierarchical child index (1-based, e.g. '3.2.4').\n\t\t * @param {string} [separator=\".\"]\n\t\t * @param {int} [digits=1]\n\t\t * @returns {string}\n\t\t */\n\t\tgetIndexHier: function (separator, digits) {\n\t\t\tseparator = separator || \".\";\n\t\t\tvar s,\n\t\t\t\tres = [];\n\t\t\t$.each(this.getParentList(false, true), function (i, o) {\n\t\t\t\ts = \"\" + (o.getIndex() + 1);\n\t\t\t\tif (digits) {\n\t\t\t\t\t// prepend leading zeroes\n\t\t\t\t\ts = (\"0000000\" + s).substr(-digits);\n\t\t\t\t}\n\t\t\t\tres.push(s);\n\t\t\t});\n\t\t\treturn res.join(separator);\n\t\t},\n\t\t/** Return the parent keys separated by options.keyPathSeparator, e.g. \"/id_1/id_17/id_32\".\n\t\t *\n\t\t * (Unlike `node.getPath()`, this method prepends a \"/\" and inverts the first argument.)\n\t\t *\n\t\t * @see FancytreeNode#getPath\n\t\t * @param {boolean} [excludeSelf=false]\n\t\t * @returns {string}\n\t\t */\n\t\tgetKeyPath: function (excludeSelf) {\n\t\t\tvar sep = this.tree.options.keyPathSeparator;\n\n\t\t\treturn sep + this.getPath(!excludeSelf, \"key\", sep);\n\t\t},\n\t\t/** Return the last child of this node or null.\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetLastChild: function () {\n\t\t\treturn this.children\n\t\t\t\t? this.children[this.children.length - 1]\n\t\t\t\t: null;\n\t\t},\n\t\t/** Return node depth. 0: System root node, 1: visible top-level node, 2: first sub-level, ... .\n\t\t * @returns {int}\n\t\t */\n\t\tgetLevel: function () {\n\t\t\tvar level = 0,\n\t\t\t\tdtn = this.parent;\n\t\t\twhile (dtn) {\n\t\t\t\tlevel++;\n\t\t\t\tdtn = dtn.parent;\n\t\t\t}\n\t\t\treturn level;\n\t\t},\n\t\t/** Return the successor node (under the same parent) or null.\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetNextSibling: function () {\n\t\t\t// TODO: use indexOf, if available: (not in IE6)\n\t\t\tif (this.parent) {\n\t\t\t\tvar i,\n\t\t\t\t\tl,\n\t\t\t\t\tac = this.parent.children;\n\n\t\t\t\tfor (i = 0, l = ac.length - 1; i < l; i++) {\n\t\t\t\t\t// up to length-2, so next(last) = null\n\t\t\t\t\tif (ac[i] === this) {\n\t\t\t\t\t\treturn ac[i + 1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\t/** Return the parent node (null for the system root node).\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetParent: function () {\n\t\t\t// TODO: return null for top-level nodes?\n\t\t\treturn this.parent;\n\t\t},\n\t\t/** Return an array of all parent nodes (top-down).\n\t\t * @param {boolean} [includeRoot=false] Include the invisible system root node.\n\t\t * @param {boolean} [includeSelf=false] Include the node itself.\n\t\t * @returns {FancytreeNode[]}\n\t\t */\n\t\tgetParentList: function (includeRoot, includeSelf) {\n\t\t\tvar l = [],\n\t\t\t\tdtn = includeSelf ? this : this.parent;\n\t\t\twhile (dtn) {\n\t\t\t\tif (includeRoot || dtn.parent) {\n\t\t\t\t\tl.unshift(dtn);\n\t\t\t\t}\n\t\t\t\tdtn = dtn.parent;\n\t\t\t}\n\t\t\treturn l;\n\t\t},\n\t\t/** Return a string representing the hierachical node path, e.g. \"a/b/c\".\n\t\t * @param {boolean} [includeSelf=true]\n\t\t * @param {string | function} [part=\"title\"] node property name or callback\n\t\t * @param {string} [separator=\"/\"]\n\t\t * @returns {string}\n\t\t * @since v2.31\n\t\t */\n\t\tgetPath: function (includeSelf, part, separator) {\n\t\t\tincludeSelf = includeSelf !== false;\n\t\t\tpart = part || \"title\";\n\t\t\tseparator = separator || \"/\";\n\n\t\t\tvar val,\n\t\t\t\tpath = [],\n\t\t\t\tisFunc = _isFunction(part);\n\n\t\t\tthis.visitParents(function (n) {\n\t\t\t\tif (n.parent) {\n\t\t\t\t\tval = isFunc ? part(n) : n[part];\n\t\t\t\t\tpath.unshift(val);\n\t\t\t\t}\n\t\t\t}, includeSelf);\n\t\t\treturn path.join(separator);\n\t\t},\n\t\t/** Return the predecessor node (under the same parent) or null.\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetPrevSibling: function () {\n\t\t\tif (this.parent) {\n\t\t\t\tvar i,\n\t\t\t\t\tl,\n\t\t\t\t\tac = this.parent.children;\n\n\t\t\t\tfor (i = 1, l = ac.length; i < l; i++) {\n\t\t\t\t\t// start with 1, so prev(first) = null\n\t\t\t\t\tif (ac[i] === this) {\n\t\t\t\t\t\treturn ac[i - 1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\t/**\n\t\t * Return an array of selected descendant nodes.\n\t\t * @param {boolean} [stopOnParents=false] only return the topmost selected\n\t\t * node (useful with selectMode 3)\n\t\t * @returns {FancytreeNode[]}\n\t\t */\n\t\tgetSelectedNodes: function (stopOnParents) {\n\t\t\tvar nodeList = [];\n\t\t\tthis.visit(function (node) {\n\t\t\t\tif (node.selected) {\n\t\t\t\t\tnodeList.push(node);\n\t\t\t\t\tif (stopOnParents === true) {\n\t\t\t\t\t\treturn \"skip\"; // stop processing this branch\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn nodeList;\n\t\t},\n\t\t/** Return true if node has children. Return undefined if not sure, i.e. the node is lazy and not yet loaded).\n\t\t * @returns {boolean | undefined}\n\t\t */\n\t\thasChildren: function () {\n\t\t\tif (this.lazy) {\n\t\t\t\tif (this.children == null) {\n\t\t\t\t\t// null or undefined: Not yet loaded\n\t\t\t\t\treturn undefined;\n\t\t\t\t} else if (this.children.length === 0) {\n\t\t\t\t\t// Loaded, but response was empty\n\t\t\t\t\treturn false;\n\t\t\t\t} else if (\n\t\t\t\t\tthis.children.length === 1 &&\n\t\t\t\t\tthis.children[0].isStatusNode()\n\t\t\t\t) {\n\t\t\t\t\t// Currently loading or load error\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !!(this.children && this.children.length);\n\t\t},\n\t\t/**\n\t\t * Return true if node has `className` defined in .extraClasses.\n\t\t *\n\t\t * @param {string} className class name (separate multiple classes by space)\n\t\t * @returns {boolean}\n\t\t *\n\t\t * @since 2.32\n\t\t */\n\t\thasClass: function (className) {\n\t\t\treturn (\n\t\t\t\t(\" \" + (this.extraClasses || \"\") + \" \").indexOf(\n\t\t\t\t\t\" \" + className + \" \"\n\t\t\t\t) >= 0\n\t\t\t);\n\t\t},\n\t\t/** Return true if node has keyboard focus.\n\t\t * @returns {boolean}\n\t\t */\n\t\thasFocus: function () {\n\t\t\treturn this.tree.hasFocus() && this.tree.focusNode === this;\n\t\t},\n\t\t/** Write to browser console if debugLevel >= 3 (prepending node info)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\tinfo: function (msg) {\n\t\t\tif (this.tree.options.debugLevel >= 3) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"info\", arguments);\n\t\t\t}\n\t\t},\n\t\t/** Return true if node is active (see also FancytreeNode#isSelected).\n\t\t * @returns {boolean}\n\t\t */\n\t\tisActive: function () {\n\t\t\treturn this.tree.activeNode === this;\n\t\t},\n\t\t/** Return true if node is vertically below `otherNode`, i.e. rendered in a subsequent row.\n\t\t * @param {FancytreeNode} otherNode\n\t\t * @returns {boolean}\n\t\t * @since 2.28\n\t\t */\n\t\tisBelowOf: function (otherNode) {\n\t\t\treturn this.getIndexHier(\".\", 5) > otherNode.getIndexHier(\".\", 5);\n\t\t},\n\t\t/** Return true if node is a direct child of otherNode.\n\t\t * @param {FancytreeNode} otherNode\n\t\t * @returns {boolean}\n\t\t */\n\t\tisChildOf: function (otherNode) {\n\t\t\treturn this.parent && this.parent === otherNode;\n\t\t},\n\t\t/** Return true, if node is a direct or indirect sub node of otherNode.\n\t\t * @param {FancytreeNode} otherNode\n\t\t * @returns {boolean}\n\t\t */\n\t\tisDescendantOf: function (otherNode) {\n\t\t\tif (!otherNode || otherNode.tree !== this.tree) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar p = this.parent;\n\t\t\twhile (p) {\n\t\t\t\tif (p === otherNode) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (p === p.parent) {\n\t\t\t\t\t$.error(\"Recursive parent link: \" + p);\n\t\t\t\t}\n\t\t\t\tp = p.parent;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\t/** Return true if node is expanded.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisExpanded: function () {\n\t\t\treturn !!this.expanded;\n\t\t},\n\t\t/** Return true if node is the first node of its parent's children.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisFirstSibling: function () {\n\t\t\tvar p = this.parent;\n\t\t\treturn !p || p.children[0] === this;\n\t\t},\n\t\t/** Return true if node is a folder, i.e. has the node.folder attribute set.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisFolder: function () {\n\t\t\treturn !!this.folder;\n\t\t},\n\t\t/** Return true if node is the last node of its parent's children.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisLastSibling: function () {\n\t\t\tvar p = this.parent;\n\t\t\treturn !p || p.children[p.children.length - 1] === this;\n\t\t},\n\t\t/** Return true if node is lazy (even if data was already loaded)\n\t\t * @returns {boolean}\n\t\t */\n\t\tisLazy: function () {\n\t\t\treturn !!this.lazy;\n\t\t},\n\t\t/** Return true if node is lazy and loaded. For non-lazy nodes always return true.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisLoaded: function () {\n\t\t\treturn !this.lazy || this.hasChildren() !== undefined; // Also checks if the only child is a status node\n\t\t},\n\t\t/** Return true if children are currently beeing loaded, i.e. a Ajax request is pending.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisLoading: function () {\n\t\t\treturn !!this._isLoading;\n\t\t},\n\t\t/*\n\t\t * @deprecated since v2.4.0: Use isRootNode() instead\n\t\t */\n\t\tisRoot: function () {\n\t\t\treturn this.isRootNode();\n\t\t},\n\t\t/** Return true if node is partially selected (tri-state).\n\t\t * @returns {boolean}\n\t\t * @since 2.23\n\t\t */\n\t\tisPartsel: function () {\n\t\t\treturn !this.selected && !!this.partsel;\n\t\t},\n\t\t/** (experimental) Return true if this is partially loaded.\n\t\t * @returns {boolean}\n\t\t * @since 2.15\n\t\t */\n\t\tisPartload: function () {\n\t\t\treturn !!this.partload;\n\t\t},\n\t\t/** Return true if this is the (invisible) system root node.\n\t\t * @returns {boolean}\n\t\t * @since 2.4\n\t\t */\n\t\tisRootNode: function () {\n\t\t\treturn this.tree.rootNode === this;\n\t\t},\n\t\t/** Return true if node is selected, i.e. has a checkmark set (see also FancytreeNode#isActive).\n\t\t * @returns {boolean}\n\t\t */\n\t\tisSelected: function () {\n\t\t\treturn !!this.selected;\n\t\t},\n\t\t/** Return true if this node is a temporarily generated system node like\n\t\t * 'loading', 'paging', or 'error' (node.statusNodeType contains the type).\n\t\t * @returns {boolean}\n\t\t */\n\t\tisStatusNode: function () {\n\t\t\treturn !!this.statusNodeType;\n\t\t},\n\t\t/** Return true if this node is a status node of type 'paging'.\n\t\t * @returns {boolean}\n\t\t * @since 2.15\n\t\t */\n\t\tisPagingNode: function () {\n\t\t\treturn this.statusNodeType === \"paging\";\n\t\t},\n\t\t/** Return true if this a top level node, i.e. a direct child of the (invisible) system root node.\n\t\t * @returns {boolean}\n\t\t * @since 2.4\n\t\t */\n\t\tisTopLevel: function () {\n\t\t\treturn this.tree.rootNode === this.parent;\n\t\t},\n\t\t/** Return true if node is lazy and not yet loaded. For non-lazy nodes always return false.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisUndefined: function () {\n\t\t\treturn this.hasChildren() === undefined; // also checks if the only child is a status node\n\t\t},\n\t\t/** Return true if all parent nodes are expanded. Note: this does not check\n\t\t * whether the node is scrolled into the visible part of the screen.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisVisible: function () {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tn,\n\t\t\t\thasFilter = this.tree.enableFilter,\n\t\t\t\tparents = this.getParentList(false, false);\n\n\t\t\t// TODO: check $(n.span).is(\":visible\")\n\t\t\t// i.e. return false for nodes (but not parents) that are hidden\n\t\t\t// by a filter\n\t\t\tif (hasFilter && !this.match && !this.subMatchCount) {\n\t\t\t\t// this.debug( \"isVisible: HIDDEN (\" + hasFilter + \", \" + this.match + \", \" + this.match + \")\" );\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tfor (i = 0, l = parents.length; i < l; i++) {\n\t\t\t\tn = parents[i];\n\n\t\t\t\tif (!n.expanded) {\n\t\t\t\t\t// this.debug(\"isVisible: HIDDEN (parent collapsed)\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// if (hasFilter && !n.match && !n.subMatchCount) {\n\t\t\t\t// \tthis.debug(\"isVisible: HIDDEN (\" + hasFilter + \", \" + this.match + \", \" + this.match + \")\");\n\t\t\t\t// \treturn false;\n\t\t\t\t// }\n\t\t\t}\n\t\t\t// this.debug(\"isVisible: VISIBLE\");\n\t\t\treturn true;\n\t\t},\n\t\t/** Deprecated.\n\t\t * @deprecated since 2014-02-16: use load() instead.\n\t\t */\n\t\tlazyLoad: function (discard) {\n\t\t\t$.error(\n\t\t\t\t\"FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead.\"\n\t\t\t);\n\t\t},\n\t\t/**\n\t\t * Load all children of a lazy node if neccessary. The <i>expanded</i> state is maintained.\n\t\t * @param {boolean} [forceReload=false] Pass true to discard any existing nodes before. Otherwise this method does nothing if the node was already loaded.\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tload: function (forceReload) {\n\t\t\tvar res,\n\t\t\t\tsource,\n\t\t\t\tself = this,\n\t\t\t\twasExpanded = this.isExpanded();\n\n\t\t\t_assert(this.isLazy(), \"load() requires a lazy node\");\n\t\t\t// _assert( forceReload || this.isUndefined(), \"Pass forceReload=true to re-load a lazy node\" );\n\t\t\tif (!forceReload && !this.isUndefined()) {\n\t\t\t\treturn _getResolvedPromise(this);\n\t\t\t}\n\t\t\tif (this.isLoaded()) {\n\t\t\t\tthis.resetLazy(); // also collapses\n\t\t\t}\n\t\t\t// This method is also called by setExpanded() and loadKeyPath(), so we\n\t\t\t// have to avoid recursion.\n\t\t\tsource = this.tree._triggerNodeEvent(\"lazyLoad\", this);\n\t\t\tif (source === false) {\n\t\t\t\t// #69\n\t\t\t\treturn _getResolvedPromise(this);\n\t\t\t}\n\t\t\t_assert(\n\t\t\t\ttypeof source !== \"boolean\",\n\t\t\t\t\"lazyLoad event must return source in data.result\"\n\t\t\t);\n\t\t\tres = this.tree._callHook(\"nodeLoadChildren\", this, source);\n\t\t\tif (wasExpanded) {\n\t\t\t\tthis.expanded = true;\n\t\t\t\tres.always(function () {\n\t\t\t\t\tself.render();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tres.always(function () {\n\t\t\t\t\tself.renderStatus(); // fix expander icon to 'loaded'\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t/** Expand all parents and optionally scroll into visible area as neccessary.\n\t\t * Promise is resolved, when lazy loading and animations are done.\n\t\t * @param {object} [opts] passed to `setExpanded()`.\n\t\t * Defaults to {noAnimation: false, noEvents: false, scrollIntoView: true}\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tmakeVisible: function (opts) {\n\t\t\tvar i,\n\t\t\t\tself = this,\n\t\t\t\tdeferreds = [],\n\t\t\t\tdfd = new $.Deferred(),\n\t\t\t\tparents = this.getParentList(false, false),\n\t\t\t\tlen = parents.length,\n\t\t\t\teffects = !(opts && opts.noAnimation === true),\n\t\t\t\tscroll = !(opts && opts.scrollIntoView === false);\n\n\t\t\t// Expand bottom-up, so only the top node is animated\n\t\t\tfor (i = len - 1; i >= 0; i--) {\n\t\t\t\t// self.debug(\"pushexpand\" + parents[i]);\n\t\t\t\tdeferreds.push(parents[i].setExpanded(true, opts));\n\t\t\t}\n\t\t\t$.when.apply($, deferreds).done(function () {\n\t\t\t\t// All expands have finished\n\t\t\t\t// self.debug(\"expand DONE\", scroll);\n\t\t\t\tif (scroll) {\n\t\t\t\t\tself.scrollIntoView(effects).done(function () {\n\t\t\t\t\t\t// self.debug(\"scroll DONE\");\n\t\t\t\t\t\tdfd.resolve();\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tdfd.resolve();\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn dfd.promise();\n\t\t},\n\t\t/** Move this node to targetNode.\n\t\t * @param {FancytreeNode} targetNode\n\t\t * @param {string} mode <pre>\n\t\t * 'child': append this node as last child of targetNode.\n\t\t * This is the default. To be compatble with the D'n'd\n\t\t * hitMode, we also accept 'over'.\n\t\t * 'firstChild': add this node as first child of targetNode.\n\t\t * 'before': add this node as sibling before targetNode.\n\t\t * 'after': add this node as sibling after targetNode.</pre>\n\t\t * @param {function} [map] optional callback(FancytreeNode) to allow modifcations\n\t\t */\n\t\tmoveTo: function (targetNode, mode, map) {\n\t\t\tif (mode === undefined || mode === \"over\") {\n\t\t\t\tmode = \"child\";\n\t\t\t} else if (mode === \"firstChild\") {\n\t\t\t\tif (targetNode.children && targetNode.children.length) {\n\t\t\t\t\tmode = \"before\";\n\t\t\t\t\ttargetNode = targetNode.children[0];\n\t\t\t\t} else {\n\t\t\t\t\tmode = \"child\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar pos,\n\t\t\t\ttree = this.tree,\n\t\t\t\tprevParent = this.parent,\n\t\t\t\ttargetParent =\n\t\t\t\t\tmode === \"child\" ? targetNode : targetNode.parent;\n\n\t\t\tif (this === targetNode) {\n\t\t\t\treturn;\n\t\t\t} else if (!this.parent) {\n\t\t\t\t$.error(\"Cannot move system root\");\n\t\t\t} else if (targetParent.isDescendantOf(this)) {\n\t\t\t\t$.error(\"Cannot move a node to its own descendant\");\n\t\t\t}\n\t\t\tif (targetParent !== prevParent) {\n\t\t\t\tprevParent.triggerModifyChild(\"remove\", this);\n\t\t\t}\n\t\t\t// Unlink this node from current parent\n\t\t\tif (this.parent.children.length === 1) {\n\t\t\t\tif (this.parent === targetParent) {\n\t\t\t\t\treturn; // #258\n\t\t\t\t}\n\t\t\t\tthis.parent.children = this.parent.lazy ? [] : null;\n\t\t\t\tthis.parent.expanded = false;\n\t\t\t} else {\n\t\t\t\tpos = $.inArray(this, this.parent.children);\n\t\t\t\t_assert(pos >= 0, \"invalid source parent\");\n\t\t\t\tthis.parent.children.splice(pos, 1);\n\t\t\t}\n\t\t\t// Remove from source DOM parent\n\t\t\t// if(this.parent.ul){\n\t\t\t// \tthis.parent.ul.removeChild(this.li);\n\t\t\t// }\n\n\t\t\t// Insert this node to target parent's child list\n\t\t\tthis.parent = targetParent;\n\t\t\tif (targetParent.hasChildren()) {\n\t\t\t\tswitch (mode) {\n\t\t\t\t\tcase \"child\":\n\t\t\t\t\t\t// Append to existing target children\n\t\t\t\t\t\ttargetParent.children.push(this);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"before\":\n\t\t\t\t\t\t// Insert this node before target node\n\t\t\t\t\t\tpos = $.inArray(targetNode, targetParent.children);\n\t\t\t\t\t\t_assert(pos >= 0, \"invalid target parent\");\n\t\t\t\t\t\ttargetParent.children.splice(pos, 0, this);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"after\":\n\t\t\t\t\t\t// Insert this node after target node\n\t\t\t\t\t\tpos = $.inArray(targetNode, targetParent.children);\n\t\t\t\t\t\t_assert(pos >= 0, \"invalid target parent\");\n\t\t\t\t\t\ttargetParent.children.splice(pos + 1, 0, this);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$.error(\"Invalid mode \" + mode);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttargetParent.children = [this];\n\t\t\t}\n\t\t\t// Parent has no <ul> tag yet:\n\t\t\t// if( !targetParent.ul ) {\n\t\t\t// \t// This is the parent's first child: create UL tag\n\t\t\t// \t// (Hidden, because it will be\n\t\t\t// \ttargetParent.ul = document.createElement(\"ul\");\n\t\t\t// \ttargetParent.ul.style.display = \"none\";\n\t\t\t// \ttargetParent.li.appendChild(targetParent.ul);\n\t\t\t// }\n\t\t\t// // Issue 319: Add to target DOM parent (only if node was already rendered(expanded))\n\t\t\t// if(this.li){\n\t\t\t// \ttargetParent.ul.appendChild(this.li);\n\t\t\t// }\n\n\t\t\t// Let caller modify the nodes\n\t\t\tif (map) {\n\t\t\t\ttargetNode.visit(map, true);\n\t\t\t}\n\t\t\tif (targetParent === prevParent) {\n\t\t\t\ttargetParent.triggerModifyChild(\"move\", this);\n\t\t\t} else {\n\t\t\t\t// prevParent.triggerModifyChild(\"remove\", this);\n\t\t\t\ttargetParent.triggerModifyChild(\"add\", this);\n\t\t\t}\n\t\t\t// Handle cross-tree moves\n\t\t\tif (tree !== targetNode.tree) {\n\t\t\t\t// Fix node.tree for all source nodes\n\t\t\t\t// \t_assert(false, \"Cross-tree move is not yet implemented.\");\n\t\t\t\tthis.warn(\"Cross-tree moveTo is experimental!\");\n\t\t\t\tthis.visit(function (n) {\n\t\t\t\t\t// TODO: fix selection state and activation, ...\n\t\t\t\t\tn.tree = targetNode.tree;\n\t\t\t\t}, true);\n\t\t\t}\n\n\t\t\t// A collaposed node won't re-render children, so we have to remove it manually\n\t\t\t// if( !targetParent.expanded ){\n\t\t\t// prevParent.ul.removeChild(this.li);\n\t\t\t// }\n\t\t\ttree._callHook(\"treeStructureChanged\", tree, \"moveTo\");\n\n\t\t\t// Update HTML markup\n\t\t\tif (!prevParent.isDescendantOf(targetParent)) {\n\t\t\t\tprevParent.render();\n\t\t\t}\n\t\t\tif (\n\t\t\t\t!targetParent.isDescendantOf(prevParent) &&\n\t\t\t\ttargetParent !== prevParent\n\t\t\t) {\n\t\t\t\ttargetParent.render();\n\t\t\t}\n\t\t\t// TODO: fix selection state\n\t\t\t// TODO: fix active state\n\n\t\t\t/*\n\t\t\tvar tree = this.tree;\n\t\t\tvar opts = tree.options;\n\t\t\tvar pers = tree.persistence;\n\n\t\t\t// Always expand, if it's below minExpandLevel\n\t\t\t// tree.logDebug (\"%s._addChildNode(%o), l=%o\", this, ftnode, ftnode.getLevel());\n\t\t\tif ( opts.minExpandLevel >= ftnode.getLevel() ) {\n\t\t\t\t// tree.logDebug (\"Force expand for %o\", ftnode);\n\t\t\t\tthis.bExpanded = true;\n\t\t\t}\n\n\t\t\t// In multi-hier mode, update the parents selection state\n\t\t\t// DT issue #82: only if not initializing, because the children may not exist yet\n\t\t\t// if( !ftnode.data.isStatusNode() && opts.selectMode==3 && !isInitializing )\n\t\t\t// \tftnode._fixSelectionState();\n\n\t\t\t// In multi-hier mode, update the parents selection state\n\t\t\tif( ftnode.bSelected && opts.selectMode==3 ) {\n\t\t\t\tvar p = this;\n\t\t\t\twhile( p ) {\n\t\t\t\t\tif( !p.hasSubSel )\n\t\t\t\t\t\tp._setSubSel(true);\n\t\t\t\t\tp = p.parent;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// render this node and the new child\n\t\t\tif ( tree.bEnableUpdate )\n\t\t\t\tthis.render();\n\t\t\treturn ftnode;\n\t\t\t*/\n\t\t},\n\t\t/** Set focus relative to this node and optionally activate.\n\t\t *\n\t\t * 'left' collapses the node if it is expanded, or move to the parent\n\t\t * otherwise.\n\t\t * 'right' expands the node if it is collapsed, or move to the first\n\t\t * child otherwise.\n\t\t *\n\t\t * @param {string|number} where 'down', 'first', 'last', 'left', 'parent', 'right', or 'up'.\n\t\t * (Alternatively the keyCode that would normally trigger this move,\n\t\t * e.g. `$.ui.keyCode.LEFT` = 'left'.\n\t\t * @param {boolean} [activate=true]\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tnavigate: function (where, activate) {\n\t\t\tvar node,\n\t\t\t\tKC = $.ui.keyCode;\n\n\t\t\t// Handle optional expand/collapse action for LEFT/RIGHT\n\t\t\tswitch (where) {\n\t\t\t\tcase \"left\":\n\t\t\t\tcase KC.LEFT:\n\t\t\t\t\tif (this.expanded) {\n\t\t\t\t\t\treturn this.setExpanded(false);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"right\":\n\t\t\t\tcase KC.RIGHT:\n\t\t\t\t\tif (!this.expanded && (this.children || this.lazy)) {\n\t\t\t\t\t\treturn this.setExpanded();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// Otherwise activate or focus the related node\n\t\t\tnode = this.findRelatedNode(where);\n\t\t\tif (node) {\n\t\t\t\t// setFocus/setActive will scroll later (if autoScroll is specified)\n\t\t\t\ttry {\n\t\t\t\t\tnode.makeVisible({ scrollIntoView: false });\n\t\t\t\t} catch (e) {} // #272\n\t\t\t\tif (activate === false) {\n\t\t\t\t\tnode.setFocus();\n\t\t\t\t\treturn _getResolvedPromise();\n\t\t\t\t}\n\t\t\t\treturn node.setActive();\n\t\t\t}\n\t\t\tthis.warn(\"Could not find related node '\" + where + \"'.\");\n\t\t\treturn _getResolvedPromise();\n\t\t},\n\t\t/**\n\t\t * Remove this node (not allowed for system root).\n\t\t */\n\t\tremove: function () {\n\t\t\treturn this.parent.removeChild(this);\n\t\t},\n\t\t/**\n\t\t * Remove childNode from list of direct children.\n\t\t * @param {FancytreeNode} childNode\n\t\t */\n\t\tremoveChild: function (childNode) {\n\t\t\treturn this.tree._callHook(\"nodeRemoveChild\", this, childNode);\n\t\t},\n\t\t/**\n\t\t * Remove all child nodes and descendents. This converts the node into a leaf.<br>\n\t\t * If this was a lazy node, it is still considered 'loaded'; call node.resetLazy()\n\t\t * in order to trigger lazyLoad on next expand.\n\t\t */\n\t\tremoveChildren: function () {\n\t\t\treturn this.tree._callHook(\"nodeRemoveChildren\", this);\n\t\t},\n\t\t/**\n\t\t * Remove class from node's span tag and .extraClasses.\n\t\t *\n\t\t * @param {string} className class name\n\t\t *\n\t\t * @since 2.17\n\t\t */\n\t\tremoveClass: function (className) {\n\t\t\treturn this.toggleClass(className, false);\n\t\t},\n\t\t/**\n\t\t * This method renders and updates all HTML markup that is required\n\t\t * to display this node in its current state.<br>\n\t\t * Note:\n\t\t * <ul>\n\t\t * <li>It should only be neccessary to call this method after the node object\n\t\t * was modified by direct access to its properties, because the common\n\t\t * API methods (node.setTitle(), moveTo(), addChildren(), remove(), ...)\n\t\t * already handle this.\n\t\t * <li> {@link FancytreeNode#renderTitle} and {@link FancytreeNode#renderStatus}\n\t\t * are implied. If changes are more local, calling only renderTitle() or\n\t\t * renderStatus() may be sufficient and faster.\n\t\t * </ul>\n\t\t *\n\t\t * @param {boolean} [force=false] re-render, even if html markup was already created\n\t\t * @param {boolean} [deep=false] also render all descendants, even if parent is collapsed\n\t\t */\n\t\trender: function (force, deep) {\n\t\t\treturn this.tree._callHook(\"nodeRender\", this, force, deep);\n\t\t},\n\t\t/** Create HTML markup for the node's outer `<span>` (expander, checkbox, icon, and title).\n\t\t * Implies {@link FancytreeNode#renderStatus}.\n\t\t * @see Fancytree_Hooks#nodeRenderTitle\n\t\t */\n\t\trenderTitle: function () {\n\t\t\treturn this.tree._callHook(\"nodeRenderTitle\", this);\n\t\t},\n\t\t/** Update element's CSS classes according to node state.\n\t\t * @see Fancytree_Hooks#nodeRenderStatus\n\t\t */\n\t\trenderStatus: function () {\n\t\t\treturn this.tree._callHook(\"nodeRenderStatus\", this);\n\t\t},\n\t\t/**\n\t\t * (experimental) Replace this node with `source`.\n\t\t * (Currently only available for paging nodes.)\n\t\t * @param {NodeData[]} source List of child node definitions\n\t\t * @since 2.15\n\t\t */\n\t\treplaceWith: function (source) {\n\t\t\tvar res,\n\t\t\t\tparent = this.parent,\n\t\t\t\tpos = $.inArray(this, parent.children),\n\t\t\t\tself = this;\n\n\t\t\t_assert(\n\t\t\t\tthis.isPagingNode(),\n\t\t\t\t\"replaceWith() currently requires a paging status node\"\n\t\t\t);\n\n\t\t\tres = this.tree._callHook(\"nodeLoadChildren\", this, source);\n\t\t\tres.done(function (data) {\n\t\t\t\t// New nodes are currently children of `this`.\n\t\t\t\tvar children = self.children;\n\t\t\t\t// Prepend newly loaded child nodes to `this`\n\t\t\t\t// Move new children after self\n\t\t\t\tfor (i = 0; i < children.length; i++) {\n\t\t\t\t\tchildren[i].parent = parent;\n\t\t\t\t}\n\t\t\t\tparent.children.splice.apply(\n\t\t\t\t\tparent.children,\n\t\t\t\t\t[pos + 1, 0].concat(children)\n\t\t\t\t);\n\n\t\t\t\t// Remove self\n\t\t\t\tself.children = null;\n\t\t\t\tself.remove();\n\t\t\t\t// Redraw new nodes\n\t\t\t\tparent.render();\n\t\t\t\t// TODO: set node.partload = false if this was tha last paging node?\n\t\t\t\t// parent.addPagingNode(false);\n\t\t\t}).fail(function () {\n\t\t\t\tself.setExpanded();\n\t\t\t});\n\t\t\treturn res;\n\t\t\t// $.error(\"Not implemented: replaceWith()\");\n\t\t},\n\t\t/**\n\t\t * Remove all children, collapse, and set the lazy-flag, so that the lazyLoad\n\t\t * event is triggered on next expand.\n\t\t */\n\t\tresetLazy: function () {\n\t\t\tthis.removeChildren();\n\t\t\tthis.expanded = false;\n\t\t\tthis.lazy = true;\n\t\t\tthis.children = undefined;\n\t\t\tthis.renderStatus();\n\t\t},\n\t\t/** Schedule activity for delayed execution (cancel any pending request).\n\t\t * scheduleAction('cancel') will only cancel a pending request (if any).\n\t\t * @param {string} mode\n\t\t * @param {number} ms\n\t\t */\n\t\tscheduleAction: function (mode, ms) {\n\t\t\tif (this.tree.timer) {\n\t\t\t\tclearTimeout(this.tree.timer);\n\t\t\t\tthis.tree.debug(\"clearTimeout(%o)\", this.tree.timer);\n\t\t\t}\n\t\t\tthis.tree.timer = null;\n\t\t\tvar self = this; // required for closures\n\t\t\tswitch (mode) {\n\t\t\t\tcase \"cancel\":\n\t\t\t\t\t// Simply made sure that timer was cleared\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"expand\":\n\t\t\t\t\tthis.tree.timer = setTimeout(function () {\n\t\t\t\t\t\tself.tree.debug(\"setTimeout: trigger expand\");\n\t\t\t\t\t\tself.setExpanded(true);\n\t\t\t\t\t}, ms);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"activate\":\n\t\t\t\t\tthis.tree.timer = setTimeout(function () {\n\t\t\t\t\t\tself.tree.debug(\"setTimeout: trigger activate\");\n\t\t\t\t\t\tself.setActive(true);\n\t\t\t\t\t}, ms);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$.error(\"Invalid mode \" + mode);\n\t\t\t}\n\t\t\t// this.tree.debug(\"setTimeout(%s, %s): %s\", mode, ms, this.tree.timer);\n\t\t},\n\t\t/**\n\t\t *\n\t\t * @param {boolean | PlainObject} [effects=false] animation options.\n\t\t * @param {object} [options=null] {topNode: null, effects: ..., parent: ...} this node will remain visible in\n\t\t * any case, even if `this` is outside the scroll pane.\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tscrollIntoView: function (effects, options) {\n\t\t\tif (options !== undefined && _isNode(options)) {\n\t\t\t\tthrow Error(\n\t\t\t\t\t\"scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' instead.\"\n\t\t\t\t);\n\t\t\t}\n\t\t\t// The scroll parent is typically the plain tree's <UL> container.\n\t\t\t// For ext-table, we choose the nearest parent that has `position: relative`\n\t\t\t// and `overflow` set.\n\t\t\t// (This default can be overridden by the local or global `scrollParent` option.)\n\t\t\tvar opts = $.extend(\n\t\t\t\t\t{\n\t\t\t\t\t\teffects:\n\t\t\t\t\t\t\teffects === true\n\t\t\t\t\t\t\t\t? { duration: 200, queue: false }\n\t\t\t\t\t\t\t\t: effects,\n\t\t\t\t\t\tscrollOfs: this.tree.options.scrollOfs,\n\t\t\t\t\t\tscrollParent: this.tree.options.scrollParent,\n\t\t\t\t\t\ttopNode: null,\n\t\t\t\t\t},\n\t\t\t\t\toptions\n\t\t\t\t),\n\t\t\t\t$scrollParent = opts.scrollParent,\n\t\t\t\t$container = this.tree.$container,\n\t\t\t\toverflowY = $container.css(\"overflow-y\");\n\n\t\t\tif (!$scrollParent) {\n\t\t\t\tif (this.tree.tbody) {\n\t\t\t\t\t$scrollParent = $container.scrollParent();\n\t\t\t\t} else if (overflowY === \"scroll\" || overflowY === \"auto\") {\n\t\t\t\t\t$scrollParent = $container;\n\t\t\t\t} else {\n\t\t\t\t\t// #922 plain tree in a non-fixed-sized UL scrolls inside its parent\n\t\t\t\t\t$scrollParent = $container.scrollParent();\n\t\t\t\t}\n\t\t\t} else if (!$scrollParent.jquery) {\n\t\t\t\t// Make sure we have a jQuery object\n\t\t\t\t$scrollParent = $($scrollParent);\n\t\t\t}\n\t\t\tif (\n\t\t\t\t$scrollParent[0] === document ||\n\t\t\t\t$scrollParent[0] === document.body\n\t\t\t) {\n\t\t\t\t// `document` may be returned by $().scrollParent(), if nothing is found,\n\t\t\t\t// but would not work: (see #894)\n\t\t\t\tthis.debug(\n\t\t\t\t\t\"scrollIntoView(): normalizing scrollParent to 'window':\",\n\t\t\t\t\t$scrollParent[0]\n\t\t\t\t);\n\t\t\t\t$scrollParent = $(window);\n\t\t\t}\n\t\t\t// eslint-disable-next-line one-var\n\t\t\tvar topNodeY,\n\t\t\t\tnodeY,\n\t\t\t\thorzScrollbarHeight,\n\t\t\t\tcontainerOffsetTop,\n\t\t\t\tdfd = new $.Deferred(),\n\t\t\t\tself = this,\n\t\t\t\tnodeHeight = $(this.span).height(),\n\t\t\t\ttopOfs = opts.scrollOfs.top || 0,\n\t\t\t\tbottomOfs = opts.scrollOfs.bottom || 0,\n\t\t\t\tcontainerHeight = $scrollParent.height(),\n\t\t\t\tscrollTop = $scrollParent.scrollTop(),\n\t\t\t\t$animateTarget = $scrollParent,\n\t\t\t\tisParentWindow = $scrollParent[0] === window,\n\t\t\t\ttopNode = opts.topNode || null,\n\t\t\t\tnewScrollTop = null;\n\n\t\t\t// this.debug(\"scrollIntoView(), scrollTop=\" + scrollTop, opts.scrollOfs);\n\t\t\t// _assert($(this.span).is(\":visible\"), \"scrollIntoView node is invisible\"); // otherwise we cannot calc offsets\n\t\t\tif (this.isRootNode() || !this.isVisible()) {\n\t\t\t\t// We cannot calc offsets for hidden elements\n\t\t\t\tthis.info(\"scrollIntoView(): node is invisible.\");\n\t\t\t\treturn _getResolvedPromise();\n\t\t\t}\n\t\t\tif (isParentWindow) {\n\t\t\t\tnodeY = $(this.span).offset().top;\n\t\t\t\ttopNodeY =\n\t\t\t\t\ttopNode && topNode.span ? $(topNode.span).offset().top : 0;\n\t\t\t\t$animateTarget = $(\"html,body\");\n\t\t\t} else {\n\t\t\t\t_assert(\n\t\t\t\t\t$scrollParent[0] !== document &&\n\t\t\t\t\t\t$scrollParent[0] !== document.body,\n\t\t\t\t\t\"scrollParent should be a simple element or `window`, not document or body.\"\n\t\t\t\t);\n\n\t\t\t\tcontainerOffsetTop = $scrollParent.offset().top;\n\t\t\t\tnodeY =\n\t\t\t\t\t$(this.span).offset().top - containerOffsetTop + scrollTop; // relative to scroll parent\n\t\t\t\ttopNodeY = topNode\n\t\t\t\t\t? $(topNode.span).offset().top -\n\t\t\t\t\t containerOffsetTop +\n\t\t\t\t\t scrollTop\n\t\t\t\t\t: 0;\n\t\t\t\thorzScrollbarHeight = Math.max(\n\t\t\t\t\t0,\n\t\t\t\t\t$scrollParent.innerHeight() - $scrollParent[0].clientHeight\n\t\t\t\t);\n\t\t\t\tcontainerHeight -= horzScrollbarHeight;\n\t\t\t}\n\n\t\t\t// this.debug(\" scrollIntoView(), nodeY=\" + nodeY + \", containerHeight=\" + containerHeight);\n\t\t\tif (nodeY < scrollTop + topOfs) {\n\t\t\t\t// Node is above visible container area\n\t\t\t\tnewScrollTop = nodeY - topOfs;\n\t\t\t\t// this.debug(\" scrollIntoView(), UPPER newScrollTop=\" + newScrollTop);\n\t\t\t} else if (\n\t\t\t\tnodeY + nodeHeight >\n\t\t\t\tscrollTop + containerHeight - bottomOfs\n\t\t\t) {\n\t\t\t\tnewScrollTop = nodeY + nodeHeight - containerHeight + bottomOfs;\n\t\t\t\t// this.debug(\" scrollIntoView(), LOWER newScrollTop=\" + newScrollTop);\n\t\t\t\t// If a topNode was passed, make sure that it is never scrolled\n\t\t\t\t// outside the upper border\n\t\t\t\tif (topNode) {\n\t\t\t\t\t_assert(\n\t\t\t\t\t\ttopNode.isRootNode() || topNode.isVisible(),\n\t\t\t\t\t\t\"topNode must be visible\"\n\t\t\t\t\t);\n\t\t\t\t\tif (topNodeY < newScrollTop) {\n\t\t\t\t\t\tnewScrollTop = topNodeY - topOfs;\n\t\t\t\t\t\t// this.debug(\" scrollIntoView(), TOP newScrollTop=\" + newScrollTop);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (newScrollTop === null) {\n\t\t\t\tdfd.resolveWith(this);\n\t\t\t} else {\n\t\t\t\t// this.debug(\" scrollIntoView(), SET newScrollTop=\" + newScrollTop);\n\t\t\t\tif (opts.effects) {\n\t\t\t\t\topts.effects.complete = function () {\n\t\t\t\t\t\tdfd.resolveWith(self);\n\t\t\t\t\t};\n\t\t\t\t\t$animateTarget.stop(true).animate(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tscrollTop: newScrollTop,\n\t\t\t\t\t\t},\n\t\t\t\t\t\topts.effects\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$animateTarget[0].scrollTop = newScrollTop;\n\t\t\t\t\tdfd.resolveWith(this);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dfd.promise();\n\t\t},\n\n\t\t/**Activate this node.\n\t\t *\n\t\t * The `cell` option requires the ext-table and ext-ariagrid extensions.\n\t\t *\n\t\t * @param {boolean} [flag=true] pass false to deactivate\n\t\t * @param {object} [opts] additional options. Defaults to {noEvents: false, noFocus: false, cell: null}\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tsetActive: function (flag, opts) {\n\t\t\treturn this.tree._callHook(\"nodeSetActive\", this, flag, opts);\n\t\t},\n\t\t/**Expand or collapse this node. Promise is resolved, when lazy loading and animations are done.\n\t\t * @param {boolean} [flag=true] pass false to collapse\n\t\t * @param {object} [opts] additional options. Defaults to {noAnimation: false, noEvents: false}\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tsetExpanded: function (flag, opts) {\n\t\t\treturn this.tree._callHook(\"nodeSetExpanded\", this, flag, opts);\n\t\t},\n\t\t/**Set keyboard focus to this node.\n\t\t * @param {boolean} [flag=true] pass false to blur\n\t\t * @see Fancytree#setFocus\n\t\t */\n\t\tsetFocus: function (flag) {\n\t\t\treturn this.tree._callHook(\"nodeSetFocus\", this, flag);\n\t\t},\n\t\t/**Select this node, i.e. check the checkbox.\n\t\t * @param {boolean} [flag=true] pass false to deselect\n\t\t * @param {object} [opts] additional options. Defaults to {noEvents: false, p\n\t\t * propagateDown: null, propagateUp: null, callback: null }\n\t\t */\n\t\tsetSelected: function (flag, opts) {\n\t\t\treturn this.tree._callHook(\"nodeSetSelected\", this, flag, opts);\n\t\t},\n\t\t/**Mark a lazy node as 'error', 'loading', 'nodata', or 'ok'.\n\t\t * @param {string} status 'error'|'loading'|'nodata'|'ok'\n\t\t * @param {string} [message]\n\t\t * @param {string} [details]\n\t\t */\n\t\tsetStatus: function (status, message, details) {\n\t\t\treturn this.tree._callHook(\n\t\t\t\t\"nodeSetStatus\",\n\t\t\t\tthis,\n\t\t\t\tstatus,\n\t\t\t\tmessage,\n\t\t\t\tdetails\n\t\t\t);\n\t\t},\n\t\t/**Rename this node.\n\t\t * @param {string} title\n\t\t */\n\t\tsetTitle: function (title) {\n\t\t\tthis.title = title;\n\t\t\tthis.renderTitle();\n\t\t\tthis.triggerModify(\"rename\");\n\t\t},\n\t\t/**Sort child list by title.\n\t\t * @param {function} [cmp] custom compare function(a, b) that returns -1, 0, or 1 (defaults to sort by title).\n\t\t * @param {boolean} [deep=false] pass true to sort all descendant nodes\n\t\t */\n\t\tsortChildren: function (cmp, deep) {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tcl = this.children;\n\n\t\t\tif (!cl) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcmp =\n\t\t\t\tcmp ||\n\t\t\t\tfunction (a, b) {\n\t\t\t\t\tvar x = a.title.toLowerCase(),\n\t\t\t\t\t\ty = b.title.toLowerCase();\n\n\t\t\t\t\t// eslint-disable-next-line no-nested-ternary\n\t\t\t\t\treturn x === y ? 0 : x > y ? 1 : -1;\n\t\t\t\t};\n\t\t\tcl.sort(cmp);\n\t\t\tif (deep) {\n\t\t\t\tfor (i = 0, l = cl.length; i < l; i++) {\n\t\t\t\t\tif (cl[i].children) {\n\t\t\t\t\t\tcl[i].sortChildren(cmp, \"$norender$\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (deep !== \"$norender$\") {\n\t\t\t\tthis.render();\n\t\t\t}\n\t\t\tthis.triggerModifyChild(\"sort\");\n\t\t},\n\t\t/** Convert node (or whole branch) into a plain object.\n\t\t *\n\t\t * The result is compatible with node.addChildren().\n\t\t *\n\t\t * @param {boolean} [recursive=false] include child nodes\n\t\t * @param {function} [callback] callback(dict, node) is called for every node, in order to allow modifications.\n\t\t * Return `false` to ignore this node or `\"skip\"` to include this node without its children.\n\t\t * @returns {NodeData}\n\t\t */\n\t\ttoDict: function (recursive, callback) {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tnode,\n\t\t\t\tres,\n\t\t\t\tdict = {},\n\t\t\t\tself = this;\n\n\t\t\t$.each(NODE_ATTRS, function (i, a) {\n\t\t\t\tif (self[a] || self[a] === false) {\n\t\t\t\t\tdict[a] = self[a];\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (!$.isEmptyObject(this.data)) {\n\t\t\t\tdict.data = $.extend({}, this.data);\n\t\t\t\tif ($.isEmptyObject(dict.data)) {\n\t\t\t\t\tdelete dict.data;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (callback) {\n\t\t\t\tres = callback(dict, self);\n\t\t\t\tif (res === false) {\n\t\t\t\t\treturn false; // Don't include this node nor its children\n\t\t\t\t}\n\t\t\t\tif (res === \"skip\") {\n\t\t\t\t\trecursive = false; // Include this node, but not the children\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (recursive) {\n\t\t\t\tif (_isArray(this.children)) {\n\t\t\t\t\tdict.children = [];\n\t\t\t\t\tfor (i = 0, l = this.children.length; i < l; i++) {\n\t\t\t\t\t\tnode = this.children[i];\n\t\t\t\t\t\tif (!node.isStatusNode()) {\n\t\t\t\t\t\t\tres = node.toDict(true, callback);\n\t\t\t\t\t\t\tif (res !== false) {\n\t\t\t\t\t\t\t\tdict.children.push(res);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dict;\n\t\t},\n\t\t/**\n\t\t * Set, clear, or toggle class of node's span tag and .extraClasses.\n\t\t *\n\t\t * @param {string} className class name (separate multiple classes by space)\n\t\t * @param {boolean} [flag] true/false to add/remove class. If omitted, class is toggled.\n\t\t * @returns {boolean} true if a class was added\n\t\t *\n\t\t * @since 2.17\n\t\t */\n\t\ttoggleClass: function (value, flag) {\n\t\t\tvar className,\n\t\t\t\thasClass,\n\t\t\t\trnotwhite = /\\S+/g,\n\t\t\t\tclassNames = value.match(rnotwhite) || [],\n\t\t\t\ti = 0,\n\t\t\t\twasAdded = false,\n\t\t\t\tstatusElem = this[this.tree.statusClassPropName],\n\t\t\t\tcurClasses = \" \" + (this.extraClasses || \"\") + \" \";\n\n\t\t\t// this.info(\"toggleClass('\" + value + \"', \" + flag + \")\", curClasses);\n\t\t\t// Modify DOM element directly if it already exists\n\t\t\tif (statusElem) {\n\t\t\t\t$(statusElem).toggleClass(value, flag);\n\t\t\t}\n\t\t\t// Modify node.extraClasses to make this change persistent\n\t\t\t// Toggle if flag was not passed\n\t\t\twhile ((className = classNames[i++])) {\n\t\t\t\thasClass = curClasses.indexOf(\" \" + className + \" \") >= 0;\n\t\t\t\tflag = flag === undefined ? !hasClass : !!flag;\n\t\t\t\tif (flag) {\n\t\t\t\t\tif (!hasClass) {\n\t\t\t\t\t\tcurClasses += className + \" \";\n\t\t\t\t\t\twasAdded = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twhile (curClasses.indexOf(\" \" + className + \" \") > -1) {\n\t\t\t\t\t\tcurClasses = curClasses.replace(\n\t\t\t\t\t\t\t\" \" + className + \" \",\n\t\t\t\t\t\t\t\" \"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.extraClasses = _trim(curClasses);\n\t\t\t// this.info(\"-> toggleClass('\" + value + \"', \" + flag + \"): '\" + this.extraClasses + \"'\");\n\t\t\treturn wasAdded;\n\t\t},\n\t\t/** Flip expanded status. */\n\t\ttoggleExpanded: function () {\n\t\t\treturn this.tree._callHook(\"nodeToggleExpanded\", this);\n\t\t},\n\t\t/** Flip selection status. */\n\t\ttoggleSelected: function () {\n\t\t\treturn this.tree._callHook(\"nodeToggleSelected\", this);\n\t\t},\n\t\ttoString: function () {\n\t\t\treturn \"FancytreeNode@\" + this.key + \"[title='\" + this.title + \"']\";\n\t\t\t// return \"<FancytreeNode(#\" + this.key + \", '\" + this.title + \"')>\";\n\t\t},\n\t\t/**\n\t\t * Trigger `modifyChild` event on a parent to signal that a child was modified.\n\t\t * @param {string} operation Type of change: 'add', 'remove', 'rename', 'move', 'data', ...\n\t\t * @param {FancytreeNode} [childNode]\n\t\t * @param {object} [extra]\n\t\t */\n\t\ttriggerModifyChild: function (operation, childNode, extra) {\n\t\t\tvar data,\n\t\t\t\tmodifyChild = this.tree.options.modifyChild;\n\n\t\t\tif (modifyChild) {\n\t\t\t\tif (childNode && childNode.parent !== this) {\n\t\t\t\t\t$.error(\n\t\t\t\t\t\t\"childNode \" + childNode + \" is not a child of \" + this\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tdata = {\n\t\t\t\t\tnode: this,\n\t\t\t\t\ttree: this.tree,\n\t\t\t\t\toperation: operation,\n\t\t\t\t\tchildNode: childNode || null,\n\t\t\t\t};\n\t\t\t\tif (extra) {\n\t\t\t\t\t$.extend(data, extra);\n\t\t\t\t}\n\t\t\t\tmodifyChild({ type: \"modifyChild\" }, data);\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Trigger `modifyChild` event on node.parent(!).\n\t\t * @param {string} operation Type of change: 'add', 'remove', 'rename', 'move', 'data', ...\n\t\t * @param {object} [extra]\n\t\t */\n\t\ttriggerModify: function (operation, extra) {\n\t\t\tthis.parent.triggerModifyChild(operation, this, extra);\n\t\t},\n\t\t/** Call fn(node) for all child nodes in hierarchical order (depth-first).<br>\n\t\t * Stop iteration, if fn() returns false. Skip current branch, if fn() returns \"skip\".<br>\n\t\t * Return false if iteration was stopped.\n\t\t *\n\t\t * @param {function} fn the callback function.\n\t\t * Return false to stop iteration, return \"skip\" to skip this node and\n\t\t * its children only.\n\t\t * @param {boolean} [includeSelf=false]\n\t\t * @returns {boolean}\n\t\t */\n\t\tvisit: function (fn, includeSelf) {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tres = true,\n\t\t\t\tchildren = this.children;\n\n\t\t\tif (includeSelf === true) {\n\t\t\t\tres = fn(this);\n\t\t\t\tif (res === false || res === \"skip\") {\n\t\t\t\t\treturn res;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (children) {\n\t\t\t\tfor (i = 0, l = children.length; i < l; i++) {\n\t\t\t\t\tres = children[i].visit(fn, true);\n\t\t\t\t\tif (res === false) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t/** Call fn(node) for all child nodes and recursively load lazy children.<br>\n\t\t * <b>Note:</b> If you need this method, you probably should consider to review\n\t\t * your architecture! Recursivley loading nodes is a perfect way for lazy\n\t\t * programmers to flood the server with requests ;-)\n\t\t *\n\t\t * @param {function} [fn] optional callback function.\n\t\t * Return false to stop iteration, return \"skip\" to skip this node and\n\t\t * its children only.\n\t\t * @param {boolean} [includeSelf=false]\n\t\t * @returns {$.Promise}\n\t\t * @since 2.4\n\t\t */\n\t\tvisitAndLoad: function (fn, includeSelf, _recursion) {\n\t\t\tvar dfd,\n\t\t\t\tres,\n\t\t\t\tloaders,\n\t\t\t\tnode = this;\n\n\t\t\t// node.debug(\"visitAndLoad\");\n\t\t\tif (fn && includeSelf === true) {\n\t\t\t\tres = fn(node);\n\t\t\t\tif (res === false || res === \"skip\") {\n\t\t\t\t\treturn _recursion ? res : _getResolvedPromise();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!node.children && !node.lazy) {\n\t\t\t\treturn _getResolvedPromise();\n\t\t\t}\n\t\t\tdfd = new $.Deferred();\n\t\t\tloaders = [];\n\t\t\t// node.debug(\"load()...\");\n\t\t\tnode.load().done(function () {\n\t\t\t\t// node.debug(\"load()... done.\");\n\t\t\t\tfor (var i = 0, l = node.children.length; i < l; i++) {\n\t\t\t\t\tres = node.children[i].visitAndLoad(fn, true, true);\n\t\t\t\t\tif (res === false) {\n\t\t\t\t\t\tdfd.reject();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (res !== \"skip\") {\n\t\t\t\t\t\tloaders.push(res); // Add promise to the list\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$.when.apply(this, loaders).then(function () {\n\t\t\t\t\tdfd.resolve();\n\t\t\t\t});\n\t\t\t});\n\t\t\treturn dfd.promise();\n\t\t},\n\t\t/** Call fn(node) for all parent nodes, bottom-up, including invisible system root.<br>\n\t\t * Stop iteration, if fn() returns false.<br>\n\t\t * Return false if iteration was stopped.\n\t\t *\n\t\t * @param {function} fn the callback function.\n\t\t * Return false to stop iteration, return \"skip\" to skip this node and children only.\n\t\t * @param {boolean} [includeSelf=false]\n\t\t * @returns {boolean}\n\t\t */\n\t\tvisitParents: function (fn, includeSelf) {\n\t\t\t// Visit parent nodes (bottom up)\n\t\t\tif (includeSelf && fn(this) === false) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar p = this.parent;\n\t\t\twhile (p) {\n\t\t\t\tif (fn(p) === false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tp = p.parent;\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\t/** Call fn(node) for all sibling nodes.<br>\n\t\t * Stop iteration, if fn() returns false.<br>\n\t\t * Return false if iteration was stopped.\n\t\t *\n\t\t * @param {function} fn the callback function.\n\t\t * Return false to stop iteration.\n\t\t * @param {boolean} [includeSelf=false]\n\t\t * @returns {boolean}\n\t\t */\n\t\tvisitSiblings: function (fn, includeSelf) {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tn,\n\t\t\t\tac = this.parent.children;\n\n\t\t\tfor (i = 0, l = ac.length; i < l; i++) {\n\t\t\t\tn = ac[i];\n\t\t\t\tif (includeSelf || n !== this) {\n\t\t\t\t\tif (fn(n) === false) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\t/** Write warning to browser console if debugLevel >= 2 (prepending node info)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\twarn: function (msg) {\n\t\t\tif (this.tree.options.debugLevel >= 2) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"warn\", arguments);\n\t\t\t}\n\t\t},\n\t};\n\n\t/******************************************************************************\n\t * Fancytree\n\t */\n\t/**\n\t * Construct a new tree object.\n\t *\n\t * @class Fancytree\n\t * @classdesc The controller behind a fancytree.\n\t * This class also contains 'hook methods': see {@link Fancytree_Hooks}.\n\t *\n\t * @param {Widget} widget\n\t *\n\t * @property {string} _id Automatically generated unique tree instance ID, e.g. \"1\".\n\t * @property {string} _ns Automatically generated unique tree namespace, e.g. \".fancytree-1\".\n\t * @property {FancytreeNode} activeNode Currently active node or null.\n\t * @property {string} ariaPropName Property name of FancytreeNode that contains the element which will receive the aria attributes.\n\t * Typically \"li\", but \"tr\" for table extension.\n\t * @property {jQueryObject} $container Outer `<ul>` element (or `<table>` element for ext-table).\n\t * @property {jQueryObject} $div A jQuery object containing the element used to instantiate the tree widget (`widget.element`)\n\t * @property {object|array} columns Recommended place to store shared column meta data. @since 2.27\n\t * @property {object} data Metadata, i.e. properties that may be passed to `source` in addition to a children array.\n\t * @property {object} ext Hash of all active plugin instances.\n\t * @property {FancytreeNode} focusNode Currently focused node or null.\n\t * @property {FancytreeNode} lastSelectedNode Used to implement selectMode 1 (single select)\n\t * @property {string} nodeContainerAttrName Property name of FancytreeNode that contains the outer element of single nodes.\n\t * Typically \"li\", but \"tr\" for table extension.\n\t * @property {FancytreeOptions} options Current options, i.e. default options + options passed to constructor.\n\t * @property {FancytreeNode} rootNode Invisible system root node.\n\t * @property {string} statusClassPropName Property name of FancytreeNode that contains the element which will receive the status classes.\n\t * Typically \"span\", but \"tr\" for table extension.\n\t * @property {object} types Map for shared type specific meta data, used with node.type attribute. @since 2.27\n\t * @property {object} viewport See ext-vieport. @since v2.31\n\t * @property {object} widget Base widget instance.\n\t */\n\tfunction Fancytree(widget) {\n\t\tthis.widget = widget;\n\t\tthis.$div = widget.element;\n\t\tthis.options = widget.options;\n\t\tif (this.options) {\n\t\t\tif (this.options.lazyload !== undefined) {\n\t\t\t\t$.error(\n\t\t\t\t\t\"The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead.\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.options.loaderror !== undefined) {\n\t\t\t\t$.error(\n\t\t\t\t\t\"The 'loaderror' event was renamed since 2014-07-03. Use 'loadError' (with uppercase E) instead.\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.options.fx !== undefined) {\n\t\t\t\t$.error(\n\t\t\t\t\t\"The 'fx' option was replaced by 'toggleEffect' since 2014-11-30.\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.options.removeNode !== undefined) {\n\t\t\t\t$.error(\n\t\t\t\t\t\"The 'removeNode' event was replaced by 'modifyChild' since 2.20 (2016-09-10).\"\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthis.ext = {}; // Active extension instances\n\t\tthis.types = {};\n\t\tthis.columns = {};\n\t\t// allow to init tree.data.foo from <div data-foo=''>\n\t\tthis.data = _getElementDataAsDict(this.$div);\n\t\t// TODO: use widget.uuid instead?\n\t\tthis._id = \"\" + (this.options.treeId || $.ui.fancytree._nextId++);\n\t\t// TODO: use widget.eventNamespace instead?\n\t\tthis._ns = \".fancytree-\" + this._id; // append for namespaced events\n\t\tthis.activeNode = null;\n\t\tthis.focusNode = null;\n\t\tthis._hasFocus = null;\n\t\tthis._tempCache = {};\n\t\tthis._lastMousedownNode = null;\n\t\tthis._enableUpdate = true;\n\t\tthis.lastSelectedNode = null;\n\t\tthis.systemFocusElement = null;\n\t\tthis.lastQuicksearchTerm = \"\";\n\t\tthis.lastQuicksearchTime = 0;\n\t\tthis.viewport = null; // ext-grid\n\n\t\tthis.statusClassPropName = \"span\";\n\t\tthis.ariaPropName = \"li\";\n\t\tthis.nodeContainerAttrName = \"li\";\n\n\t\t// Remove previous markup if any\n\t\tthis.$div.find(\">ul.fancytree-container\").remove();\n\n\t\t// Create a node without parent.\n\t\tvar fakeParent = { tree: this },\n\t\t\t$ul;\n\t\tthis.rootNode = new FancytreeNode(fakeParent, {\n\t\t\ttitle: \"root\",\n\t\t\tkey: \"root_\" + this._id,\n\t\t\tchildren: null,\n\t\t\texpanded: true,\n\t\t});\n\t\tthis.rootNode.parent = null;\n\n\t\t// Create root markup\n\t\t$ul = $(\"<ul>\", {\n\t\t\tid: \"ft-id-\" + this._id,\n\t\t\tclass: \"ui-fancytree fancytree-container fancytree-plain\",\n\t\t}).appendTo(this.$div);\n\t\tthis.$container = $ul;\n\t\tthis.rootNode.ul = $ul[0];\n\n\t\tif (this.options.debugLevel == null) {\n\t\t\tthis.options.debugLevel = FT.debugLevel;\n\t\t}\n\t\t// // Add container to the TAB chain\n\t\t// // See http://www.w3.org/TR/wai-aria-practices/#focus_activedescendant\n\t\t// // #577: Allow to set tabindex to \"0\", \"-1\" and \"\"\n\t\t// this.$container.attr(\"tabindex\", this.options.tabindex);\n\n\t\t// if( this.options.rtl ) {\n\t\t// \tthis.$container.attr(\"DIR\", \"RTL\").addClass(\"fancytree-rtl\");\n\t\t// // }else{\n\t\t// //\tthis.$container.attr(\"DIR\", null).removeClass(\"fancytree-rtl\");\n\t\t// }\n\t\t// if(this.options.aria){\n\t\t// \tthis.$container.attr(\"role\", \"tree\");\n\t\t// \tif( this.options.selectMode !== 1 ) {\n\t\t// \t\tthis.$container.attr(\"aria-multiselectable\", true);\n\t\t// \t}\n\t\t// }\n\t}\n\n\tFancytree.prototype = /** @lends Fancytree# */ {\n\t\t/* Return a context object that can be re-used for _callHook().\n\t\t * @param {Fancytree | FancytreeNode | EventData} obj\n\t\t * @param {Event} originalEvent\n\t\t * @param {Object} extra\n\t\t * @returns {EventData}\n\t\t */\n\t\t_makeHookContext: function (obj, originalEvent, extra) {\n\t\t\tvar ctx, tree;\n\t\t\tif (obj.node !== undefined) {\n\t\t\t\t// obj is already a context object\n\t\t\t\tif (originalEvent && obj.originalEvent !== originalEvent) {\n\t\t\t\t\t$.error(\"invalid args\");\n\t\t\t\t}\n\t\t\t\tctx = obj;\n\t\t\t} else if (obj.tree) {\n\t\t\t\t// obj is a FancytreeNode\n\t\t\t\ttree = obj.tree;\n\t\t\t\tctx = {\n\t\t\t\t\tnode: obj,\n\t\t\t\t\ttree: tree,\n\t\t\t\t\twidget: tree.widget,\n\t\t\t\t\toptions: tree.widget.options,\n\t\t\t\t\toriginalEvent: originalEvent,\n\t\t\t\t\ttypeInfo: tree.types[obj.type] || {},\n\t\t\t\t};\n\t\t\t} else if (obj.widget) {\n\t\t\t\t// obj is a Fancytree\n\t\t\t\tctx = {\n\t\t\t\t\tnode: null,\n\t\t\t\t\ttree: obj,\n\t\t\t\t\twidget: obj.widget,\n\t\t\t\t\toptions: obj.widget.options,\n\t\t\t\t\toriginalEvent: originalEvent,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t$.error(\"invalid args\");\n\t\t\t}\n\t\t\tif (extra) {\n\t\t\t\t$.extend(ctx, extra);\n\t\t\t}\n\t\t\treturn ctx;\n\t\t},\n\t\t/* Trigger a hook function: funcName(ctx, [...]).\n\t\t *\n\t\t * @param {string} funcName\n\t\t * @param {Fancytree|FancytreeNode|EventData} contextObject\n\t\t * @param {any} [_extraArgs] optional additional arguments\n\t\t * @returns {any}\n\t\t */\n\t\t_callHook: function (funcName, contextObject, _extraArgs) {\n\t\t\tvar ctx = this._makeHookContext(contextObject),\n\t\t\t\tfn = this[funcName],\n\t\t\t\targs = Array.prototype.slice.call(arguments, 2);\n\t\t\tif (!_isFunction(fn)) {\n\t\t\t\t$.error(\"_callHook('\" + funcName + \"') is not a function\");\n\t\t\t}\n\t\t\targs.unshift(ctx);\n\t\t\t// this.debug(\"_hook\", funcName, ctx.node && ctx.node.toString() || ctx.tree.toString(), args);\n\t\t\treturn fn.apply(this, args);\n\t\t},\n\t\t_setExpiringValue: function (key, value, ms) {\n\t\t\tthis._tempCache[key] = {\n\t\t\t\tvalue: value,\n\t\t\t\texpire: Date.now() + (+ms || 50),\n\t\t\t};\n\t\t},\n\t\t_getExpiringValue: function (key) {\n\t\t\tvar entry = this._tempCache[key];\n\t\t\tif (entry && entry.expire > Date.now()) {\n\t\t\t\treturn entry.value;\n\t\t\t}\n\t\t\tdelete this._tempCache[key];\n\t\t\treturn null;\n\t\t},\n\t\t/* Check if this tree has extension `name` enabled.\n\t\t *\n\t\t * @param {string} name name of the required extension\n\t\t */\n\t\t_usesExtension: function (name) {\n\t\t\treturn $.inArray(name, this.options.extensions) >= 0;\n\t\t},\n\t\t/* Check if current extensions dependencies are met and throw an error if not.\n\t\t *\n\t\t * This method may be called inside the `treeInit` hook for custom extensions.\n\t\t *\n\t\t * @param {string} name name of the required extension\n\t\t * @param {boolean} [required=true] pass `false` if the extension is optional, but we want to check for order if it is present\n\t\t * @param {boolean} [before] `true` if `name` must be included before this, `false` otherwise (use `null` if order doesn't matter)\n\t\t * @param {string} [message] optional error message (defaults to a descriptve error message)\n\t\t */\n\t\t_requireExtension: function (name, required, before, message) {\n\t\t\tif (before != null) {\n\t\t\t\tbefore = !!before;\n\t\t\t}\n\t\t\tvar thisName = this._local.name,\n\t\t\t\textList = this.options.extensions,\n\t\t\t\tisBefore =\n\t\t\t\t\t$.inArray(name, extList) < $.inArray(thisName, extList),\n\t\t\t\tisMissing = required && this.ext[name] == null,\n\t\t\t\tbadOrder = !isMissing && before != null && before !== isBefore;\n\n\t\t\t_assert(\n\t\t\t\tthisName && thisName !== name,\n\t\t\t\t\"invalid or same name '\" + thisName + \"' (require yourself?)\"\n\t\t\t);\n\n\t\t\tif (isMissing || badOrder) {\n\t\t\t\tif (!message) {\n\t\t\t\t\tif (isMissing || required) {\n\t\t\t\t\t\tmessage =\n\t\t\t\t\t\t\t\"'\" +\n\t\t\t\t\t\t\tthisName +\n\t\t\t\t\t\t\t\"' extension requires '\" +\n\t\t\t\t\t\t\tname +\n\t\t\t\t\t\t\t\"'\";\n\t\t\t\t\t\tif (badOrder) {\n\t\t\t\t\t\t\tmessage +=\n\t\t\t\t\t\t\t\t\" to be registered \" +\n\t\t\t\t\t\t\t\t(before ? \"before\" : \"after\") +\n\t\t\t\t\t\t\t\t\" itself\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmessage =\n\t\t\t\t\t\t\t\"If used together, `\" +\n\t\t\t\t\t\t\tname +\n\t\t\t\t\t\t\t\"` must be registered \" +\n\t\t\t\t\t\t\t(before ? \"before\" : \"after\") +\n\t\t\t\t\t\t\t\" `\" +\n\t\t\t\t\t\t\tthisName +\n\t\t\t\t\t\t\t\"`\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$.error(message);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\t/** Activate node with a given key and fire focus and activate events.\n\t\t *\n\t\t * A previously activated node will be deactivated.\n\t\t * If activeVisible option is set, all parents will be expanded as necessary.\n\t\t * Pass key = false, to deactivate the current node only.\n\t\t * @param {string} key\n\t\t * @param {object} [opts] additional options. Defaults to {noEvents: false, noFocus: false}\n\t\t * @returns {FancytreeNode} activated node (null, if not found)\n\t\t */\n\t\tactivateKey: function (key, opts) {\n\t\t\tvar node = this.getNodeByKey(key);\n\t\t\tif (node) {\n\t\t\t\tnode.setActive(true, opts);\n\t\t\t} else if (this.activeNode) {\n\t\t\t\tthis.activeNode.setActive(false, opts);\n\t\t\t}\n\t\t\treturn node;\n\t\t},\n\t\t/** (experimental) Add child status nodes that indicate 'More...', ....\n\t\t * @param {boolean|object} node optional node definition. Pass `false` to remove all paging nodes.\n\t\t * @param {string} [mode='append'] 'child'|firstChild'\n\t\t * @since 2.15\n\t\t */\n\t\taddPagingNode: function (node, mode) {\n\t\t\treturn this.rootNode.addPagingNode(node, mode);\n\t\t},\n\t\t/**\n\t\t * (experimental) Apply a modification (or navigation) operation.\n\t\t *\n\t\t * Valid commands:\n\t\t * - 'moveUp', 'moveDown'\n\t\t * - 'indent', 'outdent'\n\t\t * - 'remove'\n\t\t * - 'edit', 'addChild', 'addSibling': (reqires ext-edit extension)\n\t\t * - 'cut', 'copy', 'paste': (use an internal singleton 'clipboard')\n\t\t * - 'down', 'first', 'last', 'left', 'parent', 'right', 'up': navigate\n\t\t *\n\t\t * @param {string} cmd\n\t\t * @param {FancytreeNode} [node=active_node]\n\t\t * @param {object} [opts] Currently unused\n\t\t *\n\t\t * @since 2.32\n\t\t */\n\t\tapplyCommand: function (cmd, node, opts_) {\n\t\t\tvar // clipboard,\n\t\t\t\trefNode;\n\t\t\t// opts = $.extend(\n\t\t\t// \t{ setActive: true, clipboard: CLIPBOARD },\n\t\t\t// \topts_\n\t\t\t// );\n\n\t\t\tnode = node || this.getActiveNode();\n\t\t\t// clipboard = opts.clipboard;\n\n\t\t\tswitch (cmd) {\n\t\t\t\t// Sorting and indentation:\n\t\t\t\tcase \"moveUp\":\n\t\t\t\t\trefNode = node.getPrevSibling();\n\t\t\t\t\tif (refNode) {\n\t\t\t\t\t\tnode.moveTo(refNode, \"before\");\n\t\t\t\t\t\tnode.setActive();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"moveDown\":\n\t\t\t\t\trefNode = node.getNextSibling();\n\t\t\t\t\tif (refNode) {\n\t\t\t\t\t\tnode.moveTo(refNode, \"after\");\n\t\t\t\t\t\tnode.setActive();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"indent\":\n\t\t\t\t\trefNode = node.getPrevSibling();\n\t\t\t\t\tif (refNode) {\n\t\t\t\t\t\tnode.moveTo(refNode, \"child\");\n\t\t\t\t\t\trefNode.setExpanded();\n\t\t\t\t\t\tnode.setActive();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"outdent\":\n\t\t\t\t\tif (!node.isTopLevel()) {\n\t\t\t\t\t\tnode.moveTo(node.getParent(), \"after\");\n\t\t\t\t\t\tnode.setActive();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Remove:\n\t\t\t\tcase \"remove\":\n\t\t\t\t\trefNode = node.getPrevSibling() || node.getParent();\n\t\t\t\t\tnode.remove();\n\t\t\t\t\tif (refNode) {\n\t\t\t\t\t\trefNode.setActive();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Add, edit (requires ext-edit):\n\t\t\t\tcase \"addChild\":\n\t\t\t\t\tnode.editCreateNode(\"child\", \"\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"addSibling\":\n\t\t\t\t\tnode.editCreateNode(\"after\", \"\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"rename\":\n\t\t\t\t\tnode.editStart();\n\t\t\t\t\tbreak;\n\t\t\t\t// Simple clipboard simulation:\n\t\t\t\t// case \"cut\":\n\t\t\t\t// \tclipboard = { mode: cmd, data: node };\n\t\t\t\t// \tbreak;\n\t\t\t\t// case \"copy\":\n\t\t\t\t// \tclipboard = {\n\t\t\t\t// \t\tmode: cmd,\n\t\t\t\t// \t\tdata: node.toDict(function(d, n) {\n\t\t\t\t// \t\t\tdelete d.key;\n\t\t\t\t// \t\t}),\n\t\t\t\t// \t};\n\t\t\t\t// \tbreak;\n\t\t\t\t// case \"clear\":\n\t\t\t\t// \tclipboard = null;\n\t\t\t\t// \tbreak;\n\t\t\t\t// case \"paste\":\n\t\t\t\t// \tif (clipboard.mode === \"cut\") {\n\t\t\t\t// \t\t// refNode = node.getPrevSibling();\n\t\t\t\t// \t\tclipboard.data.moveTo(node, \"child\");\n\t\t\t\t// \t\tclipboard.data.setActive();\n\t\t\t\t// \t} else if (clipboard.mode === \"copy\") {\n\t\t\t\t// \t\tnode.addChildren(clipboard.data).setActive();\n\t\t\t\t// \t}\n\t\t\t\t// \tbreak;\n\t\t\t\t// Navigation commands:\n\t\t\t\tcase \"down\":\n\t\t\t\tcase \"first\":\n\t\t\t\tcase \"last\":\n\t\t\t\tcase \"left\":\n\t\t\t\tcase \"parent\":\n\t\t\t\tcase \"right\":\n\t\t\t\tcase \"up\":\n\t\t\t\t\treturn node.navigate(cmd);\n\t\t\t\tdefault:\n\t\t\t\t\t$.error(\"Unhandled command: '\" + cmd + \"'\");\n\t\t\t}\n\t\t},\n\t\t/** (experimental) Modify existing data model.\n\t\t *\n\t\t * @param {Array} patchList array of [key, NodePatch] arrays\n\t\t * @returns {$.Promise} resolved, when all patches have been applied\n\t\t * @see TreePatch\n\t\t */\n\t\tapplyPatch: function (patchList) {\n\t\t\tvar dfd,\n\t\t\t\ti,\n\t\t\t\tp2,\n\t\t\t\tkey,\n\t\t\t\tpatch,\n\t\t\t\tnode,\n\t\t\t\tpatchCount = patchList.length,\n\t\t\t\tdeferredList = [];\n\n\t\t\tfor (i = 0; i < patchCount; i++) {\n\t\t\t\tp2 = patchList[i];\n\t\t\t\t_assert(\n\t\t\t\t\tp2.length === 2,\n\t\t\t\t\t\"patchList must be an array of length-2-arrays\"\n\t\t\t\t);\n\t\t\t\tkey = p2[0];\n\t\t\t\tpatch = p2[1];\n\t\t\t\tnode = key === null ? this.rootNode : this.getNodeByKey(key);\n\t\t\t\tif (node) {\n\t\t\t\t\tdfd = new $.Deferred();\n\t\t\t\t\tdeferredList.push(dfd);\n\t\t\t\t\tnode.applyPatch(patch).always(_makeResolveFunc(dfd, node));\n\t\t\t\t} else {\n\t\t\t\t\tthis.warn(\"could not find node with key '\" + key + \"'\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Return a promise that is resolved, when ALL patches were applied\n\t\t\treturn $.when.apply($, deferredList).promise();\n\t\t},\n\t\t/* TODO: implement in dnd extension\n\t\tcancelDrag: function() {\n\t\t\t\tvar dd = $.ui.ddmanager.current;\n\t\t\t\tif(dd){\n\t\t\t\t\tdd.cancel();\n\t\t\t\t}\n\t\t\t},\n\t\t*/\n\t\t/** Remove all nodes.\n\t\t * @since 2.14\n\t\t */\n\t\tclear: function (source) {\n\t\t\tthis._callHook(\"treeClear\", this);\n\t\t},\n\t\t/** Return the number of nodes.\n\t\t * @returns {integer}\n\t\t */\n\t\tcount: function () {\n\t\t\treturn this.rootNode.countChildren();\n\t\t},\n\t\t/** Write to browser console if debugLevel >= 4 (prepending tree name)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\tdebug: function (msg) {\n\t\t\tif (this.options.debugLevel >= 4) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"log\", arguments);\n\t\t\t}\n\t\t},\n\t\t/** Destroy this widget, restore previous markup and cleanup resources.\n\t\t *\n\t\t * @since 2.34\n\t\t */\n\t\tdestroy: function () {\n\t\t\tthis.widget.destroy();\n\t\t},\n\t\t/** Enable (or disable) the tree control.\n\t\t *\n\t\t * @param {boolean} [flag=true] pass false to disable\n\t\t * @since 2.30\n\t\t */\n\t\tenable: function (flag) {\n\t\t\tif (flag === false) {\n\t\t\t\tthis.widget.disable();\n\t\t\t} else {\n\t\t\t\tthis.widget.enable();\n\t\t\t}\n\t\t},\n\t\t/** Temporarily suppress rendering to improve performance on bulk-updates.\n\t\t *\n\t\t * @param {boolean} flag\n\t\t * @returns {boolean} previous status\n\t\t * @since 2.19\n\t\t */\n\t\tenableUpdate: function (flag) {\n\t\t\tflag = flag !== false;\n\t\t\tif (!!this._enableUpdate === !!flag) {\n\t\t\t\treturn flag;\n\t\t\t}\n\t\t\tthis._enableUpdate = flag;\n\t\t\tif (flag) {\n\t\t\t\tthis.debug(\"enableUpdate(true): redraw \"); //, this._dirtyRoots);\n\t\t\t\tthis._callHook(\"treeStructureChanged\", this, \"enableUpdate\");\n\t\t\t\tthis.render();\n\t\t\t} else {\n\t\t\t\t// \tthis._dirtyRoots = null;\n\t\t\t\tthis.debug(\"enableUpdate(false)...\");\n\t\t\t}\n\t\t\treturn !flag; // return previous value\n\t\t},\n\t\t/** Write error to browser console if debugLevel >= 1 (prepending tree info)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\terror: function (msg) {\n\t\t\tif (this.options.debugLevel >= 1) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"error\", arguments);\n\t\t\t}\n\t\t},\n\t\t/** Expand (or collapse) all parent nodes.\n\t\t *\n\t\t * This convenience method uses `tree.visit()` and `tree.setExpanded()`\n\t\t * internally.\n\t\t *\n\t\t * @param {boolean} [flag=true] pass false to collapse\n\t\t * @param {object} [opts] passed to setExpanded()\n\t\t * @since 2.30\n\t\t */\n\t\texpandAll: function (flag, opts) {\n\t\t\tvar prev = this.enableUpdate(false);\n\n\t\t\tflag = flag !== false;\n\t\t\tthis.visit(function (node) {\n\t\t\t\tif (\n\t\t\t\t\tnode.hasChildren() !== false &&\n\t\t\t\t\tnode.isExpanded() !== flag\n\t\t\t\t) {\n\t\t\t\t\tnode.setExpanded(flag, opts);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.enableUpdate(prev);\n\t\t},\n\t\t/**Find all nodes that matches condition.\n\t\t *\n\t\t * @param {string | function(node)} match title string to search for, or a\n\t\t * callback function that returns `true` if a node is matched.\n\t\t * @returns {FancytreeNode[]} array of nodes (may be empty)\n\t\t * @see FancytreeNode#findAll\n\t\t * @since 2.12\n\t\t */\n\t\tfindAll: function (match) {\n\t\t\treturn this.rootNode.findAll(match);\n\t\t},\n\t\t/**Find first node that matches condition.\n\t\t *\n\t\t * @param {string | function(node)} match title string to search for, or a\n\t\t * callback function that returns `true` if a node is matched.\n\t\t * @returns {FancytreeNode} matching node or null\n\t\t * @see FancytreeNode#findFirst\n\t\t * @since 2.12\n\t\t */\n\t\tfindFirst: function (match) {\n\t\t\treturn this.rootNode.findFirst(match);\n\t\t},\n\t\t/** Find the next visible node that starts with `match`, starting at `startNode`\n\t\t * and wrap-around at the end.\n\t\t *\n\t\t * @param {string|function} match\n\t\t * @param {FancytreeNode} [startNode] defaults to first node\n\t\t * @returns {FancytreeNode} matching node or null\n\t\t */\n\t\tfindNextNode: function (match, startNode) {\n\t\t\t//, visibleOnly) {\n\t\t\tvar res = null,\n\t\t\t\tfirstNode = this.getFirstChild();\n\n\t\t\tmatch =\n\t\t\t\ttypeof match === \"string\"\n\t\t\t\t\t? _makeNodeTitleStartMatcher(match)\n\t\t\t\t\t: match;\n\t\t\tstartNode = startNode || firstNode;\n\n\t\t\tfunction _checkNode(n) {\n\t\t\t\t// console.log(\"_check \" + n)\n\t\t\t\tif (match(n)) {\n\t\t\t\t\tres = n;\n\t\t\t\t}\n\t\t\t\tif (res || n === startNode) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.visitRows(_checkNode, {\n\t\t\t\tstart: startNode,\n\t\t\t\tincludeSelf: false,\n\t\t\t});\n\t\t\t// Wrap around search\n\t\t\tif (!res && startNode !== firstNode) {\n\t\t\t\tthis.visitRows(_checkNode, {\n\t\t\t\t\tstart: firstNode,\n\t\t\t\t\tincludeSelf: true,\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t/** Find a node relative to another node.\n\t\t *\n\t\t * @param {FancytreeNode} node\n\t\t * @param {string|number} where 'down', 'first', 'last', 'left', 'parent', 'right', or 'up'.\n\t\t * (Alternatively the keyCode that would normally trigger this move,\n\t\t * e.g. `$.ui.keyCode.LEFT` = 'left'.\n\t\t * @param {boolean} [includeHidden=false] Not yet implemented\n\t\t * @returns {FancytreeNode|null}\n\t\t * @since v2.31\n\t\t */\n\t\tfindRelatedNode: function (node, where, includeHidden) {\n\t\t\tvar res = null,\n\t\t\t\tKC = $.ui.keyCode;\n\n\t\t\tswitch (where) {\n\t\t\t\tcase \"parent\":\n\t\t\t\tcase KC.BACKSPACE:\n\t\t\t\t\tif (node.parent && node.parent.parent) {\n\t\t\t\t\t\tres = node.parent;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"first\":\n\t\t\t\tcase KC.HOME:\n\t\t\t\t\t// First visible node\n\t\t\t\t\tthis.visit(function (n) {\n\t\t\t\t\t\tif (n.isVisible()) {\n\t\t\t\t\t\t\tres = n;\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"last\":\n\t\t\t\tcase KC.END:\n\t\t\t\t\tthis.visit(function (n) {\n\t\t\t\t\t\t// last visible node\n\t\t\t\t\t\tif (n.isVisible()) {\n\t\t\t\t\t\t\tres = n;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"left\":\n\t\t\t\tcase KC.LEFT:\n\t\t\t\t\tif (node.expanded) {\n\t\t\t\t\t\tnode.setExpanded(false);\n\t\t\t\t\t} else if (node.parent && node.parent.parent) {\n\t\t\t\t\t\tres = node.parent;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"right\":\n\t\t\t\tcase KC.RIGHT:\n\t\t\t\t\tif (!node.expanded && (node.children || node.lazy)) {\n\t\t\t\t\t\tnode.setExpanded();\n\t\t\t\t\t\tres = node;\n\t\t\t\t\t} else if (node.children && node.children.length) {\n\t\t\t\t\t\tres = node.children[0];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"up\":\n\t\t\t\tcase KC.UP:\n\t\t\t\t\tthis.visitRows(\n\t\t\t\t\t\tfunction (n) {\n\t\t\t\t\t\t\tres = n;\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ start: node, reverse: true, includeSelf: false }\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"down\":\n\t\t\t\tcase KC.DOWN:\n\t\t\t\t\tthis.visitRows(\n\t\t\t\t\t\tfunction (n) {\n\t\t\t\t\t\t\tres = n;\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ start: node, includeSelf: false }\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthis.tree.warn(\"Unknown relation '\" + where + \"'.\");\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t// TODO: fromDict\n\t\t/**\n\t\t * Generate INPUT elements that can be submitted with html forms.\n\t\t *\n\t\t * In selectMode 3 only the topmost selected nodes are considered, unless\n\t\t * `opts.stopOnParents: false` is passed.\n\t\t *\n\t\t * @example\n\t\t * // Generate input elements for active and selected nodes\n\t\t * tree.generateFormElements();\n\t\t * // Generate input elements selected nodes, using a custom `name` attribute\n\t\t * tree.generateFormElements(\"cust_sel\", false);\n\t\t * // Generate input elements using a custom filter\n\t\t * tree.generateFormElements(true, true, { filter: function(node) {\n\t\t * return node.isSelected() && node.data.yes;\n\t\t * }});\n\t\t *\n\t\t * @param {boolean | string} [selected=true] Pass false to disable, pass a string to override the field name (default: 'ft_ID[]')\n\t\t * @param {boolean | string} [active=true] Pass false to disable, pass a string to override the field name (default: 'ft_ID_active')\n\t\t * @param {object} [opts] default { filter: null, stopOnParents: true }\n\t\t */\n\t\tgenerateFormElements: function (selected, active, opts) {\n\t\t\topts = opts || {};\n\n\t\t\tvar nodeList,\n\t\t\t\tselectedName =\n\t\t\t\t\ttypeof selected === \"string\"\n\t\t\t\t\t\t? selected\n\t\t\t\t\t\t: \"ft_\" + this._id + \"[]\",\n\t\t\t\tactiveName =\n\t\t\t\t\ttypeof active === \"string\"\n\t\t\t\t\t\t? active\n\t\t\t\t\t\t: \"ft_\" + this._id + \"_active\",\n\t\t\t\tid = \"fancytree_result_\" + this._id,\n\t\t\t\t$result = $(\"#\" + id),\n\t\t\t\tstopOnParents =\n\t\t\t\t\tthis.options.selectMode === 3 &&\n\t\t\t\t\topts.stopOnParents !== false;\n\n\t\t\tif ($result.length) {\n\t\t\t\t$result.empty();\n\t\t\t} else {\n\t\t\t\t$result = $(\"<div>\", {\n\t\t\t\t\tid: id,\n\t\t\t\t})\n\t\t\t\t\t.hide()\n\t\t\t\t\t.insertAfter(this.$container);\n\t\t\t}\n\t\t\tif (active !== false && this.activeNode) {\n\t\t\t\t$result.append(\n\t\t\t\t\t$(\"<input>\", {\n\t\t\t\t\t\ttype: \"radio\",\n\t\t\t\t\t\tname: activeName,\n\t\t\t\t\t\tvalue: this.activeNode.key,\n\t\t\t\t\t\tchecked: true,\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\t\t\tfunction _appender(node) {\n\t\t\t\t$result.append(\n\t\t\t\t\t$(\"<input>\", {\n\t\t\t\t\t\ttype: \"checkbox\",\n\t\t\t\t\t\tname: selectedName,\n\t\t\t\t\t\tvalue: node.key,\n\t\t\t\t\t\tchecked: true,\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (opts.filter) {\n\t\t\t\tthis.visit(function (node) {\n\t\t\t\t\tvar res = opts.filter(node);\n\t\t\t\t\tif (res === \"skip\") {\n\t\t\t\t\t\treturn res;\n\t\t\t\t\t}\n\t\t\t\t\tif (res !== false) {\n\t\t\t\t\t\t_appender(node);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (selected !== false) {\n\t\t\t\tnodeList = this.getSelectedNodes(stopOnParents);\n\t\t\t\t$.each(nodeList, function (idx, node) {\n\t\t\t\t\t_appender(node);\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Return the currently active node or null.\n\t\t * @returns {FancytreeNode}\n\t\t */\n\t\tgetActiveNode: function () {\n\t\t\treturn this.activeNode;\n\t\t},\n\t\t/** Return the first top level node if any (not the invisible root node).\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetFirstChild: function () {\n\t\t\treturn this.rootNode.getFirstChild();\n\t\t},\n\t\t/**\n\t\t * Return node that has keyboard focus or null.\n\t\t * @returns {FancytreeNode}\n\t\t */\n\t\tgetFocusNode: function () {\n\t\t\treturn this.focusNode;\n\t\t},\n\t\t/**\n\t\t * Return current option value.\n\t\t * (Note: this is the preferred variant of `$().fancytree(\"option\", \"KEY\")`)\n\t\t *\n\t\t * @param {string} name option name (may contain '.')\n\t\t * @returns {any}\n\t\t */\n\t\tgetOption: function (optionName) {\n\t\t\treturn this.widget.option(optionName);\n\t\t},\n\t\t/**\n\t\t * Return node with a given key or null if not found.\n\t\t *\n\t\t * @param {string} key\n\t\t * @param {FancytreeNode} [searchRoot] only search below this node\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetNodeByKey: function (key, searchRoot) {\n\t\t\t// Search the DOM by element ID (assuming this is faster than traversing all nodes).\n\t\t\tvar el, match;\n\t\t\t// TODO: use tree.keyMap if available\n\t\t\t// TODO: check opts.generateIds === true\n\t\t\tif (!searchRoot) {\n\t\t\t\tel = document.getElementById(this.options.idPrefix + key);\n\t\t\t\tif (el) {\n\t\t\t\t\treturn el.ftnode ? el.ftnode : null;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Not found in the DOM, but still may be in an unrendered part of tree\n\t\t\tsearchRoot = searchRoot || this.rootNode;\n\t\t\tmatch = null;\n\t\t\tkey = \"\" + key; // Convert to string (#1005)\n\t\t\tsearchRoot.visit(function (node) {\n\t\t\t\tif (node.key === key) {\n\t\t\t\t\tmatch = node;\n\t\t\t\t\treturn false; // Stop iteration\n\t\t\t\t}\n\t\t\t}, true);\n\t\t\treturn match;\n\t\t},\n\t\t/** Return the invisible system root node.\n\t\t * @returns {FancytreeNode}\n\t\t */\n\t\tgetRootNode: function () {\n\t\t\treturn this.rootNode;\n\t\t},\n\t\t/**\n\t\t * Return an array of selected nodes.\n\t\t *\n\t\t * Note: you cannot send this result via Ajax directly. Instead the\n\t\t * node object need to be converted to plain objects, for example\n\t\t * by using `$.map()` and `node.toDict()`.\n\t\t * @param {boolean} [stopOnParents=false] only return the topmost selected\n\t\t * node (useful with selectMode 3)\n\t\t * @returns {FancytreeNode[]}\n\t\t */\n\t\tgetSelectedNodes: function (stopOnParents) {\n\t\t\treturn this.rootNode.getSelectedNodes(stopOnParents);\n\t\t},\n\t\t/** Return true if the tree control has keyboard focus\n\t\t * @returns {boolean}\n\t\t */\n\t\thasFocus: function () {\n\t\t\t// var ae = document.activeElement,\n\t\t\t// \thasFocus = !!(\n\t\t\t// \t\tae && $(ae).closest(\".fancytree-container\").length\n\t\t\t// \t);\n\n\t\t\t// if (hasFocus !== !!this._hasFocus) {\n\t\t\t// \tthis.warn(\n\t\t\t// \t\t\"hasFocus(): fix inconsistent container state, now: \" +\n\t\t\t// \t\t\thasFocus\n\t\t\t// \t);\n\t\t\t// \tthis._hasFocus = hasFocus;\n\t\t\t// \tthis.$container.toggleClass(\"fancytree-treefocus\", hasFocus);\n\t\t\t// }\n\t\t\t// return hasFocus;\n\t\t\treturn !!this._hasFocus;\n\t\t},\n\t\t/** Write to browser console if debugLevel >= 3 (prepending tree name)\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\tinfo: function (msg) {\n\t\t\tif (this.options.debugLevel >= 3) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"info\", arguments);\n\t\t\t}\n\t\t},\n\t\t/** Return true if any node is currently beeing loaded, i.e. a Ajax request is pending.\n\t\t * @returns {boolean}\n\t\t * @since 2.32\n\t\t */\n\t\tisLoading: function () {\n\t\t\tvar res = false;\n\n\t\t\tthis.rootNode.visit(function (n) {\n\t\t\t\t// also visit rootNode\n\t\t\t\tif (n._isLoading || n._requestId) {\n\t\t\t\t\tres = true;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}, true);\n\t\t\treturn res;\n\t\t},\n\t\t/*\n\t\tTODO: isInitializing: function() {\n\t\t\treturn ( this.phase==\"init\" || this.phase==\"postInit\" );\n\t\t},\n\t\tTODO: isReloading: function() {\n\t\t\treturn ( this.phase==\"init\" || this.phase==\"postInit\" ) && this.options.persist && this.persistence.cookiesFound;\n\t\t},\n\t\tTODO: isUserEvent: function() {\n\t\t\treturn ( this.phase==\"userEvent\" );\n\t\t},\n\t\t*/\n\n\t\t/**\n\t\t * Make sure that a node with a given ID is loaded, by traversing - and\n\t\t * loading - its parents. This method is meant for lazy hierarchies.\n\t\t * A callback is executed for every node as we go.\n\t\t * @example\n\t\t * // Resolve using node.key:\n\t\t * tree.loadKeyPath(\"/_3/_23/_26/_27\", function(node, status){\n\t\t * if(status === \"loaded\") {\n\t\t * console.log(\"loaded intermediate node \" + node);\n\t\t * }else if(status === \"ok\") {\n\t\t * node.activate();\n\t\t * }\n\t\t * });\n\t\t * // Use deferred promise:\n\t\t * tree.loadKeyPath(\"/_3/_23/_26/_27\").progress(function(data){\n\t\t * if(data.status === \"loaded\") {\n\t\t * console.log(\"loaded intermediate node \" + data.node);\n\t\t * }else if(data.status === \"ok\") {\n\t\t * node.activate();\n\t\t * }\n\t\t * }).done(function(){\n\t\t * ...\n\t\t * });\n\t\t * // Custom path segment resolver:\n\t\t * tree.loadKeyPath(\"/321/431/21/2\", {\n\t\t * matchKey: function(node, key){\n\t\t * return node.data.refKey === key;\n\t\t * },\n\t\t * callback: function(node, status){\n\t\t * if(status === \"loaded\") {\n\t\t * console.log(\"loaded intermediate node \" + node);\n\t\t * }else if(status === \"ok\") {\n\t\t * node.activate();\n\t\t * }\n\t\t * }\n\t\t * });\n\t\t * @param {string | string[]} keyPathList one or more key paths (e.g. '/3/2_1/7')\n\t\t * @param {function | object} optsOrCallback callback(node, status) is called for every visited node ('loading', 'loaded', 'ok', 'error').\n\t\t * Pass an object to define custom key matchers for the path segments: {callback: function, matchKey: function}.\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tloadKeyPath: function (keyPathList, optsOrCallback) {\n\t\t\tvar callback,\n\t\t\t\ti,\n\t\t\t\tpath,\n\t\t\t\tself = this,\n\t\t\t\tdfd = new $.Deferred(),\n\t\t\t\tparent = this.getRootNode(),\n\t\t\t\tsep = this.options.keyPathSeparator,\n\t\t\t\tpathSegList = [],\n\t\t\t\topts = $.extend({}, optsOrCallback);\n\n\t\t\t// Prepare options\n\t\t\tif (typeof optsOrCallback === \"function\") {\n\t\t\t\tcallback = optsOrCallback;\n\t\t\t} else if (optsOrCallback && optsOrCallback.callback) {\n\t\t\t\tcallback = optsOrCallback.callback;\n\t\t\t}\n\t\t\topts.callback = function (ctx, node, status) {\n\t\t\t\tif (callback) {\n\t\t\t\t\tcallback.call(ctx, node, status);\n\t\t\t\t}\n\t\t\t\tdfd.notifyWith(ctx, [{ node: node, status: status }]);\n\t\t\t};\n\t\t\tif (opts.matchKey == null) {\n\t\t\t\topts.matchKey = function (node, key) {\n\t\t\t\t\treturn node.key === key;\n\t\t\t\t};\n\t\t\t}\n\t\t\t// Convert array of path strings to array of segment arrays\n\t\t\tif (!_isArray(keyPathList)) {\n\t\t\t\tkeyPathList = [keyPathList];\n\t\t\t}\n\t\t\tfor (i = 0; i < keyPathList.length; i++) {\n\t\t\t\tpath = keyPathList[i];\n\t\t\t\t// strip leading slash\n\t\t\t\tif (path.charAt(0) === sep) {\n\t\t\t\t\tpath = path.substr(1);\n\t\t\t\t}\n\t\t\t\t// segListMap[path] = { parent: parent, segList: path.split(sep) };\n\t\t\t\tpathSegList.push(path.split(sep));\n\t\t\t\t// targetList.push({ parent: parent, segList: path.split(sep)/* , path: path*/});\n\t\t\t}\n\t\t\t// The timeout forces async behavior always (even if nodes are all loaded)\n\t\t\t// This way a potential progress() event will fire.\n\t\t\tsetTimeout(function () {\n\t\t\t\tself._loadKeyPathImpl(dfd, opts, parent, pathSegList).done(\n\t\t\t\t\tfunction () {\n\t\t\t\t\t\tdfd.resolve();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}, 0);\n\t\t\treturn dfd.promise();\n\t\t},\n\t\t/*\n\t\t * Resolve a list of paths, relative to one parent node.\n\t\t */\n\t\t_loadKeyPathImpl: function (dfd, opts, parent, pathSegList) {\n\t\t\tvar deferredList,\n\t\t\t\ti,\n\t\t\t\tkey,\n\t\t\t\tnode,\n\t\t\t\tnodeKey,\n\t\t\t\tremain,\n\t\t\t\tremainMap,\n\t\t\t\ttmpParent,\n\t\t\t\tsegList,\n\t\t\t\tsubDfd,\n\t\t\t\tself = this;\n\n\t\t\tfunction __findChild(parent, key) {\n\t\t\t\t// console.log(\"__findChild\", key, parent);\n\t\t\t\tvar i,\n\t\t\t\t\tl,\n\t\t\t\t\tcl = parent.children;\n\n\t\t\t\tif (cl) {\n\t\t\t\t\tfor (i = 0, l = cl.length; i < l; i++) {\n\t\t\t\t\t\tif (opts.matchKey(cl[i], key)) {\n\t\t\t\t\t\t\treturn cl[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// console.log(\"_loadKeyPathImpl, parent=\", parent, \", pathSegList=\", pathSegList);\n\n\t\t\t// Pass 1:\n\t\t\t// Handle all path segments for nodes that are already loaded.\n\t\t\t// Collect distinct top-most lazy nodes in a map.\n\t\t\t// Note that we can use node.key to de-dupe entries, even if a custom matcher would\n\t\t\t// look for other node attributes.\n\t\t\t// map[node.key] => {node: node, pathList: [list of remaining rest-paths]}\n\t\t\tremainMap = {};\n\n\t\t\tfor (i = 0; i < pathSegList.length; i++) {\n\t\t\t\tsegList = pathSegList[i];\n\t\t\t\t// target = targetList[i];\n\n\t\t\t\t// Traverse and pop path segments (i.e. keys), until we hit a lazy, unloaded node\n\t\t\t\ttmpParent = parent;\n\t\t\t\twhile (segList.length) {\n\t\t\t\t\tkey = segList.shift();\n\t\t\t\t\tnode = __findChild(tmpParent, key);\n\t\t\t\t\tif (!node) {\n\t\t\t\t\t\tthis.warn(\n\t\t\t\t\t\t\t\"loadKeyPath: key not found: \" +\n\t\t\t\t\t\t\t\tkey +\n\t\t\t\t\t\t\t\t\" (parent: \" +\n\t\t\t\t\t\t\t\ttmpParent +\n\t\t\t\t\t\t\t\t\")\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\topts.callback(this, key, \"error\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (segList.length === 0) {\n\t\t\t\t\t\topts.callback(this, node, \"ok\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (!node.lazy || node.hasChildren() !== undefined) {\n\t\t\t\t\t\topts.callback(this, node, \"loaded\");\n\t\t\t\t\t\ttmpParent = node;\n\t\t\t\t\t} else {\n\t\t\t\t\t\topts.callback(this, node, \"loaded\");\n\t\t\t\t\t\tkey = node.key; //target.segList.join(sep);\n\t\t\t\t\t\tif (remainMap[key]) {\n\t\t\t\t\t\t\tremainMap[key].pathSegList.push(segList);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tremainMap[key] = {\n\t\t\t\t\t\t\t\tparent: node,\n\t\t\t\t\t\t\t\tpathSegList: [segList],\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// console.log(\"_loadKeyPathImpl AFTER pass 1, remainMap=\", remainMap);\n\n\t\t\t// Now load all lazy nodes and continue iteration for remaining paths\n\t\t\tdeferredList = [];\n\n\t\t\t// Avoid jshint warning 'Don't make functions within a loop.':\n\t\t\tfunction __lazyload(dfd, parent, pathSegList) {\n\t\t\t\t// console.log(\"__lazyload\", parent, \"pathSegList=\", pathSegList);\n\t\t\t\topts.callback(self, parent, \"loading\");\n\t\t\t\tparent\n\t\t\t\t\t.load()\n\t\t\t\t\t.done(function () {\n\t\t\t\t\t\tself._loadKeyPathImpl\n\t\t\t\t\t\t\t.call(self, dfd, opts, parent, pathSegList)\n\t\t\t\t\t\t\t.always(_makeResolveFunc(dfd, self));\n\t\t\t\t\t})\n\t\t\t\t\t.fail(function (errMsg) {\n\t\t\t\t\t\tself.warn(\"loadKeyPath: error loading lazy \" + parent);\n\t\t\t\t\t\topts.callback(self, node, \"error\");\n\t\t\t\t\t\tdfd.rejectWith(self);\n\t\t\t\t\t});\n\t\t\t}\n\t\t\t// remainMap contains parent nodes, each with a list of relative sub-paths.\n\t\t\t// We start loading all of them now, and pass the the list to each loader.\n\t\t\tfor (nodeKey in remainMap) {\n\t\t\t\tif (_hasProp(remainMap, nodeKey)) {\n\t\t\t\t\tremain = remainMap[nodeKey];\n\t\t\t\t\t// console.log(\"for(): remain=\", remain, \"remainMap=\", remainMap);\n\t\t\t\t\t// key = remain.segList.shift();\n\t\t\t\t\t// node = __findChild(remain.parent, key);\n\t\t\t\t\t// if (node == null) { // #576\n\t\t\t\t\t// \t// Issue #576, refactored for v2.27:\n\t\t\t\t\t// \t// The root cause was, that sometimes the wrong parent was used here\n\t\t\t\t\t// \t// to find the next segment.\n\t\t\t\t\t// \t// Falling back to getNodeByKey() was a hack that no longer works if a custom\n\t\t\t\t\t// \t// matcher is used, because we cannot assume that a single segment-key is unique\n\t\t\t\t\t// \t// throughout the tree.\n\t\t\t\t\t// \tself.error(\"loadKeyPath: error loading child by key '\" + key + \"' (parent: \" + target.parent + \")\", target);\n\t\t\t\t\t// \t// \tnode = self.getNodeByKey(key);\n\t\t\t\t\t// \tcontinue;\n\t\t\t\t\t// }\n\t\t\t\t\tsubDfd = new $.Deferred();\n\t\t\t\t\tdeferredList.push(subDfd);\n\t\t\t\t\t__lazyload(subDfd, remain.parent, remain.pathSegList);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Return a promise that is resolved, when ALL paths were loaded\n\t\t\treturn $.when.apply($, deferredList).promise();\n\t\t},\n\t\t/** Re-fire beforeActivate, activate, and (optional) focus events.\n\t\t * Calling this method in the `init` event, will activate the node that\n\t\t * was marked 'active' in the source data, and optionally set the keyboard\n\t\t * focus.\n\t\t * @param [setFocus=false]\n\t\t */\n\t\treactivate: function (setFocus) {\n\t\t\tvar res,\n\t\t\t\tnode = this.activeNode;\n\n\t\t\tif (!node) {\n\t\t\t\treturn _getResolvedPromise();\n\t\t\t}\n\t\t\tthis.activeNode = null; // Force re-activating\n\t\t\tres = node.setActive(true, { noFocus: true });\n\t\t\tif (setFocus) {\n\t\t\t\tnode.setFocus();\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t/** Reload tree from source and return a promise.\n\t\t * @param [source] optional new source (defaults to initial source data)\n\t\t * @returns {$.Promise}\n\t\t */\n\t\treload: function (source) {\n\t\t\tthis._callHook(\"treeClear\", this);\n\t\t\treturn this._callHook(\"treeLoad\", this, source);\n\t\t},\n\t\t/**Render tree (i.e. create DOM elements for all top-level nodes).\n\t\t * @param {boolean} [force=false] create DOM elemnts, even if parent is collapsed\n\t\t * @param {boolean} [deep=false]\n\t\t */\n\t\trender: function (force, deep) {\n\t\t\treturn this.rootNode.render(force, deep);\n\t\t},\n\t\t/**(De)select all nodes.\n\t\t * @param {boolean} [flag=true]\n\t\t * @since 2.28\n\t\t */\n\t\tselectAll: function (flag) {\n\t\t\tthis.visit(function (node) {\n\t\t\t\tnode.setSelected(flag);\n\t\t\t});\n\t\t},\n\t\t// TODO: selectKey: function(key, select)\n\t\t// TODO: serializeArray: function(stopOnParents)\n\t\t/**\n\t\t * @param {boolean} [flag=true]\n\t\t */\n\t\tsetFocus: function (flag) {\n\t\t\treturn this._callHook(\"treeSetFocus\", this, flag);\n\t\t},\n\t\t/**\n\t\t * Set current option value.\n\t\t * (Note: this is the preferred variant of `$().fancytree(\"option\", \"KEY\", VALUE)`)\n\t\t * @param {string} name option name (may contain '.')\n\t\t * @param {any} new value\n\t\t */\n\t\tsetOption: function (optionName, value) {\n\t\t\treturn this.widget.option(optionName, value);\n\t\t},\n\t\t/**\n\t\t * Call console.time() when in debug mode (verbose >= 4).\n\t\t *\n\t\t * @param {string} label\n\t\t */\n\t\tdebugTime: function (label) {\n\t\t\tif (this.options.debugLevel >= 4) {\n\t\t\t\twindow.console.time(this + \" - \" + label);\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Call console.timeEnd() when in debug mode (verbose >= 4).\n\t\t *\n\t\t * @param {string} label\n\t\t */\n\t\tdebugTimeEnd: function (label) {\n\t\t\tif (this.options.debugLevel >= 4) {\n\t\t\t\twindow.console.timeEnd(this + \" - \" + label);\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Return all nodes as nested list of {@link NodeData}.\n\t\t *\n\t\t * @param {boolean} [includeRoot=false] Returns the hidden system root node (and its children)\n\t\t * @param {function} [callback] callback(dict, node) is called for every node, in order to allow modifications.\n\t\t * Return `false` to ignore this node or \"skip\" to include this node without its children.\n\t\t * @returns {Array | object}\n\t\t * @see FancytreeNode#toDict\n\t\t */\n\t\ttoDict: function (includeRoot, callback) {\n\t\t\tvar res = this.rootNode.toDict(true, callback);\n\t\t\treturn includeRoot ? res : res.children;\n\t\t},\n\t\t/* Implicitly called for string conversions.\n\t\t * @returns {string}\n\t\t */\n\t\ttoString: function () {\n\t\t\treturn \"Fancytree@\" + this._id;\n\t\t\t// return \"<Fancytree(#\" + this._id + \")>\";\n\t\t},\n\t\t/* _trigger a widget event with additional node ctx.\n\t\t * @see EventData\n\t\t */\n\t\t_triggerNodeEvent: function (type, node, originalEvent, extra) {\n\t\t\t// this.debug(\"_trigger(\" + type + \"): '\" + ctx.node.title + \"'\", ctx);\n\t\t\tvar ctx = this._makeHookContext(node, originalEvent, extra),\n\t\t\t\tres = this.widget._trigger(type, originalEvent, ctx);\n\t\t\tif (res !== false && ctx.result !== undefined) {\n\t\t\t\treturn ctx.result;\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t/* _trigger a widget event with additional tree data. */\n\t\t_triggerTreeEvent: function (type, originalEvent, extra) {\n\t\t\t// this.debug(\"_trigger(\" + type + \")\", ctx);\n\t\t\tvar ctx = this._makeHookContext(this, originalEvent, extra),\n\t\t\t\tres = this.widget._trigger(type, originalEvent, ctx);\n\n\t\t\tif (res !== false && ctx.result !== undefined) {\n\t\t\t\treturn ctx.result;\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t/** Call fn(node) for all nodes in hierarchical order (depth-first).\n\t\t *\n\t\t * @param {function} fn the callback function.\n\t\t * Return false to stop iteration, return \"skip\" to skip this node and children only.\n\t\t * @returns {boolean} false, if the iterator was stopped.\n\t\t */\n\t\tvisit: function (fn) {\n\t\t\treturn this.rootNode.visit(fn, false);\n\t\t},\n\t\t/** Call fn(node) for all nodes in vertical order, top down (or bottom up).<br>\n\t\t * Stop iteration, if fn() returns false.<br>\n\t\t * Return false if iteration was stopped.\n\t\t *\n\t\t * @param {function} fn the callback function.\n\t\t * Return false to stop iteration, return \"skip\" to skip this node and children only.\n\t\t * @param {object} [options]\n\t\t * Defaults:\n\t\t * {start: First top node, reverse: false, includeSelf: true, includeHidden: false}\n\t\t * @returns {boolean} false if iteration was cancelled\n\t\t * @since 2.28\n\t\t */\n\t\tvisitRows: function (fn, opts) {\n\t\t\tif (!this.rootNode.hasChildren()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (opts && opts.reverse) {\n\t\t\t\tdelete opts.reverse;\n\t\t\t\treturn this._visitRowsUp(fn, opts);\n\t\t\t}\n\t\t\topts = opts || {};\n\n\t\t\tvar i,\n\t\t\t\tnextIdx,\n\t\t\t\tparent,\n\t\t\t\tres,\n\t\t\t\tsiblings,\n\t\t\t\tsiblingOfs = 0,\n\t\t\t\tskipFirstNode = opts.includeSelf === false,\n\t\t\t\tincludeHidden = !!opts.includeHidden,\n\t\t\t\tcheckFilter = !includeHidden && this.enableFilter,\n\t\t\t\tnode = opts.start || this.rootNode.children[0];\n\n\t\t\tparent = node.parent;\n\t\t\twhile (parent) {\n\t\t\t\t// visit siblings\n\t\t\t\tsiblings = parent.children;\n\t\t\t\tnextIdx = siblings.indexOf(node) + siblingOfs;\n\t\t\t\t_assert(\n\t\t\t\t\tnextIdx >= 0,\n\t\t\t\t\t\"Could not find \" +\n\t\t\t\t\t\tnode +\n\t\t\t\t\t\t\" in parent's children: \" +\n\t\t\t\t\t\tparent\n\t\t\t\t);\n\n\t\t\t\tfor (i = nextIdx; i < siblings.length; i++) {\n\t\t\t\t\tnode = siblings[i];\n\t\t\t\t\tif (checkFilter && !node.match && !node.subMatchCount) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (!skipFirstNode && fn(node) === false) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tskipFirstNode = false;\n\t\t\t\t\t// Dive into node's child nodes\n\t\t\t\t\tif (\n\t\t\t\t\t\tnode.children &&\n\t\t\t\t\t\tnode.children.length &&\n\t\t\t\t\t\t(includeHidden || node.expanded)\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Disable warning: Functions declared within loops referencing an outer\n\t\t\t\t\t\t// scoped variable may lead to confusing semantics:\n\t\t\t\t\t\t/*jshint -W083 */\n\t\t\t\t\t\tres = node.visit(function (n) {\n\t\t\t\t\t\t\tif (checkFilter && !n.match && !n.subMatchCount) {\n\t\t\t\t\t\t\t\treturn \"skip\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (fn(n) === false) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!includeHidden && n.children && !n.expanded) {\n\t\t\t\t\t\t\t\treturn \"skip\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, false);\n\t\t\t\t\t\t/*jshint +W083 */\n\t\t\t\t\t\tif (res === false) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Visit parent nodes (bottom up)\n\t\t\t\tnode = parent;\n\t\t\t\tparent = parent.parent;\n\t\t\t\tsiblingOfs = 1; //\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\t/* Call fn(node) for all nodes in vertical order, bottom up.\n\t\t */\n\t\t_visitRowsUp: function (fn, opts) {\n\t\t\tvar children,\n\t\t\t\tidx,\n\t\t\t\tparent,\n\t\t\t\tincludeHidden = !!opts.includeHidden,\n\t\t\t\tnode = opts.start || this.rootNode.children[0];\n\n\t\t\twhile (true) {\n\t\t\t\tparent = node.parent;\n\t\t\t\tchildren = parent.children;\n\n\t\t\t\tif (children[0] === node) {\n\t\t\t\t\t// If this is already the first sibling, goto parent\n\t\t\t\t\tnode = parent;\n\t\t\t\t\tif (!node.parent) {\n\t\t\t\t\t\tbreak; // first node of the tree\n\t\t\t\t\t}\n\t\t\t\t\tchildren = parent.children;\n\t\t\t\t} else {\n\t\t\t\t\t// Otherwise, goto prev. sibling\n\t\t\t\t\tidx = children.indexOf(node);\n\t\t\t\t\tnode = children[idx - 1];\n\t\t\t\t\t// If the prev. sibling has children, follow down to last descendant\n\t\t\t\t\twhile (\n\t\t\t\t\t\t// See: https://github.com/eslint/eslint/issues/11302\n\t\t\t\t\t\t// eslint-disable-next-line no-unmodified-loop-condition\n\t\t\t\t\t\t(includeHidden || node.expanded) &&\n\t\t\t\t\t\tnode.children &&\n\t\t\t\t\t\tnode.children.length\n\t\t\t\t\t) {\n\t\t\t\t\t\tchildren = node.children;\n\t\t\t\t\t\tparent = node;\n\t\t\t\t\t\tnode = children[children.length - 1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Skip invisible\n\t\t\t\tif (!includeHidden && !node.isVisible()) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (fn(node) === false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t/** Write warning to browser console if debugLevel >= 2 (prepending tree info)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\twarn: function (msg) {\n\t\t\tif (this.options.debugLevel >= 2) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"warn\", arguments);\n\t\t\t}\n\t\t},\n\t};\n\n\t/**\n\t * These additional methods of the {@link Fancytree} class are 'hook functions'\n\t * that can be used and overloaded by extensions.\n\t *\n\t * @see [writing extensions](https://github.com/mar10/fancytree/wiki/TutorialExtensions)\n\t * @mixin Fancytree_Hooks\n\t */\n\t$.extend(\n\t\tFancytree.prototype,\n\t\t/** @lends Fancytree_Hooks# */\n\t\t{\n\t\t\t/** Default handling for mouse click events.\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeClick: function (ctx) {\n\t\t\t\tvar activate,\n\t\t\t\t\texpand,\n\t\t\t\t\t// event = ctx.originalEvent,\n\t\t\t\t\ttargetType = ctx.targetType,\n\t\t\t\t\tnode = ctx.node;\n\n\t\t\t\t// this.debug(\"ftnode.onClick(\" + event.type + \"): ftnode:\" + this + \", button:\" + event.button + \", which: \" + event.which, ctx);\n\t\t\t\t// TODO: use switch\n\t\t\t\t// TODO: make sure clicks on embedded <input> doesn't steal focus (see table sample)\n\t\t\t\tif (targetType === \"expander\") {\n\t\t\t\t\tif (node.isLoading()) {\n\t\t\t\t\t\t// #495: we probably got a click event while a lazy load is pending.\n\t\t\t\t\t\t// The 'expanded' state is not yet set, so 'toggle' would expand\n\t\t\t\t\t\t// and trigger lazyLoad again.\n\t\t\t\t\t\t// It would be better to allow to collapse/expand the status node\n\t\t\t\t\t\t// while loading (instead of ignoring), but that would require some\n\t\t\t\t\t\t// more work.\n\t\t\t\t\t\tnode.debug(\"Got 2nd click while loading: ignored\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// Clicking the expander icon always expands/collapses\n\t\t\t\t\tthis._callHook(\"nodeToggleExpanded\", ctx);\n\t\t\t\t} else if (targetType === \"checkbox\") {\n\t\t\t\t\t// Clicking the checkbox always (de)selects\n\t\t\t\t\tthis._callHook(\"nodeToggleSelected\", ctx);\n\t\t\t\t\tif (ctx.options.focusOnSelect) {\n\t\t\t\t\t\t// #358\n\t\t\t\t\t\tthis._callHook(\"nodeSetFocus\", ctx, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Honor `clickFolderMode` for\n\t\t\t\t\texpand = false;\n\t\t\t\t\tactivate = true;\n\t\t\t\t\tif (node.folder) {\n\t\t\t\t\t\tswitch (ctx.options.clickFolderMode) {\n\t\t\t\t\t\t\tcase 2: // expand only\n\t\t\t\t\t\t\t\texpand = true;\n\t\t\t\t\t\t\t\tactivate = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 3: // expand and activate\n\t\t\t\t\t\t\t\tactivate = true;\n\t\t\t\t\t\t\t\texpand = true; //!node.isExpanded();\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t// else 1 or 4: just activate\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (activate) {\n\t\t\t\t\t\tthis.nodeSetFocus(ctx);\n\t\t\t\t\t\tthis._callHook(\"nodeSetActive\", ctx, true);\n\t\t\t\t\t}\n\t\t\t\t\tif (expand) {\n\t\t\t\t\t\tif (!activate) {\n\t\t\t\t\t\t\t// this._callHook(\"nodeSetFocus\", ctx);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// this._callHook(\"nodeSetExpanded\", ctx, true);\n\t\t\t\t\t\tthis._callHook(\"nodeToggleExpanded\", ctx);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Make sure that clicks stop, otherwise <a href='#'> jumps to the top\n\t\t\t\t// if(event.target.localName === \"a\" && event.target.className === \"fancytree-title\"){\n\t\t\t\t// \tevent.preventDefault();\n\t\t\t\t// }\n\t\t\t\t// TODO: return promise?\n\t\t\t},\n\t\t\t/** Collapse all other children of same parent.\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {object} callOpts\n\t\t\t */\n\t\t\tnodeCollapseSiblings: function (ctx, callOpts) {\n\t\t\t\t// TODO: return promise?\n\t\t\t\tvar ac,\n\t\t\t\t\ti,\n\t\t\t\t\tl,\n\t\t\t\t\tnode = ctx.node;\n\n\t\t\t\tif (node.parent) {\n\t\t\t\t\tac = node.parent.children;\n\t\t\t\t\tfor (i = 0, l = ac.length; i < l; i++) {\n\t\t\t\t\t\tif (ac[i] !== node && ac[i].expanded) {\n\t\t\t\t\t\t\tthis._callHook(\n\t\t\t\t\t\t\t\t\"nodeSetExpanded\",\n\t\t\t\t\t\t\t\tac[i],\n\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\tcallOpts\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Default handling for mouse douleclick events.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeDblclick: function (ctx) {\n\t\t\t\t// TODO: return promise?\n\t\t\t\tif (\n\t\t\t\t\tctx.targetType === \"title\" &&\n\t\t\t\t\tctx.options.clickFolderMode === 4\n\t\t\t\t) {\n\t\t\t\t\t// this.nodeSetFocus(ctx);\n\t\t\t\t\t// this._callHook(\"nodeSetActive\", ctx, true);\n\t\t\t\t\tthis._callHook(\"nodeToggleExpanded\", ctx);\n\t\t\t\t}\n\t\t\t\t// TODO: prevent text selection on dblclicks\n\t\t\t\tif (ctx.targetType === \"title\") {\n\t\t\t\t\tctx.originalEvent.preventDefault();\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Default handling for mouse keydown events.\n\t\t\t *\n\t\t\t * NOTE: this may be called with node == null if tree (but no node) has focus.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeKeydown: function (ctx) {\n\t\t\t\t// TODO: return promise?\n\t\t\t\tvar matchNode,\n\t\t\t\t\tstamp,\n\t\t\t\t\t_res,\n\t\t\t\t\tfocusNode,\n\t\t\t\t\tevent = ctx.originalEvent,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\twhich = event.which,\n\t\t\t\t\t// #909: Use event.key, to get unicode characters.\n\t\t\t\t\t// We can't use `/\\w/.test(key)`, because that would\n\t\t\t\t\t// only detect plain ascii alpha-numerics. But we still need\n\t\t\t\t\t// to ignore modifier-only, whitespace, cursor-keys, etc.\n\t\t\t\t\tkey = event.key || String.fromCharCode(which),\n\t\t\t\t\tspecialModifiers = !!(\n\t\t\t\t\t\tevent.altKey ||\n\t\t\t\t\t\tevent.ctrlKey ||\n\t\t\t\t\t\tevent.metaKey\n\t\t\t\t\t),\n\t\t\t\t\tisAlnum =\n\t\t\t\t\t\t!MODIFIERS[which] &&\n\t\t\t\t\t\t!SPECIAL_KEYCODES[which] &&\n\t\t\t\t\t\t!specialModifiers,\n\t\t\t\t\t$target = $(event.target),\n\t\t\t\t\thandled = true,\n\t\t\t\t\tactivate = !(event.ctrlKey || !opts.autoActivate);\n\n\t\t\t\t// (node || FT).debug(\"ftnode.nodeKeydown(\" + event.type + \"): ftnode:\" + this + \", charCode:\" + event.charCode + \", keyCode: \" + event.keyCode + \", which: \" + event.which);\n\t\t\t\t// FT.debug( \"eventToString(): \" + FT.eventToString(event) + \", key='\" + key + \"', isAlnum: \" + isAlnum );\n\n\t\t\t\t// Set focus to active (or first node) if no other node has the focus yet\n\t\t\t\tif (!node) {\n\t\t\t\t\tfocusNode = this.getActiveNode() || this.getFirstChild();\n\t\t\t\t\tif (focusNode) {\n\t\t\t\t\t\tfocusNode.setFocus();\n\t\t\t\t\t\tnode = ctx.node = this.focusNode;\n\t\t\t\t\t\tnode.debug(\"Keydown force focus on active node\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\topts.quicksearch &&\n\t\t\t\t\tisAlnum &&\n\t\t\t\t\t!$target.is(\":input:enabled\")\n\t\t\t\t) {\n\t\t\t\t\t// Allow to search for longer streaks if typed in quickly\n\t\t\t\t\tstamp = Date.now();\n\t\t\t\t\tif (stamp - tree.lastQuicksearchTime > 500) {\n\t\t\t\t\t\ttree.lastQuicksearchTerm = \"\";\n\t\t\t\t\t}\n\t\t\t\t\ttree.lastQuicksearchTime = stamp;\n\t\t\t\t\ttree.lastQuicksearchTerm += key;\n\t\t\t\t\t// tree.debug(\"quicksearch find\", tree.lastQuicksearchTerm);\n\t\t\t\t\tmatchNode = tree.findNextNode(\n\t\t\t\t\t\ttree.lastQuicksearchTerm,\n\t\t\t\t\t\ttree.getActiveNode()\n\t\t\t\t\t);\n\t\t\t\t\tif (matchNode) {\n\t\t\t\t\t\tmatchNode.setActive();\n\t\t\t\t\t}\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tswitch (FT.eventToString(event)) {\n\t\t\t\t\tcase \"+\":\n\t\t\t\t\tcase \"=\": // 187: '+' @ Chrome, Safari\n\t\t\t\t\t\ttree.nodeSetExpanded(ctx, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"-\":\n\t\t\t\t\t\ttree.nodeSetExpanded(ctx, false);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"space\":\n\t\t\t\t\t\tif (node.isPagingNode()) {\n\t\t\t\t\t\t\ttree._triggerNodeEvent(\"clickPaging\", ctx, event);\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tFT.evalOption(\"checkbox\", node, node, opts, false)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// #768\n\t\t\t\t\t\t\ttree.nodeToggleSelected(ctx);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttree.nodeSetActive(ctx, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"return\":\n\t\t\t\t\t\ttree.nodeSetActive(ctx, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"home\":\n\t\t\t\t\tcase \"end\":\n\t\t\t\t\tcase \"backspace\":\n\t\t\t\t\tcase \"left\":\n\t\t\t\t\tcase \"right\":\n\t\t\t\t\tcase \"up\":\n\t\t\t\t\tcase \"down\":\n\t\t\t\t\t\t_res = node.navigate(event.which, activate);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\thandled = false;\n\t\t\t\t}\n\t\t\t\tif (handled) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t// /** Default handling for mouse keypress events. */\n\t\t\t// nodeKeypress: function(ctx) {\n\t\t\t// var event = ctx.originalEvent;\n\t\t\t// },\n\n\t\t\t// /** Trigger lazyLoad event (async). */\n\t\t\t// nodeLazyLoad: function(ctx) {\n\t\t\t// var node = ctx.node;\n\t\t\t// if(this._triggerNodeEvent())\n\t\t\t// },\n\t\t\t/** Load child nodes (async).\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {object[]|object|string|$.Promise|function} source\n\t\t\t * @returns {$.Promise} The deferred will be resolved as soon as the (ajax)\n\t\t\t * data was rendered.\n\t\t\t */\n\t\t\tnodeLoadChildren: function (ctx, source) {\n\t\t\t\tvar ajax,\n\t\t\t\t\tdelay,\n\t\t\t\t\tajaxDfd = null,\n\t\t\t\t\tresultDfd,\n\t\t\t\t\tisAsync = true,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\tnodePrevParent = node.parent,\n\t\t\t\t\ttag = \"nodeLoadChildren\",\n\t\t\t\t\trequestId = Date.now();\n\n\t\t\t\t// `source` is a callback: use the returned result instead:\n\t\t\t\tif (_isFunction(source)) {\n\t\t\t\t\tsource = source.call(tree, { type: \"source\" }, ctx);\n\t\t\t\t\t_assert(\n\t\t\t\t\t\t!_isFunction(source),\n\t\t\t\t\t\t\"source callback must not return another function\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// `source` is already a promise:\n\t\t\t\tif (_isFunction(source.then)) {\n\t\t\t\t\t// _assert(_isFunction(source.always), \"Expected jQuery?\");\n\t\t\t\t\tajaxDfd = source;\n\t\t\t\t} else if (source.url) {\n\t\t\t\t\t// `source` is an Ajax options object\n\t\t\t\t\tajax = $.extend({}, ctx.options.ajax, source);\n\t\t\t\t\tif (ajax.debugDelay) {\n\t\t\t\t\t\t// Simulate a slow server\n\t\t\t\t\t\tdelay = ajax.debugDelay;\n\t\t\t\t\t\tdelete ajax.debugDelay; // remove debug option\n\t\t\t\t\t\tif (_isArray(delay)) {\n\t\t\t\t\t\t\t// random delay range [min..max]\n\t\t\t\t\t\t\tdelay =\n\t\t\t\t\t\t\t\tdelay[0] +\n\t\t\t\t\t\t\t\tMath.random() * (delay[1] - delay[0]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\t\"nodeLoadChildren waiting debugDelay \" +\n\t\t\t\t\t\t\t\tMath.round(delay) +\n\t\t\t\t\t\t\t\t\" ms ...\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tajaxDfd = $.Deferred(function (ajaxDfd) {\n\t\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\t\t$.ajax(ajax)\n\t\t\t\t\t\t\t\t\t.done(function () {\n\t\t\t\t\t\t\t\t\t\tajaxDfd.resolveWith(this, arguments);\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t.fail(function () {\n\t\t\t\t\t\t\t\t\t\tajaxDfd.rejectWith(this, arguments);\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}, delay);\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tajaxDfd = $.ajax(ajax);\n\t\t\t\t\t}\n\t\t\t\t} else if ($.isPlainObject(source) || _isArray(source)) {\n\t\t\t\t\t// `source` is already a constant dict or list, but we convert\n\t\t\t\t\t// to a thenable for unified processing.\n\t\t\t\t\t// 2020-01-03: refactored.\n\t\t\t\t\t// `ajaxDfd = $.when(source)` would do the trick, but the returned\n\t\t\t\t\t// promise will resolve async, which broke some tests and\n\t\t\t\t\t// would probably also break current implementations out there.\n\t\t\t\t\t// So we mock-up a thenable that resolves synchronously:\n\t\t\t\t\tajaxDfd = {\n\t\t\t\t\t\tthen: function (resolve, reject) {\n\t\t\t\t\t\t\tresolve(source, null, null);\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t\tisAsync = false;\n\t\t\t\t} else {\n\t\t\t\t\t$.error(\"Invalid source type: \" + source);\n\t\t\t\t}\n\n\t\t\t\t// Check for overlapping requests\n\t\t\t\tif (node._requestId) {\n\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\"Recursive load request #\" +\n\t\t\t\t\t\t\trequestId +\n\t\t\t\t\t\t\t\" while #\" +\n\t\t\t\t\t\t\tnode._requestId +\n\t\t\t\t\t\t\t\" is pending.\"\n\t\t\t\t\t);\n\t\t\t\t\tnode._requestId = requestId;\n\t\t\t\t\t// \tnode.debug(\"Send load request #\" + requestId);\n\t\t\t\t}\n\n\t\t\t\tif (isAsync) {\n\t\t\t\t\ttree.debugTime(tag);\n\t\t\t\t\ttree.nodeSetStatus(ctx, \"loading\");\n\t\t\t\t}\n\n\t\t\t\t// The async Ajax request has now started...\n\t\t\t\t// Defer the deferred:\n\t\t\t\t// we want to be able to reject invalid responses, even if\n\t\t\t\t// the raw HTTP Ajax XHR resolved as Ok.\n\t\t\t\t// We use the ajaxDfd.then() syntax here, which is compatible with\n\t\t\t\t// jQuery and ECMA6.\n\t\t\t\t// However resultDfd is a jQuery deferred, which is currently the\n\t\t\t\t// expected result type of nodeLoadChildren()\n\t\t\t\tresultDfd = new $.Deferred();\n\t\t\t\tajaxDfd.then(\n\t\t\t\t\tfunction (data, textStatus, jqXHR) {\n\t\t\t\t\t\t// ajaxDfd was resolved, but we reject or resolve resultDfd\n\t\t\t\t\t\t// depending on the response data\n\t\t\t\t\t\tvar errorObj, res;\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t(source.dataType === \"json\" ||\n\t\t\t\t\t\t\t\tsource.dataType === \"jsonp\") &&\n\t\t\t\t\t\t\ttypeof data === \"string\"\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t$.error(\n\t\t\t\t\t\t\t\t\"Ajax request returned a string (did you get the JSON dataType wrong?).\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (node._requestId && node._requestId > requestId) {\n\t\t\t\t\t\t\t// The expected request time stamp is later than `requestId`\n\t\t\t\t\t\t\t// (which was kept as as closure variable to this handler function)\n\t\t\t\t\t\t\t// node.warn(\"Ignored load response for obsolete request #\" + requestId + \" (expected #\" + node._requestId + \")\");\n\t\t\t\t\t\t\tresultDfd.rejectWith(this, [\n\t\t\t\t\t\t\t\tRECURSIVE_REQUEST_ERROR,\n\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t\t// \tnode.debug(\"Response returned for load request #\" + requestId);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (node.parent === null && nodePrevParent !== null) {\n\t\t\t\t\t\t\tresultDfd.rejectWith(this, [\n\t\t\t\t\t\t\t\tINVALID_REQUEST_TARGET_ERROR,\n\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Allow to adjust the received response data in the `postProcess` event.\n\t\t\t\t\t\tif (ctx.options.postProcess) {\n\t\t\t\t\t\t\t// The handler may either\n\t\t\t\t\t\t\t// - modify `ctx.response` in-place (and leave `ctx.result` undefined)\n\t\t\t\t\t\t\t// => res = undefined\n\t\t\t\t\t\t\t// - return a replacement in `ctx.result`\n\t\t\t\t\t\t\t// => res = <new data>\n\t\t\t\t\t\t\t// If res contains an `error` property, an error status is displayed\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tres = tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\t\"postProcess\",\n\t\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\tctx.originalEvent,\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tresponse: data,\n\t\t\t\t\t\t\t\t\t\terror: null,\n\t\t\t\t\t\t\t\t\t\tdataType: source.dataType,\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tif (res.error) {\n\t\t\t\t\t\t\t\t\ttree.warn(\n\t\t\t\t\t\t\t\t\t\t\"postProcess returned error:\",\n\t\t\t\t\t\t\t\t\t\tres\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\tres = {\n\t\t\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\t\t\tmessage: \"\" + e,\n\t\t\t\t\t\t\t\t\tdetails: \"postProcess failed\",\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (res.error) {\n\t\t\t\t\t\t\t\t// Either postProcess failed with an exception, or the returned\n\t\t\t\t\t\t\t\t// result object has an 'error' property attached:\n\t\t\t\t\t\t\t\terrorObj = $.isPlainObject(res.error)\n\t\t\t\t\t\t\t\t\t? res.error\n\t\t\t\t\t\t\t\t\t: { message: res.error };\n\t\t\t\t\t\t\t\terrorObj = tree._makeHookContext(\n\t\t\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\terrorObj\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tresultDfd.rejectWith(this, [errorObj]);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t_isArray(res) ||\n\t\t\t\t\t\t\t\t($.isPlainObject(res) && _isArray(res.children))\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t// Use `ctx.result` if valid\n\t\t\t\t\t\t\t\t// (otherwise use existing data, which may have been modified in-place)\n\t\t\t\t\t\t\t\tdata = res;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tdata &&\n\t\t\t\t\t\t\t_hasProp(data, \"d\") &&\n\t\t\t\t\t\t\tctx.options.enableAspx\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Process ASPX WebMethod JSON object inside \"d\" property\n\t\t\t\t\t\t\t// (only if no postProcess event was defined)\n\t\t\t\t\t\t\tif (ctx.options.enableAspx === 42) {\n\t\t\t\t\t\t\t\ttree.warn(\n\t\t\t\t\t\t\t\t\t\"The default for enableAspx will change to `false` in the fututure. \" +\n\t\t\t\t\t\t\t\t\t\t\"Pass `enableAspx: true` or implement postProcess to silence this warning.\"\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdata =\n\t\t\t\t\t\t\t\ttypeof data.d === \"string\"\n\t\t\t\t\t\t\t\t\t? $.parseJSON(data.d)\n\t\t\t\t\t\t\t\t\t: data.d;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresultDfd.resolveWith(this, [data]);\n\t\t\t\t\t},\n\t\t\t\t\tfunction (jqXHR, textStatus, errorThrown) {\n\t\t\t\t\t\t// ajaxDfd was rejected, so we reject resultDfd as well\n\t\t\t\t\t\tvar errorObj = tree._makeHookContext(node, null, {\n\t\t\t\t\t\t\terror: jqXHR,\n\t\t\t\t\t\t\targs: Array.prototype.slice.call(arguments),\n\t\t\t\t\t\t\tmessage: errorThrown,\n\t\t\t\t\t\t\tdetails: jqXHR.status + \": \" + errorThrown,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tresultDfd.rejectWith(this, [errorObj]);\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\t// The async Ajax request has now started.\n\t\t\t\t// resultDfd will be resolved/rejected after the response arrived,\n\t\t\t\t// was postProcessed, and checked.\n\t\t\t\t// Now we implement the UI update and add the data to the tree.\n\t\t\t\t// We also return this promise to the caller.\n\t\t\t\tresultDfd\n\t\t\t\t\t.done(function (data) {\n\t\t\t\t\t\ttree.nodeSetStatus(ctx, \"ok\");\n\t\t\t\t\t\tvar children, metaData, noDataRes;\n\n\t\t\t\t\t\tif ($.isPlainObject(data)) {\n\t\t\t\t\t\t\t// We got {foo: 'abc', children: [...]}\n\t\t\t\t\t\t\t// Copy extra properties to tree.data.foo\n\t\t\t\t\t\t\t_assert(\n\t\t\t\t\t\t\t\tnode.isRootNode(),\n\t\t\t\t\t\t\t\t\"source may only be an object for root nodes (expecting an array of child objects otherwise)\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t_assert(\n\t\t\t\t\t\t\t\t_isArray(data.children),\n\t\t\t\t\t\t\t\t\"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tmetaData = data;\n\t\t\t\t\t\t\tchildren = data.children;\n\t\t\t\t\t\t\tdelete metaData.children;\n\t\t\t\t\t\t\t// Copy some attributes to tree.data\n\t\t\t\t\t\t\t$.each(TREE_ATTRS, function (i, attr) {\n\t\t\t\t\t\t\t\tif (metaData[attr] !== undefined) {\n\t\t\t\t\t\t\t\t\ttree[attr] = metaData[attr];\n\t\t\t\t\t\t\t\t\tdelete metaData[attr];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t// Copy all other attributes to tree.data.NAME\n\t\t\t\t\t\t\t$.extend(tree.data, metaData);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tchildren = data;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t_assert(\n\t\t\t\t\t\t\t_isArray(children),\n\t\t\t\t\t\t\t\"expected array of children\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tnode._setChildren(children);\n\n\t\t\t\t\t\tif (tree.options.nodata && children.length === 0) {\n\t\t\t\t\t\t\tif (_isFunction(tree.options.nodata)) {\n\t\t\t\t\t\t\t\tnoDataRes = tree.options.nodata.call(\n\t\t\t\t\t\t\t\t\ttree,\n\t\t\t\t\t\t\t\t\t{ type: \"nodata\" },\n\t\t\t\t\t\t\t\t\tctx\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\ttree.options.nodata === true &&\n\t\t\t\t\t\t\t\tnode.isRootNode()\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tnoDataRes = tree.options.strings.noData;\n\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\ttypeof tree.options.nodata === \"string\" &&\n\t\t\t\t\t\t\t\tnode.isRootNode()\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tnoDataRes = tree.options.nodata;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (noDataRes) {\n\t\t\t\t\t\t\t\tnode.setStatus(\"nodata\", noDataRes);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// trigger fancytreeloadchildren\n\t\t\t\t\t\ttree._triggerNodeEvent(\"loadChildren\", node);\n\t\t\t\t\t})\n\t\t\t\t\t.fail(function (error) {\n\t\t\t\t\t\tvar ctxErr;\n\n\t\t\t\t\t\tif (error === RECURSIVE_REQUEST_ERROR) {\n\t\t\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\t\t\"Ignored response for obsolete load request #\" +\n\t\t\t\t\t\t\t\t\trequestId +\n\t\t\t\t\t\t\t\t\t\" (expected #\" +\n\t\t\t\t\t\t\t\t\tnode._requestId +\n\t\t\t\t\t\t\t\t\t\")\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else if (error === INVALID_REQUEST_TARGET_ERROR) {\n\t\t\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\t\t\"Lazy parent node was removed while loading: discarding response.\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else if (error.node && error.error && error.message) {\n\t\t\t\t\t\t\t// error is already a context object\n\t\t\t\t\t\t\tctxErr = error;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tctxErr = tree._makeHookContext(node, null, {\n\t\t\t\t\t\t\t\terror: error, // it can be jqXHR or any custom error\n\t\t\t\t\t\t\t\targs: Array.prototype.slice.call(arguments),\n\t\t\t\t\t\t\t\tmessage: error\n\t\t\t\t\t\t\t\t\t? error.message || error.toString()\n\t\t\t\t\t\t\t\t\t: \"\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (ctxErr.message === \"[object Object]\") {\n\t\t\t\t\t\t\t\tctxErr.message = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\t\"Load children failed (\" + ctxErr.message + \")\",\n\t\t\t\t\t\t\tctxErr\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\"loadError\",\n\t\t\t\t\t\t\t\tctxErr,\n\t\t\t\t\t\t\t\tnull\n\t\t\t\t\t\t\t) !== false\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\ttree.nodeSetStatus(\n\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\"error\",\n\t\t\t\t\t\t\t\tctxErr.message,\n\t\t\t\t\t\t\t\tctxErr.details\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.always(function () {\n\t\t\t\t\t\tnode._requestId = null;\n\t\t\t\t\t\tif (isAsync) {\n\t\t\t\t\t\t\ttree.debugTimeEnd(tag);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\treturn resultDfd.promise();\n\t\t\t},\n\t\t\t/** [Not Implemented] */\n\t\t\tnodeLoadKeyPath: function (ctx, keyPathList) {\n\t\t\t\t// TODO: implement and improve\n\t\t\t\t// http://code.google.com/p/dynatree/issues/detail?id=222\n\t\t\t},\n\t\t\t/**\n\t\t\t * Remove a single direct child of ctx.node.\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {FancytreeNode} childNode dircect child of ctx.node\n\t\t\t */\n\t\t\tnodeRemoveChild: function (ctx, childNode) {\n\t\t\t\tvar idx,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\t// opts = ctx.options,\n\t\t\t\t\tsubCtx = $.extend({}, ctx, { node: childNode }),\n\t\t\t\t\tchildren = node.children;\n\n\t\t\t\t// FT.debug(\"nodeRemoveChild()\", node.toString(), childNode.toString());\n\n\t\t\t\tif (children.length === 1) {\n\t\t\t\t\t_assert(childNode === children[0], \"invalid single child\");\n\t\t\t\t\treturn this.nodeRemoveChildren(ctx);\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\tthis.activeNode &&\n\t\t\t\t\t(childNode === this.activeNode ||\n\t\t\t\t\t\tthis.activeNode.isDescendantOf(childNode))\n\t\t\t\t) {\n\t\t\t\t\tthis.activeNode.setActive(false); // TODO: don't fire events\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\tthis.focusNode &&\n\t\t\t\t\t(childNode === this.focusNode ||\n\t\t\t\t\t\tthis.focusNode.isDescendantOf(childNode))\n\t\t\t\t) {\n\t\t\t\t\tthis.focusNode = null;\n\t\t\t\t}\n\t\t\t\t// TODO: persist must take care to clear select and expand cookies\n\t\t\t\tthis.nodeRemoveMarkup(subCtx);\n\t\t\t\tthis.nodeRemoveChildren(subCtx);\n\t\t\t\tidx = $.inArray(childNode, children);\n\t\t\t\t_assert(idx >= 0, \"invalid child\");\n\t\t\t\t// Notify listeners\n\t\t\t\tnode.triggerModifyChild(\"remove\", childNode);\n\t\t\t\t// Unlink to support GC\n\t\t\t\tchildNode.visit(function (n) {\n\t\t\t\t\tn.parent = null;\n\t\t\t\t}, true);\n\t\t\t\tthis._callHook(\"treeRegisterNode\", this, false, childNode);\n\t\t\t\t// remove from child list\n\t\t\t\tchildren.splice(idx, 1);\n\t\t\t},\n\t\t\t/**Remove HTML markup for all descendents of ctx.node.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeRemoveChildMarkup: function (ctx) {\n\t\t\t\tvar node = ctx.node;\n\n\t\t\t\t// FT.debug(\"nodeRemoveChildMarkup()\", node.toString());\n\t\t\t\t// TODO: Unlink attr.ftnode to support GC\n\t\t\t\tif (node.ul) {\n\t\t\t\t\tif (node.isRootNode()) {\n\t\t\t\t\t\t$(node.ul).empty();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$(node.ul).remove();\n\t\t\t\t\t\tnode.ul = null;\n\t\t\t\t\t}\n\t\t\t\t\tnode.visit(function (n) {\n\t\t\t\t\t\tn.li = n.ul = null;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t\t/**Remove all descendants of ctx.node.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeRemoveChildren: function (ctx) {\n\t\t\t\tvar //subCtx,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\tchildren = node.children;\n\t\t\t\t// opts = ctx.options;\n\n\t\t\t\t// FT.debug(\"nodeRemoveChildren()\", node.toString());\n\t\t\t\tif (!children) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (this.activeNode && this.activeNode.isDescendantOf(node)) {\n\t\t\t\t\tthis.activeNode.setActive(false); // TODO: don't fire events\n\t\t\t\t}\n\t\t\t\tif (this.focusNode && this.focusNode.isDescendantOf(node)) {\n\t\t\t\t\tthis.focusNode = null;\n\t\t\t\t}\n\t\t\t\t// TODO: persist must take care to clear select and expand cookies\n\t\t\t\tthis.nodeRemoveChildMarkup(ctx);\n\t\t\t\t// Unlink children to support GC\n\t\t\t\t// TODO: also delete this.children (not possible using visit())\n\t\t\t\t// subCtx = $.extend({}, ctx);\n\t\t\t\tnode.triggerModifyChild(\"remove\", null);\n\t\t\t\tnode.visit(function (n) {\n\t\t\t\t\tn.parent = null;\n\t\t\t\t\ttree._callHook(\"treeRegisterNode\", tree, false, n);\n\t\t\t\t});\n\t\t\t\tif (node.lazy) {\n\t\t\t\t\t// 'undefined' would be interpreted as 'not yet loaded' for lazy nodes\n\t\t\t\t\tnode.children = [];\n\t\t\t\t} else {\n\t\t\t\t\tnode.children = null;\n\t\t\t\t}\n\t\t\t\tif (!node.isRootNode()) {\n\t\t\t\t\tnode.expanded = false; // #449, #459\n\t\t\t\t}\n\t\t\t\tthis.nodeRenderStatus(ctx);\n\t\t\t},\n\t\t\t/**Remove HTML markup for ctx.node and all its descendents.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeRemoveMarkup: function (ctx) {\n\t\t\t\tvar node = ctx.node;\n\t\t\t\t// FT.debug(\"nodeRemoveMarkup()\", node.toString());\n\t\t\t\t// TODO: Unlink attr.ftnode to support GC\n\t\t\t\tif (node.li) {\n\t\t\t\t\t$(node.li).remove();\n\t\t\t\t\tnode.li = null;\n\t\t\t\t}\n\t\t\t\tthis.nodeRemoveChildMarkup(ctx);\n\t\t\t},\n\t\t\t/**\n\t\t\t * Create `<li><span>..</span> .. </li>` tags for this node.\n\t\t\t *\n\t\t\t * This method takes care that all HTML markup is created that is required\n\t\t\t * to display this node in its current state.\n\t\t\t *\n\t\t\t * Call this method to create new nodes, or after the strucuture\n\t\t\t * was changed (e.g. after moving this node or adding/removing children)\n\t\t\t * nodeRenderTitle() and nodeRenderStatus() are implied.\n\t\t\t *\n\t\t\t * ```html\n\t\t\t * <li id='KEY' ftnode=NODE>\n\t\t\t * <span class='fancytree-node fancytree-expanded fancytree-has-children fancytree-lastsib fancytree-exp-el fancytree-ico-e'>\n\t\t\t * <span class=\"fancytree-expander\"></span>\n\t\t\t * <span class=\"fancytree-checkbox\"></span> // only present in checkbox mode\n\t\t\t * <span class=\"fancytree-icon\"></span>\n\t\t\t * <a href=\"#\" class=\"fancytree-title\"> Node 1 </a>\n\t\t\t * </span>\n\t\t\t * <ul> // only present if node has children\n\t\t\t * <li id='KEY' ftnode=NODE> child1 ... </li>\n\t\t\t * <li id='KEY' ftnode=NODE> child2 ... </li>\n\t\t\t * </ul>\n\t\t\t * </li>\n\t\t\t * ```\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} [force=false] re-render, even if html markup was already created\n\t\t\t * @param {boolean} [deep=false] also render all descendants, even if parent is collapsed\n\t\t\t * @param {boolean} [collapsed=false] force root node to be collapsed, so we can apply animated expand later\n\t\t\t */\n\t\t\tnodeRender: function (ctx, force, deep, collapsed, _recursive) {\n\t\t\t\t/* This method must take care of all cases where the current data mode\n\t\t\t\t * (i.e. node hierarchy) does not match the current markup.\n\t\t\t\t *\n\t\t\t\t * - node was not yet rendered:\n\t\t\t\t * create markup\n\t\t\t\t * - node was rendered: exit fast\n\t\t\t\t * - children have been added\n\t\t\t\t * - children have been removed\n\t\t\t\t */\n\t\t\t\tvar childLI,\n\t\t\t\t\tchildNode1,\n\t\t\t\t\tchildNode2,\n\t\t\t\t\ti,\n\t\t\t\t\tl,\n\t\t\t\t\tnext,\n\t\t\t\t\tsubCtx,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\taria = opts.aria,\n\t\t\t\t\tfirstTime = false,\n\t\t\t\t\tparent = node.parent,\n\t\t\t\t\tisRootNode = !parent,\n\t\t\t\t\tchildren = node.children,\n\t\t\t\t\tsuccessorLi = null;\n\t\t\t\t// FT.debug(\"nodeRender(\" + !!force + \", \" + !!deep + \")\", node.toString());\n\n\t\t\t\tif (tree._enableUpdate === false) {\n\t\t\t\t\t// tree.debug(\"no render\", tree._enableUpdate);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!isRootNode && !parent.ul) {\n\t\t\t\t\t// Calling node.collapse on a deep, unrendered node\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t_assert(isRootNode || parent.ul, \"parent UL must exist\");\n\n\t\t\t\t// Render the node\n\t\t\t\tif (!isRootNode) {\n\t\t\t\t\t// Discard markup on force-mode, or if it is not linked to parent <ul>\n\t\t\t\t\tif (\n\t\t\t\t\t\tnode.li &&\n\t\t\t\t\t\t(force || node.li.parentNode !== node.parent.ul)\n\t\t\t\t\t) {\n\t\t\t\t\t\tif (node.li.parentNode === node.parent.ul) {\n\t\t\t\t\t\t\t// #486: store following node, so we can insert the new markup there later\n\t\t\t\t\t\t\tsuccessorLi = node.li.nextSibling;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// May happen, when a top-level node was dropped over another\n\t\t\t\t\t\t\tthis.debug(\n\t\t\t\t\t\t\t\t\"Unlinking \" +\n\t\t\t\t\t\t\t\t\tnode +\n\t\t\t\t\t\t\t\t\t\" (must be child of \" +\n\t\t\t\t\t\t\t\t\tnode.parent +\n\t\t\t\t\t\t\t\t\t\")\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//\t this.debug(\"nodeRemoveMarkup...\");\n\t\t\t\t\t\tthis.nodeRemoveMarkup(ctx);\n\t\t\t\t\t}\n\t\t\t\t\t// Create <li><span /> </li>\n\t\t\t\t\t// node.debug(\"render...\");\n\t\t\t\t\tif (node.li) {\n\t\t\t\t\t\t// this.nodeRenderTitle(ctx);\n\t\t\t\t\t\tthis.nodeRenderStatus(ctx);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// node.debug(\"render... really\");\n\t\t\t\t\t\tfirstTime = true;\n\t\t\t\t\t\tnode.li = document.createElement(\"li\");\n\t\t\t\t\t\tnode.li.ftnode = node;\n\n\t\t\t\t\t\tif (node.key && opts.generateIds) {\n\t\t\t\t\t\t\tnode.li.id = opts.idPrefix + node.key;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnode.span = document.createElement(\"span\");\n\t\t\t\t\t\tnode.span.className = \"fancytree-node\";\n\t\t\t\t\t\tif (aria && !node.tr) {\n\t\t\t\t\t\t\t$(node.li).attr(\"role\", \"treeitem\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnode.li.appendChild(node.span);\n\n\t\t\t\t\t\t// Create inner HTML for the <span> (expander, checkbox, icon, and title)\n\t\t\t\t\t\tthis.nodeRenderTitle(ctx);\n\n\t\t\t\t\t\t// Allow tweaking and binding, after node was created for the first time\n\t\t\t\t\t\tif (opts.createNode) {\n\t\t\t\t\t\t\topts.createNode.call(\n\t\t\t\t\t\t\t\ttree,\n\t\t\t\t\t\t\t\t{ type: \"createNode\" },\n\t\t\t\t\t\t\t\tctx\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Allow tweaking after node state was rendered\n\t\t\t\t\tif (opts.renderNode) {\n\t\t\t\t\t\topts.renderNode.call(tree, { type: \"renderNode\" }, ctx);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Visit child nodes\n\t\t\t\tif (children) {\n\t\t\t\t\tif (isRootNode || node.expanded || deep === true) {\n\t\t\t\t\t\t// Create a UL to hold the children\n\t\t\t\t\t\tif (!node.ul) {\n\t\t\t\t\t\t\tnode.ul = document.createElement(\"ul\");\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t(collapsed === true && !_recursive) ||\n\t\t\t\t\t\t\t\t!node.expanded\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t// hide top UL, so we can use an animation to show it later\n\t\t\t\t\t\t\t\tnode.ul.style.display = \"none\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (aria) {\n\t\t\t\t\t\t\t\t$(node.ul).attr(\"role\", \"group\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (node.li) {\n\t\t\t\t\t\t\t\t// issue #67\n\t\t\t\t\t\t\t\tnode.li.appendChild(node.ul);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tnode.tree.$div.append(node.ul);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Add child markup\n\t\t\t\t\t\tfor (i = 0, l = children.length; i < l; i++) {\n\t\t\t\t\t\t\tsubCtx = $.extend({}, ctx, { node: children[i] });\n\t\t\t\t\t\t\tthis.nodeRender(subCtx, force, deep, false, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Remove <li> if nodes have moved to another parent\n\t\t\t\t\t\tchildLI = node.ul.firstChild;\n\t\t\t\t\t\twhile (childLI) {\n\t\t\t\t\t\t\tchildNode2 = childLI.ftnode;\n\t\t\t\t\t\t\tif (childNode2 && childNode2.parent !== node) {\n\t\t\t\t\t\t\t\tnode.debug(\n\t\t\t\t\t\t\t\t\t\"_fixParent: remove missing \" + childNode2,\n\t\t\t\t\t\t\t\t\tchildLI\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tnext = childLI.nextSibling;\n\t\t\t\t\t\t\t\tchildLI.parentNode.removeChild(childLI);\n\t\t\t\t\t\t\t\tchildLI = next;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tchildLI = childLI.nextSibling;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Make sure, that <li> order matches node.children order.\n\t\t\t\t\t\tchildLI = node.ul.firstChild;\n\t\t\t\t\t\tfor (i = 0, l = children.length - 1; i < l; i++) {\n\t\t\t\t\t\t\tchildNode1 = children[i];\n\t\t\t\t\t\t\tchildNode2 = childLI.ftnode;\n\t\t\t\t\t\t\tif (childNode1 === childNode2) {\n\t\t\t\t\t\t\t\tchildLI = childLI.nextSibling;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// node.debug(\"_fixOrder: mismatch at index \" + i + \": \" + childNode1 + \" != \" + childNode2);\n\t\t\t\t\t\t\t\tnode.ul.insertBefore(\n\t\t\t\t\t\t\t\t\tchildNode1.li,\n\t\t\t\t\t\t\t\t\tchildNode2.li\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// No children: remove markup if any\n\t\t\t\t\tif (node.ul) {\n\t\t\t\t\t\t// alert(\"remove child markup for \" + node);\n\t\t\t\t\t\tthis.warn(\"remove child markup for \" + node);\n\t\t\t\t\t\tthis.nodeRemoveChildMarkup(ctx);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!isRootNode) {\n\t\t\t\t\t// Update element classes according to node state\n\t\t\t\t\t// this.nodeRenderStatus(ctx);\n\t\t\t\t\t// Finally add the whole structure to the DOM, so the browser can render\n\t\t\t\t\tif (firstTime) {\n\t\t\t\t\t\t// #486: successorLi is set, if we re-rendered (i.e. discarded)\n\t\t\t\t\t\t// existing markup, which we want to insert at the same position.\n\t\t\t\t\t\t// (null is equivalent to append)\n\t\t\t\t\t\t// \t\tparent.ul.appendChild(node.li);\n\t\t\t\t\t\tparent.ul.insertBefore(node.li, successorLi);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Create HTML inside the node's outer `<span>` (i.e. expander, checkbox,\n\t\t\t * icon, and title).\n\t\t\t *\n\t\t\t * nodeRenderStatus() is implied.\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {string} [title] optinal new title\n\t\t\t */\n\t\t\tnodeRenderTitle: function (ctx, title) {\n\t\t\t\t// set node connector images, links and text\n\t\t\t\tvar checkbox,\n\t\t\t\t\tclassName,\n\t\t\t\t\ticon,\n\t\t\t\t\tnodeTitle,\n\t\t\t\t\trole,\n\t\t\t\t\ttabindex,\n\t\t\t\t\ttooltip,\n\t\t\t\t\ticonTooltip,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\taria = opts.aria,\n\t\t\t\t\tlevel = node.getLevel(),\n\t\t\t\t\tares = [];\n\n\t\t\t\tif (title !== undefined) {\n\t\t\t\t\tnode.title = title;\n\t\t\t\t}\n\t\t\t\tif (!node.span || tree._enableUpdate === false) {\n\t\t\t\t\t// Silently bail out if node was not rendered yet, assuming\n\t\t\t\t\t// node.render() will be called as the node becomes visible\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Connector (expanded, expandable or simple)\n\t\t\t\trole =\n\t\t\t\t\taria && node.hasChildren() !== false\n\t\t\t\t\t\t? \" role='button'\"\n\t\t\t\t\t\t: \"\";\n\t\t\t\tif (level < opts.minExpandLevel) {\n\t\t\t\t\tif (!node.lazy) {\n\t\t\t\t\t\tnode.expanded = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (level > 1) {\n\t\t\t\t\t\tares.push(\n\t\t\t\t\t\t\t\"<span \" +\n\t\t\t\t\t\t\t\trole +\n\t\t\t\t\t\t\t\t\" class='fancytree-expander fancytree-expander-fixed'></span>\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t// .. else (i.e. for root level) skip expander/connector alltogether\n\t\t\t\t} else {\n\t\t\t\t\tares.push(\n\t\t\t\t\t\t\"<span \" + role + \" class='fancytree-expander'></span>\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// Checkbox mode\n\t\t\t\tcheckbox = FT.evalOption(\"checkbox\", node, node, opts, false);\n\n\t\t\t\tif (checkbox && !node.isStatusNode()) {\n\t\t\t\t\trole = aria ? \" role='checkbox'\" : \"\";\n\t\t\t\t\tclassName = \"fancytree-checkbox\";\n\t\t\t\t\tif (\n\t\t\t\t\t\tcheckbox === \"radio\" ||\n\t\t\t\t\t\t(node.parent && node.parent.radiogroup)\n\t\t\t\t\t) {\n\t\t\t\t\t\tclassName += \" fancytree-radio\";\n\t\t\t\t\t}\n\t\t\t\t\tares.push(\n\t\t\t\t\t\t\"<span \" + role + \" class='\" + className + \"'></span>\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// Folder or doctype icon\n\t\t\t\tif (node.data.iconClass !== undefined) {\n\t\t\t\t\t// 2015-11-16\n\t\t\t\t\t// Handle / warn about backward compatibility\n\t\t\t\t\tif (node.icon) {\n\t\t\t\t\t\t$.error(\n\t\t\t\t\t\t\t\"'iconClass' node option is deprecated since v2.14.0: use 'icon' only instead\"\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\t\"'iconClass' node option is deprecated since v2.14.0: use 'icon' instead\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tnode.icon = node.data.iconClass;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If opts.icon is a callback and returns something other than undefined, use that\n\t\t\t\t// else if node.icon is a boolean or string, use that\n\t\t\t\t// else if opts.icon is a boolean or string, use that\n\t\t\t\t// else show standard icon (which may be different for folders or documents)\n\t\t\t\ticon = FT.evalOption(\"icon\", node, node, opts, true);\n\t\t\t\t// if( typeof icon !== \"boolean\" ) {\n\t\t\t\t// \t// icon is defined, but not true/false: must be a string\n\t\t\t\t// \ticon = \"\" + icon;\n\t\t\t\t// }\n\t\t\t\tif (icon !== false) {\n\t\t\t\t\trole = aria ? \" role='presentation'\" : \"\";\n\n\t\t\t\t\ticonTooltip = FT.evalOption(\n\t\t\t\t\t\t\"iconTooltip\",\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\topts,\n\t\t\t\t\t\tnull\n\t\t\t\t\t);\n\t\t\t\t\ticonTooltip = iconTooltip\n\t\t\t\t\t\t? \" title='\" + _escapeTooltip(iconTooltip) + \"'\"\n\t\t\t\t\t\t: \"\";\n\n\t\t\t\t\tif (typeof icon === \"string\") {\n\t\t\t\t\t\tif (TEST_IMG.test(icon)) {\n\t\t\t\t\t\t\t// node.icon is an image url. Prepend imagePath\n\t\t\t\t\t\t\ticon =\n\t\t\t\t\t\t\t\ticon.charAt(0) === \"/\"\n\t\t\t\t\t\t\t\t\t? icon\n\t\t\t\t\t\t\t\t\t: (opts.imagePath || \"\") + icon;\n\t\t\t\t\t\t\tares.push(\n\t\t\t\t\t\t\t\t\"<img src='\" +\n\t\t\t\t\t\t\t\t\ticon +\n\t\t\t\t\t\t\t\t\t\"' class='fancytree-icon'\" +\n\t\t\t\t\t\t\t\t\ticonTooltip +\n\t\t\t\t\t\t\t\t\t\" alt='' />\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tares.push(\n\t\t\t\t\t\t\t\t\"<span \" +\n\t\t\t\t\t\t\t\t\trole +\n\t\t\t\t\t\t\t\t\t\" class='fancytree-custom-icon \" +\n\t\t\t\t\t\t\t\t\ticon +\n\t\t\t\t\t\t\t\t\t\"'\" +\n\t\t\t\t\t\t\t\t\ticonTooltip +\n\t\t\t\t\t\t\t\t\t\"></span>\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (icon.text) {\n\t\t\t\t\t\tares.push(\n\t\t\t\t\t\t\t\"<span \" +\n\t\t\t\t\t\t\t\trole +\n\t\t\t\t\t\t\t\t\" class='fancytree-custom-icon \" +\n\t\t\t\t\t\t\t\t(icon.addClass || \"\") +\n\t\t\t\t\t\t\t\t\"'\" +\n\t\t\t\t\t\t\t\ticonTooltip +\n\t\t\t\t\t\t\t\t\">\" +\n\t\t\t\t\t\t\t\tFT.escapeHtml(icon.text) +\n\t\t\t\t\t\t\t\t\"</span>\"\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if (icon.html) {\n\t\t\t\t\t\tares.push(\n\t\t\t\t\t\t\t\"<span \" +\n\t\t\t\t\t\t\t\trole +\n\t\t\t\t\t\t\t\t\" class='fancytree-custom-icon \" +\n\t\t\t\t\t\t\t\t(icon.addClass || \"\") +\n\t\t\t\t\t\t\t\t\"'\" +\n\t\t\t\t\t\t\t\ticonTooltip +\n\t\t\t\t\t\t\t\t\">\" +\n\t\t\t\t\t\t\t\ticon.html +\n\t\t\t\t\t\t\t\t\"</span>\"\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// standard icon: theme css will take care of this\n\t\t\t\t\t\tares.push(\n\t\t\t\t\t\t\t\"<span \" +\n\t\t\t\t\t\t\t\trole +\n\t\t\t\t\t\t\t\t\" class='fancytree-icon'\" +\n\t\t\t\t\t\t\t\ticonTooltip +\n\t\t\t\t\t\t\t\t\"></span>\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Node title\n\t\t\t\tnodeTitle = \"\";\n\t\t\t\tif (opts.renderTitle) {\n\t\t\t\t\tnodeTitle =\n\t\t\t\t\t\topts.renderTitle.call(\n\t\t\t\t\t\t\ttree,\n\t\t\t\t\t\t\t{ type: \"renderTitle\" },\n\t\t\t\t\t\t\tctx\n\t\t\t\t\t\t) || \"\";\n\t\t\t\t}\n\t\t\t\tif (!nodeTitle) {\n\t\t\t\t\ttooltip = FT.evalOption(\"tooltip\", node, node, opts, null);\n\t\t\t\t\tif (tooltip === true) {\n\t\t\t\t\t\ttooltip = node.title;\n\t\t\t\t\t}\n\t\t\t\t\t// if( node.tooltip ) {\n\t\t\t\t\t// \ttooltip = node.tooltip;\n\t\t\t\t\t// } else if ( opts.tooltip ) {\n\t\t\t\t\t// \ttooltip = opts.tooltip === true ? node.title : opts.tooltip.call(tree, node);\n\t\t\t\t\t// }\n\t\t\t\t\ttooltip = tooltip\n\t\t\t\t\t\t? \" title='\" + _escapeTooltip(tooltip) + \"'\"\n\t\t\t\t\t\t: \"\";\n\t\t\t\t\ttabindex = opts.titlesTabbable ? \" tabindex='0'\" : \"\";\n\n\t\t\t\t\tnodeTitle =\n\t\t\t\t\t\t\"<span class='fancytree-title'\" +\n\t\t\t\t\t\ttooltip +\n\t\t\t\t\t\ttabindex +\n\t\t\t\t\t\t\">\" +\n\t\t\t\t\t\t(opts.escapeTitles\n\t\t\t\t\t\t\t? FT.escapeHtml(node.title)\n\t\t\t\t\t\t\t: node.title) +\n\t\t\t\t\t\t\"</span>\";\n\t\t\t\t}\n\t\t\t\tares.push(nodeTitle);\n\t\t\t\t// Note: this will trigger focusout, if node had the focus\n\t\t\t\t//$(node.span).html(ares.join(\"\")); // it will cleanup the jQuery data currently associated with SPAN (if any), but it executes more slowly\n\t\t\t\tnode.span.innerHTML = ares.join(\"\");\n\t\t\t\t// Update CSS classes\n\t\t\t\tthis.nodeRenderStatus(ctx);\n\t\t\t\tif (opts.enhanceTitle) {\n\t\t\t\t\tctx.$title = $(\">span.fancytree-title\", node.span);\n\t\t\t\t\tnodeTitle =\n\t\t\t\t\t\topts.enhanceTitle.call(\n\t\t\t\t\t\t\ttree,\n\t\t\t\t\t\t\t{ type: \"enhanceTitle\" },\n\t\t\t\t\t\t\tctx\n\t\t\t\t\t\t) || \"\";\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Update element classes according to node state.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeRenderStatus: function (ctx) {\n\t\t\t\t// Set classes for current status\n\t\t\t\tvar $ariaElem,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\t// \tnodeContainer = node[tree.nodeContainerAttrName],\n\t\t\t\t\thasChildren = node.hasChildren(),\n\t\t\t\t\tisLastSib = node.isLastSibling(),\n\t\t\t\t\taria = opts.aria,\n\t\t\t\t\tcn = opts._classNames,\n\t\t\t\t\tcnList = [],\n\t\t\t\t\tstatusElem = node[tree.statusClassPropName];\n\n\t\t\t\tif (!statusElem || tree._enableUpdate === false) {\n\t\t\t\t\t// if this function is called for an unrendered node, ignore it (will be updated on nect render anyway)\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (aria) {\n\t\t\t\t\t$ariaElem = $(node.tr || node.li);\n\t\t\t\t}\n\t\t\t\t// Build a list of class names that we will add to the node <span>\n\t\t\t\tcnList.push(cn.node);\n\t\t\t\tif (tree.activeNode === node) {\n\t\t\t\t\tcnList.push(cn.active);\n\t\t\t\t\t// \t\t$(\">span.fancytree-title\", statusElem).attr(\"tabindex\", \"0\");\n\t\t\t\t\t// \t\ttree.$container.removeAttr(\"tabindex\");\n\t\t\t\t\t// }else{\n\t\t\t\t\t// \t\t$(\">span.fancytree-title\", statusElem).removeAttr(\"tabindex\");\n\t\t\t\t\t// \t\ttree.$container.attr(\"tabindex\", \"0\");\n\t\t\t\t}\n\t\t\t\tif (tree.focusNode === node) {\n\t\t\t\t\tcnList.push(cn.focused);\n\t\t\t\t}\n\t\t\t\tif (node.expanded) {\n\t\t\t\t\tcnList.push(cn.expanded);\n\t\t\t\t}\n\t\t\t\tif (aria) {\n\t\t\t\t\tif (hasChildren === false) {\n\t\t\t\t\t\t$ariaElem.removeAttr(\"aria-expanded\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$ariaElem.attr(\"aria-expanded\", Boolean(node.expanded));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (node.folder) {\n\t\t\t\t\tcnList.push(cn.folder);\n\t\t\t\t}\n\t\t\t\tif (hasChildren !== false) {\n\t\t\t\t\tcnList.push(cn.hasChildren);\n\t\t\t\t}\n\t\t\t\t// TODO: required?\n\t\t\t\tif (isLastSib) {\n\t\t\t\t\tcnList.push(cn.lastsib);\n\t\t\t\t}\n\t\t\t\tif (node.lazy && node.children == null) {\n\t\t\t\t\tcnList.push(cn.lazy);\n\t\t\t\t}\n\t\t\t\tif (node.partload) {\n\t\t\t\t\tcnList.push(cn.partload);\n\t\t\t\t}\n\t\t\t\tif (node.partsel) {\n\t\t\t\t\tcnList.push(cn.partsel);\n\t\t\t\t}\n\t\t\t\tif (FT.evalOption(\"unselectable\", node, node, opts, false)) {\n\t\t\t\t\tcnList.push(cn.unselectable);\n\t\t\t\t}\n\t\t\t\tif (node._isLoading) {\n\t\t\t\t\tcnList.push(cn.loading);\n\t\t\t\t}\n\t\t\t\tif (node._error) {\n\t\t\t\t\tcnList.push(cn.error);\n\t\t\t\t}\n\t\t\t\tif (node.statusNodeType) {\n\t\t\t\t\tcnList.push(cn.statusNodePrefix + node.statusNodeType);\n\t\t\t\t}\n\t\t\t\tif (node.selected) {\n\t\t\t\t\tcnList.push(cn.selected);\n\t\t\t\t\tif (aria) {\n\t\t\t\t\t\t$ariaElem.attr(\"aria-selected\", true);\n\t\t\t\t\t}\n\t\t\t\t} else if (aria) {\n\t\t\t\t\t$ariaElem.attr(\"aria-selected\", false);\n\t\t\t\t}\n\t\t\t\tif (node.extraClasses) {\n\t\t\t\t\tcnList.push(node.extraClasses);\n\t\t\t\t}\n\t\t\t\t// IE6 doesn't correctly evaluate multiple class names,\n\t\t\t\t// so we create combined class names that can be used in the CSS\n\t\t\t\tif (hasChildren === false) {\n\t\t\t\t\tcnList.push(\n\t\t\t\t\t\tcn.combinedExpanderPrefix + \"n\" + (isLastSib ? \"l\" : \"\")\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tcnList.push(\n\t\t\t\t\t\tcn.combinedExpanderPrefix +\n\t\t\t\t\t\t\t(node.expanded ? \"e\" : \"c\") +\n\t\t\t\t\t\t\t(node.lazy && node.children == null ? \"d\" : \"\") +\n\t\t\t\t\t\t\t(isLastSib ? \"l\" : \"\")\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tcnList.push(\n\t\t\t\t\tcn.combinedIconPrefix +\n\t\t\t\t\t\t(node.expanded ? \"e\" : \"c\") +\n\t\t\t\t\t\t(node.folder ? \"f\" : \"\")\n\t\t\t\t);\n\t\t\t\t// node.span.className = cnList.join(\" \");\n\t\t\t\tstatusElem.className = cnList.join(\" \");\n\n\t\t\t\t// TODO: we should not set this in the <span> tag also, if we set it here:\n\t\t\t\t// Maybe most (all) of the classes should be set in LI instead of SPAN?\n\t\t\t\tif (node.li) {\n\t\t\t\t\t// #719: we have to consider that there may be already other classes:\n\t\t\t\t\t$(node.li).toggleClass(cn.lastsib, isLastSib);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Activate node.\n\t\t\t * flag defaults to true.\n\t\t\t * If flag is true, the node is activated (must be a synchronous operation)\n\t\t\t * If flag is false, the node is deactivated (must be a synchronous operation)\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} [flag=true]\n\t\t\t * @param {object} [opts] additional options. Defaults to {noEvents: false, noFocus: false}\n\t\t\t * @returns {$.Promise}\n\t\t\t */\n\t\t\tnodeSetActive: function (ctx, flag, callOpts) {\n\t\t\t\t// Handle user click / [space] / [enter], according to clickFolderMode.\n\t\t\t\tcallOpts = callOpts || {};\n\t\t\t\tvar subCtx,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\tnoEvents = callOpts.noEvents === true,\n\t\t\t\t\tnoFocus = callOpts.noFocus === true,\n\t\t\t\t\tscroll = callOpts.scrollIntoView !== false,\n\t\t\t\t\tisActive = node === tree.activeNode;\n\n\t\t\t\t// flag defaults to true\n\t\t\t\tflag = flag !== false;\n\t\t\t\t// node.debug(\"nodeSetActive\", flag);\n\n\t\t\t\tif (isActive === flag) {\n\t\t\t\t\t// Nothing to do\n\t\t\t\t\treturn _getResolvedPromise(node);\n\t\t\t\t}\n\t\t\t\t// #1042: don't scroll between mousedown/-up when clicking an embedded link\n\t\t\t\tif (\n\t\t\t\t\tscroll &&\n\t\t\t\t\tctx.originalEvent &&\n\t\t\t\t\t$(ctx.originalEvent.target).is(\"a,:checkbox\")\n\t\t\t\t) {\n\t\t\t\t\tnode.info(\"Not scrolling while clicking an embedded link.\");\n\t\t\t\t\tscroll = false;\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\tflag &&\n\t\t\t\t\t!noEvents &&\n\t\t\t\t\tthis._triggerNodeEvent(\n\t\t\t\t\t\t\"beforeActivate\",\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tctx.originalEvent\n\t\t\t\t\t) === false\n\t\t\t\t) {\n\t\t\t\t\t// Callback returned false\n\t\t\t\t\treturn _getRejectedPromise(node, [\"rejected\"]);\n\t\t\t\t}\n\t\t\t\tif (flag) {\n\t\t\t\t\tif (tree.activeNode) {\n\t\t\t\t\t\t_assert(\n\t\t\t\t\t\t\ttree.activeNode !== node,\n\t\t\t\t\t\t\t\"node was active (inconsistency)\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tsubCtx = $.extend({}, ctx, { node: tree.activeNode });\n\t\t\t\t\t\ttree.nodeSetActive(subCtx, false);\n\t\t\t\t\t\t_assert(\n\t\t\t\t\t\t\ttree.activeNode === null,\n\t\t\t\t\t\t\t\"deactivate was out of sync?\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (opts.activeVisible) {\n\t\t\t\t\t\t// If no focus is set (noFocus: true) and there is no focused node, this node is made visible.\n\t\t\t\t\t\t// scroll = noFocus && tree.focusNode == null;\n\t\t\t\t\t\t// #863: scroll by default (unless `scrollIntoView: false` was passed)\n\t\t\t\t\t\tnode.makeVisible({ scrollIntoView: scroll });\n\t\t\t\t\t}\n\t\t\t\t\ttree.activeNode = node;\n\t\t\t\t\ttree.nodeRenderStatus(ctx);\n\t\t\t\t\tif (!noFocus) {\n\t\t\t\t\t\ttree.nodeSetFocus(ctx);\n\t\t\t\t\t}\n\t\t\t\t\tif (!noEvents) {\n\t\t\t\t\t\ttree._triggerNodeEvent(\n\t\t\t\t\t\t\t\"activate\",\n\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\tctx.originalEvent\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t_assert(\n\t\t\t\t\t\ttree.activeNode === node,\n\t\t\t\t\t\t\"node was not active (inconsistency)\"\n\t\t\t\t\t);\n\t\t\t\t\ttree.activeNode = null;\n\t\t\t\t\tthis.nodeRenderStatus(ctx);\n\t\t\t\t\tif (!noEvents) {\n\t\t\t\t\t\tctx.tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\"deactivate\",\n\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\tctx.originalEvent\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn _getResolvedPromise(node);\n\t\t\t},\n\t\t\t/** Expand or collapse node, return Deferred.promise.\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} [flag=true]\n\t\t\t * @param {object} [opts] additional options. Defaults to `{noAnimation: false, noEvents: false}`\n\t\t\t * @returns {$.Promise} The deferred will be resolved as soon as the (lazy)\n\t\t\t * data was retrieved, rendered, and the expand animation finished.\n\t\t\t */\n\t\t\tnodeSetExpanded: function (ctx, flag, callOpts) {\n\t\t\t\tcallOpts = callOpts || {};\n\t\t\t\tvar _afterLoad,\n\t\t\t\t\tdfd,\n\t\t\t\t\ti,\n\t\t\t\t\tl,\n\t\t\t\t\tparents,\n\t\t\t\t\tprevAC,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\tnoAnimation = callOpts.noAnimation === true,\n\t\t\t\t\tnoEvents = callOpts.noEvents === true;\n\n\t\t\t\t// flag defaults to true\n\t\t\t\tflag = flag !== false;\n\n\t\t\t\t// node.debug(\"nodeSetExpanded(\" + flag + \")\");\n\n\t\t\t\tif ($(node.li).hasClass(opts._classNames.animating)) {\n\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\"setExpanded(\" + flag + \") while animating: ignored.\"\n\t\t\t\t\t);\n\t\t\t\t\treturn _getRejectedPromise(node, [\"recursion\"]);\n\t\t\t\t}\n\n\t\t\t\tif ((node.expanded && flag) || (!node.expanded && !flag)) {\n\t\t\t\t\t// Nothing to do\n\t\t\t\t\t// node.debug(\"nodeSetExpanded(\" + flag + \"): nothing to do\");\n\t\t\t\t\treturn _getResolvedPromise(node);\n\t\t\t\t} else if (flag && !node.lazy && !node.hasChildren()) {\n\t\t\t\t\t// Prevent expanding of empty nodes\n\t\t\t\t\t// return _getRejectedPromise(node, [\"empty\"]);\n\t\t\t\t\treturn _getResolvedPromise(node);\n\t\t\t\t} else if (!flag && node.getLevel() < opts.minExpandLevel) {\n\t\t\t\t\t// Prevent collapsing locked levels\n\t\t\t\t\treturn _getRejectedPromise(node, [\"locked\"]);\n\t\t\t\t} else if (\n\t\t\t\t\t!noEvents &&\n\t\t\t\t\tthis._triggerNodeEvent(\n\t\t\t\t\t\t\"beforeExpand\",\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tctx.originalEvent\n\t\t\t\t\t) === false\n\t\t\t\t) {\n\t\t\t\t\t// Callback returned false\n\t\t\t\t\treturn _getRejectedPromise(node, [\"rejected\"]);\n\t\t\t\t}\n\t\t\t\t// If this node inside a collpased node, no animation and scrolling is needed\n\t\t\t\tif (!noAnimation && !node.isVisible()) {\n\t\t\t\t\tnoAnimation = callOpts.noAnimation = true;\n\t\t\t\t}\n\n\t\t\t\tdfd = new $.Deferred();\n\n\t\t\t\t// Auto-collapse mode: collapse all siblings\n\t\t\t\tif (flag && !node.expanded && opts.autoCollapse) {\n\t\t\t\t\tparents = node.getParentList(false, true);\n\t\t\t\t\tprevAC = opts.autoCollapse;\n\t\t\t\t\ttry {\n\t\t\t\t\t\topts.autoCollapse = false;\n\t\t\t\t\t\tfor (i = 0, l = parents.length; i < l; i++) {\n\t\t\t\t\t\t\t// TODO: should return promise?\n\t\t\t\t\t\t\tthis._callHook(\n\t\t\t\t\t\t\t\t\"nodeCollapseSiblings\",\n\t\t\t\t\t\t\t\tparents[i],\n\t\t\t\t\t\t\t\tcallOpts\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} finally {\n\t\t\t\t\t\topts.autoCollapse = prevAC;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Trigger expand/collapse after expanding\n\t\t\t\tdfd.done(function () {\n\t\t\t\t\tvar lastChild = node.getLastChild();\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tflag &&\n\t\t\t\t\t\topts.autoScroll &&\n\t\t\t\t\t\t!noAnimation &&\n\t\t\t\t\t\tlastChild &&\n\t\t\t\t\t\ttree._enableUpdate\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Scroll down to last child, but keep current node visible\n\t\t\t\t\t\tlastChild\n\t\t\t\t\t\t\t.scrollIntoView(true, { topNode: node })\n\t\t\t\t\t\t\t.always(function () {\n\t\t\t\t\t\t\t\tif (!noEvents) {\n\t\t\t\t\t\t\t\t\tctx.tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\t\tflag ? \"expand\" : \"collapse\",\n\t\t\t\t\t\t\t\t\t\tctx\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!noEvents) {\n\t\t\t\t\t\t\tctx.tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\tflag ? \"expand\" : \"collapse\",\n\t\t\t\t\t\t\t\tctx\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t// vvv Code below is executed after loading finished:\n\t\t\t\t_afterLoad = function (callback) {\n\t\t\t\t\tvar cn = opts._classNames,\n\t\t\t\t\t\tisVisible,\n\t\t\t\t\t\tisExpanded,\n\t\t\t\t\t\teffect = opts.toggleEffect;\n\n\t\t\t\t\tnode.expanded = flag;\n\t\t\t\t\ttree._callHook(\n\t\t\t\t\t\t\"treeStructureChanged\",\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tflag ? \"expand\" : \"collapse\"\n\t\t\t\t\t);\n\t\t\t\t\t// Create required markup, but make sure the top UL is hidden, so we\n\t\t\t\t\t// can animate later\n\t\t\t\t\ttree._callHook(\"nodeRender\", ctx, false, false, true);\n\n\t\t\t\t\t// Hide children, if node is collapsed\n\t\t\t\t\tif (node.ul) {\n\t\t\t\t\t\tisVisible = node.ul.style.display !== \"none\";\n\t\t\t\t\t\tisExpanded = !!node.expanded;\n\t\t\t\t\t\tif (isVisible === isExpanded) {\n\t\t\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\t\t\"nodeSetExpanded: UL.style.display already set\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else if (!effect || noAnimation) {\n\t\t\t\t\t\t\tnode.ul.style.display =\n\t\t\t\t\t\t\t\tnode.expanded || !parent ? \"\" : \"none\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// The UI toggle() effect works with the ext-wide extension,\n\t\t\t\t\t\t\t// while jQuery.animate() has problems when the title span\n\t\t\t\t\t\t\t// has position: absolute.\n\t\t\t\t\t\t\t// Since jQuery UI 1.12, the blind effect requires the parent\n\t\t\t\t\t\t\t// element to have 'position: relative'.\n\t\t\t\t\t\t\t// See #716, #717\n\t\t\t\t\t\t\t$(node.li).addClass(cn.animating); // #717\n\n\t\t\t\t\t\t\tif (_isFunction($(node.ul)[effect.effect])) {\n\t\t\t\t\t\t\t\t// tree.debug( \"use jquery.\" + effect.effect + \" method\" );\n\t\t\t\t\t\t\t\t$(node.ul)[effect.effect]({\n\t\t\t\t\t\t\t\t\tduration: effect.duration,\n\t\t\t\t\t\t\t\t\talways: function () {\n\t\t\t\t\t\t\t\t\t\t// node.debug(\"fancytree-animating end: \" + node.li.className);\n\t\t\t\t\t\t\t\t\t\t$(this).removeClass(cn.animating); // #716\n\t\t\t\t\t\t\t\t\t\t$(node.li).removeClass(cn.animating); // #717\n\t\t\t\t\t\t\t\t\t\tcallback();\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// The UI toggle() effect works with the ext-wide extension,\n\t\t\t\t\t\t\t\t// while jQuery.animate() has problems when the title span\n\t\t\t\t\t\t\t\t// has positon: absolute.\n\t\t\t\t\t\t\t\t// Since jQuery UI 1.12, the blind effect requires the parent\n\t\t\t\t\t\t\t\t// element to have 'position: relative'.\n\t\t\t\t\t\t\t\t// See #716, #717\n\t\t\t\t\t\t\t\t// tree.debug(\"use specified effect (\" + effect.effect + \") with the jqueryui.toggle method\");\n\n\t\t\t\t\t\t\t\t// try to stop an animation that might be already in progress\n\t\t\t\t\t\t\t\t$(node.ul).stop(true, true); //< does not work after resetLazy has been called for a node whose animation wasn't complete and effect was \"blind\"\n\n\t\t\t\t\t\t\t\t// dirty fix to remove a defunct animation (effect: \"blind\") after resetLazy has been called\n\t\t\t\t\t\t\t\t$(node.ul)\n\t\t\t\t\t\t\t\t\t.parent()\n\t\t\t\t\t\t\t\t\t.find(\".ui-effects-placeholder\")\n\t\t\t\t\t\t\t\t\t.remove();\n\n\t\t\t\t\t\t\t\t$(node.ul).toggle(\n\t\t\t\t\t\t\t\t\teffect.effect,\n\t\t\t\t\t\t\t\t\teffect.options,\n\t\t\t\t\t\t\t\t\teffect.duration,\n\t\t\t\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t\t\t\t// node.debug(\"fancytree-animating end: \" + node.li.className);\n\t\t\t\t\t\t\t\t\t\t$(this).removeClass(cn.animating); // #716\n\t\t\t\t\t\t\t\t\t\t$(node.li).removeClass(cn.animating); // #717\n\t\t\t\t\t\t\t\t\t\tcallback();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcallback();\n\t\t\t\t};\n\t\t\t\t// ^^^ Code above is executed after loading finshed.\n\n\t\t\t\t// Load lazy nodes, if any. Then continue with _afterLoad()\n\t\t\t\tif (flag && node.lazy && node.hasChildren() === undefined) {\n\t\t\t\t\t// node.debug(\"nodeSetExpanded: load start...\");\n\t\t\t\t\tnode.load()\n\t\t\t\t\t\t.done(function () {\n\t\t\t\t\t\t\t// node.debug(\"nodeSetExpanded: load done\");\n\t\t\t\t\t\t\tif (dfd.notifyWith) {\n\t\t\t\t\t\t\t\t// requires jQuery 1.6+\n\t\t\t\t\t\t\t\tdfd.notifyWith(node, [\"loaded\"]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_afterLoad(function () {\n\t\t\t\t\t\t\t\tdfd.resolveWith(node);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.fail(function (errMsg) {\n\t\t\t\t\t\t\t_afterLoad(function () {\n\t\t\t\t\t\t\t\tdfd.rejectWith(node, [\n\t\t\t\t\t\t\t\t\t\"load failed (\" + errMsg + \")\",\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t/*\n\t\t\t\t\tvar source = tree._triggerNodeEvent(\"lazyLoad\", node, ctx.originalEvent);\n\t\t\t\t\t_assert(typeof source !== \"boolean\", \"lazyLoad event must return source in data.result\");\n\t\t\t\t\tnode.debug(\"nodeSetExpanded: load start...\");\n\t\t\t\t\tthis._callHook(\"nodeLoadChildren\", ctx, source).done(function(){\n\t\t\t\t\t\tnode.debug(\"nodeSetExpanded: load done\");\n\t\t\t\t\t\tif(dfd.notifyWith){ // requires jQuery 1.6+\n\t\t\t\t\t\t\tdfd.notifyWith(node, [\"loaded\"]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t_afterLoad.call(tree);\n\t\t\t\t\t}).fail(function(errMsg){\n\t\t\t\t\t\tdfd.rejectWith(node, [\"load failed (\" + errMsg + \")\"]);\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t} else {\n\t\t\t\t\t_afterLoad(function () {\n\t\t\t\t\t\tdfd.resolveWith(node);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// node.debug(\"nodeSetExpanded: returns\");\n\t\t\t\treturn dfd.promise();\n\t\t\t},\n\t\t\t/** Focus or blur this node.\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} [flag=true]\n\t\t\t */\n\t\t\tnodeSetFocus: function (ctx, flag) {\n\t\t\t\t// ctx.node.debug(\"nodeSetFocus(\" + flag + \")\");\n\t\t\t\tvar ctx2,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\topts = tree.options,\n\t\t\t\t\t// et = ctx.originalEvent && ctx.originalEvent.type,\n\t\t\t\t\tisInput = ctx.originalEvent\n\t\t\t\t\t\t? $(ctx.originalEvent.target).is(\":input\")\n\t\t\t\t\t\t: false;\n\n\t\t\t\tflag = flag !== false;\n\n\t\t\t\t// (node || tree).debug(\"nodeSetFocus(\" + flag + \"), event: \" + et + \", isInput: \"+ isInput);\n\t\t\t\t// Blur previous node if any\n\t\t\t\tif (tree.focusNode) {\n\t\t\t\t\tif (tree.focusNode === node && flag) {\n\t\t\t\t\t\t// node.debug(\"nodeSetFocus(\" + flag + \"): nothing to do\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tctx2 = $.extend({}, ctx, { node: tree.focusNode });\n\t\t\t\t\ttree.focusNode = null;\n\t\t\t\t\tthis._triggerNodeEvent(\"blur\", ctx2);\n\t\t\t\t\tthis._callHook(\"nodeRenderStatus\", ctx2);\n\t\t\t\t}\n\t\t\t\t// Set focus to container and node\n\t\t\t\tif (flag) {\n\t\t\t\t\tif (!this.hasFocus()) {\n\t\t\t\t\t\tnode.debug(\"nodeSetFocus: forcing container focus\");\n\t\t\t\t\t\tthis._callHook(\"treeSetFocus\", ctx, true, {\n\t\t\t\t\t\t\tcalledByNode: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tnode.makeVisible({ scrollIntoView: false });\n\t\t\t\t\ttree.focusNode = node;\n\t\t\t\t\tif (opts.titlesTabbable) {\n\t\t\t\t\t\tif (!isInput) {\n\t\t\t\t\t\t\t// #621\n\t\t\t\t\t\t\t$(node.span).find(\".fancytree-title\").focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (opts.aria) {\n\t\t\t\t\t\t// Set active descendant to node's span ID (create one, if needed)\n\t\t\t\t\t\t$(tree.$container).attr(\n\t\t\t\t\t\t\t\"aria-activedescendant\",\n\t\t\t\t\t\t\t$(node.tr || node.li)\n\t\t\t\t\t\t\t\t.uniqueId()\n\t\t\t\t\t\t\t\t.attr(\"id\")\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// \"ftal_\" + opts.idPrefix + node.key);\n\t\t\t\t\t}\n\t\t\t\t\t// $(node.span).find(\".fancytree-title\").focus();\n\t\t\t\t\tthis._triggerNodeEvent(\"focus\", ctx);\n\n\t\t\t\t\t// determine if we have focus on or inside tree container\n\t\t\t\t\tvar hasFancytreeFocus =\n\t\t\t\t\t\tdocument.activeElement === tree.$container.get(0) ||\n\t\t\t\t\t\t$(document.activeElement, tree.$container).length >= 1;\n\n\t\t\t\t\tif (!hasFancytreeFocus) {\n\t\t\t\t\t\t// We cannot set KB focus to a node, so use the tree container\n\t\t\t\t\t\t// #563, #570: IE scrolls on every call to .focus(), if the container\n\t\t\t\t\t\t// is partially outside the viewport. So do it only, when absolutely\n\t\t\t\t\t\t// necessary.\n\t\t\t\t\t\t$(tree.$container).focus();\n\t\t\t\t\t}\n\n\t\t\t\t\t// if( opts.autoActivate ){\n\t\t\t\t\t// \ttree.nodeSetActive(ctx, true);\n\t\t\t\t\t// }\n\t\t\t\t\tif (opts.autoScroll) {\n\t\t\t\t\t\tnode.scrollIntoView();\n\t\t\t\t\t}\n\t\t\t\t\tthis._callHook(\"nodeRenderStatus\", ctx);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** (De)Select node, return new status (sync).\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} [flag=true]\n\t\t\t * @param {object} [opts] additional options. Defaults to {noEvents: false,\n\t\t\t * propagateDown: null, propagateUp: null,\n\t\t\t * callback: null,\n\t\t\t * }\n\t\t\t * @returns {boolean} previous status\n\t\t\t */\n\t\t\tnodeSetSelected: function (ctx, flag, callOpts) {\n\t\t\t\tcallOpts = callOpts || {};\n\t\t\t\tvar node = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\tnoEvents = callOpts.noEvents === true,\n\t\t\t\t\tparent = node.parent;\n\n\t\t\t\t// flag defaults to true\n\t\t\t\tflag = flag !== false;\n\n\t\t\t\t// node.debug(\"nodeSetSelected(\" + flag + \")\", ctx);\n\n\t\t\t\t// Cannot (de)select unselectable nodes directly (only by propagation or\n\t\t\t\t// by setting the `.selected` property)\n\t\t\t\tif (FT.evalOption(\"unselectable\", node, node, opts, false)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Remember the user's intent, in case down -> up propagation prevents\n\t\t\t\t// applying it to node.selected\n\t\t\t\tnode._lastSelectIntent = flag; // Confusing use of '!'\n\n\t\t\t\t// Nothing to do?\n\t\t\t\tif (!!node.selected === flag) {\n\t\t\t\t\tif (opts.selectMode === 3 && node.partsel && !flag) {\n\t\t\t\t\t\t// If propagation prevented selecting this node last time, we still\n\t\t\t\t\t\t// want to allow to apply setSelected(false) now\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn flag;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t!noEvents &&\n\t\t\t\t\tthis._triggerNodeEvent(\n\t\t\t\t\t\t\"beforeSelect\",\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tctx.originalEvent\n\t\t\t\t\t) === false\n\t\t\t\t) {\n\t\t\t\t\treturn !!node.selected;\n\t\t\t\t}\n\t\t\t\tif (flag && opts.selectMode === 1) {\n\t\t\t\t\t// single selection mode (we don't uncheck all tree nodes, for performance reasons)\n\t\t\t\t\tif (tree.lastSelectedNode) {\n\t\t\t\t\t\ttree.lastSelectedNode.setSelected(false);\n\t\t\t\t\t}\n\t\t\t\t\tnode.selected = flag;\n\t\t\t\t} else if (\n\t\t\t\t\topts.selectMode === 3 &&\n\t\t\t\t\tparent &&\n\t\t\t\t\t!parent.radiogroup &&\n\t\t\t\t\t!node.radiogroup\n\t\t\t\t) {\n\t\t\t\t\t// multi-hierarchical selection mode\n\t\t\t\t\tnode.selected = flag;\n\t\t\t\t\tnode.fixSelection3AfterClick(callOpts);\n\t\t\t\t} else if (parent && parent.radiogroup) {\n\t\t\t\t\tnode.visitSiblings(function (n) {\n\t\t\t\t\t\tn._changeSelectStatusAttrs(flag && n === node);\n\t\t\t\t\t}, true);\n\t\t\t\t} else {\n\t\t\t\t\t// default: selectMode: 2, multi selection mode\n\t\t\t\t\tnode.selected = flag;\n\t\t\t\t}\n\t\t\t\tthis.nodeRenderStatus(ctx);\n\t\t\t\ttree.lastSelectedNode = flag ? node : null;\n\t\t\t\tif (!noEvents) {\n\t\t\t\t\ttree._triggerNodeEvent(\"select\", ctx);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Show node status (ok, loading, error, nodata) using styles and a dummy child node.\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param status\n\t\t\t * @param message\n\t\t\t * @param details\n\t\t\t * @since 2.3\n\t\t\t */\n\t\t\tnodeSetStatus: function (ctx, status, message, details) {\n\t\t\t\tvar node = ctx.node,\n\t\t\t\t\ttree = ctx.tree;\n\n\t\t\t\tfunction _clearStatusNode() {\n\t\t\t\t\t// Remove dedicated dummy node, if any\n\t\t\t\t\tvar firstChild = node.children ? node.children[0] : null;\n\t\t\t\t\tif (firstChild && firstChild.isStatusNode()) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// I've seen exceptions here with loadKeyPath...\n\t\t\t\t\t\t\tif (node.ul) {\n\t\t\t\t\t\t\t\tnode.ul.removeChild(firstChild.li);\n\t\t\t\t\t\t\t\tfirstChild.li = null; // avoid leaks (DT issue 215)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t\tif (node.children.length === 1) {\n\t\t\t\t\t\t\tnode.children = [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnode.children.shift();\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttree._callHook(\n\t\t\t\t\t\t\t\"treeStructureChanged\",\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\"clearStatusNode\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfunction _setStatusNode(data, type) {\n\t\t\t\t\t// Create/modify the dedicated dummy node for 'loading...' or\n\t\t\t\t\t// 'error!' status. (only called for direct child of the invisible\n\t\t\t\t\t// system root)\n\t\t\t\t\tvar firstChild = node.children ? node.children[0] : null;\n\t\t\t\t\tif (firstChild && firstChild.isStatusNode()) {\n\t\t\t\t\t\t$.extend(firstChild, data);\n\t\t\t\t\t\tfirstChild.statusNodeType = type;\n\t\t\t\t\t\ttree._callHook(\"nodeRenderTitle\", firstChild);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnode._setChildren([data]);\n\t\t\t\t\t\ttree._callHook(\n\t\t\t\t\t\t\t\"treeStructureChanged\",\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\"setStatusNode\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tnode.children[0].statusNodeType = type;\n\t\t\t\t\t\ttree.render();\n\t\t\t\t\t}\n\t\t\t\t\treturn node.children[0];\n\t\t\t\t}\n\n\t\t\t\tswitch (status) {\n\t\t\t\t\tcase \"ok\":\n\t\t\t\t\t\t_clearStatusNode();\n\t\t\t\t\t\tnode._isLoading = false;\n\t\t\t\t\t\tnode._error = null;\n\t\t\t\t\t\tnode.renderStatus();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"loading\":\n\t\t\t\t\t\tif (!node.parent) {\n\t\t\t\t\t\t\t_setStatusNode(\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle:\n\t\t\t\t\t\t\t\t\t\ttree.options.strings.loading +\n\t\t\t\t\t\t\t\t\t\t(message ? \" (\" + message + \")\" : \"\"),\n\t\t\t\t\t\t\t\t\t// icon: true, // needed for 'loding' icon\n\t\t\t\t\t\t\t\t\tcheckbox: false,\n\t\t\t\t\t\t\t\t\ttooltip: details,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tstatus\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnode._isLoading = true;\n\t\t\t\t\t\tnode._error = null;\n\t\t\t\t\t\tnode.renderStatus();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"error\":\n\t\t\t\t\t\t_setStatusNode(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttitle:\n\t\t\t\t\t\t\t\t\ttree.options.strings.loadError +\n\t\t\t\t\t\t\t\t\t(message ? \" (\" + message + \")\" : \"\"),\n\t\t\t\t\t\t\t\t// icon: false,\n\t\t\t\t\t\t\t\tcheckbox: false,\n\t\t\t\t\t\t\t\ttooltip: details,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tstatus\n\t\t\t\t\t\t);\n\t\t\t\t\t\tnode._isLoading = false;\n\t\t\t\t\t\tnode._error = { message: message, details: details };\n\t\t\t\t\t\tnode.renderStatus();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"nodata\":\n\t\t\t\t\t\t_setStatusNode(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttitle: message || tree.options.strings.noData,\n\t\t\t\t\t\t\t\t// icon: false,\n\t\t\t\t\t\t\t\tcheckbox: false,\n\t\t\t\t\t\t\t\ttooltip: details,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tstatus\n\t\t\t\t\t\t);\n\t\t\t\t\t\tnode._isLoading = false;\n\t\t\t\t\t\tnode._error = null;\n\t\t\t\t\t\tnode.renderStatus();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$.error(\"invalid node status \" + status);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/**\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeToggleExpanded: function (ctx) {\n\t\t\t\treturn this.nodeSetExpanded(ctx, !ctx.node.expanded);\n\t\t\t},\n\t\t\t/**\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeToggleSelected: function (ctx) {\n\t\t\t\tvar node = ctx.node,\n\t\t\t\t\tflag = !node.selected;\n\n\t\t\t\t// In selectMode: 3 this node may be unselected+partsel, even if\n\t\t\t\t// setSelected(true) was called before, due to `unselectable` children.\n\t\t\t\t// In this case, we now toggle as `setSelected(false)`\n\t\t\t\tif (\n\t\t\t\t\tnode.partsel &&\n\t\t\t\t\t!node.selected &&\n\t\t\t\t\tnode._lastSelectIntent === true\n\t\t\t\t) {\n\t\t\t\t\tflag = false;\n\t\t\t\t\tnode.selected = true; // so it is not considered 'nothing to do'\n\t\t\t\t}\n\t\t\t\tnode._lastSelectIntent = flag;\n\t\t\t\treturn this.nodeSetSelected(ctx, flag);\n\t\t\t},\n\t\t\t/** Remove all nodes.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\ttreeClear: function (ctx) {\n\t\t\t\tvar tree = ctx.tree;\n\t\t\t\ttree.activeNode = null;\n\t\t\t\ttree.focusNode = null;\n\t\t\t\ttree.$div.find(\">ul.fancytree-container\").empty();\n\t\t\t\t// TODO: call destructors and remove reference loops\n\t\t\t\ttree.rootNode.children = null;\n\t\t\t\ttree._callHook(\"treeStructureChanged\", ctx, \"clear\");\n\t\t\t},\n\t\t\t/** Widget was created (called only once, even it re-initialized).\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\ttreeCreate: function (ctx) {},\n\t\t\t/** Widget was destroyed.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\ttreeDestroy: function (ctx) {\n\t\t\t\tthis.$div.find(\">ul.fancytree-container\").remove();\n\t\t\t\tif (this.$source) {\n\t\t\t\t\tthis.$source.removeClass(\"fancytree-helper-hidden\");\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Widget was (re-)initialized.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\ttreeInit: function (ctx) {\n\t\t\t\tvar tree = ctx.tree,\n\t\t\t\t\topts = tree.options;\n\n\t\t\t\t//this.debug(\"Fancytree.treeInit()\");\n\t\t\t\t// Add container to the TAB chain\n\t\t\t\t// See http://www.w3.org/TR/wai-aria-practices/#focus_activedescendant\n\t\t\t\t// #577: Allow to set tabindex to \"0\", \"-1\" and \"\"\n\t\t\t\ttree.$container.attr(\"tabindex\", opts.tabindex);\n\n\t\t\t\t// Copy some attributes to tree.data\n\t\t\t\t$.each(TREE_ATTRS, function (i, attr) {\n\t\t\t\t\tif (opts[attr] !== undefined) {\n\t\t\t\t\t\ttree.info(\"Move option \" + attr + \" to tree\");\n\t\t\t\t\t\ttree[attr] = opts[attr];\n\t\t\t\t\t\tdelete opts[attr];\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (opts.checkboxAutoHide) {\n\t\t\t\t\ttree.$container.addClass(\"fancytree-checkbox-auto-hide\");\n\t\t\t\t}\n\t\t\t\tif (opts.rtl) {\n\t\t\t\t\ttree.$container\n\t\t\t\t\t\t.attr(\"DIR\", \"RTL\")\n\t\t\t\t\t\t.addClass(\"fancytree-rtl\");\n\t\t\t\t} else {\n\t\t\t\t\ttree.$container\n\t\t\t\t\t\t.removeAttr(\"DIR\")\n\t\t\t\t\t\t.removeClass(\"fancytree-rtl\");\n\t\t\t\t}\n\t\t\t\tif (opts.aria) {\n\t\t\t\t\ttree.$container.attr(\"role\", \"tree\");\n\t\t\t\t\tif (opts.selectMode !== 1) {\n\t\t\t\t\t\ttree.$container.attr(\"aria-multiselectable\", true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.treeLoad(ctx);\n\t\t\t},\n\t\t\t/** Parse Fancytree from source, as configured in the options.\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {object} [source] optional new source (use last data otherwise)\n\t\t\t */\n\t\t\ttreeLoad: function (ctx, source) {\n\t\t\t\tvar metaData,\n\t\t\t\t\ttype,\n\t\t\t\t\t$ul,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\t$container = ctx.widget.element,\n\t\t\t\t\tdfd,\n\t\t\t\t\t// calling context for root node\n\t\t\t\t\trootCtx = $.extend({}, ctx, { node: this.rootNode });\n\n\t\t\t\tif (tree.rootNode.children) {\n\t\t\t\t\tthis.treeClear(ctx);\n\t\t\t\t}\n\t\t\t\tsource = source || this.options.source;\n\n\t\t\t\tif (!source) {\n\t\t\t\t\ttype = $container.data(\"type\") || \"html\";\n\t\t\t\t\tswitch (type) {\n\t\t\t\t\t\tcase \"html\":\n\t\t\t\t\t\t\t// There should be an embedded `<ul>` with initial nodes,\n\t\t\t\t\t\t\t// but another `<ul class='fancytree-container'>` is appended\n\t\t\t\t\t\t\t// to the tree's <div> on startup anyway.\n\t\t\t\t\t\t\t$ul = $container\n\t\t\t\t\t\t\t\t.find(\">ul\")\n\t\t\t\t\t\t\t\t.not(\".fancytree-container\")\n\t\t\t\t\t\t\t\t.first();\n\n\t\t\t\t\t\t\tif ($ul.length) {\n\t\t\t\t\t\t\t\t$ul.addClass(\n\t\t\t\t\t\t\t\t\t\"ui-fancytree-source fancytree-helper-hidden\"\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tsource = $.ui.fancytree.parseHtml($ul);\n\t\t\t\t\t\t\t\t// allow to init tree.data.foo from <ul data-foo=''>\n\t\t\t\t\t\t\t\tthis.data = $.extend(\n\t\t\t\t\t\t\t\t\tthis.data,\n\t\t\t\t\t\t\t\t\t_getElementDataAsDict($ul)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tFT.warn(\n\t\t\t\t\t\t\t\t\t\"No `source` option was passed and container does not contain `<ul>`: assuming `source: []`.\"\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tsource = [];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"json\":\n\t\t\t\t\t\t\tsource = $.parseJSON($container.text());\n\t\t\t\t\t\t\t// $container already contains the <ul>, but we remove the plain (json) text\n\t\t\t\t\t\t\t// $container.empty();\n\t\t\t\t\t\t\t$container\n\t\t\t\t\t\t\t\t.contents()\n\t\t\t\t\t\t\t\t.filter(function () {\n\t\t\t\t\t\t\t\t\treturn this.nodeType === 3;\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t.remove();\n\t\t\t\t\t\t\tif ($.isPlainObject(source)) {\n\t\t\t\t\t\t\t\t// We got {foo: 'abc', children: [...]}\n\t\t\t\t\t\t\t\t_assert(\n\t\t\t\t\t\t\t\t\t_isArray(source.children),\n\t\t\t\t\t\t\t\t\t\"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')\"\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tmetaData = source;\n\t\t\t\t\t\t\t\tsource = source.children;\n\t\t\t\t\t\t\t\tdelete metaData.children;\n\t\t\t\t\t\t\t\t// Copy some attributes to tree.data\n\t\t\t\t\t\t\t\t$.each(TREE_ATTRS, function (i, attr) {\n\t\t\t\t\t\t\t\t\tif (metaData[attr] !== undefined) {\n\t\t\t\t\t\t\t\t\t\ttree[attr] = metaData[attr];\n\t\t\t\t\t\t\t\t\t\tdelete metaData[attr];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t// Copy extra properties to tree.data.foo\n\t\t\t\t\t\t\t\t$.extend(tree.data, metaData);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$.error(\"Invalid data-type: \" + type);\n\t\t\t\t\t}\n\t\t\t\t} else if (typeof source === \"string\") {\n\t\t\t\t\t// TODO: source is an element ID\n\t\t\t\t\t$.error(\"Not implemented\");\n\t\t\t\t}\n\n\t\t\t\t// preInit is fired when the widget markup is created, but nodes\n\t\t\t\t// not yet loaded\n\t\t\t\ttree._triggerTreeEvent(\"preInit\", null);\n\n\t\t\t\t// Trigger fancytreeinit after nodes have been loaded\n\t\t\t\tdfd = this.nodeLoadChildren(rootCtx, source)\n\t\t\t\t\t.done(function () {\n\t\t\t\t\t\ttree._callHook(\n\t\t\t\t\t\t\t\"treeStructureChanged\",\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\"loadChildren\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\ttree.render();\n\t\t\t\t\t\tif (ctx.options.selectMode === 3) {\n\t\t\t\t\t\t\ttree.rootNode.fixSelection3FromEndNodes();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tree.activeNode && tree.options.activeVisible) {\n\t\t\t\t\t\t\ttree.activeNode.makeVisible();\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttree._triggerTreeEvent(\"init\", null, { status: true });\n\t\t\t\t\t})\n\t\t\t\t\t.fail(function () {\n\t\t\t\t\t\ttree.render();\n\t\t\t\t\t\ttree._triggerTreeEvent(\"init\", null, { status: false });\n\t\t\t\t\t});\n\t\t\t\treturn dfd;\n\t\t\t},\n\t\t\t/** Node was inserted into or removed from the tree.\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} add\n\t\t\t * @param {FancytreeNode} node\n\t\t\t */\n\t\t\ttreeRegisterNode: function (ctx, add, node) {\n\t\t\t\tctx.tree._callHook(\n\t\t\t\t\t\"treeStructureChanged\",\n\t\t\t\t\tctx,\n\t\t\t\t\tadd ? \"addNode\" : \"removeNode\"\n\t\t\t\t);\n\t\t\t},\n\t\t\t/** Widget got focus.\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} [flag=true]\n\t\t\t */\n\t\t\ttreeSetFocus: function (ctx, flag, callOpts) {\n\t\t\t\tvar targetNode;\n\n\t\t\t\tflag = flag !== false;\n\n\t\t\t\t// this.debug(\"treeSetFocus(\" + flag + \"), callOpts: \", callOpts, this.hasFocus());\n\t\t\t\t// this.debug(\" focusNode: \" + this.focusNode);\n\t\t\t\t// this.debug(\" activeNode: \" + this.activeNode);\n\t\t\t\tif (flag !== this.hasFocus()) {\n\t\t\t\t\tthis._hasFocus = flag;\n\t\t\t\t\tif (!flag && this.focusNode) {\n\t\t\t\t\t\t// Node also looses focus if widget blurs\n\t\t\t\t\t\tthis.focusNode.setFocus(false);\n\t\t\t\t\t} else if (flag && (!callOpts || !callOpts.calledByNode)) {\n\t\t\t\t\t\t$(this.$container).focus();\n\t\t\t\t\t}\n\t\t\t\t\tthis.$container.toggleClass(\"fancytree-treefocus\", flag);\n\t\t\t\t\tthis._triggerTreeEvent(flag ? \"focusTree\" : \"blurTree\");\n\t\t\t\t\tif (flag && !this.activeNode) {\n\t\t\t\t\t\t// #712: Use last mousedowned node ('click' event fires after focusin)\n\t\t\t\t\t\ttargetNode =\n\t\t\t\t\t\t\tthis._lastMousedownNode || this.getFirstChild();\n\t\t\t\t\t\tif (targetNode) {\n\t\t\t\t\t\t\ttargetNode.setFocus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Widget option was set using `$().fancytree(\"option\", \"KEY\", VALUE)`.\n\t\t\t *\n\t\t\t * Note: `key` may reference a nested option, e.g. 'dnd5.scroll'.\n\t\t\t * In this case `value`contains the complete, modified `dnd5` option hash.\n\t\t\t * We can check for changed values like\n\t\t\t * if( value.scroll !== tree.options.dnd5.scroll ) {...}\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {string} key option name\n\t\t\t * @param {any} value option value\n\t\t\t */\n\t\t\ttreeSetOption: function (ctx, key, value) {\n\t\t\t\tvar tree = ctx.tree,\n\t\t\t\t\tcallDefault = true,\n\t\t\t\t\tcallCreate = false,\n\t\t\t\t\tcallRender = false;\n\n\t\t\t\tswitch (key) {\n\t\t\t\t\tcase \"aria\":\n\t\t\t\t\tcase \"checkbox\":\n\t\t\t\t\tcase \"icon\":\n\t\t\t\t\tcase \"minExpandLevel\":\n\t\t\t\t\tcase \"tabindex\":\n\t\t\t\t\t\t// tree._callHook(\"treeCreate\", tree);\n\t\t\t\t\t\tcallCreate = true;\n\t\t\t\t\t\tcallRender = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"checkboxAutoHide\":\n\t\t\t\t\t\ttree.$container.toggleClass(\n\t\t\t\t\t\t\t\"fancytree-checkbox-auto-hide\",\n\t\t\t\t\t\t\t!!value\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"escapeTitles\":\n\t\t\t\t\tcase \"tooltip\":\n\t\t\t\t\t\tcallRender = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"rtl\":\n\t\t\t\t\t\tif (value === false) {\n\t\t\t\t\t\t\ttree.$container\n\t\t\t\t\t\t\t\t.removeAttr(\"DIR\")\n\t\t\t\t\t\t\t\t.removeClass(\"fancytree-rtl\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttree.$container\n\t\t\t\t\t\t\t\t.attr(\"DIR\", \"RTL\")\n\t\t\t\t\t\t\t\t.addClass(\"fancytree-rtl\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcallRender = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"source\":\n\t\t\t\t\t\tcallDefault = false;\n\t\t\t\t\t\ttree._callHook(\"treeLoad\", tree, value);\n\t\t\t\t\t\tcallRender = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ttree.debug(\n\t\t\t\t\t\"set option \" +\n\t\t\t\t\t\tkey +\n\t\t\t\t\t\t\"=\" +\n\t\t\t\t\t\tvalue +\n\t\t\t\t\t\t\" <\" +\n\t\t\t\t\t\ttypeof value +\n\t\t\t\t\t\t\">\"\n\t\t\t\t);\n\t\t\t\tif (callDefault) {\n\t\t\t\t\tif (this.widget._super) {\n\t\t\t\t\t\t// jQuery UI 1.9+\n\t\t\t\t\t\tthis.widget._super.call(this.widget, key, value);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// jQuery UI <= 1.8, we have to manually invoke the _setOption method from the base widget\n\t\t\t\t\t\t$.Widget.prototype._setOption.call(\n\t\t\t\t\t\t\tthis.widget,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (callCreate) {\n\t\t\t\t\ttree._callHook(\"treeCreate\", tree);\n\t\t\t\t}\n\t\t\t\tif (callRender) {\n\t\t\t\t\ttree.render(true, false); // force, not-deep\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** A Node was added, removed, moved, or it's visibility changed.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\ttreeStructureChanged: function (ctx, type) {},\n\t\t}\n\t);\n\n\t/*******************************************************************************\n\t * jQuery UI widget boilerplate\n\t */\n\n\t/**\n\t * The plugin (derrived from [jQuery.Widget](http://api.jqueryui.com/jQuery.widget/)).\n\t *\n\t * **Note:**\n\t * These methods implement the standard jQuery UI widget API.\n\t * It is recommended to use methods of the {Fancytree} instance instead\n\t *\n\t * @example\n\t * // DEPRECATED: Access jQuery UI widget methods and members:\n\t * var tree = $(\"#tree\").fancytree(\"getTree\", \"#myTree\");\n\t * var node = $.ui.fancytree.getTree(\"#tree\").getActiveNode();\n\t *\n\t * // RECOMMENDED: Use the Fancytree object API\n\t * var tree = $.ui.fancytree.getTree(\"#myTree\");\n\t * var node = tree.getActiveNode();\n\t *\n\t * // or you may already have stored the tree instance upon creation:\n\t * import {createTree, version} from 'jquery.fancytree'\n\t * const tree = createTree('#tree', { ... });\n\t * var node = tree.getActiveNode();\n\t *\n\t * @see {Fancytree_Static#getTree}\n\t * @deprecated Use methods of the {Fancytree} instance instead\n\t * @mixin Fancytree_Widget\n\t */\n\n\t$.widget(\n\t\t\"ui.fancytree\",\n\t\t/** @lends Fancytree_Widget# */\n\t\t{\n\t\t\t/**These options will be used as defaults\n\t\t\t * @type {FancytreeOptions}\n\t\t\t */\n\t\t\toptions: {\n\t\t\t\tactiveVisible: true,\n\t\t\t\tajax: {\n\t\t\t\t\ttype: \"GET\",\n\t\t\t\t\tcache: false, // false: Append random '_' argument to the request url to prevent caching.\n\t\t\t\t\t// timeout: 0, // >0: Make sure we get an ajax error if server is unreachable\n\t\t\t\t\tdataType: \"json\", // Expect json format and pass json object to callbacks.\n\t\t\t\t},\n\t\t\t\taria: true,\n\t\t\t\tautoActivate: true,\n\t\t\t\tautoCollapse: false,\n\t\t\t\tautoScroll: false,\n\t\t\t\tcheckbox: false,\n\t\t\t\tclickFolderMode: 4,\n\t\t\t\tcopyFunctionsToData: false,\n\t\t\t\tdebugLevel: null, // 0..4 (null: use global setting $.ui.fancytree.debugLevel)\n\t\t\t\tdisabled: false, // TODO: required anymore?\n\t\t\t\tenableAspx: 42, // TODO: this is truethy, but distinguishable from true: default will change to false in the future\n\t\t\t\tescapeTitles: false,\n\t\t\t\textensions: [],\n\t\t\t\tfocusOnSelect: false,\n\t\t\t\tgenerateIds: false,\n\t\t\t\ticon: true,\n\t\t\t\tidPrefix: \"ft_\",\n\t\t\t\tkeyboard: true,\n\t\t\t\tkeyPathSeparator: \"/\",\n\t\t\t\tminExpandLevel: 1,\n\t\t\t\tnodata: true, // (bool, string, or callback) display message, when no data available\n\t\t\t\tquicksearch: false,\n\t\t\t\trtl: false,\n\t\t\t\tscrollOfs: { top: 0, bottom: 0 },\n\t\t\t\tscrollParent: null,\n\t\t\t\tselectMode: 2,\n\t\t\t\tstrings: {\n\t\t\t\t\tloading: \"Loading...\", // &#8230; would be escaped when escapeTitles is true\n\t\t\t\t\tloadError: \"Load error!\",\n\t\t\t\t\tmoreData: \"More...\",\n\t\t\t\t\tnoData: \"No data.\",\n\t\t\t\t},\n\t\t\t\ttabindex: \"0\",\n\t\t\t\ttitlesTabbable: false,\n\t\t\t\ttoggleEffect: { effect: \"slideToggle\", duration: 200 }, //< \"toggle\" or \"slideToggle\" to use jQuery instead of jQueryUI for toggleEffect animation\n\t\t\t\ttooltip: false,\n\t\t\t\ttreeId: null,\n\t\t\t\t_classNames: {\n\t\t\t\t\tactive: \"fancytree-active\",\n\t\t\t\t\tanimating: \"fancytree-animating\",\n\t\t\t\t\tcombinedExpanderPrefix: \"fancytree-exp-\",\n\t\t\t\t\tcombinedIconPrefix: \"fancytree-ico-\",\n\t\t\t\t\terror: \"fancytree-error\",\n\t\t\t\t\texpanded: \"fancytree-expanded\",\n\t\t\t\t\tfocused: \"fancytree-focused\",\n\t\t\t\t\tfolder: \"fancytree-folder\",\n\t\t\t\t\thasChildren: \"fancytree-has-children\",\n\t\t\t\t\tlastsib: \"fancytree-lastsib\",\n\t\t\t\t\tlazy: \"fancytree-lazy\",\n\t\t\t\t\tloading: \"fancytree-loading\",\n\t\t\t\t\tnode: \"fancytree-node\",\n\t\t\t\t\tpartload: \"fancytree-partload\",\n\t\t\t\t\tpartsel: \"fancytree-partsel\",\n\t\t\t\t\tradio: \"fancytree-radio\",\n\t\t\t\t\tselected: \"fancytree-selected\",\n\t\t\t\t\tstatusNodePrefix: \"fancytree-statusnode-\",\n\t\t\t\t\tunselectable: \"fancytree-unselectable\",\n\t\t\t\t},\n\t\t\t\t// events\n\t\t\t\tlazyLoad: null,\n\t\t\t\tpostProcess: null,\n\t\t\t},\n\t\t\t_deprecationWarning: function (name) {\n\t\t\t\tvar tree = this.tree;\n\n\t\t\t\tif (tree && tree.options.debugLevel >= 3) {\n\t\t\t\t\ttree.warn(\n\t\t\t\t\t\t\"$().fancytree('\" +\n\t\t\t\t\t\t\tname +\n\t\t\t\t\t\t\t\"') is deprecated (see https://wwwendt.de/tech/fancytree/doc/jsdoc/Fancytree_Widget.html\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/* Set up the widget, Called on first $().fancytree() */\n\t\t\t_create: function () {\n\t\t\t\tthis.tree = new Fancytree(this);\n\n\t\t\t\tthis.$source =\n\t\t\t\t\tthis.source || this.element.data(\"type\") === \"json\"\n\t\t\t\t\t\t? this.element\n\t\t\t\t\t\t: this.element.find(\">ul\").first();\n\t\t\t\t// Subclass Fancytree instance with all enabled extensions\n\t\t\t\tvar extension,\n\t\t\t\t\textName,\n\t\t\t\t\ti,\n\t\t\t\t\topts = this.options,\n\t\t\t\t\textensions = opts.extensions,\n\t\t\t\t\tbase = this.tree;\n\n\t\t\t\tfor (i = 0; i < extensions.length; i++) {\n\t\t\t\t\textName = extensions[i];\n\t\t\t\t\textension = $.ui.fancytree._extensions[extName];\n\t\t\t\t\tif (!extension) {\n\t\t\t\t\t\t$.error(\n\t\t\t\t\t\t\t\"Could not apply extension '\" +\n\t\t\t\t\t\t\t\textName +\n\t\t\t\t\t\t\t\t\"' (it is not registered, did you forget to include it?)\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t// Add extension options as tree.options.EXTENSION\n\t\t\t\t\t// \t_assert(!this.tree.options[extName], \"Extension name must not exist as option name: \" + extName);\n\n\t\t\t\t\t// console.info(\"extend \" + extName, extension.options, this.tree.options[extName])\n\t\t\t\t\t// issue #876: we want to replace custom array-options, not merge them\n\t\t\t\t\tthis.tree.options[extName] = _simpleDeepMerge(\n\t\t\t\t\t\t{},\n\t\t\t\t\t\textension.options,\n\t\t\t\t\t\tthis.tree.options[extName]\n\t\t\t\t\t);\n\t\t\t\t\t// this.tree.options[extName] = $.extend(true, {}, extension.options, this.tree.options[extName]);\n\n\t\t\t\t\t// console.info(\"extend \" + extName + \" =>\", this.tree.options[extName])\n\t\t\t\t\t// console.info(\"extend \" + extName + \" org default =>\", extension.options)\n\n\t\t\t\t\t// Add a namespace tree.ext.EXTENSION, to hold instance data\n\t\t\t\t\t_assert(\n\t\t\t\t\t\tthis.tree.ext[extName] === undefined,\n\t\t\t\t\t\t\"Extension name must not exist as Fancytree.ext attribute: '\" +\n\t\t\t\t\t\t\textName +\n\t\t\t\t\t\t\t\"'\"\n\t\t\t\t\t);\n\t\t\t\t\t// this.tree[extName] = extension;\n\t\t\t\t\tthis.tree.ext[extName] = {};\n\t\t\t\t\t// Subclass Fancytree methods using proxies.\n\t\t\t\t\t_subclassObject(this.tree, base, extension, extName);\n\t\t\t\t\t// current extension becomes base for the next extension\n\t\t\t\t\tbase = extension;\n\t\t\t\t}\n\t\t\t\t//\n\t\t\t\tif (opts.icons !== undefined) {\n\t\t\t\t\t// 2015-11-16\n\t\t\t\t\tif (opts.icon === true) {\n\t\t\t\t\t\tthis.tree.warn(\n\t\t\t\t\t\t\t\"'icons' tree option is deprecated since v2.14.0: use 'icon' instead\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\topts.icon = opts.icons;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$.error(\n\t\t\t\t\t\t\t\"'icons' tree option is deprecated since v2.14.0: use 'icon' only instead\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (opts.iconClass !== undefined) {\n\t\t\t\t\t// 2015-11-16\n\t\t\t\t\tif (opts.icon) {\n\t\t\t\t\t\t$.error(\n\t\t\t\t\t\t\t\"'iconClass' tree option is deprecated since v2.14.0: use 'icon' only instead\"\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.tree.warn(\n\t\t\t\t\t\t\t\"'iconClass' tree option is deprecated since v2.14.0: use 'icon' instead\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\topts.icon = opts.iconClass;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (opts.tabbable !== undefined) {\n\t\t\t\t\t// 2016-04-04\n\t\t\t\t\topts.tabindex = opts.tabbable ? \"0\" : \"-1\";\n\t\t\t\t\tthis.tree.warn(\n\t\t\t\t\t\t\"'tabbable' tree option is deprecated since v2.17.0: use 'tabindex='\" +\n\t\t\t\t\t\t\topts.tabindex +\n\t\t\t\t\t\t\t\"' instead\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t//\n\t\t\t\tthis.tree._callHook(\"treeCreate\", this.tree);\n\t\t\t\t// Note: 'fancytreecreate' event is fired by widget base class\n\t\t\t\t// this.tree._triggerTreeEvent(\"create\");\n\t\t\t},\n\n\t\t\t/* Called on every $().fancytree() */\n\t\t\t_init: function () {\n\t\t\t\tthis.tree._callHook(\"treeInit\", this.tree);\n\t\t\t\t// TODO: currently we call bind after treeInit, because treeInit\n\t\t\t\t// might change tree.$container.\n\t\t\t\t// It would be better, to move event binding into hooks altogether\n\t\t\t\tthis._bind();\n\t\t\t},\n\n\t\t\t/* Use the _setOption method to respond to changes to options. */\n\t\t\t_setOption: function (key, value) {\n\t\t\t\treturn this.tree._callHook(\n\t\t\t\t\t\"treeSetOption\",\n\t\t\t\t\tthis.tree,\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue\n\t\t\t\t);\n\t\t\t},\n\n\t\t\t/** Use the destroy method to clean up any modifications your widget has made to the DOM */\n\t\t\t_destroy: function () {\n\t\t\t\tthis._unbind();\n\t\t\t\tthis.tree._callHook(\"treeDestroy\", this.tree);\n\t\t\t\t// In jQuery UI 1.8, you must invoke the destroy method from the base widget\n\t\t\t\t// $.Widget.prototype.destroy.call(this);\n\t\t\t\t// TODO: delete tree and nodes to make garbage collect easier?\n\t\t\t\t// TODO: In jQuery UI 1.9 and above, you would define _destroy instead of destroy and not call the base method\n\t\t\t},\n\n\t\t\t// -------------------------------------------------------------------------\n\n\t\t\t/* Remove all event handlers for our namespace */\n\t\t\t_unbind: function () {\n\t\t\t\tvar ns = this.tree._ns;\n\t\t\t\tthis.element.off(ns);\n\t\t\t\tthis.tree.$container.off(ns);\n\t\t\t\t$(document).off(ns);\n\t\t\t},\n\t\t\t/* Add mouse and kyboard handlers to the container */\n\t\t\t_bind: function () {\n\t\t\t\tvar self = this,\n\t\t\t\t\topts = this.options,\n\t\t\t\t\ttree = this.tree,\n\t\t\t\t\tns = tree._ns;\n\t\t\t\t// selstartEvent = ( $.support.selectstart ? \"selectstart\" : \"mousedown\" )\n\n\t\t\t\t// Remove all previuous handlers for this tree\n\t\t\t\tthis._unbind();\n\n\t\t\t\t//alert(\"keydown\" + ns + \"foc=\" + tree.hasFocus() + tree.$container);\n\t\t\t\t// tree.debug(\"bind events; container: \", tree.$container);\n\t\t\t\ttree.$container\n\t\t\t\t\t.on(\"focusin\" + ns + \" focusout\" + ns, function (event) {\n\t\t\t\t\t\tvar node = FT.getNode(event),\n\t\t\t\t\t\t\tflag = event.type === \"focusin\";\n\n\t\t\t\t\t\tif (!flag && node && $(event.target).is(\"a\")) {\n\t\t\t\t\t\t\t// #764\n\t\t\t\t\t\t\tnode.debug(\n\t\t\t\t\t\t\t\t\"Ignored focusout on embedded <a> element.\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// tree.treeOnFocusInOut.call(tree, event);\n\t\t\t\t\t\t// tree.debug(\"Tree container got event \" + event.type, node, event, FT.getEventTarget(event));\n\t\t\t\t\t\tif (flag) {\n\t\t\t\t\t\t\tif (tree._getExpiringValue(\"focusin\")) {\n\t\t\t\t\t\t\t\t// #789: IE 11 may send duplicate focusin events\n\t\t\t\t\t\t\t\ttree.debug(\"Ignored double focusin.\");\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttree._setExpiringValue(\"focusin\", true, 50);\n\n\t\t\t\t\t\t\tif (!node) {\n\t\t\t\t\t\t\t\t// #789: IE 11 may send focusin before mousdown(?)\n\t\t\t\t\t\t\t\tnode = tree._getExpiringValue(\"mouseDownNode\");\n\t\t\t\t\t\t\t\tif (node) {\n\t\t\t\t\t\t\t\t\ttree.debug(\n\t\t\t\t\t\t\t\t\t\t\"Reconstruct mouse target for focusin from recent event.\"\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (node) {\n\t\t\t\t\t\t\t// For example clicking into an <input> that is part of a node\n\t\t\t\t\t\t\ttree._callHook(\n\t\t\t\t\t\t\t\t\"nodeSetFocus\",\n\t\t\t\t\t\t\t\ttree._makeHookContext(node, event),\n\t\t\t\t\t\t\t\tflag\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\ttree.tbody &&\n\t\t\t\t\t\t\t\t$(event.target).parents(\n\t\t\t\t\t\t\t\t\t\"table.fancytree-container > thead\"\n\t\t\t\t\t\t\t\t).length\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t// #767: ignore events in the table's header\n\t\t\t\t\t\t\t\ttree.debug(\n\t\t\t\t\t\t\t\t\t\"Ignore focus event outside table body.\",\n\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttree._callHook(\"treeSetFocus\", tree, flag);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.on(\n\t\t\t\t\t\t\"selectstart\" + ns,\n\t\t\t\t\t\t\"span.fancytree-title\",\n\t\t\t\t\t\tfunction (event) {\n\t\t\t\t\t\t\t// prevent mouse-drags to select text ranges\n\t\t\t\t\t\t\t// tree.debug(\"<span title> got event \" + event.type);\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t\t.on(\"keydown\" + ns, function (event) {\n\t\t\t\t\t\t// TODO: also bind keyup and keypress\n\t\t\t\t\t\t// tree.debug(\"got event \" + event.type + \", hasFocus:\" + tree.hasFocus());\n\t\t\t\t\t\t// if(opts.disabled || opts.keyboard === false || !tree.hasFocus() ){\n\t\t\t\t\t\tif (opts.disabled || opts.keyboard === false) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar res,\n\t\t\t\t\t\t\tnode = tree.focusNode, // node may be null\n\t\t\t\t\t\t\tctx = tree._makeHookContext(node || tree, event),\n\t\t\t\t\t\t\tprevPhase = tree.phase;\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\ttree.phase = \"userEvent\";\n\t\t\t\t\t\t\t// If a 'fancytreekeydown' handler returns false, skip the default\n\t\t\t\t\t\t\t// handling (implemented by tree.nodeKeydown()).\n\t\t\t\t\t\t\tif (node) {\n\t\t\t\t\t\t\t\tres = tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\t\"keydown\",\n\t\t\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tres = tree._triggerTreeEvent(\"keydown\", event);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (res === \"preventNav\") {\n\t\t\t\t\t\t\t\tres = true; // prevent keyboard navigation, but don't prevent default handling of embedded input controls\n\t\t\t\t\t\t\t} else if (res !== false) {\n\t\t\t\t\t\t\t\tres = tree._callHook(\"nodeKeydown\", ctx);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn res;\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\ttree.phase = prevPhase;\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.on(\"mousedown\" + ns, function (event) {\n\t\t\t\t\t\tvar et = FT.getEventTarget(event);\n\t\t\t\t\t\t// self.tree.debug(\"event(\" + event.type + \"): node: \", et.node);\n\t\t\t\t\t\t// #712: Store the clicked node, so we can use it when we get a focusin event\n\t\t\t\t\t\t// ('click' event fires after focusin)\n\t\t\t\t\t\t// tree.debug(\"event(\" + event.type + \"): node: \", et.node);\n\t\t\t\t\t\ttree._lastMousedownNode = et ? et.node : null;\n\t\t\t\t\t\t// #789: Store the node also for a short period, so we can use it\n\t\t\t\t\t\t// in a *resulting* focusin event\n\t\t\t\t\t\ttree._setExpiringValue(\n\t\t\t\t\t\t\t\"mouseDownNode\",\n\t\t\t\t\t\t\ttree._lastMousedownNode\n\t\t\t\t\t\t);\n\t\t\t\t\t})\n\t\t\t\t\t.on(\"click\" + ns + \" dblclick\" + ns, function (event) {\n\t\t\t\t\t\tif (opts.disabled) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar ctx,\n\t\t\t\t\t\t\tet = FT.getEventTarget(event),\n\t\t\t\t\t\t\tnode = et.node,\n\t\t\t\t\t\t\ttree = self.tree,\n\t\t\t\t\t\t\tprevPhase = tree.phase;\n\n\t\t\t\t\t\t// self.tree.debug(\"event(\" + event.type + \"): node: \", node);\n\t\t\t\t\t\tif (!node) {\n\t\t\t\t\t\t\treturn true; // Allow bubbling of other events\n\t\t\t\t\t\t}\n\t\t\t\t\t\tctx = tree._makeHookContext(node, event);\n\t\t\t\t\t\t// self.tree.debug(\"event(\" + event.type + \"): node: \", node);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\ttree.phase = \"userEvent\";\n\t\t\t\t\t\t\tswitch (event.type) {\n\t\t\t\t\t\t\t\tcase \"click\":\n\t\t\t\t\t\t\t\t\tctx.targetType = et.type;\n\t\t\t\t\t\t\t\t\tif (node.isPagingNode()) {\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\ttree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\t\t\t\t\"clickPaging\",\n\t\t\t\t\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t\t\t\t) === true\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\t\t\"click\",\n\t\t\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t\t) === false\n\t\t\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t\t\t: tree._callHook(\"nodeClick\", ctx);\n\t\t\t\t\t\t\t\tcase \"dblclick\":\n\t\t\t\t\t\t\t\t\tctx.targetType = et.type;\n\t\t\t\t\t\t\t\t\treturn tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\t\t\"dblclick\",\n\t\t\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t\t) === false\n\t\t\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t\t\t: tree._callHook(\"nodeDblclick\", ctx);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\ttree.phase = prevPhase;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t},\n\t\t\t/** Return the active node or null.\n\t\t\t * @returns {FancytreeNode}\n\t\t\t * @deprecated Use methods of the Fancytree instance instead (<a href=\"Fancytree_Widget.html\">example above</a>).\n\t\t\t */\n\t\t\tgetActiveNode: function () {\n\t\t\t\tthis._deprecationWarning(\"getActiveNode\");\n\t\t\t\treturn this.tree.activeNode;\n\t\t\t},\n\t\t\t/** Return the matching node or null.\n\t\t\t * @param {string} key\n\t\t\t * @returns {FancytreeNode}\n\t\t\t * @deprecated Use methods of the Fancytree instance instead (<a href=\"Fancytree_Widget.html\">example above</a>).\n\t\t\t */\n\t\t\tgetNodeByKey: function (key) {\n\t\t\t\tthis._deprecationWarning(\"getNodeByKey\");\n\t\t\t\treturn this.tree.getNodeByKey(key);\n\t\t\t},\n\t\t\t/** Return the invisible system root node.\n\t\t\t * @returns {FancytreeNode}\n\t\t\t * @deprecated Use methods of the Fancytree instance instead (<a href=\"Fancytree_Widget.html\">example above</a>).\n\t\t\t */\n\t\t\tgetRootNode: function () {\n\t\t\t\tthis._deprecationWarning(\"getRootNode\");\n\t\t\t\treturn this.tree.rootNode;\n\t\t\t},\n\t\t\t/** Return the current tree instance.\n\t\t\t * @returns {Fancytree}\n\t\t\t * @deprecated Use `$.ui.fancytree.getTree()` instead (<a href=\"Fancytree_Widget.html\">example above</a>).\n\t\t\t */\n\t\t\tgetTree: function () {\n\t\t\t\tthis._deprecationWarning(\"getTree\");\n\t\t\t\treturn this.tree;\n\t\t\t},\n\t\t}\n\t);\n\n\t// $.ui.fancytree was created by the widget factory. Create a local shortcut:\n\tFT = $.ui.fancytree;\n\n\t/**\n\t * Static members in the `$.ui.fancytree` namespace.\n\t * This properties and methods can be accessed without instantiating a concrete\n\t * Fancytree instance.\n\t *\n\t * @example\n\t * // Access static members:\n\t * var node = $.ui.fancytree.getNode(element);\n\t * alert($.ui.fancytree.version);\n\t *\n\t * @mixin Fancytree_Static\n\t */\n\t$.extend(\n\t\t$.ui.fancytree,\n\t\t/** @lends Fancytree_Static# */\n\t\t{\n\t\t\t/** Version number `\"MAJOR.MINOR.PATCH\"`\n\t\t\t * @type {string} */\n\t\t\tversion: \"2.38.1-0\", // Set to semver by 'grunt release'\n\t\t\t/** @type {string}\n\t\t\t * @description `\"production\" for release builds` */\n\t\t\tbuildType: \"production\", // Set to 'production' by 'grunt build'\n\t\t\t/** @type {int}\n\t\t\t * @description 0: silent .. 5: verbose (default: 3 for release builds). */\n\t\t\tdebugLevel: 3, // Set to 3 by 'grunt build'\n\t\t\t// Used by $.ui.fancytree.debug() and as default for tree.options.debugLevel\n\n\t\t\t_nextId: 1,\n\t\t\t_nextNodeKey: 1,\n\t\t\t_extensions: {},\n\t\t\t// focusTree: null,\n\n\t\t\t/** Expose class object as `$.ui.fancytree._FancytreeClass`.\n\t\t\t * Useful to extend `$.ui.fancytree._FancytreeClass.prototype`.\n\t\t\t * @type {Fancytree}\n\t\t\t */\n\t\t\t_FancytreeClass: Fancytree,\n\t\t\t/** Expose class object as $.ui.fancytree._FancytreeNodeClass\n\t\t\t * Useful to extend `$.ui.fancytree._FancytreeNodeClass.prototype`.\n\t\t\t * @type {FancytreeNode}\n\t\t\t */\n\t\t\t_FancytreeNodeClass: FancytreeNode,\n\t\t\t/* Feature checks to provide backwards compatibility */\n\t\t\tjquerySupports: {\n\t\t\t\t// http://jqueryui.com/upgrade-guide/1.9/#deprecated-offset-option-merged-into-my-and-at\n\t\t\t\tpositionMyOfs: isVersionAtLeast($.ui.version, 1, 9),\n\t\t\t},\n\t\t\t/** Throw an error if condition fails (debug method).\n\t\t\t * @param {boolean} cond\n\t\t\t * @param {string} msg\n\t\t\t */\n\t\t\tassert: function (cond, msg) {\n\t\t\t\treturn _assert(cond, msg);\n\t\t\t},\n\t\t\t/** Create a new Fancytree instance on a target element.\n\t\t\t *\n\t\t\t * @param {Element | jQueryObject | string} el Target DOM element or selector\n\t\t\t * @param {FancytreeOptions} [opts] Fancytree options\n\t\t\t * @returns {Fancytree} new tree instance\n\t\t\t * @example\n\t\t\t * var tree = $.ui.fancytree.createTree(\"#tree\", {\n\t\t\t * source: {url: \"my/webservice\"}\n\t\t\t * }); // Create tree for this matching element\n\t\t\t *\n\t\t\t * @since 2.25\n\t\t\t */\n\t\t\tcreateTree: function (el, opts) {\n\t\t\t\tvar $tree = $(el).fancytree(opts);\n\t\t\t\treturn FT.getTree($tree);\n\t\t\t},\n\t\t\t/** Return a function that executes *fn* at most every *timeout* ms.\n\t\t\t * @param {integer} timeout\n\t\t\t * @param {function} fn\n\t\t\t * @param {boolean} [invokeAsap=false]\n\t\t\t * @param {any} [ctx]\n\t\t\t */\n\t\t\tdebounce: function (timeout, fn, invokeAsap, ctx) {\n\t\t\t\tvar timer;\n\t\t\t\tif (arguments.length === 3 && typeof invokeAsap !== \"boolean\") {\n\t\t\t\t\tctx = invokeAsap;\n\t\t\t\t\tinvokeAsap = false;\n\t\t\t\t}\n\t\t\t\treturn function () {\n\t\t\t\t\tvar args = arguments;\n\t\t\t\t\tctx = ctx || this;\n\t\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\t\tinvokeAsap && !timer && fn.apply(ctx, args);\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\ttimer = setTimeout(function () {\n\t\t\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\t\t\tinvokeAsap || fn.apply(ctx, args);\n\t\t\t\t\t\ttimer = null;\n\t\t\t\t\t}, timeout);\n\t\t\t\t};\n\t\t\t},\n\t\t\t/** Write message to console if debugLevel >= 4\n\t\t\t * @param {string} msg\n\t\t\t */\n\t\t\tdebug: function (msg) {\n\t\t\t\tif ($.ui.fancytree.debugLevel >= 4) {\n\t\t\t\t\tconsoleApply(\"log\", arguments);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Write error message to console if debugLevel >= 1.\n\t\t\t * @param {string} msg\n\t\t\t */\n\t\t\terror: function (msg) {\n\t\t\t\tif ($.ui.fancytree.debugLevel >= 1) {\n\t\t\t\t\tconsoleApply(\"error\", arguments);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Convert `<`, `>`, `&`, `\"`, `'`, and `/` to the equivalent entities.\n\t\t\t *\n\t\t\t * @param {string} s\n\t\t\t * @returns {string}\n\t\t\t */\n\t\t\tescapeHtml: function (s) {\n\t\t\t\treturn (\"\" + s).replace(REX_HTML, function (s) {\n\t\t\t\t\treturn ENTITY_MAP[s];\n\t\t\t\t});\n\t\t\t},\n\t\t\t/** Make jQuery.position() arguments backwards compatible, i.e. if\n\t\t\t * jQuery UI version <= 1.8, convert\n\t\t\t * { my: \"left+3 center\", at: \"left bottom\", of: $target }\n\t\t\t * to\n\t\t\t * { my: \"left center\", at: \"left bottom\", of: $target, offset: \"3 0\" }\n\t\t\t *\n\t\t\t * See http://jqueryui.com/upgrade-guide/1.9/#deprecated-offset-option-merged-into-my-and-at\n\t\t\t * and http://jsfiddle.net/mar10/6xtu9a4e/\n\t\t\t *\n\t\t\t * @param {object} opts\n\t\t\t * @returns {object} the (potentially modified) original opts hash object\n\t\t\t */\n\t\t\tfixPositionOptions: function (opts) {\n\t\t\t\tif (opts.offset || (\"\" + opts.my + opts.at).indexOf(\"%\") >= 0) {\n\t\t\t\t\t$.error(\n\t\t\t\t\t\t\"expected new position syntax (but '%' is not supported)\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (!$.ui.fancytree.jquerySupports.positionMyOfs) {\n\t\t\t\t\tvar // parse 'left+3 center' into ['left+3 center', 'left', '+3', 'center', undefined]\n\t\t\t\t\t\tmyParts = /(\\w+)([+-]?\\d+)?\\s+(\\w+)([+-]?\\d+)?/.exec(\n\t\t\t\t\t\t\topts.my\n\t\t\t\t\t\t),\n\t\t\t\t\t\tatParts = /(\\w+)([+-]?\\d+)?\\s+(\\w+)([+-]?\\d+)?/.exec(\n\t\t\t\t\t\t\topts.at\n\t\t\t\t\t\t),\n\t\t\t\t\t\t// convert to numbers\n\t\t\t\t\t\tdx =\n\t\t\t\t\t\t\t(myParts[2] ? +myParts[2] : 0) +\n\t\t\t\t\t\t\t(atParts[2] ? +atParts[2] : 0),\n\t\t\t\t\t\tdy =\n\t\t\t\t\t\t\t(myParts[4] ? +myParts[4] : 0) +\n\t\t\t\t\t\t\t(atParts[4] ? +atParts[4] : 0);\n\n\t\t\t\t\topts = $.extend({}, opts, {\n\t\t\t\t\t\t// make a copy and overwrite\n\t\t\t\t\t\tmy: myParts[1] + \" \" + myParts[3],\n\t\t\t\t\t\tat: atParts[1] + \" \" + atParts[3],\n\t\t\t\t\t});\n\t\t\t\t\tif (dx || dy) {\n\t\t\t\t\t\topts.offset = \"\" + dx + \" \" + dy;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn opts;\n\t\t\t},\n\t\t\t/** Return a {node: FancytreeNode, type: TYPE} object for a mouse event.\n\t\t\t *\n\t\t\t * @param {Event} event Mouse event, e.g. click, ...\n\t\t\t * @returns {object} Return a {node: FancytreeNode, type: TYPE} object\n\t\t\t * TYPE: 'title' | 'prefix' | 'expander' | 'checkbox' | 'icon' | undefined\n\t\t\t */\n\t\t\tgetEventTarget: function (event) {\n\t\t\t\tvar $target,\n\t\t\t\t\ttree,\n\t\t\t\t\ttcn = event && event.target ? event.target.className : \"\",\n\t\t\t\t\tres = { node: this.getNode(event.target), type: undefined };\n\t\t\t\t// We use a fast version of $(res.node).hasClass()\n\t\t\t\t// See http://jsperf.com/test-for-classname/2\n\t\t\t\tif (/\\bfancytree-title\\b/.test(tcn)) {\n\t\t\t\t\tres.type = \"title\";\n\t\t\t\t} else if (/\\bfancytree-expander\\b/.test(tcn)) {\n\t\t\t\t\tres.type =\n\t\t\t\t\t\tres.node.hasChildren() === false\n\t\t\t\t\t\t\t? \"prefix\"\n\t\t\t\t\t\t\t: \"expander\";\n\t\t\t\t\t// }else if( /\\bfancytree-checkbox\\b/.test(tcn) || /\\bfancytree-radio\\b/.test(tcn) ){\n\t\t\t\t} else if (/\\bfancytree-checkbox\\b/.test(tcn)) {\n\t\t\t\t\tres.type = \"checkbox\";\n\t\t\t\t} else if (/\\bfancytree(-custom)?-icon\\b/.test(tcn)) {\n\t\t\t\t\tres.type = \"icon\";\n\t\t\t\t} else if (/\\bfancytree-node\\b/.test(tcn)) {\n\t\t\t\t\t// Somewhere near the title\n\t\t\t\t\tres.type = \"title\";\n\t\t\t\t} else if (event && event.target) {\n\t\t\t\t\t$target = $(event.target);\n\t\t\t\t\tif ($target.is(\"ul[role=group]\")) {\n\t\t\t\t\t\t// #nnn: Clicking right to a node may hit the surrounding UL\n\t\t\t\t\t\ttree = res.node && res.node.tree;\n\t\t\t\t\t\t(tree || FT).debug(\"Ignoring click on outer UL.\");\n\t\t\t\t\t\tres.node = null;\n\t\t\t\t\t} else if ($target.closest(\".fancytree-title\").length) {\n\t\t\t\t\t\t// #228: clicking an embedded element inside a title\n\t\t\t\t\t\tres.type = \"title\";\n\t\t\t\t\t} else if ($target.closest(\".fancytree-checkbox\").length) {\n\t\t\t\t\t\t// E.g. <svg> inside checkbox span\n\t\t\t\t\t\tres.type = \"checkbox\";\n\t\t\t\t\t} else if ($target.closest(\".fancytree-expander\").length) {\n\t\t\t\t\t\tres.type = \"expander\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn res;\n\t\t\t},\n\t\t\t/** Return a string describing the affected node region for a mouse event.\n\t\t\t *\n\t\t\t * @param {Event} event Mouse event, e.g. click, mousemove, ...\n\t\t\t * @returns {string} 'title' | 'prefix' | 'expander' | 'checkbox' | 'icon' | undefined\n\t\t\t */\n\t\t\tgetEventTargetType: function (event) {\n\t\t\t\treturn this.getEventTarget(event).type;\n\t\t\t},\n\t\t\t/** Return a FancytreeNode instance from element, event, or jQuery object.\n\t\t\t *\n\t\t\t * @param {Element | jQueryObject | Event} el\n\t\t\t * @returns {FancytreeNode} matching node or null\n\t\t\t */\n\t\t\tgetNode: function (el) {\n\t\t\t\tif (el instanceof FancytreeNode) {\n\t\t\t\t\treturn el; // el already was a FancytreeNode\n\t\t\t\t} else if (el instanceof $) {\n\t\t\t\t\tel = el[0]; // el was a jQuery object: use the DOM element\n\t\t\t\t} else if (el.originalEvent !== undefined) {\n\t\t\t\t\tel = el.target; // el was an Event\n\t\t\t\t}\n\t\t\t\twhile (el) {\n\t\t\t\t\tif (el.ftnode) {\n\t\t\t\t\t\treturn el.ftnode;\n\t\t\t\t\t}\n\t\t\t\t\tel = el.parentNode;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t},\n\t\t\t/** Return a Fancytree instance, from element, index, event, or jQueryObject.\n\t\t\t *\n\t\t\t * @param {Element | jQueryObject | Event | integer | string} [el]\n\t\t\t * @returns {Fancytree} matching tree or null\n\t\t\t * @example\n\t\t\t * $.ui.fancytree.getTree(); // Get first Fancytree instance on page\n\t\t\t * $.ui.fancytree.getTree(1); // Get second Fancytree instance on page\n\t\t\t * $.ui.fancytree.getTree(event); // Get tree for this mouse- or keyboard event\n\t\t\t * $.ui.fancytree.getTree(\"foo\"); // Get tree for this `opts.treeId`\n\t\t\t * $.ui.fancytree.getTree(\"#tree\"); // Get tree for this matching element\n\t\t\t *\n\t\t\t * @since 2.13\n\t\t\t */\n\t\t\tgetTree: function (el) {\n\t\t\t\tvar widget,\n\t\t\t\t\torgEl = el;\n\n\t\t\t\tif (el instanceof Fancytree) {\n\t\t\t\t\treturn el; // el already was a Fancytree\n\t\t\t\t}\n\t\t\t\tif (el === undefined) {\n\t\t\t\t\tel = 0; // get first tree\n\t\t\t\t}\n\t\t\t\tif (typeof el === \"number\") {\n\t\t\t\t\tel = $(\".fancytree-container\").eq(el); // el was an integer: return nth instance\n\t\t\t\t} else if (typeof el === \"string\") {\n\t\t\t\t\t// `el` may be a treeId or a selector:\n\t\t\t\t\tel = $(\"#ft-id-\" + orgEl).eq(0);\n\t\t\t\t\tif (!el.length) {\n\t\t\t\t\t\tel = $(orgEl).eq(0); // el was a selector: use first match\n\t\t\t\t\t}\n\t\t\t\t} else if (\n\t\t\t\t\tel instanceof Element ||\n\t\t\t\t\tel instanceof HTMLDocument\n\t\t\t\t) {\n\t\t\t\t\tel = $(el);\n\t\t\t\t} else if (el instanceof $) {\n\t\t\t\t\tel = el.eq(0); // el was a jQuery object: use the first\n\t\t\t\t} else if (el.originalEvent !== undefined) {\n\t\t\t\t\tel = $(el.target); // el was an Event\n\t\t\t\t}\n\t\t\t\t// el is a jQuery object wit one element here\n\t\t\t\tel = el.closest(\":ui-fancytree\");\n\t\t\t\twidget = el.data(\"ui-fancytree\") || el.data(\"fancytree\"); // the latter is required by jQuery <= 1.8\n\t\t\t\treturn widget ? widget.tree : null;\n\t\t\t},\n\t\t\t/** Return an option value that has a default, but may be overridden by a\n\t\t\t * callback or a node instance attribute.\n\t\t\t *\n\t\t\t * Evaluation sequence:\n\t\t\t *\n\t\t\t * If `tree.options.<optionName>` is a callback that returns something, use that.\n\t\t\t * Else if `node.<optionName>` is defined, use that.\n\t\t\t * Else if `tree.options.<optionName>` is a value, use that.\n\t\t\t * Else use `defaultValue`.\n\t\t\t *\n\t\t\t * @param {string} optionName name of the option property (on node and tree)\n\t\t\t * @param {FancytreeNode} node passed to the callback\n\t\t\t * @param {object} nodeObject where to look for the local option property, e.g. `node` or `node.data`\n\t\t\t * @param {object} treeOption where to look for the tree option, e.g. `tree.options` or `tree.options.dnd5`\n\t\t\t * @param {any} [defaultValue]\n\t\t\t * @returns {any}\n\t\t\t *\n\t\t\t * @example\n\t\t\t * // Check for node.foo, tree,options.foo(), and tree.options.foo:\n\t\t\t * $.ui.fancytree.evalOption(\"foo\", node, node, tree.options);\n\t\t\t * // Check for node.data.bar, tree,options.qux.bar(), and tree.options.qux.bar:\n\t\t\t * $.ui.fancytree.evalOption(\"bar\", node, node.data, tree.options.qux);\n\t\t\t *\n\t\t\t * @since 2.22\n\t\t\t */\n\t\t\tevalOption: function (\n\t\t\t\toptionName,\n\t\t\t\tnode,\n\t\t\t\tnodeObject,\n\t\t\t\ttreeOptions,\n\t\t\t\tdefaultValue\n\t\t\t) {\n\t\t\t\tvar ctx,\n\t\t\t\t\tres,\n\t\t\t\t\ttree = node.tree,\n\t\t\t\t\ttreeOpt = treeOptions[optionName],\n\t\t\t\t\tnodeOpt = nodeObject[optionName];\n\n\t\t\t\tif (_isFunction(treeOpt)) {\n\t\t\t\t\tctx = {\n\t\t\t\t\t\tnode: node,\n\t\t\t\t\t\ttree: tree,\n\t\t\t\t\t\twidget: tree.widget,\n\t\t\t\t\t\toptions: tree.widget.options,\n\t\t\t\t\t\ttypeInfo: tree.types[node.type] || {},\n\t\t\t\t\t};\n\t\t\t\t\tres = treeOpt.call(tree, { type: optionName }, ctx);\n\t\t\t\t\tif (res == null) {\n\t\t\t\t\t\tres = nodeOpt;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tres = nodeOpt == null ? treeOpt : nodeOpt;\n\t\t\t\t}\n\t\t\t\tif (res == null) {\n\t\t\t\t\tres = defaultValue; // no option set at all: return default\n\t\t\t\t}\n\t\t\t\treturn res;\n\t\t\t},\n\t\t\t/** Set expander, checkbox, or node icon, supporting string and object format.\n\t\t\t *\n\t\t\t * @param {Element | jQueryObject} span\n\t\t\t * @param {string} baseClass\n\t\t\t * @param {string | object} icon\n\t\t\t * @since 2.27\n\t\t\t */\n\t\t\tsetSpanIcon: function (span, baseClass, icon) {\n\t\t\t\tvar $span = $(span);\n\n\t\t\t\tif (typeof icon === \"string\") {\n\t\t\t\t\t$span.attr(\"class\", baseClass + \" \" + icon);\n\t\t\t\t} else {\n\t\t\t\t\t// support object syntax: { text: ligature, addClasse: classname }\n\t\t\t\t\tif (icon.text) {\n\t\t\t\t\t\t$span.text(\"\" + icon.text);\n\t\t\t\t\t} else if (icon.html) {\n\t\t\t\t\t\tspan.innerHTML = icon.html;\n\t\t\t\t\t}\n\t\t\t\t\t$span.attr(\n\t\t\t\t\t\t\"class\",\n\t\t\t\t\t\tbaseClass + \" \" + (icon.addClass || \"\")\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Convert a keydown or mouse event to a canonical string like 'ctrl+a',\n\t\t\t * 'ctrl+shift+f2', 'shift+leftdblclick'.\n\t\t\t *\n\t\t\t * This is especially handy for switch-statements in event handlers.\n\t\t\t *\n\t\t\t * @param {event}\n\t\t\t * @returns {string}\n\t\t\t *\n\t\t\t * @example\n\n\t\t\tswitch( $.ui.fancytree.eventToString(event) ) {\n\t\t\t\tcase \"-\":\n\t\t\t\t\ttree.nodeSetExpanded(ctx, false);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"shift+return\":\n\t\t\t\t\ttree.nodeSetActive(ctx, true);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"down\":\n\t\t\t\t\tres = node.navigate(event.which, activate);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\thandled = false;\n\t\t\t}\n\t\t\tif( handled ){\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t\t*/\n\t\t\teventToString: function (event) {\n\t\t\t\t// Poor-man's hotkeys. See here for a complete implementation:\n\t\t\t\t// https://github.com/jeresig/jquery.hotkeys\n\t\t\t\tvar which = event.which,\n\t\t\t\t\tet = event.type,\n\t\t\t\t\ts = [];\n\n\t\t\t\tif (event.altKey) {\n\t\t\t\t\ts.push(\"alt\");\n\t\t\t\t}\n\t\t\t\tif (event.ctrlKey) {\n\t\t\t\t\ts.push(\"ctrl\");\n\t\t\t\t}\n\t\t\t\tif (event.metaKey) {\n\t\t\t\t\ts.push(\"meta\");\n\t\t\t\t}\n\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\ts.push(\"shift\");\n\t\t\t\t}\n\n\t\t\t\tif (et === \"click\" || et === \"dblclick\") {\n\t\t\t\t\ts.push(MOUSE_BUTTONS[event.button] + et);\n\t\t\t\t} else if (et === \"wheel\") {\n\t\t\t\t\ts.push(et);\n\t\t\t\t} else if (!IGNORE_KEYCODES[which]) {\n\t\t\t\t\ts.push(\n\t\t\t\t\t\tSPECIAL_KEYCODES[which] ||\n\t\t\t\t\t\t\tString.fromCharCode(which).toLowerCase()\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn s.join(\"+\");\n\t\t\t},\n\t\t\t/** Write message to console if debugLevel >= 3\n\t\t\t * @param {string} msg\n\t\t\t */\n\t\t\tinfo: function (msg) {\n\t\t\t\tif ($.ui.fancytree.debugLevel >= 3) {\n\t\t\t\t\tconsoleApply(\"info\", arguments);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/* @deprecated: use eventToString(event) instead.\n\t\t\t */\n\t\t\tkeyEventToString: function (event) {\n\t\t\t\tthis.warn(\n\t\t\t\t\t\"keyEventToString() is deprecated: use eventToString()\"\n\t\t\t\t);\n\t\t\t\treturn this.eventToString(event);\n\t\t\t},\n\t\t\t/** Return a wrapped handler method, that provides `this._super`.\n\t\t\t *\n\t\t\t * @example\n\t\t\t\t// Implement `opts.createNode` event to add the 'draggable' attribute\n\t\t\t\t$.ui.fancytree.overrideMethod(ctx.options, \"createNode\", function(event, data) {\n\t\t\t\t\t// Default processing if any\n\t\t\t\t\tthis._super.apply(this, arguments);\n\t\t\t\t\t// Add 'draggable' attribute\n\t\t\t\t\tdata.node.span.draggable = true;\n\t\t\t\t});\n\t\t\t *\n\t\t\t * @param {object} instance\n\t\t\t * @param {string} methodName\n\t\t\t * @param {function} handler\n\t\t\t * @param {object} [context] optional context\n\t\t\t */\n\t\t\toverrideMethod: function (instance, methodName, handler, context) {\n\t\t\t\tvar prevSuper,\n\t\t\t\t\t_super = instance[methodName] || $.noop;\n\n\t\t\t\tinstance[methodName] = function () {\n\t\t\t\t\tvar self = context || this;\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tprevSuper = self._super;\n\t\t\t\t\t\tself._super = _super;\n\t\t\t\t\t\treturn handler.apply(self, arguments);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tself._super = prevSuper;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\t\t\t/**\n\t\t\t * Parse tree data from HTML <ul> markup\n\t\t\t *\n\t\t\t * @param {jQueryObject} $ul\n\t\t\t * @returns {NodeData[]}\n\t\t\t */\n\t\t\tparseHtml: function ($ul) {\n\t\t\t\tvar classes,\n\t\t\t\t\tclassName,\n\t\t\t\t\textraClasses,\n\t\t\t\t\ti,\n\t\t\t\t\tiPos,\n\t\t\t\t\tl,\n\t\t\t\t\ttmp,\n\t\t\t\t\ttmp2,\n\t\t\t\t\t$children = $ul.find(\">li\"),\n\t\t\t\t\tchildren = [];\n\n\t\t\t\t$children.each(function () {\n\t\t\t\t\tvar allData,\n\t\t\t\t\t\tlowerCaseAttr,\n\t\t\t\t\t\t$li = $(this),\n\t\t\t\t\t\t$liSpan = $li.find(\">span\", this).first(),\n\t\t\t\t\t\t$liA = $liSpan.length ? null : $li.find(\">a\").first(),\n\t\t\t\t\t\td = { tooltip: null, data: {} };\n\n\t\t\t\t\tif ($liSpan.length) {\n\t\t\t\t\t\td.title = $liSpan.html();\n\t\t\t\t\t} else if ($liA && $liA.length) {\n\t\t\t\t\t\t// If a <li><a> tag is specified, use it literally and extract href/target.\n\t\t\t\t\t\td.title = $liA.html();\n\t\t\t\t\t\td.data.href = $liA.attr(\"href\");\n\t\t\t\t\t\td.data.target = $liA.attr(\"target\");\n\t\t\t\t\t\td.tooltip = $liA.attr(\"title\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If only a <li> tag is specified, use the trimmed string up to\n\t\t\t\t\t\t// the next child <ul> tag.\n\t\t\t\t\t\td.title = $li.html();\n\t\t\t\t\t\tiPos = d.title.search(/<ul/i);\n\t\t\t\t\t\tif (iPos >= 0) {\n\t\t\t\t\t\t\td.title = d.title.substring(0, iPos);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\td.title = _trim(d.title);\n\n\t\t\t\t\t// Make sure all fields exist\n\t\t\t\t\tfor (i = 0, l = CLASS_ATTRS.length; i < l; i++) {\n\t\t\t\t\t\td[CLASS_ATTRS[i]] = undefined;\n\t\t\t\t\t}\n\t\t\t\t\t// Initialize to `true`, if class is set and collect extraClasses\n\t\t\t\t\tclasses = this.className.split(\" \");\n\t\t\t\t\textraClasses = [];\n\t\t\t\t\tfor (i = 0, l = classes.length; i < l; i++) {\n\t\t\t\t\t\tclassName = classes[i];\n\t\t\t\t\t\tif (CLASS_ATTR_MAP[className]) {\n\t\t\t\t\t\t\td[className] = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\textraClasses.push(className);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\td.extraClasses = extraClasses.join(\" \");\n\n\t\t\t\t\t// Parse node options from ID, title and class attributes\n\t\t\t\t\ttmp = $li.attr(\"title\");\n\t\t\t\t\tif (tmp) {\n\t\t\t\t\t\td.tooltip = tmp; // overrides <a title='...'>\n\t\t\t\t\t}\n\t\t\t\t\ttmp = $li.attr(\"id\");\n\t\t\t\t\tif (tmp) {\n\t\t\t\t\t\td.key = tmp;\n\t\t\t\t\t}\n\t\t\t\t\t// Translate hideCheckbox -> checkbox:false\n\t\t\t\t\tif ($li.attr(\"hideCheckbox\")) {\n\t\t\t\t\t\td.checkbox = false;\n\t\t\t\t\t}\n\t\t\t\t\t// Add <li data-NAME='...'> as node.data.NAME\n\t\t\t\t\tallData = _getElementDataAsDict($li);\n\t\t\t\t\tif (allData && !$.isEmptyObject(allData)) {\n\t\t\t\t\t\t// #507: convert data-hidecheckbox (lower case) to hideCheckbox\n\t\t\t\t\t\tfor (lowerCaseAttr in NODE_ATTR_LOWERCASE_MAP) {\n\t\t\t\t\t\t\tif (_hasProp(allData, lowerCaseAttr)) {\n\t\t\t\t\t\t\t\tallData[\n\t\t\t\t\t\t\t\t\tNODE_ATTR_LOWERCASE_MAP[lowerCaseAttr]\n\t\t\t\t\t\t\t\t] = allData[lowerCaseAttr];\n\t\t\t\t\t\t\t\tdelete allData[lowerCaseAttr];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// #56: Allow to set special node.attributes from data-...\n\t\t\t\t\t\tfor (i = 0, l = NODE_ATTRS.length; i < l; i++) {\n\t\t\t\t\t\t\ttmp = NODE_ATTRS[i];\n\t\t\t\t\t\t\ttmp2 = allData[tmp];\n\t\t\t\t\t\t\tif (tmp2 != null) {\n\t\t\t\t\t\t\t\tdelete allData[tmp];\n\t\t\t\t\t\t\t\td[tmp] = tmp2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// All other data-... goes to node.data...\n\t\t\t\t\t\t$.extend(d.data, allData);\n\t\t\t\t\t}\n\t\t\t\t\t// Recursive reading of child nodes, if LI tag contains an UL tag\n\t\t\t\t\t$ul = $li.find(\">ul\").first();\n\t\t\t\t\tif ($ul.length) {\n\t\t\t\t\t\td.children = $.ui.fancytree.parseHtml($ul);\n\t\t\t\t\t} else {\n\t\t\t\t\t\td.children = d.lazy ? undefined : null;\n\t\t\t\t\t}\n\t\t\t\t\tchildren.push(d);\n\t\t\t\t\t// FT.debug(\"parse \", d, children);\n\t\t\t\t});\n\t\t\t\treturn children;\n\t\t\t},\n\t\t\t/** Add Fancytree extension definition to the list of globally available extensions.\n\t\t\t *\n\t\t\t * @param {object} definition\n\t\t\t */\n\t\t\tregisterExtension: function (definition) {\n\t\t\t\t_assert(\n\t\t\t\t\tdefinition.name != null,\n\t\t\t\t\t\"extensions must have a `name` property.\"\n\t\t\t\t);\n\t\t\t\t_assert(\n\t\t\t\t\tdefinition.version != null,\n\t\t\t\t\t\"extensions must have a `version` property.\"\n\t\t\t\t);\n\t\t\t\t$.ui.fancytree._extensions[definition.name] = definition;\n\t\t\t},\n\t\t\t/** Replacement for the deprecated `jQuery.trim()`.\n\t\t\t *\n\t\t\t * @param {string} text\n\t\t\t */\n\t\t\ttrim: _trim,\n\t\t\t/** Inverse of escapeHtml().\n\t\t\t *\n\t\t\t * @param {string} s\n\t\t\t * @returns {string}\n\t\t\t */\n\t\t\tunescapeHtml: function (s) {\n\t\t\t\tvar e = document.createElement(\"div\");\n\t\t\t\te.innerHTML = s;\n\t\t\t\treturn e.childNodes.length === 0\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: e.childNodes[0].nodeValue;\n\t\t\t},\n\t\t\t/** Write warning message to console if debugLevel >= 2.\n\t\t\t * @param {string} msg\n\t\t\t */\n\t\t\twarn: function (msg) {\n\t\t\t\tif ($.ui.fancytree.debugLevel >= 2) {\n\t\t\t\t\tconsoleApply(\"warn\", arguments);\n\t\t\t\t}\n\t\t\t},\n\t\t}\n\t);\n\n\t// Value returned by `require('jquery.fancytree')`\n\treturn $.ui.fancytree;\n}); // End of closure\n","/*! jQuery UI - v1.12.1 - 2018-05-20\n* http://jqueryui.com\n* Includes: widget.js, position.js, keycode.js, scroll-parent.js, unique-id.js\n* Copyright jQuery Foundation and other contributors; Licensed MIT */\n\n;(function( factory ) {\n\tif ( typeof define === \"function\" && define.amd ) {\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"jquery\" ], factory );\n\t} else if ( typeof module === \"object\" && module.exports ) {\n\t\t// Node/CommonJS\n\t\tmodule.exports = factory(require(\"jquery\"));\n\t} else {\n\t\t// Browser globals\n\t\tfactory( jQuery );\n\t}\n}(function( $ ) {\n\n$.ui = $.ui || {};\n\nvar version = $.ui.version = \"1.12.1\";\n\n\n/*!\n * jQuery UI Widget 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: Widget\n//>>group: Core\n//>>description: Provides a factory for creating stateful widgets with a common API.\n//>>docs: http://api.jqueryui.com/jQuery.widget/\n//>>demos: http://jqueryui.com/widget/\n\n\n\nvar widgetUuid = 0;\nvar widgetSlice = Array.prototype.slice;\n\n$.cleanData = $.cleanData || ( function( orig ) {\n\treturn function( elems ) {\n\t\tvar events, elem, i;\n\t\tfor ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {\n\t\t\ttry {\n\n\t\t\t\t// Only trigger remove when necessary to save time\n\t\t\t\tevents = $._data( elem, \"events\" );\n\t\t\t\tif ( events && events.remove ) {\n\t\t\t\t\t$( elem ).triggerHandler( \"remove\" );\n\t\t\t\t}\n\n\t\t\t// Http://bugs.jquery.com/ticket/8235\n\t\t\t} catch ( e ) {}\n\t\t}\n\t\torig( elems );\n\t};\n} )( $.cleanData );\n\n$.widget = $.widget || function( name, base, prototype ) {\n\tvar existingConstructor, constructor, basePrototype;\n\n\t// ProxiedPrototype allows the provided prototype to remain unmodified\n\t// so that it can be used as a mixin for multiple widgets (#8876)\n\tvar proxiedPrototype = {};\n\n\tvar namespace = name.split( \".\" )[ 0 ];\n\tname = name.split( \".\" )[ 1 ];\n\tvar fullName = namespace + \"-\" + name;\n\n\tif ( !prototype ) {\n\t\tprototype = base;\n\t\tbase = $.Widget;\n\t}\n\n\tif ( $.isArray( prototype ) ) {\n\t\tprototype = $.extend.apply( null, [ {} ].concat( prototype ) );\n\t}\n\n\t// Create selector for plugin\n\t$.expr[ \":\" ][ fullName.toLowerCase() ] = function( elem ) {\n\t\treturn !!$.data( elem, fullName );\n\t};\n\n\t$[ namespace ] = $[ namespace ] || {};\n\texistingConstructor = $[ namespace ][ name ];\n\tconstructor = $[ namespace ][ name ] = function( options, element ) {\n\n\t\t// Allow instantiation without \"new\" keyword\n\t\tif ( !this._createWidget ) {\n\t\t\treturn new constructor( options, element );\n\t\t}\n\n\t\t// Allow instantiation without initializing for simple inheritance\n\t\t// must use \"new\" keyword (the code above always passes args)\n\t\tif ( arguments.length ) {\n\t\t\tthis._createWidget( options, element );\n\t\t}\n\t};\n\n\t// Extend with the existing constructor to carry over any static properties\n\t$.extend( constructor, existingConstructor, {\n\t\tversion: prototype.version,\n\n\t\t// Copy the object used to create the prototype in case we need to\n\t\t// redefine the widget later\n\t\t_proto: $.extend( {}, prototype ),\n\n\t\t// Track widgets that inherit from this widget in case this widget is\n\t\t// redefined after a widget inherits from it\n\t\t_childConstructors: []\n\t} );\n\n\tbasePrototype = new base();\n\n\t// We need to make the options hash a property directly on the new instance\n\t// otherwise we'll modify the options hash on the prototype that we're\n\t// inheriting from\n\tbasePrototype.options = $.widget.extend( {}, basePrototype.options );\n\t$.each( prototype, function( prop, value ) {\n\t\tif ( !$.isFunction( value ) ) {\n\t\t\tproxiedPrototype[ prop ] = value;\n\t\t\treturn;\n\t\t}\n\t\tproxiedPrototype[ prop ] = ( function() {\n\t\t\tfunction _super() {\n\t\t\t\treturn base.prototype[ prop ].apply( this, arguments );\n\t\t\t}\n\n\t\t\tfunction _superApply( args ) {\n\t\t\t\treturn base.prototype[ prop ].apply( this, args );\n\t\t\t}\n\n\t\t\treturn function() {\n\t\t\t\tvar __super = this._super;\n\t\t\t\tvar __superApply = this._superApply;\n\t\t\t\tvar returnValue;\n\n\t\t\t\tthis._super = _super;\n\t\t\t\tthis._superApply = _superApply;\n\n\t\t\t\treturnValue = value.apply( this, arguments );\n\n\t\t\t\tthis._super = __super;\n\t\t\t\tthis._superApply = __superApply;\n\n\t\t\t\treturn returnValue;\n\t\t\t};\n\t\t} )();\n\t} );\n\tconstructor.prototype = $.widget.extend( basePrototype, {\n\n\t\t// TODO: remove support for widgetEventPrefix\n\t\t// always use the name + a colon as the prefix, e.g., draggable:start\n\t\t// don't prefix for widgets that aren't DOM-based\n\t\twidgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name\n\t}, proxiedPrototype, {\n\t\tconstructor: constructor,\n\t\tnamespace: namespace,\n\t\twidgetName: name,\n\t\twidgetFullName: fullName\n\t} );\n\n\t// If this widget is being redefined then we need to find all widgets that\n\t// are inheriting from it and redefine all of them so that they inherit from\n\t// the new version of this widget. We're essentially trying to replace one\n\t// level in the prototype chain.\n\tif ( existingConstructor ) {\n\t\t$.each( existingConstructor._childConstructors, function( i, child ) {\n\t\t\tvar childPrototype = child.prototype;\n\n\t\t\t// Redefine the child widget using the same prototype that was\n\t\t\t// originally used, but inherit from the new version of the base\n\t\t\t$.widget( childPrototype.namespace + \".\" + childPrototype.widgetName, constructor,\n\t\t\t\tchild._proto );\n\t\t} );\n\n\t\t// Remove the list of existing child constructors from the old constructor\n\t\t// so the old child constructors can be garbage collected\n\t\tdelete existingConstructor._childConstructors;\n\t} else {\n\t\tbase._childConstructors.push( constructor );\n\t}\n\n\t$.widget.bridge( name, constructor );\n\n\treturn constructor;\n};\n\n$.widget.extend = function( target ) {\n\tvar input = widgetSlice.call( arguments, 1 );\n\tvar inputIndex = 0;\n\tvar inputLength = input.length;\n\tvar key;\n\tvar value;\n\n\tfor ( ; inputIndex < inputLength; inputIndex++ ) {\n\t\tfor ( key in input[ inputIndex ] ) {\n\t\t\tvalue = input[ inputIndex ][ key ];\n\t\t\tif ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {\n\n\t\t\t\t// Clone objects\n\t\t\t\tif ( $.isPlainObject( value ) ) {\n\t\t\t\t\ttarget[ key ] = $.isPlainObject( target[ key ] ) ?\n\t\t\t\t\t\t$.widget.extend( {}, target[ key ], value ) :\n\n\t\t\t\t\t\t// Don't extend strings, arrays, etc. with objects\n\t\t\t\t\t\t$.widget.extend( {}, value );\n\n\t\t\t\t// Copy everything else by reference\n\t\t\t\t} else {\n\t\t\t\t\ttarget[ key ] = value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn target;\n};\n\n$.widget.bridge = function( name, object ) {\n\tvar fullName = object.prototype.widgetFullName || name;\n\t$.fn[ name ] = function( options ) {\n\t\tvar isMethodCall = typeof options === \"string\";\n\t\tvar args = widgetSlice.call( arguments, 1 );\n\t\tvar returnValue = this;\n\n\t\tif ( isMethodCall ) {\n\n\t\t\t// If this is an empty collection, we need to have the instance method\n\t\t\t// return undefined instead of the jQuery instance\n\t\t\tif ( !this.length && options === \"instance\" ) {\n\t\t\t\treturnValue = undefined;\n\t\t\t} else {\n\t\t\t\tthis.each( function() {\n\t\t\t\t\tvar methodValue;\n\t\t\t\t\tvar instance = $.data( this, fullName );\n\n\t\t\t\t\tif ( options === \"instance\" ) {\n\t\t\t\t\t\treturnValue = instance;\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !instance ) {\n\t\t\t\t\t\treturn $.error( \"cannot call methods on \" + name +\n\t\t\t\t\t\t\t\" prior to initialization; \" +\n\t\t\t\t\t\t\t\"attempted to call method '\" + options + \"'\" );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !$.isFunction( instance[ options ] ) || options.charAt( 0 ) === \"_\" ) {\n\t\t\t\t\t\treturn $.error( \"no such method '\" + options + \"' for \" + name +\n\t\t\t\t\t\t\t\" widget instance\" );\n\t\t\t\t\t}\n\n\t\t\t\t\tmethodValue = instance[ options ].apply( instance, args );\n\n\t\t\t\t\tif ( methodValue !== instance && methodValue !== undefined ) {\n\t\t\t\t\t\treturnValue = methodValue && methodValue.jquery ?\n\t\t\t\t\t\t\treturnValue.pushStack( methodValue.get() ) :\n\t\t\t\t\t\t\tmethodValue;\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Allow multiple hashes to be passed on init\n\t\t\tif ( args.length ) {\n\t\t\t\toptions = $.widget.extend.apply( null, [ options ].concat( args ) );\n\t\t\t}\n\n\t\t\tthis.each( function() {\n\t\t\t\tvar instance = $.data( this, fullName );\n\t\t\t\tif ( instance ) {\n\t\t\t\t\tinstance.option( options || {} );\n\t\t\t\t\tif ( instance._init ) {\n\t\t\t\t\t\tinstance._init();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$.data( this, fullName, new object( options, this ) );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\treturn returnValue;\n\t};\n};\n\n$.Widget = $.Widget || function( /* options, element */ ) {};\n$.Widget._childConstructors = [];\n\n$.Widget.prototype = {\n\twidgetName: \"widget\",\n\twidgetEventPrefix: \"\",\n\tdefaultElement: \"<div>\",\n\n\toptions: {\n\t\tclasses: {},\n\t\tdisabled: false,\n\n\t\t// Callbacks\n\t\tcreate: null\n\t},\n\n\t_createWidget: function( options, element ) {\n\t\telement = $( element || this.defaultElement || this )[ 0 ];\n\t\tthis.element = $( element );\n\t\tthis.uuid = widgetUuid++;\n\t\tthis.eventNamespace = \".\" + this.widgetName + this.uuid;\n\n\t\tthis.bindings = $();\n\t\tthis.hoverable = $();\n\t\tthis.focusable = $();\n\t\tthis.classesElementLookup = {};\n\n\t\tif ( element !== this ) {\n\t\t\t$.data( element, this.widgetFullName, this );\n\t\t\tthis._on( true, this.element, {\n\t\t\t\tremove: function( event ) {\n\t\t\t\t\tif ( event.target === element ) {\n\t\t\t\t\t\tthis.destroy();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t\tthis.document = $( element.style ?\n\n\t\t\t\t// Element within the document\n\t\t\t\telement.ownerDocument :\n\n\t\t\t\t// Element is window or document\n\t\t\t\telement.document || element );\n\t\t\tthis.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow );\n\t\t}\n\n\t\tthis.options = $.widget.extend( {},\n\t\t\tthis.options,\n\t\t\tthis._getCreateOptions(),\n\t\t\toptions );\n\n\t\tthis._create();\n\n\t\tif ( this.options.disabled ) {\n\t\t\tthis._setOptionDisabled( this.options.disabled );\n\t\t}\n\n\t\tthis._trigger( \"create\", null, this._getCreateEventData() );\n\t\tthis._init();\n\t},\n\n\t_getCreateOptions: function() {\n\t\treturn {};\n\t},\n\n\t_getCreateEventData: $.noop,\n\n\t_create: $.noop,\n\n\t_init: $.noop,\n\n\tdestroy: function() {\n\t\tvar that = this;\n\n\t\tthis._destroy();\n\t\t$.each( this.classesElementLookup, function( key, value ) {\n\t\t\tthat._removeClass( value, key );\n\t\t} );\n\n\t\t// We can probably remove the unbind calls in 2.0\n\t\t// all event bindings should go through this._on()\n\t\tthis.element\n\t\t\t.off( this.eventNamespace )\n\t\t\t.removeData( this.widgetFullName );\n\t\tthis.widget()\n\t\t\t.off( this.eventNamespace )\n\t\t\t.removeAttr( \"aria-disabled\" );\n\n\t\t// Clean up events and states\n\t\tthis.bindings.off( this.eventNamespace );\n\t},\n\n\t_destroy: $.noop,\n\n\twidget: function() {\n\t\treturn this.element;\n\t},\n\n\toption: function( key, value ) {\n\t\tvar options = key;\n\t\tvar parts;\n\t\tvar curOption;\n\t\tvar i;\n\n\t\tif ( arguments.length === 0 ) {\n\n\t\t\t// Don't return a reference to the internal hash\n\t\t\treturn $.widget.extend( {}, this.options );\n\t\t}\n\n\t\tif ( typeof key === \"string\" ) {\n\n\t\t\t// Handle nested keys, e.g., \"foo.bar\" => { foo: { bar: ___ } }\n\t\t\toptions = {};\n\t\t\tparts = key.split( \".\" );\n\t\t\tkey = parts.shift();\n\t\t\tif ( parts.length ) {\n\t\t\t\tcurOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );\n\t\t\t\tfor ( i = 0; i < parts.length - 1; i++ ) {\n\t\t\t\t\tcurOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};\n\t\t\t\t\tcurOption = curOption[ parts[ i ] ];\n\t\t\t\t}\n\t\t\t\tkey = parts.pop();\n\t\t\t\tif ( arguments.length === 1 ) {\n\t\t\t\t\treturn curOption[ key ] === undefined ? null : curOption[ key ];\n\t\t\t\t}\n\t\t\t\tcurOption[ key ] = value;\n\t\t\t} else {\n\t\t\t\tif ( arguments.length === 1 ) {\n\t\t\t\t\treturn this.options[ key ] === undefined ? null : this.options[ key ];\n\t\t\t\t}\n\t\t\t\toptions[ key ] = value;\n\t\t\t}\n\t\t}\n\n\t\tthis._setOptions( options );\n\n\t\treturn this;\n\t},\n\n\t_setOptions: function( options ) {\n\t\tvar key;\n\n\t\tfor ( key in options ) {\n\t\t\tthis._setOption( key, options[ key ] );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t_setOption: function( key, value ) {\n\t\tif ( key === \"classes\" ) {\n\t\t\tthis._setOptionClasses( value );\n\t\t}\n\n\t\tthis.options[ key ] = value;\n\n\t\tif ( key === \"disabled\" ) {\n\t\t\tthis._setOptionDisabled( value );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t_setOptionClasses: function( value ) {\n\t\tvar classKey, elements, currentElements;\n\n\t\tfor ( classKey in value ) {\n\t\t\tcurrentElements = this.classesElementLookup[ classKey ];\n\t\t\tif ( value[ classKey ] === this.options.classes[ classKey ] ||\n\t\t\t\t\t!currentElements ||\n\t\t\t\t\t!currentElements.length ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// We are doing this to create a new jQuery object because the _removeClass() call\n\t\t\t// on the next line is going to destroy the reference to the current elements being\n\t\t\t// tracked. We need to save a copy of this collection so that we can add the new classes\n\t\t\t// below.\n\t\t\telements = $( currentElements.get() );\n\t\t\tthis._removeClass( currentElements, classKey );\n\n\t\t\t// We don't use _addClass() here, because that uses this.options.classes\n\t\t\t// for generating the string of classes. We want to use the value passed in from\n\t\t\t// _setOption(), this is the new value of the classes option which was passed to\n\t\t\t// _setOption(). We pass this value directly to _classes().\n\t\t\telements.addClass( this._classes( {\n\t\t\t\telement: elements,\n\t\t\t\tkeys: classKey,\n\t\t\t\tclasses: value,\n\t\t\t\tadd: true\n\t\t\t} ) );\n\t\t}\n\t},\n\n\t_setOptionDisabled: function( value ) {\n\t\tthis._toggleClass( this.widget(), this.widgetFullName + \"-disabled\", null, !!value );\n\n\t\t// If the widget is becoming disabled, then nothing is interactive\n\t\tif ( value ) {\n\t\t\tthis._removeClass( this.hoverable, null, \"ui-state-hover\" );\n\t\t\tthis._removeClass( this.focusable, null, \"ui-state-focus\" );\n\t\t}\n\t},\n\n\tenable: function() {\n\t\treturn this._setOptions( { disabled: false } );\n\t},\n\n\tdisable: function() {\n\t\treturn this._setOptions( { disabled: true } );\n\t},\n\n\t_classes: function( options ) {\n\t\tvar full = [];\n\t\tvar that = this;\n\n\t\toptions = $.extend( {\n\t\t\telement: this.element,\n\t\t\tclasses: this.options.classes || {}\n\t\t}, options );\n\n\t\tfunction processClassString( classes, checkOption ) {\n\t\t\tvar current, i;\n\t\t\tfor ( i = 0; i < classes.length; i++ ) {\n\t\t\t\tcurrent = that.classesElementLookup[ classes[ i ] ] || $();\n\t\t\t\tif ( options.add ) {\n\t\t\t\t\tcurrent = $( $.unique( current.get().concat( options.element.get() ) ) );\n\t\t\t\t} else {\n\t\t\t\t\tcurrent = $( current.not( options.element ).get() );\n\t\t\t\t}\n\t\t\t\tthat.classesElementLookup[ classes[ i ] ] = current;\n\t\t\t\tfull.push( classes[ i ] );\n\t\t\t\tif ( checkOption && options.classes[ classes[ i ] ] ) {\n\t\t\t\t\tfull.push( options.classes[ classes[ i ] ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis._on( options.element, {\n\t\t\t\"remove\": \"_untrackClassesElement\"\n\t\t} );\n\n\t\tif ( options.keys ) {\n\t\t\tprocessClassString( options.keys.match( /\\S+/g ) || [], true );\n\t\t}\n\t\tif ( options.extra ) {\n\t\t\tprocessClassString( options.extra.match( /\\S+/g ) || [] );\n\t\t}\n\n\t\treturn full.join( \" \" );\n\t},\n\n\t_untrackClassesElement: function( event ) {\n\t\tvar that = this;\n\t\t$.each( that.classesElementLookup, function( key, value ) {\n\t\t\tif ( $.inArray( event.target, value ) !== -1 ) {\n\t\t\t\tthat.classesElementLookup[ key ] = $( value.not( event.target ).get() );\n\t\t\t}\n\t\t} );\n\t},\n\n\t_removeClass: function( element, keys, extra ) {\n\t\treturn this._toggleClass( element, keys, extra, false );\n\t},\n\n\t_addClass: function( element, keys, extra ) {\n\t\treturn this._toggleClass( element, keys, extra, true );\n\t},\n\n\t_toggleClass: function( element, keys, extra, add ) {\n\t\tadd = ( typeof add === \"boolean\" ) ? add : extra;\n\t\tvar shift = ( typeof element === \"string\" || element === null ),\n\t\t\toptions = {\n\t\t\t\textra: shift ? keys : extra,\n\t\t\t\tkeys: shift ? element : keys,\n\t\t\t\telement: shift ? this.element : element,\n\t\t\t\tadd: add\n\t\t\t};\n\t\toptions.element.toggleClass( this._classes( options ), add );\n\t\treturn this;\n\t},\n\n\t_on: function( suppressDisabledCheck, element, handlers ) {\n\t\tvar delegateElement;\n\t\tvar instance = this;\n\n\t\t// No suppressDisabledCheck flag, shuffle arguments\n\t\tif ( typeof suppressDisabledCheck !== \"boolean\" ) {\n\t\t\thandlers = element;\n\t\t\telement = suppressDisabledCheck;\n\t\t\tsuppressDisabledCheck = false;\n\t\t}\n\n\t\t// No element argument, shuffle and use this.element\n\t\tif ( !handlers ) {\n\t\t\thandlers = element;\n\t\t\telement = this.element;\n\t\t\tdelegateElement = this.widget();\n\t\t} else {\n\t\t\telement = delegateElement = $( element );\n\t\t\tthis.bindings = this.bindings.add( element );\n\t\t}\n\n\t\t$.each( handlers, function( event, handler ) {\n\t\t\tfunction handlerProxy() {\n\n\t\t\t\t// Allow widgets to customize the disabled handling\n\t\t\t\t// - disabled as an array instead of boolean\n\t\t\t\t// - disabled class as method for disabling individual parts\n\t\t\t\tif ( !suppressDisabledCheck &&\n\t\t\t\t\t\t( instance.options.disabled === true ||\n\t\t\t\t\t\t$( this ).hasClass( \"ui-state-disabled\" ) ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn ( typeof handler === \"string\" ? instance[ handler ] : handler )\n\t\t\t\t\t.apply( instance, arguments );\n\t\t\t}\n\n\t\t\t// Copy the guid so direct unbinding works\n\t\t\tif ( typeof handler !== \"string\" ) {\n\t\t\t\thandlerProxy.guid = handler.guid =\n\t\t\t\t\thandler.guid || handlerProxy.guid || $.guid++;\n\t\t\t}\n\n\t\t\tvar match = event.match( /^([\\w:-]*)\\s*(.*)$/ );\n\t\t\tvar eventName = match[ 1 ] + instance.eventNamespace;\n\t\t\tvar selector = match[ 2 ];\n\n\t\t\tif ( selector ) {\n\t\t\t\tdelegateElement.on( eventName, selector, handlerProxy );\n\t\t\t} else {\n\t\t\t\telement.on( eventName, handlerProxy );\n\t\t\t}\n\t\t} );\n\t},\n\n\t_off: function( element, eventName ) {\n\t\teventName = ( eventName || \"\" ).split( \" \" ).join( this.eventNamespace + \" \" ) +\n\t\t\tthis.eventNamespace;\n\t\telement.off( eventName ).off( eventName );\n\n\t\t// Clear the stack to avoid memory leaks (#10056)\n\t\tthis.bindings = $( this.bindings.not( element ).get() );\n\t\tthis.focusable = $( this.focusable.not( element ).get() );\n\t\tthis.hoverable = $( this.hoverable.not( element ).get() );\n\t},\n\n\t_delay: function( handler, delay ) {\n\t\tfunction handlerProxy() {\n\t\t\treturn ( typeof handler === \"string\" ? instance[ handler ] : handler )\n\t\t\t\t.apply( instance, arguments );\n\t\t}\n\t\tvar instance = this;\n\t\treturn setTimeout( handlerProxy, delay || 0 );\n\t},\n\n\t_hoverable: function( element ) {\n\t\tthis.hoverable = this.hoverable.add( element );\n\t\tthis._on( element, {\n\t\t\tmouseenter: function( event ) {\n\t\t\t\tthis._addClass( $( event.currentTarget ), null, \"ui-state-hover\" );\n\t\t\t},\n\t\t\tmouseleave: function( event ) {\n\t\t\t\tthis._removeClass( $( event.currentTarget ), null, \"ui-state-hover\" );\n\t\t\t}\n\t\t} );\n\t},\n\n\t_focusable: function( element ) {\n\t\tthis.focusable = this.focusable.add( element );\n\t\tthis._on( element, {\n\t\t\tfocusin: function( event ) {\n\t\t\t\tthis._addClass( $( event.currentTarget ), null, \"ui-state-focus\" );\n\t\t\t},\n\t\t\tfocusout: function( event ) {\n\t\t\t\tthis._removeClass( $( event.currentTarget ), null, \"ui-state-focus\" );\n\t\t\t}\n\t\t} );\n\t},\n\n\t_trigger: function( type, event, data ) {\n\t\tvar prop, orig;\n\t\tvar callback = this.options[ type ];\n\n\t\tdata = data || {};\n\t\tevent = $.Event( event );\n\t\tevent.type = ( type === this.widgetEventPrefix ?\n\t\t\ttype :\n\t\t\tthis.widgetEventPrefix + type ).toLowerCase();\n\n\t\t// The original event may come from any element\n\t\t// so we need to reset the target on the new event\n\t\tevent.target = this.element[ 0 ];\n\n\t\t// Copy original event properties over to the new event\n\t\torig = event.originalEvent;\n\t\tif ( orig ) {\n\t\t\tfor ( prop in orig ) {\n\t\t\t\tif ( !( prop in event ) ) {\n\t\t\t\t\tevent[ prop ] = orig[ prop ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.element.trigger( event, data );\n\t\treturn !( $.isFunction( callback ) &&\n\t\t\tcallback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false ||\n\t\t\tevent.isDefaultPrevented() );\n\t}\n};\n\n$.each( { show: \"fadeIn\", hide: \"fadeOut\" }, function( method, defaultEffect ) {\n\t$.Widget.prototype[ \"_\" + method ] = function( element, options, callback ) {\n\t\tif ( typeof options === \"string\" ) {\n\t\t\toptions = { effect: options };\n\t\t}\n\n\t\tvar hasOptions;\n\t\tvar effectName = !options ?\n\t\t\tmethod :\n\t\t\toptions === true || typeof options === \"number\" ?\n\t\t\t\tdefaultEffect :\n\t\t\t\toptions.effect || defaultEffect;\n\n\t\toptions = options || {};\n\t\tif ( typeof options === \"number\" ) {\n\t\t\toptions = { duration: options };\n\t\t}\n\n\t\thasOptions = !$.isEmptyObject( options );\n\t\toptions.complete = callback;\n\n\t\tif ( options.delay ) {\n\t\t\telement.delay( options.delay );\n\t\t}\n\n\t\tif ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {\n\t\t\telement[ method ]( options );\n\t\t} else if ( effectName !== method && element[ effectName ] ) {\n\t\t\telement[ effectName ]( options.duration, options.easing, callback );\n\t\t} else {\n\t\t\telement.queue( function( next ) {\n\t\t\t\t$( this )[ method ]();\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback.call( element[ 0 ] );\n\t\t\t\t}\n\t\t\t\tnext();\n\t\t\t} );\n\t\t}\n\t};\n} );\n\nvar widget = $.widget;\n\n\n/*!\n * jQuery UI Position 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * http://api.jqueryui.com/position/\n */\n\n//>>label: Position\n//>>group: Core\n//>>description: Positions elements relative to other elements.\n//>>docs: http://api.jqueryui.com/position/\n//>>demos: http://jqueryui.com/position/\n\n\n( function() {\nvar cachedScrollbarWidth,\n\tmax = Math.max,\n\tabs = Math.abs,\n\trhorizontal = /left|center|right/,\n\trvertical = /top|center|bottom/,\n\troffset = /[\\+\\-]\\d+(\\.[\\d]+)?%?/,\n\trposition = /^\\w+/,\n\trpercent = /%$/,\n\t_position = $.fn.position;\n\nfunction getOffsets( offsets, width, height ) {\n\treturn [\n\t\tparseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),\n\t\tparseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )\n\t];\n}\n\nfunction parseCss( element, property ) {\n\treturn parseInt( $.css( element, property ), 10 ) || 0;\n}\n\nfunction getDimensions( elem ) {\n\tvar raw = elem[ 0 ];\n\tif ( raw.nodeType === 9 ) {\n\t\treturn {\n\t\t\twidth: elem.width(),\n\t\t\theight: elem.height(),\n\t\t\toffset: { top: 0, left: 0 }\n\t\t};\n\t}\n\tif ( $.isWindow( raw ) ) {\n\t\treturn {\n\t\t\twidth: elem.width(),\n\t\t\theight: elem.height(),\n\t\t\toffset: { top: elem.scrollTop(), left: elem.scrollLeft() }\n\t\t};\n\t}\n\tif ( raw.preventDefault ) {\n\t\treturn {\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t\toffset: { top: raw.pageY, left: raw.pageX }\n\t\t};\n\t}\n\treturn {\n\t\twidth: elem.outerWidth(),\n\t\theight: elem.outerHeight(),\n\t\toffset: elem.offset()\n\t};\n}\n\n$.position = $.position || {\n\tscrollbarWidth: function() {\n\t\tif ( cachedScrollbarWidth !== undefined ) {\n\t\t\treturn cachedScrollbarWidth;\n\t\t}\n\t\tvar w1, w2,\n\t\t\tdiv = $( \"<div \" +\n\t\t\t\t\"style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>\" +\n\t\t\t\t\"<div style='height:100px;width:auto;'></div></div>\" ),\n\t\t\tinnerDiv = div.children()[ 0 ];\n\n\t\t$( \"body\" ).append( div );\n\t\tw1 = innerDiv.offsetWidth;\n\t\tdiv.css( \"overflow\", \"scroll\" );\n\n\t\tw2 = innerDiv.offsetWidth;\n\n\t\tif ( w1 === w2 ) {\n\t\t\tw2 = div[ 0 ].clientWidth;\n\t\t}\n\n\t\tdiv.remove();\n\n\t\treturn ( cachedScrollbarWidth = w1 - w2 );\n\t},\n\tgetScrollInfo: function( within ) {\n\t\tvar overflowX = within.isWindow || within.isDocument ? \"\" :\n\t\t\t\twithin.element.css( \"overflow-x\" ),\n\t\t\toverflowY = within.isWindow || within.isDocument ? \"\" :\n\t\t\t\twithin.element.css( \"overflow-y\" ),\n\t\t\thasOverflowX = overflowX === \"scroll\" ||\n\t\t\t\t( overflowX === \"auto\" && within.width < within.element[ 0 ].scrollWidth ),\n\t\t\thasOverflowY = overflowY === \"scroll\" ||\n\t\t\t\t( overflowY === \"auto\" && within.height < within.element[ 0 ].scrollHeight );\n\t\treturn {\n\t\t\twidth: hasOverflowY ? $.position.scrollbarWidth() : 0,\n\t\t\theight: hasOverflowX ? $.position.scrollbarWidth() : 0\n\t\t};\n\t},\n\tgetWithinInfo: function( element ) {\n\t\tvar withinElement = $( element || window ),\n\t\t\tisWindow = $.isWindow( withinElement[ 0 ] ),\n\t\t\tisDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9,\n\t\t\thasOffset = !isWindow && !isDocument;\n\t\treturn {\n\t\t\telement: withinElement,\n\t\t\tisWindow: isWindow,\n\t\t\tisDocument: isDocument,\n\t\t\toffset: hasOffset ? $( element ).offset() : { left: 0, top: 0 },\n\t\t\tscrollLeft: withinElement.scrollLeft(),\n\t\t\tscrollTop: withinElement.scrollTop(),\n\t\t\twidth: withinElement.outerWidth(),\n\t\t\theight: withinElement.outerHeight()\n\t\t};\n\t}\n};\n\n$.fn.position = function( options ) {\n\tif ( !options || !options.of ) {\n\t\treturn _position.apply( this, arguments );\n\t}\n\n\t// Make a copy, we don't want to modify arguments\n\toptions = $.extend( {}, options );\n\n\tvar atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,\n\t\ttarget = $( options.of ),\n\t\twithin = $.position.getWithinInfo( options.within ),\n\t\tscrollInfo = $.position.getScrollInfo( within ),\n\t\tcollision = ( options.collision || \"flip\" ).split( \" \" ),\n\t\toffsets = {};\n\n\tdimensions = getDimensions( target );\n\tif ( target[ 0 ].preventDefault ) {\n\n\t\t// Force left top to allow flipping\n\t\toptions.at = \"left top\";\n\t}\n\ttargetWidth = dimensions.width;\n\ttargetHeight = dimensions.height;\n\ttargetOffset = dimensions.offset;\n\n\t// Clone to reuse original targetOffset later\n\tbasePosition = $.extend( {}, targetOffset );\n\n\t// Force my and at to have valid horizontal and vertical positions\n\t// if a value is missing or invalid, it will be converted to center\n\t$.each( [ \"my\", \"at\" ], function() {\n\t\tvar pos = ( options[ this ] || \"\" ).split( \" \" ),\n\t\t\thorizontalOffset,\n\t\t\tverticalOffset;\n\n\t\tif ( pos.length === 1 ) {\n\t\t\tpos = rhorizontal.test( pos[ 0 ] ) ?\n\t\t\t\tpos.concat( [ \"center\" ] ) :\n\t\t\t\trvertical.test( pos[ 0 ] ) ?\n\t\t\t\t\t[ \"center\" ].concat( pos ) :\n\t\t\t\t\t[ \"center\", \"center\" ];\n\t\t}\n\t\tpos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : \"center\";\n\t\tpos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : \"center\";\n\n\t\t// Calculate offsets\n\t\thorizontalOffset = roffset.exec( pos[ 0 ] );\n\t\tverticalOffset = roffset.exec( pos[ 1 ] );\n\t\toffsets[ this ] = [\n\t\t\thorizontalOffset ? horizontalOffset[ 0 ] : 0,\n\t\t\tverticalOffset ? verticalOffset[ 0 ] : 0\n\t\t];\n\n\t\t// Reduce to just the positions without the offsets\n\t\toptions[ this ] = [\n\t\t\trposition.exec( pos[ 0 ] )[ 0 ],\n\t\t\trposition.exec( pos[ 1 ] )[ 0 ]\n\t\t];\n\t} );\n\n\t// Normalize collision option\n\tif ( collision.length === 1 ) {\n\t\tcollision[ 1 ] = collision[ 0 ];\n\t}\n\n\tif ( options.at[ 0 ] === \"right\" ) {\n\t\tbasePosition.left += targetWidth;\n\t} else if ( options.at[ 0 ] === \"center\" ) {\n\t\tbasePosition.left += targetWidth / 2;\n\t}\n\n\tif ( options.at[ 1 ] === \"bottom\" ) {\n\t\tbasePosition.top += targetHeight;\n\t} else if ( options.at[ 1 ] === \"center\" ) {\n\t\tbasePosition.top += targetHeight / 2;\n\t}\n\n\tatOffset = getOffsets( offsets.at, targetWidth, targetHeight );\n\tbasePosition.left += atOffset[ 0 ];\n\tbasePosition.top += atOffset[ 1 ];\n\n\treturn this.each( function() {\n\t\tvar collisionPosition, using,\n\t\t\telem = $( this ),\n\t\t\telemWidth = elem.outerWidth(),\n\t\t\telemHeight = elem.outerHeight(),\n\t\t\tmarginLeft = parseCss( this, \"marginLeft\" ),\n\t\t\tmarginTop = parseCss( this, \"marginTop\" ),\n\t\t\tcollisionWidth = elemWidth + marginLeft + parseCss( this, \"marginRight\" ) +\n\t\t\t\tscrollInfo.width,\n\t\t\tcollisionHeight = elemHeight + marginTop + parseCss( this, \"marginBottom\" ) +\n\t\t\t\tscrollInfo.height,\n\t\t\tposition = $.extend( {}, basePosition ),\n\t\t\tmyOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );\n\n\t\tif ( options.my[ 0 ] === \"right\" ) {\n\t\t\tposition.left -= elemWidth;\n\t\t} else if ( options.my[ 0 ] === \"center\" ) {\n\t\t\tposition.left -= elemWidth / 2;\n\t\t}\n\n\t\tif ( options.my[ 1 ] === \"bottom\" ) {\n\t\t\tposition.top -= elemHeight;\n\t\t} else if ( options.my[ 1 ] === \"center\" ) {\n\t\t\tposition.top -= elemHeight / 2;\n\t\t}\n\n\t\tposition.left += myOffset[ 0 ];\n\t\tposition.top += myOffset[ 1 ];\n\n\t\tcollisionPosition = {\n\t\t\tmarginLeft: marginLeft,\n\t\t\tmarginTop: marginTop\n\t\t};\n\n\t\t$.each( [ \"left\", \"top\" ], function( i, dir ) {\n\t\t\tif ( $.ui.position[ collision[ i ] ] ) {\n\t\t\t\t$.ui.position[ collision[ i ] ][ dir ]( position, {\n\t\t\t\t\ttargetWidth: targetWidth,\n\t\t\t\t\ttargetHeight: targetHeight,\n\t\t\t\t\telemWidth: elemWidth,\n\t\t\t\t\telemHeight: elemHeight,\n\t\t\t\t\tcollisionPosition: collisionPosition,\n\t\t\t\t\tcollisionWidth: collisionWidth,\n\t\t\t\t\tcollisionHeight: collisionHeight,\n\t\t\t\t\toffset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],\n\t\t\t\t\tmy: options.my,\n\t\t\t\t\tat: options.at,\n\t\t\t\t\twithin: within,\n\t\t\t\t\telem: elem\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tif ( options.using ) {\n\n\t\t\t// Adds feedback as second argument to using callback, if present\n\t\t\tusing = function( props ) {\n\t\t\t\tvar left = targetOffset.left - position.left,\n\t\t\t\t\tright = left + targetWidth - elemWidth,\n\t\t\t\t\ttop = targetOffset.top - position.top,\n\t\t\t\t\tbottom = top + targetHeight - elemHeight,\n\t\t\t\t\tfeedback = {\n\t\t\t\t\t\ttarget: {\n\t\t\t\t\t\t\telement: target,\n\t\t\t\t\t\t\tleft: targetOffset.left,\n\t\t\t\t\t\t\ttop: targetOffset.top,\n\t\t\t\t\t\t\twidth: targetWidth,\n\t\t\t\t\t\t\theight: targetHeight\n\t\t\t\t\t\t},\n\t\t\t\t\t\telement: {\n\t\t\t\t\t\t\telement: elem,\n\t\t\t\t\t\t\tleft: position.left,\n\t\t\t\t\t\t\ttop: position.top,\n\t\t\t\t\t\t\twidth: elemWidth,\n\t\t\t\t\t\t\theight: elemHeight\n\t\t\t\t\t\t},\n\t\t\t\t\t\thorizontal: right < 0 ? \"left\" : left > 0 ? \"right\" : \"center\",\n\t\t\t\t\t\tvertical: bottom < 0 ? \"top\" : top > 0 ? \"bottom\" : \"middle\"\n\t\t\t\t\t};\n\t\t\t\tif ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {\n\t\t\t\t\tfeedback.horizontal = \"center\";\n\t\t\t\t}\n\t\t\t\tif ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {\n\t\t\t\t\tfeedback.vertical = \"middle\";\n\t\t\t\t}\n\t\t\t\tif ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {\n\t\t\t\t\tfeedback.important = \"horizontal\";\n\t\t\t\t} else {\n\t\t\t\t\tfeedback.important = \"vertical\";\n\t\t\t\t}\n\t\t\t\toptions.using.call( this, props, feedback );\n\t\t\t};\n\t\t}\n\n\t\telem.offset( $.extend( position, { using: using } ) );\n\t} );\n};\n\n$.ui.position = {\n\tfit: {\n\t\tleft: function( position, data ) {\n\t\t\tvar within = data.within,\n\t\t\t\twithinOffset = within.isWindow ? within.scrollLeft : within.offset.left,\n\t\t\t\touterWidth = within.width,\n\t\t\t\tcollisionPosLeft = position.left - data.collisionPosition.marginLeft,\n\t\t\t\toverLeft = withinOffset - collisionPosLeft,\n\t\t\t\toverRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,\n\t\t\t\tnewOverRight;\n\n\t\t\t// Element is wider than within\n\t\t\tif ( data.collisionWidth > outerWidth ) {\n\n\t\t\t\t// Element is initially over the left side of within\n\t\t\t\tif ( overLeft > 0 && overRight <= 0 ) {\n\t\t\t\t\tnewOverRight = position.left + overLeft + data.collisionWidth - outerWidth -\n\t\t\t\t\t\twithinOffset;\n\t\t\t\t\tposition.left += overLeft - newOverRight;\n\n\t\t\t\t// Element is initially over right side of within\n\t\t\t\t} else if ( overRight > 0 && overLeft <= 0 ) {\n\t\t\t\t\tposition.left = withinOffset;\n\n\t\t\t\t// Element is initially over both left and right sides of within\n\t\t\t\t} else {\n\t\t\t\t\tif ( overLeft > overRight ) {\n\t\t\t\t\t\tposition.left = withinOffset + outerWidth - data.collisionWidth;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tposition.left = withinOffset;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Too far left -> align with left edge\n\t\t\t} else if ( overLeft > 0 ) {\n\t\t\t\tposition.left += overLeft;\n\n\t\t\t// Too far right -> align with right edge\n\t\t\t} else if ( overRight > 0 ) {\n\t\t\t\tposition.left -= overRight;\n\n\t\t\t// Adjust based on position and margin\n\t\t\t} else {\n\t\t\t\tposition.left = max( position.left - collisionPosLeft, position.left );\n\t\t\t}\n\t\t},\n\t\ttop: function( position, data ) {\n\t\t\tvar within = data.within,\n\t\t\t\twithinOffset = within.isWindow ? within.scrollTop : within.offset.top,\n\t\t\t\touterHeight = data.within.height,\n\t\t\t\tcollisionPosTop = position.top - data.collisionPosition.marginTop,\n\t\t\t\toverTop = withinOffset - collisionPosTop,\n\t\t\t\toverBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,\n\t\t\t\tnewOverBottom;\n\n\t\t\t// Element is taller than within\n\t\t\tif ( data.collisionHeight > outerHeight ) {\n\n\t\t\t\t// Element is initially over the top of within\n\t\t\t\tif ( overTop > 0 && overBottom <= 0 ) {\n\t\t\t\t\tnewOverBottom = position.top + overTop + data.collisionHeight - outerHeight -\n\t\t\t\t\t\twithinOffset;\n\t\t\t\t\tposition.top += overTop - newOverBottom;\n\n\t\t\t\t// Element is initially over bottom of within\n\t\t\t\t} else if ( overBottom > 0 && overTop <= 0 ) {\n\t\t\t\t\tposition.top = withinOffset;\n\n\t\t\t\t// Element is initially over both top and bottom of within\n\t\t\t\t} else {\n\t\t\t\t\tif ( overTop > overBottom ) {\n\t\t\t\t\t\tposition.top = withinOffset + outerHeight - data.collisionHeight;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tposition.top = withinOffset;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Too far up -> align with top\n\t\t\t} else if ( overTop > 0 ) {\n\t\t\t\tposition.top += overTop;\n\n\t\t\t// Too far down -> align with bottom edge\n\t\t\t} else if ( overBottom > 0 ) {\n\t\t\t\tposition.top -= overBottom;\n\n\t\t\t// Adjust based on position and margin\n\t\t\t} else {\n\t\t\t\tposition.top = max( position.top - collisionPosTop, position.top );\n\t\t\t}\n\t\t}\n\t},\n\tflip: {\n\t\tleft: function( position, data ) {\n\t\t\tvar within = data.within,\n\t\t\t\twithinOffset = within.offset.left + within.scrollLeft,\n\t\t\t\touterWidth = within.width,\n\t\t\t\toffsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,\n\t\t\t\tcollisionPosLeft = position.left - data.collisionPosition.marginLeft,\n\t\t\t\toverLeft = collisionPosLeft - offsetLeft,\n\t\t\t\toverRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,\n\t\t\t\tmyOffset = data.my[ 0 ] === \"left\" ?\n\t\t\t\t\t-data.elemWidth :\n\t\t\t\t\tdata.my[ 0 ] === \"right\" ?\n\t\t\t\t\t\tdata.elemWidth :\n\t\t\t\t\t\t0,\n\t\t\t\tatOffset = data.at[ 0 ] === \"left\" ?\n\t\t\t\t\tdata.targetWidth :\n\t\t\t\t\tdata.at[ 0 ] === \"right\" ?\n\t\t\t\t\t\t-data.targetWidth :\n\t\t\t\t\t\t0,\n\t\t\t\toffset = -2 * data.offset[ 0 ],\n\t\t\t\tnewOverRight,\n\t\t\t\tnewOverLeft;\n\n\t\t\tif ( overLeft < 0 ) {\n\t\t\t\tnewOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth -\n\t\t\t\t\touterWidth - withinOffset;\n\t\t\t\tif ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {\n\t\t\t\t\tposition.left += myOffset + atOffset + offset;\n\t\t\t\t}\n\t\t\t} else if ( overRight > 0 ) {\n\t\t\t\tnewOverLeft = position.left - data.collisionPosition.marginLeft + myOffset +\n\t\t\t\t\tatOffset + offset - offsetLeft;\n\t\t\t\tif ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {\n\t\t\t\t\tposition.left += myOffset + atOffset + offset;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\ttop: function( position, data ) {\n\t\t\tvar within = data.within,\n\t\t\t\twithinOffset = within.offset.top + within.scrollTop,\n\t\t\t\touterHeight = within.height,\n\t\t\t\toffsetTop = within.isWindow ? within.scrollTop : within.offset.top,\n\t\t\t\tcollisionPosTop = position.top - data.collisionPosition.marginTop,\n\t\t\t\toverTop = collisionPosTop - offsetTop,\n\t\t\t\toverBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,\n\t\t\t\ttop = data.my[ 1 ] === \"top\",\n\t\t\t\tmyOffset = top ?\n\t\t\t\t\t-data.elemHeight :\n\t\t\t\t\tdata.my[ 1 ] === \"bottom\" ?\n\t\t\t\t\t\tdata.elemHeight :\n\t\t\t\t\t\t0,\n\t\t\t\tatOffset = data.at[ 1 ] === \"top\" ?\n\t\t\t\t\tdata.targetHeight :\n\t\t\t\t\tdata.at[ 1 ] === \"bottom\" ?\n\t\t\t\t\t\t-data.targetHeight :\n\t\t\t\t\t\t0,\n\t\t\t\toffset = -2 * data.offset[ 1 ],\n\t\t\t\tnewOverTop,\n\t\t\t\tnewOverBottom;\n\t\t\tif ( overTop < 0 ) {\n\t\t\t\tnewOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight -\n\t\t\t\t\touterHeight - withinOffset;\n\t\t\t\tif ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {\n\t\t\t\t\tposition.top += myOffset + atOffset + offset;\n\t\t\t\t}\n\t\t\t} else if ( overBottom > 0 ) {\n\t\t\t\tnewOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset +\n\t\t\t\t\toffset - offsetTop;\n\t\t\t\tif ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {\n\t\t\t\t\tposition.top += myOffset + atOffset + offset;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tflipfit: {\n\t\tleft: function() {\n\t\t\t$.ui.position.flip.left.apply( this, arguments );\n\t\t\t$.ui.position.fit.left.apply( this, arguments );\n\t\t},\n\t\ttop: function() {\n\t\t\t$.ui.position.flip.top.apply( this, arguments );\n\t\t\t$.ui.position.fit.top.apply( this, arguments );\n\t\t}\n\t}\n};\n\n} )();\n\nvar position = $.ui.position;\n\n\n/*!\n * jQuery UI Keycode 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: Keycode\n//>>group: Core\n//>>description: Provide keycodes as keynames\n//>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/\n\n\nvar keycode = $.ui.keyCode = {\n\tBACKSPACE: 8,\n\tCOMMA: 188,\n\tDELETE: 46,\n\tDOWN: 40,\n\tEND: 35,\n\tENTER: 13,\n\tESCAPE: 27,\n\tHOME: 36,\n\tLEFT: 37,\n\tPAGE_DOWN: 34,\n\tPAGE_UP: 33,\n\tPERIOD: 190,\n\tRIGHT: 39,\n\tSPACE: 32,\n\tTAB: 9,\n\tUP: 38\n};\n\n\n/*!\n * jQuery UI Scroll Parent 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: scrollParent\n//>>group: Core\n//>>description: Get the closest ancestor element that is scrollable.\n//>>docs: http://api.jqueryui.com/scrollParent/\n\n\n\nvar scrollParent = $.fn.scrollParent = function( includeHidden ) {\n\tvar position = this.css( \"position\" ),\n\t\texcludeStaticParent = position === \"absolute\",\n\t\toverflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,\n\t\tscrollParent = this.parents().filter( function() {\n\t\t\tvar parent = $( this );\n\t\t\tif ( excludeStaticParent && parent.css( \"position\" ) === \"static\" ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn overflowRegex.test( parent.css( \"overflow\" ) + parent.css( \"overflow-y\" ) +\n\t\t\t\tparent.css( \"overflow-x\" ) );\n\t\t} ).eq( 0 );\n\n\treturn position === \"fixed\" || !scrollParent.length ?\n\t\t$( this[ 0 ].ownerDocument || document ) :\n\t\tscrollParent;\n};\n\n\n/*!\n * jQuery UI Unique ID 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: uniqueId\n//>>group: Core\n//>>description: Functions to generate and remove uniqueId's\n//>>docs: http://api.jqueryui.com/uniqueId/\n\n\n\nvar uniqueId = $.fn.extend( {\n\tuniqueId: ( function() {\n\t\tvar uuid = 0;\n\n\t\treturn function() {\n\t\t\treturn this.each( function() {\n\t\t\t\tif ( !this.id ) {\n\t\t\t\t\tthis.id = \"ui-id-\" + ( ++uuid );\n\t\t\t\t}\n\t\t\t} );\n\t\t};\n\t} )(),\n\n\tremoveUniqueId: function() {\n\t\treturn this.each( function() {\n\t\t\tif ( /^ui-id-\\d+$/.test( this.id ) ) {\n\t\t\t\t$( this ).removeAttr( \"id\" );\n\t\t\t}\n\t\t} );\n\t}\n} );\n\n\n}));\n","module.exports = jQuery;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import '../scss/app.scss';\n\n/**\n * Admin modules\n */\n\nconst WP_Smush = WP_Smush || {};\nwindow.WP_Smush = WP_Smush;\n\n/**\n * IE polyfill for includes.\n *\n * @since 3.1.0\n * @param {string} search\n * @param {number} start\n * @return {boolean} Returns true if searchString appears as a substring of the result of converting this\n * object to a String, at one or more positions that are\n * greater than or equal to position; otherwise, returns false.\n */\nif ( ! String.prototype.includes ) {\n\tString.prototype.includes = function( search, start ) {\n\t\tif ( typeof start !== 'number' ) {\n\t\t\tstart = 0;\n\t\t}\n\n\t\tif ( start + search.length > this.length ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this.indexOf( search, start ) !== -1;\n\t};\n}\n\nrequire( './modules/helpers' );\nrequire( './modules/admin' );\nrequire( './modules/admin-common' );\nrequire( './modules/bulk-smush' );\nrequire( './modules/onboarding' );\nrequire( './modules/directory-smush' );\nrequire( './smush/cdn' );\nrequire( './smush/webp' );\nrequire( './smush/lazy-load' );\nrequire( './modules/bulk-restore' );\nrequire( './smush/settings' );\n\n/**\n * Notice scripts.\n *\n * Notices are used in the following functions:\n *\n * @used-by \\Smush\\Core\\Modules\\Smush::smush_updated()\n * @used-by \\Smush\\Core\\Integrations\\S3::3_support_required_notice()\n * @used-by \\Smush\\App\\Abstract_Page::installation_notice()\n *\n * TODO: should this be moved out in a separate file like common.scss?\n */\nrequire( './modules/notice' );\n"],"names":["jQuery","$","on","e","this","prop","preventDefault","slide_symbol","find","parents","eq","slideToggle","text","remove_element","el","timeout","fadeTo","slideUp","remove","process_smush_action","currentButton","smushAction","action","hide","mode","document","length","window","location","search","indexOf","params","attachment_id","data","_nonce","c_element","parent","css","opacity","disable_links","html","wp_smush_msgs","post","ajaxurl","r","enable_links","success","stats","Smush","new_size","error_msg","addClass","append","updateDisplayedContentAfterReCheck","count","$pendingImagesWrappers","$allDoneWrappers","removeClass","$unsmushedTooltip","textForm","tooltipText","replace","attr","goToByScroll","selector","animate","scrollTop","offset","top","assign","currentTarget","val","reload","self","id","done","response","links","not_processed","target","closest","innerHTML","wp_smushit_data","unsmushed","resmush","current_button","process_settings","button","scan_type","removeAttr","notices","type","get_ui","wp_smush_options_nonce","get","resmush_ids","count_smushed","count_supersmushed","count_images","count_image","size_before","size_after","savings_resize","savings_conversion","count_resize","bytes","parseInt","content","notice","noticeType","SUI","openNotice","icon","super_smush","super_smush_stat","super_smush_stats","remainingCount","always","$defaultText","$completedText","setTimeout","runRecheck","$el","container","count_total","smush_percent","WP_Smush","helpers","precise_round","progress_bar","res","savings_dir_smush","orig_size","image_size","remainingCountDiv","hash","scrollTo","substring","getElementById","focus","dataset","trigger","keypress","keyCode","wrapper_div","width_only","height_only","resize_checkbox","width_input","width_error_note","height_input","height_error_note","width_error","height_error","is","resize_sizes","width","show","hasClass","height","validate_resize_settings","settings_wrap","membership_valid","membership_invalid","message","dir_smush","ajax_error","stats_human","stats_percent","human","percent","combined_stats","c_stats","smushed","total_count","savings","update_cummulative_stats","prepend","ajax","url","openModal","undefined","toggleClass","restore","modal","contentContainer","settings","slide","errors","items","currentStep","totalSteps","init","resetModalWidth","renderTemplate","onboarding","template","bindSubmit","style","maxWidth","querySelector","confirmButton","addEventListener","initScan","cancel","closeModal","updateProgressBar","progress","Math","min","round","statusDiv","xhr","XMLHttpRequest","open","setRequestHeader","onload","status","JSON","parse","step","console","log","send","value","item","pop","push","src","thumb","link","total","_","memoize","compiled","options","evaluate","interpolate","escape","variable","templateSettings","bulk","bulkWarning","classList","add","ignored","upsellBox","cancelling","failedItems","skippedItems","obj","scan","remainingSteps","fail","showScanError","getProgress","onFinishStep","progress_smushed","directory","onFinish","href","directory_url","dialog","statusText","forbiddenMessage","limitReached","bulk_resume","resume","skipped","error","failed","selected","tree","triggered","progressDialog","currentScanStep","scanner","Scanner","initFileTree","off","selectedFolders","getSelectedNodes","paths","forEach","folder","key","param","smush_path","image_list_nonce","showProgressDialog","queryString","URLSearchParams","has","smushButton","ajaxSettings","list_nonce","cache","Object","entries","createTree","autoCollapse","clickFolderMode","checkbox","debugLevel","selectMode","tabindex","keyboard","quicksearch","source","lazyLoad","event","result","Promise","resolve","reject","dir","node","loadChildren","fixSelection3AfterClick","select","formatBytes","a","b","thresh","units","abs","u","toFixed","getSizeFromString","formattedSize","trim","getFormatFromString","num","decimals","sign","pow","showErrorNotice","noticeMessage","loadingButton","resetSettings","smush_url","noticeOptions","dismiss","label","noticeDismiss","tooltip","noticeDismissTooltip","removeNotice","$notice","membership","onboardingModal","scanFilesModal","first","last","selection","auto","lossy","strip_exif","original","lazy_load","usage","onboardingSlides","touchX","touchY","tracking","skipButton","skipSetup","handleTouchStart","firstTouch","touches","clientX","clientY","handleTouchMove","xUp","yUp","xDiff","yDiff","next","directionClass","input","checked","submitButton","showScanDialog","stringify","whereTo","index","newIndex","contains","goTo","nonce","elem","parentNode","removeChild","hideUpgradeModal","CDN","cdnEnableButton","cdnDisableButton","cdnStatsBox","toggle_cdn","updateStatsBox","enable","nonceField","getElementsByName","includes","toggleElements","spinner","elements","querySelectorAll","i","toggle","Lazyload","lazyloadEnableButton","lazyloadDisableButton","toggle_lazy_load","removeSpinner","removeLoaderIcon","removePlaceholder","display","handlePredefinedPlaceholders","pl1","changeColor","pl2","color","backgroundColor","addLoaderIcon","frame","wp","media","title","multiple","attachment","state","toJSON","imageIcon","backgroundImage","setAttribute","removeDiv","filename","saveSettings","page","msg","showSuccessNotice","settingsUpdated","serialize","runReCheck","otherClass","noticeDiv","warningDiv","perf","progressBar","skip_resmush","is_bulk","deferred","Deferred","setIds","is_bulk_resmush","prev","smush_type","single_ajax_suffix","bulk_ajax_suffix","smushAddParams","start","run","bindDeferredEvents","cancelAjax","isEmptyObject","memberValidityNotice","show_warning","isBulkResmush","sendUrl","dataType","savings_percent","savingsBytes","savings_bytes","origDiff","pro_savings","scanType","isNextgen","superSavings","statsHuman","isNaN","smushedCountDiv","smushConversionSavings","conversionSavings","smushResizeSavings","savingsValue","resizeSavings","resizeMessage","setProSavings","smushProSavings","proSavingsPercent","proSavingsBytes","updateRemainingCount","newSize","attachmentSize","contents","filter","nodeType","sizeStrongEl","remainingCountContainers","sidenavCountDiv","sidenavCheckTag","imageStats","is_lossy","errorMsg","fileName","thumbnail","tableDiv","error_ignore","currentId","uIndex","splice","ids","concat","itm","bulkStart","singleStart","smushing","all_done","request","membershipValidity","smush_vars","strings","stats_label","updateImageStats","enableButton","messageHolder","progressMessage","sync_stats","extend","updateStats","statusIcon","_updateProgress","removeProp","_res","updateLocalizedStats","syncStats","continueSmush","performance","now","freeExceeded","nonceValue","current_id","shift","updateSmushIds","prepareErrorRow","error_message","file_name","unshift","updateProgress","singleDone","continue","callAjax","error_in_bulk","bulkDone","abort","WebP","toggleModuleButton","recheckStatusButton","recheckStatusLink","showWizardButton","maybeShowDeleteAllSuccessNotice","toggleWebp","recheckStatus","deleteAll","toggleWizard","doEnable","runScan","localWebpURL","showNotice","generic_ajax_error","isConfigured","webp_nonce","autoclose","ui","fancytree","FT","TEST_IMG","RegExp","REX_HTML","REX_TOOLTIP","RECURSIVE_REQUEST_ERROR","INVALID_REQUEST_TARGET_ERROR","ENTITY_MAP","IGNORE_KEYCODES","SPECIAL_KEYCODES","MODIFIERS","MOUSE_BUTTONS","CLASS_ATTRS","split","CLASS_ATTR_MAP","TREE_ATTRS","NODE_ATTRS","NODE_ATTR_MAP","NODE_ATTR_LOWERCASE_MAP","NONE_NODE_DATA_MAP","active","children","toLowerCase","_isArray","Array","isArray","_assert","Date","getTime","FancytreeNode","prototype","_findDirectChild","ptr","l","cl","_setChildren","_callHook","addChildren","insertBefore","pos","origFirstChild","getFirstChild","origLastChild","getLastChild","firstNode","nodeList","isPlainObject","inArray","apply","render","renderStatus","ul","tr","fixSelection3FromEndNodes","triggerModifyChild","className","addNode","getParent","getNextSibling","addPagingNode","n","moreData","statusNodeType","partload","appendSibling","applyCommand","cmd","opts","applyPatch","patch","_getResolvedPromise","name","v","IGNORE_MAP","expanded","_hasProp","_isFunction","removeChildren","isVisible","renderTitle","setExpanded","collapseSiblings","copyTo","map","toDict","countChildren","deep","debug","call","arguments","toString","consoleApply","discard","warn","resetLazy","discardMarkup","includeSelf","fn","findAll","match","_makeNodeTitleMatcher","visit","findFirst","findRelatedNode","where","includeHidden","_changeSelectStatusAttrs","changed","unselectable","evalOption","unselectableStatus","partsel","callOpts","flag","isSelected","radiogroup","_walk","child","s","allSelected","someSelected","unselState","lazy","visitParents","fromDict","dict","getChildren","hasChildren","getIndex","getIndexHier","separator","digits","each","getParentList","o","substr","join","getKeyPath","excludeSelf","sep","keyPathSeparator","getPath","getLevel","level","dtn","ac","includeRoot","part","path","isFunc","getPrevSibling","stopOnParents","isStatusNode","extraClasses","hasFocus","focusNode","info","isActive","activeNode","isBelowOf","otherNode","isChildOf","isDescendantOf","p","isExpanded","isFirstSibling","isFolder","isLastSibling","isLazy","isLoaded","isLoading","_isLoading","isRoot","isRootNode","isPartsel","isPartload","rootNode","isPagingNode","isTopLevel","isUndefined","hasFilter","enableFilter","subMatchCount","load","forceReload","wasExpanded","_triggerNodeEvent","makeVisible","deferreds","dfd","len","effects","noAnimation","scroll","scrollIntoView","when","promise","moveTo","targetNode","prevParent","targetParent","navigate","activate","KC","LEFT","RIGHT","setFocus","setActive","childNode","force","replaceWith","scheduleAction","ms","timer","clearTimeout","_isNode","Error","duration","queue","scrollOfs","scrollParent","topNode","$scrollParent","$container","overflowY","jquery","tbody","body","topNodeY","nodeY","containerOffsetTop","nodeHeight","span","topOfs","bottomOfs","bottom","containerHeight","$animateTarget","isParentWindow","newScrollTop","max","innerHeight","clientHeight","resolveWith","complete","stop","setSelected","setStatus","details","setTitle","triggerModify","sortChildren","cmp","x","y","sort","recursive","callback","rnotwhite","classNames","wasAdded","statusElem","statusClassPropName","curClasses","_trim","toggleExpanded","toggleSelected","operation","extra","modifyChild","visitAndLoad","_recursion","loaders","then","visitSiblings","Fancytree","_makeHookContext","originalEvent","ctx","widget","typeInfo","types","funcName","contextObject","_extraArgs","args","slice","_setExpiringValue","_tempCache","expire","_getExpiringValue","entry","_usesExtension","extensions","_requireExtension","required","before","thisName","_local","extList","isBefore","isMissing","ext","badOrder","activateKey","getNodeByKey","opts_","refNode","getActiveNode","editCreateNode","editStart","patchList","p2","patchCount","deferredList","_makeResolveFunc","clear","destroy","disable","enableUpdate","_enableUpdate","expandAll","findNextNode","startNode","_checkNode","_makeNodeTitleStartMatcher","visitRows","BACKSPACE","HOME","END","UP","reverse","DOWN","generateFormElements","selectedName","_id","activeName","$result","_appender","empty","insertAfter","idx","getFocusNode","getOption","optionName","option","searchRoot","idPrefix","ftnode","getRootNode","_hasFocus","_requestId","loadKeyPath","keyPathList","optsOrCallback","pathSegList","notifyWith","matchKey","charAt","_loadKeyPathImpl","nodeKey","remain","remainMap","tmpParent","segList","subDfd","__findChild","__lazyload","errMsg","rejectWith","reactivate","noFocus","selectAll","setOption","debugTime","time","debugTimeEnd","timeEnd","_trigger","_triggerTreeEvent","_visitRowsUp","nextIdx","siblings","siblingOfs","skipFirstNode","checkFilter","nodeClick","expand","targetType","focusOnSelect","nodeSetFocus","nodeCollapseSiblings","nodeDblclick","nodeKeydown","matchNode","stamp","which","String","fromCharCode","specialModifiers","altKey","ctrlKey","metaKey","isAlnum","$target","handled","autoActivate","lastQuicksearchTime","lastQuicksearchTerm","eventToString","nodeSetExpanded","nodeToggleSelected","nodeSetActive","nodeLoadChildren","delay","resultDfd","ajaxDfd","isAsync","nodePrevParent","tag","requestId","debugDelay","random","nodeSetStatus","textStatus","jqXHR","errorObj","postProcess","enableAspx","d","parseJSON","errorThrown","metaData","noDataRes","nodata","noData","ctxErr","nodeLoadKeyPath","nodeRemoveChild","subCtx","nodeRemoveChildren","nodeRemoveMarkup","nodeRemoveChildMarkup","li","nodeRenderStatus","nodeRender","collapsed","_recursive","childLI","childNode1","childNode2","aria","firstTime","successorLi","nextSibling","createElement","generateIds","appendChild","nodeRenderTitle","createNode","renderNode","$div","firstChild","nodeTitle","role","iconTooltip","ares","minExpandLevel","iconClass","_escapeTooltip","test","imagePath","escapeHtml","titlesTabbable","escapeTitles","enhanceTitle","$title","$ariaElem","isLastSib","cn","_classNames","cnList","focused","Boolean","lastsib","loading","_error","statusNodePrefix","combinedExpanderPrefix","combinedIconPrefix","noEvents","_getRejectedPromise","activeVisible","_afterLoad","prevAC","animating","lastChild","autoScroll","effect","toggleEffect","ctx2","isInput","calledByNode","uniqueId","activeElement","nodeSetSelected","_lastSelectIntent","lastSelectedNode","_clearStatusNode","_setStatusNode","loadError","nodeToggleExpanded","treeClear","treeCreate","treeDestroy","$source","treeInit","checkboxAutoHide","rtl","treeLoad","$ul","element","rootCtx","not","parseHtml","_getElementDataAsDict","treeRegisterNode","treeSetFocus","_lastMousedownNode","treeSetOption","callDefault","callCreate","callRender","_super","Widget","_setOption","treeStructureChanged","copyFunctionsToData","disabled","treeId","radio","_deprecationWarning","_create","extension","extName","base","_extensions","_simpleDeepMerge","_subclassObject","icons","tabbable","_init","_bind","_destroy","_unbind","ns","_ns","getNode","prevPhase","phase","et","getEventTarget","getTree","version","buildType","_nextId","_nextNodeKey","_FancytreeClass","_FancytreeNodeClass","jquerySupports","positionMyOfs","isVersionAtLeast","assert","cond","$tree","debounce","invokeAsap","fixPositionOptions","my","at","myParts","exec","atParts","dx","dy","tcn","getEventTargetType","orgEl","Element","HTMLDocument","nodeObject","treeOptions","defaultValue","treeOpt","nodeOpt","setSpanIcon","baseClass","$span","shiftKey","keyEventToString","overrideMethod","instance","methodName","handler","context","prevSuper","noop","classes","iPos","tmp","tmp2","$children","allData","lowerCaseAttr","$li","$liSpan","$liA","registerExtension","definition","unescapeHtml","childNodes","nodeValue","object","property","hasOwnProperty","method","dottedVersion","major","minor","t","verParts","testParts","copy","clone","_makeVirtualFunction","prevFunc","baseFunc","_superApply","proxy","prevLocal","prevSuperApply","attrName","argArray","json","uiFancytree","reMatch","unselectableIgnore","hideCheckbox","defaultKey","lazyload","loaderror","fx","removeNode","columns","systemFocusElement","viewport","ariaPropName","nodeContainerAttrName","fakeParent","class","appendTo","orig","uuid","widgetUuid","widgetSlice","cleanData","elems","events","_data","triggerHandler","existingConstructor","constructor","basePrototype","proxiedPrototype","namespace","fullName","expr","_createWidget","_proto","_childConstructors","isFunction","returnValue","__super","__superApply","widgetEventPrefix","widgetName","widgetFullName","childPrototype","bridge","inputIndex","inputLength","isMethodCall","methodValue","pushStack","defaultElement","create","eventNamespace","bindings","hoverable","focusable","classesElementLookup","_on","ownerDocument","defaultView","parentWindow","_getCreateOptions","_setOptionDisabled","_getCreateEventData","that","_removeClass","removeData","parts","curOption","_setOptions","_setOptionClasses","classKey","currentElements","_classes","keys","_toggleClass","full","processClassString","checkOption","current","unique","_untrackClassesElement","_addClass","suppressDisabledCheck","handlers","delegateElement","handlerProxy","guid","eventName","_off","_delay","_hoverable","mouseenter","mouseleave","_focusable","focusin","focusout","Event","isDefaultPrevented","defaultEffect","hasOptions","effectName","easing","cachedScrollbarWidth","rhorizontal","rvertical","roffset","rposition","rpercent","_position","position","getOffsets","offsets","parseFloat","parseCss","getDimensions","raw","left","isWindow","scrollLeft","pageY","pageX","outerWidth","outerHeight","scrollbarWidth","w1","w2","div","innerDiv","offsetWidth","clientWidth","getScrollInfo","within","overflowX","isDocument","hasOverflowX","scrollWidth","scrollHeight","getWithinInfo","withinElement","of","atOffset","targetWidth","targetHeight","targetOffset","basePosition","dimensions","scrollInfo","collision","horizontalOffset","verticalOffset","collisionPosition","using","elemWidth","elemHeight","marginLeft","marginTop","collisionWidth","collisionHeight","myOffset","props","right","feedback","horizontal","vertical","important","fit","newOverRight","withinOffset","collisionPosLeft","overLeft","overRight","newOverBottom","collisionPosTop","overTop","overBottom","flip","newOverLeft","offsetLeft","newOverTop","offsetTop","flipfit","COMMA","DELETE","ENTER","ESCAPE","PAGE_DOWN","PAGE_UP","PERIOD","SPACE","TAB","excludeStaticParent","overflowRegex","removeUniqueId","module","exports","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","Symbol","toStringTag","defineProperty","require"],"sourceRoot":""}
1
+ {"version":3,"file":"js/smush-admin.min.js","mappings":"mCAAAA,QAAO,SAAUC,GAChB,aAKGA,EAAE,QAAQC,GAAG,QAAS,yBAAyB,SAAUC,GAErD,GAAIF,EAAEG,MAAMC,KAAK,YACb,OAAO,EAIXF,EAAEG,iBAEF,IAAMC,EAAeN,EAAEG,MAAMI,KAAK,iBAClCP,EAAEG,MAAMK,UAAUC,GAAG,GAAGF,KAAK,wBAAwBG,cACrDJ,EAAaK,KAA4B,KAAvBL,EAAaK,OAAgB,IAAM,Y,uDCfvDC,EAAiB,SAAUC,EAAIC,QACb,IAAZA,IACVA,EAAU,KAEXD,EAAGE,OAAOD,EAAS,GAAG,WACrBD,EAAGG,QAAQF,GAAS,WACnBD,EAAGI,gBAKNlB,QAAO,SAAUC,GAQhB,IA8BMkB,EAAuB,SAC5BhB,EACAiB,EACAC,EACAC,GAGA,IAAIF,EAAcf,KAAK,YAAvB,CAIAF,EAAEG,iBAGFL,EAAE,mBAAmBiB,SAGrBjB,EAAE,wBAAwBsB,OAE1B,IAAIC,EAAO,OACP,wBAA0BH,IAE5BG,EADGvB,EAAEwB,UAAUjB,KAAK,8BAA8BkB,OAAS,GAI1DC,OAAOC,SAASC,OAAOC,QAAQ,SAAW,EAHpC,OAKH,QAKN,IAAMC,EAAS,CACdT,OAAQD,EACRW,cAAeZ,EAAca,KAAK,MAClCT,KAAAA,EACAU,OAAQd,EAAca,KAAK,WAlEP,SAAUE,GAC/B,IAAMC,EAASD,EAAUC,SAEzBA,EAAOC,IAAI,CAAEC,QAAS,QAEtBF,EAAO5B,KAAK,KAAKH,KAAK,YAAY,GAiElCkC,CAAcnB,GAEdA,EAAcoB,KACb,2CACCC,cAAcnB,GACd,WAIFrB,EAAEyC,KAAKC,QAASZ,GAAQ,SAAUa,IA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,OAAOA,EAAaJ,QAGrB,IAAID,EAASE,EAAyBE,GAAY,CAGjDH,QAAS,IAOV,OAHAK,EAAoBF,GAAUJ,EAAQA,EAAOC,QAASE,GAG/CH,EAAOC,QCpBfE,EAAoB71C,EAAI,SAAS21C,GACX,oBAAXM,QAA0BA,OAAOC,aAC1CrmC,OAAOsmC,eAAeR,EAASM,OAAOC,YAAa,CAAE9qC,MAAO,WAE7DyE,OAAOsmC,eAAeR,EAAS,aAAc,CAAEvqC,OAAO,K,wBCCvD,IAAMlG,EAAWA,GAAY,GAC7BnG,OAAOmG,SAAWA,EAYX+0B,OAAO/W,UAAU3M,WACvB0jB,OAAO/W,UAAU3M,SAAW,SAAUtX,EAAQgb,GAK7C,MAJsB,iBAAVA,IACXA,EAAQ,KAGJA,EAAQhb,EAAOH,OAAStB,KAAKsB,UAGQ,IAAnCtB,KAAK0B,QAASD,EAAQgb,KAI/Bm8B,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MAaTA,EAAS,K","sources":["webpack://wp-smushit/./_src/js/modules/admin-common.js","webpack://wp-smushit/./_src/js/modules/admin.js","webpack://wp-smushit/./_src/js/modules/bulk-restore.js","webpack://wp-smushit/./_src/js/modules/bulk-smush.js","webpack://wp-smushit/./_src/js/modules/directory-smush.js","webpack://wp-smushit/./_src/js/smush/directory-scanner.js","webpack://wp-smushit/./_src/js/modules/helpers.js","webpack://wp-smushit/./_src/js/modules/notice.js","webpack://wp-smushit/./_src/js/modules/onboarding.js","webpack://wp-smushit/./_src/js/smush/cdn.js","webpack://wp-smushit/./_src/js/smush/lazy-load.js","webpack://wp-smushit/./_src/js/smush/settings.js","webpack://wp-smushit/./_src/js/smush/smush.js","webpack://wp-smushit/./_src/js/smush/webp.js","webpack://wp-smushit/./node_modules/jquery.fancytree/dist/modules/jquery.fancytree.js","webpack://wp-smushit/./node_modules/jquery.fancytree/dist/modules/jquery.fancytree.ui-deps.js","webpack://wp-smushit/external var \"jQuery\"","webpack://wp-smushit/webpack/bootstrap","webpack://wp-smushit/webpack/runtime/make namespace object","webpack://wp-smushit/./_src/js/app.js"],"sourcesContent":["jQuery(function ($) {\n\t'use strict';\n\n /**\n\t * Handle the Smush Stats link click\n\t */\n $('body').on('click', 'a.smush-stats-details', function (e) {\n //If disabled\n if ($(this).prop('disabled')) {\n return false;\n }\n\n // prevent the default action\n e.preventDefault();\n //Replace the `+` with a `-`\n const slide_symbol = $(this).find('.stats-toggle');\n $(this).parents().eq(1).find('.smush-stats-wrapper').slideToggle();\n slide_symbol.text(slide_symbol.text() == '+' ? '-' : '+');\n });\n});","import Smush from '../smush/smush';\n\nconst remove_element = function (el, timeout) {\n\tif (typeof timeout === 'undefined') {\n\t\ttimeout = 100;\n\t}\n\tel.fadeTo(timeout, 0, function () {\n\t\tel.slideUp(timeout, function () {\n\t\t\tel.remove();\n\t\t});\n\t});\n};\n\njQuery(function ($) {\n\t'use strict';\n\n\t/**\n\t * Disable the action links *\n\t *\n\t * @param c_element\n\t */\n\tconst disable_links = function (c_element) {\n\t\tconst parent = c_element.parent();\n\t\t//reduce parent opacity\n\t\tparent.css({ opacity: '0.5' });\n\t\t//Disable Links\n\t\tparent.find('a').prop('disabled', true);\n\t};\n\n\t/**\n\t * Enable the Action Links *\n\t *\n\t * @param c_element\n\t */\n\tconst enable_links = function (c_element) {\n\t\tconst parent = c_element.parent();\n\n\t\t//reduce parent opacity\n\t\tparent.css({ opacity: '1' });\n\t\t//Disable Links\n\t\tparent.find('a').prop('disabled', false);\n\t};\n\n\t/**\n\t * Restore image request with a specified action for Media Library / NextGen Gallery\n\t *\n\t * @param {Object} e\n\t * @param {string} currentButton\n\t * @param {string} smushAction\n\t * @param {string} action\n\t */\n\tconst process_smush_action = function (\n\t\te,\n\t\tcurrentButton,\n\t\tsmushAction,\n\t\taction\n\t) {\n\t\t// If disabled.\n\t\tif (currentButton.prop('disabled')) {\n\t\t\treturn;\n\t\t}\n\n\t\te.preventDefault();\n\n\t\t// Remove Error.\n\t\t$('.wp-smush-error').remove();\n\n\t\t// Hide stats.\n\t\t$('.smush-stats-wrapper').hide();\n\n\t\tlet mode = 'grid';\n\t\tif ('smush_restore_image' === smushAction) {\n\t\t\tif ($(document).find('div.media-modal.wp-core-ui').length > 0) {\n\t\t\t\tmode = 'grid';\n\t\t\t} else {\n\t\t\t\tmode =\n\t\t\t\t\twindow.location.search.indexOf('item') > -1\n\t\t\t\t\t\t? 'grid'\n\t\t\t\t\t\t: 'list';\n\t\t\t}\n\t\t}\n\n\t\t// Get the image ID and nonce.\n\t\tconst params = {\n\t\t\taction: smushAction,\n\t\t\tattachment_id: currentButton.data('id'),\n\t\t\tmode,\n\t\t\t_nonce: currentButton.data('nonce'),\n\t\t};\n\n\t\t// Reduce the opacity of stats and disable the click.\n\t\tdisable_links(currentButton);\n\n\t\tcurrentButton.html(\n\t\t\t'<span class=\"spinner wp-smush-progress\">' +\n\t\t\t\twp_smush_msgs[action] +\n\t\t\t\t'</span>'\n\t\t);\n\n\t\t// Restore the image.\n\t\t$.post(ajaxurl, params, function (r) {\n\t\t\t// Reset all functionality.\n\t\t\tenable_links(currentButton);\n\n\t\t\tif (r.success && 'undefined' !== typeof r.data) {\n\t\t\t\t// Replace in immediate parent for NextGEN.\n\t\t\t\tif (\n\t\t\t\t\t'undefined' !== typeof this.data &&\n\t\t\t\t\tthis.data.indexOf('nextgen') > -1\n\t\t\t\t) {\n\t\t\t\t\t// Show the smush button, and remove stats and restore option.\n\t\t\t\t\tcurrentButton.parents().eq(1).html(r.data.stats);\n\t\t\t\t} else if ('restore' === action) {\n\t\t\t\t\t// Show the smush button, and remove stats and restore option.\n\t\t\t\t\tcurrentButton.parents().eq(1).html(r.data.stats);\n\t\t\t\t} else {\n\t\t\t\t\tcurrentButton.parents().eq(1).html(r.data);\n\t\t\t\t}\n\n\t\t\t\tif ('undefined' !== typeof r.data && 'restore' === action) {\n\t\t\t\t\tSmush.updateImageStats(r.data.new_size);\n\t\t\t\t}\n\t\t\t} else if (r.data && r.data.error_msg) {\n\t\t\t\tif (\n\t\t\t\t\t-1 === this.data.indexOf('nextgen') &&\n\t\t\t\t\t'restore' === action\n\t\t\t\t) {\n\t\t\t\t\t$('.smush-status').addClass('error').html(r.data.error_msg);\n\t\t\t\t} else {\n\t\t\t\t\t// Show error.\n\t\t\t\t\tcurrentButton.parent().append(r.data.error_msg);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t};\n\n\t/**\n\t * Validates the Resize Width and Height against the Largest Thumbnail Width and Height\n\t *\n\t * @param wrapper_div jQuery object for the whole setting row wrapper div\n\t * @param width_only Whether to validate only width\n\t * @param height_only Validate only Height\n\t * @return {boolean} All Good or not\n\t */\n\tconst validate_resize_settings = function (\n\t\twrapper_div,\n\t\twidth_only,\n\t\theight_only\n\t) {\n\t\tconst resize_checkbox = wrapper_div.find('#resize');\n\n\t\tif (!height_only) {\n\t\t\tvar width_input = wrapper_div.find('#wp-smush-resize_width');\n\t\t\tvar width_error_note = wrapper_div.find(\n\t\t\t\t'.sui-notice-info.wp-smush-update-width'\n\t\t\t);\n\t\t}\n\t\tif (!width_only) {\n\t\t\tvar height_input = wrapper_div.find('#wp-smush-resize_height');\n\t\t\tvar height_error_note = wrapper_div.find(\n\t\t\t\t'.sui-notice-info.wp-smush-update-height'\n\t\t\t);\n\t\t}\n\n\t\tlet width_error = false;\n\t\tlet height_error = false;\n\n\t\t//If resize settings is not enabled, return true\n\t\tif (!resize_checkbox.is(':checked')) {\n\t\t\treturn true;\n\t\t}\n\n\t\t//Check if we have localised width and height\n\t\tif (\n\t\t\t'undefined' === typeof wp_smushit_data.resize_sizes ||\n\t\t\t'undefined' === typeof wp_smushit_data.resize_sizes.width\n\t\t) {\n\t\t\t//Rely on server validation\n\t\t\treturn true;\n\t\t}\n\n\t\t//Check for width\n\t\tif (\n\t\t\t!height_only &&\n\t\t\t'undefined' !== typeof width_input &&\n\t\t\tparseInt(wp_smushit_data.resize_sizes.width) >\n\t\t\t\tparseInt(width_input.val())\n\t\t) {\n\t\t\twidth_input.parent().addClass('sui-form-field-error');\n\t\t\twidth_error_note.show('slow');\n\t\t\twidth_error = true;\n\t\t} else {\n\t\t\t//Remove error class\n\t\t\twidth_input.parent().removeClass('sui-form-field-error');\n\t\t\twidth_error_note.hide();\n\t\t\tif (height_input.hasClass('error')) {\n\t\t\t\theight_error_note.show('slow');\n\t\t\t}\n\t\t}\n\n\t\t//Check for height\n\t\tif (\n\t\t\t!width_only &&\n\t\t\t'undefined' !== typeof height_input &&\n\t\t\tparseInt(wp_smushit_data.resize_sizes.height) >\n\t\t\t\tparseInt(height_input.val())\n\t\t) {\n\t\t\theight_input.parent().addClass('sui-form-field-error');\n\t\t\t//If we are not showing the width error already\n\t\t\tif (!width_error) {\n\t\t\t\theight_error_note.show('slow');\n\t\t\t}\n\t\t\theight_error = true;\n\t\t} else {\n\t\t\t//Remove error class\n\t\t\theight_input.parent().removeClass('sui-form-field-error');\n\t\t\theight_error_note.hide();\n\t\t\tif (width_input.hasClass('error')) {\n\t\t\t\twidth_error_note.show('slow');\n\t\t\t}\n\t\t}\n\n\t\tif (width_error || height_error) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t};\n\n\t/**\n\t * Update the progress bar width if we have images that needs to be resmushed\n\t *\n\t * @param unsmushed_count\n\t * @return {boolean}\n\t */\n\tconst update_progress_bar_resmush = function (unsmushed_count) {\n\t\tif ('undefined' === typeof unsmushed_count) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst smushed_count = wp_smushit_data.count_total - unsmushed_count;\n\n\t\t//Update the Progress Bar Width\n\t\t// get the progress bar\n\t\tconst $progress_bar = jQuery(\n\t\t\t'.bulk-smush-wrapper .wp-smush-progress-inner'\n\t\t);\n\t\tif ($progress_bar.length < 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst width = (smushed_count / wp_smushit_data.count_total) * 100;\n\n\t\t// increase progress\n\t\t$progress_bar.css('width', width + '%');\n\t};\n\n\tconst runRecheck = function (process_settings) {\n\t\tconst button = $('.wp-smush-scan');\n\n\t\t// Add a \"loading\" state to the button.\n\t\tbutton.addClass('sui-button-onload');\n\n\t\t// Check if type is set in data attributes.\n\t\tlet scan_type = button.data('type');\n\t\tscan_type = 'undefined' === typeof scan_type ? 'media' : scan_type;\n\n\t\t// Remove the Skip resmush attribute from button.\n\t\t$('.wp-smush-all').removeAttr('data-smush');\n\n\t\t// Remove notices.\n\t\tconst notices = $('.sui-notice-top.sui-notice-success');\n\t\tnotices.slideUp(100, function () {\n\t\t\tnotices.remove();\n\t\t});\n\n\t\t// Disable Bulk smush button and itself.\n\t\t$('.wp-smush-all').prop('disabled', true);\n\n\t\t// Hide Settings changed Notice.\n\t\t$('.wp-smush-settings-changed').hide();\n\n\t\t// Ajax params.\n\t\tconst params = {\n\t\t\taction: 'scan_for_resmush',\n\t\t\ttype: scan_type,\n\t\t\tget_ui: true,\n\t\t\tprocess_settings,\n\t\t\twp_smush_options_nonce: jQuery('#wp_smush_options_nonce').val(),\n\t\t};\n\n\t\t// Send ajax request and get ids if any.\n\t\t$.get(ajaxurl, params, function (r) {\n\t\t\t// Check if we have the ids, initialize the local variable.\n\t\t\tif ('undefined' !== typeof r.data) {\n\t\t\t\t// Update Resmush id list.\n\t\t\t\tif ('undefined' !== typeof r.data.resmush_ids) {\n\t\t\t\t\twp_smushit_data.resmush = r.data.resmush_ids;\n\n\t\t\t\t\t// Update wp_smushit_data ( Smushed count, Smushed Percent, Image count, Super smush count, resize savings, conversion savings ).\n\t\t\t\t\tif ('undefined' !== typeof wp_smushit_data) {\n\t\t\t\t\t\twp_smushit_data.count_smushed =\n\t\t\t\t\t\t\t'undefined' !== typeof r.data.count_smushed\n\t\t\t\t\t\t\t\t? r.data.count_smushed\n\t\t\t\t\t\t\t\t: wp_smushit_data.count_smushed;\n\t\t\t\t\t\twp_smushit_data.count_supersmushed =\n\t\t\t\t\t\t\t'undefined' !== typeof r.data.count_supersmushed\n\t\t\t\t\t\t\t\t? r.data.count_supersmushed\n\t\t\t\t\t\t\t\t: wp_smushit_data.count_supersmushed;\n\t\t\t\t\t\twp_smushit_data.count_images =\n\t\t\t\t\t\t\t'undefined' !== typeof r.data.count_image\n\t\t\t\t\t\t\t\t? r.data.count_image\n\t\t\t\t\t\t\t\t: wp_smushit_data.count_images;\n\t\t\t\t\t\twp_smushit_data.size_before =\n\t\t\t\t\t\t\t'undefined' !== typeof r.data.size_before\n\t\t\t\t\t\t\t\t? r.data.size_before\n\t\t\t\t\t\t\t\t: wp_smushit_data.size_before;\n\t\t\t\t\t\twp_smushit_data.size_after =\n\t\t\t\t\t\t\t'undefined' !== typeof r.data.size_after\n\t\t\t\t\t\t\t\t? r.data.size_after\n\t\t\t\t\t\t\t\t: wp_smushit_data.size_after;\n\t\t\t\t\t\twp_smushit_data.savings_resize =\n\t\t\t\t\t\t\t'undefined' !== typeof r.data.savings_resize\n\t\t\t\t\t\t\t\t? r.data.savings_resize\n\t\t\t\t\t\t\t\t: wp_smushit_data.savings_resize;\n\t\t\t\t\t\twp_smushit_data.savings_conversion =\n\t\t\t\t\t\t\t'undefined' !== typeof r.data.savings_conversion\n\t\t\t\t\t\t\t\t? r.data.savings_conversion\n\t\t\t\t\t\t\t\t: wp_smushit_data.savings_conversion;\n\t\t\t\t\t\twp_smushit_data.count_resize =\n\t\t\t\t\t\t\t'undefined' !== typeof r.data.count_resize\n\t\t\t\t\t\t\t\t? r.data.count_resize\n\t\t\t\t\t\t\t\t: wp_smushit_data.count_resize;\n\t\t\t\t\t\twp_smushit_data.unsmushed =\n\t\t\t\t\t\t\t'undefined' !== typeof r.data.unsmushed\n\t\t\t\t\t\t\t\t? r.data.unsmushed\n\t\t\t\t\t\t\t\t: wp_smushit_data.unsmushed;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ('nextgen' === scan_type) {\n\t\t\t\t\t\twp_smushit_data.bytes =\n\t\t\t\t\t\t\tparseInt(wp_smushit_data.size_before) -\n\t\t\t\t\t\t\tparseInt(wp_smushit_data.size_after);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Hide the Existing wrapper.\n\t\t\t\t\tconst notices = $(\n\t\t\t\t\t\t'.bulk-smush-wrapper .sui-notice:not(.smush-upsell-notice)'\n\t\t\t\t\t);\n\t\t\t\t\tif (notices.length > 0) {\n\t\t\t\t\t\tnotices.addClass('sui-hidden');\n\t\t\t\t\t\t$('.wp-smush-pagespeed-recommendation').addClass(\n\t\t\t\t\t\t\t'sui-hidden'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t// Remove existing Re-Smush notices.\n\t\t\t\t\t$('.wp-smush-resmush-notice').remove();\n\n\t\t\t\t\t// Show Bulk wrapper.\n\t\t\t\t\t$('.wp-smush-bulk-wrapper').removeClass('sui-hidden');\n\t\t\t\t}\n\t\t\t\t// If content is received, Prepend it.\n\t\t\t\tif ('undefined' !== typeof r.data.content) {\n\t\t\t\t\t$('#wp-smush-bulk-content').html(r.data.content);\n\t\t\t\t}\n\t\t\t\t// If we have any notice to show.\n\t\t\t\tif ('undefined' !== typeof r.data.notice) {\n\t\t\t\t\tlet type = 'success';\n\t\t\t\t\tif ('undefined' !== typeof r.data.noticeType) {\n\t\t\t\t\t\ttype = r.data.noticeType;\n\t\t\t\t\t}\n\t\t\t\t\twindow.SUI.openNotice(\n\t\t\t\t\t\t'wp-smush-ajax-notice',\n\t\t\t\t\t\t'<p>' + r.data.notice + '</p>',\n\t\t\t\t\t\t{ type, icon: 'check-tick' }\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// Hide errors.\n\t\t\t\t$('div.smush-final-log').hide();\n\n\t\t\t\t// Hide Super Smush notice if it's enabled in media settings.\n\t\t\t\tif (\n\t\t\t\t\t'undefined' !== typeof r.data.super_smush &&\n\t\t\t\t\tr.data.super_smush &&\n\t\t\t\t\t'undefined' !== r.data.super_smush_stat\n\t\t\t\t) {\n\t\t\t\t\t$('.super-smush-attachments .wp-smush-stats').html(\n\t\t\t\t\t\tr.data.super_smush_stats\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tSmush.updateStats(scan_type);\n\n\t\t\t\tconst remainingCount = r.data.count || 0;\n\t\t\t\tSmush.updateRemainingCount(remainingCount);\n\t\t\t\tupdateDisplayedContentAfterReCheck(remainingCount);\n\t\t\t}\n\t\t}).always(function () {\n\t\t\t// Hide the progress bar.\n\t\t\tjQuery(\n\t\t\t\t'.bulk-smush-wrapper .wp-smush-bulk-progress-bar-wrapper'\n\t\t\t).addClass('sui-hidden');\n\n\t\t\t// Add check complete status to button.\n\t\t\tbutton\n\t\t\t\t.removeClass('sui-button-onload')\n\t\t\t\t.addClass('smush-button-check-success');\n\n\t\t\tconst $defaultText = button.find('.wp-smush-default-text'),\n\t\t\t\t$completedText = button.find('.wp-smush-completed-text');\n\n\t\t\t$defaultText.addClass('sui-hidden-important');\n\t\t\t$completedText.removeClass('sui-hidden');\n\n\t\t\t// Remove success message from button.\n\t\t\tsetTimeout(function () {\n\t\t\t\tbutton.removeClass('smush-button-check-success');\n\n\t\t\t\t$defaultText.removeClass('sui-hidden-important');\n\t\t\t\t$completedText.addClass('sui-hidden');\n\t\t\t}, 2000);\n\n\t\t\t$('.wp-smush-all').prop('disabled', false);\n\t\t});\n\t};\n\n\tconst updateDisplayedContentAfterReCheck = function (count) {\n\t\tconst $pendingImagesWrappers = jQuery(\n\t\t\t'.bulk-smush-wrapper .wp-smush-bulk-wrapper, #wp-smush-pending-to-smush-text'\n\t\t);\n\t\tconst $allDoneWrappers = jQuery(\n\t\t\t'.bulk-smush-wrapper .wp-smush-all-done, .bulk-smush-wrapper .wp-smush-pagespeed-recommendation, #smush-box-bulk-upgrade, #wp-smush-all-smushed-text'\n\t\t);\n\n\t\tif ($pendingImagesWrappers.length && $allDoneWrappers.length) {\n\t\t\tif (count === 0) {\n\t\t\t\t$pendingImagesWrappers.addClass('sui-hidden');\n\t\t\t\t$allDoneWrappers.removeClass('sui-hidden');\n\t\t\t} else {\n\t\t\t\t$pendingImagesWrappers.removeClass('sui-hidden');\n\t\t\t\t$allDoneWrappers.addClass('sui-hidden');\n\n\t\t\t\t// Update texts mentioning the amount of unsmushed imagesin the summary icon tooltip.\n\t\t\t\tconst $unsmushedTooltip = jQuery(\n\t\t\t\t\t'.sui-summary-smush .sui-summary-details .sui-tooltip'\n\t\t\t\t);\n\n\t\t\t\t// The tooltip doesn't exist in the NextGen page.\n\t\t\t\tif ($unsmushedTooltip.length) {\n\t\t\t\t\tconst textForm = 1 === count ? 'singular' : 'plural',\n\t\t\t\t\t\ttooltipText = $unsmushedTooltip\n\t\t\t\t\t\t\t.data(textForm)\n\t\t\t\t\t\t\t.replace('{count}', count);\n\t\t\t\t\t$unsmushedTooltip.attr('data-tooltip', tooltipText);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Total count in the progress bar.\n\t\tjQuery('.wp-smush-total-count').text(count);\n\t};\n\n\t// Scroll the element to top of the page.\n\tconst goToByScroll = function (selector) {\n\t\t// Scroll if element found.\n\t\tif ($(selector).length > 0) {\n\t\t\t$('html, body').animate(\n\t\t\t\t{\n\t\t\t\t\tscrollTop: $(selector).offset().top - 100,\n\t\t\t\t},\n\t\t\t\t'slow'\n\t\t\t);\n\t\t}\n\t};\n\n\tconst update_cummulative_stats = function (stats) {\n\t\t//Update Directory Smush Stats\n\t\tif ('undefined' !== typeof stats.dir_smush) {\n\t\t\tconst stats_human = $(\n\t\t\t\t'li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-human'\n\t\t\t);\n\t\t\tconst stats_percent = $(\n\t\t\t\t'li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-percent'\n\t\t\t);\n\n\t\t\t// Do not replace if 0 savings.\n\t\t\tif (stats.dir_smush.bytes > 0) {\n\t\t\t\t$('.wp-smush-dir-link').addClass('sui-hidden');\n\n\t\t\t\t// Hide selector.\n\t\t\t\t$('li.smush-dir-savings .wp-smush-stats-label-message').hide();\n\t\t\t\t//Update Savings in bytes\n\t\t\t\tif (stats_human.length > 0) {\n\t\t\t\t\tstats_human.html(stats.dir_smush.human);\n\t\t\t\t} else {\n\t\t\t\t\tvar span =\n\t\t\t\t\t\t'<span class=\"wp-smush-stats-human\">' +\n\t\t\t\t\t\tstats.dir_smush.bytes +\n\t\t\t\t\t\t'</span>';\n\t\t\t\t}\n\n\t\t\t\t//Percentage section\n\t\t\t\tif (stats.dir_smush.percent > 0) {\n\t\t\t\t\t// Show size and percentage separator.\n\t\t\t\t\t$(\n\t\t\t\t\t\t'li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-sep'\n\t\t\t\t\t).removeClass('sui-hidden');\n\t\t\t\t\t//Update Optimisation percentage\n\t\t\t\t\tif (stats_percent.length > 0) {\n\t\t\t\t\t\tstats_percent.html(stats.dir_smush.percent + '%');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar span =\n\t\t\t\t\t\t\t'<span class=\"wp-smush-stats-percent\">' +\n\t\t\t\t\t\t\tstats.dir_smush.percent +\n\t\t\t\t\t\t\t'%' +\n\t\t\t\t\t\t\t'</span>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$('.wp-smush-dir-link').removeClass('sui-hidden');\n\t\t\t}\n\t\t}\n\n\t\t//Update Combined stats\n\t\tif (\n\t\t\t'undefined' !== typeof stats.combined_stats &&\n\t\t\tstats.combined_stats.length > 0\n\t\t) {\n\t\t\tconst c_stats = stats.combined_stats;\n\n\t\t\tlet smush_percent = (c_stats.smushed / c_stats.total_count) * 100;\n\t\t\tsmush_percent = WP_Smush.helpers.precise_round(smush_percent, 1);\n\n\t\t\t//Smushed Percent\n\t\t\tif (smush_percent) {\n\t\t\t\t$('div.wp-smush-count-total span.wp-smush-images-percent').html(\n\t\t\t\t\tsmush_percent\n\t\t\t\t);\n\t\t\t}\n\t\t\t//Update Total Attachment Count\n\t\t\tif (c_stats.total_count) {\n\t\t\t\t$(\n\t\t\t\t\t'span.wp-smush-count-total span.wp-smush-total-optimised'\n\t\t\t\t).html(c_stats.total_count);\n\t\t\t}\n\t\t\t//Update Savings and Percent\n\t\t\tif (c_stats.savings) {\n\t\t\t\t$('span.wp-smush-savings span.wp-smush-stats-human').html(\n\t\t\t\t\tc_stats.savings\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (c_stats.percent) {\n\t\t\t\t$('span.wp-smush-savings span.wp-smush-stats-percent').html(\n\t\t\t\t\tc_stats.percent\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * When 'All' is selected for the Image Sizes setting, select all available sizes.\n\t *\n\t * @since 3.2.1\n\t */\n\t$('#all-image-sizes').on('change', function () {\n\t\t$('input[name^=\"wp-smush-image_sizes\"]').prop('checked', true);\n\t});\n\n\t/**\n\t * Handles the tabs navigation on mobile.\n\t *\n\t * @since 3.8.4\n\t */\n\t$('.sui-mobile-nav').on('change', (e) => {\n\t\twindow.location.assign($(e.currentTarget).val());\n\t});\n\n\t/**\n\t * Handle re-check api status button click (Settings)\n\t *\n\t * @since 3.2.0.2\n\t */\n\t$('#update-api-status').on('click', function (e) {\n\t\te.preventDefault();\n\n\t\t//$(this).prop('disabled', true);\n\t\t$(this).addClass('sui-button-onload');\n\n\t\t$.post(ajaxurl, { action: 'recheck_api_status' }, function () {\n\t\t\tlocation.reload();\n\t\t});\n\t});\n\n\t/** Handle smush button click **/\n\t$('body').on(\n\t\t'click',\n\t\t'.wp-smush-send:not(.wp-smush-resmush)',\n\t\tfunction (e) {\n\t\t\t// prevent the default action\n\t\t\te.preventDefault();\n\t\t\tnew Smush($(this), false);\n\t\t}\n\t);\n\n\t/** Handle show in bulk smush button click **/\n\t$('body').on('click', '.wp-smush-remove-skipped', function (e) {\n\t\te.preventDefault();\n\n\t\tconst self = $(this);\n\n\t\t// Send Ajax request to remove the image from the skip list.\n\t\t$.post(ajaxurl, {\n\t\t\taction: 'remove_from_skip_list',\n\t\t\tid: self.attr('data-id'),\n\t\t}).done((response) => {\n\t\t\tif (\n\t\t\t\tresponse.success &&\n\t\t\t\t'undefined' !== typeof response.data.links\n\t\t\t) {\n\t\t\t\tself.parent()\n\t\t\t\t\t.parent()\n\t\t\t\t\t.find('.smush-status')\n\t\t\t\t\t.text(wp_smush_msgs.not_processed);\n\t\t\t\te.target.closest('.smush-status-links').innerHTML =\n\t\t\t\t\tresponse.data.links;\n\t\t\t}\n\t\t});\n\t});\n\n\t/** Handle NextGen Gallery smush button click **/\n\t$('body').on('click', '.wp-smush-nextgen-send', function (e) {\n\t\t// prevent the default action\n\t\te.preventDefault();\n\t\tnew Smush($(this), false, 'nextgen');\n\t});\n\n\t/** Handle NextGen Gallery Bulk smush button click **/\n\t$('body').on('click', '.wp-smush-nextgen-bulk', function (e) {\n\t\t// prevent the default action\n\t\te.preventDefault();\n\n\t\t// Remove existing Re-Smush notices.\n\t\t$('.wp-smush-resmush-notice').remove();\n\n\t\t//Check for ids, if there is none (Unsmushed or lossless), don't call smush function\n\t\tif (\n\t\t\t'undefined' === typeof wp_smushit_data ||\n\t\t\t(wp_smushit_data.unsmushed.length === 0 &&\n\t\t\t\twp_smushit_data.resmush.length === 0)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tjQuery('.wp-smush-all, .wp-smush-scan').prop('disabled', true);\n\t\t$('.wp-smush-notice.wp-smush-remaining').hide();\n\t\tnew Smush($(this), true, 'nextgen');\n\t});\n\n\t/** Restore: Media Library **/\n\t$('body').on('click', '.wp-smush-action.wp-smush-restore', function (e) {\n\t\tconst current_button = $(this);\n\t\tprocess_smush_action(\n\t\t\te,\n\t\t\tcurrent_button,\n\t\t\t'smush_restore_image',\n\t\t\t'restore'\n\t\t);\n\t});\n\n\t/** Resmush: Media Library **/\n\t$('body').on('click', '.wp-smush-action.wp-smush-resmush', function (e) {\n\t\tprocess_smush_action(e, $(this), 'smush_resmush_image', 'smushing');\n\t});\n\n\t/** Restore: NextGen Gallery **/\n\t$('body').on(\n\t\t'click',\n\t\t'.wp-smush-action.wp-smush-nextgen-restore',\n\t\tfunction (e) {\n\t\t\tprocess_smush_action(\n\t\t\t\te,\n\t\t\t\t$(this),\n\t\t\t\t'smush_restore_nextgen_image',\n\t\t\t\t'restore'\n\t\t\t);\n\t\t}\n\t);\n\n\t/** Resmush: NextGen Gallery **/\n\t$('body').on(\n\t\t'click',\n\t\t'.wp-smush-action.wp-smush-nextgen-resmush',\n\t\tfunction (e) {\n\t\t\tprocess_smush_action(\n\t\t\t\te,\n\t\t\t\t$(this),\n\t\t\t\t'smush_resmush_nextgen_image',\n\t\t\t\t'smushing'\n\t\t\t);\n\t\t}\n\t);\n\n\t//Scan For resmushing images\n\t$('.wp-smush-scan').on('click', function (e) {\n\t\te.preventDefault();\n\t\trunRecheck(false);\n\t});\n\n\t//Dismiss Welcome notice\n\t//@todo: Use it for popup\n\t$('#wp-smush-welcome-box .smush-dismiss-welcome').on('click', function (e) {\n\t\te.preventDefault();\n\t\tconst $el = $(this).parents().eq(1);\n\t\tremove_element($el);\n\n\t\t//Send a ajax request to save the dismissed notice option\n\t\tconst param = {\n\t\t\taction: 'dismiss_welcome_notice',\n\t\t};\n\t\t$.post(ajaxurl, param);\n\t});\n\n\t//Remove Notice\n\t$('body').on('click', '.wp-smush-notice .icon-fi-close', function (e) {\n\t\te.preventDefault();\n\t\tconst $el = $(this).parent();\n\t\tremove_element($el);\n\t});\n\n\t// On re-Smush click.\n\t$('body').on('click', '.wp-smush-skip-resmush', function (e) {\n\t\te.preventDefault();\n\n\t\tconst self = jQuery(this),\n\t\t\tcontainer = self.parents().eq(1),\n\t\t\tel = self.parent();\n\n\t\t// Remove Parent div.\n\t\tremove_element(el);\n\n\t\t// Remove Settings Notice.\n\t\t$('.sui-notice-top.sui-notice-success').remove();\n\n\t\t// Set button attribute to skip re-smush ids.\n\t\tcontainer.find('.wp-smush-all').attr('data-smush', 'skip_resmush');\n\n\t\t// Update Smushed count.\n\t\twp_smushit_data.count_smushed =\n\t\t\tparseInt(wp_smushit_data.count_smushed) +\n\t\t\twp_smushit_data.resmush.length;\n\t\twp_smushit_data.count_supersmushed =\n\t\t\tparseInt(wp_smushit_data.count_supersmushed) +\n\t\t\twp_smushit_data.resmush.length;\n\n\t\t// Update stats.\n\t\tif (wp_smushit_data.count_smushed === wp_smushit_data.count_total) {\n\t\t\t// Show all done notice.\n\t\t\t$(\n\t\t\t\t'.wp-smush-notice.wp-smush-all-done, .wp-smush-pagespeed-recommendation'\n\t\t\t).removeClass('sui-hidden');\n\n\t\t\t// Hide Smush button.\n\t\t\t$('.wp-smush-bulk-wrapper ').addClass('sui-hidden');\n\t\t}\n\n\t\t// Remove re-Smush notice.\n\t\t$('.wp-smush-resmush-notice').remove();\n\n\t\tlet type = $('.wp-smush-scan').data('type');\n\t\ttype = 'undefined' === typeof type ? 'media' : type;\n\n\t\tconst smushed_count =\n\t\t\t'undefined' !== typeof wp_smushit_data.count_smushed\n\t\t\t\t? wp_smushit_data.count_smushed\n\t\t\t\t: 0;\n\n\t\tlet smush_percent = (smushed_count / wp_smushit_data.count_total) * 100;\n\t\tsmush_percent = WP_Smush.helpers.precise_round(smush_percent, 1);\n\n\t\t$('.wp-smush-images-percent').html(smush_percent);\n\n\t\t// Update the progress bar width. Get the progress bar.\n\t\tconst progress_bar = jQuery(\n\t\t\t'.bulk-smush-wrapper .wp-smush-progress-inner'\n\t\t);\n\t\tif (progress_bar.length < 1) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Increase progress.\n\t\tprogress_bar.css('width', smush_percent + '%');\n\n\t\t// Show the default bulk smush notice.\n\t\t$('.wp-smush-bulk-wrapper').removeClass('sui-hidden');\n\t\t$('.wp-smush-bulk-wrapper .sui-notice').removeClass('sui-hidden');\n\n\t\tconst params = {\n\t\t\taction: 'delete_resmush_list',\n\t\t\ttype,\n\t\t};\n\n\t\t//Delete resmush list, @todo: update stats from the ajax response\n\t\t$.post(ajaxurl, params, function (res) {\n\t\t\t// Remove the whole li element on success\n\t\t\tif (res.success && 'undefined' !== typeof res.data.stats) {\n\t\t\t\tconst stats = res.data.stats;\n\t\t\t\t// Update wp_smushit_data ( Smushed count, Smushed Percent, Image count, Super smush count, resize savings, conversion savings )\n\t\t\t\tif ('undefined' !== typeof wp_smushit_data) {\n\t\t\t\t\twp_smushit_data.count_images =\n\t\t\t\t\t\t'undefined' !== typeof stats.count_images\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.count_images) +\n\t\t\t\t\t\t\t stats.count_images\n\t\t\t\t\t\t\t: wp_smushit_data.count_images;\n\t\t\t\t\twp_smushit_data.size_before =\n\t\t\t\t\t\t'undefined' !== typeof stats.size_before\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.size_before) +\n\t\t\t\t\t\t\t stats.size_before\n\t\t\t\t\t\t\t: wp_smushit_data.size_before;\n\t\t\t\t\twp_smushit_data.size_after =\n\t\t\t\t\t\t'undefined' !== typeof stats.size_after\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.size_after) +\n\t\t\t\t\t\t\t stats.size_after\n\t\t\t\t\t\t\t: wp_smushit_data.size_after;\n\t\t\t\t\twp_smushit_data.savings_resize =\n\t\t\t\t\t\t'undefined' !== typeof stats.savings_resize\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.savings_resize) +\n\t\t\t\t\t\t\t stats.savings_resize\n\t\t\t\t\t\t\t: wp_smushit_data.savings_resize;\n\t\t\t\t\twp_smushit_data.savings_conversion =\n\t\t\t\t\t\t'undefined' !== typeof stats.savings_conversion\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.savings_conversion) +\n\t\t\t\t\t\t\t stats.savings_conversion\n\t\t\t\t\t\t\t: wp_smushit_data.savings_conversion;\n\n\t\t\t\t\t// Add directory smush stats.\n\t\t\t\t\tif (\n\t\t\t\t\t\t'undefined' !==\n\t\t\t\t\t\t\ttypeof wp_smushit_data.savings_dir_smush &&\n\t\t\t\t\t\t'undefined' !==\n\t\t\t\t\t\t\ttypeof wp_smushit_data.savings_dir_smush.orig_size\n\t\t\t\t\t) {\n\t\t\t\t\t\twp_smushit_data.size_before =\n\t\t\t\t\t\t\t'undefined' !==\n\t\t\t\t\t\t\ttypeof wp_smushit_data.savings_dir_smush\n\t\t\t\t\t\t\t\t? parseInt(wp_smushit_data.size_before) +\n\t\t\t\t\t\t\t\t parseInt(\n\t\t\t\t\t\t\t\t\t\twp_smushit_data.savings_dir_smush\n\t\t\t\t\t\t\t\t\t\t\t.orig_size\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: wp_smushit_data.size_before;\n\t\t\t\t\t\twp_smushit_data.size_after =\n\t\t\t\t\t\t\t'undefined' !==\n\t\t\t\t\t\t\ttypeof wp_smushit_data.savings_dir_smush\n\t\t\t\t\t\t\t\t? parseInt(wp_smushit_data.size_after) +\n\t\t\t\t\t\t\t\t parseInt(\n\t\t\t\t\t\t\t\t\t\twp_smushit_data.savings_dir_smush\n\t\t\t\t\t\t\t\t\t\t\t.image_size\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: wp_smushit_data.size_after;\n\t\t\t\t\t}\n\n\t\t\t\t\twp_smushit_data.count_resize =\n\t\t\t\t\t\t'undefined' !== typeof stats.count_resize\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.count_resize) +\n\t\t\t\t\t\t\t stats.count_resize\n\t\t\t\t\t\t\t: wp_smushit_data.count_resize;\n\t\t\t\t}\n\t\t\t\t// Smush notice.\n\t\t\t\tconst remainingCountDiv = $(\n\t\t\t\t\t'.bulk-smush-wrapper .wp-smush-remaining-count'\n\t\t\t\t);\n\t\t\t\tif (\n\t\t\t\t\tremainingCountDiv.length &&\n\t\t\t\t\t'undefined' !== typeof wp_smushit_data.unsmushed\n\t\t\t\t) {\n\t\t\t\t\tremainingCountDiv.html(wp_smushit_data.unsmushed.length);\n\t\t\t\t}\n\n\t\t\t\t// If no images left, hide the notice, show all success notice.\n\t\t\t\tif (\n\t\t\t\t\t'undefined' !== typeof wp_smushit_data.unsmushed ||\n\t\t\t\t\twp_smushit_data.unsmushed.length === 0\n\t\t\t\t) {\n\t\t\t\t\t$('.wp-smush-bulk-wrapper .sui-notice').removeClass(\n\t\t\t\t\t\t'sui-hidden'\n\t\t\t\t\t);\n\t\t\t\t\t$('.sui-notice-success.wp-smush-all-done').addClass(\n\t\t\t\t\t\t'sui-hidden'\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tSmush.updateStats();\n\t\t\t}\n\t\t});\n\t});\n\n\t// Enable super smush on clicking link from stats area.\n\t$('a.wp-smush-lossy-enable').on('click', function (e) {\n\t\te.preventDefault();\n\t\t// Scroll down to settings area.\n\t\tgoToByScroll('#column-lossy');\n\t});\n\n\t// Enable resize on clicking link from stats area.\n\t$('.wp-smush-resize-enable').on('click', function (e) {\n\t\te.preventDefault();\n\t\t// Scroll down to settings area.\n\t\tgoToByScroll('#column-resize');\n\t});\n\n\t// If settings string is found in url, enable and scroll.\n\tif ( window.location.hash ) {\n\t\tconst setting_hash = window.location.hash.substring( 1 );\n\t\tlet scrollTo = '';\n\n\t\tswitch ( setting_hash ) {\n\t\t\tcase 'enable-resize':\n\t\t\t\tscrollTo = '#column-resize';\n\t\t\t\tbreak;\n\n\t\t\tcase 'backup-label':\n\t\t\t\tscrollTo = '#backup';\n\t\t\t\tbreak;\n\n\t\t\tcase 'original-label':\n\t\t\t\tscrollTo = '#original';\n\t\t\t\tbreak;\n\n\t\t\tcase 'enable-lossy':\n\t\t\t\tscrollTo = '#column-lossy';\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( '' !== scrollTo ) {\n\t\t\tgoToByScroll( scrollTo );\n\t\t\tdocument.getElementById( scrollTo.replace( '#', '' ) ).focus();\n\t\t}\n\t}\n\n\t//Trigger Bulk\n\t$('body').on('click', '.wp-smush-trigger-bulk', function (e) {\n\t\te.preventDefault();\n\n\t\t//Induce Setting button save click\n\t\tif (\n\t\t\t'undefined' !== typeof e.target.dataset.type &&\n\t\t\t'nextgen' === e.target.dataset.type\n\t\t) {\n\t\t\t$('.wp-smush-nextgen-bulk').trigger('click');\n\t\t} else {\n\t\t\t$('.wp-smush-all').trigger('click');\n\t\t}\n\n\t\t$('span.sui-notice-dismiss').trigger('click');\n\t});\n\n\t//Trigger Bulk\n\t$('body').on('click', '#bulk-smush-top-notice-close', function (e) {\n\t\te.preventDefault();\n\t\t$(this).parent().parent().slideUp('slow');\n\t});\n\n\t//Allow the checkboxes to be Keyboard Accessible\n\t$('.wp-smush-setting-row .toggle-checkbox').on('focus', function () {\n\t\t//If Space is pressed\n\t\t$(this).keypress(function (e) {\n\t\t\tif (e.keyCode == 32) {\n\t\t\t\te.preventDefault();\n\t\t\t\t$(this).find('.toggle-checkbox').trigger('click');\n\t\t\t}\n\t\t});\n\t});\n\n\t// Re-Validate Resize Width And Height.\n\t$('body').on('blur', '.wp-smush-resize-input', function () {\n\t\tconst self = $(this);\n\n\t\tconst wrapper_div = self.parents().eq(4);\n\n\t\t// Initiate the check.\n\t\tvalidate_resize_settings(wrapper_div, false, false); // run the validation.\n\t});\n\n\t// Handle Resize Checkbox toggle, to show/hide width, height settings.\n\t$('body').on('click', '#resize', function () {\n\t\tconst self = $(this);\n\t\tconst settings_wrap = $('#smush-resize-settings-wrap');\n\n\t\tif (self.is(':checked')) {\n\t\t\tsettings_wrap.show();\n\t\t} else {\n\t\t\tsettings_wrap.hide();\n\t\t}\n\t});\n\n\t//Handle Re-check button functionality\n\t$('#wp-smush-revalidate-member').on('click', function (e) {\n\t\te.preventDefault();\n\t\t//Ajax Params\n\t\tconst params = {\n\t\t\taction: 'smush_show_warning',\n\t\t};\n\t\tconst link = $(this);\n\t\tconst parent = link.parents().eq(1);\n\t\tparent.addClass('loading-notice');\n\t\t$.get(ajaxurl, params, function (r) {\n\t\t\t//remove the warning\n\t\t\tparent.removeClass('loading-notice').addClass('loaded-notice');\n\t\t\tif (0 == r) {\n\t\t\t\tparent.attr('data-message', wp_smush_msgs.membership_valid);\n\t\t\t\tremove_element(parent, 1000);\n\t\t\t} else {\n\t\t\t\tparent.attr('data-message', wp_smush_msgs.membership_invalid);\n\t\t\t\tsetTimeout(function remove_loader() {\n\t\t\t\t\tparent.removeClass('loaded-notice');\n\t\t\t\t}, 1000);\n\t\t\t}\n\t\t});\n\t});\n\n\tif ($('li.smush-dir-savings').length > 0) {\n\t\t// Update Directory Smush, as soon as the page loads.\n\t\tconst stats_param = {\n\t\t\taction: 'get_dir_smush_stats',\n\t\t};\n\t\t$.get(ajaxurl, stats_param, function (r) {\n\t\t\t//Hide the spinner\n\t\t\t$('li.smush-dir-savings .sui-icon-loader').hide();\n\n\t\t\t//If there are no errors, and we have a message to display\n\t\t\tif (!r.success && 'undefined' !== typeof r.data.message) {\n\t\t\t\t$('div.wp-smush-scan-result div.content').prepend(\n\t\t\t\t\tr.data.message\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//If there is no value in r\n\t\t\tif (\n\t\t\t\t'undefined' === typeof r.data ||\n\t\t\t\t'undefined' === typeof r.data.dir_smush\n\t\t\t) {\n\t\t\t\t//Append the text\n\t\t\t\t$('li.smush-dir-savings span.wp-smush-stats').append(\n\t\t\t\t\twp_smush_msgs.ajax_error\n\t\t\t\t);\n\t\t\t\t$('li.smush-dir-savings span.wp-smush-stats span').hide();\n\t\t\t} else {\n\t\t\t\t//Update the stats\n\t\t\t\tupdate_cummulative_stats(r.data);\n\t\t\t}\n\t\t});\n\t}\n\n\t//Dismiss Smush recommendation\n\t$('span.dismiss-recommendation').on('click', function (e) {\n\t\te.preventDefault();\n\t\tconst parent = $(this).parent();\n\t\t//remove div and save preference in db\n\t\tparent.hide('slow', function () {\n\t\t\tparent.remove();\n\t\t});\n\t\t$.ajax({\n\t\t\ttype: 'POST',\n\t\t\turl: ajaxurl,\n\t\t\tdata: {\n\t\t\t\taction: 'hide_pagespeed_suggestion',\n\t\t\t},\n\t\t});\n\t});\n\n\t// Display dialogs that show up with no user action.\n\tif ($('#smush-updated-dialog').length) {\n\t\t// Displays the modal with the release's higlights if it exists.\n\t\twindow.SUI.openModal(\n\t\t\t'smush-updated-dialog',\n\t\t\t'wpbody-content',\n\t\t\tundefined,\n\t\t\tfalse\n\t\t);\n\t}\n\n\t/**\n\t * Toggle backup notice based on \"Compress uploaded images\" setting.\n\t * @since 3.9.1\n\t */\n\t$( 'input#original' ).on( 'change', function() {\n\t\t$( '#backup-notice' ).toggleClass( 'sui-hidden', $( this ).is(':checked') );\n\t} );\n});\n","/* global WP_Smush */\n/* global ajaxurl */\n/* global _ */\n\n/**\n * Bulk restore JavaScript code.\n *\n * @since 3.2.2\n */\n(function () {\n\t'use strict';\n\n\t/**\n\t * Bulk restore modal.\n\t *\n\t * @since 3.2.2\n\t */\n\tWP_Smush.restore = {\n\t\tmodal: document.getElementById('smush-restore-images-dialog'),\n\t\tcontentContainer: document.getElementById('smush-bulk-restore-content'),\n\t\tsettings: {\n\t\t\tslide: 'start', // start, progress or finish.\n\t\t\tsuccess: 0,\n\t\t\terrors: [],\n\t\t},\n\t\titems: [], // total items, 1 item = 1 step.\n\t\tsuccess: [], // successful items restored.\n\t\terrors: [], // failed items.\n\t\tcurrentStep: 0,\n\t\ttotalSteps: 0,\n\n\t\t/**\n\t\t * Init module.\n\t\t */\n\t\tinit() {\n\t\t\tif (!this.modal) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.settings = {\n\t\t\t\tslide: 'start',\n\t\t\t\tsuccess: 0,\n\t\t\t\terrors: [],\n\t\t\t};\n\n\t\t\tthis.resetModalWidth();\n\t\t\tthis.renderTemplate();\n\n\t\t\t// Show the modal.\n\n\t\t\twindow.SUI.openModal(\n\t\t\t\t'smush-restore-images-dialog',\n\t\t\t\t'wpbody-content',\n\t\t\t\tundefined,\n\t\t\t\tfalse\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update the template, register new listeners.\n\t\t */\n\t\trenderTemplate() {\n\t\t\tconst template = WP_Smush.onboarding.template('smush-bulk-restore');\n\t\t\tconst content = template(this.settings);\n\n\t\t\tif (content) {\n\t\t\t\tthis.contentContainer.innerHTML = content;\n\t\t\t}\n\n\t\t\tthis.bindSubmit();\n\t\t},\n\n\t\t/**\n\t\t * Reset modal width.\n\t\t *\n\t\t * @since 3.6.0\n\t\t */\n\t\tresetModalWidth() {\n\t\t\tthis.modal.style.maxWidth = '460px';\n\t\t\tthis.modal.querySelector('.sui-box').style.maxWidth = '460px';\n\t\t},\n\n\t\t/**\n\t\t * Catch \"Finish setup wizard\" button click.\n\t\t */\n\t\tbindSubmit() {\n\t\t\tconst confirmButton = this.modal.querySelector(\n\t\t\t\t'button[id=\"smush-bulk-restore-button\"]'\n\t\t\t);\n\t\t\tconst self = this;\n\n\t\t\tif (confirmButton) {\n\t\t\t\tconfirmButton.addEventListener('click', function (e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tself.resetModalWidth();\n\n\t\t\t\t\tself.settings = { slide: 'progress' };\n\t\t\t\t\tself.errors = [];\n\n\t\t\t\t\tself.renderTemplate();\n\t\t\t\t\tself.initScan();\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Cancel the bulk restore.\n\t\t */\n\t\tcancel() {\n\t\t\tif (\n\t\t\t\t'start' === this.settings.slide ||\n\t\t\t\t'finish' === this.settings.slide\n\t\t\t) {\n\t\t\t\t// Hide the modal.\n\t\t\t\twindow.SUI.closeModal();\n\t\t\t} else {\n\t\t\t\tthis.updateProgressBar(true);\n\t\t\t\twindow.location.reload();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Update progress bar during directory smush.\n\t\t *\n\t\t * @param {boolean} cancel Cancel status.\n\t\t */\n\t\tupdateProgressBar(cancel = false) {\n\t\t\tlet progress = 0;\n\t\t\tif (0 < this.currentStep) {\n\t\t\t\tprogress = Math.min(\n\t\t\t\t\tMath.round((this.currentStep * 100) / this.totalSteps),\n\t\t\t\t\t99\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (progress > 100) {\n\t\t\t\tprogress = 100;\n\t\t\t}\n\n\t\t\t// Update progress bar\n\t\t\tthis.modal.querySelector('.sui-progress-text span').innerHTML =\n\t\t\t\tprogress + '%';\n\t\t\tthis.modal.querySelector('.sui-progress-bar span').style.width =\n\t\t\t\tprogress + '%';\n\n\t\t\tconst statusDiv = this.modal.querySelector(\n\t\t\t\t'.sui-progress-state-text'\n\t\t\t);\n\t\t\tif (progress >= 90) {\n\t\t\t\tstatusDiv.innerHTML = 'Finalizing...';\n\t\t\t} else if (cancel) {\n\t\t\t\tstatusDiv.innerHTML = 'Cancelling...';\n\t\t\t} else {\n\t\t\t\tstatusDiv.innerHTML =\n\t\t\t\t\tthis.currentStep +\n\t\t\t\t\t'/' +\n\t\t\t\t\tthis.totalSteps +\n\t\t\t\t\t' ' +\n\t\t\t\t\t'images restored';\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * First step in bulk restore - get the bulk attachment count.\n\t\t */\n\t\tinitScan() {\n\t\t\tconst self = this;\n\t\t\tconst _nonce = document.getElementById('_wpnonce');\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', ajaxurl + '?action=get_image_count', true);\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tif (200 === xhr.status) {\n\t\t\t\t\tconst res = JSON.parse(xhr.response);\n\t\t\t\t\tif ('undefined' !== typeof res.data.items) {\n\t\t\t\t\t\tself.items = res.data.items;\n\t\t\t\t\t\tself.totalSteps = res.data.items.length;\n\t\t\t\t\t\tself.step();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twindow.console.log(\n\t\t\t\t\t\t'Request failed. Returned status of ' + xhr.status\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send('_ajax_nonce=' + _nonce.value);\n\t\t},\n\n\t\t/**\n\t\t * Execute a scan step recursively\n\t\t */\n\t\tstep() {\n\t\t\tconst self = this;\n\t\t\tconst _nonce = document.getElementById('_wpnonce');\n\n\t\t\tif (0 < this.items.length) {\n\t\t\t\tconst item = this.items.pop();\n\t\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\t\txhr.open('POST', ajaxurl + '?action=restore_step', true);\n\t\t\t\txhr.setRequestHeader(\n\t\t\t\t\t'Content-type',\n\t\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t\t);\n\t\t\t\txhr.onload = () => {\n\t\t\t\t\tthis.currentStep++;\n\n\t\t\t\t\tif (200 === xhr.status) {\n\t\t\t\t\t\tconst res = JSON.parse(xhr.response);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t'undefined' !== typeof res.data.success &&\n\t\t\t\t\t\t\tres.data.success\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tself.success.push(item);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tself.errors.push({\n\t\t\t\t\t\t\t\tid: item,\n\t\t\t\t\t\t\t\tsrc: res.data.src,\n\t\t\t\t\t\t\t\tthumb: res.data.thumb,\n\t\t\t\t\t\t\t\tlink: res.data.link,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tself.updateProgressBar();\n\t\t\t\t\tself.step();\n\t\t\t\t};\n\t\t\t\txhr.send('item=' + item + '&_ajax_nonce=' + _nonce.value);\n\t\t\t} else {\n\t\t\t\t// Finish.\n\t\t\t\tthis.settings = {\n\t\t\t\t\tslide: 'finish',\n\t\t\t\t\tsuccess: this.success.length,\n\t\t\t\t\terrors: this.errors,\n\t\t\t\t\ttotal: this.totalSteps,\n\t\t\t\t};\n\n\t\t\t\tself.renderTemplate();\n\t\t\t\tif (0 < this.errors.length) {\n\t\t\t\t\tthis.modal.style.maxWidth = '660px';\n\t\t\t\t\tthis.modal.querySelector('.sui-box').style.maxWidth =\n\t\t\t\t\t\t'660px';\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t};\n\n\t/**\n\t * Template function (underscores based).\n\t *\n\t * @type {Function}\n\t */\n\tWP_Smush.restore.template = _.memoize((id) => {\n\t\tlet compiled;\n\t\tconst options = {\n\t\t\tevaluate: /<#([\\s\\S]+?)#>/g,\n\t\t\tinterpolate: /{{{([\\s\\S]+?)}}}/g,\n\t\t\tescape: /{{([^}]+?)}}(?!})/g,\n\t\t\tvariable: 'data',\n\t\t};\n\n\t\treturn (data) => {\n\t\t\t_.templateSettings = options;\n\t\t\tcompiled =\n\t\t\t\tcompiled || _.template(document.getElementById(id).innerHTML);\n\t\t\treturn compiled(data);\n\t\t};\n\t});\n})();\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * Bulk Smush functionality.\n *\n * @since 2.9.0 Moved from admin.js\n */\n\nimport Smush from '../smush/smush';\n\n( function( $ ) {\n\t'use strict';\n\n\tWP_Smush.bulk = {\n\t\tinit: () => {\n\t\t\t/**\n\t\t\t * Handle the Bulk Smush/Bulk re-Smush button click.\n\t\t\t */\n\t\t\t$( '.wp-smush-all' ).on( 'click', function( e ) {\n\t\t\t\te.preventDefault();\n\n\t\t\t\t$( '.sui-notice-top.sui-notice-success' ).remove();\n\n\t\t\t\tconst bulkWarning = document.getElementById(\n\t\t\t\t\t'bulk_smush_warning'\n\t\t\t\t);\n\t\t\t\tbulkWarning.classList.add( 'sui-hidden' );\n\n\t\t\t\t// Remove limit exceeded styles.\n\t\t\t\tconst progress = $( '.wp-smush-bulk-progress-bar-wrapper' );\n\t\t\t\tprogress.removeClass( 'wp-smush-exceed-limit' );\n\t\t\t\tprogress\n\t\t\t\t\t.find( '.sui-progress-block .wp-smush-all' )\n\t\t\t\t\t.addClass( 'sui-hidden' );\n\t\t\t\tprogress\n\t\t\t\t\t.find( '.sui-progress-block .wp-smush-cancel-bulk' )\n\t\t\t\t\t.removeClass( 'sui-hidden' );\n\t\t\t\tif ( bulkWarning ) {\n\t\t\t\t\tdocument\n\t\t\t\t\t\t.getElementById( 'bulk-smush-resume-button' )\n\t\t\t\t\t\t.classList.add( 'sui-hidden' );\n\t\t\t\t}\n\n\t\t\t\t// Disable re-Smush and scan button.\n\t\t\t\t// TODO: refine what is disabled.\n\t\t\t\t$(\n\t\t\t\t\t'.wp-resmush.wp-smush-action, .wp-smush-scan, .wp-smush-all:not(.sui-progress-close), a.wp-smush-lossy-enable, button.wp-smush-resize-enable, button#save-settings-button'\n\t\t\t\t).prop( 'disabled', true );\n\n\t\t\t\t// Check for IDs, if there is none (unsmushed or lossless), don't call Smush function.\n\t\t\t\t/** @param {Array} wp_smushit_data.unsmushed */\n\t\t\t\tif (\n\t\t\t\t\t'undefined' === typeof window.wp_smushit_data ||\n\t\t\t\t\t( 0 === window.wp_smushit_data.unsmushed.length &&\n\t\t\t\t\t\t0 === window.wp_smushit_data.resmush.length )\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t$( '.wp-smush-remaining' ).addClass( 'sui-hidden' );\n\n\t\t\t\t// Show loader.\n\t\t\t\tprogress\n\t\t\t\t\t.find( '.sui-progress-block i.sui-icon-info' )\n\t\t\t\t\t.removeClass( 'sui-icon-info' )\n\t\t\t\t\t.addClass( 'sui-loading' )\n\t\t\t\t\t.addClass( 'sui-icon-loader' );\n\n\t\t\t\tnew Smush( $( this ), true );\n\t\t\t} );\n\n\t\t\t/**\n\t\t\t * Ignore file from bulk Smush.\n\t\t\t *\n\t\t\t * @since 2.9.0\n\t\t\t */\n\t\t\t$( 'body' ).on( 'click', '.smush-ignore-image', function( e ) {\n\t\t\t\te.preventDefault();\n\n\t\t\t\tconst self = $( this );\n\n\t\t\t\tself.prop( 'disabled', true );\n\t\t\t\tself.attr( 'data-tooltip' );\n\t\t\t\tself.removeClass( 'sui-tooltip' );\n\t\t\t\t$.post( ajaxurl, {\n\t\t\t\t\taction: 'ignore_bulk_image',\n\t\t\t\t\tid: self.attr( 'data-id' ),\n\t\t\t\t} ).done( ( response ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tself.is( 'a' ) &&\n\t\t\t\t\t\tresponse.success &&\n\t\t\t\t\t\t'undefined' !== typeof response.data.links\n\t\t\t\t\t) {\n\t\t\t\t\t\tself.parent()\n\t\t\t\t\t\t\t.parent()\n\t\t\t\t\t\t\t.find( '.smush-status' )\n\t\t\t\t\t\t\t.text( wp_smush_msgs.ignored );\n\t\t\t\t\t\te.target.closest( '.smush-status-links' ).innerHTML =\n\t\t\t\t\t\t\tresponse.data.links;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} );\n\n\t\t\t/**\n\t\t\t * Show upsell on free version and when there are no images to compress.\n\t\t\t *\n\t\t\t * @since 3.7.2\n\t\t\t */\n\t\t\tconst upsellBox = document.getElementById( 'smush-box-bulk-upgrade' );\n\t\t\tif (\n\t\t\t\tupsellBox &&\n\t\t\t\t!window.wp_smushit_data.unsmushed.length &&\n\t\t\t\t!window.wp_smushit_data.resmush.length\n\t\t\t) {\n\t\t\t\tupsellBox.classList.remove( 'sui-hidden' );\n\t\t\t}\n\t\t},\n\t};\n\n\tWP_Smush.bulk.init();\n} )( jQuery );\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * Directory Smush module JavaScript code.\n *\n * @since 2.8.1 Separated from admin.js into dedicated file.\n */\n\nimport { createTree } from 'jquery.fancytree';\nimport Scanner from '../smush/directory-scanner';\n\n( function( $ ) {\n\t'use strict';\n\n\tWP_Smush.directory = {\n\t\tselected: [],\n\t\ttree: [],\n\t\twp_smush_msgs: [],\n\t\ttriggered: false,\n\n\t\tinit() {\n\t\t\tconst self = this,\n\t\t\t\tprogressDialog = $( '#wp-smush-progress-dialog' );\n\n\t\t\tlet totalSteps = 0,\n\t\t\t\tcurrentScanStep = 0;\n\n\t\t\t// Make sure directory smush vars are set.\n\t\t\tif ( typeof window.wp_smushit_data.dir_smush !== 'undefined' ) {\n\t\t\t\ttotalSteps = window.wp_smushit_data.dir_smush.totalSteps;\n\t\t\t\tcurrentScanStep =\n\t\t\t\t\twindow.wp_smushit_data.dir_smush.currentScanStep;\n\t\t\t}\n\n\t\t\t// Init image scanner.\n\t\t\tthis.scanner = new Scanner( totalSteps, currentScanStep );\n\n\t\t\t/**\n\t\t\t * Smush translation strings.\n\t\t\t *\n\t\t\t * @param {Array} wp_smush_msgs\n\t\t\t */\n\t\t\tthis.wp_smush_msgs = window.wp_smush_msgs || {};\n\n\t\t\t/**\n\t\t\t * Open the \"Select Smush directory\" modal.\n\t\t\t */\n\t\t\t$('button.wp-smush-browse, a#smush-directory-open-modal').on(\n\t\t\t\t'click',\n\t\t\t\tfunction (e) {\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tif ( $( e.currentTarget ).hasClass( 'wp-smush-browse' ) ) {\n\t\t\t\t\t\t// Hide all the notices.\n\t\t\t\t\t\t$( 'div.wp-smush-scan-result div.wp-smush-notice' ).hide();\n\n\t\t\t\t\t\t// Remove notice.\n\t\t\t\t\t\t$( 'div.wp-smush-info' ).remove();\n\t\t\t\t\t}\n\n\t\t\t\t\twindow.SUI.openModal(\n\t\t\t\t\t\t'wp-smush-list-dialog',\n\t\t\t\t\t\te.currentTarget,\n\t\t\t\t\t\t$(\n\t\t\t\t\t\t\t'#wp-smush-list-dialog .sui-box-header [data-modal-close]'\n\t\t\t\t\t\t)[0],\n\t\t\t\t\t\ttrue\n\t\t\t\t\t);\n\t\t\t\t\t//Display File tree for Directory Smush\n\t\t\t\t\tself.initFileTree();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Smush images: Smush in Choose Directory modal clicked\n\t\t\t */\n\t\t\t$( '#wp-smush-select-dir' ).on( 'click', function( e ) {\n\t\t\t\te.preventDefault();\n\n\t\t\t\t// If disabled, do not process\n\t\t\t\tif ( $( this ).prop( 'disabled' ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst button = $( this );\n\n\t\t\t\t$( 'div.wp-smush-list-dialog div.sui-box-body' ).css( {\n\t\t\t\t\topacity: '0.8',\n\t\t\t\t} );\n\t\t\t\t$( 'div.wp-smush-list-dialog div.sui-box-body a' ).off(\n\t\t\t\t\t'click'\n\t\t\t\t);\n\n\t\t\t\t// Disable button\n\t\t\t\tbutton.prop( 'disabled', true );\n\n\t\t\t\t// Display the spinner.\n\t\t\t\tbutton.addClass('sui-button-onload');\n\n\t\t\t\tconst selectedFolders = self.tree.getSelectedNodes();\n\n\t\t\t\tconst paths = [];\n\t\t\t\tselectedFolders.forEach( function( folder ) {\n\t\t\t\t\tpaths.push( folder.key );\n\t\t\t\t} );\n\n\t\t\t\t// Send a ajax request to get a list of all the image files\n\t\t\t\tconst param = {\n\t\t\t\t\taction: 'image_list',\n\t\t\t\t\tsmush_path: paths,\n\t\t\t\t\timage_list_nonce: $(\n\t\t\t\t\t\t'input[name=\"image_list_nonce\"]'\n\t\t\t\t\t).val(),\n\t\t\t\t};\n\n\t\t\t\t$.post( ajaxurl, param, function( response ) {\n\t\t\t\t\twindow.SUI.closeModal();\n\n\t\t\t\t\tif ( response.success ) {\n\t\t\t\t\t\tself.scanner = new Scanner( response.data, 0 );\n\t\t\t\t\t\tself.showProgressDialog( response.data );\n\t\t\t\t\t\tself.scanner.scan();\n\t\t\t\t\t} else {\n\t\t\t\t\t\twindow.SUI.openNotice(\n\t\t\t\t\t\t\t'wp-smush-ajax-notice',\n\t\t\t\t\t\t\tresponse.data.message,\n\t\t\t\t\t\t\t{ type: 'warning' }\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} );\n\n\t\t\t/**\n\t\t\t * Cancel scan.\n\t\t\t */\n\t\t\tprogressDialog.on(\n\t\t\t\t'click',\n\t\t\t\t'#cancel-directory-smush, #dialog-close-div, .wp-smush-cancel-dir',\n\t\t\t\tfunction (e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t// Display the spinner\n\t\t\t\t\t$('.wp-smush-cancel-dir').addClass('sui-button-onload');\n\t\t\t\t\tself.scanner\n\t\t\t\t\t\t.cancel()\n\t\t\t\t\t\t.done(\n\t\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\t\t( window.location.href =\n\t\t\t\t\t\t\t\t\tself.wp_smush_msgs.directory_url )\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Continue scan.\n\t\t\t */\n\t\t\tprogressDialog.on(\n\t\t\t\t'click',\n\t\t\t\t'.sui-icon-play, .wp-smush-resume-scan',\n\t\t\t\tfunction( e ) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tself.scanner.resume();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Check to see if we should open the directory module.\n\t\t\t * Used to redirect from dashboard page.\n\t\t\t *\n\t\t\t * @since 3.8.6\n\t\t\t */\n\t\t\tconst queryString = window.location.search;\n\t\t\tconst urlParams = new URLSearchParams(queryString);\n\t\t\tif (urlParams.has('start') && !this.triggered) {\n\t\t\t\tthis.triggered = true;\n\t\t\t\t$('button.wp-smush-browse').trigger('click');\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Init fileTree.\n\t\t */\n\t\tinitFileTree() {\n\t\t\tconst self = this,\n\t\t\t\tsmushButton = $( 'button#wp-smush-select-dir' ),\n\t\t\t\tajaxSettings = {\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\turl: ajaxurl,\n\t\t\t\t\tdata: {\n\t\t\t\t\t\taction: 'smush_get_directory_list',\n\t\t\t\t\t\tlist_nonce: $( 'input[name=\"list_nonce\"]' ).val(),\n\t\t\t\t\t},\n\t\t\t\t\tcache: false,\n\t\t\t\t};\n\n\t\t\t// Object already defined.\n\t\t\tif ( Object.entries( self.tree ).length > 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tself.tree = createTree( '.wp-smush-list-dialog .content', {\n\t\t\t\tautoCollapse: true, // Automatically collapse all siblings, when a node is expanded\n\t\t\t\tclickFolderMode: 3, // 1:activate, 2:expand, 3:activate and expand, 4:activate (dblclick expands)\n\t\t\t\tcheckbox: true, // Show checkboxes\n\t\t\t\tdebugLevel: 0, // 0:quiet, 1:errors, 2:warnings, 3:infos, 4:debug\n\t\t\t\tselectMode: 3, // 1:single, 2:multi, 3:multi-hier\n\t\t\t\ttabindex: '0', // Whole tree behaves as one single control\n\t\t\t\tkeyboard: true, // Support keyboard navigation\n\t\t\t\tquicksearch: true, // Navigate to next node by typing the first letters\n\t\t\t\tsource: ajaxSettings,\n\t\t\t\tlazyLoad: ( event, data ) => {\n\t\t\t\t\tdata.result = new Promise( function( resolve, reject ) {\n\t\t\t\t\t\tajaxSettings.data.dir = data.node.key;\n\t\t\t\t\t\t$.ajax( ajaxSettings )\n\t\t\t\t\t\t\t.done( ( response ) => resolve( response ) )\n\t\t\t\t\t\t\t.fail( reject );\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t\tloadChildren: ( event, data ) =>\n\t\t\t\t\tdata.node.fixSelection3AfterClick(), // Apply parent's state to new child nodes:\n\t\t\t\tselect: () =>\n\t\t\t\t\tsmushButton.prop(\n\t\t\t\t\t\t'disabled',\n\t\t\t\t\t\t! +self.tree.getSelectedNodes().length\n\t\t\t\t\t),\n\t\t\t\tinit: () => smushButton.prop( 'disabled', true ),\n\t\t\t} );\n\t\t},\n\n\t\t/**\n\t\t * Show progress dialog.\n\t\t *\n\t\t * @param {number} items Number of items in the scan.\n\t\t */\n\t\tshowProgressDialog( items ) {\n\t\t\t// Update items status and show the progress dialog..\n\t\t\t$( '.wp-smush-progress-dialog .sui-progress-state-text' ).html(\n\t\t\t\t'0/' + items + ' ' + self.wp_smush_msgs.progress_smushed\n\t\t\t);\n\n\t\t\twindow.SUI.openModal(\n\t\t\t\t'wp-smush-progress-dialog',\n\t\t\t\t'dialog-close-div',\n\t\t\t\tundefined,\n\t\t\t\tfalse\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update progress bar during directory smush.\n\t\t *\n\t\t * @param {number} progress Current progress in percent.\n\t\t * @param {boolean} cancel Cancel status.\n\t\t */\n\t\tupdateProgressBar( progress, cancel = false ) {\n\t\t\tif ( progress > 100 ) {\n\t\t\t\tprogress = 100;\n\t\t\t}\n\n\t\t\t// Update progress bar\n\t\t\t$( '.sui-progress-block .sui-progress-text span' ).text(\n\t\t\t\tprogress + '%'\n\t\t\t);\n\t\t\t$( '.sui-progress-block .sui-progress-bar span' ).width(\n\t\t\t\tprogress + '%'\n\t\t\t);\n\n\t\t\tif ( progress >= 90 ) {\n\t\t\t\t$( '.sui-progress-state .sui-progress-state-text' ).text(\n\t\t\t\t\t'Finalizing...'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( cancel ) {\n\t\t\t\t$( '.sui-progress-state .sui-progress-state-text' ).text(\n\t\t\t\t\t'Cancelling...'\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t};\n\n\tWP_Smush.directory.init();\n} )( jQuery );\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * Directory scanner module that will Smush images in the Directory Smush modal.\n *\n * @since 2.8.1\n *\n * @param {string|number} totalSteps\n * @param {string|number} currentStep\n * @return {Object} Scan object.\n * @class\n */\nconst DirectoryScanner = ( totalSteps, currentStep ) => {\n\ttotalSteps = parseInt( totalSteps );\n\tcurrentStep = parseInt( currentStep );\n\n\tlet cancelling = false,\n\t\tfailedItems = 0,\n\t\tskippedItems = 0;\n\n\tconst obj = {\n\t\tscan() {\n\t\t\tconst remainingSteps = totalSteps - currentStep;\n\t\t\tif ( currentStep !== 0 ) {\n\t\t\t\t// Scan started on a previous page load.\n\t\t\t\tstep(remainingSteps).fail(this.showScanError);\n\t\t\t} else {\n\t\t\t\tjQuery\n\t\t\t\t\t.post(ajaxurl, { action: 'directory_smush_start' }, () =>\n\t\t\t\t\t\tstep(remainingSteps).fail(this.showScanError)\n\t\t\t\t\t)\n\t\t\t\t\t.fail(this.showScanError);\n\t\t\t}\n\t\t},\n\n\t\tcancel() {\n\t\t\tcancelling = true;\n\t\t\treturn jQuery.post( ajaxurl, { action: 'directory_smush_cancel' } );\n\t\t},\n\n\t\tgetProgress() {\n\t\t\tif ( cancelling ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t// O M G ... Logic at it's finest!\n\t\t\tconst remainingSteps = totalSteps - currentStep;\n\t\t\treturn Math.min(\n\t\t\t\tMath.round(\n\t\t\t\t\t( parseInt( totalSteps - remainingSteps ) * 100 ) /\n\t\t\t\t\t\ttotalSteps\n\t\t\t\t),\n\t\t\t\t99\n\t\t\t);\n\t\t},\n\n\t\tonFinishStep( progress ) {\n\t\t\tjQuery( '.wp-smush-progress-dialog .sui-progress-state-text' ).html(\n\t\t\t\tcurrentStep -\n\t\t\t\t\tfailedItems +\n\t\t\t\t\t'/' +\n\t\t\t\t\ttotalSteps +\n\t\t\t\t\t' ' +\n\t\t\t\t\twindow.wp_smush_msgs.progress_smushed\n\t\t\t);\n\t\t\tWP_Smush.directory.updateProgressBar( progress );\n\t\t},\n\n\t\tonFinish() {\n\t\t\tWP_Smush.directory.updateProgressBar( 100 );\n\t\t\twindow.location.href =\n\t\t\t\twindow.wp_smush_msgs.directory_url + '&scan=done';\n\t\t},\n\n\t\t/**\n\t\t * Displays an error when the scan request fails.\n\t\t *\n\t\t * @param {Object} res XHR object.\n\t\t */\n\t\tshowScanError(res) {\n\t\t\tconst dialog = jQuery('#wp-smush-progress-dialog');\n\n\t\t\t// Add the error class to show/hide elements in the dialog.\n\t\t\tdialog\n\t\t\t\t.removeClass('wp-smush-exceed-limit')\n\t\t\t\t.addClass('wp-smush-scan-error');\n\n\t\t\t// Add the error status and description to the error message.\n\t\t\tdialog\n\t\t\t\t.find('#smush-scan-error')\n\t\t\t\t.text(`${res.status} ${res.statusText}`);\n\n\t\t\t// Show/hide the 403 error specific instructions.\n\t\t\tconst forbiddenMessage = dialog.find('.smush-403-error-message');\n\t\t\tif (403 !== res.status) {\n\t\t\t\tforbiddenMessage.addClass('sui-hidden');\n\t\t\t} else {\n\t\t\t\tforbiddenMessage.removeClass('sui-hidden');\n\t\t\t}\n\t\t},\n\n\t\tlimitReached() {\n\t\t\tconst dialog = jQuery( '#wp-smush-progress-dialog' );\n\n\t\t\tdialog.addClass( 'wp-smush-exceed-limit' );\n\t\t\tdialog\n\t\t\t\t.find( '#cancel-directory-smush' )\n\t\t\t\t.attr( 'data-tooltip', window.wp_smush_msgs.bulk_resume );\n\t\t\tdialog\n\t\t\t\t.find( '.sui-box-body .sui-icon-close' )\n\t\t\t\t.removeClass( 'sui-icon-close' )\n\t\t\t\t.addClass( 'sui-icon-play' );\n\t\t\tdialog\n\t\t\t\t.find( '#cancel-directory-smush' )\n\t\t\t\t.attr( 'id', 'cancel-directory-smush-disabled' );\n\t\t},\n\n\t\tresume() {\n\t\t\tconst dialog = jQuery( '#wp-smush-progress-dialog' );\n\t\t\tconst resume = dialog.find( '#cancel-directory-smush-disabled' );\n\n\t\t\tdialog.removeClass( 'wp-smush-exceed-limit' );\n\t\t\tdialog\n\t\t\t\t.find( '.sui-box-body .sui-icon-play' )\n\t\t\t\t.removeClass( 'sui-icon-play' )\n\t\t\t\t.addClass( 'sui-icon-close' );\n\t\t\tresume.attr( 'data-tooltip', 'Cancel' );\n\t\t\tresume.attr( 'id', 'cancel-directory-smush' );\n\n\t\t\tobj.scan();\n\t\t},\n\t};\n\n\t/**\n\t * Execute a scan step recursively\n\t *\n\t * Private to avoid overriding\n\t *\n\t * @param {number} remainingSteps\n\t */\n\tconst step = function( remainingSteps ) {\n\t\tif ( remainingSteps >= 0 ) {\n\t\t\tcurrentStep = totalSteps - remainingSteps;\n\t\t\treturn jQuery.post(\n\t\t\t\tajaxurl,\n\t\t\t\t{\n\t\t\t\t\taction: 'directory_smush_check_step',\n\t\t\t\t\tstep: currentStep,\n\t\t\t\t},\n\t\t\t\t( response ) => {\n\t\t\t\t\t// We're good - continue on.\n\t\t\t\t\tif (\n\t\t\t\t\t\t'undefined' !== typeof response.success &&\n\t\t\t\t\t\tresponse.success\n\t\t\t\t\t) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t'undefined' !== typeof response.data &&\n\t\t\t\t\t\t\t'undefined' !== typeof response.data.skipped &&\n\t\t\t\t\t\t\ttrue === response.data.skipped\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tskippedItems++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrentStep++;\n\t\t\t\t\t\tremainingSteps = remainingSteps - 1;\n\t\t\t\t\t\tobj.onFinishStep( obj.getProgress() );\n\t\t\t\t\t\tstep(remainingSteps).fail(obj.showScanError);\n\t\t\t\t\t} else if (\n\t\t\t\t\t\t'undefined' !== typeof response.data.error &&\n\t\t\t\t\t\t'dir_smush_limit_exceeded' === response.data.error\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Limit reached. Stop.\n\t\t\t\t\t\tobj.limitReached();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Error? never mind, continue, but count them.\n\t\t\t\t\t\tfailedItems++;\n\t\t\t\t\t\tcurrentStep++;\n\t\t\t\t\t\tremainingSteps = remainingSteps - 1;\n\t\t\t\t\t\tobj.onFinishStep( obj.getProgress() );\n\t\t\t\t\t\tstep(remainingSteps).fail(obj.showScanError);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\treturn jQuery.post(\n\t\t\tajaxurl,\n\t\t\t{\n\t\t\t\taction: 'directory_smush_finish',\n\t\t\t\titems: totalSteps - ( failedItems + skippedItems ),\n\t\t\t\tfailed: failedItems,\n\t\t\t\tskipped: skippedItems,\n\t\t\t},\n\t\t\t( response ) => obj.onFinish( response )\n\t\t);\n\t};\n\n\treturn obj;\n};\n\nexport default DirectoryScanner;\n","/* global WP_Smush */\n/* global ajaxurl */\n/* global wp_smush_msgs */\n\n/**\n * Helpers functions.\n *\n * @since 2.9.0 Moved from admin.js\n */\n( function() {\n\t'use strict';\n\n\tWP_Smush.helpers = {\n\t\tinit: () => {},\n\n\t\t/**\n\t\t * Convert bytes to human readable form.\n\t\t *\n\t\t * @param {number} a Bytes\n\t\t * @param {number} b Number of digits\n\t\t * @return {*} Formatted Bytes\n\t\t */\n\t\tformatBytes: ( a, b ) => {\n\t\t\tconst thresh = 1024,\n\t\t\t\tunits = [ 'KB', 'MB', 'GB', 'TB', 'PB' ];\n\n\t\t\tif ( Math.abs( a ) < thresh ) {\n\t\t\t\treturn a + ' B';\n\t\t\t}\n\n\t\t\tlet u = -1;\n\n\t\t\tdo {\n\t\t\t\ta /= thresh;\n\t\t\t\t++u;\n\t\t\t} while ( Math.abs( a ) >= thresh && u < units.length - 1 );\n\n\t\t\treturn a.toFixed( b ) + ' ' + units[ u ];\n\t\t},\n\n\t\t/**\n\t\t * Get size from a string.\n\t\t *\n\t\t * @param {string} formattedSize Formatter string\n\t\t * @return {*} Formatted Bytes\n\t\t */\n\t\tgetSizeFromString: ( formattedSize ) => {\n\t\t\treturn formattedSize.replace( /[a-zA-Z]/g, '' ).trim();\n\t\t},\n\n\t\t/**\n\t\t * Get type from formatted string.\n\t\t *\n\t\t * @param {string} formattedSize Formatted string\n\t\t * @return {*} Formatted Bytes\n\t\t */\n\t\tgetFormatFromString: ( formattedSize ) => {\n\t\t\treturn formattedSize.replace( /[0-9.]/g, '' ).trim();\n\t\t},\n\n\t\t/**\n\t\t * Stackoverflow: http://stackoverflow.com/questions/1726630/formatting-a-number-with-exactly-two-decimals-in-javascript\n\t\t *\n\t\t * @param {number} num\n\t\t * @param {number} decimals\n\t\t * @return {number} Number\n\t\t */\n\t\tprecise_round: ( num, decimals ) => {\n\t\t\tconst sign = num >= 0 ? 1 : -1;\n\t\t\t// Keep the percentage below 100.\n\t\t\tnum = num > 100 ? 100 : num;\n\t\t\treturn (\n\t\t\t\tMath.round( num * Math.pow( 10, decimals ) + sign * 0.001 ) /\n\t\t\t\tMath.pow( 10, decimals )\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Displays a floating error message using the #wp-smush-ajax-notice container.\n\t\t *\n\t\t * @since 3.8.0\n\t\t *\n\t\t * @param {string} message\n\t\t */\n\t\tshowErrorNotice: ( message ) => {\n\t\t\tif ( 'undefined' === typeof message ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst noticeMessage = `<p>${ message }</p>`,\n\t\t\t\tnoticeOptions = {\n\t\t\t\t\ttype: 'error',\n\t\t\t\t\ticon: 'info',\n\t\t\t\t};\n\n\t\t\tSUI.openNotice( 'wp-smush-ajax-notice', noticeMessage, noticeOptions );\n\n\t\t\tconst loadingButton = document.querySelector( '.sui-button-onload' );\n\t\t\tif ( loadingButton ) {\n\t\t\t\tloadingButton.classList.remove( 'sui-button-onload' );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Reset settings.\n\t\t *\n\t\t * @since 3.2.0\n\t\t */\n\t\tresetSettings: () => {\n\t\t\tconst _nonce = document.getElementById( 'wp_smush_reset' );\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open( 'POST', ajaxurl + '?action=reset_settings', true );\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tconst res = JSON.parse( xhr.response );\n\t\t\t\t\tif ( 'undefined' !== typeof res.success && res.success ) {\n\t\t\t\t\t\twindow.location.href = wp_smush_msgs.smush_url;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twindow.console.log(\n\t\t\t\t\t\t'Request failed. Returned status of ' + xhr.status\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send( '_ajax_nonce=' + _nonce.value );\n\t\t},\n\t};\n\n\tWP_Smush.helpers.init();\n} )();\n","/* global ajaxurl */\n/* global wp_smush_msgs */\n\n/**\n * @typedef {Object} jQuery\n * @property\n */\n( function( $ ) {\n\t'use strict';\n\n\t/**\n\t * S3 support alert.\n\t *\n\t * @since 3.6.2 Moved from class-s3.php\n\t */\n\tif ( $( '#wp-smush-s3support-alert' ).length ) {\n\t\tconst noticeOptions = {\n\t\t\ttype: 'warning',\n\t\t\ticon: 'info',\n\t\t\tdismiss: {\n\t\t\t\tshow: true,\n\t\t\t\tlabel: wp_smush_msgs.noticeDismiss,\n\t\t\t\ttooltip: wp_smush_msgs.noticeDismissTooltip,\n\t\t\t},\n\t\t};\n\n\t\twindow.SUI.openNotice(\n\t\t\t'wp-smush-s3support-alert',\n\t\t\t$( '#wp-smush-s3support-alert' ).data( 'message' ),\n\t\t\tnoticeOptions\n\t\t);\n\t}\n\n\t// Dismiss S3 support alert.\n\t$( '#wp-smush-s3support-alert' ).on( 'click', 'button', () => {\n\t\t$.post( ajaxurl, { action: 'dismiss_s3support_alert' } );\n\t} );\n\n\t// Remove API message.\n\t$( '#wp-smush-api-message button.sui-button-icon' ).on( 'click', function(\n\t\te\n\t) {\n\t\te.preventDefault();\n\t\tconst notice = $( '#wp-smush-api-message' );\n\t\tnotice.slideUp( 'slow', function() {\n\t\t\tnotice.remove();\n\t\t} );\n\t\t$.post( ajaxurl, { action: 'hide_api_message' } );\n\t} );\n\n\t// Hide the notice after a CTA button was clicked\n\tfunction removeNotice(e) {\n\t\tconst $notice = $(e.currentTarget).closest('.smush-notice');\n\t\t$notice.fadeTo(100, 0, () =>\n\t\t\t$notice.slideUp(100, () => $notice.remove())\n\t\t);\n\t}\n\n\t// Only used for the Dashboard notification for now.\n\t$('.smush-notice .smush-notice-act').on('click', (e) => {\n\t\tremoveNotice(e);\n\t});\n\n\t// Only used for the upgrade notice.\n\t$('.smush-notice .smush-notice-dismiss').on('click', (e) => {\n\t\tremoveNotice(e);\n\t\t$.post(ajaxurl, { action: 'dismiss_upgrade_notice' });\n\t});\n\n\t// Dismiss the update notice.\n\t$( '.wp-smush-update-info' ).on( 'click', '.notice-dismiss', ( e ) => {\n\t\te.preventDefault();\n\t\tremoveNotice(e);\n\t\t$.post( ajaxurl, { action: 'dismiss_update_info' } );\n\t} );\n} )( jQuery );\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * Modals JavaScript code.\n */\n( function() {\n\t'use strict';\n\n\t/**\n\t * Onboarding modal.\n\t *\n\t * @since 3.1\n\t */\n\tWP_Smush.onboarding = {\n\t\tmembership: 'free', // Assume free by default.\n\t\tonboardingModal: document.getElementById( 'smush-onboarding-dialog' ),\n\t\tscanFilesModal: document.getElementById( 'checking-files-dialog' ),\n\t\tsettings: {\n\t\t\tfirst: true,\n\t\t\tlast: false,\n\t\t\tslide: 'start',\n\t\t\tvalue: false,\n\t\t},\n\t\tselection: {\n\t\t\tauto: true,\n\t\t\tlossy: true,\n\t\t\tstrip_exif: true,\n\t\t\toriginal: false,\n\t\t\tlazy_load: true,\n\t\t\tusage: false,\n\t\t},\n\t\tcontentContainer: document.getElementById( 'smush-onboarding-content' ),\n\t\tonboardingSlides: [\n\t\t\t'start',\n\t\t\t'auto',\n\t\t\t'lossy',\n\t\t\t'strip_exif',\n\t\t\t'original',\n\t\t\t'lazy_load',\n\t\t\t'usage',\n\t\t],\n\t\ttouchX: null,\n\t\ttouchY: null,\n\n\t\t/**\n\t\t * Init module.\n\t\t */\n\t\tinit() {\n\t\t\tif ( ! this.onboardingModal ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst dialog = document.getElementById( 'smush-onboarding' );\n\n\t\t\tthis.membership = dialog.dataset.type;\n\n\t\t\tif ( 'pro' !== this.membership ) {\n\t\t\t\tthis.onboardingSlides = [\n\t\t\t\t\t'start',\n\t\t\t\t\t'auto',\n\t\t\t\t\t'strip_exif',\n\t\t\t\t\t'lazy_load',\n\t\t\t\t\t'usage',\n\t\t\t\t];\n\t\t\t\tthis.selection.lossy = false;\n\t\t\t}\n\n\t\t\tif ( 'false' === dialog.dataset.tracking ) {\n\t\t\t\tthis.onboardingSlides.pop();\n\t\t\t}\n\n\t\t\tthis.renderTemplate();\n\n\t\t\t// Skip setup.\n\t\t\tconst skipButton = this.onboardingModal.querySelector(\n\t\t\t\t'.smush-onboarding-skip-link'\n\t\t\t);\n\t\t\tif ( skipButton ) {\n\t\t\t\tskipButton.addEventListener( 'click', this.skipSetup );\n\t\t\t}\n\n\t\t\t// Show the modal.\n\t\t\twindow.SUI.openModal(\n\t\t\t\t'smush-onboarding-dialog',\n\t\t\t\t'checking-files-dialog',\n\t\t\t\tundefined,\n\t\t\t\tfalse\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Get swipe coordinates.\n\t\t *\n\t\t * @param {Object} e\n\t\t */\n\t\thandleTouchStart( e ) {\n\t\t\tconst firstTouch = e.touches[ 0 ];\n\t\t\tthis.touchX = firstTouch.clientX;\n\t\t\tthis.touchY = firstTouch.clientY;\n\t\t},\n\n\t\t/**\n\t\t * Process swipe left/right.\n\t\t *\n\t\t * @param {Object} e\n\t\t */\n\t\thandleTouchMove( e ) {\n\t\t\tif ( ! this.touchX || ! this.touchY ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst xUp = e.touches[ 0 ].clientX,\n\t\t\t\tyUp = e.touches[ 0 ].clientY,\n\t\t\t\txDiff = this.touchX - xUp,\n\t\t\t\tyDiff = this.touchY - yUp;\n\n\t\t\tif ( Math.abs( xDiff ) > Math.abs( yDiff ) ) {\n\t\t\t\tif ( xDiff > 0 ) {\n\t\t\t\t\tif ( false === WP_Smush.onboarding.settings.last ) {\n\t\t\t\t\t\tWP_Smush.onboarding.next( null, 'next' );\n\t\t\t\t\t}\n\t\t\t\t} else if ( false === WP_Smush.onboarding.settings.first ) {\n\t\t\t\t\tWP_Smush.onboarding.next( null, 'prev' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.touchX = null;\n\t\t\tthis.touchY = null;\n\t\t},\n\n\t\t/**\n\t\t * Update the template, register new listeners.\n\t\t *\n\t\t * @param {string} directionClass Accepts: fadeInRight, fadeInLeft, none.\n\t\t */\n\t\trenderTemplate( directionClass = 'none' ) {\n\t\t\t// Grab the selected value.\n\t\t\tconst input = this.onboardingModal.querySelector(\n\t\t\t\t'input[type=\"checkbox\"]'\n\t\t\t);\n\t\t\tif ( input ) {\n\t\t\t\tthis.selection[ input.id ] = input.checked;\n\t\t\t}\n\n\t\t\tconst template = WP_Smush.onboarding.template( 'smush-onboarding' );\n\t\t\tconst content = template( this.settings );\n\n\t\t\tif ( content ) {\n\t\t\t\tthis.contentContainer.innerHTML = content;\n\n\t\t\t\tif ( 'none' === directionClass ) {\n\t\t\t\t\tthis.contentContainer.classList.add( 'loaded' );\n\t\t\t\t} else {\n\t\t\t\t\tthis.contentContainer.classList.remove( 'loaded' );\n\t\t\t\t\tthis.contentContainer.classList.add( directionClass );\n\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\tthis.contentContainer.classList.add( 'loaded' );\n\t\t\t\t\t\tthis.contentContainer.classList.remove(\n\t\t\t\t\t\t\tdirectionClass\n\t\t\t\t\t\t);\n\t\t\t\t\t}, 600 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.onboardingModal.addEventListener(\n\t\t\t\t'touchstart',\n\t\t\t\tthis.handleTouchStart,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tthis.onboardingModal.addEventListener(\n\t\t\t\t'touchmove',\n\t\t\t\tthis.handleTouchMove,\n\t\t\t\tfalse\n\t\t\t);\n\n\t\t\tthis.bindSubmit();\n\t\t},\n\n\t\t/**\n\t\t * Catch \"Finish setup wizard\" button click.\n\t\t */\n\t\tbindSubmit() {\n\t\t\tconst submitButton = this.onboardingModal.querySelector(\n\t\t\t\t'button[type=\"submit\"]'\n\t\t\t);\n\t\t\tconst self = this;\n\n\t\t\tif ( submitButton ) {\n\t\t\t\tsubmitButton.addEventListener( 'click', function( e ) {\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t// Because we are not rendering the template, we need to update the last element value.\n\t\t\t\t\tconst input = self.onboardingModal.querySelector(\n\t\t\t\t\t\t'input[type=\"checkbox\"]'\n\t\t\t\t\t);\n\t\t\t\t\tif ( input ) {\n\t\t\t\t\t\tself.selection[ input.id ] = input.checked;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst _nonce = document.getElementById(\n\t\t\t\t\t\t'smush_quick_setup_nonce'\n\t\t\t\t\t);\n\n\t\t\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\t\t\txhr.open( 'POST', ajaxurl + '?action=smush_setup', true );\n\t\t\t\t\txhr.setRequestHeader(\n\t\t\t\t\t\t'Content-type',\n\t\t\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t\t\t);\n\t\t\t\t\txhr.onload = () => {\n\t\t\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\t\t\tWP_Smush.onboarding.showScanDialog();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twindow.console.log(\n\t\t\t\t\t\t\t\t'Request failed. Returned status of ' +\n\t\t\t\t\t\t\t\t\txhr.status\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\txhr.send(\n\t\t\t\t\t\t'smush_settings=' +\n\t\t\t\t\t\t\tJSON.stringify( self.selection ) +\n\t\t\t\t\t\t\t'&_ajax_nonce=' +\n\t\t\t\t\t\t\t_nonce.value\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Handle navigation.\n\t\t *\n\t\t * @param {Object} e\n\t\t * @param {null|string} whereTo\n\t\t */\n\t\tnext( e, whereTo = null ) {\n\t\t\tconst index = this.onboardingSlides.indexOf( this.settings.slide );\n\t\t\tlet newIndex = 0;\n\n\t\t\tif ( ! whereTo ) {\n\t\t\t\tnewIndex =\n\t\t\t\t\tnull !== e && e.classList.contains( 'next' )\n\t\t\t\t\t\t? index + 1\n\t\t\t\t\t\t: index - 1;\n\t\t\t} else {\n\t\t\t\tnewIndex = 'next' === whereTo ? index + 1 : index - 1;\n\t\t\t}\n\n\t\t\tconst directionClass =\n\t\t\t\tnull !== e && e.classList.contains( 'next' )\n\t\t\t\t\t? 'fadeInRight'\n\t\t\t\t\t: 'fadeInLeft';\n\n\t\t\tthis.settings = {\n\t\t\t\tfirst: 0 === newIndex,\n\t\t\t\tlast: newIndex + 1 === this.onboardingSlides.length, // length !== index\n\t\t\t\tslide: this.onboardingSlides[ newIndex ],\n\t\t\t\tvalue: this.selection[ this.onboardingSlides[ newIndex ] ],\n\t\t\t};\n\n\t\t\tthis.renderTemplate( directionClass );\n\t\t},\n\n\t\t/**\n\t\t * Handle circle navigation.\n\t\t *\n\t\t * @param {string} target\n\t\t */\n\t\tgoTo( target ) {\n\t\t\tconst newIndex = this.onboardingSlides.indexOf( target );\n\n\t\t\tthis.settings = {\n\t\t\t\tfirst: 0 === newIndex,\n\t\t\t\tlast: newIndex + 1 === this.onboardingSlides.length, // length !== index\n\t\t\t\tslide: target,\n\t\t\t\tvalue: this.selection[ target ],\n\t\t\t};\n\n\t\t\tthis.renderTemplate();\n\t\t},\n\n\t\t/**\n\t\t * Skip onboarding experience.\n\t\t */\n\t\tskipSetup: () => {\n\t\t\tconst _nonce = document.getElementById( 'smush_quick_setup_nonce' );\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open(\n\t\t\t\t'POST',\n\t\t\t\tajaxurl + '?action=skip_smush_setup&_ajax_nonce=' + _nonce.value\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tWP_Smush.onboarding.showScanDialog();\n\t\t\t\t} else {\n\t\t\t\t\twindow.console.log(\n\t\t\t\t\t\t'Request failed. Returned status of ' + xhr.status\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send();\n\t\t},\n\n\t\t/**\n\t\t * Show checking files dialog.\n\t\t */\n\t\tshowScanDialog() {\n\t\t\twindow.SUI.closeModal();\n\t\t\twindow.SUI.openModal(\n\t\t\t\t'checking-files-dialog',\n\t\t\t\t'wpbody-content',\n\t\t\t\tundefined,\n\t\t\t\tfalse\n\t\t\t);\n\n\t\t\tconst nonce = document.getElementById( 'wp_smush_options_nonce' );\n\n\t\t\tsetTimeout( () => {\n\t\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\t\txhr.open( 'POST', ajaxurl + '?action=scan_for_resmush', true );\n\t\t\t\txhr.setRequestHeader(\n\t\t\t\t\t'Content-type',\n\t\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t\t);\n\t\t\t\txhr.onload = () => {\n\t\t\t\t\tconst elem = document.querySelector(\n\t\t\t\t\t\t'#smush-onboarding-dialog'\n\t\t\t\t\t);\n\t\t\t\t\telem.parentNode.removeChild( elem );\n\n\t\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t\t\twindow.location.search = 'page=smush-bulk';\n\t\t\t\t\t\t}, 1000 );\n\t\t\t\t\t} else {\n\t\t\t\t\t\twindow.console.log(\n\t\t\t\t\t\t\t'Request failed. Returned status of ' + xhr.status\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\txhr.send(\n\t\t\t\t\t'type=media&get_ui=false&process_settings=false&wp_smush_options_nonce=' +\n\t\t\t\t\t\tnonce.value\n\t\t\t\t);\n\t\t\t}, 3000 );\n\t\t},\n\n\t\t/**\n\t\t * Hide new features modal.\n\t\t *\n\t\t * @since 3.7.0\n\t\t */\n\t\thideUpgradeModal: () => {\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', ajaxurl + '?action=hide_new_features');\n\t\t\txhr.send();\n\t\t},\n\t};\n\n\t/**\n\t * Template function (underscores based).\n\t *\n\t * @type {Function}\n\t */\n\tWP_Smush.onboarding.template = _.memoize( ( id ) => {\n\t\tlet compiled;\n\t\tconst options = {\n\t\t\tevaluate: /<#([\\s\\S]+?)#>/g,\n\t\t\tinterpolate: /{{{([\\s\\S]+?)}}}/g,\n\t\t\tescape: /{{([^}]+?)}}(?!})/g,\n\t\t\tvariable: 'data',\n\t\t};\n\n\t\treturn ( data ) => {\n\t\t\t_.templateSettings = options;\n\t\t\tcompiled =\n\t\t\t\tcompiled ||\n\t\t\t\t_.template( document.getElementById( id ).innerHTML );\n\t\t\treturn compiled( data );\n\t\t};\n\t} );\n\n\twindow.addEventListener( 'load', () => WP_Smush.onboarding.init() );\n} )();\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * CDN functionality.\n *\n * @since 3.0\n */\n( function() {\n\t'use strict';\n\n\tWP_Smush.CDN = {\n\t\tcdnEnableButton: document.getElementById( 'smush-enable-cdn' ),\n\t\tcdnDisableButton: document.getElementById( 'smush-cancel-cdn' ),\n\t\tcdnStatsBox: document.querySelector( '.smush-cdn-stats' ),\n\n\t\tinit() {\n\t\t\t/**\n\t\t\t * Handle \"Get Started\" button click on disabled CDN page.\n\t\t\t */\n\t\t\tif ( this.cdnEnableButton ) {\n\t\t\t\tthis.cdnEnableButton.addEventListener( 'click', ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.currentTarget.classList.add( 'sui-button-onload' );\n\t\t\t\t\tthis.toggle_cdn( true );\n\t\t\t\t} );\n\t\t\