// 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/core/infographics/simpleInfographic/DataDrillingExportUtil","dojo/_base/lang dojo/Deferred dojo/when dojo/dom-construct esri/dijit/geoenrichment/ReportPlayer/ReportPlayer esri/dijit/geoenrichment/ReportPlayer/PlayerResizeModes esri/dijit/geoenrichment/ReportPlayer/PlayerThemes esri/dijit/geoenrichment/ReportPlayer/dataProviders/DataProviderGE esri/dijit/geoenrichment/ReportPlayer/dataProviders/commands/supportClasses/PlayerCommands ../../reportContainers/containerGridUtils/PageQueryUtil ../../supportClasses/templateJsonUtils/BlankTemplateJsonUtil ../../supportClasses/templateJsonUtils/fieldInfo/FieldInfoBuilder esri/dijit/geoenrichment/utils/WaitingUtil".split(" "),
function(q,y,m,n,r,t,u,v,c,k,w,x,p){var d={reportPlayerClass:r,dataProviderClass:v,initPlayer:function(){var a=n.create("div",{"class":"esriGEAbsoluteStretched esriGEOffscreen"},document.body),b=new d.dataProviderClass;b.registerCommand(c.PRINT);b.registerCommand(c.IMAGE);b=(new d.reportPlayerClass({theme:u.DARK,dataProvider:b,resizeMode:t.FIT_WINDOW})).placeAt(a);b.__playerDiv=a;return b},destroyPlayer:function(a){a.destroy();n.destroy(a.__playerDiv)}},l={setReportPlayerClass:function(a){d.reportPlayerClass=
a},setDataProviderClass:function(a){d.dataProviderClass=a},canPrintDataDrilling:function(a){return k.getParentReportPlayer(a).config.dataDrilling.canPrint},canExportDataDrilling:function(a){a=k.getParentReportPlayer(a);return a.config.dataDrilling.canExport?(a=a.dataProvider.getCommandById(c.IMAGE))&&a.isBrowserSupported():!1},printDataDrilling:function(a){l._createTemporaryPlayerAndExport(a,!0)},exportDataDrilling:function(a){l._createTemporaryPlayerAndExport(a,!1)},_createTemporaryPlayerAndExport:function(a,
b){var e=k.getParentReportPlayer(a),f=e.getReportData(),c=q.mixin({},f.config);delete c.geoenrichmentUrl;var e={isClassic:f.isClassic,reportType:f.reportType,reportTitle:e.getReportTitle(),templateJson:function(){var g=a._getDataDrillingPanelDimensions(),g=w.createBlankTemplate({elementWidth:g.w,elementHeight:g.h,layout:{numRows:1,numColumns:1}});g.theme=a.theme;var b=a._drillingSections[0].toJson(),b=x.createFieldInfoFromSection(b),c=g.sectionsTables[0].data;c.data[0].fieldInfos[c.columns[0].field]=
b;return g}(),reportObject:f.reportObject,fieldData:e._viewModel.dynamicReportInfo.fieldData,analysisAreas:[e.getCurrentAnalysisArea()],infographicOptions:f.infographicOptions,attachmentsStore:f.attachmentsStore,config:c},h=d.initPlayer();h.onCommandSettingsShown=function(b){p.showProgressPromise(a.dataDrillingViewDiv,b)};h.onCommandStart=function(b){p.showProgressPromise(a.dataDrillingViewDiv,b)};m(h.setReportData(e,{waitUntilAllContentIsReady:!0,disableAnimation:!0}),function(){m(h[b?"executePrint":
"executeExport"](),function(){d.destroyPlayer(h)})})}};return l});