!function(e){var t={};function n(i){if(t[i])return t[i].exports;var s=t[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(i,s,function(t){return e[t]}.bind(null,s));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=131)}({131:function(e,t,n){"use strict";var i=i||{};window.WP_Smush=i,n(132),n(133),n(134),n(135),n(136),n(140)},132:function(e,t,n){"use strict";jQuery,WP_Smush.helpers={init:function(){},formatBytes:function(e,t){var n=["KB","MB","GB","TB","PB"];if(Math.abs(e)<1024)return e+" B";var i=-1;do{e/=1024,++i}while(Math.abs(e)>=1024&&i=0?1:-1;return e=e>100?100:e,Math.round(e*Math.pow(10,t)+.001*n)/Math.pow(10,t)},findPos:function(e){var t=0;if(e.offsetParent){do{t+=e.offsetTop}while(e=e.offsetParent);return[t]}},geturlparam:function(e){for(var t=window.location.search.substring(1).split("&"),n=0;n0&&(WDP.showOverlay("#smush-quick-setup",{title:wp_smush_msgs.quick_setup_title,class:"no-close wp-smush-overlay wp-smush-quick-setup"}),e("dialog#smush-quick-setup").remove());var t=function(t,n,s,r){if("disabled"==n.attr("disabled"))return!1;t.preventDefault(),e(".wp-smush-error").remove(),e(".smush-stats-wrapper").hide();var o="grid";"smush_restore_image"==s&&(o=e(document).find("div.media-modal.wp-core-ui").length>0?"grid":window.location.search.indexOf("item")>-1?"grid":"list");var a={action:s,attachment_id:n.data("id"),mode:o,_nonce:n.data("nonce")};!function(e){var t=e.parent();t.css({opacity:"0.5"}),t.find("a").attr("disabled","disabled")}(n),i.default.progress_bar(n,wp_smush_msgs[r],"show"),e.post(ajaxurl,a,function(e){i.default.progress_bar(n,wp_smush_msgs[r],"hide"),function(e){var t=e.parent();t.css({opacity:"1"}),t.find("a").removeAttr("disabled")}(n),e.success&&void 0!==e.data.button?(void 0!==this.data&&this.data.indexOf("nextgen")>-1?n.parent().html(e.data.button):n.parents().eq(1).html(e.data.button),void 0!==e.data&&"restore"===r&&i.default.update_image_stats(e.data.new_size)):e.data.message&&n.parent().append(e.data.message)})},n=function(t,n){t.text("").addClass("sui-button-onload sui-icon-loader sui-loading").blur();var r=t.data("type");r=void 0===r?"media":r,e("button.wp-smush-all").removeAttr("data-smush");var o=e(".sui-notice-top.sui-notice-success");o.slideUp(100,function(){o.remove()}),e(".wp-smush-all").attr("disabled","disabled"),e(".wp-smush-settings-changed").hide();var a={action:"scan_for_resmush",type:r,get_ui:!0,process_settings:n,wp_smush_options_nonce:jQuery("#wp_smush_options_nonce").val()};e.get(ajaxurl,a,function(t){if(void 0!==t.data){if(void 0!==t.data.resmush_ids){wp_smushit_data.resmush=t.data.resmush_ids,"undefinied"!=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),"nextgen"==r&&(wp_smushit_data.bytes=parseInt(wp_smushit_data.size_before)-parseInt(wp_smushit_data.size_after));var n=wp_smushit_data.count_smushed/wp_smushit_data.count_total*100;n=WP_Smush.helpers.precise_round(n,1),e(".wp-smush-images-percent").html(n);var s=e(".bulk-smush-wrapper .sui-notice");s.length>0&&(s.hide(),e(".wp-smush-pagespeed-recommendation").hide()),e(".wp-smush-resmush-notice").remove(),e(".wp-smush-bulk-wrapper").show(),void 0!==t.data.count&&function(e){if(void 0===e)return!1;var t=wp_smushit_data.count_total-e,n=jQuery(".bulk-smush-wrapper .wp-smush-progress-inner");if(!(n.length<1)){var i=t/wp_smushit_data.count_total*100;n.css("width",i+"%")}}(t.data.count)}if(void 0!==t.data.content&&e(".bulk-smush-wrapper .sui-box-body").prepend(t.data.content),void 0!==t.data.notice&&e(".wp-smush-page-header").after(t.data.notice),e("div.smush-final-log").hide(),void 0!==t.data.super_smush&&t.data.super_smush){var o=jQuery(".wp-smush-enable-lossy");o.length>0&&o.remove(),"undefined"!==t.data.super_smush_stats&&e(".super-smush-attachments .wp-smush-stats").html(t.data.super_smush_stats)}i.default.update_stats(r)}}).always(function(){jQuery(".bulk-smush-wrapper .wp-smush-bulk-progress-bar-wrapper").hide(),t.text(wp_smush_msgs.resmush_complete).removeClass("sui-button-onload sui-icon-loader sui-loading").addClass("smush-button-check-success"),setTimeout(function(){t.removeClass("smush-button-check-success").text(wp_smush_msgs.resmush_check)},2e3),e(".wp-smush-all").removeAttr("disabled"),e(".wp-smush-re-check-message").length&&s(e(".wp-smush-re-check-message"))})},r=function(t){e(t).length>0&&e("html, body").animate({scrollTop:e(t).offset().top-100},"slow")};e("body").on("click","a.smush-stats-details",function(t){if("disabled"==e(this).attr("disabled"))return!1;t.preventDefault();var n=e(this).find(".stats-toggle");e(this).parents().eq(1).find(".smush-stats-wrapper").slideToggle(),n.text("+"==n.text()?"-":"+")}),e("body").on("click",".wp-smush-send:not(.wp-smush-resmush)",function(t){t.preventDefault(),new i.default(e(this),!1)}),e("body").on("click",".wp-smush-nextgen-send",function(t){t.preventDefault(),new i.default(e(this),!1,"nextgen")}),e("body").on("click",".wp-smush-nextgen-bulk",function(t){if(t.preventDefault(),"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").attr("disabled","disabled"),e(".wp-smush-notice.wp-smush-remaining").hide(),new i.default(e(this),!0,"nextgen")}),e("body").on("click",".wp-smush-action.wp-smush-restore",function(n){var i=e(this);t(n,i,"smush_restore_image","restore");var s=i.parents().eq(1);s.hasClass("smushed")&&s.removeClass("smushed").addClass("unsmushed")}),e("body").on("click",".wp-smush-action.wp-smush-resmush",function(n){t(n,e(this),"smush_resmush_image","smushing")}),e("body").on("click",".wp-smush-action.wp-smush-nextgen-restore",function(n){t(n,e(this),"smush_restore_nextgen_image","restore")}),e("body").on("click",".wp-smush-action.wp-smush-nextgen-resmush",function(n){t(n,e(this),"smush_resmush_nextgen_image","smushing")}),e(".wp-smush-scan").on("click",function(t){t.preventDefault(),n(e(this),!1)}),e("#wp-smush-welcome-box .smush-dismiss-welcome").on("click",function(t){t.preventDefault();var n=e(this).parents().eq(1);s(n);e.post(ajaxurl,{action:"dismiss_welcome_notice"})}),e("body").on("click",".wp-smush-notice .icon-fi-close",function(t){t.preventDefault();var n=e(this).parent();s(n)}),e("input#wp-smush-save-settings").on("click",function(t){t.preventDefault();var n="",i=e('input[name="setting-type"]');i.length>0&&(n=i.val());var s=e(this);if(s.parent().find("span.sui-icon-loader.sui-loading").removeClass("sui-hidden"),""!=n&&"network"==n){var r={action:"save_settings",nonce:e("#wp_smush_options_nonce").val()};r=jQuery.param(r)+"&"+jQuery("form#wp-smush-settings-form").serialize(),jQuery.post(ajaxurl,r).done(function(){return jQuery("form#wp-smush-settings-form").submit(),!0})}else{s.parents().eq(1);var o=document.getElementById("wp-smush-strip_exif"),a=document.getElementById("wp-smush-lossy"),u=document.getElementById("wp-smush-original"),l=document.getElementById("wp-smush-resize"),c=document.getElementById("wp-smush-png_to_jpg"),d=!0;e(".wp-smush-hex-notice").hide(),null!==o&&o.checked||null!==a&&a.checked||null!==u&&u.checked||null!==l&&l.checked||null!==c&&c.checked||(d=!1),s.attr("disabled","disabled").addClass("button-grey"),d&&s.val(wp_smush_msgs.checking);var h=s.data("type");h=void 0===h?"media":h;r={action:"scan_for_resmush",wp_smush_options_nonce:jQuery("#wp_smush_options_nonce").val(),scan_type:h};r=jQuery.param(r)+"&"+jQuery("form#wp-smush-settings-form").serialize(),jQuery.post(ajaxurl,r).done(function(){return jQuery("form#wp-smush-settings-form").submit(),!0})}}),e("body").on("click",".wp-smush-skip-resmush",function(t){t.preventDefault();var n=jQuery(this),r=n.parents().eq(1),o=n.parent();s(o),e(".sui-notice-top.sui-notice-success").remove(),r.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").show(),e(".wp-smush-bulk-wrapper ").hide()),e(".wp-smush-resmush-notice").remove();var a=e(".wp-smush-scan").data("type");a=void 0===a?"media":a;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 l=jQuery(".bulk-smush-wrapper .wp-smush-progress-inner");if(!(l.length<1)){l.css("width",u+"%"),e(".wp-smush-bulk-wrapper").show(),e(".wp-smush-bulk-wrapper .sui-notice").show();var c={action:"delete_resmush_list",type:a};e.post(ajaxurl,c,function(t){if(t.success&&void 0!==t.data.stats){var n=t.data.stats;"undefinied"!=typeof wp_smushit_data&&(wp_smushit_data.count_images=void 0!==n.count_images?parseInt(wp_smushit_data.count_images)+n.count_images:wp_smushit_data.count_images,wp_smushit_data.size_before=void 0!==n.size_before?parseInt(wp_smushit_data.size_before)+n.size_before:wp_smushit_data.size_before,wp_smushit_data.size_after=void 0!==n.size_after?parseInt(wp_smushit_data.size_after)+n.size_after:wp_smushit_data.size_after,wp_smushit_data.savings_resize=void 0!==n.savings_resize?parseInt(wp_smushit_data.savings_resize)+n.savings_resize:wp_smushit_data.savings_resize,wp_smushit_data.savings_conversion=void 0!==n.savings_conversion?parseInt(wp_smushit_data.savings_conversion)+n.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!==n.count_resize?parseInt(wp_smushit_data.count_resize)+n.count_resize:wp_smushit_data.count_resize);var s=e(".bulk-smush-wrapper .wp-smush-remaining-count");s.length&&void 0!==wp_smushit_data.unsmushed&&s.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").hide(),e(".sui-notice-success.wp-smush-all-done").show()),i.default.update_stats()}})}});var o=function(){e("#wp-smush-resize").prop("checked",!0).focus(),e("div.wp-smush-resize-settings-wrap").show(),r("#column-wp-smush-resize")},a=function(){e("#wp-smush-lossy").prop("checked",!0).focus(),r("#column-wp-smush-lossy")};if(e("a.wp-smush-lossy-enable").on("click",function(e){e.preventDefault(),a()}),e(".wp-smush-resize-enable").on("click",function(e){e.preventDefault(),o()}),window.location.hash){var u=window.location.hash.substring(1);"enable-resize"===u?o():"enable-lossy"===u&&a()}if(e("body").on("click",".wp-smush-trigger-bulk",function(t){t.preventDefault(),e("button.wp-smush-all").click(),e("span.sui-notice-dismiss").click()}),e(".wp-smush-setting-row .toggle-checkbox").focus(function(){e(this).keypress(function(t){32==t.keyCode&&(t.preventDefault(),e(this).find(".toggle-checkbox").click())})}),e("body").on("blur",".wp-smush-resize-input",function(){!function(e,t,n){var i=e.find("#wp-smush-resize, #wp-smush-resize-quick-setup");if(!n)var s=e.find("#wp-smush-resize_width, #quick-setup-resize_width"),r=e.find(".sui-notice-info.wp-smush-update-width");if(!t)var o=e.find("#wp-smush-resize_height, #quick-setup-resize_height"),a=e.find(".sui-notice-info.wp-smush-update-height");var u=!1,l=!1;!i.is(":checked")||void 0===wp_smushit_data.resize_sizes||void 0===wp_smushit_data.resize_sizes.width||(!n&&void 0!==s&&parseInt(wp_smushit_data.resize_sizes.width)>parseInt(s.val())?(s.parent().addClass("sui-form-field-error"),r.show("slow"),u=!0):(s.parent().removeClass("sui-form-field-error"),r.hide(),o.hasClass("error")&&a.show("slow")),!t&&void 0!==o&&parseInt(wp_smushit_data.resize_sizes.height)>parseInt(o.val())?(o.parent().addClass("sui-form-field-error"),u||a.show("slow"),l=!0):(o.parent().removeClass("sui-form-field-error"),a.hide(),s.hasClass("error")&&r.show("slow")))}(e(this).parents().eq(4),!1,!1)}),e("body").on("click","#wp-smush-resize, #wp-smush-resize-quick-setup",function(){var t=e(this),n=e(".wp-smush-resize-settings-wrap");t.is(":checked")?n.show():n.hide()}),e("body").on("click","#wp-smush-auto",function(){var t=e(this),n=e(".wp-smush-image-size-list");t.is(":checked")?n.show():n.hide()}),e("body").on("click","#wp-smush-detection",function(){var t=e(this),n=e(".smush-highlighting-notice"),i=e(".smush-highlighting-warning");t.is(":checked")?n.length>0?n.show():i.show():(n.hide(),i.hide())}),e("#wp-smush-png_to_jpg").click(function(){var t=e(this),n=e(".wp-smush-png_to_jpg-wrap");t.is(":checked")?n.show():n.hide()}),e("#wp-smush-networkwide").on("click",function(t){e(this).is(":checked")?(e(".network-settings-wrapper").show(),e(".sui-vertical-tabs li").not(".smush-bulk").each(function(t){e(this).removeClass("sui-hidden")})):(e(".network-settings-wrapper").hide(),e(".sui-vertical-tabs li").not(".smush-bulk").each(function(t){e(this).addClass("sui-hidden")}))}),e("#wp-smush-revalidate-member").on("click",function(t){t.preventDefault();var n=e(this).parents().eq(1);n.addClass("loading-notice"),e.get(ajaxurl,{action:"smush_show_warning"},function(e){n.removeClass("loading-notice").addClass("loaded-notice"),0==e?(n.attr("data-message",wp_smush_msgs.membership_valid),s(n,1e3)):(n.attr("data-message",wp_smush_msgs.membership_invalid),setTimeout(function(){n.removeClass("loaded-notice")},1e3))})}),"undefined"!=typeof wp_smush_run_re_check&&1==wp_smush_run_re_check&&e(".wp-smush-scan").length>0&&n(e(".wp-smush-scan"),!1),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 n=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("li.smush-dir-savings .wp-smush-stats-label-message").hide(),n.length>0?n.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))}if(void 0!==t.combined_stats&&t.combined_stats.length>0){var s=t.combined_stats,r=s.smushed/s.total_count*100;(r=WP_Smush.helpers.precise_round(r,1))&&e("div.wp-smush-count-total span.wp-smush-images-percent").html(r),s.total_count&&e("span.wp-smush-count-total span.wp-smush-total-optimised").html(s.total_count),s.savings&&e("span.wp-smush-savings span.wp-smush-stats-human").html(s.savings),s.percent&&e("span.wp-smush-savings span.wp-smush-stats-percent").html(s.percent)}}(t.data):e("div.wp-smush-scan-result div.content").prepend(t.data.message)})}e(document).keyup(function(t){if(27===t.keyCode){var n=e("div.dev-overlay.wp-smush-list-dialog, div.dev-overlay.wp-smush-get-pro");if(!n.is(":visible"))return;n.find("div.close").click()}}),e("span.dismiss-recommendation").on("click",function(t){t.preventDefault();var n=e(this).parent();n.hide("slow",function(){n.remove()}),e.ajax({type:"POST",url:ajaxurl,data:{action:"hide_pagespeed_suggestion"}})}),e("div.wp-smush-api-message i.icon-fi-close").on("click",function(t){t.preventDefault();var n=e(this).parent();n.hide("slow",function(){n.remove()}),e.ajax({type:"POST",url:ajaxurl,data:{action:"hide_api_message"}})})})},134:function(e,t,n){"use strict";var i=function(e){return e&&e.__esModule?e:{default:e}}(n(92));!function(e){WP_Smush.bulk={init:function(){e("button.wp-smush-all").on("click",function(t){t.preventDefault(),e(".sui-notice-top.sui-notice-success").remove();var n=e(".wp-smush-bulk-progress-bar-wrapper");if(n.removeClass("wp-smush-exceed-limit"),n.find(".sui-progress-block .wp-smush-all").addClass("sui-hidden"),n.find(".sui-progress-block .wp-smush-cancel-bulk").removeClass("sui-hidden"),e(".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, input#wp-smush-save-settings").attr("disabled","disabled"),"undefined"==typeof wp_smushit_data||0===wp_smushit_data.unsmushed.length&&0===wp_smushit_data.resmush.length)return!1;e(".wp-smush-remaining").hide(),e(".sui-summary-smush .smush-stats-icon").removeClass("sui-icon-info sui-warning").addClass("sui-icon-loader sui-loading"),new i.default(e(this),!0)}),e("body").on("click",".smush-ignore-image",function(){e(this).attr("disabled",!0),e(this).attr("data-tooltip"),e(this).removeClass("sui-tooltip"),e.post(ajaxurl,{action:"ignore_bulk_image",id:e(this).attr("data-id")})})}},WP_Smush.bulk.init()}(jQuery)},135:function(e,t,n){"use strict";!function(e){e(window).on("load",function(){e("#smush-quick-setup-dialog").length>0&&window.SUI.dialogs["smush-quick-setup-dialog"].show()}),e(".sui-wrap").on("click",".sui-notice-dismiss",function(t){t.preventDefault(),e(this).parent().stop().slideUp("slow")}),e("#smush-quick-setup-submit").on("click",function(){var t=e(this);e.ajax({type:"POST",url:ajaxurl,data:e("#smush-quick-setup-form").serialize(),beforeSend:function(){t.attr("disabled","disabled"),e('').insertAfter(t)},success:function(e){t.removeAttr("disabled"),t.parent().find("span.spinner").remove(),location.reload()}})}),e(".smush-skip-setup").on("click",function(){var t=e("form#smush-quick-setup-form");e.ajax({type:"POST",url:ajaxurl,data:t.serialize(),beforeSend:function(){t.find(".button").attr("disabled","disabled")}})})}(jQuery)},136:function(e,t,n){"use strict";var i=n(137),s=function(e){return e&&e.__esModule?e:{default:e}}(n(139));!function(e){WP_Smush.directory={selected:[],tree:[],wp_smush_msgs:[],init:function(){var t=this,n=e("#wp-smush-progress-dialog"),i=0,r=0;void 0!==wp_smushit_data.dir_smush&&(i=wp_smushit_data.dir_smush.totalSteps,r=wp_smushit_data.dir_smush.currentScanStep),this.scanner=new s.default(i,r),wp_smush_msgs&&(this.wp_smush_msgs=wp_smush_msgs),e("div.sui-wrap").on("click","button.wp-smush-browse",function(n){n.preventDefault(),e("div.wp-smush-scan-result div.wp-smush-notice").hide(),e(this).attr("disabled")||(e(this).attr("disabled","disabled"),e("div.wp-smush-info").remove(),t.showSmushDialog(),t.initFileTree())}),e("body").on("click","a.wp-smush-dir-link",function(n){e("div.sui-wrap button.wp-smush-browse").length>0&&(n.preventDefault(),SUI.dialogs["wp-smush-list-dialog"].show(),t.initFileTree())}),e(".wp-smush-select-dir").on("click",function(n){if(n.preventDefault(),!e(this).attr("disabled")){var i=e(this);e("div.wp-smush-list-dialog div.sui-box-body").css({opacity:"0.8"}),e("div.wp-smush-list-dialog div.sui-box-body a").unbind("click"),i.attr("disabled","disabled"),i.parent().find(".add-dir-loader").addClass("sui-icon-loader sui-loading");var r=t.tree.getSelectedNodes(),o=e('input[name="wp-smush-base-path"]').val(),a=[];r.forEach(function(e){a.push(o+"/"+e.key)});var u={action:"image_list",smush_path:a,image_list_nonce:e('input[name="image_list_nonce"]').val()};e.get(ajaxurl,u,function(e){SUI.dialogs["wp-smush-list-dialog"].hide(),t.scanner=new s.default(e.data,0),t.showProgressDialog(e.data),t.scanner.scan()})}}),e("#wp-smush-list-dialog").on("click",".sui-dialog-close",function(){e(".wp-smush-browse").removeAttr("disabled"),SUI.dialogs["wp-smush-list-dialog"].hide(),e(".wp-smush-select-dir, button.wp-smush-browse, a.wp-smush-dir-link").removeAttr("disabled"),e(".wp-smush-select-dir, .wp-smush-list-dialog .sui-box-body").css({opacity:"1"})}),n.on("click",".sui-icon-close, .sui-dialog-close, .wp-smush-cancel-dir",function(n){n.preventDefault(),e(this).parent().find(".add-dir-loader").addClass("sui-icon-loader sui-loading"),t.scanner.cancel().done(function(){return window.location.href=t.wp_smush_msgs.directory_url})}),n.on("click",".sui-icon-play, .wp-smush-resume-scan",function(e){e.preventDefault(),t.scanner.resume()})},getDirectoryList:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n="";return e.ajax({type:"GET",url:ajaxurl,data:{action:"smush_get_directory_list",list_nonce:jQuery('input[name="list_nonce"]').val(),dir:t},success:function(e){n=e.data},async:!1}),e("button.wp-smush-select-dir").html(self.wp_smush_msgs.add_dir),n},initFileTree:function(){var t=this,n=e("button.wp-smush-select-dir");t.tree=(0,i.createTree)(".wp-smush-list-dialog .content",{autoCollapse:!0,clickFolderMode:3,checkbox:!0,debugLevel:0,selectMode:3,tabindex:"0",source:t.getDirectoryList,lazyLoad:function(e,n){return n.result=t.getDirectoryList(n.node.key)},loadChildren:function(e,t){return t.node.fixSelection3AfterClick()},select:function(){return n.attr("disabled",!+t.tree.getSelectedNodes().length)},init:function(){return n.attr("disabled",!0)}})},showSmushDialog:function(){SUI.dialogs["wp-smush-list-dialog"].show(),e(".wp-smush-list-dialog div.close").focus()},showProgressDialog:function(t){e(".wp-smush-progress-dialog .sui-progress-state-text").html("0/"+t+" "+self.wp_smush_msgs.progress_smushed),SUI.dialogs["wp-smush-progress-dialog"].show(),e(".wp-smush-progress-dialog div.close").focus()},updateProgressBar:function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t>100&&(t=100),e(".sui-progress-block .sui-progress-text span").text(t+"%"),e(".sui-progress-block .sui-progress-bar span").width(t+"%"),t>=90&&e(".sui-progress-state .sui-progress-state-text").text("Finalizing..."),n&&e(".sui-progress-state .sui-progress-state-text").text("Cancelling...")}},WP_Smush.directory.init()}(jQuery)},137:function(e,t,n){var i,s,r; /*! * jquery.fancytree.js * Tree view control with support for lazy loading and much more. * https://github.com/mar10/fancytree/ * * Copyright (c) 2008-2018, Martin Wendt (http://wwWendt.de) * Released under the MIT license * https://github.com/mar10/fancytree/wiki/LicenseInfo * * @version 2.29.1 * @date 2018-06-27T18:51:43Z */s=[n(93),n(138)],void 0===(r="function"==typeof(i=function(e){"use strict";if(!e.ui||!e.ui.fancytree){var t,n,i=null,s=new RegExp(/\.|\//),r=/[&<>"'\/]/g,o=/[<>"'\/]/g,a={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},u={16:!0,17:!0,18:!0},l={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:"'"},c={0:"",1:"left",2:"middle",3:"right"},d="active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore".split(" "),h={},p="columns types".split(" "),f="checkbox expanded extraClasses folder icon iconTooltip key lazy partsel radiogroup refKey selected statusNodeType title tooltip type unselectable unselectableIgnore unselectableStatus".split(" "),m={},g={},v={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,[r,0].concat(l))),a&&!n){for(i=0,s=l.length;i=0;i--)"paging"===(s=this.children[i]).statusNodeType&&this.removeChild(s);this.partload=!1},appendSibling:function(e){return this.addNode(e,"after")},applyPatch:function(t){if(null===t)return this.remove(),k(this);var n,i,s={children:!0,expanded:!0,parent:!0};for(n in t)i=t[n],s[n]||e.isFunction(i)||(m[n]?this[n]=i:this.data[n]=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):k(this)},collapseSiblings:function(){return this.tree._callHook("nodeCollapseSiblings",this)},copyTo:function(e,t,n){return e.addNode(this.toDict(!0,n),t)},countChildren:function(e){var t,n,i,s=this.children;if(!s)return 0;if(i=s.length,!1!==e)for(t=0,n=i;t=4&&(Array.prototype.unshift.call(arguments,this.toString()),_("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.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),_("error",arguments))},findAll:function(t){t=e.isFunction(t)?t:j(t);var n=[];return this.visit(function(e){t(e)&&n.push(e)}),n},findFirst:function(t){t=e.isFunction(t)?t:j(t);var n=null;return this.visit(function(e){if(t(e))return n=e,!1}),n},_changeSelectStatusAttrs:function(e){var t=!1,n=this.tree.options,s=i.evalOption("unselectable",this,this,n,!1),r=i.evalOption("unselectableStatus",this,this,n,void 0);switch(s&&null!=r&&(e=r),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:y(!1,"invalid state: "+e)}return t&&this.renderStatus(),t},fixSelection3AfterClick:function(e){var t=this.isSelected();this.visit(function(e){e._changeSelectStatusAttrs(t)}),this.fixSelection3FromEndNodes(e)},fixSelection3FromEndNodes:function(e){var t=this.tree.options;y(3===t.selectMode,"expected selectMode 3"),function e(n){var s,r,o,a,u,l,c,d,h=n.children;if(h&&h.length){for(l=!0,c=!1,s=0,r=h.length;s=3&&(Array.prototype.unshift.call(arguments,this.toString()),_("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 n=this.parent;n;){if(n===t)return!0;n===n.parent&&e.error("Recursive parent link: "+n),n=n.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,n=this.getParentList(!1,!1);for(e=0,t=n.length;e=0;n--)s.push(o[n].setExpanded(!0,t));return e.when.apply(e,s).done(function(){l?i.scrollIntoView(u).done(function(){r.resolve()}):r.resolve()}),r.promise()},moveTo:function(t,n,i){void 0===n||"over"===n?n="child":"firstChild"===n&&(t.children&&t.children.length?(n="before",t=t.children[0]):n="child");var s,r=this.parent,o="child"===n?t:t.parent;if(this!==t){if(this.parent?o.isDescendantOf(this)&&e.error("Cannot move a node to its own descendant"):e.error("Cannot move system root"),o!==r&&r.triggerModifyChild("remove",this),1===this.parent.children.length){if(this.parent===o)return;this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1}else y((s=e.inArray(this,this.parent.children))>=0,"invalid source parent"),this.parent.children.splice(s,1);if(this.parent=o,o.hasChildren())switch(n){case"child":o.children.push(this);break;case"before":y((s=e.inArray(t,o.children))>=0,"invalid target parent"),o.children.splice(s,0,this);break;case"after":y((s=e.inArray(t,o.children))>=0,"invalid target parent"),o.children.splice(s+1,0,this);break;default:e.error("Invalid mode "+n)}else o.children=[this];i&&t.visit(i,!0),o===r?o.triggerModifyChild("move",this):o.triggerModifyChild("add",this),this.tree!==t.tree&&(this.warn("Cross-tree moveTo is experimantal!"),this.visit(function(e){e.tree=t.tree},!0)),r.isDescendantOf(o)||r.render(),o.isDescendantOf(r)||o===r||o.render()}},navigate:function(t,n){var i,s,r,o=e.ui.keyCode,a=null;function u(i){if(i){try{i.makeVisible({scrollIntoView:!1})}catch(e){}return e(i.span).is(":visible")?!1===n?i.setFocus():i.setActive():(i.debug("Navigate: skipping hidden node"),void i.navigate(t,n))}}switch(t){case o.BACKSPACE:this.parent&&this.parent.parent&&(r=u(this.parent));break;case o.HOME:this.tree.visit(function(t){if(e(t.span).is(":visible"))return r=u(t),!1});break;case o.END:this.tree.visit(function(t){e(t.span).is(":visible")&&(r=t)}),r&&(r=u(r));break;case o.LEFT:this.expanded?(this.setExpanded(!1),r=u(this)):this.parent&&this.parent.parent&&(r=u(this.parent));break;case o.RIGHT:this.expanded||!this.children&&!this.lazy?this.children&&this.children.length&&(r=u(this.children[0])):(this.setExpanded(),r=u(this));break;case o.UP:for(a=this.getPrevSibling();a&&!e(a.span).is(":visible");)a=a.getPrevSibling();for(;a&&a.expanded&&a.children&&a.children.length;)a=a.children[a.children.length-1];!a&&this.parent&&this.parent.parent&&(a=this.parent),r=u(a);break;case o.DOWN:if(this.expanded&&this.children&&this.children.length)a=this.children[0];else for(i=(s=this.getParentList(!1,!0)).length-1;i>=0;i--){for(a=s[i].getNextSibling();a&&!e(a.span).is(":visible");)a=a.getNextSibling();if(a)break}r=u(a)}return r||k()},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(n){var i,s=this.parent,r=e.inArray(this,s.children),o=this;return y(this.isPagingNode(),"replaceWith() currently requires a paging status node"),(i=this.tree._callHook("nodeLoadChildren",this,n)).done(function(e){var n=o.children;for(t=0;tf+p-h&&(_=s+l-p+h,v&&(y(v.isRootNode()||e(v.span).is(":visible"),"topNode must be visible"),i<_&&(_=i-d))),null!==_?o.effects?(o.effects.complete=function(){a.resolveWith(u)},m.stop(!0).animate({scrollTop:_},o.effects)):(m[0].scrollTop=_,a.resolveWith(this)):a.resolveWith(this),a.promise()):(this.warn("scrollIntoView(): node is invisible."),k())},setActive:function(e,t){return this.tree._callHook("nodeSetActive",this,e,t)},setExpanded:function(e,t){return this.tree._callHook("nodeSetExpanded",this,e,t)},setFocus:function(e){return this.tree._callHook("nodeSetFocus",this,e)},setSelected:function(e,t){return this.tree._callHook("nodeSetSelected",this,e,t)},setStatus:function(e,t,n){return this.tree._callHook("nodeSetStatus",this,e,t,n)},setTitle:function(e){this.title=e,this.renderTitle(),this.triggerModify("rename")},sortChildren:function(e,t){var n,i,s=this.children;if(s){if(e=e||function(e,t){var n=e.title.toLowerCase(),i=t.title.toLowerCase();return n===i?0:n>i?1:-1},s.sort(e),t)for(n=0,i=s.length;n=0,n=void 0===n?!s:!!n)s||(l+=i+" ",a=!0);else for(;l.indexOf(" "+i+" ")>-1;)l=l.replace(" "+i+" "," ");return this.extraClasses=e.trim(l),a},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,n,i){var s,r=this.tree.options.modifyChild;r&&(n&&n.parent!==this&&e.error("childNode "+n+" is not a child of "+this),s={node:this,tree:this.tree,operation:t,childNode:n||null},i&&e.extend(s,i),r({type:"modifyChild"},s))},triggerModify:function(e,t){this.parent.triggerModifyChild(e,this,t)},visit:function(e,t){var n,i,s=!0,r=this.children;if(!0===t&&(!1===(s=e(this))||"skip"===s))return s;if(r)for(n=0,i=r.length;n=2&&(Array.prototype.unshift.call(arguments,this.toString()),_("warn",arguments))}},D.prototype={_makeHookContext:function(t,n,i){var s,r;return void 0!==t.node?(n&&t.originalEvent!==n&&e.error("invalid args"),s=t):t.tree?s={node:t,tree:r=t.tree,widget:r.widget,options:r.widget.options,originalEvent:n,typeInfo:r.types[t.type]||{}}:t.widget?s={node:null,tree:t,widget:t.widget,options:t.widget.options,originalEvent:n}:e.error("invalid args"),i&&e.extend(s,i),s},_callHook:function(t,n,i){var s=this._makeHookContext(n),r=this[t],o=Array.prototype.slice.call(arguments,2);return e.isFunction(r)||e.error("_callHook('"+t+"') is not a function"),o.unshift(s),r.apply(this,o)},_setExpiringValue:function(e,t,n){this._tempCache[e]={value:t,expire:Date.now()+(+n||50)}},_getExpiringValue:function(e){var t=this._tempCache[e];return t&&t.expire>Date.now()?t.value:(delete this._tempCache[e],null)},_requireExtension:function(t,n,i,s){i=!!i;var r=this._local.name,o=this.options.extensions,a=e.inArray(t,o)=4&&(Array.prototype.unshift.call(arguments,this.toString()),_("log",arguments))},enableUpdate:function(e){return e=!1!==e,!!this._enableUpdate==!!e?e:(this._enableUpdate=e,e?(this.debug("enableUpdate(true): redraw "),this.render()):this.debug("enableUpdate(false)..."),!e)},findAll:function(e){return this.rootNode.findAll(e)},findFirst:function(e){return this.rootNode.findFirst(e)},findNextNode:function(t,n,i){t="string"==typeof t?function(e){var t=new RegExp("^"+e,"i");return function(e){return t.test(e.title)}}(t):t;var s=null,r=(n=n||this.getFirstChild()).parent.children,o=null,a=function(e,t,n){var i,s,r=e.children,o=r.length,u=r[t];if(u&&!1===n(u))return!1;if(u&&u.children&&u.expanded&&!1===a(u,0,n))return!1;for(i=t+1;i