// 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/dataProviders/supportClasses/tasks/parsers/DataXMLParser",["esri/dijit/geoenrichment/utils/JsonXmlConverter","../../AreaDataUtil","./AttrUtil"],function(b,l,m){var p={parseSchema:function(a){var e={};a.tags.forEach(function(a){"xs:element"===a.name&&a.attributes&&"ReportData"===a.attributes.name&&b.queryJson(a,"xs:element").filter(function(a){return!!a.tags}).forEach(function(a){var f=e[a.attributes.name]={};b.queryJson(a,"xs:element").forEach(function(a){f[a.attributes.name]=
"xs:string"===a.attributes.type?"string":"number"})})});return e}};return{parse:function(a,e){return this._parseDataXmlJson(b.parseXml(a),e)},_parseDataXmlJson:function(a,e){function b(a){function b(a){if(a=function(a){var b={},g;a.tags.forEach(function(d){var c;c=d.innerHTML?d.innerHTML:d.tags&&d.tags.length&&d.tags[0].text||"";var f=c;"string"===k[a.name][d.name]?c=String(c):(c=Number(c),isNaN(c)&&(c=f));e&&(c=e(d.name,c));b[d.name]||(b[d.name]=c);"AREA_ID"===d.name&&(g=c)});if(!g)return null;void 0===
f[g]&&(f[g]=n++);m.cleanUpAttrs(b);return{name:a.name,attrs:b,areaIndex:f[g]}}(a)){var b=h[a.areaIndex]=h[a.areaIndex]||{};b[a.name]?b[a.name].comparisonLevels.push(a.attrs):b[a.name]=l.createCalculator(a.attrs)}}var k;a.tags[0].tags.forEach(function(a){"xs:schema"===a.name?k=p.parseSchema(a):b(a)})}if(!a||!a.tags||2>a.tags.length)return[];var h=[],f={},n=0;a.tags.forEach(function(a){"ReportData"===a.name&&b(a)});console.log("DataXMLPareser.js \x3d\x3e areaData:");console.log(h);return h}}});