­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ !function(){var e={111:function(e,t,s){"use strict";s.r(t);var i=s(446),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(''+wp_smush_msgs[o]+""),e.post(ajaxurl,r,(function(e){!function(e){var t=e.parent();t.css({opacity:"1"}),t.find("a").prop("disabled",!1)}(s),e.success&&void 0!==e.data?(void 0!==this.data&&this.data.indexOf("nextgen")>-1||"restore"===o?s.parents().eq(1).html(e.data.stats):s.parents().eq(1).html(e.data),void 0!==e.data&&"restore"===o&&i.Z.updateImageStats(e.data.new_size)):e.data&&e.data.error_msg&&s.parent().append(e.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","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()?"-":"+")})),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","

"+t.data.notice+"

",{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)}))},447: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;0100&&(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/g,interpolate:/{{{([\s\S]+?)}}}/g,escape:/{{([^}]+?)}}(?!})/g,variable:"data"};return function(i){return _.templateSettings=s,(t=t||_.template(document.getElementById(e).innerHTML))(i)}}))}()},413:function(e,t,s){"use strict";s.r(t);var i,n=s(446);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()},140:function(e,t,s){"use strict";s.r(t);var i,n=s(445),o=function(e,t){e=parseInt(e),t=parseInt(t);var s=!1,i=0,n=0,o={scan:function(){var s=e-t;0!==t?a(s):jQuery.post(ajaxurl,{action:"directory_smush_start"},(function(){return a(s)}))},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"},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){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)):void 0!==e.data.error&&"dir_smush_limit_exceeded"===e.data.error?o.limitReached():(i++,t++,a-=1,o.onFinishStep(o.getProgress()),s(a))}))):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.parent().find(".add-dir-loader").addClass("sui-icon-loader sui-loading");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, .sui-dialog-close, .wp-smush-cancel-dir",(function(t){t.preventDefault(),i(this).parent().find(".add-dir-loader").addClass("sui-icon-loader sui-loading"),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(n,o){o.result=new Promise((function(e,t){s.data.dir=o.node.key,i.ajax(s).done((function(t){return e(t)})).fail(t)})),o.result.then(t.html(e.wp_smush_msgs.add_dir))},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()},65: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&&n=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="

".concat(e,"

");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)},579: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()}))}()},110: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 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()}()},933: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"),200===i.status){var t=JSON.parse(i.response);void 0!==t.success&&t.success?function(e){var t="

".concat(e,"

"),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-text"),t(e(this).serialize(),"bulk"),function(){e("#save-settings-button").addClass("sui-button-onload-text");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(t){e("#save-settings-button").removeClass("sui-button-onload-text")}))}()})),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)},446: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})(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;s2&&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=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(""+s+" "+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='
'+(void 0===s?'':s)+''+("undefined"===t||void 0===t?"undefined":t)+''+e+"
";return"media"===n&&(o=o+'
'),o+="
"}},{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=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(''+window.wp_smush_msgs.smushing+""),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,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},442: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"),applyHtaccessButton:document.getElementById("smush-webp-apply-htaccess"),removeHtaccessButton:document.getElementById("smush-webp-remove-htaccess"),selectedServer:"",serverSelector:null,serverInstructions:[],init:function(){var e=this,t=this;if(t.serverSelector=document.getElementById("webp-server-type"),t.serverSelector){t.selectedServer=t.serverSelector.value,jQuery(t.serverSelector).on("change",(function(e){var s=e.currentTarget.value;t.hideCurrentInstructions(),t.showServerInstructions(s),t.selectedServer=s}));for(var s=document.querySelectorAll(".webp-server-instructions"),i=0;i");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)},writeHtaccess:function(e,t){var s=this;e.preventDefault();var i=e.currentTarget;i.classList.add("sui-button-onload");var n=new XMLHttpRequest;n.open("POST",ajaxurl+"?action=smush_webp_write_htaccess_rules",!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.onload=function(){i.classList.remove("sui-button-onload");var e,t=!1,o=JSON.parse(n.response);200===n.status?void 0!==o.success&&o.success&&location.reload():t=window.wp_smush_msgs.generic_ajax_error,o&&o.data&&o.data.message&&(t=o.data.message,e="warning"),t&&s.showNotice(t,e)};var o="apply"===t?"apply":"remove",a=document.getElementsByName("wp_smush_options_nonce");n.send("write_action="+o+"&_ajax_nonce="+a[0].value)},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="

".concat(e,"

"),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="

".concat(document.getElementById("wp-smush-webp-delete-all-notice").dataset.message,"

");window.SUI.openNotice("wp-smush-webp-delete-all-notice",e,{type:"success",icon:"check-tick",dismiss:{show:!0}})}},hideCurrentInstructions:function(){this.serverInstructions[this.selectedServer]&&this.serverInstructions[this.selectedServer].classList.add("sui-hidden")},showServerInstructions:function(e){void 0!==this.serverInstructions[e]&&this.serverInstructions[e].classList.remove("sui-hidden")}},WP_Smush.WebP.init()}()},445:function(e,t,s){var i,n,o;n=[s(609),s(860)],void 0===(o="function"==typeof(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={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},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=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=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(t){if(null===t)return this.remove(),I(this);var s,i,n={children:!0,expanded:!0,parent:!0};for(s in t)t.hasOwnProperty(s)&&(i=t[s],n[s]||e.isFunction(i)||(_[s]?this[s]=i:this.data[s]=i));return t.hasOwnProperty("children")&&(this.removeChildren(),t.children&&this._setChildren(t.children)),this.isVisible()&&(this.renderTitle(),this.renderStatus()),t.hasOwnProperty("expanded")?this.setExpanded(t.expanded):I(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=4&&(Array.prototype.unshift.call(arguments,this.toString()),k("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()),k("error",arguments))},findAll:function(t){t=e.isFunction(t)?t:z(t);var s=[];return this.visit((function(e){t(e)&&s.push(e)})),s},findFirst:function(t){t=e.isFunction(t)?t:z(t);var s=null;return this.visit((function(e){if(t(e))return s=e,!1})),s},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:b(!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=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()),k("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=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 b((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":b((n=e.inArray(t,r.children))>=0,"invalid target parent"),r.children.splice(n,0,this);break;case"after":b((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(),I()):i.setActive()}return this.warn("Could not find related node '"+t+"'."),I()},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 b(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;tg+f-m&&(y=u+h-f+m,w&&(b(w.isRootNode()||w.isVisible(),"topNode must be visible"),ri?1:-1},n.sort(e),t)for(s=0,i=n.length;s=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=e.trim(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=2&&(Array.prototype.unshift.call(arguments,this.toString()),k("warn",arguments))}},A.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 e.isFunction(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)=4&&(Array.prototype.unshift.call(arguments,this.toString()),k("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()),k("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?H(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("",{type:"checkbox",name:o,value:t.key,checked:!0}))}u.length?u.empty():u=e("
",{id:r}).hide().insertAfter(this.$container),!1!==s&&this.activeNode&&u.append(e("",{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()),k("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}),e.isArray(t)||(t=[t]),n=0;n=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(b((i=(o=n.children).indexOf(l)+a)>=0,"Could not find "+l+" in parent's children: "+n),s=i;s=2&&(Array.prototype.unshift.call(arguments,this.toString()),k("warn",arguments))}},e.extend(A.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;i500&&(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 e.isFunction(s)&&(s=s.call(l,{type:"source"},t),b(!e.isFunction(s),"source callback must not return another function")),e.isFunction(s.then)?a=s:s.url?(i=e.extend({},t.options.ajax,s)).debugDelay?(n=i.debugDelay,delete i.debugDelay,e.isArray(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)||e.isArray(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]);(e.isArray(p)||e.isPlainObject(p)&&e.isArray(p.children))&&(i=p)}else i&&i.hasOwnProperty("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)?(b(c.isRootNode(),"source may only be an object for root nodes (expecting an array of child objects otherwise)"),b(e.isArray(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,b(e.isArray(i),"expected array of children"),c._setChildren(i),l.options.nodata&&0===i.length&&(e.isFunction(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 b(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),b((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,k=null;if(!1!==m._enableUpdate&&(w||_.ul)){if(b(w||_.ul,"parent UL must exist"),w||(p.li&&(s||p.li.parentNode!==p.parent.ul)&&(p.li.parentNode===p.parent.ul?k=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;d1&&v.push("")):v.push(""),(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("")),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='"+P(c)+"'":"","string"==typeof r?n.test(r)?(r="/"===r.charAt(0)?r:(m.imagePath||"")+r,v.push("")):v.push(""):r.text?v.push(""+i.escapeHtml(r.text)+""):r.html?v.push(""+r.html+""):v.push("")),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=""+(m.escapeTitles?i.escapeHtml(h.title):h.title)+""),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)?I(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)?T(o,["rejected"]):(s?(a.activeNode&&(b(a.activeNode!==o,"node was active (inconsistency)"),n=e.extend({},t,{node:a.activeNode}),a.nodeSetActive(n,!1),b(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)):(b(a.activeNode===o,"node was not active (inconsistency)"),a.activeNode=null,this.nodeRenderStatus(t),u||t.tree._triggerNodeEvent("deactivate",o,t.originalEvent)),I(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."),T(l,["recursion"]);if(l.expanded&&s||!l.expanded&&!s)return I(l);if(s&&!l.lazy&&!l.hasChildren())return I(l);if(!s&&l.getLevel()=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,L(a))):(i.warn("No `source` option was passed and container does not contain `
    `: assuming `source: []`."),s=[]);break;case"json":s=e.parseJSON(u.text()),u.contents().filter((function(){return 3===this.nodeType})).remove(),e.isPlainObject(s)&&(b(e.isArray(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 A(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 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.0",buildType:"production",debugLevel:3,_nextId:1,_nextNodeKey:1,_extensions:{},_FancytreeClass:A,_FancytreeNodeClass:D,jquerySupports:{positionMyOfs:S(e.ui.version,1,9)},assert:function(e,t){return b(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&&k("log",arguments)},error:function(t){e.ui.fancytree.debugLevel>=1&&k("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 D)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 A?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(t,s,i,n,o){var a,r,u=s.tree,d=n[t],l=i[t];return e.isFunction(d)?(a={node:s,tree:u,widget:u.widget,options:u.widget.options,typeInfo:u.types[s.type]||{}},null==(r=d.call(u,{type:t},a))&&(r=l)):r=null==l?d:l,null==r&&(r=o),r},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&&k("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(/
      =0&&(y.title=y.title.substring(0,a))),y.title=e.trim(y.title),o=0,r=m.length;oul").first()).length?y.children=e.ui.fancytree.parseHtml(t):y.children=y.lazy?void 0:null,c.push(y)})),c},registerExtension:function(t){b(null!=t.name,"extensions must have a `name` property."),b(null!=t.version,"extensions must have a `version` property."),e.ui.fancytree._extensions[t.name]=t},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&&k("warn",arguments)}}),e.ui.fancytree}function b(t,s){t||(s="Fancytree assertion failed"+(s=s?": "+s:""),e.ui.fancytree.error(s),e.error(s))}function k(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;sr;return!0}function C(){var t,s,i,n,o,a=arguments[0]||{},r=1,u=arguments.length;if("object"==typeof a||e.isFunction(a)||(a={}),r===u)throw Error("need at least two args");for(;r=0}}function H(e){var t=new RegExp("^"+e,"i");return function(e){return t.test(e.title)}}function D(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;nul.fancytree-container").remove();var s,n={tree:this};this.rootNode=new D(n,{title:"root",key:"root_"+this._id,children:null,expanded:!0}),this.rootNode.parent=null,s=e("
        ",{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")})?i.apply(t,n):i)||(e.exports=o)},860:function(e,t,s){var i,n,o;n=[s(609)],void 0===(o="function"==typeof(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",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
"),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.width0?"right":"center",vertical:l<0?"top":u>0?"bottom":"middle"};ps(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||s0&&((n=e.left-t.collisionPosition.marginLeft+h+p+m-u)>0||i(n)0&&((s=e.top-t.collisionPosition.marginTop+h+p+m-u)>0||i(s)this.length)&&-1!==this.indexOf(e,t)}),s(65),s(111),s(413),s(579),s(140),s(110),s(442),s(972),s(447),s(933),s(206)}()}(); //# sourceMappingURL=smush-admin.min.js.map