HEX
Server: Apache
System: Linux cpanelx.inxs.ro 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: crowdandsafety (1041)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/crowdandsafety/public_html/wp-content/plugins/wp-smushit/app/assets/js/smush-admin.min.js
!function(){var e={5417:function(e,t,n){"use strict";n.d(t,{R:function(){return s}});var i={maybeShowCDNActivationNotice:function(){wp_smush_msgs.smush_cdn_activation_notice&&WP_Smush.helpers.renderActivationCDNNotice(wp_smush_msgs.smush_cdn_activation_notice)},maybeShowCDNUpsellForPreSiteOnStart:function(){var e=document.querySelector(".wp-smush-upsell-cdn");e&&e.classList.remove("sui-hidden")},maybeShowCDNUpsellForPreSiteOnCompleted:function(){var e=document.querySelector(".wp-smush-upsell-cdn");e&&e.classList.remove("sui-hidden")}},s=function(){var e=document.querySelector.bind(document),t=e(".sui-summary-smush-metabox");if(!t)return{};var n=window.wp_smushit_data.bo_stats,s={count_images:0,count_total:0,count_resize:0,count_skipped:0,count_smushed:0,savings_bytes:0,savings_resize:0,size_after:0,size_before:0,savings_percent:0,percent_grade:"sui-grade-dismissed",percent_metric:0,percent_optimized:0,remaining_count:0,human_bytes:"",savings_conversion_human:"",savings_conversion:0},r=e("#smush-image-score"),o=e(".smush-final-log .smush-bulk-errors"),a=e("#wp-smush-bulk-content"),u={},l=function(e){window.wp_smushit_data=Object.assign(window.wp_smushit_data,e||{}),s=Object.keys(s).reduce(function(e,t){return t in window.wp_smushit_data&&(e[t]=window.wp_smushit_data[t]),e},{})};return l(window.wp_smushit_data),{isChangedStats:function(e){return["total_items","processed_items","failed_items","is_cancelled","is_completed","is_dead"].some(function(t){return e[t]!==n[t]})},setBoStats:function(e){return n=Object.assign(n,e||{}),this},getBoStats:function(){return n},setGlobalStats:function(e){return s=Object.assign(s,e||{}),this},getGlobalStats:function(){return s},renderScoreProgress:function(){r.className=r.className.replace(/(^|\s)sui-grade-\S+/g,""),r.classList.add(s.percent_grade),r.dataset.score=s.percent_optimized,r.querySelector(".sui-circle-score-label").innerHTML=s.percent_optimized,r.querySelector("circle:last-child").setAttribute("style","--metric-array:"+2.63893782902*s.percent_metric+" "+(263.893782902-s.percent_metric))},renderSummaryDetail:function(){this.renderTotalStats(),this.renderResizedStats(),this.renderConversionSavings()},renderTotalStats:function(){t.querySelector(".sui-summary-large.wp-smush-stats-human").innerHTML=s.human_bytes,t.querySelector(".wp-smush-savings .wp-smush-stats-percent").innerHTML=s.savings_percent,t.querySelector(".wp-smush-count-total .wp-smush-total-optimised").innerHTML=s.count_images},renderResizedStats:function(){var e=t.querySelector(".wp-smush-count-resize-total");e&&(s.count_resize>0?e.classList.remove("sui-hidden"):e.classList.add("sui-hidden"),e.querySelector(".wp-smush-total-optimised").innerHTML=s.count_resize)},renderConversionSavings:function(){var e=t.querySelector(".smush-conversion-savings .wp-smush-stats");e&&(e.innerHTML=s.savings_conversion_human,s.savings_conversion>0?e.parentElement.classList.remove("sui-hidden"):e.parentElement.classList.add("sui-hidden"))},renderBoxSummary:function(){this.renderScoreProgress(),this.renderSummaryDetail()},setErrors:function(e){u=e||{}},getErrors:function(){return u},renderErrors:function(){if(Object.keys(u).length&&n.is_completed){var t=[],s=Object.keys(u),r=!1;s.map(function(e,n){var i=u[e].error_code;n<5&&"animated"===i&&(r=!0),t.push(WP_Smush.helpers.prepareBulkSmushErrorRow(u[e].error_message,u[e].file_name,u[e].thumbnail,e,"media",u[e].error_code))}),o.innerHTML=t.join(""),o.parentElement.classList.remove("sui-hidden"),o.parentElement.style.display=null,s.length>1&&e(".smush-bulk-errors-actions").classList.remove("sui-hidden"),r&&i.maybeShowCDNActivationNotice()}},resetAndHideBulkErrors:function(){o&&(this.resetErrors(),o.parentElement.classList.add("sui-hidden"),o.innerHTML="")},resetErrors:function(){u={}},renderStats:function(){this.renderBoxSummary(),this.renderErrors()},maybeUpdateBulkSmushCountContent:function(e){e&&a&&(a.innerHTML=e)},updateGlobalStatsFromSmushScriptData:function(e){return this.maybeUpdateBulkSmushCountContent(null==e?void 0:e.content),l(e),this}}}()},9738:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return p}});var i=n(9620),s=n(7119),r=n(5417);function o(e){return o="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},o(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var l=new(function(){return e=function e(){var t,n,i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,i=5e3,(n=u(n="delayTimeOnFailure"))in t?Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[n]=i},(t=[{key:"performTest",value:function(){var e=this;return new Promise(function(t,n){e.startTest().then(function(i){null!=i&&i.success?e.getResult(t,function(){setTimeout(function(){e.getResult(t,n,n)},e.delayTimeOnFailure)},n):n(i)}).catch(function(e){n(e)})})}},{key:"startTest",value:function(){return i.A.background.backgroundHealthyCheck()}},{key:"getResult",value:function(e,t,n){return this.fetchResult().then(function(n){var i=null==n?void 0:n.data;null!=n&&n.success&&null!=i&&i.loopback?e(i):t(n)}).catch(function(e){n(e)})}},{key:"fetchResult",value:function(){return i.A.background.backgroundHealthyStatus()}}])&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}());function c(e){return c="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},c(e)}function d(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,h(i.key),i)}}function h(e){var t=function(e,t){if("object"!=c(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=c(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==c(t)?t:t+""}wp.i18n.__;var p=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.autoSyncDuration=1500,this.progressTimeoutId=0,this.scanProgress=(0,s.u)(this.autoSyncDuration)},t=[{key:"startScan",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.onStart();var n=t?"smush":"scan";l.performTest().then(function(s){(null==s?void 0:s.loopback)?i.A.scanMediaLibrary.start(t).then(function(t){if(null==t||!t.success)return e.showFailureNotice(t),void e.onStartFailure(t);e.showProgressBar().autoSyncStatus()}):(e.showLoopbackErrorModal(n),e.onStartFailure(s))}).catch(function(t){console.error("Error:",t),e.showLoopbackErrorModal(n),e.onStartFailure(t)})}},{key:"onStart",value:function(){}},{key:"onStartFailure",value:function(e){}},{key:"showFailureNotice",value:function(e){WP_Smush.helpers.showNotice(e,{showdismiss:!0,autoclose:!1})}},{key:"showLoopbackErrorModal",value:function(e){var t=document.getElementById("smush-loopback-error-dialog");t&&window.SUI&&(t.dataset.processType=e||"scan",WP_Smush.helpers.showModal(t.id))}},{key:"showProgressBar",value:function(){return this.onShowProgressBar(),this.scanProgress.reset().setOnCancelCallback(this.showStopScanningModal.bind(this)).open(),this}},{key:"onShowProgressBar",value:function(){}},{key:"showStopScanningModal",value:function(){window.SUI&&(this.onShowStopScanningModal(),window.SUI.openModal("smush-stop-scanning-dialog","wpbody-content",void 0,!1))}},{key:"onShowStopScanningModal",value:function(){this.registerCancelProcessEvent()}},{key:"registerCancelProcessEvent",value:function(){var e=document.querySelector(".smush-stop-scanning-dialog-button");e&&e.addEventListener("click",this.cancelProgress.bind(this),{once:!0})}},{key:"closeStopScanningModal",value:function(){if(window.SUI){var e=document.querySelector("#smush-stop-scanning-dialog");!e||!e.classList.contains("sui-content-fade-in")||window.SUI.closeModal("smush-stop-scanning-dialog")}}},{key:"closeProgressBar",value:function(){this.onCloseProgressBar(),this.scanProgress.close()}},{key:"onCloseProgressBar",value:function(){}},{key:"updateProgress",value:function(e){var t=this.getTotalItems(e),n=this.getProcessedItems(e);return this.scanProgress.update(n,t)}},{key:"getProcessedItems",value:function(e){return(null==e?void 0:e.processed_items)||0}},{key:"getTotalItems",value:function(e){return(null==e?void 0:e.total_items)||0}},{key:"cancelProgress",value:function(){var e=this;return this.scanProgress.setCancelButtonOnCancelling(),i.A.scanMediaLibrary.cancel().then(function(t){null!=t&&t.success?e.onCancelled(t.data):e.onCancelFailure(t)})}},{key:"onCancelFailure",value:function(e){WP_Smush.helpers.showNotice(e,{showdismiss:!0,autoclose:!1}),this.scanProgress.resetCancelButtonOnFailure()}},{key:"onDead",value:function(e){this.clearProgressTimeout(),this.closeProgressBar(),this.closeStopScanningModal(),this.showRetryScanModal()}},{key:"showRetryScanModal",value:function(){var e=document.getElementById("smush-retry-scan-notice");window.SUI&&e&&(e.querySelector(".smush-retry-scan-notice-button").addEventListener("click",function(e){window.SUI.closeModal("smush-retry-scan-notice");var t=document.querySelector(".wp-smush-scan");t&&(e.preventDefault(),t.click())},{once:!0}),window.SUI.openModal("smush-retry-scan-notice","wpbody-content",void 0,!1))}},{key:"onCompleted",value:function(e){this.onFinish(e)}},{key:"onCancelled",value:function(e){this.onFinish(e)}},{key:"onFinish",value:function(e){this.clearProgressTimeout();var t=null==e?void 0:e.global_stats;this.updateGlobalStatsAndBulkContent(t),this.closeProgressBar(),this.closeStopScanningModal()}},{key:"clearProgressTimeout",value:function(){this.progressTimeoutId&&clearTimeout(this.progressTimeoutId)}},{key:"updateGlobalStatsAndBulkContent",value:function(e){e&&(r.R.updateGlobalStatsFromSmushScriptData(e),r.R.renderStats())}},{key:"getStatus",value:function(){return i.A.scanMediaLibrary.getScanStatus()}},{key:"autoSyncStatus",value:function(){var e=this,t=(new Date).getTime();this.getStatus().then(function(n){if(null!=n&&n.success){var i=n.data;i.is_dead?e.onDead(n.data):(e.beforeUpdateStatus(i),e.updateProgress(i).then(function(){e.scanProgress.increaseDurationToHaveChangeOnProgress((new Date).getTime()-t),(null==i?void 0:i.is_completed)?e.onCompleted(i):(null==i?void 0:i.is_cancelled)?e.onCancelled(i):e.progressTimeoutId=setTimeout(function(){return e.autoSyncStatus()},e.autoSyncDuration)}))}})}},{key:"beforeUpdateStatus",value:function(){}},{key:"setInnerText",value:function(e,t){e&&(e.dataset.originalText=e.dataset.originalText||e.innerText.trim(),e.innerText=t)}},{key:"revertInnerText",value:function(e){e&&e.dataset.originalText&&(e.innerText=e.dataset.originalText.trim())}},{key:"hideAnElement",value:function(e){e&&e.classList.add("sui-hidden")}},{key:"showAnElement",value:function(e){e&&e.classList.remove("sui-hidden")}}],t&&d(e.prototype,t),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}()},7119:function(e,t,n){"use strict";n.d(t,{u:function(){return i}});var i=function(e){var t,n=wp.i18n,i=n.__,s=n._n,r=document.querySelector(".wp-smush-scan-progress-bar-wrapper"),o=r.querySelector(".wp-smush-progress-percent"),a=r.querySelector(".wp-smush-progress-inner"),u=r.querySelector(".wp-smush-remaining-time"),l=r.querySelector(".wp-smush-cancel-scan-progress-btn"),c=r.querySelector(".wp-smush-scan-hold-on-notice"),d=function(){},h=0,p=e-300;r.style.setProperty("--progress-transition-duration",p/1e3+"s");var f=(null===(t=window.wp_smushit_data)||void 0===t||null===(t=t.media_library_scan)||void 0===t?void 0:t.processed_items)||0,m=[],v=e,g=6e4;return{update:function(e,t){this.updateRemainingTime(e,t);var n=t&&Math.floor(e/t*100)||0;n=Math.min(n,100);var i=a.style.width;return i=i&&i.replace("%","")||0,a.style.width=n+"%",this.animateProgressBar(i,n)},animateProgressBar:function(e,t){return h&&clearInterval(h),new Promise(function(n){h=setInterval(function(){o.innerHTML=e+"%",++e>t&&(n(),clearInterval(h))},p/(t-e))})},updateRemainingTime:function(e,t){if(u){var n=(this.calcProcessTimePerItem(e)||500)*(t-e);u.innerText=this.formatTime(n)}},calcProcessTimePerItem:function(t){if(t){if((f=f<=t?f:0)!=t){var n=Math.floor(v/(t-f));f=t,m.push(n),this.resetDurationToHaveChangeOnProgress()}else this.increaseDurationToHaveChangeOnProgress(e);if(m.length)return m.reduce(function(e,t){return e+t},0)/m.length}},increaseDurationToHaveChangeOnProgress:function(e){(v+=e)>g&&this.showHoldOnNotice()},showHoldOnNotice:function(){c.classList.remove("sui-hidden"),g=1e8},resetHoldOnNoticeVisibility:function(){c.classList.add("sui-hidden")},resetDurationToHaveChangeOnProgress:function(){v=e},formatTime:function(e){var t=Math.floor((e+p)/1e3),n=t%60,i=Math.floor(t/60),r="";return i&&(r+=i+" "+s("minute","minutes",i,"wp-smushit")),(r+=" "+n+" "+s("second","seconds",n,"wp-smushit")).trim()},reset:function(){return a.style.width="0%",o.innerHTML="0%",this.resetCancelButton(),this.resetHoldOnNoticeVisibility(),this},open:function(){l.onclick=d,r.classList.remove("sui-hidden")},close:function(){r.classList.add("sui-hidden"),this.reset()},setOnCancelCallback:function(e){if("function"==typeof e)return d=e,this},setCancelButtonLabel:function(e){return l.textContent=e,this},setCancelButtonOnCancelling:function(){this.setCancelButtonLabel(wp_smush_msgs.cancelling),this.setOnCancelCallback(function(){return!1}),l.setAttribute("disabled",!0)},resetCancelButton:function(){this.setOnCancelCallback(function(){}),this.resetCancelButtonLabel(),l.removeAttribute("disabled")},resetCancelButtonLabel:function(){this.setCancelButtonLabel(i("Cancel Scan","wp-smushit"))},resetCancelButtonOnFailure:function(){this.resetCancelButtonLabel(),l.removeAttribute("disabled")}}};t.A=new function(){var e=document.querySelector(".wp-smush-bulk-progress-bar-wrapper");if(!e)return{isEmptyObject:!0};var t=e.querySelector(".wp-smush-cancel-btn"),n=document.querySelector(".wp-smush-bulk-wrapper"),i=e.querySelector("#wp-smush-running-notice"),s=document.querySelector(".wp-smush-all-done"),r=document.getElementById("smush-stop-bulk-smush-modal"),o=e.querySelector(".wp-smush-bulk-hold-on-notice"),a=!1,u=function(){};return{update:function(t,n){var i=n&&Math.floor(t/n*100)||0;i=Math.min(i,100),e.querySelector(".wp-smush-images-percent").innerHTML=i+"%",e.querySelector(".wp-smush-progress-inner").style.width=i+"%";var s=e.querySelector(".sui-progress-state-text");return s.firstElementChild.innerHTML=t,s.lastElementChild.innerHTML=n,this},close:function(){return e.classList.add("sui-hidden"),this.setCancelButtonLabel(window.wp_smush_msgs.cancel).setOnCancelCallback(function(){}).update(0,0),this.resetOriginalNotice(),this.closeStopBulkSmushModal(),this},show:function(){e.classList.remove("sui-hidden"),t.onclick=this.showStopBulkSmushModal.bind(this),this.hideBulkSmushDescription(),this.hideBulkSmushAllDone(),this.hideRecheckImagesNotice()},showStopBulkSmushModal:function(){if(r){r.querySelector(".smush-stop-bulk-smush-button").addEventListener("click",u,{once:!0});var e=r.id;window.SUI.openModal(e,"wpbody-content",void 0,!1,!1,!0)}},closeStopBulkSmushModal:function(){window.SUI&&(!r||!r.classList.contains("sui-content-fade-in")||window.SUI.closeModal(r.id))},setCancelButtonLabel:function(e){return t.textContent=e,this},showBulkSmushDescription:function(){n.classList.remove("sui-hidden")},hideBulkSmushDescription:function(){n.classList.add("sui-hidden")},showBulkSmushAllDone:function(){s.classList.remove("sui-hidden")},hideBulkSmushAllDone:function(){s.classList.add("sui-hidden")},hideState:function(){return a||(a=!0,e.querySelector(".sui-progress-state").classList.add("sui-hidden")),this},showState:function(){return a?(a=!1,e.querySelector(".sui-progress-state").classList.remove("sui-hidden"),this):this},setNotice:function(e){var t=i.querySelector(".sui-notice-message p");return this.cacheOriginalNotice(t),t.innerHTML=e,this},cacheOriginalNotice:function(e){i.dataset.progressMessage||(i.dataset.progressMessage=e.innerHTML)},resetOriginalNotice:function(){i.dataset.progressMessage&&(i.querySelector(".sui-notice-message p").innerHTML=i.dataset.progressMessage)},hideBulkProcessingNotice:function(){return i.classList.add("sui-hidden"),this},showBulkProcessingNotice:function(){return i.classList.remove("sui-hidden"),this},setCountUnitText:function(t){e.querySelector(".sui-progress-state-unit").innerHTML=t},setOnCancelCallback:function(e){if("function"==typeof e)return u=e,this},disableExceedLimitMode:function(){e.classList.remove("wp-smush-exceed-limit"),e.querySelector("#bulk-smush-resume-button").classList.add("sui-hidden")},hideRecheckImagesNotice:function(){var e=document.querySelector(".wp-smush-recheck-images-notice-box");e&&e.classList.add("sui-hidden")},showHoldOnNotice:function(){o&&o.classList.remove("sui-hidden")},hideHoldOnNotice:function(){o&&o.classList.add("sui-hidden")}}}},8274:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var i=n(7899);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,o(i.key),i)}}function o(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=s(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}var a=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"init",value:function(){this.trackSubmenuProUpsell(),this.trackPluginListProUpsell(),this.trackDashboardWidgetProUpsell()}},{key:"trackSubmenuProUpsell",value:function(){var e=this,t=document.querySelector('#toplevel_page_smush a[href*="utm_campaign=smush_submenu_upsell');t&&t.addEventListener("click",function(t){var n;e.trackGeneralProUpsell("submenu",null==t||null===(n=t.target)||void 0===n?void 0:n.href)})}},{key:"trackPluginListProUpsell",value:function(){var e=this,t=document.getElementById("smush-pluginlist-upgrade-link");t&&t.addEventListener("click",function(t){var n;e.trackGeneralProUpsell("plugins_list",null==t||null===(n=t.target)||void 0===n?void 0:n.href)})}},{key:"trackDashboardWidgetProUpsell",value:function(){var e=this,t=document.getElementById("smush-box-dashboard-upsell-upsell");if(t){var n=t.querySelector("a[href*=smush-dashboard-upsell]");n&&n.addEventListener("click",function(t){var n;e.trackGeneralProUpsell("dash_widget",null==t||null===(n=t.target)||void 0===n?void 0:n.href)})}}},{key:"trackSetupWizardProUpsell",value:function(e,t){this.trackGeneralProUpsell("wizard",e,t)}},{key:"trackGeneralProUpsell",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"na";this.trackProUpsell({Feature:"pro_general",Location:e,"UTM Link":t,"Pro Interests":n})}},{key:"trackProUpsell",value:function(e){e=Object.assign({"User Action":"cta_clicked"},e),i.A.track("smush_pro_upsell",e)}}],t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}()},596:function(){jQuery(function(e){"use strict";e("body").on("click","a.smush-stats-details",function(t){if(e(this).prop("disabled"))return!1;t.preventDefault();var n=e(this),i=n.parents().eq(1).find(".smush-stats-wrapper");n.toggleClass("smush-stats-expanded"),i.slideToggle()})})},990:function(e,t,n){"use strict";var i=n(9982),s=n(5417),r=n(7119),o=n(9620),a=n(7899);function u(e){return u="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},u(e)}function l(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function r(n,i,s,r){var u=i&&i.prototype instanceof a?i:a,l=Object.create(u.prototype);return c(l,"_invoke",function(n,i,s){var r,a,u,l=0,c=s||[],d=!1,h={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return r=t,a=0,u=e,h.n=n,o}};function p(n,i){for(a=n,u=i,t=0;!d&&l&&!s&&t<c.length;t++){var s,r=c[t],p=h.p,f=r[2];n>3?(s=f===i)&&(u=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((s=n<2&&p<r[1])?(a=0,h.v=i,h.n=r[1]):p<f&&(s=n<3||r[0]>i||i>f)&&(r[4]=n,r[5]=i,h.n=f,a=0))}if(s||n>1)return o;throw d=!0,i}return function(s,c,f){if(l>1)throw TypeError("Generator is already running");for(d&&1===c&&p(c,f),a=c,u=f;(t=a<2?e:u)||!d;){r||(a?a<3?(a>1&&(h.n=-1),p(a,u)):h.n=u:h.v=u);try{if(l=2,r){if(a||(s="next"),t=r[s]){if(!(t=t.call(r,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(u=TypeError("The iterator does not provide a '"+s+"' method"),a=1);r=e}else if((t=(d=h.n<0)?u:n.call(i,h))!==o)break}catch(t){r=e,a=1,u=t}finally{l=1}}return{value:t,done:d}}}(n,s,r),!0),l}var o={};function a(){}function u(){}function d(){}t=Object.getPrototypeOf;var h=[][i]?t(t([][i]())):(c(t={},i,function(){return this}),t),p=d.prototype=a.prototype=Object.create(h);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,c(e,s,"GeneratorFunction")),e.prototype=Object.create(p),e}return u.prototype=d,c(p,"constructor",d),c(d,"constructor",u),u.displayName="GeneratorFunction",c(d,s,"GeneratorFunction"),c(p),c(p,s,"Generator"),c(p,i,function(){return this}),c(p,"toString",function(){return"[object Generator]"}),(l=function(){return{w:r,m:f}})()}function c(e,t,n,i){var s=Object.defineProperty;try{s({},"",{})}catch(e){s=0}c=function(e,t,n,i){function r(t,n){c(e,t,function(e){return this._invoke(t,n,e)})}t?s?s(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(r("next",0),r("throw",1),r("return",2))},c(e,t,n,i)}function d(e,t,n,i,s,r,o){try{var a=e[r](o),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,s)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(i,s){var r=e.apply(t,n);function o(e){d(r,i,s,o,a,"next",e)}function a(e){d(r,i,s,o,a,"throw",e)}o(void 0)})}}function p(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f(i.key),i)}}function f(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=u(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u(t)?t:t+""}var m=function(){return e=function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),document.addEventListener("DOMContentLoaded",function(){t.modalAction="cancel",t.modalId="smush-disconnect-site-modal",t.modal=document.getElementById(t.modalId),t._onAfterClose=t.trackDisconnectSite.bind(t),t.modal&&(t.modal.addEventListener("afterClose",t._onAfterClose,{once:!0}),document.addEventListener("onSavedSmushSettings",function(e){var t=document.getElementById("usage");t&&a.A.setAllowToTrack(t.checked)}))})},t=[{key:"trackDisconnectSite",value:function(){var e=document.getElementById("smush-disconnect-site-message").value.trim();if(0===e.length&&this.isSubmitAction()&&this.setModalAction("skip"),!this.shouldTrack())return Promise.resolve();var t={"User Message":e,"Modal Action":this.modalAction,"Tracking Status":a.A.allowToTrack()?"opted_in":"opted_out"};return a.A.setAllowToTrack(!0).track("Disconnect Site",t)}},{key:"shouldTrack",value:function(){return a.A.allowToTrack()||this.isSubmitAction()}},{key:"isSubmitAction",value:function(){return"submit"===this.modalAction}},{key:"setModalAction",value:function(e){return this.modalAction=e,this}},{key:"closeModal",value:function(){var e=this;return this.modal?new Promise(function(t){var n;e.modal.removeEventListener("afterClose",e._onAfterClose),e.modal.addEventListener("afterClose",h(l().m(function n(){return l().w(function(n){for(;;)switch(n.n){case 0:return n.n=1,e.trackDisconnectSite();case 1:t();case 2:return n.a(2)}},n)})),{once:!0}),null===(n=window.SUI)||void 0===n||n.closeModal(!0)}):Promise.resolve()}},{key:"disconnect",value:function(e){var t=this;return e&&e.classList.add("sui-button-onload-text"),o.A.settings.disconnectSite().then(function(){var e=h(l().m(function e(n){return l().w(function(e){for(;;)switch(e.n){case 0:if(!n.success){e.n=2;break}return e.n=1,t.setModalAction("submit").closeModal();case 1:window.location.search=window.location.search+"&smush-notice=site-disconnected",e.n=3;break;case 2:WP_Smush.helpers.showNotice(n);case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}()).catch(function(e){WP_Smush.helpers.showNotice(e)}).finally(function(){e&&e.classList.remove("sui-button-onload-text")})}}],t&&p(e.prototype,t),n&&p(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}(),v=new m;function g(e){return g="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},g(e)}function y(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,b(i.key),i)}}function b(e){var t=function(e,t){if("object"!=g(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=g(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==g(t)?t:t+""}function w(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}function _(e,t){return e.get(function(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}(e,t))}var k=new WeakMap;function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,s,r,o,a=[],u=!0,l=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(i=r.call(n)).done)&&(a.push(i.value),a.length!==t);u=!0);}catch(e){l=!0,s=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw s}}return a}}(e,t)||x(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e,t){if(e){if("string"==typeof e)return C(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),w(this,k,"review-prompts"),document.addEventListener("DOMContentLoaded",this.init.bind(this))},t=[{key:"init",value:function(){this.reviewPromptsElement=document.getElementById("smush-review-prompts-notice"),this.reviewPromptsElement&&(this.remindLater=this.reviewPromptsElement.querySelector("#smush-review-prompts-remind-later"),this.alreadyDid=this.reviewPromptsElement.querySelector("#smush-review-prompts-already-did"),this.rateLink=this.reviewPromptsElement.querySelector(".button-primary"),this.bindEvents())}},{key:"bindEvents",value:function(){var e=this;this.alreadyDid&&this.alreadyDid.addEventListener("click",function(t){t.preventDefault(),e.handleDismissNotice(),e.trackRateNoticeEvent("dismiss")}),this.remindLater&&this.remindLater.addEventListener("click",function(t){t.preventDefault(),e.handleRemindLater(),e.trackRateNoticeEvent("remind_later")}),this.rateLink&&this.rateLink.addEventListener("click",function(){e.handleDismissNotice(),e.trackRateNoticeEvent("rate")})}},{key:"handleDismissNotice",value:function(){var e=this;return this.alreadyDid.classList.add("wp-smush-link-in-progress"),o.A.common.dismissNotice(_(k,this)).then(function(t){var n;t.success?e.reviewPromptsElement.style.display="none":null===(n=window.WP_Smush)||void 0===n||n.helpers.showNotice(t)}).catch(function(e){var t;null===(t=window.WP_Smush)||void 0===t||t.helpers.showNotice(e)}).finally(function(){e.alreadyDid.classList.remove("wp-smush-link-in-progress")})}},{key:"handleRemindLater",value:function(){var e=this;return this.alreadyDid.classList.add("wp-smush-link-in-progress"),o.A.common.remindReviewPrompt().then(function(t){var n;t.success?e.reviewPromptsElement.style.display="none":null===(n=window.WP_Smush)||void 0===n||n.helpers.showNotice(t)}).catch(function(e){var t;null===(t=window.WP_Smush)||void 0===t||t.helpers.showNotice(e)}).finally(function(){e.alreadyDid.classList.remove("wp-smush-link-in-progress")})}},{key:"trackRateNoticeEvent",value:function(e){if(e){var t={smush:"Dashboard","smush-bulk":"Bulk Smush","smush-lazy-preload":"Lazy Load","smush-cdn":"CDN","smush-next-gen":"Next-Gen Formats","smush-integrations":"Integrations","smush-settings":"Settings","smush-cross-sell":"More free Plugins"}[new URL(window.location.href).searchParams.get("page")]||"WordPress admin";a.A.track("Rating Notice",{Action:e,"Notice type":this.reviewPromptsElement.dataset.noticeType,Location:t})}}}],t&&y(e.prototype,t),n&&y(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}()),WP_Smush.adminAjax={disconnectSite:function(e){return v.disconnect(e)}};var E=function(e,t){void 0===t&&(t=100),e.fadeTo(t,0,function(){e.slideUp(t,function(){e.remove()})})};document.addEventListener("on-smush-site-disconnected-notice",function(){WP_Smush.helpers.showNotice(wp_smush_msgs.site_disconnected_success,{type:"success"})}),jQuery(function(e){var t=function(t,n,s,r){if(t.preventDefault(),!n.attr("disabled")){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||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").prop("disabled",!0)}(n);var u=n.html();n.html('<span class="spinner wp-smush-progress">'+wp_smush_msgs[r]+"</span>"),e.post(ajaxurl,a,function(e){!function(e){var t=e.parent();t.css({opacity:"1"}),t.find("a").prop("disabled",!1)}(n);var t=a.action&&a.action.includes("nextgen");if(e.success&&void 0!==e.data){if(t)n.parents().eq(1).html(e.data.stats);else if("restore"===r)n.parents().eq(1).html(e.data.stats);else{var s=n.parents().eq(1);wp_smush_msgs.failed_item_smushed&&s.hasClass("smush-failed-processing")?(s.html('<p class="smush-status smush-success">'+wp_smush_msgs.failed_item_smushed+"</p>"),setTimeout(function(){s.html(e.data)},2e3)):s.html(e.data)}void 0!==e.data&&"restore"===r&&i.A.updateImageStats(e.data.new_size)}else e.data&&e.data.error_msg&&(t?n.parent().append(e.data.error_msg):e.data.html_stats?n.closest(".smush-status-links").parent().html(e.data.html_stats):n.closest(".smush-status-links").prev(".smush-status").addClass("smush-warning").html(e.data.error_msg),n.attr("disabled",!0),n.html(u))})}},n=function(e){if(e.notice){var t="success";void 0!==e.noticeType&&(t=e.noticeType),window.SUI.openNotice("wp-smush-ajax-notice","<p>"+e.notice+"</p>",{type:t,icon:"check-tick"})}},o=function(e){r.A.isEmptyObject||(r.A.update(0,e.remaining_count),e.remaining_count<1?(r.A.hideBulkSmushDescription(),r.A.showBulkSmushAllDone()):(r.A.showBulkSmushDescription(),r.A.hideBulkSmushAllDone()))},a=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("#all-media-type").on("change",function(){e(".lazyload-media-type-input").prop("checked",!0)}),e("#all-output-location").on("change",function(){e('input[name^="output"]').prop("checked",!0)}),e(".sui-mobile-nav").on("change",function(t){window.location.assign(e(t.currentTarget).val())}),e("#smush-clear-lcp-data").on("click",function(t){t.preventDefault();var n=e(this);n.addClass("sui-button-onload"),e.post(ajaxurl,{action:"clear_all_lcp_data",_ajax_nonce:wp_smush_msgs.nonce}).done(function(e){WP_Smush.helpers.showNotice("LCP data cleared successfully.",{type:"success",autoclose:!0})}).fail(function(){WP_Smush.helpers.showErrorNotice("Failed to clear LCP data. Please try again.")}).always(function(){n.removeClass("sui-button-onload")})}),e("body").on("click",".wp-smush-send:not(.wp-smush-resmush)",function(t){t.preventDefault(),new i.A(e(this),!1)}),e("body").on("click",".wp-smush-remove-skipped",function(t){t.preventDefault();var n=e(this);e.post(ajaxurl,{action:"remove_from_skip_list",id:n.attr("data-id"),_ajax_nonce:n.attr("data-nonce")}).done(function(e){e.success&&void 0!==e.data.html&&n.parent().parent().html(e.data.html)})}),e("body").on("click",".wp-smush-action.wp-smush-restore",function(n){var i=e(this);i.removeClass("sui-tooltip"),t(n,i,"smush_restore_image","restore")}),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(),e(this).hasClass("wp-smush-background-scan")||function(t){var i=e(".wp-smush-scan");i.addClass("sui-button-onload");var r=i.data("type");r=void 0===r?"media":r,e(".wp-smush-all").removeAttr("data-smush"),e(".wp-smush-all").prop("disabled",!0),e(".wp-smush-settings-changed").hide();var a={action:"scan_for_resmush",type:r,get_ui:!0,process_settings:t,wp_smush_options_nonce:jQuery("#wp_smush_options_nonce").val()};e.get(ajaxurl,a,function(e){if(null!=e&&e.success){var t=e.data;n(t),s.R.updateGlobalStatsFromSmushScriptData(t),s.R.renderStats(),o(t)}else WP_Smush.helpers.showNotice(e,{showdismiss:!0,autoclose:!1})}).always(function(){jQuery(".bulk-smush-wrapper .wp-smush-bulk-progress-bar-wrapper").addClass("sui-hidden"),i.removeClass("sui-button-onload").addClass("smush-button-check-success");var t=i.find(".wp-smush-default-text"),n=i.find(".wp-smush-completed-text");t.addClass("sui-hidden-important"),n.removeClass("sui-hidden"),setTimeout(function(){i.removeClass("smush-button-check-success"),t.removeClass("sui-hidden-important"),n.addClass("sui-hidden")},2e3),e(".wp-smush-all").prop("disabled",!1)})}(!1)}),e("body").on("click",".wp-smush-notice .icon-fi-close",function(t){t.preventDefault();var n=e(this).parent();E(n)}),e("a.wp-smush-lossy-enable").on("click",function(e){e.preventDefault(),a("#column-lossy")}),e(".wp-smush-resize-enable").on("click",function(e){e.preventDefault(),a("#column-resize")}),window.location.hash){var u="";switch(window.location.hash.substring(1)){case"enable-resize":u="#column-resize";break;case"backup-label":u="#backup";break;case"original-label":u="#original";break;case"enable-lossy":u="#column-lossy"}""!==u&&(a(u),document.getElementById(u.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){var t,n=e.find("#resize"),i=e.find("#wp-smush-resize_width"),s=e.find("#wp-smush-resize_height"),r=e.find("#smush-resize-settings-wrap"),o=e.find(".wp-smush-update-dimensions");if(n.is(":checked")&&i.length&&s.length&&r.length&&o.length){var a=(null===(t=window.wp_smushit_data)||void 0===t?void 0:t.resize_sizes)||{},u=a.width,l=a.height;if(u||l){var c=i.val(),d=s.val(),h=parseInt(u)>parseInt(c),p=parseInt(u)>parseInt(d);h||p?o.show("slow"):o.hide("slow"),h?i.parent().addClass("sui-form-field-warning"):i.parent().removeClass("sui-form-field-warning"),p?s.parent().addClass("sui-form-field-warning"):s.parent().removeClass("sui-form-field-warning")}}}(e(this).closest("#resize-settings-row"))}),e("body").on("click","#resize",function(){var t=e(this),n=e("#smush-resize-settings-wrap");t.is(":checked")?n.removeClass("sui-hidden"):n.addClass("sui-hidden")}),e("#wp-smush-revalidate-member").on("click",function(t){t.preventDefault();var n={action:"smush_show_warning",_ajax_nonce:window.wp_smush_msgs.nonce},i=e(this).parents().eq(1);i.addClass("loading-notice"),e.get(ajaxurl,n,function(e){i.removeClass("loading-notice").addClass("loaded-notice"),0==e?(i.attr("data-message",wp_smush_msgs.membership_valid),E(i,1e3)):(i.attr("data-message",wp_smush_msgs.membership_invalid),setTimeout(function(){i.removeClass("loaded-notice")},1e3))})}),e("li.smush-dir-savings").length>0){var l={action:"get_dir_smush_stats",_ajax_nonce:window.wp_smush_msgs.nonce};e.get(ajaxurl,l,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(".wp-smush-dir-link").addClass("sui-hidden"),e("li.smush-dir-savings .wp-smush-stats-label-message").hide(),n.length>0&&n.html(t.dir_smush.human),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+"%"))):e(".wp-smush-dir-link").removeClass("sui-hidden")}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)})}if(e("#smush-updated-dialog").length){window.SUI.openModal("smush-updated-dialog","wpbody-content",void 0,!1,!1,!0)}e("input#original").on("change",function(){e("#backup-notice").toggleClass("sui-hidden",e(this).is(":checked"))});!function(){var e=document.querySelector(".wp-smush-compression-type");if(e){var t=e.querySelector(".wp-smush-compression-type_note p");t&&e.querySelector(".wp-smush-compression-type_slider").addEventListener("change",function(e){var n,i;if("INPUT"===(null==e||null===(n=e.target)||void 0===n?void 0:n.nodeName)){var s=null===(i=e.target.dataset)||void 0===i?void 0:i.note;s&&(t.innerHTML=s.trim())}})}}(),e(".wp-smush-modal-link-close").on("click",function(t){t.preventDefault(),SUI.closeModal();var n=e(this).attr("href"),i="_blank"===e(this).attr("target");n&&(i?window.open(n,"_blank"):window.location.href=n)}),e("#smush-bulk-form input#backup").on("change",function(){var t=e(this);t.is(":checked")||(t.prop("checked",!0),window.SUI.openModal("smush-backup-original-images-dialog","wpbody-content",void 0,!1))});document.addEventListener("onSavedSmushSettings",function(e){var t;null!=e&&null!==(t=e.detail)&&void 0!==t&&t.is_outdated_stats&&(!function(){var e=document.querySelector(".wp-smush-current-compression-level"),t=document.querySelector(".wp-smush-lossy-level-tabs button.active");if(e&&t){e.innerText=t.innerText.trim();var n=e.nextElementSibling;n&&(t.id.includes("ultra")?n.classList.add("sui-hidden"):n.classList.remove("sui-hidden"))}}(),d())});var c,d=function(){var e=document.querySelector(".wp-smush-preload-images-status"),t=document.getElementById("preload-images");if(e&&t){var n=t.checked;e.innerText=n?"Active":"Inactive",e.classList.toggle("sui-tag-green",n)}};(c=document.querySelector("#lazyload-native-settings-row #native"))&&c.addEventListener("change",function(e){var t=document.querySelector("#lazyload-noscript-settings-row");t&&t.querySelector("#noscript_fallback")&&(e.target.checked?t.style.display="none":t.style.display="flex")});var h,p,f;h=document.querySelector("#preload-images-settings-row #preload-images"),p=document.getElementById("preload-exclude-settings-row"),f=document.getElementById("preload-images-fetchpriority-settings-row"),h&&(p||f)&&h.addEventListener("change",function(e){var t=e.target.checked;p.style.display=t?"flex":"none",f.style.display=t?"flex":"none"});!function(){var e,t=new URL(window.location.href),n=t.searchParams,i=t.hash,s=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=x(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,s=function(){};return{s:s,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){a=!0,r=e},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw r}}}}(n);try{for(s.s();!(e=s.n()).done;){var r=S(e.value,1)[0];r.startsWith("smush__")&&n.delete(r)}}catch(e){s.e(e)}finally{s.f()}["#directory_smush-settings-row"].forEach(function(e){i===e&&(t.hash="")}),window.history.replaceState({},"",t.toString())}();var m=function(){var e=document.querySelector("#bulk-smush-advanced-settings");if(e){var t=e.querySelector(".sui-accordion-item");if(!t.classList.contains("sui-accordion-item--open")){var n=new URL(window.location.href),i=n.hash;["#original","#backup"].includes(i)&&(t.classList.add("sui-accordion-item--open"),a(i),n.hash="",window.history.replaceState({},"",n.toString()))}}};m(),window.addEventListener("hashchange",m)})},9968:function(e,t,n){"use strict";n.r(t);var i=n(7899);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.success=[],t.renderTemplate(),t.initScan()})},cancel:function(){"start"===this.settings.slide||"finish"===this.settings.slide?window.SUI.closeModal():(this.updateProgressBar(!0),window.location.reload())},updateProgressBar:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=0;0<this.currentStep&&(t=Math.min(Math.round(100*this.currentStep/this.totalSteps),99)),t>100&&(t=100),this.modal.querySelector(".sui-progress-text span").innerHTML=t+"%",this.modal.querySelector(".sui-progress-bar span").style.width=t+"%";var n=this.modal.querySelector(".sui-progress-state-text");n.innerHTML=t>=90?"Finalizing...":e?"Cancelling...":this.currentStep+"/"+this.totalSteps+" images restored"},initScan:function(){var e=this,t=document.getElementById("_wpnonce"),n=new XMLHttpRequest;n.open("POST",ajaxurl+"?action=get_image_count",!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.onload=function(){if(200===n.status){var t=JSON.parse(n.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 "+n.status)},n.send("_ajax_nonce="+t.value)},step:function(){var e=this,t=this,n=document.getElementById("_wpnonce");if(0<this.items.length){var i=this.items.pop(),s=new XMLHttpRequest;s.open("POST",ajaxurl+"?action=restore_step",!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.onload=function(){if(e.currentStep++,200===s.status){var n=(JSON.parse(s.response)||{}).data||{};n.success?t.success.push(i):t.errors.push({id:i,src:n.src||"Error",thumb:n.thumb,link:n.link,error_code:n.error_code||""})}t.updateProgressBar(),t.step()},s.send("item="+i+"&_ajax_nonce="+n.value)}else this.onFinish()},onFinish:function(){var e=this.errors.filter(function(e){return"missing_backup"===e.error_code}).length,t=this.errors.filter(function(e){return"copy_failed"===e.error_code}).length;this.settings={slide:"finish",success:this.success.length,errors:this.errors,errorsCount:this.errors.length,missingBackupCount:e,errorCopyCount:t,total:this.totalSteps},this.renderTemplate(),0<this.errors.length&&(this.modal.style.maxWidth="660px",this.modal.querySelector(".sui-box").style.maxWidth="660px"),this.trackBulkRestoredEvent()},trackBulkRestoredEvent:function(){i.A.track("Bulk Restore Triggered",{Type:"All","Total images restored":this.settings.success,"Total images":this.settings.total,"Backup not found":this.settings.missingBackupCount})}},WP_Smush.restore.template=_.memoize(function(e){var t,n={evaluate:/<#([\s\S]+?)#>/g,interpolate:/{{{([\s\S]+?)}}}/g,escape:/{{([^}]+?)}}(?!})/g,variable:"data"};return function(i){return _.templateSettings=n,(t=t||_.template(document.getElementById(e).innerHTML))(i)}})},8686:function(e,t,n){"use strict";n.r(t);var i=n(9982),s=n(9620),r=n(7119);function o(e){return o="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},o(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}function l(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}function c(e,t){return e.get(d(e,t))}function d(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}!function(e){var t=new WeakMap,n=function(){function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),l(this,t,void 0),this.onClickBulkSmushNow(),this.onClickIgnoreImage(),this.onClickIgnoreAllImages(),this.onScanCompleted(),this.resumeBulkSmushHandler()}return u=n,h=[{key:"onClickBulkSmushNow",value:function(){var t=this;e(".wp-smush-all").on("click",function(n){var i=e(this);i.hasClass("wp-smush-scan-and-bulk-smush")||(n.preventDefault(),t.ajaxBulkSmushStart(i))})}},{key:"resumeBulkSmushHandler",value:function(){var e=this,i=document.querySelector(".wp-smush-resume-bulk-smush");i&&i.addEventListener("click",function(i){c(t,e)&&(i.preventDefault(),i.clientX>0&&i.clientY>0&&i.isTrusted&&o.call(n,c(t,e)))})}},{key:"ajaxBulkSmushStart",value:function(n){var s,o,a,u=this;if(n=n||e("#wp-smush-bulk-content .wp-smush-all"),void 0===window.wp_smushit_data||0===window.wp_smushit_data.unsmushed.length&&0===window.wp_smushit_data.resmush.length)return!1;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, button#save-settings-button").prop("disabled",!0),s=t,o=this,a=new i.A(n,!0),s.set(d(s,o),a),r.A.setOnCancelCallback(function(){c(t,u).cancelAjax()}).update(0,c(t,this).ids.length).show(),this.maybeShowCDNUpsellForPreSiteOnStart(),c(t,this).run()}},{key:"onClickIgnoreImage",value:function(){e("body").on("click",".smush-ignore-image",function(t){t.preventDefault();var n=e(this);n.prop("disabled",!0),n.attr("data-tooltip"),n.removeClass("sui-tooltip"),e.post(ajaxurl,{action:"ignore_bulk_image",id:n.attr("data-id"),_ajax_nonce:wp_smush_msgs.nonce}).done(function(e){n.is("a")&&e.success&&void 0!==e.data.html&&(t.target.closest(".smush-status-links")?n.closest(".smush-status-links").parent().html(e.data.html):t.target.closest(".smush-bulk-error-row")&&(n.addClass("disabled"),t.target.closest(".smush-bulk-error-row").style.opacity=.5))})})}},{key:"onClickIgnoreAllImages",value:function(){var e=document.querySelector(".wp_smush_ignore_all_failed_items");e&&(e.onclick=function(e){e.preventDefault(),e.target.setAttribute("disabled",""),e.target.style.cursor="progress";var t=e.target.dataset.type||null;e.target.classList.remove("sui-tooltip"),s.A.smush.ignoreAll(t).then(function(t){t.success?window.location.reload():(e.target.style.cursor="pointer",e.target.removeAttribute("disabled"),WP_Smush.helpers.showNotice(t))})})}},{key:"onScanCompleted",value:function(){var e=this;document.addEventListener("ajaxBulkSmushOnScanCompleted",function(t){e.ajaxBulkSmushStart()})}},{key:"maybeShowCDNUpsellForPreSiteOnStart",value:function(){var e=document.querySelector(".wp-smush-upsell-cdn");e&&e.classList.remove("sui-hidden")}},{key:"isBulkSmushInProgress",value:function(){var e,n;return(null===(e=c(t,this))||void 0===e||null===(e=e.ids)||void 0===e?void 0:e.length)>0&&(null===(n=c(t,this).button)||void 0===n?void 0:n.hasClass("wp-smush-started"))}},{key:"getTotalEnqueuedImages",value:function(){var e;return(null===(e=c(t,this))||void 0===e?void 0:e.total)||0}},{key:"getCompletionPercentage",value:function(){var e=c(t,this);if(!e)return 0;var n=this.getTotalEnqueuedImages(),i=(Number(e.smushed)||0)+(Array.isArray(e.errors)?e.errors.length:0);return n>0?Math.ceil(100*i/n):0}}],h&&a(u.prototype,h),p&&a(u,p),Object.defineProperty(u,"prototype",{writable:!1}),u;var u,h,p}();function o(e){r.A.disableExceedLimitMode(),r.A.hideBulkSmushDescription(),e.onStart(),e.callAjax()}WP_Smush.bulk=new n}(jQuery)},5994:function(e,t,n){"use strict";var i,s=n(6006),r=function(e,t){e=parseInt(e),t=parseInt(t);var n=!1,i=0,s=0,r={scan:function(){var n=this,i=e-t;0!==t?o(i).fail(this.showScanError):jQuery.post(ajaxurl,{action:"directory_smush_start",_ajax_nonce:window.wp_smush_msgs.nonce},function(){return o(i).fail(n.showScanError)}).fail(this.showScanError)},cancel:function(){return n=!0,jQuery.post(ajaxurl,{action:"directory_smush_cancel",_ajax_nonce:window.wp_smush_msgs.nonce})},getProgress:function(){if(n)return 0;var i=e-t;return Math.min(Math.round(100*parseInt(e-i)/e),99)},onFinishStep:function(n){jQuery(".wp-smush-progress-dialog .sui-progress-state-text").html(t-i+"/"+e+" "+window.wp_smush_msgs.progress_smushed),WP_Smush.directory.updateProgressBar(n)},onFinish:function(){WP_Smush.directory.updateProgressBar(100);var e="".concat(self.wp_smush_msgs.bulk_smush_url,"&smush__directory-scan=done#directory_smush-settings-row");window.location.href===e?window.location.reload():window.location.href=e},showScanError:function(e){var t=jQuery("#wp-smush-progress-dialog");t.removeClass("wp-smush-exceed-limit").addClass("wp-smush-scan-error"),t.find("#smush-scan-error").text("".concat(e.status," ").concat(e.statusText));var n=t.find(".smush-403-error-message");403!==e.status?n.addClass("sui-hidden"):n.removeClass("sui-hidden")},limitReached:function(){var e=jQuery("#wp-smush-progress-dialog");e.addClass("wp-smush-exceed-limit"),e.find("#cancel-directory-smush").attr("data-tooltip",window.wp_smush_msgs.bulk_resume),e.find(".sui-box-body .sui-icon-close").removeClass("sui-icon-close").addClass("sui-icon-play"),e.find("#cancel-directory-smush").attr("id","cancel-directory-smush-disabled")},resume:function(){var e=jQuery("#wp-smush-progress-dialog"),t=e.find("#cancel-directory-smush-disabled");e.removeClass("wp-smush-exceed-limit"),e.find(".sui-box-body .sui-icon-play").removeClass("sui-icon-play").addClass("sui-icon-close"),t.attr("data-tooltip","Cancel"),t.attr("id","cancel-directory-smush"),r.scan()}},o=function(n){return n>=0?(t=e-n,jQuery.post(ajaxurl,{action:"directory_smush_check_step",_ajax_nonce:window.wp_smush_msgs.nonce,step:t},function(e){void 0!==e.success&&e.success?(void 0!==e.data&&void 0!==e.data.skipped&&!0===e.data.skipped&&s++,t++,n-=1,r.onFinishStep(r.getProgress()),o(n).fail(r.showScanError)):void 0!==e.data.error&&"dir_smush_limit_exceeded"===e.data.error?r.limitReached():(i++,t++,n-=1,r.onFinishStep(r.getProgress()),o(n).fail(r.showScanError))})):jQuery.post(ajaxurl,{action:"directory_smush_finish",_ajax_nonce:window.wp_smush_msgs.nonce,items:e-(i+s),failed:i,skipped:s},function(e){return r.onFinish(e)})};return r};i=jQuery,WP_Smush.directory={selected:[],tree:[],wp_smush_msgs:[],triggered:!1,init:function(){var e=this,t=i("#wp-smush-progress-dialog"),n=0,s=0;void 0!==window.wp_smushit_data.dir_smush&&(n=window.wp_smushit_data.dir_smush.totalSteps,s=window.wp_smushit_data.dir_smush.currentScanStep),this.scanner=new r(n,s),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){t.preventDefault(),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");var n=i(this);n.addClass("sui-button-onload");var s=e.tree.getSelectedNodes(),o=[];s.forEach(function(e){o.push(e.key)});var a={action:"image_list",smush_path:o,image_list_nonce:i('input[name="image_list_nonce"]').val()};i.post(ajaxurl,a,function(t){t.success?(window.SUI.closeModal(),e.scanner=new r(t.data,0),e.showProgressDialog(t.data),e.scanner.scan()):(n.removeClass("sui-button-onload"),window.SUI.openNotice("wp-smush-ajax-notice",t.data.message,{type:"warning"}))})}),t.on("click","#cancel-directory-smush, #dialog-close-div, .wp-smush-cancel-dir",function(t){t.preventDefault(),i(".wp-smush-cancel-dir").addClass("sui-button-onload"),e.scanner.cancel().done(function(){var t="".concat(e.wp_smush_msgs.bulk_smush_url,"&smush__directory-scan=done#directory_smush-settings-row");window.location.href===t?window.location.reload():window.location.href=t})}),t.on("click",".sui-icon-play, .wp-smush-resume-scan",function(t){t.preventDefault(),e.scanner.resume()});var o=window.location.search;new URLSearchParams(o).has("smush__directory-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"),n={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,s.createTree)(".wp-smush-list-dialog .content",{autoCollapse:!0,clickFolderMode:3,checkbox:!0,debugLevel:0,selectMode:3,tabindex:"0",keyboard:!0,quicksearch:!0,source:n,lazyLoad:function(e,t){t.result=new Promise(function(e,s){n.data.dir=t.node.key,i.ajax(n).done(function(t){return e(t)}).fail(s)})},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()},770:function(){function e(t){return e="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(t)}!function(){"use strict";WP_Smush.helpers={init:function(){},cacheUpsellErrorCodes:[],formatBytes:function(e,t){var n=1024,i=["KB","MB","GB","TB","PB"];if(Math.abs(e)<n)return e+" B";var s=-1;do{e/=n,++s}while(Math.abs(e)>=n&&s<i.length-1);return e.toFixed(t)+" "+i[s]},getSizeFromString:function(e){return e.replace(/[a-zA-Z]/g,"").trim()},getFormatFromString:function(e){return e.replace(/[0-9.]/g,"").trim()},precise_round:function(e,t){var n=e>=0?1:-1;return e=e>100?100:e,Math.round(e*Math.pow(10,t)+.001*n)/Math.pow(10,t)},showErrorNotice:function(e){if(void 0!==e){var t="<p>".concat(e,"</p>");SUI.openNotice("wp-smush-ajax-notice",t,{type:"error",icon:"info"});var n=document.querySelector(".sui-button-onload");n&&n.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)},prepareBulkSmushErrorRow:function(e,t,n,i,s,r){var o=n&&void 0!==n?'<img class="attachment-thumbnail" src="'.concat(n,'" />'):'<i class="sui-icon-photo-picture" aria-hidden="true"></i>',a=window.wp_smush_msgs.edit_link.replace("{{id}}",i);t="undefined"===t||void 0===t?"undefined":t;var u='<div class="smush-bulk-error-row" data-error-code="'.concat(r,'">\n\t\t\t\t\t<div class="smush-bulk-image-data">\n\t\t\t\t\t\t<div class="smush-bulk-image-title">\n\t\t\t\t\t\t\t').concat(o,'\n\t\t\t\t\t\t\t<span class="smush-image-name">\n\t\t\t\t\t\t\t\t<a href="').concat(a,'">').concat(t,'</a>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<div class="smush-image-error">\n\t\t\t\t\t\t').concat(e,"\n\t\t\t\t\t</div>\n\t\t\t\t</div>");return"media"===s&&(u+='<div class="smush-bulk-image-actions">\n\t\t\t\t\t\t<a href="javascript:void(0)" class="sui-tooltip sui-tooltip-constrained sui-tooltip-left smush-ignore-image" data-tooltip="'.concat(window.wp_smush_msgs.error_ignore,'" data-id="').concat(i,'">\n\t\t\t\t\t\t\t').concat(window.wp_smush_msgs.btn_ignore,'\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<a class="smush-link-detail" href="').concat(a,'">\n\t\t\t\t\t\t\t').concat(window.wp_smush_msgs.view_detail,"\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</div>")),u+="</div>",u+=WP_Smush.helpers.upsellWithError(r)},cacheUpsellErrorCode:function(e){this.cacheUpsellErrorCodes.push(e)},upsellWithError:function(e){return e&&window.wp_smush_msgs["error_"+e]&&!this.isUpsellRendered(e)?(this.cacheRenderedUpsell(e),'<div class="smush-bulk-error-row smush-error-upsell"><div class="smush-bulk-image-title"><span class="smush-image-error">'+window.wp_smush_msgs["error_"+e]+"</span></div></div>"):""},isUpsellRendered:function(e){return this.cacheUpsellErrorCodes.includes(e)},cacheRenderedUpsell:function(e){this.cacheUpsellErrorCodes.push(e)},getErrorMessage:function(e){return e.message||e.data&&e.data.message||e.responseJSON&&e.responseJSON.data&&e.responseJSON.data.message||window.wp_smush_msgs.generic_ajax_error||e.status&&"Request failed. Returned status of "+e.status},showNotice:function(t,n){var i;if(i="object"===e(t)?this.getErrorMessage(t):t){n=n||{},n={type:(n=Object.assign({showdismiss:!1,autoclose:!0},n)).type||"error",icon:n.icon||("success"===n.type?"check-tick":"info"),dismiss:{show:n.showdismiss,label:window.wp_smush_msgs.noticeDismiss,tooltip:window.wp_smush_msgs.noticeDismissTooltip},autoclose:{show:n.autoclose}};var s="<p>".concat(i,"</p>");return SUI.openNotice("wp-smush-ajax-notice",s,n),Promise.resolve("#wp-smush-ajax-notice")}},closeNotice:function(){window.SUI.closeNotice("wp-smush-ajax-notice")},renderActivationCDNNotice:function(e){if(!document.getElementById("wp-smush-animated-upsell-notice")){var t='<div class="sui-notice sui-notice-info sui-margin-top" id="wp-smush-animated-upsell-notice">\n\t\t\t\t\t\t\t\t\t<div class="sui-notice-content">\n\t\t\t\t\t\t\t\t\t\t<div class="sui-notice-message">\n\t\t\t\t\t\t\t\t\t\t\t<i class="sui-notice-icon sui-icon-info" aria-hidden="true"></i>\n\t\t\t\t\t\t\t\t\t\t\t<p>'.concat(e,"</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>");document.querySelector("#smush-box-bulk .wp-smush-bulk-wrapper").outerHTML+=t}},redirectToPage:function(e){e="page=smush-".concat(e),window.location.href.includes(e)?window.location.reload():window.location.search=e},showModal:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};window.SUI&&(t=Object.assign({focusAfterClosed:"wpbody-content",focusWhenOpen:void 0,hasOverlayMask:!1,isCloseOnEsc:!1,isAnimated:!0},t),window.SUI.openModal(e,t.focusAfterClosed,t.focusWhenOpen,t.hasOverlayMask,t.isCloseOnEsc,t.isAnimated))}},WP_Smush.helpers.init()}()},4726:function(e,t,n){"use strict";n.r(t);var i=n(7119),s=n(9738),r=n(5417);function o(e){return o="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},o(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}function l(e,t,n){return t=p(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,c()?Reflect.construct(t,n||[],p(e).constructor):t.apply(e,n))}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}function d(e,t,n,i){var s=h(p(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof s?function(e){return s.apply(n,e)}:s}function h(){return h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=p(e)););return e}(e,t);if(i){var s=Object.getOwnPropertyDescriptor(i,t);return s.get?s.get.call(arguments.length<3?e:n):s.value}},h.apply(null,arguments)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}!function(){if(window.wp_smush_msgs){var e=document.querySelector.bind(document);if(e(".wp-smush-scan-progress-bar-wrapper")){var t=e(".wp-smush-scan");if(t){var n,o=e(".wp-smush-bo-start")||e(".wp-smush-bulk-wrapper .wp-smush-all"),u=wp.i18n.__,c=new(function(n){function s(){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=l(this,s)).runBulkSmushOnComplete=!1,t.restoreButton=e(".wp-smush-restore"),t.autoBulkSmushNotification=e(".wp-smush-auto-bulk-smush-notification"),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(s,n),c=s,(h=[{key:"startScanThenBulkSmushOnComplete",value:function(){this.runBulkSmushOnComplete=!0,this.startScan(!0)}},{key:"onStart",value:function(){return this.hideRecheckNotice(),this.hideFailedBulkSmushNotice(),this.disableRelatedButtons(),this.setRecheckImagesButtonOnLoad(),this.toggleBulkSmushBoxContent(),this}},{key:"onStartFailure",value:function(e){d(s,"onStartFailure",this,3)([e]),this.revertRelatedButtons()}},{key:"onCloseProgressBar",value:function(){this.maybeHideAutoBulkSmushNotification()}},{key:"disableRelatedButtons",value:function(){this.restoreButton.setAttribute("disabled",!0),o&&(o.setAttribute("disabled",!0),this.setInnerText(o,u("Waiting for Re-check to finish","wp-smushit")))}},{key:"revertRelatedButtons",value:function(){return o&&(o.removeAttribute("disabled"),this.revertInnerText(o)),this.restoreButton.removeAttribute("disabled"),this.revertRecheckImagesButton(),this}},{key:"setRecheckImagesButtonOnLoad",value:function(){this.disableRecheckImagesButton(),this.setInnerText(t.querySelector(".wp-smush-inner-text"),u("Checking Images","wp-smushit"))}},{key:"disableRecheckImagesButton",value:function(){t.setAttribute("disabled",!0)}},{key:"revertRecheckImagesButton",value:function(){t.removeAttribute("disabled"),this.revertInnerText(t.querySelector(".wp-smush-inner-text"))}},{key:"beforeUpdateStatus",value:function(e){this.runBulkSmushOnComplete=null==e?void 0:e.optimize_on_scan_completed,this.maybeShowAutoBulkSmushNotification()}},{key:"onDead",value:function(e){d(s,"onDead",this,3)([e]),this.revertRelatedButtons(),this.setRequiredScanForBulkSmushButton()}},{key:"onFinish",value:function(e){var t=e.global_stats;d(s,"onFinish",this,3)([e]),this.revertRelatedButtons(),this.toggleBulkSmushDescription(t),t.is_outdated?this.setRequiredScanForBulkSmushButton():this.removeScanEventFromBulkSmushButton(),this.revertRecheckWarning()}},{key:"onCompleted",value:function(e){o?(this.onFinish(e),e.global_stats.remaining_count<1||(this.runBulkSmushOnComplete?(this.runBulkSmushOnComplete=!1,this.triggerBulkSmushEvent(e)):this.showRecheckNoticeSuccess())):window.location.reload()}},{key:"showNotice",value:function(e){if(e.notice){var t="success";void 0!==e.noticeType&&(t=e.noticeType),window.SUI.openNotice("wp-smush-ajax-notice","<p>"+e.notice+"</p>",{type:t,icon:"check-tick"})}}},{key:"showRecheckNoticeSuccess",value:function(){var t=e(".wp-smush-recheck-images-notice-box");t&&(this.hideFailedBulkSmushNotice(),this.showAnElement(t),this.hideAnElement(t.querySelector(".wp-smush-recheck-images-notice-warning")),this.showAnElement(t.querySelector(".wp-smush-recheck-images-notice-success")))}},{key:"showRecheckNoticeWarning",value:function(){var t=e(".wp-smush-recheck-images-notice-box");t&&(this.hideFailedBulkSmushNotice(),this.showAnElement(t),this.hideAnElement(t.querySelector(".wp-smush-recheck-images-notice-success")),this.showAnElement(t.querySelector(".wp-smush-recheck-images-notice-warning")))}},{key:"hideRecheckNotice",value:function(){this.hideAnElement(e(".wp-smush-recheck-images-notice-box"))}},{key:"hideFailedBulkSmushNotice",value:function(){this.hideAnElement(e("#smush-box-inline-retry-bulk-smush-notice"))}},{key:"showProgressErrorNoticeOnRecheckNotice",value:function(){var t=e(".wp-smush-recheck-images-notice-box .wp-smush-recheck-images-notice-warning");t&&(t.classList.add("sui-notice-error"),t.classList.remove("sui-notice-warning"),this.showRecheckNoticeWarning())}},{key:"revertRecheckWarning",value:function(){var t=e(".wp-smush-recheck-images-notice-box .wp-smush-recheck-images-notice-warning");t&&(t.classList.add("sui-notice-warning"),t.classList.remove("sui-notice-error"),this.revertInnerText(t.querySelector("span")))}},{key:"triggerBulkSmushEvent",value:function(e){this.disableRecheckImagesButton(),e.enabled_background_process?this.triggerBackgroundBulkSmushEvent(e.global_stats):this.triggerAjaxBulkSmushEvent(e.global_stats)}},{key:"toggleBulkSmushDescription",value:function(e){i.A.isEmptyObject||(e.remaining_count<1?(i.A.hideBulkSmushDescription(),i.A.showBulkSmushAllDone()):(i.A.showBulkSmushDescription(),i.A.hideBulkSmushAllDone()))}},{key:"setRequiredScanForBulkSmushButton",value:function(){o&&o.classList.add("wp-smush-scan-and-bulk-smush")}},{key:"removeScanEventFromBulkSmushButton",value:function(){o&&o.classList.remove("wp-smush-scan-and-bulk-smush")}},{key:"triggerBackgroundBulkSmushEvent",value:function(e){document.dispatchEvent(new CustomEvent("backgroundBulkSmushOnScanCompleted",{detail:e}))}},{key:"triggerAjaxBulkSmushEvent",value:function(e){document.dispatchEvent(new CustomEvent("ajaxBulkSmushOnScanCompleted",{detail:e}))}},{key:"onCancelled",value:function(e){this.onFinish(e),this.runBulkSmushOnComplete=!1,this.setRequiredScanForBulkSmushButton()}},{key:"maybeShowAutoBulkSmushNotification",value:function(){this.runBulkSmushOnComplete&&this.showAnElement(this.autoBulkSmushNotification)}},{key:"maybeHideAutoBulkSmushNotification",value:function(){this.runBulkSmushOnComplete&&this.hideAnElement(this.autoBulkSmushNotification)}},{key:"toggleBulkSmushBoxContent",value:function(){r.R.resetAndHideBulkErrors(),this.toggleBulkSmushDescription(r.R.getGlobalStats())}}])&&a(c.prototype,h),p&&a(c,p),Object.defineProperty(c,"prototype",{writable:!1}),c;var c,h,p}(s.default));t&&t.classList.contains("wp-smush-background-scan")&&(t.addEventListener("click",function(){return c.startScan()}),null!==(n=window.wp_smushit_data.media_library_scan)&&void 0!==n&&n.in_processing&&c.onStart().showProgressBar().autoSyncStatus()),function(){if(o){o.addEventListener("click",function(e){o.classList.contains("wp-smush-scan-and-bulk-smush")&&(e.preventDefault(),c.startScanThenBulkSmushOnComplete())})}}(),function(){var n=e(".wp-smush-recheck-images-notice-box");if(n&&t){var i,s,r=n.querySelector(".wp-smush-trigger-background-scan");if(r)if(r.onclick=function(e){e.preventDefault(),t.click()},!window.location.search.includes("smush-action=start-scan-media"))null!==(i=window.wp_smushit_data.media_library_scan)&&void 0!==i&&i.is_dead?c.showProgressErrorNoticeOnRecheckNotice():!window.wp_smushit_data.is_outdated||null!==(s=window.wp_smushit_data)&&void 0!==s&&null!==(s=s.bo_stats)&&void 0!==s&&s.is_dead||c.showRecheckNoticeWarning();var a=n.querySelector(".wp-smush-trigger-bulk-smush");a&&o&&(a.onclick=function(e){e.preventDefault(),n.classList.add("sui-hidden"),o.click()});var u=n.querySelectorAll("button.sui-button-icon");u&&u.forEach(function(e){e.onclick=function(t){e.closest(".sui-recheck-images-notice").classList.add("sui-hidden")}}),document.addEventListener("onSavedSmushSettings",function(e){var t;if(null!=e&&null!==(t=e.detail)&&void 0!==t&&t.is_outdated_stats){c.setRequiredScanForBulkSmushButton();var i=document.querySelector("#smush-box-inline-retry-bulk-smush-notice");i&&!i.classList.contains("sui-hidden")||(n.classList.remove("sui-hidden"),n.querySelector(".wp-smush-recheck-images-notice-success").classList.add("sui-hidden"),n.querySelector(".wp-smush-recheck-images-notice-warning").classList.remove("sui-hidden"))}})}}(),function(){if(t&&window.location.search.includes("smush-action=start-scan-media")){t.click();var e;e=window.location.href.replace("&smush-action=start-scan-media",""),window.history.pushState(null,null,e)}}(),function(){if(o&&window.location.search.includes("smush-action=start-bulk-")){o.click();var e;e=window.location.href.replace(/&smush-action=start-bulk-(smush|webp-conversion)/i,""),window.history.pushState(null,null,e)}}(),function(){var e=document.getElementById("smush-loopback-error-dialog");if(e){var n=e.querySelector(".smush-retry-process-button");n&&n.addEventListener("click",function(){var n;"scan"===((null===(n=e.dataset)||void 0===n?void 0:n.processType)||"scan")?t.click():o.click()})}}()}}}}()},2339:function(e,t,n){"use strict";n.r(t);var i=n(9738);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,o(i.key),i)}}function o(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=s(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}function a(e,t,n){return t=l(t),function(e,t){if(t&&("object"==s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],l(e).constructor):t.apply(e,n))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}!function(e){if(window.wp_smush_msgs){var t=document.querySelector.bind(document);if(t(".wp-smush-scan-progress-bar-wrapper"))if(!t(".wp-smush-scan"))if(null===(e=window.wp_smushit_data.media_library_scan)||void 0===e?void 0:e.in_processing){var n=wp.i18n.__;(new(function(e){function i(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=a(this,i)).bulkSmushLink=t(".wp-smush-bulk-smush-link"),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(i,e),s=i,(o=[{key:"onShowProgressBar",value:function(){this.disableBulkSmushLink()}},{key:"onCloseProgressBar",value:function(){this.revertBulkSmushLink()}},{key:"disableBulkSmushLink",value:function(){this.bulkSmushLink&&(this.bulkSmushLink.setAttribute("disabled",!0),this.setInnerText(this.bulkSmushLink,n("Waiting for Re-check to finish","wp-smushit")))}},{key:"revertBulkSmushLink",value:function(){this.bulkSmushLink&&(this.bulkSmushLink.removeAttribute("disabled"),this.revertInnerText(this.bulkSmushLink))}}])&&r(s.prototype,o),u&&r(s,u),Object.defineProperty(s,"prototype",{writable:!1}),s;var s,o,u}(i.default))).showProgressBar().autoSyncStatus()}}}()},7811:function(){!function(e){"use strict";var t=e("#wp-smush-s3support-alert");if(t.length){var n={type:"warning",icon:"info",dismiss:{show:!0,label:wp_smush_msgs.noticeDismiss,tooltip:wp_smush_msgs.noticeDismissTooltip}};window.SUI.openNotice("wp-smush-s3support-alert",t.data("message"),n)}function i(t){var n=e(t.currentTarget).closest(".smush-notice");n.fadeTo(100,0,function(){return n.slideUp(100,function(){return n.remove()})})}t.on("click","button",function(){e.post(ajaxurl,{action:"dismiss_s3support_alert",_ajax_nonce:window.wp_smush_msgs.nonce})}),e("#wp-smush-api-message button.sui-button-icon").on("click",function(t){t.preventDefault();var n=e("#wp-smush-api-message");n.slideUp("slow",function(){n.remove()}),e.post(ajaxurl,{action:"hide_api_message",_ajax_nonce:window.wp_smush_msgs.nonce})}),e(".smush-notice .smush-notice-act").on("click",function(e){i(e)}),e(".wp-smush-update-info").on("click",".notice-dismiss",function(t){t.preventDefault(),i(t),e.post(ajaxurl,{action:"dismiss_update_info",_ajax_nonce:window.wp_smush_msgs.nonce})}),function(){var t=e("#smush-hub-connect-media-notice");if(t.length){var n=e(".wrap > .wp-header-end");n.length&&n.after(t.show())}}(),e("#smush-media-notification-skip").on("click",function(t){t.preventDefault(),e.post(ajaxurl,{action:"dismiss_media_hub_connect_notice",_ajax_nonce:window.wp_smush_msgs.nonce}).done(function(t){t&&t.success&&e("#smush-hub-connect-media-notice").remove()}).fail(function(){console.error("Failed to dismiss the media hub connect notice.")})})}(jQuery)},5557:function(e,t,n){"use strict";n.r(t);var i,s=n(7899),r=n(8274);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,s,r,o,a=[],u=!0,l=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(i=r.call(n)).done)&&(a.push(i.value),a.length!==t);u=!0);}catch(e){l=!0,s=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw s}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function u(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function r(n,i,s,r){var u=i&&i.prototype instanceof a?i:a,c=Object.create(u.prototype);return l(c,"_invoke",function(n,i,s){var r,a,u,l=0,c=s||[],d=!1,h={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return r=t,a=0,u=e,h.n=n,o}};function p(n,i){for(a=n,u=i,t=0;!d&&l&&!s&&t<c.length;t++){var s,r=c[t],p=h.p,f=r[2];n>3?(s=f===i)&&(u=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((s=n<2&&p<r[1])?(a=0,h.v=i,h.n=r[1]):p<f&&(s=n<3||r[0]>i||i>f)&&(r[4]=n,r[5]=i,h.n=f,a=0))}if(s||n>1)return o;throw d=!0,i}return function(s,c,f){if(l>1)throw TypeError("Generator is already running");for(d&&1===c&&p(c,f),a=c,u=f;(t=a<2?e:u)||!d;){r||(a?a<3?(a>1&&(h.n=-1),p(a,u)):h.n=u:h.v=u);try{if(l=2,r){if(a||(s="next"),t=r[s]){if(!(t=t.call(r,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(u=TypeError("The iterator does not provide a '"+s+"' method"),a=1);r=e}else if((t=(d=h.n<0)?u:n.call(i,h))!==o)break}catch(t){r=e,a=1,u=t}finally{l=1}}return{value:t,done:d}}}(n,s,r),!0),c}var o={};function a(){}function c(){}function d(){}t=Object.getPrototypeOf;var h=[][i]?t(t([][i]())):(l(t={},i,function(){return this}),t),p=d.prototype=a.prototype=Object.create(h);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,l(e,s,"GeneratorFunction")),e.prototype=Object.create(p),e}return c.prototype=d,l(p,"constructor",d),l(d,"constructor",c),c.displayName="GeneratorFunction",l(d,s,"GeneratorFunction"),l(p),l(p,s,"Generator"),l(p,i,function(){return this}),l(p,"toString",function(){return"[object Generator]"}),(u=function(){return{w:r,m:f}})()}function l(e,t,n,i){var s=Object.defineProperty;try{s({},"",{})}catch(e){s=0}l=function(e,t,n,i){function r(t,n){l(e,t,function(e){return this._invoke(t,n,e)})}t?s?s(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(r("next",0),r("throw",1),r("return",2))},l(e,t,n,i)}function c(e,t,n,i,s,r,o){try{var a=e[r](o),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,s)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(i,s){var r=e.apply(t,n);function o(e){c(r,i,s,o,a,"next",e)}function a(e){c(r,i,s,o,a,"throw",e)}o(void 0)})}}i="smush-onboarding-free",document.getElementById(i)&&(WP_Smush.onboarding={membership:"free",onboardingModal:document.getElementById("smush-onboarding-dialog"),settings:{first:!0,last:!1,slide:"start",fields:{}},fields:{},contentContainer:document.getElementById("smush-onboarding-content"),onboardingSlides:[],touchX:null,touchY:null,recheckImagesLink:"",upsellUTMClicked:!1,registerEventListeners:function(){document.addEventListener("smush-onboarding:rendered-slide-scan_completed",this.progressBarAnimation.bind(this)),this.skipButton=this.onboardingModal.querySelector(".smush-onboarding-skip-link"),this.skipButton&&this.skipButton.addEventListener("click",this.skipSetup.bind(this))},init:function(){var e,t;if(this.onboardingModal){this.onboardingSlides=(null===(e=window.onBoardingData)||void 0===e?void 0:e.slideKeys)||[],this.fields=(null===(t=window.onBoardingData)||void 0===t?void 0:t.slideFields)||{},this.settings.slide=this.onboardingSlides.length?this.onboardingSlides[0]:"start";var n=document.getElementById(i);this.membership=n.dataset.type,this.recheckImagesLink=n.dataset.ctaUrl,"false"===n.dataset.tracking&&this.onboardingSlides.pop(),this.registerEventListeners(),this.renderTemplate(),window.SUI.openModal("smush-onboarding-dialog","wpcontent",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,n=e.touches[0].clientY,i=this.touchX-t,s=this.touchY-n;Math.abs(i)>Math.abs(s)&&(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}},progressBarAnimation:function(e){var t=this,n=this.onboardingModal.querySelector(".sui-progress-bar span"),i=this.onboardingModal.querySelector(".sui-progress-text"),s=0;if(n&&i)var r=setInterval(function(){s+=10;var e=Math.min(Math.round(s/3e3*100),100);if(n.style.width=e+"%",i.textContent=e+"%",e>=100){clearInterval(r);var o=t.onboardingModal.querySelector(".sui-icon-loader");o&&(o.classList.remove("sui-icon-loader","sui-loading"),o.style.color="#1ABC9C",o.classList.add("sui-icon-check-tick"));var a=t.onboardingModal.querySelector(".scan-stats");a&&a.classList.remove("sui-hidden")}},10)},renderTemplate:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";this.updateCheckboxStates();var n=WP_Smush.onboarding.template(i),s=this.settings;s.fields=this.fields;var r=n(s);r&&(this.contentContainer.innerHTML=r,"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(),this.toggleSkipButton(),this.maybeHandleUpsellUTMClick();var o=new CustomEvent("smush-onboarding:rendered-slide-".concat(this.settings.slide),{detail:{settings:this.settings}});document.dispatchEvent(o)},updateCheckboxStates:function(){var e=this,t=this.onboardingModal.querySelectorAll('input[type="checkbox"]');t&&t.forEach(function(t){e.fields[t.id]=t.checked})},toggleSkipButton:function(){this.skipButton&&(this.settings.last?this.skipButton.classList.add("sui-hidden"):this.skipButton.classList.remove("sui-hidden"))},bindSubmit:function(){var e=this.onboardingModal.querySelector('button[type="submit"]'),t=this;e&&e.addEventListener("click",function(){var n=d(u().m(function n(i){var s,r;return u().w(function(n){for(;;)switch(n.p=n.n){case 0:return i.preventDefault(),e.classList.add("sui-button-onload-text"),t.updateCheckboxStates(),n.p=1,n.n=2,t.trackFinishSetupWizard();case 2:n.n=4;break;case 3:n.p=3,n.v;case 4:s=document.getElementById("smush_quick_setup_nonce"),(r=new XMLHttpRequest).open("POST",ajaxurl+"?action=smush_free_setup",!0),r.setRequestHeader("Content-type","application/x-www-form-urlencoded"),r.onload=function(){200===r.status?t.onFinishingSetup():window.console.log("Request failed.  Returned status of "+r.status)},r.send("smush_settings="+JSON.stringify(t.fields)+"&_ajax_nonce="+s.value);case 5:return n.a(2)}},n,null,[[1,3]])}));return function(e){return n.apply(this,arguments)}}())},onFinishingSetup:function(){var e;this.onFinish(),null!==(e=window.onBoardingData)&&void 0!==e&&e.isSiteConnected?this.redirectAndStartBulkSmush():this.redirectToConnectSite()},redirectAndStartBulkSmush:function(){var e,t;null!==(e=window.onBoardingData)&&void 0!==e&&e.startBulkSmushURL&&(window.location.href=null===(t=window.onBoardingData)||void 0===t?void 0:t.startBulkSmushURL)},onFinish:function(){window.SUI.closeModal()},redirectToConnectSite:function(){var e,t;null!==(e=window.onBoardingData)&&void 0!==e&&e.connectSiteUrl&&(window.location.href=null===(t=window.onBoardingData)||void 0===t?void 0:t.connectSiteUrl)},next:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.onboardingSlides.indexOf(this.settings.slide),i=0;i=t?"next"===t?n+1:n-1:null!==e&&e.classList.contains("next")?n+1:n-1;var s=null!==e&&e.classList.contains("next")?"fadeInRight":"fadeInLeft";this.settings={first:0===i,last:i+1===this.onboardingSlides.length,slide:this.onboardingSlides[i],fields:this.fields},this.renderTemplate(s)},goTo:function(e){var t=this.onboardingSlides.indexOf(e);this.settings={first:0===t,last:t+1===this.onboardingSlides.length,slide:e,fields:this.fields},this.renderTemplate()},skipSetup:function(){var e=this;return d(u().m(function t(){var n,i;return u().w(function(t){for(;;)switch(t.p=t.n){case 0:return n=document.getElementById("smush_quick_setup_nonce"),e.updateCheckboxStates(),t.p=1,t.n=2,e.trackSkipSetupWizard();case 2:t.n=4;break;case 3:t.p=3,t.v;case 4:(i=new XMLHttpRequest).open("POST",ajaxurl+"?action=skip_smush_setup&_ajax_nonce="+n.value),i.onload=function(){200===i.status?e.onSkipSetup():window.console.log("Request failed.  Returned status of "+i.status)},i.send();case 5:return t.a(2)}},t,null,[[1,3]])}))()},onSkipSetup:function(){this.onFinish(),this.redirectBulkSmushPage()},redirectBulkSmushPage:function(){var e,t=null===(e=window.wp_smush_msgs)||void 0===e?void 0:e.bulk_smush_url;t&&(window.location.href=t)},hideUpgradeModal:function(e,t){var n="_blank"!==(null==t?void 0:t.target);n&&e.preventDefault(),t.classList.add("wp-smush-link-in-progress");var i=null==t?void 0:t.href,r=new XMLHttpRequest;r.open("POST",ajaxurl+"?action=hide_new_features&_ajax_nonce="+window.wp_smush_msgs.nonce),r.onload=function(){window.SUI.closeModal(),t.classList.remove("wp-smush-link-in-progress");var e=i?"cta_clicked":"closed";s.A.track("update_modal_displayed",{Action:e}),200===r.status?i&&n&&(window.location.href=i):window.console.log("Request failed.  Returned status of "+r.status)},r.send()},maybeHandleUpsellUTMClick:function(){var e,t=this;if("configure"===(null===(e=this.settings)||void 0===e?void 0:e.slide)){var n=this.onboardingModal.querySelector(".smush-btn-pro-upsell");n&&n.addEventListener("click",function(){t.upsellUTMClicked=!0},{once:!0}),this.trackProUpsellOnClick(n)}},trackFinishSetupWizard:function(){var e;return this.trackSetupWizard(null!==(e=window.onBoardingData)&&void 0!==e&&e.isSiteConnected?"complete_wizard":"connect")},trackSkipSetupWizard:function(){return this.trackSetupWizard("quit")},trackSetupWizard:function(e){var t,n="quit"===e,i={Action:e,"Quit Step":this.getQuitStep(n),"Settings Enabled":this.getEnabledSettings(n),"Wizard Upsell":this.upsellUTMClicked?"clicked_utm":"na"},r=null===(t=this.fields)||void 0===t?void 0:t.usage;return s.A.setAllowToTrack(r).track("Setup Wizard New",i)},getQuitStep:function(e){return e&&this.settings.slide||"na"},getEnabledSettings:function(e){if(e)return"na";var t=this.getFieldMapsForTracking(),n=[];return Object.entries(this.fields).forEach(function(e){var i=o(e,2),s=i[0];if(i[1]){var r=s in t?t[s]:s;n.push(r)}}),n},getProInterests:function(){return"pro"!==this.membership&&this.upsellUTMClicked.length?this.upsellUTMClicked:"na"},getFieldMapsForTracking:function(){return{usage:"tracking",auto:"auto_smush",lossy:"super_smush",strip_exif:"strip_exif",compress_backup:"compress_backup",lazy_load:"lazy_load"}},trackProUpsellOnClick:function(e){var t=this;e&&e.addEventListener("click",function(e){var n,i,o=null===(n=t.fields)||void 0===n?void 0:n.usage;s.A.setAllowToTrack(o),(new r.A).trackSetupWizardProUpsell(null==e||null===(i=e.target)||void 0===i?void 0:i.href,"na")})}},WP_Smush.onboarding.template=_.memoize(function(e){var t,n={evaluate:/<#([\s\S]+?)#>/g,interpolate:/{{{([\s\S]+?)}}}/g,escape:/{{([^}]+?)}}(?!})/g,variable:"data"};return function(i){return _.templateSettings=n,(t=t||_.template(document.getElementById(e).innerHTML))(i)}}),window.addEventListener("load",function(){return WP_Smush.onboarding.init()}))},234:function(e,t,n){"use strict";n.r(t);var i=n(7899),s=n(8274);function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,s,r,o,a=[],u=!0,l=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(i=r.call(n)).done)&&(a.push(i.value),a.length!==t);u=!0);}catch(e){l=!0,s=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw s}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function a(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function r(n,i,s,r){var a=i&&i.prototype instanceof l?i:l,c=Object.create(a.prototype);return u(c,"_invoke",function(n,i,s){var r,a,u,l=0,c=s||[],d=!1,h={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return r=t,a=0,u=e,h.n=n,o}};function p(n,i){for(a=n,u=i,t=0;!d&&l&&!s&&t<c.length;t++){var s,r=c[t],p=h.p,f=r[2];n>3?(s=f===i)&&(u=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((s=n<2&&p<r[1])?(a=0,h.v=i,h.n=r[1]):p<f&&(s=n<3||r[0]>i||i>f)&&(r[4]=n,r[5]=i,h.n=f,a=0))}if(s||n>1)return o;throw d=!0,i}return function(s,c,f){if(l>1)throw TypeError("Generator is already running");for(d&&1===c&&p(c,f),a=c,u=f;(t=a<2?e:u)||!d;){r||(a?a<3?(a>1&&(h.n=-1),p(a,u)):h.n=u:h.v=u);try{if(l=2,r){if(a||(s="next"),t=r[s]){if(!(t=t.call(r,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(u=TypeError("The iterator does not provide a '"+s+"' method"),a=1);r=e}else if((t=(d=h.n<0)?u:n.call(i,h))!==o)break}catch(t){r=e,a=1,u=t}finally{l=1}}return{value:t,done:d}}}(n,s,r),!0),c}var o={};function l(){}function c(){}function d(){}t=Object.getPrototypeOf;var h=[][i]?t(t([][i]())):(u(t={},i,function(){return this}),t),p=d.prototype=l.prototype=Object.create(h);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,u(e,s,"GeneratorFunction")),e.prototype=Object.create(p),e}return c.prototype=d,u(p,"constructor",d),u(d,"constructor",c),c.displayName="GeneratorFunction",u(d,s,"GeneratorFunction"),u(p),u(p,s,"Generator"),u(p,i,function(){return this}),u(p,"toString",function(){return"[object Generator]"}),(a=function(){return{w:r,m:f}})()}function u(e,t,n,i){var s=Object.defineProperty;try{s({},"",{})}catch(e){s=0}u=function(e,t,n,i){function r(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?s?s(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(r("next",0),r("throw",1),r("return",2))},u(e,t,n,i)}function l(e,t,n,i,s,r,o){try{var a=e[r](o),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,s)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(i,s){var r=e.apply(t,n);function o(e){l(r,i,s,o,a,"next",e)}function a(e){l(r,i,s,o,a,"throw",e)}o(void 0)})}}document.getElementById("smush-onboarding-free")||(WP_Smush.onboarding={membership:"free",onboardingModal:document.getElementById("smush-onboarding-dialog"),first_slide:"usage",settings:{first:!0,last:!1,slide:"usage",value:!1},selection:{usage:!1,auto:!0,lossy:!0,strip_exif:!0,original:!0,preload_images:!0,lazy_load:!0},contentContainer:document.getElementById("smush-onboarding-content"),onboardingSlides:["usage","auto","lossy","strip_exif","original","preload_images","lazy_load"],touchX:null,touchY:null,recheckImagesLink:"",proFeaturesClicked:[],init:function(){if(this.onboardingModal){var e=document.getElementById("smush-onboarding");this.membership=e.dataset.type,this.recheckImagesLink=e.dataset.ctaUrl,"pro"!==this.membership&&(this.onboardingSlides=["usage","auto","lossy","strip_exif","original","lazy_load","pro_upsell"]),"false"===e.dataset.tracking&&this.onboardingSlides.pop(),this.renderTemplate(),this.skipButton=this.onboardingModal.querySelector(".smush-onboarding-skip-link"),this.skipButton&&this.skipButton.addEventListener("click",this.skipSetup.bind(this)),window.SUI.openModal("smush-onboarding-dialog","wpcontent",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,n=e.touches[0].clientY,i=this.touchX-t,s=this.touchY-n;Math.abs(i)>Math.abs(s)&&(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";this.updateCheckboxStates();var n=WP_Smush.onboarding.template("smush-onboarding")(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(),this.toggleSkipButton(),this.maybeHandleProFeatureClick()},updateCheckboxStates:function(){var e=this.onboardingModal.querySelector('input[type="checkbox"]');e&&(this.selection[e.id]=e.checked)},toggleSkipButton:function(){this.skipButton&&(this.settings.last?this.skipButton.classList.add("sui-hidden"):this.skipButton.classList.remove("sui-hidden"))},bindSubmit:function(){var e=this.onboardingModal.querySelector('button[type="submit"]'),t=this;e&&e.addEventListener("click",function(){var n=c(a().m(function n(i){var s,r;return a().w(function(n){for(;;)switch(n.p=n.n){case 0:return i.preventDefault(),e.classList.add("sui-button-onload-text"),t.updateCheckboxStates(),n.p=1,n.n=2,t.trackFinishSetupWizard();case 2:n.n=4;break;case 3:n.p=3,n.v;case 4:s=document.getElementById("smush_quick_setup_nonce"),(r=new XMLHttpRequest).open("POST",ajaxurl+"?action=smush_setup",!0),r.setRequestHeader("Content-type","application/x-www-form-urlencoded"),r.onload=function(){200===r.status?t.onFinishingSetup():window.console.log("Request failed.  Returned status of "+r.status)},r.send("smush_settings="+JSON.stringify(t.selection)+"&_ajax_nonce="+s.value);case 5:return n.a(2)}},n,null,[[1,3]])}));return function(e){return n.apply(this,arguments)}}())},onFinishingSetup:function(){this.onFinish(),this.startRecheckImages()},onFinish:function(){window.SUI.closeModal()},startRecheckImages:function(){this.recheckImagesLink&&(window.location.href=this.recheckImagesLink)},next:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.onboardingSlides.indexOf(this.settings.slide),i=0;i=t?"next"===t?n+1:n-1:null!==e&&e.classList.contains("next")?n+1:n-1;var s=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(s)},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=this;return c(a().m(function t(){var n,i;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:return n=document.getElementById("smush_quick_setup_nonce"),e.updateCheckboxStates(),t.p=1,t.n=2,e.trackSkipSetupWizard();case 2:t.n=4;break;case 3:t.p=3,t.v;case 4:(i=new XMLHttpRequest).open("POST",ajaxurl+"?action=skip_smush_setup&_ajax_nonce="+n.value),i.onload=function(){200===i.status?e.onSkipSetup():window.console.log("Request failed.  Returned status of "+i.status)},i.send();case 5:return t.a(2)}},t,null,[[1,3]])}))()},onSkipSetup:function(){this.onFinish()},hideUpgradeModal:function(e,t){var n="_blank"!==(null==t?void 0:t.target);n&&e.preventDefault(),t.classList.add("wp-smush-link-in-progress");var s=null==t?void 0:t.href,r=new XMLHttpRequest;r.open("POST",ajaxurl+"?action=hide_new_features&_ajax_nonce="+window.wp_smush_msgs.nonce),r.onload=function(){window.SUI.closeModal(),t.classList.remove("wp-smush-link-in-progress");var e=s?"cta_clicked":"closed";i.A.track("update_modal_displayed",{Action:e}),200===r.status?s&&n&&(window.location.href=s):window.console.log("Request failed.  Returned status of "+r.status)},r.send()},maybeHandleProFeatureClick:function(){var e,t=this;if("pro_upsell"===(null===(e=this.settings)||void 0===e?void 0:e.slide)){this.upsellButton=this.onboardingModal.querySelector(".smush-btn-pro-upsell");var n=this.onboardingModal.querySelector(".sui-field-list");n&&n.addEventListener("click",function(e){if(e.target.matches("label")||e.target.closest(".sui-toggle")){var n,i=null===(n=e.target.closest(".sui-field-list-item").querySelector('input[type="checkbox"]'))||void 0===n?void 0:n.name;t.handleProFeatureClicked(i)}}),this.maybeTrackProUpsell()}},handleProFeatureClicked:function(e){this.cacheProFeatureClick(e),this.highlightUpsellButton()},highlightUpsellButton:function(){this.upsellButton&&(this.upsellButton.classList.remove("smush-btn-ripple"),this.upsellButton.offsetWidth,this.upsellButton.classList.add("smush-btn-ripple"))},cacheProFeatureClick:function(e){this.proFeaturesClicked.includes(e)||this.proFeaturesClicked.push(e)},trackFinishSetupWizard:function(){return this.trackSetupWizard("finish")},trackSkipSetupWizard:function(){return this.trackSetupWizard("quit")},trackSetupWizard:function(e){var t,n="quit"===e,s={Action:n?"quit":"finish","Quit Step":this.getQuitStep(n),"Settings Enabled":this.getEnabledSettings(n),"Pro Interests":this.getProInterests()},r=null===(t=this.selection)||void 0===t?void 0:t.usage;return i.A.setAllowToTrack(r).track("Setup Wizard",s)},getQuitStep:function(e){if(!e)return"na";var t=this.getFieldMapsForTracking(),n=this.settings.slide;return n in t?t[n]:"na"},getEnabledSettings:function(e){if(e)return"na";var t=this.getFieldMapsForTracking(),n=[];return Object.entries(this.selection).forEach(function(e){var i=r(e,2),s=i[0];if(i[1]){var o=s in t?t[s]:s;n.push(o)}}),n},getProInterests:function(){return"pro"!==this.membership&&this.proFeaturesClicked.length?this.proFeaturesClicked:"na"},getFieldMapsForTracking:function(){return{usage:"tracking",auto:"auto_smush",lossy:"free"===this.membership?"super_smush":"ultra_smush",strip_exif:"strip_exif",original:"full_size",lazy_load:"lazy_load",pro_upsell:"upgrade",preload_images:"preload_images"}},maybeTrackProUpsell:function(){var e=this;this.upsellButton&&this.upsellButton.addEventListener("click",function(t){var n,r,o=null===(n=e.selection)||void 0===n?void 0:n.usage;i.A.setAllowToTrack(o),(new s.A).trackSetupWizardProUpsell(null==t||null===(r=t.target)||void 0===r?void 0:r.href,e.getProInterests())})}},WP_Smush.onboarding.template=_.memoize(function(e){var t,n={evaluate:/<#([\s\S]+?)#>/g,interpolate:/{{{([\s\S]+?)}}}/g,escape:/{{([^}]+?)}}(?!})/g,variable:"data"};return function(i){return _.templateSettings=n,t=t||_.template(document.getElementById(e).innerHTML),i.first_slide=WP_Smush.onboarding.first_slide,t(i)}}),window.addEventListener("load",function(){return WP_Smush.onboarding.init()}))},8847:function(){!function(){"use strict";WP_Smush.Lazyload={lazyloadEnableButton:document.getElementById("smush-enable-lazyload"),lazyloadDisableButton:document.getElementById("smush-cancel-lazyload"),lazyloadIframeCheckbox:document.getElementById("format-iframe"),init:function(){var e=this,t=this;this.lazyloadEnableButton&&this.lazyloadEnableButton.addEventListener("click",function(t){t.preventDefault(),t.currentTarget.classList.add("sui-button-onload"),e.toggle_lazy_load(!0)}),this.lazyloadDisableButton&&this.lazyloadDisableButton.addEventListener("click",function(t){t.preventDefault(),t.currentTarget.classList.add("sui-button-onload"),e.toggle_lazy_load(!1)});var n=document.getElementById("smush-remove-spinner");n&&n.addEventListener("click",function(t){t.preventDefault(),e.removeLoaderIcon()});var i=document.getElementById("smush-remove-placeholder");i&&i.addEventListener("click",function(t){t.preventDefault(),e.removeLoaderIcon("placeholder")});var s=document.querySelectorAll(".smush-ll-remove");s&&0<s.length&&s.forEach(function(e){e.addEventListener("click",function(e){e.preventDefault(),e.target.closest("li").style.display="none",t.remove(e.target.dataset.id,e.target.dataset.type)})}),this.handlePredefinedPlaceholders(),this.handleEmbedVideosBoxVisibility()},handleEmbedVideosBoxVisibility:function(){if(this.lazyloadIframeCheckbox){var e=document.querySelector(".lazyload-embed-videos");e&&this.lazyloadIframeCheckbox.addEventListener("click",function(){!0===this.checked?e.classList.remove("sui-hidden"):e.classList.add("sui-hidden")})}},handlePredefinedPlaceholders:function(){var e=this,t=document.getElementById("placeholder-icon-1");t&&t.addEventListener("click",function(){return e.changeColor("#F3F3F3")});var n=document.getElementById("placeholder-icon-2");n&&n.addEventListener("click",function(){return e.changeColor("#333333")})},changeColor:function(e){document.getElementById("smush-color-picker").value=e,document.querySelector(".sui-colorpicker-hex .sui-colorpicker-value > span > span").style.backgroundColor=e,document.querySelector(".sui-colorpicker-hex .sui-colorpicker-value > input").value=e},toggle_lazy_load:function(e){var t=document.getElementsByName("wp_smush_options_nonce"),n=new XMLHttpRequest;n.open("POST",ajaxurl+"?action=smush_toggle_lazy_load",!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.onload=function(){if(200===n.status){var e=JSON.parse(n.response);void 0!==e.success&&e.success?WP_Smush.helpers.redirectToPage("lazy-preload"):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 "+n.status),document.querySelector(".sui-button-onload").classList.remove("sui-button-onload")},n.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 n=e.state().get("selection").first().toJSON(),i=document.getElementById("smush-"+t+"-icon-preview");i.style.backgroundImage='url("'+n.url+'")',i.style.display="block",document.getElementById("smush-"+t+"-icon-file").setAttribute("value",n.id),document.getElementById("smush-upload-"+t).style.display="none";var s=document.getElementById("smush-remove-"+t);s.querySelector("span").innerHTML=n.filename,s.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",n=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="+n[0].value)}},WP_Smush.Lazyload.init()}()},3368:function(e,t,n){"use strict";n.r(t);var i=n(7899);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function r(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function a(n,i,s,r){var a=i&&i.prototype instanceof l?i:l,c=Object.create(a.prototype);return o(c,"_invoke",function(n,i,s){var r,o,a,l=0,c=s||[],d=!1,h={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return r=t,o=0,a=e,h.n=n,u}};function p(n,i){for(o=n,a=i,t=0;!d&&l&&!s&&t<c.length;t++){var s,r=c[t],p=h.p,f=r[2];n>3?(s=f===i)&&(a=r[(o=r[4])?5:(o=3,3)],r[4]=r[5]=e):r[0]<=p&&((s=n<2&&p<r[1])?(o=0,h.v=i,h.n=r[1]):p<f&&(s=n<3||r[0]>i||i>f)&&(r[4]=n,r[5]=i,h.n=f,o=0))}if(s||n>1)return u;throw d=!0,i}return function(s,c,f){if(l>1)throw TypeError("Generator is already running");for(d&&1===c&&p(c,f),o=c,a=f;(t=o<2?e:a)||!d;){r||(o?o<3?(o>1&&(h.n=-1),p(o,a)):h.n=a:h.v=a);try{if(l=2,r){if(o||(s="next"),t=r[s]){if(!(t=t.call(r,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,o<2&&(o=0)}else 1===o&&(t=r.return)&&t.call(r),o<2&&(a=TypeError("The iterator does not provide a '"+s+"' method"),o=1);r=e}else if((t=(d=h.n<0)?a:n.call(i,h))!==u)break}catch(t){r=e,o=1,a=t}finally{l=1}}return{value:t,done:d}}}(n,s,r),!0),c}var u={};function l(){}function c(){}function d(){}t=Object.getPrototypeOf;var h=[][i]?t(t([][i]())):(o(t={},i,function(){return this}),t),p=d.prototype=l.prototype=Object.create(h);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,o(e,s,"GeneratorFunction")),e.prototype=Object.create(p),e}return c.prototype=d,o(p,"constructor",d),o(d,"constructor",c),c.displayName="GeneratorFunction",o(d,s,"GeneratorFunction"),o(p),o(p,s,"Generator"),o(p,i,function(){return this}),o(p,"toString",function(){return"[object Generator]"}),(r=function(){return{w:a,m:f}})()}function o(e,t,n,i){var s=Object.defineProperty;try{s({},"",{})}catch(e){s=0}o=function(e,t,n,i){function r(t,n){o(e,t,function(e){return this._invoke(t,n,e)})}t?s?s(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(r("next",0),r("throw",1),r("return",2))},o(e,t,n,i)}function a(e,t,n,i,s,r,o){try{var a=e[r](o),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,s)}function u(e){return function(){var t=this,n=arguments;return new Promise(function(i,s){var r=e.apply(t,n);function o(e){a(r,i,s,o,u,"next",e)}function u(e){a(r,i,s,o,u,"throw",e)}o(void 0)})}}function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,d(i.key),i)}}function c(e,t,n){return(t=d(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=s(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}(new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),c(this,"troubleshootClicked",!1),c(this,"resumeBulkSmushCount",0),c(this,"missedEventsKey","wp_smush_missed_events")},t=[{key:"init",value:function(){i.A.allowToTrack()&&(this.trackUltraLinks(),this.trackUpsellLinks(),this.registerTroubleshootClickEvent(),this.trackScanInterruptedEventOnStopScanningModal(),this.trackScanInterruptedEventOnRetryScanModal(),this.trackBulkSmushInterruptedEventOnStopBulkSmushModal(),this.trackBulkSmushInterruptedEventOnRetryBulkSmushModal(),this.registerBulkSmushResumeClickEvent(),this.trackBulkSmushInterruptedEventWhenExitingAjaxBulkSmush(),this.trackInterruptedEventFromInlineNotice(),this.trackInterruptedEventFromLoopbackErrorModal(),this.maybeTrackMissedEventsOnLoad())}},{key:"trackUltraLinks",value:function(){var e=this,t=document.querySelectorAll(".wp-smush-upsell-ultra-compression");if(t){var n=function(t){return{settings:"bulksmush_settings",dashboard:"dash_summary",bulk:"bulksmush_summary",directory:"directory_summary","lazy-preload":"lazy_summary",cdn:"cdn_summary","next-gen":"webp_summary"}[t.classList.contains("wp-smush-ultra-compression-link")?"settings":e.getCurrentPageSlug()]||"bulksmush_settings"};t.forEach(function(e){e.addEventListener("click",function(e){i.A.track("ultra_upsell_modal",{Location:n(e.target),"Modal Action":"direct_cta"})})})}}},{key:"trackUpsellLinks",value:function(){var e=document.querySelectorAll('[href*="utm_source=smush"]');e&&e.forEach(function(e){e.addEventListener("click",function(e){var t=new URL(e.target.href).searchParams;if(t){var n=t.get("utm_campaign"),s={summary_cdn:"dash_summary","smush-dashboard-cdn-upsell":"dash_widget",smush_bulksmush_cdn:"bulk_smush_progress",smush_cdn_upgrade_button:"cdn_page",smush_bulksmush_library_gif_cdn:"media_library",smush_bulk_smush_complete_global:"bulk_smush_complete","summary_next-gen":"dash_summary","smush-dashboard-next-gen-upsell":"dash_widget","smush_next-gen_upgrade_button":"Next-Gen Formats"};if(n in s){var r=s[n],o=n.match(/(cdn|next-gen)/i),a="next-gen"===(o&&o[0])?"local_webp_upsell":"cdn_upsell";i.A.track(a,{Location:r})}}})})}},{key:"trackScanInterruptedEventOnStopScanningModal",value:function(){var e=this,t=document.getElementById("smush-stop-scanning-dialog");t&&t.querySelectorAll("[data-modal-close]").forEach(function(t){t.addEventListener("click",function(t){var n,i=(null===(n=t.target.dataset)||void 0===n?void 0:n.action)||"Close";e.trackScanInterruptedEvent({Trigger:"cancel_in_progress","Modal Action":i})})})}},{key:"trackBulkSmushInterruptedEventOnStopBulkSmushModal",value:function(){var e=this,t=document.getElementById("smush-stop-bulk-smush-modal");t&&t.querySelectorAll("[data-modal-close]").forEach(function(t){t.addEventListener("click",function(t){var n,i=(null===(n=t.target.dataset)||void 0===n?void 0:n.action)||"Close";e.trackBulkSmushInterruptedEvent({Trigger:"cancel_in_progress","Modal Action":i})})})}},{key:"trackScanInterruptedEventOnRetryScanModal",value:function(){var e=this,t=document.getElementById("smush-retry-scan-notice");if(t){var n=t.querySelector(".smush-retry-scan-notice-button");n&&n.addEventListener("click",function(t){if(document.querySelector(".wp-smush-scan"))e.trackScanInterruptedEvent({Trigger:"failed_modal","Modal Action":"Retry"});else{t.preventDefault();var n="Scan Interrupted",s=e.getScanInterruptedEventProperties({Trigger:"failed_modal","Modal Action":"Retry"});i.A.track(n,s).catch(function(){e.cacheMissedEvent({event:n,properties:s})}).finally(function(){window.location.href=t.target.href})}}),t.querySelectorAll("[data-modal-close]").forEach(function(t){t.addEventListener("click",function(t){var n,i=(null===(n=t.target.dataset)||void 0===n?void 0:n.action)||"Close";e.trackScanInterruptedEvent({Trigger:"failed_modal","Modal Action":i})})})}}},{key:"trackBulkSmushInterruptedEventOnRetryBulkSmushModal",value:function(){var e=this,t=document.getElementById("smush-retry-bulk-smush-notice");if(t){var n=t.querySelector(".smush-retry-bulk-smush-notice-button");n&&n.addEventListener("click",function(){e.trackBulkSmushInterruptedEvent({Trigger:"failed_modal","Modal Action":"Retry"})}),t.querySelectorAll("[data-modal-close]").forEach(function(t){t.addEventListener("click",function(t){var n,i=(null===(n=t.target.dataset)||void 0===n?void 0:n.action)||"Close";e.trackBulkSmushInterruptedEvent({Trigger:"failed_modal","Modal Action":i})})})}}},{key:"trackScanInterruptedEvent",value:function(e){return i.A.track("Scan Interrupted",this.getScanInterruptedEventProperties(e))}},{key:"getScanInterruptedEventProperties",value:function(e){return Object.assign({Troubleshoot:this.troubleshootClicked?"Yes":"No"},e)}},{key:"trackBulkSmushInterruptedEventWhenExitingAjaxBulkSmush",value:function(){var e=this;if(!this.canUseBackgroundOptimization()){var t=document.querySelector(".wp-smush-bulk-progress-bar-wrapper");t&&window.addEventListener("beforeunload",u(r().m(function n(){var s,o,a,u;return r().w(function(n){for(;;)switch(n.n){case 0:if((null===(s=window.WP_Smush)||void 0===s?void 0:s.bulk.isBulkSmushInProgress())&&!t.classList.contains("sui-hidden")){n.n=1;break}return n.a(2);case 1:return o=t.classList.contains("wp-smush-exceed-limit"),a="Bulk Smush Interrupted",u=e.getBulkSmushInterruptedEventProperties({Trigger:o?"exit_50_limit":"exit_in_progress","Modal Action":"Exit","Retry Attempts":e.resumeBulkSmushCount}),n.n=2,i.A.track(a,u).catch(function(){e.cacheMissedEvent({event:a,properties:u})});case 2:return n.a(2)}},n)})))}}},{key:"cacheMissedEvent",value:function(e){window.localStorage&&window.localStorage.setItem(this.missedEventsKey,JSON.stringify([e]))}},{key:"getMissedEvents",value:function(){if(!window.localStorage)return[];var e=window.localStorage.getItem(this.missedEventsKey);return e?JSON.parse(e):[]}},{key:"clearMissedEvents",value:function(){window.localStorage&&window.localStorage.removeItem(this.missedEventsKey)}},{key:"canUseBackgroundOptimization",value:function(){var e;return void 0!==(null===(e=window.wp_smushit_data)||void 0===e?void 0:e.bo_stats)}},{key:"trackBulkSmushInterruptedEvent",value:function(e){return i.A.track("Bulk Smush Interrupted",this.getBulkSmushInterruptedEventProperties(e))}},{key:"getBulkSmushInterruptedEventProperties",value:function(e){return Object.assign({Troubleshoot:this.troubleshootClicked?"Yes":"No"},this.getBulkSmushProcessStats(),e)}},{key:"getBulkSmushProcessStats",value:function(){var e;if(this.canUseBackgroundOptimization())return{};var t=null===(e=window.WP_Smush)||void 0===e?void 0:e.bulk;return t?{"Retry Attempts":this.resumeBulkSmushCount,"Total Enqueued Images":t.getTotalEnqueuedImages(),"Completion Percentage":t.getCompletionPercentage()}:{}}},{key:"trackInterruptedEventFromInlineNotice",value:function(){this.trackInterruptedEventFromInlineNoticeOnDashboard(),this.trackBulkSmushInterruptedEventFromInlineNoticeOnBulkSmush(),this.trackScanInterruptedEventFromInlineNoticeOnBulkSmush()}},{key:"trackInterruptedEventFromInlineNoticeOnDashboard",value:function(){var e=document.getElementById("smush-box-dashboard-bulk");e&&(this.trackBulkSmushInterruptedEventFromInlineNoticeOnDashboard(e),this.trackScanInterruptedEventFromInlineNoticeOnDashboard(e))}},{key:"trackBulkSmushInterruptedEventFromInlineNoticeOnDashboard",value:function(e){var t=this,n=e.querySelector(".wp-smush-retry-bulk-smush-link");n&&n.addEventListener("click",function(e){e.preventDefault();var n="Bulk Smush Interrupted",s=t.getBulkSmushInterruptedEventProperties({Trigger:"failed_notice","Modal Action":"Retry"});i.A.track(n,s).catch(function(){t.cacheMissedEvent({event:n,properties:s})}).finally(function(){window.location.href=e.target.href})})}},{key:"trackBulkSmushInterruptedInlineNoticeEvent",value:function(){return this.trackBulkSmushInterruptedEvent({Trigger:"failed_notice","Modal Action":"Retry"})}},{key:"trackBulkSmushInterruptedEventFromInlineNoticeOnBulkSmush",value:function(){var e=this,t=document.querySelector(".wp-smush-inline-retry-bulk-smush-notice .wp-smush-trigger-bulk-smush");t&&t.addEventListener("click",function(){e.trackBulkSmushInterruptedInlineNoticeEvent()})}},{key:"trackScanInterruptedEventFromInlineNoticeOnDashboard",value:function(e){var t=this,n=e.querySelector(".wp-smush-retry-scan-link");n&&n.addEventListener("click",function(e){e.preventDefault();var n="Scan Interrupted",s=t.getScanInterruptedEventProperties({Trigger:"failed_notice","Modal Action":"Retry"});i.A.track(n,s).catch(function(){t.cacheMissedEvent({event:n,properties:s})}).finally(function(){window.location.href=e.target.href})})}},{key:"trackScanInterruptedEventFromInlineNoticeOnBulkSmush",value:function(){var e=this,t=document.querySelector(".wp-smush-recheck-images-notice-box");if(t){var n=t.querySelector(".wp-smush-trigger-background-scan");n&&n.addEventListener("click",function(){var t;(null==n||null===(t=n.previousElementSibling)||void 0===t?void 0:t.querySelector("a"))&&e.trackScanInterruptedEvent({Trigger:"failed_notice","Modal Action":"Retry"})})}}},{key:"trackInterruptedEventFromLoopbackErrorModal",value:function(){var e=this,t=document.getElementById("smush-loopback-error-dialog");if(t){var n=t.querySelector('a[href*="#loopback-request-issue"]'),i=!1;n&&n.addEventListener("click",function(){i=!0},{once:!0}),t.querySelectorAll("[data-modal-close]").forEach(function(n){n.addEventListener("click",function(n){var s,r;!function(t,n){var s={Trigger:"loopback_error","Modal Action":t,Troubleshoot:i?"Yes":"No"};"scan"===n?e.trackScanInterruptedEvent(s):e.trackBulkSmushInterruptedEvent(s)}((null===(s=n.target.dataset)||void 0===s?void 0:s.action)||"Close",(null===(r=t.dataset)||void 0===r?void 0:r.processType)||"scan")})})}}},{key:"registerTroubleshootClickEvent",value:function(){var e=this,t=document.querySelectorAll('a[href*="#troubleshooting-guide"]');t&&t.forEach(function(t){t.addEventListener("click",function(){e.troubleshootClicked=!0},{once:!0})})}},{key:"maybeTrackMissedEventsOnLoad",value:function(){var e=this;window.addEventListener("load",function(){var t=e.getMissedEvents();0!==t.length&&(e.clearMissedEvents(),t.forEach(function(e){i.A.track(e.event,e.properties)}))})}},{key:"registerBulkSmushResumeClickEvent",value:function(){var e=this,t=document.querySelector(".wp-smush-resume-bulk-smush");t&&t.addEventListener("click",function(){e.resumeBulkSmushCount+=1})}},{key:"getCurrentPageSlug",value:function(){var e=new URLSearchParams(document.location.search).get("page");return"smush"===e?"dashboard":e.replace("smush-","")}}],t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}())).init()},8945:function(){function e(t){return e="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(t)}!function(t){"use strict";t("form#smush-bulk-form").on("submit",function(e){e.preventDefault(),t("#save-settings-button").addClass("sui-button-onload"),i(t(this).serialize(),"bulk")});var n=t("form#smush-lazy-preload-form");function i(e,n){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(t("#save-settings-button").removeClass("sui-button-onload-text sui-button-onload"),200===i.status){var e=JSON.parse(i.response);void 0!==e.success&&e.success?(!function(e){var t="<p>".concat(e,"</p>"),n={type:"success",icon:"check"};SUI.openNotice("wp-smush-ajax-notice",t,n);var i=document.querySelector(".sui-button-onload");i&&i.classList.remove("sui-button-onload")}(wp_smush_msgs.settingsUpdated),n=e.data,document.dispatchEvent(new CustomEvent("onSavedSmushSettings",{detail:n}))):e.data&&e.data.message?WP_Smush.helpers.showErrorNotice(e.data.message):WP_Smush.helpers.showErrorNotice("Request failed.")}else WP_Smush.helpers.showErrorNotice("Request failed. Returned status of "+i.status);var n},i.send("page="+n+"&"+e+"&_ajax_nonce="+wp_smush_msgs.nonce)}function s(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=t("#detection").is(":checked"),i=t(".smush-highlighting-notice"),s=t(".smush-highlighting-warning");if(!n)return i.hide(),void s.hide();e?(i.show(),s.hide()):i.is(":visible")||"none"!==i.css("display")?(i.show(),s.hide()):(i.hide(),s.show())}n.on("submit",function(e){e.preventDefault();var n=t(this).find('[name="tab"]'),s=n.length&&"lazy_load"===n.val();t("#save-settings-button").addClass("sui-button-onload-text"),i(t(this).serialize(),s?"lazy-load":"preload")}),n.on("keydown",function(e){"Enter"===e.key&&n.trigger("submit")}),t("form#smush-cdn-form").on("submit",function(e){e.preventDefault(),t("#save-settings-button").addClass("sui-button-onload-text"),i(t(this).serialize(),"cdn")}),t("form#smush-next-gen-form").on("submit",function(e){e.preventDefault(),t("#save-settings-button").addClass("sui-button-onload-text"),i(t(this).serialize(),"next-gen")}),t("form#smush-integrations-form").on("submit",function(e){e.preventDefault(),t("#save-settings-button").addClass("sui-button-onload-text"),i(t(this).serialize(),"integrations")}),t("form#smush-settings-form").on("submit",function(e){e.preventDefault(),t("#save-settings-button").addClass("sui-button-onload-text"),i(t(this).serialize(),"settings")}),t("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")}),t("input#detection").on("click",function(){s(!1)}),t(document).on("onSavedSmushSettings",function(){s(!0)});!function(){if(window.URL&&window.URLSearchParams){var e=new URL(window.location),t=e.searchParams.get("smush-notice");t&&(document.dispatchEvent(new CustomEvent("on-smush-".concat(t,"-notice"))),e.searchParams.delete("smush-notice"),window.history.replaceState({},document.title,e.toString()))}}();var r=function(e,t){for(var n in e){var i=document.querySelector('[name="'.concat(n,'"]'));if(i){var s=i.closest(".".concat(t));s&&("show"===e[n]?s.classList.remove("sui-hidden"):s.classList.add("sui-hidden"))}}};!function(){var n,i=document.querySelector(".wp-smush-settings-form");if(i){var s="sui-box-settings-row",o=i.querySelectorAll("[data-toggle-fields]");o&&o.forEach(function(t){var n=JSON.parse(t.dataset.toggleFields);(n||"object"===e(n))&&t.addEventListener("change",function(){this.checked&&r(n,s)})}),null!==(n=window.SUI)&&void 0!==n&&n.tabs&&window.SUI.tabs({callback:function(n,i){var o=n.next("[data-toggle-fields]");if(o.length){var a=o.data("toggle-fields");a&&"object"===e(a)&&r(a,s)}var u=i.find("[data-toggle-fields]");u.length&&u.each(function(){if(t(this).is(":checked")){var n=t(this).data("toggle-fields");n&&"object"===e(n)&&r(n,s)}})}})}}()}(jQuery)},9982:function(e,t,n){"use strict";var i=n(5417),s=n(7119),r=n(7899);function o(e){return o="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},o(e)}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var l=0,c=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"media";return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.onStart(),this.skip_resmush=!(void 0===t.data("smush")||!t.data("smush")),this.button=jQuery(t[0]),this.is_bulk=!!o(n)&&n,this.url=ajaxurl,this.log=jQuery(".smush-final-log"),this.setIds(),this.is_bulk_resmush=0<wp_smushit_data.resmush.length&&!this.skip_resmush,this.status=this.button.parent().prev(".smush-status"),this.smush_type=i,this.single_ajax_suffix="nextgen"===this.smush_type?"smush_manual_nextgen":"wp_smushit_manual",this.bulk_ajax_suffix="nextgen"===this.smush_type?"wp_smushit_nextgen_bulk":"wp_smushit_bulk",this.get_stats_action="nextgen"===this.smush_type?"nextgen_get_stats":"get_stats",this.url=this.is_bulk?e.smushAddParams(this.url,{action:this.bulk_ajax_suffix}):e.smushAddParams(this.url,{action:this.single_ajax_suffix}),this.start(),!this.is_bulk&&this.run(),this}return t=e,n=[{key:"setIds",value:function(){var e=[];"object"===o(e=0<wp_smushit_data.resmush.length&&!this.skip_resmush?0<wp_smushit_data.unsmushed.length?wp_smushit_data.resmush.concat(wp_smushit_data.unsmushed):wp_smushit_data.resmush:wp_smushit_data.unsmushed)?this.ids=e.filter(function(e,t,n){return t===n.indexOf(e)}):this.ids=e}},{key:"start",value:function(){this.button.prop("disabled",!0),this.button.addClass("wp-smush-started"),this.bulkStart(),this.singleStart()}},{key:"bulkStart",value:function(){this.is_bulk&&(jQuery(".wp-smush-bulk-wrapper").addClass("sui-hidden"),jQuery(".wp-smush-bulk-progress-bar-wrapper .sui-notice-warning:first-of-type").hide(),0>=jQuery("div.smush-final-log .smush-bulk-error-row").length&&jQuery("div.smush-final-log").addClass("sui-hidden"),jQuery(".bulk-smush-wrapper .wp-smush-bulk-progress-bar-wrapper, #wp-smush-running-notice").removeClass("sui-hidden"))}},{key:"singleStart",value:function(){this.is_bulk||(this.button.html('<span class="spinner wp-smush-progress">'+window.wp_smush_msgs.smushing+"</span>"),this.status.removeClass("error"))}},{key:"enableButton",value:function(){this.button.prop("disabled",!1),jQuery(".wp-smush-all").prop("disabled",!1),jQuery(".wp-smush-restore").prop("disabled",!1),jQuery("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.request.done(function(n){if(void 0!==n.data){var i=t.status.parent();e.membershipValidity(n.data),n.success?(i.html(n.data),t.button.html(window.wp_smush_msgs.all_done)):n.data.html_stats?i.html(n.data.html_stats):(t.status.addClass("smush-warning"),t.status.html(n.data.error_msg),t.button.html(window.smush_vars.strings.stats_label)),e.updateImageStats(n.data.new_size)}}).fail(function(e){t.status.html(e.data),t.status.addClass("smush-warning"),t.enableButton()})}}},{key:"syncStats",value:function(){var e=jQuery("div.wp-smush-bulk-progress-bar-wrapper div.wp-smush-count.tc"),t=e.html();e.html(window.wp_smush_msgs.sync_stats);var n=this;return jQuery.ajax({type:"GET",url:ajaxurl,data:{action:this.get_stats_action,_ajax_nonce:window.wp_smush_msgs.nonce},success:function(e){null!=e&&e.success?(i.R.updateGlobalStatsFromSmushScriptData(e.data),i.R.renderStats(),s.A.update(0,e.data.remaining_count),jQuery(".wp-smush-scan").prop("disabled",!1),n.hideBulkFreeLimitReachedNotice()):WP_Smush.helpers.showNotice(e,{showdismiss:!0,autoclose:!1})}}).always(function(){return e.html(t)})}},{key:"bulkDone",value:function(){this.is_bulk&&(this.enableButton(),0===this.ids.length&&(jQuery(".bulk-smush-wrapper .wp-smush-all-done").removeClass("sui-hidden"),jQuery(".wp-smush-bulk-wrapper").addClass("sui-hidden"),s.A.close(),this.onBulkSmushCompleted()),jQuery(".wp-resmush.wp-smush-action").removeProp("disabled"))}},{key:"showAnimatedUpsellNotice",value:function(){if(this.errors.length){var e=document.querySelector(".smush-bulk-errors");if(e){var t=e.querySelector('[data-error-code="animated"]');if(t)return Array.prototype.slice.call(e.childNodes,0,5).includes(t)}}}},{key:"maybeShowCDNActivationNotice",value:function(){wp_smush_msgs.smush_cdn_activation_notice&&this.showAnimatedUpsellNotice()&&WP_Smush.helpers.renderActivationCDNNotice(wp_smush_msgs.smush_cdn_activation_notice)}},{key:"maybeShowUnlimitedUpsellNotice",value:function(){var e=document.querySelector(".wp-smush-global-upsell");e&&e.classList.remove("sui-hidden")}},{key:"maybeShowBulkErrorActions",value:function(){if(this.errors.length){var e=document.querySelector(".smush-bulk-errors-actions");e&&e.classList.remove("sui-hidden")}}},{key:"freeExceeded",value:function(){var e=jQuery(".wp-smush-bulk-progress-bar-wrapper");e.addClass("wp-smush-exceed-limit").removeClass("sui-hidden"),e.find(".sui-progress-block .wp-smush-cancel-bulk").removeClass("sui-hidden"),e.find(".sui-progress-block .wp-smush-all").addClass("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"),this.showBulkFreeLimitReachedNotice()}},{key:"showBulkFreeLimitReachedNotice",value:function(){var e=document.getElementById("bulk-smush-limit-reached-notice");e&&e.classList.remove("sui-hidden")}},{key:"hideBulkFreeLimitReachedNotice",value:function(){var e=document.getElementById("bulk-smush-limit-reached-notice");e&&e.classList.add("sui-hidden")}},{key:"updateProgress",value:function(t){if(this.is_bulk_resmush||this.is_bulk){var n=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").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&&(n=(this.smushed+this.errors.length)/this.total*100)):n=(this.smushed+this.errors.length)/this.total*100,"nextgen"===this.smush_type&&wp_smushit_data.resmush.length>0&&this.smushed+this.errors.length<=1&&(wp_smushit_data.count_images-=wp_smushit_data.resmush.length+1),0===this.ids.length&&(jQuery(".bulk-smush-wrapper .wp-smush-all-done").removeClass("sui-hidden"),jQuery(".wp-smush-bulk-wrapper").addClass("sui-hidden")),this._updateProgress(this.smushed+this.errors.length,WP_Smush.helpers.precise_round(n,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(){return this.continueSmush&&this.ids.length>0&&this.is_bulk}},{key:"onStart",value:function(){this.deferred=jQuery.Deferred(),this.deferred.errors=[],this.continueSmush=!0,this.errors=[];var e=jQuery(".bulk-smush-wrapper .sui-progress-state-text");this.smushed=parseInt(e.find("span:first-child").html()),this.total=parseInt(e.find("span:last-child").html()),jQuery(".wp-smush-restore").prop("disabled",!0),this.bindDeferredEvents()}},{key:"callAjax",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(0!==l&&void 0!==l&&10>performance.now()-l)return this.freeExceeded(),this.deferred;var n=window.wp_smush_msgs.nonce;if(this.current_id=this.is_bulk?this.ids.shift():this.button.data("id"),this.current_id){e.updateSmushIds(this.current_id);var i=this.button.parent().find("#_wp_smush_nonce");i.length>0&&(n=i.val());var s=this;return this.request=e.ajax(this.is_bulk_resmush,this.current_id,this.url,n,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){s.errors.push(s.current_id);var n=t.data.error,i=WP_Smush.helpers.prepareBulkSmushErrorRow(n.error_message,n.file_name,n.thumbnail,s.current_id,s.smush_type,n.error_code);s.log.removeClass("sui-hidden"),s.log.find(".smush-bulk-errors").append(i),s.errors.length>4&&(s.log.find(".smush-bulk-errors").addClass("overflow-box"),jQuery(".smush-bulk-errors-actions").removeClass("sui-hidden"))}else void 0!==t.success&&t.success&&s.smushed++;e.membershipValidity(t.data),void 0!==t.data&&"limit_exceeded"===t.data.error&&"resolved"!==s.deferred.state()?(document.getElementById("wp-smush-running-notice").classList.add("sui-hidden"),s.continueSmush=!1,wp_smushit_data.unsmushed.unshift(s.current_id),s.ids.unshift(s.current_id),l=performance.now(),s.freeExceeded()):s.is_bulk&&(s.updateProgress(t),e.updateScoreProgress()),s.singleDone()}).always(function(){s.continue()&&s.is_bulk?s.callAjax(!1):s.deferred.resolve()}),this.deferred.errors=this.errors,this.deferred}}},{key:"maybeShowCDNUpsellForPreSiteOnCompleted",value:function(){var e=document.querySelector(".wp-smush-upsell-cdn");e&&e.classList.remove("sui-hidden")}},{key:"onBulkSmushCompleted",value:function(){var e=this;this.maybeShowUnlimitedUpsellNotice(),this.maybeShowCDNActivationNotice(),this.maybeShowCDNUpsellForPreSiteOnCompleted(),this.maybeShowBulkErrorActions();var t=this.is_bulk?function(){return e.trackBulkSmushCompleted()}:function(){return!1};this.syncStats().done(t),this.onFinishBulkSmush()}},{key:"getPercentOptimized",value:function(e,t){return e===t||e<=0?100:Math.floor(100*(e-t)/e)}},{key:"trackBulkSmushCompleted",value:function(){var e=i.R.getGlobalStats(),t=e.savings_bytes,n=e.count_images,s=e.percent_optimized,o=e.savings_percent,a=e.count_resize,u=e.savings_resize,l=this.total>0?Math.round(100*this.errors.length/this.total):0;r.A.track("Bulk Smush Completed",{"Total Savings":this.convertToMegabytes(t),"Total Images":n,"Media Optimization Percentage":parseFloat(s),"Percentage of Savings":parseFloat(o),"Images Resized":a,"Resize Savings":this.convertToMegabytes(u),"Total Enqueued Images":this.total,"Failure Percentage":l})}},{key:"convertToMegabytes",value:function(e){var t=e/Math.pow(1024,2);return t&&parseFloat(t.toFixed(2))||0}},{key:"run",value:function(){this.is_bulk&&this.ids.length>0&&(this.onStartBulkSmush(),this.callAjax(!0)),this.is_bulk||this.callAjax()}},{key:"onStartBulkSmush",value:function(){this.showInProcessingNotice()}},{key:"showInProcessingNotice",value:function(){var e=document.querySelector(".ajax-bulk-smush-in-progressing-notice");e&&e.classList.remove("sui-hidden")}},{key:"hideInProcessingNotice",value:function(){var e=document.querySelector(".ajax-bulk-smush-in-progressing-notice");e&&e.classList.add("sui-hidden")}},{key:"bindDeferredEvents",value:function(){var e=this;this.deferred.done(function(){if(e.continueSmush=!0,e.errors.length){var t=e.errors.length===e.total?window.wp_smush_msgs.all_failed: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)").prop("disabled",!1)})}},{key:"cancelAjax",value:function(){this.continueSmush=!1,this.syncStats(),this.request.abort(),this.enableButton(),this.button.removeClass("wp-smush-started"),wp_smushit_data.unsmushed.unshift(this.current_id),jQuery(".wp-smush-bulk-wrapper").removeClass("sui-hidden"),jQuery(".wp-smush-bulk-progress-bar-wrapper").addClass("sui-hidden"),this.hideBulkFreeLimitReachedNotice(),this.onFinishBulkSmush()}},{key:"onFinishBulkSmush",value:function(){this.hideInProcessingNotice()}}],u=[{key:"smushAddParams",value:function(e,t){return jQuery.isEmptyObject(t)||(e+=(e.indexOf("?")>=0?"&":"?")+jQuery.param(t)),e}},{key:"membershipValidity",value:function(e){var t=jQuery("#wp-smush-invalid-member");void 0!==e&&void 0!==e.show_warning&&t.length>0&&(e.show_warning?t.show():t.hide())}},{key:"ajax",value:function(e,t,n,i){var s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=jQuery.param({is_bulk_resmush:e,attachment_id:t,_nonce:i,new_bulk_smush_started:s});return jQuery.ajax({type:"GET",data:r,url:n,timeout:wp_smushit_data.timeout,dataType:"json"})}},{key:"getTotalImagesToSmush",value:function(){var e=wp_smushit_data.resmush.length,t=wp_smushit_data.count_total-wp_smushit_data.count_smushed;return t>0?e+t:e}},{key:"updateScoreProgress",value:function(){var t="sui-grade-dismissed",n=0,i=0,s=e.getTotalImagesToSmush(),r=parseInt(wp_smushit_data.count_total);r===s?(r>0&&(t="sui-grade-f"),i=100):0<r&&(i=n=Math.floor(100*(r-s)/r),t="sui-grade-f",n>=60&&n<90?t="sui-grade-c":n>=90&&(t="sui-grade-a"));var o=jQuery("#smush-image-score");o.removeClass(function(e,t){return(t.match(/(^|\s)sui-grade-\S+/g)||[]).join(" ")}).addClass(t).attr("data-score",n).find(".sui-circle-score-label").html(n),o.find("circle:last-child").attr("style","--metric-array:"+2.63893782902*i+" "+(263.893782902-i))}},{key:"updateStats",value:function(e){var t=void 0!==e&&"nextgen"===e;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,0),i=jQuery(".wp-smush-savings .wp-smush-stats-human");t?i.html(n):(i.html(n),jQuery(".sui-summary-large.wp-smush-stats-human").html(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),t?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),wp_smushit_data.count_resize>0&&(jQuery("span.smushed-items-count span.wp-smush-count-resize-total").removeClass("sui-hidden"),jQuery("span.smushed-items-count span.wp-smush-count-resize-total span.wp-smush-total-optimised").html(wp_smushit_data.count_resize));var s=jQuery("li.super-smush-attachments .smushed-count");s.length&&void 0!==wp_smushit_data.count_supersmushed&&s.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 o=r.find(".wp-smush-stats");o.length>0&&o.html(WP_Smush.helpers.formatBytes(wp_smushit_data.savings_conversion,1))}}},{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 n=t.contents().filter(function(){return 1===this.nodeType}).text();t.html("<strong>"+n+"</strong> "+e)}}}},{key:"updateLocalizedStats",value:function(e,t){void 0!==window.wp_smushit_data&&("media"===t?(wp_smushit_data.count_smushed=parseInt(wp_smushit_data.count_smushed)+1,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_smushed=parseInt(wp_smushit_data.count_smushed)+1,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,n,i,s){var r='<div class="smush-bulk-error-row"><div class="smush-bulk-image-data">'+(void 0===n?'<i class="sui-icon-photo-picture" aria-hidden="true"></i>':n)+'<span class="smush-image-name">'+("undefined"===t||void 0===t?"undefined":t)+'</span><span class="smush-image-error">'+e+"</span></div>";return"media"===s&&(r=r+'<div class="smush-bulk-image-actions"><button type="button" class="sui-button-icon sui-tooltip sui-tooltip-constrained sui-tooltip-left smush-ignore-image" data-tooltip="'+window.wp_smush_msgs.error_ignore+'" data-id="'+i+'"><i class="sui-icon-eye-hide" aria-hidden="true"></i></button></div>'),r+="</div>"}},{key:"updateSmushIds",value:function(e){if(void 0!==wp_smushit_data.unsmushed&&wp_smushit_data.unsmushed.length>0){var t=wp_smushit_data.unsmushed.indexOf(e);t>-1&&wp_smushit_data.unsmushed.splice(t,1)}if(void 0!==wp_smushit_data.resmush&&wp_smushit_data.resmush.length>0){var n=wp_smushit_data.resmush.indexOf(e);n>-1&&wp_smushit_data.resmush.splice(n,1)}}}],n&&a(t.prototype,n),u&&a(t,u),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,u}();t.A=c},9620:function(e,t,n){"use strict";var i=n(6139),s=n.n(i);function r(e){return r="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},r(e)}var o=new function(){function e(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={url:ajaxurl,method:arguments.length>2&&void 0!==arguments[2]?arguments[2]:"POST",cache:!1};return t instanceof FormData?(t.append("action",e),t.append("_ajax_nonce",window.wp_smush_msgs.nonce),n.contentType=!1,n.processData=!1):(t._ajax_nonce=t._ajax_nonce||window.smush_global.nonce||window.wp_smush_msgs.nonce,t.action=e),n.data=t,new Promise(function(e,t){jQuery.ajax(n).done(e).fail(t)}).then(function(e){return"object"!==r(e)&&(e=JSON.parse(e)),e}).catch(function(e){return console.error("Error:",e),e})}var t={background:{start:function(){return e("bulk_smush_start")},cancel:function(){return e("bulk_smush_cancel")},initState:function(){return e("bulk_smush_get_status")},getStatus:function(){return e("bulk_smush_get_status")},getStats:function(){return e("bulk_smush_get_global_stats")},backgroundHealthyCheck:function(){return e("smush_start_background_pre_flight_check")},backgroundHealthyStatus:function(){return e("smush_get_background_pre_flight_status")}},smush:{syncStats:function(t){return e("get_stats",t=t||{})},ignoreAll:function(t){return e("wp_smush_ignore_all_failed_items",{type:t})}},common:{dismissNotice:function(t){return e("smush_dismiss_notice",{key:t})},remindReviewPrompt:function(){return e("wp_smush_review_prompts_remind_later")},hideModal:function(t){return e("hide_modal",{modal_id:t})},track:function(t,n){return e("smush_analytics_track_event",{event:t,properties:n})},request:function(t){return t.action&&e(t.action,t)}},scanMediaLibrary:{start:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e("wp_smush_start_background_scan",{optimize_on_scan_completed:t=t?1:0,_ajax_nonce:window.wp_smushit_data.media_library_scan.nonce})},cancel:function(){return e("wp_smush_cancel_background_scan",{_ajax_nonce:window.wp_smushit_data.media_library_scan.nonce})},getScanStatus:function(){return e("wp_smush_get_background_scan_status",{_ajax_nonce:window.wp_smushit_data.media_library_scan.nonce})}},webp:{switchMethod:function(t){return e("webp_switch_method",{method:t})}},settings:{disconnectSite:function(){return e("wp_smush_disconnect_site")}}};s()(this,t)};t.A=o},7899:function(e,t,n){"use strict";var i=n(9620);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,o(i.key),i)}}function o(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=s(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}function a(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}function u(e,t){return e.get(l(e,t))}function l(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var c=new WeakMap,d=new WeakMap,h=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),a(this,c,new Set),a(this,d,void 0)},t=[{key:"track",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.allowToTrack()&&!this.inProgressEvent(e))return this.setInProgressEvent(e),i.A.common.track(e,n).then(function(n){return setTimeout(function(){t.restoreInProgressEvent(e)},1e3),n})}},{key:"inProgressEvent",value:function(e){return u(c,this).has(e)}},{key:"setInProgressEvent",value:function(e){u(c,this).add(e)}},{key:"restoreInProgressEvent",value:function(e){u(c,this).delete(e)}},{key:"allowToTrack",value:function(){var e;return u(d,this)||!(null===(e=window.wp_smush_mixpanel)||void 0===e||!e.opt_in)}},{key:"setAllowToTrack",value:function(e){var t,n,i;return n=this,i=e,(t=d).set(l(t,n),i),this}}],t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}(),p=new h;t.A=p},6006:function(e,t,n){var i,s,r;s=[n(1669),n(1503)],i=function(e){"use strict";if(!e.ui||!e.ui.fancytree){var t,n,i=null,s=new RegExp(/\.|\//),r=/[&<>"'/]/g,o=/[<>"'/]/g,a="$recursive_request",u="$request_target_invalid",l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},c={16:!0,17:!0,18:!0},d={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"},f="active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore".split(" "),m={},v="columns types".split(" "),g="checkbox expanded extraClasses folder icon iconTooltip key lazy partsel radiogroup refKey selected statusNodeType title tooltip type unselectable unselectableIgnore unselectableStatus".split(" "),y={},b={},w={active:!0,children:!0,data:!0,focus:!0};for(t=0;t<f.length;t++)m[f[t]]=!0;for(t=0;t<g.length;t++)n=g[t],y[n]=!0,n!==n.toLowerCase()&&(b[n.toLowerCase()]=n);var _=Array.isArray;return k(e.ui,"Fancytree requires jQuery UI (http://jqueryui.com)"),Date.now||(Date.now=function(){return(new Date).getTime()}),q.prototype={_findDirectChild:function(e){var t,n,i=this.children;if(i)if("string"==typeof e){for(t=0,n=i.length;t<n;t++)if(i[t].key===e)return i[t]}else{if("number"==typeof e)return this.children[e];if(e.parent===this)return e}return null},_setChildren:function(e){k(e&&(!this.children||0===this.children.length),"only init supported"),this.children=[];for(var t=0,n=e.length;t<n;t++)this.children.push(new q(this,e[t]));this.tree._callHook("treeStructureChanged",this.tree,"setChildren")},addChildren:function(t,n){var i,s,r,o=this.getFirstChild(),a=this.getLastChild(),u=null,l=[];for(e.isPlainObject(t)&&(t=[t]),this.children||(this.children=[]),i=0,s=t.length;i<s;i++)l.push(new q(this,t[i]));if(u=l[0],null==n?this.children=this.children.concat(l):(n=this._findDirectChild(n),k((r=e.inArray(n,this.children))>=0,"insertBefore must be an existing child"),this.children.splice.apply(this.children,[r,0].concat(l))),o&&!n){for(i=0,s=l.length;i<s;i++)l[i].render();o!==this.getFirstChild()&&o.renderStatus(),a!==this.getLastChild()&&a.renderStatus()}else(!this.parent||this.parent.ul||this.tr)&&this.render();return 3===this.tree.options.selectMode&&this.fixSelection3FromEndNodes(),this.triggerModifyChild("add",1===l.length?l[0]:null),u},addClass:function(e){return this.toggleClass(e,!0)},addNode:function(e,t){switch(void 0!==t&&"over"!==t||(t="child"),t){case"after":return this.getParent().addChildren(e,this.getNextSibling());case"before":return this.getParent().addChildren(e,this);case"firstChild":var n=this.children?this.children[0]:null;return this.addChildren(e,n);case"child":case"over":return this.addChildren(e)}k(!1,"Invalid mode: "+t)},addPagingNode:function(t,n){var i,s;if(n=n||"child",!1!==t)return t=e.extend({title:this.tree.options.strings.moreData,statusNodeType:"paging",icon:!1},t),this.partload=!0,this.addNode(t,n);for(i=this.children.length-1;i>=0;i--)"paging"===(s=this.children[i]).statusNodeType&&this.removeChild(s);this.partload=!1},appendSibling:function(e){return this.addNode(e,"after")},applyCommand:function(e,t){return this.tree.applyCommand(e,this,t)},applyPatch:function(e){if(null===e)return this.remove(),I(this);var t,n,i={children:!0,expanded:!0,parent:!0};for(t in e)S(e,t)&&(n=e[t],i[t]||x(n)||(y[t]?this[t]=n:this.data[t]=n));return S(e,"children")&&(this.removeChildren(),e.children&&this._setChildren(e.children)),this.isVisible()&&(this.renderTitle(),this.renderStatus()),S(e,"expanded")?this.setExpanded(e.expanded):I(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<n;t++)i+=s[t].countChildren();return i},debug:function(e){this.tree.options.debugLevel>=4&&(Array.prototype.unshift.call(arguments,this.toString()),E("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()),E("error",arguments))},findAll:function(e){e=x(e)?e:R(e);var t=[];return this.visit(function(n){e(n)&&t.push(n)}),t},findFirst:function(e){e=x(e)?e:R(e);var t=null;return this.visit(function(n){if(e(n))return t=n,!1}),t},findRelatedNode:function(e,t){return this.tree.findRelatedNode(this,e,t)},_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:k(!1,"invalid state: "+e)}return t&&this.renderStatus(),t},fixSelection3AfterClick:function(e){var t=this.isSelected();this.visit(function(e){if(e._changeSelectStatusAttrs(t),e.radiogroup)return"skip"}),this.fixSelection3FromEndNodes(e)},fixSelection3FromEndNodes:function(e){var t=this.tree.options;function n(e){var s,r,o,a,u,l,c,d,h=e.children;if(h&&h.length){for(l=!0,c=!1,s=0,r=h.length;s<r;s++)a=n(o=h[s]),i.evalOption("unselectableIgnore",o,o,t,!1)||(!1!==a&&(c=!0),!0!==a&&(l=!1));u=!!l||!!c&&void 0}else u=null==(d=i.evalOption("unselectableStatus",e,e,t,void 0))?!!e.selected:!!d;return e.partsel&&!e.selected&&e.lazy&&null==e.children&&(u=void 0),e._changeSelectStatusAttrs(u),u}k(3===t.selectMode,"expected selectMode 3"),n(this),this.visitParents(function(e){var n,s,r,o,a,u=e.children,l=!0,c=!1;for(n=0,s=u.length;n<s;n++)r=u[n],i.evalOption("unselectableIgnore",r,r,t,!1)||(((o=null==(a=i.evalOption("unselectableStatus",r,r,t,void 0))?!!r.selected:!!a)||r.partsel)&&(c=!0),o||(l=!1));o=!!l||!!c&&void 0,e._changeSelectStatusAttrs(o)})},fromDict:function(t){for(var n in t)y[n]?this[n]=t[n]:"data"===n?e.extend(this.data,t.data):x(t[n])||w[n]||(this.data[n]=t[n]);t.children&&(this.removeChildren(),this.addChildren(t.children)),this.renderTitle()},getChildren:function(){if(void 0!==this.hasChildren())return this.children},getFirstChild:function(){return this.children?this.children[0]:null},getIndex:function(){return e.inArray(this,this.parent.children)},getIndexHier:function(t,n){t=t||".";var i,s=[];return e.each(this.getParentList(!1,!0),function(e,t){i=""+(t.getIndex()+1),n&&(i=("0000000"+i).substr(-n)),s.push(i)}),s.join(t)},getKeyPath:function(e){var t=this.tree.options.keyPathSeparator;return t+this.getPath(!e,"key",t)},getLastChild:function(){return this.children?this.children[this.children.length-1]:null},getLevel:function(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e},getNextSibling:function(){if(this.parent){var e,t,n=this.parent.children;for(e=0,t=n.length-1;e<t;e++)if(n[e]===this)return n[e+1]}return null},getParent:function(){return this.parent},getParentList:function(e,t){for(var n=[],i=t?this:this.parent;i;)(e||i.parent)&&n.unshift(i),i=i.parent;return n},getPath:function(e,t,n){e=!1!==e,n=n||"/";var i,s=[],r=x(t=t||"title");return this.visitParents(function(e){e.parent&&(i=r?t(e):e[t],s.unshift(i))},e),s.join(n)},getPrevSibling:function(){if(this.parent){var e,t,n=this.parent.children;for(e=1,t=n.length;e<t;e++)if(n[e]===this)return n[e-1]}return null},getSelectedNodes:function(e){var t=[];return this.visit(function(n){if(n.selected&&(t.push(n),!0===e))return"skip"}),t},hasChildren:function(){if(this.lazy){if(null==this.children)return;if(0===this.children.length)return!1;if(1===this.children.length&&this.children[0].isStatusNode())return;return!0}return!(!this.children||!this.children.length)},hasClass:function(e){return(" "+(this.extraClasses||"")+" ").indexOf(" "+e+" ")>=0},hasFocus:function(){return this.tree.hasFocus()&&this.tree.focusNode===this},info:function(e){this.tree.options.debugLevel>=3&&(Array.prototype.unshift.call(arguments,this.toString()),E("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.tree.enableFilter,i=this.getParentList(!1,!1);if(n&&!this.match&&!this.subMatchCount)return!1;for(e=0,t=i.length;e<t;e++)if(!i[e].expanded)return!1;return!0},lazyLoad:function(t){e.error("FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead.")},load:function(e){var t,n,i=this,s=this.isExpanded();return k(this.isLazy(),"load() requires a lazy node"),e||this.isUndefined()?(this.isLoaded()&&this.resetLazy(),!1===(n=this.tree._triggerNodeEvent("lazyLoad",this))?I(this):(k("boolean"!=typeof n,"lazyLoad event must return source in data.result"),t=this.tree._callHook("nodeLoadChildren",this,n),s?(this.expanded=!0,t.always(function(){i.render()})):t.always(function(){i.renderStatus()}),t)):I(this)},makeVisible:function(t){var n,i=this,s=[],r=new e.Deferred,o=this.getParentList(!1,!1),a=o.length,u=!(t&&!0===t.noAnimation),l=!(t&&!1===t.scrollIntoView);for(n=a-1;n>=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.tree,o=this.parent,a="child"===n?t:t.parent;if(this!==t){if(this.parent?a.isDescendantOf(this)&&e.error("Cannot move a node to its own descendant"):e.error("Cannot move system root"),a!==o&&o.triggerModifyChild("remove",this),1===this.parent.children.length){if(this.parent===a)return;this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1}else k((s=e.inArray(this,this.parent.children))>=0,"invalid source parent"),this.parent.children.splice(s,1);if(this.parent=a,a.hasChildren())switch(n){case"child":a.children.push(this);break;case"before":k((s=e.inArray(t,a.children))>=0,"invalid target parent"),a.children.splice(s,0,this);break;case"after":k((s=e.inArray(t,a.children))>=0,"invalid target parent"),a.children.splice(s+1,0,this);break;default:e.error("Invalid mode "+n)}else a.children=[this];i&&t.visit(i,!0),a===o?a.triggerModifyChild("move",this):a.triggerModifyChild("add",this),r!==t.tree&&(this.warn("Cross-tree moveTo is experimental!"),this.visit(function(e){e.tree=t.tree},!0)),r._callHook("treeStructureChanged",r,"moveTo"),o.isDescendantOf(a)||o.render(),a.isDescendantOf(o)||a===o||a.render()}},navigate:function(t,n){var i,s=e.ui.keyCode;switch(t){case"left":case s.LEFT:if(this.expanded)return this.setExpanded(!1);break;case"right":case s.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===n?(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(n){var i,s=this.parent,r=e.inArray(this,s.children),o=this;return k(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;t<n.length;t++)n[t].parent=s;s.children.splice.apply(s.children,[r+1,0].concat(n)),o.children=null,o.remove(),s.render()}).fail(function(){o.setExpanded()}),i},resetLazy:function(){this.removeChildren(),this.expanded=!1,this.lazy=!0,this.children=void 0,this.renderStatus()},scheduleAction:function(t,n){this.tree.timer&&(clearTimeout(this.tree.timer),this.tree.debug("clearTimeout(%o)",this.tree.timer)),this.tree.timer=null;var i=this;switch(t){case"cancel":break;case"expand":this.tree.timer=setTimeout(function(){i.tree.debug("setTimeout: trigger expand"),i.setExpanded(!0)},n);break;case"activate":this.tree.timer=setTimeout(function(){i.tree.debug("setTimeout: trigger activate"),i.setActive(!0)},n);break;default:e.error("Invalid mode "+t)}},scrollIntoView:function(t,n){if(void 0!==n&&P(n))throw Error("scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' instead.");var i=e.extend({effects:!0===t?{duration:200,queue:!1}:t,scrollOfs:this.tree.options.scrollOfs,scrollParent:this.tree.options.scrollParent,topNode:null},n),s=i.scrollParent,r=this.tree.$container,o=r.css("overflow-y");s?s.jquery||(s=e(s)):s=this.tree.tbody?r.scrollParent():"scroll"===o||"auto"===o?r:r.scrollParent(),s[0]!==document&&s[0]!==document.body||(this.debug("scrollIntoView(): normalizing scrollParent to 'window':",s[0]),s=e(window));var a,u,l,c=new e.Deferred,d=this,h=e(this.span).height(),p=i.scrollOfs.top||0,f=i.scrollOfs.bottom||0,m=s.height(),v=s.scrollTop(),g=s,y=s[0]===window,b=i.topNode||null,w=null;return this.isRootNode()||!this.isVisible()?(this.info("scrollIntoView(): node is invisible."),I()):(y?(u=e(this.span).offset().top,a=b&&b.span?e(b.span).offset().top:0,g=e("html,body")):(k(s[0]!==document&&s[0]!==document.body,"scrollParent should be a simple element or `window`, not document or body."),l=s.offset().top,u=e(this.span).offset().top-l+v,a=b?e(b.span).offset().top-l+v:0,m-=Math.max(0,s.innerHeight()-s[0].clientHeight)),u<v+p?w=u-p:u+h>v+m-f&&(w=u+h-m+f,b&&(k(b.isRootNode()||b.isVisible(),"topNode must be visible"),a<w&&(w=a-p))),null===w?c.resolveWith(this):i.effects?(i.effects.complete=function(){c.resolveWith(d)},g.stop(!0).animate({scrollTop:w},i.effects)):(g[0].scrollTop=w,c.resolveWith(this)),c.promise())},setActive:function(e,t){return this.tree._callHook("nodeSetActive",this,e,t)},setExpanded:function(e,t){return this.tree._callHook("nodeSetExpanded",this,e,t)},setFocus:function(e){return this.tree._callHook("nodeSetFocus",this,e)},setSelected:function(e,t){return this.tree._callHook("nodeSetSelected",this,e,t)},setStatus:function(e,t,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<i;n++)s[n].children&&s[n].sortChildren(e,"$norender$");"$norender$"!==t&&this.render(),this.triggerModifyChild("sort")}},toDict:function(t,n){var i,s,r,o,a={},u=this;if(e.each(g,function(e,t){(u[t]||!1===u[t])&&(a[t]=u[t])}),e.isEmptyObject(this.data)||(a.data=e.extend({},this.data),e.isEmptyObject(a.data)&&delete a.data),n){if(!1===(o=n(a,u)))return!1;"skip"===o&&(t=!1)}if(t&&_(this.children))for(a.children=[],i=0,s=this.children.length;i<s;i++)(r=this.children[i]).isStatusNode()||!1!==(o=r.toDict(!0,n))&&a.children.push(o);return a},toggleClass:function(t,n){var i,s,r=/\S+/g,o=t.match(r)||[],a=0,u=!1,l=this[this.tree.statusClassPropName],c=" "+(this.extraClasses||"")+" ";for(l&&e(l).toggleClass(t,n);i=o[a++];)if(s=c.indexOf(" "+i+" ")>=0,n=void 0===n?!s:!!n)s||(c+=i+" ",u=!0);else for(;c.indexOf(" "+i+" ")>-1;)c=c.replace(" "+i+" "," ");return this.extraClasses=C(c),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,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<i&&!1!==(s=r[n].visit(e,!0));n++);return s},visitAndLoad:function(t,n,i){var s,r,o,a=this;return!t||!0!==n||!1!==(r=t(a))&&"skip"!==r?a.children||a.lazy?(s=new e.Deferred,o=[],a.load().done(function(){for(var n=0,i=a.children.length;n<i;n++){if(!1===(r=a.children[n].visitAndLoad(t,!0,!0))){s.reject();break}"skip"!==r&&o.push(r)}e.when.apply(this,o).then(function(){s.resolve()})}),s.promise()):I():i?r:I()},visitParents:function(e,t){if(t&&!1===e(this))return!1;for(var n=this.parent;n;){if(!1===e(n))return!1;n=n.parent}return!0},visitSiblings:function(e,t){var n,i,s,r=this.parent.children;for(n=0,i=r.length;n<i;n++)if(s=r[n],(t||s!==this)&&!1===e(s))return!1;return!0},warn:function(e){this.tree.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),E("warn",arguments))}},F.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 x(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)},_usesExtension:function(t){return e.inArray(t,this.options.extensions)>=0},_requireExtension:function(t,n,i,s){null!=i&&(i=!!i);var r=this._local.name,o=this.options.extensions,a=e.inArray(t,o)<e.inArray(r,o),u=n&&null==this.ext[t],l=!u&&null!=i&&i!==a;return k(r&&r!==t,"invalid or same name '"+r+"' (require yourself?)"),!u&&!l||(s||(u||n?(s="'"+r+"' extension requires '"+t+"'",l&&(s+=" to be registered "+(i?"before":"after")+" itself")):s="If used together, `"+t+"` must be registered "+(i?"before":"after")+" `"+r+"`"),e.error(s),!1)},activateKey:function(e,t){var n=this.getNodeByKey(e);return n?n.setActive(!0,t):this.activeNode&&this.activeNode.setActive(!1,t),n},addPagingNode:function(e,t){return this.rootNode.addPagingNode(e,t)},applyCommand:function(t,n,i){var s;switch(n=n||this.getActiveNode(),t){case"moveUp":(s=n.getPrevSibling())&&(n.moveTo(s,"before"),n.setActive());break;case"moveDown":(s=n.getNextSibling())&&(n.moveTo(s,"after"),n.setActive());break;case"indent":(s=n.getPrevSibling())&&(n.moveTo(s,"child"),s.setExpanded(),n.setActive());break;case"outdent":n.isTopLevel()||(n.moveTo(n.getParent(),"after"),n.setActive());break;case"remove":s=n.getPrevSibling()||n.getParent(),n.remove(),s&&s.setActive();break;case"addChild":n.editCreateNode("child","");break;case"addSibling":n.editCreateNode("after","");break;case"rename":n.editStart();break;case"down":case"first":case"last":case"left":case"parent":case"right":case"up":return n.navigate(t);default:e.error("Unhandled command: '"+t+"'")}},applyPatch:function(t){var n,i,s,r,o,a,u=t.length,l=[];for(i=0;i<u;i++)k(2===(s=t[i]).length,"patchList must be an array of length-2-arrays"),r=s[0],o=s[1],(a=null===r?this.rootNode:this.getNodeByKey(r))?(n=new e.Deferred,l.push(n),a.applyPatch(o).always(O(n,a))):this.warn("could not find node with key '"+r+"'");return e.when.apply(e,l).promise()},clear:function(e){this._callHook("treeClear",this)},count:function(){return this.rootNode.countChildren()},debug:function(e){this.options.debugLevel>=4&&(Array.prototype.unshift.call(arguments,this.toString()),E("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()),E("error",arguments))},expandAll:function(e,t){var n=this.enableUpdate(!1);e=!1!==e,this.visit(function(n){!1!==n.hasChildren()&&n.isExpanded()!==e&&n.setExpanded(e,t)}),this.enableUpdate(n)},findAll:function(e){return this.rootNode.findAll(e)},findFirst:function(e){return this.rootNode.findFirst(e)},findNextNode:function(e,t){var n=null,i=this.getFirstChild();function s(i){if(e(i)&&(n=i),n||i===t)return!1}return e="string"==typeof e?D(e):e,t=t||i,this.visitRows(s,{start:t,includeSelf:!1}),n||t===i||this.visitRows(s,{start:i,includeSelf:!0}),n},findRelatedNode:function(t,n,i){var s=null,r=e.ui.keyCode;switch(n){case"parent":case r.BACKSPACE:t.parent&&t.parent.parent&&(s=t.parent);break;case"first":case r.HOME:this.visit(function(e){if(e.isVisible())return s=e,!1});break;case"last":case r.END:this.visit(function(e){e.isVisible()&&(s=e)});break;case"left":case r.LEFT:t.expanded?t.setExpanded(!1):t.parent&&t.parent.parent&&(s=t.parent);break;case"right":case r.RIGHT:t.expanded||!t.children&&!t.lazy?t.children&&t.children.length&&(s=t.children[0]):(t.setExpanded(),s=t);break;case"up":case r.UP:this.visitRows(function(e){return s=e,!1},{start:t,reverse:!0,includeSelf:!1});break;case"down":case r.DOWN:this.visitRows(function(e){return s=e,!1},{start:t,includeSelf:!1});break;default:this.tree.warn("Unknown relation '"+n+"'.")}return s},generateFormElements:function(t,n,i){i=i||{};var s,r="string"==typeof t?t:"ft_"+this._id+"[]",o="string"==typeof n?n:"ft_"+this._id+"_active",a="fancytree_result_"+this._id,u=e("#"+a),l=3===this.options.selectMode&&!1!==i.stopOnParents;function c(t){u.append(e("<input>",{type:"checkbox",name:r,value:t.key,checked:!0}))}u.length?u.empty():u=e("<div>",{id:a}).hide().insertAfter(this.$container),!1!==n&&this.activeNode&&u.append(e("<input>",{type:"radio",name:o,value:this.activeNode.key,checked:!0})),i.filter?this.visit(function(e){var t=i.filter(e);if("skip"===t)return t;!1!==t&&c(e)}):!1!==t&&(s=this.getSelectedNodes(l),e.each(s,function(e,t){c(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 n,i;return!t&&(n=document.getElementById(this.options.idPrefix+e))?n.ftnode?n.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()),E("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,n){var i,s,r,o=this,a=new e.Deferred,u=this.getRootNode(),l=this.options.keyPathSeparator,c=[],d=e.extend({},n);for("function"==typeof n?i=n:n&&n.callback&&(i=n.callback),d.callback=function(e,t,n){i&&i.call(e,t,n),a.notifyWith(e,[{node:t,status:n}])},null==d.matchKey&&(d.matchKey=function(e,t){return e.key===t}),_(t)||(t=[t]),s=0;s<t.length;s++)(r=t[s]).charAt(0)===l&&(r=r.substr(1)),c.push(r.split(l));return setTimeout(function(){o._loadKeyPathImpl(a,d,u,c).done(function(){a.resolve()})},0),a.promise()},_loadKeyPathImpl:function(t,n,i,s){var r,o,a,u,l,c,d,h,p,f,m=this;function v(e,t){var i,s,r=e.children;if(r)for(i=0,s=r.length;i<s;i++)if(n.matchKey(r[i],t))return r[i];return null}for(d={},o=0;o<s.length;o++)for(p=s[o],h=i;p.length;){if(a=p.shift(),!(u=v(h,a))){this.warn("loadKeyPath: key not found: "+a+" (parent: "+h+")"),n.callback(this,a,"error");break}if(0===p.length){n.callback(this,u,"ok");break}if(u.lazy&&void 0===u.hasChildren()){n.callback(this,u,"loaded"),d[a=u.key]?d[a].pathSegList.push(p):d[a]={parent:u,pathSegList:[p]};break}n.callback(this,u,"loaded"),h=u}function g(e,t,i){n.callback(m,t,"loading"),t.load().done(function(){m._loadKeyPathImpl.call(m,e,n,t,i).always(O(e,m))}).fail(function(i){m.warn("loadKeyPath: error loading lazy "+t),n.callback(m,u,"error"),e.rejectWith(m)})}for(l in r=[],d)S(d,l)&&(c=d[l],f=new e.Deferred,r.push(f),g(f,c.parent,c.pathSegList));return e.when.apply(e,r).promise()},reactivate:function(e){var t,n=this.activeNode;return n?(this.activeNode=null,t=n.setActive(!0,{noFocus:!0}),e&&n.setFocus(),t):I()},reload:function(e){return this._callHook("treeClear",this),this._callHook("treeLoad",this,e)},render:function(e,t){return this.rootNode.render(e,t)},selectAll:function(e){this.visit(function(t){t.setSelected(e)})},setFocus:function(e){return this._callHook("treeSetFocus",this,e)},setOption:function(e,t){return this.widget.option(e,t)},debugTime:function(e){this.options.debugLevel>=4&&window.console.time(this+" - "+e)},debugTimeEnd:function(e){this.options.debugLevel>=4&&window.console.timeEnd(this+" - "+e)},toDict:function(e,t){var n=this.rootNode.toDict(!0,t);return e?n:n.children},toString:function(){return"Fancytree@"+this._id},_triggerNodeEvent:function(e,t,n,i){var s=this._makeHookContext(t,n,i),r=this.widget._trigger(e,n,s);return!1!==r&&void 0!==s.result?s.result:r},_triggerTreeEvent:function(e,t,n){var i=this._makeHookContext(this,t,n),s=this.widget._trigger(e,t,i);return!1!==s&&void 0!==i.result?i.result:s},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 n,i,s,r,o=0,a=!1===(t=t||{}).includeSelf,u=!!t.includeHidden,l=!u&&this.enableFilter,c=t.start||this.rootNode.children[0];for(s=c.parent;s;){for(k((i=(r=s.children).indexOf(c)+o)>=0,"Could not find "+c+" in parent's children: "+s),n=i;n<r.length;n++)if(c=r[n],!l||c.match||c.subMatchCount){if(!a&&!1===e(c))return!1;if(a=!1,c.children&&c.children.length&&(u||c.expanded)&&!1===c.visit(function(t){return!l||t.match||t.subMatchCount?!1!==e(t)&&(u||!t.children||t.expanded?void 0:"skip"):"skip"},!1))return!1}c=s,s=s.parent,o=1}return!0},_visitRowsUp:function(e,t){for(var n,i,s,r=!!t.includeHidden,o=t.start||this.rootNode.children[0];;){if((n=(s=o.parent).children)[0]===o){if(!(o=s).parent)break;n=s.children}else for(i=n.indexOf(o),o=n[i-1];(r||o.expanded)&&o.children&&o.children.length;)s=o,o=(n=o.children)[n.length-1];if((r||o.isVisible())&&!1===e(o))return!1}},warn:function(e){this.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),E("warn",arguments))}},e.extend(F.prototype,{nodeClick:function(e){var t,n,i=e.targetType,s=e.node;if("expander"===i){if(s.isLoading())return void s.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(n=!1,t=!0,s.folder)switch(e.options.clickFolderMode){case 2:n=!0,t=!1;break;case 3:t=!0,n=!0}t&&(this.nodeSetFocus(e),this._callHook("nodeSetActive",e,!0)),n&&this._callHook("nodeToggleExpanded",e)}},nodeCollapseSiblings:function(e,t){var n,i,s,r=e.node;if(r.parent)for(i=0,s=(n=r.parent.children).length;i<s;i++)n[i]!==r&&n[i].expanded&&this._callHook("nodeSetExpanded",n[i],!1,t)},nodeDblclick:function(e){"title"===e.targetType&&4===e.options.clickFolderMode&&this._callHook("nodeToggleExpanded",e),"title"===e.targetType&&e.originalEvent.preventDefault()},nodeKeydown:function(t){var n,s,r,o=t.originalEvent,a=t.node,u=t.tree,l=t.options,c=o.which,p=o.key||String.fromCharCode(c),f=!!(o.altKey||o.ctrlKey||o.metaKey),m=!h[c]&&!d[c]&&!f,v=e(o.target),g=!0,y=!(o.ctrlKey||!l.autoActivate);if(a||(r=this.getActiveNode()||this.getFirstChild())&&(r.setFocus(),(a=t.node=this.focusNode).debug("Keydown force focus on active node")),l.quicksearch&&m&&!v.is(":input:enabled"))return(s=Date.now())-u.lastQuicksearchTime>500&&(u.lastQuicksearchTerm=""),u.lastQuicksearchTime=s,u.lastQuicksearchTerm+=p,(n=u.findNextNode(u.lastQuicksearchTerm,u.getActiveNode()))&&n.setActive(),void o.preventDefault();switch(i.eventToString(o)){case"+":case"=":u.nodeSetExpanded(t,!0);break;case"-":u.nodeSetExpanded(t,!1);break;case"space":a.isPagingNode()?u._triggerNodeEvent("clickPaging",t,o):i.evalOption("checkbox",a,a,l,!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":a.navigate(o.which,y);break;default:g=!1}g&&o.preventDefault()},nodeLoadChildren:function(t,n){var i,s,r,o=null,l=!0,c=t.tree,d=t.node,h=d.parent,p="nodeLoadChildren",f=Date.now();return x(n)&&k(!x(n=n.call(c,{type:"source"},t)),"source callback must not return another function"),x(n.then)?o=n:n.url?(i=e.extend({},t.options.ajax,n)).debugDelay?(s=i.debugDelay,delete i.debugDelay,_(s)&&(s=s[0]+Math.random()*(s[1]-s[0])),d.warn("nodeLoadChildren waiting debugDelay "+Math.round(s)+" ms ..."),o=e.Deferred(function(t){setTimeout(function(){e.ajax(i).done(function(){t.resolveWith(this,arguments)}).fail(function(){t.rejectWith(this,arguments)})},s)})):o=e.ajax(i):e.isPlainObject(n)||_(n)?(o={then:function(e,t){e(n,null,null)}},l=!1):e.error("Invalid source type: "+n),d._requestId&&(d.warn("Recursive load request #"+f+" while #"+d._requestId+" is pending."),d._requestId=f),l&&(c.debugTime(p),c.nodeSetStatus(t,"loading")),r=new e.Deferred,o.then(function(i,s,o){var l,p;if("json"!==n.dataType&&"jsonp"!==n.dataType||"string"!=typeof i||e.error("Ajax request returned a string (did you get the JSON dataType wrong?)."),d._requestId&&d._requestId>f)r.rejectWith(this,[a]);else if(null!==d.parent||null===h){if(t.options.postProcess){try{(p=c._triggerNodeEvent("postProcess",t,t.originalEvent,{response:i,error:null,dataType:n.dataType})).error&&c.warn("postProcess returned error:",p)}catch(e){p={error:e,message:""+e,details:"postProcess failed"}}if(p.error)return l=e.isPlainObject(p.error)?p.error:{message:p.error},l=c._makeHookContext(d,null,l),void r.rejectWith(this,[l]);(_(p)||e.isPlainObject(p)&&_(p.children))&&(i=p)}else i&&S(i,"d")&&t.options.enableAspx&&(42===t.options.enableAspx&&c.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);r.resolveWith(this,[i])}else r.rejectWith(this,[u])},function(e,t,n){var i=c._makeHookContext(d,null,{error:e,args:Array.prototype.slice.call(arguments),message:n,details:e.status+": "+n});r.rejectWith(this,[i])}),r.done(function(n){var i,s,r;c.nodeSetStatus(t,"ok"),e.isPlainObject(n)?(k(d.isRootNode(),"source may only be an object for root nodes (expecting an array of child objects otherwise)"),k(_(n.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),s=n,i=n.children,delete s.children,e.each(v,function(e,t){void 0!==s[t]&&(c[t]=s[t],delete s[t])}),e.extend(c.data,s)):i=n,k(_(i),"expected array of children"),d._setChildren(i),c.options.nodata&&0===i.length&&(x(c.options.nodata)?r=c.options.nodata.call(c,{type:"nodata"},t):!0===c.options.nodata&&d.isRootNode()?r=c.options.strings.noData:"string"==typeof c.options.nodata&&d.isRootNode()&&(r=c.options.nodata),r&&d.setStatus("nodata",r)),c._triggerNodeEvent("loadChildren",d)}).fail(function(e){var n;e!==a?e!==u?(e.node&&e.error&&e.message?n=e:"[object Object]"===(n=c._makeHookContext(d,null,{error:e,args:Array.prototype.slice.call(arguments),message:e?e.message||e.toString():""})).message&&(n.message=""),d.warn("Load children failed ("+n.message+")",n),!1!==c._triggerNodeEvent("loadError",n,null)&&c.nodeSetStatus(t,"error",n.message,n.details)):d.warn("Lazy parent node was removed while loading: discarding response."):d.warn("Ignored response for obsolete load request #"+f+" (expected #"+d._requestId+")")}).always(function(){d._requestId=null,l&&c.debugTimeEnd(p)}),r.promise()},nodeLoadKeyPath:function(e,t){},nodeRemoveChild:function(t,n){var i,s=t.node,r=e.extend({},t,{node:n}),o=s.children;if(1===o.length)return k(n===o[0],"invalid single child"),this.nodeRemoveChildren(t);this.activeNode&&(n===this.activeNode||this.activeNode.isDescendantOf(n))&&this.activeNode.setActive(!1),this.focusNode&&(n===this.focusNode||this.focusNode.isDescendantOf(n))&&(this.focusNode=null),this.nodeRemoveMarkup(r),this.nodeRemoveChildren(r),k((i=e.inArray(n,o))>=0,"invalid child"),s.triggerModifyChild("remove",n),n.visit(function(e){e.parent=null},!0),this._callHook("treeRegisterNode",this,!1,n),o.splice(i,1)},nodeRemoveChildMarkup:function(t){var n=t.node;n.ul&&(n.isRootNode()?e(n.ul).empty():(e(n.ul).remove(),n.ul=null),n.visit(function(e){e.li=e.ul=null}))},nodeRemoveChildren:function(e){var t=e.tree,n=e.node;n.children&&(this.activeNode&&this.activeNode.isDescendantOf(n)&&this.activeNode.setActive(!1),this.focusNode&&this.focusNode.isDescendantOf(n)&&(this.focusNode=null),this.nodeRemoveChildMarkup(e),n.triggerModifyChild("remove",null),n.visit(function(e){e.parent=null,t._callHook("treeRegisterNode",t,!1,e)}),n.lazy?n.children=[]:n.children=null,n.isRootNode()||(n.expanded=!1),this.nodeRenderStatus(e))},nodeRemoveMarkup:function(t){var n=t.node;n.li&&(e(n.li).remove(),n.li=null),this.nodeRemoveChildMarkup(t)},nodeRender:function(t,n,i,s,r){var o,a,u,l,c,d,h,p=t.node,f=t.tree,m=t.options,v=m.aria,g=!1,y=p.parent,b=!y,w=p.children,_=null;if(!1!==f._enableUpdate&&(b||y.ul)){if(k(b||y.ul,"parent UL must exist"),b||(p.li&&(n||p.li.parentNode!==p.parent.ul)&&(p.li.parentNode===p.parent.ul?_=p.li.nextSibling:this.debug("Unlinking "+p+" (must be child of "+p.parent+")"),this.nodeRemoveMarkup(t)),p.li?this.nodeRenderStatus(t):(g=!0,p.li=document.createElement("li"),p.li.ftnode=p,p.key&&m.generateIds&&(p.li.id=m.idPrefix+p.key),p.span=document.createElement("span"),p.span.className="fancytree-node",v&&!p.tr&&e(p.li).attr("role","treeitem"),p.li.appendChild(p.span),this.nodeRenderTitle(t),m.createNode&&m.createNode.call(f,{type:"createNode"},t)),m.renderNode&&m.renderNode.call(f,{type:"renderNode"},t)),w){if(b||p.expanded||!0===i){for(p.ul||(p.ul=document.createElement("ul"),(!0!==s||r)&&p.expanded||(p.ul.style.display="none"),v&&e(p.ul).attr("role","group"),p.li?p.li.appendChild(p.ul):p.tree.$div.append(p.ul)),l=0,c=w.length;l<c;l++)h=e.extend({},t,{node:w[l]}),this.nodeRender(h,n,i,!1,!0);for(o=p.ul.firstChild;o;)(u=o.ftnode)&&u.parent!==p?(p.debug("_fixParent: remove missing "+u,o),d=o.nextSibling,o.parentNode.removeChild(o),o=d):o=o.nextSibling;for(o=p.ul.firstChild,l=0,c=w.length-1;l<c;l++)(a=w[l])===(u=o.ftnode)?o=o.nextSibling:p.ul.insertBefore(a.li,u.li)}}else p.ul&&(this.warn("remove child markup for "+p),this.nodeRemoveChildMarkup(t));b||g&&y.ul.insertBefore(p.li,_)}},nodeRenderTitle:function(t,n){var r,o,a,u,l,c,d,h=t.node,p=t.tree,f=t.options,m=f.aria,v=h.getLevel(),g=[];void 0!==n&&(h.title=n),h.span&&!1!==p._enableUpdate&&(l=m&&!1!==h.hasChildren()?" role='button'":"",v<f.minExpandLevel?(h.lazy||(h.expanded=!0),v>1&&g.push("<span "+l+" class='fancytree-expander fancytree-expander-fixed'></span>")):g.push("<span "+l+" class='fancytree-expander'></span>"),(r=i.evalOption("checkbox",h,h,f,!1))&&!h.isStatusNode()&&(l=m?" role='checkbox'":"",o="fancytree-checkbox",("radio"===r||h.parent&&h.parent.radiogroup)&&(o+=" fancytree-radio"),g.push("<span "+l+" class='"+o+"'></span>")),void 0!==h.data.iconClass&&(h.icon?e.error("'iconClass' node option is deprecated since v2.14.0: use 'icon' only instead"):(h.warn("'iconClass' node option is deprecated since v2.14.0: use 'icon' instead"),h.icon=h.data.iconClass)),!1!==(a=i.evalOption("icon",h,h,f,!0))&&(l=m?" role='presentation'":"",d=(d=i.evalOption("iconTooltip",h,h,f,null))?" title='"+M(d)+"'":"","string"==typeof a?s.test(a)?(a="/"===a.charAt(0)?a:(f.imagePath||"")+a,g.push("<img src='"+a+"' class='fancytree-icon'"+d+" alt='' />")):g.push("<span "+l+" class='fancytree-custom-icon "+a+"'"+d+"></span>"):a.text?g.push("<span "+l+" class='fancytree-custom-icon "+(a.addClass||"")+"'"+d+">"+i.escapeHtml(a.text)+"</span>"):a.html?g.push("<span "+l+" class='fancytree-custom-icon "+(a.addClass||"")+"'"+d+">"+a.html+"</span>"):g.push("<span "+l+" class='fancytree-icon'"+d+"></span>")),u="",f.renderTitle&&(u=f.renderTitle.call(p,{type:"renderTitle"},t)||""),u||(!0===(c=i.evalOption("tooltip",h,h,f,null))&&(c=h.title),u="<span class='fancytree-title'"+(c=c?" title='"+M(c)+"'":"")+(f.titlesTabbable?" tabindex='0'":"")+">"+(f.escapeTitles?i.escapeHtml(h.title):h.title)+"</span>"),g.push(u),h.span.innerHTML=g.join(""),this.nodeRenderStatus(t),f.enhanceTitle&&(t.$title=e(">span.fancytree-title",h.span),u=f.enhanceTitle.call(p,{type:"enhanceTitle"},t)||""))},nodeRenderStatus:function(t){var n,s=t.node,r=t.tree,o=t.options,a=s.hasChildren(),u=s.isLastSibling(),l=o.aria,c=o._classNames,d=[],h=s[r.statusClassPropName];h&&!1!==r._enableUpdate&&(l&&(n=e(s.tr||s.li)),d.push(c.node),r.activeNode===s&&d.push(c.active),r.focusNode===s&&d.push(c.focused),s.expanded&&d.push(c.expanded),l&&(!1===a?n.removeAttr("aria-expanded"):n.attr("aria-expanded",Boolean(s.expanded))),s.folder&&d.push(c.folder),!1!==a&&d.push(c.hasChildren),u&&d.push(c.lastsib),s.lazy&&null==s.children&&d.push(c.lazy),s.partload&&d.push(c.partload),s.partsel&&d.push(c.partsel),i.evalOption("unselectable",s,s,o,!1)&&d.push(c.unselectable),s._isLoading&&d.push(c.loading),s._error&&d.push(c.error),s.statusNodeType&&d.push(c.statusNodePrefix+s.statusNodeType),s.selected?(d.push(c.selected),l&&n.attr("aria-selected",!0)):l&&n.attr("aria-selected",!1),s.extraClasses&&d.push(s.extraClasses),!1===a?d.push(c.combinedExpanderPrefix+"n"+(u?"l":"")):d.push(c.combinedExpanderPrefix+(s.expanded?"e":"c")+(s.lazy&&null==s.children?"d":"")+(u?"l":"")),d.push(c.combinedIconPrefix+(s.expanded?"e":"c")+(s.folder?"f":"")),h.className=d.join(" "),s.li&&e(s.li).toggleClass(c.lastsib,u))},nodeSetActive:function(t,n,i){i=i||{};var s,r=t.node,o=t.tree,a=t.options,u=!0===i.noEvents,l=!0===i.noFocus,c=!1!==i.scrollIntoView;return r===o.activeNode==(n=!1!==n)?I(r):(c&&t.originalEvent&&e(t.originalEvent.target).is("a,:checkbox")&&(r.info("Not scrolling while clicking an embedded link."),c=!1),n&&!u&&!1===this._triggerNodeEvent("beforeActivate",r,t.originalEvent)?B(r,["rejected"]):(n?(o.activeNode&&(k(o.activeNode!==r,"node was active (inconsistency)"),s=e.extend({},t,{node:o.activeNode}),o.nodeSetActive(s,!1),k(null===o.activeNode,"deactivate was out of sync?")),a.activeVisible&&r.makeVisible({scrollIntoView:c}),o.activeNode=r,o.nodeRenderStatus(t),l||o.nodeSetFocus(t),u||o._triggerNodeEvent("activate",r,t.originalEvent)):(k(o.activeNode===r,"node was not active (inconsistency)"),o.activeNode=null,this.nodeRenderStatus(t),u||t.tree._triggerNodeEvent("deactivate",r,t.originalEvent)),I(r)))},nodeSetExpanded:function(t,n,i){i=i||{};var s,r,o,a,u,l,c=t.node,d=t.tree,h=t.options,p=!0===i.noAnimation,f=!0===i.noEvents;if(n=!1!==n,e(c.li).hasClass(h._classNames.animating))return c.warn("setExpanded("+n+") while animating: ignored."),B(c,["recursion"]);if(c.expanded&&n||!c.expanded&&!n)return I(c);if(n&&!c.lazy&&!c.hasChildren())return I(c);if(!n&&c.getLevel()<h.minExpandLevel)return B(c,["locked"]);if(!f&&!1===this._triggerNodeEvent("beforeExpand",c,t.originalEvent))return B(c,["rejected"]);if(p||c.isVisible()||(p=i.noAnimation=!0),r=new e.Deferred,n&&!c.expanded&&h.autoCollapse){u=c.getParentList(!1,!0),l=h.autoCollapse;try{for(h.autoCollapse=!1,o=0,a=u.length;o<a;o++)this._callHook("nodeCollapseSiblings",u[o],i)}finally{h.autoCollapse=l}}return r.done(function(){var e=c.getLastChild();n&&h.autoScroll&&!p&&e&&d._enableUpdate?e.scrollIntoView(!0,{topNode:c}).always(function(){f||t.tree._triggerNodeEvent(n?"expand":"collapse",t)}):f||t.tree._triggerNodeEvent(n?"expand":"collapse",t)}),s=function(i){var s=h._classNames,r=h.toggleEffect;if(c.expanded=n,d._callHook("treeStructureChanged",t,n?"expand":"collapse"),d._callHook("nodeRender",t,!1,!1,!0),c.ul)if("none"!==c.ul.style.display==!!c.expanded)c.warn("nodeSetExpanded: UL.style.display already set");else{if(r&&!p)return e(c.li).addClass(s.animating),void(x(e(c.ul)[r.effect])?e(c.ul)[r.effect]({duration:r.duration,always:function(){e(this).removeClass(s.animating),e(c.li).removeClass(s.animating),i()}}):(e(c.ul).stop(!0,!0),e(c.ul).parent().find(".ui-effects-placeholder").remove(),e(c.ul).toggle(r.effect,r.options,r.duration,function(){e(this).removeClass(s.animating),e(c.li).removeClass(s.animating),i()})));c.ul.style.display=c.expanded||!parent?"":"none"}i()},n&&c.lazy&&void 0===c.hasChildren()?c.load().done(function(){r.notifyWith&&r.notifyWith(c,["loaded"]),s(function(){r.resolveWith(c)})}).fail(function(e){s(function(){r.rejectWith(c,["load failed ("+e+")"])})}):s(function(){r.resolveWith(c)}),r.promise()},nodeSetFocus:function(t,n){var i,s=t.tree,r=t.node,o=s.options,a=!!t.originalEvent&&e(t.originalEvent.target).is(":input");if(n=!1!==n,s.focusNode){if(s.focusNode===r&&n)return;i=e.extend({},t,{node:s.focusNode}),s.focusNode=null,this._triggerNodeEvent("blur",i),this._callHook("nodeRenderStatus",i)}n&&(this.hasFocus()||(r.debug("nodeSetFocus: forcing container focus"),this._callHook("treeSetFocus",t,!0,{calledByNode:!0})),r.makeVisible({scrollIntoView:!1}),s.focusNode=r,o.titlesTabbable&&(a||e(r.span).find(".fancytree-title").focus()),o.aria&&e(s.$container).attr("aria-activedescendant",e(r.tr||r.li).uniqueId().attr("id")),this._triggerNodeEvent("focus",t),document.activeElement===s.$container.get(0)||e(document.activeElement,s.$container).length>=1||e(s.$container).focus(),o.autoScroll&&r.scrollIntoView(),this._callHook("nodeRenderStatus",t))},nodeSetSelected:function(e,t,n){n=n||{};var s=e.node,r=e.tree,o=e.options,a=!0===n.noEvents,u=s.parent;if(t=!1!==t,!i.evalOption("unselectable",s,s,o,!1)){if(s._lastSelectIntent=t,!!s.selected===t&&(3!==o.selectMode||!s.partsel||t))return t;if(!a&&!1===this._triggerNodeEvent("beforeSelect",s,e.originalEvent))return!!s.selected;t&&1===o.selectMode?(r.lastSelectedNode&&r.lastSelectedNode.setSelected(!1),s.selected=t):3!==o.selectMode||!u||u.radiogroup||s.radiogroup?u&&u.radiogroup?s.visitSiblings(function(e){e._changeSelectStatusAttrs(t&&e===s)},!0):s.selected=t:(s.selected=t,s.fixSelection3AfterClick(n)),this.nodeRenderStatus(e),r.lastSelectedNode=t?s:null,a||r._triggerNodeEvent("select",e)}},nodeSetStatus:function(t,n,i,s){var r=t.node,o=t.tree;function a(){var e=r.children?r.children[0]:null;if(e&&e.isStatusNode()){try{r.ul&&(r.ul.removeChild(e.li),e.li=null)}catch(e){}1===r.children.length?r.children=[]:r.children.shift(),o._callHook("treeStructureChanged",t,"clearStatusNode")}}function u(n,i){var s=r.children?r.children[0]:null;return s&&s.isStatusNode()?(e.extend(s,n),s.statusNodeType=i,o._callHook("nodeRenderTitle",s)):(r._setChildren([n]),o._callHook("treeStructureChanged",t,"setStatusNode"),r.children[0].statusNodeType=i,o.render()),r.children[0]}switch(n){case"ok":a(),r._isLoading=!1,r._error=null,r.renderStatus();break;case"loading":r.parent||u({title:o.options.strings.loading+(i?" ("+i+")":""),checkbox:!1,tooltip:s},n),r._isLoading=!0,r._error=null,r.renderStatus();break;case"error":u({title:o.options.strings.loadError+(i?" ("+i+")":""),checkbox:!1,tooltip:s},n),r._isLoading=!1,r._error={message:i,details:s},r.renderStatus();break;case"nodata":u({title:i||o.options.strings.noData,checkbox:!1,tooltip:s},n),r._isLoading=!1,r._error=null,r.renderStatus();break;default:e.error("invalid node status "+n)}},nodeToggleExpanded:function(e){return this.nodeSetExpanded(e,!e.node.expanded)},nodeToggleSelected:function(e){var t=e.node,n=!t.selected;return t.partsel&&!t.selected&&!0===t._lastSelectIntent&&(n=!1,t.selected=!0),t._lastSelectIntent=n,this.nodeSetSelected(e,n)},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 n=t.tree,i=n.options;n.$container.attr("tabindex",i.tabindex),e.each(v,function(e,t){void 0!==i[t]&&(n.info("Move option "+t+" to tree"),n[t]=i[t],delete i[t])}),i.checkboxAutoHide&&n.$container.addClass("fancytree-checkbox-auto-hide"),i.rtl?n.$container.attr("DIR","RTL").addClass("fancytree-rtl"):n.$container.removeAttr("DIR").removeClass("fancytree-rtl"),i.aria&&(n.$container.attr("role","tree"),1!==i.selectMode&&n.$container.attr("aria-multiselectable",!0)),this.treeLoad(t)},treeLoad:function(t,n){var s,r,o,a=t.tree,u=t.widget.element,l=e.extend({},t,{node:this.rootNode});if(a.rootNode.children&&this.treeClear(t),n=n||this.options.source)"string"==typeof n&&e.error("Not implemented");else switch(r=u.data("type")||"html"){case"html":(o=u.find(">ul").not(".fancytree-container").first()).length?(o.addClass("ui-fancytree-source fancytree-helper-hidden"),n=e.ui.fancytree.parseHtml(o),this.data=e.extend(this.data,A(o))):(i.warn("No `source` option was passed and container does not contain `<ul>`: assuming `source: []`."),n=[]);break;case"json":n=e.parseJSON(u.text()),u.contents().filter(function(){return 3===this.nodeType}).remove(),e.isPlainObject(n)&&(k(_(n.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),s=n,n=n.children,delete s.children,e.each(v,function(e,t){void 0!==s[t]&&(a[t]=s[t],delete s[t])}),e.extend(a.data,s));break;default:e.error("Invalid data-type: "+r)}return a._triggerTreeEvent("preInit",null),this.nodeLoadChildren(l,n).done(function(){a._callHook("treeStructureChanged",t,"loadChildren"),a.render(),3===t.options.selectMode&&a.rootNode.fixSelection3FromEndNodes(),a.activeNode&&a.options.activeVisible&&a.activeNode.makeVisible(),a._triggerTreeEvent("init",null,{status:!0})}).fail(function(){a.render(),a._triggerTreeEvent("init",null,{status:!1})})},treeRegisterNode:function(e,t,n){e.tree._callHook("treeStructureChanged",e,t?"addNode":"removeNode")},treeSetFocus:function(t,n,i){var s;(n=!1!==n)!==this.hasFocus()&&(this._hasFocus=n,!n&&this.focusNode?this.focusNode.setFocus(!1):!n||i&&i.calledByNode||e(this.$container).focus(),this.$container.toggleClass("fancytree-treefocus",n),this._triggerTreeEvent(n?"focusTree":"blurTree"),n&&!this.activeNode&&(s=this._lastMousedownNode||this.getFirstChild())&&s.setFocus())},treeSetOption:function(t,n,i){var s=t.tree,r=!0,o=!1,a=!1;switch(n){case"aria":case"checkbox":case"icon":case"minExpandLevel":case"tabindex":o=!0,a=!0;break;case"checkboxAutoHide":s.$container.toggleClass("fancytree-checkbox-auto-hide",!!i);break;case"escapeTitles":case"tooltip":a=!0;break;case"rtl":!1===i?s.$container.removeAttr("DIR").removeClass("fancytree-rtl"):s.$container.attr("DIR","RTL").addClass("fancytree-rtl"),a=!0;break;case"source":r=!1,s._callHook("treeLoad",s,i),a=!0}s.debug("set option "+n+"="+i+" <"+typeof i+">"),r&&(this.widget._super?this.widget._super.call(this.widget,n,i):e.Widget.prototype._setOption.call(this.widget,n,i)),o&&s._callHook("treeCreate",s),a&&s.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 F(this),this.$source=this.source||"json"===this.element.data("type")?this.element:this.element.find(">ul").first();var t,n,i,s=this.options,r=s.extensions,o=this.tree;for(i=0;i<r.length;i++)n=r[i],(t=e.ui.fancytree._extensions[n])||e.error("Could not apply extension '"+n+"' (it is not registered, did you forget to include it?)"),this.tree.options[n]=N({},t.options,this.tree.options[n]),k(void 0===this.tree.ext[n],"Extension name must not exist as Fancytree.ext attribute: '"+n+"'"),this.tree.ext[n]={},j(this.tree,o,t,n),o=t;void 0!==s.icons&&(!0===s.icon?(this.tree.warn("'icons' tree option is deprecated since v2.14.0: use 'icon' instead"),s.icon=s.icons):e.error("'icons' tree option is deprecated since v2.14.0: use 'icon' only instead")),void 0!==s.iconClass&&(s.icon?e.error("'iconClass' tree option is deprecated since v2.14.0: use 'icon' only instead"):(this.tree.warn("'iconClass' tree option is deprecated since v2.14.0: use 'icon' instead"),s.icon=s.iconClass)),void 0!==s.tabbable&&(s.tabindex=s.tabbable?"0":"-1",this.tree.warn("'tabbable' tree option is deprecated since v2.17.0: use 'tabindex='"+s.tabindex+"' instead")),this.tree._callHook("treeCreate",this.tree)},_init:function(){this.tree._callHook("treeInit",this.tree),this._bind()},_setOption:function(e,t){return this.tree._callHook("treeSetOption",this.tree,e,t)},_destroy:function(){this._unbind(),this.tree._callHook("treeDestroy",this.tree)},_unbind:function(){var t=this.tree._ns;this.element.off(t),this.tree.$container.off(t),e(document).off(t)},_bind:function(){var t=this,n=this.options,s=this.tree,r=s._ns;this._unbind(),s.$container.on("focusin"+r+" focusout"+r,function(t){var n=i.getNode(t),r="focusin"===t.type;if(!r&&n&&e(t.target).is("a"))n.debug("Ignored focusout on embedded <a> element.");else{if(r){if(s._getExpiringValue("focusin"))return void s.debug("Ignored double focusin.");s._setExpiringValue("focusin",!0,50),n||(n=s._getExpiringValue("mouseDownNode"))&&s.debug("Reconstruct mouse target for focusin from recent event.")}n?s._callHook("nodeSetFocus",s._makeHookContext(n,t),r):s.tbody&&e(t.target).parents("table.fancytree-container > thead").length?s.debug("Ignore focus event outside table body.",t):s._callHook("treeSetFocus",s,r)}}).on("selectstart"+r,"span.fancytree-title",function(e){e.preventDefault()}).on("keydown"+r,function(e){if(n.disabled||!1===n.keyboard)return!0;var t,i=s.focusNode,r=s._makeHookContext(i||s,e),o=s.phase;try{return s.phase="userEvent","preventNav"===(t=i?s._triggerNodeEvent("keydown",i,e):s._triggerTreeEvent("keydown",e))?t=!0:!1!==t&&(t=s._callHook("nodeKeydown",r)),t}finally{s.phase=o}}).on("mousedown"+r,function(e){var t=i.getEventTarget(e);s._lastMousedownNode=t?t.node:null,s._setExpiringValue("mouseDownNode",s._lastMousedownNode)}).on("click"+r+" dblclick"+r,function(e){if(n.disabled)return!0;var s,r=i.getEventTarget(e),o=r.node,a=t.tree,u=a.phase;if(!o)return!0;s=a._makeHookContext(o,e);try{switch(a.phase="userEvent",e.type){case"click":return s.targetType=r.type,o.isPagingNode()?!0===a._triggerNodeEvent("clickPaging",s,e):!1!==a._triggerNodeEvent("click",s,e)&&a._callHook("nodeClick",s);case"dblclick":return s.targetType=r.type,!1!==a._triggerNodeEvent("dblclick",s,e)&&a._callHook("nodeDblclick",s)}}finally{a.phase=u}})},getActiveNode:function(){return this._deprecationWarning("getActiveNode"),this.tree.activeNode},getNodeByKey:function(e){return this._deprecationWarning("getNodeByKey"),this.tree.getNodeByKey(e)},getRootNode:function(){return this._deprecationWarning("getRootNode"),this.tree.rootNode},getTree:function(){return this._deprecationWarning("getTree"),this.tree}}),i=e.ui.fancytree,e.extend(e.ui.fancytree,{version:"2.38.1-0",buildType:"production",debugLevel:3,_nextId:1,_nextNodeKey:1,_extensions:{},_FancytreeClass:F,_FancytreeNodeClass:q,jquerySupports:{positionMyOfs:T(e.ui.version,1,9)},assert:function(e,t){return k(e,t)},createTree:function(t,n){var s=e(t).fancytree(n);return i.getTree(s)},debounce:function(e,t,n,i){var s;return 3===arguments.length&&"boolean"!=typeof n&&(i=n,n=!1),function(){var r=arguments;i=i||this,n&&!s&&t.apply(i,r),clearTimeout(s),s=setTimeout(function(){n||t.apply(i,r),s=null},e)}},debug:function(t){e.ui.fancytree.debugLevel>=4&&E("log",arguments)},error:function(t){e.ui.fancytree.debugLevel>=1&&E("error",arguments)},escapeHtml:function(e){return(""+e).replace(r,function(e){return l[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 n=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.my),i=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.at),s=(n[2]?+n[2]:0)+(i[2]?+i[2]:0),r=(n[4]?+n[4]:0)+(i[4]?+i[4]:0);t=e.extend({},t,{my:n[1]+" "+n[3],at:i[1]+" "+i[3]}),(s||r)&&(t.offset=s+" "+r)}return t},getEventTarget:function(t){var n,s=t&&t.target?t.target.className:"",r={node:this.getNode(t.target),type:void 0};return/\bfancytree-title\b/.test(s)?r.type="title":/\bfancytree-expander\b/.test(s)?r.type=!1===r.node.hasChildren()?"prefix":"expander":/\bfancytree-checkbox\b/.test(s)?r.type="checkbox":/\bfancytree(-custom)?-icon\b/.test(s)?r.type="icon":/\bfancytree-node\b/.test(s)?r.type="title":t&&t.target&&((n=e(t.target)).is("ul[role=group]")?((r.node&&r.node.tree||i).debug("Ignoring click on outer UL."),r.node=null):n.closest(".fancytree-title").length?r.type="title":n.closest(".fancytree-checkbox").length?r.type="checkbox":n.closest(".fancytree-expander").length&&(r.type="expander")),r},getEventTargetType:function(e){return this.getEventTarget(e).type},getNode:function(t){if(t instanceof q)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 n,i=t;return t instanceof F?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)),(n=(t=t.closest(":ui-fancytree")).data("ui-fancytree")||t.data("fancytree"))?n.tree:null)},evalOption:function(e,t,n,i,s){var r,o,a=t.tree,u=i[e],l=n[e];return x(u)?(r={node:t,tree:a,widget:a.widget,options:a.widget.options,typeInfo:a.types[t.type]||{}},null==(o=u.call(a,{type:e},r))&&(o=l)):o=null==l?u:l,null==o&&(o=s),o},setSpanIcon:function(t,n,i){var s=e(t);"string"==typeof i?s.attr("class",n+" "+i):(i.text?s.text(""+i.text):i.html&&(t.innerHTML=i.html),s.attr("class",n+" "+(i.addClass||"")))},eventToString:function(e){var t=e.which,n=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"===n||"dblclick"===n?i.push(p[e.button]+n):"wheel"===n?i.push(n):c[t]||i.push(d[t]||String.fromCharCode(t).toLowerCase()),i.join("+")},info:function(t){e.ui.fancytree.debugLevel>=3&&E("info",arguments)},keyEventToString:function(e){return this.warn("keyEventToString() is deprecated: use eventToString()"),this.eventToString(e)},overrideMethod:function(t,n,i,s){var r,o=t[n]||e.noop;t[n]=function(){var e=s||this;try{return r=e._super,e._super=o,i.apply(e,arguments)}finally{e._super=r}}},parseHtml:function(t){var n,i,s,r,o,a,u,l,c=t.find(">li"),d=[];return c.each(function(){var c,h,p=e(this),v=p.find(">span",this).first(),y=v.length?null:p.find(">a").first(),w={tooltip:null,data:{}};for(v.length?w.title=v.html():y&&y.length?(w.title=y.html(),w.data.href=y.attr("href"),w.data.target=y.attr("target"),w.tooltip=y.attr("title")):(w.title=p.html(),(o=w.title.search(/<ul/i))>=0&&(w.title=w.title.substring(0,o))),w.title=C(w.title),r=0,a=f.length;r<a;r++)w[f[r]]=void 0;for(n=this.className.split(" "),s=[],r=0,a=n.length;r<a;r++)i=n[r],m[i]?w[i]=!0:s.push(i);if(w.extraClasses=s.join(" "),(u=p.attr("title"))&&(w.tooltip=u),(u=p.attr("id"))&&(w.key=u),p.attr("hideCheckbox")&&(w.checkbox=!1),(c=A(p))&&!e.isEmptyObject(c)){for(h in b)S(c,h)&&(c[b[h]]=c[h],delete c[h]);for(r=0,a=g.length;r<a;r++)u=g[r],null!=(l=c[u])&&(delete c[u],w[u]=l);e.extend(w.data,c)}(t=p.find(">ul").first()).length?w.children=e.ui.fancytree.parseHtml(t):w.children=w.lazy?void 0:null,d.push(w)}),d},registerExtension:function(t){k(null!=t.name,"extensions must have a `name` property."),k(null!=t.version,"extensions must have a `version` property."),e.ui.fancytree._extensions[t.name]=t},trim:C,unescapeHtml:function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue},warn:function(t){e.ui.fancytree.debugLevel>=2&&E("warn",arguments)}}),e.ui.fancytree}function k(t,n){t||(n="Fancytree assertion failed"+(n=n?": "+n:""),e.ui.fancytree.error(n),e.error(n))}function S(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function x(e){return"function"==typeof e}function C(e){return null==e?"":e.trim()}function E(e,t){var n,i,s=window.console?window.console[e]:null;if(s)try{s.apply(window.console,t)}catch(e){for(i="",n=0;n<t.length;n++)i+=t[n];s(i)}}function P(e){return!(!e.tree||void 0===e.statusNodeType)}function T(t,n,i,s){var r,o,a,u=e.map(C(t).split("."),function(e){return parseInt(e,10)}),l=e.map(Array.prototype.slice.call(arguments,1),function(e){return parseInt(e,10)});for(r=0;r<l.length;r++)if((o=u[r]||0)!==(a=l[r]||0))return o>a;return!0}function N(){var t,n,i,s,r,o=arguments[0]||{},a=1,u=arguments.length;if("object"==typeof o||x(o)||(o={}),a===u)throw Error("need at least two args");for(;a<u;a++)if(null!=(t=arguments[a]))for(n in t)if(S(t,n)){if(i=o[n],o===(s=t[n]))continue;s&&e.isPlainObject(s)?(r=i&&e.isPlainObject(i)?i:{},o[n]=N(r,s)):void 0!==s&&(o[n]=s)}return o}function L(e,t,n,i,s){var r,o,a,u,l,c=(r=t[e],o=i[e],a=t.ext[s],u=function(){return r.apply(t,arguments)},l=function(e){return r.apply(t,e)},function(){var e=t._local,n=t._super,i=t._superApply;try{return t._local=a,t._super=u,t._superApply=l,o.apply(t,arguments)}finally{t._local=e,t._super=n,t._superApply=i}});return c}function j(t,n,i,s){for(var r in i)"function"==typeof i[r]?"function"==typeof t[r]?t[r]=L(r,t,n,i,s):"_"===r.charAt(0)?t.ext[s][r]=L(r,t,n,i,s):e.error("Could not override tree."+r+". Use prefix '_' to create tree."+s+"._"+r):"options"!==r&&(t.ext[s][r]=i[r])}function I(t,n){return void 0===t?e.Deferred(function(){this.resolve()}).promise():e.Deferred(function(){this.resolveWith(t,n)}).promise()}function B(t,n){return void 0===t?e.Deferred(function(){this.reject()}).promise():e.Deferred(function(){this.rejectWith(t,n)}).promise()}function O(e,t){return function(){e.resolveWith(t)}}function A(t){var n=e.extend({},t.data()),i=n.json;return delete n.fancytree,delete n.uiFancytree,i&&(delete n.json,n=e.extend(n,i)),n}function M(e){return(""+e).replace(o,function(e){return l[e]})}function R(e){return e=e.toLowerCase(),function(t){return t.title.toLowerCase().indexOf(e)>=0}}function D(e){var t=new RegExp("^"+e,"i");return function(e){return t.test(e.title)}}function q(t,n){var s,r,o,a;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={},s=0,r=g.length;s<r;s++)this[o=g[s]]=n[o];for(o in null==this.unselectableIgnore&&null==this.unselectableStatus||(this.unselectable=!0),n.hideCheckbox&&e.error("'hideCheckbox' node option was removed in v2.23.0: use 'checkbox: false'"),n.data&&e.extend(this.data,n.data),n)y[o]||!this.tree.options.copyFunctionsToData&&x(n[o])||w[o]||(this.data[o]=n[o]);null==this.key?this.tree.options.defaultKey?(this.key=""+this.tree.options.defaultKey(this),k(this.key,"defaultKey() must return a unique key")):this.key="_"+i._nextNodeKey++:this.key=""+this.key,n.active&&(k(null===this.tree.activeNode,"only one active node allowed"),this.tree.activeNode=this),n.selected&&(this.tree.lastSelectedNode=this),(a=n.children)?a.length?this._setChildren(a):this.children=this.lazy?[]:null:this.children=null,this.tree._callHook("treeRegisterNode",this.tree,!0,this)}function F(t){this.widget=t,this.$div=t.element,this.options=t.options,this.options&&(void 0!==this.options.lazyload&&e.error("The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead."),void 0!==this.options.loaderror&&e.error("The 'loaderror' event was renamed since 2014-07-03. Use 'loadError' (with uppercase E) instead."),void 0!==this.options.fx&&e.error("The 'fx' option was replaced by 'toggleEffect' since 2014-11-30."),void 0!==this.options.removeNode&&e.error("The 'removeNode' event was replaced by 'modifyChild' since 2.20 (2016-09-10).")),this.ext={},this.types={},this.columns={},this.data=A(this.$div),this._id=""+(this.options.treeId||e.ui.fancytree._nextId++),this._ns=".fancytree-"+this._id,this.activeNode=null,this.focusNode=null,this._hasFocus=null,this._tempCache={},this._lastMousedownNode=null,this._enableUpdate=!0,this.lastSelectedNode=null,this.systemFocusElement=null,this.lastQuicksearchTerm="",this.lastQuicksearchTime=0,this.viewport=null,this.statusClassPropName="span",this.ariaPropName="li",this.nodeContainerAttrName="li",this.$div.find(">ul.fancytree-container").remove();var n,s={tree:this};this.rootNode=new q(s,{title:"root",key:"root_"+this._id,children:null,expanded:!0}),this.rootNode.parent=null,n=e("<ul>",{id:"ft-id-"+this._id,class:"ui-fancytree fancytree-container fancytree-plain"}).appendTo(this.$div),this.$container=n,this.rootNode.ul=n[0],null==this.options.debugLevel&&(this.options.debugLevel=i.debugLevel)}e.ui.fancytree.warn("Fancytree: ignored duplicate include")},void 0===(r="function"==typeof i?i.apply(t,s):i)||(e.exports=r)},1503:function(e,t,n){var i,s,r;s=[n(1669)],i=function(e){e.ui=e.ui||{},e.ui.version="1.12.1";var t,n,i=0,s=Array.prototype.slice;e.cleanData=e.cleanData||(t=e.cleanData,function(n){var i,s,r;for(r=0;null!=(s=n[r]);r++)try{(i=e._data(s,"events"))&&i.remove&&e(s).triggerHandler("remove")}catch(e){}t(n)}),e.widget=e.widget||function(t,n,i){var s,r,o,a={},u=t.split(".")[0],l=u+"-"+(t=t.split(".")[1]);return i||(i=n,n=e.Widget),e.isArray(i)&&(i=e.extend.apply(null,[{}].concat(i))),e.expr[":"][l.toLowerCase()]=function(t){return!!e.data(t,l)},e[u]=e[u]||{},s=e[u][t],r=e[u][t]=function(e,t){if(!this._createWidget)return new r(e,t);arguments.length&&this._createWidget(e,t)},e.extend(r,s,{version:i.version,_proto:e.extend({},i),_childConstructors:[]}),(o=new n).options=e.widget.extend({},o.options),e.each(i,function(t,i){e.isFunction(i)?a[t]=function(){function e(){return n.prototype[t].apply(this,arguments)}function s(e){return n.prototype[t].apply(this,e)}return function(){var t,n=this._super,r=this._superApply;return this._super=e,this._superApply=s,t=i.apply(this,arguments),this._super=n,this._superApply=r,t}}():a[t]=i}),r.prototype=e.widget.extend(o,{widgetEventPrefix:s&&o.widgetEventPrefix||t},a,{constructor:r,namespace:u,widgetName:t,widgetFullName:l}),s?(e.each(s._childConstructors,function(t,n){var i=n.prototype;e.widget(i.namespace+"."+i.widgetName,r,n._proto)}),delete s._childConstructors):n._childConstructors.push(r),e.widget.bridge(t,r),r},e.widget.extend=function(t){for(var n,i,r=s.call(arguments,1),o=0,a=r.length;o<a;o++)for(n in r[o])i=r[o][n],r[o].hasOwnProperty(n)&&void 0!==i&&(e.isPlainObject(i)?t[n]=e.isPlainObject(t[n])?e.widget.extend({},t[n],i):e.widget.extend({},i):t[n]=i);return t},e.widget.bridge=function(t,n){var i=n.prototype.widgetFullName||t;e.fn[t]=function(r){var o="string"==typeof r,a=s.call(arguments,1),u=this;return o?this.length||"instance"!==r?this.each(function(){var n,s=e.data(this,i);return"instance"===r?(u=s,!1):s?e.isFunction(s[r])&&"_"!==r.charAt(0)?(n=s[r].apply(s,a))!==s&&void 0!==n?(u=n&&n.jquery?u.pushStack(n.get()):n,!1):void 0:e.error("no such method '"+r+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+r+"'")}):u=void 0:(a.length&&(r=e.widget.extend.apply(null,[r].concat(a))),this.each(function(){var t=e.data(this,i);t?(t.option(r||{}),t._init&&t._init()):e.data(this,i,new n(r,this))})),u}},e.Widget=e.Widget||function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},n!==this&&(e.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===n&&this.destroy()}}),this.document=e(n.style?n.ownerDocument:n.document||n),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,n){t._removeClass(n,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,n){var i,s,r,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},i=t.split("."),t=i.shift(),i.length){for(s=o[t]=e.widget.extend({},this.options[t]),r=0;r<i.length-1;r++)s[i[r]]=s[i[r]]||{},s=s[i[r]];if(t=i.pop(),1===arguments.length)return void 0===s[t]?null:s[t];s[t]=n}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=n}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return"classes"===e&&this._setOptionClasses(t),this.options[e]=t,"disabled"===e&&this._setOptionDisabled(t),this},_setOptionClasses:function(t){var n,i,s;for(n in t)s=this.classesElementLookup[n],t[n]!==this.options.classes[n]&&s&&s.length&&(i=e(s.get()),this._removeClass(s,n),i.addClass(this._classes({element:i,keys:n,classes:t,add:!0})))},_setOptionDisabled:function(e){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!e),e&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(t){var n=[],i=this;function s(s,r){var o,a;for(a=0;a<s.length;a++)o=i.classesElementLookup[s[a]]||e(),o=t.add?e(e.unique(o.get().concat(t.element.get()))):e(o.not(t.element).get()),i.classesElementLookup[s[a]]=o,n.push(s[a]),r&&t.classes[s[a]]&&n.push(t.classes[s[a]])}return t=e.extend({element:this.element,classes:this.options.classes||{}},t),this._on(t.element,{remove:"_untrackClassesElement"}),t.keys&&s(t.keys.match(/\S+/g)||[],!0),t.extra&&s(t.extra.match(/\S+/g)||[]),n.join(" ")},_untrackClassesElement:function(t){var n=this;e.each(n.classesElementLookup,function(i,s){-1!==e.inArray(t.target,s)&&(n.classesElementLookup[i]=e(s.not(t.target).get()))})},_removeClass:function(e,t,n){return this._toggleClass(e,t,n,!1)},_addClass:function(e,t,n){return this._toggleClass(e,t,n,!0)},_toggleClass:function(e,t,n,i){i="boolean"==typeof i?i:n;var s="string"==typeof e||null===e,r={extra:s?t:n,keys:s?e:t,element:s?this.element:e,add:i};return r.element.toggleClass(this._classes(r),i),this},_on:function(t,n,i){var s,r=this;"boolean"!=typeof t&&(i=n,n=t,t=!1),i?(n=s=e(n),this.bindings=this.bindings.add(n)):(i=n,n=this.element,s=this.widget()),e.each(i,function(i,o){function a(){if(t||!0!==r.options.disabled&&!e(this).hasClass("ui-state-disabled"))return("string"==typeof o?r[o]:o).apply(r,arguments)}"string"!=typeof o&&(a.guid=o.guid=o.guid||a.guid||e.guid++);var u=i.match(/^([\w:-]*)\s*(.*)$/),l=u[1]+r.eventNamespace,c=u[2];c?s.on(l,c,a):n.on(l,a)})},_off:function(t,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(n).off(n),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function n(){return("string"==typeof e?i[e]:e).apply(i,arguments)}var i=this;return setTimeout(n,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(e(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(e(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,n,i){var s,r,o=this.options[t];if(i=i||{},(n=e.Event(n)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],r=n.originalEvent)for(s in r)s in n||(n[s]=r[s]);return this.element.trigger(n,i),!(e.isFunction(o)&&!1===o.apply(this.element[0],[n].concat(i))||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(i,s,r){var o;"string"==typeof s&&(s={effect:s});var a=s?!0===s||"number"==typeof s?n:s.effect||n:t;"number"==typeof(s=s||{})&&(s={duration:s}),o=!e.isEmptyObject(s),s.complete=r,s.delay&&i.delay(s.delay),o&&e.effects&&e.effects.effect[a]?i[t](s):a!==t&&i[a]?i[a](s.duration,s.easing,r):i.queue(function(n){e(this)[t](),r&&r.call(i[0]),n()})}}),e.widget,function(){var t,n=Math.max,i=Math.abs,s=/left|center|right/,r=/top|center|bottom/,o=/[\+\-]\d+(\.[\d]+)?%?/,a=/^\w+/,u=/%$/,l=e.fn.position;function c(e,t,n){return[parseFloat(e[0])*(u.test(e[0])?t/100:1),parseFloat(e[1])*(u.test(e[1])?n/100:1)]}function d(t,n){return parseInt(e.css(t,n),10)||0}function h(t){var n=t[0];return 9===n.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(n)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:n.preventDefault?{width:0,height:0,offset:{top:n.pageY,left:n.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.position=e.position||{scrollbarWidth:function(){if(void 0!==t)return t;var n,i,s=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),r=s.children()[0];return e("body").append(s),n=r.offsetWidth,s.css("overflow","scroll"),n===(i=r.offsetWidth)&&(i=s[0].clientWidth),s.remove(),t=n-i},getScrollInfo:function(t){var n=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),s="scroll"===n||"auto"===n&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?e.position.scrollbarWidth():0,height:s?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var n=e(t||window),i=e.isWindow(n[0]),s=!!n[0]&&9===n[0].nodeType;return{element:n,isWindow:i,isDocument:s,offset:i||s?{left:0,top:0}:e(t).offset(),scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:n.outerWidth(),height:n.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return l.apply(this,arguments);t=e.extend({},t);var u,p,f,m,v,g,y=e(t.of),b=e.position.getWithinInfo(t.within),w=e.position.getScrollInfo(b),_=(t.collision||"flip").split(" "),k={};return g=h(y),y[0].preventDefault&&(t.at="left top"),p=g.width,f=g.height,m=g.offset,v=e.extend({},m),e.each(["my","at"],function(){var e,n,i=(t[this]||"").split(" ");1===i.length&&(i=s.test(i[0])?i.concat(["center"]):r.test(i[0])?["center"].concat(i):["center","center"]),i[0]=s.test(i[0])?i[0]:"center",i[1]=r.test(i[1])?i[1]:"center",e=o.exec(i[0]),n=o.exec(i[1]),k[this]=[e?e[0]:0,n?n[0]:0],t[this]=[a.exec(i[0])[0],a.exec(i[1])[0]]}),1===_.length&&(_[1]=_[0]),"right"===t.at[0]?v.left+=p:"center"===t.at[0]&&(v.left+=p/2),"bottom"===t.at[1]?v.top+=f:"center"===t.at[1]&&(v.top+=f/2),u=c(k.at,p,f),v.left+=u[0],v.top+=u[1],this.each(function(){var s,r,o=e(this),a=o.outerWidth(),l=o.outerHeight(),h=d(this,"marginLeft"),g=d(this,"marginTop"),S=a+h+d(this,"marginRight")+w.width,x=l+g+d(this,"marginBottom")+w.height,C=e.extend({},v),E=c(k.my,o.outerWidth(),o.outerHeight());"right"===t.my[0]?C.left-=a:"center"===t.my[0]&&(C.left-=a/2),"bottom"===t.my[1]?C.top-=l:"center"===t.my[1]&&(C.top-=l/2),C.left+=E[0],C.top+=E[1],s={marginLeft:h,marginTop:g},e.each(["left","top"],function(n,i){e.ui.position[_[n]]&&e.ui.position[_[n]][i](C,{targetWidth:p,targetHeight:f,elemWidth:a,elemHeight:l,collisionPosition:s,collisionWidth:S,collisionHeight:x,offset:[u[0]+E[0],u[1]+E[1]],my:t.my,at:t.at,within:b,elem:o})}),t.using&&(r=function(e){var s=m.left-C.left,r=s+p-a,u=m.top-C.top,c=u+f-l,d={target:{element:y,left:m.left,top:m.top,width:p,height:f},element:{element:o,left:C.left,top:C.top,width:a,height:l},horizontal:r<0?"left":s>0?"right":"center",vertical:c<0?"top":u>0?"bottom":"middle"};p<a&&i(s+r)<p&&(d.horizontal="center"),f<l&&i(u+c)<f&&(d.vertical="middle"),n(i(s),i(r))>n(i(u),i(c))?d.important="horizontal":d.important="vertical",t.using.call(this,e,d)}),o.offset(e.extend(C,{using:r}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,r=s.isWindow?s.scrollLeft:s.offset.left,o=s.width,a=e.left-t.collisionPosition.marginLeft,u=r-a,l=a+t.collisionWidth-o-r;t.collisionWidth>o?u>0&&l<=0?(i=e.left+u+t.collisionWidth-o-r,e.left+=u-i):e.left=l>0&&u<=0?r:u>l?r+o-t.collisionWidth:r:u>0?e.left+=u:l>0?e.left-=l:e.left=n(e.left-a,e.left)},top:function(e,t){var i,s=t.within,r=s.isWindow?s.scrollTop:s.offset.top,o=t.within.height,a=e.top-t.collisionPosition.marginTop,u=r-a,l=a+t.collisionHeight-o-r;t.collisionHeight>o?u>0&&l<=0?(i=e.top+u+t.collisionHeight-o-r,e.top+=u-i):e.top=l>0&&u<=0?r:u>l?r+o-t.collisionHeight:r:u>0?e.top+=u:l>0?e.top-=l:e.top=n(e.top-a,e.top)}},flip:{left:function(e,t){var n,s,r=t.within,o=r.offset.left+r.scrollLeft,a=r.width,u=r.isWindow?r.scrollLeft:r.offset.left,l=e.left-t.collisionPosition.marginLeft,c=l-u,d=l+t.collisionWidth-a-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,f=-2*t.offset[0];c<0?((n=e.left+h+p+f+t.collisionWidth-a-o)<0||n<i(c))&&(e.left+=h+p+f):d>0&&((s=e.left-t.collisionPosition.marginLeft+h+p+f-u)>0||i(s)<d)&&(e.left+=h+p+f)},top:function(e,t){var n,s,r=t.within,o=r.offset.top+r.scrollTop,a=r.height,u=r.isWindow?r.scrollTop:r.offset.top,l=e.top-t.collisionPosition.marginTop,c=l-u,d=l+t.collisionHeight-a-u,h="top"===t.my[1]?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,p="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,f=-2*t.offset[1];c<0?((s=e.top+h+p+f+t.collisionHeight-a-o)<0||s<i(c))&&(e.top+=h+p+f):d>0&&((n=e.top-t.collisionPosition.marginTop+h+p+f-u)>0||i(n)<d)&&(e.top+=h+p+f)}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}}}(),e.ui.position,e.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},e.fn.scrollParent=function(t){var n=this.css("position"),i="absolute"===n,s=t?/(auto|scroll|hidden)/:/(auto|scroll)/,r=this.parents().filter(function(){var t=e(this);return(!i||"static"!==t.css("position"))&&s.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==n&&r.length?r:e(this[0].ownerDocument||document)},e.fn.extend({uniqueId:(n=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}})},void 0===(r="function"==typeof i?i.apply(t,s):i)||(e.exports=r)},1873:function(e,t,n){var i=n(9325).Symbol;e.exports=i},1033:function(e){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},695:function(e,t,n){var i=n(8096),s=n(2428),r=n(6449),o=n(3656),a=n(361),u=n(7167),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=r(e),c=!n&&s(e),d=!n&&!c&&o(e),h=!n&&!c&&!d&&u(e),p=n||c||d||h,f=p?i(e.length,String):[],m=f.length;for(var v in e)!t&&!l.call(e,v)||p&&("length"==v||d&&("offset"==v||"parent"==v)||h&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||a(v,m))||f.push(v);return f}},6547:function(e,t,n){var i=n(3360),s=n(5288),r=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var o=e[t];r.call(e,t)&&s(o,n)&&(void 0!==n||t in e)||i(e,t,n)}},3360:function(e,t,n){var i=n(3243);e.exports=function(e,t,n){"__proto__"==t&&i?i(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},2552:function(e,t,n){var i=n(1873),s=n(659),r=n(9350),o=i?i.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?s(e):r(e)}},7534:function(e,t,n){var i=n(2552),s=n(346);e.exports=function(e){return s(e)&&"[object Arguments]"==i(e)}},5083:function(e,t,n){var i=n(1882),s=n(7296),r=n(3805),o=n(7473),a=/^\[object .+?Constructor\]$/,u=Function.prototype,l=Object.prototype,c=u.toString,d=l.hasOwnProperty,h=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!r(e)||s(e))&&(i(e)?h:a).test(o(e))}},4901:function(e,t,n){var i=n(2552),s=n(294),r=n(346),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,e.exports=function(e){return r(e)&&s(e.length)&&!!o[i(e)]}},8984:function(e,t,n){var i=n(5527),s=n(3650),r=Object.prototype.hasOwnProperty;e.exports=function(e){if(!i(e))return s(e);var t=[];for(var n in Object(e))r.call(e,n)&&"constructor"!=n&&t.push(n);return t}},9302:function(e,t,n){var i=n(3488),s=n(6757),r=n(2865);e.exports=function(e,t){return r(s(e,t,i),e+"")}},9570:function(e,t,n){var i=n(7334),s=n(3243),r=n(3488),o=s?function(e,t){return s(e,"toString",{configurable:!0,enumerable:!1,value:i(t),writable:!0})}:r;e.exports=o},8096:function(e){e.exports=function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}},7301:function(e){e.exports=function(e){return function(t){return e(t)}}},1791:function(e,t,n){var i=n(6547),s=n(3360);e.exports=function(e,t,n,r){var o=!n;n||(n={});for(var a=-1,u=t.length;++a<u;){var l=t[a],c=r?r(n[l],e[l],l,n,e):void 0;void 0===c&&(c=e[l]),o?s(n,l,c):i(n,l,c)}return n}},5481:function(e,t,n){var i=n(9325)["__core-js_shared__"];e.exports=i},999:function(e,t,n){var i=n(9302),s=n(6800);e.exports=function(e){return i(function(t,n){var i=-1,r=n.length,o=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(r--,o):void 0,a&&s(n[0],n[1],a)&&(o=r<3?void 0:o,r=1),t=Object(t);++i<r;){var u=n[i];u&&e(t,u,i,o)}return t})}},3243:function(e,t,n){var i=n(6110),s=function(){try{var e=i(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=s},4840:function(e,t,n){var i="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=i},6110:function(e,t,n){var i=n(5083),s=n(392);e.exports=function(e,t){var n=s(e,t);return i(n)?n:void 0}},659:function(e,t,n){var i=n(1873),s=Object.prototype,r=s.hasOwnProperty,o=s.toString,a=i?i.toStringTag:void 0;e.exports=function(e){var t=r.call(e,a),n=e[a];try{e[a]=void 0;var i=!0}catch(e){}var s=o.call(e);return i&&(t?e[a]=n:delete e[a]),s}},392:function(e){e.exports=function(e,t){return null==e?void 0:e[t]}},361:function(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var i=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==i||"symbol"!=i&&t.test(e))&&e>-1&&e%1==0&&e<n}},6800:function(e,t,n){var i=n(5288),s=n(4894),r=n(361),o=n(3805);e.exports=function(e,t,n){if(!o(n))return!1;var a=typeof t;return!!("number"==a?s(n)&&r(t,n.length):"string"==a&&t in n)&&i(n[t],e)}},7296:function(e,t,n){var i,s=n(5481),r=(i=/[^.]+$/.exec(s&&s.keys&&s.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"";e.exports=function(e){return!!r&&r in e}},5527:function(e){var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},3650:function(e,t,n){var i=n(4335)(Object.keys,Object);e.exports=i},6009:function(e,t,n){e=n.nmd(e);var i=n(4840),s=t&&!t.nodeType&&t,r=s&&e&&!e.nodeType&&e,o=r&&r.exports===s&&i.process,a=function(){try{var e=r&&r.require&&r.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a},9350:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},6757:function(e,t,n){var i=n(1033),s=Math.max;e.exports=function(e,t,n){return t=s(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,a=s(r.length-t,0),u=Array(a);++o<a;)u[o]=r[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=r[o];return l[t]=n(u),i(e,this,l)}}},9325:function(e,t,n){var i=n(4840),s="object"==typeof self&&self&&self.Object===Object&&self,r=i||s||Function("return this")();e.exports=r},2865:function(e,t,n){var i=n(9570),s=n(1811)(i);e.exports=s},1811:function(e){var t=Date.now;e.exports=function(e){var n=0,i=0;return function(){var s=t(),r=16-(s-i);if(i=s,r>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},7473:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},6139:function(e,t,n){var i=n(6547),s=n(1791),r=n(999),o=n(4894),a=n(5527),u=n(5950),l=Object.prototype.hasOwnProperty,c=r(function(e,t){if(a(t)||o(t))s(t,u(t),e);else for(var n in t)l.call(t,n)&&i(e,n,t[n])});e.exports=c},7334:function(e){e.exports=function(e){return function(){return e}}},5288:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},3488:function(e){e.exports=function(e){return e}},2428:function(e,t,n){var i=n(7534),s=n(346),r=Object.prototype,o=r.hasOwnProperty,a=r.propertyIsEnumerable,u=i(function(){return arguments}())?i:function(e){return s(e)&&o.call(e,"callee")&&!a.call(e,"callee")};e.exports=u},6449:function(e){var t=Array.isArray;e.exports=t},4894:function(e,t,n){var i=n(1882),s=n(294);e.exports=function(e){return null!=e&&s(e.length)&&!i(e)}},3656:function(e,t,n){e=n.nmd(e);var i=n(9325),s=n(9935),r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,a=o&&o.exports===r?i.Buffer:void 0,u=(a?a.isBuffer:void 0)||s;e.exports=u},1882:function(e,t,n){var i=n(2552),s=n(3805);e.exports=function(e){if(!s(e))return!1;var t=i(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3805:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},7167:function(e,t,n){var i=n(4901),s=n(7301),r=n(6009),o=r&&r.isTypedArray,a=o?s(o):i;e.exports=a},5950:function(e,t,n){var i=n(695),s=n(8984),r=n(4894);e.exports=function(e){return r(e)?i(e):s(e)}},9935:function(e){e.exports=function(){return!1}},1669:function(e){"use strict";e.exports=jQuery}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var r=t[i]={id:i,loaded:!1,exports:{}};return e[i](r,r.exports,n),r.loaded=!0,r.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){"use strict";var e=e||{};window.WP_Smush=e,String.prototype.includes||(String.prototype.includes=function(e,t){return"number"!=typeof t&&(t=0),!(t+e.length>this.length)&&-1!==this.indexOf(e,t)}),n(770),n(990),n(596),n(8686),n(9738),n(4726),n(2339),n(234),n(5557),n(5994),n(8847),n(9968),n(8945),n(3368),n(7811)}()}();
//# sourceMappingURL=smush-admin.min.js.map