// 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/_SmartLayoutSupport","dojo/_base/declare dojo/when dojo/dom-class dojo/dom-geometry dojo/dom-style dojo/window dojo/on esri/dijit/geoenrichment/utils/DomUtil ../PlayerResizeModes".split(" "),function(f,g,c,h,k,l,m,e,d){return f(null,{postCreate:function(){this.inherited(arguments);var a=this;this.listenToWindowResize&&this.resizeMode===d.FIT_WINDOW&&this.own(m(window,"resize",function(){setTimeout(function(){a.resize()})}))},_width:0,_height:0,
resize:function(a,b){return this._resize({width:a,height:b})},_resize:function(a){a=a||{};if(this.resizeMode===d.MANUAL)this._width=void 0!==a.width?a.width:this._width,this._height=void 0!==a.height?a.height:this._height;else if(this.resizeMode===d.FIT_WINDOW){e.hide(this.domNode);var b=l.getBox();e.show(this.domNode);this._width=this._maxWidth=b.w;this._height=this._maxHeight=b.h}this._updateResizeModeDomClass();b=this.resizeMode===d.AUTO||this.isSlidesView||0===this._width&&0===this._height;return this._doResize(b?
void 0:this._width,b?void 0:this._height,a.isPaginating)},_updateResizeModeDomClass:function(){c.remove(this.domNode,"esriGEReportPlayerFullScreen");c.remove(this.domNode,"esriGEReportPlayerAutoResize");c.remove(this.domNode,"esriGEReportPlayerManualResize");switch(this.resizeMode){case d.FIT_WINDOW:c.add(this.domNode,"esriGEReportPlayerFullScreen");break;case d.AUTO:c.add(this.domNode,"esriGEReportPlayerAutoResize");break;case d.MANUAL:c.add(this.domNode,"esriGEReportPlayerManualResize")}},_doResize:function(a,
b,d){var c=this;k.set(this.domNode,{width:void 0===a?"auto":a+"px",height:void 0===b?"auto":b+"px"});if(this._currentReportContainer)return this._applyConstraints(),g(this._currentReportContainer.resize(void 0===a?0:a,void 0===b?0:b),function(){c.playerTabs&&c.playerTabs.resize();c._emitResizedEvent(d)})},_maxWidth:0,_maxHeight:0,setMaxWidth:function(a){this._maxWidth=a},setMaxHeight:function(a){this._maxHeight=a},_calcMaxWidth:function(){return this._maxWidth},_calcMaxHeight:function(){var a=h.getMarginBox(this.playerHeader).h||
0;return Math.max(0,this._maxHeight-a)},_applyConstraints:function(){this._currentReportContainer.setMaxWidth&&this._currentReportContainer.setMaxWidth(this._calcMaxWidth());this._currentReportContainer.setMaxHeight&&this._currentReportContainer.setMaxHeight(this._calcMaxHeight())}})});