// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
require({cache:{"url:widgets/Geoprocessing/resultrenderers/RecordSetRenderer.html":'\x3cdiv\x3e\r\n  \x3cdiv class\x3d"output-label" data-dojo-attach-point\x3d"labelNode"\x3e\r\n    \x3cspan data-dojo-attach-point\x3d"labelContent"\x3e\x3c/span\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"control-section"\x3e\r\n    \x3cdiv class\x3d"clear-node jimu-float-trailing" data-dojo-attach-point\x3d"clearNode" style\x3d"display:none"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"popup-menu-button jimu-float-trailing" data-dojo-attach-point\x3d"exportNode" style\x3d"display:none"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"magnify-node jimu-float-trailing" data-dojo-attach-point\x3d"magnifyNode"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"table-node" data-dojo-attach-point\x3d"tableNode"\x3e\x3c/div\x3e\r\n\x3c/div\x3e'}});
define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/dom-construct dojo/dom-style dojo/dom-attr dojo/on dojo/dom-geometry dijit/_TemplatedMixin dojo/store/Memory dgrid/OnDemandGrid dgrid/extensions/ColumnResizer jimu/dijit/FeatureActionPopupMenu jimu/LayerInfos/LayerInfos jimu/dijit/Popup dojo/text!./RecordSetRenderer.html ../BaseResultRenderer ../utils".split(" "),function(l,e,g,f,c,h,k,p,q,r,t,u,v,w,x,y,z,A){return l([z,q],{baseClass:"jimu-gp-resultrenderer-base jimu-gp-renderer-table",
templateString:y,postCreate:function(){this.inherited(arguments);this.popupMenu=v.getInstance();var a=[];if(this.value.features&&0!==this.value.features.length){c.set(this.magnifyNode,"display","");if(!A.useDynamicSchema(this.param,this.config)&&this.param.defaultValue&&this.param.defaultValue.output&&this.param.defaultValue.output.fields&&0<this.param.defaultValue.output.fields.length)a=g.filter(this.param.defaultValue.output.fields,e.hitch(this,function(b){return!1!==b.visible}));else if(this.value.fields)a=
this.value.fields;else if(this.value.features&&0<this.value.features.length)for(var d in this.value.features[0].attributes)a.push({name:d});if(this.config.shareResults){var m=w.getInstanceSync();var B=m.addTable({featureCollectionData:{layerDefinition:{fields:a},featureSet:this.value},title:this.param.label||this.param.name});c.set(this.clearNode,"display","");h.set(this.clearNode,"title",this.nls.clear);this.own(k(this.clearNode,"click",e.hitch(this,function(){m.removeTable(B);c.set(this.exportNode,
"display","none");c.set(this.clearNode,"display","none");c.set(this.magnifyNode,"display","none");this.labelContent.innerHTML=this.nls.cleared;f.empty(this.tableNode);this.table&&this.table.destroy()})))}d=g.map(this.value.features,function(b){return b.attributes});h.set(this.magnifyNode,"title",this.nls.enlargeView);this.own(k(this.magnifyNode,"click",e.hitch(this,this.magnifyTable)));this.config.showExportButton&&(h.set(this.exportNode,"title",this.nls.exportOutput),c.set(this.exportNode,"display",
""),this.own(k(this.exportNode,"click",e.hitch(this,this._showActions))));a=g.map(a,function(b){return{label:b.alias||b.name,field:b.name}});var n;g.some(this.value.fields,function(b){if("esriFieldTypeOID"===b.type)return n=b.name,!0});d=new r({data:d,idProperty:n});this.table=new (l([t,u]))({columns:a,store:d});f.place(this.table.domNode,this.tableNode)}else c.set(this.clearNode,"display","none"),c.set(this.exportNode,"display","none"),c.set(this.magnifyNode,"display","none"),this.tableNode.innerHTML=
this.nls.emptyResult},startup:function(){this.inherited(arguments);this.table.startup()},_showActions:function(a){this.popupMenu.prepareActions(this.value,this.config.showExportButton).then(e.hitch(this,function(){var d=p.position(a.target);this.popupMenu.show(d)}))},magnifyTable:function(){var a=f.create("div",{"class":"gp-table-magnified"});f.place(this.table.domNode,a);(new x({content:a,titleLabel:this.param.tooltip||this.param.label||"",container:"main-page",customPosition:{top:"5%",left:"5%",
width:"90%",height:"90%"},onClose:e.hitch(this,function(){f.place(this.table.domNode,this.tableNode);this.table.resize()})})).startup();this.table.resize()}})});