// 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
/*
 jQuery Knob*/
require({cache:{"widgets/Visibility/js/VisibilityControl":function(){define("dojo/_base/declare dojo/_base/kernel dojo/_base/event dojo/Deferred dojo/_base/lang dojo/_base/array dojo/on dojo/number dojo/string dojo/dom-style dojo/mouse dojo/promise/all dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!../templates/VisibilityControl.html jimu/dijit/Message esri/dijit/util/busyIndicator esri/graphic esri/layers/GraphicsLayer esri/tasks/FeatureSet esri/graphicsUtils esri/symbols/SimpleMarkerSymbol esri/renderers/SimpleRenderer esri/Color esri/dijit/analysis/CreateViewshed esri/layers/FeatureLayer esri/geometry/Polygon esri/geometry/geometryEngine ./geometryUtils jimu/dijit/CoordinateControl ./util jimu/utils dojo/keys dijit/focus ./portal-publish dojo/dom-class dojo/dom-construct esri/renderers/UniqueValueRenderer jimu/LayerStructure ../js/symbologySettings dijit/form/NumberTextBox jimu/dijit/CheckBox ./jquery.knob.min".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G,x,v,z,A,F,J,L,P,Q,Z,ca,da,ea,fa,K,V,aa,Y){return H([d,h,p],{templateString:t,baseClass:"jimu-widget-visibility-control",FOV:180,LA:180,map:null,_currentOpenPanel:"mainPage",portalPublishObj:null,_renderer:null,Azimuth1:null,Azimuth2:null,graphics:null,_layerList:null,fillStyles:null,lineStyles:null,constructor:function(I){H.safeMixin(this,I);this.nls=I.nls},postCreate:function(){this.openAtStartAysn=!0;this.fillStyles={esriSFSBackwardDiagonal:"backwarddiagonal",
esriSFSCross:"cross",esriSFSDiagonalCross:"diagonalcross",esriSFSForwardDiagonal:"forwarddiagonal",esriSFSHorizontal:"horizontal",esriSFSNull:"none",esriSFSSolid:"solid",esriSFSVertical:"vertical"};this.lineStyles={esriSLSDash:"dash",esriSLSDashDot:"dashdot",esriSLSDashDotDot:"longdashdotdot",esriSLSDot:"dot",esriSLSLongDash:"longdash",esriSLSLongDashDot:"longdashdot",esriSLSNull:"none",esriSLSShortDash:"shortdash",esriSLSShortDashDot:"shortdashdot",esriSLSShortDashDotDot:"shortdashdotdot",esriSLSShortDot:"shortdot",
esriSLSSolid:"solid"};var I=[],O;l.forEach("meters kilometers miles feet yards nauticalMiles".split(" "),m.hitch(this,function(N){O={value:N,label:window.jimuNls.units[N]};I.push(O)}));this.observerHeightDD.addOption(I);this.utils=new Q({appConfig:this.appConfig,nls:this.nls});this.distanceUnitDD.addOption(m.clone(I));this.observerHeightDD.set("value",this.config.defaultObserverHeightUnit);this.distanceUnitDD.set("value",this.config.defaultObservableDistanceUnit);this.angleUnits.setValue(this.config.defaultAngleUnits);
if(this.portalUrl){this._initGL();this._createSettings();this._layerList=this._getAllMapLayers();this._ptSym=new G(this.pointSymbol);var E=new x(this._ptSym);this._observerLocation=new y({id:"observerLocation"});this._observerLocation.spatialReference=this.map.spatialReference;this._observerLocation.setRenderer(E);this.map.addLayer(this._observerLocation);this.distanceUnit=this.distanceUnitDD.get("value");this.observerHeightUnit=this.observerHeightDD.get("value");this.inputControl=new P({parentWidget:this.parentWidget,
label:this.nls.observerLocation,input:!0,showCopyButton:!1,showFormatButton:!0,showDrawPoint:!0,drawButtonLabel:this.nls.addPointToolTip,graphicsLayer:this._observerLocation});this.inputControl.placeAt(this.observerCoordsContainer);this.inputControl.startup();this._syncEvents();this.minObsRange.invalidMessage=this.nls.invalidMessage;this.minObsRange.rangeMessage=this.nls.minimumRangeMessage;this.maxObsRange.invalidMessage=this.nls.invalidMessage;this.maxObsRange.rangeMessage=this.nls.maximumRangeMessage}else this._showPortalURLError(this.nls.portalURLError);
this.resetInputColor();this._suppoprtAccessibility()},startup:function(){this.busyIndicator=u.create({target:this.domNode.parentNode.parentNode.parentNode,backgroundOpacity:0});this.FOVInput.id="fovinput"+this.parentWidget.id;var I=m.hitch(this,function(O,E,N){this.LA=this.angleUnits.checked?O/17.777777777778:O;this.FOV=Math.round(E);this.tooltip.innerHTML=360===N&&this.angleUnits.checked?$("#"+this.FOVInput.id).val()+" "+this.nls.milsLabel:this.angleUnits.checked?N+" "+this.nls.milsLabel:N+" "+this.nls.degreesLabel});
$("#"+this.FOVInput.id).knob({min:0,max:360,cursor:360,width:160,height:160,draw:function(){I(this.v,this.o.cursor,this.cv);window.isRTL&&this.i.css({"margin-right":"-"+(3*this.w/4+2>>0)+"px","margin-left":"auto"})}})},destroy:function(){this.map.removeLayer(this._observerLocation);this.map.removeLayer(this.graphicsLayer)},_showPortalURLError:function(I){f.set(this.controls,"display","none");f.set(this.buttonContainer,"display","none");this.errorText.innerHTML=I;f.set(this.errorText,"display","")},
_initGL:function(){this.graphicsLayer=new y;this.graphicsLayer.name="Viewshed Layer";this.map.addLayer(this.graphicsLayer)},_syncEvents:function(){this.own(b(this.btnCreate,"click",m.hitch(this,this.createButtonWasClicked)),b(this.btnCreate,"keydown",m.hitch(this,function(I){I.keyCode!==ca.ENTER&&I.keyCode!==ca.SPACE||this.createButtonWasClicked()})),b(this.btnClear,"click",m.hitch(this,function(){fa.add(this.saveToLayerIcon,"esriCTHidden");this.onClearBtnClicked();this._suppoprtAccessibility()})),
b(this.btnClear,"keydown",m.hitch(this,function(I){if(I.keyCode===ca.ENTER||I.keyCode===ca.SPACE)fa.add(this.saveToLayerIcon,"esriCTHidden"),this.onClearBtnClicked(),this._suppoprtAccessibility()})),b(this.minObsRange,"keyup",m.hitch(this,this.minObsRangeKeyWasPressed)),b(this.FOVInput,"mousemove",m.hitch(this,this.mouseMoveOverFOVInput)),b(this.FOVInput,e.leave,m.hitch(this,this.mouseMoveOutFOVInput)),b(this.FOVGroup,e.leave,m.hitch(this,function(){this.tooltip.hidden=!0})),b(this.FOVGroup,e.enter,
m.hitch(this,this.mouseMoveOverFOVGroup)),b(this.FOVInput,e.enter,m.hitch(this,function(){this.tooltip.hidden=!0})),b(this.FOVInput,"keypress",m.hitch(this,function(I){isNaN(I.key)&&13!==I.charCode&&n.stop(I)})),this.angleUnits.on("change",m.hitch(this,this.angleUnitsDidChange)),this.observerHeightDD.on("change",m.hitch(this,this.distanceUnitDDDidChange)),this.distanceUnitDD.on("change",m.hitch(this,this.distanceUnitDDDidChange)),b(this.inputControl.dt,"DrawComplete",m.hitch(this,function(){this.feedbackDidComplete();
da.focus(this.inputControl.coordtext)})),b(this.inputControl,"get-coordinate-complete",m.hitch(this,this.feedbackDidComplete)),b(this.saveToLayerIcon,"click",m.hitch(this,function(){fa.contains(this.saveToLayerIcon,"esriCTHidden")||this._showPanel("publishPage")})),b(this.saveToLayerIcon,"keydown",m.hitch(this,function(I){if(I.keyCode===ca.ENTER||I.keyCode===ca.SPACE)fa.contains(this.saveToLayerIcon,"esriCTHidden")||this._showPanel("publishPage")})),b(this.settingsIcon,"click",m.hitch(this,function(){fa.contains(this.settingsIcon,
"esriCTHidden")||this._showPanel("settingsPage")})),b(this.settingsIcon,"keydown",m.hitch(this,function(I){if(I.keyCode===ca.ENTER||I.keyCode===ca.SPACE)fa.contains(this.settingsIcon,"esriCTHidden")||this._showPanel("settingsPage")})),b(this.settingsPanelBackButton,"click",m.hitch(this,function(){fa.contains(this.settingsPanelBackButton,"esriCTHidden")||(this._SettingsInstance.onSettingsChanged(),this._showPanel("mainPage"))})),b(this.settingsPanelBackButton,"keydown",m.hitch(this,function(I){I.keyCode!==
ca.ENTER&&I.keyCode!==ca.SPACE||fa.contains(this.settingsPanelBackButton,"esriCTHidden")||(this._SettingsInstance.onSettingsChanged(),this._showPanel("mainPage"))})))},minObsRangeKeyWasPressed:function(){this.minObsRange.isValid()&&(this.maxObsRange.constraints.min=Number(this.minObsRange.displayedValue)+.001,this.maxObsRange.set("value",Number(this.minObsRange.displayedValue)+1))},mouseMoveOverFOVGroup:function(){!1===this.FOVInput.disabled&&(this.mouseMoveOverFOVInput(),this.tooltip.hidden=!1)},
mouseMoveOverFOVInput:function(){var I=this.tooltip;!1===this.FOVInput.disabled&&$(document).ready(function(){$(document).mousemove(function(O){f.set(I,{left:O.pageX+10+"px",top:O.pageY+10+"px"})})})},mouseMoveOutFOVInput:function(){this.tooltip.hidden=!1;this.FOVInput.blur()},angleUnitsDidChange:function(){this.angleUnits.checked?($("#"+this.FOVInput.id).trigger("configure",{max:6400,units:"mils",milsValue:6400}),$("#"+this.FOVInput.id).val(6400).trigger("change")):($("#"+this.FOVInput.id).trigger("configure",
{max:360,units:"degrees",milsValue:6400}),$("#"+this.FOVInput.id).val(360).trigger("change"));this.resetInputColor()},distanceUnitDDDidChange:function(){var I="",O={};this.distanceUnit=this.distanceUnitDD.get("value");this.observerHeightUnit=this.observerHeightDD.get("value");if(this.distanceUnit){switch(this.distanceUnit){case "miles":O.max=31;break;case "nauticalMiles":O.max=26.9383;break;case "kilometers":O.max=50;break;case "yards":O.max=54680;break;case "feet":O.max=164041;break;case "meters":O.max=
5E4}I=c.substitute(this.nls.maximumRangeMessage,{units:window.jimuNls.units[this.distanceUnit],limit:a.format(O.max,{places:2,locale:k.locale})});O.min=Number(this.minObsRange.displayedValue)+.001;this.maxObsRange.set("constraints",O);this.maxObsRange.set("rangeMessage",I)}},feedbackDidComplete:function(){this.inputControl.deactivateDrawTool();this.map.enableMapNavigation();this.enableFOVDial()},enableFOVDial:function(){this.FOVInput.disabled&&(this.FOVInput.disabled=!1,$("#"+this.FOVInput.id).trigger("configure",
{fgColor:"#00ff66",bgColor:"#f37371",inputColor:"#ccc"}));this.resetInputColor()},_createWedgesUsingBuffers:function(I,O,E,N){O=C.getGeometries(O);N=J.geodesicBuffer(O,[N],"meters",!0);0<E?(E=J.geodesicBuffer(O,[E],"meters",!0),N=J.difference(N[0],E[0])):N=N[0];I.resolve([N,N])},_createWedgesUsingAngles:function(I,O,E,N,R,W){O=O.geometry;var ha=[];var oa=[];this.Azimuth1=E>N?E-360:E;W=L.getPointsForArc(E,N,O,W);oa.push([O.x,O.y]);l.forEach(W,function(T){oa.push([T.x,T.y])});oa.push([O.x,O.y]);if(0<
R){var ma=L.getDestinationPoint(O,E,R);E=L.getPointsForArc(E,N,O,R);ha.push([ma.x,ma.y]);l.forEach(W,function(T){ha.push([T.x,T.y])});E.reverse();l.forEach(E,function(T){ha.push([T.x,T.y])});ha.push([ma.x,ma.y])}else ha=oa;E=new F(ha);E.setSpatialReference(O.spatialReference);N=new F(oa);N.setSpatialReference(O.spatialReference);I.resolve([E,N])},_createWedges:function(I,O,E){var N=new q;this.Azimuth1=parseInt(this.LA-this.FOV/2,10);0>this.Azimuth1&&(this.Azimuth1+=360);this.Azimuth2=parseInt(this.LA+
this.FOV/2,10);360<this.Azimuth2&&(this.Azimuth2-=360);360===this.FOV?(this.Azimuth1=0,this.Azimuth2=360,this._createWedgesUsingBuffers(N,I,O,E)):this._createWedgesUsingAngles(N,I[0],this.Azimuth1,this.Azimuth2,O,E);return N.promise},_getFeatureCollectionLayer:function(I){l.forEach(I,m.hitch(this,function(O,E){O.attributes={};O.attributes.ObjectID=E}));return new A({featureSet:{features:I,geometryType:"esriGeometryPoint"},layerDefinition:{name:"InputLayer",geometryType:"esriGeometryPoint",objectIdField:"ObjectID",
fields:[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"}]}})},_initAnalysisProcess:function(I){this._createWedges(I.InputObserver.features,I.MinimumRadius,I.MaximumRadius).then(m.hitch(this,function(O){var E=[];if(O&&2===O.length){var N=this.appConfig.geometryService;var R=L.getProjectedGeometry(O[0],this.map.spatialReference,N).then(m.hitch(this,function(W){this._wedgeGeometry=W}));E.push(R);O=L.getProjectedGeometry(O[1],this.map.spatialReference,N).then(m.hitch(this,function(W){this._fullWedgeGeometry=
W}));E.push(O);g(E).then(m.hitch(this,function(){this._createViewShed(I)}))}}))},_createViewShed:function(I){I={portalUrl:this.portalUrl,inputLayer:this._getFeatureCollectionLayer(I.InputObserver.features),maxDistanceUnits:"Meters",maximumDistance:I.MaximumRadius,observerHeightUnits:"Meters",observerHeight:I.ObserverHeight,showSelectAnalysisLayer:!1,targetHeightUnits:"Meters",map:this.map,showChooseExtent:!1,returnFeatureCollection:!0};I=new z(I);I.startup();I.on("job-result",m.hitch(this,this._onViewShedCreated));
I.on("job-status",m.hitch(this,function(O){"esriJobFailed"===O.jobStatus&&this._showJobError(O)}));I.on("job-fail",m.hitch(this,this._showJobError));I._form.validate()?(this.busyIndicator.show(),I._handleSaveBtnClick()):new w({message:this.nls.validationError})},_showJobError:function(I){new w({message:I.message});this.busyIndicator.hide()},_onViewShedCreated:function(I){var O=[];l.forEach(I.value.featureSet.features,m.hitch(this,function(E){E=new F(E.geometry);E.setSpatialReference(this.map.spatialReference);
(E=J.difference(this._wedgeGeometry,E))&&(E=J.difference(this._wedgeGeometry,E));E=new r(E);E.setAttributes({type:1});O.push(E)}));this._showGraphicsOnMap(O)},_drawWedge:function(I,O){for(var E=new q,N=0,R=I.length;N<R;N++){var W=I[N];W&&W.geometry&&(O?W.setAttributes({type:2}):W.setAttributes({type:3}),this.graphicsLayer.add(W))}E.resolve("success");return E.promise},_drawViewshed:function(I){var O=new q;this.graphics=[];var E=new r(this._wedgeGeometry);E.setAttributes({type:0,regionType:"nonVisible"});
for(var N=0,R=I.length;N<R;N++){var W=I[N];if(W&&W.geometry){var ha=W.geometry;W.setAttributes({type:1,regionType:"visible"});var oa=W;this.graphicsLayer.add(W)}}ha&&(this.graphics.push(oa),I=J.difference(this._wedgeGeometry,ha),E=new r(I),E.setAttributes({type:0,regionType:"nonVisible"}));this.graphics.push(E);this.graphicsLayer.add(E);O.resolve("success");return O.promise},_showGraphicsOnMap:function(I){this._drawWedge([new r(this._fullWedgeGeometry)],!0);this._drawWedge([new r(this._wedgeGeometry)],
!1);this._drawViewshed(I).then(m.hitch(this,function(){this.map.setExtent(C.graphicsExtent(this.graphicsLayer.graphics),!0);fa.remove(this.saveToLayerIcon,"esriCTHidden");this.busyIndicator.hide();this._createPortalPublishUI();this._suppoprtAccessibility()}))},createButtonWasClicked:function(){if(this.minObsRange.isValid()&&this.maxObsRange.isValid()&&this.observerHeight.isValid()&&0!==parseInt(this.FOVInput.value,10)){var I=new r(this.inputControl.getMapCoordinateDD()),O=new B;O.features=[I];I={InputObserver:O,
MinimumRadius:this.utils.convertToMeters(this.minObsRange.value,this.distanceUnit),MaximumRadius:this.utils.convertToMeters(this.maxObsRange.value,this.distanceUnit),ObserverHeight:this.utils.convertToMeters(this.observerHeight.value,this.observerHeightUnit)};this._initAnalysisProcess(I)}else new w({message:this.nls.validationError})},onClearBtnClicked:function(){this.angleUnits&&(this.angleUnits.setValue(this.config.defaultAngleUnits),this.observerHeightDD.set("value",this.config.defaultObserverHeightUnit),
this.distanceUnitDD.set("value",this.config.defaultObservableDistanceUnit),this.graphicsLayer.clear(),this.inputControl.clear(),this.FOVInput.disabled=!0,this.angleUnitsDidChange(),$("#"+this.FOVInput.id).trigger("configure",{fgColor:"#ccc",bgColor:"#ccc",inputColor:"#ccc"}),this.tooltip.hidden=!0,this.resetInputColor())},resetInputColor:function(){setTimeout(m.hitch(this,function(){f.set(this.FOVInput,"color","gray")}),100)},_suppoprtAccessibility:function(){"mainPage"===this._currentOpenPanel&&
(Z.initFirstFocusNode(this.parentWidget.domNode,this.settingsIcon),Z.isAutoFocusFirstNodeWidget(this)&&da.focus(this.settingsIcon),Z.initLastFocusNode(this.parentWidget.domNode,this.btnClear));"publishPage"===this._currentOpenPanel&&this.portalPublishObj._setFirstLastFocusNodes();"settingsPage"===this._currentOpenPanel&&(Z.initFirstFocusNode(this.parentWidget.domNode,this.settingsPanelBackButton),this._SettingsInstance._setLastFocusNode())},_createPortalPublishUI:function(){this.portalPublishObj=
new ea({config:this.config,appConfig:this.appConfig,graphicsLayer:this.graphicsLayer,graphics:this.graphics,_renderer:this._renderer,map:this.map,nls:this.nls,parentNode:this.parentWidget.domNode,observerHeight:this.observerHeight.value,minObsRange:this.minObsRange.value,maxObsRange:this.maxObsRange.value,distanceUnitDD:this.distanceUnitDD.getOptions(this.distanceUnitDD.value).label,observerHeightDD:this.observerHeightDD.getOptions(this.observerHeightDD.value).label,angleUnits:this.nls.degreesLabel,
centerPoint:this.inputControl.coordtext.value,fovStartAngle:this.Azimuth1,fovEndAngle:this.Azimuth2,_layerList:this._layerList});K.empty(this.portalPublishContainer);this.portalPublishObj.placeAt(this.portalPublishContainer);this.portalPublishObj.startup();this.own(b(this.portalPublishObj,"displayMainPageOnBack",m.hitch(this,function(){this._showPanel("mainPage")})));this._showPanel("publishPage")},_showPanel:function(I){if(this._currentOpenPanel){var O=this._getNodeByName(this._currentOpenPanel);
fa.add(O,"esriCTHidden")}O=this._getNodeByName(I);fa.remove(O,"esriCTHidden");this._lastOpenPanel=this._currentOpenPanel;this._currentOpenPanel=I;this._suppoprtAccessibility()},_getNodeByName:function(I){switch(I){case "mainPage":var O=this.visibiltyWidget;break;case "publishPage":O=this.portalPublishContainer;break;case "settingsPage":O=this.settingsContainer}return O},_createRendererForPublishLayer:function(I){var O=new v(I.visibleSectionFillColor.color),E=255*(1-I.visibleSectionFillColor.transparency),
N=new v(I.visibleSectionOutlineColor.color),R=255*(1-I.visibleSectionOutlineColor.transparency),W=new v(I.nonVisibleSectionFillColor.color),ha=255*(1-I.nonVisibleSectionFillColor.transparency),oa=new v(I.nonVisibleSectionOutlineColor.color);this._renderer=new V({type:"uniqueValue",field1:"RegionType",uniqueValueInfos:[{value:1,symbol:{color:[O.r,O.g,O.b,E],outline:{color:[N.r,N.g,N.b,R],width:.75,type:"esriSLS",style:I.visibleSectionOutlineColor.type},type:"esriSFS",style:I.visibleSectionFillColor.type}},
{value:0,symbol:{color:[W.r,W.g,W.b,ha],outline:{color:[oa.r,oa.g,oa.b,255*(1-I.nonVisibleSectionOutlineColor.transparency)],width:1,type:"esriSLS",style:I.nonVisibleSectionOutlineColor.type},type:"esriSFS",style:I.nonVisibleSectionFillColor.type}}]});this._renderer.removeValue("others")},_createRendererForGraphicsLayer:function(I){var O=new v(I.visibleSectionFillColor.color),E=255*(1-I.visibleSectionFillColor.transparency),N=new v(I.visibleSectionOutlineColor.color),R=255*(1-I.visibleSectionOutlineColor.transparency),
W=new v(I.nonVisibleSectionFillColor.color),ha=255*(1-I.nonVisibleSectionFillColor.transparency),oa=new v(I.nonVisibleSectionOutlineColor.color);I=new V({type:"uniqueValue",field1:"type",uniqueValueInfos:[{value:1,symbol:{color:[O.r,O.g,O.b,E],outline:{color:[N.r,N.g,N.b,R],width:.75,type:"esriSLS",style:I.visibleSectionOutlineColor.type},type:"esriSFS",style:I.visibleSectionFillColor.type}},{value:0,symbol:{color:[W.r,W.g,W.b,ha],outline:{color:[oa.r,oa.g,oa.b,255*(1-I.nonVisibleSectionOutlineColor.transparency)],
width:1,type:"esriSLS",style:I.nonVisibleSectionOutlineColor.type},type:"esriSFS",style:I.nonVisibleSectionFillColor.type}},{value:2,symbol:{color:[0,0,0,0],outline:{color:[0,0,0,1],width:1,type:"esriSLS",style:"esriSLSDash"},type:"esriSFS",style:"esriSFSSolid"}},{value:3,symbol:{color:[0,0,0,0],outline:{color:[255,0,0,1],width:1,type:"esriSLS",style:"esriSLSSolid"},type:"esriSFS",style:"esriSFSSolid"}}]});I.removeValue("others");this.graphicsLayer.setRenderer(I);this.graphicsLayer.refresh()},_getAllMapLayers:function(){var I=
[];aa.getInstance().traversal(function(O){"undefined"!==typeof O._layerInfo.layerObject.type&&-1===O._layerInfo.layerObject.type.indexOf("tile")&&"esriGeometryPolygon"===O._layerInfo.layerObject.geometryType&&I.push(O._layerInfo.layerObject)});return I},_createSettings:function(){this._SettingsInstance=new Y({nls:this.nls,config:this.config,appConfig:this.appConfig,refDomNode:this.parentWidget.domNode},K.create("div",{},this.symbologySettingsNode));this.own(this._SettingsInstance.on("settingsChanged",
m.hitch(this,function(I){this._createRendererForPublishLayer(I);this._createRendererForGraphicsLayer(I)})));this._SettingsInstance.startup()}})})},"esri/dijit/util/busyIndicator":function(){define("dijit/registry dojo/_base/lang dojo/_base/window dojo/dom dojo/dom-construct dojox/widget/Standby require".split(" "),function(H,k,n,q,m,l,b){var a={_defaultStandbyParams:{image:b.toUrl("../images/loading-throb.gif"),color:"#fff",opacity:.75,duration:200},create:function(c){if(c=this._normalizeParams(c))return c=
new l(a._toStandbyParams(c)),m.place(c.domNode,n.doc.body),a._createHandle(c)},_normalizeParams:function(c){if(c){if(c.target)return c;if("string"===typeof c){var f=H.byId(c);c=f?f.domNode:q.byId(c)}else c=c.domNode?c.domNode:q.byId(c);if(c)return{target:c}}},_toStandbyParams:function(c){c.imageUrl&&(c.image=c.imageUrl);c.backgroundColor&&(c.color=c.backgroundColor);c.backgroundOpacity&&(c.opacity=c.backgroundOpacity);c.fadeDuration&&(c.duration=c.fadeDuration);return k.mixin({},a._defaultStandbyParams,
c)},_createHandle:function(c){return{show:function(){c&&c.show()},hide:function(){c&&c.hide()},destroy:function(){c&&(c.destroy(),c=null)}}}};return a})},"dojox/widget/Standby":function(){define("dojo/_base/kernel dojo/_base/declare dojo/_base/array dojo/_base/event dojo/_base/sniff dojo/dom dojo/dom-attr dojo/dom-construct dojo/dom-geometry dojo/dom-style dojo/window dojo/_base/window dojo/_base/fx dojo/fx dijit/_Widget dijit/_TemplatedMixin dijit/registry".split(" "),function(H,k,n,q,m,l,b,a,c,
f,e,g,d,h,p,t,w){H.experimental("dojox.widget.Standby");return k("dojox.widget.Standby",[p,t],{image:require.toUrl("dojox/widget/Standby/images/loading.gif").toString(),imageText:"Please Wait...",text:"Please wait...",centerIndicator:"image",target:"",color:"#C0C0C0",duration:500,zIndex:"auto",opacity:.75,templateString:'\x3cdiv\x3e\x3cdiv style\x3d"display: none; opacity: 0; z-index: 9999; position: absolute; cursor:wait;" dojoAttachPoint\x3d"_underlayNode"\x3e\x3c/div\x3e\x3cimg src\x3d"${image}" style\x3d"opacity: 0; display: none; z-index: -10000; position: absolute; top: 0px; left: 0px; cursor:wait;" dojoAttachPoint\x3d"_imageNode"\x3e\x3cdiv style\x3d"opacity: 0; display: none; z-index: -10000; position: absolute; top: 0px;" dojoAttachPoint\x3d"_textNode"\x3e\x3c/div\x3e\x3c/div\x3e',
_underlayNode:null,_imageNode:null,_textNode:null,_centerNode:null,_displayed:!1,_resizeCheck:null,_started:!1,_parent:null,startup:function(u){if(!this._started){if("string"===typeof this.target){var r=w.byId(this.target);this.target=r?r.domNode:l.byId(this.target)}this.text&&(this._textNode.innerHTML=this.text);"image"===this.centerIndicator?(this._centerNode=this._imageNode,b.set(this._imageNode,"src",this.image),b.set(this._imageNode,"alt",this.imageText)):this._centerNode=this._textNode;f.set(this._underlayNode,
{display:"none",backgroundColor:this.color});f.set(this._centerNode,"display","none");this.connect(this._underlayNode,"onclick","_ignore");this.domNode.parentNode&&this.domNode.parentNode!=g.body()&&g.body().appendChild(this.domNode);7==m("ie")&&(this._ieFixNode=a.create("div"),f.set(this._ieFixNode,{opacity:"0",zIndex:"-1000",position:"absolute",top:"-1000px"}),g.body().appendChild(this._ieFixNode));this.inherited(arguments)}},show:function(){this._displayed||(this._anim&&(this._anim.stop(),delete this._anim),
this._displayed=!0,this._size(),this._disableOverflow(),this._fadeIn())},hide:function(){if(this._displayed)try{this._anim&&(this._anim.stop(),delete this._anim),this._size()}catch(u){console.error(u)}finally{this._fadeOut(),this._displayed=!1,null!==this._resizeCheck&&(clearInterval(this._resizeCheck),this._resizeCheck=null)}},isVisible:function(){return this._displayed},onShow:function(){},onHide:function(){},uninitialize:function(){this._displayed=!1;this._resizeCheck&&clearInterval(this._resizeCheck);
f.set(this._centerNode,"display","none");f.set(this._underlayNode,"display","none");7==m("ie")&&this._ieFixNode&&(g.body().removeChild(this._ieFixNode),delete this._ieFixNode);this._anim&&(this._anim.stop(),delete this._anim);this._centerNode=this._textNode=this._imageNode=this.target=null;this.inherited(arguments)},_size:function(){if(this._displayed){var u=b.get(g.body(),"dir");u&&(u=u.toLowerCase());var r=this._scrollerWidths(),y=this.target,B=f.get(this._centerNode,"display");f.set(this._centerNode,
"display","block");var C=c.position(y,!0);if(y===g.body()||y===g.doc)C=e.getBox(),C.x=C.l,C.y=C.t;var G=c.getMarginBox(this._centerNode);f.set(this._centerNode,"display",B);if(this._ieFixNode){var x=-this._ieFixNode.offsetTop/1E3;C.x=Math.floor((C.x+.9)/x);C.y=Math.floor((C.y+.9)/x);C.w=Math.floor((C.w+.9)/x);C.h=Math.floor((C.h+.9)/x)}var v=f.get(y,"zIndex"),z=B=v;if("auto"===this.zIndex)if("auto"!=v)B=parseInt(B,10),z=parseInt(z,10);else{var A=y;if(A&&A!==g.body()&&A!==g.doc)for(A=y.parentNode,
x=-1E5;A&&A!==g.body();)(v=f.get(A,"zIndex"))&&"auto"!==v&&(v=parseInt(v,10),x<v&&(x=v,B=v+1,z=v+1)),A=A.parentNode}else B=parseInt(this.zIndex,10),z=parseInt(this.zIndex,10);f.set(this._centerNode,"zIndex",z);f.set(this._underlayNode,"zIndex",B);if((B=y.parentNode)&&B!==g.body()&&y!==g.body()&&y!==g.doc){A=C.h;z=C.w;y=c.position(B,!0);this._ieFixNode&&(x=-this._ieFixNode.offsetTop/1E3,y.x=Math.floor((y.x+.9)/x),y.y=Math.floor((y.y+.9)/x),y.w=Math.floor((y.w+.9)/x),y.h=Math.floor((y.h+.9)/x));y.w-=
B.scrollHeight>B.clientHeight&&0<B.clientHeight?r.v:0;y.h-=B.scrollWidth>B.clientWidth&&0<B.clientWidth?r.h:0;"rtl"===u&&(m("opera")?(C.x+=B.scrollHeight>B.clientHeight&&0<B.clientHeight?r.v:0,y.x+=B.scrollHeight>B.clientHeight&&0<B.clientHeight?r.v:0):m("ie")?y.x+=B.scrollHeight>B.clientHeight&&0<B.clientHeight?r.v:0:m("webkit"));y.w<C.w&&(C.w-=y.w);y.h<C.h&&(C.h-=y.h);var F=y.y,J=y.y+y.h,L=C.y,P=C.y+A;u=y.x;x=y.x+y.w;v=C.x;var Q=C.x+z;if(P>F&&L<F)C.y=y.y,A-=F-L,C.h=A<y.h?A:C.h-2*(B.scrollWidth>
B.clientWidth&&0<B.clientWidth?r.h:0);else if(L<J&&P>J)C.h=J-L;else if(P<=F||L>=J)C.h=0;if(Q>u&&v<u)C.x=y.x,z-=u-v,C.w=z<y.w?z:C.w-2*(B.scrollHeight>B.clientHeight&&0<B.clientHeight?r.w:0);else if(v<x&&Q>x)C.w=x-v;else if(Q<=u||v>=x)C.w=0}0<C.h&&0<C.w?(f.set(this._underlayNode,{display:"block",width:C.w+"px",height:C.h+"px",top:C.y+"px",left:C.x+"px"}),r=["borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],this._cloneStyles(r),m("ie")||(r=
"MozBorderRadius MozBorderRadiusTopleft MozBorderRadiusTopright MozBorderRadiusBottomleft MozBorderRadiusBottomright WebkitBorderRadius WebkitBorderTopLeftRadius WebkitBorderTopRightRadius WebkitBorderBottomLeftRadius WebkitBorderBottomRightRadius".split(" "),this._cloneStyles(r,this)),r=C.h/2-G.h/2,B=C.w/2-G.w/2,C.h>=G.h&&C.w>=G.w?f.set(this._centerNode,{top:r+C.y+"px",left:B+C.x+"px",display:"block"}):f.set(this._centerNode,"display","none")):(f.set(this._underlayNode,"display","none"),f.set(this._centerNode,
"display","none"));if(null===this._resizeCheck){var Z=this;this._resizeCheck=setInterval(function(){Z._size()},100)}}},_cloneStyles:function(u){n.forEach(u,function(r){f.set(this._underlayNode,r,f.get(this.target,r))},this)},_fadeIn:function(){var u=this,r=d.animateProperty({duration:u.duration,node:u._underlayNode,properties:{opacity:{start:0,end:u.opacity}}}),y=d.animateProperty({duration:u.duration,node:u._centerNode,properties:{opacity:{start:0,end:1}},onEnd:function(){u.onShow();delete u._anim}});
this._anim=h.combine([r,y]);this._anim.play()},_fadeOut:function(){var u=this,r=d.animateProperty({duration:u.duration,node:u._underlayNode,properties:{opacity:{start:u.opacity,end:0}},onEnd:function(){f.set(this.node,{display:"none",zIndex:"-1000"})}}),y=d.animateProperty({duration:u.duration,node:u._centerNode,properties:{opacity:{start:1,end:0}},onEnd:function(){f.set(this.node,{display:"none",zIndex:"-1000"});u.onHide();u._enableOverflow();delete u._anim}});this._anim=h.combine([r,y]);this._anim.play()},
_ignore:function(u){u&&q.stop(u)},_scrollerWidths:function(){var u=a.create("div");f.set(u,{position:"absolute",opacity:0,overflow:"hidden",width:"50px",height:"50px",zIndex:"-100",top:"-200px",padding:"0px",margin:"0px"});var r=a.create("div");f.set(r,{width:"200px",height:"10px"});u.appendChild(r);g.body().appendChild(u);r=c.getContentBox(u);f.set(u,"overflow","scroll");var y=c.getContentBox(u);g.body().removeChild(u);return{v:r.w-y.w,h:r.h-y.h}},_setTextAttr:function(u){this.text=this._textNode.innerHTML=
u},_setColorAttr:function(u){f.set(this._underlayNode,"backgroundColor",u);this.color=u},_setImageTextAttr:function(u){b.set(this._imageNode,"alt",u);this.imageText=u},_setImageAttr:function(u){b.set(this._imageNode,"src",u);this.image=u},_setCenterIndicatorAttr:function(u){this.centerIndicator=u;"image"===u?(this._centerNode=this._imageNode,f.set(this._textNode,"display","none")):(this._centerNode=this._textNode,f.set(this._imageNode,"display","none"))},_setTargetAttr:function(u){if("string"===typeof u){var r=
w.byId(u);this._set("target",r?r.domNode:l.byId(u))}else this._set("target",u)},_disableOverflow:function(){if(this.target===g.body()||this.target===g.doc){this._overflowDisabled=!0;var u=g.body();this._oldOverflow=u.style&&u.style.overflow?f.get(u,"overflow"):"";if(m("ie")&&!m("quirks")){if(u.parentNode&&u.parentNode.style&&u.parentNode.style.overflow)this._oldBodyParentOverflow=u.parentNode.style.overflow;else try{this._oldBodyParentOverflow=f.get(u.parentNode,"overflow")}catch(r){this._oldBodyParentOverflow=
"scroll"}f.set(u.parentNode,"overflow","hidden")}f.set(u,"overflow","hidden")}},_enableOverflow:function(){if(this._overflowDisabled){delete this._overflowDisabled;var u=g.body();m("ie")&&!m("quirks")&&(u.parentNode.style.overflow=this._oldBodyParentOverflow,delete this._oldBodyParentOverflow);f.set(u,"overflow",this._oldOverflow);if(m("webkit")){var r=a.create("div",{style:{height:"2px"}});u.appendChild(r);setTimeout(function(){u.removeChild(r)},0)}delete this._oldOverflow}}})})},"esri/dijit/analysis/CreateViewshed":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/Color dojo/_base/json dojo/has dojo/json dojo/string dojo/dom-style dojo/dom-attr dojo/dom-construct dojo/query dojo/dom-class dojo/number dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dijit/_OnDijitClickMixin dijit/_FocusMixin dijit/registry dijit/form/Button dijit/form/CheckBox dijit/form/Form dijit/form/Select dijit/form/TextBox dijit/form/NumberSpinner dijit/form/ValidationTextBox dijit/layout/ContentPane dijit/form/FilteringSelect dijit/Dialog ../../kernel ../../lang ./AnalysisBase ./_AnalysisOptions ../../symbols/SimpleFillSymbol ../../symbols/SimpleLineSymbol ../../toolbars/draw ../PopupTemplate ../../layers/FeatureLayer ../../graphic ./utils ./AnalysisRegistry ./CreditEstimator ../../symbols/PictureMarkerSymbol dijit/form/HorizontalSlider dijit/form/HorizontalRule dijit/form/HorizontalRuleLabels dojo/i18n!../../nls/jsapi dojo/text!./templates/CreateViewshed.html".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G,x,v,z,A,F,J,L,P,Q,Z,ca,da,ea,fa,K,V,aa,Y,I,O,E,N,R,W,ha,oa,ma,T){H=k([w,u,r,y,B,ea,da],{declaredClass:"esri.dijit.analysis.CreateViewshed",templateString:T,widgetsInTemplate:!0,inputLayer:null,maximumDistance:15,maxDistanceUnits:"Kilometers",targetHeight:0,targetHeightUnits:"Meters",observerHeight:1.75,observerHeightUnits:"Meters",outputLayerName:null,i18n:null,map:null,toolName:"CreateViewshed",helpFileName:"CreateViewshed",resultParameter:"viewshedLayer",
constructor:function(ba,na){na=ba.distanceDefaultUnits||"Miles";this._pbConnects=[];ba.containerNode&&(this.container=ba.containerNode);this.maxDistanceUnits=ba.maxDistanceUnits?ba.maxDistanceUnits:na;this.maximumDistance=ca.isDefined(ba.maximumDistance)?ba.maximumDistance:"Miles"===na?9:15;this.observerHeightUnits=ba.observerHeightUnits?ba.observerHeightUnits:"Miles"===na?"Feet":"Meters";this.observerHeight=ca.isDefined(ba.observerHeight)?ba.observerHeight:"Miles"===na?6:1.75;this.targetHeightUnits=
ba.targetHeightUnits?ba.targetHeightUnits:"Miles"===na?"Feet":"Meters"},destroy:function(){this.inherited(arguments);q.forEach(this._pbConnects,m.disconnect);delete this._pbConnects},postMixInProperties:function(){this.inherited(arguments);n.mixin(this.i18n,ma.findHotSpotsTool);n.mixin(this.i18n,ma.createViewshedTool);this.set("drawPointLayerName",this.i18n.pointlayerName)},postCreate:function(){this.inherited(arguments);p.add(this._form.domNode,"esriSimpleForm");this._outputLayerInput.set("validator",
n.hitch(this,this.validateServiceName));this.showCredits=!1;this._buildUI()},startup:function(){},_handleModeCrumbClick:function(ba){ba.preventDefault();this._onClose(!0)},_onClose:function(ba){ba&&this._pointfeatureLayer&&(this.map.removeLayer(this._pointfeatureLayer),q.forEach(this.inputLayers,function(na,ia){na===this._pointfeatureLayer&&(this._analysisSelect.removeOption({value:ia+1,label:this._pointfeatureLayer.name}),this.inputLayers.splice(ia,1))},this));this._handleInputDrawPointChange(!1);
this.emit("close",{save:!ba})},clear:function(){this._pointfeatureLayer&&(this.map.removeLayer(this._pointfeatureLayer),q.forEach(this.inputLayers,function(ba,na){ba===this._pointfeatureLayer&&(this._analysisSelect.removeOption({value:na+1,label:this._pointfeatureLayer.name}),this.inputLayers.splice(na,1))},this));this._handleInputDrawPointChange(!1)},_handleShowCreditsClick:function(ba){ba.preventDefault();ba={};var na=this.get("observerHeight"),ia=this.get("targetHeight"),pa=this.get("maximumDistance");
this._form.validate()&&(ba.inputLayer=b.toJson(this.constructAnalysisInputLyrObj(this.get("inputLayer"))),0<=pa&&(ba.maximumDistance=pa,ba.maxDistanceUnits=this.get("maxDistanceUnits")),0<=na&&(ba.observerHeight=na,ba.observerHeightUnits=this.get("observerHeightUnits")),0<=ia&&(ba.targetHeight=ia,ba.targetHeightUnits=this.get("targetHeightUnits")),this.returnFeatureCollection||(ba.OutputName=b.toJson({serviceProperties:{name:this.get("outputLayerName")}})),this.returnFeatureCollection||(ba.OutputName=
b.toJson({serviceProperties:{name:this.get("outputLayerName")}})),this.showChooseExtent&&this._useExtentCheck.get("checked")&&(ba.context=b.toJson({extent:this.map.extent._normalize(!0)})),this.getCreditsEstimate(this.toolName,ba).then(n.hitch(this,function(D){this._usageForm.set("content",D);this._usageDialog.show()})))},_handleSaveBtnClick:function(ba){if(this._form.validate()){this._saveBtn.set("disabled",!0);ba={};var na={};var ia=this.get("observerHeight");var pa=this.get("targetHeight"),D=this.get("maximumDistance");
ba.inputLayer=b.toJson(this.constructAnalysisInputLyrObj(this.get("inputLayer")));0<=D&&(ba.maximumDistance=D,ba.maxDistanceUnits=this.get("maxDistanceUnits"));0<=ia&&(ba.observerHeight=ia,ba.observerHeightUnits=this.get("observerHeightUnits"));0<=pa&&(ba.targetHeight=pa,ba.targetHeightUnits=this.get("targetHeightUnits"));this.returnFeatureCollection||(ba.OutputName=b.toJson({serviceProperties:{name:this.get("outputLayerName")}}));this.showChooseExtent&&!this.get("disableExtent")&&this._useExtentCheck.get("checked")&&
(ba.context=b.toJson({extent:this.map.extent._normalize(!0)}));this.returnFeatureCollection&&(ia={outSR:this.map.spatialReference},this.showChooseExtent&&this._useExtentCheck.get("checked")&&(ia.extent=this.map.extent._normalize(!0)),ba.context=b.toJson(ia));ba.returnFeatureCollection=this.returnFeatureCollection;na.jobParams=ba;na.itemParams={description:this.i18n.itemDescription,tags:f.substitute(this.i18n.itemTags,{layername:this.inputLayer.name,fieldname:ba.field?ba.field:""}),snippet:this.i18n.itemSnippet};
this.showSelectFolder&&(na.itemParams.folder=this.get("folderId"));this.execute(na)}},_save:function(){},_buildUI:function(){this._loadConnections();this.signInPromise.then(n.hitch(this,O.initHelpLinks,this.domNode,this.showHelp,{analysisGpServer:this.analysisGpServer}));var ba=!0;this.get("showSelectAnalysisLayer")&&(this.inputLayers&&this.inputLayer&&!O.isLayerInLayers(this.inputLayer,this.inputLayers)&&(this.inputLayers.push(this.inputLayer),-1!==this.inputLayer.name.indexOf("Drawn Input Points")&&
(this.map.addLayer(this.inputLayer),this._pointfeatureLayer=this.inputLayer)),this.get("inputLayer")||!this.get("inputLayers")||this.rerun||this.set("inputLayer",this.inputLayers[0]),O.populateAnalysisLayers(this,"inputLayer","inputLayers",{posIncrement:1}));this.outputLayerName&&(this._outputLayerInput.set("value",this.outputLayerName),ba=!1);O.addReadyToUseLayerOption(this,[this._analysisSelect]);this._updateAnalysisLayerUI(ba);e.set(this._chooseFolderRow,"display",!0===this.showSelectFolder?"block":
"none");this.showSelectFolder&&this.getFolderStore().then(n.hitch(this,function(na){this.folderStore=na;O.setupFoldersUI({folderStore:this.folderStore,folderId:this.folderId,folderName:this.folderName,folderSelect:this._webMapFolderSelect,username:this.portalUser?this.portalUser.username:""})}));e.set(this._chooseExtentDiv,"display",!0===this.showChooseExtent?"inline-block":"none");e.set(this._showCreditsLink,"display",!0===this.showCredits?"block":"none");this._distanceUnitsSelect.addOption([{value:"Miles",
label:this.i18n.miles},{value:"Yards",label:this.i18n.yards},{value:"Feet",label:this.i18n.feet},{type:"separator"},{value:"Kilometers",label:this.i18n.kilometers},{value:"Meters",label:this.i18n.meters}]);this.maxDistanceUnits&&(this._distanceUnitsSelect.set("value",this.maxDistanceUnits),this._handleMaxDstUnitsChange(this.maxDistanceUnits));this.maximumDistance&&this._maximumDistanceInput.set("value",this.maximumDistance);this._obsrUnitsSelect.addOption([{value:"Miles",label:this.i18n.miles},{value:"Yards",
label:this.i18n.yards},{value:"Feet",label:this.i18n.feet},{type:"separator"},{value:"Kilometers",label:this.i18n.kilometers},{value:"Meters",label:this.i18n.meters}]);this.observerHeightUnits&&this._obsrUnitsSelect.set("value",this.observerHeightUnits);this.observerHeight&&this._obsrHeightInput.set("value",this.observerHeight);this._targetUnitsSelect.addOption([{value:"Miles",label:this.i18n.miles},{value:"Yards",label:this.i18n.yards},{value:"Feet",label:this.i18n.feet},{type:"separator"},{value:"Kilometers",
label:this.i18n.kilometers},{value:"Meters",label:this.i18n.meters}]);this.targetHeightUnits&&this._targetUnitsSelect.set("value",this.targetHeightUnits);this.targetHeight&&this._targetHgtInput.set("value",this.targetHeight)},_loadConnections:function(){this.on("start",n.hitch(this,"_onClose",!1));this._connect(this._closeBtn,"onclick",n.hitch(this,"_onClose",!0))},validateServiceName:function(ba){return O.validateServiceName(ba,{textInput:this._outputLayerInput,isItem:!this.returnFeatureCollection})},
_handleInputDrawPointChange:function(ba){ba?(this.emit("drawtool-activate",{}),this._pointfeatureLayer||this._createPointFeatColl(),this._pointtoolbar.activate(V.POINT)):this._pointtoolbar.deactivate()},_createPointFeatColl:function(){var ba=O.createPointFeatureCollection(this.drawPointLayerName);this._pointfeatureLayer=new Y(ba,{id:this.drawPointLayerName});this.map.addLayer(this._pointfeatureLayer);m.connect(this._pointfeatureLayer,"onClick",n.hitch(this,function(na){this.map.infoWindow.setFeatures([na.graphic])}))},
_addPointFeatures:function(ba){var na=[],ia={};ba=new I(ba);ia.description="blayer desc";ia.title="blayer";ba.setAttributes(ia);na.push(ba);this._pointfeatureLayer.applyEdits(na,null,null);if(0===this.inputLayers.length||this.inputLayers[this.inputLayers.length-1]!==this._pointfeatureLayer)this.inputLayers.push(this._pointfeatureLayer),na=this.inputLayers.length-1,ia=this._analysisSelect.getOptions(),this._analysisSelect.removeOption(ia),ia=q.map(ia,function(pa){pa.selected=!1;return pa}),this._analysisSelect.addOption({value:na+
1,label:this._pointfeatureLayer.name,selected:!0}),this._analysisSelect.addOption(ia),this._handleAnalysisLayerChange(na+1)},_handleMaxDstChange:function(){this._maximumDistanceInput.validate()},_handleMaxDstUnitsChange:function(ba){var na="",ia={min:0};"Miles"===ba?(ia.max=31,na=f.substitute(this.i18n.maxDistanceValidMsg,{units:ba,limit:31})):"Kilometers"===ba?(ia.max=50,na=f.substitute(this.i18n.maxDistanceValidMsg,{units:ba,limit:50})):"Yards"===ba?(ia.max=54680,na=f.substitute(this.i18n.maxDistanceValidMsg,
{units:ba,limit:54680})):"Feet"===ba?(ia.max=164041,na=f.substitute(this.i18n.maxDistanceValidMsg,{units:ba,limit:164041})):"Meters"===ba&&(ia.max=5E4,na=f.substitute(this.i18n.maxDistanceValidMsg,{units:ba,limit:5E4}));this._maximumDistanceInput.set("constraints",ia);this._maximumDistanceInput.set("rangeMessage",na)},_handleAnalysisLayerChange:function(ba){"browse"===ba||"browselayers"===ba?(this._createBrowseItems({browseValue:ba,disabledSubResources:[this.inputLayer]},{tags:["point"],geometryTypes:[E.GeometryTypes.Point,
E.GeometryTypes.MultiPoint]},this._analysisSelect),this._analysisPointDrawBtn.reset()):(this.inputLayer=this.inputLayers[ba-1],this._updateAnalysisLayerUI(!0))},_handleBrowseItemsSelect:function(ba,na){ba&&ba.selection&&O.addAnalysisReadyLayer({item:ba.selection,layers:this.inputLayers,layersSelect:this._analysisSelect,posIncrement:1,browseDialog:ba.dialog||this._browsedlg,widget:this},na).always(n.hitch(this,this._updateAnalysisLayerUI,!0))},_updateAnalysisLayerUI:function(ba){this.inputLayer&&(g.set(this._interpolateToolDescription,
"innerHTML",f.substitute(this.i18n.toolDefine,{layername:this.inputLayer.name})),ba&&(this.outputLayerName=f.substitute(this.i18n.outputLayerName,{layername:this.inputLayer.name})),this._outputLayerInput.set("value",this.outputLayerName),this._pointfeatureLayer&&this._pointfeatureLayer.name!==this.inputLayer.name&&this._analysisPointDrawBtn.reset())},_setAnalysisGpServerAttr:function(ba){ba&&(this.analysisGpServer=ba,this.set("toolServiceUrl",this.analysisGpServer+"/"+this.toolName))},_setInputLayersAttr:function(ba){this.inputLayers=
ba||[]},_setInputLayerAttr:function(ba){this.inputLayer=ba},_getInputLayerAttr:function(){return this.inputLayer},_getOutputLayerNameAttr:function(){this._outputLayerInput&&(this.outputLayerName=this._outputLayerInput.get("value"));return this.outputLayerName},_setOutputLayerNameAttr:function(ba){this.outputLayerName=ba},_setMapAttr:function(ba){this.map=ba;this._pointtoolbar=new V(this.map);m.connect(this._pointtoolbar,"onDrawEnd",n.hitch(this,this._addPointFeatures))},_getMapAttr:function(){return this.map},
_setDisableRunAnalysisAttr:function(ba){this._saveBtn.set("disabled",ba)},_setDisableExtentAttr:function(ba){this._useExtentCheck.set("checked",!ba);this._useExtentCheck.set("disabled",ba)},_getDisableExtentAttr:function(){this._useExtentCheck.get("disabled")},_setMaxDistanceUnitsAttr:function(ba){this.maxDistanceUnits=ba},_getMaxDistanceUnitsAttr:function(){this._distanceUnitsSelect&&this._distanceUnitsSelect.get("value")&&(this.maxDistanceUnits=this._distanceUnitsSelect.get("value"));return this.maxDistanceUnits},
_setMaximumDistanceAttr:function(ba){this.maximumDistance=ba},_getMaximumDistanceAttr:function(){return this._maximumDistanceInput.get("value")},_setObserverHeightUnitsAttr:function(ba){this.observerHeightUnits=ba},_getObserverHeightUnitsAttr:function(){this._obsrUnitsSelect&&this._obsrUnitsSelect.get("value")&&(this.observerHeightUnits=this._obsrUnitsSelect.get("value"));return this.observerHeightUnits},_setObserverHeightAttr:function(ba){this.observerHeight=ba},_getObserverHeightAttr:function(){return this._obsrHeightInput.get("value")},
_setTargetHeightUnitsAttr:function(ba){this.targetHeightUnits=ba},_getTargetHeightUnitsAttr:function(){this._targetUnitsSelect&&this._targetUnitsSelect.get("value")&&(this.targetHeightUnits=this._targetUnitsSelect.get("value"));return this.targetHeightUnits},_setTargetHeightAttr:function(ba){this.targetHeight=ba},_getTargetHeightAttr:function(){return this._targetHgtInput.get("value")},_setDrawPointLayerNameAttr:function(ba){this.drawPointLayerName=ba},_getDrawPointLayerNameAttr:function(){return this._pointfeatureLayer.name},
_getDrawLayerAttr:function(){var ba=[];this._featureLayer&&ba.push(this._featureLayer);this._pointfeatureLayer&&ba.push(this._pointfeatureLayer);return ba},_connect:function(ba,na,ia){this._pbConnects.push(m.connect(ba,na,ia))}});a("extend-esri")&&n.setObject("dijit.analysis.CreateViewshed",H,Z);return H})},"esri/dijit/analysis/AnalysisBase":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/json dojo/has dojo/json dojo/Deferred dojo/promise/all dojo/when dojo/data/ItemFileWriteStore dojo/string dojo/Evented dojo/_base/kernel dojo/Stateful ../../kernel ../../lang ../../request ../../tasks/Geoprocessor dojo/i18n!../../nls/jsapi ./utils ./storageUtils ./ItemTypes ../../IdentityManager".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G){k=k([p,d],{declaredClass:"esri.dijit.analysis.AnalysisBase",isOutputLayerItemUpdated:!1,analysisGpServer:null,toolName:null,portalUrl:null,jobParams:null,itemParams:null,gp:null,resultParameter:null,signInPromise:null,getResultLyrInfos:!1,checkCreditLimits:!1,useGPCreditTask:!0,_isGPCreditSync:!0,_jobInfo:null,_popupInfo:null,_toolServiceUrl:null,_counter:null,_analysisType:"feature",doRefreshItem:!0,doSaveJobInfo:!1,doSaveInStorage:!1,_doDeleteViewResult:!1,
outputName:"OutputName",_freeGPTools:["CreateWatersheds","CreateViewshed","TraceDownstream"],constructor:function(x){this.isOutputLayerItemUpdated=!1;this._rids=[];this._counter=0;this._popupInfo=[];x.analysisGpServer?this._signIn(x.analysisGpServer):x.portalUrl&&(this.portalUrl=x.portalUrl,this._signIn(x.portalUrl,!0));this.i18n={};n.mixin(this.i18n,y.common);n.mixin(this.i18n,y.analysisTools);n.mixin(this.i18n,y.analysisMsgCodes);n.mixin(this.i18n,y.analysisSettings);this.signInPromise.then(n.hitch(this,
this._initErrorHelpMap))},execute:function(x){var v;this.jobParams=x.jobParams;this.jobParams.actualOutputName=this.outputName;var z=this.jobParams[this.outputName];this._analysisType=x.analysisType||"feature";this._updateContext();var A=m.fromJson(this.jobParams.context);z&&(v=m.fromJson(z));!z||v&&!v.serviceProperties?(this.itemParams=null,this.jobParams.resultName=this.get("resultName")):this.showGeoAnalyticsParams&&z&&A&&A.dataStore&&-1===["BDS","GDB"].indexOf(A.dataStore)?(this.jobParams._gaxOutName=
v.serviceProperties.name.replace(/[\s]|\-|\./g,"_"),this.jobParams[this.outputName]=null,this.jobParams.outputType=G.BDFSTEMPLATE,this.itemParams=null):(this.showGeoAnalyticsParams&&"CopyToDataStore"===this.toolName&&A&&A.dataStore&&-1!==["BDS","GDB"].indexOf(A.dataStore)&&(delete A.dataStore,this.jobParams.context=m.toJson(A)),this.itemParams=x.itemParams);w.isDefined(x.isSpatioTemporalDataStore)&&(this._isSpatioTemporalDataStore=B.settingsVM&&B.settingsVM.datastore&&"CopyToDataStore"!==this.toolName?
"BDS"===B.settingsVM.datastore:x.isSpatioTemporalDataStore);this.signInPromise.then(n.hitch(this,this._checkUser))},_updateContext:function(){var x;this.rerun&&this.context&&this._useExtentCheck&&!this._useExtentCheck.get("checked")&&(this.context.extent=null);this.context&&((x=m.fromJson(this.jobParams.context))||(x={}),this.context.outSR&&!x.outSR&&(x.outSR=this.context.outSR),this.context.processSR&&!x.processSR&&(x.processSR=this.context.processSR),this.context.extent&&!x.extent&&(x.extent=this.context.extent),
this.showGeoAnalyticsParams&&this.context.dataStore&&!x.dataStore&&(x.dataStore=this.context.dataStore),"raster"===this._analysisType&&(this.context.cellSize&&!x.cellSize&&(x.cellSize=this.context.cellSize),!this.context.mask||x.mask||this.isDLTool||(x.mask=this.context.mask),!this.context.snapRaster||x.snapRaster||this.isDetectObjectTool||(x.snapRaster=this.context.snapRaster),this.isDLTool||this.isOutputFeatureTool||this.isProximityTool||!this.context.resamplingMethod||x.resamplingMethod||(x.resamplingMethod=
this.context.resamplingMethod)),this.isDLTool&&(this.context.processorType&&!x.processorType&&(x.processorType=this.context.processorType),"feature"===this._analysisType&&this.context.cellSize&&!x.cellSize&&(x.cellSize=this.context.cellSize)),this.isPPFTool&&(this.context.parallelProcessingFactor&&!x.parallelProcessingFactor&&(x.parallelProcessingFactor=this.context.parallelProcessingFactor),this.context.recycleProcessingWorkers&&!x.recycleProcessingWorkers&&(x.recycleProcessingWorkers=this.context.recycleProcessingWorkers),
this.context.retryOnFailures&&!x.retryOnFailures&&(x.retryOnFailures=this.context.retryOnFailures)),this.jobParams.context=m.toJson(x))},_checkUser:function(){var x;if(x=t.id.findCredential(this.portalUrl).userId)x=this.portalUrl+"/sharing/rest/community/users/"+x,u({url:x,content:{f:"json"}}).then(n.hitch(this,this._handleUserProfileResponse),n.hitch(this,function(v){this.emit("job-fail",{message:v.message+(v.details?v.details.toString():""),jobParams:this.jobParams})}))},getUserProfile:function(){var x=
new a;this.userProfile?x.resolve(this.userProfile):this.signInPromise.then(n.hitch(this,function(v){if(v=v.userId)v=this.portalUrl+"/sharing/rest/community/users/"+v,u({url:v,content:{f:"json"}}).then(n.hitch(this,function(z){this.userProfile=z;x.resolve(z)}),n.hitch(this,function(z){x.reject(z)}))}));return x.promise},_handleUserProfileResponse:function(x){var v=this.jobParams.outputType&&this.jobParams.outputType===G.FLAYERVIEW;if(w.isDefined(x)&&w.isDefined(x.orgId))if(-1===q.indexOf(["account_admin",
"account_publisher","org_admin","org_publisher"],x.role))this.emit("job-fail",{message:this.i18n.pubRoleMsg,messageCode:"AB_0001",jobParams:this.jobParams});else if(w.isDefined(x.availableCredits)&&this.get("checkCreditLimits")&&!v&&!this._byPassCreditCheck(this.toolName)){var z,A={},F=this.toolName,J=new a;var L=this._cleanUpJobParamsForSubmit();for(z in L)L.hasOwnProperty(z)&&("object"===typeof L[z]?A[z]=m.toJson(L[z]):-1!==q.indexOf(["measurementtype"],z.toLowerCase())&&"StraightLine"!==L[z]?(v=
m.fromJson(L[z]),A[z]=v?v.name.replace(/[\s~`!#$%\^&*+=\-\[\]\\';,\/{}|\\":<>\?]/g,""):"DrivingTime"):A[z]=L[z]);this.isRaster&&(F=this.rasterGPToolName,A.functionArguments&&(A.functionArguments=m.fromJson(A.functionArguments)),A.context&&(A.context=m.fromJson(A.context)));w.isDefined(this.itemParams)&&!this.isRaster?J=this._checkServiceName(x.orgId,!0):J.resolve(!0);J.then(n.hitch(this,function(P){P&&(this.isRaster&&w.isDefined(this.estimatedCost)?x.availableCredits>this.estimatedCost?this._runJob():
this.emit("job-fail",{message:this.i18n.insufficientCreditsMsg,messageCode:"AB_0001",jobParams:this.jobParams}):this.getCreditsEstimate(F,A,this.isRaster).always(n.hitch(this,function(Q){var Z=Q&&w.isDefined(Q.cost)?Q.cost:Q.maximumCost;w.isDefined(Z)&&x.availableCredits>Z?this._runJob():Q&&(Q.messageCode||Q.message)&&0!==Q.status?(Z=w.isDefined(this.i18n[Q.messageCode])?this.i18n[Q.messageCode]:Q.message,Z=w.isDefined(Q.params)?g.substitute(Z,Q.params):Z,this.emit("job-fail",{message:Z,messageCode:"AB_0001",
jobParams:this.jobParams})):this.isRaster&&w.isDefined(Z)&&x.availableCredits<Z?this.emit("job-fail",{message:this.i18n.insufficientCreditsMsg,messageCode:"AB_0001",jobParams:this.jobParams}):this._runJob()})))}))}else w.isDefined(this.itemParams)?this._checkServiceName(x.orgId):(this.emit("start",this.jobParams),this._submitGpJob());else this.emit("job-fail",{message:this.i18n.orgUsrMsg,jobParams:this.jobParams})},_runJob:function(){w.isDefined(this.itemParams)?("raster"===this._analysisType?this._createImageService():
this._createService(),this.emit("start",this.jobParams)):(this.emit("start",this.jobParams),this._submitGpJob())},_checkServiceName:function(x,v){var z=new a;t.id.findCredential(this.portalUrl);x=this.portalUrl+"/sharing/rest/portals/"+x+"/isServiceNameAvailable";var A=m.fromJson(this.jobParams[this.outputName]);w.isDefined(A.serviceProperties)&&w.isDefined(A.serviceProperties.name)&&(A.serviceProperties.name=A.serviceProperties.name.replace(/[\s]|\-|\./g,"_"),this.jobParams[this.outputName]=m.toJson(A));
u({url:x,content:{name:A.serviceProperties.name,type:"raster"===this._analysisType?"Image Service":"Feature Service",f:"json"}}).then(n.hitch(this,function(F){F.available?(v||("raster"===this._analysisType?this._createImageService():this._createService(),this.emit("start",this.jobParams)),z.resolve(!0)):(this.emit("job-fail",{message:this.i18n.servNameExists,type:"warning",messageCode:"AB_0002",jobParams:this.jobParams}),z.resolve(!1))}),n.hitch(this,function(F){this.emit("job-fail",{message:F.message+
(F.details?F.details.toString():""),jobParams:this.jobParams});z.resolve(!1)}));return z},_checkServiceNameOnly:function(x,v){var z=new a;t.id.findCredential(this.portalUrl);u({url:this.portalUrl+"/sharing/rest/portals/"+x+"/isServiceNameAvailable",content:{name:v,type:"Image Service",f:"json"}}).then(n.hitch(this,function(A){A.available?z.resolve(!0):(this.emit("job-fail",{message:this.i18n.servNameExists,type:"warning",messageCode:"AB_0002",jobParams:this.jobParams}),z.resolve(!1))}),n.hitch(this,
function(A){this.emit("job-fail",{message:A.message+(A.details?A.details.toString():""),jobParams:this.jobParams});z.resolve(!1)}));return z},_createService:function(){var x=this._submitGpJob;var v=t.id.findCredential(this.portalUrl).userId;var z=m.fromJson(this.jobParams[this.outputName]);if(v){var A=this.itemParams.folder;v=this.portalUrl+"/sharing/rest/content/users/"+v+(A&&"/"!==A?"/"+A:"")+"/createService";z={createParameters:m.toJson({currentVersion:10.2,serviceDescription:"",hasVersionedData:!1,
supportsDisconnectedEditing:!1,hasStaticData:!0,maxRecordCount:2E3,supportedQueryFormats:"JSON",capabilities:"Query",description:"",copyrightText:"",allowGeometryUpdates:!1,syncEnabled:!1,editorTrackingInfo:{enableEditorTracking:!1,enableOwnershipAccessControl:!1,allowOthersToUpdate:!0,allowOthersToDelete:!0},xssPreventionInfo:{xssPreventionEnabled:!0,xssPreventionRule:"InputOnly",xssInputRule:"rejectInvalid"},tables:[],name:z.serviceProperties.name}),outputType:"featureService",f:"json"};this._isSpatioTemporalDataStore&&
(A=m.fromJson(z.createParameters),A.options={dataSourceType:"spatiotemporal"},z.createParameters=m.toJson(A));this.jobParams.outputType&&this.jobParams.outputType===G.FLAYERVIEW&&(A=m.fromJson(z.createParameters),n.mixin(z,this._getViewCreateParams()),z.createParameters=m.toJson(A),x=this._addViewDefinition);u({url:v,content:z},{usePost:!0}).then(n.hitch(this,x),n.hitch(this,this._handleCreateServiceError))}},_createImageService:function(){var x=t.id.findCredential(this.portalUrl).userId;var v=m.fromJson(this.jobParams[this.outputName]);
if(x){var z=this.itemParams.folder;x=this.portalUrl+"/sharing/rest/content/users/"+x+(z&&"/"!==z?"/"+z:"")+"/createService";v={createParameters:m.toJson({name:v.serviceProperties.name,description:"",capabilities:v.serviceProperties.capabilities||"Image",properties:{isCached:!0,path:"@",description:"",copyright:""}}),outputType:"imageService",f:"json"};u({url:x,content:v},{usePost:!0}).then(n.hitch(this,this._submitGpJob),n.hitch(this,this._handleCreateServiceError))}},_handleCreateServiceError:function(x){this.emit("job-fail",
{message:x.message+(x.details?x.details.toString():""),jobParams:this.jobParams})},_getViewCreateParams:function(){return{isView:!0}},_addViewDefinition:function(x){var v;if(this.itemParams){this.currentGpItemId=x.itemId;var z=m.fromJson(this.jobParams[this.outputName]);z.serviceProperties&&(z.serviceProperties.serviceUrl=x.serviceurl);z.itemProperties={itemId:x.itemId};this.itemParams.folder&&(z.itemProperties.folderId=this.itemParams.folder);this.jobParams[this.outputName]=m.toJson(z)}this.getViewParams({jobParams:this.jobParams,
resultService:{url:x.serviceurl,itemId:x.itemId}}).then(n.hitch(this,function(A){v=A;var F={jobId:"ViewJob_"+(new Date).getTime(),jobStatus:"esriJobSubmitted",jobParams:this.jobParams};this._addToDefinition(x.serviceurl,v).then(n.hitch(this,function(J){var L={value:{}};this._doDeleteViewResult||(this._jobInfo.jobStatus="esriJobSucceeded",setTimeout(n.hitch(this,function(){this.itemParams.properties={jobUrl:J.serviceurl+"/jobs/"+this._jobInfo.jobId,jobType:"GPServer",jobId:this._jobInfo.jobId,jobStatus:"completed"};
this._readItem()}),300),this.doSaveJobInfo&&this.saveJobInfo(this._jobInfo),L.outputLayerName=m.fromJson(this.jobParams[this.outputName]).serviceProperties.name,L.value.itemId=this.currentGpItemId,L.analysisInfo={toolName:this.toolName,secondaryOutputs:this.secondaryOutputs,jobParams:this.jobParams},this.emit("job-result",L))}),n.hitch(this,this._gpJobFailed));this.emit("job-submit",this.jobParams);setTimeout(n.hitch(this,function(){this._jobInfo=F;this._jobInfo.jobStatus="esriJobExecuting";this._readItem();
this.emit("job-status",this._jobInfo)},0))}),n.hitch(this,this._gpJobFailed))},_addToDefinition:function(x,v){x=x.replace("/rest/services","/rest/admin/services")+"/addToDefinition";var z=t.id.findCredential(this.portalUrl);v={f:"json",addToDefinition:m.toJson(v),token:z.token};return u({url:x,content:v},{usePost:!0})},_getAdminLayerInfo:function(x){x=x.replace("/rest/services","/rest/admin/services");var v={f:"json",token:t.id.findCredential(this.portalUrl).token};return u({url:x,content:v})},_getSelf:function(x){return u({url:x+
"/sharing/rest/portals/self",content:{culture:h.locale,f:"json"},callbackParamName:"callback",timeout:0},{})},_submitGpJob:function(x){var v=m.fromJson(this.jobParams.context);this._doCancelCleanup=!1;if(this.itemParams){this.currentGpItemId=x.itemId;var z=m.fromJson(this.jobParams[this.outputName]);z.serviceProperties&&(z.serviceProperties.serviceUrl=x.serviceurl);z.itemProperties={itemId:x.itemId};this.itemParams.folder&&(z.itemProperties.folderId=this.itemParams.folder);this.jobParams[this.outputName]=
m.toJson(z)}if(this.analysisGpServer){this._toolServiceUrl&&this.gp||this.set("toolServiceUrl",this.analysisGpServer+"/"+this.toolName);this.gp.setUpdateDelay(3E3);if(this.showGeoAnalyticsParams&&this.jobParams._gaxOutName&&v.dataStore&&-1===["BDS","GDB"].indexOf(v.dataStore)){var A=this.jobParams[this.outputName]=this.jobParams._gaxOutName;delete this.jobParams._gaxOutName}this.itemParams||delete this.jobParams.resultName;this.gp.submitJob(this._cleanUpJobParamsForSubmit(),n.hitch(this,this._gpJobComplete),
n.hitch(this,this._gpJobStatus),n.hitch(this,this._gpJobFailed));this.itemParams||(this.jobParams.resultName=this.get("resultName"));A&&(this.jobParams[this.outputName]=null);this.emit("job-submit",this.jobParams)}else this._getSelf(this.portalUrl).then(n.hitch(this,function(F){this.analysisGpServer=F.helperServices.analysis&&F.helperServices.analysis.url?F.helperServices.analysis.url:null;this.set("toolServiceUrl",this.analysisGpServer+"/"+this.toolName);this.gp.setUpdateDelay(3E3);this.itemParams||
delete this.jobParams.resultName;this.gp.submitJob(this.jobParams,n.hitch(this,this._gpJobComplete),n.hitch(this,this._gpJobStatus),n.hitch(this,this._gpJobFailed));this.itemParams||(this.jobParams.resultName=this.get("resultName"));this.emit("job-submit",this.jobParams)}))},_cleanUpJobParamsForSubmit:function(){var x=n.mixin({},this.jobParams),v=["actualOutputName","aLayer","attributeExprObj","data","resultName"].concat(this.removeJobParamKeys||[]),z;for(z in x)x.hasOwnProperty(z)&&-1!==v.indexOf(z)&&
delete x[z];return x},_updateItem:function(x){var v;if(v=t.id.findCredential(this.portalUrl).userId){var z=this.itemParams.folder;v=this.portalUrl+"/sharing/rest/content/users/"+v+(z&&"/"!==z?"/"+z:"")+"/items/"+this.currentGpItemId+"/update";if(x)var A=x.item.properties;w.isDefined(A)||(A={});w.isDefined(A.jobUrl)||(A.jobUrl=this._toolServiceUrl+"/jobs/"+this._jobInfo.jobId,A.jobType="GPServer",A.jobId=this._jobInfo.jobId,A.jobStatus="processing",this.itemParams.properties=A);A=n.mixin({f:"json"},
this.itemParams);x&&A.folder===x.item.folder&&delete A.folder;x&&x.item&&A.tags===x.item.tags.toString()&&delete A.tags;x&&x.item&&A.snippet===x.item.snippet&&delete A.snippet;x&&x.item&&A.description===x.item.description&&delete A.description;A.properties&&(A.properties=m.toJson(A.properties));A.text&&(A.text=m.toJson(A.text));x=u({url:v,content:A},{usePost:!0});x.then(n.hitch(this,this._handleItemUpdate),n.hitch(this,this._handleUpdateItemError));return x}},_handleItemUpdate:function(x){this.isOutputLayerItemUpdated=
!0},_handleItemDataUpdate:function(x){},_handleUpdateItemError:function(x){this.isOutputLayerItemUpdated=!0;this.emit("job-fail",{message:x.message+(x.details?x.details.toString():""),jobParams:this.jobParams})},_handleErrorResponse:function(x){this.emit("job-fail",x)},_refreshItem:function(){var x;if(x=t.id.findCredential(this.portalUrl).userId){var v=this.itemParams.folder;x=this.portalUrl+"/sharing/rest/content/users/"+x+(v&&"/"!==v?"/"+v:"")+"/items/"+this.currentGpItemId+"/refresh";x=u({url:x,
content:{f:"json"}},{usePost:!0})}else x=new a,x.resolve();return x.promise},_handleItemRefresh:function(x){},_readItem:function(){var x;if(x=t.id.findCredential(this.portalUrl).userId){var v=this.itemParams.folder;x=this.portalUrl+"/sharing/rest/content/users/"+x+(v&&"/"!==v?"/"+v:"")+"/items/"+this.currentGpItemId;x=u({url:x,content:{f:"json"}});return x.then(n.hitch(this,this._updateItem))}},getItemInfo:function(x){if(t.id.findCredential(this.portalUrl).userId)return x=this.portalUrl+"/sharing/rest/content/items/"+
x,u({url:x,content:{f:"json"}})},_gpJobStatus:function(x){x.jobParams=this.jobParams;x.resultParameter=this.resultParameter;x.returnProcessInfo=this.jobParams.returnProcessInfo;x.getResultLyrInfos=this.getResultLyrInfos;x.currentGpItemId=this.currentGpItemId;x.itemParams=this.itemParams;"esriJobFailed"===x.jobStatus||"esriJobSucceeded"===x.jobStatus||"esriJobTimedOut"===x.jobStatus?(x.messages&&(x.message=this._buildErrorMsg(x)),this._checkTimer&&(clearInterval(this._checkTimer),this._checkTimer=
null,this._gpJobComplete(x)),"esriJobFailed"!==x.jobStatus&&"esriJobTimedOut"!==x.jobStatus||this._deleteItem(!1)):-1===["esriJobCancelling","esriJobCancelled"].indexOf(x.jobStatus)||this._doCancelCleanup||(this._handleOnCancel(x),this._doCancelCleanup=!0);this.doSaveJobInfo&&this.saveJobInfo(x);this.emit("job-status",x);this._jobInfo=x;this.itemParams&&!this.isOutputLayerItemUpdated&&this._readItem()},_updateRefreshItem:function(x){var v=[],z=x[0];v.push(this._readItem(this.doRefreshItem));c(v).then(n.hitch(this,
function(A){z.outputLayerName=m.fromJson(this.jobParams[this.outputName]).serviceProperties.name;z.value.itemId=this.currentGpItemId;z.analysisInfo={toolName:this.toolName,secondaryOutputs:this.secondaryOutputs,jobParams:this.jobParams};this.doRefreshItem?this._refreshItem().always(n.hitch(this,function(){this.emit("job-result",z)})):this.emit("job-result",z)}),n.hitch(this,this._handleDeleteItemError))},_gpJobComplete:function(x){var v;"esriJobSucceeded"===x.jobStatus&&(x.jobParams=this.jobParams,
this.emit("job-success",x),c(this._getGpResultData(x)).then(n.hitch(this,function(z){z=q.filter(z,function(A){var F=!0;w.isDefined(A.value.empty)?F=A.value.empty:w.isDefined(A.value.url)||w.isDefined(A.value.itemId)?F=!1:w.isDefined(A.value.featureSet)?F=!1:this.jobParams.outputType===G.BDFSTEMPLATE&&(F=!1);if(!F)return A},this);0===z.length?(this.currentGpItemId&&this._deleteItem(!1),this.showGeoAnalyticsParams&&x.messages&&(x.message=this._buildErrorMsg(x)),this.emit("job-fail",{message:this.showGeoAnalyticsParams?
x.message:this.i18n.emptyResultInfoMsg,type:"warning",jobParams:this.jobParams})):(w.isDefined(this.itemParams)&&this.itemParams.properties&&this.itemParams.properties.jobStatus&&"processing"===this.itemParams.properties.jobStatus&&(this.itemParams.properties.jobStatus="completed"),q.forEach(z,function(A){if(A.value.featureSet&&!A.value.url)A.value.featureSet.spatialReference=A.value.layerDefinition.spatialReference;else if(A.value.url&&-1!==A.value.url.indexOf("/FeatureServer/")&&A.value.layerInfo&&
A.value.layerInfo.popupInfo){var F=A.value.url.match(/[0-9]+$/g)[0];this._popupInfo[F]=A.value.layerInfo.popupInfo}},this),v=z[0],v.results=z,this.jobParams.returnProcessInfo?this.gp.getResultData(x.jobId,"processInfo").then(n.hitch(this,function(A){var F=[];q.forEach(A.value,function(J){F.push(m.fromJson(J))},this);this.currentGpItemId?(this.itemParams.description=B.buildReport(F),this._updateRefreshItem(z)):(v.analysisReport=B.buildReport(F),v.outputLayerName=this.jobParams.resultName,this.emit("job-result",
v))})):this.currentGpItemId?this._updateRefreshItem(z):(v.outputLayerName=this.jobParams.resultName,this.emit("job-result",v)))})))},_gpJobFailed:function(x){var v=n.clone(x);v.jobParams=this.jobParams;this._checkTimer&&(clearInterval(this._checkTimer),this._checkTimer=null);x.messages&&(x.message=this._buildErrorMsg(x));this.emit("job-fail",v)},_getGpResultData:function(x){var v=[],z=[];"string"===typeof this.resultParameter?z.push(this.resultParameter):this.resultParameter instanceof Array&&(z=
this.resultParameter,this.secondaryOutputs&&this.secondaryOutputNames&&(z=q.filter(z,function(A){A=this.secondaryOutputs.indexOf(A);return-1===A?!0:x.jobParams.hasOwnProperty(this.secondaryOutputNames[A])},this)));q.forEach(z,function(A,F){v.push(this.gp.getResultData(x.jobId,A))},this);return v},_handleOnCancel:function(x){this.itemParams?this._deleteItem(!0,x):this.emit("job-cancel",x)},cancel:function(x){this.jobParams.outputType&&this.jobParams.outputType===G.FLAYERVIEW?(this._doDeleteViewResult=
!0,this._deleteItem(!0)):this.gp.cancelJob(x.jobId).then(n.hitch(this,function(v){"esriJobCancelled"===v.jobStatus&&this._handleOnCancel(v)}),function(v){})},checkJobStatus:function(x){this.signInPromise.then(n.hitch(this,function(){this.gp.setUpdateDelay(3E3);this._checkTimer=setInterval(n.hitch(this,this._checkStatus,x,n.hitch(this,this._gpJobStatus),n.hitch(this,this._gpJobFailed)),3E3)}))},_checkStatus:function(x,v,z){this.gp.checkJobStatus(x,v,z)},_deleteItem:function(x,v){var z;if((z=t.id.findCredential(this.portalUrl).userId)&&
this.itemParams){var A=w.isDefined(this.itemParams.folder)?this.itemParams.folder:"";z=this.portalUrl+"/sharing/rest/content/users/"+z+(A&&"/"!==A?"/"+A:"")+"/items/"+this.currentGpItemId+"/delete";u({url:z,content:{f:"json"}},{usePost:!0}).then(n.hitch(this,this._handleItemDelete,x,v),n.hitch(this,this._handleDeleteItemError))}},_handleItemDelete:function(x,v,z){x&&this.emit("job-cancel",v)},_handleDeleteItemError:function(x){this.emit("job-fail",{message:x.message+(x.details?x.details.toString():
""),jobParams:this.jobParams})},_initFolderStore:function(x,v){this._fportal=this.portalSelf?new x.Portal({url:this.portalUrl,self:this.portalSelf}):new x.Portal(this.portalUrl);this._fportal.signIn().then(n.hitch(this,function(z){this.portalUser=z;this.portalUser.getFolders().then(n.hitch(this,function(A){A=B.createFolderStore(A,this.portalUser.username);v.resolve(A)}))}))},getFolderStore:function(){var x=new a,v,z,A,F;this.folderStore?x.resolve(this.folderStore):this.signInPromise.then(n.hitch(this,
function(J){v=["../../arcgis/Portal"];z=this._counter++;A=this;this._rids&&this._rids.push(z);H(v,function(L){F=A._rids?q.indexOf(A._rids,z):-1;-1!==F&&(A._rids.splice(F,1),A._initFolderStore(L,x))})}));return x},_checkToolUrl:function(){var x=new a;this.analysisGpServer?(this._toolServiceUrl&&this.gp||this.set("toolServiceUrl",this.analysisGpServer+"/"+this.toolName),x.resolve({success:!0})):this._getSelf(this.portalUrl).then(n.hitch(this,function(v){(this.analysisGpServer=v.helperServices.analysis&&
v.helperServices.analysis.url?v.helperServices.analysis.url:null)&&this.set("toolServiceUrl",this.analysisGpServer+"/"+this.toolName);x.resolve({success:!0})}));return x},getCreditsEstimate:function(x,v,z){this.start=window.performance.now();var A,F,J,L,P,Q={};var Z=new a;this._checkToolUrl().then(n.hitch(this,function(ca){this._toolServiceUrl?L=this._toolServiceUrl:(J=this.portalUrl&&-1!==this.portalUrl.indexOf("dev")?"dev":this.portalUrl&&-1!==this.portalUrl.indexOf("qa")?"qa":"",L="http://analysis"+
J+".arcgis.com/arcgis/rest/services/tasks/GPServer/"+this.toolName);this.useGPCreditTask?(P=this.portalSelf||this._portal,z?(A=P&&P.helperServices&&P.helperServices.rasterAnalytics.url?P.helperServices.rasterAnalytics.url+"/EstimateRasterAnalysisCost":L.replace("/tasks/GPServer/"+x,"/RasterAnalysisTools/GPServer/EstimateRasterAnalysisCost"),Q.name=x,Q.parameters=v,ca=v.context,ca.cellSize=this.context.cellSize,!ca.extent&&this.context.extent&&(ca.extent=this.context.extent),ca={jobParams:{inputAnalysisTask:m.toJson(Q),
context:m.toJson(ca)},resultParameter:"outCost",def:Z,isGPCreditSync:!1}):(A=P&&P.helperServices&&P.helperServices.creditEstimation&&P.helperServices.creditEstimation.url?P.helperServices.creditEstimation.url+"/EstimateCredits":L.replace("/tasks/GPServer/"+x,"/Estimate/GPServer/EstimateCredits"),ca={jobParams:{taskName:x,taskParameters:m.toJson(v)},resultParameter:"creditEstimate",def:Z,isGPCreditSync:this._isGPCreditSync}),this._getGPCreditEstimate(A,ca)):(A=L.replace("/"+x,"/exts/Estimate/"+x),
F=n.mixin({f:"json"},v),u({url:A,content:F},{usePost:!0}).then(n.hitch(this,function(da){this.end=window.performance.now();console.log("Analysis Credit Estimator SOE Sync Time : "+(this.end-this.start)+" milliseconds");Z.resolve(da)}),function(da){Z.resolve(da)}))}));return Z.promise},_getGPCreditEstimate:function(x,v){this.creditGP=new r(x);this.creditGP.setUpdateDelay(1E3);v.isGPCreditSync?this.creditGP.execute(v.jobParams,n.hitch(this,this._getGPCreditResult,v.def,v.resultParameter,v.isGPCreditSync),
n.hitch(this,this._creditGPJobFailed,v.def,v.isGPCreditSync)):this.creditGP.submitJob(v.jobParams,n.hitch(this,this._getGPCreditResult,v.def,v.resultParameter,v.isGPCreditSync),n.hitch(this,this._creditGPJobFailed,v.def,v.isGPCreditSync),n.hitch(this,this._creditGPJobFailed,v.def,v.isGPCreditSync))},_getGPCreditResult:function(x,v,z,A){z?(this.end=window.performance.now(),console.log("Analysis Credit Estimator GP Sync Time : "+(this.end-this.start)+" milliseconds"),x.resolve(A[0].value)):this.creditGP.getResultData(A.jobId,
v).then(n.hitch(this,function(F,J){J&&J.value&&J.value.credits&&(J.value.cost=J.value.credits);this.end=window.performance.now();console.log("Analysis Credit Estimator GP Async Time : "+(this.end-this.start)+" milliseconds");F.resolve(J.value)},x),n.hitch(this,function(F,J){F.resolve(J)},x))},_creditGPJobFailed:function(x,v,z){v?!z.code||400!==z.code&&-1===z.code.indexOf("IdentityManagerBase.")?0===z.status&&z.message&&(z.messages=[z.message],x.resolve(this._buildErrorMsg(z))):(z.messages=z.details,
x.resolve(z)):"esriJobFailed"!==z.jobStatus&&"esriJobCancelled"!==z.jobStatus||x.resolve(this._buildErrorMsg(z))},_signIn:function(x,v){var z,A;this.signInPromise=new a;if(v){v=["../../arcgis/Portal"];var F=this._counter++;var J=this;this._rids&&this._rids.push(F);H(v,n.hitch(this,function(L){z=J._rids?q.indexOf(J._rids,F):-1;-1!==z&&(J._rids.splice(z,1),this._portal=this.portalSelf?new L.Portal({url:x,self:this.portalSelf}):new L.Portal(x),this._portal.signIn().then(n.hitch(this,function(P){this.portalUser=
P;this._portal.helperServices&&this._portal.helperServices.analysis&&this._portal.helperServices.analysis.url?(this.analysisGpServer=this._portal.helperServices.analysis.url,this.showGeoAnalyticsParams&&this._portal.helperServices.geoanalytics&&(this.analysisGpServer=this._portal.helperServices.geoanalytics.url),u({url:this.analysisGpServer,content:{f:"json"},callbackParamName:"callback"}).then(n.hitch(this,function(Q){A=t.id.findCredential(this.analysisGpServer);this.signInPromise.resolve(A)}),n.hitch(this,
function(Q){this.signInPromise.reject(Q)}))):this.signInPromise.resolve(P)}),n.hitch(this,this._handleSignInError)))}))}else u({url:x,content:{f:"json"},callbackParamName:"callback"}).then(n.hitch(this,function(L){L=t.id.findCredential(x);if(w.isDefined(L)){var P=t.id.findServerInfo(this._toolServiceUrl);w.isDefined(P)&&w.isDefined(P.owningSystemUrl)&&(this.portalUrl=P.owningSystemUrl);this.signInPromise.resolve(L)}else t.id.getCredential(x).then(n.hitch(this,function(Q){Q=t.id.findCredential(x);
P=t.id.findServerInfo(this._toolServiceUrl);w.isDefined(P)&&w.isDefined(P.owningSystemUrl)&&(this.portalUrl=P.owningSystemUrl);this.signInPromise.resolve(Q)}),n.hitch(this,this._handleSignInError))}),n.hitch(this,this._handleSignInError));return this.signInPromise},_handleSignInError:function(x){this.emit("job-fail",{message:this.i18n.analysisSignInErrorMsg,messageCode:"AB_0003"});this.signInPromise.reject(x)},_buildErrorMsg:function(x){var v="",z=[],A,F;this.errorHelpMap||this._initErrorHelpMap();
z=q.filter(x.messages,function(J){if(("esriJobMessageTypeError"===J.type||"esriJobMessageTypeWarning"===J.type)&&-1!==J.description.indexOf("messageCode"))return J.description},this);0<z.length&&q.forEach(z,function(J){try{A=m.fromJson(J.description)}catch(L){A=J.description}F="";"esriJobMessageTypeWarning"===J.type&&(x.type="warning");A.messageCode?(F=w.isDefined(this.i18n[A.messageCode])?this.i18n[A.messageCode]:A.message,F=w.isDefined(A.params)?g.substitute(F,A.params):F,v+=F+"\x26nbsp;",(J=this._addLearnMoreErrorLink(A.messageCode))&&
(v+=J)):A.error&&A.error.messageCode?(F=w.isDefined(this.i18n[A.error.messageCode])?this.i18n[A.error.messageCode]:A.error.message,F=w.isDefined(A.error.params)?g.substitute(F,A.error.params):F,v+=F+"\x26nbsp;",(J=this._addLearnMoreErrorLink(A.error.messageCode))&&(v+=J)):v+=A+"\x26nbsp;"},this);return v},_toolServiceUrlSetter:function(x){this._toolServiceUrl=x;this.gp=new r(x)},_setToolServiceUrlAttr:function(x){this._toolServiceUrl=x;this.gp=new r(x)},checkCreditLimitsAttr:function(x){this.checkCreditLimits=
x},saveJobInfo:function(x){if(this.doSaveJobInfo&&this.currentGpItemId&&-1!==q.indexOf(["esriJobSucceeded"],x.jobStatus)){n.mixin(x.jobParams,{extentCheck:this._useExtentCheck&&this._useExtentCheck.get("checked")});q.forEach(x.messages,function(A){A.description=B.safetagsReplace(A.description)},this);x={toolName:this.toolName,jobParams:x.jobParams,timestamp:Date.now(),portalUrl:this.portalUrl,jobInfo:{jobId:x.jobId,jobStatus:x.jobStatus,messages:x.messages,analysisServer:"bigdata"===this.analysisMode?
"geoanalytics":"default"===this.analysisMode?"standard":this.analysisMode}};"CopyToDataStore"===this.toolName&&(x.jobParams.isSpatioTemporalDataStore=this._isSpatioTemporalDataStore);"bigdata"===this.analysisMode&&x.jobParams.timeStepReference&&(x.jobParams.timeReferenceType=this.get("timeReferenceType"));"bigdata"===this.analysisMode&&x.jobParams.timeBoundaryReference&&(x.jobParams.timeBoundaryReferenceType=this.get("timeBoundaryReferenceType"));for(z in x.jobParams)if(x.jobParams.hasOwnProperty(z)&&
w.isDefined(x.jobParams[z])){if("object"===typeof x.jobParams[z]&&x.jobParams[z].serviceToken||"string"===typeof x.jobParams[z]&&-1!==x.jobParams[z].indexOf("serviceToken")){var v="string"===typeof x.jobParams[z]?m.fromJson(x.jobParams[z]):x.jobParams[z];v&&v.serviceToken&&(delete v.serviceToken,x.jobParams[z]="string"===typeof x.jobParams[z]?m.toJson(v):v)}if("object"===typeof x.jobParams[z]&&!n.isArray(x.jobParams[z])&&x.jobParams[z].filter||"string"===typeof x.jobParams[z]&&-1!==x.jobParams[z].search(/[<>]/g))"object"===
typeof x.jobParams[z]&&x.jobParams[z].filter&&!n.isArray(x.jobParams[z])?x.jobParams[z].filter=B.safetagsReplace(x.jobParams[z].filter):"string"===typeof x.jobParams[z]&&-1!==x.jobParams[z].search(/[<>]/g)&&(x.jobParams[z]=B.safetagsReplace(x.jobParams[z]))}var z=t.id.findCredential(this.portalUrl);this.currentGpItemId&&(z={id:this.currentGpItemId,folderId:this.itemParams.folder,owner:z.userId},C.addToItemResource(z,x));this.doSaveInStorage&&C.addToStorage(x)}},_initErrorHelpMap:function(){if(this.isSingleTenant){var x=
H.toUrl("./help/errorhelpmap_enterprise.json");u({url:x}).then(n.hitch(this,function(v){this.errorHelpMap=v.map}))}},_addLearnMoreErrorLink:function(x){if(this.isSingleTenant){var v=this.portalSelf&&this.portalSelf.helpMap&&this.portalSelf.helpMap.m;x=v&&v[this.errorHelpMap[x]];v=this&&this.portalSelf?this.portalSelf.helpBase:null;var z=this.analysisGpServer&&-1!==this.analysisGpServer.indexOf("dev")?"dev":this.analysisGpServer&&-1!==this.analysisGpServer.indexOf("qa")?"uat":"";if(w.isDefined(x)){var A=
"http://doc"+z+".arcgis.com/en/arcgis-online/analyze/"+x;this.isSingleTenant&&v?A=v+x:this.isSingleTenant&&!v&&(A="http://server"+z+".arcgis.com/en/portal/latest/use/"+x)}A&&(A="\x3cbr/\x3e\x3cbr/\x3e\x3cdiv class\x3d'esriHelpPopup'\x3e\x3ca class\x3d'action zoomTo' href\x3d'"+A+"' target\x3d'_help'\x3e"+this.i18n.learnMore+"\x3c/a\x3e\x3c/div\x3e\x3cbr/\x3e\x3cbr/\x3e");return A}},getLearnMoreLink:function(x){return x?this._addLearnMoreErrorLink(x):""},_byPassCreditCheck:function(x){return-1!==this._freeGPTools.indexOf(x)}});
l("extend-esri")&&n.setObject("dijit.analysis.AnalysisBase",k,t);return k})},"esri/tasks/Geoprocessor":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/Deferred dojo/_base/json dojo/has dojo/io-query ../kernel ../request ../deferredUtils ../geometry/normalizeUtils ./Task ./FeatureSet ./JobInfo ./GPMessage ./LinearUnit ./DataFile ./RasterData ./Date ./ParameterValue ./GPResultImageLayer ../layers/ArcGISDynamicMapServiceLayer ../layers/MapImage".split(" "),function(H,
k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G){H=H(g,{declaredClass:"esri.tasks.Geoprocessor",_eventMap:{"execute-complete":["results","messages"],"get-result-data-complete":["result"],"get-result-image-complete":["mapImage"],"get-result-image-layer-complete":["layer"],"job-cancel":["jobInfo"],"job-complete":["jobInfo"],"status-update":["jobInfo"]},constructor:function(x){this._jobUpdateHandler=k.hitch(this,this._jobUpdateHandler);this._getJobStatus=k.hitch(this,this._getJobStatus);this._getResultDataHandler=
k.hitch(this,this._getResultDataHandler);this._getResultImageHandler=k.hitch(this,this._getResultImageHandler);this._executeHandler=k.hitch(this,this._executeHandler);this._updateTimers=[];this.registerConnectEvents()},updateDelay:1E3,processSpatialReference:null,outputSpatialReference:null,outSpatialReference:null,setUpdateDelay:function(x){this.updateDelay=x},setProcessSpatialReference:function(x){this.processSpatialReference=x},setOutputSpatialReference:function(x){this._setOutSR(x)},setOutSpatialReference:function(x){this._setOutSR(x)},
__msigns:[{n:"execute",c:3,a:[{i:0,p:["*"]}],e:2,f:1},{n:"submitJob",c:4,a:[{i:0,p:["*"]}],e:3}],_setOutSR:function(x){this.outSpatialReference=this.outputSpatialReference=x},_getOutSR:function(){return this.outSpatialReference||this.outputSpatialReference},_gpEncode:function(x,v,z){for(var A in x){var F=x[A];k.isArray(F)?x[A]=m.toJson(n.map(F,function(J){return this._gpEncode({item:J},!0).item},this)):F instanceof Date&&(x[A]=F.getTime())}return this._encode(x,v,z)},_decode:function(x){var v=x.dataType,
z=new y(x);if(-1!==n.indexOf(["GPBoolean","GPDouble","GPLong","GPString"],v))return z;if("GPLinearUnit"===v)z.value=new t(z.value);else if("GPFeatureRecordSetLayer"===v||"GPRecordSet"===v)z.value=new d(z.value);else if("GPDataFile"===v)z.value=new w(z.value);else if("GPDate"===v)x=z.value,k.isString(x)?z.value=new r({date:x}):z.value=new Date(x);else if("GPRasterData"===v||"GPRasterDataLayer"===v)x=x.value.mapImage,z.value=x?new G(x):new u(z.value);else if(-1!==v.indexOf("GPMultiValue:")){var A=v.split(":")[1];
x=z.value;z.value=n.map(x,function(F){return this._decode({paramName:"_name",dataType:A,value:F}).value},this)}else console.log(this.declaredClass+" : GP Data type not handled. : "+z.dataType),z=null;return z},submitJob:function(x,v,z,A,F){var J=this._getOutSR(),L=F.assembly;x=this._gpEncode(k.mixin({},this._url.query,{f:"json","env:outSR":J?J.wkid||m.toJson(J.toJson()):null,"env:processSR":this.processSpatialReference?this.processSpatialReference.wkid||m.toJson(this.processSpatialReference.toJson()):
null},x),null,L&&L[0]);var P=this._jobUpdateHandler,Q=this._errorHandler;return c({url:this._url.path+"/submitJob",content:x,callbackParamName:"callback",load:function(Z,ca){P(Z,ca,!1,v,z,F.dfd)},error:function(Z){Q(Z,A,F.dfd)}})},_jobUpdateHandler:function(x,v,z,A,F,J){var L=x.jobId;v=new h(x);this._successHandler([v],"onStatusUpdate",F,z&&J);if(!z)switch(clearTimeout(this._updateTimers[L]),this._updateTimers[L]=null,J&&J.progress(v),x.jobStatus){case h.STATUS_SUBMITTED:case h.STATUS_EXECUTING:case h.STATUS_WAITING:case h.STATUS_NEW:var P=
this._getJobStatus;this._updateTimers[L]=setTimeout(function(){P(L,z,A,F,J)},this.updateDelay);break;default:this._successHandler([v],"onJobComplete",A,J)}},_getJobStatus:function(x,v,z,A,F){var J=this._jobUpdateHandler;c({url:this._url.path+"/jobs/"+x,content:k.mixin({},this._url.query,{f:"json"}),callbackParamName:"callback",load:function(L,P){J(L,P,v,z,A,F)},error:this._errorHandler})},_getResultDataHandler:function(x,v,z,A,F){try{var J=this._decode(x);this._successHandler([J],"onGetResultDataComplete",
z,F)}catch(L){this._errorHandler(L,A,F)}},getResultData:function(x,v,z,A){var F=this._getResultDataHandler,J=this._errorHandler,L=new q(f._dfdCanceller);L._pendingDfd=c({url:this._url.path+"/jobs/"+x+"/results/"+v,content:k.mixin({},this._url.query,{f:"json",returnType:"data"}),callbackParamName:"callback",load:function(P,Q){F(P,Q,z,A,L)},error:function(P){J(P,A,L)}});return L},checkJobStatus:function(x,v,z){var A=this._jobUpdateHandler,F=this._errorHandler,J=new q(f._dfdCanceller);J._pendingDfd=
c({url:this._url.path+"/jobs/"+x,content:k.mixin({},this._url.query,{f:"json"}),callbackParamName:"callback",load:function(L,P){A(L,P,!0,null,v,J)},error:function(L){F(L,z,J)}});return J},cancelJob:function(x,v,z){var A=this._errorHandler,F=new q(f._dfdCanceller);F._pendingDfd=c({url:this._url.path+"/jobs/"+x+"/cancel",content:k.mixin({},this._url.query,{f:"json"}),callbackParamName:"callback",load:k.hitch(this,function(J,L){this._successHandler([J],"onJobCancel",v,F)}),error:function(J){A(J,z,F)}});
return F},execute:function(x,v,z,A){var F=this._getOutSR(),J=A.assembly;x=this._gpEncode(k.mixin({},this._url.query,{f:"json","env:outSR":F?F.wkid||m.toJson(F.toJson()):null,"env:processSR":this.processSpatialReference?this.processSpatialReference.wkid||m.toJson(this.processSpatialReference.toJson()):null},x),null,J&&J[0]);var L=this._executeHandler,P=this._errorHandler;return c({url:this._url.path+"/execute",content:x,callbackParamName:"callback",load:function(Q,Z){L(Q,Z,v,z,A.dfd)},error:function(Q){P(Q,
z,A.dfd)}})},_executeHandler:function(x,v,z,A,F){try{var J=x.results,L,P=x.messages;var Q=0;for(L=J.length;Q<L;Q++)J[Q]=this._decode(J[Q]);Q=0;for(L=P.length;Q<L;Q++)P[Q]=new p(P[Q]);this._successHandler([J,P],"onExecuteComplete",z,F)}catch(Z){this._errorHandler(Z,A,F)}},_getResultImageHandler:function(x,v,z,A,F){try{var J=this._decode(x);this._successHandler([J],"onGetResultImageComplete",z,F)}catch(L){this._errorHandler(L,A,F)}},getResultImage:function(x,v,z,A,F){var J=this._getResultImageHandler,
L=this._errorHandler;z=this._gpEncode(k.mixin({},this._url.query,{f:"json"},z.toJson()));var P=new q(f._dfdCanceller);P._pendingDfd=c({url:this._url.path+"/jobs/"+x+"/results/"+v,content:z,callbackParamName:"callback",load:function(Q,Z){J(Q,Z,A,F,P)},error:function(Q){L(Q,F,P)}});return P},cancelJobStatusUpdates:function(x){clearTimeout(this._updateTimers[x]);this._updateTimers[x]=null},getResultImageLayer:function(x,v,z,A){if(null==v){var F=this._url.path.indexOf("/GPServer/");x=this._url.path.substring(0,
F)+"/MapServer/jobs/"+x}else x=this._url.path+"/jobs/"+x+"/results/"+v;this._url.query&&(x+="?"+b.objectToQuery(this._url.query));v=null==v?new C(x,{imageParameters:z}):new B(x,{imageParameters:z},!0);this.onGetResultImageLayerComplete(v);A&&A(v);return v},onStatusUpdate:function(){},onJobComplete:function(){},onExecuteComplete:function(){},onGetResultDataComplete:function(){},onGetResultImageComplete:function(){},onGetResultImageLayerComplete:function(){},onJobCancel:function(){}});e._createWrappers(H);
l("extend-esri")&&k.setObject("tasks.Geoprocessor",H,a);return H})},"esri/tasks/JobInfo":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel","./GPMessage"],function(H,k,n,q,m){H=H(null,{declaredClass:"esri.tasks.JobInfo",constructor:function(l){this.messages=[];k.mixin(this,l);l=this.messages;var b,a=l.length;for(b=0;b<a;b++)l[b]=new m(l[b])},jobId:"",jobStatus:""});k.mixin(H,{STATUS_CANCELLED:"esriJobCancelled",STATUS_CANCELLING:"esriJobCancelling",STATUS_DELETED:"esriJobDeleted",
STATUS_DELETING:"esriJobDeleting",STATUS_EXECUTING:"esriJobExecuting",STATUS_FAILED:"esriJobFailed",STATUS_NEW:"esriJobNew",STATUS_SUBMITTED:"esriJobSubmitted",STATUS_SUCCEEDED:"esriJobSucceeded",STATUS_TIMED_OUT:"esriJobTimedOut",STATUS_WAITING:"esriJobWaiting"});n("extend-esri")&&k.setObject("tasks.JobInfo",H,q);return H})},"esri/tasks/GPMessage":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(H,k,n,q){H=H(null,{declaredClass:"esri.tasks.GPMessage",constructor:function(m){k.mixin(this,
m)}});k.mixin(H,{TYPE_INFORMATIVE:"esriJobMessageTypeInformative",TYPE_PROCESS_DEFINITION:"esriJobMessageTypeProcessDefinition",TYPE_PROCESS_START:"esriJobMessageTypeProcessStart",TYPE_PROCESS_STOP:"esriJobMessageTypeProcessStop",TYPE_WARNING:"esriJobMessageTypeWarning",TYPE_ERROR:"esriJobMessageTypeError",TYPE_EMPTY:"esriJobMessageTypeEmpty",TYPE_ABORT:"esriJobMessageTypeAbort"});n("extend-esri")&&k.setObject("tasks.GPMessage",H,q);return H})},"esri/tasks/LinearUnit":function(){define(["dojo/_base/declare",
"dojo/_base/lang","dojo/has","../kernel"],function(H,k,n,q){H=H(null,{declaredClass:"esri.tasks.LinearUnit",constructor:function(m){m&&k.mixin(this,m)},distance:0,units:null,toJson:function(){var m={};this.distance&&(m.distance=this.distance);this.units&&(m.units=this.units);return m}});n("extend-esri")&&k.setObject("tasks.LinearUnit",H,q);return H})},"esri/tasks/DataFile":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(H,k,n,q){H=H(null,{declaredClass:"esri.tasks.DataFile",
constructor:function(m){m&&k.mixin(this,m)},url:null,itemID:null,toJson:function(){var m={};this.url&&(m.url=this.url);this.itemID&&(m.itemID=this.itemID);return m}});n("extend-esri")&&k.setObject("tasks.DataFile",H,q);return H})},"esri/tasks/RasterData":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(H,k,n,q){H=H(null,{declaredClass:"esri.tasks.RasterData",constructor:function(m){m&&k.mixin(this,m)},url:null,format:null,itemID:null,toJson:function(){var m=
{};this.url&&(m.url=this.url);this.format&&(m.format=this.format);this.itemID&&(m.itemID=this.itemID);return m}});n("extend-esri")&&k.setObject("tasks.RasterData",H,q);return H})},"esri/tasks/Date":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/date/locale","dojo/has","../kernel"],function(H,k,n,q,m){H=H(null,{declaredClass:"esri.tasks.Date",constructor:function(l){l&&(l.format&&(this.format=l.format),this.date=n.parse(l.date,{selector:"date",datePattern:this.format}))},date:new Date,
format:"EEE MMM dd HH:mm:ss zzz yyyy",toJson:function(){return{date:n.format(this.date,{selector:"date",datePattern:this.format}),format:this.format}}});q("extend-esri")&&k.setObject("tasks.Date",H,m);return H})},"esri/tasks/ParameterValue":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(H,k,n,q){H=H(null,{declaredClass:"esri.tasks.ParameterValue",constructor:function(m){k.mixin(this,m)}});n("extend-esri")&&k.setObject("tasks.ParameterValue",H,q);return H})},
"esri/tasks/GPResultImageLayer":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/json dojo/has dojo/io-query ../kernel ../layers/ArcGISDynamicMapServiceLayer".split(" "),function(H,k,n,q,m,l,b){H=H(b,{declaredClass:"esri.tasks._GPResultImageLayer",constructor:function(a,c){c&&c.imageParameters&&c.imageParameters.extent&&(this.initialExtent=this.fullExtent=c.imageParameters.extent,this.spatialReference=this.initialExtent.spatialReference);this.getImageUrl=k.hitch(this,this.getImageUrl);
this.loaded=!0;this.onLoad(this)},getImageUrl:function(a,c,f,e){var g=a.spatialReference.wkid;e(this._url.path+"?"+m.objectToQuery(k.mixin(this._params,{f:"image",bbox:n.toJson(a.toJson()),bboxSR:g,imageSR:g,size:c+","+f})))}});q("extend-esri")&&k.setObject("tasks._GPResultImageLayer",H,l);return H})},"esri/dijit/analysis/utils":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/event dojo/_base/fx dojo/_base/json dojo/_base/kernel dojo/dom-attr dojo/has dojo/i18n dojo/io-query dojo/i18n!../../nls/jsapi dojo/json dojo/string dojo/query dojo/date/locale dojo/dom-style dojo/dom-class dojo/dom-construct dojo/Deferred dojo/promise/all dojo/fx/easing dojo/number dojo/_base/window dojo/when dojo/dom dojo/on dojo/data/ItemFileWriteStore dojo/topic dojo/store/Memory dojox/mvc/equals dijit/registry dijit/Dialog dijit/form/CheckBox ../../kernel ../../lang ../../units ../../request ./HelpWindow ../../tasks/query ../../dijit/BrowseItems ../../layers/FeatureLayer ./PluginAnalysisLayers ../../tasks/Geoprocessor ../../dijit/SingleFilter ./FeatureRecordSetLayer ./PluginLayers ./PCSList ./ItemTypes ../../layers/ArcGISImageServiceLayer ../../layers/RasterXLayer ../../layers/RasterFunction ./AnalysisRegistry ../RasterFunctionEditor/utils".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G,x,v,z,A,F,J,L,P,Q,Z,ca,da,ea,fa,K,V,aa,Y,I,O,E,N,R,W,ha,oa,ma,T,ba,na,ia,pa){H={};k.mixin(H,{_helpDialog:null,systemRFTGroupName:"Raster Function Templates",i18n:null,UNITSMAP:{Feet:"esriFeet",Yards:"esriYards",Miles:"esriMiles",Meters:"esriMeters",Kilometers:"esriKilometers",NauticalMiles:"esriNauticalMiles"},initHelpLinks:function(D,M,X){if(D){var U=Z.byNode(D),ka=U?U.get("helpFileName"):X&&X.helpFileName?X.helpFileName:null,S=U?U.get("isSingleTenant"):
X&&X.isSingleTenant?X.isSingleTenant:!1,ja=ia.Modes.standard,la=U&&U.portalSelf?U.portalSelf.helpBase:X&&X.helpBase?X.helpBase:null,qa=U&&U.portalSelf;this._helpDialog||(this._helpDialog=new aa({isPortal:S,portalSelf:qa}));U&&(U.showGeoAnalyticsParams||U.showBigData)||X&&X.analysisMode&&X.analysisMode===ia.Modes.Bigdata?(ka+="_bd",ja=ia.Modes.Bigdata):X&&X.analysisMode&&"raster"===X.analysisMode&&(ka+="_ra",ja=ia.Modes.Raster);t("[esriHelpTopic]",D).forEach(function(ta,Ba,wa){ta&&(u.set(ta,"display",
fa.isDefined(M)&&!0!==M?"none":""),fa.isDefined(ta._helpClickHandler)&&(ta._helpClickHandler.remove(),ta._helpClickHandler=null),ta._helpClickHandler=F(ta,"click",k.hitch(this,function(ua){m.stop(ua);X&&X.showHelpFromUrl&&X.helpUrl?this._helpDialog.show(ua,{showHelpFromUrl:X.showHelpFromUrl,helpUrl:X.helpUrl}):this._helpDialog.show(ua,{helpId:c.get(ta,"esriHelpTopic"),helpFileName:ka,analysisGpServer:X&&X.analysisGpServer?X.analysisGpServer:null,helpParentNode:D,isPortal:S,analysisMode:ja,helpBase:la,
portalSelf:U&&U.portalSelf})})))},this)}},constructAnalysisFeatColl:function(D){var M={},X;M.featureCollection=D.layerDefinition;for(X in M.featureCollection)M.featureCollection.hasOwnProperty(X)&&"objectIdField"===X&&(M.featureCollection.objectIdFieldName=k.clone(M.featureCollection.objectIdField),delete M.featureCollection.objectIdField);M.featureCollection.features=D.featureSet.features;return M},constructAnalysisInputLyrObj:function(D,M,X){if(D instanceof T||"Image Service"===D.type||"esri.layers.RasterXLayer"===
D.declaredClass)return pa.getRasterJsonFromLayer(D);var U={},ka="";fa.isDefined(X)||(X=!0);if(D.getMap)var S=D.getMap();else D._map&&(S=D._map);if(D.url&&!D._collection)U={url:D.url},this.isHostedService(D.url),D.getDefinitionExpression&&D.getDefinitionExpression()?U.filter=D.getDefinitionExpression():fa.isDefined(D.definitionExpression)&&""!==D.definitionExpression&&(U.filter=D.definitionExpression),D.useMapTime&&D.timeInfo&&S&&S.timeExtent&&X&&(S.timeExtent.startTime?(ka+=S.timeExtent.startTime.getTime(),
S.timeExtent.endTime&&(ka+=","+S.timeExtent.endTime.getTime())):S.timeExtent.endTime&&(ka+=S.timeExtent.endTime.getTime()),ka&&(U.time=ka)),D.credential&&(U.serviceToken=D.credential.token),-1!==U.url.indexOf("?")&&(X=U.url.substring(U.url.indexOf("?")+1,U.url.length),X=g.queryToObject(X),k.mixin(U,X),U.url=U.url.substring(0,U.url.indexOf("?")));else if(!D.url||D._collection)try{U=D.toJson()}catch(ja){D._json=h.parse(D._json),U=D.toJson()}U.name=D.name;M&&(U=new W(U));return U},formatDate:function(D){return w.format(D,
{datePattern:"yyyy-MM-dd",selector:"date"})+" "+w.format(D,{selector:"time",timePattern:"HH:mm:ss"})},isHostedService:function(D){if(!D)return!1;var M=-1!==D.indexOf(".arcgis.com/");D=-1!==D.indexOf("/services")||-1!==D.indexOf("//tiles")||-1!==D.indexOf("//features");return M&&D},isPortalHostedService:function(D){return D?-1!==D.toLowerCase().indexOf("/hosted/"):!1},isTimeEnabled:function(D){var M=10.2<=D.version&&D._useStandardizedQueries;return D.useMapTime&&D.timeInfo&&(M||10.2<=D.version)||fa.isDefined(D.time)},
isTimeInstantLayer:function(D){return fa.isDefined(D.timeInfo)&&fa.isDefined(D.timeInfo.startTimeField)&&!fa.isDefined(D.timeInfo.endTimeField)||fa.isDefined(D.time)&&fa.isDefined(D.time.timeType)&&"instant"===D.time.timeType},buildReport:function(D,M){var X="";M||(M={},k.mixin(M,d.analysisMsgCodes));n.forEach(D,function(U,ka){if("string"===typeof U.message){var S=fa.isDefined(M[U.messageCode])?M[U.messageCode]:U.message;X+=U.style.substring(0,U.style.indexOf("\x3c/"))+(this._isEmptyObject(U.params)?
S:p.substitute(S,U.params))+U.style.substring(U.style.indexOf("\x3c/"))}else if(k.isArray(U.message)){var ja=[];var la=k.clone(U.style);n.forEach(U.message,function(qa,ta){la=la.replace(/<\//,"${"+ta+"}");S=fa.isDefined(M[U.messageCode+"_"+ta])?M[U.messageCode+"_"+ta]:qa;S=this._isEmptyObject(U.params)?S:p.substitute(S,U.params);"string"===typeof S&&(S=this.safetagsReplace(S));ja.push(S+"\x3c/")},this);la=p.substitute(la,ja);X+=la}},this);return X},getLayerFeatureCount:function(D,M){var X=new Y,U=
new B;M||(M={});X.geometry=M.geometry;X.geometryType=M.geometryType||"esriGeometryEnvelope";D.url||X.geometry?(D.url&&(X.where=M.where||"1\x3d1",D.getDefinitionExpression&&D.getDefinitionExpression()&&!M.where?X.where=D.getDefinitionExpression():fa.isDefined(D.definitionExpression)&&""!==D.definitionExpression&&!M.where&&(X.where=D.definitionExpression)),U=D.queryCount(X)):U.resolve(D.graphics.length);return U.promise},createPolygonFeatureCollection:function(D){var M={layerDefinition:null,featureSet:{features:[],
geometryType:ia.GeometryTypes.Polygon}};M.layerDefinition={currentVersion:10.2,copyrightText:"",defaultVisibility:!0,relationships:[],isDataVersioned:!1,supportsRollbackOnFailureParameter:!0,supportsStatistics:!0,supportsAdvancedQueries:!0,geometryType:ia.GeometryTypes.Polygon,minScale:0,maxScale:0,objectIdField:"OBJECTID",templates:[],type:"Feature Layer",displayField:"TITLE",visibilityField:"VISIBLE",name:D,hasAttachments:!1,typeIdField:"TYPEID",capabilities:"Query",allowGeometryUpdates:!0,htmlPopupType:"",
hasM:!1,hasZ:!1,globalIdField:"",supportedQueryFormats:"JSON",hasStaticData:!1,maxRecordCount:-1,indexes:[],types:[],drawingInfo:{renderer:{type:"simple",symbol:{color:[0,0,0,255],outline:{color:[0,0,0,255],width:3,type:"esriSLS",style:"esriSLSSolid"},type:"esriSFS",style:"esriSFSNull"},label:"",description:""},transparency:0,labelingInfo:null,fixedSymbols:!0},fields:[{alias:"OBJECTID",name:"OBJECTID",type:"esriFieldTypeOID",editable:!1},{alias:"Title",name:"TITLE",length:50,type:"esriFieldTypeString",
editable:!0},{alias:"Visible",name:"VISIBLE",type:"esriFieldTypeInteger",editable:!0},{alias:"Description",name:"DESCRIPTION",length:1073741822,type:"esriFieldTypeString",editable:!0},{alias:"Type ID",name:"TYPEID",type:"esriFieldTypeInteger",editable:!0}]};return M},createPointFeatureCollection:function(D){var M={layerDefinition:null,featureSet:{features:[],geometryType:ia.GeometryTypes.Point}};M.layerDefinition={objectIdField:"OBJECTID",templates:[],type:"Feature Layer",drawingInfo:{renderer:{field1:"TYPEID",
type:"simple",symbol:{height:24,xoffset:0,yoffset:12,width:24,contentType:"image/png",type:"esriPMS",url:"http://static.arcgis.com/images/Symbols/Basic/GreenStickpin.png"},description:"",value:"0",label:"Stickpin"}},displayField:"TITLE",visibilityField:"VISIBLE",name:D,hasAttachments:!1,typeIdField:"TYPEID",capabilities:"Query",types:[],geometryType:ia.GeometryTypes.Point,fields:[{alias:"OBJECTID",name:"OBJECTID",type:"esriFieldTypeOID",editable:!1},{alias:"Title",name:"TITLE",length:50,type:"esriFieldTypeString",
editable:!0},{alias:"Visible",name:"VISIBLE",type:"esriFieldTypeInteger",editable:!0},{alias:"Description",name:"DESCRIPTION",length:1073741822,type:"esriFieldTypeString",editable:!0},{alias:"Type ID",name:"TYPEID",type:"esriFieldTypeInteger",editable:!0}]};return M},createFolderStore:function(D,M){var X=new J({data:{identifier:"id",label:"name",items:[]}});X.newItem({name:M,id:""});n.forEach(D,function(U){X.newItem({name:U.title,id:U.id})});return X},setupFoldersUI:function(D){D.folderSelect.set("store",
D.folderStore);D.folderSelect.set("required",!0);D.folderSelect.set("searchAttr","name");fa.isDefined(D.folderId)?D.folderStore.get(D.folderId).then(k.hitch(this,function(M){fa.isDefined(M)?D.folderSelect.set("item",M):D.folderStore.get("").then(function(X){D.folderSelect.set("item",X)},this)})):D.folderName?D.folderStore.fetch({query:{name:D.folderName},onComplete:k.hitch(this,function(M){fa.isDefined(M)&&0<M.length?D.folderSelect.set("item",M[0]):D.folderStore.get("").then(function(X){D.folderSelect.set("item",
X)},this)})}):D.username?D.folderSelect.set("displayedValue",D.username):D.folderStore.get("").then(function(M){D.folderSelect.set("item",M)},this)},_isEmptyObject:function(D){for(var M in D)if(D.hasOwnProperty(M))return!1;return!0},validateServiceName:function(D,M){var X=/(:|&|<|>|%|#|\?|\\|"|\/|\+|=|\*|@|'|;|\||,)/g.test(D),U=!0,ka=!0;if(fa.isDefined(M)&&M.textInput)var S=M.textInput;fa.isDefined(M)&&fa.isDefined(M.isItem)&&(ka=M.isItem);this.initI18n();if(0===D.length||0===p.trim(D).length){var ja=
this.i18n.requiredValue;U=!1}else if(X)ja=this.i18n.invalidServiceName,U=!1;else if(ka&&98<D.length)ja=this.i18n.invalidServiceNameLength,U=!1;else if(ka&&170<encodeURIComponent(D).length){for(D+="";170<encodeURIComponent(D).length;)D=D.substring(0,D.length-1);ja=p.substitute(this.i18n.suggestedServiceNameLength,{count:D.length});U=!1}S&&!U&&S.set("invalidMessage",ja);return U},getStepNumber:function(D){t(".esriAnalysisNumberLabel",D).forEach(function(M,X){X=this._getNumberLabel(X);c.set(M,"innerHTML",
X)},this)},_getNumberLabel:function(D){var M="";this.initI18n();switch(D){case 0:M=this.i18n.oneLabel;break;case 1:M=this.i18n.twoLabel;break;case 2:M=this.i18n.threeLabel;break;case 3:M=this.i18n.fourLabel;break;case 4:M=this.i18n.fiveLabel;break;case 5:M=this.i18n.sixLabel;break;case 6:M=this.i18n.sevenLabel;break;case 7:M=this.i18n.eightLabel;break;case 8:M=this.i18n.nineLabel;break;case 9:M=this.i18n.tenLabel;break;case 10:M=this.i18n.elevenLabel;break;case 11:M=this.i18n.twelveLabel;break;case 12:M=
this.i18n.thirteenLabel}return M},populateAnalysisLayers:function(D,M,X,U){if(D){var ka=[],S=D.get(M);M=U&&U.layerSelect?U.layerSelect:D._analysisSelect;D.rerun&&!S&&(U||(U={}),U.chooseBlank=!0);D._titleRow&&u.set(D._titleRow,"display","none");D._analysisLabelRow&&u.set(D._analysisLabelRow,"display","table-row");D._selectAnalysisRow&&(u.set(D._selectAnalysisRow,"display","table-row"),u.set(D._analysisSelect.domNode.parentNode,"padding-bottom","1em"));D.domNode&&this.getStepNumber(D.domNode);fa.isDefined(U)&&
U.chooseLabel&&ka.push({value:-1,label:this.i18n.chooseLabel});fa.isDefined(U)&&U.chooseBlank&&ka.push({value:"  ",label:""});fa.isDefined(U)&&fa.isDefined(U.posIncrement)||(fa.isDefined(U)||(U={}),U.posIncrement=0);D.get(X)||D.set(X,[]);n.forEach(D.get(X),function(ja,la){la+=U.posIncrement;la={value:fa.isDefined(U)&&U.chooseLabel?""+la+1:""+la,label:ja.name};S&&(ja.name===S.name||ja.url&&S.url&&ja.url===S.url)&&(la.selected=!0);ka.push(la)},this);M.addOption(ka);M.set("required",!0);U.chooseBlank&&
"  "===M.get("value")&&setTimeout(k.hitch(this,this._validateSelectUI,M),100)}},isValidAnalysisLayer:function(D){var M="",X=!0;var U={isValid:X,validationMessage:M};var ka,S,ja=0,la=0,qa=0,ta,Ba,wa,ua=!0;if(!fa.isDefined(D)||!fa.isDefined(D.toolName))return U;this.initI18n();U=D.toolName;var ra=D.layers;var sa=D.analysisLayer;var va=U.charAt(0).toLowerCase()+U.substring(1);var za=this.i18n;D=D.showReadyToUseLayers||!1;n.forEach(ra,function(Aa){ua=!1;if(Aa instanceof T||"esri.layers.RasterXLayer"===
Aa.declaredClass)ta=!0;ta&&1<Aa.bandCount&&(Ba=!0);ta&&1===Aa.bandCount&&(wa=!0);Aa.geometryType===ia.GeometryTypes.Point&&(Ea=!0,ja++);if(Aa.geometryType===ia.GeometryTypes.Point||Aa.geometryType===ia.GeometryTypes.MultiPoint)ka=!0;Aa.geometryType===ia.GeometryTypes.Line&&(S=!0,qa++);Aa.geometryType===ia.GeometryTypes.Polygon&&(Oa=!0,la++)},this);if(-1!==n.indexOf(["CreateDriveTimeAreas","PlanRoutes","ConnectOriginsToDestinations"],U)&&(!Ea||sa&&sa.geometryType!==ia.GeometryTypes.Point))M=p.substitute(this.i18n.selectPointLayer,
{toolName:za[va]}),X=!1;else if("AggregatePoints"!==U&&"InterpolatePoints"!==U||(!sa||sa.geometryType===ia.GeometryTypes.Point||sa.geometryType===ia.GeometryTypes.MultiPoint)&&ka)if("CalculateDensity"===U&&(!ka&&!S||sa&&sa.geometryType!==ia.GeometryTypes.Point&&sa.geometryType!==ia.GeometryTypes.MultiPoint&&sa.geometryType!==ia.GeometryTypes.Line))M=p.substitute(this.i18n.areaFeatureInvalidMsg,{toolName:za[va]}),X=!1;else if("FindHotSpots"!==U&&"FindOutliers"!==U||D||!(!ka&&!Oa||sa&&sa.geometryType!==
ia.GeometryTypes.Point&&sa.geometryType!==ia.GeometryTypes.MultiPoint&&sa.geometryType!==ia.GeometryTypes.Polygon))if("OverlayLayers"!==U&&"AggregatePoints"!==U&&"SummarizeWithin"!==U&&"SummarizeNearby"!==U&&"FindNearest"!==U&&"MergeLayers"!==U||D||0!==ra.length&&(1!==ra.length||ra[0]!==sa&&fa.isDefined(sa)))if("ConnectOriginsToDestinations"===U&&!D&&(ua||2>ja))M=p.substitute(this.i18n.odPointMsg,{toolName:za[va]}),X=!1;else if(this.isFindCentroids(U)&&this.isPointLayer(sa))M=p.substitute(this.i18n.selectNoPointLayer,
{toolName:za[va]}),X=!1;else if("AggregatePoints"===U&&!D&&1<ra.length){var Oa=n.some(ra,function(Aa){return Aa.geometryType===ia.GeometryTypes.Polygon});Oa||(M=p.substitute(this.i18n.aggregatePolyMsg,{toolName:za[va]}),X=!1)}else if("MergeLayers"===U&&!D&&1<ra.length)1<ja||1<qa||1<la||(M=this.i18n.mergeValidationMsg,X=!1);else if("SummarizeWithin"!==U&&"DissolveBoundaries"!==U||(!sa||sa.geometryType===ia.GeometryTypes.Polygon)&&Oa||D)if("ExtractData"===U)(X=n.some(ra,function(Aa){return-1!==Aa.capabilities.indexOf("Extract")}))||
(M=p.substitute(this.i18n.extractValidationMsg));else if(("ConnectOriginsToDestinations"===U||U===ia.Tools.ChooseBestFacilities)&&1<ra.length){var Ea=n.some(ra,function(Aa){var Wa=fa.isDefined(sa)&&sa.id===Aa.id;return Aa.geometryType===ia.GeometryTypes.Point&&!Wa});Ea||(M=p.substitute(U===ia.Tools.ChooseBestFacilities?this.i18n.selectPointLayer:this.i18n.odPointMsg,{toolName:za[va]}),X=!1)}else"CalculateSlope"===U||"DeriveAspect"===U||"RemapValues"===U?ta?wa||(X=!1,M=p.substitute(this.i18n.noSingleBandISMsg,
{toolName:za[va]})):(X=!1,M=p.substitute(this.i18n.noImageServiceMsg,{toolName:za[va]})):"ExtractRaster"===U?ta||(X=!1,M=p.substitute(this.i18n.noImageServiceMsg,{toolName:za[va]})):"MonitorVegetation"===U&&(ta?Ba||(X=!1,M=p.substitute(this.i18n.noMultiBandISMsg,{toolName:za[va]})):(X=!1,M=p.substitute(this.i18n.noImageServiceMsg,{toolName:za[va]})));else M=p.substitute(this.i18n.selectPolyLayer,{toolName:za[va]}),X=!1;else M=p.substitute(this.i18n.overlayValidationMsg,{toolName:za[va]}),X=!1;else M=
p.substitute(this.i18n.hotspotsLineFeatureMsg,{toolName:za[va]}),X=!1;else M=p.substitute(this.i18n.selectPointLayer,{toolName:za[va]}),X=!1;return U={isValid:X,validationMessage:M}},isFindCentroids:function(D){return D===ia.Tools.FindCentroids},isPointLayer:function(D){return D&&D.geometryType===ia.GeometryTypes.Point},initI18n:function(){this.i18n||(this.i18n={},k.mixin(this.i18n,d.common),k.mixin(this.i18n,d.analysisTools),k.mixin(this.i18n,d.analysisMsgCodes),k.mixin(this.i18n,d.browseLayersDlg),
k.mixin(this.i18n,d.driveTimes),k.mixin(this.i18n,d.calculateFields))},addBrowseAnalysisDialog:function(D){if(D&&D.widget){this.i18n||this.initI18n();var M="esri/dijit/analysis/PluginAnalysisLayers",X=function(ra){return"\x3cimg class\x3d'grid-item galleryThumbnail' width\x3d'120px' height\x3d'80px' alt\x3d'' src\x3d'"+(ra.thumbnailUrl||this._portal.staticImagesUrl+"/desktopapp.png")+"'\x3e"},U=function(ra){return'\x3cdiv class\x3d"galleryLabelContainer"\x3e\x3cspan alt\x3d\''+(ra.title||ra.name||
"\x3cNo Title\x3e")+"'\x3e"+(ra.title.replace(/_/g," ")||ra.name.replace(/_/g," ")||"\x3cNo Title\x3e")+"\x3c/span\x3e\x3c/div\x3e"},ka=function(ra){return"\x3cimg class\x3d'grid-item-thumb' width\x3d'16px' height\x3d'16px' alt\x3d'' src\x3d'"+ra.iconUrl+"'/\x3e"},S=function(ra){return"\x3cimg class\x3d'grid-item-thumb' width\x3d'16px' height\x3d'16px' alt\x3d'' src\x3d'"+ra.iconUrl+"'/\x3e"},ja=v.doc.createDocumentFragment();ja=y.create("div",{style:"width:100%;height:100%;"},ja);var la=y.create("div",
{style:"width:100%;height:10%;","class":""}),qa=y.create("div",{style:"width:100%"},ja),ta=this._isCustomAnalysisQuery(D.widget);1===D.browseType?(M="esri/dijit/analysis/PluginLayers",M={portalUrl:D.widget.get("portalUrl"),message:"",plugin:M,sortDescending:!0,sort:"title",self:D.widget.get("portalSelf"),itemsPerPage:100,demandList:!0,extent:D.widget.get("map").extent,useExtent:!1,fetchTimeout:600,galleryTemplate:"\x3cdiv class\x3d'listServiceTitle'\x3e\x3ctable cellpadding\x3d'0' cellspacing\x3d'0' width\x3d'100%'\x3e\x3ctr width\x3d'100%'\x3e\x3ctd nowrap\x3d'nowrap'\x3e  \x3cdiv  style\x3d\"position:absolute;left:80px; top:10px; width:1px; height:1px; background: transparent;\"\x3e\x3c/div\x3e\x3cdiv style\x3d'overflow:hidden;'\x3e\x3ca style\x3d\"height:16px;\"\x3e${item.title}\x3c/a\x3e\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3ctable cellpadding\x3d'0' cellspacing\x3d'0' width\x3d'100%'\x3e\x3ctr width\x3d'100%' class\x3d'bottomRowTable'\x3e\x3ctd width\x3d'20'\x3e  \x3cspan class\x3d'esriAlignLeading'\x3e${item:_formatThumbnail}\x3c/span\x3e\x3c/td\x3e\x3ctd nowrap\x3d'nowrap'\x3e  \x3cspan class\x3d'esriAlignLeading' style\x3d'color:#656565;'\x3e${item.owner}\x3c/span\x3e\x3c/td\x3e\x3ctd style\x3d'padding-right:5px;padding-left:3px;'\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e",
showInfoPanel:!0,isAutoClose:!1,checkIsButtonEnabled:!0,formatThumbnail:S,formatInfoPanelImage:ka,"class":"esriAnalysisLayersItems"}):M={portalUrl:D.widget.get("portalUrl"),message:"",plugin:M,sortDescending:!0,sort:"title",self:D.widget.get("portalSelf"),pagingLinks:1,rowsPerPage:6,"class":"esriBrowseAnalysisLayers itemsGallery esriFloatLeading",extent:D.widget.get("map").extent,useExtent:!ta,fetchTimeout:600,galleryTemplate:'\x3cdiv style\x3d\'opacity:1;\' class\x3d\'grid-item gallery-view galleryNode\'\x3e${item:_formatItemTitle}${item:_formatThumbnail}\x3cdiv class\x3d"linksDiv" style\x3d\'display:none;\'\x3e\x3cdiv class\x3d"esriItemLinks"\x3e\x3cdiv class\x3d"esriFloatLeading"\x3e\x3ca style\x3d"text-decoration: none;"\x3e\x3cspan\x3eAdd layer to analysis\x3c/span\x3e\x3cdiv class\x3d"dijitReset dijitInline esriArrows"\x3e\x3c/div\x3e\x3c/a\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e',
formatItemTitle:U,showInfoPanel:!1,showTooltip:!0,formatThumbnail:X,style:"width:48em;height:100%;clear:both;"};U=y.toDom('\x3cdiv class\x3d"esriBrowseOptions"\x3e');y.place(U,la);X=y.create("div",{"class":"esriBrowseOption"},U);if(!D.browseType||1!==D.browseType){U=y.create("div",{"class":"esriBrowseOption"},U);var Ba=new da({name:"addlayer",id:D.widget.id+(D.browseType?D.browseType:"")+"_addlayercheck","class":"",value:!1,checked:!1},y.create("input",{},U));y.create("label",{"for":D.widget.id+"_addlayercheck",
"class":"esriBrowseOption_label",innerHTML:this.i18n.addLayer},U)}U=!0;D.browseType&&1===D.browseType?U=!1:ta&&(U=!1);U=new da({name:"extentcheck",id:D.widget.id+(D.browseType?D.browseType:"")+"_addextentcheck","class":"",value:U,checked:U},y.create("input",{},X));y.create("label",{"for":D.widget.id+(D.browseType?D.browseType:"")+"_addextentcheck","class":"esriBrowseOption_label",innerHTML:this.i18n.withinMapArea},X);M.messageRight=la;var wa=new I(M,qa);U.on("change",k.hitch(this,function(ra){wa.set("useExtent",
ra)}));var ua=new ca({title:1===D.browseType?this.i18n.browseLayers:ta?this.i18n.browseAnalysisLayers:this.i18n.browseAnalysisTitle,content:ja,browseItems:wa,addlayerCheckBox:Ba,style:D.browseType&&1===D.browseType?"":"padding:.75em 0;background-color: #fff;width:50em;"});D.widget.own(ua.on("hide",k.hitch(ua,function(ra){ua.browseItems.reset()})));return ua}},addAnalysisReadyLayer:function(D,M){function X(wa){var ua;if("Feature Service"===S.type){var ra=new O(S.url,{outFields:["*"]});k.mixin(S,ra)}"Image Service"===
S.type&&(ra=-1<wa.capabilities.indexOf("TilesOnly")?new ba(S.url,{outFields:["*"]}):new T(S.url,{outFields:["*"]}),k.mixin(S,ra));k.mixin(S,wa);S.id=S.title+"_"+wa.id;S.title=D.item.selectedLayer?S.title+"-"+wa.name:S.title.replace(/_/g," ");S.name=S.title;S.version=S.currentVersion;if(la&&D.widget.showBrowseLayers){var sa=(ua=D.layersSelect.get("store"))&&ua.data;ua=2;ua=sa.splice(sa.length-ua,ua);var va={id:sa.length,label:S.title,name:S.title,url:S.url};sa.push(va);sa=sa.concat(ua);ua=new P({data:sa,
idProperty:"id"});D.layersSelect.set("store",ua);D.layersSelect.set("value",va.name)}else{sa=D.layersSelect.getOptions();if(D.widget.useArcGISComponents&&(D.widget.showBrowseLayers||D.widget.showReadyToUseLayers))ua=2;else if(D.widget.showBrowseLayers&&D.widget.showReadyToUseLayers)ua=3;else if(D.widget.showBrowseLayers||D.widget.showReadyToUseLayers)ua=2;ua=sa.splice(sa.length-ua,ua);D.layersSelect.removeOption(ua);sa=D.layers.length;D.posIncrement&&(sa+=D.posIncrement);sa=""+sa;ua.unshift({value:sa,
label:S.title,selected:!0});D.layersSelect.addOption(ua);D.layersSelect.set("value",sa)}ra&&(S.lyr=ra,ra.name=S.name);S.linfo=wa;D.layers.push(S);if(D.browseDialog.addlayerCheckBox&&D.browseDialog.addlayerCheckBox.get("checked")||ja||M)this._addLayerHandle&&this._addLayerHandle.remove(),this._addLayerHandle=D.widget.map.on("layer-add",k.hitch(this,function(za){this._addLayerHandle.remove();D.widget.emit("add-ready-to-use-layer",{layer:za.layer,layerInfo:wa,item:S})})),D.widget.map.addLayer(ra);D.browseDialog.browseItems&&
D.browseDialog.browseItems.clear()}if(fa.isDefined(D)&&fa.isDefined(D.item)&&fa.isDefined(D.layersSelect)&&fa.isDefined(D.layers)&&fa.isDefined(D.browseDialog)){D.browseDialog.hide&&D.browseDialog.hide();var U,ka;(U=!D.item.selectedLayer&&D.item.url?D.item.type===ma.IS?D.item.url:D.item.url+"/0":D.item.selectedLayer.url)&&-1!==window.location.protocol.indexOf("https:")&&(U=U.replace("http:","https:"));var S={url:U,itemId:D.item.id,title:D.item.title,type:D.item.type,analysisReady:!0};U=n.some(D.layers,
function(wa,ua){var ra=wa.analysisReady&&S.analysisReady&&wa.itemId===S.itemId;D.item.selectedLayer&&D.item.selectedLayer.url&&(ra=wa.itemId&&S.itemId?wa.itemId===S.itemId&&wa.url===S.url:wa.url===S.url);ra&&(ka=ua);return ra});var ja;D.browseDialog.browseItems&&t(".js-add-layer-checkbox",D.browseDialog.browseItems.infoPanel).forEach(function(wa){ja=wa.checked});var la=-1!==D.layersSelect.baseClass.indexOf("dijitComboBox");var qa=new B;var ta="sync";if(U){D.posIncrement&&(ka+=D.posIncrement);if(D.browseDialog.addlayerCheckBox&&
D.browseDialog.addlayerCheckBox.get("checked")||ja||M){D.posIncrement||(D.posIncrement=0);var Ba=D.layers[ka-D.posIncrement];D.widget.map.getLayer(Ba.lyr.id)||(this._addLayerHandle&&this._addLayerHandle.remove(),this._addLayerHandle=D.widget.map.on("layer-add",k.hitch(this,function(wa){this._addLayerHandle.remove();D.widget.emit("add-ready-to-use-layer",{layer:wa.layer,layerInfo:Ba.linfo,item:Ba})})),D.widget.map.addLayer(Ba.lyr))}la?D.layersSelect.set("value",D.layers[ka-1].name):D.layersSelect.set("value",
""+ka);D.browseDialog.browseItems&&D.browseDialog.browseItems.clear();qa.resolve()}else D.item.selectedLayer?(S.url=D.item.selectedLayer.url,qa.then(k.hitch(this,X)),setTimeout(function(){qa.resolve(D.item.selectedLayer)},500)):(ta=D.item.itemDataUrl?V({url:D.item.itemDataUrl,content:{f:"json"}}):"sync",z(ta,k.hitch(this,function(wa){wa&&wa.layers&&wa.layers[0].id&&(S.url=S.url.substring(0,S.url.lastIndexOf("/0"))+"/"+wa.layers[0].id);V({url:S.url,content:{f:"json"}}).then(k.hitch(this,function(ua){X(ua);
qa.resolve()}))})));return qa.promise}},addReadyToUseLayerOption:function(D,M){D&&(D.showReadyToUseLayers||D.showBrowseLayers)&&(M||(M=[]),D.signInPromise||(D.signInPromise=new B,setTimeout(k.hitch(this,function(){D.signInPromise.resolve()}),100)),D.i18n||(this.initI18n(),D.i18n=this.i18n),D.signInPromise.then(k.hitch(this,function(){n.forEach(M,function(X){var U=X.select||X;if(-1!==U.baseClass.indexOf("dijitComboBox")&&D.showBrowseLayers){if(X=U.get("store"))X.put({id:"separator",name:"separator",
label:"\x3chr\x3e"}),X.put({id:"browselayers",name:"browselayers",label:D.i18n.browseLayers})}else{var ka=U.getOptions();n.some(ka,function(S){return"separator"===S.type},this)||!D.showReadyToUseLayers&&!D.showBrowseLayers||U.addOption({type:"separator",value:""});this.addBrowseOptionForTool({select:U,disableLAAL:X.disableLAAL},D)}},this);D.showReadyToUseLayers&&!fa.isDefined(D._browsedlg)&&(D._browsedlg=this.addBrowseAnalysisDialog({widget:D}),D.own(D._browsedlg.browseItems.on("select-change",k.hitch(D,
D._handleBrowseItemsSelect)),D._browsedlg.on("hide",k.hitch(D,function(){n.forEach(M,function(X){"browse"===X.get("value")&&X.reset()});D.layersSelect&&D.layersSelect.reset()}))));D.showBrowseLayers&&!fa.isDefined(D._browseLyrsdlg)&&(D._browseLyrsdlg=this.addBrowseAnalysisDialog({widget:D,browseType:1}),D.own(D._browseLyrsdlg.on("browseitems-close",k.hitch(this,function(X){"add-layer"===X.action&&(D._browseLyrsdlg.browseItems.plugIn._grid&&(X.selection.selectedLayer=D._browseLyrsdlg.browseItems.plugIn._selectedLayer,
D._handleBrowseItemsSelect({dialog:D._browseLyrsdlg,selection:X.selection})),D._browseLyrsdlg.browseItems.closeInfoPanel())})),D._browseLyrsdlg.on("hide",k.hitch(D,function(){n.forEach(M,function(X){"browselayers"===X.get("value")&&X.reset()})}))))})))},addBrowseOptionForTool:function(D,M){var X=D.select,U=D.disableLAAL||!1,ka=X.getOptions();D=[];var S=!1;if(!n.some(ka,function(ja){return"browselayers"===ja.value||"browse"===ja.value},this)){if(0<ka.length&&"separator"!==ka[ka.length-1].type||0===
ka.length)D.push({type:"separator"}),S=!0;M.useArcGISComponents&&(M.showBrowseLayers||M.showReadyToUseLayers)?D.push({value:"browselayers",label:M.i18n.browseAnalysisLayers}):(!U&&M.showReadyToUseLayers&&(U=M.i18n.browseAnalysisTitle,this._isCustomAnalysisQuery(M)&&(U=M.i18n.browseAnalysisLayers),D.push({value:"browse",label:U})),M.showBrowseLayers&&D.push({value:"browselayers",label:M.i18n.browseLayers}));(!0===S&&1<D.length||!1===S&&0<D.length)&&X.addOption(D)}},_isCustomAnalysisQuery:function(D){var M=
'title:"Living Atlas Analysis Layers" AND owner:esri',X=!1;D&&D.isSingleTenant&&(M='title:"Living Atlas Analysis Layers" AND owner:esri_livingatlas');D.portalSelf&&D.portalSelf.analysisLayersGroupQuery&&D.portalSelf.analysisLayersGroupQuery!==M?X=!0:D._portal&&D._portal.analysisLayersGroupQuery&&D._portal.analysisLayersGroupQuery!==M&&(X=!0);return X},getMaxInputByMode:function(D){if(D&&D.units&&D.type&&D.limits&&D.travelMode){var M,X=D.limits.maximumBreakDistanceValue,U=D.limits.maximumBreakDistanceValueUnits,
ka=D.limits.maximumBreakTimeValue,S=D.limits.maximumBreakTimeValueUnits,ja=this.isWalkingTravelMode(D.travelMode.travelMode);ja&&(X=D.limits.maximumBreakWalkingDistanceValue,U=D.limits.maximumBreakWalkingDistanceValueUnits,ka=D.limits.maximumBreakWalkingTimeValue,S=D.limits.maximumBreakWalkingTimeValueUnits);"reachableStreets"===D.alternateLimits&&(S=this.generateLimitsForReachableStreets({limits:D.limits,isWalking:ja}),X=S.driveDistanceLimit,U=S.driveDistanceUnit,ka=S.driveTimeLimit,S=S.driveTimeUnit);
"unreachableAreas"===D.alternateLimits&&(S=this.generateLimitsForUnreachableAreas({limits:D.limits,isWalking:ja}),X=S.driveDistanceLimit,U=S.driveDistanceUnit,ka=S.driveTimeLimit,S=S.driveTimeUnit);ka*=this.perMinute(S);X*=this.perMile(U);"StraightLine"===D.type?"Miles"===D.units?M=1E3:"Yards"===D.units?M=176E4:"Kilometers"===D.units?M=x.format(1609.344,{places:2}):"Meters"===D.units?M=x.format(1609344,{places:2}):"Feet"===D.units&&(M=528E4):this.isDistanceMode(D.travelMode)?"Miles"===D.units?M=X:
"Yards"===D.units?M=1760*X:"Kilometers"===D.units?M=x.format(1.609344*X,{places:2}):"Meters"===D.units?M=x.format(1609.344*X,{places:2}):"Feet"===D.units&&(M=5280*X):this.isTimeMode(D.travelMode)&&("Minutes"===D.units?M=ka:"Seconds"===D.units?M=60*ka:"Hours"===D.units&&(M=ka/60));return"string"===typeof M?x.parse(M):parseFloat(M)}},isWalkingTravelMode:function(D){if(D&&D.restrictionAttributeNames)return D.restrictionAttributeNames.some(function(M){return"walking"===M.toLowerCase()})},isDistanceMode:function(D){return"Distance"===
D.units},isTimeMode:function(D){return"Time"===D.units},generateLimitsForUnreachableAreas:function(D){var M={driveDistanceLimit:null,driveDistanceUnit:null,driveTimeLimit:null,driveTimeUnit:null};D.isWalking?(M.driveDistanceLimit=D.limits.maximumBreakWalkingDistanceValueDetailedPolygons,M.driveDistanceUnit=D.limits.maximumBreakWalkingDistanceValueUnitsDetailedPolygons,M.driveTimeLimit=D.limits.maximumBreakWalkingTimeValueDetailedPolygons,M.driveTimeUnit=D.limits.maximumBreakWalkingTimeValueUnitsDetailedPolygons):
(M.driveDistanceLimit=D.limits.maximumBreakDistanceValueDetailedPolygons,M.driveDistanceUnit=D.limits.maximumBreakDistanceValueUnitsDetailedPolygons,M.driveTimeLimit=D.limits.maximumBreakTimeValueDetailedPolygons,M.driveTimeUnit=D.limits.maximumBreakTimeValueUnitsDetailedPolygons);return M},generateLimitsForReachableStreets:function(D){var M={driveDistanceLimit:null,driveDistanceUnit:null,driveTimeLimit:null,driveTimeUnit:null};D.isWalking?(M.driveDistanceLimit=D.limits.maximumBreakWalkingDistanceValueServiceAreaLines,
M.driveDistanceUnit=D.limits.maximumBreakWalkingDistanceValueUnitsServiceAreaLines,M.driveTimeLimit=D.limits.maximumBreakWalkingTimeValueServiceAreaLines,M.driveTimeUnit=D.limits.maximumBreakWalkingTimeValueUnitsServiceAreaLines):(M.driveDistanceLimit=D.limits.maximumBreakDistanceValueServiceAreaLines,M.driveDistanceUnit=D.limits.maximumBreakDistanceValueUnitsServiceAreaLines,M.driveTimeLimit=D.limits.maximumBreakTimeValueServiceAreaLines,M.driveTimeUnit=D.limits.maximumBreakTimeValueUnitsServiceAreaLines);
return M},updateModeConstraints:function(D){if(D&&D.validateWidget&&D.units&&D.type&&D.travelMode){var M=D.validateWidget.get("constraints");M.max=this.getMaxInputByMode(D);D.validateWidget.set(M)}},getTravelModes:function(D){var M=new B,X,U,ka,S;fa.isDefined(this.travelModes)&&0<this.travelModes.length?M.resolve(this.travelModes):D&&D.widget?D.widget.signInPromise.then(k.hitch(this,function(ja){(S=D.widget.get("helperServices"))&&S.routingUtilities?(ka=S.routingUtilities.url,X="sync"):X=D.widget._getSelf(D.widget.portalUrl);
z(X,k.hitch(this,function(la){la&&la.helperServices&&la.helperServices.routingUtilities&&(ka=la.helperServices.routingUtilities.url);fa.isDefined(ka)?(U=new N(ka+"/GetTravelModes"),U.execute({}).then(k.hitch(this,function(qa){this.travelModes=n.map(qa[0].value&&qa[0].value.features,function(ta){return b.fromJson(ta.attributes.TravelMode)});qa[1]&&qa[1].paramName&&"defaultTravelMode"===qa[1].paramName&&(this.defaultTravelModeId=qa[1].value);M.resolve(this.travelModes)}),k.hitch(this,function(qa){M.reject(qa)}))):
M.reject(Error("Missing Routing Utility Service to get Travel Modes"))}),function(la){M.reject(la)})})):M.reject(Error("Missing parameter: params.widget required parameter"));return M.promise},populateTravelModes:function(D){if(D&&D.selectWidget&&D.widget){var M=[],X=D.allowmode||"all",U=!1;this.initI18n();D.addStraightLine&&M.push({value:"StraightLine",label:'\x3cdiv class\x3d"esriFloatLeading bufferIcon esriStraightLineDistanceIcon"\x3e\x3c/div\x3e\x3cdiv class\x3d"esriLeadingMargin4" style\x3d"height:20px;margin-top:10px;"\x3e'+
this.i18n.straightLineDistance+"\x3c/div\x3e",selected:D.value&&"StraightLine"===D.value});this.getTravelModes({widget:D.widget}).then(k.hitch(this,function(ka){var S=fa.isDefined(D.enableTravelModes)&&!D.enableTravelModes;n.forEach(ka,function(ja,la){la=this.createOptionForTravelMode(ja,{name:ja.name,disabled:S,separator:D.separator});this.isTravelModeAllowed(X,la.units)&&("all"!==X&&(la.value=la.value.replace(la.units,"")),D.value&&D.value.id===ja.id?Q(D.value,ja)&&(la.selected=!la.disabled,U=!0):
!D.value&&D.selectDefaultMode&&this.defaultTravelModeId&&this.defaultTravelModeId===ja.id&&(la.selected=!0),M.push(la))},this);!U&&this.isRequiredToAddTravelMode(D)&&this.isTravelModeAllowed(X,this.getTravelModeUnits(D.value))&&M.push(this.getOptionForCustomTravelMode(D,S));D.selectWidget.removeOption();D.selectWidget.addOption(M);D.widget.emit("travelmodes-added",{travelOptions:M})}),k.hitch(this,function(ka){M&&0<M.length&&(D.selectWidget.removeOption(),D.selectWidget.addOption(M),D.widget.emit("travelmodes-added",
{travelOptions:M}))}))}},getTravelModeLabel:function(D,M){M=M?M:D.name;return'\x3cdiv class\x3d"esriFloatLeading bufferIcon esri'+this.getTravelModei18nKey(D.type)+this.getTravelModeUnits(D)+'Icon"\x3e\x3c/div\x3e\x3cdiv class\x3d"esriLeadingMargin4" style\x3d"height:20px;margin-top:10px;" title\x3d"'+D.description+'"\x3e'+M+"\x3c/div\x3e"},getTravelModeUnits:function(D){var M=D.units||name.split(/\s/)[1];return M=D.impedanceAttributeName===D.timeAttributeName?"Time":D.impedanceAttributeName===D.distanceAttributeName?
"Distance":"Other"},getTravelModeValue:function(D,M){return D.replace(/\s/g,M||"")},getTravelModei18nKey:function(D){return"AUTOMOBILE"===D?"Driving":"TRUCK"===D?"Trucking":"WALK"===D?"Walking":"Other"},isTravelModeAllowed:function(D,M){return"all"===D||D.toLowerCase()===M.toLowerCase()},isRequiredToAddTravelMode:function(D){return D.widget.rerun&&"StraightLine"!==D.value},isTrafficBasedTravelMode:function(D){var M=this.getTravelModei18nKey(D.type).toLowerCase();return"time"===this.getTravelModeUnits(D).toLowerCase()&&
("driving"===M||"trucking"===M)},getOptionForCustomTravelMode:function(D,M){D=this.createOptionForTravelMode(D.value,{name:"\x26lt"+D.value.name+"\x26gt",disabled:M,separator:D.separator});D.selected=!0;return D},createOptionForTravelMode:function(D,M){return{label:this.getTravelModeLabel(D,M.name),value:this.getTravelModeValue(M.name,M.separator),travelMode:D,disabled:M.disabled,modei18nKey:this.getTravelModei18nKey(D.type).toLowerCase(),units:this.getTravelModeUnits(D)}},updateDisplay:function(D,
M,X){(new t.NodeList(D)).style("display",M?X?X:"block":"none")},isGreaterThanZero:function(){return 0<this.get("value")},getExprFunctions:function(){this.i18n||this.initI18n();this.exprFunctions||(this.exprFunctions=[{type:"NumType",label:p.substitute(this.i18n.asMetersFunc,{functionName:"as_meters(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"as_meters()"},{type:"NumType",label:p.substitute(this.i18n.asKilometersFunc,{functionName:"as_kilometers(\x3ci\x3enumber\x3c/i\x3e)",
num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"as_kilometers()"},{type:"NumType",label:p.substitute(this.i18n.asFeetFunc,{functionName:"as_feet(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"as_feet()"},{type:"NumType",label:p.substitute(this.i18n.asYardsFunc,{functionName:"as_yards(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"as_yards()"},{type:"NumType",label:p.substitute(this.i18n.asMilesFunc,{functionName:"as_miles(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),
name:"as_miles()"},{type:"NumType",label:p.substitute(this.i18n.asNuaticalMilesFunc,{functionName:"as_nautical_miles(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"as_nautical_miles()"},{type:"NumType",label:p.substitute(this.i18n.absFunc,{functionName:"abs(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"abs()"},{type:"NumType",label:p.substitute(this.i18n.logFunc,{functionName:"log(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"log()"},
{type:"NumType",label:p.substitute(this.i18n.sinFunc,{functionName:"sin(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"sin()"},{type:"NumType",label:p.substitute(this.i18n.cosFunc,{functionName:"cos(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"cos()"},{type:"NumType",label:p.substitute(this.i18n.tanFunc,{functionName:"tan(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"tan()"},{type:"NumType",label:p.substitute(this.i18n.squareRootFunc,
{functionName:"sqrt(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"sqrt()"},{type:"NumType",label:p.substitute(this.i18n.minFunc,{functionName:"min(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"min()"},{type:"NumType",label:p.substitute(this.i18n.maxFunc,{functionName:"max(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"max()"},{type:"NumType",label:p.substitute(this.i18n.constrainFunc,{functionName:"constrain(\x3ci\x3enumber\x3c/i\x3e, \x3ci\x3elow\x3c/i\x3e, \x3ci\x3ehigh\x3c/i\x3e",
num:"\x3ci\x3enumber\x3c/i\x3e",low:"\x3ci\x3elow\x3c/i\x3e",high:"\x3ci\x3ehigh\x3c/i\x3e"}),name:"constrain(,,)"},{type:"NumType",label:p.substitute(this.i18n.iffFunc,{functionName:"iif(\x3ci\x3econdition\x3c/i\x3e,\x3ci\x3evalue if TRUE\x3c/i\x3e,\x3ci\x3evalue if FALSE\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"iif(,,)"},{type:"NumType",label:p.substitute(this.i18n.whenFunc,{functionName:"when(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"when(,)"},{type:"NumType",
label:p.substitute(this.i18n.decodeFunc,{functionName:"decode(\x3ci\x3eexpression\x3c/i\x3e, \x3ci\x3ecase1,return1,..caseN,returnN\x3c/i\x3e, \x3ci\x3edefault\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"decode(,,,)"}]);return this.exprFunctions},addAttributeOptions:function(D){this.initI18n();fa.isDefined(D.allowSelectLabel)||(D.allowSelectLabel=!0);var M=[],X=fa.isDefined(D.emptyValue)?D.emptyValue:"";if(D.allowNumericType||void 0===D.allowNumericType)M=[ia.FieldTypes.Short,ia.FieldTypes.Integer,
ia.FieldTypes.Float,ia.FieldTypes.Double];var U=D.layer;var ka=D.selectWidget;var S=U?U.fields:[];ka.removeOption(ka.getOptions());D.allowSelectLabel&&ka.addOption({value:X,label:this.i18n.attribute});D.allowStringType&&M.push(ia.FieldTypes.String);D.allowDateType&&M.push(ia.FieldTypes.Date);var ja=[];n.forEach(S,function(la){-1!==n.indexOf(M,la.type)&&la.name!==U.objectIdField&&ja.push({value:la.name,label:fa.isDefined(la.alias)&&""!==la.alias?la.alias:la.name,type:la.type===ia.FieldTypes.String?
ia.PseudoFieldTypes.String:la.type===ia.FieldTypes.Date?ia.PseudoFieldTypes.Date:ia.PseudoFieldTypes.Number})},this);if(0===ja.length)return!1;ka.addOption(ja);fa.isDefined(D.priorityChange)?ka.set("value",X,D.priorityChange):ka.set("value",X);ka.set("disabled",!U||0===U.fields.length);return!0},addStatisticsOptions:function(D){this.initI18n();var M=D.selectWidget,X=[{value:"SUM",label:this.i18n.sum},{value:"MIN",label:this.i18n.minimum},{value:"MAX",label:this.i18n.maximum},{value:"MEAN",label:D.showGeoAnalyticsParams?
this.i18n.mean:this.i18n.average},{value:"STDDEV",label:this.i18n.standardDev}],U=[{value:"MIN",label:this.i18n.minimum},{value:"MAX",label:this.i18n.maximum}],ka=[{value:"First",label:this.i18n.first},{value:"Last",label:this.i18n.last}],S=fa.isDefined(D.emptyValue)?D.emptyValue:"";M.removeOption(M.getOptions());M.addOption([{value:S,label:this.i18n.statistic}]);D.showGeoAnalyticsParams&&(M.addOption({value:"COUNT",label:this.i18n.count}),X.push({value:"VARIANCE",label:this.i18n.variance}),X.splice(4,
0,{value:"RANGE",label:this.i18n.range}));D.showFirstLastStats&&M.addOption(ka);D.type&&"number"!==D.type?D.type&&"string"===D.type?(M.addOption({value:"ANY",label:this.i18n.any}),D.selectWidget.optionsType="string"):D.type&&"date"===D.type&&(M.addOption(U),D.selectWidget.optionsType="date"):(M.addOption(X),D.selectWidget.optionsType="number");M.set("value",S)},addFillOptions:function(D){var M=D.selectWidget,X=[{value:"ZEROES",label:this.i18n.zeroes},{value:"SPATIAL_NEIGHBORS",label:this.i18n.spatialneighbhors},
{value:"SPACE_TIME_NEIGHBORS",label:this.i18n.spacetimeneighbors},{value:"TEMPORAL_TREND",label:this.i18n.temporaltrend}];M.removeOption(M.getOptions());M.addOption([{value:"0",label:this.i18n.fill}]);D.type&&"number"!==D.type||M.addOption(X)},perMeter:function(D){var M=1;switch(D){case K.MILLIMETERS:M=1E3;break;case K.CENTIMETERS:M=100;break;case K.DECIMETERS:M=10;break;case K.METERS:M=1;break;case K.KILOMETERS:M=.001;break;case K.INCHES:M=39.370079;break;case K.FEET:M=3.2808399;break;case K.YARDS:M=
1.0936133;break;case K.MILES:M=6.2137119E-4;break;case K.NAUTICAL_MILES:M=5.399568E-4;break;case K.ACRES:M=2.4710538E-4;break;case K.ARES:M=.01;break;case K.HECTARES:M=1E-4;break;case K.SQUARE_INCHES:M=1550.0031;break;case K.SQUARE_FEET:M=10.7639104;break;case K.SQUARE_YARDS:M=1.19599005;break;case K.SQUARE_MILES:M=3.86102159E-7;break;case K.SQUARE_NAUTICAL_MILES:M=2.9155335E-7;break;case K.SQUARE_MILLIMETERS:M=1E6;break;case K.SQUARE_CENTIMETERS:M=1E4;break;case K.SQUARE_DECIMETERS:M=100;break;case K.SQUARE_METERS:M=
1;break;case K.SQUARE_KILOMETERS:M=1E-6}return M},perMile:function(D){var M=1;switch(D){case "Feet":M=1.89394E-4;break;case "Yards":M=5.68182E-4;break;case "Meters":M=6.21371E-4;break;case "Kilometers":M=.621371}return M},perMinute:function(D){var M=1;switch(D){case "Seconds":M=.0166667;break;case "Hours":M=60}return M},getType:function(D){var M=null;switch(D){case K.ACRES:M=2;break;case K.ARES:M=2;break;case K.CENTIMETERS:M=1;break;case K.DECIMETERS:M=1;break;case K.FEET:M=1;break;case K.HECTARES:M=
2;break;case K.INCHES:M=1;break;case K.KILOMETERS:M=1;break;case K.METERS:M=1;break;case K.MILES:M=1;break;case K.MILLIMETERS:M=1;break;case K.NAUTICAL_MILES:M=1;break;case K.SQUARE_CENTIMETERS:M=2;break;case K.SQUARE_DECIMETERS:M=2;break;case K.SQUARE_FEET:M=2;break;case K.SQUARE_INCHES:M=2;break;case K.SQUARE_KILOMETERS:M=2;break;case K.SQUARE_METERS:M=2;break;case K.SQUARE_MILES:M=2;break;case K.SQUARE_MILLIMETERS:M=2;break;case K.SQUARE_NAUTICAL_MILES:M=2;break;case K.SQUARE_YARDS:M=2;break;case K.YARDS:M=
1;break;default:M=0}return M},unitConversion:function(D,M,X){var U=!0;fa.isDefined(D)||(this.emitError("The 'From' Value must be a valid numeric value: "+D),U=!1);fa.isDefined(M)||(this.emitError("The 'From' Units must be defined: "+M),U=!1);fa.isDefined(X)||(this.emitError("The 'To' Units must be defined: "+X),U=!1);D instanceof Array&&(this.emitError("Only single 'From' Value supported: "+D),U=!1);M instanceof Array&&(this.emitError("Only single 'From' Units supported: "+M),U=!1);X instanceof Array&&
(this.emitError("Only single 'To' Units supported: "+X),U=!1);var ka=this.getType(M),S=this.getType(X);0===ka&&(this.emitError("Unsupported 'From' Units: "+M),U=!1);0===S&&(this.emitError("Unsupported 'To' Units: "+X),U=!1);ka!==S&&(this.emitError("Incompatible 'From' and 'To' Units: "+M+" and "+X),U=!1);return U?M===X?+D:+D/this.perMeter(M)*this.perMeter(X):Number.NaN},emitError:function(D){console.log("error",Error(D))},isEmpty:function(D){for(var M in D)if(D.hasOwnProperty(M))return!1;return h.stringify(D)===
h.stringify({})},getRoutingUtilities:function(D){var M=new B,X={},U,ka,S,ja;D||M.reject(Error("Missing parameter: widget required parameter"));-1!==n.indexOf(["CreateDriveTimeAreas","EnrichLayer","SummarizeNearby"],D.toolName)?k.mixin(X,{toolName:"GenerateServiceAreas",serviceName:"asyncServiceArea"}):D.toolName===ia.Tools.ChooseBestFacilities?k.mixin(X,{toolName:"SolveLocationAllocation",serviceName:"asyncLocationAllocation"}):"PlanRoutes"===D.toolName?k.mixin(X,{toolName:"SolveVehicleRoutingProblem",
serviceName:"asyncVRP"}):"FindNearest"===D.toolName?k.mixin(X,{toolName:"FindClosestFacilities",serviceName:"asyncClosestFacility"}):"ConnectOriginsToDestinations"===D.toolName&&k.mixin(X,{toolName:"FindRoutes",serviceName:"asyncRoute"});this.routingUtilities||(this.routingUtilities={});this.routingUtilities&&this.routingUtilities[D.toolName]?M.resolve(this.routingUtilities[D.toolName]):D.signInPromise.then(k.hitch(this,function(la){(ja=D.get("helperServices"))&&ja.routingUtilities?(S=ja.routingUtilities.url,
U="sync"):U=D._getSelf(D.portalUrl);z(U,k.hitch(this,function(qa){qa&&qa.helperServices&&qa.helperServices.routingUtilities&&(S=qa.helperServices.routingUtilities.url);fa.isDefined(S)||M.reject(Error("Missing Routing Utility Service to get Network Analysis Service Limits."));ka=new N(S+"/GetToolInfo");ka.execute(X).then(k.hitch(this,function(ta){ta&&0<ta.length&&ta[0].value?(this.routingUtilities[D.toolName]=ta[0].value,M.resolve(ta[0].value)):M.reject("Routing Utility Service 'GetToolInfo' job did not return service limits.")}),
function(ta){M.reject(ta)})}))}),function(la){M.reject(la)});return M.promise},getNetworkAnalysisLimits:function(D){var M=new B;D||M.reject(Error("Missing parameter: widget required parameter"));this.getRoutingUtilities(D).then(k.hitch(this,function(X){X.serviceLimits?M.resolve(X.serviceLimits):M.reject()}),function(X){M.reject(X)});return M.promise},isEsriWorldGeocoder:function(D){var M=this.isAgoWorldGeocodeServer(D);D=this.isAgoWorldGeocodeServerProxy(D);return M||D},isAgoWorldGeocodeServer:function(D){return D&&
!!D.match(/(arcgis.com\/arcgis\/rest\/services\/world\/geocodeserver).*/ig)},isCustomGeoEnrichmentServer:function(D,M){var X=(D||"").toLowerCase();D=-1<X.indexOf("/geoenrichmentserver")&&-1<X.indexOf("/servers/")&&-1<X.indexOf("/rest/services/");M=!M&&X.indexOf("utility")&&-1<X.indexOf(".arcgis.com");return D&&M},isAgoWorldGeocodeServerProxy:function(D){return D&&!!D.match(/(\/servers\/[\da-z\.-]+\/rest\/services\/world\/geocodeserver).*/ig)},isWorldGeoLocator:function(D){return D&&!!D.match(/(\/rest\/services\/world\/geocodeserver).*/ig)},
showMessages:function(D,M,X){c.set(M,"innerHTML",D);l.fadeIn({node:X,easing:G.quadIn,onEnd:k.hitch(this,function(){u.set(X,{display:""})})}).play()},hideMessages:function(D){l.fadeOut({node:D,easing:G.quadOut,onEnd:function(){u.set(D,{display:"none"})}}).play()},getHelpUrl:function(D){if(D.topic&&D.widget){var M;D.widget.portalSelf&&D.widget.portalSelf.helpBase?M=D.widget.portalSelf.helpBase+"index.html#":!D.widget.isSingleTenant||D.widget.portalSelf&&D.widget.portalSelf.helpBase||(M="http://server.arcgis.com/en/portal/latest/use/");
"BufferExpression"===D.topic&&(M+="Use_expressions_with_GeoAnalytics_Tools/019300000183000000/");return M}},isPCS:function(D){return!!D&&!!oa&&-1!==n.indexOf(oa,D)},isPCSByLayerType:function(D){var M=!!D&&!!D.fullExtent&&this.isPCS(D.fullExtent.spatialReference.wkid);!M&&D.extent&&(M=!!D&&!!D.extent&&this.isPCS(D.extent.spatialReference.wkid));!M&&D.spatialReference&&(M=!!D&&!!D.spatialReference&&this.isPCS(D.spatialReference.wkid));return M},checkPCSforAnalysis:function(D){var M=D.widget&&D.widget.toolName,
X=!!D.widget&&!!D.widget.context&&!!D.widget.context.processSR&&this.isPCS(D.widget.context.processSR.wkid),U=!0,ka=D.jobParams||D.widget.jobParams,S=!!D.widget&&!!D.widget.context&&!!D.widget.context.processSR&&!!D.widget.context.processSR.wkid;if(!M||!ka||!D.widget.showGeoAnalyticsParams)return!1;var ja="\x3ca  href\x3d'#' id\x3d'"+D.widget.id+"_warn_settings_link'\x3e"+D.widget.i18n.analysisSettings+"\x3c/a\x3e\x3cdiv class\x3d'esriAnalysisSettingsIcon'\x3e\x3c/div\x3e";var la=p.substitute(D.widget.i18n.PCSReqMsg,
{defaultSpatialRef:D.widget.i18n.worldCylindrical,settingsIcon:ja});"FindHotSpots"!==M&&"FindPointClusters"!==M||X?"CalculateDensity"!==M&&"FindPointClusters"!==M&&"GeographicallyWeightedRegression"!==M||X?"AggregatePoints"!==M||-1===n.indexOf(["HEXAGON","SQUARE"],ka.binType)||X?"SummarizeWithin"===M&&ka.summaryPolygons&&!X?U=this.isPCSByLayerType(D.widget.sumWithinLayer):"SummarizeWithin"!==M||-1===n.indexOf(["HEXAGON","SQUARE"],ka.binType)||X?"JoinFeatures"===M&&ka.spatialNearDistance&&"Near"===
ka.spatialRelationship&&!X?(U=this.isPCSByLayerType(D.widget.targetLayer))||(la=p.substitute(D.widget.i18n.JFPCSReqMsg,{settingsIcon:ja})):"BuildMultiVariableGrid"!==M||X?"CalculateMotionStatistics"===M&&"Planar"===ka.distanceMethod&&(1<ka.motionStatistics.split(",").length||1===ka.motionStatistics.split(",").length&&-1===ka.motionStatistics.indexOf("Duration"))&&!X?(U=this.isPCSByLayerType(D.widget.inputLayer))||(la=p.substitute(D.widget.i18n.CMSPCSReqMsg,{settingsIcon:ja})):"TraceProximityEvents"!==
M||"Planar"!==ka.distanceMethod||X||(U=this.isPCSByLayerType(D.widget.inputLayer))||(la=p.substitute(D.widget.i18n.TPEPCSReqMsg,{settingsIcon:ja})):U=n.every(D.inputLayers,function(qa){return this.isPCSByLayerType(qa)},this):U=this.isPCSByLayerType(D.widget.summaryLayer):U=this.isPCSByLayerType(D.widget.pointLayer):(U=this.isPCSByLayerType(D.widget.inputLayer),"GeographicallyWeightedRegression"!==M||U||(la=p.substitute(D.widget.i18n.GWRPCSReqMsg,{settingsIcon:ja}))):(U=this.isPCSByLayerType(D.widget.analysisLayer),
"FindPointClusters"!==M||U||(la=p.substitute(D.widget.i18n.FPCSReqMsg,{settingsIcon:ja})));U||D.hasPCSWarnShown||(D.widget.set("disableRunAnalysis",U),this.settingsVM&&this.settingsDlg&&D.widget._bodyNode&&D.widget._errorMessagePane&&(this.showMessages(la,D.widget._bodyNode,D.widget._errorMessagePane),A.byId(D.widget.id+"_warn_settings_link")&&F(A.byId(D.widget.id+"_warn_settings_link"),"click",k.hitch(D.widget,D.widget.showSettingsDlg))));!U&&D.hasPCSWarnShown&&S&&(U=!0);return U},tryParseJSON:function(D){try{var M=
h.parse(D);if(M&&"object"===typeof M&&null!==M)return M}catch(X){}return!1},decodeTag:function(D){return{"\x26lt;":"\x3c","\x26gt;":"\x3e"}[D]||D},stringDecode:function(D){return D.replace(/(&lt;|&gt;)/g,this.decodeTag)},jobParamsToWidgetProps:function(D){if(D&&D.jobParams){var M=D.jobParams,X=new B,U=[],ka=[],S;for(S in M){var ja;M.hasOwnProperty(S)&&("string"===typeof M[S]&&-1!==M[S].search(/(&lt;|&gt;)/g)&&(M[S]=this.stringDecode(M[S])),ja="string"===typeof M[S]?this.tryParseJSON(M[S]):M[S])&&
(-1!==S.toLowerCase().indexOf("layer")&&"object"===typeof ja?ka.push({key:S,obj:ja}):ja&&(ja.Raster||ja.url)&&ka.push({key:S,obj:ja}),M[S]=ja)}for(S=0;S<ka.length;S++){ja=ka[S].obj;var la=ka[S].key;"object"===typeof ja&&ja.length?(M[la]=[],n.forEach(ja,function(qa,ta){this._getFlayers(qa,la,M,U,!0,ta)},this)):"object"===typeof ja&&ja.Raster?(ja.url=ja.Raster.url,this._getFlayers(ja,la,M,U,!0,"Raster")):this._getFlayers(ja,la,M,U)}C(U).then(k.hitch(this,function(){X.resolve(D)}),k.hitch(this,function(){X.resolve(D)}));
return X.promise}},_getLayerType:function(D){return D?-1!==D.indexOf("BigDataCatalogServer")?ma.BIGDATA:-1!==D.indexOf("ImageServer")?ma.IS:ma.FS:null},_getFlayers:function(D,M,X,U,ka,S){if(D.url){var ja=V({url:D.url,content:{f:"json"}});var la=new B;U.push(la);ja.then(k.hitch(this,function(qa,ta,Ba,wa,ua){var ra=this._getLayerType(qa.url);if(ra===ma.FS){var sa=new O(qa.url,{mode:O.MODE_ONDEMAND,outFields:["*"],resourceInfo:ua});qa.filter&&sa.setDefinitionExpression(qa.filter);sa.filter=qa.filter}else ra===
ma.BIGDATA?(sa=ua,k.mixin(sa,qa)):ra===ma.IS&&(ua=qa.Raster||qa,sa=new T(ua.url),ua.renderingRule&&sa.setRenderingRule(new na(ua.renderingRule)),ua.name&&(sa.name=ua.name),qa.Raster&&qa.Raster.url===qa.url&&delete qa.url);qa.name&&(sa.name=qa.name);ka?X[ta][wa]=sa:ka&&ra===ma.IS?k.mixin(X[ta][wa],sa):X[ta]=sa;Ba.resolve()},D,M,la,S),k.hitch(this,function(qa,ta,Ba,wa,ua){qa={name:qa.name,empty:!0};ka?X[ta][wa]=qa:X[ta]=qa;Ba.resolve()},D,M,la,S))}else U=new O(D,{outFields:["*"]}),D.name&&(U.name=D.name),
ka?X[M][S]=U:X[M]=U},isLayerInLayers:function(D,M){return n.some(M,function(X){return this.isSameLayer(D,X)},this)},addBlankOption:function(D,M){M&&M.length?M.push({value:"  ",label:""}):D.addOption({value:"  ",label:""});setTimeout(k.hitch(this,this._validateSelectUI,D),100)},_validateSelectUI:function(D){D._hasBeenBlurred=!0;D.set("focused",!0);D.validate();D.set("focused",!1);D._hasBeenBlurred=!1;setTimeout(k.hitch(this,function(){D.reset()}),1E3)},updateExpressions:function(D){D&&D.selectedInputLayers&&
D.inputLayers&&D.data&&D.expressions&&(n.forEach(D.selectedInputLayers,function(M,X){n.forEach(D.inputLayers,function(U,ka){U&&M&&(!M.url&&!U.url&&M.name===U.name||M.url&&U.url&&M.url===U.url)&&(M._oldIndex=X,M._newIndex=ka)})}),n.forEach(D.data,function(M,X){0<X&&M&&(X=D.expressions[X-1],fa.isDefined(M.layer)&&(M.layer=X&&X.layer),fa.isDefined(M.selectingLayer)&&(M.selectingLayer=X&&X.selectingLayer))}),n.forEach(D.data,function(M){var X=!1,U=!1;n.forEach(D.selectedInputLayers,function(ka){fa.isDefined(M.layer)&&
M.layer===ka._oldIndex&&!X&&(M.layer=ka._newIndex,X=!0);fa.isDefined(M.selectingLayer)&&M.selectingLayer===ka._oldIndex&&!U&&(M.selectingLayer=ka._newIndex,U=!0)},this)},this))},isBigDataTypeTobeAdded:function(D){return-1==n.indexOf(D,'type:"Big Data File Share"')?!0:!1},removeDuplicates:function(D,M){for(var X=[],U={},ka=0;ka<D.length;ka++)U[D[ka]]?U[D[ka]]+=1:(X.push(D[ka]),U[D[ka]]=1);return M?U:X},isPoint:function(D){return D&&D.geometryType===ia.GeometryTypes.Point},isLine:function(D){return D&&
D.geometryType===ia.GeometryTypes.Line},isPolygon:function(D){return D&&D.geometryType===ia.GeometryTypes.Polygon},isSameLayer:function(D,M){return D&&M&&(D.name&&M.name&&D.name===M.name||D.url&&M.url&&D.url===M.url)},getTimeType:function(D){return D?fa.isDefined(D.timeInfo)&&fa.isDefined(D.timeInfo.startTimeField)&&!fa.isDefined(D.timeInfo.endTimeField)?ia.TimeTypes.Instant:fa.isDefined(D.timeInfo)&&fa.isDefined(D.timeInfo.startTimeField)&&fa.isDefined(D.timeInfo.endTimeField)?ia.TimeTypes.Interval:
fa.isDefined(D.time)&&fa.isDefined(D.time.timeType)?D.time.timeType:!1:!1},fetchGroupForRFT:function(D){var M=new B,X=a.locale,U=X?X.substring(0,2):"en";X=this.systemRFTGroupName+" owner: ("+("en"===U?["esri_en"]:["esri_en","esri_"+U]).join(" OR ")+")";D.queryGroups({q:X},!0).then(function(ka){0<ka.total&&ka.results?(ka=ka.results,ka=this.findRFTLocaleGroup(ka,U)||this.findRFTLocaleGroup(ka,"en"),M.resolve(ka)):M.resolve(null)}.bind(this));return M},findRFTLocaleGroup:function(D,M){var X;D.some(function(U){var ka=
U.owner;if(ka&&ka.substring(ka.length-2)===M)return X=U,!0});return X},updateOptions:function(D,M){if(D){for(;0<D.getOptions().length;)D.removeOption(D.getOptions());D._setDisplay("");M&&0<M.length&&D.addOption(M)}},addOptionsFromLayers:function(D){D.select&&D.layers&&(D.customOptions=D.customOptions||[],D.forbiddenLayers=D.forbiddenLayers||[],D.layers.forEach(function(M,X){this.isLayerInLayers(M,D.forbiddenLayers)||D.customOptions.push({value:X.toString(),label:M.name,selected:D.selectedOption&&
this.isSameLayer(D.selectedOption,M)})},this),this.updateOptions(D.select,D.customOptions),this.addBrowseOptionForTool({select:D.select,disableLAAL:!0},D.widget))},replaceTag:function(D){return{"\x26":"\x26amp;","\x3c":"\x26lt;","\x3e":"\x26gt;"}[D]||D},safetagsReplace:function(D){return D.replace(/[<>]/g,this.replaceTag)}});f("extend-esri")&&k.setObject("dijit.analysis.utils",H,ea);return H})},"dojo/fx/easing":function(){define(["../_base/lang"],function(H){var k={linear:function(n){return n},quadIn:function(n){return Math.pow(n,
2)},quadOut:function(n){return n*(n-2)*-1},quadInOut:function(n){n*=2;return 1>n?Math.pow(n,2)/2:-1*(--n*(n-2)-1)/2},cubicIn:function(n){return Math.pow(n,3)},cubicOut:function(n){return Math.pow(n-1,3)+1},cubicInOut:function(n){n*=2;return 1>n?Math.pow(n,3)/2:(Math.pow(n-2,3)+2)/2},quartIn:function(n){return Math.pow(n,4)},quartOut:function(n){return-1*(Math.pow(n-1,4)-1)},quartInOut:function(n){n*=2;return 1>n?Math.pow(n,4)/2:-.5*(Math.pow(n-2,4)-2)},quintIn:function(n){return Math.pow(n,5)},quintOut:function(n){return Math.pow(n-
1,5)+1},quintInOut:function(n){n*=2;return 1>n?Math.pow(n,5)/2:(Math.pow(n-2,5)+2)/2},sineIn:function(n){return-1*Math.cos(Math.PI/2*n)+1},sineOut:function(n){return Math.sin(Math.PI/2*n)},sineInOut:function(n){return-1*(Math.cos(Math.PI*n)-1)/2},expoIn:function(n){return 0==n?0:Math.pow(2,10*(n-1))},expoOut:function(n){return 1==n?1:-1*Math.pow(2,-10*n)+1},expoInOut:function(n){if(0==n)return 0;if(1==n)return 1;n*=2;if(1>n)return Math.pow(2,10*(n-1))/2;--n;return(-1*Math.pow(2,-10*n)+2)/2},circIn:function(n){return-1*
(Math.sqrt(1-Math.pow(n,2))-1)},circOut:function(n){return Math.sqrt(1-Math.pow(n-1,2))},circInOut:function(n){n*=2;return 1>n?-.5*(Math.sqrt(1-Math.pow(n,2))-1):.5*(Math.sqrt(1-Math.pow(n-2,2))+1)},backIn:function(n){return Math.pow(n,2)*(2.70158*n-1.70158)},backOut:function(n){--n;return Math.pow(n,2)*(2.70158*n+1.70158)+1},backInOut:function(n){n*=2;if(1>n)return Math.pow(n,2)*(3.5949095*n-2.5949095)/2;n-=2;return(Math.pow(n,2)*(3.5949095*n+2.5949095)+2)/2},elasticIn:function(n){if(0==n||1==n)return n;
--n;return-1*Math.pow(2,10*n)*Math.sin(2*(n-.075)*Math.PI/.3)},elasticOut:function(n){return 0==n||1==n?n:Math.pow(2,-10*n)*Math.sin(2*(n-.075)*Math.PI/.3)+1},elasticInOut:function(n){if(0==n)return 0;n*=2;if(2==n)return 1;var q=.3*1.5,m=q/4;if(1>n)return--n,-.5*Math.pow(2,10*n)*Math.sin(2*(n-m)*Math.PI/q);--n;return.5*Math.pow(2,-10*n)*Math.sin(2*(n-m)*Math.PI/q)+1},bounceIn:function(n){return 1-k.bounceOut(1-n)},bounceOut:function(n){return n<1/2.75?7.5625*Math.pow(n,2):n<2/2.75?7.5625*Math.pow(n-
1.5/2.75,2)+.75:n<2.5/2.75?7.5625*Math.pow(n-2.25/2.75,2)+.9375:7.5625*Math.pow(n-2.625/2.75,2)+.984375},bounceInOut:function(n){return.5>n?k.bounceIn(2*n)/2:k.bounceOut(2*n-1)/2+.5}};H.setObject("dojo.fx.easing",k);return k})},"dojox/mvc/equals":function(){define(["dojo/_base/array","dojo/_base/lang","dojo/Stateful","./StatefulArray"],function(H,k,n,q){var m=function(l,b,a){a=a||m;var c=[a.getType(l),a.getType(b)];return c[0]!=c[1]?!1:a["equals"+c[0].replace(/^[a-z]/,function(f){return f.toUpperCase()})](l,
b)};return k.setObject("dojox.mvc.equals",k.mixin(m,{getType:function(l){return k.isArray(l)?"array":k.isFunction((l||{}).getTime)?"date":null!=l&&("[object Object]"=={}.toString.call(l)||k.isFunction((l||{}).set)&&k.isFunction((l||{}).watch))?"object":"value"},equalsArray:function(l,b){for(var a=0,c=Math.max(l.length,b.length);a<c;a++)if(!m(l[a],b[a]))return!1;return!0},equalsDate:function(l,b){return l.getTime()==b.getTime()},equalsObject:function(l,b){var a=k.mixin({},l,b),c;for(c in a)if(!(c in
n.prototype||"_watchCallbacks"==c||m(l[c],b[c])))return!1;return!0},equalsValue:function(l,b){return l===b}}))})},"dojox/mvc/StatefulArray":function(){define(["dojo/_base/lang","dojo/Stateful"],function(H,k){function n(m){m._watchElementCallbacks&&m._watchElementCallbacks(void 0,[],[]);return m}var q=function(m){m=H._toArray(m||[]);m.constructor=q;return H.mixin(m,{pop:function(){return this.splice(this.get("length")-1,1)[0]},push:function(){this.splice.apply(this,[this.get("length"),0].concat(H._toArray(arguments)));
return this.get("length")},reverse:function(){return n([].reverse.apply(this,H._toArray(arguments)))},shift:function(){return this.splice(0,1)[0]},sort:function(){return n([].sort.apply(this,H._toArray(arguments)))},splice:function(l,b){var a=this.get("length");l+=0>l?a:0;var c=Math.min(l,a),f=this.slice(l,l+b),e=H._toArray(arguments).slice(2);[].splice.apply(this,[l,b].concat(Array(e.length)));for(var g=0;g<e.length;g++)this[c+g]=e[g];this._watchElementCallbacks&&this._watchElementCallbacks(l,f,
e);this._watchCallbacks&&this._watchCallbacks("length",a,a-f.length+e.length);return f},unshift:function(){this.splice.apply(this,[0,0].concat(H._toArray(arguments)));return this.get("length")},concat:function(l){return new q([].concat.apply(this,arguments))},join:function(l){for(var b=[],a=this.get("length"),c=0;c<a;c++)b.push(this.get(c));return b.join(l)},slice:function(l,b){var a=this.get("length");b=(void 0===b?a:b)+(0>b?a:0);var c=[];for(l=l+(0>l?a:0)||0;l<Math.min(b,this.get("length"));l++)c.push(this.get(l));
return new q(c)},watchElements:function(l){var b=this._watchElementCallbacks,a=this;b||(b=this._watchElementCallbacks=function(f,e,g){for(var d=[].concat(b.list),h=0;h<d.length;h++)d[h].call(a,f,e,g)},b.list=[]);b.list.push(l);var c={};c.unwatch=c.remove=function(){for(var f=b.list,e=0;e<f.length;e++)if(f[e]==l){f.splice(e,1);break}};return c}},k.prototype,{set:function(l,b){if("length"==l)l=this.get("length"),l<b?this.splice.apply(this,[l,0].concat(Array(b-l))):b<l&&this.splice.apply(this,[b,l-b]);
else{var a=this.length;k.prototype.set.call(this,l,b);a!=this.length&&k.prototype.set.call(this,"length",this.length)}return this},isInstanceOf:function(l){return k.prototype.isInstanceOf.apply(this,arguments)||l==q}})};q._meta={bases:[k]};return H.setObject("dojox.mvc.StatefulArray",q)})},"esri/dijit/analysis/HelpWindow":function(){define("require dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/event dojo/_base/kernel dojo/aspect dojo/has dojo/dom-construct dojo/dom-class dojo/dom-attr dojo/dom-style dojo/query dojo/window dojo/dom-geometry dijit/_Widget dijit/TooltipDialog dijit/popup ../../kernel ../../lang ../../urlUtils ../../request ../_EventedWidget dojo/i18n!../../nls/jsapi".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G,x,v){n=n([w],{declaredClass:"esri.dijit.analysis.HelpWindow",i18n:null,onlineHelpMap:null,showLearnMore:!1,"class":"esriAnalyisHelpWindow",constructor:function(z){this.isPortal=z&&z.isPortal},postMixInProperties:function(){this.inherited(arguments);this.i18n={};q.mixin(this.i18n,v.common);q.mixin(this.i18n,v.analysisHelp)},postCreate:function(){this.inherited(arguments);var z=["ar","he"],A;this.onlineHelpMap={};for(A=0;A<z.length;A+=1){var F=
z[A];b.locale&&-1!==b.locale.indexOf(F)&&(-1!==b.locale.indexOf("-")?-1!==b.locale.indexOf(F+"-")&&(this._isRightToLeft=!0):this._isRightToLeft=!0)}z=H.toUrl(this.isPortal?"./help/helpmap_enterprise.json":"./help/helpmap.json");G({url:z}).then(q.hitch(this,function(J){this.onlineHelpMap=J.map}));this._initSelfHelpMap()},_getAbsoluteUrl:function(z){var A=C.getProtocolForWebResource();if(/^https?:/i.test(z))return z;if(/^\/\//i.test(z))return A+z;if(/^\//i.test(z))return A+"//"+window.location.host+
z},_computeSize:function(z){var A={w:400,h:200};c("esri-mobile")?A={w:"50%",h:"90%"}:-1!==z.indexOf("Category")?(A.w=400,A.h=320):-1!==z.indexOf("Tool")?(A.w=400,A.h=320):-1!==z.indexOf("toolDescription")&&(A.w=400,A.h=520);return A},_initSelfHelpMap:function(){this.isPortal&&this.portalSelf&&this.portalSelf.helpMap&&(this.selfHelpMap=this.portalSelf.helpMap.m)},_setHelpTopicAttr:function(z){this.tooltipHelpDlg&&(r.close(this.tooltipHelpDlg),this.tooltipHelpDlg.destroy(),this.tooltipHelpDlg=null);
var A="";this.showLearnMore=!1;var F=this._analysisGpServer&&-1!==this._analysisGpServer.indexOf("dev")?"dev":this._analysisGpServer&&-1!==this._analysisGpServer.indexOf("qa")?"uat":"";A=this.isPortal?"-PortalOnly":"-OnlineOnly";var J=q.clone(b.locale);var L="es-es es-mx fr-fr fr-ch it-ch it-it de-de de-ch".split(" ");"nb"===J?J="no":-1!==k.indexOf(L,J)&&(J=J.split("-")[0]);var P="ar bs ca cs da de es el et fi fr he hr hu id it ja ko lt lv ru nl no pl pt-br pt-pt ro sl sk sv sr th tr uk vi zh-cn zh-hk zh-tw".split(" ");
var Q="ar de es fr it ja ko ru pl pt-br zh-cn".split(" ");if("SHOWHELPURL"===z)L=this.helpIdUrl,this.showLearnMore=!1;else{L=H.toUrl("esri/dijit/analysis/help/"+this.helpFileName+".html");var Z=this.helpFileName;if(B.isDefined(this.onlineHelpMap[Z])&&B.isDefined(this.onlineHelpMap[Z][z])){this.showLearnMore=!0;var ca="https://doc"+F+".arcgis.com/en/arcgis-online/analyze/"+this.onlineHelpMap[Z][z];this.isPortal&&this.helpBase&&this.selfHelpMap&&(ca=this.helpBase+this.selfHelpMap[this.onlineHelpMap[Z][z]])}-1!==
k.indexOf(P,J)&&(-1!==J.indexOf("-")&&(J=J.split("-"),J=J[0]+"-"+J[1].toUpperCase()),L=H.toUrl("esri/dijit/analysis/help/"+J+"/"+this.helpFileName+".html"));-1!==k.indexOf(Q,J)&&this.showLearnMore&&(ca="https://doc"+F+".arcgis.com/"+J+"/arcgis-online/analyze/"+this.onlineHelpMap[Z][z],this.isPortal&&this.helpBase&&this.selfHelpMap?ca=this.helpBase+this.selfHelpMap[this.onlineHelpMap[Z][z]]:this.isPortal&&!this.helpBase&&(ca="https://server"+F+".arcgis.com/"+J+"/portal/latest/use/"+this.onlineHelpMap[Z][z]))}this._size=
F=this._computeSize(z);this.tooltipHelpDlg=new u({preload:!0,content:"\x3cdiv class\x3d'' style\x3d'position:relative'\x3cdiv class\x3d'sizer content'\x3e\x3cdiv class\x3d'contentPane'\x3e\x3cdiv class\x3d'esriFloatTrailing' style\x3d'padding:0;'\x3e\x3ca href\x3d'#' class\x3d'esriAnalysisCloseIcon' title\x3d'"+this.i18n.close+"'\x3e\x3c/a\x3e\x3c/div\x3e\x3ciframe frameborder\x3d'0'  id\x3d'"+z+"' src\x3d'"+L+"#"+z+A+"' width\x3d'"+F.w+"' height\x3d'"+F.h+"' marginheight\x3d'0' marginwidth\x3d'0'\x3e\x3c/iframe\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d'sizer'\x3e\x3cdiv class\x3d'actionsPane'\x3e\x3cdiv class\x3d'actionList"+
(this.showLearnMore?"'\x3e":" hidden'\x3e")+"\x3ca class\x3d'action zoomTo' href\x3d'"+(this.showLearnMore?ca:"#")+"' target\x3d'_help'\x3e"+this.i18n.learnMore+"\x3c/a\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e","class":"esriHelpPopup esriHelpPopupWrapper esriAnalyisHelpWindow"});this.tooltipHelpDlg.startup()},show:function(z,A){this.helpFileName=A.helpFileName;this._analysisGpServer=A.analysisGpServer;this.isPortal=A.isPortal;this.helpBase=A.helpBase;A.portalSelf&&(this.portalSelf=
A.portalSelf);this.selfHelpMap||this._initSelfHelpMap();A.analysisMode&&(this.analysisMode=A.analysisMode);A.showHelpFromUrl&&A.helpUrl&&(this.showHelpFromUrl=A.showHelpFromUrl,this.helpIdUrl=A.helpUrl,A.helpId="SHOWHELPURL");this.set("helpTopic",A.helpId);var F=a.after(r,"open",q.hitch(this,function(){h(".esriAnalysisCloseIcon",this.tooltipHelpDlg.domNode).on("click",q.hitch(this,this.close));F.remove()})),J=z.pageX,L=p.getBox(),P;var Q=!1;if(A.helpParentNode)var Z=A.helpParentNode;Z&&(P=t.position(Z));
P&&L.w-z.pageX<P.w?(Q=!0,J=P.x-this._size.w-10,this._isRightToLeft&&(J-=10)):this._isRightToLeft&&J-40<this._size.w&&(J=P.w+this._size.w+80);r.open({popup:this.tooltipHelpDlg,x:!0===this._isRightToLeft||Q?J-40:J+40,y:z.screenY-z.pageY+10,onCancel:q.hitch(this,function(){this.close()}),onExecute:function(){this.close()}});this.tooltipHelpDlg.domNode.parentNode&&d.set(this.tooltipHelpDlg.domNode.parentNode,"overflowY","hidden")},close:function(z,A){r.close(this.tooltipHelpDlg)}});c("extend-esri")&&
q.setObject("dijit.analysis.HelpWindow",n,y);return n})},"esri/dijit/BrowseItems":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/window dojo/_base/event dojo/dom-class dojo/dom-style dojo/dom-attr dojo/string dojo/on dojo/aspect dojo/has dojo/dom dojo/dom-construct dojo/mouse dojo/topic dojo/query dojo/parser dijit/registry dijit/TooltipDialog dijit/popup dojo/promise/all dojo/Deferred dgrid/Grid dgrid/extensions/Pagination dgrid/extensions/DijitRegistry dgrid/OnDemandGrid dgrid/Selection dgrid/selector dgrid/Keyboard dgrid/util/mouse dgrid/util/touch put-selector/put dojo/store/Observable dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin ../arcgis/Portal ../Evented ../PluginTarget dojo/i18n!../nls/jsapi ./_AppTemplateFiltersMixin ./_RefreshMixin ../kernel ../lang ../config ../geometry/webMercatorUtils ../tasks/GeometryService ../SpatialReference dojo/NodeList-dom".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G,x,v,z,A,F,J,L,P,Q,Z,ca,da,ea,fa,K,V,aa,Y,I,O,E,N,R,W,ha,oa){var ma=H(null,{idProperty:"id",constructor:function(T){H.safeMixin(this,T)},get:function(T,ba){return K.PortalUtil.request(this.portalUrl+"content/items/"+T,ba).then(function(na){return new K.PortalItem(k.mixin(na,{portal:this.portal}))})},getIdentity:function(T){return T[this.idProperty]},query:function(T,ba){T=k.isObject(T)?T:{q:T};var na=null;if(ba){T=k.mixin(T,{num:ba.count,start:(ba.start||
0)+1});if(ba.sort&&ba.sort.length){var ia=ba.sort[0];T=k.mixin(T,{sortField:encodeURIComponent("created"===ia.attribute?"uploaded":ia.attribute),sortOrder:ia.descending?"desc":"asc"})}ba.useExtent&&ba.extent&&(T.bbox=ba.extent);ba.queryType&&"group"===ba.queryType&&(na="group")}ba="group"===na?this.portal.queryGroups(T,!0).then(function(pa){pa.results.total=pa.total;return pa.results}):this.portal.queryItems(T,!0).then(function(pa){pa.results.total=pa.total;return pa.results});return K.PortalResult(ba)}});
q=H([da,ea,fa,aa],{templateString:'\x3cdiv\x3e\x3cdiv class\x3d"top-bar"\x3e\x3cdiv  class\x3d"esriFloatLeading instructions"\x3e\x3cspan class\x3d"messageLeft hide" data-dojo-attach-point\x3d"messageNodeLeft"\x3e\x3c/span\x3e\x3cspan class\x3d"messageRight hide" data-dojo-attach-point\x3d"messageNodeRight"\x3e\x3c/span\x3e\x3ca tabIndex\x3d"-1" data-dojo-attach-point\x3d"helpLink" class\x3d"esriHelpIcon hide" title\x3d"${i18n.browseItems.learnMoreConfigurableApps}" href\x3d"#" target\x3d"_blank"\x3e\x3c/a\x3e\x3c/div\x3e\x3cdiv id\x3d"${id}_search"class\x3d"searchBar esriFloatTrailing"\x3e\x3cinput tabIndex\x3d"1" placeholder\x3d"${i18n.browseItems.searchTitle}" class\x3d"esriSearchBox dijitTextBox" type\x3d"search"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"gallery"\x3e\x3cdiv class\x3d"gallery-left  quiet-scroll"\x3e\x3cul class\x3d"filters"\x3e\x3c/ul\x3e\x3c/div\x3e\x3cdiv class\x3d"templates gallery-right"\x3e\x3cp id\x3d"${id}_filterTitle" class\x3d"filter-title hide" data-dojo-attach-point\x3d"filterDescription"\x3e\x3c/p\x3e\x3cdiv id\x3d"${id}_grid"class\x3d"dgrid-autoheight quiet-scroll"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv  class\x3d"loaderWrap" data-dojo-attach-point\x3d"loaderWrap"\x3e\x3c/div\x3e\x3cdiv  class\x3d"js-info-panel templateInfoPanel" data-dojo-attach-point\x3d"infoPanel"\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e',
galleryTemplate:"\x3cdiv style\x3d'opacity:1;' class\x3d'grid-item gallery-view'\x3e${item:_formatThumbnail}${item:_formatItemTitle}\x3cp class\x3d\"template-overlay\" style\x3d\"display:none;\"\x3e${i18n.browseItems.selectDetails}\x3c/p\x3e\x3c/div\x3e",infoPanelTemplate:'\x3cdiv\x3e\x3cdiv class\x3d"template-info-showing"\x3e\x3cdiv class\x3d"thumbnail"\x3e\x3cimg src\x3d"${item:_formatInfoPanelImage}"\x3e\x3c/div\x3e\x3ch4\x3e${item.title}\x3c/h4\x3e\x3cdiv class\x3d"template-info"\x3e\x3cp class\x3d"quiet-scroll"\x3e${item.snippet}\x3c/p\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"panel-actions"\x3e\x3cbutton class\x3d"btn blue btn-main" id\x3d"on-next"\x3e${i18n.browseItems.configure}\x3c/button\x3e\x3cbutton class\x3d"btn btn-cancel" id\x3d"close-panel"\x3e${i18n.common.close}\x3c/button\x3e\x3c/div\x3e\x3cdiv\x3e',
_popupTemplate:'\x3cdiv class\x3d"esriBrowsePopup quiet-scroll"\x3e\x3cp\x3e{summary}\x3c/p\x3e\x3c/div\x3e',showInfoPanel:!0,isAutoClose:!0,showTooltip:!1,filterWithinGroup:!0,checkIsButtonEnabled:!1,baseClass:"esriBrowseItemsCtr",i18n:Y,postMixInProperties:function(){this.inherited(arguments)},postCreate:function(){this.inherited(arguments);this.self?(this._portal=new K.Portal({url:this.portalUrl,self:this.self}),this._init(),this._portal.on("load",k.hitch(this,function(){this.emit("portal-load",
{portal:this._portal});this._fetchData()}))):(this._portal=new K.Portal(this.portalUrl),this._portal.signIn().then(k.hitch(this,function(){this.emit("portal-load",{portal:this._portal});this._init();this._fetchData()})))},_init:function(){this._canSearchPublic=this.self?this.self.canSearchPublic:this._portal.canSearchPublic;this.query=k.mixin(this.query||{},{get:function(T){return this[T]&&this[T].length?"("+this[T].join(" OR ")+") ":""},toString:function(){return{q:this.get("groups")+this.get("tags")+
this.get("persistentTypekeywords")+this.get("typekeywords")+this.get("types")+this.get("owners")+this.get("orgids")+this.get("custom")+(this.query||"")+(this.search||"")+' -type:"Attachment" -tags:"mature support"'}}});this.self?this.self.canSearchPublic=!0:this._portal.canSearchPublic=!0;this.galleryTemplate=this.plugIn&&this.plugIn.galleryTemplate||this.galleryTemplate;this.infoPanelTemplate=this.plugIn&&this.plugIn.infoPanelTemplate||this.infoPanelTemplate;if(this.helpLinkUrl=this.plugIn&&this.plugIn.helpLinkUrl||
"")a.set(this.helpLink,"href",this.helpLinkUrl),l.remove(this.helpLink,"hide");w(".templates",this.domNode).addClass("fade");w(".dgrid-footer",this.domNode).addClass("hide");b.set(this.infoPanel,"display","none")},destroy:function(){this.inherited(arguments);this._grid&&this._grid.destroy();this._img_connect&&(this._img_connect.remove(),this._img_connect_error.remove());this._queryTimer&&clearTimeout(this._queryTimer);this._grid=this._portal=null},closeInfoPanel:function(){d.byId("close-panel").click()},
_setItemQueryAttr:function(T){this.itemQuery=T},_setPluginAttr:function(T){this.addPlugin(T)},_setMessageAttr:function(T){this.set("messageRight",T)},_setMessageRightAttr:function(T){"string"===typeof T?a.set(this.messageNodeRight,"innerHTML",T):T instanceof HTMLElement&&h.place(T,this.messageNodeRight);l.remove(this.messageNodeRight,"hide")},_setMessageLeftAttr:function(T){"string"===typeof T?a.set(this.messageNodeLeft,"innerHTML",T):T instanceof HTMLElement&&h.place(T,this.messageNodeLeft);l.remove(this.messageNodeLeft,
"hide")},_setDisabledAttr:function(T){var ba=r.findWidgets(this.domNode).concat(r.findWidgets(this._content));n.forEach(ba,function(na){na.set("disabled",T)});l[T?"add":"remove"](this._interval.domNode,"dijitTextBoxDisabled")},_setSortAttr:function(T){this.sortAttribute=T},_setSortDescendingAttr:function(T){this.sortDescending=T},_getSelectionAttr:function(){var T=this._grid.selection,ba;for(ba in T)if(T.hasOwnProperty(ba))break;return ba&&this._grid.row(ba).data},_setGalleryTemplateAttr:function(T){N.isDefined(T)&&
(this.galleryTemplate=T)},_setFormatThumbnailAttr:function(T){N.isDefined(T)&&"function"===typeof T&&(this._formatThumbnail=T)},_setFormatItemTitleAttr:function(T){N.isDefined(T)&&"function"===typeof T&&(this._formatItemTitle=T)},_setRowsPerPageAttr:function(T){this._set("rowsPerPage",T)},_setPagingLinksAttr:function(T){this._set("pagingLinks",T)},_getQueryAttr:function(){return this.query},_setQueryAttr:function(T){this._set("query",T);this._grid&&this._grid.set("query",T.toString())},_setExtentAttr:function(T){T&&
this._set("extent",this._extentToString(T))},_setUseExtentAttr:function(T){this._set("useExtent",T)},_setQueryTypeAttr:function(T){this._set("queryType",T)},_setFetchTimeoutAttr:function(T){this._set("fetchTimeout",T)},_setShowInfoPanelAttr:function(T){this._set("showInfoPanel",T)},_setSelectionModeAttr:function(T){-1===n.indexOf(["extended","toggle","multiple","single","none"],T)&&(console.log("Incorrect Value provided for selectionMode. It is one of the following: extended, toggle, multiple, single, none"),
T="single");this._set("selectionMode",T)},_setDemandListAttr:function(T){this._set("demandList",T)},_validate:function(){return!!this.get("selection")},reset:function(){w(".esriSearchBox",d.byId(this.id+"_search")).forEach(function(pa){a.set(pa,"value","")});this.query.search="";if(this.plugIn.filters){var T=[],ba=[],na=[],ia=[];w("li.active",this.domNode).forEach(function(pa){l.remove(pa,"active");var D=this.plugIn.filters[pa.childNodes[0].id];pa=n.map(D.tags,function(U){return'tags:"'+U+'"'},this);
var M=n.map(D.owners,function(U){return'owner:"'+U+'"'},this),X=n.map(D.orgids,function(U){return'orgid:"'+U+'"'},this);D=n.map(D.typekeywords,function(U){return'typekeywords:"'+U+'"'},this);T.push(pa);na.push(M);ia.push(X);ba.push(D)},this);this.query.tags=n.filter(this.query.tags,function(pa){return-1!==n.indexOf(T,pa)});this.query.owners=n.filter(this.query.owners,function(pa){return-1!==n.indexOf(na,pa)});this.query.orgids=n.filter(this.query.orgids,function(pa){return-1!==n.indexOf(ia,pa)});
this.query.typekeywords=n.filter(this.query.typekeywords,function(pa){return-1!==n.indexOf(ba,pa)});d.byId("all").click()}},_showPopup:function(T){if(!this._isInsideTooltipDialog){this._closePopup();var ba=this._grid.row(T);T=w("img",ba.element)[0];if(ba={summary:ba.data.snippet},ba.summary)this._tooltip=new y({content:k.replace(this._popupTemplate,ba),onMouseEnter:k.hitch(this,function(){this._isInsideTooltipDialog=!0}),onMouseLeave:k.hitch(this,function(){this._isInsideTooltipDialog=!1;this._closePopup()})}),
B.open({className:"esriBrowsePopupCtr",popup:this._tooltip,around:T,orient:["after-centered","before-centered"]}),this._onCloseConnect=w(".dijitDialogCloseIcon",this._tooltip.domNode).on("click",k.hitch(this,function(na){na.preventDefault();this._closePopup()}))}},_closePopup:function(){this._tooltip&&(this._onCloseConnect&&this._onCloseConnect.remove(),B.close(this._tooltip),this._tooltip.destroyRecursive(),this._tooltip=this._onCloseConnect=void 0)},_clearQueryTimeout:function(){clearTimeout(this._queryTimer);
this._queryTimer=null},_clearClosePanelTimeout:function(){clearTimeout(this._panelClosing);this._panelClosing=null;n.forEach(this._panelClickHandles,"item.remove();");h.empty(this.infoPanel)},_createGrid:function(){var T=H([x,v,F,O,z]),ba=new ca(new ma({portal:this._portal})),na=this.query,ia=k.hitch(this,function(M){M.snippet=M.snippet||"";var X=Z("div");M=c.substitute(this.galleryTemplate,{item:M,i18n:this.i18n},null,this);h.place(M,X);return X}),pa={};this.get("demandList")&&(T=H([x,A,F,O,z]));
this.get("useExtent")&&(pa.extent=this.get("extent"),pa.useExtent=this.get("useExtent"));this.get("queryType")&&(pa.queryType=this.get("queryType"));var D={store:ba,query:na.toString(),selectionMode:this.selectionMode||"single",pagingLinks:this.get("pagingLinks")||2,rowsPerPage:this.plugIn&&this.plugIn.rowsPerPage||this.get("itemsPerPage")||6,loadingMessage:"Loading items...",showLoadingMessage:!1,renderRow:ia,noDataMessage:this.i18n.gallery.noItemsToDisplay,deselectOnRefresh:!("multiple"===this.selectionMode||
"extended"===this.selectionMode||"toggle"===this.selectionMode),sort:[{attribute:this.sortAttribute||"title",descending:this.sortDescending||!1}],queryOptions:pa};this.get("demandList")&&(D={store:ba,query:na.toString(),minRowsPerPage:this.plugIn&&this.plugIn.rowsPerPage||this.get("itemsPerPage")||50,selectionMode:this.selectionMode||"single",loadingMessage:"Loading items...",showLoadingMessage:!1,renderRow:ia,pagingMethod:"throttleDelayed",noDataMessage:this.i18n.gallery.noItemsToDisplay,deselectOnRefresh:!("multiple"===
this.selectionMode||"extended"===this.selectionMode||"toggle"===this.selectionMode),sort:[{attribute:this.sortAttribute||"title",descending:this.sortDescending||!1}],queryOptions:pa});this._grid=new T(D,this.id+"_grid");this._grid.startup();this.own(f(this.domNode,"click",k.hitch(this,function(M){d.byId("close-panel")&&this.isAutoClose&&d.byId("close-panel").click()})),this._grid.on(P.enterRow,k.hitch(this,function(M){!1===l.contains(this.domNode,"showing")&&this.showInfoPanel&&this._showOverlay(!0,
M);this.showTooltip&&!this.showInfoPanel&&this._showPopup(M)})),this._grid.on(P.leaveRow,k.hitch(this,function(M){this._showOverlay(!1,M);this.showTooltip&&!this.showInfoPanel&&this._closePopup(M)})),this._grid.on(".dgrid-row:click",k.hitch(this,function(M){this.emit("grid-row-click",M);if(!1===l.contains(this.domNode,"showing")&&this.showInfoPanel){M.preventDefault();m.stop(M);this._clearClosePanelTimeout();var X=this.get("selection");this._showOverlay(!1,M);this.showInfoPanel&&this.infoPanelTemplate?
(b.set(this.infoPanel,"display","block"),h.place(c.substitute(this.infoPanelTemplate,{item:X,i18n:this.i18n},function(U){return N.isDefined(U)?U:""},this),this.infoPanel)):b.set(this.infoPanel,"display","none");this.emit("show-info-panel");l.add(this.domNode,"showing");this._panelClickHandles=[w(".template-info-showing .thumbnail img",this.domNode).on("error",k.hitch(this,function(U){a.set(U.target,"src",X.thumbnailUrl)})),w(".panel-actions .btn").on("click",k.hitch(this,function(U){U.preventDefault();
m.stop(U);this.checkIsButtonEnabled&&l.contains(U.target,"disabled")||("close-panel"===U.target.id?(l.remove(this.domNode,"showing"),b.set(this.infoPanel,"display","none"),this._panelClosing=setTimeout(k.hitch(this,function(){n.forEach(void 0,"item.remove();");h.empty(this.infoPanel)},250))):(t.publish("/esri/browseitems/close",U.target.id,this.get("selection")),U={selection:this.get("selection"),action:U.target.id},this.emit("browseitems-close",U)))})),w(".js-info-panel",this.domNode).on("click",
k.hitch(this,function(U){this.isAutoClose&&(U.preventDefault(),m.stop(U))})),f(w(".dgrid-footer,.dgrid-header",this._grid.domNode),p.leave,k.hitch(this,function(U){this.showTooltip&&!this.showInfoPanel&&this._closePopup()}))]}})),this._grid.on("dgrid-refresh-complete",k.hitch(this,function(M){w(".templates",this.domNode).removeClass("fade");w(".loaderWrap",this.domNode).addClass("hide");w(".dgrid-footer",this.domNode)[this._grid._total<=this._grid.rowsPerPage?"addClass":"removeClass"]("hide");this.showTooltip&&
!this.showInfoPanel&&this._closePopup()})),this._grid.on("refresh",k.hitch(this,function(){this.showTooltip&&!this.showInfoPanel&&this._closePopup();this._img_connect&&(this._img_connect.remove(),this._img_connect_error.remove(),this._img_connect_error=this._img_connect=null);this._img_connect=w(".grid-item-thumb",this._grid.domNode).on("load",k.hitch(this,function(M){(M=this._grid.row(M))&&M.element&&w(".grid-item",M.element).addClass("fadeIn").style("opacity","1")}));this._img_connect_error=w(".grid-item-thumb",
this._grid.domNode).on("error",k.hitch(this,function(M){a.set(M.target,"src",this._portal.staticImagesUrl+"/desktopapp.png")}))})),f(d.byId(this.id+"_search"),"keyup",k.hitch(this,function(M){M.preventDefault();this._clearQueryTimeout();this._queryTimer=setTimeout(k.hitch(this,function(){this.query.search=a.get(M.target,"value");this._fetchItems(this.query).then(k.hitch(this,function(){this._clearQueryTimeout()}))}),this.searchKeypressDelay||450)})),f(d.byId(this.id+"_search"),"search",k.hitch(this,
function(M){this._queryTimer||(M.preventDefault(),this.query.search=a.get(M.target,"value"),this._fetchItems(this.query))})),this.watch("extent",k.hitch(this,function(M,X,U){this._grid.queryOptions.extent=this.get("extent");this._grid.queryOptions.useExtent=this.get("useExtent");this._grid.query.bbox=this._grid.queryOptions.useExtent?this._grid.queryOptions.extent:"";this._grid.refresh()})),this.watch("useExtent",k.hitch(this,function(M,X,U){this._grid.queryOptions.extent=this.get("extent");this._grid.queryOptions.useExtent=
U;this._grid.query.bbox=this._grid.queryOptions.useExtent?this._grid.queryOptions.extent:"";this._grid.refresh()})));this.showInfoPanel||("single"===this._grid.selectionMode?this.own(this._grid.on("dgrid-select,dgrid-deselect",k.hitch(this,function(M){M={selection:this.get("selection")};this.emit("select-change",M)}))):-1!==n.indexOf(["toggle","multiple","extended"],this._grid.selectionMode)&&this.own(this._grid.on("dgrid-select,dgrid-deselect",k.hitch(this,function(M){M=M.grid.selection;var X,U=
[];for(X in M)M[X]&&U.push(this._grid.row(X).data);this.emit("select-change",{selection:U})}))));this.emit("grid-ready",{grid:this._grid,ready:!0})},_createFilters:function(){if(this.plugIn&&this.plugIn.filters){var T=this.plugIn.filters,ba=this.plugIn.filterStrings,na,ia=w(".filters",this.domNode)[0];for(na in T)h.create("li",{"class":"all"===na?"active":"",innerHTML:"\x3ca id\x3d'"+na+"'  href\x3d'#'\x3e"+ba[na].title+"\x3c/a\x3e"},ia);this.own(f(ia,"li a:click",k.hitch(this,function(pa){pa.preventDefault();
var D=pa.target;w(".active",ia).removeClass("active");l.add(D.parentNode,"active");w(".templates",this.domNode).addClass("fade");setTimeout(k.hitch(this,function(){l["all"===D.id?"add":"remove"](this.filterDescription,"hide");a.set(this.filterDescription,"innerHTML",ba[D.id].description||"")}),225);pa=k.mixin({},T[D.id]||{});this.query.tags=n.map(pa.tags||[],function(M){return'tags:"'+M+'"'});this.query.owners=n.map(pa.owners,function(M){return'owner:"'+M+'"'});this.query.orgids=n.map(pa.orgids,function(M){return'orgid:"'+
M+'"'});this.query.typekeywords=[].concat(n.map(pa.typekeywords||[],function(M){return'typekeywords:"'+M+'"'}));this.filterWithinGroup||(this.query.groups=n.map(pa.groups,function(M){return'group:"'+M+'"'}));this._fetchItems(this.query)})));l.add(this.domNode,"filters");l.remove(this.domNode,"nofilters")}else l.add(this.domNode,"nofilters"+(this.plugIn&&this.plugIn.extraClasses?" "+this.plugIn.extraClasses.join(" "):"")),l.remove(this.domNode,"filters")},_showOverlay:function(T,ba){(ba=this._grid.row(ba))&&
w(".template-overlay",ba.element).style("display",T?"":"none")},_fetchData:function(){this._user=this._portal.getPortalUser();return this.plugIn&&this.plugIn.fetchData?this.plugIn.fetchData():this._fetchItems(this.itemQuery)},_fetchItems:function(T,ba){var na={sort:[{attribute:this.sortAttribute||"title",descending:this.sortDescending||!1}]},ia=new G;this.get("useExtent")&&(na.extent=this.get("extent"),na.useExtent=this.get("useExtent"));this.get("queryType")&&(na.queryType=this.get("queryType"));
w(".templates",this.domNode).addClass("fade");w(".dgrid-footer",this.domNode).addClass("hide");w(".loaderWrap",this.domNode).removeClass("hide");setTimeout(k.hitch(this,function(){this.query=k.mixin(this.query,T);this._grid?this._grid.set("query",this.query.toString(),na):(this._createFilters(),this._createGrid());ia.resolve(this._grid)}),60);return ia},_formatThumbnail:function(T){var ba=T.thumbnailUrl||this._portal.staticImagesUrl+"/desktopapp.png";T.thumbnailUrl=ba;return"\x3cimg class\x3d'grid-item-thumb' width\x3d'187px' height\x3d'125px' alt\x3d'' src\x3d'"+
ba+"'\x3e"},_formatInfoPanelImage:function(T){var ba=T.screenshots&&T.screenshots.length?T.screenshots[0]:null;return ba?T.itemUrl+"/info/"+ba:T.thumbnailUrl},_formatItemTitle:function(T){return"\x3ch5\x3e"+(T.title||T.name||"\x3cNo Title\x3e")+"\x3c/h5\x3e"},clear:function(){this._grid.clearSelection()},doProject:function(T,ba){var na=[102113,102100,3857],ia=new G;var pa=function(M,X){!(M&&0<M.length&&M[0]&&"extent"==M[0].type)||isNaN(M[0].xmin)||isNaN(M[0].ymin)||isNaN(M[0].xmax)||isNaN(M[0].ymax)?
M&&0<M.length&&M[0]&&"point"==M[0].type&&!isNaN(M[0].x)&&!isNaN(M[0].y)&&ia.resolve(M,X):ia.resolve(M,X)};if(null!=T.spatialReference.wkid&&4326==T.spatialReference.wkid&&null!=ba.wkid&&this.contains(na,ba.wkid)){T.ymin=Math.max(T.ymin,-89.99);T.ymax=Math.min(T.ymax,89.99);T=W.geographicToWebMercator(T);if((na=T.spatialReference._getInfo())&&T.xmin>T.xmax){pa=na.valid[1]-T.xmin;var D=T.xmax-na.valid[0];pa>D?T.xmax=na.valid[1]+D:T.xmin=na.valid[0]-pa}T.spatialReference.wkid=ba.wkid;ia.resolve([T])}else null!=
T.spatialReference.wkid&&this.contains(na,T.spatialReference.wkid)&&null!=ba.wkid&&4326==ba.wkid?(T=W.webMercatorToGeographic(T),(na=T.spatialReference._getInfo())&&T.xmin>T.xmax&&(pa=na.valid[1]-T.xmin,D=T.xmax-na.valid[0],pa>D?T.xmax=na.valid[1]+D:T.xmin=na.valid[0]-pa),ia.resolve([T])):(this.geometryService||(this.geometryService=new ha(R.defaults.geometryService)),this.geometryService.project([T],ba,pa));return ia},contains:function(T,ba){for(var na=T.length;na--;)if(T[na]===ba)return!0;return!1},
_extentToGCS:function(T){T=T.shiftCentralMeridian(!0);return W.webMercatorToGeographic(T)},_extentToString:function(T){var ba="";null!=T&&(T=this._extentToGCS(T),ba=this._roundValue(T.xmin,1E4)+","+this._roundValue(T.ymin,1E4)+","+this._roundValue(T.xmax,1E4)+","+this._roundValue(T.ymax,1E4));return ba},_roundValue:function(T,ba){return Math.round(T*ba)/ba}});g("extend-esri")&&k.setObject("dijit.BrowseItems",q,E);return q})},"dgrid/extensions/Pagination":function(){define("../_StoreMixin dojo/_base/declare dojo/_base/array dojo/_base/lang dojo/_base/Deferred dojo/on dojo/query dojo/string dojo/has put-selector/put ../util/misc dojo/i18n!./nls/pagination dojo/_base/sniff xstyle/css!../css/extensions/Pagination.css".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g){function d(p){p.noDataNode?(f(p.noDataNode,"!"),delete p.noDataNode):p.cleanup();p.contentNode.innerHTML=""}function h(p){if(p.loadingNode)f(p.loadingNode,"!"),delete p.loadingNode;else if(p._oldPageNodes){for(var t in p._oldPageNodes)p.removeRow(p._oldPageNodes[t]);delete p._oldPageNodes;p._oldPageObserver&&(p._oldPageObserver.cancel(),p._numObservers--,delete p._oldPageObserver)}delete p._isLoading}return k("dgrid.extensions.Pagination",H,{rowsPerPage:10,pagingTextBox:!1,
previousNextArrows:!0,firstLastArrows:!1,pagingLinks:2,pageSizeOptions:null,showLoadingMessage:!0,i18nPagination:g,showFooter:!0,_currentPage:1,_total:0,buildRendering:function(){this.inherited(arguments);var p=this,t=this.paginationNode=f(this.footerNode,"div.dgrid-pagination"),w=this.paginationStatusNode=f(t,"div.dgrid-status"),u=this.i18nPagination;w.tabIndex=0;this._updatePaginationSizeSelect();this._updateRowsPerPageOption();w.innerHTML=a.substitute(u.status,{start:1,end:1,total:0});t=this.paginationNavigationNode=
f(t,"div.dgrid-navigation");this.firstLastArrows&&(w=this.paginationFirstNode=f(t,"span.dgrid-first.dgrid-page-link","\u00ab"),w.setAttribute("aria-label",u.gotoFirst),w.tabIndex=0);this.previousNextArrows&&(w=this.paginationPreviousNode=f(t,"span.dgrid-previous.dgrid-page-link","\u2039"),w.setAttribute("aria-label",u.gotoPrev),w.tabIndex=0);this.paginationLinksNode=f(t,"span.dgrid-pagination-links");this.previousNextArrows&&(w=this.paginationNextNode=f(t,"span.dgrid-next.dgrid-page-link","\u203a"),
w.setAttribute("aria-label",u.gotoNext),w.tabIndex=0);this.firstLastArrows&&(w=this.paginationLastNode=f(t,"span.dgrid-last.dgrid-page-link","\u00bb"),w.setAttribute("aria-label",u.gotoLast),w.tabIndex=0);this._listeners.push(l(t,".dgrid-page-link:click,.dgrid-page-link:keydown",function(r){if("keydown"!==r.type||13===r.keyCode)if(r=this.className,!(p._isLoading||-1<r.indexOf("dgrid-page-disabled"))){var y=p._currentPage;var B=Math.ceil(p._total/p.rowsPerPage);this===p.paginationPreviousNode?p.gotoPage(y-
1):this===p.paginationNextNode?p.gotoPage(y+1):this===p.paginationFirstNode?p.gotoPage(1):this===p.paginationLastNode?p.gotoPage(B):"dgrid-page-link"===r&&p.gotoPage(+this.innerHTML)}}))},destroy:function(){this.inherited(arguments);this._pagingTextBoxHandle&&this._pagingTextBoxHandle.remove()},_updatePaginationSizeSelect:function(){var p=this.pageSizeOptions,t=this.paginationSizeSelect;if(p&&p.length){if(!t){t=this.paginationSizeSelect=f(this.paginationNode,"select.dgrid-page-size[aria-label\x3d"+
this.i18nPagination.rowsPerPage+"]");var w=this._paginationSizeChangeHandle=l(t,"change",q.hitch(this,function(){this.set("rowsPerPage",+this.paginationSizeSelect.value)}));this._listeners.push(w)}for(w=t.options.length=0;w<p.length;w++)f(t,"option",p[w],{value:p[w],selected:this.rowsPerPage===p[w]});this._updateRowsPerPageOption()}else p&&p.length||!t||(f(t,"!"),this.paginationSizeSelect=null,this._paginationSizeChangeHandle.remove())},_setPageSizeOptions:function(p){this.pageSizeOptions=p&&p.sort(function(t,
w){return t-w});this._updatePaginationSizeSelect()},_updateRowsPerPageOption:function(){var p=this.rowsPerPage,t=this.pageSizeOptions,w=this.paginationSizeSelect;w&&(0>n.indexOf(t,p)?this._setPageSizeOptions(t.concat([p])):w.value=""+p)},_setRowsPerPage:function(p){this.rowsPerPage=p;this._updateRowsPerPageOption();this.gotoPage(1)},_updateNavigation:function(){function p(F,J){if(w.pagingTextBox&&F==y&&1<G)J=f(r,"input.dgrid-page-input[type\x3dtext][value\x3d$]",y),J.setAttribute("aria-label",u.jumpPage),
w._pagingTextBoxHandle=l(J,"change",function(){var P=+this.value;!isNaN(P)&&0<P&&P<=G&&w.gotoPage(+this.value)}),v&&"INPUT"===v.tagName&&J.focus();else{var L=F===y;J=f(r,"span"+(L?".dgrid-page-disabled":"")+".dgrid-page-link",F+(J?" ":""));J.setAttribute("aria-label",u.gotoPage);J.tabIndex=L?-1:0;z===F&&(L?F<G?z++:A.focus():J.focus());L||(A=J)}}function t(F,J){f(F,(J?".":"!")+"dgrid-page-disabled");F.tabIndex=J?-1:0}var w=this,u=this.i18nPagination,r=this.paginationLinksNode,y=this._currentPage,B=
this.pagingLinks,C=this.paginationNavigationNode,G=Math.ceil(this._total/this.rowsPerPage),x=this._pagingTextBoxHandle,v=document.activeElement,z,A;v&&e.contains(this.paginationNavigationNode,v)?"dgrid-page-link"===v.className&&(z=+v.innerHTML):v=null;x&&x.remove();r.innerHTML="";b(".dgrid-first, .dgrid-previous",C).forEach(function(F){t(F,1===y)});b(".dgrid-last, .dgrid-next",C).forEach(function(F){t(F,y>=G)});if(B&&0<G){p(1,!0);C=y-B;for(2<C?f(r,"span.dgrid-page-skip","..."):C=2;C<Math.min(y+B+
1,G);C++)p(C,!0);y+B+1<G&&f(r,"span.dgrid-page-skip","...");1<G&&p(G)}else w.pagingTextBox&&p(y);v&&-1===v.tabIndex&&(B=b("[tabindex\x3d'0']",this.paginationNavigationNode),v===this.paginationPreviousNode||v===this.paginationFirstNode?v=B[0]:B.length&&(v=B[B.length-1]),v&&v.focus())},refresh:function(){var p=this;this.inherited(arguments);if(this.store)return this.gotoPage(1).then(function(t){setTimeout(function(){l.emit(p.domNode,"dgrid-refresh-complete",{bubbles:!0,cancelable:!1,grid:p,results:t})},
0);return t});console.warn("Pagination requires a store to operate.")},_onNotification:function(p){p.length!==this._rowsOnPage&&this.gotoPage(this._currentPage)},renderArray:function(p,t){var w=this,u=this.inherited(arguments);this._lastCollection=null;t||(this._topLevelRequest&&this._topLevelRequest!==p&&(this._topLevelRequest.cancel(),delete this._topLevelRequest),"function"===typeof p.cancel&&(this._topLevelRequest=p),m.when(p,function(){w._topLevelRequest&&delete w._topLevelRequest}));return u},
insertRow:function(){var p=this._oldPageNodes,t=this.inherited(arguments);p&&t===p[t.id]&&delete p[t.id];return t},gotoPage:function(p){var t=this,w=new m;this._trackError(function(){var u=t.rowsPerPage,r=(p-1)*u,y=q.mixin(t.get("queryOptions"),{start:r,count:u}),B=t.contentNode,C;if(t.showLoadingMessage){d(t);var G=t.loadingNode=f(B,"div.dgrid-loading");G.innerHTML=t.loadingMessage}else{t._oldPageNodes=G={};B=B.children;var x=0;for(C=B.length;x<C;x++)G[B[x].id]=B[x];t._oldPageObserver=t.observers.pop()}t._isLoading=
!0;var v=t.store.query(t.query,y);m.when(t.renderArray(v,null,y),function(z){h(t);t.scrollTo({y:0});m.when(v.total,function(A){A||(t.noDataNode&&(f(t.noDataNode,"!"),delete t.noDataNode),t.noDataNode=f(t.contentNode,"div.dgrid-no-data"),t.noDataNode.innerHTML=t.noDataMessage);t.paginationStatusNode.innerHTML=a.substitute(t.i18nPagination.status,{start:Math.min(r+1,A),end:Math.min(A,r+u),total:A});t._total=A;t._currentPage=p;t._rowsOnPage=z.length;t._updateNavigation()});(7>c("ie")||c("ie")&&c("quirks"))&&
t.resize();w.resolve(v)},function(z){h(t);w.reject(z)});return w.promise})||w.reject();return w.promise}})})},"dgrid/extensions/DijitRegistry":function(){define(["dojo/_base/declare","dojo/dom-geometry","dijit/registry"],function(H,k,n){return H("dgrid.extensions.DijitRegistry",null,{minSize:0,maxSize:Infinity,layoutPriority:0,showTitle:!0,buildRendering:function(){n.add(this);this.inherited(arguments);this.domNode.setAttribute("widgetId",this.id)},startup:function(){if(!this._started){this.inherited(arguments);
var q=n.getEnclosingWidget(this.domNode.parentNode);q&&q.isLayoutContainer&&this._resizeHandle.remove()}},destroyRecursive:function(){this.destroy()},destroy:function(){this.inherited(arguments);n.remove(this.id)},getChildren:function(){return[]},isLeftToRight:function(){return!this.isRTL},resize:function(q){q&&k.setMarginBox(this.domNode,q);this.inherited(arguments)},_set:function(q,m){this[q]=m},watch:function(){},getParent:function(){return n.getEnclosingWidget(this.domNode.parentNode)}})})},"dgrid/selector":function(){define("dojo/_base/kernel dojo/_base/array dojo/_base/lang dojo/on dojo/aspect dojo/_base/sniff put-selector/put".split(" "),
function(H,k,n,q,m,l,b){n.getObject("dgrid.selector",!0);return dgrid.selector=function(a,c){function f(u){return!p.allowSelect(p.row(u))}function e(u){return function(r){var y=r.rows,B=y.length;r="false";var C;for(C=0;C<B;C++){var G=p.cell(y[C],a.id).element;G&&(G=(G.contents||G).input)&&!G.disabled&&(G.checked=u,G.setAttribute("aria-checked",u))}if("checkbox"==t.type){y=p.selection;B=!1;for(C in y)if(y[C]!=p.allSelected){B=!0;break}t.indeterminate=B;t.checked=p.allSelected;B?r="mixed":p.allSelected&&
(r="true");t.setAttribute("aria-checked",r)}}}function g(u){if("click"==u.type||32==u.keyCode||!l("opera")&&13==u.keyCode||0===u.keyCode){var r=p.row(u);p._selectionTriggerEvent=u;if(r){if(p.allowSelect(r)){var y=p._lastSelected&&p.row(p._lastSelected);"radio"==c?y&&y.id==r.id||(p.clearSelection(),p.select(r,null,!0),p._lastSelected=r.element):r&&(u.shiftKey?e(!0)({rows:[r]}):y=null,y=u.shiftKey?y:null,p.select(y||r,r,y?void 0:null),p._lastSelected=r.element)}}else b(this,(p.allSelected?"!":".")+
"dgrid-select-all"),p[p.allSelected?"clearSelection":"selectAll"]();p._selectionTriggerEvent=null}}function d(){p._hasSelectorInputListener=!0;h.push(p.on(".dgrid-selector:click,.dgrid-selector:keydown",g));var u=p._handleSelect;p._handleSelect=function(B){this.cell(B).column!=a&&u.apply(this,arguments)};if("function"==typeof a.disabled){var r=p.allowSelect,y=a.disabled;p.allowSelect=function(B){var C=r.call(this,B);return y===f?C:C&&!y.call(a,B.data)}}a.disabled=f;h.push(p.on("dgrid-select",e(!0)));
h.push(p.on("dgrid-deselect",e(!1)))}var h=[],p,t;a||(a={});a.type&&(a.selectorType=a.type,H.deprecated("columndef.type","use columndef.selectorType instead","dgrid 0.4"));a.selectorType=c=c||a.selectorType||"checkbox";a.sortable=!1;var w="function"==typeof c?c:function(u,r,y){var B=r.parentNode;p._hasSelectorInputListener||d();var C=a.disabled;b(B&&B.contents?B:r,".dgrid-selector");r=r.input||(r.input=b(r,"input[type\x3d"+c+"]",{tabIndex:isNaN(a.tabIndex)?-1:a.tabIndex,disabled:C&&("function"==typeof C?
C.call(a,y):C),checked:u}));r.setAttribute("aria-checked",!!u);return r};m.after(a,"init",function(){p=a.grid});m.after(a,"destroy",function(){k.forEach(h,function(u){u.remove()});p._hasSelectorInputListener=!1});a.renderCell=function(u,r,y,B,C){r=(r=u&&p.row(u))&&p.selection[r.id];w(r,y,u)};a.renderHeaderCell=function(u){var r="label"in a?a.label:a.field||"";"radio"!=c&&p.allowSelectAll?w(!1,u,{}):(u.appendChild(document.createTextNode(r)),p._hasSelectorInputListener||d());t=u.lastChild};return a}})},
"dgrid/Keyboard":function(){define("dojo/_base/declare dojo/aspect dojo/on dojo/_base/lang dojo/has put-selector/put ./util/misc dojo/_base/Deferred dojo/_base/sniff".split(" "),function(H,k,n,q,m,l,b,a){function c(v){v.preventDefault()}var f={checkbox:1,radio:1,button:1},e=/\bdgrid-cell\b/,g=/\bdgrid-row\b/,d=H("dgrid.Keyboard",null,{pageSkip:10,tabIndex:0,keyMap:null,headerKeyMap:null,postMixInProperties:function(){this.inherited(arguments);this.keyMap||(this.keyMap=q.mixin({},d.defaultKeyMap));
this.headerKeyMap||(this.headerKeyMap=q.mixin({},d.defaultHeaderKeyMap))},postCreate:function(){function v(F){var J=F.target;return J.type&&(!f[J.type]||32==F.keyCode)}function z(F){function J(){A._focusedHeaderNode&&(A._focusedHeaderNode.tabIndex=-1);if(A.showHeader){if(L)for(var ca=0,da,ea=A.headerNode.getElementsByTagName("th");da=ea[ca];++ca){if(P.test(da.className)){A._focusedHeaderNode=Z=da;break}}else A._focusedHeaderNode=Z=A.headerNode;Z&&(Z.tabIndex=A.tabIndex)}}var L=A.cellNavigation,P=
L?e:g,Q=F===A.headerNode,Z=F;Q?(J(),k.after(A,"renderHeader",J,!0)):k.after(A,"renderArray",function(ca){return a.when(ca,function(da){var ea=A._focusedNode||Z;if(P.test(ea.className)&&b.contains(F,ea))return da;for(var fa=0,K=F.getElementsByTagName("*"),V;V=K[fa];++fa)if(P.test(V.className)){ea=A._focusedNode=V;break}ea.tabIndex=A.tabIndex;return da})});A._listeners.push(n(F,"mousedown",function(ca){v(ca)||A._focusOnNode(ca.target,Q,ca)}));A._listeners.push(n(F,"keydown",function(ca){if(!ca.metaKey&&
!ca.altKey){var da=A[Q?"headerKeyMap":"keyMap"][ca.keyCode];da&&!v(ca)&&da.call(A,ca)}}))}this.inherited(arguments);var A=this;this.tabableHeader&&(z(this.headerNode),this._listeners.push(n(this.headerNode,"dgrid-cellfocusin",function(){A.scrollTo({x:this.scrollLeft})})));z(this.contentNode);this._debouncedEnsureScroll=b.debounce(this._ensureScroll,this)},removeRow:function(v){if(!this._focusedNode)return this.inherited(arguments);var z=this,A=document.activeElement===this._focusedNode,F=this[this.cellNavigation?
"cell":"row"](this._focusedNode),J=F.row||F,L;v=v.element||v;v===J.element&&((L=this.down(J,!0))&&L.element!==v||(L=this.up(J,!0)),this._removedFocus={active:A,rowId:J.id,columnId:F.column&&F.column.id,siblingId:L&&L.element!==v?L.id:void 0},setTimeout(function(){z._removedFocus&&z._restoreFocus(J.id)},0),this._focusedNode=null);this.inherited(arguments)},insertRow:function(v){var z=this.inherited(arguments);this._removedFocus&&!this._removedFocus.wait&&this._restoreFocus(z);return z},_restoreFocus:function(v){var z=
this._removedFocus,A;if((v=(v=v&&this.row(v))&&v.element&&v.id===z.rowId?v:"undefined"!==typeof z.siblingId&&this.row(z.siblingId))&&v.element){if(!v.element.parentNode.parentNode){z.wait=!0;return}"undefined"!==typeof z.columnId&&(A=this.cell(v,z.columnId))&&A.element&&(v=A);z.active&&0!==v.element.offsetHeight?this._focusOnNode(v,!1,null):(l(v.element,".dgrid-focus"),v.element.tabIndex=this.tabIndex,this._focusedNode=v.element)}delete this._removedFocus},addKeyHandler:function(v,z,A){return k.after(this[A?
"headerKeyMap":"keyMap"],v,z,!0)},_ensureRowScroll:function(v){var z=this.getScrollPosition().y;z>v.offsetTop?this.scrollTo({y:v.offsetTop}):z+this.contentNode.offsetHeight<v.offsetTop+v.offsetHeight&&this.scrollTo({y:v.offsetTop-this.contentNode.offsetHeight+v.offsetHeight})},_ensureColumnScroll:function(v){var z=this.getScrollPosition().x,A=v.offsetLeft;if(z>A)this.scrollTo({x:A});else{var F=this.bodyNode.clientWidth;v=v.offsetWidth;var J=A+v;z+F<J&&this.scrollTo({x:F>v?J-F:A})}},_ensureScroll:function(v,
z){this.cellNavigation&&(this.columnSets||1<this.subRows.length)&&!z&&this._ensureRowScroll(v.row.element);this.bodyNode.clientWidth<this.contentNode.offsetWidth&&this._ensureColumnScroll(v.element)},_focusOnNode:function(v,z,A){var F="_focused"+(z?"Header":"")+"Node",J=this[F],L=this.cellNavigation?"cell":"row",P=this[L](v),Q;if(v=P&&P.element){if(this.cellNavigation){var Z=v.getElementsByTagName("input");var ca=0;for(Q=Z.length;ca<Q;ca++){var da=Z[ca];if((-1!=da.tabIndex||"_dgridLastValue"in da)&&
!da.disabled){8>m("ie")&&(da.style.position="relative");da.focus();8>m("ie")&&(da.style.position="");var ea=!0;break}}}null!==A&&(A=q.mixin({grid:this},A),A.type&&(A.parentType=A.type),A.bubbles||(A.bubbles=!0));J&&(l(J,"!dgrid-focus[!tabIndex]"),8>m("ie")&&(J.style.position=""),A&&(A[L]=this[L](J),n.emit(J,"dgrid-cellfocusout",A)));J=this[F]=v;A&&(A[L]=P);F=this.cellNavigation?e:g;!ea&&F.test(v.className)&&(8>m("ie")&&(v.style.position="relative"),v.tabIndex=this.tabIndex,v.focus());l(v,".dgrid-focus");
A&&n.emit(J,"dgrid-cellfocusin",A);this._debouncedEnsureScroll(P,z)}},focusHeader:function(v){this._focusOnNode(v||this._focusedHeaderNode,!0)},focus:function(v){(v=v||this._focusedNode)?this._focusOnNode(v,!1):this.contentNode.focus()}}),h=d.moveFocusVertical=function(v,z){if(this._focusOnNode&&v.target!==this.contentNode){var A=this.cellNavigation,F=this[A?"cell":"row"](v);F=A&&F.column.id;z=this.down(this._focusedNode,z,!0);A&&(z=this.cell(z,F));this._focusOnNode(z,!1,v);v.preventDefault()}};H=
d.moveFocusUp=function(v){h.call(this,v,-1)};var p=d.moveFocusDown=function(v){h.call(this,v,1)},t=d.moveFocusPageUp=function(v){h.call(this,v,-this.pageSkip)},w=d.moveFocusPageDown=function(v){h.call(this,v,this.pageSkip)},u=d.moveFocusHorizontal=function(v,z){if(this.cellNavigation&&v.target!==this.contentNode){var A=!this.row(v);this._focusOnNode(this.right(this["_focused"+(A?"Header":"")+"Node"],z),A,v);v.preventDefault()}},r=d.moveFocusLeft=function(v){u.call(this,v,-1)},y=d.moveFocusRight=function(v){u.call(this,
v,1)},B=d.moveHeaderFocusEnd=function(v,z){if(this.cellNavigation){var A=this.headerNode.getElementsByTagName("th");this._focusOnNode(A[z?0:A.length-1],!0,v)}v.preventDefault()},C=d.moveHeaderFocusHome=function(v){B.call(this,v,!0)},G=d.moveFocusEnd=function(v,z){var A=this,F=this.cellNavigation,J=this.contentNode,L=J.scrollTop+(z?0:J.scrollHeight);J=J[z?"firstChild":"lastChild"];var P=-1<J.className.indexOf("dgrid-preload"),Q=P?J[(z?"next":"previous")+"Sibling"]:J,Z=Q.offsetTop+(z?0:Q.offsetHeight);
if(P){for(;Q&&0>Q.className.indexOf("dgrid-row");)Q=Q[(z?"next":"previous")+"Sibling"];if(!Q)return}if(!P||1>J.offsetHeight)F&&(Q=this.cell(Q,this.cell(v).column.id)),this._focusOnNode(Q,!1,v);else{m("dom-addeventlistener")||(v=q.mixin({},v));var ca=k.after(this,"renderArray",function(da){ca.remove();return a.when(da,function(ea){ea=ea[z?0:ea.length-1];F&&(ea=A.cell(ea,A.cell(v).column.id));A._focusOnNode(ea,!1,v)})})}L===Z&&v.preventDefault()},x=d.moveFocusHome=function(v){G.call(this,v,!0)};d.defaultKeyMap=
{32:c,33:t,34:w,35:G,36:x,37:r,38:H,39:y,40:p};d.defaultHeaderKeyMap={32:c,35:B,36:C,37:r,39:y};return d})},"dgrid/util/mouse":function(){define(["dojo/_base/lang","dojo/on","dojo/dom","dojo/query"],function(H,k,n){function q(l,b){return function(a,c){return k(a,l+":"+b,function(f){if(!n.isDescendant(f.relatedTarget,this))return c.call(this,f)})}}var m={enterRow:q(".dgrid-content .dgrid-row","mouseover"),enterCell:q(".dgrid-content .dgrid-cell","mouseover"),enterHeaderCell:q(".dgrid-header .dgrid-cell",
"mouseover"),leaveRow:q(".dgrid-content .dgrid-row","mouseout"),leaveCell:q(".dgrid-content .dgrid-cell","mouseout"),leaveHeaderCell:q(".dgrid-header .dgrid-cell","mouseout"),createDelegatingHandler:q};H.getObject("dgrid.util.mouse",!0);H.mixin(dgrid.util.mouse,m);return m})},"dgrid/util/touch":function(){define(["dojo/on","dojo/query"],function(H,k){function n(m,l,b,a){if(!(1<b.targetTouches.length)){var c=b.changedTouches[0],f=c.screenX,e=c.screenY;a&&b.preventDefault();var g=H(m,"touchend",function(d){var h=
d.changedTouches[0];d.targetTouches.length||(Math.abs(h.screenX-f)<q.tapRadius&&Math.abs(h.screenY-e)<q.tapRadius&&(a&&d.preventDefault(),l.call(this,d)),g.remove())})}}var q={tapRadius:10,dbltapTime:250,selector:function(m,l,b){return function(a,c){var f=l.bubble;f?l=f:!1!==b&&(b=!0);return H(a,l,function(e){var g=e.target;3==g.nodeType&&(g=g.parentNode);for(;!k.matches(g,m,a);)if(g==a||!b||!(g=g.parentNode))return;return c.call(g,e)})}},countCurrentTouches:function(m,l){if(!("touches"in m))return-1;
var b,a,c;for(a=b=0;c=m.touches[b];++b)l.contains(c.target)&&++a;return a},tap:function(m,l){return H(m,"touchstart",function(b){n(m,l,b)})},dbltap:function(m,l){var b,a;return H(m,"touchstart",function(c){b?n(m,function(f){if(b){var e=f.changedTouches[0];Math.abs(e.screenX-b.screenX)<q.tapRadius&&Math.abs(e.screenY-b.screenY)<q.tapRadius&&(a&&clearTimeout(a),b=a=null,l.call(this,f))}},c,!0):n(m,function(f){b=f.changedTouches[0];a=setTimeout(function(){b=a=null},q.dbltapTime)},c)})}};return q})},
"esri/dijit/_AppTemplateFiltersMixin":function(){define(["dojo/_base/declare"],function(){return{rootNodes:{app:{all:{},narrate:{typekeywords:["story"]},collect:{typekeywords:["collect"]},compare:{typekeywords:["compare"]},"3dscene":{typekeywords:["3Dscene"]},analyze:{typekeywords:["summarize"]},present:{typekeywords:["gallery"]},social:{typekeywords:["social"]},local:{typekeywords:["local"]},route:{typekeywords:["route"]},showcase:{typekeywords:["showcase"]}}}}})},"esri/dijit/_RefreshMixin":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/Deferred dojo/on dojo/has ../kernel".split(" "),
function(H,k,n,q,m,l){function b(a){"object"!==typeof a&&(a=Error(a));a.grid=this;q.emit(this.domNode,"dgrid-error",{grid:this,error:a,cancelable:!0,bubbles:!0})&&console.error(a)}H=H(null,{_trackError:function(a){"string"===typeof a&&(a=k.hitch(this,a));try{var c=a()}catch(f){b.call(this,f)}return n.when(c,k.hitch(this,function(){q.emit(this.domNode,"refresh",{cancelable:!0,bubbles:!0})}),k.hitch(this,b))}});m("extend-esri")&&k.setObject("dijit._RefreshMixin",H,l);return H})},"esri/dijit/analysis/PluginAnalysisLayers":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/promise/all dojo/has ../../kernel dojo/i18n!../../nls/jsapi".split(" "),
function(H,k,n,q,m,l,b){var a=H(null,{filters:{all:{},categoryBoundaries:{tags:["boundaries","places"]},subCategoryBoundaries:{tags:["boundaries"]},subCategoryPlaces:{tags:["places"]},categoryHexBins:{tags:["hex"]},categoryTransportation:{tags:["transportation"]}},constructor:function(c){k.mixin(this,c);this.i18n=k.mixin({},b.browseLayersDlg);this.filterStrings={all:{title:this.i18n.categoryAll},categoryBoundaries:{title:this.i18n.categoryBoundaries},subCategoryBoundaries:{title:"\x26nbsp;\x26nbsp;\x26nbsp;\x26nbsp;"+
this.i18n.subCategoryBoundaries},subCategoryPlaces:{title:"\x26nbsp;\x26nbsp;\x26nbsp;\x26nbsp;"+this.i18n.subCategoryPlaces},categoryHexBins:{title:this.i18n.categoryHexBins},categoryTransportation:{title:this.i18n.categoryTransportation}}},fetchData:function(){this._portal=this.parent._portal;var c;return this._fetchGroups().then(k.hitch(this,function(f){c=n.map(f||[],function(e){if(e)return'group:"'+e.id+'"'});return this._fetchGroupItems(c)}))},_fetchGroup:function(c,f){this._groups=this._groups||
[];return this._groups[c]||this._portal.queryGroups(f,!0).then(k.hitch(this,function(e){0<e.total&&e.results&&(this._groups[c]=e.results);return this._groups[c]||[]}))},_fetchGroupItems:function(c,f){var e=this._isCustom?['-typekeywords:"Multilayer"']:['typekeywords:"Analysis Ready"'];this._portal&&this._portal.user&&this._portal.user.demographics||e.push('-typekeywords:"Requires Credits"');return this.parent._fetchItems({groups:c,query:f,types:['type:"Map Service"','type:"Feature Service"'],typekeywords:e})},
_fetchGroups:function(){return this._fetchEsriAnalysisLayers()},_fetchEsriAnalysisLayers:function(){if(this._portal&&this._portal.analysisLayersGroupQuery){var c=this._portal.analysisLayersGroupQuery;this._isCustomAnalysisQuery()&&(this.filterStrings=this.filters=null)}return this._fetchGroup("esriAnalysisLayers",{q:c,num:100,start:0}).then(k.hitch(this,function(f){f&&0<f.length&&(this.parent.sortAttribute=f[0].sortField,this.parent.sortDescending="asc"!==f[0].sortOrder);return f}))},_isCustomAnalysisQuery:function(){var c=
'title:"Living Atlas Analysis Layers" AND owner:esri',f=!1;this._portal&&this._portal.isPortal&&(c='title:"Living Atlas Analysis Layers" AND owner:esri_livingatlas');this._portal&&this._portal.analysisLayersGroupQuery&&this._portal.analysisLayersGroupQuery!==c&&(f=!0);return this._isCustom=f}});k.mixin(a,{add:function(c,f){c.plugIn||(f=f||{},f.parent=c,c.plugIn=new a(f))},remove:function(c){c.plugIn&&(c.plugIn.destroy(),delete c.plugIn)}});m("extend-esri")&&k.setObject("dijit.analysis.PluginAnalysisLayers",
a,l);return a})},"esri/dijit/SingleFilter":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/json dojo/has dojo/json dojo/string dojo/number dojo/dom dojo/dom-style dojo/dom-attr dojo/dom-construct dojo/query dojo/dom-class dojo/_base/event dojo/Evented dojo/data/ItemFileWriteStore dojo/date/locale dojo/parser dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dijit/_OnDijitClickMixin dijit/_FocusMixin dijit/registry dijit/form/TextBox dijit/form/FilteringSelect dijit/form/RadioButton dijit/form/DateTextBox dijit/form/NumberTextBox ../config ../kernel ../lang ../tasks/GenerateRendererTask ../tasks/UniqueValueDefinition ../tasks/GenerateRendererParameters ../layers/FeatureLayer ../layers/GeoRSSLayer ./analysis/ItemTypes dojo/i18n!../nls/jsapi dojo/text!./templates/SingleFilter.html".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G,x,v,z,A,F,J,L,P,Q,Z,ca,da,ea,fa,K,V,aa,Y,I,O){H=k([C,G,x,v,z,u],{declaredClass:"esri.dijit.SingleFilter",widgetsInTemplate:!0,templateString:O,valueHandlers:[],onFieldChangeEnabled:!0,onOperatorChangeEnabled:!0,onPromptChangeHandler:null,onHintChangeHandler:null,fieldDomains:{},fieldsStore:null,fieldsInfo:{stringFieldsCount:0,numberFieldsCount:0,dateFieldsCount:0},stringOperatorStore:null,dateOperatorStore:null,numberOperatorStore:null,uniqueValuesStore:null,
isEnableInteractiveFilter:!0,uniqueValuesResults:{},partsObj:null,dayInMS:86399E3,allowAllDateTypes:!1,showUnique:!0,postMixInProperties:function(){this.inherited(arguments);this.i18n={};this.i18n=n.mixin(this.i18n,I.filterDlg)},parseExpressionTemplate:function(){var E=function(na,ia){e.byId(ia).className="attributeValueContainer";"field_dropdown"===na?e.byId(ia).innerHTML=N:"operator_dropdown"===na?e.byId(ia).innerHTML=R:"values_input"===na?e.byId(ia).innerHTML=W+ha:console.error("problem with expressionTemplate from localization file")},
N='\x3cselect id\x3d"'+this.id+'.fieldsList" class\x3d"attributeField" data-dojo-type\x3d"dijit/form/FilteringSelect" maxHeight\x3d"150" sortByLabel\x3d"true"\x3e\x3c/select\x3e',R='\x3cselect id\x3d"'+this.id+'.operatorList" class\x3d"operator" data-dojo-type\x3d"dijit/form/FilteringSelect" maxHeight\x3d"150" sortByLabel\x3d"false"\x3e\x3c/select\x3e',W='\x3cdiv id\x3d"'+this.id+'.attributeValueContainer"\x3e\x3c/div\x3e',ha='\x3cdiv class\x3d"attributeValueOptions"\x3e\x3ctable cellpadding\x3d"0" cellspacing\x3d"0"\x3e  \x3ctbody\x3e    \x3ctr\x3e      \x3ctd nowrap\x3d"nowrap"\x3e        \x3cinput id\x3d"'+
this.id+'.radioValue" class\x3d"radioValue attributeValueRadio" checked\x3d"checked" name\x3d"'+this.id+'.inputOption" data-dojo-type\x3d"dijit/form/RadioButton" title\x3d"'+this.i18n.valueTooltip+'"/\x3e        \x3clabel class\x3d"labels" title\x3d"'+this.i18n.valueTooltip+'"\x3e'+this.i18n.value+'        \x3c/label\x3e      \x3c/td\x3e      \x3ctd nowrap\x3d"nowrap" class\x3d"esriLeadingPadding05"\x3e        \x3cinput id\x3d"'+this.id+'.radioFields" class\x3d"radioFields attributeValueRadio" name\x3d"'+
this.id+'.inputOption" data-dojo-type\x3d"dijit/form/RadioButton" title\x3d"'+this.i18n.fieldTooltip+'"/\x3e        \x3clabel class\x3d"labels" title\x3d"'+this.i18n.fieldTooltip+'"\x3e'+this.i18n.field+'        \x3c/label\x3e      \x3c/td\x3e      \x3ctd id\x3d"'+this.id+'.radioUniqueColumn" nowrap\x3d"nowrap" class\x3d"esriLeadingPadding05"\x3e        \x3cinput id\x3d"'+this.id+'.radioUnique" class\x3d"radioUnique attributeValueRadio" name\x3d"'+this.id+'.inputOption" data-dojo-type\x3d"dijit/form/RadioButton" title\x3d"'+
this.i18n.uniqueValueTooltip+'"/\x3e        \x3clabel class\x3d"labels" title\x3d"'+this.i18n.uniqueValueTooltip+'"\x3e'+this.i18n.uniqueValues+"        \x3c/label\x3e      \x3c/td\x3e    \x3c/tr\x3e  \x3c/tbody\x3e\x3c/table\x3e\x3c/div\x3e",oa=this.i18n.expressionTemplate,ma=oa.indexOf("${"),T=oa.substring(0,ma).trim();e.byId(this.id+".column1").innerHTML=T.length?"\x3cdiv class\x3d'attributeText'\x3e"+T+"\x3c/div\x3e":"";T=oa.indexOf("}",ma+1);var ba=oa.substring(ma+2,T);E(ba,this.id+".column2");
ma=oa.indexOf("${",ma+1);T=oa.substring(T+1,ma).trim();e.byId(this.id+".column3").innerHTML=T.length?"\x3cdiv class\x3d'attributeText'\x3e"+T+"\x3c/div\x3e":"";T=oa.indexOf("}",ma+1);ba=oa.substring(ma+2,T);E(ba,this.id+".column4");ma=oa.indexOf("${",ma+1);T=oa.substring(T+1,ma).trim();e.byId(this.id+".column5").innerHTML=T.length?"\x3cdiv class\x3d'attributeText'\x3e"+T+"\x3c/div\x3e":"";T=oa.indexOf("}",ma+1);ba=oa.substring(ma+2,T);E(ba,this.id+".column6");T=oa.substring(T+1,oa.length).trim();
e.byId(this.id+".column7").innerHTML=T.length?"\x3cdiv class\x3d'attributeText'\x3e"+T+"\x3c/div\x3e":""},postCreate:function(){this.inherited(arguments);this.parseExpressionTemplate();this.createOperatorStores();this.createFieldsStore(this.fields);this.readCodedValues();B.parse(e.byId(this.id+".exprTable")).then(n.hitch(this,function(E){m.connect(this.getFieldsList(),"onChange",this,"onChangeField");m.connect(this.getOperatorList(),"onChange",this,"onChangeOperator");m.connect(A.byId(this.id+".radioValue"),
"onClick",this,"showValueInput");m.connect(A.byId(this.id+".radioFields"),"onClick",this,"showFields");m.connect(A.byId(this.id+".radioUnique"),"onClick",this,"showUniqueList");this.version&&10.1>this.version&&this.mapLayer.url&&this.showUnique&&g.set(e.byId(this.id+".radioUniqueColumn"),"display","none");m.connect(e.byId(this.id+".deleteExpression"),"onclick",this,"onClickDeleteExpression");m.connect(this.interactiveCheck,"onclick",this,"onInteractiveClick");m.connect(this.interactiveArrow,"onclick",
this,"onClickShowHideInteractive");this.enableInteractiveHandlers();this.isEnableInteractiveFilter||g.set(this._interactiveFilterRow,"display","none");g.set(e.byId(this.id+".radioUniqueColumn"),"display",this.showUnique?"block":"none");this.own(this.watch("showUnique",n.hitch(this,function(N,R,W){g.set(e.byId(this.id+".radioUniqueColumn"),"display",W?"block":"none")})))}))},constructor:function(E,N){this.id=E.id||"";this.owner=E.owner;this.version=E.version;this.part=E.part;this.fields=E.fields;this.mapLayer=
E.mapLayer;!1===E.enableEvents&&(this.onOperatorChangeEnabled=this.onFieldChangeEnabled=!1)},init:function(E){if(!E.part||this.mapLayer&&E.mapLayer&&this.mapLayer.id!==E.mapLayer.id)this.clearAttributeValueDijits(),this.mapLayer=E.mapLayer,this.version=E.version,this.fields=E.fields,this.createOperatorStores(),this.createFieldsStore(this.fields),this.readCodedValues(),this.fillFieldsList(this.fieldsStore),this.onChangeField();E.part&&(this.part=E.part,this.onOperatorChangeEnabled=this.onFieldChangeEnabled=
!1,this.buildEditUIField(this.part,this))},destroy:function(){this.onOperatorChangeEnabled=this.onFieldChangeEnabled=!1;this.clearAttributeValueDijits();q.forEach(A.findWidgets(e.byId(this.id)),function(E){E.destroyRecursive()});this.inherited(arguments)},toJson:function(){var E=null;this.isInteractiveChecked()&&(E={prompt:this.promptText.attr("value"),hint:this.hintText.attr("value")});return{fieldObj:this.getField(),operator:this.getOperator(),valueObj:this.getValue(),interactiveObj:E}},buildFriendlyTextExpr:function(E){var N=
this.i18n.expressionTemplate,R=function(oa,ma,T){return c.substitute(N,{field_dropdown:oa,operator_dropdown:ma,values_input:T})};if(!1===E.valueObj.isValid)return"\x26lt;expression is missing value\x26gt;";var W="";if("string"===E.fieldObj.shortType)E.operator===this.i18n.stringOperatorIsBlank||E.operator===this.i18n.stringOperatorIsNotBlank?W=R(E.fieldObj.label,E.operator,""):"field"===E.valueObj.type?W=R(E.fieldObj.label,E.operator,E.valueObj.label):(W=this.getDecodedValue(E.interactiveObj?E.interactiveObj.value:
E.valueObj.value,E.fieldObj.name),W=R(E.fieldObj.label,E.operator,"'"+W+"'"));else if("number"===E.fieldObj.shortType)if(E.operator===this.i18n.numberOperatorIsBetween||E.operator===this.i18n.numberOperatorIsNotBetween)W=E.interactiveObj?E.interactiveObj.value2:E.valueObj.value2,W=R(E.fieldObj.label,E.operator,f.format(E.interactiveObj?E.interactiveObj.value1:E.valueObj.value1,{pattern:"#####0.##########"})+" "+this.i18n.andBetweenValues+" "+f.format(W,{pattern:"#####0.##########"}));else if(E.operator===
this.i18n.numberOperatorIsBlank||E.operator===this.i18n.numberOperatorIsNotBlank)W=R(E.fieldObj.label,E.operator,"");else if("field"===E.valueObj.type)W=R(E.fieldObj.label,E.operator,E.valueObj.label);else{W=E.interactiveObj?E.interactiveObj.value:E.valueObj.value;var ha=this.getDecodedValue(W,E.fieldObj.name);W=R(E.fieldObj.label,E.operator,W!==ha?"'"+ha+"'":f.format(W,{pattern:"#####0.##########"}))}else da.isDefined(E.valueObj.value)&&"field"!==E.valueObj.type&&"string"===typeof E.valueObj.value&&
(E.valueObj.value=new Date(E.valueObj.value)),W=E.operator===this.i18n.dateOperatorIsBetween||E.operator===this.i18n.dateOperatorIsNotBetween?R(E.fieldObj.label,E.operator,(E.interactiveObj?this.formatFriendlyDate(E.interactiveObj.value1):this.formatFriendlyDate(E.valueObj.value1))+" "+this.i18n.andBetweenValues+" "+(E.interactiveObj?this.formatFriendlyDate(E.interactiveObj.value2):this.formatFriendlyDate(this.addDay(E.valueObj.value2)))):E.operator===this.i18n.dateOperatorIsBlank||E.operator===this.i18n.dateOperatorIsNotBlank?
R(E.fieldObj.label,E.operator,""):"field"===E.valueObj.type?R(E.fieldObj.label,E.operator,E.valueObj.label):R(E.fieldObj.label,E.operator,E.interactiveObj?this.formatFriendlyDate(E.interactiveObj.value):this.formatFriendlyDate(E.valueObj.value));return W},builtSingleFilterString:function(E,N){if(da.isDefined(E.valueObj.isValid)&&!E.valueObj.isValid)return{whereClause:null};var R=E.valueObj.value,W=E.valueObj.value1,ha=E.valueObj.value2,oa=!1;if(E.interactiveObj){if(!E.interactiveObj.prompt||!E.interactiveObj.hint)return{whereClause:null};
da.isDefined(N)&&(oa=!0,da.isDefined(E.valueObj.value)&&(R="{"+N+"}"),da.isDefined(E.valueObj.value1)&&(W="{"+N+"}"),da.isDefined(E.valueObj.value2)&&(ha="{"+(N+1)+"}"))}var ma="",T=E.fieldObj.name;this.mapLayer&&this.mapLayer.url&&-1!==this.mapLayer.url.indexOf("BigDataCatalogServer")&&this.hasWhiteSpace(T)&&(T='"'+T+'"');if("string"===E.fieldObj.shortType)switch(N="",R&&"field"!==E.valueObj.type&&this.isHostedService(this.mapLayer.url)&&this.containsNonLatinCharacter(R)&&(N="N"),E.operator){case this.i18n.stringOperatorIs:ma=
"field"===E.valueObj.type?T+" \x3d "+R:T+" \x3d "+N+"'"+R.replace(/'/g,"''")+"'";break;case this.i18n.stringOperatorIsNot:ma="field"===E.valueObj.type?T+" \x3c\x3e "+R:T+" \x3c\x3e "+N+"'"+R.replace(/'/g,"''")+"'";break;case this.i18n.stringOperatorStartsWith:ma=T+" LIKE "+N+"'"+R.replace(/'/g,"''")+"%'";break;case this.i18n.stringOperatorEndsWith:ma=T+" LIKE "+N+"'%"+R.replace(/'/g,"''")+"'";break;case this.i18n.stringOperatorContains:ma=T+" LIKE "+N+"'%"+R.replace(/'/g,"''")+"%'";break;case this.i18n.stringOperatorDoesNotContain:ma=
T+" NOT LIKE "+N+"'%"+R.replace(/'/g,"''")+"%'";break;case this.i18n.stringOperatorIsBlank:ma=T+" IS NULL";break;case this.i18n.stringOperatorIsNotBlank:ma=T+" IS NOT NULL"}else if("number"===E.fieldObj.shortType)switch(E.operator){case this.i18n.numberOperatorIs:ma=T+" \x3d "+R;break;case this.i18n.numberOperatorIsNot:ma=T+" \x3c\x3e "+R;break;case this.i18n.numberOperatorIsAtLeast:ma=T+" \x3e\x3d "+R;break;case this.i18n.numberOperatorIsLessThan:ma=T+" \x3c "+R;break;case this.i18n.numberOperatorIsAtMost:ma=
T+" \x3c\x3d "+R;break;case this.i18n.numberOperatorIsGreaterThan:ma=T+" \x3e "+R;break;case this.i18n.numberOperatorIsBetween:ma=T+" BETWEEN "+W+" AND "+ha;break;case this.i18n.numberOperatorIsNotBetween:ma=T+" NOT BETWEEN "+W+" AND "+ha;break;case this.i18n.numberOperatorIsBlank:ma=T+" IS NULL";break;case this.i18n.numberOperatorIsNotBlank:ma=T+" IS NOT NULL"}else switch(da.isDefined(R)&&"field"!==E.valueObj.type&&"string"===typeof R&&(R=this.parseFriendlyDate(R)),E.operator){case this.i18n.dateOperatorIsOn:ma=
"field"===E.valueObj.type?T+" \x3d "+R:oa?T+" BETWEEN "+(this.supportsStandardizedQuery?"timestamp ":"")+"'{"+N+"}' AND "+(this.supportsStandardizedQuery?"timestamp ":"")+"'{"+(N+1)+"}'":T+" BETWEEN "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(R)+"' AND "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(this.addDay(R))+"'";break;case this.i18n.dateOperatorIsNotOn:ma="field"===E.valueObj.type?T+" \x3c\x3e "+R:oa?T+" NOT BETWEEN "+(this.supportsStandardizedQuery?
"timestamp ":"")+"'{"+N+"}' AND "+(this.supportsStandardizedQuery?"timestamp ":"")+"'{"+(N+1)+"}'":T+" NOT BETWEEN "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(R)+"' AND "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(this.addDay(R))+"'";break;case this.i18n.dateOperatorIsBefore:ma="field"===E.valueObj.type?T+" \x3c "+R:T+" \x3c "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(R)+"'";break;case this.i18n.dateOperatorIsAfter:ma=
"field"===E.valueObj.type?T+" \x3e "+R:T+" \x3e "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(this.addDay(R))+"'";break;case this.i18n.dateOperatorIsBetween:ma=oa?T+" BETWEEN '"+W+"' AND '"+ha+"'":T+" BETWEEN "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(W)+"' AND "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(this.addDay(ha))+"'";break;case this.i18n.dateOperatorIsNotBetween:ma=oa?T+" NOT BETWEEN '"+W+"' AND '"+ha+"'":T+" NOT BETWEEN "+
(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(W)+"' AND "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(this.addDay(ha))+"'";break;case this.i18n.dateOperatorIsBlank:ma=T+" IS NULL";break;case this.i18n.dateOperatorIsNotBlank:ma=T+" IS NOT NULL"}return{whereClause:ma}},showDeleteIcon:function(){g.set(e.byId(this.id+".deleteExpression"),"display","block")},hideDeleteIcon:function(){g.set(e.byId(this.id+".deleteExpression"),"display","none")},createFieldsStore:function(E){if(E&&
E.length){E=n.clone(E);E=E.sort(function(R,W){R.label=R.alias||R.name;W.label=W.alias||W.name;return R.label<W.label?-1:R.label>W.label?1:0});var N=this.isHostedService(this.mapLayer.url);this.supportsStandardizedQuery=10.2<=this.mapLayer.version&&(this.mapLayer.useStandardizedQueries||this.isBigDataLayer(this.mapLayer));E=q.filter(E,function(R,W){return"esriFieldTypeString"===R.type||"esriFieldTypeDouble"===R.type||"esriFieldTypeSingle"===R.type||"esriFieldTypeInteger"===R.type||"esriFieldTypeSmallInteger"===
R.type||"esriFieldTypeDate"===R.type&&(this.allowAllDateTypes||N||this.supportsStandardizedQuery)?!0:!1},this);E=q.map(E,function(R,W){switch(R.type){case "esriFieldTypeString":var ha="string";this.fieldsInfo.stringFieldsCount++;break;case "esriFieldTypeDate":ha="date";this.fieldsInfo.dateFieldsCount++;break;default:ha="number",this.fieldsInfo.numberFieldsCount++}return{id:W,label:R.label,shortType:ha,alias:R.alias,editable:R.editable,name:R.name,nullable:R.nullable,type:R.type}},this);E.length&&
(this.fieldsStore=new r({data:{identifier:"id",label:"label",items:E}}))}},createOperatorStores:function(){var E=[];E.push({name:this.i18n.stringOperatorIs,name_:this.i18n.stringOperatorIs,id:0});E.push({name:this.i18n.stringOperatorIsNot,name_:this.i18n.stringOperatorIsNot,id:1});E.push({name:this.i18n.stringOperatorStartsWith,name_:this.i18n.stringOperatorStartsWith,id:2});E.push({name:this.i18n.stringOperatorEndsWith,name_:this.i18n.stringOperatorEndsWith,id:3});E.push({name:this.i18n.stringOperatorContains,
name_:this.i18n.stringOperatorContains,id:4});E.push({name:this.i18n.stringOperatorDoesNotContain,name_:this.i18n.stringOperatorDoesNotContain,id:5});E.push({name:this.i18n.stringOperatorIsBlank,name_:this.i18n.stringOperatorIsBlank,id:6});E.push({name:this.i18n.stringOperatorIsNotBlank,name_:this.i18n.stringOperatorIsNotBlank,id:7});this.stringOperatorStore=new r({data:{label:"name",identifier:"id",items:E}});E=[];E.push({name:this.i18n.dateOperatorIsOn,id:0});E.push({name:this.i18n.dateOperatorIsNotOn,
id:1});E.push({name:this.i18n.dateOperatorIsBefore,id:2});E.push({name:this.i18n.dateOperatorIsAfter,id:3});E.push({name:this.i18n.dateOperatorIsBetween,id:6});E.push({name:this.i18n.dateOperatorIsNotBetween,id:7});E.push({name:this.i18n.dateOperatorIsBlank,id:8});E.push({name:this.i18n.dateOperatorIsNotBlank,id:9});this.dateOperatorStore=new r({data:{label:"name",identifier:"id",items:E}});E=[];E.push({name:this.i18n.numberOperatorIs,name_:this.i18n.numberOperatorIs,id:0});E.push({name:this.i18n.numberOperatorIsNot,
name_:this.i18n.numberOperatorIsNot,id:1});E.push({name:this.i18n.numberOperatorIsAtLeast,name_:this.i18n.numberOperatorIsAtLeast,id:2});E.push({name:this.i18n.numberOperatorIsLessThan,name_:this.i18n.numberOperatorIsLessThan,id:3});E.push({name:this.i18n.numberOperatorIsAtMost,name_:this.i18n.numberOperatorIsAtMost,id:4});E.push({name:this.i18n.numberOperatorIsGreaterThan,name_:this.i18n.numberOperatorIsGreaterThan,id:5});E.push({name:this.i18n.numberOperatorIsBetween,name_:this.i18n.numberOperatorIsBetween,
id:6});E.push({name:this.i18n.numberOperatorIsNotBetween,name_:this.i18n.numberOperatorIsNotBetween,id:7});E.push({name:this.i18n.numberOperatorIsBlank,name_:this.i18n.numberOperatorIsBlank,id:8});E.push({name:this.i18n.numberOperatorIsNotBlank,name_:this.i18n.numberOperatorIsNotBlank,id:9});this.numberOperatorStore=new r({data:{label:"name",identifier:"id",items:E}})},readCodedValues:function(){q.forEach(this.mapLayer.fields,function(E){E.domain&&E.domain.codedValues&&(this.fieldDomains[E.name]=
E.domain.codedValues)},this)},getDecodedValue:function(E,N){N=this.getCodedValues(N);var R;if(N)for(R=0;R<N.length;R+=1){var W=N[R];if(W.code===E)return W.name}return E},getCodedValues:function(E){return this.fieldDomains[E]},getFieldsList:function(){return A.byId(this.id+".fieldsList")},getOperatorList:function(){return A.byId(this.id+".operatorList")},getValueFieldsList:function(){return A.byId(this.id+".valueFields")},getAttrValContNode:function(){return e.byId(this.id+".attributeValueContainer")},
getField:function(){var E=this.getFieldsList();return{name:E.store.getValue(E.item,"name"),label:E.store.getValue(E.item,"label"),shortType:E.store.getValue(E.item,"shortType"),type:E.store.getValue(E.item,"type")}},getOperator:function(){var E=this.getOperatorList();return E.item?E.store.getValue(E.item,"name"):""},getValue:function(){return{}},isInteractiveChecked:function(){return this.interactiveCheck.checked},setInteractiveSection:function(E,N,R){this.disableInteractiveHandlers();this.interactiveCheck.checked=
E;this.promptText.attr("value",N);this.hintText.attr("value",R);g.set(this.interactiveSpace,"display","block");this.interactiveArrow.innerHTML="\x26nbsp;\x26#9650;";this.enableInteractiveHandlers()},enableInteractiveHandlers:function(){this.onPromptChangeHandler=m.connect(this.promptText,"onChange",this,"onChangeInteractive");this.onHintchangeHandler=m.connect(this.hintText,"onChange",this,"onChangeInteractive")},disableInteractiveHandlers:function(){m.disconnect(this.onPromptChangeHandler);m.disconnect(this.onHintChangeHandler)},
fillFieldsList:function(E){var N=this.getFieldsList();N.set("labelAttr","label");N.set("searchAttr","label");N.set("store",E);N.set("value",0)},fillOperatorList:function(E,N,R){var W=this.getOperatorList();W.set("labelAttr","name");W.set("searchAttr","name");W.set("query",R?R:{});W.set("store",E);if(N){var ha=!1;for(R=0;20>R&&(E.fetchItemByIdentity({identity:R,onItem:n.hitch(this,function(oa){oa&&oa.name[0]===N&&(W.set("value",oa.id[0]),ha=!0)})}),!ha);R++);}else W.set("value",0)},createValueString:function(E){var N=
this.getAttrValContNode();this.clearAttributeValueDijits();h.empty(N);if(E){N=new J({id:this.id+".value","class":"attributeValue",maxHeight:150,sortByLabel:!0},h.create("div",{},N));var R=this.buildCodedValuesStore(E);N.set("store",R);N.set("value",0);this.valueHandlers.push(m.connect(N,"onChange",this,"onValueChange"))}else N=new F({id:this.id+".value","class":"attributeValue",required:!0,placeHolder:"",intermediateChanges:!0},h.create("div",{},N)),this.valueHandlers.push(m.connect(N,"onChange",
this,"onValueChange"));this.checkDefaultOption();this.getValue=function(){var W=A.byId(this.id+".value"),ha=!0;E?W.item?W=W.item.code[0]:(W="",ha=!1):ha=W=W.get("value");return{value:W,isValid:ha}}},createValueDate:function(){var E=this.getAttrValContNode();this.clearAttributeValueDijits();h.empty(E);E=new P({id:this.id+".value","class":"attributeValue",trim:!0,required:!0,placeHolder:"",constraints:{formatLength:"short"}},h.create("div",{},E));this.checkDefaultOption();this.valueHandlers.push(m.connect(E,
"onChange",this,"onValueChange"));this.getValue=function(){var N=A.byId(this.id+".value").get("value");return{value:N,isValid:da.isDefined(N)}}},createValueNumber:function(E){var N=this.getAttrValContNode();this.clearAttributeValueDijits();h.empty(N);if(E){N=new J({id:this.id+".value","class":"attributeValue",maxHeight:150,sortByLabel:!0},h.create("div",{},N));var R=this.buildCodedValuesStore(E);N.set("store",R);N.set("value",0);this.valueHandlers.push(m.connect(N,"onChange",this,"onValueChange"))}else N=
new Q({id:this.id+".value","class":"attributeValue",required:!0,placeHolder:"",intermediateChanges:!0,constraints:{pattern:"#####0.##########"}},h.create("div",{},N)),this.valueHandlers.push(m.connect(N,"onChange",this,"onValueChange"));this.checkDefaultOption();this.getValue=function(){var W=A.byId(this.id+".value"),ha=!0;E?W.item?W=W.item.code[0]:(W="",ha=!1):(W=W.get("value"),ha=da.isDefined(W)&&!isNaN(W));return{value:W,isValid:ha}}},createValueBetweenDate:function(){var E=this.getAttrValContNode();
this.clearAttributeValueDijits();h.empty(E);var N=new P({id:this.id+".value1","class":"attributeValue1",trim:!0,required:!0,placeHolder:"",constraints:{formatLength:"short"}},h.create("div",{},E));h.create("span",{innerHTML:this.i18n.andBetweenValues,"class":"attributeBetweenValues"},E);E=new P({id:this.id+".value2","class":"attributeValue2",trim:!0,required:!0,placeHolder:"",constraints:{formatLength:"short"}},h.create("div",{},E));this.checkDefaultOption();this.valueHandlers.push(m.connect(N,"onChange",
this,"onValueChange"));this.valueHandlers.push(m.connect(E,"onChange",this,"onValueChange"));this.getValue=function(){var R=A.byId(this.id+".value1").get("value"),W=A.byId(this.id+".value2").get("value");return{value1:R,value2:W,isValid:da.isDefined(R)&&da.isDefined(W)}}},createValueBetweenNumber:function(){var E=this.getAttrValContNode();this.clearAttributeValueDijits();h.empty(E);var N=new Q({id:this.id+".value1","class":"attributeValue1",required:!0,placeHolder:"",intermediateChanges:!0,constraints:{pattern:"#####0.##########"}},
h.create("div",{},E));h.create("span",{innerHTML:this.i18n.andBetweenValues,"class":"attributeBetweenValues"},E);E=new Q({id:this.id+".value2","class":"attributeValue2",required:!0,placeHolder:"",intermediateChanges:!0,constraints:{pattern:"#####0.##########"}},h.create("div",{},E));this.checkDefaultOption();this.valueHandlers.push(m.connect(N,"onChange",this,"onValueChange"));this.valueHandlers.push(m.connect(E,"onChange",this,"onValueChange"));this.getValue=function(){var R=A.byId(this.id+".value1").get("value"),
W=A.byId(this.id+".value2").get("value");return{value1:R,value2:W,isValid:da.isDefined(R)&&da.isDefined(W)&&!isNaN(R)&&!isNaN(W)&&R<=W}}},createValueInTheLastDate:function(){},createValueIsBlank:function(){var E=this.getAttrValContNode();this.clearAttributeValueDijits();h.empty(E);E.innerHTML="\x3cinput id\x3d'"+this.id+".value' class\x3d'attributeValue' type\x3d'text' disabled\x3d'true'/\x3e";this.checkDefaultOption();this.getValue=function(){return{value:null,isValid:!0}}},createValueFields:function(E,
N,R){var W=this.getAttrValContNode();this.clearAttributeValueDijits();h.empty(W);var ha=new J({id:this.id+".valueFields","class":"attributeValue",maxHeight:150,labelAttr:"label",searchAttr:"label",store:E,query:N},h.create("div",{},W));if(R){var oa=!1;for(W=0;100>W&&(E.fetchItemByIdentity({identity:W,onItem:n.hitch(this,function(ma){ma&&ma.shortType[0]===N.shortType&&ma.name[0]!==R&&(ha.set("value",ma.id),oa=!0)})}),!oa);W++);}this.valueHandlers.push(m.connect(ha,"onChange",this,"onValueChange"));
this.getValue=function(){var ma=A.byId(this.id+".valueFields");return{value:ma.store.getValue(ma.item,"name"),label:ma.store.getValue(ma.item,"label"),type:"field",isValid:!0}}},createValueUnique:function(E){var N=this.getAttrValContNode();this.clearAttributeValueDijits();h.empty(N);E=new J({id:this.id+".valueUnique","class":"attributeValue",maxHeight:150,store:E},h.create("div",{},N));E.set("value",0);this.valueHandlers.push(m.connect(E,"onChange",this,"onValueChange"));this.getValue=function(){var R=
A.byId(this.id+".valueUnique");return{value:R.store.getValue(R.item,"value"),isValid:!0}}},setValue:function(E,N){if(N)for(var R=0;R<N.length;R++){if(E===N[R].code){A.byId(this.id+".value").set("value",R);break}}else"date"===this.part.fieldObj.shortType?A.byId(this.id+".value").set("value",new Date(E)):("number"===this.part.fieldObj.shortType&&(E=Number(E)),A.byId(this.id+".value").set("value",E))},setValue1:function(E){"date"===this.part.fieldObj.shortType?E=new Date(E):"number"===this.part.fieldObj.shortType&&
(E=Number(E));A.byId(this.id+".value1").set("value",E)},setValue2:function(E){"date"===this.part.fieldObj.shortType?E=new Date(E):"number"===this.part.fieldObj.shortType&&(E=Number(E));A.byId(this.id+".value2").set("value",E)},setValueFieldById:function(E){this.getValueFieldsList().set("value",E)},enableOnFieldChange:function(){this.onFieldChangeEnabled=!0},enableOnOperatorChange:function(){this.onOperatorChangeEnabled=!0},onChangeField:function(E){this.onFieldChangeEnabled&&this._onChangeField(this.getFieldsList(),
this)},onChangeOperator:function(E){this.onOperatorChangeEnabled&&this._onChangeOperator(this.getOperatorList(),this)},onClickDeleteExpression:function(E){this._deleteExpression(this)},_onChangeField:function(E,N,R){var W=!!this.mapLayer&&this.isPortalHostedService(this.mapLayer.url);this.isBigDataLayer(this.mapLayer)||W&&"esriFieldTypeDate"===this.fieldsStore.getValue(E.item,"type")?g.set(e.byId(this.id+".radioUniqueColumn"),"display","none"):g.set(e.byId(this.id+".radioUniqueColumn"),"display",
"");W=N.getOperatorList();switch(this.fieldsStore.getValue(E.item,"type")){case "esriFieldTypeString":var ha=null;E=this.fieldsStore.getValue(E.item,"name");this.getCodedValues(E)&&(ha=this.i18n.stringOperatorStartsWith,ha+="|"+this.i18n.stringOperatorEndsWith,ha+="|"+this.i18n.stringOperatorContains,ha+="|"+this.i18n.stringOperatorDoesNotContain,ha={name_:new RegExp("^(?!("+ha+")$)")});W.attr("value")===this.i18n.stringOperatorIs?(N.fillOperatorList(this.stringOperatorStore,this.i18n.stringOperatorIs,
ha),this.onChangeOperator(W,N,R)):N.fillOperatorList(this.stringOperatorStore,this.i18n.stringOperatorIs,ha);N.createValueString(this.getCodedValues(E));break;case "esriFieldTypeDate":N.fillOperatorList(this.dateOperatorStore,this.i18n.dateOperatorIsOn);N.createValueDate();break;default:ha=null,E=this.fieldsStore.getValue(E.item,"name"),this.getCodedValues(E)&&(ha=this.i18n.numberOperatorIsBetween,ha+="|"+this.i18n.numberOperatorIsNotBetween,ha+="|"+this.i18n.numberOperatorIsAtLeast,ha+="|"+this.i18n.numberOperatorIsLessThan,
ha+="|"+this.i18n.numberOperatorIsAtMost,ha+="|"+this.i18n.numberOperatorIsGreaterThan,ha={name_:new RegExp("^(?!("+ha+")$)")}),W.attr("value")===this.i18n.numberOperatorIs?(N.fillOperatorList(this.numberOperatorStore,this.i18n.numberOperatorIs,ha),this.onChangeOperator(W,N,R)):N.fillOperatorList(this.numberOperatorStore,this.i18n.numberOperatorIs,ha),N.createValueNumber(this.getCodedValues(E))}"date"===this.fieldsStore.getValue(N.getFieldsList().item,"shortType")?N.disableInteractiveCheck():N.enableInteractiveCheck();
m.publish("filter-expression-change",this)},_onChangeOperator:function(E,N,R){E=E.item?E.item.name[0]:E.value;R=this.fieldsStore.getValue(N.getFieldsList().item,"shortType");var W=this.fieldsStore.getValue(N.getFieldsList().item,"name");N.enableOptions();if("date"!==R&&"number"!==R||E!==this.i18n.dateOperatorIsBetween&&E!==this.i18n.numberOperatorIsBetween&&E!==this.i18n.dateOperatorIsNotBetween&&E!==this.i18n.numberOperatorIsNotBetween)if("date"!==R||E!==this.i18n.dateOperatorInTheLast&&E!==this.i18n.dateOperatorNotInTheLast)if(E===
this.i18n.stringOperatorIsBlank||E===this.i18n.dateOperatorIsBlank||E===this.i18n.numberOperatorIsBlank||E===this.i18n.stringOperatorIsNotBlank||E===this.i18n.dateOperatorIsNotBlank||E===this.i18n.numberOperatorIsNotBlank)N.createValueIsBlank(),N.disableOptions();else switch(R){case "string":N.createValueString(this.getCodedValues(W));break;case "date":N.createValueDate();break;default:N.createValueNumber(this.getCodedValues(W))}else N.disableOptions(),N.createValueInTheLastDate();else N.disableOptions(),
"date"===R?N.createValueBetweenDate():N.createValueBetweenNumber();m.publish("filter-expression-change",this)},onInteractiveClick:function(E){this.isInteractiveChecked()?(g.set(this.interactiveSpace,"display","block"),this.interactiveArrow.innerHTML="\x26nbsp;\x26#9650;"):(g.set(this.interactiveSpace,"display","none"),this.interactiveArrow.innerHTML="\x26nbsp;\x26#9660;");m.publish("filter-expression-change",this)},onClickShowHideInteractive:function(E){this.interactiveCheck.disabled||("none"===g.set(this.interactiveSpace,
"display")?(g.set(this.interactiveSpace,"display","block"),this.interactiveArrow.innerHTML="\x26nbsp;\x26#9650;"):(g.set(this.interactiveSpace,"display","none"),this.interactiveArrow.innerHTML="\x26nbsp;\x26#9660;"))},onChangeInteractive:function(){m.publish("filter-expression-change",this)},showValueInput:function(E){this._showValueInput(A.byNode(E.target),this)},showFields:function(E){this._showFields(A.byNode(E.target),this)},showUniqueList:function(E){this._showUniqueList(A.byNode(E.target),this)},
onValueChange:function(){this.onValueChangeHandler&&clearTimeout(this.onValueChangeHandler);this.onValueChangeHandler=setTimeout(n.hitch(this,function(){this.onValueChangeHandler=null;m.publish("filter-expression-change",this)}),800)},_showValueInput:function(E,N,R){N.onChangeOperator(E,N,R);N.enableInteractiveCheck()},_showFields:function(E,N,R){R=N.getFieldsList().item;E=this.fieldsStore.getValue(R,"shortType");R=this.fieldsStore.getValue(R,"name");N.createValueFields(this.fieldsStore,{shortType:E,
name:new RegExp("^(?!"+R+"$)")},R);N.disableInteractiveCheck()},_showUniqueList:function(E,N,R){this.uniqueValuesStore&&delete this.uniqueValuesStore;R=this.fieldsStore.getValue(N.getFieldsList().item,"name");if(10.1<=this.version||!this.mapLayer.url){var W=null;this.mapLayer.queryServiceUrl?W=this.mapLayer.queryServiceUrl:this.mapLayer.itemLayers&&q.forEach(this.mapLayer.itemLayers,function(ha){ha.id===this.layerInfo.id&&ha.layerUrl&&(W=ha.layerUrl)},this);W||(W=this.mapLayer.url);if(this.uniqueValuesResults[this.mapLayer.id+
"_"+R])this.onGenerateRendererResults(N,E,this.uniqueValuesResults[this.mapLayer.id+"_"+R]);else this.generateRendererUniqueValues(R,W,n.hitch(this,"onGenerateRendererResults",N,E),n.hitch(this,function(){this.showValueInput(E,N)}))}else E&&this.showValueInput(E,N)},onGenerateRendererResults:function(E,N,R){var W=this.fieldsStore.getValue(E.getFieldsList().item,"name"),ha=this.fieldsStore.getValue(E.getFieldsList().item,"shortType"),oa=this.fieldsStore.getValue(E.getFieldsList().item,"type");this.uniqueValuesResults[this.mapLayer.id+
"_"+W]=R;var ma=null;q.forEach(this.mapLayer.fields,function(T){T.name===W&&T.domain&&(ma=T.domain)});R=q.filter(R,function(T,ba){return"string"===ha?"\x3cNull\x3e"!==T&&""!==T.trim():"\x3cNull\x3e"!==T&&""!==T});R.length?("date"===ha?(R=q.map(R,function(T){return new Date(T)}),R=R.sort(function(T,ba){T=T.getTime();ba=ba.getTime();return T<ba?-1:T>ba?1:0}),R=q.map(R,function(T){return this.formatFriendlyDate(T)},this)):"number"===ha?(R=q.map(R,function(T){return"esriFieldTypeDouble"===oa||"esriFieldTypeSingle"===
oa?parseFloat(T):parseInt(T,10)}),R=R.sort(function(T,ba){return T<ba?-1:T>ba?1:0})):R=R.sort(function(T,ba){return T<ba?-1:T>ba?1:0}),N=q.map(R,function(T,ba){var na=T;"string"===ha&&(na=""===T?"\x3c"+this.i18n.emptyString+"\x3e":T);if(ma&&ma.codedValues){for(var ia=0;ia<ma.codedValues.length;ia++){var pa=ma.codedValues[ia];if(T===pa.code)return{id:ba,name:pa.name||na,value:T}}return{id:ba,name:""+na,value:T}}if("esriFieldTypeDouble"===oa||"esriFieldTypeSingle"===oa)na=f.format(T,{pattern:"#####0.##########"});
return{id:ba,name:""+na,value:T}},this),this.uniqueValuesStore=new r({data:{label:"name",identifier:"id",items:N}}),E.createValueUnique(this.uniqueValuesStore)):this.showValueInput(N,E)},generateRendererUniqueValues:function(E,N,R,W){E instanceof Array&&(E=E.toString());var ha=new fa;ha.attributeField=E;E=new K;E.classificationDefinition=ha;this.mapLayer instanceof aa?N=new ea(this.mapLayer):this.mapLayer instanceof V&&!this.mapLayer.url?N=new ea(this.mapLayer):this.hasDynamicLayers(this.mapLayer)?
(ha=this.mapLayer.layerDefinitions&&this.mapLayer.layerDefinitions[this.mapLayer.id]?this.mapLayer.layerDefinitions[this.mapLayer.id]:null,E.where=ha?ha:null,N=new ea(this.mapLayer.url+"/dynamicLayer",{source:this.layerInfo.source})):(ha=this.mapLayer.getDefinitionExpression(),E.where=ha?ha:null,N=new ea(N));Z.defaults.io.timeout=1E4;N.execute(E,function(oa){Z.defaults.io.timeout=6E4;oa=q.map(oa.infos,function(ma){return ma.value});R(oa)},n.hitch(this,function(oa){Z.defaults.io.timeout=6E4;W()}))},
hasDynamicLayers:function(E){return E&&E.supportsDynamicLayers?!0:!1},formatDate:function(E){return y.format(E,{datePattern:"yyyy-MM-dd",selector:"date"})+" "+y.format(E,{selector:"time",timePattern:"HH:mm:ss"})},formatFriendlyDate:function(E){return y.format(E,{formatLength:"short",selector:"date"})},parseFriendlyDate:function(E){return y.parse(E,{formatLength:"short",selector:"date"})},parseDate:function(E){var N=y.parse(E,{datePattern:"yyyy-MM-dd",timePattern:"HH:mm:ss"});N||(N=y.parse(E.replace(" ",
", "),{datePattern:"yyyy-MM-dd",timePattern:"HH:mm:ss"}))||(N=y.parse(E.replace(" "," - "),{datePattern:"yyyy-MM-dd",timePattern:"HH:mm:ss"}));return N},addDay:function(E){return new Date(E.getTime()+this.dayInMS)},subtractDay:function(E){return new Date(E.getTime()-this.dayInMS)},containsNonLatinCharacter:function(E){for(var N=0;N<E.length;N++)if(255<E.charCodeAt(N))return!0;return!1},hasWhiteSpace:function(E){return/\s/g.test(E)},buildCodedValuesStore:function(E){E=q.map(E,function(N,R){return{name:N.name,
code:N.code,id:R}});return new r({data:{label:"name",identifier:"id",items:E}})},clearAttributeValueDijits:function(){this.valueHandlers&&0!==this.valueHandlers.length&&(q.forEach(this.valueHandlers,n.hitch(this,function(E){m.disconnect(E);E=null})),this.valueHandlers=[],A.byId(this.id+".value")?A.byId(this.id+".value").destroy():e.byId(this.id+".value")&&this.getAttrValContNode().removeChild(e.byId(this.id+".value")),A.byId(this.id+".value1")?A.byId(this.id+".value1").destroy():e.byId(this.id+".value1")&&
this.getAttrValContNode().removeChild(e.byId(this.id+".value1")),A.byId(this.id+".value2")?A.byId(this.id+".value2").destroy():e.byId(this.id+".value2")&&this.getAttrValContNode().removeChild(e.byId(this.id+".value2")),A.byId(this.id+".valueFields")&&A.byId(this.id+".valueFields").destroy(),A.byId(this.id+".valueUnique")&&A.byId(this.id+".valueUnique").destroy())},checkDefaultOption:function(){p(".attributeValueOptions .attributeValueRadio",this.domNode).forEach(function(E){A.byNode(E).set("checked",
-1<E.className.indexOf("radioValue"))})},disableOptions:function(){p(".attributeValueOptions .attributeValueRadio",this.domNode).forEach(function(E){A.byNode(E).set("disabled",!0)})},enableOptions:function(){p(".attributeValueOptions .attributeValueRadio",this.domNode).forEach(function(E){A.byNode(E).set("disabled",!1)})},checkFieldOption:function(){A.byId(this.id+".radioFields").set("checked",!0)},disableFieldOption:function(){A.byId(this.id+".radioFields").set("disabled",!0)},disableUniqueOption:function(){A.byId(this.id+
".radioUnique").set("disabled",!0)},enableInteractiveCheck:function(){this.interactiveCheck.disabled=!1},disableInteractiveCheck:function(){this.interactiveCheck.checked=!1;this.interactiveCheck.disabled=!0},isBigDataLayer:function(E){return!!E.url&&-1!==E.url.indexOf("BigDataCatalogServer")&&("featureClass"===E.type||"table"===E.type)},isPortalHostedService:function(E){return E?-1!==E.toLowerCase().indexOf("/hosted/"):!1},isHostedService:function(E){if(!E)return!1;var N=-1!==E.indexOf(".arcgis.com/");
E=-1!==E.indexOf("//services")||-1!==E.indexOf("//tiles")||-1!==E.indexOf("//features");return N&&E},buildEditUIField:function(E,N,R){this.getFieldItemByName({name:E.fieldObj.name},n.hitch(this,function(W){N.getFieldsList().set("value",W.id[0],!1);this.buildEditUIOperator(E,N,R)}),n.hitch(this,function(){N.getFieldsList().set("value",0);this.buildEditUIOperator(E,N,R)}))},buildEditUIOperator:function(E,N,R){switch(E.fieldObj.shortType){case "string":N.fillOperatorList(this.stringOperatorStore,E.operator);
break;case "date":N.fillOperatorList(this.dateOperatorStore,E.operator);break;default:N.fillOperatorList(this.numberOperatorStore,E.operator)}setTimeout(n.hitch(this,function(){this.getOperatorItemByName(N.getOperatorList().store,{name:E.operator},n.hitch(this,function(W){N.getOperatorList().set("value",W.id[0],!1);this.buildEditUIValue(E,N,R)}),n.hitch(this,function(){N.getOperatorList().set("value",0);this.buildEditUIValue(E,N,R)}))}),100)},buildEditUIValue:function(E,N,R){this.onOperatorChangeEnabled=
this.onFieldChangeEnabled=!0;var W=E.operator;this.onChangeOperator(N.getOperatorList(),N);N.enableOptions();setTimeout(n.hitch(this,function(){W===this.i18n.stringOperatorIsBlank||W===this.i18n.dateOperatorIsBlank||W===this.i18n.numberOperatorIsBlank||W===this.i18n.stringOperatorIsNotBlank||W===this.i18n.dateOperatorIsNotBlank||W===this.i18n.numberOperatorIsNotBlank?(N.createValueIsBlank(),N.disableOptions()):"field"===E.valueObj.type?(N.createValueFields(this.fieldsStore,{shortType:E.fieldObj.shortType,
name:new RegExp("^(?!"+E.fieldObj.name+"$)")}),N.checkFieldOption(),this.getFieldItemByName({name:E.valueObj.value},n.hitch(this,function(ha){N.setValueFieldById(ha.id[0])}),n.hitch(this,function(){N.setValueFieldById(0)}))):da.isDefined(E.valueObj.value1)?(N.setValue1(E.valueObj.value1),N.setValue2(E.valueObj.value2)):N.setValue(E.valueObj.value,this.getCodedValues(E.fieldObj.name))}),100)},getFieldItemByName:function(E,N,R){this.fieldsStore.fetch({query:E,onComplete:n.hitch(this,function(W){W&&
W.length?N(W[0]):R()})})},getOperatorItemByName:function(E,N,R,W){E.fetch({query:N,onComplete:n.hitch(this,function(ha){ha&&ha.length?R(ha[0]):W()})})}});b("extend-esri")&&n.setObject("dijit.SingleFilter",H,ca);return H})},"esri/tasks/GenerateRendererTask":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/number dojo/_base/json dojo/_base/Deferred dojo/has ../kernel ../request ../deferredUtils ../urlUtils ../renderers/jsonUtils ./StatisticDefinition ./Task ./QueryTask ./query dojo/has!extend-esri?./GenerateRendererParameters dojo/has!extend-esri?./ClassificationDefinition dojo/has!extend-esri?./ClassBreaksDefinition dojo/has!extend-esri?./UniqueValueDefinition dojo/has!extend-esri?./ColorRamp dojo/has!extend-esri?./AlgorithmicColorRamp dojo/has!extend-esri?./MultipartColorRamp".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w){k=k(p,{declaredClass:"esri.tasks.GenerateRendererTask",_eventMap:{complete:["renderer"]},constructor:function(u,r){!n.isObject(u)||"esri.layers.FeatureLayer"!==u.declaredClass&&"esri.layers.CSVLayer"!==u.declaredClass?(this.url=u,this._url.path+="/generateRenderer"):u.url&&n.isString(u.url)&&"esri.layers.CSVLayer"!==u.declaredClass?(this.url=u.url,this._url=g.urlToObject(this.url),this._url.path+="/generateRenderer"):this._features=u.graphics;this._handler=
n.hitch(this,this._handler);this.source=r&&r.source;this.gdbVersion=r&&r.gdbVersion;this.checkValueRange=r&&r.checkValueRange;this.registerConnectEvents()},_handler:function(u,r,y,B,C){try{if("esri.renderer.ClassBreaksRenderer"===u.declaredClass||"esri.renderer.UniqueValueRenderer"===u.declaredClass)var G=u;else G=d.fromJson(u),"classBreaks"===u.type&&G.setMaxInclusive(!0);if(this.checkValueRange){var x=new t(this.url),v=new w,z=new h;z.statisticType="min";z.onStatisticField=this._field;var A=new h;
A.statisticType="max";A.onStatisticField=this._field;v.outStatistics=[z,A];x.execute(v).then(n.hitch(this,function(F){F=F.features[0].attributes;for(var J in F)if(0===J.toLowerCase().indexOf("min"))var L=F[J];else var P=F[J];G=this._processRenderer(G,this._prefix,this._unitLabel,this._formatLabel,this._precision,L,P);this._successHandler([G],"onComplete",y,C)}))}else G=this._processRenderer(G,this._prefix,this._unitLabel,this._formatLabel,this._precision),this._successHandler([G],"onComplete",y,C)}catch(F){this._errorHandler(F,
B,C)}},_processRenderer:function(u,r,y,B,C,G,x){"esri.renderer.ClassBreaksRenderer"===u.declaredClass?q.forEach(u.infos,function(v,z){0===z&&void 0!==G&&null!==G&&(v.minValue=G);z===u.infos.length-1&&void 0!==x&&null!==x&&(v.classMaxValue=v.maxValue=x);C&&(v.classMaxValue=v.maxValue=Math.round(v.maxValue/C)*C,v.minValue=Math.round(v.minValue/C)*C);B&&(v.label=m.format(v.minValue)+" - "+m.format(v.maxValue));r&&(v.label=r+" "+v.label);y&&(v.label=v.label+" "+y)}):q.forEach(u.infos,function(v,z){0===
z&&void 0!==G&&null!==G&&(v.value=G);z===u.infos.length-1&&void 0!==x&&null!==x&&(v.value=x);B&&(v.label=m.format(v.value));r&&(v.label=r+" "+v.label);y&&(v.label=v.label+" "+y)});return u},execute:function(u,r,y){var B=this._handler,C=this._errorHandler;this._precision=u.precision;this._prefix=u.prefix;this._unitLabel=u.unitLabel;this._formatLabel=u.formatLabel;if(this._features=u.features||this._features){var G=new b;var x=this._features;H(["./generateRenderer"],function(A){var F;"esri.tasks.ClassBreaksDefinition"===
u.classificationDefinition.declaredClass?F=A.createClassBreaksRenderer({features:x,definition:u.classificationDefinition}):"esri.tasks.UniqueValueDefinition"===u.classificationDefinition.declaredClass&&(F=A.createUniqueValueRenderer({features:x,definition:u.classificationDefinition}));F?B(F,null,r,y,G):C(null,y,G)})}else{var v=n.mixin(u.toJson(),{f:"json"});this._field="esri.tasks.ClassBreaksDefinition"===u.classificationDefinition.declaredClass?u.classificationDefinition.classificationField:u.classificationDefinition.attributeField;
if(this.source){var z={source:this.source.toJson()};v.layer=l.toJson(z)}this.gdbVersion&&(v.gdbVersion=this.gdbVersion);G=new b(e._dfdCanceller);G._pendingDfd=f({url:this._url.path,content:v,callbackParamName:"callback",load:function(A,F){B(A,F,r,y,G)},error:function(A){C(A,y,G)}})}return G},onComplete:function(){}});a("extend-esri")&&n.setObject("tasks.GenerateRendererTask",k,c);return k})},"esri/tasks/UniqueValueDefinition":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel",
"./ClassificationDefinition"],function(H,k,n,q,m){H=H(m,{declaredClass:"esri.tasks.UniqueValueDefinition",type:"uniqueValueDef",attributeField:null,attributeField2:null,attributeField3:null,fieldDelimiter:null,toJson:function(){var l=this.inherited(arguments);this.uniqueValueFields=[];this.attributeField&&this.uniqueValueFields.push(this.attributeField);this.attributeField2&&this.uniqueValueFields.push(this.attributeField2);this.attributeField3&&this.uniqueValueFields.push(this.attributeField3);k.mixin(l,
{type:this.type,uniqueValueFields:this.uniqueValueFields});this.fieldDelimiter&&k.mixin(l,{fieldDelimiter:this.fieldDelimiter});return l}});n("extend-esri")&&k.setObject("tasks.UniqueValueDefinition",H,q);return H})},"esri/tasks/ClassificationDefinition":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(H,k,n,q){H=H(null,{declaredClass:"esri.tasks.ClassificationDefinition",type:null,baseSymbol:null,colorRamp:null,toJson:function(){var m={};this.baseSymbol&&
k.mixin(m,{baseSymbol:this.baseSymbol.toJson()});this.colorRamp&&!k.isString(this.colorRamp)&&k.mixin(m,{colorRamp:this.colorRamp.toJson()});return m}});n("extend-esri")&&k.setObject("tasks.ClassificationDefinition",H,q);return H})},"esri/tasks/GenerateRendererParameters":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/json","dojo/has","../kernel"],function(H,k,n,q,m){H=H(null,{declaredClass:"esri.tasks.GenerateRendererParameters",classificationDefinition:null,where:null,precision:null,
prefix:null,unitLabel:null,formatLabel:null,toJson:function(){return{classificationDef:n.toJson(this.classificationDefinition.toJson()),where:this.where}}});q("extend-esri")&&k.setObject("tasks.GenerateRendererParameters",H,m);return H})},"esri/layers/GeoRSSLayer":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/json dojo/has ../kernel ../config ../request ../urlUtils ./ServiceGeneratedFeatureCollection".split(" "),function(H,k,n,q,m,l,b,a,c){H=H([c],{declaredClass:"esri.layers.GeoRSSLayer",
serviceUrl:a.getProtocolForWebResource()+"//utility.arcgis.com/sharing/rss",constructor:function(f,e){this._url=a.urlToObject(this.url=f);l.defaults.geoRSSService&&(this.serviceUrl=l.defaults.geoRSSService);this._createLayer()},parse:function(){return this._io=b({url:this.serviceUrl,content:{url:this.url,refresh:this.loaded?!0:void 0,outSR:this._outSR?n.toJson(this._outSR.toJson()):void 0},callbackParamName:"callback"})},_initLayer:function(f){this.inherited(arguments);this.loaded||(this.loaded=!0,
this.onLoad(this))}});q("extend-esri")&&k.setObject("layers.GeoRSSLayer",H,m);return H})},"esri/layers/ServiceGeneratedFeatureCollection":function(){define("dojo/_base/declare dojo/_base/connect dojo/_base/lang dojo/_base/array dojo/dom-construct dojo/dom-style dojo/has ../kernel ../SpatialReference ../geometry/Extent ../geometry/webMercatorUtils ../renderers/SimpleRenderer ./layer ./FeatureLayer ../dijit/PopupTemplate".split(" "),function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p){H=H([d],{declaredClass:"esri.layers._ServiceGeneratedFeatureCollection",
constructor:function(t,w){this.pointSymbol=w&&w.pointSymbol;this.polylineSymbol=w&&w.polylineSymbol;this.polygonSymbol=w&&w.polygonSymbol;this._outSR=w&&(w.outSpatialReference||w.outSR)||new c({wkid:4326});this._options=n.mixin({},w)},parse:function(){console.error("parse function has not been implemented")},getFeatureLayers:function(){var t=[];this._fLayers&&(t=t.concat(this._fLayers));return t},onRefresh:function(){},onOpacityChange:function(){},refresh:function(){this.loaded&&this._map&&!this._io&&
this.visible&&this._createLayer()},_createLayer:function(t){var w=this;this._fireUpdateStart();t=this.parse(t);t.addCallback(function(u){w._io=null;w._initLayer(u)});t.addErrback(function(u){w._io=null;u=n.mixin(Error(),u);u.message="Unable to load resource: "+w.url+" "+(u.message||"");w._fireUpdateEnd(u);w.onError(u)})},_initLayer:function(t){this.loaded&&this._removeInternalLayers();this.name=t.name;this.description=t.description;this.snippet=t.snippet;this.featureInfos=t.featureInfos;this.fullExtent=
this.initialExtent=new f(t.lookAtExtent);this.copyright=t.author||t.copyright;var w;(t=n.getObject("featureCollection.layers",!1,t))&&0<t.length&&(this._fLayers=[],q.forEach(t,function(u,r){var y=n.getObject("featureSet.features",!1,u);y&&0<y.length&&(w=n.mixin({outFields:["*"],infoTemplate:u.popupInfo?new p(u.popupInfo):null,editable:!1},this._options),w.id&&(w.id=w.id+"_"+r),w.webgl=!1,u.layerDefinition.capabilities="Query,Data",u=new h(u,w),u.geometryType&&(this["_"+u.geometryType]=u),this._fLayers.push(u))},
this),0===this._fLayers.length&&delete this._fLayers);this.items=[];this._esriGeometryPoint&&(this.items=this.items.concat(this._esriGeometryPoint.graphics),this.pointSymbol&&(t=new g(this.pointSymbol),this._esriGeometryPoint.setRenderer(t)));this._esriGeometryPolyline&&(this.items=this.items.concat(this._esriGeometryPolyline.graphics),this.polylineSymbol&&(t=new g(this.polylineSymbol),this._esriGeometryPolyline.setRenderer(t)));this._esriGeometryPolygon&&(this.items=this.items.concat(this._esriGeometryPolygon.graphics),
this.polygonSymbol&&(t=new g(this.polygonSymbol),this._esriGeometryPolygon.setRenderer(t)));this._fireUpdateEnd();this.loaded&&(this._addInternalLayers(),this.onRefresh())},_addInternalLayers:function(){var t=this._map;this._fireUpdateStart();var w=t.spatialReference,u=this._outSR;if(w.wkid)var r=w._isWebMercator()&&u._isWebMercator()||w.wkid===u.wkid;else if(w.wkt)r=w.wkt===u.wkt;else{console.log("_setMap - map has invalid spatial reference");return}if(!r)if(w._isWebMercator()&&4326===u.wkid)this._converter=
e.geographicToWebMercator;else if(u._isWebMercator()&&4326===w.wkid)this._converter=e.webMercatorToGeographic;else{console.log("_setMap - unsupported workflow. Spatial reference of the map and layer do not match, and the conversion cannot be done on the client.");return}(w=this._fLayers)&&0<w.length&&q.forEach(w,function(y){if(this._converter){var B=y.graphics,C,G,x=B?B.length:0;for(C=0;C<x;C++)(G=B[C].geometry)&&B[C].setGeometry(this._converter(G))}t.addLayer(y)},this);this.setVisibility(this.visible);
this._fireUpdateEnd()},_removeInternalLayers:function(){var t=this._map;t&&q.forEach(this.getFeatureLayers(),t.removeLayer,t)},setScaleRange:function(t,w){this.inherited(arguments);q.forEach(this.getFeatureLayers(),function(u){u.setScaleRange(t,w)});this._options.minScale=this.minScale;this._options.maxScale=this.maxScale},setOpacity:function(t){this.opacity!=t&&(q.forEach(this.getFeatureLayers(),function(w){w.setOpacity(t)}),this.opacity=this._options.opacity=t,this.onOpacityChange(t))},onVisibilityChange:function(t){this._fireUpdateStart();
q.forEach(this.getFeatureLayers(),function(w){w.setVisibility(t)});this._fireUpdateEnd()},_setMap:function(t,w){this.inherited(arguments);this._map=t;var u=this._div=m.create("div",null,w);l.set(u,"position","absolute");this._addInternalLayers();this.evaluateSuspension();return u},_unsetMap:function(t,w){this._io&&this._io.cancel();k.disconnect(this._extChgHandle);delete this._extChgHandle;this._removeInternalLayers();var u=this._div;u&&(w.removeChild(u),m.destroy(u));this._div=null;this.inherited(arguments)}});
b("extend-esri")&&n.setObject("layers._ServiceGeneratedFeatureCollection",H,a);return H})},"esri/dijit/analysis/ItemTypes":function(){define(["dojo/_base/lang","dojo/has","../../kernel"],function(H,k,n){var q={BIGDATA:"Big Data File Share",CSV:"CSV",XLS:"Microsoft Excel",FS:"Feature Service",MS:"Map Service",IS:"Image Service",FLAYER:"Feature Layer",BDATAFEATURE:"featureClass",TABLE:"Table",BTABLE:"table",FLAYERVIEW:"FeatureLayerView",MVGRID:"Multi-Variable Grid",GPSERVICE:"Geoprocessing Service",
RFT:"Raster function template",BDFSTEMPLATE:"bdfstemplate",DLPK:"Deep Learning Package",FILE:"files",DOC:"documents",IMG:"images",PDF:"pdfs",CSVS:"csvs"};k("extend-esri")&&H.setObject("dijit.analysis.itemTypes",q,n);return q})},"esri/dijit/analysis/FeatureRecordSetLayer":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../../tasks/DataFile","../../kernel"],function(H,k,n,q,m){H=H(q,{declaredClass:"esri.dijit.analysis.FeatureRecordSetLayer",constructor:function(l){l&&k.mixin(this,
l)},toJson:function(){var l={};this.url&&(l.url=this.url);this.filter&&(l.filter=this.filter);this.serviceToken&&(l.serviceToken=this.serviceToken);this.featureSet&&(l.featureSet=this.featureSet);this.layerDefinition&&(l.layerDefinition=this.layerDefinition);this.time&&(l.time=this.time);return l}});n("extend-esri")&&k.setObject("dijit.analysis.FeatureRecordSetLayer",H,m);return H})},"esri/dijit/analysis/PluginLayers":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/dom-construct dojo/Deferred dojo/promise/all dojo/dom dojo/dom-attr dojo/dom-class dojo/dom-style dojo/query dojo/store/Memory dojo/store/Observable dojo/Evented dojo/has ./ItemTypes ../../request ../../kernel ../../lang dgrid/OnDemandGrid dgrid/Selection ./AnalysisRegistry dojo/i18n!../../nls/jsapi".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G){var x=H([h],{infoPanelTemplate:'\x3cdiv\x3e\x3cdiv class\x3d"template-info-showing"\x3e\x3cdiv\x3e\x3cimg width\x3d\'16px\' height\x3d\'16px\' alt\x3d\'\' src\x3d\'${item.iconUrl}\'\x3e\x3c/div\x3e\x3ch4\x3e${item.title}\x3c/h4\x3e\x3cdiv class\x3d"template-info"\x3e\x3cp class\x3d""\x3e${item.snippet}\x3c/p\x3e${item:plugIn._showLayers}\x3cdiv id\x3d"${item.id}_details" class\x3d"quiet-scroll layer-container"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"panel-actions"\x3e${item:plugIn._addLayerToMap}\x3cbutton class\x3d"btn blue btn-main disabled" id\x3d"add-layer"\x3e${i18n.common.addLayerBtnLabel}\x3c/button\x3e\x3cbutton class\x3d"btn btn-cancel" id\x3d"close-panel"\x3e${i18n.common.close}\x3c/button\x3e\x3c/div\x3e\x3cdiv\x3e',
geometryTypes:[C.GeometryTypes.Point,C.GeometryTypes.Point.MultiPoint,C.GeometryTypes.Line,C.GeometryTypes.Polygon],layerTypes:[t.FLAYER,t.BDATAFEATURE,t.BTABLE,t.TABLE],timeTypes:[C.TimeTypes.Instant,C.TimeTypes.Interval],checkGeometryType:!0,checkLayerType:!1,checkTimeFilter:!1,fetchType:['type:"'+t.MS+'"','type:"'+t.FS+'"'],constructor:function(v){k.mixin(this,v);this.filters={all:{},mycontent:{owners:this.self?[this.self.user.username]:[]},esriBoundaryLayers:{owners:["esri_boundaries"]}};this.i18n=
k.mixin({},G.browseLayersDlg);k.mixin(this.i18n,G.browseItems);k.mixin(this.i18n,G.common);this.filterStrings={all:{title:this.self&&this.self.isPortal?this.i18n.items.portalOrg:this.i18n.items.organizationLabel},mycontent:{title:this.i18n.items.contentLabel},esriBoundaryLayers:{title:this.i18n.esriBoundaryLayers}}},fetchData:function(){this._portal=this.parent._portal;this._user=this._portal.getPortalUser();this.filters.mycontent.owner=this._user;this.parent.fetchType&&(this.fetchType=this.parent.fetchType);
return this._fetchItems()},_fetchItems:function(){return this.parent._fetchItems({types:this.fetchType})},_fetchServiceInfo:function(v){var z=new m,A,F={f:"json"};v.url?(-1!==window.location.protocol.indexOf("https:")&&(v.url=v.url.replace("http:","https:")),w({url:v.url,content:F}).then(function(J){z.resolve(J)},k.hitch(this,function(J){A=J.details&&J.details.length?J.details.shift():"";J&&403===J.httpCode&&-1<A.indexOf("SSL Required")?(v.set("url",v.url.replace("http:","https:")),this._fetchServiceInfo(v).then(function(L){z.resolve(L)})):
(v.isLoaded=!0,z.resolve({error:J}))}))):z.resolve(null);return z},_addLayerToMap:function(v){return v.type===t.BIGDATA||v.type===t.CSV||v.type===t.XLS?"":'\x3cdiv class\x3d"esriFloatLeading esriLeadingPadding1 padding-trailer-half js-add-layer-node"\x3e\x3clabel\x3e\x3cinput name\x3d"addlayertomap" class\x3d"js-add-layer-checkbox" type\x3d"checkbox"\x3e\x3cspan class\x3d"esriLeadingPadding1"\x3e'+this.i18n.common.addLayer+"\x3c/span\x3e\x3c/label\x3e\x3c/div\x3e"},_showLayers:function(v){if(v&&-1!==
n.indexOf([t.FS,t.MS,t.IS,t.BIGDATA,t.CSV,t.XLS],v.type)){if(v.type===t.CSV||v.type===t.XLS)v.url=v.itemUrl;this.plugIn._fetchServiceInfo(v).then(k.hitch(this,function(z){var A=[],F={f:"json"};z.layers&&(A=[].concat(A).concat(z.layers));z.tables&&0<z.tables.length&&(A=[].concat(A).concat(z.tables));z.children&&(A=z.children);!v||v.type!==t.CSV&&v.type!==t.XLS&&v.type!==t.IS||(A=[v]);if(!A.length)var J=this.plugIn.i18n.noDataMessages.noItemInfo;this.plugIn._createLayerGrid(q.create("div",null,b.byId(v.id+
"_details")),J);n.forEach(A,function(L,P){v.type===t.BIGDATA?(L.url=v.url+"/"+L.name,L.url=encodeURI(L.url)):L.url=v.type===t.CSV?v.itemUrl:v.type===t.IS?v.url:v.url+"/"+P;-1!==window.location.protocol.indexOf("https:")&&(L.url=L.url.replace("http:","https:"));w({url:L.url,content:F}).then(k.hitch(this,function(Q){L=k.mixin(L,Q);this.plugIn._store.put(L);this.plugIn._grid.refresh()}),k.hitch(this,function(Q){this.plugIn._grid.noDataMessage=this.plugIn.i18n.noDataMessages.noLayerInfo;this.plugIn._grid.refresh()}))},
this)}))}return""},_getLayerHead:function(){return"\x3ctr\x3e\x3cth\x3e\x3c/th\x3e\x3cth\x3eLayer Name\x3c/th\x3e\x3cth\x3e Geometry Type\x3c/th\x3e\x3c/tr\x3e"},_getLayerNode:function(v,z,A){z=v.name;var F='\x3ctr\x3e\x3ctd\x3e\x3cinput type\x3d"checkbox" class\x3d"js-layer-check" name\x3d"layers" value\x3d"'+z+' checked"\x3e\x3c/td\x3e\x3ctd\x3e',J="\x3c/td\x3e\x3ctd\x3e"+v.geometryType+"\x3c/td\x3e\x3c/tr\x3e";return v.itemUrl||v.url?F+'\x3ca class\x3d"'+(A||"")+'"\x3e'+z+"\x3c/a\x3e"+J:F+z+J},
_createLayerGrid:function(v,z){var A=H([y,B]);this._store=d(new g({idProperty:"name"}));this._atleastALayerAvailable=!1;this._grid=new A({store:this._store,query:k.hitch(this,function(F){var J=!0,L=!0,P=!0,Q=!0;this.checkGeometryType&&F.type!==t.IS&&(P=-1!==n.indexOf(this.geometryTypes,F.geometryType));this.checkTimeFilter&&(J=-1!==n.indexOf(this.timeTypes,this.getTimeType(F)));this.checkLayerType&&(L=-1!==n.indexOf(this.layerTypes,F.type));"function"===typeof this.customCheckHandler&&(Q=this.customCheckHandler(F));
F=F&&P&&J&&L&&Q;F||(this._grid.noDataMessage=this.getNoDataMessage({geomCheck:P,timeCheck:J,typeCheck:L,customCheck:Q}));!this._atleastALayerAvailable&&F&&(this._atleastALayerAvailable=F);e(".js-add-layer-checkbox",this.parent.infoPanel).forEach(function(Z){a.set(Z,"disabled",!this._atleastALayerAvailable)},this);return F}),selectionMode:"single","class":"esriAnalysisLayersGrid quiet-scroll",noDataMessage:z||this.i18n.noValidLayerMsg,allowSelect:k.hitch(this,function(F){var J;this.checkLayerType&&
F.data&&(J=-1!==n.indexOf(this.layerTypes,F.data.type));J=F.data.geometryType?-1!==n.indexOf(this.geometryTypes,F.data.geometryType)||this.checkLayerType&&J:!0;return F&&F.data&&J}),renderRow:k.hitch(this,this._renderer)},v);this._grid.startup();this._grid.on("dgrid-select,dgrid-deselect",k.hitch(this,function(F){F=F.grid.selection;var J=[];for(L in F)F[L]&&J.push(this._grid.row(L).data);var L={selection:J};e(".panel-actions .btn-main",this.parent.infoPanel).forEach(function(P){c.toggle(P,"disabled",
0===J.length)},this);J[0]&&(this._selectedLayer=J[0]);this.emit("layer-change",L)}))},hasTimeInfo:function(v){return v&&v.timeInfo},getTimeType:function(v){return v?r.isDefined(v.timeInfo)&&r.isDefined(v.timeInfo.startTimeField)&&!r.isDefined(v.timeInfo.endTimeField)?C.TimeTypes.Instant:r.isDefined(v.timeInfo)&&r.isDefined(v.timeInfo.startTimeField)&&r.isDefined(v.timeInfo.endTimeField)?C.TimeTypes.Interval:r.isDefined(v.time)&&r.isDefined(v.time.timeType)?v.time.timeType:!1:!1},getNoDataMessage:function(v){if(v.geomCheck)if(v.timeCheck){if(!v.typeCheck)return this.i18n.noDataMessages.typeCheckFailure;
if(!v.customCheck)return this.customCheckFailureMessage}else return this.i18n.noDataMessages.timeCheckFailure;else return this.i18n.noDataMessages.geomCheckFailure},getDateFields:function(v){return n.filter(v&&v.fields||[],function(z){return z&&"esriFieldTypeDate"===z.type})},_renderer:function(v){v.snippet=v.snippet||"";var z=q.create("div"),A=this._getLabel(v);q.place('\x3cdiv class\x3d"panel panel-white panel-bordered panel-compact border-bottom-clear"\x3e\x3ch5 class\x3d"trailer-0 font-size-0 word-break"\x3e\x3ca\x3e'+
v.name+'\x3c/a\x3e\x3c/h5\x3e\x3cnav class\x3d"inline-block"\x3e\x3ca class\x3d"link-gray font-size--2 esriTrailingPadding1 esriTrailingMargin05"\x3e\x3cspan class\x3d"'+A.icon+'"\x3e\x3c/span\x3e'+A.name+"\x3c/a\x3e"+(v.timeInfo||v.time&&"instant"===v.time.timeType?'\x3ca class\x3d"link-gray font-size--2 esriTrailingPadding1" data-action\x3d"timeSettings" data-layerid\x3d"0"\x3e\x3cspan class\x3d"esri-icon-time-clock"\x3e\x3c/span\x3e'+this.i18n.timeEnabled+"\x3c/a\x3e":'\x3ca class\x3d"esriTrailingPadding1"\x3e\x3c/a\x3e')+
"\x3c/nav\x3e\x3c/div\x3e",z);return z},_getLabel:function(v){var z={icon:"",name:""},A=v.geometryType;A===C.GeometryTypes.Point||A===C.GeometryTypes.MultiPoint?(z.name=this.i18n.points,z.icon="esri-icon-map-pin"):A===C.GeometryTypes.Polygon?(z.name=this.i18n.areas,z.icon="esri-icon-polygon"):A===C.GeometryTypes.Line?(z.name=this.i18n.lines,z.icon="esri-icon-polyline"):v.type===t.IS?(z.name=this.i18n.imageService,z.icon="esri-icon-layers"):(z.name=this.i18n.table,z.icon="esri-icon-table");return z}});
k.mixin(x,{add:function(v,z){v.plugIn||(z=z||{},z.parent=v,z.self=v.self,v.plugIn=new x(z))},remove:function(v){v.plugIn&&(v.plugIn.destroy(),delete v.plugIn)}});p("extend-esri")&&k.setObject("dijit.analysis.PluginLayers",x,u);return x})},"esri/dijit/analysis/AnalysisRegistry":function(){define(["dojo/_base/lang","dojo/has","../../kernel"],function(H,k,n){var q={Modes:{Raster:"raster",Bigdata:"bigdata",Standard:"standard",Feature:"feature"},Tools:{FindCentroids:"FindCentroids",ChooseBestFacilities:"ChooseBestFacilities"},
ProcessInfoTools:{DescribeDataset:{Name:"DescribeDataset",Gax:!0,Std:!1},GeneralizedLinearRegression:{Name:"GeneralizedLinearRegression",Gax:!0,Std:!1},ForestBasedClassificationAndRegression:{Name:"ForestBasedClassificationAndRegression",Gax:!0,Std:!1},GeographicallyWeightedRegression:{Name:"GeographicallyWeightedRegression",Gax:!0,Std:!1},FindSimilarLocations:{Name:"FindSimilarLocations",Gax:!0,Std:!0},FindHotSpots:{Name:"FindHotSpots",Gax:!1,Std:!0},FindOutliers:{Name:"FindOutliers",Gax:!0,Std:!0}},
ToolCategory:{Gax:"GeoAnalyticsTools",Std:"SpatialAnalysisTools"},GeometryTypes:{Polygon:"esriGeometryPolygon",Line:"esriGeometryPolyline",Point:"esriGeometryPoint",MultiPoint:"esriGeometryMultipoint"},PseudoGeometryTypes:{Point:"point",Line:"line",Polygon:"polygon"},TimeTypes:{Instant:"instant",Interval:"interval"},FieldTypes:{ObjectId:"esriFieldTypeOID",String:"esriFieldTypeString",Short:"esriFieldTypeSmallInteger",Integer:"esriFieldTypeInteger",Float:"esriFieldTypeSingle",Double:"esriFieldTypeDouble",
Date:"esriFieldTypeDate"},PseudoFieldTypes:{Number:"number",String:"string",Date:"date"},Shapes:{square:"SQUARE",hexagon:"HEXAGON",transverseHexagon:"TRANSVERSEHEXAGON",triangle:"TRIANGLE",diamond:"DIAMOND"},DistanceMethods:{geodesic:"Geodesic",planar:"Planar"}};k("extend-esri")&&H.setObject("dijit.analysis.AnalysisRegistry",q,n);return q})},"esri/dijit/analysis/PCSList":function(){define(["dojo/_base/lang","dojo/has","../../kernel"],function(H,k,n){var q=[2E3,2001,2002,2003,2004,2005,2006,2007,2008,
2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067,2068,2069,2070,2071,2072,2073,2074,2075,2076,2077,2078,2079,2080,2081,2082,2083,2084,2085,2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2097,2098,2099,2100,2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,2118,2119,
2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2133,2134,2135,2136,2137,2138,2139,2140,2141,2142,2143,2144,2145,2146,2147,2148,2149,2150,2151,2152,2153,2154,2155,2157,2158,2159,2160,2161,2162,2163,2164,2165,2166,2167,2168,2169,2170,2172,2173,2174,2175,2176,2177,2178,2179,2180,2181,2182,2183,2184,2185,2186,2187,2188,2189,2190,2191,2192,2193,2195,2196,2197,2198,2200,2201,2202,2203,2204,2205,2206,2207,2208,2209,2210,2211,2212,2213,2214,2215,2216,2217,2219,2220,2222,2223,2224,2225,2226,
2227,2228,2229,2230,2231,2232,2233,2234,2235,2236,2237,2238,2239,2240,2241,2242,2243,2244,2245,2246,2247,2248,2249,2250,2251,2252,2253,2254,2255,2256,2257,2258,2259,2260,2261,2262,2263,2264,2265,2266,2267,2268,2269,2270,2271,2272,2273,2274,2275,2276,2277,2278,2279,2280,2281,2282,2283,2284,2285,2286,2287,2288,2289,2290,2291,2292,2294,2295,2308,2309,2310,2311,2312,2313,2314,2315,2316,2317,2318,2319,2320,2321,2322,2323,2324,2325,2326,2327,2328,2329,2330,2331,2332,2333,2334,2335,2336,2337,2338,2339,2340,
2341,2342,2343,2344,2345,2346,2347,2348,2349,2350,2351,2352,2353,2354,2355,2356,2357,2358,2359,2360,2361,2362,2363,2364,2365,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2384,2385,2386,2387,2388,2389,2390,2391,2392,2393,2394,2395,2396,2397,2398,2399,2400,2401,2402,2403,2404,2405,2406,2407,2408,2409,2410,2411,2412,2413,2414,2415,2416,2417,2418,2419,2420,2421,2422,2423,2424,2425,2426,2427,2428,2429,2430,2431,2432,2433,2434,2435,2436,2437,2438,2439,2440,2441,
2442,2443,2444,2445,2446,2447,2448,2449,2450,2451,2452,2453,2454,2455,2456,2457,2458,2459,2460,2461,2462,2463,2464,2465,2466,2467,2468,2469,2470,2471,2472,2473,2474,2475,2476,2477,2478,2479,2480,2481,2482,2483,2484,2485,2486,2487,2488,2489,2490,2491,2494,2495,2496,2497,2498,2499,2500,2501,2502,2503,2504,2505,2506,2507,2508,2509,2510,2511,2512,2513,2514,2515,2516,2517,2518,2519,2520,2521,2522,2523,2524,2525,2526,2527,2528,2529,2530,2531,2532,2533,2534,2535,2536,2537,2538,2539,2540,2541,2542,2543,2544,
2545,2546,2547,2548,2549,2550,2551,2552,2553,2554,2555,2556,2557,2558,2559,2560,2561,2562,2563,2564,2565,2566,2567,2568,2569,2570,2571,2572,2573,2574,2575,2576,2577,2578,2579,2580,2581,2582,2583,2584,2585,2586,2587,2588,2589,2590,2591,2592,2593,2594,2595,2596,2597,2598,2599,2600,2601,2602,2603,2604,2605,2606,2607,2608,2609,2610,2611,2612,2613,2614,2615,2616,2617,2618,2619,2620,2621,2622,2623,2624,2625,2626,2627,2628,2629,2630,2631,2632,2633,2634,2635,2636,2637,2638,2639,2640,2641,2642,2643,2644,2645,
2646,2647,2648,2649,2650,2651,2652,2653,2654,2655,2656,2657,2658,2659,2660,2661,2662,2663,2664,2665,2666,2667,2668,2669,2670,2671,2672,2673,2674,2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,2691,2692,2693,2694,2695,2696,2697,2698,2699,2700,2701,2702,2703,2704,2705,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,2720,2721,2722,2723,2724,2725,2726,2727,2728,2729,2730,2731,2732,2733,2734,2735,2736,2737,2738,2739,2740,2741,2742,2743,2744,2745,2746,
2747,2748,2749,2750,2751,2752,2753,2754,2755,2756,2757,2758,2759,2760,2761,2762,2763,2764,2765,2766,2767,2768,2769,2770,2771,2772,2773,2774,2775,2776,2777,2778,2779,2780,2781,2782,2783,2784,2785,2786,2787,2788,2789,2790,2791,2792,2793,2794,2795,2796,2797,2798,2799,2800,2801,2802,2803,2804,2805,2806,2807,2808,2809,2810,2811,2812,2813,2814,2815,2816,2817,2818,2819,2820,2821,2822,2823,2824,2825,2826,2827,2828,2829,2830,2831,2832,2833,2834,2835,2836,2837,2838,2839,2840,2841,2842,2843,2844,2845,2846,2847,
2848,2849,2850,2851,2852,2853,2854,2855,2856,2857,2858,2859,2860,2861,2862,2863,2864,2865,2866,2867,2868,2869,2870,2871,2872,2873,2874,2875,2876,2877,2878,2879,2880,2881,2882,2883,2884,2885,2886,2887,2888,2891,2892,2893,2894,2895,2896,2897,2898,2899,2900,2901,2902,2903,2904,2905,2906,2907,2908,2909,2910,2911,2912,2913,2914,2915,2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,2931,2932,2933,2934,2935,2936,2937,2938,2939,2940,2941,2942,2943,2944,2945,2946,2947,2948,2949,2950,
2951,2952,2953,2954,2955,2956,2957,2958,2959,2960,2961,2962,2964,2965,2966,2967,2968,2969,2970,2971,2972,2973,2975,2976,2977,2978,2979,2980,2981,2982,2983,2984,2985,2986,2987,2988,2989,2990,2991,2992,2993,2994,2995,2996,2997,2998,2999,3E3,3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,3024,3025,3026,3027,3028,3029,3030,3031,3032,3033,3034,3035,3036,3037,3038,3039,3040,3041,3042,3043,3044,3045,3046,3047,3048,3049,3050,3051,3054,3055,
3056,3057,3058,3059,3060,3061,3062,3063,3064,3065,3066,3067,3068,3069,3070,3071,3072,3073,3074,3075,3076,3077,3078,3079,3080,3081,3082,3083,3084,3085,3086,3087,3088,3089,3090,3091,3092,3093,3094,3095,3096,3097,3098,3099,3100,3101,3102,3106,3107,3108,3109,3110,3111,3112,3113,3114,3115,3116,3117,3118,3119,3120,3121,3122,3123,3124,3125,3126,3127,3128,3129,3130,3131,3132,3133,3134,3135,3136,3137,3138,3141,3142,3146,3147,3148,3149,3150,3151,3153,3154,3155,3156,3157,3158,3159,3160,3161,3162,3163,3164,3165,
3166,3167,3168,3169,3170,3171,3172,3174,3175,3176,3177,3178,3179,3180,3181,3182,3183,3184,3185,3186,3187,3188,3189,3190,3191,3192,3193,3194,3195,3196,3197,3198,3199,3200,3201,3202,3203,3294,3295,3296,3297,3298,3299,3300,3301,3302,3303,3304,3305,3306,3307,3308,3309,3310,3311,3312,3313,3314,3315,3316,3317,3318,3319,3320,3321,3322,3323,3324,3325,3326,3327,3328,3329,3330,3331,3332,3333,3334,3335,3336,3337,3338,3339,3340,3341,3342,3343,3344,3345,3346,3347,3348,3349,3350,3351,3352,3353,3354,3355,3356,3357,
3358,3359,3360,3361,3362,3363,3364,3365,3366,3367,3368,3369,3370,3371,3372,3373,3374,3375,3376,3377,3378,3379,3380,3381,3382,3383,3384,3385,3386,3387,3388,3389,3390,3391,3392,3393,3394,3395,3396,3397,3398,3399,3400,3401,3402,3403,3404,3405,3406,3407,3408,3409,3410,3411,3412,3413,3414,3415,3416,3417,3418,3419,3420,3421,3422,3423,3424,3425,3426,3427,3428,3429,3430,3431,3432,3433,3434,3435,3436,3437,3438,3439,3440,3441,3442,3443,3444,3445,3446,3447,3448,3449,3450,3451,3452,3453,3454,3455,3456,3457,3458,
3459,3460,3461,3462,3463,3464,3465,3466,3467,3468,3469,3470,3471,3472,3473,3474,3475,3476,3477,3478,3479,3480,3481,3482,3483,3484,3485,3486,3487,3488,3489,3490,3491,3492,3493,3494,3495,3496,3497,3498,3499,3500,3501,3502,3503,3504,3505,3506,3507,3508,3509,3510,3511,3512,3513,3514,3515,3516,3517,3518,3519,3520,3521,3522,3523,3524,3525,3526,3527,3528,3529,3530,3531,3532,3533,3534,3535,3536,3537,3538,3539,3540,3541,3542,3543,3544,3545,3546,3547,3548,3549,3550,3551,3552,3553,3554,3555,3556,3557,3558,3559,
3560,3561,3562,3563,3564,3565,3566,3567,3568,3569,3570,3571,3572,3573,3574,3575,3576,3577,3578,3579,3580,3581,3582,3583,3584,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,3643,3644,3645,3646,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,
3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,3676,3677,3678,3679,3680,3681,3682,3683,3684,3685,3686,3687,3688,3689,3690,3691,3692,3693,3694,3695,3696,3697,3698,3699,3700,3701,3702,3703,3704,3705,3706,3707,3708,3709,3710,3711,3712,3713,3714,3715,3716,3717,3718,3719,3720,3721,3722,3723,3724,3725,3726,3727,3728,3729,3730,3731,3732,3733,3734,3735,3736,3737,3738,3739,3740,3741,3742,3743,3744,3745,3746,3747,3748,3749,3750,3751,3753,3754,3755,3756,3757,3758,3759,3760,3761,3762,
3763,3764,3765,3766,3767,3768,3769,3770,3771,3772,3773,3775,3776,3777,3779,3780,3781,3783,3784,3785,3788,3789,3790,3791,3793,3794,3797,3798,3799,3800,3801,3802,3812,3814,3815,3816,3825,3826,3827,3828,3829,3832,3833,3834,3835,3836,3837,3838,3839,3840,3841,3844,3845,3846,3847,3848,3849,3850,3851,3852,3854,3857,3873,3874,3875,3876,3877,3878,3879,3880,3881,3882,3883,3884,3885,3890,3891,3892,3893,3907,3908,3909,3910,3911,3912,3920,3942,3943,3944,3945,3946,3947,3948,3949,3950,3968,3969,3970,3973,3974,3975,
3976,3978,3979,3986,3987,3988,3989,3991,3992,3994,3995,3996,3997,4026,4037,4038,4048,4049,4050,4051,4056,4057,4058,4059,4060,4061,4062,4063,4071,4082,4083,4087,4088,4093,4094,4095,4096,4217,4390,4391,4392,4393,4394,4395,4396,4397,4398,4399,4400,4401,4402,4403,4404,4405,4406,4407,4408,4409,4410,4411,4412,4413,4414,4415,4417,4418,4419,4420,4421,4422,4423,4424,4425,4426,4427,4428,4429,4430,4431,4432,4433,4434,4437,4438,4439,4455,4456,4457,4462,4467,4471,4474,4484,4485,4486,4487,4488,4489,4491,4492,4493,
4494,4495,4496,4497,4498,4499,4500,4501,4502,4503,4504,4505,4506,4507,4508,4509,4510,4511,4512,4513,4514,4515,4516,4517,4518,4519,4520,4521,4522,4523,4524,4525,4526,4527,4528,4529,4530,4531,4532,4533,4534,4535,4536,4537,4538,4539,4540,4541,4542,4543,4544,4545,4546,4547,4548,4549,4550,4551,4552,4553,4554,4559,4568,4569,4570,4571,4572,4573,4574,4575,4576,4577,4578,4579,4580,4581,4582,4583,4584,4585,4586,4587,4588,4589,4647,4652,4653,4654,4655,4656,4766,4767,4768,4769,4770,4771,4772,4773,4774,4775,4776,
4777,4778,4779,4780,4781,4782,4783,4784,4785,4786,4787,4788,4789,4790,4791,4792,4793,4794,4795,4796,4797,4798,4799,4800,4822,4826,4839,5014,5015,5016,5018,5048,5069,5070,5071,5072,5105,5106,5107,5108,5109,5110,5111,5112,5113,5114,5115,5116,5117,5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5167,5168,5173,5174,5175,5176,5177,5178,5179,5180,5181,5182,5183,5184,5185,5186,5187,5188,5221,5223,5234,5235,5243,5247,5253,5254,5255,5256,5257,5258,5259,5266,5269,5270,5271,5272,5273,5274,5275,
5292,5293,5294,5295,5296,5297,5298,5299,5300,5301,5302,5303,5304,5305,5306,5307,5308,5309,5310,5311,5316,5320,5321,5325,5329,5330,5331,5337,5343,5344,5345,5346,5347,5348,5349,5355,5356,5357,5361,5362,5367,5382,5383,5387,5388,5389,5396,5456,5457,5459,5460,5461,5462,5463,5469,5472,5479,5480,5481,5482,5490,5513,5514,5518,5519,5520,5523,5530,5531,5532,5533,5534,5535,5536,5537,5538,5539,5550,5551,5552,5559,5562,5563,5564,5565,5566,5567,5568,5569,5570,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,
5582,5583,5588,5589,5596,5623,5624,5625,5627,5629,5631,5632,5633,5634,5635,5636,5637,5638,5639,5641,5643,5644,5646,5649,5650,5651,5652,5653,5654,5655,5659,5663,5664,5665,5666,5667,5668,5669,5670,5671,5672,5673,5674,5675,5676,5677,5678,5679,5680,5682,5683,5684,5685,5700,5825,5836,5837,5839,5842,5844,5858,5875,5876,5877,5879,5880,5887,5890,5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936,5937,5938,5939,5940,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,
6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121,6122,6123,6124,6125,6128,6129,6141,6204,6210,6211,6244,6245,6246,6247,6248,6249,6250,6251,6252,6253,6254,6255,6256,6257,6258,6259,6260,6261,6262,6263,6264,6265,6266,6267,6268,6269,6270,6271,6272,6273,6274,6275,
6307,6312,6316,6328,6329,6330,6331,6332,6333,6334,6335,6336,6337,6338,6339,6340,6341,6342,6343,6344,6345,6346,6347,6348,6350,6351,6352,6353,6354,6355,6356,6362,6366,6367,6368,6369,6370,6371,6372,6381,6382,6383,6384,6385,6386,6387,6391,6393,6394,6395,6396,6397,6398,6399,6400,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,6411,6412,6413,6414,6415,6416,6417,6418,6419,6420,6421,6422,6423,6424,6425,6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,6439,6440,6441,6442,6443,6444,6445,6446,
6447,6448,6449,6450,6451,6452,6453,6454,6455,6456,6457,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,6473,6474,6475,6476,6477,6478,6479,6480,6481,6482,6483,6484,6485,6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,6497,6498,6499,6500,6501,6502,6503,6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6518,6519,6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532,6533,6534,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,
6549,6550,6551,6552,6553,6554,6555,6556,6557,6558,6559,6560,6561,6562,6563,6564,6565,6566,6567,6568,6569,6570,6571,6572,6573,6574,6575,6576,6577,6578,6579,6580,6581,6582,6583,6584,6585,6586,6587,6588,6589,6590,6591,6592,6593,6594,6595,6596,6597,6598,6599,6600,6601,6602,6603,6605,6606,6607,6608,6609,6610,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,6626,6627,6628,6629,6630,6631,6632,6633,6634,6635,6636,6637,6646,6669,6670,6671,6672,6673,6674,6675,6676,6677,6678,6679,6680,
6681,6682,6683,6684,6685,6686,6687,6688,6689,6690,6691,6692,6703,6707,6708,6709,6720,6721,6722,6723,6732,6733,6734,6735,6736,6737,6738,6784,6785,6786,6787,6788,6789,6790,6791,6792,6793,6794,6795,6796,6797,6798,6799,6800,6801,6802,6803,6804,6805,6806,6807,6808,6809,6810,6811,6812,6813,6814,6815,6816,6817,6818,6819,6820,6821,6822,6823,6824,6825,6826,6827,6828,6829,6830,6831,6832,6833,6834,6835,6836,6837,6838,6839,6840,6841,6842,6843,6844,6845,6846,6847,6848,6849,6850,6851,6852,6853,6854,6855,6856,6857,
6858,6859,6860,6861,6862,6863,6867,6868,6870,6875,6876,6879,6880,6884,6885,6886,6887,6915,6922,6923,6924,6925,6931,6932,6933,6956,6957,6958,6959,6962,6984,6991,7005,7006,7007,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7074,7075,7076,7077,7078,7079,7080,7081,7082,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7131,7132,7257,7258,7259,7260,7261,7262,7263,7264,7265,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275,7276,7277,
7278,7279,7280,7281,7282,7283,7284,7285,7286,7287,7288,7289,7290,7291,7292,7293,7294,7295,7296,7297,7298,7299,7300,7301,7302,7303,7304,7305,7306,7307,7308,7309,7310,7311,7312,7313,7314,7315,7316,7317,7318,7319,7320,7321,7322,7323,7324,7325,7326,7327,7328,7329,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339,7340,7341,7342,7343,7344,7345,7346,7347,7348,7349,7350,7351,7352,7353,7354,7355,7356,7357,7358,7359,7360,7361,7362,7363,7364,7365,7366,7367,7368,7369,7370,7374,7375,7376,7528,7529,7530,7531,7532,
7533,7534,7535,7536,7537,7538,7539,7540,7541,7542,7543,7544,7545,7546,7547,7548,7549,7550,7551,7552,7553,7554,7555,7556,7557,7558,7559,7560,7561,7562,7563,7564,7565,7566,7567,7568,7569,7570,7571,7572,7573,7574,7575,7576,7577,7578,7579,7580,7581,7582,7583,7584,7585,7586,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,7617,7618,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,7632,7633,
7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,7845,7846,7847,7848,7849,7850,7851,7852,7853,7854,7855,7856,7857,7858,7859,20002,20003,20004,20005,20006,20007,20008,20009,20010,20011,20012,20013,20014,20015,20016,20017,20018,20019,20020,20021,20022,20023,20024,20025,20026,20027,20028,20029,20030,20031,20032,20062,20063,20064,20065,20066,20067,20068,20069,20070,20071,20072,20073,20074,20075,20076,20077,20078,20079,20080,20081,20082,20083,20084,20085,20086,20087,20088,20089,20090,20091,
20092,20135,20136,20137,20138,20248,20249,20250,20251,20252,20253,20254,20255,20256,20257,20258,20348,20349,20350,20351,20352,20353,20354,20355,20356,20357,20358,20436,20437,20438,20439,20440,20499,20538,20539,20790,20791,20822,20823,20824,20934,20935,20936,21035,21036,21037,21095,21096,21097,21148,21149,21150,21291,21292,21413,21414,21415,21416,21417,21418,21419,21420,21421,21422,21423,21473,21474,21475,21476,21477,21478,21479,21480,21481,21482,21483,21500,21780,21781,21782,21817,21818,21891,21892,
21893,21894,21896,21897,21898,21899,22032,22033,22091,22092,22171,22172,22173,22174,22175,22176,22177,22181,22182,22183,22184,22185,22186,22187,22191,22192,22193,22194,22195,22196,22197,22234,22235,22236,22332,22391,22392,22521,22522,22523,22524,22525,22700,22770,22780,22832,22991,22992,22993,22994,23028,23029,23030,23031,23032,23033,23034,23035,23036,23037,23038,23090,23095,23239,23240,23433,23700,23830,23831,23832,23833,23834,23835,23836,23837,23838,23839,23840,23841,23842,23843,23844,23845,23846,
23847,23848,23849,23850,23851,23852,23853,23866,23867,23868,23869,23870,23871,23872,23877,23878,23879,23880,23881,23882,23883,23884,23886,23887,23888,23889,23890,23891,23892,23893,23894,23946,23947,23948,24047,24048,24100,24200,24305,24306,24311,24312,24313,24342,24343,24344,24345,24346,24347,24370,24371,24372,24373,24374,24375,24376,24377,24378,24379,24380,24381,24382,24383,24500,24547,24548,24571,24600,24718,24719,24720,24721,24817,24818,24819,24820,24821,24877,24878,24879,24880,24881,24882,24891,
24892,24893,25E3,25231,25391,25392,25393,25394,25395,25828,25829,25830,25831,25832,25833,25834,25835,25836,25837,25838,25884,25932,26191,26192,26193,26194,26195,26237,26331,26332,26391,26392,26393,26432,26591,26592,26632,26692,26701,26702,26703,26704,26705,26706,26707,26708,26709,26710,26711,26712,26713,26714,26715,26716,26717,26718,26719,26720,26721,26722,26729,26730,26731,26732,26733,26734,26735,26736,26737,26738,26739,26740,26741,26742,26743,26744,26745,26746,26747,26748,26749,26750,26751,26752,
26753,26754,26755,26756,26757,26758,26759,26760,26761,26762,26763,26764,26765,26766,26767,26768,26769,26770,26771,26772,26773,26774,26775,26776,26777,26778,26779,26780,26781,26782,26783,26784,26785,26786,26787,26788,26789,26790,26791,26792,26793,26794,26795,26796,26797,26798,26799,26801,26802,26803,26811,26812,26813,26847,26848,26849,26850,26851,26852,26853,26854,26855,26856,26857,26858,26859,26860,26861,26862,26863,26864,26865,26866,26867,26868,26869,26870,26891,26892,26893,26894,26895,26896,26897,
26898,26899,26901,26902,26903,26904,26905,26906,26907,26908,26909,26910,26911,26912,26913,26914,26915,26916,26917,26918,26919,26920,26921,26922,26923,26929,26930,26931,26932,26933,26934,26935,26936,26937,26938,26939,26940,26941,26942,26943,26944,26945,26946,26948,26949,26950,26951,26952,26953,26954,26955,26956,26957,26958,26959,26960,26961,26962,26963,26964,26965,26966,26967,26968,26969,26970,26971,26972,26973,26974,26975,26976,26977,26978,26979,26980,26981,26982,26983,26984,26985,26986,26987,26988,
26989,26990,26991,26992,26993,26994,26995,26996,26997,26998,27037,27038,27039,27040,27120,27200,27205,27206,27207,27208,27209,27210,27211,27212,27213,27214,27215,27216,27217,27218,27219,27220,27221,27222,27223,27224,27225,27226,27227,27228,27229,27230,27231,27232,27258,27259,27260,27291,27292,27391,27392,27393,27394,27395,27396,27397,27398,27429,27492,27493,27500,27561,27562,27563,27564,27571,27572,27573,27574,27581,27582,27583,27584,27591,27592,27593,27594,27700,28191,28192,28193,28232,28348,28349,
28350,28351,28352,28353,28354,28355,28356,28357,28358,28402,28403,28404,28405,28406,28407,28408,28409,28410,28411,28412,28413,28414,28415,28416,28417,28418,28419,28420,28421,28422,28423,28424,28425,28426,28427,28428,28429,28430,28431,28432,28462,28463,28464,28465,28466,28467,28468,28469,28470,28471,28472,28473,28474,28475,28476,28477,28478,28479,28480,28481,28482,28483,28484,28485,28486,28487,28488,28489,28490,28491,28492,28600,28991,28992,29100,29101,29118,29119,29120,29121,29122,29168,29169,29170,
29171,29172,29177,29178,29179,29180,29181,29182,29183,29184,29185,29187,29188,29189,29190,29191,29192,29193,29194,29195,29220,29221,29333,29635,29636,29701,29738,29739,29849,29850,29871,29872,29873,29900,29901,29902,29903,30161,30162,30163,30164,30165,30166,30167,30168,30169,30170,30171,30172,30173,30174,30175,30176,30177,30178,30179,30200,30339,30340,30491,30492,30493,30494,30591,30592,30729,30730,30731,30732,30791,30792,30800,31028,31121,31154,31170,31171,31251,31252,31253,31254,31255,31256,31257,
31258,31259,31265,31266,31267,31268,31275,31276,31277,31278,31279,31281,31282,31283,31284,31285,31286,31287,31288,31289,31290,31291,31292,31293,31294,31295,31296,31297,31370,31461,31462,31463,31464,31465,31466,31467,31468,31469,31491,31492,31493,31494,31495,31528,31529,31600,31700,31838,31839,31900,31901,31917,31918,31919,31920,31921,31922,31965,31966,31967,31968,31969,31970,31971,31972,31973,31974,31975,31976,31977,31978,31979,31980,31981,31982,31983,31984,31985,31986,31987,31988,31989,31990,31991,
31992,31993,31994,31995,31996,31997,31998,31999,32E3,32001,32002,32003,32005,32006,32007,32008,32009,32010,32011,32012,32013,32014,32015,32016,32017,32018,32019,32020,32021,32022,32023,32024,32025,32026,32027,32028,32029,32030,32031,32033,32034,32035,32036,32037,32038,32039,32040,32041,32042,32043,32044,32045,32046,32047,32048,32049,32050,32051,32052,32053,32054,32055,32056,32057,32058,32059,32060,32061,32062,32064,32065,32066,32067,32074,32075,32076,32077,32081,32082,32083,32084,32085,32086,32098,
32099,32100,32104,32107,32108,32109,32110,32111,32112,32113,32114,32115,32116,32117,32118,32119,32120,32121,32122,32123,32124,32125,32126,32127,32128,32129,32130,32133,32134,32135,32136,32137,32138,32139,32140,32141,32142,32143,32144,32145,32146,32147,32148,32149,32150,32151,32152,32153,32154,32155,32156,32157,32158,32161,32164,32165,32166,32167,32180,32181,32182,32183,32184,32185,32186,32187,32188,32189,32190,32191,32192,32193,32194,32195,32196,32197,32198,32199,32201,32202,32203,32204,32205,32206,
32207,32208,32209,32210,32211,32212,32213,32214,32215,32216,32217,32218,32219,32220,32221,32222,32223,32224,32225,32226,32227,32228,32229,32230,32231,32232,32233,32234,32235,32236,32237,32238,32239,32240,32241,32242,32243,32244,32245,32246,32247,32248,32249,32250,32251,32252,32253,32254,32255,32256,32257,32258,32259,32260,32301,32302,32303,32304,32305,32306,32307,32308,32309,32310,32311,32312,32313,32314,32315,32316,32317,32318,32319,32320,32321,32322,32323,32324,32325,32326,32327,32328,32329,32330,
32331,32332,32333,32334,32335,32336,32337,32338,32339,32340,32341,32342,32343,32344,32345,32346,32347,32348,32349,32350,32351,32352,32353,32354,32355,32356,32357,32358,32359,32360,32601,32602,32603,32604,32605,32606,32607,32608,32609,32610,32611,32612,32613,32614,32615,32616,32617,32618,32619,32620,32621,32622,32623,32624,32625,32626,32627,32628,32629,32630,32631,32632,32633,32634,32635,32636,32637,32638,32639,32640,32641,32642,32643,32644,32645,32646,32647,32648,32649,32650,32651,32652,32653,32654,
32655,32656,32657,32658,32659,32660,32661,32662,32664,32665,32666,32667,32701,32702,32703,32704,32705,32706,32707,32708,32709,32710,32711,32712,32713,32714,32715,32716,32717,32718,32719,32720,32721,32722,32723,32724,32725,32726,32727,32728,32729,32730,32731,32732,32733,32734,32735,32736,32737,32738,32739,32740,32741,32742,32743,32744,32745,32746,32747,32748,32749,32750,32751,32752,32753,32754,32755,32756,32757,32758,32759,32760,32761,32766,53001,53002,53003,53004,53008,53009,53010,53011,53012,53013,
53014,53015,53016,53017,53018,53019,53021,53022,53023,53024,53025,53026,53027,53028,53029,53030,53031,53032,53034,53042,53043,53044,53045,53046,53048,53049,53074,53075,53076,53077,53078,53079,53080,54001,54002,54003,54004,54008,54009,54010,54011,54012,54013,54014,54015,54016,54017,54018,54019,54021,54022,54023,54024,54025,54026,54027,54028,54029,54030,54031,54032,54034,54042,54043,54044,54045,54046,54048,54049,54050,54051,54052,54053,54074,54075,54076,54077,54078,54079,54080,65061,65062,65161,65163,
102001,102002,102003,102004,102005,102006,102007,102008,102009,102010,102011,102012,102013,102014,102015,102016,102017,102018,102019,102020,102021,102022,102023,102024,102025,102026,102027,102028,102029,102030,102031,102032,102033,102034,102035,102036,102037,102038,102039,102040,102041,102042,102043,102044,102045,102046,102047,102048,102049,102050,102051,102052,102053,102054,102055,102056,102057,102058,102059,102060,102061,102062,102063,102064,102065,102066,102067,102068,102069,102070,102071,102072,
102073,102074,102075,102076,102077,102078,102079,102080,102081,102082,102083,102084,102085,102086,102087,102088,102089,102090,102091,102092,102093,102094,102095,102096,102097,102098,102099,102100,102101,102102,102103,102104,102105,102106,102107,102108,102109,102110,102111,102112,102113,102114,102115,102116,102117,102118,102119,102120,102121,102122,102123,102124,102125,102126,102127,102128,102129,102130,102131,102132,102133,102134,102135,102136,102137,102138,102139,102140,102141,102142,102143,102144,
102145,102146,102147,102148,102149,102150,102151,102152,102153,102154,102155,102156,102157,102158,102159,102160,102161,102162,102163,102164,102165,102166,102167,102168,102169,102170,102171,102172,102173,102174,102175,102176,102177,102178,102179,102180,102181,102182,102183,102184,102185,102186,102187,102188,102189,102190,102191,102192,102193,102194,102195,102196,102197,102198,102199,102200,102201,102202,102203,102204,102205,102206,102207,102208,102209,102210,102211,102212,102213,102214,102215,102216,
102217,102218,102219,102220,102221,102222,102223,102224,102225,102226,102227,102228,102229,102230,102231,102232,102233,102234,102235,102236,102237,102238,102239,102240,102241,102242,102243,102244,102245,102246,102247,102248,102249,102250,102251,102252,102253,102254,102255,102256,102257,102258,102259,102260,102261,102262,102263,102264,102265,102266,102267,102268,102269,102270,102271,102272,102273,102274,102275,102276,102277,102278,102279,102280,102281,102282,102283,102284,102285,102286,102287,102288,
102289,102290,102291,102292,102293,102294,102295,102296,102297,102298,102299,102300,102301,102302,102303,102304,102305,102306,102307,102308,102309,102310,102311,102312,102313,102314,102315,102316,102317,102318,102319,102320,102321,102322,102323,102324,102325,102326,102327,102328,102329,102330,102331,102332,102333,102334,102335,102336,102337,102338,102339,102340,102341,102342,102343,102344,102345,102346,102347,102348,102349,102350,102351,102352,102353,102354,102355,102356,102357,102358,102359,102360,
102361,102362,102363,102364,102365,102366,102367,102368,102369,102370,102371,102372,102373,102374,102375,102376,102377,102378,102379,102380,102381,102382,102383,102384,102385,102386,102387,102388,102389,102390,102391,102392,102393,102394,102395,102396,102397,102398,102399,102400,102401,102402,102403,102404,102405,102406,102407,102408,102409,102410,102411,102412,102413,102414,102415,102416,102417,102418,102419,102420,102421,102422,102423,102424,102425,102426,102427,102428,102429,102430,102431,102432,
102433,102434,102435,102436,102437,102438,102439,102440,102441,102442,102443,102444,102445,102446,102447,102448,102449,102450,102451,102452,102453,102454,102455,102456,102457,102458,102459,102460,102461,102462,102463,102464,102465,102466,102467,102468,102469,102470,102471,102472,102473,102474,102475,102476,102477,102478,102479,102480,102481,102482,102483,102484,102485,102486,102487,102488,102489,102490,102491,102492,102493,102494,102495,102496,102500,102501,102502,102503,102504,102505,102506,102507,
102508,102509,102510,102511,102512,102513,102514,102515,102516,102517,102518,102519,102520,102521,102522,102523,102524,102525,102526,102527,102528,102529,102530,102531,102532,102533,102534,102535,102536,102537,102538,102539,102540,102541,102542,102543,102544,102545,102546,102547,102548,102549,102550,102551,102552,102553,102554,102555,102556,102557,102558,102559,102560,102561,102570,102571,102572,102573,102574,102575,102576,102577,102578,102579,102580,102581,102582,102583,102584,102585,102586,102587,
102588,102589,102590,102591,102592,102593,102594,102595,102596,102597,102598,102599,102600,102601,102602,102603,102604,102605,102606,102607,102608,102609,102610,102611,102612,102613,102614,102615,102616,102617,102618,102619,102620,102621,102622,102623,102624,102625,102626,102627,102628,102629,102630,102631,102632,102633,102634,102635,102636,102637,102638,102639,102640,102641,102642,102643,102644,102645,102646,102647,102648,102649,102650,102651,102652,102653,102654,102655,102656,102657,102658,102659,
102660,102661,102662,102663,102664,102665,102666,102667,102668,102669,102670,102671,102672,102673,102674,102675,102676,102677,102678,102679,102680,102681,102682,102683,102684,102685,102686,102687,102688,102689,102690,102691,102692,102693,102694,102695,102696,102697,102698,102699,102700,102701,102702,102703,102704,102705,102706,102707,102708,102709,102710,102711,102712,102713,102714,102715,102716,102717,102718,102719,102720,102721,102722,102723,102724,102725,102726,102727,102728,102729,102730,102733,
102734,102735,102736,102737,102738,102739,102740,102741,102742,102743,102744,102745,102746,102747,102748,102749,102750,102751,102752,102753,102754,102755,102756,102757,102758,102761,102762,102763,102764,102765,102766,102767,102768,102769,102770,102771,102772,102773,102774,102775,102776,102777,102778,102779,102780,102781,102782,102783,102784,102785,102786,102787,102788,102789,102790,102791,102792,102793,102794,102795,102796,102797,102798,102962,102963,102965,102966,102967,102968,102969,102970,102971,
102972,102973,102974,102975,102976,102977,102978,102979,102980,102981,102982,102983,102984,102985,102986,102987,102988,102989,102990,102991,102992,102993,102994,102995,102996,102997,102998,102999,103E3,103001,103002,103003,103004,103005,103006,103007,103008,103009,103010,103011,103012,103013,103014,103015,103016,103017,103018,103019,103020,103021,103022,103023,103024,103025,103026,103027,103028,103029,103030,103031,103032,103033,103034,103035,103036,103037,103038,103039,103040,103041,103042,103043,
103044,103045,103046,103047,103048,103049,103050,103051,103052,103053,103054,103055,103056,103057,103058,103059,103060,103061,103062,103063,103064,103065,103066,103067,103068,103069,103070,103071,103072,103073,103074,103075,103076,103077,103078,103079,103080,103081,103082,103083,103084,103085,103086,103087,103088,103089,103090,103091,103092,103093,103094,103095,103096,103097,103098,103099,103100,103101,103102,103103,103104,103105,103106,103107,103108,103109,103110,103111,103112,103113,103114,103115,
103116,103117,103118,103119,103120,103121,103122,103123,103124,103125,103126,103127,103128,103129,103130,103131,103132,103133,103134,103135,103136,103137,103138,103139,103140,103141,103142,103143,103144,103145,103146,103147,103148,103149,103150,103151,103152,103153,103154,103155,103156,103157,103158,103159,103160,103161,103162,103163,103164,103165,103166,103167,103168,103169,103170,103171,103172,103173,103174,103175,103176,103177,103178,103179,103180,103181,103182,103183,103184,103185,103186,103187,
103188,103189,103190,103191,103192,103193,103194,103195,103196,103197,103198,103199,103200,103201,103202,103203,103204,103205,103206,103207,103208,103209,103210,103211,103212,103213,103214,103215,103216,103217,103218,103219,103220,103221,103222,103223,103224,103225,103226,103227,103228,103229,103230,103231,103232,103233,103234,103235,103236,103237,103238,103239,103240,103241,103242,103243,103244,103245,103246,103247,103248,103249,103250,103251,103252,103253,103254,103255,103256,103257,103258,103259,
103260,103261,103262,103263,103264,103265,103266,103267,103268,103269,103270,103271,103272,103273,103274,103275,103276,103277,103278,103279,103280,103281,103282,103283,103284,103285,103286,103287,103288,103289,103290,103291,103292,103293,103294,103295,103296,103297,103298,103299,103300,103301,103302,103303,103304,103305,103306,103307,103308,103309,103310,103311,103312,103313,103314,103315,103316,103317,103318,103319,103320,103321,103322,103323,103324,103325,103326,103327,103328,103329,103330,103331,
103332,103333,103334,103335,103336,103337,103338,103339,103340,103341,103342,103343,103344,103345,103346,103347,103348,103349,103350,103351,103352,103353,103354,103355,103356,103357,103358,103359,103360,103361,103362,103363,103364,103365,103366,103367,103368,103369,103370,103371,103372,103373,103374,103375,103376,103377,103378,103379,103380,103381,103382,103383,103384,103385,103386,103387,103388,103389,103390,103391,103392,103393,103394,103395,103396,103397,103398,103399,103400,103401,103402,103403,
103404,103405,103406,103407,103408,103409,103410,103411,103412,103413,103414,103415,103416,103417,103418,103419,103420,103421,103422,103423,103424,103425,103426,103427,103428,103429,103430,103431,103432,103433,103434,103435,103436,103437,103438,103439,103440,103441,103442,103443,103444,103445,103446,103447,103448,103449,103450,103451,103452,103453,103454,103455,103456,103457,103458,103459,103460,103461,103462,103463,103464,103465,103466,103467,103468,103469,103470,103471,103472,103473,103474,103475,
103476,103477,103478,103479,103480,103481,103482,103483,103484,103485,103486,103487,103488,103489,103490,103491,103492,103493,103494,103495,103496,103497,103498,103499,103500,103501,103502,103503,103504,103505,103506,103507,103508,103509,103510,103511,103512,103513,103514,103515,103516,103517,103518,103519,103520,103521,103522,103523,103524,103525,103526,103527,103528,103529,103530,103531,103532,103533,103534,103535,103536,103537,103538,103539,103540,103541,103542,103543,103544,103545,103546,103547,
103548,103549,103550,103551,103552,103553,103554,103555,103556,103557,103558,103559,103560,103561,103562,103563,103564,103565,103566,103567,103568,103569,103570,103571,103572,103573,103574,103575,103576,103577,103578,103579,103580,103581,103582,103583,103584,103585,103600,103601,103602,103603,103604,103605,103606,103607,103608,103609,103610,103611,103612,103613,103614,103615,103616,103617,103618,103619,103620,103621,103622,103623,103624,103625,103626,103627,103628,103629,103630,103631,103632,103633,
103634,103635,103636,103637,103638,103639,103640,103641,103642,103643,103644,103645,103646,103647,103648,103649,103650,103651,103652,103653,103654,103655,103656,103657,103658,103659,103660,103661,103662,103663,103664,103665,103666,103667,103668,103669,103670,103671,103672,103673,103674,103675,103676,103677,103678,103679,103680,103681,103682,103683,103684,103685,103686,103687,103688,103689,103690,103691,103692,103693,103694,103695,103700,103701,103702,103703,103704,103705,103706,103707,103708,103709,
103710,103711,103712,103713,103714,103715,103716,103717,103718,103719,103720,103721,103722,103723,103724,103725,103726,103727,103728,103729,103730,103731,103732,103733,103734,103735,103736,103737,103738,103739,103740,103741,103742,103743,103744,103745,103746,103747,103748,103749,103750,103751,103752,103753,103754,103755,103756,103757,103758,103759,103760,103761,103762,103763,103764,103765,103766,103767,103768,103769,103770,103771,103772,103773,103774,103775,103776,103777,103778,103779,103780,103781,
103782,103783,103784,103785,103786,103787,103788,103789,103790,103791,103792,103793,103794,103795,103796,103797,103798,103799,103800,103801,103802,103803,103804,103805,103806,103807,103808,103809,103810,103811,103812,103813,103814,103815,103816,103817,103818,103819,103820,103821,103822,103823,103824,103825,103826,103827,103828,103829,103830,103831,103832,103833,103834,103835,103836,103837,103838,103839,103840,103841,103842,103843,103844,103845,103846,103847,103848,103849,103850,103851,103852,103853,
103854,103855,103856,103857,103858,103859,103860,103861,103862,103863,103864,103865,103866,103867,103868,103869,103870,103871,103900,103901,103902,103903,103904,103905,103906,103907,103908,103909,103910,103911,103912,103913,103914,103915,103916,103917,103918,103919,103920,103921,103922,103923,103924,103925,103926,103927,103928,103929,103930,103931,103932,103933,103934,103935,103936,103937,103938,103939,103940,103941,103942,103943,103944,103945,103946,103947,103948,103949,103950,103951,103952,103953,
103954,103955,103956,103957,103958,103959,103960,103961,103962,103963,103964,103965,103966,103967,103968,103969,103970,103971];k("extend-esri")&&H.setObject("dijit.analysis.PCSList",q,n);return q})},"esri/layers/RasterXLayer":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/array dojo/_base/Deferred dojo/sniff dojo/dom-construct dojo/dom-style dojo/on dojox/gfx/matrix dojo/when dojo/DeferredList ../kernel ../config ../lang ../domUtils ../urlUtils ../graphic ../request ../renderers/ClassBreaksRenderer ../renderers/StretchRenderer ../renderers/UniqueValueRenderer ../renderers/ColormapRenderer ../renderers/ShadedReliefRenderer ../geometry/Extent ../SpatialReference ../geometry/Point ./Field ./TimeInfo ./MosaicRule ./DimensionalDefinition ./PixelBlock ./ImageServiceLayerMixin ./rasterLib/raster/rasterFactory ./rasterLib/raster/rasterProjectionHelper ./rasterLib/renderer/rasterRendererHelper ./rasterLib/tile/RasterTileInfo ./rasterLib/tile/RasterTileManager ./rasterLib/tile/RasterHandler ./layer".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G,x,v,z,A,F,J,L,P,Q,Z,ca,da,ea,fa,K,V,aa){var Y=h.defaults.map.zoomDuration;H=H([aa],{declaredClass:"esri.layers.RasterXLayer",managedSuspension:!0,opacity:1,tileMode:!0,useWebGL:!0,drawMode:!0,_eventMap:{"raster-change":!0,"renderer-change":!0},_lastPopup:[],_rasterFieldPrefix:"Raster.",_cachedVariableStats:{},_cachedVariableHistogram:{},constructor:function(I,O){O=O||{};this.tileMode=null!=O.tileMode?O.tileMode:this.tileMode;this.useWebGL=null!=
O.useWebGL?O.useWebGL:this.useWebGL;this.roaming=null!=O.roaming?O.roaming:this.roaming;this.drawMode=null!=O.drawMode?O.drawMode:this.drawMode;this.bandIds=O.bandIds&&0<O.bandIds.length?O.bandIds:null;this.renderer=O.renderer;this._customModules=O.customModules;this.useMapTime=O.useMapTime;if(O.multidimensionalDefinition&&0<O.multidimensionalDefinition.length){var E=new L;E.multidimensionalDefinition=O.multidimensionalDefinition.map(function(N){return N.toJson?N:new P(N)});E.method=L.METHOD_NONE;
this.mosaicRule=E}this.infoTemplate=O.infoTemplate;this.drawMode||(this._contextType=O._contextType||O.drawType);this._supportLegacyPropMethods=!1!==O.legacySupport;this._rasterHandler=new V({customModules:this._customModules});this._workInitPromise=this._rasterHandler.start();this.pixelData=null;this._initialize(I,O);c(this,"load",k.hitch(this,function(){e(this._rasterHandler._connected||this._rasterHandler._connectionPromise,k.hitch(this,function(){this._rasterHandler.setLayer({layerId:this.id,
raster:{rasterInfo:this.raster.rasterInfo,rasterFunction:this.raster.rasterFunction&&this.raster.rasterFunction.toJson()},bandCount:this.raster.rasterInfo.bandCount});this.raster.rasterFunction&&this._rasterHandler.setRasterFunction({layerId:this.id,data:this.raster.rasterFunction.toJson(!0)});this._rasterRenderer&&this._rasterHandler.setRasterRenderer({layerId:this.id,data:this._rasterRenderer.toJson(!0)})}))}));this._animatePan2d=k.hitch(this,this._animatePan2d)},setOpacity:function(I){this.opacity!==
I&&(this.opacity=I,this.onOpacityChange(I))},onOpacityChange:function(){},onRendererChange:function(){},refresh:function(){if(this.loaded&&this._map)if(!this._canDraw()||10>l("ie"))this.onError(Error("Unable to refresh. This layer is not supported in the current browser."));else this._map&&this._extentChangeHandler(this._map.extent)},clear:function(I,O,E,N){this._canDraw()&&(this.useWebGL||(E?this._context.clearRect(I,O,E,N):this._context.clearRect(0,0,this._map.width,this._map.height)))},getContext:function(){return this._context},
onResume:function(){this.inherited(arguments);this._toggleTime();t.show(this._div);if("css-transforms"===this._map.navigationMode){var I=this._map.__visibleDelta;this._left=this._tdx=I.x;this._top=this._tdy=I.y;a.set(this._div,d._css.names.transform,d._css.translate(this._left,this._top))}this._displayTimer=this._displayTimer||setTimeout(k.hitch(this,function(){this._extentChangeHandler(this._map.extent,null,!0)}),0)},onSuspend:function(){this.inherited(arguments);this._fireUpdateEnd();this._toggleTime();
t.hide(this._div);clearTimeout(this._displayTimer);this._displayTimer=null},redraw:function(){this.useWebGL&&this._glSetting&&(this._glSetting.hasNewTexture=!1);var I=this.tileMode?this.tileManager.originalPixelData:this.originalPixelData;if(this.tileMode?I&&(I.src||I.texture):I)if(this.tileMode)if(this.useWebGL)this._updateAllTilesOnce(I);else{this.tileManager.tiles.forEach(function(E){E&&(E.update=null,E.completed=!1,E.processedPixelBlock=null,E.renderedPixelBlock=null)});I.processedPixelBlock=
null;var O=this.raster.rasterFunction?this.raster.rasterFunction.read(I):{extent:I.extent,pixelBlock:I.src[this.tileManager.identifiers[0]]&&I.src[this.tileManager.identifiers[0]].pixelBlock};I.renderedPixelBlock=null;I=this._rasterRenderer?this._rasterRenderer.draw(O):O;this._drawOneFrame(I)}else this._supportLegacyPropMethods&&this.pixelFilter?this._setPixelData(this.originalPixelData):(I.processedPixelBlock=null,O=this.raster.rasterFunction?this.raster.rasterFunction.read(I):{extent:I.extent,pixelBlock:I.src?
I.src[this.tileManager.identifiers[0]]&&I.src[this.tileManager.identifiers[0]].pixelBlock:I.pixelBlock},I.renderedPixelBlock=null,I=this._rasterRenderer?this._rasterRenderer.draw(O):O,this._drawOneFrame(I))},getCurrentResolution:function(){var I=this._map.extent;return new A((I.xmax-I.xmin)/this._map.width,(I.ymax-I.ymin)/this._map.height,I.spatialReference)},getCustomRasterFields:function(I){var O=I?I.rasterAttributeTableFieldPrefix:this._rasterFieldPrefix,E={name:this._rasterFieldPrefix+"ServicePixelValue",
alias:"Pixel Value",domain:null,editable:!1,length:50,type:10.3<=this.version?"esriFieldTypeDouble":"esriFieldTypeString"};I=this.fields?k.clone(this.fields):[];I.push(E);(E=this.rasterAttributeTable&&this.rasterAttributeTable.fields)&&0<E.length&&(E=q.filter(E,function(N){return"esriFieldTypeOID"!==N.type&&"value"!==N.name.toLowerCase()}),E=q.map(E,function(N){var R=k.clone(N);R.name=O+N.name;return R}),I=I.concat(E));return I},setRenderer:function(I,O){if(this.loaded&&I){if(I.declaredClass&&-1<
I.declaredClass.indexOf("esri.layers.rasterLib")){this._rasterRenderer=I;this._rasterRenderer.bind({layer:this});var E=this.bandIds=I.bandIndex;this.raster&&this.raster.setFetchParameters({bandIds:E});this._params&&(this._params.bandIds=E&&0<E.length?E.join(","):null);this.renderer=this._getCommonRenderer(I)}else E=k.clone(I.toJson?I.toJson():I),"rasterStretch"===E.type&&(E.bandIndex=this.bandIds,E.bandIndex&&1<E.bandIndex.length||!E.bandIndex&&this.raster&&1<this.raster.rasterInfo.bandCount)&&(E.type=
"rgb"),this._rasterRenderer=ea.create(E),this.renderer=I.declaredClass?I:this._getCommonRenderer(this._rasterRenderer),this._rasterRenderer.bind({layer:this});if(this._map){if(this.loaded&&this._rasterHandler._connected){var N=this._rasterHandler.setRasterRenderer({layerId:this.id,data:this._rasterRenderer.toJson(!0)});this._updateTilingEffects()}O||(N?N.then(k.hitch(this,function(){this.redraw()})):this.redraw());this.onRendererChange()}}},setBandIds:function(I,O){this.bandIds=I;this.raster&&this.raster.setFetchParameters({bandIds:I});
this._params&&(this._params.bandIds=I&&0<I.length?I.join(","):null);this.setRenderer(this.renderer,O)},_setTime:function(I){I=I?I.toJson():null;this._params&&(this._params.time=I);this.raster.setFetchParameters({time:I});this.tileManager&&this.tileManager.tiles&&this.tileManager.resetTiles()},setInfoTemplate:function(I){this.infoTemplate=I;this._updateInfoTemplateFields(this.fields)},setMultiDimensionalDefinition:function(I,O){var E=I&&I.multidimensionalDefinition;if(E&&this.loaded){var N=E&&E[0].variableName;
""===N&&(N=this._multidimensionalInfo.variables[0].name,E.forEach(function(W){W.variableName=N}));if("ImageService"===this.raster.sourceType){var R=this.raster._getAllDimensionDefinition(E,N);R.defChanged&&(I.multidimensionalDefinition=R.definition,this.setMosaicRule(I,!0))}this.raster.setFetchParameters({multidimensionalDefinition:E});this.tileManager&&this.tileManager.tiles&&this.tileManager.resetTiles();N&&this._updateRasterInfo(N);O||this.refresh()}},_updateRasterInfo:function(I){var O=this.raster.rasterInfo,
E=this.getHistograms(I);I=this.getStatistics(I);(new g([E,I])).then(k.hitch(this,function(N){N[0][0]&&(O.histograms=N[0][1].histograms);N[1][0]&&(O.statistics=N[1][1]);this.refresh()}))},_updateInfoTemplateFields:function(I){if(I&&!(1>I.length)&&this.infoTemplate&&this.infoTemplate.info&&this.infoTemplate.info.fieldInfos&&!(1>this.infoTemplate.info.fieldInfos.length)){var O,E;var N=this.infoTemplate.info.fieldInfos;for(O=0;O<I.length;O++){var R=I[O];for(E=0;E<N.length;E++)if(N[E].fieldName.toLowerCase()===
R.name.toLowerCase()&&N[E].fieldName!==R.name){N[E].fieldName=R.name;break}}}},getPixelData:function(I){return this.tileMode?I?this.tileManager.originalPixelData.src&&this.tileManager.originalPixelData.src[this.tileManager.identifiers[0]]:null:this.inherited(arguments)},fetchPopupFromTiles:function(I){var O=new m;this.identify(I.geometry).then(function(E){var N=E.pixelValue;this.hasStdTime()&&N&&N.length&&null!=N[0]&&(N=N.map(function(ha){return this.getStdTimeValue(ha)}.bind(this)).join(", "));if(N){E=
{ObjectId:0,"Raster.ServicePixelValue":N};var R=this.rasterAttributeTable&&this.rasterAttributeTable.features;if(R&&0<R.length&&(R=q.filter(R,function(ha){if(ha&&ha.attributes)return ha.attributes.hasOwnProperty("Value")?ha.attributes.Value==N:ha.attributes.VALUE==N}),0<R.length&&(R=k.clone(R[0]))))for(var W in R.attributes)R.attributes.hasOwnProperty(W)&&(E[this._rasterFieldPrefix+W]=R.attributes[W]);W=new u(new v(this.projectedFullExtent||this.fullExtent),null,E);W.setInfoTemplate(this.infoTemplate);
W._layer=this;this._lastPopup=[W];O.resolve([W])}else this._lastPopup=[],O.resolve()}.bind(this),function(E){this._lastPopup=[];O.resolve(E)});return O},getPopupFromTiles:function(){return this._lastPopup},identify:function(I,O){return this.raster?this.raster.identify(I):(I=new m,I.reject("layer must be initialized to identify"),I.promise)},_getCommonRenderer:function(I){switch(I.rendererName){case "RGB":case "Stretch":return new B(I.toCommonRendererJson());case "UniqueValue":return new C(I.toCommonRendererJson());
case "ClassBreaks":return new y(I.toCommonRendererJson());case "Colormap":return new G(I.toCommonRendererJson());case "ShadedRelief":return new x(I.toCommonRendererJson())}},_getProjectedFullExtent:function(I){return this.raster.getProjectedFullExtent(I).then(k.hitch(this,function(O){this.projectedFullExtent=O}))},_initialize:function(I,O){O=O||{};this._supportLegacyPropMethods&&this.constructor._onMap&&(this.constructor._onMap["rendering-change"]={method:"onRenderingChange"},this.constructor._onMap["mosaic-rule-change"]=
{method:"onMosaicRuleChange"},this.constructor._onMap["spatial-reference-change"]={method:"onSpatialReferenceChange"});this.raster={};var E=O.raster?O.raster.url:I;E&&-1<E.toLowerCase().indexOf("/imageserver")&&this._supportLegacyPropMethods&&this._addLegacySupport(E,O);var N=k.hitch(this,function(){this.loaded=!0;this.mosaicRule&&this.mosaicRule.multidimensionalDefinition&&0<this.mosaicRule.multidimensionalDefinition.length&&this.setMultiDimensionalDefinition(this.mosaicRule,!0);this.raster._setRasterHandler(this._rasterHandler);
this.onLoad(this);var R=this._loadCallback;R&&(delete this._loadCallback,R(this))});(I?ca.create(k.mixin({url:I},O)):O.raster&&O.raster.open()).then(k.hitch(this,function(R){if(R){this.raster=R;var W=this._getSourceImageServiceRaster();this.url||(this.url=W&&W.url);this.url&&(this._url=w.urlToObject(I));var ha=O.minScale,oa=O.maxScale,ma=R.tileInfo&&"Raster"===R.tileInfo.tileType;null==oa&&(oa=ma&&O.zoomFactor?R.tileInfo.lods[R.tileInfo.lods.length-1].scale/O.zoomFactor:this.maxScale);null==ha&&(ha=
ma&&O.zoomFactor?R.tileInfo.lods[0].scale*O.zoomFactor:this.minScale);W&&"ImageService"===W.sourceType&&this._supportLegacyPropMethods&&this._addGeneralProperties(I,O);this.initialExtent=this.fullExtent=this.extent=this.raster.rasterInfo.extent;this.spatialReference=this.extent.spatialReference;this.timeInfo=this.raster.rasterInfo.timeInfo?new J(this.raster.rasterInfo.timeInfo):null;this.rasterAttributeTable=this.raster.rasterInfo.vat;this._multidimensionalInfo=this.raster.rasterInfo.multidimensionalInfo;
this.rasterAttributeTable&&(this._rasterAttributeTableFields=this.rasterAttributeTable.fields);this.mosaicRule&&this.raster.setFetchParameters({multidimensionalDefinition:this.mosaicRule.multidimensionalDefinition});this._multidimensionalInfo&&(this._getDefaultMultidimensionalDefinition(this._multidimensionalInfo,!0,!0),this.mosaicRule||(this.mosaicRule=this.defaultMosaicRule,this.raster.setFetchParameters({multidimensionalDefinition:this._defaultMultidimensionalDefinition})),this.raster.defaultMultidimensionalDefinition=
this._defaultMultidimensionalDefinition);null==ha||this._hasMin||this.setMinScale(ha);null==oa||this._hasMax||this.setMaxScale(oa);this._workInitPromise?this._workInitPromise.then(N,N):N()}else console.error("cannot create rasterx layer as the raster data source cannot be opened")}),this._errorHandler)},_getSourceImageServiceRaster:function(){var I=this.raster&&"Function"===this.raster.sourceType?1===this.raster.getMemberRasters().length?this.raster.getMemberRasters()[0]:null:this.raster;if(I&&"ImageService"===
I.sourceType)return I},_addLegacySupport:function(I,O){this._url=w.urlToObject(I);O=O||{};this.format=(I=O.imageServiceParameters)&&I.format;this.compressionTolerance=I&&I.compressionTolerance?I.compressionTolerance:.01;this.interpolation=I?I.interpolation:null;this.compressionQuality=I?I.compressionQuality:null;this.bandIds=I&&I.bandIds||O&&O.bandIds||null;this.mosaicRule||(this.mosaicRule=I?I.mosaicRule:null);this.renderingRule||(this.renderingRule=I?I.renderingRule:null);this.useMapDimensionValue=
O.hasOwnProperty("useMapDimensionValue")?!!O.useMapDimensionValue:!0;this.hasImageFilter=O.hasImageFilter;this.activeMapDimensions=O.activeMapDimensions;this._params=k.mixin({},this._url.query,{f:"image",interpolation:this.interpolation,format:this.format,compressionQuality:this.compressionQuality,bandIds:this.bandIds?this.bandIds.join(","):null},I?I.toJson():{});this.pixelFilter=O.pixelFilter;this.originalPixelData=this.pixelData=null;this._queryVisibleRastersHandler=k.hitch(this,this._queryVisibleRastersHandler);
this._useRenderingRuleAttributeTable=!1;this._rasterFunctionTemplateInfos={};this._customRenderingRuleId={};this._setDefaultFilter=function(){};var E={setInterpolation:"interpolation",setCompressionQuality:"compressionQuality",setCompressionTolerance:"compressionTolerance",setBandIds:"bandIds",setDefaultBandIds:"bandIds",setMosaicRule:"mosaicRule",setRenderingRule:"renderingRule",setImageFormat:"format"},N,R=new Z;Object.keys(E).forEach(k.hitch(this,function(W){this[W]=k.hitch(this,function(ha,oa){N=
{};N[E[W]]=ha;this.raster&&(this.raster.setFetchParameters(N),R[W].bind(this)(ha,oa))})}));this.setDisableClientCaching=function(W){R.setDisableClientCaching.bind(this)(W);var ha=this._getSourceImageServiceRaster();ha?ha.disableClientCaching=W:null}.bind(this);this.setDefinitionExpression=R.setDefinitionExpression.bind(this);this.setUseMapTime=R.setUseMapTime.bind(this);this._toggleTime=R._toggleTime.bind(this);this._onTimeExtentChangeHandler=R._onTimeExtentChangeHandler.bind(this);this.setPixelFilter=
R.setPixelFilter.bind(this);this.getHistograms=R.getHistograms.bind(this);this.getRasterFunctionInfos=R.getRasterFunctionInfos.bind(this);this.getKeyProperties=R.getKeyProperties.bind(this);this.getRasterAttributeTable=R.getRasterAttributeTable.bind(this);this.getRenderingRuleServiceInfo=R.getRenderingRuleServiceInfo.bind(this);this._getRenderingRuleId=R._getRenderingRuleId.bind(this);this._isRenderingRuleAProcessingTemplate=R._isRenderingRuleAProcessingTemplate.bind(this);this.handleSpatialReferenceChange=
R.handleSpatialReferenceChange.bind(this);this.onRenderingChange=this.onRenderingChange||function(){};this.onSpatialReferenceChange=this.onSpatialReferenceChange||function(){};this.onMosaicRuleChange=this.onMosaicRuleChange||function(W){};this.setRasterRenderer=this.setRenderer;this.getMultidimensionalInfo=R.getMultidimensionalInfo.bind(this);this.getColormap=R.getColormap.bind(this);this.getRenderingRuleColormap=R.getRenderingRuleColormap.bind(this);this.getDefaultMultidimensionalDefinition=R.getDefaultMultidimensionalDefinition.bind(this);
this._getDefaultMultidimensionalDefinition=R._getDefaultMultidimensionalDefinition.bind(this);this._getDefaultDimensionValue=R._getDefaultDimensionValue.bind(this);this.getStatistics=R.getStatistics.bind(this)},_addGeneralProperties:function(){var I=this._getSourceImageServiceRaster();if(I){var O=["minScale","maxScale","tileInfo"];Object.keys(I.serviceInfo).forEach(function(R){null==this[R]&&-1===O.indexOf(R)&&(this[R]=I.serviceInfo[R])}.bind(this));this.pixelSizeX=parseFloat(this.pixelSizeX);this.pixelSizeY=
parseFloat(this.pixelSizeY);this.bands=I.rasterInfo.statistics;var E,N=[];this.fields=this.fields||[];for(E=0;E<this.fields.length;E++)N.push(new F(this.fields[E]));this.fields=N;this.version=this.currentVersion;this.defaultMosaicRule=I.serviceInfo.defaultMosaicRule}},setDefaultRenderer:function(){if(this.loaded&&this._canvas&&!this.pixelFilter){var I=ea.createDefaultRenderer(this);if(null!=I){var O=this.mosaicRule&&this.mosaicRule.multidimensionalDefinition&&0<this.mosaicRule.multidimensionalDefinition.length;
if(this._multidimensionalInfo&&O&&"Stretch"===I.rendererName){var E=this.mosaicRule.multidimensionalDefinition[0].variableName;(O=this._multidimensionalInfo.variables.filter(function(N){return N.name===E})[0])&&O.histograms&&O.histograms.length&&(I.histograms=O.histograms,6===I.stretchType&&(I.dra=!1));O&&O.statistics&&O.statistics.length&&(I.statistics=O.statistics.map(function(N){return[N.min,N.max,N.mean,N.stddev||N.standardDeviation]}),6!==I.stretchType&&(I.dra=!1))}this.setRenderer(I,!0)}}},
setDefaultInterpolation:function(){if(this.loaded&&this._canvas){var I=this.raster.serviceInfo&&this.raster.serviceInfo.defaultResamplingMethod;if(I)switch(I.toLowerCase()){case "bilinear":this.interpolation="RSP_BilinearInterpolation";break;case "cubic":this.interpolation="RSP_CubicConvolution";break;case "majority":this.interpolation="RSP_Majority";break;case "nearest":this.interpolation="RSP_NearestNeighbor"}else{I=this.raster.dataType&&this.raster.dataType.toLowerCase();var O=!!this.raster.rasterInfo.colormap;
this.raster.rasterInfo.vat||O||"thematic"===I||"StdTime"===I?"RSP_NearestNeighbor":"RSP_BilinearInterpolation"}}},_toggleTime:function(){},_updateTilingEffects:function(){(this._hasTilingEffects=this._rasterRenderer&&this._rasterRenderer.hasTilingEffects()||this.raster&&this.raster.rasterFunction&&this.raster.rasterFunction.hasTilingEffects())&&this._map&&this.tileMode&&this.useWebGL&&this.tileManager&&(this._hasTilingEffects=!1)},_setMap:function(I,O){this.inherited(arguments);I.spatialReference&&
(I.spatialReference.ics||I.spatialReference.icsId)&&(this.roaming=this.useWebGL=this.tileMode=!1);if(this.tileMode){this.virtualTileInfo=new fa(null,{refTileInfo:I.tileInfo,spatialReference:I.spatialReference,extent:this.raster.rasterInfo.extent});var E=this.raster.tileInfo&&(-1<["Elevation","Raster"].indexOf(this.raster.tileInfo.tileType)||3===this.raster.rasterInfo.bandCount&&"U8"===this.raster.rasterInfo.pixelType)?this.raster.tileInfo:this.virtualTileInfo;this._tileParams=this._tileParams||{};
this._tileParams.size=E.cols+","+E.rows;this.tileManager=new K({tileInfo:E,layer:this,mapSR:I.spatialReference})}this._dragOrigin={x:0,y:0};E=this._div=b.create("div",null,O);var N={width:I.width+"px",height:I.height+"px",position:"absolute"};"css-transforms"===I.navigationMode?this.roaming&&this.tileMode&&this.useWebGL||(N[d._css.names.transform]=d._css.translate(I.__visibleDelta.x,I.__visibleDelta.y),this._left=I.__visibleDelta.x,this._top=I.__visibleDelta.y):this._left=this._top=0;a.set(E,N);this._canvas=
b.create("canvas",{width:I.width+"px",height:I.height+"px",style:"position: absolute;"},E);p.isDefined(this.opacity)&&a.set(E,"opacity",this.opacity);this._contextType?(this._context=this._canvas.getContext(this._contextType,null),this.useWebGL=this._context instanceof WebGLRenderingContext):this.useWebGL?(this._context=this._canvas.getContext("webgl",null)||this._canvas.getContext("experimental-webgl",null),this.drawMode=!1):(this._context=this._canvas.getContext("2d"),this.drawMode=!0);this._context||
console.error("Unable to create the context. This browser might not support \x3ccanvas\x3e elements.");this.useWebGL&&(I.acquireWebGLContext(this),this._glSetting={gl:this._context,branchCount:this.raster.rasterFunction?this.raster.rasterFunction.branchCount:0,pingpong:null,branches:null,drawMesh:this._drawMesh,programUniforms:{}});this.raster.rasterFunction&&(this._updateTilingEffects(),this.raster.setProcessingContext({layer:this}));this.setRenderer(this.renderer,!0);this._rasterRenderer||this.setDefaultRenderer();
this.interpolation||this.setDefaultInterpolation();this._mapWidth=I.width;this._mapHeight=I.height;this._connects=[];this._connects.push(n.connect(I,"onPan",this,this._panHandler));this._connects.push(n.connect(I,"onPanEnd",this,this._panEndHandler));"css-transforms"===I.navigationMode?this._connects.push(n.connect(I,"onScale",this,this._onScaleHandler)):(this._connects.push(n.connect(I,"onZoom",this,this._onZoomHandler)),this._connects.push(n.connect(I,"onZoomEnd",this,this._onZoomEndHandler)));
this._connects.push(n.connect(I,"onResize",this,this._onResizeHandler));this._connects.push(n.connect(I,"onExtentChange",this,this._extentChangeHandler));this._connects.push(n.connect(this,"onVisibilityChange",this,this._visibilityChangeHandler));this._connects.push(n.connect(this,"onOpacityChange",this,this._opacityChangeHandler));this._startRect={left:0,top:0,width:I.width,height:I.height};this.evaluateSuspension();if(this.suspended&&!I.loaded)var R=n.connect(I,"onLoad",this,function(){n.disconnect(R);
R=null;this.evaluateSuspension()});return E},_unsetMap:function(I,O){this.useWebGL&&I.releaseWebGLContext(this);q.forEach(this._connects,n.disconnect,this);var E=this._div;E&&(O.removeChild(E),b.destroy(E));this._map=this._canvas=this._context=this.data=this._connects=null;clearTimeout(this._displayTimer);this._displayTimer=null;this.inherited(arguments)},_canDraw:function(){return!!(this._map&&this._canvas&&this._context)},_requestDataErrorHandler:function(I){"CancelError"!==I.name&&(this.clear(),
this.onError(I))},_clonePixelData:function(I){if(null===I||I.texture)return I;var O={};I.extent&&(O.extent=k.clone(I.extent));var E=I.pixelBlock;null!=E&&(O.pixelBlock=E.clone());O.texture=I.texture;return O},_setPixelData:function(I){if(I){I=this._clonePixelData(I);this.pixelFilter&&(this.pixelFilter.filter?(this.pixelFilter.renderTexture=!0,this.pixelFilter.filter(I)):this.pixelFilter(I));this.pixelData=I;if(this._rasterReadPromise&&this._rasterReadPromise.isCanceled())return;this._drawPixelData()}this._rasterReadPromise=
null},_requestData:function(I,O,E){this._rasterReadPromise&&this._rasterReadPromise.cancel();I=k.clone(I)._normalize(!0);this._rasterReadPromise=this.raster.read({extent:I,width:this._map.width,height:this._map.height});this._rasterReadPromise.then(k.hitch(this,function(N){this._rasterReadPromise&&this._rasterReadPromise.isCanceled()||(this.originalPixelData=N&&N.srcData?{extent:N.extent,src:N.srcData}:N,this.useWebGL&&this._glSetting&&(this._glSetting.hasNewTexture=!0),this._setPixelData(N))}),k.hitch(this,
this._requestDataErrorHandler));return this._rasterReadPromise},_drawPixelData:function(I){a.set(this._canvas,{left:"0px",top:"0px",width:this._map.width+"px",height:this._map.height+"px"});this._startRect={left:0,top:0,width:this._map.width,height:this._map.height};this.drawMode||"css-transforms"!==this._map.navigationMode||(this._tdx=this._left,this._tdy=this._top,this._multiply=null,a.set(this._div,d._css.names.transform,d._css.translate(this._left,this._top)),a.set(this._canvas,d._css.names.transform,
d._css.translate(-this._left,-this._top)),this._dragOrigin={x:0,y:0});this.useWebGL&&this._rasterRenderer&&this._rasterRenderer.draw(this.pixelData);if(this._canDraw()&&this.drawMode&&this.drawMode&&(I=I||this.pixelData)&&I.pixelBlock){var O=this.pixelFilter?this.pixelData:this._rasterRenderer?this._rasterRenderer.draw(I):I;I=O.pixelBlock;var E=this._context,N=E.createImageData(I.width,I.height);N.data.set(I.getAsRGBA());O=O.extent;var R=this._map.extent,W=this.getCurrentResolution(),ha=0,oa=0;Math.abs(O.xmin-
R.xmin)>W.x&&(ha=Math.round((O.xmin-R.xmin)/W.x));Math.abs(R.ymax-O.ymax)>W.y&&(oa=Math.round((R.ymax-O.ymax)/W.y));"css-transforms"===this._map.navigationMode?(this._tdx=this._left,this._tdy=this._top,this._multiply=null,a.set(this._div,d._css.names.transform,d._css.translate(this._left,this._top)),a.set(this._canvas,d._css.names.transform,d._css.translate(-this._left,-this._top))):(a.set(this._div,{left:"0px",top:"0px",width:this._map.width+"px",height:this._map.height+"px"}),a.set(this._canvas,
{left:"0px",top:"0px",width:this._map.width+"px",height:this._map.height+"px"}));this._dragOrigin={x:0,y:0};this.tileMode?this.clear(ha,oa,I.width,I.height):this.clear();E.putImageData(N,ha,oa,0,0,I.width,I.height);this._fireUpdateEnd()}},hasStdTime:function(){if(!this.hasMultidimensions||"StdTime"!==this.raster.dataType)return!1;var I=this.mosaicRule&&this.mosaicRule.multidimensionalDefinition,O=I&&I.length?I[0].variableName:this._defaultMultidimensionalDefinition[0].variableName;return this.raster.rasterInfo.multidimensionalInfo.variables.some(function(E){if(E.name===
O)return E.dimensions.some(function(N){return"StdTime"===N.name})})},getStdTimeValue:function(I){return(new Date(864E5*(I-25569))).toString()},_animatePan2d:function(){this._oldDelta&&this._delta.x===this._oldDelta.x&&this._delta.y===this._oldDelta.y||(this.tileManager.updateTile(this.tileManager.originalPixelData,!0),this._oldDelta={x:this._delta.x,y:this._delta.y});this._roamingAnimation&&this.tileMode&&this.useWebGL&&(this._roamingAnimation=requestAnimationFrame(this._animatePan2d))},_cancelAnimation:function(){this._animation&&
(cancelAnimationFrame(this._animation),this._animation=null)},_updateAllTilesOnce:function(I,O){return this.tileManager.updateTile(I,!0).then(k.hitch(this,function(E){(this._hasTilingEffects||this.useWebGL||O)&&this._drawOneFrame(E)}))},_drawOneFrame:function(I,O){if(!(this.suspended||!this._map||this.tileMode&&!this._drawTile||(this.tileMode&&this.useWebGL&&this.tileManager.originalPixelData.isEmpty&&this._context.clear(this._context.COLOR_BUFFER_BIT),this.tileMode&&this.useWebGL&&this.tileManager.xformSetting&&
this.tileManager.xformSetting.requireProjection&&!this.tileManager.xformSetting.gridConfig))){if(!this._resetCss||this._levelChange)this._levelChange=!1,this._resetDrawing();if(I&&(I.renderedPixelBlock||I.pixelBlock)&&this._canDraw()&&this.drawMode){O=I.extent;var E=this._map.extent;if(!this._isExtentOutSide(O,E)){var N=I.pixelBlock||I.renderedPixelBlock,R=this._context,W=R.createImageData(N.width,N.height);W.data.set((I.renderedPixelBlock||I.pixelBlock).getAsRGBA());I=this.getCurrentResolution();
var ha=0,oa=0;Math.abs(O.xmin-E.xmin)>I.x&&(ha=Math.round((O.xmin-E.xmin)/I.x));Math.abs(E.ymax-O.ymax)>I.y&&(oa=Math.round((E.ymax-O.ymax)/I.y));R.putImageData(W,ha,oa,0,0,N.width,N.height)}}else this._fireUpdateEnd()}},_isExtentOutSide:function(I,O){return I.xmax<=O.xmin||I.xmin>=O.xmax||I.ymax<=O.ymin||I.ymin>=O.ymax},_resetDrawing:function(){this._resetCss=!0;if(!this.useWebGL)if(this._multiply||this._startRect.width!==this._map.width||this._startRect.height!==this._map.height)this.clear();else{var I=
this._context.getImageData(0,0,this._map.width,this._map.height);this.clear();this._context.putImageData(I,this._startRect.left,this._startRect.top)}this._dragOrigin={x:0,y:0};this._startRect={left:0,top:0,width:this._map.width,height:this._map.height};a.set(this._canvas,{left:"0px",top:"0px",width:this._map.width+"px",height:this._map.height+"px"});"css-transforms"===this._map.navigationMode?(this.roaming&&this.tileMode&&this.useWebGL&&(this._delta=null),this._tdx=this._left,this._tdy=this._top,
this._multiply=null,a.set(this._div,d._css.names.transform,d._css.translate(this._left,this._top)),a.set(this._canvas,d._css.names.transform,d._css.translate(-this._left,-this._top))):(a.set(this._div,{left:"0px",top:"0px",width:this._map.width+"px",height:this._map.height+"px"}),a.set(this._canvas,{left:"0px",top:"0px",width:this._map.width+"px",height:this._map.height+"px"}))},_drawAllFrames:function(){if(!this.suspended&&this._map&&(!this.tileMode||this._drawTile))if(this._resetCss){var I=this._frames,
O=0,E;for(E=0;E<I.length;E++)if(I[E].completed)O++;else if(I[E].tileData.renderedPixelBlock){I[E].completed=!0;var N=I[E].tileData;break}else if(I[E].tileData._fetched&&!I[E].tileData.src){I[E].completed=!0;break}else if(I[E].tileData.update&&I[E].tileData.update.isFulfilled()&&!I[E].tileData.renderedPixelBlock){I[E].completed=!0;break}else I[E].tileData.fetch&&(!0===I[E].tileData.fetch||I[E].tileData.fetch.isCanceled()||I[E].tileData.fetch.isRejected())?(I[E].completed=!0,O++):this._isExtentOutSide(I[E].tileData.extent,
this._map.extent)&&(I[E].completed=!0,O++);if(N){O++;var R=N.extent,W=this._map.extent,ha=this.getCurrentResolution(),oa=E=0;Math.abs(R.xmin-W.xmin)>ha.x&&(E=Math.round((R.xmin-W.xmin)/ha.x));Math.abs(W.ymax-R.ymax)>ha.y&&(oa=Math.round((W.ymax-R.ymax)/ha.y));N.renderedPixelBlock?(R=N.renderedPixelBlock,W=this._context.createImageData(R.width,R.height),W.data.set(N.renderedPixelBlock.getAsRGBA()),this._context.putImageData(W,E,oa,0,0,R.width,R.height)):this.clear(E,oa,N.width,N.height)}O===I.length?
(this._animation=null,this._fireUpdateEnd()):this._animation=requestAnimationFrame(k.hitch(this,this._drawAllFrames))}else this._resetDrawing(),this._animation=requestAnimationFrame(k.hitch(this,this._drawAllFrames))},_fetchTiles:function(I,O){if(!this.suspended&&this.loaded){this._cancelAnimation();var E=this.tileManager,N=!(E.xformSetting.requireProjection&&E.xformSetting.requirePE)||da.load();e(N,k.hitch(this,function(){E.updateExtent(I,this.getCurrentResolution());this._resetCss=!1;E.fetchTiles(O);
O&&(this._hasTilingEffects||this.useWebGL?this.useWebGL&&0<E.tiles.length?(E.fillupTiles(),E._validateRawPixelBlocks(E.originalPixelData)?this._updateAllTilesOnce(E.originalPixelData):E.originalPixelData&&E.originalPixelData.src&&E.tiles.some(function(R){return R.updateCompleted})&&this._context.clear(this._context.COLOR_BUFFER_BIT),E.tiles.forEach(k.hitch(this,function(R){R.update&&!R.updateCompleted&&R.update.then(function(W){R.updateCompleted||(R.updateCompleted=!0);(this._hasTilingEffects||this.useWebGL)&&
this._drawOneFrame(W)}.bind(this))}))):this._hasTilingEffects&&e(E.fetchAllCompleted.isResolved()||E.fetchAllCompleted,k.hitch(this,function(){this._updateAllTilesOnce(E.originalPixelData)})):(this._frames=E.tiles.map(function(R){return{completed:!1,tileData:R}}),this._drawAllFrames()))}))}},_redrawTiles:function(){this._fetchTiles(this._map.extent,!0)},_panHandler:function(I,O){this._drawTile=!1;"css-transforms"===this._map.navigationMode?this.roaming&&this.tileMode&&this.useWebGL?(this._delta=O,
!this._roamingAnimation&&this.tileMode&&(this._roamingAnimation=requestAnimationFrame(this._animatePan2d))):(this._left=this._map.__visibleDelta.x+O.x,this._top=this._map.__visibleDelta.y+O.y,a.set(this._div,d._css.names.transform,d._css.translate(this._left,this._top))):a.set(this._div,{left:this._startRect.left+O.x+"px",top:this._startRect.top+O.y+"px"});this.tileMode&&this._fetchTiles(I)},_panEndHandler:function(I,O){O&&(this._startRect.left+=O.x,this._startRect.top+=O.y);this.oldData=null;this._roamingAnimation&&
(cancelAnimationFrame(this._roamingAnimation),this._oldDelta=this._roamingAnimation=null)},_onScaleHandler:function(I,O){var E={},N=d._css.names;a.set(this._canvas,N.transition,O?"none":N.transformName+" "+Y+"ms ease");this._matrix=I;I=this._multiply?f.multiply(I,this._multiply):I;if(this._tdx||this._tdy)I=f.multiply(I,{xx:1,xy:0,yx:0,yy:1,dx:-this._tdx,dy:-this._tdy});E[N.transform]=d._css.matrix(I);a.set(this._canvas,E)},_onZoomHandler:function(I,O,E){var N=this._startRect;I=N.width*O;O*=N.height;
var R=N.left-(I-N.width)*(E.x-N.left)/N.width;E=N.top-(O-N.height)*(E.y-N.top)/N.height;a.set(this._canvas,{left:R+"px",top:E+"px",width:I+"px",height:O+"px"});this._endRect={left:R,top:E,width:I,height:O}},_onZoomEndHandler:function(){this._endRect&&(this._startRect=this._endRect)},_onResizeHandler:function(I,O,E){a.set(this._div,{width:O+"px",height:E+"px"});a.set(this._canvas,{width:O+"px",height:E+"px"});this._startRect.width=this._canvas.width=O;this._startRect.height=this._canvas.height=E;this.useWebGL&&
this._glSetting&&(this._glSetting.pingpong=null,this._glSetting.branches=null)},_extentChangeHandler:function(I,O,E,N){if(this.loaded&&!this.suspended&&(!O||0!==O.x||0!==O.y||E)){this._drawTile=!0;"css-transforms"===this._map.navigationMode&&(O&&(this._dragOrigin.x+=O.x,this._dragOrigin.y+=O.y),this._left=this._map.__visibleDelta.x,this._top=this._map.__visibleDelta.y,this.roaming&&this.tileMode&&this.useWebGL||E||a.set(this._div,d._css.names.transform,d._css.translate(this._left,this._top)),E&&(a.set(this._canvas,
d._css.names.transition,"none"),this._multiply=this._multiply?f.multiply(this._matrix,this._multiply):this._matrix,this._levelChange=!0));this._fireUpdateStart();var R=this._map;O=this.raster.rasterFunction?this.raster.getMemberRasters().map(function(ha){return ha._rasterId}):[this.raster._rasterId];var W={};this.tileMode?((this.roaming||this.useWebGL)&&this.tileMode||(O.forEach(function(ha,oa){W[ha]={extent:R.extent,pixelBlock:new Q({width:R.width,height:R.height,pixels:[],pixelType:"",mask:null,
statistics:[]})}}),this.tileManager.originalPixelData={extent:R.extent,src:W}),this.projectedFullExtent?this._fetchTiles(I,!0):this._getProjectedFullExtent(R.spatialReference).then(k.hitch(this,function(){this._fetchTiles(I,!0)}))):this._requestData(R.extent,R.width,R.height)}},_visibilityChangeHandler:function(I){I?t.show(this._div):t.hide(this._div)},_opacityChangeHandler:function(I){a.set(this._div,"opacity",I)}});l("extend-esri")&&k.setObject("layers.RasterXLayer",H,d);return H})},"esri/layers/rasterLib/raster/rasterFactory":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/Deferred dojo/_base/array dojo/_base/config dojo/sniff dojo/when ../../../kernel ../../../Evented ../../../request ../../../deferredUtils ../../../urlUtils ./ImageServiceRaster ./TileServiceRaster ./TileRaster ./FunctionRaster".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w){H={customDrivers:[],create:function(u){if(u){if(u.url){var r=d.urlToObject(u.url);var y=r.path;var B=r.query}r=u.serviceInfo;var C=u.rasterFxArgs||{},G=new q,x=n.hitch(this,function(F){console.error(F);this._trycustomDrivers(n.mixin({url:y},u),0,G)});if(y)if(-1===y.toLowerCase().indexOf("imageserver")&&-1===y.toLowerCase().indexOf("mapserver")){var v=new t(n.mixin({},u,{url:y}));u.rasterFx&&(v=new w({rasterFx:u.rasterFx,rasterFxArgs:n.mixin({},C,{raster:v})}));
var z=v}else{z=new q;r=r||this._getServiceInfo(y,B);var A=n.hitch(this,function(F){F.bandCount?v=F.capabilities&&-1<F.capabilities.toLowerCase().indexOf("tileonly")?new p(n.mixin({},{serviceInfo:F},B,u,{url:y})):new h(n.mixin({},{serviceInfo:F},B,u,{url:y})):F.tileInfo&&(v=new p(n.mixin({},{serviceInfo:F},B,this._options,{url:y})));u.rasterFx&&(v=new w({rasterFx:u.rasterFx,rasterFxArgs:n.mixin({},C,{raster:v})}));z.resolve(v)});a(r,A,x)}else z=v=new w({rasterFx:u.rasterFx,rasterFxArgs:n.mixin({},
C,{raster:v})});a(z,n.hitch(this,function(F){F?F.open().then(n.hitch(this,function(J){G.resolve(F)}),x):x(Error("There is no raster to open"))}),x);return G.promise}},register:function(u){this.customDrivers=this.customDrivers||[];0<this.customDrivers.filter(function(r){return r.sourceType===u.prototype.sourceType}).length||this.customDrivers.push(u)},_trycustomDrivers:function(u,r,y){y=y||new q;var B=this.customDrivers[r];if(B){var C=new B(u);C.open().then(n.hitch(this,function(G){y.resolve(C)}),
n.hitch(this,function(G){this._trycustomDrivers(u,r+1,y)}))}else y.reject("cannot load layer "+(u&&u.url||""));return y.promise},_getServiceInfo:function(u,r){r=r||{};var y=r.bandIds;r=r.renderingRule;var B=new q(g._dfdCanceller),C={f:"json"};y&&(C.bandIds=y);r&&(C.renderingRule=r.toJson?JSON.stringify(r.toJson()):JSON.stringify(r));B._pendingDfd=e({url:u,content:C,handleAs:"json",callbackParamName:"callback"});B._pendingDfd.then(function(G){B.callback(G)},function(G){B.errback(G)});return B.promise}};
b("extend-esri")&&n.setObject("layers.rasterLib.raster.rasterFactory",H,c);return H})},"esri/layers/rasterLib/raster/ImageServiceRaster":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/Deferred dojo/_base/array dojo/_base/config dojo/_base/json dojo/sniff dojo/DeferredList dojo/when ../../../kernel ../../../Evented ../../../request ../../../geometry/Extent ../../../geometry/Point ../../../SpatialReference ../../../WKIDUnitConversion ../../../deferredUtils ../../../urlUtils ../../MosaicRule ../../ImageServiceParameters ../../PixelBlock ./RasterInfo ./BasicRaster ../../rasterFormats/rasterCodec ../tile/RasterTileInfo".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G,x,v,z){H=k([x],{declaredClass:"esri.layers.rasterLib.raster.ImageServiceRaster",sourceType:"ImageService",constructor:function(A){A&&(this._imageServiceParams=A.imageServiceParameters,this._commonReqParams=A._commonReqParams,this._imageServiceParams||(this._imageServiceParams={interpolation:A.interpolation,pixelType:A.pixelType,format:A.format||"lerc",compressionQuality:A.compressionQuality,bandIds:A.bandIds,noDataInterpretation:A.noDataInterpretation,
adjustAspectRatio:A.adjustAspectRatio,mosaicRule:A.mosaicRule,renderingRule:A.interpolation}))},open:function(){var A=new q;if(this.serviceInfo&&this.rasterInfo)return this.loaded=!0,this._findCredential(),this.setFetchParameters(this._imageServiceParams),A.resolve(this),A.promise;var F=this.serviceInfo||this._generateServiceInfo(this._imageServiceParams&&this._imageServiceParams.renderingRule),J=n.hitch(this,function(P){this._fixServiceInfo(P);this.serviceInfo=P;this._findCredential();var Q=this._parseRasterInfo(P),
Z={};P.defaultMosaicMethod?(Z.method=P.defaultMosaicMethod,Z.operation=P.mosaicOperator,Z.sortField=P.sortField,Z.sortValue=P.sortValue):Z.method=y.METHOD_NONE;this.serviceInfo.defaultMosaicRule=new y(Z);this.serviceInfo.defaultMosaicRule.ascending=!0;P=this._getColormap(this);Z=this._getHistograms(this);var ca=this._getRasterAttributeTable(this),da=this._getKeyProperties(this),ea=this._getMultidimensionalInfo(),fa=this._getSlices();(new c([P,Z,ca,da,ea,fa])).then(n.hitch(this,function(K){K[0][0]&&
(Q.colormap=K[0][1]);K[1][0]&&(Q.histograms=K[1][1]);K[2][0]&&(Q.vat=K[2][1]);K[3][0]&&(Q.keyProperties=K[3][1]);K[4][0]&&(Q.multidimensionalInfo=K[4][1]);this._slices=K[5][0]?K[5][1]:null;Q.keyProperties&&Q.keyProperties.DataType&&(this.dataType=Q.keyProperties.DataType);this.loaded=!0;this.rasterInfo=Q;this.setFetchParameters(this._imageServiceParams);A.resolve(this)}))}),L=n.hitch(this,function(P){this.loaded=!0;A.reject(P)});f(F,J,L);return A.promise},setFetchParameters:function(A,F){if(F)this.imageServiceParams=
A;else{var J=this.imageServiceParams;J&&A?Object.keys(A).forEach(function(L){J[L]=A[L]}):this.imageServiceParams=A}this._constructGetImageParams();this._getRasterIdentifier(!0)},read:function(A){if(A.pixelBlock||A.texture){var F=new q;F.resolve(A);return F.promise}if(!1===A.virtual&&this.tileInfo&&!this.tileInfo.virtual)return this.readTile(A);if(this._slices){var J=this._getSliceId();if(null==J)return F=new q,F.resolve(A),F.promise}var L=A.extent,P=L.spatialReference.wkid||b.toJson(L.spatialReference.toJson(!1)),
Q=A.timeExtent?A.timeExtent.toJson().join(","):null;F=this.url+"/exportImage";var Z={};this._slices&&(Z.sliceid=J);this.disableClientCaching&&(Z._ts=(new Date).getTime());J=n.mixin({},this._commonReqParams,{bbox:L.xmin+","+L.ymin+","+L.xmax+","+L.ymax,imageSR:P,bboxSR:P,size:A.width+","+A.height,time:Q},Z);return this._requestPixels({url:F,payload:J,decodeParams:{width:A.width,height:A.height,planes:null,pixelType:null,format:null,decodeFunc:null,isPoint:!1},tileOptions:A})},readTile:function(A){var F=
this.tileBoundary&&this.tileBoundary[A.level];if(F&&(F.minRow>A.row||F.maxRow<A.row||F.minCol>A.col||F.maxCol<A.col)){var J=new q;J.resolve(A);return J.promise}if(this._slices&&(J=this._getSliceId(),null==J))return J=new q,J.resolve(A),J.promise;F=this.url+"/tile/"+A.level+"/"+A.row+"/"+A.col;var L={width:this.tileInfo.cols,height:this.tileInfo.rows,planes:null,pixelType:null,format:null,decodeFunc:null,isPoint:"elevation"===A.tileType.toLowerCase()?!0:!1};J=this._slices?"sliceid\x3d"+J+"\x26":"";
J=this.disableClientCaching?"_ts\x3d "+(new Date).getTime():J.replace(/&$/,"");return this._requestPixels({url:F+(0<J.length?"?"+J:""),payload:{},decodeParams:L,tileOptions:A})},toJson:function(){return{url:this.url,tileInfo:this.tileInfo,rasterInfo:this.rasterInfo,serviceInfo:this.serviceInfo,sourceType:this.sourceType,_commonReqParams:this._commonReqParams,_rasterId:this._rasterId}},_getSliceId:function(){var A=n.clone(this._imageServiceParams.multidimensionalDefinition),F=n.clone(this._imageServiceParams.time);
if(null==this._slices||null==F&&(null==A||0===A.length))return 0;var J=A||this.defaultMultidimensionalDefinition,L=J[0].variableName;J=this._getAllDimensionDefinition(J,L).definition;A=null;if(null==J||0===J.length)return null;if(F&&this.serviceInfo.timeInfo){if(null==F[1]||F[1]===F[0])var P=F[0];else{var Q=this.serviceInfo.timeInfo.startTimeField;P=this.rasterInfo.multidimensionalInfo.variables.find(function(da){return da.name===L}).dimensions.find(function(da){return da.name===Q}).values.filter(function(da){return Array.isArray(da)?
Math.max(da[0],F[0])<Math.min(da[1],F[1]):da>=F[0]&&da<=F[1]}).sort(function(da,ea){da=Array.isArray(da)?da[1]:da;ea=Array.isArray(ea)?da[1]:ea;return Math.abs(F[1]-da)-Math.abs(F[1]-ea)})[0]||[F[1]]}J.some(function(da){if(da.dimensionName===Q)return da.values[0]=P,!0;if(!da.dimensionName)return da.dimensionName=Q,da.isSlice=!0,da.values=[P],!0})||J.push({variableName:L,dimensionName:Q,isSlice:!0,values:[P]})}for(var Z=0;Z<this._slices.length;Z++){var ca=this._slices[Z].multidimensionalDefinition;
if(ca.length===J.length&&!ca.some(function(da){var ea=J.filter(function(K){return da.variableName===K.variableName&&K.dimensionName===da.dimensionName})[0];if(!ea)return!0;var fa=Array.isArray(da.values[0])?da.values[0][0]:da.values[0];ea=Array.isArray(ea.values[0])?ea.values[0][0]:ea.values[0];return fa!==ea})){A=Z;break}}return A},_getAllDimensionDefinition:function(A,F){var J=A.map(function(P){return P.dimensionName}),L=!1;this.rasterInfo.multidimensionalInfo.variables.forEach(function(P){P.name!==
F||P.dimensions.length===A.length&&J[0]||(P.dimensions.forEach(function(Q){0>J.indexOf(Q.name)&&(J[0]?A.push({variableName:F,dimensionName:Q.name,values:[Q.values[0]]}):(A[0].dimensionName=Q.name,A[0].values=[Q.values[0]],Q[0]=Q.name))}),L=!0)},this);return{defChanged:L,definition:A}},_generateServiceInfo:function(A){var F=this.url,J=new q(u._dfdCanceller);J._pendingDfd=d({url:F,content:{f:"json",renderingRule:A?b.toJson(A.toJson()):null},handleAs:"json",callbackParamName:"callback"});J._pendingDfd.then(function(L){J.callback(L)},
function(L){J.errback(L)});return J},_fixServiceInfo:function(A){var F=A.spatialReference.wkid;A.tileInfo&&0===A.extent.xmin&&360===A.extent.xmax&&F&&null==w[F]&&(A.tileInfo.applyGCS360Transform=!0)},_parseRasterInfo:function(A){var F=new G;F.bandCount=A.bandCount;F.extent=new h(A.fullExtent);F.spatialReference=A.spatialReference;F.pixelType=A.pixelType;F.width=Math.floor((A.fullExtent.xmax-A.fullExtent.xmin)/A.pixelSizeX+.5);F.height=Math.floor((A.fullExtent.ymax-A.fullExtent.ymin)/A.pixelSizeY+
.5);F.cellSize=new p({x:A.pixelSizeX,y:A.pixelSizeY,spatialReference:A.spatialReference});var J;if(A.minValues&&0<A.minValues.length&&A.maxValues&&A.stdvValues&&A.meanValues){var L=[];for(J=0;J<A.minValues.length;J++)L.push({min:A.minValues[J],max:A.maxValues[J],mean:A.meanValues[J],stddev:A.stdvValues[J]});A.bandCount!==L.length&&(L=null)}this.dataType=A.serviceDataType?A.serviceDataType.replace("esriImageServiceDataType",""):"Generic";F.statistics=L;A.objectIdField&&A.fields&&(F.catalogInfo={objectIdField:A.objectIdField,
fields:A.fields});F.timeInfo=A.timeInfo;if(A.tileInfo){this.tileInfo=new z(A.tileInfo);this.tileInfo.tileType=A.cacheType||"Map";F.tileInfo=this.tileInfo;var P=F.extent,Q=this.tileInfo.origin,Z=this.tileInfo.cols,ca=this.tileInfo.rows;this.tileBoundary=this.tileInfo.lods.map(function(da){return{minCol:Math.floor((P.xmin-Q.x+.1*da.resolution)/Z/da.resolution),maxCol:Math.floor((P.xmax-Q.x-.1*da.resolution)/Z/da.resolution),minRow:Math.floor((Q.y-P.ymax+.1*da.resolution)/ca/da.resolution),maxRow:Math.floor((Q.y-
P.ymin-.1*da.resolution)/ca/da.resolution)}})}return F},_getColormap:function(A){A=this.url+"/colormap";var F=new q(u._dfdCanceller),J={f:"json"},L=this.serviceInfo.hasColormap||this.rasterInfo&&this.rasterInfo.hasColormap;10<this.serviceInfo.currentVersion&&L?(F._pendingDfd=d({url:A,content:J,handleAs:"json",callbackParamName:"callback"}),F._pendingDfd.then(function(P){F.callback(P.colormap)},function(P){F.errback(P)})):F.callback(null);return F},_getHistograms:function(A){var F=this.url+"/histograms",
J=new q(u._dfdCanceller),L={f:"json"},P=this.serviceInfo.hasHistograms||this.rasterInfo&&this.rasterInfo.hasHistograms;A&&A.renderingRule&&(L.renderingRule=b.toJson(A.renderingRule.toJson()),P=!0);10<this.serviceInfo.currentVersion&&P?(J._pendingDfd=d({url:F,content:L,handleAs:"json",callbackParamName:"callback"}),J._pendingDfd.then(function(Q){J.callback(Q.histograms)},function(Q){J.errback(Q)})):J.callback(null);return J},_getRasterAttributeTable:function(A){var F=this.url+"/rasterAttributeTable",
J=new q(u._dfdCanceller),L={f:"json"},P=this.serviceInfo.hasRasterAttributeTable;A&&A.renderingRule&&(L.renderingRule=b.toJson(A.renderingRule.toJson()),P=!0);10<this.serviceInfo.currentVersion&&P?(J._pendingDfd=d({url:F,content:L,handleAs:"json",callbackParamName:"callback"}),J._pendingDfd.then(function(Q){J.callback(Q)},function(Q){J.errback(Q)})):J.callback(null);return J},_getKeyProperties:function(A){var F=this.url+"/keyProperties",J=new q(u._dfdCanceller),L={f:"json"};A&&A.renderingRule&&(L.renderingRule=
b.toJson(A.renderingRule.toJson()));10<this.serviceInfo.currentVersion?(J._pendingDfd=d({url:F,content:L,handleAs:"json",callbackParamName:"callback"}),J._pendingDfd.then(function(P){J.callback(P)},function(P){J.errback(P)})):J.callback(null);return J},_getMultidimensionalInfo:function(){var A=this.url+"/multidimensionalInfo",F=new q(u._dfdCanceller);10.3<=this.serviceInfo.currentVersion&&this.serviceInfo.hasMultidimensions?(F._pendingDfd=d({url:A,content:{f:"json"},handleAs:"json",callbackParamName:"callback"}),
F._pendingDfd.then(n.hitch(this,function(J){F.callback(J.multidimensionalInfo)}),function(J){F.errback(J)})):F.callback(null);return F},_getSlices:function(){var A=this.url+"/slices",F=new q(u._dfdCanceller);this.serviceInfo.hasMultidimensions?(F._pendingDfd=d({url:A,content:{f:"json"},handleAs:"json",callbackParamName:"callback"}),F._pendingDfd.then(n.hitch(this,function(J){F.callback(J.slices)}),function(J){F.errback(J)})):F.callback(null);return F},_initializationFailed:function(){},_constructGetImageParams:function(){var A=
this.imageServiceParams||{},F=n.mixin({},this._query,{f:"image",interpolation:A.interpolation,pixelType:A.pixelType,format:A.format||"lerc",compressionQuality:A.compressionQuality,bandIds:A.bandIds?A.bandIds.join(","):null,noData:null!=A.noData?A.noData.join(","):null,noDataInterpretation:A.noDataInterpretation,adjustAspectRatio:null==A.adjustAspectRatio?null:A.adjustAspectRatio,mosaicRule:A.mosaicRule?b.toJson(A.mosaicRule.toJson()):null,renderingRule:A.renderingRule?b.toJson(A.renderingRule.toJson()):
null,token:this.credential&&this.credential.token||null});"lerc"===F.format.toLowerCase()?(F.compressionTolerance=A.compressionTolerance,10.5<=this.serviceInfo.currentVersion&&(F.lercVersion=A.lercVersion||2)):"tiff"===F.format.toLowerCase()?F.compression=A.compression:-1<["jpg","jpeg","jpg","jpgpng"].indexOf(F.format.toLowerCase())&&(F.compression=A.compression);this._commonReqParams=F},_getRasterIdentifier:function(A){if(this._rasterId)return this._rasterId;A=this.url.replace("http:","").replace("https:",
"");var F=[],J=this.imageServiceParams||{};F.push(A);F.push(J.interpolation);F.push(J.pixelType);F.push(J.compressionQuality);F.push(J.bandIds?J.bandIds.join(","):"");F.push(J.mosaicRule?b.toJson(J.mosaicRule.toJson()):"");F.push(J.renderingRule?b.toJson(J.renderingRule.toJson()):"");A=F.join("|");return this._rasterId=this._computeSignature(A)},_wrapExtent:function(A){var F=A.spatialReference._getInfo();if(F){var J=F.valid[0];F=F.valid[1];if(A.xmin<J-this.resolution.x||A.xmax>F+this.resolution.y){var L=
new h((A.xmin-J)%(F-J),A.ymin,(A.xmax-F)%(F-J),A.ymax,A.spatialReference);L.xmax<L.xmin&&(L=null)}}return L||A}});a("extend-esri")&&n.setObject("layers.rasterLib.raster.ImageServiceRaster",H,e);return H})},"esri/layers/ImageServiceParameters":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/json dojo/has ../kernel ../lang".split(" "),function(H,k,n,q,m,l){H=H(null,{declaredClass:"esri.layers.ImageServiceParameters",extent:null,width:null,height:null,imageSpatialReference:null,format:null,
interpolation:null,compressionQuality:null,bandIds:null,timeExtent:null,mosaicRule:null,renderingRule:null,renderer:null,noData:null,compressionTolerance:null,adjustAspectRatio:null,lercVersion:null,toJson:function(b){var a=this.bbox||this.extent;b=(a=a&&b&&a._normalize(!0))?a.spatialReference.wkid||n.toJson(a.spatialReference.toJson()):null;var c=this.imageSpatialReference;a={bbox:a?a.xmin+","+a.ymin+","+a.xmax+","+a.ymax:null,bboxSR:b,size:null!==this.width&&null!==this.height?this.width+","+this.height:
null,imageSR:c?c.wkid||n.toJson(c.toJson()):b,format:this.format,interpolation:this.interpolation,compressionQuality:this.compressionQuality,bandIds:this.bandIds?this.bandIds.join(","):null,mosaicRule:this.mosaicRule?n.toJson(this.mosaicRule.toJson()):null,renderingRule:this.renderingRule?n.toJson(this.renderingRule.toJson()):null,renderer:this.renderer?n.toJson(this.renderer.toJson()):null,noData:this.noData,noDataInterpretation:this.noDataInterpretation,compressionTolerance:this.compressionTolerance,
adjustAspectRatio:this.adjustAspectRatio,lercVersion:this.lercVersion};b=this.timeExtent;a.time=b?b.toJson().join(","):null;return l.filter(a,function(f){if(null!==f&&void 0!==f)return!0})}});k.mixin(H,{INTERPOLATION_BILINEAR:"RSP_BilinearInterpolation",INTERPOLATION_CUBICCONVOLUTION:"RSP_CubicConvolution",INTERPOLATION_MAJORITY:"RSP_Majority",INTERPOLATION_NEARESTNEIGHBOR:"RSP_NearestNeighbor",NODATA_MATCH_ALL:"esriNoDataMatchAll",NODATA_MATCH_ANY:"esriNoDataMatchAny"});q("extend-esri")&&k.setObject("layers.ImageServiceParameters",
H,m);return H})},"esri/layers/rasterLib/raster/RasterInfo":function(){define(["dojo/_base/declare","dojo/_base/lang","../../../geometry/Extent","../../../SpatialReference","../tile/RasterTileInfo"],function(H,k,n,q,m){return H(null,{declaredClass:"esri.layers.rasterLib.raster.RasterInfo",bandCount:null,pixelType:null,extent:null,spatialReference:null,width:null,height:null,colormap:null,attributeTable:null,multiDimensionalInfo:null,statistics:null,histograms:null,catalogInfo:null,keyProperties:null,
cellSize:null,format:null,compression:null,compressionQuality:null,packetSize:null,geodataXform:null,constructor:function(l){k.mixin(this,l);this.extent=this.extent?this.extent.toJson?this.extent:new n(this.extent):null;this.spatialReference=this.spatialReference?this.spatialReference.toJson?this.spatialReference:new q(this.spatialReference):null;this.tileInfo=this.tileInfo?this.tileInfo.toJson?this.tileInfo:new m(this.tileInfo):null},toJson:function(){return{bandCount:this.bandCount,pixelType:this.pixelType,
extent:this.extent&&this.extent.toJson?this.extent.toJson():this.extent,spatialReference:this.spatialReference&&this.spatialReference.toJson?this.spatialReference.toJson():this.spatialReference,width:this.width,height:this.height,colormap:this.colormap?k.clone(this.colormap):null,attributeTable:this.attributeTable?k.clone(this.attributeTable):null,multiDimensionalInfo:this.multiDimensionalInfo?k.clone(this.multiDimensionalInfo):null,statistics:this.statistics?k.clone(this.statistics):null,histograms:this.histograms?
k.clone(this.histograms):null,catalogInfo:this.catalogInfo?k.clone(this.catalogInfo):null,keyProperties:this.keyProperties?k.clone(this.keyProperties):null,cellSize:this.cellSize&&this.cellSize.toJson?this.cellSize.toJson():this.cellSize,tileInfo:this.tileInfo&&this.tileInfo.toJson?this.tileInfo.toJson():this.tileInfo,format:this.format,compression:this.compression,compressionQuality:this.compressionQuality,packetSize:this.packetSize,geodataXform:this.geodataXform?k.clone(this.geodataXform):null}},
clone:function(){return new this.constructor(this.toJson())}})})},"esri/layers/rasterLib/tile/RasterTileInfo":function(){define("dojo/_base/declare dojo/_base/lang ../../../geometry/Extent ../../../SpatialReference ../../../geometry/Point ../../../lang ../../TileInfo".split(" "),function(H,k,n,q,m,l,b){return H([b],{declaredClass:"esri.layers.rasterLib.tile.RasterTileInfo",rows:512,cols:512,compressionQuality:95,lercError:.01,spatialReference:null,origin:null,virtual:!0,tileType:"Raster",constructor:function(a,
c){if(a||c){var f=c&&c.refTileInfo;a?this.virtual=!1:(this.virtual=!0,k.mixin(this,{rows:c.rows||this.rows,cols:c.cols||this.cols,compressionQuality:c.compressionQuality||95,lercError:c.compressionTolerance||.01,spatialReference:c.spatialReference,origin:c.origin}),this.width=this.cols,this.height=this.rows,this.origin||(f?this.origin=f.origin:c.spatialReference.isWebMercator()||c.extent&&360<=Math.max(Math.abs(c.extent.xmin),Math.abs(c.extent.xmax))?this.origin={x:-2.0037508342787E7,y:2.0037508342787E7}:
-1<[4326,4269].indexOf(c.spatialReference.wkid)||360>Math.max(Math.abs(c.extent.xmin),Math.abs(c.extent.xmax))?this.origin={x:-180,y:90}:this.origin={x:c.extent.xmin,y:c.extent.ymax}))}},toJson:function(){var a=b.prototype.toJson.apply(this);a.tileType=this.tileType;a.virtual=this.virtual;a.lercError=this.lercError;return a},clone:function(){return new this.prototype(this.toJson())}})})},"esri/layers/rasterLib/raster/BasicRaster":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/Deferred dojo/_base/array dojo/_base/config dojo/_base/json dojo/sniff dojo/DeferredList dojo/when ../../../kernel ../../../Evented ../../../request ../../../geometry/Extent ../../../geometry/Point ../../../SpatialReference ../../../deferredUtils ../../../urlUtils ../../MosaicRule ../../ImageServiceParameters ../../PixelBlock ../../rasterFormats/rasterCodec ../tile/RasterHandler ./rasterProjectionHelper ./RasterInfo".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G,x,v){return k([g],{url:null,dataType:null,rasterInfo:null,tileInfo:null,serviceInfo:null,loaded:null,constructor:function(z){if(z){var A=z.url;A&&(A=u.urlToObject(A),this.url=A.path,this._query=A.query);this.dataType=z.dataType;this.serviceInfo=z.serviceInfo;this.rasterInfo=z.rasterInfo;this.tileInfo=z.tileInfo;this.serviceInfo=z.serviceInfo}},open:function(){},read:function(z){},identify:function(z){var A=new q,F=this.rasterInfo.extent;if(x.requirePE(F.spatialReference,
z.spatialReference))x.load().then(n.hitch(this,function(){J=x.project(z,F.spatialReference);A.resolve(J)}),function(){A.reject(Error("cannot project into this spatial reference"))});else{var J=x.project(z,F.spatialReference);A.resolve(J)}return A.then(n.hitch(this,function(L){var P=this.tileInfo,Q=P.origin,Z=P.lods[P.lods.length-1],ca=(L.x-Q.x)/P.cols/Z.resolution;L=(Q.y-L.y)/P.rows/Z.resolution;var da=Math.round((L-Math.floor(L))*P.rows)*P.cols+Math.round((ca-Math.floor(ca))*P.cols);Q=new h(Q.x+
Z.resolution*P.cols*ca,Q.y-Z.resolution*P.rows*(L+1),Q.x+Z.resolution*P.cols*(ca+1),Q.y-Z.resolution*P.rows*L,F.spatialReference);var ea=this.getMemberRasters?this.getMemberRasters()[0]:this;return ea.read({level:Z.level,row:Math.floor(L),col:Math.floor(ca),extent:Q,width:P.cols,height:P.rows,virtual:ea.tileInfo.virtual,tileType:ea.tileInfo.tileType}).then(function(fa){return(fa=fa&&fa.pixelBlock)&&fa.pixels&&0<fa.pixels.length&&(!fa.mask||fa.mask[da])?{pixelValue:fa.pixels.map(function(K){return K[da]})}:
{pixelValue:null}})}))},getProjectedFullExtent:function(z,A){var F=new q;if(this.projectedFullExtent&&!A)return F.resolve(this.projectedFullExtent),F.promise;var J=this.rasterInfo.extent;if(x.requirePE(this.rasterInfo.extent.spatialReference,z))x.load().then(n.hitch(this,function(){L=x.project(J,z);this.projectedFullExtent=L=new h(L.toJson());F.resolve(L)}),function(){F.reject(Error("cannot project into this spatial reference"))});else{var L=x.project(J,z);this.projectedFullExtent=L=new h(L.toJson());
F.resolve(L)}return F.promise},setFetchParameters:function(z,A){},_setRasterHandler:function(z){this._rasterHandler=z;this.getMemberRasters&&this.getMemberRasters().forEach(n.hitch(this,function(A){A._rasterHandler=z}))},_findCredential:function(){this.url&&((this._credential=e.id&&e.id.findCredential(this.url))&&this._credential.ssl||this.serviceInfo&&this.serviceInfo._ssl)&&(this.url=this.url.replace(/^http:/i,"https:"))},_initWorker:function(){this._rasterHandler=new G;this._rasterHandler.start().then(function(){this._rasterHandlerInitialized=
!0}.bind(this))},_requestPixels:function(z){var A=z.url,F=z.payload,J=z.decodeParams,L=z.tileOptions,P=new q(w._dfdCanceller);this._rasterHandler||this._initWorker();var Q=this._rasterHandler,Z={};A={url:A,handleAs:"arraybuffer",content:F};z.headers&&(A.headers=z.headers);P._pendingDfd=d(A).then(n.hitch(this,function(ca){(Q&&this._rasterHandlerInitialized?Q.decode({encodedData:ca,decodeParams:J}):C.decode(ca,J)).then(function(da){Z.pixelBlock=new B(da);Z.extent=L.extent;Z.level=L.level;Z.row=L.row;
Z.col=L.col;Z.width=L.width;Z.height=L.height;w._resDfd(P,[Z])},function(da){w._resDfd(P,[da],!0)})}),function(ca){w._resDfd(P,[ca],!0)});return P},_computeSignature:function(z){if("string"===typeof z){for(var A=new Uint8Array(z.length),F=0;F<z.length;F++)A[F]=z.charCodeAt(F);z=A}F=A=65535;for(var J=z.length,L=Math.floor(J/2),P=0;L;){var Q=359<=L?359:L;L-=Q;do A+=z[P++]<<8,F+=A+=z[P++];while(--Q);A=(A&65535)+(A>>>16);F=(F&65535)+(F>>>16)}J&1&&(F+=A+=z[P]<<8);return((F&65535)+(F>>>16)<<16|(A&65535)+
(A>>>16))>>>0}})})},"esri/layers/rasterFormats/rasterCodec":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/Deferred ../PixelBlock ./LercCodec ./Lerc2Codec ./JpgPlus ./Png ./Raw ./TiffDecoder".split(" "),function(H,k,n,q,m,l,b,a,c,f,e){return{validPixelTypes:"U1 U2 U4 U8 U16 U32 S8 S16 S32 F32".split(" "),supportedFormats:"lerc jpeg jpg jpgpng png png8 png24 png32 bip bsq tiff".split(" "),_isPlatformLittleEndian:function(){var g=new ArrayBuffer(4),d=new Uint8Array(g);(new Uint32Array(g))[0]=
1;return 1===d[0]}(),decode:function(g,d){if(void 0===d||null===d)throw"missing decode options";var h;d.format&&(h=d.format.toUpperCase());"BSQ"!==h&&"BIP"!==h&&(h=this._getFormat(g));var p=d.decodeFunc;if(void 0===p||null===p)p=this._getFormatDecoderDfd(h);return p(g,d)},_getFormatDecoderDfd:function(g){var d=null;switch(g){case "LERC":d=this._decodeLerc;break;case "LERC2":d=this._decodeLerc2;break;case "JPEG":d=this._decodeJpeg;break;case "PNG":d=this._decodePng;break;case "BSQ":d=this._decodeBsq;
break;case "BIP":d=this._decodeBip;break;case "TIFF":d=this._decodeTiff;break;default:d=function(h,p){throw"The raster format is not supported";}}d=n.hitch(this,d);return function(h,p){var t=new q;p.isPoint&&p.width&&(p.width++,p.height++);h=d(h,p);p.isPoint&&p.width&&(this._interpolatePointGrid(h),p.width--,p.height--);t.resolve(h);return t}.bind(this)},_getFormat:function(g){g=new Uint8Array(g,0,10);var d="";if(255===g[0]&&216===g[1])d="JPEG";else if(137===g[0]&&80===g[1]&&78===g[2]&&71===g[3])d=
"PNG";else if(67===g[0]&&110===g[1]&&116===g[2]&&90===g[3]&&73===g[4]&&109===g[5]&&97===g[6]&&103===g[7]&&101===g[8]&&32===g[9])d="LERC";else if(76===g[0]&&101===g[1]&&114===g[2]&&99===g[3]&&50===g[4]&&32===g[5])d="LERC2";else if(-1<String.fromCharCode.apply(null,g).toLowerCase().indexOf("error"))d="ERROR";else if(73===g[0]&&73===g[1]&&42===g[2]&&0===g[3]||77===g[0]&&77===g[1]&&0===g[2]&&42===g[3])d="TIFF";return d},_validateDecodeParams:function(g){if(!g.height||Math.floor(g.height)!==g.height)throw"Height not provided.";
if(!g.width||Math.floor(g.width)!==g.width)throw"Width not provided.";},_decodeJpeg:function(g,d){if(!a)throw"The jpeg decoder module is not loaded.";this._validateDecodeParams(d);g=(new a).decode(g);if(!this._verifyResult(g,d))throw"The decoded image dimensions are incorrect.";d=new m({width:g.width,height:g.height,pixels:g.pixels,pixelType:"U8",mask:g.mask,statistics:null});d.calculateStatistics();return d},_decodePng:function(g,d){if(!c)throw"The png decoder module is not loaded.";this._validateDecodeParams(d);
g=new Uint8Array(g);var h=new c(g);g=new Uint8Array(d.width*d.height*4);h.copyToImageData(g,h.decodePixels());var p=h=0;p=new Uint8Array(d.width*d.height);for(h=0;h<d.width*d.height;h++)p[h]=g[4*h+3];var t=new m({width:d.width,height:d.height,pixels:[],pixelType:"U8",mask:p,statistics:[]});for(h=0;3>h;h++){var w=new Uint8Array(d.width*d.height);for(p=0;p<d.width*d.height;p++)w[p]=g[4*p+h];t.addData({pixels:w})}t.calculateStatistics();return t},_decodeBsq:function(g,d){if(!f)throw"The bsq decoder module is not loaded.";
this._validateDecodeParams(d);var h=d.noDataValue;d.pixelType=this._getpixelTypeAndNoData(d.pixelType);g=f.decodeBSQ(g,{bandCount:d.planes,width:d.width,height:d.height,pixelType:d.pixelType,noDataValue:h});d=new m({width:d.width,height:d.height,pixels:g.pixels,pixelType:d.pixelType,mask:g.maskData,statistics:null});d.calculateStatistics();return d},_decodeBip:function(g,d){this._validateDecodeParams(d);var h=d.noDataValue;d.pixelType=this._getpixelTypeAndNoData(d.pixelType);g=f.decodeBIP(g,{bandCount:d.planes,
width:d.width,height:d.height,pixelType:d.pixelType,noDataValue:h});d=new m({width:d.width,height:d.height,pixels:g.pixels,pixelType:d.pixelType,mask:g.maskData,statistics:null});d.calculateStatistics();return d},_decodeTiff:function(g,d){this._validateDecodeParams(d);d.pixelType=this._getpixelTypeAndNoData(d.pixelType);g=e.decode(g);g=new m({width:g.width,height:g.height,pixels:g.pixels,pixelType:g.pixelType,mask:g.maskData,statistics:null});g.calculateStatistics();return g},_decodeLerc:function(g,
d){if(!this._isPlatformLittleEndian)throw"lerc decoder is not supported on big endian platform";this._validateDecodeParams(d);var h=d.noDataValue;d.pixelType=this._getpixelTypeAndNoData(d.pixelType);for(var p=0,t,w=0,u,r=g.byteLength-10;w<r;){var y=l.decode(g,{inputOffset:w,encodedMaskData:t,returnMask:0===p?!0:!1,returnEncodedMask:0===p?!0:!1,returnFileInfo:!0,pixelType:d.pixelType,noDataValue:h});w=y.fileInfo.eofOffset;0===p&&(t=y.encodedMaskData,u=new m({width:d.width,height:d.height,pixels:[],
pixelType:d.pixelType,mask:y.maskData,statistics:[]}));p++;if(!this._verifyResult(y,d))throw"The decoded image dimensions are incorrect";u.addData({pixels:y.pixelData,statistics:{minValue:y.minValue,maxValue:y.maxValue,noDataValue:y.noDataValue}})}return u},_decodeLerc2:function(g,d){if(!this._isPlatformLittleEndian)throw"lerc2 decoder is not supported on big endian platform";this._validateDecodeParams(d);d.pixelType=this._getpixelTypeAndNoData(d.pixelType);for(var h=0,p,t,w,u=0,r,y=g.byteLength-
10,B=[],C,G=0;u<y;){t=b.decode(g,{inputOffset:u,maskData:p,returnFileInfo:!0});u=t.fileInfo.eofOffset;p=t.maskData;0===h&&(w=t.fileInfo.numValidPixel,r=new m({width:d.width,height:d.height,pixels:[],dimCount:t.dimCount||1,pixelType:t.fileInfo.pixelType,mask:p,statistics:[]}));t.fileInfo.mask&&0<t.fileInfo.mask.numBytes&&G++;p&&B.push(p);h++;if(!this._verifyResult(t,d))throw"The decoded image dimensions are incorrect";r.addData({pixels:t.pixelData,statistics:{minValue:t.minValue,maxValue:t.maxValue,
noDataValue:t.noDataValue,dimStats:t.dimStats}})}if(1<G){d=r.width*r.height;r.bandMasks=B;p=new Uint8Array(d);p.set(B[0]);for(w=1;w<B.length;w++)for(C=B[w],g=0;g<d;g++)p[g]&=C[g];for(g=w=0;g<d;g++)w+=C[g];r.mask=p}r.validPixelCount=w;return r},_interpolatePointGrid:function(g,d){var h=g.pixels;if(h&&0!==h.length){var p=h.length,t=g.width,w=g.mask,u=t-1,r=g.height-1,y=[],B,C;if(0===(null==d?1:d)){for(d=0;d<p;d++){var G=h[d];var x=new G.constructor(u*r);for(B=0;B<r;B++){var v=B*t;for(C=0;C<u;C++)x[B*
u+C]=G[v+C]}y.push(x)}if(w){var z=new Uint8Array(u*r);for(B=0;B<r;B++)for(v=B*t,C=0;C<u;C++)z[B*u+C]=w[v+C]}}else{for(d=0;d<p;d++){G=h[d];x=new G.constructor(u*r);for(B=0;B<r;B++)for(v=B*t,C=0;C<u;C++)x[B*u+C]=(G[v+C]+G[v+C+1]+G[v+t+C]+G[v+t+C+1])/4;y.push(x)}if(w)for(z=new Uint8Array(u*r),B=0;B<r;B++)for(v=B*t,C=0;C<u;C++)z[B*u+C]=Math.min.apply(null,[w[v+C],w[v+C+1],w[v+t+C],w[v+t+C+1]])}g.width=u;g.height=r;g.mask=z;g.pixels=y;return g}},_getpixelTypeAndNoData:function(g){return"U1"===g||"U2"===
g||"U4"===g||"U8"===g?"U8":g},_verifyResult:function(g,d){return g.height!==d.height||g.width!==d.width?!1:!0}}})},"esri/layers/rasterFormats/JpgPlus":function(){define(["dojo/_base/declare","./Zlib","./Jpg"],function(H,k,n){return H(null,{constructor:function(){},decode:function(q){var m=new Uint8Array(q);q=new n;q.parse(m);var l=q.numComponents,b=q.getData(q.width,q.height,!0),a=q.width*q.height,c=q.eof,f=0,e=0,g=0;if(c<m.length-1){e=(new k(m.subarray(c))).getBytes();var d=new Uint8Array(a);for(f=
m=0;f<e.length;f++)for(g=7;0<=g;g--)d[m++]=e[f]>>g&1}m=[];if(1===l)m=[b,b,b];else{for(f=0;3>f;f++)l=new Uint8Array(a),m.push(l);for(e=g=0;e<a;e++)for(f=0;3>f;f++)m[f][e]=b[g++]}return{width:q.width,height:q.height,pixels:m,mask:d}}})})},"esri/layers/rasterFormats/Zlib":function(){define([],function(){var H=function(){function k(){this.bufferLength=this.pos=0;this.eof=!1;this.buffer=null}k.prototype={ensureBuffer:function(n){var q=this.buffer,m=q?q.byteLength:0;if(n<m)return q;for(var l=512;l<n;)l<<=
1;n=new Uint8Array(l);for(l=0;l<m;++l)n[l]=q[l];return this.buffer=n},getByte:function(){for(var n=this.pos;this.bufferLength<=n;){if(this.eof)return null;this.readBlock()}return this.buffer[this.pos++]},getBytes:function(n){var q=this.pos;if(n){this.ensureBuffer(q+n);for(n=q+n;!this.eof&&this.bufferLength<n;)this.readBlock();var m=this.bufferLength;n>m&&(n=m)}else{for(;!this.eof;)this.readBlock();n=this.bufferLength}this.pos=n;return this.buffer.subarray(q,n)},lookChar:function(){for(var n=this.pos;this.bufferLength<=
n;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var n=this.pos;this.bufferLength<=n;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(n,q,m){for(var l=n+q;this.bufferLength<=l&&!this.eof;)this.readBlock();return new Stream(this.buffer,n,q,m)},skip:function(n){n||(n=1);this.pos+=n},reset:function(){this.pos=0}};return k}();return function(){function k(c){throw Error(c);
}function n(c){var f=0,e=c[f++],g=c[f++];-1!=e&&-1!=g||k("Invalid header in flate stream");8!=(e&15)&&k("Unknown compression method in flate stream");0!=((e<<8)+g)%31&&k("Bad FCHECK in flate stream");g&32&&k("FDICT bit set in flate stream");this.bytes=c;this.bytesPos=f;this.codeBuf=this.codeSize=0;H.call(this)}if(!self||!self.Uint32Array)return null;var q=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),m=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,
131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),l=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),b=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,
459020,524392,524328,59E4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,
459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,
459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,
459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,
459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,
459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,
459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],a=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,
327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];n.prototype=Object.create(H.prototype);n.prototype.getBits=function(c){for(var f=this.codeSize,e=this.codeBuf,g=this.bytes,d=this.bytesPos,h;f<c;)"undefined"==typeof(h=g[d++])&&k("Bad encoding in flate stream"),e|=h<<f,f+=8;this.codeBuf=e>>c;this.codeSize=f-=c;this.bytesPos=d;return e&(1<<c)-1};n.prototype.getCode=function(c){var f=c[0],e=c[1];c=this.codeSize;for(var g=
this.codeBuf,d=this.bytes,h=this.bytesPos;c<e;){var p;"undefined"==typeof(p=d[h++])&&k("Bad encoding in flate stream");g|=p<<c;c+=8}e=f[g&(1<<e)-1];f=e>>16;e&=65535;(0==c||c<f||0==f)&&k("Bad encoding in flate stream");this.codeBuf=g>>f;this.codeSize=c-f;this.bytesPos=h;return e};n.prototype.generateHuffmanTable=function(c){for(var f=c.length,e=0,g=0;g<f;++g)c[g]>e&&(e=c[g]);for(var d=1<<e,h=new Uint32Array(d),p=1,t=0,w=2;p<=e;++p,t<<=1,w<<=1)for(var u=0;u<f;++u)if(c[u]==p){var r=0,y=t;for(g=0;g<p;++g)r=
r<<1|y&1,y>>=1;for(g=r;g<d;g+=w)h[g]=p<<16|u;++t}return[h,e]};n.prototype.readBlock=function(){function c(r,y,B,C,G){for(r=r.getBits(B)+C;0<r--;)y[t++]=G}var f=this.getBits(3);f&1&&(this.eof=!0);f>>=1;if(0==f){var e=this.bytes,g=this.bytesPos,d;"undefined"==typeof(d=e[g++])&&k("Bad block header in flate stream");var h=d;"undefined"==typeof(d=e[g++])&&k("Bad block header in flate stream");h|=d<<8;"undefined"==typeof(d=e[g++])&&k("Bad block header in flate stream");f=d;"undefined"==typeof(d=e[g++])&&
k("Bad block header in flate stream");(f|d<<8)!=(~h&65535)&&k("Bad uncompressed block length in flate stream");this.codeSize=this.codeBuf=0;d=this.bufferLength;f=this.ensureBuffer(d+h);this.bufferLength=h=d+h;for(var p=d;p<h;++p){if("undefined"==typeof(d=e[g++])){this.eof=!0;break}f[p]=d}this.bytesPos=g}else{if(1==f)g=b,d=a;else if(2==f){f=this.getBits(5)+257;d=this.getBits(5)+1;e=this.getBits(4)+4;g=Array(q.length);for(var t=0;t<e;)g[q[t++]]=this.getBits(3);g=this.generateHuffmanTable(g);t=e=0;d=
f+d;for(h=Array(d);t<d;)p=this.getCode(g),16==p?c(this,h,2,3,e):17==p?c(this,h,3,3,e=0):18==p?c(this,h,7,11,e=0):h[t++]=e=p;g=this.generateHuffmanTable(h.slice(0,f));d=this.generateHuffmanTable(h.slice(f,d))}else k("Unknown block type in flate stream");h=(f=this.buffer)?f.length:0;for(p=this.bufferLength;;){var w=this.getCode(g);if(256>w)p+1>=h&&(f=this.ensureBuffer(p+1),h=f.length),f[p++]=w;else{if(256==w){this.bufferLength=p;break}w-=257;w=m[w];var u=w>>16;0<u&&(u=this.getBits(u));e=(w&65535)+u;
w=this.getCode(d);w=l[w];u=w>>16;0<u&&(u=this.getBits(u));w=(w&65535)+u;p+e>=h&&(f=this.ensureBuffer(p+e),h=f.length);for(u=0;u<e;++u,++p)f[p]=f[p-w]}}}};return n}()})},"esri/layers/rasterFormats/Jpg":function(){define([],function(){var H=function(){function k(n){this.message="JPEG error: "+n}k.prototype=Error();k.prototype.name="JpegError";return k.constructor=k}();return function(){function k(){this.decodeTransform=null;this.colorTransform=-1}function n(a,c){for(var f=0,e=[],g,d,h=16;0<h&&!a[h-
1];)h--;e.push({children:[],index:0});var p=e[0],t;for(g=0;g<h;g++){for(d=0;d<a[g];d++){p=e.pop();for(p.children[p.index]=c[f];0<p.index;)p=e.pop();p.index++;for(e.push(p);e.length<=g;)e.push(t={children:[],index:0}),p.children[p.index]=t.children,p=t;f++}g+1<h&&(e.push(t={children:[],index:0}),p.children[p.index]=t.children,p=t)}return e[0].children}function q(a,c,f,e,g,d,h,p,t){function w(){if(0<J)return J--,F>>J&1;F=a[c++];if(255===F){var O=a[c++];if(O)throw new H("unexpected marker "+(F<<8|O).toString(16));
}J=7;return F>>>7}function u(O){for(;;){O=O[w()];if("number"===typeof O)return O;if("object"!==typeof O)throw new H("invalid huffman sequence");}}function r(O){for(var E=0;0<O;)E=E<<1|w(),O--;return E}function y(O){if(1===O)return 1===w()?1:-1;var E=r(O);return E>=1<<O-1?E:E+(-1<<O)+1}function B(O,E){var N=u(O.huffmanTableDC);N=0===N?0:y(N);O.blockData[E]=O.pred+=N;for(N=1;64>N;){var R=u(O.huffmanTableAC),W=R&15;R>>=4;if(0===W){if(15>R)break;N+=16}else N+=R,O.blockData[E+b[N]]=y(W),N++}}function C(O,
E){var N=u(O.huffmanTableDC);N=0===N?0:y(N)<<t;O.blockData[E]=O.pred+=N}function G(O,E){O.blockData[E]|=w()<<t}function x(O,E){if(0<L)L--;else for(var N=d;N<=h;){var R=u(O.huffmanTableAC),W=R&15;R>>=4;if(0===W){if(15>R){L=r(R)+(1<<R)-1;break}N+=16}else N+=R,O.blockData[E+b[N]]=y(W)*(1<<t),N++}}function v(O,E){for(var N=d,R=0,W;N<=h;){W=b[N];switch(P){case 0:R=u(O.huffmanTableAC);W=R&15;R>>=4;if(0===W)15>R?(L=r(R)+(1<<R),P=4):(R=16,P=1);else{if(1!==W)throw new H("invalid ACn encoding");Q=y(W);P=R?
2:3}continue;case 1:case 2:O.blockData[E+W]?O.blockData[E+W]+=w()<<t:(R--,0===R&&(P=2===P?3:0));break;case 3:O.blockData[E+W]?O.blockData[E+W]+=w()<<t:(O.blockData[E+W]=Q<<t,P=0);break;case 4:O.blockData[E+W]&&(O.blockData[E+W]+=w()<<t)}N++}4===P&&(L--,0===L&&(P=0))}var z=f.mcusPerLine,A=c,F=0,J=0,L=0,P=0,Q,Z=e.length,ca,da,ea,fa;p=f.progressive?0===d?0===p?C:G:0===p?x:v:B;var K=0;f=1===Z?e[0].blocksPerLine*e[0].blocksPerColumn:z*f.mcusPerColumn;for(var V,aa;K<f;){var Y=g?Math.min(f-K,g):f;for(ca=
0;ca<Z;ca++)e[ca].pred=0;L=0;if(1===Z){var I=e[0];for(fa=0;fa<Y;fa++)p(I,64*((I.blocksPerLine+1)*(K/I.blocksPerLine|0)+K%I.blocksPerLine)),K++}else for(fa=0;fa<Y;fa++){for(ca=0;ca<Z;ca++)for(I=e[ca],V=I.h,aa=I.v,da=0;da<aa;da++)for(ea=0;ea<V;ea++)p(I,64*((I.blocksPerLine+1)*((K/z|0)*I.v+da)+(K%z*I.h+ea)));K++}J=0;(I=l(a,c))&&I.invalid&&(console.log("decodeScan - unexpected MCU data, next marker is: "+I.invalid),c=I.offset);I=I&&I.marker;if(!I||65280>=I)throw new H("marker was not found");if(65488<=
I&&65495>=I)c+=2;else break}(I=l(a,c))&&I.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+I.invalid),c=I.offset);return c-A}function m(a,c){a=c.blocksPerLine;for(var f=c.blocksPerColumn,e=new Int16Array(64),g=0;g<f;g++)for(var d=0;d<a;d++){var h=void 0,p=void 0,t=void 0,w=void 0,u=void 0,r=void 0,y=void 0,B=void 0,C=u=r=w=p=h=void 0,G=void 0,x=void 0,v=void 0,z=64*((c.blocksPerLine+1)*g+d),A=e,F=c.quantizationTable,J=c.blockData;if(!F)throw new H("missing required Quantization Table.");
for(var L=0;64>L;L+=8)h=J[z+L],B=J[z+L+1],y=J[z+L+2],r=J[z+L+3],u=J[z+L+4],w=J[z+L+5],t=J[z+L+6],p=J[z+L+7],h*=F[L],0===(B|y|r|u|w|t|p)?(h=5793*h+512>>10,A[L]=h,A[L+1]=h,A[L+2]=h,A[L+3]=h,A[L+4]=h,A[L+5]=h,A[L+6]=h,A[L+7]=h):(B*=F[L+1],y*=F[L+2],r*=F[L+3],u*=F[L+4],w*=F[L+5],t*=F[L+6],p*=F[L+7],v=5793*h+128>>8,x=5793*u+128>>8,G=y,C=t,u=2896*(B-p)+128>>8,p=2896*(B+p)+128>>8,r<<=4,w<<=4,v=v+x+1>>1,x=v-x,h=3784*G+1567*C+128>>8,G=1567*G-3784*C+128>>8,C=h,u=u+w+1>>1,w=u-w,p=p+r+1>>1,r=p-r,v=v+C+1>>1,C=
v-C,x=x+G+1>>1,G=x-G,h=2276*u+3406*p+2048>>12,u=3406*u-2276*p+2048>>12,p=h,h=799*r+4017*w+2048>>12,r=4017*r-799*w+2048>>12,w=h,A[L]=v+p,A[L+7]=v-p,A[L+1]=x+w,A[L+6]=x-w,A[L+2]=G+r,A[L+5]=G-r,A[L+3]=C+u,A[L+4]=C-u);for(F=0;8>F;++F)h=A[F],B=A[F+8],y=A[F+16],r=A[F+24],u=A[F+32],w=A[F+40],t=A[F+48],p=A[F+56],0===(B|y|r|u|w|t|p)?(h=5793*h+8192>>14,h=-2040>h?0:2024<=h?255:h+2056>>4,J[z+F]=h,J[z+F+8]=h,J[z+F+16]=h,J[z+F+24]=h,J[z+F+32]=h,J[z+F+40]=h,J[z+F+48]=h,J[z+F+56]=h):(v=5793*h+2048>>12,x=5793*u+2048>>
12,G=y,C=t,u=2896*(B-p)+2048>>12,p=2896*(B+p)+2048>>12,v=(v+x+1>>1)+4112,x=v-x,h=3784*G+1567*C+2048>>12,G=1567*G-3784*C+2048>>12,C=h,u=u+w+1>>1,w=u-w,p=p+r+1>>1,r=p-r,v=v+C+1>>1,C=v-C,x=x+G+1>>1,G=x-G,h=2276*u+3406*p+2048>>12,u=3406*u-2276*p+2048>>12,p=h,h=799*r+4017*w+2048>>12,r=4017*r-799*w+2048>>12,w=h,h=v+p,p=v-p,B=x+w,t=x-w,y=G+r,w=G-r,r=C+u,u=C-u,h=16>h?0:4080<=h?255:h>>4,B=16>B?0:4080<=B?255:B>>4,y=16>y?0:4080<=y?255:y>>4,r=16>r?0:4080<=r?255:r>>4,u=16>u?0:4080<=u?255:u>>4,w=16>w?0:4080<=w?
255:w>>4,t=16>t?0:4080<=t?255:t>>4,p=16>p?0:4080<=p?255:p>>4,J[z+F]=h,J[z+F+8]=B,J[z+F+16]=y,J[z+F+24]=r,J[z+F+32]=u,J[z+F+40]=w,J[z+F+48]=t,J[z+F+56]=p)}return c.blockData}function l(a,c,f){var e=a.length-1;f=f<c?f:c;if(c>=e)return null;var g=a[c]<<8|a[c+1];if(65472<=g&&65534>=g)return{invalid:null,marker:g,offset:c};for(c=a[f]<<8|a[f+1];!(65472<=c&&65534>=c);){if(++f>=e)return null;c=a[f]<<8|a[f+1]}return{invalid:g.toString(16),marker:c,offset:f}}if(!self||!self.Uint8ClampedArray)return null;var b=
new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);k.prototype={parse:function(a){function c(){var F=a[g]<<8|a[g+1];g+=2;return F}function f(){var F=c();F=g+F-2;var J=l(a,F,g);J&&J.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+J.invalid),F=J.offset);F=a.subarray(g,F);g+=F.length;return F}function e(F){for(var J=Math.ceil(F.samplesPerLine/
8/F.maxH),L=Math.ceil(F.scanLines/8/F.maxV),P=0;P<F.components.length;P++){A=F.components[P];var Q=Math.ceil(Math.ceil(F.samplesPerLine/8)*A.h/F.maxH),Z=Math.ceil(Math.ceil(F.scanLines/8)*A.v/F.maxV);A.blockData=new Int16Array(64*L*A.v*(J*A.h+1));A.blocksPerLine=Q;A.blocksPerColumn=Z}F.mcusPerLine=J;F.mcusPerColumn=L}var g=0,d=null,h=null,p=[],t=[],w=[],u=c();if(65496!==u)throw new H("SOI not found");for(u=c();65497!==u;){switch(u){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var r=
f();65504===u&&74===r[0]&&70===r[1]&&73===r[2]&&70===r[3]&&0===r[4]&&(d={version:{major:r[5],minor:r[6]},densityUnits:r[7],xDensity:r[8]<<8|r[9],yDensity:r[10]<<8|r[11],thumbWidth:r[12],thumbHeight:r[13],thumbData:r.subarray(14,14+3*r[12]*r[13])});65518===u&&65===r[0]&&100===r[1]&&111===r[2]&&98===r[3]&&101===r[4]&&(h={version:r[5]<<8|r[6],flags0:r[7]<<8|r[8],flags1:r[9]<<8|r[10],transformCode:r[11]});break;case 65499:u=c()+g-2;for(var y;g<u;){var B=a[g++],C=new Uint16Array(64);if(0===B>>4)for(r=
0;64>r;r++)y=b[r],C[y]=a[g++];else if(1===B>>4)for(r=0;64>r;r++)y=b[r],C[y]=c();else throw new H("DQT - invalid table spec");p[B&15]=C}break;case 65472:case 65473:case 65474:if(G)throw new H("Only single frame JPEGs supported");c();var G={};G.extended=65473===u;G.progressive=65474===u;G.precision=a[g++];G.scanLines=c();G.samplesPerLine=c();G.components=[];G.componentIds={};r=a[g++];for(u=C=B=0;u<r;u++){y=a[g];var x=a[g+1]>>4;var v=a[g+1]&15;B<x&&(B=x);C<v&&(C=v);x=G.components.push({h:x,v:v,quantizationId:a[g+
2],quantizationTable:null});G.componentIds[y]=x-1;g+=3}G.maxH=B;G.maxV=C;e(G);break;case 65476:y=c();for(u=2;u<y;){B=a[g++];C=new Uint8Array(16);for(r=x=0;16>r;r++,g++)x+=C[r]=a[g];v=new Uint8Array(x);for(r=0;r<x;r++,g++)v[r]=a[g];u+=17+x;(0===B>>4?w:t)[B&15]=n(C,v)}break;case 65501:c();var z=c();break;case 65498:c();y=a[g++];r=[];for(u=0;u<y;u++){B=G.componentIds[a[g++]];var A=G.components[B];B=a[g++];A.huffmanTableDC=w[B>>4];A.huffmanTableAC=t[B&15];r.push(A)}u=a[g++];y=a[g++];B=a[g++];u=q(a,g,
G,r,z,u,y,B>>4,B&15);g+=u;break;case 65535:255!==a[g]&&g--;break;default:if(255===a[g-3]&&192<=a[g-2]&&254>=a[g-2])g-=3;else throw new H("unknown marker "+u.toString(16));}u=c()}this.width=G.samplesPerLine;this.height=G.scanLines;this.jfif=d;this.eof=g;this.adobe=h;this.components=[];for(u=0;u<G.components.length;u++){A=G.components[u];if(d=p[A.quantizationId])A.quantizationTable=d;this.components.push({output:m(G,A),scaleX:A.h/G.maxH,scaleY:A.v/G.maxV,blocksPerLine:A.blocksPerLine,blocksPerColumn:A.blocksPerColumn})}this.numComponents=
this.components.length},_getLinearizedBlockData:function(a,c){var f=this.width/a,e=this.height/c,g,d,h=0,p=this.components.length,t=a*c*p,w=new Uint8ClampedArray(t),u=new Uint32Array(a);for(d=0;d<p;d++){var r=this.components[d];var y=r.scaleX*f;var B=r.scaleY*e;h=d;var C=r.output;var G=r.blocksPerLine+1<<3;for(g=0;g<a;g++)r=0|g*y,u[g]=(r&4294967288)<<3|r&7;for(y=0;y<c;y++)for(r=0|y*B,r=G*(r&4294967288)|(r&7)<<3,g=0;g<a;g++)w[h]=C[r+u[g]],h+=p}if(c=this.decodeTransform)for(d=0;d<t;)for(a=r=0;r<p;r++,
d++,a+=2)w[d]=(w[d]*c[a]>>8)+c[a+1];return w},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0===this.colorTransform?!1:!0:1===this.colorTransform?!0:!1},_convertYccToRgb:function(a){for(var c,f,e,g=0,d=a.length;g<d;g+=3)c=a[g],f=a[g+1],e=a[g+2],a[g]=c-179.456+1.402*e,a[g+1]=c+135.459-.344*f-.714*e,a[g+2]=c-226.816+1.772*f;return a},_convertYcckToRgb:function(a){for(var c,f,e,g,d=0,h=0,p=a.length;h<p;h+=4)c=a[h],f=a[h+1],e=a[h+2],g=a[h+3],a[d++]=
-122.67195406894+f*(-6.60635669420364E-5*f+4.37130475926232E-4*e-5.4080610064599E-5*c+4.8449797120281E-4*g-.154362151871126)+e*(-9.57964378445773E-4*e+8.17076911346625E-4*c-.00477271405408747*g+1.53380253221734)+c*(9.61250184130688E-4*c-.00266257332283933*g+.48357088451265)+g*(-3.36197177618394E-4*g+.484791561490776),a[d++]=107.268039397724+f*(2.19927104525741E-5*f-6.40992018297945E-4*e+6.59397001245577E-4*c+4.26105652938837E-4*g-.176491792462875)+e*(-7.78269941513683E-4*e+.00130872261408275*c+7.70482631801132E-4*
g-.151051492775562)+c*(.00126935368114843*c-.00265090189010898*g+.25802910206845)+g*(-3.18913117588328E-4*g-.213742400323665),a[d++]=-20.810012546947+f*(-5.70115196973677E-4*f-2.63409051004589E-5*e+.0020741088115012*c-.00288260236853442*g+.814272968359295)+e*(-1.53496057440975E-5*e-1.32689043961446E-4*c+5.60833691242812E-4*g-.195152027534049)+c*(.00174418132927582*c-.00255243321439347*g+.116935020465145)+g*(-3.43531996510555E-4*g+.24165260232407);return a},_convertYcckToCmyk:function(a){for(var c,
f,e,g=0,d=a.length;g<d;g+=4)c=a[g],f=a[g+1],e=a[g+2],a[g]=434.456-c-1.402*e,a[g+1]=119.541-c+.344*f+.714*e,a[g+2]=481.816-c-1.772*f;return a},_convertCmykToRgb:function(a){for(var c,f,e,g,d=0,h=1/255,p=0,t=a.length;p<t;p+=4)c=a[p]*h,f=a[p+1]*h,e=a[p+2]*h,g=a[p+3]*h,a[d++]=255+c*(-4.387332384609988*c+54.48615194189176*f+18.82290502165302*e+212.25662451639585*g-285.2331026137004)+f*(1.7149763477362134*f-5.6096736904047315*e-17.873870861415444*g-5.497006427196366)+e*(-2.5217340131683033*e-21.248923337353073*
g+17.5119270841813)-g*(21.86122147463605*g+189.48180835922747),a[d++]=255+c*(8.841041422036149*c+60.118027045597366*f+6.871425592049007*e+31.159100130055922*g-79.2970844816548)+f*(-15.310361306967817*f+17.575251261109482*e+131.35250912493976*g-190.9453302588951)+e*(4.444339102852739*e+9.8632861493405*g-24.86741582555878)-g*(20.737325471181034*g+187.80453709719578),a[d++]=255+c*(.8842522430003296*c+8.078677503112928*f+30.89978309703729*e-.23883238689178934*g-14.183576799673286)+f*(10.49593273432072*
f+63.02378494754052*e+50.606957656360734*g-112.23884253719248)+e*(.03296041114873217*e+115.60384449646641*g-193.58209356861505)-g*(22.33816807309886*g+180.12613974708367);return a},getData:function(a,c,f){if(4<this.numComponents)throw new H("Unsupported color mode");a=this._getLinearizedBlockData(a,c);if(1===this.numComponents&&f){f=a.length;c=new Uint8ClampedArray(3*f);for(var e=0,g=0;g<f;g++){var d=a[g];c[e++]=d;c[e++]=d;c[e++]=d}return c}if(3===this.numComponents&&this._isColorConversionNeeded())return this._convertYccToRgb(a);
if(4===this.numComponents){if(this._isColorConversionNeeded())return f?this._convertYcckToRgb(a):this._convertYcckToCmyk(a);if(f)return this._convertCmykToRgb(a)}return a}};return k}()})},"esri/layers/rasterFormats/Png":function(){define(["./Zlib"],function(H){return function(){function k(q){var m,l;this.data=q;this.pos=8;this.palette=[];this.imgData=[];this.transparency={};this.animation=null;this.text={};for(l=null;;){var b=this.readUInt32();var a=q=void 0;q=[];for(a=0;4>a;++a)q.push(String.fromCharCode(this.data[this.pos++]));
q=q.join("");switch(q){case "IHDR":this.width=this.readUInt32();this.height=this.readUInt32();this.bits=this.data[this.pos++];this.colorType=this.data[this.pos++];this.compressionMethod=this.data[this.pos++];this.filterMethod=this.data[this.pos++];this.interlaceMethod=this.data[this.pos++];break;case "acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||Infinity,frames:[]};break;case "PLTE":this.palette=this.read(b);break;case "fcTL":l&&this.animation.frames.push(l);this.pos+=
4;l={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()};q=this.readUInt16();b=this.readUInt16()||100;l.delay=1E3*q/b;l.disposeOp=this.data[this.pos++];l.blendOp=this.data[this.pos++];l.data=[];break;case "IDAT":case "fdAT":"fdAT"===q&&(this.pos+=4,b-=4);q=(null!=l?l.data:void 0)||this.imgData;for(a=0;0<=b?a<b:a>b;0<=b?++a:--a)q.push(this.data[this.pos++]);break;case "tRNS":this.transparency={};switch(this.colorType){case 3:this.transparency.indexed=
this.read(b);b=255-this.transparency.indexed.length;if(0<b)for(q=0;0<=b?q<b:q>b;0<=b?++q:--q)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(b)[0];break;case 2:this.transparency.rgb=this.read(b)}break;case "tEXt":a=this.read(b);b=a.indexOf(0);q=String.fromCharCode.apply(String,a.slice(0,b));this.text[q]=String.fromCharCode.apply(String,a.slice(b+1));break;case "IEND":l&&this.animation.frames.push(l);a:{switch(this.colorType){case 0:case 3:case 4:l=1;break a;
case 2:case 6:l=3;break a}l=void 0}this.colors=l;this.hasAlphaChannel=4===(m=this.colorType)||6===m;m=this.colors+(this.hasAlphaChannel?1:0);this.pixelBitlength=this.bits*m;a:{switch(this.colors){case 1:m="DeviceGray";break a;case 3:m="DeviceRGB";break a}m=void 0}this.colorSpace=m;this.imgData=new Uint8Array(this.imgData);return;default:this.pos+=b}this.pos+=4;if(this.pos>this.data.length)throw Error("Incomplete or corrupt PNG file");}}k.load=function(q,m,l){"function"===typeof m&&(l=m);var b=new XMLHttpRequest;
b.open("GET",q,!0);b.responseType="arraybuffer";b.onload=function(){var a=new Uint8Array(b.response||b.mozResponseArrayBuffer);a=new k(a);"function"===typeof(null!=m?m.getContext:void 0)&&a.render(m);return"function"===typeof l?l(a):void 0};return b.send(null)};k.prototype.read=function(q){var m;var l=[];for(m=0;0<=q?m<q:m>q;0<=q?++m:--m)l.push(this.data[this.pos++]);return l};k.prototype.readUInt32=function(){var q=this.data[this.pos++]<<24;var m=this.data[this.pos++]<<16;var l=this.data[this.pos++]<<
8;var b=this.data[this.pos++];return q|m|l|b};k.prototype.readUInt16=function(){var q=this.data[this.pos++]<<8;var m=this.data[this.pos++];return q|m};k.prototype.decodePixels=function(q){var m,l,b,a,c,f,e,g;null==q&&(q=this.imgData);if(0===q.length)return new Uint8Array(0);q=new H(q);q=q.getBytes();var d=this.pixelBitlength/8;var h=d*this.width;var p=new Uint8Array(h*this.height);var t=q.length;for(l=a=c=0;a<t;){switch(q[a++]){case 0:for(b=m=0;m<h;b=m+=1)p[l++]=q[a++];break;case 1:for(b=f=0;f<h;b=
f+=1){m=q[a++];var w=b<d?0:p[l-d];p[l++]=(m+w)%256}break;case 2:for(b=w=0;w<h;b=w+=1){m=q[a++];var u=(b-b%d)/d;f=c&&p[(c-1)*h+u*d+b%d];p[l++]=(f+m)%256}break;case 3:for(b=g=0;g<h;b=g+=1)m=q[a++],u=(b-b%d)/d,w=b<d?0:p[l-d],f=c&&p[(c-1)*h+u*d+b%d],p[l++]=(m+Math.floor((w+f)/2))%256;break;case 4:for(b=g=0;g<h;b=g+=1){m=q[a++];u=(b-b%d)/d;w=b<d?0:p[l-d];0===c?f=e=0:(f=p[(c-1)*h+u*d+b%d],e=u&&p[(c-1)*h+(u-1)*d+b%d]);var r=w+f-e;b=Math.abs(r-w);u=Math.abs(r-f);r=Math.abs(r-e);w=b<=u&&b<=r?w:u<=r?f:e;p[l++]=
(m+w)%256}break;default:throw Error("Invalid filter algorithm: "+q[a-1]);}c++}return p};k.prototype.decodePalette=function(){var q,m,l,b,a;var c=this.palette;var f=this.transparency.indexed||[];var e=new Uint8Array((f.length||0)+c.length);var g=l=q=m=0;for(b=c.length;l<b;g=l+=3)e[m++]=c[g],e[m++]=c[g+1],e[m++]=c[g+2],e[m++]=null!=(a=f[q++])?a:255;return e};k.prototype.copyToImageData=function(q,m){var l,b;var a=this.colors;var c=null;var f=this.hasAlphaChannel;this.palette.length&&(c=null!=(l=this._decodedPalette)?
l:this._decodedPalette=this.decodePalette(),a=4,f=!0);q=q.data||q;var e=q.length;var g=c||m;l=b=0;if(1===a)for(;l<e;)a=c?4*m[l/4]:b,b=g[a++],q[l++]=b,q[l++]=b,q[l++]=b,q[l++]=f?g[a++]:this.transparency.grayscale&&this.transparency.grayscale===b?0:255,b=a;else for(;l<e;)a=c?4*m[l/4]:b,q[l++]=g[a++],q[l++]=g[a++],q[l++]=g[a++],q[l++]=f?g[a++]:this.transparency.rgb&&this.transparency.rgb[1]===g[a-3]&&this.transparency.rgb[3]===g[a-2]&&this.transparency.rgb[5]===g[a-1]?0:255,b=a};k.prototype.decode=function(){var q=
new Uint8Array(this.width*this.height*4);this.copyToImageData(q,this.decodePixels());return q};var n=function(q){(void 0).clearRect(0,0,q.width,q.height);(void 0).putImageData(q,0,0);q=new Image;q.src=(void 0).toDataURL();return q};k.prototype.decodeFrames=function(q){var m,l;if(this.animation){var b=this.animation.frames;var a=[];var c=m=0;for(l=b.length;m<l;c=++m){c=b[c];var f=q.createImageData(c.width,c.height);var e=this.decodePixels(new Uint8Array(c.data));this.copyToImageData(f,e);c.imageData=
f;a.push(c.image=n(f))}return a}};k.prototype.renderFrame=function(q,m){var l=this.animation.frames;var b=l[m];l=l[m-1];0===m&&q.clearRect(0,0,this.width,this.height);1===(null!=l?l.disposeOp:void 0)?q.clearRect(l.xOffset,l.yOffset,l.width,l.height):2===(null!=l?l.disposeOp:void 0)&&q.putImageData(l.imageData,l.xOffset,l.yOffset);0===b.blendOp&&q.clearRect(b.xOffset,b.yOffset,b.width,b.height);return q.drawImage(b.image,b.xOffset,b.yOffset)};k.prototype.animate=function(q){var m,l=this;var b=0;var a=
this.animation;var c=a.numFrames;var f=a.frames;var e=a.numPlays;return(m=function(){var g=b++%c;var d=f[g];l.renderFrame(q,g);if(1<c&&b/c<e)return l.animation._timeout=setTimeout(m,d.delay)})()};k.prototype.stopAnimation=function(){var q;return clearTimeout(null!=(q=this.animation)?q._timeout:void 0)};k.prototype.render=function(q){q._png&&q._png.stopAnimation();q._png=this;q.width=this.width;q.height=this.height;q=q.getContext("2d");if(this.animation)return this.decodeFrames(q),this.animate(q);
var m=q.createImageData(this.width,this.height);this.copyToImageData(m,this.decodePixels());return q.putImageData(m,0,0)};return k}()})},"esri/layers/rasterFormats/Raw":function(){define([],function(){return{decodeBIP:function(H,k){var n=k.pixelType,q=k.bandCount,m=[],l=k.width*k.height,b=this.getBandCount(H,k);q=q||b;var a=H.byteLength-H.byteLength%(l*this._getPixelLength(n)),c=new n(H,0,l*b),f,e,g;for(f=0;f<q;f++){var d=new n(l);for(e=0;e<l;e++)d[e]=c[e*b+f];m.push(d)}a<H.byteLength-1&&(g=this._decodeMask(H.slice(a),
k));return{pixels:m,maskData:g}},decodeBSQ:function(H,k){var n=k.pixelType,q=k.bandCount;if(void 0===q||null===q)q=this.getBandCount(H,k);var m=[],l=k.width*k.height,b=l*q,a=H.byteLength-H.byteLength%(l*this._getPixelLength(n));n=new n(H,0,b);var c;for(b=0;b<q;b++)m.push(n.subarray(b*l,(b+1)*l));a<H.byteLength-1&&(c=this._decodeMask(H.slice(a),k));return{pixels:m,maskData:c}},getBandCount:function(H,k){return Math.floor(H.byteLength/(k.width*k.height*this._getPixelLength(k.pixelType)))},_getPixelLength:function(H){var k=
1;switch(H){case Uint8Array:case Int8Array:case Uint8ClampedArray:k=1;break;case Uint16Array:case Int16Array:k=2;break;case Uint32Array:case Int32Array:case Float32Array:k=4;break;case Float64Array:k=8}return k},_decodeMask:function(H,k){var n=k.width*k.height;if(8*H.byteLength<n)return null;H=new Uint8Array(H,0,Math.ceil(n/8));k=new Uint8Array(k.width*k.height);var q=0,m=0,l=0,b=0;for(l=0;l<H.length-1;l++)for(m=H[l],b=7;0<=b;b--)k[q++]=m>>b&1;for(b=7;q<n-1;)m=H[H.length-1],k[q++]=m>>b&1,b--;return k}}})},
"esri/layers/rasterFormats/TiffDecoder":function(){define(["./Jpg","./Zlib"],function(H,k){var n=function(){var b=new ArrayBuffer(4),a=new Uint8Array(b);b=new Uint32Array(b);a[0]=1;a[1]=2;a[2]=3;a[3]=4;return 67305985===b[0]},q=function(){var b=[];b[254]="NEWSUBFILETYPE";b[255]="SUBFILETYPE";b[256]="IMAGEWIDTH";b[257]="IMAGELENGTH";b[258]="BITSPERSAMPLE";b[259]="COMPRESSION";b[262]="PHOTOMETRICINTERPRETATION";b[263]="THRESHHOLDING";b[264]="CELLWIDTH";b[265]="CELLLENGTH";b[266]="FILLORDER";b[269]=
"DOCUMENTNAME";b[270]="IMAGEDESCRIPTION";b[271]="MAKE";b[272]="MODEL";b[273]="STRIPOFFSETS";b[274]="ORIENTATION";b[277]="SAMPLESPERPIXEL";b[278]="ROWSPERSTRIP";b[279]="STRIPBYTECOUNTS";b[280]="MINSAMPLEVALUE";b[281]="MAXSAMPLEVALUE";b[282]="XRESOLUTION";b[283]="YRESOLUTION";b[284]="PLANARCONFIGURATION";b[285]="PAGENAME";b[286]="XPOSITION";b[287]="YPOSITION";b[288]="FREEOFFSETS";b[289]="FREEBYTECOUNTS";b[290]="GRAYRESPONSEUNIT";b[291]="GRAYRESPONSECURVE";b[292]="T4OPTIONS";b[293]="T6OPTIONS";b[296]=
"RESOLUTIONUNIT";b[297]="PAGENUMBER";b[300]="COLORRESPONSEUNIT";b[301]="TRANSFERFUNCTION";b[305]="SOFTWARE";b[306]="DATETIME";b[315]="ARTIST";b[316]="HOSTCOMPUTER";b[317]="PREDICTOR";b[318]="WHITEPOINT";b[319]="PRIMARYCHROMATICITIES";b[320]="COLORMAP";b[321]="HALFTONEHINTS";b[322]="TILEWIDTH";b[323]="TILELENGTH";b[324]="TILEOFFSETS";b[325]="TILEBYTECOUNTS";b[326]="BADFAXLINES";b[327]="CLEANFAXDATA";b[328]="CONSECUTIVEBADFAXLINES";b[330]="SUBIFD";b[332]="INKSET";b[333]="INKNAMES";b[334]="NUMBEROFINKS";
b[336]="DOTRANGE";b[337]="TARGETPRINTER";b[338]="EXTRASAMPLES";b[339]="SAMPLEFORMAT";b[340]="SMINSAMPLEVALUE";b[341]="SMAXSAMPLEVALUE";b[342]="TRANSFERRANGE";b[347]="JPEGTABLES";b[512]="JPEGPROC";b[513]="JPEGIFOFFSET";b[514]="JPEGIFBYTECOUNT";b[515]="JPEGRESTARTINTERVAL";b[517]="JPEGLOSSLESSPREDICTORS";b[518]="JPEGPOINTTRANSFORM";b[519]="JPEGQTABLES";b[520]="JPEGDCTABLES";b[521]="JPEGACTABLES";b[529]="YCBCRCOEFFICIENTS";b[530]="YCBCRSUBSAMPLING";b[531]="YCBCRPOSITIONING";b[532]="REFERENCEBLACKWHITE";
b[33550]="GEOPIXELSCALE";b[33922]="GEOTIEPOINTS";b[33432]="COPYRIGHT";b[42112]="GDAL_METADATA";b[42113]="GDAL_NODATA";b[50844]="RPCCOEFFICIENT";b[34735]="GEOKEYDIRECTORY";b[34736]="GEODOUBLEPARAMS";b[34737]="GEOASCIIPARAMS";return b}(),m=[0,1,1,2,4,8,1,1,2,4,8,4,8],l=function(b,a){var c="UNKNOWN";3===b?c="F32":1===b?8>=a?c="U8":16>=a?c="U16":32>=a&&(c="U32"):2===b&&(8>=a?c="S8":16>=a?c="S16":32>=a&&(c="S32"));return c};return{decode:function(b){var a=new DataView(b,0,8),c=a.getUint16(0,!1);if(18761===
c)var f=!0;else if(19789===c)f=!1;else throw"unexpected endianess byte";if(42!==a.getUint16(2,f))throw"unexpected tiff identifier";var e=a.getUint32(4,f);var g=f;var d,h;var p=e;for(var t=[];p;){var w=(new DataView(b,p,2)).getUint16(0,g);var u=p+2;p=(new DataView(b,u+12*w,4)).getUint32(0,g);var r={};for(d=0;d<w;d++){var y=new DataView(b,u,12);var B=y.getUint16(0,g);var C=y.getUint16(2,g);var G=y.getUint32(4,g);var x=y.getUint32(8,g);u+=12;if(!(7===C||12<C)){var v=h={fieldTag:B,fieldType:C,fieldValueCount:G,
fieldValueOffset:x},z=void 0,A=void 0,F=b,J=g,L=[],P=h.fieldType,Q=h.fieldValueCount,Z=h.fieldValueOffset,ca=Z,da=m[P],ea=8*da,fa=Q*da,K=Q*m[P]*8;if(32>=K)if(J||(Z>>>=32-K),1===Q)L=[Z];else for(z=0;z<Q;z++)L.push(Z<<ea*z>>>32-ea);else for(ca=Z;ca<Z+fa;ca+=da){switch(P){case 1:A=(new DataView(F,ca,1)).getUint8(0);break;case 2:A=(new DataView(F,ca,1)).getUint8(0);break;case 3:A=(new DataView(F,ca,2)).getUint16(0,J);break;case 4:A=(new DataView(F,ca,4)).getUint32(0,J);break;case 5:A=(new DataView(F,
ca,4)).getUint32(0,J)/(new DataView(F,ca+4,4)).getUint32(0,J);break;case 6:A=(new DataView(F,ca,1)).getInt8(0);break;case 8:A=(new DataView(F,ca,2)).getInt16(0,J);break;case 9:A=(new DataView(F,ca,4)).getInt32(0,J);break;case 10:A=(new DataView(F,ca,4)).getInt32(0,J)/(new DataView(F,ca+4,4)).getInt32(0,J);break;case 11:A=(new DataView(F,ca,4)).getFloat32(0,J);break;case 12:A=(new DataView(F,ca,8)).getFloat64(0,J);break;case 7:A=null;break;default:A=null}L.push(A)}if(2===P){var V="",aa=L;L=[];for(z=
0;z<aa.length;z++)0===aa[z]&&""!==V?(L.push(V),V=""):V+=String.fromCharCode(aa[z]);""===V&&0!==L.length||L.push(V)}v.fieldValues=L;var Y=r,I=q[B];void 0===I&&(I="unknown"+B);Y[I]={type:C,values:h.fieldValues}}}t.push(r)}if(0===t.length)throw"no valid image file directory";var O,E=t[0],N=void 0===E.GDAL_NODATA||null===E.GDAL_NODATA?null:parseFloat(E.GDAL_NODATA.values[0]);if(E.TILEOFFSETS){var R=n()===g,W=E.TILEOFFSETS?E.TILEOFFSETS.values:void 0;if(void 0===W)var ha=void 0;else{var oa=E.TILEBYTECOUNTS.values,
ma=E.TILEWIDTH.values[0],T=E.TILELENGTH.values[0],ba=E.IMAGEWIDTH.values[0],na=E.IMAGELENGTH.values[0],ia=ba*na,pa=E.BITSPERSAMPLE.values[0],D=E.SAMPLESPERPIXEL.values[0],M=E.SAMPLEFORMAT?E.SAMPLEFORMAT.values[0]:1,X=l(M,pa);if(1!==(E.PLANARCONFIGURATION?E.PLANARCONFIGURATION.values[0]:1))throw console.log("can only handle PLANARCONFIGURATION\x3d1"),"can only handle PLANARCONFIGURATION\x3d1";var U=E.COMPRESSION?E.COMPRESSION.values[0]:1;if(1!==U&&6!==U&&8!==U&&32946!==U)throw console.log("this compression is not supported at this moment"),
"this compression is not supported at this moment";if(3<M)ha=void 0;else{if(3===M){var ka=new Float32Array(ia*D);var S=Float32Array}else 1===M?8>=pa?(ka=new Uint8Array(ia*D),S=Uint8Array):16>=pa?(ka=new Uint16Array(ia*D),S=Uint16Array):32>=pa&&(ka=new Uint32Array(ia*D),S=Uint32Array):2===M&&(8>=pa?(ka=new Int8Array(ia*D),S=Int8Array):16>=pa?(ka=new Int16Array(ia*D),S=Int16Array):32>=pa&&(ka=new Int32Array(ia*D),S=Int32Array));var ja,la,qa,ta,Ba,wa=Math.ceil(ba/ma);if(0===pa%8)for(ja=0;ja<W.length;ja++){var ua=
Math.floor(ja/wa)*T;var ra=ja%wa*ma;var sa=(ua*ba+ra)*D;if("U8"===X||"S8"===X||R)if(8===U||32946===U){var va=new Uint8Array(b,W[ja],oa[ja]);var za=new k(va);var Oa=za.getBytes();var Ea=new ArrayBuffer(Oa.length);va=new Uint8Array(Ea);va.set(Oa);va.length!==ma*T*D*pa/8&&console.log("tile byte counts is different than expected")}else if(6===U){va=new Uint8Array(b,W[ja],oa[ja]);var Aa=new H;Aa.parse(va);var Wa=Aa.getData(Aa.width,Aa.height);Ea=new ArrayBuffer(Wa.length);va=new Uint8Array(Ea);va.set(Wa)}else 1===
U&&(oa[ja]!==ma*T*D*pa/8&&console.log("tile byte counts is different than expected"),Ea=b.slice(W[ja],W[ja]+oa[ja]));else{if(8===U||32946===U){va=new Uint8Array(b,W[ja],oa[ja]);za=new k(va);va=za.getBytes();Ea=new ArrayBuffer(va.length);var Pa=new Uint8Array(Ea);va.length!==ma*T*D*pa/8&&console.log("tile byte counts is different than expected")}else 1===U&&(oa[ja]!==ma*T*D*pa/8&&console.log("tile byte counts is different than expected"),Ea=new ArrayBuffer(oa[ja]),va=new Uint8Array(b,W[ja],oa[ja]),
Pa=new Uint8Array(Ea));switch(X){case "U16":case "S16":for(qa=0;qa<va.length;qa+=2)Pa[qa]=va[qa+1],Pa[qa+1]=va[qa];break;case "U32":case "S32":case "F32":for(qa=0;qa<va.length;qa+=4)Pa[qa]=va[qa+3],Pa[qa+1]=va[qa+2],Pa[qa+2]=va[qa+1],Pa[qa+3]=va[qa]}}var hb=new S(Ea);var ab=0;var bb=sa;var ib=Math.min(ma,ba-ra);var jb=Math.min(T,na-ua);for(ta=0;ta<jb;ta++)for(bb=sa+ta*ba*D,ab=ta*ma*D,Ba=0;Ba<ib*D;Ba++,bb++,ab++)ka[bb]=hb[ab]}var Xa={width:ba,height:na,pixelType:X};if(1===D)Xa.pixels=[ka];else for(Xa.pixels=
[],ja=0;ja<D;ja++){var db=new S(ia);for(la=0;la<ia;la++)db[la]=ka[la*D+ja];Xa.pixels.push(db)}ha=Xa}}}else if(E.STRIPOFFSETS){var kb=n()===g,Ja=E.STRIPOFFSETS?E.STRIPOFFSETS.values:void 0;if(void 0===Ja)ha=void 0;else{var Ka=E.STRIPBYTECOUNTS.values,Ra=E.ROWSPERSTRIP.values,La=E.IMAGEWIDTH.values[0],Sa=E.IMAGELENGTH.values[0],Ma=La*Sa,Fa=E.BITSPERSAMPLE.values[0],Da=E.SAMPLESPERPIXEL.values[0],Ta=E.SAMPLEFORMAT?E.SAMPLEFORMAT.values[0]:1,Ya=l(Ta,Fa);if(1!==(E.PLANARCONFIGURATION?E.PLANARCONFIGURATION.values[0]:
1))throw console.log("can only handle PLANARCONFIGURATION\x3d1"),"can only handle PLANARCONFIGURATION\x3d1";var Ga=E.COMPRESSION?E.COMPRESSION.values[0]:1;if(1!==Ga&&6!==Ga&&8!==Ga&&32946!==Ga)throw console.log("compressed tiff is not supported at this moment"),"compressed tiff is not supported at this moment";if(3<Ta)ha=void 0;else{if(3===Ta){var Ha=new Float32Array(Ma*Da);var Na=Float32Array}else 1===Ta?8>=Fa?(Ha=new Uint8Array(Ma*Da),Na=Uint8Array):16>=Fa?(Ha=new Uint16Array(Ma*Da),Na=Uint16Array):
32>=Fa&&(Ha=new Uint32Array(Ma*Da),Na=Uint32Array):2===Ta&&(8>=Fa?(Ha=new Int8Array(Ma*Da),Na=Int8Array):16>=Fa?(Ha=new Int16Array(Ma*Da),Na=Int16Array):32>=Fa&&(Ha=new Int32Array(La*Sa*Da),Na=Int32Array));var xa,Ua,Ca,Va=Ra;if(0===Fa%8)for(xa=0;xa<Ja.length;xa++){var lb=xa*Ra*La*Da;Va=(xa+1)*Ra>Sa?Sa-xa*Ra:Ra;if("U8"===Ya||"S8"===Ya||kb)if(8===Ga||32946===Ga){var ya=new Uint8Array(b,Ja[xa],Ka[xa]);var cb=new k(ya);var eb=cb.getBytes();var Ia=new ArrayBuffer(eb.length);ya=new Uint8Array(Ia);ya.set(eb);
ya.length!==Va*La*Da*Fa/8&&console.log("strip byte counts is different than expected")}else if(6===Ga){ya=new Uint8Array(b,Ja[xa],Ka[xa]);var Za=new H;Za.parse(ya);var fb=Za.getData(Za.width,Za.height);Ia=new ArrayBuffer(fb.length);ya=new Uint8Array(Ia);ya.set(fb)}else 1===Ga&&(Ka[xa]!==Va*La*Da*Fa/8&&console.log("strip byte counts is different than expected"),Ia=b.slice(Ja[xa],Ja[xa]+Ka[xa]));else{if(6===Ga||8===Ga||32946===Ga){ya=new Uint8Array(b,Ja[xa],Ka[xa]);cb=new k(ya);ya=cb.getBytes();Ia=
new ArrayBuffer(ya.length);var Qa=new Uint8Array(Ia);ya.length!==Va*La*Da*Fa/8&&console.log("strip byte counts is different than expected")}else 1===Ga&&(Ka[xa]!==Va*La*Da*Fa/8&&console.log("strip byte counts is different than expected"),Ia=new ArrayBuffer(Ka[xa]),ya=new Uint8Array(b,Ja[xa],Ka[xa]),Qa=new Uint8Array(Ia));switch(Ya){case "U16":case "S16":for(Ca=0;Ca<ya.length;Ca+=2)Qa[Ca]=ya[Ca+1],Qa[Ca+1]=ya[Ca];break;case "U32":case "S32":case "F32":for(Ca=0;Ca<ya.length;Ca+=4)Qa[Ca]=ya[Ca+3],Qa[Ca+
1]=ya[Ca+2],Qa[Ca+2]=ya[Ca+1],Qa[Ca+3]=ya[Ca]}}var mb=new Na(Ia);Ha.set(mb,lb)}var $a={width:La,height:Sa,pixelType:Ya};if(1===Da)$a.pixels=[Ha];else for($a.pixels=[],xa=0;xa<Da;xa++){var gb=new Na(Ma);for(Ua=0;Ua<Ma;Ua++)gb[Ua]=Ha[Ua*Da+xa];$a.pixels.push(gb)}ha=$a}}}if(null!==N){ha.maskData=new Uint8Array(ha.width*ha.height);if(1E24<Math.abs(N))for(O=0;O<ha.width*ha.height;O++)ha.maskData[O]=1E-6>Math.abs((ha.pixels[0][O]-N)/N)?0:1;else for(O=0;O<ha.width*ha.height;O++)ha.maskData[O]=ha.pixels[0][O]===
N?0:1;ha.noDataValue=N}return ha}}})},"esri/layers/rasterLib/tile/RasterHandler":function(){define("require exports module dojo/Deferred dojo/promise/all ../../PixelBlock ../../vectorTiles/core/workers ../../vectorTiles/core/promiseUtils ../../vectorTiles/core/requireUtils ../../vectorTiles/request ../../rasterLib/function/rasterFunctionHelper ../../rasterLib/renderer/rasterRendererHelper".split(" "),function(H,k,n,q,m,l,b,a,c,f,e,g){function d(h){var p=new q;m(h).then(function(t){p.resolve()});return p.promise}
return function(){function h(p){this.customModules=p&&p.customModules}h.prototype.destroy=function(){this.stop();this.customModules=this.rasterLayer=null};h.prototype.start=function(){this.stop();var p=new q,t=0,w=this.customModules?this.customModules.length+1:1,u=c.getAbsMid("esri/layers/rasterLib/tile/RasterWorker",H,n),r=b.open(u,{client:this}).then(function(y){this._connection=y;t++;t===w&&(this._connected=!0,p.resolve())}.bind(this));this._openDL=[r];this.customModules&&this.customModules.forEach(function(y){r=
b.open(y,{client:this}).then(function(B){t++;t===w&&(this._connected=!0,p.resolve())});this._openDL.push(r);console.log(y)}.bind(this));return this._connectionPromise=p.promise};h.prototype.stop=function(){this._openDL?this._openDL.forEach(function(p){p.isFulfilled()||p.cancel()}.bind(this)):this._connectionPromise&&!this._connectionPromise.isFulfilled()&&this._connectionPromise.cancel();this._connection&&(this._connection.close(),this._connection=null)};h.prototype.decode=function(p){if(!this._connectionPromise.isFulfilled()||
!this._connection)return a.reject(Error("no connection"));var t={id:null};return this._connection.invoke("decode",p,[],t).then(function(w){w.targetWorker=t;return w})};h.prototype.process=function(p){if(!this._connectionPromise.isFulfilled()||!this._connection)return a.reject(Error("no connection"));var t={id:null};p.layerId=this.rasterLayer.layerId;var w=new q;this._connection.invoke("process",p,[],t).then(function(u){u.targetWorker=t;u.src?Object.keys(u.src).forEach(function(r){u.src[r].pixelBlock=
new l(u.src[r].pixelBlock)}):u.src=null;u.pixelBlock&&(u.pixelBlock=new l(u.pixelBlock));w.resolve(u)});return w.promise};h.prototype.render=function(p){if(!this._connectionPromise.isFulfilled()||!this._connection)return a.reject(Error("no connection"));var t={id:null};p.layerId=this.rasterLayer.layerId;return this._connection.invoke("render",p,[],t).then(function(w){w.targetWorker=t;w.pixelBlock=w.pixelBlock?new l(w.pixelBlock):null;return w})};h.prototype.setLayer=function(p){if(!this._connectionPromise.isFulfilled()||
!this._connection)return a.reject(Error("no connection"));this.rasterLayer=p;p=this._connection.broadcast("setLayer",p,[],{id:null});return d(p)};h.prototype.setRasterFunction=function(p){if(!this._connectionPromise.isFulfilled()||!this._connection)return a.reject(Error("no connection"));p=this._connection.broadcast("setRasterFunction",p,[],{id:null});return d(p)};h.prototype.setRasterRenderer=function(p){if(!this._connectionPromise.isFulfilled()||!this._connection)return a.reject(Error("no connection"));
p=this._connection.broadcast("setRasterRenderer",p,[],{id:null});return d(p)};return h}()})},"esri/layers/vectorTiles/core/workers":function(){define(["require","exports","./workers/workers"],function(H,k,n){Object.defineProperty(k,"__esModule",{value:!0});for(var q in n)k.hasOwnProperty(q)||(k[q]=n[q])})},"esri/layers/vectorTiles/core/workers/workers":function(){define("require exports dojo/sniff dojo/promise/all ../Logger ../promiseUtils ./Connection ./RemoteClient ./WorkerOwner".split(" "),function(H,
k,n,q,m,l,b,a,c){function f(){if(t)return t;for(var w=e+g,u=[],r=function(B){var C=c.create(B).then(function(G){return p[B]=G});u.push(C)},y=0;y<w;y++)r(y);return t=q(u).then(function(){})}Object.defineProperty(k,"__esModule",{value:!0});k.Connection=b;k.RemoteClient=a;(b=navigator.hardwareConcurrency)||(b=n("safari")&&n("mac")||n("trident")?8:2);var e=n("esri-workers-debug")?1:Math.max(1,Math.ceil(b/2)),g=n("esri-workers-debug")?1:Math.max(1,Math.floor(b/2)),d=m.getLogger("esri.core.workers"),h=
0,p=[];k.initialize=function(){f()};k.open=function(w,u,r){void 0===u&&(u={});if(Array.isArray(w))return new k.Connection(w.map(function(C){return new k.RemoteClient(C,u.client)}));if("string"!==typeof w){d.warn("workers-open:signature-deprecated","DEPRECATED: workers.open() changed signature.");var y=w;w=u;u={client:y,strategy:r?"dedicated":"distributed"}}var B=u.strategy||"distributed";return"local"===B?l.create(function(C){H([w],function(G){C(k.RemoteClient.connect(G))})}).then(function(C){return new k.Connection([new k.RemoteClient(C,
u.client)])}):f().then(function(){if("dedicated"===B){var C=e+h++;h%=g;return p[C].open(w).then(function(G){return new k.Connection([new k.RemoteClient(G,u.client)])})}return l.all(p.map(function(G){return G.open(w)})).then(function(G){return new k.Connection(G.map(function(x){return new k.RemoteClient(x,u.client)}))})})};k.terminate=function(){for(var w=0;w<p.length;w++)p[w]&&p[w].terminate();p.length=0};var t})},"esri/layers/vectorTiles/core/Logger":function(){define(["require","exports","dojo/has"],
function(H,k,n){var q={info:0,warn:1,error:2};H=function(){function m(l){void 0===l&&(l={});this.module=l.module||"";this.writer=l.writer||null;this.level=l.level||null;null!=l.enabled&&(this.enabled=!!l.enabled);m._loggers[this.module]=this;l=this.module.lastIndexOf(".");-1!==l&&(this.parent=m.getLogger(this.module.slice(0,l)))}m.prototype.log=function(l){for(var b=[],a=1;a<arguments.length;a++)b[a-1]=arguments[a];this._isEnabled()&&this._matchLevel(l)&&(a=this._inheritedWriter())&&a.apply(void 0,
[l,this.module].concat(b))};m.prototype.error=function(){for(var l=[],b=0;b<arguments.length;b++)l[b]=arguments[b];this.log.apply(this,["error"].concat(l))};m.prototype.warn=function(){for(var l=[],b=0;b<arguments.length;b++)l[b]=arguments[b];this.log.apply(this,["warn"].concat(l))};m.prototype.info=function(){for(var l=[],b=0;b<arguments.length;b++)l[b]=arguments[b];this.log.apply(this,["info"].concat(l))};m.prototype.getLogger=function(l){return m.getLogger(this.module+"."+l)};m.getLogger=function(l){var b=
m._loggers[l];b||(b=new m({module:l}));return b};m.prototype._parentWithMember=function(l,b){for(var a=this;a&&null==a[l];)a=a.parent;return a?a[l]:b};m.prototype._inheritedWriter=function(){return this._parentWithMember("writer",this._consoleWriter)};m.prototype._consoleWriter=function(l,b){for(var a=[],c=2;c<arguments.length;c++)a[c-2]=arguments[c];console[l].apply(console,["["+b+"]"].concat(a))};m.prototype._matchLevel=function(l){return q[this._parentWithMember("level","error")]<=q[l]};m.prototype._isEnabled=
function(){return this._parentWithMember("enabled",!0)};m._loggers={};return m}();k=H.getLogger("esri");n("dojo-debug-messages")?k.level="info":k.level="warn";return H})},"esri/layers/vectorTiles/core/promiseUtils":function(){define("require exports dojo/Deferred dojo/when dojo/promise/all ./Error".split(" "),function(H,k,n,q,m,l){function b(a){if(a){if("function"!==typeof a.forEach){var c=Object.keys(a),f=c.map(function(h){return a[h]});return b(f).then(function(h){var p={};c.forEach(function(t,
w){return p[t]=h[w]});return p})}var e=new n,g=[],d=a.length;0===d&&e.resolve(g);a.forEach(function(h){var p={promise:h};g.push(p);h.then(function(t){p.value=t}).catch(function(t){p.error=t}).then(function(){--d;0===d&&e.resolve(g)})});return e.promise}}Object.defineProperty(k,"__esModule",{value:!0});k.all=function(a){return m(a)};k.filter=function(a,c){var f=a.slice();return m(a.map(function(e,g){return c(e,g)})).then(function(e){return f.filter(function(g,d){return e[d]})})};k.eachAlways=b;k.create=
function(a,c){var f=new n(c);a(function(e){void 0===e&&(e=null);return q(e).then(f.resolve)},f.reject);return f.promise};k.reject=function(a){var c=new n;c.reject(a);return c.promise};k.resolve=function(a){void 0===a&&(a=null);var c=new n;c.resolve(a);return c.promise};k.after=function(a,c){void 0===c&&(c=null);var f=0,e=new n(function(){f&&(clearTimeout(f),f=0)});f=setTimeout(function(){e.resolve(c)},a);return e.promise};k.timeout=function(a,c,f){var e=0,g=new n(a.cancel);a.then(function(d){g.isFulfilled()||
(g.resolve(d),e&&(clearTimeout(e),e=0))});a.catch(function(d){g.isFulfilled()||(g.reject(d),e&&(clearTimeout(e),e=0))});e=setTimeout(function(){var d=f||new l("promiseUtils:timeout","The wrapped promise did not resolve within "+c+" ms");g.reject(d)},c);return g.promise};k.wrapCallback=function(a){var c=!1,f=new n(function(){return c=!0});a(function(e){c||f.resolve(e)});return f.promise};k.isThenable=function(a){return a&&"function"===typeof a.then};k.when=function(a){return q(a)}})},"esri/layers/vectorTiles/core/Error":function(){define(["require",
"exports","./tsSupport/extendsHelper","./lang","./Message"],function(H,k,n,q,m){H=function(l){function b(a,c,f){var e=l.call(this,a,c,f)||this;return e instanceof b?e:new b(a,c,f)}n(b,l);b.prototype.toJSON=function(){return{name:this.name,message:this.message,details:q.clone(this.details),dojoType:this.dojoType}};b.fromJSON=function(a){var c=new b(a.name,a.message,a.details);null!=a.dojoType&&(c.dojoType=a.dojoType);return c};return b}(m);H.prototype.type="error";return H})},"esri/layers/vectorTiles/core/tsSupport/extendsHelper":function(){define([],
function(){return function(){var H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,n){k.__proto__=n}||function(k,n){for(var q in n)n.hasOwnProperty(q)&&(k[q]=n[q])};return function(k,n){function q(){this.constructor=k}H(k,n);k.prototype=null===n?Object.create(n):(q.prototype=n.prototype,new q)}}()})},"esri/layers/vectorTiles/core/lang":function(){define("dojo/_base/kernel dojo/_base/lang dojo/date dojo/number dojo/date/locale dojo/i18n!../nls/common".split(" "),function(H,k,n,q,
m,l){function b(h){return void 0!==h&&null!==h}function a(h){return b(h)?h:""}function c(h,p,t){var w=t.match(/([^\(]+)(\([^\)]+\))?/i),u=k.trim(w[1]);t=p[h];w=JSON.parse((w[2]?k.trim(w[2]):"{}").replace(/^\(/,"{").replace(/\)$/,"}").replace(/([{,])\s*([0-9a-zA-Z_]+)\s*:/gi,'$1"$2":').replace(/"\s*:\s*'/gi,'":"').replace(/'\s*(,|\})/gi,'"$1'));var r=w.utcOffset;if(-1===g.indexOf(u))u=k.getObject(u),k.isFunction(u)&&(t=u(t,h,p,w));else if("number"===typeof t||"string"===typeof t&&t&&!isNaN(Number(t)))switch(t=
Number(t),u){case "NumberFormat":h=k.mixin({},w);p=parseFloat(h.places);if(isNaN(p)||0>p)h.places=Infinity;return q.format(t,h);case "DateString":t=new Date(t);if(w.local||w.systemLocale)return w.systemLocale?t.toLocaleDateString()+(w.hideTime?"":" "+t.toLocaleTimeString()):t.toDateString()+(w.hideTime?"":" "+t.toTimeString());t=t.toUTCString();w.hideTime&&(t=t.replace(/\s+\d\d:\d\d:\d\d\s+(utc|gmt)/i,""));return t;case "DateFormat":return t=new Date(t),b(r)&&(t=n.add(t,"minute",t.getTimezoneOffset()-
r)),m.format(t,w)}return a(t)}function f(h,p){var t;if(p)for(t in h)h.hasOwnProperty(t)&&(void 0===h[t]?delete h[t]:h[t]instanceof Object&&f(h[t],!0));else for(t in h)h.hasOwnProperty(t)&&void 0===h[t]&&delete h[t];return h}function e(h){if(!h||"object"!=typeof h||k.isFunction(h))return h;if(h instanceof Int8Array||h instanceof Uint8Array||h instanceof Uint8ClampedArray||h instanceof Int16Array||h instanceof Int32Array||h instanceof Uint16Array||h instanceof Uint32Array||h instanceof Float32Array||
h instanceof Float64Array||h instanceof Date)return new h.constructor(h);if(h instanceof ArrayBuffer)return h.slice(0,h.byteLength);if("function"===typeof h.clone)h=h.clone();else if("function"===typeof h.map&&"function"===typeof h.forEach)h=h.map(e);else if("function"===typeof h.notifyChange&&"function"===typeof h.watch)h=h.clone();else{var p={},t,w={};for(t in h){var u=h[t];var r=!(t in w)||w[t]!==u;if(!(t in p)||p[t]!==u&&r)p[t]=e?e(u):u}h=p}return h}var g=["NumberFormat","DateString","DateFormat"],
d=/<\/?[^>]+>/g;return{equals:function(h,p){return h===p||"number"===typeof h&&isNaN(h)&&"number"===typeof p&&isNaN(p)||k.isFunction((h||{}).getTime)&&k.isFunction((p||{}).getTime)&&h.getTime()==p.getTime()||k.isFunction((h||{}).equals)&&h.equals(p)||k.isFunction((p||{}).equals)&&p.equals(h)||!1},mixin:k.mixin,valueOf:function(h,p){for(var t in h)if(h[t]==p)return t;return null},stripTags:function(h){if(h){var p=typeof h;if("string"===p)h=h.replace(d,"");else if("object"===p)for(var t in h)(p=h[t])&&
"string"===typeof p&&(p=p.replace(d,"")),h[t]=p}return h},substitute:function(h,p,t){if(b(t))if(k.isObject(t)){var w=t.first;var u=t.dateFormat;var r=t.numberFormat}else w=t;if(p&&"{*}"!==p)return k.replace(p,k.hitch({obj:h},function(B,C){B=C.split(":");return 1<B.length?(C=B[0],B.shift(),c(C,this.obj,B.join(":"))):u&&-1!==(u.properties||[]).indexOf(C)?c(C,this.obj,u.formatter||"DateString"):r&&-1!==(r.properties||[]).indexOf(C)?c(C,this.obj,r.formatter||"NumberFormat"):a(this.obj[C])}));p=[];var y;
p.push('\x3ctable class\x3d"esri-widget__table" summary\x3d"'+l.fieldsSummary+'"\x3e\x3ctbody\x3e');for(y in h)if(t=h[y],u&&-1!==(u.properties||[]).indexOf(y)?t=c(y,h,u.formatter||"DateString"):r&&-1!==(r.properties||[]).indexOf(y)&&(t=c(y,h,r.formatter||"NumberFormat")),p.push("\x3ctr\x3e\x3cth\x3e"+y+"\x3c/th\x3e\x3ctd\x3e"+a(t)+"\x3c/td\x3e\x3c/tr\x3e"),w)break;p.push("\x3c/tbody\x3e\x3c/table\x3e");return p.join("")},filter:function(h,p,t){p=[k.isString(h)?h.split(""):h,t||H.global,k.isString(p)?
new Function("item","index","array",p):p];t={};var w;h=p[0];for(w in h)p[2].call(p[w],h[w],w,h)&&(t[w]=h[w]);return t},startsWith:function(h,p,t){t=t||0;return h.indexOf(p,t)===t},endsWith:function(h,p,t){if("number"!==typeof t||!isFinite(t)||Math.floor(t)!==t||t>h.length)t=h.length;t-=p.length;h=h.indexOf(p,t);return-1!==h&&h===t},isDefined:b,fixJson:f,clone:e}})},"esri/layers/vectorTiles/core/Message":function(){define(["require","exports","dojo/string"],function(H,k,n){return function(){function q(m,
l,b){this instanceof q&&(this.name=m,this.message=l&&n.substitute(l,b,function(a){return null==a?"":a})||"",this.details=b)}q.prototype.toString=function(){return"["+this.name+"]: "+this.message};return q}()})},"esri/layers/vectorTiles/core/workers/Connection":function(){define(["require","exports","../promiseUtils"],function(H,k,n){return function(){function q(m){this._clientIdx=0;this._clients=m}q.prototype.broadcast=function(m,l,b){for(var a=[],c=0,f=this._clients;c<f.length;c++)a.push(f[c].invoke(m,
l,b));return a};q.prototype.close=function(){for(var m=0,l=this._clients;m<l.length;m++)l[m].close();this._clients=[]};q.prototype.invoke=function(m,l,b,a){var c=a&&a.client;if(!this._clients||!this._clients.length)return n.reject(Error("Connection closed"));null!=c&&-1!==this._clients.indexOf(c)||this._clients.some(function(f){return f.isBusy()?!1:(c=f,!0)})||(this._clientIdx=(this._clientIdx+1)%this._clients.length,c=this._clients[this._clientIdx]);m=c.invoke(m,l,b);a&&(a.client=c);return m};q.prototype.openPorts=
function(){return n.all(this._clients.map(function(m){return m.openPort()}))};return q}()})},"esri/layers/vectorTiles/core/workers/RemoteClient":function(){define("require exports dojo/Deferred ../Error ../promiseUtils ./utils".split(" "),function(H,k,n,q,m,l){function b(h,p){h["delete"](p)}var a=l.MessageType.CLOSE,c=l.MessageType.CANCEL,f=l.MessageType.INVOKE,e=l.MessageType.RESPONSE,g=l.MessageType.OPEN_PORT,d=function(){function h(p){this._timer=null;this._cancelledJobIds=new Set;this._invokeMessages=
[];this._invoke=p;this._timer=null;this._process=this._process.bind(this)}h.prototype.push=function(p){p.type===l.MessageType.CANCEL?this._cancelledJobIds.add(p.jobId):(this._invokeMessages.push(p),null===this._timer&&(this._timer=setTimeout(this._process,0)))};h.prototype.clear=function(){this._invokeMessages.length=0;this._cancelledJobIds.clear();this._timer=null};h.prototype._process=function(){this._timer=null;for(var p=0,t=this._invokeMessages;p<t.length;p++){var w=t[p];this._cancelledJobIds.has(w.jobId)||
this._invoke(w)}this._cancelledJobIds.clear();this._invokeMessages.length=0};return h}();return function(){function h(p,t,w){this._outJobs=new Map;this._inJobs=new Map;this._queue=new d(this._onInvoke.bind(this));this._onMessage=this._onMessage.bind(this);this._client=t;this._port=p;this._port.addEventListener("message",this._onMessage);this._port.start();this._channel=w}h.connect=function(p){var t=new MessageChannel;p="function"===typeof p?new p:"default"in p&&"function"===typeof p.default?new p.default:
p;p.remoteClient=new h(t.port1,p,t);return t.port2};h.prototype.close=function(){this._post({type:a});this._close()};h.prototype.isBusy=function(){return 0<this._outJobs.size};h.prototype.invoke=function(p,t,w){var u=this;if(!this._port)return m.reject(new q("remote-client:port-closed","Can't invoke(), port is closed"));var r=l.newJobId(),y=new n(function(){b(u._outJobs,r);u._post({type:c,jobId:r})});this._outJobs.set(r,y);this._post({type:f,jobId:r,methodName:p},t,w);return y.promise};h.prototype.openPort=
function(){var p=this,t=l.newJobId(),w=new n(function(){b(p._outJobs,t);p._post({type:c,jobId:t})});this._outJobs.set(t,w);this._post({type:g,jobId:t});return w.promise};h.prototype._close=function(){this._channel&&(this._channel=null);this._port.removeEventListener("message",this._onMessage);this._port.close();this._outJobs.forEach(function(p){p.cancel()});this._inJobs.clear();this._outJobs.clear();this._queue.clear();this._port=this._client=null};h.prototype._onMessage=function(p){if(p=l.receiveMessage(p))switch(p.type){case e:this._onResponse(p);
break;case f:this._queue.push(p);break;case c:this._onCancel(p);break;case a:this._close();break;case g:this._onOpenPort(p)}};h.prototype._onCancel=function(p){var t=this._inJobs,w=p.jobId,u=t.get(w);this._queue.push(p);u&&(b(t,w),u.cancel())};h.prototype._onInvoke=function(p){var t=this,w=p.methodName,u=p.jobId;p=p.data;var r=this._inJobs,y=this._client,B=y[w];try{if(!B&&w&&-1!==w.indexOf("."))for(var C=w.split("."),G=0;G<C.length-1;G++)y=y[C[G]],B=y[C[G+1]];if("function"!==typeof B)throw new TypeError(w+
" is not a function");var x=B.call(y,p,this)}catch(v){this._post({type:e,jobId:u,error:l.toInvokeError(v)});return}m.isThenable(x)?(r.set(u,x),x.then(function(v){r.has(u)&&(b(r,u),t._post({type:e,jobId:u},v))}).catch(function(v){r.has(u)&&(b(r,u),v&&"cancel"===v.dojoType||t._post({type:e,jobId:u,error:l.toInvokeError(v||{message:"Error encountered at method "+w})}))})):this._post({type:e,jobId:u},x)};h.prototype._onOpenPort=function(p){var t=new MessageChannel;new h(t.port1,this._client);this._post({type:e,
jobId:p.jobId},t.port2,[t.port2])};h.prototype._onResponse=function(p){var t=p.jobId,w=p.error;p=p.data;var u=this._outJobs;if(u.has(t)){var r=u.get(t);b(u,t);w?r.reject(q.fromJSON(JSON.parse(w))):r.resolve(p)}};h.prototype._post=function(p,t,w){return l.postMessage(this._port,p,t,w)};return h}()})},"esri/layers/vectorTiles/core/workers/utils":function(){define(["require","exports","dojo/has"],function(H,k,n){function q(l){return l&&"object"===typeof l&&("result"in l||"transferList"in l)}Object.defineProperty(k,
"__esModule",{value:!0});(function(l){l[l.HANDSHAKE=0]="HANDSHAKE";l[l.CONFIGURE=1]="CONFIGURE";l[l.CONFIGURED=2]="CONFIGURED";l[l.OPEN=3]="OPEN";l[l.OPENED=4]="OPENED";l[l.RESPONSE=5]="RESPONSE";l[l.INVOKE=6]="INVOKE";l[l.CANCEL=7]="CANCEL";l[l.CLOSE=8]="CLOSE";l[l.OPEN_PORT=9]="OPEN_PORT"})(k.MessageType||(k.MessageType={}));var m=0;k.newJobId=function(){return m++};k.isTranferableResult=q;k.toInvokeError=function(l){return l?l.toJSON?JSON.stringify(l):JSON.stringify({name:l.name,message:l.message,
details:l.details,stack:l.stack}):null};k.postMessage=function(l,b,a,c){2===arguments.length||void 0===a&&void 0===c?l.postMessage(b):(n("esri-workers-supports-transfer-arraybuffer")||(c?(c=c.filter(function(f){return!(f instanceof ArrayBuffer)}),c.length||(c=null)):q(a)&&a.transferList&&(a.transferList=a.transferList.filter(function(f){return!(f instanceof ArrayBuffer)}),a.transferList.length||(a.transferList=null))),c?(b.data=a,l.postMessage(b,c)):q(a)?(b.data=a.result,a.transferList?l.postMessage(b,
a.transferList):l.postMessage(b)):(b.data=a,l.postMessage(b)))};k.receiveMessage=function(l){return l?(l=l.data)?"string"===typeof l?JSON.parse(l):l:null:null}})},"esri/layers/vectorTiles/core/workers/WorkerOwner":function(){define("require exports dojo/Deferred ../../kernel ../Error ../Logger ../promiseUtils ./utils ./workerFactory".split(" "),function(H,k,n,q,m,l,b,a,c){var f=l.getLogger("esri.core.workers"),e=a.MessageType.CANCEL,g=a.MessageType.INVOKE,d=a.MessageType.OPEN,h=a.MessageType.OPENED,
p=a.MessageType.RESPONSE;return function(){function t(w,u){this._outJobs=new Map;this._inJobs=new Map;this.worker=w;this.id=u;w.addEventListener("message",this._onMessage.bind(this));w.addEventListener("error",function(r){r.preventDefault();f.error(r)})}t.create=function(w){return c.createWorker().then(function(u){return new t(u,w)})};t.prototype.terminate=function(){this.worker.terminate()};t.prototype.open=function(w){var u=this,r=a.newJobId(),y=new n(function(B){u._outJobs["delete"](r);u._post({type:e,
jobId:r})});this._outJobs.set(r,y);this._post({type:d,jobId:r,modulePath:w});return y.promise};t.prototype._onMessage=function(w){if(w=a.receiveMessage(w))switch(w.type){case h:case p:this._onResponse(w);break;case e:this._onCancel(w);break;case g:this._onInvoke(w)}};t.prototype._onCancel=function(w){(w=this._inJobs.get(w.jobId))&&w.cancel()};t.prototype._onInvoke=function(w){var u=this,r=w.methodName,y=w.jobId;w=w.data;var B=this._inJobs,C=q.workerMessages[r];try{if("function"!==typeof C)throw new TypeError(r+
" is not a function");var G=C.call(null,w)}catch(x){this._post({type:p,jobId:y,error:a.toInvokeError(x)});return}b.isThenable(G)?(B.set(y,G),G.then(function(x){B["delete"](y);u._post({type:p,jobId:y},x)}).catch(function(x){B["delete"](y);x||(x={message:"Error encountered at method"+r});x.dojoType&&"cancel"===x.dojoType||u._post({type:p,jobId:y,error:a.toInvokeError(x)})})):this._post({type:p,jobId:y},G)};t.prototype._onResponse=function(w){var u=w.jobId,r=w.error;w=w.data;var y=this._outJobs.get(u);
y&&(this._outJobs["delete"](u),r?y.reject(m.fromJSON(JSON.parse(r))):y.resolve(w))};t.prototype._post=function(w,u,r){return a.postMessage(this.worker,w,u,r)};return t}()})},"esri/layers/vectorTiles/core/workers/workerFactory":function(){define("require exports ../tsSupport/assignHelper dojo/_base/kernel ../../config ../../request ../Logger ../promiseUtils ../sniff ../urlUtils ./loaderConfig ./utils ./WorkerFallback".split(" "),function(H,k,n,q,m,l,b,a,c,f,e,g,d){function h(C){return a.create(function(G){function x(z){if(z=
g.receiveMessage(z))switch(z.type){case B:z=C;var A=m.workers.loaderUrl||e.DEFAULT_LOADER_URL;if(null!=m["default"]){var F=n({},m);delete F["default"];F=JSON.parse(JSON.stringify(F))}else F=JSON.parse(JSON.stringify(m));var J=m.workers.loaderConfig;J=e.default({baseUrl:J.baseUrl,locale:q.locale,has:n({"config-deferredInstrumentation":0,"dojo-test-sniff":0,"esri-cors":1,"esri-secure-context":c("esri-secure-context"),"esri-workers-supports-transfer-arraybuffer":c("esri-workers-supports-transfer-arraybuffer"),
"events-keypress-typed":0,"host-webworker":1},J.has),map:n({},J.map),paths:n({},J.paths),packages:J.packages||[]});z.postMessage({type:y,configure:{esriConfig:F,loaderUrl:A,loaderConfig:J}});break;case r:C.removeEventListener("message",x),C.removeEventListener("error",v),G(C)}}function v(z){z.preventDefault();C.removeEventListener("message",x);C.removeEventListener("error",v);w.warn("Failed to create Worker. Fallback to execute module in main thread",z);C=new d;C.addEventListener("message",x);C.addEventListener("error",
v)}C.addEventListener("message",x);C.addEventListener("error",v)})}Object.defineProperty(k,"__esModule",{value:!0});var p=f.normalize(H.toUrl("./worker.js")),t=!f.hasSameOrigin(p,location.href),w=b.getLogger("esri.core.workers"),u=null,r=g.MessageType.CONFIGURED,y=g.MessageType.CONFIGURE,B=g.MessageType.HANDSHAKE;k.createWorker=function(){if(!c("esri-workers"))return h(new d);if(!t){var C=void 0;try{C=new Worker(p)}catch(G){w.warn("Failed to create Worker. Fallback to execute module in main thread",
event),C=new d}return h(C)}u||(u=l(p,{responseType:"text"}));return u.then(function(G){return new Worker(URL.createObjectURL(new Blob([G.data],{type:"text/javascript"})))}).catch(function(G){w.warn("Failed to create Worker. Fallback to execute module in main thread",G);return new d}).then(function(G){return h(G)})}})},"esri/layers/vectorTiles/core/tsSupport/assignHelper":function(){define([],function(){return Object.assign||function(H){for(var k,n=1,q=arguments.length;n<q;n++){k=arguments[n];for(var m in k)Object.prototype.hasOwnProperty.call(k,
m)&&(H[m]=k[m])}return H}})},"esri/layers/vectorTiles/config":function(){define(["require","exports","esri/config"],function(H,k,n){Object.defineProperty(n,"workers",{get:function(){return n.defaults.workers},set:function(q){return n.defaults.workers=q}});return n})},"esri/layers/vectorTiles/request":function(){define(["require","exports","esri/request","dojo/_base/lang","dojo/Deferred"],function(H,k,n,q,m){return function(l,b){l=q.mixin({},{url:l,failOk:!0},b);"array-buffer"===b.responseType?(l.handleAs=
"arraybuffer",delete l.responseType):b.responseType&&(l.handleAs=b.responseType,delete l.responseType);null!==b.query&&(l.content=l.query,delete l.query);if(b.hasOwnProperty("allowImageDataAccess")){var a={allowImageDataAccess:b.allowImageDataAccess};delete l.allowImageDataAccess}var c=new m(function(){f.isFulfilled()||f.cancel()});var f=n(l,a).then(function(e){c.resolve({data:e})}).catch(function(e){e&&null!=e.httpCode&&(e.details=e.details||{},e.details.httpStatus=e.httpCode);c.reject(e)});return c.promise}})},
"esri/layers/vectorTiles/core/sniff":function(){define(["require","exports","dojo/sniff","./global","../views/webgl/context-util"],function(H,k,n,q,m){function l(){var f={available:!1,version:0,majorPerformanceCaveat:!1,supportsHighPrecisionFragment:!1,supportsVertexShaderSamplers:!1,supportsElementIndexUint:!1,supportsStandardDerivatives:!1},e=document.createElement("canvas");if(!e)return f;var g=m.createContext(e,{failIfMajorPerformanceCaveat:!0},"webgl");!g&&(g=m.createContext(e,{},"webgl"))&&
(f.majorPerformanceCaveat=!0);if(!g)return f;e=g.getParameter(g.VERSION);if(!e)return f;if(e=e.match(/^WebGL\s+([\d.]*)/))f.version=parseFloat(e[1]),f.available=.94<=f.version,e=g.getShaderPrecisionFormat(g.FRAGMENT_SHADER,g.HIGH_FLOAT),f.supportsHighPrecisionFragment=e&&0<e.precision,f.supportsVertexShaderSamplers=0<g.getParameter(g.MAX_VERTEX_TEXTURE_IMAGE_UNITS),f.supportsElementIndexUint=null!==g.getExtension("OES_element_index_uint"),f.supportsStandardDerivatives=null!==g.getExtension("OES_standard_derivatives");
return f}function b(){var f={available:!1,version:0},e=document.createElement("canvas");if(!e)return f;e=m.createContext(e,{},"webgl2");if(!e)return f;f.available=!0;e=e.getParameter(e.VERSION);if(!e)return f;if(e=e.match(/^WebGL\s+([\d.]*)/))f.version=parseFloat(e[1]);return f}(function(){var f=navigator.userAgent,e=f.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i);f=f.match(/iPhone/i);e&&n.add("esri-mobile",e);f&&n.add("esri-iPhone",f);n.add("esri-phonegap",!!q.cordova);
n.add("esri-cors",n("esri-phonegap")||"XMLHttpRequest"in q&&"withCredentials"in new XMLHttpRequest);n.add("esri-geolocation",function(){return!!navigator.geolocation});n.add("esri-canvas-svg-support",function(){return!(n("trident")||n("ie"))});n.add("esri-secure-context",function(){if("isSecureContext"in q)return q.isSecureContext;if(q.location&&q.location.origin)return 0===q.location.origin.indexOf("https:")});n.add("esri-wasm","WebAssembly"in q);n("host-webworker")||(n.add("esri-workers","Worker"in
q),n.add("esri-script-sandbox",function(){return"MessageChannel"in q&&"HTMLIFrameElement"in q&&"sandbox"in HTMLIFrameElement.prototype}),n.add("esri-url-encodes-apostrophe",function(){var g=q.document.createElement("a");g.href="?'";return-1<g.href.indexOf("?%27")}),a||(a=l()),n.add("esri-webgl",a.available),n.add("esri-webgl-high-precision-fragment",a.supportsHighPrecisionFragment),n.add("esri-webgl-vertex-shader-samplers",a.supportsVertexShaderSamplers),n.add("esri-webgl-element-index-uint",a.supportsElementIndexUint),
n.add("esri-webgl-standard-derivatives",a.supportsStandardDerivatives),n.add("esri-webgl-major-performance-caveat",a.majorPerformanceCaveat),n.add("esri-featurelayer-webgl-labeling",!0),c||(c=b()),n.add("esri-webgl2",c.available))})();var a=null,c=null;return n})},"esri/layers/vectorTiles/core/global":function(){define(["require","exports"],function(H,k){return function(){if("undefined"!==typeof global)return global;if("undefined"!==typeof window)return window;if("undefined"!==typeof self)return self}()})},
"esri/layers/vectorTiles/views/webgl/context-util":function(){define(["require","exports"],function(H,k){function n(b,a,c){void 0===a&&(a={});switch(c){case "webgl":var f=["webgl","experimental-webgl","webkit-3d","moz-webgl"];break;case "webgl2":f=["webgl2"];break;default:f=["webgl","experimental-webgl","webkit-3d","moz-webgl"]}c=null;for(var e=0;e<f.length;e++){var g=f[e];try{c=b.getContext(g,a)}catch(d){}if(c)break}return c}function q(b,a){(b=b.parentNode)&&(b.innerHTML='\x3ctable style\x3d"background-color: #8CE; width: 100%; height: 100%;"\x3e\x3ctr\x3e\x3ctd align\x3d"center"\x3e\x3cdiv style\x3d"display: table-cell; vertical-align: middle;"\x3e\x3cdiv style\x3d""\x3e'+
a+"\x3c/div\x3e\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e")}Object.defineProperty(k,"__esModule",{value:!0});k.createContextOrErrorHTML=function(b,a,c){void 0===a&&(a={});if(!window.WebGLRenderingContext)return q(b,m),null;a=n(b,a,c);return a?a:(q(b,l),null)};k.createContext=n;var m='This page requires a browser that supports WebGL.\x3cbr/\x3e\x3ca href\x3d"http://get.webgl.org"\x3eClick here to upgrade your browser.\x3c/a\x3e',l='It doesn\'t appear your computer can support WebGL.\x3cbr/\x3e\x3ca href\x3d"http://get.webgl.org/troubleshooting/"\x3eClick here for more information.\x3c/a\x3e'})},
"esri/layers/vectorTiles/core/urlUtils":function(){define(["require","exports","esri/urlUtils","dojo/_base/url"],function(H,k,n,q){function m(y){return n.normalize(y)}function l(y){return"data:"===y.slice(0,5)}function b(y){return a(y)||u.test(y)}function a(y){return y&&"/"===y[0]&&"/"===y[1]}function c(y){return n.urlToObject(y)}function f(y){if("string"===typeof y)return new q(g(y));y.scheme||(y.scheme=k.appUrl.scheme);return y}function e(y){if(l(y))return null;var B=y.indexOf("://");if(-1===B&&
a(y))B=2;else if(-1!==B)B+=3;else return null;B=y.indexOf("/",B);return-1===B?y:y.slice(0,B)}function g(y,B,C){void 0===B&&(B=k.appBaseUrl);if(a(y))return C&&C.preserveProtocolRelative?y:"http"===k.appUrl.scheme&&k.appUrl.authority===e(y).slice(2)?"http:"+y:"https:"+y;if(u.test(y))return y;"/"===y[0]&&(C=B.indexOf("//"),C=B.indexOf("/",C+2),B=-1===C?B:B.slice(0,C));return h(B,y)}function d(y,B,C){void 0===C&&(C=!1);y=f(y);B=f(B);return C||y.scheme===B.scheme?y.host.toLowerCase()===B.host.toLowerCase()&&
y.port===B.port:!1}function h(){for(var y=[],B=0;B<arguments.length;B++)y[B]=arguments[B];if(y&&y.length){B=[];if(b(y[0])){var C=y[0],G=C.indexOf("//");B.push(C.slice(0,G+1));w.test(y[0])&&(B[0]+="/");y[0]=C.slice(G+2)}else"/"===y[0][0]&&B.push("");y=y.reduce(function(x,v){return v?x.concat(v.split("/")):x},[]);for(C=0;C<y.length;C++)G=y[C],".."===G&&0<B.length?B.pop():!G||"."===G&&0!==B.length||B.push(G);return B.join("/")}}function p(y,B,C){if(!(B&&C&&y&&b(y)))return y;var G=y.indexOf("//"),x=y.indexOf("/",
G+2),v=y.indexOf(":",G+2);x=Math.min(0>x?y.length:x,0>v?y.length:v);if(y.slice(G+2,x).toLowerCase()!==B.toLowerCase())return y;B=y.slice(0,G+2);y=y.slice(x);return""+B+C+y}function t(y,B,C){void 0===B&&(B=k.appBaseUrl);if(!b(y))return y;var G=m(y),x=G.toLowerCase();B=m(B).toLowerCase().replace(/\/+$/,"");if((C=C?m(C).toLowerCase().replace(/\/+$/,""):null)&&0!==B.indexOf(C))return y;for(var v=function(F,J,L){L=F.indexOf(J,L);return-1===L?F.length:L},z=v(x,"/",x.indexOf("//")+2),A=-1;x.slice(0,z+1)===
B.slice(0,z)+"/";){A=z+1;if(z===x.length)break;z=v(x,"/",z+1)}if(-1===A||C&&A<C.length)return y;y=G.slice(A);G=B.slice(A-1).replace(/[^/]+/g,"").length;if(0<G)for(x=0;x<G;x++)y="../"+y;else y="./"+y;return y}Object.defineProperty(k,"__esModule",{value:!0});k.normalize=m;k.canUseXhr=function(y){return n.canUseXhr(y)};k.removeTrailingSlash=function(y){return y.replace(/\/+$/,"")};H=Function("return this")();k.appUrl=new q(H.location);k.appBaseUrl=function(){var y=k.appUrl.path;y=y.substring(0,y.lastIndexOf(y.split("/")[y.split("/").length-
1]));return k.appUrl.scheme+"://"+k.appUrl.host+(null!=k.appUrl.port?":"+k.appUrl.port:"")+y}();var w=/^\s*file:/i,u=/^\s*[a-z][a-z0-9-+.]*:[^0-9]/i;k.isDataProtocol=l;k.isAbsolute=b;k.isProtocolRelative=a;k.urlToObject=c;k.getOrigin=e;k.makeAbsolute=g;k.hasSameOrigin=d;k.join=h;k.removeFile=function(y){var B=0;if(b(y)){var C=y.indexOf("//");-1!==C&&(B=C+2)}C=y.lastIndexOf("/");return C<B?y:y.slice(0,C+1)};k.addProxy=function(y){return n.addProxy(y)};k.makeData=function(y){return y.isBase64?"data:"+
y.mediaType+";base64,"+y.data:"data:"+y.mediaType+","+y.data};var r=/^data:(.*?)(;base64)?,(.*)$/;k.dataComponents=function(y){return(y=y.match(r))?{mediaType:y[1],isBase64:!!y[2],data:y[3]}:null};k.changeDomain=p;k.read=function(y,B){var C=B&&B.url&&B.url.path;y&&C&&(y=g(y,C,{preserveProtocolRelative:!0}));(B=B&&B.portal)&&!B.isPortal&&B.urlKey&&B.customBaseUrl?(C=B.urlKey+"."+B.customBaseUrl,B=d(k.appUrl,k.appUrl.scheme+"://"+C)?p(y,B.portalHostname,C):p(y,C,B.portalHostname)):B=y;return B};k.write=
function(y,B){if(!y)return y;!b(y)&&B&&B.blockedRelativeUrls&&B.blockedRelativeUrls.push(y);var C=g(y);if(B){var G=B.verifyItemRelativeUrls&&B.verifyItemRelativeUrls.rootPath||B.url&&B.url.path;G&&(C=t(C,G,G),C!==y&&B.verifyItemRelativeUrls&&B.verifyItemRelativeUrls.writtenUrls.push(C))}y=C;C=(B=B&&B.portal)&&!B.isPortal&&B.urlKey&&B.customBaseUrl?p(y,B.urlKey+"."+B.customBaseUrl,B.portalHostname):y;return C};k.makeRelative=t;k.removeQueryParameters=function(y){y=c(y);Object.keys(y.query||{});return y.path}})},
"esri/layers/vectorTiles/core/workers/loaderConfig":function(){define(["require","exports","../tsSupport/assignHelper","dojo/has","../urlUtils"],function(H,k,n,q,m){Object.defineProperty(k,"__esModule",{value:!0});k.DEFAULT_LOADER_URL=m.makeAbsolute(m.removeQueryParameters(H.toUrl("./worker-init.js")));k.DEFAULT_CONFIG={baseUrl:function(){var l=m.removeQueryParameters(H.toUrl("dojo/x.js"));return m.makeAbsolute(l.slice(0,l.length-5))}(),packages:[{name:"esri"},{name:"dojo"},{name:"dojox"},{name:"dstore"},
{name:"moment",main:"moment"},{name:"@dojo"},{name:"cldrjs",main:"dist/cldr"},{name:"globalize",main:"dist/globalize"},{name:"maquette",main:"dist/maquette.umd"},{name:"maquette-css-transitions",main:"dist/maquette-css-transitions.umd"},{name:"maquette-jsx",main:"dist/maquette-jsx.umd"},{name:"tslib",main:"tslib"}],map:{globalize:{cldr:"cldrjs/dist/cldr","cldr/event":"cldrjs/dist/cldr/event","cldr/supplemental":"cldrjs/dist/cldr/supplemental","cldr/unresolved":"cldrjs/dist/cldr/unresolved"}}};k.default=
function(l){var b={async:l.async,isDebug:l.isDebug,locale:l.locale,baseUrl:l.baseUrl,has:n({},l.has),map:n({},l.map),packages:l.packages&&l.packages.concat()||[],paths:n({},l.paths)};l.hasOwnProperty("async")||(b.async=!0);l.hasOwnProperty("isDebug")||(b.isDebug=!1);l.baseUrl||(b.baseUrl=k.DEFAULT_CONFIG.baseUrl);k.DEFAULT_CONFIG.packages.forEach(function(e){a:{for(var g=b.packages,d=0;d<g.length;d++)if(g[d].name===e.name)break a;e=n({},e);d=m.removeQueryParameters(H.toUrl(e.name+"/x.js"));d=d.slice(0,
d.length-5);e.location=m.makeAbsolute(d);g.push(e)}});l=b.map=b.map||{};for(var a=0,c=Object.keys(k.DEFAULT_CONFIG.map);a<c.length;a++){var f=c[a];l[f]||(l[f]=k.DEFAULT_CONFIG.map[f])}return b}})},"esri/layers/vectorTiles/core/workers/WorkerFallback":function(){define(["require","exports","dojo/has","../global","./utils"],function(H,k,n,q,m){var l=function(){return function(){var c=this,f=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach(function(e){c[e]=
function(){for(var g=[],d=0;d<arguments.length;d++)g[d]=arguments[d];return f[e].apply(f,g)}})}}(),b=q.MutationObserver||q.WebKitMutationObserver,a=function(){if(q.process&&q.process.nextTick)var c=function(g){q.process.nextTick(g)};else if(q.Promise)c=function(g){q.Promise.resolve().then(g)};else if(b){var f=[],e=document.createElement("div");(new b(function(){for(;0<f.length;)f.shift()()})).observe(e,{attributes:!0});c=function(g){f.push(g);e.setAttribute("queueStatus","1")}}return c}();return function(){function c(){this._dispatcher=
new l;this._isInitialized=!1;this._workerPostMessage({type:m.MessageType.HANDSHAKE})}c.prototype.terminate=function(){};Object.defineProperty(c.prototype,"onmessage",{get:function(){return this._onmessageHandler},set:function(f){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler);(this._onmessageHandler=f)&&this.addEventListener("message",f)},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"onerror",{get:function(){return this._onerrorHandler},set:function(f){this._onerrorHandler&&
this.removeEventListener("error",this._onerrorHandler);(this._onerrorHandler=f)&&this.addEventListener("error",f)},enumerable:!0,configurable:!0});c.prototype.postMessage=function(f,e){var g=this;a(function(){g._workerMessageHandler(new MessageEvent("message",{data:f}))})};c.prototype.dispatchEvent=function(f){return this._dispatcher.dispatchEvent(f)};c.prototype.addEventListener=function(f,e,g){this._dispatcher.addEventListener(f,e,g)};c.prototype.removeEventListener=function(f,e,g){this._dispatcher.removeEventListener(f,
e,g)};c.prototype._workerPostMessage=function(f,e){var g=this;a(function(){g.dispatchEvent(new MessageEvent("message",{data:f}))})};c.prototype._workerMessageHandler=function(f){var e=this;if(f=m.receiveMessage(f)){var g=f.jobId;switch(f.type){case m.MessageType.CONFIGURE:this._isInitialized||this._workerPostMessage({type:m.MessageType.CONFIGURED});break;case m.MessageType.OPEN:f=f.modulePath,n("esri-webpack")?H(["esri/core/workers/RemoteClient","esri/views/vectorTiles/WorkerTileHandler","esri/views/2d/layers/features/Pipeline",
"esri/views/3d/layers/PointCloudWorker","esri/views/3d/layers/SceneLayerWorker","esri/layers/graphics/sources/support/CSVSourceWorker","esri/views/3d/webgl-engine/lib/edgeRendering/EdgeProcessingWorker",f],function(d,h,p,t,w,u,r,y){switch(y){case "esri/views/vectorTiles/WorkerTileHandler":break;case "esri/views/2d/layers/features/Pipeline":h=p;break;case "esri/views/3d/layers/PointCloudWorker":h=t;break;case "esri/views/3d/layers/SceneLayerWorker":h=w;break;case "esri/layers/graphics/sources/support/CSVSourceWorker":h=
u;break;case "esri/views/3d/webgl-engine/lib/edgeRendering/EdgeProcessingWorker":h=r;break;default:h=y}d=d.connect(h);e._workerPostMessage({type:m.MessageType.OPENED,jobId:g,data:d})}):H(["./RemoteClient",f],function(d,h){d=d.connect(h);e._workerPostMessage({type:m.MessageType.OPENED,jobId:g,data:d})})}}};return c}()})},"esri/layers/vectorTiles/core/requireUtils":function(){define(["require","exports","dojo/Deferred"],function(H,k,n){function q(m,l){if(Array.isArray(l)){var b=new n;m(l,function(){for(var a=
[],c=0;c<arguments.length;c++)a[c]=arguments[c];b.resolve(a)});return b.promise}return q(m,[l]).then(function(a){return a[0]})}Object.defineProperty(k,"__esModule",{value:!0});k.when=q;k.getAbsMid=function(m,l,b){return l.toAbsMid?l.toAbsMid(m):b.id.replace(/\/[^\/]*$/gi,"/")+m}})},"esri/layers/rasterLib/function/rasterFunctionHelper":function(){define(["dojo/_base/declare","dojo/_base/lang","./rasterFunctionRegistry"],function(H,k,n){return{create:function(q,m){if(q){var l=q.renderTexture,b=Object.keys(q);
if(q.read&&!m)return q;q.read&&m&&(q=q.toJson());-1<b.indexOf("name")&&b.indexOf(!1)?(q=k.mixin({},q),m=this._parseV2(q,m)):(q="esri.layers.RasterFunction"===q.declaredClass?q.toJson():k.mixin({},q),m=this._parseV1(q,m));m.branchCount=m.updateBranchStructure();m.renderTexture||(m.renderTexture=!!l);return m}},_parseV1:function(q,m){var l=q.rasterFunction,b=q.rasterFunctionArguments,a=q.renderTexture||q.rasterFunctionArguments.renderTexture||!1,c,f,e,g,d,h,p;(g=b.raster||b.Raster)&&g.rasterFunction&&
(c=this._parseV1(g,m));(g=b.raster2||b.Raster2)&&g.rasterFunction&&(f=this._parseV1(g,m));(g=b.rasters||b.Rasters)&&0<g.length&&(e=g.map(k.hitch(this,function(t){return t&&t.rasterFunction?this._parseV1(t,m):t})));(g=b.dem||b.DEM)&&(g.functionName||g.rasterFunction)&&(d=this._parseV1(g,m));(g=b.fillRaster||b.FillRaster)&&(g.functionName||g.rasterFunction)&&(h=this._parseV1(g,m));g=n.functions[l];if(!g)return console.error("Function is not currently supported: "+l),null;l=new g(b);l.variableName&&
(g=b[l.variableName])&&(g.functionName||g.rasterFunction)&&(p=this._parseV1(g,m));q.outputPixelType&&(l.pixelType=q.outputPixelType);"$$"===c?l.functionArguments.raster=m&&m.raster:null!=c?l.functionArguments.raster=c:l.functionArguments.raster||(l.functionArguments.raster=m&&m.raster);null!=f&&(l.functionArguments.raster2=f);null!=e&&(l.functionArguments.rasters=e.map(function(t){"$$"===t&&(t=m&&m.raster);return t}));null!=d&&(l.functionArguments.dem=d);null!=h&&(l.functionArguments.fillRaster=h);
null!=p&&(l.functionArguments[l.variableName]=p);l.renderTexture=a;return l},_parseV2:function(q,m){if(!q)return null;q=k.clone(q);this._bindV2Args(q,m);var l={};this._convertTov1(q,l);return this._parseV1(l,m)},_bindV2Args:function(q,m){(q||m)&&Object.keys(q).forEach(function(l){q[l]["function"]&&q[l].arguments?this._bindV2Args(q[l].arguments,m):null!=m[q[l].name]&&(q[l].value=m[q[l].name])}.bind(this))},_convertV2Types:function(q){if(!q)return null;"ArgumentArray"===q.type?q.elements&&"RasterStatistics"===
q.elements[0].type&&(q=q.elements):q instanceof Array&&0===q.length&&(q=null);return q},_convertTov1:function(q,m){if((q||m)&&q["function"]){var l=q["function"],b=q.arguments;m.rasterFunction=l.type.replace("Function","");m.outputPixelType="UNKNOWN"===l.pixelType?"Unknown":l.pixelType;m.rasterFunctionArguments={};var a;Object.keys(b).forEach(function(c){b[c]["function"]&&b[c].arguments?(m.rasterFunctionArguments[c]={},this._convertTov1(b[c],m.rasterFunctionArguments[c])):(a=b[c].value,m.rasterFunctionArguments[c]=
"object"!==typeof a||a.functionArguments?a:this._convertV2Types(a))}.bind(this))}}}})},"esri/layers/rasterLib/function/rasterFunctionRegistry":function(){define("dojo/_base/declare dojo/_base/lang ../../rasterLib/function/AspectFunction ../../rasterLib/function/BandArithmeticFunction ../../rasterLib/function/ColormapFunction ../../rasterLib/function/CompositeBandFunction ../../rasterLib/function/ContrastBrightnessFunction ../../rasterLib/function/ConvolutionFunction ../../rasterLib/function/ExtractBandFunction ../../rasterLib/function/HillshadeFunction ../../rasterLib/function/LocalFunction ../../rasterLib/function/MaskFunction ../../rasterLib/function/NDVIFunction ../../rasterLib/function/SlopeFunction ../../rasterLib/function/StretchFunction ../../rasterLib/function/RemapFunction ../../rasterLib/function/IdentityFunction ../../rasterLib/function/ResampleFunction".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u){return function(){function r(G){G.prototype.supportWebGL&&(B[G.prototype.functionName]=G);G.prototype.support2D&&(y[G.prototype.functionName]=G);C[G.prototype.functionName]=G}var y={},B={},C={};r(n);r(q);r(m);r(l);r(b);r(a);r(c);r(f);r(e);r(g);r(d);r(h);r(p);r(t);r(w);r(u);return{cpu:y,gpu:B,functions:C,register:r,getFunction:function(G){return C[G]},support:function(G,x){return!!("gpu"===x?B:"cpu"===x?y:C)[G]}}}()})},"esri/layers/rasterLib/function/AspectFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../../WKIDUnitConversion ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./surfaceUtils".split(" "),
function(H,k,n,q,m,l,b,a){return H([n,b],{declaredClass:"esri.layers.rasterLib.function.AspectFunction",functionName:"Aspect",supportWebGL:!0,support2D:!0,constructor:function(c){this.functionArguments=this.mixinIgnoreCase({raster:null},c)},bind:function(){var c=this.getSourceRasterInfo();if(!c.raster)return Error("The raster input to aspect function is invalid.");this.rasterInfo=k.mixin(c.raster,{bandCount:1,pixelType:this._calculatePixelType(this.pixelType,"F32"),statistics:[{min:0,max:360}],histograms:null});
this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType="Generic";return!0},read2D:function(c){this._performance.start();c=a.aspect(c.raster);this._addPerformanceMetric(this._performance.elapsed());return c},readGL:function(c){this._performance.start();this._initializeProgram({fragment:l.aspect,fragmentName:"Aspect"});var f=this._setupTextureData(c.raster),e=this.bindFrameBuffer(),g=this.gl,d=g.drawingBufferWidth;g=g.drawingBufferHeight;var h=f.extent;
this._setUniforms({u_resolution:c&&c.raster&&c.raster.pixelBlock?[1/c.raster.pixelBlock.width,1/c.raster.pixelBlock.height]:[1/d,1/g],u_cellSize:[(h.xmax-h.xmin)/d,(h.ymax-h.ymin)/g]});this._bindTexture(f.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:f.extent,texture:e.texture}}})})},"esri/layers/rasterLib/function/RasterFunctionX":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/config ../raster/RasterInfo ../../../geometry/Extent ../../PixelBlock".split(" "),
function(H,k,n,q,m,l){return H(null,{functionName:null,functionArguments:null,pixelType:"Unknown",rasterInfo:null,constructor:function(b){b&&(this.pixelType=b.outputPixelType||b.OutputPixelType||this.pixelType,this.renderTexture=b.renderTexture,this._initFunction())},mixinIgnoreCase:function(b,a){var c=Object.keys(b),f=Object.keys(a),e,g,d=c.length;for(e=0;e<f.length;e++){var h=a[f[e]];if(null!=h)for(g=0;g<d;g++)if(c[g].toLowerCase()===f[e].toLowerCase()){b[c[g]]=h;break}}return b},bind:function(b){},
setProcessingContext:function(b){if(!b)throw"cannot bind to layer without options";this.useWebGL=!!b.useWebGL;this._tileMode=!!b.tileMode;this._glSetting=b.glSetting;this._rawRasterInfo=b.rawRasterInfo;this._xformSetting=b.xformSetting||this._xformSetting;if(!this.useWebGL||this._glSetting&&this._glSetting.gl){this.gl=this.useWebGL?this._glSetting.gl:null;this._glSetting&&(this._glSetting.pingpong=null,this._glSetting.branches=null);var a=this.functionArguments.raster,c=this.functionArguments.raster2,
f=this.functionArguments.dem,e=this.functionArguments.fillRaster,g=this.functionArguments.rasters;a&&a.functionArguments&&a.setProcessingContext(b);c&&c.functionArguments&&c.setProcessingContext(b);f&&f.functionArguments&&f.setProcessingContext(b);e&&e.functionArguments&&e.setProcessingContext(b);if(g)for(a=0;a<g.length;a++)g[a]&&g[a].functionArguments&&g[a].setProcessingContext(b);this.bind()}},updateBranchStructure:function(){var b=0,a=this.functionArguments;a.raster&&a.raster.read&&a.raster.functionArguments&&
(b+=a.raster.updateBranchStructure());a.raster2&&a.raster2.read&&a.raster2.functionArguments&&(b+=a.raster2.updateBranchStructure(),a.raster2.isBranch=!0,a.raster&&a.raster.read&&(a.raster.isBranch=!0));a.rasters&&(b=a.rasters.length,a.rasters.forEach(function(c){c.read&&c.functionArguments&&(c.isBranch=!0)}));a.dem&&a.dem.read&&a.dem.functionArguments&&(b+=a.dem.updateBranchStructure());return 1===b?0:b},read:function(b){b=this.processRasterArgument(b);return this.useWebGL?this.readGL(b):this.read2D(b)},
hasTilingEffects:function(){return!1},read2D:function(){},readGL:function(){},getSourceRasterInfo:function(){var b,a={};if(this.functionArguments.raster2)a.functionArguments.raster=this._bindRaster(this.functionArguments.raster),a.functionArguments.raster2=this._bindRaster(this.functionArguments.raster2);else if(this.functionArguments.rasters)for(a.rasters=[],b=0;b<this.functionArguments.rasters.length;b++)a.rasters[b]=this._bindRaster(this.functionArguments.rasters[b]);else a.raster=this._bindRaster(this.functionArguments.raster);
return this.sourceRasterInfo=a},processRasterArgument:function(b){var a=this.bind();if(!0!==a)throw a;var c={};if(this.functionArguments.raster2)c.raster=this._readRaster(this.functionArguments.raster,b),c.raster2=this._readRaster(this.functionArguments.raster2,b);else if(this.functionArguments.rasters)for(c.rasters=[],a=0;a<this.functionArguments.rasters.length;a++)c.rasters[a]=this._readRaster(this.functionArguments.rasters[a],b);else c.raster=this._readRaster(this.functionArguments.raster,b);return c},
toJson:function(){var b=this.functionArguments,a=b.raster,c=b.raster2;b=b.rasters;a=a?a.toJson?a.toJson():a:null;c=c?c.toJson?c.toJson():c:null;var f;b&&0<b.length&&(f=b.map(function(e){return e.toJson?e.toJson():e}));b=k.mixin({},this.functionArguments);b.raster=a;b.raster2=c;b.rasters=f;b=this._fixRasterFunctionJson(b);return{rasterFunction:this.functionName,rasterFunctionArguments:b,outputPixelType:this.pixelType}},_initFunction:function(b){},_getIntegerRange:function(b){switch(b){case "U8":var a=
[0,255];break;case "U16":a=[0,65535];break;case "U32":a=[0,4294967295];break;case "S8":a=[-128,127];break;case "S16":a=[-32768,32767];break;case "S32":a=[-2147483648,2147483647]}return a},_calculatePixelType:function(b,a){return b&&"unknown"!==b.toLowerCase()?b:a},_clonePixelData:function(b){if(null==b)return b;var a={};b.extent&&(a.extent=new m(b.extent.xmin,b.extent.ymin,b.extent.xmax,b.extent.ymax,b.extent.spatialReference));b=b.pixelBlock;if(null==b)return a;a.pixelBlock=b.clone?b.clone():l.prototype.clone(b);
return a},_readRaster:function(b,a){if(null==b||"$$"===b)var c=this._clonePixelData(a.src[Object.keys(a.src)[0]]);else b&&b.rasterInfo&&!b.functionArguments?c=this._clonePixelData(a.src[b._rasterId]):isNaN(b)?b.read&&(c=b.functionArguments?b.read(a):this._clonePixelData(a)):(c=a.src?a.src[Object.keys(a.src)[0]]:a,a=c.pixelBlock,a=new Float32Array(a.width*a.height),a.fill(parseFloat(b)),c=this._clonePixelData(c),c.pixelBlock.pixels=[a],c.isConstant=!0);return c},_bindRaster:function(b){if(b&&"$$"!==
b)isNaN(b)?b.rasterInfo?a=b.rasterInfo:b.bind&&b.bind()&&(a=b.rasterInfo):a={};else var a=this._rawRasterInfo;a&&(a=a.clone?a.clone():new q(a),a.bandCount=a.bandCount||3);return a},_getOutputBand:function(b,a){switch(b){case "U8":b=new Uint8Array(a);break;case "U16":b=new Uint16Array(a);break;case "U32":b=new Uint32Array(a);break;case "S8":b=new Int8Array(a);break;case "S16":b=new Int16Array(a);break;case "S32":b=new Int32Array(a);break;case "U32":b=new Uint32Array(a);break;case "F32":b=new Float32Array(a);
break;case "F64":b=new Float64Array(a);break;default:b=new Float32Array(a)}return b},_clampBand:function(b,a,c){if(("F64"===a||"F32"===a)&&!c)return b;var f,e=this._getIntegerRange(a),g=b.length;if(e)for(c=e[1],e=e[0],a=this._getOutputBand(a,g),f=0;f<g;f++){var d=b[f];a[f]=d>c?c:d<e?e:d}else a=b;return a},_performance:{start:function(){return this._start=self.performance&&self.performance.now()||new Date}.bind(this),elapsed:function(){return(self.performance&&self.performance.now()||new Date)-this._start}.bind(this)},
_addPerformanceMetric:function(b){n.isDebug&&(self.rasterFunctionPerformance||(self.rasterFunctionPerformance=[]),self.rasterFunctionPerformance.push(b),50<self.rasterFunctionPerformance.length&&self.rasterFunctionPerformance.shift())},_fixRasterFunctionJson:function(b){for(var a in b)b.hasOwnProperty(a)&&(null==b[a]?delete b[a]:b[a]instanceof Object&&!b[a].sourceType&&this._fixRasterFunctionJson(b[a],!0));return b}})})},"esri/layers/rasterLib/function/pixelShaders":function(){define(["dojo/_base/declare",
"dojo/_base/lang","./pixelShaderScripts"],function(H,k,n){H={shaderType:"fragment",getShader:function(q,m){var l=q.createShader(q.FRAGMENT_SHADER);q.shaderSource(l,m);q.compileShader(l);q.getShaderParameter(l,q.COMPILE_STATUS)||(l=null);return l}};k.mixin(H,n);return H})},"esri/layers/rasterLib/function/pixelShaderScripts":function(){define([],function(){return{aspect:"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform vec2 u_resolution;\nuniform vec2 u_cellSize;\nfloat getNeighborHoodAlpha(float a, float b, float c, float d, float e, float f, float g, float h, float i){\nif (a \x3d\x3d 0.0 || a \x3d\x3d 0.0 || a\x3d\x3d0.0 || a \x3d\x3d 0.0 || a \x3d\x3d 0.0 || a\x3d\x3d0.0 || a \x3d\x3d 0.0 || a \x3d\x3d 0.0 || a\x3d\x3d0.0) {\nreturn 0.0;\n}\nelse {\nreturn e;\n}\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\nfloat pi \x3d 3.141592653589793238;\nfloat dz_dx \x3d 0.0;\nfloat dz_dy \x3d 0.0;\nvec4 va, vb, vc,vd,ve,vf,vg,vh,vi;\nvec2 axy \x3d vec2(-1.0,-1.0);\nvec2 bxy \x3d vec2(0.0, -1.0);\nvec2 cxy \x3d vec2(1.0, -1.0);\nvec2 dxy \x3d vec2(-1.0, 0.0);\nvec2 fxy \x3d vec2(1.0, 0.0);\nvec2 gxy \x3d vec2(-1.0, 1.0);\nvec2 hxy \x3d vec2(0.0, 1.0);\nvec2 ixy \x3d vec2(1.0, 1.0);\nif (v_texCoord.s \x3c u_resolution.s)\n{\naxy[0] \x3d 1.0;\ndxy[0] \x3d 1.0;\ngxy[0] \x3d 1.0;\n}\nif (v_texCoord.t \x3c u_resolution.t)\n{\naxy[1] \x3d 1.0;\nbxy[1] \x3d 1.0;\ncxy[1] \x3d 1.0;\n}\nif (v_texCoord.s \x3e1.0-u_resolution.s)\n{\ncxy[0] \x3d -1.0;\nfxy[0] \x3d -1.0;\nixy[0] \x3d -1.0;\n}\nif (v_texCoord.t \x3e 1.0- u_resolution.t)\n{\ngxy[1] \x3d -1.0;\nhxy[1] \x3d -1.0;\nixy[1] \x3d -1.0;\n}\nif (v_texCoord.s \x3e\x3d u_resolution.s \x26\x26 (1.0-u_resolution.s)\x3e\x3dv_texCoord.s \x26\x26 v_texCoord.t \x3e\x3d u_resolution.t \x26\x26 (1.0-u_resolution.t)\x3e\x3dv_texCoord.t)\n{\nva \x3d texture2D(u_image, v_texCoord + u_resolution* axy);\nvb \x3d texture2D(u_image, v_texCoord + u_resolution* bxy);\nvc \x3d texture2D(u_image, v_texCoord + u_resolution* cxy);\nvd \x3d texture2D(u_image, v_texCoord + u_resolution* dxy);\nve \x3d texture2D(u_image, v_texCoord + u_resolution* vec2(0, 0));\nvf \x3d texture2D(u_image, v_texCoord + u_resolution* fxy);\nvg \x3d texture2D(u_image, v_texCoord + u_resolution* gxy);\nvh \x3d texture2D(u_image, v_texCoord + u_resolution* hxy);\nvi \x3d texture2D(u_image, v_texCoord + u_resolution* ixy);\n}\ndz_dx \x3d (vc+2.0*vf+vi - va - 2.0*vd - vg).r/(8.0*u_cellSize[0]);\ndz_dy \x3d -(vg+2.0*vh+vi - va - 2.0*vb - vc).r/(8.0*u_cellSize[1]);\nfloat alpha \x3d getNeighborHoodAlpha(va.a, vb.a, vc.a, vd.a, ve.a, vf.a, vg.a, vh.a, vi.a);\nfloat aspect_rad \x3d 0.0;\nif (dz_dx \x3d\x3d 0.0)\n{\nif (dz_dy \x3e 0.0)\naspect_rad \x3d 0.5 * pi;\nelse if (dz_dy \x3c 0.0)\naspect_rad \x3d 1.5 * pi;\nelse\nalpha \x3d 0.0;//undefined make it nodata\n}\nelse\n{\naspect_rad \x3d 0.5*pi + atan(dz_dy, -dz_dx);\nif (aspect_rad \x3c 0.0)\naspect_rad \x3d 2.0*pi + aspect_rad;\n}\nfloat aspect \x3d aspect_rad * 180.0 / pi;\ngl_FragColor \x3d vec4(aspect, aspect, aspect, alpha);\n}",
bandArithmetic:"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform int u_bandId_nir;\nuniform int u_bandId_red;\nuniform bool u_scaled;\nuniform int u_bandCount;\nuniform int u_method;\nuniform float u_constants[6];\nvec4 calculateNDVI() {\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nfloat red \x3d float(u_bandId_red \x3d\x3d 0 ? currentPixel.r : (u_bandId_red \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat nir \x3d float(u_bandId_nir \x3d\x3d 0 ? currentPixel.r : (u_bandId_nir \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat ndvi_denom \x3d nir + red;\nfloat ndvi;\nif (ndvi_denom \x3d\x3d 0.0) {\nndvi \x3d 0.0;\n} else {\nndvi \x3d (nir - red) / ndvi_denom;\nif (u_scaled) {\nndvi \x3d float(floor(ndvi * 100.0 + 100.5));\n}\n}\nreturn vec4(ndvi, ndvi, ndvi, currentPixel.a);\n}\nvec4 calculateSAVI() {\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nfloat red \x3d float(u_bandId_red \x3d\x3d 0 ? currentPixel.r : (u_bandId_red \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat nir \x3d float(u_bandId_nir \x3d\x3d 0 ? currentPixel.r : (u_bandId_nir \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat savi_denom \x3d nir + red + u_constants[0];\nfloat savi;\nif (savi_denom \x3d\x3d 0.0) {\nsavi \x3d 0.0;\n} else {\nsavi \x3d (nir - red) / savi_denom * (1.0 + u_constants[0]);\n}\nreturn vec4(savi, savi, savi, currentPixel.a);\n}\nvec4 calculateMSAVI() {\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nfloat red \x3d float(u_bandId_red \x3d\x3d 0 ? currentPixel.r : (u_bandId_red \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat nir \x3d float(u_bandId_nir \x3d\x3d 0 ? currentPixel.r : (u_bandId_nir \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat msavi \x3d 0.5 * (2.0 * (nir + 1.0) - sqrt(pow((2.0 * nir + 1.0), 2.0) - 8.0 * (nir - red)));\nreturn vec4(msavi, msavi, msavi, currentPixel.a);\n}\nvec4 calculateTSAVI() {\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nfloat red \x3d float(u_bandId_red \x3d\x3d 0 ? currentPixel.r : (u_bandId_red \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat nir \x3d float(u_bandId_nir \x3d\x3d 0 ? currentPixel.r : (u_bandId_nir \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat s \x3d u_constants[0];\nfloat a \x3d u_constants[1];\nfloat x \x3d u_constants[2];\nfloat tsavi_denom \x3d a * nir + red - a * s + x * (1.0 + s * s);\nfloat tsavi;\nif (tsavi_denom \x3d\x3d 0.0) {\ntsavi \x3d 0.0;\n} else {\ntsavi \x3d s * (nir - s * red - a) / tsavi_denom;\n}\nreturn vec4(tsavi, tsavi, tsavi, currentPixel.a);\n}\nvec4 calculatePVI() {\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nfloat red \x3d float(u_bandId_red \x3d\x3d 0 ? currentPixel.r : (u_bandId_red \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat nir \x3d float(u_bandId_nir \x3d\x3d 0 ? currentPixel.r : (u_bandId_nir \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat a \x3d u_constants[0];\nfloat b \x3d u_constants[1];\nfloat pvi \x3d (nir - a * red - b) / sqrt(1.0 + a * 2.0);\nreturn vec4(pvi, pvi, pvi, currentPixel.a);\n}\nvec4 calculateGEMI() {\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nfloat red \x3d float(u_bandId_red \x3d\x3d 0 ? currentPixel.r : (u_bandId_red \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat nir \x3d float(u_bandId_nir \x3d\x3d 0 ? currentPixel.r : (u_bandId_nir \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat gemi;\nif (red \x3d\x3d 1.0) {\ngemi \x3d 0.0;\n} else {\nfloat eta \x3d (2.0 * (nir * nir - red * red) + 1.5 * nir + 0.5 * red) / (nir + red + 0.5);\nfloat gemi \x3d eta * (1.0 - 0.25*eta) - (red - 0.125) / (1.0 - red);\n}\nreturn vec4(gemi, gemi, gemi, currentPixel.a);\n}\nvec4 calculateVARI() {\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nfloat red \x3d float(currentPixel.r);\nfloat green \x3d float(currentPixel.g);\nfloat blue \x3d float(currentPixel.b);\nfloat vari \x3d (green - red) /(green + red - blue);\nreturn vec4(vari, vari, vari, currentPixel.a);\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\nvec4 pv;\nif (u_method \x3c 4) {\nif (u_method \x3d\x3d 1) {\npv \x3d calculateNDVI();\n} else if (u_method \x3d\x3d 2) {\npv \x3d calculateSAVI();\n} else if (u_method \x3d\x3d 3) {\npv \x3d calculateTSAVI();\n} else if (u_method \x3d\x3d 4) {\npv \x3d calculateMSAVI();\n}\n} else {\nif (u_method \x3d\x3d 5) {\npv \x3d calculateGEMI();\n} else if (u_method \x3d\x3d 6) {\npv \x3d calculatePVI();\n} else if (u_method \x3d\x3d 7) {\npv \x3d calculateGEMI();\n} else if (u_method \x3d\x3d 9) {\npv \x3d calculateVARI();\n}\n}\ngl_FragColor \x3d pv;\n}",
colormap:"precision mediump float;\nuniform sampler2D u_image;\nuniform sampler2D u_image1;\nvarying vec2 v_texCoord;\nuniform float u_indexedColormapOffset;\nuniform float u_indexedColormapMaxIndex;\nvec4 colorize() {\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nfloat clrIndex \x3d currentPixel.r - u_indexedColormapOffset;\nvec4 result;\nif (currentPixel.a \x3d\x3d 0.0 || clrIndex \x3e u_indexedColormapMaxIndex) {\nresult \x3d vec4(0.0, 0.0, 0.0, 0.0);\n}\nelse {\nvec2 clrPosition \x3d vec2(clrIndex / u_indexedColormapMaxIndex, 0.0);\nvec4 color \x3d texture2D(u_image1, clrPosition);\nresult \x3d vec4(color.r, color.g, color.b, color.a);\n}\nreturn result;\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\ngl_FragColor \x3d colorize();\n}",
compositeBand:"precision mediump float;\nuniform sampler2D u_image;\nuniform sampler2D u_image1;\nuniform sampler2D u_image2;\nvarying vec2 v_texCoord;\nuniform int u_rasterCount;\nvec4 composite() {\nvec4 p0, p1, p2;\np0 \x3d texture2D(u_image, v_texCoord);\nvec4 result;\nif (u_rasterCount \x3d\x3d 1){\nresult \x3d p0;\n}\nelse if (u_rasterCount \x3d\x3d 2){\np1 \x3d texture2D(u_image1, v_texCoord);\nresult \x3d vec4(p0.r,p1.r,0.0,min(p0.a,p1.a));\n}\nelse if (u_rasterCount \x3d\x3d 3){\np1 \x3d texture2D(u_image1, v_texCoord);\np2 \x3d texture2D(u_image2, v_texCoord);\nresult \x3d vec4(p0.r,p1.r,p2.r,min(min(p0.a,p1.a),p2.a));\n}\nreturn result;\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\ngl_FragColor \x3d composite();\n}",
constant:"precision mediump float;\nuniform vec4 u_color;\nvoid main() {\ngl_FragColor \x3d u_color;\n}",contrastBrightness:"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform float u_contrastOffset;\nuniform float u_brightnessOffset;\nuniform float u_scaleFactor;\nvec4 adjustContrastBrightness() {\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nfloat c \x3d u_contrastOffset;\nfloat b \x3d u_brightnessOffset;\nfloat maxI \x3d 255.0;\nfloat mid \x3d 128.0;\nvec4 v;\nif (c \x3e 0.0 \x26\x26 c \x3c 100.0) {\nv \x3d (200.0 * currentPixel - 100.0 * maxI + 2.0 * maxI * b) / (2.0 * (100.0 - c)) + mid;\n} else if (c \x3c\x3d 0.0 \x26\x26 c \x3e -100.0) {\nv \x3d (200.0 * currentPixel - 100.0 * maxI + 2.0 * maxI * b) * (100.0 + c) / 20000.0 + mid;\n} else if (c \x3d\x3d 100.0) {\nv \x3d (200.0 * currentPixel - 100.0 * maxI + (maxI + 1.0) * (100.0 - c) + 2.0 * maxI * b);\nv \x3d (sign(v) + 1.0) / 2.0; //binary contrast with extra mid tone at 0.5\n} else if (c \x3d\x3d -100.0) {\nv \x3d vec4(mid, mid, mid, currentPixel.a); //no contrast\n}\nreturn vec4(v.r / u_scaleFactor, v.g / u_scaleFactor, v.b / u_scaleFactor, currentPixel.a);\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\ngl_FragColor \x3d adjustContrastBrightness();\n}",
convolution:"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform vec2 u_resolution;\nuniform float u_kernel[25];\nuniform int u_kernelSize;\nvec4 convolve33(){\nvec4 vp11, vp12, vp13, vp21, vp22, vp23, vp31, vp32, vp33;\nvec2 xy11 \x3d vec2(-1.0, -1.0);\nvec2 xy12 \x3d vec2(0.0, -1.0);\nvec2 xy13 \x3d vec2(1.0, -1.0);\nvec2 xy21 \x3d vec2(-1.0, 0.0);\nvec2 xy23 \x3d vec2(1.0, 0.0);\nvec2 xy31 \x3d vec2(-1.0, 1.0);\nvec2 xy32 \x3d vec2(0.0, 1.0);\nvec2 xy33 \x3d vec2(1.0, 1.0);\nif (v_texCoord.s \x3c u_resolution.s) {\nxy11[0] \x3d 1.0;\nxy21[0] \x3d 1.0;\nxy31[0] \x3d 1.0;\n}\nif (v_texCoord.t \x3c u_resolution.t) {\nxy11[1] \x3d 1.0;\nxy12[1] \x3d 1.0;\nxy13[1] \x3d 1.0;\n}\nif (v_texCoord.s \x3e 1.0 - u_resolution.s) {\nxy13[0] \x3d -1.0;\nxy23[0] \x3d -1.0;\nxy33[0] \x3d -1.0;\n}\nif (v_texCoord.t \x3e 1.0 - u_resolution.t) {\nxy31[1] \x3d -1.0;\nxy32[1] \x3d -1.0;\nxy33[1] \x3d -1.0;\n}\nvec4 convolResult \x3d\ntexture2D(u_image, v_texCoord + u_resolution * xy11) * u_kernel[0] +\ntexture2D(u_image, v_texCoord + u_resolution * xy12) * u_kernel[1] +\ntexture2D(u_image, v_texCoord + u_resolution * xy13) * u_kernel[2] +\ntexture2D(u_image, v_texCoord + u_resolution * xy21) * u_kernel[3] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(0, 0)) * u_kernel[4] +\ntexture2D(u_image, v_texCoord + u_resolution * xy23) * u_kernel[5] +\ntexture2D(u_image, v_texCoord + u_resolution * xy31) * u_kernel[6] +\ntexture2D(u_image, v_texCoord + u_resolution * xy32) * u_kernel[7] +\ntexture2D(u_image, v_texCoord + u_resolution * xy33) * u_kernel[8];\nreturn vec4(convolResult.rgb, texture2D(u_image, v_texCoord).a);\n}\nvec4 convolve55(){\nvec4 vp11, vp12, vp13, vp21, vp22, vp23, vp31, vp32, vp33;\nfloat xdif[5];//https://www.opengl.org/wiki/Data_Type_(GLSL) array constructor ES3.0\nfloat ydif[5];\nfloat a \x3d -2.0;\nfor (int i\x3d0; i\x3c5; i++){\nxdif[i] \x3d a;\nydif[i] \x3d a;\na++;\n}\nif (v_texCoord.s \x3c u_resolution.s *2.0) { //2 pixel\nxdif[0] \x3d 2.0;\nif (v_texCoord.s \x3c u_resolution.s) { //1 pixel\nxdif[1] \x3d 1.0;\n}\n}\nelse if (v_texCoord.s \x3e 1.0 - u_resolution.s *2.0) {\nxdif[0] \x3d -2.0;\nif (v_texCoord.s \x3e 1.0 - u_resolution.s) {\nxdif[1] \x3d -1.0;\n}\n}\nif (v_texCoord.t \x3c u_resolution.t *2.0) {\nydif[0] \x3d 2.0;\nif (v_texCoord.t \x3c u_resolution.t) {\nydif[1] \x3d 1.0;\n}\n}\nelse if (v_texCoord.t \x3e 1.0 - u_resolution.t*2.0) {\nydif[0] \x3d -2.0;\nif (v_texCoord.t \x3e 1.0 - u_resolution.t) {\nydif[1] \x3d -1.0;\n}\n}\nvec4 convolResult \x3d\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[0], ydif[0])) * u_kernel[0] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[1], ydif[0])) * u_kernel[1] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[2], ydif[0])) * u_kernel[2] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[3], ydif[0])) * u_kernel[3] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[4], ydif[0])) * u_kernel[4] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[0], ydif[1])) * u_kernel[5] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[1], ydif[1])) * u_kernel[6] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[2], ydif[1])) * u_kernel[7] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[3], ydif[1])) * u_kernel[8] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[4], ydif[1])) * u_kernel[9] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[0], ydif[2])) * u_kernel[10] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[1], ydif[2])) * u_kernel[11] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[2], ydif[2])) * u_kernel[12] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[3], ydif[2])) * u_kernel[13] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[4], ydif[2])) * u_kernel[14] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[0], ydif[3])) * u_kernel[15] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[1], ydif[3])) * u_kernel[16] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[2], ydif[3])) * u_kernel[17] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[3], ydif[3])) * u_kernel[18] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[4], ydif[3])) * u_kernel[19] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[0], ydif[4])) * u_kernel[20] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[1], ydif[4])) * u_kernel[21] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[2], ydif[4])) * u_kernel[22] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[3], ydif[4])) * u_kernel[23] +\ntexture2D(u_image, v_texCoord + u_resolution * vec2(xdif[4], ydif[4])) * u_kernel[24];\nreturn vec4(convolResult.rgb, texture2D(u_image, v_texCoord).a);\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\nif (u_kernelSize \x3d\x3d 9){\ngl_FragColor \x3d convolve33();\n}\nelse {\ngl_FragColor \x3d convolve55();\n}\n}",
extractBand:"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform int u_bandIDs[3];\nuniform bool u_alterBand;\nvec4 extractBand() {\nvec4 p \x3d texture2D(u_image, v_texCoord);\nif (!u_alterBand){\nreturn p;\n}\nfloat r, g, b;\nif (u_bandIDs[0] \x3d\x3d0){\nr \x3d p.r;\n}\nelse if (u_bandIDs[0] \x3d\x3d1){\nr \x3d p.g;\n}\nelse if (u_bandIDs[0] \x3d\x3d2){\nr \x3d p.b;\n}\nif (u_bandIDs[1] \x3d\x3d0){\ng \x3d p.r;\n}\nelse if (u_bandIDs[1] \x3d\x3d1){\ng \x3d p.g;\n}\nelse if (u_bandIDs[1] \x3d\x3d2){\ng \x3d p.b;\n}\nif (u_bandIDs[2] \x3d\x3d0){\nb \x3d p.r;\n}\nelse if (u_bandIDs[2] \x3d\x3d1){\nb \x3d p.g;\n}\nelse if (u_bandIDs[2] \x3d\x3d2){\nb \x3d p.b;\n}\nreturn vec4(r, g, b, p.a);\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\ngl_FragColor \x3d extractBand();\n}",
hillshade:"precision mediump float;\nuniform sampler2D u_image;\nuniform sampler2D u_image1;\nvarying vec2 v_texCoord;\nuniform vec2 u_resolution;\nuniform int u_slopeType;\nuniform int u_hillshadeType;\nuniform int u_lightSourceCount;\nuniform float u_sinZcosA;\nuniform float u_sinZsinA;\nuniform float u_cosZ;\nuniform float u_sinZcosAs[6];\nuniform float u_sinZsinAs[6];\nuniform float u_cosZs[6];\nuniform float u_weights[6];\nuniform float u_xFactor;\nuniform float u_yFactor;\nuniform bool u_scaled;\nuniform float u_minValue;\nuniform float u_maxValue;\nuniform bool u_applyColorramp;\nuniform float u_indexedColormapOffset;\nuniform float u_indexedColormapMaxIndex;\nuniform vec2 u_rawResolution;\nuniform int u_resampling;\nvec4 getPixelValue(vec2 coords) {\nif (u_resampling \x3d\x3d 0) {\nreturn texture2D(u_image, coords);\n}\nvec2 pos_ul \x3d floor(coords / u_rawResolution) * u_rawResolution;\nvec2 pos_ur \x3d pos_ul + vec2(1.0, 0.0) * u_rawResolution;\nvec2 pos_ll \x3d pos_ul + vec2(0.0, 1.0) * u_rawResolution;\nvec2 pos_lr \x3d pos_ul + vec2(1.0, 1.0) * u_rawResolution;\nvec2 weight \x3d fract(coords / u_rawResolution);\nvec4 vp_ul \x3d texture2D(u_image, pos_ul);\nvec4 vp_ur \x3d texture2D(u_image, pos_ur);\nvec4 vp_ll \x3d texture2D(u_image, pos_ll);\nvec4 vp_lr \x3d texture2D(u_image, pos_lr);\nvec4 vp \x3d mix(mix(vp_ul, vp_ur, weight.x), mix(vp_ll, vp_lr, weight.x), weight.y);\nreturn vp;\n}\nfloat getNeighborHoodAlpha(float a, float b, float c, float d, float e, float f, float g, float h, float i){\nif (a \x3d\x3d 0.0 || a \x3d\x3d 0.0 || a\x3d\x3d0.0 || a \x3d\x3d 0.0 || a \x3d\x3d 0.0 || a\x3d\x3d0.0 || a \x3d\x3d 0.0 || a \x3d\x3d 0.0 || a\x3d\x3d0.0) {\nreturn 0.0;\n}\nelse {\nreturn e;\n}\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvec3 rgb2hsv(vec3 c) {\nvec4 K \x3d vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\nvec4 p \x3d c.g \x3c c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);\nvec4 q \x3d c.r \x3c p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);\nfloat d \x3d q.x - min(q.w, q.y);\nfloat e \x3d 1.0e-10;\nreturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);\n}\nvec3 hsv2rgb(vec3 c) {\nvec4 K \x3d vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\nvec3 p \x3d abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\nreturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\nvec4 overlay(float val, float minValue, float maxValue, float hillshade, float alpha) {\nfloat clrIndex \x3d clamp((val - minValue) / (maxValue - minValue), 0.0, 1.0);\nvec4 rgb \x3d texture2D(u_image1, vec2(clrIndex, 0.0));\nvec3 hsv \x3d rgb2hsv(rgb.xyz);\nhsv.z \x3d hillshade;\nreturn vec4(hsv2rgb(hsv) * alpha, alpha);\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\nvec4 va, vb, vc, vd, ve, vf, vg, vh, vi;\nvec2 axy \x3d vec2(-1.0, -1.0);\nvec2 bxy \x3d vec2(0.0, -1.0);\nvec2 cxy \x3d vec2(1.0, -1.0);\nvec2 dxy \x3d vec2(-1.0, 0.0);\nvec2 fxy \x3d vec2(1.0, 0.0);\nvec2 gxy \x3d vec2(-1.0, 1.0);\nvec2 hxy \x3d vec2(0.0, 1.0);\nvec2 ixy \x3d vec2(1.0, 1.0);\nif (v_texCoord.s \x3c u_resolution.s) {\naxy[0] \x3d 1.0;\ndxy[0] \x3d 1.0;\ngxy[0] \x3d 1.0;\n}\nif (v_texCoord.t \x3c u_resolution.t) {\naxy[1] \x3d 1.0;\nbxy[1] \x3d 1.0;\ncxy[1] \x3d 1.0;\n}\nif (v_texCoord.s \x3e 1.0 - u_resolution.s) {\ncxy[0] \x3d -1.0;\nfxy[0] \x3d -1.0;\nixy[0] \x3d -1.0;\n}\nif (v_texCoord.t \x3e 1.0 - u_resolution.t) {\ngxy[1] \x3d -1.0;\nhxy[1] \x3d -1.0;\nixy[1] \x3d -1.0;\n}\nva \x3d texture2D(u_image, v_texCoord + u_resolution * axy);\nvb \x3d texture2D(u_image, v_texCoord + u_resolution * bxy);\nvc \x3d texture2D(u_image, v_texCoord + u_resolution * cxy);\nvd \x3d texture2D(u_image, v_texCoord + u_resolution * dxy);\nve \x3d texture2D(u_image, v_texCoord + u_resolution * vec2(0, 0));\nvf \x3d texture2D(u_image, v_texCoord + u_resolution * fxy);\nvg \x3d texture2D(u_image, v_texCoord + u_resolution * gxy);\nvh \x3d texture2D(u_image, v_texCoord + u_resolution * hxy);\nvi \x3d texture2D(u_image, v_texCoord + u_resolution * ixy);\nfloat alpha \x3d getNeighborHoodAlpha(va.a, vb.a, vc.a, vd.a, ve.a, vf.a, vg.a, vh.a, vi.a);\nfloat dzx \x3d (vc + 2.0 * vf + vi - va - 2.0 * vd - vg).r * u_xFactor;\nfloat dzy \x3d (vg + 2.0 * vh + vi - va - 2.0 * vb - vc).r * u_yFactor; //flip\nfloat s2 \x3d sqrt(1.0 + dzx * dzx + dzy * dzy);\nfloat hillshade \x3d 0.0;\nif (u_hillshadeType \x3d\x3d 0){\nfloat cosDelta \x3d u_sinZsinA * dzy - u_sinZcosA * dzx;\nfloat z \x3d (u_cosZ + cosDelta) / s2;\nif (z \x3c 0.0)  z \x3d 0.0;\nhillshade \x3d z;\n}\nelse if (u_hillshadeType \x3d\x3d 1){\nfor (int k \x3d 0; k \x3c 6; k++) {\nfloat cosDelta \x3d u_sinZsinAs[k] * dzy - u_sinZcosAs[k] * dzx;\nfloat z \x3d (u_cosZs[k] + cosDelta) / s2;\nif (z \x3c 0.0) z \x3d 0.0;\nhillshade \x3d hillshade + z * u_weights[k];\nif (k \x3d\x3d u_lightSourceCount-1) break;\n}\n}\nif (u_applyColorramp) {\nvec4 result \x3d overlay(ve.r, u_minValue, u_maxValue, hillshade, alpha);\nif (u_scaled) {\nresult \x3d vec4(result.rgb * 255.0, result.a);\n}\ngl_FragColor \x3d result;\n} else {\nif (u_scaled) {\nhillshade \x3d hillshade * 255.0;\nif (hillshade\x3e 255.0) {\nhillshade \x3d 255.0;\n}\n}\ngl_FragColor \x3d vec4(hillshade, hillshade, hillshade, alpha);\n}\n}",
identity:"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform int u_bandCount;\nfloat shift_right(float v, float amt) {\nv \x3d floor(v) + 0.5;\nreturn floor(v / exp2(amt));\n}\nfloat shift_left(float v, float amt) {\nreturn floor(v * exp2(amt) + 0.5);\n}\nfloat mask_last(float v, float bits) {\nreturn mod(v, shift_left(1.0, bits));\n}\nfloat extract_bits(float num, float from, float to) {\nfrom \x3d floor(from + 0.5);\nto \x3d floor(to + 0.5);\nreturn mask_last(shift_right(num, from), to - from);\n}\nvec4 encode_float(float val) {\nif (val \x3d\x3d 0.0)\nreturn vec4(0, 0, 0, 0);\nfloat sign \x3d val \x3e 0.0 ? 0.0 : 1.0;\nval \x3d abs(val);\nfloat exponent \x3d floor(log2(val));\nfloat biased_exponent \x3d exponent + 127.0;\nfloat fraction \x3d ((val / exp2(exponent)) - 1.0) * 8388608.0;\nfloat t \x3d biased_exponent / 2.0;\nfloat last_bit_of_biased_exponent \x3d fract(t) * 2.0;\nfloat remaining_bits_of_biased_exponent \x3d floor(t);\nfloat byte4 \x3d extract_bits(fraction, 0.0, 8.0) / 255.0;\nfloat byte3 \x3d extract_bits(fraction, 8.0, 16.0) / 255.0;\nfloat byte2 \x3d (last_bit_of_biased_exponent * 128.0 + extract_bits(fraction, 16.0, 23.0)) / 255.0;\nfloat byte1 \x3d (sign * 128.0 + remaining_bits_of_biased_exponent) / 255.0;\nreturn vec4(byte4, byte3, byte2, byte1);\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\nvec4 currentPixel \x3d  texture2D(u_image, v_texCoord);\ngl_FragColor \x3d vec4( currentPixel.rgb, currentPixel.a); //encode_float(currentPixel.r);\n}",
local:"precision mediump float;\nuniform sampler2D u_image;\nuniform sampler2D u_image1;\nuniform sampler2D u_image2;\nvarying vec2 v_texCoord;\nuniform int u_rasterCount;\nvec4 polyfill;\nvec4 localOp1() {\nvec4 a \x3d texture2D(u_image, v_texCoord);\nvec4 result;\nvec4 replaceme1;\nreturn result;\n}\nvec4 localOp2() {\nvec4 a \x3d texture2D(u_image, v_texCoord);\nvec4 b \x3d texture2D(u_image1, v_texCoord);\nvec4 result;\nvec4 replaceme2;\nreturn result;\n}\nvec4 localOp3() {\nvec4 a \x3d texture2D(u_image, v_texCoord);\nvec4 b \x3d texture2D(u_image1, v_texCoord);\nvec4 c \x3d texture2D(u_image2, v_texCoord);\nvec4 result;\nvec4 replaceme3;\nreturn result;\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\ngl_FragColor \x3d localOp1();\n}",
local0:"precision mediump float;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_texCoord;\nuniform float u_minCutOff[3];\nuniform float u_maxCutOff[3];\nuniform float u_minOutput[3];\nuniform float u_maxOutput[3];\nuniform float u_factor[3];\nuniform int u_operation;\nuniform int u_constant[3];\nuniform vec4 gamma;\nfloat localOperate1(float a, float b, float c){\nfloat result;\nif (u_operation \x3d\x3d 1){\nresult \x3d a + b;\n}\nelse if (u_operation \x3d\x3d 2){\nresult \x3d a - b;\n}\nelse if (u_operation \x3d\x3d3){\nresult \x3d a * b;\n}\nelse if (u_operation \x3d\x3d4){\nresult \x3d sqrt(a);\n}\nelse if (u_operation \x3d\x3d5){\nresult \x3d pow(a, b);\n}\nelse if (u_operation \x3d\x3d6){\nresult \x3d acos(a);\n}\nelse if (u_operation \x3d\x3d7){\nresult \x3d asin(a);\n}\nelse if (u_operation \x3d\x3d8){\nresult \x3d atan(a);\n}\nelse if (u_operation \x3d\x3d9){\nresult \x3d 999.0; //atanh not available\n}\nelse if (u_operation \x3d\x3d10){\nresult \x3d abs(a);\n}\nelse if (u_operation \x3d\x3d13){\nresult \x3d 999.0; //bitwise not available\n}\nelse if (u_operation \x3d\x3d17){\nresult \x3d a !\x3d 0.0 \x26\x26 b !\x3d0.0;\n}\nelse if (u_operation \x3d\x3d18){\nresult \x3d a \x3d\x3d0.0? 1.0:0.0;\n}\nelse if (u_operation \x3d\x3d19){\nresult \x3d a !\x3d 0.0 || b !\x3d0.0;\n}\nelse if (u_operation \x3d\x3d20){\nresult \x3d a !\x3d 0.0 ^^ b !\x3d0.0; //exclusive or\n}\nelse if (u_operation \x3d\x3d21){\nresult \x3d cos(a);\n}\nelse if (u_operation \x3d\x3d23){\nresult \x3d a / b;\n}\nelse if (u_operation \x3d\x3d24){\nresult \x3d a \x3d\x3d b ? 1.0:0.0;\n}\nelse if (u_operation \x3d\x3d25){\nresult \x3d exp(a);\n}\nelse if (u_operation \x3d\x3d26){\nresult \x3d pow(10.0, a);\n}\nelse if (u_operation \x3d\x3d27){\nresult \x3d exp2(a);\n}\nelse if (u_operation \x3d\x3d28){\nresult \x3d a \x3e b? 1.0 : 0.0;\n}\nelse if (u_operation \x3d\x3d29){\nresult \x3d  a \x3e\x3d b? 1.0 : 0.0;\n}\nelse if (u_operation \x3d\x3d30){\nresult \x3d floor(a); //int\n}\nelse if (u_operation \x3d\x3d31){\nresult \x3d a \x3d\x3d0? 1.0:0.0; //null pass mask\n}\nelse if (u_operation \x3d\x3d32){\nresult \x3d a; //float\n}\nelse if (u_operation \x3d\x3d33){\nresult \x3d a \x3c b? 1.0 : 0.0;\n}\nelse if (u_operation \x3d\x3d34){\nresult \x3d a \x3c\x3d b? 1.0 : 0.0;\n}\nelse if (u_operation \x3d\x3d35){\nresult \x3d log(a);\n}\nelse if (u_operation \x3d\x3d36){\nresult \x3d log2(a) / log2(10.0);\n}\nelse if (u_operation \x3d\x3d37){\nresult \x3d log2(a);\n}\nelse if (u_operation \x3d\x3d44){\nresult \x3d mod(a, b);\n}\nelse if (u_operation \x3d\x3d45){\nresult \x3d -a;\n}\nelse if (u_operation \x3d\x3d46){\nresult \x3d a !\x3d b? 1.0 : 0.0;\n}\nelse if (u_operation \x3d\x3d48){\nresult \x3d ceil(a);\n}\nelse if (u_operation \x3d\x3d49){\nresult \x3d floor(a);\n}\nelse if (u_operation \x3d\x3d51){\nresult \x3d sin(a);\n}\nelse if (u_operation \x3d\x3d53){\nresult \x3d a * a;\n}\nelse if (u_operation \x3d\x3d56){\nresult \x3d tan(a);\n}\nelse if (u_operation \x3d\x3d57){\nresult \x3d 999.0; //tanh not available\n}\nelse if (u_operation \x3d\x3d59){\nresult \x3d 999.0; //acosh not available\n}\nelse if (u_operation \x3d\x3d60){\nresult \x3d 999.0; //asinh not available\n}\nelse if (u_operation \x3d\x3d61){\nresult \x3d atan(a, b);\n}\nelse if (u_operation \x3d\x3d64){\nresult \x3d a / b;\n}\nelse if (u_operation \x3d\x3d65){\nresult \x3d floor(a/b);\n}\nelse if (u_operation \x3d\x3d76){\nresult \x3d a !\x3d0? b:c;\n}\n}\nvoid main() {\nvec4 currentPixel0 \x3d  texture2D(u_image0, v_texCoord);\nfloat graya, reda, greena, bluea;\nif (u_bandCount \x3d\x3d 1) {\ngraya \x3d stretchOneaue(float(currentPixel.r), u_minCutOff[0], u_maxCutOff[0], u_minOutput[0], u_maxOutput[0], u_factor[0]);\ngl_FragColor \x3d vec4(graya, graya, graya, currentPixel.a);\n}\nelse if (u_bandCount \x3d\x3d 3) {\nreda \x3d stretchOneaue(float(currentPixel.r), u_minCutOff[0], u_maxCutOff[0], u_minOutput[0], u_maxOutput[0], u_factor[0]);\ngreena \x3d stretchOneaue(float(currentPixel.g), u_minCutOff[1], u_maxCutOff[1], u_minOutput[1], u_maxOutput[1], u_factor[1]);\nbluea \x3d stretchOneaue(float(currentPixel.b), u_minCutOff[2], u_maxCutOff[2], u_minOutput[2], u_maxOutput[2], u_factor[2]);\ngl_FragColor \x3d vec4(reda, greena, bluea, currentPixel.a);\n}\n}",
mask:"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform float u_includedRanges[6];\nuniform bool u_includedRanges_specified;\nuniform float u_noDataValues[6];\nuniform bool u_noDataValues_specified;\nuniform int u_noDataInterpretation;\nuniform int u_bandCount;\nvec4 mask() {\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nvec4 processedPixel \x3d currentPixel;\nif (u_includedRanges_specified) {\nif (u_bandCount \x3d\x3d 1) {\nif (currentPixel.r \x3e u_includedRanges[0] \x26\x26 currentPixel.r \x3c u_includedRanges[1])\nprocessedPixel \x3d vec4(currentPixel.rgb, currentPixel.a);\nelse\nprocessedPixel \x3d vec4(currentPixel.rgb, 0);\n} else if (u_bandCount \x3d\x3d 3) {\nif (currentPixel.r \x3e u_includedRanges[0] \x26\x26 currentPixel.r \x3c u_includedRanges[1] \x26\x26 currentPixel.g \x3e u_includedRanges[2] \x26\x26 currentPixel.g \x3c u_includedRanges[3] \x26\x26 currentPixel.b \x3e u_includedRanges[4] \x26\x26 currentPixel.b \x3c u_includedRanges[5])\nprocessedPixel \x3d vec4(currentPixel.rgb, currentPixel.a);\nelse\nprocessedPixel \x3d vec4(currentPixel.rgb, 0);\n}\n}\nif (u_noDataValues_specified) {\nif (u_bandCount \x3d\x3d 1) {\nif (processedPixel.r \x3d\x3d u_noDataValues[0])\nprocessedPixel \x3d vec4(processedPixel.rgb, 0);\nelse\nprocessedPixel \x3d vec4(processedPixel.rgb, processedPixel.a);\n} else if (u_bandCount \x3d\x3d 3) {\nif (u_noDataInterpretation \x3d\x3d1 \x26\x26 processedPixel.r \x3d\x3d u_noDataValues[0] \x26\x26 processedPixel.g \x3d\x3d u_noDataValues[1] \x26\x26 processedPixel.b \x3d\x3d u_noDataValues[2])\nprocessedPixel \x3d vec4(processedPixel.rgb, 0);\nelse if (processedPixel.r \x3d\x3d u_noDataValues[0] || processedPixel.g \x3d\x3d u_noDataValues[1] || processedPixel.b \x3d\x3d u_noDataValues[2])\nprocessedPixel \x3d vec4(processedPixel.rgb, 0);\nelse\nprocessedPixel \x3d vec4(processedPixel.rgb, processedPixel.a);\n}\n}\nreturn processedPixel;\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\ngl_FragColor \x3d mask();\n}",
ndvi:"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform int u_bandId_red;\nuniform int u_bandId_nir;\nuniform bool u_scaled;\nuniform int u_bandCount;\nvec4 calculateNDVI(){\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nfloat red \x3d float(u_bandId_red \x3d\x3d 0 ? currentPixel.r : (u_bandId_red \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat nir \x3d float(u_bandId_nir \x3d\x3d 0 ? currentPixel.r : (u_bandId_nir \x3d\x3d 1 ? currentPixel.g : currentPixel.b));\nfloat ndvi_denom \x3d nir + red;\nfloat ndvi;\nif (ndvi_denom \x3d\x3d 0.0) {\nndvi \x3d 0.0;\n}\nelse {\nndvi \x3d (nir - red) / ndvi_denom;\nif (u_scaled) {\nndvi \x3d float(floor(ndvi * 100.0 + 100.5));\n}\n}\nreturn vec4(ndvi, ndvi, ndvi, currentPixel.a);\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\ngl_FragColor \x3d calculateNDVI();\n}",
remap:"precision mediump float;\nuniform sampler2D u_image;\nuniform sampler2D u_image1;\nvarying vec2 v_texCoord;\nuniform float u_indexedColormapOffset;\nuniform float u_indexedColormapMaxIndex;\nuniform float u_breaks[16];\nuniform vec2 u_rawResolution;\nuniform int u_resampling;\nvec4 getPixelValue(vec2 coords) {\nif (u_resampling \x3d\x3d 0) {\nreturn texture2D(u_image, coords);\n}\nvec2 pos_ul \x3d floor(coords / u_rawResolution) * u_rawResolution;\nvec2 pos_ur \x3d pos_ul + vec2(1.0, 0.0) * u_rawResolution;\nvec2 pos_ll \x3d pos_ul + vec2(0.0, 1.0) * u_rawResolution;\nvec2 pos_lr \x3d pos_ul + vec2(1.0, 1.0) * u_rawResolution;\nvec2 weight \x3d fract(coords / u_rawResolution);\nvec4 vp_ul \x3d texture2D(u_image, pos_ul);\nvec4 vp_ur \x3d texture2D(u_image, pos_ur);\nvec4 vp_ll \x3d texture2D(u_image, pos_ll);\nvec4 vp_lr \x3d texture2D(u_image, pos_lr);\nvec4 vp \x3d mix(mix(vp_ul, vp_ur, weight.x), mix(vp_ll, vp_lr, weight.x), weight.y);\nreturn vp;\n}\nfloat getRemapIndex(float pixelValue) {\nif (pixelValue \x3c u_breaks[0] || pixelValue \x3e u_breaks[15]) {\nreturn -1.0;\n}\nfor (int i \x3d 0; i \x3c 16; i++) {\nif (pixelValue \x3c u_breaks[i]) {\nreturn float(i - 1);\n}\n}\nif (pixelValue \x3d\x3d u_breaks[15]) {\nreturn 15.0;\n}\nreturn 0.0;\n}\nvec4 colorize(float pv) {\nfloat clrIndex \x3d pv - u_indexedColormapOffset;\nvec4 result;\nif (clrIndex \x3e u_indexedColormapMaxIndex) {\nresult \x3d vec4(0.0, 0.0, 0.0, 0.0);\n}\nelse {\nvec2 clrPosition \x3d vec2(clrIndex / u_indexedColormapMaxIndex, 0.0);\nvec4 color \x3d texture2D(u_image1, clrPosition);\nresult \x3d vec4(color.r, color.g, color.b, color.a);\n}\nreturn result;\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\nvec4 currentPixel \x3d texture2D(u_image, v_texCoord);\nif (currentPixel.a \x3d\x3d 0.0) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn;\n}\nfloat remappedIndex \x3d getRemapIndex(currentPixel.r);\nif (remappedIndex \x3c 0.0) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn;\n}\ngl_FragColor \x3d colorize(remappedIndex);\n}",
resample:"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform vec2 u_resamplingRatio;\nuniform int u_resamplingType;\nuniform vec2 u_anchor;\nuniform vec2 u_resolution;\nvec4 resample(){\nvec2 pos_nn, pos_ul, pos_ur, pos_ll, pos_lr, pos_offset;\nfloat weight,weight_total, weight_ul, weight_ur, weight_ll, weight_lr;\nvec4 vp;  //v_texCoord is canvas space 0-1\nvec2 originalResolution \x3d vec2(u_resolution.s*u_resamplingRatio.s, u_resolution.t*u_resamplingRatio.t);\nvec2 pos \x3d vec2(u_anchor.s+(v_texCoord.s-u_anchor.s),(u_anchor.t+(v_texCoord.t-u_anchor.t)));\nif (u_resamplingType \x3d\x3d 0)\n{//shift and scaling, y \x3d ax+b so x \x3d (y-b)/a\npos_nn \x3d vec2(floor(pos.s/originalResolution.s+0.5)*originalResolution.s,floor(pos.t/originalResolution.t+0.5)*originalResolution.t);\nif (pos_nn.s \x3c0.0 || pos_nn.s \x3e 1.0 || pos_nn.t \x3c0.0 || pos_nn.t \x3e 1.0){\nvp \x3d vec4(1.0, 0.0, 0.0, 1.0);//vec4(0.0, 1.0, 0.0, vp.a);\n}\nelse {\nvp \x3d texture2D(u_image, vec2(pos_nn.s, pos_nn.t));\n}\n}\nelse if (u_resamplingType \x3d\x3d 1)\n{//shift and scaling, 4 neighbors y \x3d ax+b so x \x3d (y-b)/a\npos_ul \x3d vec2(floor(pos.s/originalResolution.s)*originalResolution.s,floor(pos.t/originalResolution.t)*originalResolution.t);\npos_ur \x3d vec2(pos_ul.s+originalResolution.s, pos_ul.t);\npos_ll \x3d vec2(pos_ul.s, pos_ul.t+originalResolution.t);\npos_lr \x3d vec2(pos_ul.s+originalResolution.s, pos_ul.t+originalResolution.t);\npos_offset \x3d vec2(pos.s - floor(pos_ul.s),pos.t - floor(pos_ul.t));\nweight_lr \x3d sqrt(pow(pos_offset.s,2.0) + pow(pos_offset.t,2.0));\nweight_ul \x3d sqrt(pow( originalResolution.s- pos_offset.s,2.0)+ pow(originalResolution.t- pos_offset.t,2.0));\nweight_ur \x3d sqrt(pow( pos_offset.s,2.0)+ 1.0- pow(originalResolution.t - pos_offset.t,2.0));\nweight_ll \x3d sqrt(pow( originalResolution.s- pos_offset.s,2.0)+ pow(pos_offset.t,2.0));\nvp \x3d (texture2D(u_image, pos_ul) * weight_ul + texture2D(u_image, pos_ur) * weight_ur + texture2D(u_image, pos_ll) * weight_ll + texture2D(u_image, pos_lr) * weight_lr)/(weight_ul+weight_ur+weight_ll+weight_lr);\n}\nelse if (u_resamplingType \x3d\x3d 2)\n{//shift and scaling, 16 neighbors\nweight_total \x3d 0.0;\nvp \x3d vec4(0.0,0.0,0.0,0.0);\npos_ul \x3d vec2(floor(pos.s/originalResolution.s)*originalResolution.s-originalResolution.s,floor(pos.t/originalResolution.t)*originalResolution.t-originalResolution.t);\npos_offset \x3d vec2(pos.s - floor(pos_ul.s),pos.t - floor(pos_ul.t));\nfor (int i\x3d0; i\x3c4; i++){//row\nfor (int j\x3d0; j\x3c4; j++){//col\nweight \x3d sqrt(pow(pos_offset.s-float(j),2.0)+ pow(pos_offset.t-float(i),2.0));\nvp +\x3dtexture2D(u_image, vec2(pos_ul.s+float(i)*originalResolution.s,pos_ul.t+float(j)*originalResolution.t)) * weight;\nweight_total +\x3d weight;\n}\n}\nvp \x3d vp/weight_total;\n}\nreturn vp;\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\ngl_FragColor \x3d resample();\n}",
slope:"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texCoord;\nuniform vec2 u_resolution;\nuniform vec2 u_cellSize;\nuniform float u_zfactor;\nuniform float u_altitude;\nuniform float u_azimuth;\nfloat shift_right(float v, float amt) {\nv \x3d floor(v) + 0.5;\nreturn floor(v / exp2(amt));\n}\nfloat shift_left(float v, float amt) {\nreturn floor(v * exp2(amt) + 0.5);\n}\nfloat mask_last(float v, float bits) {\nreturn mod(v, shift_left(1.0, bits));\n}\nfloat extract_bits(float num, float from, float to) {\nfrom \x3d floor(from + 0.5);\nto \x3d floor(to + 0.5);\nreturn mask_last(shift_right(num, from), to - from);\n}\nvec4 encode_float(float val) {\nif (val \x3d\x3d 0.0)\nreturn vec4(0, 0, 0, 0);\nfloat sign \x3d val \x3e 0.0 ? 0.0 : 1.0;\nval \x3d abs(val);\nfloat exponent \x3d floor(log2(val));\nfloat biased_exponent \x3d exponent + 127.0;\nfloat fraction \x3d ((val / exp2(exponent)) - 1.0) * 8388608.0;\nfloat t \x3d biased_exponent / 2.0;\nfloat last_bit_of_biased_exponent \x3d fract(t) * 2.0;\nfloat remaining_bits_of_biased_exponent \x3d floor(t);\nfloat byte4 \x3d extract_bits(fraction, 0.0, 8.0) / 255.0;\nfloat byte3 \x3d extract_bits(fraction, 8.0, 16.0) / 255.0;\nfloat byte2 \x3d (last_bit_of_biased_exponent * 128.0 + extract_bits(fraction, 16.0, 23.0)) / 255.0;\nfloat byte1 \x3d (sign * 128.0 + remaining_bits_of_biased_exponent) / 255.0;\nreturn vec4(byte4, byte3, byte2, byte1);\n}\nfloat getNeighborHoodAlpha(float a, float b, float c, float d, float e, float f, float g, float h, float i){\nif (a \x3d\x3d 0.0 || a \x3d\x3d 0.0 || a\x3d\x3d0.0 || a \x3d\x3d 0.0 || a \x3d\x3d 0.0 || a\x3d\x3d0.0 || a \x3d\x3d 0.0 || a \x3d\x3d 0.0 || a\x3d\x3d0.0) {\nreturn 0.0;\n}\nelse {\nreturn e;\n}\n}\nvec4 calculateSlope() {\nfloat pi \x3d 3.141592653589793238;\nfloat dzx \x3d 0.0;\nfloat dzy \x3d 0.0;\nvec4 va,  vb,  vc,  vd,  ve,  vf,  vg,  vh,  vi;\nvec2 axy \x3d vec2(-1.0, -1.0);\nvec2 bxy \x3d vec2(0.0, -1.0);\nvec2 cxy \x3d vec2(1.0, -1.0);\nvec2 dxy \x3d vec2(-1.0, 0.0);\nvec2 fxy \x3d vec2(1.0, 0.0);\nvec2 gxy \x3d vec2(-1.0, 1.0);\nvec2 hxy \x3d vec2(0.0, 1.0);\nvec2 ixy \x3d vec2(1.0, 1.0);\nif (v_texCoord.s \x3c u_resolution.s) {\naxy[0] \x3d 1.0;\ndxy[0] \x3d 1.0;\ngxy[0] \x3d 1.0;\n}\nif (v_texCoord.t \x3c u_resolution.t) {\naxy[1] \x3d 1.0;\nbxy[1] \x3d 1.0;\ncxy[1] \x3d 1.0;\n}\nif (v_texCoord.s \x3e 1.0 - u_resolution.s) {\ncxy[0] \x3d -1.0;\nfxy[0] \x3d -1.0;\nixy[0] \x3d -1.0;\n}\nif (v_texCoord.t \x3e 1.0 - u_resolution.t) {\ngxy[1] \x3d -1.0;\nhxy[1] \x3d -1.0;\nixy[1] \x3d -1.0;\n}\nif (v_texCoord.s \x3e\x3d u_resolution.s \x26\x26 (1.0 - u_resolution.s) \x3e\x3d v_texCoord.s \x26\x26 v_texCoord.t \x3e\x3d u_resolution.t \x26\x26 (1.0 - u_resolution.t) \x3e\x3d v_texCoord.t) {\nva \x3d texture2D(u_image, v_texCoord + u_resolution * axy);\nvb \x3d texture2D(u_image, v_texCoord + u_resolution * bxy);\nvc \x3d texture2D(u_image, v_texCoord + u_resolution * cxy);\nvd \x3d texture2D(u_image, v_texCoord + u_resolution * dxy);\nve \x3d texture2D(u_image, v_texCoord + u_resolution * vec2(0, 0));\nvf \x3d texture2D(u_image, v_texCoord + u_resolution * fxy);\nvg \x3d texture2D(u_image, v_texCoord + u_resolution * gxy);\nvh \x3d texture2D(u_image, v_texCoord + u_resolution * hxy);\nvi \x3d texture2D(u_image, v_texCoord + u_resolution * ixy);\n}\ndzx \x3d (vc + 2.0 * vf + vi - va - 2.0 * vd - vg).r / (8.0 * u_cellSize[0]);\ndzy \x3d -(vg + 2.0 * vh + vi - va - 2.0 * vb - vc).r / (8.0 * u_cellSize[1]);\nfloat alpha \x3d getNeighborHoodAlpha(va.a, vb.a, vc.a, vd.a, ve.a, vf.a, vg.a, vh.a, vi.a);\nfloat slope \x3d atan(u_zfactor * sqrt(dzx * dzx + dzy * dzy)) * 57.2957795;\nreturn vec4(slope, slope, slope, alpha);\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\ngl_FragColor \x3d calculateSlope();\n}",
stretch:"precision mediump float;\nuniform sampler2D u_image;\nuniform sampler2D u_image1;\nuniform sampler2D u_image2;\nvarying vec2 v_texCoord;\nuniform float u_minCutOff[3];\nuniform float u_maxCutOff[3];\nuniform float u_minOutput[3];\nuniform float u_maxOutput[3];\nuniform float u_factor[3];\nuniform int u_bandCount;\nuniform vec2 u_sourceDim;\nuniform vec2 u_targetDim;\nuniform int u_state;\nuniform bool u_minMaxTexture;\nuniform bool u_useGamma;\nuniform float u_gamma[4];\nuniform float u_gammaCorrection[4];\nuniform bool u_scaled;\nuniform vec2 u_rawResolution;\nuniform int u_resampling;\nvec4 getPixelValue(vec2 coords) {\nif (u_resampling \x3d\x3d 0) {\nreturn texture2D(u_image, coords);\n}\nvec2 pos_ul \x3d floor(coords / u_rawResolution) * u_rawResolution;\nvec2 pos_ur \x3d pos_ul + vec2(1.0, 0.0) * u_rawResolution;\nvec2 pos_ll \x3d pos_ul + vec2(0.0, 1.0) * u_rawResolution;\nvec2 pos_lr \x3d pos_ul + vec2(1.0, 1.0) * u_rawResolution;\nvec2 weight \x3d fract(coords / u_rawResolution);\nvec4 vp_ul \x3d texture2D(u_image, pos_ul);\nvec4 vp_ur \x3d texture2D(u_image, pos_ur);\nvec4 vp_ll \x3d texture2D(u_image, pos_ll);\nvec4 vp_lr \x3d texture2D(u_image, pos_lr);\nvec4 vp \x3d mix(mix(vp_ul, vp_ur, weight.x), mix(vp_ll, vp_lr, weight.x), weight.y);\nif (u_bandCount \x3d\x3d 1) {\nfloat alpha \x3d vp_ul.a * vp_ur.a * vp_ll.a * vp_lr.a;\nvec4 vp_nn \x3d texture2D(u_image, coords);\nreturn alpha \x3d\x3d 0.0 ? vp_nn : vec4(vp.rgb, alpha);\n}\nreturn vp;\n}\nvec4 findMin(vec4 p1, vec4 p2) {\nif (p1.a \x3d\x3d 0.0) {\nreturn p2;\n} else if (p2.a \x3d\x3d 0.0) {\nreturn p1;\n} else {\nreturn vec4(min(p1.r, p2.r),min(p1.g, p2.g),min(p1.b, p2.b),p1.a);\n}\n}\nvec4 findMax(vec4 p1, vec4 p2) {\nif (p1.a \x3d\x3d 0.0) {\nreturn p2;\n} else if (p2.a \x3d\x3d 0.0) {\nreturn p1;\n} else {\nreturn vec4(max(p1.r, p2.r),max(p1.g, p2.g),max(p1.b, p2.b),p1.a);\n}\n}\nvec4 findMinMax(vec4 p1, vec4 p2) {\nif (p1.a \x3d\x3d 0.0) {\nreturn p2;\n} else if (p2.a \x3d\x3d 0.0) {\nreturn p1;\n} else {\nreturn vec4(min(p1.r, p2.r), max(p1.g, p2.g), 0.0, p1.a);\n}\n}\nvec4 minMax(int state) {\nvec2 pixelFract \x3d fract(v_texCoord * u_sourceDim);\nfloat xshift \x3d ((pixelFract.s \x3e\x3d 0.5 || pixelFract.s \x3d\x3d 0.0) ? -1.0 : 1.0) / u_sourceDim.s; //take left pixel if \x3e 0.5\nfloat yshift \x3d ((pixelFract.s \x3e\x3d 0.5 || pixelFract.s \x3d\x3d 0.0) ? -1.0 : 1.0) / u_sourceDim.t; //take bottom pixel if \x3e 0.5\nif (u_sourceDim.s \x3d\x3d 1.0) {\nxshift \x3d 0.0;\n}\nif (u_sourceDim.t \x3d\x3d 1.0) {\nyshift \x3d 0.0;\n}\nvec4 p1 \x3d texture2D(u_image, v_texCoord);\nvec4 p2 \x3d texture2D(u_image, v_texCoord + vec2(xshift, 0.0));\nvec4 p3 \x3d texture2D(u_image, v_texCoord + vec2(0.0, yshift));\nvec4 p4 \x3d texture2D(u_image, v_texCoord + vec2(xshift, yshift));\nvec4 pval;\nif (state \x3d\x3d 2) {\npval \x3d findMinMax(findMinMax(p1, p2), findMinMax(p3, p4));\n} else if (state \x3d\x3d 1) {\npval \x3d findMax(findMax(p1, p2), findMax(p3, p4));\n} else if (state \x3d\x3d 0) {\npval \x3d findMin(findMin(p1, p2), findMin(p3, p4));\n}\nreturn pval;\n}\nfloat stretchOneValue(float val, float minCutOff, float maxCutOff, float minOutput, float maxOutput, float factor, bool scaled) {\nfloat stretchedVal;\nif (val \x3e minCutOff \x26\x26 val \x3c maxCutOff) {\nstretchedVal \x3d minOutput + (val - minCutOff) * factor;\n} else if (val \x3e\x3d maxCutOff) {\nstretchedVal \x3d maxOutput;\n} else {\nstretchedVal \x3d minOutput;\n}\nif (scaled) {\nreturn stretchedVal;\n}\nelse {\nreturn stretchedVal / maxOutput; //0-1\n}\n}\nfloat stretchOneValueGamma(float val, float minCutOff, float maxCutOff, float minOutput, float maxOutput, float factor, float gamma, float gammaCorrection, bool scaled) {\nfloat stretchedVal;\nfloat tempf \x3d 1.0;\nfloat outRange \x3d maxOutput - minOutput;\nfloat relativeVal \x3d (val - minCutOff) / (maxCutOff - minCutOff);\nif (val \x3e minCutOff \x26\x26 val \x3c maxCutOff) {\nif (gamma \x3e 1.0) {\ntempf -\x3d pow(1.0 / outRange, relativeVal * gammaCorrection);\n}\nstretchedVal \x3d floor(tempf * outRange * pow(relativeVal, 1.0 / gamma)) + minOutput;\n}\nelse if (val \x3e\x3d maxCutOff) {\nstretchedVal \x3d maxOutput;\n} else {\nstretchedVal \x3d minOutput;\n}\nif (scaled) {\nreturn stretchedVal;\n}\nelse {\nreturn stretchedVal / maxOutput; //0-1\n}\n}\nbool isOutside(){\nif (v_texCoord.t\x3e1.00001 ||v_texCoord.t\x3c-0.00001 || v_texCoord.s\x3e1.00001 ||v_texCoord.s\x3c-0.00001) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nvoid main() {\nif (isOutside()) {\nreturn;\n}\nif (u_state \x3d\x3d 100) {\nvec4 currentPixel \x3d getPixelValue(v_texCoord);\nfloat grayVal,\nredVal,\ngreenVal,\nblueVal;\nfloat min0,\nmax0,\nmin1,\nmax1,\nmin2,\nmax2,\nfactor0,\nfactor1,\nfactor2;\nvec4 minV, maxV;\nif (u_minMaxTexture) {\nif (u_bandCount \x3d\x3d 1) {\nminV \x3d texture2D(u_image1, v_texCoord);\nmin0 \x3d minV.r;\nmax0 \x3d minV.g;\nfactor0 \x3d (u_maxOutput[0] - u_minOutput[0]) / (max0 - min0);\n} else {\nminV \x3d texture2D(u_image1, v_texCoord);\nmaxV \x3d texture2D(u_image2, v_texCoord);\nmin0 \x3d minV.r;\nmax0 \x3d maxV.r;\nmin1 \x3d minV.g;\nmax1 \x3d maxV.g;\nmin2 \x3d minV.b;\nmax2 \x3d maxV.b;\nfactor0 \x3d (u_maxOutput[0] - u_minOutput[0]) / (max0 - min0);\nfactor1 \x3d (u_maxOutput[1] - u_minOutput[1]) / (max1 - min1);\nfactor2 \x3d (u_maxOutput[2] - u_minOutput[2]) / (max2 - min2);\n}\n} else {\nmin0 \x3d u_minCutOff[0];\nmax0 \x3d u_maxCutOff[0];\nmin1 \x3d u_minCutOff[1];\nmax1 \x3d u_maxCutOff[1];\nmin2 \x3d u_minCutOff[2];\nmax2 \x3d u_maxCutOff[2];\nfactor0 \x3d u_factor[0];\nfactor1 \x3d u_factor[1];\nfactor2 \x3d u_factor[2];\n}\nif (u_useGamma){\nif (u_bandCount \x3d\x3d 1) {\ngrayVal \x3d stretchOneValueGamma(float(currentPixel.r), min0, max0, u_minOutput[0], u_maxOutput[0], factor0, u_gamma[0], u_gammaCorrection[0], u_scaled);\ngl_FragColor \x3d vec4(grayVal, grayVal, grayVal, currentPixel.a);\n} else {\nredVal \x3d stretchOneValueGamma(float(currentPixel.r), min0, max0, u_minOutput[0], u_maxOutput[0], factor0, u_gamma[0], u_gammaCorrection[0], u_scaled);\ngreenVal \x3d stretchOneValueGamma(float(currentPixel.g), min1, max1, u_minOutput[1], u_maxOutput[1], factor1, u_gamma[1], u_gammaCorrection[1], u_scaled);\nblueVal \x3d stretchOneValueGamma(float(currentPixel.b), min2, max2, u_minOutput[2], u_maxOutput[2], factor2, u_gamma[1], u_gammaCorrection[2], u_scaled);\ngl_FragColor \x3d vec4(redVal, greenVal, blueVal, currentPixel.a);\n}\n}\nelse {\nif (u_bandCount \x3d\x3d 1) {\ngrayVal \x3d stretchOneValue(float(currentPixel.r), min0, max0, u_minOutput[0], u_maxOutput[0], factor0, u_scaled);\ngl_FragColor \x3d vec4(grayVal, grayVal, grayVal, currentPixel.a);\n} else {\nredVal \x3d stretchOneValue(float(currentPixel.r), min0, max0, u_minOutput[0], u_maxOutput[0], factor0, u_scaled);\ngreenVal \x3d stretchOneValue(float(currentPixel.g), min1, max1, u_minOutput[1], u_maxOutput[1], factor1, u_scaled);\nblueVal \x3d stretchOneValue(float(currentPixel.b), min2, max2, u_minOutput[2], u_maxOutput[2], factor2, u_scaled);\ngl_FragColor \x3d vec4(redVal, greenVal, blueVal, currentPixel.a);\n}\n}\n} else {\nvec4 currentPixel \x3d minMax(u_state);\ngl_FragColor \x3d currentPixel;\n}\n}"}})},
"esri/layers/rasterLib/function/RasterFunctionWebGLMixin":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ./pixelShaders ./vertexShaders ./webglHelper ./convolutionKernel".split(" "),function(H,k,n,q,m,l,b){return H(null,{gl:null,rgbaFloatData:null,originalTexture:null,lastTexture:null,renderTexture:!1,constructor:function(a){this._isProgramInitialized=!1;this.gl=a&&a.gl;a&&a.renderTexture&&(this.renderTexture=a.renderTexture);this._xformSetting=a&&a._xformSetting||{requireProjection:!1,
meshSize:[20,20]}},bindFrameBuffer:function(){var a=this.gl;this._setupPingPongTextures();this._setupBranchingTextures();var c=this._glSetting;this.isBranch?(c.branchIndex=(c.branchIndex+1)%c.branchCount,c=c.branches[c.branchIndex]):(c.pingpongIndex=(c.pingpongIndex+1)%c.pingpong.length,c=c.pingpong[c.pingpongIndex]);a.bindFramebuffer(a.FRAMEBUFFER,c.frameBuffer);a.viewport(0,0,a.drawingBufferWidth,a.drawingBufferHeight);return c},_initializeProgram:function(a){if(this.gl)try{var c=this.gl;c.viewport(0,
0,c.drawingBufferWidth,c.drawingBufferHeight);var f=this._glSetting.programUniforms,e="local"===this.functionName?"local"+this.functionArguments.operation:this.functionName,g=f[e];if(g)this._uniforms=g.uniforms,this.rasterProgram=g.program;else{var d=(this._useMesh=this._tileMode&&this._xformSetting.requireProjection)?m.mesh:m.basic,h=m.getShader(c,a.vertex||d),p=q.getShader(c,a.fragment),t=this._loadProgram(h,p),w={rasterProgram:l.getUniforms(c,t)};f[e]={uniforms:w,program:t};this.rasterProgram=
t;this._uniforms=w}c.useProgram(this.rasterProgram);var u=c.getAttribLocation(this.rasterProgram,"a_texCoord"),r=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,r);var y=l.createMesh(this._xformSetting.meshSize);c.bufferData(c.ARRAY_BUFFER,y,c.STATIC_DRAW);c.enableVertexAttribArray(u);c.vertexAttribPointer(u,2,c.FLOAT,!1,0,0);c.disable(c.DEPTH_TEST);c.blendFunc(c.SRC_ALPHA,c.ZERO);c.disable(c.BLEND);c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,!1);this._shaderInfo=
{fragment:a.fragmentName}}catch(B){console.error("webgl exception: "+B.message)}else console.error("WebGL is required.")},_setUniform:function(a,c,f){null!=c&&(f&&!this._uniforms[f]&&(this._uniforms[f]=l.getUniforms(this.gl,this[f])),f=f?this._uniforms[f]:this._uniforms.rasterProgram,(a=f[a]||f[a+"[0]"])&&l.setUniform(this.gl,a,c))},_setUniforms:function(a,c){var f=Object.keys(a),e,g=f.length;for(e=0;e<g;e++)this._setUniform(f[e],a[f[e]],c);this.rawInput?this._setUniform("u_flipY",!0,c):this._setUniform("u_flipY",
!1,c);this._tileMode?(this.rawInput?(a=this._xformSetting.offset,f=this._xformSetting.scale):(a=[0,0],f=[1,1]),this._setUniform("u_xformOffset",a,c),this._setUniform("u_xformScale",f,c),this._xformSetting.requireProjection&&(this.rawInput?(this._setupXformTexture(),this._setUniform("u_projection",!0,c),this._setUniform("u_transformGridSize",this._xformSetting.gridConfig.size,c),this._setUniform("u_transformSpacing",this._xformSetting.gridConfig.spacing,c),this._setUniform("u_targetImageSize",new Float32Array([this.gl.drawingBufferWidth,
this.gl.drawingBufferHeight]),c)):this._setUniform("u_projection",!1,c))):(a=[0,0],f=[1,1],this._setUniform("u_xformOffset",a,c),this._setUniform("u_xformScale",f,c));this.rawInput&&this._rawResolution&&("RSP_BilinearInterpolation"===this.interpolation||"RSP_CubicConvolution"===this.interpolation)?(this._setUniform("u_resampling",1),this._setUniform("u_rawResolution",this._rawResolution)):this._setUniform("u_resampling",0)},_setupTextureData:function(a,c){if(a.texture)return a;a.raster&&a.raster.pixelBlock&&
(a=a.raster);this.rawInput=!0;var f=c&&c.notOriginal,e=c&&c.bandIDs;c&&c.reCreate?c=!1:(c=this._tileMode?!this._xformSetting.hasNewTexture:!this._glSetting.hasNewTexture)&&this._originalBandIDs&&(c=e?this._originalBandIDs.join("")===e.join(""):!1);0<this._glSetting.branchCount&&(c=!1);if(c&&this.originalTexture)return{extent:a.extent,texture:this.originalTexture};c=this._createTexture();f||(this.originalTexture=c,this._originalBandIDs=e);f=this.gl;var g=a.pixelBlock;this._rawResolution=g?[1/a.pixelBlock.width,
1/a.pixelBlock.height]:[1/this.gl.drawingBufferWidth,1/this.gl.drawingBufferHeight];var d=0;e&&0<e.length&&g&&(d=Math.max.apply(null,e),g.pixels.length>d&&e&&(g.pixels=e.map(function(p){return g.pixels[p]}),g.statistics&&(g.statistics=e.map(function(p){return g.statistics[p]}))));e=g.width;d=g.height;f.getExtension("OES_texture_float");var h=g.getAsRGBAFloat();f.texImage2D(f.TEXTURE_2D,0,f.RGBA,e,d,0,f.RGBA,f.FLOAT,h);return{extent:a.extent,texture:c}},_setupPingPongTextures:function(){var a=this._glSetting;
if(!a||!a.pingpong){a.pingpong=[];var c=l.createBufferTexture(this.gl,!1);a.pingpong.push(c);c=l.createBufferTexture(this.gl,!1);a.pingpong.push(c);a.pingpongIndex=1}},_setupBranchingTextures:function(){var a=this._glSetting;if(!a||!a.branches){a.branches=[];var c=0,f=a.branchCount;if(0<f){for(c=0;c<f;c++){var e=l.createBufferTexture(this.gl,!1);a.branches.push(e)}a.branchIndex=f-1}}},_setupXformTexture:function(a){for(var c=this._createTexture(),f=this.gl,e=4*this._xformSetting.gridConfig.size[0],
g=this._xformSetting.gridConfig.size[1],d=new Float32Array(e*g*4),h=0,p=0;p<this._xformSetting.gridConfig.coefficients.length;p++)d[h++]=this._xformSetting.gridConfig.coefficients[p],2===p%3&&(d[h++]=1);f.getExtension("OES_texture_float");f.texImage2D(f.TEXTURE_2D,0,f.RGBA,e,g,0,f.RGBA,f.FLOAT,d);this._bindTexture(c,"u_transformGrid",a)},_createTexture:function(a){return l.createTexture(this.gl,a)},_bindTexture:function(a,c,f){c=c||"u_image";f=this._uniforms[f||"rasterProgram"];var e=this._getTextureIndex(c);
if(-1!==e){var g=this.gl;g.uniform1i(f[c].location,e);g.activeTexture(g.TEXTURE0+e);g.bindTexture(g.TEXTURE_2D,a)}},_getTextureIndex:function(a,c){c=this._uniforms[c||"rasterProgram"];if(!c||!c[a]||c[a].info.type!==this.gl.SAMPLER_2D)return-1;if("u_transformGrid"===a)return 0;a="u_image"===a?0:parseInt(a.replace("u_image",""));return this._xformSetting.requireProjection?a+1:a},_drawGL:function(a){var c=this.gl;this.renderTexture?(c.enable(c.BLEND),c.bindFramebuffer(c.FRAMEBUFFER,null)):c.disable(c.BLEND);
a||c.viewport(0,0,c.drawingBufferWidth,c.drawingBufferHeight);a=this._xformSetting.meshSize||[1,1];c.drawArrays(c.TRIANGLES,0,a[0]*a[1]*6);this._drawMesh()},_drawMesh:function(){if(this.renderTexture&&this._glSetting.drawMesh){this.meshProgram=this.meshProgram||this._setupMeshProgram();var a=this.gl;a.useProgram(this.meshProgram);a.bindFramebuffer(a.FRAMEBUFFER,null);var c=a.getAttribLocation(this.meshProgram,"a_texCoord"),f=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,f);f=this._xformSetting.meshSize||
[1,1];var e=l.createMesh(f,!0);a.bufferData(a.ARRAY_BUFFER,e,a.STATIC_DRAW);a.enableVertexAttribArray(c);a.vertexAttribPointer(c,2,a.FLOAT,!1,0,0);a.disable(a.DEPTH_TEST);a.blendFunc(a.ONE,a.ZERO);this._setUniforms({u_color:[0,0,1,1],u_drawMeshLines:!0},"meshProgram");a.drawArrays(a.LINES,0,f[0]*f[1]*10)}},_setupMeshProgram:function(){var a=m.getShader(this.gl,m.mesh),c=q.getShader(this.gl,q.constant);return this._loadProgram(a,c)},_loadProgram:function(a,c){return l.loadProgram(this.gl,a,c)},_getShaderScript:function(a,
c){c=document.getElementById(c);if(!c)return null;a="";for(c=c.firstChild;c;)3==c.nodeType&&(a+=c.textContent),c=c.nextSibling;return a}})})},"esri/layers/rasterLib/function/vertexShaders":function(){define(["dojo/_base/declare","dojo/_base/lang","./vertexShaderScripts"],function(H,k,n){H={shaderType:"vertex",getShader:function(q,m){var l=q.createShader(q.VERTEX_SHADER);q.shaderSource(l,m);q.compileShader(l);q.getShaderParameter(l,q.COMPILE_STATUS)||(l=null);return l}};k.mixin(H,n);return H})},"esri/layers/rasterLib/function/vertexShaderScripts":function(){define([],
function(){return{basic:"varying vec2 v_texCoord;\nattribute vec2 a_texCoord;\nuniform vec2 u_xformOffset;\nuniform vec2 u_xformScale;\nuniform bool u_flipY;\nvoid main() {\nv_texCoord \x3d u_xformOffset + a_texCoord * u_xformScale;\nif (u_flipY) {\nv_texCoord.t \x3d 1.0 - v_texCoord.t;\n}\nvec2 position \x3d a_texCoord * 2.0 - 1.0;\ngl_Position \x3d vec4(position, 0.0, 1.0);\n}",histogram:"attribute float a_pixelIndex;\nuniform sampler2D u_image;\nuniform sampler2D u_image1;\nuniform sampler2D u_image2;\nuniform vec2 u_sourceDim;\nuniform vec2 u_halfPixel;\nuniform vec4 u_bandSelection;\nuniform vec4 u_mins;\nuniform vec4 u_factors;\nuniform float u_size;\nuniform int u_bandCount;\nuniform bool u_minMaxTexture;\nvoid main() {\nfloat row \x3d a_pixelIndex/u_sourceDim.s;\nvec2 coord \x3d vec2(fract(row), floor(row)/u_sourceDim.t);\nvec4 pv \x3d texture2D(u_image, coord + u_halfPixel);\nvec4 minVal, maxVal, pvm;\nif (u_minMaxTexture){\nif (u_bandCount \x3d\x3d1){ //min \x3d red, max \x3d green\nvec4 minmax \x3d texture2D(u_image1, vec2(0.5,0.5));\nminVal \x3d vec4(minmax.r, minmax.r, minmax.r, 0.0);\nmaxVal \x3d vec4(minmax.g, minmax.g, minmax.g, 0.0);\n}\nelse if (u_bandCount \x3d\x3d3){ //min \x3d red, max \x3d green\nminVal \x3d texture2D(u_image1, vec2(0.5,0.5));\nmaxVal \x3d texture2D(u_image2, vec2(0.5,0.5));\n}\nvec4 factors \x3d u_size/(maxVal-minVal+vec4(0.0,0.0,0.0,1.0)) * u_factors;\npvm \x3d (pv - minVal) * factors;\n}\nelse {\npvm \x3d (pv - u_mins) * u_factors;\n}\nfloat histVal \x3d min(floor(pvm.r+pvm.g+pvm.b), u_size-1.0);\nhistVal \x3d pv.a \x3d\x3d 1.0? histVal: u_size;\ngl_Position \x3d vec4((histVal+0.1) / (u_size+1.0) * 2.0 - 1.0, 0.5, 0, 1);\ngl_PointSize \x3d 1.0;\n}",
mesh:"varying vec2 v_texCoord;\nattribute vec2 a_texCoord;\nuniform bool u_drawMeshLines;\nuniform bool u_flipY;\nuniform vec2 u_xformOffset;\nuniform vec2 u_xformScale;\nuniform sampler2D u_transformGrid;\nuniform vec2 u_transformSpacing;\nuniform vec2 u_transformGridSize;\nuniform vec2 u_targetImageSize;\nuniform vec2 u_srcImageSize;\nuniform bool u_projection;\nvec2 projectPixelLocation(vec2 coords) {\nvec2 index_image \x3d floor(coords * u_targetImageSize);\nvec2 oneTransformPixel \x3d vec2(0.25 / u_transformGridSize.s, 1.0 / u_transformGridSize.t);\nvec2 index_transform \x3d floor(index_image / u_transformSpacing) / u_transformGridSize;\nvec2 pos \x3d fract((index_image + vec2(0.5, 0.5)) / u_transformSpacing);\nvec2 srcLocation;\nvec2 transform_location \x3d index_transform + oneTransformPixel * 0.5;\nif (pos.s \x3c\x3d pos.t) {\nvec4 ll_abc \x3d texture2D(u_transformGrid, vec2(transform_location.s, transform_location.t));\nvec4 ll_def \x3d texture2D(u_transformGrid, vec2(transform_location.s + oneTransformPixel.s, transform_location.t));\nsrcLocation.s \x3d dot(ll_abc.rgb, vec3(pos, 1.0));\nsrcLocation.t \x3d dot(ll_def.rgb, vec3(pos, 1.0));\n} else {\nvec4 ur_abc \x3d texture2D(u_transformGrid, vec2(transform_location.s + 2.0 * oneTransformPixel.s, transform_location.t));\nvec4 ur_def \x3d texture2D(u_transformGrid, vec2(transform_location.s + 3.0 * oneTransformPixel.s, transform_location.t));\nsrcLocation.s \x3d dot(ur_abc.rgb, vec3(pos, 1.0));\nsrcLocation.t \x3d dot(ur_def.rgb, vec3(pos, 1.0));\n}\nreturn srcLocation;// + halfPixel;\n}\nvoid main() {\nif (u_projection) {\nv_texCoord \x3d projectPixelLocation(a_texCoord);\n} else {\nv_texCoord \x3d u_xformOffset + a_texCoord * u_xformScale;\n}\nif (u_flipY) {\nv_texCoord.t \x3d 1.0 - v_texCoord.t;\n}\nvec2 position \x3d a_texCoord * 2.0 - 1.0;\nif (u_drawMeshLines){\nvec2 adjustedPos \x3d (v_texCoord - u_xformOffset) / u_xformScale;\ngl_Position \x3d vec4( adjustedPos * 2.0 - 1.0, 0.0, 1.0);\n}\nelse {\ngl_Position \x3d vec4(position, 0.0, 1.0);\n}\n}"}})},
"esri/layers/rasterLib/function/webglHelper":function(){define([],function(){var H={getUniforms:function(k,n){var q=k.getProgramParameter(n,k.ACTIVE_UNIFORMS),m,l,b={};for(m=0;m<q;m++)(l=k.getActiveUniform(n,m))&&(b[l.name]={location:k.getUniformLocation(n,l.name),info:l});return b},setUniform:function(k,n,q){var m=n.info,l=n.location,b=m.type;if(null==q)console.log("uniform "+n.info.name+" has null or undefined value");else switch(b){case k.FLOAT:1<m.size?0===q.length?console.log("uniform "+n.info.name+
" has length 0"):k.uniform1fv(l,q):k.uniform1f(l,q);break;case k.FLOAT_VEC2:if(0===q.length){console.log("uniform "+n.info.name+" has length 0");break}k.uniform2fv(l,q);break;case k.FLOAT_VEC3:if(0===q.length){console.log("uniform "+n.info.name+" has length 0");break}k.uniform3fv(l,q);break;case k.FLOAT_VEC4:if(0===q.length){console.log("uniform "+n.info.name+" has length 0");break}k.uniform4fv(l,q);break;case k.INT:case k.BOOL:1<m.size?0===q.length?console.log("uniform "+n.info.name+" has length 0"):
k.uniform1iv(l,q):k.uniform1i(l,q);break;case k.INT_VEC2:case k.BOOL_VEC2:if(0===q.length){console.log("uniform "+n.info.name+" has length 0");break}k.uniform2iv(l,q);break;case k.INT_VEC3:case k.BOOL_VEC3:if(0===q.length){console.log("uniform "+n.info.name+" has length 0");break}k.uniform3iv(l,q);break;case k.INT_VEC4:case k.BOOL_VEC4:0===q.length?console.log("uniform "+n.info.name+" has length 0"):k.uniform4iv(l,q)}},createTexture:function(k,n){var q=k.createTexture();k.bindTexture(k.TEXTURE_2D,
q);k.texParameteri(k.TEXTURE_2D,k.TEXTURE_WRAP_S,k.CLAMP_TO_EDGE);k.texParameteri(k.TEXTURE_2D,k.TEXTURE_WRAP_T,k.CLAMP_TO_EDGE);k.texParameteri(k.TEXTURE_2D,k.TEXTURE_MIN_FILTER,n?k.LINEAR:k.NEAREST);k.texParameteri(k.TEXTURE_2D,k.TEXTURE_MAG_FILTER,n?k.LINEAR:k.NEAREST);return q},createBufferTexture:function(k,n,q){n=H.createTexture(k,n);k.getExtension("OES_texture_float");q=q||[k.drawingBufferWidth,k.drawingBufferHeight];k.texImage2D(k.TEXTURE_2D,0,k.RGBA,q[0],q[1],0,k.RGBA,k.FLOAT,null);q=k.createFramebuffer();
k.bindFramebuffer(k.FRAMEBUFFER,q);k.framebufferTexture2D(k.FRAMEBUFFER,k.COLOR_ATTACHMENT0,k.TEXTURE_2D,n,0);return{texture:n,frameBuffer:q}},getShader:function(k,n,q){q=q?k.createShader(k.VERTEX_SHADER):k.createShader(k.FRAGMENT_SHADER);k.shaderSource(q,n);k.compileShader(q);k.getShaderParameter(q,k.COMPILE_STATUS)||(console.log(k.getShaderInfoLog(q)),q=null);return q},loadProgram:function(k,n,q){var m=k.createProgram();k.attachShader(m,n);k.attachShader(m,q);k.linkProgram(m);k.getProgramParameter(m,
k.LINK_STATUS)||(console.warn("failed to load webgl program: "+k.getProgramInfoLog(m)),k.deleteProgram(m),m=null);return m},createMesh:function(k,n){if(!k||1===k[0]&&1===k[1])return new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);var q=k&&n?new Float32Array(k[0]*k[1]*20):new Float32Array(k[0]*k[1]*12);var m=.9998/k[1],l=.9998/k[0],b,a,c=0;for(b=0;b<k[1];b++)for(a=0;a<k[0];a++){var f=1E-4+m*b;var e=1E-4+l*a;k&&!n?(q[c++]=f,q[c++]=e,q[c++]=f+m,q[c++]=e,q[c++]=f,q[c++]=e+l,q[c++]=f,q[c++]=e+l,q[c++]=f+m,
q[c++]=e,q[c++]=f+m,q[c++]=e+l):(q[c++]=f,q[c++]=e,q[c++]=f,q[c++]=e+l,q[c++]=f,q[c++]=e+l,q[c++]=f+m,q[c++]=e+l,q[c++]=f+m,q[c++]=e+l,q[c++]=f+m,q[c++]=e,q[c++]=f,q[c++]=e,q[c++]=f+m,q[c++]=e,q[c++]=f,q[c++]=e+l,q[c++]=f+m,q[c++]=e)}return q}};return H})},"esri/layers/rasterLib/function/convolutionKernel":function(){define([],function(){var H={Default:[0,0,0,0,1,0,0,0,0],LineDetectionHorizontal:[-1,-1,-1,2,2,2,-1,-1,-1],LineDetectionVertical:[-1,2,-1,-1,2,-1,-1,2,-1],LineDetectionLeftDiagonal:[2,
-1,-1,-1,2,-1,-1,-1,2],LineDetectionRightDiagonal:[-1,-1,2,-1,2,-1,2,-1,-1],GradientNorth:[-1,-2,-1,0,0,0,1,2,1],GradientWest:[-1,0,1,-2,0,2,-1,0,1],GradientEast:[1,0,-1,2,0,-2,1,0,-1],GradientSouth:[1,2,1,0,0,0,-1,-2,-1],GradientNorthEast:[0,-1,-2,1,0,-1,2,1,0],GradientNorthWest:[-2,-1,0,-1,0,1,0,1,2],SmoothArithmeticMean:[.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111],Smoothing3x3:[.0625,.125,.0625,.125,.25,.125,.0625,
.125,.0625],Smoothing5x5:[1,1,1,1,1,1,4,4,4,1,1,4,12,4,1,1,4,4,4,1,1,1,1,1,1],Sharpening3x3:[-1,-1,-1,-1,9,-1,-1,-1,-1],Sharpening5x5:[-1,-3,-4,-3,-1,-3,0,6,0,-3,-4,6,21,6,-4,-3,0,6,0,-3,-1,-3,-4,-3,-1],Laplacian3x3:[0,-1,0,-1,4,-1,0,-1,0],Laplacian5x5:[0,0,-1,0,0,0,-1,-2,-1,0,-1,-2,17,-2,-1,0,-1,-2,-1,0,0,0,-1,0,0],SobelHorizontal:[-1,-2,-1,0,0,0,1,2,1],SobelVertical:[-1,0,1,-2,0,2,-1,0,1],Sharpen:[0,-.25,0,-.25,2,-.25,0,-.25,0],Sharpen2:[-.25,-.25,-.25,-.25,3,-.25,-.25,-.25,-.25],PointSpread:[-.627,
.352,-.627,.352,2.923,.352,-.627,.352,-.627],getKernel:function(k){switch(k){case 0:return H.LineDetectionHorizontal;case 1:return H.LineDetectionVertical;case 2:return H.LineDetectionLeftDiagonal;case 3:return H.LineDetectionRightDiagonal;case 4:return H.GradientNorth;case 5:return H.GradientWest;case 6:return H.GradientEast;case 7:return H.GradientSouth;case 8:return H.GradientNorthEast;case 9:return H.GradientNorthWest;case 10:return H.SmoothArithmeticMean;case 11:return H.Smoothing3x3;case 12:return H.Smoothing5x5;
case 13:return H.Sharpening3x3;case 14:return H.Sharpening5x5;case 15:return H.Laplacian3x3;case 16:return H.Laplacian5x5;case 17:return H.SobelHorizontal;case 18:return H.SobelVertical;case 19:return H.Sharpen;case 20:return H.Sharpen2;case 21:return H.PointSpread;default:return H.Default}}};return H})},"esri/layers/rasterLib/function/surfaceUtils":function(){define(["dojo/_base/lang"],function(H){return{hillshade:function(k,n){if(null!==k&&null!==k.pixelBlock&&null!==k.pixelBlock.pixels){var q=
this._clonePixelBlock(k.pixelBlock),m=n.altitude,l=n.azimuth,b=n.zFactor,a=n.psPower,c=n.psFactor,f=n.hillshadeType,e=n.slopeType,g=n.isGCS;1===f&&(b*=2);n=q.width;var d=q.height,h=q.pixels[0],p=q.mask,t=new Uint8Array(n*d);p&&t.set(p);var w=new Uint8Array(n*d),u=(k.extent.xmax-k.extent.xmin)/n,r=(k.extent.ymax-k.extent.ymin)/d,y=b/(8*u),B=b/(8*r);.001<b&&g&&(y/=111E3,B/=111E3);3===e&&(g?(y=111E3*u,B=111E3*r,y=(b+Math.pow(y,a)*c)/(8*y),B=(b+Math.pow(B,a)*c)/(8*B)):(y=(b+Math.pow(u,a)*c)/(8*u),B=(b+
Math.pow(r,a)*c)/(8*r)));g=(90-m)*Math.PI/180;m=Math.cos(g);var C=(360-l+90)*Math.PI/180;l=Math.sin(g)*Math.cos(C);g=Math.sin(g)*Math.sin(C);b=[];a=[];c=[];u=[315,270,225,360,180,0];var G=[60,60,60,60,60,90];e=[3,5,3,2,1,4];var x=e.reduce(function(Z,ca){return Z+ca});r=e.map(function(Z){return Z/x});if(1===f){var v=u.length;for(e=0;e<v;e++)m=G[e],l=u[e],g=(90-m)*Math.PI/180,m=Math.cos(g),C=(360-l+90)*Math.PI/180,l=Math.sin(g)*Math.cos(C),g=Math.sin(g)*Math.sin(C),b.push(m),a.push(l),c.push(g)}var z=
0;for(e=1;e<d-1;e++)for(G=e*n,u=1;u<n-1;u++)if(p&&!p[G+u])w[G+u]=0;else{C=0;if(p&&(C=p[G-n+u-1]+p[G-n+u]+p[G-n+u+1]+p[G+u-1]+p[G+u+1]+p[G+n+u-1]+p[G+n+u]+p[G+n+u+1],7>C)){w[G+u]=0;t[G+u]=0;continue}if(7===C){var A=p[G-n+u-1]?h[G-n+u-1]:h[G+u];var F=p[G-n+u]?h[G-n+u]:h[G+u];var J=p[G-n+u+1]?h[G-n+u+1]:h[G+u];C=p[G+u-1]?h[G+u-1]:h[G+u];var L=p[G+u+1]?h[G+u+1]:h[G+u];z=p[G+n+u-1]?h[G+n+u-1]:h[G+u];var P=p[G+n+u]?h[G+n+u]:h[G+u];var Q=p[G+n+u+1]?h[G+n+u+1]:h[G+u]}else A=h[G-n+u-1],F=h[G-n+u],J=h[G-n+
u+1],C=h[G+u-1],L=h[G+u+1],z=h[G+n+u-1],P=h[G+n+u],Q=h[G+n+u+1];C=(J+L+L+Q-(A+C+C+z))*y;F=(z+P+P+Q-(A+F+F+J))*B;J=Math.sqrt(1+C*C+F*F);z=0;if(0===f)P=g*F-l*C,P=255*(m+P)/J,0>P&&(P=0),z=P;else if(1===f)for(A=0;A<v;A++)P=c[A]*F-a[A]*C,P=255*(b[A]+P)/J,0>P&&(P=0),z+=P*r[A];w[G+u]=z}for(e=0;e<d;e++)w[e*n]=w[e*n+1],w[(e+1)*n-1]=w[(e+1)*n-2];for(e=1;e<n-1;e++)w[e]=w[e+n],w[e+(d-1)*n]=w[e+(d-2)*n];q.pixelType="U8";q.pixels=[w];q.statistics=[{minValue:0,maxValue:255}];p&&(q.mask=t);return{extent:k.extent,
pixelBlock:q}}},slope:function(k,n){if(null!==k&&null!==k.pixelBlock&&null!==k.pixelBlock.pixels){var q=this._clonePixelBlock(k.pixelBlock),m=n.zFactor,l=n.psPower,b=n.psFactor,a=n.slopeType,c=n.isGCS;n=q.width;var f=q.height,e=q.pixels[0],g=q.mask,d=new Uint8Array(n*f);g&&d.set(g);var h=new Float32Array(n*f),p=(k.extent.xmax-k.extent.xmin)/n,t=(k.extent.ymax-k.extent.ymin)/f,w=m/(8*p),u=m/(8*t);1E-4>Math.abs(m-1)&&c&&(w/=111E3,u/=111E3);3===a&&(c?(w=111E3*p,u=111E3*t,w=(m+Math.pow(w,l)*b)/(8*w),
u=(m+Math.pow(u,l)*b)/(8*u)):(w=(m+Math.pow(p,l)*b)/(8*p),u=(m+Math.pow(t,l)*b)/(8*t)));for(m=1;m<f-1;m++)for(b=m*n,l=1;l<n-1;l++)if(g&&!g[b+l])h[b+l]=0;else{t=0;if(g&&(t=g[b-n+l-1]+g[b-n+l]+g[b-n+l+1]+g[b+l-1]+g[b+l+1]+g[b+n+l-1]+g[b+n+l]+g[b+n+l+1],7>t)){h[b+l]=0;d[b+l]=0;continue}if(7===t){t=g[b-n+l-1]?e[b-n+l-1]:e[b+l];c=g[b-n+l]?e[b-n+l]:e[b+l];p=g[b-n+l+1]?e[b-n+l+1]:e[b+l];var r=g[b+l-1]?e[b+l-1]:e[b+l];var y=g[b+l+1]?e[b+l+1]:e[b+l];var B=g[b+n+l-1]?e[b+n+l-1]:e[b+l];var C=g[b+n+l]?e[b+n+
l]:e[b+l];var G=g[b+n+l+1]?e[b+n+l+1]:e[b+l]}else t=e[b-n+l-1],c=e[b-n+l],p=e[b-n+l+1],r=e[b+l-1],y=e[b+l+1],B=e[b+n+l-1],C=e[b+n+l],G=e[b+n+l+1];r=(p+y+y+G-(t+r+r+B))*w;t=(B+C+C+G-(t+c+c+p))*u;t=Math.sqrt(r*r+t*t);h[b+l]=1===a||3===a?57.2957795*Math.atan(t):100*t}for(m=0;m<f;m++)h[m*n]=h[m*n+1],h[(m+1)*n-1]=h[(m+1)*n-2];for(m=1;m<n-1;m++)h[m]=h[m+n],h[m+(f-1)*n]=h[m+(f-2)*n];q.pixelType="F32";q.pixels=[h];q.statistics=[{minValue:0,maxValue:255}];g&&(q.mask=d);return{extent:k.extent,pixelBlock:q}}},
aspect:function(k){if(null!==k&&null!==k.pixelBlock&&null!==k.pixelBlock.pixels){var n=this._clonePixelBlock(k.pixelBlock),q=n.width,m=n.height,l=n.pixels[0],b=n.mask,a=new Uint8Array(q*m);b&&a.set(b);var c=new Float32Array(q*m),f=1/((k.extent.xmax-k.extent.xmin)/q),e=1/((k.extent.ymax-k.extent.ymin)/m),g,d;for(g=1;g<m-1;g++){var h=g*q;for(d=1;d<q-1;d++)if(b&&!b[h+d])c[h+d]=0;else{var p=0;if(b&&(p=b[h-q+d-1]+b[h-q+d]+b[h-q+d+1]+b[h+d-1]+b[h+d+1]+b[h+q+d-1]+b[h+q+d]+b[h+q+d+1],7>p)){c[h+d]=0;a[h+d]=
0;continue}if(7===p){p=b[h-q+d-1]?l[h-q+d-1]:l[h+d];var t=b[h-q+d]?l[h-q+d]:l[h+d];var w=b[h-q+d+1]?l[h-q+d+1]:l[h+d];var u=b[h+d-1]?l[h+d-1]:l[h+d];var r=b[h+d+1]?l[h+d+1]:l[h+d];var y=b[h+q+d-1]?l[h+q+d-1]:l[h+d];var B=b[h+q+d]?l[h+q+d]:l[h+d];var C=b[h+q+d+1]?l[h+q+d+1]:l[h+d]}else p=l[h-q+d-1],t=l[h-q+d],w=l[h-q+d+1],u=l[h+d-1],r=l[h+d+1],y=l[h+q+d-1],B=l[h+q+d],C=l[h+q+d+1];u=(w+r+r+C-(p+u+u+y))*f;p=(y+B+B+C-(p+t+t+w))*e;0===u&&0===p?p=-1:(p=90-57.29578*Math.atan2(p,-u),0>p&&(p+=360),360===p?
p=0:360<p&&(p%=360));c[h+d]=p}}for(g=0;g<m;g++)c[g*q]=c[g*q+1],c[(g+1)*q-1]=c[(g+1)*q-2];for(g=1;g<q-1;g++)c[g]=c[g+q],c[g+(m-1)*q]=c[g+(m-2)*q];n.pixelType="F32";n.pixels=[c];n.statistics={minValue:0,maxValue:360};b&&(n.mask=a);return{extent:k.extent,pixelBlock:n}}},_clonePixelBlock:function(k){return k.clone?k.clone():H.clone(k)}}})},"esri/layers/rasterLib/function/BandArithmeticFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./rasterIndex".split(" "),
function(H,k,n,q,m,l,b){return H([n,l],{declaredClass:"esri.layers.rasterLib.function.BandArithmeticFunction",functionName:"BandArithmetic",supportWebGL:!0,support2D:!0,constructor:function(a){this.functionArguments=this.mixinIgnoreCase({method:1,bandIndexes:"",raster:null},a)},bind:function(a){a=this.getSourceRasterInfo(a);if(!a.raster)return Error("The raster input to band arithmetic function is invalid.");this.rasterInfo=k.mixin(a.raster,{bandCount:8===this.functionArguments.method?a.raster.bandCount:
1,pixelType:this._calculatePixelType(this.pixelType,"F32"),statistics:null,histograms:null});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType="Generic";return!0},read2D:function(a){this._performance.start();a=a.raster;var c=b.calculate(a.pixelBlock,{bandIndexes:this.functionArguments.bandIndexes,method:this.functionArguments.method});this._addPerformanceMetric(this._performance.elapsed());"Unknown"!==this.pixelType&&(c.pixelType=this.pixelType);
return{extent:a.extent,pixelBlock:c}},readGL:function(a){this._performance.start();this._initializeProgram({fragment:m.bandArithmetic,fragmentName:"bandArithmetic"});var c=this.functionArguments.bandIndexes.trim().split(" ").map(function(d){return parseInt(d,10)});this._infraredBandID=c[0]-1;this._visibleBandID=c[1]-1;this._alterBand=2<Math.max(this._infraredBandID,this._visibleBandID)?!0:!1;a=this._setupTextureData(a.raster,this._alterBand&&2==c.length?{bandIDs:[this._infraredBandID,this._visibleBandID,
this._infraredBandID]}:{bandIDs:[c[0]-1,c[1]-1,c[2]-1]});var f=this.bindFrameBuffer(),e=this.functionArguments.method,g=2<c.length?c.slice(2):null;this._alterBand?this._setUniforms({u_method:e,u_bandId_nir:0,u_bandId_red:1,u_constants:g}):this._setUniforms({u_method:e,u_bandId_nir:c[0]-1,u_bandId_red:c[1]-1,u_constants:g});this._bindTexture(a.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:a.extent,texture:f.texture}}})})},"esri/layers/rasterLib/function/rasterIndex":function(){define(["dojo/_base/lang"],
function(H){return{calculate:function(k,n){if(k&&k.pixels&&k.pixels.length){var q=n&&n.bandIndexes;n=n&&n.method;var m=q.trim().split(" ").map(function(a){return parseInt(a,10)}).filter(function(a){return null!=a});k=this._clonePixelBlock(k);var l=k.pixels,b=k.mask;switch(n){case 1:l=this._calculateNDVI(b,l[m[0]-1],l[m[1]-1]);break;case 2:l=this._calculateSAVI(b,l[m[0]-1],l[m[1]-1],m[2]);break;case 3:l=this._calculateTSAVI(b,l[m[0]-1],l[m[1]-1],m[2],m[3],m[4]);break;case 4:l=this._calculateMSAVI(b,
l[m[0]-1],l[m[1]-1]);break;case 5:l=this._calculateGEMI(b,l[m[0]-1],l[m[1]-1]);break;case 6:l=this._calculatePVI(b,l[m[0]-1],l[m[1]-1],m[2],m[3]);break;case 7:l=this._calculateGVITM(b,l[m[0]-1],l[m[1]-1],l[m[2]-1],l[m[3]-1],l[m[4]-1],l[m[5]-1]);break;case 8:l=this._calculateSultan(b,l[m[0]-1],l[m[1]-1],l[m[2]-1],l[m[3]-1],l[m[4]-1],l[m[5]-1]);break;case 9:l=this._calculateVARI(b,l[m[0]-1],l[m[1]-1],l[m[2]-1]);break;case 0:l=this._calculateUserDefined(b,l,q)}k.pixels=l;k.pixelType="F32";k.calculateStatistics();
return k}},_clonePixelBlock:function(k){return k.clone?k.clone():H.clone(k)},_parseUserDefined:function(k,n){k=k.replace(" ","");0===k.indexOf("-")&&(k="0"+k);0===k.indexOf("+")&&(k=k.slice(1,k.length));k=k.split("");var q=[],m=[],l="+-*/()".split(""),b,a="";for(b=0;b<k.length;b++){var c=k[b];l.some(function(f){return f===c})?(""!==a&&m.push(parseFloat(a)),q.push(c),a=""):"b"===c.toLowerCase()?(b++,a=c.concat(k[b]),m.push(n[parseInt(a[1],10)-1]),a=""):(a=a.concat(c),b===k.length-1&&m.push(parseFloat(a)))}return{ops:q,
nums:m}},_op:function(k,n,q,m){if(q.constructor===Number&&m.constructor===Number)return q+m;var l;if(q.constructor===Number){var b=m.length;var a=q;q=new Float32Array(b);for(l=0;l<b;l++)q[l]=a}else if(b=q.length,m.constructor===Number)for(a=m,m=new Float32Array(b),l=0;l<b;l++)m[l]=a;a=new Float32Array(b);if(null==k)if("+"===n)for(l=0;l<b;l++)a[l]=q[l]+m[l];else if("-"===n)for(l=0;l<b;l++)a[l]=q[l]-m[l];else if("*"===n)for(l=0;l<b;l++)a[l]=q[l]*m[l];else{if("/"===n)for(l=0;l<b;l++)a[l]=q[l]/m[l]}else if("+"===
n)for(l=0;l<b;l++)k[l]&&(a[l]=q[l]+m[l]);else if("-"===n)for(l=0;l<b;l++)k[l]&&(a[l]=q[l]-m[l]);else if("*"===n)for(l=0;l<b;l++)k[l]&&(a[l]=q[l]*m[l]);else if("/"===n)for(l=0;l<b;l++)k[l]&&(a[l]=q[l]/m[l]);return a},_shrinkOp:function(k,n){k.splice(n,1);var q=n=0,m=0;do{for(n=m=q=0;n<k.length;n++)if("("===k[n])q=n;else if(")"===k[n]){m=n;break}m===q+1&&k.splice(q,2)}while(m===q+1);return k},_getPriorityOpIndex:function(k,n){if(1===k.length)return{opIndex:0,numIndex:0};var q=n=0,m=0,l=-1,b=0;for(n=
0;n<k.length;n++)if("("===k[n])q=n;else if(")"===k[n]){m=n;break}var a=0===m?k:k.slice(q+1,m);for(n=0;n<a.length;n++)if("*"===a[n]||"/"===a[n]){l=n;break}if(!(-1<l))for(n=0;n<a.length;n++)if("+"===a[n]||"-"===a[n]){l=n;break}0<m&&(l+=q+1);for(n=0;n<l;n++)"("===k[n]&&b++;return{opIndex:l,numIndex:l-b}},_calculateUserDefined:function(k,n,q){n=this._parseUserDefined(q,n);q=n.ops;for(var m=n.nums,l,b,a;0<q.length&&(n=this._getPriorityOpIndex(q,m),l=q[n.opIndex],b=m[n.numIndex],a=m[n.numIndex+1],l=this._op(k,
l,b,a),1!==q.length);)q=this._shrinkOp(q,n.opIndex),m.splice(n.numIndex,2,l);return[l]},_calculateNDVI:function(k,n,q){var m=q.length,l=new Float32Array(m),b;if(null==k)for(b=0;b<m;b++){var a=q[b];var c=n[b];l[b]=(c-a)/(c+a)}else for(b=0;b<m;b++)k[b]&&(a=q[b],c=n[b],l[b]=(c-a)/(c+a));return[l]},_calculateSAVI:function(k,n,q,m){var l=q.length,b=new Float32Array(l),a;if(null==k)for(a=0;a<l;a++){var c=q[a];var f=n[a];b[a]=(f-c)/(f+c+m)*(1+m)}else for(a=0;a<l;a++)k[a]&&(c=q[a],f=n[a],b[a]=(f-c)/(f+c+
m)*(1+m));return[b]},_calculateTSAVI:function(k,n,q,m,l,b){var a=q.length,c=new Float32Array(a),f=-l*m+b*(1+m*m);if(null==k)for(b=0;b<a;b++){var e=q[b];var g=n[b];c[b]=m*(g-m*e-l)/(l*g+e+f)}else for(b=0;b<a;b++)k[b]&&(e=q[b],g=n[b],c[b]=m*(g-m*e-l)/(l*g+e+f));return[c]},_calculateMSAVI:function(k,n,q){var m=q.length,l=new Float32Array(m),b;if(null==k)for(b=0;b<m;b++){var a=q[b];var c=n[b];l[b]=.5*(2*(c+1)-Math.sqrt(Math.pow(2*c+1,2)-8*(c-a)))}else for(b=0;b<m;b++)k[b]&&(l[b]=.5*(2*(c+1)-Math.sqrt(Math.pow(2*
c+1,2)-8*(c-a))));return[l]},_calculateGEMI:function(k,n,q){var m=q.length,l=new Float32Array(m),b;if(null==k)for(b=0;b<m;b++){var a=q[b];var c=n[b];c=(2*(c*c-a*a)+1.5*c+.5*a)/(c+a+.5);l[b]=c*(1-.25*c)-(a-.125)/(1-a)}else for(b=0;b<m;b++)k[b]&&(a=q[b],c=n[b],c=(2*(c*c-a*a)+1.5*c+.5*a)/(c+a+.5),l[b]=c*(1-.25*c)-(a-.125)/(1-a));return[l]},_calculatePVI:function(k,n,q,m,l){var b=q.length,a=new Float32Array(b),c,f=Math.sqrt(1+m*m);if(null==k)for(c=0;c<b;c++){var e=q[c];var g=n[c];a[c]=(g-m*e-l)/f}else for(c=
0;c<b;c++)k[c]&&(e=q[c],g=n[c],a[c]=(g-m*e-l)/f);return[a]},_calculateGVITM:function(k,n,q,m,l,b,a){var c=n.length,f=new Float32Array(c),e;if(null==k)for(e=0;e<c;e++)f[e]=-.2848*n[e]-.2435*q[e]-.5436*m[e]+.7243*l[e]+.084*b[e]-1.18*a[e];else for(e=0;e<c;e++)k[e]&&(f[e]=-.2848*n[e]-.2435*q[e]-.5436*m[e]+.7243*l[e]+.084*b[e]-1.18*a[e]);return[f]},_calculateSultan:function(k,n,q,m,l,b,a){q=n.length;var c=new Float32Array(q),f=new Float32Array(q),e=new Float32Array(q),g;if(null==k)for(g=0;g<q;g++)c[g]=
b[g]/a[g]*100,f[g]=b[g]/n[g]*100,e[g]=m[g]/l[g]*(b[g]/l[g])*100;else for(g=0;g<q;g++)k[g]&&(c[g]=b[g]/a[g]*100,f[g]=b[g]/n[g]*100,e[g]=m[g]/l[g]*(b[g]/l[g])*100);return[c,f,e]},_calculateVARI:function(k,n,q,m){var l=n.length,b=new Float32Array(l),a;if(null==k)for(a=0;a<l;a++){var c=n[a];var f=q[a];var e=m[a];b[a]=(f-c)/(f+c-e)}else for(a=0;a<l;a++)if(k[a])for(a=0;a<l;a++)c=n[a],f=q[a],e=m[a],b[a]=(f-c)/(f+c-e);return[b]}}})},"esri/layers/rasterLib/function/ColormapFunction":function(){define("dojo/_base/declare dojo/_base/lang ../../../renderers/colorRampGenerator ./RasterFunctionX ./pixelShaders ./RasterFunctionWebGLMixin ./rasterUtils".split(" "),
function(H,k,n,q,m,l,b){return H([q,l],{declaredClass:"esri.layers.rasterLib.function.ColormapFunction",functionName:"Colormap",pixelType:"U8",renderTexture:!1,supportWebGL:!0,support2D:!0,constructor:function(a){this.functionArguments=this.mixinIgnoreCase({colormap:null,colorRampName:null,colorRamp:null,colorMapName:null,raster:null},a);this.invert=a&&a.invert;a=a.colormap||a.Colormap;if(a){if(a.features||a[0].attributes){a=a.features||a;var c=Object.keys(a[0].attributes);var f=c.filter(function(t){return"alpha"===
t.toLowerCase()})[0];var e=c.filter(function(t){return"value"===t.toLowerCase()})[0];var g=c.filter(function(t){return"red"===t.toLowerCase()})[0];var d=c.filter(function(t){return"green"===t.toLowerCase()})[0];var h=c.filter(function(t){return"blue"===t.toLowerCase()})[0];if(!(e&&g&&d&&h))throw"invalid colormap";a=a.map(function(t){return f?[t.attributes[e],t.attributes[g],t.attributes[d],t.attributes[h],t.attributes[f]]:[t.attributes[e],t.attributes[g],t.attributes[d],t.attributes[h]]});var p=1.1>
Math.max.apply(null,a.map(function(t){return t[1]}));c=f&&1.1>Math.max.apply(null,a.map(function(t){return t[4]}));if(p)for(p=0;p<a.length;p++)a[p][1]=Math.round(255*a[p][1]),a[p][2]=Math.round(255*a[p][2]),a[p][3]=Math.round(255*a[p][3]),c&&(a[p][4]=Math.round(255*a[p][4]))}this.functionArguments.colormap=this._sortClr(a)}this._initialize()},bind:function(a){this._initialize();a=this.getSourceRasterInfo(a);if(!a.raster||"F32"===a.raster.pixelType)return Error("The raster input to colormap function is invalid. It must be integer type.");
this.rasterInfo=k.mixin(a.raster,{bandCount:3,pixelType:this._calculatePixelType(this.pixelType,"U8"),statistics:null,histograms:null});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType="Processed";return!0},read2D:function(a){return this._colorize(a.raster)},readGL:function(a){return this._colorizeGL(a.raster)},_colorize:function(a){this._performance.start();var c=b.colorize(a.pixelBlock,{indexedColormap:this._indexedColormap,indexedColormapOffset:this._indexedColormapOffset,
indexed2DColormap:this._indexed2DColormap,alphaSpecified:this._alphaSpecified});this._addPerformanceMetric(this._performance.elapsed());return{extent:a.extent,pixelBlock:c}},_binarySearchClr:function(a,c){for(var f=0,e=a.length-1,g=0,d=0;f<e;)if(g=Math.floor((f+e)/2),d=a[g],d[0]<c)f=g;else if(d[0]>c)e=g;else return d.slice(1);return null},_sortClr:function(a,c){var f,e=[];for(f=0;f<a.length;f++)e.push(a[f]);for(f=0;f<e.length-1;f++){var g=e[f];for(a=f+1;a<e.length;a++)g[0]>e[a][0]&&(g=e[a],e[a]=e[f],
e[f]=g)}if(c)for(f=0;f<e.length/2;f++)g=e[f],e[e.length-1-f]=e[f],e[f]=g;return e},_invertColorRamp:function(a){if(!a)return a;var c={type:a.type};"random"===a.type?c=a:"multipart"===a.type?c.colorRamps=a.colorRamps.map(function(f){return{fromColor:f.toColor,toColor:f.fromColor}}).reverse():(c.fromColor=a.toColor,c.toColor=a.fromColor);return c},_initialize:function(){this._indexedColormapOffset=0;if(this.functionArguments.colormap){var a=b.buildIndexedColormap(this.functionArguments.colormap);this._alphaSpecified=
a&&a.alphaSpecified;this._indexedColormap=a&&a.indexedColormap;this._indexedColormapOffset=a&&a.offset;this._indexedColormap||(this._indexed2DColormap=this._getIndexed2DColormap())}else this.functionArguments.colorRamp?this._indexedColormap="multipart"===this.functionArguments.colorRamp.type?this.invert?n.createMultiPartColorRamp(this._invertColorRamp(this.functionArguments.colorRamp)):n.createMultiPartColorRamp(this.functionArguments.colorRamp):this.invert?n.createAlgorithmicColorRamp(this._invertColorRamp(this.functionArguments.colorRamp)):
n.createAlgorithmicColorRamp(this.functionArguments.colorRamp):this.functionArguments.colormapName&&"random"===this.functionArguments.colormapName.toLowerCase()&&(this._indexedColormap=n.createRandomColorRamp())},_getIndexed2DColormap:function(){var a=this.functionArguments.colormap;if(!a)return null;var c=0;0>a[0][0]&&(c=a[0][0]);var f=[],e=5===a[0].length,g;for(g=0;g<a.length;g++)f[a[g][0]-c]=e?a[g].slice(1):a[g].slice(1).concat([255]);return f},_colorizeGL:function(a){this._performance.start();
this._initializeProgram({fragment:m.colormap,fragmentName:"Colormap"});var c=this._indexedColormap,f=this._indexedColormapOffset;this._clrTexture||(this._clrTexture=this._setupColormapTexture(c));var e=this._clrTexture,g=this.bindFrameBuffer();a=this._setupTextureData(a);this._setUniforms({u_indexedColormapOffset:f,u_indexedColormapMaxIndex:c.length/4-1});this._bindTexture(e,"u_image1");this._bindTexture(a.texture,"u_image");this._drawGL();return{extent:a.extent,texture:g.texture}},_setupColormapTexture:function(a){var c=
this._createTexture(),f=this.gl,e=a.length/4,g=new Float32Array(a.length),d,h=this.renderTexture?255:1;for(d=0;d<a.length;d++)g[d]=a[d]/h;f.getExtension("OES_texture_float");f.texImage2D(f.TEXTURE_2D,0,f.RGBA,e,1,0,f.RGBA,f.FLOAT,g);return c}})})},"esri/renderers/colorRampGenerator":function(){define(["dojo/_base/declare","dojo/_base/lang","../renderers/colorUtils"],function(H,k,n){return{createAlgorithmicColorRamp:function(q,m){if(!q)return null;var l=q.fromColor,b=q.toColor;if(!l||!b)return null;
void 0===l.r&&3<=l.length&&(l={r:l[0],g:l[1],b:l[2]});void 0===b.r&&3<=b.length&&(b={r:b[0],g:b[1],b:b[2]});var a=q.size||256;q=q.algorithm||"cie-lab";if(1===a)var c=[l.r,l.g,l.b,255];else if(2===a)c=[l.r,l.g,l.b,255,b.r,b.g,l.b,255];else if(-1<q.toLowerCase().indexOf("hsv")){c=n.toHSV(l);b=n.toHSV(b);a=a||256;var f=0===c.s,e=0===b.s;l=c.h;q=b.h;f&&!e?l=c.h=q:e&&!f&&(q=b.h=l);f=Math.abs(q-l);180>f?q=(q-l)/(a-1):(f=360-f,q=l>q?f/(a-1):-f/(a-1));f=(b.s-c.s)/(a-1);e=(b.v-c.v)/(a-1);var g=c.s;c=c.v;var d,
h=new Uint8Array(4*a);for(d=0;d<a-1;d++){var p=n.toRGB({h:l,s:g,v:c});h[4*d]=p.r;h[4*d+1]=p.g;h[4*d+2]=p.b;h[4*d+3]=255;l+=q;g+=f;c+=e;360<l?l-=360:0>l&&(l+=360)}p=n.toRGB(b);h[4*(a-1)]=p.r;h[4*(a-1)+1]=p.g;h[4*(a-1)+2]=p.b;h[4*(a-1)+3]=255;c=h}else if(-1<q.toLowerCase().indexOf("lch")){g=n.toLCH(l);b=n.toLCH(b);a=a||256;c=(b.l-g.l)/(a-1);l=(b.c-g.c)/(a-1);q=(b.h-g.h)/(a-1);f=g.l;e=g.c;g=g.h;h=new Uint8Array(4*a);for(d=0;d<a-1;d++)p=n.toRGB({l:f,c:e,h:g}),h[4*d]=p.r,h[4*d+1]=p.g,h[4*d+2]=p.b,h[4*
d+3]=255,f+=c,e+=l,g+=q;p=n.toRGB(b);h[4*(a-1)]=p.r;h[4*(a-1)+1]=p.g;h[4*(a-1)+2]=p.b;h[4*(a-1)+3]=255;c=h}else if(-1<q.toLowerCase().indexOf("lab")){g=n.toLAB(l);b=n.toLAB(b);a=a||256;c=(b.l-g.l)/(a-1);l=(b.a-g.a)/(a-1);q=(b.b-g.b)/(a-1);f=g.l;e=g.a;g=g.b;h=new Uint8Array(4*a);for(d=0;d<a-1;d++)p=n.toRGB({l:f,a:e,b:g}),h[4*d]=p.r,h[4*d+1]=p.g,h[4*d+2]=p.b,h[4*d+3]=255,f+=c,e+=l,g+=q;p=n.toRGB(b);h[4*(a-1)]=p.r;h[4*(a-1)+1]=p.g;h[4*(a-1)+2]=p.b;h[4*(a-1)+3]=255;c=h}if(m&&!1===m.flattened)for(m=c,
c=[],b=0;b<c/4;b++)c[b]=m.slice(4*b,4*b+4);return c},createMultiPartColorRamp:function(q,m){if(!q)return null;m=m&&k.clone(m)||{flattened:!0};var l=q.colorRamps;if(!l||0===l.length)return null;var b=q.size||256;q=Math.max(Math.floor(b/l.length),1);var a=Math.max(q,b-(l.length-1)*q),c=!1!==m.flattened;m.flattened=!0;b=(l.length-1)*q+a;var f=new Uint8Array(4*b);for(b=0;b<l.length;b++){var e={fromColor:l[b].fromColor,toColor:l[b].toColor,size:b===l.length-1?a:q};f instanceof Array?f.concat(this.createAlgorithmicColorRamp(e,
m)):f.set(this.createAlgorithmicColorRamp(e,m),q*b*4)}if(!c)for(m=f,f=[],b=0;b<f/4;b++)f[b]=m.slice(4*b,4*b+4);return f},createRandomColorRamp:function(q){q=q||{};var m=q.size||256,l=!1===q.flattened;var b=l?new Uint8Array(4*m):[];for(q=0;q<m;q++)l?(b[4*q]=Math.round(255*Math.random()),b[4*q+1]=Math.round(255*Math.random()),b[4*q+2]=Math.round(255*Math.random()),b[4*q+3]=255):b[q]=[Math.round(255*Math.random()),Math.round(255*Math.random()),Math.round(255*Math.random()),255];return b}}})},"esri/layers/rasterLib/function/rasterUtils":function(){define(["dojo/_base/lang"],
function(H){return{mask:function(k,n){if(k&&k.pixels&&k.pixels.length){k=this._clonePixelBlock(k);var q=n.includedRanges,m=n.noDataInterpretation;n=n.noDataValues;if(null===q&&null===n)return k;var l=k.pixels,b=k.mask,a=k.width*k.height,c=l.length,f;if(null!==n&&n.length!==c)throw"expect "+c+" elements in noDataValues";if(null!==q&&q.length!==2*c)throw"expect "+2*c+" elements in IncludeRanges";if(null==b){b=new Uint8Array(a);for(f=0;f<a;f++)b[f]=1;k.mask=b}if(0===m)for(m=0;m<c;m++){var e=l[m];var g=
null===q?null:q[2*m];var d=null===q?null:q[2*m+1];var h=null===n?null:parseFloat(n[m]);if(null===g||null===d)for(f=0;f<a;f++){if(b[f]){var p=e[f];p===h&&(b[f]=0)}}else if(null===h)for(f=0;f<a;f++)b[f]&&(p=e[f],p<g||p>d)&&(b[f]=0);else for(f=0;f<a;f++)b[f]&&(p=e[f],p<g||p>d||p===h)&&(b[f]=0)}else{var t=new Uint8Array(a);for(f=0;f<a;f++)t[f]=b[f];for(m=0;m<c;m++)if(e=l[m],g=null===q?null:q[2*m],d=null===q?null:q[2*m+1],h=null===n?null:parseFloat(n[m]),null===g||null===d)for(f=0;f<a;f++)t[f]&&(p=e[f],
p!==h&&(t=0));else if(null===h)for(f=0;f<a;f++)t[f]&&(p=e[f],p<=g&&p<=d&&(t=0));else for(f=0;f<a;f++)t[f]&&(p=e[f],p<=g&&p<=d&&p!==h&&(t=0));for(f=0;f<a;f++)b[f]&&t[f]&&(b[f]=0)}return k}},calculateStatisticsHistograms:function(k,n){k=this._clonePixelBlock(k);n=k.pixelType;var q=k.pixels,m=k.mask,l=q.length,b,a,c=[],f;for(b=0;b<l;b++){var e={min:-.5,max:255.5,size:256,counts:new Uint32Array(256)};var g=e.counts;var d=q[b];if("U8"===n)if(m)for(a=0;a<k.width*k.height;a++)m[a]&&g[d[a]]++;else for(a=
0;a<k.width*k.height;a++)g[d[a]]++;else{var h=k.statistics[b].minValue;var p=k.statistics[b].maxValue;e.min=h;e.max=p;p=(p-h)/256;var t=new Uint32Array(257);if(m)for(a=0;a<k.width*k.height;a++)m[a]&&t[Math.floor((d[a]-h)/p)]++;else for(a=0;a<k.width*k.height;a++)t[Math.floor((d[a]-h)/p)]++;for(a=0;255>a;a++)g[a]=t[a];g[255]=t[255]+t[256]}c.push(e);h=k.statistics[b].minValue;p=k.statistics[b].maxValue;for(a=t=f=d=0;a<e.size;a++)d+=g[a],f+=a*g[a];f/=d;for(a=0;a<e.size;a++)t+=g[a]*Math.pow(a-f,2);g=
Math.sqrt(t/(d-1));a=(f+.5)*(e.max-e.min)/e.size+e.min;e=g*(e.max-e.min)/e.size;k.statistics[b]={min:h,minValue:h,max:p,maxValue:p,mean:a,stddev:e}}k.histograms=c;return k},buildIndexedColormap:function(k,n){if(!k)return null;var q=0;0>k[0][0]&&(q=k[0][0]);var m=Math.max(256,k[k.length-1][0]-q);if(65536<m)return null;var l=new Uint8Array(4*m),b=[],a=0,c=5===k[0].length;if(n)for(b=k[a],n=b[0]-q;n<m;n++)l[4*n]=b[1],l[4*n+1]=b[2],l[4*n+2]=b[3],l[4*n+3]=c?b[4]:255,n===b[0]-q&&(b=a===k.length-1?b:k[++a]);
else for(n=0;n<k.length;n++)b=k[n],a=4*(b[0]-q),l[a]=b[1],l[a+1]=b[2],l[a+2]=b[3],l[a+3]=c?b[4]:255;return{indexedColormap:l,offset:q,alphaSpecified:c}},colorize:function(k,n){if(null!==k&&null!==k.pixels){k=this._clonePixelBlock(k);var q=k.pixels,m=k.width*k.height,l=k.mask,b=n.indexedColormap,a=n.indexedColormapOffset,c=b&&b.length-1,f=n.indexed2DColormap;n=n.alphaSpecified;if(3<=q.length)throw"colormap only works on single band image";var e=q[0],g=new Uint8Array(e.length),d=new Uint8Array(e.length),
h=new Uint8Array(e.length),p=0;if(b)if(l)for(q=0;q<m;q++)l[q]&&(p=4*(e[q]-a),p<a||p>c?l[q]=0:(g[q]=b[p],d[q]=b[p+1],h[q]=b[p+2],l[q]=b[p+3]));else{l=new Uint8Array(m);for(q=0;q<m;q++)p=4*(e[q]-a),p<a||p>c?l[q]=0:(g[q]=b[p],d[q]=b[p+1],h[q]=b[p+2],l[q]=b[p+3]);k.mask=l}else if(l)for(q=0;q<m;q++)l[q]&&(b=f[e[q]],g[q]=b[0],d[q]=b[1],h[q]=b[2],l[q]=b[3]);else{l=new Uint8Array(m);for(q=0;q<m;q++)b=f[e[q]],g[q]=b[0],d[q]=b[1],h[q]=b[2],l[q]=b[3];k.mask=l}k.pixels=[g,d,h];k.statistics=null;k.pixelType="U8";
k.maskIsAlpha=n;return k}},convolute:function(k,n){k=this._clonePixelBlock(k);var q=k.pixels,m=k.width,l=k.height,b=m*l,a=q.length,c,f,e,g,d=[],h=[],p=n.normalizedKernel,t=n.kernelRows,w=n.kernelCols;for(n=0;n<a;n++){var u=q[n];var r=new Float32Array(b);r.set(u);for(e=1;e<l-1;e++){var y=e*m;for(g=1;g<m-1;g++){for(c=h=0;c<t;c++)for(f=0;f<w;f++)h+=u[y+g+(c-1)*m+f-1]*p[c*w+f];r[y+g]=h}}d.push(r)}k.pixels=d;return k},contrastBrightnessStretch:function(k,n){if(null!==k&&null!==k.pixels){k=this._clonePixelBlock(k);
var q=k.pixels,m=k.mask,l=k.width*k.height,b=q.length;var a=n&&n.contrastOffset;n=n&&n.brightnessOffset;if("U8"!==k.pixelType)throw"the contrast and brightness function only supports 8 bit unsigned integer data";var c=this._createContrastBrightnessLUT(a,n);if(null==m)for(a=0;a<l;a++)for(n=0;n<b;n++)q[n][a]=c[q[n][a]];else for(a=0;a<l;a++)if(m[a])for(n=0;n<b;n++)q[n][a]=c[q[n][a]];k.pixelType="U8";return k}},isNull:function(k,n){if(null!==k&&null!==k.pixels){k=this._clonePixelBlock(k);n=k.mask;var q=
k.pixels[0],m=q.length,l;if(n){for(l=0;l<m;l++)q[l]=n[l]?0:1;k.mask=null}else if(q.fill)q.fill(0);else for(l=0;l<m;l++)q[l]=0;return k}},setNull:function(k){if(null!==n&&null!==n.pixels){var n=this._clonePixelBlock(k);k=n.mask;var q=n.pixels[0],m=q.length,l;k=k||new Uint8Array(m);for(l=0;l<m;l++)k[l]=q[l]?0:1;n.mask=k;return n}},local:function(k,n){if(!n)return k[0];var q=n.rasterCountNeeded;n=n.functor;var m=this._clonePixelBlock(k[0]);if(null!==m&&null!==m.pixels){var l=m.width*m.height,b;k=(b=
k[1])&&b.pixels[0];var a=b&&b.mask,c=m.mask,f=m.pixels[0];if(2===q)if(!c&&a)c=a;else if(c&&a)for(b=0;b<l;b++)c[b]=c[b]&&a[b]?1:0;m.mask=c;if(1===q)if(null==c)for(b=0;b<l;b++)f[b]=n(f[b]);else for(b=0;b<l;b++)c[b]&&(f[b]=n(f[b]));else if(2===q)if(null==c)for(b=0;b<l;b++)f[b]=n(f[b],k[b]);else for(b=0;b<l;b++)c[b]&&(f[b]=n(f[b],k[b]));m.mask=c;m.calculateStatistics();return m}},remapColor:function(k,n){k=this._clonePixelBlock(k);var q=k.width*k.height,m=n.length,l=Math.floor(m/2),b=n[Math.floor(l)],
a=n[0].value,c=n[n.length-1].value,f=k.pixels[0],e,g,d=!1,h=new Uint8Array(q),p=new Uint8Array(q),t=new Uint8Array(q),w=k.mask,u=4===n[0].mappedColor.length;w&&0!==w.length||(w=new Uint8Array(q),w.fill(u?255:1),k.mask=w);for(g=0;g<q;g++)if(w[g]){var r=f[g];if(r<a||r>c)h[g]=p[g]=t[g]=w[g]=0;else{d=!1;var y=l;var B=b;var C=0;for(e=m-1;1<e-C;){if(r===B.value){d=!0;break}r>B.value?C=y:e=y;y=Math.floor((C+e)/2);B=n[Math.floor(y)]}d||(B=r===n[e].value?n[e]:n[C]);h[g]=B.mappedColor[0];p[g]=B.mappedColor[1];
t[g]=B.mappedColor[2];w[g]=B.mappedColor[3]}}k.pixels=[h,p,t];k.mask=w;k.pixelType="u8";k.maskIsAlpha=u;return k},_clonePixelBlock:function(k){if(k.clone)return k.clone();var n=H.clone(k),q;if(k.pixels&&k.pixels[0]&&0<k.pixels[0].length&&!(n.pixels&&n.pixels[0]&&0<n.pixels[0].length)){n.pixels=[];var m=k.pixels.length;for(q=0;q<m;q++)n.pixels[q]=new k.pixels[q].constructor(k.pixels[q])}if(k.statistics)for(n.statistics=[],m=k.statistics.length,q=0;q<m;q++)n.statistics[q]=H.clone(k.statistics[q]);k.mask&&
(n.mask=new Uint8Array(k.mask));return n},_createContrastBrightnessLUT:function(k,n){if(this._contrastCache&&this._contrastCache.contrastOffset===k&&this._contrastCache.brightnessOffset===n)return this._contrastCache.lut;var q=Math.min(Math.max(k,-100),100),m=Math.min(Math.max(n,-100),100),l,b=new Uint8Array(256);for(l=0;256>l;l++){if(0<q&&100>q)var a=(200*l-25500+510*m)/(2*(100-q))+128;else 0>=q&&-100<q?a=(200*l-25500+510*m)*(100+q)/2E4+128:100===q?(a=200*l-25500+256*(100-q)+510*m,a=0<a?255:0):-100===
q&&(a=128);b[l]=255<a?255:0>a?0:a}this._contrastCache={contrastOffset:k,brightnessOffset:n,lut:b};return b}}})},"esri/layers/rasterLib/function/CompositeBandFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin".split(" "),function(H,k,n,q,m,l){return H([n,l],{declaredClass:"esri.layers.rasterLib.function.CompositeBandFunction",functionName:"CompositeBand",supportWebGL:!0,support2D:!0,constructor:function(b){this.functionArguments=
this.mixinIgnoreCase({rasters:null},b)},bind:function(b){b=this.getSourceRasterInfo(b);if(!b.rasters)return Error("The rasters input to composite band function is invalid.");var a=[],c=[],f=b.rasters.length,e;if(b.rasters[0].statistics)for(e=0;e<f;e++)a.push(b.rasters[e].statistics[0]);if(b.rasters[0].histograms)for(e=0;e<f;e++)c.push(b.rasters[e].histograms[0]);this.rasterInfo=k.mixin(b.rasters[0],{bandCount:f,pixelType:this._calculatePixelType(this.pixelType,b.rasters[0].pixelType),statistics:a,
histograms:c});return!0},read2D:function(b){b=b.rasters;if(null!=b&&0!==b.length){var a=this._clonePixelData(b[0]),c=a.pixelBlock,f=[],e=[];for(g=0;g<b.length;g++)f.push(b[g].pixelBlock.pixels[0]),e.push(b[g].pixelBlock.statistics[0]);c.pixels=f;c.stackedStatistics=e;c.planes=b.length;var g;e=c.width*c.height;for(g=0;g<b.length;g++)if(c=b[g].pixelBlock.mask,d&&c)for(f=0;f<e;f++)d[f]&=c[f];else var d=d||c;a.maks=d;return a}},readGL:function(b){this._performance.start();this._initializeProgram({fragment:m.compositeBand,
fragmentName:"CompositeBand"});var a=b.rasters;if(null!=a&&0!==a.length){a=a.length;var c,f=this.bindFrameBuffer();for(c=0;c<a;c++){var e=this._setupTextureData(b.rasters[c],{notOriginal:0<c});var g=0<c?c.toString():"";this._bindTexture(e.texture,"u_image"+g)}this._setUniforms({u_rasterCount:a});this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:e.extent,texture:f.texture}}}})})},"esri/layers/rasterLib/function/ContrastBrightnessFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./rasterUtils".split(" "),
function(H,k,n,q,m,l,b){return H([n,l],{declaredClass:"esri.layers.rasterLib.function.ContrastBrightnessFunction",renderTexture:!0,functionName:"ContrastBrightness",supportWebGL:!0,support2D:!0,pixelType:"U8",constructor:function(a){this.functionArguments=this.mixinIgnoreCase({contrastOffset:0,brightnessOffset:0,raster:null},a)},bind:function(a){a=this.getSourceRasterInfo(a);if(!a.raster)return Error("The raster input to contrast and brightness function is invalid.");this.rasterInfo=k.mixin(a.raster,
{bandCount:a.raster.bandCount,pixelType:this._calculatePixelType(this.pixelType,"U8"),statistics:null,histograms:null});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType="Processed";return!0},read2D:function(a){a=a.raster;if(null!==a&&null!==a.pixelBlock&&null!==a.pixelBlock.pixels){var c=b.contrastBrightnessStretch(a.pixelBlock,{contrastOffset:this.functionArguments.contrastOffset,brightnessOffset:this.functionArguments.brightnessOffset});"Unknown"!==
this.pixelType&&(c.pixelType=this.pixelType,c.pixels=c.pixels.map(k.hitch(this,function(f){return this._clampBand(f,c.pixelType)})));return{extent:a.extent,pixelBlock:c}}},readGL:function(a){return this._cbGL(a.raster)},_cbGL:function(a){this._performance.start();this._initializeProgram({fragment:m.contrastBrightness,fragmentName:"ContrastBrightness"});a=this._setupTextureData(a);this._setUniforms({u_contrastOffset:Math.min(Math.max(this.functionArguments.contrastOffset,-100),100),u_brightnessOffset:Math.min(Math.max(this.functionArguments.brightnessOffset,
-100),100),u_scaleFactor:this.renderTexture?255:1});this._bindTexture(a.texture,"u_image");var c=this.bindFrameBuffer();this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:a.extent,texture:c.texture}}})})},"esri/layers/rasterLib/function/ConvolutionFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./convolutionKernel ./pixelShaders ./RasterFunctionWebGLMixin ./rasterUtils".split(" "),function(H,k,n,q,m,l,b,a){return H([n,
b],{declaredClass:"esri.layers.rasterLib.function.ConvolutionFunction",functionName:"Convolution",supportWebGL:!0,support2D:!0,constructor:function(c){this.functionArguments=this.mixinIgnoreCase({columns:3,rows:3,type:0,kernel:null,raster:null},c)},bind:function(c){c=this.getSourceRasterInfo(c);if(!c.raster)return Error("The raster input to convolution function is invalid.");this.rasterInfo=k.mixin(c.raster,{bandCount:c.raster.bandCount,pixelType:this._calculatePixelType(this.pixelType,c.raster.pixelType),
statistics:c.raster.statistics,histograms:c.raster.histograms});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType="Generic";return!0},read2D:function(c){this._performance.start();c=c.raster;var f=this._analyzeKernel(),e=a.convolute(c.pixelBlock,{normalizedKernel:f.normalizedKernel,kernelCols:this.functionArguments.columns,kernelRows:this.functionArguments.rows});this._addPerformanceMetric(this._performance.elapsed());"Unknown"!==this.pixelType&&
(e.pixelType=this.pixelType);e.pixels=e.pixels.map(k.hitch(this,function(g){return this._clampBand(g,e.pixelType)}));return{extent:c.extent,pixelBlock:e}},readGL:function(c){this._performance.start();this._initializeProgram({fragment:l.convolution,fragmentName:"Convolution"});var f=this._setupTextureData(c.raster),e=this.bindFrameBuffer(),g=this.gl,d=g.drawingBufferWidth;g=g.drawingBufferHeight;var h=this.functionArguments.kernel;this._setUniforms({u_resolution:c&&c.raster&&c.raster.pixelBlock?[1/
c.raster.pixelBlock.width,1/c.raster.pixelBlock.height]:[1/d,1/g],u_kernel:h,u_kernelSize:h.length});this._bindTexture(f.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:f.extent,texture:e.texture}},_analyzeKernel:function(){var c=this.functionArguments.kernel,f=c.reduce(function(d,h){return d+h});0!==f&&1!==f&&(c=c.map(function(d){return d/f}));var e,g=[];for(e=0;e<c.length;e++)g.some(function(d){return d===c[e]})||g.push(c[e]);return{normalizedKernel:c,
distinctValues:g}},_analyzeKernelPattern:function(){var c=this.functionArguments.rows,f=this.functionArguments.columns,e=this.functionArguments.kernel,g=[],d,h;for(d=0;d<c;d++)g.push({weights:e.slice(d*f,(d+1)*f)});var p;for(d=1;d<c;d++){var t=g[d].weights;for(e=0;e<d;e++)if(p=g[e].weights){var w=t[0]/p[0];for(h=1;h<f;h++)t[h]/p[h]!==w&&(w=null);null!==w&&(g[d]={row:e,factor:w})}}return g}})})},"esri/layers/rasterLib/function/ExtractBandFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin".split(" "),
function(H,k,n,q,m,l){return H([n,l],{declaredClass:"esri.layers.rasterLib.function.ExtractBandFunction",functionName:"ExtractBand",supportWebGL:!0,support2D:!0,constructor:function(b){this.functionArguments=this.mixinIgnoreCase({bandIDs:[],missingBandAction:0,raster:null},b)},bind:function(b){b=this.getSourceRasterInfo(b);if(!b.raster)return Error("The raster input to extract band function is invalid.");var a=[],c=b.raster.statistics,f=[],e=b.raster.histograms,g=this.functionArguments.bandIDs.length||
b.raster.bandCount;this.functionArguments.bandIDs.forEach(k.hitch(this,function(d){if(d>=g-1){if(1===this.functionArguments.missingBandAction)return Error("missing band "+d);d=g-1}if(0>d)return Error("missing band "+d);void 0!==c&&null!==c&&0<c.length&&a.push(c[d]);void 0!==e&&null!==e&&0<e.length&&f.push(e[d])}));this.rasterInfo=k.mixin(b.raster,{bandCount:g,pixelType:this._calculatePixelType(this.pixelType,b.raster.pixelType),statistics:a,histograms:f});return!0},read2D:function(b){b=this._clonePixelData(b.raster);
if(null!==b&&null!==b.pixelBlock&&null!==b.pixelBlock.pixels){this._performance.start();var a=b.pixelBlock,c=a.statistics,f=a.pixels,e=f.length;if(null==this.functionArguments.bandIDs)throw"missing bandIDs parameter";if(0===this.functionArguments.bandIDs.length)return b;var g=[],d=[];this.functionArguments.bandIDs.forEach(function(h){if(h>=e-1){if(1===this.functionArguments.missingBandAction)throw"missing band "+h;h=e-1}if(0>h)throw"missing band "+h;g.push(f[h]);void 0!==c&&null!==c&&0<c.length&&
d.push(c[h])});a.pixels=g;a.statistics=d;a.planes=this.functionArguments.bandIDs.length;return b}},readGL:function(b){this._performance.start();if(null==this.functionArguments.bandIDs)throw"missing bandIDs parameter";if(3<this.functionArguments.bandIDs.length)throw"this version does not support more than 3 bands yet";this._initializeProgram({fragment:m.extractBand,fragmentName:"ExtractBand"});var a=this.functionArguments.bandIDs;1===a.length&&(a=[a[0],a[0],a[0]]);this._bandIDs=a;this._alterBand=!(0===
this.functionArguments.bandIDs.length||0===a[0]&&1===a[1]&&2===a[2]);var c=!!(this._alterBand&&b.raster&&b.raster.texture);b=this._setupTextureData(b.raster,{bandIDs:a});var f=this.bindFrameBuffer();c?this._setUniforms({u_bandIDs:a,u_alterBand:this._alterBand}):this._setUniforms({u_bandIDs:a,u_alterBand:!1});this._bindTexture(b.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:b.extent,texture:f.texture}}})})},"esri/layers/rasterLib/function/HillshadeFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../../renderers/colorRampGenerator ../../../WKIDUnitConversion ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./surfaceUtils ./rasterUtils".split(" "),
function(H,k,n,q,m,l,b,a,c,f){return H([n,a],{declaredClass:"esri.layers.rasterLib.function.HillshadeFunction",functionName:"Hillshade",supportWebGL:!0,support2D:!0,renderTexture:!0,constructor:function(e){this.functionArguments=this.mixinIgnoreCase({hillshadeType:0,altitude:45,azimuth:315,zFactor:1,slopeType:1,psPower:.664,psFactor:.024,colorRamp:null,raster:null},e);this._azimuths=[315,270,225,360,180,0];this._altitudes=[60,60,60,60,60,90];this._weights=[3,5,3,2,1,4];var g=this._weights.reduce(function(d,
h){return d+h});this._weights=this._weights.map(function(d){return d/g})},bind:function(e){e=this.getSourceRasterInfo(e);if(!e.raster)return Error("The raster input to hillshade function is invalid.");e.raster.statistics&&(this.srcStatistics=e.raster.statistics);this.rasterInfo=k.mixin(e.raster,{bandCount:1,pixelType:this._calculatePixelType(this.pixelType,"U8"),statistics:[{min:0,max:255}],histograms:null});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType=
"Generic";this._initializeColormap();return!0},read2D:function(e){this._performance.start();e=e.raster;e=c.hillshade(e,{altitude:this.functionArguments.altitude,azimuth:this.functionArguments.azimuth,zFactor:this.functionArguments.zFactor,psPower:this.functionArguments.psPower,psFactor:this.functionArguments.psFactor,hillshadeType:this.functionArguments.hillshadeType,slopeType:this.functionArguments.slopeType,isGCS:e.extent.spatialReference.wkid&&null==m[e.extent.spatialReference.wkid]});this._addPerformanceMetric(this._performance.elapsed());
return e},readGL:function(e){this._performance.start();this._initializeProgram({fragment:b.hillshade,fragmentName:"Hillshade"});this.functionArguments.colorRamp&&this._indexedColormap&&!this._clrTexture&&(this._clrTexture=this._setupColormapTexture(this._indexedColormap));var g=this._setupTextureData(e.raster),d=this.bindFrameBuffer(),h=this.gl,p=h.drawingBufferWidth;h=h.drawingBufferHeight;var t=g.extent,w=(t.xmax-t.xmin)/p,u=(t.ymax-t.ymin)/h,r=this.functionArguments.altitude,y=this.functionArguments.azimuth,
B=this.functionArguments.zFactor;1===this.functionArguments.hillshadeType&&(B*=2);var C=B/(8*w),G=B/(8*u);.001<B&&t.spatialReference.wkid&&null==m[t.spatialReference.wkid]&&(C/=111E3,G/=111E3);var x=this.functionArguments.psPower,v=this.functionArguments.psFactor;3===this.functionArguments.slopeType&&((C=t.spatialReference.wkid&&null==m[t.spatialReference.wkid])?(C=111E3*w,G=111E3*u,C=(B+Math.pow(C,x)*v)/(8*C),G=(B+Math.pow(G,x)*v)/(8*G)):(C=(B+Math.pow(w,x)*v)/(8*w),G=(B+Math.pow(u,x)*v)/(8*u)));
var z=(90-r)*Math.PI/180;r=Math.cos(z);var A=(360-y+90)*Math.PI/180;y=Math.sin(z)*Math.cos(A);z=Math.sin(z)*Math.sin(A);x=Array(6);v=Array(6);t=Array(6);var F=this._weights,J;if(1===this.functionArguments.hillshadeType){var L=this._azimuths.length;for(J=0;J<L;J++)r=this._altitudes[J],y=this._azimuths[J],z=(90-r)*Math.PI/180,r=Math.cos(z),A=(360-y+90)*Math.PI/180,y=Math.sin(z)*Math.cos(A),z=Math.sin(z)*Math.sin(A),x[J]=r,v[J]=y,t[J]=z}else x[0]=r,v[0]=y,t[0]=z;x=x.map(function(P){return parseFloat(P)});
v=v.map(function(P){return parseFloat(P)});t=t.map(function(P){return parseFloat(P)});this._setUniforms({u_cellSize:[w,u],u_zfactor:B,u_xFactor:C,u_yFactor:G,u_sinZcosA:y,u_sinZsinA:z,u_cosZ:r,u_sinZcosAs:v,u_sinZsinAs:t,u_cosZs:x,u_weights:F,u_hillshadeType:this.functionArguments.hillshadeType,u_resolution:e&&e.raster&&e.raster.pixelBlock?[1/e.raster.pixelBlock.width,1/e.raster.pixelBlock.height]:[1/p,1/h],u_scaled:!this.renderTexture,u_applyColorramp:this._clrTexture?!0:!1,u_minValue:this.srcStatistics[0].min,
u_maxValue:this.srcStatistics[0].max,u_indexedColormapOffset:this._indexedColormapOffset||0,u_indexedColormapMaxIndex:this._indexedColormap?this._indexedColormap.length/4-1:0});this._clrTexture&&this._bindTexture(this._clrTexture,"u_image1");this._bindTexture(g.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:g.extent,texture:d.texture}},_initializeColormap:function(){this._indexedColormapOffset=0;var e=this._indexedColormap,g=this.functionArguments.colorRamp;
this.functionArguments.colormap?(this._alphaSpecified=(g=f.buildIndexedColormap(this.functionArguments.colormap))&&g.alphaSpecified,this._indexedColormap=g&&g.indexedColormap,this._indexedColormapOffset=g&&g.offset):g?(this._indexedColormap="multipart"===g.type?this.invert?q.createMultiPartColorRamp(this._invertColorRamp(g)):q.createMultiPartColorRamp(g):this.invert?q.createAlgorithmicColorRamp(this._invertColorRamp(g)):q.createAlgorithmicColorRamp(g),g.fromColor&&g.toColor&&"000"===g.fromColor.slice(0,
3).join("")&&"255255255"===g.toColor.slice(0,3).join("")&&(this._clrTexture=this._indexedColormap=null)):this.functionArguments.colormapName?"random"===this.functionArguments.colormapName.toLowerCase()&&(this._indexedColormap=q.createRandomColorRamp()):this._clrTexture=this._indexedColormap=null;if(e&&this._indexedColormap){g=!0;for(var d=0;d<e.length;d++)if(e[d]!==this._indexedColormap[d]){g=!1;break}g||(this._clrTexture=null)}},_setupColormapTexture:function(e){var g=this._createTexture(),d=this.gl,
h=e.length/4,p=new Float32Array(e.length),t;for(t=0;t<e.length;t++)p[t]=e[t]/255;d.getExtension("OES_texture_float");d.texImage2D(d.TEXTURE_2D,0,d.RGBA,h,1,0,d.RGBA,d.FLOAT,p);return g}})})},"esri/layers/rasterLib/function/LocalFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./rasterUtils".split(" "),function(H,k,n,q,m,l,b){return H([n,l],{declaredClass:"esri.layers.rasterLib.function.LocalFunction",functionName:"Local",
supportWebGL:!0,support2D:!0,constructor:function(a){this.functionArguments=this.mixinIgnoreCase({operation:null,rasters:null},a)},bind:function(a){a=this.getSourceRasterInfo(a);var c=0;a.raster?c=a.raster.bandCount:a.rasters&&(c=Math.max.apply(null,a.rasters.map(function(f){return f.bandCount})));if(0===c)return Error("The raster input to local function is invalid. It only takes single band input.");a=a.raster||a.rasters.filter(function(f){return!!f.extent})[0];this.rasterInfo=k.mixin(a,{bandCount:1,
pixelType:this._calculatePixelType(this.pixelType,"F32"),statistics:null,histograms:null});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType="Generic";return!0},read2D:function(a){var c=[];c=a.raster?a.raster2?[a.raster,a.raster2]:[a.raster]:a.rasters;a=c.map(function(h){return h.pixelBlock});var f=this.functionArguments.operation;if(null===f)return c[0];this._performance.start();var e=this._getOperations(),g=e.operators[f-1];e=e.functors[f-1];
if(!this.functionArguments.rasters){if(1!==g)throw"no sufficient rasters, require "+g;}else if(999!==g&&this.functionArguments.rasters.length!==g)throw"number of rasters does not meet (short or exceed) the operation requirment, require "+g;var d=31===f?b.isNull(a[0]):50===f?b.setNull(a[0]):b.local(a,{rasterCountNeeded:g,functor:e});"Unknown"!==this.pixelType&&(d.pixelType=this.pixelType,d.pixels=d.pixels.map(k.hitch(this,function(h){return this._clampBand(h,d.pixelType)})));d.statistics||d.calculateStatistics();
return{extent:c[0].extent,pixelBlock:d}},readGL:function(a){this._performance.start();var c=this.functionArguments.operation,f=this._getWebGLOperations(),e=f.operators[c-1],g=m.local;f="result\x3d"+f.functors[c-1]+";";31!==c&&50!==c&&(f+="result \x3d vec4(result.rgb, a.a);");g=g.replace("vec4 replaceme"+e+";",f);f=this.gl.getParameter(this.gl.VERSION);var d="";if(-1<f.toLowerCase().indexOf("webgl 1.0")||-1<f.toLowerCase().indexOf("webgl 0."))d=this._getPolyfill(c);g=g.replace("vec4 polyfill;",d);
1<e&&(g=g.replace("gl_FragColor \x3d localOp1();","gl_FragColor \x3d localOp1();".replace("1",e.toString())));this._initializeProgram({fragment:g,fragmentName:"Local"});c=a.rasters;if(null!=c&&0!==c.length){c=c.length;f=this.bindFrameBuffer();for(e=0;e<c;e++){g=0<e?e.toString():"";var h=this._setupTextureData(a.rasters[e],{reCreate:!0});this._bindTexture(h.texture,"u_image"+g)}this._setUniforms({});this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:h.extent,texture:f.texture}}},
_getOperations:function(){return{operators:[2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,1,1,1,1,999,999,1,1,999,1,1,2,2,2,999,999,999,999,999,999,999,999,999,999,3],functors:[function(a,c){return a+c},function(a,c){return a-c},function(a,c){return a*c},function(a){return Math.sqrt(a)},function(a,c){return Math.pow(a,c)},function(a){return Math.acos(a)},function(a){return Math.asin(a)},function(a){return Math.atan(a)},function(a){return Math.atanh(a)},
function(a){return Math.abs(a)},function(a,c){return a&c},function(a,c){return a<<c},function(a){return~a},function(a,c){return a|c},function(a,c){return a>>c},function(a,c){return a^c},function(a,c){return a&&c},function(a){return!a},function(a,c){return a||c},function(a,c){return a!=c},function(a){return Math.cos(a)},function(a,c){return Math.cosh(a)},function(a,c){return a/c},function(a,c){return a==c},function(a){return Math.exp(a)},function(a){return Math.pow(10,a)},function(a){return Math.pow(2,
a)},function(a,c){return a>c?1:0},function(a,c){return a>=c?1:0},function(a,c){return Math.floor(a)},function(a){return!a},function(a){return a},function(a,c){return a<c?1:0},function(a,c){return a<=c?1:0},function(a){return Math.log(a)},function(a,c){return Math.log10(a)},function(a,c){return Math.log2(a)},999,999,999,999,999,999,function(a,c){return a%c},function(a){return-a},function(a,c){return a!=c?1:0},999,function(a,c){return Math.floor(a)},function(a,c){return Math.ceil(a)},function(a,c){return c?
0:a},function(a,c){return Math.sin(a)},function(a,c){return Math.sinh(a)},function(a,c){return a*a},999,999,function(a){return Math.tan(a)},function(a){return Math.tanh(a)},999,function(a){return Math.acosh(a)},function(a){return Math.asinh(a)},function(a,c){return Math.atan2(a,c)},function(a,c){return a/c},function(a,c){return Math.floor(a/c)},999,999,999,999,999,999,999,999,999,999,function(a,c,f){return a?c:f}]}},_polyfill:{sinh:"vec4 sinh(vec4 x) {\nvec4 halfexp \x3d exp(x)/2.0;\nreturn halfexp - 1.0/halfexp;\n}",
asinh:"vec4 asinh(vec4 x) {\nvec4 halfexp \x3d exp(x)/2.0;\nreturn 1.0/(halfexp - 1.0/halfexp);\n}",cosh:"vec4 cosh(vec4 x) {\nvec4 halfexp \x3d exp(x)/2.0;\nreturn halfexp + 1.0/halfexp;\n}",acosh:"vec4 acosh(vec4 x) {\nvec4 halfexp \x3d exp(x)/2.0;\nreturn 1.0/(halfexp + 1.0/halfexp);\n}",tanh:"vec4 tanh(vec4 x) {\nvec4 expx \x3d exp(x);\nreturn (expx - 1.0/expx)/(expx + 1.0/expx);\n}",atanh:"vec4 atanh(vec4 x) {\nvec4 expx \x3d exp(x);\nreturn (expx + 1.0/expx)/(expx - 1.0/expx);\n}"},_getPolyfill:function(a){var c=
"";switch(a){case 9:c=this._polyfill.atanh;break;case 22:c=this._polyfill.cosh;break;case 52:c=this._polyfill.sinh;break;case 57:c=this._polyfill.tanh;break;case 59:c=this._polyfill.acosh;break;case 60:c=this._polyfill.asinh}return c},_getWebGLOperations:function(){return{operators:[2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,1,1,1,1,999,999,1,1,999,1,1,2,2,2,999,999,999,999,999,999,999,999,999,999,3],functors:["(a + b)","(a - b)",
"(a * b)","sqrt(a)","pow(a, b)","acos(a)","asin(a)","atan(a)","atanh(a)","abs(a)","a","a","a","a","a","a","(a.r\x3d\x3d0.0 || b.r\x3d\x3d0.0) ? vec4(0.0,0.0,0.0,a.a) : vec4(1.0,1.0,1.0,a.a)","a.r\x3d\x3d0.0?vec4(1.0,1.0,1.0,a.a) : vec4(0.0,0.0,0.0,a.a)","(a.r\x3d\x3d0.0 \x26\x26 b.r\x3d\x3d0.0) ? vec4(0.0,0.0,0.0,a.a) : vec4(1.0,1.0,1.0,a.a)","(a.r\x3d\x3d0.0 ^^ b.r\x3d\x3d0.0) ? vec4(1.0,1.0,1.0,a.a) : vec4(0.0,0.0,0.0,a.a)","cos(a)","cosh(a)","a / b","a.r \x3d\x3d b.r? vec4(1.0,1.0,1.0,a.a) : vec4(0.0,0.0,0.0,a.a)",
"exp(a)","pow(10.0, a)","pow(2.0, a)","a.r \x3e b.r ? vec4(1.0,1.0,1.0,a.a) : vec4(0.0,0.0,0.0,a.a)","a.r \x3e\x3d b.r ? vec4(1.0,1.0,1.0,a.a) : vec4(0.0,0.0,0.0,a.a)","floor(a)","a.a \x3d\x3d 0.0? vec4(1.0,1.0,1.0,1.0) : vec4(0.0,0.0,0.0,1.0)","a","a.r \x3c b.r ? vec4(1.0,1.0,1.0,a.a) : vec4(0.0,0.0,0.0,a.a)","a.r \x3c\x3d b.r ? vec4(1.0,1.0,1.0,a.a) : vec4(0.0,0.0,0.0,a.a)","log(a)","log2(a) / log2(10.0)","log2(a)",999,999,999,999,999,999,"mod(a, b)","-a","a.r !\x3d b.r ? vec4(1.0,1.0,1.0,a.a) : vec4(0.0,0.0,0.0,a.a)",
999,"floor(a)","ceil(a)","a.r !\x3d 0.0 ? vec4(0.0,0.0,0.0,0.0) : a","sin(a)","sinh(a)","a * a",999,999,"tan(a)","tanh(a)",999,"acosh(a)","asinh(a)","atan(a, b)","a / b","floor(a / b)",999,999,999,999,999,999,999,999,999,999,"a.r!\x3d0 ? b : c"]}}})})},"esri/layers/rasterLib/function/MaskFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./rasterUtils".split(" "),function(H,k,n,q,m,l,b){return H([n,l],{declaredClass:"esri.layers.rasterLib.function.MaskFunction",
functionName:"Mask",supportWebGL:!0,support2D:!0,constructor:function(a){this.functionArguments=this.mixinIgnoreCase({includedRanges:null,noDataInterpretation:0,noDataValues:null,raster:null},a)},bind:function(a){a=this.getSourceRasterInfo(a);if(!a.raster)return Error("The raster input to mask function is invalid.");this.rasterInfo=k.mixin(a.raster,{bandCount:a.raster.bandCount,pixelType:this._calculatePixelType(this.pixelType,a.raster.pixelType),statistics:a.raster.statistics,histograms:a.raster.histograms});
return!0},read2D:function(a){this._performance.start();a=a.raster;var c=b.mask(a.pixelBlock,{includedRanges:this.functionArguments.includedRanges,noDataInterpretation:this.functionArguments.noDataInterpretation,noDataValues:this.functionArguments.noDataValues});this._addPerformanceMetric(this._performance.elapsed());"Unknown"!==this.pixelType&&(c.pixelType=this.pixelType);return{extent:a.extent,pixelBlock:c}},readGL:function(a){this._performance.start();this._initializeProgram({fragment:m.mask,fragmentName:"Mask"});
a=this._setupTextureData(a.raster);var c=this.bindFrameBuffer(),f=this.functionArguments.includedRanges,e=this.functionArguments.noDataValues?this.functionArguments.noDataValues.map(function(g){return parseFloat(g,10)}):null;this._setUniforms({u_includedRanges:f,u_includedRanges_specified:f?!0:!1,u_noDataValues:e,u_noDataValues_specified:e?!0:!1,u_noDataInterpretation:this.functionArguments.noDataInterpretation,u_bandCount:Math.min(this.sourceRasterInfo.raster.bandCount,3)});this._bindTexture(a.texture,
"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:a.extent,texture:c.texture}}})})},"esri/layers/rasterLib/function/NDVIFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./rasterIndex".split(" "),function(H,k,n,q,m,l,b){return H([n,l],{declaredClass:"esri.layers.rasterLib.function.NDVIFunction",functionName:"NDVI",supportWebGL:!0,support2D:!0,constructor:function(a){this.functionArguments=
this.mixinIgnoreCase({visibleBandID:1,infraredBandID:2,scaled:!0,raster:null},a)},bind:function(a){a=this.getSourceRasterInfo(a);if(!(a.raster&&1<a.raster.bandCount))return Error("The raster input to ndvi function is invalid. It requires more than 1 band.");this.rasterInfo=k.mixin(a.raster,{bandCount:1,pixelType:this._calculatePixelType(this.pixelType,this.scaled?"U8":"F32"),statistics:this.scaled?[{min:0,max:200}]:[{min:-1,max:1}],histograms:null});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||
{};this.rasterInfo.keyProperties.DataType="Generic";return!0},read2D:function(a){this._performance.start();a=a.raster;var c=b.calculate(a.pixelBlock,{bandIndexes:[this.functionArguments.infraredBandID+1,this.functionArguments.visibleBandID+1].join(" "),method:1}),f;if(this.functionArguments.scaled){var e=c.pixels[0];var g=c.mask;var d=e.length;var h=new Uint8Array(d);if(null==g)for(f=0;f<d;f++)h[f]=100*e[f]+100&255;else for(f=0;f<d;f++)g[f]&&(h[f]=100*e[f]+100&255);c.pixels[0]=h;c.pixelType="U8"}this._addPerformanceMetric(this._performance.elapsed());
"Unknown"!==this.pixelType&&(c.pixelType=this.pixelType);return{extent:a.extent,pixelBlock:c}},readGL:function(a){this._performance.start();this._initializeProgram({fragment:m.ndvi,fragmentName:"NDVI"});var c=this.functionArguments.visibleBandID,f=this.functionArguments.infraredBandID,e=this.functionArguments.scaled||!1;this._alterBand=2<Math.max(f,c)?!0:!1;a=this._setupTextureData(a.raster,{bandIDs:this._alterBand?{bandIDs:[f,c,f]}:null});var g=this.bindFrameBuffer();this._alterBand?this._setUniforms({u_bandId_nir:0,
u_bandId_red:1,u_scaled:e}):this._setUniforms({u_bandId_nir:f,u_bandId_red:c,u_scaled:e});this._bindTexture(a.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:a.extent,texture:g.texture}}})})},"esri/layers/rasterLib/function/SlopeFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../../WKIDUnitConversion ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./surfaceUtils".split(" "),function(H,k,n,q,m,l,
b,a){return H([n,b],{declaredClass:"esri.layers.rasterLib.function.SlopeFunction",functionName:"Slope",supportWebGL:!0,support2D:!0,constructor:function(c){this.functionArguments=this.mixinIgnoreCase({zFactor:1,slopeType:1,psPower:.664,psFactor:.024,raster:null},c)},bind:function(c){c=this.getSourceRasterInfo(c);if(!c.raster)return Error("The raster input to slope function is invalid.");this.rasterInfo=k.mixin(c.raster,{bandCount:1,pixelType:this._calculatePixelType(this.outputPixelType,"F32"),statistics:1===
this.slopeType||3===this.slopeType?[{min:0,max:90}]:null,histograms:null});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType="Generic";return!0},read2D:function(c){this._performance.start();c=c.raster;c=a.slope(c,{zFactor:this.functionArguments.zFactor,psPower:this.functionArguments.psPower,psFactor:this.functionArguments.psFactor,slopeType:this.functionArguments.slopeType,isGCS:c.extent.spatialReference.wkid&&null==q[c.extent.spatialReference.wkid]});
this._addPerformanceMetric(this._performance.elapsed());return c},readGL:function(c){this._performance.start();this._initializeProgram({fragment:l.slope,fragmentName:"Slope"});var f=this._setupTextureData(c.raster),e=this.bindFrameBuffer(),g=this.gl,d=g.drawingBufferWidth;g=g.drawingBufferHeight;var h=f.extent;this._setUniforms({u_resolution:c&&c.raster&&c.raster.pixelBlock?[1/c.raster.pixelBlock.width,1/c.raster.pixelBlock.height]:[1/d,1/g],u_cellSize:[(h.xmax-h.xmin)/d,(h.ymax-h.ymin)/g],u_zfactor:this.functionArguments.zFactor});
this._bindTexture(f.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:f.extent,texture:e.texture}}})})},"esri/layers/rasterLib/function/StretchFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./vertexShaders ./pixelShaders ./RasterFunctionWebGLMixin".split(" "),function(H,k,n,q,m,l,b){return H([n,b],{declaredClass:"esri.layers.rasterLib.function.StretchFunction",functionName:"Stretch",supportWebGL:!0,
support2D:!0,constructor:function(a){this.functionArguments=this.mixinIgnoreCase({stretchType:0,min:0,max:255,numberOfStandardDeviations:2,statistics:null,histograms:null,dra:!1,minPercent:.25,maxPercent:.5,useGamma:!1,gamma:null,raster:null,computeGamma:!1},a);this.functionArguments.statistics=this._convertStats(this.functionArguments.statistics);-1===[0,3,5,6].indexOf(this.functionArguments.stretchType)&&(console.error("The specific stretch type has not been implemented: "+this.functionArguments.stretchType),
this.functionArguments.stretchType=5);this.min=null==this.min?0:this.min;this.max=null==this.max?255:this.max},bind:function(a){a=this.getSourceRasterInfo(a);if(!a.raster)return Error("The raster input to stretch function is invalid.");a.raster.statistics&&(this.srcStatistics=this._convertStats(a.raster.statistics));a.raster.histograms&&(this.srcHistograms=a.raster.histograms);this.rasterInfo=k.mixin({},a.raster,{bandCount:a.raster.bandCount,pixelType:this._calculatePixelType(this.pixelType,"U8"),
statistics:null,histograms:null});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType="Generic";return!0},read2D:function(a){a=a.raster;this._stretch(a);return a},hasTilingEffects:function(a){a=a||this.functionArguments;return!!(a.dra||a.raster&&"object"===typeof a.raster&&a.raster.dra)},_convertStats:function(a){return a?a.map(function(c){return c&&null!=c.min?[c.min,c.max,c.mean,c.stddev]:c}):null},_updateStatistisHistograms:function(a){var c=this.functionArguments,
f=c.histograms||this.srcHistograms;if(a&&a.pixelBlock&&a.pixelBlock.pixels){if(0===c.stretchType)this._statistics=c.statistics&&0<c.statistics.length?c.statistics:this.srcStatistics,this._histograms=f;else{var e=a.pixelBlock,g=e.pixels.length,d=6===c.stretchType&&(c.dra||!f)||3===c.stretchType&&c.dra;d&&(e.statistics||e.calculateStatistics(),this._calculateStatisticsHistograms(a));if(c.dra)if(e.statistics||e.calculateStatistics(),d)this._statistics=e.statistics,this._histograms=e.histograms;else for(c=
e.statistics,this._statistics=[],a=0;a<g;a++)this._statistics[a]=[c[a].minValue,c[a].maxValue,0,0];else this._statistics=c.statistics&&0<c.statistics.length?c.statistics:this.srcStatistics,this._histograms=f}this._statistics=this._convertStats(this._statistics);this._gammaCorrection=this._getGammaCorrection()}else this._statistics=c.statistics&&0<c.statistics.length?c.statistics:this.srcStatistics,this._histograms=f,this._gammaCorrection=this._getGammaCorrection(),this._statistics=this._convertStats(this._statistics)},
_getGammaCorrection:function(){var a=this.functionArguments.gamma;if(a){var c=[],f;for(f=0;f<a.length;f++)c[f]=1<a[f]?2<a[f]?6.5+Math.pow(a[f]-2,2.5):6.5+100*Math.pow(2-a[f],4):1;return c}},_stretch:function(a){if(null!==a&&null!==a.pixelBlock&&null!==a.pixelBlock.pixels&&0!==this.functionArguments.stretchType){this._updateStatistisHistograms(a);var c=a.pixelBlock,f=c.pixels;c=c.width*c.height;var e=f.length,g,d;this._createLUT(a);if(null==this.LUT)return this._filterNoLUT(a);var h=this.LUT,p=this.LUTOffset;
for(g=0;g<e;g++){var t=h[g];for(d=0;d<c;d++){var w=f[g][d];f[g][d]=t[w-p]}}a.pixelBlock.pixelType="U8"}},_calculateStatisticsHistograms:function(a){a=a.pixelBlock;var c=a.pixelType,f=a.pixels,e=a.mask,g=f.length,d,h,p=function(v){this.min=-.5;this.max=255.5;this.size=256;k.mixin(this,v);this.counts=this.counts||new Uint32Array(this.size)},t=[],w,u;for(d=0;d<g;d++){var r=new p;var y=r.counts;var B=f[d];if("U8"===c)if(e)for(h=0;h<a.width*a.height;h++)e[h]&&y[B[h]]++;else for(h=0;h<a.width*a.height;h++)y[B[h]]++;
else{var C=a.statistics[d].minValue;var G=a.statistics[d].maxValue;r.min=C;r.max=G;G=(G-C)/256;var x=new Uint32Array(257);if(e)for(h=0;h<a.width*a.height;h++)e[h]&&x[Math.floor((B[h]-C)/G)]++;else for(h=0;h<a.width*a.height;h++)x[Math.floor((B[h]-C)/G)]++;for(h=0;255>h;h++)y[h]=x[h];y[255]=x[255]+x[256]}t.push(r);B=[];C=a.statistics[d].minValue;G=a.statistics[d].maxValue;for(h=u=w=x=0;h<r.size;h++)x+=y[h],w+=h*y[h];w/=x;for(h=0;h<r.size;h++)u+=y[h]*Math.pow(h-w,2);y=Math.sqrt(u/(x-1));h=(w+.5)*(r.max-
r.min)/r.size+r.min;r=y*(r.max-r.min)/r.size;B.push(C);B.push(G);B.push(h);B.push(r);a.statistics[d]={min:C,minValue:C,max:G,maxValue:G,mean:h,stddev:r}}a.histograms=t},_getCutOffPoints:function(a){var c=this.functionArguments,f=999;a&&a.pixelBlock?f=a.pixelBlock.pixels.length:a&&a.texture&&(f=3);a=Math.min(f,this._statistics.length);var e=[],g=[],d,h;switch(c.stretchType){case 5:for(d=0;d<a;d++)e[d]=this._statistics[d][0],g[d]=this._statistics[d][1];break;case 3:for(d=0;d<a;d++)e[d]=this._statistics[d][2]-
c.numberOfStandardDeviations*this._statistics[d][3],g[d]=this._statistics[d][2]+c.numberOfStandardDeviations*this._statistics[d][3],e[d]<this._statistics[d][0]&&(e[d]=this._statistics[d][0]),g[d]>this._statistics[d][1]&&(g[d]=this._statistics[d][1]);break;case 6:for(d=0;d<a;d++){f=this._histograms[d];var p=new Uint32Array(f.size);var t=f.counts;var w=0;var u=-.5===f.min&&1===(f.max-f.min)/t?.5:0;for(h=0;h<f.size;h++)w+=t[h],p[h]=w;t=c.minPercent*w/100;for(h=0;h<f.size;h++)if(p[h]>t){e[d]=f.min+(f.max-
f.min)/f.size*(h+u);break}t=(1-c.maxPercent/100)*w;for(h=f.size-2;0<=h;h--)if(p[h]<t){g[d]=f.min+(f.max-f.min)/f.size*(h+2-u);break}}break;default:for(d=0;d<f;d++)e[d]=0,g[d]=255}return{minCutOff:e,maxCutOff:g}},_createLUT:function(a){var c=this.functionArguments,f=a.pixelBlock,e=f.pixelType;if("U8"===e||"U16"===e||"S8"===e||"S16"===e){if(this._LUTSignature&&(e=this._computeLutSignature(),e.length===this._LUTSignature.length&&!e.some(function(z,A){return z!==this._LUTSignature[A]}.bind(this))))return;
e=f.pixels.length;var g=[],d=[],h=c.max,p=c.min,t=c.gamma,w=h-p,u=this._getCutOffPoints(a);a=u.minCutOff;u=u.maxCutOff;var r=0,y=256;"S8"===f.pixelType?r=-127:"S16"===f.pixelType&&(r=-32767);if("U16"===f.pixelType||"S16"===f.pixelType)y=65536;for(f=0;f<e;f++)g[f]=u[f]-a[f];var B=this._gammaCorrection;if(c.useGamma)for(f=0;f<e;f++){var C=[];for(c=0;c<y;c++){var G=c+r;var x=(G-a[f])/g[f];var v=1;1<t[f]&&(v-=Math.pow(1/w,x*B[f]));G<u[f]&&G>a[f]?C[c]=Math.floor(v*w*Math.pow(x,1/t[f]))+p:G>u[f]?C[c]=h:
G<a[f]&&(C[c]=p)}d[f]=C}else for(f=0;f<e;f++){C=[];for(c=0;c<y;c++)G=c+r,C[c]=G<a[f]?p:G>u[f]?h:Math.floor((G-a[f])/g[f]*w)+p;d[f]=C}this.LUT=d;this.LUTOffset=r;this._LUTSignature=this._computeLutSignature()}},_computeLutSignature:function(){var a=this.functionArguments,c=[],f,e;c.push(a.stretchType);c.push(a.min);c.push(a.max);c.push(a.numberOfStandardDeviations);if(this._statistics)for(f=0;f<this._statistics.length;f++)for(e=0;e<this._statistics[f].length;e++)c.push(this._statistics[f][e]);c.push(a.dra?
1:0);c.push(a.minPercent);c.push(a.maxPercent);if(a.gamma)for(f=0;f<this._statistics.length;f++)c.push(a.gamma[f]);c.push(a.useGamma?1:0);return c},_filterNoLUT:function(a){if(null!==a&&null!==a.pixelBlock&&null!==a.pixelBlock.pixels){var c=this.functionArguments,f=a.pixelBlock,e=f.pixels,g=f.mask;f=f.width*f.height;var d=e.length,h=[],p=[],t=c.max,w=c.min,u=c.gamma,r=t-w;var y=this._getCutOffPoints(a);var B=y.minCutOff,C=y.maxCutOff;for(y=0;y<d;y++)h[y]=C[y]-B[y];if(c.useGamma&&null!==u&&u.length>=
d)for(y=0;y<d;y++)p[y]=1<u[y]?2<u[y]?6.5+Math.pow(u[y]-2,2.5):6.5+100*Math.pow(2-u[y],4):1;if(c.useGamma)if(void 0!==g&&null!==g)for(c=0;c<f;c++){if(g[c])for(y=0;y<d;y++){var G=e[y][c];var x=(G-B[y])/h[y];var v=1;1<u[y]&&(v-=Math.pow(1/r,x*p[y]));G<C[y]&&G>B[y]?e[y][c]=Math.floor(v*r*Math.pow(x,1/u[y]))+w:G>C[y]?e[y][c]=t:G<B[y]&&(e[y][c]=w)}}else for(c=0;c<f;c++)for(y=0;y<d;y++)G=e[y][c],x=(G-B[y])/h[y],v=1,1<u[y]&&(v-=Math.pow(1/r,x*p[y])),G<C[y]&&G>B[y]?e[y][c]=Math.floor(v*r*Math.pow(x,1/u[y]))+
w:G>C[y]?e[y][c]=t:G<B[y]&&(e[y][c]=w);else if(void 0!==g&&null!==g)for(c=0;c<f;c++){if(g[c])for(y=0;y<d;y++)G=e[y][c],G<C[y]&&G>B[y]?e[y][c]=Math.floor((G-B[y])/h[y]*r)+w:G>C[y]?e[y][c]=t:G<B[y]&&(e[y][c]=w)}else for(c=0;c<f;c++)for(y=0;y<d;y++)G=e[y][c],G<C[y]&&G>B[y]?e[y][c]=Math.floor((G-B[y])/h[y]*r)+w:G>C[y]?e[y][c]=t:G<B[y]&&(e[y][c]=w);a.pixelBlock.pixelType="U8";return a}},_computeGammaValues:function(a){var c=this._statistics.length,f,e=[];for(f=0;f<c;f++){var g=this._statistics[f][2];"U8"!==
a&&(g=255*(g-this._statistics[f][0])/(this._statistics[f][1]-this._statistics[f][0]));e.push(this._computeGammaValue(g))}return e},_computeGammaValue:function(a){if(0!==a&&!(255<a||0>a)){var c=0;0<a&&150!=a&&255>a&&(c=150>=a?45*Math.cos(.01047*a):17*Math.sin(.021*a));c=Math.log((a+c)/255);if(0!==c&&(a=Math.log(a/255)/c,!isNaN(a)))return Math.min(9.9,Math.max(.01,a))}},readGL:function(a){return this._stretchGL(a.raster)},_stretchGL:function(a){this._performance.start();var c=this.renderTexture,f,e=
a.pixelBlock&&a.pixelBlock.pixels&&a.pixelBlock.pixels.length||this.sourceRasterInfo.raster.bandCount,g=a.pixelBlock,d=this.gl,h=d.drawingBufferWidth,p=d.drawingBufferHeight;if(!g&&this.functionArguments.dra){var t=new Float32Array(h*p*4),w=new Uint8Array(h*p);var u=new Float32Array(h*p);var r=new Float32Array(h*p);var y=new Float32Array(h*p);d.checkFramebufferStatus(d.FRAMEBUFFER)==d.FRAMEBUFFER_COMPLETE&&d.readPixels(0,0,h,p,d.RGBA,d.FLOAT,t);for(f=0;f<h*p;f++)u[f]=t[4*f],r[f]=t[4*f+1],y[f]=t[4*
f+2],w[f]=t[4*f+3];a.pixelBlock=new q({width:h,height:p,pixels:[u,r,y],mask:w});a.pixelBlock.calculateStatistics()}!g&&this.functionArguments.dra&&this._useGPUStats?(u=new Float32Array(e),r=new Float32Array(e)):(this._updateStatistisHistograms(a),t=this._getCutOffPoints(a),u=new Float32Array(e),r=new Float32Array(e),u.set(t.minCutOff.slice(0,e)),r.set(t.maxCutOff.slice(0,e)));this._initializeProgram({fragment:l.stretch,fragmentName:"Stretch"});t=this._setupTextureData(a);w=this.bindFrameBuffer();
this.renderTexture=!1;this._performance.start();if(!g&&this.functionArguments.dra&&this._useGPUStats){this._setUniforms({u_sourceDim:[h,p],u_bandCount:e});if(1===e)var B=this._readMinMax(t,2);else{B=this._readMinMax(t,0);var C=this._readMinMax(t,1)}if(6===this.functionArguments.stretchType||3===this.functionArguments.stretchType&&this.functionArguments.dra)f=this._readHistogram(B,C,a),u=f.minCutOff||u,r=f.minCutOff||r}y=this.functionArguments.max-this.functionArguments.min;a=new Float32Array(e);for(f=
0;f<e;f++)a[f]=y/(r[f]-u[f]);this._useGPUStats&&this._initializeProgram({fragment:l.stretch,fragmentName:"Stretch"});d.blendFunc(d.SRC_ALPHA,d.ZERO);y=new Float32Array(3);var G=new Float32Array(3);for(f=0;3>f;f++)y[f]=this.functionArguments.min,G[f]=this.functionArguments.max;f=this.functionArguments.useGamma;var x=this.functionArguments.gamma,v=this._gammaCorrection;Array.isArray(x)&&x.length>=e||(f=!1);this._setUniforms({u_sourceDim:[h,p],u_bandCount:e,u_minOutput:y,u_maxOutput:G,u_minCutOff:u,
u_maxCutOff:r,u_factor:a,u_state:100,u_useGamma:f,u_gamma:x,u_scaled:!c,u_gammaCorrection:v,u_minMaxTexture:!g&&this.functionArguments.dra&&this._useGPUStats?!0:!1});this.renderTexture=c;d.viewport(0,0,h,p);this._bindTexture(t.texture,"u_image");!g&&this.functionArguments.dra&&this._useGPUStats&&(c=d.getUniformLocation(this.rasterProgram,"u_image1"),d.uniform1i(c,1),d.activeTexture(d.TEXTURE1),d.bindTexture(d.TEXTURE_2D,B.texture),1<e&&(e=d.getUniformLocation(this.rasterProgram,"u_image2"),d.uniform1i(e,
2),d.activeTexture(d.TEXTURE2),d.bindTexture(d.TEXTURE_2D,C.texture)));this._drawGL();return{extent:t.extent,texture:w.texture}},_readMinMax:function(a,c){var f=this.gl,e=a.width||f.drawingBufferWidth,g=a.height||f.drawingBufferHeight;this._setUniforms({u_state:c});this.renderTexture=!1;var d=a.texture;for(f.activeTexture(f.TEXTURE0);1<e||1<g;){var h=this._createTexture();c=Math.max(Math.ceil(e/2),1);var p=Math.max(Math.ceil(g/2),1);f.getExtension("OES_texture_float");f.texImage2D(f.TEXTURE_2D,0,
f.RGBA,c,p,0,f.RGBA,f.FLOAT,null);a=f.createFramebuffer();f.bindFramebuffer(f.FRAMEBUFFER,a);f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,h,0);f.viewport(0,0,c,p);f.bindTexture(f.TEXTURE_2D,d);this._setUniforms({u_sourceDim:[e,g]});e=c;g=p;this._drawGL(!0);d=h}a=new Float32Array(e*g*4);f.checkFramebufferStatus(f.FRAMEBUFFER)==f.FRAMEBUFFER_COMPLETE&&f.readPixels(0,0,e,g,f.RGBA,f.FLOAT,a);return{texture:h,minmax:a}},_readHistogram:function(a,c,f){if(a)try{var e=this.gl,g=e.drawingBufferWidth,
d=e.drawingBufferHeight,h,p,t;if(a.texture instanceof WebGLTexture){var w=!0;var u=[1,0,0,1];if(c){var r=a.minmax;var y=c.minmax}else r=[a.minmax[0]],y=[a.minmax[1]]}else for(y=c,r=a,u=new Float32Array(y.length),h=0;h<y.length;h++)u[h]=256/(y[h]-r[h]);var B=new Float32Array(g*d);for(t=0;t<B.length;t++)B[t]=t;if(!this.histogramProgram){var C=m.getShader(e,m.histogram),G=l.getShader(e,l.constant);this.histogramProgram=this._loadProgram(C,G)}e.blendFunc(e.ONE,e.ONE);e.enable(e.BLEND);e.useProgram(this.histogramProgram);
var x=e.getAttribLocation(this.histogramProgram,"a_pixelIndex"),v=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,v);e.bufferData(e.ARRAY_BUFFER,B,e.STATIC_DRAW);e.enableVertexAttribArray(x);e.vertexAttribPointer(x,1,e.FLOAT,!1,0,0);var z=this._setupHistTexture(f),A=this._createTexture();e.getExtension("OES_texture_float");e.texImage2D(e.TEXTURE_2D,0,e.RGBA,257,1,0,e.RGBA,e.FLOAT,null);var F=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,F);e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,
e.TEXTURE_2D,A,0);e.viewport(0,0,257,1);var J=e.getUniformLocation(this.histogramProgram,"u_image");e.uniform1i(J,0);e.activeTexture(e.TEXTURE0);e.bindTexture(e.TEXTURE_2D,z);var L=e.getUniformLocation(this.histogramProgram,"u_sourceDim");e.uniform2f(L,g,d);var P=e.getUniformLocation(this.histogramProgram,"u_bandCount");e.uniform1i(P,3);var Q=e.getUniformLocation(this.histogramProgram,"u_halfPixel");e.uniform2f(Q,.5/g,.5/d);var Z=e.getUniformLocation(this.histogramProgram,"u_minMaxTexture");if(w){e.uniform1i(Z,
1);var ca=e.getUniformLocation(this.histogramProgram,"u_image1");e.uniform1i(ca,1);e.activeTexture(e.TEXTURE1);e.bindTexture(e.TEXTURE_2D,a.texture);if(c){var da=e.getUniformLocation(this.histogramProgram,"u_image2");e.uniform1i(da,2);e.activeTexture(e.TEXTURE2);e.bindTexture(e.TEXTURE_2D,c.texture)}}else{var ea=e.getUniformLocation(this.histogramProgram,"u_mins");e.uniform4f(ea,r[0],r[0],r[0],r[0]);e.uniform1i(Z,0)}var fa=e.getUniformLocation(this.histogramProgram,"u_color"),K=e.getUniformLocation(this.histogramProgram,
"u_factors"),V=e.getUniformLocation(this.histogramProgram,"u_size");e.uniform1f(V,256);a=[];c=[];e.uniform4fv(fa,[1,0,0,1]);e.uniform4fv(K,[u[0],0,0,1]);e.drawArrays(e.POINTS,0,B.length);var aa=this.sourceRasterInfo.raster.bandCount;1<aa&&(e.uniform4fv(fa,[0,1,0,1]),e.uniform4fv(K,[0,u[0],0,1]),e.drawArrays(e.POINTS,0,B.length),e.uniform4fv(fa,[0,0,1,1]),e.uniform4fv(K,[0,0,u[0],1]),e.drawArrays(e.POINTS,0,B.length));if(e.checkFramebufferStatus(e.FRAMEBUFFER)==e.FRAMEBUFFER_COMPLETE){var Y=new Float32Array(1028);
e.readPixels(0,0,257,1,e.RGBA,e.FLOAT,Y);e=0;var I=-.5===r[0]&&1===(y[0]-r[0])/256?.5:0;for(h=0;h<aa;h++){var O=new Float32Array(257);var E=new Float32Array(257);for(t=e=0;256>t;t++)e+=Y[4*t+h],O[t]=e,E[t]=Y[4*t+h];E[256]=Y[1024+h];O[256]=e+Y[1024+h];var N=this.functionArguments.minPercent*e/100;if(y){for(p=0;256>p;p++)if(O[p]>N){a[h]=r[0]+(y[0]-r[0])/256*(p+I);break}N=(1-this.functionArguments.maxPercent/100)*e;for(p=254;0<=p;p--)if(O[p]<N){c[h]=r[0]+(y[0]-r[0])/256*(p+2-I);break}}}}return{histogram:Y,
minCutOff:a,maxCutOff:c}}catch(R){console.debug("webgl filter exception: "+R.message)}},_setupHistTexture:function(a){if(a instanceof WebGLTexture)return a;var c=this.originalHistTexture=this._createTexture(),f=this.gl;a=a.pixelBlock;var e=a.width,g=a.height;f.getExtension("OES_texture_float");this.rgbaFloatData=a.getAsRGBAFloat();f.texImage2D(f.TEXTURE_2D,0,f.RGBA,e,g,0,f.RGBA,f.FLOAT,this.rgbaFloatData);return c}})})},"esri/layers/rasterLib/function/RemapFunction":function(){define("dojo/_base/declare dojo/_base/lang ../../../renderers/colorRampGenerator ./RasterFunctionX ./pixelShaders ./RasterFunctionWebGLMixin ./rasterUtils".split(" "),
function(H,k,n,q,m,l,b){return H([q,l],{declaredClass:"esri.layers.rasterLib.function.RemapFunction",functionName:"Remap",pixelType:"U8",renderTexture:!1,supportWebGL:!0,support2D:!0,constructor:function(a){this.functionArguments=this.mixinIgnoreCase({inputRanges:null,outputValues:null,outputColors:null,colorBreaks:null,raster:null},a)},bind:function(a){a=this.getSourceRasterInfo(a);if(!a.raster)return Error("The raster input is not available.");var c=!(!this.functionArguments.outputColors&&!this.functionArguments.colorBreaks);
this.rasterInfo=k.mixin(a.raster,{bandCount:c?3:1,pixelType:this._calculatePixelType(this.pixelType,"U8"),statistics:null,histograms:null});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType=c?"Processed":"Thematic";return!0},read2D:function(a){return this._remap(a.raster)},readGL:function(a){return this._remapGL(a.raster)},_remap:function(a){this._performance.start();var c=b.remapColor(a.pixelBlock,this.functionArguments.colorBreaks);this._addPerformanceMetric(this._performance.elapsed());
return{extent:a.extent,pixelBlock:c}},_remapGL:function(a){this._performance.start();this._initializeProgram({fragment:m.remap,fragmentName:"Remap"});var c=new Uint8Array(64),f=this.functionArguments.colorBreaks;f.forEach(function(h,p){c[4*p]=h.mappedColor[0];c[4*p+1]=h.mappedColor[1];c[4*p+2]=h.mappedColor[2];c[4*p+3]=1>=h.mappedColor[3]?255*h.mappedColor[3]:h.mappedColor[3]});var e=f[f.length-1],g=e.mappedColor;c[60]=g[0];c[61]=g[1];c[62]=g[2];c[63]=1>=g[3]?255*g[3]:g[3];var d=new Float32Array(16);
f.forEach(function(h,p){d[p]=h.value});d[15]=e.value;this._clrTexture||(this._clrTexture=this._setupColormapTexture(c));f=this._clrTexture;e=this.bindFrameBuffer();a=this._setupTextureData(a);this._setUniforms({u_indexedColormapOffset:0,u_indexedColormapMaxIndex:c.length/4-1,u_breaks:d});this._bindTexture(f,"u_image1");this._bindTexture(a.texture,"u_image");this._drawGL();return{extent:a.extent,texture:e.texture}},_setupColormapTexture:function(a){var c=this._createTexture(),f=a.length/4,e=new Float32Array(a.length),
g=this.renderTexture?255:1,d,h=this.gl;for(d=0;d<a.length;d++)e[d]=a[d]/g;h.getExtension("OES_texture_float");h.texImage2D(h.TEXTURE_2D,0,h.RGBA,f,1,0,h.RGBA,h.FLOAT,e);return c}})})},"esri/layers/rasterLib/function/IdentityFunction":function(){define(["dojo/_base/declare","dojo/_base/lang","./pixelShaders","./RasterFunctionX","./RasterFunctionWebGLMixin"],function(H,k,n,q,m){return H([q,m],{declaredClass:"esri.layers.rasterLib.function.IdentityFunction",functionName:"Identity",supportWebGL:!0,support2D:!0,
constructor:function(l){this.functionArguments={raster:null}},bind:function(l){l=this.getSourceRasterInfo(l);if(!l.raster)return Error("The raster input to identity function is invalid.");this.rasterInfo=k.mixin(l.raster,{});return!0},read2D:function(l){return l.raster},readGL:function(l){this._initializeProgram({fragment:n.identity,fragmentName:"identity"});l=this._setupTextureData(l.raster);var b=this.bindFrameBuffer();this._bindTexture(l.texture,"u_image");this._drawGL();return{extent:l.extent,
texture:b.texture}}})})},"esri/layers/rasterLib/function/ResampleFunction":function(){define(["dojo/_base/declare","dojo/_base/lang","./pixelShaders","./RasterFunctionX","./RasterFunctionWebGLMixin"],function(H,k,n,q,m){return H([q,m],{declaredClass:"esri.layers.rasterLib.function.ResampleFunction",renderTexture:!0,resamplingOrigin:null,resamplingRatio:null,zFactor:1,functionName:"Resample",supportWebGL:!0,support2D:!1,constructor:function(l){this.functionArguments=this.mixinIgnoreCase({resamplingType:0},
l)},bind:function(l){l=this.getSourceRasterInfo(l);if(!l.raster)return Error("The raster input to convolution function is invalid.");this.rasterInfo=k.mixin(l.raster,{bandCount:l.raster.bandCount,pixelType:this._calculatePixelType(this.pixelType,l.raster.pixelType),statistics:l.raster.statistics,histograms:l.raster.histograms});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};return!0},readGL:function(l){this._performance.start();this._initializeProgram({fragment:n.resample,fragmentName:"Resample"});
var b=this._setupTextureData(l.raster),a=this.bindFrameBuffer(),c=this.gl,f=c.drawingBufferWidth;c=c.drawingBufferHeight;var e=l.raster;void 0!==e.pixelBlock?(b=b||this._setupTextureData(e),l=e.pixelBlock.width,e=e.pixelBlock.height):(b=b||e,l=f,e=c);this._setUniforms({u_resamplingRatio:this.resamplingRatio||[l/f,e/c],u_anchor:this.resamplingOrigin||[0,1],u_resamplingType:this.functionArguments.resamplingType,u_resolution:[1/f,1/c]});this._drawGL();this._addPerformanceMetric(this._performance.elapsed());
return{extent:b.extent,texture:a.texture}}})})},"esri/layers/rasterLib/renderer/rasterRendererHelper":function(){define("dojo/_base/declare dojo/_base/lang ../../PixelBlock ./RasterColormapRenderer ./RasterUniqueValueRenderer ./RasterRGBRenderer ./RasterStretchColorRampRenderer ./RasterClassBreaksRenderer ./RasterShadedReliefRenderer".split(" "),function(H,k,n,q,m,l,b,a,c){var f=function(){function e(d){g[d.prototype.rendererName]=d}var g={};e(q);e(l);e(b);e(m);e(a);e(c);return g}();return{wellKnownRenderers:f,
isSupported:function(e){if(!e)return!1;var g=!0;f[e.rendererName]||(g=!1);return g},create:function(e){if(!e)return null;if(e.rendererName){var g=e.rendererName;e=e.rendererArguments}else g="uniqueValue rasterStretch rasterShadedRelief rgb rasterColormap classBreaks".split(" ").indexOf(e.type),g="UniqueValue Stretch ShadedRelief RGB Colormap ClassBreaks".split(" ")[g],"rasterStretch"===e.type&&e.bandIndex&&1<e.bandIndex.length&&(g="RGB");return(g=f[g])?new g(e):null},createDefaultRenderer:function(e){if(e&&
e.raster){var g=e.raster.rasterInfo,d=e.raster.dataType;if(g){var h=e.raster.rasterFunction,p=["Stretch","Colormap","ContrastAndBrightness"];if(h&&"U8"===g.pixelType&&-1<p.indexOf(h.functionName))h.renderTexture=!0;else if("Processed"!==d||!(e.useWebGL&&h&&h.renderTexture||!e.useWebGL&&"U8"===g.pixelType)){h&&(g=h.rasterInfo);h=g.bandCount;var t=g.colormap,w=g.vat;p=g.histograms;p&&0===p.length&&(p=null);var u=g.statistics&&g.statistics.map(function(B){return[B.min,B.max,B.mean,B.stddev]});if(1===
h&&t&&0<t.length)var r=this._getDefaultColormapRenderer(w,t);else if(1===h&&w&&w.features&&0<w.features.length)r=new m({});else{t=0;w=!1;d||!e.raster||!e.raster.tileInfo||void 0!==e.raster.tileInfo.tileType&&"Map"!==e.raster.tileInfo.tileType?"U8"===g.pixelType&&"Processed"===d?(t=5,u=u||[[0,255,0,0],[0,255,0,0],[0,255,0,0]],w=!1):"U8"===g.pixelType||"Elevation"===d?(t=5,w=u?!1:!0):"Scientific"===d||"StdTime"===d?(t=5,w=u?!1:!0,r=this._getDefaultScientificColorRamp()):p&&0<p.length?(t=6,w=!1):u?(t=
5,w=!1):(t=6,w=!0):(u=[[0,255,0,0],[0,255,0,0],[0,255,0,0]],t=5,w=!1);u||(t=5,w=!0);var y;3<=h&&!(e.bandIds||e.raster&&e.raster.imageServiceParams&&e.raster.imageServiceParams.bandIds)&&(y=this.getDefaultBandCombination(g));y&&(u=y.map(function(B){return u[B]}));e={stretchType:t,min:0,max:255,dra:w,minPercent:.25,maxPercent:.25,useGamma:!1,computeGamma:!1,statistics:u,histograms:p,numberOfStandardDeviations:2.5,bandIndex:y};1===h||y&&1===y.length?(r&&(e.colorRamp=r,e.invert=!1),r=new b(e)):r=new l(e)}return r}}}},
getDefaultBandCombination:function(e){var g=e.bandCount;if(1===g)return null;if(2===g)return[0];var d=(e=e.keyProperties)&&e.ChangeAnalysisParameters&&e.ChangeAnalysisParameters.AnalysisType;if(d&&("ccdc"===d.toLowerCase()||"landtrendr"===d.toLowerCase()))return[0];e=e&&e.BandProperties;var h;if(e&&e.length===g){var p=this.getWellKnownBandIndexes(e);e=p.red;d=p.green;var t=p.blue;p=p.nir;null!=e&&null!=d&&null!=t?h=[e,d,t]:null!=p&&null!=e&&null!=d&&(h=[p,e,d])}!h&&3<=g&&(h=[0,1,2]);return h},getWellKnownBandIndexes:function(e){for(var g=
{},d=0;d<e.length;d++){var h=e[d],p=h.BandName&&h.BandName.toLowerCase();"red"===p?g.red=d:"green"===p?g.green=d:"blue"===p?g.blue=d:"nearinfrared"===p||"nearinfrared_1"===p||"nir"===p?g.nir=d:h.WavelengthMax&&h.WavelengthMin&&(p=h.WavelengthMin,h=h.WavelengthMax,null==g.blue&&410<=p&&480>=p&&480<=h&&540>=h?g.blue=d:null==g.green&&490<=p&&560>=p&&560<=h&&610>=h?g.green=d:null==g.red&&595<=p&&670>=p&&660<=h&&730>=h?g.red=d:null==g.nir&&700<=p&&860>=p&&800<=h&&950>=h&&(g.nir=d))}return g},_getDefaultColormapRenderer:function(e,
g){if(g||g.length){var d=[],h=this._ratContainsColormap(e);if(h)var p=this._getRATValueClassNameMap(e);g.forEach(function(t){var w=p?p[t[0]]:t[0];d.push({color:[t[1],t[2],t[3]],value:t[0],label:h?null!=w?w:"":t[0]})});return new q({colormapInfos:d})}},_ratContainsColormap:function(e){if(!e||!e.fields)return!1;var g,d,h;return e.fields.some(function(p){p&&p.name&&(p=p.name.toLowerCase(),"red"===p&&(g=!0),"green"===p&&(d=!0),"blue"===p&&(h=!0));return g&&d&&h})},_getRATValueClassNameMap:function(e){if(!e||
!e.fields)return null;var g={},d,h;e.fields.forEach(function(p){if("classname"===p.name.toLowerCase()||"class_name"===p.name.toLowerCase())d=p.name;"value"===p.name.toLowerCase()&&(h=p.name)});e.features.forEach(function(p){p=p.attributes;g[p[h]]=d?p[d]:p[h]});return g},_getDefaultScientificColorRamp:function(){return{type:"multipart",colorRamps:[{fromColor:[255,0,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,0,255]}].map(function(e){return{fromColor:e.toColor,
toColor:e.fromColor}}).reverse()}}}})},"esri/layers/rasterLib/renderer/RasterColormapRenderer":function(){define(["dojo/_base/declare","dojo/_base/lang","./RasterRenderer","../function/ColormapFunction"],function(H,k,n,q){return H([n],{declaredClass:"esri.layers.rasterLib.renderer.RasterColormapRenderer",rendererName:"Colormap",renderTexture:!0,constructor:function(m){m&&m.colormapInfos&&(m.colormap=m.colormapInfos.map(function(l){return[l.value].concat(l.color)}));this._function=new q(m);this._function.outputPixelType=
"U8";this._function.renderTexture=!0},draw2D:function(m){this._updateColormapParameters();m=this._clonePixelData(m);return m=this._function._colorize(m)},drawGL:function(m){this._updateColormapParameters();this._function._colorizeGL(m)},toJson:function(){var m=this._function.toJson().rasterFunctionArguments;return{rendererName:this.rendererName,rendererArguments:m}},toCommonRendererJson:function(){return{type:"rasterColormap",colormapInfos:this.colormapInfos||this.colormap.map(function(m){return{value:m[0],
color:m.slice(1),label:m[0]}})}},_updateColormapParameters:function(){var m=this._function.functionArguments;m.colormap=this.colormap;m.colormapName=this.colormapName;m.colorRamp=this.colorRamp;m.colorRampName=this.colorRampName}})})},"esri/layers/rasterLib/renderer/RasterRenderer":function(){define(["dojo/_base/declare","dojo/_base/lang","../../../geometry/Extent","../../PixelBlock"],function(H,k,n,q){return H(null,{declaredClass:"esri.layers.rasterLib.renderer.RasterRenderer",raster:null,constructor:function(m){m=
m||{};this.raster=m.raster||m.Raster||this.raster;this.draw=k.hitch(this,this.draw);this.bind=k.hitch(this,this.bind);m=k.clone(m);Object.keys(m).forEach(function(l){null==m[l]&&delete m[l]});k.mixin(this,m)},bind:function(m){if(!m)throw"failed to bind without options";var l=m;m.layer&&(m=m.layer,l={id:m.id,rawRasterInfo:m.raster.rasterInfo,glSetting:m._glSetting,xformSetting:m.tileManager&&m.tileManager.xformSetting,useWebGL:m.useWebGL,resampling:m.tileMode&&m.tileManager&&m.tileManager.xformSetting.requireProjection&&
!m._hasTilingEffects&&"Thematic"!==m.raster.dataType?1:0,tileMode:m.tileMode});this._rawRasterInfo=l.rawRasterInfo;this.useWebGL=l.useWebGL;this._function&&this._function.setProcessingContext(k.mixin({useProcessedData:!0},l));this._processingContext=l},hasTilingEffects:function(){},draw:function(m){return this.useWebGL?this.drawGL(m):this.draw2D(m)},toJson:function(){},_clonePixelData:function(m){if(null==m)return m;var l={};m.extent&&(l.extent=new n(m.extent.xmin,m.extent.ymin,m.extent.xmax,m.extent.ymax,
m.extent.spatialReference));m=m.processedPixelBlock||m.pixelBlock;if(null==m)return l;l.pixelBlock=m.clone?m.clone():q.prototype.clone(m);return l}})})},"esri/layers/rasterLib/renderer/RasterUniqueValueRenderer":function(){define(["dojo/_base/declare","dojo/_base/lang","./RasterRenderer","../function/ColormapFunction","../../../renderers/colorRampGenerator"],function(H,k,n,q,m){return H([n],{declaredClass:"esri.layers.rasterLib.renderer.RasterUniqueValueRenderer",rendererName:"UniqueValue",field:"",
alias:"",uniqueValueInfos:null,constructor:function(l){l&&l.colormap&&(this.colormap=l.colormap,this._function=new q(l),this._function.outputPixelType="U8",this._function.renderTexture=!0)},bind:function(l){this.inherited(arguments);if(!this._function){var b=(this.raster&&this.raster.rasterInfo||this._rawRasterInfo).vat;if(!b)throw"uv renderer requires data source to have raster attribute table";var a=this.attributeField||this.field1||this.field,c=this.infos||this.uniqueValueInfos;this.defaultColor=
this.defaultColor||this.defaultSymbol&&this.defaultSymbol.color;var f=b.fields.filter(function(r){return"value"===r.name.toLowerCase()})[0];if(f)var e=f.name;a||((a=b.fields.filter(function(r){return-1<["classname","category"].indexOf(r.name.toLowerCase())})[0])||(a=b.fields.filter(function(r){return"esriFieldTypeString"===r.type})[0]),this.alias=(this.field=a=a&&a.name||e)&&a.alias||e);var g=[],d;if(!c){c=[];var h=b.fields.filter(function(r){return"alpha"===r.name.toLowerCase()})[0];var p=b.fields.filter(function(r){return"red"===
r.name.toLowerCase()})[0];var t=b.fields.filter(function(r){return"green"===r.name.toLowerCase()})[0];var w=b.fields.filter(function(r){return"blue"===r.name.toLowerCase()})[0];for(f=0;f<b.features.length;f++){var u=b.features[f].attributes;(d=c.some(function(r){r.value===u[a]}))||(h&&p&&t&&w?c.push({value:u[a],alias:u[a],color:[u[p.name],u[t.name],u[w.name],u[h.name]]}):p&&t&&w?c.push({value:u[a],alias:u[a],color:[u[p.name],u[t.name],u[w.name]]}):c.push({value:u[a],alias:u[a]}))}if(!(p&&t&&w))for(d=
m.createRandomColorRamp({size:c.length}),f=0;f<c.length;f++)c[f].color=d[f];this.uniqueValueInfos=c}if(c)c.forEach(function(r){g=g.concat(b.features.filter(function(y){return r.value==y.attributes[a]}).map(function(y){return[y.attributes[e]].concat(r.color||r.symbol&&r.symbol.color)}))}),this.defaultColor&&b.features.filter(function(r){g.some(function(y){return y[0]===r.attributes[e]})||g.push([r.attributes[e]].concat(this.defaultColor))});else throw"missing uniqueValueInfos property";this._function=
new q({colormap:g});this.colormap=g;this._function.outputPixelType="U8";this._function.renderTexture=!0;this._function.setProcessingContext(this._processingContext)}},draw2D:function(l){l=this._clonePixelData(l);return l=this._function._colorize(l)},drawGL:function(l){this._function._colorizeGL(l)},toJson:function(l){var b={field:this.field,uniqueValueInfos:this.uniqueValueInfos,defaultColor:this.defaultColor};l&&(b.colormap=this.colormap);return{rendererName:this.rendererName,rendererArguments:b}},
toCommonRendererJson:function(){var l=this.attributeField||this.field1||this.field,b=(this.infos||this.uniqueValueInfos).map(function(a){return{value:a.value,label:a.alias+"",symbol:{color:3===a.color.length?a.color.concat([255]):a.color,type:"esriSFS",style:"esriSFSSolid"}}});return{type:"uniqueValue",field1:l,uniqueValueInfos:b}}})})},"esri/layers/rasterLib/renderer/RasterRGBRenderer":function(){define("dojo/_base/declare dojo/_base/lang ./RasterRenderer ../function/StretchFunction ../function/ContrastBrightnessFunction ../function/rasterUtils".split(" "),
function(H,k,n,q,m,l){return H([n],{declaredClass:"esri.layers.rasterLib.renderer.RasterRGBRenderer",rendererName:"RGB",bandIndex:null,stretchType:0,min:0,max:255,numberOfStandardDeviations:2,statistics:null,histograms:null,dra:!1,minPercent:.25,maxPercent:.5,useGamma:!1,gamma:null,computeGamma:!1,sigmoidStrengthLevel:1,constructor:function(b){this.stretchType="number"===typeof this.stretchType?this.stretchType:"none   standardDeviation histogramEqualization minMax percentClip   sigmoid".split(" ").indexOf(this.stretchType);
b=k.mixin({},b,{stretchType:this.stretchType});this._stretchFunction=new q(b);this._stretchFunction.outputPixelType="U8";this._stretchFunction.renderTexture=!1;this.bandIndex=b.bandIndex||b.BandIndex;this._function=new m(b);this._function.functionArguments.raster=this._stretchFunction;this._function.renderTexture=!0},hasTilingEffects:function(){return this._stretchFunction.hasTilingEffects()},draw2D:function(b){this._updateStretchParameters();b=this._clonePixelData(b);if("U8"===b.pixelBlock.pixelType&&
!this.contrastOffset&&!this.brightnessOffset)return b;this._stretchFunction._stretch(b);var a=b.pixelBlock,c=this.bandIndex,f=Math.max.apply(null,c);a&&a.pixels.length>f&&c&&(a.pixels=c.map(function(e){return a.pixels[e]}),a.statistics&&(a.statistics=c.map(function(e){return a.statistics[e]})));if(this.contrastOffset||this.brightnessOffset)b.pixelBlock=l.contrastBrightnessStretch(b.pixelBlock,{contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset});return b},drawGL:function(b){this._updateStretchParameters();
b.pixelBlock&&(b=this._clonePixelData(b));var a=b.pixelBlock,c=this.bandIndex,f=Math.max.apply(null,c),e=this.statistics&&0<this.statistics.length?this.statistics:this._stretchFunction&&this._stretchFunction.srcStatistics,g=this.histograms&&0<this.histograms.length?this.histograms:this._stretchFunction&&this._stretchFunction.srcHistograms,d,h;a&&a.pixels.length>f&&c&&(a.pixels=c.map(function(p){return a.pixels[p]}),a.statistics&&(a.statistics=c.map(function(p){return a.statistics[p]})),e&&0<e.length&&
e.length!==c.length&&(d=c.map(function(p){return e[p]})),g&&0<g.length&&g.length!==c.length&&(h=c.map(function(p){return g[p]})));this._stretchFunction.functionArguments.statistics=d||e;this._stretchFunction.functionArguments.histograms=h||g;this.contrastOffset||this.brightnessOffset?(this._stretchFunction.renderTexture=!1,this._function.renderTexture=!0,b=this._stretchFunction._stretchGL(b),this._function._cbGL(b)):(this._stretchFunction.renderTexture=!0,this._stretchFunction._stretchGL(b))},toJson:function(){var b=
this._stretchFunction.toJson().rasterFunctionArguments;b.bandIndex=this.bandIndex;b.contrastOffset=this.contrastOffset;b.brightnessOffset=this.brightnessOffset;return{rendererName:this.rendererName,rendererArguments:b}},toCommonRendererJson:function(){return{type:"rasterStretch",stretchType:"none   standardDeviation histogramEqualization minMax percentClip   sigmoid".split(" ")[this.stretchType]||"minMax",min:this.min,max:this.max,numberOfStandardDeviations:this.numberOfStandardDeviations,statistics:k.clone(this.statistics),
dra:this.dra,minPercent:this.minPercent,maxPercent:this.maxPercent,useGamma:this.useGamma,gamma:k.clone(this.gamma),computeGamma:this.computeGamma,sigmoidStrengthLevel:this.sigmoidStrengthLevel}},_updateStretchParameters:function(){var b=this._stretchFunction.functionArguments;b.stretchType=this.stretchType;b.min=this.min;b.max=this.max;b.numberOfStandardDeviations=this.numberOfStandardDeviations;b.statistics=this.statistics;b.histograms=this.histograms;b.dra=this.dra;b.minPercent=this.minPercent;
b.maxPercent=this.maxPercent;b.useGamma=this.useGamma;b.gamma=this.gamma;b.computeGamma=this.computeGamma;this._stretchFunction.interpolation=this.interpolation}})})},"esri/layers/rasterLib/renderer/RasterStretchColorRampRenderer":function(){define("dojo/_base/declare dojo/_base/lang ./RasterRenderer ../function/ResampleFunction ../function/StretchFunction ../function/ContrastBrightnessFunction ../function/ColormapFunction ../function/rasterUtils".split(" "),function(H,k,n,q,m,l,b,a){return H([n],
{declaredClass:"esri.layers.rasterLib.renderer.RasterStretchColorRampRenderer",rendererName:"Stretch",bandIndex:[0],colorRamp:null,invert:!1,stretchType:0,min:0,max:255,numberOfStandardDeviations:2,statistics:null,histograms:null,dra:!1,minPercent:.25,maxPercent:.5,useGamma:!1,gamma:null,computeGamma:!1,sigmoidStrengthLevel:1,constructor:function(c){this.stretchType="number"===typeof this.stretchType?this.stretchType:"none   standardDeviation histogramEqualization minMax percentClip   sigmoid".split(" ").indexOf(this.stretchType);
c=k.mixin({},c,{stretchType:this.stretchType});Object.keys(c).forEach(function(f){null==c[f]&&delete c[f]});this._function=new l(c);this._stretchFunction=new m(c);this._stretchFunction.outputPixelType="U8";this._stretchFunction.renderTexture=!1;this._clrFunction=new b(c);this._clrFunction.functionArguments.raster=this._stretchFunction;this._clrFunction.renderTexture=!1;this._function.functionArguments.raster=this._clrFunction},hasTilingEffects:function(){return this._stretchFunction.hasTilingEffects()},
draw2D:function(c){this._updateStretchParameters();c=this._clonePixelData(c);if("U8"===c.pixelBlock.pixelType&&!(this.contrastOffset||this.brightnessOffset||this.colorRamp))return c;this._stretchFunction._stretch(c);var f=c.pixelBlock,e=this.bandIndex?this.bandIndex[0]:0;f&&1<f.pixels.length&&f.pixels.length>e&&(f.pixels=[f.pixels[e]],f.statistics&&(f.statistics=[f.statistics[e]]));this.colorRamp&&(c=this._clrFunction._colorize(c));if(this.contrastOffset||this.brightnessOffset)c.pixelBlock=a.contrastBrightnessStretch(c.pixelBlock,
{contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset});return c},drawGL:function(c){this._updateStretchParameters();c.pixelBlock&&(c=this._clonePixelData(c));var f=c.pixelBlock,e=this.bandIndex?this.bandIndex[0]||0:0,g=this.statistics&&0<this.statistics.length?this.statistics:this._stretchFunction&&this._stretchFunction.srcStatistics,d=this.histograms&&0<this.histograms.length?this.histograms:this._stretchFunction&&this._stretchFunction.srcHistograms,h,p;f&&1<f.pixels.length&&
f.pixels.length>e&&(f.pixels=[f.pixels[e]],f.statistics&&(f.statistics=[f.statistics[e]]),g&&g.length>e&&(h=[g[e]]),d&&d.length>e&&(p=[d[e]]));this._stretchFunction.functionArguments.statistics=h||g;this._stretchFunction.functionArguments.histograms=p||d;f=!!this.colorRamp;this.contrastOffset||this.brightnessOffset?(this._stretchFunction.renderTexture=!1,this._clrFunction.renderTexture=!1,this._function.renderTexture=!0,c=this._stretchFunction._stretchGL(c),f&&(c=this._clrFunction._colorizeGL(c)),
this._function._cbGL(c)):f?(this._stretchFunction.renderTexture=!1,this._clrFunction.renderTexture=!0,c=this._stretchFunction._stretchGL(c),this._clrFunction._colorizeGL(c)):(this._stretchFunction.renderTexture=!0,this._stretchFunction._stretchGL(c))},toJson:function(){var c=this._stretchFunction.toJson().rasterFunctionArguments;c.colorRamp=this.colorRamp||"";this.invert&&(c.invert=!0);c.contrastOffset=this.contrastOffset;c.brightnessOffset=this.brightnessOffset;return{rendererName:this.rendererName,
rendererArguments:c}},toCommonRendererJson:function(){return{type:"rasterStretch",stretchType:"none   standardDeviation histogramEqualization minMax percentClip   sigmoid".split(" ")[this.stretchType]||"minMax",colorRamp:this.colorRamp&&this.colorRamp.toJson?this.colorRamp.toJson():this.colorRamp,min:this.min,max:this.max,numberOfStandardDeviations:this.numberOfStandardDeviations,statistics:k.clone(this.statistics),dra:this.dra,minPercent:this.minPercent,maxPercent:this.maxPercent,useGamma:this.useGamma,
gamma:k.clone(this.gamma),computeGamma:this.computeGamma,sigmoidStrengthLevel:this.sigmoidStrengthLevel}},_updateStretchParameters:function(){var c=this._stretchFunction.functionArguments;c.stretchType=this.stretchType;c.min=this.min;c.max=this.max;c.numberOfStandardDeviations=this.numberOfStandardDeviations;c.statistics=this.statistics;c.histograms=this.histograms;c.dra=this.dra;c.minPercent=this.minPercent;c.maxPercent=this.maxPercent;c.useGamma=this.useGamma;c.gamma=this.gamma;c.computeGamma=this.computeGamma;
this._stretchFunction.interpolation=this.interpolation}})})},"esri/layers/rasterLib/renderer/RasterClassBreaksRenderer":function(){define(["dojo/_base/declare","dojo/_base/lang","./RasterRenderer","../function/ColormapFunction","../function/RemapFunction"],function(H,k,n,q,m){return H([n],{declaredClass:"esri.layers.rasterLib.renderer.RasterClassBreaksRenderer",rendererName:"ClassBreaks",renderTexture:!0,constructor:function(l){l=l||{};this._function=new m(l);this._function.outputPixelType="U8";var b=
l.classBreakInfos;l=l.minValue;null!=l&&b&&(this._function.functionArguments.colorBreaks=this._getSortedColorBreaks(l,b))},bind:function(l){this.inherited(arguments);this.isColormapFunction=!1;var b=this.raster&&this.raster.rasterInfo||this._rawRasterInfo,a=b&&b.vat;if(a&&"u8"===b.pixelType.toLowerCase()&&this.classBreakInfos){var c=this.field;if(b=a.fields.filter(function(p){return"value"===p.name.toLowerCase()})[0])var f=b.name;var e=a.features.sort(function(p,t){return parseFloat(p.attributes[c])-
parseFloat(t.attributes[c])})[0].attributes[c];this.isColormapFunction=!0;var g=[],d=this.field,h=this.classBreakInfos;h.forEach(function(p,t){a.features.forEach(function(w){var u=h[t-1]&&h[t-1].classMaxValue||e;w.attributes[d]<=p.classMaxValue&&(w.attributes[d]>u||w.attributes[d]===e)&&(u=p.symbol.color,g.some(function(r){return r[0]===w.attributes[f]})||g.push([w.attributes[f]].concat(u)))})});this._function=new q({colormap:g});this.colormap=g;this._function.outputPixelType="U8";this._function.renderTexture=
!0}this._function&&this._function.setProcessingContext(k.mixin({useProcessedData:!0},this._processingContext))},draw2D:function(l){if(this.isColormapFunction)return this._updateColormapParameters(),l=this._clonePixelData(l),l=this._function._colorize(l);this._updateRemapParameters();return this._function._remap(l)},drawGL:function(l){this.isColormapFunction?(this._updateColormapParameters(),this._function._colorizeGL(l)):(this._function.renderTexture=!0,this._updateRemapParameters(),this._function._remapGL(l))},
toJson:function(){var l=this._function.toJson().rasterFunctionArguments;return{rendererName:this.rendererName,rendererArguments:l}},toCommonRendererJson:function(){var l,b=this.classBreakInfos,a=this.colorBreaks;if(null==b&&a)for(b=[],l=0;l<a.length-1;l++)b.push({classMaxValue:a[l+1].value,symbol:{color:a[l].mappedColor,type:"esriSFS",style:"esriSFSSolid"},label:a[l].value+" - "+a[l+1].value});return{type:"classBreaks",field:"Value",minValue:null!=this.minValue?this.minValue:a[0].value,classBreakInfos:b}},
_updateRemapParameters:function(){var l=this.classBreakInfos,b=this.minValue;null!=b&&l&&(this._function.functionArguments.colorBreaks=this._getSortedColorBreaks(b,l))},_getSortedColorBreaks:function(l,b){b=b.map(function(c){return{maxValue:c.classMaxValue,color:c.symbol.color}}).sort(function(c,f){return c.maxValue-f.maxValue});var a=[{value:l,mappedColor:b[0].color}];for(l=0;l<b.length;l++)a.push({value:b[l].maxValue,mappedColor:l===b.length-1?b[l].color:b[l+1].color});return a},_updateColormapParameters:function(){this._function.functionArguments.colormap=
this.colormap;this._function.interpolation=this.interpolation}})})},"esri/layers/rasterLib/renderer/RasterShadedReliefRenderer":function(){define("dojo/_base/declare dojo/_base/lang ./RasterRenderer ../function/HillshadeFunction ../function/ContrastBrightnessFunction ../function/ColormapFunction ../function/rasterUtils".split(" "),function(H,k,n,q,m,l,b){return H([n],{declaredClass:"esri.layers.rasterLib.renderer.RasterShadedReliefRenderer",rendererName:"ShadedRelief",hillshadeType:null,azimuth:315,
altitude:45,zFactor:1,slopeType:null,psPower:.664,psFactor:.024,raster:null,constructor:function(a){this.hillshadeType="number"===typeof this.hillshadeType?this.hillshadeType:["traditional","multi-directional"].indexOf(this.hillshadeType);a&&a.scalingType&&(this.slopeType="adjusted"===a.scalingType?3:1);a&&a.pixelSizePower&&(this.psPower=a.pixelSizePower);a&&a.pixelSizeFactor&&(this.psFactor=a.pixelSizeFactor);a=k.mixin({},a,{hillshadeType:this.hillshadeType,psPower:this.psPower,psFactor:this.psFactor,
slopeType:this.slopeType});Object.keys(a).forEach(function(c){null==a[c]&&delete a[c]});this._function=new m(a);this._hillshadeFunction=new q(a);this._hillshadeFunction.outputPixelType="U8";this._hillshadeFunction.renderTexture=!1;this._function.functionArguments.raster=this._hillshadeFunction},hasTilingEffects:function(){return this._hillshadeFunction.hasTilingEffects()},draw2D:function(a){this._updateHillshadeParameters();a=this._clonePixelData(a);a=this._hillshadeFunction.read2D({raster:a});if(this.contrastOffset||
this.brightnessOffset)a.pixelBlock=b.contrastBrightnessStretch(a.pixelBlock,{contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset});return a},drawGL:function(a){this._updateHillshadeParameters();this.contrastOffset||this.brightnessOffset?(this._hillshadeFunction.renderTexture=!1,this._function.renderTexture=!0,a=this._hillshadeFunction.readGL({raster:a}),this._function._cbGL(a)):(this._hillshadeFunction.renderTexture=!0,this._hillshadeFunction.readGL({raster:a}))},toJson:function(){var a=
this._hillshadeFunction.toJson().rasterFunctionArguments;a.colorRamp=this.colorRamp||"";this.invert&&(a.invert=!0);a.contrastOffset=this.contrastOffset;a.brightnessOffset=this.brightnessOffset;return{rendererName:this.rendererName,rendererArguments:a}},toCommonRendererJson:function(){return{type:"rasterShadedRelief",hillshadeType:["traditional","multi-directional"][this.hillshadeType]||"traditional",azimuth:this.azimuth,altitude:this.altitude,zFactor:this.zFactor,scalingType:3===this.slopeType?"adjusted":
"none",pixelSizePower:this.psPower,pixelSizeFactor:this.psFactor,colorRamp:this.colorRamp&&this.colorRamp.toJson?this.colorRamp.toJson():this.colorRamp}},_updateHillshadeParameters:function(){var a=this._hillshadeFunction.functionArguments;a.hillshadeType=this.hillshadeType;a.azimuth=this.azimuth;a.altitude=this.altitude;a.zFactor=this.zFactor;a.slopeType=this.slopeType;a.psPower=this.psPower;a.psFactor=this.psFactor}})})},"esri/layers/rasterLib/raster/rasterProjectionHelper":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/Deferred dojo/sniff ../../../kernel ../../../WKIDUnitConversion ../../../geometry/Extent ../../../geometry/projection ../../../geometry/webMercatorUtils ../../../SpatialReference ../../../geometry/Point".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e){H={requirePE:function(d,h){return!(d.equals(h)||d._canProject(h))},load:function(){var d=new n;if(!this._loadPromise)if(a.isSupported())this._loadPromise=a.load();else{var h=new n;h.reject("projection engine is not supported on this version of the browser, please try with a modern browser");this._loadPromise=h.promise}this._loadPromise.isFulfilled()?this._loadPromise.isResolved()?d.resolve():this._loadPromise.isRejected()&&d.resolve():(this._pendingdfds=this._pendingdfds||
[],this._pendingdfds.push(d),this._loadPromise.then(k.hitch(this,function(){this._pendingdfds.forEach(function(p){p.isFulfilled()||p.resolve()})}),k.hitch(this,function(){this._pendingdfds.forEach(function(p){p.isFulfilled()||p.reject()})})));return d.promise},computeError:function(d,h){return[Math.abs((d[0]+d[4]+d[4*h.rows]+d[4*h.rows+4])/4-d[2*h.rows+2]),Math.abs((d[1]+d[5]+d[4*h.rows+1]+d[4*h.rows+5])/4-d[2*h.rows+3])]},getDefaultDatumTransformationForDataset:function(d,h,p){if(!(h&&d.spatialReference&&
this.requirePE(d.spatialReference,h)&&a.isLoaded()))return null;d=new b(d.toJson());h=new f(h.toJson());return p?a.getTransformation(h,d.spatialReference,d):a.getTransformation(d.spatialReference,h,d)},project:function(d,h,p){if(!h||d.spatialReference.equals(h))return d;var t=a.isLoaded()?a:c;"esri.geometry.Extent"===d.declaredClass?d=new b(d.toJson()):"esri.geometry.Point"===d.declaredClass&&(d=new e(d.toJson()));h=new f(h.toJson());(d=t.project(d,h))&&"esri.geometry.Extent"===d.declaredClass?(d=
new b(d.toJson()),p&&(1E-5>Math.abs(d.xmin+180)&&1E-5>Math.abs(d.xmax-180)?(d.xmin=0,d.xmax=360):(0>d.xmin&&(d.xmin+=360,d.xmax+=360),0>d.xmax&&(d.xmax+=360)))):d&&"esri.geometry.Point"===d.declaredClass&&(d=new e(d.toJson()),p&&0>d.x&&(d.x+=360));return d},projectResolution:function(d,h,p){var t=p.xmin+(p.xmax-p.xmin)/2;p=p.ymin+(p.ymax-p.ymin)/2;d=new b(t,p,t+d.x,p+d.y,d.spatialReference);d=this.project(d,h);return new e(d.xmax-d.xmin,d.ymax-d.ymin,h)},getProjectionOffsetGrid:function(d,h,p,t,w,
u,r){null==r&&(r=[32,32]);var y=d.xmin,B=d.ymin,C=d.xmax,G=d.ymax,x=d.spatialReference,v=h.spatialReference,z=a.isLoaded()?a:c,A=w?-w:null,F=r[0]*p.x,J=r[1]*p.y;C={cols:Math.ceil((C-y)/F)+1,rows:Math.ceil((G-B)/J)+1};d=[];for(G=0;G<C.cols;G++){var L=P;var P=[];for(p=0;p<C.rows;p++){var Q=new e({x:y+F*G,y:B+J*p,spatialReference:x});Q=z.project(Q,v,u);if(!Q)return null;t&&0>Q.x&&(Q.x+=360);P.push(Q);0<G&&null!=A&&Q.x<L[p].x&&(Q.x+=w-A,Q.x<L[p].x&&(Q.x+=w-A));d.push((Q.x-h.xmin)/(h.xmax-h.xmin));d.push((Q.y-
h.ymin)/(h.ymax-h.ymin))}}h=this.computeError(d,C);t=new Float32Array((C.cols-1)*(C.rows-1)*12);w=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]);u=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(G=0;G<C.cols-1;G++)for(p=0;p<C.rows-1;p++){F=G*C.rows*2+2*p;y=d[F];B=d[F+1];P=d[F+2];x=d[F+3];F+=2*C.rows;v=d[F];z=d[F+1];A=d[F+2];J=d[F+3];L=0;Q=12*(p*(C.cols-1)+G);for(F=0;3>F;F++)t[Q++]=w[L++]*y+w[L++]*P+w[L++]*A;for(F=L=0;3>F;F++)t[Q++]=w[L++]*B+w[L++]*x+w[L++]*J;for(F=L=0;3>F;F++)t[Q++]=u[L++]*y+u[L++]*v+u[L++]*
A;for(F=L=0;3>F;F++)t[Q++]=u[L++]*B+u[L++]*z+u[L++]*J}return{offsets:d,error:h,coefficients:t,spacing:r,size:[C.cols-1,C.rows-1]}},getHalfWorldWidth:function(d){var h=d&&d.wkid;if(null!=h)return d.isWebMercator()&&(h=3857),null==l[h]?180:g[h]}};q("extend-esri")&&k.setObject("layers.rasterLib.raster.rasterProjectionHelper",H,m);var g={3395:2.0037508342789244E7,3410:1.7334193943686873E7,3832:3339584.723798206,3857:2.0037508342788905E7,3975:1.7367530445161372E7,4087:2.0037508342789244E7,4088:2.0015108787169147E7,
6933:1.7367530445161372E7,8858:7396237.374497803,8859:2465412.4581659334,32662:2.0037508342789244E7,53001:2.001508679602057E7,53002:1.000754339801029E7,53003:2.001508679602057E7,53004:2.001508679602057E7,53016:1.4152803599503474E7,53017:1.7333573624304302E7,53025:7276828.3848298555,53031:1.0384677558821043E7,53034:2.001508679602057E7,53036:7389443.187332862,53037:2463147.729110953,53079:2.0015114352186374E7,53080:2.0015114352186374E7,54001:2.0037508342789244E7,54002:1.0018754171394624E7,54003:2.0037508342789244E7,
54004:2.0037508342789244E7,54016:1.4168658027268292E7,54017:1.736753044516137E7,54025:7311399.09166516,54031:1.0396310810074743E7,54034:2.0037508342789244E7,54050:808820.9223376509,54053:1920897.3915568967,54079:2.0037508342789244E7,54080:2.0037508342789244E7,54099:1.3524439768288724E7,54100:2.0037508342789244E7,54101:2.0037508342789244E7,102038:4297258.582585486,102299:5013965.117483125};return H})},"esri/geometry/projection":function(){define("require exports dojo/Deferred ./pe ../SpatialReference ./GeographicTransformation".split(" "),
function(H,k,n,q,m,l){function b(g,d,h,p,t){void 0===p&&(p=null);void 0===t&&(t=!1);if(null===p){var w=l.cacheKey(d,h);void 0!==e[w]?p=e[w]:(p=a(d,h,null),null===p&&(p=new l),e[w]=p)}return c._project(g,d,h instanceof m||!1===t?h:new m(h),p,t)}function a(g,d,h){void 0===h&&(h=null);g=c._getTransformation(g,d,h);return null!==g?l.fromGE(g):null}Object.defineProperty(k,"__esModule",{value:!0});var c=null;k.isLoaded=function(){return!!c&&q.isLoaded()};k.isSupported=function(){return q.isSupported()};
var f=null;k.load=function(){if(f)return f.promise;f=new n;var g=q.load();H(["./geometryEngine"],function(d){c=d;g.then(function(){c._enableProjection(q);f.resolve()},function(h){f.reject(h)})});return f.promise};k.project=function(g,d,h){void 0===h&&(h=null);return g instanceof Array?0===g.length?[]:b(g,g[0].spatialReference,d,h):b([g],g.spatialReference,d,h)[0]};var e={};k.projectMany=b;k.getTransformation=a;k.getTransformations=function(g,d,h){void 0===h&&(h=null);g=c._getTransformationBySuitability(g,
d,h);if(null!==g){d=[];for(h=0;h<g.length;h++)d.push(l.fromGE(g[h]));return d}return[]}})},"esri/geometry/pe":function(){define(["require","exports","../core/tsSupport/extendsHelper","dojo/Deferred","../core/sniff"],function(H,k,n,q,m){function l(w){function u(C,G,x){C[G]=x(C[G])}k._pe=w;g.init();d.init();h.init();p.init();t.init();k.PeGCSExtent=function(C){function G(){return null!==C&&C.apply(this,arguments)||this}n(G,C);G.prototype.destroy=function(){k._pe.destroy(this)};return G}(k._pe.PeGCSExtent);
for(var r=0,y=[k._pe.PeDatum,k._pe.PeGeogcs,k._pe.PeGeogtran,k._pe.PeObject,k._pe.PeParameter,k._pe.PePrimem,k._pe.PeProjcs,k._pe.PeSpheroid,k._pe.PeUnit];r<y.length;r++)w=y[r],u(w.prototype,"getName",function(C){return function(){return C.call(this,Array(g.PE_NAME_MAX))}});r=0;for(y=[k._pe.PeGeogtran,k._pe.PeProjcs];r<y.length;r++)w=y[r],u(w.prototype,"getParameters",function(C){return function(){for(var G=Array(g.PE_PARM_MAX),x=C.call(this),v=0;v<G.length;v++){var z=k._pe.getValue(x,"*");G[v]=z?
k._pe.wrapPointer(z,k._pe.PeParameter):null;x+=Int32Array.BYTES_PER_ELEMENT}return G}});u(k._pe.PeHorizon.prototype,"getCoord",function(C){return function(){var G=this.getSize();if(!G)return null;var x=[],v=C.call(this);f(x,G,v);return x}});u(k._pe.PeGTlistExtendedEntry.prototype,"getEntries",function(C){var G=k._pe._pe_getPeGTlistExtendedGTsSize();return function(){var x=null,v=C.call(this);if(!k._pe.compare(v,k._pe.NULL)){x=[v];var z=this.getSteps();if(1<z){v=k._pe.getPointer(v);for(var A=1;A<z;A++)x.push(k._pe.wrapPointer(v+
G*A,k._pe.PeGTlistExtendedGTs))}}return x}});var B=k._pe._pe_getPeHorizonSize();w=function(C){return function(){var G=this._cache;G||(this._cache=G=new Map);if(G.has(C))return G.get(C);var x=null,v=C.call(this);if(!k._pe.compare(v,k._pe.NULL)){x=[v];var z=v.getNump();if(1<z){v=k._pe.getPointer(v);for(var A=1;A<z;A++)x.push(k._pe.wrapPointer(v+B*A,k._pe.PeHorizon))}}G.set(C,x);return x}};u(k._pe.PeProjcs.prototype,"horizonGcsGenerate",w);u(k._pe.PeProjcs.prototype,"horizonPcsGenerate",w);k._pe.PeObject.prototype.toString=
function(C){void 0===C&&(C=g.PE_STR_OPTS_NONE);k._pe.ensureCache.prepare();var G=k._pe.getPointer(this),x=k._pe.ensureInt8(Array(g.PE_BUFFER_MAX));return k._pe.UTF8ToString(k._pe._pe_object_to_string_ext(G,C,x))}}function b(w){if(w){var u=k._pe.getClass(w);u&&(u=k._pe.getCache(u))&&(w=k._pe.getPointer(w))&&delete u[w]}}function a(w,u){var r=[];u=Array(u);for(var y=0;y<w;y++)r.push(k._pe.ensureInt8(u));return r}function c(w){if(Array.isArray(w[0])){var u=[];w.forEach(function(r){u.push(r[0],r[1])})}else u=
w;return u}function f(w,u,r,y){void 0===y&&(y=!1);if(y)for(y=0;y<2*u;y++)w[y]=k._pe.getValue(r+y*Float64Array.BYTES_PER_ELEMENT,"double");else{var B=0===w.length;for(y=0;y<u;y++)B&&(w[y]=Array(2)),w[y][0]=k._pe.getValue(r,"double"),w[y][1]=k._pe.getValue(r+Float64Array.BYTES_PER_ELEMENT,"double"),r+=2*Float64Array.BYTES_PER_ELEMENT}}Object.defineProperty(k,"__esModule",{value:!0});var e;k._pe=null;k.isLoaded=function(){return!!k._pe};k.isSupported=function(){return!!m("esri-wasm")};k.load=function(){if(e)return e.promise;
e=new q;H(["./support/pe-wasm"],function(w){w({locateFile:function(u){return H.toUrl("./support/"+u)},onAbort:function(u){e.reject(Error(u))}}).then(function(u){l(u);e.resolve()})});return e.promise};(function(w){function u(B,C,G){k._pe.ensureCache.prepare();var x=c(G),v=G===x;x=k._pe.ensureFloat64(x);(B=k._pe._pe_geog_to_proj(k._pe.getPointer(B),C,x))&&f(G,C,x,v);return B}function r(B,C,G){return y(B,C,G,0)}function y(B,C,G,x){k._pe.ensureCache.prepare();var v=c(G),z=G===v;v=k._pe.ensureFloat64(v);
(B=k._pe._pe_proj_to_geog_center(k._pe.getPointer(B),C,v,x))&&f(G,C,v,z);return B}w.geogToProj=u;w.projGeog=function(B,C,G,x){switch(x){case g.PE_TRANSFORM_P_TO_G:return r(B,C,G);case g.PE_TRANSFORM_G_TO_P:return u(B,C,G)}return 0};w.projToGeog=r;w.projToGeogCenter=y})(k.PeCSTransformations||(k.PeCSTransformations={}));var g;(function(w){w.init=function(){w.PE_BUFFER_MAX=k._pe.PeDefs.prototype.PE_BUFFER_MAX;w.PE_NAME_MAX=k._pe.PeDefs.prototype.PE_NAME_MAX;w.PE_MGRS_MAX=k._pe.PeDefs.prototype.PE_MGRS_MAX;
w.PE_USNG_MAX=k._pe.PeDefs.prototype.PE_USNG_MAX;w.PE_DD_MAX=k._pe.PeDefs.prototype.PE_DD_MAX;w.PE_DDM_MAX=k._pe.PeDefs.prototype.PE_DDM_MAX;w.PE_DMS_MAX=k._pe.PeDefs.prototype.PE_DMS_MAX;w.PE_UTM_MAX=k._pe.PeDefs.prototype.PE_UTM_MAX;w.PE_PARM_MAX=k._pe.PeDefs.prototype.PE_PARM_MAX;w.PE_TYPE_NONE=k._pe.PeDefs.prototype.PE_TYPE_NONE;w.PE_TYPE_GEOGCS=k._pe.PeDefs.prototype.PE_TYPE_GEOGCS;w.PE_TYPE_PROJCS=k._pe.PeDefs.prototype.PE_TYPE_PROJCS;w.PE_TYPE_GEOGTRAN=k._pe.PeDefs.prototype.PE_TYPE_GEOGTRAN;
w.PE_TYPE_COORDSYS=k._pe.PeDefs.prototype.PE_TYPE_COORDSYS;w.PE_TYPE_UNIT=k._pe.PeDefs.prototype.PE_TYPE_UNIT;w.PE_STR_OPTS_NONE=k._pe.PeDefs.prototype.PE_STR_OPTS_NONE;w.PE_STR_AUTH_NONE=k._pe.PeDefs.prototype.PE_STR_AUTH_NONE;w.PE_STR_AUTH_TOP=k._pe.PeDefs.prototype.PE_STR_AUTH_TOP;w.PE_STR_NAME_CANON=k._pe.PeDefs.prototype.PE_STR_NAME_CANON;w.PE_PARM_X0=k._pe.PeDefs.prototype.PE_PARM_X0;w.PE_PARM_ND=k._pe.PeDefs.prototype.PE_PARM_ND;w.PE_TRANSFORM_1_TO_2=k._pe.PeDefs.prototype.PE_TRANSFORM_1_TO_2;
w.PE_TRANSFORM_2_TO_1=k._pe.PeDefs.prototype.PE_TRANSFORM_2_TO_1;w.PE_TRANSFORM_P_TO_G=k._pe.PeDefs.prototype.PE_TRANSFORM_P_TO_G;w.PE_TRANSFORM_G_TO_P=k._pe.PeDefs.prototype.PE_TRANSFORM_G_TO_P;w.PE_HORIZON_RECT=k._pe.PeDefs.prototype.PE_HORIZON_RECT;w.PE_HORIZON_POLY=k._pe.PeDefs.prototype.PE_HORIZON_POLY;w.PE_HORIZON_LINE=k._pe.PeDefs.prototype.PE_HORIZON_LINE;w.PE_HORIZON_DELTA=k._pe.PeDefs.prototype.PE_HORIZON_DELTA}})(g=k.PeDefs||(k.PeDefs={}));(function(w){function u(C,G){var x=null,v=y[C];
v||(v={},y[C]=v);v.hasOwnProperty(String(G))?x=v[G]:(C=k._pe.PeFactory.prototype.factoryByType(C,G),k._pe.compare(C,k._pe.NULL)||(x=C,v[G]=x));return x=r(x)}function r(C){if(C){var G=C.getType();switch(G){case g.PE_TYPE_GEOGCS:C=k._pe.castObject(C,k._pe.PeGeogcs);break;case g.PE_TYPE_PROJCS:C=k._pe.castObject(C,k._pe.PeProjcs);break;case g.PE_TYPE_GEOGTRAN:C=k._pe.castObject(C,k._pe.PeGeogtran);break;default:G&g.PE_TYPE_UNIT&&(C=k._pe.castObject(C,k._pe.PeUnit))}}return C}var y={},B={};w.initialize=
function(){k._pe.PeFactory.prototype.initialize(null)};w.coordsys=function(C){return u(g.PE_TYPE_COORDSYS,C)};w.factoryByType=u;w.fromString=function(C,G){var x=null,v=B[C];v||(v={},B[C]=v);v.hasOwnProperty(G)?x=v[G]:(C=k._pe.PeFactory.prototype.fromString(C,G),k._pe.compare(C,k._pe.NULL)||(x=C,v[G]=x));return x=r(x)};w.geogcs=function(C){return u(g.PE_TYPE_GEOGCS,C)};w.geogtran=function(C){return u(g.PE_TYPE_GEOGTRAN,C)};w.getCode=function(C){return k._pe.PeFactory.prototype.getCode(C)};w.projcs=
function(C){return u(g.PE_TYPE_PROJCS,C)};w.unit=function(C){return u(g.PE_TYPE_UNIT,C)}})(k.PeFactory||(k.PeFactory={}));k.PeGCSExtent=null;var d;(function(w){var u;w.init=function(){w.PE_GTLIST_OPTS_COMMON=k._pe.PeGTlistExtended.prototype.PE_GTLIST_OPTS_COMMON;u=k._pe._pe_getPeGTlistExtendedEntrySize()};w.getGTlist=function(r,y,B,C,G,x){var v=null,z=new k._pe.PeInteger(x);try{var A=k._pe.PeGTlistExtended.prototype.getGTlist(r,y,B,C,G,z);if(x=z.val)if(v=[A],1<x){var F=k._pe.getPointer(A);for(r=1;r<
x;r++)v.push(k._pe.wrapPointer(F+u*r,k._pe.PeGTlistExtendedEntry))}}finally{k._pe.destroy(z)}return v}})(d=k.PeGTlistExtended||(k.PeGTlistExtended={}));(function(w){w.destroy=function(u){if(u&&u.length){for(var r=0;r<u.length;r++){var y=u[r];b(y);y.getEntries().forEach(function(B){b(B);B=B.getGeogtran();b(B);B.getParameters().forEach(b);[B.getGeogcs1(),B.getGeogcs2()].forEach(function(C){b(C);var G=C.getDatum();b(G);b(G.getSpheroid());b(C.getPrimem());b(C.getUnit())})})}k._pe.PeGTlistExtendedEntry.prototype.Delete(u[0])}}})(k.PeGTlistExtendedEntry||
(k.PeGTlistExtendedEntry={}));(function(w){w.geogToGeog=function(u,r,y,B,C){k._pe.ensureCache.prepare();var G=c(y),x=y===G;G=k._pe.ensureFloat64(G);var v=0;B&&(v=k._pe.ensureFloat64(B));(u=k._pe._pe_geog_to_geog(k._pe.getPointer(u),r,G,v,C))&&f(y,r,G,x);return u}})(k.PeGTTransformations||(k.PeGTTransformations={}));(function(w){function u(y,B,C,G,x,v){k._pe.ensureCache.prepare();switch(y){case "dd":var z=k._pe._pe_geog_to_dd;var A=g.PE_DD_MAX;break;case "ddm":z=k._pe._pe_geog_to_ddm;A=g.PE_DDM_MAX;
break;case "dms":z=k._pe._pe_geog_to_dms,A=g.PE_DMS_MAX}y=0;B&&(y=k._pe.getPointer(B));B=c(G);B=k._pe.ensureFloat64(B);A=a(C,A);G=k._pe.ensureInt32(A);if(x=z(y,C,B,x,G))for(z=0;z<C;z++)v[z]=k._pe.UTF8ToString(A[z]);return x}function r(y,B,C,G,x){k._pe.ensureCache.prepare();switch(y){case "dd":var v=k._pe._pe_dd_to_geog;break;case "ddm":v=k._pe._pe_ddm_to_geog;break;case "dms":v=k._pe._pe_dms_to_geog}y=0;B&&(y=k._pe.getPointer(B));B=G.map(function(z){return k._pe.ensureString(z)});G=k._pe.ensureInt32(B);
B=k._pe.ensureFloat64(Array(2*C));(v=v(y,C,G,B))&&f(x,C,B);return v}w.geog_to_dms=function(y,B,C,G,x){return u("dms",y,B,C,G,x)};w.dms_to_geog=function(y,B,C,G){return r("dms",y,B,C,G)};w.geog_to_ddm=function(y,B,C,G,x){return u("ddm",y,B,C,G,x)};w.ddm_to_geog=function(y,B,C,G){return r("ddm",y,B,C,G)};w.geog_to_dd=function(y,B,C,G,x){return u("dd",y,B,C,G,x)};w.dd_to_geog=function(y,B,C,G){return r("dd",y,B,C,G)}})(k.PeNotationDms||(k.PeNotationDms={}));var h;(function(w){w.init=function(){w.PE_MGRS_STYLE_NEW=
k._pe.PeNotationMgrs.prototype.PE_MGRS_STYLE_NEW;w.PE_MGRS_STYLE_OLD=k._pe.PeNotationMgrs.prototype.PE_MGRS_STYLE_OLD;w.PE_MGRS_STYLE_AUTO=k._pe.PeNotationMgrs.prototype.PE_MGRS_STYLE_AUTO;w.PE_MGRS_180_ZONE_1_PLUS=k._pe.PeNotationMgrs.prototype.PE_MGRS_180_ZONE_1_PLUS;w.PE_MGRS_ADD_SPACES=k._pe.PeNotationMgrs.prototype.PE_MGRS_ADD_SPACES};w.geog_to_mgrs_extended=function(u,r,y,B,C,G,x){k._pe.ensureCache.prepare();var v=0;u&&(v=k._pe.getPointer(u));u=c(y);y=k._pe.ensureFloat64(u);u=a(r,g.PE_MGRS_MAX);
var z=k._pe.ensureInt32(u);if(B=k._pe._pe_geog_to_mgrs_extended(v,r,y,B,C,G,z))for(C=0;C<r;C++)x[C]=k._pe.UTF8ToString(u[C]);return B};w.mgrs_to_geog_extended=function(u,r,y,B,C){k._pe.ensureCache.prepare();var G=0;u&&(G=k._pe.getPointer(u));u=y.map(function(x){return k._pe.ensureString(x)});y=k._pe.ensureInt32(u);u=k._pe.ensureFloat64(Array(2*r));(B=k._pe._pe_mgrs_to_geog_extended(G,r,y,B,u))&&f(C,r,u);return B}})(h=k.PeNotationMgrs||(k.PeNotationMgrs={}));(function(w){w.geog_to_usng=function(u,
r,y,B,C,G,x){k._pe.ensureCache.prepare();var v=0;u&&(v=k._pe.getPointer(u));u=c(y);y=k._pe.ensureFloat64(u);u=a(r,g.PE_MGRS_MAX);var z=k._pe.ensureInt32(u);if(B=k._pe._pe_geog_to_usng(v,r,y,B,C,G,z))for(C=0;C<r;C++)x[C]=k._pe.UTF8ToString(u[C]);return B};w.usng_to_geog=function(u,r,y,B){k._pe.ensureCache.prepare();var C=0;u&&(C=k._pe.getPointer(u));u=y.map(function(G){return k._pe.ensureString(G)});y=k._pe.ensureInt32(u);u=k._pe.ensureFloat64(Array(2*r));(C=k._pe._pe_usng_to_geog(C,r,y,u))&&f(B,r,
u);return C}})(k.PeNotationUsng||(k.PeNotationUsng={}));var p;(function(w){w.init=function(){w.PE_UTM_OPTS_NONE=k._pe.PeNotationUtm.prototype.PE_UTM_OPTS_NONE;w.PE_UTM_OPTS_ADD_SPACES=k._pe.PeNotationUtm.prototype.PE_UTM_OPTS_ADD_SPACES;w.PE_UTM_OPTS_NS=k._pe.PeNotationUtm.prototype.PE_UTM_OPTS_NS};w.geog_to_utm=function(u,r,y,B,C){k._pe.ensureCache.prepare();var G=0;u&&(G=k._pe.getPointer(u));u=c(y);y=k._pe.ensureFloat64(u);u=a(r,g.PE_UTM_MAX);var x=k._pe.ensureInt32(u);if(B=k._pe._pe_geog_to_utm(G,
r,y,B,x))for(G=0;G<r;G++)C[G]=k._pe.UTF8ToString(u[G]);return B};w.utm_to_geog=function(u,r,y,B,C){k._pe.ensureCache.prepare();var G=0;u&&(G=k._pe.getPointer(u));u=y.map(function(x){return k._pe.ensureString(x)});y=k._pe.ensureInt32(u);u=k._pe.ensureFloat64(Array(2*r));(B=k._pe._pe_utm_to_geog(G,r,y,B,u))&&f(C,r,u);return B}})(p=k.PeNotationUtm||(k.PeNotationUtm={}));var t;(function(w){var u=new Map;w.init=function(){w.PE_PCSINFO_OPTION_NONE=k._pe.PePCSInfo.prototype.PE_PCSINFO_OPTION_NONE;w.PE_PCSINFO_OPTION_DOMAIN=
k._pe.PePCSInfo.prototype.PE_PCSINFO_OPTION_DOMAIN;w.PE_POLE_OUTSIDE_BOUNDARY=k._pe.PePCSInfo.prototype.PE_POLE_OUTSIDE_BOUNDARY;w.PE_POLE_POINT=k._pe.PePCSInfo.prototype.PE_POLE_POINT};w.generate=function(r,y){void 0===y&&(y=w.PE_PCSINFO_OPTION_DOMAIN);var B;if(u.has(r)){var C=u.get(r);C[y]&&(B=C[y])}B||(B=k._pe.PePCSInfo.prototype.generate(r,y),C||(C=[],u.set(r,C)),C[y]=B);return B}})(t=k.PePCSInfo||(k.PePCSInfo={}));(function(w){w.version_string=function(){return k._pe.PeVersion.prototype.version_string()}})(k.PeVersion||
(k.PeVersion={}));k._init=l})},"esri/core/tsSupport/extendsHelper":function(){define([],function(){return function(){var H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,n){k.__proto__=n}||function(k,n){for(var q in n)n.hasOwnProperty(q)&&(k[q]=n[q])};return function(k,n){function q(){this.constructor=k}H(k,n);k.prototype=null===n?Object.create(n):(q.prototype=n.prototype,new q)}}()})},"esri/geometry/GeographicTransformation":function(){define(["require","exports","./GeographicTransformationStep"],
function(H,k,n){return function(){function q(m){this.steps=[];this._cached_projection={};this._chain="";this._gtlistentry=null;if(m&&m.steps){var l=0;for(m=m.steps;l<m.length;l++){var b=m[l];b instanceof n?this.steps.push(b):this.steps.push(new n({wkid:b.wkid,wkt:b.wkt,isInverse:b.isInverse}))}}}q.cacheKey=function(m,l){return[void 0!==m.wkid&&null!==m.wkid?m.wkid.toString():"-1",void 0!==m.wkt&&null!==m.wkt?m.wkt.toString():"",void 0!==l.wkid&&null!==l.wkid?l.wkid.toString():"-1",void 0!==l.wkt&&
null!==l.wkt?l.wkt.toString():""].join()};q.fromGE=function(m){var l=new q,b="",a=0;for(m=m.steps;a<m.length;a++){var c=n.fromGE(m[a]);l.steps.push(c);b+=c.uid.toString()+","}l._cached_projection={};l._gtlistentry=null;l._chain=b;return l};q.prototype.getInverse=function(){var m=new q;m.steps=[];for(var l=this.steps.length-1;0<=l;l--)m.steps.push(this.steps[l].getInverse());return m};q.prototype.getGTListEntry=function(){for(var m="",l=0,b=this.steps;l<b.length;l++)m+=b[l].uid.toString()+",";m!==
this._chain&&(this._gtlistentry=null,this._cached_projection={},this._chain=m);return this._gtlistentry};q.prototype.assignCachedGe=function(m,l,b){this._cached_projection[q.cacheKey(m,l)]=b};q.prototype.getCachedGeTransformation=function(m,l){for(var b="",a=0,c=this.steps;a<c.length;a++)b+=c[a].uid.toString()+",";b!==this._chain&&(this._gtlistentry=null,this._cached_projection={},this._chain=b);m=this._cached_projection[q.cacheKey(m,l)];return void 0===m?null:m};return q}()})},"esri/geometry/GeographicTransformationStep":function(){define(["require",
"exports"],function(H,k){var n=0;return function(){function q(m){void 0===m&&(m=null);this.uid=n++;m?(this._wkt=void 0!==m.wkt?m.wkt:null,this._wkid=void 0!==m.wkid?m.wkid:-1,this._isInverse=void 0!==m.isInverse?!0===m.isInverse:!1):(this._wkt=null,this._wkid=-1,this._isInverse=!1)}q.fromGE=function(m){var l=new q;l._wkt=m.wkt;l._wkid=m.wkid;l._isInverse=m.isInverse;return l};Object.defineProperty(q.prototype,"wkt",{get:function(){return this._wkt},set:function(m){this._wkt=m;this.uid=n++},enumerable:!0,
configurable:!0});Object.defineProperty(q.prototype,"wkid",{get:function(){return this._wkid},set:function(m){this._wkid=m;this.uid=n++},enumerable:!0,configurable:!0});Object.defineProperty(q.prototype,"isInverse",{get:function(){return this._isInverse},set:function(m){this._isInverse=m;this.uid=n++},enumerable:!0,configurable:!0});q.prototype.getInverse=function(){var m=new q;m._wkt=this.wkt;m._wkid=this._wkid;m._isInverse=!this.isInverse;return m};return q}()})},"esri/layers/rasterLib/raster/TileServiceRaster":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/Deferred dojo/_base/array dojo/_base/config dojo/_base/json dojo/sniff dojo/DeferredList dojo/when ../../../kernel ../../../Evented ../../../request ../../../geometry/Extent ../../../geometry/Point ../../../SpatialReference ../../../deferredUtils ../../../urlUtils ../../PixelBlock ../../rasterFormats/rasterCodec ../tile/RasterTileInfo ./RasterInfo ./BasicRaster".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G){H=k([G],{declaredClass:"esri.layers.rasterLib.raster.TileServiceRaster",constructor:function(x){},open:function(){var x=new q,v=this.serviceInfo||this._getServiceInfo(null),z=n.hitch(this,function(F){this.serviceInfo=F;this.version=F.currentVersion;this.rasterInfo=this._parseRasterInfo(F);this.loaded=!0;this._getRasterIdentifier();x.resolve(this)}),A=n.hitch(this,function(F){this.loaded=!0;this._getRasterIdentifier();x.reject(F)});f(v,z,A);return x.promise},
read:function(x){var v=this.url+"/tile/"+x.level+"/"+x.row+"/"+x.col,z={width:this.tileInfo.cols,height:this.tileInfo.rows,planes:null,pixelType:null,format:null,decodeFunc:null,isPoint:"elevation"===this.tileType.toLowerCase()?!0:!1};return this._requestPixels({url:v+(this.disableClientCaching?"?_ts\x3d "+(new Date).getTime():""),payload:{},decodeParams:z,tileOptions:x})},identify:function(x,v){null==v&&(v=this.tileInfo.lods[this.tileInfo.lods.length-1].level);var z=(x.x-this.tileInfo.origin.x)/
this.tileInfo.lods[v].resolution/this.tileInfo.cols;x=(this.tileInfo.origin.y-x.y)/this.tileInfo.lods[v].resolution/this.tileInfo.rows;var A=Math.floor(z),F=Math.floor(x),J=Math.floor((z-A)*this.tileInfo.cols);J=Math.min(J,this.tileInfo.cols-1);var L=Math.floor((x-F)*this.tileInfo.rows);L=Math.min(L,this.tileInfo.rows-1);var P=new q;this.read({level:v,row:F,col:A}).then(function(Q){var Z=L*Q.width+J;Q&&Q.pixels&&0<Q.pixels.length?(Q=Q.mask?Q.mask[Z]?Q.pixels.map(function(ca){return ca[Z]}):null:Q.pixels.map(function(ca){return ca[Z]}),
P.resolve(Q)):P.reject("no valid data")},function(Q){P.reject(Q)});return P.promise},setFetchParameters:function(x,v){},_getRasterIdentifier:function(){this._rasterId||(this._rasterId=this.url.replace("http:","").replace("https:",""));return this._rasterId},_getServiceInfo:function(){var x=this.url,v=new q(w._dfdCanceller);v._pendingDfd=d({url:x,content:{f:"json"},handleAs:"json",callbackParamName:"callback"});v._pendingDfd.then(function(z){v.callback(z)},function(z){v.errback(z)});return v},_parseRasterInfo:function(x){var v=
new C;v.extent=new h(x.fullExtent);v.spatialReference=new t(x.spatialReference);this.tileType=x.cacheType||"Map";switch(this.tileType){case "Map":v.bandCount=3;v.pixelType="U8";this.dataType="Processed";break;case "Elevation":v.bandCount=1;v.pixelType=x.pixelType||"F32";this.dataType="Elevation";break;case "Raster":v.bandCount=null,v.pixelType=null,this.dataType=x.serviceDataType&&x.serviceDataType.replace("esriImageServiceDataType","")||"Generic"}var z=x.tileInfo;v.width=Math.floor((x.fullExtent.xmax-
x.fullExtent.xmin)/z.lods[z.lods.length-1].resolution+.5);v.height=Math.floor((x.fullExtent.ymax-x.fullExtent.ymin)/z.lods[z.lods.length-1].resolution+.5);v.cellSize=new p({x:z.lods[z.lods.length-1].resolution,y:z.lods[z.lods.length-1].resolution,spatialReference:x.spatialReference});this.tileInfo=new B(z);this.tileInfo.tileType=this.tileType;return v}});a("extend-esri")&&n.setObject("layers.rasterLib.raster.TileServiceRaster",H,e);return H})},"esri/layers/rasterLib/raster/TileRaster":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/Deferred dojo/_base/array dojo/_base/config dojo/_base/json dojo/sniff dojo/DeferredList dojo/when ../../../kernel ../../../Evented ../../../request ../../../geometry/Extent ../../../geometry/Point ../../../SpatialReference ../../../deferredUtils ../../../urlUtils ../../PixelBlock ../../rasterFormats/rasterCodec ../tile/RasterTileInfo ./RasterInfo ./BasicRaster".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G){H=k([G],{declaredClass:"esri.layers.rasterLib.raster.TileRaster",sourceType:"TileCache",_RECORD_SIZE:8,constructor:function(x){this._cloudBlobStorage=x&&x._cloudBlobStorage},open:function(){var x=new q,v=this.datasetInfo||this._getDatasetInfo(null),z=n.hitch(this,function(F){this.datasetInfo=F;this.rasterInfo=F=this._parseRasterInfo(F);this.tileType="Cache/LERC"===F.format?"Elevation":"Cache/MIXED"===F.format||"Cache/JPEG"===F.format||"Cache/PNG"===
F.format?"Map":"Raster";this.tileInfo=F.tileInfo;this.dataType=["Generic","Elevation","Processed"][["Raster","Elevation","Map"].indexOf(this.tileType)];this._HEADER_SIZE=F.packetSize*F.packetSize*this._RECORD_SIZE+64;this.loaded=!0;this._cloudBlobStorage=this._cloudBlobStorage||-1<this.url.toLowerCase().indexOf("s3.amazonaws.com")||-1<this.url.toLowerCase().indexOf("windows.net")||-1<this.url.toLowerCase().indexOf("googleapis.com");this._getRasterIdentifier();x.resolve(this)}),A=n.hitch(this,function(F){this.loaded=
!0;this._getRasterIdentifier();x.reject(F)});f(v,z,A);return x.promise},read:function(x){var v=new q,z=x.level,A=x.row,F=x.col,J=this._buildCacheFilePath(this.url,z,A,F),L=this._getIndexRecordFromBundle(z,A,F);d({url:J,content:{},headers:{Range:"bytes\x3d0-"+(this._HEADER_SIZE-1).toString()},handleAs:"arraybuffer"}).then(n.hitch(this,function(P,Q){if(!v.isCanceled()){console.log("time in ms request "+(new Date-Z));var Z=new Date;P=new Uint8Array(P);P=this._getTileEndAndContentType(P,L);Q={width:this.tileInfo.cols,
height:this.tileInfo.rows,planes:null,pixelType:null,format:null,decodeFunc:null,isPoint:"elevation"===this.tileType.toLowerCase()?!0:!1};this._requestPixels({url:J+(this.disableClientCaching?"?_ts\x3d "+(new Date).getTime():""),payload:{},headers:{Range:"bytes\x3d"+P.position.toString()+"-"+(P.position+P.recordSize).toString()},decodeParams:Q,tileOptions:x}).then(function(ca){v.isCanceled()||v.resolve(ca)},function(ca){v.isCanceled()||v.reject(ca)})}}));return v.promise},identify:function(){return null},
setFetchParameters:function(x,v){},toJson:function(){return{url:this.url,tileInfo:this.tileInfo.toJson(),rasterInfo:this.rasterInfo.toJson(),datasetInfo:this.datasetInfo,sourceType:this.sourceType,tileType:this.tileType,_rasterId:this._rasterId}},_getDatasetInfo:function(){return d({url:this.url+"/conf.json",handleAs:"json",content:{}})},_parseRasterInfo:function(x){var v=new C;switch(x.pixelType){case 1:var z="U1";break;case 1:z="U2";break;case 2:z="U4";break;case 3:z="U8";break;case 4:z="S8";break;
case 5:z="U16";break;case 6:z="S16";break;case 7:z="U32";break;case 8:z="S32";break;case 9:z="F32";break;default:z="F32"}var A,F=[],J=x.LODInfos;for(A=0;A<J.levels.length;A++)F.push({level:J.levels[A],resolution:J.resolutions[A],scale:96/.0254*J.resolutions[A]});A=new t(x.extent.spatialReference||x.geodataXform.spatialReference);F=new B({rows:x.blockHeight,cols:x.blockWidth,dpi:96,format:x.format,compressionQuality:0,origin:x.origin,spatialReference:A,lods:F});v.pixelType=z;v.bandCount=x.bandCount;
v.spatialReference=A;v.extent=new h({xmin:x.extent.xmin,ymin:x.extent.ymin,xmax:x.extent.xmax,ymax:x.extent.ymax,spatialReference:A});v.cellSize=new p({x:x.pixelSizeX,y:x.pixelSizeY,spatialReference:A});v.width=Math.floor((v.extent.xmax-v.extent.xmin)/v.cellSize.x+.5);v.height=Math.floor((v.extent.ymax-v.extent.ymin)/v.cellSize.y+.5);v.statistics=x.statistics.map(function(L){Object.keys(L).forEach(function(P){isNaN(L[P])&&(L[P]=null)});return L});v.histograms=x.histograms;v.geodataXform=x.geodataXform;
v.packetSize=x.packetSize;v.format=x.format;v.compressionQuality=x.compressionQuality;v.tileInfo=F;return v},_getRasterIdentifier:function(){this._rasterId||(this._rasterId=this.url.replace("http:","").replace("https:",""));return this._rasterId},_buildCacheFilePath:function(x,v,z,A){var F=this.rasterInfo.packetSize;A=Math.floor(A/F)*F;z="R"+this._toHexString4(Math.floor(z/F)*F)+"C"+this._toHexString4(A);F="L";F=10<=v?F+v.toString():F+("0"+v.toString());return this._cloudBlobStorage?x+"/_alllayers/"+
F+"/"+z+".bundle":x+"/"+F+"_"+z+"/bundle"},_getIndexRecordFromBundle:function(x,v,z){x=this.rasterInfo.packetSize;v=v%x*x+z%x;if(0>v)throw"Invalid level / row / col";return v*this._RECORD_SIZE+64},_getTileEndAndContentType:function(x,v){x=x.subarray(v,v+8);v=0;var z;for(z=0;5>z;z++)v|=(x[z]&255)<<8*z;var A=v&0xffffffffff;v=0;for(z=5;8>z;z++)v|=(x[z]&255)<<8*(z-5);return{position:A,recordSize:v&0xffffffffff}},_toHexString4:function(x){x=x.toString(16);if(4!=x.length)for(var v=4-x.length;0<v--;)x="0"+
x;return x}});a("extend-esri")&&n.setObject("layers.rasterLib.raster.TileRaster",H,e);return H})},"esri/layers/rasterLib/raster/FunctionRaster":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/Deferred dojo/_base/array dojo/_base/config dojo/_base/json dojo/sniff ../DeferredList2 dojo/when ../../../kernel ../../../Evented ../../../request ../../../deferredUtils ../../../geometry/Extent ../../../geometry/Point ../../../SpatialReference ../../../deferredUtils ../../../urlUtils ../../rasterFormats/rasterCodec ./RasterInfo ./BasicRaster ../../rasterLib/function/rasterFunctionHelper".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G){H=k([C],{declaredClass:"esri.layers.rasterLib.raster.FunctionRaster",rasterFunction:null,sourceType:"Function",constructor:function(x){x&&x.rasterFx&&this._init(x.rasterFx,x.rasterFxArgs)},open:function(){var x=this.getMemberRasters().map(function(z){return z.open()});this.identifiers=this.getMemberRasters().map(function(z){return z._rasterId});var v=new q;(new c(x,null,null,!0)).then(function(z){z.some(function(A){return!A[0]})?v.reject(z):
(this.rasterFunction.bind(),this.rasterInfo=this.rasterFunction.rasterInfo,this.dataType=this.rasterInfo.keyProperties&&this.rasterInfo.keyProperties.DataType||"Generic",this.tileInfo=z[0][1].tileInfo,v.resolve(this))}.bind(this));return v.promise},getProjectedFullExtent:function(x){var v=new q;this.getMemberRasters()[0].getProjectedFullExtent(x).then(n.hitch(this,function(z){this.projectedFullExtent=z;v.resolve(z)}));return v.promise},setProcessingContext:function(x){var v=x;x.layer&&(x=x.layer,
v={id:x.id,rawRasterInfo:x.raster.rasterInfo,glSetting:x._glSetting,xformSetting:x.tileManager&&x.tileManager.xformSetting,useWebGL:x.useWebGL,resampling:x.tileMode&&x.tileManager&&x.tileManager.xformSetting.requireProjection&&!x._hasTilingEffects&&"Thematic"!==x.raster.dataType?1:0,tileMode:x.tileMode});this.rasterFunction.setProcessingContext(v);this._layerOptions=v},alterDefinition:function(x){if(x=x||this.rasterFunction)1===this.memberRasters.length&&!x._bindComplete&&(this.rasterFunction=G.create(x,
{raster:this.memberRasters[0]}))&&(this.rasterFunction.bind(),this.rasterInfo=this.rasterFunction.rasterInfo,this.dataType=this.rasterInfo.keyProperties&&this.rasterInfo.keyProperties.DataType||"Generic",this.rasterFunction.setProcessingContext(this._layerOptions)),this._rasterHandler&&this._rasterHandler._connected&&this.rasterFunction&&this._rasterHandler.setRasterFunction({layerId:this._layerOptions.id,data:this.rasterFunction.toJson(!0)})},setFetchParameters:function(x,v){var z=this.getMemberRasters();
z&&1===z.length&&z[0].setFetchParameters(x,v)},getMemberRasters:function(){this.memberRasters||(this.memberRasters=[],this._getMemberRasters(this.rasterFunction.functionArguments,this.memberRasters));return this.memberRasters},read:function(x){var v=new q(h._dfdCanceller);if(x.src){var z=this.rasterFunction.read(x);v.resolve(z);return v.promise}var A=this.getMemberRasters().map(function(P){return P.read(x)});A=new c(A);var F,J,L=this.identifiers;v._pendingDfd=A;A.then(n.hitch(this,function(P){if(F=
P.some(function(Q){return Q[0]}))J={},P.forEach(function(Q,Z){J[L[Z]]=Q[0]?Q[1]:null});z=J?this.rasterFunction.read({extent:x.extent,src:J}):null;z.srcData=J;v.resolve(z)}));return v},_init:function(x,v){if(this.rasterFunction=G.create(x,v))this.rasterFunction._bindComplete=!0;else throw"Cannot initialize a function raster without a raster function";},_getMemberRasters:function(x,v){var z=Object.keys(x),A,F,J;for(A=0;A<z.length;A++)if(J=x[z[A]]){var L=J instanceof Array?J:[J];for(F=0;F<L.length;F++)(J=
L[F])&&("function"===typeof J||"object"===typeof J)&&J.read&&(J.functionArguments?this._getMemberRasters(J.functionArguments,v):J.sourceType&&"Function"!==J.sourceType&&(J._identifier=J._getRasterIdentifier(),v.some(function(P){return P._identifier===J._identifier})||v.push(J)))}return v}});a("extend-esri")&&n.setObject("layers.rasterLib.raster.FunctionRaster",H,e);return H})},"esri/layers/rasterLib/DeferredList2":function(){define(["dojo/DeferredList"],function(H){return function(k,n,q,m,l){this.list=
k;n=new H(k,n,q,m,l);var b=n.resolve.bind(n),a=n.cancel.bind(n);n.cancel=function(){k&&k.forEach(function(c){c.cancel&&c.cancel()});a.apply(this,arguments)}.bind(n);n.resolve=function(){this.isFulfilled()||b.apply(this,arguments)}.bind(n);return n}})},"esri/layers/rasterLib/tile/RasterTileManager":function(){define("dojo/_base/declare dojo/_base/lang dojo/Deferred dojo/when ../DeferredList2 ../../../geometry/Extent ../../../SpatialReference ../../../geometry/Point ../../PixelBlock ./RasterTileInfo ../raster/rasterProjectionHelper".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e){var g=function(d,h){var p;for(p=0;p<d.length;p++)if(h(d[p]))return p;return-1};return H(null,{declaredClass:"esri.layers.rasterLib.tile.RasterTileManager",count:null,fullBoundary:null,tileBoundary:null,tiles:null,resolution:null,virtual:!0,prefetchBufferSize:0,_progressiveGlobal:!1,_MAX_TILES:128,_defaultMatrixResolution:20,constructor:function(d){this.tiles=[];this.xformSetting={};this.mapSpatialReference=d&&d.mapSR;this.layer=d&&d.layer;this.identifiers=this.layer.raster.rasterFunction?
this.layer.raster.getMemberRasters().map(function(h){return h._rasterId}):[this.layer.raster._rasterId];(d=d&&d.tileInfo)&&this.setTileInfo(d)},setTileInfo:function(d){this.tileInfo=d;this.virtual=d.virtual;this.mapResolution=null;this.tiles.length=0;this.xformSetting.requireProjection=!this.virtual&&!this.mapSpatialReference.equals(this.tileInfo.spatialReference);this.xformSetting.requirePE=e.requirePE(this.mapSpatialReference,this.tileInfo.spatialReference);this.xformSetting.meshSize=this.xformSetting.requireProjection?
[this._defaultMatrixResolution,this._defaultMatrixResolution]:[1,1];this.halfWorldWidth=e.getHalfWorldWidth(d.spatialReference)},updateResolution:function(d,h){if(!(this.mapResolution&&d&&this._resolutionEqual(this.mapResolution.x,d.x)&&this._resolutionEqual(this.mapResolution.y,d.y))){this.resetTiles();var p=this.xformSetting.requireProjection;this.mapResolution=this.resolution=d;p&&(this.resolution=e.projectResolution(d,this.tileInfo.spatialReference,this.layer.projectedFullExtent||h));this._resolution=
this.resolution;d=this.resolution;if(!this.tileInfo.virtual){p=.75*Math.min(d.x,d.y)+.25*Math.max(d.x,d.y);if(p>=this.tileInfo.lods[0].resolution){var t=this.tileInfo.lods[0];this.ooe=!0}else{if(p<=this.tileInfo.lods[this.tileInfo.lods.length-1].resolution)t=this.tileInfo.lods[this.tileInfo.lods.length-1];else for(d=0;d<this.tileInfo.lods.length-1;d++)if(t=this.tileInfo.lods[d],h=this.tileInfo.lods[d+1],t.resolution>=p&&h.resolution<=p){t.resolution-p>p-h.resolution&&(t=h);break}this.ooe=!1}this.level=
t&&t.level;d=this.resolution=new a({x:t.resolution,y:t.resolution,spatialReference:this.tileInfo.spatialReference})}p=this.layer.raster.rasterInfo.extent;t=this.tileInfo.origin;h=this.tileInfo.cols;var w=this.tileInfo.rows;this.fullBoundary={rowStart:Math.floor((t.y-p.ymax)/d.y/w),rowEnd:Math.floor((t.y-p.ymin-d.y)/d.y/w),colStart:Math.floor((p.xmin-t.x)/d.x/h),colEnd:Math.floor((p.xmax-t.x-d.x)/d.x/h)};if(p=this.halfWorldWidth){w=Math.ceil(p/d.x/(h/2));var u=this.tileInfo.applyGCS360Transform?360:
p,r=Math.round(h-(u-t.x)/d.x%h);r===h&&(r=0);this.fullBoundary.colRange=w;this.fullBoundary.paddingRight=r;this.fullBoundary.paddingLeft=Math.round((w*h*d.x+t.x-u-(this.tileInfo.applyGCS360Transform?0:t.x+p))/d.x)}this.hasNewData=!0}},getXformGrid:function(){var d=this.mapExtent,h=this.layer._hasTilingEffects?this.extent:this.fullExtent,p=this.layer.getCurrentResolution(),t=JSON.stringify(d.toJson())+JSON.stringify(h.toJson());this._datumTransformationInitialized||(this._datumTransformationInitialized=
!0,this._datumTransformation=e.getDefaultDatumTransformationForDataset(this.layer.raster.rasterInfo.extent,d.spatialReference,!0));this._cachedExtentString&&this._cachedExtentString===t||(this._cachedExtentString=t,this._xformGrid=d=e.getProjectionOffsetGrid(d,h,p,this.tileInfo.applyGCS360Transform,this.halfWorldWidth,this._datumTransformation));d=this._xformGrid;this.xformSetting.meshSize=d&&d.size;return d},getWrapTimes:function(d){var h=e.getHalfWorldWidth(d.spatialReference);if(!h)return 0;var p=
2*h;h=this.tileInfo.applyGCS360Transform?0:-h;return Math.floor((d.xmax-h)/p)-Math.floor((d.xmin-h)/p)},normalizeCoordinate:function(d,h){if(!h)return 0;var p=2*h;if(0<d){for(;d>h;)d-=p;return d}for(;d<-h;)d+=p;return d},resetTiles:function(){this.tiles.forEach(k.hitch(this,function(d){d.fetch&&!d.fetch.isCanceled()&&d.fetch.cancel();d.update&&!d.update.isCanceled()&&d.update.cancel()}));this.tiles.length=0},updateExtent:function(d,h){this.mapExtent=this.extent=d;var p=this.xformSetting.requireProjection;
if(p){this.extent=e.project(d,this.tileInfo.spatialReference,this.tileInfo.applyGCS360Transform);if(!this.extent)return;this.extent.spatialReference=new b(this.extent.spatialReference.toJson())}this.updateResolution(h,d);var t=this.extent,w=this.tileInfo,u=w.cols,r=w.rows;h=this.resolution;var y=t;p=p?this.layer.raster.rasterInfo.extent:this.layer.raster.projectedFullExtent;this.ooe&&(y=this._getIntersect(t,p));var B=Math.floor((y.xmin-w.origin.x)/h.x/u)-this.prefetchBufferSize,C=Math.floor((y.xmax-
w.origin.x)/h.x/u)+this.prefetchBufferSize,G=null;d=this.getWrapTimes(d);var x=this.fullBoundary&&this.fullBoundary.colRange;d&&this.halfWorldWidth&&(C===B&&(G=B),C+=d*x);var v=this.halfWorldWidth&&this.tiles.length&&(d!==this.wrapTimes||G!==this._circlularColId);v&&(this._wrapSwitchCount=this._wrapSwitchCount?this._wrapSwitchCount+1:1);this.wrapTimes=d;this._circlularColId=G;var z=Math.floor((w.origin.y-y.ymax)/h.y/r)-this.prefetchBufferSize;G=Math.floor((w.origin.y-y.ymin)/h.y/r)+this.prefetchBufferSize;
this.tileBoundary={rowStart:z,rowEnd:G,colStart:B,colEnd:C};var A,F;((y=(G-z+1)*(C-B+1)>this._MAX_TILES||!this.virtual&&this._resolution.x>8*this.tileInfo.lods[0].resolution)||2<d||v)&&this.resetTiles();if(!(y||2<d)){v=this.tiles;y=!1;for(A=v.length-1;0<=A;A--){var J=v[A].row;var L=v[A].wrapCol;if(J<z||J>G||L<B||L>C)v[A].fetch&&!v[A].fetch.isCanceled()&&v[A].fetch.cancel(),v[A].update&&!v[A].update.isCanceled()&&v[A].update.cancel(),v.splice(A,1),y=!0}for(A=z;A<=G;A++)for(F=B;F<=C;F++){z=new l(w.origin.x+
h.x*u*F,w.origin.y-h.y*r*(A+1),w.origin.x+h.x*u*(F+1),w.origin.y-h.y*r*A,t.spatialReference);var P=d&&x?0<=F?F%x:x- -F%x:F;J=g(v,function(Q){return Q.row===A&&Q.col===P&&Q.wrapCol===F});L=p.xmax>=z.xmax?u:Math.round((p.xmax-z.xmin)/h.x);-1===J&&(v.push({row:A,col:P,wrapCol:F,cellsizeX:h.x,cellsizeY:h.y,width:u,height:r,actualWidth:L,extent:z,normalizedExtent:this._wrapExtent(z,P),pixelBlock:null,virtual:this.virtual,level:this.level,tileType:this.tileInfo.tileType||"Raster"}),y=!0)}y&&this._sortTiles();
h=this.tileInfo.rows*(this.tileBoundary.rowEnd-this.tileBoundary.rowStart+1);this.width=this.tileInfo.cols*(this.tileBoundary.colEnd-this.tileBoundary.colStart+1);this.height=h;this.count=v.length;h=Math.min.apply(null,v.map(function(Q){return Q.extent.xmin}));w=Math.max.apply(null,v.map(function(Q){return Q.extent.xmax}));u=Math.min.apply(null,v.map(function(Q){return Q.extent.ymin}));r=Math.max.apply(null,v.map(function(Q){return Q.extent.ymax}));h=this.fullExtent=new l(h,u,w,r,t.spatialReference);
if(this.layer.roaming||this.layer.useWebGL)this.layer._hasTilingEffects?(this.xformSetting.offset=[0,0],this.xformSetting.scale=[1,1]):(y&&(this._tilesChanged=!0),this.xformSetting.offset=[(t.xmin-h.xmin)/(h.xmax-h.xmin),-(h.ymin-t.ymin)/(h.ymax-h.ymin)],this.xformSetting.scale=[(t.xmax-t.xmin)/(h.xmax-h.xmin),(t.ymax-t.ymin)/(h.ymax-h.ymin)])}},fetchTiles:function(d){(this._tilesChanged||d)&&this._fetchTiles(d)},_fetchTiles:function(d){this._fetchCounter=0;var h=this.extent;this.fetchAllCompleted=
d?new n:null;(this._tilesChanged||d&&this.layer._hasTilingEffects)&&this.tiles.forEach(k.hitch(this,function(t){t.updateCompleted=!1}));var p={};!this.layer.roaming&&this.layer._hasTilingEffects&&d?(this.identifiers.forEach(function(t,w){p[t]={extent:this.extent,pixelBlock:new c({width:this.layer._map.width,height:this.layer._map.height,pixels:[],pixelType:"",mask:null,statistics:[]})}}.bind(this)),this.originalPixelData={extent:this.extent,src:p,isEmpty:!0}):this._tilesChanged&&(this.identifiers.forEach(function(t,
w){p[t]={extent:this.fullExtent,pixelBlock:new c({width:128,height:128,pixels:[],pixelType:"",mask:null,statistics:[]})}}.bind(this)),this.originalPixelData={extent:this.fullExtent,src:p,isEmpty:!0});this.tiles.forEach(k.hitch(this,function(t){if(t.fetch)t.update||(t.update=this.updateTile(t));else{if(this._isTileOutSide(t,h)){t.updateCompleted=!0;return}this._requestTile(t)}this.layer.roaming&&this.layer.useWebGL?this._fillPixelData(t):t.src&&d&&(this.layer._hasTilingEffects||this.layer.useWebGL)&&
(this._fillPixelData(t),this.layer._hasTilingEffects&&(t.updateCompleted=!0),t.processedPixelBlock=null,t.renderedPixelBlock=null)}));0===this._fetchCounter&&(this._fetched=!0);this._tilesChanged=!1;d&&this._updateFetchStatus()},updateTile:function(d,h){var p=new n;if(!d.src&&!d.fetch)return p.resolve(d),p.promise;q(d.src||d._fetched||d.fetch,k.hitch(this,function(){var t=this.layer.tileMode&&this.layer._rasterHandler&&!(this.layer._hasTilingEffects||this.layer.useWebGL),w=this.layer._drawTile,u=
this._validateRawPixelBlocks(d);this.layer._hasTilingEffects&&!this.layer.useWebGL&&(w=w&&(this._progressiveGlobal||h));if((h||!h&&u)&&(t||w||this.layer.roaming)){if(this.xformSetting.requireProjection&&this.layer.useWebGL&&(this.xformSetting.gridConfig=this.getXformGrid(),null==this.xformSetting.gridConfig))return p.cancel(),p.promise;this._processTile(d,h).then(k.hitch(this,function(r){p.isCanceled()||this._renderTile(r,h).then(k.hitch(this,function(y){this.hasNewData=!1;p.isCanceled()||p.resolve(y)}))}))}else h||
u||(d.updateCompleted=!0),this.layer.useWebGL||this.layer._hasTilingEffects?p.resolve(this.originalPixelData):p.resolve()}));return p.promise},setLayer:function(d){this.layer=d},fillupTiles:function(){this.tiles.forEach(k.hitch(this,function(d){d.update&&d.updateCompleted&&!d.filled&&(d.updateCompleted=!1,this._fillPixelData(d),d.updateCompleted=!0)}))},_validateRawPixelBlocks:function(d){return d&&d.src&&!this.identifiers.some(function(h){return!(d.src[h].pixelBlock&&0!==d.src[h].pixelBlock.validPixelCount&&
d.src[h].pixelBlock.pixels&&0<d.src[h].pixelBlock.pixels.length)})},_wrapExtent:function(d,h){if(d){if(this.tileInfo.applyGCS360Transform){var p=this.normalizeCoordinate(d.xmin,180);0>p&&(p+=360);return new l({xmin:p,ymin:d.ymin,xmax:d.xmax-d.xmin+p,ymax:d.ymax,spatialReference:d.spatialReference})}if(this.halfWorldWidth){p=null!=h?new l({xmin:this.tileInfo.origin.x+this.tileInfo.cols*h*this.resolution.x,ymin:d.ymin,xmax:this.tileInfo.origin.x+this.tileInfo.cols*(h+1)*this.resolution.x,ymax:d.ymax,
spatialReference:d.spatialReference}):new l({xmin:d.xmin,ymin:d.ymin,xmax:d.xmax,ymax:d.ymax,spatialReference:d.spatialReference});h=this.normalizeCoordinate(p.xmin,this.halfWorldWidth);var t=h-p.xmin;.01<Math.abs(t)&&(p.xmin=h,p.xmax+=t)}return p||d}},_getIntersect:function(d,h){return new l(Math.max(d.xmin,h.xmin),Math.max(d.ymin,h.ymin),Math.min(d.xmax,h.xmax),Math.min(d.ymax,h.ymax),d.spatialReference)},_isTileOutSide:function(d,h){var p=!1;if(d.virtual){var t=d.normalizedExtent;if(h=h||(this.xformSetting.requireProjection?
this.layer.raster.rasterInfo.extent:this.layer.raster.projectedFullExtent)){d=t.xmin-this.prefetchBufferSize*this.tileInfo.cols*this.resolution.x;p=t.ymin-this.prefetchBufferSize*this.tileInfo.rows*this.resolution.y;var w=t.xmax+this.prefetchBufferSize*this.tileInfo.cols*this.resolution.x;t=t.ymax+this.prefetchBufferSize*this.tileInfo.rows*this.resolution.y;p=w<=h.xmin||d>=h.xmax||t<=h.ymin||p>=h.ymax}else p=!1}else p=0>d.level||d.row<this.fullBoundary.rowStart||d.row>this.fullBoundary.rowEnd||d.col<
this.fullBoundary.colStart||d.col>this.fullBoundary.colEnd;return p},_resolutionEqual:function(d,h){return d===h||d&&h&&Math.abs(d-h)<Math.abs(h/1E4)?!0:!1},_requestTile:function(d){var h=this.identifiers,p;if(this._isTileOutSide(d)){var t=new n;d.updateCompleted=!0;t.resolve(null);t=t.promise}else t=this.layer.raster.rasterFunction?new m(this.layer.raster.getMemberRasters().map(function(w){return w.read(d)})):new m([this.layer.raster.read(d)]);d.fetch=t;this._fetchCounter++;q(d.src||d._fetched||
t,k.hitch(this,function(w){if(p=w&&w.some(function(r){return r[0]})){var u={};w.forEach(function(r,y){u[h[y]]=r[0]&&r[1]?{extent:r[1].extent,pixelBlock:r[1].pixelBlock,width:r[1].width,height:r[1].height}:null});d.src=u}else d.src=null;this._fetchCounter--;0===this._fetchCounter&&(this._fetched=!0);d._fetched=!0;this._updateFetchStatus()}),k.hitch(this,function(){this._fetchCounter--;0===this._fetchCounter&&(this._fetched=!0);d._fetched=!0;this._updateFetchStatus()}));d.update=this.updateTile(d)},
_updateFetchStatus:function(){this.layer._drawTile&&this.fetchAllCompleted&&!this.fetchAllCompleted.isResolved()&&!this.tiles.some(function(d){return!d._fetched})&&(this.tiles.forEach(k.hitch(this,function(d){this._fillPixelData(d)})),this.fetchAllCompleted.resolve())},_fillPixelData:function(d,h){if(d&&!d.updateCompleted)if(Math.abs(d.cellsizeX-this.resolution.x)>d.cellsizeX/10)d.updateCompleted=!0;else if(!1===this._validateRawPixelBlocks(d))d.updateCompleted=!0;else{var p=d.extent;if(this.layer.roaming||
this.layer.useWebGL&&!this.layer._hasTilingEffects){var t=this.fullExtent;var w=this.tileInfo.cols*(this.tileBoundary.colEnd-this.tileBoundary.colStart+1);var u=this.tileInfo.rows*(this.tileBoundary.rowEnd-this.tileBoundary.rowStart+1);h?this.originalPixelData.renderedPixelBlock||(this.originalPixelData.renderedPixelBlock=new c({width:w,height:u,pixels:[],pixelType:"",mask:null,statistics:[]})):this.identifiers.forEach(k.hitch(this,function(y){this.originalPixelData.src[y].pixelBlock.width=w;this.originalPixelData.src[y].pixelBlock.height=
u}))}else t=this.extent,w=this.layer._map.width,u=this.layer._map.height,h?this.originalPixelData.renderedPixelBlock||(this.originalPixelData.renderedPixelBlock=new c({width:w,height:u,pixels:[],pixelType:"",mask:null,statistics:[]})):this.identifiers.forEach(k.hitch(this,function(y){this.originalPixelData.src[y].pixelBlock.width=w;this.originalPixelData.src[y].pixelBlock.height=u}));if(t.xmax<=p.xmin||t.xmin>=p.xmax||t.ymax<=p.ymin||t.ymin>=p.ymax)return null;var r=this.originalPixelData.isEmpty=
!1;this.identifiers.forEach(k.hitch(this,function(y){d.src&&(this._fillPixelBlock(d.src[y],this.originalPixelData.src[y],{extent:t,width:w,height:u,normalizedExtent:d.normalizedExtent},!1),r=!0)}));d.filled=r;this.hasNewData=!0}},_fillPixelBlock:function(d,h,p,t){var w=d.extent,u=p.extent;t=p.width;var r=p.height;if(d.pixelBlock&&d.pixelBlock.pixels&&d.pixelBlock.pixels[0]){var y=(w.xmax-w.xmin)/d.width,B=Math.max(w.xmin,u.xmin),C=Math.min(w.ymax,u.ymax),G=Math.round((B-w.xmin)/y),x=d.width-Math.round(Math.abs(w.xmax-
Math.min(w.xmax,u.xmax))/y),v=Math.round(Math.abs(w.ymax-C)/y),z=d.height-Math.round((Math.max(w.ymin,u.ymin)-w.ymin)/y),A=this.halfWorldWidth;B=Math.round((B-u.xmin)/y);p=p.normalizedExtent;if(!(this.wrapTimes&&A&&w.xmin<-A)){if(this.wrapTimes&&A){if(this.tileInfo.applyGCS360Transform)360<w.xmin&&(B-=this.fullBoundary.paddingLeft);else if(w.xmin>A){B-=this.fullBoundary.paddingLeft;var F=this.normalizeCoordinate(w.xmin,A);var J=this.normalizeCoordinate(w.xmax,A)}else F=w.xmin,J=w.xmax;this.tileInfo.applyGCS360Transform?
p&&360>p.xmin&&360<p.xmax&&(x-=this.fullBoundary.paddingRight):p&&p.xmin<A&&p.xmax>A?x-=this.fullBoundary.paddingRight:F<A&&J>A&&(x-=this.fullBoundary.paddingRight)}F=Math.round(Math.abs(u.ymax-C)/y);J=d.pixelBlock.pixels.length;h=h.pixelBlock;p=d.width;w=h.mask||new Uint8Array(t*r);var L=d.pixelBlock,P=L.mask,Q=0;for(y=0;y<J;y++){C=L.pixels[y];A=h.pixels[y]||new C.constructor(t*r);for(d=v;d<z;d++)for(Q=(F+d-v)*t+B,u=G;u<x;u++)A[Q+u-G]=C[d*p+u];h.pixels[y]=A}if(P)for(d=v;d<z;d++)for(Q=(F+d-v)*t+B,
u=G;u<x;u++)w[Q+u-G]=P[d*p+u];else for(d=v;d<z;d++)for(Q=(F+d-v)*t+B,u=G;u<x;u++)w[Q+u-G]=1;h.pixelType=h.pixelType||L.pixelType;h.mask=w;if(!(h.statistics&&0<h.statistics.length))for(h.statistics=[],d=0;d<L.statistics.length;d++)h.statistics[d]={minValue:L.statistics[d].minValue,maxValue:L.statistics[d].maxValue};else if(L.statistics&&h.statistics)for(d=0;d<h.statistics.length;d++)h.statistics[d].minValue=Math.min(L.statistics[d].minValue,h.statistics[d].minValue),h.statistics[d].maxValue=Math.max(L.statistics[d].maxValue,
h.statistics[d].maxValue)}}},_processTile:function(d,h){var p=new n,t=this.layer._hasTilingEffects,w=this.layer.useWebGL,u=t||w,r=this.layer.raster.rasterFunction&&d&&(t||w||!d.processedPixelBlock);if(h)var y=d;else this._fillPixelData(d),y=u?this.originalPixelData:d;this.xformSetting.hasNewTexture=this.hasNewData;var B;r?(this.identifiers.forEach(function(C){if(0===y.src[C].pixelBlock.pixels.length||0===y.src[C].pixelBlock.pixels[0].length)B=!0}),B?p.resolve({extent:y.extent,processedPixelBlock:y.src[this.identifiers[0]],
pixelBlock:y.src[this.identifiers[0]]}):w?(this.processedPixelData=this.layer.raster.rasterFunction.read(y),p.resolve(this.processedPixelData)):this.layer._rasterHandler?this.layer._rasterHandler.process({extent:y.extent,src:y.src}).then(function(C){t?(this.processedPixelData=C,p.resolve(this.processedPixelData)):(d.processedPixelBlock=C.pixelBlock,p.resolve(d))}):(h=this.layer.raster.rasterFunction.read(d),d.processedPixelBlock=h.pixelBlock,p.resolve(d))):u?p.resolve(y.src[this.identifiers[0]]):
(d.pixelBlock=y.src[this.identifiers[0]]&&y.src[this.identifiers[0]].pixelBlock,p.resolve(d));return p.promise},_renderTile:function(d){var h=new n,p=this.layer._hasTilingEffects,t=this.layer.useWebGL,w=Math.abs((d.extent.xmax-d.extent.xmin)/d.width-this.layer.getCurrentResolution().x)>this.resolution.x/10;w=this.layer.useWebGL&&(w||this._isTileOutSide(d,this.layer._map.extent));this.xformSetting.hasNewTexture=this.hasNewData;this.layer._rasterRenderer&&d&&(d.texture||d.src||d.pixelBlock||d.processedPixelBlock)?
(this.layer._rasterRenderer.interpolation=this.layer.interpolation,t&&!w?(this.layer.raster.rasterFunction&&this.layer.raster.rasterFunction.renderTexture||this.layer._rasterRenderer.draw(d),h.resolve(d)):this.layer._rasterHandler?this.layer._rasterHandler.render({extent:d.extent,pixelBlock:d.processedPixelBlock||d.pixelBlock}).then(function(u){p?(u.renderedPixelBlock=u.pixelBlock,h.resolve(u)):(d.renderedPixelBlock=u.pixelBlock,h.resolve(d))}.bind(this)):(d.renderedPixelBlock=this.layer._rasterRenderer.draw(d).pixelBlock,
h.resolve(d))):(d.renderedPixelBlock=d.processedPixelBlock||d.pixelBlock,h.resolve(d));return h.promise},_sortTiles:function(){this.tiles.sort(function(d,h){return d.row<h.row||d.row==h.row&&d.col<h.col?-1:1})}})})},"esri/dijit/RasterFunctionEditor/utils":function(){define("dojo/_base/lang dojo/_base/url dojo/has dojo/on dojo/Deferred dojo/_base/array ../../kernel ../../request ../../lang ../../config ../../layers/ArcGISImageServiceLayer ../../layers/ImageServiceParameters ../../layers/MosaicRule ../../layers/RasterFunction ../../tasks/Geoprocessor ../../tasks/JobInfo ../../renderers/colorUtils ../../renderers/colorRampUtils".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u){function r(z){if(z){var A=l.map([z.FromColor,z.ToColor],function(F){F=w.toRGB({h:F.Hue,s:F.Saturation,v:F.Value});return[F.r,F.g,F.b]});return{fromColor:A[0],toColor:A[1],type:"algorithmic",algorithm:z.Algorithm}}}function y(z){if(z)return z=w.toHSV(w.getDojoColor(z)),{type:"HsvColor",Hue:z.h,Saturation:z.s,Value:z.v,AlphaValue:255}}function B(z){if(z){var A=z.toJson?z.toJson():void 0;return{Algorithm:A&&A.Algorithm||"esriHSVAlgorithm",type:"AlgorithmicColorRamp",
FromColor:y(z.fromColor),ToColor:y(z.toColor)}}}var C={},G,x,v;H.mixin(C,{fetchRFT:function(z,A,F,J,L){var P=new m;var Q=(Q=(Q=z.name)&&Q.slice(-8))&&".rft.xml"===Q.toLowerCase();return z&&z.itemDataUrl?Q?L?this.convertRFT({url:L+"/ConvertRasterFunctionTemplate",rft:{itemId:z.id},format:"json"},A,J,F):(F("errorUtilitiesServiceNotAvailable"),P.reject(Error("errorUtilitiesServiceNotAvailable")),P.promise):a({url:z.itemDataUrl,callbackParamName:"callback",content:{f:"json"},handleAs:"json",load:A,error:F}).then(J):
(F("errorRetrievingRFTItem"),P.reject(Error("errorRetrievingRFTItem")),P.promise)},convertRFT:function(z,A,F,J){var L=z.url,P=function(){v&&(v.remove(),v=null);x&&(x.remove(),x=null)};G||(G=new p(L),q(G,"error",P));x=q(G,"job-complete",function(Q){x&&(x.remove(),x=null);Q.jobInfo.jobStatus!==t.STATUS_SUCCEEDED?(P(),J(Q)):G.getResultData(Q.jobInfo.jobId,"outputRasterFunction")});v=q(G,"get-result-data-complete",function(Q){v&&(v.remove(),v=null);var Z=Q&&Q.result&&Q.result.value;Z&&Z.url&&(Q={url:Z.url,
handleAs:"json",load:F,error:J},Z=(new k(Z.url)).authority,-1===f.defaults.io.corsEnabledServers.indexOf(Z)&&f.defaults.io.corsEnabledServers.push(Z),a(Q))});z={inputRasterFunction:JSON.stringify(z.rft),format:z.format};return G.submitJob(z,A,null,J)},getRasterJsonFromLayer:function(z){if(!z)return null;var A=z.url;A&&0<A.indexOf("?token\x3d")&&(A=A.slice(0,A.indexOf("?token\x3d")));var F=z.credential||A&&b.id.findCredential(A);c.isDefined(F)&&(A=A+"?token\x3d"+F.token,F.referer&&(A+=F.referer));
A={url:A,name:z.name};z.renderingRule&&(A.renderingRule=z.renderingRule.toJson?z.renderingRule.toJson():z.renderingRule);z.mosaicRule&&(A.mosaicRule=z.mosaicRule.toJson?z.mosaicRule.toJson():z.mosaicRule);return A},getLayerIdfromRasterValue:function(z,A){if(z&&A){var F;l.some(A,function(J){if(J&&J.url===z.url&&J.name===z.name&&z.name)return F=J.id,!0});return F}},getColorRampFromArg:function(z){if(z){var A;if(z.type&&-1<z.type.toLowerCase().indexOf("colorramp"))var F=z;else z.value&&-1<z.value.type.toLowerCase().indexOf("colorramp")&&
(F=z.value);if(F)return z=F.type.toLowerCase(),"multipartcolorramp"===z?A=u.fromJson({type:"multipart",colorRamps:l.map(F.ArrayOfColorRamp,function(J){return r(J)})}):"algorithmiccolorramp"===z&&(A=u.fromJson(r(F))),A.id=A.name=F.Name,A}},getRFxArgColorRampValue:function(z){if(z){if(z.fromColor&&z.toColor)return H.mixin(B(z),{Name:z.name});if(z.colorRamps){var A=l.map(z.colorRamps,B);return{type:"MultiPartColorRamp",NumColorRamps:A.length,ArrayOfColorRamp:A,Name:z.name}}}},RFX_VARIABLE_TYPE:"RasterFunctionVariable",
RFX_TEMPLATE_TYPE:"RasterFunctionTemplate",ARGUMENT_ARRAY_TYPE:"ArgumentArray",getArgRFT:function(z){if(z){if("RasterFunctionTemplate"===z.type)return z;if(z.value&&"RasterFunctionTemplate"===z.value.type)return z.value}},getEnumData:function(z,A,F){if(Array.isArray(z))return z.forEach(function(J){J.key=J.key.toString()}),z},getImageServiceTitle:function(z){z=z.split("/");return z[z.length-2]},isReferencedObject:function(z){if(z&&c.isDefined(z._object_ref_id))return!0},functionTypes:{local:"LocalFunction",
gpAdapter:"GPAdapterFunction",pythonAdapter:"PythonAdapterFunction"},defaultRasterNodeProps:{name:"Raster",isDataset:!0,isPublic:!1,type:"RasterFunctionVariable"},getArcGISImageServiceLayerItem:function(z){if(z){z=H.clone(z);z.name||(z.name=this.getImageServiceTitle(z.url));var A=new g;z.mosaicRule&&(A.mosaicRule=new d(z.mosaicRule));z.renderingRule&&(A.renderingRule=new h(z.renderingRule));A=new e(z.url,{id:z.name+(new Date).toString(),imageServiceParameters:A});A.name=z.name;return A}},filterMDInfoIfMosiacRuleIsSet:function(z){var A=
H.clone(z.multidimensionalInfo),F=[],J=z.mosaicRule&&z.mosaicRule.multidimensionalDefinition;if(J&&0<J.length){var L=A.variables.filter(function(P){return J[0].variableName===P.name}.bind(this));if(!L||0===L.length)return A;L=L[0];F=H.clone(L);F.dimensions=[];J.forEach(function(P){var Q=L.dimensions.filter(function(fa){return P.dimensionName===fa.name}.bind(this));if(Q&&0!==Q.length){var Z=(Q=Q[0])&&Q.values,ca=0,da=1,ea=P.values&&P.values.length;switch(P.values&&P.values[0].length||ea){case 1:ca=
Z.indexOf(P.values[0]);da=ca+1;break;case 2:ca=Z.indexOf(P.values[0][0]),da=Z.indexOf(P.values[0][1])+1}Z=Z.slice(ca,da);Q.values=Z;F.dimensions.push(Q)}else F.dimensions=H.clone(L.dimensions)}.bind(this));A.variables=[F]}return A}});n("extend-esri")&&H.setObject("dijit.RasterFunctionEditor.utils",C,b);return C})},"esri/dijit/analysis/storageUtils":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/Deferred dojo/promise/all dojo/has dojo/json ../../request ../../kernel".split(" "),
function(H,k,n,q,m,l,b,a,c){k={MAX_RESOURCES:10,checkResourceLimit:!0,_getItemUrl:function(f){var e=f.folderId||f.ownerFolder;return this._portalUrl+"/sharing/rest/content/users/"+f.owner+"/"+(e?e+"/":"")+"/items/"+f.id},addToItemResource:function(f,e){this._portalUrl=e.portalUrl;delete e.portalUrl;f=this._getItemUrl(f);f+="/addResources";e={filename:e.jobInfo.jobId+".json",text:b.stringify(e),resourcesPrefix:"jobs",f:"json"};return a({url:f,content:e},{usePost:!0})},getItemResource:function(f,e){e&&
e.portalUrl&&(this._portalUrl=e.portalUrl);f=this._getItemUrl(f);f+="/resources/"+e.resource;return a({url:f,content:{f:"json"}})},removeItemResource:function(f,e){e&&e.portalUrl&&(this._portalUrl=e.portalUrl);f=this._getItemUrl(f);return a({url:f+"/removeResources",content:{resource:e.resource,deleteAll:e.deleteAll,f:"json"}},{usePost:!0})},addToStorage:function(f){if(window.sessionStorage){var e=window.sessionStorage.getItem("esri_analysis_jobhistory");e=e?b.parse(e):[];e.push(f);window.sessionStorage.setItem("esri_analysis_jobhistory",
b.stringify(e))}},addAllToStorage:function(f){window.sessionStorage&&window.sessionStorage.setItem("esri_analysis_jobhistory",b.stringify(f))},removeFromStorage:function(f){if(window.sessionStorage){var e=window.sessionStorage.getItem("esri_analysis_jobhistory");e&&(e=b.parse(e));e=H.filter(e,function(g){return g.jobInfo&&g.jobInfo.jobId!==f.jobInfo.jobId});window.sessionStorage.setItem("esri_analysis_jobhistory",b.stringify(e))}},removeAllFromStorage:function(){window.sessionStorage&&window.sessionStorage.removeItem("esri_analysis_jobhistory")},
getJobsInfoList:function(){var f;window.sessionStorage&&(f=window.sessionStorage.getItem("esri_analysis_jobhistory"))&&(f=b.parse(f));return f},addItemResources:function(f,e){var g=this.getJobsInfoList(),d=[];H.forEach(g,function(h){h.portalUrl=e.portalUrl;var p=new q;d.push(p);this.addToItemResource(f,h).then(n.hitch(this,function(t){t&&!0===t.success&&(this.removeFromStorage(h),p.resolve(t))}))},this);return m(d)},saveJobsQueue:function(f,e){var g=this.getJobsInfoList(),d=new q;g&&0<g.length&&this.removeResourceQueue(f,
e).then(n.hitch(this,function(){if(g.length>this.MAX_RESOURCES){for(this.sortJobsInfoList(g,{asc:!1});g.length>this.MAX_RESOURCES;)g.pop();this.addAllToStorage(g)}this.addItemResources(f,e).then(n.hitch(this,function(h){d.resolve(h)}),n.hitch(this,function(h){d.reject(h)}))}),n.hitch(this,function(h){d.reject(h)}));return d.promise},saveJobsInfoList:function(f,e){return this.checkResourceLimit?this.saveJobsQueue(f,e):this.addItemResources(f,e)},getResources:function(f,e){e&&e.portalUrl&&(this._portalUrl=
e.portalUrl);f=this._getItemUrl(f);return a({url:f+"/resources",content:{f:"json"}})},getResourcesInfo:function(f,e){var g=[],d=new q;this.sortResources(f,e).then(n.hitch(this,function(h){H.forEach(h.resources,function(p){e.resource=p.resource;g.push(this.getItemResource(f,e))},this);m(g).then(n.hitch(this,function(p){d.resolve(p)}),n.hitch(this,function(p){d.reject(p)}))}),n.hitch(this,function(h){d.reject(h)}));return d.promise},sortJobsInfoList:function(f,e){f.sort(n.hitch(this,function(g,d){return e.asc?
g.timestamp-d.timestamp:d.timestamp-g.timestamp}))},sortResources:function(f,e){var g=new q;this.getResources(f,e).then(n.hitch(this,function(d){d.resources&&0<d.resources.length&&d.resources.sort(n.hitch(this,function(h,p){return e.asc?h.created-p.created:p.created-h.created}));g.resolve(d)}),n.hitch(this,function(d){g.reject(d)}));return g.promise},removeResourceQueue:function(f,e){var g=new q,d=[];var h=this.getJobsInfoList().length;var p=this.MAX_RESOURCES-h;p=0<p?p:0;e.asc=!0;this.sortResources(f,
e).then(n.hitch(this,function(t){if(t&&t.resources&&0<t.resources.length)if(0===p){var w=t.resources.shift();e.resource=w.resource;e.deleteAll=!0;d.push(this.removeItemResource(f,e));t.resources=[]}else for(;t.resources.length>p;)w=t.resources.shift(),e.resource=w.resource,d.push(this.removeItemResource(f,e));m(d).always(n.hitch(this,function(){g.resolve(t)}))}),n.hitch(this,function(t){g.reject(t)}));return g.promise}};l("extend-esri")&&n.setObject("dijit.analysis.storageUtils",k,c);return k})},
"esri/dijit/analysis/_AnalysisOptions":function(){define("dojo/_base/declare dojo/_base/lang dojo/dom-attr dojo/_base/json dojo/dom-class dojo/dom-construct dojo/dom-style dojo/aspect dojo/has dojo/_base/array dojo/_base/window dojo/on dojo/query dojo/number ./Settings ./SettingsViewModel ./utils ./mixins/browselayers/BrowseLayerMixin ./mixins/FilterAndSelection dijit/Dialog dijit/form/NumberTextBox dojo/i18n!../../nls/jsapi ../../lang ../../kernel".split(" "),function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,
p,t,w,u,r,y,B,C,G,x){H=H([u,r],{declaredClass:"esri.dijit.analysis._AnalysisOptions",showSelectFolder:!1,showChooseExtent:!0,showHelp:!0,showCredits:!0,returnFeatureCollection:!1,showCloseIcon:!0,showSelectAnalysisLayer:!0,map:null,showReadyToUseLayers:!0,showAnalysisBusyIndicator:!0,showGeoAnalyticsParams:!1,showBrowseLayers:!1,showAnalysisModeLabel:!1,distanceDefaultUnits:"Miles",showSettings:!1,showOutputType:!1,context:{},includeRouteLayers:!1,doSaveJobInfo:!1,doSaveInStorage:!1,showCreditCalcBusyIndicator:!0,
useArcGISComponents:!1,isServerAdvanceLicensed:!0,constructor:function(v){v.rerun&&this._initRerunProps(v)},isAdmin:function(v){return G.isDefined(v.role)&&("org_admin"===v.role||"account_admin"===v.role)},isOwner:function(v,z){return v.owner?v.owner===z.id:v.userId?v.userId===z.username:v.credential?v.credential.userId===z.username:!0},_initRerunProps:function(v){v.OutputName&&v.OutputName.serviceProperties?v.outputLayerName=v.OutputName.serviceProperties.name:v.resultName&&(v.outputLayerName=v.resultName);
v.timeStepReference&&(v.timeReference=v.timeStepReference);this.set("extentCheck",v.extentCheck);this._numberFormatHandle=a.before(B,"_setValueAttr",function(z,A,F){z=h.format(z);return[z,A,F]});this.on("close",k.hitch(this,function(){this._numberFormatHandle&&(this._numberFormatHandle.remove(),this._numberFormatHandle=null)}))},_setShowSelectFolderAttr:function(v){!0===v&&v===this.get("returnFeatureCollection")&&(v=!v);this.showSelectFolder=v;this._webMapFolderSelect&&this._webMapFolderSelect.set("required",
v);this._chooseFolderRow&&b.set(this._chooseFolderRow,"display",!0===this.showSelectFolder?"block":"none");v&&this._webMapFolderSelect&&this.getFolderStore().then(k.hitch(this,function(z){this.folderStore=z;w.setupFoldersUI({folderStore:this.folderStore,folderId:this.folderId,folderName:this.folderName,folderSelect:this._webMapFolderSelect,username:this.portalUser?this.portalUser.username:""})}))},_getShowSelectFolderAttr:function(){return this.showSelectFolder},_setShowChooseExtentAttr:function(v){this.showChooseExtent=
v},_getShowChooseExtentAttr:function(){return this.showChooseExtent},_setExtentCheckAttr:function(v){this.extentCheck=v;G.isDefined(this._useExtentCheck)&&G.isDefined(v)&&this._useExtentCheck.set("checked",v)},_setMapAttr:function(v){this.map=v},_getMapAttr:function(){return this.map},_setShowHelpAttr:function(v){this.showHelp=v},_getShowHelpAttr:function(){return this.showHelp},_setReturnFeatureCollectionAttr:function(v){this.returnFeatureCollection=v;this.set("showSelectFolder",!v)},_getReturnFeatureCollectionAttr:function(){return this.returnFeatureCollection},
_setShowCreditsAttr:function(v){(this.showCredits=v)&&this._showCreditsLink&&this._usageForm&&(this._onCreditsClickHandle=g.pausable(this._showCreditsLink,"click",k.hitch(this,this._handleShowCreditsClick)))},_getShowCreditsAttr:function(){return this.showCredits},_setShowCloseIconAttr:function(v){this.showCloseIcon=v},_getShowCloseIconAttr:function(){return this.showCloseIcon},_setShowSelectAnalysisLayerAttr:function(v){this.showSelectAnalysisLayer=v;this._analysisSelect&&this._analysisSelect.set("required",
v)},_getShowSelectAnalysisLayerAttr:function(){return this.showSelectAnalysisLayer},_setIsSingleTenantAttr:function(v){this.isSingleTenant=v},_getIsSingleTenantAttr:function(){return this.isSingleTenant},_setAllowChooseLabelAttr:function(v){this.allowChooseLabel=v},_getAllowChooseLabelAttr:function(){return this.allowChooseLabel},_setTitleAttr:function(v){this.title=v;this._toolTitle&&n.set(this._toolTitle,"innerHTML",v)},_getTitleAttr:function(){return this.title=n.get(this._toolTitle,"innerHTML")},
_setShowReadyToUseLayersAttr:function(v){this.showReadyToUseLayers=v},_getShowReadyToUseLayersAttr:function(v){return this.showReadyToUseLayers},_setFolderIdAttr:function(v){this.folderId=v},_getFolderIdAttr:function(){this._webMapFolderSelect&&this.folderStore&&(this.folderId=this._webMapFolderSelect.item?this.folderStore.getValue(this._webMapFolderSelect.item,"id"):"");return this.folderId},_setFolderNameAttr:function(v){this.folderName=v},_getFolderNameAttr:function(){this._webMapFolderSelect&&
this.folderStore&&this._webMapFolderSelect.item&&(this.folderName=this.folderStore.getValue(this._webMapFolderSelect.item,"name"));return this.folderName},_setHelperServicesAttr:function(v){this.helperServices=v},_getHelperServicesAttr:function(v){return this.helperServices},_getPortalSelfAttr:function(){return this.portalSelf},_setPortalSelfAttr:function(v){this.portalSelf=v},_setShowAnalysisBusyIndicatorAttr:function(v){v&&this.own(this.on("start",k.hitch(this,function(){this.showLoadingIndicator()})),
this.on("job-fail, job-result, job-cancel",k.hitch(this,function(){this.hideLoadingIndicator()})),this.on("job-status",k.hitch(this,function(z){"esriJobFailed"===z.jobStatus&&this.hideLoadingIndicator()})))},_setShowGeoAnalyticsParamsAttr:function(v){this.showGeoAnalyticsParams=v},_getShowGeoAnalyticsParamsAttr:function(){return this.showGeoAnalyticsParams},_setShowBrowseLayersAttr:function(v){this.showBrowseLayers=v},_getShowBrowseLayersAttr:function(){return this.showBrowseLayers},showLoadingIndicator:function(){this.get("showAnalysisBusyIndicator")&&
(this._saveBtn.set("iconClass","esriLoading"),this.set("disableRunAnalysis",!0))},hideLoadingIndicator:function(){this.get("showAnalysisBusyIndicator")&&(this._saveBtn.set("iconClass",""),this.set("disableRunAnalysis",!1))},_setDistanceDefaultUnitsAttr:function(v){this.distanceDefaultUnits=v},_getDistanceDefaultUnitsAttr:function(){return this.distanceDefaultUnits},_setAnalysisModeAttr:function(v){this.analysisMode=v},_setShowAnalysisModeLabelAttr:function(v){this.showAnalysisModeLabel=v;this._titleLbl&&
this._analysisModeLblNode&&(b.set(this._titleLbl,"display",this.showAnalysisModeLabel?"none":"block"),b.set(this._analysisModeLblNode,"display",this.showAnalysisModeLabel?"flex":"none"),this.showAnalysisModeLabel&&("standard"===this.analysisMode?this.analysisModeLabel=this.i18n.standard:"bigdata"===this.analysisMode||this.showGeoAnalyticsParams?this.analysisModeLabel=this.i18n.bigData:"raster"===this.analysisMode&&(this.analysisModeLabel=this.i18n.raster),n.set(this._analysisModeCrumb,"innerHTML",
this.analysisModeLabel)))},_getTimeReferenceAttr:function(){if(this._timeRefDay){var v="",z="",A="";var F=this._timeRefDay.get("value");var J=this._timeRefTime.get("value");F&&(v=F.toDateString(),A="Date");J&&(z=J.toTimeString(),A="DateTime");this.set("timeReferenceType",A);F=z&&-1!==z.indexOf("GMT")?v+" "+z.substring(0,z.indexOf("GMT")+3):z?v+" "+z.split(" ")[0]+" GMT":v+" GMT";this.timeReference=(new Date(F)).getTime()}return this.timeReference},_setTimeReferenceAttr:function(v){v=new Date(v+6E4*
(new Date(v)).getTimezoneOffset());this._timeRefDay&&this._timeRefDay.set("value",v);this._timeRefTime&&"DateTime"===this.timeReferenceType&&this._timeRefTime.set("value",v)},_setTimeReferenceTypeAttr:function(v){this.timeReferenceType=v},_setSLayersAttr:function(v){this.sLayers=v},_setContextAttr:function(v){this.context=v},_setIncludeRouteLayersAttr:function(v){this.includeRouteLayers=v},_getIncludeRouteLayersAttr:function(){return this.includeRouteLayers},_setShowSettingsAttr:function(v){this.showSettings=
v;var z=this.analysisMode&&("raster"===this.analysisMode||"bigdata"===this.analysisMode),A="ClassifyPixelsUsingDeepLearning DetectObjectsUsingDeepLearning ClassifyObjectsUsingDeepLearning CalculateSlope DeriveAspect MonitorVegetation ApplyRFxTemplate RemapValues ExtractRaster AggregateMultidimensionalRaster GenerateMultidimensionalAnomaly GenerateTrendRaster PredictUsingTrendRaster FindArgumentStatistics Sample ConvertFeatureToRaster".split(" "),F=["ClassifyPixelsUsingDeepLearning","DetectObjectsUsingDeepLearning",
"ClassifyObjectsUsingDeepLearning"],J=this.analysisMode&&"raster"===this.analysisMode;A=J&&-1!==A.indexOf(this.toolName)&&this.isSingleTenant;var L=J&&-1!==F.indexOf(this.toolName);F=L&&this.isSingleTenant;var P=J&&"Sample"===this.toolName,Q=-1!==["DetectObjectsUsingDeepLearning","ClassifyObjectsUsingDeepLearning"].indexOf(this.toolName),Z=-1!=="SummarizeRasterWithin ZonalStatisticsAsTable CalculateDensityRaster InterpolatePointsEBK CreateViewshedRaster Watershed ConvertRasterToFeature Sample".split(" ").indexOf(this.toolName),
ca=-1!=="CalculateDistance DetermineOptimumTravelCostNetwork DetermineTravelCostPathAsPolyline OptimalPathAsLine OptimalPathAsRaster DistanceAllocation DistanceAccumulation OptimalRegionConnections".split(" ").indexOf(this.toolName),da=J&&!Q&&!P;P=J&&!P;L=J&&!Z&&!L&&!ca;Z=J&&!this.isSingleTenant;v&&(w.settingsDlg||(v=e.doc.createDocumentFragment(),v=l.create("div",{style:"width:200px;height:200px;"},v),ca=f.filter(this.sLayers,function(ea){return ea.type?"Table"!==ea.type:!0}),w.settingsVM=new t({showHelp:!0,
showCloseIcon:!1,showOverwriteResultOption:!1,showCloseAnalysisOption:!0,showStoreAnalysisOption:!0,showCoordinateSystems:this.analysisMode&&("raster"===this.analysisMode&&!Q||"bigdata"===this.analysisMode),showProcessSR:this.analysisMode&&"bigdata"===this.analysisMode,showOutSR:da,showExtent:!0,showRasterSettings:J,showGeoAnalyticsSettings:this.analysisMode&&"bigdata"===this.analysisMode,showRasterPPFSettings:A,showRasterPTSettings:F,showRasterSnapSettings:da,showCellsizeSettings:P,showResamplingSettings:L,
showCreditWarningSettings:Z,showHeader:!1,layers:ca,showJobsHistory:!1,jobsHistoryItem:null}),this.signInPromise.then(k.hitch(this,function(){w.settingsVM.set("portalUrl",this.portalUrl)})),w.settings=new p({viewModel:w.settingsVM},v),this.i18n||(this.i18n={},k.mixin(this.i18n,C.common),k.mixin(this.i18n,C.analysisTools),k.mixin(this.i18n,C.analysisMsgCodes),k.mixin(this.i18n,C.analysisSettings)),w.settingsDlg=new y({title:this.i18n.analysisEnv,content:w.settings,style:"width:400px;"}),w.settingsDlg.own(w.settings.on("ok-settings",
k.hitch(this,function(){w.settingsDlg.hide()})),w.settings.on("cancel-settings",k.hitch(this,function(){w.settingsDlg.hide()})))),w.settingsDlg&&(w.settingsVM.set("showRasterSettings",J),w.settingsVM.set("showGeoAnalyticsSettings",this.analysisMode&&"bigdata"===this.analysisMode),w.settingsVM.set("showCoordinateSystems",this.analysisMode&&("raster"===this.analysisMode&&!Q||"bigdata"===this.analysisMode)),w.settingsVM.set("showProcessSR",this.analysisMode&&"bigdata"===this.analysisMode),w.settingsVM.set("showOutSR",
da),w.settingsVM.set("showRasterPPFSettings",A),w.settingsVM.set("showRasterPTSettings",F),w.settingsVM.set("showRasterSnapSettings",da),w.settingsVM.set("showCellsizeSettings",P),w.settingsVM.set("showResamplingSettings",L),w.settingsVM.set("showCreditWarningSettings",Z),this.domNode&&d("[esriHelpTopic\x3d'toolDescription']",this.domNode).forEach(k.hitch(this,function(ea){ea&&(this._settingsLink=l.create("a",{href:"#","class":"esriAnalysisSettingsIcon"},ea,"before"),g(this._settingsLink,"click",
k.hitch(this,this._handleSettingsLinkClick)))})),this._settingWatchers||(this._settingWatchers=!0,J=this.get("context"),w.settingsVM.extent&&(J.extent=w.settingsVM.extent,this._useExtentCheck&&this._useExtentCheck.set("checked",!1)),w.settingsVM.outSR&&(J.outSR=w.settingsVM.outSR),w.settingsVM.processSR&&(J.processSR=w.settingsVM.processSR),w.settingsVM.extent&&(J.extent=w.settingsVM.extent,this._useExtentCheck&&this._useExtentCheck.set("checked",!1)),w.settingsVM.cellSize&&(J.cellSize=w.settingsVM.cellSize),
w.settingsVM.mask&&(J.mask=w.settingsVM.mask),w.settingsVM.snapRaster&&(J.snapRaster=w.settingsVM.snapRaster),w.settingsVM.processorType&&(J.processorType=w.settingsVM.processorType),w.settingsVM.parallelProcessingFactor&&(J.parallelProcessingFactor=w.settingsVM.parallelProcessingFactor),w.settingsVM.recycleProcessingWorkers&&(J.recycleProcessingWorkers=w.settingsVM.recycleProcessingWorkers),w.settingsVM.retryOnFailures&&(J.retryOnFailures=w.settingsVM.retryOnFailures),w.settingsVM.resamplingMethod&&
(J.resamplingMethod=w.settingsVM.resamplingMethod),this.set("returnFeatureCollection",!z&&w.settingsVM.returnFeatureCollection),this._updateContextDatastore(J,w.settingsVM.datastore),this.set("context",J),w.settingsVM.watch("outSR",k.hitch(this,function(ea,fa,K){if(ea=this.get("context"))ea.outSR=K,this.set("context",ea)})),w.settingsVM.watch("processSR",k.hitch(this,function(ea,fa,K){if(ea=this.get("context"))ea.processSR=K,this.set("context",ea)})),w.settingsVM.watch("extent",k.hitch(this,function(ea,
fa,K){if(ea=this.get("context"))ea.extent=K,this.set("context",ea);this._useExtentCheck&&this._useExtentCheck.set("checked",!G.isDefined(K))})),w.settingsVM.watch("cellSize",k.hitch(this,function(ea,fa,K){if(ea=this.get("context"))ea.cellSize=K,this.set("context",ea)})),w.settingsVM.watch("mask",k.hitch(this,function(ea,fa,K){if(ea=this.get("context"))ea.mask=K,this.set("context",ea)})),w.settingsVM.watch("snapRaster",k.hitch(this,function(ea,fa,K){if(ea=this.get("context"))ea.snapRaster=K,this.set("context",
ea)})),w.settingsVM.watch("returnFeatureCollection",k.hitch(this,function(ea,fa,K){this.set("returnFeatureCollection",!(this.analysisMode&&("raster"===this.analysisMode||"bigdata"===this.analysisMode))&&K)})),w.settingsVM.watch("datastore",k.hitch(this,function(ea,fa,K){if(ea=this.get("context"))this._updateContextDatastore(ea,K),this.set("context",ea)})),w.settingsVM.watch("processorType",k.hitch(this,function(ea,fa,K){if(ea=this.get("context"))ea.processorType=K,this.set("context",ea)})),w.settingsVM.watch("parallelProcessingFactor",
k.hitch(this,function(ea,fa,K){if(ea=this.get("context"))ea.parallelProcessingFactor=K,this.set("context",ea)})),w.settingsVM.watch("recycleProcessingWorkers",k.hitch(this,function(ea,fa,K){if(ea=this.get("context"))ea.recycleProcessingWorkers=K,this.set("context",ea)})),w.settingsVM.watch("retryOnFailures",k.hitch(this,function(ea,fa,K){if(ea=this.get("context"))ea.retryOnFailures=K,this.set("context",ea)})),w.settingsVM.watch("resamplingMethod",k.hitch(this,function(ea,fa,K){if(ea=this.get("context"))ea.resamplingMethod=
K,this.set("context",ea)})))))},_updateContextDatastore:function(v,z){v&&z&&(z&&-1===["BDS","GDB"].indexOf(z)?v.dataStore=z:v.dataStore=null,setTimeout(k.hitch(this,function(){this.set("showSelectFolder",this.showGeoAnalyticsParams?!v.dataStore:this.showSelectFolder)}),0))},_setShowOutputTypeAttr:function(v){this.showOutputType=v},_setDoSaveJobInfoAttr:function(v){this.doSaveJobInfo=v},_setDoSaveInStorageAttr:function(v){this.doSaveInStorage=v},_getResultNameAttr:function(v){this.resultName="";this.outputLayerInput?
this.resultName=this.outputLayerInput.get("value"):this._outputLayerInput&&(this.resultName=this._outputLayerInput.get("value"));return this.resultName},_setArcadeEditorAttr:function(v){this.arcadeEditor=v},_setShowCreditCalcBusyIndicatorAttr:function(v){var z=[];this.showCredits&&this._showCreditsLink&&this._usageForm&&(v?(z.push(a.before(this,"_handleShowCreditsClick",k.hitch(this,function(){var A=this._form&&this._form.validate();"DeriveNewLocations"===this.toolName||"FindExistingLocations"===
this.toolName?A=A&&this.expressionGrid.validate():"EnrichLayer"==this.toolName&&(A=A&&this.validateSelectedGrid());A?this._pauseCreditLinkClick(this._onCreditsClickHandle,!0):this._pauseCreditLinkClick(this._onCreditsClickHandle,!1)}))),z.push(a.after(this._usageForm,"_setContentAttr",k.hitch(this,function(){this._pauseCreditLinkClick(this._onCreditsClickHandle,!1)}))),z.push(a.after(this._usageForm,"_setErrorContentAttr",k.hitch(this,function(){this._pauseCreditLinkClick(this._onCreditsClickHandle,
!1)})))):z.forEach(function(A){A.remove();A=null}))},_setuseArcGISComponentsAttr:function(v){this.useArcGISComponents=v},_getuseArcGISComponentsAttr:function(v){return this.useArcGISComponents},_setIsServerAdvanceLicensedAttr:function(v){this.isServerAdvanceLicensed=v},_getIsServerAdvanceLicensedAttr:function(){return this.isServerAdvanceLicensed},_handleSettingsLinkClick:function(){this.showSettingsDlg()},showSettingsDlg:function(v){v&&v.preventDefault();this._hasPCSWarnShown&&this.showGeoAnalyticsParams&&
this._errorMessagePane&&w.hideMessages(this._errorMessagePane);w.settingsDlg.show()},_handleModeCrumbClick:function(v){v.preventDefault();this._onClose(!1)},_onFocus:function(){this.map&&"function"===typeof this.map.disableKeyboardNavigation&&this.map.disableKeyboardNavigation();this.emit("focus");this.inherited(arguments)},_onBlur:function(){this.map&&"function"===typeof this.map.enableKeyboardNavigation&&this.map.enableKeyboardNavigation();this.emit("blur");this.inherited(arguments)},_handleAtrrValueUpdate:function(v,
z,A){"0"!==A&&(v=this.get("statisticSelect"),(A=this.getOptions(A))&&A.type&&w.addStatisticsOptions({selectWidget:v,type:A.type,showGeoAnalyticsParams:this.showGeoAnalyticsParams}))},_pauseCreditLinkClick:function(v,z){z?(v.pause(),b.set(this._showCreditsLink,{color:"grey",cursor:"none"}),m.add(this._showCreditsLink,"esriAnalysisTextDisabled esriLoadingBar2")):(v.resume(),b.set(this._showCreditsLink,{color:"#21759B",cursor:"pointer"}),m.remove(this._showCreditsLink,"esriAnalysisTextDisabled esriLoadingBar2"))},
constructAnalysisInputLyrObj:function(v,z){z=G.isDefined(z)?z:this.isSingleTenant;return w.constructAnalysisInputLyrObj(v,z,!this.showGeoAnalyticsParams)},_addBarrierstoJobParams:function(v,z){v instanceof Object&&(z.pointBarrierLayer&&(v.pointBarrierLayer=q.toJson(this.constructAnalysisInputLyrObj(z.pointBarrierLayer))),z.lineBarrierLayer&&(v.lineBarrierLayer=q.toJson(this.constructAnalysisInputLyrObj(z.lineBarrierLayer))),z.polygonBarrierLayer&&(v.polygonBarrierLayer=q.toJson(this.constructAnalysisInputLyrObj(z.polygonBarrierLayer))));
return v}});c("extend-esri")&&k.setObject("dijit.analysis._AnalysisOptions",H,x);return H})},"esri/dijit/analysis/Settings":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/Color dojo/_base/json dojo/has dojo/json dojo/string dojo/dom-style dojo/dom-attr dojo/dom-construct dojo/query dojo/dom-class dojo/NodeList dojo/NodeList-dom dojo/_base/fx dojo/fx/easing dojo/promise/all dojo/Evented dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dijit/_OnDijitClickMixin dijit/_FocusMixin dijit/registry dijit/form/Button dijit/form/CheckBox dijit/form/Form dijit/form/Select dijit/form/TextBox dijit/form/NumberTextBox dijit/form/ToggleButton dijit/form/ValidationTextBox dijit/layout/ContentPane dijit/form/FilteringSelect dijit/Dialog dijit/ConfirmDialog dojox/mvc/at dgrid1/OnDemandGrid dgrid1/Tree dgrid1/Editor dgrid1/Keyboard dgrid1/Selection dgrid1/Selector dgrid1/extensions/ColumnResizer dgrid1/extensions/DijitRegistry ../../kernel ../../lang ../../geometry/Extent ../../SpatialReference ../../layers/ArcGISImageServiceLayer ./_Widget ./utils ./SettingsViewModel ./JobsList ./components/DataStoreSelect dojo/i18n!../../nls/jsapi dojo/text!./templates/Settings.html".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G,x,v,z,A,F,J,L,P,Q,Z,ca,da,ea,fa,K,V,aa,Y,I,O,E,N,R,W,ha,oa,ma,T,ba,na,ia,pa,D,M,X,U){var ka=k([aa,O,E,N,I,Y,R,W]);H=na.createSubclass([C,G,x,v],{declaredClass:"esri.dijit.analysis.Settings",templateString:U,widgetsInTemplate:!0,i18n:null,toolName:"Settings",helpFileName:"AnalysisEnvironments",viewModelType:pa,cssClass:{primaryButton:"btn calcite blue",button:"btn calcite"},constructor:function(S,ja){this._pbConnects=[];S.containerNode&&(this.container=
S.containerNode);this.cssClass=n.mixin({},this.cssClass)},destroy:function(){this.inherited(arguments);q.forEach(this._pbConnects,m.disconnect);delete this._pbConnects},postMixInProperties:function(){this.inherited(arguments);this.i18n={};n.mixin(this.i18n,X.common);n.mixin(this.i18n,X.analysisSettings);this._initModelWatchers()},postCreate:function(){this.inherited(arguments);this.viewModel.showOkCancel&&(this._state={});this.initUI()},startup:function(){this._spatialRefGrid.startup()},initUI:function(){this._rasterUX=
[this._snapLblRow,this._snapSelRow,this._rasterLblRow,this._cellLblRow,this._cellSelectRow,this._cellSelectNumRow,this._maskLblRow,this._maskSelRow];this._extentUX=[this._processExtLblRow,this._extentLblRow,this._extentRow];this._coordSysUX=[this._processSRRow,this._processSRLblRow,this._outSRLblRow,this._outSRRow,this._coordinateLblRow];this._geoanalyticsUX=[this._geoanalyticsLblRow,this._datastoreLabelRow,this._selectDataStore];this._rasterPPFUX=[this._parallelProcessingLblRow,this._parallelProcessingFactorLblRow,
this._parallelProcessingFactorNumRow,this._recycleProcessingWorkersLblRow,this._recycleProcessingWorkersNumRow,this._retryOnFailuresLblRow,this._retryOnFailuresNumRow];this._rasterPTUX=[this._processorLblRow,this._processorTypeLblRow,this._processorTypeSelRow];this._rasterStorageUX=[this._storageLblRow,this._resamplingMethodLblRow,this._resamplingMethodSelRow];ia.initHelpLinks(this.domNode,this.viewModel.showHelp);ia.updateDisplay(this._rasterUX,this.viewModel.showRasterSettings,"table-row");ia.updateDisplay([this._overwriteRow],
this.viewModel.showOverwriteResultOption,"table-row");ia.updateDisplay([this._closeAnalysisRow],this.viewModel.showCloseAnalysisOption,"table-row");ia.updateDisplay([this._storeAnalysisRow],this.viewModel.showStoreAnalysisOption,"table-row");ia.updateDisplay(this._coordSysUX,this.viewModel.showCoordinateSystems,"table-row");ia.updateDisplay([this._processSRRow,this._processSRLblRow],this.viewModel.showProcessSR,"table-row");ia.updateDisplay([this._outSRLblRow,this._outSRRow],this.viewModel.showOutSR,
"table-row");ia.updateDisplay([this._coordinateLblRow],this.viewModel.showProcessSR||this.viewModel.showProcessSR,"table-row");ia.updateDisplay(this._extentUX,this.viewModel.showExtent,"table-row");ia.updateDisplay([this._closeDiv],this.viewModel.showCloseIcon,"block");ia.updateDisplay([this._settingsHeader],this.viewModel.showHeader,"block");ia.updateDisplay([this._actionbuttonCtr],this.viewModel.showOkCancel,"block");ia.updateDisplay(this._geoanalyticsUX,this.viewModel.showGeoAnalyticsSettings,
"table-row");ia.updateDisplay(this._rasterPPFUX,this.viewModel.showRasterPPFSettings,"table-row");ia.updateDisplay(this._rasterPTUX,this.viewModel.showRasterPTSettings,"table-row");ia.updateDisplay([this._maskLblRow,this._maskSelRow],this.viewModel.showRasterSettings&&!this.viewModel.showRasterPTSettings,"table-row");ia.updateDisplay([this._snapLblRow,this._snapSelRow],this.viewModel.showRasterSnapSettings,"table-row");ia.updateDisplay([this._cellLblRow,this._cellSelectRow,this._cellSelectNumRow],
this.viewModel.showCellsizeSettings,"table-row");ia.updateDisplay(this._rasterStorageUX,this.viewModel.showResamplingSettings,"table-row");ia.updateDisplay([this._creditWarningRow],this.viewModel.showCreditWarningSettings,"table-row");this._spatialRefGrid||(this._spatialRefGrid=new ka({collection:this.viewModel.spatialRefStore,id:this.id+"_settingsgrid",showHeader:!1,columns:[{renderExpando:!0,label:"Name",field:"name",sortable:!1,resizable:!0}],"class":"esriAnalysisSpatialRefTree"},this._spatialRefGridNode),
h(".dijitButton",this._coordDialog.domNode).forEach(function(S,ja){0===ja?p.add(S,this.cssClass.primaryButton):p.add(S,this.cssClass.button)},this));this.viewModel.outSR&&this._outSRInput.set("value",this.viewModel.outSR.wkid);this.viewModel.processSR&&this._processSRInput.set("value",this.viewModel.processSR.wkid);this.viewModel.layers&&this._updateLayerOptions(this.viewModel.layers);this._updateProcessSRSelectValue();this._handleProcessSRSelectChange(this._processSRSelect.get("value"));this._updateOutSRSelectValue();
this._handleSRSelectChange(this._outSRSelect.get("value"));this._updateExtentSelectValue();this._handleExtentOptionChange(this._extentSelect.get("value"));this._updateCellSizeSelectValue();this._handleCellSizeSelectChange(this._cellSizeSelect.get("value"));this._updateSnapRasterSelectValue();this._handleSnapRasterSelectChange(this._snapRasterSelect.get("value"));this._updateMaskSelectValue();this._handleMaskSelectChange(this._maskSelect.get("value"));this._updateProcessorTypeSelectValue();this._handleProcessorTypeSelectChange(this._processorTypeSelect.get("value"));
this._updateparallelProcessingFactorInputValue();this._handleparallelProcessingFactorInputChange(this._parallelProcessingFactorInput.get("value"));this._updaterecycleProcessingWorkersInputValue();this._handlerecycleProcessingWorkersInputChange(this._recycleProcessingWorkersInput.get("value"));this._updateretryOnFailuresInputValue();this._handleretryOnFailuresInputChange(this._retryOnFailuresInput.get("value"));this._updateResamplingMethodSelectValue();this._handleResamplingMethodSelectChange(this._resamplingMethodSelect.get("value"));
this._closeAnalysisCheck.set("checked",this.viewModel.closeAnalysisWidget);this._storeAnalysisCheck.set("checked",!this.viewModel.returnFeatureCollection);this._creditWarningCheck.set("checked",this.viewModel.creditWarning);this.viewModel.showJobsHistory&&this.buildJobsUI();this.viewModel.showGeoAnalyticsSettings&&this.buildDataStoreUI();this._handleCloseMsg()},_initModelWatchers:function(){this.own(this.viewModel.watch("showCloseIcon",n.hitch(this,function(S,ja,la){ia.updateDisplay([this._closeDiv],
la,"block")})),this.viewModel.watch("showHelp",n.hitch(this,function(S,ja,la){ia.initHelpLinks(this.domNode,la)})),this.viewModel.watch("showOverwriteResultOption",n.hitch(this,function(S,ja,la){ia.updateDisplay([this._overwriteRow],la,"table-row")})),this.viewModel.watch("showCloseAnalysisOption",n.hitch(this,function(S,ja,la){ia.updateDisplay([this._closeAnalysisRow],la,"table-row")})),this.viewModel.watch("showStoreAnalysisOption",n.hitch(this,function(S,ja,la){ia.updateDisplay([this._storeAnalysisRow],
la,"table-row")})),this.viewModel.watch("showCoordinateSystems",n.hitch(this,function(S,ja,la){ia.updateDisplay(this._coordSysUX,la,"table-row")})),this.viewModel.watch("showProcessSR",n.hitch(this,function(S,ja,la){ia.updateDisplay([this._processSRRow,this._processSRLblRow],la,"table-row");ia.updateDisplay([this._coordinateLblRow],la||this.viewModel.showOutSR,"table-row");this._updateProcessSRSelectValue();this._handleProcessSRSelectChange(this._processSRSelect.get("value"))})),this.viewModel.watch("showOutSR",
n.hitch(this,function(S,ja,la){ia.updateDisplay([this._outSRLblRow,this._outSRRow],la,"table-row");ia.updateDisplay([this._coordinateLblRow],la||this.viewModel.showProcessSR,"table-row");this._updateOutSRSelectValue();this._handleSRSelectChange(this._outSRSelect.get("value"))})),this.viewModel.watch("showExtent",n.hitch(this,function(S,ja,la){ia.updateDisplay(this._extentUX,la,"table-row");this._updateExtentSelectValue();la&&this._handleExtentOptionChange(this._extentSelect.get("value"))})),this.viewModel.watch("showRasterSettings",
n.hitch(this,function(S,ja,la){ia.updateDisplay(this._rasterUX,la,"table-row");this._updateCellSizeSelectValue();this._handleCellSizeSelectChange(this._cellSizeSelect.get("value"));this._updateSnapRasterSelectValue();this._handleSnapRasterSelectChange(this._snapRasterSelect.get("value"));this._updateMaskSelectValue();this._handleMaskSelectChange(this._maskSelect.get("value"));this._updateResamplingMethodSelectValue();this._handleResamplingMethodSelectChange(this._resamplingMethodSelect.get("value"))})),
this.viewModel.watch("showRasterPPFSettings",n.hitch(this,function(S,ja,la){ia.updateDisplay(this._rasterPPFUX,la,"table-row");this._updateparallelProcessingFactorInputValue();this._handleparallelProcessingFactorInputChange(this._parallelProcessingFactorInput.get("value"));this._updaterecycleProcessingWorkersInputValue();this._handlerecycleProcessingWorkersInputChange(this._recycleProcessingWorkersInput.get("value"));this._updateretryOnFailuresInputValue();this._handleretryOnFailuresInputChange(this._retryOnFailuresInput.get("value"))})),
this.viewModel.watch("showRasterPTSettings",n.hitch(this,function(S,ja,la){ia.updateDisplay(this._rasterPTUX,la,"table-row");ia.updateDisplay([this._maskLblRow,this._maskSelRow],!la&&this.viewModel.showRasterSettings,"table-row");this._updateProcessorTypeSelectValue();this._handleProcessorTypeSelectChange(this._processorTypeSelect.get("value"))})),this.viewModel.watch("showRasterSnapSettings",n.hitch(this,function(S,ja,la){ia.updateDisplay([this._snapLblRow,this._snapSelRow],la,"table-row");this._updateparallelProcessingFactorInputValue();
this._handleSnapRasterSelectChange(this._snapRasterSelect.get("value"))})),this.viewModel.watch("showCellsizeSettings",n.hitch(this,function(S,ja,la){ia.updateDisplay([this._cellLblRow,this._cellSelectRow,this._cellSelectNumRow],la,"table-row")})),this.viewModel.watch("layers",n.hitch(this,function(S,ja,la){this._updateLayerOptions(this.viewModel.layers)})),this.viewModel.watch("showHeader",n.hitch(this,function(S,ja,la){ia.updateDisplay([this._settingsHeader],la,"block")})),this.viewModel.watch("showOkCancel",
n.hitch(this,function(S,ja,la){ia.updateDisplay([this._actionbuttonCtr],la,"block")})),this.viewModel.watch("showGeoAnalyticsSettings",n.hitch(this,function(S,ja,la){ia.updateDisplay(this._geoanalyticsUX,la,"table-row");la&&this.buildDataStoreUI()})),this.viewModel.watch("isCustomProcessSR",n.hitch(this,function(){this._updateProcessSRSelectValue();this._handleProcessSRSelectChange(this._processSRSelect.get("value"))})),this.viewModel.watch("isCustomExtent",n.hitch(this,function(){this._updateExtentSelectValue();
this._handleExtentOptionChange(this._extentSelect.get("value"))})),this.viewModel.watch("isCustomOutSR",n.hitch(this,function(){this._updateOutSRSelectValue();this._handleSRSelectChange(this._outSRSelect.get("value"))})),this.viewModel.watch("closeAnalysisWidget",n.hitch(this,function(S,ja,la){this._handleCloseAnalysisCheck(la)})),this.viewModel.watch("returnFeatureCollection",n.hitch(this,function(S,ja,la){this._handleReturnFeatureCollectionCheck(la)})),this.viewModel.watch("showJobsHistory",n.hitch(this,
this.buildJobsUI)),this.viewModel.watch("jobsViewModel",n.hitch(this,this.buildJobsUI)),this.viewModel.watch("showResamplingSettings",n.hitch(this,function(S,ja,la){ia.updateDisplay(this._rasterStorageUX,la,"table-row")})),this.viewModel.watch("showCreditWarningSettings",n.hitch(this,function(S,ja,la){ia.updateDisplay([this._creditWarningRow],la,"table-row")})))},buildJobsUI:function(){ia.updateDisplay([this._settingsNavCtrl],this.viewModel.showJobsHistory,"block");p.toggle(this._form.domNode,"tab-contents tab-section is-active",
this.viewModel.showJobsHistory);p.toggle(this._jobHistoryCtr,"tab-contents tab-section",this.viewModel.showJobsHistory);p.toggle(this.domNode,"esri-analysis-category",this.viewModel.showJobsHistory);this.viewModel.showJobsHistory&&(this._addTabHandlers||(h(".tab-nav a",this.domNode).on("click",n.hitch(this,function(S){S.stopPropagation();h(".tab-title",this.domNode).removeClass("is-active");p.add(S.target,"is-active");S=p.contains(S.target,"general-tab");ia.updateDisplay([this._form.domNode],S,"block");
ia.updateDisplay([this._jobHistoryCtr],!S,"block")})),this._addTabHandlers=!0),this.buildJobsList())},buildJobsList:function(){this.viewModel.jobsViewModel&&!this._jobsListWidget&&(this._jobsListWidget=new D({viewModel:this.viewModel.jobsViewModel},this._jobsListDiv))},buildDataStoreUI:function(){this._dataStoreSelect||(this._dataStoreSelect=new M({geoAnalyticsServer:this.viewModel.geoAnalyticsServer,value:this.viewModel.get("datastore")},d.create("div",null,this._dataStoreTd)),this._dataStoreSelect.startup(),
this._dataStoreSelect.on("change",n.hitch(this,this._handleDSSelectChange)))},_updateExtentSelectValue:function(){if(this.viewModel.get("isCustomExtent"))this._extentSelect.set("value","SPECIFIED");else if(this.viewModel.viewProps&&this.viewModel.viewProps.extentLayer&&this._layerNames){var S=q.indexOf(this._layerNames,this.viewModel.viewProps.extentLayer.name);this._extentSelect.set("value","LAYER_"+S)}else this._extentSelect.set("value","DEFAULT");this.viewModel.get("isCustomExtent")&&this.viewModel.extent&&
(this._xMinInput.set("value",this.viewModel.extent.xmin),this._xMaxInput.set("value",this.viewModel.extent.xmax),this._yMinInput.set("value",this.viewModel.extent.ymin),this._yMaxInput.set("value",this.viewModel.extent.ymax))},_updateProcessSRSelectValue:function(){this.viewModel.processSR&&this.viewModel.get("isCustomProcessSR")&&this._processSRInput.set("value",this.viewModel.processSR.wkid);if(this.viewModel.get("isCustomProcessSR"))this._processSRSelect.set("value","SPECIFIED");else if(this.viewModel.viewProps&&
this.viewModel.viewProps.pSRLayer&&this._layerNames){var S=q.indexOf(this._layerNames,this.viewModel.viewProps.pSRLayer.name);this._processSRSelect.set("value","LAYER_"+S)}else this._processSRSelect.set("value","DEFAULT")},_updateOutSRSelectValue:function(){this.viewModel.outSR&&this.viewModel.get("isCustomOutSR")&&this._outSRInput.set("value",this.viewModel.outSR.wkid);if(this.viewModel.get("isCustomOutSR"))this._outSRSelect.set("value","SPECIFIED");else if(this.viewModel.viewProps&&this.viewModel.viewProps.outSRLayer&&
this._layerNames){var S=q.indexOf(this._layerNames,this.viewModel.viewProps.outSRLayer.name);this._outSRSelect.set("value","LAYER_"+S)}else this._outSRSelect.set("value","DEFAULT")},_updateCellSizeSelectValue:function(){if(this.viewModel.get("isCustomCellSize"))this._cellSizeSelect.set("value","SPECIFIED");else if(this.viewModel.viewProps&&this.viewModel.viewProps.cellSizeLayer&&this._layerNames){var S=q.indexOf(this._layerNames,this.viewModel.viewProps.cellSizeLayer.name);this._cellSizeSelect.set("value",
"LAYER_"+S)}else this.viewModel.cellSize?this._cellSizeSelect.set("value",this.viewModel.cellSize):this._cellSizeSelect.set("value",this._cellSizeSelect.get("value"));this.viewModel.get("isCustomCellSize")&&this.viewModel.cellSize&&this._cellSizeInput.set("value",this.viewModel.cellSize)},_updateSnapRasterSelectValue:function(){if(this.viewModel.viewProps&&this.viewModel.viewProps.snapRasterLayer&&this._layerNames){var S=q.indexOf(this._layerNames,this.viewModel.viewProps.snapRasterLayer.name);this._snapRasterSelect.set("value",
"LAYER_"+this._layerNames[S])}else this._snapRasterSelect.set("value",this._snapRasterSelect.get("value"))},_updateMaskSelectValue:function(){if(this.viewModel.viewProps&&this.viewModel.viewProps.processorType&&this._layerNames){var S=q.indexOf(this._layerNames,this.viewModel.viewProps.maskLayer.name);this._maskSelect.set("value","LAYER_"+S)}else this._maskSelect.set("value",this._maskSelect.get("value"))},_updateProcessorTypeSelectValue:function(){this.viewModel.processorType?this._processorTypeSelect.set("value",
this.viewModel.processorType):this._processorTypeSelect.set("value",this._processorTypeSelect.get("value"))},_updateparallelProcessingFactorInputValue:function(){this.viewModel.parallelProcessingFactor?this._parallelProcessingFactorInput.set("value",this.viewModel.parallelProcessingFactor):this._parallelProcessingFactorInput.set("value",this._parallelProcessingFactorInput.get("value"))},_updaterecycleProcessingWorkersInputValue:function(){this.viewModel.recycleProcessingWorkers?this._recycleProcessingWorkersInput.set("value",
this.viewModel.recycleProcessingWorkers):this._recycleProcessingWorkersInput.set("value",this._recycleProcessingWorkersInput.get("value"))},_updateretryOnFailuresInputValue:function(){this.viewModel.retryOnFailures?this._retryOnFailuresInput.set("value",this.viewModel.retryOnFailures):this._retryOnFailuresInput.set("value",this._retryOnFailuresInput.get("value"))},_updateResamplingMethodSelectValue:function(){this.viewModel.resamplingMethod?this._resamplingMethodSelect.set("value",this.viewModel.resamplingMethod):
this._resamplingMethodSelect.set("value",this._resamplingMethodSelect.get("value"))},_handleSRSelectChange:function(S){this._coordDialog.hide();this._outSRBtn.set("disabled","SPECIFIED"!==S);ia.updateDisplay(this._outSRCustomRow,"SPECIFIED"===S&&this.viewModel.showOutSR,"table-row");ia.updateDisplay(this._outSRCustomInputRow,"SPECIFIED"===S&&this.viewModel.showOutSR,"table-row");this._outSRInput.set("required","SPECIFIED"===S);-1!==S.indexOf("LAYER_")&&(S=S.split("_")[1],S=this.viewModel.layers[S],
this.viewModel.showOkCancel?(this._outSR={wkid:parseInt(S.fullExtent.spatialReference.wkid,10)},this._state.outSRLayer={name:S.name,url:S.url,fullExtent:S.fullExtent}):this.viewModel.set("outSR",{wkid:parseInt(S.fullExtent.spatialReference.wkid,10)}))},_handleProcessSRSelectChange:function(S){this._coordDialog.hide();this._processSRBtn.set("disabled","SPECIFIED"!==S);ia.updateDisplay(this._processSRCustomRow,"SPECIFIED"===S&&this.viewModel.showProcessSR,"table-row");ia.updateDisplay(this._processSRCustomInputRow,
"SPECIFIED"===S&&this.viewModel.showProcessSR,"table-row");this._processSRInput.set("required","SPECIFIED"===S);-1!==S.indexOf("LAYER_")&&(S=S.split("_")[1],S=this.viewModel.layers[S],this.viewModel.showOkCancel?(this._processSR={wkid:parseInt(S.fullExtent.spatialReference.wkid,10)},this._state.pSRLayer={name:S.name,url:S.url,fullExtent:S.fullExtent}):this.viewModel.set("processSR",{wkid:parseInt(S.fullExtent.spatialReference.wkid,10)}))},_handleOutSRBtnClick:function(){this._outSRClick=!0;this._coordDialog.show()},
_handleProcessSRBtnClick:function(){this._outSRClick=!1;this._coordDialog.show()},_handleExtentOptionChange:function(S){var ja="SPECIFIED"===S;ia.updateDisplay([this._extentLbl,this._customExtentRow],this.viewModel.showExtent&&ja,"table-row");this._xMinInput.set("required",ja);this._xMaxInput.set("required",ja);this._yMinInput.set("required",ja);this._yMaxInput.set("required",ja);-1!==S.indexOf("LAYER_")?(S=S.split("_")[1],S=this.viewModel.layers[S],ja=new ma(S.fullExtent),this.viewModel.showOkCancel?
(this._extent=ja.shiftCentralMeridian(),this._state.extentLayer={name:S.name,url:S.url,fullExtent:S.fullExtent}):this.viewModel.set("extent",ja.shiftCentralMeridian())):"SPECIFIED"===S?(ja=new ma(this._xMinInput.get("value"),this._yMinInput.get("value"),this._xMaxInput.get("value"),this._yMaxInput.get("value"),new T({wkid:102100})),this.viewModel.showOkCancel?(this._extent=ja,this._state.extentLayer=null):this.viewModel.set("extent",ja)):"DEFAULT"===S&&(this._extent=null,this._state.extentLayer=null)},
_validateExtent:function(){var S=!0,ja="";this._handleCloseMsg();this._xMinInput.get("value")>this._xMaxInput.get("value")&&(S=!1,ja+=this.i18n.xMinMaxExtent);this._yMinInput.get("value")>this._yMaxInput.get("value")&&(S=!1,ja+="\x3cbr/\x3e"+this.i18n.yMinMaxExtent);S||this._showMessages(ja);return S},_handleSRDlgOk:function(){var S;for(ja in this._spatialRefGrid.get("selection"))this._spatialRefGrid.get("selection").hasOwnProperty(ja)&&(S=ja);S=this._spatialRefGrid.collection.getSync(S);var ja=S.sRef.wkid;
this.viewModel.showOkCancel?this._outSRClick?this._outSR={wkid:parseInt(ja,10)}:this._processSR={wkid:parseInt(ja,10)}:this.viewModel.set(this._outSRClick?"outSR":"processSR",{wkid:parseInt(ja,10)});this._outSRClick?this._outSRInput.textbox.value=ja:this._processSRInput.textbox.value=ja;this._outSRClick?g.set(this._outSRLabel,"innerHTML",S.name):g.set(this._processSRLabel,"innerHTML",S.name)},_handleSRDlgCancel:function(){},_handleOutSRInputChange:function(S){S&&(g.set(this._outSRLabel,"innerHTML",
""),ia.updateDisplay([this._outSRLabel],!1,"inline"),this.viewModel.showOkCancel?(this._outSR={wkid:parseInt(S,10)},this._state.outSRLayer=null):this.viewModel.set("outSR",{wkid:parseInt(S,10)}))},_handleProcessSRInputChange:function(S){S&&(g.set(this._processSRLabel,"innerHTML",""),ia.updateDisplay([this._processSRLabel],!1,"inline"),this.viewModel.showOkCancel?(this._processSR={wkid:parseInt(S,10)},this._state.pSRLayer=null):this.viewModel.set("processSR",{wkid:parseInt(S,10)}))},_handleCellSizeSelectChange:function(S){ia.updateDisplay([this._cellSelectNumRow],
"SPECIFIED"===S&&this.viewModel.showRasterSettings,"table-row");-1!==S.indexOf("LAYER_")?(S=this._cellSizeSelect.getOptions(S),this.viewModel.showOkCancel?(this._cellSize={url:S.url},this._state.cellSizeLayer={name:S.label.substring(6),url:S.url,fullExtent:S.fullExtent}):this.viewModel.set("cellSize",{url:S.url})):"SPECIFIED"===S?this.viewModel.showOkCancel?(this._cellSize=this._cellSizeInput.get("value"),this._state.cellSizeLayer=null):this.viewModel.set("cellSize",this._cellSizeInput.get("value")):
this.viewModel.showOkCancel?(this._cellSize=S,this._state.cellSizeLayer=null):this.viewModel.set("cellSize",S)},_handleSnapRasterSelectChange:function(S){-1!==S.indexOf("LAYER_")?(S=this._snapRasterSelect.getOptions(S),this.viewModel.showOkCancel?(this._snapRaster={url:S.url},this._state.snapRasterLayer={name:S.label.substring(6),url:S.url,fullExtent:S.fullExtent}):this.viewModel.set("snapRaster",{url:S.url})):this.viewModel.showOkCancel?(this._snapRaster="NONE"===S?void 0:S,this._state.snapRasterLayer=
null):this.viewModel.set("snapRaster","NONE"===S?void 0:S)},_handleMaskSelectChange:function(S){-1!==S.indexOf("LAYER_")?(S=this._maskSelect.getOptions(S),this.viewModel.showOkCancel?(this._mask={url:S.url},this._state.maskLayer={name:S.label.substring(6),url:S.url,fullExtent:S.fullExtent}):this.viewModel.set("mask",{url:S.url})):this.viewModel.showOkCancel?(this._mask="NONE"===S?void 0:S,this._state.maskLayer=null):this.viewModel.set("mask","NONE"===S?void 0:S)},_handleCellSizeInputChange:function(S){S&&
"SPECIFIED"===this._cellSizeSelect.get("value")&&(this.viewModel.showOkCancel?this._cellSize=S:this.viewModel.set("cellSize",S))},_handleDSSelectChange:function(S){this.viewModel.showOkCancel||this.viewModel.set("datastore",S.value)},_handleProcessorTypeSelectChange:function(S){this.viewModel.showOkCancel?this._processorType="NONE"===S?void 0:S:this.viewModel.set("processorType",S)},_handleparallelProcessingFactorInputChange:function(S){this.viewModel.showOkCancel?this._parallelProcessingFactor=S:
this.viewModel.set("parallelProcessingFactor",S)},_handlerecycleProcessingWorkersInputChange:function(S){this.viewModel.showOkCancel?this._recycleProcessingWorkers=S:this.viewModel.set("recycleProcessingWorkers",S)},_handleretryOnFailuresInputChange:function(S){this.viewModel.showOkCancel?this._retryOnFailures=S:this.viewModel.set("retryOnFailures",S)},_handleResamplingMethodSelectChange:function(S){this.viewModel.showOkCancel?this._resamplingMethod=S:this.viewModel.set("resamplingMethod",S)},_updateLayerOptions:function(S){var ja=
q.map(S,function(ra,sa){return{value:"LAYER_"+sa,label:"Layer "+ra.name,url:ra.url,fullExtent:ra.fullExtent}}),la=[{value:"minof",label:this.i18n.minInputs},{value:"maxof",label:this.i18n.maxInputs,selected:!0},{value:"SPECIFIED",label:this.i18n.extentSpecfiedBelow}],qa=[{value:"DEFAULT",label:this.i18n.defaultLabel},{value:"SPECIFIED",label:this.i18n.extentSpecfiedBelow}],ta=[{value:"GPU",label:this.i18n.gpu},{value:"CPU",label:this.i18n.cpu}],Ba=[{value:"NEAREST",label:this.i18n.nearest},{value:"BILINEAR",
label:this.i18n.bilinear},{value:"CUBIC",label:this.i18n.cubic}];var wa=[].concat([{value:"DEFAULT",label:this.i18n.defaultExtentLabel},{value:"SPECIFIED",label:this.i18n.extentSpecfiedBelow}]).concat(ja);qa=[].concat(qa).concat(ja);var ua=q.filter(S,function(ra){return ra instanceof ba||"esri.layers.RasterXLayer"===ra.declaredClass});ua=[].concat(q.map(ua,function(ra,sa){return{value:"LAYER_"+ra.name,label:"Layer "+ra.name,url:ra.url,fullExtent:ra.fullExtent}},this));this._layerNames=q.map(S,function(ra,
sa){return ra.name});this._outSRSelect.removeOption(this._outSRSelect.getOptions());this._processSRSelect.removeOption(this._processSRSelect.getOptions());this._extentSelect.removeOption(this._extentSelect.getOptions());this._maskSelect.removeOption(this._maskSelect.getOptions());this._cellSizeSelect.removeOption(this._cellSizeSelect.getOptions());this._snapRasterSelect.removeOption(this._snapRasterSelect.getOptions());this._processorTypeSelect.removeOption(this._processorTypeSelect.getOptions());
this._resamplingMethodSelect.removeOption(this._resamplingMethodSelect.getOptions());this._outSRSelect.addOption(wa);this._processSRSelect.addOption(wa);this._extentSelect.addOption(qa);this._maskSelect.addOption([{value:"NONE",label:""}].concat(ja));this._cellSizeSelect.addOption([].concat(la).concat(ja));this._snapRasterSelect.addOption([{value:"NONE",label:""}].concat(ua));this._processorTypeSelect.addOption([{value:"NONE",label:""}].concat(ta));this._resamplingMethodSelect.addOption(Ba);this._updateExtentSelectValue();
this._updateOutSRSelectValue();this._updateProcessSRSelectValue();this._updateCellSizeSelectValue();this._updateSnapRasterSelectValue();this._updateMaskSelectValue();this._updateProcessorTypeSelectValue();this._updateparallelProcessingFactorInputValue();this._updaterecycleProcessingWorkersInputValue();this._updateretryOnFailuresInputValue();this._updateResamplingMethodSelectValue()},_handleCloseAnalysisCheck:function(S){this.viewModel.showOkCancel||this.viewModel.set("closeAnalysisWidget",S)},_handleReturnFeatureCollectionCheck:function(S){this.viewModel.showOkCancel||
this.viewModel.set("returnFeatureCollection",!S)},_handleOkButtonClick:function(S){S&&S.preventDefault();this._form.validate()&&("SPECIFIED"!==this._extentSelect.get("value")||this._validateExtent())&&(this.viewModel.set("viewProps",this._state),"DEFAULT"!==this._outSRSelect.get("value")?this.viewModel.set("outSR",this._outSR):"DEFAULT"===this._outSRSelect.get("value")&&this.viewModel.set("outSR",null),"DEFAULT"!==this._processSRSelect.get("value")?this.viewModel.set("processSR",this._processSR):
"DEFAULT"===this._processSRSelect.get("value")&&this.viewModel.set("processSR",null),"SPECIFIED"===this._extentSelect.get("value")&&this._validateExtent()&&(this._extent=new ma(this._xMinInput.get("value"),this._yMinInput.get("value"),this._xMaxInput.get("value"),this._yMaxInput.get("value"),new T({wkid:102100}))),this.viewModel.set("extent",this._extent),this.viewModel.set("mask",this._mask),this.viewModel.set("snapRaster",this._snapRaster),this.viewModel.set("cellSize",this._cellSize),this.viewModel.set("resamplingMethod",
this._resamplingMethod),this.viewModel.set("creditWarningChecked",this._creditWarning),this._dataStoreSelect&&this.viewModel.set("datastore",this._dataStoreSelect.get("value")),this.viewModel.set("closeAnalysisWidget",this._closeAnalysisCheck.get("checked")),this.viewModel.set("returnFeatureCollection",!this._storeAnalysisCheck.get("checked")),this.viewModel.set("isCustomExtent","SPECIFIED"===this._extentSelect.get("value")),this.viewModel.set("isCustomOutSR","SPECIFIED"===this._outSRSelect.get("value")),
this.viewModel.set("isCustomProcessSR","SPECIFIED"===this._processSRSelect.get("value")),this.viewModel.set("isCustomCellSize","SPECIFIED"===this._cellSizeSelect.get("value")),this.viewModel.set("processorType",this._processorType),this.viewModel.set("parallelProcessingFactor",this._parallelProcessingFactor),this.viewModel.set("recycleProcessingWorkers",this._recycleProcessingWorkers),this.viewModel.set("retryOnFailures",this._retryOnFailures),this.viewModel.save(),this.emit("ok-settings",{viewMode:this.viewModel}))},
_handleCancelButtonClick:function(){this.viewModel.reset();this.reset();this.emit("cancel-settings",{viewMode:this.viewModel})},_handleCreditWarningCheck:function(S){this.viewModel.set("creditWarning",S)},reset:function(){"SPECIFIED"!==this._extentSelect.get("value")||this._validateExtent()||this.viewModel.get("isCustomExtent")||(this._xMinInput.reset(),this._xMaxInput.reset(),this._yMinInput.reset(),this._yMaxInput.reset());this.initUI()},_showMessages:function(S){g.set(this._bodyNode,"innerHTML",
S);u.fadeIn({node:this._errorMessagePane,easing:r.quadIn,onEnd:n.hitch(this,function(){e.set(this._errorMessagePane,{display:""})})}).play()},_handleCloseMsg:function(S){S&&S.preventDefault();u.fadeOut({node:this._errorMessagePane,easing:r.quadOut,onEnd:n.hitch(this,function(){e.set(this._errorMessagePane,{display:"none"})})}).play()}});a("extend-esri")&&n.setObject("dijit.analysis.Settings",H,ha);return H})},"dojo/NodeList":function(){define(["./query"],function(H){return H.NodeList})},"dijit/ConfirmDialog":function(){define(["dojo/_base/declare",
"./Dialog","./_ConfirmDialogMixin"],function(H,k,n){return H("dijit.ConfirmDialog",[k,n],{})})},"dijit/_ConfirmDialogMixin":function(){define(["dojo/_base/declare","./_WidgetsInTemplateMixin","dojo/i18n!./nls/common","dojo/text!./templates/actionBar.html","./form/Button"],function(H,k,n,q){return H("dijit._ConfirmDialogMixin",k,{actionBarTemplate:q,buttonOk:n.buttonOk,_setButtonOkAttr:{node:"okButton",attribute:"label"},buttonCancel:n.buttonCancel,_setButtonCancelAttr:{node:"cancelButton",attribute:"label"}})})},
"dojox/mvc/at":function(){define(["dojo/_base/kernel","dojo/_base/lang","./sync","./_atBindingExtension"],function(H,k,n){H.experimental("dojox.mvc");H=function(q,m){return{atsignature:"dojox.mvc.at",target:q,targetProp:m,bindDirection:n.both,direction:function(l){this.bindDirection=l;return this},transform:function(l){this.converter=l;return this},equals:function(l){this.equalsCallback=l;return this}}};H.from=n.from;H.to=n.to;H.both=n.both;return k.setObject("dojox.mvc.at",H)})},"dojox/mvc/sync":function(){define(["dojo/_base/lang",
"dojo/_base/config","dojo/_base/array","dojo/has"],function(H,k,n,q){function m(c,f,e,g,d,h,p,t,w,u){if(!(e(w,t)||"*"==d&&0>n.indexOf(g.get("properties")||[p],p)||"*"==d&&p in(u||{}))){e="*"==d?p:d;if(q("mvc-bindings-log-api"))var r=b(g,e,h,p);try{w=c?c(w,f):w}catch(y){q("mvc-bindings-log-api")&&console.log("Copy from"+r.join(" to ")+" was not done as an error is thrown in the converter.");return}q("mvc-bindings-log-api")&&console.log(r.reverse().join(" is being copied from: ")+" (Value: "+w+" from "+
t+")");H.isFunction(g.set)?g.set(e,w):g[e]=w}}var l=H.getObject("dojox.mvc",!0);q.add("mvc-bindings-log-api",(k.mvc||{}).debugBindings);var b=q("mvc-bindings-log-api")?function(c,f,e,g){return[[e.canConvertToLoggable||!e.declaredClass?e:e.declaredClass,g].join(":"),[c.canConvertToLoggable||!c.declaredClass?c:c.declaredClass,f].join(":")]}:"";k={from:1,to:2,both:3};var a=function(c,f,e,g,d){var h=(d||{}).converter;if(h){var p={source:c,target:e};var t=h.format&&H.hitch(p,h.format);var w=h.parse&&H.hitch(p,
h.parse)}var u=[],r=[],y=H.mixin({},c.constraints,e.constraints);h=(d||{}).bindDirection||l.both;var B=(d||{}).equals||a.equals;if(q("mvc-bindings-log-api"))var C=b(c,f,e,g);if("*"==g){if("*"!=f)throw Error("Unmatched wildcard is specified between source and target.");d=e.get("properties");if(!d){d=[];for(var G in e)e.hasOwnProperty(G)&&"_watchCallbacks"!=G&&d.push(G)}r=e.get("excludes")}else d=[f];h&l.from&&(H.isFunction(c.set)&&H.isFunction(c.watch)?u.push(c.watch.apply(c,("*"!=f?[f]:[]).concat([function(x,
v,z){m(t,y,B,e,g,c,x,v,z,r)}]))):q("mvc-bindings-log-api")&&console.log(C.reverse().join(" is not a stateful property. Its change is not reflected to ")+"."),n.forEach(d,function(x){if("*"!=g||!(x in(r||{}))){var v=H.isFunction(c.get)?c.get(x):c[x];m(t,y,B,e,"*"==g?x:g,c,x,void 0,v)}}));h&l.to&&(h&l.from||n.forEach(d,function(x){if("*"!=g||!(x in(r||{}))){var v=H.isFunction(e.get)?e.get(g):e[g];m(w,y,B,c,x,e,"*"==g?x:g,void 0,v)}}),H.isFunction(e.set)&&H.isFunction(e.watch)?u.push(e.watch.apply(e,
("*"!=g?[g]:[]).concat([function(x,v,z){m(w,y,B,c,f,e,x,v,z,r)}]))):q("mvc-bindings-log-api")&&console.log(C.join(" is not a stateful property. Its change is not reflected to ")+"."));q("mvc-bindings-log-api")&&console.log(C.join(" is bound to: "));G={};G.unwatch=G.remove=function(){for(var x=null;x=u.pop();)x.unwatch();q("mvc-bindings-log-api")&&console.log(C.join(" is unbound from: "))};return G};H.mixin(l,k);return H.setObject("dojox.mvc.sync",H.mixin(a,{equals:function(c,f){return c===f||"number"==
typeof c&&isNaN(c)&&"number"==typeof f&&isNaN(f)||H.isFunction((c||{}).getTime)&&H.isFunction((f||{}).getTime)&&c.getTime()==f.getTime()||(H.isFunction((c||{}).equals)?c.equals(f):H.isFunction((f||{}).equals)?f.equals(c):!1)}},k))})},"dojox/mvc/_atBindingExtension":function(){define(["dojo/_base/config","dojo/has","dijit/_WidgetBase","./atBindingExtension"],function(H,k,n,q){k.add("mvc-extension-per-widget",(H.mvc||{}).extensionPerWidget);k("mvc-extension-per-widget")||q(n.prototype)})},"dojox/mvc/atBindingExtension":function(){define("dojo/aspect dojo/_base/array dojo/_base/lang dijit/_WidgetBase ./_atBindingMixin dijit/registry".split(" "),
function(H,k,n,q,m){return function(l){k.forEach(arguments,function(b){b.dataBindAttr?console.warn("Detected a widget or a widget class that has already been applied data binding extension. Skipping..."):(n._mixin(b,m.mixin),H.before(b,"postscript",function(a,c){this._dbpostscript(a,c)}),H.before(b,"startup",function(){this._started||this._startAtWatchHandles()}),H.before(b,"destroy",function(){this._stopAtWatchHandles()}),H.around(b,"set",function(a){return function(c,f){return c==m.prototype.dataBindAttr?
this._setBind(f):"dojox.mvc.at"==(f||{}).atsignature?this._setAtWatchHandle(c,f):a.apply(this,n._toArray(arguments))}}))});return arguments}})},"dojox/mvc/_atBindingMixin":function(){define("dojo/_base/array dojo/_base/lang dojo/_base/declare dojo/has dojo/Stateful ./resolve ./sync".split(" "),function(H,k,n,q,m,l,b){function a(d){try{var h=require("dijit/registry")}catch(t){return}for(d=d.domNode&&d.domNode.parentNode;d;){if(d=h.getEnclosingWidget(d)){var p=d._relTargetProp||"target";if((k.isFunction(d.get)?
d.get(p):d[p])||p in d.constructor.prototype)return d}d=d&&d.domNode.parentNode}}function c(d,h,p,t,w){function u(){r.Two&&r.Two.unwatch();delete r.Two;var G=y&&(k.isFunction(y.get)?y.get(B):y[B]),x=l(d,G);G=l(p,G);q("mvc-bindings-log-api")&&(!x||/^rel:/.test(d)&&!y)&&e(d,h);q("mvc-bindings-log-api")&&(!G||/^rel:/.test(p)&&!y)&&e(p,t);x&&G&&(!/^rel:/.test(d)&&!/^rel:/.test(p)||y)&&(x.set&&x.watch||"*"!=h?null==h?(k.isFunction(G.set)?G.set(t,x):G[t]=x,q("mvc-bindings-log-api")&&console.log("dojox/mvc/_atBindingMixin set "+
x+" to: "+f(G,t))):r.Two=b(x,h,G,t,w):q("mvc-bindings-log-api")&&e(d,h))}var r={},y=a(p),B=y&&y._relTargetProp||"target";u();if(y&&/^rel:/.test(d)||/^rel:/.test(p)&&k.isFunction(y.set)&&k.isFunction(y.watch))r.rel=y.watch(B,function(G,x,v){x!==v&&(q("mvc-bindings-log-api")&&console.log("Change in relative data binding target: "+y),u())});var C={};C.unwatch=C.remove=function(){for(var G in r)r[G]&&r[G].unwatch(),delete r[G]};return C}var f=q("mvc-bindings-log-api")?function(d,h){return[d._setIdAttr||
!d.declaredClass?d:d.declaredClass,h].join(":")}:"",e=q("mvc-bindings-log-api")?function(d,h){console.warn(h+" could not be resolved"+("string"==typeof d?" with "+d:"")+".")}:"",g={dataBindAttr:"data-mvc-bindings",_dbpostscript:function(d,h){h=this._refs=(d||{}).refs||{};for(var p in d)if("dojox.mvc.at"==(d[p]||{}).atsignature){var t=d[p];delete d[p];h[p]=t}t=new m;var w=this;t.toString=function(){return"[Mixin value of widget "+w.declaredClass+", "+(w.id||"NO ID")+"]"};t.canConvertToLoggable=!0;
this._startAtWatchHandles(t);for(p in h)void 0!==t[p]&&((d=d||{})[p]=t[p]);this._stopAtWatchHandles()},_startAtWatchHandles:function(d){this.canConvertToLoggable=!0;var h=this._refs;if(h){var p=this._atWatchHandles=this._atWatchHandles||{};this._excludes=null;for(var t in h)h[t]&&"*"!=t&&(p[t]=c(h[t].target,h[t].targetProp,d||this,t,{bindDirection:h[t].bindDirection,converter:h[t].converter,equals:h[t].equalsCallback}));"dojox.mvc.at"==(h["*"]||{}).atsignature&&(p["*"]=c(h["*"].target,h["*"].targetProp,
d||this,"*",{bindDirection:h["*"].bindDirection,converter:h["*"].converter,equals:h["*"].equalsCallback}))}},_stopAtWatchHandles:function(){for(var d in this._atWatchHandles)this._atWatchHandles[d].unwatch(),delete this._atWatchHandles[d]},_setAtWatchHandle:function(d,h){if("ref"==d)throw Error(this+": 1.7 ref syntax used in conjunction with 1.8 dojox/mvc/at syntax, which is not supported.");var p=this._atWatchHandles=this._atWatchHandles||{};p[d]&&(p[d].unwatch(),delete p[d]);this._excludes=this[d]=
null;this._started?p[d]=c(h.target,h.targetProp,this,d,{bindDirection:h.bindDirection,converter:h.converter,equals:h.equalsCallback}):this._refs[d]=h},_setBind:function(d){d=eval("({"+d+"})");for(var h in d){var p=d[h];"dojox.mvc.at"!=(p||{}).atsignature?console.warn(h+" in "+dataBindAttr+" is not a data binding handle."):this._setAtWatchHandle(h,p)}},_getExcludesAttr:function(){if(this._excludes)return this._excludes;var d=[],h;for(h in this._atWatchHandles)"*"!=h&&d.push(h);return d},_getPropertiesAttr:function(){if(this.constructor._attribs)return this.constructor._attribs;
var d=["onClick"].concat(this.constructor._setterAttrs);H.forEach(["id","excludes","properties","ref","binding"],function(h){h=H.indexOf(d,h);0<=h&&d.splice(h,1)});return this.constructor._attribs=d}};g[g.dataBindAttr]="";n=n("dojox/mvc/_atBindingMixin",null,g);n.mixin=g;return n})},"dojox/mvc/resolve":function(){define(["dojo/_base/lang","dijit/registry","dojo/Stateful"],function(H,k){return H.setObject("dojox.mvc.resolve",function(n,q){if("string"==typeof n){var m=n.match(/^(expr|rel|widget):(.*)$/)||
[];try{n="rel"==m[1]?H.getObject(m[2]||"",!1,q):"widget"==m[1]?k.byId(m[2]):H.getObject(m[2]||n,!1,q)}catch(l){}}return n})})},"dgrid1/OnDemandGrid":function(){define(["dojo/_base/declare","./Grid","./OnDemandList"],function(H,k,n){return H([k,n],{})})},"dgrid1/Grid":function(){define("dojo/_base/declare dojo/_base/lang dojo/dom-construct dojo/dom-class dojo/on dojo/has ./List ./util/misc dojo/_base/sniff".split(" "),function(H,k,n,q,m,l,b,a){function c(f,e){e&&e.nodeType&&f.appendChild(e)}H=H(b,
{columns:null,hasNeutralSort:!1,cellNavigation:!0,tabableHeader:!0,showHeader:!0,column:function(f){return"object"!==typeof f?this.columns[f]:this.cell(f).column},listType:"grid",cell:function(f,e){if(f.column&&f.element)return f;f.target&&f.target.nodeType&&(f=f.target);if(f.nodeType){do{if(this._rowIdToObject[f.id])break;var g=f.columnId;if(g){e=g;var d=f;break}f=f.parentNode}while(f&&f!==this.domNode)}if(!d&&"undefined"!==typeof e){var h=this.row(f);if(g=h&&h.element){g=g.getElementsByTagName("td");
for(var p=0;p<g.length;p++)if(g[p].columnId===e){d=g[p];break}}}if(null!=f)return{row:h||this.row(f),column:e&&this.column(e),element:d}},createRowCells:function(f,e,g,d,h){var p=n.create("table",{className:"dgrid-row-table",role:"presentation"}),t=9>l("ie")?n.create("tbody",null,p):p,w,u,r;g=g||this.subRows;var y=0;for(w=g.length;y<w;y++){var B=g[y];var C=n.create("tr",null,t);B.className&&(C.className=B.className);var G=0;for(u=B.length;G<u;G++){var x=B[G];var v=x.id;var z=x.field?" field-"+a.escapeCssIdentifier(x.field,
"-"):"";(r="function"===typeof x.className?x.className(d):x.className)&&(z+=" "+r);z=n.create(f,{className:"dgrid-cell"+(v?" dgrid-column-"+a.escapeCssIdentifier(v,"-"):"")+z,role:"th"===f?"columnheader":"gridcell"});z.columnId=v;if(v=x.colSpan)z.colSpan=v;if(v=x.rowSpan)z.rowSpan=v;e(z,x,d,h);C.appendChild(z)}}return p},_createBodyRowCell:function(f,e,g,d){var h=g;e.get?h=e.get(g):"field"in e&&"_item"!==e.field&&(h=g[e.field]);e.renderCell?c(f,e.renderCell(g,h,f,d)):this._defaultRenderCell.call(e,
g,h,f,d)},_createHeaderRowCell:function(f,e){var g=e.headerNode=f,d=e.field;d&&(f.field=d);e.renderHeaderCell?c(g,e.renderHeaderCell(g)):("label"in e||e.field)&&g.appendChild(document.createTextNode("label"in e?e.label:e.field));!1!==e.sortable&&d&&"_item"!==d&&(f.sortable=!0,f.className+=" dgrid-sortable")},left:function(f,e){f.element||(f=this.cell(f));return this.cell(this._move(f,-(e||1),"dgrid-cell"))},right:function(f,e){f.element||(f=this.cell(f));return this.cell(this._move(f,e||1,"dgrid-cell"))},
_defaultRenderCell:function(f,e,g){if(this.formatter){var d=this.formatter,h=this.grid.formatterScope;f="string"===typeof d&&h?h[d](e,f):this.formatter(e,f);null!=f&&f.hasOwnProperty("html")?g.innerHTML=f.html:null!=f&&g.appendChild(document.createTextNode(f))}else null!=e&&g.appendChild(document.createTextNode(e))},renderRow:function(f,e){f=this.createRowCells("td",k.hitch(this,"_createBodyRowCell"),e&&e.subRows,f,e);e=n.create("div",{role:"row"});e.appendChild(f);return e},renderHeader:function(){var f=
this,e=this.headerNode;e.setAttribute("role","row");n.empty(e);var g=this.createRowCells("th",k.hitch(this,"_createHeaderRowCell"),this.subRows&&this.subRows.headerRows);this._rowIdToObject[g.id=this.id+"-header"]=this.columns;e.appendChild(g);this._sortListener&&this._sortListener.remove();this._sortListener=m(g,"click,keydown",function(d){if("click"===d.type||32===d.keyCode||!l("opera")&&13===d.keyCode){var h=d.target;do if(h.sortable){var p=h.field||h.columnId;var t=f.sort[0];p=f.hasNeutralSort&&
t&&t.property===p&&t.descending?[]:[{property:p,descending:t&&t.property===p&&!t.descending}];t={bubbles:!0,cancelable:!0,grid:f,parentType:d.type,sort:p};m.emit(d.target,"dgrid-sort",t)&&(f._sortNode=h,f.set("sort",p));break}while((h=h.parentNode)&&h!==e)}})},resize:function(){var f=this.headerNode.firstChild,e=this.contentNode,g;this.inherited(arguments);e.style.width="";e&&f&&(g=f.offsetWidth)>e.offsetWidth&&(e.style.width=g+"px")},destroy:function(){this._destroyColumns();this._sortListener&&
this._sortListener.remove();this.inherited(arguments)},_setSort:function(){this.inherited(arguments);this.updateSortArrow(this.sort)},_findSortArrowParent:function(f){var e=this.columns,g;for(g in e){var d=e[g];if(d.field===f)return d.headerNode}},updateSortArrow:function(f,e){this._lastSortedArrow&&(this._lastSortedArrow.parentNode&&q.remove(this._lastSortedArrow.parentNode,"dgrid-sort-up dgrid-sort-down"),n.destroy(this._lastSortedArrow),delete this._lastSortedArrow);e&&(this.sort=f);f[0]&&(e=f[0].property,
f=f[0].descending,e=this._sortNode||this._findSortArrowParent(e),delete this._sortNode,e&&(e=e.contents||e,this._lastSortedArrow=n.create("div",{className:"dgrid-sort-arrow ui-icon",innerHTML:"\x26nbsp;",role:"presentation"},e,"first"),q.add(e,"dgrid-sort-"+(f?"down":"up")),this.resize()))},styleColumn:function(f,e){return this.addCssRule("#"+a.escapeCssIdentifier(this.domNode.id)+" .dgrid-column-"+a.escapeCssIdentifier(f,"-"),e)},_configColumns:function(f,e){var g=[],d=e instanceof Array;a.each(e,
function(h,p){"string"===typeof h&&(e[p]=h={label:h});d||h.field||(h.field=p);p=h.id=h.id||(isNaN(p)?p:f+p);this._configColumn&&(this._configColumn(h,e,f),p=h.id);d&&(this.columns[p]=h);h.grid?h.grid!==this&&console.warn("Sharing column definition objects with multiple grids is not supported.",h.grid,this):h.grid=this;g.push(h)},this);return d?e:g},_destroyColumns:function(){this.cleanup()},configStructure:function(){var f=this.subRows,e=this._columns=this.columns;this.columns=!e||e instanceof Array?
{}:e;if(f)for(e=0;e<f.length;e++)f[e]=this._configColumns(e+"-",f[e]);else this.subRows=[this._configColumns("",e)]},_getColumns:function(){return this._columns||this.columns},_setColumns:function(f){this._destroyColumns();this.subRows=null;this.columns=f;this._updateColumns()},_setSubRows:function(f){this._destroyColumns();this.subRows=f;this._updateColumns()},_updateColumns:function(){this.configStructure();this.renderHeader();this.refresh();this._lastCollection&&this.renderArray(this._lastCollection);
this._started&&(this.sort.length?(this._lastSortedArrow=null,this.updateSortArrow(this.sort)):this.resize())}});H.appendIfNode=c;return H})},"dgrid1/List":function(){define("dojo/_base/declare dojo/_base/lang dojo/dom-class dojo/dom-construct dojo/on dojo/query dojo/sniff ./util/misc".split(" "),function(H,k,n,q,m,l,b,a){function c(r,y){return l("#"+a.escapeCssIdentifier(r),y)[0]}function f(r,y){r.className="dgrid-scrollbar-measure";document.body.appendChild(r);y=r["offset"+y]-r["client"+y];r.className=
"";r.parentNode&&document.body.removeChild(r);return y}function e(r){n.replace(this.domNode,r,this._class||"");this._class=r}function g(){return this._class}var d=[];b("mozilla")&&d.push("has-mozilla");b("touch")&&d.push("has-touch");n.add(document.documentElement,d);b.add("pointer",function(r){return"PointerEvent"in r?"pointer":"MSPointerEvent"in r?"MSPointer":!1});var h,p;b.add("dom-scrollbar-width",function(r,y,B){return f(B,"Width")});b.add("dom-scrollbar-height",function(r,y,B){return f(B,"Height")});
b.add("dom-rtl-scrollbar-left",function(r,y,B){r=document.createElement("div");B.className="dgrid-scrollbar-measure";B.setAttribute("dir","rtl");B.appendChild(r);document.body.appendChild(B);y=!!b("ie")||!!b("trident")||/\bEdge\//.test(navigator.userAgent)||r.offsetLeft>=b("dom-scrollbar-width");B.className="";B.parentNode&&document.body.removeChild(B);q.destroy(r);B.removeAttribute("dir");return y});var t=0,w=function(){this._started&&this.resize()},u=H(null,{tabableHeader:!1,showHeader:!1,showFooter:!1,
maintainOddEven:!0,cleanAddedRules:!0,addUiClasses:!0,highlightDuration:250,resizeThrottleDelay:a.defaultDelay,resizeThrottleMethod:"throttleDelayed",postscript:function(r,y){var B=this;(this._Row=function(C,G,x){this.id=C;this.data=G;this.element=x}).prototype.remove=function(){B.removeRow(this.element)};y&&(this.srcNodeRef=y=y.nodeType?y:c(y));this.create(r,y)},listType:"list",create:function(r,y){y=this.domNode=y||document.createElement("div");if(r){this.params=r;H.safeMixin(this,r);var B=r["class"]||
r.className||y.className}this.sort=this.sort||[];this._listeners=[];this._rowIdToObject={};this.postMixInProperties&&this.postMixInProperties();this.id=y.id=y.id||this.id||u.autoIdPrefix+t++;this.buildRendering();B&&e.call(this,B);this.postCreate();delete this.srcNodeRef;this.domNode.offsetHeight&&this.startup()},buildRendering:function(){var r=this.domNode,y=this.addUiClasses,B=this;var C=this.isRTL="rtl"===(document.body.dir||document.documentElement.dir||document.body.style.direction).toLowerCase();
r.className="";r.setAttribute("role","grid");n.add(r,"dgrid dgrid-"+this.listType+(y?" ui-widget":""));var G=this.headerNode=q.create("div",{className:"dgrid-header dgrid-header-row"+(y?" ui-widget-header":"")+(this.showHeader?"":" dgrid-header-hidden")},r);var x=this.bodyNode=q.create("div",{className:"dgrid-scroller"},r);b("ff")&&(x.tabIndex=-1);this.headerScrollNode=q.create("div",{className:"dgrid-header dgrid-header-scroll dgrid-scrollbar-width"+(y?" ui-widget-header":"")},r);this.footerNode=
q.create("div",{className:"dgrid-footer"+(this.showFooter?"":" dgrid-footer-hidden")},r);C&&(r.className+=" dgrid-rtl"+(b("dom-rtl-scrollbar-left")?" dgrid-rtl-swap":""));m(x,"scroll",function(v){B.showHeader&&(G.scrollLeft=v.scrollLeft||x.scrollLeft);v.stopPropagation();m.emit(r,"scroll",{scrollTarget:x})});this.configStructure();this.renderHeader();this.contentNode=this.touchNode=q.create("div",{className:"dgrid-content"+(y?" ui-widget-content":"")},this.bodyNode);"string"===typeof this.resizeThrottleMethod&&
a[this.resizeThrottleMethod]?y=a[this.resizeThrottleMethod](w,this,this.resizeThrottleDelay):"function"===typeof this.resizeThrottleMethod?y=this.resizeThrottleMethod(k.hitch(this,w),this.resizeThrottleDelay):(console.warn("Invalid value specified for resizeThrottleMethod:  "+this.resizeThrottleMethod),y=a.throttleDelayed(w,this,this.resizeThrottleDelay));this._resizeHandle=m(window,"resize",y);this._listeners.push(this._resizeHandle)},postCreate:function(){},startup:function(){this._started||(this.inherited(arguments),
this._started=!0,this.resize(),this.set("sort",this.sort))},configStructure:function(){},resize:function(){var r=this.bodyNode,y=this.footerNode;y=this.showFooter?y.offsetHeight:0;this.headerScrollNode.style.height=r.style.marginTop=this.headerNode.offsetHeight+"px";r.style.marginBottom=y+"px";h||(h=b("dom-scrollbar-width"),p=b("dom-scrollbar-height"),b("ie")&&(h++,p++),a.addCssRule(".dgrid-scrollbar-width","width: "+h+"px"),a.addCssRule(".dgrid-scrollbar-height","height: "+p+"px"),17!==h&&(a.addCssRule(".dgrid-header-row",
"right: "+h+"px"),a.addCssRule(".dgrid-rtl-swap .dgrid-header-row","left: "+h+"px")))},addCssRule:function(r,y){r=a.addCssRule(r,y);this.cleanAddedRules&&this._listeners.push(r);return r},on:function(r,y){r=m(this.domNode,r,y);b("dom-addeventlistener")||this._listeners.push(r);return r},cleanup:function(){for(var r in this._rowIdToObject)if(this._rowIdToObject[r]!==this.columns){var y=c(r,this.domNode);y&&this.removeRow(y,!0)}},destroy:function(){if(this._listeners){for(var r=this._listeners.length;r--;)this._listeners[r].remove();
this._listeners=null}this._started=!1;this.cleanup();q.destroy(this.domNode)},refresh:function(){this.cleanup();this._rowIdToObject={};this._autoRowId=0;this.contentNode.innerHTML="";this.scrollTo({x:0,y:0})},highlightRow:function(r,y){var B="dgrid-highlight"+(this.addUiClasses?" ui-state-highlight":"");r=r.element||r;n.add(r,B);setTimeout(function(){n.remove(r,B)},y||this.highlightDuration)},adjustRowIndices:function(r){var y=r.rowIndex;if(-1<y){do-1<r.rowIndex&&this.setRowIndex(r,y++,r.rowIndex);
while((r=r.nextSibling)&&r.rowIndex!==y)}},renderArray:function(r,y,B){B=B||{};var C=B.start||0,G=document.createDocumentFragment(),x=[],v=0,z=r.length;y||(this._lastCollection=r);for(;v<z;)x[v]=this.insertRow(r[v],G,null,C++,B),v++;(r=y?y.parentNode:this.contentNode)&&r.parentNode&&(r!==this.contentNode||z)&&(r.insertBefore(G,y||null),z&&this.adjustRowIndices(x[z-1]));return x},renderHeader:function(){},setRowIndex:function(r,y,B){r.rowIndex=y;this.maintainOddEven&&(y=1===y%2?"dgrid-row-odd":"dgrid-row-even",
void 0!==B?(B=1===B%2?"dgrid-row-odd":"dgrid-row-even",B!==y&&n.replace(r,B,y)):n.add(r,y))},_autoRowId:0,insertRow:function(r,y,B,C,G){var x=this.id+"-row-"+(this.collection&&this.collection.getIdentity?this.collection.getIdentity(r):this._autoRowId++),v=c(x,this.domNode),z=v&&v.previousSibling;v&&(v===B&&(B=(B.connected||B).nextSibling),this.removeRow(v,!1,G));v=this.renderRow(r,G);v.className=(v.className||"")+" dgrid-row "+(this.addUiClasses?" ui-state-default":"");this._rowIdToObject[v.id=x]=
r;y.insertBefore(v,B||null);this.setRowIndex(v,C);z&&z.rowIndex!==v.rowIndex-1&&this.adjustRowIndices(z);return v},renderRow:function(r){var y=document.createElement("div");y.appendChild(document.createTextNode(r));return y},removeRow:function(r,y){r=r.element||r;delete this._rowIdToObject[r.id];y||q.destroy(r)},row:function(r){var y;if(r instanceof this._Row)return r;r.target&&r.target.nodeType&&(r=r.target);if(r.nodeType){do{var B=r.id;if(y=this._rowIdToObject[B])return new this._Row(B.substring(this.id.length+
5),y,r);r=r.parentNode}while(r&&r!==this.domNode)}else return"object"===typeof r?y=this.collection.getIdentity(r):(y=r,r=this._rowIdToObject[this.id+"-row-"+y]),new this._Row(y,r,c(this.id+"-row-"+y,this.domNode))},cell:function(r){return{row:this.row(r)}},_move:function(r,y,B,C){var G;var x=G=r.element;y=y||1;do if(r=G[0>y?"previousSibling":"nextSibling"]){do if((G=r)&&-1<(G.className+" ").indexOf(B+" ")){x=G;y+=0>y?1:-1;break}while(r=(!C||!G.hidden)&&G[0>y?"lastChild":"firstChild"])}else if(G=G.parentNode,
!G||G===this.bodyNode||G===this.headerNode)break;while(y);return x},up:function(r,y,B){r.element||(r=this.row(r));return this.row(this._move(r,-(y||1),"dgrid-row",B))},down:function(r,y,B){r.element||(r=this.row(r));return this.row(this._move(r,y||1,"dgrid-row",B))},scrollTo:function(r){"undefined"!==typeof r.x&&(this.bodyNode.scrollLeft=r.x);"undefined"!==typeof r.y&&(this.bodyNode.scrollTop=r.y)},getScrollPosition:function(){return{x:this.bodyNode.scrollLeft,y:this.bodyNode.scrollTop}},get:function(r){var y=
"_get"+r.charAt(0).toUpperCase()+r.slice(1);return"function"===typeof this[y]?this[y].apply(this,[].slice.call(arguments,1)):this[r]},set:function(r,y){if("object"===typeof r)for(var B in r)this.set(B,r[B]);else B="_set"+r.charAt(0).toUpperCase()+r.slice(1),"function"===typeof this[B]?this[B].apply(this,[].slice.call(arguments,1)):this[r]=y;return this},_getClass:g,_setClass:e,_getClassName:g,_setClassName:e,_setSort:function(r,y){this.sort="string"!==typeof r?r:[{property:r,descending:y}];this._applySort()},
_applySort:function(){this.refresh();if(this._lastCollection){var r=this.sort;if(r&&0<r.length){var y=r[0].property,B=!!r[0].descending;this._lastCollection.sort(function(C,G){C=C[y];G=G[y];void 0===C&&(C="");void 0===G&&(G="");return C===G?0:C>G!==B?1:-1})}this.renderArray(this._lastCollection)}},_setShowHeader:function(r){var y=this.headerNode;this.showHeader=r;n.toggle(y,"dgrid-header-hidden",!r);this.renderHeader();this.resize();r&&(y.scrollLeft=this.getScrollPosition().x)},_setShowFooter:function(r){this.showFooter=
r;n.toggle(this.footerNode,"dgrid-footer-hidden",!r);this.resize()}});u.autoIdPrefix="dgrid_";return u})},"dgrid1/util/misc":function(){define(["dojo/has"],function(H){var k=[],n,q,m,l=/([^A-Za-z0-9_\u00A0-\uFFFF-])/g,b=setTimeout,a=clearTimeout;H.add("requestidlecallback",function(f){return"function"===typeof f.requestIdleCallback});var c={defaultDelay:15,throttle:function(f,e,g){var d=!1;g=g||c.defaultDelay;return function(){d||(d=!0,f.apply(e,arguments),b(function(){d=!1},g))}},throttleDelayed:function(f,
e,g){var d=!1;g=g||c.defaultDelay;return function(){if(!d){d=!0;var h=arguments;b(function(){d=!1;f.apply(e,h)},g)}}},debounce:function(f,e,g){var d;g=g||c.defaultDelay;return function(){d&&(a(d),d=null);var h=arguments;d=b(function(){d=null;f.apply(e,h)},g)}},each:function(f,e,g){var d;if(f)if("number"===typeof f.length){var h=0;for(d=f.length;h<d;h++)e.call(g,f[h],h,f)}else for(h in f)e.call(g,f[h],h,f)},addCssRule:function(f,e){n||(n=document.createElement("style"),document.getElementsByTagName("head")[0].appendChild(n),
n=n.sheet||n.styleSheet,q=n.deleteRule?"deleteRule":"removeRule",m=n.cssRules?"cssRules":"rules");var g=k.length;k[g]=(n.cssRules||n.rules).length;n.addRule?n.addRule(f,e):n.insertRule(f+"{"+e+"}",k[g]);return{get:function(d){return n[m][k[g]].style[d]},set:function(d,h){"undefined"!==typeof k[g]&&(n[m][k[g]].style[d]=h)},remove:function(){var d=k[g],h;if(void 0!==d){n[q](d);k[g]=void 0;var p=g+1;for(h=k.length;p<h;p++)k[p]>d&&k[p]--}}}},escapeCssIdentifier:function(f,e){return"string"===typeof f?
f.replace(l,e||"\\$1"):f}};return c})},"dgrid1/OnDemandList":function(){define("./List ./_StoreMixin dojo/_base/declare dojo/_base/lang dojo/dom-construct dojo/on dojo/when dojo/query ./util/misc".split(" "),function(H,k,n,q,m,l,b,a,c){function f(d){return d&&(0<=d.className.indexOf("dgrid-row")||0<=d.className.indexOf("dgrid-loading"))}function e(d){return d&&0<=d.className.indexOf("dgrid-preload")}var g=0;return n([H,k],{minRowsPerPage:25,maxRowsPerPage:250,maxEmptySpace:Infinity,bufferRows:10,
farOffRemoval:2E3,queryRowsOverlap:0,pagingMethod:"debounce",pagingDelay:c.defaultDelay,keepScrollPosition:!1,rowHeight:0,_deleteQueue:[],postCreate:function(){this.inherited(arguments);var d=this;l(this.bodyNode,"scroll",c[this.pagingMethod](function(h){d._processScroll(h)},null,this.pagingDelay))},renderQuery:function(d,h){var p=this,t=h&&h.container||this.contentNode,w,u=0,r=h&&h.start||0;"level"in d&&(u=w=d.level);var y={query:d,count:0,level:u,top:!1};var B={node:m.create("div",{className:"dgrid-preload",
style:{height:"0"}},t),count:0,query:d,next:y,level:u,top:!0};var C=B.node;C.rowIndex=0;y.previous=B;var G=y.node=m.create("div",{className:"dgrid-preload",style:{height:"0"}},t);B.id=g++;C.setAttribute("data-preloadid",B.id);y.id=g++;G.setAttribute("data-preloadid",y.id);G.rowIndex=this.minRowsPerPage;p._insertPreload(B);var x=m.create("div",{className:"dgrid-loading"},G,"before");m.create("div",{className:"dgrid-below"},x).innerHTML=this.loadingMessage;h=q.mixin({start:0,count:this.minRowsPerPage},
h);null!=w&&(h.queryLevel=w);return this._trackError(function(){var v=d(h);return p.renderQueryResults(v,G,h).then(function(z){return v.totalLength.then(function(A){var F=z.length,J=G.parentNode;!p._rows||"queryLevel"in h||(p._rows.min=0,p._rows.max=F===A?Infinity:F-1);m.destroy(x);"queryLevel"in h||(p._total=A);0===A&&J&&(p.noDataNode&&m.destroy(p.noDataNode),p._insertNoDataNode(J));B.count=r;y.count=A-F-r;G.rowIndex=r+F;A?p._updatePreloadRowHeights(B):(G.style.display="none",C.style.display="none");
p._previousScrollPosition&&J&&J.offsetHeight&&(p.scrollTo(p._previousScrollPosition),delete p._previousScrollPosition);return b(p._processScroll()).then(function(){return z})})}).otherwise(function(z){m.destroy(x);throw z;})})},_insertPreload:function(d){var h=this.preload;if(h){for(;h.node.compareDocumentPosition(d.node)&Node.DOCUMENT_POSITION_PRECEDING;)if(h=h.previous,null==h)return;for(;h.node.compareDocumentPosition(d.node)&Node.DOCUMENT_POSITION_FOLLOWING&&h.next;)h=h.next;h.previous.next=d;
d.previous=h.previous;d=d.next;d.next=h;h.previous=d}else this.preload=d},refresh:function(d){var h=this,p=d&&d.keepScrollPosition,t;"undefined"===typeof p&&(p=this.keepScrollPosition);p&&(this._previousScrollPosition=this.getScrollPosition());this.inherited(arguments);if(this._renderedCollection)return this.renderQuery(function(w){w=h._renderedCollection.fetchRange({start:w.start,end:w.start+w.count});w.then(function(u){t=u});return w}).then(function(){h._emitRefreshComplete();return t})},resize:function(){this.inherited(arguments);
this._processScroll()},cleanup:function(){this.inherited(arguments);this.preload=null},renderQueryResults:function(d){var h=this.inherited(arguments),p=this._getRenderedCollection(this.preload);p&&p.releaseRange&&h.then(function(t){t[0]&&!t[0].parentNode.tagName&&d.totalLength.then(function(){p.releaseRange(t[0].rowIndex,t[t.length-1].rowIndex+1)})});return h},_getFirstRowSibling:function(d){return d.lastChild},_calcRowHeight:function(d){var h=d.nextSibling;return h&&!/\bdgrid-preload\b/.test(h.className)?
h.offsetTop-d.offsetTop:d.offsetHeight},_calcAverageRowHeight:function(d){for(var h=d.length,p=0,t=0;t<h;t++)p+=this._calcRowHeight(d[t]);return h&&p?p/h:0},_updatePreloadRowHeights:function(){var d=this.preload,h=0;if(d){for(;d.previous;)d=d.previous;for(;d;)d.rowHeight||(d.rowHeight=this._calcAverageRowHeight(d.node.parentNode.querySelectorAll(".dgrid-row")),this._adjustPreloadHeight(d)),h=d?d.rowHeight:h,d=d.next;this.rowHeight=h}},lastScrollTop:0,_processScroll:function(d){function h(da,ea){ea=
ea?"next":"previous";for(var fa;fa=da[ea];)da=fa;return da}function p(da,ea){function fa(){a:{var T=!ea;for(var ba=da;ba=ba[ea?"previous":"next"];)if(T===ba.top){T=ba;break a}T=void 0}if(T&&aa!==T&&!e(T.top?T.node.nextSibling:T.node.previousSibling))return V(),da=T,O=da.node,Y=ea?da.node.offsetTop-C:B-(da.node.offsetTop+da.node.offsetHeight),oa=(T=K(O))&&T.rowIndex,W=void 0,T}function K(T){var ba=e(T);(T=T[E])&&!f(T)&&(T=ba&&e(T)?null:(ba=fa())?ba:K(T));return T}function V(){da.count+=N;ea&&(O.rowIndex-=
N);r._adjustPreloadHeight(da);N=0;r._releaseRange(da,ea,oa,W)}var aa=da;da=h(da,ea);var Y=ea?da.node.offsetTop-C:B-(da.node.offsetTop+da.node.offsetHeight),I=r.farOffRemoval,O=da.node,E=ea?"previousSibling":"nextSibling",N=0,R=0,W;if(Y>2*I){var ha;var oa=(ha=K(O))&&ha.rowIndex;for(W=void 0;ha&&aa!==da;){var ma=r._calcRowHeight(ha);R+ma+I>Y||!f(ha)?ha=fa():(R+=ma,N+=ha.count||1,r._pruneRow(ha,ea),"rowIndex"in ha&&(W=ha.rowIndex),ha=K(ha))}V();r._deleteNodeQueue()}}function t(da,ea){do da=ea?da.next:
da.previous;while(da&&!da.node.offsetWidth);return da}var w=this.preload,u;this._updatePreloadRowHeights();if(u=w&&w.rowHeight){var r=this,y=r.bodyNode,B=d&&d.scrollTop||this.getScrollPosition().y,C=y.offsetHeight+B;d=r.lastScrollTop;y=r.bufferRows*u;var G=y-u,x,v=!0;for(r.lastScrollTop=B;w&&!w.node.offsetWidth;)w=w.previous;for(;w&&w!==z;){var z=r.preload;r.preload=w;u=w.node;var A=u.offsetTop;if(C+1+G<A)w=t(w,v=!1);else if(B-1-G>A+u.offsetHeight)w=t(w,v=!0);else{A=((u.top?B-y:C)-A)/w.rowHeight;
var F=(C-B+2*y)/w.rowHeight;F+=Math.min(Math.abs(Math.max(Math.min((B-d)*w.rowHeight,r.maxRowsPerPage/2),r.maxRowsPerPage/-2)),10);u.top&&(A-=F);A=Math.max(A,0);10>A&&0<A&&F+A<r.maxRowsPerPage&&(F+=Math.max(0,A),A=0);F=Math.min(Math.max(F,r.minRowsPerPage),r.maxRowsPerPage,w.count);if(0===F)w=t(w,v);else{F=Math.ceil(F);A=Math.min(Math.floor(A),w.count-F);var J={};w.count-=F;var L=u,P=r.queryRowsOverlap,Q=!w.top&&w;if(Q)w.previous&&(p(w),0<A&&e(u.previousSibling)?(A=Math.min(w.count,A),w.previous.count+=
A,r._adjustPreloadHeight(w.previous,!0),u.rowIndex+=A,P=0):F+=A,w.count-=A),J.start=u.rowIndex-P,J.count=Math.min(F+P,r.maxRowsPerPage),u.rowIndex=J.start+J.count;else{if(w.next)if(L=u.nextSibling,p(w,!0),e(u.nextSibling))w.next.count+=w.count-A,w.next.node.rowIndex=A+F,r._adjustPreloadHeight(w.next),w.count=A,P=0,L=w.next.node;else var Z=!0;J.start=w.count;J.count=Math.min(F+P,r.maxRowsPerPage);J.scrollingUp=!0}Z&&L&&L.offsetWidth&&(Z=L.offsetTop);r._adjustPreloadHeight(w);"level"in w.query&&(J.queryLevel=
w.query.level);if("queryLevel"in J||!(J.start>r._total||0>J.count)){var ca=m.create("div",{className:"dgrid-loading",style:{height:F*w.rowHeight+"px"}},L,"before");m.create("div",{className:"dgrid-"+(Q?"below":"above"),innerHTML:r.loadingMessage},ca);ca.count=F;r._trackError(function(){(function(da,ea,fa){var K=w.query(J);x=r.renderQueryResults(K,da,J).then(function(V){var aa=r._rows;!aa||"queryLevel"in J||!V.length||(ea?(aa.max<=aa.min&&(aa.min=V[0].rowIndex),aa.max=V[V.length-1].rowIndex):(aa.max<=
aa.min&&(aa.max=V[V.length-1].rowIndex),aa.min=V[0].rowIndex));L=da.nextSibling;m.destroy(da);fa&&L&&L.offsetWidth&&r.scrollTo({y:r.bodyNode.scrollTop+L.offsetTop-fa});K.totalLength.then(function(Y){"queryLevel"in J||(r._total=Y,r._rows&&r._rows.max>=r._total-1&&(r._rows.max=Infinity));ea&&(ea.count=Y-ea.node.rowIndex,r._adjustPreloadHeight(ea))});r._processScroll();return V},function(V){m.destroy(da);throw V;})})(ca,Q,Z)});w=w.previous}}}}return x}},_adjustPreloadHeight:function(d,h){d.node.style.height=
this._calculatePreloadHeight(d,h)+"px"},_calculatePreloadHeight:function(d,h){return Math.min(d.count*d.rowHeight,h?Infinity:this.maxEmptySpace)},_pruneRow:function(d,h,p){this.removeRow(d,!0,p);this._queueNodeForDeletion(d)},_queueNodeForDeletion:function(d){this._deleteQueue.push(d)},_deleteNodeQueue:function(){for(var d=document.createElement("div"),h=this._deleteQueue,p=h.length;p--;)d.appendChild(h[p]);this._deleteQueue=[];setTimeout(function(){m.destroy(d)},1)},_removePreloads:function(d){if(d&&
d.length){var h=this,p=this._getHeadPreload();d.forEach(function(t){if(t=h._findPreload(t,p))t.previous&&(t.previous.next=t.next),t.next&&(t.next.previous=t.previous)})}},_getHeadPreload:function(){var d=this.preload;if(d)for(;d.previous;)d=d.previous;return d},_findPreload:function(d,h){for(h||(h=this._getHeadPreload());h;){if(h.node===d)return h;h=h.next}},_getRenderedCollection:function(){return this._renderedCollection},_releaseRange:function(d,h,p,t){if(d){var w=d.level;d=this._getRenderedCollection(d);
null!=t&&d.releaseRange&&"number"===typeof p&&"number"===typeof t&&(h?d.releaseRange(t,p+1):d.releaseRange(p,t+1),this._rows&&!w&&(this._rows[h?"max":"min"]=t,this._rows.max>=this._total-1&&(this._rows.max=Infinity)))}}})})},"dgrid1/_StoreMixin":function(){define("dojo/_base/declare dojo/_base/lang dojo/Deferred dojo/aspect dojo/dom-construct dojo/has dojo/on dojo/when".split(" "),function(H,k,n,q,m,l,b,a){function c(f){if("object"!==typeof f)f=Error(f);else if("cancel"===f.dojoType)return;b.emit(this.domNode,
"dgrid-error",{grid:this,error:f,cancelable:!0,bubbles:!0})&&console.error(f)}return H(null,{collection:null,_renderedCollection:null,_rows:null,_observerHandle:null,_structureHandle:null,shouldTrackCollection:!0,getBeforePut:!0,noDataMessage:"",loadingMessage:"",_total:0,constructor:function(){this.dirty={};this._updating={};this._columnsWithSet={};this._structureHandle=q.before(this,"configStructure",k.hitch(this,function(){this._columnsWithSet={}}))},destroy:function(){this.inherited(arguments);
this._structureHandle&&this._structureHandle.remove();this._renderedCollection&&this._cleanupCollection();this._refreshTimeout&&clearTimeout(this._refreshTimeout)},_configColumn:function(f){f.set&&(this._columnsWithSet[f.field]=f);this.inherited(arguments)},_setCollection:function(f){this._renderedCollection&&(this.cleanup(),this._cleanupCollection({shouldRevert:!f||f.storage!==this._renderedCollection.storage}));this.collection=f;if(this._started){if(f){var e=f;this.sort&&0<this.sort.length&&(e=
f.sort(this.sort));e.track&&this.shouldTrackCollection&&(e=e.track(),this._rows=[],this._observerHandle=this._observeCollection(e,this.contentNode,{rows:this._rows}));this._renderedCollection=e}this.refresh()}},_setStore:function(){this.collection||console.debug("set('store') call detected, but you probably meant set('collection')")},_getTotal:function(){return this._total},_cleanupCollection:function(f){f=f||{};this._observerHandle&&(this._observerHandle.remove(),this._observerHandle=this._rows=
null);!1!==f.shouldRevert&&(this.dirty={});this._renderedCollection=this.collection=null},_applySort:function(){this.collection?this.set("collection",this.collection):this.store&&console.debug("_StoreMixin found store property but not collection; this is often the sign of a mistake during migration from 0.3 to 0.4")},_emitRefreshComplete:function(){var f=this;this._refreshTimeout=setTimeout(function(){b.emit(f.domNode,"dgrid-refresh-complete",{bubbles:!0,cancelable:!1,grid:f});f._refreshTimeout=null},
0)},_insertNoDataNode:function(f){this._removeNoDataNode();f=f||this.contentNode;var e=this.noDataNode=m.create("div",{className:"dgrid-no-data",innerHTML:this.noDataMessage});f.insertBefore(e,this._getFirstRowSibling?this._getFirstRowSibling(f):null);return e},_removeNoDataNode:function(){return this.noDataNode?(m.destroy(this.noDataNode),delete this.noDataNode,!0):!1},row:function(){var f=this.inherited(arguments);f&&f.data&&"undefined"!==typeof f.id&&(f.id=this.collection.getIdentity(f.data));
return f},refresh:function(){var f=this.inherited(arguments);this.collection||this._insertNoDataNode();return f},refreshCell:function(f){if(!this.collection||!this._createBodyRowCell)throw Error("refreshCell requires a Grid with a collection.");this.inherited(arguments);return this.collection.get(f.row.id).then(k.hitch(this,"_refreshCellFromItem",f))},_refreshCellFromItem:function(f,e,g){var d=f.element;m.empty(d);var h=this.dirty&&this.dirty[f.row.id];h&&(e=k.delegate(e,h));this._createBodyRowCell(d,
f.column,e,g)},renderArray:function(){var f=this.inherited(arguments);this.collection||f.length&&this.noDataNode&&m.destroy(this.noDataNode);return f},insertRow:function(f,e,g,d,h){var p=this.collection,t=this.dirty;p=p&&p.getIdentity(f);var w;p in t&&!(p in this._updating)&&(w=t[p]);w&&(f=k.delegate(f,w));t=this.inherited(arguments);h&&h.rows&&(h.rows[d]=t);this.noDataNode&&(m.destroy(this.noDataNode),this.noDataNode=null);return t},updateDirty:function(f,e,g){var d=this.dirty,h=d[f];h||(h=d[f]=
{});h[e]=g},save:function(){function f(y,B){return function(C){var G=e._columnsWithSet,x=e._updating,v;if("function"===typeof C.set)C.set(B);else for(v in B)C[v]=B[v];for(v in G){var z=G[v].set(C);void 0!==z&&(C[v]=z)}x[y]=!0;return g.put(C).then(function(A){delete d[y];delete x[y];p[y]=A;return p})}}var e=this,g=this.collection,d=this.dirty,h=new n,p={},t=function(y){var B;return e.getBeforePut||!(B=e.row(y).data)?function(){return g.get(y)}:function(){return B}},w=h.then(function(){return p}),u;
for(u in d){var r=f(u,d[u]);w=w.then(t(u)).then(r)}h.resolve();return w},revert:function(){this.dirty={};this.refresh()},_trackError:function(f){"string"===typeof f&&(f=k.hitch(this,f));var e=this;try{var g=a(f())}catch(d){f=new n,f.reject(d),g=f.promise}g.otherwise(function(d){c.call(e,d)});return g},removeRow:function(f,e,g){var d={element:f};e||this.up(d).element!==f||this.down(d).element!==f||this._insertNoDataNode();(d=g&&g.rows||this._rows)&&delete d[f.rowIndex];return this.inherited(arguments)},
renderQueryResults:function(f,e,g){g=k.mixin({rows:this._rows},g);var d=this;return f.then(function(h){h=d.renderArray(h,e,g);delete d._lastCollection;return h})},_observeCollection:function(f,e,g){var d=this,h=g.rows,p,t=[f.on("delete, update",function(w){var u=w.previousIndex,r=w.index;void 0!==u&&h[u]&&("max"in h&&(void 0===r||r<h.min||r>h.max)&&h.max--,0>h.max&&(h.max=0),p=h[u],p.parentNode===e&&d.removeRow(p,!1,g),h.splice(u,1),("delete"===w.type||"update"===w.type&&(u<r||void 0===r))&&h[u]&&
h[u].rowIndex--);"delete"===w.type&&(p=null)}),f.on("add, update",function(w){var u=w.previousIndex,r=w.index;if(void 0!==r&&(!("max"in h)||r>=h.min&&r<=h.max)){"max"in h&&(void 0===u||u<h.min||u>h.max)&&h.max++;if(h.length){if(u=h[r],!u&&(u=h[r-1]))u=(u.connected||u).nextSibling}else u=d._getFirstRowSibling&&d._getFirstRowSibling(e);p&&u&&p.id===u.id&&(u=(u.connected||u).nextSibling);u&&!u.parentNode&&(u=document.getElementById(u.id));h.splice(r,0,void 0);p=d.insertRow(w.target,e,u,r,g);d.highlightRow(p)}p=
null}),f.on("add, delete, update",function(w){var u="undefined"!==typeof w.previousIndex?w.previousIndex:Infinity,r="undefined"!==typeof w.index?w.index:Infinity,y=Math.min(u,r);u!==r&&h[y]&&d.adjustRowIndices(h[y]);Infinity!==u&&d._processScroll&&(h[u]||h[u-1])&&d._processScroll();d._onNotification(h,w,f);f===d._renderedCollection&&"totalLength"in w&&(d._total=w.totalLength)})];return{remove:function(){for(;0<t.length;)t.pop().remove()}}},_onNotification:function(){}})})},"dgrid1/Tree":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/aspect dojo/Deferred dojo/dom-construct dojo/dom-class dojo/on dojo/promise/all dojo/query dojo/when ./util/has-css3 ./Grid dojo/has!touch?./util/touch".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h){return H(null,{collapseOnRefresh:!1,enableTreeTransitions:!0,treeIndentWidth:9,constructor:function(){this._treeColumnListeners=[]},shouldExpand:function(p,t,w){return w},expand:function(p,t,w,u){function r(){x||y._processScroll&&y._processScroll()}if(!this._treeColumn)return e();var y=this,B=p.element?p:this.row(p),C=!!this._expanded[B.id],G=g("transitionend");p=B.element;p=-1<p.className.indexOf("dgrid-expando-icon")?p:f(".dgrid-expando-icon",p)[0];w=w||!this.enableTreeTransitions;
if(p&&p.mayHaveChildren&&(w||t!==C)){var x=void 0===t?!this._expanded[B.id]:t,v=this.getScrollPosition();this._resetExpanded(B.id,x);b.replace(p,"ui-icon-triangle-1-"+(x?"se":"e"),"ui-icon-triangle-1-"+(x?"e":"se"));b.toggle(B.element,"dgrid-row-expanded",x);t=B.element;var z=t.connected,A={};if(!z){z=A.container=t.connected=l.create("div",{className:"dgrid-tree-container"},t,"after");var F=function(Z){var ca=y._renderedCollection.getChildren(B.data);y.sort&&0<y.sort.length&&(ca=ca.sort(y.sort));
ca.track&&y.shouldTrackCollection&&(z._rows=Z.rows=[],ca=ca.track(),z._handles=[ca.tracking,y._observeCollection(ca,z,Z)]);F.collection=ca;return"start"in Z?ca.fetchRange({start:Z.start,end:Z.start+Z.count}):ca.fetch()};"level"in p&&(z.level=F.level=p.level+1);if(this.renderQuery)var J=u?y._renderedCollection.getChildren(B.data).fetchRange({start:0,end:1}).totalLength.then(function(Z){A.start=Z-y.minRowsPerPage;A.end=Z-1;A.count=y.minRowsPerPage;y._previousScrollPosition=v;return y.renderQuery(F,
A)}):this.renderQuery(F,A);else{var L=l.create("div",null,z);J=this._trackError(function(){return y.renderQueryResults(F(A),L,k.mixin({rows:A.rows},"level"in F?{queryLevel:F.level}:null)).then(function(Z){l.destroy(L);return Z})})}G&&a(z,G,this._onTreeTransitionEnd)}z.hidden=!x;var P=z.style;if(!G||w)P.display=x?"block":"none",P.height="",r();else{a.once(z,G,r);if(x){P.display="block";var Q=z.scrollHeight;P.height="0px"}else b.add(z,"dgrid-tree-resetting"),P.height=z.scrollHeight+"px";setTimeout(function(){b.remove(z,
"dgrid-tree-resetting");P.height=x?Q?Q+"px":"auto":"0px"},0)}}return e(J)},_configColumns:function(){var p=this.inherited(arguments);this._resetExpanded();for(var t=0,w=p.length;t<w;t++)if(p[t].renderExpando){this._configureTreeColumn(p[t]);break}return p},insertRow:function(p,t,w,u,r){r=r||{};var y=r.queryLevel="queryLevel"in r?r.queryLevel:"level"in t?t.level:0,B=this.inherited(arguments),C=this.row(B);(y=this.shouldExpand(C,y,this._expanded[C.id]))&&this._expandWhenInDom(B,r);(y||!this.collection.mayHaveChildren||
this.collection.mayHaveChildren(p))&&b.add(B,"dgrid-row-expandable");return B},_expandWhenInDom:function(p,t,w){p.offsetHeight?(p=this.expand(p,!0,!0,t.scrollingUp),w&&p.then(function(){w.resolve()})):p.parentNode&&this.domNode.offsetHeight&&(this._expandPromises&&!w&&(w=new m,this._expandPromises.push(w.promise)),setTimeout(this._expandWhenInDom.bind(this,p,t,w),0))},_queueNodeForDeletion:function(p){this.inherited(arguments);var t=p.connected;t&&this._deleteQueue.push(t)},_pruneRow:function(p,t){var w=
p.connected,u;if(w){var r=this.row(p).id;this._expanded[r]&&(u=f("\x3e.dgrid-preload",w)[t?1:0])&&(u=this._findPreload(u),u=t?u.next:u.previous,u.expandedContent||(u.expandedContent={}),u.expandedContent[r]=w.offsetHeight)}this.inherited(arguments,[p,t,{treePrune:!0,removeBelow:t}])},refresh:function(p){this._expandPromises=[];var t=(this.keepScrollPosition||p&&p.keepScrollPosition)&&Object.keys(this._expanded).length?this.inherited(arguments,k.mixin(p||{},{keepScrollPosition:!1})):this.inherited(arguments);
return e(t).then(function(){var w=this._expandPromises;delete this._expandPromises;return c(w)}.bind(this))},removeRow:function(p,t,w){var u=p.connected,r={};if(u){u._handles&&(n.forEach(u._handles,function(x){x.remove()}),delete u._handles);u._rows&&(r.rows=u._rows);var y=f("\x3e.dgrid-row",u);var B=f("\x3e.dgrid-preload",u);if(y&&y.length){if(this._releaseRange){var C=y[0].rowIndex;var G=y[y.length-1].rowIndex;this._releaseRange(this._findPreload(B[0]),!1,C,G)}y.forEach(function(x){w&&w.treePrune?
this._pruneRow(x,w.removeBelow):this.removeRow(x,!0,r)},this)}this._removePreloads&&this._removePreloads(B);u._rows&&(u._rows.length=0,delete u._rows);t?this._queueNodeForDeletion(u):l.destroy(u)}this.inherited(arguments)},_refreshCellFromItem:function(p,t){if(!p.column.renderExpando)return this.inherited(arguments);this.inherited(arguments,[p,t,{queryLevel:f(".dgrid-expando-icon",p.element)[0].level}])},cleanup:function(){this.inherited(arguments);this.collapseOnRefresh&&this._resetExpanded()},_destroyColumns:function(){this.inherited(arguments);
for(var p=this._treeColumnListeners,t=p.length;t--;)p[t].remove();this._treeColumnListeners=[];this._treeColumn=null},_calcRowHeight:function(p){var t=p.connected;return this.inherited(arguments)+(t?t.offsetHeight:0)},_configureTreeColumn:function(p){var t=this,w=".dgrid-content .dgrid-column-"+p.id,u;this._treeColumn=p;if(!p._isConfiguredTreeColumn){var r=p.renderCell||this._defaultRenderCell;p._isConfiguredTreeColumn=!0;p.renderCell=function(B,C,G,x){var v=x&&"queryLevel"in x?x.queryLevel:0,z=!t.collection.mayHaveChildren||
t.collection.mayHaveChildren(B);var A=p.renderExpando(v,z,t._expanded[t.collection.getIdentity(B)],B);A.level=v;A.mayHaveChildren=z;(B=r.call(p,B,C,G,x))&&B.nodeType?(G.appendChild(A),G.appendChild(B)):G.insertBefore(A,G.firstChild)};"function"!==typeof p.renderExpando&&(p.renderExpando=this._defaultRenderExpando)}var y=this._treeColumnListeners;0===y.length&&(y.push(this.on(p.expandOn||".dgrid-expando-icon:click,"+w+":dblclick,"+w+":keydown",function(B){var C=t.row(B);t.collection.mayHaveChildren&&
!t.collection.mayHaveChildren(C.data)||"keydown"===B.type&&32!==B.keyCode||"dblclick"===B.type&&u&&1<u.count&&C.id===u.id&&-1<B.target.className.indexOf("dgrid-expando-icon")||t.expand(C);-1<B.target.className.indexOf("dgrid-expando-icon")&&(u&&u.id===t.row(B).id?u.count++:u={id:t.row(B).id,count:1})})),g("touch")&&y.push(this.on(h.selector(w,h.dbltap),function(){t.expand(this)})))},_defaultRenderExpando:function(p,t,w){var u=this.grid.isRTL?"right":"left",r="dgrid-expando-icon";t&&(r+=" ui-icon ui-icon-triangle-1-"+
(w?"se":"e"));return l.create("div",{className:r,innerHTML:"\x26nbsp;",style:"margin-"+u+": "+p*this.grid.treeIndentWidth+"px; float: "+u+";"})},_onNotification:function(p,t){"delete"===t.type&&this._resetExpanded(t.id);this.inherited(arguments)},_onTreeTransitionEnd:function(p){var t=this,w=this.style.height;w&&(this.style.display="0px"===w?"none":"block");p&&(b.add(this,"dgrid-tree-resetting"),setTimeout(function(){b.remove(t,"dgrid-tree-resetting")},0));this.style.height=""},_resetPlaceHolder:function(p){var t=
this._getHeadPreload&&this._getHeadPreload();if(t)if(null!=p)a:for(;t;){var w=t.expandedContent;if(w&&w[p]){delete w[p];this._adjustPreloadHeight(t);break a}t=t.next}else for(p=t;p;)p.expandedContent&&(delete p.expandedContent,this._adjustPreloadHeight(p)),p=p.next},_resetExpanded:function(p,t){this._resetPlaceHolder(p);null==p?this._expanded={}:t?this._expanded[p]=!0:delete this._expanded[p]},_calculatePreloadHeight:function(p){var t=this.inherited(arguments),w=p.expandedContent;w&&Object.keys(w).forEach(function(u){t+=
w[u]});return t},_getRenderedCollection:function(p){return p.level?p.query.collection:this.inherited(arguments)}})})},"dgrid1/util/has-css3":function(){define(["dojo/has"],function(H){function k(q,m){q=q.style;var l;if(m in q)return!0;m=m.slice(0,1).toUpperCase()+m.slice(1);for(l=n.length;l--;)if(n[l]+m in q)return n[l];return!1}var n=["ms","O","Moz","Webkit"];H.add("css-transitions",function(q,m,l){return k(l,"transitionProperty")});H.add("css-transforms",function(q,m,l){return k(l,"transform")});
H.add("css-transforms3d",function(q,m,l){return k(l,"perspective")});H.add("transitionend",function(){var q=H("css-transitions");return q?!0===q?"transitionend":{ms:"MSTransitionEnd",O:"oTransitionEnd",Moz:"transitionend",Webkit:"webkitTransitionEnd"}[q]:!1});return H})},"dgrid1/Editor":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/Deferred dojo/dom-construct dojo/dom-class dojo/on dojo/query dojo/sniff ./Grid".split(" "),function(H,k,n,q,m,l,b,a,c,f){return k(null,{editorFocusWrapperClassName:"dgrid-editor-focus-wrapper",
constructor:function(){this._editorInstances={};this._editorColumnListeners=[];this._editorCellListeners={};this._editorsPendingStartup=[]},postCreate:function(){var e=this;this.inherited(arguments);this.on(".dgrid-input:focusin",function(){e._focusedEditorCell=e.cell(this)});this._editorFocusoutHandle=b.pausable(this.domNode,".dgrid-input:focusout",function(g){e._focusedEditorCell&&e._focusedEditorCell.element.contains(g.target)||(e._focusedEditorCell=null)});this._listeners.push(this._editorFocusoutHandle)},
insertRow:function(){this._editorRowListeners={};var e=this.inherited(arguments),g=this.row(e),d=this._editorCellListeners[e.id]=this._editorCellListeners[e.id]||{},h;for(h in this._editorRowListeners)d[h]=this._editorRowListeners[h];this._editorRowListeners=null;(d=this._previouslyFocusedEditorCell)&&d.row.id===g.id&&(this.edit(this.cell(g,d.column.id)),this._previouslyFocusedEditorCell=null);return e},refresh:function(){for(var e in this._editorInstances){var g=this._getEditorRootNode(this._editorInstances[e].domNode);
g&&g.parentNode&&(this._removeEditorBlurHandles(),g.parentNode.removeChild(g))}return this.inherited(arguments)},removeRow:function(e){var g=this,d=this._focusedEditorCell,h=this.row(e);d&&h&&d.row.id===h.id&&(this._previouslyFocusedEditorCell=d,this._editorFocusoutHandle.pause(),setTimeout(function(){g._editorFocusoutHandle.resume();g._previouslyFocusedEditorCell=null},0));if(this._editorCellListeners[e.id]){for(var p in this._editorCellListeners[e.id])this._editorCellListeners[e.id][p].remove();
delete this._editorCellListeners[e.id]}for(d=this._alwaysOnWidgetColumns.length;d--;)if(h=(h=this.cell(e,this._alwaysOnWidgetColumns[d].id).element)&&(h.contents||h).widget)this._editorFocusoutHandle.pause(),h.destroyRecursive(),this._editorFocusoutHandle.resume();return this.inherited(arguments)},renderArray:function(){var e=this.inherited(arguments);e.length?this._startupPendingEditors():this._editorsPendingStartup=[];return e},_onNotification:function(){this.inherited(arguments);this._startupPendingEditors()},
_destroyColumns:function(){this._editorStructureCleanup();this.inherited(arguments)},_editorStructureCleanup:function(){var e=this._editorInstances,g=this._editorColumnListeners;this._editTimer&&clearTimeout(this._editTimer);for(var d in e){var h=e[d];h.domNode&&h.destroyRecursive()}this._editorInstances={};for(e=g.length;e--;)g[e].remove();for(var p in this._editorCellListeners)for(d in this._editorCellListeners[p])this._editorCellListeners[p][d].remove();for(e=0;e<this._editorColumnListeners.length;e++)this._editorColumnListeners[e].remove();
this._editorCellListeners={};this._editorColumnListeners=[];this._editorsPendingStartup=[]},configStructure:function(){this._alwaysOnWidgetColumns=[];this.inherited(arguments)},_configColumns:function(){for(var e=this.inherited(arguments),g=0,d=e.length;g<d;g++)e[g].editor&&this._configureEditorColumn(e[g]);return e},_configureEditorColumn:function(e){var g=this,d=e.renderCell||this._defaultRenderCell,h=e.editOn,p="string"!==typeof e.editor;h?this._editorInstances[e.id]=this._createSharedEditor(e,
d):p&&this._alwaysOnWidgetColumns.push(e);e.renderCell=h?function(t,w,u,r){if(!r||!r.alreadyHooked){var y=b(u,h,function(){g._activeOptions=r;g.edit(this)});if(g._editorRowListeners)g._editorRowListeners[e.id]=y;else{var B=g.row(t);g._editorCellListeners[B.element.id][e.id]=y}}return d.call(e,t,w,u,r)}:function(t,w,u,r){if(!e.canEdit||e.canEdit(t,w))t=g._createEditor(e,t),g._showEditor(t,e,u,w),u[p?"widget":"input"]=t;else return d.call(e,t,w,u,r)}},edit:function(e){function g(C){d._activeCell=u;
d._showEditor(p,t,u,y);d._editTimer=setTimeout(function(){var G=d._getEditorFocusNode(p);G.focus&&G.focus();t._editorBlurHandle&&t._editorBlurHandle.resume();d._editTimer=null;C.resolve(p)},0)}var d=this,h,p;e.column||(e=this.cell(e));if(!e||!e.element)return null;this._previouslyFocusedEditorCell=e;var t=e.column;var w=t.field;var u=e.element.contents||e.element;if(p=this._editorInstances[t.id]){if(this._activeCell!==u){var r=e.row;var y=(h=this.dirty&&this.dirty[r.id])&&w in h?h[w]:t.get?t.get(r.data):
r.data[w];if(!t.canEdit||t.canEdit(e.row.data,y)){var B=new q;e=this._getEditorFocusNode(p);e.offsetWidth?(e.blur(),setTimeout(function(){g(B)},0)):g(B);return B.promise}}}else if(t.editor&&(p=u.widget||u.input))return B=new q,p.focus&&p.focus(),B.resolve(p),B.promise;return null},refreshCell:function(e){var g=e.column,d=g.get?g.get(e.row.data):e.row.data[g.field],h;g.editor&&(e.column.editOn&&this._activeCell===e.element?h=this._editorInstances[e.column.id]:e.column.editOn||(h=e.element.widget||
e.element.input));if(h)return h.domNode?h.set("value",d):this._updateInputValue(h,d),(new q).resolve();g._editorBlurHandle&&g._editorBlurHandle.remove();return this.inherited(arguments)},_showEditor:function(e,g,d,h){var p=e.domNode;p||this._updateInputValue(e,h);d.innerHTML="";l.add(d,"dgrid-cell-editing");p&&g.editOn&&e.validate&&e.reset&&e.reset();d.appendChild(this._getEditorRootNode(e));p&&!g.editOn?this._editorsPendingStartup.push([e,g,d,h]):this._startupEditor(e,g,d,h)},_startupEditor:function(e,
g,d,h){e.domNode&&(e._started||e.startup(),e._dgridIgnoreChange=!0,e.set("value",h),setTimeout(function(){e._dgridIgnoreChange=!1},0));e._dgridLastValue=h;this._activeCell&&(this._activeValue=h,b.emit(d,"dgrid-editor-show",{grid:this,cell:this.cell(d),column:g,editor:e,bubbles:!0,cancelable:!1}))},_startupPendingEditors:function(){for(var e=this._editorsPendingStartup,g=e.length;g--;)this._startupEditor.apply(this,e[g]);this._editorsPendingStartup=[]},_handleEditorChange:function(e,g){var d=e.target;
"_dgridLastValue"in d&&-1<d.className.indexOf("dgrid-input")&&this._updatePropertyFromEditor(g||this.cell(d).column,d,e)},_getEditorFocusNode:function(e){var g=e.parentNode||e.domNode&&e.domNode.parentNode;g&&l.contains(g,this.editorFocusWrapperClassName)||(g=e.focusNode||e.domNode||e);return g},_getEditorRootNode:function(e){if(e){var g=e.parentNode||e.domNode&&e.domNode.parentNode;g&&l.contains(g,this.editorFocusWrapperClassName)||(g=e.domNode||e);return g}},_createEditorFocusWrapper:function(e,
g){isNaN(g)&&(g=isNaN(e.tabIndex)?-1:e.tabIndex);g=m.create("div",{className:this.editorFocusWrapperClassName,tabIndex:g});g.appendChild(e);return g},_createEditor:function(e,g){var d=e.editor,h=e.editOn,p=this,t="string"!==typeof d&&d,w={};var u=e.editorArgs||{};"function"===typeof u&&(u=u.call(this,e,g));if(t){var r=new t(u);u=r.focusNode||r.domNode;u.className+=" dgrid-input";if(c("mac")&&e.editOn&&/checkbox|radio/i.test(u.type))u=this._createEditorFocusWrapper(r.domNode,e.tabIndex),this._listeners.push(b(u,
"blur",function(){r._dgridIgnoreChange||p._updatePropertyFromEditor(e,r,{type:"widget"})}));else if(!h)r.on("change",function(){r._dgridIgnoreChange||p._updatePropertyFromEditor(e,r,{type:"widget"})})}else this._hasInputListener||(this._hasInputListener=!0,this.on("change",function(B){p._handleEditorChange(B)})),"textarea"===d?t="textarea":(t="input",w.type=d),r=u=m.create(t,n.mixin(w,{className:"dgrid-input",name:e.field,tabIndex:isNaN(e.tabIndex)?-1:e.tabIndex},u)),c("mac")&&e.editOn&&/checkbox|radio/i.test(d)&&
(u=this._createEditorFocusWrapper(r),r.tabIndex=0,r.removeAttribute("tabindex")),9>c("ie")&&(d="radio"===d||"checkbox"===d?b(r,"click",function(B){p._handleEditorChange(B,e)}):b(r,"change",function(B){p._handleEditorChange(B,e)}),h?this._editorColumnListeners.push(d):this._editorRowListeners?this._editorRowListeners[e.id]=d:this._editorCellListeners[this.row(g).element.id][e.id]=d);if(e.autoSelect){var y=r.focusNode||r;y.select&&b(y,"focus",function(){setTimeout(function(){y.select()},0)})}return r},
_createSharedEditor:function(e){function g(){var r=h._activeCell;w.blur();"function"===typeof h.focus&&setTimeout(function(){h.focus(r)},p&&9>c("ie")?15:0)}var d=this._createEditor(e),h=this,p=d.domNode,t=this._getEditorRootNode(d),w=this._getEditorFocusNode(d),u=p?function(){d.set("value",d._dgridLastValue)}:function(){h._updateInputValue(d,d._dgridLastValue);h._updatePropertyFromEditor(e,d)};this._editorColumnListeners.push(b(w,"keydown",function(r){r=r.keyCode||r.which;27===r?(u(),h._activeValue=
d._dgridLastValue,g()):13===r&&!1!==e.dismissOnEnter&&g()}));(e._editorBlurHandle=b.pausable(this._getEditorFocusNode(d),"blur",function(r){if(!d.dropDown||!d.dropDown.domNode.contains(r.relatedTarget||document.activeElement)){if(r&&r.target){var y=r.target;if((y=l.contains(y,h.editorFocusWrapperClassName)&&y)&&r.relatedTarget===(d.focusNode||d)){y.focus();return}}h._updatePropertyFromEditor(e,d,{type:"widget"});r=t.parentNode;y={alreadyHooked:!0};var B=h.cell(t);b.emit(B.element,"dgrid-editor-hide",
{grid:h,cell:B,column:e,editor:d,bubbles:!0,cancelable:!1});e._editorBlurHandle.pause();r.removeChild(t);B.row&&(l.remove(B.element,"dgrid-cell-editing"),m.empty(r),f.appendIfNode(r,e.renderCell(B.row.data,h._activeValue,r,h._activeOptions?n.delegate(y,h._activeOptions):y)));h._focusedEditorCell=h._activeCell=h._activeValue=h._activeOptions=null}})).pause();this._editorColumnListeners.push(e._editorBlurHandle);return d},_updatePropertyFromEditor:function(e,g,d){var h;if(!g.isValid||g.isValid())if(d=
this._updateProperty((g.domNode||g).parentNode,this._activeCell?this._activeValue:g._dgridLastValue,this._retrieveEditorValue(e,g),d),this._activeCell?this._activeValue=d:g._dgridLastValue=d,"radio"===g.type&&g.name&&!e.editOn&&e.field)for(h in d=this.row(g),a("input[type\x3dradio][name\x3d"+g.name+"]",this.contentNode).forEach(function(p){var t=this.row(p);p!==g&&p._dgridLastValue&&(p._dgridLastValue=!1,this.updateDirty?this.updateDirty(t.id,e.field,!1):t.data[e.field]=!1)},this),this.dirty)d.id.toString()!==
h&&this.dirty[h][e.field]&&this.updateDirty(h,e.field,!1)},_updateProperty:function(e,g,d,h){var p=this;if((g&&g.valueOf())!==(d&&d.valueOf())){var t=this.cell(e),w=t.row,u=t.column;e=t.element;if(u.field&&w)if(t={grid:this,cell:t,oldValue:g,value:d,bubbles:!0,cancelable:!0},h&&h.type&&(t.parentType=h.type),b.emit(e,"dgrid-datachange",t))this.updateDirty?(this.updateDirty(w.id,u.field,d),u.autoSave&&setTimeout(function(){p._trackError("save")},0)):w.data[u.field]=d;else{var r;(r=e.widget)?(r._dgridIgnoreChange=
!0,r.set("value",g),setTimeout(function(){r._dgridIgnoreChange=!1},0)):(r=e.input)&&this._updateInputValue(r,g);return g}}return d},_updateInputValue:function(e,g){e.value=g;if("radio"===e.type||"checkbox"===e.type)e.checked=e.defaultChecked=!!g},_retrieveEditorValue:function(e,g){return"function"===typeof g.get?this._convertEditorValue(g.get("value")):this._convertEditorValue(g["checkbox"===g.type||"radio"===g.type?"checked":"value"])},_convertEditorValue:function(e,g){"number"===typeof g?e=isNaN(e)?
e:parseFloat(e):"boolean"===typeof g?e="true"===e?!0:"false"===e?!1:e:g instanceof Date&&(g=new Date(e),e=isNaN(g.getTime())?e:g);return e},_removeEditorBlurHandles:function(){H.forEach(this.subRows,function(e){e instanceof Array?H.forEach(e,function(g){g._editorBlurHandle&&g._editorBlurHandle.remove()}):e._editorBlurHandle&&e._editorBlurHandle.remove()})}})})},"dgrid1/Keyboard":function(){define("dojo/_base/declare dojo/aspect dojo/dom-class dojo/on dojo/_base/lang dojo/has ./util/misc dojo/_base/sniff".split(" "),
function(H,k,n,q,m,l,b){function a(x){x.preventDefault()}var c={checkbox:1,radio:1,button:1},f=/\bdgrid-cell\b/,e=/\bdgrid-row\b/,g=H(null,{pageSkip:10,tabIndex:0,keyMap:null,headerKeyMap:null,mouseDownEventType:"mousedown",postMixInProperties:function(){this.inherited(arguments);this.keyMap||(this.keyMap=m.mixin({},g.defaultKeyMap));this.headerKeyMap||(this.headerKeyMap=m.mixin({},g.defaultHeaderKeyMap))},postCreate:function(){function x(A){var F=A.target;return F.type&&(!c[F.type]||32===A.keyCode)}
function v(A){function F(){z._focusedHeaderNode&&(z._focusedHeaderNode.tabIndex=-1);if(z.showHeader){if(L)for(var ca=z.headerNode.getElementsByTagName("th"),da=0,ea;ea=ca[da];++da){if(P.test(ea.className)){z._focusedHeaderNode=Z=ea;break}}else z._focusedHeaderNode=Z=z.headerNode;Z&&(Z.tabIndex=z.tabIndex)}}function J(){var ca=z._focusedNode||Z;if(!P.test(ca.className)||!A.contains(ca)){for(var da=A.getElementsByTagName("*"),ea=0,fa;fa=da[ea];++ea)if(P.test(fa.className)){ca=z._focusedNode=fa;break}Z.tabIndex=
-1;ca.tabIndex=z.tabIndex}}var L=z.cellNavigation,P=L?f:e,Q=A===z.headerNode,Z=A;Q?(F(),z._listeners.push(k.after(z,"renderHeader",F,!0))):z._listeners.push(k.after(z,"renderArray",J,!0),k.after(z,"_onNotification",function(ca,da){0===da.totalLength?A.tabIndex=0:1===da.totalLength&&"add"===da.type&&J()},!0));z._listeners.push(q(A,z.mouseDownEventType,function(ca){x(ca)||z._focusOnNode(ca.target,Q,ca)}));z._listeners.push(q(A,"keydown",function(ca){if(!ca.metaKey&&!ca.altKey){var da=z[Q?"headerKeyMap":
"keyMap"][ca.keyCode];da&&!x(ca)&&da.call(z,ca)}}))}this.inherited(arguments);var z=this;this.tabableHeader&&(v(this.headerNode),q(this.headerNode,"dgrid-cellfocusin",function(){z.scrollTo({x:this.scrollLeft})}));v(this.contentNode);this._debouncedEnsureScroll=b.debounce(this._ensureScroll,this)},_pruneRow:function(){var x=this._focusedNode;this._focusedNode=null;this.inherited(arguments);this._focusedNode=x},removeRow:function(x){if(!this._focusedNode)return this.inherited(arguments);var v=this,
z=document.activeElement===this._focusedNode,A=this[this.cellNavigation?"cell":"row"](this._focusedNode),F=A.row||A,J;x=x.element||x;x===F.element&&((J=this.down(F,1,!0))&&J.element!==x||(J=this.up(F,1,!0)),this._removedFocus={active:z,rowId:F.id,columnId:A.column&&A.column.id,siblingId:J&&J.element!==x?J.id:void 0},setTimeout(function(){v._removedFocus&&v._restoreFocus(F.id)},0),this._focusedNode=null);this.inherited(arguments)},insertRow:function(){var x=this.inherited(arguments);this._removedFocus&&
!this._removedFocus.wait&&this._restoreFocus(x);return x},_restoreFocus:function(x){var v=this._removedFocus,z;if((x=(x=x&&this.row(x))&&x.element&&x.id===v.rowId?x:"undefined"!==typeof v.siblingId&&this.row(v.siblingId))&&x.element){if(!x.element.parentNode.parentNode){v.wait=!0;return}"undefined"!==typeof v.columnId&&(z=this.cell(x,v.columnId))&&z.element&&(x=z);v.active&&0!==x.element.offsetHeight?this._focusOnNode(x,!1,null):(n.add(x.element,"dgrid-focus"),x.element.tabIndex=this.tabIndex,this._focusedNode=
x.element)}delete this._removedFocus},addKeyHandler:function(x,v,z){x=k.after(this[z?"headerKeyMap":"keyMap"],x,v,!0);this._listeners.push(x);return x},_ensureRowScroll:function(x){var v=this.getScrollPosition().y;v>x.offsetTop?this.scrollTo({y:x.offsetTop}):v+this.contentNode.offsetHeight<x.offsetTop+x.offsetHeight&&this.scrollTo({y:x.offsetTop-this.contentNode.offsetHeight+x.offsetHeight})},_ensureColumnScroll:function(x){var v=this.getScrollPosition().x,z=x.offsetLeft;if(v>z)this.scrollTo({x:z});
else{var A=this.bodyNode.clientWidth;x=x.offsetWidth;var F=z+x;v+A<F&&this.scrollTo({x:A>x?F-A:z})}},_ensureScroll:function(x,v){!x.column&&!x.row&&x.data&&x.element?this._ensureRowScroll(x.element):(this.cellNavigation&&(this.columnSets||1<this.subRows.length)&&!v&&this._ensureRowScroll(x.row.element),this.bodyNode.clientWidth<this.contentNode.offsetWidth&&this._ensureColumnScroll(x.element))},_focusOnNode:function(x,v,z){var A="_focused"+(v?"Header":"")+"Node",F=this[A],J=this.cellNavigation?"cell":
"row",L=this[J](x),P;if(x=L&&L.element){if(this.cellNavigation){var Q=x.getElementsByTagName("input");var Z=0;for(P=Q.length;Z<P;Z++){var ca=Q[Z];if((-1!==ca.tabIndex||"_dgridLastValue"in ca)&&!ca.disabled){ca.focus();var da=!0;break}}}null!==z&&(z=m.mixin({grid:this},z),z.type&&(z.parentType=z.type),z.bubbles||(z.bubbles=!0));F&&(n.remove(F,"dgrid-focus"),F.removeAttribute("tabindex"),z&&(z[J]=this[J](F),q.emit(F,"dgrid-cellfocusout",z)));F=this[A]=x;z&&(z[J]=L);A=this.cellNavigation?f:e;!da&&A.test(x.className)&&
(x.tabIndex=this.tabIndex,x.focus());n.add(x,"dgrid-focus");z&&q.emit(F,"dgrid-cellfocusin",z);this._debouncedEnsureScroll(L,v)}},focusHeader:function(x){this._focusOnNode(x||this._focusedHeaderNode,!0)},focus:function(x){(x=x||this._focusedNode)?this._focusOnNode(x,!1):(this._removedFocus&&(this._removedFocus.active=!0),this.contentNode.focus())}}),d=g.moveFocusVertical=function(x,v){if(this._focusedNode&&x.target!==this.contentNode){var z=this.cellNavigation,A=this[z?"cell":"row"](x);A=z&&A.column.id;
v=this.down(this._focusedNode,v,!0);z&&(v=this.cell(v,A));this._focusOnNode(v,!1,x);x.preventDefault()}};H=g.moveFocusUp=function(x){d.call(this,x,-1)};var h=g.moveFocusDown=function(x){d.call(this,x,1)},p=g.moveFocusPageUp=function(x){d.call(this,x,-this.pageSkip)},t=g.moveFocusPageDown=function(x){d.call(this,x,this.pageSkip)},w=g.moveFocusHorizontal=function(x,v){if(this.cellNavigation&&x.target!==this.contentNode){var z=!this.row(x);this._focusOnNode(this.right(this["_focused"+(z?"Header":"")+
"Node"],v),z,x);x.preventDefault()}},u=g.moveFocusLeft=function(x){w.call(this,x,-1)},r=g.moveFocusRight=function(x){w.call(this,x,1)},y=g.moveHeaderFocusEnd=function(x,v){if(this.cellNavigation){var z=this.headerNode.getElementsByTagName("th");this._focusOnNode(z[v?0:z.length-1],!0,x)}x.preventDefault()},B=g.moveHeaderFocusHome=function(x){y.call(this,x,!0)},C=g.moveFocusEnd=function(x,v){var z=this.cellNavigation,A=this.contentNode,F=A.scrollTop+(v?0:A.scrollHeight);A=A[v?"firstChild":"lastChild"];
var J=-1<A.className.indexOf("dgrid-preload"),L=J?A[(v?"next":"previous")+"Sibling"]:A;x.preventDefault();this.scrollTo({y:F});if(J){for(;L&&0>L.className.indexOf("dgrid-row");)L=L[(v?"next":"previous")+"Sibling"];if(!L)return}if(!J||1>A.offsetHeight)z&&(L=this.cell(L,this.cell(x).column.id)),this._focusOnNode(L,!1,x);else{l("dom-addeventlistener")||(x=m.mixin({},x));var P=k.after(this,"renderArray",function(Q){var Z=Q[v?0:Q.length-1];z&&(Z=this.cell(Z,this.cell(x).column.id));this._focusOnNode(Z,
!1,x);P.remove();return Q});this._listeners.push(P)}},G=g.moveFocusHome=function(x){C.call(this,x,!0)};g.defaultKeyMap={32:a,33:p,34:t,35:C,36:G,37:u,38:H,39:r,40:h};g.defaultHeaderKeyMap={32:a,35:y,36:B,37:u,39:r};return g})},"dgrid1/Selection":function(){define("dojo/_base/declare dojo/aspect dojo/dom-class dojo/mouse dojo/on dojo/sniff dojo/has!touch?./util/touch dojo/query dojo/dom".split(" "),function(H,k,n,q,m,l,b){function a(t,w){w=t.unselectable=w?"on":"";t=t.getElementsByTagName("*");for(var u=
t.length;--u;)"INPUT"!==t[u].tagName&&"TEXTAREA"!==t[u].tagName&&(t[u].unselectable=w)}function c(t,w){var u=t.bodyNode,r=w?"text":21>l("ff")?"-moz-none":"none";e&&"msUserSelect"!==e?u.style[e]=r:l("dom-selectstart")?w||t._selectstartHandle?w&&t._selectstartHandle&&(t._selectstartHandle.remove(),delete t._selectstartHandle):t._selectstartHandle=m(u,"selectstart",function(y){var B=y.target&&y.target.tagName;"INPUT"!==B&&"TEXTAREA"!==B&&y.preventDefault()}):(a(u,!w),w||t._unselectableHandle)?w&&t._unselectableHandle&&
(t._unselectableHandle.remove(),delete t._unselectableHandle):t._unselectableHandle=k.after(t,"renderRow",function(y){a(y,!0);return y})}l.add("dom-comparedocumentposition",function(t,w,u){return!!u.compareDocumentPosition});l.add("dom-selectstart","undefined"!==typeof document.onselectstart);var f=l("mac")?"metaKey":"ctrlKey",e=l("css-user-select"),g=l("pointer"),d=g&&"MS"===g.slice(0,2),h=g?g+(d?"Down":"down"):"mousedown",p=g?g+(d?"Up":"up"):"mouseup";"WebkitUserSelect"===e&&"undefined"!==typeof document.documentElement.style.msUserSelect&&
(e=!1);return H(null,{selectionDelegate:".dgrid-row",selectionEvents:h+","+p+",dgrid-cellfocusin",selectionTouchEvents:l("touch")?b.tap:null,deselectOnRefresh:!0,allowSelectAll:!1,selection:{},selectionMode:"extended",allowTextSelection:void 0,_selectionTargetType:"rows",create:function(){this.selection={};return this.inherited(arguments)},postCreate:function(){this.inherited(arguments);this._initSelectionEvents();var t=this.selectionMode;this.selectionMode="";this._setSelectionMode(t)},destroy:function(){this.inherited(arguments);
this._selectstartHandle&&this._selectstartHandle.remove();this._unselectableHandle&&this._unselectableHandle.remove();this._removeDeselectSignals&&this._removeDeselectSignals()},_setSelectionMode:function(t){t!==this.selectionMode&&(this.clearSelection(),this.selectionMode=t,this._selectionHandlerName="_"+t+"SelectionHandler",this._setAllowTextSelection(this.allowTextSelection))},_setAllowTextSelection:function(t){"undefined"!==typeof t?c(this,t):c(this,"none"===this.selectionMode);this.allowTextSelection=
t},_handleSelect:function(t,w){if(!q.isRight(t)&&this[this._selectionHandlerName]&&this.allowSelect(this.row(w))&&("dgrid-cellfocusin"!==t.type||"mousedown"!==t.parentType)&&(t.type!==p||w===this._waitForMouseUp)){this._waitForMouseUp=null;this._selectionTriggerEvent=t;if(!t.keyCode||!t.ctrlKey||32===t.keyCode)if(!t.shiftKey&&t.type===h&&this.isSelected(w))this._waitForMouseUp=w;else this[this._selectionHandlerName](t,w);this._selectionTriggerEvent=null}},_singleSelectionHandler:function(t,w){t=t.keyCode?
t.ctrlKey:t[f];this._lastSelected===w?this.select(w,null,!t||!this.isSelected(w)):(this.clearSelection(),this.select(w),this._lastSelected=w)},_multipleSelectionHandler:function(t,w){var u=this._lastSelected,r=t.keyCode?t.ctrlKey:t[f];if(!t.shiftKey){var y=r?null:!0;u=null}this.select(w,u,y);u||(this._lastSelected=w)},_extendedSelectionHandler:function(t,w){if(t[f]||!this.isSelected(w)||1!==this.getSelectedCount())(2===t.button?this.isSelected(w):t.keyCode?t.ctrlKey:t[f])||this.clearSelection(null,
!0),this._multipleSelectionHandler(t,w)},_toggleSelectionHandler:function(t,w){this.select(w,null,null)},_initSelectionEvents:function(){var t=this,w=this.contentNode,u=this.selectionDelegate;this._selectionEventQueues={deselect:[],select:[]};l("touch")&&!l("pointer")&&this.selectionTouchEvents?(m(w,b.selector(u,this.selectionTouchEvents),function(r){t._handleSelect(r,this);t._ignoreMouseSelect=this}),m(w,m.selector(u,this.selectionEvents),function(r){t._ignoreMouseSelect!==this?t._handleSelect(r,
this):r.type===p&&(t._ignoreMouseSelect=null)})):m(w,m.selector(u,this.selectionEvents),function(r){t._handleSelect(r,this)});this.addKeyHandler&&this.addKeyHandler(32,function(r){t._handleSelect(r,r.target)});if(this.allowSelectAll)this.on("keydown",function(r){r[f]&&65===r.keyCode&&!/\bdgrid-input\b/.test(r.target.className)&&(r.preventDefault(),t[t.allSelected?"clearSelection":"selectAll"]())});this._setCollection&&this._listeners.push(k.before(this,"_setCollection",function(r){t._updateDeselectionAspect(r)}));
this._updateDeselectionAspect()},_updateDeselectionAspect:function(t){function w(y,B){if((y=u.row(y))&&u.selection[y.id])u[B](y)}var u=this;this._removeDeselectSignals&&this._removeDeselectSignals();var r=t&&t.track&&this._observeCollection?[k.before(this,"_observeCollection",function(y){r.push(y.on("delete",function(B){"undefined"===typeof B.index&&w(B.id,"deselect")}))}),k.after(this,"_observeCollection",function(y){r.push(y.on("update",function(B){"undefined"!==typeof B.index&&w(y.getIdentity(B.target),
"select")}))},!0)]:[k.before(this,"removeRow",function(y,B){B||(y=this.row(y))&&y.id in this.selection&&this.deselect(y)})];this._removeDeselectSignals=function(){for(var y=r.length;y--;)r[y].remove();r=[]}},allowSelect:function(){return!0},_fireSelectionEvent:function(t){var w=this._selectionEventQueues[t],u=this._selectionTriggerEvent;var r={bubbles:!0,grid:this};u&&(r.parentType=u.type);r[this._selectionTargetType]=w;this._selectionEventQueues[t]=[];m.emit(this.contentNode,"dgrid-"+t,r)},_fireSelectionEvents:function(){var t=
this._selectionEventQueues,w;for(w in t)t[w].length&&this._fireSelectionEvent(w)},_select:function(t,w,u){"undefined"===typeof u&&(u=!0);t.element||(t=this.row(t));if(!1===u||this.allowSelect(t)){var r=this.selection;var y=!!r[t.id];null===u&&(u=!y);var B=t.element;u||this.allSelected?r[t.id]=u:delete this.selection[t.id];B&&(u?n.add(B,"dgrid-selected"+(this.addUiClasses?" ui-state-active":"")):n.remove(B,"dgrid-selected ui-state-active"));u!==y&&B&&this._selectionEventQueues[(u?"":"de")+"select"].push(t);
if(w)if(w.element||(w=this.row(w)),w){if(w=w.element)for(r=this._determineSelectionDirection(B,w),r||(w=document.getElementById(w.id),r=this._determineSelectionDirection(B,w));t.element!==w&&(t=this[r](t));)this._select(t,null,u)}else this._lastSelected=B,console.warn("The selection range has been reset because the beginning of the selection is no longer in the DOM. If you are using OnDemandList, you may wish to increase farOffRemoval to avoid this, but note that keeping more nodes in the DOM may impact performance.")}},
_determineSelectionDirection:l("dom-comparedocumentposition")?function(t,w){t=w.compareDocumentPosition(t);return t&1?!1:2===t?"down":"up"}:function(t,w){return 1>w.sourceIndex?!1:w.sourceIndex>t.sourceIndex?"down":"up"},select:function(t,w,u){this._select(t,w,u);this._fireSelectionEvents()},deselect:function(t,w){this.select(t,w,!1)},clearSelection:function(t,w){this.allSelected=!1;for(var u in this.selection)t!==u&&this._select(u,null,!1);w||(this._lastSelected=null);this._fireSelectionEvents()},
selectAll:function(){this.allSelected=!0;this.selection={};for(var t in this._rowIdToObject){var w=this.row(this._rowIdToObject[t]);this._select(w.id,null,!0)}this._fireSelectionEvents()},getSelectedCount:function(){var t=0,w;for(w in this.selection)w&&(t+=1);return t},isSelected:function(t){if("undefined"===typeof t||null===t)return!1;t.element||(t=this.row(t));return t.id in this.selection?!!this.selection[t.id]:this.allSelected&&(!t.data||this.allowSelect(t))},refresh:function(){this.deselectOnRefresh&&
this.clearSelection();this._lastSelected=null;return this.inherited(arguments)},renderArray:function(){var t=this.inherited(arguments),w=this.selection,u,r;for(u=0;u<t.length;u++){var y=this.row(t[u]);(r=y.id in w?w[y.id]:this.allSelected)&&this.select(y,null,r)}this._fireSelectionEvents();return t}})})},"dgrid1/Selector":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/sniff dojo/dom-construct dojo/dom-class ./Selection".split(" "),function(H,k,n,q,m,l){return H(l,{postCreate:function(){this.inherited(arguments);
this.on(".dgrid-selector:click,.dgrid-selector:keydown",k.hitch(this,"_handleSelectorClick"));this.on("dgrid-select",k.hitch(this,"_changeSelectorInput",!0));this.on("dgrid-deselect",k.hitch(this,"_changeSelectorInput",!1))},_defaultRenderSelectorInput:function(b,a,c,f){var e=b.grid;m.add(c,"dgrid-selector");return c.input=q.create("input",{"aria-checked":a,checked:a,disabled:!e.allowSelect(e.row(f)),tabIndex:isNaN(b.tabIndex)?-1:b.tabIndex,type:b.selector},c)},_configureSelectorColumn:function(b){var a=
this,c=b.selector;this._selectorColumns.push(b);this._selectorSingleRow=this._selectorSingleRow||"radio"===b.selector;var f="function"===typeof c?c:this._defaultRenderSelectorInput;b.sortable=!1;b.renderCell=function(e,g,d){g=(g=e&&a.row(e))&&a.selection[g.id];f(b,!!g,d,e)};b.renderHeaderCell=function(e){var g="label"in b?b.label:b.field||"";"radio"!==b.selector&&a.allowSelectAll?(b._selectorHeaderCheckbox=f(b,!1,e,{}),a._hasSelectorHeaderCheckbox=!0):e.appendChild(document.createTextNode(g))}},_handleSelectorClick:function(b){if("INPUT"!==
b.target.nodeName||"keydown"!==b.type||32!==b.keyCode){var a=this.cell(b).row;if("click"===b.type||32===b.keyCode||!n("opera")&&13===b.keyCode||0===b.keyCode){this._selectionTriggerEvent=b;if(a){if(this.allowSelect(a)){var c=this._lastSelected&&this.row(this._lastSelected);this._selectorSingleRow?c&&c.id===a.id||(this.clearSelection(),this.select(a,null,!0),this._lastSelected=a.element):a&&(b.shiftKey?this._changeSelectorInput(!0,{rows:[a]}):c=null,c=b.shiftKey?c:null,this.select(c||a,a,c?void 0:
null),this._lastSelected=a.element)}}else this[this.allSelected?"clearSelection":"selectAll"]();this._selectionTriggerEvent=null}}},_changeSelectorInput:function(b,a){this._selectorColumns.length&&this._updateRowSelectors(b,a);this._hasSelectorHeaderCheckbox&&this._updateHeaderCheckboxes()},_updateRowSelectors:function(b,a){a=a.rows;for(var c=a.length,f=this._selectorColumns.length,e=0;e<c;e++)for(var g=0;g<f;g++){var d=this.cell(a[e],this._selectorColumns[g].id).element;d&&(d=(d.contents||d).input)&&
!d.disabled&&(d.checked=b,d.setAttribute("aria-checked",b))}},_updateHeaderCheckboxes:function(){for(var b=this._selectorColumns.length,a=0;a<b;a++){var c="false",f=this._selectorColumns[a]._selectorHeaderCheckbox;if(f){var e=this.selection;var g=!1;for(var d in e)if(e[d]!=this.allSelected){g=!0;break}f.indeterminate=g;f.checked=this.allSelected;g?c="mixed":this.allSelected&&(c="true");f.setAttribute("aria-checked",c)}}},configStructure:function(){this.inherited(arguments);var b=this.columns;this._selectorColumns=
[];this._hasSelectorHeaderCheckbox=this._selectorSingleRow=!1;for(var a in b)b[a].selector&&this._configureSelectorColumn(b[a])},_handleSelect:function(b){var a=this.cell(b).column;a&&a.selector||this.inherited(arguments)}})})},"dgrid1/extensions/ColumnResizer":function(){define("dojo/_base/declare dojo/_base/array dojo/on dojo/query dojo/_base/lang dojo/dom dojo/dom-construct dojo/dom-geometry dojo/has ../util/misc dojo/_base/html".split(" "),function(H,k,n,q,m,l,b,a,c,f){function e(u,r,y,B,C){for(var G=
1;G<r;G++)u[y+G][B]=C}function g(u){for(var r=u.length,y=r,B=k.filter(u[0],function(L){return!L.hidden}).length,C=Array(r);r--;)C[r]=Array(B);var G={};for(r=0;r<y;r++)for(var x=C[r],v=u[r],z=0,A=0;z<B;z++){var F=v[A],J;if("undefined"===typeof x[z]){x[z]=F.id;F.rowSpan&&1<F.rowSpan&&e(C,F.rowSpan,r,z,F.id);if(0<r&&F.colSpan&&1<F.colSpan)for(J=1;J<F.colSpan;J++)x[++z]=F.id,F.rowSpan&&1<F.rowSpan&&e(C,F.rowSpan,r,z,F.id);G[F.id]=u[0][z].id;A++}}return G}function d(u,r,y,B,C){if(!(0>=y)){var G=u.columns[r];
if(G){var x={grid:u,columnId:r,width:y,bubbles:!0,cancelable:!0};B&&(x.parentType=B);if(!u._resizedColumns||n.emit(u.headerNode,"dgrid-columnresize",x))return"auto"===y?delete G.width:(G.width=y,y+="px"),(B=u._columnSizes[r])?B.set("width",y):B=f.addCssRule("#"+f.escapeCssIdentifier(u.domNode.id)+" .dgrid-column-"+f.escapeCssIdentifier(r,"-"),"width: "+y+";"),u._columnSizes[r]=B,!1!==C&&u.resize(),!0}}}var h,p,t=0,w={create:function(){h=b.create("div",{className:"dgrid-column-resizer"});p=b.create("div",
{className:"dgrid-resize-guard"})},destroy:function(){b.destroy(h);b.destroy(p);h=p=null},show:function(u){var r=a.position(u.domNode,!0);h.style.top=r.y+"px";h.style.height=r.h+"px";document.body.appendChild(h);u.domNode.appendChild(p)},move:function(u){h.style.left=u+"px"},hide:function(){h.parentNode.removeChild(h);p.parentNode.removeChild(p)}};return H(null,{resizeNode:null,minWidth:40,adjustLastColumn:!0,_resizedColumns:!1,buildRendering:function(){this.inherited(arguments);t||w.create();t++},
destroy:function(){this.inherited(arguments);for(var u in this._columnSizes)this._columnSizes[u].remove();--t||w.destroy()},resizeColumnWidth:function(u,r){return d(this,u,r)},configStructure:function(){var u=this._oldColumnSizes=m.mixin({},this._columnSizes),r;this._resizedColumns=!1;this._columnSizes={};this.inherited(arguments);for(r in u)r in this._columnSizes||u[r].remove();delete this._oldColumnSizes},_configColumn:function(u){this.inherited(arguments);var r=u.id,y;"width"in u&&((y=this._oldColumnSizes[r])?
y.set("width",u.width+"px"):y=f.addCssRule("#"+f.escapeCssIdentifier(this.domNode.id)+" .dgrid-column-"+f.escapeCssIdentifier(r,"-"),"width: "+u.width+"px;"),this._columnSizes[r]=y)},renderHeader:function(){this.inherited(arguments);var u=this;if(this.columnSets&&this.columnSets.length)for(var r=this.columnSets.length;r--;)var y=m.mixin(y||{},g(this.columnSets[r]));else this.subRows&&1<this.subRows.length&&(y=g(this.subRows));r=q(".dgrid-cell",u.headerNode);for(var B=r.length;B--;){var C=r[B],G=C.columnId,
x=u.columns[G],v=C.childNodes;if(x&&!1!==x.resizable){x=b.create("div",{className:"dgrid-resize-header-container"});for(C.contents=x;0<v.length;)x.appendChild(v[0]);v=b.create("div",{className:"dgrid-resize-handle resizeNode-"+f.escapeCssIdentifier(G,"-")},x);C.appendChild(x);v.columnId=y&&y[G]||G}}u.mouseMoveListen||(n(u.headerNode,".dgrid-resize-handle:mousedown"+(c("touch")?",.dgrid-resize-handle:touchstart":""),function(z){u._resizeMouseDown(z,this);u.mouseMoveListen.resume();u.mouseUpListen.resume()}),
u._listeners.push(u.mouseMoveListen=n.pausable(document,"mousemove"+(c("touch")?",touchmove":""),f.throttleDelayed(function(z){u._updateResizerPosition(z)}))),u._listeners.push(u.mouseUpListen=n.pausable(document,"mouseup"+(c("touch")?",touchend":""),function(z){u._resizeMouseUp(z);u.mouseMoveListen.pause();u.mouseUpListen.pause()})),u.mouseMoveListen.pause(),u.mouseUpListen.pause())},_resizeMouseDown:function(u,r){u.preventDefault();l.setSelectable(this.domNode,!1);this._startX=this._getResizeMouseLocation(u);
this._targetCell=q(".dgrid-column-"+f.escapeCssIdentifier(r.columnId,"-"),this.headerNode)[0];this._updateResizerPosition(u);w.show(this)},_resizeMouseUp:function(u){var r=this._columnSizes,y;this.adjustLastColumn&&(y=this.headerNode.clientWidth-1);if(!this._resizedColumns){var B=q(".dgrid-cell",this.headerNode);this.columnSets&&this.columnSets.length?B=B.filter(function(F){return"0"===F.columnId.split("-")[0]&&!(F.columnId in r)}):this.subRows&&1<this.subRows.length&&(B=B.filter(function(F){return"0"===
F.columnId.charAt(0)&&!(F.columnId in r)}));var C=B.map(function(F){return F.offsetWidth});B.forEach(function(F,J){d(this,F.columnId,C[J],null,!1)},this);this._resizedColumns=!0}l.setSelectable(this.domNode,!0);B=this._targetCell;var G=this._getResizeMouseLocation(u)-this._startX,x=B.offsetWidth+G,v=this._getResizedColumnWidths(),z=v.totalWidth;v=v.lastColId;var A=q(".dgrid-column-"+f.escapeCssIdentifier(v,"-"),this.headerNode)[0].offsetWidth;x<this.minWidth&&(x=this.minWidth);d(this,B.columnId,x,
u.type)&&B.columnId!==v&&this.adjustLastColumn&&(z+G<y?d(this,v,"auto",u.type):A-G<=this.minWidth&&d(this,v,this.minWidth,u.type));w.hide();delete this._startX;delete this._targetCell},_updateResizerPosition:function(u){if(this._targetCell){u=this._getResizeMouseLocation(u);var r=this._targetCell.offsetWidth,y=u;r+(u-this._startX)<this.minWidth&&(y=this._startX-(r-this.minWidth));w.move(y)}},_getResizeMouseLocation:function(u){var r=0;u.pageX?r=u.pageX:u.clientX&&(r=u.clientX+document.body.scrollLeft+
document.documentElement.scrollLeft);return r},_getResizedColumnWidths:function(){var u=0,r=q((this.columnSets?".dgrid-column-set-cell ":"")+"tr:first-child .dgrid-cell",this.headerNode),y=r.length;if(!y)return{};for(var B=r[y-1].columnId;y--;)u+=r[y].offsetWidth;return{totalWidth:u,lastColId:B}}})})},"dgrid1/extensions/DijitRegistry":function(){define(["dojo/_base/declare","dojo/dom-geometry","dijit/_WidgetBase","dijit/registry"],function(H,k,n,q){var m=n.prototype;return H(null,{minSize:0,maxSize:Infinity,
layoutPriority:0,showTitle:!0,buildRendering:function(){q.add(this);this.inherited(arguments);this.domNode.setAttribute("widgetId",this.id)},startup:function(){if(!this._started){this.inherited(arguments);var l=this.getParent();l&&l.isLayoutContainer&&this._resizeHandle.remove()}},destroyRecursive:function(){this.destroy()},destroy:function(){this.inherited(arguments);q.remove(this.id)},getChildren:function(){return[]},getParent:function(){return q.getEnclosingWidget(this.domNode.parentNode)},isLeftToRight:function(){return!this.isRTL},
placeAt:function(l,b){return m.placeAt.call(this,l,b)},resize:function(l){l&&k.setMarginBox(this.domNode,l);this.inherited(arguments)},_set:function(l,b){this[l]=b},watch:function(){}})})},"esri/dijit/analysis/_Widget":function(){define(["dijit/_WidgetBase","dojo/_base/lang","dojo/dom-class"],function(H,k,n){return H.createSubclass({declaredClass:"esri.dijit.analysis.Widget",create:function(q,m){q=k.mixin({viewModel:{}},q);q.viewModel=this._ensureViewModelInstance(q.viewModel);this.inherited(arguments,
[q,m])},destroy:function(){this.inherited(arguments);this.viewModel.destroy&&this.viewModel.destroy();this.viewModel=null},viewModel:null,_setViewModelAttr:function(q){this._set("viewModel",this._ensureViewModelInstance(q))},viewModelType:null,visible:!0,_setVisibleAttr:function(q){this._set("visible",q);n.toggle(this.domNode,"esri-hidden",!q)},_ensureViewModelInstance:function(q){return q&&!q.declaredClass&&this.viewModelType?new this.viewModelType(q):q}})})},"esri/dijit/analysis/SettingsViewModel":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/Color dojo/has dojo/json dojo/Stateful ./storeUtils ./SpatialReferences ./JobsViewModel ../../kernel ../../lang".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g){H=H([b],{declaredClass:"esri.dijit.analysis.SettingsViewModel",showHelp:!0,showOverwriteResultOption:!0,showCloseAnalysisOption:!0,showStoreAnalysisOption:!0,showCoordinateSystems:!0,showOutSR:!0,showProcessSR:!0,showExtent:!0,showRasterSettings:!0,showGeoAnalyticsSettings:!0,showRasterPPFSettings:!1,showRasterPTSettings:!1,showRasterSnapSettings:!0,showCreditWarningSettings:!0,showResamplingSettings:!1,showCloseIcon:!0,showHeader:!0,showOkCancel:!0,showJobsHistory:!1,
isCustomExtent:!1,layers:null,viewProps:null,closeAnalysisWidget:!0,returnFeaturCollection:!1,jobsViewModel:null,geoAnalyticsServer:null,creditWarning:!0,spatialRefStore:a.createHierarchicalStore({data:c}),spatialRefData:c,constructor:function(d){var h=this.get("saveModel");h&&h.layers&&d.layers&&(this._arrayUnique(d.layers.concat(h.layers),"name"),delete h.layers);k.mixin(d,h);this.watch("showJobsHistory",k.hitch(this,this.updateJobsVM));this.watch("portalUrl",k.hitch(this,this.updateJobsVM));this.watch("jobsHistoryItem",
k.hitch(this,this.updateJobsVM))},_showCloseIconSetter:function(d){this.showCloseIcon=d},_showHelpSetter:function(d){this.showHelp=d},_showOverwriteResultOptionSetter:function(d){this.showOverwriteResultOption=d},_showCloseAnalysisOptionSetter:function(d){this.showCloseAnalysisOption=d},_showStoreAnalysisOptionSetter:function(d){this.showStoreAnalysisOption=d},_showCoordinateSystemsSetter:function(d){this.showCoordinateSystems=d},_showExtentSetter:function(d){this.showExtent=d},_showRasterSettingsSetter:function(d){this.showRasterSettings=
d},_showRasterPPFSettingsSetter:function(d){this.showRasterPPFSettings=d},_showRasterPTSettingsSetter:function(d){this.showRasterPTSettings=d},_showRasterSnapSettingsSetter:function(d){this.showRasterSnapSettings=d},_returnFeatureCollectionSetter:function(d){this.returnFeatureCollection=d},_closeAnalysisWidgetSetter:function(d){this.closeAnalysisWidget=d},_overwriteResultSetter:function(d){this.overwriteResult=d},_outSRSetter:function(d){this.outSR=d},_processSRSetter:function(d){this.processSR=d},
_extentSetter:function(d){this.extent=d},_snapRasterSetter:function(d){this.snapRaster=d},_cellSizeSetter:function(d){this.cellSize=d},_maskSetter:function(d){this.mask=d},_layersSetter:function(d){this.layers=d},_showHeaderSetter:function(d){this.showHeader=d},_showOutSRSetter:function(d){this.showOutSR=d;this.set("outSR",d?this.outSR:void 0)},_showProcessSRSetter:function(d){this.showProcessSR=d;this.set("processSR",d?this.processSR:void 0)},_showOkCancelSetter:function(d){this.showOkCancel=!0},
_isCustomExtentSetter:function(d){this.isCustomExtent=d},_isCustomOutSRSetter:function(d){this.isCustomOutSR=d},_isCustomProcessSRSetter:function(d){this.isCustomProcessSR=d},_isCustomCellSizeSetter:function(d){this.isCustomCellSize=d},_showGeoAnalyticsSettingsSetter:function(d){this.showGeoAnalyticsSettings=d},_datastoreSetter:function(d){this.datastore=d},_portalUrlSetter:function(d){this.portalUrl=d},_jobsHistoryItemSetter:function(d){this.jobsHistoryItem=d},_viewPropsSetter:function(d){this.viewProps=
d},_saveModelGetter:function(){var d;window.localStorage&&(d=window.localStorage.getItem("esri_analysis_settings"))&&(d=l.parse(d));return d},_saveModelSetter:function(d){d||(d={isCustomExtent:this.isCustomExtent,isCustomOutSR:this.isCustomOutSR,isCustomProcessSR:this.isCustomProcessSR,isCustomCellSize:this.isCustomCellSize,outSR:this.outSR,processSR:this.processSR,extent:this.extent,cellSize:this.cellSize,snapRaster:this.snapRaster,mask:this.mask,datastore:this.datastore,viewProps:this.viewProps,
closeAnalysisWidget:this.closeAnalysisWidget,returnFeatureCollection:this.returnFeatureCollection,processorType:this.processorType,parallelProcessingFactor:this.parallelProcessingFactor,recycleProcessingWorkers:this.recycleProcessingWorkers,retryOnFailures:this.retryOnFailures,resamplingMethod:this.resamplingMethod,creditWarning:this.creditWarning},this.layers&&0<this.layers.length&&(d.layers=n.map(this.layers,function(h){return{name:h.name,url:h.url,fullExtent:h.fullExtent,type:h.type,format:h.format}})));
window.localStorage&&d&&window.localStorage.setItem("esri_analysis_settings",l.stringify(d))},_geoAnalyticsServerSetter:function(d){this.geoAnalyticsServer=d},_processorTypeSetter:function(d){this.processorType=d},_parallelProcessingFactorSetter:function(d){this.parallelProcessingFactor=d},_recycleIntervalOfProecssingWorkersSetter:function(d){this.recycleIntervalOfProecssingWorkers=d},_numberOfRetriesOnRandomFailureSetter:function(d){this.numberOfRetriesOnRandomFailure=d},_resamplingMethodSetter:function(d){this.resamplingMethod=
d},_creditWarningSetter:function(d){this.creditWarning=d},save:function(){this.set("saveModel")},reset:function(){k.mixin(this,this.get("saveModel"))},updateJobsVM:function(){this.showJobsHistory&&this.portalUrl&&this.jobsHistoryItem&&!this.jobsViewModel&&(this.jobsViewModel=new f({portalUrl:this.portalUrl,item:this.jobsHistoryItem}),this.watch("jobsHistoryItem",k.hitch(this,function(){this.jobsViewModel.set("item",this.jobsHistoryItem)})),this.watch("portalUrl",k.hitch(this,function(){this.jobsViewModel.set("portalUrl",
this.portalUrl)})))},_arrayUnique:function(d,h){d=d.concat();for(var p=0;p<d.length;++p)for(var t=p+1;t<d.length;++t)(!h&&d[p]===d[t]||h&&d[p][h]===d[t][h])&&d.splice(t--,1);return d}});m("extend-esri")&&k.setObject("dijit.analysis.SettingsViewModel",H,e);return H})},"esri/dijit/analysis/storeUtils":function(){define("dojo/_base/declare dojo/_base/lang dojo/has dstore/Memory dstore/Trackable dstore/Tree ../../kernel".split(" "),function(H,k,n,q,m,l,b){var a=H([q,m]);q={createHierarchicalStore:function(c){c=
this.createSyncStore(c,l);c.getRootCollection=function(){return this.root.filter({parent:void 0})};return c.getRootCollection()},createSyncStore:function(c,f){c=c||{};c.data&&(c=k.mixin({},c,{data:k.clone(c.data)}));return new (f?H([a,f]):a)(c)},createStore:function(c){for(var f={identifier:"id",label:"id",items:[]},e=0,g=c.length;e<g;e++)f.items.push(k.mixin({id:e},c[e%g]));return this.createSyncStore({data:f})}};n("extend-esri")&&k.setObject("dijit.analysis.storeUtils",q,b);return q})},"dstore/Memory":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array ./Store ./Promised ./SimpleQuery ./QueryResults".split(" "),
function(H,k,n,q,m,l,b){return H([q,m,l],{constructor:function(){this.storage.version=0},postscript:function(){this.inherited(arguments);this.setData(this.data||[])},data:null,autoEmitEvents:!1,getSync:function(a){return this.storage.fullData[this.storage.index[a]]},putSync:function(a,c){c=c||{};var f=this.storage,e=f.index,g=f.fullData,d=this.Model;!d||a instanceof d||(a=this._restore(a));var h=this.getIdentity(a);null==h&&(this._setIdentity(a,"id"in c?c.id:Math.random()),h=this.getIdentity(a));
f.version++;f=h in e?"update":"add";d={target:a};var p;if("update"===f){if(!1===c.overwrite)throw Error("Object already exists");h=p=e[h]}else h=this.defaultNewToStart?0:g.length;if("beforeId"in c){var t=c.beforeId;null===t?(c=g.length,"update"===f&&--c):(c=e[t],p<c&&--c);void 0!==c?d.beforeId=t:(console.error("options.beforeId was specified but no corresponding index was found"),c=h)}else c=h;if(c===p)g[c]=a;else for(void 0!==p&&g.splice(p,1),g.splice(c,0,a),p=void 0===p?c:Math.min(p,c),c=g.length;p<
c;++p)e[this.getIdentity(g[p])]=p;this.emit(f,d);return a},addSync:function(a,c){(c=c||{}).overwrite=!1;return this.putSync(a,c)},removeSync:function(a){var c=this.storage,f=c.index;c=c.fullData;if(a in f)return f=c.splice(f[a],1)[0],this._reindex(),this.emit("delete",{id:a,target:f}),!0},setData:function(a){this.parse&&(a=this.parse(a));a.items&&(this.idProperty=a.identifier||this.idProperty,a=a.items);this.storage.fullData=this.data=a;this._reindex()},_reindex:function(){for(var a=this.storage,
c=a.index={},f=a.fullData,e=this.Model,g=Object.prototype,d=0,h=f.length;d<h;d++){var p=f[d];if(e&&!(p instanceof e)){var t=this._restore(p,p.__proto__===g);p!==t&&(f[d]=p=t)}c[this.getIdentity(p)]=d}a.version++},fetchSync:function(){var a=this.data;if(!a||a._version!==this.storage.version){a=this.storage.fullData;for(var c=this.queryLog,f=0,e=c.length;f<e;f++)a=c[f].querier(a);a._version=this.storage.version;this.data=a}return new b(a)},fetchRangeSync:function(a){var c=this.fetchSync();return new b(c.slice(a.start,
a.end),{totalLength:c.length})},_includePropertyInSubCollection:function(a){return"data"!==a&&this.inherited(arguments)}})})},"dstore/Store":function(){define("dojo/_base/lang dojo/_base/array dojo/aspect dojo/has dojo/when dojo/_base/declare ./QueryMethod ./Filter dojo/Evented".split(" "),function(H,k,n,q,m,l,b,a,c){function f(g){return function(d,h){var p=this;m(d,function(t){t={target:t};var w=h[1]||{};"beforeId"in w&&(t.beforeId=w.beforeId);p.emit(g,t)});return d}}q.add("object-proto",!!{}.__proto__&&
!{}.watch);var e=q("object-proto");return l(c,{constructor:function(g){g&&l.safeMixin(this,g);this.Model&&this.Model.createSubclass&&(this.Model=this.Model.createSubclass([]).extend({_store:this}));this.storage=new c;var d=this;this.autoEmitEvents&&(n.after(this,"add",f("add")),n.after(this,"put",f("update")),n.after(this,"remove",function(h,p){m(h,function(){d.emit("delete",{id:p[0]})});return h}))},autoEmitEvents:!0,idProperty:"id",queryAccessors:!0,getIdentity:function(g){return g.get?g.get(this.idProperty):
g[this.idProperty]},_setIdentity:function(g,d){g.set?g.set(this.idProperty,d):g[this.idProperty]=d},forEach:function(g,d){var h=this;return m(this.fetch(),function(p){for(var t=0,w;void 0!==(w=p[t]);t++)g.call(d,w,t,h);return p})},matchesFilter:function(g){var d=this.queryLog;if(d&&g){g=[g];for(var h=0,p=d.length;h<p;h++)g=d[h].querier(g);return 0<g.length}return!0},on:function(g,d,h){var p=this;return this.storage.on(g,function(t){d&&(!h||p.matchesFilter(t&&t.target))&&d&&d(t)})},emit:function(g,
d){d=d||{};d.type=g;try{return this.storage.emit(g,d)}catch(h){console.error(h)}finally{return d.cancelable}},parse:null,stringify:null,Model:null,_restore:function(g,d){var h=this.Model;if(h&&g){var p=h.prototype,t=p._restore;t?g=t.call(g,h,d):e&&d?g.__proto__=p:g=H.delegate(p,g)}return g},create:function(g){return new this.Model(g)},_createSubCollection:function(g){var d=H.delegate(this.constructor.prototype),h;for(h in this)this._includePropertyInSubCollection(h,d)&&(d[h]=this[h]);return l.safeMixin(d,
g)},_includePropertyInSubCollection:function(g,d){return!(g in d)||d[g]!==this[g]},queryLog:[],filter:new b({type:"filter",normalizeArguments:function(g){var d=this.Filter;return g instanceof d?[g]:[new d(g)]}}),Filter:a,sort:new b({type:"sort",normalizeArguments:function(g,d){if("function"===typeof g)var h=[g];else h=g instanceof Array?g.slice():"object"===typeof g?[].slice.call(arguments):[{property:g,descending:d}],h=k.map(h,function(p){p=H.mixin({},p);p.descending=!!p.descending;return p}),h=
[h];return h}}),select:new b({type:"select"}),_getQuerierFactory:function(g){return this["_create"+(g[0].toUpperCase()+g.substr(1))+"Querier"]}})})},"dstore/QueryMethod":function(){define([],function(){return function(H){var k=H.type,n=H.normalizeArguments,q=H.applyQuery,m=H.querierFactory;return function(){var l=Array.prototype.slice.call(arguments),b=n?n.apply(this,l):l;l={type:k,arguments:l,normalizedArguments:b};var a=this._getQuerierFactory(k)||m;a&&(l.querier=a.apply(this,b));b=this._createSubCollection({queryLog:this.queryLog.concat(l)});
return q?q.call(this,b,l):b}}})},"dstore/Filter":function(){define(["dojo/_base/declare"],function(H){function k(q){return function(){var m=this.constructor,l=new m;l.type=q;l.args=Array.prototype.slice.call(arguments);return this.type?k("and").call(m.prototype,this,l):l}}function n(q){return function(){for(var m=this.constructor,l=[],b=0;b<arguments.length;b++){var a=arguments[b];l.push(a instanceof m?a:new m(a))}m=new m;m.type=q;m.args=l;this.type===q?m.args=this.args.concat(l):this.type?l.unshift(this):
1===l.length&&l[0].type&&(m.type=l[0].type,m.args=l[0].args.slice());return m}}H=H(null,{constructor:function(q){var m=typeof q;switch(m){case "object":m=this;for(var l in q){var b=q[l];m=b instanceof this.constructor?m[b.type](l,b.args[0]):b&&b.test?m.match(l,b):m.eq(l,b)}this.type=m.type;this.args=m.args;break;case "function":case "string":this.type=m,this.args=[q]}},and:n("and"),or:n("or"),eq:k("eq"),ne:k("ne"),lt:k("lt"),lte:k("lte"),gt:k("gt"),gte:k("gte"),contains:k("contains"),"in":k("in"),
match:k("match")});H.filterCreator=k;H.logicalOperatorCreator=n;return H})},"dstore/Promised":function(){define(["dojo/_base/declare","dojo/Deferred","./QueryResults","dojo/when"],function(H,k,n,q){function m(l,b){return function(){var a=new k;try{a.resolve(this[l].apply(this,arguments))}catch(c){a.reject(c)}return b?(a=new n(a.promise),a.totalLength=q(a.totalLength),a):a.promise}}return H(null,{get:m("getSync"),put:m("putSync"),add:m("addSync"),remove:m("removeSync"),fetch:m("fetchSync",!0),fetchRange:m("fetchRangeSync",
!0)})})},"dstore/QueryResults":function(){define(["dojo/_base/lang","dojo/when"],function(H,k){function n(q,m){return k(this,function(l){for(var b=0,a=l.length;b<a;b++)q.call(m,l[b],b,l)})}return function(q,m){var l=m&&"totalLength"in m;if(q.then){q=H.delegate(q);var b=q.then(function(a){var c=l?m.totalLength:a.totalLength||a.length;a.totalLength=c;return!l&&c});q.totalLength=l?m.totalLength:b;q.response=m&&m.response}else q.totalLength=l?m.totalLength:q.length;q.forEach=n;return q}})},"dstore/SimpleQuery":function(){define(["dojo/_base/declare",
"dojo/_base/array"],function(H,k){function n(m,l){if(-1<m.indexOf(".")){var b=m.split("."),a=b.length;return function(c){for(var f=0;f<a;f++)c=c&&(l&&c.get?c.get(b[f]):c[b[f]]);return c}}return function(c){return c.get?c.get(m):c[m]}}var q={eq:function(m,l){return m===l},"in":function(m,l){return-1<k.indexOf(l.data||l,m)},ne:function(m,l){return m!==l},lt:function(m,l){return m<l},lte:function(m,l){return m<=l},gt:function(m,l){return m>l},gte:function(m,l){return m>=l},match:function(m,l,b){return l.test(m,
b)},contains:function(m,l,b,a){var c=this;l=l.data?l.data:Array.isArray(l)?l:[l];return k.every(l,function(f){if("object"===typeof f&&f.type){var e=c._getFilterComparator(f.type);return k.some(m,function(g){return e.call(c,g,f.args[1],b,a)})}return-1<k.indexOf(m,f)})}};return H(null,{_createFilterQuerier:function(m){function l(f){var e=f.type;f=f.args;var g=a._getFilterComparator(e);if(g){var d=f[0],h=n(d,b),p=f[1];p&&p.fetchSync&&(p=p.fetchSync());return function(y){return g.call(a,h(y),p,y,d)}}switch(e){case "and":case "or":for(var t=
0,w=f.length;t<w;t++){var u=l(f[t]);var r=r?function(y,B){return"and"===e?function(C){return y(C)&&B(C)}:function(C){return y(C)||B(C)}}(r,u):u}return r;case "function":return f[0];case "string":r=a[f[0]];if(!r)throw Error("No filter function "+f[0]+" was found in the collection");return r;case void 0:return function(){return!0};default:throw Error('Unknown filter operation "'+e+'"');}}var b=this.queryAccessors,a=this,c=l(m);return function(f){return k.filter(f,c)}},_getFilterComparator:function(m){return q[m]||
this.inherited(arguments)},_createSelectQuerier:function(m){return function(l){var b=m.length;return k.map(l,m instanceof Array?function(a){for(var c={},f=0;f<b;f++){var e=m[f];c[e]=a[e]}return c}:function(a){return a[m]})}},_createSortQuerier:function(m){var l=this.queryAccessors;return function(b){b=b.slice();"function"===typeof m?b.sort(m):m&&m.length&&b.sort(function(a,c){for(var f=0;f<m.length;f++){var e=m[f];if("function"==typeof e)var g=e(a,c);else{g=e.get||(e.get=n(e.property,l));e=e.descending;
var d=g(a);g=g(c);null!=d&&(d=d.valueOf());null!=g&&(g=g.valueOf());g=d===g?0:!!e===("undefined"===typeof g||null===g&&"undefined"!==typeof d||null!=d&&d<g)?1:-1}if(0!==g)return g}return 0});return b}}})})},"dstore/Trackable":function(){define("dojo/_base/lang dojo/_base/declare dojo/aspect dojo/when dojo/promise/all dojo/_base/array dojo/on".split(" "),function(H,k,n,q,m,l,b){function a(e,g,d){for(var h=e.length-1;0<=h;--h){var p=e[h],t=p.start;p=t+p.count;if(g>p){e.splice(h+1,0,{start:g,count:d-
g});return}d>=t&&(g=Math.min(g,t),d=Math.max(d,p),e.splice(h,1))}e.unshift({start:g,count:d-g})}var c=0,f={track:function(){function e(){return function(){var C=this,G=this.inherited(arguments);q(G,function(x){x=C._results=x.slice();C._partialResults&&(C._partialResults=null);C._ranges=[];a(C._ranges,0,x.length)});return G}}function g(){return function(C){var G=this,x=C.start,v=C.end,z=this.inherited(arguments);this._results||q(z,function(A){return q(A.totalLength,function(F){var J=G._partialResults||
(G._partialResults=[]);v=Math.min(v,x+A.length);J.length=F;F=[x,v-x].concat(A);J.splice.apply(J,F);a(G._ranges,x,v);return A})});return z}}function d(C,G){c++;var x=G.target;G=H.delegate(G,y[C]);var v=G.beforeId;q(u._results||u._partialResults,function(z){if(z){var A,F,J=u._ranges,L="id"in G?G.id:h.getIdentity(x),P=-1,Q=-1,Z=-1,ca=-1;if("delete"===C||"update"===C)for(A=0;-1===P&&A<J.length;++A){var da=J[A];var ea=da.start;for(F=ea+da.count;ea<F;++ea)if(h.getIdentity(z[ea])==L){P=G.previousIndex=ea;
Q=A;var fa=v==L;z.splice(P,1);da.count--;for(ea=A+1;ea<J.length;++ea)J[ea].start--;break}}if("add"===C||"update"===C){if(r){if(r([x]).length){var K=0;F=J.length-1;for(fa=-1;K<=F&&-1===Z;)A=K+Math.round((F-K)/2),da=J[A],Q=z.slice(da.start,da.start+da.count),void 0!==v&&(fa=null===v?Q.length:B(Q,v)),-1===fa&&(fa=P>=Math.max(0,da.start-1)&&P<=da.start+da.count?P:h.defaultNewToStart?0:Q.length),Q.splice(fa,0,x),ea=l.indexOf(r(Q),x),L=da.start+ea,0===ea&&0!==da.start?F=A-1:ea>=Q.length-1&&L<z.length?K=
A+1:(Z=L,ca=A);if(-1===Z&&0<K&&K<J.length)var V=!0}}else{ea=-1;if(void 0===v||fa)"update"===C?(Z=P,ca=Q):h.defaultNewToStart?ea=Z=0:(Z=z.length,ea=J.length-1);else if(null===v)Z=z.length,ea=J.length-1;else for(A=0,F=J.length;-1===ca&&A<F;++A)da=J[A],Z=B(z,v,da.start,da.start+da.count),-1!==Z&&(ca=A);-1!==ea&&-1===ca&&(da=J[ea])&&da.start<=Z&&Z<=da.start+da.count&&(ca=ea)}if(-1<Z&&-1<ca)for(G.index=Z,z.splice(Z,0,x),J[ca].count++,A=ca+1;A<J.length;++A)J[A].start++;else if(V)for(G.beforeIndex=J[K].start,
A=K;A<J.length;++A)J[A].start++}G.totalLength=z.length}(z=u["on_tracked"+C])&&z.call(u,G)})}var h=this.store||this,p=[],t={add:1,update:1,"delete":1},w;for(w in t)p.push(this.on(w,function(C){return function(G){d(C,G)}}(w)));var u=k.safeMixin(H.delegate(this),{_ranges:[],fetch:e(),fetchRange:g(),releaseRange:function(C,G){if(this._partialResults){a:for(var x=this._ranges,v=0,z;z=x[v];++v){var A=z.start,F=A+z.count;if(C<=A)if(G>=F)x.splice(v,1);else{z.start=G;z.count=F-z.start;break a}else if(C<F)if(G>
A){x.splice(v,1,{start:A,count:C-A},{start:G,count:F-G});break a}else z.count=C-z.start}for(;C<G;++C)delete this._partialResults[C]}},on:function(C,G){var x=this,v=this.getInherited(arguments);return b.parse(u,C,G,function(z,A){return A in t?n.after(u,"on_tracked"+A,G,!0):v.call(x,A,G)})},tracking:{remove:function(){for(;0<p.length;)p.pop().remove();this.remove=function(){}}},track:null});this.fetchSync&&(k.safeMixin(u,{fetchSync:e(),fetchRangeSync:g()}),u.fetchSync());var r;l.forEach(this.queryLog,
function(C){var G=r,x=C.querier;x&&(r=G?function(v){return x(G(v))}:x)});var y={add:{index:void 0},update:{previousIndex:void 0,index:void 0},"delete":{previousIndex:void 0}},B=function(C,G,x,v){v=void 0!==v?v:C.length;for(x=void 0!==x?x:0;x<v;++x)if(h.getIdentity(C[x])===G)return x;return-1};return u}};m=k(null,f);m.create=function(e,g){e=k.safeMixin(H.delegate(e),f);k.safeMixin(e,g);return e};return m})},"dstore/Tree":function(){define(["dojo/_base/declare"],function(H){return H(null,{constructor:function(){this.root=
this},mayHaveChildren:function(k){return"hasChildren"in k?k.hasChildren:!0},getRootCollection:function(){return this.root.filter({parent:null})},getChildren:function(k){return this.root.filter({parent:this.getIdentity(k)})}})})},"esri/dijit/analysis/SpatialReferences":function(){define(["dojo/_base/lang","dojo/has","../../kernel"],function(H,k,n){for(var q=[{name:"Spatial References"},{name:"PCS",parent:"Spatial References"},{name:"UTM",parent:"PCS"},{name:"World",parent:"PCS"},{name:"Continental",
parent:"World"},{name:"Sinusoidal",type:"PCS",sRef:{wkid:54008},parent:"World"},{name:"Winkel Tripel (NGS version)",type:"PCS",sRef:{wkid:54042},parent:"World"},{name:"NAD 1983 Contiguous USA Albers",type:"PCS",sRef:{wkid:5070},parent:"Continental"},{name:"GDA 1994 Australia Albers",type:"PCS",sRef:{wkid:3577},parent:"Continental"},{name:"ETRS 1989 Lambert Azimuthal Equal Area Coord Ref Sys",type:"PCS",sRef:{wkid:3035},parent:"Continental"},{name:"ETRS 1989 Lambert Conformal Conic Coord Ref Sys",
type:"PCS",sRef:{wkid:3034},parent:"Continental"},{name:"NAD 1983 Albers Canada",type:"PCS",sRef:{wkid:102001},parent:"Continental"},{name:"NAD 1983 Lambert Canada",type:"PCS",sRef:{wkid:102002},parent:"Continental"},{name:"NAD 1983 Lambert contiguous USA",type:"PCS",sRef:{wkid:102004},parent:"Continental"},{name:"NAD 1983 Albers Alaska",type:"PCS",sRef:{wkid:3338},parent:"Continental"},{name:"NAD 1983 Albers Hawaii",type:"PCS",sRef:{wkid:102007},parent:"Continental"},{name:"NAD 1983 Albers North America",
type:"PCS",sRef:{wkid:102008},parent:"Continental"},{name:"NAD 1983 Lambert North America",type:"PCS",sRef:{wkid:102009},parent:"Continental"},{name:"WGS 1984 Sinusoidal Africa",type:"PCS",sRef:{wkid:102011},parent:"Continental"},{name:"WGS 1984 Lambert Asia",type:"PCS",sRef:{wkid:102012},parent:"Continental"},{name:"SAD 1969 Lambert South America",type:"PCS",sRef:{wkid:102015},parent:"Continental"},{name:"WGS 1984 Lambert Azimuthal EqArea North Pole",type:"PCS",sRef:{wkid:102017},parent:"Continental"},
{name:"WGS 1984 Stereographic North Pole",type:"PCS",sRef:{wkid:102018},parent:"Continental"},{name:"WGS 1984 Lambert Azimuthal EqArea South Pole",type:"PCS",sRef:{wkid:102020},parent:"Continental"},{name:"WGS 1984 Stereographic South Pole",type:"PCS",sRef:{wkid:102021},parent:"Continental"},{name:"WGS 1984 Lambert for Africa",type:"PCS",sRef:{wkid:102024},parent:"Continental"},{name:"WGS 1984 Albers for Northern Asia",type:"PCS",sRef:{wkid:102025},parent:"Continental"},{name:"WGS 1984 Lambert for Northern Asia",
type:"PCS",sRef:{wkid:102027},parent:"Continental"},{name:"WGS 1984 Albers for Southern Asia",type:"PCS",sRef:{wkid:102028},parent:"Continental"},{name:"WGS 1984 Lambert for Southern Asia",type:"PCS",sRef:{wkid:102030},parent:"Continental"},{name:"SAD 1969 Albers South America",type:"PCS",sRef:{wkid:102033},parent:"Continental"},{name:"NAD 1983 USGS Contiguous USA Albers",type:"PCS",sRef:{wkid:102039},parent:"Continental"},{name:"WGS 1984 UTM Zone 1N",type:"PCS",sRef:{wkid:32601},parent:"UTM"},{name:"WGS 1984 UTM Zone 2N",
type:"PCS",sRef:{wkid:32602},parent:"UTM"},{name:"WGS 1984 UTM Zone 3N",type:"PCS",sRef:{wkid:32603},parent:"UTM"},{name:"WGS 1984 UTM Zone 4N",type:"PCS",sRef:{wkid:32604},parent:"UTM"},{name:"WGS 1984 UTM Zone 5N",type:"PCS",sRef:{wkid:32605},parent:"UTM"},{name:"WGS 1984 UTM Zone 6N",type:"PCS",sRef:{wkid:32606},parent:"UTM"},{name:"WGS 1984 UTM Zone 7N",type:"PCS",sRef:{wkid:32607},parent:"UTM"},{name:"WGS 1984 UTM Zone 8N",type:"PCS",sRef:{wkid:32608},parent:"UTM"},{name:"WGS 1984 UTM Zone 9N",
type:"PCS",sRef:{wkid:32609},parent:"UTM"},{name:"WGS 1984 UTM Zone 10N",type:"PCS",sRef:{wkid:32610},parent:"UTM"},{name:"WGS 1984 UTM Zone 11N",type:"PCS",sRef:{wkid:32611},parent:"UTM"},{name:"WGS 1984 UTM Zone 12N",type:"PCS",sRef:{wkid:32612},parent:"UTM"},{name:"WGS 1984 UTM Zone 13N",type:"PCS",sRef:{wkid:32613},parent:"UTM"},{name:"WGS 1984 UTM Zone 14N",type:"PCS",sRef:{wkid:32614},parent:"UTM"},{name:"WGS 1984 UTM Zone 15N",type:"PCS",sRef:{wkid:32615},parent:"UTM"},{name:"WGS 1984 UTM Zone 16N",
type:"PCS",sRef:{wkid:32616},parent:"UTM"},{name:"WGS 1984 UTM Zone 17N",type:"PCS",sRef:{wkid:32617},parent:"UTM"},{name:"WGS 1984 UTM Zone 18N",type:"PCS",sRef:{wkid:32618},parent:"UTM"},{name:"WGS 1984 UTM Zone 19N",type:"PCS",sRef:{wkid:32619},parent:"UTM"},{name:"WGS 1984 UTM Zone 20N",type:"PCS",sRef:{wkid:32620},parent:"UTM"},{name:"WGS 1984 UTM Zone 21N",type:"PCS",sRef:{wkid:32621},parent:"UTM"},{name:"WGS 1984 UTM Zone 22N",type:"PCS",sRef:{wkid:32622},parent:"UTM"},{name:"WGS 1984 UTM Zone 23N",
type:"PCS",sRef:{wkid:32623},parent:"UTM"},{name:"WGS 1984 UTM Zone 24N",type:"PCS",sRef:{wkid:32624},parent:"UTM"},{name:"WGS 1984 UTM Zone 25N",type:"PCS",sRef:{wkid:32625},parent:"UTM"},{name:"WGS 1984 UTM Zone 26N",type:"PCS",sRef:{wkid:32626},parent:"UTM"},{name:"WGS 1984 UTM Zone 27N",type:"PCS",sRef:{wkid:32627},parent:"UTM"},{name:"WGS 1984 UTM Zone 28N",type:"PCS",sRef:{wkid:32628},parent:"UTM"},{name:"WGS 1984 UTM Zone 29N",type:"PCS",sRef:{wkid:32629},parent:"UTM"},{name:"WGS 1984 UTM Zone 30N",
type:"PCS",sRef:{wkid:32630},parent:"UTM"},{name:"WGS 1984 UTM Zone 31N",type:"PCS",sRef:{wkid:32631},parent:"UTM"},{name:"WGS 1984 UTM Zone 32N",type:"PCS",sRef:{wkid:32632},parent:"UTM"},{name:"WGS 1984 UTM Zone 33N",type:"PCS",sRef:{wkid:32633},parent:"UTM"},{name:"WGS 1984 UTM Zone 34N",type:"PCS",sRef:{wkid:32634},parent:"UTM"},{name:"WGS 1984 UTM Zone 35N",type:"PCS",sRef:{wkid:32635},parent:"UTM"},{name:"WGS 1984 UTM Zone 36N",type:"PCS",sRef:{wkid:32636},parent:"UTM"},{name:"WGS 1984 UTM Zone 37N",
type:"PCS",sRef:{wkid:32637},parent:"UTM"},{name:"WGS 1984 UTM Zone 38N",type:"PCS",sRef:{wkid:32638},parent:"UTM"},{name:"WGS 1984 UTM Zone 39N",type:"PCS",sRef:{wkid:32639},parent:"UTM"},{name:"WGS 1984 UTM Zone 40N",type:"PCS",sRef:{wkid:32640},parent:"UTM"},{name:"WGS 1984 UTM Zone 41N",type:"PCS",sRef:{wkid:32641},parent:"UTM"},{name:"WGS 1984 UTM Zone 42N",type:"PCS",sRef:{wkid:32642},parent:"UTM"},{name:"WGS 1984 UTM Zone 43N",type:"PCS",sRef:{wkid:32643},parent:"UTM"},{name:"WGS 1984 UTM Zone 44N",
type:"PCS",sRef:{wkid:32644},parent:"UTM"},{name:"WGS 1984 UTM Zone 45N",type:"PCS",sRef:{wkid:32645},parent:"UTM"},{name:"WGS 1984 UTM Zone 46N",type:"PCS",sRef:{wkid:32646},parent:"UTM"},{name:"WGS 1984 UTM Zone 47N",type:"PCS",sRef:{wkid:32647},parent:"UTM"},{name:"WGS 1984 UTM Zone 48N",type:"PCS",sRef:{wkid:32648},parent:"UTM"},{name:"WGS 1984 UTM Zone 49N",type:"PCS",sRef:{wkid:32649},parent:"UTM"},{name:"WGS 1984 UTM Zone 50N",type:"PCS",sRef:{wkid:32650},parent:"UTM"},{name:"WGS 1984 UTM Zone 51N",
type:"PCS",sRef:{wkid:32651},parent:"UTM"},{name:"WGS 1984 UTM Zone 52N",type:"PCS",sRef:{wkid:32652},parent:"UTM"},{name:"WGS 1984 UTM Zone 53N",type:"PCS",sRef:{wkid:32653},parent:"UTM"},{name:"WGS 1984 UTM Zone 54N",type:"PCS",sRef:{wkid:32654},parent:"UTM"},{name:"WGS 1984 UTM Zone 55N",type:"PCS",sRef:{wkid:32655},parent:"UTM"},{name:"WGS 1984 UTM Zone 56N",type:"PCS",sRef:{wkid:32656},parent:"UTM"},{name:"WGS 1984 UTM Zone 57N",type:"PCS",sRef:{wkid:32657},parent:"UTM"},{name:"WGS 1984 UTM Zone 58N",
type:"PCS",sRef:{wkid:32658},parent:"UTM"},{name:"WGS 1984 UTM Zone 59N",type:"PCS",sRef:{wkid:32659},parent:"UTM"},{name:"WGS 1984 UTM Zone 60N",type:"PCS",sRef:{wkid:32660},parent:"UTM"}],m=0;m<q.length;++m)q[m].hasChildren=void 0===q[m].type;q={identifier:"name",items:q};k("extend-esri")&&H.setObject("dijit.analysis.SpatialReferences",q,n);return q})},"esri/dijit/analysis/JobsViewModel":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has dojo/json dojo/Stateful dojo/topic ./utils ./storageUtils ../../kernel ../../lang".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e){H=H([l],{declaredClass:"esri.dijit.analysis.JobsViewModel",constructor:function(g){this.watch("item",k.hitch(this,this.fetchJobs))},_portalUrlSetter:function(g){this.portalUrl=g},_itemSetter:function(g){this.item=g},_jobsSetter:function(g){this.jobs=g},_currentJobSetter:function(g){g&&g.jobParams&&a.jobParamsToWidgetProps(g).then(k.hitch(this,function(d){this.currentJob=d;b.publish("analysis/jobs/selectedjob",this.currentJob,this.item)}))},fetchJobs:function(){this.portalUrl&&
this.item&&c.getResourcesInfo(this.item,{portalUrl:this.portalUrl}).then(k.hitch(this,function(g){g=n.filter(g,function(d){return e.isDefined(d.toolName)&&e.isDefined(d.jobInfo)&&e.isDefined(d.jobParams)});this.set("jobs",g)}),k.hitch(this,function(g){console.log("Error fetching jobs",g)}))}});q("extend-esri")&&k.setObject("dijit.analysis.JobsViewModel",H,f);return H})},"esri/dijit/analysis/JobsList":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/Color dojo/_base/json dojo/date/locale dojo/has dojo/json dojo/on dojo/string dojo/dom-style dojo/dom-attr dojo/dom-construct dojo/query dojo/dom-class dojo/NodeList dojo/NodeList-dom dojo/_base/fx dojo/fx/easing dojo/Evented dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dijit/_OnDijitClickMixin dijit/_FocusMixin dijit/registry dijit/form/Button dijit/form/CheckBox dijit/form/Form dijit/form/Select dijit/form/TextBox dijit/form/ToggleButton dijit/form/ValidationTextBox dijit/layout/ContentPane dijit/form/FilteringSelect dijit/Dialog dijit/ConfirmDialog dojox/mvc/at dgrid1/OnDemandGrid dgrid1/Tree dgrid1/Editor dgrid1/Keyboard dgrid1/Selection dgrid1/Selector dgrid1/extensions/ColumnResizer dgrid1/extensions/DijitRegistry ../../kernel ../../lang ./_Widget ./utils ./JobsViewModel dojo/i18n!../../nls/jsapi dojo/text!./templates/JobsList.html".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G,x,v,z,A,F,J,L,P,Q,Z,ca,da,ea,fa,K,V,aa,Y,I,O,E,N,R,W,ha,oa,ma,T,ba,na,ia){H=ma.createSubclass([G,x,v,z],{declaredClass:"esri.dijit.analysis.JobsList",templateString:ia,widgetsInTemplate:!0,i18n:null,toolName:"JobsList",helpFileName:"AnalysisEnvironments",viewModelType:ba,cssClass:{primaryButton:"btn calcite blue",button:"btn calcite",tableRow:"esriHelpPopup"},constructor:function(pa,D){this._pbConnects=[];pa.containerNode&&(this.container=pa.containerNode);
this.cssClass=n.mixin({},this.cssClass)},destroy:function(){this.inherited(arguments)},postMixInProperties:function(){this.inherited(arguments);this.i18n={};n.mixin(this.i18n,na.common);this._initModelWatchers()},postCreate:function(){this.inherited(arguments);this.buildJobsList()},startup:function(){},buildJobsList:function(){q.forEach(this.viewModel.jobs,function(pa){var D=p.create("tr",{"class":this.cssClass.tableRow},this._analysisJobTBody),M=p.create("td",{innerHTML:"\x3ca href\x3d'#'\x3e"+pa.toolName+
"\x3c/a\x3e"},D);p.create("td",{innerHTML:this._formatTimeStamp(pa.timestamp)},D);e(M,"click",n.hitch(this,this._openTool,pa))},this)},_initModelWatchers:function(){this.own(this.viewModel.watch("jobs",n.hitch(this,this.buildJobsList)))},_openTool:function(pa){this.viewModel.set("currentJob",pa)},_formatTimeStamp:function(pa){return a.format(new Date(pa),{formatLength:"medium"})}});c("extend-esri")&&n.setObject("dijit.analysis.JobsList",H,ha);return H})},"esri/dijit/analysis/components/DataStoreSelect":function(){define("../../../kernel ../../../lang ../../../request dijit/_WidgetBase dojox/lang/functional/object dojo/_base/declare dojo/_base/lang dojo/dom-construct dojo/has dojo/promise/all dojo/Evented dojo/i18n!../nls/DataStoreSelect".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g){k=l([q,e],{declaredClass:"esri.dijit.analysis.components.DataStoreSelect",geoAnalyticsServer:null,i18n:null,postMixInProperties:function(){this.inherited(arguments);this.i18n={};b.mixin(this.i18n,g)},buildRendering:function(){this.createElements()},postCreate:function(){this.inherited(arguments);this.buildDataStoreUI()},createElements:function(){this.domNode=a.create("div",{style:"width:100%;height:100%"});this._dsSelect=a.create("select",{"class":"dijit dijitReset dijitInline dijitLeft dijitDownArrowButton esriLeadingMargin1 longInput esriLongLabel dijitSelect dijitValidationTextBox",
onchange:b.hitch(this,this._handleDSSelectChange)},this.domNode)},_handleDSSelectChange:function(d){this.emit("change",{value:this._dsSelect.value})},buildDataStoreUI:function(){if(this.geoAnalyticsServer&&!this.bdfsTemplateOptions){var d=this.geoAnalyticsServer.replace("/System/GeoAnalyticsTools/GPServer","");n({url:d+"/DataStoreCatalogs",content:{f:"json"}}).then(b.hitch(this,function(h){var p=h.services.map(function(t){return t.name});h=p.map(function(t){return n({url:d+"/"+t+"/BigDataCatalogServer",
content:{f:"json"}})});f(h).then(b.hitch(this,function(t){var w=[];t.filter(function(r,y){r.name=p[y];return void 0!==r.outputTemplates}).forEach(function(r){r.outputTemplates.forEach(function(y){w.push({label:r.name.replace("DataStoreCatalogs/bigDataFileShares_","")+"-"+y.title,innerHTML:r.name.replace("DataStoreCatalogs/bigDataFileShares_","")+"-"+y.title,value:r.name.replace("DataStoreCatalogs/bigDataFileShares_","/bigDataFileShares/")+":"+y.name})})});this.bdfsTemplateOptions=w;t=a.create("optGroup",
{label:this.i18n.agsDataStore});var u=a.create("optGroup",{label:this.i18n.bdfsTemplates});t.appendChild(a.create("option",{label:this.i18n.relationalDS,value:"GDB",innerHTML:this.i18n.relationalDS}));t.appendChild(a.create("option",{label:this.i18n.spatialDS,value:"BDS",innerHTML:this.i18n.spatialDS}));w.forEach(b.hitch(this,function(r){u.appendChild(a.create("option",r))}));this._dsSelect.appendChild(t);this._dsSelect.appendChild(u);m.keys(this._dsSelect.options).some(function(r){return r.label===
this.value},this);this._setCurValue()}))}),b.hitch(this,function(){this._dsSelect.add(a.create("option",{label:this.i18n.relationalDS,value:"GDB",innerHTML:this.i18n.relationalDS}));this._dsSelect.add(a.create("option",{label:this.i18n.spatialDS,value:"BDS",innerHTML:this.i18n.spatialDS}));this._setCurValue()}))}},_setCurValue:function(){m.keys(this._dsSelect.options).some(function(d){return d.label===this.value},this)?this._dsSelect.value=this.value:this._dsSelect.value="BDS"},reset:function(){this._dsSelect.reset()},
_setGeoAnalyticsServerAttr:function(d){this.geoAnalyticsServer=d},_setValueAttr:function(d){this.value=d||"BDS"},_getValueAttr:function(){return this._dsSelect?this._dsSelect.value:null}});c("extend-esri")&&b.setObject("dijit.analysis.components.DataStoreSelect",k,H);return k})},"dojox/lang/functional/object":function(){define(["dojo/_base/kernel","dojo/_base/lang","./lambda"],function(H,k,n){var q={};k.mixin(n,{keys:function(m){var l=[],b;for(b in m)b in q||l.push(b);return l},values:function(m){var l=
[],b;for(b in m)b in q||l.push(m[b]);return l},filterIn:function(m,l,b){b=b||H.global;l=n.lambda(l);var a={},c;for(c in m)if(!(c in q)){var f=m[c];l.call(b,f,c,m)&&(a[c]=f)}return a},forIn:function(m,l,b){b=b||H.global;l=n.lambda(l);for(var a in m)a in q||l.call(b,m[a],a,m);return b},mapIn:function(m,l,b){b=b||H.global;l=n.lambda(l);var a={},c;for(c in m)c in q||(a[c]=l.call(b,m[c],c,m));return a}});return n})},"dojox/lang/functional/lambda":function(){define(["../..","dojo/_base/lang","dojo/_base/array"],
function(H,k,n){var q=k.getObject("lang.functional",!0,H),m={},l=1<"ab".split(/a*/).length?String.prototype.split:function(c){var f=this.split.call(this,c);(c=c.exec(this))&&0==c.index&&f.unshift("");return f},b=function(c){var f=[],e=l.call(c,/\s*->\s*/m);if(1<e.length)for(;e.length;)c=e.pop(),f=e.pop().split(/\s*,\s*|\s+/m),e.length&&e.push("(function("+f.join(", ")+"){ return ("+c+"); })");else if(c.match(/\b_\b/))f=["_"];else{e=c.match(/^\s*(?:[+*\/%&|\^\.=<>]|!=)/m);var g=c.match(/[+\-*\/%&|\^\.=<>!]\s*$/m);
if(e||g)e&&(f.push("$1"),c="$1"+c),g&&(f.push("$2"),c+="$2");else{e=c.replace(/(?:\b[A-Z]|\.[a-zA-Z_$])[a-zA-Z_$\d]*|[a-zA-Z_$][a-zA-Z_$\d]*:|this|true|false|null|undefined|typeof|instanceof|in|delete|new|void|arguments|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|eval|isFinite|isNaN|parseFloat|parseInt|unescape|dojo|dijit|dojox|window|document|'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g,"").match(/([a-z_$][a-z_$\d]*)/gi)||[];var d={};n.forEach(e,function(h){d.hasOwnProperty(h)||(f.push(h),
d[h]=1)})}}return{args:f,body:c}},a=function(c){return c.length?function(){var f=c.length-1,e=q.lambda(c[f]).apply(this,arguments);for(--f;0<=f;--f)e=q.lambda(c[f]).call(this,e);return e}:function(f){return f}};k.mixin(q,{rawLambda:function(c){return b(c)},buildLambda:function(c){c=b(c);return"function("+c.args.join(",")+"){return ("+c.body+");}"},lambda:function(c){if("function"==typeof c)return c;if(c instanceof Array)return a(c);if(m.hasOwnProperty(c))return m[c];var f=b(c);return m[c]=new Function(f.args,
"return ("+f.body+");")},clearLambdaCache:function(){m={}}});return q})},"esri/dijit/analysis/mixins/browselayers/BrowseLayerMixin":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has dojo/query ../../../../kernel ../../../../request ../../../../lang ../../../../layers/CSVLayer ../../../../arcgis/Portal ../../../../SpatialReference ../../ProjectExtent dojo/Deferred ../../ItemTypes ../../utils ./configs/AGOLBrowseItem ./configs/EnterpriseBrowseItem dojo/i18n!../../nls/BrowseLayerMixin".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u){H=H([],{tableSupportedTools:"JoinFeatures SummarizeAttributes ExtractData GeocodeLocationsfromTable CopyToDataStore AppendData CalculateField MergeLayers DescribeDataset DetectIncidents".split(" "),allowedItemTypes:[],defaultItemTypes:[h.MS,h.FS],availableItemTypeFilters:["layers","featureLayers"],_createBrowseItems:function(r,y,B){r=r||{};var C=r.browseValue||{};y=y||{};var G=this.defaultItemTypes.concat(this.get("allowedItemTypes"));if(this.useArcGISComponents)this.setUpItemBrowser(r,
y,B).then(function(){this.map&&this._chopExtentAtDateLine(this.map.extent).then(this._projectExtentAndDispatch.bind(this))}.bind(this));else{var x=[];G.forEach(function(v){x.push('type:"'+v+'"')});"browse"===C?(B=this._browsedlg.browseItems.get("query"),B.custom=this._queryTagsForLivingAtlasBrowseItems(y),this._browsedlg.browseItems.set("extent",this.get("map").extent),this._browsedlg.browseItems.set("query",B),this._browsedlg.show()):(this.showGeoAnalyticsParams&&x.push('type:"'+h.BIGDATA+'"'),B=
this._browseLyrsdlg.browseItems.get("query"),B.types=x,this._browseLyrsdlg.browseItems.set("query",B),y.geometryTypes?(this._browseLyrsdlg.browseItems.plugIn.checkGeometryType=!0,0<y.geometryTypes.length&&(this._browseLyrsdlg.browseItems.plugIn.geometryTypes=y.geometryTypes)):this._browseLyrsdlg.browseItems.plugIn.checkGeometryType=!1,y.layerTypes?(this._browseLyrsdlg.browseItems.plugIn.checkLayerType=!0,0<y.layerTypes.length&&(this._browseLyrsdlg.browseItems.plugIn.layerTypes=y.layerTypes)):this._browseLyrsdlg.browseItems.plugIn.checkLayerType=
!1,y.customCheck?(this._browseLyrsdlg.browseItems.plugIn.customCheckHandler=y.customCheck.customCheckHandler,this._browseLyrsdlg.browseItems.plugIn.customCheckFailureMessage=y.customCheck.customCheckFailureMessage):this._browseLyrsdlg.browseItems.plugIn.customCheckHandler=void 0,this._browseLyrsdlg.show())}},setUpItemBrowser:function(r,y,B){var C=new d;window.require(["arcgis-components/wrappers/ItemBrowser","esri/arcgis/Portal"],function(G,x){if(!this.ib){var v=document.createElement("div");!r.isDialog&&
document.body.appendChild(v);var z=new x.Portal(this.portalSelf&&this.portalSelf.urlKey&&this.portalSelf.customBaseUrl?location.protocol+"//"+this.portalSelf.urlKey+"."+this.portalSelf.customBaseUrl+"/sharing/rest":(this.portalSelf&&this.portalSelf.portalHostname?location.protocol+"//"+this.portalSelf.portalHostname:this.portalUrl)+"/sharing/rest"),A=this.defaultItemTypes.concat(this.get("allowedItemTypes")),F=function(){this._closeFullScreenBrowser();r.isDialog&&this._closeDialog();this._resetSelectBox(B);
!r.isDialog&&this._removeDOMfromBody(v)},J=function(ca){this._closeFullScreenBrowser();r.isDialog&&this._closeDialog();ca[0]&&ca[0].type===h.RFT?this.onSelectRFTTool.bind(this)(ca[0],z):ca[0]&&ca[0].type===h.DLPK?this.onSelectDLPKTool.bind(this)(ca[0],z):this.onBrowseItemSelect.bind(this)(ca[0],z,B);!r.isDialog&&this._removeDOMfromBody(v)},L=function(ca){this._closeFullScreenBrowser();r.isDialog&&this._closeDialog();this.onSelectGPTool.bind(this)(ca);!r.isDialog&&this._removeDOMfromBody(v)},P=function(ca){this._closeFullScreenBrowser();
r.isDialog&&this._closeDialog();this.onEditRFTTool.bind(this)(ca,z);!r.isDialog&&this._removeDOMfromBody(v)},Q=function(ca){this._closeFullScreenBrowser();r.isDialog&&this._closeDialog();this.onBrowseItemSelect.bind(this)(ca,z,B);!r.isDialog&&this._removeDOMfromBody(v)},Z=function(ca){r.isDialog&&this._closeDialog();ca&&ca.type===h.RFT?this.onEditRFTTool.bind(this)(ca,z):this.onBrowseItemSelect.bind(this)(ca,z,B,!0);!r.isDialog&&this._removeDOMfromBody(v)};-1<this.tableSupportedTools.indexOf(this.helpFileName)&&
(A=A.concat([this.showGeoAnalyticsParams?h.TABLE:h.BTABLE]));z.signIn().then(function(){this._fetchGroupForRFT(z).then(function(ca){-1<A.indexOf(h.IS)?this.availableItemTypeFilters=["layers","featureLayers","mapImageLayers","imageryLayers"]:-1===A.indexOf(h.GPSERVICE)&&-1===A.indexOf(h.RFT)&&-1===A.indexOf(h.FILE)&&(this.availableItemTypeFilters=this.availableItemTypeFilters.concat(["layers","featureLayers"]));-1<this.tableSupportedTools.indexOf(this.helpFileName)&&(this.availableItemTypeFilters=
this.availableItemTypeFilters.concat(["tables"]));ca={allowedItemTypes:this.showGeoAnalyticsParams?[h.BIGDATA].concat(A):A,availableItemTypeFilters:this.showGeoAnalyticsParams?this.availableItemTypeFilters.concat(["bigDataFileShares"]):this.availableItemTypeFilters,customQueryTags:y,addQueryParameters:r.addQueryParameters,portal:z,isPortal:this.isSingleTenant,onSelectSubLayer:Q.bind(this),onActionSubLayer:Z.bind(this),onSelectGPTool:L.bind(this),onEditRFT:P.bind(this),rftGroupId:ca,disableLAAL:r.disableLAAL,
disableBoundary:r.disableBoundary,title:r.title,disabledSubResources:this._getDisableResources(r.disabledSubResources),showRFTSystemSection:null!=r.showRFTSystemSection?r.showRFTSystemSection:"raster"===r.analysisMode?!0:!1,showRFTEditCustomAction:null!=r.showRFTEditCustomAction?r.showRFTEditCustomAction:!0,enableMapAreaFilter:null!=r.enableMapAreaFilter?r.enableMapAreaFilter:!0};var da=k.mixin(G.initialState.settings.config,this.isSingleTenant?w.getConfig(ca):t.getConfig(ca)),ea=k.mixin(G.initialState.parameters,
{section:"myContent",filter:k.mixin(G.initialState.parameters.filter,{searchMapArea:!1})});-1<ca.allowedItemTypes.indexOf(h.RFT)&&!this.isSingleTenant&&(da.addQueryParameters=function(V){return"all"===V.parameters.section?"-owner: (esri_*)":""});if(-1<ca.allowedItemTypes.indexOf(h.RFT)&&ca.showRFTSystemSection){var fa=this.isSingleTenant;ea.section="System";ea.sort={field:"title",order:"asc"};da.enableMapAreaFilter=!1;da.addQueryParameters=function(V){var aa;return!fa&&V.parameters&&"all"===V.parameters.section?
"-owner: (esri_*)":V.parameters&&V.parameters.searchString&&V.parameters.searchString.current&&"System"===V.parameters.section?(V=V.parameters.searchString.current,-1===V.indexOf(":")&&(aa="tags: ("+V+")"),aa?aa:""):""};var K;n.some(da.customSections,function(V){if("System"===V.name)return K=V.baseQuery,!0});require(["arcgis-raster-function-editor/RFxRegistry"],function(V){V.initialize({sysRFxBaseQuery:K,asRFxEditorBuddy:!1,isMultiTenant:!1===this.isSingleTenant});V=V.createRequestProxy(b);this._originalRequestModule=
b;b=V}.bind(this))}this.ib=new G.ItemBrowserWrapper(v,{apiVersion:3,portal:z,request:b,initialState:k.mixin(G.initialState,{settings:k.mixin(G.initialState.settings,{config:k.mixin(da,{onBack:F.bind(this),onSelect:J.bind(this)})}),ui:k.mixin(G.initialState.ui,{expanded:k.mixin(G.initialState.ui.expanded,{filters:!0})})}),parameters:ea});r.isDialog&&this._createDialog(v,z);C.resolve()}.bind(this))}.bind(this))}}.bind(this));return C},_queryTagsForLivingAtlasBrowseItems:function(r){if((r=r&&r.tags)&&
0!==r.length){if(1===r.length)return['tags:"'+r[0]+'"'];m=[];r.forEach(function(y){m.push('tags:"'+y+'"')});return m}},onBrowseItemSelect:function(r,y,B,C){y=this._getPortalItem(r,y);var G={selection:y,dialog:this._browseLyrsdlg||this._browsedlg};!r.url||p.isHostedService(r.url)||this.isSingleTenant||y.selectedLayer instanceof c?this._handleBrowseItemsSelect(G,C):this._getProxyServiceInfo(r).then(function(){a.isDefined(r.analysisProxyCheck)&&"failure"===r.analysisProxyCheck?this._resetSelectBox(B):
this._handleBrowseItemsSelect(G,C)}.bind(this),function(){this._resetSelectBox(B)}.bind(this))},onSelectGPTool:function(r){r.resource.url=r.url;this._handleSelectGpTool(r.resource)},onSelectRFTTool:function(r,y){this._handleSelectRFTTool(this._getPortalItem(r,y))},onSelectDLPKTool:function(r,y){this._handleSelectDLPKTool(this._getPortalItem(r,y))},onEditRFTTool:function(r,y){this._handleEditRFTTool(this._getPortalItem(r,y))},_getPortalItem:function(r,y){r.resource&&r.item?(y=new f.PortalItem(k.mixin(r.item,
{portal:y})),y.selectedLayer=r.resource,y.selectedLayer.url=r.url):(y=new f.PortalItem(k.mixin(r,{portal:y})),r.type&&-1<[h.CSV,h.XLS].indexOf(r.type)&&(y.selectedLayer=y));return y},_createDialog:function(r,y){window.require(["dijit/Dialog","esri/dijit/analysis/mixins/browselayers/configs/Common"],function(B,C){this.itemBrowserDialog||(this.itemBrowserDialog=new B({style:"width: 900px; height:900px; overflow: auto",id:"itemBrowserDialog",closable:!1,title:u.customAnalysisLayerTitle}));this.itemBrowserDialog.set("content",
r);this.itemBrowserDialog.show()}.bind(this))},_closeDialog:function(){this.itemBrowserDialog.hide();this.itemBrowserDialog.destroy();delete this.itemBrowserDialog;delete this.ib},_closeFullScreenBrowser:function(){this._originalRequestModule&&(b=this._originalRequestModule);this.ib.dispatch({type:"CLOSE_FULLSCREEN_BROWSER"})},_setAllowedItemTypesAttr:function(r){this.allowedItemTypes=r},_setAvailableItemTypeFiltersAttr:function(r){this.availableItemTypeFilters=r},_getDisableResources:function(r){var y=
{};r&&r.length&&r.forEach(function(B){B&&B.url&&(y[B.url]=!0)},this);return y},_projectExtentAndDispatch:function(r){this.sr||(this.sr=new e(4326));g(r,this.sr,function(y){this._dispatchExtentToItemBrowser(y[0])}.bind(this),function(y){console.error(y)}.bind(this))},_chopExtentAtDateLine:function(r){var y=new d;window.esri.geometry.normalizeCentralMeridian([r],null,function(B){if(B[0].rings){var C=(new window.esri.geometry.Polygon(r.spatialReference)).addRing(B[0].rings[0]).getExtent();B=(new window.esri.geometry.Polygon(r.spatialReference)).addRing(B[0].rings[1]).getExtent();
y.resolve(C.getWidth()>B.getWidth()?C:B)}else y.resolve(B[0])},function(B){y.reject(B)});return y},_dispatchExtentToItemBrowser:function(r){window.require(["arcgis-components/wrappers/ItemBrowser"],function(y){this.ib.dispatch(y.updateExtent({minx:r.xmin,miny:r.ymin,maxx:r.xmax,maxy:r.ymax}))}.bind(this))},_fetchGroupForRFT:function(r){var y=new d;-1===this.allowedItemTypes.indexOf(h.RFT)&&y.resolve();this._systemRFTsGroup&&y.resolve(this._systemRFTsGroup);p.fetchGroupForRFT(r).then(function(B){this._systemRFTsGroup=
B;y.resolve(B)}.bind(this));return y},_removeDOMfromBody:function(r){setTimeout(function(){document.body.removeChild(r)},300);delete this.ib},_resetSelectBox:function(r){r&&r.reset()},_getProxyServiceInfo:function(r){var y=new d,B;a.isDefined(r)&&a.isDefined(r.url)||y.reject({error:"mapLayer is not defined"});var C=r.url+(-1<r.url.indexOf("?")?"\x26":"?")+"f\x3djson";var G=l.id.findCredential(r.url);var x=r.url;this.proxyCheckedServers||(this.proxyCheckedServers=[]);n.some(this.proxyCheckedServers,
function(v){B=x.substring(0,x.indexOf("/",9));if(v.server===B)return r.analysisProxyCheck=v.check,!0},this)?y.resolve({}):(G&&G.token&&(C+="\x26token\x3d"+G.token),y=b({url:C,content:null},{useProxy:!0}),y.then(function(){r.analysisProxyCheck="success";this.proxyCheckedServers.push({server:x.substring(0,x.indexOf("/",9)),check:"success"})}.bind(this),function(){r.analysisProxyCheck="failure";this.proxyCheckedServers.push({server:x.substring(0,x.indexOf("/",9)),check:"failure"})}.bind(this)));return y.promise}});
q("extend-esri")&&k.setObject("dijit.analysis.mixins.browselayers.BrowseLayerMixin",H,l);return H})},"esri/layers/CSVLayer":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/has ../kernel ../arcgis/csv ./FeatureLayer ../geometry/Extent ../tasks/FeatureSet".split(" "),function(H,k,n,q,m,l,b,a,c){k=k(b,{declaredClass:"esri.layers.CSVLayer",_preventInit:!0,_fieldTypeMap:{Date:"esriFieldTypeDate",Number:"esriFieldTypeDouble",String:"esriFieldTypeString"},constructor:function(f,
e){this.url=f;e=n.mixin({},e);this.columnDelimiter=e.columnDelimiter;this.latitudeFieldName=e.latitudeFieldName;this.longitudeFieldName=e.longitudeFieldName;f=e.layerDefinition;f||(f={fields:e.fields||[],geometryType:"esriGeometryPoint",copyrightText:e.copyright},e.fields&&H.forEach(e.fields,function(g){g.type=this._fieldTypeMap[g.type||"String"];g.alias||(g.alias=g.name)},this));this._buildCsvFcParam={url:this.url,columnDelimiter:this.columnDelimiter,layerDefinition:f,outFields:e.outFields};this.latitudeFieldName&&
this.longitudeFieldName&&(this._buildCsvFcParam.locationInfo={locationType:"coordinates",latitudeFieldName:this.latitudeFieldName,longitudeFieldName:this.longitudeFieldName});this._projectFeatures=n.hitch(this,this._projectFeatures);this._addFeatures=n.hitch(this,this._addFeatures);this._initCSVLayer(e)},refresh:function(){this._fireUpdateStart();this.applyEdits(null,null,this.graphics);this._loadFeatures()},_isWebGLCompatible:function(){return!1},_setMap:function(f){var e=this.inherited(arguments);
this._fireUpdateStart();this._projectFeatures(this._csvFC).then(this._addFeatures).otherwise(this._errorHandler);this._csvFC=null;return e},_initCSVLayer:function(f){var e=this;l.buildCSVFeatureCollection(this._buildCsvFcParam).then(function(g){!e._buildCsvFcParam.locationInfo||e.latitudeFieldName&&e.longitudeFieldName||(e.latitudeFieldName=e._buildCsvFcParam.locationInfo.latitudeFieldName,e.longitudeFieldName=e._buildCsvFcParam.locationInfo.longitudeFieldName);e._csvFC=g;var d=g.layerDefinition;
d.extent=e._getFCExtent(g);f.outFields||(f.outFields=["*"]);f.timeInfo&&(d.timeInfo=f.timeInfo);e._initFeatureLayer({layerDefinition:d},f)}).otherwise(this._errorHandler)},_loadFeatures:function(){l.buildCSVFeatureCollection(this._buildCsvFcParam).then(this._projectFeatures).then(this._addFeatures).otherwise(this._errorHandler)},_projectFeatures:function(f){return l.projectFeatureCollection(f,this._map.spatialReference)},_addFeatures:function(f){f=new c(f.featureSet);this.applyEdits(f.features,null,
null);this._fireUpdateEnd()},_getFCExtent:function(f){if(f&&f.featureSet&&f.featureSet.features){f=f.featureSet.features;var e=f.length;if(1<e){var g=f[0].geometry;var d=new a(g.x,g.y,g.x,g.y);for(--e;0<e;e--)g=f[e].geometry,d.xmin=Math.min(d.xmin,g.x),d.ymin=Math.min(d.ymin,g.y),d.xmax=Math.max(d.xmax,g.x),d.ymax=Math.max(d.ymax,g.y);0>=d.getWidth()&&0>=d.getHeight()&&(d=null)}}return d}});q("extend-esri")&&n.setObject("layers.CSVLayer",k,m);return k})},"esri/arcgis/csv":function(){define("dojo/_base/lang dojo/_base/array dojo/_base/Deferred dojo/sniff dojo/number dojox/data/CsvStore ../kernel ../config ../request ../SpatialReference ../geometry/jsonUtils ../geometry/webMercatorUtils".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g){function d(C){var G=0,x="";k.forEach([","," ",";","|","\t"],function(v){var z=C.split(v).length;z>G&&(G=z,x=v)});return x}function h(C,G){if(!C||"[object Date]"!==Object.prototype.toString.call(C)||isNaN(C.getTime()))return!1;C=!0;if(q("chrome")&&/\d+\W*$/.test(G)){if(G.match(/[^0-9a-zA-Z\s]/))return!1;if(G=G.match(/[a-zA-Z]{2,}/)){C=!1;for(var x=0,v=G.length,z=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i;!C&&
x<=v&&!(C=!z.test(G[x]));)x++;C=!C}}return C}function p(C,G,x){var v=C.indexOf("\n");v=H.trim(C.substr(0,v));var z=G.columnDelimiter;z||(z=d(v));var A=new l({data:C,separator:z});A.fetch({onComplete:function(F,J){J=0;var L={layerDefinition:G.layerDefinition,featureSet:{features:[],geometryType:"esriGeometryPoint"}},P=L.layerDefinition.objectIdField,Q=L.layerDefinition.fields;P||k.some(Q,function(E){return"esriFieldTypeOID"===E.type?(P=E.name,!0):!1})||(Q.push({name:"__OBJECTID",alias:"__OBJECTID",
type:"esriFieldTypeOID",editable:!1}),P="__OBJECTID");var Z=A._attributes,ca=[],da=[];k.forEach(Q,function(E){"esriFieldTypeDate"===E.type?ca.push(E.name):("esriFieldTypeDouble"===E.type||"esriFieldTypeInteger"===E.type)&&da.push(E.name)});if(G.locationInfo&&"coordinates"===G.locationInfo.locationType){var ea=G.locationInfo.latitudeFieldName;var fa=G.locationInfo.longitudeFieldName}else k.forEach(Z,function(E){var N=k.indexOf(r,E.toLowerCase());-1!==N&&(ea=E);N=k.indexOf(y,E.toLowerCase());-1!==N&&
(fa=E)}),ea&&fa&&(G.locationInfo={locationType:"coordinates",latitudeFieldName:ea,longitudeFieldName:fa});if(ea&&fa){-1===k.indexOf(da,ea)&&da.push(ea);-1===k.indexOf(da,fa)&&da.push(fa);if(H.isArray(G.outFields)&&-1===k.indexOf(G.outFields,"*"))var K=G.outFields;k.forEach(Z,function(E){k.some(Q,function(N){return E===N.name})||Q.push({name:E,alias:E,type:E===ea||E===fa?"esriFieldTypeDouble":"esriFieldTypeString"})});Z=0;var V=F.length;for(Z;Z<V;Z++){var aa=F[Z],Y=A.getAttributes(aa),I={};k.forEach(Y,
function(E){if(E&&(E===ea||E===fa||!K||-1<k.indexOf(K,E))){var N=E;0===E.length&&k.forEach(Q,function(W,ha){W.name==="attribute_"+(ha-1)&&(E="attribute_"+(ha-1))});if(-1<k.indexOf(ca,E)){N=A.getValue(aa,N);var R=new Date(N);I[E]=h(R,N)?R.getTime():null}else-1<k.indexOf(da,E)?(R=m.parse(A.getValue(aa,N)),E!==ea&&E!==fa||!(isNaN(R)||181<Math.abs(R))||(R=parseFloat(A.getValue(aa,N))),isNaN(R)?I[E]=null:I[E]=R):I[E]=A.getValue(aa,N)}});I[P]=J;J++;Y=I[ea];var O=I[fa];null==O||null==Y||isNaN(Y)||isNaN(O)||
(K&&-1===k.indexOf(K,ea)&&delete I[ea],K&&-1===k.indexOf(K,fa)&&delete I[fa],L.featureSet.features.push({geometry:{x:O,y:Y,spatialReference:{wkid:4326}},attributes:I}))}L.layerDefinition.name="csv";x&&x(L)}else setTimeout(function(){console.error("File does not seem to contain fields with point coordinates.")},1),x&&x(null,Error("File does not seem to contain fields with point coordinates."))},onError:function(F){console.error("Error fetching items from CSV store: ",F);x&&x(null,F)}});return!0}function t(C,
G,x,v,z,A){0===C.length&&z(null);var F=e.getGeometryType(G),J=[];k.forEach(C,function(L){L=new F(L);L.spatialReference=x;J.push(L)},this);G=[102113,102100,3857];x.wkid&&4326===x.wkid&&v.wkid&&-1<k.indexOf(G,v.wkid)?(k.forEach(J,function(L){L.xmin?(L.xmin=Math.max(L.xmin,-180),L.xmax=Math.min(L.xmax,180),L.ymin=Math.max(L.ymin,-89.99),L.ymax=Math.min(L.ymax,89.99)):L.rings?k.forEach(L.rings,function(P){k.forEach(P,function(Q){Q[0]=Math.min(Math.max(Q[0],-180),180);Q[1]=Math.min(Math.max(Q[1],-89.99),
89.99)},this)},this):L.paths?k.forEach(L.paths,function(P){k.forEach(P,function(Q){Q[0]=Math.min(Math.max(Q[0],-180),180);Q[1]=Math.min(Math.max(Q[1],-89.99),89.99)},this)},this):L.x&&(L.x=Math.min(Math.max(L.x,-180),180),L.y=Math.min(Math.max(L.y,-89.99),89.99))},this),C=[],k.forEach(J,function(L){L=g.geographicToWebMercator(L);102100!==v.wkid&&(L.spatialReference=v);C.push(L.toJson())},this),z(C)):null!==x.wkid&&-1<k.indexOf(G,x.wkid)&&null!==v.wkid&&4326===v.wkid?(C=[],k.forEach(J,function(L){C.push(g.webMercatorToGeographic(L).toJson())},
this),z(C)):(G=function(L,P){L&&L.length===C.length?(C=[],k.forEach(L,function(Q){Q&&(Q.rings&&0<Q.rings.length&&0<Q.rings[0].length&&0<Q.rings[0][0].length&&!isNaN(Q.rings[0][0][0])&&!isNaN(Q.rings[0][0][1])||Q.paths&&0<Q.paths.length&&0<Q.paths[0].length&&0<Q.paths[0][0].length&&!isNaN(Q.paths[0][0][0])&&!isNaN(Q.paths[0][0][1])||Q.xmin&&!isNaN(Q.xmin)&&Q.ymin&&!isNaN(Q.ymin)||Q.x&&!isNaN(Q.x)&&Q.y&&!isNaN(Q.y))?C.push(Q.toJson()):C.push(null)},this),z(C)):A(L,P)},a.defaults.geometryService?a.defaults.geometryService.project(J,
v,H.hitch(this,G),A):z(null))}function w(C,G){var x=[102113,102100,3857];return C&&G&&C.wkid===G.wkid&&C.wkt===G.wkt||C&&G&&C.wkid&&G.wkid&&-1<k.indexOf(x,C.wkid)&&-1<k.indexOf(x,G.wkid)?!0:!1}function u(C,G,x,v){if(C.featureSet&&0!==C.featureSet.features.length)if(w(x,G))v(C);else{var z=function(L){var P=[];k.forEach(C.featureSet.features,function(Q,Z){L[Z]&&(Q.geometry=L[Z],P.push(Q))},this);v(C)},A=function(L,P){console.error("error projecting featureSet ("+C.layerDefinition.name+"). Final try.");
v(C)},F=function(L,P){console.error("error projecting featureSet ("+C.layerDefinition.name+"). Try one more time.");t(J,C.featureSet.geometryType,G,x,H.hitch(this,z),H.hitch(this,A))};if(C.featureSet.features&&0<C.featureSet.features.length){var J=[];k.forEach(C.featureSet.features,function(L){if(L.geometry.toJson)J.push(L.geometry);else{var P=e.getGeometryType(C.featureSet.geometryType);J.push(new P(L.geometry))}});G.toJson||(G=new f(G));x.toJson||(x=new f(x));t(J,C.featureSet.geometryType,G,x,H.hitch(this,
z),H.hitch(this,F))}else v(C)}}var r="lat latitude y ycenter latitude83 latdecdeg point-y lat_dd".split(" "),y="lon lng long longitude x xcenter longitude83 longdecdeg point-x long_dd".split(" "),B={latFieldStrings:r,longFieldStrings:y,buildCSVFeatureCollection:function(C){var G=new n,x=function(z,A){A?G.errback(A):G.callback(z)},v={url:C.url,handleAs:"text",load:function(z){p(z,C,H.hitch(this,x))},error:function(z){G.errback(z);console.error("error: "+z)}};-1<C.url.indexOf("arcgis.com")&&-1<C.url.indexOf("/content/items")&&
-1<C.url.indexOf("/data")&&(v.headers={"Content-Type":""});c(v,{usePost:!1});return G},projectFeatureCollection:function(C,G,x){var v=new n;x||(x=new f({wkid:4326}));u(C,x,G,H.hitch(this,function(z){v.callback(z)}));return v},generateDefaultPopupInfo:function(C){var G={esriFieldTypeDouble:1,esriFieldTypeSingle:1},x={esriFieldTypeInteger:1,esriFieldTypeSmallInteger:1},v={esriFieldTypeDate:1},z=null;C=k.map(C.layerDefinition.fields,H.hitch(this,function(A){"NAME"===A.name.toUpperCase()&&(z=A.name);
var F="esriFieldTypeOID"!==A.type&&"esriFieldTypeGlobalID"!==A.type&&"esriFieldTypeGeometry"!==A.type,J=null;if(F){var L=A.name.toLowerCase();if(-1<",stretched value,fnode_,tnode_,lpoly_,rpoly_,poly_,subclass,subclass_,rings_ok,rings_nok,".indexOf(","+L+",")||-1<L.indexOf("area")||-1<L.indexOf("length")||-1<L.indexOf("shape")||-1<L.indexOf("perimeter")||-1<L.indexOf("objectid")||L.indexOf("_")===L.length-1||L.indexOf("_i")===L.length-2&&1<L.length)F=!1;A.type in x?J={places:0,digitSeparator:!0}:A.type in
G?J={places:2,digitSeparator:!0}:A.type in v&&(J={dateFormat:"shortDateShortTime"})}return H.mixin({},{fieldName:A.name,label:A.alias,isEditable:!0,tooltip:"",visible:F,format:J,stringFieldOption:"textbox"})}));return{title:z?"{"+z+"}":"",fieldInfos:C,description:null,showAttachments:!1,mediaInfos:[]}},_getSeparator:d,_isValidDate:h,_processCsvData:p,_projectGeometries:t,_sameSpatialReference:w,_projectFeatureSet:u};q("extend-esri")&&H.setObject("arcgis.csv",B,b);return B})},"dojox/data/CsvStore":function(){define("dojo/_base/lang dojo/_base/declare dojo/_base/xhr dojo/_base/kernel dojo/data/util/filter dojo/data/util/simpleFetch".split(" "),
function(H,k,n,q,m,l){k=k("dojox.data.CsvStore",null,{constructor:function(b){this._attributes=[];this._attributeIndexes={};this._dataArray=[];this._arrayOfAllItems=[];this._loadFinished=!1;b.url&&(this.url=b.url);this._csvData=b.data;b.label?this.label=b.label:""===this.label&&(this.label=void 0);this._storeProp="_csvStore";this._idProp="_csvId";this._features={"dojo.data.api.Read":!0,"dojo.data.api.Identity":!0};this._loadInProgress=!1;this._queuedFetches=[];this.identifier=b.identifier;""===this.identifier?
delete this.identifier:this._idMap={};"separator"in b&&(this.separator=b.separator);"urlPreventCache"in b&&(this.urlPreventCache=b.urlPreventCache?!0:!1)},url:"",label:"",identifier:"",separator:",",urlPreventCache:!1,_assertIsItem:function(b){if(!this.isItem(b))throw Error(this.declaredClass+": a function was passed an item argument that was not an item");},_getIndex:function(b){b=this.getIdentity(b);this.identifier&&(b=this._idMap[b]);return b},getValue:function(b,a,c){this._assertIsItem(b);var f=
c;if("string"===typeof a)a=this._attributeIndexes[a],null!=a&&(f=this._dataArray[this._getIndex(b)][a]||c);else throw Error(this.declaredClass+": a function was passed an attribute argument that was not a string");return f},getValues:function(b,a){return(b=this.getValue(b,a))?[b]:[]},getAttributes:function(b){this._assertIsItem(b);var a=[];b=this._dataArray[this._getIndex(b)];for(var c=0;c<b.length;c++)""!==b[c]&&a.push(this._attributes[c]);return a},hasAttribute:function(b,a){this._assertIsItem(b);
if("string"===typeof a)return a=this._attributeIndexes[a],b=this._dataArray[this._getIndex(b)],"undefined"!==typeof a&&a<b.length&&""!==b[a];throw Error(this.declaredClass+": a function was passed an attribute argument that was not a string");},containsValue:function(b,a,c){var f=void 0;"string"===typeof c&&(f=m.patternToRegExp(c,!1));return this._containsValue(b,a,c,f)},_containsValue:function(b,a,c,f){b=this.getValues(b,a);for(a=0;a<b.length;++a){var e=b[a];if("string"===typeof e&&f)return null!==
e.match(f);if(c===e)return!0}return!1},isItem:function(b){if(b&&b[this._storeProp]===this)if(b=b[this._idProp],this.identifier){if(this._dataArray[this._idMap[b]])return!0}else if(0<=b&&b<this._dataArray.length)return!0;return!1},isItemLoaded:function(b){return this.isItem(b)},loadItem:function(b){},getFeatures:function(){return this._features},getLabel:function(b){if(this.label&&this.isItem(b))return this.getValue(b,this.label)},getLabelAttributes:function(b){return this.label?[this.label]:null},
_fetchItems:function(b,a,c){var f=this,e=function(p,t){var w=null;if(p.query){var u;w=[];var r=p.queryOptions?p.queryOptions.ignoreCase:!1,y={};for(u in p.query){var B=p.query[u];"string"===typeof B&&(y[u]=m.patternToRegExp(B,r))}for(r=0;r<t.length;++r){var C=!0,G=t[r];for(u in p.query)B=p.query[u],f._containsValue(G,u,B,y[u])||(C=!1);C&&w.push(G)}}else w=t.slice(0,t.length);a(w,p)};if(this._loadFinished)e(b,this._arrayOfAllItems);else if(""!==this.url)if(this._loadInProgress)this._queuedFetches.push({args:b,
filter:e});else{this._loadInProgress=!0;var g=n.get({url:f.url,handleAs:"text",preventCache:f.urlPreventCache});g.addCallback(function(p){try{f._processData(p),e(b,f._arrayOfAllItems),f._handleQueuedFetches()}catch(t){c(t,b)}});g.addErrback(function(p){f._loadInProgress=!1;if(c)c(p,b);else throw p;});var d=null;b.abort&&(d=b.abort);b.abort=function(){var p=g;p&&-1===p.fired&&(p.cancel(),p=null);d&&d.call(b)}}else if(this._csvData)try{this._processData(this._csvData),this._csvData=null,e(b,this._arrayOfAllItems)}catch(p){c(p,
b)}else{var h=Error(this.declaredClass+": No CSV source data was provided as either URL or String data input.");if(c)c(h,b);else throw h;}},close:function(b){},_getArrayOfArraysFromCsvFileContents:function(b){if(H.isString(b)){var a=/^\s+/g,c=/\s+$/g,f=/""/g,e=[],g=this._splitLines(b);for(b=0;b<g.length;++b){var d=g[b];if(0<d.length){d=d.split(this.separator);for(var h=0;h<d.length;){var p=d[h].replace(a,""),t=p.replace(c,""),w=t.charAt(0),u=t.charAt(t.length-1),r=t.charAt(t.length-2),y=t.charAt(t.length-
3);if(2===t.length&&'""'==t)d[h]="";else if('"'==w&&('"'!=u||'"'==u&&'"'==r&&'"'!=y)){if(h+1===d.length)return;d[h]=p+this.separator+d[h+1];d.splice(h+1,1)}else'"'==w&&'"'==u&&(t=t.slice(1,t.length-1),t=t.replace(f,'"')),d[h]=t,h+=1}e.push(d)}}this._attributes=e.shift();for(b=0;b<this._attributes.length;b++)this._attributeIndexes[this._attributes[b]]=b;this._dataArray=e}},_splitLines:function(b){var a=[],c,f="",e=!1;for(c=0;c<b.length;c++){var g=b.charAt(c);switch(g){case '"':e=!e;f+=g;break;case "\r":e?
f+=g:(a.push(f),f="",c<b.length-1&&"\n"==b.charAt(c+1)&&c++);break;case "\n":e?f+=g:(a.push(f),f="");break;default:f+=g}}""!==f&&a.push(f);return a},_processData:function(b){this._getArrayOfArraysFromCsvFileContents(b);this._arrayOfAllItems=[];if(this.identifier&&void 0===this._attributeIndexes[this.identifier])throw Error(this.declaredClass+": Identity specified is not a column header in the data set.");for(b=0;b<this._dataArray.length;b++){var a=b;this.identifier&&(a=this._dataArray[b][this._attributeIndexes[this.identifier]],
this._idMap[a]=b);this._arrayOfAllItems.push(this._createItemFromIdentity(a))}this._loadFinished=!0;this._loadInProgress=!1},_createItemFromIdentity:function(b){var a={};a[this._storeProp]=this;a[this._idProp]=b;return a},getIdentity:function(b){return this.isItem(b)?b[this._idProp]:null},fetchItemByIdentity:function(b){var a=b.scope?b.scope:q.global;if(this._loadFinished){var c=this._createItemFromIdentity(b.identity);this.isItem(c)||(c=null);b.onItem&&b.onItem.call(a,c)}else{var f=this;if(""!==
this.url)this._loadInProgress?this._queuedFetches.push({args:b}):(this._loadInProgress=!0,c=n.get({url:f.url,handleAs:"text"}),c.addCallback(function(e){try{f._processData(e);var g=f._createItemFromIdentity(b.identity);f.isItem(g)||(g=null);b.onItem&&b.onItem.call(a,g);f._handleQueuedFetches()}catch(d){b.onError&&b.onError.call(a,d)}}),c.addErrback(function(e){this._loadInProgress=!1;b.onError&&b.onError.call(a,e)}));else if(this._csvData)try{f._processData(f._csvData),f._csvData=null,c=f._createItemFromIdentity(b.identity),
f.isItem(c)||(c=null),b.onItem&&b.onItem.call(a,c)}catch(e){b.onError&&b.onError.call(a,e)}}},getIdentityAttributes:function(b){return this.identifier?[this.identifier]:null},_handleQueuedFetches:function(){if(0<this._queuedFetches.length){for(var b=0;b<this._queuedFetches.length;b++){var a=this._queuedFetches[b],c=a.filter,f=a.args;c?c(f,this._arrayOfAllItems):this.fetchItemByIdentity(a.args)}this._queuedFetches=[]}}});H.extend(k,l);return k})},"esri/dijit/analysis/ProjectExtent":function(){define(["dojo/_base/array",
"esri/geometry/Extent","esri/geometry/webMercatorUtils","esri/geometry/Polygon","esri/tasks/GeometryService"],function(H,k,n,q,m){function l(b,a){if(b&&a.xmin>a.xmax){var c=b.valid[1]-a.xmin,f=a.xmax-b.valid[0];c>f?a.xmax=b.valid[1]+f:a.xmin=b.valid[0]-c}}return function(b,a,c,f,e,g){var d=[102113,102100,3857],h=b.spatialReference.wkid;if(h===a.wkid)return c([b],null);if(4326==h&&-1<H.indexOf(d,a.wkid))return b.ymin=Math.max(b.ymin,-89.99),b.ymax=Math.min(b.ymax,89.99),b=n.geographicToWebMercator(b),
e=b.spatialReference._getInfo(),l(e,b),b.spatialReference.wkid=a.wkid,c([b],null);if(-1<H.indexOf(d,h)&&4326==a.wkid)return b=n.webMercatorToGeographic(b),e=b.spatialReference._getInfo(),l(e,b),c([b],null);g||(g=new m(window.esriGeowConfig.self.helperServices.geometry.url));if(e&&e.wrapAround180&&"extent"===b.type){var p=b;b=q.fromExtent(b)}g.project([b],a,function(t,w){if(!(t&&0<t.length&&t[0]&&"extent"==t[0].type)||isNaN(t[0].xmin)||isNaN(t[0].ymin)||isNaN(t[0].xmax)||isNaN(t[0].ymax)){if(t&&0<
t.length&&t[0]&&"point"==t[0].type&&!isNaN(t[0].x)&&!isNaN(t[0].y))return c(t,w);if(p&&"polygon"===t[0].type){if(1===t[0].rings.length)t[0]=new k(t[0].getExtent());else{var u=(new q(t[0].spatialReference.toJson())).addRing(t[0].rings[0]).getExtent(),r=(new q(t[0].spatialReference.toJson())).addRing(t[0].rings[1]).getExtent();t[0]=r;t[0].xmin=r.xmin-u.getWidth();t[0].ymin=Math.min(r.ymin,u.ymin);t[0].ymax=Math.max(r.ymax,u.ymax)}return c(t,w)}if(f)return f()}else return c(t,w)},f)}})},"esri/dijit/analysis/mixins/browselayers/configs/AGOLBrowseItem":function(){define(["dojo/_base/lang",
"dojo/has","../../../../../kernel","./EnterpriseBrowseItem","../../../ItemTypes"],function(H,k,n,q,m){var l={getConfig:function(b){var a=q.getConfig(b);a.baseSections.push("all");a.baseSections.push("subscription");(-1<b.allowedItemTypes.indexOf(m.RFT)||-1<b.allowedItemTypes.indexOf(m.DLPK))&&a.baseSections.push("livingAtlas");return a}};k("extend-esri")&&H.setObject("dijit.analysis.mixins.browselayers.configs.AGOLBrowseItem",l,n);return l})},"esri/dijit/analysis/mixins/browselayers/configs/EnterpriseBrowseItem":function(){define("dojo/_base/lang dojo/has dojox/lang/functional/object ../../../../../kernel ./Common ../../../AnalysisRegistry ../../../ItemTypes dojo/i18n!../../../nls/BrowseLayerMixin".split(" "),
function(H,k,n,q,m,l,b,a){var c={getConfig:function(f){var e=f.disableLAAL?{customSections:[]}:{customSections:m.getLAALCustomSection(f)};!f.disableBoundary&&f.portal.EsriBoundaryLayersGroupQuery&&e.customSections.push(m.getBoundaryLayersSection(f));-1<f.allowedItemTypes.indexOf(b.RFT)&&f.showRFTSystemSection&&e.customSections.push(m.getSystemRFTSection(f));e=H.mixin({dialogTitle:f.title||a.customAnalysisLayerTitle,allowedItemTypes:f.allowedItemTypes,availableItemTypeFilters:f.availableItemTypeFilters,
baseSections:["myContent","myFavorites","myGroups","myOrganization"],resultsPerQuery:m.getNumberOfPages(),layoutMode:"fullscreen",staticFilters:m.getStaticFilters(f.customQueryTags),mainActionTitle:a.mainActionTitle,customActions:[m.getAddtoMapActions(f.onActionSubLayer)],showSubResources:this._getSubResourcesForPortal(f),disabledSubResources:f.disabledSubResources,addQueryParameters:f.addQueryParameters,enableMapAreaFilter:f.enableMapAreaFilter},e);f.showRFTEditCustomAction&&e.customActions.push(m.getEditRFTActions(f.onEditRFT));
return e},_getSubResourcesForPortal:function(f){var e={};-1<f.allowedItemTypes.indexOf(b.FS)&&(e[b.FS]={allowed:function(g){return this.allowedItemsForTypes(g,f.customQueryTags)}.bind(this),onSelect:f.onSelectSubLayer,customActions:[m.getAddtoMapActions(f.onActionSubLayer)],filters:this._getFilterforSubLayer(!1,f.customQueryTags)});-1<f.allowedItemTypes.indexOf(b.MS)&&(e[b.MS]={allowed:function(g){return this.allowedItemsForTypes(g,f.customQueryTags)}.bind(this),onSelect:f.onSelectSubLayer,customActions:[m.getAddtoMapActions(f.onActionSubLayer)],
filters:this._getFilterforSubLayer(!1,f.customQueryTags)});-1<f.allowedItemTypes.indexOf(b.BIGDATA)&&(e[b.BIGDATA]={allowed:function(g){return this.allowedItemsForTypes(g,f.customQueryTags)}.bind(this),onSelect:f.onSelectSubLayer,filters:this._getFilterforSubLayer(!0,f.customQueryTags)});-1<f.allowedItemTypes.indexOf(b.GPSERVICE)&&(e[b.GPSERVICE]={allowed:function(){return!0},onSelect:f.onSelectGPTool,filters:[]});return e},_getFilterforSubLayer:function(f,e){var g=[];g.push(this.getGeometryFilter(e.geometryTypes));
e.layerTypes&&(f?g.push(this.getFilterForLayerTypesForBigData(e.layerTypes)):g.push(this.getFilterForLayerTypesForFS(e.layerTypes)));e.timeTypes&&g.push(this.getTimeFilter(e.timeTypes));return g},getGeometryFilter:function(f){var e=[];(f&&0<f.length?f:n.values(l.GeometryTypes)).forEach(function(g){switch(g){case l.GeometryTypes.Point:e.push({displayName:a.pointFilterName,allowed:this.filters.geometryTypes[l.GeometryTypes.Point],value:"point"});break;case l.GeometryTypes.Polygon:e.push({displayName:a.polygonFilterName,
allowed:this.filters.geometryTypes[l.GeometryTypes.Polygon],value:"polygon"});break;case l.GeometryTypes.Line:e.push({displayName:a.lineFilterName,allowed:this.filters.geometryTypes[l.GeometryTypes.Line],value:"line"});break;case l.GeometryTypes.MultiPoint:e.push({displayName:a.multiPointFilterName,allowed:this.filters.geometryTypes[l.GeometryTypes.MultiPoint],value:"multipoint"})}},this);return{allowed:function(){return!0},displayName:a.geometryFilterName,value:"geometry",children:e}},getFilterForLayerTypesForFS:function(f){var e=
[];(f?0<f.length?f:[b.FLAYER,b.TABLE]:[]).forEach(function(g){switch(g){case b.FLAYER:e.push({displayName:a.featureLayerName,allowed:this.filters.layerTypes[b.FLAYER],value:"featurelayer"});break;case b.TABLE:e.push({displayName:a.tableLayerName,allowed:this.filters.layerTypes[b.TABLE],value:"ftable"})}},this);return{allowed:function(){return!0},displayName:a.itemTypeFilterName,value:"itemtype",children:e}},getFilterForLayerTypesForBigData:function(f){var e=[];(f?0<f.length?f:[b.BDATAFEATURE,b.BTABLE]:
[]).forEach(function(g){switch(g){case b.BDATAFEATURE:e.push({displayName:a.featureLayerName,allowed:this.filters.layerTypes[b.BDATAFEATURE],value:"bfeaturelayer"});break;case b.BTABLE:e.push({displayName:a.tableLayerName,allowed:this.filters.layerTypes[b.BTABLE],value:"btable"})}},this);return{allowed:function(){return!0},displayName:a.featureLayerName,value:"itemtype",children:e}},getTimeFilter:function(f){var e=[];(f?0<f.length?f:[l.TimeTypes.Instant,l.TimeTypes.Interval]:[]).forEach(function(g){switch(g){case l.TimeTypes.Instant:e.push({displayName:a.instantFilterName,
allowed:this.filters.timeTypes[l.TimeTypes.Instant].bind(this),value:"instant"});break;case l.TimeTypes.Interval:e.push({displayName:a.intervalFilterName,allowed:this.filters.timeTypes[l.TimeTypes.Interval].bind(this),value:"interval"})}},this);return{allowed:function(){return!0},displayName:a.timeFilterName,value:"time",children:e}},allowedItemsForTypes:function(f,e){var g=!0,d=e.layerTypes||[b.FLAYER,b.BDATAFEATURE];e.geometryTypes&&f.geometryType&&(e.geometryTypes=0<e.geometryTypes.length?e.geometryTypes:
n.values(l.GeometryTypes),g=g&&-1!==e.geometryTypes.indexOf(f.geometryType));d&&f.type&&(d=0<d.length?d:[b.FLAYER,b.BDATAFEATURE,b.BTABLE,b.TABLE],g=g&&-1!==d.indexOf(f.type));e.timeTypes&&(e.timeTypes=0<e.timeTypes.length?e.timeTypes:[l.TimeTypes.Instant,l.TimeTypes.Interval],g=g&&-1!==e.timeTypes.indexOf(this.getTimeType(f)));e.customCheck&&e.customCheck.customCheckHandler&&(g=g&&e.customCheck.customCheckHandler(f));return g&&f},getTimeType:function(f){return f?this.isDefined(f.timeInfo)&&this.isDefined(f.timeInfo.startTimeField)&&
!this.isDefined(f.timeInfo.endTimeField)?l.TimeTypes.Instant:this.isDefined(f.timeInfo)&&this.isDefined(f.timeInfo.startTimeField)&&this.isDefined(f.timeInfo.endTimeField)?l.TimeTypes.Interval:this.isDefined(f.time)&&this.isDefined(f.time.timeType)?f.time.timeType:!1:!1},isDefined:function(f){return void 0!==f&&null!==f},filters:{layerTypes:{"Feature Layer":function(f){return f.type===b.FLAYER},Table:function(f){return f.type===b.TABLE},featureClass:function(f){return f.type===b.BDATAFEATURE},table:function(f){return f.type===
b.BTABLE}},geometryTypes:{esriGeometryMultipoint:function(f){return f.geometryType===l.GeometryTypes.MultiPoint},esriGeometryPolyline:function(f){return f.geometryType===l.GeometryTypes.Line},esriGeometryPolygon:function(f){return f.geometryType===l.GeometryTypes.Polygon},esriGeometryPoint:function(f){return f.geometryType===l.GeometryTypes.Point}},timeTypes:{instant:function(f){return this.getTimeType(f)===l.TimeTypes.Instant},interval:function(f){return this.getTimeType(f)===l.TimeTypes.Interval}}}};
k("extend-esri")&&H.setObject("dijit.analysis.mixins.browselayers.configs.EnterpriseBrowseItem",c,q);return c})},"esri/dijit/analysis/mixins/browselayers/configs/Common":function(){define(["dojo/_base/lang","dojo/has","../../../../../kernel","dojo/i18n!../../../nls/BrowseLayerMixin","../../../ItemTypes"],function(H,k,n,q,m){var l={getLAALCustomSection:function(b){var a=this._isCustomAnalysisQuery(b.portal,b.isPortal),c=[{name:q.customeSectionName,baseQuery:this._getLAALBaseQuery(b.customQueryTags,
b.portal,b.isPortal),filters:[{fetchGroupIdByQuery:this._getDefaultQueryString(b.isPortal),name:q.Categories,type:"group",path:["categories"],staticSchema:this._getStaticLAALSchema(b.portal,b.isPortal)}].concat(this._getFilters(b.isPortal)),disableSubResources:!0}];a&&c.push({name:q.customAnalysisGroupName,baseQuery:"",filters:[{id:this._getAnalysisGroupQuery(b.portal,b.isPortal).split(":")[1],name:q.Categories,type:"group",path:["categories"],staticSchema:void 0}].concat(this._getFilters(b.isPortal)),
disableSubResources:!1});return c},getAddtoMapActions:function(b){return{allowed:function(a){return a.type!==m.RFT&&a.type!==m.XLS&&a.type!==m.CSV&&a.type!==m.DLPK},asynchronous:!1,onAction:b,name:q.customActionName}},getEditRFTActions:function(b){return{allowed:function(a){return a.type===m.RFT&&!a.rfxTemplateData},asynchronous:!1,onAction:b,name:q.edit}},getSystemRFTSection:function(b){var a='(group:"'+(b.rftGroupId&&b.rftGroupId.id)+'") -type:"Attachment" -tags:"mature support"';b.isPortal||(a+=
' -typekeywords:"categoryname#distance (legacy)system_rft"');return{name:"System",baseQuery:a,filters:[].concat(this._getFilters(b.isPortal)),addToFront:!1,sortField:"title"}},getStaticFilters:function(b){if((b=b.tags)&&0!==b.length){var a=[];b.forEach(function(c){a.push(q[c]?q[c]:c)});return a}},getBoundaryLayersSection:function(b){return{name:q.boundaryLayers,baseQuery:"("+b.portal.EsriBoundaryLayersGroupQuery.split("AND")[1].trim()+')-type:"Attachment" -tags:"mature support"',filters:this._getFilters(b.isPortal),
addToFront:!1,disableSubResources:!1}},getNumberOfPages:function(){return 16},_getLAALBaseQuery:function(b,a,c){c=['typekeywords:"Analysis Ready"'];(a||a.user||!a.user.demographics)&&c.push('-typekeywords:"Requires Credits"');c.push('-type:"Attachment" -tags:"mature support"');c.push(this._queryTagsForLivingAtlasItemBrowser(b));return c.join(" ")},_queryTagsForLivingAtlasItemBrowser:function(b){b=b.tags;var a=[];if(!b||0===b.length)return"";if(1===b.length)return"tags: ("+b[0]+")";b.forEach(function(c){a.push(c)});
return"tags: ("+a.join(" OR ")+")"},_getAnalysisGroupQuery:function(b,a){return this._isCustomAnalysisQuery(b,a)},_getDefaultQueryString:function(b){var a='title:"Living Atlas Analysis Layers" AND owner:esri';b&&(a='title:"Living Atlas Analysis Layers" AND owner:esri_livingatlas');return a},_isCustomAnalysisQuery:function(b,a){return b&&b.analysisLayersGroupQuery&&b.analysisLayersGroupQuery!==this._getDefaultQueryString(a)?b.analysisLayersGroupQuery:!1},_getStaticLAALSchema:function(b,a){return[{title:"categories",
categories:[{title:"boundaries and places",categories:[{title:"boundaries",categories:[],displayName:q.boundaries},{title:"places",categories:[],displayName:q.places}],displayName:q.boundariesAndPlaces},{title:"hexbins",categories:[],displayName:q.hexbins},{title:"transportation",categories:[],displayName:q.transportation}]}]},_getFilters:function(b){return["tags"]}};k("extend-esri")&&H.setObject("dijit.analysis.mixins.browselayers.configs.Common",l,n);return l})},"esri/dijit/analysis/mixins/FilterAndSelection":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/json dojo/has dojo/dom-construct dojo/dom-class ../../../kernel dojo/aspect ../components/FilterAndSelection/FilterAndSelection".split(" "),
function(H,k,n,q,m,l,b,a,c,f){H=H([],{showFilterAndSelection:!1,filterAndSelections:[],aspectsForFilters:[],_updateJobFilterAndSelection:function(e){this.showFilterAndSelection&&this.filterObjects&&this.filterObjects.forEach(function(g){var d=e[g.layer]||e[g.jobParamLayer],h=this.filterAndSelections[g.layer];if((d="string"===typeof d?q.fromJson(d):d)&&h){var p=h.get("inputQuery");p&&(d.filter=d.filter?d.filter+" AND "+p:p,e[g.layer]=q.toJson(d),e[g.jobParamLayer]&&(e[g.jobParamLayer]=q.toJson(d)),
h.get("expression")&&(e[g.expressionObj]=q.toJson(h.get("expression"))))}}.bind(this));return e},clearFilterAndSelection:function(){n.forEach(this.aspectsForFilters,function(e){e.remove()});n.forEach(Object.keys(this.filterAndSelections),function(e){this.filterAndSelections[e].clear()},this)},_createFilterAndSelections:function(){this.filterAndSelections={};this.showFilterAndSelection&&n.forEach(this.filterObjects,function(e){this.filterAndSelections[e.layer]=this._createFilterAndSelection(e)},this)},
_createFilterAndSelection:function(e){b.add(e.select.domNode,"with-filter");var g=e.layerForTool||e.layer,d={map:this.map,layer:this[e.layer]||this[e.layerForTool]||e.layers&&e.layers[e.select.get("value")],expression:this[e.expressionObj]};d=this.constructDomForFilter(d,e.select);this.aspectsForFilters.push(c.after(e.select,"onChange",function(h){0<=parseInt(h)&&(h=e.layers&&e.layers[h]||this[g],this.filterAndSelections[e.layer]&&this.filterAndSelections[e.layer].set("layer",h))}.bind(this),!0));
this.aspectsForFilters.push(c.after(this,"_onClose",this.clearFilterAndSelection.bind(this)));return d},constructDomForFilter:function(e,g){g=g.domNode.parentNode;var d=l.create("div",null,g);e.msgContainer=l.create("div",{class:"esriLeadingMargin1 paddingTop1"},g);return new f(e,d)}});m("extend-esri")&&k.setObject("dijit.analysis.mixins.FilterAndSelection.FilterAndSelection",H,a);return H})},"esri/dijit/analysis/components/FilterAndSelection/FilterAndSelection":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/Color dojo/_base/connect dojo/has dojo/string dojo/dom-attr dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dijit/form/Button dijit/form/ToggleButton dijit/Dialog ../../../../kernel ../../../../lang ../../../../layers/FeatureLayer ../../ExpressionForm ../../../../geometry/Extent ../../../../geometry/ScreenPoint ../../../../symbols/CartographicLineSymbol ../../../../symbols/SimpleMarkerSymbol ../../../../symbols/SimpleLineSymbol ../../../../symbols/SimpleFillSymbol ../../../../tasks/query ../../ItemTypes ../../AnalysisRegistry dojo/i18n!../../../../nls/jsapi dojo/text!./FilterAndSelection.html".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G,x,v,z,A,F,J){H=H([c,f,e],{declaredClass:"esri.dijit.analysis.components.FilterAndSelection.FilterAndSelection",templateString:J,_pbConnects:[],i18n:{},map:{},layer:{},msgContainer:null,expression:{},inputQuery:"",postMixInProperties:function(){this.inherited(arguments);k.mixin(this.i18n,F.expressionGrid);k.mixin(this.i18n,F.common)},destroy:function(){this.inherited(arguments);n.forEach(this._pbConnects,m.disconnect);delete this._pbConnects},
postCreate:function(){this.inherited(arguments);this.own(this._expressionForm.on("add-expression",k.hitch(this,this._handleExpressionFormAdd)));this.own(this._expressionForm.on("cancel-expression",k.hitch(this,this._handleExpressionFormCancel)))},startup:function(){},_handleSelectionButtonClick:function(L){L&&!this._mapClickHandle?(this._mapClickHandle=this.map.on("click",k.hitch(this,this._handleMapClick)),this.emit("selecttool-activate",{}),this.set("expression",void 0)):(this._mapClickHandle&&
(this._mapClickHandle.remove(),this._mapClickHandle=null),this.emit("selecttool-deactivate",{}))},_setInputQueryForRerun:function(){var L=this.layer&&(this.layer.type===z.BDATAFEATURE||this.layer.type===z.BTABLE);this.layer&&this.layer.filter&&-1!==this.layer.filter.indexOf(" AND ")?(this.set("inputQuery",this.layer.filter.substring(this.layer.filter.indexOf(" AND ")+5)),L||this.layer.setDefinitionExpression(this.layer.filter.substring(0,this.layer.filter.indexOf(" AND ")))):this.layer&&this.layer.filter&&
-1===this.layer.filter.indexOf(" AND ")&&(this.set("inputQuery",this.layer.filter),L||this.layer.setDefinitionExpression(null));this.inputQuery===(this.expression&&this.expression.expression.where)?a.set(this.msgContainer,"innerHTML",this.expression.expression._attributeText):0===this._getObjectIds().length&&a.set(this.msgContainer,"innerHTML","")},_handleQueryButtonClick:function(){this._expDialog.set("title",this.i18n.queryLabel);this._selectBtn.set("checked",!1);this._isAttrFlag=!0;this._expressionForm.set("showUnique",
!(this.layer&&(this.layer.type===z.BDATAFEATURE||this.layer.type===z.TABLE||this.layer.type===z.BTABLE)));this.expression?(this._expressionForm.set("action","edit"),this._expressionForm.set("expression",this.expression.expression)):this._expressionForm.set("action","add");this._expDialog.show()},_handleExpressionFormAdd:function(L){this.selectionLayer&&this.selectionLayer.clearSelection();if("add"===L.action||"edit"===L.action)this.set("expression",L),this.set("inputQuery",L.expression&&L.expression.where||
""),L=this._getQuery(),this.selectionLayer&&this.selectionLayer.selectFeatures(L,w.SELECTION_ADD);this._expDialog.hide()},_handleExpressionFormCancel:function(){this._expDialog.hide()},clear:function(){this.selectionLayer&&(this.selectionLayer.clearSelection(),this.map.removeLayer(this.selectionLayer),this.selectionLayer=null,this.set("inputQuery",""));this._mapClickHandle&&(this._mapClickHandle.remove(),delete this._mapClickHandle)},_handleMapClick:function(L){var P;!this._isAttrFlag&&this.expression&&
this.selectionLayer.clearSelection();var Q=6;if((P=this.layer.renderer)&&"esri.renderer.SimpleRenderer"===P.declaredClass){var Z=P.symbol;Z.xoffset&&(Q=Math.max(Q,Math.abs(Z.xoffset)));Z.yoffset&&(Q=Math.max(Q,Math.abs(Z.yoffset)))}else!P||"esri.renderer.UniqueValueRenderer"!==P.declaredClass&&"esri.renderer.ClassBreaksRenderer"!==P.declaredClass||n.forEach(P.infos,function(ca){Z=ca.symbol;Z.xoffset&&(Q=Math.max(Q,Math.abs(Z.xoffset)));Z.yoffset&&(Q=Math.max(Q,Math.abs(Z.yoffset)))});P=L.screenPoint;
L=this.map.toMap(new y(P.x-Q,P.y+Q));P=this.map.toMap(new y(P.x+Q,P.y-Q));L=new r(L.x,L.y,P.x,P.y,this.map.spatialReference);L=this._getQuery({extent:L});this.layer.getDefinitionExpression&&(L.where=this.layer.getDefinitionExpression());this.layer.queryFeatures(L).then(k.hitch(this,function(ca){if(ca){var da=[],ea=[],fa=[];this.selectionLayer&&0<this.selectionLayer.getSelectedFeatures().length&&(ea=n.map(this.selectionLayer.getSelectedFeatures(),function(K){return K.attributes[this.selectionLayer.objectIdField]},
this));n.forEach(ca.features,function(K){0===ea.length?da.push(K.attributes[this.selectionLayer.objectIdField]):-1===n.indexOf(ea,K.attributes[this.selectionLayer.objectIdField])?da.push(K.attributes[this.selectionLayer.objectIdField]):fa.push(K.attributes[this.selectionLayer.objectIdField])},this);0<da.length&&(ca=this._getQuery({oids:da}),this.selectionLayer.selectFeatures(ca,w.SELECTION_ADD));0<fa.length&&(ca=this._getQuery({oids:fa}),this.selectionLayer.selectFeatures(ca,w.SELECTION_SUBTRACT))}}))},
_handleLayerSelectionComplete:function(){var L=this.selectionLayer.getSelectedFeatures();if(!this._isAttrFlag&&0<L.length){var P="";n.forEach(L,function(Q){P+=this.selectionLayer.objectIdField+" \x3d "+Q.attributes[this.selectionLayer.objectIdField]+" OR ";return Q.attributes[this.selectionLayer.objectIdField]},this);P=P.substring(0,P.lastIndexOf(" OR "));this.set("inputQuery",P);a.set(this.msgContainer,"innerHTML",b.substitute(this.i18n.selectedFeaturesLabel,{total:L.length}))}this._isAttrFlag||
0!==L.length||(a.set(this.msgContainer,"innerHTML",""),this.set("inputQuery",""))},_onSelectionLayerLoad:function(L,P){P.setScaleRange(L.minScale,L.maxScale);this._connect(L,"onScaleRangeChange",k.hitch(this,function(Q,Z){Q.setScaleRange(Z.minScale,Z.maxScale)},P,L));this.map.addLayer(P);P.geometryType===A.GeometryTypes.Point||"esriGeometryMultPoint"===P.geometryType?(L=new C,L.setStyle(C.STYLE_TARGET),L._setDim(16,16,0),L.setOutline(new B(G.STYLE_SOLID,new q([0,255,255]),2,B.CAP_ROUND,B.JOIN_ROUND)),
L.setColor(new q([0,0,0,0])),P.setSelectionSymbol(L)):P.geometryType===A.GeometryTypes.Line?P.setSelectionSymbol(new G(G.STYLE_SOLID,new q([0,255,255]),2)):P.geometryType===A.GeometryTypes.Polygon&&P.setSelectionSymbol(new x(x.STYLE_NULL,new G(G.STYLE_SOLID,new q([0,255,255]),2),new q([0,0,0,0])));this.selectionLayer&&this.inputQuery&&(this.inputQuery.match(/ OR /g)||!this.expression?this._isAttrFlag=!1:(this._isAttrFlag=!0,this.set("expression",{action:"edit",expression:this.expression.expression})),
P=this._getQuery(),this.selectionLayer.selectFeatures(P,w.SELECTION_ADD))},_isLayerPresentInMap:function(L){var P=!1;this.map.getLayersVisibleAtScale().forEach(function(Q){P=P||Q.url===L.url});return P},_getObjectIds:function(){var L=this.get("inputQuery");L=L?L.split(" OR "):[];L=n.map(L,function(P){return P.split(" \x3d ")[1]});a.set(this.msgContainer,"innerHTML",b.substitute(this.i18n.selectedFeaturesLabel,{total:L.length}));return L},_getQuery:function(L){var P=new v;P.returnGeometry=!0;if(!L)return this._isAttrFlag?
P.where=this.get("inputQuery"):P.objectIds=this._getObjectIds(),P;L.extent&&(P.geometry=L.extent);L.oids&&(P.objectIds=L.oids);return P},_setMapAttr:function(L){this.map=L},_getMapAttr:function(){return this.map},_getInputQueryAttr:function(){return this.inputQuery},_setInputQueryAttr:function(L){this.inputQuery=L},_getLayerAttr:function(){return this.selectionLayer},_setLayerAttr:function(L){if(L&&L.url){var P=this.layer&&(this.layer.type===z.BDATAFEATURE||this.layer.type===z.BTABLE||this.layer.type===
z.TABLE);this.layer=L;this.set("inputQuery","");this.selectionLayer&&this.clear();this._selectBtn.set("checked",!1);this._expressionForm.set("showUnique",!P);this._expressionForm.set("showFirstRow",!1);this._expressionForm.set("firstOperands",[L]);this._expressionForm.set("inputOperands",[L]);this._expressionForm.set("selectedFirstOperand",L);this._expressionForm.init();this._queryBtn.set("disabled",!1);this._setInputQueryForRerun();if(this._isLayerPresentInMap(L))if(this._selectBtn.set("disabled",
!1),this.selectionLayer=new w(L.url&&!L._collection?L.url:this.layer.toJson(),{outFields:["*"],mode:L.url&&!L._collection?w.MODE_SELECTION:w.MODE_SNAPSHOT}),this.selectionLayer.setRenderer(null),this.selectionLayer.on("selection-complete",k.hitch(this,this._handleLayerSelectionComplete)),this.selectionLayer.loaded)this._onSelectionLayerLoad(L,this.selectionLayer);else this.selectionLayer.on("load",k.hitch(this,this._onSelectionLayerLoad,L,this.selectionLayer));else this._selectBtn.set("disabled",
!0)}else this._selectBtn.set("disabled",!0),this._queryBtn.set("disabled",!0)},_setExpressionAttr:function(L){L?(this._isAttrFlag=!0,this.expression=L,this.expression.expression&&(a.set(this.msgContainer,"innerHTML",this.expression.expression._attributeText),this.set("inputQuery",this.expression.expression.where))):(this._isAttrFlag=!1,this.expression=void 0)},_getExpressionAttr:function(){return this.expression},_connect:function(L,P,Q){this._pbConnects.push(m.connect(L,P,Q))}});l("extend-esri")&&
k.setObject("dijit.analysis.components.FilterAndSelection.FilterAndSelection",H,p);return H})},"esri/dijit/analysis/ExpressionForm":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/json dojo/_base/fx dojo/has dojo/json dojo/string dojo/dom-style dojo/dom-attr dojo/dom-construct dojo/query dojo/dom-class dojo/_base/event dojo/Evented dojo/fx/easing dojo/number dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dijit/_OnDijitClickMixin dijit/_FocusMixin dijit/registry dijit/form/Button dijit/form/CheckBox dijit/form/Form dijit/form/Select dijit/form/TextBox dijit/form/ValidationTextBox dijit/layout/ContentPane dijit/form/FilteringSelect dijit/Dialog dijit/Tooltip ../../kernel ../../lang ./utils ../SingleFilter dojo/i18n!../../nls/jsapi dojo/text!./templates/ExpressionForm.html".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G,x,v,z,A,F,J,L,P,Q,Z,ca,da,ea,fa,K,V,aa,Y){H=k([y,B,C,G,x,w],{declaredClass:"esri.dijit.analysis.ExpressionForm",templateString:Y,widgetsInTemplate:!0,firstOperands:null,defaultUnits:"english",showFirstRow:!0,showUnique:!0,operator:null,isServerAdvanceLicensed:!0,allLayersOpertors:["intersects","notIntersects","withinDistance","notWithinDistance","nearest"],constructor:function(I){I.containerNode&&(this.container=I.containerNode);this._setClasses(I)},
_setClasses:function(I){this._addBtnClass=I.primaryActionButttonClass||"esriAnalysisSubmitButton"},destroy:function(){this.inherited(arguments);q.forEach(this._pbConnects,m.disconnect);delete this._pbConnects},postMixInProperties:function(){this.inherited(arguments);this.i18n={};n.mixin(this.i18n,aa.common);n.mixin(this.i18n,aa.expressionGrid);n.mixin(this.i18n,aa.expressionForm)},postCreate:function(){this.inherited(arguments);this.attributeChangeHandler=m.subscribe("filter-expression-change",n.hitch(this,
this._handleAttributeFilterChange));this._distanceInput.set("validator",n.hitch(this,this._validateDistance));this.set("action","add");e.set(this._firstRow,"display",this.showFirstRow?"":"none");this.isServerAdvanceLicensed||this._operatorSelect.removeOption("nearest");this.own(this.watch("showUnique",n.hitch(this,function(I,O,E){this._attributeFilter&&this._attributeFilter.set("showUnique",E)})))},init:function(){this.isServerAdvanceLicensed||this._operatorSelect.removeOption("nearest");this.showReadyToUseLayers&&
this.owningWidget&&!this._browseTitle&&(this._browseTitle=K._isCustomAnalysisQuery(this.owningWidget)?this.i18n.browseAnalysisLayers:this.i18n.browseAnalysisTitle);if(this._firstOperandSelect&&this.firstOperands&&this.inputOperands){this._firstOperandSelect.getOptions()&&this._firstOperandSelect.removeOption(this._firstOperandSelect.getOptions());var I,O,E=this.inputOperands.length,N=this.firstOperands.length,R=[];for(I=0;I<E;I+=1)for(O=0;O<N;O+=1)fa.isDefined(this.inputOperands[I].id)&&fa.isDefined(this.firstOperands[O].id)&&
this.inputOperands[I].id===this.firstOperands[O].id?R[this.firstOperands[O].id]=I.toString():fa.isDefined(this.inputOperands[I].name)&&fa.isDefined(this.firstOperands[O].name)&&this.inputOperands[I].name===this.firstOperands[O].name&&(R[this.firstOperands[O].name]=I.toString());q.forEach(this.firstOperands,function(W,ha){fa.isDefined(W)&&this._firstOperandSelect.addOption({value:R[W.id||W.name],label:W.name})},this);this.selectedFirstOperand&&(fa.isDefined(this.selectedFirstOperand.id)||(this.selectedFirstOperand.id=
this.selectedFirstOperand.name),this._firstOperandSelect.set("value",R[this.selectedFirstOperand.id]));(this.get("showReadyToUseLayers")||this.get("showReadyLayersForFirst"))&&this._firstOperandSelect.addOption({type:"separator",value:""});this.get("showReadyToUseLayers")&&this.get("showReadyLayersForFirst")&&this._firstOperandSelect.addOption({value:"browse",label:this._browseTitle});this.get("showBrowseLayers")&&this.get("showReadyLayersForFirst")&&this._firstOperandSelect.addOption({value:"browselayers",
label:this.i18n.browseLayers});1===E&&!this.get("showReadyToUseLayers")&&!this.get("showBrowseLayers")&&this._operatorSelect&&this._operatorSelect.getOptions()&&(this._operatorSelect.removeOption(this._operatorSelect.getOptions()),this._operatorSelect.addOption({value:"where",label:this.i18n.where}))}"add"===this.get("action")&&(this._operatorSelect.set("value","where"),this._handleOperatorChange("where"),this._distanceInput.set("value",""),"metric"===this.defaultUnits?this._distanceUnitsSelect.set("value",
"Kilometers"):this._distanceUnitsSelect.set("value","Miles"))},startup:function(){},clear:function(){this.init()},_validateDistance:function(I){var O=this._operatorSelect.get("value");return-1===q.indexOf(["withinDistance","notWithinDistance"],O)?!0:(I=r.parse(I))&&0<parseFloat(I,10)&&Infinity>parseFloat(I,10)},_handleAttributeFilterChange:function(){if(this._attributeFilter){var I=this._attributeFilter.toJson();I=this._attributeFilter.builtSingleFilterString(I);I.whereClause?this._addBtn.set("disabled",
!1):this._addBtn.set("disabled",!0)}},_handleSecondOperandChange:function(I){if("browse"===I||"browselayers"===I)this.owningWidget.layersSelect=this._secondOperandSelect,this.owningWidget.showReadyToUseLayersDialog(!1,I)},_handleFirstOperandChange:function(I){"browse"!==I&&"browselayers"!==I||!this.get("showReadyLayersForFirst")?this._handleOperatorChange("where"):(this.owningWidget.layersSelect=this._firstOperandSelect,this.owningWidget.showReadyToUseLayersDialog(!0,I))},_handleDistanceInputChange:function(I){this._addBtn.set("disabled",
!this._distanceInput.validate())},_handleOperatorChange:function(I){var O=this.get("operator");this.set("operator",I);-1===q.indexOf(["where","withinDistance","notWithinDistance"],I)?!0!==this._checkBetweenPairs(I,O)&&this._buildSpatialExpression(I,O):"where"===I?this._buildAttributeExpression(I):-1!==q.indexOf(["withinDistance","notWithinDistance"],I)&&this._buildDistanceExpression(I,O)},_checkBetweenPairs:function(I,O){return q.some([["contains","notContains"],["within","notWithin"]],function(E){if(I===
E[0]&&O===E[1]||I===E[1]&&O===E[0])return!0})},_isValidSecondOperand:function(I,O,E){var N=!1;"contains"===I||"notContains"===I?"esriGeometryPoint"!==O&&"esriGeometryMultipoint"!==O||"esriGeometryPoint"!==E&&"esriGeometryMultipoint"!==E?"esriGeometryPolyline"!==O||"esriGeometryPoint"!==E&&"esriGeometryPolyline"!==E&&"esriGeometryMultipoint"!==E?"esriGeometryPolygon"===O&&(N=!0):N=!0:N=!0:"within"===I||"notWithin"===I?"esriGeometryPoint"===O||"esriGeometryMultipoint"===O?N=!0:"esriGeometryPolyline"!==
O||"esriGeometryPolygon"!==E&&"esriGeometryPolyline"!==E?"esriGeometryPolygon"===O&&"esriGeometryPolygon"===E&&(N=!0):N=!0:N=!0;return N},_isValidFirstOperand:function(I){var O=!0;I&&I.fields?I.fields&&1===I.fields.length&&"esriFieldTypeOID"===I.fields[0].type&&(this._showMessages(f.substitute(this.i18n.inValidAttributeFilterMessage,{layername:I.name})),O=!1):O=!1;return O},_addBrowseAndBrowseLayerOptions:function(I){if(!I)return!1;(this.get("showReadyToUseLayers")||this.get("showBrowseLayers"))&&
I.addOption({type:"separator",value:""});this.get("showReadyToUseLayers")&&I.addOption({value:"browse",label:this._browseTitle});this.get("showBrowseLayers")&&I.addOption({value:"browselayers",label:this.i18n.browseLayers});return!0},_buildSpatialExpression:function(I,O){var E=parseInt(this._firstOperandSelect.get("value"),10);var N=this.inputOperands[E].geometryType;this._addBtn.set("disabled",!1);this._distanceInput.set("required",!1);e.set(this._attrFilterDiv,"display","none");e.set(this._secondOperandSelect.domNode,
"display","");this._secondOperandSelect&&(-1===this.allLayersOpertors.indexOf(O)&&(this._secondOperandSelect.getOptions()&&this._secondOperandSelect.removeOption(this._secondOperandSelect.getOptions()),q.forEach(this.inputOperands,function(R,W){W.toString()!==this._firstOperandSelect.get("value")&&this._isValidSecondOperand(I,N,R.geometryType)&&(this._secondOperandSelect.addOption({value:W.toString(),label:R.name}),""!==this._secondOperandSelect.get("value")&&this._secondOperandSelect.get("value")||
this._secondOperandSelect.set("value",W.toString()))},this),this._addBrowseAndBrowseLayerOptions(this._secondOperandSelect)),e.set(this._secondRow,"display",""),e.set(this._secondExpressionDiv,"display","none"),e.set(this._secondOperandSelect,{display:"",width:"75%"}))},_buildAttributeExpression:function(I){this._distanceInput.set("required",!1);e.set(this._secondExpressionDiv,"display","none");this._secondOperandSelect&&this._secondOperandSelect.getOptions()&&this._secondOperandSelect.removeOption(this._secondOperandSelect.getOptions());
e.set(this._secondOperandSelect.domNode,"display","none");I=parseInt(this._firstOperandSelect.get("value"),10);I=this.inputOperands[I];this._isValidFirstOperand(I)?(this._addBtn.set("disabled",!0),e.set(this._secondRow,"display",""),e.set(this._attrFilterDiv,"display",""),this._attributeFilter&&(this._attributeFilter.init({mapLayer:I,version:I.version,fields:I.fields,allowAllDateTypes:!0,part:"edit"===this.get("action")&&this.expression&&this.expression._attributeExprObj?this.expression._attributeExprObj:
null}),this._attributeFilter.set("showUnique",this.showUnique)),this._attributeFilter||(this._attributeFilter=new V({"class":"filterSegment",mapLayer:I,version:I.version,fields:I.fields,part:"edit"===this.get("action")&&this.expression&&this.expression._attributeExprObj?this.expression._attributeExprObj:null,enableEvents:!0,isEnableInteractiveFilter:!1,allowAllDateTypes:!0,showUnique:this.showUnique},d.create("div",{},this._attrFilterDiv)),this._attributeFilter.fillFieldsList(this._attributeFilter.fieldsStore))):
(e.set(this._secondRow,"display","none"),e.set(this._attrFilterDiv,"display","none"),this._addBtn.set("disabled",!0))},_buildDistanceExpression:function(I,O){this._addBtn.set("disabled",!this._distanceInput.validate());this._distanceInput.set("required",!0);e.set(this._secondRow,"display","");e.set(this._secondOperandSelect.domNode,"display","");e.set(this._secondExpressionDiv,{display:"",width:"75%"});e.set(this._secondOperandSelect,{display:"",width:"75%"});e.set(this._attrFilterDiv,"display","none");
this._secondOperandSelect&&this._secondOperandSelect.getOptions()&&-1===this.allLayersOpertors.indexOf(O)&&(this._secondOperandSelect.removeOption(this._secondOperandSelect.getOptions()),q.forEach(this.inputOperands,function(E,N){N.toString()!==this._firstOperandSelect.get("value")&&this._secondOperandSelect.addOption({value:N.toString(),label:E.name})},this),this._addBrowseAndBrowseLayerOptions(this._secondOperandSelect))},_handleAddButtonClick:function(I){t.stop(I);this._expressionForm&&!this._expressionForm.validate()?
this.emit("cancel-expression",{}):(this.set("expression"),this.emit("add-expression",{expression:this.get("expression"),text:this.get("text"),displayText:this.get("displayText"),action:this.get("action")}))},_handleCloseButtonClick:function(I){t.stop(I);this.emit("cancel-expression",{})},_setInputOperandsAttr:function(I){this.inputOperands=I},_getInputOperandsAttr:function(){return this.inputOperands},_setFirstOperandsAttr:function(I){this.firstOperands=I},_getFirstOperandsAttr:function(I){return this.firstOperands},
_setSelectedFirstOperandAttr:function(I){this.selectedFirstOperand=I},_getExpressionAttr:function(I){return this.expression},_setExpressionAttr:function(I){var O=!1;if(I)this._operatorSelect&&(this._firstOperandSelect.set("value",I.layer),this._operatorSelect.set("value",I.spatialRel?I.spatialRel:"where"),"where"===this._operatorSelect.get("value")?O=!0:(-1!==q.indexOf(["withinDistance","notWithinDistance"],this._operatorSelect.get("value"))&&(this._distanceInput.set("value",I.distance),this._distanceUnitsSelect.set("value",
I.units)),setTimeout(n.hitch(this,function(){this._secondOperandSelect.set("value",I.selectingLayer)}),100)));else if(I={},this._operatorSelect)if(I.layer=parseInt(this._firstOperandSelect.get("value"),10),"where"===this._operatorSelect.get("value")){var E=this._attributeFilter.toJson();var N=this._attributeFilter.builtSingleFilterString(E);I._attributeFilter=N;I._attributeExprObj=E;I._attributeText=this._attributeFilter.buildFriendlyTextExpr(E);I.where=N.whereClause}else I.selectingLayer=parseInt(this._secondOperandSelect.get("value"),
10),I.spatialRel=this._operatorSelect.get("value"),-1!==q.indexOf(["withinDistance","notWithinDistance"],this._operatorSelect.get("value"))&&(I.distance=this._distanceInput.get("value"),I.units=this._distanceUnitsSelect.get("value"));this.expression=I;O&&this._handleOperatorChange("where")},_showMessages:function(I){g.set(this._bodyNode,"innerHTML",I);b.fadeIn({node:this._errorMessagePane,easing:u.quadIn,onEnd:n.hitch(this,function(){e.set(this._errorMessagePane,{display:""})})}).play()},_handleCloseMsg:function(I){I&&
I.preventDefault();b.fadeOut({node:this._errorMessagePane,easing:u.quadOut,onEnd:n.hitch(this,function(){e.set(this._errorMessagePane,{display:"none"})})}).play()},_setActionAttr:function(I){this.action=I},_getActionAttr:function(){return this.action},_setTextAttr:function(I){this.text=I},_getTextAttr:function(){var I="";this.expression&&(I=this.inputOperands[this.expression.layer].name);this.expression.spatialRel?(I+=" "+this.i18n[this.expression.spatialRel],this.expression.distance&&(I+=" "+this.expression.distance+
" "+this.expression.units+" "+this.i18n.from),I+=" "+this.inputOperands[this.expression.selectingLayer].name):I+=" "+this.i18n.whereLabel+" "+this.expression._attributeText;return I},_getDisplayTextAttr:function(){var I="";if(this.expression){var O=this.inputOperands[this.expression.layer].name;I+=this.shortenString(O)}this.expression.spatialRel?(I+=" \x3clabel style\x3d'font-style: italic;'\x3e"+this.i18n[this.expression.spatialRel],this.expression.distance&&(I+=" "+this.expression.distance+" "+
this.expression.units+" "+this.i18n.from),O=this.inputOperands[this.expression.selectingLayer].name,I=I+"\x3c/label\x3e "+this.shortenString(O)):I+=" \x3clabel style\x3d'font-style: italic;'\x3e"+this.i18n.whereLabel+" "+this.expression._attributeText+"\x3c/label";return I+"\x3c/tr\x3e\x3c/tbody\x3e\x3c/table\x3e"},shortenString:function(I){return"\x3clabel style\x3d'overflow: hidden;text-overflow: ellipsis'\x3e"+I+"\x3c/label\x3e\x3c/td\x3e"},_setPrimaryActionButttonClassAttr:function(I){this.primaryActionButttonClass=
I},_getPrimaryActionButttonClassAttr:function(){return this.primaryActionButttonClass},_setShowFirstRowAttr:function(I){this.showFirstRow=I},_getShowFirstRowAttr:function(){return this.showFirstRow},_setShowReadyToUseLayersAttr:function(I){this._set("showReadyToUseLayers",I)},_setShowReadyLayersForFirstAttr:function(I){this._set("showReadyLayersForFirst",I)},_setShowBrowseLayersAttr:function(I){this._set("showBrowseLayers",I)},_setOwningWidgetAttr:function(I){this._set("owningWidget",I)}});a("extend-esri")&&
n.setObject("dijit.analysis.ExpressionForm",H,ea);return H})},"esri/dijit/analysis/CreditEstimator":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/event dojo/_base/kernel dojo/has dojo/dom-construct dojo/dom-class dojo/dom-attr dojo/dom-style dojo/string dojo/number dijit/_WidgetBase dijit/_TemplatedMixin dijit/_OnDijitClickMixin dijit/_FocusMixin ../../kernel ../../lang dojo/i18n!../../nls/jsapi dojo/text!./templates/CreditEstimator.html".split(" "),function(H,
k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B){H=k([h,p,t,w],{declaredClass:"esri.dijit.analysis.CreditEstimator",i18n:null,templateString:B,postMixInProperties:function(){this.inherited(arguments);this.i18n={};n.mixin(this.i18n,y.common);n.mixin(this.i18n,y.analysisMsgCodes);n.mixin(this.i18n,y.creditEstimator)},postCreate:function(){this.inherited(arguments)},_setContentAttr:function(C){var G="";C.code&&!C.messageCode&&(C.messageCode=C.code);C.messageCode?(G=r.isDefined(this.i18n[C.messageCode])?this.i18n[C.messageCode]:
C.message,G=r.isDefined(C.params)?g.substitute(G,C.params):G,f.set(this._messageDiv,"display","block"),f.set(this._messageDiv,"innerHTML",G),e.set(this._table,"display","none")):(e.set(this._table,"display","table"),f.set(this._messageDiv,"display",r.isDefined(C.infoMessage)?"block":"none"),f.set(this._messageDiv,"innerHTML",r.isDefined(C.infoMessage)?C.infoMessage:""),r.isDefined(C.infoMessage)&&e.set(this._messageDiv,"margin-top","1em"),G=r.isDefined(C.cost)?C.cost:C.maximumCost,C.maximumCost&&
f.set(this._costLabelNode,"innerHTML",this.i18n.maxCreditsLabel),C.totalRecords?f.set(this._totalRecordsNode,"innerHTML",d.format(C.totalRecords,{locale:l.locale})):e.set(this._totalRecordsLabelNode,"display","none"),f.set(this._creditsReqNode,"innerHTML",d.format(G,{locale:l.locale})))},_setErrorContentAttr:function(C){e.set(this._table,"display","none");f.set(this._messageDiv,"innerHTML",C)}});b("extend-esri")&&n.setObject("dijit.analysis.CreditEstimator",H,u);return H})},"widgets/Visibility/js/geometryUtils":function(){define("esri/geometry/Point esri/geometry/Polyline esri/geometry/webMercatorUtils dojo/Deferred dojo/_base/array dojo/_base/lang esri/SpatialReference".split(" "),
function(H,k,n,q,m,l,b){var a={getProjectedGeometry:function(c,f,e){var g=new q;if(n.canProject(c,f)){var d=n.project(c,f);g.resolve(d)}else e.project([c],f,function(h){d=h[0];g.resolve(d)});return g.promise},getDestinationPoint:function(c,f,e){var g=c.x*Math.PI/180,d=f*Math.PI/180;f=Math.sin(d);d=Math.cos(d);var h=.9966471893352243*Math.tan(c.y*Math.PI/180);c=1/Math.sqrt(1+h*h);var p=h*c,t=Math.atan2(h,d);h=c*f;var w=1-h*h,u=2.7233160610984375E11*w/4.040829998465916E13,r=1+u/16384*(4096+u*(-768+
u*(320-175*u))),y=u/1024*(256+u*(-128+u*(74-47*u))),B=e/(6356752.314245*r),C=0;do{u=Math.cos(2*t+B);var G=Math.sin(B);var x=Math.cos(B);var v=y*G*(u+y/4*(x*(-1+2*u*u)-y/6*u*(-3+4*G*G)*(-3+4*u*u)));var z=B;B=e/(6356752.314245*r)+v}while(1E-12<Math.abs(B-z)&&200>++C);if(200<=C)return console.log("Formula failed to converge"),null;e=p*G-c*x*d;e=Math.atan2(p*x+c*G*d,.9966471893352243*Math.sqrt(h*h+e*e));w=2.0955066654848088E-4*w*(4+.003352810664775694*(4-3*w));g=(g+(Math.atan2(G*f,c*x-p*G*d)-.003352810664775694*
(1-w)*h*(B+w*G*(u+w*x*(-1+2*u*u))))+3*Math.PI)%(2*Math.PI)-Math.PI;e=180*e/Math.PI;g=180*g/Math.PI;return new H(g,e,new b(4326))},getInverseCalculations:function(c,f){var e=f.x*Math.PI/180-c.x*Math.PI/180,g=.9966471893352243*Math.tan(c.y*Math.PI/180);c=1/Math.sqrt(1+g*g);g*=c;var d=.9966471893352243*Math.tan(f.y*Math.PI/180);f=1/Math.sqrt(1+d*d);d*=f;var h=e,p=0;do{var t=Math.sin(h);var w=Math.cos(h);var u=f*t*f*t+(c*d-g*f*w)*(c*d-g*f*w);u=Math.sqrt(u);if(0==u)return{distance:0,initialBearing:0,finalBearing:0};
var r=g*d+c*f*w;var y=Math.atan2(u,r);var B=c*f*t/u;var C=1-B*B;var G=r-2*g*d/C;isNaN(G)&&(G=0);var x=2.0955066654848088E-4*C*(4+.003352810664775694*(4-3*C));var v=h;h=e+.003352810664775694*(1-x)*B*(y+x*u*(G+x*r*(-1+2*G*G)))}while(1E-12<Math.abs(h-v)&&200>++p);if(200<=p)return null;h=2.7233160610984375E11*C/4.040829998465916E13;p=h/1024*(256+h*(-128+h*(74-47*h)));e=Math.atan2(f*t,c*d-g*f*w);c=Math.atan2(c*t,-g*f+c*d*w);e=(e+2*Math.PI)%(2*Math.PI);c=(c+2*Math.PI)%(2*Math.PI);g=Number((6356752.314245*
(1+h/16384*(4096+h*(-768+h*(320-175*h))))*(y-p*u*(G+p/4*(r*(-1+2*G*G)-p/6*G*(-3+4*u*u)*(-3+4*G*G))))).toFixed(3));e=180*e/Math.PI;c=180*c/Math.PI;return{distance:g,initialBearing:e,finalBearing:c}},getLineBetweenPoints:function(c){var f,e=[];m.forEach(c,l.hitch(this,function(g){e.push([a.removeNegativeExponents(g.x),a.removeNegativeExponents(g.y)])}));0<e.length&&(f=new k({paths:[e],spatialReference:{wkid:4326}}));return f},getAngleBetweenPoints:function(c,f){c=a.getInverseCalculations(c,f);return null===
c?0:c.initialBearing},getDistanceBetweenPoints:function(c,f){c=a.getInverseCalculations(c,f);return null===c?0:c.distance},getPointsForArc:function(c,f,e,g){var d=[];var h=f-c;f=parseInt(h,10);0>=f&&(f=1);var p=Math.abs(h)/Math.abs(f);if(0<p)for(h=0;h<Math.abs(f)+1;h++){var t=c+p*h;(t=a.getDestinationPoint(e,t,Math.abs(g)))&&d.push(t)}return d},removeNegativeExponents:function(c){return 1<c.toString().toLowerCase().split("e-").length?0:c}};return a})},"jimu/dijit/CoordinateControl":function(){define("dojo/_base/declare dojo/_base/array dojo/_base/lang jimu/utils dojo/on dojo/has dojo/query dojo/dom-attr dojo/dom-class dojo/dom-style dojo/string dojo/topic dojo/keys dojo/Deferred dojo/Evented dojo/dom dojo/dom-construct dojo/aspect jimu/BaseWidget dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dijit/registry dijit/Tooltip dijit/TooltipDialog dijit/popup dojo/text!./templates/CoordinateControl.html esri/geometry/webMercatorUtils esri/graphic esri/geometry/Point esri/request esri/SpatialReference esri/tasks/GeometryService esri/tasks/ProjectParameters esri/toolbars/draw jimu/dijit/Message ./_CoordinateControlFormatNotation ./_CoordinateControlConfirmNotation dojo/_base/sniff dijit/form/TextBox dijit/form/Textarea dijit/form/Select dijit/InlineEditBox".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G,x,v,z,A,F,J,L,P,Q,Z,ca,da,ea,fa){return H([r,y,B,p],{templateString:z,baseClass:"jimu-coordinate-control",parentWidget:null,input:!0,label:null,showCopyButton:!1,showFormatButton:!1,zoomScale:null,showDeleteButton:!0,showExpandButton:!0,showDrawPoint:!0,drawButtonLabel:null,drawToolTip:null,graphicsLayer:null,type:"DD",inputFromText:!0,addSign:!1,hasCustomLabel:!1,postMixInProperties:function(){this.nls=window.jimuNls.coordinateControl;this.isRenderIdForAttrs=
!0},constructor:function(K){H.safeMixin(this,K);this.uid=K.id||C.getUniqueId("cc");null===this.parentWidget&&console.error("No parentWidget parameter supplied: Parameter is mandatory");null===this.label&&console.info("No label parameter supplied (optional): Coordinate Control will have no label");null===this.zoomScale&&console.info("No zoomScale parameter supplied (optional): Coordinate Control will have no zoom button");null===this.drawButtonLabel&&console.info("No drawButtonLabel parameter supplied (optional): Coordinate Control will have no draw button");
null===this.graphicsLayer&&console.info("No graphicsLayer parameter supplied: Input graphics will not be shown on map")},postCreate:function(){this._frmtdlg=new x({id:this.uid+"_formatCoordinateTooltip",content:new ea({nls:this.nls,ct:this.type}),style:"width: 400px",onClose:n.hitch(this,this.popupDidClose)});u.after(this._frmtdlg,"onShow",n.hitch(this,function(){this._frmtdlg.content.frmtSelect.focus()}));u.after(this._frmtdlg,"onClose",n.hitch(this,function(){this.formatButton.focus()}));this.own(m(this._frmtdlg,
"keydown",n.hitch(this,function(K){K.keyCode===d.ESCAPE&&v.close(this._frmtdlg)})));"DartTheme"===this.parentWidget.appConfig.theme.name&&c.add(this._frmtdlg.domNode,"coordinateControlDialog");this.defaultFormat&&(this._frmtdlg.content.formats[this.type].defaultFormat=this.defaultFormat);this.geomsrvc=new Q(this.parentWidget.appConfig.geometryService);this.dt=new ca(this.parentWidget.map);this.initUI();this.setUIListeners()},initUI:function(){null===this.label?this.setHidden(this.coordNameContainer,
!1):this.coordName.setValue(this.label);this.input?(this.zoomButton.parentNode.style.display="none",this.setHidden(this.expandButton,!0),this.setHidden(this.removeControlBtn,!0),this.coordName.set("disabled","disabled"),this.coordName.set("value",this.label+" ("+this._frmtdlg.content.ct+")"),this.showDrawPoint?(this.drawPointButton.title=this.drawButtonLabel,null===this.drawToolTip&&(this.drawToolTip=this.nls.tooltip)):this.setHidden(this.drawPointButton,!0)):(this.coordtext.disabled=!0,this.coordtext.placeholder=
"",this.setHidden(this.drawPointButton,!0),this.showExpandButton||(this.setHidden(this.expandButton,!0),c.remove(this.domNode,"coordinateContainer"),c.add(this.domNode,"outputCoordinateContainer"),c.add(this.cpbtn,"outputCopyBtn"),this.coordtext.readOnly=!0),this.showDeleteButton||this.setHidden(this.removeControlBtn,!0));this.showCopyButton||(this.setHidden(this.cpbtn,!0),c.add(this.cpbtn,"inputCopyBtn"),a.set(this.cpbtn,"title",this.nls.copyAll));this.showFormatButton||this.setHidden(this.formatButton,
!0);null===this.zoomScale&&this.setHidden(this.zoomButton,!0);this.formatButton.title=this.input?this.nls.formatInput:this.nls.formatOutput;a.set(this.formatButton,"aria-label",this.formatButton.title)},setUIListeners:function(){this.input||g.subscribe("INPUTPOINTDIDCHANGE",n.hitch(this,this.mapWasClicked));g.subscribe("INPUTERROR",n.hitch(this,this.inputError));g.subscribe("VALIDINPUT",n.hitch(this,function(K){this.toggleZoomButton(K)}));this.own(m(this.expandButton,"click",n.hitch(this,this.expandButtonWasClicked)));
this.own(m(this.expandButton,"keydown",n.hitch(this,function(K){if(K.keyCode===d.ENTER||K.keyCode===d.SPACE)this.expandButtonWasClicked(K),K.preventDefault()})));this.own(m(this.zoomButton,"click",n.hitch(this,this.zoomButtonWasClicked)));this.own(m(this.zoomButton,"keydown",n.hitch(this,function(K){K.keyCode!==d.ENTER&&K.keyCode!==d.SPACE||this.zoomButtonWasClicked(K)})));this.own(m(this.coordName,"change",n.hitch(this,this.coordNameDidChange)));this.cpbtn.addEventListener("click",n.hitch(this,this.cpBtnWasClicked));
this.own(m(this.cpbtn,"keydown",n.hitch(this,function(K){K.keyCode!==d.ENTER&&K.keyCode!==d.SPACE||this.cpBtnWasClicked(K)})));this.subVal1CpBtn.addEventListener("click",n.hitch(this,this.cpSubBtnWasClicked));this.own(m(this.subVal1CpBtn,"keydown",n.hitch(this,function(K){K.keyCode!==d.ENTER&&K.keyCode!==d.SPACE||this.cpSubBtnWasClicked(K)})));this.subVal2CpBtn.addEventListener("click",n.hitch(this,this.cpSubBtnWasClicked));this.own(m(this.subVal2CpBtn,"keydown",n.hitch(this,function(K){K.keyCode!==
d.ENTER&&K.keyCode!==d.SPACE||this.cpSubBtnWasClicked(K)})));this.subVal3CpBtn.addEventListener("click",n.hitch(this,this.cpSubBtnWasClicked));this.own(m(this.subVal3CpBtn,"keydown",n.hitch(this,function(K){K.keyCode!==d.ENTER&&K.keyCode!==d.SPACE||this.cpSubBtnWasClicked(K)})));this.subVal4CpBtn.addEventListener("click",n.hitch(this,this.cpSubBtnWasClicked));this.own(m(this.subVal4CpBtn,"keydown",n.hitch(this,function(K){K.keyCode!==d.ENTER&&K.keyCode!==d.SPACE||this.cpSubBtnWasClicked(K)})));this.own(m(this.formatButton,
"click",n.hitch(this,this.formatButtonWasClicked)));this.own(m(this.formatButton,"keydown",n.hitch(this,function(K){K.keyCode!==d.ENTER&&K.keyCode!==d.SPACE||this.formatButtonWasClicked(K)})));this.own(m(this.drawPointButton,"click",n.hitch(this,this.drawPointButtonWasClicked)));this.own(m(this.drawPointButton,"keydown",n.hitch(this,function(K){K.keyCode!==d.ENTER&&K.keyCode!==d.SPACE||this.drawPointButtonWasClicked(K)})));this.own(m(this.removeControlBtn,"keydown",n.hitch(this,function(K){K.keyCode!==
d.ENTER&&K.keyCode!==d.SPACE||this.remove()})));this.own(m(this._frmtdlg.content.applyButton,"click",n.hitch(this,this.formatDialogApplyButtonClicked)));this.own(m(this._frmtdlg.content.applyButton,"keydown",n.hitch(this,function(K){K.keyCode!==d.ENTER&&K.keyCode!==d.SPACE||this.formatDialogApplyButtonClicked()})));this.own(m(this._frmtdlg.content.cancelButton,"click",n.hitch(this,function(){v.close(this._frmtdlg)})));this.own(m(this._frmtdlg.content.cancelButton,"keydown",n.hitch(this,function(K){K.keyCode!==
d.ENTER&&K.keyCode!==d.SPACE||v.close(this._frmtdlg)})));this.own(m(this.coordtext,"keydown",n.hitch(this,this.coordTextInputKeyWasPressed)));this.own(m(this.coordtext,"input",n.hitch(this,function(){this.currentClickPointDD=null;this.zoomButton.parentNode&&(this.zoomButton.parentNode.style.display="none");this.emit("coordinates-deleted",{})})));this.own(this.geomsrvc.on("error",n.hitch(this,this.geomSrvcDidFail)));this.own(m(this.dt,"draw-complete",n.hitch(this,this.drawComplete)));this.own(u.after(this.parentWidget,
"onClose",n.hitch(this,function(){this.input&&c.contains(this.drawPointButton,"drawPointBtn-active")&&this.deactivateDrawTool();this._frmtdlg&&this._frmtdlg.domNode.offsetParent&&"closed"===this.parentWidget.state&&v.close(this._frmtdlg)})));this.own(u.after(this.parentWidget,"onOpen",n.hitch(this,function(){var K=this.parentWidget.getParent().getParent().domNode;this.own(m(K,"click",n.hitch(this,function(V){"settingBtn"!==V.target.className&&this._frmtdlg&&this._frmtdlg.domNode.offsetParent&&"active"===
this.parentWidget.state&&v.close(this._frmtdlg)})))})))},formatDialogApplyButtonClicked:function(){this.type=this._frmtdlg.content.ct;this.updateDisplay();this.input?this.coordName.set("value",this.label+" ("+this._frmtdlg.content.ct+")"):this.hasCustomLabel&&this.coordName.set("value",this.label);v.close(this._frmtdlg)},popupDidClose:function(){if(this._frmtdlg.content.isCanceled)this.addSign!==this._frmtdlg.content.addSignChkBox.checked&&this._frmtdlg.content.addSignChkBox.setValue(this.addSign);
else{this.addSign=this._frmtdlg.content.addSignChkBox.checked;var K=this._frmtdlg.content.ct;this.type!==K&&(this.type=K,this.updateDisplay())}},coordNameDidChange:function(){this.hasCustomLabel=!0},cpSubBtnWasClicked:function(K){this[K.currentTarget.id.split("~")[0]].select();try{var V=document.execCommand("copy")}catch(aa){V=!1}this.showToolTip(K.currentTarget.id,V?this.nls.copySuccessful:this.nls.copyFailed)},cpBtnWasClicked:function(K){K.preventDefault();if(this.input){K=C.toArray().filter(function(Y){return"jimu-coordinate-control"===
Y.baseClass&&!Y.input});var V=K.map(function(Y){if(Y.coordtext)return Y.coordtext.value}).join("\r\n");K=this.coordtext.value;this.coordtext.value=K+"\r\n"+V;this.selectText(this.coordtext);try{var aa=document.execCommand("copy")}catch(Y){aa=!1}this.coordtext.value=K}else{this.selectText(this.coordtext);try{aa=document.execCommand("copy")}catch(Y){aa=!1}}this.showToolTip(this.cpbtn.id,aa?this.nls.copySuccessful:this.nls.copyFailed)},selectText:function(K){var V=document.getSelection();V.removeAllRanges();
K.focus();var aa=/Edge/.test(navigator.userAgent),Y=!!window.MSInputMethodContext&&!!document.documentMode;if(l("ff")||l("chrome")||l("safari"))!this.input&&this.coordtext.disabled?(this.coordtext.disabled=!1,K.select(),this.coordtext.disabled=!0):K.select();aa&&K.select();Y&&(aa=document.createRange(),aa.selectNode(K),V.addRange(aa))},showToolTip:function(K,V){var aa=t.byId(K);G.show(V,aa);setTimeout(function(){G.hide(aa)},1E3)},geomSrvcDidComplete:function(K){0>=K[0].length?(new da({message:this.nls.parseCoordinatesError}),
g.publish("INPUTERROR")):(this.currentClickPointDD=this.currentClickPoint=new J(K[0][0],K[0][1],new P({wkid:4326})),this.input&&(this.currentClickPoint.spatialReference.equals(this.parentWidget.map.spatialReference)?this.parentWidget.map.centerAt(this.currentClickPoint):this.getProjectedPoint(this.currentClickPoint).then(n.hitch(this,function(V){this.currentClickPoint=V;this.parentWidget.map.centerAt(this.currentClickPoint)}),n.hitch(this,function(V){console.error(V);g.publish("INPUTERROR")})),this.updateDisplay(),
g.publish("INPUTPOINTDIDCHANGE",{mapPoint:this.currentClickPointDD,inputFromText:!0}),g.publish("VALIDINPUT",{show:!0})))},geomSrvcDidFail:function(){new da({message:this.nls.parseCoordinatesError});g.publish("INPUTERROR")},coordTextInputKeyWasPressed:function(K){if(K.keyCode===d.ENTER){K.preventDefault();var V=this.getCleanInput(K.currentTarget.value);this.inputFromText=!1;this.getCoordinateType(V).then(n.hitch(this,function(aa){if(aa)if(1===aa.length){var Y=this.processCoordTextInput(V,aa[0],!1);
this.getXYNotation(Y,aa[0].conversionType).then(n.hitch(this,function(I){0<I[0].length?this.geomSrvcDidComplete(I):this.geomSrvcDidFail()}))}else this.confirmNotationDialog||(this.confirmNotationDialog=new fa({title:this.nls.comfirmInputNotation,nls:this.nls,options:aa,style:"width: 400px",hasSkipCheckBox:!1,theme:this.parentWidget.appConfig.theme.name})),this.confirmNotationDialog.show().then(n.hitch(this,function(){var I=k.filter(aa,function(E){return E.name===this.confirmNotationDialog.comboOptions.get("value")},
this),O=this.processCoordTextInput(V,I[0],!1);this.getXYNotation(O,I[0].conversionType).then(n.hitch(this,function(E){0<E[0].length?this.geomSrvcDidComplete(E):this.geomSrvcDidFail()}))},function(){}));else new da({message:this.nls.parseCoordinatesError}),g.publish("INPUTERROR")}));a.set(this.coordtext,"value",V);this.emit("get-coordinate-complete",V);this.currentClickPoint=null}if(K.keyCode===d.BACKSPACE||K.keyCode===d.DELETE)this.currentClickPointDD=null,this.zoomButton&&this.zoomButton.parentNode&&
(this.zoomButton.parentNode.style.display="none"),this.emit("coordinates-deleted",{})},getFormattedCoordinateText:function(){return this.coordtext.value},getCurrentMapCoordinate:function(){return this.currentClickPoint},getMapCoordinateDD:function(){return this.currentClickPointDD},deactivateDrawTool:function(){this.dt.deactivate();c.remove(this.drawPointButton,"drawPointBtn-active")},processCoordTextInput:function(K,V,aa){var Y=V.pattern.exec(K),I=!1,O=V.name;switch(V.name){case "DD":var E=Y[2];
var N=Y[7];var R=Y[10];var W=Y[16];var ha=Y[3].replace(/[,:]/,".");var oa=Y[11].replace(/[,:]/,".");O="DD";break;case "DDrev":E=Y[11];N=Y[16];R=Y[2];W=Y[8];ha=Y[12].replace(/[,:]/,".");oa=Y[3].replace(/[,:]/,".");O="DD";break;case "DDM":E=Y[2];N=Y[7];R=Y[10];W=Y[15];ha=Y[3];var ma=Y[4].replace(/[,:]/,".");oa=Y[11];var T=Y[12].replace(/[,:]/,".");O="DDM";break;case "DDMrev":E=Y[10];N=Y[15];R=Y[2];W=Y[7];ha=Y[11];ma=Y[12].replace(/[,:]/,".");oa=Y[3];T=Y[4].replace(/[,:]/,".");O="DDM";break;case "DMS":E=
Y[2];N=Y[8];R=Y[11];W=Y[17];ha=Y[3];ma=Y[4];var ba=Y[5].replace(/[,:]/,".");oa=Y[12];T=Y[13];var na=Y[14].replace(/[,:]/,".");O="DMS";break;case "DMSrev":E=Y[11],N=Y[17],R=Y[2],W=Y[8],ha=Y[12],ma=Y[13],ba=Y[14].replace(/[,:]/,"."),oa=Y[3],T=Y[4],na=Y[5].replace(/[,:]/,"."),O="DMS"}E&&N?(I=!0,E=(new RegExp(/[Ss-]/)).test(E)?"-":"+"):E=E&&(new RegExp(/[Ss-]/)).test(E)?"-":N&&(new RegExp(/[Ss-]/)).test(N)?"-":"+";R&&W?(I=!0,R=(new RegExp(/[Ww-]/)).test(R)?"-":"+"):R=R&&(new RegExp(/[Ww-]/)).test(R)?
"-":W&&(new RegExp(/[Ww-]/)).test(W)?"-":"+";I&&(aa||new da({message:this.nls.latLongWarningMessage}));switch(O){case "DD":K=E+ha+","+R+oa;break;case "DDM":K=E+ha+" "+ma+","+R+oa+" "+T;break;case "DMS":K=E+ha+" "+ma+" "+ba+","+R+oa+" "+T+" "+na}return K},zoomButtonWasClicked:function(){this.currentClickPoint&&(this.parentWidget.map.getZoom()<this.zoomScale?this.parentWidget.map.centerAt(this.currentClickPoint).then(n.hitch(this,function(){this.parentWidget.map.setScale(this.zoomScale)})):this.parentWidget.map.centerAt(this.currentClickPoint))},
setHidden:function(K,V){f.set(K,"display","none");V&&w.destroy(K.parentNode)},setVisible:function(K){f.set(K,"display","inline-flex")},remove:function(){this._frmtdlg&&this._frmtdlg.domNode.offsetParent&&v.close(this._frmtdlg);this.destroyRecursive();this.emit("removeCoordsControl")},mapWasClicked:function(K){this.currentClickPoint=K.mapPoint;this.getDDPoint(K.mapPoint).then(n.hitch(this,function(V){this.currentClickPointDDDD=this.currentClickPointDD=V;this.inputFromText=K.inputFromText?!0:!1;this.updateDisplay()}),
n.hitch(this,function(V){console.error(V)}))},getDDPoint:function(K){var V=new h,aa=new P(3857);A.canProject(K,aa)?V.resolve(A.webMercatorToGeographic(A.project(K,aa))):(aa={url:this.geomsrvc.url+"/findTransformations",content:{f:"json",inSR:JSON.stringify(K.spatialReference.toJson()),outSR:4326,extentOfInterest:JSON.stringify(this.parentWidget.map.extent)},handleAs:"json",callbackParamName:"callback"},(new L(aa,{usePost:!1})).then(n.hitch(this,function(Y){Y=(Y=Y&&Y.transformations?Y.transformations:
void 0)&&0<Y.length?Y[0].wkid:void 0;var I=new Z;I.outSR=new P(4326);I.geometries=[K];I.transformForward=!0;I.transformation=Y;this.geomsrvc.project(I,n.hitch(this,function(O){V.resolve(O[0])}),function(O){V.reject(O)})}),n.hitch(this,function(Y){V.reject(Y)})));return V},getProjectedPoint:function(K){var V=new h;if(A.canProject(K,this.parentWidget.map))V.resolve(A.geographicToWebMercator(K));else{var aa={url:this.geomsrvc.url+"/findTransformations",content:{f:"json",inSR:4326,outSR:JSON.stringify(this.parentWidget.map.spatialReference.toJson()),
extentOfInterest:JSON.stringify(this.parentWidget.map.extent)},handleAs:"json",callbackParamName:"callback"};(new L(aa,{usePost:!1})).then(n.hitch(this,function(Y){Y=(Y=Y&&Y.transformations?Y.transformations:void 0)&&0<Y.length?Y[0].geoTransforms[0].wkid:void 0;var I=new Z;I.outSR=new P(this.parentWidget.map.spatialReference);I.geometries=[K];I.transformForward=!0;I.transformation=Y;this.geomsrvc.project(I,n.hitch(this,function(O){V.resolve(O[0])}),function(O){V.reject(O)})}),n.hitch(this,function(Y){V.reject(Y)}))}return V},
expandButtonWasClicked:function(){c.toggle(this.coordcontrols,"expanded");c.contains(this.coordcontrols,"expanded")?(c.remove(this.expandButton,"expandBtn"),c.add(this.expandButton,"collapseBtn"),a.set(this.expandButton,"aria-expanded","true")):(c.remove(this.expandButton,"collapseBtn"),c.add(this.expandButton,"expandBtn"),a.set(this.expandButton,"aria-expanded","false"));this.setSubCoordUI(c.contains(this.coordcontrols,"expanded"));this._setCoordControlsTabindex(c.contains(this.coordcontrols,"expanded"));
this.emit("expandButtonClicked",c.contains(this.coordcontrols,"expanded"))},_setCoordControlsTabindex:function(K){var V=[];if(K){var aa=0;K=-1}else aa=-1,K=0;V=b("input[tabindex\x3d'"+K+"']",this.coordcontrols);V=V.concat(b("span[tabindex\x3d'"+K+"']",this.coordcontrols));k.forEach(V,n.hitch(this,function(Y){a.set(Y,"tabindex",aa)}))},formatButtonWasClicked:function(){this._frmtdlg.content.setCt(this.type);v.open({popup:this._frmtdlg,around:this.formatButton})},drawPointButtonWasClicked:function(){if(c.contains(this.drawPointButton,
"drawPointBtn-active"))this.dt.deactivate(),this.parentWidget.map.enableMapNavigation();else{this.parentWidget.map.disableMapNavigation();this.dt.activate(ca.POINT);var K=this.dt._tooltip;K&&(K.innerHTML=this.drawToolTip)}c.toggle(this.drawPointButton,"drawPointBtn-active")},drawComplete:function(K){var V={};V.mapPoint=K.geometry;this.parentWidget.map.enableMapNavigation();this.mapWasClicked(V)},setSubCoordUI:function(K){if(K){K="165px";switch(this.type){case "DD":case "DMS":case "DDM":this.sub1label.innerHTML=
"Lat";this.sub2label.innerHTML="Lon";this.setHidden(this.sub3,!1);this.setHidden(this.sub4,!1);K="90px";break;case "GARS":this.sub1label.innerHTML="Lon";this.sub2label.innerHTML="Lat";this.sub3label.innerHTML="Quadrant";this.sub4label.innerHTML="Key";this.setVisible(this.sub3);this.setVisible(this.sub4);break;case "GEOREF":this.sub1label.innerHTML="15\u00b0 Quad";this.sub2label.innerHTML="1\u00b0 Quad";this.sub3label.innerHTML="Easting";this.setVisible(this.sub3);this.sub4label.innerHTML="Northing";
this.setVisible(this.sub4);break;case "USNG":case "MGRS":this.sub1label.innerHTML="GZD";this.sub2label.innerHTML="Grid Sq";this.sub3label.innerHTML="Easting";this.sub4label.innerHTML="Northing";this.setVisible(this.sub3);this.setVisible(this.sub4);break;case "UTM":this.sub1label.innerHTML="Zone";this.sub2label.innerHTML="Band";this.sub3label.innerHTML="Easting";this.sub4label.innerHTML="Northing";this.setVisible(this.sub3);this.setVisible(this.sub4);break;case "UTM_H":this.sub1label.innerHTML="Zone",
this.sub2label.innerHTML="Hemisphere",this.sub3label.innerHTML="Easting",this.sub4label.innerHTML="Northing",this.setVisible(this.sub3),this.setVisible(this.sub4)}f.set(this.coordcontrols,"display","block");f.set(this.coordcontrols,"height",K);f.set(this.coordcontrols,"width","300px")}else f.set(this.coordcontrols,"display","none"),f.set(this.coordcontrols,"height","0px");K=this.uid.split("_")[1];a.set(this["cc_"+K+"sub1val"],"aria-label",this.sub1label.innerHTML);a.set(this["cc_"+K+"sub2val"],"aria-label",
this.sub2label.innerHTML);a.set(this["cc_"+K+"sub3val"],"aria-label",this.sub3label.innerHTML);a.set(this["cc_"+K+"sub4val"],"aria-label",this.sub4label.innerHTML)},setCoordUI:function(K){if(K){var V=this.uid.split("_")[1];if(!this["cc_"+V+"sub1val"]||this.input&&this.inputFromText)return;var aa=this._frmtdlg.content.formats[this.type];aa=aa.useCustom?aa.customFormat:aa.defaultFormat;switch(this.type){case "DD":K=this.getFormattedDDStr(K,aa,this.addSign);this["cc_"+V+"sub1val"].value=e.substitute("${xcrd}",
{xcrd:K.latdeg});this["cc_"+V+"sub2val"].value=e.substitute("${ycrd}",{ycrd:K.londeg});var Y=K.formatResult;break;case "DDM":K=this.getFormattedDDMStr(K,aa,this.addSign);this["cc_"+V+"sub1val"].value=e.substitute("${latd} ${latm}",{latd:K.latdeg,latm:K.latmin});this["cc_"+V+"sub2val"].value=e.substitute("${lond} ${lonm}",{lond:K.londeg,lonm:K.lonmin});Y=K.formatResult;break;case "DMS":K=this.getFormattedDMSStr(K,aa,this.addSign);this["cc_"+V+"sub1val"].value=e.substitute("${latd} ${latm} ${lats}",
{latd:K.latdeg,latm:K.latmin,lats:K.latsec});this["cc_"+V+"sub2val"].value=e.substitute("${lond} ${lonm} ${lons}",{lond:K.londeg,lonm:K.lonmin,lons:K.lonsec});Y=K.formatResult;break;case "USNG":K=this.getFormattedUSNGStr(K,aa,!1);this["cc_"+V+"sub1val"].value=K.gzd;this["cc_"+V+"sub2val"].value=K.grdsq;this["cc_"+V+"sub3val"].value=K.easting;this["cc_"+V+"sub4val"].value=K.northing;Y=K.formatResult;break;case "MGRS":K=this.getFormattedMGRSStr(K,aa,!1);this["cc_"+V+"sub1val"].value=K.gzd;this["cc_"+
V+"sub2val"].value=K.grdsq;this["cc_"+V+"sub3val"].value=K.easting;this["cc_"+V+"sub4val"].value=K.northing;Y=K.formatResult;break;case "GARS":K=this.getFormattedGARSStr(K,aa,!1);this["cc_"+V+"sub1val"].value=K.lon;this["cc_"+V+"sub2val"].value=K.lat;this["cc_"+V+"sub3val"].value=K.quadrant;this["cc_"+V+"sub4val"].value=K.key;Y=K.formatResult;break;case "GEOREF":K=this.getFormattedGEOREFStr(K,aa,!1);this["cc_"+V+"sub1val"].value=K.lon+K.lat;this["cc_"+V+"sub2val"].value=K.quadrant15lon+K.quadrant15lat;
this["cc_"+V+"sub3val"].value=K.quadrant1lon;this["cc_"+V+"sub4val"].value=K.quadrant1lat;Y=K.formatResult;break;case "UTM":K=this.getFormattedUTMStr(K,aa,!1);K.bandLetter.match(/^[AaBbYyZz]/)?(this["cc_"+V+"sub1val"].value="",this["cc_"+V+"sub2val"].value="",this["cc_"+V+"sub3val"].value="",this["cc_"+V+"sub4val"].value="",K.formatResult=""):(this["cc_"+V+"sub1val"].value=K.zone,this["cc_"+V+"sub2val"].value=K.bandLetter,this["cc_"+V+"sub3val"].value=K.easting,this["cc_"+V+"sub4val"].value=K.westing);
Y=K.formatResult;break;case "UTM_H":K=this.getFormattedUTMHStr(K,aa,!1),K.hemisphere.match(/^[AaBbYyZz]/)?(this["cc_"+V+"sub1val"].value="",this["cc_"+V+"sub2val"].value="",this["cc_"+V+"sub3val"].value="",this["cc_"+V+"sub4val"].value="",K.formatResult=""):(this["cc_"+V+"sub1val"].value=K.zone,this["cc_"+V+"sub2val"].value=K.hemisphere,this["cc_"+V+"sub3val"].value=K.easting,this["cc_"+V+"sub4val"].value=K.westing),Y=K.formatResult}}else Y="";this.coordcontrols&&this.setSubCoordUI(c.contains(this.coordcontrols,
"expanded"));this.coordtext&&(a.set(this.coordtext,"value",Y),this.emit("get-coordinate-complete",Y))},getFormattedCoordinates:function(){this.getCoordValues(this.currentClickPointDD,this.type,4).then(n.hitch(this,function(K){this.setCoordUI(K)}),n.hitch(this,function(K){console.log(K)}))},updateDisplay:function(){this.currentClickPoint&&(this.currentClickPointDD||(this.currentClickPointDD=this.currentClickPoint),this.getFormattedCoordinates(this.currentClickPointDD),this.input&&(null!==this.graphicsLayer&&
(this.graphicsLayer.clear(),this.currentClickPoint.spatialReference.equals(this.parentWidget.map.spatialReference)?this.graphicsLayer.add(new F(this.currentClickPoint)):this.getProjectedPoint(this.currentClickPointDD).then(n.hitch(this,function(K){this.graphicsLayer.add(new F(K))}),n.hitch(this,function(K){console.error(K)}))),g.publish("INPUTPOINTDIDCHANGE",{mapPoint:this.currentClickPointDD,inputFromText:!0}),g.publish("VALIDINPUT",{show:!0})))},clear:function(){this.coordtext.value="";this.currentClickPointDDDD=
this.currentClickPointDD=this.currentClickPoint=null;this.graphicsLayer.clear()},inputError:function(){this.setCoordUI();this.toggleZoomButton(!1)},toggleZoomButton:function(K){this.zoomButton.parentNode&&(this.zoomButton.parentNode.style.display=K?"inline-block":"none")},getCleanInput:function(K){K=K.replace(/\n/g,"");K=K.replace(/\s+/g," ").trim();return K.toUpperCase()},getCoordValues:function(K,V,aa){var Y=new h;K={sr:4326,coordinates:[[K.x,K.y]],conversionType:V.name?V.name:V,numOfDigits:aa||
6,rounding:!0,addSpaces:!1};switch(V){case "DD":K.numOfDigits=6;break;case "USNG":K.numOfDigits=5;break;case "MGRS":K.conversionMode="mgrsDefault";K.numOfDigits=5;break;case "UTM_H":K.conversionType="utm";K.conversionMode="utmNorthSouth";K.addSpaces=!0;break;case "UTM":K.conversionType="utm";K.conversionMode="utmDefault";K.addSpaces=!0;break;case "GARS":K.conversionMode="garsDefault"}this.geomsrvc.toGeoCoordinateString(K).then(function(I){Y.resolve(I)},function(){Y.resolve(null)});return Y.promise},
getXYNotation:function(K,V){var aa=new h;var Y=V.name?V.name:V;V={sr:4326,conversionType:Y,strings:[]};switch(Y){case "DD":case "DDM":case "DMS":V.numOfDigits=2;K=K.replace(/[\u00b0\u02da\u00ba^~*"'\u2032\u00a8\u02dd]/g,"");V.strings.push(K);break;case "DDrev":V.conversionType="DD";V.numOfDigits=2;K=K.replace(/[\u00b0\u02da\u00ba^~*"'\u2032\u00a8\u02dd]/g,"");V.strings.push(K);break;case "DDMrev":V.conversionType="DDM";V.numOfDigits=2;K=K.replace(/[\u00b0\u02da\u00ba^~*"'\u2032\u00a8\u02dd]/g,"");
V.strings.push(K);break;case "DMSrev":V.conversionType="DMS";V.numOfDigits=2;K=K.replace(/[\u00b0\u02da\u00ba^~*"'\u2032\u00a8\u02dd]/g,"");V.strings.push(K);break;case "USNG":V.strings.push(K);V.addSpaces="false";break;case "MGRS":V.conversionMode="mgrsNewStyle";V.strings.push(K);V.addSpaces="false";break;case "UTM_H":V.conversionType="utm";V.conversionMode="utmNorthSouth";V.strings.push(K);break;case "UTM":V.conversionType="utm";V.conversionMode="utmDefault";V.strings.push(K);break;case "GARS":V.conversionMode=
"garsCenter";V.strings.push(K);break;case "GEOREF":V.strings.push(K)}this.geomsrvc.fromGeoCoordinateString(V).then(function(I){aa.resolve(I)},function(){aa.resolve(null)});return aa.promise},getNotations:function(){return[{name:"DD",pattern:new RegExp([/^(([NS\+\-\s])*([0-8]?\d([,.]\d*)?|90([,.]0*)?)([\u00b0\u02da\u00ba^~*]*)([NS\+\-\s])*)([,:;\s|\/\\]+)/,/(([EW\+\-\s])*([0]?\d?\d([,.]\d*)?|1[0-7]\d([,.]\d*)?|180([,.]0*)?)([\u00b0\u02da\u00ba^~*]*)([EW\+\-\s])*)$/].map(function(K){return K.source}).join("")),
notationType:this.nls.DDLatLongNotation,conversionType:"DD"},{name:"DDrev",pattern:new RegExp([/^(([EW\+\-\s])*([0]?\d?\d([,.]\d*)?|1[0-7]\d([,.]\d*)?|180([,.]0*)?)([\u00b0\u02da\u00ba^~*]*)([EW\+\-\s])*)/,/([,:;\s|\/\\]+)(([NS\+\-\s])*([0-8]?\d([,.]\d*)?|90([,.]0*)?)([\u00b0\u02da\u00ba^~*]*)([NS\+\-\s])*)$/].map(function(K){return K.source}).join("")),notationType:this.nls.DDLongLatNotation,conversionType:"DD"},{name:"DDM",pattern:new RegExp([/^(([NS\+\-\s])*([0-8]?\d|90)[\u00b0\u02da\u00ba^~*\s\-_]+(([0-5]?\d|\d)([,.]\d*)?)['\u2032\s_]*([NS\+\-\s])*)/,
/([,:;\s|\/\\]+)/,/(([EW\+\-\s])*([0]?\d?\d|1[0-7]\d|180)[\u00b0\u02da\u00ba^~*\s\-_]+(([0-5]\d|\d)([,.]\d*)?)['\u2032\s_]*([EW\+\-\s])*)/,/[\s]*$/].map(function(K){return K.source}).join("")),notationType:this.nls.DDMLatLongNotation,conversionType:"DDM"},{name:"DDMrev",pattern:new RegExp([/^(([EW\+\-\s])*([0]?\d?\d|1[0-7]\d|180)[\u00b0\u02da\u00ba^~*\s\-_]+(([0-5]\d|\d)([,.]\d*)?)['\u2032\s_]*([EW\+\-\s])*)/,/([,:;\s|\/\\]+)/,/(([NS\+\-\s])*([0-8]?\d|90)[\u00b0\u02da\u00ba^~*\s\-_]+(([0-5]?\d|\d)([,.]\d*)?)['\u2032\s_]*([NS\+\-\s])*)[\s]*$/].map(function(K){return K.source}).join("")),
notationType:this.nls.DDMLongLatNotation,conversionType:"DDM"},{name:"DMS",pattern:new RegExp([/^(([NS\+\-\s])*([0-8]?\d|90)[\u00b0\u02da\u00ba^~*\s\-_]+([0-5]?\d|\d)['\u2032\s\-_]+(([0-5]?\d|\d)([,.]\d*)?)["\u00a8\u02dd\s_]*([NS\+\-\s])*)/,/([,:;\s|\/\\]+)/,/(([EW\+\-\s])*([0]?\d?\d|1[0-7]\d|180)[\u00b0\u02da\u00ba^~*\s\-_]+([0-5]\d|\d)['\u2032\s\-_]+(([0-5]?\d|\d)([,.]\d*)?)["\u00a8\u02dd\s_]*([EW\+\-\s])*)[\s]*$/].map(function(K){return K.source}).join("")),notationType:this.nls.DMSLatLongNotation,
conversionType:"DMS"},{name:"DMSrev",pattern:new RegExp([/^(([EW\+\-\s])*([0]?\d?\d|1[0-7]\d|180)[\u00b0\u02da\u00ba^~*\s\-_]+([0-5]\d|\d)['\u2032\s\-_]+(([0-5]?\d|\d)([,.]\d*)?)["\u00a8\u02dd\s_]*([EW\+\-\s])*)/,/([,:;\s|\/\\]+)/,/(([NS\+\-\s])*([0-8]?\d|90)[\u00b0\u02da\u00ba^~*\s\-_]+([0-5]?\d|\d)['\u2032\s\-_]+(([0-5]?\d|\d)([,.]\d*)?)["\u00a8\u02dd\s_]*([NS\+\-\s])*)[\s]*$/].map(function(K){return K.source}).join("")),notationType:this.nls.DMSLongLatNotation,conversionType:"DMS"},{name:"GARS",
pattern:/^\d{3}[a-zA-Z]{2}[1-4]?[1-9]?$/,notationType:this.nls.GARSNotation,conversionType:"GARS"},{name:"GEOREF",pattern:/^[a-zA-Z]{4}\d{1,8}$/,notationType:this.nls.GEOREFNotation,conversionType:"GEOREF"},{name:"MGRS",pattern:new RegExp([/^\d{1,2}[-,;:\s]*[C-HJ-NP-X][-,;:\s]*[A-HJ-NP-Z]{2}[-,;:\s]*/,/(\d[-,;:\s]+\d|\d{2}[-,;:\s]+\d{2}|\d{3}[-,;:\s]+\d{3}|\d{4}[-,;:\s]+\d{4}|\d{5}[-,;:\s]+\d{5})/,/$|^(\d{1,2}[-,;:\s]*[C-HJ-NP-X][-,;:\s]*[A-HJ-NP-Z]{2}[-,;:\s]*)/,/(\d{2}|\d{4}|\d{6}|\d{8}|\d{10})?$|^[ABYZ][-,;:\s]*[A-HJ-NP-Z]{2}[-,;:\s]*/,
/(\d[-,;:\s]+\d|\d{2}[-,;:\s]+\d{2}|\d{3}[-,;:\s]+\d{3}|\d{4}[-,;:\s]+\d{4}|\d{5}[-,;:\s]+\d{5})/,/$|^[ABYZ][-,;:\s]*[A-HJ-NP-Z]{2}[-,;:\s]*(\d{2}|\d{4}|\d{6}|\d{8}|\d{10})?$/].map(function(K){return K.source}).join("")),notationType:this.nls.MGRSNotation,conversionType:"MGRS"},{name:"UTM",pattern:new RegExp([/^\d{1,2}[-,;:\s]*[c-hj-np-xC-HJ-NP-X][-,;:\s]*\d{1,6}\.?\d*[mM]?[-,;:\s]?\d{1,7}\.?\d*[mM]?$/].map(function(K){return K.source}).join("")),notationType:this.nls.UTMBandNotation,conversionType:"UTM"},
{name:"UTM (H)",pattern:new RegExp([/^\d{1,2}[-,;:\s]*[NnSs][-,;:\s]*\d{1,6}\.?\d*[mM]?[-,;:\s]+\d{1,7}\.?\d*[mM]?$/].map(function(K){return K.source}).join("")),notationType:this.nls.UTMHemNotation,conversionType:"UTM_H"}]},getCoordinateType:function(K){var V=this.getCleanInput(K);K=new h;var aa=this.getNotations();V=k.filter(aa,function(Y){return Y.pattern.test(this.v)},{v:V});0<V.length?K.resolve(V):K.resolve(null);return K.promise},getFormattedDDStr:function(K,V,aa){var Y={};Y.sourceValue=K;Y.sourceFormatString=
V;K=K[0].split(/[ ,]+/);Y.latdeg=K[0].replace(/[nNsS]/,"");Y.londeg=K[1].replace(/[eEwW]/,"");Y.latdeg=q.localizeNumber(parseFloat(Y.latdeg));Y.londeg=q.localizeNumber(parseFloat(Y.londeg));aa&&("N"===K[0].slice(-1)?Y.latdeg="+"+Y.latdeg:Y.latdeg="-"+Y.latdeg,"W"===K[1].slice(-1)?Y.londeg="-"+Y.londeg:Y.londeg="+"+Y.londeg);V=V.replace(/X/,Y.londeg);V=V.replace(/[eEwW]/,K[1].slice(-1));V=V.replace(/[nNsS]/,K[0].slice(-1));V=V.replace(/Y/,Y.latdeg);Y.formatResult=V;return Y},getFormattedDDMStr:function(K,
V,aa){var Y={};Y.sourceValue=K;Y.sourceFormatString=V;Y.parts=K[0].split(/[ ,]+/);Y.latdeg=Y.parts[0];Y.latmin=Y.parts[1].replace(/[nNsS]/,"");Y.londeg=Y.parts[2];Y.lonmin=Y.parts[3].replace(/[eEwW]/,"");Y.latmin=q.localizeNumber(parseFloat(Y.latmin));Y.lonmin=q.localizeNumber(parseFloat(Y.lonmin));aa&&("N"===Y.parts[1].slice(-1)?Y.latdeg="+"+Y.latdeg:Y.latdeg="-"+Y.latdeg,"W"===Y.parts[3].slice(-1)?Y.londeg="-"+Y.londeg:Y.londeg="+"+Y.londeg);K=V.replace(/[EeWw]/,Y.parts[3].slice(-1));K=K.replace(/Y/,
Y.lonmin);K=K.replace(/X/,Y.londeg);K=K.replace(/[NnSs]/,Y.parts[1].slice(-1));K=K.replace(/B/,Y.latmin);K=K.replace(/A/,Y.latdeg);Y.formatResult=K;return Y},getFormattedDMSStr:function(K,V,aa){var Y={};Y.sourceValue=K;Y.sourceFormatString=V;Y.parts=K[0].split(/[ ,]+/);Y.latdeg=Y.parts[0];Y.latmin=Y.parts[1];Y.latsec=Y.parts[2].replace(/[NnSs]/,"");Y.londeg=Y.parts[3];Y.lonmin=Y.parts[4];Y.latsec=q.localizeNumber(parseFloat(Y.latsec));Y.parts[5]&&(Y.lonsec=Y.parts[5].replace(/[EWew]/,""),Y.lonsec=
q.localizeNumber(parseFloat(Y.lonsec)));aa&&("N"===Y.parts[2].slice(-1)?Y.latdeg="+"+Y.latdeg:Y.latdeg="-"+Y.latdeg,"W"===Y.parts[5].slice(-1)?Y.londeg="-"+Y.londeg:Y.londeg="+"+Y.londeg);K=V.replace(/A/,Y.latdeg);K=K.replace(/B/,Y.latmin);K=K.replace(/C/,Y.latsec);K=K.replace(/X/,Y.londeg);K=K.replace(/Y/,Y.lonmin);K=K.replace(/Z/,Y.lonsec);K=K.replace(/[NnSs]/,Y.parts[2].slice(-1));Y.parts[5]&&(K=K.replace(/[EeWw]/,Y.parts[5].slice(-1)));Y.formatResult=K;return Y},getFormattedUSNGStr:function(K,
V){var aa={};aa.sourceValue=K;aa.sourceFormatString=V;K[0].match(/^[ABYZ]/)?aa.gzd=K[0].match(/[ABYZ]/)[0].trim():aa.gzd=K[0].match(/\d{1,2}[C-HJ-NP-X]/)[0].trim();K[0].replace(aa.gzd,"").match(/[a-hJ-zA-HJ-Z]{2}/)&&(aa.grdsq=K[0].replace(aa.gzd,"").match(/[a-hJ-zA-HJ-Z]{2}/)[0].trim());K[0].replace(aa.gzd+aa.grdsq,"").match(/^\d{1,5}/)&&(aa.easting=K[0].replace(aa.gzd+aa.grdsq,"").match(/^\d{1,5}/)[0].trim());K[0].replace(aa.gzd+aa.grdsq,"").match(/\d{1,5}$/)&&(aa.northing=K[0].replace(aa.gzd+aa.grdsq,
"").match(/\d{1,5}$/)[0].trim());K=V.replace(/Y/,aa.northing);K=K.replace(/X/,aa.easting);K=K.replace(/S/,aa.grdsq);K=K.replace(/Z/,aa.gzd);aa.formatResult=K;return aa},getFormattedMGRSStr:function(K,V){var aa={};aa.sourceValue=K;aa.sourceFormatString=V;K[0].match(/^[ABYZ]/)?aa.gzd=K[0].match(/[ABYZ]/)[0].trim():aa.gzd=K[0].match(/\d{1,2}[C-HJ-NP-X]/)[0].trim();aa.grdsq=K[0].replace(aa.gzd,"").match(/[a-hJ-zA-HJ-Z]{2}/)[0].trim();aa.easting=K[0].replace(aa.gzd+aa.grdsq,"").match(/^\d{1,5}/)[0].trim();
aa.northing=K[0].replace(aa.gzd+aa.grdsq,"").match(/\d{1,5}$/)[0].trim();K=V.replace(/Y/,aa.northing);K=K.replace(/X/,aa.easting);K=K.replace(/S/,aa.grdsq);K=K.replace(/Z/,aa.gzd);aa.formatResult=K;return aa},getFormattedGARSStr:function(K,V){var aa={};aa.sourceValue=K;aa.sourceFormatString=V;aa.lon=K[0].match(/\d{3}/);aa.lat=K[0].match(/[a-zA-Z]{2}/);K=K[0].match(/\d*$/);aa.quadrant=K[0][0];aa.key=K[0][1];V=V.replace(/K/,aa.key);V=V.replace(/Q/,aa.quadrant);V=V.replace(/Y/,aa.lat);V=V.replace(/X/,
aa.lon);aa.formatResult=V;return aa},getFormattedGEOREFStr:function(K,V){var aa={};aa.sourceValue=K;aa.sourceFormatString=V;aa.lon=K[0].match(/[a-zA-Z]{1}/)[0].trim();aa.lat=K[0].replace(aa.lon,"").match(/[a-zA-Z]{1}/)[0].trim();aa.quadrant15lon=K[0].replace(aa.lon+aa.lat,"").match(/[a-zA-Z]{1}/)[0].trim();aa.quadrant15lat=K[0].replace(aa.lon+aa.lat+aa.quadrant15lon,"").match(/[a-zA-Z]{1}/)[0].trim();K=K[0].replace(aa.lon+aa.lat+aa.quadrant15lon+aa.quadrant15lat,"");aa.quadrant1lon=K.substr(0,K.length/
2);aa.quadrant1lat=K.substr(K.length/2,K.length);V=V.replace(/Y/,aa.quadrant1lat);V=V.replace(/X/,aa.quadrant1lon);V=V.replace(/D/,aa.quadrant15lat);V=V.replace(/C/,aa.quadrant15lon);V=V.replace(/B/,aa.lat);V=V.replace(/A/,aa.lon);aa.formatResult=V;return aa},getFormattedUTMStr:function(K,V){var aa={};aa.sourceValue=K;aa.sourceFormatString=V;aa.parts=K[0].split(/[ ,]+/);aa.zone=aa.parts[0].replace(/[A-Z]/,"");aa.bandLetter=aa.parts[0].slice(-1);aa.easting=aa.parts[1];aa.westing=aa.parts[2];K=V.replace(/Y/,
aa.westing);K=K.replace(/X/,aa.easting);K=K.replace(/B/,aa.bandLetter);K=K.replace(/Z/,aa.zone);aa.formatResult=K;return aa},getFormattedUTMHStr:function(K,V){var aa={};aa.sourceValue=K;aa.sourceFormatString=V;aa.parts=K[0].split(/[ ,]+/);aa.zone=aa.parts[0].replace(/[A-Z]/,"");aa.hemisphere=aa.parts[0].slice(-1);aa.easting=aa.parts[1];aa.westing=aa.parts[2];K=V.replace(/Y/,aa.westing);K=K.replace(/X/,aa.easting);K=K.replace(/H/,aa.hemisphere);K=K.replace(/Z/,aa.zone);aa.formatResult=K;return aa}})})},
"jimu/dijit/_CoordinateControlFormatNotation":function(){define("dojo/_base/declare dojo/_base/lang dojo/dom-style dojo/on dojo/dom-attr dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin jimu/dijit/formSelect jimu/dijit/CheckBox".split(" "),function(H,k,n,q,m,l,b,a){return H([l,b,a],{baseClass:"jimu-coordinate-control",templateString:'\x3cdiv\x3e\x3cspan class\x3d"formatText"\x3e${nls.editCoordinateDialogTitle}\x3c/span\x3e\x3cdiv class\x3d"controlContainer"\x3e\x3cselect tabindex\x3d"0" class\x3d"selectFormat" data-dojo-attach-point\x3d"frmtSelect" aria-label\x3d"${nls.editCoordinateDialogTitle}" data-dojo-type\x3d"jimu/dijit/formSelect"\x3e\x3c/select\x3e\x3cinput tabindex\x3d"0" type\x3d"text" data-dojo-attach-point\x3d"frmtVal" class\x3d"formatInput"\x3e\x3c/input\x3e\x3cdiv class\x3d"settingsContainer" data-dojo-attach-point\x3d"prefixContainer"\x3e\x3cdiv class\x3d"formatText" data-dojo-attach-point\x3d"addSignChkBox" label\x3d"${nls.posNegPrefixLabel}" data-dojo-type\x3d"jimu/dijit/CheckBox"/\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"btnContainer"\x3e\x3cdiv tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.applyButtonLabel}" data-dojo-attach-point\x3d"applyButton" class\x3d"jimu-btn"\x3e${nls.applyButtonLabel}\x3c/div\x3e\x3cdiv data-dojo-attach-point\x3d"cancelButton" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.cancelButtonLabel}" class\x3d"jimu-btn formatCoordCancelButton"\x3e${nls.cancelButtonLabel}\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e',
isCanceled:!1,formats:{},setCt:function(c){this.ct=c;this.frmtSelect.set("value",this.ct)},postCreate:function(){this.formats={DD:{defaultFormat:"YN XE",customFormat:null,useCustom:!1},DDM:{defaultFormat:"A\u00b0 B'N X\u00b0 Y'E",customFormat:null,useCustom:!1},DMS:{defaultFormat:"A\u00b0 B' C\"N X\u00b0 Y' Z\"E",customFormat:null,useCustom:!1},GARS:{defaultFormat:"XYQK",customFormat:null,useCustom:!1},GEOREF:{defaultFormat:"ABCDXY",customFormat:null,useCustom:!1},MGRS:{defaultFormat:"ZSXY",customFormat:null,
useCustom:!1},USNG:{defaultFormat:"ZSXY",customFormat:null,useCustom:!1},UTM:{defaultFormat:"ZB X Y",customFormat:null,useCustom:!1},UTM_H:{defaultFormat:"ZH X Y",customFormat:null,useCustom:!1}};var c=[],f;for(f in this.formats){var e={value:f,label:this.nls.notations[f]};c.push(e)}this.frmtSelect.addOption(c);m.set(this.frmtVal,"value",this.formats[this.ct].defaultFormat);this.own(q(this.frmtSelect,"change",k.hitch(this,this.frmtSelectValueDidChange)));this.own(q(this.frmtVal,"change",k.hitch(this,
this.formatValDidChange)));this.own(q(this.cancelButton,"click",k.hitch(this,function(){this.isCanceled=!0})));this.own(q(this.applyButton,"click",k.hitch(this,function(){this.isCanceled=!1})));this.displayPrefixContainer()},formatValDidChange:function(){var c=m.get(this.frmtVal,"value"),f=this.frmtSelect.get("value");this.formats[f].customFormat=c;this.formats[f].useCustom=!0},frmtSelectValueDidChange:function(c){var f=this.formats[c].useCustom?this.formats[c].customFormat:this.formats[c].defaultFormat;
this.ct=c;m.set(this.frmtVal,"value",f);this.displayPrefixContainer()},displayPrefixContainer:function(){switch(this.ct){case "DD":case "DDM":case "DMS":n.set(this.prefixContainer,{display:""});break;default:n.set(this.prefixContainer,{display:"none"})}}})})},"jimu/dijit/_CoordinateControlConfirmNotation":function(){define("dojo/_base/declare dojo/_base/Deferred dojo/_base/lang dojo/dom-construct dojo/dom-class dojo/aspect dojo/keys dojo/query dijit/Dialog dijit/form/Select dojo/_base/lang".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e){return H([c],{baseClass:"jimu-coordinate-control",numberOfInputs:0,selectOptions:{},comboOptions:{},dfd:null,constructor:function(g){e.mixin(this,g);this.numberOfInputs=g.options.length;this.selectOptions=g.options},postCreate:function(){this.inherited("postCreate",arguments);this.closable=!1;this.closeButtonNode.style.display="none";"DartTheme"===this.theme&&m.add(this.containerNode,"coordinateControlDialog");this.message=q.create("div",{style:"margin-bottom: 5px"},
this.containerNode,"first");this.message.innerHTML=this.numberOfInputs+" "+this.nls.multipleNotationLabel;this.comboOptions=new f({style:{width:"99%"},"aria-label":this.numberOfInputs+" "+this.nls.multipleNotationLabel},q.create("div",{},this.containerNode,"last"));this.own(l.after(this.comboOptions,"onChange",n.hitch(this,this._onComboOptionsChanged)));for(var g=0;g<this.selectOptions.length;g++)this.comboOptions.addOption({value:this.selectOptions[g].name,label:this.selectOptions[g].notationType});
this.buttonDiv=q.create("div",{"class":"buttonContainer",style:"margin-top:10px;"+(window.isRTL?"text-align:left":"text-align:right")},this.containerNode,"last");this.okButton=q.create("div",{innerHTML:this.nls.applyButtonLabel,"class":"jimu-btn",role:"button",tabindex:"0","aria-label":this.nls.applyButtonLabel,onclick:e.hitch(this,function(){this.hide();this.dfd.resolve()}),onkeypress:e.hitch(this,function(d){if(d.keyCode===b.ENTER||d.keyCode===b.SPACE)this.hide(),this.dfd.resolve()})},this.buttonDiv,
"first");this.cancelButton=q.create("div",{innerHTML:this.nls.cancelButtonLabel,"class":"jimu-btn",style:"margin: 0 5px 0 5px",role:"button",tabindex:"0","aria-label":this.nls.cancelButtonLabel,onclick:e.hitch(this,function(){this.hide();this.dfd.cancel()}),onkeypress:e.hitch(this,function(d){if(d.keyCode===b.ENTER||d.keyCode===b.SPACE)this.hide(),this.dfd.cancel()})},this.buttonDiv,"last")},show:function(){this.inherited("show",arguments);this.dfd=new k;var g=this._getDOMElement(".dijitSelectLabel",
this.comboOptions.domNode);g&&m.add(g,"dijitSelectLabelConfirmNotation");return this.dfd},_onComboOptionsChanged:function(){var g=this._getDOMElement(".dijitSelectLabel",this.comboOptions.domNode);g&&m.add(g,"dijitSelectLabelConfirmNotation")},_getDOMElement:function(g,d){return(g=a(g,d))&&1===g.length?g[0]:null}})})},"dijit/form/Textarea":function(){define(["dojo/_base/declare","dojo/dom-style","./_ExpandingTextAreaMixin","./SimpleTextarea"],function(H,k,n,q){return H("dijit.form.Textarea",[q,n],
{baseClass:"dijitTextBox dijitTextArea dijitExpandingTextArea",cols:"",buildRendering:function(){this.inherited(arguments);k.set(this.textbox,{overflowY:"hidden",overflowX:"auto",boxSizing:"border-box",MsBoxSizing:"border-box",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box"})}})})},"dijit/form/_ExpandingTextAreaMixin":function(){define("dojo/_base/declare dojo/dom-construct dojo/has dojo/_base/lang dojo/on dojo/_base/window ../Viewport".split(" "),function(H,k,n,q,m,l,b){n.add("textarea-needs-help-shrinking",
function(){var a=l.body(),c=k.create("textarea",{rows:"5",cols:"20",value:" ",style:{zoom:1,fontSize:"12px",height:"96px",overflow:"hidden",visibility:"hidden",position:"absolute",border:"5px solid white",margin:"0",padding:"0",boxSizing:"border-box",MsBoxSizing:"border-box",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box"}},a,"last"),f=c.scrollHeight>=c.clientHeight;a.removeChild(c);return f});return H("dijit.form._ExpandingTextAreaMixin",null,{_setValueAttr:function(){this.inherited(arguments);
this.resize()},postCreate:function(){this.inherited(arguments);var a=this.textbox;a.style.overflowY="hidden";this.own(m(a,"focus, resize",q.hitch(this,"_resizeLater")))},startup:function(){this.inherited(arguments);this.own(b.on("resize",q.hitch(this,"_resizeLater")));this._resizeLater()},_onInput:function(a){this.inherited(arguments);this.resize()},_estimateHeight:function(){var a=this.textbox;a.rows=(a.value.match(/\n/g)||[]).length+1},_resizeLater:function(){this.defer("resize")},resize:function(){function a(){var t=
!1;""===c.value&&(c.value=" ",t=!0);var w=c.scrollHeight;t&&(c.value="");return w}var c=this.textbox;"hidden"==c.style.overflowY&&(c.scrollTop=0);if(!this.busyResizing){this.busyResizing=!0;if(a()||c.offsetHeight){var f=a()+Math.max(c.offsetHeight-c.clientHeight,0),e=f+"px";e!=c.style.height&&(c.style.height=e,c.rows=1);if(n("textarea-needs-help-shrinking")){var g=a(),d=c.style.minHeight,h=4,p=c.scrollTop;c.style.minHeight=e;for(c.style.height="auto";0<f;){c.style.minHeight=Math.max(f-h,4)+"px";e=
a();g-=e;f-=g;if(g<h)break;g=e;h<<=1}c.style.height=f+"px";c.style.minHeight=d;c.scrollTop=p}c.style.overflowY=a()>c.clientHeight?"auto":"hidden";"hidden"==c.style.overflowY&&(c.scrollTop=0)}else this._estimateHeight();this.busyResizing=!1}}})})},"dijit/InlineEditBox":function(){define("require dojo/_base/array dojo/aspect dojo/_base/declare dojo/dom-attr dojo/dom-class dojo/dom-construct dojo/dom-style dojo/i18n dojo/_base/kernel dojo/keys dojo/_base/lang dojo/on dojo/sniff dojo/when ./a11yclick ./focus ./_Widget ./_TemplatedMixin ./_WidgetsInTemplateMixin ./_Container ./form/Button ./form/_TextBoxMixin ./form/TextBox dojo/text!./templates/InlineEditBox.html dojo/i18n!./nls/common".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G,x,v){r=q("dijit._InlineEditor",[u,r,y],{templateString:v,contextRequire:H,postMixInProperties:function(){this.inherited(arguments);this.messages=c.getLocalization("dijit","common",this.lang);k.forEach(["buttonSave","buttonCancel"],function(z){this[z]||(this[z]=this.messages[z])},this)},buildRendering:function(){this.inherited(arguments);var z="string"==typeof this.editor?g.getObject(this.editor)||H(this.editor):this.editor,A=this.sourceStyle,
F="line-height:"+A.lineHeight+";",J=a.getComputedStyle(this.domNode);k.forEach(["Weight","Family","Size","Style"],function(P){J["font"+P]!=A["font"+P]&&(F+="font-"+P+":"+A["font"+P]+";")},this);k.forEach("marginTop marginBottom marginLeft marginRight position left top right bottom float clear display".split(" "),function(P){this.domNode.style[P]=A[P]},this);var L=this.inlineEditBox.width;"100%"==L?(F+="width:100%;",this.domNode.style.display="block"):F+="width:"+(L+(Number(L)==L?"px":""))+";";L=g.delegate(this.inlineEditBox.editorParams,
{style:F,dir:this.dir,lang:this.lang,textDir:this.textDir});this.editWidget=new z(L,this.editorPlaceholder);this.inlineEditBox.autoSave&&(this.saveButton.destroy(),this.cancelButton.destroy(),this.saveButton=this.cancelButton=null,b.destroy(this.buttonContainer))},postCreate:function(){this.inherited(arguments);var z=this.editWidget;this.inlineEditBox.autoSave?this.own(n.after(z,"onChange",g.hitch(this,"_onChange"),!0),d(z,"keydown",g.hitch(this,"_onKeyDown"))):"intermediateChanges"in z&&(z.set("intermediateChanges",
!0),this.own(n.after(z,"onChange",g.hitch(this,"_onIntermediateChange"),!0)),this.saveButton.set("disabled",!0))},startup:function(){this.editWidget.startup();this.inherited(arguments)},_onIntermediateChange:function(){this.saveButton.set("disabled",this.getValue()==this._resetValue||!this.enableSave())},destroy:function(){this.editWidget.destroy(!0);this.inherited(arguments)},getValue:function(){var z=this.editWidget;return String(z.get("displayedValue"in z||"_getDisplayedValueAttr"in z?"displayedValue":
"value"))},_onKeyDown:function(z){this.inlineEditBox.autoSave&&this.inlineEditBox.editing&&!z.altKey&&!z.ctrlKey&&(z.keyCode==e.ESCAPE?(z.stopPropagation(),z.preventDefault(),this.cancel(!0)):z.keyCode==e.ENTER&&"INPUT"==z.target.tagName&&(z.stopPropagation(),z.preventDefault(),this._onChange()))},_onBlur:function(){this.inherited(arguments);this.inlineEditBox.autoSave&&this.inlineEditBox.editing&&(this.getValue()==this._resetValue?this.cancel(!1):this.enableSave()&&this.save(!1))},_onChange:function(){this.inlineEditBox.autoSave&&
this.inlineEditBox.editing&&this.enableSave()&&w.focus(this.inlineEditBox.displayNode)},enableSave:function(){return this.editWidget.isValid?this.editWidget.isValid():!0},focus:function(){this.editWidget.focus();this.editWidget.focusNode&&(w._onFocusNode(this.editWidget.focusNode),"INPUT"==this.editWidget.focusNode.tagName&&this.defer(function(){G.selectInputText(this.editWidget.focusNode)}))}});u=q("dijit.InlineEditBox"+(h("dojo-bidi")?"_NoBidi":""),u,{editing:!1,autoSave:!0,buttonSave:"",buttonCancel:"",
renderAsHtml:!1,editor:x,editorWrapper:r,editorParams:{},disabled:!1,onChange:function(){},onCancel:function(){},width:"100%",value:"",noValueIndicator:6>=h("ie")?"\x3cspan style\x3d'font-family: wingdings; text-decoration: underline;'\x3e\x26#160;\x26#160;\x26#160;\x26#160;\x26#x270d;\x26#160;\x26#160;\x26#160;\x26#160;\x3c/span\x3e":"\x3cspan style\x3d'text-decoration: underline;'\x3e\x26#160;\x26#160;\x26#160;\x26#160;\x26#x270d;\x26#160;\x26#160;\x26#160;\x26#160;\x3c/span\x3e",constructor:function(){this.editorParams=
{}},postMixInProperties:function(){this.inherited(arguments);this.displayNode=this.srcNodeRef;this.own(d(this.displayNode,t,g.hitch(this,"_onClick")),d(this.displayNode,"mouseover, focus",g.hitch(this,"_onMouseOver")),d(this.displayNode,"mouseout, blur",g.hitch(this,"_onMouseOut")));this.displayNode.setAttribute("role","button");this.displayNode.getAttribute("tabIndex")||this.displayNode.setAttribute("tabIndex",0);this.value||"value"in this.params||(this.value=g.trim(this.renderAsHtml?this.displayNode.innerHTML:
this.displayNode.innerText||this.displayNode.textContent||""));this.value||(this.displayNode.innerHTML=this.noValueIndicator);l.add(this.displayNode,"dijitInlineEditBoxDisplayMode")},setDisabled:function(z){f.deprecated("dijit.InlineEditBox.setDisabled() is deprecated.  Use set('disabled', bool) instead.","","2.0");this.set("disabled",z)},_setDisabledAttr:function(z){this.domNode.setAttribute("aria-disabled",z?"true":"false");z?this.displayNode.removeAttribute("tabIndex"):this.displayNode.setAttribute("tabIndex",
0);l.toggle(this.displayNode,"dijitInlineEditBoxDisplayModeDisabled",z);this._set("disabled",z)},_onMouseOver:function(){this.disabled||l.add(this.displayNode,"dijitInlineEditBoxDisplayModeHover")},_onMouseOut:function(){l.remove(this.displayNode,"dijitInlineEditBoxDisplayModeHover")},_onClick:function(z){this.disabled||(z&&(z.stopPropagation(),z.preventDefault()),this._onMouseOut(),this.defer("edit"))},edit:function(){if(!this.disabled&&!this.editing){this._set("editing",!0);this._savedTabIndex=
m.get(this.displayNode,"tabIndex")||"0";if(!this.wrapperWidget){var z=b.create("span",null,this.domNode,"before");this.wrapperWidget=new ("string"==typeof this.editorWrapper?g.getObject(this.editorWrapper):this.editorWrapper)({value:this.value,buttonSave:this.buttonSave,buttonCancel:this.buttonCancel,dir:this.dir,lang:this.lang,tabIndex:this._savedTabIndex,editor:this.editor,inlineEditBox:this,sourceStyle:a.getComputedStyle(this.displayNode),save:g.hitch(this,"save"),cancel:g.hitch(this,"cancel"),
textDir:this.textDir},z);this.wrapperWidget._started||this.wrapperWidget.startup();this._started||this.startup()}var A=this.wrapperWidget;l.add(this.displayNode,"dijitOffScreen");l.remove(A.domNode,"dijitOffScreen");a.set(A.domNode,{visibility:"visible"});m.set(this.displayNode,"tabIndex","-1");var F=A.editWidget,J=this;p(F.onLoadDeferred,g.hitch(A,function(){F.set("displayedValue"in F||"_setDisplayedValueAttr"in F?"displayedValue":"value",J.value);this.defer(function(){A.saveButton&&A.saveButton.set("disabled",
"intermediateChanges"in F);this.focus();this._resetValue=this.getValue()})}))}},_onBlur:function(){this.inherited(arguments)},destroy:function(){this.wrapperWidget&&!this.wrapperWidget._destroyed&&(this.wrapperWidget.destroy(),delete this.wrapperWidget);this.inherited(arguments)},_showText:function(z){var A=this.wrapperWidget;a.set(A.domNode,{visibility:"hidden"});l.add(A.domNode,"dijitOffScreen");l.remove(this.displayNode,"dijitOffScreen");m.set(this.displayNode,"tabIndex",this._savedTabIndex);z&&
w.focus(this.displayNode)},save:function(z){if(!this.disabled&&this.editing){this._set("editing",!1);var A=this.wrapperWidget.getValue();this.set("value",A);this._showText(z)}},setValue:function(z){f.deprecated("dijit.InlineEditBox.setValue() is deprecated.  Use set('value', ...) instead.","","2.0");return this.set("value",z)},_setValueAttr:function(z){z=g.trim(z);var A=this.renderAsHtml?z:z.replace(/&/gm,"\x26amp;").replace(/</gm,"\x26lt;").replace(/>/gm,"\x26gt;").replace(/"/gm,"\x26quot;").replace(/\n/g,
"\x3cbr\x3e");this.displayNode.innerHTML=this.editorParams&&"password"===this.editorParams.type?"********":A||this.noValueIndicator;this._set("value",z);this._started&&this.defer(function(){this.onChange(z)})},getValue:function(){f.deprecated("dijit.InlineEditBox.getValue() is deprecated.  Use get('value') instead.","","2.0");return this.get("value")},cancel:function(z){!this.disabled&&this.editing&&(this._set("editing",!1),this.defer("onCancel"),this._showText(z))}});h("dojo-bidi")&&(u=q("dijit.InlineEditBox",
u,{_setValueAttr:function(){this.inherited(arguments);this.applyTextDir(this.displayNode)}}));u._InlineEditor=r;return u})},"widgets/Visibility/js/util":function(){define(["dojo/_base/declare","dojo/_base/array","dojo/_base/Deferred","esri/tasks/GeometryService"],function(H,k,n,q){return H(null,{constructor:function(m){this.appConfig=m.appConfig;this.nls=m.nls;(m=this.appConfig.geometryService)||(m="//utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer");this.geomService=new q(m)},
getCleanInput:function(m){m=m.replace(/\n/g,"");m=m.replace(/\s+/g," ").trim();return m.toUpperCase()},getCoordValues:function(m,l,b){var a=new n;m={sr:4326,coordinates:[[m.x,m.y]],conversionType:l.name?l.name:l,numOfDigits:b||6,rounding:!0,addSpaces:!1};switch(l){case "DD":m.numOfDigits=6;break;case "USNG":m.numOfDigits=5;break;case "MGRS":m.conversionMode="mgrsDefault";m.numOfDigits=5;break;case "UTM (H)":m.conversionType="utm";m.conversionMode="utmNorthSouth";m.addSpaces=!0;break;case "UTM":m.conversionType=
"utm";m.conversionMode="utmDefault";m.addSpaces=!0;break;case "GARS":m.conversionMode="garsDefault"}this.geomService.toGeoCoordinateString(m).then(function(c){a.resolve(c)},function(){a.resolve(null)});return a.promise},getXYNotation:function(m,l){var b=new n;var a=l.name?l.name:l;l={sr:4326,conversionType:a,strings:[]};switch(a){case "DD":case "DDM":case "DMS":l.numOfDigits=2;m=m.replace(/[\u00b0\u02da\u00ba^~*"'\u2032\u00a8\u02dd]/g,"");l.strings.push(m);break;case "USNG":l.strings.push(m);l.addSpaces=
"false";break;case "MGRS":l.conversionMode="mgrsNewStyle";l.strings.push(m);l.addSpaces="false";break;case "UTM (H)":l.conversionType="utm";l.conversionMode="utmNorthSouth";l.strings.push(m);break;case "UTM":l.conversionType="utm";l.conversionMode="utmDefault";l.strings.push(m);break;case "GARS":l.conversionMode="garsCenter";l.strings.push(m);break;case "GEOREF":l.strings.push(m)}this.geomService.fromGeoCoordinateString(l).then(function(c){b.resolve(c)},function(){b.resolve(null)});return b.promise},
getNotations:function(){return[{name:"DD",pattern:new RegExp([/^(([NS\+\-\s])*([0-8]?\d([,.]\d*)?|90([,.]0*)?)([\u00b0\u02da\u00ba^~*]*)([NS\+\-\s])*)([,:;\s|\/\\]+)/,/(([EW\+\-\s])*([0]?\d?\d([,.]\d*)?|1[0-7]\d([,.]\d*)?|180([,.]0*)?)([\u00b0\u02da\u00ba^~*]*)([EW\+\-\s])*)$/].map(function(m){return m.source}).join("")),notationType:this.nls.DDLatLongNotation,conversionType:"DD"},{name:"DDrev",pattern:new RegExp([/^(([EW\+\-\s])*([0]?\d?\d([,.]\d*)?|1[0-7]\d([,.]\d*)?|180([,.]0*)?)([\u00b0\u02da\u00ba^~*]*)([EW\+\-\s])*)/,
/([,:;\s|\/\\]+)(([NS\+\-\s])*([0-8]?\d([,.]\d*)?|90([,.]0*)?)([\u00b0\u02da\u00ba^~*]*)([NS\+\-\s])*)$/].map(function(m){return m.source}).join("")),notationType:this.nls.DDLongLatNotation,conversionType:"DD"},{name:"DDM",pattern:new RegExp([/^(([NS\+\-\s])*([0-8]?\d|90)[\u00b0\u02da\u00ba^~*\s\-_]+(([0-5]?\d|\d)([,.]\d*)?)['\u2032\s_]*([NS\+\-\s])*)/,/([,:;\s|\/\\]+)/,/(([EW\+\-\s])*([0]?\d?\d|1[0-7]\d|180)[\u00b0\u02da\u00ba^~*\s\-_]+(([0-5]\d|\d)([,.]\d*)?)['\u2032\s_]*([EW\+\-\s])*)/,/[\s]*$/].map(function(m){return m.source}).join("")),
notationType:this.nls.DDMLatLongNotation,conversionType:"DDM"},{name:"DDMrev",pattern:new RegExp([/^(([EW\+\-\s])*([0]?\d?\d|1[0-7]\d|180)[\u00b0\u02da\u00ba^~*\s\-_]+(([0-5]\d|\d)([,.]\d*)?)['\u2032\s_]*([EW\+\-\s])*)/,/([,:;\s|\/\\]+)/,/(([NS\+\-\s])*([0-8]?\d|90)[\u00b0\u02da\u00ba^~*\s\-_]+(([0-5]?\d|\d)([,.]\d*)?)['\u2032\s_]*([NS\+\-\s])*)[\s]*$/].map(function(m){return m.source}).join("")),notationType:this.nls.DDMLongLatNotation,conversionType:"DDM"},{name:"DMS",pattern:new RegExp([/^(([NS\+\-\s])*([0-8]?\d|90)[\u00b0\u02da\u00ba^~*\s\-_]+([0-5]?\d|\d)['\u2032\s\-_]+(([0-5]?\d|\d)([,.]\d*)?)["\u00a8\u02dd\s_]*([NS\+\-\s])*)/,
/([,:;\s|\/\\]+)/,/(([EW\+\-\s])*([0]?\d?\d|1[0-7]\d|180)[\u00b0\u02da\u00ba^~*\s\-_]+([0-5]\d|\d)['\u2032\s\-_]+(([0-5]?\d|\d)([,.]\d*)?)["\u00a8\u02dd\s_]*([EW\+\-\s])*)[\s]*$/].map(function(m){return m.source}).join("")),notationType:this.nls.DMSLatLongNotation,conversionType:"DMS"},{name:"DMSrev",pattern:new RegExp([/^(([EW\+\-\s])*([0]?\d?\d|1[0-7]\d|180)[\u00b0\u02da\u00ba^~*\s\-_]+([0-5]\d|\d)['\u2032\s\-_]+(([0-5]?\d|\d)([,.]\d*)?)["\u00a8\u02dd\s_]*([EW\+\-\s])*)/,/([,:;\s|\/\\]+)/,/(([NS\+\-\s])*([0-8]?\d|90)[\u00b0\u02da\u00ba^~*\s\-_]+([0-5]?\d|\d)['\u2032\s\-_]+(([0-5]?\d|\d)([,.]\d*)?)["\u00a8\u02dd\s_]*([NS\+\-\s])*)[\s]*$/].map(function(m){return m.source}).join("")),
notationType:this.nls.DMSLongLatNotation,conversionType:"DMS"},{name:"GARS",pattern:/^\d{3}[a-zA-Z]{2}[1-4]?[1-9]?$/,notationType:this.nls.GARSNotation,conversionType:"GARS"},{name:"GEOREF",pattern:/^[a-zA-Z]{4}\d{1,8}$/,notationType:this.nls.GEOREFNotation,conversionType:"GEOREF"},{name:"MGRS",pattern:new RegExp([/^\d{1,2}[-,;:\s]*[C-HJ-NP-X][-,;:\s]*[A-HJ-NP-Z]{2}[-,;:\s]*/,/(\d[-,;:\s]+\d|\d{2}[-,;:\s]+\d{2}|\d{3}[-,;:\s]+\d{3}|\d{4}[-,;:\s]+\d{4}|\d{5}[-,;:\s]+\d{5})/,/$|^(\d{1,2}[-,;:\s]*[C-HJ-NP-X][-,;:\s]*[A-HJ-NP-Z]{2}[-,;:\s]*)/,
/(\d{2}|\d{4}|\d{6}|\d{8}|\d{10})?$|^[ABYZ][-,;:\s]*[A-HJ-NP-Z]{2}[-,;:\s]*/,/(\d[-,;:\s]+\d|\d{2}[-,;:\s]+\d{2}|\d{3}[-,;:\s]+\d{3}|\d{4}[-,;:\s]+\d{4}|\d{5}[-,;:\s]+\d{5})/,/$|^[ABYZ][-,;:\s]*[A-HJ-NP-Z]{2}[-,;:\s]*(\d{2}|\d{4}|\d{6}|\d{8}|\d{10})?$/].map(function(m){return m.source}).join("")),notationType:this.nls.MGRSNotation,conversionType:"MGRS"},{name:"UTM",pattern:new RegExp([/^\d{1,2}[-,;:\s]*[c-hj-np-xC-HJ-NP-X][-,;:\s]*\d{1,6}\.?\d*[mM]?[-,;:\s]?\d{1,7}\.?\d*[mM]?$/].map(function(m){return m.source}).join("")),
notationType:this.nls.UTMBandNotation,conversionType:"UTM"},{name:"UTM (H)",pattern:new RegExp([/^\d{1,2}[-,;:\s]*[NnSs][-,;:\s]*\d{1,6}\.?\d*[mM]?[-,;:\s]+\d{1,7}\.?\d*[mM]?$/].map(function(m){return m.source}).join("")),notationType:this.nls.UTMHemNotation,conversionType:"UTM (H)"}]},getCoordinateType:function(m){var l=this.getCleanInput(m);m=new n;var b=this.getNotations();l=k.filter(b,function(a){return a.pattern.test(this.v)},{v:l});0<l.length?m.resolve(l):m.resolve(null);return m.promise},getFormattedDDStr:function(m,
l,b){var a={};a.sourceValue=m;a.sourceFormatString=l;m=m[0].split(/[ ,]+/);a.latdeg=m[0].replace(/[nNsS]/,"");a.londeg=m[1].replace(/[eEwW]/,"");b&&(a.latdeg="N"===m[0].slice(-1)?"+"+a.latdeg:"-"+a.latdeg,a.londeg="W"===m[1].slice(-1)?"-"+a.londeg:"+"+a.londeg);l=l.replace(/X/,a.londeg);l=l.replace(/[eEwW]/,m[1].slice(-1));l=l.replace(/[nNsS]/,m[0].slice(-1));l=l.replace(/Y/,a.latdeg);a.formatResult=l;return a},getFormattedDDMStr:function(m,l,b){var a={};a.sourceValue=m;a.sourceFormatString=l;a.parts=
m[0].split(/[ ,]+/);a.latdeg=a.parts[0];a.latmin=a.parts[1].replace(/[nNsS]/,"");a.londeg=a.parts[2];a.lonmin=a.parts[3].replace(/[eEwW]/,"");b&&(a.latdeg="N"===a.parts[1].slice(-1)?"+"+a.latdeg:"-"+a.latdeg,a.londeg="W"===a.parts[3].slice(-1)?"-"+a.londeg:"+"+a.londeg);m=l.replace(/[EeWw]/,a.parts[3].slice(-1));m=m.replace(/Y/,a.lonmin);m=m.replace(/X/,a.londeg);m=m.replace(/[NnSs]/,a.parts[1].slice(-1));m=m.replace(/B/,a.latmin);m=m.replace(/A/,a.latdeg);a.formatResult=m;return a},getFormattedDMSStr:function(m,
l,b){var a={};a.sourceValue=m;a.sourceFormatString=l;a.parts=m[0].split(/[ ,]+/);a.latdeg=a.parts[0];a.latmin=a.parts[1];a.latsec=a.parts[2].replace(/[NnSs]/,"");a.londeg=a.parts[3];a.lonmin=a.parts[4];a.lonsec=a.parts[5].replace(/[EWew]/,"");b&&(a.latdeg="N"===a.parts[2].slice(-1)?"+"+a.latdeg:"-"+a.latdeg,a.londeg="W"===a.parts[5].slice(-1)?"-"+a.londeg:"+"+a.londeg);m=l.replace(/A/,a.latdeg);m=m.replace(/B/,a.latmin);m=m.replace(/C/,a.latsec);m=m.replace(/X/,a.londeg);m=m.replace(/Y/,a.lonmin);
m=m.replace(/Z/,a.lonsec);m=m.replace(/[NnSs]/,a.parts[2].slice(-1));m=m.replace(/[EeWw]/,a.parts[5].slice(-1));a.formatResult=m;return a},getFormattedUSNGStr:function(m,l){var b={};b.sourceValue=m;b.sourceFormatString=l;m[0].match(/^[ABYZ]/)?b.gzd=m[0].match(/[ABYZ]/)[0].trim():b.gzd=m[0].match(/\d{1,2}[C-HJ-NP-X]/)[0].trim();b.grdsq=m[0].replace(b.gzd,"").match(/[a-hJ-zA-HJ-Z]{2}/)[0].trim();b.easting=m[0].replace(b.gzd+b.grdsq,"").match(/^\d{1,5}/)[0].trim();b.northing=m[0].replace(b.gzd+b.grdsq,
"").match(/\d{1,5}$/)[0].trim();m=l.replace(/Y/,b.northing);m=m.replace(/X/,b.easting);m=m.replace(/S/,b.grdsq);m=m.replace(/Z/,b.gzd);b.formatResult=m;return b},getFormattedMGRSStr:function(m,l){var b={};b.sourceValue=m;b.sourceFormatString=l;m[0].match(/^[ABYZ]/)?b.gzd=m[0].match(/[ABYZ]/)[0].trim():b.gzd=m[0].match(/\d{1,2}[C-HJ-NP-X]/)[0].trim();b.grdsq=m[0].replace(b.gzd,"").match(/[a-hJ-zA-HJ-Z]{2}/)[0].trim();b.easting=m[0].replace(b.gzd+b.grdsq,"").match(/^\d{1,5}/)[0].trim();b.northing=m[0].replace(b.gzd+
b.grdsq,"").match(/\d{1,5}$/)[0].trim();m=l.replace(/Y/,b.northing);m=m.replace(/X/,b.easting);m=m.replace(/S/,b.grdsq);m=m.replace(/Z/,b.gzd);b.formatResult=m;return b},getFormattedGARSStr:function(m,l){var b={};b.sourceValue=m;b.sourceFormatString=l;b.lon=m[0].match(/\d{3}/);b.lat=m[0].match(/[a-zA-Z]{2}/);m=m[0].match(/\d*$/);b.quadrant=m[0][0];b.key=m[0][1];l=l.replace(/K/,b.key);l=l.replace(/Q/,b.quadrant);l=l.replace(/Y/,b.lat);l=l.replace(/X/,b.lon);b.formatResult=l;return b},getFormattedGEOREFStr:function(m,
l){var b={};b.sourceValue=m;b.sourceFormatString=l;b.lon=m[0].match(/[a-zA-Z]{1}/)[0].trim();b.lat=m[0].replace(b.lon,"").match(/[a-zA-Z]{1}/)[0].trim();b.quadrant15lon=m[0].replace(b.lon+b.lat,"").match(/[a-zA-Z]{1}/)[0].trim();b.quadrant15lat=m[0].replace(b.lon+b.lat+b.quadrant15lon,"").match(/[a-zA-Z]{1}/)[0].trim();m=m[0].replace(b.lon+b.lat+b.quadrant15lon+b.quadrant15lat,"");b.quadrant1lon=m.substr(0,m.length/2);b.quadrant1lat=m.substr(m.length/2,m.length);l=l.replace(/Y/,b.quadrant1lat);l=
l.replace(/X/,b.quadrant1lon);l=l.replace(/D/,b.quadrant15lat);l=l.replace(/C/,b.quadrant15lon);l=l.replace(/B/,b.lat);l=l.replace(/A/,b.lon);b.formatResult=l;return b},getFormattedUTMStr:function(m,l){var b={};b.sourceValue=m;b.sourceFormatString=l;b.parts=m[0].split(/[ ,]+/);b.zone=b.parts[0].replace(/[A-Z]/,"");b.bandLetter=b.parts[0].slice(-1);b.easting=b.parts[1];b.westing=b.parts[2];m=l.replace(/Y/,b.westing);m=m.replace(/X/,b.easting);m=m.replace(/B/,b.bandLetter);m=m.replace(/Z/,b.zone);b.formatResult=
m;return b},getFormattedUTMHStr:function(m,l){var b={};b.sourceValue=m;b.sourceFormatString=l;b.parts=m[0].split(/[ ,]+/);b.zone=b.parts[0].replace(/[A-Z]/,"");b.hemisphere=b.parts[0].slice(-1);b.easting=b.parts[1];b.westing=b.parts[2];m=l.replace(/Y/,b.westing);m=m.replace(/X/,b.easting);m=m.replace(/H/,b.hemisphere);m=m.replace(/Z/,b.zone);b.formatResult=m;return b},convertMetersToUnits:function(m,l){var b=0;switch(l.toLowerCase()){case "meters":b=m;break;case "feet":b=3.28084*m;break;case "kilometers":b=
.001*m;break;case "miles":b=6.21371E-4*m;break;case "nauticalMiles":b=5.39957E-4*m;break;case "yards":b=1.09361*m}return b},convertToMeters:function(m,l){var b=m;switch(l){case "meters":b=m;break;case "feet":b=.3048*m;break;case "kilometers":b=1E3*m;break;case "miles":b=1609.34*m;break;case "nauticalMiles":b=1852.001376036*m;break;case "yards":b=.9144*m}return b}})})},"widgets/Visibility/js/portal-publish":function(){define("dojo/_base/declare jimu/BaseWidget dijit/_WidgetsInTemplateMixin jimu/dijit/CheckBox dojo/_base/array dojo/_base/lang dojo/json dojo/text!../templates/portal-publish.html dojo/dom-construct dojo/on dojo/dom-class dojo/dom-style esri/arcgis/Portal dojo/Evented ./portal-utils jimu/LayerInfos/LayerInfos esri/layers/FeatureLayer esri/graphic esri/dijit/util/busyIndicator jimu/utils dojo/keys dijit/focus dojo/query dojo/topic dijit/form/ValidationTextBox jimu/dijit/formSelect".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u,r,y,B,C,G,x){return H([k,n,h],{templateString:a,baseClass:"jimu-widget-visibility-publish",publishNewLayer:null,busyIndicator:null,fieldsObj:null,postCreate:function(){String.prototype.format||(String.prototype.format=function(){var v=arguments;return this.replace(/{(\d+)}/g,function(z,A){return"undefined"!==typeof v[A]?v[A]:z})});this.fieldsObj={RegionType:{value:"",dataType:"esriFieldTypeInteger"},CenterPoint:{value:this.centerPoint,dataType:"esriFieldTypeString"},
ObservationHeight:{value:this.observerHeight,dataType:"esriFieldTypeDouble"},HeightUnit:{value:this.observerHeightDD,dataType:"esriFieldTypeString"},MinObservationDistance:{value:this.minObsRange,dataType:"esriFieldTypeDouble"},MaxObservationDistance:{value:this.maxObsRange,dataType:"esriFieldTypeDouble"},DistanceUnit:{value:this.distanceUnitDD,dataType:"esriFieldTypeString"},FOVStartAngle:{value:this.fovStartAngle,dataType:"esriFieldTypeDouble"},FOVEndAngle:{value:this.fovEndAngle,dataType:"esriFieldTypeDouble"},
AngleUnits:{value:this.angleUnits,dataType:"esriFieldTypeString"}};this.fields={RegionType:"",CenterPoint:this.centerPoint,ObservationHeight:this.observerHeight,HeightUnit:this.observerHeightDD,MinObservationDistance:this.minObsRange,MaxObservationDistance:this.maxObsRange,DistanceUnit:this.distanceUnitDD,FOVStartAngle:this.fovStartAngle,FOVEndAngle:this.fovEndAngle,AngleUnits:this.angleUnits};this.publishNewLayer=new q({checked:!1,label:this.nls.publishToNewLayer},c.create("div",{},this.checkBoxParentContainer));
this.own(f(this.publishNewLayer,"change",l.hitch(this,this._onCheckboxClicked)));this._populateSelectList(this.featureLayerList,this._layerList,!0);0===this.featureLayerList.options.length&&(this.publishNewLayer.setValue(!0),e.add(this.checkBoxParentContainer,"esriCTHidden"));!this.config.hasOwnProperty("operationalLayer")||this.config.hasOwnProperty("operationalLayer")&&this.config.operationalLayer.hasOwnProperty("name")&&""===this.config.operationalLayer.name?(e.add(this.featureLayerList.domNode,
"esriCTHidden"),this.publishNewLayer.setValue(!0),e.remove(this.addLayerNameArea.domNode,"esriCTHidden")):(e.remove(this.featureLayerList.domNode,"esriCTHidden"),this.publishNewLayer.setValue(!1),e.add(this.addLayerNameArea.domNode,"esriCTHidden"));this.own(f(this.resultsPanelBackButton,"click",l.hitch(this,function(){this.emit("displayMainPageOnBack")})));this.own(f(this.resultsPanelBackButton,"keydown",l.hitch(this,function(v){v.keyCode!==B.ENTER&&v.keyCode!==B.SPACE||this.emit("displayMainPageOnBack")})));
this.own(f(this.publishButton,"click",l.hitch(this,function(){if(this.publishNewLayer.checked&&!this.addLayerNameArea.isValid())this.publishMessage.innerHTML=this.nls.missingLayerNameMessage;else{this.publishMessage.innerHTML="";var v={layerName:this.publishNewLayer.checked?this.addLayerNameArea.value:this.featureLayerList.getValue(),url:"",itemId:"",serviceItemId:""};if(!this.publishNewLayer.checked){var z=this._layerList.filter(function(A){return A.name===v.layerName},this);1===z.length&&(v.url=
z[0].url,v.itemId=z[0].id,v.serviceItemId=b.parse(z[0]._json).serviceItemId)}this._initSaveToPortal(v)}})));this.own(f(this.publishButton,"keydown",l.hitch(this,function(v){if(v.keyCode===B.ENTER||v.keyCode===B.SPACE)if(this.publishNewLayer.checked&&!this.addLayerNameArea.isValid())this.publishMessage.innerHTML=this.nls.missingLayerNameMessage,this._setFirstLastFocusNodes();else{this.publishMessage.innerHTML="";var z={layerName:this.publishNewLayer.checked?this.addLayerNameArea.value:this.featureLayerList.getValue(),
url:"",itemId:"",serviceItemId:"",map:this.map,appConfig:this.appConfig,renderer:this._renderer,publishMessage:this.publishMessage,nls:this.nls,graphics:this.ThreatArea.graphics};this.publishNewLayer.checked||(v=this._layerList.filter(function(A){return A.name===z.layerName},this),1===v.length&&(z.url=v[0].url,z.itemId=v[0].id,z.serviceItemId=b.parse(v[0]._json).serviceItemId));this._initSaveToPortal(z)}})));this.own(x.subscribe("WIDGET_RESIZE",l.hitch(this,this._onWidgetResize)));this.own(f(this.featureLayerList,
"change",l.hitch(this,function(){this._onWidgetResize()})))},startup:function(){this.busyIndicator=r.create({target:this.parentNode.parentNode.parentNode.parentNode,backgroundOpacity:0})},_onWidgetResize:function(){var v=G(".dijitValidationTextBoxLabel",this.featureLayerList.domNode);0<v.length&&g.set(v[0],"width",this.publishButton.clientWidth-53+"px")},_onCheckboxClicked:function(){this.publishNewLayer.checked?(e.add(this.featureLayerList.domNode,"esriCTHidden"),e.remove(this.addLayerNameArea.domNode,
"esriCTHidden"),this.addLayerNameArea.reset(),this.addLayerNameArea.focus()):(e.add(this.addLayerNameArea.domNode,"esriCTHidden"),e.remove(this.featureLayerList.domNode,"esriCTHidden"));this._addLayerToMap=this.publishNewLayer.checked},_containsSupportedCapabilities:function(v){var z=!0;["create","delete","query","update","editing"].forEach(function(A){-1===v.toLowerCase().split(",").indexOf(A)&&(z=!1)});return z},_populateSelectList:function(v,z,A){var F=[];A&&(F=m.filter(z,function(J){return"esriGeometryPolygon"===
J.geometryType},this));z=0<F.length?F:z;m.forEach(z,l.hitch(this,function(J){J.url&&"Feature Layer"===J.type&&this._containsSupportedCapabilities(J.capabilities)&&v.addOption({value:J.name,label:y.sanitizeHTML(J.name),selected:!1,id:J.id})}));this.config.hasOwnProperty("operationalLayer")&&this.config.operationalLayer.hasOwnProperty("name")&&""!==this.config.operationalLayer.name?v.setValue(this.config.operationalLayer.name):v.setValue("")},_toLowerCaseProps:function(v){for(var z,A=Object.keys(v),
F=A.length,J={};F--;)z=A[F],J[z.toLowerCase()]=v[z];return J},_initSaveToPortal:function(v){var z=v.layerName,A=new d.Portal(this.appConfig.portalUrl);this.own(f(A,"load",l.hitch(this,function(){A.signIn().then(l.hitch(this,function(F){var J=F.credential.token,L=F.orgId,P=F.username;if("org_user"===F.role)this.publishMessage.innerHTML=y.sanitizeHTML(this.nls.createService.format(this.nls.userRole)),this._setFirstLastFocusNodes();else if(v.url){F=new w(v.url+"?token\x3d"+J,{id:v.layerName,outFields:["*"]});
F._wabProperties={itemLayerInfo:{portalUrl:this.appConfig.portalUrl,itemId:v.itemId}};this.busyIndicator.show();var Q=[];this.graphics.forEach(function(ca){if(void 0!==ca.attributes&&ca.attributes.hasOwnProperty("type")){var da=l.clone(this.fields);da.RegionType="visible"===ca.attributes.regionType?1:0;da=A.isPortal?this._toLowerCaseProps(da):da;Q.push(new u(ca.geometry,null,da))}},this);F.applyEdits(Q,null,null).then(l.hitch(this,function(){x.publish("moveMap",!1);this.publishMessage.innerHTML=this.nls.successfullyPublished.format('\x3cbr /\x3e\x3ca href\x3d"'+
this.appConfig.portalUrl+"home/item.html?id\x3d"+v.serviceItemId+'" target\x3d"_blank"\x3e')+"\x3c/a\x3e";this._reset()})).otherwise(l.hitch(this,function(ca){this.publishMessage.innerHTML=ca.message;this._reset()}));this.busyIndicator.hide();this._setFirstLastFocusNodes()}else{var Z=this.appConfig.portalUrl+"sharing/content/users/"+P+"/createService";p.isNameAvailable(this.appConfig.portalUrl+"sharing/rest/portals/"+L+"/isServiceNameAvailable",J,z).then(l.hitch(this,function(ca){ca.available?(this.busyIndicator.show(),
p.createFeatureService(Z,J,p.getFeatureServiceParams(z,this.map)).then(l.hitch(this,function(da){if(da.success){var ea=da.serviceurl.replace(/rest/g,"rest/admin")+"/addToDefinition";p.addDefinitionToService(ea,J,p.getLayerParams(z,this.map,this._renderer,this.nls)).then(l.hitch(this,function(fa){if(fa.success){fa=new w(da.serviceurl+"/0?token\x3d"+J,{id:z,outFields:["*"]});fa._wabProperties={itemLayerInfo:{portalUrl:this.appConfig.portalUrl,itemId:da.itemId}};this.map.addLayer(fa);if(fa.loaded){var K=
t.getInstanceSync().getLayerInfoById(z);K.enablePopup()}else fa.on("load",l.hitch(this,function(){K=t.getInstanceSync().getLayerInfoById(z);K.enablePopup()}));var V=[];m.forEach(this.graphics,function(aa){if(void 0!==aa.attributes&&aa.attributes.hasOwnProperty("type")){var Y=l.clone(this.fields);Y.RegionType="visible"===aa.attributes.regionType?1:0;Y=A.isPortal?this._toLowerCaseProps(Y):Y;V.push(new u(aa.geometry,null,Y))}},this);fa.applyEdits(V,null,null).then(l.hitch(this,function(){this._reset()})).otherwise(l.hitch(this,
function(){this._reset()}));this.busyIndicator.hide();this.publishMessage.innerHTML=this.nls.successfullyPublished.format('\x3cbr /\x3e\x3ca role\x3d"link" tabindex\x3d0 aria-label\x3d"'+this.nls.successfullyPublished+'" href\x3d"'+this.appConfig.portalUrl+"home/item.html?id\x3d"+da.itemId+'" target\x3d"_blank"\x3e')+"\x3c/a\x3e";this._setFirstLastFocusNodes()}}),l.hitch(this,function(fa){this.busyIndicator.hide();this.publishMessage.innerHTML=y.sanitizeHTML(this.nls.addToDefinition.format(fa.message));
this._setFirstLastFocusNodes()}))}else this.busyIndicator.hide(),this.publishMessage.innerHTML=y.sanitizeHTML(this.nls.unableToCreate.format(z)),this._setFirstLastFocusNodes()}),l.hitch(this,function(da){this.busyIndicator.hide();this.publishMessage.innerHTML=y.sanitizeHTML(this.nls.createService.format(da.message));this._setFirstLastFocusNodes()}))):(this.busyIndicator.hide(),this.publishMessage.innerHTML=this.nls.layerNameExists)}))}}),l.hitch(this,function(F){this.busyIndicator.hide();this.publishMessage.innerHTML=
F.message;this._setFirstLastFocusNodes()}))})))},_reset:function(){this.graphicsLayer.clear();this.graphics=[];this.graphicsLayer.refresh()},_setFirstLastFocusNodes:function(){y.initFirstFocusNode(this.parentNode,this.resultsPanelBackButton);C.focus(this.resultsPanelBackButton);y.initLastFocusNode(this.parentNode,this.publishButton);var v=G("a",this.publishMessage)[0];""!==this.publishMessage.innerHTML&&v?(y.initLastFocusNode(this.parentNode,this.publishMessage),C.focus(v)):""===this.publishMessage.innerHTML&&
C.focus(this.resultsPanelBackButton)},_matchLayerFields:function(v,z){var A={},F=Object.keys(this.fieldsObj);m.forEach(z,l.hitch(this,function(J){m.forEach(F,l.hitch(this,function(L){if(J.name.toLowerCase()===L.toLowerCase()&&(J.type===this.fieldsObj[L].dataType||"esriFieldTypeString"===J.type)){var P=this.fieldsObj[L].value;"esriFieldTypeString"===J.type&&50>J.length&&"string"===typeof this.fieldsObj[L].value&&(P=this.fieldsObj[L].value.substr(0,J.length));A[J.name]="RegionType"===L?v:P}}))}));return A}})})},
"widgets/Visibility/js/portal-utils":function(){define(["esri/request","dojo/json"],function(H,k){return{getFeatureServiceParams:function(n,q){return{name:n,serviceDescription:"",hasStaticData:!1,maxRecordCount:1E3,supportedQueryFormats:"JSON",capabilities:"Create,Delete,Query,Update,Editing",tags:"GRG",description:"",copyrightText:"",spatialReference:{wkid:102100},initialExtent:{xmin:q.extent.xmin,ymin:q.extent.ymin,xmax:q.extent.xmax,ymax:q.extent.ymax,spatialReference:{wkid:102100}},allowGeometryUpdates:!0,
units:"esriMeters",xssPreventionInfo:{xssPreventionEnabled:!0,xssPreventionRule:"InputOnly",xssInputRule:"rejectInvalid"}}},getLayerParams:function(n,q,m,l){return{layers:[{adminLayerInfo:{geometryField:{name:"Shape"},xssTrustedFields:""},id:0,name:n,type:"Feature Layer",displayField:"",description:"",tags:"GRG",copyrightText:"",defaultVisibility:!0,ownershipBasedAccessControlForFeatures:{allowOthersToQuery:!1,allowOthersToDelete:!1,allowOthersToUpdate:!1},relationships:[],isDataVersioned:!1,supportsCalculate:!0,
supportsAttachmentsByUploadId:!0,supportsRollbackOnFailureParameter:!0,supportsStatistics:!0,supportsAdvancedQueries:!0,supportsValidateSql:!0,supportsCoordinatesQuantization:!0,supportsApplyEditsWithGlobalIds:!0,advancedQueryCapabilities:{supportsPagination:!0,supportsQueryWithDistance:!0,supportsReturningQueryExtent:!0,supportsStatistics:!0,supportsOrderBy:!0,supportsDistinct:!0,supportsQueryWithResultType:!0,supportsSqlExpression:!0,supportsReturningGeometryCentroid:!0},useStandardizedQueries:!1,
geometryType:"esriGeometryPolygon",minScale:0,maxScale:0,extent:q.extent,drawingInfo:{renderer:m.toJson(),transparency:0},allowGeometryUpdates:!0,hasAttachments:!1,htmlPopupType:"esriServerHTMLPopupTypeNone",hasM:!1,hasZ:!1,objectIdField:"OBJECTID",globalIdField:"",typeIdField:"",fields:[{name:"OBJECTID",type:"esriFieldTypeOID",actualType:"int",alias:"OBJECTID",sqlType:"sqlTypeOther",nullable:!1,editable:!1,domain:null,defaultValue:null},{name:"RegionType",type:"esriFieldTypeInteger",alias:l.regionTypeLabel,
actualType:"nvarchar",nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"CenterPoint",type:"esriFieldTypeString",alias:l.centerPointLabel,actualType:"nvarchar",nullable:!0,editable:!0,domain:null,defaultValue:null,sqlType:"sqlTypeNVarchar",length:50},{name:"ObservationHeight",type:"esriFieldTypeDouble",alias:l.observationHeightLabel,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"HeightUnit",type:"esriFieldTypeString",alias:l.heightUnitLabel,actualType:"nvarchar",nullable:!0,
editable:!0,domain:null,defaultValue:null,sqlType:"sqlTypeNVarchar",length:50},{name:"MinObservationDistance",type:"esriFieldTypeDouble",alias:l.minObservationDistanceLabel,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"MaxObservationDistance",type:"esriFieldTypeDouble",alias:l.maxObservationDistance,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"DistanceUnit",type:"esriFieldTypeString",alias:l.distanceUnitLabel,actualType:"nvarchar",nullable:!0,editable:!0,domain:null,
defaultValue:null,sqlType:"sqlTypeNVarchar",length:50},{name:"FOVStartAngle",type:"esriFieldTypeDouble",alias:l.fovstartAngleLabel,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"FOVEndAngle",type:"esriFieldTypeDouble",alias:l.fovEndAngleLabel,nullable:!0,editable:!0,domain:null,defaultValue:null},{name:"AngleUnits",type:"esriFieldTypeString",alias:l.AngleUnits,actualType:"nvarchar",nullable:!0,editable:!0,domain:null,defaultValue:null,sqlType:"sqlTypeNVarchar",length:50}],indexes:[],
types:[],templates:[{name:"New Feature",description:"",drawingTool:"esriFeatureEditToolPolygon",prototype:{attributes:{}}}],supportedQueryFormats:"JSON",hasStaticData:!1,maxRecordCount:1E4,standardMaxRecordCount:4E3,tileMaxRecordCount:4E3,maxRecordCountFactor:1,exceedsLimitFactor:1,capabilities:"Query,Editing,Create,Update,Delete"}]}},isNameAvailable:function(n,q,m){return H({url:n,content:{name:m,type:"Feature Service",token:q,f:"json"},handleAs:"json",callbackParamName:"callback"},{usePost:!0})},
createFeatureService:function(n,q,m){return H({url:n,content:{f:"json",token:q,typeKeywords:"ArcGIS Server,Data,Feature Access,Feature Service,Service,Hosted Service",createParameters:k.stringify(m),outputType:"featureService"},handleAs:"json",callbackParamName:"callback"},{usePost:!0})},addDefinitionToService:function(n,q,m){return H({url:n,content:{token:q,addToDefinition:k.stringify(m),f:"json"},handleAs:"json",callbackParamName:"callback"},{usePost:!0})}}})},"widgets/Visibility/js/symbologySettings":function(){define("dojo/_base/declare dojo/_base/array dojo/_base/html dojo/on ./ColorPickerEditor jimu/BaseWidget dijit/_WidgetsInTemplateMixin dojo/text!../templates/symbologySettings.html dojo/_base/lang dojo/Evented dojo/dom-class dojo/dom-attr dojo/query dojo/keys dojo/dom dijit/registry jimu/utils dijit/focus jimu/dijit/formSelect jimu/dijit/SymbolChooser".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d,h,p,t,w,u){return H([l,b,f],{baseClass:"jimu-widget-visibility-symbologySettings",templateString:a,selectedSettings:{},colorPickerNodes:[],constructor:function(r){c.mixin(this,r)},startup:function(){if(!this.config.hasOwnProperty("symbology"))var r={visibleSectionOutlineColor:{color:"#000000",transparency:1,type:"esriSLSSolid"},visibleSectionFillColor:{color:"#00ff00",transparency:.5,type:"esriSFSSolid"},nonVisibleSectionOutlineColor:{color:"#000000",transparency:1,
type:"esriSLSSolid"},nonVisibleSectionFillColor:{color:"#ff0000",transparency:.5,type:"esriSFSSolid"}};this.colorPickerNodes=d(".colorPicker",this.domNode);k.forEach(this.colorPickerNodes,c.hitch(this,function(B){B=new m({nls:this.nls,type:e.contains(B,"Line")?"line":"fill"},B);B.setValues({color:r?r[B.id].color:this.config.symbology[B.id].color,transparency:r?r[B.id].transparency:this.config.symbology[B.id].transparency});B.startup();B.dropdown.set("value",r?r[B.id].type:this.config.symbology[B.id].type)}));
var y=d(".jimu-color-pickerPopup",this.domNode);k.forEach(y,c.hitch(this,function(B){this.own(q(B,"keydown",c.hitch(this,function(C){C.keyCode!==h.ENTER&&C.keyCode!==h.SPACE||C.currentTarget.click()})))}));this.onSettingsChanged()},postCreate:function(){this.inherited(arguments);this._handleClickEvents();this.visibleSectionSettingsButton.click()},_handleClickEvents:function(){this.own(q(this.visibleSectionSettingsButton,"click",c.hitch(this,function(){this._openCloseNodes(this.visibleSectionSettingsButton,
this.visibleSectionContainer)})));this.own(q(this.nonVisibleSectionSettingsButton,"click",c.hitch(this,function(){this._openCloseNodes(this.nonVisibleSectionSettingsButton,this.nonVisibleSectionContainer)})));this.own(q(this.visibleSectionSettingsButton,"keydown",c.hitch(this,function(r){r.keyCode!==h.ENTER&&r.keyCode!==h.SPACE||this._openCloseNodes(this.visibleSectionSettingsButton,this.visibleSectionContainer)})));this.own(q(this.nonVisibleSectionSettingsButton,"keydown",c.hitch(this,function(r){r.keyCode!==
h.ENTER&&r.keyCode!==h.SPACE||this._openCloseNodes(this.nonVisibleSectionSettingsButton,this.nonVisibleSectionContainer)})))},_openCloseNodes:function(r,y){var B=d(".container",this.domNode),C=d(".esriCTSettingsButtonIcon",this.domNode),G=!1;this.validInputs()&&(r&&e.contains(r,"esriCTLabelSettingsRightButton")&&(G=!0),k.forEach(B,c.hitch(this,function(x){n.addClass(x,"esriCTGroupHidden")})),k.forEach(C,c.hitch(this,function(x,v){n.removeClass(x,"esriCTLabelSettingsDownButton");n.addClass(x,"esriCTLabelSettingsRightButton");
g.set(x,"aria-expanded","false");v===C.length-1&&setTimeout(c.hitch(this,function(){this._setLastFocusNode()}),100)})),G?(n.removeClass(y,"esriCTGroupHidden"),n.removeClass(r,"esriCTLabelSettingsRightButton"),n.addClass(r,"esriCTLabelSettingsDownButton"),g.set(r,"aria-expanded","true"),r=d(".jimu-color-picker",y),r.length&&u.focus(r[0])):u.focus(r))},onClose:function(){if(!this.validInputs())return!1;this.onSettingsChanged();this._openCloseNodes()},onSettingsChanged:function(){k.forEach(this.colorPickerNodes,
c.hitch(this,function(r){var y={color:t.byId(r.id).getValues().color,transparency:t.byId(r.id).getValues().transparency,type:t.byId(r.id).dropdown.getValue()};this.selectedSettings[r.id]=y}));this.emit("settingsChanged",this.selectedSettings)},validInputs:function(){var r=!0;k.some(this.colorPickerNodes,function(y){if(!t.byId(y.id).validateSpinner())return r=!1,!0},this);return r},_setLastFocusNode:function(){if(e.contains(this.nonVisibleSectionSettingsButton,"esriCTLabelSettingsDownButton")){var r=
d(".dijit",p.byId("nonVisibleSectionFillColor").lastElementChild)[0];w.initLastFocusNode(this.refDomNode,r)}else w.initLastFocusNode(this.refDomNode,this.nonVisibleSectionSettingsButton)}})})},"widgets/Visibility/js/ColorPickerEditor":function(){define("dojo/_base/declare dojo/_base/array dojo/_base/lang dojo/_base/Color dojo/on dojo/query dojo/_base/html dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!../templates/ColorPickerEditor.html dijit/form/HorizontalSlider jimu/dijit/ColorPickerPopup dijit/form/NumberSpinner".split(" "),
function(H,k,n,q,m,l,b,a,c,f,e,g,d){return H([a,c,f],{_defaultColor:"#485566",templateString:e,nls:null,postCreate:function(){this.colorPicker=new d({color:this._defaultColor,tabindex:0,"aria-label":this.nls.colorPicker},this.colorPicker);this.colorPicker.startup();this.slider=new g({name:"slider",value:100,minimum:0,maximum:100,discreteValues:101,intermediateChanges:!0,showButtons:!1,style:"display: inline-block;","aria-label":this.nls.transparency},this.sliderBar);this.slider.startup();var h=[],
p,t="esriSLSDash esriSLSDashDot esriSLSDashDotDot esriSLSDot esriSLSLongDash esriSLSLongDashDot esriSLSNull esriSLSShortDash esriSLSShortDashDot esriSLSShortDashDotDot esriSLSShortDot esriSLSSolid".split(" "),w="esriSFSBackwardDiagonal esriSFSCross esriSFSDiagonalCross esriSFSForwardDiagonal esriSFSHorizontal esriSFSNull esriSFSSolid esriSFSVertical".split(" ");"line"===this.type?k.forEach(t,n.hitch(this,function(u){p={value:u,label:this.nls.lineStyles[u]};h.push(p)})):k.forEach(w,n.hitch(this,function(u){p=
{value:u,label:this.nls.fillStyles[u]};h.push(p)}));this.dropdown.addOption(h);this.inherited(arguments)},startup:function(){this.own(m(this.slider,"change",n.hitch(this,function(h){!1===this._isSameVal()&&this.spinner.setValue(h)})));this.own(m(this.spinner,"change",n.hitch(this,function(h){h<=this.slider.maximum&&this.slider.setValue(h)})));this._stylePolyfill();this.inherited(arguments)},_isSameVal:function(){return this.slider.getValue()===this.spinner.getValue()},getValues:function(){var h=null,
p=null;(p=this.colorPicker.getColor())&&p.toHex&&(h=p.toHex());p=this.spinner.getValue()/100;return{color:h,transparency:p}},setValues:function(h){if("object"===typeof h||"string"===typeof h)this.colorPicker.setColor(new q(h.color)),h.transparency="undefined"===typeof h.transparency?0:100*h.transparency,this.slider.setValue(h.transparency),this.spinner.setValue(h.transparency)},_stylePolyfill:function(){var h=l(".dijitSliderLeftBumper",this.domNode)[0];h&&h.parentNode&&b.setStyle(h.parentNode,"background-color",
"#24b5cc")},validateSpinner:function(){var h=!0;this.spinner.isValid()||(this._shake(this.spinner.domNode,16),this.spinner.focus(),h=!1);return h},_shake:function(h,p){function t(){if(15>w){h.style.transform="translate(0px, 0px)";p-=u;var B=r(-p,p),C=r(-p,p);h.style.transform="translate("+B+"px, "+C+"px)";w+=1;requestAnimationFrame(t)}15<=w&&(h.style.transform="translate(0, 0)",y._shakingElements.splice(y._shakingElements.indexOf(h),1))}var w=1,u=p/15,r=function(B,C){return Math.floor(Math.random()*
(C-B+1))+B};this._shakingElements||(this._shakingElements=[]);if(-1===this._shakingElements.indexOf(h)){this._shakingElements.push(h);var y=this;t()}}})})},"jimu/dijit/ColorPickerPopup":function(){define("dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dojo/_base/lang dojo/_base/html dojo/on dojo/_base/Color dijit/TooltipDialog dijit/popup jimu/dijit/ColorPalette jimu/utils".split(" "),function(H,k,n,q,m,l,b,a,c,f,e){return H([k,n],{baseClass:"jimu-color-pickerPopup",declaredClass:"jimu.dijit.ColorPickerPopup",
templateString:'\x3cdiv class\x3d"jimu-color-picker"\x3e\x3c/div\x3e',_isTooltipDialogOpened:!1,color:null,showLabel:!1,around:null,_ENABLE:!0,recordUID:"",postCreate:function(){this.inherited(arguments);this._createTooltipDialog(this.domNode);this._hideTooltipDialog()},destroy:function(){c.close(this.tooltipDialog);this.picker.destroy();this.tooltipDialog.destroy();this.inherited(arguments)},enable:function(){this._ENABLE=!0;m.removeClass(this.domNode,"disable")},disable:function(){this._ENABLE=
!1;m.addClass(this.domNode,"disable")},isPartOfPopup:function(g){var d=this.tooltipDialog.domNode;return g===d||m.isDescendant(g,d)},hideTooltipDialog:function(){this._hideTooltipDialog()},showTooltipDialog:function(){this._showTooltipDialog()},initUI:function(){this.picker.initUI()},isOpen:function(){return this._isTooltipDialogOpened},_showTooltipDialog:function(){c.open({parent:this.getParent(),popup:this.tooltipDialog,around:this.around?this.around:this.domNode,orient:this.orient});this._isTooltipDialogOpened=
!0},_hideTooltipDialog:function(){c.hide(this.tooltipDialog);this._isTooltipDialogOpened=!1},_createTooltipDialog:function(){var g=m.create("div");this.tooltipDialog=new a({content:g});m.addClass(this.tooltipDialog.domNode,"jimu-color-picker-popup-dialog");var d=new f({appearance:{showTransparent:!1,showColorPalette:!0,showCoustom:!0,showColorPickerOK:!0,showColorPickerApply:!0,showCoustomRecord:!0,closeDialogWhenChange:!0},recordUID:this.recordUID,onChange:q.hitch(this,function(h){h&&(h=new b(h),
this.setColor(h),this.onChange(h))})});d.placeAt(g);d.startup();this.own(l(d,"close",q.hitch(this,function(){this._hideTooltipDialog()})));this.own(l(d,"change-style",q.hitch(this,function(){this._hideTooltipDialog();this._showTooltipDialog()})));this.own(l(this.domNode,"click",q.hitch(this,function(h){h.stopPropagation();h.preventDefault();this._isTooltipDialogOpened?this._hideTooltipDialog():!1!==this._ENABLE&&this._showTooltipDialog()})));this.own(l(document,"click",q.hitch(this,function(h){this.isPartOfPopup(h.srcElement||
h.target)||this._hideTooltipDialog()})));this.picker=d},setColor:function(g){if(g instanceof b){null===this.color&&!0===this.showLabel&&this._changeLabel(g);var d=g.toHex();this.color=g;m.setStyle(this.domNode,"backgroundColor",d);this.picker&&(this.picker.refreshRecords(),this.picker.setColor(d,!1,!0));this.showLabel&&this._changeLabel(this.color)}},getColor:function(){return this.color},_changeLabel:function(g){m.empty(this.domNode);m.create("span",{innerHTML:g.toHex(),className:"color-label",style:{color:e.invertColor(g.toHex())}},
this.domNode)},onChange:function(g){g&&this.showLabel&&this._changeLabel(g)},changeColor:function(){this.picker&&this.picker.changeColor();this.showLabel&&this._changeLabel(this.color)},setTitle:function(g){this.domNode.title=g},getTooltipDialog:function(){return this.tooltipDialog||null}})})},"widgets/Visibility/js/jquery.knob.min":function(){define(["jimu/loaderplugins/jquery-loader! ./libs/jquery/jquery-1-11-1.js"],function(H){var k=Math.max,n=Math.min;var q=void 0;q=H(document);var m=function(){var b=
this;this.cv=this.v=this.g=this.i=this.$=this.o=null;this.h=this.w=this.y=this.x=0;this.c=this.$c=null;this.t=0;this.isInit=!1;this.rH=this.eH=this.cH=this.dH=this.pColor=this.fgColor=null;this.scale=1;this.relativeHeight=this.relativeWidth=this.relative=!1;this.$div=null;this.run=function(){var a=function(c,f){for(var e in f)b.o[e]=f[e];b._carve().init();b._configure()._draw()};if(!this.$.data("kontroled")){this.$.data("kontroled",!0);this.extend();this.o=H.extend({min:void 0!==this.$.data("min")?
this.$.data("min"):0,max:void 0!==this.$.data("max")?this.$.data("max"):100,stopper:!0,readOnly:this.$.data("readonly")||"readonly"===this.$.attr("readonly"),cursor:!0===this.$.data("cursor")&&90||this.$.data("cursor")||0,thickness:this.$.data("thickness")&&Math.max(Math.min(this.$.data("thickness"),1),.01)||.35,lineCap:this.$.data("linecap")||"butt",width:this.$.data("width")||200,height:this.$.data("height")||200,displayInput:null===this.$.data("displayinput")||this.$.data("displayinput"),displayPrevious:this.$.data("displayprevious"),
fgColor:this.$.data("fgcolor")||"#999",inputColor:this.$.data("inputcolor"),font:this.$.data("font")||"Arial",fontWeight:this.$.data("font-weight")||"bold",inline:!1,step:this.$.data("step")||1,rotation:this.$.data("rotation"),units:"degrees",milsValue:0,draw:null,change:null,cancel:null,release:null,format:function(c){return c},parse:function(c){return c}},this.o);this.o.flip="anticlockwise"===this.o.rotation||"acw"===this.o.rotation;this.o.inputColor||(this.o.inputColor=this.o.fgColor);this.i=this.$;
this.v=this.o.parse(this.$.val());this.$.bind("change blur",function(){"mils"===b.o.units&&(b.o.milsValue=b.$.val());b.val(b._validate(b.o.parse("degrees"===b.o.units?b.$.val():b.$.val()/17.777777777778)));b.o.cursor="degrees"===b.o.units?b.$.val():b.$.val()/17.777777777778;b.o.inputColor=0!==b.$.val()?"#ccc":"#f37371";b._carve().init();b._draw()});this.$c=H(document.createElement("canvas")).attr({width:this.o.width,height:this.o.height});this.$div=H('\x3cdiv style\x3d"'+(this.o.inline?"display:inline;":
"")+"width:"+this.o.width+"px;height:"+this.o.height+'px;"\x3e\x3c/div\x3e');this.$.wrap(this.$div).before(this.$c);this.$div=this.$.parent();"undefined"!==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(this.$c[0]);this.c=this.$c[0].getContext?this.$c[0].getContext("2d"):null;if(!this.c)throw{name:"CanvasNotSupportedException",message:"Canvas not supported. Please use excanvas on IE8.0.",toString:function(){return this.name+": "+this.message}};this.scale=(window.devicePixelRatio||1)/(this.c.webkitBackingStorePixelRatio||
this.c.mozBackingStorePixelRatio||this.c.msBackingStorePixelRatio||this.c.oBackingStorePixelRatio||this.c.backingStorePixelRatio||1);this.relativeWidth=0!==this.o.width%1&&this.o.width.indexOf("%");this.relativeHeight=0!==this.o.height%1&&this.o.height.indexOf("%");this.relative=this.relativeWidth||this.relativeHeight;this._carve();this.v instanceof Object?(this.cv={},this.copy(this.v,this.cv)):this.cv=this.v;this.$.bind("configure",a).parent().bind("configure",a);this._listen()._configure()._xy().init();
this.isInit=!0;this._draw();return this}};this._carve=function(){if(this.relative){var a=this.relativeWidth?this.$div.parent().width()*parseInt(this.o.width,10)/100:this.$div.parent().width(),c=this.relativeHeight?this.$div.parent().height()*parseInt(this.o.height,10)/100:this.$div.parent().height();this.w=this.h=Math.min(a,c)}else this.w=this.o.width,this.h=this.o.height;this.$div.css({width:this.w+"px",height:this.h+"px"});this.$c.attr({width:this.w,height:this.h});1!==this.scale&&(this.$c[0].width*=
this.scale,this.$c[0].height*=this.scale,this.$c.width(this.w),this.$c.height(this.h));return this};this._draw=function(){var a=!0;b.g=b.c;b.clear();b.dH&&(a=b.dH());!1!==a&&b.draw()};this._mouse=function(a){var c=function(f){f=b.xy2val(f.pageX,f.pageY);f===b.cv||b.cH&&!1===b.cH(f)||(b.change(b._validate(f)),b._draw())};c(a);q.bind("mousemove.k",c).bind("keyup.k",function(f){27===f.keyCode&&(q.unbind("mouseup.k mousemove.k keyup.k"),b.eH&&!1===b.eH()||b.cancel())}).bind("mouseup.k",function(){q.unbind("mousemove.k mouseup.k keyup.k");
b.val(b.cv)});return this};this._xy=function(){var a=this.$c.offset();this.x=a.left;this.y=a.top;return this};this._listen=function(){this.o.readOnly?this.$.attr("readonly","readonly"):(this.$c.bind("mousedown",function(a){a.preventDefault();b._xy()._mouse(a)}),this.listen());this.relative&&H(window).resize(function(){b._carve().init();b._draw()});return this};this._configure=function(){this.o.draw&&(this.dH=this.o.draw);this.o.change&&(this.cH=this.o.change);this.o.cancel&&(this.eH=this.o.cancel);
this.o.release&&(this.rH=this.o.release);this.o.displayPrevious?(this.pColor=this.h2rgba(this.o.fgColor,"0.5"),this.fgColor=this.h2rgba(this.o.fgColor,"0.5")):this.fgColor=this.o.fgColor;return this};this._clear=function(){this.$c[0].width=this.$c[0].width};this._validate=function(a){return Math.round(~~((0>a?-.5:.5)+a/this.o.step)*this.o.step*100)/100};this.listen=function(){};this.extend=function(){};this.init=function(){};this.change=function(){};this.val=function(){};this.xy2val=function(){};
this.draw=function(){};this.clear=function(){this._clear()};this.h2rgba=function(a,c){a=a.substring(1,7);a=[parseInt(a.substring(0,2),16),parseInt(a.substring(2,4),16),parseInt(a.substring(4,6),16)];return"rgba("+a[0]+","+a[1]+","+a[2]+","+c+")"};this.copy=function(a,c){for(var f in a)c[f]=a[f]}};var l=function(){m.call(this);this.w2=this.cursorExt=this.lineWidth=this.radius=this.xy=this.startAngle=null;this.PI2=2*Math.PI;this.extend=function(){this.o=H.extend({bgColor:this.$.data("bgcolor")||"#999",
angleOffset:this.$.data("angleoffset")||0,angleArc:this.$.data("anglearc")||360,inline:!0},this.o)};this.val=function(b,a){if(null!==b)b=this.o.parse(b),!1!==a&&b!==this.v&&this.rH&&!1===this.rH(b)||(this.v=this.cv=this.o.stopper?k(n(b,this.o.max),this.o.min):b,this._draw());else return this.v};this.xy2val=function(b,a){b=Math.atan2(b-(this.x+this.w2),-(a-this.y-this.w2))-this.angleOffset;this.o.flip&&(b=this.angleArc-b-this.PI2);this.angleArc!==this.PI2&&0>b&&-.5<b?b=0:0>b&&(b+=this.PI2);b=b*(this.o.max-
this.o.min)/this.angleArc+this.o.min;this.o.stopper&&(b=k(n(b,this.o.max),this.o.min));return b};this.listen=function(){var b=this,a,c;this.$.bind("keydown",function(f){var e=f.keyCode;96<=e&&105>=e&&(e=f.keyCode=e-48);a=parseInt(String.fromCharCode(e),10);isNaN(a)&&13!==e&&8!==e&&9!==e&&f.preventDefault()}).bind("keyup",function(){isNaN(a)?c&&(window.clearTimeout(c),c=null,b.val(b.$.val())):b.$.val()>b.o.max&&b.$.val(b.o.max)||b.$.val()<b.o.min&&b.$.val(b.o.min)})};this.init=function(){if(this.v<
this.o.min||this.v>this.o.max)this.v=this.o.min;"degrees"===this.o.units?this.$.val(this.v):this.$.val(this.o.milsValue);this.w2=this.w/2;this.cursorExt=this.o.cursor*Math.PI/180/2;this.xy=this.w2*this.scale;this.lineWidth=this.xy*this.o.thickness;this.lineCap=this.o.lineCap;this.radius=this.xy-this.lineWidth/2;this.o.angleOffset&&(this.o.angleOffset=isNaN(this.o.angleOffset)?0:this.o.angleOffset);this.o.angleArc&&(this.o.angleArc=isNaN(this.o.angleArc)?this.PI2:this.o.angleArc);this.angleOffset=
this.o.angleOffset*Math.PI/180;this.angleArc=this.o.angleArc*Math.PI/180;this.startAngle=1.5*Math.PI+this.angleOffset;this.endAngle=1.5*Math.PI+this.angleOffset+this.angleArc;var b=k(String(Math.abs(this.o.max)).length,String(Math.abs(this.o.min)).length,2)+2;this.o.displayInput&&this.i.css({width:this.w/2+4+"px",height:this.w/3+"px",position:"absolute","vertical-align":"middle","margin-top":this.w/3+"px","margin-left":"-"+(3*this.w/4+2)+"px",border:0,background:"none",font:this.o.fontWeight+" "+
this.w/b+"px "+this.o.font,"text-align":"center",color:this.o.inputColor||this.o.fgColor,padding:"0px","-webkit-appearance":"none"})||this.i.css({width:"0px",visibility:"hidden"})};this.change=function(b){this.cv=b};this.angle=function(b){return(b-this.o.min)*this.angleArc/(this.o.max-this.o.min)};this.arc=function(b){b=this.angle(b);if(this.o.flip){var a=this.endAngle+1E-5;b=a-b-1E-5}else a=this.startAngle-1E-5,b=a+b+1E-5;this.o.cursor&&(a=b-this.cursorExt)&&(b+=this.cursorExt);return{s:a,e:b,d:this.o.flip&&
!this.o.cursor}};this.draw=function(){var b=this.g,a=this.arc(this.cv);var c=1;b.lineWidth=this.lineWidth;b.lineCap=this.lineCap;"none"!==this.o.bgColor&&(b.beginPath(),b.strokeStyle=this.o.bgColor,b.arc(this.xy,this.xy,this.radius,this.endAngle-1E-5,this.startAngle+1E-5,!0),b.stroke());this.o.displayPrevious&&(c=this.arc(this.v),b.beginPath(),b.strokeStyle=this.pColor,b.arc(this.xy,this.xy,this.radius,c.s,c.e,c.d),b.stroke(),c=this.cv===this.v);b.beginPath();b.strokeStyle=c?this.o.fgColor:this.fgColor;
b.arc(this.xy,this.xy,this.radius,a.s,a.e,a.d);b.stroke()};this.cancel=function(){this.val(this.v)}};H.fn.dial=H.fn.knob=function(b){return this.each(function(){var a=new l;a.o=b;a.$=H(this);a.run()}).parent()}})},"jimu/loaderplugins/jquery-loader":function(){define(["dojo/Deferred","dojo/when"],function(H,k){var n,q={},m=function(c){var f=new H;if(q.locked)return setTimeout(function(){m(c)},50),f;if(q[c])return q.locked=!0,f.resolve(q[c]),f;q.locked=!0;n([c],function(){q[c]=window.jQuery;f.resolve(q[c])});
return f},l=function(c,f,e){n([c[f]],function(){f===c.length-1?e.resolve():(f++,l(c,f,e))})},b=function(c,f){c=new H;f[0]?l(f,0,c):c.resolve();return c},a=function(c,f){var e=new H;m(c).then(function(g){b(c,f).then(function(){q.locked=!1;e.resolve(g)})});return e};return{load:function(c,f,e){c=c.split(",");var g=[];n=f;0===c.length?e(null):(f=c[0],g=c.slice(1),k(a(f,g),e))}}})},"widgets/Visibility/js/PrivilegeUtil":function(){define("dojo/_base/declare dojo/_base/lang jimu/portalUtils jimu/portalUrlUtils jimu/Role esri/lang".split(" "),
function(H,k,n,q,m,l){var b=null,a=H([],{userRole:null,userPortalUrl:null,portalAnalysis:null,portalSelf:null,portalUrl:null,_isServiceAvailable:!1,constructor:function(c){this.portalUrl=c},_clearLoadedInfo:function(){this.portalUrl=this.portalSelf=this.userPortalUrl=this.userRole=null},loadPrivileges:function(c){this.portalSelf=this.userPortalUrl=this.userRole=null;this._isServiceAvailable=!1;c&&(this.portalUrl=c);c=n.getPortal(this.portalUrl);return c.haveSignIn()?this._loadUserInfo(c):this._signIn(c)},
getPortalUrl:function(c){return c?q.getStandardPortalUrl(c):this.portalUrl?q.getStandardPortalUrl(this.portalUrl):q.getStandardPortalUrl(this.appConfig.portalUrl)},_privilegeLoaded:function(){return null!==this.portalSelf},getUserPortal:function(){return this._privilegeLoaded()?this.getPortalUrl(this.userPortalUrl):null},_signIn:function(c){return c.loadSelfInfo().then(k.hitch(this,function(f){var e=n.getPortal(f.portalHostname);return null===e?!1:e.signIn().then(k.hitch(this,function(g){return this._loadUserInfo(e,
g)}),function(){return!1})}),function(){return!1})},_loadUserInfo:function(c){return c.loadSelfInfo().then(k.hitch(this,function(f){this.userPortalUrl=f.urlKey?f.urlKey+"."+f.customBaseUrl:this.portalUrl;return f&&f.user?(this.userRole=new m({id:f.user.roleId?f.user.roleId:f.user.role,role:f.user.role}),f.user.privileges&&this.userRole.setPrivileges(f.user.privileges),this.portalSelf=f,!0):!1}),function(){return!1})},_canPerformElevationAnalysis:function(){this.portalSelf&&(this._isServiceAvailable=
l.isDefined(this.portalSelf.helperServices.elevation));return this.canPerformAnalysis()&&this._isServiceAvailable},canPerformAnalysis:function(){var c=!1;this.userRole&&(this.userRole.isAdmin()||this.userRole.isPublisher())?c=!0:this.userRole&&this.userRole.isCustom()&&(c=this.userRole.canCreateItem()&&this.userRole.canPublishFeatures()&&this.userRole.canUseSpatialAnalysis());this.portalSelf&&this.portalSelf.isPortal&&(c=c&&l.isDefined(this.portalSelf.helperServices.analysis)&&l.isDefined(this.portalSelf.helperServices.analysis.url));
return c}});a.getInstance=function(c){null===b&&(b=new a(c));return b};return a})},"widgets/Visibility/_build-generate_module":function(){define(["dojo/text!./Widget.html","dojo/text!./css/style.css","dojo/i18n!./nls/strings"],function(){})},"url:widgets/Visibility/templates/VisibilityControl.html":'\x3cdiv\x3e\r\n\x3cdiv class\x3d"" data-dojo-attach-point\x3d"visibiltyWidget"\x3e\r\n    \x3cdiv class\x3d"esriCTFullWidth esriCTNewHeader"\x3e\r\n\x3c!-- Panel Title --\x3e\r\n\x3cdiv class\x3d"esriCTMainTitleDiv esriCTEllipsis" title\x3d"${nls.mainPageTitle}"\x3e\r\n  ${nls.mainPageTitle}\r\n  \x3c/div\x3e\r\n  \x3c!-- Settings Icon --\x3e\r\n  \x3cdiv class\x3d"esriCTRightSideButton"\x3e\r\n    \x3cdiv class\x3d"esriCTSettingsIcon esriCTPointer" title\x3d"${nls.settingsTitle}" tabindex\x3d"0" role\x3d\'button\'\r\n    aria-label\x3d\'${nls.settingsTitle}\' data-dojo-attach-point\x3d"settingsIcon"\x3e\x3c/div\x3e\r\n  \x3cdiv class\x3d"esriCTSaveToLayerIcon esriCTPointer esriCTHidden" title\x3d"${nls.resultsTitle}" tabindex\x3d"0"  role\x3d\'button\' aria-label\x3d\'${nls.resultsTitle}\' data-dojo-attach-point\x3d"saveToLayerIcon"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n\r\n  \x3clabel data-dojo-attach-point\x3d"errorText" style\x3d"display: none"\x3e\x3c/label\x3e\r\n  \x3cdiv class\x3d"controls" data-dojo-attach-point\x3d"controls"\x3e\r\n    \x3cdiv class\x3d"controlGroup"\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"observerCoordsContainer"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"controlGroup"\x3e\r\n      \x3clabel class\x3d"titleLabel" data-dojo-attach-point\x3d"FOVLabel"\x3e${nls.fieldOfView}\x3c/label\x3e\r\n      \x3cdiv class\x3d"center" data-dojo-attach-point\x3d"FOVGroup"\x3e\r\n        \x3cinput type\x3d"text" value\x3d"360" class\x3d"fov" data-displayInput\x3d"true" data-cursor\x3d"true" disabled\x3d"true"\r\n          data-dojo-attach-point\x3d"FOVInput" aria-label\x3d"${nls.fieldOfView}" /\x3e\r\n        \x3cp class\x3d"cursortooltip" data-dojo-attach-point\x3d"tooltip" hidden\x3d\'true\'\x3e\x3c/p\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"controlGroup"\x3e\r\n      \x3cinput class\x3d"switch-toggle" data-dojo-type\x3d"dijit/form/CheckBox" data-dojo-attach-point\x3d"angleUnits" checked\x3d"false" aria-label\x3d"${nls.useMilsText}"/\x3e\r\n      \x3clabel class\x3d"titleLabel"\x3e${nls.useMilsText}\x3c/label\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"controlGroup"\x3e\r\n      \x3clabel class\x3d"titleLabel"\x3e${nls.observerHeight}\x3c/label\x3e\r\n      \x3cdiv\x3e\r\n        \x3cinput class\x3d"inputNumberTextbox" data-dojo-type\x3d\'dijit/form/NumberTextBox\' required\x3d"true" value\x3d"2"\r\n          data-dojo-props\x3d\'\r\n          constraints: {min: 0},\r\n          invalidMessage: "${nls.invalidMessage}",\r\n          rangeMessage: "${nls.observerRangeMessage}"\'\r\n          data-dojo-attach-point\x3d"observerHeight" aria-label\x3d"${nls.observerHeight}"\x3e\r\n        \x3cselect style\x3d"width: 100px" class\x3d"controlSpace noResize" data-dojo-type\x3d"jimu/dijit/formSelect"\r\n          data-dojo-attach-point\x3d"observerHeightDD" aria-label\x3d"${nls.observerHeight}"\x3e\r\n        \x3c/select\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"controlGroup"\x3e\r\n      \x3clabel class\x3d"titleLabel"\x3e${nls.minObsDistance}\x3c/label\x3e\r\n      \x3cdiv\x3e\r\n        \x3cinput class\x3d"inputNumberTextbox" data-dojo-type\x3d\'dijit/form/NumberTextBox\' required\x3d"true" value\x3d"3"\r\n          data-dojo-props\x3d\'constraints: {min: 0}\' data-dojo-attach-point\x3d"minObsRange" aria-label\x3d"${nls.minObsDistance}"\x3e\r\n        \x3cselect style\x3d"width: 100px" class\x3d"controlSpace noResize" data-dojo-type\x3d"jimu/dijit/formSelect"\r\n          data-dojo-attach-point\x3d"distanceUnitDD" aria-label\x3d"${nls.minObsDistance}"\x3e\r\n        \x3c/select\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"controlGroup"\x3e\r\n      \x3clabel class\x3d"titleLabel"\x3e${nls.maxObsDistance}\x3c/label\x3e\r\n      \x3cdiv\x3e\r\n        \x3cinput class\x3d"inputNumberTextbox" data-dojo-type\x3d\'dijit/form/NumberTextBox\' required\x3d"true" value\x3d"5"\r\n          data-dojo-props\x3d\'constraints: {min: 0}\' data-dojo-attach-point\x3d"maxObsRange" aria-label\x3d"${nls.maxObsDistance}"\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"buttonContainer" data-dojo-attach-point\x3d"buttonContainer"\x3e\r\n      \x3cdiv class\x3d"btnContainer HalfWidthLeft"\x3e\r\n        \x3cdiv class\x3d"jimu-btn" data-dojo-attach-point\x3d"btnCreate" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.createBtn}"\x3e${nls.createBtn}\x3c/div\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv class\x3d"btnContainer HalfWidthRight"\x3e\r\n        \x3cdiv class\x3d"jimu-btn controlSpace" data-dojo-attach-point\x3d"btnClear" tabindex\x3d"0" role\x3d"button" aria-label\x3d"${nls.clearBtn}"\x3e${nls.clearBtn}\x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n\x3c/div\x3e\r\n\x3cdiv class\x3d"esriCTHidden" data-dojo-attach-point\x3d"portalPublishContainer"\x3e\x3c/div\x3e\r\n\x3cdiv class\x3d"esriCTHidden" data-dojo-attach-point\x3d"settingsContainer"\x3e\r\n  \x3cdiv\x3e\r\n    \x3cdiv class\x3d"esriCTFullWidth esriCTSettingHeader"\x3e\r\n      \x3cdiv class\x3d"esriCTBackButton" title\x3d"${nls.back}"\x3e\r\n        \x3cdiv class\x3d"esriCTItemLeftArrow" data-dojo-attach-point\x3d"settingsPanelBackButton" tabindex\x3d"0"\r\n          aria-label\x3d"${nls.back}" role\x3d"button"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTTitleDiv esriCTEllipsis" title\x3d"${nls.settingsTitle}"\x3e${nls.settingsTitle}\x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTMainPageRow"\x3e\r\n      \x3cdiv style\x3d"overflow: hidden;" data-dojo-attach-point\x3d"symbologySettingsNode"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n\x3c/div\x3e',
"url:esri/dijit/templates/SingleFilter.html":'\x3cdiv class\x3d"esriSingleFilterForm singleFilter" id\x3d"${id}.singleFilter"\x3e\r\n  \x3cdiv\x3e\r\n    \x3ctable id\x3d"${id}.exprTable" class\x3d"rowTable" cellpadding\x3d"0" cellspacing\x3d"0"\x3e\r\n      \x3ctbody\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd valign\x3d"top" nowrap\x3e\r\n            \x3cdiv id\x3d"${id}.column1"\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd valign\x3d"top" nowrap\x3e\r\n            \x3cdiv id\x3d"${id}.column2"\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd valign\x3d"top" nowrap\x3e\r\n            \x3cdiv id\x3d"${id}.column3"\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd valign\x3d"top" nowrap\x3e\r\n            \x3cdiv id\x3d"${id}.column4"\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd valign\x3d"top" nowrap\x3e\r\n            \x3cdiv id\x3d"${id}.column5"\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd valign\x3d"top" nowrap\x3e\r\n            \x3cdiv id\x3d"${id}.column6"\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd valign\x3d"top" nowrap\x3e\r\n            \x3cdiv id\x3d"${id}.column7"\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd valign\x3d"top" nowrap\x3e\r\n            \x3ca id\x3d"${id}.deleteExpression" href\x3d"JavaScript:void(0);" style\x3d"margin:0 5px;display:none;" class\x3d"esriAGOFilterRemoveIcon" title\x3d"${i18n.deleteExpression}"\x3e\x3c/a\x3e\r\n          \x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr data-dojo-attach-point\x3d"_interactiveFilterRow"\x3e\r\n          \x3ctd colspan\x3d"8"\x3e\r\n            \x3ctable cellpadding\x3d"0" cellspacing\x3d"0" class\x3d"interactiveFilter"\x3e\r\n              \x3ctbody\x3e\r\n                \x3ctr\x3e\r\n                  \x3ctd nowrap\x3d"nowrap"\x3e\r\n                    \x3ctable cellpadding\x3d"0" cellspacing\x3d"0"\x3e\r\n                      \x3ctbody\x3e\r\n                        \x3ctr\x3e\r\n                          \x3ctd nowrap\x3d"nowrap"\x3e\r\n                            \x3cinput dojoAttachPoint\x3d"interactiveCheck" type\x3d"checkbox" class\x3d"promptCheckBox" title\x3d"${i18n.promptMsg}"/\x3e\r\n                          \x3c/td\x3e\r\n                          \x3ctd nowrap\x3d"nowrap"\x3e\r\n                            \x3clabel class\x3d"labels" for\x3d"promptCheckBox"\x3e\r\n                              \x26nbsp;\x26nbsp;${i18n.askForValues}\r\n                            \x3c/label\x3e\r\n                          \x3c/td\x3e\r\n                          \x3ctd\x3e\r\n                            \x3cspan dojoAttachPoint\x3d"interactiveArrow" style\x3d"color:#cbcbcb;cursor:pointer;" class\x3d"showHidePromptDiv"\x3e\x26nbsp;\x26#9660;\x3c/span\x3e\r\n                          \x3c/td\x3e\r\n                        \x3c/tr\x3e\r\n                      \x3c/tbody\x3e\r\n                    \x3c/table\x3e\r\n                  \x3c/td\x3e\r\n                \x3c/tr\x3e\r\n                \x3ctr dojoAttachPoint\x3d"interactiveSpace" style\x3d"display:none"\x3e\r\n                  \x3ctd nowrap\x3d"nowrap"\x3e\r\n                    \x3ctable cellpadding\x3d"0" cellspacing\x3d"0"\x3e\r\n                      \x3ctbody\x3e\r\n                        \x3ctr\x3e\r\n                          \x3ctd nowrap\x3d"nowrap"\x3e\r\n                            ${i18n.prompt}\r\n                          \x3c/td\x3e\r\n                          \x3ctd width\x3d"10"\x3e\r\n                            \x26nbsp;\r\n                          \x3c/td\x3e\r\n                          \x3ctd\x3e\r\n                            \x3cdiv dojoAttachPoint\x3d"promptText" dojotype\x3d"dijit.form.TextBox" intermediateChanges\x3d"true" style\x3d"width:250px;"\x3e\r\n                            \x3c/div\x3e\r\n                          \x3c/td\x3e\r\n                        \x3c/tr\x3e\r\n                        \x3ctr\x3e\r\n                          \x3ctd nowrap\x3d"nowrap"\x3e\r\n                            ${i18n.hint}\r\n                          \x3c/td\x3e\r\n                          \x3ctd width\x3d"10"\x3e\r\n                            \x26nbsp;\r\n                          \x3c/td\x3e\r\n                          \x3ctd\x3e\r\n                            \x3cdiv dojoAttachPoint\x3d"hintText" dojotype\x3d"dijit.form.TextBox" intermediateChanges\x3d"true" style\x3d"width:250px;"\x3e\r\n                            \x3c/div\x3e\r\n                          \x3c/td\x3e\r\n                        \x3c/tr\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/td\x3e\r\n        \x3c/tr\x3e\r\n      \x3c/tbody\x3e\r\n    \x3c/table\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"promptDiv" style\x3d"display:none;padding:10px 0px;"\x3e\r\n    \x3clabel class\x3d"labels promptLabels" for\x3d"txtPrompt"\x3e\r\n      ${i18n.prompt}\r\n    \x3c/label\x3e\r\n    \x3cinput class\x3d"promptFields txtPrompt" type\x3d"text"/\x3e\r\n    \x3cbr/\x3e\r\n    \x3clabel class\x3d"labels promptLabels" for\x3d"txtHint"\x3e\r\n      ${i18n.hint}\r\n    \x3c/label\x3e\r\n    \x3cinput class\x3d"promptFields txtHint" type\x3d"text" /\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',
"url:dijit/templates/actionBar.html":"\x3cdiv class\x3d'dijitDialogPaneActionBar' data-dojo-attach-point\x3d\"actionBarNode\"\x3e\r\n\t\x3cbutton data-dojo-type\x3d'dijit/form/Button' type\x3d'submit' data-dojo-attach-point\x3d\"okButton\"\x3e\x3c/button\x3e\r\n\t\x3cbutton data-dojo-type\x3d'dijit/form/Button' type\x3d'button'\r\n\t\t\tdata-dojo-attach-point\x3d\"cancelButton\" data-dojo-attach-event\x3d'click:onCancel'\x3e\x3c/button\x3e\r\n\x3c/div\x3e\r\n","url:esri/dijit/analysis/templates/JobsList.html":'\x3cdiv class\x3d"esriAnalysis"\x3e\r\n   \x3cdiv class\x3d"analysisCategoryCtr" style\x3d"overflow:auto;" data-dojo-attach-point\x3d"_tableDiv"\x3e\r\n    \x3ctable class\x3d"calciteWebTable table-striped"\x3e\r\n       \x3cthead\x3e\r\n         \x3ctr\x3e\r\n          \x3cth\x3e${i18n.toolName}\x3c/th\x3e\r\n          \x3cth\x3e${i18n.dateCreated}\x3c/th\x3e\r\n         \x3c/tr\x3e\r\n      \x3c/thead\x3e\r\n      \x3ctbody data-dojo-attach-point\x3d"_analysisJobTBody"\x3e\r\n      \x3c/tbody\x3e\r\n    \x3c/table\x3e\r\n   \x3c/div\x3e\r\n\x3c/div\x3e',
"url:esri/dijit/analysis/templates/Settings.html":'\x3cdiv class\x3d"esriAnalysis"\x3e\r\n  \x3cdiv\x3e\r\n    \x3cdiv class\x3d"analysisTitle" style\x3d"padding:1em;" data-dojo-attach-point\x3d"_settingsHeader"\x3e\r\n         \x3ctable class\x3d"esriFormTable"\x3e\r\n            \x3ctr\x3e\r\n              \x3ctd class\x3d"esriAlignLeading esriAnalysisTitle" colspan\x3d"2"\x3e\r\n                \x3clabel data-dojo-attach-point\x3d"_analysisTitle"\x3e${i18n.analysisEnv}\x3c/label\x3e\r\n              \x3c/td\x3e\r\n              \x3ctd\x3e\r\n                \x3cdiv class\x3d"esriFloatTrailing" style\x3d"padding:0;"\x3e\r\n                    \x3cdiv class\x3d"esriFloatTrailing" data-dojo-attach-point\x3d"_closeDiv"\x3e\r\n                      \x3ca href\x3d"#" data-dojo-attach-point\x3d"_closeBtn" title\x3d"${i18n.close}" class\x3d"esriAnalysisCloseIcon"\x3e\x3c/a\x3e\r\n                    \x3c/div\x3e\r\n                \x3c/div\x3e\r\n              \x3c/td\x3e\r\n            \x3c/tr\x3e\r\n         \x3c/table\x3e\r\n    \x3c/div\x3e\r\n    \x3cnav class\x3d"tab-nav feature-nav" data-dojo-attach-point\x3d"_settingsNavCtrl" style\x3d"display:none;"\x3e\r\n      \x3ca href\x3d"#" class\x3d"tab-title is-active general-tab" data-dojo-attach-point\x3d"_generalTab"\x3eGeneral\x3c/a\x3e\r\n      \x3ca href\x3d"#" class\x3d"tab-title history-tab" data-dojo-attach-point\x3d"_historyTab"\x3eHistory\x3c/a\x3e\r\n    \x3c/nav\x3e\r\n   \x3c!--\x3cdiv style\x3d"clear:both; border-bottom: #CCC thin solid; height:1px;width:100%;"\x3e\x3c/div\x3e--\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv data-dojo-type\x3d"dijit/form/Form" data-dojo-attach-point\x3d"_form" readOnly\x3d"true"\x3e\r\n     \x3ctable class\x3d"esriFormTable"\x3e\r\n       \x3ctbody\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_overwriteRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3clabel class\x3d"esriSelectLabel esriLeadingMargin1"\x3e\r\n               \x3cinput type\x3d"radio" data-dojo-attach-point\x3d"_overwriteCheck" data-dojo-type\x3d"dijit/form/CheckBox" data-dojo-props\x3d"checked:false" name\x3d"overwriteResult" value\x3d"false" /\x3e\r\n               ${i18n.overwriteResultLayer}\r\n             \x3c/label\x3e\r\n           \x3c/td\x3e\r\n           \x3ctd class\x3d"shortTextInput"\x3e\r\n             \x3ca href\x3d"#" class\x3d\'esriFloatTrailing helpIcon\' data-dojo-attach-point\x3d"_analysisFieldHelpLink" esriHelpTopic\x3d"overwriteResult"\x3e\x3c/a\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_closeAnalysisRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3clabel class\x3d"esriSelectLabel esriLeadingMargin1"\x3e\r\n               \x3cinput type\x3d"radio" data-dojo-attach-point\x3d"_closeAnalysisCheck" data-dojo-type\x3d"dijit/form/CheckBox" data-dojo-props\x3d"checked:${viewModel.closeAnalysisWidget}" data-dojo-attach-event\x3d"onChange:_handleCloseAnalysisCheck" name\x3d"closeAnalysisWidget" value\x3d"false" /\x3e\r\n               ${i18n.closeAnalysisWisget}\r\n             \x3c/label\x3e\r\n           \x3c/td\x3e\r\n           \x3ctd class\x3d"shortTextInput"\x3e\r\n             \x3ca href\x3d"#" class\x3d\'esriFloatTrailing helpIcon\' data-dojo-attach-point\x3d"_analysisFieldHelpLink" esriHelpTopic\x3d"closeAnalysisWidget"\x3e\x3c/a\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_storeAnalysisRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3clabel class\x3d"esriSelectLabel esriLeadingMargin1"\x3e\r\n               \x3cinput type\x3d"radio" data-dojo-attach-point\x3d"_storeAnalysisCheck" data-dojo-type\x3d"dijit/form/CheckBox" data-dojo-props\x3d"checked:false" data-dojo-attach-event\x3d"onChange:_handleReturnFeatureCollectionCheck" name\x3d"storeAnalysisResults" value\x3d"false" /\x3e\r\n               ${i18n.storeAnalysisResults}\r\n             \x3c/label\x3e\r\n           \x3c/td\x3e\r\n           \x3ctd class\x3d"shortTextInput"\x3e\r\n             \x3ca href\x3d"#" class\x3d\'esriFloatTrailing helpIcon\' data-dojo-attach-point\x3d"_analysisFieldHelpLink" esriHelpTopic\x3d"storeAnalysisResults"\x3e\x3c/a\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_coordinateLblRow"\x3e\r\n           \x3ctd class\x3d"esriAlignLeading esriAnalysisTitle" colspan\x3d"3"\x3e\r\n             \x3clabel class\x3d"esriAnalysisStepsLabel"\x3e${i18n.CoordinateSys}\x3c/label\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_outSRLblRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3clabel class\x3d"esriLeadingMargin1"\x3e${i18n.outSR}\x3c/label\x3e\r\n           \x3c/td\x3e\r\n           \x3ctd class\x3d"shortTextInput"\x3e\r\n             \x3ca href\x3d"#" class\x3d\'esriFloatTrailing helpIcon\' esriHelpTopic\x3d"outputCoordinateSystem"\x3e\x3c/a\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_outSRRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3cselect class\x3d"esriLeadingMargin1 longInput esriLongLabel" data-dojo-type\x3d"dijit/form/Select" data-dojo-attach-point\x3d"_outSRSelect" data-dojo-attach-event\x3d"onChange:_handleSRSelectChange"\x3e\r\n               \x3coption value\x3d"DEFAULT"\x3e${i18n.defaultExtentLabel}\x3c/option\x3e\r\n               \x3coption value\x3d"SPECIFIED"\x3e${i18n.extentSpecfiedBelow}\x3c/option\x3e\r\n             \x3c/select\x3e\r\n           \x3c/td\x3e\r\n           \x3ctd style\x3d"width:15%"\x3e\r\n             \x3cdiv data-dojo-type\x3d"dijit/form/ToggleButton" data-dojo-props\x3d"showLabel:false,iconClass:\'esriAnalysisSRIcon\'" data-dojo-attach-point\x3d"_outSRBtn" data-dojo-attach-event\x3d"onChange:_handleOutSRBtnClick"\x3e\x3c/div\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_outSRCustomRow" style\x3d"display:none;"\x3e\r\n           \x3ctd colspan\x3d"3"\x3e\r\n             \x3clabel class\x3d"esriLeadingMargin2"\x3e${i18n.spatialReference}\x3c/label\x3e\r\n             \x3cinput style\x3d"width:20%;" class\x3d"mediumInput esriMediumLabel" type\x3d"text" data-dojo-props\x3d"constraints: {pattern: \'######\', places: 0}" data-dojo-attach-point\x3d"_outSRInput" data-dojo-type\x3d"dijit/form/NumberTextBox" data-dojo-attach-event\x3d"onChange:_handleOutSRInputChange"\x3e\x3c/input\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_outSRCustomInputRow" style\x3d"display:none;"\x3e\r\n           \x3ctd colspan\x3d"3"\x3e\r\n             \x3clabel class\x3d"esriLeadingMargin2" data-dojo-attach-point\x3d"_outSRLabel"\x3e\x3c/label\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_processSRLblRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3clabel class\x3d"esriLeadingMargin1"\x3e${i18n.processSR}\x3c/label\x3e\r\n           \x3c/td\x3e\r\n           \x3ctd class\x3d"shortTextInput"\x3e\r\n             \x3ca href\x3d"#" class\x3d\'esriFloatTrailing helpIcon\' esriHelpTopic\x3d"processingCoordinateSystem"\x3e\x3c/a\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_processSRRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3cselect class\x3d"esriLeadingMargin1 longInput esriLongLabel" data-dojo-type\x3d"dijit/form/Select" data-dojo-attach-point\x3d"_processSRSelect" data-dojo-attach-event\x3d"onChange:_handleProcessSRSelectChange"\x3e\r\n               \x3coption value\x3d"DEFAULT"\x3e${i18n.defaultExtentLabel}\x3c/option\x3e\r\n               \x3coption value\x3d"SPECIFIED"\x3e${i18n.extentSpecfiedBelow}\x3c/option\x3e\r\n             \x3c/select\x3e\r\n           \x3c/td\x3e\r\n           \x3ctd style\x3d"width:15%"\x3e\r\n             \x3cdiv data-dojo-type\x3d"dijit/form/ToggleButton" class\x3d"esriFloatLeading" data-dojo-props\x3d"showLabel:false,iconClass:\'esriAnalysisSRIcon\'" data-dojo-attach-point\x3d"_processSRBtn" data-dojo-attach-event\x3d"onChange:_handleProcessSRBtnClick"\x3e\x3c/div\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_processSRCustomRow" style\x3d"display:none;"\x3e\r\n           \x3ctd colspan\x3d"3"\x3e\r\n             \x3clabel class\x3d"esriLeadingMargin2"\x3e${i18n.spatialReference}\x3c/label\x3e\r\n             \x3cinput style\x3d"width:20%;" class\x3d"mediumInput esriMediumLabel" type\x3d"text" data-dojo-props\x3d"constraints: {pattern: \'######\', places: 0}" data-dojo-attach-point\x3d"_processSRInput" data-dojo-type\x3d"dijit/form/NumberTextBox" data-dojo-attach-event\x3d"onChange:_handleProcessSRInputChange"\x3e\x3c/input\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_processSRCustomInputRow" style\x3d"display:none;"\x3e\r\n           \x3ctd colspan\x3d"3"\x3e\r\n             \x3clabel class\x3d"esriLeadingMargin2" data-dojo-attach-point\x3d"_processSRLabel"\x3e\x3c/label\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_processExtLblRow"\x3e\r\n           \x3ctd class\x3d"esriAlignLeading esriAnalysisTitle" colspan\x3d"3"\x3e\r\n             \x3clabel class\x3d"esriAnalysisStepsLabel"\x3e${i18n.processExtent}\x3c/label\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_extentLblRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3clabel class\x3d"esriLeadingMargin1"\x3e${i18n.extent}\x3c/label\x3e\r\n           \x3c/td\x3e\r\n           \x3ctd class\x3d"shortTextInput"\x3e\r\n             \x3ca href\x3d"#" class\x3d\'esriFloatTrailing helpIcon\' esriHelpTopic\x3d"processingExtent"\x3e\x3c/a\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_extentRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3cselect class\x3d"esriLeadingMargin1 longInput esriLongLabel" data-dojo-type\x3d"dijit/form/Select" data-dojo-attach-point\x3d"_extentSelect" data-dojo-attach-event\x3d"onChange:_handleExtentOptionChange"\x3e\r\n               \x3coption value\x3d"DEFAULT"\x3e${i18n.defaultLabel}\x3c/option\x3e\r\n               \x3coption value\x3d"DISPLAY"\x3e${i18n.extentAsDisplay}\x3c/option\x3e\r\n               \x3coption value\x3d"SPECIFIED"\x3e${i18n.extentSpecfiedBelow}\x3c/option\x3e\r\n             \x3c/select\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_extentLbl"\x3e\r\n           \x3ctd style\x3d"padding:0" colspan\x3d"2"\x3e\r\n             \x3cdiv class\x3d"esriLeadingMargin1"\x3e\r\n               \x3clabel class\x3d"esriSmallLabel"\x3e${i18n.enterCoords}\x3c/label\x3e\r\n             \x3c/div\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_customExtentRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3ctable class\x3d"esriLeadigMargin1 esriFormTable" style\x3d"width:90%;"\x3e\r\n               \x3ctr\x3e\r\n                 \x3ctd\x3e\r\n                   \x3clabel class\x3d""\x3e${i18n.xMin}\x3c/label\x3e\r\n                   \x3cinput type\x3d"text" class\x3d"mediumInput" style\x3d"width:65%;" data-dojo-attach-point\x3d"_xMinInput" data-dojo-type\x3d"dijit/form/NumberTextBox"\x3e\x3c/input\x3e\r\n                 \x3c/td\x3e\r\n                 \x3ctd\x3e\r\n                   \x3clabel\x3e${i18n.xMax}\x3c/label\x3e\r\n                   \x3cinput type\x3d"text" class\x3d"mediumInput" style\x3d"width:65%;" data-dojo-attach-point\x3d"_xMaxInput" data-dojo-type\x3d"dijit/form/NumberTextBox"\x3e\x3c/input\x3e\r\n                 \x3c/td\x3e\r\n               \x3c/tr\x3e\r\n               \x3ctr\x3e\r\n                 \x3ctd\x3e\r\n                   \x3clabel class\x3d""\x3e${i18n.yMin}\x3c/label\x3e\r\n                   \x3cinput type\x3d"text" class\x3d"mediumInput" style\x3d"width:65%;" data-dojo-attach-point\x3d"_yMinInput" data-dojo-type\x3d"dijit/form/NumberTextBox"\x3e\x3c/input\x3e\r\n                 \x3c/td\x3e\r\n                 \x3ctd\x3e\r\n                   \x3clabel\x3e${i18n.yMax}\x3c/label\x3e\r\n                   \x3cinput type\x3d"text" class\x3d"mediumInput" style\x3d"width:65%;" data-dojo-attach-point\x3d"_yMaxInput" data-dojo-type\x3d"dijit/form/NumberTextBox"\x3e\x3c/input\x3e\r\n                 \x3c/td\x3e\r\n               \x3c/tr\x3e\r\n             \x3c/table\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_snapLblRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3clabel class\x3d"esriLeadingMargin1"\x3e${i18n.snapRaster}\x3c/label\x3e\r\n           \x3c/td\x3e\r\n           \x3ctd class\x3d"shortTextInput"\x3e\r\n             \x3ca href\x3d"#" class\x3d\'esriFloatTrailing helpIcon\' esriHelpTopic\x3d"snapRaster"\x3e\x3c/a\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_snapSelRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3cselect class\x3d"esriLeadingMargin1 longInput esriLongLabel" data-dojo-type\x3d"dijit/form/Select" data-dojo-attach-point\x3d"_snapRasterSelect" data-dojo-attach-event\x3d"onChange:_handleSnapRasterSelectChange"\x3e\x3c/select\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_geoanalyticsLblRow"\x3e\r\n           \x3ctd class\x3d"esriAlignLeading esriAnalysisTitle" colspan\x3d"3"\x3e\r\n             \x3clabel class\x3d"esriAnalysisStepsLabel"\x3e${i18n.geoanalytis}\x3c/label\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_datastoreLabelRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3clabel class\x3d"esriLeadingMargin1"\x3e${i18n.datastoreLabel}\x3c/label\x3e\r\n           \x3c/td\x3e\r\n           \x3ctd class\x3d"shortTextInput"\x3e\r\n             \x3ca href\x3d"#" class\x3d\'esriFloatTrailing helpIcon\' esriHelpTopic\x3d"dataStore"\x3e\x3c/a\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_selectDataStore"\x3e\r\n           \x3ctd colspan\x3d"2" data-dojo-attach-point\x3d"_dataStoreTd"\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_rasterLblRow"\x3e\r\n           \x3ctd class\x3d"esriAlignLeading esriAnalysisTitle" colspan\x3d"3"\x3e\r\n             \x3clabel class\x3d"esriAnalysisStepsLabel"\x3e${i18n.rasterLabel}\x3c/label\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_cellLblRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3clabel class\x3d"esriLeadingMargin1"\x3e${i18n.cellSize}\x3c/label\x3e\r\n           \x3c/td\x3e\r\n           \x3ctd class\x3d"shortTextInput"\x3e\r\n             \x3ca href\x3d"#" class\x3d\'esriFloatTrailing helpIcon\' esriHelpTopic\x3d"cellSize"\x3e\x3c/a\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_cellSelectRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3cselect class\x3d"esriLeadingMargin1 longInput esriLongLabel" data-dojo-type\x3d"dijit/form/Select" data-dojo-attach-point\x3d"_cellSizeSelect" data-dojo-attach-event\x3d"onChange:_handleCellSizeSelectChange"\x3e\x3c/select\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_cellSelectNumRow" style\x3d"display:none;"\x3e\r\n           \x3ctd colspan\x3d"3"\x3e\r\n             \x3cinput style\x3d"width:20%;" class\x3d"esriLeadingMargin1 mediumInput esriMediumLabel" type\x3d"text" data-dojo-attach-point\x3d"_cellSizeInput" data-dojo-type\x3d"dijit/form/NumberTextBox" data-dojo-attach-event\x3d"onChange:_handleCellSizeInputChange"\x3e\x3c/input\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_maskLblRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3clabel class\x3d"esriLeadingMargin1"\x3e${i18n.mask}\x3c/label\x3e\r\n           \x3c/td\x3e\r\n           \x3ctd class\x3d"shortTextInput"\x3e\r\n             \x3ca href\x3d"#" class\x3d\'esriFloatTrailing helpIcon\' esriHelpTopic\x3d"mask"\x3e\x3c/a\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_maskSelRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3cselect class\x3d"esriLeadingMargin1 longInput esriLongLabel" data-dojo-type\x3d"dijit/form/Select" data-dojo-attach-point\x3d"_maskSelect" data-dojo-attach-event\x3d"onChange:_handleMaskSelectChange"\x3e\x3c/select\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_creditWarningRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3clabel class\x3d"esriSelectLabel esriLeadingMargin1"\x3e\r\n               \x3cinput type\x3d"radio" data-dojo-attach-point\x3d"_creditWarningCheck" data-dojo-type\x3d"dijit/form/CheckBox" data-dojo-props\x3d"checked:true" data-dojo-attach-event\x3d"onChange:_handleCreditWarningCheck" name\x3d"creditWarning" value\x3d"false" /\x3e\r\n               ${i18n.creditWarning}\r\n             \x3c/label\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_storageLblRow"\x3e\r\n           \x3ctd class\x3d"esriAlignLeading esriAnalysisTitle" colspan\x3d"3"\x3e\r\n             \x3clabel class\x3d"esriAnalysisStepsLabel"\x3e${i18n.storageLabel}\x3c/label\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_resamplingMethodLblRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3clabel class\x3d"esriLeadingMargin1"\x3e${i18n.resamplingMethod}\x3c/label\x3e\r\n           \x3c/td\x3e\r\n           \x3ctd class\x3d"shortTextInput"\x3e\r\n             \x3ca href\x3d"#" class\x3d\'esriFloatTrailing helpIcon\' esriHelpTopic\x3d"resamplingMethod"\x3e\x3c/a\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_resamplingMethodSelRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3cselect class\x3d"esriLeadingMargin1 longInput esriLongLabel" data-dojo-type\x3d"dijit/form/Select" data-dojo-attach-point\x3d"_resamplingMethodSelect" data-dojo-attach-event\x3d"onChange:_handleResamplingMethodSelectChange"\x3e\x3c/select\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_processorLblRow"\x3e\r\n           \x3ctd class\x3d"esriAlignLeading esriAnalysisTitle" colspan\x3d"3"\x3e\r\n             \x3clabel class\x3d"esriAnalysisStepsLabel"\x3e${i18n.processorType}\x3c/label\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_processorTypeLblRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3clabel class\x3d"esriLeadingMargin1"\x3e${i18n.processorType}\x3c/label\x3e\r\n           \x3c/td\x3e\r\n           \x3ctd class\x3d"shortTextInput"\x3e\r\n             \x3ca href\x3d"#" class\x3d\'esriFloatTrailing helpIcon\' esriHelpTopic\x3d"processorType"\x3e\x3c/a\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_processorTypeSelRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3cselect class\x3d"esriLeadingMargin1 longInput esriLongLabel" data-dojo-type\x3d"dijit/form/Select" data-dojo-attach-point\x3d"_processorTypeSelect" data-dojo-attach-event\x3d"onChange:_handleProcessorTypeSelectChange"\x3e\x3c/select\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_parallelProcessingLblRow"\x3e\r\n           \x3ctd class\x3d"esriAlignLeading esriAnalysisTitle" colspan\x3d"3"\x3e\r\n             \x3clabel class\x3d"esriAnalysisStepsLabel"\x3e${i18n.parallelProcessingLabel}\x3c/label\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_recycleProcessingWorkersLblRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3clabel class\x3d"esriLeadingMargin1"\x3e${i18n.recycleProcessingWorkers}\x3c/label\x3e\r\n           \x3c/td\x3e\r\n           \x3ctd class\x3d"shortTextInput"\x3e\r\n             \x3ca href\x3d"#" class\x3d\'esriFloatTrailing helpIcon\' esriHelpTopic\x3d"recycleProcessingWorkers"\x3e\x3c/a\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_recycleProcessingWorkersNumRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3cinput class\x3d"esriLeadingMargin1 mediumInput esriMediumLabel" type\x3d"text" data-dojo-attach-point\x3d"_recycleProcessingWorkersInput" data-dojo-type\x3d"dijit/form/NumberTextBox" data-dojo-attach-event\x3d"onChange:_handlerecycleProcessingWorkersInputChange"\x3e\x3c/input\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_parallelProcessingFactorLblRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3clabel class\x3d"esriLeadingMargin1"\x3e${i18n.parallelProcessingFactor}\x3c/label\x3e\r\n           \x3c/td\x3e\r\n           \x3ctd class\x3d"shortTextInput"\x3e\r\n             \x3ca href\x3d"#" class\x3d\'esriFloatTrailing helpIcon\' esriHelpTopic\x3d"parallelProcessingFactor"\x3e\x3c/a\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_parallelProcessingFactorNumRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3cinput class\x3d"esriLeadingMargin1 mediumInput esriMediumLabel" type\x3d"text" data-dojo-attach-point\x3d"_parallelProcessingFactorInput" data-dojo-type\x3d"dijit/form/NumberTextBox" data-dojo-attach-event\x3d"onChange:_handleparallelProcessingFactorInputChange"\x3e\x3c/input\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_retryOnFailuresLblRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3clabel class\x3d"esriLeadingMargin1"\x3e${i18n.retryOnFailures}\x3c/label\x3e\r\n           \x3c/td\x3e\r\n           \x3ctd class\x3d"shortTextInput"\x3e\r\n             \x3ca href\x3d"#" class\x3d\'esriFloatTrailing helpIcon\' esriHelpTopic\x3d"retryOnFailures"\x3e\x3c/a\x3e\r\n           \x3c/td\x3e\r\n         \x3c/tr\x3e\r\n         \x3ctr data-dojo-attach-point\x3d"_retryOnFailuresNumRow"\x3e\r\n           \x3ctd colspan\x3d"2"\x3e\r\n             \x3cinput class\x3d"esriLeadingMargin1 mediumInput esriMediumLabel" type\x3d"text" data-dojo-attach-point\x3d"_retryOnFailuresInput" data-dojo-type\x3d"dijit/form/NumberTextBox" data-dojo-attach-event\x3d"onChange:_handleretryOnFailuresInputChange"\x3e\x3c/input\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\r\n  \x3cdiv data-dojo-attach-point\x3d"_jobHistoryCtr" style\x3d"display:none;"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"_jobsListDiv"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"esriFormWarning esriRoundedBox" data-dojo-attach-point\x3d"_errorMessagePane" style\x3d"display:none;"\x3e\r\n      \x3ca href\x3d"#" title\x3d"${i18n.close}" class\x3d"esriFloatTrailing esriAnalysisCloseIcon" title\x3d\'${i18n.close}\' data-dojo-attach-event\x3d"onclick:_handleCloseMsg"\x3e\r\n      \x3c/a\x3e\r\n      \x3cspan data-dojo-attach-point\x3d"_bodyNode"\x3e\x3c/span\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv data-dojo-type\x3d"dijit/ConfirmDialog" class\x3d"esriAnalysisStgSpatialDialog" title\x3d"${i18n.coordSysDialogTitle}" data-dojo-props\x3d"closable:false" data-dojo-attach-point\x3d"_coordDialog" style\x3d"width:40em;" data-dojo-attach-event\x3d"onExecute:_handleSRDlgOk,onCancel:_handleSRDlgCancel"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"_spatialRefGridNode"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv  class\x3d"esriFloatTrailing" data-dojo-attach-point\x3d"_actionbuttonCtr"\x3e\r\n    \x3cdiv data-dojo-type\x3d"dijit/form/Button"  class\x3d"${cssClass.primaryButton}" data-dojo-attach-point\x3d"_addBtn" data-dojo-attach-event\x3d"onClick:_handleOkButtonClick"\x3e\r\n      ${i18n.apply}\r\n    \x3c/div\x3e\r\n      \x3cdiv data-dojo-type\x3d"dijit/form/Button" class\x3d"${cssClass.button}" data-dojo-attach-point\x3d"_closeBtn" data-dojo-attach-event\x3d"onClick:_handleCancelButtonClick"\x3e\r\n      ${i18n.cancel}\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:esri/dijit/analysis/templates/ExpressionForm.html":'\x3cdiv class\x3d"esriAnalysis esriExpressionForm"\x3e\r\n  \x3cdiv class\x3d"esriFormError esriRoundedBox" data-dojo-attach-point\x3d"_errorMessagePane" style\x3d"display:none;"\x3e\x3c/div\x3e\r\n  \x3c!--\x3cdiv class\x3d"clear" style\x3d"height:1em;"\x3e\x3c/div\x3e--\x3e\r\n  \x3cdiv data-dojo-type\x3d"dijit/form/Form" class\x3d"esriSimpleForm" data-dojo-attach-point\x3d"_expressionForm"\x3e\r\n    \x3ctable class\x3d"esriFormTable" style\x3d"border: 1px solid #929497;background-color: #F7F8F8 !important;"\x3e \r\n      \x3ctbody\x3e\r\n        \x3ctr data-dojo-attach-point\x3d"_firstRow" \x3e\r\n          \x3ctd style\x3d"width:75%"\x3e\r\n            \x3cselect class\x3d"" data-dojo-type\x3d"dijit/form/Select" style\x3d"width:100%;table-layout:fixed;" data-dojo-attach-event\x3d"onChange:_handleFirstOperandChange" data-dojo-attach-point\x3d"_firstOperandSelect"\x3e\r\n            \x3c/select\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd style\x3d"width:25%"\x3e\r\n            \x3cselect class\x3d"" data-dojo-type\x3d"dijit/form/Select" data-dojo-attach-event\x3d"onChange:_handleOperatorChange" style\x3d"width:100%;table-layout:fixed;" data-dojo-attach-point\x3d"_operatorSelect"\x3e\r\n              \x3coption value\x3d"where"\x3e${i18n.where}\x3c/option\x3e\r\n              \x3coption value\x3d"intersects"\x3e${i18n.intersects}\x3c/option\x3e\r\n              \x3coption value\x3d"notIntersects"\x3e${i18n.notIntersects}\x3c/option\x3e\r\n              \x3coption value\x3d"withinDistance"\x3e${i18n.withinDistance}\x3c/option\x3e\r\n              \x3coption value\x3d"notWithinDistance"\x3e${i18n.notWithinDistance}\x3c/option\x3e\r\n              \x3coption value\x3d"contains"\x3e${i18n.contains}\x3c/option\x3e\r\n              \x3coption value\x3d"notContains"\x3e${i18n.notContains}\x3c/option\x3e\r\n              \x3coption value\x3d"within"\x3e${i18n.within}\x3c/option\x3e\r\n              \x3coption value\x3d"notWithin"\x3e${i18n.notWithin}\x3c/option\x3e\r\n              \x3coption value\x3d"nearest"\x3e${i18n.nearest}\x3c/option\x3e\r\n              \x3c!--\x3coption value\x3d"contains"\x3e${i18n.contains}\x3c/option\x3e\r\n              \x3coption value\x3d"notContains"\x3e${i18n.notContains}\x3c/option\x3e--\x3e\r\n              \x3c!--\x3coption value\x3d"within"\x3e${i18n.within}\x3c/option\x3e\r\n              \x3coption value\x3d"notWithin"\x3e${i18n.notWithin}\x3c/option\x3e--\x3e\r\n              \x3c!--\x3coption value\x3d"identical"\x3e${i18n.identical}\x3c/option\x3e\r\n              \x3coption value\x3d"notIdentical"\x3e${i18n.notIdentical}\x3c/option\x3e\r\n              \x3coption value\x3d"touches"\x3e${i18n.touches}\x3c/option\x3e\r\n              \x3coption value\x3d"notTouches"\x3e${i18n.notTouches}\x3c/option\x3e--\x3e\r\n              \x3c!--\x3coption value\x3d"crossesOutline"\x3e${i18n.crossesOutline}\x3c/option\x3e\r\n              \x3coption value\x3d"notCrossesOutline"\x3e${i18n.notCrossesOutline}\x3c/option\x3e--\x3e\r\n            \x3c/select\x3e\r\n          \x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr data-dojo-attach-point\x3d"_secondRow" style\x3d"display:none;"\x3e\r\n          \x3ctd data-dojo-attach-point\x3d"_secondOperandTd" colspan\x3d"2"\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"_secondExpressionDiv" style\x3d"display:none; padding-bottom:0.25em;"\x3e\r\n              \x3cinput type\x3d"text" data-dojo-type\x3d"dijit/form/NumberTextBox" data-dojo-attach-event\x3d"onChange:_handleDistanceInputChange" data-dojo-props\x3d"intermediateChanges:true" data-dojo-attach-point\x3d"_distanceInput" style\x3d"width:20%;"\x3e\x3c/input\x3e\r\n              \x3cselect data-dojo-type\x3d"dijit/form/Select"  data-dojo-attach-point\x3d"_distanceUnitsSelect"  style\x3d"width:20%;table-layout:fixed;"\x3e\r\n                \x3coption value\x3d"Miles"\x3e${i18n.miles}\x3c/option\x3e\r\n                \x3coption value\x3d"Yards"\x3e${i18n.yards}\x3c/option\x3e\r\n                \x3coption value\x3d"Feet"\x3e${i18n.feet}\x3c/option\x3e\r\n                \x3coption type\x3d"separator"\x3e\x3c/option\x3e\r\n                \x3coption value\x3d"Kilometers"\x3e${i18n.kilometers}\x3c/option\x3e\r\n                \x3coption value\x3d"Meters"\x3e${i18n.meters}\x3c/option\x3e\r\n                \x3coption value\x3d"NauticalMiles"\x3e${i18n.nautMiles}\x3c/option\x3e\r\n              \x3c/select\x3e\r\n              \x3clabel\x3e ${i18n.from} \x3c/label\x3e\r\n            \x3c/div\x3e\r\n            \x3cselect class\x3d"" data-dojo-type\x3d"dijit/form/Select" style\x3d"width:75%;table-layout:fixed;" data-dojo-attach-point\x3d"_secondOperandSelect" data-dojo-attach-event\x3d"onChange:_handleSecondOperandChange"\x3e\r\n            \x3c/select\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"_attrFilterDiv" style\x3d"display:none;"\x3e\x3c/div\x3e\r\n          \x3c/td\x3e\r\n        \x3c/tr\x3e\r\n      \x3c/tbody\x3e\r\n    \x3c/table\x3e\r\n    \x3cdiv class\x3d"esriFormWarning esriRoundedBox" data-dojo-attach-point\x3d"_errorMessagePane" style\x3d"display:none;"\x3e\r\n      \x3ca href\x3d"#" title\x3d"${i18n.close}" class\x3d"esriFloatTrailing esriAnalysisInfoPaneCloseIcon" title\x3d\'${i18n.close}\' data-dojo-attach-event\x3d"onclick:_handleCloseMsg"\x3e\r\n      \x3c/a\x3e\r\n      \x3cspan data-dojo-attach-point\x3d"_bodyNode"\x3e\x3c/span\x3e\r\n    \x3c/div\x3e    \r\n    \x3cdiv style\x3d"clear:both;"\x3e\x3c/div\x3e\r\n    \x3cdiv  class\x3d"esriFloatTrailing" style\x3d"padding: 10px 5px;"\x3e\r\n      \x3cdiv data-dojo-type\x3d"dijit/form/Button"  class\x3d"${_addBtnClass}" data-dojo-attach-point\x3d"_addBtn" data-dojo-attach-event\x3d"onClick:_handleAddButtonClick"\x3e\r\n        ${i18n.add}\r\n      \x3c/div\x3e\r\n       \x3cdiv data-dojo-type\x3d"dijit/form/Button" class\x3d"esriLeadingMargin05" data-dojo-attach-point\x3d"_closeBtn" data-dojo-attach-event\x3d"onClick:_handleCloseButtonClick"\x3e\r\n        ${i18n.close}\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \r\n  \x3c/div\x3e\r\n\x3c/div\x3e  \r\n',
"url:esri/dijit/analysis/components/FilterAndSelection/FilterAndSelection.html":'\x3cdiv class\x3d"esriLeadingMargin1 esriFloatTrailing marginTop1"\x3e\r\n  \x3cdiv data-dojo-type\x3d"dijit/form/ToggleButton" class\x3d"esriActionButton" data-dojo-props\x3d"label:\'${i18n.selectLabel}\',iconClass:\'esriAnalysisSelectFilterIcon\',showLabel:false" data-dojo-attach-point\x3d"_selectBtn" data-dojo-attach-event\x3d"onChange:_handleSelectionButtonClick"\x3e\x3c/div\x3e\r\n  \x3cdiv data-dojo-type\x3d"dijit/form/Button" class\x3d"esriActionButton" data-dojo-props\x3d"label:\'${i18n.queryLabel}\',iconClass:\'esriAnalysisAttributeFiltercon\',showLabel:false" data-dojo-attach-point\x3d"_queryBtn" data-dojo-attach-event\x3d"onClick:_handleQueryButtonClick"\x3e\x3c/div\x3e\r\n  \x3cdiv data-dojo-type\x3d"dijit/Dialog" title\x3d"${i18n.expression}" data-dojo-props\x3d"closable:false" data-dojo-attach-point\x3d"_expDialog" style\x3d"width:65em;"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"_expressionForm" data-dojo-type\x3d"esri/dijit/analysis/ExpressionForm" data-dojo-props\x3d"showFirstRow:false,primaryActionButttonClass:\'btn calcite blue\'"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',
"url:esri/dijit/analysis/templates/CreditEstimator.html":'\x3cdiv class\x3d"esriAnalysis esriSimpleForm"\x3e\r\n  \x3ctable class\x3d"esriFormTable"  data-dojo-attach-point\x3d"_table"  style\x3d"border-collapse:collapse;border-spacing:5px;"\x3e\r\n     \x3c!--\x3ctr\x3e\r\n      \x3ctd\x3e\r\n        \x3clabel class\x3d"esriFloatLeading"\x3e${i18n.analysisLayersLabel}\x3c/label\x3e\r\n      \x3c/td\x3e\r\n      \x3ctd\x3e\r\n      \x3c/td\x3e\r\n    \x3c/tr\x3e--\x3e\r\n     \x3ctr\x3e\r\n      \x3ctd\x3e\r\n        \x3clabel class\x3d"esriFloatLeading" data-dojo-attach-point\x3d"_totalRecordsLabelNode"\x3e${i18n.totalRecordsLabel}\x3c/label\x3e\r\n      \x3c/td\x3e\r\n      \x3ctd data-dojo-attach-point\x3d"_totalRecordsNode"\x3e\r\n      \x3c/td\x3e\r\n    \x3c/tr\x3e\r\n     \x3c!--\x3ctr\x3e\r\n      \x3ctd\x3e\r\n        \x3clabel class\x3d"esriFloatLeading"\x3e${i18n.creditsAvailLabel}\x3c/label\x3e\r\n      \x3c/td\x3e\r\n      \x3ctd\x3e\r\n      \x3c/td\x3e\r\n    \x3c/tr\x3e--\x3e\r\n     \x3ctr\x3e\r\n      \x3ctd\x3e\r\n        \x3clabel class\x3d"esriFloatLeading" data-dojo-attach-point\x3d"_costLabelNode"\x3e${i18n.creditsReqLabel}\x3c/label\x3e\r\n      \x3c/td\x3e\r\n      \x3ctd data-dojo-attach-point\x3d"_creditsReqNode"\x3e\r\n      \x3c/td\x3e\r\n    \x3c/tr\x3e\r\n  \x3c/table\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"_messageDiv"\x3e\x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:esri/dijit/analysis/templates/CreateViewshed.html":'\x3cdiv class\x3d"esriAnalysis"\x3e\r\n  \x3cdiv data-dojo-type\x3d"dijit/layout/ContentPane" style\x3d"margin-top:0.5em; margin-bottom: 0.5em;"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"_hotspotsToolContentTitle" class\x3d"analysisTitle"\x3e\r\n         \x3ctable class\x3d"esriFormTable" \x3e \r\n            \x3ctr\x3e\r\n              \x3ctd class\x3d"esriToolIconTd"\x3e\x3cdiv class\x3d"createViewshedIcon"\x3e\x3c/div\x3e\x3c/td\x3e\r\n              \x3ctd class\x3d"esriAlignLeading esriAnalysisTitle" data-dojo-attach-point\x3d"_toolTitle"\x3e\r\n                \x3clabel data-dojo-attach-point\x3d"_titleLbl"\x3e${i18n.createViewshed}\x3c/label\x3e\r\n                \x3cnav class\x3d"breadcrumbs"  data-dojo-attach-point\x3d"_analysisModeLblNode" style\x3d"display:none;"\x3e\r\n                  \x3ca href\x3d"#" class\x3d"crumb breadcrumbs__modelabel" data-dojo-attach-event\x3d"onclick:_handleModeCrumbClick" data-dojo-attach-point\x3d"_analysisModeCrumb"\x3e\x3c/a\x3e\r\n                  \x3ca href\x3d"#" class\x3d"crumb is-active" data-dojo-attach-point\x3d"_analysisTitleCrumb" style\x3d"font-size:16px;"\x3e${i18n.createViewshed}\x3c/a\x3e\r\n                \x3c/nav\x3e                 \r\n              \x3c/td\x3e\r\n              \x3ctd\x3e\r\n                \x3cdiv class\x3d"esriFloatTrailing" style\x3d"padding:0;"\x3e\r\n                    \x3cdiv class\x3d"esriFloatLeading"\x3e\r\n                      \x3ca href\x3d"#" class\x3d\'esriFloatLeading helpIcon\' esriHelpTopic\x3d"toolDescription"\x3e\x3c/a\x3e\r\n                    \x3c/div\x3e\r\n                    \x3cdiv class\x3d"esriFloatTrailing"\x3e\r\n                      \x3ca href\x3d"#" data-dojo-attach-point\x3d"_closeBtn" title\x3d"${i18n.close}" class\x3d"esriAnalysisCloseIcon"\x3e\x3c/a\x3e\r\n                    \x3c/div\x3e              \r\n                \x3c/div\x3e  \r\n              \x3c/td\x3e\r\n            \x3c/tr\x3e\r\n         \x3c/table\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv style\x3d"clear:both; border-bottom: #CCC thin solid; height:1px;width:100%;"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv data-dojo-type\x3d"dijit/form/Form" data-dojo-attach-point\x3d"_form" readOnly\x3d"true"\x3e\r\n     \x3ctable class\x3d"esriFormTable"\x3e \r\n       \x3ctbody\x3e\r\n        \x3ctr data-dojo-attach-point\x3d"_titleRow"\x3e\r\n          \x3ctd  colspan\x3d"3" class\x3d"sectionHeader" data-dojo-attach-point\x3d"_interpolateToolDescription" \x3e\x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr data-dojo-attach-point\x3d"_analysisLabelRow" style\x3d"display:none;"\x3e\r\n          \x3ctd colspan\x3d"2"\x3e\r\n            \x3clabel class\x3d"esriFloatLeading  esriTrailingMargin025 esriAnalysisNumberLabel"\x3e${i18n.oneLabel}\x3c/label\x3e\r\n            \x3clabel class\x3d"esriAnalysisStepsLabel"\x3e${i18n.analysisLayerLabel}\x3c/label\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd\x3e\r\n            \x3ca href\x3d"#" class\x3d\'esriFloatTrailing helpIcon\' esriHelpTopic\x3d"inputLayer"\x3e\x3c/a\x3e\r\n          \x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr data-dojo-attach-point\x3d"_selectAnalysisRow" style\x3d"display:none;"\x3e\r\n          \x3ctd  colspan\x3d"3"\x3e\r\n            \x3ctable style\x3d"width:100%;"\x3e\r\n              \x3ctr\x3e\r\n                \x3ctd style\x3d"width:80%"\x3e  \r\n                \x3cselect class\x3d"esriLeadingMargin1 longInput esriLongLabel"  style\x3d"margin-top:1.0em;" data-dojo-type\x3d"dijit/form/Select" data-dojo-attach-point\x3d"_analysisSelect" data-dojo-attach-event\x3d"onChange:_handleAnalysisLayerChange"\x3e\x3c/select\x3e\r\n                \x3c/td\x3e\r\n                \x3ctd style\x3d"width:20%"\x3e\r\n                \x3cdiv data-dojo-type\x3d"dijit/form/ToggleButton"  data-dojo-attach-point\x3d"_analysisPointDrawBtn"  class\x3d"esriFloatLeading esriActionButton" data-dojo-props\x3d"showLabel:false,iconClass:\'toolbarIcon esriPointIcon\',label:\'${i18n.drawLabel}\'" data-dojo-attach-event\x3d"onChange:_handleInputDrawPointChange"\x3e\x3c/div\x3e\r\n                \x3c/td\x3e\r\n              \x3c/tr\x3e\r\n            \x3c/table\x3e\r\n          \x3c/td\x3e\r\n        \x3c/tr\x3e          \r\n        \x3ctr\x3e\r\n          \x3ctd colspan\x3d"3"\x3e\r\n            \x3clabel class\x3d"esriFloatLeading esriTrailingMargin025 esriAnalysisNumberLabel"\x3e${i18n.oneLabel}\x3c/label\x3e\r\n            \x3clabel class\x3d"esriAnalysisStepsLabel"\x3e${i18n.viewshedOptionlabel}\x3c/label\x3e\r\n          \x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd colspan\x3d"2"\x3e\r\n            \x3clabel class\x3d"esriLeadingMargin2"\x3e${i18n.observerHghtLabel}\x3c/label\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd class\x3d"shortTextInput"\x3e\r\n            \x3ca href\x3d"#" class\x3d\'esriFloatTrailing helpIcon\' esriHelpTopic\x3d"ObserverHeight"\x3e\x3c/a\x3e\r\n          \x3c/td\x3e                    \r\n        \x3c/tr\x3e                  \r\n        \x3ctr\x3e\r\n          \x3ctd colspan\x3d"3" style\x3d"padding:0;"\x3e\r\n            \x3ctable class\x3d"esriFormTable esriLeadingMargin2" style\x3d"width:90%;"\x3e\r\n              \x3ctbody\x3e\r\n                \x3ctr\x3e\r\n                \x3ctd  style\x3d"width:50%;padding-right:1em;"\x3e\r\n            \x3cinput type\x3d"text" data-dojo-type\x3d"dijit/form/NumberTextBox" data-dojo-props\x3d"value:${observerHeight},intermediateChanges:true,invalidMessage:\'${i18n.distanceInValidMsg}\',constraints:{min:0}" data-dojo-attach-point\x3d"_obsrHeightInput" style\x3d"width:100%;"\x3e\r\n                \x3c/td\x3e\r\n                \x3ctd colspan\x3d"2"\x3e\r\n            \x3cselect class\x3d"longInput esriAnalysisSelect" data-dojo-type\x3d"dijit/form/Select" data-dojo-attach-point\x3d"_obsrUnitsSelect"\x3e\r\n            \x3c/select\x3e\r\n                \x3c/td\x3e\r\n                \x3c/tr\x3e\r\n              \x3c/tbody\x3e\r\n            \x3c/table\x3e\r\n          \x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd colspan\x3d"2"\x3e\r\n            \x3clabel class\x3d"esriLeadingMargin2"\x3e${i18n.targetHghtLabel}\x3c/label\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd class\x3d"shortTextInput"\x3e\r\n            \x3ca href\x3d"#" class\x3d\'esriFloatTrailing helpIcon\' esriHelpTopic\x3d"TargetHeight"\x3e\x3c/a\x3e\r\n          \x3c/td\x3e                    \r\n        \x3c/tr\x3e                  \r\n        \x3ctr\x3e\r\n          \x3ctd colspan\x3d"3" style\x3d"padding:0;"\x3e\r\n            \x3ctable class\x3d"esriFormTable esriLeadingMargin2" style\x3d"width:90%;"\x3e\r\n              \x3ctbody\x3e\r\n                \x3ctr\x3e\r\n                \x3ctd  style\x3d"width:50%;padding-right:1em;"\x3e\r\n            \x3cinput type\x3d"text" data-dojo-type\x3d"dijit/form/NumberTextBox" data-dojo-props\x3d"value:${targetHeight},intermediateChanges:true,invalidMessage:\'${i18n.distanceInValidMsg}\',constraints:{min:0}" data-dojo-attach-point\x3d"_targetHgtInput" style\x3d"width:100%;"\x3e\r\n                \x3c/td\x3e\r\n                \x3ctd colspan\x3d"2"\x3e\r\n            \x3cselect class\x3d"longInput esriAnalysisSelect" data-dojo-type\x3d"dijit/form/Select" data-dojo-attach-point\x3d"_targetUnitsSelect"\x3e\r\n            \x3c/select\x3e\r\n                \x3c/td\x3e\r\n                \x3c/tr\x3e\r\n              \x3c/tbody\x3e\r\n            \x3c/table\x3e\r\n          \x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd colspan\x3d"2"\x3e\r\n            \x3clabel class\x3d"esriLeadingMargin2"\x3e${i18n.maxDistanceLabel}\x3c/label\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd class\x3d"shortTextInput"\x3e\r\n            \x3ca href\x3d"#" class\x3d\'esriFloatTrailing helpIcon\' esriHelpTopic\x3d"MaximumDistance"\x3e\x3c/a\x3e\r\n          \x3c/td\x3e                    \r\n        \x3c/tr\x3e                   \r\n        \x3ctr\x3e\r\n          \x3ctd colspan\x3d"3" style\x3d"padding:0;"\x3e\r\n            \x3ctable class\x3d"esriFormTable esriLeadingMargin2" style\x3d"width:90%;"\x3e\r\n              \x3ctbody\x3e\r\n                \x3ctr\x3e\r\n                \x3ctd  style\x3d"width:50%;padding-right:1em;"\x3e\r\n            \x3cinput type\x3d"text" data-dojo-type\x3d"dijit/form/NumberTextBox" data-dojo-props\x3d"value:${maximumDistance},intermediateChanges:true,invalidMessage:\'${i18n.distanceInValidMsg}\', constraints:{min:0}" data-dojo-attach-point\x3d"_maximumDistanceInput" style\x3d"width:100%;" data-dojo-attach-event\x3d"onChange:_handleMaxDstChange"\x3e\r\n                \x3c/td\x3e\r\n                \x3ctd colspan\x3d"2"\x3e\r\n            \x3cselect class\x3d"longInput esriAnalysisSelect" data-dojo-type\x3d"dijit/form/Select" data-dojo-attach-point\x3d"_distanceUnitsSelect" data-dojo-attach-event\x3d"onChange:_handleMaxDstUnitsChange"\x3e\r\n            \x3c/select\x3e\r\n                \x3c/td\x3e\r\n               \x3c/tr\x3e                  \r\n                \x3c/tbody\x3e\r\n              \x3c/table\x3e\r\n            \x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd colspan\x3d"3" class\x3d"clear"\x3e\x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd colspan\x3d"2"\x3e\r\n            \x3clabel class\x3d"esriFloatLeading esriTrailingMargin025 esriAnalysisNumberLabel"\x3e${i18n.twoLabel}\x3c/label\x3e\r\n            \x3clabel class\x3d"esriAnalysisStepsLabel"\x3e${i18n.outputLayerLabel}\x3c/label\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd class\x3d"shortTextInput"\x3e\r\n            \x3ca href\x3d"#" class\x3d\'esriFloatTrailing helpIcon\' esriHelpTopic\x3d"OutputLayer"\x3e\x3c/a\x3e \r\n          \x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd colspan\x3d"3"\x3e\r\n            \x3cinput type\x3d"text" data-dojo-type\x3d"dijit/form/ValidationTextBox" data-dojo-props\x3d"trim:true,required:true" class\x3d"longTextInput esriLeadingMargin1" data-dojo-attach-point\x3d"_outputLayerInput"\x3e\x3c/input\x3e\r\n          \x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd colspan\x3d"3"\x3e\r\n             \x3cdiv data-dojo-attach-point\x3d"_chooseFolderRow" class\x3d"esriLeadingMargin1"\x3e\r\n               \x3clabel style\x3d"width:9px;font-size:smaller;"\x3e${i18n.saveResultIn}\x3c/label\x3e\r\n               \x3cinput class\x3d"longInput" data-dojo-attach-point\x3d"_webMapFolderSelect" data-dojo-type\x3d"dijit/form/FilteringSelect" trim\x3d"true" style\x3d"width:55%;"\x3e\x3c/input\x3e\r\n             \x3c/div\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\r\n  \x3cdiv style\x3d"padding:5px;margin-top:5px;border-top:solid 1px #BBB;"\x3e\r\n    \x3cdiv class\x3d"esriExtentCreditsCtr"\x3e\r\n      \x3ca class\x3d"esriFloatTrailing esriSmallFont"  href\x3d"#" data-dojo-attach-point\x3d"_showCreditsLink"\x3e${i18n.showCredits}\x3c/a\x3e\r\n     \x3clabel data-dojo-attach-point\x3d"_chooseExtentDiv" class\x3d"esriSelectLabel esriExtentLabel"\x3e\r\n       \x3cinput type\x3d"radio" data-dojo-attach-point\x3d"_useExtentCheck" data-dojo-type\x3d"dijit/form/CheckBox" data-dojo-props\x3d"checked:true" name\x3d"extent" value\x3d"true"/\x3e\r\n         ${i18n.useMapExtent}\r\n     \x3c/label\x3e\r\n    \x3c/div\x3e\r\n    \x3cbutton data-dojo-type\x3d"dijit/form/Button" type\x3d"submit" data-dojo-attach-point\x3d"_saveBtn" class\x3d"esriLeadingMargin4 esriAnalysisSubmitButton" data-dojo-attach-event\x3d"onClick:_handleSaveBtnClick"\x3e\r\n        ${i18n.runAnalysis}\r\n    \x3c/button\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv data-dojo-type\x3d"dijit/Dialog" title\x3d"${i18n.creditTitle}" data-dojo-attach-point\x3d"_usageDialog" style\x3d"width:40em;"\x3e\r\n    \x3cdiv data-dojo-type\x3d"esri/dijit/analysis/CreditEstimator"  data-dojo-attach-point\x3d"_usageForm"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e    \r\n\x3c/div\x3e\r\n',
"url:jimu/dijit/templates/CoordinateControl.html":"\x3cdiv class\x3d'coordinateContainer'\x3e\r\n  \x3cdiv class\x3d'coordLabel' data-dojo-attach-point\x3d'coordNameContainer' data-a11y-label-id\x3d'coordLabel'\x3e\r\n    \x3cspan data-dojo-type\x3d'dijit/InlineEditBox' width\x3d'75px' data-dojo-props\x3d\"editor:'dijit/form/TextBox', autoSave:true\"\r\n      data-dojo-attach-point\x3d'coordName'\x3e${type}\x3c/span\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d'add-with-icon coordInput'\x3e\r\n    \x3ctextarea data-a11y-label-by\x3d'coordLabel' tabindex\x3d\"0\" aria-multiline\x3d\"true\" role\x3d\"textbox\" id\x3d'${uid}' type\x3d'text' rows\x3d'1' data-dojo-attach-point\x3d'coordtext' spellcheck\x3d'false'\r\n    placeholder\x3d'${nls.coordinateInputLabel}' title\x3d'${nls.coordinateInputLabel}'\x3e\x3c/textarea\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d'coordactions'\x3e\r\n    \x3cdiv class\x3d'add-with-icon'\x3e\r\n      \x3cspan tabindex\x3d\"0\" role\x3d\"button\" id\x3d'${uid}_cpbtn' aria-label\x3d'${nls.copyToClipboard}' title\x3d'${nls.copyToClipboard}' data-dojo-attach-point\x3d'cpbtn' class\x3d'cpbtn'\x3e\x3c/span\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d'add-with-icon'\x3e\r\n      \x3cspan tabindex\x3d\"0\" role\x3d\"button\" title\x3d\"${nls.formatOutput}\" class\x3d'settingBtn' data-dojo-attach-point\x3d'formatButton'\x3e\x3c/span\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d'add-with-icon'\x3e\r\n      \x3cspan tabindex\x3d\"0\" role\x3d\"button\" aria-label\x3d'${nls.zoomLabel}' title\x3d'${nls.zoomLabel}' class\x3d'zoomBtn' data-dojo-attach-point\x3d'zoomButton'\x3e\x3c/span\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d'add-with-icon'\x3e\r\n      \x3cspan tabindex\x3d\"0\" role\x3d\"button\" aria-label\x3d'${nls.addPointLabel}' title\x3d'${nls.addPointLabel}' class\x3d'drawPointBtn' data-dojo-attach-point\x3d'drawPointButton'\x3e\x3c/span\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d'add-with-icon'\x3e\r\n      \x3cspan tabindex\x3d\"0\" role\x3d\"button\" aria-label\x3d'${nls.removeCoordinate}' title\x3d'${nls.removeCoordinate}' class\x3d'jimu-icon jimu-icon-close' data-dojo-attach-point\x3d'removeControlBtn'\r\n        data-dojo-attach-event\x3d'onclick: remove'\x3e\x3c/span\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d'add-with-icon'\x3e\r\n      \x3cspan tabindex\x3d\"0\" role\x3d\"button\" aria-label\x3d\"${nls.expandOutput}\" aria-expanded \x3d \"false\" title\x3d\"${nls.expandOutput}\" class\x3d'expandBtn' data-dojo-attach-point\x3d'expandButton'\x3e\x3c/span\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d'coordcontrols' class\x3d'coordarea' style\x3d\"display: none\"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d'sub1' class\x3d'coordformat'\x3e\r\n      \x3cdiv class\x3d'crdfrmtlabel'\x3e\r\n        \x3cspan data-dojo-attach-point\x3d'sub1label' data-a11y-label-id\x3d'sub1Label'/\x3e\r\n      \x3c/div\x3e\r\n      \x3cinput data-a11y-label-by\x3d'sub1Label' tabindex\x3d\"-1\" role\x3d\"textbox\" readonly data-dojo-attach-point\x3d'${uid}sub1val' class\x3d'jimu-input crds'\x3e\x3c/input\x3e\r\n      \x3cdiv class\x3d'add-with-icon'\x3e\r\n        \x3cspan tabindex\x3d\"-1\" role\x3d\"button\" id\x3d'${uid}sub1val~cpbtn' aria-label\x3d'${nls.copyToClipboard}' title\x3d'${nls.copyToClipboard}' data-dojo-attach-point\x3d'subVal1CpBtn' class\x3d'jimu-icon cpbtn'\x3e\x3c/span\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d'sub2' class\x3d'coordformat'\x3e\r\n      \x3cdiv class\x3d'crdfrmtlabel'\x3e\r\n        \x3cspan data-dojo-attach-point\x3d'sub2label' data-a11y-label-id\x3d'sub2Label'/\x3e\r\n      \x3c/div\x3e\r\n      \x3cinput data-a11y-label-by\x3d'sub2Label' tabindex\x3d\"-1\" role\x3d\"textbox\" readonly data-dojo-attach-point\x3d'${uid}sub2val' class\x3d'jimu-input crds'\x3e\x3c/input\x3e\r\n      \x3cdiv class\x3d'add-with-icon'\x3e\r\n        \x3cspan tabindex\x3d\"-1\" role\x3d\"button\" id\x3d'${uid}sub2val~cpbtn' aria-label\x3d'${nls.copyToClipboard}' title\x3d'${nls.copyToClipboard}' data-dojo-attach-point\x3d'subVal2CpBtn' class\x3d'jimu-icon cpbtn'\x3e\x3c/span\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d'sub3' class\x3d'coordformat sub3'\x3e\r\n      \x3cdiv class\x3d'crdfrmtlabel'\x3e\r\n        \x3cspan data-dojo-attach-point\x3d'sub3label' data-a11y-label-id\x3d'sub3Label'/\x3e\r\n      \x3c/div\x3e\r\n      \x3cinput data-a11y-label-by\x3d'sub3Label' tabindex\x3d\"-1\" role\x3d\"textbox\" readonly data-dojo-attach-point\x3d'${uid}sub3val' class\x3d'jimu-input crds'\x3e\r\n      \x3c/input\x3e\r\n      \x3cdiv class\x3d'add-with-icon'\x3e\r\n        \x3cspan tabindex\x3d\"-1\" role\x3d\"button\" id\x3d'${uid}sub3val~cpbtn' aria-label\x3d'$${nls.copyToClipboard}' title\x3d'$${nls.copyToClipboard}' data-dojo-attach-point\x3d'subVal3CpBtn' class\x3d'jimu-icon cpbtn'\x3e\x3c/span\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d'sub4' class\x3d'coordformat sub4'\x3e\r\n      \x3cdiv class\x3d'crdfrmtlabel'\x3e\r\n        \x3cspan data-dojo-attach-point\x3d'sub4label' data-a11y-label-id\x3d'sub4Label' /\x3e\r\n      \x3c/div\x3e\r\n      \x3cinput data-a11y-label-by\x3d'sub4Label' tabindex\x3d\"-1\" role\x3d\"textbox\" readonly data-dojo-attach-point\x3d'${uid}sub4val' class\x3d'jimu-input crds'\x3e\r\n      \x3c/input\x3e\r\n      \x3cdiv class\x3d'add-with-icon'\x3e\r\n        \x3cspan tabindex\x3d\"-1\" role\x3d\"button\" id\x3d'${uid}sub4val~cpbtn' aria-label\x3d'${nls.copyToClipboard} title\x3d'${nls.copyToClipboard}' data-dojo-attach-point\x3d'subVal4CpBtn' class\x3d'jimu-icon cpbtn'\x3e\x3c/span\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d\"line-separator\"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e",
"url:dijit/templates/InlineEditBox.html":'\x3cspan data-dojo-attach-point\x3d"editNode" role\x3d"presentation" class\x3d"dijitReset dijitInline dijitOffScreen"\r\n\t\x3e\x3cspan data-dojo-attach-point\x3d"editorPlaceholder"\x3e\x3c/span\r\n\t\x3e\x3cspan data-dojo-attach-point\x3d"buttonContainer"\r\n\t\t\x3e\x3cbutton data-dojo-type\x3d"./form/Button" data-dojo-props\x3d"label: \'${buttonSave}\', \'class\': \'saveButton\'"\r\n\t\t\tdata-dojo-attach-point\x3d"saveButton" data-dojo-attach-event\x3d"onClick:save"\x3e\x3c/button\r\n\t\t\x3e\x3cbutton data-dojo-type\x3d"./form/Button"  data-dojo-props\x3d"label: \'${buttonCancel}\', \'class\': \'cancelButton\'"\r\n\t\t\tdata-dojo-attach-point\x3d"cancelButton" data-dojo-attach-event\x3d"onClick:cancel"\x3e\x3c/button\r\n\t\x3e\x3c/span\r\n\x3e\x3c/span\x3e\r\n',
"url:widgets/Visibility/templates/portal-publish.html":'\x3cdiv class\x3d"esriCTFullHeight" data-dojo-attach-point\x3d"resultsPageNode"\x3e\r\n  \x3cdiv class\x3d"esriCTFullWidth esriCTSettingHeader"\x3e\r\n    \x3cdiv class\x3d"esriCTBackButton" title\x3d"${nls.back}"\x3e\r\n      \x3cdiv class\x3d"esriCTItemLeftArrow" data-dojo-attach-point\x3d"resultsPanelBackButton" tabindex\x3d"0"\r\n        aria-label\x3d"${nls.back}" role\x3d"button"\x3e\x3c/div\x3e\r\n      \x3cdiv class\x3d"esriCTTitleDiv esriCTEllipsis" title\x3d"${nls.resultsTitle}"\x3e${nls.resultsTitle}\x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"esriCTMainPageRow"\x3e\r\n      \x3c!-- esriCT Layer Name --\x3e\r\n      \x3cdiv class\x3d"esriCTFullWidth esriCTSettingRow"\x3e\r\n        \x3cdiv class\x3d"esriCTInputLabel esriCTEllipsis" title\x3d"${nls.layerName}"\x3e${nls.layerName}\x3c/div\x3e\r\n        \x3cinput aria-label\x3d"${nls.layerName}" class\x3d"esriCTHidden" style\x3d"width: 100%; margin-bottom: 8px;"\r\n          data-dojo-type\x3d"dijit/form/ValidationTextBox" data-dojo-attach-point\x3d"addLayerNameArea"\r\n          data-dojo-props\x3d"regExp:\'[a-zA-Z0-9_ -]*\', invalidMessage:\'${nls.invalidLayerName}\', missingMessage:\'${nls.missingLayerNameMessage}\'"\r\n            required\x3d"true" tabindex\x3d"0" trim\x3d"true"\x3e\x3c/input\x3e\r\n        \x3cselect class\x3d"publishSelect" aria-label\x3d"${nls.layerName}" data-dojo-type\x3d"jimu/dijit/formSelect" tabindex\x3d"0"\r\n          data-dojo-attach-point\x3d"featureLayerList"\x3e\x3c/select\x3e\r\n        \x3cdiv class\x3d"esriCTCheckBoxNode" data-dojo-attach-point\x3d"checkBoxParentContainer"\x3e\x3c/div\x3e\r\n      \x3c/div\x3e\r\n      \x3c!-- Publish esriCT Button --\x3e\r\n      \x3cdiv class\x3d"esriCTPublishBtnContainer"\x3e\r\n        \x3cdiv class\x3d\'jimu-btn\' data-dojo-attach-point\x3d\'publishButton\' tabindex\x3d"0" aria-label\x3d"${nls.publishBtnLabel}"\r\n          role\x3d"button"\x3e${nls.publishBtnLabel}\x3c/div\x3e\r\n      \x3c/div\x3e\r\n\r\n      \x3c!-- Publishing Message --\x3e\r\n      \x3cdiv class\x3d"esriCTPublishMessage" data-dojo-attach-point\x3d"publishMessage"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/Visibility/templates/ColorPickerEditor.html":'\x3cdiv class\x3d"esriCTColorPickerEditor"\x3e\r\n  \x3cdiv class\x3d"colorPicker" data-dojo-attach-point\x3d"colorPicker"\x3e\x3c/div\x3e\r\n  \x3cdiv class\x3d"esriCTSliderWrapper"\x3e\r\n    \x3cdiv class\x3d"esriCTSliderbar" data-dojo-attach-point\x3d"sliderBar"\x3e\r\n      \x3col data-dojo-type\x3d"dijit/form/HorizontalRuleLabels" style\x3d"height:2.5em;" container\x3d"topDecoration"\x3e\r\n        \x3cli\x3e${nls.transparency}\x3c/li\x3e\r\n        \x3cli\x3e\x3c/li\x3e\r\n      \x3c/ol\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cinput type\x3d"text" data-dojo-type\x3d"dijit/form/NumberSpinner" value\x3d"0" data-dojo-attach-point\x3d"spinner"\r\n    data-dojo-props\x3d"smallDelta:10,intermediateChanges:true,constraints: {min:0,max:100}" aria-label\x3d"${nls.transparency}"\x3e\r\n  \x3cdiv class\x3d"esriCTOutFillSection"\x3e\r\n    \x3clabel for\x3d"${id}_select"\x3e${nls.style}\x3c/label\x3e\r\n    \x3cselect class\x3d"noResize" data-dojo-type\x3d"jimu/dijit/formSelect" aria-label\x3d"${nls.style}" data-dojo-attach-point\x3d"dropdown" /\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/Visibility/templates/symbologySettings.html":'\x3cdiv\x3e\r\n       \x3c!-- Visible Section DropDown --\x3e\r\n       \x3cdiv class\x3d"esriCTSettingsRow"\x3e\r\n        \x3cdiv class\x3d"esriCTLabelSettingsRightButton esriCTSettingsButtonIcon esriCTPointer"\r\n          title\x3d"${nls.visibleSectionButtonLabel}" data-dojo-attach-point\x3d"visibleSectionSettingsButton"\r\n          role\x3d"button" aria-label\x3d"${nls.visibleSectionButtonLabel}" tabindex\x3d"0" aria-expanded \x3d"false"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTInputLabelSettings esriCTEllipsis esriCTSubTitle" title\x3d"${nls.visibleSectionLabel}"\x3e\r\n          ${nls.visibleSectionLabel}\x3c/div\x3e\r\n      \x3c/div\x3e\r\n\r\n      \x3c!-- Visible Section Color Pickers --\x3e\r\n      \x3cdiv class\x3d"container esriCTGroupHidden" data-dojo-attach-point\x3d"visibleSectionContainer"\x3e\r\n        \x3cdiv class\x3d"esriCTEllipsis" title\x3d"${nls.outline}"\x3e${nls.outline}\x3c/div\x3e\r\n        \x3cdiv class\x3d"colorPicker Line" id\x3d"visibleSectionOutlineColor"\r\n          data-dojo-attach-point\x3d"visibleAreaOutlineColorPicker"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTEllipsis" title\x3d"${nls.fill}"\x3e${nls.fill}\x3c/div\x3e\r\n        \x3cdiv class\x3d"colorPicker Fill" id\x3d"visibleSectionFillColor"\r\n          data-dojo-attach-point\x3d"visibleAreaFillColorPicker"\x3e\x3c/div\x3e\r\n      \x3c/div\x3e\r\n\r\n      \x3c!-- Non-visible Section DropDown --\x3e\r\n      \x3cdiv class\x3d"esriCTSettingsRow"\x3e\r\n        \x3cdiv class\x3d"esriCTLabelSettingsRightButton esriCTSettingsButtonIcon esriCTPointer"\r\n        title\x3d"${nls.nonVisibleSectionButtonLabel}" data-dojo-attach-point\x3d"nonVisibleSectionSettingsButton"\r\n        role\x3d"button" aria-label\x3d"${nls.nonVisibleSectionButtonLabel}" tabindex\x3d"0" aria-expanded \x3d"false"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTInputLabelSettings esriCTEllipsis esriCTSubTitle" title\x3d"${nls.nonVisibleSectionLabel}"\x3e${nls.nonVisibleSectionLabel}\r\n        \x3c/div\x3e\r\n      \x3c/div\x3e\r\n\r\n      \x3c!-- Non-visible Section --\x3e\r\n      \x3cdiv class\x3d"container esriCTGroupHidden" data-dojo-attach-point\x3d"nonVisibleSectionContainer"\x3e\r\n        \x3cdiv class\x3d"esriCTEllipsis" title\x3d"${nls.outline}"\x3e${nls.outline}\x3c/div\x3e\r\n        \x3cdiv class\x3d"colorPicker Line" id\x3d"nonVisibleSectionOutlineColor" data-dojo-attach-point\x3d"nonVisibleAreaOutlineColorPicker"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTEllipsis" title\x3d"${nls.fill}"\x3e${nls.fill}\x3c/div\x3e\r\n        \x3cdiv class\x3d"colorPicker Fill" id\x3d"nonVisibleSectionFillColor" data-dojo-attach-point\x3d"nonVisibleAreaFillColorPicker"\x3e\x3c/div\x3e\r\n      \x3c/div\x3e   \r\n\x3c/div\x3e',
"url:widgets/Visibility/Widget.html":"\x3cdiv\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d'visibilityContainer'\x3e\x3c/div\x3e\r\n\x3c/div\x3e","url:widgets/Visibility/css/style.css":".jimu-widget-visibility-control .controls {margin: 20px 0 0 0;}.jimu-widget-visibility-control .inputNumberTextbox {width: calc(100% - 120px) !important; margin: 0px;}.jimu-widget-visibility-control .controlGroup {padding: 4px 2px;}.jimu-widget-visibility-control .buttonContainer {display: flex;}.jimu-widget-visibility-control .controlSpace {margin-left: unset;}.jimu-widget-visibility-control .titleLabel {padding-bottom: 5px; display: block;}.jimu-widget-visibility-control .noResize .dijitSelectLabel,.jimu-widget-visibility-control .noResize .dijitTextBox .dijitInputInner,.jimu-widget-visibility-control .noResize.dijitValidationTextBox .dijitValidationContainer {text-overflow: ellipsis; overflow: hidden; width: 60px; text-align: initial; padding-top: 5px;}.jimu-widget-visibility-control .claro .dijitSelect {background-color: rgba(255, 255, 255, 0);}.jimu-widget-visibility-control .dijitSelect .dijitButtonContents {border-style: none none none none; background-color: #ffffff;}.jimu-widget-visibility-control .dijitSelect .dijitButtonContentsDartTheme {background-color: inherit;}.jimu-widget-visibility-control .dijitSelect .dijitArrowButton {background-color: #ffffff; background-image: none; border-color: #ffffff;}.jimu-widget-visibility-control .dijitSelect .dijitArrowButtonDartTheme {background-color: rgba(0, 0, 0, 0.5) !important;}.jimu-widget-visibility-control .dijitMenuItem {color: #7989a0;}.jimu-widget-visibility-control .dijitSelect .dijitInputField {margin-right: 8px;}.jimu-widget-visibility-control .cursortooltip {z-index: 10; position: fixed; border: 1px solid #777; color: black; background-color: white; margin: 2px; padding: 6px; border-radius: 6px;}.jimu-widget-visibility-control .center {display: table !important; margin: 0 auto;}.jimu-widget-visibility-control .btnContainer {text-align: right; margin-top: 15px; display: grid; padding: 15px 4px;}.jimu-widget-visibility-control .HalfWidthLeft {width: 50%;}.jimu-widget-visibility-control .HalfWidthRight {width: 50%;}.jimu-widget-visibility-control .jimu-coordinate-control textarea {width: 100%;}.jimu-widget-visibility-control .jimu-coordinate-control .add-with-icon.coordInput {width: calc(100% - 60px);}.jimu-widget-visibility-control .jimu-coordinate-control .coordLabel {font-size: 12px;}.jimu-widget-visibility-control .switch-toggle-group {padding: 5px;}.jimu-widget-visibility-control .switch-toggle-group .checkbox-inline {padding-left: 36px; vertical-align: top;}.jimu-widget-visibility-control .switch-toggle-group .switch-toggle.dijitCheckBox {margin-left: -36px;}.jimu-widget-visibility-control .switch-toggle.dijitCheckBox {height: 16px; width: 28px; border: 0 none; background: #adadad; position: relative; float: right; cursor: pointer; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px;}.jimu-rtl .jimu-widget-visibility-control .switch-toggle.dijitCheckBox {float: left;}.jimu-widget-visibility-control .switch-toggle.dijitCheckBox:before {content: \"\"; background: #f8f8f8; position: absolute; padding: 0; height: 12px; width: 12px; left: auto; right: 14px; top: 2px; z-index: 1; -webkit-transition: right 0.3s; -moz-transition: right 0.3s; -o-transition: right 0.3s; transition: right 0.3s; -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%;}.jimu-widget-visibility-control .switch-toggle.dijitCheckBox input {width: 100%; height: 100%; position: absolute; left: 0; z-index: 2;}.jimu-widget-visibility-control .switch-toggle.dijitCheckBox.dijitCheckBoxChecked {background: #50ad4e;}.jimu-widget-visibility-control .switch-toggle.dijitCheckBox.dijitCheckBoxChecked:before {right: 2px;}.btnContainer {text-align: right; margin-top: 6px;}.settingsContainer {margin-top: 6px;}.checkBoxText {padding: 0 5px 0 5px;}.controlContainer {margin-top: 6px;}.customFormatTextbox {height: 30px; background-color: transparent; border: 1px solid #d2dae2; padding: 5px; margin: 0 3px 0 3px; width: 55%; font-family: 'Avenir Light', Verdana, Geneva, sans-serif;}.coordNotationSelect {background-color: transparent; height: 30px; user-select: none; width: 40%; float: left; border: 1px solid #d2dae2; font-family: 'Avenir Light', Verdana, Geneva, sans-serif; margin-bottom: 5px;}.jimu-rtl .coordNotationSelect {float: right;}.DartTheme .jimu-widget-visibility-control .cusrortooltip {background-color: #4c4c4c;}.claro .dartThemeClaroDijitTooltipContainerOverride .dijitTooltipContainer {background-color: #4c4c4c; background-image: -webkit-linear-gradient(bottom, rgb(76, 76, 76) 0px, #4c4c4c 10px); border: 1px solid #ffffff; color: #ffffff;}.claro .dartThemeClaroDijitTooltipContainerOverride .jimu-widget-subtitle {color: #ffffff;}.claro .dartThemeClaroDijitTooltipContainerOverride .dijitTooltipConnector {background-image: url('images/tooltip.png');}.jimu-widget-visibility-control .jimu-coordinate-control .settingBtn {margin-left: 1px;}.jimu-widget-visibility-control .jimu-coordinate-control .drawPointBtn {margin-left: 2px;}.jimu-widget-visibility-publish .esriCTFullHeight {height: 100%;}.jimu-widget-visibility-publish .esriCTFullWidth,.jimu-widget-visibility-control .esriCTFullWidth {width: 100%;}.jimu-widget-visibility-publish .esriCTSettingHeader,.jimu-widget-visibility-control .esriCTSettingHeader {height: 30px; border-bottom: 1px solid #464646;}.jimu-widget-visibility-publish .esriCTBackButton,.jimu-widget-visibility-control .esriCTBackButton {display: table; width: 100%;}.jimu-widget-visibility-publish .esriCTItemLeftArrow,.jimu-widget-visibility-control .esriCTItemLeftArrow {background-image: url('./images/left-arrow_black.png'); display: table-cell; width: 20px; height: 20px; background-repeat: no-repeat; background-position: center center; cursor: pointer;}.jimu-rtl .jimu-widget-visibility-publish .esriCTItemLeftArrow {transform: rotate(180deg);}.jimu-widget-visibility-publish .esriCTItemLeftArrow:hover {background-image: url('./images/left-arrow_black_hover.png');}.jimu-widget-visibility-publish .esriCTTitleDiv,.jimu-widget-visibility-control .esriCTTitleDiv {line-height: 10px; font-weight: bold; text-align: center; width: calc(100% - 50px); height: 20px; padding-top: 6px;}.jimu-widget-visibility-publish .esriCTEllipsis,.jimu-widget-visibility-control .esriCTEllipsis {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}.jimu-widget-visibility-publish .esriCTMainPageRow,.jimu-widget-visibility-control .esriCTMainPageRow {width: calc(100% - 20px); margin: 20px 10px 10px 10px; display: inline-block;}.jimu-widget-visibility-publish .esriCTInputLabel {float: left; line-height: 28px; padding: 5px 0px 0px 0px; width: 100%;}.jimu-widget-visibility-publish .SelectStyle {height: 30px; color: #7d7d7d; padding-left: 5px; font-size: 13px; width: 100%; margin: 1px 0 8px 0;}.jimu-widget-visibility-publish .publishSelect .dijitSelectLabel {overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 288px; text-align: left;}.jimu-widget-visibility-publish .esriCTCheckBoxNode {padding-top: 10px;}.jimu-widget-visibility-publish .esriCTPublishBtnContainer {text-align: right; margin-top: 15px; display: grid;}.jimu-widget-visibility-publish .esriCTPublishMessage {float: left; line-height: 16px; padding: 18px 0px 0px 0; font-weight: bold; display: inline-block; word-break: break-all;}.jimu-rtl .jimu-widget-visibility-publish .esriCTPublishMessage {float: right;}.jimu-widget-visibility-publish .esriCTHidden {display: none;}.jimu-widget-visiblity .esriCTHidden {display: none;}.jimu-widget-visiblity .jimu-btn {width: 100%;}.jimu-widget-visibility-publish .esriCTPublishControl {float: right; min-width: 9px; line-height: 12px; padding-bottom: 3px; padding-top: 3px;}.jimu-widget-visibility-control .esriCTMainTitleDiv {line-height: 10px; font-weight: bold; text-align: left; width: calc(100% - 50px); padding: 5px 3px 5px 3px; display: inline-block;}.jimu-rtl .jimu-widget-visibility-control .esriCTMainTitleDiv {text-align: right;}.jimu-widget-visibility-control .esriCTSaveToLayerIcon {background-image: url('./images/left-arrow_black.png'); width: 20px; height: 20px; background-repeat: no-repeat; background-position: center center; cursor: pointer; transform: rotate(180deg);}.jimu-rtl .jimu-widget-visibility-control .esriCTSaveToLayerIcon {float: left; transform: rotate(360deg);}.jimu-widget-visibility-control .esriCTSaveToLayerIcon:hover {background-image: url('./images/left-arrow_black_hover.png'); background-repeat: no-repeat;}.jimu-widget-visibility-control .esriCTNewHeader {float: left; height: 30px; border-bottom: 1px solid #464646; padding: 0px 2px;}.jimu-widget-visibility-control .esriCTSliderWrapper {width: calc(100% - 278px); display: inline-block; margin: 5px;}.jimu-widget-visibility-control .dijitSlider {width: 100%;}.jimu-rtl .jimu-widget-visibility-control .dijitSlider {margin-left: auto; margin-right: 10px;}.jimu-widget-visibility-control .dijitSlider .dijitSliderImageHandleH {top: -10px; width: 20px; height: 20px;}.jimu-widget-visibility-control .esriCTColorPickerEditor {padding-top: 5px; padding-bottom: 8px; min-width: 350px; display: inline-table;}.jimu-widget-visibility-control .esriCTColorPickerEditor .jimu-color-picker {display: inline-block; width: 25px; height: 25px;}.jimu-widget-visibility-control .esriCTColorPickerEditor .dijitSpinner.dijitNumberTextBox.dijitValidationTextBox {width: 70px; height: 30px;}.jimu-widget-visibility-control .dijitSliderImageHandleH {top: -7px;}.jimu-widget-visibility-control .dijitSliderThumbHover {background-image: url(\"../images/sliderball.svg\"); background-position: 0 0;}.jimu-widget-visibility-control .dijitSliderImageHandle.dijitSliderImageHandleH {background-image: url(\"../images/sliderball.svg\"); background-position: 0 0;}.jimu-widget-visibility-control .dijitSliderImageHandle.dijitSliderImageHandleH.dojoMoveItem {background-image: url(\"../images/sliderball.svg\"); background-position: 0 0;}.jimu-widget-visibility-control .dijitSlider .dijitSliderProgressBarH,.jimu-widget-visibility-control .dijitSlider .dijitSliderLeftBumper {border-color: #000; background-color: #000; background-image: -webkit-linear-gradient(top, #000 0px, #000 1px, rgba(255, 255, 255, 0) 2px); background-image: -o-linear-gradient(top, #000 0px, #000 1px, rgba(255, 255, 255, 0) 2px); background-image: linear-gradient(top, #000 0px, #000 1px, rgba(255, 255, 255, 0) 2px);}.jimu-widget-visibility-control .dijitSlider .dijitSliderRemainingBarH,.jimu-widget-visibility-control .dijitSlider .dijitSliderRightBumper {border-color: #d7d7d7; background-color: #d7d7d7;}.jimu-widget-visibility-control .esriCTColorPickerEditor .trans {font-family: \"Avenir Light\"; font-size: 12px; padding: 0 5px 0 5px; letter-spacing: 0.33px;}.jimu-widget-visibility-control .sliderbar {width: 60px;}.dijitRuleLabelH {left: -12%;}.jimu-widget-visibility-control .esriCTOutFillSection {vertical-align: middle; display: inline-flex; flex-direction: column; margin: 0px 0px 21px 3px;}.jimu-widget-visibility-symbologySettings .esriCTSettingsRow {width: 100%; display: inline-flex;}.jimu-widget-visibility-symbologySettings .esriCTLabelSettingsRightButton {background: url(\"../images/arrow-right_black.png\") no-repeat;}.jimu-rtl .jimu-widget-visibility-symbologySettings .esriCTLabelSettingsRightButton {transform: rotate(180deg);}.jimu-widget-visibility-symbologySettings .esriCTLabelSettingsRightButton:hover {background: url(\"../images/arrow-right_black_hover.png\") no-repeat;}.jimu-widget-visibility-symbologySettings .esriCTSettingsButtonIcon {margin-top: 13px; height: 16px; width: 16px;}.jimu-rtl .jimu-widget-visibility-symbologySettings .esriCTSettingsButtonIcon {margin: 10px 0px 0px 5px;}.jimu-widget-visibility-symbologySettings .esriCTPointer {cursor: pointer;}.jimu-widget-visibility-symbologySettings .esriCTInputLabelSettings {float: left; line-height: 28px; padding: 5px 0px 0px 0px;}.jimu-widget-visibility-symbologySettings .esriCTEllipsis {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}.jimu-widget-visibility-symbologySettings .esriCTSubTitle {font-weight: bold;}.jimu-widget-visibility-symbologySettings .esriCTGroupHidden {display: none;}.jimu-widget-visibility-symbologySettings .esriCTLabelSettingsDownButton {background: url(\"../images/arrow-down_black.png\") no-repeat; margin-top: 15px;}.jimu-rtl .jimu-widget-visibility-symbologySettings .esriCTLabelSettingsDownButton {margin: 15px 0px 0px 5px;}.jimu-widget-visibility-symbologySettings .esriCTLabelSettingsDownButton:hover {background: url(\"../images/arrow-down_black_hover.png\") no-repeat;}.jimu-widget-visibility-control .esriCTSettingsIcon {background-image: url('./images/settings_black.png'); height: 16px; width: 16px; background-size: 16px; background-repeat: no-repeat; margin-top: 2px; margin-right: 13px; display: inline-block;}.jimu-rtl .jimu-widget-visibility-control .esriCTSettingsIcon {float: left;}.jimu-widget-visibility-control .esriCTSettingsIcon:hover {background-image: url('./images/settings_black_hover.png'); background-repeat: no-repeat;}.jimu-widget-visibility-symbologySettings .esriCTSettingsButtonIcon:focus {outline: 2px solid #24B5CC !important; outline-offset: -2px;}.jimu-widget-visibility-control .esriCTRightSideButton {float: right; display: inline-flex;}.jimu-rtl .jimu-widget-visibility-control .esriCTRightSideButton {float: left;}",
"*now":function(H){H(['dojo/i18n!*preload*widgets/Visibility/nls/Widget*["ar","bs","ca","cs","da","de","en","el","es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","nb","nl","pl","pt-br","pt-pt","ro","ru","sk","sl","sr","sv","th","tr","zh-cn","uk","vi","zh-hk","zh-tw","ROOT"]'])},"*noref":1}});
define("dojo/_base/declare dojo/dom-construct dojo/_base/lang dojo/topic dojo/dom-attr jimu/BaseWidget dijit/_WidgetsInTemplateMixin jimu/dijit/Message jimu/utils ./js/VisibilityControl ./js/PrivilegeUtil".split(" "),function(H,k,n,q,m,l,b,a,c,f,e){return H([l,b],{baseClass:"jimu-widget-visiblity",privilegeUtil:null,_visibilityControl:null,postMixInProperties:function(){this.nls=n.mixin(this.nls,window.jimuNls.coordinateControl)},destroy:function(){if(this._visibilityControl)this._visibilityControl.onClearBtnClicked();
this.inherited(arguments)},resize:function(){q.publish("WIDGET_RESIZE",{})},startup:function(){this.inherited(arguments);this.config.portalUrl?(this.config.hasOwnProperty("defaultObserverHeightUnit")||(this.config.defaultObserverHeightUnit="meters"),this.config.hasOwnProperty("defaultObservableDistanceUnit")||(this.config.defaultObservableDistanceUnit="kilometers"),this.config.hasOwnProperty("defaultAngleUnits")||(this.config.defaultAngleUnits=!1),this.privilegeUtil=e.getInstance(this.config.portalUrl),
this.privilegeUtil.loadPrivileges().then(n.hitch(this,this._validatePrivileges),n.hitch(this,this._showError))):this._showError(this.nls.portalURLError)},_validatePrivileges:function(g){g&&this.privilegeUtil._canPerformElevationAnalysis()?this._createVisibilityControl():this._showError()},_showError:function(g){g||(g=this.nls.privilegeError,this.privilegeUtil._isServiceAvailable||(g=this.nls.noServiceError));new a({message:g});m.set(this.visibilityContainer,"innerHTML",g)},_createVisibilityControl:function(){var g=
this.privilegeUtil.getUserPortal();!this._visibilityControl&&g&&(this._visibilityControl=(new f({config:this.config,parentWidget:this,nls:this.nls,appConfig:this.appConfig,portalUrl:g,pointSymbol:{color:[255,0,0,64],size:12,type:"esriSMS",style:"esriSMSCircle",outline:{color:[0,0,0,255],width:1,type:"esriSLS",style:"esriSLSSolid"}},map:this.map},k.create("div"))).placeAt(this.visibilityContainer),this._visibilityControl.startup(),this._setTheme())},_removeStyleFile:function(g,d){var h=null;h="js"===
d?"src":"css"===d?"href":"none";d=document.getElementsByTagName("js"===d?"script":"css"===d?"link":"none");for(var p=d.length;0<=p;p--)d[p]&&null!==d[p].getAttribute(h)&&-1!==d[p].getAttribute(h).indexOf(g)&&d[p].parentNode.removeChild(d[p])},_setTheme:function(){"DartTheme"===this.appConfig.theme.name?c.loadStyleLink("dartOverrideCSS",this.folderUrl+"css/dartTheme.css",null):this._removeStyleFile(this.folderUrl+"css/dartTheme.css","css");"DashboardTheme"===this.appConfig.theme.name?c.loadStyleLink("dashboardOverrideCSS",
this.folderUrl+"css/dashboardTheme.css",null):this._removeStyleFile(this.folderUrl+"css/dashboardTheme.css","css");"LaunchpadTheme"===this.appConfig.theme.name?c.loadStyleLink("launchpadOverrideCSS",this.folderUrl+"css/launchpadTheme.css",null):this._removeStyleFile(this.folderUrl+"css/launchpadTheme.css","css");"BoxTheme"===this.appConfig.theme.name?c.loadStyleLink("boxOverrideCSS",this.folderUrl+"css/boxTheme.css",null):this._removeStyleFile(this.folderUrl+"css/boxTheme.css","css")}})});