// 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
define("dojo/_base/declare dojo/Evented dojo/on dojo/_base/lang dojo/_base/html jimu/dijit/Popup jimu/dijit/FeaturelayerSource jimu/dijit/LoadingIndicator esri/request".split(" "),function(f,g,e,c,h,k,l,m,n){return f([k,g],{width:830,height:560,titleLabel:"",dijitArgs:null,postCreate:function(){this.inherited(arguments);h.addClass(this.domNode,"jimu-featurelayer-source-popup");this._initFls();this._initLoading()},getSelectedRadioType:function(){return this.fls.getSelectedRadioType()},_initFls:function(){this.fls=
new l(this.dijitArgs);this.fls.placeAt(this.contentContainerNode);this.fls.startup();this.own(e(this.fls,"ok",c.hitch(this,function(d){if(0!==d.length){var a=d[0];if(a.definition)try{a.definition.name=a.name,a.definition.url=a.url,this.emit("ok",a)}catch(b){console.error(b)}else this.loading.show(),n({url:a.url,content:{f:"json"},handleAs:"json",callbackParamName:"callback"}).then(c.hitch(this,function(b){if(this.domNode){this.loading.hide();a.definition=b;try{a.definition.name=a.name,a.definition.url=
a.url,this.emit("ok",a)}catch(p){console.error(p)}}}),c.hitch(this,function(b){console.error(b);this.domNode&&this.loading.hide()}))}})));this.own(e(this.fls,"cancel",c.hitch(this,function(){try{this.emit("cancel")}catch(d){console.error(d)}})))},_initLoading:function(){this.loading=new m({hidden:!0});this.loading.placeAt(this.domNode);this.loading.startup()}})});