// 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/DataAggregation/js/UI/templates/FeatureList.html":'\x3cdiv class\x3d"pad-left-5 no-select"\x3e\r\n  \x3ctable class\x3d"page-table" cellpading\x3d"0"\x3e\r\n    \x3ctbody\x3e\r\n      \x3ctr\x3e\r\n        \x3ctd colspan\x3d"2" class\x3d"panel-title-td"\x3e\r\n          \x3cdiv class\x3d"panel-title-text" data-dojo-attach-point\x3d"pageTitle" tabindex\x3d"0" role\x3d"region" \r\n          aria-label\x3d"${nls.review.reviewMatched} ${nls.review.reviewMatchedHint}"\x3e\x3c/div\x3e\r\n        \x3c/td\x3e\r\n      \x3c/tr\x3e\r\n      \x3ctr class\x3d"bottom-border-bold task-instruction-row"\x3e\r\n        \x3ctd colspan\x3d"2" class\x3d"panel-title-hint-td"\x3e\r\n          \x3cdiv class\x3d"instruction" data-dojo-attach-point\x3d"pageHint"\x3e\x3c/div\x3e\r\n        \x3c/td\x3e\r\n      \x3c/tr\x3e\r\n      \x3ctr\x3e\r\n        \x3ctd\x3e\r\n          \x3ctable class\x3d"page-table" cellpading\x3d"0"\x3e\r\n            \x3ctbody data-dojo-attach-point\x3d"featureListTable"\x3e\r\n            \x3c/tbody\x3e\r\n          \x3c/table\x3e\r\n        \x3c/td\x3e\r\n      \x3c/tr\x3e\r\n    \x3c/tbody\x3e\r\n  \x3c/table\x3e\r\n\x3c/div\x3e'}});
define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/dom-construct dojo/dom-class dojo/dom-attr dojo/keys dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/Evented dojo/text!./templates/FeatureList.html dojo/query dojo/Deferred dojo/on ./Feature".split(" "),function(q,f,k,g,l,r,m,t,u,v,w,x,y,h,n,z){return q([t,u,v,w],{baseClass:"cf-feature-list",declaredClass:"CriticalFacilities.FeatureList",templateString:x,label:"FeatureList",parent:null,nls:null,map:null,appConfig:null,
config:null,features:[],updateFeatures:[],hint:"",theme:"",styleColor:"",type:"",isDuplicate:!1,layer:null,_editToolbar:null,_syncFields:{},_started:!1,constructor:function(a){f.mixin(this,a)},postCreate:function(){this.inherited(arguments);this.pageHint.innerHTML=this.hint;this.pageTitle.innerHTML=this._title;r.set(this.pageTitle,"aria-label",this._title+" "+this.hint)},onShown:function(){this.pageContainer.nextDisabled=!1;this.pageContainer.backDisabled=!1},startup:function(){this._started=!0;this._initFeatureList(this.features);
this._updateAltIndexes();this.updateImageNodes();this.own(n(this,"feature-list-updated",f.hitch(this,this._updateAltIndexes)));this.own(n(this.pageContainer,"view-index-change",f.hitch(this,this._indexChanged)))},validate:function(a,b){var c=new h;"next-view"===a?c.resolve(this._nextView()):"back-view"===a?c.resolve(this._backView()):this._homeView(b).then(function(e){c.resolve(e)});return c},_nextView:function(){return!0},_backView:function(){return!0},_homeView:function(a){var b=new h;this.pageContainer.getViewByTitle("Home").verifyClearSettings(a).then(function(c){b.resolve(c)});
return b},_indexChanged:function(a){this._updateAltIndexes();a.oldIndex===this.altNextIndex&&(this.altNextIndex=a.newIndex)},_updateAltIndexes:function(){this.pageContainer&&!this._reviewView&&(this._reviewView=this.pageContainer.getViewByTitle("Review"))&&(this.altHomeIndex=this.altBackIndex=this._reviewView.index);if(this.featureListTable&&this.featureListTable.rows){var a=this.featureListTable.rows;if(a.length&&0<a.length){var b=a[0].featureView;a=a[a.length-1].featureView;this.altNextIndex=b.index;
this.finalFeatureIndex=a.index;a.altNextIndex=this._reviewView.index;b.altBackIndex=this.index}}},_initFeatureList:function(a){var b=0;this.featureListTable.rows.length!==this.features.length&&k.forEach(a,f.hitch(this,function(c){this._initRow(c,b);b+=1}))},updateImageNodes:function(){var a=this.pageContainer.isDarkTheme,b=a?"next-arrow-img":"next-arrow-img-white",c=a?"next-arrow-img-white":"next-arrow-img";a=y("."+b,this.domNode);k.forEach(a,function(e){l.remove(e,b);l.add(e,c)})},setStyleColor:function(a){this.styleColor=
a},_initFeatureView:function(a,b){a=new z({nls:this.nls,map:this.map,parent:this.parent,config:this.config,appConfig:this.appConfig,label:b,altBackIndex:this.index,isDuplicate:this.isDuplicate,feature:a,theme:this.theme,layer:this.layer,_editToolbar:this._editToolbar,csvStore:this.csvStore,_parentFeatureList:this,pageContainer:this.pageContainer,pageHint:this.nls.review.reviewFeatureHint,pageTitle:a.label});this.pageContainer.addView(a);return this.pageContainer.getViewByTitle(b)},_initRow:function(a,
b){var c=g.create("tr",{className:"bottom-border feature-list-row",tabindex:0,role:"button","aria-label":a.label,onclick:f.hitch(this,function(d){this.pageContainer.selectView(d.currentTarget.featureView.index)}),onkeydown:f.hitch(this,function(d){d.keyCode!==m.ENTER&&d.keyCode!==m.SPACE||this.pageContainer.selectView(d.currentTarget.featureView.index)})},this.featureListTable);c.featureView=this._initFeatureView(a,this.label+"_"+b);c.fieldInfo=a.fieldInfo;for(b=0;b<a.fieldInfo.length;b++){var e=
a.fieldInfo[b];if(e.name===this.layer.objectIdField){c._featureOID=e.value;break}}b=g.create("td",{className:"pad-10"},c);c.featureView.featureListLabel=g.create("div",{className:"main-text float-left text-left",innerHTML:a.label},b);a=g.create("td",{className:"width-15"},c);g.create("div",{className:"next-arrow float-right next-arrow-img"},a);this.lastFocusNode=c},removeFeature:function(a,b){for(var c=new h,e=this.featureListTable.rows,d=0;d<e.length;d++){var p=e[d];if(p._featureOID===b){this.pageContainer._backLabelClone=
f.clone(this.pageContainer._backLabels);this.pageContainer.removeView(p.featureView);this.featureListTable.deleteRow(d);a=this.features.indexOf(a);-1<a&&this.features.splice(a,1);this.emit("feature-list-updated",this.features.length);d===this.features.length&&this.pageContainer.selectView(this.altBackIndex);break}}c.resolve("feature-removed");return c},resetFeatureList:function(){if(0<this.featureListTable.rows.length){for(var a=this.featureListTable.rows.length;0<a;a--)this.pageContainer.removeView(this.featureListTable.rows[a-
1].featureView),this.featureListTable.deleteRow(a-1);this.altNextIndex=void 0;this._initFeatureList(this.features);this._updateAltIndexes();this.pageContainer._backLabels=this.pageContainer._backLabelClone;this.updateImageNodes()}},addFeature:function(a){this.features.push(a);this.emit("feature-list-updated",this.features.length)}})});