// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
define("esri/dijit/geoenrichment/ReportPlayer/playerSupports/_WaitingSupport","dojo/_base/declare dojo/_base/lang esri/dijit/geoenrichment/utils/DelayUtil esri/dijit/geoenrichment/utils/DomUtil esri/dijit/geoenrichment/utils/WaitingUtil esri/dijit/geoenrichment/utils/progress/SmoothProgress".split(" "),function(c,e,f,k,d,g){var h=c(null,{_dataProgress:0,_areaProgresses:null,_numAreas:0,constructor:function(a){e.mixin(this,a);this.reset()},reset:function(){this._dataProgress=0;this._areaProgresses=
{};this._fireProgress()},setLoadDataProgress:function(a){this._dataProgress=a;this._fireProgress()},setNumAreas:function(a){this._numAreas=a},setProgressForAreaAt:function(a,b){this._areaProgresses[b]=a;this._fireProgress()},finalize:function(){this.onDone();return f.delay(300)},_setProgress:function(a){this._currentProgress=a;this.onChange(this._currentProgress)},_fireProgress:function(){var a=.25*this._dataProgress,b=.75/this._numAreas,c;for(c in this._areaProgresses)a+=b*(this._areaProgresses[c]||
0);a=Math.min(1,Math.max(0,a));this.onChange(a);this._printProgress()},_printProgress:function(){var a=[],b;for(b in this._areaProgresses)a.push("#"+b+" "+(100*this._areaProgresses[b]).toFixed(0));console.log("...........LOAD PROGRESS \x3d\x3e Data "+(100*this._dataProgress).toFixed(0)+" Areas "+a.join("; "))},onChange:function(a){},onDone:function(){}});return c(null,{_progressController:null,_initProgressController:function(){var a=this;this.showProgressBar&&(this._progressController=new h,(new g(this._progressController)).onChange=
function(b){d.showProgressBar({value:b,node:a.domNode,position:"top"})})},_showWaiting:function(a){return d.showProgressPromise(this.domNode,a,{progressClass:"esriGEReportPlayerProgress",onShowProgress:this._onShowWaiting.bind(this),onRemoveProgress:this._onRemoveWaiting.bind(this)})},_onShowWaiting:function(){this.normalViewDiv.style.opacity="0.01"},_onRemoveWaiting:function(){this.normalViewDiv.style.opacity=""}})});