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S,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,KACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MAaTA,EAAS,K","sources":["webpack://wp-smushit/./_src/js/common/globalStats.js","webpack://wp-smushit/./_src/js/common/media-library-scanner.js","webpack://wp-smushit/./_src/js/common/progressbar.js","webpack://wp-smushit/./_src/js/loopback-tester.js","webpack://wp-smushit/./_src/js/modules/admin-common.js","webpack://wp-smushit/./_src/js/modules/admin.js","webpack://wp-smushit/./_src/js/modules/background-process.js","webpack://wp-smushit/./_src/js/modules/bulk-restore.js","webpack://wp-smushit/./_src/js/modules/bulk-smush.js","webpack://wp-smushit/./_src/js/modules/directory-smush.js","webpack://wp-smushit/./_src/js/smush/directory-scanner.js","webpack://wp-smushit/./_src/js/modules/helpers.js","webpack://wp-smushit/./_src/js/modules/media-library-scanner-on-bulk-smush.js","webpack://wp-smushit/./_src/js/modules/media-library-scanner-on-dashboard.js","webpack://wp-smushit/./_src/js/modules/nextgen-bulk.js","webpack://wp-smushit/./_src/js/modules/notice.js","webpack://wp-smushit/./_src/js/modules/onboarding.js","webpack://wp-smushit/./_src/js/smush/cdn.js","webpack://wp-smushit/./_src/js/smush/lazy-load.js","webpack://wp-smushit/./_src/js/smush/product-analytics.js","webpack://wp-smushit/./_src/js/smush/settings.js","webpack://wp-smushit/./_src/js/smush/smush.js","webpack://wp-smushit/./_src/js/smush/webp.js","webpack://wp-smushit/./_src/js/utils/fetcher.js","webpack://wp-smushit/./_src/js/utils/tracker.js","webpack://wp-smushit/./node_modules/jquery.fancytree/dist/modules/jquery.fancytree.js","webpack://wp-smushit/./node_modules/jquery.fancytree/dist/modules/jquery.fancytree.ui-deps.js","webpack://wp-smushit/./node_modules/lodash/_Symbol.js","webpack://wp-smushit/./node_modules/lodash/_apply.js","webpack://wp-smushit/./node_modules/lodash/_arrayLikeKeys.js","webpack://wp-smushit/./node_modules/lodash/_assignValue.js","webpack://wp-smushit/./node_modules/lodash/_baseAssignValue.js","webpack://wp-smushit/./node_modules/lodash/_baseGetTag.js","webpack://wp-smushit/./node_modules/lodash/_baseIsArguments.js","webpack://wp-smushit/./node_modules/lodash/_baseIsNative.js","webpack://wp-smushit/./node_modules/lodash/_baseIsTypedArray.js","webpack://wp-smushit/./node_modules/lodash/_baseKeys.js","webpack://wp-smushit/./node_modules/lodash/_baseRest.js","webpack://wp-smushit/./node_modules/lodash/_baseSetToString.js","webpack://wp-smushit/./node_modules/lodash/_baseTimes.js","webpack://wp-smushit/./node_modules/lodash/_baseUnary.js","webpack://wp-smushit/./node_modules/lodash/_copyObject.js","webpack://wp-smushit/./node_modules/lodash/_coreJsData.js","webpack://wp-smushit/./node_modules/lodash/_createAssigner.js","webpack://wp-smushit/./node_modules/lodash/_defineProperty.js","webpack://wp-smushit/./node_modules/lodash/_freeGlobal.js","webpack://wp-smushit/./node_modules/lodash/_getNative.js","webpack://wp-smushit/./node_modules/lodash/_getRawTag.js","webpack://wp-smushit/./node_modules/lodash/_getValue.js","webpack://wp-smushit/./node_modules/lodash/_isIndex.js","webpack://wp-smushit/./node_modules/lodash/_isIterateeCall.js","webpack://wp-smushit/./node_modules/lodash/_isMasked.js","webpack://wp-smushit/./node_modules/lodash/_isPrototype.js","webpack://wp-smushit/./node_modules/lodash/_nativeKeys.js","webpack://wp-smushit/./node_modules/lodash/_nodeUtil.js","webpack://wp-smushit/./node_modules/lodash/_objectToString.js","webpack://wp-smushit/./node_modules/lodash/_overArg.js","webpack://wp-smushit/./node_modules/lodash/_overRest.js","webpack://wp-smushit/./node_modules/lodash/_root.js","webpack://wp-smushit/./node_modules/lodash/_setToString.js","webpack://wp-smushit/./node_modules/lodash/_shortOut.js","webpack://wp-smushit/./node_modules/lodash/_toSource.js","webpack://wp-smushit/./node_modules/lodash/assign.js","webpack://wp-smushit/./node_modules/lodash/constant.js","webpack://wp-smushit/./node_modules/lodash/eq.js","webpack://wp-smushit/./node_modules/lodash/identity.js","webpack://wp-smushit/./node_modules/lodash/isArguments.js","webpack://wp-smushit/./node_modules/lodash/isArray.js","webpack://wp-smushit/./node_modules/lodash/isArrayLike.js","webpack://wp-smushit/./node_modules/lodash/isBuffer.js","webpack://wp-smushit/./node_modules/lodash/isFunction.js","webpack://wp-smushit/./node_modules/lodash/isLength.js","webpack://wp-smushit/./node_modules/lodash/isObject.js","webpack://wp-smushit/./node_modules/lodash/isObjectLike.js","webpack://wp-smushit/./node_modules/lodash/isTypedArray.js","webpack://wp-smushit/./node_modules/lodash/keys.js","webpack://wp-smushit/./node_modules/lodash/stubFalse.js","webpack://wp-smushit/external var \"jQuery\"","webpack://wp-smushit/webpack/bootstrap","webpack://wp-smushit/webpack/runtime/compat get default export","webpack://wp-smushit/webpack/runtime/define property getters","webpack://wp-smushit/webpack/runtime/global","webpack://wp-smushit/webpack/runtime/hasOwnProperty shorthand","webpack://wp-smushit/webpack/runtime/make namespace object","webpack://wp-smushit/webpack/runtime/node module decorator","webpack://wp-smushit/./_src/js/app.js"],"sourcesContent":["/* global WP_Smush */\nexport const UpsellManger = ( () => {\n\treturn {\n\t\tmaybeShowCDNActivationNotice() {\n\t\t\tif ( ! wp_smush_msgs.smush_cdn_activation_notice ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tWP_Smush.helpers.renderActivationCDNNotice( wp_smush_msgs.smush_cdn_activation_notice );\n\t\t},\n\t\tmaybeShowCDNUpsellForPreSiteOnStart() {\n\t\t\tconst upsellCdn = document.querySelector( '.wp-smush-upsell-cdn' );\n\t\t\tif ( upsellCdn ) {\n\t\t\t\tupsellCdn.querySelector( 'p' ).innerHTML = wp_smush_msgs.processing_cdn_for_free;\n\t\t\t\tupsellCdn.classList.remove( 'sui-hidden' );\n\t\t\t}\n\t\t},\n\t\tmaybeShowCDNUpsellForPreSiteOnCompleted() {\n\t\t\tconst upsellCdn = document.querySelector( '.wp-smush-upsell-cdn' );\n\t\t\tif ( upsellCdn ) {\n\t\t\t\tupsellCdn.querySelector( 'p' ).innerHTML = wp_smush_msgs.processed_cdn_for_free;\n\t\t\t\tupsellCdn.classList.remove( 'sui-hidden' );\n\t\t\t}\n\t\t}\n\t};\n} )();\nexport const GlobalStats = ( () => {\n\tconst $ = document.querySelector.bind( document );\n\tconst summarySmush = $( '.sui-summary-smush-metabox' );\n\tif ( ! summarySmush ) {\n\t\treturn {};\n\t}\n\t// Cache initial stats.\n\tlet boStats = window.wp_smushit_data.bo_stats;\n\tlet globalStats = {\n\t\tcount_images: 0,\n\t\tcount_total: 0,\n\t\tcount_resize: 0,\n\t\tcount_skipped: 0,\n\t\tcount_smushed: 0,\n\t\tsavings_bytes: 0,\n\t\tsavings_resize: 0,\n\t\tsize_after: 0,\n\t\tsize_before: 0,\n\t\tsavings_percent: 0,\n\t\tpercent_grade: 'sui-grade-dismissed',\n\t\tpercent_metric: 0,\n\t\tpercent_optimized: 0,\n\t\tremaining_count: 0,\n\t\thuman_bytes: '',\n\t\tsavings_conversion_human: '',\n\t\tsavings_conversion: 0,\n\t};\n\n\tconst imageScore = $( '#smush-image-score' );\n\tconst logBulk = $( '.smush-final-log .smush-bulk-errors' );\n\tconst bulkSmushCountContent = $( '#wp-smush-bulk-content' );\n\tlet allErrors = {};\n\n\tconst generateGlobalStatsFromSmushData = ( smushScriptData ) => {\n\t\twindow.wp_smushit_data = Object.assign( window.wp_smushit_data, smushScriptData || {} );\n\t\tglobalStats = Object.keys( globalStats ).reduce( function( newStats, key ) {\n\t\t\tif ( key in window.wp_smushit_data ) {\n\t\t\t\tnewStats[ key ] = window.wp_smushit_data[ key ];\n\t\t\t}\n\t\t\treturn newStats;\n\t\t}, {} );\n\t}\n\n\tgenerateGlobalStatsFromSmushData( window.wp_smushit_data );\n\n\treturn {\n\t\tisChangedStats( newBoStats ) {\n\t\t\tconst primaryKeys = [ 'total_items', 'processed_items', 'failed_items', 'is_cancelled', 'is_completed', 'is_dead' ];\n\t\t\treturn primaryKeys.some( ( key ) => {\n\t\t\t\treturn newBoStats[ key ] !== boStats[ key ];\n\t\t\t} );\n\t\t},\n\t\tsetBoStats( newBoStats ) {\n\t\t\tboStats = Object.assign( boStats, newBoStats || {} );\n\t\t\treturn this;\n\t\t},\n\t\tgetBoStats() {\n\t\t\treturn boStats;\n\t\t},\n\t\tsetGlobalStats( newGlobalStats ) {\n\t\t\tglobalStats = Object.assign( globalStats, newGlobalStats || {} );\n\t\t\treturn this;\n\t\t},\n\t\tgetGlobalStats() {\n\t\t\treturn globalStats;\n\t\t},\n\t\t/**\n\t\t * Circle progress bar.\n\t\t */\n\t\trenderScoreProgress() {\n\t\t\timageScore.className = imageScore.className.replace( /(^|\\s)sui-grade-\\S+/g, '' );\n\t\t\timageScore.classList.add( globalStats.percent_grade );\n\t\t\timageScore.dataset.score = globalStats.percent_optimized;\n\t\t\timageScore.querySelector( '.sui-circle-score-label' ).innerHTML = globalStats.percent_optimized;\n\n\t\t\timageScore\n\t\t\t\t.querySelector( 'circle:last-child' )\n\t\t\t\t.setAttribute( 'style', '--metric-array:' + ( 2.63893782902 * globalStats.percent_metric ) + ' ' + ( 263.893782902 - globalStats.percent_metric ) );\n\t\t},\n\t\t/**\n\t\t * Summary detail - center meta box.\n\t\t */\n\t\trenderSummaryDetail() {\n\t\t\tthis.renderTotalStats();\n\t\t\tthis.renderResizedStats();\n\t\t\tthis.renderConversionSavings();\n\t\t},\n\t\trenderTotalStats() {\n\t\t\t// Total savings.\n\t\t\tsummarySmush.querySelector( '.sui-summary-large.wp-smush-stats-human' ).innerHTML = globalStats.human_bytes;\n\t\t\t// Update the savings percent.\n\t\t\tsummarySmush.querySelector( '.wp-smush-savings .wp-smush-stats-percent' ).innerHTML = globalStats.savings_percent;\n\t\t\t// To total smushed images files.\n\t\t\tsummarySmush.querySelector( '.wp-smush-count-total .wp-smush-total-optimised' ).innerHTML = globalStats.count_images;\n\t\t},\n\t\trenderResizedStats() {\n\t\t\tconst resizeCountElement = summarySmush.querySelector( '.wp-smush-count-resize-total' );\n\t\t\tif ( ! resizeCountElement ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( globalStats.count_resize > 0 ) {\n\t\t\t\tresizeCountElement.classList.remove( 'sui-hidden' );\n\t\t\t} else {\n\t\t\t\tresizeCountElement.classList.add( 'sui-hidden' );\n\t\t\t}\n\t\t\tresizeCountElement.querySelector( '.wp-smush-total-optimised' ).innerHTML = globalStats.count_resize;\n\t\t},\n\t\trenderConversionSavings() {\n\t\t\t// PNG2JPG Savings.\n\t\t\tconst conversionSavingsElement = summarySmush.querySelector( '.smush-conversion-savings .wp-smush-stats' );\n\t\t\tif ( ! conversionSavingsElement ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconversionSavingsElement.innerHTML = globalStats.savings_conversion_human;\n\t\t\tif ( globalStats.savings_conversion > 0 ) {\n\t\t\t\tconversionSavingsElement.parentElement.classList.remove( 'sui-hidden' );\n\t\t\t} else {\n\t\t\t\tconversionSavingsElement.parentElement.classList.add( 'sui-hidden' );\n\t\t\t}\n\t\t},\n\t\trenderBoxSummary() {\n\t\t\t// Circle core progress.\n\t\t\tthis.renderScoreProgress();\n\t\t\t// Summary detail.\n\t\t\tthis.renderSummaryDetail();\n\t\t},\n\t\tsetErrors( newErrors ) {\n\t\t\tallErrors = newErrors || {};\n\t\t},\n\t\tgetErrors() {\n\t\t\treturn allErrors;\n\t\t},\n\t\trenderErrors() {\n\t\t\tif ( ! Object.keys( allErrors ).length || ! boStats.is_completed ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst errors = [];\n\t\t\tconst errorKeys = Object.keys( allErrors );\n\t\t\t// Cache error code to avoid double upsell notice.\n\t\t\tlet showAnimatedUpsell = false;\n\t\t\terrorKeys.map( ( image_id, index ) => {\n\t\t\t\tconst upsellErrorCode = allErrors[ image_id ].error_code;\n\t\t\t\tif ( index < 5 && 'animated' === upsellErrorCode ) {\n\t\t\t\t\tshowAnimatedUpsell = true;\n\t\t\t\t}\n\t\t\t\terrors.push( WP_Smush.helpers.prepareBulkSmushErrorRow(\n\t\t\t\t\tallErrors[ image_id ].error_message,\n\t\t\t\t\tallErrors[ image_id ].file_name,\n\t\t\t\t\tallErrors[ image_id ].thumbnail,\n\t\t\t\t\timage_id,\n\t\t\t\t\t'media',\n\t\t\t\t\tallErrors[ image_id ].error_code,\n\t\t\t\t) );\n\t\t\t}\n\t\t\t);\n\t\t\tlogBulk.innerHTML = errors.join( '' );\n\t\t\tlogBulk.parentElement.classList.remove( 'sui-hidden' );\n\t\t\tlogBulk.parentElement.style.display = null;\n\t\t\t// Show view all.\n\t\t\tif ( errorKeys.length > 1 ) {\n\t\t\t\t$( '.smush-bulk-errors-actions' ).classList.remove( 'sui-hidden' );\n\t\t\t}\n\n\t\t\t// Show animated upsell CDN if user disabled CDN and found an animated error in first 5 errors.\n\t\t\tif ( showAnimatedUpsell ) {\n\t\t\t\tUpsellManger.maybeShowCDNActivationNotice();\n\t\t\t}\n\t\t},\n\t\tresetAndHideBulkErrors() {\n\t\t\tif ( ! logBulk ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.resetErrors();\n\t\t\tlogBulk.parentElement.classList.add( 'sui-hidden' );\n\t\t\tlogBulk.innerHTML = '';\n\t\t},\n\t\tresetErrors() {\n\t\t\tallErrors = {};\n\t\t},\n\t\trenderStats() {\n\t\t\t// Render Smush box summary.\n\t\t\tthis.renderBoxSummary();\n\t\t\t// Render Errors.\n\t\t\tthis.renderErrors();\n\t\t},\n\t\tmaybeUpdateBulkSmushCountContent( newContent ) {\n\t\t\tif ( newContent && bulkSmushCountContent ) {\n\t\t\t\tbulkSmushCountContent.innerHTML = newContent;\n\t\t\t}\n\t\t},\n\t\tupdateGlobalStatsFromSmushScriptData( smushScriptData ) {\n\t\t\tthis.maybeUpdateBulkSmushCountContent( smushScriptData?.content );\n\t\t\tgenerateGlobalStatsFromSmushData( smushScriptData );\n\t\t\treturn this;\n\t\t},\n\t};\n} )();\n","/* global WP_Smush */\n\n/**\n * Abstract Media Library Scanner.\n *\n */\nimport Fetcher from '../utils/fetcher';\nimport { scanProgressBar } from './progressbar';\nimport { GlobalStats } from './globalStats';\nimport loopbackTester from '../loopback-tester';\nconst { __ } = wp.i18n;\nexport default class MediaLibraryScanner {\n\tconstructor() {\n\t\tthis.autoSyncDuration = 1500;\n\t\tthis.progressTimeoutId = 0;\n\t\tthis.scanProgress = scanProgressBar( this.autoSyncDuration );\n\t}\n\n\tstartScan( optimizeOnScanCompleted = false ) {\n\t\tthis.onStart();\n\t\tconst processType = optimizeOnScanCompleted ? 'smush' : 'scan';\n\t\tloopbackTester.performTest().then( ( res ) => {\n\t\t\tconst isLoopbackHealthy = res?.loopback;\n\t\t\tif ( isLoopbackHealthy ) {\n\t\t\t\tFetcher.scanMediaLibrary.start( optimizeOnScanCompleted ).then( ( response ) => {\n\t\t\t\t\tif ( ! response?.success ) {\n\t\t\t\t\t\tthis.showFailureNotice( response );\n\t\t\t\t\t\tthis.onStartFailure( response );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis.showProgressBar().autoSyncStatus();\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tthis.showLoopbackErrorModal( processType );\n\t\t\t\tthis.onStartFailure( res );\n\t\t\t}\n\t\t} ).catch( ( error ) => {\n\t\t\tconsole.error( 'Error:', error );\n\t\t\tthis.showLoopbackErrorModal( processType );\n\t\t\tthis.onStartFailure( error );\n\t\t} );\n\t}\n\n\tonStart() {\n\t\t// Do nothing at the moment.\n\t}\n\n\tonStartFailure( response ) {\n\t\t// Do nothing at the moment.\n\t}\n\n\tshowFailureNotice( response ) {\n\t\tWP_Smush.helpers.showNotice( response, {\n\t\t\tshowdismiss: true,\n\t\t\tautoclose: false,\n\t\t} );\n\t}\n\n\tshowLoopbackErrorModal( processType ) {\n\t\tconst loopbackErrorModal = document.getElementById( 'smush-loopback-error-dialog' );\n\t\tif ( ! loopbackErrorModal || ! window.SUI ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Cache current process type.\n\t\tloopbackErrorModal.dataset.processType = processType || 'scan';\n\n\t\tWP_Smush.helpers.showModal( loopbackErrorModal.id );\n\t}\n\n\tshowProgressBar() {\n\t\tthis.onShowProgressBar();\n\t\tthis.scanProgress.reset().setOnCancelCallback( this.showStopScanningModal.bind( this ) ).open();\n\t\treturn this;\n\t}\n\n\tonShowProgressBar() {\n\t\t// Do nothing at the moment.\n\t}\n\n\tshowStopScanningModal() {\n\t\tif ( ! window.SUI ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.onShowStopScanningModal();\n\n\t\twindow.SUI.openModal(\n\t\t\t'smush-stop-scanning-dialog',\n\t\t\t'wpbody-content',\n\t\t\tundefined,\n\t\t\tfalse\n\t\t);\n\t}\n\n\tonShowStopScanningModal() {\n\t\tthis.registerCancelProcessEvent();\n\t}\n\n\tregisterCancelProcessEvent() {\n\t\tconst stopScanButton = document.querySelector( '.smush-stop-scanning-dialog-button' );\n\t\tif ( ! stopScanButton ) {\n\t\t\treturn;\n\t\t}\n\n\t\tstopScanButton.addEventListener( 'click', this.cancelProgress.bind( this ), { once: true } );\n\t}\n\n\tcloseStopScanningModal() {\n\t\tif ( ! window.SUI ) {\n\t\t\treturn;\n\t\t}\n\t\tconst stopScanningElement = document.querySelector( '#smush-stop-scanning-dialog' );\n\t\tconst isModalClosed = ( ! stopScanningElement ) || ! stopScanningElement.classList.contains( 'sui-content-fade-in' );\n\t\tif ( isModalClosed ) {\n\t\t\treturn;\n\t\t}\n\t\twindow.SUI.closeModal( 'smush-stop-scanning-dialog' );\n\t}\n\n\tcloseProgressBar() {\n\t\tthis.onCloseProgressBar();\n\t\tthis.scanProgress.close();\n\t}\n\n\tonCloseProgressBar() {\n\t\t// Do nothing at the moment.\n\t}\n\n\tupdateProgress( stats ) {\n\t\tconst totalItems = this.getTotalItems( stats );\n\t\tconst processedItems = this.getProcessedItems( stats );\n\n\t\treturn this.scanProgress.update( processedItems, totalItems );\n\t}\n\n\tgetProcessedItems( stats ) {\n\t\treturn stats?.processed_items || 0;\n\t}\n\n\tgetTotalItems( stats ) {\n\t\treturn stats?.total_items || 0;\n\t}\n\n\tcancelProgress() {\n\t\tthis.scanProgress.setCancelButtonOnCancelling();\n\t\treturn Fetcher.scanMediaLibrary.cancel().then( ( response ) => {\n\t\t\tif ( ! response?.success ) {\n\t\t\t\tthis.onCancelFailure( response );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.onCancelled( response.data );\n\t\t} );\n\t}\n\n\tonCancelFailure( response ) {\n\t\tWP_Smush.helpers.showNotice( response, {\n\t\t\tshowdismiss: true,\n\t\t\tautoclose: false,\n\t\t} );\n\t\tthis.scanProgress.resetCancelButtonOnFailure();\n\t}\n\n\tonDead( stats ) {\n\t\tthis.clearProgressTimeout();\n\t\tthis.closeProgressBar();\n\t\tthis.closeStopScanningModal();\n\t\tthis.showRetryScanModal();\n\t}\n\n\tshowRetryScanModal() {\n\t\tconst retryScanModalElement = document.getElementById( 'smush-retry-scan-notice' );\n\t\tif ( ! window.SUI || ! retryScanModalElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tretryScanModalElement.querySelector( '.smush-retry-scan-notice-button' ).addEventListener( 'click', ( e ) => {\n\t\t\twindow.SUI.closeModal( 'smush-retry-scan-notice' );\n\t\t\tconst recheckImagesBtn = document.querySelector( '.wp-smush-scan' );\n\t\t\tif ( ! recheckImagesBtn ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\te.preventDefault();\n\t\t\trecheckImagesBtn.click();\n\t\t}, { once: true } );\n\n\t\twindow.SUI.openModal(\n\t\t\t'smush-retry-scan-notice',\n\t\t\t'wpbody-content',\n\t\t\tundefined,\n\t\t\tfalse\n\t\t);\n\t}\n\n\tonCompleted( stats ) {\n\t\tthis.onFinish( stats );\n\t}\n\n\tonCancelled( stats ) {\n\t\tthis.onFinish( stats );\n\t}\n\n\tonFinish( stats ) {\n\t\tthis.clearProgressTimeout();\n\t\tconst globalStats = stats?.global_stats;\n\t\tthis.updateGlobalStatsAndBulkContent( globalStats );\n\t\tthis.closeProgressBar();\n\t\tthis.closeStopScanningModal();\n\t}\n\n\tclearProgressTimeout() {\n\t\tif ( this.progressTimeoutId ) {\n\t\t\tclearTimeout( this.progressTimeoutId );\n\t\t}\n\t}\n\n\tupdateGlobalStatsAndBulkContent( globalStats ) {\n\t\tif ( ! globalStats ) {\n\t\t\treturn;\n\t\t}\n\t\tGlobalStats.updateGlobalStatsFromSmushScriptData( globalStats );\n\t\tGlobalStats.renderStats();\n\t}\n\n\tgetStatus() {\n\t\treturn Fetcher.scanMediaLibrary.getScanStatus();\n\t}\n\n\tautoSyncStatus() {\n\t\tconst startTime = new Date().getTime();\n\t\tthis.getStatus().then( ( response ) => {\n\t\t\tif ( ! response?.success ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst stats = response.data;\n\n\t\t\tif ( stats.is_dead ) {\n\t\t\t\tthis.onDead( response.data );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.beforeUpdateStatus( stats );\n\n\t\t\tthis.updateProgress( stats ).then( () => {\n\t\t\t\tthis.scanProgress.increaseDurationToHaveChangeOnProgress( new Date().getTime() - startTime );\n\n\t\t\t\tconst isCompleted = stats?.is_completed;\n\t\t\t\tif ( isCompleted ) {\n\t\t\t\t\tthis.onCompleted( stats );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst isCancelled = stats?.is_cancelled;\n\t\t\t\tif ( isCancelled ) {\n\t\t\t\t\tthis.onCancelled( stats );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.progressTimeoutId = setTimeout( () => this.autoSyncStatus(), this.autoSyncDuration );\n\t\t\t} );\n\t\t} );\n\t}\n\n\tbeforeUpdateStatus() {\n\t\t// Do nothing at the moment.\n\t}\n\n\tsetInnerText( element, newText ) {\n\t\tif ( ! element ) {\n\t\t\treturn;\n\t\t}\n\t\telement.dataset.originalText = element.dataset.originalText || element.innerText.trim();\n\t\telement.innerText = newText;\n\t}\n\n\trevertInnerText( element ) {\n\t\tif ( ! element || ! element.dataset.originalText ) {\n\t\t\treturn;\n\t\t}\n\t\telement.innerText = element.dataset.originalText.trim();\n\t}\n\n\thideAnElement( element ) {\n\t\tif ( element ) {\n\t\t\telement.classList.add( 'sui-hidden' );\n\t\t}\n\t}\n\n\tshowAnElement( element ) {\n\t\tif ( element ) {\n\t\t\telement.classList.remove( 'sui-hidden' );\n\t\t}\n\t}\n}\n","/* global WP_Smush */\n\n/**\n * SmushProgressBar\n * TODO: Update progressbar for free version.\n *\n * @param autoSyncDuration\n */\nexport const scanProgressBar = ( autoSyncDuration ) => {\n\tconst { __, _n } = wp.i18n;\n\tconst scanProgressBar = document.querySelector( '.wp-smush-scan-progress-bar-wrapper' );\n\tconst percentElement = scanProgressBar.querySelector( '.wp-smush-progress-percent' );\n\tconst progressElement = scanProgressBar.querySelector( '.wp-smush-progress-inner' );\n\tconst remainingTimeElement = scanProgressBar.querySelector( '.wp-smush-remaining-time' );\n\tconst cancelBtn = scanProgressBar.querySelector( '.wp-smush-cancel-scan-progress-btn' );\n\tconst holdOnNoticeElement = scanProgressBar.querySelector( '.wp-smush-scan-hold-on-notice' );\n\tlet onCancelCallback = () => {};\n\tlet intervalProgressAnimation = 0;\n\t// It should be smaller than autoSyncDuration.\n\tconst progressTransitionDuration = autoSyncDuration - 300;//1200\n\tscanProgressBar.style.setProperty( '--progress-transition-duration', progressTransitionDuration / 1000 + 's' );\n\n\tlet prevProcessedItems = window.wp_smushit_data?.media_library_scan?.processed_items || 0;\n\tconst cacheProcessTimePerItem = [];\n\tlet durationToHaveChangeOnProgress = autoSyncDuration;\n\tlet timeLimitToShowNotice = autoSyncDuration * 10;// 15s.\n\treturn {\n\t\tupdate( processedItems, totalItems ) {\n\t\t\tthis.updateRemainingTime( processedItems, totalItems );\n\n\t\t\tlet width = ( totalItems && Math.floor( processedItems / totalItems * 100 ) ) || 0;\n\t\t\twidth = Math.min( width, 100 );\n\n\t\t\tlet currentWidth = progressElement.style.width;\n\t\t\tcurrentWidth = ( currentWidth && currentWidth.replace( '%', '' ) ) || 0;\n\t\t\tprogressElement.style.width = width + '%';\n\n\t\t\treturn this.animateProgressBar( currentWidth, width );\n\t\t},\n\t\tanimateProgressBar( currentWidth, width ) {\n\t\t\tif ( intervalProgressAnimation ) {\n\t\t\t\tclearInterval( intervalProgressAnimation );\n\t\t\t}\n\t\t\treturn new Promise( ( resolve ) => {\n\t\t\t\tconst delayTime = progressTransitionDuration / ( width - currentWidth );\n\t\t\t\tintervalProgressAnimation = setInterval( () => {\n\t\t\t\t\t// Progress bar label.\n\t\t\t\t\tpercentElement.innerHTML = currentWidth + '%';\n\t\t\t\t\tcurrentWidth++;\n\t\t\t\t\tif ( currentWidth > width ) {\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t\tclearInterval( intervalProgressAnimation );\n\t\t\t\t\t}\n\t\t\t\t}, delayTime );\n\t\t\t} );\n\t\t},\n\t\tupdateRemainingTime( processedItems, totalItems ) {\n\t\t\tif ( ! remainingTimeElement ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst processTimePerItem = this.calcProcessTimePerItem( processedItems ) || 500;\n\t\t\tconst remainingTime = processTimePerItem * ( totalItems - processedItems );\n\t\t\tremainingTimeElement.innerText = this.formatTime( remainingTime );\n\t\t},\n\t\tcalcProcessTimePerItem( processedItems ) {\n\t\t\tif ( ! processedItems ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tprevProcessedItems = prevProcessedItems <= processedItems ? prevProcessedItems : 0;\n\t\t\tif ( prevProcessedItems != processedItems ) {\n\t\t\t\tconst processTimePerItem = Math.floor( durationToHaveChangeOnProgress / ( processedItems - prevProcessedItems ) );\n\n\t\t\t\tprevProcessedItems = processedItems;\n\t\t\t\tcacheProcessTimePerItem.push( processTimePerItem );\n\t\t\t\tthis.resetDurationToHaveChangeOnProgress();\n\t\t\t} else {\n\t\t\t\tthis.increaseDurationToHaveChangeOnProgress( autoSyncDuration );\n\t\t\t}\n\n\t\t\tif ( ! cacheProcessTimePerItem.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treturn cacheProcessTimePerItem.reduce(\n\t\t\t\t( accumulator, processTime ) => accumulator + processTime, 0\n\t\t\t) / cacheProcessTimePerItem.length;\n\t\t},\n\t\tincreaseDurationToHaveChangeOnProgress( increaseTime ) {\n\t\t\tdurationToHaveChangeOnProgress += increaseTime;\n\t\t\tif ( durationToHaveChangeOnProgress > timeLimitToShowNotice ) {\n\t\t\t\tthis.showHoldOnNotice();\n\t\t\t}\n\t\t},\n\t\tshowHoldOnNotice() {\n\t\t\tholdOnNoticeElement.classList.remove( 'sui-hidden' );\n\t\t\ttimeLimitToShowNotice = 100000000;\n\t\t},\n\t\tresetHoldOnNoticeVisibility() {\n\t\t\tholdOnNoticeElement.classList.add( 'sui-hidden' );\n\t\t},\n\t\tresetDurationToHaveChangeOnProgress() {\n\t\t\tdurationToHaveChangeOnProgress = autoSyncDuration;\n\t\t},\n\t\tformatTime( totalMilliSeconds ) {\n\t\t\tconst totalSeconds = Math.floor( ( totalMilliSeconds + progressTransitionDuration ) / 1000 );\n\t\t\tconst seconds = totalSeconds % 60;\n\t\t\tconst minutes = Math.floor( totalSeconds / 60 );\n\n\t\t\tlet timeString = '';\n\t\t\tif ( minutes ) {\n\t\t\t\ttimeString += minutes + ' ' + _n( 'minute', 'minutes', minutes, 'wp-smushit' );\n\t\t\t}\n\n\t\t\ttimeString += ' ' + seconds + ' ' + _n( 'second', 'seconds', seconds, 'wp-smushit' );\n\n\t\t\treturn timeString.trim();\n\t\t},\n\t\treset() {\n\t\t\tprogressElement.style.width = '0%';\n\t\t\tpercentElement.innerHTML = '0%';\n\n\t\t\tthis.resetCancelButton();\n\t\t\tthis.resetHoldOnNoticeVisibility();\n\t\t\treturn this;\n\t\t},\n\t\topen() {\n\t\t\tcancelBtn.onclick = onCancelCallback;\n\t\t\tscanProgressBar.classList.remove( 'sui-hidden' );\n\t\t},\n\t\tclose() {\n\t\t\tscanProgressBar.classList.add( 'sui-hidden' );\n\t\t\tthis.reset();\n\t\t},\n\t\tsetOnCancelCallback( callBack ) {\n\t\t\tif ( 'function' !== typeof callBack ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonCancelCallback = callBack;\n\t\t\treturn this;\n\t\t},\n\t\tsetCancelButtonLabel( textContent ) {\n\t\t\tcancelBtn.textContent = textContent;\n\t\t\treturn this;\n\t\t},\n\t\tsetCancelButtonOnCancelling() {\n\t\t\tthis.setCancelButtonLabel( wp_smush_msgs.cancelling );\n\t\t\tthis.setOnCancelCallback( () => false );\n\t\t\tcancelBtn.setAttribute( 'disabled', true );\n\t\t},\n\t\tresetCancelButton() {\n\t\t\tthis.setOnCancelCallback( () => {} );\n\t\t\tthis.resetCancelButtonLabel();\n\t\t\tcancelBtn.removeAttribute( 'disabled' );\n\t\t},\n\t\tresetCancelButtonLabel() {\n\t\t\tthis.setCancelButtonLabel( __( 'Cancel Scan', 'wp-smushit' ) );\n\t\t},\n\t\tresetCancelButtonOnFailure() {\n\t\t\tthis.resetCancelButtonLabel();\n\t\t\tcancelBtn.removeAttribute( 'disabled' );\n\t\t}\n\t};\n};\n\nconst SmushProgressBar = () => {\n\t'use strict';\n\tconst progressBar = document.querySelector( '.wp-smush-bulk-progress-bar-wrapper' );\n\tif ( ! progressBar ) {\n\t\treturn {\n\t\t\tisEmptyObject: true,\n\t\t};\n\t}\n\tconst cancelBtn = progressBar.querySelector( '.wp-smush-cancel-btn' );\n\tconst bulkSmushDescription = document.querySelector( '.wp-smush-bulk-wrapper' );\n\tconst bulkRunningNotice = progressBar.querySelector( '#wp-smush-running-notice' );\n\tconst bulkSmushAllDone = document.querySelector( '.wp-smush-all-done' );\n\tconst stopBulkSmushModal = document.getElementById( 'smush-stop-bulk-smush-modal' );\n\tlet isStateHidden = false;\n\tlet onCancelCallback = () => {};\n\n\treturn {\n\t\t/**\n\t\t * Update progress bar.\n\t\t *\n\t\t * @param {number} processedItems\n\t\t * @param {number} totalItems\n\t\t */\n\t\tupdate( processedItems, totalItems ) {\n\t\t\tlet width = totalItems && Math.floor( processedItems / totalItems * 100 ) || 0;\n\t\t\twidth = Math.min( width, 100 );\n\n\t\t\t// Progress bar label.\n\t\t\tprogressBar.querySelector( '.wp-smush-images-percent' ).innerHTML = width + '%';\n\t\t\t// Progress bar.\n\t\t\tprogressBar.querySelector( '.wp-smush-progress-inner' ).style.width = width + '%';\n\n\t\t\t// Update processed/total.\n\t\t\tconst processStateStats = progressBar.querySelector( '.sui-progress-state-text' );\n\t\t\tprocessStateStats.firstElementChild.innerHTML = processedItems;\n\t\t\tprocessStateStats.lastElementChild.innerHTML = totalItems;\n\n\t\t\treturn this;\n\t\t},\n\t\tclose() {\n\t\t\tprogressBar.classList.add( 'sui-hidden' );\n\t\t\tthis.setCancelButtonLabel( window.wp_smush_msgs.cancel )\n\t\t\t\t.setOnCancelCallback( () => {} )\n\t\t\t\t.update( 0, 0 );\n\t\t\tthis.resetOriginalNotice();\n\t\t\tthis.closeStopBulkSmushModal();\n\t\t\treturn this;\n\t\t},\n\t\tshow() {\n\t\t\t// Show progress bar.\n\t\t\tprogressBar.classList.remove( 'sui-hidden' );\n\t\t\tcancelBtn.onclick = this.showStopBulkSmushModal.bind( this );\n\t\t\tthis.hideBulkSmushDescription();\n\t\t\tthis.hideBulkSmushAllDone();\n\t\t\tthis.hideRecheckImagesNotice();\n\t\t},\n\t\tshowStopBulkSmushModal() {\n\t\t\tif ( ! stopBulkSmushModal ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst stopBulkSmushButton = stopBulkSmushModal.querySelector( '.smush-stop-bulk-smush-button' );\n\t\t\tstopBulkSmushButton.addEventListener( 'click', onCancelCallback, { once: true } );\n\n\t\t\t// Displays the modal with the release's higlights if it exists.\n\t\t\tconst modalId = stopBulkSmushModal.id,\n\t\t\tfocusAfterClosed = 'wpbody-content',\n\t\t\tfocusWhenOpen = undefined,\n\t\t\thasOverlayMask = false,\n\t\t\tisCloseOnEsc = false,\n\t\t\tisAnimated = true;\n\n\t\t\twindow.SUI.openModal(\n\t\t\t\tmodalId,\n\t\t\t\tfocusAfterClosed,\n\t\t\t\tfocusWhenOpen,\n\t\t\t\thasOverlayMask,\n\t\t\t\tisCloseOnEsc,\n\t\t\t\tisAnimated\n\t\t\t);\n\t\t},\n\t\tcloseStopBulkSmushModal() {\n\t\t\tif ( ! window.SUI ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst isModalClosed = ( ! stopBulkSmushModal ) || ! stopBulkSmushModal.classList.contains( 'sui-content-fade-in' );\n\t\t\tif ( isModalClosed ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\twindow.SUI.closeModal( stopBulkSmushModal.id );\n\t\t},\n\t\tsetCancelButtonLabel( textContent ) {\n\t\t\tcancelBtn.textContent = textContent;\n\t\t\treturn this;\n\t\t},\n\t\tshowBulkSmushDescription() {\n\t\t\tbulkSmushDescription.classList.remove( 'sui-hidden' );\n\t\t},\n\t\thideBulkSmushDescription() {\n\t\t\tbulkSmushDescription.classList.add( 'sui-hidden' );\n\t\t},\n\t\tshowBulkSmushAllDone() {\n\t\t\tbulkSmushAllDone.classList.remove( 'sui-hidden' );\n\t\t},\n\t\thideBulkSmushAllDone() {\n\t\t\tbulkSmushAllDone.classList.add( 'sui-hidden' );\n\t\t},\n\t\thideState() {\n\t\t\tif ( isStateHidden ) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tisStateHidden = true;\n\t\t\tprogressBar.querySelector( '.sui-progress-state' ).classList.add( 'sui-hidden' );\n\t\t\treturn this;\n\t\t},\n\t\tshowState() {\n\t\t\tif ( ! isStateHidden ) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tisStateHidden = false;\n\t\t\tprogressBar.querySelector( '.sui-progress-state' ).classList.remove( 'sui-hidden' );\n\t\t\treturn this;\n\t\t},\n\t\tsetNotice( inProcessNotice ) {\n\t\t\tconst progressMessage = bulkRunningNotice.querySelector( '.sui-notice-message p' );\n\t\t\tthis.cacheOriginalNotice( progressMessage );\n\t\t\tprogressMessage.innerHTML = inProcessNotice;\n\t\t\treturn this;\n\t\t},\n\t\tcacheOriginalNotice( progressMessage ) {\n\t\t\tif ( bulkRunningNotice.dataset.progressMessage ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tbulkRunningNotice.dataset.progressMessage = progressMessage.innerHTML;\n\t\t},\n\t\tresetOriginalNotice() {\n\t\t\tif ( ! bulkRunningNotice.dataset.progressMessage ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst progressMessage = bulkRunningNotice.querySelector( '.sui-notice-message p' );\n\t\t\tprogressMessage.innerHTML = bulkRunningNotice.dataset.progressMessage;\n\t\t},\n\t\thideBulkProcessingNotice() {\n\t\t\tbulkRunningNotice.classList.add( 'sui-hidden' );\n\t\t\treturn this;\n\t\t},\n\t\tshowBulkProcessingNotice() {\n\t\t\tbulkRunningNotice.classList.remove( 'sui-hidden' );\n\t\t\treturn this;\n\t\t},\n\t\tsetCountUnitText( unitText ) {\n\t\t\tconst progressUnit = progressBar.querySelector( '.sui-progress-state-unit' );\n\t\t\tprogressUnit.innerHTML = unitText;\n\t\t},\n\t\tsetOnCancelCallback( callBack ) {\n\t\t\tif ( 'function' !== typeof callBack ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonCancelCallback = callBack;\n\t\t\treturn this;\n\t\t},\n\t\tdisableExceedLimitMode() {\n\t\t\tprogressBar.classList.remove( 'wp-smush-exceed-limit' );\n\t\t\tprogressBar.querySelector( '#bulk-smush-resume-button' ).classList.add( 'sui-hidden' );\n\t\t},\n\t\thideRecheckImagesNotice() {\n\t\t\tconst recheckImagesNoticeElement = document.querySelector( '.wp-smush-recheck-images-notice-box' );\n\t\t\tif ( recheckImagesNoticeElement ) {\n\t\t\t\trecheckImagesNoticeElement.classList.add( 'sui-hidden' );\n\t\t\t}\n\t\t}\n\n\t};\n};\nexport default new SmushProgressBar();\n","import Fetcher from './utils/fetcher';\n\nclass LoopbackTester {\n\tdelayTimeOnFailure = 5000;\n\n\tperformTest() {\n\t\treturn new Promise( ( resolve, reject ) => {\n\t\t\tthis.startTest().then( ( res ) => {\n\t\t\t\tif ( res?.success ) {\n\t\t\t\t\tthis.getResult(\n\t\t\t\t\t\tresolve,\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\t\t\tthis.getResult( resolve, reject, reject );\n\t\t\t\t\t\t\t}, this.delayTimeOnFailure );\n\t\t\t\t\t\t},\n\t\t\t\t\t\treject\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\treject( res );\n\t\t\t\t}\n\t\t\t} ).catch( ( error ) => {\n\t\t\t\treject( error );\n\t\t\t} );\n\t\t} );\n\t}\n\n\tstartTest() {\n\t\treturn Fetcher.background.backgroundHealthyCheck();\n\t}\n\n\tgetResult( successCallback, failedCallback, errorCallback ) {\n\t\treturn this.fetchResult().then( ( status ) => {\n\t\t\tlet data = status?.data;\n\t\t\tif (status?.success && data?.loopback) {\n\t\t\t\tsuccessCallback(data);\n\t\t\t} else {\n\t\t\t\tfailedCallback(status);\n\t\t\t}\n\t\t} ).catch( ( error ) => {\n\t\t\terrorCallback( error );\n\t\t} );\n\t}\n\n\tfetchResult() {\n\t\treturn Fetcher.background.backgroundHealthyStatus();\n\t}\n}\n\nexport default ( new LoopbackTester() );\n","jQuery(function ($) {\n\t'use strict';\n\n /**\n\t * Handle the Smush Stats link click\n\t */\n $('body').on('click', 'a.smush-stats-details', function (e) {\n //If disabled\n if ($(this).prop('disabled')) {\n return false;\n }\n\n // prevent the default action\n e.preventDefault();\n //Replace the `+` with a `-`\n const slide_symbol = $(this).find('.stats-toggle');\n $(this).parents().eq(1).find('.smush-stats-wrapper').slideToggle();\n slide_symbol.text(slide_symbol.text() == '+' ? '-' : '+');\n });\n});","/* global ajaxurl */\n\nimport Smush from '../smush/smush';\nimport {GlobalStats} from \"../common/globalStats\";\nimport SmushProgress from \"../common/progressbar\";\n\nconst remove_element = function (el, timeout) {\n\tif (typeof timeout === 'undefined') {\n\t\ttimeout = 100;\n\t}\n\tel.fadeTo(timeout, 0, function () {\n\t\tel.slideUp(timeout, function () {\n\t\t\tel.remove();\n\t\t});\n\t});\n};\n\njQuery(function ($) {\n\t'use strict';\n\n\t/**\n\t * Disable the action links *\n\t *\n\t * @param c_element\n\t */\n\tconst disable_links = function (c_element) {\n\t\tconst parent = c_element.parent();\n\t\t//reduce parent opacity\n\t\tparent.css({ opacity: '0.5' });\n\t\t//Disable Links\n\t\tparent.find('a').prop('disabled', true);\n\t};\n\n\t/**\n\t * Enable the Action Links *\n\t *\n\t * @param c_element\n\t */\n\tconst enable_links = function (c_element) {\n\t\tconst parent = c_element.parent();\n\n\t\t//reduce parent opacity\n\t\tparent.css({ opacity: '1' });\n\t\t//Disable Links\n\t\tparent.find('a').prop('disabled', false);\n\t};\n\n\t/**\n\t * Restore image request with a specified action for Media Library / NextGen Gallery\n\t *\n\t * @param {Object} e\n\t * @param {string} currentButton\n\t * @param {string} smushAction\n\t * @param {string} action\n\t */\n\tconst process_smush_action = function (\n\t\te,\n\t\tcurrentButton,\n\t\tsmushAction,\n\t\taction\n\t) {\n\t\te.preventDefault();\n\n\t\t// If disabled.\n\t\tif ( currentButton.attr( 'disabled' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove Error.\n\t\t$('.wp-smush-error').remove();\n\n\t\t// Hide stats.\n\t\t$('.smush-stats-wrapper').hide();\n\n\t\tlet mode = 'grid';\n\t\tif ('smush_restore_image' === smushAction) {\n\t\t\tif ($(document).find('div.media-modal.wp-core-ui').length > 0) {\n\t\t\t\tmode = 'grid';\n\t\t\t} else {\n\t\t\t\tmode =\n\t\t\t\t\twindow.location.search.indexOf('item') > -1\n\t\t\t\t\t\t? 'grid'\n\t\t\t\t\t\t: 'list';\n\t\t\t}\n\t\t}\n\n\t\t// Get the image ID and nonce.\n\t\tconst params = {\n\t\t\taction: smushAction,\n\t\t\tattachment_id: currentButton.data('id'),\n\t\t\tmode,\n\t\t\t_nonce: currentButton.data('nonce'),\n\t\t};\n\n\t\t// Reduce the opacity of stats and disable the click.\n\t\tdisable_links(currentButton);\n\n\t\tconst oldLabel = currentButton.html();\n\n\t\tcurrentButton.html(\n\t\t\t'<span class=\"spinner wp-smush-progress\">' +\n\t\t\t\twp_smush_msgs[action] +\n\t\t\t\t'</span>'\n\t\t);\n\n\t\t// Restore the image.\n\t\t$.post(ajaxurl, params, function (r) {\n\t\t\t// Reset all functionality.\n\t\t\tenable_links(currentButton);\n\n\t\t\tif (r.success && 'undefined' !== typeof r.data) {\n\t\t\t\t// Replace in immediate parent for NextGEN.\n\t\t\t\tif (\n\t\t\t\t\t'undefined' !== typeof this.data &&\n\t\t\t\t\tthis.data.indexOf('nextgen') > -1\n\t\t\t\t) {\n\t\t\t\t\t// Show the smush button, and remove stats and restore option.\n\t\t\t\t\tcurrentButton.parents().eq(1).html(r.data.stats);\n\t\t\t\t} else if ('restore' === action) {\n\t\t\t\t\t// Show the smush button, and remove stats and restore option.\n\t\t\t\t\tcurrentButton.parents().eq(1).html(r.data.stats);\n\t\t\t\t} else {\n\t\t\t\t\tconst wrapper = currentButton.parents().eq(1);\n\t\t\t\t\tif ( wp_smush_msgs.failed_item_smushed && wrapper.hasClass('smush-failed-processing') ) {\n\t\t\t\t\t\twrapper.html( '<p class=\"smush-status smush-success\">' + wp_smush_msgs.failed_item_smushed + '</p>' );\n\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\twrapper.html( r.data );\n\t\t\t\t\t\t}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\twrapper.html(r.data);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ('undefined' !== typeof r.data && 'restore' === action) {\n\t\t\t\t\tSmush.updateImageStats(r.data.new_size);\n\t\t\t\t}\n\t\t\t} else if (r.data && r.data.error_msg) {\n\t\t\t\tif (\n\t\t\t\t\t-1 === this.data.indexOf('nextgen')\n\t\t\t\t) {\n\t\t\t\t\tcurrentButton.closest( '.smushit' ).find('.smush-status').addClass('smush-warning').html(r.data.error_msg);\n\t\t\t\t} else {\n\t\t\t\t\t// Show error.\n\t\t\t\t\tcurrentButton.parent().append(r.data.error_msg);\n\t\t\t\t}\n\n\t\t\t\t// Reset label and disable button on error.\n\t\t\t\tcurrentButton.attr('disabled', true);\n\t\t\t\tcurrentButton.html( oldLabel );\n\t\t\t}\n\t\t});\n\t};\n\n\t/**\n\t * Validates the Resize Width and Height against the Largest Thumbnail Width and Height\n\t *\n\t * @param wrapper_div jQuery object for the whole setting row wrapper div\n\t * @param width_only Whether to validate only width\n\t * @param height_only Validate only Height\n\t * @return {boolean} All Good or not\n\t */\n\tconst validate_resize_settings = function (\n\t\twrapper_div,\n\t\twidth_only,\n\t\theight_only\n\t) {\n\t\tconst resize_checkbox = wrapper_div.find('#resize');\n\n\t\tif (!height_only) {\n\t\t\tvar width_input = wrapper_div.find('#wp-smush-resize_width');\n\t\t\tvar width_error_note = wrapper_div.find(\n\t\t\t\t'.sui-notice-info.wp-smush-update-width'\n\t\t\t);\n\t\t}\n\t\tif (!width_only) {\n\t\t\tvar height_input = wrapper_div.find('#wp-smush-resize_height');\n\t\t\tvar height_error_note = wrapper_div.find(\n\t\t\t\t'.sui-notice-info.wp-smush-update-height'\n\t\t\t);\n\t\t}\n\n\t\tlet width_error = false;\n\t\tlet height_error = false;\n\n\t\t//If resize settings is not enabled, return true\n\t\tif (!resize_checkbox.is(':checked')) {\n\t\t\treturn true;\n\t\t}\n\n\t\t//Check if we have localised width and height\n\t\tif (\n\t\t\t'undefined' === typeof wp_smushit_data.resize_sizes ||\n\t\t\t'undefined' === typeof wp_smushit_data.resize_sizes.width\n\t\t) {\n\t\t\t//Rely on server validation\n\t\t\treturn true;\n\t\t}\n\n\t\t//Check for width\n\t\tif (\n\t\t\t!height_only &&\n\t\t\t'undefined' !== typeof width_input &&\n\t\t\tparseInt(wp_smushit_data.resize_sizes.width) >\n\t\t\t\tparseInt(width_input.val())\n\t\t) {\n\t\t\twidth_input.parent().addClass('sui-form-field-error');\n\t\t\twidth_error_note.show('slow');\n\t\t\twidth_error = true;\n\t\t} else {\n\t\t\t//Remove error class\n\t\t\twidth_input.parent().removeClass('sui-form-field-error');\n\t\t\twidth_error_note.hide();\n\t\t\tif (height_input.hasClass('error')) {\n\t\t\t\theight_error_note.show('slow');\n\t\t\t}\n\t\t}\n\n\t\t//Check for height\n\t\tif (\n\t\t\t!width_only &&\n\t\t\t'undefined' !== typeof height_input &&\n\t\t\tparseInt(wp_smushit_data.resize_sizes.height) >\n\t\t\t\tparseInt(height_input.val())\n\t\t) {\n\t\t\theight_input.parent().addClass('sui-form-field-error');\n\t\t\t//If we are not showing the width error already\n\t\t\tif (!width_error) {\n\t\t\t\theight_error_note.show('slow');\n\t\t\t}\n\t\t\theight_error = true;\n\t\t} else {\n\t\t\t//Remove error class\n\t\t\theight_input.parent().removeClass('sui-form-field-error');\n\t\t\theight_error_note.hide();\n\t\t\tif (width_input.hasClass('error')) {\n\t\t\t\twidth_error_note.show('slow');\n\t\t\t}\n\t\t}\n\n\t\tif (width_error || height_error) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t};\n\n\t/**\n\t * Update the progress bar width if we have images that needs to be resmushed\n\t *\n\t * @param unsmushed_count\n\t * @return {boolean}\n\t */\n\tconst update_progress_bar_resmush = function (unsmushed_count) {\n\t\tif ('undefined' === typeof unsmushed_count) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst smushed_count = wp_smushit_data.count_total - unsmushed_count;\n\n\t\t//Update the Progress Bar Width\n\t\t// get the progress bar\n\t\tconst $progress_bar = jQuery(\n\t\t\t'.bulk-smush-wrapper .wp-smush-progress-inner'\n\t\t);\n\t\tif ($progress_bar.length < 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst width = (smushed_count / wp_smushit_data.count_total) * 100;\n\n\t\t// increase progress\n\t\t$progress_bar.css('width', width + '%');\n\t};\n\n\tconst runRecheck = function (process_settings) {\n\t\tconst button = $('.wp-smush-scan');\n\n\t\t// Add a \"loading\" state to the button.\n\t\tbutton.addClass('sui-button-onload');\n\n\t\t// Check if type is set in data attributes.\n\t\tlet scan_type = button.data('type');\n\t\tscan_type = 'undefined' === typeof scan_type ? 'media' : scan_type;\n\n\t\t// Remove the Skip resmush attribute from button.\n\t\t$('.wp-smush-all').removeAttr('data-smush');\n\n\t\t// Disable Bulk smush button and itself.\n\t\t$('.wp-smush-all').prop('disabled', true);\n\n\t\t// Hide Settings changed Notice.\n\t\t$('.wp-smush-settings-changed').hide();\n\n\t\t// Ajax params.\n\t\tconst params = {\n\t\t\taction: 'scan_for_resmush',\n\t\t\ttype: scan_type,\n\t\t\tget_ui: true,\n\t\t\tprocess_settings,\n\t\t\twp_smush_options_nonce: jQuery('#wp_smush_options_nonce').val(),\n\t\t};\n\n\t\t// Send ajax request and get ids if any.\n\t\t$.get(ajaxurl, params, function (response) {\n\t\t\tif ( ! response?.success ) {\n\t\t\t\tWP_Smush.helpers.showNotice( response, {\n\t\t\t\t\tshowdismiss: true,\n\t\t\t\t\tautoclose: false,\n\t\t\t\t} );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst stats = response.data;\n\t\t\tshowRecheckImagesNotice( stats );\n\t\t\tGlobalStats.updateGlobalStatsFromSmushScriptData( stats );\n\t\t\tGlobalStats.renderStats();\n\t\t\tupdateBulkSmushContentAfterReCheck( stats );\n\t\t}).always(function () {\n\t\t\t// Hide the progress bar.\n\t\t\tjQuery(\n\t\t\t\t'.bulk-smush-wrapper .wp-smush-bulk-progress-bar-wrapper'\n\t\t\t).addClass('sui-hidden');\n\n\t\t\t// Add check complete status to button.\n\t\t\tbutton\n\t\t\t\t.removeClass('sui-button-onload')\n\t\t\t\t.addClass('smush-button-check-success');\n\n\t\t\tconst $defaultText = button.find('.wp-smush-default-text'),\n\t\t\t\t$completedText = button.find('.wp-smush-completed-text');\n\n\t\t\t$defaultText.addClass('sui-hidden-important');\n\t\t\t$completedText.removeClass('sui-hidden');\n\n\t\t\t// Remove success message from button.\n\t\t\tsetTimeout(function () {\n\t\t\t\tbutton.removeClass('smush-button-check-success');\n\n\t\t\t\t$defaultText.removeClass('sui-hidden-important');\n\t\t\t\t$completedText.addClass('sui-hidden');\n\t\t\t}, 2000);\n\n\t\t\t$('.wp-smush-all').prop('disabled', false);\n\t\t});\n\t};\n\n\tconst showRecheckImagesNotice = ( stats ) => {\n\t\tif ( ! stats.notice ) {\n\t\t\treturn;\n\t\t}\n\t\tlet type = 'success';\n\t\tif ( 'undefined' !== typeof stats.noticeType ) {\n\t\t\ttype = stats.noticeType;\n\t\t}\n\t\twindow.SUI.openNotice(\n\t\t\t'wp-smush-ajax-notice',\n\t\t\t'<p>' + stats.notice + '</p>',\n\t\t\t{ type, icon: 'check-tick' }\n\t\t);\n\t};\n\n\tconst updateBulkSmushContentAfterReCheck = ( stats ) => {\n\t\tif ( SmushProgress.isEmptyObject ) {\n\t\t\treturn;\n\t\t}\n\n\t\tSmushProgress.update( 0, stats.remaining_count );\n\t\tif ( stats.remaining_count < 1 ) {\n\t\t\tSmushProgress.hideBulkSmushDescription();\n\t\t\tSmushProgress.showBulkSmushAllDone();\n\t\t} else {\n\t\t\tSmushProgress.showBulkSmushDescription();\n\t\t\tSmushProgress.hideBulkSmushAllDone();\n\t\t}\n\t}\n\n\tconst updateDisplayedContentAfterReCheck = function (count) {\n\t\tconst $pendingImagesWrappers = jQuery(\n\t\t\t'.bulk-smush-wrapper .wp-smush-bulk-wrapper'\n\t\t);\n\t\tconst $allDoneWrappers = jQuery(\n\t\t\t'.bulk-smush-wrapper .wp-smush-all-done'\n\t\t);\n\n\t\tif ($pendingImagesWrappers.length && $allDoneWrappers.length) {\n\t\t\tif (count === 0) {\n\t\t\t\t$pendingImagesWrappers.addClass('sui-hidden');\n\t\t\t\t$allDoneWrappers.find('p').html( wp_smush_msgs.all_smushed );\n\t\t\t\t$allDoneWrappers.find('.sui-notice-icon').removeClass('sui-icon-info').addClass('sui-icon-check-tick');\n\t\t\t\t$allDoneWrappers.removeClass('sui-notice-warning').addClass('sui-notice-success');\n\t\t\t\t$allDoneWrappers.removeClass('sui-hidden');\n\t\t\t} else {\n\t\t\t\t$pendingImagesWrappers.removeClass('sui-hidden');\n\t\t\t\t$allDoneWrappers.addClass('sui-hidden');\n\n\t\t\t\t// Update texts mentioning the amount of unsmushed imagesin the summary icon tooltip.\n\t\t\t\tconst $unsmushedTooltip = jQuery(\n\t\t\t\t\t'.sui-summary-smush .sui-summary-details .sui-tooltip'\n\t\t\t\t);\n\n\t\t\t\t// The tooltip doesn't exist in the NextGen page.\n\t\t\t\tif ($unsmushedTooltip.length) {\n\t\t\t\t\tconst textForm = 1 === count ? 'singular' : 'plural',\n\t\t\t\t\t\ttooltipText = $unsmushedTooltip\n\t\t\t\t\t\t\t.data(textForm)\n\t\t\t\t\t\t\t.replace('{count}', count);\n\t\t\t\t\t$unsmushedTooltip.attr('data-tooltip', tooltipText);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Total count in the progress bar.\n\t\tjQuery('.wp-smush-total-count').text(count);\n\t};\n\n\t// Scroll the element to top of the page.\n\tconst goToByScroll = function (selector) {\n\t\t// Scroll if element found.\n\t\tif ($(selector).length > 0) {\n\t\t\t$('html, body').animate(\n\t\t\t\t{\n\t\t\t\t\tscrollTop: $(selector).offset().top - 100,\n\t\t\t\t},\n\t\t\t\t'slow'\n\t\t\t);\n\t\t}\n\t};\n\n\tconst update_cummulative_stats = function (stats) {\n\t\t//Update Directory Smush Stats\n\t\tif ('undefined' !== typeof stats.dir_smush) {\n\t\t\tconst stats_human = $(\n\t\t\t\t'li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-human'\n\t\t\t);\n\t\t\tconst stats_percent = $(\n\t\t\t\t'li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-percent'\n\t\t\t);\n\n\t\t\t// Do not replace if 0 savings.\n\t\t\tif (stats.dir_smush.bytes > 0) {\n\t\t\t\t$('.wp-smush-dir-link').addClass('sui-hidden');\n\n\t\t\t\t// Hide selector.\n\t\t\t\t$('li.smush-dir-savings .wp-smush-stats-label-message').hide();\n\t\t\t\t//Update Savings in bytes\n\t\t\t\tif (stats_human.length > 0) {\n\t\t\t\t\tstats_human.html(stats.dir_smush.human);\n\t\t\t\t}\n\n\t\t\t\t//Percentage section\n\t\t\t\tif (stats.dir_smush.percent > 0) {\n\t\t\t\t\t// Show size and percentage separator.\n\t\t\t\t\t$(\n\t\t\t\t\t\t'li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-sep'\n\t\t\t\t\t).removeClass('sui-hidden');\n\t\t\t\t\t//Update Optimisation percentage\n\t\t\t\t\tif (stats_percent.length > 0) {\n\t\t\t\t\t\tstats_percent.html(stats.dir_smush.percent + '%');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$('.wp-smush-dir-link').removeClass('sui-hidden');\n\t\t\t}\n\t\t}\n\n\t\t//Update Combined stats\n\t\tif (\n\t\t\t'undefined' !== typeof stats.combined_stats &&\n\t\t\tstats.combined_stats.length > 0\n\t\t) {\n\t\t\tconst c_stats = stats.combined_stats;\n\n\t\t\tlet smush_percent = (c_stats.smushed / c_stats.total_count) * 100;\n\t\t\tsmush_percent = WP_Smush.helpers.precise_round(smush_percent, 1);\n\n\t\t\t//Smushed Percent\n\t\t\tif (smush_percent) {\n\t\t\t\t$('div.wp-smush-count-total span.wp-smush-images-percent').html(\n\t\t\t\t\tsmush_percent\n\t\t\t\t);\n\t\t\t}\n\t\t\t//Update Total Attachment Count\n\t\t\tif (c_stats.total_count) {\n\t\t\t\t$(\n\t\t\t\t\t'span.wp-smush-count-total span.wp-smush-total-optimised'\n\t\t\t\t).html(c_stats.total_count);\n\t\t\t}\n\t\t\t//Update Savings and Percent\n\t\t\tif (c_stats.savings) {\n\t\t\t\t$('span.wp-smush-savings span.wp-smush-stats-human').html(\n\t\t\t\t\tc_stats.savings\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (c_stats.percent) {\n\t\t\t\t$('span.wp-smush-savings span.wp-smush-stats-percent').html(\n\t\t\t\t\tc_stats.percent\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * When 'All' is selected for the Image Sizes setting, select all available sizes.\n\t *\n\t * @since 3.2.1\n\t */\n\t$('#all-image-sizes').on('change', function () {\n\t\t$('input[name^=\"wp-smush-image_sizes\"]').prop('checked', true);\n\t});\n\n\t/**\n\t * Handles the tabs navigation on mobile.\n\t *\n\t * @since 3.8.4\n\t */\n\t$('.sui-mobile-nav').on('change', (e) => {\n\t\twindow.location.assign($(e.currentTarget).val());\n\t});\n\n\t/**\n\t * Handle re-check api status button click (Settings)\n\t *\n\t * @since 3.2.0.2\n\t */\n\t$('#update-api-status').on('click', function (e) {\n\t\te.preventDefault();\n\n\t\t//$(this).prop('disabled', true);\n\t\t$(this).addClass('sui-button-onload');\n\n\t\t$.post(ajaxurl, { action: 'recheck_api_status' }, function () {\n\t\t\tlocation.reload();\n\t\t});\n\t});\n\n\t/** Handle smush button click **/\n\t$('body').on(\n\t\t'click',\n\t\t'.wp-smush-send:not(.wp-smush-resmush)',\n\t\tfunction (e) {\n\t\t\t// prevent the default action\n\t\t\te.preventDefault();\n\t\t\tnew Smush($(this), false);\n\t\t}\n\t);\n\n\t/**\n\t * Handle show in bulk smush button click.\n\t */\n\t$( 'body' ).on( 'click', '.wp-smush-remove-skipped', function( e ) {\n\t\te.preventDefault();\n\n\t\tconst self = $( this );\n\n\t\t// Send ajax request to remove the image from the skip list.\n\t\t$.post( ajaxurl, {\n\t\t\taction: 'remove_from_skip_list',\n\t\t\tid: self.attr( 'data-id' ),\n\t\t\t_ajax_nonce: self.attr( 'data-nonce' ),\n\t\t} ).done( ( response ) => {\n\t\t\tif ( response.success && 'undefined' !== typeof response.data.html ) {\n\t\t\t\tself.parent().parent().html( response.data.html );\n\t\t\t}\n\t\t} );\n\t} );\n\t/** Restore: Media Library **/\n\t$('body').on('click', '.wp-smush-action.wp-smush-restore', function (e) {\n\t\tconst current_button = $(this);\n\t\tprocess_smush_action(\n\t\t\te,\n\t\t\tcurrent_button,\n\t\t\t'smush_restore_image',\n\t\t\t'restore'\n\t\t);\n\t});\n\n\t/** Resmush: Media Library **/\n\t$('body').on('click', '.wp-smush-action.wp-smush-resmush', function (e) {\n\t\tprocess_smush_action(e, $(this), 'smush_resmush_image', 'smushing');\n\t});\n\n\t/** Restore: NextGen Gallery **/\n\t$('body').on(\n\t\t'click',\n\t\t'.wp-smush-action.wp-smush-nextgen-restore',\n\t\tfunction (e) {\n\t\t\tprocess_smush_action(\n\t\t\t\te,\n\t\t\t\t$(this),\n\t\t\t\t'smush_restore_nextgen_image',\n\t\t\t\t'restore'\n\t\t\t);\n\t\t}\n\t);\n\n\t/** Resmush: NextGen Gallery **/\n\t$('body').on(\n\t\t'click',\n\t\t'.wp-smush-action.wp-smush-nextgen-resmush',\n\t\tfunction (e) {\n\t\t\tprocess_smush_action(\n\t\t\t\te,\n\t\t\t\t$(this),\n\t\t\t\t'smush_resmush_nextgen_image',\n\t\t\t\t'smushing'\n\t\t\t);\n\t\t}\n\t);\n\n\t//Scan For resmushing images\n\t$('.wp-smush-scan').on('click', function (e) {\n\t\te.preventDefault();\n\t\tif ( $(this).hasClass('wp-smush-background-scan') ) {\n\t\t\treturn;\n\t\t}\n\t\trunRecheck(false);\n\t});\n\n\t//Remove Notice\n\t$('body').on('click', '.wp-smush-notice .icon-fi-close', function (e) {\n\t\te.preventDefault();\n\t\tconst $el = $(this).parent();\n\t\tremove_element($el);\n\t});\n\n\t// On re-Smush click.\n\t// TODO: This can be removed, but follow the logic and remove all excess code as well.\n\t$('body').on('click', '.wp-smush-skip-resmush', function (e) {\n\t\te.preventDefault();\n\n\t\tconst self = jQuery(this),\n\t\t\tcontainer = self.parents().eq(1),\n\t\t\tel = self.parent();\n\n\t\t// Remove Parent div.\n\t\tremove_element(el);\n\n\t\t// Set button attribute to skip re-smush ids.\n\t\tcontainer.find('.wp-smush-all').attr('data-smush', 'skip_resmush');\n\n\t\t// Update Smushed count.\n\t\twp_smushit_data.count_smushed =\n\t\t\tparseInt(wp_smushit_data.count_smushed) +\n\t\t\twp_smushit_data.resmush.length;\n\t\twp_smushit_data.count_supersmushed =\n\t\t\tparseInt(wp_smushit_data.count_supersmushed) +\n\t\t\twp_smushit_data.resmush.length;\n\n\t\t// Update stats.\n\t\tif (wp_smushit_data.count_smushed === wp_smushit_data.count_total) {\n\t\t\t// Show all done notice.\n\t\t\t$('.wp-smush-notice.wp-smush-all-done').removeClass('sui-hidden');\n\n\t\t\t// Hide Smush button.\n\t\t\t$('.wp-smush-bulk-wrapper ').addClass('sui-hidden');\n\t\t}\n\n\t\t// Remove re-Smush notice.\n\t\t$('.wp-smush-resmush-notice').remove();\n\n\t\tlet type = $('.wp-smush-scan').data('type');\n\t\ttype = 'undefined' === typeof type ? 'media' : type;\n\n\t\tconst smushed_count =\n\t\t\t'undefined' !== typeof wp_smushit_data.count_smushed\n\t\t\t\t? wp_smushit_data.count_smushed\n\t\t\t\t: 0;\n\n\t\tlet smush_percent = (smushed_count / wp_smushit_data.count_total) * 100;\n\t\tsmush_percent = WP_Smush.helpers.precise_round(smush_percent, 1);\n\n\t\t$('.wp-smush-images-percent').html(smush_percent);\n\n\t\t// Update the progress bar width. Get the progress bar.\n\t\tconst progress_bar = jQuery(\n\t\t\t'.bulk-smush-wrapper .wp-smush-progress-inner'\n\t\t);\n\t\tif (progress_bar.length < 1) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Increase progress.\n\t\tprogress_bar.css('width', smush_percent + '%');\n\n\t\t// Show the default bulk smush notice.\n\t\t$('.wp-smush-bulk-wrapper').removeClass('sui-hidden');\n\t\t$('.wp-smush-bulk-wrapper .sui-notice').removeClass('sui-hidden');\n\n\t\tconst params = {\n\t\t\taction: 'delete_resmush_list',\n\t\t\ttype,\n\t\t};\n\n\t\t//Delete resmush list, @todo: update stats from the ajax response\n\t\t$.post(ajaxurl, params, function (res) {\n\t\t\t// Remove the whole li element on success\n\t\t\tif (res.success && 'undefined' !== typeof res.data.stats) {\n\t\t\t\tconst stats = res.data.stats;\n\t\t\t\t// Update wp_smushit_data ( Smushed count, Smushed Percent, Image count, Super smush count, resize savings, conversion savings )\n\t\t\t\tif ('undefined' !== typeof wp_smushit_data) {\n\t\t\t\t\twp_smushit_data.count_images =\n\t\t\t\t\t\t'undefined' !== typeof stats.count_images\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.count_images) +\n\t\t\t\t\t\t\t stats.count_images\n\t\t\t\t\t\t\t: wp_smushit_data.count_images;\n\t\t\t\t\twp_smushit_data.size_before =\n\t\t\t\t\t\t'undefined' !== typeof stats.size_before\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.size_before) +\n\t\t\t\t\t\t\t stats.size_before\n\t\t\t\t\t\t\t: wp_smushit_data.size_before;\n\t\t\t\t\twp_smushit_data.size_after =\n\t\t\t\t\t\t'undefined' !== typeof stats.size_after\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.size_after) +\n\t\t\t\t\t\t\t stats.size_after\n\t\t\t\t\t\t\t: wp_smushit_data.size_after;\n\t\t\t\t\twp_smushit_data.savings_resize =\n\t\t\t\t\t\t'undefined' !== typeof stats.savings_resize\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.savings_resize) +\n\t\t\t\t\t\t\t stats.savings_resize\n\t\t\t\t\t\t\t: wp_smushit_data.savings_resize;\n\t\t\t\t\twp_smushit_data.savings_conversion =\n\t\t\t\t\t\t'undefined' !== typeof stats.savings_conversion\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.savings_conversion) +\n\t\t\t\t\t\t\t stats.savings_conversion\n\t\t\t\t\t\t\t: wp_smushit_data.savings_conversion;\n\n\t\t\t\t\t// Add directory smush stats.\n\t\t\t\t\tif (\n\t\t\t\t\t\t'undefined' !==\n\t\t\t\t\t\t\ttypeof wp_smushit_data.savings_dir_smush &&\n\t\t\t\t\t\t'undefined' !==\n\t\t\t\t\t\t\ttypeof wp_smushit_data.savings_dir_smush.orig_size\n\t\t\t\t\t) {\n\t\t\t\t\t\twp_smushit_data.size_before =\n\t\t\t\t\t\t\t'undefined' !==\n\t\t\t\t\t\t\ttypeof wp_smushit_data.savings_dir_smush\n\t\t\t\t\t\t\t\t? parseInt(wp_smushit_data.size_before) +\n\t\t\t\t\t\t\t\t parseInt(\n\t\t\t\t\t\t\t\t\t\twp_smushit_data.savings_dir_smush\n\t\t\t\t\t\t\t\t\t\t\t.orig_size\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: wp_smushit_data.size_before;\n\t\t\t\t\t\twp_smushit_data.size_after =\n\t\t\t\t\t\t\t'undefined' !==\n\t\t\t\t\t\t\ttypeof wp_smushit_data.savings_dir_smush\n\t\t\t\t\t\t\t\t? parseInt(wp_smushit_data.size_after) +\n\t\t\t\t\t\t\t\t parseInt(\n\t\t\t\t\t\t\t\t\t\twp_smushit_data.savings_dir_smush\n\t\t\t\t\t\t\t\t\t\t\t.image_size\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: wp_smushit_data.size_after;\n\t\t\t\t\t}\n\n\t\t\t\t\twp_smushit_data.count_resize =\n\t\t\t\t\t\t'undefined' !== typeof stats.count_resize\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.count_resize) +\n\t\t\t\t\t\t\t stats.count_resize\n\t\t\t\t\t\t\t: wp_smushit_data.count_resize;\n\t\t\t\t}\n\n\t\t\t\t// If no images left, hide the notice, show all success notice.\n\t\t\t\tif (\n\t\t\t\t\t'undefined' !== typeof wp_smushit_data.unsmushed ||\n\t\t\t\t\twp_smushit_data.unsmushed.length === 0\n\t\t\t\t) {\n\t\t\t\t\t$('.wp-smush-bulk-wrapper .sui-notice').removeClass(\n\t\t\t\t\t\t'sui-hidden'\n\t\t\t\t\t);\n\t\t\t\t\t$('.sui-notice-success.wp-smush-all-done').addClass(\n\t\t\t\t\t\t'sui-hidden'\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tSmush.updateStats();\n\t\t\t}\n\t\t});\n\t});\n\n\t// Enable super smush on clicking link from stats area.\n\t$('a.wp-smush-lossy-enable').on('click', function (e) {\n\t\te.preventDefault();\n\t\t// Scroll down to settings area.\n\t\tgoToByScroll('#column-lossy');\n\t});\n\n\t// Enable resize on clicking link from stats area.\n\t$('.wp-smush-resize-enable').on('click', function (e) {\n\t\te.preventDefault();\n\t\t// Scroll down to settings area.\n\t\tgoToByScroll('#column-resize');\n\t});\n\n\t// If settings string is found in url, enable and scroll.\n\tif ( window.location.hash ) {\n\t\tconst setting_hash = window.location.hash.substring( 1 );\n\t\tlet scrollTo = '';\n\n\t\tswitch ( setting_hash ) {\n\t\t\tcase 'enable-resize':\n\t\t\t\tscrollTo = '#column-resize';\n\t\t\t\tbreak;\n\n\t\t\tcase 'backup-label':\n\t\t\t\tscrollTo = '#backup';\n\t\t\t\tbreak;\n\n\t\t\tcase 'original-label':\n\t\t\t\tscrollTo = '#original';\n\t\t\t\tbreak;\n\n\t\t\tcase 'enable-lossy':\n\t\t\t\tscrollTo = '#column-lossy';\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( '' !== scrollTo ) {\n\t\t\tgoToByScroll( scrollTo );\n\t\t\tdocument.getElementById( scrollTo.replace( '#', '' ) ).focus();\n\t\t}\n\t}\n\n\t//Trigger Bulk\n\t$('body').on('click', '.wp-smush-trigger-bulk', function (e) {\n\t\te.preventDefault();\n\n\t\t//Induce Setting button save click\n\t\tif (\n\t\t\t'undefined' !== typeof e.target.dataset.type &&\n\t\t\t'nextgen' === e.target.dataset.type\n\t\t) {\n\t\t\t$('.wp-smush-nextgen-bulk').trigger('click');\n\t\t} else {\n\t\t\t$('.wp-smush-all').trigger('click');\n\t\t}\n\n\t\t$('span.sui-notice-dismiss').trigger('click');\n\t});\n\n\t//Trigger Bulk\n\t$('body').on('click', '#bulk-smush-top-notice-close', function (e) {\n\t\te.preventDefault();\n\t\t$(this).parent().parent().slideUp('slow');\n\t});\n\n\t//Allow the checkboxes to be Keyboard Accessible\n\t$('.wp-smush-setting-row .toggle-checkbox').on('focus', function () {\n\t\t//If Space is pressed\n\t\t$(this).keypress(function (e) {\n\t\t\tif (e.keyCode == 32) {\n\t\t\t\te.preventDefault();\n\t\t\t\t$(this).find('.toggle-checkbox').trigger('click');\n\t\t\t}\n\t\t});\n\t});\n\n\t// Re-Validate Resize Width And Height.\n\t$('body').on('blur', '.wp-smush-resize-input', function () {\n\t\tconst self = $(this);\n\n\t\tconst wrapper_div = self.parents().eq(4);\n\n\t\t// Initiate the check.\n\t\tvalidate_resize_settings(wrapper_div, false, false); // run the validation.\n\t});\n\n\t// Handle Resize Checkbox toggle, to show/hide width, height settings.\n\t$('body').on('click', '#resize', function () {\n\t\tconst self = $(this);\n\t\tconst settings_wrap = $('#smush-resize-settings-wrap');\n\n\t\tif (self.is(':checked')) {\n\t\t\tsettings_wrap.show();\n\t\t} else {\n\t\t\tsettings_wrap.hide();\n\t\t}\n\t});\n\n\t//Handle Re-check button functionality\n\t$('#wp-smush-revalidate-member').on('click', function (e) {\n\t\te.preventDefault();\n\t\t//Ajax Params\n\t\tconst params = {\n\t\t\taction: 'smush_show_warning',\n\t\t\t_ajax_nonce: window.wp_smush_msgs.nonce,\n\t\t};\n\t\tconst link = $(this);\n\t\tconst parent = link.parents().eq(1);\n\t\tparent.addClass('loading-notice');\n\t\t$.get(ajaxurl, params, function (r) {\n\t\t\t//remove the warning\n\t\t\tparent.removeClass('loading-notice').addClass('loaded-notice');\n\t\t\tif (0 == r) {\n\t\t\t\tparent.attr('data-message', wp_smush_msgs.membership_valid);\n\t\t\t\tremove_element(parent, 1000);\n\t\t\t} else {\n\t\t\t\tparent.attr('data-message', wp_smush_msgs.membership_invalid);\n\t\t\t\tsetTimeout(function remove_loader() {\n\t\t\t\t\tparent.removeClass('loaded-notice');\n\t\t\t\t}, 1000);\n\t\t\t}\n\t\t});\n\t});\n\n\tif ($('li.smush-dir-savings').length > 0) {\n\t\t// Update Directory Smush, as soon as the page loads.\n\t\tconst stats_param = {\n\t\t\taction: 'get_dir_smush_stats',\n\t\t\t_ajax_nonce: window.wp_smush_msgs.nonce,\n\t\t};\n\t\t$.get(ajaxurl, stats_param, function (r) {\n\t\t\t//Hide the spinner\n\t\t\t$('li.smush-dir-savings .sui-icon-loader').hide();\n\n\t\t\t//If there are no errors, and we have a message to display\n\t\t\tif (!r.success && 'undefined' !== typeof r.data.message) {\n\t\t\t\t$('div.wp-smush-scan-result div.content').prepend(\n\t\t\t\t\tr.data.message\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//If there is no value in r\n\t\t\tif (\n\t\t\t\t'undefined' === typeof r.data ||\n\t\t\t\t'undefined' === typeof r.data.dir_smush\n\t\t\t) {\n\t\t\t\t//Append the text\n\t\t\t\t$('li.smush-dir-savings span.wp-smush-stats').append(\n\t\t\t\t\twp_smush_msgs.ajax_error\n\t\t\t\t);\n\t\t\t\t$('li.smush-dir-savings span.wp-smush-stats span').hide();\n\t\t\t} else {\n\t\t\t\t//Update the stats\n\t\t\t\tupdate_cummulative_stats(r.data);\n\t\t\t}\n\t\t});\n\t}\n\n\t// Display dialogs that show up with no user action.\n\tif ( $( '#smush-updated-dialog' ).length ) {\n\t\t// Displays the modal with the release's higlights if it exists.\n\t\tconst modalId = 'smush-updated-dialog',\n\t\t\tfocusAfterClosed = 'wpbody-content',\n\t\t\tfocusWhenOpen = undefined,\n\t\t\thasOverlayMask = false,\n\t\t\tisCloseOnEsc = false,\n\t\t\tisAnimated = true;\n\n\t\twindow.SUI.openModal(\n\t\t\tmodalId,\n\t\t\tfocusAfterClosed,\n\t\t\tfocusWhenOpen,\n\t\t\thasOverlayMask,\n\t\t\tisCloseOnEsc,\n\t\t\tisAnimated\n\t\t);\n\t}\n\n\t/**\n\t * Toggle backup notice based on \"Optimize original images\" setting.\n\t * @since 3.9.1\n\t */\n\t$( 'input#original' ).on( 'change', function() {\n\t\t$( '#backup-notice' ).toggleClass( 'sui-hidden', $( this ).is(':checked') );\n\t} );\n\n\n\t/**\n\t * Bulk compression level notice.\n\t */\n\tconst handleCompressionLevelNotice = () => {\n\t\tconst compressionLevelNotice = document.querySelector( '.wp-smush-compression-type' );\n\t\tif ( ! compressionLevelNotice ) {\n\t\t\treturn;\n\t\t}\n\t\tconst compressionNoticeContent = compressionLevelNotice.querySelector( '.wp-smush-compression-type_note p' );\n\t\tif ( ! compressionNoticeContent ) {\n\t\t\treturn;\n\t\t}\n\t\tcompressionLevelNotice.querySelector('.wp-smush-compression-type_slider').addEventListener('change', (e) => {\n\t\t\tif ( 'INPUT' !== e?.target?.nodeName ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst note = e.target.dataset?.note;\n\t\t\tif ( ! note ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcompressionNoticeContent.innerHTML = note.trim();\n\t\t} );\n\t}\n\thandleCompressionLevelNotice();\n\n\n\t/**\n\t * Close modal and redirect to the href link.\n\t */\n\t$('.wp-smush-modal-link-close').on( 'click', function( e ) {\n\t\te.preventDefault();\n\t\tSUI.closeModal();\n\t\tconst href = $(this).attr('href');\n\t\tlet openNewTab = '_blank' === $(this).attr('target');\n\t\tif ( href ) {\n\t\t\tif ( openNewTab ) {\n\t\t\t\twindow.open( href, '_blank' );\n\t\t\t} else {\n\t\t\t\twindow.location.href = href;\n\t\t\t}\n\t\t}\n\t});\n\n\t// Update Smush mode on lossy level change.\n\tconst updateLossyLevelInSummaryBox = () => {\n\t\tconst lossyLevelSummaryBox = document.querySelector('.wp-smush-current-compression-level');\n\t\tconst currentLossyLevelTab = document.querySelector( '.wp-smush-lossy-level-tabs button.active' );\n\t\tif ( ! lossyLevelSummaryBox || ! currentLossyLevelTab ) {\n\t\t\treturn;\n\t\t}\n\t\t// Update lossy label.\n\t\tlossyLevelSummaryBox.innerText = currentLossyLevelTab.innerText.trim();\n\n\t\t// Toggle Ultra notice/upsell link.\n\t\tconst upsellLink = lossyLevelSummaryBox.nextElementSibling;\n\t\tif ( upsellLink ) {\n\t\t\tif ( currentLossyLevelTab.id.includes('ultra') ) {\n\t\t\t\tupsellLink.classList.add( 'sui-hidden' );\n\t\t\t} else {\n\t\t\t\tupsellLink.classList.remove( 'sui-hidden' );\n\t\t\t}\n\t\t}\n\t}\n\n\tdocument.addEventListener( 'onSavedSmushSettings', function( e ) {\n\t\tif ( ! e?.detail?.is_outdated_stats ) {\n\t\t\treturn;\n\t\t}\n\t\tupdateLossyLevelInSummaryBox();\n\t} );\n});\n","/* global WP_Smush */\n\n/**\n * Bulk Smush Background Optimization.\n *\n * @since 3.12.0\n */\nimport Fetcher from '../utils/fetcher';\nimport tracker from '../utils/tracker';\nimport SmushProgress from '../common/progressbar';\nimport {GlobalStats, UpsellManger} from \"../common/globalStats\";\nimport loopbackTester from '../loopback-tester';\n\n(function () {\n 'use strict';\n if (!window.wp_smush_msgs) {\n return;\n }\n const $ = document.querySelector.bind(document);\n const NO_FREE_LIMITED = 50;\n\n /**\n * Handle Background Process.\n * @returns \n */\n const BackgroundProcess = () => {\n return {\n handle(action) {\n return Fetcher.background[action]();\n },\n initState() {\n return Fetcher.background.initState();\n },\n }\n }\n\n /**\n * Background Optimization.\n */\n const BackgroundSmush = (() => {\n\n const startBtn = window.wp_smushit_data && window.wp_smushit_data.bo_stats && $('.wp-smush-bo-start');\n if (!startBtn) {\n return;\n }\n\n const BO = new BackgroundProcess();\n const bulkWrapper = $('.bulk-smush-wrapper');\n const reScanImagesButton = $('.wp-smush-scan');\n let intervalHandle = 0;\n let cancellationInProgress = false;\n return {\n hookStatusChecks() {\n if (intervalHandle) {\n // Already done\n return;\n }\n\n let count = 0;\n\t\t\t\tlet statusSyncInProgress = false;\n let statSyncInProgress = false;\n intervalHandle = setInterval(() => {\n if (statusSyncInProgress) {\n return;\n }\n statusSyncInProgress = true;\n\n count++;\n const statusSynced = this.syncBackgroundStatus();\n if (count % 3 === 0) {\n // Do a full update every nth time\n statusSynced.then(() => {\n if (!statSyncInProgress) {\n this.syncStats().then(() => {\n statSyncInProgress = false;\n });\n statSyncInProgress = true;\n }\n });\n }\n\n statusSynced.finally(() => {\n statusSyncInProgress = false;\n });\n }, 3 * 1000);\n },\n resetBOStatsOnStart() {\n GlobalStats.setBoStats( {\n is_cancelled: false,\n is_completed: false,\n processed_items: 0,\n failed_items: 0,\n } );\n },\n start() {\n // Reset boStats.\n this.resetBOStatsOnStart();\n\n // Disable UI.\n this.onStart();\n\n loopbackTester.performTest().then( ( res ) => {\n const isLoopbackHealthy = res?.loopback;\n if ( isLoopbackHealthy ) {\n // Start BO.\n this.startBulkSmush();\n } else {\n this.showLoopbackErrorModal();\n this.onStartFailure();\n }\n } ).catch( ( error ) => {\n\t\t\t console.error( 'Error:', error );\n this.showLoopbackErrorModal();\n this.onStartFailure();\n } );\n },\n startBulkSmush() {\n BO.handle('start').then((res) => {\n if (res.success) {\n // Update stats.\n const updatedStats = this.updateStats(res.data, false);\n // Show progress bar.\n this.showProgressBar();\n this.hookStatusChecks();\n if ( updatedStats ) {\n // Render stats.\n GlobalStats.renderStats();\n }\n } else {\n this.showFailureNotice( res );\n this.onStartFailure( res );\n }\n });\n },\n showFailureNotice( res ) {\n WP_Smush.helpers.showNotice( res, {\n 'showdismiss': true,\n 'autoclose' : false,\n } );\n },\n onStartFailure( res ) {\n this.cancelBulk();\n },\n showLoopbackErrorModal() {\n const loopbackErrorModal = document.getElementById( 'smush-loopback-error-dialog' );\n if ( ! loopbackErrorModal || ! window.SUI ) {\n return;\n }\n \n // Cache current process type.\n loopbackErrorModal.dataset.processType = 'smush';\n \n WP_Smush.helpers.showModal( loopbackErrorModal.id );\n },\n /**\n * Initial state when load the Bulk Smush page while BO is running.\n */\n initState() {\n if (!GlobalStats.getBoStats().in_processing) {\n return;\n }\n // Disable UI.\n this.onStart();\n // Start BO.\n BO.initState().then((res) => {\n if (res.success) {\n // Update stats.\n this.updateStats(res.data, false);\n // Show progress bar.\n this.showProgressBar();\n this.hookStatusChecks();\n // Maybe update errors.\n if ( res.data.errors && ! Object.keys( GlobalStats.getErrors() ).length ) {\n GlobalStats.setErrors( res.data.errors );\n }\n // Render stats.\n GlobalStats.renderStats();\n } else {\n WP_Smush.helpers.showNotice( res );\n }\n });\n },\n /**\n * Cancel.\n */\n cancel() {\n cancellationInProgress = true;\n\t\t\t\tthis.setCancelButtonStateToStarted();\n BO.handle('cancel').then((res) => {\n if (res.success) {\n this.cancelBulk();\n } else {\n WP_Smush.helpers.showNotice( res );\n }\n });\n },\n hideProgressBar() {\n // Hide progress bar.\n SmushProgress.close().update(0, GlobalStats.getBoStats().total_items);\n },\n showProgressBar() {\n // Reset progress bar.\n SmushProgress.update(GlobalStats.getBoStats().processed_items, GlobalStats.getBoStats().total_items);\n // Show progress bar.\n SmushProgress.show();\n },\n /**\n * Update stats.\n * @param {Object} newStats Included increment stats and new BO stats.\n * @param updateGlobal\n */\n updateStats(newStats, updateGlobal) {\n // Make sure we have processed_stats/errors property (not added by default when start).\n newStats.global_stats = newStats.global_stats || {};\n newStats.errors = newStats.errors || {};\n const {\n global_stats,\n errors,\n ...newBoStats\n } = newStats;\n if ( ! GlobalStats.isChangedStats( newBoStats ) ) {\n return false;\n }\n // Update BO stats.\n GlobalStats.setBoStats(newBoStats);\n if (updateGlobal) {\n // Update global stats.\n GlobalStats.setGlobalStats(global_stats);\n }\n // Update Errors.\n GlobalStats.setErrors( errors );\n return true;\n },\n cancelBulk() {\n // Sync Stats.\n this.syncStats(() => {\n if (100 === GlobalStats.getGlobalStats().percent_optimized) {\n // If the last item was getting processed when the user cancelled then the process might have completed\n GlobalStats.setBoStats( {\n is_completed: true\n } );\n this.onCompletedBulk();\n } else {\n // Update status of boStats.\n GlobalStats.setBoStats( {\n is_cancelled: true\n } );\n // Reset and hide progress bar.\n this.onFinish();\n // Bulk is cancelled, show bulk desc.\n SmushProgress.showBulkSmushDescription();\n }\n\n cancellationInProgress = false;\n });\n },\n showCompletedMessage() {\n // Render completed message.\n // Show completed message.\n const processedWrapper = bulkWrapper.querySelector('.wp-smush-all-done');\n if ( GlobalStats.getBoStats().failed_items ) {\n let completeMessage = wp_smush_msgs.all_failed;\n if ( ! this.isFailedAllItems() ) {\n completeMessage = wp_smush_msgs.error_in_bulk.replace( '{{smushed}}', GlobalStats.getBoStats().total_items - GlobalStats.getBoStats().failed_items )\n .replace('{{total}}', GlobalStats.getBoStats().total_items )\n .replace('{{errors}}', GlobalStats.getBoStats().failed_items );\n }\n processedWrapper.querySelector('p').innerHTML = completeMessage;\n processedWrapper.classList.remove('sui-notice-success', 'sui-notice-warning');\n const noticeType = this.getNoticeType();\n const noticeIcon = 'warning' === noticeType ? 'info' : 'check-tick';\n const iconElement = processedWrapper.querySelector('.sui-notice-icon');\n processedWrapper.classList.add( 'sui-notice-' + noticeType );\n iconElement.classList.remove('sui-icon-check-tick', 'sui-icon-info');\n iconElement.classList.add( 'sui-icon-' + noticeIcon );\n } else {\n processedWrapper.querySelector('p').innerHTML = wp_smush_msgs.all_smushed;\n }\n processedWrapper.classList.remove('sui-hidden');\n },\n isFailedAllItems() {\n return GlobalStats.getBoStats().failed_items === GlobalStats.getBoStats().total_items;\n },\n getNoticeType() {\n return this.isFailedAllItems() ? 'warning' : 'success';\n },\n onCompletedBulk() {\n // Reset and hide progress bar.\n this.onFinish();\n // Bulk is completed, hide bulk desc.\n SmushProgress.hideBulkSmushDescription();\n // Show completed message.\n this.showCompletedMessage();\n\n // Reset the progress when we finish so the next smushing starts from zero.\n SmushProgress.update(0, GlobalStats.getBoStats().total_items);\n },\n completeBulk() {\n // Sync Stats.\n this.syncStats(() => this.onCompletedBulk());\n },\n syncStats(onComplete = () => false) {\n return BO.handle('getStats').then((res) => {\n if ( res.success ) {\n const responseErrors = res.data.errors || {};\n this.updateStats( { global_stats: res.data, errors: responseErrors }, true );\n GlobalStats.renderStats();\n if ( res.data.content ) {\n $('#wp-smush-bulk-content').innerHTML = res.data.content;\n }\n onComplete();\n } else {\n WP_Smush.helpers.showNotice( res );\n }\n }).catch( (error) => console.log('error', error));\n },\n syncBackgroundStatus() {\n return BO.handle('getStatus').then((res) => {\n if ((res.data || {}).in_process_notice) {\n SmushProgress.setNotice( res.data.in_process_notice );\n }\n\n if (res.success) {\n // Update stats.\n if ( this.updateStats(res.data, false) ) {\n // Update progress bar.\n SmushProgress.update(GlobalStats.getBoStats().processed_items, GlobalStats.getBoStats().total_items);\n\n if (! GlobalStats.getBoStats().is_cancelled && ! GlobalStats.getBoStats().is_completed) {\n // Render stats.\n GlobalStats.renderStats();\n }\n }\n\n if (GlobalStats.getBoStats().is_cancelled && !cancellationInProgress) {\n // Cancelled on server side\n this.cancelBulk();\n } else if (GlobalStats.getBoStats().is_completed) {\n this.completeBulk();\n } else if ( GlobalStats.getBoStats().is_dead ) {\n this.onDead();\n }\n } else {\n WP_Smush.helpers.showNotice( res );\n }\n });\n },\n onStart() {\n // Disable btn.\n startBtn.setAttribute('disabled', '');\n // Disable re-check images.\n reScanImagesButton && reScanImagesButton.setAttribute('disabled', '');\n $('.wp-smush-restore').setAttribute('disabled', '');\n // Show upsell cdn.\n UpsellManger.maybeShowCDNUpsellForPreSiteOnStart();\n\n this.hideBulkSmushFailedNotice();\n\n\t\t\t\tthis.setCancelButtonStateToInitial();\n },\n hideBulkSmushFailedNotice() {\n const bulkSmushFailedNotice = document.querySelector( '.wp-smush-inline-retry-bulk-smush-notice' );\n if ( bulkSmushFailedNotice ) {\n bulkSmushFailedNotice.parentElement.classList.add( 'sui-hidden' );\n }\n },\n onFinish() {\n // Clear interval.\n if (intervalHandle) {\n clearInterval(intervalHandle);\n intervalHandle = 0;\n }\n\n // Disable btn.\n startBtn.removeAttribute('disabled');\n // Reset and hide Progress Bar.\n this.hideProgressBar();\n // Disable re-check images.\n reScanImagesButton && reScanImagesButton.removeAttribute('disabled', '');\n $('.wp-smush-restore').removeAttribute('disabled', '');\n\n // Show upsell cdn.\n UpsellManger.maybeShowCDNUpsellForPreSiteOnCompleted();\n },\n onDead() {\n this.onFinish();\n SmushProgress.showBulkSmushDescription();\n this.showRetryBulkSmushModal();\n },\n showRetryBulkSmushModal() {\n const retryModalElement = document.getElementById( 'smush-retry-bulk-smush-notice' );\n if ( ! window.SUI || ! retryModalElement ) {\n return;\n }\n \n retryModalElement.querySelector('.smush-retry-bulk-smush-notice-button').onclick = (e) => {\n e.preventDefault();\n window.SUI.closeModal( 'smush-retry-bulk-smush-notice' );\n this.start();\n }\n \n window.SUI.openModal(\n 'smush-retry-bulk-smush-notice',\n 'wpbody-content',\n undefined,\n false\n );\n },\n init() {\n if (!startBtn) {\n return;\n }\n\n // Start BO.\n startBtn.onclick = () => {\n const requiredScanMedia = startBtn.classList.contains('wp-smush-scan-and-bulk-smush');\n if ( requiredScanMedia ) {\n return;\n }\n this.start();\n }\n\n const triggerBulkSmushButton = document.querySelector( '.wp-smush-inline-retry-bulk-smush-notice .wp-smush-trigger-bulk-smush' );\n if ( triggerBulkSmushButton ) {\n triggerBulkSmushButton.addEventListener( 'click', ( e ) => {\n e.preventDefault();\n\n startBtn.click();\n } );\n }\n\n // If BO is running, initial new state.\n this.initState();\n },\n\t\t\tsetCancelButtonStateToInitial() {\n SmushProgress.setCancelButtonLabel( wp_smush_msgs.cancel );\n SmushProgress.setOnCancelCallback( this.cancel.bind(this) );\n\t\t\t},\n\t\t\tsetCancelButtonStateToStarted() {\n SmushProgress.setCancelButtonLabel( wp_smush_msgs.cancelling );\n SmushProgress.setOnCancelCallback( () => false );\n },\n }\n })();\n // Run.\n BackgroundSmush && BackgroundSmush.init();\n /**\n * For globalStats, we will need to update it on reload and after re-checking images,\n * and on finish the BO.\n * 1. On finish, we handled via BackgroundSmush.syncStats -> BackgroundSmush.updateStats\n * 2. On reload or after re-checking images, we need to update globalStats from global variable:\n * window.wp_smushit_data\n */\n // Update global stats after re-checking images.\n document.addEventListener('wpSmushAfterRecheckImages', function(){\n GlobalStats.updateGlobalStatsFromSmushScriptData();\n });\n \n document.addEventListener('backgroundBulkSmushOnScanCompleted', function(){\n\t\tif ( ! BackgroundSmush ) {\n\t\t\treturn;\n\t\t}\n GlobalStats.setBoStats({\n in_processing: true,\n });\n BackgroundSmush.initState();\n });\n})();","/* global WP_Smush */\n/* global ajaxurl */\n/* global _ */\n\nimport tracker from \"../utils/tracker\";\n\n/**\n * Bulk restore JavaScript code.\n *\n * @since 3.2.2\n */\n(function () {\n\t'use strict';\n\n\t/**\n\t * Bulk restore modal.\n\t *\n\t * @since 3.2.2\n\t */\n\tWP_Smush.restore = {\n\t\tmodal: document.getElementById('smush-restore-images-dialog'),\n\t\tcontentContainer: document.getElementById('smush-bulk-restore-content'),\n\t\tsettings: {\n\t\t\tslide: 'start', // start, progress or finish.\n\t\t\tsuccess: 0,\n\t\t\terrors: [],\n\t\t},\n\t\titems: [], // total items, 1 item = 1 step.\n\t\tsuccess: [], // successful items restored.\n\t\terrors: [], // failed items.\n\t\tcurrentStep: 0,\n\t\ttotalSteps: 0,\n\n\t\t/**\n\t\t * Init module.\n\t\t */\n\t\tinit() {\n\t\t\tif (!this.modal) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.settings = {\n\t\t\t\tslide: 'start',\n\t\t\t\tsuccess: 0,\n\t\t\t\terrors: [],\n\t\t\t};\n\n\t\t\tthis.resetModalWidth();\n\t\t\tthis.renderTemplate();\n\n\t\t\t// Show the modal.\n\n\t\t\twindow.SUI.openModal(\n\t\t\t\t'smush-restore-images-dialog',\n\t\t\t\t'wpbody-content',\n\t\t\t\tundefined,\n\t\t\t\tfalse\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update the template, register new listeners.\n\t\t */\n\t\trenderTemplate() {\n\t\t\tconst template = WP_Smush.onboarding.template('smush-bulk-restore');\n\t\t\tconst content = template(this.settings);\n\n\t\t\tif (content) {\n\t\t\t\tthis.contentContainer.innerHTML = content;\n\t\t\t}\n\n\t\t\tthis.bindSubmit();\n\t\t},\n\n\t\t/**\n\t\t * Reset modal width.\n\t\t *\n\t\t * @since 3.6.0\n\t\t */\n\t\tresetModalWidth() {\n\t\t\tthis.modal.style.maxWidth = '460px';\n\t\t\tthis.modal.querySelector('.sui-box').style.maxWidth = '460px';\n\t\t},\n\n\t\t/**\n\t\t * Catch \"Finish setup wizard\" button click.\n\t\t */\n\t\tbindSubmit() {\n\t\t\tconst confirmButton = this.modal.querySelector(\n\t\t\t\t'button[id=\"smush-bulk-restore-button\"]'\n\t\t\t);\n\t\t\tconst self = this;\n\n\t\t\tif (confirmButton) {\n\t\t\t\tconfirmButton.addEventListener('click', function (e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tself.resetModalWidth();\n\n\t\t\t\t\tself.settings = { slide: 'progress' };\n\t\t\t\t\tself.errors = [];\n\n\t\t\t\t\tself.renderTemplate();\n\t\t\t\t\tself.initScan();\n\n\t\t\t\t\ttracker.track('Bulk Restore Triggered');\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Cancel the bulk restore.\n\t\t */\n\t\tcancel() {\n\t\t\tif (\n\t\t\t\t'start' === this.settings.slide ||\n\t\t\t\t'finish' === this.settings.slide\n\t\t\t) {\n\t\t\t\t// Hide the modal.\n\t\t\t\twindow.SUI.closeModal();\n\t\t\t} else {\n\t\t\t\tthis.updateProgressBar(true);\n\t\t\t\twindow.location.reload();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Update progress bar during directory smush.\n\t\t *\n\t\t * @param {boolean} cancel Cancel status.\n\t\t */\n\t\tupdateProgressBar(cancel = false) {\n\t\t\tlet progress = 0;\n\t\t\tif (0 < this.currentStep) {\n\t\t\t\tprogress = Math.min(\n\t\t\t\t\tMath.round((this.currentStep * 100) / this.totalSteps),\n\t\t\t\t\t99\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (progress > 100) {\n\t\t\t\tprogress = 100;\n\t\t\t}\n\n\t\t\t// Update progress bar\n\t\t\tthis.modal.querySelector('.sui-progress-text span').innerHTML =\n\t\t\t\tprogress + '%';\n\t\t\tthis.modal.querySelector('.sui-progress-bar span').style.width =\n\t\t\t\tprogress + '%';\n\n\t\t\tconst statusDiv = this.modal.querySelector(\n\t\t\t\t'.sui-progress-state-text'\n\t\t\t);\n\t\t\tif (progress >= 90) {\n\t\t\t\tstatusDiv.innerHTML = 'Finalizing...';\n\t\t\t} else if (cancel) {\n\t\t\t\tstatusDiv.innerHTML = 'Cancelling...';\n\t\t\t} else {\n\t\t\t\tstatusDiv.innerHTML =\n\t\t\t\t\tthis.currentStep +\n\t\t\t\t\t'/' +\n\t\t\t\t\tthis.totalSteps +\n\t\t\t\t\t' ' +\n\t\t\t\t\t'images restored';\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * First step in bulk restore - get the bulk attachment count.\n\t\t */\n\t\tinitScan() {\n\t\t\tconst self = this;\n\t\t\tconst _nonce = document.getElementById('_wpnonce');\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', ajaxurl + '?action=get_image_count', true);\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tif (200 === xhr.status) {\n\t\t\t\t\tconst res = JSON.parse(xhr.response);\n\t\t\t\t\tif ('undefined' !== typeof res.data.items) {\n\t\t\t\t\t\tself.items = res.data.items;\n\t\t\t\t\t\tself.totalSteps = res.data.items.length;\n\t\t\t\t\t\tself.step();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twindow.console.log(\n\t\t\t\t\t\t'Request failed. Returned status of ' + xhr.status\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send('_ajax_nonce=' + _nonce.value);\n\t\t},\n\n\t\t/**\n\t\t * Execute a scan step recursively\n\t\t */\n\t\tstep() {\n\t\t\tconst self = this;\n\t\t\tconst _nonce = document.getElementById('_wpnonce');\n\n\t\t\tif (0 < this.items.length) {\n\t\t\t\tconst item = this.items.pop();\n\t\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\t\txhr.open('POST', ajaxurl + '?action=restore_step', true);\n\t\t\t\txhr.setRequestHeader(\n\t\t\t\t\t'Content-type',\n\t\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t\t);\n\t\t\t\txhr.onload = () => {\n\t\t\t\t\tthis.currentStep++;\n\n\t\t\t\t\tif (200 === xhr.status) {\n\t\t\t\t\t\tconst res = JSON.parse(xhr.response);\n\t\t\t\t\t\tconst data = ((res || {}).data || {});\n\t\t\t\t\t\tif (data.success) {\n\t\t\t\t\t\t\tself.success.push(item);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tself.errors.push({\n\t\t\t\t\t\t\t\tid: item,\n\t\t\t\t\t\t\t\tsrc: data.src || \"Error\",\n\t\t\t\t\t\t\t\tthumb: data.thumb,\n\t\t\t\t\t\t\t\tlink: data.link,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tself.updateProgressBar();\n\t\t\t\t\tself.step();\n\t\t\t\t};\n\t\t\t\txhr.send('item=' + item + '&_ajax_nonce=' + _nonce.value);\n\t\t\t} else {\n\t\t\t\t// Finish.\n\t\t\t\tthis.settings = {\n\t\t\t\t\tslide: 'finish',\n\t\t\t\t\tsuccess: this.success.length,\n\t\t\t\t\terrors: this.errors,\n\t\t\t\t\ttotal: this.totalSteps,\n\t\t\t\t};\n\n\t\t\t\tself.renderTemplate();\n\t\t\t\tif (0 < this.errors.length) {\n\t\t\t\t\tthis.modal.style.maxWidth = '660px';\n\t\t\t\t\tthis.modal.querySelector('.sui-box').style.maxWidth =\n\t\t\t\t\t\t'660px';\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t};\n\n\t/**\n\t * Template function (underscores based).\n\t *\n\t * @type {Function}\n\t */\n\tWP_Smush.restore.template = _.memoize((id) => {\n\t\tlet compiled;\n\t\tconst options = {\n\t\t\tevaluate: /<#([\\s\\S]+?)#>/g,\n\t\t\tinterpolate: /{{{([\\s\\S]+?)}}}/g,\n\t\t\tescape: /{{([^}]+?)}}(?!})/g,\n\t\t\tvariable: 'data',\n\t\t};\n\n\t\treturn (data) => {\n\t\t\t_.templateSettings = options;\n\t\t\tcompiled =\n\t\t\t\tcompiled || _.template(document.getElementById(id).innerHTML);\n\t\t\treturn compiled(data);\n\t\t};\n\t});\n})();\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * Bulk Smush functionality.\n *\n * @since 2.9.0 Moved from admin.js\n */\n\nimport Smush from '../smush/smush';\nimport Fetcher from '../utils/fetcher';\nimport SmushProcess from '../common/progressbar';\n\n( function( $ ) {\n\t'use strict';\n\n\tWP_Smush.bulk = {\n\t\tinit() {\n\t\t\tthis.onClickBulkSmushNow();\n\t\t\tthis.onClickIgnoreImage();\n\t\t\tthis.onClickIgnoreAllImages();\n\t\t\tthis.onScanCompleted();\n\t\t},\n\t\tonClickBulkSmushNow() {\n\t\t\t/**\n\t\t\t * Handle the Bulk Smush/Bulk re-Smush button click.\n\t\t\t */\n\t\t\t$( '.wp-smush-all' ).on( 'click', function( e ) {\n\t\t\t\tconst bulkSmushButton = $(this);\n\t\t\t\tif ( bulkSmushButton.hasClass('wp-smush-scan-and-bulk-smush') ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\n\t\t\t\tWP_Smush.bulk.ajaxBulkSmushStart( bulkSmushButton );\n\t\t\t} );\n\t\t},\n\t\tajaxBulkSmushStart( bulkSmushButton ) {\n\t\t\tbulkSmushButton = bulkSmushButton || $( '#wp-smush-bulk-content .wp-smush-all' );\n\t\t\t// Check for IDs, if there is none (unsmushed or lossless), don't call Smush function.\n\t\t\t/** @param {Array} wp_smushit_data.unsmushed */\n\t\t\tif (\n\t\t\t\t'undefined' === typeof window.wp_smushit_data ||\n\t\t\t\t( 0 === window.wp_smushit_data.unsmushed.length &&\n\t\t\t\t\t0 === window.wp_smushit_data.resmush.length )\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// Disable re-Smush and scan button.\n\t\t\t// TODO: refine what is disabled.\n\t\t\t$(\n\t\t\t\t'.wp-resmush.wp-smush-action, .wp-smush-scan, .wp-smush-all:not(.sui-progress-close), a.wp-smush-lossy-enable, button.wp-smush-resize-enable, button#save-settings-button'\n\t\t\t).prop( 'disabled', true );\n\n\t\t\tif ( bulkSmushButton.hasClass('wp-smush-resume-bulk-smush') && this.bulkSmush ) {\n\t\t\t\tthis.resumeBulkSmush();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tthis.bulkSmush = new Smush( bulkSmushButton, true );\n\t\t\tSmushProcess.setOnCancelCallback( () => {\n\t\t\t\tthis.bulkSmush.cancelAjax()\n\t\t\t}).update( 0, this.bulkSmush.ids.length ).show();\n\n\t\t\t// Show upsell cdn.\n\t\t\tthis.maybeShowCDNUpsellForPreSiteOnStart();\n\n\t\t\t// Run bulk Smush.\n\t\t\tthis.bulkSmush.run();\n\t\t},\n\t\tresumeBulkSmush() {\n\t\t\tSmushProcess.disableExceedLimitMode();\n\t\t\tSmushProcess.hideBulkSmushDescription();\n\t\t\tthis.bulkSmush.onStart();\n\t\t\tthis.bulkSmush.callAjax();\n\t\t},\n\t\tonClickIgnoreImage() {\n\t\t\t/**\n\t\t\t * Ignore file from bulk Smush.\n\t\t\t *\n\t\t\t * @since 2.9.0\n\t\t\t */\n\t\t\t$( 'body' ).on( 'click', '.smush-ignore-image', function( e ) {\n\t\t\t\te.preventDefault();\n\n\t\t\t\tconst self = $( this );\n\n\t\t\t\tself.prop( 'disabled', true );\n\t\t\t\tself.attr( 'data-tooltip' );\n\t\t\t\tself.removeClass( 'sui-tooltip' );\n\t\t\t\t$.post( ajaxurl, {\n\t\t\t\t\taction: 'ignore_bulk_image',\n\t\t\t\t\tid: self.attr( 'data-id' ),\n\t\t\t\t\t_ajax_nonce: wp_smush_msgs.nonce,\n\t\t\t\t} ).done( ( response ) => {\n\t\t\t\t\tif ( self.is( 'a' ) && response.success && 'undefined' !== typeof response.data.html ) {\n\t\t\t\t\t\tif( self.closest('.smush-status-links') ) {\n\t\t\t\t\t\t\tself.closest('.smush-status-links').parent().html( response.data.html );\n\t\t\t\t\t\t} else if (e.target.closest( '.smush-bulk-error-row' ) ){\n\t\t\t\t\t\t\tself.addClass('disabled');\n\t\t\t\t\t\t\te.target.closest( '.smush-bulk-error-row' ).style.opacity = 0.5;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} );\n\t\t},\n\t\tonClickIgnoreAllImages() {\n\t\t\t/**\n\t\t\t * Ignore file from bulk Smush.\n\t\t\t *\n\t\t\t * @since 3.12.0\n\t\t\t */\n\t\t\tconst ignoreAll = document.querySelector('.wp_smush_ignore_all_failed_items');\n\t\t\tif ( ignoreAll ) {\n\t\t\t\tignoreAll.onclick = (e) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.target.setAttribute('disabled','');\n\t\t\t\t\te.target.style.cursor = 'progress';\n\t\t\t\t\tconst type = e.target.dataset.type || null;\n\t\t\t\t\te.target.classList.remove('sui-tooltip');\n\t\t\t\t\tFetcher.smush.ignoreAll(type).then((res) => {\n\t\t\t\t\t\tif ( res.success ) {\n\t\t\t\t\t\t\twindow.location.reload();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\te.target.style.cursor = 'pointer';\n\t\t\t\t\t\t\te.target.removeAttribute('disabled');\n\t\t\t\t\t\t\tWP_Smush.helpers.showNotice( res );\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tonScanCompleted() {\n\t\t\tdocument.addEventListener('ajaxBulkSmushOnScanCompleted', (e) => {\n\t\t\t\tthis.ajaxBulkSmushStart();\n\t\t\t});\n\t\t},\n\t\tmaybeShowCDNUpsellForPreSiteOnStart: () => {\n\t\t\t// Show upsell cdn.\n\t\t\tconst upsell_cdn = document.querySelector('.wp-smush-upsell-cdn');\n\t\t\tif ( upsell_cdn ) {\n\t\t\t\tupsell_cdn.classList.remove('sui-hidden');\n\t\t\t}\n\t\t}\n\t\t\n\t};\n\n\tWP_Smush.bulk.init();\n} )( jQuery );\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * Directory Smush module JavaScript code.\n *\n * @since 2.8.1 Separated from admin.js into dedicated file.\n */\n\nimport { createTree } from 'jquery.fancytree';\nimport Scanner from '../smush/directory-scanner';\n\n( function( $ ) {\n\t'use strict';\n\n\tWP_Smush.directory = {\n\t\tselected: [],\n\t\ttree: [],\n\t\twp_smush_msgs: [],\n\t\ttriggered: false,\n\n\t\tinit() {\n\t\t\tconst self = this,\n\t\t\t\tprogressDialog = $( '#wp-smush-progress-dialog' );\n\n\t\t\tlet totalSteps = 0,\n\t\t\t\tcurrentScanStep = 0;\n\n\t\t\t// Make sure directory smush vars are set.\n\t\t\tif ( typeof window.wp_smushit_data.dir_smush !== 'undefined' ) {\n\t\t\t\ttotalSteps = window.wp_smushit_data.dir_smush.totalSteps;\n\t\t\t\tcurrentScanStep =\n\t\t\t\t\twindow.wp_smushit_data.dir_smush.currentScanStep;\n\t\t\t}\n\n\t\t\t// Init image scanner.\n\t\t\tthis.scanner = new Scanner( totalSteps, currentScanStep );\n\n\t\t\t/**\n\t\t\t * Smush translation strings.\n\t\t\t *\n\t\t\t * @param {Array} wp_smush_msgs\n\t\t\t */\n\t\t\tthis.wp_smush_msgs = window.wp_smush_msgs || {};\n\n\t\t\t/**\n\t\t\t * Open the \"Select Smush directory\" modal.\n\t\t\t */\n\t\t\t$( 'button.wp-smush-browse, a#smush-directory-open-modal' ).on(\n\t\t\t\t'click',\n\t\t\t\tfunction( e ) {\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tif ( $( e.currentTarget ).hasClass( 'wp-smush-browse' ) ) {\n\t\t\t\t\t\t// Hide all the notices.\n\t\t\t\t\t\t$( 'div.wp-smush-scan-result div.wp-smush-notice' ).hide();\n\n\t\t\t\t\t\t// Remove notice.\n\t\t\t\t\t\t$( 'div.wp-smush-info' ).remove();\n\t\t\t\t\t}\n\n\t\t\t\t\twindow.SUI.openModal(\n\t\t\t\t\t\t'wp-smush-list-dialog',\n\t\t\t\t\t\te.currentTarget,\n\t\t\t\t\t\t$(\n\t\t\t\t\t\t\t'#wp-smush-list-dialog .sui-box-header [data-modal-close]'\n\t\t\t\t\t\t)[0],\n\t\t\t\t\t\ttrue\n\t\t\t\t\t);\n\t\t\t\t\t//Display File tree for Directory Smush\n\t\t\t\t\tself.initFileTree();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Smush images: Smush in Choose Directory modal clicked\n\t\t\t */\n\t\t\t$( '#wp-smush-select-dir' ).on( 'click', function( e ) {\n\t\t\t\te.preventDefault();\n\n\t\t\t\t$( 'div.wp-smush-list-dialog div.sui-box-body' ).css( {\n\t\t\t\t\topacity: '0.8',\n\t\t\t\t} );\n\t\t\t\t$( 'div.wp-smush-list-dialog div.sui-box-body a' ).off(\n\t\t\t\t\t'click'\n\t\t\t\t);\n\n\t\t\t\tconst button = $( this );\n\n\t\t\t\t// Display the spinner.\n\t\t\t\tbutton.addClass('sui-button-onload');\n\n\t\t\t\tconst selectedFolders = self.tree.getSelectedNodes();\n\n\t\t\t\tconst paths = [];\n\t\t\t\tselectedFolders.forEach( function( folder ) {\n\t\t\t\t\tpaths.push( folder.key );\n\t\t\t\t} );\n\n\t\t\t\t// Send a ajax request to get a list of all the image files\n\t\t\t\tconst param = {\n\t\t\t\t\taction: 'image_list',\n\t\t\t\t\tsmush_path: paths,\n\t\t\t\t\timage_list_nonce: $(\n\t\t\t\t\t\t'input[name=\"image_list_nonce\"]'\n\t\t\t\t\t).val(),\n\t\t\t\t};\n\n\t\t\t\t$.post( ajaxurl, param, function( response ) {\n\t\t\t\t\tif ( response.success ) {\n\t\t\t\t\t\t// Close the modal.\n\t\t\t\t\t\twindow.SUI.closeModal();\n\n\t\t\t\t\t\tself.scanner = new Scanner( response.data, 0 );\n\t\t\t\t\t\tself.showProgressDialog( response.data );\n\t\t\t\t\t\tself.scanner.scan();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Remove the spinner.\n\t\t\t\t\t\tbutton.removeClass('sui-button-onload');\n\n\t\t\t\t\t\twindow.SUI.openNotice(\n\t\t\t\t\t\t\t'wp-smush-ajax-notice',\n\t\t\t\t\t\t\tresponse.data.message,\n\t\t\t\t\t\t\t{ type: 'warning' }\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} );\n\n\t\t\t/**\n\t\t\t * Cancel scan.\n\t\t\t */\n\t\t\tprogressDialog.on(\n\t\t\t\t'click',\n\t\t\t\t'#cancel-directory-smush, #dialog-close-div, .wp-smush-cancel-dir',\n\t\t\t\tfunction( e ) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t// Display the spinner\n\t\t\t\t\t$( '.wp-smush-cancel-dir' ).addClass( 'sui-button-onload' );\n\t\t\t\t\tself.scanner\n\t\t\t\t\t\t.cancel()\n\t\t\t\t\t\t.done(\n\t\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\t\t( window.location.href =\n\t\t\t\t\t\t\t\t\tself.wp_smush_msgs.directory_url )\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Continue scan.\n\t\t\t */\n\t\t\tprogressDialog.on(\n\t\t\t\t'click',\n\t\t\t\t'.sui-icon-play, .wp-smush-resume-scan',\n\t\t\t\tfunction( e ) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tself.scanner.resume();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Check to see if we should open the directory module.\n\t\t\t * Used to redirect from dashboard page.\n\t\t\t *\n\t\t\t * @since 3.8.6\n\t\t\t */\n\t\t\tconst queryString = window.location.search;\n\t\t\tconst urlParams = new URLSearchParams( queryString );\n\t\t\tif ( urlParams.has( 'start' ) && ! this.triggered ) {\n\t\t\t\tthis.triggered = true;\n\t\t\t\t$( 'button.wp-smush-browse' ).trigger( 'click' );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Init fileTree.\n\t\t */\n\t\tinitFileTree() {\n\t\t\tconst self = this,\n\t\t\t\tsmushButton = $( 'button#wp-smush-select-dir' ),\n\t\t\t\tajaxSettings = {\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\turl: ajaxurl,\n\t\t\t\t\tdata: {\n\t\t\t\t\t\taction: 'smush_get_directory_list',\n\t\t\t\t\t\tlist_nonce: $( 'input[name=\"list_nonce\"]' ).val(),\n\t\t\t\t\t},\n\t\t\t\t\tcache: false,\n\t\t\t\t};\n\n\t\t\t// Object already defined.\n\t\t\tif ( Object.entries( self.tree ).length > 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tself.tree = createTree( '.wp-smush-list-dialog .content', {\n\t\t\t\tautoCollapse: true, // Automatically collapse all siblings, when a node is expanded\n\t\t\t\tclickFolderMode: 3, // 1:activate, 2:expand, 3:activate and expand, 4:activate (dblclick expands)\n\t\t\t\tcheckbox: true, // Show checkboxes\n\t\t\t\tdebugLevel: 0, // 0:quiet, 1:errors, 2:warnings, 3:infos, 4:debug\n\t\t\t\tselectMode: 3, // 1:single, 2:multi, 3:multi-hier\n\t\t\t\ttabindex: '0', // Whole tree behaves as one single control\n\t\t\t\tkeyboard: true, // Support keyboard navigation\n\t\t\t\tquicksearch: true, // Navigate to next node by typing the first letters\n\t\t\t\tsource: ajaxSettings,\n\t\t\t\tlazyLoad: ( event, data ) => {\n\t\t\t\t\tdata.result = new Promise( function( resolve, reject ) {\n\t\t\t\t\t\tajaxSettings.data.dir = data.node.key;\n\t\t\t\t\t\t$.ajax( ajaxSettings )\n\t\t\t\t\t\t\t.done( ( response ) => resolve( response ) )\n\t\t\t\t\t\t\t.fail( reject );\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t\tloadChildren: ( event, data ) =>\n\t\t\t\t\tdata.node.fixSelection3AfterClick(), // Apply parent's state to new child nodes:\n\t\t\t\tselect: () =>\n\t\t\t\t\tsmushButton.prop(\n\t\t\t\t\t\t'disabled',\n\t\t\t\t\t\t! +self.tree.getSelectedNodes().length\n\t\t\t\t\t),\n\t\t\t\tinit: () => smushButton.prop( 'disabled', true ),\n\t\t\t} );\n\t\t},\n\n\t\t/**\n\t\t * Show progress dialog.\n\t\t *\n\t\t * @param {number} items Number of items in the scan.\n\t\t */\n\t\tshowProgressDialog( items ) {\n\t\t\t// Update items status and show the progress dialog..\n\t\t\t$( '.wp-smush-progress-dialog .sui-progress-state-text' ).html(\n\t\t\t\t'0/' + items + ' ' + self.wp_smush_msgs.progress_smushed\n\t\t\t);\n\n\t\t\twindow.SUI.openModal(\n\t\t\t\t'wp-smush-progress-dialog',\n\t\t\t\t'dialog-close-div',\n\t\t\t\tundefined,\n\t\t\t\tfalse\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update progress bar during directory smush.\n\t\t *\n\t\t * @param {number} progress Current progress in percent.\n\t\t * @param {boolean} cancel Cancel status.\n\t\t */\n\t\tupdateProgressBar( progress, cancel = false ) {\n\t\t\tif ( progress > 100 ) {\n\t\t\t\tprogress = 100;\n\t\t\t}\n\n\t\t\t// Update progress bar\n\t\t\t$( '.sui-progress-block .sui-progress-text span' ).text(\n\t\t\t\tprogress + '%'\n\t\t\t);\n\t\t\t$( '.sui-progress-block .sui-progress-bar span' ).width(\n\t\t\t\tprogress + '%'\n\t\t\t);\n\n\t\t\tif ( progress >= 90 ) {\n\t\t\t\t$( '.sui-progress-state .sui-progress-state-text' ).text(\n\t\t\t\t\t'Finalizing...'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( cancel ) {\n\t\t\t\t$( '.sui-progress-state .sui-progress-state-text' ).text(\n\t\t\t\t\t'Cancelling...'\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t};\n\n\tWP_Smush.directory.init();\n}( jQuery ) );\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * Directory scanner module that will Smush images in the Directory Smush modal.\n *\n * @since 2.8.1\n *\n * @param {string|number} totalSteps\n * @param {string|number} currentStep\n * @return {Object} Scan object.\n * @class\n */\nconst DirectoryScanner = ( totalSteps, currentStep ) => {\n\ttotalSteps = parseInt( totalSteps );\n\tcurrentStep = parseInt( currentStep );\n\n\tlet cancelling = false,\n\t\tfailedItems = 0,\n\t\tskippedItems = 0;\n\n\tconst obj = {\n\t\tscan() {\n\t\t\tconst remainingSteps = totalSteps - currentStep;\n\t\t\tif ( currentStep !== 0 ) {\n\t\t\t\t// Scan started on a previous page load.\n\t\t\t\tstep( remainingSteps ).fail( this.showScanError );\n\t\t\t} else {\n\t\t\t\tjQuery\n\t\t\t\t\t.post( ajaxurl, {\n\t\t\t\t\t\taction: 'directory_smush_start',\n\t\t\t\t\t\t_ajax_nonce: window.wp_smush_msgs.nonce\n\t\t\t\t\t}, () =>\n\t\t\t\t\t\tstep( remainingSteps ).fail( this.showScanError )\n\t\t\t\t\t)\n\t\t\t\t\t.fail( this.showScanError );\n\t\t\t}\n\t\t},\n\n\t\tcancel() {\n\t\t\tcancelling = true;\n\t\t\treturn jQuery.post( ajaxurl, {\n\t\t\t\taction: 'directory_smush_cancel',\n\t\t\t\t_ajax_nonce: window.wp_smush_msgs.nonce\n\t\t\t} );\n\t\t},\n\n\t\tgetProgress() {\n\t\t\tif ( cancelling ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t// O M G ... Logic at it's finest!\n\t\t\tconst remainingSteps = totalSteps - currentStep;\n\t\t\treturn Math.min(\n\t\t\t\tMath.round(\n\t\t\t\t\t( parseInt( totalSteps - remainingSteps ) * 100 ) /\n\t\t\t\t\ttotalSteps\n\t\t\t\t),\n\t\t\t\t99\n\t\t\t);\n\t\t},\n\n\t\tonFinishStep( progress ) {\n\t\t\tjQuery( '.wp-smush-progress-dialog .sui-progress-state-text' ).html(\n\t\t\t\tcurrentStep -\n\t\t\t\tfailedItems +\n\t\t\t\t'/' +\n\t\t\t\ttotalSteps +\n\t\t\t\t' ' +\n\t\t\t\twindow.wp_smush_msgs.progress_smushed\n\t\t\t);\n\t\t\tWP_Smush.directory.updateProgressBar( progress );\n\t\t},\n\n\t\tonFinish() {\n\t\t\tWP_Smush.directory.updateProgressBar( 100 );\n\t\t\twindow.location.href =\n\t\t\t\twindow.wp_smush_msgs.directory_url + '&scan=done';\n\t\t},\n\n\t\t/**\n\t\t * Displays an error when the scan request fails.\n\t\t *\n\t\t * @param {Object} res XHR object.\n\t\t */\n\t\tshowScanError( res ) {\n\t\t\tconst dialog = jQuery( '#wp-smush-progress-dialog' );\n\n\t\t\t// Add the error class to show/hide elements in the dialog.\n\t\t\tdialog\n\t\t\t\t.removeClass( 'wp-smush-exceed-limit' )\n\t\t\t\t.addClass( 'wp-smush-scan-error' );\n\n\t\t\t// Add the error status and description to the error message.\n\t\t\tdialog\n\t\t\t\t.find( '#smush-scan-error' )\n\t\t\t\t.text( `${ res.status } ${ res.statusText }` );\n\n\t\t\t// Show/hide the 403 error specific instructions.\n\t\t\tconst forbiddenMessage = dialog.find( '.smush-403-error-message' );\n\t\t\tif ( 403 !== res.status ) {\n\t\t\t\tforbiddenMessage.addClass( 'sui-hidden' );\n\t\t\t} else {\n\t\t\t\tforbiddenMessage.removeClass( 'sui-hidden' );\n\t\t\t}\n\t\t},\n\n\t\tlimitReached() {\n\t\t\tconst dialog = jQuery( '#wp-smush-progress-dialog' );\n\n\t\t\tdialog.addClass( 'wp-smush-exceed-limit' );\n\t\t\tdialog\n\t\t\t\t.find( '#cancel-directory-smush' )\n\t\t\t\t.attr( 'data-tooltip', window.wp_smush_msgs.bulk_resume );\n\t\t\tdialog\n\t\t\t\t.find( '.sui-box-body .sui-icon-close' )\n\t\t\t\t.removeClass( 'sui-icon-close' )\n\t\t\t\t.addClass( 'sui-icon-play' );\n\t\t\tdialog\n\t\t\t\t.find( '#cancel-directory-smush' )\n\t\t\t\t.attr( 'id', 'cancel-directory-smush-disabled' );\n\t\t},\n\n\t\tresume() {\n\t\t\tconst dialog = jQuery( '#wp-smush-progress-dialog' );\n\t\t\tconst resume = dialog.find( '#cancel-directory-smush-disabled' );\n\n\t\t\tdialog.removeClass( 'wp-smush-exceed-limit' );\n\t\t\tdialog\n\t\t\t\t.find( '.sui-box-body .sui-icon-play' )\n\t\t\t\t.removeClass( 'sui-icon-play' )\n\t\t\t\t.addClass( 'sui-icon-close' );\n\t\t\tresume.attr( 'data-tooltip', 'Cancel' );\n\t\t\tresume.attr( 'id', 'cancel-directory-smush' );\n\n\t\t\tobj.scan();\n\t\t},\n\t};\n\n\t/**\n\t * Execute a scan step recursively\n\t *\n\t * Private to avoid overriding\n\t *\n\t * @param {number} remainingSteps\n\t */\n\tconst step = function( remainingSteps ) {\n\t\tif ( remainingSteps >= 0 ) {\n\t\t\tcurrentStep = totalSteps - remainingSteps;\n\t\t\treturn jQuery.post(\n\t\t\t\tajaxurl,\n\t\t\t\t{\n\t\t\t\t\taction: 'directory_smush_check_step',\n\t\t\t\t\t_ajax_nonce: window.wp_smush_msgs.nonce,\n\t\t\t\t\tstep: currentStep,\n\t\t\t\t},\n\t\t\t\t( response ) => {\n\t\t\t\t\t// We're good - continue on.\n\t\t\t\t\tif (\n\t\t\t\t\t\t'undefined' !== typeof response.success &&\n\t\t\t\t\t\tresponse.success\n\t\t\t\t\t) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t'undefined' !== typeof response.data &&\n\t\t\t\t\t\t\t'undefined' !== typeof response.data.skipped &&\n\t\t\t\t\t\t\ttrue === response.data.skipped\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tskippedItems++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrentStep++;\n\t\t\t\t\t\tremainingSteps = remainingSteps - 1;\n\t\t\t\t\t\tobj.onFinishStep( obj.getProgress() );\n\t\t\t\t\t\tstep( remainingSteps ).fail( obj.showScanError );\n\t\t\t\t\t} else if (\n\t\t\t\t\t\t'undefined' !== typeof response.data.error &&\n\t\t\t\t\t\t'dir_smush_limit_exceeded' === response.data.error\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Limit reached. Stop.\n\t\t\t\t\t\tobj.limitReached();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Error? never mind, continue, but count them.\n\t\t\t\t\t\tfailedItems++;\n\t\t\t\t\t\tcurrentStep++;\n\t\t\t\t\t\tremainingSteps = remainingSteps - 1;\n\t\t\t\t\t\tobj.onFinishStep( obj.getProgress() );\n\t\t\t\t\t\tstep( remainingSteps ).fail( obj.showScanError );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\treturn jQuery.post(\n\t\t\tajaxurl,\n\t\t\t{\n\t\t\t\taction: 'directory_smush_finish',\n\t\t\t\t_ajax_nonce: window.wp_smush_msgs.nonce,\n\t\t\t\titems: totalSteps - ( failedItems + skippedItems ),\n\t\t\t\tfailed: failedItems,\n\t\t\t\tskipped: skippedItems,\n\t\t\t},\n\t\t\t( response ) => obj.onFinish( response )\n\t\t);\n\t};\n\n\treturn obj;\n};\n\nexport default DirectoryScanner;\n","/* global WP_Smush */\n/* global ajaxurl */\n/* global wp_smush_msgs */\n\n/**\n * Helpers functions.\n *\n * @since 2.9.0 Moved from admin.js\n */\n( function() {\n\t'use strict';\n\n\tWP_Smush.helpers = {\n\t\tinit: () => {},\n\t\tcacheUpsellErrorCodes: [],\n\n\t\t/**\n\t\t * Convert bytes to human-readable form.\n\t\t *\n\t\t * @param {number} a Bytes\n\t\t * @param {number} b Number of digits\n\t\t * @return {*} Formatted Bytes\n\t\t */\n\t\tformatBytes: ( a, b ) => {\n\t\t\tconst thresh = 1024,\n\t\t\t\tunits = [ 'KB', 'MB', 'GB', 'TB', 'PB' ];\n\n\t\t\tif ( Math.abs( a ) < thresh ) {\n\t\t\t\treturn a + ' B';\n\t\t\t}\n\n\t\t\tlet u = -1;\n\n\t\t\tdo {\n\t\t\t\ta /= thresh;\n\t\t\t\t++u;\n\t\t\t} while ( Math.abs( a ) >= thresh && u < units.length - 1 );\n\n\t\t\treturn a.toFixed( b ) + ' ' + units[ u ];\n\t\t},\n\n\t\t/**\n\t\t * Get size from a string.\n\t\t *\n\t\t * @param {string} formattedSize Formatter string\n\t\t * @return {*} Formatted Bytes\n\t\t */\n\t\tgetSizeFromString: ( formattedSize ) => {\n\t\t\treturn formattedSize.replace( /[a-zA-Z]/g, '' ).trim();\n\t\t},\n\n\t\t/**\n\t\t * Get type from formatted string.\n\t\t *\n\t\t * @param {string} formattedSize Formatted string\n\t\t * @return {*} Formatted Bytes\n\t\t */\n\t\tgetFormatFromString: ( formattedSize ) => {\n\t\t\treturn formattedSize.replace( /[0-9.]/g, '' ).trim();\n\t\t},\n\n\t\t/**\n\t\t * Stackoverflow: http://stackoverflow.com/questions/1726630/formatting-a-number-with-exactly-two-decimals-in-javascript\n\t\t *\n\t\t * @param {number} num\n\t\t * @param {number} decimals\n\t\t * @return {number} Number\n\t\t */\n\t\tprecise_round: ( num, decimals ) => {\n\t\t\tconst sign = num >= 0 ? 1 : -1;\n\t\t\t// Keep the percentage below 100.\n\t\t\tnum = num > 100 ? 100 : num;\n\t\t\treturn (\n\t\t\t\tMath.round( num * Math.pow( 10, decimals ) + sign * 0.001 ) /\n\t\t\t\tMath.pow( 10, decimals )\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Displays a floating error message using the #wp-smush-ajax-notice container.\n\t\t *\n\t\t * @since 3.8.0\n\t\t *\n\t\t * @param {string} message\n\t\t */\n\t\tshowErrorNotice: ( message ) => {\n\t\t\tif ( 'undefined' === typeof message ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst noticeMessage = `<p>${ message }</p>`,\n\t\t\t\tnoticeOptions = {\n\t\t\t\t\ttype: 'error',\n\t\t\t\t\ticon: 'info',\n\t\t\t\t};\n\n\t\t\tSUI.openNotice( 'wp-smush-ajax-notice', noticeMessage, noticeOptions );\n\n\t\t\tconst loadingButton = document.querySelector( '.sui-button-onload' );\n\t\t\tif ( loadingButton ) {\n\t\t\t\tloadingButton.classList.remove( 'sui-button-onload' );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Reset settings.\n\t\t *\n\t\t * @since 3.2.0\n\t\t */\n\t\tresetSettings: () => {\n\t\t\tconst _nonce = document.getElementById( 'wp_smush_reset' );\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open( 'POST', ajaxurl + '?action=reset_settings', true );\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tconst res = JSON.parse( xhr.response );\n\t\t\t\t\tif ( 'undefined' !== typeof res.success && res.success ) {\n\t\t\t\t\t\twindow.location.href = wp_smush_msgs.smush_url;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twindow.console.log(\n\t\t\t\t\t\t'Request failed. Returned status of ' + xhr.status\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send( '_ajax_nonce=' + _nonce.value );\n\t\t},\n\n\t\t/**\n\t\t * Prepare error row. Will only allow to hide errors for WP media attachments (not nextgen).\n\t\t *\n\t\t * @since 1.9.0\n\t\t * @since 3.12.0 Moved from Smush.\n\t\t *\n\t\t * @param {string} errorMsg Error message.\n\t\t * @param {string} fileName File name.\n\t\t * @param {string} thumbnail Thumbnail for image (if available).\n\t\t * @param {number} id Image ID.\n\t\t * @param {string} type Smush type: media or netxgen.\n\t\t * @param {string} errorCode Error code.\n\t\t *\n\t\t * @return {string} Row with error.\n\t\t */\n\t\t prepareBulkSmushErrorRow: (errorMsg, fileName, thumbnail, id, type, errorCode) => {\n\t\t\tconst thumbDiv =\n\t\t\tthumbnail && 'undefined' !== typeof thumbnail ?\n\t\t\t\t`<img class=\"attachment-thumbnail\" src=\"${thumbnail}\" />` :\n\t\t\t\t'<i class=\"sui-icon-photo-picture\" aria-hidden=\"true\"></i>';\n\t\t\tconst editLink = window.wp_smush_msgs.edit_link.replace('{{id}}', id);\n\t\t\tfileName =\n\t\t\t\t'undefined' === fileName || 'undefined' === typeof fileName ?\n\t\t\t\t'undefined' :\n\t\t\t\tfileName;\n\n\t\t\tlet tableDiv =\n\t\t\t\t`<div class=\"smush-bulk-error-row\" data-error-code=\"${errorCode}\">\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${ thumbDiv }\n\t\t\t\t\t\t\t<span class=\"smush-image-name\">\n\t\t\t\t\t\t\t\t<a href=\"${editLink}\">${fileName}</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${errorMsg}\n\t\t\t\t\t</div>\n\t\t\t\t</div>`;\n\n\t\t\tif ('media' === type) {\n\t\t\t\ttableDiv +=\n\t\t\t\t\t`<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=\"${window.wp_smush_msgs.error_ignore}\" data-id=\"${id}\">\n\t\t\t\t\t\t\t${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=\"${editLink}\">\n\t\t\t\t\t\t\t${window.wp_smush_msgs.view_detail}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</div>`;\n\t\t\t}\n\n\t\t\ttableDiv += '</div>';\n\n\t\t\ttableDiv += WP_Smush.helpers.upsellWithError( errorCode );\n\n\t\t\treturn tableDiv;\n\t\t},\n\t\tcacheUpsellErrorCode( errorCode ) {\n\t\t\tthis.cacheUpsellErrorCodes.push( errorCode );\n\t\t},\n\t\t/**\n\t\t * Get upsell base on error code.\n\t\t * @param {string} errorCode Error code.\n\t\t * @returns {string}\n\t\t */\n\t\tupsellWithError(errorCode) {\n\t\t\tif (\n\t\t\t\t!errorCode\n\t\t\t\t|| !window.wp_smush_msgs['error_' + errorCode]\n\t\t\t\t|| this.isUpsellRendered( errorCode )\n\t\t\t) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\tthis.cacheRenderedUpsell( errorCode );\n\t\t\t\n\t\t\treturn '<div class=\"smush-bulk-error-row smush-error-upsell\">' +\n\t\t\t\t'<div class=\"smush-bulk-image-title\">' +\n\t\t\t\t'<span class=\"smush-image-error\">' +\n\t\t\t\twindow.wp_smush_msgs['error_' + errorCode] +\n\t\t\t\t'</span>' +\n\t\t\t\t'</div></div>';\n\t\t},\n\t\t// Do not use arrow function to use `this`.\n\t\tisUpsellRendered( errorCode ) {\n\t\t\treturn this.cacheUpsellErrorCodes.includes( errorCode );\n\t\t},\n\t\t// Do not use arrow function to use `this`.\n\t\tcacheRenderedUpsell( errorCode ) {\n\t\t\tthis.cacheUpsellErrorCodes.push( errorCode );\n\t\t},\n\t\t/**\n\t\t * Get error message from Ajax response or Error. \n\t\t * @param {Object} resp\n\t\t */\n\t\tgetErrorMessage: ( resp ) => {\n\t\t\treturn resp.message || resp.data && resp.data.message ||\n\t\t\t\tresp.responseJSON && resp.responseJSON.data && resp.responseJSON.data.message ||\n\t\t\t\twindow.wp_smush_msgs.generic_ajax_error ||\n\t\t\t\tresp.status && 'Request failed. Returned status of ' + resp.status\n\t\t},\n\n\t\t/**\n\t\t * Displays a floating message from response,\n\t\t * using the #wp-smush-ajax-notice container.\n\t\t *\n\t\t * @param {Object|string} notice\n\t\t * @param {Object} \t\t noticeOptions\n\t\t */\n\t\tshowNotice: function( notice, noticeOptions ) {\n\t\t\tlet message;\n\t\t\tif ( 'object' === typeof notice ) {\n\t\t\t\tmessage = this.getErrorMessage( notice );\n\t\t\t} else {\n\t\t\t\tmessage = notice;\n\t\t\t}\n\n\t\t\tif ( ! message ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tnoticeOptions = noticeOptions || {};\n\t\t\tnoticeOptions = Object.assign({\n\t\t\t\tshowdismiss: false,\n\t\t\t\tautoclose: true,\n\t\t\t},noticeOptions);\n\t\t\tnoticeOptions = {\n\t\t\t\ttype: noticeOptions.type || 'error',\n\t\t\t\ticon: noticeOptions.icon || ( 'success' === noticeOptions.type ? 'check-tick' : 'info' ),\n\t\t\t\tdismiss: {\n\t\t\t\t\tshow: noticeOptions.showdismiss,\n\t\t\t\t\tlabel: window.wp_smush_msgs.noticeDismiss,\n\t\t\t\t\ttooltip: window.wp_smush_msgs.noticeDismissTooltip,\n\t\t\t\t},\n\t\t\t\tautoclose: {\n\t\t\t\t\tshow: noticeOptions.autoclose\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst noticeMessage = `<p>${ message }</p>`;\n\n\t\t\tSUI.openNotice( 'wp-smush-ajax-notice', noticeMessage, noticeOptions );\n\t\t\treturn Promise.resolve( '#wp-smush-ajax-notice' );\n\t\t},\n\t\tcloseNotice() {\n\t\t\twindow.SUI.closeNotice( 'wp-smush-ajax-notice' );\n\t\t},\n\t\trenderActivationCDNNotice: function( noticeMessage ) {\n\t\t\tconst animatedNotice = document.getElementById('wp-smush-animated-upsell-notice');\n\t\t\tif ( animatedNotice ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst upsellHtml = `<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>${noticeMessage}</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>`;\n\t\t\tdocument.querySelector( '#smush-box-bulk .wp-smush-bulk-wrapper' ).outerHTML += upsellHtml;\n\t\t},\n\t\tredirectToPage( page ) {\n\t\t\tpage = `page=smush-${page}`;\n\t\t\tif ( window.location.href.includes( page ) ) {\n\t\t\t\twindow.location.reload();\n\t\t\t} else {\n\t\t\t\twindow.location.search = page;\n\t\t\t}\n\t\t},\n\t\tshowModal( modalId ) {\n\t\t\tif ( ! window.SUI ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst focusAfterClosed = 'wpbody-content',\n\t\t\tfocusWhenOpen = undefined,\n\t\t\thasOverlayMask = false,\n\t\t\tisCloseOnEsc = false,\n\t\t\tisAnimated = true;\n\n\t\t\twindow.SUI.openModal(\n\t\t\t\tmodalId,\n\t\t\t\tfocusAfterClosed,\n\t\t\t\tfocusWhenOpen,\n\t\t\t\thasOverlayMask,\n\t\t\t\tisCloseOnEsc,\n\t\t\t\tisAnimated\n\t\t\t);\n\t\t}\n\t};\n\n\tWP_Smush.helpers.init();\n}() );\n","/* global WP_Smush */\n\n/**\n * Scan Media Library.\n *\n */\nimport SmushProgress from '../common/progressbar';\nimport MediaLibraryScanner from '../common/media-library-scanner';\nimport { GlobalStats } from '../common/globalStats';\n\n( function() {\n\t'use strict';\n\tif ( ! window.wp_smush_msgs ) {\n\t\treturn;\n\t}\n\tconst $ = document.querySelector.bind( document );\n\tconst existScanProgressBar = $( '.wp-smush-scan-progress-bar-wrapper' );\n\tif ( ! existScanProgressBar ) {\n\t\treturn;\n\t}\n\n\tconst recheckImagesBtn = $( '.wp-smush-scan' );\n\tif ( ! recheckImagesBtn ) {\n\t\treturn;\n\t}\n\tconst bulkSmushButton = $( '.wp-smush-bo-start' ) || $( '.wp-smush-bulk-wrapper .wp-smush-all' );\n\tconst { __ } = wp.i18n;\n\n\tclass MediaLibraryScannerOnBulkSmush extends MediaLibraryScanner {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis.runBulkSmushOnComplete = false;\n\t\t\tthis.restoreButton = $( '.wp-smush-restore' );\n\t\t\tthis.autoBulkSmushNotification = $( '.wp-smush-auto-bulk-smush-notification' );\n\t\t}\n\n\t\tstartScanThenBulkSmushOnComplete() {\n\t\t\tthis.runBulkSmushOnComplete = true;\n\t\t\tthis.startScan( true );\n\t\t}\n\n\t\tonStart() {\n\t\t\tthis.hideRecheckNotice();\n\t\t\tthis.hideFailedBulkSmushNotice();\n\t\t\tthis.disableRelatedButtons();\n\t\t\tthis.setRecheckImagesButtonOnLoad();\n\t\t\tthis.toggleBulkSmushBoxContent();\n\t\t\treturn this;\n\t\t}\n\n\t\tonStartFailure( response ) {\n\t\t\tsuper.onStartFailure( response );\n\t\t\tthis.revertRelatedButtons();\n\t\t}\n\n\t\tonCloseProgressBar() {\n\t\t\tthis.maybeHideAutoBulkSmushNotification();\n\t\t}\n\n\t\tdisableRelatedButtons() {\n\t\t\tthis.restoreButton.setAttribute( 'disabled', true );\n\t\t\tif ( bulkSmushButton ) {\n\t\t\t\tbulkSmushButton.setAttribute( 'disabled', true );\n\t\t\t\tthis.setInnerText( bulkSmushButton, __( 'Waiting for Re-check to finish', 'wp-smushit' ) );\n\t\t\t}\n\t\t}\n\n\t\trevertRelatedButtons() {\n\t\t\tif ( bulkSmushButton ) {\n\t\t\t\tbulkSmushButton.removeAttribute( 'disabled' );\n\t\t\t\tthis.revertInnerText( bulkSmushButton );\n\t\t\t}\n\t\t\tthis.restoreButton.removeAttribute( 'disabled' );\n\t\t\tthis.revertRecheckImagesButton();\n\t\t\treturn this;\n\t\t}\n\n\t\tsetRecheckImagesButtonOnLoad() {\n\t\t\t// recheckImagesBtn.classList.add( 'sui-button-onload' );\n\t\t\tthis.disableRecheckImagesButton();\n\t\t\tthis.setInnerText( recheckImagesBtn.querySelector( '.wp-smush-inner-text' ), __( 'Checking Images', 'wp-smushit' ) );\n\t\t}\n\n\t\tdisableRecheckImagesButton() {\n\t\t\trecheckImagesBtn.setAttribute( 'disabled', true );\n\t\t}\n\n\t\trevertRecheckImagesButton() {\n\t\t\t// recheckImagesBtn.classList.remove( 'sui-button-onload' );\n\t\t\trecheckImagesBtn.removeAttribute( 'disabled' );\n\t\t\tthis.revertInnerText( recheckImagesBtn.querySelector( '.wp-smush-inner-text' ) );\n\t\t}\n\n\t\tbeforeUpdateStatus( stats ) {\n\t\t\tthis.runBulkSmushOnComplete = stats?.optimize_on_scan_completed;\n\t\t\tthis.maybeShowAutoBulkSmushNotification();\n\t\t}\n\n\t\tonDead( stats ) {\n\t\t\tsuper.onDead( stats );\n\t\t\tthis.revertRelatedButtons();\n\t\t\tthis.setRequiredScanForBulkSmushButton();\n\t\t}\n\n\t\tonFinish( stats ) {\n\t\t\tconst globalStats = stats.global_stats;\n\t\t\tsuper.onFinish( stats );\n\t\t\tthis.revertRelatedButtons();\n\t\t\tthis.toggleBulkSmushDescription( globalStats );\n\t\t\tif ( globalStats.is_outdated ) {\n\t\t\t\tthis.setRequiredScanForBulkSmushButton();\n\t\t\t} else {\n\t\t\t\tthis.removeScanEventFromBulkSmushButton();\n\t\t\t}\n\n\t\t\tthis.revertRecheckWarning();\n\t\t}\n\n\t\tonCompleted( stats ) {\n\t\t\tconst requiredReloadPage = ! bulkSmushButton;\n\t\t\tif ( requiredReloadPage ) {\n\t\t\t\twindow.location.reload();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.onFinish( stats );\n\t\t\tconst globalStats = stats.global_stats;\n\t\t\tconst allImagesSmushed = globalStats.remaining_count < 1;\n\t\t\tif ( allImagesSmushed ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! this.runBulkSmushOnComplete ) {\n\t\t\t\tthis.showRecheckNoticeSuccess();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.runBulkSmushOnComplete = false;\n\n\t\t\tthis.triggerBulkSmushEvent( stats );\n\t\t}\n\n\t\tshowNotice( stats ) {\n\t\t\tif ( ! stats.notice ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet type = 'success';\n\t\t\tif ( 'undefined' !== typeof stats.noticeType ) {\n\t\t\t\ttype = stats.noticeType;\n\t\t\t}\n\t\t\twindow.SUI.openNotice(\n\t\t\t\t'wp-smush-ajax-notice',\n\t\t\t\t'<p>' + stats.notice + '</p>',\n\t\t\t\t{ type, icon: 'check-tick' }\n\t\t\t);\n\t\t}\n\n\t\tshowRecheckNoticeSuccess() {\n\t\t\tconst recheckNotice = $( '.wp-smush-recheck-images-notice-box' );\n\t\t\tif ( ! recheckNotice ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.hideFailedBulkSmushNotice();\n\t\t\tthis.showAnElement( recheckNotice );\n\t\t\tthis.hideAnElement( recheckNotice.querySelector( '.wp-smush-recheck-images-notice-warning' ) );\n\t\t\tthis.showAnElement( recheckNotice.querySelector( '.wp-smush-recheck-images-notice-success' ) );\n\t\t}\n\n\t\tshowRecheckNoticeWarning() {\n\t\t\tconst recheckNotice = $( '.wp-smush-recheck-images-notice-box' );\n\t\t\tif ( ! recheckNotice ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.hideFailedBulkSmushNotice();\n\t\t\tthis.showAnElement( recheckNotice );\n\t\t\tthis.hideAnElement( recheckNotice.querySelector( '.wp-smush-recheck-images-notice-success' ) );\n\t\t\tthis.showAnElement( recheckNotice.querySelector( '.wp-smush-recheck-images-notice-warning' ) );\n\t\t}\n\n\t\thideRecheckNotice() {\n\t\t\tthis.hideAnElement( $( '.wp-smush-recheck-images-notice-box' ) );\n\t\t}\n\n\t\thideFailedBulkSmushNotice() {\n\t\t\tthis.hideAnElement( $( '#smush-box-inline-retry-bulk-smush-notice' ) );\n\t\t}\n\n\t\tshowProgressErrorNoticeOnRecheckNotice() {\n\t\t\tconst recheckWarningElement = $( '.wp-smush-recheck-images-notice-box .wp-smush-recheck-images-notice-warning' );\n\t\t\tif ( ! recheckWarningElement ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\trecheckWarningElement.classList.add( 'sui-notice-error' );\n\t\t\trecheckWarningElement.classList.remove( 'sui-notice-warning' );\n\t\t\tthis.showRecheckNoticeWarning();\n\t\t}\n\n\t\trevertRecheckWarning() {\n\t\t\tconst recheckWarningElement = $( '.wp-smush-recheck-images-notice-box .wp-smush-recheck-images-notice-warning' );\n\t\t\tif ( ! recheckWarningElement ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\trecheckWarningElement.classList.add( 'sui-notice-warning' );\n\t\t\trecheckWarningElement.classList.remove( 'sui-notice-error' );\n\t\t\tthis.revertInnerText( recheckWarningElement.querySelector( 'span' ) );\n\t\t}\n\n\t\ttriggerBulkSmushEvent( stats ) {\n\t\t\tthis.disableRecheckImagesButton();\n\n\t\t\tif ( stats.enabled_background_process ) {\n\t\t\t\tthis.triggerBackgroundBulkSmushEvent( stats.global_stats );\n\t\t\t} else {\n\t\t\t\tthis.triggerAjaxBulkSmushEvent( stats.global_stats );\n\t\t\t}\n\t\t}\n\n\t\ttoggleBulkSmushDescription( globalStats ) {\n\t\t\tif ( SmushProgress.isEmptyObject ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( globalStats.remaining_count < 1 ) {\n\t\t\t\tSmushProgress.hideBulkSmushDescription();\n\t\t\t\tSmushProgress.showBulkSmushAllDone();\n\t\t\t} else {\n\t\t\t\tSmushProgress.showBulkSmushDescription();\n\t\t\t\tSmushProgress.hideBulkSmushAllDone();\n\t\t\t}\n\t\t}\n\n\t\tsetRequiredScanForBulkSmushButton() {\n\t\t\tbulkSmushButton && bulkSmushButton.classList.add( 'wp-smush-scan-and-bulk-smush' );\n\t\t}\n\n\t\tremoveScanEventFromBulkSmushButton() {\n\t\t\tbulkSmushButton && bulkSmushButton.classList.remove( 'wp-smush-scan-and-bulk-smush' );\n\t\t}\n\n\t\ttriggerBackgroundBulkSmushEvent( globalStats ) {\n\t\t\tdocument.dispatchEvent(\n\t\t\t\tnew CustomEvent( 'backgroundBulkSmushOnScanCompleted', {\n\t\t\t\t\tdetail: globalStats\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\n\t\ttriggerAjaxBulkSmushEvent( globalStats ) {\n\t\t\tdocument.dispatchEvent(\n\t\t\t\tnew CustomEvent( 'ajaxBulkSmushOnScanCompleted', {\n\t\t\t\t\tdetail: globalStats\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\n\t\tonCancelled( stats ) {\n\t\t\tthis.onFinish( stats );\n\t\t\tthis.runBulkSmushOnComplete = false;\n\t\t\tthis.setRequiredScanForBulkSmushButton();\n\t\t}\n\n\t\tmaybeShowAutoBulkSmushNotification() {\n\t\t\tif (\n\t\t\t\t! this.runBulkSmushOnComplete\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.showAnElement( this.autoBulkSmushNotification );\n\t\t}\n\n\t\tmaybeHideAutoBulkSmushNotification() {\n\t\t\tif (\n\t\t\t\t! this.runBulkSmushOnComplete\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.hideAnElement( this.autoBulkSmushNotification );\n\t\t}\n\n\t\ttoggleBulkSmushBoxContent() {\n\t\t\tGlobalStats.resetAndHideBulkErrors();\n\t\t\tthis.toggleBulkSmushDescription( GlobalStats.getGlobalStats() );\n\t\t}\n\t}\n\tconst mediaLibScanner = new MediaLibraryScannerOnBulkSmush();\n\n\t/**\n\t * Event Listeners.\n\t */\n\n\t// Background Scan Media Library.\n\tconst registerScanMediaLibraryEvent = () => {\n\t\tif ( ! recheckImagesBtn ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst canScanInBackground = recheckImagesBtn.classList.contains( 'wp-smush-background-scan' );\n\t\tif ( ! canScanInBackground ) {\n\t\t\treturn;\n\t\t}\n\n\t\trecheckImagesBtn.addEventListener( 'click', () => mediaLibScanner.startScan() );\n\n\t\t//Check scan is running.\n\t\tif ( window.wp_smushit_data.media_library_scan?.in_processing ) {\n\t\t\tmediaLibScanner.onStart().showProgressBar().autoSyncStatus();\n\t\t}\n\t};\n\n\tconst maybeAutoStartMediaLibraryScanOnRedirect = () => {\n\t\tif ( ! recheckImagesBtn || ! window.location.search.includes( 'smush-action=start-scan-media' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\trecheckImagesBtn.click();\n\t\tconst removeScanActionFromURLAddress = () => {\n\t\t\tconst cleanedURL = window.location.href.replace( '&smush-action=start-scan-media', '' );\n\t\t\twindow.history.pushState( null, null, cleanedURL );\n\t\t};\n\t\tremoveScanActionFromURLAddress();\n\t};\n\n\t/**\n\t * Recheck Images Notice events.\n\t */\n\tconst registerEventsRelatedInlineNoticeOnBulkSmushPage = () => {\n\t\tconst recheckImagesNotice = $( '.wp-smush-recheck-images-notice-box' );\n\t\tif ( ! recheckImagesNotice || ! recheckImagesBtn ) {\n\t\t\treturn;\n\t\t}\n\t\tconst triggerBackgroundScanImagesLink = recheckImagesNotice.querySelector( '.wp-smush-trigger-background-scan' );\n\t\tif ( triggerBackgroundScanImagesLink ) {\n\t\t\ttriggerBackgroundScanImagesLink.onclick = ( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\trecheckImagesBtn.click();\n\t\t\t};\n\n\t\t\tif ( ! window.location.search.includes( 'smush-action=start-scan-media' ) ) {\n\t\t\t\tif ( window.wp_smushit_data.media_library_scan?.is_dead ) {\n\t\t\t\t\tmediaLibScanner.showProgressErrorNoticeOnRecheckNotice();\n\t\t\t\t} else if( window.wp_smushit_data.is_outdated && ! window.wp_smushit_data?.bo_stats?.is_dead ) {\n\t\t\t\t\tmediaLibScanner.showRecheckNoticeWarning();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst triggerBulkSmush = recheckImagesNotice.querySelector( '.wp-smush-trigger-bulk-smush' );\n\t\tif ( triggerBulkSmush && bulkSmushButton ) {\n\t\t\ttriggerBulkSmush.onclick = ( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\trecheckImagesNotice.classList.add( 'sui-hidden' );\n\t\t\t\tbulkSmushButton.click();\n\t\t\t};\n\t\t}\n\t\tconst dismissNotices = recheckImagesNotice.querySelectorAll( 'button.sui-button-icon' );\n\t\tif ( dismissNotices ) {\n\t\t\tdismissNotices.forEach( ( dismissNotice ) => {\n\t\t\t\tdismissNotice.onclick = ( e ) => {\n\t\t\t\t\tdismissNotice.closest( '.sui-recheck-images-notice' ).classList.add( 'sui-hidden' );\n\t\t\t\t};\n\t\t\t} );\n\t\t}\n\n\t\tdocument.addEventListener( 'onSavedSmushSettings', function( e ) {\n\t\t\tif ( ! e?.detail?.is_outdated_stats ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tmediaLibScanner.setRequiredScanForBulkSmushButton();\n\n\t\t\tconst bulkSmushFailedNotice = document.querySelector( '#smush-box-inline-retry-bulk-smush-notice' );\n\t\t\tconst isShowingBulkSmushFailedNotice = bulkSmushFailedNotice && ! bulkSmushFailedNotice.classList.contains( 'sui-hidden' );\n\t\t\tif ( isShowingBulkSmushFailedNotice ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\trecheckImagesNotice.classList.remove( 'sui-hidden' );\n\t\t\trecheckImagesNotice.querySelector( '.wp-smush-recheck-images-notice-success' ).classList.add( 'sui-hidden' );\n\t\t\trecheckImagesNotice.querySelector( '.wp-smush-recheck-images-notice-warning' ).classList.remove( 'sui-hidden' );\n\t\t} );\n\t};\n\n\t// Scan and Bulk Smush.\n\tconst registerScanAndBulkSmushEvent = () => {\n\t\tif ( ! bulkSmushButton ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst handleScanAndBulkSmush = ( e ) => {\n\t\t\tconst shouldRunScan = bulkSmushButton.classList.contains( 'wp-smush-scan-and-bulk-smush' );\n\t\t\tif ( ! shouldRunScan ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\te.preventDefault();\n\t\t\tmediaLibScanner.startScanThenBulkSmushOnComplete();\n\t\t};\n\n\t\tbulkSmushButton.addEventListener( 'click', handleScanAndBulkSmush );\n\t};\n\n\tconst autoStartBulkSmushOnRedirect = () => {\n\t\tif ( ! bulkSmushButton || ! window.location.search.includes( 'smush-action=start-bulk-' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tbulkSmushButton.click();\n\n\t\tconst removeSmushActionFromURLAddress = () => {\n\t\t\tconst cleanedURL = window.location.href.replace( /&smush-action=start-bulk-(smush|webp-conversion)/i, '' );\n\t\t\twindow.history.pushState( null, null, cleanedURL );\n\t\t};\n\t\tremoveSmushActionFromURLAddress();\n\t};\n\n\tconst registerRetryProcessFromLoopbackErrorModal = () => {\n\t\tconst loopbackErrorModal = document.getElementById( 'smush-loopback-error-dialog' );\n\t\tif ( ! loopbackErrorModal ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst retryButton = loopbackErrorModal.querySelector( '.smush-retry-process-button' );\n\t\tif ( retryButton ) {\n\t\t\tretryButton.addEventListener( 'click', () => {\n\t\t\t\tconst processType = loopbackErrorModal.dataset?.processType || 'scan';\n\t\t\t\tif ( 'scan' === processType ) {\n\t\t\t\t\trecheckImagesBtn.click();\n\t\t\t\t} else {\n\t\t\t\t\tbulkSmushButton.click();\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t};\n\n\tregisterScanMediaLibraryEvent();\n\tregisterScanAndBulkSmushEvent();\n\tregisterEventsRelatedInlineNoticeOnBulkSmushPage();\n\tmaybeAutoStartMediaLibraryScanOnRedirect();\n\tautoStartBulkSmushOnRedirect();\n\tregisterRetryProcessFromLoopbackErrorModal();\n}() );\n","/* global WP_Smush */\n\n/**\n * Scan Media Library.\n *\n */\nimport MediaLibraryScanner from '../common/media-library-scanner';\n\n( function() {\n\t'use strict';\n\tif ( ! window.wp_smush_msgs ) {\n\t\treturn;\n\t}\n\tconst $ = document.querySelector.bind( document );\n\tconst existScanProgressBar = $( '.wp-smush-scan-progress-bar-wrapper' );\n\tif ( ! existScanProgressBar ) {\n\t\treturn;\n\t}\n\n\tconst recheckImagesBtn = $( '.wp-smush-scan' );\n\tif ( recheckImagesBtn ) {\n\t\treturn;\n\t}\n\t//Check scan is running.\n\tconst is_scan_running = window.wp_smushit_data.media_library_scan?.in_processing;\n\tif ( ! is_scan_running ) {\n\t\treturn;\n\t}\n\n\tconst { __ } = wp.i18n;\n\n\tclass mediaLibraryScannerOnDashboard extends MediaLibraryScanner {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis.bulkSmushLink = $( '.wp-smush-bulk-smush-link' );\n\t\t}\n\t\tonShowProgressBar() {\n\t\t\tthis.disableBulkSmushLink();\n\t\t}\n\n\t\tonCloseProgressBar() {\n\t\t\tthis.revertBulkSmushLink();\n\t\t}\n\n\t\tdisableBulkSmushLink() {\n\t\t\tif ( ! this.bulkSmushLink ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.bulkSmushLink.setAttribute( 'disabled', true );\n\t\t\tthis.setInnerText( this.bulkSmushLink, __( 'Waiting for Re-check to finish', 'wp-smushit' ) );\n\t\t}\n\n\t\trevertBulkSmushLink() {\n\t\t\tif ( ! this.bulkSmushLink ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.bulkSmushLink.removeAttribute( 'disabled' );\n\t\t\tthis.revertInnerText( this.bulkSmushLink );\n\t\t}\n\t}\n\n\t( new mediaLibraryScannerOnDashboard() ).showProgressBar().autoSyncStatus();\n}() );\n","import Smush from '../smush/smush';\nimport SmushProcess from '../common/progressbar';\n\n(function($) {\n $(function() {\n /** Handle NextGen Gallery smush button click **/\n $('body').on('click', '.wp-smush-nextgen-send', function (e) {\n // prevent the default action\n e.preventDefault();\n new Smush($(this), false, 'nextgen');\n });\n\n /** Handle NextGen Gallery Bulk smush button click **/\n $('body').on('click', '.wp-smush-nextgen-bulk', function (e) {\n // prevent the default action\n e.preventDefault();\n\n // Remove existing Re-Smush notices.\n // TODO: REMOVE re-smush-notice since no longer used.\n $('.wp-smush-resmush-notice').remove();\n\n //Check for ids, if there is none (Unsmushed or lossless), don't call smush function\n if (\n 'undefined' === typeof wp_smushit_data ||\n (wp_smushit_data.unsmushed.length === 0 &&\n wp_smushit_data.resmush.length === 0)\n ) {\n return false;\n }\n\n const bulkSmush = new Smush( $(this), true, 'nextgen' );\n\t\t\tSmushProcess.setOnCancelCallback( () => {\n\t\t\t\tbulkSmush.cancelAjax();\n\t\t\t}).update( 0, bulkSmush.ids.length ).show();\n\n jQuery('.wp-smush-all, .wp-smush-scan').prop('disabled', true);\n $('.wp-smush-notice.wp-smush-remaining').hide();\n\n\t\t\t// Run bulk Smush.\n\t\t\tbulkSmush.run();\n })\n .on('click', '.wp-smush-trigger-nextgen-bulk', function(e){\n e.preventDefault();\n const bulkSmushButton = $('.wp-smush-nextgen-bulk');\n if ( bulkSmushButton.length ) {\n bulkSmushButton.trigger('click');\n SUI.closeNotice( 'wp-smush-ajax-notice' );\n }\n });\n\n });\n}(window.jQuery));","/* global ajaxurl */\n/* global wp_smush_msgs */\n\n( function( $ ) {\n\t'use strict';\n\n\tconst s3alert = $( '#wp-smush-s3support-alert' );\n\n\t/**\n\t * S3 support alert.\n\t *\n\t * @since 3.6.2 Moved from class-s3.php\n\t */\n\tif ( s3alert.length ) {\n\t\tconst noticeOptions = {\n\t\t\ttype: 'warning',\n\t\t\ticon: 'info',\n\t\t\tdismiss: {\n\t\t\t\tshow: true,\n\t\t\t\tlabel: wp_smush_msgs.noticeDismiss,\n\t\t\t\ttooltip: wp_smush_msgs.noticeDismissTooltip,\n\t\t\t},\n\t\t};\n\n\t\twindow.SUI.openNotice(\n\t\t\t'wp-smush-s3support-alert',\n\t\t\ts3alert.data( 'message' ),\n\t\t\tnoticeOptions\n\t\t);\n\t}\n\n\t// Dismiss S3 support alert.\n\ts3alert.on( 'click', 'button', () => {\n\t\t$.post( ajaxurl,\n\t\t\t{\n\t\t\t\taction: 'dismiss_s3support_alert',\n\t\t\t\t_ajax_nonce: window.wp_smush_msgs.nonce,\n\t\t\t}\n\t\t);\n\t} );\n\n\t// Remove API message.\n\t$( '#wp-smush-api-message button.sui-button-icon' ).on( 'click', function( e ) {\n\t\te.preventDefault();\n\t\tconst notice = $( '#wp-smush-api-message' );\n\t\tnotice.slideUp( 'slow', function() {\n\t\t\tnotice.remove();\n\t\t} );\n\t\t$.post( ajaxurl,\n\t\t\t{\n\t\t\t\taction: 'hide_api_message',\n\t\t\t\t_ajax_nonce: window.wp_smush_msgs.nonce,\n\t\t\t}\n\t\t);\n\t} );\n\n\t// Hide the notice after a CTA button was clicked\n\tfunction removeNotice( e ) {\n\t\tconst $notice = $( e.currentTarget ).closest( '.smush-notice' );\n\t\t$notice.fadeTo( 100, 0, () =>\n\t\t\t$notice.slideUp( 100, () => $notice.remove() )\n\t\t);\n\t}\n\n\t// Only used for the Dashboard notification for now.\n\t$( '.smush-notice .smush-notice-act' ).on( 'click', ( e ) => {\n\t\tremoveNotice( e );\n\t} );\n\n\t// Dismiss the update notice.\n\t$( '.wp-smush-update-info' ).on( 'click', '.notice-dismiss', ( e ) => {\n\t\te.preventDefault();\n\t\tremoveNotice( e );\n\t\t$.post( ajaxurl,\n\t\t\t{\n\t\t\t\taction: 'dismiss_update_info',\n\t\t\t\t_ajax_nonce: window.wp_smush_msgs.nonce,\n\t\t\t}\n\t\t);\n\t} );\n}( jQuery ) );\n","/* global WP_Smush */\n/* global ajaxurl */\nimport tracker from \"../utils/tracker\";\n\n/**\n * Modals JavaScript code.\n */\n( function() {\n\t'use strict';\n\n\t/**\n\t * Onboarding modal.\n\t *\n\t * @since 3.1\n\t */\n\tWP_Smush.onboarding = {\n\t\tmembership: 'free', // Assume free by default.\n\t\tonboardingModal: document.getElementById( 'smush-onboarding-dialog' ),\n\t\tfirst_slide: 'usage',\n\t\tsettings: {\n\t\t\tfirst: true,\n\t\t\tlast: false,\n\t\t\tslide: 'usage',\n\t\t\tvalue: false,\n\t\t},\n\t\tselection: {\n\t\t\tusage: false,\n\t\t\tauto: true,\n\t\t\tlossy: true,\n\t\t\tstrip_exif: true,\n\t\t\toriginal: false,\n\t\t\tlazy_load: true,\n\t\t},\n\t\tcontentContainer: document.getElementById( 'smush-onboarding-content' ),\n\t\tonboardingSlides: [\n\t\t\t'usage',\n\t\t\t'auto',\n\t\t\t'lossy',\n\t\t\t'strip_exif',\n\t\t\t'original',\n\t\t\t'lazy_load',\n\t\t],\n\t\ttouchX: null,\n\t\ttouchY: null,\n\t\trecheckImagesLink: '',\n\t\t/**\n\t\t * Init module.\n\t\t */\n\t\tinit() {\n\t\t\tif ( ! this.onboardingModal ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst dialog = document.getElementById( 'smush-onboarding' );\n\n\t\t\tthis.membership = dialog.dataset.type;\n\t\t\tthis.recheckImagesLink = dialog.dataset.ctaUrl;\n\n\t\t\tif ( 'pro' !== this.membership ) {\n\t\t\t\tthis.onboardingSlides = [\n\t\t\t\t\t'usage',\n\t\t\t\t\t'auto',\n\t\t\t\t\t'lossy',\n\t\t\t\t\t'strip_exif',\n\t\t\t\t\t'lazy_load',\n\t\t\t\t];\n\t\t\t}\n\n\t\t\tif ( 'false' === dialog.dataset.tracking ) {\n\t\t\t\tthis.onboardingSlides.pop();\n\t\t\t}\n\n\t\t\tthis.renderTemplate();\n\n\t\t\t// Skip setup.\n\t\t\tconst skipButton = this.onboardingModal.querySelector(\n\t\t\t\t'.smush-onboarding-skip-link'\n\t\t\t);\n\t\t\tif ( skipButton ) {\n\t\t\t\tskipButton.addEventListener( 'click', this.skipSetup.bind( this ) );\n\t\t\t}\n\n\t\t\t// Show the modal.\n\t\t\twindow.SUI.openModal(\n\t\t\t\t'smush-onboarding-dialog',\n\t\t\t\t'wpcontent',\n\t\t\t\tundefined,\n\t\t\t\tfalse\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Get swipe coordinates.\n\t\t *\n\t\t * @param {Object} e\n\t\t */\n\t\thandleTouchStart( e ) {\n\t\t\tconst firstTouch = e.touches[ 0 ];\n\t\t\tthis.touchX = firstTouch.clientX;\n\t\t\tthis.touchY = firstTouch.clientY;\n\t\t},\n\n\t\t/**\n\t\t * Process swipe left/right.\n\t\t *\n\t\t * @param {Object} e\n\t\t */\n\t\thandleTouchMove( e ) {\n\t\t\tif ( ! this.touchX || ! this.touchY ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst xUp = e.touches[ 0 ].clientX,\n\t\t\t\tyUp = e.touches[ 0 ].clientY,\n\t\t\t\txDiff = this.touchX - xUp,\n\t\t\t\tyDiff = this.touchY - yUp;\n\n\t\t\tif ( Math.abs( xDiff ) > Math.abs( yDiff ) ) {\n\t\t\t\tif ( xDiff > 0 ) {\n\t\t\t\t\tif ( false === WP_Smush.onboarding.settings.last ) {\n\t\t\t\t\t\tWP_Smush.onboarding.next( null, 'next' );\n\t\t\t\t\t}\n\t\t\t\t} else if ( false === WP_Smush.onboarding.settings.first ) {\n\t\t\t\t\tWP_Smush.onboarding.next( null, 'prev' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.touchX = null;\n\t\t\tthis.touchY = null;\n\t\t},\n\n\t\t/**\n\t\t * Update the template, register new listeners.\n\t\t *\n\t\t * @param {string} directionClass Accepts: fadeInRight, fadeInLeft, none.\n\t\t */\n\t\trenderTemplate( directionClass = 'none' ) {\n\t\t\t// Grab the selected value.\n\t\t\tconst input = this.onboardingModal.querySelector(\n\t\t\t\t'input[type=\"checkbox\"]'\n\t\t\t);\n\t\t\tif ( input ) {\n\t\t\t\tthis.selection[ input.id ] = input.checked;\n\t\t\t}\n\n\t\t\tconst template = WP_Smush.onboarding.template( 'smush-onboarding' );\n\t\t\tconst content = template( this.settings );\n\n\t\t\tif ( content ) {\n\t\t\t\tthis.contentContainer.innerHTML = content;\n\n\t\t\t\tif ( 'none' === directionClass ) {\n\t\t\t\t\tthis.contentContainer.classList.add( 'loaded' );\n\t\t\t\t} else {\n\t\t\t\t\tthis.contentContainer.classList.remove( 'loaded' );\n\t\t\t\t\tthis.contentContainer.classList.add( directionClass );\n\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\tthis.contentContainer.classList.add( 'loaded' );\n\t\t\t\t\t\tthis.contentContainer.classList.remove(\n\t\t\t\t\t\t\tdirectionClass\n\t\t\t\t\t\t);\n\t\t\t\t\t}, 600 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.onboardingModal.addEventListener(\n\t\t\t\t'touchstart',\n\t\t\t\tthis.handleTouchStart,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tthis.onboardingModal.addEventListener(\n\t\t\t\t'touchmove',\n\t\t\t\tthis.handleTouchMove,\n\t\t\t\tfalse\n\t\t\t);\n\n\t\t\tthis.bindSubmit();\n\t\t},\n\n\t\t/**\n\t\t * Catch \"Finish setup wizard\" button click.\n\t\t */\n\t\tbindSubmit() {\n\t\t\tconst submitButton = this.onboardingModal.querySelector(\n\t\t\t\t'button[type=\"submit\"]'\n\t\t\t);\n\t\t\tconst self = this;\n\n\t\t\tif ( submitButton ) {\n\t\t\t\tsubmitButton.addEventListener( 'click', function( e ) {\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t// Because we are not rendering the template, we need to update the last element value.\n\t\t\t\t\tconst input = self.onboardingModal.querySelector(\n\t\t\t\t\t\t'input[type=\"checkbox\"]'\n\t\t\t\t\t);\n\t\t\t\t\tif ( input ) {\n\t\t\t\t\t\tself.selection[ input.id ] = input.checked;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst _nonce = document.getElementById(\n\t\t\t\t\t\t'smush_quick_setup_nonce'\n\t\t\t\t\t);\n\n\t\t\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\t\t\txhr.open( 'POST', ajaxurl + '?action=smush_setup', true );\n\t\t\t\t\txhr.setRequestHeader(\n\t\t\t\t\t\t'Content-type',\n\t\t\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t\t\t);\n\t\t\t\t\txhr.onload = () => {\n\t\t\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\t\t\tself.onFinishingSetup();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twindow.console.log(\n\t\t\t\t\t\t\t\t'Request failed. Returned status of ' +\n\t\t\t\t\t\t\t\t\txhr.status\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\txhr.send(\n\t\t\t\t\t\t'smush_settings=' +\n\t\t\t\t\t\t\tJSON.stringify( self.selection ) +\n\t\t\t\t\t\t\t'&_ajax_nonce=' +\n\t\t\t\t\t\t\t_nonce.value\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\n\t\tonFinishingSetup() {\n\t\t\tthis.onFinish();\n\t\t\tthis.startRecheckImages();\n\t\t},\n\n\t\tonFinish() {\n\t\t\twindow.SUI.closeModal();\n\t\t},\n\n\t\tstartRecheckImages() {\n\t\t\tif ( ! this.recheckImagesLink ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\twindow.location.href = this.recheckImagesLink;\n\t\t},\n\n\t\t/**\n\t\t * Handle navigation.\n\t\t *\n\t\t * @param {Object} e\n\t\t * @param {null|string} whereTo\n\t\t */\n\t\tnext( e, whereTo = null ) {\n\t\t\tconst index = this.onboardingSlides.indexOf( this.settings.slide );\n\t\t\tlet newIndex = 0;\n\n\t\t\tif ( ! whereTo ) {\n\t\t\t\tnewIndex =\n\t\t\t\t\tnull !== e && e.classList.contains( 'next' )\n\t\t\t\t\t\t? index + 1\n\t\t\t\t\t\t: index - 1;\n\t\t\t} else {\n\t\t\t\tnewIndex = 'next' === whereTo ? index + 1 : index - 1;\n\t\t\t}\n\n\t\t\tconst directionClass =\n\t\t\t\tnull !== e && e.classList.contains( 'next' )\n\t\t\t\t\t? 'fadeInRight'\n\t\t\t\t\t: 'fadeInLeft';\n\n\t\t\tthis.settings = {\n\t\t\t\tfirst: 0 === newIndex,\n\t\t\t\tlast: newIndex + 1 === this.onboardingSlides.length, // length !== index\n\t\t\t\tslide: this.onboardingSlides[ newIndex ],\n\t\t\t\tvalue: this.selection[ this.onboardingSlides[ newIndex ] ],\n\t\t\t};\n\n\t\t\tthis.renderTemplate( directionClass );\n\t\t},\n\n\t\t/**\n\t\t * Handle circle navigation.\n\t\t *\n\t\t * @param {string} target\n\t\t */\n\t\tgoTo( target ) {\n\t\t\tconst newIndex = this.onboardingSlides.indexOf( target );\n\n\t\t\tthis.settings = {\n\t\t\t\tfirst: 0 === newIndex,\n\t\t\t\tlast: newIndex + 1 === this.onboardingSlides.length, // length !== index\n\t\t\t\tslide: target,\n\t\t\t\tvalue: this.selection[ target ],\n\t\t\t};\n\n\t\t\tthis.renderTemplate();\n\t\t},\n\n\t\t/**\n\t\t * Skip onboarding experience.\n\t\t */\n\t\tskipSetup() {\n\t\t\tconst _nonce = document.getElementById( 'smush_quick_setup_nonce' );\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open(\n\t\t\t\t'POST',\n\t\t\t\tajaxurl + '?action=skip_smush_setup&_ajax_nonce=' + _nonce.value\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tthis.onSkipSetup();\n\t\t\t\t} else {\n\t\t\t\t\twindow.console.log(\n\t\t\t\t\t\t'Request failed. Returned status of ' + xhr.status\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send();\n\t\t},\n\n\t\tonSkipSetup() {\n\t\t\tthis.onFinish();\n\t\t},\n\n\t\t/**\n\t\t * Hide new features modal.\n\t\t * @since 3.7.0\n\t\t * @since 3.12.2 Add a new parameter redirectUrl\n\t\t */\n\t\thideUpgradeModal: ( e, button ) => {\n\t\t\te.preventDefault();\n\t\t\tbutton.classList.add( 'wp-smush-link-in-progress' );\n\t\t\tconst redirectUrl = button?.href;\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open( 'POST', ajaxurl + '?action=hide_new_features&_ajax_nonce=' + window.wp_smush_msgs.nonce );\n\t\t\txhr.onload = () => {\n\t\t\t\twindow.SUI.closeModal();\n\t\t\t\tbutton.classList.remove( 'wp-smush-link-in-progress' );\n\n\t\t\t\tconst actionName = redirectUrl ? 'cta_clicked' : 'closed';\n\t\t\t\ttracker.track( 'update_modal_displayed', {\n\t\t\t\t\tAction: actionName,\n\t\t\t\t} );\n\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tif ( redirectUrl ) {\n\t\t\t\t\t\twindow.location.href = redirectUrl;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twindow.console.log(\n\t\t\t\t\t\t'Request failed. Returned status of ' + xhr.status\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send();\n\t\t},\n\t};\n\n\t/**\n\t * Template function (underscores based).\n\t *\n\t * @type {Function}\n\t */\n\tWP_Smush.onboarding.template = _.memoize( ( id ) => {\n\t\tlet compiled;\n\t\tconst options = {\n\t\t\tevaluate: /<#([\\s\\S]+?)#>/g,\n\t\t\tinterpolate: /{{{([\\s\\S]+?)}}}/g,\n\t\t\tescape: /{{([^}]+?)}}(?!})/g,\n\t\t\tvariable: 'data',\n\t\t};\n\n\t\treturn ( data ) => {\n\t\t\t_.templateSettings = options;\n\t\t\tcompiled =\n\t\t\t\tcompiled ||\n\t\t\t\t_.template( document.getElementById( id ).innerHTML );\n\t\t\tdata.first_slide = WP_Smush.onboarding.first_slide;\n\t\t\treturn compiled( data );\n\t\t};\n\t} );\n\n\twindow.addEventListener( 'load', () => WP_Smush.onboarding.init() );\n}() );\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * CDN functionality.\n *\n * @since 3.0\n */\n( function() {\n\t'use strict';\n\n\tWP_Smush.CDN = {\n\t\tcdnEnableButton: document.getElementById( 'smush-enable-cdn' ),\n\t\tcdnDisableButton: document.getElementById( 'smush-cancel-cdn' ),\n\t\tcdnStatsBox: document.querySelector( '.smush-cdn-stats' ),\n\n\t\tinit() {\n\t\t\t/**\n\t\t\t * Handle \"Get Started\" button click on disabled CDN page.\n\t\t\t */\n\t\t\tif ( this.cdnEnableButton ) {\n\t\t\t\tthis.cdnEnableButton.addEventListener( 'click', ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.currentTarget.classList.add( 'sui-button-onload' );\n\t\t\t\t\tthis.toggle_cdn( true );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handle \"Deactivate' button click on CDN page.\n\t\t\t */\n\t\t\tif ( this.cdnDisableButton ) {\n\t\t\t\tthis.cdnDisableButton.addEventListener( 'click', ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.currentTarget.classList.add( 'sui-button-onload' );\n\n\t\t\t\t\tthis.toggle_cdn( false );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tthis.updateStatsBox();\n\t\t},\n\n\t\t/**\n\t\t * Toggle CDN.\n\t\t *\n\t\t * @since 3.0\n\t\t *\n\t\t * @param {boolean} enable\n\t\t */\n\t\ttoggle_cdn( enable ) {\n\t\t\tconst nonceField = document.getElementsByName(\n\t\t\t\t'wp_smush_options_nonce'\n\t\t\t);\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open( 'POST', ajaxurl + '?action=smush_toggle_cdn', true );\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tconst res = JSON.parse( xhr.response );\n\t\t\t\t\tif ( 'undefined' !== typeof res.success && res.success ) {\n\t\t\t\t\t\tWP_Smush.helpers.redirectToPage( 'cdn' );\n\t\t\t\t\t} else if ( 'undefined' !== typeof res.data.message ) {\n\t\t\t\t\t\tWP_Smush.helpers.showErrorNotice( res.data.message );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tWP_Smush.helpers.showErrorNotice( 'Request failed. Returned status of ' + xhr.status );\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send(\n\t\t\t\t'param=' + enable + '&_ajax_nonce=' + nonceField[ 0 ].value\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update the CDN stats box in summary meta box. Only fetch new data when on CDN page.\n\t\t *\n\t\t * @since 3.0\n\t\t */\n\t\tupdateStatsBox() {\n\t\t\tif (\n\t\t\t\t'undefined' === typeof this.cdnStatsBox ||\n\t\t\t\t! this.cdnStatsBox\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Only fetch the new stats, when user is on CDN page.\n\t\t\tif ( ! window.location.search.includes( 'page=smush-cdn' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.toggleElements();\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open( 'POST', ajaxurl + '?action=get_cdn_stats', true );\n\t\t\txhr.onload = () => {\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tconst res = JSON.parse( xhr.response );\n\t\t\t\t\tif ( 'undefined' !== typeof res.success && res.success ) {\n\t\t\t\t\t\tthis.toggleElements();\n\t\t\t\t\t} else if ( 'undefined' !== typeof res.data.message ) {\n\t\t\t\t\t\tWP_Smush.helpers.showErrorNotice( res.data.message );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tWP_Smush.helpers.showErrorNotice( 'Request failed. Returned status of ' + xhr.status );\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send();\n\t\t},\n\n\t\t/**\n\t\t * Show/hide elements during status update in the updateStatsBox()\n\t\t *\n\t\t * @since 3.1 Moved out from updateStatsBox()\n\t\t */\n\t\ttoggleElements() {\n\t\t\tconst spinner = this.cdnStatsBox.querySelector(\n\t\t\t\t'.sui-icon-loader'\n\t\t\t);\n\t\t\tconst elements = this.cdnStatsBox.querySelectorAll(\n\t\t\t\t'.wp-smush-stats > :not(.sui-icon-loader)'\n\t\t\t);\n\n\t\t\tfor ( let i = 0; i < elements.length; i++ ) {\n\t\t\t\telements[ i ].classList.toggle( 'sui-hidden' );\n\t\t\t}\n\n\t\t\tspinner.classList.toggle( 'sui-hidden' );\n\t\t},\n\t};\n\n\tWP_Smush.CDN.init();\n} )();\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * Lazy loading functionality.\n *\n * @since 3.0\n */\n( function() {\n\t'use strict';\n\n\tWP_Smush.Lazyload = {\n\t\tlazyloadEnableButton: document.getElementById(\n\t\t\t'smush-enable-lazyload'\n\t\t),\n\t\tlazyloadDisableButton: document.getElementById(\n\t\t\t'smush-cancel-lazyload'\n\t\t),\n\n\t\tinit() {\n\t\t\tconst self = this;\n\n\t\t\t/**\n\t\t\t * Handle \"Activate\" button click on disabled Lazy load page.\n\t\t\t */\n\t\t\tif ( this.lazyloadEnableButton ) {\n\t\t\t\tthis.lazyloadEnableButton.addEventListener( 'click', ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.currentTarget.classList.add( 'sui-button-onload' );\n\n\t\t\t\t\tthis.toggle_lazy_load( true );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handle \"Deactivate' button click on Lazy load page.\n\t\t\t */\n\t\t\tif ( this.lazyloadDisableButton ) {\n\t\t\t\tthis.lazyloadDisableButton.addEventListener( 'click', ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.currentTarget.classList.add( 'sui-button-onload' );\n\n\t\t\t\t\tthis.toggle_lazy_load( false );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handle \"Remove icon\" button click on Lazy load page.\n\t\t\t *\n\t\t\t * This removes the image from the upload placeholder.\n\t\t\t *\n\t\t\t * @since 3.2.2\n\t\t\t */\n\t\t\tconst removeSpinner = document.getElementById(\n\t\t\t\t'smush-remove-spinner'\n\t\t\t);\n\t\t\tif ( removeSpinner ) {\n\t\t\t\tremoveSpinner.addEventListener( 'click', ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tthis.removeLoaderIcon();\n\t\t\t\t} );\n\t\t\t}\n\t\t\tconst removePlaceholder = document.getElementById(\n\t\t\t\t'smush-remove-placeholder'\n\t\t\t);\n\t\t\tif ( removePlaceholder ) {\n\t\t\t\tremovePlaceholder.addEventListener( 'click', ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tthis.removeLoaderIcon( 'placeholder' );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handle \"Remove\" icon click.\n\t\t\t *\n\t\t\t * This removes the select icon from the list (not same as above functions).\n\t\t\t *\n\t\t\t * @since 3.2.2\n\t\t\t */\n\t\t\tconst items = document.querySelectorAll( '.smush-ll-remove' );\n\t\t\tif ( items && 0 < items.length ) {\n\t\t\t\titems.forEach( function( el ) {\n\t\t\t\t\tel.addEventListener( 'click', ( e ) => {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\te.target.closest( 'li' ).style.display = 'none';\n\t\t\t\t\t\tself.remove(\n\t\t\t\t\t\t\te.target.dataset.id,\n\t\t\t\t\t\t\te.target.dataset.type\n\t\t\t\t\t\t);\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tthis.handlePredefinedPlaceholders();\n\t\t},\n\n\t\t/**\n\t\t * Handle background color changes for the two predefined placeholders.\n\t\t *\n\t\t * @since 3.7.1\n\t\t */\n\t\thandlePredefinedPlaceholders() {\n\t\t\tconst pl1 = document.getElementById( 'placeholder-icon-1' );\n\t\t\tif ( pl1 ) {\n\t\t\t\tpl1.addEventListener( 'click', () => this.changeColor( '#F3F3F3' ) );\n\t\t\t}\n\n\t\t\tconst pl2 = document.getElementById( 'placeholder-icon-2' );\n\t\t\tif ( pl2 ) {\n\t\t\t\tpl2.addEventListener( 'click', () => this.changeColor( '#333333' ) );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Set color.\n\t\t *\n\t\t * @since 3.7.1\n\t\t * @param {string} color\n\t\t */\n\t\tchangeColor( color ) {\n\t\t\tdocument.getElementById( 'smush-color-picker' ).value = color;\n\t\t\tdocument.querySelector( '.sui-colorpicker-hex .sui-colorpicker-value > span > span' ).style.backgroundColor = color;\n\t\t\tdocument.querySelector( '.sui-colorpicker-hex .sui-colorpicker-value > input' ).value = color;\n\t\t},\n\n\t\t/**\n\t\t * Toggle lazy loading.\n\t\t *\n\t\t * @since 3.2.0\n\t\t *\n\t\t * @param {string} enable\n\t\t */\n\t\ttoggle_lazy_load( enable ) {\n\t\t\tconst nonceField = document.getElementsByName(\n\t\t\t\t'wp_smush_options_nonce'\n\t\t\t);\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open(\n\t\t\t\t'POST',\n\t\t\t\tajaxurl + '?action=smush_toggle_lazy_load',\n\t\t\t\ttrue\n\t\t\t);\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tconst res = JSON.parse( xhr.response );\n\t\t\t\t\tif ( 'undefined' !== typeof res.success && res.success ) {\n\t\t\t\t\t\tWP_Smush.helpers.redirectToPage( 'lazy-load' );\n\t\t\t\t\t} else if ( 'undefined' !== typeof res.data.message ) {\n\t\t\t\t\t\tWP_Smush.helpers.showErrorNotice( res.data.message );\n\t\t\t\t\t\tdocument.querySelector( '.sui-button-onload' ).classList.remove( 'sui-button-onload' );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tWP_Smush.helpers.showErrorNotice( 'Request failed. Returned status of ' + xhr.status );\n\t\t\t\t\tdocument.querySelector( '.sui-button-onload' ).classList.remove( 'sui-button-onload' );\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send(\n\t\t\t\t'param=' + enable + '&_ajax_nonce=' + nonceField[ 0 ].value\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Add lazy load spinner icon.\n\t\t *\n\t\t * @since 3.2.2\n\t\t * @param {string} type Accepts: spinner, placeholder.\n\t\t */\n\t\taddLoaderIcon( type = 'spinner' ) {\n\t\t\tlet frame;\n\n\t\t\t// If the media frame already exists, reopen it.\n\t\t\tif ( frame ) {\n\t\t\t\tframe.open();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Create a new media frame\n\t\t\tframe = wp.media( {\n\t\t\t\ttitle: 'Select or upload an icon',\n\t\t\t\tbutton: {\n\t\t\t\t\ttext: 'Select icon',\n\t\t\t\t},\n\t\t\t\tmultiple: false, // Set to true to allow multiple files to be selected\n\t\t\t} );\n\n\t\t\t// When an image is selected in the media frame...\n\t\t\tframe.on( 'select', function() {\n\t\t\t\t// Get media attachment details from the frame state\n\t\t\t\tconst attachment = frame\n\t\t\t\t\t.state()\n\t\t\t\t\t.get( 'selection' )\n\t\t\t\t\t.first()\n\t\t\t\t\t.toJSON();\n\n\t\t\t\t// Send the attachment URL to our custom image input field.\n\t\t\t\tconst imageIcon = document.getElementById(\n\t\t\t\t\t'smush-' + type + '-icon-preview'\n\t\t\t\t);\n\t\t\t\timageIcon.style.backgroundImage =\n\t\t\t\t\t'url(\"' + attachment.url + '\")';\n\t\t\t\timageIcon.style.display = 'block';\n\n\t\t\t\t// Send the attachment id to our hidden input\n\t\t\t\tdocument\n\t\t\t\t\t.getElementById( 'smush-' + type + '-icon-file' )\n\t\t\t\t\t.setAttribute( 'value', attachment.id );\n\n\t\t\t\t// Hide the add image link\n\t\t\t\tdocument.getElementById(\n\t\t\t\t\t'smush-upload-' + type\n\t\t\t\t).style.display = 'none';\n\n\t\t\t\t// Unhide the remove image link\n\t\t\t\tconst removeDiv = document.getElementById(\n\t\t\t\t\t'smush-remove-' + type\n\t\t\t\t);\n\t\t\t\tremoveDiv.querySelector( 'span' ).innerHTML =\n\t\t\t\t\tattachment.filename;\n\t\t\t\tremoveDiv.style.display = 'block';\n\t\t\t} );\n\n\t\t\t// Finally, open the modal on click\n\t\t\tframe.open();\n\t\t},\n\n\t\t/**\n\t\t * Remove lazy load spinner icon.\n\t\t *\n\t\t * @since 3.2.2\n\t\t * @param {string} type Accepts: spinner, placeholder.\n\t\t */\n\t\tremoveLoaderIcon: ( type = 'spinner' ) => {\n\t\t\t// Clear out the preview image\n\t\t\tconst imageIcon = document.getElementById(\n\t\t\t\t'smush-' + type + '-icon-preview'\n\t\t\t);\n\t\t\timageIcon.style.backgroundImage = '';\n\t\t\timageIcon.style.display = 'none';\n\n\t\t\t// Un-hide the add image link\n\t\t\tdocument.getElementById( 'smush-upload-' + type ).style.display =\n\t\t\t\t'block';\n\n\t\t\t// Hide the delete image link\n\t\t\tdocument.getElementById( 'smush-remove-' + type ).style.display =\n\t\t\t\t'none';\n\n\t\t\t// Delete the image id from the hidden input\n\t\t\tdocument\n\t\t\t\t.getElementById( 'smush-' + type + '-icon-file' )\n\t\t\t\t.setAttribute( 'value', '' );\n\t\t},\n\n\t\t/**\n\t\t * Remove item.\n\t\t *\n\t\t * @param {number} id Image ID.\n\t\t * @param {string} type Accepts: spinner, placeholder.\n\t\t */\n\t\tremove: ( id, type = 'spinner' ) => {\n\t\t\tconst nonceField = document.getElementsByName(\n\t\t\t\t'wp_smush_options_nonce'\n\t\t\t);\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open( 'POST', ajaxurl + '?action=smush_remove_icon', true );\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\t\t\txhr.send(\n\t\t\t\t'id=' +\n\t\t\t\t\tid +\n\t\t\t\t\t'&type=' +\n\t\t\t\t\ttype +\n\t\t\t\t\t'&_ajax_nonce=' +\n\t\t\t\t\tnonceField[ 0 ].value\n\t\t\t);\n\t\t},\n\t};\n\n\tWP_Smush.Lazyload.init();\n} )();\n","import tracker from '../utils/tracker';\n\nclass ProductAnalytics {\n\ttroubleshootClicked = false;\n\tresumeBulkSmushCount = 0;\n\tmissedEventsKey = 'wp_smush_missed_events';\n\n\tinit() {\n\t\tif ( ! tracker.allowToTrack() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.trackUltraLinks();\n\t\tthis.trackUpsellLinks();\n\n\t\tthis.registerTroubleshootClickEvent();\n\n\t\t// Scan Interrupted Event from Scan Modal.\n\t\tthis.trackScanInterruptedEventOnStopScanningModal();\n\t\tthis.trackScanInterruptedEventOnRetryScanModal();\n\n\t\t// Bulk Smush Interrupted Event from Bulk Smush Modal.\n\t\tthis.trackBulkSmushInterruptedEventOnStopBulkSmushModal();\n\t\tthis.trackBulkSmushInterruptedEventOnRetryBulkSmushModal();\n\t\tthis.registerBulkSmushResumeClickEvent();\n\n\t\t// Bulk Smush Interrupted Event when exit ajax bulk smush.\n\t\tthis.trackBulkSmushInterruptedEventWhenExitingAjaxBulkSmush();\n\n\t\t// Interrupted Event from Inline Notice.\n\t\tthis.trackInterruptedEventFromInlineNotice();\n\n\t\t// Interrupted Event from Loopback Error Modal.\n\t\tthis.trackInterruptedEventFromLoopbackErrorModal();\n\n\t\tthis.maybeTrackMissedEventsOnLoad();\n\t}\n\n\ttrackUltraLinks() {\n\t\tconst ultraUpsellLinks = document.querySelectorAll( '.wp-smush-upsell-ultra-compression' );\n\t\tif ( ! ultraUpsellLinks ) {\n\t\t\treturn;\n\t\t}\n\t\tconst getLocation = ( ultraLink ) => {\n\t\t\tconst locations = {\n\t\t\t\tsettings: 'bulksmush_settings',\n\t\t\t\tdashboard: 'dash_summary',\n\t\t\t\tbulk: 'bulksmush_summary',\n\t\t\t\tdirectory: 'directory_summary',\n\t\t\t\t'lazy-load': 'lazy_summary',\n\t\t\t\tcdn: 'cdn_summary',\n\t\t\t\twebp: 'webp_summary',\n\t\t\t};\n\t\t\tconst locationId = ultraLink.classList.contains( 'wp-smush-ultra-compression-link' ) ? 'settings' : this.getCurrentPageSlug();\n\t\t\treturn locations[ locationId ] || 'bulksmush_settings';\n\t\t};\n\n\t\tultraUpsellLinks.forEach( ( ultraLink ) => {\n\t\t\tconst eventName = 'ultra_upsell_modal';\n\t\t\tultraLink.addEventListener( 'click', ( e ) => {\n\t\t\t\ttracker.track( eventName, {\n\t\t\t\t\tLocation: getLocation( e.target ),\n\t\t\t\t\t'Modal Action': 'direct_cta',\n\t\t\t\t} );\n\t\t\t} );\n\t\t} );\n\t}\n\n\ttrackUpsellLinks() {\n\t\tconst upsellLinks = document.querySelectorAll( '[href*=\"utm_source=smush\"]' );\n\t\tif ( ! upsellLinks ) {\n\t\t\treturn;\n\t\t}\n\t\tupsellLinks.forEach( ( upsellLink ) => {\n\t\t\tupsellLink.addEventListener( 'click', ( e ) => {\n\t\t\t\tconst params = new URL( e.target.href ).searchParams;\n\t\t\t\tif ( ! params ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst campaign = params.get( 'utm_campaign' );\n\t\t\t\tconst upsellLocations = {\n\t\t\t\t\t// CDN.\n\t\t\t\t\tsummary_cdn: 'dash_summary',\n\t\t\t\t\t'smush-dashboard-cdn-upsell': 'dash_widget',\n\t\t\t\t\tsmush_bulksmush_cdn: 'bulk_smush_progress',\n\t\t\t\t\tsmush_cdn_upgrade_button: 'cdn_page',\n\t\t\t\t\tsmush_bulksmush_library_gif_cdn: 'media_library',\n\t\t\t\t\tsmush_bulk_smush_complete_global: 'bulk_smush_complete',\n\n\t\t\t\t\t// Local WebP.\n\t\t\t\t\tsummary_local_webp: 'dash_summary',\n\t\t\t\t\t'smush-dashboard-local-webp-upsell': 'dash_widget',\n\t\t\t\t\t// smush_webp_upgrade_button: 'webp_page',// Handled inside React WebP - free-content.jsx\n\t\t\t\t};\n\n\t\t\t\tif ( ! ( campaign in upsellLocations ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst Location = upsellLocations[ campaign ];\n\t\t\t\tconst matches = campaign.match( /(cdn|webp)/i );\n\t\t\t\tconst upsellModule = matches && matches[ 0 ];\n\n\t\t\t\tconst eventName = 'webp' === upsellModule ? 'local_webp_upsell' : 'cdn_upsell';\n\t\t\t\ttracker.track( eventName, { Location } );\n\t\t\t} );\n\t\t} );\n\t}\n\n\ttrackScanInterruptedEventOnStopScanningModal() {\n\t\tconst stopScanningModal = document.getElementById( 'smush-stop-scanning-dialog' );\n\t\tif ( ! stopScanningModal ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst closeButtons = stopScanningModal.querySelectorAll( '[data-modal-close]' );\n\t\tcloseButtons.forEach( ( closeButton ) => {\n\t\t\tcloseButton.addEventListener( 'click', ( e ) => {\n\t\t\t\tconst action = e.target.dataset?.action || 'Close';\n\t\t\t\tthis.trackScanInterruptedEvent( {\n\t\t\t\t\tTrigger: 'cancel_in_progress',\n\t\t\t\t\t'Modal Action': action,\n\t\t\t\t} );\n\t\t\t} );\n\t\t} );\n\t}\n\n\ttrackBulkSmushInterruptedEventOnStopBulkSmushModal() {\n\t\tconst stopBulkSmushModal = document.getElementById( 'smush-stop-bulk-smush-modal' );\n\t\tif ( ! stopBulkSmushModal ) {\n\t\t\treturn;\n\t\t}\n\t\tconst closeButtons = stopBulkSmushModal.querySelectorAll( '[data-modal-close]' );\n\t\tcloseButtons.forEach( ( closeButton ) => {\n\t\t\tcloseButton.addEventListener( 'click', ( e ) => {\n\t\t\t\tconst action = e.target.dataset?.action || 'Close';\n\t\t\t\tthis.trackBulkSmushInterruptedEvent( {\n\t\t\t\t\tTrigger: 'cancel_in_progress',\n\t\t\t\t\t'Modal Action': action,\n\t\t\t\t} );\n\t\t\t} );\n\t\t} );\n\t}\n\n\ttrackScanInterruptedEventOnRetryScanModal() {\n\t\tconst retryScanModal = document.getElementById( 'smush-retry-scan-notice' );\n\t\tif ( ! retryScanModal ) {\n\t\t\treturn;\n\t\t}\n\t\tconst retryButton = retryScanModal.querySelector( '.smush-retry-scan-notice-button' );\n\t\tif ( retryButton ) {\n\t\t\tretryButton.addEventListener( 'click', ( e ) => {\n\t\t\t\tconst recheckImagesBtn = document.querySelector( '.wp-smush-scan' );\n\t\t\t\tif ( recheckImagesBtn ) {\n\t\t\t\t\tthis.trackScanInterruptedEvent( {\n\t\t\t\t\t\tTrigger: 'failed_modal',\n\t\t\t\t\t\t'Modal Action': 'Retry',\n\t\t\t\t\t} );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\n\t\t\t\tconst event = 'Scan Interrupted';\n\t\t\t\tconst properties = this.getScanInterruptedEventProperties( {\n\t\t\t\t\tTrigger: 'failed_modal',\n\t\t\t\t\t'Modal Action': 'Retry',\n\t\t\t\t} );\n\n\t\t\t\ttracker.track( event, properties ).catch( () => {\n\t\t\t\t\tthis.cacheMissedEvent( {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\tproperties,\n\t\t\t\t\t} );\n\t\t\t\t} ).finally( () => {\n\t\t\t\t\twindow.location.href = e.target.href;\n\t\t\t\t} );\n\t\t\t} );\n\t\t}\n\t\tconst closeButtons = retryScanModal.querySelectorAll( '[data-modal-close]' );\n\t\tcloseButtons.forEach( ( closeButton ) => {\n\t\t\tcloseButton.addEventListener( 'click', ( e ) => {\n\t\t\t\tconst action = e.target.dataset?.action || 'Close';\n\t\t\t\tthis.trackScanInterruptedEvent( {\n\t\t\t\t\tTrigger: 'failed_modal',\n\t\t\t\t\t'Modal Action': action,\n\t\t\t\t} );\n\t\t\t} );\n\t\t} );\n\t}\n\n\ttrackBulkSmushInterruptedEventOnRetryBulkSmushModal() {\n\t\tconst retryBulkModal = document.getElementById( 'smush-retry-bulk-smush-notice' );\n\t\tif ( ! retryBulkModal ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst retryButton = retryBulkModal.querySelector( '.smush-retry-bulk-smush-notice-button' );\n\t\tif ( retryButton ) {\n\t\t\tretryButton.addEventListener( 'click', () => {\n\t\t\t\tthis.trackBulkSmushInterruptedEvent( {\n\t\t\t\t\tTrigger: 'failed_modal',\n\t\t\t\t\t'Modal Action': 'Retry',\n\t\t\t\t} );\n\t\t\t} );\n\t\t}\n\n\t\tconst closeButtons = retryBulkModal.querySelectorAll( '[data-modal-close]' );\n\t\tcloseButtons.forEach( ( closeButton ) => {\n\t\t\tcloseButton.addEventListener( 'click', ( e ) => {\n\t\t\t\tconst action = e.target.dataset?.action || 'Close';\n\t\t\t\tthis.trackBulkSmushInterruptedEvent( {\n\t\t\t\t\tTrigger: 'failed_modal',\n\t\t\t\t\t'Modal Action': action,\n\t\t\t\t} );\n\t\t\t} );\n\t\t} );\n\t}\n\n\ttrackScanInterruptedEvent( properties ) {\n\t\treturn tracker.track( 'Scan Interrupted', this.getScanInterruptedEventProperties( properties ) );\n\t}\n\n\tgetScanInterruptedEventProperties( properties ) {\n\t\treturn Object.assign( {\n\t\t\tTroubleshoot: this.troubleshootClicked ? 'Yes' : 'No',\n\t\t}, properties );\n\t}\n\n\ttrackBulkSmushInterruptedEventWhenExitingAjaxBulkSmush() {\n\t\tif ( this.canUseBackgroundOptimization() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst progressBar = document.querySelector( '.wp-smush-bulk-progress-bar-wrapper' );\n\t\tif ( ! progressBar ) {\n\t\t\treturn;\n\t\t}\n\n\t\twindow.addEventListener( 'beforeunload', () => {\n\t\t\tconst ajaxBulkSmushObject = window.WP_Smush?.bulk?.bulkSmush;\n\t\t\tconst isBulkSmushInProgressing = ajaxBulkSmushObject && ajaxBulkSmushObject.ids.length > 0 && ! progressBar.classList.contains( 'sui-hidden' );\n\t\t\tif ( ! isBulkSmushInProgressing ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst isFreeExceeded = progressBar.classList.contains( 'wp-smush-exceed-limit' );\n\t\t\tconst event = 'Bulk Smush Interrupted';\n\t\t\tconst properties = this.getBulkSmushInterruptedEventProperties(\n\t\t\t\t{\n\t\t\t\t\tTrigger: isFreeExceeded ? 'exit_50_limit' : 'exit_in_progress',\n\t\t\t\t\t'Modal Action': 'Exit',\n\t\t\t\t\t'Retry Attempts': this.resumeBulkSmushCount,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\ttracker.track( event, properties ).catch( () => {\n\t\t\t\tthis.cacheMissedEvent( {\n\t\t\t\t\tevent,\n\t\t\t\t\tproperties,\n\t\t\t\t} );\n\t\t\t} );\n\t\t} );\n\t}\n\n\tcacheMissedEvent( eventData ) {\n\t\tif ( window.localStorage ) {\n\t\t\t// As now we only use it for one event, so let's keep it as a simple array.\n\t\t\twindow.localStorage.setItem( this.missedEventsKey, JSON.stringify( [ eventData ] ) );\n\t\t}\n\t}\n\n\tgetMissedEvents() {\n\t\tif ( ! window.localStorage ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst properties = window.localStorage.getItem( this.missedEventsKey );\n\t\tif ( ! properties ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn JSON.parse( properties );\n\t}\n\n\tclearMissedEvents() {\n\t\tif ( window.localStorage ) {\n\t\t\twindow.localStorage.removeItem( this.missedEventsKey );\n\t\t}\n\t}\n\n\tcanUseBackgroundOptimization() {\n\t\treturn 'undefined' !== typeof window.wp_smushit_data?.bo_stats;\n\t}\n\n\ttrackBulkSmushInterruptedEvent( properties ) {\n\t\treturn tracker.track( 'Bulk Smush Interrupted', this.getBulkSmushInterruptedEventProperties( properties ) );\n\t}\n\n\tgetBulkSmushInterruptedEventProperties( properties ) {\n\t\treturn Object.assign(\n\t\t\t{\n\t\t\t\tTroubleshoot: this.troubleshootClicked ? 'Yes' : 'No',\n\t\t\t},\n\t\t\tthis.getBulkSmushProcessStats(),\n\t\t\tproperties\n\t\t);\n\t}\n\n\tgetBulkSmushProcessStats() {\n\t\tif ( this.canUseBackgroundOptimization() ) {\n\t\t\t// Handled it via PHP.\n\t\t\treturn {};\n\t\t}\n\t\tconst ajaxBulkSmushObject = window.WP_Smush?.bulk?.bulkSmush;\n\t\tconst totalEnqueuedImages = ajaxBulkSmushObject?.total || 0;\n\t\tconst processedImages = ajaxBulkSmushObject?.smushed + ajaxBulkSmushObject?.errors.length;\n\t\tconst completionPercentage = totalEnqueuedImages > 0 ? Math.ceil( processedImages * 100 / totalEnqueuedImages ) : 0;\n\n\t\treturn {\n\t\t\t'Total Enqueued Images': totalEnqueuedImages,\n\t\t\t'Completion Percentage': completionPercentage,\n\t\t};\n\t}\n\n\ttrackInterruptedEventFromInlineNotice() {\n\t\tthis.trackInterruptedEventFromInlineNoticeOnDashboard();\n\t\tthis.trackBulkSmushInterruptedEventFromInlineNoticeOnBulkSmush();\n\t\tthis.trackScanInterruptedEventFromInlineNoticeOnBulkSmush();\n\t}\n\n\ttrackInterruptedEventFromInlineNoticeOnDashboard() {\n\t\tconst dashboardBulkElement = document.getElementById( 'smush-box-dashboard-bulk' );\n\t\tif ( ! dashboardBulkElement ) {\n\t\t\treturn;\n\t\t}\n\t\tthis.trackBulkSmushInterruptedEventFromInlineNoticeOnDashboard( dashboardBulkElement );\n\t\tthis.trackScanInterruptedEventFromInlineNoticeOnDashboard( dashboardBulkElement );\n\t}\n\n\ttrackBulkSmushInterruptedEventFromInlineNoticeOnDashboard( dashboardBulkElement ) {\n\t\tconst triggerBulkSmushButton = dashboardBulkElement.querySelector( '.wp-smush-retry-bulk-smush-link' );\n\t\tif ( ! triggerBulkSmushButton ) {\n\t\t\treturn;\n\t\t}\n\t\ttriggerBulkSmushButton.addEventListener( 'click', ( e ) => {\n\t\t\te.preventDefault();\n\n\t\t\tconst event = 'Bulk Smush Interrupted';\n\t\t\tconst properties = this.getBulkSmushInterruptedEventProperties(\n\t\t\t\t{\n\t\t\t\t\tTrigger: 'failed_notice',\n\t\t\t\t\t'Modal Action': 'Retry',\n\t\t\t\t}\n\t\t\t);\n\n\t\t\ttracker.track( event, properties ).catch( () => {\n\t\t\t\tthis.cacheMissedEvent( {\n\t\t\t\t\tevent,\n\t\t\t\t\tproperties,\n\t\t\t\t} );\n\t\t\t} ).finally( () => {\n\t\t\t\twindow.location.href = e.target.href;\n\t\t\t} );\n\t\t} );\n\t}\n\n\ttrackBulkSmushInterruptedInlineNoticeEvent() {\n\t\treturn this.trackBulkSmushInterruptedEvent( {\n\t\t\tTrigger: 'failed_notice',\n\t\t\t'Modal Action': 'Retry',\n\t\t} );\n\t}\n\n\ttrackBulkSmushInterruptedEventFromInlineNoticeOnBulkSmush() {\n\t\tconst triggerBulkSmushButton = document.querySelector( '.wp-smush-inline-retry-bulk-smush-notice .wp-smush-trigger-bulk-smush' );\n\t\tif ( ! triggerBulkSmushButton ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttriggerBulkSmushButton.addEventListener( 'click', () => {\n\t\t\tthis.trackBulkSmushInterruptedInlineNoticeEvent();\n\t\t} );\n\t}\n\n\ttrackScanInterruptedEventFromInlineNoticeOnDashboard( dashboardBulkElement ) {\n\t\tconst triggerScanButton = dashboardBulkElement.querySelector( '.wp-smush-retry-scan-link' );\n\t\tif ( ! triggerScanButton ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttriggerScanButton.addEventListener( 'click', ( e ) => {\n\t\t\te.preventDefault();\n\n\t\t\tconst event = 'Scan Interrupted';\n\t\t\tconst properties = this.getScanInterruptedEventProperties( {\n\t\t\t\tTrigger: 'failed_notice',\n\t\t\t\t'Modal Action': 'Retry',\n\t\t\t} );\n\n\t\t\ttracker.track( event, properties ).catch( () => {\n\t\t\t\tthis.cacheMissedEvent( {\n\t\t\t\t\tevent,\n\t\t\t\t\tproperties,\n\t\t\t\t} );\n\t\t\t} ).finally( () => {\n\t\t\t\twindow.location.href = e.target.href;\n\t\t\t} );\n\t\t} );\n\t}\n\n\ttrackScanInterruptedEventFromInlineNoticeOnBulkSmush() {\n\t\tconst recheckImagesNotice = document.querySelector( '.wp-smush-recheck-images-notice-box' );\n\t\tif ( ! recheckImagesNotice ) {\n\t\t\treturn;\n\t\t}\n\t\tconst triggerBackgroundScanImagesLink = recheckImagesNotice.querySelector( '.wp-smush-trigger-background-scan' );\n\t\tif ( triggerBackgroundScanImagesLink ) {\n\t\t\ttriggerBackgroundScanImagesLink.addEventListener( 'click', () => {\n\t\t\t\t// We are using the same frame for failed scan notice and generic required scan notice,\n\t\t\t\t// so we need to verify the failed notice before tracking the event.\n\t\t\t\tconst containTroubleshootingLink = triggerBackgroundScanImagesLink?.previousElementSibling?.querySelector( 'a' );\n\t\t\t\tif ( ! containTroubleshootingLink ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.trackScanInterruptedEvent( {\n\t\t\t\t\tTrigger: 'failed_notice',\n\t\t\t\t\t'Modal Action': 'Retry',\n\t\t\t\t} );\n\t\t\t} );\n\t\t}\n\t}\n\n\ttrackInterruptedEventFromLoopbackErrorModal() {\n\t\tconst loopbackErrorModal = document.getElementById( 'smush-loopback-error-dialog' );\n\t\tif ( ! loopbackErrorModal ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst loopbackErrorDocsLink = loopbackErrorModal.querySelector( 'a[href*=\"#loopback-request-issue\"]' );\n\t\tlet isTroubleshootClicked = false;\n\t\tif ( loopbackErrorDocsLink ) {\n\t\t\tloopbackErrorDocsLink.addEventListener( 'click', () => {\n\t\t\t\tisTroubleshootClicked = true;\n\t\t\t}, { once: true } );\n\t\t}\n\n\t\tconst closeButtons = loopbackErrorModal.querySelectorAll( '[data-modal-close]' );\n\t\tcloseButtons.forEach( ( closeButton ) => {\n\t\t\tcloseButton.addEventListener( 'click', ( e ) => {\n\t\t\t\tconst action = e.target.dataset?.action || 'Close';\n\t\t\t\tconst processType = loopbackErrorModal.dataset?.processType || 'scan';\n\t\t\t\tconst properties = {\n\t\t\t\t\tTrigger: 'loopback_error',\n\t\t\t\t\t'Modal Action': action,\n\t\t\t\t\tTroubleshoot: isTroubleshootClicked ? 'Yes' : 'No',\n\t\t\t\t};\n\n\t\t\t\tif ( 'scan' === processType ) {\n\t\t\t\t\tthis.trackScanInterruptedEvent( properties );\n\t\t\t\t} else {\n\t\t\t\t\tthis.trackBulkSmushInterruptedEvent( properties );\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\t}\n\n\tregisterTroubleshootClickEvent() {\n\t\tconst troubleshootLinks = document.querySelectorAll( 'a[href*=\"#troubleshooting-guide\"]' );\n\t\tif ( ! troubleshootLinks ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttroubleshootLinks.forEach( ( troubleshootLink ) => {\n\t\t\ttroubleshootLink.addEventListener( 'click', () => {\n\t\t\t\tthis.troubleshootClicked = true;\n\t\t\t}, { once: true } );\n\t\t} );\n\t}\n\n\tmaybeTrackMissedEventsOnLoad() {\n\t\twindow.addEventListener( 'load', () => {\n\t\t\tconst missedEvents = this.getMissedEvents();\n\t\t\tif ( 0 === missedEvents.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.clearMissedEvents();\n\n\t\t\tmissedEvents.forEach( ( missedEvent ) => {\n\t\t\t\ttracker.track( missedEvent.event, missedEvent.properties );\n\t\t\t} );\n\t\t} );\n\t}\n\n\tregisterBulkSmushResumeClickEvent() {\n\t\tconst resumeBulkSmushButton = document.querySelector( '.wp-smush-resume-bulk-smush' );\n\t\tif ( ! resumeBulkSmushButton ) {\n\t\t\treturn;\n\t\t}\n\n\t\tresumeBulkSmushButton.addEventListener( 'click', () => {\n\t\t\tthis.resumeBulkSmushCount += 1;\n\t\t} );\n\t}\n\n\tgetCurrentPageSlug() {\n\t\tconst searchParams = new URLSearchParams( document.location.search );\n\t\tconst pageSlug = searchParams.get( 'page' );\n\t\treturn 'smush' === pageSlug ? 'dashboard' : pageSlug.replace( 'smush-', '' );\n\t}\n}\n\n( new ProductAnalytics() ).init();\n","/* global ajaxurl */\n/* global wp_smush_msgs */\n/* global WP_Smush */\n/* global SUI */\n\n( function( $ ) {\n\t'use strict';\n\n\t/**\n\t * Bulk compress page.\n\t */\n\t$( 'form#smush-bulk-form' ).on( 'submit', function( e ) {\n\t\te.preventDefault();\n\t\t$( '#save-settings-button' ).addClass( 'sui-button-onload' );\n\t\tsaveSettings( $( this ).serialize(), 'bulk' );\n\t\t// runReCheck();\n\t} );\n\n\t/**\n\t * Lazy load page.\n\t */\n\t$( 'form#smush-lazy-load-form' ).on( 'submit', function( e ) {\n\t\te.preventDefault();\n\t\t$( '#save-settings-button' ).addClass( 'sui-button-onload-text' );\n\t\tsaveSettings( $( this ).serialize(), 'lazy-load' );\n\t} );\n\n\t/**\n\t * CDN page.\n\t */\n\t$( 'form#smush-cdn-form' ).on( 'submit', function( e ) {\n\t\te.preventDefault();\n\t\t$( '#save-settings-button' ).addClass( 'sui-button-onload-text' );\n\t\tsaveSettings( $( this ).serialize(), 'cdn' );\n\t} );\n\n\t/**\n\t * Local WebP page.\n\t */\n\t$( 'form#smush-webp-form' ).on( 'submit', function( e ) {\n\t\te.preventDefault();\n\t\t$( '#save-settings-button' ).addClass( 'sui-button-onload-text' );\n\t\tsaveSettings( $( this ).serialize(), 'webp' );\n\t} );\n\n\t/**\n\t * Integrations page.\n\t */\n\t$( 'form#smush-integrations-form' ).on( 'submit', function( e ) {\n\t\te.preventDefault();\n\t\t$( '#save-settings-button' ).addClass( 'sui-button-onload-text' );\n\t\tsaveSettings( $( this ).serialize(), 'integrations' );\n\t} );\n\n\t/**\n\t * Settings page.\n\t */\n\t$( 'form#smush-settings-form' ).on( 'submit', function( e ) {\n\t\te.preventDefault();\n\t\t$( '#save-settings-button' ).addClass( 'sui-button-onload-text' );\n\t\tsaveSettings( $( this ).serialize(), 'settings' );\n\t} );\n\n\t/**\n\t * Save settings.\n\t *\n\t * @param {string} settings JSON string of settings.\n\t * @param {string} page Settings page.\n\t */\n\tfunction saveSettings( settings, page ) {\n\t\tconst xhr = new XMLHttpRequest();\n\n\t\txhr.open( 'POST', ajaxurl + '?action=smush_save_settings', true );\n\t\txhr.setRequestHeader(\n\t\t\t'Content-type',\n\t\t\t'application/x-www-form-urlencoded'\n\t\t);\n\n\t\txhr.onload = () => {\n\t\t\t$( '#save-settings-button' ).removeClass(\n\t\t\t\t'sui-button-onload-text sui-button-onload'\n\t\t\t);\n\n\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\tconst res = JSON.parse( xhr.response );\n\t\t\t\tif ( 'undefined' !== typeof res.success && res.success ) {\n\t\t\t\t\tshowSuccessNotice( wp_smush_msgs.settingsUpdated );\n\t\t\t\t\ttriggerSavedSmushSettingsEvent( res.data );\n\t\t\t\t} else if ( res.data && res.data.message ) {\n\t\t\t\t\tWP_Smush.helpers.showErrorNotice( res.data.message );\n\t\t\t\t} else {\n\t\t\t\t\tWP_Smush.helpers.showErrorNotice( 'Request failed.' );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tWP_Smush.helpers.showErrorNotice( 'Request failed. Returned status of ' + xhr.status );\n\t\t\t}\n\t\t};\n\n\t\txhr.send( 'page=' + page + '&' + settings + '&_ajax_nonce=' + wp_smush_msgs.nonce );\n\t}\n\t\n\tfunction triggerSavedSmushSettingsEvent( status ) {\n\t\tdocument.dispatchEvent(\n\t\t\tnew CustomEvent( 'onSavedSmushSettings', {\n\t\t\t\tdetail: status\n\t\t\t} )\n\t\t);\n\t}\n\n\t/**\n\t * Show successful update notice.\n\t *\n\t * @param {string} msg Notice message.\n\t */\n\tfunction showSuccessNotice( msg ) {\n\t\tconst noticeMessage = `<p>${ msg }</p>`,\n\t\t\tnoticeOptions = {\n\t\t\t\ttype: 'success',\n\t\t\t\ticon: 'check',\n\t\t\t};\n\n\t\tSUI.openNotice( 'wp-smush-ajax-notice', noticeMessage, noticeOptions );\n\n\t\tconst loadingButton = document.querySelector( '.sui-button-onload' );\n\t\tif ( loadingButton ) {\n\t\t\tloadingButton.classList.remove( 'sui-button-onload' );\n\t\t}\n\t}\n\n\t/**\n\t * Re-check images from bulk smush and integrations pages.\n\t */\n\tfunction runReCheck() {\n\t\t$( '#save-settings-button' ).addClass( 'sui-button-onload' );\n\n\t\tconst param = {\n\t\t\taction: 'scan_for_resmush',\n\t\t\twp_smush_options_nonce: $( '#wp_smush_options_nonce' ).val(),\n\t\t\ttype: 'media',\n\t\t};\n\n\t\t// Send ajax, Update Settings, And Check For resmush.\n\t\t$.post( ajaxurl, $.param( param ) ).done( function() {\n\t\t\t$( '#save-settings-button' ).removeClass( 'sui-button-onload' );\n\t\t} );\n\t}\n\n\t/**\n\t * Parse remove data change.\n\t */\n\t$( 'input[name=keep_data]' ).on( 'change', function( e ) {\n\t\tconst otherClass =\n\t\t\t'keep_data-true' === e.target.id\n\t\t\t\t? 'keep_data-false'\n\t\t\t\t: 'keep_data-true';\n\t\te.target.parentNode.classList.add( 'active' );\n\t\tdocument\n\t\t\t.getElementById( otherClass )\n\t\t\t.parentNode.classList.remove( 'active' );\n\t} );\n\n\t/**\n\t * Handle auto-detect checkbox toggle, to show/hide highlighting notice.\n\t */\n\t$( 'input#detection' ).on( 'click', function() {\n\t\tconst noticeDiv = $( '.smush-highlighting-notice' );\n\t\tconst warningDiv = $( '.smush-highlighting-warning' );\n\n\t\t// Setting enabled.\n\t\tif ( $( this ).is( ':checked' ) ) {\n\t\t\t// Highlighting is already active and setting not saved.\n\t\t\tif ( noticeDiv.length > 0 ) {\n\t\t\t\tnoticeDiv.show();\n\t\t\t} else {\n\t\t\t\twarningDiv.show();\n\t\t\t}\n\t\t} else {\n\t\t\tnoticeDiv.hide();\n\t\t\twarningDiv.hide();\n\t\t}\n\t} );\n}( jQuery ) );\n","/* global WP_Smush */\n/* global ajaxurl */\n/* global wp_smushit_data */\n\nimport {GlobalStats} from \"../common/globalStats\";\nimport SmushProgress from \"../common/progressbar\";\n\nlet perf = 0;\n\nimport tracker from '../utils/tracker';\n\n/**\n * Smush class.\n *\n * @since 2.9.0 Moved from admin.js into a dedicated ES6 class.\n */\nclass Smush {\n\t/**\n\t * Class constructor.\n\t *\n\t * @param {Object} button Button object that made the call.\n\t * @param {boolean} bulk Bulk smush or not.\n\t * @param {string} type Accepts: 'nextgen', 'media'.\n\t */\n\tconstructor( button, bulk, type = 'media' ) {\n\t\tthis.onStart();\n\n\t\t//If smush attribute is not defined, Need not skip re-Smush IDs.\n\t\tthis.skip_resmush = ! (\n\t\t\t'undefined' === typeof button.data( 'smush' ) ||\n\t\t\t! button.data( 'smush' )\n\t\t);\n\t\tthis.button = jQuery( button[ 0 ] );\n\t\tthis.is_bulk = typeof bulk ? bulk : false;\n\t\tthis.url = ajaxurl;\n\t\tthis.log = jQuery( '.smush-final-log' );\n\n\t\tthis.setIds();\n\n\t\tthis.is_bulk_resmush =\n\t\t\t0 < wp_smushit_data.resmush.length && ! this.skip_resmush;\n\t\tthis.status = this.button.parent().prev( '.smush-status' );\n\n\t\t// Added for NextGen support.\n\t\tthis.smush_type = type;\n\t\tthis.single_ajax_suffix =\n\t\t\t'nextgen' === this.smush_type\n\t\t\t\t? 'smush_manual_nextgen'\n\t\t\t\t: 'wp_smushit_manual';\n\t\tthis.bulk_ajax_suffix =\n\t\t\t'nextgen' === this.smush_type\n\t\t\t\t? 'wp_smushit_nextgen_bulk'\n\t\t\t\t: 'wp_smushit_bulk';\n\t\tthis.get_stats_action = 'nextgen' === this.smush_type ? 'nextgen_get_stats' : 'get_stats';\n\t\tthis.url = this.is_bulk\n\t\t\t? Smush.smushAddParams( this.url, {\n\t\t\t\taction: this.bulk_ajax_suffix,\n\t\t\t} )\n\t\t\t: Smush.smushAddParams( this.url, {\n\t\t\t\taction: this.single_ajax_suffix,\n\t\t\t} );\n\n\t\tthis.start();\n\t\t( ! this.is_bulk ) && this.run();\n\t\tthis.bindDeferredEvents();\n\n\t\t// Handle cancel ajax.\n\t\t// this.cancelAjax();\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Add params to the URL.\n\t *\n\t * @param {string} url URL to add the params to.\n\t * @param {Object} data Object with params.\n\t * @return {string} URL with params.\n\t */\n\tstatic smushAddParams( url, data ) {\n\t\tif ( ! jQuery.isEmptyObject( data ) ) {\n\t\t\turl +=\n\t\t\t\t( url.indexOf( '?' ) >= 0 ? '&' : '?' ) + jQuery.param( data );\n\t\t}\n\n\t\treturn url;\n\t}\n\n\t/**\n\t * Check membership validity.\n\t *\n\t * @param {Object} data\n\t * @param {number} data.show_warning\n\t */\n\tstatic membershipValidity( data ) {\n\t\tconst memberValidityNotice = jQuery( '#wp-smush-invalid-member' );\n\n\t\t// Check for membership warning.\n\t\tif (\n\t\t\t'undefined' !== typeof data &&\n\t\t\t'undefined' !== typeof data.show_warning &&\n\t\t\tmemberValidityNotice.length > 0\n\t\t) {\n\t\t\tif ( data.show_warning ) {\n\t\t\t\tmemberValidityNotice.show();\n\t\t\t} else {\n\t\t\t\tmemberValidityNotice.hide();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Send Ajax request for compressing the image.\n\t *\n\t * @param {boolean} isBulkResmush\n\t * @param {number} id\n\t * @param {string} sendUrl\n\t * @param {string} nonce\n\t * @param {boolean} newBulkSmushStarted\n\t * @return {*|jQuery.promise|void} Compression results.\n\t */\n\tstatic ajax( isBulkResmush, id, sendUrl, nonce, newBulkSmushStarted= false ) {\n\t\tconst param = jQuery.param( {\n\t\t\tis_bulk_resmush: isBulkResmush,\n\t\t\tattachment_id: id,\n\t\t\t_nonce: nonce,\n\t\t\tnew_bulk_smush_started: newBulkSmushStarted\n\t\t} );\n\n\t\treturn jQuery.ajax( {\n\t\t\ttype: 'GET',\n\t\t\tdata: param,\n\t\t\turl: sendUrl,\n\t\t\t/** @param {Array} wp_smushit_data */\n\t\t\ttimeout: wp_smushit_data.timeout,\n\t\t\tdataType: 'json',\n\t\t} );\n\t}\n\n\t/**\n\t * Sets this.ids.\n\t */\n\tsetIds() {\n\t\tlet ids = [];\n\t\tif ( 0 < wp_smushit_data.resmush.length && ! this.skip_resmush ) {\n\t\t\tif ( 0 < wp_smushit_data.unsmushed.length ) {\n\t\t\t\tids = wp_smushit_data.resmush.concat( wp_smushit_data.unsmushed );\n\t\t\t} else {\n\t\t\t\tids = wp_smushit_data.resmush;\n\t\t\t}\n\t\t} else {\n\t\t\tids = wp_smushit_data.unsmushed;\n\t\t}\n\n\t\tif ( 'object' === typeof ids ) {\n\t\t\t// If button has re-Smush class, and we do have ids that needs to re-Smushed, put them in the list.\n\t\t\tthis.ids = ids.filter( function( itm, i, a ) {\n\t\t\t\treturn i === a.indexOf( itm );\n\t\t\t} );\n\t\t} else {\n\t\t\tthis.ids = ids;\n\t\t}\n\t}\n\n\t/**\n\t * Show loader in button for single and bulk Smush.\n\t */\n\tstart() {\n\t\tthis.button.prop( 'disabled', true );\n\t\tthis.button.addClass( 'wp-smush-started' );\n\n\t\tthis.bulkStart();\n\t\tthis.singleStart();\n\t}\n\n\t/**\n\t * Start bulk Smush.\n\t */\n\tbulkStart() {\n\t\tif ( ! this.is_bulk ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Hide the bulk div.\n\t\tjQuery( '.wp-smush-bulk-wrapper' ).addClass( 'sui-hidden' );\n\n\t\t// Hide the bulk limit message.\n\t\tjQuery(\n\t\t\t'.wp-smush-bulk-progress-bar-wrapper .sui-notice-warning:first-of-type'\n\t\t).hide();\n\n\t\t// Hide parent wrapper, if there are no other messages.\n\t\tif (\n\t\t\t0 >= jQuery( 'div.smush-final-log .smush-bulk-error-row' ).length\n\t\t) {\n\t\t\tjQuery( 'div.smush-final-log' ).addClass('sui-hidden');\n\t\t}\n\n\t\t// Show the progress bar.\n\t\tjQuery(\n\t\t\t'.bulk-smush-wrapper .wp-smush-bulk-progress-bar-wrapper, #wp-smush-running-notice'\n\t\t).removeClass( 'sui-hidden' );\n\t}\n\n\t/**\n\t * Start single image Smush.\n\t */\n\tsingleStart() {\n\t\tif ( this.is_bulk ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.button.html(\n\t\t\t'<span class=\"spinner wp-smush-progress\">' +\n\t\t\t\twindow.wp_smush_msgs.smushing +\n\t\t\t\t'</span>'\n\t\t);\n\t\tthis.status.removeClass( 'error' );\n\t}\n\n\t/**\n\t * Enable button.\n\t */\n\tenableButton() {\n\t\tthis.button.prop( 'disabled', false );\n\t\tjQuery('.wp-smush-all').prop('disabled', false);\n\t\tjQuery('.wp-smush-restore').prop('disabled', false);\n\t\t// For bulk process, enable other buttons.\n\t\tjQuery(\n\t\t\t'a.wp-smush-lossy-enable, button.wp-smush-resize-enable, button#save-settings-button'\n\t\t).prop('disabled', false);\n\t}\n\n\t/**\n\t * Finish single image Smush.\n\t */\n\tsingleDone() {\n\t\tif ( this.is_bulk ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst self = this;\n\n\t\tthis.request\n\t\t\t.done( function( response ) {\n\t\t\t\tif ( 'undefined' !== typeof response.data ) {\n\t\t\t\t\t// Check if stats div exists.\n\t\t\t\t\tconst parent = self.status.parent();\n\n\t\t\t\t\t// Check whether to show membership validity notice or not.\n\t\t\t\t\tSmush.membershipValidity( response.data );\n\n\t\t\t\t\tif ( ! response.success ) {\n\t\t\t\t\t\tif ( response.data.html_stats ) {\n\t\t\t\t\t\t\tparent.html( response.data.html_stats );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tself.status.addClass( 'smush-warning' );\n\t\t\t\t\t\t\t/** @param {string} response.data.error_msg */\n\t\t\t\t\t\t\tself.status.html( response.data.error_msg );\n\t\t\t\t\t\t\tself.button.html(\n\t\t\t\t\t\t\t\twindow.smush_vars.strings.stats_label\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If we've updated status, replace the content.\n\t\t\t\t\t\tparent.html( response.data );\n\t\t\t\t\t\tself.button.html( window.wp_smush_msgs.all_done );\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Update image size in attachment info panel.\n\t\t\t\t\t *\n\t\t\t\t\t * @param {string|number} response.data.new_size\n\t\t\t\t\t */\n\t\t\t\t\tSmush.updateImageStats( response.data.new_size );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.fail( function( response ) {\n\t\t\t\tself.status.html( response.data );\n\t\t\t\tself.status.addClass( 'smush-warning' );\n\t\t\t\tself.enableButton();\n\t\t\t} );\n\t}\n\n\t/**\n\t * Get total images left to optimize.\n\t *\n\t * @see get_total_images_to_smush() in Abstract_Summary_Page class.\n\t *\n\t * @since 3.10.0\n\t */\n\tstatic getTotalImagesToSmush() {\n\t\tconst imagesToResmush = wp_smushit_data.resmush.length;\n\n\t\tconst unsmushedCount = wp_smushit_data.count_total - wp_smushit_data.count_smushed;\n\n\t\tif ( unsmushedCount > 0 ) {\n\t\t\treturn imagesToResmush + unsmushedCount;\n\t\t}\n\n\t\treturn imagesToResmush;\n\t}\n\n\t/**\n\t * Update the \"optimized images\" score on the summary meta box.\n\t *\n\t * @see get_grade_data() in Abstract_Summary_Page class.\n\t *\n\t * @since 3.10.0\n\t */\n\tstatic updateScoreProgress() {\n\t\tlet grade = 'sui-grade-dismissed';\n\t\tlet percentOptimized = 0;\n\t\tlet percentMetric = 0;\n\n\t\tconst totalImagesToSmush = Smush.getTotalImagesToSmush();\n\t\tconst totalImages = parseInt( wp_smushit_data.count_total );\n\n\t\tif ( totalImages === totalImagesToSmush ) {\n\t\t\tif ( totalImages > 0 ) {\n\t\t\t\tgrade = 'sui-grade-f';\n\t\t\t}\n\t\t\tpercentMetric = 100;\n\t\t} else if ( 0 < totalImages ) {\n\t\t\tpercentOptimized = Math.floor( ( totalImages - totalImagesToSmush ) * 100 / totalImages );\n\t\t\tpercentMetric = percentOptimized;\n\t\t\tgrade = 'sui-grade-f';\n\n\t\t\tif ( percentOptimized >= 60 && percentOptimized < 90 ) {\n\t\t\t\tgrade = 'sui-grade-c';\n\t\t\t} else if ( percentOptimized >= 90 ) {\n\t\t\t\tgrade = 'sui-grade-a';\n\t\t\t}\n\t\t}\n\n\t\tconst imageScore = jQuery( '#smush-image-score' );\n\n\t\timageScore\n\t\t\t.removeClass(\n\t\t\t\tfunction( index, className ) {\n\t\t\t\t\tconst matchedClasses = className.match( /(^|\\s)sui-grade-\\S+/g );\n\t\t\t\t\treturn ( matchedClasses || [] ).join( ' ' );\n\t\t\t\t}\n\t\t\t)\n\t\t\t.addClass( grade )\n\t\t\t.attr( 'data-score', percentOptimized )\n\t\t\t.find( '.sui-circle-score-label' ).html( percentOptimized );\n\n\t\timageScore\n\t\t\t.find( 'circle:last-child' )\n\t\t\t.attr( 'style', '--metric-array:' + ( 2.63893782902 * percentMetric ) + ' ' + ( 263.893782902 - percentMetric ) );\n\t}\n\n\t/**\n\t * Update all stats sections based on the response.\n\t *\n\t * @param {string} scanType Current scan type.\n\t */\n\tstatic updateStats( scanType ) {\n\t\tconst isNextgen = 'undefined' !== typeof scanType && 'nextgen' === scanType;\n\n\t\t// Calculate updated savings in bytes.\n\t\twp_smushit_data.savings_bytes = parseInt( wp_smushit_data.size_before ) - parseInt( wp_smushit_data.size_after );\n\n\t\tconst formattedSize = WP_Smush.helpers.formatBytes( wp_smushit_data.savings_bytes, 0 );\n\t\tconst statsHuman = jQuery( '.wp-smush-savings .wp-smush-stats-human' );\n\n\t\tif ( isNextgen ) {\n\t\t\tstatsHuman.html( formattedSize );\n\t\t} else {\n\t\t\tstatsHuman.html( WP_Smush.helpers.getFormatFromString( formattedSize ) );\n\t\t\tjQuery( '.sui-summary-large.wp-smush-stats-human' )\n\t\t\t\t.html( WP_Smush.helpers.getSizeFromString( formattedSize ) );\n\t\t}\n\n\t\t// Update the savings percent.\n\t\twp_smushit_data.savings_percent = WP_Smush.helpers.precise_round(\n\t\t\t( parseInt( wp_smushit_data.savings_bytes ) /\n\t\t\t\tparseInt( wp_smushit_data.size_before ) ) *\n\t\t\t\t100,\n\t\t\t1\n\t\t);\n\t\tif ( ! isNaN( wp_smushit_data.savings_percent ) ) {\n\t\t\tjQuery( '.wp-smush-savings .wp-smush-stats-percent' )\n\t\t\t\t.html( wp_smushit_data.savings_percent );\n\t\t}\n\n\t\t// Update image count.\n\t\tif ( isNextgen ) {\n\t\t\tjQuery( '.sui-summary-details span.wp-smush-total-optimised' )\n\t\t\t\t.html( wp_smushit_data.count_images );\n\t\t} else {\n\t\t\tjQuery( 'span.smushed-items-count span.wp-smush-count-total span.wp-smush-total-optimised' )\n\t\t\t\t.html( wp_smushit_data.count_images );\n\t\t}\n\n\t\t// Update resize image count.\n\t\tif ( wp_smushit_data.count_resize > 0 ) {\n\t\t\tjQuery( 'span.smushed-items-count span.wp-smush-count-resize-total' ).removeClass( 'sui-hidden' );\n\t\t\tjQuery( 'span.smushed-items-count span.wp-smush-count-resize-total span.wp-smush-total-optimised' )\n\t\t\t\t.html( wp_smushit_data.count_resize );\n\t\t}\n\n\t\t// Update super-Smushed image count.\n\t\tconst smushedCountDiv = jQuery( 'li.super-smush-attachments .smushed-count' );\n\t\tif ( smushedCountDiv.length && 'undefined' !== typeof wp_smushit_data.count_supersmushed ) {\n\t\t\tsmushedCountDiv.html( wp_smushit_data.count_supersmushed );\n\t\t}\n\n\t\t// Update conversion savings.\n\t\tconst smushConversionSavings = jQuery( '.smush-conversion-savings' );\n\t\tif (\n\t\t\tsmushConversionSavings.length > 0 &&\n\t\t\t'undefined' !== typeof wp_smushit_data.savings_conversion &&\n\t\t\twp_smushit_data.savings_conversion !== ''\n\t\t) {\n\t\t\tconst conversionSavings = smushConversionSavings.find( '.wp-smush-stats' );\n\t\t\tif ( conversionSavings.length > 0 ) {\n\t\t\t\tconversionSavings.html(\n\t\t\t\t\tWP_Smush.helpers.formatBytes( wp_smushit_data.savings_conversion, 1 )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Update image size in attachment info panel.\n\t *\n\t * @since 2.8\n\t *\n\t * @param {number} newSize\n\t */\n\tstatic updateImageStats( newSize ) {\n\t\tif ( 0 === newSize ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst attachmentSize = jQuery( '.attachment-info .file-size' );\n\t\tconst currentSize = attachmentSize\n\t\t\t.contents()\n\t\t\t.filter( function() {\n\t\t\t\treturn this.nodeType === 3;\n\t\t\t} )\n\t\t\t.text();\n\n\t\t// There is a space before the size.\n\t\tif ( currentSize !== ' ' + newSize ) {\n\t\t\tconst sizeStrongEl = attachmentSize\n\t\t\t\t.contents()\n\t\t\t\t.filter( function() {\n\t\t\t\t\treturn this.nodeType === 1;\n\t\t\t\t} )\n\t\t\t\t.text();\n\t\t\tattachmentSize.html(\n\t\t\t\t'<strong>' + sizeStrongEl + '</strong> ' + newSize\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Sync stats.\n\t */\n\tsyncStats() {\n\t\tconst messageHolder = jQuery(\n\t\t\t'div.wp-smush-bulk-progress-bar-wrapper div.wp-smush-count.tc'\n\t\t);\n\t\t// Store the existing content in a variable.\n\t\tconst progressMessage = messageHolder.html();\n\t\t/** @param {string} wp_smush_msgs.sync_stats */\n\t\tmessageHolder.html( window.wp_smush_msgs.sync_stats );\n\n\t\tconst self = this;\n\n\t\t// Send ajax.\n\t\treturn jQuery\n\t\t\t.ajax( {\n\t\t\t\ttype: 'GET',\n\t\t\t\turl: ajaxurl,\n\t\t\t\tdata: {\n\t\t\t\t\taction: this.get_stats_action,\n\t\t\t\t\t_ajax_nonce: window.wp_smush_msgs.nonce,\n\t\t\t\t},\n\t\t\t\tsuccess( response ) {\n\t\t\t\t\tif ( ! response?.success ) {\n\t\t\t\t\t\tWP_Smush.helpers.showNotice( response, {\n\t\t\t\t\t\t\tshowdismiss: true,\n\t\t\t\t\t\t\tautoclose: false,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tGlobalStats.updateGlobalStatsFromSmushScriptData( response.data );\n\t\t\t\t\tGlobalStats.renderStats();\n\t\t\t\t\tSmushProgress.update( 0, response.data.remaining_count );\n\n\t\t\t\t\tjQuery('.wp-smush-scan').prop('disabled', false);\n\t\t\t\t\tself.hideBulkFreeLimitReachedNotice();\n\t\t\t\t},\n\t\t\t} )\n\t\t\t.always( () => messageHolder.html( progressMessage ) );\n\t}\n\n\t/**\n\t * After the bulk optimization has been finished.\n\t */\n\tbulkDone() {\n\t\tif ( ! this.is_bulk ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Enable the button.\n\t\tthis.enableButton();\n\n\t\t// Show notice.\n\t\tif ( 0 === this.ids.length ) {\n\t\t\tjQuery('.bulk-smush-wrapper .wp-smush-all-done').removeClass( 'sui-hidden' );\n\t\t\tjQuery( '.wp-smush-bulk-wrapper' ).addClass( 'sui-hidden' );\n\t\t\t// Hide the progress bar if scan is finished.\n\t\t\tjQuery( '.wp-smush-bulk-progress-bar-wrapper' ).addClass( 'sui-hidden' );\n\n\t\t\t// Reset the progress when we finish so the next smushing starts from zero.\n\t\t\tthis._updateProgress(0, 0);\n\t\t} else {\n\t\t\t// TODO: REMOVE \"re-smush-notice\" since no longer used. And maybe for \"wp-smush-remaining\" too.\n\t\t\tconst notice = jQuery(\n\t\t\t\t'.bulk-smush-wrapper .wp-smush-resmush-notice'\n\t\t\t);\n\n\t\t\tif ( notice.length > 0 ) {\n\t\t\t\tnotice.show();\n\t\t\t} else {\n\t\t\t\tjQuery( '.bulk-smush-wrapper .wp-smush-remaining' ).removeClass( 'sui-hidden' );\n\t\t\t}\n\t\t}\n\n\t\t// Enable re-Smush and scan button.\n\t\tjQuery( '.wp-resmush.wp-smush-action' ).removeProp(\n\t\t\t'disabled'\n\t\t);\n\t}\n\t\n\tshowAnimatedUpsellNotice() {\n\t\tif ( ! this.errors.length ) {\n\t\t\treturn;\n\t\t}\n\t\t// Only show animated upsell if exists an animated error in first 5 errors.\n\t\t// Note, this.errors will be reset each we resume so let detect animated error from elements.\n\t\tconst bulkErrors = document.querySelector('.smush-bulk-errors');\n\t\tif ( ! bulkErrors ) {\n\t\t\treturn;\n\t\t}\n\t\tconst firstAnimatedError = bulkErrors.querySelector( '[data-error-code=\"animated\"]' );\n\t\tif ( ! firstAnimatedError ) {\n\t\t\treturn;\n\t\t}\n\t\tconst first5Errors = Array.prototype.slice.call(bulkErrors.childNodes, 0, 5 );\n\t\treturn first5Errors.includes( firstAnimatedError );\n\t}\n\n\tmaybeShowCDNActivationNotice() {\n\t\t// Only for pro users.\n\t\tif ( ! wp_smush_msgs.smush_cdn_activation_notice || ! this.showAnimatedUpsellNotice() ) {\n\t\t\treturn;\n\t\t}\n\t\tWP_Smush.helpers.renderActivationCDNNotice( wp_smush_msgs.smush_cdn_activation_notice );\n\t}\n\n\tmaybeShowUnlimitedUpsellNotice() {\n\t\tconst unlimitedUpsellNotice = document.querySelector('.wp-smush-global-upsell');\n\t\tif ( ! unlimitedUpsellNotice ) {\n\t\t\treturn;\n\t\t}\n\t\tunlimitedUpsellNotice.classList.remove( 'sui-hidden' );\n\t}\n\n\tmaybeShowBulkErrorActions() {\n\t\tif ( ! this.errors.length ) {\n\t\t\treturn;\n\t\t}\n\t\tconst bulkErrorActionsElement = document.querySelector('.smush-bulk-errors-actions');\n\t\tif ( ! bulkErrorActionsElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tbulkErrorActionsElement.classList.remove('sui-hidden');\n\t}\n\n\t/**\n\t * Free Smush limit exceeded.\n\t */\n\tfreeExceeded() {\n\t\tconst progress = jQuery( '.wp-smush-bulk-progress-bar-wrapper' );\n\t\tprogress.addClass( 'wp-smush-exceed-limit' ).removeClass('sui-hidden');\n\t\tprogress\n\t\t\t.find( '.sui-progress-block .wp-smush-cancel-bulk' )\n\t\t\t.removeClass( 'sui-hidden' );\n\t\tprogress\n\t\t\t.find( '.sui-progress-block .wp-smush-all' )\n\t\t\t.addClass( 'sui-hidden' );\n\n\t\tprogress\n\t\t\t.find( 'i.sui-icon-loader' )\n\t\t\t.addClass( 'sui-icon-info' )\n\t\t\t.removeClass( 'sui-icon-loader' )\n\t\t\t.removeClass( 'sui-loading' );\n\n\t\tdocument\n\t\t\t.getElementById( 'bulk-smush-resume-button' )\n\t\t\t.classList.remove( 'sui-hidden' );\n\n\t\tthis.showBulkFreeLimitReachedNotice();\n\t}\n\n\tshowBulkFreeLimitReachedNotice() {\n\t\tconst bulkFreeLimitReachedNotice = document.getElementById( 'smush-limit-reached-notice' );\n\t\tif ( bulkFreeLimitReachedNotice ) {\n\t\t\tbulkFreeLimitReachedNotice.classList.remove( 'sui-hidden' );\n\t\t}\n\t}\n\n\thideBulkFreeLimitReachedNotice() {\n\t\tconst bulkFreeLimitReachedNotice = document.getElementById( 'smush-limit-reached-notice' );\n\t\tif ( bulkFreeLimitReachedNotice ) {\n\t\t\tbulkFreeLimitReachedNotice.classList.add( 'sui-hidden' );\n\t\t}\n\t}\n\n\t/**\n\t * Adds the stats for the current image to existing stats.\n\t *\n\t * @param {Array} imageStats\n\t * @param {string} imageStats.count\n\t * @param {boolean} imageStats.is_lossy\n\t * @param {Array} imageStats.savings_resize\n\t * @param {Array} imageStats.savings_conversion\n\t * @param {string} imageStats.size_before\n\t * @param {string} imageStats.size_after\n\t * @param {string} type\n\t */\n\tstatic updateLocalizedStats( imageStats, type ) {\n\t\t// Increase the Smush count.\n\t\tif ( 'undefined' === typeof window.wp_smushit_data ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// No need to increase attachment count, resize, conversion savings for directory Smush.\n\t\tif ( 'media' === type ) {\n\t\t\twp_smushit_data.count_smushed = parseInt( wp_smushit_data.count_smushed ) + 1;\n\n\t\t\t// Increase Smushed image count.\n\t\t\twp_smushit_data.count_images = parseInt( wp_smushit_data.count_images ) + parseInt( imageStats.count );\n\n\t\t\t// Increase super Smush count, if applicable.\n\t\t\tif ( imageStats.is_lossy ) {\n\t\t\t\twp_smushit_data.count_supersmushed = parseInt( wp_smushit_data.count_supersmushed ) + 1;\n\t\t\t}\n\n\t\t\t// Add to resize savings.\n\t\t\twp_smushit_data.savings_resize =\n\t\t\t\t'undefined' !== typeof imageStats.savings_resize.bytes\n\t\t\t\t\t? parseInt( wp_smushit_data.savings_resize ) + parseInt( imageStats.savings_resize.bytes )\n\t\t\t\t\t: parseInt( wp_smushit_data.savings_resize );\n\n\t\t\t// Update resize count.\n\t\t\twp_smushit_data.count_resize =\n\t\t\t\t'undefined' !== typeof imageStats.savings_resize.bytes\n\t\t\t\t\t? parseInt( wp_smushit_data.count_resize ) + 1\n\t\t\t\t\t: wp_smushit_data.count_resize;\n\n\t\t\t// Add to conversion savings.\n\t\t\twp_smushit_data.savings_conversion =\n\t\t\t\t'undefined' !== typeof imageStats.savings_conversion &&\n\t\t\t\t'undefined' !== typeof imageStats.savings_conversion.bytes\n\t\t\t\t\t? parseInt( wp_smushit_data.savings_conversion ) + parseInt( imageStats.savings_conversion.bytes )\n\t\t\t\t\t: parseInt( wp_smushit_data.savings_conversion );\n\t\t} else if ( 'directory_smush' === type ) {\n\t\t\t//Increase smushed image count\n\t\t\twp_smushit_data.count_images = parseInt( wp_smushit_data.count_images ) + 1;\n\t\t} else if ( 'nextgen' === type ) {\n\t\t\twp_smushit_data.count_smushed = parseInt( wp_smushit_data.count_smushed ) + 1;\n\t\t\twp_smushit_data.count_supersmushed = parseInt( wp_smushit_data.count_supersmushed ) + 1;\n\n\t\t\t// Increase Smushed image count.\n\t\t\twp_smushit_data.count_images = parseInt( wp_smushit_data.count_images ) + parseInt( imageStats.count );\n\t\t}\n\n\t\t// If we have savings. Update savings.\n\t\tif ( imageStats.size_before > imageStats.size_after ) {\n\t\t\twp_smushit_data.size_before =\n\t\t\t\t'undefined' !== typeof imageStats.size_before\n\t\t\t\t\t? parseInt( wp_smushit_data.size_before ) + parseInt( imageStats.size_before )\n\t\t\t\t\t: parseInt( wp_smushit_data.size_before );\n\t\t\twp_smushit_data.size_after =\n\t\t\t\t'undefined' !== typeof imageStats.size_after\n\t\t\t\t\t? parseInt( wp_smushit_data.size_after ) + parseInt( imageStats.size_after )\n\t\t\t\t\t: parseInt( wp_smushit_data.size_after );\n\t\t}\n\n\t\t// Add stats for resizing. Update savings.\n\t\tif ( 'undefined' !== typeof imageStats.savings_resize ) {\n\t\t\twp_smushit_data.size_before =\n\t\t\t\t'undefined' !== typeof imageStats.savings_resize.size_before\n\t\t\t\t\t? parseInt( wp_smushit_data.size_before ) + parseInt( imageStats.savings_resize.size_before )\n\t\t\t\t\t: parseInt( wp_smushit_data.size_before );\n\t\t\twp_smushit_data.size_after =\n\t\t\t\t'undefined' !== typeof imageStats.savings_resize.size_after\n\t\t\t\t\t? parseInt( wp_smushit_data.size_after ) + parseInt( imageStats.savings_resize.size_after )\n\t\t\t\t\t: parseInt( wp_smushit_data.size_after );\n\t\t}\n\n\t\t// Add stats for conversion. Update savings.\n\t\tif ( 'undefined' !== typeof imageStats.savings_conversion ) {\n\t\t\twp_smushit_data.size_before =\n\t\t\t\t'undefined' !== typeof imageStats.savings_conversion.size_before\n\t\t\t\t\t? parseInt( wp_smushit_data.size_before ) + parseInt( imageStats.savings_conversion.size_before )\n\t\t\t\t\t: parseInt( wp_smushit_data.size_before );\n\t\t\twp_smushit_data.size_after =\n\t\t\t\t'undefined' !== typeof imageStats.savings_conversion.size_after\n\t\t\t\t\t? parseInt( wp_smushit_data.size_after ) + parseInt( imageStats.savings_conversion.size_after )\n\t\t\t\t\t: parseInt( wp_smushit_data.size_after );\n\t\t}\n\t}\n\n\t/**\n\t * Update progress.\n\t *\n\t * @param {Object} _res\n\t */\n\tupdateProgress( _res ) {\n\t\tif ( ! this.is_bulk_resmush && ! this.is_bulk ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet progress = 0;\n\n\t\t// Update localized stats.\n\t\tif (\n\t\t\t_res &&\n\t\t\t'undefined' !== typeof _res.data &&\n\t\t\t'undefined' !== typeof _res.data.stats\n\t\t) {\n\t\t\tSmush.updateLocalizedStats( _res.data.stats, this.smush_type );\n\t\t}\n\n\t\tif ( ! this.is_bulk_resmush ) {\n\t\t\t// Handle progress for normal bulk smush.\n\t\t\tprogress =\n\t\t\t\t( ( this.smushed + this.errors.length ) / this.total ) * 100;\n\t\t} else {\n\t\t\t// If the request was successful, update the progress bar.\n\t\t\tif ( _res.success ) {\n\t\t\t\t// Handle progress for super Smush progress bar.\n\t\t\t\tif ( wp_smushit_data.resmush.length > 0 ) {\n\t\t\t\t\t// Update the count.\n\t\t\t\t\tjQuery( '.wp-smush-images-remaining' ).html(\n\t\t\t\t\t\twp_smushit_data.resmush.length\n\t\t\t\t\t);\n\t\t\t\t} else if (\n\t\t\t\t\t0 === wp_smushit_data.resmush.length &&\n\t\t\t\t\t0 === this.ids.length\n\t\t\t\t) {\n\t\t\t\t\t// If all images are re-Smushed, show the All Smushed message.\n\t\t\t\t\tjQuery('.bulk-resmush-wrapper .wp-smush-all-done').removeClass( 'sui-hidden' );\n\n\t\t\t\t\t// Hide everything else.\n\t\t\t\t\tjQuery(\n\t\t\t\t\t\t'.wp-smush-resmush-wrap, .wp-smush-bulk-progress-bar-wrapper'\n\t\t\t\t\t).addClass( 'sui-hidden' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Handle progress for normal bulk Smush. Set progress bar width.\n\t\t\tif (\n\t\t\t\t'undefined' !== typeof this.ids &&\n\t\t\t\t'undefined' !== typeof this.total &&\n\t\t\t\tthis.total > 0\n\t\t\t) {\n\t\t\t\tprogress =\n\t\t\t\t\t( ( this.smushed + this.errors.length ) / this.total ) *\n\t\t\t\t\t100;\n\t\t\t}\n\t\t}\n\n\t\t// Reset the lossless images count in case of pending images for resmush ( Nextgen only ).\n\t\tif (\n\t\t\t'nextgen' === this.smush_type &&\n\t\t\twp_smushit_data.resmush.length > 0 && \n\t\t\t(this.smushed + this.errors.length <= 1)\n\t\t) {\n\t\t\twp_smushit_data.count_images -= (wp_smushit_data.resmush.length + 1);\n\t\t}\n\n\t\t// No more images left. Show bulk wrapper and Smush notice.\n\t\tif ( 0 === this.ids.length ) {\n\t\t\t// TODO: Check it with BO and maybe move these into progress bar module for reusing.\n\t\t\tjQuery('.bulk-smush-wrapper .wp-smush-all-done').removeClass( 'sui-hidden' );\n\t\t\tjQuery( '.wp-smush-bulk-wrapper' ).addClass( 'sui-hidden' );\n\t\t}\n\n\t\t// Increase the progress bar and counter.\n\t\tthis._updateProgress(\n\t\t\tthis.smushed + this.errors.length,\n\t\t\tWP_Smush.helpers.precise_round( progress, 1 )\n\t\t);\n\n\t\t// Avoid updating the stats twice when the bulk smush ends on Smush's page.\n\t\tif (0 !== this.ids.length || 'nextgen' === this.smush_type) {\n\t\t\t// Update stats and counts.\n\t\t\tSmush.updateStats(this.smush_type);\n\t\t}\n\t}\n\n\t/**\n\t * Update progress.\n\t *\n\t * @param {number} count Number of images optimized.\n\t * @param {string} width Percentage complete.\n\t * @private\n\t */\n\t_updateProgress( count, width ) {\n\t\tif ( ! this.is_bulk && ! this.is_bulk_resmush ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Progress bar label.\n\t\tjQuery( 'span.wp-smush-images-percent' ).html( width + '%' );\n\t\t// Progress bar.\n\t\tjQuery( '.bulk-smush-wrapper .wp-smush-progress-inner' ).css(\n\t\t\t'width',\n\t\t\twidth + '%'\n\t\t);\n\n\t\t// Progress bar status.\n\t\tjQuery( '.bulk-smush-wrapper .sui-progress-state-text' )\n\t\t\t.find( 'span:first-child' )\n\t\t\t.html( count )\n\t\t\t.find( 'span:last-child' )\n\t\t\t.html( this.total );\n\t}\n\n\t/**\n\t * Whether to send the ajax requests further or not.\n\t *\n\t * @return {*|boolean} Should continue or not.\n\t */\n\tcontinue() {\n\t\treturn this.continueSmush && this.ids.length > 0 && this.is_bulk;\n\t\tlet continueSmush = this.button.attr( 'continue_smush' );\n\n\t\tif ( 'undefined' === typeof continueSmush ) {\n\t\t\tcontinueSmush = true;\n\t\t}\n\n\t\tif ( 'false' === continueSmush || ! continueSmush ) {\n\t\t\tcontinueSmush = false;\n\t\t}\n\n\t\treturn continueSmush && this.ids.length > 0 && this.is_bulk;\n\t}\n\n\tonStart() {\n\t\tthis.deferred = jQuery.Deferred();\n\t\tthis.deferred.errors = [];\n\t\tthis.continueSmush = true;\n\t\t// TODO: errors will reset after bulk smush limit is reached and user clicks continue.\n\t\tthis.errors = [];\n\t\t// Smushed and total we take from the progress bar... I don't like this :-(\n\t\tconst progressBar = jQuery(\n\t\t\t'.bulk-smush-wrapper .sui-progress-state-text'\n\t\t);\n\t\tthis.smushed = parseInt(\n\t\t\tprogressBar.find( 'span:first-child' ).html()\n\t\t);\n\t\tthis.total = parseInt( progressBar.find( 'span:last-child' ).html() );\n\n\t\tjQuery('.wp-smush-restore').prop('disabled', true);\n\t}\n\n\t/**\n\t * Send ajax request for optimizing single and bulk, call update_progress on ajax response.\n\t *\n\t * @return {*} Ajax call response.\n\t */\n\tcallAjax(newBulkSmushStarted = false) {\n\t\t/**\n\t\t * This here little piece of code allows to track auto continue clicks and halts bulk Smush until the page\n\t\t * is reloaded.\n\t\t *\n\t\t * @since 3.5.0\n\t\t * @see https://wordpress.org/plugins/wp-nonstop-smushit/\n\t\t */\n\t\tif (\n\t\t\t0 !== perf &&\n\t\t\t'undefined' !== typeof perf &&\n\t\t\t10 > performance.now() - perf\n\t\t) {\n\t\t\tthis.freeExceeded();\n\t\t\treturn this.deferred;\n\t\t}\n\n\t\tlet nonceValue = window.wp_smush_msgs.nonce;\n\t\t// Remove from array while processing so we can continue where left off.\n\t\tthis.current_id = this.is_bulk\n\t\t\t? this.ids.shift()\n\t\t\t: this.button.data( 'id' );\n\n\t\t// Remove the ID from respective variable as well.\n\t\tSmush.updateSmushIds( this.current_id );\n\n\t\tconst nonceField = this.button.parent().find( '#_wp_smush_nonce' );\n\t\tif ( nonceField.length > 0 ) {\n\t\t\tnonceValue = nonceField.val();\n\t\t}\n\n\t\tconst self = this;\n\n\t\tthis.request = Smush.ajax(\n\t\t\tthis.is_bulk_resmush,\n\t\t\tthis.current_id,\n\t\t\tthis.url,\n\t\t\tnonceValue,\n\t\t\tnewBulkSmushStarted\n\t\t)\n\t\t\t.done( function( res ) {\n\t\t\t\t// If no response or success is false, do not process further. Increase the error count except if bulk request limit exceeded.\n\t\t\t\tif (\n\t\t\t\t\t'undefined' === typeof res.success ||\n\t\t\t\t\t( 'undefined' !== typeof res.success &&\n\t\t\t\t\t\tfalse === res.success &&\n\t\t\t\t\t\t'undefined' !== typeof res.data &&\n\t\t\t\t\t\t'limit_exceeded' !== res.data.error )\n\t\t\t\t) {\n\t\t\t\t\tself.errors.push( self.current_id );\n\t\t\t\t\tconst error = res.data.error;\n\n\t\t\t\t\t/** @param {string} res.data.file_name */\n\t\t\t\t\tconst errorMsg = WP_Smush.helpers.prepareBulkSmushErrorRow(\n\t\t\t\t\t\terror.error_message,\n\t\t\t\t\t\terror.file_name,\n\t\t\t\t\t\terror.thumbnail,\n\t\t\t\t\t\tself.current_id,\n\t\t\t\t\t\tself.smush_type,\n\t\t\t\t\t\terror.error_code\n\t\t\t\t\t);\n\n\t\t\t\t\tself.log.removeClass('sui-hidden');\n\n\t\t\t\t\t// Print the error on screen.\n\t\t\t\t\tself.log.find( '.smush-bulk-errors' ).append( errorMsg );\n\t\t\t\t\tif ( self.errors.length > 4 ) {\n\t\t\t\t\t\tself.log.find( '.smush-bulk-errors' ).addClass('overflow-box');\n\t\t\t\t\t\tjQuery( '.smush-bulk-errors-actions' ).removeClass( 'sui-hidden' );\n\t\t\t\t\t}\n\t\t\t\t} else if (\n\t\t\t\t\t'undefined' !== typeof res.success &&\n\t\t\t\t\tres.success\n\t\t\t\t) {\n\t\t\t\t\t// Increment the smushed count if image smushed without errors.\n\t\t\t\t\tself.smushed++;\n\t\t\t\t}\n\n\t\t\t\t// Check whether to show the warning notice or not.\n\t\t\t\tSmush.membershipValidity( res.data );\n\n\t\t\t\t/**\n\t\t\t\t * Bulk Smush limit exceeded: Stop ajax requests, remove progress bar, append the last image ID\n\t\t\t\t * back to Smush variable, and reset variables to allow the user to continue bulk Smush.\n\t\t\t\t */\n\t\t\t\tif (\n\t\t\t\t\t'undefined' !== typeof res.data &&\n\t\t\t\t\t'limit_exceeded' === res.data.error &&\n\t\t\t\t\t'resolved' !== self.deferred.state()\n\t\t\t\t) {\n\t\t\t\t\t// Hide bulk running message.\n\t\t\t\t\tconst bulkRunning = document.getElementById(\n\t\t\t\t\t\t'wp-smush-running-notice'\n\t\t\t\t\t);\n\t\t\t\t\tbulkRunning.classList.add( 'sui-hidden' );\n\n\t\t\t\t\t// Add a data attribute to the Smush button, to stop sending ajax.\n\t\t\t\t\t// self.button.attr( 'continue_smush', false );\n\t\t\t\t\tself.continueSmush = false;\n\n\t\t\t\t\t// Reinsert the current ID.\n\t\t\t\t\twp_smushit_data.unsmushed.unshift( self.current_id );\n\t\t\t\t\tself.ids.unshift( self.current_id );\n\n\t\t\t\t\tperf = performance.now();\n\t\t\t\t\tself.freeExceeded();\n\t\t\t\t} else if ( self.is_bulk ) {\n\t\t\t\t\tself.updateProgress( res );\n\t\t\t\t\tSmush.updateScoreProgress();\n\t\t\t\t}\n\n\t\t\t\tif (0 === self.ids.length && self.is_bulk ) {\n\t\t\t\t\tself.onBulkSmushCompleted();\n\t\t\t\t}\n\n\t\t\t\tself.singleDone();\n\t\t\t} )\n\t\t\t.always( function() {\n\t\t\t\tif ( ! self.continue() || ! self.is_bulk ) {\n\t\t\t\t\t// Calls deferred.done()\n\t\t\t\t\tself.deferred.resolve();\n\t\t\t\t} else {\n\t\t\t\t\tself.callAjax(false);\n\t\t\t\t}\n\t\t\t} );\n\n\t\tthis.deferred.errors = this.errors;\n\n\t\treturn this.deferred;\n\t}\n\t\n\tmaybeShowCDNUpsellForPreSiteOnCompleted() {\n\t\t// Show upsell cdn.\n\t\tconst upsellCdn = document.querySelector('.wp-smush-upsell-cdn');\n\t\tif ( upsellCdn ) {\n\t\t\tupsellCdn.querySelector('p').innerHTML = wp_smush_msgs.processed_cdn_for_free;\n\t\t\tupsellCdn.classList.remove('sui-hidden');\n\t\t}\n\t}\n\t\n\tonBulkSmushCompleted() {\n\t\t// Show upsell unlimited on completed.\n\t\tthis.maybeShowUnlimitedUpsellNotice();\n\t\t// Show CDN activation notice for pro users.\n\t\tthis.maybeShowCDNActivationNotice();\n\t\t// Show CDN upsell for old users.\n\t\tthis.maybeShowCDNUpsellForPreSiteOnCompleted();\n\t\t\n\t\tthis.maybeShowBulkErrorActions();\n\t\t\n\t\tconst callback = this.is_bulk\n\t\t\t? () => this.trackBulkSmushCompleted()\n\t\t\t: () => false;\n\n\t\tthis.syncStats().done(callback);\n\t}\n\n\tgetPercentOptimized(totalImages, totalImagesToSmush) {\n\t\tif (totalImages === totalImagesToSmush || totalImages <= 0) {\n\t\t\treturn 100;\n\t\t} else {\n\t\t\treturn Math.floor((totalImages - totalImagesToSmush) * 100 / totalImages);\n\t\t}\n\t}\n\n\t/**\n\t * Prepare error row. Will only allow to hide errors for WP media attachments (not nextgen).\n\t *\n\t * @since 1.9.0\n\t *\n\t * @param {string} errorMsg Error message.\n\t * @param {string} fileName File name.\n\t * @param {string} thumbnail Thumbnail for image (if available).\n\t * @param {number} id Image ID.\n\t * @param {string} type Smush type: media or netxgen.\n\t *\n\t * @return {string} Row with error.\n\t */\n\tstatic prepareErrorRow( errorMsg, fileName, thumbnail, id, type ) {\n\t\tconst thumbDiv =\n\t\t\t'undefined' === typeof thumbnail\n\t\t\t\t? '<i class=\"sui-icon-photo-picture\" aria-hidden=\"true\"></i>'\n\t\t\t\t: thumbnail;\n\t\tconst fileLink =\n\t\t\t'undefined' === fileName || 'undefined' === typeof fileName\n\t\t\t\t? 'undefined'\n\t\t\t\t: fileName;\n\n\t\tlet tableDiv =\n\t\t\t'<div class=\"smush-bulk-error-row\">' +\n\t\t\t'<div class=\"smush-bulk-image-data\">' +\n\t\t\tthumbDiv +\n\t\t\t'<span class=\"smush-image-name\">' +\n\t\t\tfileLink +\n\t\t\t'</span>' +\n\t\t\t'<span class=\"smush-image-error\">' +\n\t\t\terrorMsg +\n\t\t\t'</span>' +\n\t\t\t'</div>';\n\n\t\tif ( 'media' === type ) {\n\t\t\ttableDiv =\n\t\t\t\ttableDiv +\n\t\t\t\t'<div class=\"smush-bulk-image-actions\">' +\n\t\t\t\t'<button type=\"button\" class=\"sui-button-icon sui-tooltip sui-tooltip-constrained sui-tooltip-left smush-ignore-image\" data-tooltip=\"' +\n\t\t\t\twindow.wp_smush_msgs.error_ignore +\n\t\t\t\t'\" data-id=\"' +\n\t\t\t\tid +\n\t\t\t\t'\">' +\n\t\t\t\t'<i class=\"sui-icon-eye-hide\" aria-hidden=\"true\"></i>' +\n\t\t\t\t'</button>' +\n\t\t\t\t'</div>';\n\t\t}\n\n\t\ttableDiv = tableDiv + '</div>';\n\n\t\treturn tableDiv;\n\t}\n\n\ttrackBulkSmushCompleted() {\n\t\tconst {\n\t\t\tsavings_bytes,\n\t\t\tcount_images,\n\t\t\tpercent_optimized,\n\t\t\tsavings_percent,\n\t\t\tcount_resize,\n\t\t\tsavings_resize\n\t\t} = GlobalStats.getGlobalStats();\n\t\ttracker.track( 'Bulk Smush Completed', {\n\t\t\t'Total Savings': this.convertToMegabytes( savings_bytes ),\n\t\t\t'Total Images': count_images,\n\t\t\t'Media Optimization Percentage': parseFloat( percent_optimized ),\n\t\t\t'Percentage of Savings': parseFloat( savings_percent ),\n\t\t\t'Images Resized': count_resize,\n\t\t\t'Resize Savings': this.convertToMegabytes( savings_resize )\n\t\t} );\n\t}\n\n\tconvertToMegabytes( sizeInBytes ) {\n\t\tconst unitMB = Math.pow( 1024, 2 );\n\t\tconst sizeInMegabytes = sizeInBytes / unitMB;\n\t\treturn sizeInMegabytes && parseFloat( sizeInMegabytes.toFixed( 2 ) ) || 0;\n\t}\n\n\t/**\n\t * Send ajax request for single and bulk Smushing.\n\t */\n\trun() {\n\t\t// If bulk and we have a definite number of IDs.\n\t\tif ( this.is_bulk && this.ids.length > 0 ) {\n\t\t\tthis.callAjax(true);\n\t\t}\n\n\t\tif ( ! this.is_bulk ) {\n\t\t\tthis.callAjax();\n\t\t}\n\t}\n\n\t/**\n\t * Show bulk Smush errors, and disable bulk Smush button on completion.\n\t */\n\tbindDeferredEvents() {\n\t\tconst self = this;\n\n\t\tthis.deferred.done( function() {\n\t\t\t// self.button.removeAttr( 'continue_smush' );\n\t\t\tself.continueSmush = true;\n\n\t\t\tif ( self.errors.length ) {\n\t\t\t\t/** @param {string} wp_smush_msgs.error_in_bulk */\n\t\t\t\tconst msg = self.errors.length === self.total ?\n\t\t\t\t\t\t\t\twindow.wp_smush_msgs.all_failed :\n\t\t\t\t\t\t\t\twindow.wp_smush_msgs.error_in_bulk\n\t\t\t\t\t\t\t\t.replace( '{{errors}}', self.errors.length )\n\t\t\t\t\t\t\t\t.replace( '{{total}}', self.total )\n\t\t\t\t\t\t\t\t.replace( '{{smushed}}', self.smushed );\n\n\t\t\t\tjQuery( '.wp-smush-all-done' )\n\t\t\t\t\t.addClass( 'sui-notice-warning' )\n\t\t\t\t\t.removeClass( 'sui-notice-success' )\n\t\t\t\t\t.find( 'p' )\n\t\t\t\t\t.html( msg );\n\t\t\t}\n\n\t\t\tself.bulkDone();\n\n\t\t\t// Re-enable the buttons.\n\t\t\tjQuery(\n\t\t\t\t'.wp-smush-all:not(.wp-smush-finished)'\n\t\t\t).prop('disabled', false);\n\t\t} );\n\t}\n\n\t/**\n\t * Handles the cancel button click.\n\t * Update the UI, and enable the bulk Smush button.\n\t */\n\tcancelAjax() {\n\t\t// Add a data attribute to the Smush button, to stop sending ajax.\n\t\t// this.button.attr( 'continue_smush', false );\n\t\tthis.continueSmush = false;\n\t\t// Sync and update stats.\n\t\tthis.syncStats();\n\n\t\tthis.request.abort();\n\t\tthis.enableButton();\n\t\tthis.button.removeClass( 'wp-smush-started' );\n\t\twp_smushit_data.unsmushed.unshift( this.current_id );\n\t\tjQuery( '.wp-smush-bulk-wrapper' ).removeClass( 'sui-hidden' );\n\n\t\t// Hide the progress bar.\n\t\tjQuery( '.wp-smush-bulk-progress-bar-wrapper' ).addClass( 'sui-hidden' );\n\n\t\tthis.hideBulkFreeLimitReachedNotice();\n\t}\n\n\t/**\n\t * Remove the current ID from the unSmushed/re-Smush variable.\n\t *\n\t * @param {number} currentId\n\t */\n\tstatic updateSmushIds( currentId ) {\n\t\tif (\n\t\t\t'undefined' !== typeof wp_smushit_data.unsmushed &&\n\t\t\twp_smushit_data.unsmushed.length > 0\n\t\t) {\n\t\t\tconst uIndex = wp_smushit_data.unsmushed.indexOf( currentId );\n\t\t\tif ( uIndex > -1 ) {\n\t\t\t\twp_smushit_data.unsmushed.splice( uIndex, 1 );\n\t\t\t}\n\t\t}\n\n\t\t// Remove from the re-Smush list.\n\t\tif (\n\t\t\t'undefined' !== typeof wp_smushit_data.resmush &&\n\t\t\twp_smushit_data.resmush.length > 0\n\t\t) {\n\t\t\tconst index = wp_smushit_data.resmush.indexOf( currentId );\n\t\t\tif ( index > -1 ) {\n\t\t\t\twp_smushit_data.resmush.splice( index, 1 );\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport default Smush;\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * WebP functionality.\n *\n * @since 3.8.0\n */\nimport Fetcher from '../utils/fetcher';\n\n(function () {\n\t'use strict';\n\n\tWP_Smush.WebP = {\n\t\tnonceField: document.getElementsByName('wp_smush_options_nonce'),\n\t\ttoggleModuleButton: document.getElementById('smush-toggle-webp-button'),\n\t\trecheckStatusButton: document.getElementById('smush-webp-recheck'),\n\t\trecheckStatusLink: document.getElementById('smush-webp-recheck-link'),\n\t\tshowWizardButton: document.getElementById('smush-webp-toggle-wizard'),\n\t\tswitchWebpMethod: document.getElementById('smush-switch-webp-method' ),\n\n\t\tinit() {\n\t\t\tthis.maybeShowDeleteAllSuccessNotice();\n\n\t\t\t/**\n\t\t\t * Handles the \"Deactivate\" and \"Get Started\" buttons on the WebP page.\n\t\t\t */\n\t\t\tif (this.toggleModuleButton) {\n\t\t\t\tthis.toggleModuleButton.addEventListener('click', (e) =>\n\t\t\t\t\tthis.toggleWebp(e)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handle \"RE-CHECK STATUS' button click on WebP page.\n\t\t\t */\n\t\t\tif (this.recheckStatusButton) {\n\t\t\t\tthis.recheckStatusButton.addEventListener('click', (e) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tthis.recheckStatus();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handle \"RE-CHECK STATUS' link click on WebP page.\n\t\t\t */\n\t\t\tif (this.recheckStatusLink) {\n\t\t\t\tthis.recheckStatusLink.addEventListener('click', (e) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tthis.recheckStatus();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles the \"Delete WebP images\" button.\n\t\t\t */\n\t\t\tif (document.getElementById('wp-smush-webp-delete-all')) {\n\t\t\t\tdocument\n\t\t\t\t\t.getElementById('wp-smush-webp-delete-all')\n\t\t\t\t\t.addEventListener('click', (e) => this.deleteAll(e));\n\t\t\t}\n\n\t\t\tif (this.showWizardButton) {\n\t\t\t\tthis.showWizardButton.addEventListener(\n\t\t\t\t\t'click',\n\t\t\t\t\tthis.toggleWizard\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( this.switchWebpMethod ) {\n\t\t\t\tthis.switchWebpMethod.addEventListener(\n\t\t\t\t\t'click',\n\t\t\t\t\t( e ) => {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\te.target.classList.add('wp-smush-link-in-progress');\n\t\t\t\t\t\tthis.switchMethod( this.switchWebpMethod.dataset.method );\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\n\t\tswitchMethod( newMethod ) {\n\t\t\tFetcher.webp.switchMethod( newMethod ).then( ( res ) => {\n\t\t\t\tif ( ! res?.success ) {\n\t\t\t\t\tWP_Smush.helpers.showNotice( res );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\twindow.location.reload();\n\t\t\t} );\n\t\t},\n\n\t\t/**\n\t\t * Toggle WebP module.\n\t\t *\n\t\t * @param {Event} e\n\t\t */\n\t\ttoggleWebp(e) {\n\t\t\te.preventDefault();\n\n\t\t\tconst button = e.currentTarget,\n\t\t\t\tdoEnable = 'enable' === button.dataset.action;\n\n\t\t\tbutton.classList.add('sui-button-onload');\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', ajaxurl + '?action=smush_webp_toggle', true);\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\n\t\t\txhr.onload = () => {\n\t\t\t\tconst res = JSON.parse(xhr.response);\n\n\t\t\t\tif (200 === xhr.status) {\n\t\t\t\t\tif ('undefined' !== typeof res.success && res.success) {\n\t\t\t\t\t\tconst scanPromise = this.runScan();\n\t\t\t\t\t\tscanPromise.onload = () => {\n\t\t\t\t\t\t\twindow.location.href =\n\t\t\t\t\t\t\t\twindow.wp_smush_msgs.localWebpURL;\n\t\t\t\t\t\t};\n\t\t\t\t\t} else if ('undefined' !== typeof res.data.message) {\n\t\t\t\t\t\tthis.showNotice(res.data.message);\n\t\t\t\t\t\tbutton.classList.remove('sui-button-onload');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlet message = window.wp_smush_msgs.generic_ajax_error;\n\t\t\t\t\tif (res && 'undefined' !== typeof res.data.message) {\n\t\t\t\t\t\tmessage = res.data.message;\n\t\t\t\t\t}\n\t\t\t\t\tthis.showNotice(message);\n\t\t\t\t\tbutton.classList.remove('sui-button-onload');\n\t\t\t\t}\n\t\t\t};\n\n\t\t\txhr.send(\n\t\t\t\t'param=' + doEnable + '&_ajax_nonce=' + this.nonceField[0].value\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * re-check server configuration for WebP.\n\t\t */\n\t\trecheckStatus() {\n\t\t\tthis.recheckStatusButton.classList.add('sui-button-onload');\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', ajaxurl + '?action=smush_webp_get_status', true);\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tthis.recheckStatusButton.classList.remove('sui-button-onload');\n\t\t\t\tlet message = false;\n\t\t\t\tconst res = JSON.parse(xhr.response);\n\t\t\t\tif (200 === xhr.status) {\n\t\t\t\t\tconst isConfigured = res.success ? '1' : '0';\n\t\t\t\t\tif (\n\t\t\t\t\t\tisConfigured !==\n\t\t\t\t\t\tthis.recheckStatusButton.dataset.isConfigured\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Reload the page when the configuration status changed.\n\t\t\t\t\t\tlocation.reload();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmessage = window.wp_smush_msgs.generic_ajax_error;\n\t\t\t\t}\n\n\t\t\t\tif (res && res.data) {\n\t\t\t\t\tmessage = res.data;\n\t\t\t\t}\n\n\t\t\t\tif (message) {\n\t\t\t\t\tthis.showNotice(message);\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send('_ajax_nonce=' + window.wp_smush_msgs.webp_nonce);\n\t\t},\n\n\t\tdeleteAll(e) {\n\t\t\tconst button = e.currentTarget;\n\t\t\tbutton.classList.add('sui-button-onload');\n\n\t\t\tlet message = false;\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', ajaxurl + '?action=smush_webp_delete_all', true);\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\n\t\t\txhr.onload = () => {\n\t\t\t\tconst res = JSON.parse(xhr.response);\n\t\t\t\tif (200 === xhr.status) {\n\t\t\t\t\tif ('undefined' !== typeof res.success && res.success) {\n\t\t\t\t\t\tconst scanPromise = this.runScan();\n\t\t\t\t\t\tscanPromise.onload = () => {\n\t\t\t\t\t\t\tlocation.search =\n\t\t\t\t\t\t\t\tlocation.search + '¬ice=webp-deleted';\n\t\t\t\t\t\t};\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmessage = window.wp_smush_msgs.generic_ajax_error;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmessage = window.wp_smush_msgs.generic_ajax_error;\n\t\t\t\t}\n\n\t\t\t\tif (res && res.data && res.data.message) {\n\t\t\t\t\tmessage = res.data.message;\n\t\t\t\t}\n\n\t\t\t\tif (message) {\n\t\t\t\t\tbutton.classList.remove('sui-button-onload');\n\n\t\t\t\t\tconst noticeMessage = `<p style=\"text-align: left;\">${message}</p>`;\n\t\t\t\t\tconst noticeOptions = {\n\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\ticon: 'info',\n\t\t\t\t\t\tautoclose: {\n\t\t\t\t\t\t\tshow: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\n\t\t\t\t\twindow.SUI.openNotice(\n\t\t\t\t\t\t'wp-smush-webp-delete-all-error-notice',\n\t\t\t\t\t\tnoticeMessage,\n\t\t\t\t\t\tnoticeOptions\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\txhr.send('_ajax_nonce=' + this.nonceField[0].value);\n\t\t},\n\n\t\ttoggleWizard(e) {\n\t\t\te.currentTarget.classList.add('sui-button-onload');\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open(\n\t\t\t\t'GET',\n\t\t\t\tajaxurl +\n\t\t\t\t\t'?action=smush_toggle_webp_wizard&_ajax_nonce=' +\n\t\t\t\t\twindow.wp_smush_msgs.webp_nonce,\n\t\t\t\ttrue\n\t\t\t);\n\t\t\txhr.onload = () => location.href = window.wp_smush_msgs.localWebpURL;\n\t\t\txhr.send();\n\t\t},\n\n\t\t/**\n\t\t * Triggers the scanning of images for updating the images to re-smush.\n\t\t *\n\t\t * @since 3.8.0\n\t\t */\n\t\trunScan() {\n\t\t\tconst xhr = new XMLHttpRequest(),\n\t\t\t\tnonceField = document.getElementsByName(\n\t\t\t\t\t'wp_smush_options_nonce'\n\t\t\t\t);\n\n\t\t\txhr.open('POST', ajaxurl + '?action=scan_for_resmush', true);\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\n\t\t\txhr.send('_ajax_nonce=' + nonceField[0].value);\n\n\t\t\treturn xhr;\n\t\t},\n\n\t\t/**\n\t\t * Show message (notice).\n\t\t *\n\t\t * @param {string} message\n\t\t * @param {string} type\n\t\t */\n\t\tshowNotice(message, type) {\n\t\t\tif ('undefined' === typeof message) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst noticeMessage = `<p>${message}</p>`;\n\t\t\tconst noticeOptions = {\n\t\t\t\ttype: type || 'error',\n\t\t\t\ticon: 'info',\n\t\t\t\tdismiss: {\n\t\t\t\t\tshow: true,\n\t\t\t\t\tlabel: window.wp_smush_msgs.noticeDismiss,\n\t\t\t\t\ttooltip: window.wp_smush_msgs.noticeDismissTooltip,\n\t\t\t\t},\n\t\t\t\tautoclose: {\n\t\t\t\t\tshow: false,\n\t\t\t\t},\n\t\t\t};\n\n\t\t\twindow.SUI.openNotice(\n\t\t\t\t'wp-smush-ajax-notice',\n\t\t\t\tnoticeMessage,\n\t\t\t\tnoticeOptions\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Show delete all webp success notice.\n\t\t */\n\t\tmaybeShowDeleteAllSuccessNotice() {\n\t\t\tif (!document.getElementById('wp-smush-webp-delete-all-notice')) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst noticeMessage = `<p>${\n\t\t\t\tdocument.getElementById('wp-smush-webp-delete-all-notice')\n\t\t\t\t\t.dataset.message\n\t\t\t}</p>`;\n\n\t\t\tconst noticeOptions = {\n\t\t\t\ttype: 'success',\n\t\t\t\ticon: 'check-tick',\n\t\t\t\tdismiss: {\n\t\t\t\t\tshow: true,\n\t\t\t\t},\n\t\t\t};\n\n\t\t\twindow.SUI.openNotice(\n\t\t\t\t'wp-smush-webp-delete-all-notice',\n\t\t\t\tnoticeMessage,\n\t\t\t\tnoticeOptions\n\t\t\t);\n\t\t},\n\t};\n\n\tWP_Smush.WebP.init();\n})();\n","/* global ajaxurl */\n\n/**\n * External dependencies\n */\nimport assign from 'lodash/assign';\n\n/**\n * Wrapper function for ajax calls to WordPress.\n *\n * @since 3.12.0\n */\nfunction SmushFetcher() {\n\t/**\n\t * Request ajax with a promise.\n\t * Use FormData Object as data if you need to upload file\n\t *\n\t * @param {string} action\n\t * @param {Object|FormData} data\n\t * @param {string} method\n\t * @return {Promise<any>} Request results.\n\t */\n\tfunction request(action, data = {}, method = 'POST') {\n\t\tconst args = {\n\t\t\turl: ajaxurl,\n\t\t\tmethod,\n\t\t\tcache: false\n\t\t};\n\n\t\tif (data instanceof FormData) {\n\t\t\tdata.append('action', action);\n\t\t\tdata.append('_ajax_nonce', window.wp_smush_msgs.nonce);\n\t\t\targs.contentType = false;\n\t\t\targs.processData = false;\n\t\t} else {\n\t\t\tdata._ajax_nonce = data._ajax_nonce || window.smush_global.nonce || window.wp_smush_msgs.nonce;\n\t\t\tdata.action = action;\n\t\t}\n\t\targs.data = data;\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tjQuery.ajax(args).done(resolve).fail(reject);\n\t\t}).then((response) => {\n\t\t\tif (typeof response !== 'object') {\n\t\t\t\tresponse = JSON.parse(response);\n\t\t\t}\n\t\t\treturn response;\n\t\t}).catch((error) => {\n\t\t\tconsole.error('Error:', error);\n\t\t\treturn error;\n\t\t});\n\t}\n\n\tconst methods = {\n\t\t/**\n\t\t * Manage ajax for background.\n\t\t */\n\t\tbackground: {\n\t\t\t/**\n\t\t\t * Start background process.\n\t\t\t */\n\t\t\tstart: () => {\n\t\t\t\treturn request('bulk_smush_start');\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Cancel background process.\n\t\t\t */\n\t\t\tcancel: () => {\n\t\t\t\treturn request('bulk_smush_cancel');\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Initial State - Get stats on the first time.\n\t\t\t */\n\t\t\tinitState: () => {\n\t\t\t\treturn request('bulk_smush_get_status');\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Get stats.\n\t\t\t */\n\t\t\tgetStatus: () => {\n\t\t\t\treturn request('bulk_smush_get_status');\n\t\t\t},\n\n\t\t\tgetStats: () => {\n\t\t\t\treturn request('bulk_smush_get_global_stats');\n\t\t\t},\n\n\t\t\tbackgroundHealthyCheck: () => {\n\t\t\t\treturn request('smush_start_background_pre_flight_check');\n\t\t\t},\n\n\t\t\tbackgroundHealthyStatus: () => {\n\t\t\t\treturn request('smush_get_background_pre_flight_status');\n\t\t\t}\n\t\t},\n\t\tsmush: {\n\t\t\t/**\n\t\t\t * Sync stats.\n\t\t\t */\n\t\t\tsyncStats: ( data ) => {\n\t\t\t\tdata = data || {};\n\t\t\t\treturn request('get_stats', data);\n\t\t\t},\n\n\t\t\t/**\n * Ignore All.\n */\n\t\t\tignoreAll: ( type ) => {\n return request('wp_smush_ignore_all_failed_items', {\n type: type,\n });\n },\n\t\t},\n\n\t\t/**\n\t\t * Manage ajax for other requests\n\t\t */\n\t\tcommon: {\n\t\t\t/**\n\t\t\t * Dismiss Notice.\n\t\t\t *\n\t\t\t * @param {string} dismissId Notification id.\n\t\t\t */\n\t\t\tdismissNotice: (dismissId) => {\n\t\t\t\treturn request('smush_dismiss_notice', {\n\t\t\t\t\tkey: dismissId\n\t\t\t\t});\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Hide the new features modal.\n\t\t\t *\n\t\t\t * @param {string} modalID Notification id.\n\t\t\t */\n\t\t\thideModal: (modalID) => request('hide_modal', {\n\t\t\t\tmodal_id: modalID,\n\t\t\t}),\n\n\t\t\ttrack: ( event, properties ) => request('smush_analytics_track_event', {\n\t\t\t\tevent,\n\t\t\t\tproperties\n\t\t\t}),\n\n\t\t\t/**\n\t\t\t * Custom request.\n\t\t\t *\n\t\t\t * @param {Object} data\n\t\t\t */\n\t\t\trequest: (data) => data.action && request(data.action, data),\n\t\t},\n\n\t\tscanMediaLibrary: {\n\t\t\tstart: ( optimize_on_scan_completed = false ) => {\n\t\t\t\toptimize_on_scan_completed = optimize_on_scan_completed ? 1 : 0;\n\t\t\t\tconst _ajax_nonce = window.wp_smushit_data.media_library_scan.nonce;\n\t\t\t\treturn request( 'wp_smush_start_background_scan', {\n\t\t\t\t\toptimize_on_scan_completed,\n\t\t\t\t\t_ajax_nonce,\n\t\t\t\t} );\n\t\t\t},\n\n\t\t\tcancel: () => {\n\t\t\t\tconst _ajax_nonce = window.wp_smushit_data.media_library_scan.nonce;\n\t\t\t\treturn request( 'wp_smush_cancel_background_scan', {\n\t\t\t\t\t_ajax_nonce,\n\t\t\t\t} );\n\t\t\t},\n\n\t\t\tgetScanStatus: () => {\n\t\t\t\tconst _ajax_nonce = window.wp_smushit_data.media_library_scan.nonce;\n\t\t\t\treturn request( 'wp_smush_get_background_scan_status', {\n\t\t\t\t\t_ajax_nonce,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\n\t\twebp: {\n\t\t\tswitchMethod: ( method ) => {\n\t\t\t\treturn request( 'webp_switch_method', { method } );\n\t\t\t},\n\t\t}\n\t};\n\n\tassign(this, methods);\n}\n\nconst SmushAjax = new SmushFetcher();\nexport default SmushAjax;","import Fetcher from './fetcher';\n\nclass Tracker {\n\ttrack( event, properties = {} ) {\n\t\tif ( ! this.allowToTrack() ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn Fetcher.common.track( event, properties );\n\t}\n\n\tallowToTrack() {\n\t\treturn !! ( window.wp_smush_mixpanel?.opt_in );\n\t}\n}\n\nconst tracker = new Tracker();\n\nexport default tracker;\n","/*!\n * jquery.fancytree.js\n * Tree view control with support for lazy loading and much more.\n * https://github.com/mar10/fancytree/\n *\n * Copyright (c) 2008-2021, Martin Wendt (https://wwWendt.de)\n * Released under the MIT license\n * https://github.com/mar10/fancytree/wiki/LicenseInfo\n *\n * @version 2.38.1-0\n * @date 2021-09-09T01:07:22Z\n */\n\n/** Core Fancytree module.\n */\n\n// UMD wrapper for the Fancytree core module\n(function (factory) {\n\tif (typeof define === \"function\" && define.amd) {\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine([\"jquery\", \"./jquery.fancytree.ui-deps\"], factory);\n\t} else if (typeof module === \"object\" && module.exports) {\n\t\t// Node/CommonJS\n\t\trequire(\"./jquery.fancytree.ui-deps\");\n\t\tmodule.exports = factory(require(\"jquery\"));\n\t} else {\n\t\t// Browser globals\n\t\tfactory(jQuery);\n\t}\n})(function ($) {\n\t\"use strict\";\n\n\t// prevent duplicate loading\n\tif ($.ui && $.ui.fancytree) {\n\t\t$.ui.fancytree.warn(\"Fancytree: ignored duplicate include\");\n\t\treturn;\n\t}\n\n\t/******************************************************************************\n\t * Private functions and variables\n\t */\n\n\tvar i,\n\t\tattr,\n\t\tFT = null, // initialized below\n\t\tTEST_IMG = new RegExp(/\\.|\\//), // strings are considered image urls if they contain '.' or '/'\n\t\tREX_HTML = /[&<>\"'/]/g, // Escape those characters\n\t\tREX_TOOLTIP = /[<>\"'/]/g, // Don't escape `&` in tooltips\n\t\tRECURSIVE_REQUEST_ERROR = \"$recursive_request\",\n\t\tINVALID_REQUEST_TARGET_ERROR = \"$request_target_invalid\",\n\t\tENTITY_MAP = {\n\t\t\t\"&\": \"&\",\n\t\t\t\"<\": \"<\",\n\t\t\t\">\": \">\",\n\t\t\t'\"': \""\",\n\t\t\t\"'\": \"'\",\n\t\t\t\"/\": \"/\",\n\t\t},\n\t\tIGNORE_KEYCODES = { 16: true, 17: true, 18: true },\n\t\tSPECIAL_KEYCODES = {\n\t\t\t8: \"backspace\",\n\t\t\t9: \"tab\",\n\t\t\t10: \"return\",\n\t\t\t13: \"return\",\n\t\t\t// 16: null, 17: null, 18: null, // ignore shift, ctrl, alt\n\t\t\t19: \"pause\",\n\t\t\t20: \"capslock\",\n\t\t\t27: \"esc\",\n\t\t\t32: \"space\",\n\t\t\t33: \"pageup\",\n\t\t\t34: \"pagedown\",\n\t\t\t35: \"end\",\n\t\t\t36: \"home\",\n\t\t\t37: \"left\",\n\t\t\t38: \"up\",\n\t\t\t39: \"right\",\n\t\t\t40: \"down\",\n\t\t\t45: \"insert\",\n\t\t\t46: \"del\",\n\t\t\t59: \";\",\n\t\t\t61: \"=\",\n\t\t\t// 91: null, 93: null, // ignore left and right meta\n\t\t\t96: \"0\",\n\t\t\t97: \"1\",\n\t\t\t98: \"2\",\n\t\t\t99: \"3\",\n\t\t\t100: \"4\",\n\t\t\t101: \"5\",\n\t\t\t102: \"6\",\n\t\t\t103: \"7\",\n\t\t\t104: \"8\",\n\t\t\t105: \"9\",\n\t\t\t106: \"*\",\n\t\t\t107: \"+\",\n\t\t\t109: \"-\",\n\t\t\t110: \".\",\n\t\t\t111: \"/\",\n\t\t\t112: \"f1\",\n\t\t\t113: \"f2\",\n\t\t\t114: \"f3\",\n\t\t\t115: \"f4\",\n\t\t\t116: \"f5\",\n\t\t\t117: \"f6\",\n\t\t\t118: \"f7\",\n\t\t\t119: \"f8\",\n\t\t\t120: \"f9\",\n\t\t\t121: \"f10\",\n\t\t\t122: \"f11\",\n\t\t\t123: \"f12\",\n\t\t\t144: \"numlock\",\n\t\t\t145: \"scroll\",\n\t\t\t173: \"-\",\n\t\t\t186: \";\",\n\t\t\t187: \"=\",\n\t\t\t188: \",\",\n\t\t\t189: \"-\",\n\t\t\t190: \".\",\n\t\t\t191: \"/\",\n\t\t\t192: \"`\",\n\t\t\t219: \"[\",\n\t\t\t220: \"\\\\\",\n\t\t\t221: \"]\",\n\t\t\t222: \"'\",\n\t\t},\n\t\tMODIFIERS = {\n\t\t\t16: \"shift\",\n\t\t\t17: \"ctrl\",\n\t\t\t18: \"alt\",\n\t\t\t91: \"meta\",\n\t\t\t93: \"meta\",\n\t\t},\n\t\tMOUSE_BUTTONS = { 0: \"\", 1: \"left\", 2: \"middle\", 3: \"right\" },\n\t\t// Boolean attributes that can be set with equivalent class names in the LI tags\n\t\t// Note: v2.23: checkbox and hideCheckbox are *not* in this list\n\t\tCLASS_ATTRS =\n\t\t\t\"active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore\".split(\n\t\t\t\t\" \"\n\t\t\t),\n\t\tCLASS_ATTR_MAP = {},\n\t\t// Top-level Fancytree attributes, that can be set by dict\n\t\tTREE_ATTRS = \"columns types\".split(\" \"),\n\t\t// TREE_ATTR_MAP = {},\n\t\t// Top-level FancytreeNode attributes, that can be set by dict\n\t\tNODE_ATTRS =\n\t\t\t\"checkbox expanded extraClasses folder icon iconTooltip key lazy partsel radiogroup refKey selected statusNodeType title tooltip type unselectable unselectableIgnore unselectableStatus\".split(\n\t\t\t\t\" \"\n\t\t\t),\n\t\tNODE_ATTR_MAP = {},\n\t\t// Mapping of lowercase -> real name (because HTML5 data-... attribute only supports lowercase)\n\t\tNODE_ATTR_LOWERCASE_MAP = {},\n\t\t// Attribute names that should NOT be added to node.data\n\t\tNONE_NODE_DATA_MAP = {\n\t\t\tactive: true,\n\t\t\tchildren: true,\n\t\t\tdata: true,\n\t\t\tfocus: true,\n\t\t};\n\n\tfor (i = 0; i < CLASS_ATTRS.length; i++) {\n\t\tCLASS_ATTR_MAP[CLASS_ATTRS[i]] = true;\n\t}\n\tfor (i = 0; i < NODE_ATTRS.length; i++) {\n\t\tattr = NODE_ATTRS[i];\n\t\tNODE_ATTR_MAP[attr] = true;\n\t\tif (attr !== attr.toLowerCase()) {\n\t\t\tNODE_ATTR_LOWERCASE_MAP[attr.toLowerCase()] = attr;\n\t\t}\n\t}\n\t// for(i=0; i<TREE_ATTRS.length; i++) {\n\t// \tTREE_ATTR_MAP[TREE_ATTRS[i]] = true;\n\t// }\n\n\tfunction _assert(cond, msg) {\n\t\t// TODO: see qunit.js extractStacktrace()\n\t\tif (!cond) {\n\t\t\tmsg = msg ? \": \" + msg : \"\";\n\t\t\tmsg = \"Fancytree assertion failed\" + msg;\n\n\t\t\t// consoleApply(\"assert\", [!!cond, msg]);\n\n\t\t\t// #1041: Raised exceptions may not be visible in the browser\n\t\t\t// console if inside promise chains, so we also print directly:\n\t\t\t$.ui.fancytree.error(msg);\n\n\t\t\t// Throw exception:\n\t\t\t$.error(msg);\n\t\t}\n\t}\n\n\tfunction _hasProp(object, property) {\n\t\treturn Object.prototype.hasOwnProperty.call(object, property);\n\t}\n\n\t/* Replacement for the deprecated `jQuery.isFunction()`. */\n\tfunction _isFunction(obj) {\n\t\treturn typeof obj === \"function\";\n\t}\n\n\t/* Replacement for the deprecated `jQuery.trim()`. */\n\tfunction _trim(text) {\n\t\treturn text == null ? \"\" : text.trim();\n\t}\n\n\t/* Replacement for the deprecated `jQuery.isArray()`. */\n\tvar _isArray = Array.isArray;\n\n\t_assert($.ui, \"Fancytree requires jQuery UI (http://jqueryui.com)\");\n\n\tfunction consoleApply(method, args) {\n\t\tvar i,\n\t\t\ts,\n\t\t\tfn = window.console ? window.console[method] : null;\n\n\t\tif (fn) {\n\t\t\ttry {\n\t\t\t\tfn.apply(window.console, args);\n\t\t\t} catch (e) {\n\t\t\t\t// IE 8?\n\t\t\t\ts = \"\";\n\t\t\t\tfor (i = 0; i < args.length; i++) {\n\t\t\t\t\ts += args[i];\n\t\t\t\t}\n\t\t\t\tfn(s);\n\t\t\t}\n\t\t}\n\t}\n\n\t/* support: IE8 Polyfil for Date.now() */\n\tif (!Date.now) {\n\t\tDate.now = function now() {\n\t\t\treturn new Date().getTime();\n\t\t};\n\t}\n\n\t/*Return true if x is a FancytreeNode.*/\n\tfunction _isNode(x) {\n\t\treturn !!(x.tree && x.statusNodeType !== undefined);\n\t}\n\n\t/** Return true if dotted version string is equal or higher than requested version.\n\t *\n\t * See http://jsfiddle.net/mar10/FjSAN/\n\t */\n\tfunction isVersionAtLeast(dottedVersion, major, minor, patch) {\n\t\tvar i,\n\t\t\tv,\n\t\t\tt,\n\t\t\tverParts = $.map(_trim(dottedVersion).split(\".\"), function (e) {\n\t\t\t\treturn parseInt(e, 10);\n\t\t\t}),\n\t\t\ttestParts = $.map(\n\t\t\t\tArray.prototype.slice.call(arguments, 1),\n\t\t\t\tfunction (e) {\n\t\t\t\t\treturn parseInt(e, 10);\n\t\t\t\t}\n\t\t\t);\n\n\t\tfor (i = 0; i < testParts.length; i++) {\n\t\t\tv = verParts[i] || 0;\n\t\t\tt = testParts[i] || 0;\n\t\t\tif (v !== t) {\n\t\t\t\treturn v > t;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Deep-merge a list of objects (but replace array-type options).\n\t *\n\t * jQuery's $.extend(true, ...) method does a deep merge, that also merges Arrays.\n\t * This variant is used to merge extension defaults with user options, and should\n\t * merge objects, but override arrays (for example the `triggerStart: [...]` option\n\t * of ext-edit). Also `null` values are copied over and not skipped.\n\t *\n\t * See issue #876\n\t *\n\t * Example:\n\t * _simpleDeepMerge({}, o1, o2);\n\t */\n\tfunction _simpleDeepMerge() {\n\t\tvar options,\n\t\t\tname,\n\t\t\tsrc,\n\t\t\tcopy,\n\t\t\tclone,\n\t\t\ttarget = arguments[0] || {},\n\t\t\ti = 1,\n\t\t\tlength = arguments.length;\n\n\t\t// Handle case when target is a string or something (possible in deep copy)\n\t\tif (typeof target !== \"object\" && !_isFunction(target)) {\n\t\t\ttarget = {};\n\t\t}\n\t\tif (i === length) {\n\t\t\tthrow Error(\"need at least two args\");\n\t\t}\n\t\tfor (; i < length; i++) {\n\t\t\t// Only deal with non-null/undefined values\n\t\t\tif ((options = arguments[i]) != null) {\n\t\t\t\t// Extend the base object\n\t\t\t\tfor (name in options) {\n\t\t\t\t\tif (_hasProp(options, name)) {\n\t\t\t\t\t\tsrc = target[name];\n\t\t\t\t\t\tcopy = options[name];\n\t\t\t\t\t\t// Prevent never-ending loop\n\t\t\t\t\t\tif (target === copy) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Recurse if we're merging plain objects\n\t\t\t\t\t\t// (NOTE: unlike $.extend, we don't merge arrays, but replace them)\n\t\t\t\t\t\tif (copy && $.isPlainObject(copy)) {\n\t\t\t\t\t\t\tclone = src && $.isPlainObject(src) ? src : {};\n\t\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\t\ttarget[name] = _simpleDeepMerge(clone, copy);\n\t\t\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t\t} else if (copy !== undefined) {\n\t\t\t\t\t\t\ttarget[name] = copy;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Return the modified object\n\t\treturn target;\n\t}\n\n\t/** Return a wrapper that calls sub.methodName() and exposes\n\t * this : tree\n\t * this._local : tree.ext.EXTNAME\n\t * this._super : base.methodName.call()\n\t * this._superApply : base.methodName.apply()\n\t */\n\tfunction _makeVirtualFunction(methodName, tree, base, extension, extName) {\n\t\t// $.ui.fancytree.debug(\"_makeVirtualFunction\", methodName, tree, base, extension, extName);\n\t\t// if(rexTestSuper && !rexTestSuper.test(func)){\n\t\t// // extension.methodName() doesn't call _super(), so no wrapper required\n\t\t// return func;\n\t\t// }\n\t\t// Use an immediate function as closure\n\t\tvar proxy = (function () {\n\t\t\tvar prevFunc = tree[methodName], // org. tree method or prev. proxy\n\t\t\t\tbaseFunc = extension[methodName], //\n\t\t\t\t_local = tree.ext[extName],\n\t\t\t\t_super = function () {\n\t\t\t\t\treturn prevFunc.apply(tree, arguments);\n\t\t\t\t},\n\t\t\t\t_superApply = function (args) {\n\t\t\t\t\treturn prevFunc.apply(tree, args);\n\t\t\t\t};\n\n\t\t\t// Return the wrapper function\n\t\t\treturn function () {\n\t\t\t\tvar prevLocal = tree._local,\n\t\t\t\t\tprevSuper = tree._super,\n\t\t\t\t\tprevSuperApply = tree._superApply;\n\n\t\t\t\ttry {\n\t\t\t\t\ttree._local = _local;\n\t\t\t\t\ttree._super = _super;\n\t\t\t\t\ttree._superApply = _superApply;\n\t\t\t\t\treturn baseFunc.apply(tree, arguments);\n\t\t\t\t} finally {\n\t\t\t\t\ttree._local = prevLocal;\n\t\t\t\t\ttree._super = prevSuper;\n\t\t\t\t\ttree._superApply = prevSuperApply;\n\t\t\t\t}\n\t\t\t};\n\t\t})(); // end of Immediate Function\n\t\treturn proxy;\n\t}\n\n\t/**\n\t * Subclass `base` by creating proxy functions\n\t */\n\tfunction _subclassObject(tree, base, extension, extName) {\n\t\t// $.ui.fancytree.debug(\"_subclassObject\", tree, base, extension, extName);\n\t\tfor (var attrName in extension) {\n\t\t\tif (typeof extension[attrName] === \"function\") {\n\t\t\t\tif (typeof tree[attrName] === \"function\") {\n\t\t\t\t\t// override existing method\n\t\t\t\t\ttree[attrName] = _makeVirtualFunction(\n\t\t\t\t\t\tattrName,\n\t\t\t\t\t\ttree,\n\t\t\t\t\t\tbase,\n\t\t\t\t\t\textension,\n\t\t\t\t\t\textName\n\t\t\t\t\t);\n\t\t\t\t} else if (attrName.charAt(0) === \"_\") {\n\t\t\t\t\t// Create private methods in tree.ext.EXTENSION namespace\n\t\t\t\t\ttree.ext[extName][attrName] = _makeVirtualFunction(\n\t\t\t\t\t\tattrName,\n\t\t\t\t\t\ttree,\n\t\t\t\t\t\tbase,\n\t\t\t\t\t\textension,\n\t\t\t\t\t\textName\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$.error(\n\t\t\t\t\t\t\"Could not override tree.\" +\n\t\t\t\t\t\t\tattrName +\n\t\t\t\t\t\t\t\". Use prefix '_' to create tree.\" +\n\t\t\t\t\t\t\textName +\n\t\t\t\t\t\t\t\"._\" +\n\t\t\t\t\t\t\tattrName\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Create member variables in tree.ext.EXTENSION namespace\n\t\t\t\tif (attrName !== \"options\") {\n\t\t\t\t\ttree.ext[extName][attrName] = extension[attrName];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction _getResolvedPromise(context, argArray) {\n\t\tif (context === undefined) {\n\t\t\treturn $.Deferred(function () {\n\t\t\t\tthis.resolve();\n\t\t\t}).promise();\n\t\t}\n\t\treturn $.Deferred(function () {\n\t\t\tthis.resolveWith(context, argArray);\n\t\t}).promise();\n\t}\n\n\tfunction _getRejectedPromise(context, argArray) {\n\t\tif (context === undefined) {\n\t\t\treturn $.Deferred(function () {\n\t\t\t\tthis.reject();\n\t\t\t}).promise();\n\t\t}\n\t\treturn $.Deferred(function () {\n\t\t\tthis.rejectWith(context, argArray);\n\t\t}).promise();\n\t}\n\n\tfunction _makeResolveFunc(deferred, context) {\n\t\treturn function () {\n\t\t\tdeferred.resolveWith(context);\n\t\t};\n\t}\n\n\tfunction _getElementDataAsDict($el) {\n\t\t// Evaluate 'data-NAME' attributes with special treatment for 'data-json'.\n\t\tvar d = $.extend({}, $el.data()),\n\t\t\tjson = d.json;\n\n\t\tdelete d.fancytree; // added to container by widget factory (old jQuery UI)\n\t\tdelete d.uiFancytree; // added to container by widget factory\n\n\t\tif (json) {\n\t\t\tdelete d.json;\n\t\t\t// <li data-json='...'> is already returned as object (http://api.jquery.com/data/#data-html5)\n\t\t\td = $.extend(d, json);\n\t\t}\n\t\treturn d;\n\t}\n\n\tfunction _escapeTooltip(s) {\n\t\treturn (\"\" + s).replace(REX_TOOLTIP, function (s) {\n\t\t\treturn ENTITY_MAP[s];\n\t\t});\n\t}\n\n\t// TODO: use currying\n\tfunction _makeNodeTitleMatcher(s) {\n\t\ts = s.toLowerCase();\n\t\treturn function (node) {\n\t\t\treturn node.title.toLowerCase().indexOf(s) >= 0;\n\t\t};\n\t}\n\n\tfunction _makeNodeTitleStartMatcher(s) {\n\t\tvar reMatch = new RegExp(\"^\" + s, \"i\");\n\t\treturn function (node) {\n\t\t\treturn reMatch.test(node.title);\n\t\t};\n\t}\n\n\t/******************************************************************************\n\t * FancytreeNode\n\t */\n\n\t/**\n\t * Creates a new FancytreeNode\n\t *\n\t * @class FancytreeNode\n\t * @classdesc A FancytreeNode represents the hierarchical data model and operations.\n\t *\n\t * @param {FancytreeNode} parent\n\t * @param {NodeData} obj\n\t *\n\t * @property {Fancytree} tree The tree instance\n\t * @property {FancytreeNode} parent The parent node\n\t * @property {string} key Node id (must be unique inside the tree)\n\t * @property {string} title Display name (may contain HTML)\n\t * @property {object} data Contains all extra data that was passed on node creation\n\t * @property {FancytreeNode[] | null | undefined} children Array of child nodes.<br>\n\t * For lazy nodes, null or undefined means 'not yet loaded'. Use an empty array\n\t * to define a node that has no children.\n\t * @property {boolean} expanded Use isExpanded(), setExpanded() to access this property.\n\t * @property {string} extraClasses Additional CSS classes, added to the node's `<span>`.<br>\n\t * Note: use `node.add/remove/toggleClass()` to modify.\n\t * @property {boolean} folder Folder nodes have different default icons and click behavior.<br>\n\t * Note: Also non-folders may have children.\n\t * @property {string} statusNodeType null for standard nodes. Otherwise type of special system node: 'error', 'loading', 'nodata', or 'paging'.\n\t * @property {boolean} lazy True if this node is loaded on demand, i.e. on first expansion.\n\t * @property {boolean} selected Use isSelected(), setSelected() to access this property.\n\t * @property {string} tooltip Alternative description used as hover popup\n\t * @property {string} iconTooltip Description used as hover popup for icon. @since 2.27\n\t * @property {string} type Node type, used with tree.types map. @since 2.27\n\t */\n\tfunction FancytreeNode(parent, obj) {\n\t\tvar i, l, name, cl;\n\n\t\tthis.parent = parent;\n\t\tthis.tree = parent.tree;\n\t\tthis.ul = null;\n\t\tthis.li = null; // <li id='key' ftnode=this> tag\n\t\tthis.statusNodeType = null; // if this is a temp. node to display the status of its parent\n\t\tthis._isLoading = false; // if this node itself is loading\n\t\tthis._error = null; // {message: '...'} if a load error occurred\n\t\tthis.data = {};\n\n\t\t// TODO: merge this code with node.toDict()\n\t\t// copy attributes from obj object\n\t\tfor (i = 0, l = NODE_ATTRS.length; i < l; i++) {\n\t\t\tname = NODE_ATTRS[i];\n\t\t\tthis[name] = obj[name];\n\t\t}\n\t\t// unselectableIgnore and unselectableStatus imply unselectable\n\t\tif (\n\t\t\tthis.unselectableIgnore != null ||\n\t\t\tthis.unselectableStatus != null\n\t\t) {\n\t\t\tthis.unselectable = true;\n\t\t}\n\t\tif (obj.hideCheckbox) {\n\t\t\t$.error(\n\t\t\t\t\"'hideCheckbox' node option was removed in v2.23.0: use 'checkbox: false'\"\n\t\t\t);\n\t\t}\n\t\t// node.data += obj.data\n\t\tif (obj.data) {\n\t\t\t$.extend(this.data, obj.data);\n\t\t}\n\t\t// Copy all other attributes to this.data.NAME\n\t\tfor (name in obj) {\n\t\t\tif (\n\t\t\t\t!NODE_ATTR_MAP[name] &&\n\t\t\t\t(this.tree.options.copyFunctionsToData ||\n\t\t\t\t\t!_isFunction(obj[name])) &&\n\t\t\t\t!NONE_NODE_DATA_MAP[name]\n\t\t\t) {\n\t\t\t\t// node.data.NAME = obj.NAME\n\t\t\t\tthis.data[name] = obj[name];\n\t\t\t}\n\t\t}\n\n\t\t// Fix missing key\n\t\tif (this.key == null) {\n\t\t\t// test for null OR undefined\n\t\t\tif (this.tree.options.defaultKey) {\n\t\t\t\tthis.key = \"\" + this.tree.options.defaultKey(this);\n\t\t\t\t_assert(this.key, \"defaultKey() must return a unique key\");\n\t\t\t} else {\n\t\t\t\tthis.key = \"_\" + FT._nextNodeKey++;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.key = \"\" + this.key; // Convert to string (#217)\n\t\t}\n\n\t\t// Fix tree.activeNode\n\t\t// TODO: not elegant: we use obj.active as marker to set tree.activeNode\n\t\t// when loading from a dictionary.\n\t\tif (obj.active) {\n\t\t\t_assert(\n\t\t\t\tthis.tree.activeNode === null,\n\t\t\t\t\"only one active node allowed\"\n\t\t\t);\n\t\t\tthis.tree.activeNode = this;\n\t\t}\n\t\tif (obj.selected) {\n\t\t\t// #186\n\t\t\tthis.tree.lastSelectedNode = this;\n\t\t}\n\t\t// TODO: handle obj.focus = true\n\n\t\t// Create child nodes\n\t\tcl = obj.children;\n\t\tif (cl) {\n\t\t\tif (cl.length) {\n\t\t\t\tthis._setChildren(cl);\n\t\t\t} else {\n\t\t\t\t// if an empty array was passed for a lazy node, keep it, in order to mark it 'loaded'\n\t\t\t\tthis.children = this.lazy ? [] : null;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.children = null;\n\t\t}\n\t\t// Add to key/ref map (except for root node)\n\t\t//\tif( parent ) {\n\t\tthis.tree._callHook(\"treeRegisterNode\", this.tree, true, this);\n\t\t//\t}\n\t}\n\n\tFancytreeNode.prototype = /** @lends FancytreeNode# */ {\n\t\t/* Return the direct child FancytreeNode with a given key, index. */\n\t\t_findDirectChild: function (ptr) {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tcl = this.children;\n\n\t\t\tif (cl) {\n\t\t\t\tif (typeof ptr === \"string\") {\n\t\t\t\t\tfor (i = 0, l = cl.length; i < l; i++) {\n\t\t\t\t\t\tif (cl[i].key === ptr) {\n\t\t\t\t\t\t\treturn cl[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (typeof ptr === \"number\") {\n\t\t\t\t\treturn this.children[ptr];\n\t\t\t\t} else if (ptr.parent === this) {\n\t\t\t\t\treturn ptr;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\t// TODO: activate()\n\t\t// TODO: activateSilently()\n\t\t/* Internal helper called in recursive addChildren sequence.*/\n\t\t_setChildren: function (children) {\n\t\t\t_assert(\n\t\t\t\tchildren && (!this.children || this.children.length === 0),\n\t\t\t\t\"only init supported\"\n\t\t\t);\n\t\t\tthis.children = [];\n\t\t\tfor (var i = 0, l = children.length; i < l; i++) {\n\t\t\t\tthis.children.push(new FancytreeNode(this, children[i]));\n\t\t\t}\n\t\t\tthis.tree._callHook(\n\t\t\t\t\"treeStructureChanged\",\n\t\t\t\tthis.tree,\n\t\t\t\t\"setChildren\"\n\t\t\t);\n\t\t},\n\t\t/**\n\t\t * Append (or insert) a list of child nodes.\n\t\t *\n\t\t * @param {NodeData[]} children array of child node definitions (also single child accepted)\n\t\t * @param {FancytreeNode | string | Integer} [insertBefore] child node (or key or index of such).\n\t\t * If omitted, the new children are appended.\n\t\t * @returns {FancytreeNode} first child added\n\t\t *\n\t\t * @see FancytreeNode#applyPatch\n\t\t */\n\t\taddChildren: function (children, insertBefore) {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tpos,\n\t\t\t\torigFirstChild = this.getFirstChild(),\n\t\t\t\torigLastChild = this.getLastChild(),\n\t\t\t\tfirstNode = null,\n\t\t\t\tnodeList = [];\n\n\t\t\tif ($.isPlainObject(children)) {\n\t\t\t\tchildren = [children];\n\t\t\t}\n\t\t\tif (!this.children) {\n\t\t\t\tthis.children = [];\n\t\t\t}\n\t\t\tfor (i = 0, l = children.length; i < l; i++) {\n\t\t\t\tnodeList.push(new FancytreeNode(this, children[i]));\n\t\t\t}\n\t\t\tfirstNode = nodeList[0];\n\t\t\tif (insertBefore == null) {\n\t\t\t\tthis.children = this.children.concat(nodeList);\n\t\t\t} else {\n\t\t\t\t// Returns null if insertBefore is not a direct child:\n\t\t\t\tinsertBefore = this._findDirectChild(insertBefore);\n\t\t\t\tpos = $.inArray(insertBefore, this.children);\n\t\t\t\t_assert(pos >= 0, \"insertBefore must be an existing child\");\n\t\t\t\t// insert nodeList after children[pos]\n\t\t\t\tthis.children.splice.apply(\n\t\t\t\t\tthis.children,\n\t\t\t\t\t[pos, 0].concat(nodeList)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (origFirstChild && !insertBefore) {\n\t\t\t\t// #708: Fast path -- don't render every child of root, just the new ones!\n\t\t\t\t// #723, #729: but only if it's appended to an existing child list\n\t\t\t\tfor (i = 0, l = nodeList.length; i < l; i++) {\n\t\t\t\t\tnodeList[i].render(); // New nodes were never rendered before\n\t\t\t\t}\n\t\t\t\t// Adjust classes where status may have changed\n\t\t\t\t// Has a first child\n\t\t\t\tif (origFirstChild !== this.getFirstChild()) {\n\t\t\t\t\t// Different first child -- recompute classes\n\t\t\t\t\torigFirstChild.renderStatus();\n\t\t\t\t}\n\t\t\t\tif (origLastChild !== this.getLastChild()) {\n\t\t\t\t\t// Different last child -- recompute classes\n\t\t\t\t\torigLastChild.renderStatus();\n\t\t\t\t}\n\t\t\t} else if (!this.parent || this.parent.ul || this.tr) {\n\t\t\t\t// render if the parent was rendered (or this is a root node)\n\t\t\t\tthis.render();\n\t\t\t}\n\t\t\tif (this.tree.options.selectMode === 3) {\n\t\t\t\tthis.fixSelection3FromEndNodes();\n\t\t\t}\n\t\t\tthis.triggerModifyChild(\n\t\t\t\t\"add\",\n\t\t\t\tnodeList.length === 1 ? nodeList[0] : null\n\t\t\t);\n\t\t\treturn firstNode;\n\t\t},\n\t\t/**\n\t\t * Add class to node's span tag and to .extraClasses.\n\t\t *\n\t\t * @param {string} className class name\n\t\t *\n\t\t * @since 2.17\n\t\t */\n\t\taddClass: function (className) {\n\t\t\treturn this.toggleClass(className, true);\n\t\t},\n\t\t/**\n\t\t * Append or prepend a node, or append a child node.\n\t\t *\n\t\t * This a convenience function that calls addChildren()\n\t\t *\n\t\t * @param {NodeData} node node definition\n\t\t * @param {string} [mode=child] 'before', 'after', 'firstChild', or 'child' ('over' is a synonym for 'child')\n\t\t * @returns {FancytreeNode} new node\n\t\t */\n\t\taddNode: function (node, mode) {\n\t\t\tif (mode === undefined || mode === \"over\") {\n\t\t\t\tmode = \"child\";\n\t\t\t}\n\t\t\tswitch (mode) {\n\t\t\t\tcase \"after\":\n\t\t\t\t\treturn this.getParent().addChildren(\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tthis.getNextSibling()\n\t\t\t\t\t);\n\t\t\t\tcase \"before\":\n\t\t\t\t\treturn this.getParent().addChildren(node, this);\n\t\t\t\tcase \"firstChild\":\n\t\t\t\t\t// Insert before the first child if any\n\t\t\t\t\tvar insertBefore = this.children ? this.children[0] : null;\n\t\t\t\t\treturn this.addChildren(node, insertBefore);\n\t\t\t\tcase \"child\":\n\t\t\t\tcase \"over\":\n\t\t\t\t\treturn this.addChildren(node);\n\t\t\t}\n\t\t\t_assert(false, \"Invalid mode: \" + mode);\n\t\t},\n\t\t/**Add child status nodes that indicate 'More...', etc.\n\t\t *\n\t\t * This also maintains the node's `partload` property.\n\t\t * @param {boolean|object} node optional node definition. Pass `false` to remove all paging nodes.\n\t\t * @param {string} [mode='child'] 'child'|firstChild'\n\t\t * @since 2.15\n\t\t */\n\t\taddPagingNode: function (node, mode) {\n\t\t\tvar i, n;\n\n\t\t\tmode = mode || \"child\";\n\t\t\tif (node === false) {\n\t\t\t\tfor (i = this.children.length - 1; i >= 0; i--) {\n\t\t\t\t\tn = this.children[i];\n\t\t\t\t\tif (n.statusNodeType === \"paging\") {\n\t\t\t\t\t\tthis.removeChild(n);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.partload = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tnode = $.extend(\n\t\t\t\t{\n\t\t\t\t\ttitle: this.tree.options.strings.moreData,\n\t\t\t\t\tstatusNodeType: \"paging\",\n\t\t\t\t\ticon: false,\n\t\t\t\t},\n\t\t\t\tnode\n\t\t\t);\n\t\t\tthis.partload = true;\n\t\t\treturn this.addNode(node, mode);\n\t\t},\n\t\t/**\n\t\t * Append new node after this.\n\t\t *\n\t\t * This a convenience function that calls addNode(node, 'after')\n\t\t *\n\t\t * @param {NodeData} node node definition\n\t\t * @returns {FancytreeNode} new node\n\t\t */\n\t\tappendSibling: function (node) {\n\t\t\treturn this.addNode(node, \"after\");\n\t\t},\n\t\t/**\n\t\t * (experimental) Apply a modification (or navigation) operation.\n\t\t *\n\t\t * @param {string} cmd\n\t\t * @param {object} [opts]\n\t\t * @see Fancytree#applyCommand\n\t\t * @since 2.32\n\t\t */\n\t\tapplyCommand: function (cmd, opts) {\n\t\t\treturn this.tree.applyCommand(cmd, this, opts);\n\t\t},\n\t\t/**\n\t\t * Modify existing child nodes.\n\t\t *\n\t\t * @param {NodePatch} patch\n\t\t * @returns {$.Promise}\n\t\t * @see FancytreeNode#addChildren\n\t\t */\n\t\tapplyPatch: function (patch) {\n\t\t\t// patch [key, null] means 'remove'\n\t\t\tif (patch === null) {\n\t\t\t\tthis.remove();\n\t\t\t\treturn _getResolvedPromise(this);\n\t\t\t}\n\t\t\t// TODO: make sure that root node is not collapsed or modified\n\t\t\t// copy (most) attributes to node.ATTR or node.data.ATTR\n\t\t\tvar name,\n\t\t\t\tpromise,\n\t\t\t\tv,\n\t\t\t\tIGNORE_MAP = { children: true, expanded: true, parent: true }; // TODO: should be global\n\n\t\t\tfor (name in patch) {\n\t\t\t\tif (_hasProp(patch, name)) {\n\t\t\t\t\tv = patch[name];\n\t\t\t\t\tif (!IGNORE_MAP[name] && !_isFunction(v)) {\n\t\t\t\t\t\tif (NODE_ATTR_MAP[name]) {\n\t\t\t\t\t\t\tthis[name] = v;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.data[name] = v;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Remove and/or create children\n\t\t\tif (_hasProp(patch, \"children\")) {\n\t\t\t\tthis.removeChildren();\n\t\t\t\tif (patch.children) {\n\t\t\t\t\t// only if not null and not empty list\n\t\t\t\t\t// TODO: addChildren instead?\n\t\t\t\t\tthis._setChildren(patch.children);\n\t\t\t\t}\n\t\t\t\t// TODO: how can we APPEND or INSERT child nodes?\n\t\t\t}\n\t\t\tif (this.isVisible()) {\n\t\t\t\tthis.renderTitle();\n\t\t\t\tthis.renderStatus();\n\t\t\t}\n\t\t\t// Expand collapse (final step, since this may be async)\n\t\t\tif (_hasProp(patch, \"expanded\")) {\n\t\t\t\tpromise = this.setExpanded(patch.expanded);\n\t\t\t} else {\n\t\t\t\tpromise = _getResolvedPromise(this);\n\t\t\t}\n\t\t\treturn promise;\n\t\t},\n\t\t/** Collapse all sibling nodes.\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tcollapseSiblings: function () {\n\t\t\treturn this.tree._callHook(\"nodeCollapseSiblings\", this);\n\t\t},\n\t\t/** Copy this node as sibling or child of `node`.\n\t\t *\n\t\t * @param {FancytreeNode} node source node\n\t\t * @param {string} [mode=child] 'before' | 'after' | 'child'\n\t\t * @param {Function} [map] callback function(NodeData, FancytreeNode) that could modify the new node\n\t\t * @returns {FancytreeNode} new\n\t\t */\n\t\tcopyTo: function (node, mode, map) {\n\t\t\treturn node.addNode(this.toDict(true, map), mode);\n\t\t},\n\t\t/** Count direct and indirect children.\n\t\t *\n\t\t * @param {boolean} [deep=true] pass 'false' to only count direct children\n\t\t * @returns {int} number of child nodes\n\t\t */\n\t\tcountChildren: function (deep) {\n\t\t\tvar cl = this.children,\n\t\t\t\ti,\n\t\t\t\tl,\n\t\t\t\tn;\n\t\t\tif (!cl) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tn = cl.length;\n\t\t\tif (deep !== false) {\n\t\t\t\tfor (i = 0, l = n; i < l; i++) {\n\t\t\t\t\tn += cl[i].countChildren();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn n;\n\t\t},\n\t\t// TODO: deactivate()\n\t\t/** Write to browser console if debugLevel >= 4 (prepending node info)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\tdebug: function (msg) {\n\t\t\tif (this.tree.options.debugLevel >= 4) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"log\", arguments);\n\t\t\t}\n\t\t},\n\t\t/** Deprecated.\n\t\t * @deprecated since 2014-02-16. Use resetLazy() instead.\n\t\t */\n\t\tdiscard: function () {\n\t\t\tthis.warn(\n\t\t\t\t\"FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead.\"\n\t\t\t);\n\t\t\treturn this.resetLazy();\n\t\t},\n\t\t/** Remove DOM elements for all descendents. May be called on .collapse event\n\t\t * to keep the DOM small.\n\t\t * @param {boolean} [includeSelf=false]\n\t\t */\n\t\tdiscardMarkup: function (includeSelf) {\n\t\t\tvar fn = includeSelf ? \"nodeRemoveMarkup\" : \"nodeRemoveChildMarkup\";\n\t\t\tthis.tree._callHook(fn, this);\n\t\t},\n\t\t/** Write error to browser console if debugLevel >= 1 (prepending tree info)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\terror: function (msg) {\n\t\t\tif (this.tree.options.debugLevel >= 1) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"error\", arguments);\n\t\t\t}\n\t\t},\n\t\t/**Find all nodes that match condition (excluding self).\n\t\t *\n\t\t * @param {string | function(node)} match title string to search for, or a\n\t\t * callback function that returns `true` if a node is matched.\n\t\t * @returns {FancytreeNode[]} array of nodes (may be empty)\n\t\t */\n\t\tfindAll: function (match) {\n\t\t\tmatch = _isFunction(match) ? match : _makeNodeTitleMatcher(match);\n\t\t\tvar res = [];\n\t\t\tthis.visit(function (n) {\n\t\t\t\tif (match(n)) {\n\t\t\t\t\tres.push(n);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn res;\n\t\t},\n\t\t/**Find first node that matches condition (excluding self).\n\t\t *\n\t\t * @param {string | function(node)} match title string to search for, or a\n\t\t * callback function that returns `true` if a node is matched.\n\t\t * @returns {FancytreeNode} matching node or null\n\t\t * @see FancytreeNode#findAll\n\t\t */\n\t\tfindFirst: function (match) {\n\t\t\tmatch = _isFunction(match) ? match : _makeNodeTitleMatcher(match);\n\t\t\tvar res = null;\n\t\t\tthis.visit(function (n) {\n\t\t\t\tif (match(n)) {\n\t\t\t\t\tres = n;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn res;\n\t\t},\n\t\t/** Find a node relative to self.\n\t\t *\n\t\t * @param {number|string} where The keyCode that would normally trigger this move,\n\t\t *\t\tor a keyword ('down', 'first', 'last', 'left', 'parent', 'right', 'up').\n\t\t * @returns {FancytreeNode}\n\t\t * @since v2.31\n\t\t */\n\t\tfindRelatedNode: function (where, includeHidden) {\n\t\t\treturn this.tree.findRelatedNode(this, where, includeHidden);\n\t\t},\n\t\t/* Apply selection state (internal use only) */\n\t\t_changeSelectStatusAttrs: function (state) {\n\t\t\tvar changed = false,\n\t\t\t\topts = this.tree.options,\n\t\t\t\tunselectable = FT.evalOption(\n\t\t\t\t\t\"unselectable\",\n\t\t\t\t\tthis,\n\t\t\t\t\tthis,\n\t\t\t\t\topts,\n\t\t\t\t\tfalse\n\t\t\t\t),\n\t\t\t\tunselectableStatus = FT.evalOption(\n\t\t\t\t\t\"unselectableStatus\",\n\t\t\t\t\tthis,\n\t\t\t\t\tthis,\n\t\t\t\t\topts,\n\t\t\t\t\tundefined\n\t\t\t\t);\n\n\t\t\tif (unselectable && unselectableStatus != null) {\n\t\t\t\tstate = unselectableStatus;\n\t\t\t}\n\t\t\tswitch (state) {\n\t\t\t\tcase false:\n\t\t\t\t\tchanged = this.selected || this.partsel;\n\t\t\t\t\tthis.selected = false;\n\t\t\t\t\tthis.partsel = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase true:\n\t\t\t\t\tchanged = !this.selected || !this.partsel;\n\t\t\t\t\tthis.selected = true;\n\t\t\t\t\tthis.partsel = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase undefined:\n\t\t\t\t\tchanged = this.selected || !this.partsel;\n\t\t\t\t\tthis.selected = false;\n\t\t\t\t\tthis.partsel = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t_assert(false, \"invalid state: \" + state);\n\t\t\t}\n\t\t\t// this.debug(\"fixSelection3AfterLoad() _changeSelectStatusAttrs()\", state, changed);\n\t\t\tif (changed) {\n\t\t\t\tthis.renderStatus();\n\t\t\t}\n\t\t\treturn changed;\n\t\t},\n\t\t/**\n\t\t * Fix selection status, after this node was (de)selected in multi-hier mode.\n\t\t * This includes (de)selecting all children.\n\t\t */\n\t\tfixSelection3AfterClick: function (callOpts) {\n\t\t\tvar flag = this.isSelected();\n\n\t\t\t// this.debug(\"fixSelection3AfterClick()\");\n\n\t\t\tthis.visit(function (node) {\n\t\t\t\tnode._changeSelectStatusAttrs(flag);\n\t\t\t\tif (node.radiogroup) {\n\t\t\t\t\t// #931: don't (de)select this branch\n\t\t\t\t\treturn \"skip\";\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.fixSelection3FromEndNodes(callOpts);\n\t\t},\n\t\t/**\n\t\t * Fix selection status for multi-hier mode.\n\t\t * Only end-nodes are considered to update the descendants branch and parents.\n\t\t * Should be called after this node has loaded new children or after\n\t\t * children have been modified using the API.\n\t\t */\n\t\tfixSelection3FromEndNodes: function (callOpts) {\n\t\t\tvar opts = this.tree.options;\n\n\t\t\t// this.debug(\"fixSelection3FromEndNodes()\");\n\t\t\t_assert(opts.selectMode === 3, \"expected selectMode 3\");\n\n\t\t\t// Visit all end nodes and adjust their parent's `selected` and `partsel`\n\t\t\t// attributes. Return selection state true, false, or undefined.\n\t\t\tfunction _walk(node) {\n\t\t\t\tvar i,\n\t\t\t\t\tl,\n\t\t\t\t\tchild,\n\t\t\t\t\ts,\n\t\t\t\t\tstate,\n\t\t\t\t\tallSelected,\n\t\t\t\t\tsomeSelected,\n\t\t\t\t\tunselIgnore,\n\t\t\t\t\tunselState,\n\t\t\t\t\tchildren = node.children;\n\n\t\t\t\tif (children && children.length) {\n\t\t\t\t\t// check all children recursively\n\t\t\t\t\tallSelected = true;\n\t\t\t\t\tsomeSelected = false;\n\n\t\t\t\t\tfor (i = 0, l = children.length; i < l; i++) {\n\t\t\t\t\t\tchild = children[i];\n\t\t\t\t\t\t// the selection state of a node is not relevant; we need the end-nodes\n\t\t\t\t\t\ts = _walk(child);\n\t\t\t\t\t\t// if( !child.unselectableIgnore ) {\n\t\t\t\t\t\tunselIgnore = FT.evalOption(\n\t\t\t\t\t\t\t\"unselectableIgnore\",\n\t\t\t\t\t\t\tchild,\n\t\t\t\t\t\t\tchild,\n\t\t\t\t\t\t\topts,\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (!unselIgnore) {\n\t\t\t\t\t\t\tif (s !== false) {\n\t\t\t\t\t\t\t\tsomeSelected = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (s !== true) {\n\t\t\t\t\t\t\t\tallSelected = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// eslint-disable-next-line no-nested-ternary\n\t\t\t\t\tstate = allSelected\n\t\t\t\t\t\t? true\n\t\t\t\t\t\t: someSelected\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: false;\n\t\t\t\t} else {\n\t\t\t\t\t// This is an end-node: simply report the status\n\t\t\t\t\tunselState = FT.evalOption(\n\t\t\t\t\t\t\"unselectableStatus\",\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\topts,\n\t\t\t\t\t\tundefined\n\t\t\t\t\t);\n\t\t\t\t\tstate = unselState == null ? !!node.selected : !!unselState;\n\t\t\t\t}\n\t\t\t\t// #939: Keep a `partsel` flag that was explicitly set on a lazy node\n\t\t\t\tif (\n\t\t\t\t\tnode.partsel &&\n\t\t\t\t\t!node.selected &&\n\t\t\t\t\tnode.lazy &&\n\t\t\t\t\tnode.children == null\n\t\t\t\t) {\n\t\t\t\t\tstate = undefined;\n\t\t\t\t}\n\t\t\t\tnode._changeSelectStatusAttrs(state);\n\t\t\t\treturn state;\n\t\t\t}\n\t\t\t_walk(this);\n\n\t\t\t// Update parent's state\n\t\t\tthis.visitParents(function (node) {\n\t\t\t\tvar i,\n\t\t\t\t\tl,\n\t\t\t\t\tchild,\n\t\t\t\t\tstate,\n\t\t\t\t\tunselIgnore,\n\t\t\t\t\tunselState,\n\t\t\t\t\tchildren = node.children,\n\t\t\t\t\tallSelected = true,\n\t\t\t\t\tsomeSelected = false;\n\n\t\t\t\tfor (i = 0, l = children.length; i < l; i++) {\n\t\t\t\t\tchild = children[i];\n\t\t\t\t\tunselIgnore = FT.evalOption(\n\t\t\t\t\t\t\"unselectableIgnore\",\n\t\t\t\t\t\tchild,\n\t\t\t\t\t\tchild,\n\t\t\t\t\t\topts,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t);\n\t\t\t\t\tif (!unselIgnore) {\n\t\t\t\t\t\tunselState = FT.evalOption(\n\t\t\t\t\t\t\t\"unselectableStatus\",\n\t\t\t\t\t\t\tchild,\n\t\t\t\t\t\t\tchild,\n\t\t\t\t\t\t\topts,\n\t\t\t\t\t\t\tundefined\n\t\t\t\t\t\t);\n\t\t\t\t\t\tstate =\n\t\t\t\t\t\t\tunselState == null\n\t\t\t\t\t\t\t\t? !!child.selected\n\t\t\t\t\t\t\t\t: !!unselState;\n\t\t\t\t\t\t// When fixing the parents, we trust the sibling status (i.e.\n\t\t\t\t\t\t// we don't recurse)\n\t\t\t\t\t\tif (state || child.partsel) {\n\t\t\t\t\t\t\tsomeSelected = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!state) {\n\t\t\t\t\t\t\tallSelected = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// eslint-disable-next-line no-nested-ternary\n\t\t\t\tstate = allSelected ? true : someSelected ? undefined : false;\n\t\t\t\tnode._changeSelectStatusAttrs(state);\n\t\t\t});\n\t\t},\n\t\t// TODO: focus()\n\t\t/**\n\t\t * Update node data. If dict contains 'children', then also replace\n\t\t * the hole sub tree.\n\t\t * @param {NodeData} dict\n\t\t *\n\t\t * @see FancytreeNode#addChildren\n\t\t * @see FancytreeNode#applyPatch\n\t\t */\n\t\tfromDict: function (dict) {\n\t\t\t// copy all other attributes to this.data.xxx\n\t\t\tfor (var name in dict) {\n\t\t\t\tif (NODE_ATTR_MAP[name]) {\n\t\t\t\t\t// node.NAME = dict.NAME\n\t\t\t\t\tthis[name] = dict[name];\n\t\t\t\t} else if (name === \"data\") {\n\t\t\t\t\t// node.data += dict.data\n\t\t\t\t\t$.extend(this.data, dict.data);\n\t\t\t\t} else if (\n\t\t\t\t\t!_isFunction(dict[name]) &&\n\t\t\t\t\t!NONE_NODE_DATA_MAP[name]\n\t\t\t\t) {\n\t\t\t\t\t// node.data.NAME = dict.NAME\n\t\t\t\t\tthis.data[name] = dict[name];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (dict.children) {\n\t\t\t\t// recursively set children and render\n\t\t\t\tthis.removeChildren();\n\t\t\t\tthis.addChildren(dict.children);\n\t\t\t}\n\t\t\tthis.renderTitle();\n\t\t\t/*\n\t\t\tvar children = dict.children;\n\t\t\tif(children === undefined){\n\t\t\t\tthis.data = $.extend(this.data, dict);\n\t\t\t\tthis.render();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdict = $.extend({}, dict);\n\t\t\tdict.children = undefined;\n\t\t\tthis.data = $.extend(this.data, dict);\n\t\t\tthis.removeChildren();\n\t\t\tthis.addChild(children);\n\t\t\t*/\n\t\t},\n\t\t/** Return the list of child nodes (undefined for unexpanded lazy nodes).\n\t\t * @returns {FancytreeNode[] | undefined}\n\t\t */\n\t\tgetChildren: function () {\n\t\t\tif (this.hasChildren() === undefined) {\n\t\t\t\t// TODO: only required for lazy nodes?\n\t\t\t\treturn undefined; // Lazy node: unloaded, currently loading, or load error\n\t\t\t}\n\t\t\treturn this.children;\n\t\t},\n\t\t/** Return the first child node or null.\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetFirstChild: function () {\n\t\t\treturn this.children ? this.children[0] : null;\n\t\t},\n\t\t/** Return the 0-based child index.\n\t\t * @returns {int}\n\t\t */\n\t\tgetIndex: function () {\n\t\t\t// return this.parent.children.indexOf(this);\n\t\t\treturn $.inArray(this, this.parent.children); // indexOf doesn't work in IE7\n\t\t},\n\t\t/** Return the hierarchical child index (1-based, e.g. '3.2.4').\n\t\t * @param {string} [separator=\".\"]\n\t\t * @param {int} [digits=1]\n\t\t * @returns {string}\n\t\t */\n\t\tgetIndexHier: function (separator, digits) {\n\t\t\tseparator = separator || \".\";\n\t\t\tvar s,\n\t\t\t\tres = [];\n\t\t\t$.each(this.getParentList(false, true), function (i, o) {\n\t\t\t\ts = \"\" + (o.getIndex() + 1);\n\t\t\t\tif (digits) {\n\t\t\t\t\t// prepend leading zeroes\n\t\t\t\t\ts = (\"0000000\" + s).substr(-digits);\n\t\t\t\t}\n\t\t\t\tres.push(s);\n\t\t\t});\n\t\t\treturn res.join(separator);\n\t\t},\n\t\t/** Return the parent keys separated by options.keyPathSeparator, e.g. \"/id_1/id_17/id_32\".\n\t\t *\n\t\t * (Unlike `node.getPath()`, this method prepends a \"/\" and inverts the first argument.)\n\t\t *\n\t\t * @see FancytreeNode#getPath\n\t\t * @param {boolean} [excludeSelf=false]\n\t\t * @returns {string}\n\t\t */\n\t\tgetKeyPath: function (excludeSelf) {\n\t\t\tvar sep = this.tree.options.keyPathSeparator;\n\n\t\t\treturn sep + this.getPath(!excludeSelf, \"key\", sep);\n\t\t},\n\t\t/** Return the last child of this node or null.\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetLastChild: function () {\n\t\t\treturn this.children\n\t\t\t\t? this.children[this.children.length - 1]\n\t\t\t\t: null;\n\t\t},\n\t\t/** Return node depth. 0: System root node, 1: visible top-level node, 2: first sub-level, ... .\n\t\t * @returns {int}\n\t\t */\n\t\tgetLevel: function () {\n\t\t\tvar level = 0,\n\t\t\t\tdtn = this.parent;\n\t\t\twhile (dtn) {\n\t\t\t\tlevel++;\n\t\t\t\tdtn = dtn.parent;\n\t\t\t}\n\t\t\treturn level;\n\t\t},\n\t\t/** Return the successor node (under the same parent) or null.\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetNextSibling: function () {\n\t\t\t// TODO: use indexOf, if available: (not in IE6)\n\t\t\tif (this.parent) {\n\t\t\t\tvar i,\n\t\t\t\t\tl,\n\t\t\t\t\tac = this.parent.children;\n\n\t\t\t\tfor (i = 0, l = ac.length - 1; i < l; i++) {\n\t\t\t\t\t// up to length-2, so next(last) = null\n\t\t\t\t\tif (ac[i] === this) {\n\t\t\t\t\t\treturn ac[i + 1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\t/** Return the parent node (null for the system root node).\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetParent: function () {\n\t\t\t// TODO: return null for top-level nodes?\n\t\t\treturn this.parent;\n\t\t},\n\t\t/** Return an array of all parent nodes (top-down).\n\t\t * @param {boolean} [includeRoot=false] Include the invisible system root node.\n\t\t * @param {boolean} [includeSelf=false] Include the node itself.\n\t\t * @returns {FancytreeNode[]}\n\t\t */\n\t\tgetParentList: function (includeRoot, includeSelf) {\n\t\t\tvar l = [],\n\t\t\t\tdtn = includeSelf ? this : this.parent;\n\t\t\twhile (dtn) {\n\t\t\t\tif (includeRoot || dtn.parent) {\n\t\t\t\t\tl.unshift(dtn);\n\t\t\t\t}\n\t\t\t\tdtn = dtn.parent;\n\t\t\t}\n\t\t\treturn l;\n\t\t},\n\t\t/** Return a string representing the hierachical node path, e.g. \"a/b/c\".\n\t\t * @param {boolean} [includeSelf=true]\n\t\t * @param {string | function} [part=\"title\"] node property name or callback\n\t\t * @param {string} [separator=\"/\"]\n\t\t * @returns {string}\n\t\t * @since v2.31\n\t\t */\n\t\tgetPath: function (includeSelf, part, separator) {\n\t\t\tincludeSelf = includeSelf !== false;\n\t\t\tpart = part || \"title\";\n\t\t\tseparator = separator || \"/\";\n\n\t\t\tvar val,\n\t\t\t\tpath = [],\n\t\t\t\tisFunc = _isFunction(part);\n\n\t\t\tthis.visitParents(function (n) {\n\t\t\t\tif (n.parent) {\n\t\t\t\t\tval = isFunc ? part(n) : n[part];\n\t\t\t\t\tpath.unshift(val);\n\t\t\t\t}\n\t\t\t}, includeSelf);\n\t\t\treturn path.join(separator);\n\t\t},\n\t\t/** Return the predecessor node (under the same parent) or null.\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetPrevSibling: function () {\n\t\t\tif (this.parent) {\n\t\t\t\tvar i,\n\t\t\t\t\tl,\n\t\t\t\t\tac = this.parent.children;\n\n\t\t\t\tfor (i = 1, l = ac.length; i < l; i++) {\n\t\t\t\t\t// start with 1, so prev(first) = null\n\t\t\t\t\tif (ac[i] === this) {\n\t\t\t\t\t\treturn ac[i - 1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\t/**\n\t\t * Return an array of selected descendant nodes.\n\t\t * @param {boolean} [stopOnParents=false] only return the topmost selected\n\t\t * node (useful with selectMode 3)\n\t\t * @returns {FancytreeNode[]}\n\t\t */\n\t\tgetSelectedNodes: function (stopOnParents) {\n\t\t\tvar nodeList = [];\n\t\t\tthis.visit(function (node) {\n\t\t\t\tif (node.selected) {\n\t\t\t\t\tnodeList.push(node);\n\t\t\t\t\tif (stopOnParents === true) {\n\t\t\t\t\t\treturn \"skip\"; // stop processing this branch\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn nodeList;\n\t\t},\n\t\t/** Return true if node has children. Return undefined if not sure, i.e. the node is lazy and not yet loaded).\n\t\t * @returns {boolean | undefined}\n\t\t */\n\t\thasChildren: function () {\n\t\t\tif (this.lazy) {\n\t\t\t\tif (this.children == null) {\n\t\t\t\t\t// null or undefined: Not yet loaded\n\t\t\t\t\treturn undefined;\n\t\t\t\t} else if (this.children.length === 0) {\n\t\t\t\t\t// Loaded, but response was empty\n\t\t\t\t\treturn false;\n\t\t\t\t} else if (\n\t\t\t\t\tthis.children.length === 1 &&\n\t\t\t\t\tthis.children[0].isStatusNode()\n\t\t\t\t) {\n\t\t\t\t\t// Currently loading or load error\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !!(this.children && this.children.length);\n\t\t},\n\t\t/**\n\t\t * Return true if node has `className` defined in .extraClasses.\n\t\t *\n\t\t * @param {string} className class name (separate multiple classes by space)\n\t\t * @returns {boolean}\n\t\t *\n\t\t * @since 2.32\n\t\t */\n\t\thasClass: function (className) {\n\t\t\treturn (\n\t\t\t\t(\" \" + (this.extraClasses || \"\") + \" \").indexOf(\n\t\t\t\t\t\" \" + className + \" \"\n\t\t\t\t) >= 0\n\t\t\t);\n\t\t},\n\t\t/** Return true if node has keyboard focus.\n\t\t * @returns {boolean}\n\t\t */\n\t\thasFocus: function () {\n\t\t\treturn this.tree.hasFocus() && this.tree.focusNode === this;\n\t\t},\n\t\t/** Write to browser console if debugLevel >= 3 (prepending node info)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\tinfo: function (msg) {\n\t\t\tif (this.tree.options.debugLevel >= 3) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"info\", arguments);\n\t\t\t}\n\t\t},\n\t\t/** Return true if node is active (see also FancytreeNode#isSelected).\n\t\t * @returns {boolean}\n\t\t */\n\t\tisActive: function () {\n\t\t\treturn this.tree.activeNode === this;\n\t\t},\n\t\t/** Return true if node is vertically below `otherNode`, i.e. rendered in a subsequent row.\n\t\t * @param {FancytreeNode} otherNode\n\t\t * @returns {boolean}\n\t\t * @since 2.28\n\t\t */\n\t\tisBelowOf: function (otherNode) {\n\t\t\treturn this.getIndexHier(\".\", 5) > otherNode.getIndexHier(\".\", 5);\n\t\t},\n\t\t/** Return true if node is a direct child of otherNode.\n\t\t * @param {FancytreeNode} otherNode\n\t\t * @returns {boolean}\n\t\t */\n\t\tisChildOf: function (otherNode) {\n\t\t\treturn this.parent && this.parent === otherNode;\n\t\t},\n\t\t/** Return true, if node is a direct or indirect sub node of otherNode.\n\t\t * @param {FancytreeNode} otherNode\n\t\t * @returns {boolean}\n\t\t */\n\t\tisDescendantOf: function (otherNode) {\n\t\t\tif (!otherNode || otherNode.tree !== this.tree) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar p = this.parent;\n\t\t\twhile (p) {\n\t\t\t\tif (p === otherNode) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (p === p.parent) {\n\t\t\t\t\t$.error(\"Recursive parent link: \" + p);\n\t\t\t\t}\n\t\t\t\tp = p.parent;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\t/** Return true if node is expanded.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisExpanded: function () {\n\t\t\treturn !!this.expanded;\n\t\t},\n\t\t/** Return true if node is the first node of its parent's children.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisFirstSibling: function () {\n\t\t\tvar p = this.parent;\n\t\t\treturn !p || p.children[0] === this;\n\t\t},\n\t\t/** Return true if node is a folder, i.e. has the node.folder attribute set.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisFolder: function () {\n\t\t\treturn !!this.folder;\n\t\t},\n\t\t/** Return true if node is the last node of its parent's children.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisLastSibling: function () {\n\t\t\tvar p = this.parent;\n\t\t\treturn !p || p.children[p.children.length - 1] === this;\n\t\t},\n\t\t/** Return true if node is lazy (even if data was already loaded)\n\t\t * @returns {boolean}\n\t\t */\n\t\tisLazy: function () {\n\t\t\treturn !!this.lazy;\n\t\t},\n\t\t/** Return true if node is lazy and loaded. For non-lazy nodes always return true.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisLoaded: function () {\n\t\t\treturn !this.lazy || this.hasChildren() !== undefined; // Also checks if the only child is a status node\n\t\t},\n\t\t/** Return true if children are currently beeing loaded, i.e. a Ajax request is pending.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisLoading: function () {\n\t\t\treturn !!this._isLoading;\n\t\t},\n\t\t/*\n\t\t * @deprecated since v2.4.0: Use isRootNode() instead\n\t\t */\n\t\tisRoot: function () {\n\t\t\treturn this.isRootNode();\n\t\t},\n\t\t/** Return true if node is partially selected (tri-state).\n\t\t * @returns {boolean}\n\t\t * @since 2.23\n\t\t */\n\t\tisPartsel: function () {\n\t\t\treturn !this.selected && !!this.partsel;\n\t\t},\n\t\t/** (experimental) Return true if this is partially loaded.\n\t\t * @returns {boolean}\n\t\t * @since 2.15\n\t\t */\n\t\tisPartload: function () {\n\t\t\treturn !!this.partload;\n\t\t},\n\t\t/** Return true if this is the (invisible) system root node.\n\t\t * @returns {boolean}\n\t\t * @since 2.4\n\t\t */\n\t\tisRootNode: function () {\n\t\t\treturn this.tree.rootNode === this;\n\t\t},\n\t\t/** Return true if node is selected, i.e. has a checkmark set (see also FancytreeNode#isActive).\n\t\t * @returns {boolean}\n\t\t */\n\t\tisSelected: function () {\n\t\t\treturn !!this.selected;\n\t\t},\n\t\t/** Return true if this node is a temporarily generated system node like\n\t\t * 'loading', 'paging', or 'error' (node.statusNodeType contains the type).\n\t\t * @returns {boolean}\n\t\t */\n\t\tisStatusNode: function () {\n\t\t\treturn !!this.statusNodeType;\n\t\t},\n\t\t/** Return true if this node is a status node of type 'paging'.\n\t\t * @returns {boolean}\n\t\t * @since 2.15\n\t\t */\n\t\tisPagingNode: function () {\n\t\t\treturn this.statusNodeType === \"paging\";\n\t\t},\n\t\t/** Return true if this a top level node, i.e. a direct child of the (invisible) system root node.\n\t\t * @returns {boolean}\n\t\t * @since 2.4\n\t\t */\n\t\tisTopLevel: function () {\n\t\t\treturn this.tree.rootNode === this.parent;\n\t\t},\n\t\t/** Return true if node is lazy and not yet loaded. For non-lazy nodes always return false.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisUndefined: function () {\n\t\t\treturn this.hasChildren() === undefined; // also checks if the only child is a status node\n\t\t},\n\t\t/** Return true if all parent nodes are expanded. Note: this does not check\n\t\t * whether the node is scrolled into the visible part of the screen.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisVisible: function () {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tn,\n\t\t\t\thasFilter = this.tree.enableFilter,\n\t\t\t\tparents = this.getParentList(false, false);\n\n\t\t\t// TODO: check $(n.span).is(\":visible\")\n\t\t\t// i.e. return false for nodes (but not parents) that are hidden\n\t\t\t// by a filter\n\t\t\tif (hasFilter && !this.match && !this.subMatchCount) {\n\t\t\t\t// this.debug( \"isVisible: HIDDEN (\" + hasFilter + \", \" + this.match + \", \" + this.match + \")\" );\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tfor (i = 0, l = parents.length; i < l; i++) {\n\t\t\t\tn = parents[i];\n\n\t\t\t\tif (!n.expanded) {\n\t\t\t\t\t// this.debug(\"isVisible: HIDDEN (parent collapsed)\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// if (hasFilter && !n.match && !n.subMatchCount) {\n\t\t\t\t// \tthis.debug(\"isVisible: HIDDEN (\" + hasFilter + \", \" + this.match + \", \" + this.match + \")\");\n\t\t\t\t// \treturn false;\n\t\t\t\t// }\n\t\t\t}\n\t\t\t// this.debug(\"isVisible: VISIBLE\");\n\t\t\treturn true;\n\t\t},\n\t\t/** Deprecated.\n\t\t * @deprecated since 2014-02-16: use load() instead.\n\t\t */\n\t\tlazyLoad: function (discard) {\n\t\t\t$.error(\n\t\t\t\t\"FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead.\"\n\t\t\t);\n\t\t},\n\t\t/**\n\t\t * Load all children of a lazy node if neccessary. The <i>expanded</i> state is maintained.\n\t\t * @param {boolean} [forceReload=false] Pass true to discard any existing nodes before. Otherwise this method does nothing if the node was already loaded.\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tload: function (forceReload) {\n\t\t\tvar res,\n\t\t\t\tsource,\n\t\t\t\tself = this,\n\t\t\t\twasExpanded = this.isExpanded();\n\n\t\t\t_assert(this.isLazy(), \"load() requires a lazy node\");\n\t\t\t// _assert( forceReload || this.isUndefined(), \"Pass forceReload=true to re-load a lazy node\" );\n\t\t\tif (!forceReload && !this.isUndefined()) {\n\t\t\t\treturn _getResolvedPromise(this);\n\t\t\t}\n\t\t\tif (this.isLoaded()) {\n\t\t\t\tthis.resetLazy(); // also collapses\n\t\t\t}\n\t\t\t// This method is also called by setExpanded() and loadKeyPath(), so we\n\t\t\t// have to avoid recursion.\n\t\t\tsource = this.tree._triggerNodeEvent(\"lazyLoad\", this);\n\t\t\tif (source === false) {\n\t\t\t\t// #69\n\t\t\t\treturn _getResolvedPromise(this);\n\t\t\t}\n\t\t\t_assert(\n\t\t\t\ttypeof source !== \"boolean\",\n\t\t\t\t\"lazyLoad event must return source in data.result\"\n\t\t\t);\n\t\t\tres = this.tree._callHook(\"nodeLoadChildren\", this, source);\n\t\t\tif (wasExpanded) {\n\t\t\t\tthis.expanded = true;\n\t\t\t\tres.always(function () {\n\t\t\t\t\tself.render();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tres.always(function () {\n\t\t\t\t\tself.renderStatus(); // fix expander icon to 'loaded'\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t/** Expand all parents and optionally scroll into visible area as neccessary.\n\t\t * Promise is resolved, when lazy loading and animations are done.\n\t\t * @param {object} [opts] passed to `setExpanded()`.\n\t\t * Defaults to {noAnimation: false, noEvents: false, scrollIntoView: true}\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tmakeVisible: function (opts) {\n\t\t\tvar i,\n\t\t\t\tself = this,\n\t\t\t\tdeferreds = [],\n\t\t\t\tdfd = new $.Deferred(),\n\t\t\t\tparents = this.getParentList(false, false),\n\t\t\t\tlen = parents.length,\n\t\t\t\teffects = !(opts && opts.noAnimation === true),\n\t\t\t\tscroll = !(opts && opts.scrollIntoView === false);\n\n\t\t\t// Expand bottom-up, so only the top node is animated\n\t\t\tfor (i = len - 1; i >= 0; i--) {\n\t\t\t\t// self.debug(\"pushexpand\" + parents[i]);\n\t\t\t\tdeferreds.push(parents[i].setExpanded(true, opts));\n\t\t\t}\n\t\t\t$.when.apply($, deferreds).done(function () {\n\t\t\t\t// All expands have finished\n\t\t\t\t// self.debug(\"expand DONE\", scroll);\n\t\t\t\tif (scroll) {\n\t\t\t\t\tself.scrollIntoView(effects).done(function () {\n\t\t\t\t\t\t// self.debug(\"scroll DONE\");\n\t\t\t\t\t\tdfd.resolve();\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tdfd.resolve();\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn dfd.promise();\n\t\t},\n\t\t/** Move this node to targetNode.\n\t\t * @param {FancytreeNode} targetNode\n\t\t * @param {string} mode <pre>\n\t\t * 'child': append this node as last child of targetNode.\n\t\t * This is the default. To be compatble with the D'n'd\n\t\t * hitMode, we also accept 'over'.\n\t\t * 'firstChild': add this node as first child of targetNode.\n\t\t * 'before': add this node as sibling before targetNode.\n\t\t * 'after': add this node as sibling after targetNode.</pre>\n\t\t * @param {function} [map] optional callback(FancytreeNode) to allow modifcations\n\t\t */\n\t\tmoveTo: function (targetNode, mode, map) {\n\t\t\tif (mode === undefined || mode === \"over\") {\n\t\t\t\tmode = \"child\";\n\t\t\t} else if (mode === \"firstChild\") {\n\t\t\t\tif (targetNode.children && targetNode.children.length) {\n\t\t\t\t\tmode = \"before\";\n\t\t\t\t\ttargetNode = targetNode.children[0];\n\t\t\t\t} else {\n\t\t\t\t\tmode = \"child\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar pos,\n\t\t\t\ttree = this.tree,\n\t\t\t\tprevParent = this.parent,\n\t\t\t\ttargetParent =\n\t\t\t\t\tmode === \"child\" ? targetNode : targetNode.parent;\n\n\t\t\tif (this === targetNode) {\n\t\t\t\treturn;\n\t\t\t} else if (!this.parent) {\n\t\t\t\t$.error(\"Cannot move system root\");\n\t\t\t} else if (targetParent.isDescendantOf(this)) {\n\t\t\t\t$.error(\"Cannot move a node to its own descendant\");\n\t\t\t}\n\t\t\tif (targetParent !== prevParent) {\n\t\t\t\tprevParent.triggerModifyChild(\"remove\", this);\n\t\t\t}\n\t\t\t// Unlink this node from current parent\n\t\t\tif (this.parent.children.length === 1) {\n\t\t\t\tif (this.parent === targetParent) {\n\t\t\t\t\treturn; // #258\n\t\t\t\t}\n\t\t\t\tthis.parent.children = this.parent.lazy ? [] : null;\n\t\t\t\tthis.parent.expanded = false;\n\t\t\t} else {\n\t\t\t\tpos = $.inArray(this, this.parent.children);\n\t\t\t\t_assert(pos >= 0, \"invalid source parent\");\n\t\t\t\tthis.parent.children.splice(pos, 1);\n\t\t\t}\n\t\t\t// Remove from source DOM parent\n\t\t\t// if(this.parent.ul){\n\t\t\t// \tthis.parent.ul.removeChild(this.li);\n\t\t\t// }\n\n\t\t\t// Insert this node to target parent's child list\n\t\t\tthis.parent = targetParent;\n\t\t\tif (targetParent.hasChildren()) {\n\t\t\t\tswitch (mode) {\n\t\t\t\t\tcase \"child\":\n\t\t\t\t\t\t// Append to existing target children\n\t\t\t\t\t\ttargetParent.children.push(this);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"before\":\n\t\t\t\t\t\t// Insert this node before target node\n\t\t\t\t\t\tpos = $.inArray(targetNode, targetParent.children);\n\t\t\t\t\t\t_assert(pos >= 0, \"invalid target parent\");\n\t\t\t\t\t\ttargetParent.children.splice(pos, 0, this);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"after\":\n\t\t\t\t\t\t// Insert this node after target node\n\t\t\t\t\t\tpos = $.inArray(targetNode, targetParent.children);\n\t\t\t\t\t\t_assert(pos >= 0, \"invalid target parent\");\n\t\t\t\t\t\ttargetParent.children.splice(pos + 1, 0, this);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$.error(\"Invalid mode \" + mode);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttargetParent.children = [this];\n\t\t\t}\n\t\t\t// Parent has no <ul> tag yet:\n\t\t\t// if( !targetParent.ul ) {\n\t\t\t// \t// This is the parent's first child: create UL tag\n\t\t\t// \t// (Hidden, because it will be\n\t\t\t// \ttargetParent.ul = document.createElement(\"ul\");\n\t\t\t// \ttargetParent.ul.style.display = \"none\";\n\t\t\t// \ttargetParent.li.appendChild(targetParent.ul);\n\t\t\t// }\n\t\t\t// // Issue 319: Add to target DOM parent (only if node was already rendered(expanded))\n\t\t\t// if(this.li){\n\t\t\t// \ttargetParent.ul.appendChild(this.li);\n\t\t\t// }\n\n\t\t\t// Let caller modify the nodes\n\t\t\tif (map) {\n\t\t\t\ttargetNode.visit(map, true);\n\t\t\t}\n\t\t\tif (targetParent === prevParent) {\n\t\t\t\ttargetParent.triggerModifyChild(\"move\", this);\n\t\t\t} else {\n\t\t\t\t// prevParent.triggerModifyChild(\"remove\", this);\n\t\t\t\ttargetParent.triggerModifyChild(\"add\", this);\n\t\t\t}\n\t\t\t// Handle cross-tree moves\n\t\t\tif (tree !== targetNode.tree) {\n\t\t\t\t// Fix node.tree for all source nodes\n\t\t\t\t// \t_assert(false, \"Cross-tree move is not yet implemented.\");\n\t\t\t\tthis.warn(\"Cross-tree moveTo is experimental!\");\n\t\t\t\tthis.visit(function (n) {\n\t\t\t\t\t// TODO: fix selection state and activation, ...\n\t\t\t\t\tn.tree = targetNode.tree;\n\t\t\t\t}, true);\n\t\t\t}\n\n\t\t\t// A collaposed node won't re-render children, so we have to remove it manually\n\t\t\t// if( !targetParent.expanded ){\n\t\t\t// prevParent.ul.removeChild(this.li);\n\t\t\t// }\n\t\t\ttree._callHook(\"treeStructureChanged\", tree, \"moveTo\");\n\n\t\t\t// Update HTML markup\n\t\t\tif (!prevParent.isDescendantOf(targetParent)) {\n\t\t\t\tprevParent.render();\n\t\t\t}\n\t\t\tif (\n\t\t\t\t!targetParent.isDescendantOf(prevParent) &&\n\t\t\t\ttargetParent !== prevParent\n\t\t\t) {\n\t\t\t\ttargetParent.render();\n\t\t\t}\n\t\t\t// TODO: fix selection state\n\t\t\t// TODO: fix active state\n\n\t\t\t/*\n\t\t\tvar tree = this.tree;\n\t\t\tvar opts = tree.options;\n\t\t\tvar pers = tree.persistence;\n\n\t\t\t// Always expand, if it's below minExpandLevel\n\t\t\t// tree.logDebug (\"%s._addChildNode(%o), l=%o\", this, ftnode, ftnode.getLevel());\n\t\t\tif ( opts.minExpandLevel >= ftnode.getLevel() ) {\n\t\t\t\t// tree.logDebug (\"Force expand for %o\", ftnode);\n\t\t\t\tthis.bExpanded = true;\n\t\t\t}\n\n\t\t\t// In multi-hier mode, update the parents selection state\n\t\t\t// DT issue #82: only if not initializing, because the children may not exist yet\n\t\t\t// if( !ftnode.data.isStatusNode() && opts.selectMode==3 && !isInitializing )\n\t\t\t// \tftnode._fixSelectionState();\n\n\t\t\t// In multi-hier mode, update the parents selection state\n\t\t\tif( ftnode.bSelected && opts.selectMode==3 ) {\n\t\t\t\tvar p = this;\n\t\t\t\twhile( p ) {\n\t\t\t\t\tif( !p.hasSubSel )\n\t\t\t\t\t\tp._setSubSel(true);\n\t\t\t\t\tp = p.parent;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// render this node and the new child\n\t\t\tif ( tree.bEnableUpdate )\n\t\t\t\tthis.render();\n\t\t\treturn ftnode;\n\t\t\t*/\n\t\t},\n\t\t/** Set focus relative to this node and optionally activate.\n\t\t *\n\t\t * 'left' collapses the node if it is expanded, or move to the parent\n\t\t * otherwise.\n\t\t * 'right' expands the node if it is collapsed, or move to the first\n\t\t * child otherwise.\n\t\t *\n\t\t * @param {string|number} where 'down', 'first', 'last', 'left', 'parent', 'right', or 'up'.\n\t\t * (Alternatively the keyCode that would normally trigger this move,\n\t\t * e.g. `$.ui.keyCode.LEFT` = 'left'.\n\t\t * @param {boolean} [activate=true]\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tnavigate: function (where, activate) {\n\t\t\tvar node,\n\t\t\t\tKC = $.ui.keyCode;\n\n\t\t\t// Handle optional expand/collapse action for LEFT/RIGHT\n\t\t\tswitch (where) {\n\t\t\t\tcase \"left\":\n\t\t\t\tcase KC.LEFT:\n\t\t\t\t\tif (this.expanded) {\n\t\t\t\t\t\treturn this.setExpanded(false);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"right\":\n\t\t\t\tcase KC.RIGHT:\n\t\t\t\t\tif (!this.expanded && (this.children || this.lazy)) {\n\t\t\t\t\t\treturn this.setExpanded();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// Otherwise activate or focus the related node\n\t\t\tnode = this.findRelatedNode(where);\n\t\t\tif (node) {\n\t\t\t\t// setFocus/setActive will scroll later (if autoScroll is specified)\n\t\t\t\ttry {\n\t\t\t\t\tnode.makeVisible({ scrollIntoView: false });\n\t\t\t\t} catch (e) {} // #272\n\t\t\t\tif (activate === false) {\n\t\t\t\t\tnode.setFocus();\n\t\t\t\t\treturn _getResolvedPromise();\n\t\t\t\t}\n\t\t\t\treturn node.setActive();\n\t\t\t}\n\t\t\tthis.warn(\"Could not find related node '\" + where + \"'.\");\n\t\t\treturn _getResolvedPromise();\n\t\t},\n\t\t/**\n\t\t * Remove this node (not allowed for system root).\n\t\t */\n\t\tremove: function () {\n\t\t\treturn this.parent.removeChild(this);\n\t\t},\n\t\t/**\n\t\t * Remove childNode from list of direct children.\n\t\t * @param {FancytreeNode} childNode\n\t\t */\n\t\tremoveChild: function (childNode) {\n\t\t\treturn this.tree._callHook(\"nodeRemoveChild\", this, childNode);\n\t\t},\n\t\t/**\n\t\t * Remove all child nodes and descendents. This converts the node into a leaf.<br>\n\t\t * If this was a lazy node, it is still considered 'loaded'; call node.resetLazy()\n\t\t * in order to trigger lazyLoad on next expand.\n\t\t */\n\t\tremoveChildren: function () {\n\t\t\treturn this.tree._callHook(\"nodeRemoveChildren\", this);\n\t\t},\n\t\t/**\n\t\t * Remove class from node's span tag and .extraClasses.\n\t\t *\n\t\t * @param {string} className class name\n\t\t *\n\t\t * @since 2.17\n\t\t */\n\t\tremoveClass: function (className) {\n\t\t\treturn this.toggleClass(className, false);\n\t\t},\n\t\t/**\n\t\t * This method renders and updates all HTML markup that is required\n\t\t * to display this node in its current state.<br>\n\t\t * Note:\n\t\t * <ul>\n\t\t * <li>It should only be neccessary to call this method after the node object\n\t\t * was modified by direct access to its properties, because the common\n\t\t * API methods (node.setTitle(), moveTo(), addChildren(), remove(), ...)\n\t\t * already handle this.\n\t\t * <li> {@link FancytreeNode#renderTitle} and {@link FancytreeNode#renderStatus}\n\t\t * are implied. If changes are more local, calling only renderTitle() or\n\t\t * renderStatus() may be sufficient and faster.\n\t\t * </ul>\n\t\t *\n\t\t * @param {boolean} [force=false] re-render, even if html markup was already created\n\t\t * @param {boolean} [deep=false] also render all descendants, even if parent is collapsed\n\t\t */\n\t\trender: function (force, deep) {\n\t\t\treturn this.tree._callHook(\"nodeRender\", this, force, deep);\n\t\t},\n\t\t/** Create HTML markup for the node's outer `<span>` (expander, checkbox, icon, and title).\n\t\t * Implies {@link FancytreeNode#renderStatus}.\n\t\t * @see Fancytree_Hooks#nodeRenderTitle\n\t\t */\n\t\trenderTitle: function () {\n\t\t\treturn this.tree._callHook(\"nodeRenderTitle\", this);\n\t\t},\n\t\t/** Update element's CSS classes according to node state.\n\t\t * @see Fancytree_Hooks#nodeRenderStatus\n\t\t */\n\t\trenderStatus: function () {\n\t\t\treturn this.tree._callHook(\"nodeRenderStatus\", this);\n\t\t},\n\t\t/**\n\t\t * (experimental) Replace this node with `source`.\n\t\t * (Currently only available for paging nodes.)\n\t\t * @param {NodeData[]} source List of child node definitions\n\t\t * @since 2.15\n\t\t */\n\t\treplaceWith: function (source) {\n\t\t\tvar res,\n\t\t\t\tparent = this.parent,\n\t\t\t\tpos = $.inArray(this, parent.children),\n\t\t\t\tself = this;\n\n\t\t\t_assert(\n\t\t\t\tthis.isPagingNode(),\n\t\t\t\t\"replaceWith() currently requires a paging status node\"\n\t\t\t);\n\n\t\t\tres = this.tree._callHook(\"nodeLoadChildren\", this, source);\n\t\t\tres.done(function (data) {\n\t\t\t\t// New nodes are currently children of `this`.\n\t\t\t\tvar children = self.children;\n\t\t\t\t// Prepend newly loaded child nodes to `this`\n\t\t\t\t// Move new children after self\n\t\t\t\tfor (i = 0; i < children.length; i++) {\n\t\t\t\t\tchildren[i].parent = parent;\n\t\t\t\t}\n\t\t\t\tparent.children.splice.apply(\n\t\t\t\t\tparent.children,\n\t\t\t\t\t[pos + 1, 0].concat(children)\n\t\t\t\t);\n\n\t\t\t\t// Remove self\n\t\t\t\tself.children = null;\n\t\t\t\tself.remove();\n\t\t\t\t// Redraw new nodes\n\t\t\t\tparent.render();\n\t\t\t\t// TODO: set node.partload = false if this was tha last paging node?\n\t\t\t\t// parent.addPagingNode(false);\n\t\t\t}).fail(function () {\n\t\t\t\tself.setExpanded();\n\t\t\t});\n\t\t\treturn res;\n\t\t\t// $.error(\"Not implemented: replaceWith()\");\n\t\t},\n\t\t/**\n\t\t * Remove all children, collapse, and set the lazy-flag, so that the lazyLoad\n\t\t * event is triggered on next expand.\n\t\t */\n\t\tresetLazy: function () {\n\t\t\tthis.removeChildren();\n\t\t\tthis.expanded = false;\n\t\t\tthis.lazy = true;\n\t\t\tthis.children = undefined;\n\t\t\tthis.renderStatus();\n\t\t},\n\t\t/** Schedule activity for delayed execution (cancel any pending request).\n\t\t * scheduleAction('cancel') will only cancel a pending request (if any).\n\t\t * @param {string} mode\n\t\t * @param {number} ms\n\t\t */\n\t\tscheduleAction: function (mode, ms) {\n\t\t\tif (this.tree.timer) {\n\t\t\t\tclearTimeout(this.tree.timer);\n\t\t\t\tthis.tree.debug(\"clearTimeout(%o)\", this.tree.timer);\n\t\t\t}\n\t\t\tthis.tree.timer = null;\n\t\t\tvar self = this; // required for closures\n\t\t\tswitch (mode) {\n\t\t\t\tcase \"cancel\":\n\t\t\t\t\t// Simply made sure that timer was cleared\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"expand\":\n\t\t\t\t\tthis.tree.timer = setTimeout(function () {\n\t\t\t\t\t\tself.tree.debug(\"setTimeout: trigger expand\");\n\t\t\t\t\t\tself.setExpanded(true);\n\t\t\t\t\t}, ms);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"activate\":\n\t\t\t\t\tthis.tree.timer = setTimeout(function () {\n\t\t\t\t\t\tself.tree.debug(\"setTimeout: trigger activate\");\n\t\t\t\t\t\tself.setActive(true);\n\t\t\t\t\t}, ms);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$.error(\"Invalid mode \" + mode);\n\t\t\t}\n\t\t\t// this.tree.debug(\"setTimeout(%s, %s): %s\", mode, ms, this.tree.timer);\n\t\t},\n\t\t/**\n\t\t *\n\t\t * @param {boolean | PlainObject} [effects=false] animation options.\n\t\t * @param {object} [options=null] {topNode: null, effects: ..., parent: ...} this node will remain visible in\n\t\t * any case, even if `this` is outside the scroll pane.\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tscrollIntoView: function (effects, options) {\n\t\t\tif (options !== undefined && _isNode(options)) {\n\t\t\t\tthrow Error(\n\t\t\t\t\t\"scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' instead.\"\n\t\t\t\t);\n\t\t\t}\n\t\t\t// The scroll parent is typically the plain tree's <UL> container.\n\t\t\t// For ext-table, we choose the nearest parent that has `position: relative`\n\t\t\t// and `overflow` set.\n\t\t\t// (This default can be overridden by the local or global `scrollParent` option.)\n\t\t\tvar opts = $.extend(\n\t\t\t\t\t{\n\t\t\t\t\t\teffects:\n\t\t\t\t\t\t\teffects === true\n\t\t\t\t\t\t\t\t? { duration: 200, queue: false }\n\t\t\t\t\t\t\t\t: effects,\n\t\t\t\t\t\tscrollOfs: this.tree.options.scrollOfs,\n\t\t\t\t\t\tscrollParent: this.tree.options.scrollParent,\n\t\t\t\t\t\ttopNode: null,\n\t\t\t\t\t},\n\t\t\t\t\toptions\n\t\t\t\t),\n\t\t\t\t$scrollParent = opts.scrollParent,\n\t\t\t\t$container = this.tree.$container,\n\t\t\t\toverflowY = $container.css(\"overflow-y\");\n\n\t\t\tif (!$scrollParent) {\n\t\t\t\tif (this.tree.tbody) {\n\t\t\t\t\t$scrollParent = $container.scrollParent();\n\t\t\t\t} else if (overflowY === \"scroll\" || overflowY === \"auto\") {\n\t\t\t\t\t$scrollParent = $container;\n\t\t\t\t} else {\n\t\t\t\t\t// #922 plain tree in a non-fixed-sized UL scrolls inside its parent\n\t\t\t\t\t$scrollParent = $container.scrollParent();\n\t\t\t\t}\n\t\t\t} else if (!$scrollParent.jquery) {\n\t\t\t\t// Make sure we have a jQuery object\n\t\t\t\t$scrollParent = $($scrollParent);\n\t\t\t}\n\t\t\tif (\n\t\t\t\t$scrollParent[0] === document ||\n\t\t\t\t$scrollParent[0] === document.body\n\t\t\t) {\n\t\t\t\t// `document` may be returned by $().scrollParent(), if nothing is found,\n\t\t\t\t// but would not work: (see #894)\n\t\t\t\tthis.debug(\n\t\t\t\t\t\"scrollIntoView(): normalizing scrollParent to 'window':\",\n\t\t\t\t\t$scrollParent[0]\n\t\t\t\t);\n\t\t\t\t$scrollParent = $(window);\n\t\t\t}\n\t\t\t// eslint-disable-next-line one-var\n\t\t\tvar topNodeY,\n\t\t\t\tnodeY,\n\t\t\t\thorzScrollbarHeight,\n\t\t\t\tcontainerOffsetTop,\n\t\t\t\tdfd = new $.Deferred(),\n\t\t\t\tself = this,\n\t\t\t\tnodeHeight = $(this.span).height(),\n\t\t\t\ttopOfs = opts.scrollOfs.top || 0,\n\t\t\t\tbottomOfs = opts.scrollOfs.bottom || 0,\n\t\t\t\tcontainerHeight = $scrollParent.height(),\n\t\t\t\tscrollTop = $scrollParent.scrollTop(),\n\t\t\t\t$animateTarget = $scrollParent,\n\t\t\t\tisParentWindow = $scrollParent[0] === window,\n\t\t\t\ttopNode = opts.topNode || null,\n\t\t\t\tnewScrollTop = null;\n\n\t\t\t// this.debug(\"scrollIntoView(), scrollTop=\" + scrollTop, opts.scrollOfs);\n\t\t\t// _assert($(this.span).is(\":visible\"), \"scrollIntoView node is invisible\"); // otherwise we cannot calc offsets\n\t\t\tif (this.isRootNode() || !this.isVisible()) {\n\t\t\t\t// We cannot calc offsets for hidden elements\n\t\t\t\tthis.info(\"scrollIntoView(): node is invisible.\");\n\t\t\t\treturn _getResolvedPromise();\n\t\t\t}\n\t\t\tif (isParentWindow) {\n\t\t\t\tnodeY = $(this.span).offset().top;\n\t\t\t\ttopNodeY =\n\t\t\t\t\ttopNode && topNode.span ? $(topNode.span).offset().top : 0;\n\t\t\t\t$animateTarget = $(\"html,body\");\n\t\t\t} else {\n\t\t\t\t_assert(\n\t\t\t\t\t$scrollParent[0] !== document &&\n\t\t\t\t\t\t$scrollParent[0] !== document.body,\n\t\t\t\t\t\"scrollParent should be a simple element or `window`, not document or body.\"\n\t\t\t\t);\n\n\t\t\t\tcontainerOffsetTop = $scrollParent.offset().top;\n\t\t\t\tnodeY =\n\t\t\t\t\t$(this.span).offset().top - containerOffsetTop + scrollTop; // relative to scroll parent\n\t\t\t\ttopNodeY = topNode\n\t\t\t\t\t? $(topNode.span).offset().top -\n\t\t\t\t\t containerOffsetTop +\n\t\t\t\t\t scrollTop\n\t\t\t\t\t: 0;\n\t\t\t\thorzScrollbarHeight = Math.max(\n\t\t\t\t\t0,\n\t\t\t\t\t$scrollParent.innerHeight() - $scrollParent[0].clientHeight\n\t\t\t\t);\n\t\t\t\tcontainerHeight -= horzScrollbarHeight;\n\t\t\t}\n\n\t\t\t// this.debug(\" scrollIntoView(), nodeY=\" + nodeY + \", containerHeight=\" + containerHeight);\n\t\t\tif (nodeY < scrollTop + topOfs) {\n\t\t\t\t// Node is above visible container area\n\t\t\t\tnewScrollTop = nodeY - topOfs;\n\t\t\t\t// this.debug(\" scrollIntoView(), UPPER newScrollTop=\" + newScrollTop);\n\t\t\t} else if (\n\t\t\t\tnodeY + nodeHeight >\n\t\t\t\tscrollTop + containerHeight - bottomOfs\n\t\t\t) {\n\t\t\t\tnewScrollTop = nodeY + nodeHeight - containerHeight + bottomOfs;\n\t\t\t\t// this.debug(\" scrollIntoView(), LOWER newScrollTop=\" + newScrollTop);\n\t\t\t\t// If a topNode was passed, make sure that it is never scrolled\n\t\t\t\t// outside the upper border\n\t\t\t\tif (topNode) {\n\t\t\t\t\t_assert(\n\t\t\t\t\t\ttopNode.isRootNode() || topNode.isVisible(),\n\t\t\t\t\t\t\"topNode must be visible\"\n\t\t\t\t\t);\n\t\t\t\t\tif (topNodeY < newScrollTop) {\n\t\t\t\t\t\tnewScrollTop = topNodeY - topOfs;\n\t\t\t\t\t\t// this.debug(\" scrollIntoView(), TOP newScrollTop=\" + newScrollTop);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (newScrollTop === null) {\n\t\t\t\tdfd.resolveWith(this);\n\t\t\t} else {\n\t\t\t\t// this.debug(\" scrollIntoView(), SET newScrollTop=\" + newScrollTop);\n\t\t\t\tif (opts.effects) {\n\t\t\t\t\topts.effects.complete = function () {\n\t\t\t\t\t\tdfd.resolveWith(self);\n\t\t\t\t\t};\n\t\t\t\t\t$animateTarget.stop(true).animate(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tscrollTop: newScrollTop,\n\t\t\t\t\t\t},\n\t\t\t\t\t\topts.effects\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$animateTarget[0].scrollTop = newScrollTop;\n\t\t\t\t\tdfd.resolveWith(this);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dfd.promise();\n\t\t},\n\n\t\t/**Activate this node.\n\t\t *\n\t\t * The `cell` option requires the ext-table and ext-ariagrid extensions.\n\t\t *\n\t\t * @param {boolean} [flag=true] pass false to deactivate\n\t\t * @param {object} [opts] additional options. Defaults to {noEvents: false, noFocus: false, cell: null}\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tsetActive: function (flag, opts) {\n\t\t\treturn this.tree._callHook(\"nodeSetActive\", this, flag, opts);\n\t\t},\n\t\t/**Expand or collapse this node. Promise is resolved, when lazy loading and animations are done.\n\t\t * @param {boolean} [flag=true] pass false to collapse\n\t\t * @param {object} [opts] additional options. Defaults to {noAnimation: false, noEvents: false}\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tsetExpanded: function (flag, opts) {\n\t\t\treturn this.tree._callHook(\"nodeSetExpanded\", this, flag, opts);\n\t\t},\n\t\t/**Set keyboard focus to this node.\n\t\t * @param {boolean} [flag=true] pass false to blur\n\t\t * @see Fancytree#setFocus\n\t\t */\n\t\tsetFocus: function (flag) {\n\t\t\treturn this.tree._callHook(\"nodeSetFocus\", this, flag);\n\t\t},\n\t\t/**Select this node, i.e. check the checkbox.\n\t\t * @param {boolean} [flag=true] pass false to deselect\n\t\t * @param {object} [opts] additional options. Defaults to {noEvents: false, p\n\t\t * propagateDown: null, propagateUp: null, callback: null }\n\t\t */\n\t\tsetSelected: function (flag, opts) {\n\t\t\treturn this.tree._callHook(\"nodeSetSelected\", this, flag, opts);\n\t\t},\n\t\t/**Mark a lazy node as 'error', 'loading', 'nodata', or 'ok'.\n\t\t * @param {string} status 'error'|'loading'|'nodata'|'ok'\n\t\t * @param {string} [message]\n\t\t * @param {string} [details]\n\t\t */\n\t\tsetStatus: function (status, message, details) {\n\t\t\treturn this.tree._callHook(\n\t\t\t\t\"nodeSetStatus\",\n\t\t\t\tthis,\n\t\t\t\tstatus,\n\t\t\t\tmessage,\n\t\t\t\tdetails\n\t\t\t);\n\t\t},\n\t\t/**Rename this node.\n\t\t * @param {string} title\n\t\t */\n\t\tsetTitle: function (title) {\n\t\t\tthis.title = title;\n\t\t\tthis.renderTitle();\n\t\t\tthis.triggerModify(\"rename\");\n\t\t},\n\t\t/**Sort child list by title.\n\t\t * @param {function} [cmp] custom compare function(a, b) that returns -1, 0, or 1 (defaults to sort by title).\n\t\t * @param {boolean} [deep=false] pass true to sort all descendant nodes\n\t\t */\n\t\tsortChildren: function (cmp, deep) {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tcl = this.children;\n\n\t\t\tif (!cl) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcmp =\n\t\t\t\tcmp ||\n\t\t\t\tfunction (a, b) {\n\t\t\t\t\tvar x = a.title.toLowerCase(),\n\t\t\t\t\t\ty = b.title.toLowerCase();\n\n\t\t\t\t\t// eslint-disable-next-line no-nested-ternary\n\t\t\t\t\treturn x === y ? 0 : x > y ? 1 : -1;\n\t\t\t\t};\n\t\t\tcl.sort(cmp);\n\t\t\tif (deep) {\n\t\t\t\tfor (i = 0, l = cl.length; i < l; i++) {\n\t\t\t\t\tif (cl[i].children) {\n\t\t\t\t\t\tcl[i].sortChildren(cmp, \"$norender$\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (deep !== \"$norender$\") {\n\t\t\t\tthis.render();\n\t\t\t}\n\t\t\tthis.triggerModifyChild(\"sort\");\n\t\t},\n\t\t/** Convert node (or whole branch) into a plain object.\n\t\t *\n\t\t * The result is compatible with node.addChildren().\n\t\t *\n\t\t * @param {boolean} [recursive=false] include child nodes\n\t\t * @param {function} [callback] callback(dict, node) is called for every node, in order to allow modifications.\n\t\t * Return `false` to ignore this node or `\"skip\"` to include this node without its children.\n\t\t * @returns {NodeData}\n\t\t */\n\t\ttoDict: function (recursive, callback) {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tnode,\n\t\t\t\tres,\n\t\t\t\tdict = {},\n\t\t\t\tself = this;\n\n\t\t\t$.each(NODE_ATTRS, function (i, a) {\n\t\t\t\tif (self[a] || self[a] === false) {\n\t\t\t\t\tdict[a] = self[a];\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (!$.isEmptyObject(this.data)) {\n\t\t\t\tdict.data = $.extend({}, this.data);\n\t\t\t\tif ($.isEmptyObject(dict.data)) {\n\t\t\t\t\tdelete dict.data;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (callback) {\n\t\t\t\tres = callback(dict, self);\n\t\t\t\tif (res === false) {\n\t\t\t\t\treturn false; // Don't include this node nor its children\n\t\t\t\t}\n\t\t\t\tif (res === \"skip\") {\n\t\t\t\t\trecursive = false; // Include this node, but not the children\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (recursive) {\n\t\t\t\tif (_isArray(this.children)) {\n\t\t\t\t\tdict.children = [];\n\t\t\t\t\tfor (i = 0, l = this.children.length; i < l; i++) {\n\t\t\t\t\t\tnode = this.children[i];\n\t\t\t\t\t\tif (!node.isStatusNode()) {\n\t\t\t\t\t\t\tres = node.toDict(true, callback);\n\t\t\t\t\t\t\tif (res !== false) {\n\t\t\t\t\t\t\t\tdict.children.push(res);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dict;\n\t\t},\n\t\t/**\n\t\t * Set, clear, or toggle class of node's span tag and .extraClasses.\n\t\t *\n\t\t * @param {string} className class name (separate multiple classes by space)\n\t\t * @param {boolean} [flag] true/false to add/remove class. If omitted, class is toggled.\n\t\t * @returns {boolean} true if a class was added\n\t\t *\n\t\t * @since 2.17\n\t\t */\n\t\ttoggleClass: function (value, flag) {\n\t\t\tvar className,\n\t\t\t\thasClass,\n\t\t\t\trnotwhite = /\\S+/g,\n\t\t\t\tclassNames = value.match(rnotwhite) || [],\n\t\t\t\ti = 0,\n\t\t\t\twasAdded = false,\n\t\t\t\tstatusElem = this[this.tree.statusClassPropName],\n\t\t\t\tcurClasses = \" \" + (this.extraClasses || \"\") + \" \";\n\n\t\t\t// this.info(\"toggleClass('\" + value + \"', \" + flag + \")\", curClasses);\n\t\t\t// Modify DOM element directly if it already exists\n\t\t\tif (statusElem) {\n\t\t\t\t$(statusElem).toggleClass(value, flag);\n\t\t\t}\n\t\t\t// Modify node.extraClasses to make this change persistent\n\t\t\t// Toggle if flag was not passed\n\t\t\twhile ((className = classNames[i++])) {\n\t\t\t\thasClass = curClasses.indexOf(\" \" + className + \" \") >= 0;\n\t\t\t\tflag = flag === undefined ? !hasClass : !!flag;\n\t\t\t\tif (flag) {\n\t\t\t\t\tif (!hasClass) {\n\t\t\t\t\t\tcurClasses += className + \" \";\n\t\t\t\t\t\twasAdded = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twhile (curClasses.indexOf(\" \" + className + \" \") > -1) {\n\t\t\t\t\t\tcurClasses = curClasses.replace(\n\t\t\t\t\t\t\t\" \" + className + \" \",\n\t\t\t\t\t\t\t\" \"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.extraClasses = _trim(curClasses);\n\t\t\t// this.info(\"-> toggleClass('\" + value + \"', \" + flag + \"): '\" + this.extraClasses + \"'\");\n\t\t\treturn wasAdded;\n\t\t},\n\t\t/** Flip expanded status. */\n\t\ttoggleExpanded: function () {\n\t\t\treturn this.tree._callHook(\"nodeToggleExpanded\", this);\n\t\t},\n\t\t/** Flip selection status. */\n\t\ttoggleSelected: function () {\n\t\t\treturn this.tree._callHook(\"nodeToggleSelected\", this);\n\t\t},\n\t\ttoString: function () {\n\t\t\treturn \"FancytreeNode@\" + this.key + \"[title='\" + this.title + \"']\";\n\t\t\t// return \"<FancytreeNode(#\" + this.key + \", '\" + this.title + \"')>\";\n\t\t},\n\t\t/**\n\t\t * Trigger `modifyChild` event on a parent to signal that a child was modified.\n\t\t * @param {string} operation Type of change: 'add', 'remove', 'rename', 'move', 'data', ...\n\t\t * @param {FancytreeNode} [childNode]\n\t\t * @param {object} [extra]\n\t\t */\n\t\ttriggerModifyChild: function (operation, childNode, extra) {\n\t\t\tvar data,\n\t\t\t\tmodifyChild = this.tree.options.modifyChild;\n\n\t\t\tif (modifyChild) {\n\t\t\t\tif (childNode && childNode.parent !== this) {\n\t\t\t\t\t$.error(\n\t\t\t\t\t\t\"childNode \" + childNode + \" is not a child of \" + this\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tdata = {\n\t\t\t\t\tnode: this,\n\t\t\t\t\ttree: this.tree,\n\t\t\t\t\toperation: operation,\n\t\t\t\t\tchildNode: childNode || null,\n\t\t\t\t};\n\t\t\t\tif (extra) {\n\t\t\t\t\t$.extend(data, extra);\n\t\t\t\t}\n\t\t\t\tmodifyChild({ type: \"modifyChild\" }, data);\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Trigger `modifyChild` event on node.parent(!).\n\t\t * @param {string} operation Type of change: 'add', 'remove', 'rename', 'move', 'data', ...\n\t\t * @param {object} [extra]\n\t\t */\n\t\ttriggerModify: function (operation, extra) {\n\t\t\tthis.parent.triggerModifyChild(operation, this, extra);\n\t\t},\n\t\t/** Call fn(node) for all child nodes in hierarchical order (depth-first).<br>\n\t\t * Stop iteration, if fn() returns false. Skip current branch, if fn() returns \"skip\".<br>\n\t\t * Return false if iteration was stopped.\n\t\t *\n\t\t * @param {function} fn the callback function.\n\t\t * Return false to stop iteration, return \"skip\" to skip this node and\n\t\t * its children only.\n\t\t * @param {boolean} [includeSelf=false]\n\t\t * @returns {boolean}\n\t\t */\n\t\tvisit: function (fn, includeSelf) {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tres = true,\n\t\t\t\tchildren = this.children;\n\n\t\t\tif (includeSelf === true) {\n\t\t\t\tres = fn(this);\n\t\t\t\tif (res === false || res === \"skip\") {\n\t\t\t\t\treturn res;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (children) {\n\t\t\t\tfor (i = 0, l = children.length; i < l; i++) {\n\t\t\t\t\tres = children[i].visit(fn, true);\n\t\t\t\t\tif (res === false) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t/** Call fn(node) for all child nodes and recursively load lazy children.<br>\n\t\t * <b>Note:</b> If you need this method, you probably should consider to review\n\t\t * your architecture! Recursivley loading nodes is a perfect way for lazy\n\t\t * programmers to flood the server with requests ;-)\n\t\t *\n\t\t * @param {function} [fn] optional callback function.\n\t\t * Return false to stop iteration, return \"skip\" to skip this node and\n\t\t * its children only.\n\t\t * @param {boolean} [includeSelf=false]\n\t\t * @returns {$.Promise}\n\t\t * @since 2.4\n\t\t */\n\t\tvisitAndLoad: function (fn, includeSelf, _recursion) {\n\t\t\tvar dfd,\n\t\t\t\tres,\n\t\t\t\tloaders,\n\t\t\t\tnode = this;\n\n\t\t\t// node.debug(\"visitAndLoad\");\n\t\t\tif (fn && includeSelf === true) {\n\t\t\t\tres = fn(node);\n\t\t\t\tif (res === false || res === \"skip\") {\n\t\t\t\t\treturn _recursion ? res : _getResolvedPromise();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!node.children && !node.lazy) {\n\t\t\t\treturn _getResolvedPromise();\n\t\t\t}\n\t\t\tdfd = new $.Deferred();\n\t\t\tloaders = [];\n\t\t\t// node.debug(\"load()...\");\n\t\t\tnode.load().done(function () {\n\t\t\t\t// node.debug(\"load()... done.\");\n\t\t\t\tfor (var i = 0, l = node.children.length; i < l; i++) {\n\t\t\t\t\tres = node.children[i].visitAndLoad(fn, true, true);\n\t\t\t\t\tif (res === false) {\n\t\t\t\t\t\tdfd.reject();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (res !== \"skip\") {\n\t\t\t\t\t\tloaders.push(res); // Add promise to the list\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$.when.apply(this, loaders).then(function () {\n\t\t\t\t\tdfd.resolve();\n\t\t\t\t});\n\t\t\t});\n\t\t\treturn dfd.promise();\n\t\t},\n\t\t/** Call fn(node) for all parent nodes, bottom-up, including invisible system root.<br>\n\t\t * Stop iteration, if fn() returns false.<br>\n\t\t * Return false if iteration was stopped.\n\t\t *\n\t\t * @param {function} fn the callback function.\n\t\t * Return false to stop iteration, return \"skip\" to skip this node and children only.\n\t\t * @param {boolean} [includeSelf=false]\n\t\t * @returns {boolean}\n\t\t */\n\t\tvisitParents: function (fn, includeSelf) {\n\t\t\t// Visit parent nodes (bottom up)\n\t\t\tif (includeSelf && fn(this) === false) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar p = this.parent;\n\t\t\twhile (p) {\n\t\t\t\tif (fn(p) === false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tp = p.parent;\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\t/** Call fn(node) for all sibling nodes.<br>\n\t\t * Stop iteration, if fn() returns false.<br>\n\t\t * Return false if iteration was stopped.\n\t\t *\n\t\t * @param {function} fn the callback function.\n\t\t * Return false to stop iteration.\n\t\t * @param {boolean} [includeSelf=false]\n\t\t * @returns {boolean}\n\t\t */\n\t\tvisitSiblings: function (fn, includeSelf) {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tn,\n\t\t\t\tac = this.parent.children;\n\n\t\t\tfor (i = 0, l = ac.length; i < l; i++) {\n\t\t\t\tn = ac[i];\n\t\t\t\tif (includeSelf || n !== this) {\n\t\t\t\t\tif (fn(n) === false) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\t/** Write warning to browser console if debugLevel >= 2 (prepending node info)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\twarn: function (msg) {\n\t\t\tif (this.tree.options.debugLevel >= 2) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"warn\", arguments);\n\t\t\t}\n\t\t},\n\t};\n\n\t/******************************************************************************\n\t * Fancytree\n\t */\n\t/**\n\t * Construct a new tree object.\n\t *\n\t * @class Fancytree\n\t * @classdesc The controller behind a fancytree.\n\t * This class also contains 'hook methods': see {@link Fancytree_Hooks}.\n\t *\n\t * @param {Widget} widget\n\t *\n\t * @property {string} _id Automatically generated unique tree instance ID, e.g. \"1\".\n\t * @property {string} _ns Automatically generated unique tree namespace, e.g. \".fancytree-1\".\n\t * @property {FancytreeNode} activeNode Currently active node or null.\n\t * @property {string} ariaPropName Property name of FancytreeNode that contains the element which will receive the aria attributes.\n\t * Typically \"li\", but \"tr\" for table extension.\n\t * @property {jQueryObject} $container Outer `<ul>` element (or `<table>` element for ext-table).\n\t * @property {jQueryObject} $div A jQuery object containing the element used to instantiate the tree widget (`widget.element`)\n\t * @property {object|array} columns Recommended place to store shared column meta data. @since 2.27\n\t * @property {object} data Metadata, i.e. properties that may be passed to `source` in addition to a children array.\n\t * @property {object} ext Hash of all active plugin instances.\n\t * @property {FancytreeNode} focusNode Currently focused node or null.\n\t * @property {FancytreeNode} lastSelectedNode Used to implement selectMode 1 (single select)\n\t * @property {string} nodeContainerAttrName Property name of FancytreeNode that contains the outer element of single nodes.\n\t * Typically \"li\", but \"tr\" for table extension.\n\t * @property {FancytreeOptions} options Current options, i.e. default options + options passed to constructor.\n\t * @property {FancytreeNode} rootNode Invisible system root node.\n\t * @property {string} statusClassPropName Property name of FancytreeNode that contains the element which will receive the status classes.\n\t * Typically \"span\", but \"tr\" for table extension.\n\t * @property {object} types Map for shared type specific meta data, used with node.type attribute. @since 2.27\n\t * @property {object} viewport See ext-vieport. @since v2.31\n\t * @property {object} widget Base widget instance.\n\t */\n\tfunction Fancytree(widget) {\n\t\tthis.widget = widget;\n\t\tthis.$div = widget.element;\n\t\tthis.options = widget.options;\n\t\tif (this.options) {\n\t\t\tif (this.options.lazyload !== undefined) {\n\t\t\t\t$.error(\n\t\t\t\t\t\"The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead.\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.options.loaderror !== undefined) {\n\t\t\t\t$.error(\n\t\t\t\t\t\"The 'loaderror' event was renamed since 2014-07-03. Use 'loadError' (with uppercase E) instead.\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.options.fx !== undefined) {\n\t\t\t\t$.error(\n\t\t\t\t\t\"The 'fx' option was replaced by 'toggleEffect' since 2014-11-30.\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.options.removeNode !== undefined) {\n\t\t\t\t$.error(\n\t\t\t\t\t\"The 'removeNode' event was replaced by 'modifyChild' since 2.20 (2016-09-10).\"\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthis.ext = {}; // Active extension instances\n\t\tthis.types = {};\n\t\tthis.columns = {};\n\t\t// allow to init tree.data.foo from <div data-foo=''>\n\t\tthis.data = _getElementDataAsDict(this.$div);\n\t\t// TODO: use widget.uuid instead?\n\t\tthis._id = \"\" + (this.options.treeId || $.ui.fancytree._nextId++);\n\t\t// TODO: use widget.eventNamespace instead?\n\t\tthis._ns = \".fancytree-\" + this._id; // append for namespaced events\n\t\tthis.activeNode = null;\n\t\tthis.focusNode = null;\n\t\tthis._hasFocus = null;\n\t\tthis._tempCache = {};\n\t\tthis._lastMousedownNode = null;\n\t\tthis._enableUpdate = true;\n\t\tthis.lastSelectedNode = null;\n\t\tthis.systemFocusElement = null;\n\t\tthis.lastQuicksearchTerm = \"\";\n\t\tthis.lastQuicksearchTime = 0;\n\t\tthis.viewport = null; // ext-grid\n\n\t\tthis.statusClassPropName = \"span\";\n\t\tthis.ariaPropName = \"li\";\n\t\tthis.nodeContainerAttrName = \"li\";\n\n\t\t// Remove previous markup if any\n\t\tthis.$div.find(\">ul.fancytree-container\").remove();\n\n\t\t// Create a node without parent.\n\t\tvar fakeParent = { tree: this },\n\t\t\t$ul;\n\t\tthis.rootNode = new FancytreeNode(fakeParent, {\n\t\t\ttitle: \"root\",\n\t\t\tkey: \"root_\" + this._id,\n\t\t\tchildren: null,\n\t\t\texpanded: true,\n\t\t});\n\t\tthis.rootNode.parent = null;\n\n\t\t// Create root markup\n\t\t$ul = $(\"<ul>\", {\n\t\t\tid: \"ft-id-\" + this._id,\n\t\t\tclass: \"ui-fancytree fancytree-container fancytree-plain\",\n\t\t}).appendTo(this.$div);\n\t\tthis.$container = $ul;\n\t\tthis.rootNode.ul = $ul[0];\n\n\t\tif (this.options.debugLevel == null) {\n\t\t\tthis.options.debugLevel = FT.debugLevel;\n\t\t}\n\t\t// // Add container to the TAB chain\n\t\t// // See http://www.w3.org/TR/wai-aria-practices/#focus_activedescendant\n\t\t// // #577: Allow to set tabindex to \"0\", \"-1\" and \"\"\n\t\t// this.$container.attr(\"tabindex\", this.options.tabindex);\n\n\t\t// if( this.options.rtl ) {\n\t\t// \tthis.$container.attr(\"DIR\", \"RTL\").addClass(\"fancytree-rtl\");\n\t\t// // }else{\n\t\t// //\tthis.$container.attr(\"DIR\", null).removeClass(\"fancytree-rtl\");\n\t\t// }\n\t\t// if(this.options.aria){\n\t\t// \tthis.$container.attr(\"role\", \"tree\");\n\t\t// \tif( this.options.selectMode !== 1 ) {\n\t\t// \t\tthis.$container.attr(\"aria-multiselectable\", true);\n\t\t// \t}\n\t\t// }\n\t}\n\n\tFancytree.prototype = /** @lends Fancytree# */ {\n\t\t/* Return a context object that can be re-used for _callHook().\n\t\t * @param {Fancytree | FancytreeNode | EventData} obj\n\t\t * @param {Event} originalEvent\n\t\t * @param {Object} extra\n\t\t * @returns {EventData}\n\t\t */\n\t\t_makeHookContext: function (obj, originalEvent, extra) {\n\t\t\tvar ctx, tree;\n\t\t\tif (obj.node !== undefined) {\n\t\t\t\t// obj is already a context object\n\t\t\t\tif (originalEvent && obj.originalEvent !== originalEvent) {\n\t\t\t\t\t$.error(\"invalid args\");\n\t\t\t\t}\n\t\t\t\tctx = obj;\n\t\t\t} else if (obj.tree) {\n\t\t\t\t// obj is a FancytreeNode\n\t\t\t\ttree = obj.tree;\n\t\t\t\tctx = {\n\t\t\t\t\tnode: obj,\n\t\t\t\t\ttree: tree,\n\t\t\t\t\twidget: tree.widget,\n\t\t\t\t\toptions: tree.widget.options,\n\t\t\t\t\toriginalEvent: originalEvent,\n\t\t\t\t\ttypeInfo: tree.types[obj.type] || {},\n\t\t\t\t};\n\t\t\t} else if (obj.widget) {\n\t\t\t\t// obj is a Fancytree\n\t\t\t\tctx = {\n\t\t\t\t\tnode: null,\n\t\t\t\t\ttree: obj,\n\t\t\t\t\twidget: obj.widget,\n\t\t\t\t\toptions: obj.widget.options,\n\t\t\t\t\toriginalEvent: originalEvent,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t$.error(\"invalid args\");\n\t\t\t}\n\t\t\tif (extra) {\n\t\t\t\t$.extend(ctx, extra);\n\t\t\t}\n\t\t\treturn ctx;\n\t\t},\n\t\t/* Trigger a hook function: funcName(ctx, [...]).\n\t\t *\n\t\t * @param {string} funcName\n\t\t * @param {Fancytree|FancytreeNode|EventData} contextObject\n\t\t * @param {any} [_extraArgs] optional additional arguments\n\t\t * @returns {any}\n\t\t */\n\t\t_callHook: function (funcName, contextObject, _extraArgs) {\n\t\t\tvar ctx = this._makeHookContext(contextObject),\n\t\t\t\tfn = this[funcName],\n\t\t\t\targs = Array.prototype.slice.call(arguments, 2);\n\t\t\tif (!_isFunction(fn)) {\n\t\t\t\t$.error(\"_callHook('\" + funcName + \"') is not a function\");\n\t\t\t}\n\t\t\targs.unshift(ctx);\n\t\t\t// this.debug(\"_hook\", funcName, ctx.node && ctx.node.toString() || ctx.tree.toString(), args);\n\t\t\treturn fn.apply(this, args);\n\t\t},\n\t\t_setExpiringValue: function (key, value, ms) {\n\t\t\tthis._tempCache[key] = {\n\t\t\t\tvalue: value,\n\t\t\t\texpire: Date.now() + (+ms || 50),\n\t\t\t};\n\t\t},\n\t\t_getExpiringValue: function (key) {\n\t\t\tvar entry = this._tempCache[key];\n\t\t\tif (entry && entry.expire > Date.now()) {\n\t\t\t\treturn entry.value;\n\t\t\t}\n\t\t\tdelete this._tempCache[key];\n\t\t\treturn null;\n\t\t},\n\t\t/* Check if this tree has extension `name` enabled.\n\t\t *\n\t\t * @param {string} name name of the required extension\n\t\t */\n\t\t_usesExtension: function (name) {\n\t\t\treturn $.inArray(name, this.options.extensions) >= 0;\n\t\t},\n\t\t/* Check if current extensions dependencies are met and throw an error if not.\n\t\t *\n\t\t * This method may be called inside the `treeInit` hook for custom extensions.\n\t\t *\n\t\t * @param {string} name name of the required extension\n\t\t * @param {boolean} [required=true] pass `false` if the extension is optional, but we want to check for order if it is present\n\t\t * @param {boolean} [before] `true` if `name` must be included before this, `false` otherwise (use `null` if order doesn't matter)\n\t\t * @param {string} [message] optional error message (defaults to a descriptve error message)\n\t\t */\n\t\t_requireExtension: function (name, required, before, message) {\n\t\t\tif (before != null) {\n\t\t\t\tbefore = !!before;\n\t\t\t}\n\t\t\tvar thisName = this._local.name,\n\t\t\t\textList = this.options.extensions,\n\t\t\t\tisBefore =\n\t\t\t\t\t$.inArray(name, extList) < $.inArray(thisName, extList),\n\t\t\t\tisMissing = required && this.ext[name] == null,\n\t\t\t\tbadOrder = !isMissing && before != null && before !== isBefore;\n\n\t\t\t_assert(\n\t\t\t\tthisName && thisName !== name,\n\t\t\t\t\"invalid or same name '\" + thisName + \"' (require yourself?)\"\n\t\t\t);\n\n\t\t\tif (isMissing || badOrder) {\n\t\t\t\tif (!message) {\n\t\t\t\t\tif (isMissing || required) {\n\t\t\t\t\t\tmessage =\n\t\t\t\t\t\t\t\"'\" +\n\t\t\t\t\t\t\tthisName +\n\t\t\t\t\t\t\t\"' extension requires '\" +\n\t\t\t\t\t\t\tname +\n\t\t\t\t\t\t\t\"'\";\n\t\t\t\t\t\tif (badOrder) {\n\t\t\t\t\t\t\tmessage +=\n\t\t\t\t\t\t\t\t\" to be registered \" +\n\t\t\t\t\t\t\t\t(before ? \"before\" : \"after\") +\n\t\t\t\t\t\t\t\t\" itself\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmessage =\n\t\t\t\t\t\t\t\"If used together, `\" +\n\t\t\t\t\t\t\tname +\n\t\t\t\t\t\t\t\"` must be registered \" +\n\t\t\t\t\t\t\t(before ? \"before\" : \"after\") +\n\t\t\t\t\t\t\t\" `\" +\n\t\t\t\t\t\t\tthisName +\n\t\t\t\t\t\t\t\"`\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$.error(message);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\t/** Activate node with a given key and fire focus and activate events.\n\t\t *\n\t\t * A previously activated node will be deactivated.\n\t\t * If activeVisible option is set, all parents will be expanded as necessary.\n\t\t * Pass key = false, to deactivate the current node only.\n\t\t * @param {string} key\n\t\t * @param {object} [opts] additional options. Defaults to {noEvents: false, noFocus: false}\n\t\t * @returns {FancytreeNode} activated node (null, if not found)\n\t\t */\n\t\tactivateKey: function (key, opts) {\n\t\t\tvar node = this.getNodeByKey(key);\n\t\t\tif (node) {\n\t\t\t\tnode.setActive(true, opts);\n\t\t\t} else if (this.activeNode) {\n\t\t\t\tthis.activeNode.setActive(false, opts);\n\t\t\t}\n\t\t\treturn node;\n\t\t},\n\t\t/** (experimental) Add child status nodes that indicate 'More...', ....\n\t\t * @param {boolean|object} node optional node definition. Pass `false` to remove all paging nodes.\n\t\t * @param {string} [mode='append'] 'child'|firstChild'\n\t\t * @since 2.15\n\t\t */\n\t\taddPagingNode: function (node, mode) {\n\t\t\treturn this.rootNode.addPagingNode(node, mode);\n\t\t},\n\t\t/**\n\t\t * (experimental) Apply a modification (or navigation) operation.\n\t\t *\n\t\t * Valid commands:\n\t\t * - 'moveUp', 'moveDown'\n\t\t * - 'indent', 'outdent'\n\t\t * - 'remove'\n\t\t * - 'edit', 'addChild', 'addSibling': (reqires ext-edit extension)\n\t\t * - 'cut', 'copy', 'paste': (use an internal singleton 'clipboard')\n\t\t * - 'down', 'first', 'last', 'left', 'parent', 'right', 'up': navigate\n\t\t *\n\t\t * @param {string} cmd\n\t\t * @param {FancytreeNode} [node=active_node]\n\t\t * @param {object} [opts] Currently unused\n\t\t *\n\t\t * @since 2.32\n\t\t */\n\t\tapplyCommand: function (cmd, node, opts_) {\n\t\t\tvar // clipboard,\n\t\t\t\trefNode;\n\t\t\t// opts = $.extend(\n\t\t\t// \t{ setActive: true, clipboard: CLIPBOARD },\n\t\t\t// \topts_\n\t\t\t// );\n\n\t\t\tnode = node || this.getActiveNode();\n\t\t\t// clipboard = opts.clipboard;\n\n\t\t\tswitch (cmd) {\n\t\t\t\t// Sorting and indentation:\n\t\t\t\tcase \"moveUp\":\n\t\t\t\t\trefNode = node.getPrevSibling();\n\t\t\t\t\tif (refNode) {\n\t\t\t\t\t\tnode.moveTo(refNode, \"before\");\n\t\t\t\t\t\tnode.setActive();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"moveDown\":\n\t\t\t\t\trefNode = node.getNextSibling();\n\t\t\t\t\tif (refNode) {\n\t\t\t\t\t\tnode.moveTo(refNode, \"after\");\n\t\t\t\t\t\tnode.setActive();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"indent\":\n\t\t\t\t\trefNode = node.getPrevSibling();\n\t\t\t\t\tif (refNode) {\n\t\t\t\t\t\tnode.moveTo(refNode, \"child\");\n\t\t\t\t\t\trefNode.setExpanded();\n\t\t\t\t\t\tnode.setActive();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"outdent\":\n\t\t\t\t\tif (!node.isTopLevel()) {\n\t\t\t\t\t\tnode.moveTo(node.getParent(), \"after\");\n\t\t\t\t\t\tnode.setActive();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Remove:\n\t\t\t\tcase \"remove\":\n\t\t\t\t\trefNode = node.getPrevSibling() || node.getParent();\n\t\t\t\t\tnode.remove();\n\t\t\t\t\tif (refNode) {\n\t\t\t\t\t\trefNode.setActive();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Add, edit (requires ext-edit):\n\t\t\t\tcase \"addChild\":\n\t\t\t\t\tnode.editCreateNode(\"child\", \"\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"addSibling\":\n\t\t\t\t\tnode.editCreateNode(\"after\", \"\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"rename\":\n\t\t\t\t\tnode.editStart();\n\t\t\t\t\tbreak;\n\t\t\t\t// Simple clipboard simulation:\n\t\t\t\t// case \"cut\":\n\t\t\t\t// \tclipboard = { mode: cmd, data: node };\n\t\t\t\t// \tbreak;\n\t\t\t\t// case \"copy\":\n\t\t\t\t// \tclipboard = {\n\t\t\t\t// \t\tmode: cmd,\n\t\t\t\t// \t\tdata: node.toDict(function(d, n) {\n\t\t\t\t// \t\t\tdelete d.key;\n\t\t\t\t// \t\t}),\n\t\t\t\t// \t};\n\t\t\t\t// \tbreak;\n\t\t\t\t// case \"clear\":\n\t\t\t\t// \tclipboard = null;\n\t\t\t\t// \tbreak;\n\t\t\t\t// case \"paste\":\n\t\t\t\t// \tif (clipboard.mode === \"cut\") {\n\t\t\t\t// \t\t// refNode = node.getPrevSibling();\n\t\t\t\t// \t\tclipboard.data.moveTo(node, \"child\");\n\t\t\t\t// \t\tclipboard.data.setActive();\n\t\t\t\t// \t} else if (clipboard.mode === \"copy\") {\n\t\t\t\t// \t\tnode.addChildren(clipboard.data).setActive();\n\t\t\t\t// \t}\n\t\t\t\t// \tbreak;\n\t\t\t\t// Navigation commands:\n\t\t\t\tcase \"down\":\n\t\t\t\tcase \"first\":\n\t\t\t\tcase \"last\":\n\t\t\t\tcase \"left\":\n\t\t\t\tcase \"parent\":\n\t\t\t\tcase \"right\":\n\t\t\t\tcase \"up\":\n\t\t\t\t\treturn node.navigate(cmd);\n\t\t\t\tdefault:\n\t\t\t\t\t$.error(\"Unhandled command: '\" + cmd + \"'\");\n\t\t\t}\n\t\t},\n\t\t/** (experimental) Modify existing data model.\n\t\t *\n\t\t * @param {Array} patchList array of [key, NodePatch] arrays\n\t\t * @returns {$.Promise} resolved, when all patches have been applied\n\t\t * @see TreePatch\n\t\t */\n\t\tapplyPatch: function (patchList) {\n\t\t\tvar dfd,\n\t\t\t\ti,\n\t\t\t\tp2,\n\t\t\t\tkey,\n\t\t\t\tpatch,\n\t\t\t\tnode,\n\t\t\t\tpatchCount = patchList.length,\n\t\t\t\tdeferredList = [];\n\n\t\t\tfor (i = 0; i < patchCount; i++) {\n\t\t\t\tp2 = patchList[i];\n\t\t\t\t_assert(\n\t\t\t\t\tp2.length === 2,\n\t\t\t\t\t\"patchList must be an array of length-2-arrays\"\n\t\t\t\t);\n\t\t\t\tkey = p2[0];\n\t\t\t\tpatch = p2[1];\n\t\t\t\tnode = key === null ? this.rootNode : this.getNodeByKey(key);\n\t\t\t\tif (node) {\n\t\t\t\t\tdfd = new $.Deferred();\n\t\t\t\t\tdeferredList.push(dfd);\n\t\t\t\t\tnode.applyPatch(patch).always(_makeResolveFunc(dfd, node));\n\t\t\t\t} else {\n\t\t\t\t\tthis.warn(\"could not find node with key '\" + key + \"'\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Return a promise that is resolved, when ALL patches were applied\n\t\t\treturn $.when.apply($, deferredList).promise();\n\t\t},\n\t\t/* TODO: implement in dnd extension\n\t\tcancelDrag: function() {\n\t\t\t\tvar dd = $.ui.ddmanager.current;\n\t\t\t\tif(dd){\n\t\t\t\t\tdd.cancel();\n\t\t\t\t}\n\t\t\t},\n\t\t*/\n\t\t/** Remove all nodes.\n\t\t * @since 2.14\n\t\t */\n\t\tclear: function (source) {\n\t\t\tthis._callHook(\"treeClear\", this);\n\t\t},\n\t\t/** Return the number of nodes.\n\t\t * @returns {integer}\n\t\t */\n\t\tcount: function () {\n\t\t\treturn this.rootNode.countChildren();\n\t\t},\n\t\t/** Write to browser console if debugLevel >= 4 (prepending tree name)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\tdebug: function (msg) {\n\t\t\tif (this.options.debugLevel >= 4) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"log\", arguments);\n\t\t\t}\n\t\t},\n\t\t/** Destroy this widget, restore previous markup and cleanup resources.\n\t\t *\n\t\t * @since 2.34\n\t\t */\n\t\tdestroy: function () {\n\t\t\tthis.widget.destroy();\n\t\t},\n\t\t/** Enable (or disable) the tree control.\n\t\t *\n\t\t * @param {boolean} [flag=true] pass false to disable\n\t\t * @since 2.30\n\t\t */\n\t\tenable: function (flag) {\n\t\t\tif (flag === false) {\n\t\t\t\tthis.widget.disable();\n\t\t\t} else {\n\t\t\t\tthis.widget.enable();\n\t\t\t}\n\t\t},\n\t\t/** Temporarily suppress rendering to improve performance on bulk-updates.\n\t\t *\n\t\t * @param {boolean} flag\n\t\t * @returns {boolean} previous status\n\t\t * @since 2.19\n\t\t */\n\t\tenableUpdate: function (flag) {\n\t\t\tflag = flag !== false;\n\t\t\tif (!!this._enableUpdate === !!flag) {\n\t\t\t\treturn flag;\n\t\t\t}\n\t\t\tthis._enableUpdate = flag;\n\t\t\tif (flag) {\n\t\t\t\tthis.debug(\"enableUpdate(true): redraw \"); //, this._dirtyRoots);\n\t\t\t\tthis._callHook(\"treeStructureChanged\", this, \"enableUpdate\");\n\t\t\t\tthis.render();\n\t\t\t} else {\n\t\t\t\t// \tthis._dirtyRoots = null;\n\t\t\t\tthis.debug(\"enableUpdate(false)...\");\n\t\t\t}\n\t\t\treturn !flag; // return previous value\n\t\t},\n\t\t/** Write error to browser console if debugLevel >= 1 (prepending tree info)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\terror: function (msg) {\n\t\t\tif (this.options.debugLevel >= 1) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"error\", arguments);\n\t\t\t}\n\t\t},\n\t\t/** Expand (or collapse) all parent nodes.\n\t\t *\n\t\t * This convenience method uses `tree.visit()` and `tree.setExpanded()`\n\t\t * internally.\n\t\t *\n\t\t * @param {boolean} [flag=true] pass false to collapse\n\t\t * @param {object} [opts] passed to setExpanded()\n\t\t * @since 2.30\n\t\t */\n\t\texpandAll: function (flag, opts) {\n\t\t\tvar prev = this.enableUpdate(false);\n\n\t\t\tflag = flag !== false;\n\t\t\tthis.visit(function (node) {\n\t\t\t\tif (\n\t\t\t\t\tnode.hasChildren() !== false &&\n\t\t\t\t\tnode.isExpanded() !== flag\n\t\t\t\t) {\n\t\t\t\t\tnode.setExpanded(flag, opts);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.enableUpdate(prev);\n\t\t},\n\t\t/**Find all nodes that matches condition.\n\t\t *\n\t\t * @param {string | function(node)} match title string to search for, or a\n\t\t * callback function that returns `true` if a node is matched.\n\t\t * @returns {FancytreeNode[]} array of nodes (may be empty)\n\t\t * @see FancytreeNode#findAll\n\t\t * @since 2.12\n\t\t */\n\t\tfindAll: function (match) {\n\t\t\treturn this.rootNode.findAll(match);\n\t\t},\n\t\t/**Find first node that matches condition.\n\t\t *\n\t\t * @param {string | function(node)} match title string to search for, or a\n\t\t * callback function that returns `true` if a node is matched.\n\t\t * @returns {FancytreeNode} matching node or null\n\t\t * @see FancytreeNode#findFirst\n\t\t * @since 2.12\n\t\t */\n\t\tfindFirst: function (match) {\n\t\t\treturn this.rootNode.findFirst(match);\n\t\t},\n\t\t/** Find the next visible node that starts with `match`, starting at `startNode`\n\t\t * and wrap-around at the end.\n\t\t *\n\t\t * @param {string|function} match\n\t\t * @param {FancytreeNode} [startNode] defaults to first node\n\t\t * @returns {FancytreeNode} matching node or null\n\t\t */\n\t\tfindNextNode: function (match, startNode) {\n\t\t\t//, visibleOnly) {\n\t\t\tvar res = null,\n\t\t\t\tfirstNode = this.getFirstChild();\n\n\t\t\tmatch =\n\t\t\t\ttypeof match === \"string\"\n\t\t\t\t\t? _makeNodeTitleStartMatcher(match)\n\t\t\t\t\t: match;\n\t\t\tstartNode = startNode || firstNode;\n\n\t\t\tfunction _checkNode(n) {\n\t\t\t\t// console.log(\"_check \" + n)\n\t\t\t\tif (match(n)) {\n\t\t\t\t\tres = n;\n\t\t\t\t}\n\t\t\t\tif (res || n === startNode) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.visitRows(_checkNode, {\n\t\t\t\tstart: startNode,\n\t\t\t\tincludeSelf: false,\n\t\t\t});\n\t\t\t// Wrap around search\n\t\t\tif (!res && startNode !== firstNode) {\n\t\t\t\tthis.visitRows(_checkNode, {\n\t\t\t\t\tstart: firstNode,\n\t\t\t\t\tincludeSelf: true,\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t/** Find a node relative to another node.\n\t\t *\n\t\t * @param {FancytreeNode} node\n\t\t * @param {string|number} where 'down', 'first', 'last', 'left', 'parent', 'right', or 'up'.\n\t\t * (Alternatively the keyCode that would normally trigger this move,\n\t\t * e.g. `$.ui.keyCode.LEFT` = 'left'.\n\t\t * @param {boolean} [includeHidden=false] Not yet implemented\n\t\t * @returns {FancytreeNode|null}\n\t\t * @since v2.31\n\t\t */\n\t\tfindRelatedNode: function (node, where, includeHidden) {\n\t\t\tvar res = null,\n\t\t\t\tKC = $.ui.keyCode;\n\n\t\t\tswitch (where) {\n\t\t\t\tcase \"parent\":\n\t\t\t\tcase KC.BACKSPACE:\n\t\t\t\t\tif (node.parent && node.parent.parent) {\n\t\t\t\t\t\tres = node.parent;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"first\":\n\t\t\t\tcase KC.HOME:\n\t\t\t\t\t// First visible node\n\t\t\t\t\tthis.visit(function (n) {\n\t\t\t\t\t\tif (n.isVisible()) {\n\t\t\t\t\t\t\tres = n;\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"last\":\n\t\t\t\tcase KC.END:\n\t\t\t\t\tthis.visit(function (n) {\n\t\t\t\t\t\t// last visible node\n\t\t\t\t\t\tif (n.isVisible()) {\n\t\t\t\t\t\t\tres = n;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"left\":\n\t\t\t\tcase KC.LEFT:\n\t\t\t\t\tif (node.expanded) {\n\t\t\t\t\t\tnode.setExpanded(false);\n\t\t\t\t\t} else if (node.parent && node.parent.parent) {\n\t\t\t\t\t\tres = node.parent;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"right\":\n\t\t\t\tcase KC.RIGHT:\n\t\t\t\t\tif (!node.expanded && (node.children || node.lazy)) {\n\t\t\t\t\t\tnode.setExpanded();\n\t\t\t\t\t\tres = node;\n\t\t\t\t\t} else if (node.children && node.children.length) {\n\t\t\t\t\t\tres = node.children[0];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"up\":\n\t\t\t\tcase KC.UP:\n\t\t\t\t\tthis.visitRows(\n\t\t\t\t\t\tfunction (n) {\n\t\t\t\t\t\t\tres = n;\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ start: node, reverse: true, includeSelf: false }\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"down\":\n\t\t\t\tcase KC.DOWN:\n\t\t\t\t\tthis.visitRows(\n\t\t\t\t\t\tfunction (n) {\n\t\t\t\t\t\t\tres = n;\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ start: node, includeSelf: false }\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthis.tree.warn(\"Unknown relation '\" + where + \"'.\");\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t// TODO: fromDict\n\t\t/**\n\t\t * Generate INPUT elements that can be submitted with html forms.\n\t\t *\n\t\t * In selectMode 3 only the topmost selected nodes are considered, unless\n\t\t * `opts.stopOnParents: false` is passed.\n\t\t *\n\t\t * @example\n\t\t * // Generate input elements for active and selected nodes\n\t\t * tree.generateFormElements();\n\t\t * // Generate input elements selected nodes, using a custom `name` attribute\n\t\t * tree.generateFormElements(\"cust_sel\", false);\n\t\t * // Generate input elements using a custom filter\n\t\t * tree.generateFormElements(true, true, { filter: function(node) {\n\t\t * return node.isSelected() && node.data.yes;\n\t\t * }});\n\t\t *\n\t\t * @param {boolean | string} [selected=true] Pass false to disable, pass a string to override the field name (default: 'ft_ID[]')\n\t\t * @param {boolean | string} [active=true] Pass false to disable, pass a string to override the field name (default: 'ft_ID_active')\n\t\t * @param {object} [opts] default { filter: null, stopOnParents: true }\n\t\t */\n\t\tgenerateFormElements: function (selected, active, opts) {\n\t\t\topts = opts || {};\n\n\t\t\tvar nodeList,\n\t\t\t\tselectedName =\n\t\t\t\t\ttypeof selected === \"string\"\n\t\t\t\t\t\t? selected\n\t\t\t\t\t\t: \"ft_\" + this._id + \"[]\",\n\t\t\t\tactiveName =\n\t\t\t\t\ttypeof active === \"string\"\n\t\t\t\t\t\t? active\n\t\t\t\t\t\t: \"ft_\" + this._id + \"_active\",\n\t\t\t\tid = \"fancytree_result_\" + this._id,\n\t\t\t\t$result = $(\"#\" + id),\n\t\t\t\tstopOnParents =\n\t\t\t\t\tthis.options.selectMode === 3 &&\n\t\t\t\t\topts.stopOnParents !== false;\n\n\t\t\tif ($result.length) {\n\t\t\t\t$result.empty();\n\t\t\t} else {\n\t\t\t\t$result = $(\"<div>\", {\n\t\t\t\t\tid: id,\n\t\t\t\t})\n\t\t\t\t\t.hide()\n\t\t\t\t\t.insertAfter(this.$container);\n\t\t\t}\n\t\t\tif (active !== false && this.activeNode) {\n\t\t\t\t$result.append(\n\t\t\t\t\t$(\"<input>\", {\n\t\t\t\t\t\ttype: \"radio\",\n\t\t\t\t\t\tname: activeName,\n\t\t\t\t\t\tvalue: this.activeNode.key,\n\t\t\t\t\t\tchecked: true,\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\t\t\tfunction _appender(node) {\n\t\t\t\t$result.append(\n\t\t\t\t\t$(\"<input>\", {\n\t\t\t\t\t\ttype: \"checkbox\",\n\t\t\t\t\t\tname: selectedName,\n\t\t\t\t\t\tvalue: node.key,\n\t\t\t\t\t\tchecked: true,\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (opts.filter) {\n\t\t\t\tthis.visit(function (node) {\n\t\t\t\t\tvar res = opts.filter(node);\n\t\t\t\t\tif (res === \"skip\") {\n\t\t\t\t\t\treturn res;\n\t\t\t\t\t}\n\t\t\t\t\tif (res !== false) {\n\t\t\t\t\t\t_appender(node);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (selected !== false) {\n\t\t\t\tnodeList = this.getSelectedNodes(stopOnParents);\n\t\t\t\t$.each(nodeList, function (idx, node) {\n\t\t\t\t\t_appender(node);\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Return the currently active node or null.\n\t\t * @returns {FancytreeNode}\n\t\t */\n\t\tgetActiveNode: function () {\n\t\t\treturn this.activeNode;\n\t\t},\n\t\t/** Return the first top level node if any (not the invisible root node).\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetFirstChild: function () {\n\t\t\treturn this.rootNode.getFirstChild();\n\t\t},\n\t\t/**\n\t\t * Return node that has keyboard focus or null.\n\t\t * @returns {FancytreeNode}\n\t\t */\n\t\tgetFocusNode: function () {\n\t\t\treturn this.focusNode;\n\t\t},\n\t\t/**\n\t\t * Return current option value.\n\t\t * (Note: this is the preferred variant of `$().fancytree(\"option\", \"KEY\")`)\n\t\t *\n\t\t * @param {string} name option name (may contain '.')\n\t\t * @returns {any}\n\t\t */\n\t\tgetOption: function (optionName) {\n\t\t\treturn this.widget.option(optionName);\n\t\t},\n\t\t/**\n\t\t * Return node with a given key or null if not found.\n\t\t *\n\t\t * @param {string} key\n\t\t * @param {FancytreeNode} [searchRoot] only search below this node\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetNodeByKey: function (key, searchRoot) {\n\t\t\t// Search the DOM by element ID (assuming this is faster than traversing all nodes).\n\t\t\tvar el, match;\n\t\t\t// TODO: use tree.keyMap if available\n\t\t\t// TODO: check opts.generateIds === true\n\t\t\tif (!searchRoot) {\n\t\t\t\tel = document.getElementById(this.options.idPrefix + key);\n\t\t\t\tif (el) {\n\t\t\t\t\treturn el.ftnode ? el.ftnode : null;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Not found in the DOM, but still may be in an unrendered part of tree\n\t\t\tsearchRoot = searchRoot || this.rootNode;\n\t\t\tmatch = null;\n\t\t\tkey = \"\" + key; // Convert to string (#1005)\n\t\t\tsearchRoot.visit(function (node) {\n\t\t\t\tif (node.key === key) {\n\t\t\t\t\tmatch = node;\n\t\t\t\t\treturn false; // Stop iteration\n\t\t\t\t}\n\t\t\t}, true);\n\t\t\treturn match;\n\t\t},\n\t\t/** Return the invisible system root node.\n\t\t * @returns {FancytreeNode}\n\t\t */\n\t\tgetRootNode: function () {\n\t\t\treturn this.rootNode;\n\t\t},\n\t\t/**\n\t\t * Return an array of selected nodes.\n\t\t *\n\t\t * Note: you cannot send this result via Ajax directly. Instead the\n\t\t * node object need to be converted to plain objects, for example\n\t\t * by using `$.map()` and `node.toDict()`.\n\t\t * @param {boolean} [stopOnParents=false] only return the topmost selected\n\t\t * node (useful with selectMode 3)\n\t\t * @returns {FancytreeNode[]}\n\t\t */\n\t\tgetSelectedNodes: function (stopOnParents) {\n\t\t\treturn this.rootNode.getSelectedNodes(stopOnParents);\n\t\t},\n\t\t/** Return true if the tree control has keyboard focus\n\t\t * @returns {boolean}\n\t\t */\n\t\thasFocus: function () {\n\t\t\t// var ae = document.activeElement,\n\t\t\t// \thasFocus = !!(\n\t\t\t// \t\tae && $(ae).closest(\".fancytree-container\").length\n\t\t\t// \t);\n\n\t\t\t// if (hasFocus !== !!this._hasFocus) {\n\t\t\t// \tthis.warn(\n\t\t\t// \t\t\"hasFocus(): fix inconsistent container state, now: \" +\n\t\t\t// \t\t\thasFocus\n\t\t\t// \t);\n\t\t\t// \tthis._hasFocus = hasFocus;\n\t\t\t// \tthis.$container.toggleClass(\"fancytree-treefocus\", hasFocus);\n\t\t\t// }\n\t\t\t// return hasFocus;\n\t\t\treturn !!this._hasFocus;\n\t\t},\n\t\t/** Write to browser console if debugLevel >= 3 (prepending tree name)\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\tinfo: function (msg) {\n\t\t\tif (this.options.debugLevel >= 3) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"info\", arguments);\n\t\t\t}\n\t\t},\n\t\t/** Return true if any node is currently beeing loaded, i.e. a Ajax request is pending.\n\t\t * @returns {boolean}\n\t\t * @since 2.32\n\t\t */\n\t\tisLoading: function () {\n\t\t\tvar res = false;\n\n\t\t\tthis.rootNode.visit(function (n) {\n\t\t\t\t// also visit rootNode\n\t\t\t\tif (n._isLoading || n._requestId) {\n\t\t\t\t\tres = true;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}, true);\n\t\t\treturn res;\n\t\t},\n\t\t/*\n\t\tTODO: isInitializing: function() {\n\t\t\treturn ( this.phase==\"init\" || this.phase==\"postInit\" );\n\t\t},\n\t\tTODO: isReloading: function() {\n\t\t\treturn ( this.phase==\"init\" || this.phase==\"postInit\" ) && this.options.persist && this.persistence.cookiesFound;\n\t\t},\n\t\tTODO: isUserEvent: function() {\n\t\t\treturn ( this.phase==\"userEvent\" );\n\t\t},\n\t\t*/\n\n\t\t/**\n\t\t * Make sure that a node with a given ID is loaded, by traversing - and\n\t\t * loading - its parents. This method is meant for lazy hierarchies.\n\t\t * A callback is executed for every node as we go.\n\t\t * @example\n\t\t * // Resolve using node.key:\n\t\t * tree.loadKeyPath(\"/_3/_23/_26/_27\", function(node, status){\n\t\t * if(status === \"loaded\") {\n\t\t * console.log(\"loaded intermediate node \" + node);\n\t\t * }else if(status === \"ok\") {\n\t\t * node.activate();\n\t\t * }\n\t\t * });\n\t\t * // Use deferred promise:\n\t\t * tree.loadKeyPath(\"/_3/_23/_26/_27\").progress(function(data){\n\t\t * if(data.status === \"loaded\") {\n\t\t * console.log(\"loaded intermediate node \" + data.node);\n\t\t * }else if(data.status === \"ok\") {\n\t\t * node.activate();\n\t\t * }\n\t\t * }).done(function(){\n\t\t * ...\n\t\t * });\n\t\t * // Custom path segment resolver:\n\t\t * tree.loadKeyPath(\"/321/431/21/2\", {\n\t\t * matchKey: function(node, key){\n\t\t * return node.data.refKey === key;\n\t\t * },\n\t\t * callback: function(node, status){\n\t\t * if(status === \"loaded\") {\n\t\t * console.log(\"loaded intermediate node \" + node);\n\t\t * }else if(status === \"ok\") {\n\t\t * node.activate();\n\t\t * }\n\t\t * }\n\t\t * });\n\t\t * @param {string | string[]} keyPathList one or more key paths (e.g. '/3/2_1/7')\n\t\t * @param {function | object} optsOrCallback callback(node, status) is called for every visited node ('loading', 'loaded', 'ok', 'error').\n\t\t * Pass an object to define custom key matchers for the path segments: {callback: function, matchKey: function}.\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tloadKeyPath: function (keyPathList, optsOrCallback) {\n\t\t\tvar callback,\n\t\t\t\ti,\n\t\t\t\tpath,\n\t\t\t\tself = this,\n\t\t\t\tdfd = new $.Deferred(),\n\t\t\t\tparent = this.getRootNode(),\n\t\t\t\tsep = this.options.keyPathSeparator,\n\t\t\t\tpathSegList = [],\n\t\t\t\topts = $.extend({}, optsOrCallback);\n\n\t\t\t// Prepare options\n\t\t\tif (typeof optsOrCallback === \"function\") {\n\t\t\t\tcallback = optsOrCallback;\n\t\t\t} else if (optsOrCallback && optsOrCallback.callback) {\n\t\t\t\tcallback = optsOrCallback.callback;\n\t\t\t}\n\t\t\topts.callback = function (ctx, node, status) {\n\t\t\t\tif (callback) {\n\t\t\t\t\tcallback.call(ctx, node, status);\n\t\t\t\t}\n\t\t\t\tdfd.notifyWith(ctx, [{ node: node, status: status }]);\n\t\t\t};\n\t\t\tif (opts.matchKey == null) {\n\t\t\t\topts.matchKey = function (node, key) {\n\t\t\t\t\treturn node.key === key;\n\t\t\t\t};\n\t\t\t}\n\t\t\t// Convert array of path strings to array of segment arrays\n\t\t\tif (!_isArray(keyPathList)) {\n\t\t\t\tkeyPathList = [keyPathList];\n\t\t\t}\n\t\t\tfor (i = 0; i < keyPathList.length; i++) {\n\t\t\t\tpath = keyPathList[i];\n\t\t\t\t// strip leading slash\n\t\t\t\tif (path.charAt(0) === sep) {\n\t\t\t\t\tpath = path.substr(1);\n\t\t\t\t}\n\t\t\t\t// segListMap[path] = { parent: parent, segList: path.split(sep) };\n\t\t\t\tpathSegList.push(path.split(sep));\n\t\t\t\t// targetList.push({ parent: parent, segList: path.split(sep)/* , path: path*/});\n\t\t\t}\n\t\t\t// The timeout forces async behavior always (even if nodes are all loaded)\n\t\t\t// This way a potential progress() event will fire.\n\t\t\tsetTimeout(function () {\n\t\t\t\tself._loadKeyPathImpl(dfd, opts, parent, pathSegList).done(\n\t\t\t\t\tfunction () {\n\t\t\t\t\t\tdfd.resolve();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}, 0);\n\t\t\treturn dfd.promise();\n\t\t},\n\t\t/*\n\t\t * Resolve a list of paths, relative to one parent node.\n\t\t */\n\t\t_loadKeyPathImpl: function (dfd, opts, parent, pathSegList) {\n\t\t\tvar deferredList,\n\t\t\t\ti,\n\t\t\t\tkey,\n\t\t\t\tnode,\n\t\t\t\tnodeKey,\n\t\t\t\tremain,\n\t\t\t\tremainMap,\n\t\t\t\ttmpParent,\n\t\t\t\tsegList,\n\t\t\t\tsubDfd,\n\t\t\t\tself = this;\n\n\t\t\tfunction __findChild(parent, key) {\n\t\t\t\t// console.log(\"__findChild\", key, parent);\n\t\t\t\tvar i,\n\t\t\t\t\tl,\n\t\t\t\t\tcl = parent.children;\n\n\t\t\t\tif (cl) {\n\t\t\t\t\tfor (i = 0, l = cl.length; i < l; i++) {\n\t\t\t\t\t\tif (opts.matchKey(cl[i], key)) {\n\t\t\t\t\t\t\treturn cl[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// console.log(\"_loadKeyPathImpl, parent=\", parent, \", pathSegList=\", pathSegList);\n\n\t\t\t// Pass 1:\n\t\t\t// Handle all path segments for nodes that are already loaded.\n\t\t\t// Collect distinct top-most lazy nodes in a map.\n\t\t\t// Note that we can use node.key to de-dupe entries, even if a custom matcher would\n\t\t\t// look for other node attributes.\n\t\t\t// map[node.key] => {node: node, pathList: [list of remaining rest-paths]}\n\t\t\tremainMap = {};\n\n\t\t\tfor (i = 0; i < pathSegList.length; i++) {\n\t\t\t\tsegList = pathSegList[i];\n\t\t\t\t// target = targetList[i];\n\n\t\t\t\t// Traverse and pop path segments (i.e. keys), until we hit a lazy, unloaded node\n\t\t\t\ttmpParent = parent;\n\t\t\t\twhile (segList.length) {\n\t\t\t\t\tkey = segList.shift();\n\t\t\t\t\tnode = __findChild(tmpParent, key);\n\t\t\t\t\tif (!node) {\n\t\t\t\t\t\tthis.warn(\n\t\t\t\t\t\t\t\"loadKeyPath: key not found: \" +\n\t\t\t\t\t\t\t\tkey +\n\t\t\t\t\t\t\t\t\" (parent: \" +\n\t\t\t\t\t\t\t\ttmpParent +\n\t\t\t\t\t\t\t\t\")\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\topts.callback(this, key, \"error\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (segList.length === 0) {\n\t\t\t\t\t\topts.callback(this, node, \"ok\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (!node.lazy || node.hasChildren() !== undefined) {\n\t\t\t\t\t\topts.callback(this, node, \"loaded\");\n\t\t\t\t\t\ttmpParent = node;\n\t\t\t\t\t} else {\n\t\t\t\t\t\topts.callback(this, node, \"loaded\");\n\t\t\t\t\t\tkey = node.key; //target.segList.join(sep);\n\t\t\t\t\t\tif (remainMap[key]) {\n\t\t\t\t\t\t\tremainMap[key].pathSegList.push(segList);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tremainMap[key] = {\n\t\t\t\t\t\t\t\tparent: node,\n\t\t\t\t\t\t\t\tpathSegList: [segList],\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// console.log(\"_loadKeyPathImpl AFTER pass 1, remainMap=\", remainMap);\n\n\t\t\t// Now load all lazy nodes and continue iteration for remaining paths\n\t\t\tdeferredList = [];\n\n\t\t\t// Avoid jshint warning 'Don't make functions within a loop.':\n\t\t\tfunction __lazyload(dfd, parent, pathSegList) {\n\t\t\t\t// console.log(\"__lazyload\", parent, \"pathSegList=\", pathSegList);\n\t\t\t\topts.callback(self, parent, \"loading\");\n\t\t\t\tparent\n\t\t\t\t\t.load()\n\t\t\t\t\t.done(function () {\n\t\t\t\t\t\tself._loadKeyPathImpl\n\t\t\t\t\t\t\t.call(self, dfd, opts, parent, pathSegList)\n\t\t\t\t\t\t\t.always(_makeResolveFunc(dfd, self));\n\t\t\t\t\t})\n\t\t\t\t\t.fail(function (errMsg) {\n\t\t\t\t\t\tself.warn(\"loadKeyPath: error loading lazy \" + parent);\n\t\t\t\t\t\topts.callback(self, node, \"error\");\n\t\t\t\t\t\tdfd.rejectWith(self);\n\t\t\t\t\t});\n\t\t\t}\n\t\t\t// remainMap contains parent nodes, each with a list of relative sub-paths.\n\t\t\t// We start loading all of them now, and pass the the list to each loader.\n\t\t\tfor (nodeKey in remainMap) {\n\t\t\t\tif (_hasProp(remainMap, nodeKey)) {\n\t\t\t\t\tremain = remainMap[nodeKey];\n\t\t\t\t\t// console.log(\"for(): remain=\", remain, \"remainMap=\", remainMap);\n\t\t\t\t\t// key = remain.segList.shift();\n\t\t\t\t\t// node = __findChild(remain.parent, key);\n\t\t\t\t\t// if (node == null) { // #576\n\t\t\t\t\t// \t// Issue #576, refactored for v2.27:\n\t\t\t\t\t// \t// The root cause was, that sometimes the wrong parent was used here\n\t\t\t\t\t// \t// to find the next segment.\n\t\t\t\t\t// \t// Falling back to getNodeByKey() was a hack that no longer works if a custom\n\t\t\t\t\t// \t// matcher is used, because we cannot assume that a single segment-key is unique\n\t\t\t\t\t// \t// throughout the tree.\n\t\t\t\t\t// \tself.error(\"loadKeyPath: error loading child by key '\" + key + \"' (parent: \" + target.parent + \")\", target);\n\t\t\t\t\t// \t// \tnode = self.getNodeByKey(key);\n\t\t\t\t\t// \tcontinue;\n\t\t\t\t\t// }\n\t\t\t\t\tsubDfd = new $.Deferred();\n\t\t\t\t\tdeferredList.push(subDfd);\n\t\t\t\t\t__lazyload(subDfd, remain.parent, remain.pathSegList);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Return a promise that is resolved, when ALL paths were loaded\n\t\t\treturn $.when.apply($, deferredList).promise();\n\t\t},\n\t\t/** Re-fire beforeActivate, activate, and (optional) focus events.\n\t\t * Calling this method in the `init` event, will activate the node that\n\t\t * was marked 'active' in the source data, and optionally set the keyboard\n\t\t * focus.\n\t\t * @param [setFocus=false]\n\t\t */\n\t\treactivate: function (setFocus) {\n\t\t\tvar res,\n\t\t\t\tnode = this.activeNode;\n\n\t\t\tif (!node) {\n\t\t\t\treturn _getResolvedPromise();\n\t\t\t}\n\t\t\tthis.activeNode = null; // Force re-activating\n\t\t\tres = node.setActive(true, { noFocus: true });\n\t\t\tif (setFocus) {\n\t\t\t\tnode.setFocus();\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t/** Reload tree from source and return a promise.\n\t\t * @param [source] optional new source (defaults to initial source data)\n\t\t * @returns {$.Promise}\n\t\t */\n\t\treload: function (source) {\n\t\t\tthis._callHook(\"treeClear\", this);\n\t\t\treturn this._callHook(\"treeLoad\", this, source);\n\t\t},\n\t\t/**Render tree (i.e. create DOM elements for all top-level nodes).\n\t\t * @param {boolean} [force=false] create DOM elemnts, even if parent is collapsed\n\t\t * @param {boolean} [deep=false]\n\t\t */\n\t\trender: function (force, deep) {\n\t\t\treturn this.rootNode.render(force, deep);\n\t\t},\n\t\t/**(De)select all nodes.\n\t\t * @param {boolean} [flag=true]\n\t\t * @since 2.28\n\t\t */\n\t\tselectAll: function (flag) {\n\t\t\tthis.visit(function (node) {\n\t\t\t\tnode.setSelected(flag);\n\t\t\t});\n\t\t},\n\t\t// TODO: selectKey: function(key, select)\n\t\t// TODO: serializeArray: function(stopOnParents)\n\t\t/**\n\t\t * @param {boolean} [flag=true]\n\t\t */\n\t\tsetFocus: function (flag) {\n\t\t\treturn this._callHook(\"treeSetFocus\", this, flag);\n\t\t},\n\t\t/**\n\t\t * Set current option value.\n\t\t * (Note: this is the preferred variant of `$().fancytree(\"option\", \"KEY\", VALUE)`)\n\t\t * @param {string} name option name (may contain '.')\n\t\t * @param {any} new value\n\t\t */\n\t\tsetOption: function (optionName, value) {\n\t\t\treturn this.widget.option(optionName, value);\n\t\t},\n\t\t/**\n\t\t * Call console.time() when in debug mode (verbose >= 4).\n\t\t *\n\t\t * @param {string} label\n\t\t */\n\t\tdebugTime: function (label) {\n\t\t\tif (this.options.debugLevel >= 4) {\n\t\t\t\twindow.console.time(this + \" - \" + label);\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Call console.timeEnd() when in debug mode (verbose >= 4).\n\t\t *\n\t\t * @param {string} label\n\t\t */\n\t\tdebugTimeEnd: function (label) {\n\t\t\tif (this.options.debugLevel >= 4) {\n\t\t\t\twindow.console.timeEnd(this + \" - \" + label);\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Return all nodes as nested list of {@link NodeData}.\n\t\t *\n\t\t * @param {boolean} [includeRoot=false] Returns the hidden system root node (and its children)\n\t\t * @param {function} [callback] callback(dict, node) is called for every node, in order to allow modifications.\n\t\t * Return `false` to ignore this node or \"skip\" to include this node without its children.\n\t\t * @returns {Array | object}\n\t\t * @see FancytreeNode#toDict\n\t\t */\n\t\ttoDict: function (includeRoot, callback) {\n\t\t\tvar res = this.rootNode.toDict(true, callback);\n\t\t\treturn includeRoot ? res : res.children;\n\t\t},\n\t\t/* Implicitly called for string conversions.\n\t\t * @returns {string}\n\t\t */\n\t\ttoString: function () {\n\t\t\treturn \"Fancytree@\" + this._id;\n\t\t\t// return \"<Fancytree(#\" + this._id + \")>\";\n\t\t},\n\t\t/* _trigger a widget event with additional node ctx.\n\t\t * @see EventData\n\t\t */\n\t\t_triggerNodeEvent: function (type, node, originalEvent, extra) {\n\t\t\t// this.debug(\"_trigger(\" + type + \"): '\" + ctx.node.title + \"'\", ctx);\n\t\t\tvar ctx = this._makeHookContext(node, originalEvent, extra),\n\t\t\t\tres = this.widget._trigger(type, originalEvent, ctx);\n\t\t\tif (res !== false && ctx.result !== undefined) {\n\t\t\t\treturn ctx.result;\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t/* _trigger a widget event with additional tree data. */\n\t\t_triggerTreeEvent: function (type, originalEvent, extra) {\n\t\t\t// this.debug(\"_trigger(\" + type + \")\", ctx);\n\t\t\tvar ctx = this._makeHookContext(this, originalEvent, extra),\n\t\t\t\tres = this.widget._trigger(type, originalEvent, ctx);\n\n\t\t\tif (res !== false && ctx.result !== undefined) {\n\t\t\t\treturn ctx.result;\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t/** Call fn(node) for all nodes in hierarchical order (depth-first).\n\t\t *\n\t\t * @param {function} fn the callback function.\n\t\t * Return false to stop iteration, return \"skip\" to skip this node and children only.\n\t\t * @returns {boolean} false, if the iterator was stopped.\n\t\t */\n\t\tvisit: function (fn) {\n\t\t\treturn this.rootNode.visit(fn, false);\n\t\t},\n\t\t/** Call fn(node) for all nodes in vertical order, top down (or bottom up).<br>\n\t\t * Stop iteration, if fn() returns false.<br>\n\t\t * Return false if iteration was stopped.\n\t\t *\n\t\t * @param {function} fn the callback function.\n\t\t * Return false to stop iteration, return \"skip\" to skip this node and children only.\n\t\t * @param {object} [options]\n\t\t * Defaults:\n\t\t * {start: First top node, reverse: false, includeSelf: true, includeHidden: false}\n\t\t * @returns {boolean} false if iteration was cancelled\n\t\t * @since 2.28\n\t\t */\n\t\tvisitRows: function (fn, opts) {\n\t\t\tif (!this.rootNode.hasChildren()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (opts && opts.reverse) {\n\t\t\t\tdelete opts.reverse;\n\t\t\t\treturn this._visitRowsUp(fn, opts);\n\t\t\t}\n\t\t\topts = opts || {};\n\n\t\t\tvar i,\n\t\t\t\tnextIdx,\n\t\t\t\tparent,\n\t\t\t\tres,\n\t\t\t\tsiblings,\n\t\t\t\tsiblingOfs = 0,\n\t\t\t\tskipFirstNode = opts.includeSelf === false,\n\t\t\t\tincludeHidden = !!opts.includeHidden,\n\t\t\t\tcheckFilter = !includeHidden && this.enableFilter,\n\t\t\t\tnode = opts.start || this.rootNode.children[0];\n\n\t\t\tparent = node.parent;\n\t\t\twhile (parent) {\n\t\t\t\t// visit siblings\n\t\t\t\tsiblings = parent.children;\n\t\t\t\tnextIdx = siblings.indexOf(node) + siblingOfs;\n\t\t\t\t_assert(\n\t\t\t\t\tnextIdx >= 0,\n\t\t\t\t\t\"Could not find \" +\n\t\t\t\t\t\tnode +\n\t\t\t\t\t\t\" in parent's children: \" +\n\t\t\t\t\t\tparent\n\t\t\t\t);\n\n\t\t\t\tfor (i = nextIdx; i < siblings.length; i++) {\n\t\t\t\t\tnode = siblings[i];\n\t\t\t\t\tif (checkFilter && !node.match && !node.subMatchCount) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (!skipFirstNode && fn(node) === false) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tskipFirstNode = false;\n\t\t\t\t\t// Dive into node's child nodes\n\t\t\t\t\tif (\n\t\t\t\t\t\tnode.children &&\n\t\t\t\t\t\tnode.children.length &&\n\t\t\t\t\t\t(includeHidden || node.expanded)\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Disable warning: Functions declared within loops referencing an outer\n\t\t\t\t\t\t// scoped variable may lead to confusing semantics:\n\t\t\t\t\t\t/*jshint -W083 */\n\t\t\t\t\t\tres = node.visit(function (n) {\n\t\t\t\t\t\t\tif (checkFilter && !n.match && !n.subMatchCount) {\n\t\t\t\t\t\t\t\treturn \"skip\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (fn(n) === false) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!includeHidden && n.children && !n.expanded) {\n\t\t\t\t\t\t\t\treturn \"skip\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, false);\n\t\t\t\t\t\t/*jshint +W083 */\n\t\t\t\t\t\tif (res === false) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Visit parent nodes (bottom up)\n\t\t\t\tnode = parent;\n\t\t\t\tparent = parent.parent;\n\t\t\t\tsiblingOfs = 1; //\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\t/* Call fn(node) for all nodes in vertical order, bottom up.\n\t\t */\n\t\t_visitRowsUp: function (fn, opts) {\n\t\t\tvar children,\n\t\t\t\tidx,\n\t\t\t\tparent,\n\t\t\t\tincludeHidden = !!opts.includeHidden,\n\t\t\t\tnode = opts.start || this.rootNode.children[0];\n\n\t\t\twhile (true) {\n\t\t\t\tparent = node.parent;\n\t\t\t\tchildren = parent.children;\n\n\t\t\t\tif (children[0] === node) {\n\t\t\t\t\t// If this is already the first sibling, goto parent\n\t\t\t\t\tnode = parent;\n\t\t\t\t\tif (!node.parent) {\n\t\t\t\t\t\tbreak; // first node of the tree\n\t\t\t\t\t}\n\t\t\t\t\tchildren = parent.children;\n\t\t\t\t} else {\n\t\t\t\t\t// Otherwise, goto prev. sibling\n\t\t\t\t\tidx = children.indexOf(node);\n\t\t\t\t\tnode = children[idx - 1];\n\t\t\t\t\t// If the prev. sibling has children, follow down to last descendant\n\t\t\t\t\twhile (\n\t\t\t\t\t\t// See: https://github.com/eslint/eslint/issues/11302\n\t\t\t\t\t\t// eslint-disable-next-line no-unmodified-loop-condition\n\t\t\t\t\t\t(includeHidden || node.expanded) &&\n\t\t\t\t\t\tnode.children &&\n\t\t\t\t\t\tnode.children.length\n\t\t\t\t\t) {\n\t\t\t\t\t\tchildren = node.children;\n\t\t\t\t\t\tparent = node;\n\t\t\t\t\t\tnode = children[children.length - 1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Skip invisible\n\t\t\t\tif (!includeHidden && !node.isVisible()) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (fn(node) === false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t/** Write warning to browser console if debugLevel >= 2 (prepending tree info)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\twarn: function (msg) {\n\t\t\tif (this.options.debugLevel >= 2) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"warn\", arguments);\n\t\t\t}\n\t\t},\n\t};\n\n\t/**\n\t * These additional methods of the {@link Fancytree} class are 'hook functions'\n\t * that can be used and overloaded by extensions.\n\t *\n\t * @see [writing extensions](https://github.com/mar10/fancytree/wiki/TutorialExtensions)\n\t * @mixin Fancytree_Hooks\n\t */\n\t$.extend(\n\t\tFancytree.prototype,\n\t\t/** @lends Fancytree_Hooks# */\n\t\t{\n\t\t\t/** Default handling for mouse click events.\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeClick: function (ctx) {\n\t\t\t\tvar activate,\n\t\t\t\t\texpand,\n\t\t\t\t\t// event = ctx.originalEvent,\n\t\t\t\t\ttargetType = ctx.targetType,\n\t\t\t\t\tnode = ctx.node;\n\n\t\t\t\t// this.debug(\"ftnode.onClick(\" + event.type + \"): ftnode:\" + this + \", button:\" + event.button + \", which: \" + event.which, ctx);\n\t\t\t\t// TODO: use switch\n\t\t\t\t// TODO: make sure clicks on embedded <input> doesn't steal focus (see table sample)\n\t\t\t\tif (targetType === \"expander\") {\n\t\t\t\t\tif (node.isLoading()) {\n\t\t\t\t\t\t// #495: we probably got a click event while a lazy load is pending.\n\t\t\t\t\t\t// The 'expanded' state is not yet set, so 'toggle' would expand\n\t\t\t\t\t\t// and trigger lazyLoad again.\n\t\t\t\t\t\t// It would be better to allow to collapse/expand the status node\n\t\t\t\t\t\t// while loading (instead of ignoring), but that would require some\n\t\t\t\t\t\t// more work.\n\t\t\t\t\t\tnode.debug(\"Got 2nd click while loading: ignored\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// Clicking the expander icon always expands/collapses\n\t\t\t\t\tthis._callHook(\"nodeToggleExpanded\", ctx);\n\t\t\t\t} else if (targetType === \"checkbox\") {\n\t\t\t\t\t// Clicking the checkbox always (de)selects\n\t\t\t\t\tthis._callHook(\"nodeToggleSelected\", ctx);\n\t\t\t\t\tif (ctx.options.focusOnSelect) {\n\t\t\t\t\t\t// #358\n\t\t\t\t\t\tthis._callHook(\"nodeSetFocus\", ctx, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Honor `clickFolderMode` for\n\t\t\t\t\texpand = false;\n\t\t\t\t\tactivate = true;\n\t\t\t\t\tif (node.folder) {\n\t\t\t\t\t\tswitch (ctx.options.clickFolderMode) {\n\t\t\t\t\t\t\tcase 2: // expand only\n\t\t\t\t\t\t\t\texpand = true;\n\t\t\t\t\t\t\t\tactivate = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 3: // expand and activate\n\t\t\t\t\t\t\t\tactivate = true;\n\t\t\t\t\t\t\t\texpand = true; //!node.isExpanded();\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t// else 1 or 4: just activate\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (activate) {\n\t\t\t\t\t\tthis.nodeSetFocus(ctx);\n\t\t\t\t\t\tthis._callHook(\"nodeSetActive\", ctx, true);\n\t\t\t\t\t}\n\t\t\t\t\tif (expand) {\n\t\t\t\t\t\tif (!activate) {\n\t\t\t\t\t\t\t// this._callHook(\"nodeSetFocus\", ctx);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// this._callHook(\"nodeSetExpanded\", ctx, true);\n\t\t\t\t\t\tthis._callHook(\"nodeToggleExpanded\", ctx);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Make sure that clicks stop, otherwise <a href='#'> jumps to the top\n\t\t\t\t// if(event.target.localName === \"a\" && event.target.className === \"fancytree-title\"){\n\t\t\t\t// \tevent.preventDefault();\n\t\t\t\t// }\n\t\t\t\t// TODO: return promise?\n\t\t\t},\n\t\t\t/** Collapse all other children of same parent.\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {object} callOpts\n\t\t\t */\n\t\t\tnodeCollapseSiblings: function (ctx, callOpts) {\n\t\t\t\t// TODO: return promise?\n\t\t\t\tvar ac,\n\t\t\t\t\ti,\n\t\t\t\t\tl,\n\t\t\t\t\tnode = ctx.node;\n\n\t\t\t\tif (node.parent) {\n\t\t\t\t\tac = node.parent.children;\n\t\t\t\t\tfor (i = 0, l = ac.length; i < l; i++) {\n\t\t\t\t\t\tif (ac[i] !== node && ac[i].expanded) {\n\t\t\t\t\t\t\tthis._callHook(\n\t\t\t\t\t\t\t\t\"nodeSetExpanded\",\n\t\t\t\t\t\t\t\tac[i],\n\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\tcallOpts\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Default handling for mouse douleclick events.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeDblclick: function (ctx) {\n\t\t\t\t// TODO: return promise?\n\t\t\t\tif (\n\t\t\t\t\tctx.targetType === \"title\" &&\n\t\t\t\t\tctx.options.clickFolderMode === 4\n\t\t\t\t) {\n\t\t\t\t\t// this.nodeSetFocus(ctx);\n\t\t\t\t\t// this._callHook(\"nodeSetActive\", ctx, true);\n\t\t\t\t\tthis._callHook(\"nodeToggleExpanded\", ctx);\n\t\t\t\t}\n\t\t\t\t// TODO: prevent text selection on dblclicks\n\t\t\t\tif (ctx.targetType === \"title\") {\n\t\t\t\t\tctx.originalEvent.preventDefault();\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Default handling for mouse keydown events.\n\t\t\t *\n\t\t\t * NOTE: this may be called with node == null if tree (but no node) has focus.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeKeydown: function (ctx) {\n\t\t\t\t// TODO: return promise?\n\t\t\t\tvar matchNode,\n\t\t\t\t\tstamp,\n\t\t\t\t\t_res,\n\t\t\t\t\tfocusNode,\n\t\t\t\t\tevent = ctx.originalEvent,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\twhich = event.which,\n\t\t\t\t\t// #909: Use event.key, to get unicode characters.\n\t\t\t\t\t// We can't use `/\\w/.test(key)`, because that would\n\t\t\t\t\t// only detect plain ascii alpha-numerics. But we still need\n\t\t\t\t\t// to ignore modifier-only, whitespace, cursor-keys, etc.\n\t\t\t\t\tkey = event.key || String.fromCharCode(which),\n\t\t\t\t\tspecialModifiers = !!(\n\t\t\t\t\t\tevent.altKey ||\n\t\t\t\t\t\tevent.ctrlKey ||\n\t\t\t\t\t\tevent.metaKey\n\t\t\t\t\t),\n\t\t\t\t\tisAlnum =\n\t\t\t\t\t\t!MODIFIERS[which] &&\n\t\t\t\t\t\t!SPECIAL_KEYCODES[which] &&\n\t\t\t\t\t\t!specialModifiers,\n\t\t\t\t\t$target = $(event.target),\n\t\t\t\t\thandled = true,\n\t\t\t\t\tactivate = !(event.ctrlKey || !opts.autoActivate);\n\n\t\t\t\t// (node || FT).debug(\"ftnode.nodeKeydown(\" + event.type + \"): ftnode:\" + this + \", charCode:\" + event.charCode + \", keyCode: \" + event.keyCode + \", which: \" + event.which);\n\t\t\t\t// FT.debug( \"eventToString(): \" + FT.eventToString(event) + \", key='\" + key + \"', isAlnum: \" + isAlnum );\n\n\t\t\t\t// Set focus to active (or first node) if no other node has the focus yet\n\t\t\t\tif (!node) {\n\t\t\t\t\tfocusNode = this.getActiveNode() || this.getFirstChild();\n\t\t\t\t\tif (focusNode) {\n\t\t\t\t\t\tfocusNode.setFocus();\n\t\t\t\t\t\tnode = ctx.node = this.focusNode;\n\t\t\t\t\t\tnode.debug(\"Keydown force focus on active node\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\topts.quicksearch &&\n\t\t\t\t\tisAlnum &&\n\t\t\t\t\t!$target.is(\":input:enabled\")\n\t\t\t\t) {\n\t\t\t\t\t// Allow to search for longer streaks if typed in quickly\n\t\t\t\t\tstamp = Date.now();\n\t\t\t\t\tif (stamp - tree.lastQuicksearchTime > 500) {\n\t\t\t\t\t\ttree.lastQuicksearchTerm = \"\";\n\t\t\t\t\t}\n\t\t\t\t\ttree.lastQuicksearchTime = stamp;\n\t\t\t\t\ttree.lastQuicksearchTerm += key;\n\t\t\t\t\t// tree.debug(\"quicksearch find\", tree.lastQuicksearchTerm);\n\t\t\t\t\tmatchNode = tree.findNextNode(\n\t\t\t\t\t\ttree.lastQuicksearchTerm,\n\t\t\t\t\t\ttree.getActiveNode()\n\t\t\t\t\t);\n\t\t\t\t\tif (matchNode) {\n\t\t\t\t\t\tmatchNode.setActive();\n\t\t\t\t\t}\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tswitch (FT.eventToString(event)) {\n\t\t\t\t\tcase \"+\":\n\t\t\t\t\tcase \"=\": // 187: '+' @ Chrome, Safari\n\t\t\t\t\t\ttree.nodeSetExpanded(ctx, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"-\":\n\t\t\t\t\t\ttree.nodeSetExpanded(ctx, false);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"space\":\n\t\t\t\t\t\tif (node.isPagingNode()) {\n\t\t\t\t\t\t\ttree._triggerNodeEvent(\"clickPaging\", ctx, event);\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tFT.evalOption(\"checkbox\", node, node, opts, false)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// #768\n\t\t\t\t\t\t\ttree.nodeToggleSelected(ctx);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttree.nodeSetActive(ctx, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"return\":\n\t\t\t\t\t\ttree.nodeSetActive(ctx, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"home\":\n\t\t\t\t\tcase \"end\":\n\t\t\t\t\tcase \"backspace\":\n\t\t\t\t\tcase \"left\":\n\t\t\t\t\tcase \"right\":\n\t\t\t\t\tcase \"up\":\n\t\t\t\t\tcase \"down\":\n\t\t\t\t\t\t_res = node.navigate(event.which, activate);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\thandled = false;\n\t\t\t\t}\n\t\t\t\tif (handled) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t// /** Default handling for mouse keypress events. */\n\t\t\t// nodeKeypress: function(ctx) {\n\t\t\t// var event = ctx.originalEvent;\n\t\t\t// },\n\n\t\t\t// /** Trigger lazyLoad event (async). */\n\t\t\t// nodeLazyLoad: function(ctx) {\n\t\t\t// var node = ctx.node;\n\t\t\t// if(this._triggerNodeEvent())\n\t\t\t// },\n\t\t\t/** Load child nodes (async).\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {object[]|object|string|$.Promise|function} source\n\t\t\t * @returns {$.Promise} The deferred will be resolved as soon as the (ajax)\n\t\t\t * data was rendered.\n\t\t\t */\n\t\t\tnodeLoadChildren: function (ctx, source) {\n\t\t\t\tvar ajax,\n\t\t\t\t\tdelay,\n\t\t\t\t\tajaxDfd = null,\n\t\t\t\t\tresultDfd,\n\t\t\t\t\tisAsync = true,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\tnodePrevParent = node.parent,\n\t\t\t\t\ttag = \"nodeLoadChildren\",\n\t\t\t\t\trequestId = Date.now();\n\n\t\t\t\t// `source` is a callback: use the returned result instead:\n\t\t\t\tif (_isFunction(source)) {\n\t\t\t\t\tsource = source.call(tree, { type: \"source\" }, ctx);\n\t\t\t\t\t_assert(\n\t\t\t\t\t\t!_isFunction(source),\n\t\t\t\t\t\t\"source callback must not return another function\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// `source` is already a promise:\n\t\t\t\tif (_isFunction(source.then)) {\n\t\t\t\t\t// _assert(_isFunction(source.always), \"Expected jQuery?\");\n\t\t\t\t\tajaxDfd = source;\n\t\t\t\t} else if (source.url) {\n\t\t\t\t\t// `source` is an Ajax options object\n\t\t\t\t\tajax = $.extend({}, ctx.options.ajax, source);\n\t\t\t\t\tif (ajax.debugDelay) {\n\t\t\t\t\t\t// Simulate a slow server\n\t\t\t\t\t\tdelay = ajax.debugDelay;\n\t\t\t\t\t\tdelete ajax.debugDelay; // remove debug option\n\t\t\t\t\t\tif (_isArray(delay)) {\n\t\t\t\t\t\t\t// random delay range [min..max]\n\t\t\t\t\t\t\tdelay =\n\t\t\t\t\t\t\t\tdelay[0] +\n\t\t\t\t\t\t\t\tMath.random() * (delay[1] - delay[0]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\t\"nodeLoadChildren waiting debugDelay \" +\n\t\t\t\t\t\t\t\tMath.round(delay) +\n\t\t\t\t\t\t\t\t\" ms ...\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tajaxDfd = $.Deferred(function (ajaxDfd) {\n\t\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\t\t$.ajax(ajax)\n\t\t\t\t\t\t\t\t\t.done(function () {\n\t\t\t\t\t\t\t\t\t\tajaxDfd.resolveWith(this, arguments);\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t.fail(function () {\n\t\t\t\t\t\t\t\t\t\tajaxDfd.rejectWith(this, arguments);\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}, delay);\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tajaxDfd = $.ajax(ajax);\n\t\t\t\t\t}\n\t\t\t\t} else if ($.isPlainObject(source) || _isArray(source)) {\n\t\t\t\t\t// `source` is already a constant dict or list, but we convert\n\t\t\t\t\t// to a thenable for unified processing.\n\t\t\t\t\t// 2020-01-03: refactored.\n\t\t\t\t\t// `ajaxDfd = $.when(source)` would do the trick, but the returned\n\t\t\t\t\t// promise will resolve async, which broke some tests and\n\t\t\t\t\t// would probably also break current implementations out there.\n\t\t\t\t\t// So we mock-up a thenable that resolves synchronously:\n\t\t\t\t\tajaxDfd = {\n\t\t\t\t\t\tthen: function (resolve, reject) {\n\t\t\t\t\t\t\tresolve(source, null, null);\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t\tisAsync = false;\n\t\t\t\t} else {\n\t\t\t\t\t$.error(\"Invalid source type: \" + source);\n\t\t\t\t}\n\n\t\t\t\t// Check for overlapping requests\n\t\t\t\tif (node._requestId) {\n\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\"Recursive load request #\" +\n\t\t\t\t\t\t\trequestId +\n\t\t\t\t\t\t\t\" while #\" +\n\t\t\t\t\t\t\tnode._requestId +\n\t\t\t\t\t\t\t\" is pending.\"\n\t\t\t\t\t);\n\t\t\t\t\tnode._requestId = requestId;\n\t\t\t\t\t// \tnode.debug(\"Send load request #\" + requestId);\n\t\t\t\t}\n\n\t\t\t\tif (isAsync) {\n\t\t\t\t\ttree.debugTime(tag);\n\t\t\t\t\ttree.nodeSetStatus(ctx, \"loading\");\n\t\t\t\t}\n\n\t\t\t\t// The async Ajax request has now started...\n\t\t\t\t// Defer the deferred:\n\t\t\t\t// we want to be able to reject invalid responses, even if\n\t\t\t\t// the raw HTTP Ajax XHR resolved as Ok.\n\t\t\t\t// We use the ajaxDfd.then() syntax here, which is compatible with\n\t\t\t\t// jQuery and ECMA6.\n\t\t\t\t// However resultDfd is a jQuery deferred, which is currently the\n\t\t\t\t// expected result type of nodeLoadChildren()\n\t\t\t\tresultDfd = new $.Deferred();\n\t\t\t\tajaxDfd.then(\n\t\t\t\t\tfunction (data, textStatus, jqXHR) {\n\t\t\t\t\t\t// ajaxDfd was resolved, but we reject or resolve resultDfd\n\t\t\t\t\t\t// depending on the response data\n\t\t\t\t\t\tvar errorObj, res;\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t(source.dataType === \"json\" ||\n\t\t\t\t\t\t\t\tsource.dataType === \"jsonp\") &&\n\t\t\t\t\t\t\ttypeof data === \"string\"\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t$.error(\n\t\t\t\t\t\t\t\t\"Ajax request returned a string (did you get the JSON dataType wrong?).\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (node._requestId && node._requestId > requestId) {\n\t\t\t\t\t\t\t// The expected request time stamp is later than `requestId`\n\t\t\t\t\t\t\t// (which was kept as as closure variable to this handler function)\n\t\t\t\t\t\t\t// node.warn(\"Ignored load response for obsolete request #\" + requestId + \" (expected #\" + node._requestId + \")\");\n\t\t\t\t\t\t\tresultDfd.rejectWith(this, [\n\t\t\t\t\t\t\t\tRECURSIVE_REQUEST_ERROR,\n\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t\t// \tnode.debug(\"Response returned for load request #\" + requestId);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (node.parent === null && nodePrevParent !== null) {\n\t\t\t\t\t\t\tresultDfd.rejectWith(this, [\n\t\t\t\t\t\t\t\tINVALID_REQUEST_TARGET_ERROR,\n\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Allow to adjust the received response data in the `postProcess` event.\n\t\t\t\t\t\tif (ctx.options.postProcess) {\n\t\t\t\t\t\t\t// The handler may either\n\t\t\t\t\t\t\t// - modify `ctx.response` in-place (and leave `ctx.result` undefined)\n\t\t\t\t\t\t\t// => res = undefined\n\t\t\t\t\t\t\t// - return a replacement in `ctx.result`\n\t\t\t\t\t\t\t// => res = <new data>\n\t\t\t\t\t\t\t// If res contains an `error` property, an error status is displayed\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tres = tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\t\"postProcess\",\n\t\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\tctx.originalEvent,\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tresponse: data,\n\t\t\t\t\t\t\t\t\t\terror: null,\n\t\t\t\t\t\t\t\t\t\tdataType: source.dataType,\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tif (res.error) {\n\t\t\t\t\t\t\t\t\ttree.warn(\n\t\t\t\t\t\t\t\t\t\t\"postProcess returned error:\",\n\t\t\t\t\t\t\t\t\t\tres\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\tres = {\n\t\t\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\t\t\tmessage: \"\" + e,\n\t\t\t\t\t\t\t\t\tdetails: \"postProcess failed\",\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (res.error) {\n\t\t\t\t\t\t\t\t// Either postProcess failed with an exception, or the returned\n\t\t\t\t\t\t\t\t// result object has an 'error' property attached:\n\t\t\t\t\t\t\t\terrorObj = $.isPlainObject(res.error)\n\t\t\t\t\t\t\t\t\t? res.error\n\t\t\t\t\t\t\t\t\t: { message: res.error };\n\t\t\t\t\t\t\t\terrorObj = tree._makeHookContext(\n\t\t\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\terrorObj\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tresultDfd.rejectWith(this, [errorObj]);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t_isArray(res) ||\n\t\t\t\t\t\t\t\t($.isPlainObject(res) && _isArray(res.children))\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t// Use `ctx.result` if valid\n\t\t\t\t\t\t\t\t// (otherwise use existing data, which may have been modified in-place)\n\t\t\t\t\t\t\t\tdata = res;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tdata &&\n\t\t\t\t\t\t\t_hasProp(data, \"d\") &&\n\t\t\t\t\t\t\tctx.options.enableAspx\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Process ASPX WebMethod JSON object inside \"d\" property\n\t\t\t\t\t\t\t// (only if no postProcess event was defined)\n\t\t\t\t\t\t\tif (ctx.options.enableAspx === 42) {\n\t\t\t\t\t\t\t\ttree.warn(\n\t\t\t\t\t\t\t\t\t\"The default for enableAspx will change to `false` in the fututure. \" +\n\t\t\t\t\t\t\t\t\t\t\"Pass `enableAspx: true` or implement postProcess to silence this warning.\"\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdata =\n\t\t\t\t\t\t\t\ttypeof data.d === \"string\"\n\t\t\t\t\t\t\t\t\t? $.parseJSON(data.d)\n\t\t\t\t\t\t\t\t\t: data.d;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresultDfd.resolveWith(this, [data]);\n\t\t\t\t\t},\n\t\t\t\t\tfunction (jqXHR, textStatus, errorThrown) {\n\t\t\t\t\t\t// ajaxDfd was rejected, so we reject resultDfd as well\n\t\t\t\t\t\tvar errorObj = tree._makeHookContext(node, null, {\n\t\t\t\t\t\t\terror: jqXHR,\n\t\t\t\t\t\t\targs: Array.prototype.slice.call(arguments),\n\t\t\t\t\t\t\tmessage: errorThrown,\n\t\t\t\t\t\t\tdetails: jqXHR.status + \": \" + errorThrown,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tresultDfd.rejectWith(this, [errorObj]);\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\t// The async Ajax request has now started.\n\t\t\t\t// resultDfd will be resolved/rejected after the response arrived,\n\t\t\t\t// was postProcessed, and checked.\n\t\t\t\t// Now we implement the UI update and add the data to the tree.\n\t\t\t\t// We also return this promise to the caller.\n\t\t\t\tresultDfd\n\t\t\t\t\t.done(function (data) {\n\t\t\t\t\t\ttree.nodeSetStatus(ctx, \"ok\");\n\t\t\t\t\t\tvar children, metaData, noDataRes;\n\n\t\t\t\t\t\tif ($.isPlainObject(data)) {\n\t\t\t\t\t\t\t// We got {foo: 'abc', children: [...]}\n\t\t\t\t\t\t\t// Copy extra properties to tree.data.foo\n\t\t\t\t\t\t\t_assert(\n\t\t\t\t\t\t\t\tnode.isRootNode(),\n\t\t\t\t\t\t\t\t\"source may only be an object for root nodes (expecting an array of child objects otherwise)\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t_assert(\n\t\t\t\t\t\t\t\t_isArray(data.children),\n\t\t\t\t\t\t\t\t\"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tmetaData = data;\n\t\t\t\t\t\t\tchildren = data.children;\n\t\t\t\t\t\t\tdelete metaData.children;\n\t\t\t\t\t\t\t// Copy some attributes to tree.data\n\t\t\t\t\t\t\t$.each(TREE_ATTRS, function (i, attr) {\n\t\t\t\t\t\t\t\tif (metaData[attr] !== undefined) {\n\t\t\t\t\t\t\t\t\ttree[attr] = metaData[attr];\n\t\t\t\t\t\t\t\t\tdelete metaData[attr];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t// Copy all other attributes to tree.data.NAME\n\t\t\t\t\t\t\t$.extend(tree.data, metaData);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tchildren = data;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t_assert(\n\t\t\t\t\t\t\t_isArray(children),\n\t\t\t\t\t\t\t\"expected array of children\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tnode._setChildren(children);\n\n\t\t\t\t\t\tif (tree.options.nodata && children.length === 0) {\n\t\t\t\t\t\t\tif (_isFunction(tree.options.nodata)) {\n\t\t\t\t\t\t\t\tnoDataRes = tree.options.nodata.call(\n\t\t\t\t\t\t\t\t\ttree,\n\t\t\t\t\t\t\t\t\t{ type: \"nodata\" },\n\t\t\t\t\t\t\t\t\tctx\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\ttree.options.nodata === true &&\n\t\t\t\t\t\t\t\tnode.isRootNode()\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tnoDataRes = tree.options.strings.noData;\n\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\ttypeof tree.options.nodata === \"string\" &&\n\t\t\t\t\t\t\t\tnode.isRootNode()\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tnoDataRes = tree.options.nodata;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (noDataRes) {\n\t\t\t\t\t\t\t\tnode.setStatus(\"nodata\", noDataRes);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// trigger fancytreeloadchildren\n\t\t\t\t\t\ttree._triggerNodeEvent(\"loadChildren\", node);\n\t\t\t\t\t})\n\t\t\t\t\t.fail(function (error) {\n\t\t\t\t\t\tvar ctxErr;\n\n\t\t\t\t\t\tif (error === RECURSIVE_REQUEST_ERROR) {\n\t\t\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\t\t\"Ignored response for obsolete load request #\" +\n\t\t\t\t\t\t\t\t\trequestId +\n\t\t\t\t\t\t\t\t\t\" (expected #\" +\n\t\t\t\t\t\t\t\t\tnode._requestId +\n\t\t\t\t\t\t\t\t\t\")\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else if (error === INVALID_REQUEST_TARGET_ERROR) {\n\t\t\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\t\t\"Lazy parent node was removed while loading: discarding response.\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else if (error.node && error.error && error.message) {\n\t\t\t\t\t\t\t// error is already a context object\n\t\t\t\t\t\t\tctxErr = error;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tctxErr = tree._makeHookContext(node, null, {\n\t\t\t\t\t\t\t\terror: error, // it can be jqXHR or any custom error\n\t\t\t\t\t\t\t\targs: Array.prototype.slice.call(arguments),\n\t\t\t\t\t\t\t\tmessage: error\n\t\t\t\t\t\t\t\t\t? error.message || error.toString()\n\t\t\t\t\t\t\t\t\t: \"\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (ctxErr.message === \"[object Object]\") {\n\t\t\t\t\t\t\t\tctxErr.message = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\t\"Load children failed (\" + ctxErr.message + \")\",\n\t\t\t\t\t\t\tctxErr\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\"loadError\",\n\t\t\t\t\t\t\t\tctxErr,\n\t\t\t\t\t\t\t\tnull\n\t\t\t\t\t\t\t) !== false\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\ttree.nodeSetStatus(\n\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\"error\",\n\t\t\t\t\t\t\t\tctxErr.message,\n\t\t\t\t\t\t\t\tctxErr.details\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.always(function () {\n\t\t\t\t\t\tnode._requestId = null;\n\t\t\t\t\t\tif (isAsync) {\n\t\t\t\t\t\t\ttree.debugTimeEnd(tag);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\treturn resultDfd.promise();\n\t\t\t},\n\t\t\t/** [Not Implemented] */\n\t\t\tnodeLoadKeyPath: function (ctx, keyPathList) {\n\t\t\t\t// TODO: implement and improve\n\t\t\t\t// http://code.google.com/p/dynatree/issues/detail?id=222\n\t\t\t},\n\t\t\t/**\n\t\t\t * Remove a single direct child of ctx.node.\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {FancytreeNode} childNode dircect child of ctx.node\n\t\t\t */\n\t\t\tnodeRemoveChild: function (ctx, childNode) {\n\t\t\t\tvar idx,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\t// opts = ctx.options,\n\t\t\t\t\tsubCtx = $.extend({}, ctx, { node: childNode }),\n\t\t\t\t\tchildren = node.children;\n\n\t\t\t\t// FT.debug(\"nodeRemoveChild()\", node.toString(), childNode.toString());\n\n\t\t\t\tif (children.length === 1) {\n\t\t\t\t\t_assert(childNode === children[0], \"invalid single child\");\n\t\t\t\t\treturn this.nodeRemoveChildren(ctx);\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\tthis.activeNode &&\n\t\t\t\t\t(childNode === this.activeNode ||\n\t\t\t\t\t\tthis.activeNode.isDescendantOf(childNode))\n\t\t\t\t) {\n\t\t\t\t\tthis.activeNode.setActive(false); // TODO: don't fire events\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\tthis.focusNode &&\n\t\t\t\t\t(childNode === this.focusNode ||\n\t\t\t\t\t\tthis.focusNode.isDescendantOf(childNode))\n\t\t\t\t) {\n\t\t\t\t\tthis.focusNode = null;\n\t\t\t\t}\n\t\t\t\t// TODO: persist must take care to clear select and expand cookies\n\t\t\t\tthis.nodeRemoveMarkup(subCtx);\n\t\t\t\tthis.nodeRemoveChildren(subCtx);\n\t\t\t\tidx = $.inArray(childNode, children);\n\t\t\t\t_assert(idx >= 0, \"invalid child\");\n\t\t\t\t// Notify listeners\n\t\t\t\tnode.triggerModifyChild(\"remove\", childNode);\n\t\t\t\t// Unlink to support GC\n\t\t\t\tchildNode.visit(function (n) {\n\t\t\t\t\tn.parent = null;\n\t\t\t\t}, true);\n\t\t\t\tthis._callHook(\"treeRegisterNode\", this, false, childNode);\n\t\t\t\t// remove from child list\n\t\t\t\tchildren.splice(idx, 1);\n\t\t\t},\n\t\t\t/**Remove HTML markup for all descendents of ctx.node.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeRemoveChildMarkup: function (ctx) {\n\t\t\t\tvar node = ctx.node;\n\n\t\t\t\t// FT.debug(\"nodeRemoveChildMarkup()\", node.toString());\n\t\t\t\t// TODO: Unlink attr.ftnode to support GC\n\t\t\t\tif (node.ul) {\n\t\t\t\t\tif (node.isRootNode()) {\n\t\t\t\t\t\t$(node.ul).empty();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$(node.ul).remove();\n\t\t\t\t\t\tnode.ul = null;\n\t\t\t\t\t}\n\t\t\t\t\tnode.visit(function (n) {\n\t\t\t\t\t\tn.li = n.ul = null;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t\t/**Remove all descendants of ctx.node.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeRemoveChildren: function (ctx) {\n\t\t\t\tvar //subCtx,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\tchildren = node.children;\n\t\t\t\t// opts = ctx.options;\n\n\t\t\t\t// FT.debug(\"nodeRemoveChildren()\", node.toString());\n\t\t\t\tif (!children) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (this.activeNode && this.activeNode.isDescendantOf(node)) {\n\t\t\t\t\tthis.activeNode.setActive(false); // TODO: don't fire events\n\t\t\t\t}\n\t\t\t\tif (this.focusNode && this.focusNode.isDescendantOf(node)) {\n\t\t\t\t\tthis.focusNode = null;\n\t\t\t\t}\n\t\t\t\t// TODO: persist must take care to clear select and expand cookies\n\t\t\t\tthis.nodeRemoveChildMarkup(ctx);\n\t\t\t\t// Unlink children to support GC\n\t\t\t\t// TODO: also delete this.children (not possible using visit())\n\t\t\t\t// subCtx = $.extend({}, ctx);\n\t\t\t\tnode.triggerModifyChild(\"remove\", null);\n\t\t\t\tnode.visit(function (n) {\n\t\t\t\t\tn.parent = null;\n\t\t\t\t\ttree._callHook(\"treeRegisterNode\", tree, false, n);\n\t\t\t\t});\n\t\t\t\tif (node.lazy) {\n\t\t\t\t\t// 'undefined' would be interpreted as 'not yet loaded' for lazy nodes\n\t\t\t\t\tnode.children = [];\n\t\t\t\t} else {\n\t\t\t\t\tnode.children = null;\n\t\t\t\t}\n\t\t\t\tif (!node.isRootNode()) {\n\t\t\t\t\tnode.expanded = false; // #449, #459\n\t\t\t\t}\n\t\t\t\tthis.nodeRenderStatus(ctx);\n\t\t\t},\n\t\t\t/**Remove HTML markup for ctx.node and all its descendents.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeRemoveMarkup: function (ctx) {\n\t\t\t\tvar node = ctx.node;\n\t\t\t\t// FT.debug(\"nodeRemoveMarkup()\", node.toString());\n\t\t\t\t// TODO: Unlink attr.ftnode to support GC\n\t\t\t\tif (node.li) {\n\t\t\t\t\t$(node.li).remove();\n\t\t\t\t\tnode.li = null;\n\t\t\t\t}\n\t\t\t\tthis.nodeRemoveChildMarkup(ctx);\n\t\t\t},\n\t\t\t/**\n\t\t\t * Create `<li><span>..</span> .. </li>` tags for this node.\n\t\t\t *\n\t\t\t * This method takes care that all HTML markup is created that is required\n\t\t\t * to display this node in its current state.\n\t\t\t *\n\t\t\t * Call this method to create new nodes, or after the strucuture\n\t\t\t * was changed (e.g. after moving this node or adding/removing children)\n\t\t\t * nodeRenderTitle() and nodeRenderStatus() are implied.\n\t\t\t *\n\t\t\t * ```html\n\t\t\t * <li id='KEY' ftnode=NODE>\n\t\t\t * <span class='fancytree-node fancytree-expanded fancytree-has-children fancytree-lastsib fancytree-exp-el fancytree-ico-e'>\n\t\t\t * <span class=\"fancytree-expander\"></span>\n\t\t\t * <span class=\"fancytree-checkbox\"></span> // only present in checkbox mode\n\t\t\t * <span class=\"fancytree-icon\"></span>\n\t\t\t * <a href=\"#\" class=\"fancytree-title\"> Node 1 </a>\n\t\t\t * </span>\n\t\t\t * <ul> // only present if node has children\n\t\t\t * <li id='KEY' ftnode=NODE> child1 ... </li>\n\t\t\t * <li id='KEY' ftnode=NODE> child2 ... </li>\n\t\t\t * </ul>\n\t\t\t * </li>\n\t\t\t * ```\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} [force=false] re-render, even if html markup was already created\n\t\t\t * @param {boolean} [deep=false] also render all descendants, even if parent is collapsed\n\t\t\t * @param {boolean} [collapsed=false] force root node to be collapsed, so we can apply animated expand later\n\t\t\t */\n\t\t\tnodeRender: function (ctx, force, deep, collapsed, _recursive) {\n\t\t\t\t/* This method must take care of all cases where the current data mode\n\t\t\t\t * (i.e. node hierarchy) does not match the current markup.\n\t\t\t\t *\n\t\t\t\t * - node was not yet rendered:\n\t\t\t\t * create markup\n\t\t\t\t * - node was rendered: exit fast\n\t\t\t\t * - children have been added\n\t\t\t\t * - children have been removed\n\t\t\t\t */\n\t\t\t\tvar childLI,\n\t\t\t\t\tchildNode1,\n\t\t\t\t\tchildNode2,\n\t\t\t\t\ti,\n\t\t\t\t\tl,\n\t\t\t\t\tnext,\n\t\t\t\t\tsubCtx,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\taria = opts.aria,\n\t\t\t\t\tfirstTime = false,\n\t\t\t\t\tparent = node.parent,\n\t\t\t\t\tisRootNode = !parent,\n\t\t\t\t\tchildren = node.children,\n\t\t\t\t\tsuccessorLi = null;\n\t\t\t\t// FT.debug(\"nodeRender(\" + !!force + \", \" + !!deep + \")\", node.toString());\n\n\t\t\t\tif (tree._enableUpdate === false) {\n\t\t\t\t\t// tree.debug(\"no render\", tree._enableUpdate);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!isRootNode && !parent.ul) {\n\t\t\t\t\t// Calling node.collapse on a deep, unrendered node\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t_assert(isRootNode || parent.ul, \"parent UL must exist\");\n\n\t\t\t\t// Render the node\n\t\t\t\tif (!isRootNode) {\n\t\t\t\t\t// Discard markup on force-mode, or if it is not linked to parent <ul>\n\t\t\t\t\tif (\n\t\t\t\t\t\tnode.li &&\n\t\t\t\t\t\t(force || node.li.parentNode !== node.parent.ul)\n\t\t\t\t\t) {\n\t\t\t\t\t\tif (node.li.parentNode === node.parent.ul) {\n\t\t\t\t\t\t\t// #486: store following node, so we can insert the new markup there later\n\t\t\t\t\t\t\tsuccessorLi = node.li.nextSibling;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// May happen, when a top-level node was dropped over another\n\t\t\t\t\t\t\tthis.debug(\n\t\t\t\t\t\t\t\t\"Unlinking \" +\n\t\t\t\t\t\t\t\t\tnode +\n\t\t\t\t\t\t\t\t\t\" (must be child of \" +\n\t\t\t\t\t\t\t\t\tnode.parent +\n\t\t\t\t\t\t\t\t\t\")\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//\t this.debug(\"nodeRemoveMarkup...\");\n\t\t\t\t\t\tthis.nodeRemoveMarkup(ctx);\n\t\t\t\t\t}\n\t\t\t\t\t// Create <li><span /> </li>\n\t\t\t\t\t// node.debug(\"render...\");\n\t\t\t\t\tif (node.li) {\n\t\t\t\t\t\t// this.nodeRenderTitle(ctx);\n\t\t\t\t\t\tthis.nodeRenderStatus(ctx);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// node.debug(\"render... really\");\n\t\t\t\t\t\tfirstTime = true;\n\t\t\t\t\t\tnode.li = document.createElement(\"li\");\n\t\t\t\t\t\tnode.li.ftnode = node;\n\n\t\t\t\t\t\tif (node.key && opts.generateIds) {\n\t\t\t\t\t\t\tnode.li.id = opts.idPrefix + node.key;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnode.span = document.createElement(\"span\");\n\t\t\t\t\t\tnode.span.className = \"fancytree-node\";\n\t\t\t\t\t\tif (aria && !node.tr) {\n\t\t\t\t\t\t\t$(node.li).attr(\"role\", \"treeitem\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnode.li.appendChild(node.span);\n\n\t\t\t\t\t\t// Create inner HTML for the <span> (expander, checkbox, icon, and title)\n\t\t\t\t\t\tthis.nodeRenderTitle(ctx);\n\n\t\t\t\t\t\t// Allow tweaking and binding, after node was created for the first time\n\t\t\t\t\t\tif (opts.createNode) {\n\t\t\t\t\t\t\topts.createNode.call(\n\t\t\t\t\t\t\t\ttree,\n\t\t\t\t\t\t\t\t{ type: \"createNode\" },\n\t\t\t\t\t\t\t\tctx\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Allow tweaking after node state was rendered\n\t\t\t\t\tif (opts.renderNode) {\n\t\t\t\t\t\topts.renderNode.call(tree, { type: \"renderNode\" }, ctx);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Visit child nodes\n\t\t\t\tif (children) {\n\t\t\t\t\tif (isRootNode || node.expanded || deep === true) {\n\t\t\t\t\t\t// Create a UL to hold the children\n\t\t\t\t\t\tif (!node.ul) {\n\t\t\t\t\t\t\tnode.ul = document.createElement(\"ul\");\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t(collapsed === true && !_recursive) ||\n\t\t\t\t\t\t\t\t!node.expanded\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t// hide top UL, so we can use an animation to show it later\n\t\t\t\t\t\t\t\tnode.ul.style.display = \"none\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (aria) {\n\t\t\t\t\t\t\t\t$(node.ul).attr(\"role\", \"group\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (node.li) {\n\t\t\t\t\t\t\t\t// issue #67\n\t\t\t\t\t\t\t\tnode.li.appendChild(node.ul);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tnode.tree.$div.append(node.ul);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Add child markup\n\t\t\t\t\t\tfor (i = 0, l = children.length; i < l; i++) {\n\t\t\t\t\t\t\tsubCtx = $.extend({}, ctx, { node: children[i] });\n\t\t\t\t\t\t\tthis.nodeRender(subCtx, force, deep, false, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Remove <li> if nodes have moved to another parent\n\t\t\t\t\t\tchildLI = node.ul.firstChild;\n\t\t\t\t\t\twhile (childLI) {\n\t\t\t\t\t\t\tchildNode2 = childLI.ftnode;\n\t\t\t\t\t\t\tif (childNode2 && childNode2.parent !== node) {\n\t\t\t\t\t\t\t\tnode.debug(\n\t\t\t\t\t\t\t\t\t\"_fixParent: remove missing \" + childNode2,\n\t\t\t\t\t\t\t\t\tchildLI\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tnext = childLI.nextSibling;\n\t\t\t\t\t\t\t\tchildLI.parentNode.removeChild(childLI);\n\t\t\t\t\t\t\t\tchildLI = next;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tchildLI = childLI.nextSibling;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Make sure, that <li> order matches node.children order.\n\t\t\t\t\t\tchildLI = node.ul.firstChild;\n\t\t\t\t\t\tfor (i = 0, l = children.length - 1; i < l; i++) {\n\t\t\t\t\t\t\tchildNode1 = children[i];\n\t\t\t\t\t\t\tchildNode2 = childLI.ftnode;\n\t\t\t\t\t\t\tif (childNode1 === childNode2) {\n\t\t\t\t\t\t\t\tchildLI = childLI.nextSibling;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// node.debug(\"_fixOrder: mismatch at index \" + i + \": \" + childNode1 + \" != \" + childNode2);\n\t\t\t\t\t\t\t\tnode.ul.insertBefore(\n\t\t\t\t\t\t\t\t\tchildNode1.li,\n\t\t\t\t\t\t\t\t\tchildNode2.li\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// No children: remove markup if any\n\t\t\t\t\tif (node.ul) {\n\t\t\t\t\t\t// alert(\"remove child markup for \" + node);\n\t\t\t\t\t\tthis.warn(\"remove child markup for \" + node);\n\t\t\t\t\t\tthis.nodeRemoveChildMarkup(ctx);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!isRootNode) {\n\t\t\t\t\t// Update element classes according to node state\n\t\t\t\t\t// this.nodeRenderStatus(ctx);\n\t\t\t\t\t// Finally add the whole structure to the DOM, so the browser can render\n\t\t\t\t\tif (firstTime) {\n\t\t\t\t\t\t// #486: successorLi is set, if we re-rendered (i.e. discarded)\n\t\t\t\t\t\t// existing markup, which we want to insert at the same position.\n\t\t\t\t\t\t// (null is equivalent to append)\n\t\t\t\t\t\t// \t\tparent.ul.appendChild(node.li);\n\t\t\t\t\t\tparent.ul.insertBefore(node.li, successorLi);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Create HTML inside the node's outer `<span>` (i.e. expander, checkbox,\n\t\t\t * icon, and title).\n\t\t\t *\n\t\t\t * nodeRenderStatus() is implied.\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {string} [title] optinal new title\n\t\t\t */\n\t\t\tnodeRenderTitle: function (ctx, title) {\n\t\t\t\t// set node connector images, links and text\n\t\t\t\tvar checkbox,\n\t\t\t\t\tclassName,\n\t\t\t\t\ticon,\n\t\t\t\t\tnodeTitle,\n\t\t\t\t\trole,\n\t\t\t\t\ttabindex,\n\t\t\t\t\ttooltip,\n\t\t\t\t\ticonTooltip,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\taria = opts.aria,\n\t\t\t\t\tlevel = node.getLevel(),\n\t\t\t\t\tares = [];\n\n\t\t\t\tif (title !== undefined) {\n\t\t\t\t\tnode.title = title;\n\t\t\t\t}\n\t\t\t\tif (!node.span || tree._enableUpdate === false) {\n\t\t\t\t\t// Silently bail out if node was not rendered yet, assuming\n\t\t\t\t\t// node.render() will be called as the node becomes visible\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Connector (expanded, expandable or simple)\n\t\t\t\trole =\n\t\t\t\t\taria && node.hasChildren() !== false\n\t\t\t\t\t\t? \" role='button'\"\n\t\t\t\t\t\t: \"\";\n\t\t\t\tif (level < opts.minExpandLevel) {\n\t\t\t\t\tif (!node.lazy) {\n\t\t\t\t\t\tnode.expanded = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (level > 1) {\n\t\t\t\t\t\tares.push(\n\t\t\t\t\t\t\t\"<span \" +\n\t\t\t\t\t\t\t\trole +\n\t\t\t\t\t\t\t\t\" class='fancytree-expander fancytree-expander-fixed'></span>\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t// .. else (i.e. for root level) skip expander/connector alltogether\n\t\t\t\t} else {\n\t\t\t\t\tares.push(\n\t\t\t\t\t\t\"<span \" + role + \" class='fancytree-expander'></span>\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// Checkbox mode\n\t\t\t\tcheckbox = FT.evalOption(\"checkbox\", node, node, opts, false);\n\n\t\t\t\tif (checkbox && !node.isStatusNode()) {\n\t\t\t\t\trole = aria ? \" role='checkbox'\" : \"\";\n\t\t\t\t\tclassName = \"fancytree-checkbox\";\n\t\t\t\t\tif (\n\t\t\t\t\t\tcheckbox === \"radio\" ||\n\t\t\t\t\t\t(node.parent && node.parent.radiogroup)\n\t\t\t\t\t) {\n\t\t\t\t\t\tclassName += \" fancytree-radio\";\n\t\t\t\t\t}\n\t\t\t\t\tares.push(\n\t\t\t\t\t\t\"<span \" + role + \" class='\" + className + \"'></span>\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// Folder or doctype icon\n\t\t\t\tif (node.data.iconClass !== undefined) {\n\t\t\t\t\t// 2015-11-16\n\t\t\t\t\t// Handle / warn about backward compatibility\n\t\t\t\t\tif (node.icon) {\n\t\t\t\t\t\t$.error(\n\t\t\t\t\t\t\t\"'iconClass' node option is deprecated since v2.14.0: use 'icon' only instead\"\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\t\"'iconClass' node option is deprecated since v2.14.0: use 'icon' instead\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tnode.icon = node.data.iconClass;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If opts.icon is a callback and returns something other than undefined, use that\n\t\t\t\t// else if node.icon is a boolean or string, use that\n\t\t\t\t// else if opts.icon is a boolean or string, use that\n\t\t\t\t// else show standard icon (which may be different for folders or documents)\n\t\t\t\ticon = FT.evalOption(\"icon\", node, node, opts, true);\n\t\t\t\t// if( typeof icon !== \"boolean\" ) {\n\t\t\t\t// \t// icon is defined, but not true/false: must be a string\n\t\t\t\t// \ticon = \"\" + icon;\n\t\t\t\t// }\n\t\t\t\tif (icon !== false) {\n\t\t\t\t\trole = aria ? \" role='presentation'\" : \"\";\n\n\t\t\t\t\ticonTooltip = FT.evalOption(\n\t\t\t\t\t\t\"iconTooltip\",\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\topts,\n\t\t\t\t\t\tnull\n\t\t\t\t\t);\n\t\t\t\t\ticonTooltip = iconTooltip\n\t\t\t\t\t\t? \" title='\" + _escapeTooltip(iconTooltip) + \"'\"\n\t\t\t\t\t\t: \"\";\n\n\t\t\t\t\tif (typeof icon === \"string\") {\n\t\t\t\t\t\tif (TEST_IMG.test(icon)) {\n\t\t\t\t\t\t\t// node.icon is an image url. Prepend imagePath\n\t\t\t\t\t\t\ticon =\n\t\t\t\t\t\t\t\ticon.charAt(0) === \"/\"\n\t\t\t\t\t\t\t\t\t? icon\n\t\t\t\t\t\t\t\t\t: (opts.imagePath || \"\") + icon;\n\t\t\t\t\t\t\tares.push(\n\t\t\t\t\t\t\t\t\"<img src='\" +\n\t\t\t\t\t\t\t\t\ticon +\n\t\t\t\t\t\t\t\t\t\"' class='fancytree-icon'\" +\n\t\t\t\t\t\t\t\t\ticonTooltip +\n\t\t\t\t\t\t\t\t\t\" alt='' />\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tares.push(\n\t\t\t\t\t\t\t\t\"<span \" +\n\t\t\t\t\t\t\t\t\trole +\n\t\t\t\t\t\t\t\t\t\" class='fancytree-custom-icon \" +\n\t\t\t\t\t\t\t\t\ticon +\n\t\t\t\t\t\t\t\t\t\"'\" +\n\t\t\t\t\t\t\t\t\ticonTooltip +\n\t\t\t\t\t\t\t\t\t\"></span>\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (icon.text) {\n\t\t\t\t\t\tares.push(\n\t\t\t\t\t\t\t\"<span \" +\n\t\t\t\t\t\t\t\trole +\n\t\t\t\t\t\t\t\t\" class='fancytree-custom-icon \" +\n\t\t\t\t\t\t\t\t(icon.addClass || \"\") +\n\t\t\t\t\t\t\t\t\"'\" +\n\t\t\t\t\t\t\t\ticonTooltip +\n\t\t\t\t\t\t\t\t\">\" +\n\t\t\t\t\t\t\t\tFT.escapeHtml(icon.text) +\n\t\t\t\t\t\t\t\t\"</span>\"\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if (icon.html) {\n\t\t\t\t\t\tares.push(\n\t\t\t\t\t\t\t\"<span \" +\n\t\t\t\t\t\t\t\trole +\n\t\t\t\t\t\t\t\t\" class='fancytree-custom-icon \" +\n\t\t\t\t\t\t\t\t(icon.addClass || \"\") +\n\t\t\t\t\t\t\t\t\"'\" +\n\t\t\t\t\t\t\t\ticonTooltip +\n\t\t\t\t\t\t\t\t\">\" +\n\t\t\t\t\t\t\t\ticon.html +\n\t\t\t\t\t\t\t\t\"</span>\"\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// standard icon: theme css will take care of this\n\t\t\t\t\t\tares.push(\n\t\t\t\t\t\t\t\"<span \" +\n\t\t\t\t\t\t\t\trole +\n\t\t\t\t\t\t\t\t\" class='fancytree-icon'\" +\n\t\t\t\t\t\t\t\ticonTooltip +\n\t\t\t\t\t\t\t\t\"></span>\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Node title\n\t\t\t\tnodeTitle = \"\";\n\t\t\t\tif (opts.renderTitle) {\n\t\t\t\t\tnodeTitle =\n\t\t\t\t\t\topts.renderTitle.call(\n\t\t\t\t\t\t\ttree,\n\t\t\t\t\t\t\t{ type: \"renderTitle\" },\n\t\t\t\t\t\t\tctx\n\t\t\t\t\t\t) || \"\";\n\t\t\t\t}\n\t\t\t\tif (!nodeTitle) {\n\t\t\t\t\ttooltip = FT.evalOption(\"tooltip\", node, node, opts, null);\n\t\t\t\t\tif (tooltip === true) {\n\t\t\t\t\t\ttooltip = node.title;\n\t\t\t\t\t}\n\t\t\t\t\t// if( node.tooltip ) {\n\t\t\t\t\t// \ttooltip = node.tooltip;\n\t\t\t\t\t// } else if ( opts.tooltip ) {\n\t\t\t\t\t// \ttooltip = opts.tooltip === true ? node.title : opts.tooltip.call(tree, node);\n\t\t\t\t\t// }\n\t\t\t\t\ttooltip = tooltip\n\t\t\t\t\t\t? \" title='\" + _escapeTooltip(tooltip) + \"'\"\n\t\t\t\t\t\t: \"\";\n\t\t\t\t\ttabindex = opts.titlesTabbable ? \" tabindex='0'\" : \"\";\n\n\t\t\t\t\tnodeTitle =\n\t\t\t\t\t\t\"<span class='fancytree-title'\" +\n\t\t\t\t\t\ttooltip +\n\t\t\t\t\t\ttabindex +\n\t\t\t\t\t\t\">\" +\n\t\t\t\t\t\t(opts.escapeTitles\n\t\t\t\t\t\t\t? FT.escapeHtml(node.title)\n\t\t\t\t\t\t\t: node.title) +\n\t\t\t\t\t\t\"</span>\";\n\t\t\t\t}\n\t\t\t\tares.push(nodeTitle);\n\t\t\t\t// Note: this will trigger focusout, if node had the focus\n\t\t\t\t//$(node.span).html(ares.join(\"\")); // it will cleanup the jQuery data currently associated with SPAN (if any), but it executes more slowly\n\t\t\t\tnode.span.innerHTML = ares.join(\"\");\n\t\t\t\t// Update CSS classes\n\t\t\t\tthis.nodeRenderStatus(ctx);\n\t\t\t\tif (opts.enhanceTitle) {\n\t\t\t\t\tctx.$title = $(\">span.fancytree-title\", node.span);\n\t\t\t\t\tnodeTitle =\n\t\t\t\t\t\topts.enhanceTitle.call(\n\t\t\t\t\t\t\ttree,\n\t\t\t\t\t\t\t{ type: \"enhanceTitle\" },\n\t\t\t\t\t\t\tctx\n\t\t\t\t\t\t) || \"\";\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Update element classes according to node state.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeRenderStatus: function (ctx) {\n\t\t\t\t// Set classes for current status\n\t\t\t\tvar $ariaElem,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\t// \tnodeContainer = node[tree.nodeContainerAttrName],\n\t\t\t\t\thasChildren = node.hasChildren(),\n\t\t\t\t\tisLastSib = node.isLastSibling(),\n\t\t\t\t\taria = opts.aria,\n\t\t\t\t\tcn = opts._classNames,\n\t\t\t\t\tcnList = [],\n\t\t\t\t\tstatusElem = node[tree.statusClassPropName];\n\n\t\t\t\tif (!statusElem || tree._enableUpdate === false) {\n\t\t\t\t\t// if this function is called for an unrendered node, ignore it (will be updated on nect render anyway)\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (aria) {\n\t\t\t\t\t$ariaElem = $(node.tr || node.li);\n\t\t\t\t}\n\t\t\t\t// Build a list of class names that we will add to the node <span>\n\t\t\t\tcnList.push(cn.node);\n\t\t\t\tif (tree.activeNode === node) {\n\t\t\t\t\tcnList.push(cn.active);\n\t\t\t\t\t// \t\t$(\">span.fancytree-title\", statusElem).attr(\"tabindex\", \"0\");\n\t\t\t\t\t// \t\ttree.$container.removeAttr(\"tabindex\");\n\t\t\t\t\t// }else{\n\t\t\t\t\t// \t\t$(\">span.fancytree-title\", statusElem).removeAttr(\"tabindex\");\n\t\t\t\t\t// \t\ttree.$container.attr(\"tabindex\", \"0\");\n\t\t\t\t}\n\t\t\t\tif (tree.focusNode === node) {\n\t\t\t\t\tcnList.push(cn.focused);\n\t\t\t\t}\n\t\t\t\tif (node.expanded) {\n\t\t\t\t\tcnList.push(cn.expanded);\n\t\t\t\t}\n\t\t\t\tif (aria) {\n\t\t\t\t\tif (hasChildren === false) {\n\t\t\t\t\t\t$ariaElem.removeAttr(\"aria-expanded\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$ariaElem.attr(\"aria-expanded\", Boolean(node.expanded));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (node.folder) {\n\t\t\t\t\tcnList.push(cn.folder);\n\t\t\t\t}\n\t\t\t\tif (hasChildren !== false) {\n\t\t\t\t\tcnList.push(cn.hasChildren);\n\t\t\t\t}\n\t\t\t\t// TODO: required?\n\t\t\t\tif (isLastSib) {\n\t\t\t\t\tcnList.push(cn.lastsib);\n\t\t\t\t}\n\t\t\t\tif (node.lazy && node.children == null) {\n\t\t\t\t\tcnList.push(cn.lazy);\n\t\t\t\t}\n\t\t\t\tif (node.partload) {\n\t\t\t\t\tcnList.push(cn.partload);\n\t\t\t\t}\n\t\t\t\tif (node.partsel) {\n\t\t\t\t\tcnList.push(cn.partsel);\n\t\t\t\t}\n\t\t\t\tif (FT.evalOption(\"unselectable\", node, node, opts, false)) {\n\t\t\t\t\tcnList.push(cn.unselectable);\n\t\t\t\t}\n\t\t\t\tif (node._isLoading) {\n\t\t\t\t\tcnList.push(cn.loading);\n\t\t\t\t}\n\t\t\t\tif (node._error) {\n\t\t\t\t\tcnList.push(cn.error);\n\t\t\t\t}\n\t\t\t\tif (node.statusNodeType) {\n\t\t\t\t\tcnList.push(cn.statusNodePrefix + node.statusNodeType);\n\t\t\t\t}\n\t\t\t\tif (node.selected) {\n\t\t\t\t\tcnList.push(cn.selected);\n\t\t\t\t\tif (aria) {\n\t\t\t\t\t\t$ariaElem.attr(\"aria-selected\", true);\n\t\t\t\t\t}\n\t\t\t\t} else if (aria) {\n\t\t\t\t\t$ariaElem.attr(\"aria-selected\", false);\n\t\t\t\t}\n\t\t\t\tif (node.extraClasses) {\n\t\t\t\t\tcnList.push(node.extraClasses);\n\t\t\t\t}\n\t\t\t\t// IE6 doesn't correctly evaluate multiple class names,\n\t\t\t\t// so we create combined class names that can be used in the CSS\n\t\t\t\tif (hasChildren === false) {\n\t\t\t\t\tcnList.push(\n\t\t\t\t\t\tcn.combinedExpanderPrefix + \"n\" + (isLastSib ? \"l\" : \"\")\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tcnList.push(\n\t\t\t\t\t\tcn.combinedExpanderPrefix +\n\t\t\t\t\t\t\t(node.expanded ? \"e\" : \"c\") +\n\t\t\t\t\t\t\t(node.lazy && node.children == null ? \"d\" : \"\") +\n\t\t\t\t\t\t\t(isLastSib ? \"l\" : \"\")\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tcnList.push(\n\t\t\t\t\tcn.combinedIconPrefix +\n\t\t\t\t\t\t(node.expanded ? \"e\" : \"c\") +\n\t\t\t\t\t\t(node.folder ? \"f\" : \"\")\n\t\t\t\t);\n\t\t\t\t// node.span.className = cnList.join(\" \");\n\t\t\t\tstatusElem.className = cnList.join(\" \");\n\n\t\t\t\t// TODO: we should not set this in the <span> tag also, if we set it here:\n\t\t\t\t// Maybe most (all) of the classes should be set in LI instead of SPAN?\n\t\t\t\tif (node.li) {\n\t\t\t\t\t// #719: we have to consider that there may be already other classes:\n\t\t\t\t\t$(node.li).toggleClass(cn.lastsib, isLastSib);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Activate node.\n\t\t\t * flag defaults to true.\n\t\t\t * If flag is true, the node is activated (must be a synchronous operation)\n\t\t\t * If flag is false, the node is deactivated (must be a synchronous operation)\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} [flag=true]\n\t\t\t * @param {object} [opts] additional options. Defaults to {noEvents: false, noFocus: false}\n\t\t\t * @returns {$.Promise}\n\t\t\t */\n\t\t\tnodeSetActive: function (ctx, flag, callOpts) {\n\t\t\t\t// Handle user click / [space] / [enter], according to clickFolderMode.\n\t\t\t\tcallOpts = callOpts || {};\n\t\t\t\tvar subCtx,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\tnoEvents = callOpts.noEvents === true,\n\t\t\t\t\tnoFocus = callOpts.noFocus === true,\n\t\t\t\t\tscroll = callOpts.scrollIntoView !== false,\n\t\t\t\t\tisActive = node === tree.activeNode;\n\n\t\t\t\t// flag defaults to true\n\t\t\t\tflag = flag !== false;\n\t\t\t\t// node.debug(\"nodeSetActive\", flag);\n\n\t\t\t\tif (isActive === flag) {\n\t\t\t\t\t// Nothing to do\n\t\t\t\t\treturn _getResolvedPromise(node);\n\t\t\t\t}\n\t\t\t\t// #1042: don't scroll between mousedown/-up when clicking an embedded link\n\t\t\t\tif (\n\t\t\t\t\tscroll &&\n\t\t\t\t\tctx.originalEvent &&\n\t\t\t\t\t$(ctx.originalEvent.target).is(\"a,:checkbox\")\n\t\t\t\t) {\n\t\t\t\t\tnode.info(\"Not scrolling while clicking an embedded link.\");\n\t\t\t\t\tscroll = false;\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\tflag &&\n\t\t\t\t\t!noEvents &&\n\t\t\t\t\tthis._triggerNodeEvent(\n\t\t\t\t\t\t\"beforeActivate\",\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tctx.originalEvent\n\t\t\t\t\t) === false\n\t\t\t\t) {\n\t\t\t\t\t// Callback returned false\n\t\t\t\t\treturn _getRejectedPromise(node, [\"rejected\"]);\n\t\t\t\t}\n\t\t\t\tif (flag) {\n\t\t\t\t\tif (tree.activeNode) {\n\t\t\t\t\t\t_assert(\n\t\t\t\t\t\t\ttree.activeNode !== node,\n\t\t\t\t\t\t\t\"node was active (inconsistency)\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tsubCtx = $.extend({}, ctx, { node: tree.activeNode });\n\t\t\t\t\t\ttree.nodeSetActive(subCtx, false);\n\t\t\t\t\t\t_assert(\n\t\t\t\t\t\t\ttree.activeNode === null,\n\t\t\t\t\t\t\t\"deactivate was out of sync?\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (opts.activeVisible) {\n\t\t\t\t\t\t// If no focus is set (noFocus: true) and there is no focused node, this node is made visible.\n\t\t\t\t\t\t// scroll = noFocus && tree.focusNode == null;\n\t\t\t\t\t\t// #863: scroll by default (unless `scrollIntoView: false` was passed)\n\t\t\t\t\t\tnode.makeVisible({ scrollIntoView: scroll });\n\t\t\t\t\t}\n\t\t\t\t\ttree.activeNode = node;\n\t\t\t\t\ttree.nodeRenderStatus(ctx);\n\t\t\t\t\tif (!noFocus) {\n\t\t\t\t\t\ttree.nodeSetFocus(ctx);\n\t\t\t\t\t}\n\t\t\t\t\tif (!noEvents) {\n\t\t\t\t\t\ttree._triggerNodeEvent(\n\t\t\t\t\t\t\t\"activate\",\n\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\tctx.originalEvent\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t_assert(\n\t\t\t\t\t\ttree.activeNode === node,\n\t\t\t\t\t\t\"node was not active (inconsistency)\"\n\t\t\t\t\t);\n\t\t\t\t\ttree.activeNode = null;\n\t\t\t\t\tthis.nodeRenderStatus(ctx);\n\t\t\t\t\tif (!noEvents) {\n\t\t\t\t\t\tctx.tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\"deactivate\",\n\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\tctx.originalEvent\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn _getResolvedPromise(node);\n\t\t\t},\n\t\t\t/** Expand or collapse node, return Deferred.promise.\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} [flag=true]\n\t\t\t * @param {object} [opts] additional options. Defaults to `{noAnimation: false, noEvents: false}`\n\t\t\t * @returns {$.Promise} The deferred will be resolved as soon as the (lazy)\n\t\t\t * data was retrieved, rendered, and the expand animation finished.\n\t\t\t */\n\t\t\tnodeSetExpanded: function (ctx, flag, callOpts) {\n\t\t\t\tcallOpts = callOpts || {};\n\t\t\t\tvar _afterLoad,\n\t\t\t\t\tdfd,\n\t\t\t\t\ti,\n\t\t\t\t\tl,\n\t\t\t\t\tparents,\n\t\t\t\t\tprevAC,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\tnoAnimation = callOpts.noAnimation === true,\n\t\t\t\t\tnoEvents = callOpts.noEvents === true;\n\n\t\t\t\t// flag defaults to true\n\t\t\t\tflag = flag !== false;\n\n\t\t\t\t// node.debug(\"nodeSetExpanded(\" + flag + \")\");\n\n\t\t\t\tif ($(node.li).hasClass(opts._classNames.animating)) {\n\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\"setExpanded(\" + flag + \") while animating: ignored.\"\n\t\t\t\t\t);\n\t\t\t\t\treturn _getRejectedPromise(node, [\"recursion\"]);\n\t\t\t\t}\n\n\t\t\t\tif ((node.expanded && flag) || (!node.expanded && !flag)) {\n\t\t\t\t\t// Nothing to do\n\t\t\t\t\t// node.debug(\"nodeSetExpanded(\" + flag + \"): nothing to do\");\n\t\t\t\t\treturn _getResolvedPromise(node);\n\t\t\t\t} else if (flag && !node.lazy && !node.hasChildren()) {\n\t\t\t\t\t// Prevent expanding of empty nodes\n\t\t\t\t\t// return _getRejectedPromise(node, [\"empty\"]);\n\t\t\t\t\treturn _getResolvedPromise(node);\n\t\t\t\t} else if (!flag && node.getLevel() < opts.minExpandLevel) {\n\t\t\t\t\t// Prevent collapsing locked levels\n\t\t\t\t\treturn _getRejectedPromise(node, [\"locked\"]);\n\t\t\t\t} else if (\n\t\t\t\t\t!noEvents &&\n\t\t\t\t\tthis._triggerNodeEvent(\n\t\t\t\t\t\t\"beforeExpand\",\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tctx.originalEvent\n\t\t\t\t\t) === false\n\t\t\t\t) {\n\t\t\t\t\t// Callback returned false\n\t\t\t\t\treturn _getRejectedPromise(node, [\"rejected\"]);\n\t\t\t\t}\n\t\t\t\t// If this node inside a collpased node, no animation and scrolling is needed\n\t\t\t\tif (!noAnimation && !node.isVisible()) {\n\t\t\t\t\tnoAnimation = callOpts.noAnimation = true;\n\t\t\t\t}\n\n\t\t\t\tdfd = new $.Deferred();\n\n\t\t\t\t// Auto-collapse mode: collapse all siblings\n\t\t\t\tif (flag && !node.expanded && opts.autoCollapse) {\n\t\t\t\t\tparents = node.getParentList(false, true);\n\t\t\t\t\tprevAC = opts.autoCollapse;\n\t\t\t\t\ttry {\n\t\t\t\t\t\topts.autoCollapse = false;\n\t\t\t\t\t\tfor (i = 0, l = parents.length; i < l; i++) {\n\t\t\t\t\t\t\t// TODO: should return promise?\n\t\t\t\t\t\t\tthis._callHook(\n\t\t\t\t\t\t\t\t\"nodeCollapseSiblings\",\n\t\t\t\t\t\t\t\tparents[i],\n\t\t\t\t\t\t\t\tcallOpts\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} finally {\n\t\t\t\t\t\topts.autoCollapse = prevAC;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Trigger expand/collapse after expanding\n\t\t\t\tdfd.done(function () {\n\t\t\t\t\tvar lastChild = node.getLastChild();\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tflag &&\n\t\t\t\t\t\topts.autoScroll &&\n\t\t\t\t\t\t!noAnimation &&\n\t\t\t\t\t\tlastChild &&\n\t\t\t\t\t\ttree._enableUpdate\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Scroll down to last child, but keep current node visible\n\t\t\t\t\t\tlastChild\n\t\t\t\t\t\t\t.scrollIntoView(true, { topNode: node })\n\t\t\t\t\t\t\t.always(function () {\n\t\t\t\t\t\t\t\tif (!noEvents) {\n\t\t\t\t\t\t\t\t\tctx.tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\t\tflag ? \"expand\" : \"collapse\",\n\t\t\t\t\t\t\t\t\t\tctx\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!noEvents) {\n\t\t\t\t\t\t\tctx.tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\tflag ? \"expand\" : \"collapse\",\n\t\t\t\t\t\t\t\tctx\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t// vvv Code below is executed after loading finished:\n\t\t\t\t_afterLoad = function (callback) {\n\t\t\t\t\tvar cn = opts._classNames,\n\t\t\t\t\t\tisVisible,\n\t\t\t\t\t\tisExpanded,\n\t\t\t\t\t\teffect = opts.toggleEffect;\n\n\t\t\t\t\tnode.expanded = flag;\n\t\t\t\t\ttree._callHook(\n\t\t\t\t\t\t\"treeStructureChanged\",\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tflag ? \"expand\" : \"collapse\"\n\t\t\t\t\t);\n\t\t\t\t\t// Create required markup, but make sure the top UL is hidden, so we\n\t\t\t\t\t// can animate later\n\t\t\t\t\ttree._callHook(\"nodeRender\", ctx, false, false, true);\n\n\t\t\t\t\t// Hide children, if node is collapsed\n\t\t\t\t\tif (node.ul) {\n\t\t\t\t\t\tisVisible = node.ul.style.display !== \"none\";\n\t\t\t\t\t\tisExpanded = !!node.expanded;\n\t\t\t\t\t\tif (isVisible === isExpanded) {\n\t\t\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\t\t\"nodeSetExpanded: UL.style.display already set\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else if (!effect || noAnimation) {\n\t\t\t\t\t\t\tnode.ul.style.display =\n\t\t\t\t\t\t\t\tnode.expanded || !parent ? \"\" : \"none\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// The UI toggle() effect works with the ext-wide extension,\n\t\t\t\t\t\t\t// while jQuery.animate() has problems when the title span\n\t\t\t\t\t\t\t// has position: absolute.\n\t\t\t\t\t\t\t// Since jQuery UI 1.12, the blind effect requires the parent\n\t\t\t\t\t\t\t// element to have 'position: relative'.\n\t\t\t\t\t\t\t// See #716, #717\n\t\t\t\t\t\t\t$(node.li).addClass(cn.animating); // #717\n\n\t\t\t\t\t\t\tif (_isFunction($(node.ul)[effect.effect])) {\n\t\t\t\t\t\t\t\t// tree.debug( \"use jquery.\" + effect.effect + \" method\" );\n\t\t\t\t\t\t\t\t$(node.ul)[effect.effect]({\n\t\t\t\t\t\t\t\t\tduration: effect.duration,\n\t\t\t\t\t\t\t\t\talways: function () {\n\t\t\t\t\t\t\t\t\t\t// node.debug(\"fancytree-animating end: \" + node.li.className);\n\t\t\t\t\t\t\t\t\t\t$(this).removeClass(cn.animating); // #716\n\t\t\t\t\t\t\t\t\t\t$(node.li).removeClass(cn.animating); // #717\n\t\t\t\t\t\t\t\t\t\tcallback();\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// The UI toggle() effect works with the ext-wide extension,\n\t\t\t\t\t\t\t\t// while jQuery.animate() has problems when the title span\n\t\t\t\t\t\t\t\t// has positon: absolute.\n\t\t\t\t\t\t\t\t// Since jQuery UI 1.12, the blind effect requires the parent\n\t\t\t\t\t\t\t\t// element to have 'position: relative'.\n\t\t\t\t\t\t\t\t// See #716, #717\n\t\t\t\t\t\t\t\t// tree.debug(\"use specified effect (\" + effect.effect + \") with the jqueryui.toggle method\");\n\n\t\t\t\t\t\t\t\t// try to stop an animation that might be already in progress\n\t\t\t\t\t\t\t\t$(node.ul).stop(true, true); //< does not work after resetLazy has been called for a node whose animation wasn't complete and effect was \"blind\"\n\n\t\t\t\t\t\t\t\t// dirty fix to remove a defunct animation (effect: \"blind\") after resetLazy has been called\n\t\t\t\t\t\t\t\t$(node.ul)\n\t\t\t\t\t\t\t\t\t.parent()\n\t\t\t\t\t\t\t\t\t.find(\".ui-effects-placeholder\")\n\t\t\t\t\t\t\t\t\t.remove();\n\n\t\t\t\t\t\t\t\t$(node.ul).toggle(\n\t\t\t\t\t\t\t\t\teffect.effect,\n\t\t\t\t\t\t\t\t\teffect.options,\n\t\t\t\t\t\t\t\t\teffect.duration,\n\t\t\t\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t\t\t\t// node.debug(\"fancytree-animating end: \" + node.li.className);\n\t\t\t\t\t\t\t\t\t\t$(this).removeClass(cn.animating); // #716\n\t\t\t\t\t\t\t\t\t\t$(node.li).removeClass(cn.animating); // #717\n\t\t\t\t\t\t\t\t\t\tcallback();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcallback();\n\t\t\t\t};\n\t\t\t\t// ^^^ Code above is executed after loading finshed.\n\n\t\t\t\t// Load lazy nodes, if any. Then continue with _afterLoad()\n\t\t\t\tif (flag && node.lazy && node.hasChildren() === undefined) {\n\t\t\t\t\t// node.debug(\"nodeSetExpanded: load start...\");\n\t\t\t\t\tnode.load()\n\t\t\t\t\t\t.done(function () {\n\t\t\t\t\t\t\t// node.debug(\"nodeSetExpanded: load done\");\n\t\t\t\t\t\t\tif (dfd.notifyWith) {\n\t\t\t\t\t\t\t\t// requires jQuery 1.6+\n\t\t\t\t\t\t\t\tdfd.notifyWith(node, [\"loaded\"]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_afterLoad(function () {\n\t\t\t\t\t\t\t\tdfd.resolveWith(node);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.fail(function (errMsg) {\n\t\t\t\t\t\t\t_afterLoad(function () {\n\t\t\t\t\t\t\t\tdfd.rejectWith(node, [\n\t\t\t\t\t\t\t\t\t\"load failed (\" + errMsg + \")\",\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t/*\n\t\t\t\t\tvar source = tree._triggerNodeEvent(\"lazyLoad\", node, ctx.originalEvent);\n\t\t\t\t\t_assert(typeof source !== \"boolean\", \"lazyLoad event must return source in data.result\");\n\t\t\t\t\tnode.debug(\"nodeSetExpanded: load start...\");\n\t\t\t\t\tthis._callHook(\"nodeLoadChildren\", ctx, source).done(function(){\n\t\t\t\t\t\tnode.debug(\"nodeSetExpanded: load done\");\n\t\t\t\t\t\tif(dfd.notifyWith){ // requires jQuery 1.6+\n\t\t\t\t\t\t\tdfd.notifyWith(node, [\"loaded\"]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t_afterLoad.call(tree);\n\t\t\t\t\t}).fail(function(errMsg){\n\t\t\t\t\t\tdfd.rejectWith(node, [\"load failed (\" + errMsg + \")\"]);\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t} else {\n\t\t\t\t\t_afterLoad(function () {\n\t\t\t\t\t\tdfd.resolveWith(node);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// node.debug(\"nodeSetExpanded: returns\");\n\t\t\t\treturn dfd.promise();\n\t\t\t},\n\t\t\t/** Focus or blur this node.\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} [flag=true]\n\t\t\t */\n\t\t\tnodeSetFocus: function (ctx, flag) {\n\t\t\t\t// ctx.node.debug(\"nodeSetFocus(\" + flag + \")\");\n\t\t\t\tvar ctx2,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\topts = tree.options,\n\t\t\t\t\t// et = ctx.originalEvent && ctx.originalEvent.type,\n\t\t\t\t\tisInput = ctx.originalEvent\n\t\t\t\t\t\t? $(ctx.originalEvent.target).is(\":input\")\n\t\t\t\t\t\t: false;\n\n\t\t\t\tflag = flag !== false;\n\n\t\t\t\t// (node || tree).debug(\"nodeSetFocus(\" + flag + \"), event: \" + et + \", isInput: \"+ isInput);\n\t\t\t\t// Blur previous node if any\n\t\t\t\tif (tree.focusNode) {\n\t\t\t\t\tif (tree.focusNode === node && flag) {\n\t\t\t\t\t\t// node.debug(\"nodeSetFocus(\" + flag + \"): nothing to do\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tctx2 = $.extend({}, ctx, { node: tree.focusNode });\n\t\t\t\t\ttree.focusNode = null;\n\t\t\t\t\tthis._triggerNodeEvent(\"blur\", ctx2);\n\t\t\t\t\tthis._callHook(\"nodeRenderStatus\", ctx2);\n\t\t\t\t}\n\t\t\t\t// Set focus to container and node\n\t\t\t\tif (flag) {\n\t\t\t\t\tif (!this.hasFocus()) {\n\t\t\t\t\t\tnode.debug(\"nodeSetFocus: forcing container focus\");\n\t\t\t\t\t\tthis._callHook(\"treeSetFocus\", ctx, true, {\n\t\t\t\t\t\t\tcalledByNode: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tnode.makeVisible({ scrollIntoView: false });\n\t\t\t\t\ttree.focusNode = node;\n\t\t\t\t\tif (opts.titlesTabbable) {\n\t\t\t\t\t\tif (!isInput) {\n\t\t\t\t\t\t\t// #621\n\t\t\t\t\t\t\t$(node.span).find(\".fancytree-title\").focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (opts.aria) {\n\t\t\t\t\t\t// Set active descendant to node's span ID (create one, if needed)\n\t\t\t\t\t\t$(tree.$container).attr(\n\t\t\t\t\t\t\t\"aria-activedescendant\",\n\t\t\t\t\t\t\t$(node.tr || node.li)\n\t\t\t\t\t\t\t\t.uniqueId()\n\t\t\t\t\t\t\t\t.attr(\"id\")\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// \"ftal_\" + opts.idPrefix + node.key);\n\t\t\t\t\t}\n\t\t\t\t\t// $(node.span).find(\".fancytree-title\").focus();\n\t\t\t\t\tthis._triggerNodeEvent(\"focus\", ctx);\n\n\t\t\t\t\t// determine if we have focus on or inside tree container\n\t\t\t\t\tvar hasFancytreeFocus =\n\t\t\t\t\t\tdocument.activeElement === tree.$container.get(0) ||\n\t\t\t\t\t\t$(document.activeElement, tree.$container).length >= 1;\n\n\t\t\t\t\tif (!hasFancytreeFocus) {\n\t\t\t\t\t\t// We cannot set KB focus to a node, so use the tree container\n\t\t\t\t\t\t// #563, #570: IE scrolls on every call to .focus(), if the container\n\t\t\t\t\t\t// is partially outside the viewport. So do it only, when absolutely\n\t\t\t\t\t\t// necessary.\n\t\t\t\t\t\t$(tree.$container).focus();\n\t\t\t\t\t}\n\n\t\t\t\t\t// if( opts.autoActivate ){\n\t\t\t\t\t// \ttree.nodeSetActive(ctx, true);\n\t\t\t\t\t// }\n\t\t\t\t\tif (opts.autoScroll) {\n\t\t\t\t\t\tnode.scrollIntoView();\n\t\t\t\t\t}\n\t\t\t\t\tthis._callHook(\"nodeRenderStatus\", ctx);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** (De)Select node, return new status (sync).\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} [flag=true]\n\t\t\t * @param {object} [opts] additional options. Defaults to {noEvents: false,\n\t\t\t * propagateDown: null, propagateUp: null,\n\t\t\t * callback: null,\n\t\t\t * }\n\t\t\t * @returns {boolean} previous status\n\t\t\t */\n\t\t\tnodeSetSelected: function (ctx, flag, callOpts) {\n\t\t\t\tcallOpts = callOpts || {};\n\t\t\t\tvar node = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\tnoEvents = callOpts.noEvents === true,\n\t\t\t\t\tparent = node.parent;\n\n\t\t\t\t// flag defaults to true\n\t\t\t\tflag = flag !== false;\n\n\t\t\t\t// node.debug(\"nodeSetSelected(\" + flag + \")\", ctx);\n\n\t\t\t\t// Cannot (de)select unselectable nodes directly (only by propagation or\n\t\t\t\t// by setting the `.selected` property)\n\t\t\t\tif (FT.evalOption(\"unselectable\", node, node, opts, false)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Remember the user's intent, in case down -> up propagation prevents\n\t\t\t\t// applying it to node.selected\n\t\t\t\tnode._lastSelectIntent = flag; // Confusing use of '!'\n\n\t\t\t\t// Nothing to do?\n\t\t\t\tif (!!node.selected === flag) {\n\t\t\t\t\tif (opts.selectMode === 3 && node.partsel && !flag) {\n\t\t\t\t\t\t// If propagation prevented selecting this node last time, we still\n\t\t\t\t\t\t// want to allow to apply setSelected(false) now\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn flag;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t!noEvents &&\n\t\t\t\t\tthis._triggerNodeEvent(\n\t\t\t\t\t\t\"beforeSelect\",\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tctx.originalEvent\n\t\t\t\t\t) === false\n\t\t\t\t) {\n\t\t\t\t\treturn !!node.selected;\n\t\t\t\t}\n\t\t\t\tif (flag && opts.selectMode === 1) {\n\t\t\t\t\t// single selection mode (we don't uncheck all tree nodes, for performance reasons)\n\t\t\t\t\tif (tree.lastSelectedNode) {\n\t\t\t\t\t\ttree.lastSelectedNode.setSelected(false);\n\t\t\t\t\t}\n\t\t\t\t\tnode.selected = flag;\n\t\t\t\t} else if (\n\t\t\t\t\topts.selectMode === 3 &&\n\t\t\t\t\tparent &&\n\t\t\t\t\t!parent.radiogroup &&\n\t\t\t\t\t!node.radiogroup\n\t\t\t\t) {\n\t\t\t\t\t// multi-hierarchical selection mode\n\t\t\t\t\tnode.selected = flag;\n\t\t\t\t\tnode.fixSelection3AfterClick(callOpts);\n\t\t\t\t} else if (parent && parent.radiogroup) {\n\t\t\t\t\tnode.visitSiblings(function (n) {\n\t\t\t\t\t\tn._changeSelectStatusAttrs(flag && n === node);\n\t\t\t\t\t}, true);\n\t\t\t\t} else {\n\t\t\t\t\t// default: selectMode: 2, multi selection mode\n\t\t\t\t\tnode.selected = flag;\n\t\t\t\t}\n\t\t\t\tthis.nodeRenderStatus(ctx);\n\t\t\t\ttree.lastSelectedNode = flag ? node : null;\n\t\t\t\tif (!noEvents) {\n\t\t\t\t\ttree._triggerNodeEvent(\"select\", ctx);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Show node status (ok, loading, error, nodata) using styles and a dummy child node.\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param status\n\t\t\t * @param message\n\t\t\t * @param details\n\t\t\t * @since 2.3\n\t\t\t */\n\t\t\tnodeSetStatus: function (ctx, status, message, details) {\n\t\t\t\tvar node = ctx.node,\n\t\t\t\t\ttree = ctx.tree;\n\n\t\t\t\tfunction _clearStatusNode() {\n\t\t\t\t\t// Remove dedicated dummy node, if any\n\t\t\t\t\tvar firstChild = node.children ? node.children[0] : null;\n\t\t\t\t\tif (firstChild && firstChild.isStatusNode()) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// I've seen exceptions here with loadKeyPath...\n\t\t\t\t\t\t\tif (node.ul) {\n\t\t\t\t\t\t\t\tnode.ul.removeChild(firstChild.li);\n\t\t\t\t\t\t\t\tfirstChild.li = null; // avoid leaks (DT issue 215)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t\tif (node.children.length === 1) {\n\t\t\t\t\t\t\tnode.children = [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnode.children.shift();\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttree._callHook(\n\t\t\t\t\t\t\t\"treeStructureChanged\",\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\"clearStatusNode\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfunction _setStatusNode(data, type) {\n\t\t\t\t\t// Create/modify the dedicated dummy node for 'loading...' or\n\t\t\t\t\t// 'error!' status. (only called for direct child of the invisible\n\t\t\t\t\t// system root)\n\t\t\t\t\tvar firstChild = node.children ? node.children[0] : null;\n\t\t\t\t\tif (firstChild && firstChild.isStatusNode()) {\n\t\t\t\t\t\t$.extend(firstChild, data);\n\t\t\t\t\t\tfirstChild.statusNodeType = type;\n\t\t\t\t\t\ttree._callHook(\"nodeRenderTitle\", firstChild);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnode._setChildren([data]);\n\t\t\t\t\t\ttree._callHook(\n\t\t\t\t\t\t\t\"treeStructureChanged\",\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\"setStatusNode\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tnode.children[0].statusNodeType = type;\n\t\t\t\t\t\ttree.render();\n\t\t\t\t\t}\n\t\t\t\t\treturn node.children[0];\n\t\t\t\t}\n\n\t\t\t\tswitch (status) {\n\t\t\t\t\tcase \"ok\":\n\t\t\t\t\t\t_clearStatusNode();\n\t\t\t\t\t\tnode._isLoading = false;\n\t\t\t\t\t\tnode._error = null;\n\t\t\t\t\t\tnode.renderStatus();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"loading\":\n\t\t\t\t\t\tif (!node.parent) {\n\t\t\t\t\t\t\t_setStatusNode(\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle:\n\t\t\t\t\t\t\t\t\t\ttree.options.strings.loading +\n\t\t\t\t\t\t\t\t\t\t(message ? \" (\" + message + \")\" : \"\"),\n\t\t\t\t\t\t\t\t\t// icon: true, // needed for 'loding' icon\n\t\t\t\t\t\t\t\t\tcheckbox: false,\n\t\t\t\t\t\t\t\t\ttooltip: details,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tstatus\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnode._isLoading = true;\n\t\t\t\t\t\tnode._error = null;\n\t\t\t\t\t\tnode.renderStatus();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"error\":\n\t\t\t\t\t\t_setStatusNode(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttitle:\n\t\t\t\t\t\t\t\t\ttree.options.strings.loadError +\n\t\t\t\t\t\t\t\t\t(message ? \" (\" + message + \")\" : \"\"),\n\t\t\t\t\t\t\t\t// icon: false,\n\t\t\t\t\t\t\t\tcheckbox: false,\n\t\t\t\t\t\t\t\ttooltip: details,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tstatus\n\t\t\t\t\t\t);\n\t\t\t\t\t\tnode._isLoading = false;\n\t\t\t\t\t\tnode._error = { message: message, details: details };\n\t\t\t\t\t\tnode.renderStatus();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"nodata\":\n\t\t\t\t\t\t_setStatusNode(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttitle: message || tree.options.strings.noData,\n\t\t\t\t\t\t\t\t// icon: false,\n\t\t\t\t\t\t\t\tcheckbox: false,\n\t\t\t\t\t\t\t\ttooltip: details,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tstatus\n\t\t\t\t\t\t);\n\t\t\t\t\t\tnode._isLoading = false;\n\t\t\t\t\t\tnode._error = null;\n\t\t\t\t\t\tnode.renderStatus();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$.error(\"invalid node status \" + status);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/**\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeToggleExpanded: function (ctx) {\n\t\t\t\treturn this.nodeSetExpanded(ctx, !ctx.node.expanded);\n\t\t\t},\n\t\t\t/**\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeToggleSelected: function (ctx) {\n\t\t\t\tvar node = ctx.node,\n\t\t\t\t\tflag = !node.selected;\n\n\t\t\t\t// In selectMode: 3 this node may be unselected+partsel, even if\n\t\t\t\t// setSelected(true) was called before, due to `unselectable` children.\n\t\t\t\t// In this case, we now toggle as `setSelected(false)`\n\t\t\t\tif (\n\t\t\t\t\tnode.partsel &&\n\t\t\t\t\t!node.selected &&\n\t\t\t\t\tnode._lastSelectIntent === true\n\t\t\t\t) {\n\t\t\t\t\tflag = false;\n\t\t\t\t\tnode.selected = true; // so it is not considered 'nothing to do'\n\t\t\t\t}\n\t\t\t\tnode._lastSelectIntent = flag;\n\t\t\t\treturn this.nodeSetSelected(ctx, flag);\n\t\t\t},\n\t\t\t/** Remove all nodes.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\ttreeClear: function (ctx) {\n\t\t\t\tvar tree = ctx.tree;\n\t\t\t\ttree.activeNode = null;\n\t\t\t\ttree.focusNode = null;\n\t\t\t\ttree.$div.find(\">ul.fancytree-container\").empty();\n\t\t\t\t// TODO: call destructors and remove reference loops\n\t\t\t\ttree.rootNode.children = null;\n\t\t\t\ttree._callHook(\"treeStructureChanged\", ctx, \"clear\");\n\t\t\t},\n\t\t\t/** Widget was created (called only once, even it re-initialized).\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\ttreeCreate: function (ctx) {},\n\t\t\t/** Widget was destroyed.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\ttreeDestroy: function (ctx) {\n\t\t\t\tthis.$div.find(\">ul.fancytree-container\").remove();\n\t\t\t\tif (this.$source) {\n\t\t\t\t\tthis.$source.removeClass(\"fancytree-helper-hidden\");\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Widget was (re-)initialized.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\ttreeInit: function (ctx) {\n\t\t\t\tvar tree = ctx.tree,\n\t\t\t\t\topts = tree.options;\n\n\t\t\t\t//this.debug(\"Fancytree.treeInit()\");\n\t\t\t\t// Add container to the TAB chain\n\t\t\t\t// See http://www.w3.org/TR/wai-aria-practices/#focus_activedescendant\n\t\t\t\t// #577: Allow to set tabindex to \"0\", \"-1\" and \"\"\n\t\t\t\ttree.$container.attr(\"tabindex\", opts.tabindex);\n\n\t\t\t\t// Copy some attributes to tree.data\n\t\t\t\t$.each(TREE_ATTRS, function (i, attr) {\n\t\t\t\t\tif (opts[attr] !== undefined) {\n\t\t\t\t\t\ttree.info(\"Move option \" + attr + \" to tree\");\n\t\t\t\t\t\ttree[attr] = opts[attr];\n\t\t\t\t\t\tdelete opts[attr];\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (opts.checkboxAutoHide) {\n\t\t\t\t\ttree.$container.addClass(\"fancytree-checkbox-auto-hide\");\n\t\t\t\t}\n\t\t\t\tif (opts.rtl) {\n\t\t\t\t\ttree.$container\n\t\t\t\t\t\t.attr(\"DIR\", \"RTL\")\n\t\t\t\t\t\t.addClass(\"fancytree-rtl\");\n\t\t\t\t} else {\n\t\t\t\t\ttree.$container\n\t\t\t\t\t\t.removeAttr(\"DIR\")\n\t\t\t\t\t\t.removeClass(\"fancytree-rtl\");\n\t\t\t\t}\n\t\t\t\tif (opts.aria) {\n\t\t\t\t\ttree.$container.attr(\"role\", \"tree\");\n\t\t\t\t\tif (opts.selectMode !== 1) {\n\t\t\t\t\t\ttree.$container.attr(\"aria-multiselectable\", true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.treeLoad(ctx);\n\t\t\t},\n\t\t\t/** Parse Fancytree from source, as configured in the options.\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {object} [source] optional new source (use last data otherwise)\n\t\t\t */\n\t\t\ttreeLoad: function (ctx, source) {\n\t\t\t\tvar metaData,\n\t\t\t\t\ttype,\n\t\t\t\t\t$ul,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\t$container = ctx.widget.element,\n\t\t\t\t\tdfd,\n\t\t\t\t\t// calling context for root node\n\t\t\t\t\trootCtx = $.extend({}, ctx, { node: this.rootNode });\n\n\t\t\t\tif (tree.rootNode.children) {\n\t\t\t\t\tthis.treeClear(ctx);\n\t\t\t\t}\n\t\t\t\tsource = source || this.options.source;\n\n\t\t\t\tif (!source) {\n\t\t\t\t\ttype = $container.data(\"type\") || \"html\";\n\t\t\t\t\tswitch (type) {\n\t\t\t\t\t\tcase \"html\":\n\t\t\t\t\t\t\t// There should be an embedded `<ul>` with initial nodes,\n\t\t\t\t\t\t\t// but another `<ul class='fancytree-container'>` is appended\n\t\t\t\t\t\t\t// to the tree's <div> on startup anyway.\n\t\t\t\t\t\t\t$ul = $container\n\t\t\t\t\t\t\t\t.find(\">ul\")\n\t\t\t\t\t\t\t\t.not(\".fancytree-container\")\n\t\t\t\t\t\t\t\t.first();\n\n\t\t\t\t\t\t\tif ($ul.length) {\n\t\t\t\t\t\t\t\t$ul.addClass(\n\t\t\t\t\t\t\t\t\t\"ui-fancytree-source fancytree-helper-hidden\"\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tsource = $.ui.fancytree.parseHtml($ul);\n\t\t\t\t\t\t\t\t// allow to init tree.data.foo from <ul data-foo=''>\n\t\t\t\t\t\t\t\tthis.data = $.extend(\n\t\t\t\t\t\t\t\t\tthis.data,\n\t\t\t\t\t\t\t\t\t_getElementDataAsDict($ul)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tFT.warn(\n\t\t\t\t\t\t\t\t\t\"No `source` option was passed and container does not contain `<ul>`: assuming `source: []`.\"\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tsource = [];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"json\":\n\t\t\t\t\t\t\tsource = $.parseJSON($container.text());\n\t\t\t\t\t\t\t// $container already contains the <ul>, but we remove the plain (json) text\n\t\t\t\t\t\t\t// $container.empty();\n\t\t\t\t\t\t\t$container\n\t\t\t\t\t\t\t\t.contents()\n\t\t\t\t\t\t\t\t.filter(function () {\n\t\t\t\t\t\t\t\t\treturn this.nodeType === 3;\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t.remove();\n\t\t\t\t\t\t\tif ($.isPlainObject(source)) {\n\t\t\t\t\t\t\t\t// We got {foo: 'abc', children: [...]}\n\t\t\t\t\t\t\t\t_assert(\n\t\t\t\t\t\t\t\t\t_isArray(source.children),\n\t\t\t\t\t\t\t\t\t\"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')\"\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tmetaData = source;\n\t\t\t\t\t\t\t\tsource = source.children;\n\t\t\t\t\t\t\t\tdelete metaData.children;\n\t\t\t\t\t\t\t\t// Copy some attributes to tree.data\n\t\t\t\t\t\t\t\t$.each(TREE_ATTRS, function (i, attr) {\n\t\t\t\t\t\t\t\t\tif (metaData[attr] !== undefined) {\n\t\t\t\t\t\t\t\t\t\ttree[attr] = metaData[attr];\n\t\t\t\t\t\t\t\t\t\tdelete metaData[attr];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t// Copy extra properties to tree.data.foo\n\t\t\t\t\t\t\t\t$.extend(tree.data, metaData);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$.error(\"Invalid data-type: \" + type);\n\t\t\t\t\t}\n\t\t\t\t} else if (typeof source === \"string\") {\n\t\t\t\t\t// TODO: source is an element ID\n\t\t\t\t\t$.error(\"Not implemented\");\n\t\t\t\t}\n\n\t\t\t\t// preInit is fired when the widget markup is created, but nodes\n\t\t\t\t// not yet loaded\n\t\t\t\ttree._triggerTreeEvent(\"preInit\", null);\n\n\t\t\t\t// Trigger fancytreeinit after nodes have been loaded\n\t\t\t\tdfd = this.nodeLoadChildren(rootCtx, source)\n\t\t\t\t\t.done(function () {\n\t\t\t\t\t\ttree._callHook(\n\t\t\t\t\t\t\t\"treeStructureChanged\",\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\"loadChildren\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\ttree.render();\n\t\t\t\t\t\tif (ctx.options.selectMode === 3) {\n\t\t\t\t\t\t\ttree.rootNode.fixSelection3FromEndNodes();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tree.activeNode && tree.options.activeVisible) {\n\t\t\t\t\t\t\ttree.activeNode.makeVisible();\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttree._triggerTreeEvent(\"init\", null, { status: true });\n\t\t\t\t\t})\n\t\t\t\t\t.fail(function () {\n\t\t\t\t\t\ttree.render();\n\t\t\t\t\t\ttree._triggerTreeEvent(\"init\", null, { status: false });\n\t\t\t\t\t});\n\t\t\t\treturn dfd;\n\t\t\t},\n\t\t\t/** Node was inserted into or removed from the tree.\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} add\n\t\t\t * @param {FancytreeNode} node\n\t\t\t */\n\t\t\ttreeRegisterNode: function (ctx, add, node) {\n\t\t\t\tctx.tree._callHook(\n\t\t\t\t\t\"treeStructureChanged\",\n\t\t\t\t\tctx,\n\t\t\t\t\tadd ? \"addNode\" : \"removeNode\"\n\t\t\t\t);\n\t\t\t},\n\t\t\t/** Widget got focus.\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} [flag=true]\n\t\t\t */\n\t\t\ttreeSetFocus: function (ctx, flag, callOpts) {\n\t\t\t\tvar targetNode;\n\n\t\t\t\tflag = flag !== false;\n\n\t\t\t\t// this.debug(\"treeSetFocus(\" + flag + \"), callOpts: \", callOpts, this.hasFocus());\n\t\t\t\t// this.debug(\" focusNode: \" + this.focusNode);\n\t\t\t\t// this.debug(\" activeNode: \" + this.activeNode);\n\t\t\t\tif (flag !== this.hasFocus()) {\n\t\t\t\t\tthis._hasFocus = flag;\n\t\t\t\t\tif (!flag && this.focusNode) {\n\t\t\t\t\t\t// Node also looses focus if widget blurs\n\t\t\t\t\t\tthis.focusNode.setFocus(false);\n\t\t\t\t\t} else if (flag && (!callOpts || !callOpts.calledByNode)) {\n\t\t\t\t\t\t$(this.$container).focus();\n\t\t\t\t\t}\n\t\t\t\t\tthis.$container.toggleClass(\"fancytree-treefocus\", flag);\n\t\t\t\t\tthis._triggerTreeEvent(flag ? \"focusTree\" : \"blurTree\");\n\t\t\t\t\tif (flag && !this.activeNode) {\n\t\t\t\t\t\t// #712: Use last mousedowned node ('click' event fires after focusin)\n\t\t\t\t\t\ttargetNode =\n\t\t\t\t\t\t\tthis._lastMousedownNode || this.getFirstChild();\n\t\t\t\t\t\tif (targetNode) {\n\t\t\t\t\t\t\ttargetNode.setFocus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Widget option was set using `$().fancytree(\"option\", \"KEY\", VALUE)`.\n\t\t\t *\n\t\t\t * Note: `key` may reference a nested option, e.g. 'dnd5.scroll'.\n\t\t\t * In this case `value`contains the complete, modified `dnd5` option hash.\n\t\t\t * We can check for changed values like\n\t\t\t * if( value.scroll !== tree.options.dnd5.scroll ) {...}\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {string} key option name\n\t\t\t * @param {any} value option value\n\t\t\t */\n\t\t\ttreeSetOption: function (ctx, key, value) {\n\t\t\t\tvar tree = ctx.tree,\n\t\t\t\t\tcallDefault = true,\n\t\t\t\t\tcallCreate = false,\n\t\t\t\t\tcallRender = false;\n\n\t\t\t\tswitch (key) {\n\t\t\t\t\tcase \"aria\":\n\t\t\t\t\tcase \"checkbox\":\n\t\t\t\t\tcase \"icon\":\n\t\t\t\t\tcase \"minExpandLevel\":\n\t\t\t\t\tcase \"tabindex\":\n\t\t\t\t\t\t// tree._callHook(\"treeCreate\", tree);\n\t\t\t\t\t\tcallCreate = true;\n\t\t\t\t\t\tcallRender = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"checkboxAutoHide\":\n\t\t\t\t\t\ttree.$container.toggleClass(\n\t\t\t\t\t\t\t\"fancytree-checkbox-auto-hide\",\n\t\t\t\t\t\t\t!!value\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"escapeTitles\":\n\t\t\t\t\tcase \"tooltip\":\n\t\t\t\t\t\tcallRender = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"rtl\":\n\t\t\t\t\t\tif (value === false) {\n\t\t\t\t\t\t\ttree.$container\n\t\t\t\t\t\t\t\t.removeAttr(\"DIR\")\n\t\t\t\t\t\t\t\t.removeClass(\"fancytree-rtl\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttree.$container\n\t\t\t\t\t\t\t\t.attr(\"DIR\", \"RTL\")\n\t\t\t\t\t\t\t\t.addClass(\"fancytree-rtl\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcallRender = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"source\":\n\t\t\t\t\t\tcallDefault = false;\n\t\t\t\t\t\ttree._callHook(\"treeLoad\", tree, value);\n\t\t\t\t\t\tcallRender = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ttree.debug(\n\t\t\t\t\t\"set option \" +\n\t\t\t\t\t\tkey +\n\t\t\t\t\t\t\"=\" +\n\t\t\t\t\t\tvalue +\n\t\t\t\t\t\t\" <\" +\n\t\t\t\t\t\ttypeof value +\n\t\t\t\t\t\t\">\"\n\t\t\t\t);\n\t\t\t\tif (callDefault) {\n\t\t\t\t\tif (this.widget._super) {\n\t\t\t\t\t\t// jQuery UI 1.9+\n\t\t\t\t\t\tthis.widget._super.call(this.widget, key, value);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// jQuery UI <= 1.8, we have to manually invoke the _setOption method from the base widget\n\t\t\t\t\t\t$.Widget.prototype._setOption.call(\n\t\t\t\t\t\t\tthis.widget,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (callCreate) {\n\t\t\t\t\ttree._callHook(\"treeCreate\", tree);\n\t\t\t\t}\n\t\t\t\tif (callRender) {\n\t\t\t\t\ttree.render(true, false); // force, not-deep\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** A Node was added, removed, moved, or it's visibility changed.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\ttreeStructureChanged: function (ctx, type) {},\n\t\t}\n\t);\n\n\t/*******************************************************************************\n\t * jQuery UI widget boilerplate\n\t */\n\n\t/**\n\t * The plugin (derrived from [jQuery.Widget](http://api.jqueryui.com/jQuery.widget/)).\n\t *\n\t * **Note:**\n\t * These methods implement the standard jQuery UI widget API.\n\t * It is recommended to use methods of the {Fancytree} instance instead\n\t *\n\t * @example\n\t * // DEPRECATED: Access jQuery UI widget methods and members:\n\t * var tree = $(\"#tree\").fancytree(\"getTree\", \"#myTree\");\n\t * var node = $.ui.fancytree.getTree(\"#tree\").getActiveNode();\n\t *\n\t * // RECOMMENDED: Use the Fancytree object API\n\t * var tree = $.ui.fancytree.getTree(\"#myTree\");\n\t * var node = tree.getActiveNode();\n\t *\n\t * // or you may already have stored the tree instance upon creation:\n\t * import {createTree, version} from 'jquery.fancytree'\n\t * const tree = createTree('#tree', { ... });\n\t * var node = tree.getActiveNode();\n\t *\n\t * @see {Fancytree_Static#getTree}\n\t * @deprecated Use methods of the {Fancytree} instance instead\n\t * @mixin Fancytree_Widget\n\t */\n\n\t$.widget(\n\t\t\"ui.fancytree\",\n\t\t/** @lends Fancytree_Widget# */\n\t\t{\n\t\t\t/**These options will be used as defaults\n\t\t\t * @type {FancytreeOptions}\n\t\t\t */\n\t\t\toptions: {\n\t\t\t\tactiveVisible: true,\n\t\t\t\tajax: {\n\t\t\t\t\ttype: \"GET\",\n\t\t\t\t\tcache: false, // false: Append random '_' argument to the request url to prevent caching.\n\t\t\t\t\t// timeout: 0, // >0: Make sure we get an ajax error if server is unreachable\n\t\t\t\t\tdataType: \"json\", // Expect json format and pass json object to callbacks.\n\t\t\t\t},\n\t\t\t\taria: true,\n\t\t\t\tautoActivate: true,\n\t\t\t\tautoCollapse: false,\n\t\t\t\tautoScroll: false,\n\t\t\t\tcheckbox: false,\n\t\t\t\tclickFolderMode: 4,\n\t\t\t\tcopyFunctionsToData: false,\n\t\t\t\tdebugLevel: null, // 0..4 (null: use global setting $.ui.fancytree.debugLevel)\n\t\t\t\tdisabled: false, // TODO: required anymore?\n\t\t\t\tenableAspx: 42, // TODO: this is truethy, but distinguishable from true: default will change to false in the future\n\t\t\t\tescapeTitles: false,\n\t\t\t\textensions: [],\n\t\t\t\tfocusOnSelect: false,\n\t\t\t\tgenerateIds: false,\n\t\t\t\ticon: true,\n\t\t\t\tidPrefix: \"ft_\",\n\t\t\t\tkeyboard: true,\n\t\t\t\tkeyPathSeparator: \"/\",\n\t\t\t\tminExpandLevel: 1,\n\t\t\t\tnodata: true, // (bool, string, or callback) display message, when no data available\n\t\t\t\tquicksearch: false,\n\t\t\t\trtl: false,\n\t\t\t\tscrollOfs: { top: 0, bottom: 0 },\n\t\t\t\tscrollParent: null,\n\t\t\t\tselectMode: 2,\n\t\t\t\tstrings: {\n\t\t\t\t\tloading: \"Loading...\", // … would be escaped when escapeTitles is true\n\t\t\t\t\tloadError: \"Load error!\",\n\t\t\t\t\tmoreData: \"More...\",\n\t\t\t\t\tnoData: \"No data.\",\n\t\t\t\t},\n\t\t\t\ttabindex: \"0\",\n\t\t\t\ttitlesTabbable: false,\n\t\t\t\ttoggleEffect: { effect: \"slideToggle\", duration: 200 }, //< \"toggle\" or \"slideToggle\" to use jQuery instead of jQueryUI for toggleEffect animation\n\t\t\t\ttooltip: false,\n\t\t\t\ttreeId: null,\n\t\t\t\t_classNames: {\n\t\t\t\t\tactive: \"fancytree-active\",\n\t\t\t\t\tanimating: \"fancytree-animating\",\n\t\t\t\t\tcombinedExpanderPrefix: \"fancytree-exp-\",\n\t\t\t\t\tcombinedIconPrefix: \"fancytree-ico-\",\n\t\t\t\t\terror: \"fancytree-error\",\n\t\t\t\t\texpanded: \"fancytree-expanded\",\n\t\t\t\t\tfocused: \"fancytree-focused\",\n\t\t\t\t\tfolder: \"fancytree-folder\",\n\t\t\t\t\thasChildren: \"fancytree-has-children\",\n\t\t\t\t\tlastsib: \"fancytree-lastsib\",\n\t\t\t\t\tlazy: \"fancytree-lazy\",\n\t\t\t\t\tloading: \"fancytree-loading\",\n\t\t\t\t\tnode: \"fancytree-node\",\n\t\t\t\t\tpartload: \"fancytree-partload\",\n\t\t\t\t\tpartsel: \"fancytree-partsel\",\n\t\t\t\t\tradio: \"fancytree-radio\",\n\t\t\t\t\tselected: \"fancytree-selected\",\n\t\t\t\t\tstatusNodePrefix: \"fancytree-statusnode-\",\n\t\t\t\t\tunselectable: \"fancytree-unselectable\",\n\t\t\t\t},\n\t\t\t\t// events\n\t\t\t\tlazyLoad: null,\n\t\t\t\tpostProcess: null,\n\t\t\t},\n\t\t\t_deprecationWarning: function (name) {\n\t\t\t\tvar tree = this.tree;\n\n\t\t\t\tif (tree && tree.options.debugLevel >= 3) {\n\t\t\t\t\ttree.warn(\n\t\t\t\t\t\t\"$().fancytree('\" +\n\t\t\t\t\t\t\tname +\n\t\t\t\t\t\t\t\"') is deprecated (see https://wwwendt.de/tech/fancytree/doc/jsdoc/Fancytree_Widget.html\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/* Set up the widget, Called on first $().fancytree() */\n\t\t\t_create: function () {\n\t\t\t\tthis.tree = new Fancytree(this);\n\n\t\t\t\tthis.$source =\n\t\t\t\t\tthis.source || this.element.data(\"type\") === \"json\"\n\t\t\t\t\t\t? this.element\n\t\t\t\t\t\t: this.element.find(\">ul\").first();\n\t\t\t\t// Subclass Fancytree instance with all enabled extensions\n\t\t\t\tvar extension,\n\t\t\t\t\textName,\n\t\t\t\t\ti,\n\t\t\t\t\topts = this.options,\n\t\t\t\t\textensions = opts.extensions,\n\t\t\t\t\tbase = this.tree;\n\n\t\t\t\tfor (i = 0; i < extensions.length; i++) {\n\t\t\t\t\textName = extensions[i];\n\t\t\t\t\textension = $.ui.fancytree._extensions[extName];\n\t\t\t\t\tif (!extension) {\n\t\t\t\t\t\t$.error(\n\t\t\t\t\t\t\t\"Could not apply extension '\" +\n\t\t\t\t\t\t\t\textName +\n\t\t\t\t\t\t\t\t\"' (it is not registered, did you forget to include it?)\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t// Add extension options as tree.options.EXTENSION\n\t\t\t\t\t// \t_assert(!this.tree.options[extName], \"Extension name must not exist as option name: \" + extName);\n\n\t\t\t\t\t// console.info(\"extend \" + extName, extension.options, this.tree.options[extName])\n\t\t\t\t\t// issue #876: we want to replace custom array-options, not merge them\n\t\t\t\t\tthis.tree.options[extName] = _simpleDeepMerge(\n\t\t\t\t\t\t{},\n\t\t\t\t\t\textension.options,\n\t\t\t\t\t\tthis.tree.options[extName]\n\t\t\t\t\t);\n\t\t\t\t\t// this.tree.options[extName] = $.extend(true, {}, extension.options, this.tree.options[extName]);\n\n\t\t\t\t\t// console.info(\"extend \" + extName + \" =>\", this.tree.options[extName])\n\t\t\t\t\t// console.info(\"extend \" + extName + \" org default =>\", extension.options)\n\n\t\t\t\t\t// Add a namespace tree.ext.EXTENSION, to hold instance data\n\t\t\t\t\t_assert(\n\t\t\t\t\t\tthis.tree.ext[extName] === undefined,\n\t\t\t\t\t\t\"Extension name must not exist as Fancytree.ext attribute: '\" +\n\t\t\t\t\t\t\textName +\n\t\t\t\t\t\t\t\"'\"\n\t\t\t\t\t);\n\t\t\t\t\t// this.tree[extName] = extension;\n\t\t\t\t\tthis.tree.ext[extName] = {};\n\t\t\t\t\t// Subclass Fancytree methods using proxies.\n\t\t\t\t\t_subclassObject(this.tree, base, extension, extName);\n\t\t\t\t\t// current extension becomes base for the next extension\n\t\t\t\t\tbase = extension;\n\t\t\t\t}\n\t\t\t\t//\n\t\t\t\tif (opts.icons !== undefined) {\n\t\t\t\t\t// 2015-11-16\n\t\t\t\t\tif (opts.icon === true) {\n\t\t\t\t\t\tthis.tree.warn(\n\t\t\t\t\t\t\t\"'icons' tree option is deprecated since v2.14.0: use 'icon' instead\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\topts.icon = opts.icons;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$.error(\n\t\t\t\t\t\t\t\"'icons' tree option is deprecated since v2.14.0: use 'icon' only instead\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (opts.iconClass !== undefined) {\n\t\t\t\t\t// 2015-11-16\n\t\t\t\t\tif (opts.icon) {\n\t\t\t\t\t\t$.error(\n\t\t\t\t\t\t\t\"'iconClass' tree option is deprecated since v2.14.0: use 'icon' only instead\"\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.tree.warn(\n\t\t\t\t\t\t\t\"'iconClass' tree option is deprecated since v2.14.0: use 'icon' instead\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\topts.icon = opts.iconClass;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (opts.tabbable !== undefined) {\n\t\t\t\t\t// 2016-04-04\n\t\t\t\t\topts.tabindex = opts.tabbable ? \"0\" : \"-1\";\n\t\t\t\t\tthis.tree.warn(\n\t\t\t\t\t\t\"'tabbable' tree option is deprecated since v2.17.0: use 'tabindex='\" +\n\t\t\t\t\t\t\topts.tabindex +\n\t\t\t\t\t\t\t\"' instead\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t//\n\t\t\t\tthis.tree._callHook(\"treeCreate\", this.tree);\n\t\t\t\t// Note: 'fancytreecreate' event is fired by widget base class\n\t\t\t\t// this.tree._triggerTreeEvent(\"create\");\n\t\t\t},\n\n\t\t\t/* Called on every $().fancytree() */\n\t\t\t_init: function () {\n\t\t\t\tthis.tree._callHook(\"treeInit\", this.tree);\n\t\t\t\t// TODO: currently we call bind after treeInit, because treeInit\n\t\t\t\t// might change tree.$container.\n\t\t\t\t// It would be better, to move event binding into hooks altogether\n\t\t\t\tthis._bind();\n\t\t\t},\n\n\t\t\t/* Use the _setOption method to respond to changes to options. */\n\t\t\t_setOption: function (key, value) {\n\t\t\t\treturn this.tree._callHook(\n\t\t\t\t\t\"treeSetOption\",\n\t\t\t\t\tthis.tree,\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue\n\t\t\t\t);\n\t\t\t},\n\n\t\t\t/** Use the destroy method to clean up any modifications your widget has made to the DOM */\n\t\t\t_destroy: function () {\n\t\t\t\tthis._unbind();\n\t\t\t\tthis.tree._callHook(\"treeDestroy\", this.tree);\n\t\t\t\t// In jQuery UI 1.8, you must invoke the destroy method from the base widget\n\t\t\t\t// $.Widget.prototype.destroy.call(this);\n\t\t\t\t// TODO: delete tree and nodes to make garbage collect easier?\n\t\t\t\t// TODO: In jQuery UI 1.9 and above, you would define _destroy instead of destroy and not call the base method\n\t\t\t},\n\n\t\t\t// -------------------------------------------------------------------------\n\n\t\t\t/* Remove all event handlers for our namespace */\n\t\t\t_unbind: function () {\n\t\t\t\tvar ns = this.tree._ns;\n\t\t\t\tthis.element.off(ns);\n\t\t\t\tthis.tree.$container.off(ns);\n\t\t\t\t$(document).off(ns);\n\t\t\t},\n\t\t\t/* Add mouse and kyboard handlers to the container */\n\t\t\t_bind: function () {\n\t\t\t\tvar self = this,\n\t\t\t\t\topts = this.options,\n\t\t\t\t\ttree = this.tree,\n\t\t\t\t\tns = tree._ns;\n\t\t\t\t// selstartEvent = ( $.support.selectstart ? \"selectstart\" : \"mousedown\" )\n\n\t\t\t\t// Remove all previuous handlers for this tree\n\t\t\t\tthis._unbind();\n\n\t\t\t\t//alert(\"keydown\" + ns + \"foc=\" + tree.hasFocus() + tree.$container);\n\t\t\t\t// tree.debug(\"bind events; container: \", tree.$container);\n\t\t\t\ttree.$container\n\t\t\t\t\t.on(\"focusin\" + ns + \" focusout\" + ns, function (event) {\n\t\t\t\t\t\tvar node = FT.getNode(event),\n\t\t\t\t\t\t\tflag = event.type === \"focusin\";\n\n\t\t\t\t\t\tif (!flag && node && $(event.target).is(\"a\")) {\n\t\t\t\t\t\t\t// #764\n\t\t\t\t\t\t\tnode.debug(\n\t\t\t\t\t\t\t\t\"Ignored focusout on embedded <a> element.\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// tree.treeOnFocusInOut.call(tree, event);\n\t\t\t\t\t\t// tree.debug(\"Tree container got event \" + event.type, node, event, FT.getEventTarget(event));\n\t\t\t\t\t\tif (flag) {\n\t\t\t\t\t\t\tif (tree._getExpiringValue(\"focusin\")) {\n\t\t\t\t\t\t\t\t// #789: IE 11 may send duplicate focusin events\n\t\t\t\t\t\t\t\ttree.debug(\"Ignored double focusin.\");\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttree._setExpiringValue(\"focusin\", true, 50);\n\n\t\t\t\t\t\t\tif (!node) {\n\t\t\t\t\t\t\t\t// #789: IE 11 may send focusin before mousdown(?)\n\t\t\t\t\t\t\t\tnode = tree._getExpiringValue(\"mouseDownNode\");\n\t\t\t\t\t\t\t\tif (node) {\n\t\t\t\t\t\t\t\t\ttree.debug(\n\t\t\t\t\t\t\t\t\t\t\"Reconstruct mouse target for focusin from recent event.\"\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (node) {\n\t\t\t\t\t\t\t// For example clicking into an <input> that is part of a node\n\t\t\t\t\t\t\ttree._callHook(\n\t\t\t\t\t\t\t\t\"nodeSetFocus\",\n\t\t\t\t\t\t\t\ttree._makeHookContext(node, event),\n\t\t\t\t\t\t\t\tflag\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\ttree.tbody &&\n\t\t\t\t\t\t\t\t$(event.target).parents(\n\t\t\t\t\t\t\t\t\t\"table.fancytree-container > thead\"\n\t\t\t\t\t\t\t\t).length\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t// #767: ignore events in the table's header\n\t\t\t\t\t\t\t\ttree.debug(\n\t\t\t\t\t\t\t\t\t\"Ignore focus event outside table body.\",\n\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttree._callHook(\"treeSetFocus\", tree, flag);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.on(\n\t\t\t\t\t\t\"selectstart\" + ns,\n\t\t\t\t\t\t\"span.fancytree-title\",\n\t\t\t\t\t\tfunction (event) {\n\t\t\t\t\t\t\t// prevent mouse-drags to select text ranges\n\t\t\t\t\t\t\t// tree.debug(\"<span title> got event \" + event.type);\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t\t.on(\"keydown\" + ns, function (event) {\n\t\t\t\t\t\t// TODO: also bind keyup and keypress\n\t\t\t\t\t\t// tree.debug(\"got event \" + event.type + \", hasFocus:\" + tree.hasFocus());\n\t\t\t\t\t\t// if(opts.disabled || opts.keyboard === false || !tree.hasFocus() ){\n\t\t\t\t\t\tif (opts.disabled || opts.keyboard === false) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar res,\n\t\t\t\t\t\t\tnode = tree.focusNode, // node may be null\n\t\t\t\t\t\t\tctx = tree._makeHookContext(node || tree, event),\n\t\t\t\t\t\t\tprevPhase = tree.phase;\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\ttree.phase = \"userEvent\";\n\t\t\t\t\t\t\t// If a 'fancytreekeydown' handler returns false, skip the default\n\t\t\t\t\t\t\t// handling (implemented by tree.nodeKeydown()).\n\t\t\t\t\t\t\tif (node) {\n\t\t\t\t\t\t\t\tres = tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\t\"keydown\",\n\t\t\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tres = tree._triggerTreeEvent(\"keydown\", event);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (res === \"preventNav\") {\n\t\t\t\t\t\t\t\tres = true; // prevent keyboard navigation, but don't prevent default handling of embedded input controls\n\t\t\t\t\t\t\t} else if (res !== false) {\n\t\t\t\t\t\t\t\tres = tree._callHook(\"nodeKeydown\", ctx);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn res;\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\ttree.phase = prevPhase;\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.on(\"mousedown\" + ns, function (event) {\n\t\t\t\t\t\tvar et = FT.getEventTarget(event);\n\t\t\t\t\t\t// self.tree.debug(\"event(\" + event.type + \"): node: \", et.node);\n\t\t\t\t\t\t// #712: Store the clicked node, so we can use it when we get a focusin event\n\t\t\t\t\t\t// ('click' event fires after focusin)\n\t\t\t\t\t\t// tree.debug(\"event(\" + event.type + \"): node: \", et.node);\n\t\t\t\t\t\ttree._lastMousedownNode = et ? et.node : null;\n\t\t\t\t\t\t// #789: Store the node also for a short period, so we can use it\n\t\t\t\t\t\t// in a *resulting* focusin event\n\t\t\t\t\t\ttree._setExpiringValue(\n\t\t\t\t\t\t\t\"mouseDownNode\",\n\t\t\t\t\t\t\ttree._lastMousedownNode\n\t\t\t\t\t\t);\n\t\t\t\t\t})\n\t\t\t\t\t.on(\"click\" + ns + \" dblclick\" + ns, function (event) {\n\t\t\t\t\t\tif (opts.disabled) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar ctx,\n\t\t\t\t\t\t\tet = FT.getEventTarget(event),\n\t\t\t\t\t\t\tnode = et.node,\n\t\t\t\t\t\t\ttree = self.tree,\n\t\t\t\t\t\t\tprevPhase = tree.phase;\n\n\t\t\t\t\t\t// self.tree.debug(\"event(\" + event.type + \"): node: \", node);\n\t\t\t\t\t\tif (!node) {\n\t\t\t\t\t\t\treturn true; // Allow bubbling of other events\n\t\t\t\t\t\t}\n\t\t\t\t\t\tctx = tree._makeHookContext(node, event);\n\t\t\t\t\t\t// self.tree.debug(\"event(\" + event.type + \"): node: \", node);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\ttree.phase = \"userEvent\";\n\t\t\t\t\t\t\tswitch (event.type) {\n\t\t\t\t\t\t\t\tcase \"click\":\n\t\t\t\t\t\t\t\t\tctx.targetType = et.type;\n\t\t\t\t\t\t\t\t\tif (node.isPagingNode()) {\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\ttree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\t\t\t\t\"clickPaging\",\n\t\t\t\t\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t\t\t\t) === true\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\t\t\"click\",\n\t\t\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t\t) === false\n\t\t\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t\t\t: tree._callHook(\"nodeClick\", ctx);\n\t\t\t\t\t\t\t\tcase \"dblclick\":\n\t\t\t\t\t\t\t\t\tctx.targetType = et.type;\n\t\t\t\t\t\t\t\t\treturn tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\t\t\"dblclick\",\n\t\t\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t\t) === false\n\t\t\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t\t\t: tree._callHook(\"nodeDblclick\", ctx);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\ttree.phase = prevPhase;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t},\n\t\t\t/** Return the active node or null.\n\t\t\t * @returns {FancytreeNode}\n\t\t\t * @deprecated Use methods of the Fancytree instance instead (<a href=\"Fancytree_Widget.html\">example above</a>).\n\t\t\t */\n\t\t\tgetActiveNode: function () {\n\t\t\t\tthis._deprecationWarning(\"getActiveNode\");\n\t\t\t\treturn this.tree.activeNode;\n\t\t\t},\n\t\t\t/** Return the matching node or null.\n\t\t\t * @param {string} key\n\t\t\t * @returns {FancytreeNode}\n\t\t\t * @deprecated Use methods of the Fancytree instance instead (<a href=\"Fancytree_Widget.html\">example above</a>).\n\t\t\t */\n\t\t\tgetNodeByKey: function (key) {\n\t\t\t\tthis._deprecationWarning(\"getNodeByKey\");\n\t\t\t\treturn this.tree.getNodeByKey(key);\n\t\t\t},\n\t\t\t/** Return the invisible system root node.\n\t\t\t * @returns {FancytreeNode}\n\t\t\t * @deprecated Use methods of the Fancytree instance instead (<a href=\"Fancytree_Widget.html\">example above</a>).\n\t\t\t */\n\t\t\tgetRootNode: function () {\n\t\t\t\tthis._deprecationWarning(\"getRootNode\");\n\t\t\t\treturn this.tree.rootNode;\n\t\t\t},\n\t\t\t/** Return the current tree instance.\n\t\t\t * @returns {Fancytree}\n\t\t\t * @deprecated Use `$.ui.fancytree.getTree()` instead (<a href=\"Fancytree_Widget.html\">example above</a>).\n\t\t\t */\n\t\t\tgetTree: function () {\n\t\t\t\tthis._deprecationWarning(\"getTree\");\n\t\t\t\treturn this.tree;\n\t\t\t},\n\t\t}\n\t);\n\n\t// $.ui.fancytree was created by the widget factory. Create a local shortcut:\n\tFT = $.ui.fancytree;\n\n\t/**\n\t * Static members in the `$.ui.fancytree` namespace.\n\t * This properties and methods can be accessed without instantiating a concrete\n\t * Fancytree instance.\n\t *\n\t * @example\n\t * // Access static members:\n\t * var node = $.ui.fancytree.getNode(element);\n\t * alert($.ui.fancytree.version);\n\t *\n\t * @mixin Fancytree_Static\n\t */\n\t$.extend(\n\t\t$.ui.fancytree,\n\t\t/** @lends Fancytree_Static# */\n\t\t{\n\t\t\t/** Version number `\"MAJOR.MINOR.PATCH\"`\n\t\t\t * @type {string} */\n\t\t\tversion: \"2.38.1-0\", // Set to semver by 'grunt release'\n\t\t\t/** @type {string}\n\t\t\t * @description `\"production\" for release builds` */\n\t\t\tbuildType: \"production\", // Set to 'production' by 'grunt build'\n\t\t\t/** @type {int}\n\t\t\t * @description 0: silent .. 5: verbose (default: 3 for release builds). */\n\t\t\tdebugLevel: 3, // Set to 3 by 'grunt build'\n\t\t\t// Used by $.ui.fancytree.debug() and as default for tree.options.debugLevel\n\n\t\t\t_nextId: 1,\n\t\t\t_nextNodeKey: 1,\n\t\t\t_extensions: {},\n\t\t\t// focusTree: null,\n\n\t\t\t/** Expose class object as `$.ui.fancytree._FancytreeClass`.\n\t\t\t * Useful to extend `$.ui.fancytree._FancytreeClass.prototype`.\n\t\t\t * @type {Fancytree}\n\t\t\t */\n\t\t\t_FancytreeClass: Fancytree,\n\t\t\t/** Expose class object as $.ui.fancytree._FancytreeNodeClass\n\t\t\t * Useful to extend `$.ui.fancytree._FancytreeNodeClass.prototype`.\n\t\t\t * @type {FancytreeNode}\n\t\t\t */\n\t\t\t_FancytreeNodeClass: FancytreeNode,\n\t\t\t/* Feature checks to provide backwards compatibility */\n\t\t\tjquerySupports: {\n\t\t\t\t// http://jqueryui.com/upgrade-guide/1.9/#deprecated-offset-option-merged-into-my-and-at\n\t\t\t\tpositionMyOfs: isVersionAtLeast($.ui.version, 1, 9),\n\t\t\t},\n\t\t\t/** Throw an error if condition fails (debug method).\n\t\t\t * @param {boolean} cond\n\t\t\t * @param {string} msg\n\t\t\t */\n\t\t\tassert: function (cond, msg) {\n\t\t\t\treturn _assert(cond, msg);\n\t\t\t},\n\t\t\t/** Create a new Fancytree instance on a target element.\n\t\t\t *\n\t\t\t * @param {Element | jQueryObject | string} el Target DOM element or selector\n\t\t\t * @param {FancytreeOptions} [opts] Fancytree options\n\t\t\t * @returns {Fancytree} new tree instance\n\t\t\t * @example\n\t\t\t * var tree = $.ui.fancytree.createTree(\"#tree\", {\n\t\t\t * source: {url: \"my/webservice\"}\n\t\t\t * }); // Create tree for this matching element\n\t\t\t *\n\t\t\t * @since 2.25\n\t\t\t */\n\t\t\tcreateTree: function (el, opts) {\n\t\t\t\tvar $tree = $(el).fancytree(opts);\n\t\t\t\treturn FT.getTree($tree);\n\t\t\t},\n\t\t\t/** Return a function that executes *fn* at most every *timeout* ms.\n\t\t\t * @param {integer} timeout\n\t\t\t * @param {function} fn\n\t\t\t * @param {boolean} [invokeAsap=false]\n\t\t\t * @param {any} [ctx]\n\t\t\t */\n\t\t\tdebounce: function (timeout, fn, invokeAsap, ctx) {\n\t\t\t\tvar timer;\n\t\t\t\tif (arguments.length === 3 && typeof invokeAsap !== \"boolean\") {\n\t\t\t\t\tctx = invokeAsap;\n\t\t\t\t\tinvokeAsap = false;\n\t\t\t\t}\n\t\t\t\treturn function () {\n\t\t\t\t\tvar args = arguments;\n\t\t\t\t\tctx = ctx || this;\n\t\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\t\tinvokeAsap && !timer && fn.apply(ctx, args);\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\ttimer = setTimeout(function () {\n\t\t\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\t\t\tinvokeAsap || fn.apply(ctx, args);\n\t\t\t\t\t\ttimer = null;\n\t\t\t\t\t}, timeout);\n\t\t\t\t};\n\t\t\t},\n\t\t\t/** Write message to console if debugLevel >= 4\n\t\t\t * @param {string} msg\n\t\t\t */\n\t\t\tdebug: function (msg) {\n\t\t\t\tif ($.ui.fancytree.debugLevel >= 4) {\n\t\t\t\t\tconsoleApply(\"log\", arguments);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Write error message to console if debugLevel >= 1.\n\t\t\t * @param {string} msg\n\t\t\t */\n\t\t\terror: function (msg) {\n\t\t\t\tif ($.ui.fancytree.debugLevel >= 1) {\n\t\t\t\t\tconsoleApply(\"error\", arguments);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Convert `<`, `>`, `&`, `\"`, `'`, and `/` to the equivalent entities.\n\t\t\t *\n\t\t\t * @param {string} s\n\t\t\t * @returns {string}\n\t\t\t */\n\t\t\tescapeHtml: function (s) {\n\t\t\t\treturn (\"\" + s).replace(REX_HTML, function (s) {\n\t\t\t\t\treturn ENTITY_MAP[s];\n\t\t\t\t});\n\t\t\t},\n\t\t\t/** Make jQuery.position() arguments backwards compatible, i.e. if\n\t\t\t * jQuery UI version <= 1.8, convert\n\t\t\t * { my: \"left+3 center\", at: \"left bottom\", of: $target }\n\t\t\t * to\n\t\t\t * { my: \"left center\", at: \"left bottom\", of: $target, offset: \"3 0\" }\n\t\t\t *\n\t\t\t * See http://jqueryui.com/upgrade-guide/1.9/#deprecated-offset-option-merged-into-my-and-at\n\t\t\t * and http://jsfiddle.net/mar10/6xtu9a4e/\n\t\t\t *\n\t\t\t * @param {object} opts\n\t\t\t * @returns {object} the (potentially modified) original opts hash object\n\t\t\t */\n\t\t\tfixPositionOptions: function (opts) {\n\t\t\t\tif (opts.offset || (\"\" + opts.my + opts.at).indexOf(\"%\") >= 0) {\n\t\t\t\t\t$.error(\n\t\t\t\t\t\t\"expected new position syntax (but '%' is not supported)\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (!$.ui.fancytree.jquerySupports.positionMyOfs) {\n\t\t\t\t\tvar // parse 'left+3 center' into ['left+3 center', 'left', '+3', 'center', undefined]\n\t\t\t\t\t\tmyParts = /(\\w+)([+-]?\\d+)?\\s+(\\w+)([+-]?\\d+)?/.exec(\n\t\t\t\t\t\t\topts.my\n\t\t\t\t\t\t),\n\t\t\t\t\t\tatParts = /(\\w+)([+-]?\\d+)?\\s+(\\w+)([+-]?\\d+)?/.exec(\n\t\t\t\t\t\t\topts.at\n\t\t\t\t\t\t),\n\t\t\t\t\t\t// convert to numbers\n\t\t\t\t\t\tdx =\n\t\t\t\t\t\t\t(myParts[2] ? +myParts[2] : 0) +\n\t\t\t\t\t\t\t(atParts[2] ? +atParts[2] : 0),\n\t\t\t\t\t\tdy =\n\t\t\t\t\t\t\t(myParts[4] ? +myParts[4] : 0) +\n\t\t\t\t\t\t\t(atParts[4] ? +atParts[4] : 0);\n\n\t\t\t\t\topts = $.extend({}, opts, {\n\t\t\t\t\t\t// make a copy and overwrite\n\t\t\t\t\t\tmy: myParts[1] + \" \" + myParts[3],\n\t\t\t\t\t\tat: atParts[1] + \" \" + atParts[3],\n\t\t\t\t\t});\n\t\t\t\t\tif (dx || dy) {\n\t\t\t\t\t\topts.offset = \"\" + dx + \" \" + dy;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn opts;\n\t\t\t},\n\t\t\t/** Return a {node: FancytreeNode, type: TYPE} object for a mouse event.\n\t\t\t *\n\t\t\t * @param {Event} event Mouse event, e.g. click, ...\n\t\t\t * @returns {object} Return a {node: FancytreeNode, type: TYPE} object\n\t\t\t * TYPE: 'title' | 'prefix' | 'expander' | 'checkbox' | 'icon' | undefined\n\t\t\t */\n\t\t\tgetEventTarget: function (event) {\n\t\t\t\tvar $target,\n\t\t\t\t\ttree,\n\t\t\t\t\ttcn = event && event.target ? event.target.className : \"\",\n\t\t\t\t\tres = { node: this.getNode(event.target), type: undefined };\n\t\t\t\t// We use a fast version of $(res.node).hasClass()\n\t\t\t\t// See http://jsperf.com/test-for-classname/2\n\t\t\t\tif (/\\bfancytree-title\\b/.test(tcn)) {\n\t\t\t\t\tres.type = \"title\";\n\t\t\t\t} else if (/\\bfancytree-expander\\b/.test(tcn)) {\n\t\t\t\t\tres.type =\n\t\t\t\t\t\tres.node.hasChildren() === false\n\t\t\t\t\t\t\t? \"prefix\"\n\t\t\t\t\t\t\t: \"expander\";\n\t\t\t\t\t// }else if( /\\bfancytree-checkbox\\b/.test(tcn) || /\\bfancytree-radio\\b/.test(tcn) ){\n\t\t\t\t} else if (/\\bfancytree-checkbox\\b/.test(tcn)) {\n\t\t\t\t\tres.type = \"checkbox\";\n\t\t\t\t} else if (/\\bfancytree(-custom)?-icon\\b/.test(tcn)) {\n\t\t\t\t\tres.type = \"icon\";\n\t\t\t\t} else if (/\\bfancytree-node\\b/.test(tcn)) {\n\t\t\t\t\t// Somewhere near the title\n\t\t\t\t\tres.type = \"title\";\n\t\t\t\t} else if (event && event.target) {\n\t\t\t\t\t$target = $(event.target);\n\t\t\t\t\tif ($target.is(\"ul[role=group]\")) {\n\t\t\t\t\t\t// #nnn: Clicking right to a node may hit the surrounding UL\n\t\t\t\t\t\ttree = res.node && res.node.tree;\n\t\t\t\t\t\t(tree || FT).debug(\"Ignoring click on outer UL.\");\n\t\t\t\t\t\tres.node = null;\n\t\t\t\t\t} else if ($target.closest(\".fancytree-title\").length) {\n\t\t\t\t\t\t// #228: clicking an embedded element inside a title\n\t\t\t\t\t\tres.type = \"title\";\n\t\t\t\t\t} else if ($target.closest(\".fancytree-checkbox\").length) {\n\t\t\t\t\t\t// E.g. <svg> inside checkbox span\n\t\t\t\t\t\tres.type = \"checkbox\";\n\t\t\t\t\t} else if ($target.closest(\".fancytree-expander\").length) {\n\t\t\t\t\t\tres.type = \"expander\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn res;\n\t\t\t},\n\t\t\t/** Return a string describing the affected node region for a mouse event.\n\t\t\t *\n\t\t\t * @param {Event} event Mouse event, e.g. click, mousemove, ...\n\t\t\t * @returns {string} 'title' | 'prefix' | 'expander' | 'checkbox' | 'icon' | undefined\n\t\t\t */\n\t\t\tgetEventTargetType: function (event) {\n\t\t\t\treturn this.getEventTarget(event).type;\n\t\t\t},\n\t\t\t/** Return a FancytreeNode instance from element, event, or jQuery object.\n\t\t\t *\n\t\t\t * @param {Element | jQueryObject | Event} el\n\t\t\t * @returns {FancytreeNode} matching node or null\n\t\t\t */\n\t\t\tgetNode: function (el) {\n\t\t\t\tif (el instanceof FancytreeNode) {\n\t\t\t\t\treturn el; // el already was a FancytreeNode\n\t\t\t\t} else if (el instanceof $) {\n\t\t\t\t\tel = el[0]; // el was a jQuery object: use the DOM element\n\t\t\t\t} else if (el.originalEvent !== undefined) {\n\t\t\t\t\tel = el.target; // el was an Event\n\t\t\t\t}\n\t\t\t\twhile (el) {\n\t\t\t\t\tif (el.ftnode) {\n\t\t\t\t\t\treturn el.ftnode;\n\t\t\t\t\t}\n\t\t\t\t\tel = el.parentNode;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t},\n\t\t\t/** Return a Fancytree instance, from element, index, event, or jQueryObject.\n\t\t\t *\n\t\t\t * @param {Element | jQueryObject | Event | integer | string} [el]\n\t\t\t * @returns {Fancytree} matching tree or null\n\t\t\t * @example\n\t\t\t * $.ui.fancytree.getTree(); // Get first Fancytree instance on page\n\t\t\t * $.ui.fancytree.getTree(1); // Get second Fancytree instance on page\n\t\t\t * $.ui.fancytree.getTree(event); // Get tree for this mouse- or keyboard event\n\t\t\t * $.ui.fancytree.getTree(\"foo\"); // Get tree for this `opts.treeId`\n\t\t\t * $.ui.fancytree.getTree(\"#tree\"); // Get tree for this matching element\n\t\t\t *\n\t\t\t * @since 2.13\n\t\t\t */\n\t\t\tgetTree: function (el) {\n\t\t\t\tvar widget,\n\t\t\t\t\torgEl = el;\n\n\t\t\t\tif (el instanceof Fancytree) {\n\t\t\t\t\treturn el; // el already was a Fancytree\n\t\t\t\t}\n\t\t\t\tif (el === undefined) {\n\t\t\t\t\tel = 0; // get first tree\n\t\t\t\t}\n\t\t\t\tif (typeof el === \"number\") {\n\t\t\t\t\tel = $(\".fancytree-container\").eq(el); // el was an integer: return nth instance\n\t\t\t\t} else if (typeof el === \"string\") {\n\t\t\t\t\t// `el` may be a treeId or a selector:\n\t\t\t\t\tel = $(\"#ft-id-\" + orgEl).eq(0);\n\t\t\t\t\tif (!el.length) {\n\t\t\t\t\t\tel = $(orgEl).eq(0); // el was a selector: use first match\n\t\t\t\t\t}\n\t\t\t\t} else if (\n\t\t\t\t\tel instanceof Element ||\n\t\t\t\t\tel instanceof HTMLDocument\n\t\t\t\t) {\n\t\t\t\t\tel = $(el);\n\t\t\t\t} else if (el instanceof $) {\n\t\t\t\t\tel = el.eq(0); // el was a jQuery object: use the first\n\t\t\t\t} else if (el.originalEvent !== undefined) {\n\t\t\t\t\tel = $(el.target); // el was an Event\n\t\t\t\t}\n\t\t\t\t// el is a jQuery object wit one element here\n\t\t\t\tel = el.closest(\":ui-fancytree\");\n\t\t\t\twidget = el.data(\"ui-fancytree\") || el.data(\"fancytree\"); // the latter is required by jQuery <= 1.8\n\t\t\t\treturn widget ? widget.tree : null;\n\t\t\t},\n\t\t\t/** Return an option value that has a default, but may be overridden by a\n\t\t\t * callback or a node instance attribute.\n\t\t\t *\n\t\t\t * Evaluation sequence:\n\t\t\t *\n\t\t\t * If `tree.options.<optionName>` is a callback that returns something, use that.\n\t\t\t * Else if `node.<optionName>` is defined, use that.\n\t\t\t * Else if `tree.options.<optionName>` is a value, use that.\n\t\t\t * Else use `defaultValue`.\n\t\t\t *\n\t\t\t * @param {string} optionName name of the option property (on node and tree)\n\t\t\t * @param {FancytreeNode} node passed to the callback\n\t\t\t * @param {object} nodeObject where to look for the local option property, e.g. `node` or `node.data`\n\t\t\t * @param {object} treeOption where to look for the tree option, e.g. `tree.options` or `tree.options.dnd5`\n\t\t\t * @param {any} [defaultValue]\n\t\t\t * @returns {any}\n\t\t\t *\n\t\t\t * @example\n\t\t\t * // Check for node.foo, tree,options.foo(), and tree.options.foo:\n\t\t\t * $.ui.fancytree.evalOption(\"foo\", node, node, tree.options);\n\t\t\t * // Check for node.data.bar, tree,options.qux.bar(), and tree.options.qux.bar:\n\t\t\t * $.ui.fancytree.evalOption(\"bar\", node, node.data, tree.options.qux);\n\t\t\t *\n\t\t\t * @since 2.22\n\t\t\t */\n\t\t\tevalOption: function (\n\t\t\t\toptionName,\n\t\t\t\tnode,\n\t\t\t\tnodeObject,\n\t\t\t\ttreeOptions,\n\t\t\t\tdefaultValue\n\t\t\t) {\n\t\t\t\tvar ctx,\n\t\t\t\t\tres,\n\t\t\t\t\ttree = node.tree,\n\t\t\t\t\ttreeOpt = treeOptions[optionName],\n\t\t\t\t\tnodeOpt = nodeObject[optionName];\n\n\t\t\t\tif (_isFunction(treeOpt)) {\n\t\t\t\t\tctx = {\n\t\t\t\t\t\tnode: node,\n\t\t\t\t\t\ttree: tree,\n\t\t\t\t\t\twidget: tree.widget,\n\t\t\t\t\t\toptions: tree.widget.options,\n\t\t\t\t\t\ttypeInfo: tree.types[node.type] || {},\n\t\t\t\t\t};\n\t\t\t\t\tres = treeOpt.call(tree, { type: optionName }, ctx);\n\t\t\t\t\tif (res == null) {\n\t\t\t\t\t\tres = nodeOpt;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tres = nodeOpt == null ? treeOpt : nodeOpt;\n\t\t\t\t}\n\t\t\t\tif (res == null) {\n\t\t\t\t\tres = defaultValue; // no option set at all: return default\n\t\t\t\t}\n\t\t\t\treturn res;\n\t\t\t},\n\t\t\t/** Set expander, checkbox, or node icon, supporting string and object format.\n\t\t\t *\n\t\t\t * @param {Element | jQueryObject} span\n\t\t\t * @param {string} baseClass\n\t\t\t * @param {string | object} icon\n\t\t\t * @since 2.27\n\t\t\t */\n\t\t\tsetSpanIcon: function (span, baseClass, icon) {\n\t\t\t\tvar $span = $(span);\n\n\t\t\t\tif (typeof icon === \"string\") {\n\t\t\t\t\t$span.attr(\"class\", baseClass + \" \" + icon);\n\t\t\t\t} else {\n\t\t\t\t\t// support object syntax: { text: ligature, addClasse: classname }\n\t\t\t\t\tif (icon.text) {\n\t\t\t\t\t\t$span.text(\"\" + icon.text);\n\t\t\t\t\t} else if (icon.html) {\n\t\t\t\t\t\tspan.innerHTML = icon.html;\n\t\t\t\t\t}\n\t\t\t\t\t$span.attr(\n\t\t\t\t\t\t\"class\",\n\t\t\t\t\t\tbaseClass + \" \" + (icon.addClass || \"\")\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Convert a keydown or mouse event to a canonical string like 'ctrl+a',\n\t\t\t * 'ctrl+shift+f2', 'shift+leftdblclick'.\n\t\t\t *\n\t\t\t * This is especially handy for switch-statements in event handlers.\n\t\t\t *\n\t\t\t * @param {event}\n\t\t\t * @returns {string}\n\t\t\t *\n\t\t\t * @example\n\n\t\t\tswitch( $.ui.fancytree.eventToString(event) ) {\n\t\t\t\tcase \"-\":\n\t\t\t\t\ttree.nodeSetExpanded(ctx, false);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"shift+return\":\n\t\t\t\t\ttree.nodeSetActive(ctx, true);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"down\":\n\t\t\t\t\tres = node.navigate(event.which, activate);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\thandled = false;\n\t\t\t}\n\t\t\tif( handled ){\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t\t*/\n\t\t\teventToString: function (event) {\n\t\t\t\t// Poor-man's hotkeys. See here for a complete implementation:\n\t\t\t\t// https://github.com/jeresig/jquery.hotkeys\n\t\t\t\tvar which = event.which,\n\t\t\t\t\tet = event.type,\n\t\t\t\t\ts = [];\n\n\t\t\t\tif (event.altKey) {\n\t\t\t\t\ts.push(\"alt\");\n\t\t\t\t}\n\t\t\t\tif (event.ctrlKey) {\n\t\t\t\t\ts.push(\"ctrl\");\n\t\t\t\t}\n\t\t\t\tif (event.metaKey) {\n\t\t\t\t\ts.push(\"meta\");\n\t\t\t\t}\n\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\ts.push(\"shift\");\n\t\t\t\t}\n\n\t\t\t\tif (et === \"click\" || et === \"dblclick\") {\n\t\t\t\t\ts.push(MOUSE_BUTTONS[event.button] + et);\n\t\t\t\t} else if (et === \"wheel\") {\n\t\t\t\t\ts.push(et);\n\t\t\t\t} else if (!IGNORE_KEYCODES[which]) {\n\t\t\t\t\ts.push(\n\t\t\t\t\t\tSPECIAL_KEYCODES[which] ||\n\t\t\t\t\t\t\tString.fromCharCode(which).toLowerCase()\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn s.join(\"+\");\n\t\t\t},\n\t\t\t/** Write message to console if debugLevel >= 3\n\t\t\t * @param {string} msg\n\t\t\t */\n\t\t\tinfo: function (msg) {\n\t\t\t\tif ($.ui.fancytree.debugLevel >= 3) {\n\t\t\t\t\tconsoleApply(\"info\", arguments);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/* @deprecated: use eventToString(event) instead.\n\t\t\t */\n\t\t\tkeyEventToString: function (event) {\n\t\t\t\tthis.warn(\n\t\t\t\t\t\"keyEventToString() is deprecated: use eventToString()\"\n\t\t\t\t);\n\t\t\t\treturn this.eventToString(event);\n\t\t\t},\n\t\t\t/** Return a wrapped handler method, that provides `this._super`.\n\t\t\t *\n\t\t\t * @example\n\t\t\t\t// Implement `opts.createNode` event to add the 'draggable' attribute\n\t\t\t\t$.ui.fancytree.overrideMethod(ctx.options, \"createNode\", function(event, data) {\n\t\t\t\t\t// Default processing if any\n\t\t\t\t\tthis._super.apply(this, arguments);\n\t\t\t\t\t// Add 'draggable' attribute\n\t\t\t\t\tdata.node.span.draggable = true;\n\t\t\t\t});\n\t\t\t *\n\t\t\t * @param {object} instance\n\t\t\t * @param {string} methodName\n\t\t\t * @param {function} handler\n\t\t\t * @param {object} [context] optional context\n\t\t\t */\n\t\t\toverrideMethod: function (instance, methodName, handler, context) {\n\t\t\t\tvar prevSuper,\n\t\t\t\t\t_super = instance[methodName] || $.noop;\n\n\t\t\t\tinstance[methodName] = function () {\n\t\t\t\t\tvar self = context || this;\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tprevSuper = self._super;\n\t\t\t\t\t\tself._super = _super;\n\t\t\t\t\t\treturn handler.apply(self, arguments);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tself._super = prevSuper;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\t\t\t/**\n\t\t\t * Parse tree data from HTML <ul> markup\n\t\t\t *\n\t\t\t * @param {jQueryObject} $ul\n\t\t\t * @returns {NodeData[]}\n\t\t\t */\n\t\t\tparseHtml: function ($ul) {\n\t\t\t\tvar classes,\n\t\t\t\t\tclassName,\n\t\t\t\t\textraClasses,\n\t\t\t\t\ti,\n\t\t\t\t\tiPos,\n\t\t\t\t\tl,\n\t\t\t\t\ttmp,\n\t\t\t\t\ttmp2,\n\t\t\t\t\t$children = $ul.find(\">li\"),\n\t\t\t\t\tchildren = [];\n\n\t\t\t\t$children.each(function () {\n\t\t\t\t\tvar allData,\n\t\t\t\t\t\tlowerCaseAttr,\n\t\t\t\t\t\t$li = $(this),\n\t\t\t\t\t\t$liSpan = $li.find(\">span\", this).first(),\n\t\t\t\t\t\t$liA = $liSpan.length ? null : $li.find(\">a\").first(),\n\t\t\t\t\t\td = { tooltip: null, data: {} };\n\n\t\t\t\t\tif ($liSpan.length) {\n\t\t\t\t\t\td.title = $liSpan.html();\n\t\t\t\t\t} else if ($liA && $liA.length) {\n\t\t\t\t\t\t// If a <li><a> tag is specified, use it literally and extract href/target.\n\t\t\t\t\t\td.title = $liA.html();\n\t\t\t\t\t\td.data.href = $liA.attr(\"href\");\n\t\t\t\t\t\td.data.target = $liA.attr(\"target\");\n\t\t\t\t\t\td.tooltip = $liA.attr(\"title\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If only a <li> tag is specified, use the trimmed string up to\n\t\t\t\t\t\t// the next child <ul> tag.\n\t\t\t\t\t\td.title = $li.html();\n\t\t\t\t\t\tiPos = d.title.search(/<ul/i);\n\t\t\t\t\t\tif (iPos >= 0) {\n\t\t\t\t\t\t\td.title = d.title.substring(0, iPos);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\td.title = _trim(d.title);\n\n\t\t\t\t\t// Make sure all fields exist\n\t\t\t\t\tfor (i = 0, l = CLASS_ATTRS.length; i < l; i++) {\n\t\t\t\t\t\td[CLASS_ATTRS[i]] = undefined;\n\t\t\t\t\t}\n\t\t\t\t\t// Initialize to `true`, if class is set and collect extraClasses\n\t\t\t\t\tclasses = this.className.split(\" \");\n\t\t\t\t\textraClasses = [];\n\t\t\t\t\tfor (i = 0, l = classes.length; i < l; i++) {\n\t\t\t\t\t\tclassName = classes[i];\n\t\t\t\t\t\tif (CLASS_ATTR_MAP[className]) {\n\t\t\t\t\t\t\td[className] = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\textraClasses.push(className);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\td.extraClasses = extraClasses.join(\" \");\n\n\t\t\t\t\t// Parse node options from ID, title and class attributes\n\t\t\t\t\ttmp = $li.attr(\"title\");\n\t\t\t\t\tif (tmp) {\n\t\t\t\t\t\td.tooltip = tmp; // overrides <a title='...'>\n\t\t\t\t\t}\n\t\t\t\t\ttmp = $li.attr(\"id\");\n\t\t\t\t\tif (tmp) {\n\t\t\t\t\t\td.key = tmp;\n\t\t\t\t\t}\n\t\t\t\t\t// Translate hideCheckbox -> checkbox:false\n\t\t\t\t\tif ($li.attr(\"hideCheckbox\")) {\n\t\t\t\t\t\td.checkbox = false;\n\t\t\t\t\t}\n\t\t\t\t\t// Add <li data-NAME='...'> as node.data.NAME\n\t\t\t\t\tallData = _getElementDataAsDict($li);\n\t\t\t\t\tif (allData && !$.isEmptyObject(allData)) {\n\t\t\t\t\t\t// #507: convert data-hidecheckbox (lower case) to hideCheckbox\n\t\t\t\t\t\tfor (lowerCaseAttr in NODE_ATTR_LOWERCASE_MAP) {\n\t\t\t\t\t\t\tif (_hasProp(allData, lowerCaseAttr)) {\n\t\t\t\t\t\t\t\tallData[\n\t\t\t\t\t\t\t\t\tNODE_ATTR_LOWERCASE_MAP[lowerCaseAttr]\n\t\t\t\t\t\t\t\t] = allData[lowerCaseAttr];\n\t\t\t\t\t\t\t\tdelete allData[lowerCaseAttr];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// #56: Allow to set special node.attributes from data-...\n\t\t\t\t\t\tfor (i = 0, l = NODE_ATTRS.length; i < l; i++) {\n\t\t\t\t\t\t\ttmp = NODE_ATTRS[i];\n\t\t\t\t\t\t\ttmp2 = allData[tmp];\n\t\t\t\t\t\t\tif (tmp2 != null) {\n\t\t\t\t\t\t\t\tdelete allData[tmp];\n\t\t\t\t\t\t\t\td[tmp] = tmp2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// All other data-... goes to node.data...\n\t\t\t\t\t\t$.extend(d.data, allData);\n\t\t\t\t\t}\n\t\t\t\t\t// Recursive reading of child nodes, if LI tag contains an UL tag\n\t\t\t\t\t$ul = $li.find(\">ul\").first();\n\t\t\t\t\tif ($ul.length) {\n\t\t\t\t\t\td.children = $.ui.fancytree.parseHtml($ul);\n\t\t\t\t\t} else {\n\t\t\t\t\t\td.children = d.lazy ? undefined : null;\n\t\t\t\t\t}\n\t\t\t\t\tchildren.push(d);\n\t\t\t\t\t// FT.debug(\"parse \", d, children);\n\t\t\t\t});\n\t\t\t\treturn children;\n\t\t\t},\n\t\t\t/** Add Fancytree extension definition to the list of globally available extensions.\n\t\t\t *\n\t\t\t * @param {object} definition\n\t\t\t */\n\t\t\tregisterExtension: function (definition) {\n\t\t\t\t_assert(\n\t\t\t\t\tdefinition.name != null,\n\t\t\t\t\t\"extensions must have a `name` property.\"\n\t\t\t\t);\n\t\t\t\t_assert(\n\t\t\t\t\tdefinition.version != null,\n\t\t\t\t\t\"extensions must have a `version` property.\"\n\t\t\t\t);\n\t\t\t\t$.ui.fancytree._extensions[definition.name] = definition;\n\t\t\t},\n\t\t\t/** Replacement for the deprecated `jQuery.trim()`.\n\t\t\t *\n\t\t\t * @param {string} text\n\t\t\t */\n\t\t\ttrim: _trim,\n\t\t\t/** Inverse of escapeHtml().\n\t\t\t *\n\t\t\t * @param {string} s\n\t\t\t * @returns {string}\n\t\t\t */\n\t\t\tunescapeHtml: function (s) {\n\t\t\t\tvar e = document.createElement(\"div\");\n\t\t\t\te.innerHTML = s;\n\t\t\t\treturn e.childNodes.length === 0\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: e.childNodes[0].nodeValue;\n\t\t\t},\n\t\t\t/** Write warning message to console if debugLevel >= 2.\n\t\t\t * @param {string} msg\n\t\t\t */\n\t\t\twarn: function (msg) {\n\t\t\t\tif ($.ui.fancytree.debugLevel >= 2) {\n\t\t\t\t\tconsoleApply(\"warn\", arguments);\n\t\t\t\t}\n\t\t\t},\n\t\t}\n\t);\n\n\t// Value returned by `require('jquery.fancytree')`\n\treturn $.ui.fancytree;\n}); // End of closure\n","/*! jQuery UI - v1.12.1 - 2018-05-20\n* http://jqueryui.com\n* Includes: widget.js, position.js, keycode.js, scroll-parent.js, unique-id.js\n* Copyright jQuery Foundation and other contributors; Licensed MIT */\n\n;(function( factory ) {\n\tif ( typeof define === \"function\" && define.amd ) {\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"jquery\" ], factory );\n\t} else if ( typeof module === \"object\" && module.exports ) {\n\t\t// Node/CommonJS\n\t\tmodule.exports = factory(require(\"jquery\"));\n\t} else {\n\t\t// Browser globals\n\t\tfactory( jQuery );\n\t}\n}(function( $ ) {\n\n$.ui = $.ui || {};\n\nvar version = $.ui.version = \"1.12.1\";\n\n\n/*!\n * jQuery UI Widget 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: Widget\n//>>group: Core\n//>>description: Provides a factory for creating stateful widgets with a common API.\n//>>docs: http://api.jqueryui.com/jQuery.widget/\n//>>demos: http://jqueryui.com/widget/\n\n\n\nvar widgetUuid = 0;\nvar widgetSlice = Array.prototype.slice;\n\n$.cleanData = $.cleanData || ( function( orig ) {\n\treturn function( elems ) {\n\t\tvar events, elem, i;\n\t\tfor ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {\n\t\t\ttry {\n\n\t\t\t\t// Only trigger remove when necessary to save time\n\t\t\t\tevents = $._data( elem, \"events\" );\n\t\t\t\tif ( events && events.remove ) {\n\t\t\t\t\t$( elem ).triggerHandler( \"remove\" );\n\t\t\t\t}\n\n\t\t\t// Http://bugs.jquery.com/ticket/8235\n\t\t\t} catch ( e ) {}\n\t\t}\n\t\torig( elems );\n\t};\n} )( $.cleanData );\n\n$.widget = $.widget || function( name, base, prototype ) {\n\tvar existingConstructor, constructor, basePrototype;\n\n\t// ProxiedPrototype allows the provided prototype to remain unmodified\n\t// so that it can be used as a mixin for multiple widgets (#8876)\n\tvar proxiedPrototype = {};\n\n\tvar namespace = name.split( \".\" )[ 0 ];\n\tname = name.split( \".\" )[ 1 ];\n\tvar fullName = namespace + \"-\" + name;\n\n\tif ( !prototype ) {\n\t\tprototype = base;\n\t\tbase = $.Widget;\n\t}\n\n\tif ( $.isArray( prototype ) ) {\n\t\tprototype = $.extend.apply( null, [ {} ].concat( prototype ) );\n\t}\n\n\t// Create selector for plugin\n\t$.expr[ \":\" ][ fullName.toLowerCase() ] = function( elem ) {\n\t\treturn !!$.data( elem, fullName );\n\t};\n\n\t$[ namespace ] = $[ namespace ] || {};\n\texistingConstructor = $[ namespace ][ name ];\n\tconstructor = $[ namespace ][ name ] = function( options, element ) {\n\n\t\t// Allow instantiation without \"new\" keyword\n\t\tif ( !this._createWidget ) {\n\t\t\treturn new constructor( options, element );\n\t\t}\n\n\t\t// Allow instantiation without initializing for simple inheritance\n\t\t// must use \"new\" keyword (the code above always passes args)\n\t\tif ( arguments.length ) {\n\t\t\tthis._createWidget( options, element );\n\t\t}\n\t};\n\n\t// Extend with the existing constructor to carry over any static properties\n\t$.extend( constructor, existingConstructor, {\n\t\tversion: prototype.version,\n\n\t\t// Copy the object used to create the prototype in case we need to\n\t\t// redefine the widget later\n\t\t_proto: $.extend( {}, prototype ),\n\n\t\t// Track widgets that inherit from this widget in case this widget is\n\t\t// redefined after a widget inherits from it\n\t\t_childConstructors: []\n\t} );\n\n\tbasePrototype = new base();\n\n\t// We need to make the options hash a property directly on the new instance\n\t// otherwise we'll modify the options hash on the prototype that we're\n\t// inheriting from\n\tbasePrototype.options = $.widget.extend( {}, basePrototype.options );\n\t$.each( prototype, function( prop, value ) {\n\t\tif ( !$.isFunction( value ) ) {\n\t\t\tproxiedPrototype[ prop ] = value;\n\t\t\treturn;\n\t\t}\n\t\tproxiedPrototype[ prop ] = ( function() {\n\t\t\tfunction _super() {\n\t\t\t\treturn base.prototype[ prop ].apply( this, arguments );\n\t\t\t}\n\n\t\t\tfunction _superApply( args ) {\n\t\t\t\treturn base.prototype[ prop ].apply( this, args );\n\t\t\t}\n\n\t\t\treturn function() {\n\t\t\t\tvar __super = this._super;\n\t\t\t\tvar __superApply = this._superApply;\n\t\t\t\tvar returnValue;\n\n\t\t\t\tthis._super = _super;\n\t\t\t\tthis._superApply = _superApply;\n\n\t\t\t\treturnValue = value.apply( this, arguments );\n\n\t\t\t\tthis._super = __super;\n\t\t\t\tthis._superApply = __superApply;\n\n\t\t\t\treturn returnValue;\n\t\t\t};\n\t\t} )();\n\t} );\n\tconstructor.prototype = $.widget.extend( basePrototype, {\n\n\t\t// TODO: remove support for widgetEventPrefix\n\t\t// always use the name + a colon as the prefix, e.g., draggable:start\n\t\t// don't prefix for widgets that aren't DOM-based\n\t\twidgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name\n\t}, proxiedPrototype, {\n\t\tconstructor: constructor,\n\t\tnamespace: namespace,\n\t\twidgetName: name,\n\t\twidgetFullName: fullName\n\t} );\n\n\t// If this widget is being redefined then we need to find all widgets that\n\t// are inheriting from it and redefine all of them so that they inherit from\n\t// the new version of this widget. We're essentially trying to replace one\n\t// level in the prototype chain.\n\tif ( existingConstructor ) {\n\t\t$.each( existingConstructor._childConstructors, function( i, child ) {\n\t\t\tvar childPrototype = child.prototype;\n\n\t\t\t// Redefine the child widget using the same prototype that was\n\t\t\t// originally used, but inherit from the new version of the base\n\t\t\t$.widget( childPrototype.namespace + \".\" + childPrototype.widgetName, constructor,\n\t\t\t\tchild._proto );\n\t\t} );\n\n\t\t// Remove the list of existing child constructors from the old constructor\n\t\t// so the old child constructors can be garbage collected\n\t\tdelete existingConstructor._childConstructors;\n\t} else {\n\t\tbase._childConstructors.push( constructor );\n\t}\n\n\t$.widget.bridge( name, constructor );\n\n\treturn constructor;\n};\n\n$.widget.extend = function( target ) {\n\tvar input = widgetSlice.call( arguments, 1 );\n\tvar inputIndex = 0;\n\tvar inputLength = input.length;\n\tvar key;\n\tvar value;\n\n\tfor ( ; inputIndex < inputLength; inputIndex++ ) {\n\t\tfor ( key in input[ inputIndex ] ) {\n\t\t\tvalue = input[ inputIndex ][ key ];\n\t\t\tif ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {\n\n\t\t\t\t// Clone objects\n\t\t\t\tif ( $.isPlainObject( value ) ) {\n\t\t\t\t\ttarget[ key ] = $.isPlainObject( target[ key ] ) ?\n\t\t\t\t\t\t$.widget.extend( {}, target[ key ], value ) :\n\n\t\t\t\t\t\t// Don't extend strings, arrays, etc. with objects\n\t\t\t\t\t\t$.widget.extend( {}, value );\n\n\t\t\t\t// Copy everything else by reference\n\t\t\t\t} else {\n\t\t\t\t\ttarget[ key ] = value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn target;\n};\n\n$.widget.bridge = function( name, object ) {\n\tvar fullName = object.prototype.widgetFullName || name;\n\t$.fn[ name ] = function( options ) {\n\t\tvar isMethodCall = typeof options === \"string\";\n\t\tvar args = widgetSlice.call( arguments, 1 );\n\t\tvar returnValue = this;\n\n\t\tif ( isMethodCall ) {\n\n\t\t\t// If this is an empty collection, we need to have the instance method\n\t\t\t// return undefined instead of the jQuery instance\n\t\t\tif ( !this.length && options === \"instance\" ) {\n\t\t\t\treturnValue = undefined;\n\t\t\t} else {\n\t\t\t\tthis.each( function() {\n\t\t\t\t\tvar methodValue;\n\t\t\t\t\tvar instance = $.data( this, fullName );\n\n\t\t\t\t\tif ( options === \"instance\" ) {\n\t\t\t\t\t\treturnValue = instance;\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !instance ) {\n\t\t\t\t\t\treturn $.error( \"cannot call methods on \" + name +\n\t\t\t\t\t\t\t\" prior to initialization; \" +\n\t\t\t\t\t\t\t\"attempted to call method '\" + options + \"'\" );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !$.isFunction( instance[ options ] ) || options.charAt( 0 ) === \"_\" ) {\n\t\t\t\t\t\treturn $.error( \"no such method '\" + options + \"' for \" + name +\n\t\t\t\t\t\t\t\" widget instance\" );\n\t\t\t\t\t}\n\n\t\t\t\t\tmethodValue = instance[ options ].apply( instance, args );\n\n\t\t\t\t\tif ( methodValue !== instance && methodValue !== undefined ) {\n\t\t\t\t\t\treturnValue = methodValue && methodValue.jquery ?\n\t\t\t\t\t\t\treturnValue.pushStack( methodValue.get() ) :\n\t\t\t\t\t\t\tmethodValue;\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Allow multiple hashes to be passed on init\n\t\t\tif ( args.length ) {\n\t\t\t\toptions = $.widget.extend.apply( null, [ options ].concat( args ) );\n\t\t\t}\n\n\t\t\tthis.each( function() {\n\t\t\t\tvar instance = $.data( this, fullName );\n\t\t\t\tif ( instance ) {\n\t\t\t\t\tinstance.option( options || {} );\n\t\t\t\t\tif ( instance._init ) {\n\t\t\t\t\t\tinstance._init();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$.data( this, fullName, new object( options, this ) );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\treturn returnValue;\n\t};\n};\n\n$.Widget = $.Widget || function( /* options, element */ ) {};\n$.Widget._childConstructors = [];\n\n$.Widget.prototype = {\n\twidgetName: \"widget\",\n\twidgetEventPrefix: \"\",\n\tdefaultElement: \"<div>\",\n\n\toptions: {\n\t\tclasses: {},\n\t\tdisabled: false,\n\n\t\t// Callbacks\n\t\tcreate: null\n\t},\n\n\t_createWidget: function( options, element ) {\n\t\telement = $( element || this.defaultElement || this )[ 0 ];\n\t\tthis.element = $( element );\n\t\tthis.uuid = widgetUuid++;\n\t\tthis.eventNamespace = \".\" + this.widgetName + this.uuid;\n\n\t\tthis.bindings = $();\n\t\tthis.hoverable = $();\n\t\tthis.focusable = $();\n\t\tthis.classesElementLookup = {};\n\n\t\tif ( element !== this ) {\n\t\t\t$.data( element, this.widgetFullName, this );\n\t\t\tthis._on( true, this.element, {\n\t\t\t\tremove: function( event ) {\n\t\t\t\t\tif ( event.target === element ) {\n\t\t\t\t\t\tthis.destroy();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t\tthis.document = $( element.style ?\n\n\t\t\t\t// Element within the document\n\t\t\t\telement.ownerDocument :\n\n\t\t\t\t// Element is window or document\n\t\t\t\telement.document || element );\n\t\t\tthis.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow );\n\t\t}\n\n\t\tthis.options = $.widget.extend( {},\n\t\t\tthis.options,\n\t\t\tthis._getCreateOptions(),\n\t\t\toptions );\n\n\t\tthis._create();\n\n\t\tif ( this.options.disabled ) {\n\t\t\tthis._setOptionDisabled( this.options.disabled );\n\t\t}\n\n\t\tthis._trigger( \"create\", null, this._getCreateEventData() );\n\t\tthis._init();\n\t},\n\n\t_getCreateOptions: function() {\n\t\treturn {};\n\t},\n\n\t_getCreateEventData: $.noop,\n\n\t_create: $.noop,\n\n\t_init: $.noop,\n\n\tdestroy: function() {\n\t\tvar that = this;\n\n\t\tthis._destroy();\n\t\t$.each( this.classesElementLookup, function( key, value ) {\n\t\t\tthat._removeClass( value, key );\n\t\t} );\n\n\t\t// We can probably remove the unbind calls in 2.0\n\t\t// all event bindings should go through this._on()\n\t\tthis.element\n\t\t\t.off( this.eventNamespace )\n\t\t\t.removeData( this.widgetFullName );\n\t\tthis.widget()\n\t\t\t.off( this.eventNamespace )\n\t\t\t.removeAttr( \"aria-disabled\" );\n\n\t\t// Clean up events and states\n\t\tthis.bindings.off( this.eventNamespace );\n\t},\n\n\t_destroy: $.noop,\n\n\twidget: function() {\n\t\treturn this.element;\n\t},\n\n\toption: function( key, value ) {\n\t\tvar options = key;\n\t\tvar parts;\n\t\tvar curOption;\n\t\tvar i;\n\n\t\tif ( arguments.length === 0 ) {\n\n\t\t\t// Don't return a reference to the internal hash\n\t\t\treturn $.widget.extend( {}, this.options );\n\t\t}\n\n\t\tif ( typeof key === \"string\" ) {\n\n\t\t\t// Handle nested keys, e.g., \"foo.bar\" => { foo: { bar: ___ } }\n\t\t\toptions = {};\n\t\t\tparts = key.split( \".\" );\n\t\t\tkey = parts.shift();\n\t\t\tif ( parts.length ) {\n\t\t\t\tcurOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );\n\t\t\t\tfor ( i = 0; i < parts.length - 1; i++ ) {\n\t\t\t\t\tcurOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};\n\t\t\t\t\tcurOption = curOption[ parts[ i ] ];\n\t\t\t\t}\n\t\t\t\tkey = parts.pop();\n\t\t\t\tif ( arguments.length === 1 ) {\n\t\t\t\t\treturn curOption[ key ] === undefined ? null : curOption[ key ];\n\t\t\t\t}\n\t\t\t\tcurOption[ key ] = value;\n\t\t\t} else {\n\t\t\t\tif ( arguments.length === 1 ) {\n\t\t\t\t\treturn this.options[ key ] === undefined ? null : this.options[ key ];\n\t\t\t\t}\n\t\t\t\toptions[ key ] = value;\n\t\t\t}\n\t\t}\n\n\t\tthis._setOptions( options );\n\n\t\treturn this;\n\t},\n\n\t_setOptions: function( options ) {\n\t\tvar key;\n\n\t\tfor ( key in options ) {\n\t\t\tthis._setOption( key, options[ key ] );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t_setOption: function( key, value ) {\n\t\tif ( key === \"classes\" ) {\n\t\t\tthis._setOptionClasses( value );\n\t\t}\n\n\t\tthis.options[ key ] = value;\n\n\t\tif ( key === \"disabled\" ) {\n\t\t\tthis._setOptionDisabled( value );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t_setOptionClasses: function( value ) {\n\t\tvar classKey, elements, currentElements;\n\n\t\tfor ( classKey in value ) {\n\t\t\tcurrentElements = this.classesElementLookup[ classKey ];\n\t\t\tif ( value[ classKey ] === this.options.classes[ classKey ] ||\n\t\t\t\t\t!currentElements ||\n\t\t\t\t\t!currentElements.length ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// We are doing this to create a new jQuery object because the _removeClass() call\n\t\t\t// on the next line is going to destroy the reference to the current elements being\n\t\t\t// tracked. We need to save a copy of this collection so that we can add the new classes\n\t\t\t// below.\n\t\t\telements = $( currentElements.get() );\n\t\t\tthis._removeClass( currentElements, classKey );\n\n\t\t\t// We don't use _addClass() here, because that uses this.options.classes\n\t\t\t// for generating the string of classes. We want to use the value passed in from\n\t\t\t// _setOption(), this is the new value of the classes option which was passed to\n\t\t\t// _setOption(). We pass this value directly to _classes().\n\t\t\telements.addClass( this._classes( {\n\t\t\t\telement: elements,\n\t\t\t\tkeys: classKey,\n\t\t\t\tclasses: value,\n\t\t\t\tadd: true\n\t\t\t} ) );\n\t\t}\n\t},\n\n\t_setOptionDisabled: function( value ) {\n\t\tthis._toggleClass( this.widget(), this.widgetFullName + \"-disabled\", null, !!value );\n\n\t\t// If the widget is becoming disabled, then nothing is interactive\n\t\tif ( value ) {\n\t\t\tthis._removeClass( this.hoverable, null, \"ui-state-hover\" );\n\t\t\tthis._removeClass( this.focusable, null, \"ui-state-focus\" );\n\t\t}\n\t},\n\n\tenable: function() {\n\t\treturn this._setOptions( { disabled: false } );\n\t},\n\n\tdisable: function() {\n\t\treturn this._setOptions( { disabled: true } );\n\t},\n\n\t_classes: function( options ) {\n\t\tvar full = [];\n\t\tvar that = this;\n\n\t\toptions = $.extend( {\n\t\t\telement: this.element,\n\t\t\tclasses: this.options.classes || {}\n\t\t}, options );\n\n\t\tfunction processClassString( classes, checkOption ) {\n\t\t\tvar current, i;\n\t\t\tfor ( i = 0; i < classes.length; i++ ) {\n\t\t\t\tcurrent = that.classesElementLookup[ classes[ i ] ] || $();\n\t\t\t\tif ( options.add ) {\n\t\t\t\t\tcurrent = $( $.unique( current.get().concat( options.element.get() ) ) );\n\t\t\t\t} else {\n\t\t\t\t\tcurrent = $( current.not( options.element ).get() );\n\t\t\t\t}\n\t\t\t\tthat.classesElementLookup[ classes[ i ] ] = current;\n\t\t\t\tfull.push( classes[ i ] );\n\t\t\t\tif ( checkOption && options.classes[ classes[ i ] ] ) {\n\t\t\t\t\tfull.push( options.classes[ classes[ i ] ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis._on( options.element, {\n\t\t\t\"remove\": \"_untrackClassesElement\"\n\t\t} );\n\n\t\tif ( options.keys ) {\n\t\t\tprocessClassString( options.keys.match( /\\S+/g ) || [], true );\n\t\t}\n\t\tif ( options.extra ) {\n\t\t\tprocessClassString( options.extra.match( /\\S+/g ) || [] );\n\t\t}\n\n\t\treturn full.join( \" \" );\n\t},\n\n\t_untrackClassesElement: function( event ) {\n\t\tvar that = this;\n\t\t$.each( that.classesElementLookup, function( key, value ) {\n\t\t\tif ( $.inArray( event.target, value ) !== -1 ) {\n\t\t\t\tthat.classesElementLookup[ key ] = $( value.not( event.target ).get() );\n\t\t\t}\n\t\t} );\n\t},\n\n\t_removeClass: function( element, keys, extra ) {\n\t\treturn this._toggleClass( element, keys, extra, false );\n\t},\n\n\t_addClass: function( element, keys, extra ) {\n\t\treturn this._toggleClass( element, keys, extra, true );\n\t},\n\n\t_toggleClass: function( element, keys, extra, add ) {\n\t\tadd = ( typeof add === \"boolean\" ) ? add : extra;\n\t\tvar shift = ( typeof element === \"string\" || element === null ),\n\t\t\toptions = {\n\t\t\t\textra: shift ? keys : extra,\n\t\t\t\tkeys: shift ? element : keys,\n\t\t\t\telement: shift ? this.element : element,\n\t\t\t\tadd: add\n\t\t\t};\n\t\toptions.element.toggleClass( this._classes( options ), add );\n\t\treturn this;\n\t},\n\n\t_on: function( suppressDisabledCheck, element, handlers ) {\n\t\tvar delegateElement;\n\t\tvar instance = this;\n\n\t\t// No suppressDisabledCheck flag, shuffle arguments\n\t\tif ( typeof suppressDisabledCheck !== \"boolean\" ) {\n\t\t\thandlers = element;\n\t\t\telement = suppressDisabledCheck;\n\t\t\tsuppressDisabledCheck = false;\n\t\t}\n\n\t\t// No element argument, shuffle and use this.element\n\t\tif ( !handlers ) {\n\t\t\thandlers = element;\n\t\t\telement = this.element;\n\t\t\tdelegateElement = this.widget();\n\t\t} else {\n\t\t\telement = delegateElement = $( element );\n\t\t\tthis.bindings = this.bindings.add( element );\n\t\t}\n\n\t\t$.each( handlers, function( event, handler ) {\n\t\t\tfunction handlerProxy() {\n\n\t\t\t\t// Allow widgets to customize the disabled handling\n\t\t\t\t// - disabled as an array instead of boolean\n\t\t\t\t// - disabled class as method for disabling individual parts\n\t\t\t\tif ( !suppressDisabledCheck &&\n\t\t\t\t\t\t( instance.options.disabled === true ||\n\t\t\t\t\t\t$( this ).hasClass( \"ui-state-disabled\" ) ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn ( typeof handler === \"string\" ? instance[ handler ] : handler )\n\t\t\t\t\t.apply( instance, arguments );\n\t\t\t}\n\n\t\t\t// Copy the guid so direct unbinding works\n\t\t\tif ( typeof handler !== \"string\" ) {\n\t\t\t\thandlerProxy.guid = handler.guid =\n\t\t\t\t\thandler.guid || handlerProxy.guid || $.guid++;\n\t\t\t}\n\n\t\t\tvar match = event.match( /^([\\w:-]*)\\s*(.*)$/ );\n\t\t\tvar eventName = match[ 1 ] + instance.eventNamespace;\n\t\t\tvar selector = match[ 2 ];\n\n\t\t\tif ( selector ) {\n\t\t\t\tdelegateElement.on( eventName, selector, handlerProxy );\n\t\t\t} else {\n\t\t\t\telement.on( eventName, handlerProxy );\n\t\t\t}\n\t\t} );\n\t},\n\n\t_off: function( element, eventName ) {\n\t\teventName = ( eventName || \"\" ).split( \" \" ).join( this.eventNamespace + \" \" ) +\n\t\t\tthis.eventNamespace;\n\t\telement.off( eventName ).off( eventName );\n\n\t\t// Clear the stack to avoid memory leaks (#10056)\n\t\tthis.bindings = $( this.bindings.not( element ).get() );\n\t\tthis.focusable = $( this.focusable.not( element ).get() );\n\t\tthis.hoverable = $( this.hoverable.not( element ).get() );\n\t},\n\n\t_delay: function( handler, delay ) {\n\t\tfunction handlerProxy() {\n\t\t\treturn ( typeof handler === \"string\" ? instance[ handler ] : handler )\n\t\t\t\t.apply( instance, arguments );\n\t\t}\n\t\tvar instance = this;\n\t\treturn setTimeout( handlerProxy, delay || 0 );\n\t},\n\n\t_hoverable: function( element ) {\n\t\tthis.hoverable = this.hoverable.add( element );\n\t\tthis._on( element, {\n\t\t\tmouseenter: function( event ) {\n\t\t\t\tthis._addClass( $( event.currentTarget ), null, \"ui-state-hover\" );\n\t\t\t},\n\t\t\tmouseleave: function( event ) {\n\t\t\t\tthis._removeClass( $( event.currentTarget ), null, \"ui-state-hover\" );\n\t\t\t}\n\t\t} );\n\t},\n\n\t_focusable: function( element ) {\n\t\tthis.focusable = this.focusable.add( element );\n\t\tthis._on( element, {\n\t\t\tfocusin: function( event ) {\n\t\t\t\tthis._addClass( $( event.currentTarget ), null, \"ui-state-focus\" );\n\t\t\t},\n\t\t\tfocusout: function( event ) {\n\t\t\t\tthis._removeClass( $( event.currentTarget ), null, \"ui-state-focus\" );\n\t\t\t}\n\t\t} );\n\t},\n\n\t_trigger: function( type, event, data ) {\n\t\tvar prop, orig;\n\t\tvar callback = this.options[ type ];\n\n\t\tdata = data || {};\n\t\tevent = $.Event( event );\n\t\tevent.type = ( type === this.widgetEventPrefix ?\n\t\t\ttype :\n\t\t\tthis.widgetEventPrefix + type ).toLowerCase();\n\n\t\t// The original event may come from any element\n\t\t// so we need to reset the target on the new event\n\t\tevent.target = this.element[ 0 ];\n\n\t\t// Copy original event properties over to the new event\n\t\torig = event.originalEvent;\n\t\tif ( orig ) {\n\t\t\tfor ( prop in orig ) {\n\t\t\t\tif ( !( prop in event ) ) {\n\t\t\t\t\tevent[ prop ] = orig[ prop ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.element.trigger( event, data );\n\t\treturn !( $.isFunction( callback ) &&\n\t\t\tcallback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false ||\n\t\t\tevent.isDefaultPrevented() );\n\t}\n};\n\n$.each( { show: \"fadeIn\", hide: \"fadeOut\" }, function( method, defaultEffect ) {\n\t$.Widget.prototype[ \"_\" + method ] = function( element, options, callback ) {\n\t\tif ( typeof options === \"string\" ) {\n\t\t\toptions = { effect: options };\n\t\t}\n\n\t\tvar hasOptions;\n\t\tvar effectName = !options ?\n\t\t\tmethod :\n\t\t\toptions === true || typeof options === \"number\" ?\n\t\t\t\tdefaultEffect :\n\t\t\t\toptions.effect || defaultEffect;\n\n\t\toptions = options || {};\n\t\tif ( typeof options === \"number\" ) {\n\t\t\toptions = { duration: options };\n\t\t}\n\n\t\thasOptions = !$.isEmptyObject( options );\n\t\toptions.complete = callback;\n\n\t\tif ( options.delay ) {\n\t\t\telement.delay( options.delay );\n\t\t}\n\n\t\tif ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {\n\t\t\telement[ method ]( options );\n\t\t} else if ( effectName !== method && element[ effectName ] ) {\n\t\t\telement[ effectName ]( options.duration, options.easing, callback );\n\t\t} else {\n\t\t\telement.queue( function( next ) {\n\t\t\t\t$( this )[ method ]();\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback.call( element[ 0 ] );\n\t\t\t\t}\n\t\t\t\tnext();\n\t\t\t} );\n\t\t}\n\t};\n} );\n\nvar widget = $.widget;\n\n\n/*!\n * jQuery UI Position 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * http://api.jqueryui.com/position/\n */\n\n//>>label: Position\n//>>group: Core\n//>>description: Positions elements relative to other elements.\n//>>docs: http://api.jqueryui.com/position/\n//>>demos: http://jqueryui.com/position/\n\n\n( function() {\nvar cachedScrollbarWidth,\n\tmax = Math.max,\n\tabs = Math.abs,\n\trhorizontal = /left|center|right/,\n\trvertical = /top|center|bottom/,\n\troffset = /[\\+\\-]\\d+(\\.[\\d]+)?%?/,\n\trposition = /^\\w+/,\n\trpercent = /%$/,\n\t_position = $.fn.position;\n\nfunction getOffsets( offsets, width, height ) {\n\treturn [\n\t\tparseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),\n\t\tparseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )\n\t];\n}\n\nfunction parseCss( element, property ) {\n\treturn parseInt( $.css( element, property ), 10 ) || 0;\n}\n\nfunction getDimensions( elem ) {\n\tvar raw = elem[ 0 ];\n\tif ( raw.nodeType === 9 ) {\n\t\treturn {\n\t\t\twidth: elem.width(),\n\t\t\theight: elem.height(),\n\t\t\toffset: { top: 0, left: 0 }\n\t\t};\n\t}\n\tif ( $.isWindow( raw ) ) {\n\t\treturn {\n\t\t\twidth: elem.width(),\n\t\t\theight: elem.height(),\n\t\t\toffset: { top: elem.scrollTop(), left: elem.scrollLeft() }\n\t\t};\n\t}\n\tif ( raw.preventDefault ) {\n\t\treturn {\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t\toffset: { top: raw.pageY, left: raw.pageX }\n\t\t};\n\t}\n\treturn {\n\t\twidth: elem.outerWidth(),\n\t\theight: elem.outerHeight(),\n\t\toffset: elem.offset()\n\t};\n}\n\n$.position = $.position || {\n\tscrollbarWidth: function() {\n\t\tif ( cachedScrollbarWidth !== undefined ) {\n\t\t\treturn cachedScrollbarWidth;\n\t\t}\n\t\tvar w1, w2,\n\t\t\tdiv = $( \"<div \" +\n\t\t\t\t\"style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>\" +\n\t\t\t\t\"<div style='height:100px;width:auto;'></div></div>\" ),\n\t\t\tinnerDiv = div.children()[ 0 ];\n\n\t\t$( \"body\" ).append( div );\n\t\tw1 = innerDiv.offsetWidth;\n\t\tdiv.css( \"overflow\", \"scroll\" );\n\n\t\tw2 = innerDiv.offsetWidth;\n\n\t\tif ( w1 === w2 ) {\n\t\t\tw2 = div[ 0 ].clientWidth;\n\t\t}\n\n\t\tdiv.remove();\n\n\t\treturn ( cachedScrollbarWidth = w1 - w2 );\n\t},\n\tgetScrollInfo: function( within ) {\n\t\tvar overflowX = within.isWindow || within.isDocument ? \"\" :\n\t\t\t\twithin.element.css( \"overflow-x\" ),\n\t\t\toverflowY = within.isWindow || within.isDocument ? \"\" :\n\t\t\t\twithin.element.css( \"overflow-y\" ),\n\t\t\thasOverflowX = overflowX === \"scroll\" ||\n\t\t\t\t( overflowX === \"auto\" && within.width < within.element[ 0 ].scrollWidth ),\n\t\t\thasOverflowY = overflowY === \"scroll\" ||\n\t\t\t\t( overflowY === \"auto\" && within.height < within.element[ 0 ].scrollHeight );\n\t\treturn {\n\t\t\twidth: hasOverflowY ? $.position.scrollbarWidth() : 0,\n\t\t\theight: hasOverflowX ? $.position.scrollbarWidth() : 0\n\t\t};\n\t},\n\tgetWithinInfo: function( element ) {\n\t\tvar withinElement = $( element || window ),\n\t\t\tisWindow = $.isWindow( withinElement[ 0 ] ),\n\t\t\tisDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9,\n\t\t\thasOffset = !isWindow && !isDocument;\n\t\treturn {\n\t\t\telement: withinElement,\n\t\t\tisWindow: isWindow,\n\t\t\tisDocument: isDocument,\n\t\t\toffset: hasOffset ? $( element ).offset() : { left: 0, top: 0 },\n\t\t\tscrollLeft: withinElement.scrollLeft(),\n\t\t\tscrollTop: withinElement.scrollTop(),\n\t\t\twidth: withinElement.outerWidth(),\n\t\t\theight: withinElement.outerHeight()\n\t\t};\n\t}\n};\n\n$.fn.position = function( options ) {\n\tif ( !options || !options.of ) {\n\t\treturn _position.apply( this, arguments );\n\t}\n\n\t// Make a copy, we don't want to modify arguments\n\toptions = $.extend( {}, options );\n\n\tvar atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,\n\t\ttarget = $( options.of ),\n\t\twithin = $.position.getWithinInfo( options.within ),\n\t\tscrollInfo = $.position.getScrollInfo( within ),\n\t\tcollision = ( options.collision || \"flip\" ).split( \" \" ),\n\t\toffsets = {};\n\n\tdimensions = getDimensions( target );\n\tif ( target[ 0 ].preventDefault ) {\n\n\t\t// Force left top to allow flipping\n\t\toptions.at = \"left top\";\n\t}\n\ttargetWidth = dimensions.width;\n\ttargetHeight = dimensions.height;\n\ttargetOffset = dimensions.offset;\n\n\t// Clone to reuse original targetOffset later\n\tbasePosition = $.extend( {}, targetOffset );\n\n\t// Force my and at to have valid horizontal and vertical positions\n\t// if a value is missing or invalid, it will be converted to center\n\t$.each( [ \"my\", \"at\" ], function() {\n\t\tvar pos = ( options[ this ] || \"\" ).split( \" \" ),\n\t\t\thorizontalOffset,\n\t\t\tverticalOffset;\n\n\t\tif ( pos.length === 1 ) {\n\t\t\tpos = rhorizontal.test( pos[ 0 ] ) ?\n\t\t\t\tpos.concat( [ \"center\" ] ) :\n\t\t\t\trvertical.test( pos[ 0 ] ) ?\n\t\t\t\t\t[ \"center\" ].concat( pos ) :\n\t\t\t\t\t[ \"center\", \"center\" ];\n\t\t}\n\t\tpos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : \"center\";\n\t\tpos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : \"center\";\n\n\t\t// Calculate offsets\n\t\thorizontalOffset = roffset.exec( pos[ 0 ] );\n\t\tverticalOffset = roffset.exec( pos[ 1 ] );\n\t\toffsets[ this ] = [\n\t\t\thorizontalOffset ? horizontalOffset[ 0 ] : 0,\n\t\t\tverticalOffset ? verticalOffset[ 0 ] : 0\n\t\t];\n\n\t\t// Reduce to just the positions without the offsets\n\t\toptions[ this ] = [\n\t\t\trposition.exec( pos[ 0 ] )[ 0 ],\n\t\t\trposition.exec( pos[ 1 ] )[ 0 ]\n\t\t];\n\t} );\n\n\t// Normalize collision option\n\tif ( collision.length === 1 ) {\n\t\tcollision[ 1 ] = collision[ 0 ];\n\t}\n\n\tif ( options.at[ 0 ] === \"right\" ) {\n\t\tbasePosition.left += targetWidth;\n\t} else if ( options.at[ 0 ] === \"center\" ) {\n\t\tbasePosition.left += targetWidth / 2;\n\t}\n\n\tif ( options.at[ 1 ] === \"bottom\" ) {\n\t\tbasePosition.top += targetHeight;\n\t} else if ( options.at[ 1 ] === \"center\" ) {\n\t\tbasePosition.top += targetHeight / 2;\n\t}\n\n\tatOffset = getOffsets( offsets.at, targetWidth, targetHeight );\n\tbasePosition.left += atOffset[ 0 ];\n\tbasePosition.top += atOffset[ 1 ];\n\n\treturn this.each( function() {\n\t\tvar collisionPosition, using,\n\t\t\telem = $( this ),\n\t\t\telemWidth = elem.outerWidth(),\n\t\t\telemHeight = elem.outerHeight(),\n\t\t\tmarginLeft = parseCss( this, \"marginLeft\" ),\n\t\t\tmarginTop = parseCss( this, \"marginTop\" ),\n\t\t\tcollisionWidth = elemWidth + marginLeft + parseCss( this, \"marginRight\" ) +\n\t\t\t\tscrollInfo.width,\n\t\t\tcollisionHeight = elemHeight + marginTop + parseCss( this, \"marginBottom\" ) +\n\t\t\t\tscrollInfo.height,\n\t\t\tposition = $.extend( {}, basePosition ),\n\t\t\tmyOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );\n\n\t\tif ( options.my[ 0 ] === \"right\" ) {\n\t\t\tposition.left -= elemWidth;\n\t\t} else if ( options.my[ 0 ] === \"center\" ) {\n\t\t\tposition.left -= elemWidth / 2;\n\t\t}\n\n\t\tif ( options.my[ 1 ] === \"bottom\" ) {\n\t\t\tposition.top -= elemHeight;\n\t\t} else if ( options.my[ 1 ] === \"center\" ) {\n\t\t\tposition.top -= elemHeight / 2;\n\t\t}\n\n\t\tposition.left += myOffset[ 0 ];\n\t\tposition.top += myOffset[ 1 ];\n\n\t\tcollisionPosition = {\n\t\t\tmarginLeft: marginLeft,\n\t\t\tmarginTop: marginTop\n\t\t};\n\n\t\t$.each( [ \"left\", \"top\" ], function( i, dir ) {\n\t\t\tif ( $.ui.position[ collision[ i ] ] ) {\n\t\t\t\t$.ui.position[ collision[ i ] ][ dir ]( position, {\n\t\t\t\t\ttargetWidth: targetWidth,\n\t\t\t\t\ttargetHeight: targetHeight,\n\t\t\t\t\telemWidth: elemWidth,\n\t\t\t\t\telemHeight: elemHeight,\n\t\t\t\t\tcollisionPosition: collisionPosition,\n\t\t\t\t\tcollisionWidth: collisionWidth,\n\t\t\t\t\tcollisionHeight: collisionHeight,\n\t\t\t\t\toffset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],\n\t\t\t\t\tmy: options.my,\n\t\t\t\t\tat: options.at,\n\t\t\t\t\twithin: within,\n\t\t\t\t\telem: elem\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tif ( options.using ) {\n\n\t\t\t// Adds feedback as second argument to using callback, if present\n\t\t\tusing = function( props ) {\n\t\t\t\tvar left = targetOffset.left - position.left,\n\t\t\t\t\tright = left + targetWidth - elemWidth,\n\t\t\t\t\ttop = targetOffset.top - position.top,\n\t\t\t\t\tbottom = top + targetHeight - elemHeight,\n\t\t\t\t\tfeedback = {\n\t\t\t\t\t\ttarget: {\n\t\t\t\t\t\t\telement: target,\n\t\t\t\t\t\t\tleft: targetOffset.left,\n\t\t\t\t\t\t\ttop: targetOffset.top,\n\t\t\t\t\t\t\twidth: targetWidth,\n\t\t\t\t\t\t\theight: targetHeight\n\t\t\t\t\t\t},\n\t\t\t\t\t\telement: {\n\t\t\t\t\t\t\telement: elem,\n\t\t\t\t\t\t\tleft: position.left,\n\t\t\t\t\t\t\ttop: position.top,\n\t\t\t\t\t\t\twidth: elemWidth,\n\t\t\t\t\t\t\theight: elemHeight\n\t\t\t\t\t\t},\n\t\t\t\t\t\thorizontal: right < 0 ? \"left\" : left > 0 ? \"right\" : \"center\",\n\t\t\t\t\t\tvertical: bottom < 0 ? \"top\" : top > 0 ? \"bottom\" : \"middle\"\n\t\t\t\t\t};\n\t\t\t\tif ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {\n\t\t\t\t\tfeedback.horizontal = \"center\";\n\t\t\t\t}\n\t\t\t\tif ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {\n\t\t\t\t\tfeedback.vertical = \"middle\";\n\t\t\t\t}\n\t\t\t\tif ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {\n\t\t\t\t\tfeedback.important = \"horizontal\";\n\t\t\t\t} else {\n\t\t\t\t\tfeedback.important = \"vertical\";\n\t\t\t\t}\n\t\t\t\toptions.using.call( this, props, feedback );\n\t\t\t};\n\t\t}\n\n\t\telem.offset( $.extend( position, { using: using } ) );\n\t} );\n};\n\n$.ui.position = {\n\tfit: {\n\t\tleft: function( position, data ) {\n\t\t\tvar within = data.within,\n\t\t\t\twithinOffset = within.isWindow ? within.scrollLeft : within.offset.left,\n\t\t\t\touterWidth = within.width,\n\t\t\t\tcollisionPosLeft = position.left - data.collisionPosition.marginLeft,\n\t\t\t\toverLeft = withinOffset - collisionPosLeft,\n\t\t\t\toverRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,\n\t\t\t\tnewOverRight;\n\n\t\t\t// Element is wider than within\n\t\t\tif ( data.collisionWidth > outerWidth ) {\n\n\t\t\t\t// Element is initially over the left side of within\n\t\t\t\tif ( overLeft > 0 && overRight <= 0 ) {\n\t\t\t\t\tnewOverRight = position.left + overLeft + data.collisionWidth - outerWidth -\n\t\t\t\t\t\twithinOffset;\n\t\t\t\t\tposition.left += overLeft - newOverRight;\n\n\t\t\t\t// Element is initially over right side of within\n\t\t\t\t} else if ( overRight > 0 && overLeft <= 0 ) {\n\t\t\t\t\tposition.left = withinOffset;\n\n\t\t\t\t// Element is initially over both left and right sides of within\n\t\t\t\t} else {\n\t\t\t\t\tif ( overLeft > overRight ) {\n\t\t\t\t\t\tposition.left = withinOffset + outerWidth - data.collisionWidth;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tposition.left = withinOffset;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Too far left -> align with left edge\n\t\t\t} else if ( overLeft > 0 ) {\n\t\t\t\tposition.left += overLeft;\n\n\t\t\t// Too far right -> align with right edge\n\t\t\t} else if ( overRight > 0 ) {\n\t\t\t\tposition.left -= overRight;\n\n\t\t\t// Adjust based on position and margin\n\t\t\t} else {\n\t\t\t\tposition.left = max( position.left - collisionPosLeft, position.left );\n\t\t\t}\n\t\t},\n\t\ttop: function( position, data ) {\n\t\t\tvar within = data.within,\n\t\t\t\twithinOffset = within.isWindow ? within.scrollTop : within.offset.top,\n\t\t\t\touterHeight = data.within.height,\n\t\t\t\tcollisionPosTop = position.top - data.collisionPosition.marginTop,\n\t\t\t\toverTop = withinOffset - collisionPosTop,\n\t\t\t\toverBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,\n\t\t\t\tnewOverBottom;\n\n\t\t\t// Element is taller than within\n\t\t\tif ( data.collisionHeight > outerHeight ) {\n\n\t\t\t\t// Element is initially over the top of within\n\t\t\t\tif ( overTop > 0 && overBottom <= 0 ) {\n\t\t\t\t\tnewOverBottom = position.top + overTop + data.collisionHeight - outerHeight -\n\t\t\t\t\t\twithinOffset;\n\t\t\t\t\tposition.top += overTop - newOverBottom;\n\n\t\t\t\t// Element is initially over bottom of within\n\t\t\t\t} else if ( overBottom > 0 && overTop <= 0 ) {\n\t\t\t\t\tposition.top = withinOffset;\n\n\t\t\t\t// Element is initially over both top and bottom of within\n\t\t\t\t} else {\n\t\t\t\t\tif ( overTop > overBottom ) {\n\t\t\t\t\t\tposition.top = withinOffset + outerHeight - data.collisionHeight;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tposition.top = withinOffset;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Too far up -> align with top\n\t\t\t} else if ( overTop > 0 ) {\n\t\t\t\tposition.top += overTop;\n\n\t\t\t// Too far down -> align with bottom edge\n\t\t\t} else if ( overBottom > 0 ) {\n\t\t\t\tposition.top -= overBottom;\n\n\t\t\t// Adjust based on position and margin\n\t\t\t} else {\n\t\t\t\tposition.top = max( position.top - collisionPosTop, position.top );\n\t\t\t}\n\t\t}\n\t},\n\tflip: {\n\t\tleft: function( position, data ) {\n\t\t\tvar within = data.within,\n\t\t\t\twithinOffset = within.offset.left + within.scrollLeft,\n\t\t\t\touterWidth = within.width,\n\t\t\t\toffsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,\n\t\t\t\tcollisionPosLeft = position.left - data.collisionPosition.marginLeft,\n\t\t\t\toverLeft = collisionPosLeft - offsetLeft,\n\t\t\t\toverRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,\n\t\t\t\tmyOffset = data.my[ 0 ] === \"left\" ?\n\t\t\t\t\t-data.elemWidth :\n\t\t\t\t\tdata.my[ 0 ] === \"right\" ?\n\t\t\t\t\t\tdata.elemWidth :\n\t\t\t\t\t\t0,\n\t\t\t\tatOffset = data.at[ 0 ] === \"left\" ?\n\t\t\t\t\tdata.targetWidth :\n\t\t\t\t\tdata.at[ 0 ] === \"right\" ?\n\t\t\t\t\t\t-data.targetWidth :\n\t\t\t\t\t\t0,\n\t\t\t\toffset = -2 * data.offset[ 0 ],\n\t\t\t\tnewOverRight,\n\t\t\t\tnewOverLeft;\n\n\t\t\tif ( overLeft < 0 ) {\n\t\t\t\tnewOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth -\n\t\t\t\t\touterWidth - withinOffset;\n\t\t\t\tif ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {\n\t\t\t\t\tposition.left += myOffset + atOffset + offset;\n\t\t\t\t}\n\t\t\t} else if ( overRight > 0 ) {\n\t\t\t\tnewOverLeft = position.left - data.collisionPosition.marginLeft + myOffset +\n\t\t\t\t\tatOffset + offset - offsetLeft;\n\t\t\t\tif ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {\n\t\t\t\t\tposition.left += myOffset + atOffset + offset;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\ttop: function( position, data ) {\n\t\t\tvar within = data.within,\n\t\t\t\twithinOffset = within.offset.top + within.scrollTop,\n\t\t\t\touterHeight = within.height,\n\t\t\t\toffsetTop = within.isWindow ? within.scrollTop : within.offset.top,\n\t\t\t\tcollisionPosTop = position.top - data.collisionPosition.marginTop,\n\t\t\t\toverTop = collisionPosTop - offsetTop,\n\t\t\t\toverBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,\n\t\t\t\ttop = data.my[ 1 ] === \"top\",\n\t\t\t\tmyOffset = top ?\n\t\t\t\t\t-data.elemHeight :\n\t\t\t\t\tdata.my[ 1 ] === \"bottom\" ?\n\t\t\t\t\t\tdata.elemHeight :\n\t\t\t\t\t\t0,\n\t\t\t\tatOffset = data.at[ 1 ] === \"top\" ?\n\t\t\t\t\tdata.targetHeight :\n\t\t\t\t\tdata.at[ 1 ] === \"bottom\" ?\n\t\t\t\t\t\t-data.targetHeight :\n\t\t\t\t\t\t0,\n\t\t\t\toffset = -2 * data.offset[ 1 ],\n\t\t\t\tnewOverTop,\n\t\t\t\tnewOverBottom;\n\t\t\tif ( overTop < 0 ) {\n\t\t\t\tnewOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight -\n\t\t\t\t\touterHeight - withinOffset;\n\t\t\t\tif ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {\n\t\t\t\t\tposition.top += myOffset + atOffset + offset;\n\t\t\t\t}\n\t\t\t} else if ( overBottom > 0 ) {\n\t\t\t\tnewOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset +\n\t\t\t\t\toffset - offsetTop;\n\t\t\t\tif ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {\n\t\t\t\t\tposition.top += myOffset + atOffset + offset;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tflipfit: {\n\t\tleft: function() {\n\t\t\t$.ui.position.flip.left.apply( this, arguments );\n\t\t\t$.ui.position.fit.left.apply( this, arguments );\n\t\t},\n\t\ttop: function() {\n\t\t\t$.ui.position.flip.top.apply( this, arguments );\n\t\t\t$.ui.position.fit.top.apply( this, arguments );\n\t\t}\n\t}\n};\n\n} )();\n\nvar position = $.ui.position;\n\n\n/*!\n * jQuery UI Keycode 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: Keycode\n//>>group: Core\n//>>description: Provide keycodes as keynames\n//>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/\n\n\nvar keycode = $.ui.keyCode = {\n\tBACKSPACE: 8,\n\tCOMMA: 188,\n\tDELETE: 46,\n\tDOWN: 40,\n\tEND: 35,\n\tENTER: 13,\n\tESCAPE: 27,\n\tHOME: 36,\n\tLEFT: 37,\n\tPAGE_DOWN: 34,\n\tPAGE_UP: 33,\n\tPERIOD: 190,\n\tRIGHT: 39,\n\tSPACE: 32,\n\tTAB: 9,\n\tUP: 38\n};\n\n\n/*!\n * jQuery UI Scroll Parent 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: scrollParent\n//>>group: Core\n//>>description: Get the closest ancestor element that is scrollable.\n//>>docs: http://api.jqueryui.com/scrollParent/\n\n\n\nvar scrollParent = $.fn.scrollParent = function( includeHidden ) {\n\tvar position = this.css( \"position\" ),\n\t\texcludeStaticParent = position === \"absolute\",\n\t\toverflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,\n\t\tscrollParent = this.parents().filter( function() {\n\t\t\tvar parent = $( this );\n\t\t\tif ( excludeStaticParent && parent.css( \"position\" ) === \"static\" ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn overflowRegex.test( parent.css( \"overflow\" ) + parent.css( \"overflow-y\" ) +\n\t\t\t\tparent.css( \"overflow-x\" ) );\n\t\t} ).eq( 0 );\n\n\treturn position === \"fixed\" || !scrollParent.length ?\n\t\t$( this[ 0 ].ownerDocument || document ) :\n\t\tscrollParent;\n};\n\n\n/*!\n * jQuery UI Unique ID 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: uniqueId\n//>>group: Core\n//>>description: Functions to generate and remove uniqueId's\n//>>docs: http://api.jqueryui.com/uniqueId/\n\n\n\nvar uniqueId = $.fn.extend( {\n\tuniqueId: ( function() {\n\t\tvar uuid = 0;\n\n\t\treturn function() {\n\t\t\treturn this.each( function() {\n\t\t\t\tif ( !this.id ) {\n\t\t\t\t\tthis.id = \"ui-id-\" + ( ++uuid );\n\t\t\t\t}\n\t\t\t} );\n\t\t};\n\t} )(),\n\n\tremoveUniqueId: function() {\n\t\treturn this.each( function() {\n\t\t\tif ( /^ui-id-\\d+$/.test( this.id ) ) {\n\t\t\t\t$( this ).removeAttr( \"id\" );\n\t\t\t}\n\t\t} );\n\t}\n} );\n\n\n}));\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignValue;\n","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nmodule.exports = copyObject;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nmodule.exports = createAssigner;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","var assignValue = require('./_assignValue'),\n copyObject = require('./_copyObject'),\n createAssigner = require('./_createAssigner'),\n isArrayLike = require('./isArrayLike'),\n isPrototype = require('./_isPrototype'),\n keys = require('./keys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\nvar assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n});\n\nmodule.exports = assign;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","module.exports = jQuery;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = function(module) {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","import '../scss/app.scss';\n\n/**\n * Admin modules\n */\n\nconst WP_Smush = WP_Smush || {};\nwindow.WP_Smush = WP_Smush;\n\n/**\n * IE polyfill for includes.\n *\n * @since 3.1.0\n * @param {string} search\n * @param {number} start\n * @return {boolean} Returns true if searchString appears as a substring of the result of converting this\n * object to a String, at one or more positions that are\n * greater than or equal to position; otherwise, returns false.\n */\nif ( ! String.prototype.includes ) {\n\tString.prototype.includes = function( search, start ) {\n\t\tif ( typeof start !== 'number' ) {\n\t\t\tstart = 0;\n\t\t}\n\n\t\tif ( start + search.length > this.length ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this.indexOf( search, start ) !== -1;\n\t};\n}\n\nrequire( './modules/helpers' );\nrequire( './modules/admin' );\nrequire( './modules/admin-common' );\nrequire( './modules/bulk-smush' );\nrequire( './modules/nextgen-bulk' );\nrequire( './modules/background-process' );\nrequire( './common/media-library-scanner' );\nrequire( './modules/media-library-scanner-on-bulk-smush' );\nrequire( './modules/media-library-scanner-on-dashboard' );\nrequire( './modules/onboarding' );\nrequire( './modules/directory-smush' );\nrequire( './smush/cdn' );\nrequire( './smush/webp' );\nrequire( './smush/lazy-load' );\nrequire( './modules/bulk-restore' );\nrequire( './smush/settings' );\nrequire( './smush/product-analytics' );\n\n/**\n * Notice scripts.\n *\n * Notices are used in the following functions:\n *\n * @used-by \\Smush\\Core\\Modules\\Smush::smush_updated()\n * @used-by \\Smush\\Core\\Integrations\\S3::3_support_required_notice()\n * @used-by \\Smush\\App\\Abstract_Page::installation_notice()\n *\n * TODO: should this be moved out in a separate file like common.scss?\n */\nrequire( './modules/notice' );\n"],"names":["UpsellManger","maybeShowCDNActivationNotice","wp_smush_msgs","smush_cdn_activation_notice","WP_Smush","helpers","renderActivationCDNNotice","maybeShowCDNUpsellForPreSiteOnStart","upsellCdn","document","querySelector","innerHTML","processing_cdn_for_free","classList","remove","maybeShowCDNUpsellForPreSiteOnCompleted","processed_cdn_for_free","GlobalStats","$","bind","summarySmush","boStats","window","wp_smushit_data","bo_stats","globalStats","count_images","count_total","count_resize","count_skipped","count_smushed","savings_bytes","savings_resize","size_after","size_before","savings_percent","percent_grade","percent_metric","percent_optimized","remaining_count","human_bytes","savings_conversion_human","savings_conversion","imageScore","logBulk","bulkSmushCountContent","allErrors","generateGlobalStatsFromSmushData","smushScriptData","Object","assign","keys","reduce","newStats","key","isChangedStats","newBoStats","some","setBoStats","this","getBoStats","setGlobalStats","newGlobalStats","getGlobalStats","renderScoreProgress","className","replace","add","dataset","score","setAttribute","renderSummaryDetail","renderTotalStats","renderResizedStats","renderConversionSavings","resizeCountElement","conversionSavingsElement","parentElement","renderBoxSummary","setErrors","newErrors","getErrors","renderErrors","length","is_completed","errors","errorKeys","showAnimatedUpsell","map","image_id","index","upsellErrorCode","error_code","push","prepareBulkSmushErrorRow","error_message","file_name","thumbnail","join","style","display","resetAndHideBulkErrors","resetErrors","renderStats","maybeUpdateBulkSmushCountContent","newContent","updateGlobalStatsFromSmushScriptData","content","wp","i18n","__","MediaLibraryScanner","_classCallCheck","autoSyncDuration","progressTimeoutId","scanProgress","scanProgressBar","value","_this","optimizeOnScanCompleted","arguments","undefined","onStart","processType","loopbackTester","performTest","then","res","loopback","Fetcher","scanMediaLibrary","start","response","success","showFailureNotice","onStartFailure","showProgressBar","autoSyncStatus","showLoopbackErrorModal","catch","error","console","showNotice","showdismiss","autoclose","loopbackErrorModal","getElementById","SUI","showModal","id","onShowProgressBar","reset","setOnCancelCallback","showStopScanningModal","open","onShowStopScanningModal","openModal","registerCancelProcessEvent","stopScanButton","addEventListener","cancelProgress","once","stopScanningElement","contains","closeModal","onCloseProgressBar","close","stats","totalItems","getTotalItems","processedItems","getProcessedItems","update","processed_items","total_items","_this2","setCancelButtonOnCancelling","cancel","onCancelled","data","onCancelFailure","resetCancelButtonOnFailure","clearProgressTimeout","closeProgressBar","closeStopScanningModal","showRetryScanModal","retryScanModalElement","e","recheckImagesBtn","preventDefault","click","onFinish","global_stats","updateGlobalStatsAndBulkContent","clearTimeout","getScanStatus","_this3","startTime","Date","getTime","getStatus","is_dead","onDead","beforeUpdateStatus","updateProgress","increaseDurationToHaveChangeOnProgress","onCompleted","is_cancelled","setTimeout","element","newText","originalText","innerText","trim","_window$wp_smushit_da","_wp$i18n","_n","percentElement","progressElement","remainingTimeElement","cancelBtn","holdOnNoticeElement","onCancelCallback","intervalProgressAnimation","progressTransitionDuration","setProperty","prevProcessedItems","media_library_scan","cacheProcessTimePerItem","durationToHaveChangeOnProgress","timeLimitToShowNotice","updateRemainingTime","width","Math","floor","min","currentWidth","animateProgressBar","clearInterval","Promise","resolve","setInterval","remainingTime","calcProcessTimePerItem","formatTime","processTimePerItem","resetDurationToHaveChangeOnProgress","accumulator","processTime","increaseTime","showHoldOnNotice","resetHoldOnNoticeVisibility","totalMilliSeconds","totalSeconds","seconds","minutes","timeString","resetCancelButton","onclick","callBack","setCancelButtonLabel","textContent","cancelling","resetCancelButtonLabel","removeAttribute","progressBar","isEmptyObject","bulkSmushDescription","bulkRunningNotice","bulkSmushAllDone","stopBulkSmushModal","isStateHidden","processStateStats","firstElementChild","lastElementChild","resetOriginalNotice","closeStopBulkSmushModal","show","showStopBulkSmushModal","hideBulkSmushDescription","hideBulkSmushAllDone","hideRecheckImagesNotice","modalId","showBulkSmushDescription","showBulkSmushAllDone","hideState","showState","setNotice","inProcessNotice","progressMessage","cacheOriginalNotice","hideBulkProcessingNotice","showBulkProcessingNotice","setCountUnitText","unitText","disableExceedLimitMode","recheckImagesNoticeElement","LoopbackTester","reject","startTest","getResult","delayTimeOnFailure","background","backgroundHealthyCheck","successCallback","failedCallback","errorCallback","fetchResult","status","backgroundHealthyStatus","jQuery","on","prop","slide_symbol","find","parents","eq","slideToggle","text","remove_element","el","timeout","fadeTo","slideUp","process_smush_action","currentButton","smushAction","action","attr","hide","mode","location","search","indexOf","params","attachment_id","_nonce","c_element","parent","css","opacity","disable_links","oldLabel","html","post","ajaxurl","r","enable_links","wrapper","failed_item_smushed","hasClass","Smush","updateImageStats","new_size","error_msg","closest","addClass","append","showRecheckImagesNotice","notice","type","noticeType","openNotice","icon","updateBulkSmushContentAfterReCheck","SmushProgress","goToByScroll","selector","animate","scrollTop","offset","top","currentTarget","val","reload","self","_ajax_nonce","done","current_button","process_settings","button","scan_type","removeAttr","get_ui","wp_smush_options_nonce","get","always","removeClass","$defaultText","$completedText","runRecheck","$el","container","parseInt","resmush","count_supersmushed","smush_percent","precise_round","progress_bar","savings_dir_smush","orig_size","image_size","unsmushed","updateStats","hash","scrollTo","substring","focus","target","trigger","keypress","keyCode","wrapper_div","width_only","height_only","resize_checkbox","width_input","width_error_note","height_input","height_error_note","width_error","height_error","is","resize_sizes","height","validate_resize_settings","settings_wrap","nonce","membership_valid","membership_invalid","stats_param","message","dir_smush","ajax_error","stats_human","stats_percent","bytes","human","percent","combined_stats","c_stats","smushed","total_count","savings","update_cummulative_stats","prepend","toggleClass","compressionLevelNotice","compressionNoticeContent","_e$target","_e$target$dataset","nodeName","note","handleCompressionLevelNotice","href","openNewTab","_e$detail","detail","is_outdated_stats","lossyLevelSummaryBox","currentLossyLevelTab","upsellLink","nextElementSibling","includes","updateLossyLevelInSummaryBox","BackgroundProcess","handle","initState","BackgroundSmush","startBtn","BO","bulkWrapper","reScanImagesButton","intervalHandle","cancellationInProgress","hookStatusChecks","count","statusSyncInProgress","statSyncInProgress","statusSynced","syncBackgroundStatus","syncStats","finally","resetBOStatsOnStart","failed_items","startBulkSmush","updatedStats","cancelBulk","_this4","in_processing","_this5","setCancelButtonStateToStarted","hideProgressBar","updateGlobal","_objectWithoutProperties","_excluded","_this6","onCompletedBulk","showCompletedMessage","processedWrapper","completeMessage","all_failed","isFailedAllItems","error_in_bulk","getNoticeType","noticeIcon","iconElement","all_smushed","completeBulk","_this7","_this8","onComplete","responseErrors","log","_this9","in_process_notice","hideBulkSmushFailedNotice","setCancelButtonStateToInitial","bulkSmushFailedNotice","showRetryBulkSmushModal","_this10","retryModalElement","init","_this11","triggerBulkSmushButton","restore","modal","contentContainer","settings","slide","items","currentStep","totalSteps","resetModalWidth","renderTemplate","onboarding","template","bindSubmit","maxWidth","confirmButton","initScan","tracker","track","updateProgressBar","progress","round","statusDiv","xhr","XMLHttpRequest","setRequestHeader","onload","JSON","parse","step","send","item","pop","src","thumb","link","total","_","memoize","compiled","options","evaluate","interpolate","escape","variable","templateSettings","bulk","onClickBulkSmushNow","onClickIgnoreImage","onClickIgnoreAllImages","onScanCompleted","bulkSmushButton","ajaxBulkSmushStart","bulkSmush","resumeBulkSmush","SmushProcess","cancelAjax","ids","run","callAjax","ignoreAll","cursor","smush","upsell_cdn","failedItems","skippedItems","obj","scan","remainingSteps","fail","showScanError","getProgress","onFinishStep","progress_smushed","directory","directory_url","dialog","concat","statusText","forbiddenMessage","limitReached","bulk_resume","resume","skipped","failed","selected","tree","triggered","progressDialog","currentScanStep","scanner","Scanner","initFileTree","off","selectedFolders","getSelectedNodes","paths","forEach","folder","param","smush_path","image_list_nonce","showProgressDialog","queryString","URLSearchParams","has","smushButton","ajaxSettings","url","list_nonce","cache","entries","createTree","autoCollapse","clickFolderMode","checkbox","debugLevel","selectMode","tabindex","keyboard","quicksearch","source","lazyLoad","event","result","dir","node","ajax","loadChildren","fixSelection3AfterClick","select","cacheUpsellErrorCodes","formatBytes","a","b","thresh","units","abs","u","toFixed","getSizeFromString","formattedSize","getFormatFromString","num","decimals","sign","pow","showErrorNotice","noticeMessage","loadingButton","resetSettings","smush_url","errorMsg","fileName","errorCode","thumbDiv","editLink","edit_link","tableDiv","error_ignore","btn_ignore","view_detail","upsellWithError","cacheUpsellErrorCode","isUpsellRendered","cacheRenderedUpsell","getErrorMessage","resp","responseJSON","generic_ajax_error","noticeOptions","_typeof","dismiss","label","noticeDismiss","tooltip","noticeDismissTooltip","closeNotice","upsellHtml","outerHTML","redirectToPage","page","mediaLibScanner","_MediaLibraryScanner","MediaLibraryScannerOnBulkSmush","_callSuper","runBulkSmushOnComplete","restoreButton","autoBulkSmushNotification","_inherits","startScan","hideRecheckNotice","hideFailedBulkSmushNotice","disableRelatedButtons","setRecheckImagesButtonOnLoad","toggleBulkSmushBoxContent","_get","_getPrototypeOf","prototype","call","revertRelatedButtons","maybeHideAutoBulkSmushNotification","setInnerText","revertInnerText","revertRecheckImagesButton","disableRecheckImagesButton","optimize_on_scan_completed","maybeShowAutoBulkSmushNotification","setRequiredScanForBulkSmushButton","toggleBulkSmushDescription","is_outdated","removeScanEventFromBulkSmushButton","revertRecheckWarning","triggerBulkSmushEvent","showRecheckNoticeSuccess","recheckNotice","showAnElement","hideAnElement","recheckWarningElement","showRecheckNoticeWarning","enabled_background_process","triggerBackgroundBulkSmushEvent","triggerAjaxBulkSmushEvent","dispatchEvent","CustomEvent","startScanThenBulkSmushOnComplete","registerScanAndBulkSmushEvent","recheckImagesNotice","_window$wp_smushit_da2","_window$wp_smushit_da3","triggerBackgroundScanImagesLink","showProgressErrorNoticeOnRecheckNotice","triggerBulkSmush","dismissNotices","querySelectorAll","dismissNotice","registerEventsRelatedInlineNoticeOnBulkSmushPage","cleanedURL","history","pushState","maybeAutoStartMediaLibraryScanOnRedirect","autoStartBulkSmushOnRedirect","retryButton","_loopbackErrorModal$d","registerRetryProcessFromLoopbackErrorModal","mediaLibraryScannerOnDashboard","bulkSmushLink","disableBulkSmushLink","revertBulkSmushLink","s3alert","removeNotice","$notice","membership","onboardingModal","first_slide","first","last","selection","usage","auto","lossy","strip_exif","original","lazy_load","onboardingSlides","touchX","touchY","recheckImagesLink","ctaUrl","tracking","skipButton","skipSetup","handleTouchStart","firstTouch","touches","clientX","clientY","handleTouchMove","xUp","yUp","xDiff","yDiff","next","directionClass","input","checked","submitButton","onFinishingSetup","stringify","startRecheckImages","whereTo","newIndex","goTo","onSkipSetup","hideUpgradeModal","redirectUrl","actionName","Action","CDN","cdnEnableButton","cdnDisableButton","cdnStatsBox","toggle_cdn","updateStatsBox","enable","nonceField","getElementsByName","toggleElements","spinner","elements","i","toggle","Lazyload","lazyloadEnableButton","lazyloadDisableButton","toggle_lazy_load","removeSpinner","removeLoaderIcon","removePlaceholder","handlePredefinedPlaceholders","pl1","changeColor","pl2","color","backgroundColor","addLoaderIcon","frame","media","title","multiple","attachment","state","toJSON","imageIcon","backgroundImage","removeDiv","filename","ProductAnalytics","_defineProperty","allowToTrack","trackUltraLinks","trackUpsellLinks","registerTroubleshootClickEvent","trackScanInterruptedEventOnStopScanningModal","trackScanInterruptedEventOnRetryScanModal","trackBulkSmushInterruptedEventOnStopBulkSmushModal","trackBulkSmushInterruptedEventOnRetryBulkSmushModal","registerBulkSmushResumeClickEvent","trackBulkSmushInterruptedEventWhenExitingAjaxBulkSmush","trackInterruptedEventFromInlineNotice","trackInterruptedEventFromLoopbackErrorModal","maybeTrackMissedEventsOnLoad","ultraUpsellLinks","getLocation","ultraLink","dashboard","cdn","webp","getCurrentPageSlug","Location","upsellLinks","URL","searchParams","campaign","upsellLocations","summary_cdn","smush_bulksmush_cdn","smush_cdn_upgrade_button","smush_bulksmush_library_gif_cdn","smush_bulk_smush_complete_global","summary_local_webp","matches","match","eventName","stopScanningModal","closeButton","trackScanInterruptedEvent","Trigger","_e$target$dataset2","trackBulkSmushInterruptedEvent","retryScanModal","properties","getScanInterruptedEventProperties","cacheMissedEvent","_e$target$dataset3","retryBulkModal","_e$target$dataset4","Troubleshoot","troubleshootClicked","canUseBackgroundOptimization","_window$WP_Smush","ajaxBulkSmushObject","isFreeExceeded","getBulkSmushInterruptedEventProperties","resumeBulkSmushCount","eventData","localStorage","setItem","missedEventsKey","getItem","removeItem","getBulkSmushProcessStats","_window$WP_Smush2","totalEnqueuedImages","processedImages","ceil","trackInterruptedEventFromInlineNoticeOnDashboard","trackBulkSmushInterruptedEventFromInlineNoticeOnBulkSmush","trackScanInterruptedEventFromInlineNoticeOnBulkSmush","dashboardBulkElement","trackBulkSmushInterruptedEventFromInlineNoticeOnDashboard","trackScanInterruptedEventFromInlineNoticeOnDashboard","trackBulkSmushInterruptedInlineNoticeEvent","triggerScanButton","_triggerBackgroundSca","previousElementSibling","loopbackErrorDocsLink","isTroubleshootClicked","_e$target$dataset5","_this12","troubleshootLinks","troubleshootLink","_this13","missedEvents","getMissedEvents","clearMissedEvents","missedEvent","_this14","resumeBulkSmushButton","pageSlug","saveSettings","msg","showSuccessNotice","settingsUpdated","serialize","otherClass","parentNode","noticeDiv","warningDiv","perf","skip_resmush","is_bulk","setIds","is_bulk_resmush","prev","smush_type","single_ajax_suffix","bulk_ajax_suffix","get_stats_action","smushAddParams","bindDeferredEvents","filter","itm","bulkStart","singleStart","smushing","request","membershipValidity","all_done","html_stats","smush_vars","strings","stats_label","enableButton","messageHolder","sync_stats","hideBulkFreeLimitReachedNotice","_updateProgress","removeProp","bulkErrors","firstAnimatedError","Array","slice","childNodes","showAnimatedUpsellNotice","unlimitedUpsellNotice","bulkErrorActionsElement","showBulkFreeLimitReachedNotice","bulkFreeLimitReachedNotice","_res","updateLocalizedStats","continueSmush","deferred","Deferred","newBulkSmushStarted","performance","now","freeExceeded","nonceValue","current_id","shift","updateSmushIds","unshift","updateScoreProgress","onBulkSmushCompleted","singleDone","continue","maybeShowUnlimitedUpsellNotice","maybeShowBulkErrorActions","callback","trackBulkSmushCompleted","totalImages","totalImagesToSmush","_GlobalStats$getGloba","convertToMegabytes","parseFloat","sizeInBytes","sizeInMegabytes","bulkDone","abort","memberValidityNotice","show_warning","isBulkResmush","sendUrl","new_bulk_smush_started","dataType","imagesToResmush","unsmushedCount","grade","percentOptimized","percentMetric","getTotalImagesToSmush","scanType","isNextgen","statsHuman","isNaN","smushedCountDiv","smushConversionSavings","conversionSavings","newSize","attachmentSize","contents","nodeType","sizeStrongEl","imageStats","is_lossy","currentId","uIndex","splice","WebP","toggleModuleButton","recheckStatusButton","recheckStatusLink","showWizardButton","switchWebpMethod","maybeShowDeleteAllSuccessNotice","toggleWebp","recheckStatus","deleteAll","toggleWizard","switchMethod","method","newMethod","doEnable","runScan","localWebpURL","isConfigured","webp_nonce","SmushAjax","args","FormData","contentType","processData","smush_global","methods","getStats","common","dismissId","hideModal","modalID","modal_id","Tracker","_window$wp_smush_mixp","wp_smush_mixpanel","opt_in","ui","fancytree","FT","TEST_IMG","RegExp","REX_HTML","REX_TOOLTIP","RECURSIVE_REQUEST_ERROR","INVALID_REQUEST_TARGET_ERROR","ENTITY_MAP","IGNORE_KEYCODES","SPECIAL_KEYCODES","MODIFIERS","MOUSE_BUTTONS","CLASS_ATTRS","split","CLASS_ATTR_MAP","TREE_ATTRS","NODE_ATTRS","NODE_ATTR_MAP","NODE_ATTR_LOWERCASE_MAP","NONE_NODE_DATA_MAP","active","children","toLowerCase","_isArray","isArray","_assert","FancytreeNode","_findDirectChild","ptr","l","cl","_setChildren","_callHook","addChildren","insertBefore","pos","origFirstChild","getFirstChild","origLastChild","getLastChild","firstNode","nodeList","isPlainObject","inArray","apply","render","renderStatus","ul","tr","fixSelection3FromEndNodes","triggerModifyChild","addNode","getParent","getNextSibling","addPagingNode","n","extend","moreData","statusNodeType","partload","removeChild","appendSibling","applyCommand","cmd","opts","applyPatch","patch","_getResolvedPromise","name","v","IGNORE_MAP","expanded","_hasProp","_isFunction","removeChildren","isVisible","renderTitle","setExpanded","collapseSiblings","copyTo","toDict","countChildren","deep","debug","toString","consoleApply","discard","warn","resetLazy","discardMarkup","includeSelf","fn","findAll","_makeNodeTitleMatcher","visit","findFirst","findRelatedNode","where","includeHidden","_changeSelectStatusAttrs","changed","unselectable","evalOption","unselectableStatus","partsel","callOpts","flag","isSelected","radiogroup","_walk","child","s","allSelected","someSelected","unselState","lazy","visitParents","fromDict","dict","getChildren","hasChildren","getIndex","getIndexHier","separator","digits","each","getParentList","o","substr","getKeyPath","excludeSelf","sep","keyPathSeparator","getPath","getLevel","level","dtn","ac","includeRoot","part","path","isFunc","getPrevSibling","stopOnParents","isStatusNode","extraClasses","hasFocus","focusNode","info","isActive","activeNode","isBelowOf","otherNode","isChildOf","isDescendantOf","p","isExpanded","isFirstSibling","isFolder","isLastSibling","isLazy","isLoaded","isLoading","_isLoading","isRoot","isRootNode","isPartsel","isPartload","rootNode","isPagingNode","isTopLevel","isUndefined","hasFilter","enableFilter","subMatchCount","load","forceReload","wasExpanded","_triggerNodeEvent","makeVisible","deferreds","dfd","len","effects","noAnimation","scroll","scrollIntoView","when","promise","moveTo","targetNode","prevParent","targetParent","navigate","activate","KC","LEFT","RIGHT","setFocus","setActive","childNode","force","replaceWith","scheduleAction","ms","timer","_isNode","Error","duration","queue","scrollOfs","scrollParent","topNode","$scrollParent","$container","overflowY","jquery","tbody","body","topNodeY","nodeY","containerOffsetTop","nodeHeight","span","topOfs","bottomOfs","bottom","containerHeight","$animateTarget","isParentWindow","newScrollTop","max","innerHeight","clientHeight","resolveWith","complete","stop","setSelected","setStatus","details","setTitle","triggerModify","sortChildren","cmp","x","y","sort","recursive","rnotwhite","classNames","wasAdded","statusElem","statusClassPropName","curClasses","_trim","toggleExpanded","toggleSelected","operation","extra","modifyChild","visitAndLoad","_recursion","loaders","visitSiblings","Fancytree","_makeHookContext","originalEvent","ctx","widget","typeInfo","types","funcName","contextObject","_extraArgs","_setExpiringValue","_tempCache","expire","_getExpiringValue","entry","_usesExtension","extensions","_requireExtension","required","before","thisName","_local","extList","isBefore","isMissing","ext","badOrder","activateKey","getNodeByKey","opts_","refNode","getActiveNode","editCreateNode","editStart","patchList","p2","patchCount","deferredList","_makeResolveFunc","clear","destroy","disable","enableUpdate","_enableUpdate","expandAll","findNextNode","startNode","_checkNode","_makeNodeTitleStartMatcher","visitRows","BACKSPACE","HOME","END","UP","reverse","DOWN","generateFormElements","selectedName","_id","activeName","$result","_appender","empty","insertAfter","idx","getFocusNode","getOption","optionName","option","searchRoot","idPrefix","ftnode","getRootNode","_hasFocus","_requestId","loadKeyPath","keyPathList","optsOrCallback","pathSegList","notifyWith","matchKey","charAt","_loadKeyPathImpl","nodeKey","remain","remainMap","tmpParent","segList","subDfd","__findChild","__lazyload","errMsg","rejectWith","reactivate","noFocus","selectAll","setOption","debugTime","time","debugTimeEnd","timeEnd","_trigger","_triggerTreeEvent","_visitRowsUp","nextIdx","siblings","siblingOfs","skipFirstNode","checkFilter","nodeClick","expand","targetType","focusOnSelect","nodeSetFocus","nodeCollapseSiblings","nodeDblclick","nodeKeydown","matchNode","stamp","which","String","fromCharCode","specialModifiers","altKey","ctrlKey","metaKey","isAlnum","$target","handled","autoActivate","lastQuicksearchTime","lastQuicksearchTerm","eventToString","nodeSetExpanded","nodeToggleSelected","nodeSetActive","nodeLoadChildren","delay","resultDfd","ajaxDfd","isAsync","nodePrevParent","tag","requestId","debugDelay","random","nodeSetStatus","textStatus","jqXHR","errorObj","postProcess","enableAspx","d","parseJSON","errorThrown","metaData","noDataRes","nodata","noData","ctxErr","nodeLoadKeyPath","nodeRemoveChild","subCtx","nodeRemoveChildren","nodeRemoveMarkup","nodeRemoveChildMarkup","li","nodeRenderStatus","nodeRender","collapsed","_recursive","childLI","childNode1","childNode2","aria","firstTime","successorLi","nextSibling","createElement","generateIds","appendChild","nodeRenderTitle","createNode","renderNode","$div","firstChild","nodeTitle","role","iconTooltip","ares","minExpandLevel","iconClass","_escapeTooltip","test","imagePath","escapeHtml","titlesTabbable","escapeTitles","enhanceTitle","$title","$ariaElem","isLastSib","cn","_classNames","cnList","focused","Boolean","lastsib","loading","_error","statusNodePrefix","combinedExpanderPrefix","combinedIconPrefix","noEvents","_getRejectedPromise","activeVisible","_afterLoad","prevAC","animating","lastChild","autoScroll","effect","toggleEffect","ctx2","isInput","calledByNode","uniqueId","activeElement","nodeSetSelected","_lastSelectIntent","lastSelectedNode","_clearStatusNode","_setStatusNode","loadError","nodeToggleExpanded","treeClear","treeCreate","treeDestroy","$source","treeInit","checkboxAutoHide","rtl","treeLoad","$ul","rootCtx","not","parseHtml","_getElementDataAsDict","treeRegisterNode","treeSetFocus","_lastMousedownNode","treeSetOption","callDefault","callCreate","callRender","_super","Widget","_setOption","treeStructureChanged","copyFunctionsToData","disabled","treeId","radio","_deprecationWarning","_create","extension","extName","base","_extensions","_simpleDeepMerge","_subclassObject","icons","tabbable","_init","_bind","_destroy","_unbind","ns","_ns","getNode","prevPhase","phase","et","getEventTarget","getTree","version","buildType","_nextId","_nextNodeKey","_FancytreeClass","_FancytreeNodeClass","jquerySupports","positionMyOfs","isVersionAtLeast","assert","cond","$tree","debounce","invokeAsap","fixPositionOptions","my","at","myParts","exec","atParts","dx","dy","tcn","getEventTargetType","orgEl","Element","HTMLDocument","nodeObject","treeOptions","defaultValue","treeOpt","nodeOpt","setSpanIcon","baseClass","$span","shiftKey","keyEventToString","overrideMethod","instance","methodName","handler","context","prevSuper","noop","classes","iPos","tmp","tmp2","$children","allData","lowerCaseAttr","$li","$liSpan","$liA","registerExtension","definition","unescapeHtml","nodeValue","object","property","hasOwnProperty","dottedVersion","major","minor","t","verParts","testParts","copy","clone","_makeVirtualFunction","prevFunc","baseFunc","_superApply","proxy","prevLocal","prevSuperApply","attrName","argArray","json","uiFancytree","reMatch","unselectableIgnore","hideCheckbox","defaultKey","lazyload","loaderror","fx","removeNode","columns","systemFocusElement","viewport","ariaPropName","nodeContainerAttrName","fakeParent","class","appendTo","orig","uuid","widgetUuid","widgetSlice","cleanData","elems","events","elem","_data","triggerHandler","existingConstructor","constructor","basePrototype","proxiedPrototype","namespace","fullName","expr","_createWidget","_proto","_childConstructors","isFunction","returnValue","__super","__superApply","widgetEventPrefix","widgetName","widgetFullName","childPrototype","bridge","inputIndex","inputLength","isMethodCall","methodValue","pushStack","defaultElement","create","eventNamespace","bindings","hoverable","focusable","classesElementLookup","_on","ownerDocument","defaultView","parentWindow","_getCreateOptions","_setOptionDisabled","_getCreateEventData","that","_removeClass","removeData","parts","curOption","_setOptions","_setOptionClasses","classKey","currentElements","_classes","_toggleClass","full","processClassString","checkOption","current","unique","_untrackClassesElement","_addClass","suppressDisabledCheck","handlers","delegateElement","handlerProxy","guid","_off","_delay","_hoverable","mouseenter","mouseleave","_focusable","focusin","focusout","Event","isDefaultPrevented","defaultEffect","hasOptions","effectName","easing","cachedScrollbarWidth","rhorizontal","rvertical","roffset","rposition","rpercent","_position","position","getOffsets","offsets","parseCss","getDimensions","raw","left","isWindow","scrollLeft","pageY","pageX","outerWidth","outerHeight","scrollbarWidth","w1","w2","div","innerDiv","offsetWidth","clientWidth","getScrollInfo","within","overflowX","isDocument","hasOverflowX","scrollWidth","scrollHeight","getWithinInfo","withinElement","of","atOffset","targetWidth","targetHeight","targetOffset","basePosition","dimensions","scrollInfo","collision","horizontalOffset","verticalOffset","collisionPosition","using","elemWidth","elemHeight","marginLeft","marginTop","collisionWidth","collisionHeight","myOffset","props","right","feedback","horizontal","vertical","important","fit","newOverRight","withinOffset","collisionPosLeft","overLeft","overRight","newOverBottom","collisionPosTop","overTop","overBottom","flip","newOverLeft","offsetLeft","newOverTop","offsetTop","flipfit","COMMA","DELETE","ENTER","ESCAPE","PAGE_DOWN","PAGE_UP","PERIOD","SPACE","TAB","excludeStaticParent","overflowRegex","removeUniqueId","Symbol","module","exports","func","thisArg","baseTimes","isArguments","isBuffer","isIndex","isTypedArray","inherited","isArr","isArg","isBuff","isType","skipIndexes","baseAssignValue","objValue","defineProperty","getRawTag","objectToString","symToStringTag","toStringTag","baseGetTag","isObjectLike","isMasked","isObject","toSource","reIsHostCtor","funcProto","Function","objectProto","funcToString","reIsNative","isLength","typedArrayTags","isPrototype","nativeKeys","identity","overRest","setToString","constant","baseSetToString","string","iteratee","assignValue","customizer","isNew","newValue","coreJsData","baseRest","isIterateeCall","assigner","sources","guard","getNative","freeGlobal","g","baseIsNative","getValue","nativeObjectToString","isOwn","unmasked","reIsUint","isArrayLike","uid","maskSrcKey","IE_PROTO","Ctor","overArg","freeExports","freeModule","freeProcess","process","nodeUtil","require","binding","transform","arg","nativeMax","array","otherArgs","freeSelf","root","shortOut","nativeNow","lastCalled","remaining","copyObject","createAssigner","other","baseIsArguments","propertyIsEnumerable","stubFalse","Buffer","baseIsTypedArray","baseUnary","nodeIsTypedArray","arrayLikeKeys","baseKeys","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","loaded","__webpack_modules__","getter","__esModule","enumerable","globalThis","nmd"],"sourceRoot":""}