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

//>>built
require({cache:{"widgets/Analysis/a11y/Widget":function(){define("dojo/_base/lang dojo/_base/html dojo/dom-attr dojo/dom-construct dojo/query dojo/on dojo/keys dijit/a11yclick jimu/utils".split(" "),function(L,d,q,p,t,g,c,a,b){return{a11y_initFirstFocusNode:function(){b.initFirstFocusNode(this.domNode,this.toolsSection)},a11y_initLastFocusNode:function(){var h=t(".tools-table-item",this.toolsTbody);(h=h[h.length-1])&&b.initLastFocusNode(this.domNode,h)},a11y_addTool:function(h,k,l){var e=b.getUUID();
q.set(h,"role","button");q.set(h,"tabindex","0");var n="jimuUniq_name_"+e;q.set(k,"id",n);!0===l?q.set(h,"aria-labelledby",n):(k="jimuUniq_tip_"+e,p.create("div",{id:k,"class":"icon-section screen-readers-only",innerHTML:this.nls.toolNotAvailable},h),q.set(h,"aria-disabled","true"),q.set(h,"aria-labelledby",n+" "+k))},a11y_analysisTool_backBtn:function(h,k){q.set(h,"role","button");q.set(h,"tabindex","0");this.currentAnalysisDijit.own(g(h,"keydown",L.hitch(this,function(l){l.keyCode===c.TAB&&(l.preventDefault(),
l.shiftKey?this.toolPanel.focus():("none"!==d.getStyle(k,"display")?k:this.toolPanel).focus())})))},a11y_analysisTool_submitBtn:function(h,k){if("none"!==d.getStyle(k,"display")){var l=t('[role\x3d"button"]',k)[0],e=d.getAttr(l,"aria-labelledby");d.setAttr(k,"aria-labelledby",e);d.setAttr(k,"tabindex","0");d.setAttr(k,"role","button");this.currentAnalysisDijit.own(g(k,a,L.hitch(this,function(){l.click()})));this.currentAnalysisDijit.own(g(k,"keydown",L.hitch(this,function(n){n.keyCode===c.TAB&&(n.preventDefault(),
n.shiftKey?(h?h:this.toolPanel).focus():this.toolPanel.focus())})))}else k=h?h:this.toolPanel;1===this.toolCountInList&&(b.initFirstFocusNode(this.domNode,this.toolPanel),b.initLastFocusNode(this.domNode,k))},a11y_analysisTool_toolPanel:function(h,k){this.own(g(this.toolPanel,"keydown",L.hitch(this,function(l){if(l.keyCode===c.ESCAPE&&h)l.stopPropagation(),h.focus();else if(d.hasClass(l.target,"tool-panel")&&l.keyCode===c.TAB){l.preventDefault();var e="none"!==d.getStyle(k,"display")?k:null,n;l.shiftKey?
n=e||h||this.toolPanel:l.shiftKey||(n=h||e||this.toolPanel);n.focus()}})))},a11y_updateTitleForMsgDom:function(h,k){var l=d.getAttr(this.toolTitle,"id"),e=d.getAttr(this.messageStatusNode,"id");l=[l,e];h===k.STATUS_SUCCEEDED&&l.push(d.getAttr(this.outputtip,"id"));d.setAttr(this.messagePanel,"aria-labelledby",l.join(" "))},a11y_addAttrsAndEventForCancelBtn:function(h){q.set(h,"role","button");q.set(h,"tabindex","0");this.own(g(h,"keydown",L.hitch(this,function(k){k.shiftKey||k.keyCode!==c.TAB||(k.preventDefault(),
this.messagePanel.focus())})))},a11y_addAttrsForOutputLink:function(h){q.set(h,"role","link")},a11y_addAttrsForExportNode:function(h){q.set(h,"role","button");q.set(h,"aria-haspopup","true");q.set(h,"aria-label",this.nls.action);q.set(h,"tabindex","0")},a11y_addMessagePanelEvent:function(){this.own(g(this.messagePanel,"keydown",L.hitch(this,function(h){if(h.keyCode===c.ESCAPE)h.stopPropagation(),"none"!==d.getStyle(this.buttonSection,"display")&&this.backBtn.focus();else if(d.hasClass(h.target,"message-panel")&&
h.keyCode===c.TAB){var k=t(".job-cancel-icon",this.messageSection)[0]||("none"!==d.getStyle(this.buttonSection,"display")?this.homeBtn:null);k?h.shiftKey&&(h.preventDefault(),k.focus()):h.preventDefault()}})))},a11y_switchToPrevious:function(h){h.keyCode!==c.ENTER&&h.keyCode!==c.SPACE||this._switchToPrevious()},a11y_switchToHome:function(h){h.keyCode===c.ENTER||h.keyCode===c.SPACE?this._switchToHome():h.shiftKey||h.keyCode!==c.TAB||(h.preventDefault(),this.messagePanel.focus())},a11y_switchView_toolList:function(){1===
this.toolCountInList?this.toolPanel.focus():this.toolsSection.focus()},a11y_switchView_others:function(h,k){h===k?this.toolPanel.focus():this.messagePanel.focus()}}})},"esri/tasks/JobInfo":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel","./GPMessage"],function(L,d,q,p,t){L=L(null,{declaredClass:"esri.tasks.JobInfo",constructor:function(g){this.messages=[];d.mixin(this,g);g=this.messages;var c,a=g.length;for(c=0;c<a;c++)g[c]=new t(g[c])},jobId:"",jobStatus:""});d.mixin(L,
{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"});q("extend-esri")&&d.setObject("tasks.JobInfo",L,p);return L})},"esri/tasks/GPMessage":function(){define(["dojo/_base/declare","dojo/_base/lang",
"dojo/has","../kernel"],function(L,d,q,p){L=L(null,{declaredClass:"esri.tasks.GPMessage",constructor:function(t){d.mixin(this,t)}});d.mixin(L,{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"});
q("extend-esri")&&d.setObject("tasks.GPMessage",L,p);return L})},"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(L,d,q,p,t,g,c,a,b,h,k,l,e,n,m,v,z,y,D,B,H,G,J,I,C,f,r,w,u,E,K,Q,V,W,Y,ja,ba,fa,ua,xa,va,P,N,A,M,O,U,X,ia,ca,S,ea,na,ha,ma){L={};d.mixin(L,{_helpDialog:null,systemRFTGroupName:"Raster Function Templates",i18n:null,UNITSMAP:{Feet:"esriFeet",Yards:"esriYards",Miles:"esriMiles",Meters:"esriMeters",Kilometers:"esriKilometers",NauticalMiles:"esriNauticalMiles"},initHelpLinks:function(x,F,T){if(x){var R=V.byNode(x),aa=R?R.get("helpFileName"):T&&T.helpFileName?T.helpFileName:null,Z=R?R.get("isSingleTenant"):
T&&T.isSingleTenant?T.isSingleTenant:!1,da=ha.Modes.standard,ka=R&&R.portalSelf?R.portalSelf.helpBase:T&&T.helpBase?T.helpBase:null,la=R&&R.portalSelf;this._helpDialog||(this._helpDialog=new xa({isPortal:Z,portalSelf:la}));R&&(R.showGeoAnalyticsParams||R.showBigData)||T&&T.analysisMode&&T.analysisMode===ha.Modes.Bigdata?(aa+="_bd",da=ha.Modes.Bigdata):T&&T.analysisMode&&"raster"===T.analysisMode&&(aa+="_ra",da=ha.Modes.Raster);v("[esriHelpTopic]",x).forEach(function(pa,Ba,ta){pa&&(y.set(pa,"display",
ba.isDefined(F)&&!0!==F?"none":""),ba.isDefined(pa._helpClickHandler)&&(pa._helpClickHandler.remove(),pa._helpClickHandler=null),pa._helpClickHandler=w(pa,"click",d.hitch(this,function(qa){t.stop(qa);T&&T.showHelpFromUrl&&T.helpUrl?this._helpDialog.show(qa,{showHelpFromUrl:T.showHelpFromUrl,helpUrl:T.helpUrl}):this._helpDialog.show(qa,{helpId:b.get(pa,"esriHelpTopic"),helpFileName:aa,analysisGpServer:T&&T.analysisGpServer?T.analysisGpServer:null,helpParentNode:x,isPortal:Z,analysisMode:da,helpBase:ka,
portalSelf:R&&R.portalSelf})})))},this)}},constructAnalysisFeatColl:function(x){var F={},T;F.featureCollection=x.layerDefinition;for(T in F.featureCollection)F.featureCollection.hasOwnProperty(T)&&"objectIdField"===T&&(F.featureCollection.objectIdFieldName=d.clone(F.featureCollection.objectIdField),delete F.featureCollection.objectIdField);F.featureCollection.features=x.featureSet.features;return F},constructAnalysisInputLyrObj:function(x,F,T){if(x instanceof S||"Image Service"===x.type||"esri.layers.RasterXLayer"===
x.declaredClass)return ma.getRasterJsonFromLayer(x);var R={},aa="";ba.isDefined(T)||(T=!0);if(x.getMap)var Z=x.getMap();else x._map&&(Z=x._map);if(x.url&&!x._collection)R={url:x.url},this.isHostedService(x.url),x.getDefinitionExpression&&x.getDefinitionExpression()?R.filter=x.getDefinitionExpression():ba.isDefined(x.definitionExpression)&&""!==x.definitionExpression&&(R.filter=x.definitionExpression),x.useMapTime&&x.timeInfo&&Z&&Z.timeExtent&&T&&(Z.timeExtent.startTime?(aa+=Z.timeExtent.startTime.getTime(),
Z.timeExtent.endTime&&(aa+=","+Z.timeExtent.endTime.getTime())):Z.timeExtent.endTime&&(aa+=Z.timeExtent.endTime.getTime()),aa&&(R.time=aa)),x.credential&&(R.serviceToken=x.credential.token),-1!==R.url.indexOf("?")&&(T=R.url.substring(R.url.indexOf("?")+1,R.url.length),T=l.queryToObject(T),d.mixin(R,T),R.url=R.url.substring(0,R.url.indexOf("?")));else if(!x.url||x._collection)try{R=x.toJson()}catch(da){x._json=n.parse(x._json),R=x.toJson()}R.name=x.name;F&&(R=new U(R));return R},formatDate:function(x){return z.format(x,
{datePattern:"yyyy-MM-dd",selector:"date"})+" "+z.format(x,{selector:"time",timePattern:"HH:mm:ss"})},isHostedService:function(x){if(!x)return!1;var F=-1!==x.indexOf(".arcgis.com/");x=-1!==x.indexOf("/services")||-1!==x.indexOf("//tiles")||-1!==x.indexOf("//features");return F&&x},isPortalHostedService:function(x){return x?-1!==x.toLowerCase().indexOf("/hosted/"):!1},isTimeEnabled:function(x){var F=10.2<=x.version&&x._useStandardizedQueries;return x.useMapTime&&x.timeInfo&&(F||10.2<=x.version)||ba.isDefined(x.time)},
isTimeInstantLayer:function(x){return ba.isDefined(x.timeInfo)&&ba.isDefined(x.timeInfo.startTimeField)&&!ba.isDefined(x.timeInfo.endTimeField)||ba.isDefined(x.time)&&ba.isDefined(x.time.timeType)&&"instant"===x.time.timeType},buildReport:function(x,F){var T="";F||(F={},d.mixin(F,e.analysisMsgCodes));q.forEach(x,function(R,aa){if("string"===typeof R.message){var Z=ba.isDefined(F[R.messageCode])?F[R.messageCode]:R.message;T+=R.style.substring(0,R.style.indexOf("\x3c/"))+(this._isEmptyObject(R.params)?
Z:m.substitute(Z,R.params))+R.style.substring(R.style.indexOf("\x3c/"))}else if(d.isArray(R.message)){var da=[];var ka=d.clone(R.style);q.forEach(R.message,function(la,pa){ka=ka.replace(/<\//,"${"+pa+"}");Z=ba.isDefined(F[R.messageCode+"_"+pa])?F[R.messageCode+"_"+pa]:la;Z=this._isEmptyObject(R.params)?Z:m.substitute(Z,R.params);"string"===typeof Z&&(Z=this.safetagsReplace(Z));da.push(Z+"\x3c/")},this);ka=m.substitute(ka,da);T+=ka}},this);return T},getLayerFeatureCount:function(x,F){var T=new va,
R=new H;F||(F={});T.geometry=F.geometry;T.geometryType=F.geometryType||"esriGeometryEnvelope";x.url||T.geometry?(x.url&&(T.where=F.where||"1\x3d1",x.getDefinitionExpression&&x.getDefinitionExpression()&&!F.where?T.where=x.getDefinitionExpression():ba.isDefined(x.definitionExpression)&&""!==x.definitionExpression&&!F.where&&(T.where=x.definitionExpression)),R=x.queryCount(T)):R.resolve(x.graphics.length);return R.promise},createPolygonFeatureCollection:function(x){var F={layerDefinition:null,featureSet:{features:[],
geometryType:ha.GeometryTypes.Polygon}};F.layerDefinition={currentVersion:10.2,copyrightText:"",defaultVisibility:!0,relationships:[],isDataVersioned:!1,supportsRollbackOnFailureParameter:!0,supportsStatistics:!0,supportsAdvancedQueries:!0,geometryType:ha.GeometryTypes.Polygon,minScale:0,maxScale:0,objectIdField:"OBJECTID",templates:[],type:"Feature Layer",displayField:"TITLE",visibilityField:"VISIBLE",name:x,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 F},createPointFeatureCollection:function(x){var F={layerDefinition:null,featureSet:{features:[],geometryType:ha.GeometryTypes.Point}};F.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:x,hasAttachments:!1,typeIdField:"TYPEID",capabilities:"Query",types:[],geometryType:ha.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 F},createFolderStore:function(x,F){var T=new u({data:{identifier:"id",label:"name",items:[]}});T.newItem({name:F,id:""});q.forEach(x,function(R){T.newItem({name:R.title,id:R.id})});return T},setupFoldersUI:function(x){x.folderSelect.set("store",
x.folderStore);x.folderSelect.set("required",!0);x.folderSelect.set("searchAttr","name");ba.isDefined(x.folderId)?x.folderStore.get(x.folderId).then(d.hitch(this,function(F){ba.isDefined(F)?x.folderSelect.set("item",F):x.folderStore.get("").then(function(T){x.folderSelect.set("item",T)},this)})):x.folderName?x.folderStore.fetch({query:{name:x.folderName},onComplete:d.hitch(this,function(F){ba.isDefined(F)&&0<F.length?x.folderSelect.set("item",F[0]):x.folderStore.get("").then(function(T){x.folderSelect.set("item",
T)},this)})}):x.username?x.folderSelect.set("displayedValue",x.username):x.folderStore.get("").then(function(F){x.folderSelect.set("item",F)},this)},_isEmptyObject:function(x){for(var F in x)if(x.hasOwnProperty(F))return!1;return!0},validateServiceName:function(x,F){var T=/(:|&|<|>|%|#|\?|\\|"|\/|\+|=|\*|@|'|;|\||,)/g.test(x),R=!0,aa=!0;if(ba.isDefined(F)&&F.textInput)var Z=F.textInput;ba.isDefined(F)&&ba.isDefined(F.isItem)&&(aa=F.isItem);this.initI18n();if(0===x.length||0===m.trim(x).length){var da=
this.i18n.requiredValue;R=!1}else if(T)da=this.i18n.invalidServiceName,R=!1;else if(aa&&98<x.length)da=this.i18n.invalidServiceNameLength,R=!1;else if(aa&&170<encodeURIComponent(x).length){for(x+="";170<encodeURIComponent(x).length;)x=x.substring(0,x.length-1);da=m.substitute(this.i18n.suggestedServiceNameLength,{count:x.length});R=!1}Z&&!R&&Z.set("invalidMessage",da);return R},getStepNumber:function(x){v(".esriAnalysisNumberLabel",x).forEach(function(F,T){T=this._getNumberLabel(T);b.set(F,"innerHTML",
T)},this)},_getNumberLabel:function(x){var F="";this.initI18n();switch(x){case 0:F=this.i18n.oneLabel;break;case 1:F=this.i18n.twoLabel;break;case 2:F=this.i18n.threeLabel;break;case 3:F=this.i18n.fourLabel;break;case 4:F=this.i18n.fiveLabel;break;case 5:F=this.i18n.sixLabel;break;case 6:F=this.i18n.sevenLabel;break;case 7:F=this.i18n.eightLabel;break;case 8:F=this.i18n.nineLabel;break;case 9:F=this.i18n.tenLabel;break;case 10:F=this.i18n.elevenLabel;break;case 11:F=this.i18n.twelveLabel;break;case 12:F=
this.i18n.thirteenLabel}return F},populateAnalysisLayers:function(x,F,T,R){if(x){var aa=[],Z=x.get(F);F=R&&R.layerSelect?R.layerSelect:x._analysisSelect;x.rerun&&!Z&&(R||(R={}),R.chooseBlank=!0);x._titleRow&&y.set(x._titleRow,"display","none");x._analysisLabelRow&&y.set(x._analysisLabelRow,"display","table-row");x._selectAnalysisRow&&(y.set(x._selectAnalysisRow,"display","table-row"),y.set(x._analysisSelect.domNode.parentNode,"padding-bottom","1em"));x.domNode&&this.getStepNumber(x.domNode);ba.isDefined(R)&&
R.chooseLabel&&aa.push({value:-1,label:this.i18n.chooseLabel});ba.isDefined(R)&&R.chooseBlank&&aa.push({value:"  ",label:""});ba.isDefined(R)&&ba.isDefined(R.posIncrement)||(ba.isDefined(R)||(R={}),R.posIncrement=0);x.get(T)||x.set(T,[]);q.forEach(x.get(T),function(da,ka){ka+=R.posIncrement;ka={value:ba.isDefined(R)&&R.chooseLabel?""+ka+1:""+ka,label:da.name};Z&&(da.name===Z.name||da.url&&Z.url&&da.url===Z.url)&&(ka.selected=!0);aa.push(ka)},this);F.addOption(aa);F.set("required",!0);R.chooseBlank&&
"  "===F.get("value")&&setTimeout(d.hitch(this,this._validateSelectUI,F),100)}},isValidAnalysisLayer:function(x){var F="",T=!0;var R={isValid:T,validationMessage:F};var aa,Z,da=0,ka=0,la=0,pa,Ba,ta,qa=!0;if(!ba.isDefined(x)||!ba.isDefined(x.toolName))return R;this.initI18n();R=x.toolName;var ra=x.layers;var oa=x.analysisLayer;var sa=R.charAt(0).toLowerCase()+R.substring(1);var za=this.i18n;x=x.showReadyToUseLayers||!1;q.forEach(ra,function(Aa){qa=!1;if(Aa instanceof S||"esri.layers.RasterXLayer"===
Aa.declaredClass)pa=!0;pa&&1<Aa.bandCount&&(Ba=!0);pa&&1===Aa.bandCount&&(ta=!0);Aa.geometryType===ha.GeometryTypes.Point&&(Ea=!0,da++);if(Aa.geometryType===ha.GeometryTypes.Point||Aa.geometryType===ha.GeometryTypes.MultiPoint)aa=!0;Aa.geometryType===ha.GeometryTypes.Line&&(Z=!0,la++);Aa.geometryType===ha.GeometryTypes.Polygon&&(Oa=!0,ka++)},this);if(-1!==q.indexOf(["CreateDriveTimeAreas","PlanRoutes","ConnectOriginsToDestinations"],R)&&(!Ea||oa&&oa.geometryType!==ha.GeometryTypes.Point))F=m.substitute(this.i18n.selectPointLayer,
{toolName:za[sa]}),T=!1;else if("AggregatePoints"!==R&&"InterpolatePoints"!==R||(!oa||oa.geometryType===ha.GeometryTypes.Point||oa.geometryType===ha.GeometryTypes.MultiPoint)&&aa)if("CalculateDensity"===R&&(!aa&&!Z||oa&&oa.geometryType!==ha.GeometryTypes.Point&&oa.geometryType!==ha.GeometryTypes.MultiPoint&&oa.geometryType!==ha.GeometryTypes.Line))F=m.substitute(this.i18n.areaFeatureInvalidMsg,{toolName:za[sa]}),T=!1;else if("FindHotSpots"!==R&&"FindOutliers"!==R||x||!(!aa&&!Oa||oa&&oa.geometryType!==
ha.GeometryTypes.Point&&oa.geometryType!==ha.GeometryTypes.MultiPoint&&oa.geometryType!==ha.GeometryTypes.Polygon))if("OverlayLayers"!==R&&"AggregatePoints"!==R&&"SummarizeWithin"!==R&&"SummarizeNearby"!==R&&"FindNearest"!==R&&"MergeLayers"!==R||x||0!==ra.length&&(1!==ra.length||ra[0]!==oa&&ba.isDefined(oa)))if("ConnectOriginsToDestinations"===R&&!x&&(qa||2>da))F=m.substitute(this.i18n.odPointMsg,{toolName:za[sa]}),T=!1;else if(this.isFindCentroids(R)&&this.isPointLayer(oa))F=m.substitute(this.i18n.selectNoPointLayer,
{toolName:za[sa]}),T=!1;else if("AggregatePoints"===R&&!x&&1<ra.length){var Oa=q.some(ra,function(Aa){return Aa.geometryType===ha.GeometryTypes.Polygon});Oa||(F=m.substitute(this.i18n.aggregatePolyMsg,{toolName:za[sa]}),T=!1)}else if("MergeLayers"===R&&!x&&1<ra.length)1<da||1<la||1<ka||(F=this.i18n.mergeValidationMsg,T=!1);else if("SummarizeWithin"!==R&&"DissolveBoundaries"!==R||(!oa||oa.geometryType===ha.GeometryTypes.Polygon)&&Oa||x)if("ExtractData"===R)(T=q.some(ra,function(Aa){return-1!==Aa.capabilities.indexOf("Extract")}))||
(F=m.substitute(this.i18n.extractValidationMsg));else if(("ConnectOriginsToDestinations"===R||R===ha.Tools.ChooseBestFacilities)&&1<ra.length){var Ea=q.some(ra,function(Aa){var Wa=ba.isDefined(oa)&&oa.id===Aa.id;return Aa.geometryType===ha.GeometryTypes.Point&&!Wa});Ea||(F=m.substitute(R===ha.Tools.ChooseBestFacilities?this.i18n.selectPointLayer:this.i18n.odPointMsg,{toolName:za[sa]}),T=!1)}else"CalculateSlope"===R||"DeriveAspect"===R||"RemapValues"===R?pa?ta||(T=!1,F=m.substitute(this.i18n.noSingleBandISMsg,
{toolName:za[sa]})):(T=!1,F=m.substitute(this.i18n.noImageServiceMsg,{toolName:za[sa]})):"ExtractRaster"===R?pa||(T=!1,F=m.substitute(this.i18n.noImageServiceMsg,{toolName:za[sa]})):"MonitorVegetation"===R&&(pa?Ba||(T=!1,F=m.substitute(this.i18n.noMultiBandISMsg,{toolName:za[sa]})):(T=!1,F=m.substitute(this.i18n.noImageServiceMsg,{toolName:za[sa]})));else F=m.substitute(this.i18n.selectPolyLayer,{toolName:za[sa]}),T=!1;else F=m.substitute(this.i18n.overlayValidationMsg,{toolName:za[sa]}),T=!1;else F=
m.substitute(this.i18n.hotspotsLineFeatureMsg,{toolName:za[sa]}),T=!1;else F=m.substitute(this.i18n.selectPointLayer,{toolName:za[sa]}),T=!1;return R={isValid:T,validationMessage:F}},isFindCentroids:function(x){return x===ha.Tools.FindCentroids},isPointLayer:function(x){return x&&x.geometryType===ha.GeometryTypes.Point},initI18n:function(){this.i18n||(this.i18n={},d.mixin(this.i18n,e.common),d.mixin(this.i18n,e.analysisTools),d.mixin(this.i18n,e.analysisMsgCodes),d.mixin(this.i18n,e.browseLayersDlg),
d.mixin(this.i18n,e.driveTimes),d.mixin(this.i18n,e.calculateFields))},addBrowseAnalysisDialog:function(x){if(x&&x.widget){this.i18n||this.initI18n();var F="esri/dijit/analysis/PluginAnalysisLayers",T=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"},R=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"},aa=function(ra){return"\x3cimg class\x3d'grid-item-thumb' width\x3d'16px' height\x3d'16px' alt\x3d'' src\x3d'"+ra.iconUrl+"'/\x3e"},Z=function(ra){return"\x3cimg class\x3d'grid-item-thumb' width\x3d'16px' height\x3d'16px' alt\x3d'' src\x3d'"+ra.iconUrl+"'/\x3e"},da=C.doc.createDocumentFragment();da=B.create("div",{style:"width:100%;height:100%;"},da);var ka=B.create("div",
{style:"width:100%;height:10%;","class":""}),la=B.create("div",{style:"width:100%"},da),pa=this._isCustomAnalysisQuery(x.widget);1===x.browseType?(F="esri/dijit/analysis/PluginLayers",F={portalUrl:x.widget.get("portalUrl"),message:"",plugin:F,sortDescending:!0,sort:"title",self:x.widget.get("portalSelf"),itemsPerPage:100,demandList:!0,extent:x.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:Z,formatInfoPanelImage:aa,"class":"esriAnalysisLayersItems"}):F={portalUrl:x.widget.get("portalUrl"),message:"",plugin:F,sortDescending:!0,sort:"title",self:x.widget.get("portalSelf"),pagingLinks:1,rowsPerPage:6,"class":"esriBrowseAnalysisLayers itemsGallery esriFloatLeading",extent:x.widget.get("map").extent,useExtent:!pa,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:R,showInfoPanel:!1,showTooltip:!0,formatThumbnail:T,style:"width:48em;height:100%;clear:both;"};R=B.toDom('\x3cdiv class\x3d"esriBrowseOptions"\x3e');B.place(R,ka);T=B.create("div",{"class":"esriBrowseOption"},R);if(!x.browseType||1!==x.browseType){R=B.create("div",{"class":"esriBrowseOption"},R);var Ba=new Y({name:"addlayer",id:x.widget.id+(x.browseType?x.browseType:"")+"_addlayercheck","class":"",value:!1,checked:!1},B.create("input",{},R));B.create("label",{"for":x.widget.id+"_addlayercheck",
"class":"esriBrowseOption_label",innerHTML:this.i18n.addLayer},R)}R=!0;x.browseType&&1===x.browseType?R=!1:pa&&(R=!1);R=new Y({name:"extentcheck",id:x.widget.id+(x.browseType?x.browseType:"")+"_addextentcheck","class":"",value:R,checked:R},B.create("input",{},T));B.create("label",{"for":x.widget.id+(x.browseType?x.browseType:"")+"_addextentcheck","class":"esriBrowseOption_label",innerHTML:this.i18n.withinMapArea},T);F.messageRight=ka;var ta=new P(F,la);R.on("change",d.hitch(this,function(ra){ta.set("useExtent",
ra)}));var qa=new W({title:1===x.browseType?this.i18n.browseLayers:pa?this.i18n.browseAnalysisLayers:this.i18n.browseAnalysisTitle,content:da,browseItems:ta,addlayerCheckBox:Ba,style:x.browseType&&1===x.browseType?"":"padding:.75em 0;background-color: #fff;width:50em;"});x.widget.own(qa.on("hide",d.hitch(qa,function(ra){qa.browseItems.reset()})));return qa}},addAnalysisReadyLayer:function(x,F){function T(ta){var qa;if("Feature Service"===Z.type){var ra=new N(Z.url,{outFields:["*"]});d.mixin(Z,ra)}"Image Service"===
Z.type&&(ra=-1<ta.capabilities.indexOf("TilesOnly")?new ea(Z.url,{outFields:["*"]}):new S(Z.url,{outFields:["*"]}),d.mixin(Z,ra));d.mixin(Z,ta);Z.id=Z.title+"_"+ta.id;Z.title=x.item.selectedLayer?Z.title+"-"+ta.name:Z.title.replace(/_/g," ");Z.name=Z.title;Z.version=Z.currentVersion;if(ka&&x.widget.showBrowseLayers){var oa=(qa=x.layersSelect.get("store"))&&qa.data;qa=2;qa=oa.splice(oa.length-qa,qa);var sa={id:oa.length,label:Z.title,name:Z.title,url:Z.url};oa.push(sa);oa=oa.concat(qa);qa=new K({data:oa,
idProperty:"id"});x.layersSelect.set("store",qa);x.layersSelect.set("value",sa.name)}else{oa=x.layersSelect.getOptions();if(x.widget.useArcGISComponents&&(x.widget.showBrowseLayers||x.widget.showReadyToUseLayers))qa=2;else if(x.widget.showBrowseLayers&&x.widget.showReadyToUseLayers)qa=3;else if(x.widget.showBrowseLayers||x.widget.showReadyToUseLayers)qa=2;qa=oa.splice(oa.length-qa,qa);x.layersSelect.removeOption(qa);oa=x.layers.length;x.posIncrement&&(oa+=x.posIncrement);oa=""+oa;qa.unshift({value:oa,
label:Z.title,selected:!0});x.layersSelect.addOption(qa);x.layersSelect.set("value",oa)}ra&&(Z.lyr=ra,ra.name=Z.name);Z.linfo=ta;x.layers.push(Z);if(x.browseDialog.addlayerCheckBox&&x.browseDialog.addlayerCheckBox.get("checked")||da||F)this._addLayerHandle&&this._addLayerHandle.remove(),this._addLayerHandle=x.widget.map.on("layer-add",d.hitch(this,function(za){this._addLayerHandle.remove();x.widget.emit("add-ready-to-use-layer",{layer:za.layer,layerInfo:ta,item:Z})})),x.widget.map.addLayer(ra);x.browseDialog.browseItems&&
x.browseDialog.browseItems.clear()}if(ba.isDefined(x)&&ba.isDefined(x.item)&&ba.isDefined(x.layersSelect)&&ba.isDefined(x.layers)&&ba.isDefined(x.browseDialog)){x.browseDialog.hide&&x.browseDialog.hide();var R,aa;(R=!x.item.selectedLayer&&x.item.url?x.item.type===ca.IS?x.item.url:x.item.url+"/0":x.item.selectedLayer.url)&&-1!==window.location.protocol.indexOf("https:")&&(R=R.replace("http:","https:"));var Z={url:R,itemId:x.item.id,title:x.item.title,type:x.item.type,analysisReady:!0};R=q.some(x.layers,
function(ta,qa){var ra=ta.analysisReady&&Z.analysisReady&&ta.itemId===Z.itemId;x.item.selectedLayer&&x.item.selectedLayer.url&&(ra=ta.itemId&&Z.itemId?ta.itemId===Z.itemId&&ta.url===Z.url:ta.url===Z.url);ra&&(aa=qa);return ra});var da;x.browseDialog.browseItems&&v(".js-add-layer-checkbox",x.browseDialog.browseItems.infoPanel).forEach(function(ta){da=ta.checked});var ka=-1!==x.layersSelect.baseClass.indexOf("dijitComboBox");var la=new H;var pa="sync";if(R){x.posIncrement&&(aa+=x.posIncrement);if(x.browseDialog.addlayerCheckBox&&
x.browseDialog.addlayerCheckBox.get("checked")||da||F){x.posIncrement||(x.posIncrement=0);var Ba=x.layers[aa-x.posIncrement];x.widget.map.getLayer(Ba.lyr.id)||(this._addLayerHandle&&this._addLayerHandle.remove(),this._addLayerHandle=x.widget.map.on("layer-add",d.hitch(this,function(ta){this._addLayerHandle.remove();x.widget.emit("add-ready-to-use-layer",{layer:ta.layer,layerInfo:Ba.linfo,item:Ba})})),x.widget.map.addLayer(Ba.lyr))}ka?x.layersSelect.set("value",x.layers[aa-1].name):x.layersSelect.set("value",
""+aa);x.browseDialog.browseItems&&x.browseDialog.browseItems.clear();la.resolve()}else x.item.selectedLayer?(Z.url=x.item.selectedLayer.url,la.then(d.hitch(this,T)),setTimeout(function(){la.resolve(x.item.selectedLayer)},500)):(pa=x.item.itemDataUrl?ua({url:x.item.itemDataUrl,content:{f:"json"}}):"sync",f(pa,d.hitch(this,function(ta){ta&&ta.layers&&ta.layers[0].id&&(Z.url=Z.url.substring(0,Z.url.lastIndexOf("/0"))+"/"+ta.layers[0].id);ua({url:Z.url,content:{f:"json"}}).then(d.hitch(this,function(qa){T(qa);
la.resolve()}))})));return la.promise}},addReadyToUseLayerOption:function(x,F){x&&(x.showReadyToUseLayers||x.showBrowseLayers)&&(F||(F=[]),x.signInPromise||(x.signInPromise=new H,setTimeout(d.hitch(this,function(){x.signInPromise.resolve()}),100)),x.i18n||(this.initI18n(),x.i18n=this.i18n),x.signInPromise.then(d.hitch(this,function(){q.forEach(F,function(T){var R=T.select||T;if(-1!==R.baseClass.indexOf("dijitComboBox")&&x.showBrowseLayers){if(T=R.get("store"))T.put({id:"separator",name:"separator",
label:"\x3chr\x3e"}),T.put({id:"browselayers",name:"browselayers",label:x.i18n.browseLayers})}else{var aa=R.getOptions();q.some(aa,function(Z){return"separator"===Z.type},this)||!x.showReadyToUseLayers&&!x.showBrowseLayers||R.addOption({type:"separator",value:""});this.addBrowseOptionForTool({select:R,disableLAAL:T.disableLAAL},x)}},this);x.showReadyToUseLayers&&!ba.isDefined(x._browsedlg)&&(x._browsedlg=this.addBrowseAnalysisDialog({widget:x}),x.own(x._browsedlg.browseItems.on("select-change",d.hitch(x,
x._handleBrowseItemsSelect)),x._browsedlg.on("hide",d.hitch(x,function(){q.forEach(F,function(T){"browse"===T.get("value")&&T.reset()});x.layersSelect&&x.layersSelect.reset()}))));x.showBrowseLayers&&!ba.isDefined(x._browseLyrsdlg)&&(x._browseLyrsdlg=this.addBrowseAnalysisDialog({widget:x,browseType:1}),x.own(x._browseLyrsdlg.on("browseitems-close",d.hitch(this,function(T){"add-layer"===T.action&&(x._browseLyrsdlg.browseItems.plugIn._grid&&(T.selection.selectedLayer=x._browseLyrsdlg.browseItems.plugIn._selectedLayer,
x._handleBrowseItemsSelect({dialog:x._browseLyrsdlg,selection:T.selection})),x._browseLyrsdlg.browseItems.closeInfoPanel())})),x._browseLyrsdlg.on("hide",d.hitch(x,function(){q.forEach(F,function(T){"browselayers"===T.get("value")&&T.reset()})}))))})))},addBrowseOptionForTool:function(x,F){var T=x.select,R=x.disableLAAL||!1,aa=T.getOptions();x=[];var Z=!1;if(!q.some(aa,function(da){return"browselayers"===da.value||"browse"===da.value},this)){if(0<aa.length&&"separator"!==aa[aa.length-1].type||0===
aa.length)x.push({type:"separator"}),Z=!0;F.useArcGISComponents&&(F.showBrowseLayers||F.showReadyToUseLayers)?x.push({value:"browselayers",label:F.i18n.browseAnalysisLayers}):(!R&&F.showReadyToUseLayers&&(R=F.i18n.browseAnalysisTitle,this._isCustomAnalysisQuery(F)&&(R=F.i18n.browseAnalysisLayers),x.push({value:"browse",label:R})),F.showBrowseLayers&&x.push({value:"browselayers",label:F.i18n.browseLayers}));(!0===Z&&1<x.length||!1===Z&&0<x.length)&&T.addOption(x)}},_isCustomAnalysisQuery:function(x){var F=
'title:"Living Atlas Analysis Layers" AND owner:esri',T=!1;x&&x.isSingleTenant&&(F='title:"Living Atlas Analysis Layers" AND owner:esri_livingatlas');x.portalSelf&&x.portalSelf.analysisLayersGroupQuery&&x.portalSelf.analysisLayersGroupQuery!==F?T=!0:x._portal&&x._portal.analysisLayersGroupQuery&&x._portal.analysisLayersGroupQuery!==F&&(T=!0);return T},getMaxInputByMode:function(x){if(x&&x.units&&x.type&&x.limits&&x.travelMode){var F,T=x.limits.maximumBreakDistanceValue,R=x.limits.maximumBreakDistanceValueUnits,
aa=x.limits.maximumBreakTimeValue,Z=x.limits.maximumBreakTimeValueUnits,da=this.isWalkingTravelMode(x.travelMode.travelMode);da&&(T=x.limits.maximumBreakWalkingDistanceValue,R=x.limits.maximumBreakWalkingDistanceValueUnits,aa=x.limits.maximumBreakWalkingTimeValue,Z=x.limits.maximumBreakWalkingTimeValueUnits);"reachableStreets"===x.alternateLimits&&(Z=this.generateLimitsForReachableStreets({limits:x.limits,isWalking:da}),T=Z.driveDistanceLimit,R=Z.driveDistanceUnit,aa=Z.driveTimeLimit,Z=Z.driveTimeUnit);
"unreachableAreas"===x.alternateLimits&&(Z=this.generateLimitsForUnreachableAreas({limits:x.limits,isWalking:da}),T=Z.driveDistanceLimit,R=Z.driveDistanceUnit,aa=Z.driveTimeLimit,Z=Z.driveTimeUnit);aa*=this.perMinute(Z);T*=this.perMile(R);"StraightLine"===x.type?"Miles"===x.units?F=1E3:"Yards"===x.units?F=176E4:"Kilometers"===x.units?F=I.format(1609.344,{places:2}):"Meters"===x.units?F=I.format(1609344,{places:2}):"Feet"===x.units&&(F=528E4):this.isDistanceMode(x.travelMode)?"Miles"===x.units?F=T:
"Yards"===x.units?F=1760*T:"Kilometers"===x.units?F=I.format(1.609344*T,{places:2}):"Meters"===x.units?F=I.format(1609.344*T,{places:2}):"Feet"===x.units&&(F=5280*T):this.isTimeMode(x.travelMode)&&("Minutes"===x.units?F=aa:"Seconds"===x.units?F=60*aa:"Hours"===x.units&&(F=aa/60));return"string"===typeof F?I.parse(F):parseFloat(F)}},isWalkingTravelMode:function(x){if(x&&x.restrictionAttributeNames)return x.restrictionAttributeNames.some(function(F){return"walking"===F.toLowerCase()})},isDistanceMode:function(x){return"Distance"===
x.units},isTimeMode:function(x){return"Time"===x.units},generateLimitsForUnreachableAreas:function(x){var F={driveDistanceLimit:null,driveDistanceUnit:null,driveTimeLimit:null,driveTimeUnit:null};x.isWalking?(F.driveDistanceLimit=x.limits.maximumBreakWalkingDistanceValueDetailedPolygons,F.driveDistanceUnit=x.limits.maximumBreakWalkingDistanceValueUnitsDetailedPolygons,F.driveTimeLimit=x.limits.maximumBreakWalkingTimeValueDetailedPolygons,F.driveTimeUnit=x.limits.maximumBreakWalkingTimeValueUnitsDetailedPolygons):
(F.driveDistanceLimit=x.limits.maximumBreakDistanceValueDetailedPolygons,F.driveDistanceUnit=x.limits.maximumBreakDistanceValueUnitsDetailedPolygons,F.driveTimeLimit=x.limits.maximumBreakTimeValueDetailedPolygons,F.driveTimeUnit=x.limits.maximumBreakTimeValueUnitsDetailedPolygons);return F},generateLimitsForReachableStreets:function(x){var F={driveDistanceLimit:null,driveDistanceUnit:null,driveTimeLimit:null,driveTimeUnit:null};x.isWalking?(F.driveDistanceLimit=x.limits.maximumBreakWalkingDistanceValueServiceAreaLines,
F.driveDistanceUnit=x.limits.maximumBreakWalkingDistanceValueUnitsServiceAreaLines,F.driveTimeLimit=x.limits.maximumBreakWalkingTimeValueServiceAreaLines,F.driveTimeUnit=x.limits.maximumBreakWalkingTimeValueUnitsServiceAreaLines):(F.driveDistanceLimit=x.limits.maximumBreakDistanceValueServiceAreaLines,F.driveDistanceUnit=x.limits.maximumBreakDistanceValueUnitsServiceAreaLines,F.driveTimeLimit=x.limits.maximumBreakTimeValueServiceAreaLines,F.driveTimeUnit=x.limits.maximumBreakTimeValueUnitsServiceAreaLines);
return F},updateModeConstraints:function(x){if(x&&x.validateWidget&&x.units&&x.type&&x.travelMode){var F=x.validateWidget.get("constraints");F.max=this.getMaxInputByMode(x);x.validateWidget.set(F)}},getTravelModes:function(x){var F=new H,T,R,aa,Z;ba.isDefined(this.travelModes)&&0<this.travelModes.length?F.resolve(this.travelModes):x&&x.widget?x.widget.signInPromise.then(d.hitch(this,function(da){(Z=x.widget.get("helperServices"))&&Z.routingUtilities?(aa=Z.routingUtilities.url,T="sync"):T=x.widget._getSelf(x.widget.portalUrl);
f(T,d.hitch(this,function(ka){ka&&ka.helperServices&&ka.helperServices.routingUtilities&&(aa=ka.helperServices.routingUtilities.url);ba.isDefined(aa)?(R=new M(aa+"/GetTravelModes"),R.execute({}).then(d.hitch(this,function(la){this.travelModes=q.map(la[0].value&&la[0].value.features,function(pa){return c.fromJson(pa.attributes.TravelMode)});la[1]&&la[1].paramName&&"defaultTravelMode"===la[1].paramName&&(this.defaultTravelModeId=la[1].value);F.resolve(this.travelModes)}),d.hitch(this,function(la){F.reject(la)}))):
F.reject(Error("Missing Routing Utility Service to get Travel Modes"))}),function(ka){F.reject(ka)})})):F.reject(Error("Missing parameter: params.widget required parameter"));return F.promise},populateTravelModes:function(x){if(x&&x.selectWidget&&x.widget){var F=[],T=x.allowmode||"all",R=!1;this.initI18n();x.addStraightLine&&F.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:x.value&&"StraightLine"===x.value});this.getTravelModes({widget:x.widget}).then(d.hitch(this,function(aa){var Z=ba.isDefined(x.enableTravelModes)&&!x.enableTravelModes;q.forEach(aa,function(da,ka){ka=this.createOptionForTravelMode(da,{name:da.name,disabled:Z,separator:x.separator});this.isTravelModeAllowed(T,ka.units)&&("all"!==T&&(ka.value=ka.value.replace(ka.units,"")),x.value&&x.value.id===da.id?Q(x.value,da)&&(ka.selected=!ka.disabled,R=!0):
!x.value&&x.selectDefaultMode&&this.defaultTravelModeId&&this.defaultTravelModeId===da.id&&(ka.selected=!0),F.push(ka))},this);!R&&this.isRequiredToAddTravelMode(x)&&this.isTravelModeAllowed(T,this.getTravelModeUnits(x.value))&&F.push(this.getOptionForCustomTravelMode(x,Z));x.selectWidget.removeOption();x.selectWidget.addOption(F);x.widget.emit("travelmodes-added",{travelOptions:F})}),d.hitch(this,function(aa){F&&0<F.length&&(x.selectWidget.removeOption(),x.selectWidget.addOption(F),x.widget.emit("travelmodes-added",
{travelOptions:F}))}))}},getTravelModeLabel:function(x,F){F=F?F:x.name;return'\x3cdiv class\x3d"esriFloatLeading bufferIcon esri'+this.getTravelModei18nKey(x.type)+this.getTravelModeUnits(x)+'Icon"\x3e\x3c/div\x3e\x3cdiv class\x3d"esriLeadingMargin4" style\x3d"height:20px;margin-top:10px;" title\x3d"'+x.description+'"\x3e'+F+"\x3c/div\x3e"},getTravelModeUnits:function(x){var F=x.units||name.split(/\s/)[1];return F=x.impedanceAttributeName===x.timeAttributeName?"Time":x.impedanceAttributeName===x.distanceAttributeName?
"Distance":"Other"},getTravelModeValue:function(x,F){return x.replace(/\s/g,F||"")},getTravelModei18nKey:function(x){return"AUTOMOBILE"===x?"Driving":"TRUCK"===x?"Trucking":"WALK"===x?"Walking":"Other"},isTravelModeAllowed:function(x,F){return"all"===x||x.toLowerCase()===F.toLowerCase()},isRequiredToAddTravelMode:function(x){return x.widget.rerun&&"StraightLine"!==x.value},isTrafficBasedTravelMode:function(x){var F=this.getTravelModei18nKey(x.type).toLowerCase();return"time"===this.getTravelModeUnits(x).toLowerCase()&&
("driving"===F||"trucking"===F)},getOptionForCustomTravelMode:function(x,F){x=this.createOptionForTravelMode(x.value,{name:"\x26lt"+x.value.name+"\x26gt",disabled:F,separator:x.separator});x.selected=!0;return x},createOptionForTravelMode:function(x,F){return{label:this.getTravelModeLabel(x,F.name),value:this.getTravelModeValue(F.name,F.separator),travelMode:x,disabled:F.disabled,modei18nKey:this.getTravelModei18nKey(x.type).toLowerCase(),units:this.getTravelModeUnits(x)}},updateDisplay:function(x,
F,T){(new v.NodeList(x)).style("display",F?T?T:"block":"none")},isGreaterThanZero:function(){return 0<this.get("value")},getExprFunctions:function(){this.i18n||this.initI18n();this.exprFunctions||(this.exprFunctions=[{type:"NumType",label:m.substitute(this.i18n.asMetersFunc,{functionName:"as_meters(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"as_meters()"},{type:"NumType",label:m.substitute(this.i18n.asKilometersFunc,{functionName:"as_kilometers(\x3ci\x3enumber\x3c/i\x3e)",
num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"as_kilometers()"},{type:"NumType",label:m.substitute(this.i18n.asFeetFunc,{functionName:"as_feet(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"as_feet()"},{type:"NumType",label:m.substitute(this.i18n.asYardsFunc,{functionName:"as_yards(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"as_yards()"},{type:"NumType",label:m.substitute(this.i18n.asMilesFunc,{functionName:"as_miles(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),
name:"as_miles()"},{type:"NumType",label:m.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:m.substitute(this.i18n.absFunc,{functionName:"abs(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"abs()"},{type:"NumType",label:m.substitute(this.i18n.logFunc,{functionName:"log(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"log()"},
{type:"NumType",label:m.substitute(this.i18n.sinFunc,{functionName:"sin(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"sin()"},{type:"NumType",label:m.substitute(this.i18n.cosFunc,{functionName:"cos(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"cos()"},{type:"NumType",label:m.substitute(this.i18n.tanFunc,{functionName:"tan(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"tan()"},{type:"NumType",label:m.substitute(this.i18n.squareRootFunc,
{functionName:"sqrt(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"sqrt()"},{type:"NumType",label:m.substitute(this.i18n.minFunc,{functionName:"min(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"min()"},{type:"NumType",label:m.substitute(this.i18n.maxFunc,{functionName:"max(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"max()"},{type:"NumType",label:m.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:m.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:m.substitute(this.i18n.whenFunc,{functionName:"when(\x3ci\x3enumber\x3c/i\x3e)",num:"\x3ci\x3enumber\x3c/i\x3e"}),name:"when(,)"},{type:"NumType",
label:m.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(x){this.initI18n();ba.isDefined(x.allowSelectLabel)||(x.allowSelectLabel=!0);var F=[],T=ba.isDefined(x.emptyValue)?x.emptyValue:"";if(x.allowNumericType||void 0===x.allowNumericType)F=[ha.FieldTypes.Short,ha.FieldTypes.Integer,
ha.FieldTypes.Float,ha.FieldTypes.Double];var R=x.layer;var aa=x.selectWidget;var Z=R?R.fields:[];aa.removeOption(aa.getOptions());x.allowSelectLabel&&aa.addOption({value:T,label:this.i18n.attribute});x.allowStringType&&F.push(ha.FieldTypes.String);x.allowDateType&&F.push(ha.FieldTypes.Date);var da=[];q.forEach(Z,function(ka){-1!==q.indexOf(F,ka.type)&&ka.name!==R.objectIdField&&da.push({value:ka.name,label:ba.isDefined(ka.alias)&&""!==ka.alias?ka.alias:ka.name,type:ka.type===ha.FieldTypes.String?
ha.PseudoFieldTypes.String:ka.type===ha.FieldTypes.Date?ha.PseudoFieldTypes.Date:ha.PseudoFieldTypes.Number})},this);if(0===da.length)return!1;aa.addOption(da);ba.isDefined(x.priorityChange)?aa.set("value",T,x.priorityChange):aa.set("value",T);aa.set("disabled",!R||0===R.fields.length);return!0},addStatisticsOptions:function(x){this.initI18n();var F=x.selectWidget,T=[{value:"SUM",label:this.i18n.sum},{value:"MIN",label:this.i18n.minimum},{value:"MAX",label:this.i18n.maximum},{value:"MEAN",label:x.showGeoAnalyticsParams?
this.i18n.mean:this.i18n.average},{value:"STDDEV",label:this.i18n.standardDev}],R=[{value:"MIN",label:this.i18n.minimum},{value:"MAX",label:this.i18n.maximum}],aa=[{value:"First",label:this.i18n.first},{value:"Last",label:this.i18n.last}],Z=ba.isDefined(x.emptyValue)?x.emptyValue:"";F.removeOption(F.getOptions());F.addOption([{value:Z,label:this.i18n.statistic}]);x.showGeoAnalyticsParams&&(F.addOption({value:"COUNT",label:this.i18n.count}),T.push({value:"VARIANCE",label:this.i18n.variance}),T.splice(4,
0,{value:"RANGE",label:this.i18n.range}));x.showFirstLastStats&&F.addOption(aa);x.type&&"number"!==x.type?x.type&&"string"===x.type?(F.addOption({value:"ANY",label:this.i18n.any}),x.selectWidget.optionsType="string"):x.type&&"date"===x.type&&(F.addOption(R),x.selectWidget.optionsType="date"):(F.addOption(T),x.selectWidget.optionsType="number");F.set("value",Z)},addFillOptions:function(x){var F=x.selectWidget,T=[{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}];F.removeOption(F.getOptions());F.addOption([{value:"0",label:this.i18n.fill}]);x.type&&"number"!==x.type||F.addOption(T)},perMeter:function(x){var F=1;switch(x){case fa.MILLIMETERS:F=1E3;break;case fa.CENTIMETERS:F=100;break;case fa.DECIMETERS:F=10;break;case fa.METERS:F=1;break;case fa.KILOMETERS:F=.001;break;case fa.INCHES:F=39.370079;break;case fa.FEET:F=3.2808399;break;case fa.YARDS:F=
1.0936133;break;case fa.MILES:F=6.2137119E-4;break;case fa.NAUTICAL_MILES:F=5.399568E-4;break;case fa.ACRES:F=2.4710538E-4;break;case fa.ARES:F=.01;break;case fa.HECTARES:F=1E-4;break;case fa.SQUARE_INCHES:F=1550.0031;break;case fa.SQUARE_FEET:F=10.7639104;break;case fa.SQUARE_YARDS:F=1.19599005;break;case fa.SQUARE_MILES:F=3.86102159E-7;break;case fa.SQUARE_NAUTICAL_MILES:F=2.9155335E-7;break;case fa.SQUARE_MILLIMETERS:F=1E6;break;case fa.SQUARE_CENTIMETERS:F=1E4;break;case fa.SQUARE_DECIMETERS:F=
100;break;case fa.SQUARE_METERS:F=1;break;case fa.SQUARE_KILOMETERS:F=1E-6}return F},perMile:function(x){var F=1;switch(x){case "Feet":F=1.89394E-4;break;case "Yards":F=5.68182E-4;break;case "Meters":F=6.21371E-4;break;case "Kilometers":F=.621371}return F},perMinute:function(x){var F=1;switch(x){case "Seconds":F=.0166667;break;case "Hours":F=60}return F},getType:function(x){var F=null;switch(x){case fa.ACRES:F=2;break;case fa.ARES:F=2;break;case fa.CENTIMETERS:F=1;break;case fa.DECIMETERS:F=1;break;
case fa.FEET:F=1;break;case fa.HECTARES:F=2;break;case fa.INCHES:F=1;break;case fa.KILOMETERS:F=1;break;case fa.METERS:F=1;break;case fa.MILES:F=1;break;case fa.MILLIMETERS:F=1;break;case fa.NAUTICAL_MILES:F=1;break;case fa.SQUARE_CENTIMETERS:F=2;break;case fa.SQUARE_DECIMETERS:F=2;break;case fa.SQUARE_FEET:F=2;break;case fa.SQUARE_INCHES:F=2;break;case fa.SQUARE_KILOMETERS:F=2;break;case fa.SQUARE_METERS:F=2;break;case fa.SQUARE_MILES:F=2;break;case fa.SQUARE_MILLIMETERS:F=2;break;case fa.SQUARE_NAUTICAL_MILES:F=
2;break;case fa.SQUARE_YARDS:F=2;break;case fa.YARDS:F=1;break;default:F=0}return F},unitConversion:function(x,F,T){var R=!0;ba.isDefined(x)||(this.emitError("The 'From' Value must be a valid numeric value: "+x),R=!1);ba.isDefined(F)||(this.emitError("The 'From' Units must be defined: "+F),R=!1);ba.isDefined(T)||(this.emitError("The 'To' Units must be defined: "+T),R=!1);x instanceof Array&&(this.emitError("Only single 'From' Value supported: "+x),R=!1);F instanceof Array&&(this.emitError("Only single 'From' Units supported: "+
F),R=!1);T instanceof Array&&(this.emitError("Only single 'To' Units supported: "+T),R=!1);var aa=this.getType(F),Z=this.getType(T);0===aa&&(this.emitError("Unsupported 'From' Units: "+F),R=!1);0===Z&&(this.emitError("Unsupported 'To' Units: "+T),R=!1);aa!==Z&&(this.emitError("Incompatible 'From' and 'To' Units: "+F+" and "+T),R=!1);return R?F===T?+x:+x/this.perMeter(F)*this.perMeter(T):Number.NaN},emitError:function(x){console.log("error",Error(x))},isEmpty:function(x){for(var F in x)if(x.hasOwnProperty(F))return!1;
return n.stringify(x)===n.stringify({})},getRoutingUtilities:function(x){var F=new H,T={},R,aa,Z,da;x||F.reject(Error("Missing parameter: widget required parameter"));-1!==q.indexOf(["CreateDriveTimeAreas","EnrichLayer","SummarizeNearby"],x.toolName)?d.mixin(T,{toolName:"GenerateServiceAreas",serviceName:"asyncServiceArea"}):x.toolName===ha.Tools.ChooseBestFacilities?d.mixin(T,{toolName:"SolveLocationAllocation",serviceName:"asyncLocationAllocation"}):"PlanRoutes"===x.toolName?d.mixin(T,{toolName:"SolveVehicleRoutingProblem",
serviceName:"asyncVRP"}):"FindNearest"===x.toolName?d.mixin(T,{toolName:"FindClosestFacilities",serviceName:"asyncClosestFacility"}):"ConnectOriginsToDestinations"===x.toolName&&d.mixin(T,{toolName:"FindRoutes",serviceName:"asyncRoute"});this.routingUtilities||(this.routingUtilities={});this.routingUtilities&&this.routingUtilities[x.toolName]?F.resolve(this.routingUtilities[x.toolName]):x.signInPromise.then(d.hitch(this,function(ka){(da=x.get("helperServices"))&&da.routingUtilities?(Z=da.routingUtilities.url,
R="sync"):R=x._getSelf(x.portalUrl);f(R,d.hitch(this,function(la){la&&la.helperServices&&la.helperServices.routingUtilities&&(Z=la.helperServices.routingUtilities.url);ba.isDefined(Z)||F.reject(Error("Missing Routing Utility Service to get Network Analysis Service Limits."));aa=new M(Z+"/GetToolInfo");aa.execute(T).then(d.hitch(this,function(pa){pa&&0<pa.length&&pa[0].value?(this.routingUtilities[x.toolName]=pa[0].value,F.resolve(pa[0].value)):F.reject("Routing Utility Service 'GetToolInfo' job did not return service limits.")}),
function(pa){F.reject(pa)})}))}),function(ka){F.reject(ka)});return F.promise},getNetworkAnalysisLimits:function(x){var F=new H;x||F.reject(Error("Missing parameter: widget required parameter"));this.getRoutingUtilities(x).then(d.hitch(this,function(T){T.serviceLimits?F.resolve(T.serviceLimits):F.reject()}),function(T){F.reject(T)});return F.promise},isEsriWorldGeocoder:function(x){var F=this.isAgoWorldGeocodeServer(x);x=this.isAgoWorldGeocodeServerProxy(x);return F||x},isAgoWorldGeocodeServer:function(x){return x&&
!!x.match(/(arcgis.com\/arcgis\/rest\/services\/world\/geocodeserver).*/ig)},isCustomGeoEnrichmentServer:function(x,F){var T=(x||"").toLowerCase();x=-1<T.indexOf("/geoenrichmentserver")&&-1<T.indexOf("/servers/")&&-1<T.indexOf("/rest/services/");F=!F&&T.indexOf("utility")&&-1<T.indexOf(".arcgis.com");return x&&F},isAgoWorldGeocodeServerProxy:function(x){return x&&!!x.match(/(\/servers\/[\da-z\.-]+\/rest\/services\/world\/geocodeserver).*/ig)},isWorldGeoLocator:function(x){return x&&!!x.match(/(\/rest\/services\/world\/geocodeserver).*/ig)},
showMessages:function(x,F,T){b.set(F,"innerHTML",x);g.fadeIn({node:T,easing:J.quadIn,onEnd:d.hitch(this,function(){y.set(T,{display:""})})}).play()},hideMessages:function(x){g.fadeOut({node:x,easing:J.quadOut,onEnd:function(){y.set(x,{display:"none"})}}).play()},getHelpUrl:function(x){if(x.topic&&x.widget){var F;x.widget.portalSelf&&x.widget.portalSelf.helpBase?F=x.widget.portalSelf.helpBase+"index.html#":!x.widget.isSingleTenant||x.widget.portalSelf&&x.widget.portalSelf.helpBase||(F="http://server.arcgis.com/en/portal/latest/use/");
"BufferExpression"===x.topic&&(F+="Use_expressions_with_GeoAnalytics_Tools/019300000183000000/");return F}},isPCS:function(x){return!!x&&!!ia&&-1!==q.indexOf(ia,x)},isPCSByLayerType:function(x){var F=!!x&&!!x.fullExtent&&this.isPCS(x.fullExtent.spatialReference.wkid);!F&&x.extent&&(F=!!x&&!!x.extent&&this.isPCS(x.extent.spatialReference.wkid));!F&&x.spatialReference&&(F=!!x&&!!x.spatialReference&&this.isPCS(x.spatialReference.wkid));return F},checkPCSforAnalysis:function(x){var F=x.widget&&x.widget.toolName,
T=!!x.widget&&!!x.widget.context&&!!x.widget.context.processSR&&this.isPCS(x.widget.context.processSR.wkid),R=!0,aa=x.jobParams||x.widget.jobParams,Z=!!x.widget&&!!x.widget.context&&!!x.widget.context.processSR&&!!x.widget.context.processSR.wkid;if(!F||!aa||!x.widget.showGeoAnalyticsParams)return!1;var da="\x3ca  href\x3d'#' id\x3d'"+x.widget.id+"_warn_settings_link'\x3e"+x.widget.i18n.analysisSettings+"\x3c/a\x3e\x3cdiv class\x3d'esriAnalysisSettingsIcon'\x3e\x3c/div\x3e";var ka=m.substitute(x.widget.i18n.PCSReqMsg,
{defaultSpatialRef:x.widget.i18n.worldCylindrical,settingsIcon:da});"FindHotSpots"!==F&&"FindPointClusters"!==F||T?"CalculateDensity"!==F&&"FindPointClusters"!==F&&"GeographicallyWeightedRegression"!==F||T?"AggregatePoints"!==F||-1===q.indexOf(["HEXAGON","SQUARE"],aa.binType)||T?"SummarizeWithin"===F&&aa.summaryPolygons&&!T?R=this.isPCSByLayerType(x.widget.sumWithinLayer):"SummarizeWithin"!==F||-1===q.indexOf(["HEXAGON","SQUARE"],aa.binType)||T?"JoinFeatures"===F&&aa.spatialNearDistance&&"Near"===
aa.spatialRelationship&&!T?(R=this.isPCSByLayerType(x.widget.targetLayer))||(ka=m.substitute(x.widget.i18n.JFPCSReqMsg,{settingsIcon:da})):"BuildMultiVariableGrid"!==F||T?"CalculateMotionStatistics"===F&&"Planar"===aa.distanceMethod&&(1<aa.motionStatistics.split(",").length||1===aa.motionStatistics.split(",").length&&-1===aa.motionStatistics.indexOf("Duration"))&&!T?(R=this.isPCSByLayerType(x.widget.inputLayer))||(ka=m.substitute(x.widget.i18n.CMSPCSReqMsg,{settingsIcon:da})):"TraceProximityEvents"!==
F||"Planar"!==aa.distanceMethod||T||(R=this.isPCSByLayerType(x.widget.inputLayer))||(ka=m.substitute(x.widget.i18n.TPEPCSReqMsg,{settingsIcon:da})):R=q.every(x.inputLayers,function(la){return this.isPCSByLayerType(la)},this):R=this.isPCSByLayerType(x.widget.summaryLayer):R=this.isPCSByLayerType(x.widget.pointLayer):(R=this.isPCSByLayerType(x.widget.inputLayer),"GeographicallyWeightedRegression"!==F||R||(ka=m.substitute(x.widget.i18n.GWRPCSReqMsg,{settingsIcon:da}))):(R=this.isPCSByLayerType(x.widget.analysisLayer),
"FindPointClusters"!==F||R||(ka=m.substitute(x.widget.i18n.FPCSReqMsg,{settingsIcon:da})));R||x.hasPCSWarnShown||(x.widget.set("disableRunAnalysis",R),this.settingsVM&&this.settingsDlg&&x.widget._bodyNode&&x.widget._errorMessagePane&&(this.showMessages(ka,x.widget._bodyNode,x.widget._errorMessagePane),r.byId(x.widget.id+"_warn_settings_link")&&w(r.byId(x.widget.id+"_warn_settings_link"),"click",d.hitch(x.widget,x.widget.showSettingsDlg))));!R&&x.hasPCSWarnShown&&Z&&(R=!0);return R},tryParseJSON:function(x){try{var F=
n.parse(x);if(F&&"object"===typeof F&&null!==F)return F}catch(T){}return!1},decodeTag:function(x){return{"\x26lt;":"\x3c","\x26gt;":"\x3e"}[x]||x},stringDecode:function(x){return x.replace(/(&lt;|&gt;)/g,this.decodeTag)},jobParamsToWidgetProps:function(x){if(x&&x.jobParams){var F=x.jobParams,T=new H,R=[],aa=[],Z;for(Z in F){var da;F.hasOwnProperty(Z)&&("string"===typeof F[Z]&&-1!==F[Z].search(/(&lt;|&gt;)/g)&&(F[Z]=this.stringDecode(F[Z])),da="string"===typeof F[Z]?this.tryParseJSON(F[Z]):F[Z])&&
(-1!==Z.toLowerCase().indexOf("layer")&&"object"===typeof da?aa.push({key:Z,obj:da}):da&&(da.Raster||da.url)&&aa.push({key:Z,obj:da}),F[Z]=da)}for(Z=0;Z<aa.length;Z++){da=aa[Z].obj;var ka=aa[Z].key;"object"===typeof da&&da.length?(F[ka]=[],q.forEach(da,function(la,pa){this._getFlayers(la,ka,F,R,!0,pa)},this)):"object"===typeof da&&da.Raster?(da.url=da.Raster.url,this._getFlayers(da,ka,F,R,!0,"Raster")):this._getFlayers(da,ka,F,R)}G(R).then(d.hitch(this,function(){T.resolve(x)}),d.hitch(this,function(){T.resolve(x)}));
return T.promise}},_getLayerType:function(x){return x?-1!==x.indexOf("BigDataCatalogServer")?ca.BIGDATA:-1!==x.indexOf("ImageServer")?ca.IS:ca.FS:null},_getFlayers:function(x,F,T,R,aa,Z){if(x.url){var da=ua({url:x.url,content:{f:"json"}});var ka=new H;R.push(ka);da.then(d.hitch(this,function(la,pa,Ba,ta,qa){var ra=this._getLayerType(la.url);if(ra===ca.FS){var oa=new N(la.url,{mode:N.MODE_ONDEMAND,outFields:["*"],resourceInfo:qa});la.filter&&oa.setDefinitionExpression(la.filter);oa.filter=la.filter}else ra===
ca.BIGDATA?(oa=qa,d.mixin(oa,la)):ra===ca.IS&&(qa=la.Raster||la,oa=new S(qa.url),qa.renderingRule&&oa.setRenderingRule(new na(qa.renderingRule)),qa.name&&(oa.name=qa.name),la.Raster&&la.Raster.url===la.url&&delete la.url);la.name&&(oa.name=la.name);aa?T[pa][ta]=oa:aa&&ra===ca.IS?d.mixin(T[pa][ta],oa):T[pa]=oa;Ba.resolve()},x,F,ka,Z),d.hitch(this,function(la,pa,Ba,ta,qa){la={name:la.name,empty:!0};aa?T[pa][ta]=la:T[pa]=la;Ba.resolve()},x,F,ka,Z))}else R=new N(x,{outFields:["*"]}),x.name&&(R.name=x.name),
aa?T[F][Z]=R:T[F]=R},isLayerInLayers:function(x,F){return q.some(F,function(T){return this.isSameLayer(x,T)},this)},addBlankOption:function(x,F){F&&F.length?F.push({value:"  ",label:""}):x.addOption({value:"  ",label:""});setTimeout(d.hitch(this,this._validateSelectUI,x),100)},_validateSelectUI:function(x){x._hasBeenBlurred=!0;x.set("focused",!0);x.validate();x.set("focused",!1);x._hasBeenBlurred=!1;setTimeout(d.hitch(this,function(){x.reset()}),1E3)},updateExpressions:function(x){x&&x.selectedInputLayers&&
x.inputLayers&&x.data&&x.expressions&&(q.forEach(x.selectedInputLayers,function(F,T){q.forEach(x.inputLayers,function(R,aa){R&&F&&(!F.url&&!R.url&&F.name===R.name||F.url&&R.url&&F.url===R.url)&&(F._oldIndex=T,F._newIndex=aa)})}),q.forEach(x.data,function(F,T){0<T&&F&&(T=x.expressions[T-1],ba.isDefined(F.layer)&&(F.layer=T&&T.layer),ba.isDefined(F.selectingLayer)&&(F.selectingLayer=T&&T.selectingLayer))}),q.forEach(x.data,function(F){var T=!1,R=!1;q.forEach(x.selectedInputLayers,function(aa){ba.isDefined(F.layer)&&
F.layer===aa._oldIndex&&!T&&(F.layer=aa._newIndex,T=!0);ba.isDefined(F.selectingLayer)&&F.selectingLayer===aa._oldIndex&&!R&&(F.selectingLayer=aa._newIndex,R=!0)},this)},this))},isBigDataTypeTobeAdded:function(x){return-1==q.indexOf(x,'type:"Big Data File Share"')?!0:!1},removeDuplicates:function(x,F){for(var T=[],R={},aa=0;aa<x.length;aa++)R[x[aa]]?R[x[aa]]+=1:(T.push(x[aa]),R[x[aa]]=1);return F?R:T},isPoint:function(x){return x&&x.geometryType===ha.GeometryTypes.Point},isLine:function(x){return x&&
x.geometryType===ha.GeometryTypes.Line},isPolygon:function(x){return x&&x.geometryType===ha.GeometryTypes.Polygon},isSameLayer:function(x,F){return x&&F&&(x.name&&F.name&&x.name===F.name||x.url&&F.url&&x.url===F.url)},getTimeType:function(x){return x?ba.isDefined(x.timeInfo)&&ba.isDefined(x.timeInfo.startTimeField)&&!ba.isDefined(x.timeInfo.endTimeField)?ha.TimeTypes.Instant:ba.isDefined(x.timeInfo)&&ba.isDefined(x.timeInfo.startTimeField)&&ba.isDefined(x.timeInfo.endTimeField)?ha.TimeTypes.Interval:
ba.isDefined(x.time)&&ba.isDefined(x.time.timeType)?x.time.timeType:!1:!1},fetchGroupForRFT:function(x){var F=new H,T=a.locale,R=T?T.substring(0,2):"en";T=this.systemRFTGroupName+" owner: ("+("en"===R?["esri_en"]:["esri_en","esri_"+R]).join(" OR ")+")";x.queryGroups({q:T},!0).then(function(aa){0<aa.total&&aa.results?(aa=aa.results,aa=this.findRFTLocaleGroup(aa,R)||this.findRFTLocaleGroup(aa,"en"),F.resolve(aa)):F.resolve(null)}.bind(this));return F},findRFTLocaleGroup:function(x,F){var T;x.some(function(R){var aa=
R.owner;if(aa&&aa.substring(aa.length-2)===F)return T=R,!0});return T},updateOptions:function(x,F){if(x){for(;0<x.getOptions().length;)x.removeOption(x.getOptions());x._setDisplay("");F&&0<F.length&&x.addOption(F)}},addOptionsFromLayers:function(x){x.select&&x.layers&&(x.customOptions=x.customOptions||[],x.forbiddenLayers=x.forbiddenLayers||[],x.layers.forEach(function(F,T){this.isLayerInLayers(F,x.forbiddenLayers)||x.customOptions.push({value:T.toString(),label:F.name,selected:x.selectedOption&&
this.isSameLayer(x.selectedOption,F)})},this),this.updateOptions(x.select,x.customOptions),this.addBrowseOptionForTool({select:x.select,disableLAAL:!0},x.widget))},replaceTag:function(x){return{"\x26":"\x26amp;","\x3c":"\x26lt;","\x3e":"\x26gt;"}[x]||x},safetagsReplace:function(x){return x.replace(/[<>]/g,this.replaceTag)}});h("extend-esri")&&d.setObject("dijit.analysis.utils",L,ja);return L})},"dojo/fx/easing":function(){define(["../_base/lang"],function(L){var d={linear:function(q){return q},quadIn:function(q){return Math.pow(q,
2)},quadOut:function(q){return q*(q-2)*-1},quadInOut:function(q){q*=2;return 1>q?Math.pow(q,2)/2:-1*(--q*(q-2)-1)/2},cubicIn:function(q){return Math.pow(q,3)},cubicOut:function(q){return Math.pow(q-1,3)+1},cubicInOut:function(q){q*=2;return 1>q?Math.pow(q,3)/2:(Math.pow(q-2,3)+2)/2},quartIn:function(q){return Math.pow(q,4)},quartOut:function(q){return-1*(Math.pow(q-1,4)-1)},quartInOut:function(q){q*=2;return 1>q?Math.pow(q,4)/2:-.5*(Math.pow(q-2,4)-2)},quintIn:function(q){return Math.pow(q,5)},quintOut:function(q){return Math.pow(q-
1,5)+1},quintInOut:function(q){q*=2;return 1>q?Math.pow(q,5)/2:(Math.pow(q-2,5)+2)/2},sineIn:function(q){return-1*Math.cos(Math.PI/2*q)+1},sineOut:function(q){return Math.sin(Math.PI/2*q)},sineInOut:function(q){return-1*(Math.cos(Math.PI*q)-1)/2},expoIn:function(q){return 0==q?0:Math.pow(2,10*(q-1))},expoOut:function(q){return 1==q?1:-1*Math.pow(2,-10*q)+1},expoInOut:function(q){if(0==q)return 0;if(1==q)return 1;q*=2;if(1>q)return Math.pow(2,10*(q-1))/2;--q;return(-1*Math.pow(2,-10*q)+2)/2},circIn:function(q){return-1*
(Math.sqrt(1-Math.pow(q,2))-1)},circOut:function(q){return Math.sqrt(1-Math.pow(q-1,2))},circInOut:function(q){q*=2;return 1>q?-.5*(Math.sqrt(1-Math.pow(q,2))-1):.5*(Math.sqrt(1-Math.pow(q-2,2))+1)},backIn:function(q){return Math.pow(q,2)*(2.70158*q-1.70158)},backOut:function(q){--q;return Math.pow(q,2)*(2.70158*q+1.70158)+1},backInOut:function(q){q*=2;if(1>q)return Math.pow(q,2)*(3.5949095*q-2.5949095)/2;q-=2;return(Math.pow(q,2)*(3.5949095*q+2.5949095)+2)/2},elasticIn:function(q){if(0==q||1==q)return q;
--q;return-1*Math.pow(2,10*q)*Math.sin(2*(q-.075)*Math.PI/.3)},elasticOut:function(q){return 0==q||1==q?q:Math.pow(2,-10*q)*Math.sin(2*(q-.075)*Math.PI/.3)+1},elasticInOut:function(q){if(0==q)return 0;q*=2;if(2==q)return 1;var p=.3*1.5,t=p/4;if(1>q)return--q,-.5*Math.pow(2,10*q)*Math.sin(2*(q-t)*Math.PI/p);--q;return.5*Math.pow(2,-10*q)*Math.sin(2*(q-t)*Math.PI/p)+1},bounceIn:function(q){return 1-d.bounceOut(1-q)},bounceOut:function(q){return q<1/2.75?7.5625*Math.pow(q,2):q<2/2.75?7.5625*Math.pow(q-
1.5/2.75,2)+.75:q<2.5/2.75?7.5625*Math.pow(q-2.25/2.75,2)+.9375:7.5625*Math.pow(q-2.625/2.75,2)+.984375},bounceInOut:function(q){return.5>q?d.bounceIn(2*q)/2:d.bounceOut(2*q-1)/2+.5}};L.setObject("dojo.fx.easing",d);return d})},"dojox/mvc/equals":function(){define(["dojo/_base/array","dojo/_base/lang","dojo/Stateful","./StatefulArray"],function(L,d,q,p){var t=function(g,c,a){a=a||t;var b=[a.getType(g),a.getType(c)];return b[0]!=b[1]?!1:a["equals"+b[0].replace(/^[a-z]/,function(h){return h.toUpperCase()})](g,
c)};return d.setObject("dojox.mvc.equals",d.mixin(t,{getType:function(g){return d.isArray(g)?"array":d.isFunction((g||{}).getTime)?"date":null!=g&&("[object Object]"=={}.toString.call(g)||d.isFunction((g||{}).set)&&d.isFunction((g||{}).watch))?"object":"value"},equalsArray:function(g,c){for(var a=0,b=Math.max(g.length,c.length);a<b;a++)if(!t(g[a],c[a]))return!1;return!0},equalsDate:function(g,c){return g.getTime()==c.getTime()},equalsObject:function(g,c){var a=d.mixin({},g,c),b;for(b in a)if(!(b in
q.prototype||"_watchCallbacks"==b||t(g[b],c[b])))return!1;return!0},equalsValue:function(g,c){return g===c}}))})},"dojox/mvc/StatefulArray":function(){define(["dojo/_base/lang","dojo/Stateful"],function(L,d){function q(t){t._watchElementCallbacks&&t._watchElementCallbacks(void 0,[],[]);return t}var p=function(t){t=L._toArray(t||[]);t.constructor=p;return L.mixin(t,{pop:function(){return this.splice(this.get("length")-1,1)[0]},push:function(){this.splice.apply(this,[this.get("length"),0].concat(L._toArray(arguments)));
return this.get("length")},reverse:function(){return q([].reverse.apply(this,L._toArray(arguments)))},shift:function(){return this.splice(0,1)[0]},sort:function(){return q([].sort.apply(this,L._toArray(arguments)))},splice:function(g,c){var a=this.get("length");g+=0>g?a:0;var b=Math.min(g,a),h=this.slice(g,g+c),k=L._toArray(arguments).slice(2);[].splice.apply(this,[g,c].concat(Array(k.length)));for(var l=0;l<k.length;l++)this[b+l]=k[l];this._watchElementCallbacks&&this._watchElementCallbacks(g,h,
k);this._watchCallbacks&&this._watchCallbacks("length",a,a-h.length+k.length);return h},unshift:function(){this.splice.apply(this,[0,0].concat(L._toArray(arguments)));return this.get("length")},concat:function(g){return new p([].concat.apply(this,arguments))},join:function(g){for(var c=[],a=this.get("length"),b=0;b<a;b++)c.push(this.get(b));return c.join(g)},slice:function(g,c){var a=this.get("length");c=(void 0===c?a:c)+(0>c?a:0);var b=[];for(g=g+(0>g?a:0)||0;g<Math.min(c,this.get("length"));g++)b.push(this.get(g));
return new p(b)},watchElements:function(g){var c=this._watchElementCallbacks,a=this;c||(c=this._watchElementCallbacks=function(h,k,l){for(var e=[].concat(c.list),n=0;n<e.length;n++)e[n].call(a,h,k,l)},c.list=[]);c.list.push(g);var b={};b.unwatch=b.remove=function(){for(var h=c.list,k=0;k<h.length;k++)if(h[k]==g){h.splice(k,1);break}};return b}},d.prototype,{set:function(g,c){if("length"==g)g=this.get("length"),g<c?this.splice.apply(this,[g,0].concat(Array(c-g))):c<g&&this.splice.apply(this,[c,g-c]);
else{var a=this.length;d.prototype.set.call(this,g,c);a!=this.length&&d.prototype.set.call(this,"length",this.length)}return this},isInstanceOf:function(g){return d.prototype.isInstanceOf.apply(this,arguments)||g==p}})};p._meta={bases:[d]};return L.setObject("dojox.mvc.StatefulArray",p)})},"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(L,d,q,p,t,g,c,a,b,h,k,l,e,n,m,v,z,y,D,B,H,G,J,I,C){q=q([z],{declaredClass:"esri.dijit.analysis.HelpWindow",i18n:null,onlineHelpMap:null,showLearnMore:!1,"class":"esriAnalyisHelpWindow",constructor:function(f){this.isPortal=f&&f.isPortal},postMixInProperties:function(){this.inherited(arguments);this.i18n={};p.mixin(this.i18n,C.common);p.mixin(this.i18n,C.analysisHelp)},postCreate:function(){this.inherited(arguments);var f=["ar","he"],r;this.onlineHelpMap={};for(r=0;r<f.length;r+=1){var w=
f[r];c.locale&&-1!==c.locale.indexOf(w)&&(-1!==c.locale.indexOf("-")?-1!==c.locale.indexOf(w+"-")&&(this._isRightToLeft=!0):this._isRightToLeft=!0)}f=L.toUrl(this.isPortal?"./help/helpmap_enterprise.json":"./help/helpmap.json");J({url:f}).then(p.hitch(this,function(u){this.onlineHelpMap=u.map}));this._initSelfHelpMap()},_getAbsoluteUrl:function(f){var r=G.getProtocolForWebResource();if(/^https?:/i.test(f))return f;if(/^\/\//i.test(f))return r+f;if(/^\//i.test(f))return r+"//"+window.location.host+
f},_computeSize:function(f){var r={w:400,h:200};b("esri-mobile")?r={w:"50%",h:"90%"}:-1!==f.indexOf("Category")?(r.w=400,r.h=320):-1!==f.indexOf("Tool")?(r.w=400,r.h=320):-1!==f.indexOf("toolDescription")&&(r.w=400,r.h=520);return r},_initSelfHelpMap:function(){this.isPortal&&this.portalSelf&&this.portalSelf.helpMap&&(this.selfHelpMap=this.portalSelf.helpMap.m)},_setHelpTopicAttr:function(f){this.tooltipHelpDlg&&(D.close(this.tooltipHelpDlg),this.tooltipHelpDlg.destroy(),this.tooltipHelpDlg=null);
var r="";this.showLearnMore=!1;var w=this._analysisGpServer&&-1!==this._analysisGpServer.indexOf("dev")?"dev":this._analysisGpServer&&-1!==this._analysisGpServer.indexOf("qa")?"uat":"";r=this.isPortal?"-PortalOnly":"-OnlineOnly";var u=p.clone(c.locale);var E="es-es es-mx fr-fr fr-ch it-ch it-it de-de de-ch".split(" ");"nb"===u?u="no":-1!==d.indexOf(E,u)&&(u=u.split("-")[0]);var K="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"===f)E=this.helpIdUrl,this.showLearnMore=!1;else{E=L.toUrl("esri/dijit/analysis/help/"+this.helpFileName+".html");var V=this.helpFileName;if(H.isDefined(this.onlineHelpMap[V])&&H.isDefined(this.onlineHelpMap[V][f])){this.showLearnMore=!0;var W="https://doc"+w+".arcgis.com/en/arcgis-online/analyze/"+this.onlineHelpMap[V][f];this.isPortal&&this.helpBase&&this.selfHelpMap&&(W=this.helpBase+this.selfHelpMap[this.onlineHelpMap[V][f]])}-1!==
d.indexOf(K,u)&&(-1!==u.indexOf("-")&&(u=u.split("-"),u=u[0]+"-"+u[1].toUpperCase()),E=L.toUrl("esri/dijit/analysis/help/"+u+"/"+this.helpFileName+".html"));-1!==d.indexOf(Q,u)&&this.showLearnMore&&(W="https://doc"+w+".arcgis.com/"+u+"/arcgis-online/analyze/"+this.onlineHelpMap[V][f],this.isPortal&&this.helpBase&&this.selfHelpMap?W=this.helpBase+this.selfHelpMap[this.onlineHelpMap[V][f]]:this.isPortal&&!this.helpBase&&(W="https://server"+w+".arcgis.com/"+u+"/portal/latest/use/"+this.onlineHelpMap[V][f]))}this._size=
w=this._computeSize(f);this.tooltipHelpDlg=new y({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'"+f+"' src\x3d'"+E+"#"+f+r+"' width\x3d'"+w.w+"' height\x3d'"+w.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?W:"#")+"' 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(f,r){this.helpFileName=r.helpFileName;this._analysisGpServer=r.analysisGpServer;this.isPortal=r.isPortal;this.helpBase=r.helpBase;r.portalSelf&&(this.portalSelf=
r.portalSelf);this.selfHelpMap||this._initSelfHelpMap();r.analysisMode&&(this.analysisMode=r.analysisMode);r.showHelpFromUrl&&r.helpUrl&&(this.showHelpFromUrl=r.showHelpFromUrl,this.helpIdUrl=r.helpUrl,r.helpId="SHOWHELPURL");this.set("helpTopic",r.helpId);var w=a.after(D,"open",p.hitch(this,function(){n(".esriAnalysisCloseIcon",this.tooltipHelpDlg.domNode).on("click",p.hitch(this,this.close));w.remove()})),u=f.pageX,E=m.getBox(),K;var Q=!1;if(r.helpParentNode)var V=r.helpParentNode;V&&(K=v.position(V));
K&&E.w-f.pageX<K.w?(Q=!0,u=K.x-this._size.w-10,this._isRightToLeft&&(u-=10)):this._isRightToLeft&&u-40<this._size.w&&(u=K.w+this._size.w+80);D.open({popup:this.tooltipHelpDlg,x:!0===this._isRightToLeft||Q?u-40:u+40,y:f.screenY-f.pageY+10,onCancel:p.hitch(this,function(){this.close()}),onExecute:function(){this.close()}});this.tooltipHelpDlg.domNode.parentNode&&e.set(this.tooltipHelpDlg.domNode.parentNode,"overflowY","hidden")},close:function(f,r){D.close(this.tooltipHelpDlg)}});b("extend-esri")&&
p.setObject("dijit.analysis.HelpWindow",q,B);return q})},"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(L,d,q,p,t,g,c,a,b,h,k,l,e,n,m,v,z,y,D,B,H,G,J,I,C,f,r,w,u,E,K,Q,V,W,Y,ja,ba,fa,ua,xa,va,P,N,A,M,O,U,X,ia){var ca=L(null,{idProperty:"id",constructor:function(S){L.safeMixin(this,S)},get:function(S,ea){return fa.PortalUtil.request(this.portalUrl+"content/items/"+S,ea).then(function(na){return new fa.PortalItem(d.mixin(na,{portal:this.portal}))})},getIdentity:function(S){return S[this.idProperty]},query:function(S,ea){S=d.isObject(S)?S:{q:S};var na=null;if(ea){S=d.mixin(S,{num:ea.count,start:(ea.start||
0)+1});if(ea.sort&&ea.sort.length){var ha=ea.sort[0];S=d.mixin(S,{sortField:encodeURIComponent("created"===ha.attribute?"uploaded":ha.attribute),sortOrder:ha.descending?"desc":"asc"})}ea.useExtent&&ea.extent&&(S.bbox=ea.extent);ea.queryType&&"group"===ea.queryType&&(na="group")}ea="group"===na?this.portal.queryGroups(S,!0).then(function(ma){ma.results.total=ma.total;return ma.results}):this.portal.queryItems(S,!0).then(function(ma){ma.results.total=ma.total;return ma.results});return fa.PortalResult(ea)}});
p=L([Y,ja,ba,xa],{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:va,postMixInProperties:function(){this.inherited(arguments)},postCreate:function(){this.inherited(arguments);this.self?(this._portal=new fa.Portal({url:this.portalUrl,self:this.self}),this._init(),this._portal.on("load",d.hitch(this,function(){this.emit("portal-load",
{portal:this._portal});this._fetchData()}))):(this._portal=new fa.Portal(this.portalUrl),this._portal.signIn().then(d.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=d.mixin(this.query||{},{get:function(S){return this[S]&&this[S].length?"("+this[S].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),g.remove(this.helpLink,"hide");z(".templates",this.domNode).addClass("fade");z(".dgrid-footer",this.domNode).addClass("hide");c.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(){e.byId("close-panel").click()},
_setItemQueryAttr:function(S){this.itemQuery=S},_setPluginAttr:function(S){this.addPlugin(S)},_setMessageAttr:function(S){this.set("messageRight",S)},_setMessageRightAttr:function(S){"string"===typeof S?a.set(this.messageNodeRight,"innerHTML",S):S instanceof HTMLElement&&n.place(S,this.messageNodeRight);g.remove(this.messageNodeRight,"hide")},_setMessageLeftAttr:function(S){"string"===typeof S?a.set(this.messageNodeLeft,"innerHTML",S):S instanceof HTMLElement&&n.place(S,this.messageNodeLeft);g.remove(this.messageNodeLeft,
"hide")},_setDisabledAttr:function(S){var ea=D.findWidgets(this.domNode).concat(D.findWidgets(this._content));q.forEach(ea,function(na){na.set("disabled",S)});g[S?"add":"remove"](this._interval.domNode,"dijitTextBoxDisabled")},_setSortAttr:function(S){this.sortAttribute=S},_setSortDescendingAttr:function(S){this.sortDescending=S},_getSelectionAttr:function(){var S=this._grid.selection,ea;for(ea in S)if(S.hasOwnProperty(ea))break;return ea&&this._grid.row(ea).data},_setGalleryTemplateAttr:function(S){M.isDefined(S)&&
(this.galleryTemplate=S)},_setFormatThumbnailAttr:function(S){M.isDefined(S)&&"function"===typeof S&&(this._formatThumbnail=S)},_setFormatItemTitleAttr:function(S){M.isDefined(S)&&"function"===typeof S&&(this._formatItemTitle=S)},_setRowsPerPageAttr:function(S){this._set("rowsPerPage",S)},_setPagingLinksAttr:function(S){this._set("pagingLinks",S)},_getQueryAttr:function(){return this.query},_setQueryAttr:function(S){this._set("query",S);this._grid&&this._grid.set("query",S.toString())},_setExtentAttr:function(S){S&&
this._set("extent",this._extentToString(S))},_setUseExtentAttr:function(S){this._set("useExtent",S)},_setQueryTypeAttr:function(S){this._set("queryType",S)},_setFetchTimeoutAttr:function(S){this._set("fetchTimeout",S)},_setShowInfoPanelAttr:function(S){this._set("showInfoPanel",S)},_setSelectionModeAttr:function(S){-1===q.indexOf(["extended","toggle","multiple","single","none"],S)&&(console.log("Incorrect Value provided for selectionMode. It is one of the following: extended, toggle, multiple, single, none"),
S="single");this._set("selectionMode",S)},_setDemandListAttr:function(S){this._set("demandList",S)},_validate:function(){return!!this.get("selection")},reset:function(){z(".esriSearchBox",e.byId(this.id+"_search")).forEach(function(ma){a.set(ma,"value","")});this.query.search="";if(this.plugIn.filters){var S=[],ea=[],na=[],ha=[];z("li.active",this.domNode).forEach(function(ma){g.remove(ma,"active");var x=this.plugIn.filters[ma.childNodes[0].id];ma=q.map(x.tags,function(R){return'tags:"'+R+'"'},this);
var F=q.map(x.owners,function(R){return'owner:"'+R+'"'},this),T=q.map(x.orgids,function(R){return'orgid:"'+R+'"'},this);x=q.map(x.typekeywords,function(R){return'typekeywords:"'+R+'"'},this);S.push(ma);na.push(F);ha.push(T);ea.push(x)},this);this.query.tags=q.filter(this.query.tags,function(ma){return-1!==q.indexOf(S,ma)});this.query.owners=q.filter(this.query.owners,function(ma){return-1!==q.indexOf(na,ma)});this.query.orgids=q.filter(this.query.orgids,function(ma){return-1!==q.indexOf(ha,ma)});
this.query.typekeywords=q.filter(this.query.typekeywords,function(ma){return-1!==q.indexOf(ea,ma)});e.byId("all").click()}},_showPopup:function(S){if(!this._isInsideTooltipDialog){this._closePopup();var ea=this._grid.row(S);S=z("img",ea.element)[0];if(ea={summary:ea.data.snippet},ea.summary)this._tooltip=new B({content:d.replace(this._popupTemplate,ea),onMouseEnter:d.hitch(this,function(){this._isInsideTooltipDialog=!0}),onMouseLeave:d.hitch(this,function(){this._isInsideTooltipDialog=!1;this._closePopup()})}),
H.open({className:"esriBrowsePopupCtr",popup:this._tooltip,around:S,orient:["after-centered","before-centered"]}),this._onCloseConnect=z(".dijitDialogCloseIcon",this._tooltip.domNode).on("click",d.hitch(this,function(na){na.preventDefault();this._closePopup()}))}},_closePopup:function(){this._tooltip&&(this._onCloseConnect&&this._onCloseConnect.remove(),H.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;q.forEach(this._panelClickHandles,"item.remove();");n.empty(this.infoPanel)},_createGrid:function(){var S=L([I,C,w,N,f]),ea=new W(new ca({portal:this._portal})),na=this.query,ha=d.hitch(this,function(F){F.snippet=F.snippet||"";var T=V("div");F=b.substitute(this.galleryTemplate,{item:F,i18n:this.i18n},null,this);n.place(F,T);return T}),ma={};this.get("demandList")&&(S=L([I,r,w,N,f]));
this.get("useExtent")&&(ma.extent=this.get("extent"),ma.useExtent=this.get("useExtent"));this.get("queryType")&&(ma.queryType=this.get("queryType"));var x={store:ea,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:ha,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:ma};this.get("demandList")&&(x={store:ea,query:na.toString(),minRowsPerPage:this.plugIn&&this.plugIn.rowsPerPage||this.get("itemsPerPage")||50,selectionMode:this.selectionMode||"single",loadingMessage:"Loading items...",showLoadingMessage:!1,renderRow:ha,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:ma});this._grid=new S(x,this.id+"_grid");this._grid.startup();this.own(h(this.domNode,"click",d.hitch(this,function(F){e.byId("close-panel")&&this.isAutoClose&&e.byId("close-panel").click()})),this._grid.on(K.enterRow,d.hitch(this,function(F){!1===g.contains(this.domNode,"showing")&&this.showInfoPanel&&this._showOverlay(!0,
F);this.showTooltip&&!this.showInfoPanel&&this._showPopup(F)})),this._grid.on(K.leaveRow,d.hitch(this,function(F){this._showOverlay(!1,F);this.showTooltip&&!this.showInfoPanel&&this._closePopup(F)})),this._grid.on(".dgrid-row:click",d.hitch(this,function(F){this.emit("grid-row-click",F);if(!1===g.contains(this.domNode,"showing")&&this.showInfoPanel){F.preventDefault();t.stop(F);this._clearClosePanelTimeout();var T=this.get("selection");this._showOverlay(!1,F);this.showInfoPanel&&this.infoPanelTemplate?
(c.set(this.infoPanel,"display","block"),n.place(b.substitute(this.infoPanelTemplate,{item:T,i18n:this.i18n},function(R){return M.isDefined(R)?R:""},this),this.infoPanel)):c.set(this.infoPanel,"display","none");this.emit("show-info-panel");g.add(this.domNode,"showing");this._panelClickHandles=[z(".template-info-showing .thumbnail img",this.domNode).on("error",d.hitch(this,function(R){a.set(R.target,"src",T.thumbnailUrl)})),z(".panel-actions .btn").on("click",d.hitch(this,function(R){R.preventDefault();
t.stop(R);this.checkIsButtonEnabled&&g.contains(R.target,"disabled")||("close-panel"===R.target.id?(g.remove(this.domNode,"showing"),c.set(this.infoPanel,"display","none"),this._panelClosing=setTimeout(d.hitch(this,function(){q.forEach(void 0,"item.remove();");n.empty(this.infoPanel)},250))):(v.publish("/esri/browseitems/close",R.target.id,this.get("selection")),R={selection:this.get("selection"),action:R.target.id},this.emit("browseitems-close",R)))})),z(".js-info-panel",this.domNode).on("click",
d.hitch(this,function(R){this.isAutoClose&&(R.preventDefault(),t.stop(R))})),h(z(".dgrid-footer,.dgrid-header",this._grid.domNode),m.leave,d.hitch(this,function(R){this.showTooltip&&!this.showInfoPanel&&this._closePopup()}))]}})),this._grid.on("dgrid-refresh-complete",d.hitch(this,function(F){z(".templates",this.domNode).removeClass("fade");z(".loaderWrap",this.domNode).addClass("hide");z(".dgrid-footer",this.domNode)[this._grid._total<=this._grid.rowsPerPage?"addClass":"removeClass"]("hide");this.showTooltip&&
!this.showInfoPanel&&this._closePopup()})),this._grid.on("refresh",d.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=z(".grid-item-thumb",this._grid.domNode).on("load",d.hitch(this,function(F){(F=this._grid.row(F))&&F.element&&z(".grid-item",F.element).addClass("fadeIn").style("opacity","1")}));this._img_connect_error=z(".grid-item-thumb",
this._grid.domNode).on("error",d.hitch(this,function(F){a.set(F.target,"src",this._portal.staticImagesUrl+"/desktopapp.png")}))})),h(e.byId(this.id+"_search"),"keyup",d.hitch(this,function(F){F.preventDefault();this._clearQueryTimeout();this._queryTimer=setTimeout(d.hitch(this,function(){this.query.search=a.get(F.target,"value");this._fetchItems(this.query).then(d.hitch(this,function(){this._clearQueryTimeout()}))}),this.searchKeypressDelay||450)})),h(e.byId(this.id+"_search"),"search",d.hitch(this,
function(F){this._queryTimer||(F.preventDefault(),this.query.search=a.get(F.target,"value"),this._fetchItems(this.query))})),this.watch("extent",d.hitch(this,function(F,T,R){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",d.hitch(this,function(F,T,R){this._grid.queryOptions.extent=this.get("extent");this._grid.queryOptions.useExtent=
R;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",d.hitch(this,function(F){F={selection:this.get("selection")};this.emit("select-change",F)}))):-1!==q.indexOf(["toggle","multiple","extended"],this._grid.selectionMode)&&this.own(this._grid.on("dgrid-select,dgrid-deselect",d.hitch(this,function(F){F=F.grid.selection;var T,R=
[];for(T in F)F[T]&&R.push(this._grid.row(T).data);this.emit("select-change",{selection:R})}))));this.emit("grid-ready",{grid:this._grid,ready:!0})},_createFilters:function(){if(this.plugIn&&this.plugIn.filters){var S=this.plugIn.filters,ea=this.plugIn.filterStrings,na,ha=z(".filters",this.domNode)[0];for(na in S)n.create("li",{"class":"all"===na?"active":"",innerHTML:"\x3ca id\x3d'"+na+"'  href\x3d'#'\x3e"+ea[na].title+"\x3c/a\x3e"},ha);this.own(h(ha,"li a:click",d.hitch(this,function(ma){ma.preventDefault();
var x=ma.target;z(".active",ha).removeClass("active");g.add(x.parentNode,"active");z(".templates",this.domNode).addClass("fade");setTimeout(d.hitch(this,function(){g["all"===x.id?"add":"remove"](this.filterDescription,"hide");a.set(this.filterDescription,"innerHTML",ea[x.id].description||"")}),225);ma=d.mixin({},S[x.id]||{});this.query.tags=q.map(ma.tags||[],function(F){return'tags:"'+F+'"'});this.query.owners=q.map(ma.owners,function(F){return'owner:"'+F+'"'});this.query.orgids=q.map(ma.orgids,function(F){return'orgid:"'+
F+'"'});this.query.typekeywords=[].concat(q.map(ma.typekeywords||[],function(F){return'typekeywords:"'+F+'"'}));this.filterWithinGroup||(this.query.groups=q.map(ma.groups,function(F){return'group:"'+F+'"'}));this._fetchItems(this.query)})));g.add(this.domNode,"filters");g.remove(this.domNode,"nofilters")}else g.add(this.domNode,"nofilters"+(this.plugIn&&this.plugIn.extraClasses?" "+this.plugIn.extraClasses.join(" "):"")),g.remove(this.domNode,"filters")},_showOverlay:function(S,ea){(ea=this._grid.row(ea))&&
z(".template-overlay",ea.element).style("display",S?"":"none")},_fetchData:function(){this._user=this._portal.getPortalUser();return this.plugIn&&this.plugIn.fetchData?this.plugIn.fetchData():this._fetchItems(this.itemQuery)},_fetchItems:function(S,ea){var na={sort:[{attribute:this.sortAttribute||"title",descending:this.sortDescending||!1}]},ha=new J;this.get("useExtent")&&(na.extent=this.get("extent"),na.useExtent=this.get("useExtent"));this.get("queryType")&&(na.queryType=this.get("queryType"));
z(".templates",this.domNode).addClass("fade");z(".dgrid-footer",this.domNode).addClass("hide");z(".loaderWrap",this.domNode).removeClass("hide");setTimeout(d.hitch(this,function(){this.query=d.mixin(this.query,S);this._grid?this._grid.set("query",this.query.toString(),na):(this._createFilters(),this._createGrid());ha.resolve(this._grid)}),60);return ha},_formatThumbnail:function(S){var ea=S.thumbnailUrl||this._portal.staticImagesUrl+"/desktopapp.png";S.thumbnailUrl=ea;return"\x3cimg class\x3d'grid-item-thumb' width\x3d'187px' height\x3d'125px' alt\x3d'' src\x3d'"+
ea+"'\x3e"},_formatInfoPanelImage:function(S){var ea=S.screenshots&&S.screenshots.length?S.screenshots[0]:null;return ea?S.itemUrl+"/info/"+ea:S.thumbnailUrl},_formatItemTitle:function(S){return"\x3ch5\x3e"+(S.title||S.name||"\x3cNo Title\x3e")+"\x3c/h5\x3e"},clear:function(){this._grid.clearSelection()},doProject:function(S,ea){var na=[102113,102100,3857],ha=new J;var ma=function(F,T){!(F&&0<F.length&&F[0]&&"extent"==F[0].type)||isNaN(F[0].xmin)||isNaN(F[0].ymin)||isNaN(F[0].xmax)||isNaN(F[0].ymax)?
F&&0<F.length&&F[0]&&"point"==F[0].type&&!isNaN(F[0].x)&&!isNaN(F[0].y)&&ha.resolve(F,T):ha.resolve(F,T)};if(null!=S.spatialReference.wkid&&4326==S.spatialReference.wkid&&null!=ea.wkid&&this.contains(na,ea.wkid)){S.ymin=Math.max(S.ymin,-89.99);S.ymax=Math.min(S.ymax,89.99);S=U.geographicToWebMercator(S);if((na=S.spatialReference._getInfo())&&S.xmin>S.xmax){ma=na.valid[1]-S.xmin;var x=S.xmax-na.valid[0];ma>x?S.xmax=na.valid[1]+x:S.xmin=na.valid[0]-ma}S.spatialReference.wkid=ea.wkid;ha.resolve([S])}else null!=
S.spatialReference.wkid&&this.contains(na,S.spatialReference.wkid)&&null!=ea.wkid&&4326==ea.wkid?(S=U.webMercatorToGeographic(S),(na=S.spatialReference._getInfo())&&S.xmin>S.xmax&&(ma=na.valid[1]-S.xmin,x=S.xmax-na.valid[0],ma>x?S.xmax=na.valid[1]+x:S.xmin=na.valid[0]-ma),ha.resolve([S])):(this.geometryService||(this.geometryService=new X(O.defaults.geometryService)),this.geometryService.project([S],ea,ma));return ha},contains:function(S,ea){for(var na=S.length;na--;)if(S[na]===ea)return!0;return!1},
_extentToGCS:function(S){S=S.shiftCentralMeridian(!0);return U.webMercatorToGeographic(S)},_extentToString:function(S){var ea="";null!=S&&(S=this._extentToGCS(S),ea=this._roundValue(S.xmin,1E4)+","+this._roundValue(S.ymin,1E4)+","+this._roundValue(S.xmax,1E4)+","+this._roundValue(S.ymax,1E4));return ea},_roundValue:function(S,ea){return Math.round(S*ea)/ea}});l("extend-esri")&&d.setObject("dijit.BrowseItems",p,A);return p})},"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(L,d,q,p,t,g,c,a,b,h,k,l){function e(m){m.noDataNode?(h(m.noDataNode,"!"),delete m.noDataNode):m.cleanup();m.contentNode.innerHTML=""}function n(m){if(m.loadingNode)h(m.loadingNode,"!"),delete m.loadingNode;else if(m._oldPageNodes){for(var v in m._oldPageNodes)m.removeRow(m._oldPageNodes[v]);delete m._oldPageNodes;m._oldPageObserver&&(m._oldPageObserver.cancel(),m._numObservers--,delete m._oldPageObserver)}delete m._isLoading}return d("dgrid.extensions.Pagination",L,{rowsPerPage:10,pagingTextBox:!1,
previousNextArrows:!0,firstLastArrows:!1,pagingLinks:2,pageSizeOptions:null,showLoadingMessage:!0,i18nPagination:l,showFooter:!0,_currentPage:1,_total:0,buildRendering:function(){this.inherited(arguments);var m=this,v=this.paginationNode=h(this.footerNode,"div.dgrid-pagination"),z=this.paginationStatusNode=h(v,"div.dgrid-status"),y=this.i18nPagination;z.tabIndex=0;this._updatePaginationSizeSelect();this._updateRowsPerPageOption();z.innerHTML=a.substitute(y.status,{start:1,end:1,total:0});v=this.paginationNavigationNode=
h(v,"div.dgrid-navigation");this.firstLastArrows&&(z=this.paginationFirstNode=h(v,"span.dgrid-first.dgrid-page-link","\u00ab"),z.setAttribute("aria-label",y.gotoFirst),z.tabIndex=0);this.previousNextArrows&&(z=this.paginationPreviousNode=h(v,"span.dgrid-previous.dgrid-page-link","\u2039"),z.setAttribute("aria-label",y.gotoPrev),z.tabIndex=0);this.paginationLinksNode=h(v,"span.dgrid-pagination-links");this.previousNextArrows&&(z=this.paginationNextNode=h(v,"span.dgrid-next.dgrid-page-link","\u203a"),
z.setAttribute("aria-label",y.gotoNext),z.tabIndex=0);this.firstLastArrows&&(z=this.paginationLastNode=h(v,"span.dgrid-last.dgrid-page-link","\u00bb"),z.setAttribute("aria-label",y.gotoLast),z.tabIndex=0);this._listeners.push(g(v,".dgrid-page-link:click,.dgrid-page-link:keydown",function(D){if("keydown"!==D.type||13===D.keyCode)if(D=this.className,!(m._isLoading||-1<D.indexOf("dgrid-page-disabled"))){var B=m._currentPage;var H=Math.ceil(m._total/m.rowsPerPage);this===m.paginationPreviousNode?m.gotoPage(B-
1):this===m.paginationNextNode?m.gotoPage(B+1):this===m.paginationFirstNode?m.gotoPage(1):this===m.paginationLastNode?m.gotoPage(H):"dgrid-page-link"===D&&m.gotoPage(+this.innerHTML)}}))},destroy:function(){this.inherited(arguments);this._pagingTextBoxHandle&&this._pagingTextBoxHandle.remove()},_updatePaginationSizeSelect:function(){var m=this.pageSizeOptions,v=this.paginationSizeSelect;if(m&&m.length){if(!v){v=this.paginationSizeSelect=h(this.paginationNode,"select.dgrid-page-size[aria-label\x3d"+
this.i18nPagination.rowsPerPage+"]");var z=this._paginationSizeChangeHandle=g(v,"change",p.hitch(this,function(){this.set("rowsPerPage",+this.paginationSizeSelect.value)}));this._listeners.push(z)}for(z=v.options.length=0;z<m.length;z++)h(v,"option",m[z],{value:m[z],selected:this.rowsPerPage===m[z]});this._updateRowsPerPageOption()}else m&&m.length||!v||(h(v,"!"),this.paginationSizeSelect=null,this._paginationSizeChangeHandle.remove())},_setPageSizeOptions:function(m){this.pageSizeOptions=m&&m.sort(function(v,
z){return v-z});this._updatePaginationSizeSelect()},_updateRowsPerPageOption:function(){var m=this.rowsPerPage,v=this.pageSizeOptions,z=this.paginationSizeSelect;z&&(0>q.indexOf(v,m)?this._setPageSizeOptions(v.concat([m])):z.value=""+m)},_setRowsPerPage:function(m){this.rowsPerPage=m;this._updateRowsPerPageOption();this.gotoPage(1)},_updateNavigation:function(){function m(w,u){if(z.pagingTextBox&&w==B&&1<J)u=h(D,"input.dgrid-page-input[type\x3dtext][value\x3d$]",B),u.setAttribute("aria-label",y.jumpPage),
z._pagingTextBoxHandle=g(u,"change",function(){var K=+this.value;!isNaN(K)&&0<K&&K<=J&&z.gotoPage(+this.value)}),C&&"INPUT"===C.tagName&&u.focus();else{var E=w===B;u=h(D,"span"+(E?".dgrid-page-disabled":"")+".dgrid-page-link",w+(u?" ":""));u.setAttribute("aria-label",y.gotoPage);u.tabIndex=E?-1:0;f===w&&(E?w<J?f++:r.focus():u.focus());E||(r=u)}}function v(w,u){h(w,(u?".":"!")+"dgrid-page-disabled");w.tabIndex=u?-1:0}var z=this,y=this.i18nPagination,D=this.paginationLinksNode,B=this._currentPage,H=
this.pagingLinks,G=this.paginationNavigationNode,J=Math.ceil(this._total/this.rowsPerPage),I=this._pagingTextBoxHandle,C=document.activeElement,f,r;C&&k.contains(this.paginationNavigationNode,C)?"dgrid-page-link"===C.className&&(f=+C.innerHTML):C=null;I&&I.remove();D.innerHTML="";c(".dgrid-first, .dgrid-previous",G).forEach(function(w){v(w,1===B)});c(".dgrid-last, .dgrid-next",G).forEach(function(w){v(w,B>=J)});if(H&&0<J){m(1,!0);G=B-H;for(2<G?h(D,"span.dgrid-page-skip","..."):G=2;G<Math.min(B+H+
1,J);G++)m(G,!0);B+H+1<J&&h(D,"span.dgrid-page-skip","...");1<J&&m(J)}else z.pagingTextBox&&m(B);C&&-1===C.tabIndex&&(H=c("[tabindex\x3d'0']",this.paginationNavigationNode),C===this.paginationPreviousNode||C===this.paginationFirstNode?C=H[0]:H.length&&(C=H[H.length-1]),C&&C.focus())},refresh:function(){var m=this;this.inherited(arguments);if(this.store)return this.gotoPage(1).then(function(v){setTimeout(function(){g.emit(m.domNode,"dgrid-refresh-complete",{bubbles:!0,cancelable:!1,grid:m,results:v})},
0);return v});console.warn("Pagination requires a store to operate.")},_onNotification:function(m){m.length!==this._rowsOnPage&&this.gotoPage(this._currentPage)},renderArray:function(m,v){var z=this,y=this.inherited(arguments);this._lastCollection=null;v||(this._topLevelRequest&&this._topLevelRequest!==m&&(this._topLevelRequest.cancel(),delete this._topLevelRequest),"function"===typeof m.cancel&&(this._topLevelRequest=m),t.when(m,function(){z._topLevelRequest&&delete z._topLevelRequest}));return y},
insertRow:function(){var m=this._oldPageNodes,v=this.inherited(arguments);m&&v===m[v.id]&&delete m[v.id];return v},gotoPage:function(m){var v=this,z=new t;this._trackError(function(){var y=v.rowsPerPage,D=(m-1)*y,B=p.mixin(v.get("queryOptions"),{start:D,count:y}),H=v.contentNode,G;if(v.showLoadingMessage){e(v);var J=v.loadingNode=h(H,"div.dgrid-loading");J.innerHTML=v.loadingMessage}else{v._oldPageNodes=J={};H=H.children;var I=0;for(G=H.length;I<G;I++)J[H[I].id]=H[I];v._oldPageObserver=v.observers.pop()}v._isLoading=
!0;var C=v.store.query(v.query,B);t.when(v.renderArray(C,null,B),function(f){n(v);v.scrollTo({y:0});t.when(C.total,function(r){r||(v.noDataNode&&(h(v.noDataNode,"!"),delete v.noDataNode),v.noDataNode=h(v.contentNode,"div.dgrid-no-data"),v.noDataNode.innerHTML=v.noDataMessage);v.paginationStatusNode.innerHTML=a.substitute(v.i18nPagination.status,{start:Math.min(D+1,r),end:Math.min(r,D+y),total:r});v._total=r;v._currentPage=m;v._rowsOnPage=f.length;v._updateNavigation()});(7>b("ie")||b("ie")&&b("quirks"))&&
v.resize();z.resolve(C)},function(f){n(v);z.reject(f)});return z.promise})||z.reject();return z.promise}})})},"dgrid/extensions/DijitRegistry":function(){define(["dojo/_base/declare","dojo/dom-geometry","dijit/registry"],function(L,d,q){return L("dgrid.extensions.DijitRegistry",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 p=q.getEnclosingWidget(this.domNode.parentNode);p&&p.isLayoutContainer&&this._resizeHandle.remove()}},destroyRecursive:function(){this.destroy()},destroy:function(){this.inherited(arguments);q.remove(this.id)},getChildren:function(){return[]},isLeftToRight:function(){return!this.isRTL},resize:function(p){p&&d.setMarginBox(this.domNode,p);this.inherited(arguments)},_set:function(p,t){this[p]=t},watch:function(){},getParent:function(){return q.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(L,d,q,p,t,g,c){q.getObject("dgrid.selector",!0);return dgrid.selector=function(a,b){function h(y){return!m.allowSelect(m.row(y))}function k(y){return function(D){var B=D.rows,H=B.length;D="false";var G;for(G=0;G<H;G++){var J=m.cell(B[G],a.id).element;J&&(J=(J.contents||J).input)&&!J.disabled&&(J.checked=y,J.setAttribute("aria-checked",y))}if("checkbox"==v.type){B=m.selection;H=!1;for(G in B)if(B[G]!=m.allSelected){H=!0;break}v.indeterminate=H;v.checked=m.allSelected;H?D="mixed":m.allSelected&&
(D="true");v.setAttribute("aria-checked",D)}}}function l(y){if("click"==y.type||32==y.keyCode||!g("opera")&&13==y.keyCode||0===y.keyCode){var D=m.row(y);m._selectionTriggerEvent=y;if(D){if(m.allowSelect(D)){var B=m._lastSelected&&m.row(m._lastSelected);"radio"==b?B&&B.id==D.id||(m.clearSelection(),m.select(D,null,!0),m._lastSelected=D.element):D&&(y.shiftKey?k(!0)({rows:[D]}):B=null,B=y.shiftKey?B:null,m.select(B||D,D,B?void 0:null),m._lastSelected=D.element)}}else c(this,(m.allSelected?"!":".")+
"dgrid-select-all"),m[m.allSelected?"clearSelection":"selectAll"]();m._selectionTriggerEvent=null}}function e(){m._hasSelectorInputListener=!0;n.push(m.on(".dgrid-selector:click,.dgrid-selector:keydown",l));var y=m._handleSelect;m._handleSelect=function(H){this.cell(H).column!=a&&y.apply(this,arguments)};if("function"==typeof a.disabled){var D=m.allowSelect,B=a.disabled;m.allowSelect=function(H){var G=D.call(this,H);return B===h?G:G&&!B.call(a,H.data)}}a.disabled=h;n.push(m.on("dgrid-select",k(!0)));
n.push(m.on("dgrid-deselect",k(!1)))}var n=[],m,v;a||(a={});a.type&&(a.selectorType=a.type,L.deprecated("columndef.type","use columndef.selectorType instead","dgrid 0.4"));a.selectorType=b=b||a.selectorType||"checkbox";a.sortable=!1;var z="function"==typeof b?b:function(y,D,B){var H=D.parentNode;m._hasSelectorInputListener||e();var G=a.disabled;c(H&&H.contents?H:D,".dgrid-selector");D=D.input||(D.input=c(D,"input[type\x3d"+b+"]",{tabIndex:isNaN(a.tabIndex)?-1:a.tabIndex,disabled:G&&("function"==typeof G?
G.call(a,B):G),checked:y}));D.setAttribute("aria-checked",!!y);return D};t.after(a,"init",function(){m=a.grid});t.after(a,"destroy",function(){d.forEach(n,function(y){y.remove()});m._hasSelectorInputListener=!1});a.renderCell=function(y,D,B,H,G){D=(D=y&&m.row(y))&&m.selection[D.id];z(D,B,y)};a.renderHeaderCell=function(y){var D="label"in a?a.label:a.field||"";"radio"!=b&&m.allowSelectAll?z(!1,y,{}):(y.appendChild(document.createTextNode(D)),m._hasSelectorInputListener||e());v=y.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(L,d,q,p,t,g,c,a){function b(C){C.preventDefault()}var h={checkbox:1,radio:1,button:1},k=/\bdgrid-cell\b/,l=/\bdgrid-row\b/,e=L("dgrid.Keyboard",null,{pageSkip:10,tabIndex:0,keyMap:null,headerKeyMap:null,postMixInProperties:function(){this.inherited(arguments);this.keyMap||(this.keyMap=p.mixin({},e.defaultKeyMap));
this.headerKeyMap||(this.headerKeyMap=p.mixin({},e.defaultHeaderKeyMap))},postCreate:function(){function C(w){var u=w.target;return u.type&&(!h[u.type]||32==w.keyCode)}function f(w){function u(){r._focusedHeaderNode&&(r._focusedHeaderNode.tabIndex=-1);if(r.showHeader){if(E)for(var W=0,Y,ja=r.headerNode.getElementsByTagName("th");Y=ja[W];++W){if(K.test(Y.className)){r._focusedHeaderNode=V=Y;break}}else r._focusedHeaderNode=V=r.headerNode;V&&(V.tabIndex=r.tabIndex)}}var E=r.cellNavigation,K=E?k:l,Q=
w===r.headerNode,V=w;Q?(u(),d.after(r,"renderHeader",u,!0)):d.after(r,"renderArray",function(W){return a.when(W,function(Y){var ja=r._focusedNode||V;if(K.test(ja.className)&&c.contains(w,ja))return Y;for(var ba=0,fa=w.getElementsByTagName("*"),ua;ua=fa[ba];++ba)if(K.test(ua.className)){ja=r._focusedNode=ua;break}ja.tabIndex=r.tabIndex;return Y})});r._listeners.push(q(w,"mousedown",function(W){C(W)||r._focusOnNode(W.target,Q,W)}));r._listeners.push(q(w,"keydown",function(W){if(!W.metaKey&&!W.altKey){var Y=
r[Q?"headerKeyMap":"keyMap"][W.keyCode];Y&&!C(W)&&Y.call(r,W)}}))}this.inherited(arguments);var r=this;this.tabableHeader&&(f(this.headerNode),this._listeners.push(q(this.headerNode,"dgrid-cellfocusin",function(){r.scrollTo({x:this.scrollLeft})})));f(this.contentNode);this._debouncedEnsureScroll=c.debounce(this._ensureScroll,this)},removeRow:function(C){if(!this._focusedNode)return this.inherited(arguments);var f=this,r=document.activeElement===this._focusedNode,w=this[this.cellNavigation?"cell":
"row"](this._focusedNode),u=w.row||w,E;C=C.element||C;C===u.element&&((E=this.down(u,!0))&&E.element!==C||(E=this.up(u,!0)),this._removedFocus={active:r,rowId:u.id,columnId:w.column&&w.column.id,siblingId:E&&E.element!==C?E.id:void 0},setTimeout(function(){f._removedFocus&&f._restoreFocus(u.id)},0),this._focusedNode=null);this.inherited(arguments)},insertRow:function(C){var f=this.inherited(arguments);this._removedFocus&&!this._removedFocus.wait&&this._restoreFocus(f);return f},_restoreFocus:function(C){var f=
this._removedFocus,r;if((C=(C=C&&this.row(C))&&C.element&&C.id===f.rowId?C:"undefined"!==typeof f.siblingId&&this.row(f.siblingId))&&C.element){if(!C.element.parentNode.parentNode){f.wait=!0;return}"undefined"!==typeof f.columnId&&(r=this.cell(C,f.columnId))&&r.element&&(C=r);f.active&&0!==C.element.offsetHeight?this._focusOnNode(C,!1,null):(g(C.element,".dgrid-focus"),C.element.tabIndex=this.tabIndex,this._focusedNode=C.element)}delete this._removedFocus},addKeyHandler:function(C,f,r){return d.after(this[r?
"headerKeyMap":"keyMap"],C,f,!0)},_ensureRowScroll:function(C){var f=this.getScrollPosition().y;f>C.offsetTop?this.scrollTo({y:C.offsetTop}):f+this.contentNode.offsetHeight<C.offsetTop+C.offsetHeight&&this.scrollTo({y:C.offsetTop-this.contentNode.offsetHeight+C.offsetHeight})},_ensureColumnScroll:function(C){var f=this.getScrollPosition().x,r=C.offsetLeft;if(f>r)this.scrollTo({x:r});else{var w=this.bodyNode.clientWidth;C=C.offsetWidth;var u=r+C;f+w<u&&this.scrollTo({x:w>C?u-w:r})}},_ensureScroll:function(C,
f){this.cellNavigation&&(this.columnSets||1<this.subRows.length)&&!f&&this._ensureRowScroll(C.row.element);this.bodyNode.clientWidth<this.contentNode.offsetWidth&&this._ensureColumnScroll(C.element)},_focusOnNode:function(C,f,r){var w="_focused"+(f?"Header":"")+"Node",u=this[w],E=this.cellNavigation?"cell":"row",K=this[E](C),Q;if(C=K&&K.element){if(this.cellNavigation){var V=C.getElementsByTagName("input");var W=0;for(Q=V.length;W<Q;W++){var Y=V[W];if((-1!=Y.tabIndex||"_dgridLastValue"in Y)&&!Y.disabled){8>
t("ie")&&(Y.style.position="relative");Y.focus();8>t("ie")&&(Y.style.position="");var ja=!0;break}}}null!==r&&(r=p.mixin({grid:this},r),r.type&&(r.parentType=r.type),r.bubbles||(r.bubbles=!0));u&&(g(u,"!dgrid-focus[!tabIndex]"),8>t("ie")&&(u.style.position=""),r&&(r[E]=this[E](u),q.emit(u,"dgrid-cellfocusout",r)));u=this[w]=C;r&&(r[E]=K);w=this.cellNavigation?k:l;!ja&&w.test(C.className)&&(8>t("ie")&&(C.style.position="relative"),C.tabIndex=this.tabIndex,C.focus());g(C,".dgrid-focus");r&&q.emit(u,
"dgrid-cellfocusin",r);this._debouncedEnsureScroll(K,f)}},focusHeader:function(C){this._focusOnNode(C||this._focusedHeaderNode,!0)},focus:function(C){(C=C||this._focusedNode)?this._focusOnNode(C,!1):this.contentNode.focus()}}),n=e.moveFocusVertical=function(C,f){if(this._focusOnNode&&C.target!==this.contentNode){var r=this.cellNavigation,w=this[r?"cell":"row"](C);w=r&&w.column.id;f=this.down(this._focusedNode,f,!0);r&&(f=this.cell(f,w));this._focusOnNode(f,!1,C);C.preventDefault()}};L=e.moveFocusUp=
function(C){n.call(this,C,-1)};var m=e.moveFocusDown=function(C){n.call(this,C,1)},v=e.moveFocusPageUp=function(C){n.call(this,C,-this.pageSkip)},z=e.moveFocusPageDown=function(C){n.call(this,C,this.pageSkip)},y=e.moveFocusHorizontal=function(C,f){if(this.cellNavigation&&C.target!==this.contentNode){var r=!this.row(C);this._focusOnNode(this.right(this["_focused"+(r?"Header":"")+"Node"],f),r,C);C.preventDefault()}},D=e.moveFocusLeft=function(C){y.call(this,C,-1)},B=e.moveFocusRight=function(C){y.call(this,
C,1)},H=e.moveHeaderFocusEnd=function(C,f){if(this.cellNavigation){var r=this.headerNode.getElementsByTagName("th");this._focusOnNode(r[f?0:r.length-1],!0,C)}C.preventDefault()},G=e.moveHeaderFocusHome=function(C){H.call(this,C,!0)},J=e.moveFocusEnd=function(C,f){var r=this,w=this.cellNavigation,u=this.contentNode,E=u.scrollTop+(f?0:u.scrollHeight);u=u[f?"firstChild":"lastChild"];var K=-1<u.className.indexOf("dgrid-preload"),Q=K?u[(f?"next":"previous")+"Sibling"]:u,V=Q.offsetTop+(f?0:Q.offsetHeight);
if(K){for(;Q&&0>Q.className.indexOf("dgrid-row");)Q=Q[(f?"next":"previous")+"Sibling"];if(!Q)return}if(!K||1>u.offsetHeight)w&&(Q=this.cell(Q,this.cell(C).column.id)),this._focusOnNode(Q,!1,C);else{t("dom-addeventlistener")||(C=p.mixin({},C));var W=d.after(this,"renderArray",function(Y){W.remove();return a.when(Y,function(ja){ja=ja[f?0:ja.length-1];w&&(ja=r.cell(ja,r.cell(C).column.id));r._focusOnNode(ja,!1,C)})})}E===V&&C.preventDefault()},I=e.moveFocusHome=function(C){J.call(this,C,!0)};e.defaultKeyMap=
{32:b,33:v,34:z,35:J,36:I,37:D,38:L,39:B,40:m};e.defaultHeaderKeyMap={32:b,35:H,36:G,37:D,39:B};return e})},"dgrid/util/mouse":function(){define(["dojo/_base/lang","dojo/on","dojo/dom","dojo/query"],function(L,d,q){function p(g,c){return function(a,b){return d(a,g+":"+c,function(h){if(!q.isDescendant(h.relatedTarget,this))return b.call(this,h)})}}var t={enterRow:p(".dgrid-content .dgrid-row","mouseover"),enterCell:p(".dgrid-content .dgrid-cell","mouseover"),enterHeaderCell:p(".dgrid-header .dgrid-cell",
"mouseover"),leaveRow:p(".dgrid-content .dgrid-row","mouseout"),leaveCell:p(".dgrid-content .dgrid-cell","mouseout"),leaveHeaderCell:p(".dgrid-header .dgrid-cell","mouseout"),createDelegatingHandler:p};L.getObject("dgrid.util.mouse",!0);L.mixin(dgrid.util.mouse,t);return t})},"dgrid/util/touch":function(){define(["dojo/on","dojo/query"],function(L,d){function q(t,g,c,a){if(!(1<c.targetTouches.length)){var b=c.changedTouches[0],h=b.screenX,k=b.screenY;a&&c.preventDefault();var l=L(t,"touchend",function(e){var n=
e.changedTouches[0];e.targetTouches.length||(Math.abs(n.screenX-h)<p.tapRadius&&Math.abs(n.screenY-k)<p.tapRadius&&(a&&e.preventDefault(),g.call(this,e)),l.remove())})}}var p={tapRadius:10,dbltapTime:250,selector:function(t,g,c){return function(a,b){var h=g.bubble;h?g=h:!1!==c&&(c=!0);return L(a,g,function(k){var l=k.target;3==l.nodeType&&(l=l.parentNode);for(;!d.matches(l,t,a);)if(l==a||!c||!(l=l.parentNode))return;return b.call(l,k)})}},countCurrentTouches:function(t,g){if(!("touches"in t))return-1;
var c,a,b;for(a=c=0;b=t.touches[c];++c)g.contains(b.target)&&++a;return a},tap:function(t,g){return L(t,"touchstart",function(c){q(t,g,c)})},dbltap:function(t,g){var c,a;return L(t,"touchstart",function(b){c?q(t,function(h){if(c){var k=h.changedTouches[0];Math.abs(k.screenX-c.screenX)<p.tapRadius&&Math.abs(k.screenY-c.screenY)<p.tapRadius&&(a&&clearTimeout(a),c=a=null,g.call(this,h))}},b,!0):q(t,function(h){c=h.changedTouches[0];a=setTimeout(function(){c=a=null},p.dbltapTime)},b)})}};return p})},
"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(L,d,q,p,t,g){function c(a){"object"!==typeof a&&(a=Error(a));a.grid=this;p.emit(this.domNode,"dgrid-error",{grid:this,error:a,cancelable:!0,bubbles:!0})&&console.error(a)}L=L(null,{_trackError:function(a){"string"===typeof a&&(a=d.hitch(this,a));try{var b=a()}catch(h){c.call(this,h)}return q.when(b,d.hitch(this,function(){p.emit(this.domNode,"refresh",{cancelable:!0,bubbles:!0})}),d.hitch(this,c))}});t("extend-esri")&&d.setObject("dijit._RefreshMixin",L,g);return L})},"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(L,d,q,p,t,g,c){var a=L(null,{filters:{all:{},categoryBoundaries:{tags:["boundaries","places"]},subCategoryBoundaries:{tags:["boundaries"]},subCategoryPlaces:{tags:["places"]},categoryHexBins:{tags:["hex"]},categoryTransportation:{tags:["transportation"]}},constructor:function(b){d.mixin(this,b);this.i18n=d.mixin({},c.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 b;return this._fetchGroups().then(d.hitch(this,function(h){b=q.map(h||[],function(k){if(k)return'group:"'+k.id+'"'});return this._fetchGroupItems(b)}))},_fetchGroup:function(b,h){this._groups=this._groups||
[];return this._groups[b]||this._portal.queryGroups(h,!0).then(d.hitch(this,function(k){0<k.total&&k.results&&(this._groups[b]=k.results);return this._groups[b]||[]}))},_fetchGroupItems:function(b,h){var k=this._isCustom?['-typekeywords:"Multilayer"']:['typekeywords:"Analysis Ready"'];this._portal&&this._portal.user&&this._portal.user.demographics||k.push('-typekeywords:"Requires Credits"');return this.parent._fetchItems({groups:b,query:h,types:['type:"Map Service"','type:"Feature Service"'],typekeywords:k})},
_fetchGroups:function(){return this._fetchEsriAnalysisLayers()},_fetchEsriAnalysisLayers:function(){if(this._portal&&this._portal.analysisLayersGroupQuery){var b=this._portal.analysisLayersGroupQuery;this._isCustomAnalysisQuery()&&(this.filterStrings=this.filters=null)}return this._fetchGroup("esriAnalysisLayers",{q:b,num:100,start:0}).then(d.hitch(this,function(h){h&&0<h.length&&(this.parent.sortAttribute=h[0].sortField,this.parent.sortDescending="asc"!==h[0].sortOrder);return h}))},_isCustomAnalysisQuery:function(){var b=
'title:"Living Atlas Analysis Layers" AND owner:esri',h=!1;this._portal&&this._portal.isPortal&&(b='title:"Living Atlas Analysis Layers" AND owner:esri_livingatlas');this._portal&&this._portal.analysisLayersGroupQuery&&this._portal.analysisLayersGroupQuery!==b&&(h=!0);return this._isCustom=h}});d.mixin(a,{add:function(b,h){b.plugIn||(h=h||{},h.parent=b,b.plugIn=new a(h))},remove:function(b){b.plugIn&&(b.plugIn.destroy(),delete b.plugIn)}});t("extend-esri")&&d.setObject("dijit.analysis.PluginAnalysisLayers",
a,g);return a})},"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(L,d,q,p,t,g,c,a,b,h,k,l,e,n,m,v,z,y,D,B,H,G,J){L=L(l,{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(I){this._jobUpdateHandler=d.hitch(this,this._jobUpdateHandler);this._getJobStatus=d.hitch(this,this._getJobStatus);this._getResultDataHandler=d.hitch(this,this._getResultDataHandler);this._getResultImageHandler=d.hitch(this,
this._getResultImageHandler);this._executeHandler=d.hitch(this,this._executeHandler);this._updateTimers=[];this.registerConnectEvents()},updateDelay:1E3,processSpatialReference:null,outputSpatialReference:null,outSpatialReference:null,setUpdateDelay:function(I){this.updateDelay=I},setProcessSpatialReference:function(I){this.processSpatialReference=I},setOutputSpatialReference:function(I){this._setOutSR(I)},setOutSpatialReference:function(I){this._setOutSR(I)},__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(I){this.outSpatialReference=this.outputSpatialReference=I},_getOutSR:function(){return this.outSpatialReference||this.outputSpatialReference},_gpEncode:function(I,C,f){for(var r in I){var w=I[r];d.isArray(w)?I[r]=t.toJson(q.map(w,function(u){return this._gpEncode({item:u},!0).item},this)):w instanceof Date&&(I[r]=w.getTime())}return this._encode(I,C,f)},_decode:function(I){var C=I.dataType,f=new B(I);if(-1!==q.indexOf(["GPBoolean",
"GPDouble","GPLong","GPString"],C))return f;if("GPLinearUnit"===C)f.value=new v(f.value);else if("GPFeatureRecordSetLayer"===C||"GPRecordSet"===C)f.value=new e(f.value);else if("GPDataFile"===C)f.value=new z(f.value);else if("GPDate"===C)I=f.value,d.isString(I)?f.value=new D({date:I}):f.value=new Date(I);else if("GPRasterData"===C||"GPRasterDataLayer"===C)I=I.value.mapImage,f.value=I?new J(I):new y(f.value);else if(-1!==C.indexOf("GPMultiValue:")){var r=C.split(":")[1];I=f.value;f.value=q.map(I,function(w){return this._decode({paramName:"_name",
dataType:r,value:w}).value},this)}else console.log(this.declaredClass+" : GP Data type not handled. : "+f.dataType),f=null;return f},submitJob:function(I,C,f,r,w){var u=this._getOutSR(),E=w.assembly;I=this._gpEncode(d.mixin({},this._url.query,{f:"json","env:outSR":u?u.wkid||t.toJson(u.toJson()):null,"env:processSR":this.processSpatialReference?this.processSpatialReference.wkid||t.toJson(this.processSpatialReference.toJson()):null},I),null,E&&E[0]);var K=this._jobUpdateHandler,Q=this._errorHandler;
return b({url:this._url.path+"/submitJob",content:I,callbackParamName:"callback",load:function(V,W){K(V,W,!1,C,f,w.dfd)},error:function(V){Q(V,r,w.dfd)}})},_jobUpdateHandler:function(I,C,f,r,w,u){var E=I.jobId;C=new n(I);this._successHandler([C],"onStatusUpdate",w,f&&u);if(!f)switch(clearTimeout(this._updateTimers[E]),this._updateTimers[E]=null,u&&u.progress(C),I.jobStatus){case n.STATUS_SUBMITTED:case n.STATUS_EXECUTING:case n.STATUS_WAITING:case n.STATUS_NEW:var K=this._getJobStatus;this._updateTimers[E]=
setTimeout(function(){K(E,f,r,w,u)},this.updateDelay);break;default:this._successHandler([C],"onJobComplete",r,u)}},_getJobStatus:function(I,C,f,r,w){var u=this._jobUpdateHandler;b({url:this._url.path+"/jobs/"+I,content:d.mixin({},this._url.query,{f:"json"}),callbackParamName:"callback",load:function(E,K){u(E,K,C,f,r,w)},error:this._errorHandler})},_getResultDataHandler:function(I,C,f,r,w){try{var u=this._decode(I);this._successHandler([u],"onGetResultDataComplete",f,w)}catch(E){this._errorHandler(E,
r,w)}},getResultData:function(I,C,f,r){var w=this._getResultDataHandler,u=this._errorHandler,E=new p(h._dfdCanceller);E._pendingDfd=b({url:this._url.path+"/jobs/"+I+"/results/"+C,content:d.mixin({},this._url.query,{f:"json",returnType:"data"}),callbackParamName:"callback",load:function(K,Q){w(K,Q,f,r,E)},error:function(K){u(K,r,E)}});return E},checkJobStatus:function(I,C,f){var r=this._jobUpdateHandler,w=this._errorHandler,u=new p(h._dfdCanceller);u._pendingDfd=b({url:this._url.path+"/jobs/"+I,content:d.mixin({},
this._url.query,{f:"json"}),callbackParamName:"callback",load:function(E,K){r(E,K,!0,null,C,u)},error:function(E){w(E,f,u)}});return u},cancelJob:function(I,C,f){var r=this._errorHandler,w=new p(h._dfdCanceller);w._pendingDfd=b({url:this._url.path+"/jobs/"+I+"/cancel",content:d.mixin({},this._url.query,{f:"json"}),callbackParamName:"callback",load:d.hitch(this,function(u,E){this._successHandler([u],"onJobCancel",C,w)}),error:function(u){r(u,f,w)}});return w},execute:function(I,C,f,r){var w=this._getOutSR(),
u=r.assembly;I=this._gpEncode(d.mixin({},this._url.query,{f:"json","env:outSR":w?w.wkid||t.toJson(w.toJson()):null,"env:processSR":this.processSpatialReference?this.processSpatialReference.wkid||t.toJson(this.processSpatialReference.toJson()):null},I),null,u&&u[0]);var E=this._executeHandler,K=this._errorHandler;return b({url:this._url.path+"/execute",content:I,callbackParamName:"callback",load:function(Q,V){E(Q,V,C,f,r.dfd)},error:function(Q){K(Q,f,r.dfd)}})},_executeHandler:function(I,C,f,r,w){try{var u=
I.results,E,K=I.messages;var Q=0;for(E=u.length;Q<E;Q++)u[Q]=this._decode(u[Q]);Q=0;for(E=K.length;Q<E;Q++)K[Q]=new m(K[Q]);this._successHandler([u,K],"onExecuteComplete",f,w)}catch(V){this._errorHandler(V,r,w)}},_getResultImageHandler:function(I,C,f,r,w){try{var u=this._decode(I);this._successHandler([u],"onGetResultImageComplete",f,w)}catch(E){this._errorHandler(E,r,w)}},getResultImage:function(I,C,f,r,w){var u=this._getResultImageHandler,E=this._errorHandler;f=this._gpEncode(d.mixin({},this._url.query,
{f:"json"},f.toJson()));var K=new p(h._dfdCanceller);K._pendingDfd=b({url:this._url.path+"/jobs/"+I+"/results/"+C,content:f,callbackParamName:"callback",load:function(Q,V){u(Q,V,r,w,K)},error:function(Q){E(Q,w,K)}});return K},cancelJobStatusUpdates:function(I){clearTimeout(this._updateTimers[I]);this._updateTimers[I]=null},getResultImageLayer:function(I,C,f,r){if(null==C){var w=this._url.path.indexOf("/GPServer/");I=this._url.path.substring(0,w)+"/MapServer/jobs/"+I}else I=this._url.path+"/jobs/"+
I+"/results/"+C;this._url.query&&(I+="?"+c.objectToQuery(this._url.query));C=null==C?new G(I,{imageParameters:f}):new H(I,{imageParameters:f},!0);this.onGetResultImageLayerComplete(C);r&&r(C);return C},onStatusUpdate:function(){},onJobComplete:function(){},onExecuteComplete:function(){},onGetResultDataComplete:function(){},onGetResultImageComplete:function(){},onGetResultImageLayerComplete:function(){},onJobCancel:function(){}});k._createWrappers(L);g("extend-esri")&&d.setObject("tasks.Geoprocessor",
L,a);return L})},"esri/tasks/LinearUnit":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(L,d,q,p){L=L(null,{declaredClass:"esri.tasks.LinearUnit",constructor:function(t){t&&d.mixin(this,t)},distance:0,units:null,toJson:function(){var t={};this.distance&&(t.distance=this.distance);this.units&&(t.units=this.units);return t}});q("extend-esri")&&d.setObject("tasks.LinearUnit",L,p);return L})},"esri/tasks/DataFile":function(){define(["dojo/_base/declare","dojo/_base/lang",
"dojo/has","../kernel"],function(L,d,q,p){L=L(null,{declaredClass:"esri.tasks.DataFile",constructor:function(t){t&&d.mixin(this,t)},url:null,itemID:null,toJson:function(){var t={};this.url&&(t.url=this.url);this.itemID&&(t.itemID=this.itemID);return t}});q("extend-esri")&&d.setObject("tasks.DataFile",L,p);return L})},"esri/tasks/RasterData":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(L,d,q,p){L=L(null,{declaredClass:"esri.tasks.RasterData",constructor:function(t){t&&
d.mixin(this,t)},url:null,format:null,itemID:null,toJson:function(){var t={};this.url&&(t.url=this.url);this.format&&(t.format=this.format);this.itemID&&(t.itemID=this.itemID);return t}});q("extend-esri")&&d.setObject("tasks.RasterData",L,p);return L})},"esri/tasks/Date":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/date/locale","dojo/has","../kernel"],function(L,d,q,p,t){L=L(null,{declaredClass:"esri.tasks.Date",constructor:function(g){g&&(g.format&&(this.format=g.format),this.date=
q.parse(g.date,{selector:"date",datePattern:this.format}))},date:new Date,format:"EEE MMM dd HH:mm:ss zzz yyyy",toJson:function(){return{date:q.format(this.date,{selector:"date",datePattern:this.format}),format:this.format}}});p("extend-esri")&&d.setObject("tasks.Date",L,t);return L})},"esri/tasks/ParameterValue":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(L,d,q,p){L=L(null,{declaredClass:"esri.tasks.ParameterValue",constructor:function(t){d.mixin(this,
t)}});q("extend-esri")&&d.setObject("tasks.ParameterValue",L,p);return L})},"esri/tasks/GPResultImageLayer":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/json dojo/has dojo/io-query ../kernel ../layers/ArcGISDynamicMapServiceLayer".split(" "),function(L,d,q,p,t,g,c){L=L(c,{declaredClass:"esri.tasks._GPResultImageLayer",constructor:function(a,b){b&&b.imageParameters&&b.imageParameters.extent&&(this.initialExtent=this.fullExtent=b.imageParameters.extent,this.spatialReference=this.initialExtent.spatialReference);
this.getImageUrl=d.hitch(this,this.getImageUrl);this.loaded=!0;this.onLoad(this)},getImageUrl:function(a,b,h,k){var l=a.spatialReference.wkid;k(this._url.path+"?"+t.objectToQuery(d.mixin(this._params,{f:"image",bbox:q.toJson(a.toJson()),bboxSR:l,imageSR:l,size:b+","+h})))}});p("extend-esri")&&d.setObject("tasks._GPResultImageLayer",L,g);return L})},"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(L,d,q,p,t,g,c,a,b,h,k,l,e,n,m,v,z,y,D,B,H,G,J,I,C,f,r,w,u,E,K,Q,V,W,Y,ja,ba,fa,ua,xa,va,P,N){L=d([G,J,I,C,f,y],{declaredClass:"esri.dijit.SingleFilter",widgetsInTemplate:!0,templateString:N,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=q.mixin(this.i18n,P.filterDlg)},parseExpressionTemplate:function(){var A=function(na,ha){k.byId(ha).className="attributeValueContainer";"field_dropdown"===na?k.byId(ha).innerHTML=M:"operator_dropdown"===na?k.byId(ha).innerHTML=O:"values_input"===na?k.byId(ha).innerHTML=U+X:console.error("problem with expressionTemplate from localization file")},
M='\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',O='\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',U='\x3cdiv id\x3d"'+this.id+'.attributeValueContainer"\x3e\x3c/div\x3e',X='\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",ia=this.i18n.expressionTemplate,ca=ia.indexOf("${"),S=ia.substring(0,ca).trim();k.byId(this.id+".column1").innerHTML=S.length?"\x3cdiv class\x3d'attributeText'\x3e"+S+"\x3c/div\x3e":"";S=ia.indexOf("}",ca+1);var ea=ia.substring(ca+2,S);A(ea,this.id+".column2");
ca=ia.indexOf("${",ca+1);S=ia.substring(S+1,ca).trim();k.byId(this.id+".column3").innerHTML=S.length?"\x3cdiv class\x3d'attributeText'\x3e"+S+"\x3c/div\x3e":"";S=ia.indexOf("}",ca+1);ea=ia.substring(ca+2,S);A(ea,this.id+".column4");ca=ia.indexOf("${",ca+1);S=ia.substring(S+1,ca).trim();k.byId(this.id+".column5").innerHTML=S.length?"\x3cdiv class\x3d'attributeText'\x3e"+S+"\x3c/div\x3e":"";S=ia.indexOf("}",ca+1);ea=ia.substring(ca+2,S);A(ea,this.id+".column6");S=ia.substring(S+1,ia.length).trim();
k.byId(this.id+".column7").innerHTML=S.length?"\x3cdiv class\x3d'attributeText'\x3e"+S+"\x3c/div\x3e":""},postCreate:function(){this.inherited(arguments);this.parseExpressionTemplate();this.createOperatorStores();this.createFieldsStore(this.fields);this.readCodedValues();H.parse(k.byId(this.id+".exprTable")).then(q.hitch(this,function(A){t.connect(this.getFieldsList(),"onChange",this,"onChangeField");t.connect(this.getOperatorList(),"onChange",this,"onChangeOperator");t.connect(r.byId(this.id+".radioValue"),
"onClick",this,"showValueInput");t.connect(r.byId(this.id+".radioFields"),"onClick",this,"showFields");t.connect(r.byId(this.id+".radioUnique"),"onClick",this,"showUniqueList");this.version&&10.1>this.version&&this.mapLayer.url&&this.showUnique&&l.set(k.byId(this.id+".radioUniqueColumn"),"display","none");t.connect(k.byId(this.id+".deleteExpression"),"onclick",this,"onClickDeleteExpression");t.connect(this.interactiveCheck,"onclick",this,"onInteractiveClick");t.connect(this.interactiveArrow,"onclick",
this,"onClickShowHideInteractive");this.enableInteractiveHandlers();this.isEnableInteractiveFilter||l.set(this._interactiveFilterRow,"display","none");l.set(k.byId(this.id+".radioUniqueColumn"),"display",this.showUnique?"block":"none");this.own(this.watch("showUnique",q.hitch(this,function(M,O,U){l.set(k.byId(this.id+".radioUniqueColumn"),"display",U?"block":"none")})))}))},constructor:function(A,M){this.id=A.id||"";this.owner=A.owner;this.version=A.version;this.part=A.part;this.fields=A.fields;this.mapLayer=
A.mapLayer;!1===A.enableEvents&&(this.onOperatorChangeEnabled=this.onFieldChangeEnabled=!1)},init:function(A){if(!A.part||this.mapLayer&&A.mapLayer&&this.mapLayer.id!==A.mapLayer.id)this.clearAttributeValueDijits(),this.mapLayer=A.mapLayer,this.version=A.version,this.fields=A.fields,this.createOperatorStores(),this.createFieldsStore(this.fields),this.readCodedValues(),this.fillFieldsList(this.fieldsStore),this.onChangeField();A.part&&(this.part=A.part,this.onOperatorChangeEnabled=this.onFieldChangeEnabled=
!1,this.buildEditUIField(this.part,this))},destroy:function(){this.onOperatorChangeEnabled=this.onFieldChangeEnabled=!1;this.clearAttributeValueDijits();p.forEach(r.findWidgets(k.byId(this.id)),function(A){A.destroyRecursive()});this.inherited(arguments)},toJson:function(){var A=null;this.isInteractiveChecked()&&(A={prompt:this.promptText.attr("value"),hint:this.hintText.attr("value")});return{fieldObj:this.getField(),operator:this.getOperator(),valueObj:this.getValue(),interactiveObj:A}},buildFriendlyTextExpr:function(A){var M=
this.i18n.expressionTemplate,O=function(ia,ca,S){return b.substitute(M,{field_dropdown:ia,operator_dropdown:ca,values_input:S})};if(!1===A.valueObj.isValid)return"\x26lt;expression is missing value\x26gt;";var U="";if("string"===A.fieldObj.shortType)A.operator===this.i18n.stringOperatorIsBlank||A.operator===this.i18n.stringOperatorIsNotBlank?U=O(A.fieldObj.label,A.operator,""):"field"===A.valueObj.type?U=O(A.fieldObj.label,A.operator,A.valueObj.label):(U=this.getDecodedValue(A.interactiveObj?A.interactiveObj.value:
A.valueObj.value,A.fieldObj.name),U=O(A.fieldObj.label,A.operator,"'"+U+"'"));else if("number"===A.fieldObj.shortType)if(A.operator===this.i18n.numberOperatorIsBetween||A.operator===this.i18n.numberOperatorIsNotBetween)U=A.interactiveObj?A.interactiveObj.value2:A.valueObj.value2,U=O(A.fieldObj.label,A.operator,h.format(A.interactiveObj?A.interactiveObj.value1:A.valueObj.value1,{pattern:"#####0.##########"})+" "+this.i18n.andBetweenValues+" "+h.format(U,{pattern:"#####0.##########"}));else if(A.operator===
this.i18n.numberOperatorIsBlank||A.operator===this.i18n.numberOperatorIsNotBlank)U=O(A.fieldObj.label,A.operator,"");else if("field"===A.valueObj.type)U=O(A.fieldObj.label,A.operator,A.valueObj.label);else{U=A.interactiveObj?A.interactiveObj.value:A.valueObj.value;var X=this.getDecodedValue(U,A.fieldObj.name);U=O(A.fieldObj.label,A.operator,U!==X?"'"+X+"'":h.format(U,{pattern:"#####0.##########"}))}else Y.isDefined(A.valueObj.value)&&"field"!==A.valueObj.type&&"string"===typeof A.valueObj.value&&
(A.valueObj.value=new Date(A.valueObj.value)),U=A.operator===this.i18n.dateOperatorIsBetween||A.operator===this.i18n.dateOperatorIsNotBetween?O(A.fieldObj.label,A.operator,(A.interactiveObj?this.formatFriendlyDate(A.interactiveObj.value1):this.formatFriendlyDate(A.valueObj.value1))+" "+this.i18n.andBetweenValues+" "+(A.interactiveObj?this.formatFriendlyDate(A.interactiveObj.value2):this.formatFriendlyDate(this.addDay(A.valueObj.value2)))):A.operator===this.i18n.dateOperatorIsBlank||A.operator===this.i18n.dateOperatorIsNotBlank?
O(A.fieldObj.label,A.operator,""):"field"===A.valueObj.type?O(A.fieldObj.label,A.operator,A.valueObj.label):O(A.fieldObj.label,A.operator,A.interactiveObj?this.formatFriendlyDate(A.interactiveObj.value):this.formatFriendlyDate(A.valueObj.value));return U},builtSingleFilterString:function(A,M){if(Y.isDefined(A.valueObj.isValid)&&!A.valueObj.isValid)return{whereClause:null};var O=A.valueObj.value,U=A.valueObj.value1,X=A.valueObj.value2,ia=!1;if(A.interactiveObj){if(!A.interactiveObj.prompt||!A.interactiveObj.hint)return{whereClause:null};
Y.isDefined(M)&&(ia=!0,Y.isDefined(A.valueObj.value)&&(O="{"+M+"}"),Y.isDefined(A.valueObj.value1)&&(U="{"+M+"}"),Y.isDefined(A.valueObj.value2)&&(X="{"+(M+1)+"}"))}var ca="",S=A.fieldObj.name;this.mapLayer&&this.mapLayer.url&&-1!==this.mapLayer.url.indexOf("BigDataCatalogServer")&&this.hasWhiteSpace(S)&&(S='"'+S+'"');if("string"===A.fieldObj.shortType)switch(M="",O&&"field"!==A.valueObj.type&&this.isHostedService(this.mapLayer.url)&&this.containsNonLatinCharacter(O)&&(M="N"),A.operator){case this.i18n.stringOperatorIs:ca=
"field"===A.valueObj.type?S+" \x3d "+O:S+" \x3d "+M+"'"+O.replace(/'/g,"''")+"'";break;case this.i18n.stringOperatorIsNot:ca="field"===A.valueObj.type?S+" \x3c\x3e "+O:S+" \x3c\x3e "+M+"'"+O.replace(/'/g,"''")+"'";break;case this.i18n.stringOperatorStartsWith:ca=S+" LIKE "+M+"'"+O.replace(/'/g,"''")+"%'";break;case this.i18n.stringOperatorEndsWith:ca=S+" LIKE "+M+"'%"+O.replace(/'/g,"''")+"'";break;case this.i18n.stringOperatorContains:ca=S+" LIKE "+M+"'%"+O.replace(/'/g,"''")+"%'";break;case this.i18n.stringOperatorDoesNotContain:ca=
S+" NOT LIKE "+M+"'%"+O.replace(/'/g,"''")+"%'";break;case this.i18n.stringOperatorIsBlank:ca=S+" IS NULL";break;case this.i18n.stringOperatorIsNotBlank:ca=S+" IS NOT NULL"}else if("number"===A.fieldObj.shortType)switch(A.operator){case this.i18n.numberOperatorIs:ca=S+" \x3d "+O;break;case this.i18n.numberOperatorIsNot:ca=S+" \x3c\x3e "+O;break;case this.i18n.numberOperatorIsAtLeast:ca=S+" \x3e\x3d "+O;break;case this.i18n.numberOperatorIsLessThan:ca=S+" \x3c "+O;break;case this.i18n.numberOperatorIsAtMost:ca=
S+" \x3c\x3d "+O;break;case this.i18n.numberOperatorIsGreaterThan:ca=S+" \x3e "+O;break;case this.i18n.numberOperatorIsBetween:ca=S+" BETWEEN "+U+" AND "+X;break;case this.i18n.numberOperatorIsNotBetween:ca=S+" NOT BETWEEN "+U+" AND "+X;break;case this.i18n.numberOperatorIsBlank:ca=S+" IS NULL";break;case this.i18n.numberOperatorIsNotBlank:ca=S+" IS NOT NULL"}else switch(Y.isDefined(O)&&"field"!==A.valueObj.type&&"string"===typeof O&&(O=this.parseFriendlyDate(O)),A.operator){case this.i18n.dateOperatorIsOn:ca=
"field"===A.valueObj.type?S+" \x3d "+O:ia?S+" BETWEEN "+(this.supportsStandardizedQuery?"timestamp ":"")+"'{"+M+"}' AND "+(this.supportsStandardizedQuery?"timestamp ":"")+"'{"+(M+1)+"}'":S+" BETWEEN "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(O)+"' AND "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(this.addDay(O))+"'";break;case this.i18n.dateOperatorIsNotOn:ca="field"===A.valueObj.type?S+" \x3c\x3e "+O:ia?S+" NOT BETWEEN "+(this.supportsStandardizedQuery?
"timestamp ":"")+"'{"+M+"}' AND "+(this.supportsStandardizedQuery?"timestamp ":"")+"'{"+(M+1)+"}'":S+" NOT BETWEEN "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(O)+"' AND "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(this.addDay(O))+"'";break;case this.i18n.dateOperatorIsBefore:ca="field"===A.valueObj.type?S+" \x3c "+O:S+" \x3c "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(O)+"'";break;case this.i18n.dateOperatorIsAfter:ca=
"field"===A.valueObj.type?S+" \x3e "+O:S+" \x3e "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(this.addDay(O))+"'";break;case this.i18n.dateOperatorIsBetween:ca=ia?S+" BETWEEN '"+U+"' AND '"+X+"'":S+" BETWEEN "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(U)+"' AND "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(this.addDay(X))+"'";break;case this.i18n.dateOperatorIsNotBetween:ca=ia?S+" NOT BETWEEN '"+U+"' AND '"+X+"'":S+" NOT BETWEEN "+
(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(U)+"' AND "+(this.supportsStandardizedQuery?"timestamp ":"")+"'"+this.formatDate(this.addDay(X))+"'";break;case this.i18n.dateOperatorIsBlank:ca=S+" IS NULL";break;case this.i18n.dateOperatorIsNotBlank:ca=S+" IS NOT NULL"}return{whereClause:ca}},showDeleteIcon:function(){l.set(k.byId(this.id+".deleteExpression"),"display","block")},hideDeleteIcon:function(){l.set(k.byId(this.id+".deleteExpression"),"display","none")},createFieldsStore:function(A){if(A&&
A.length){A=q.clone(A);A=A.sort(function(O,U){O.label=O.alias||O.name;U.label=U.alias||U.name;return O.label<U.label?-1:O.label>U.label?1:0});var M=this.isHostedService(this.mapLayer.url);this.supportsStandardizedQuery=10.2<=this.mapLayer.version&&(this.mapLayer.useStandardizedQueries||this.isBigDataLayer(this.mapLayer));A=p.filter(A,function(O,U){return"esriFieldTypeString"===O.type||"esriFieldTypeDouble"===O.type||"esriFieldTypeSingle"===O.type||"esriFieldTypeInteger"===O.type||"esriFieldTypeSmallInteger"===
O.type||"esriFieldTypeDate"===O.type&&(this.allowAllDateTypes||M||this.supportsStandardizedQuery)?!0:!1},this);A=p.map(A,function(O,U){switch(O.type){case "esriFieldTypeString":var X="string";this.fieldsInfo.stringFieldsCount++;break;case "esriFieldTypeDate":X="date";this.fieldsInfo.dateFieldsCount++;break;default:X="number",this.fieldsInfo.numberFieldsCount++}return{id:U,label:O.label,shortType:X,alias:O.alias,editable:O.editable,name:O.name,nullable:O.nullable,type:O.type}},this);A.length&&(this.fieldsStore=
new D({data:{identifier:"id",label:"label",items:A}}))}},createOperatorStores:function(){var A=[];A.push({name:this.i18n.stringOperatorIs,name_:this.i18n.stringOperatorIs,id:0});A.push({name:this.i18n.stringOperatorIsNot,name_:this.i18n.stringOperatorIsNot,id:1});A.push({name:this.i18n.stringOperatorStartsWith,name_:this.i18n.stringOperatorStartsWith,id:2});A.push({name:this.i18n.stringOperatorEndsWith,name_:this.i18n.stringOperatorEndsWith,id:3});A.push({name:this.i18n.stringOperatorContains,name_:this.i18n.stringOperatorContains,
id:4});A.push({name:this.i18n.stringOperatorDoesNotContain,name_:this.i18n.stringOperatorDoesNotContain,id:5});A.push({name:this.i18n.stringOperatorIsBlank,name_:this.i18n.stringOperatorIsBlank,id:6});A.push({name:this.i18n.stringOperatorIsNotBlank,name_:this.i18n.stringOperatorIsNotBlank,id:7});this.stringOperatorStore=new D({data:{label:"name",identifier:"id",items:A}});A=[];A.push({name:this.i18n.dateOperatorIsOn,id:0});A.push({name:this.i18n.dateOperatorIsNotOn,id:1});A.push({name:this.i18n.dateOperatorIsBefore,
id:2});A.push({name:this.i18n.dateOperatorIsAfter,id:3});A.push({name:this.i18n.dateOperatorIsBetween,id:6});A.push({name:this.i18n.dateOperatorIsNotBetween,id:7});A.push({name:this.i18n.dateOperatorIsBlank,id:8});A.push({name:this.i18n.dateOperatorIsNotBlank,id:9});this.dateOperatorStore=new D({data:{label:"name",identifier:"id",items:A}});A=[];A.push({name:this.i18n.numberOperatorIs,name_:this.i18n.numberOperatorIs,id:0});A.push({name:this.i18n.numberOperatorIsNot,name_:this.i18n.numberOperatorIsNot,
id:1});A.push({name:this.i18n.numberOperatorIsAtLeast,name_:this.i18n.numberOperatorIsAtLeast,id:2});A.push({name:this.i18n.numberOperatorIsLessThan,name_:this.i18n.numberOperatorIsLessThan,id:3});A.push({name:this.i18n.numberOperatorIsAtMost,name_:this.i18n.numberOperatorIsAtMost,id:4});A.push({name:this.i18n.numberOperatorIsGreaterThan,name_:this.i18n.numberOperatorIsGreaterThan,id:5});A.push({name:this.i18n.numberOperatorIsBetween,name_:this.i18n.numberOperatorIsBetween,id:6});A.push({name:this.i18n.numberOperatorIsNotBetween,
name_:this.i18n.numberOperatorIsNotBetween,id:7});A.push({name:this.i18n.numberOperatorIsBlank,name_:this.i18n.numberOperatorIsBlank,id:8});A.push({name:this.i18n.numberOperatorIsNotBlank,name_:this.i18n.numberOperatorIsNotBlank,id:9});this.numberOperatorStore=new D({data:{label:"name",identifier:"id",items:A}})},readCodedValues:function(){p.forEach(this.mapLayer.fields,function(A){A.domain&&A.domain.codedValues&&(this.fieldDomains[A.name]=A.domain.codedValues)},this)},getDecodedValue:function(A,
M){M=this.getCodedValues(M);var O;if(M)for(O=0;O<M.length;O+=1){var U=M[O];if(U.code===A)return U.name}return A},getCodedValues:function(A){return this.fieldDomains[A]},getFieldsList:function(){return r.byId(this.id+".fieldsList")},getOperatorList:function(){return r.byId(this.id+".operatorList")},getValueFieldsList:function(){return r.byId(this.id+".valueFields")},getAttrValContNode:function(){return k.byId(this.id+".attributeValueContainer")},getField:function(){var A=this.getFieldsList();return{name:A.store.getValue(A.item,
"name"),label:A.store.getValue(A.item,"label"),shortType:A.store.getValue(A.item,"shortType"),type:A.store.getValue(A.item,"type")}},getOperator:function(){var A=this.getOperatorList();return A.item?A.store.getValue(A.item,"name"):""},getValue:function(){return{}},isInteractiveChecked:function(){return this.interactiveCheck.checked},setInteractiveSection:function(A,M,O){this.disableInteractiveHandlers();this.interactiveCheck.checked=A;this.promptText.attr("value",M);this.hintText.attr("value",O);
l.set(this.interactiveSpace,"display","block");this.interactiveArrow.innerHTML="\x26nbsp;\x26#9650;";this.enableInteractiveHandlers()},enableInteractiveHandlers:function(){this.onPromptChangeHandler=t.connect(this.promptText,"onChange",this,"onChangeInteractive");this.onHintchangeHandler=t.connect(this.hintText,"onChange",this,"onChangeInteractive")},disableInteractiveHandlers:function(){t.disconnect(this.onPromptChangeHandler);t.disconnect(this.onHintChangeHandler)},fillFieldsList:function(A){var M=
this.getFieldsList();M.set("labelAttr","label");M.set("searchAttr","label");M.set("store",A);M.set("value",0)},fillOperatorList:function(A,M,O){var U=this.getOperatorList();U.set("labelAttr","name");U.set("searchAttr","name");U.set("query",O?O:{});U.set("store",A);if(M){var X=!1;for(O=0;20>O&&(A.fetchItemByIdentity({identity:O,onItem:q.hitch(this,function(ia){ia&&ia.name[0]===M&&(U.set("value",ia.id[0]),X=!0)})}),!X);O++);}else U.set("value",0)},createValueString:function(A){var M=this.getAttrValContNode();
this.clearAttributeValueDijits();n.empty(M);if(A){M=new u({id:this.id+".value","class":"attributeValue",maxHeight:150,sortByLabel:!0},n.create("div",{},M));var O=this.buildCodedValuesStore(A);M.set("store",O);M.set("value",0);this.valueHandlers.push(t.connect(M,"onChange",this,"onValueChange"))}else M=new w({id:this.id+".value","class":"attributeValue",required:!0,placeHolder:"",intermediateChanges:!0},n.create("div",{},M)),this.valueHandlers.push(t.connect(M,"onChange",this,"onValueChange"));this.checkDefaultOption();
this.getValue=function(){var U=r.byId(this.id+".value"),X=!0;A?U.item?U=U.item.code[0]:(U="",X=!1):X=U=U.get("value");return{value:U,isValid:X}}},createValueDate:function(){var A=this.getAttrValContNode();this.clearAttributeValueDijits();n.empty(A);A=new K({id:this.id+".value","class":"attributeValue",trim:!0,required:!0,placeHolder:"",constraints:{formatLength:"short"}},n.create("div",{},A));this.checkDefaultOption();this.valueHandlers.push(t.connect(A,"onChange",this,"onValueChange"));this.getValue=
function(){var M=r.byId(this.id+".value").get("value");return{value:M,isValid:Y.isDefined(M)}}},createValueNumber:function(A){var M=this.getAttrValContNode();this.clearAttributeValueDijits();n.empty(M);if(A){M=new u({id:this.id+".value","class":"attributeValue",maxHeight:150,sortByLabel:!0},n.create("div",{},M));var O=this.buildCodedValuesStore(A);M.set("store",O);M.set("value",0);this.valueHandlers.push(t.connect(M,"onChange",this,"onValueChange"))}else M=new Q({id:this.id+".value","class":"attributeValue",
required:!0,placeHolder:"",intermediateChanges:!0,constraints:{pattern:"#####0.##########"}},n.create("div",{},M)),this.valueHandlers.push(t.connect(M,"onChange",this,"onValueChange"));this.checkDefaultOption();this.getValue=function(){var U=r.byId(this.id+".value"),X=!0;A?U.item?U=U.item.code[0]:(U="",X=!1):(U=U.get("value"),X=Y.isDefined(U)&&!isNaN(U));return{value:U,isValid:X}}},createValueBetweenDate:function(){var A=this.getAttrValContNode();this.clearAttributeValueDijits();n.empty(A);var M=
new K({id:this.id+".value1","class":"attributeValue1",trim:!0,required:!0,placeHolder:"",constraints:{formatLength:"short"}},n.create("div",{},A));n.create("span",{innerHTML:this.i18n.andBetweenValues,"class":"attributeBetweenValues"},A);A=new K({id:this.id+".value2","class":"attributeValue2",trim:!0,required:!0,placeHolder:"",constraints:{formatLength:"short"}},n.create("div",{},A));this.checkDefaultOption();this.valueHandlers.push(t.connect(M,"onChange",this,"onValueChange"));this.valueHandlers.push(t.connect(A,
"onChange",this,"onValueChange"));this.getValue=function(){var O=r.byId(this.id+".value1").get("value"),U=r.byId(this.id+".value2").get("value");return{value1:O,value2:U,isValid:Y.isDefined(O)&&Y.isDefined(U)}}},createValueBetweenNumber:function(){var A=this.getAttrValContNode();this.clearAttributeValueDijits();n.empty(A);var M=new Q({id:this.id+".value1","class":"attributeValue1",required:!0,placeHolder:"",intermediateChanges:!0,constraints:{pattern:"#####0.##########"}},n.create("div",{},A));n.create("span",
{innerHTML:this.i18n.andBetweenValues,"class":"attributeBetweenValues"},A);A=new Q({id:this.id+".value2","class":"attributeValue2",required:!0,placeHolder:"",intermediateChanges:!0,constraints:{pattern:"#####0.##########"}},n.create("div",{},A));this.checkDefaultOption();this.valueHandlers.push(t.connect(M,"onChange",this,"onValueChange"));this.valueHandlers.push(t.connect(A,"onChange",this,"onValueChange"));this.getValue=function(){var O=r.byId(this.id+".value1").get("value"),U=r.byId(this.id+".value2").get("value");
return{value1:O,value2:U,isValid:Y.isDefined(O)&&Y.isDefined(U)&&!isNaN(O)&&!isNaN(U)&&O<=U}}},createValueInTheLastDate:function(){},createValueIsBlank:function(){var A=this.getAttrValContNode();this.clearAttributeValueDijits();n.empty(A);A.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(A,M,O){var U=this.getAttrValContNode();
this.clearAttributeValueDijits();n.empty(U);var X=new u({id:this.id+".valueFields","class":"attributeValue",maxHeight:150,labelAttr:"label",searchAttr:"label",store:A,query:M},n.create("div",{},U));if(O){var ia=!1;for(U=0;100>U&&(A.fetchItemByIdentity({identity:U,onItem:q.hitch(this,function(ca){ca&&ca.shortType[0]===M.shortType&&ca.name[0]!==O&&(X.set("value",ca.id),ia=!0)})}),!ia);U++);}this.valueHandlers.push(t.connect(X,"onChange",this,"onValueChange"));this.getValue=function(){var ca=r.byId(this.id+
".valueFields");return{value:ca.store.getValue(ca.item,"name"),label:ca.store.getValue(ca.item,"label"),type:"field",isValid:!0}}},createValueUnique:function(A){var M=this.getAttrValContNode();this.clearAttributeValueDijits();n.empty(M);A=new u({id:this.id+".valueUnique","class":"attributeValue",maxHeight:150,store:A},n.create("div",{},M));A.set("value",0);this.valueHandlers.push(t.connect(A,"onChange",this,"onValueChange"));this.getValue=function(){var O=r.byId(this.id+".valueUnique");return{value:O.store.getValue(O.item,
"value"),isValid:!0}}},setValue:function(A,M){if(M)for(var O=0;O<M.length;O++){if(A===M[O].code){r.byId(this.id+".value").set("value",O);break}}else"date"===this.part.fieldObj.shortType?r.byId(this.id+".value").set("value",new Date(A)):("number"===this.part.fieldObj.shortType&&(A=Number(A)),r.byId(this.id+".value").set("value",A))},setValue1:function(A){"date"===this.part.fieldObj.shortType?A=new Date(A):"number"===this.part.fieldObj.shortType&&(A=Number(A));r.byId(this.id+".value1").set("value",
A)},setValue2:function(A){"date"===this.part.fieldObj.shortType?A=new Date(A):"number"===this.part.fieldObj.shortType&&(A=Number(A));r.byId(this.id+".value2").set("value",A)},setValueFieldById:function(A){this.getValueFieldsList().set("value",A)},enableOnFieldChange:function(){this.onFieldChangeEnabled=!0},enableOnOperatorChange:function(){this.onOperatorChangeEnabled=!0},onChangeField:function(A){this.onFieldChangeEnabled&&this._onChangeField(this.getFieldsList(),this)},onChangeOperator:function(A){this.onOperatorChangeEnabled&&
this._onChangeOperator(this.getOperatorList(),this)},onClickDeleteExpression:function(A){this._deleteExpression(this)},_onChangeField:function(A,M,O){var U=!!this.mapLayer&&this.isPortalHostedService(this.mapLayer.url);this.isBigDataLayer(this.mapLayer)||U&&"esriFieldTypeDate"===this.fieldsStore.getValue(A.item,"type")?l.set(k.byId(this.id+".radioUniqueColumn"),"display","none"):l.set(k.byId(this.id+".radioUniqueColumn"),"display","");U=M.getOperatorList();switch(this.fieldsStore.getValue(A.item,
"type")){case "esriFieldTypeString":var X=null;A=this.fieldsStore.getValue(A.item,"name");this.getCodedValues(A)&&(X=this.i18n.stringOperatorStartsWith,X+="|"+this.i18n.stringOperatorEndsWith,X+="|"+this.i18n.stringOperatorContains,X+="|"+this.i18n.stringOperatorDoesNotContain,X={name_:new RegExp("^(?!("+X+")$)")});U.attr("value")===this.i18n.stringOperatorIs?(M.fillOperatorList(this.stringOperatorStore,this.i18n.stringOperatorIs,X),this.onChangeOperator(U,M,O)):M.fillOperatorList(this.stringOperatorStore,
this.i18n.stringOperatorIs,X);M.createValueString(this.getCodedValues(A));break;case "esriFieldTypeDate":M.fillOperatorList(this.dateOperatorStore,this.i18n.dateOperatorIsOn);M.createValueDate();break;default:X=null,A=this.fieldsStore.getValue(A.item,"name"),this.getCodedValues(A)&&(X=this.i18n.numberOperatorIsBetween,X+="|"+this.i18n.numberOperatorIsNotBetween,X+="|"+this.i18n.numberOperatorIsAtLeast,X+="|"+this.i18n.numberOperatorIsLessThan,X+="|"+this.i18n.numberOperatorIsAtMost,X+="|"+this.i18n.numberOperatorIsGreaterThan,
X={name_:new RegExp("^(?!("+X+")$)")}),U.attr("value")===this.i18n.numberOperatorIs?(M.fillOperatorList(this.numberOperatorStore,this.i18n.numberOperatorIs,X),this.onChangeOperator(U,M,O)):M.fillOperatorList(this.numberOperatorStore,this.i18n.numberOperatorIs,X),M.createValueNumber(this.getCodedValues(A))}"date"===this.fieldsStore.getValue(M.getFieldsList().item,"shortType")?M.disableInteractiveCheck():M.enableInteractiveCheck();t.publish("filter-expression-change",this)},_onChangeOperator:function(A,
M,O){A=A.item?A.item.name[0]:A.value;O=this.fieldsStore.getValue(M.getFieldsList().item,"shortType");var U=this.fieldsStore.getValue(M.getFieldsList().item,"name");M.enableOptions();if("date"!==O&&"number"!==O||A!==this.i18n.dateOperatorIsBetween&&A!==this.i18n.numberOperatorIsBetween&&A!==this.i18n.dateOperatorIsNotBetween&&A!==this.i18n.numberOperatorIsNotBetween)if("date"!==O||A!==this.i18n.dateOperatorInTheLast&&A!==this.i18n.dateOperatorNotInTheLast)if(A===this.i18n.stringOperatorIsBlank||A===
this.i18n.dateOperatorIsBlank||A===this.i18n.numberOperatorIsBlank||A===this.i18n.stringOperatorIsNotBlank||A===this.i18n.dateOperatorIsNotBlank||A===this.i18n.numberOperatorIsNotBlank)M.createValueIsBlank(),M.disableOptions();else switch(O){case "string":M.createValueString(this.getCodedValues(U));break;case "date":M.createValueDate();break;default:M.createValueNumber(this.getCodedValues(U))}else M.disableOptions(),M.createValueInTheLastDate();else M.disableOptions(),"date"===O?M.createValueBetweenDate():
M.createValueBetweenNumber();t.publish("filter-expression-change",this)},onInteractiveClick:function(A){this.isInteractiveChecked()?(l.set(this.interactiveSpace,"display","block"),this.interactiveArrow.innerHTML="\x26nbsp;\x26#9650;"):(l.set(this.interactiveSpace,"display","none"),this.interactiveArrow.innerHTML="\x26nbsp;\x26#9660;");t.publish("filter-expression-change",this)},onClickShowHideInteractive:function(A){this.interactiveCheck.disabled||("none"===l.set(this.interactiveSpace,"display")?
(l.set(this.interactiveSpace,"display","block"),this.interactiveArrow.innerHTML="\x26nbsp;\x26#9650;"):(l.set(this.interactiveSpace,"display","none"),this.interactiveArrow.innerHTML="\x26nbsp;\x26#9660;"))},onChangeInteractive:function(){t.publish("filter-expression-change",this)},showValueInput:function(A){this._showValueInput(r.byNode(A.target),this)},showFields:function(A){this._showFields(r.byNode(A.target),this)},showUniqueList:function(A){this._showUniqueList(r.byNode(A.target),this)},onValueChange:function(){this.onValueChangeHandler&&
clearTimeout(this.onValueChangeHandler);this.onValueChangeHandler=setTimeout(q.hitch(this,function(){this.onValueChangeHandler=null;t.publish("filter-expression-change",this)}),800)},_showValueInput:function(A,M,O){M.onChangeOperator(A,M,O);M.enableInteractiveCheck()},_showFields:function(A,M,O){O=M.getFieldsList().item;A=this.fieldsStore.getValue(O,"shortType");O=this.fieldsStore.getValue(O,"name");M.createValueFields(this.fieldsStore,{shortType:A,name:new RegExp("^(?!"+O+"$)")},O);M.disableInteractiveCheck()},
_showUniqueList:function(A,M,O){this.uniqueValuesStore&&delete this.uniqueValuesStore;O=this.fieldsStore.getValue(M.getFieldsList().item,"name");if(10.1<=this.version||!this.mapLayer.url){var U=null;this.mapLayer.queryServiceUrl?U=this.mapLayer.queryServiceUrl:this.mapLayer.itemLayers&&p.forEach(this.mapLayer.itemLayers,function(X){X.id===this.layerInfo.id&&X.layerUrl&&(U=X.layerUrl)},this);U||(U=this.mapLayer.url);if(this.uniqueValuesResults[this.mapLayer.id+"_"+O])this.onGenerateRendererResults(M,
A,this.uniqueValuesResults[this.mapLayer.id+"_"+O]);else this.generateRendererUniqueValues(O,U,q.hitch(this,"onGenerateRendererResults",M,A),q.hitch(this,function(){this.showValueInput(A,M)}))}else A&&this.showValueInput(A,M)},onGenerateRendererResults:function(A,M,O){var U=this.fieldsStore.getValue(A.getFieldsList().item,"name"),X=this.fieldsStore.getValue(A.getFieldsList().item,"shortType"),ia=this.fieldsStore.getValue(A.getFieldsList().item,"type");this.uniqueValuesResults[this.mapLayer.id+"_"+
U]=O;var ca=null;p.forEach(this.mapLayer.fields,function(S){S.name===U&&S.domain&&(ca=S.domain)});O=p.filter(O,function(S,ea){return"string"===X?"\x3cNull\x3e"!==S&&""!==S.trim():"\x3cNull\x3e"!==S&&""!==S});O.length?("date"===X?(O=p.map(O,function(S){return new Date(S)}),O=O.sort(function(S,ea){S=S.getTime();ea=ea.getTime();return S<ea?-1:S>ea?1:0}),O=p.map(O,function(S){return this.formatFriendlyDate(S)},this)):"number"===X?(O=p.map(O,function(S){return"esriFieldTypeDouble"===ia||"esriFieldTypeSingle"===
ia?parseFloat(S):parseInt(S,10)}),O=O.sort(function(S,ea){return S<ea?-1:S>ea?1:0})):O=O.sort(function(S,ea){return S<ea?-1:S>ea?1:0}),M=p.map(O,function(S,ea){var na=S;"string"===X&&(na=""===S?"\x3c"+this.i18n.emptyString+"\x3e":S);if(ca&&ca.codedValues){for(var ha=0;ha<ca.codedValues.length;ha++){var ma=ca.codedValues[ha];if(S===ma.code)return{id:ea,name:ma.name||na,value:S}}return{id:ea,name:""+na,value:S}}if("esriFieldTypeDouble"===ia||"esriFieldTypeSingle"===ia)na=h.format(S,{pattern:"#####0.##########"});
return{id:ea,name:""+na,value:S}},this),this.uniqueValuesStore=new D({data:{label:"name",identifier:"id",items:M}}),A.createValueUnique(this.uniqueValuesStore)):this.showValueInput(M,A)},generateRendererUniqueValues:function(A,M,O,U){A instanceof Array&&(A=A.toString());var X=new ba;X.attributeField=A;A=new fa;A.classificationDefinition=X;this.mapLayer instanceof xa?M=new ja(this.mapLayer):this.mapLayer instanceof ua&&!this.mapLayer.url?M=new ja(this.mapLayer):this.hasDynamicLayers(this.mapLayer)?
(X=this.mapLayer.layerDefinitions&&this.mapLayer.layerDefinitions[this.mapLayer.id]?this.mapLayer.layerDefinitions[this.mapLayer.id]:null,A.where=X?X:null,M=new ja(this.mapLayer.url+"/dynamicLayer",{source:this.layerInfo.source})):(X=this.mapLayer.getDefinitionExpression(),A.where=X?X:null,M=new ja(M));V.defaults.io.timeout=1E4;M.execute(A,function(ia){V.defaults.io.timeout=6E4;ia=p.map(ia.infos,function(ca){return ca.value});O(ia)},q.hitch(this,function(ia){V.defaults.io.timeout=6E4;U()}))},hasDynamicLayers:function(A){return A&&
A.supportsDynamicLayers?!0:!1},formatDate:function(A){return B.format(A,{datePattern:"yyyy-MM-dd",selector:"date"})+" "+B.format(A,{selector:"time",timePattern:"HH:mm:ss"})},formatFriendlyDate:function(A){return B.format(A,{formatLength:"short",selector:"date"})},parseFriendlyDate:function(A){return B.parse(A,{formatLength:"short",selector:"date"})},parseDate:function(A){var M=B.parse(A,{datePattern:"yyyy-MM-dd",timePattern:"HH:mm:ss"});M||(M=B.parse(A.replace(" ",", "),{datePattern:"yyyy-MM-dd",
timePattern:"HH:mm:ss"}))||(M=B.parse(A.replace(" "," - "),{datePattern:"yyyy-MM-dd",timePattern:"HH:mm:ss"}));return M},addDay:function(A){return new Date(A.getTime()+this.dayInMS)},subtractDay:function(A){return new Date(A.getTime()-this.dayInMS)},containsNonLatinCharacter:function(A){for(var M=0;M<A.length;M++)if(255<A.charCodeAt(M))return!0;return!1},hasWhiteSpace:function(A){return/\s/g.test(A)},buildCodedValuesStore:function(A){A=p.map(A,function(M,O){return{name:M.name,code:M.code,id:O}});
return new D({data:{label:"name",identifier:"id",items:A}})},clearAttributeValueDijits:function(){this.valueHandlers&&0!==this.valueHandlers.length&&(p.forEach(this.valueHandlers,q.hitch(this,function(A){t.disconnect(A);A=null})),this.valueHandlers=[],r.byId(this.id+".value")?r.byId(this.id+".value").destroy():k.byId(this.id+".value")&&this.getAttrValContNode().removeChild(k.byId(this.id+".value")),r.byId(this.id+".value1")?r.byId(this.id+".value1").destroy():k.byId(this.id+".value1")&&this.getAttrValContNode().removeChild(k.byId(this.id+
".value1")),r.byId(this.id+".value2")?r.byId(this.id+".value2").destroy():k.byId(this.id+".value2")&&this.getAttrValContNode().removeChild(k.byId(this.id+".value2")),r.byId(this.id+".valueFields")&&r.byId(this.id+".valueFields").destroy(),r.byId(this.id+".valueUnique")&&r.byId(this.id+".valueUnique").destroy())},checkDefaultOption:function(){m(".attributeValueOptions .attributeValueRadio",this.domNode).forEach(function(A){r.byNode(A).set("checked",-1<A.className.indexOf("radioValue"))})},disableOptions:function(){m(".attributeValueOptions .attributeValueRadio",
this.domNode).forEach(function(A){r.byNode(A).set("disabled",!0)})},enableOptions:function(){m(".attributeValueOptions .attributeValueRadio",this.domNode).forEach(function(A){r.byNode(A).set("disabled",!1)})},checkFieldOption:function(){r.byId(this.id+".radioFields").set("checked",!0)},disableFieldOption:function(){r.byId(this.id+".radioFields").set("disabled",!0)},disableUniqueOption:function(){r.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(A){return!!A.url&&-1!==A.url.indexOf("BigDataCatalogServer")&&("featureClass"===A.type||"table"===A.type)},isPortalHostedService:function(A){return A?-1!==A.toLowerCase().indexOf("/hosted/"):!1},isHostedService:function(A){if(!A)return!1;var M=-1!==A.indexOf(".arcgis.com/");A=-1!==A.indexOf("//services")||-1!==A.indexOf("//tiles")||-1!==A.indexOf("//features");return M&&
A},buildEditUIField:function(A,M,O){this.getFieldItemByName({name:A.fieldObj.name},q.hitch(this,function(U){M.getFieldsList().set("value",U.id[0],!1);this.buildEditUIOperator(A,M,O)}),q.hitch(this,function(){M.getFieldsList().set("value",0);this.buildEditUIOperator(A,M,O)}))},buildEditUIOperator:function(A,M,O){switch(A.fieldObj.shortType){case "string":M.fillOperatorList(this.stringOperatorStore,A.operator);break;case "date":M.fillOperatorList(this.dateOperatorStore,A.operator);break;default:M.fillOperatorList(this.numberOperatorStore,
A.operator)}setTimeout(q.hitch(this,function(){this.getOperatorItemByName(M.getOperatorList().store,{name:A.operator},q.hitch(this,function(U){M.getOperatorList().set("value",U.id[0],!1);this.buildEditUIValue(A,M,O)}),q.hitch(this,function(){M.getOperatorList().set("value",0);this.buildEditUIValue(A,M,O)}))}),100)},buildEditUIValue:function(A,M,O){this.onOperatorChangeEnabled=this.onFieldChangeEnabled=!0;var U=A.operator;this.onChangeOperator(M.getOperatorList(),M);M.enableOptions();setTimeout(q.hitch(this,
function(){U===this.i18n.stringOperatorIsBlank||U===this.i18n.dateOperatorIsBlank||U===this.i18n.numberOperatorIsBlank||U===this.i18n.stringOperatorIsNotBlank||U===this.i18n.dateOperatorIsNotBlank||U===this.i18n.numberOperatorIsNotBlank?(M.createValueIsBlank(),M.disableOptions()):"field"===A.valueObj.type?(M.createValueFields(this.fieldsStore,{shortType:A.fieldObj.shortType,name:new RegExp("^(?!"+A.fieldObj.name+"$)")}),M.checkFieldOption(),this.getFieldItemByName({name:A.valueObj.value},q.hitch(this,
function(X){M.setValueFieldById(X.id[0])}),q.hitch(this,function(){M.setValueFieldById(0)}))):Y.isDefined(A.valueObj.value1)?(M.setValue1(A.valueObj.value1),M.setValue2(A.valueObj.value2)):M.setValue(A.valueObj.value,this.getCodedValues(A.fieldObj.name))}),100)},getFieldItemByName:function(A,M,O){this.fieldsStore.fetch({query:A,onComplete:q.hitch(this,function(U){U&&U.length?M(U[0]):O()})})},getOperatorItemByName:function(A,M,O,U){A.fetch({query:M,onComplete:q.hitch(this,function(X){X&&X.length?O(X[0]):
U()})})}});c("extend-esri")&&q.setObject("dijit.SingleFilter",L,W);return L})},"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(L,d,q,p,t,g,c,a,b,h,k,l,e,n,m,v,z){d=d(m,{declaredClass:"esri.tasks.GenerateRendererTask",_eventMap:{complete:["renderer"]},constructor:function(y,D){!q.isObject(y)||"esri.layers.FeatureLayer"!==y.declaredClass&&"esri.layers.CSVLayer"!==y.declaredClass?(this.url=y,this._url.path+="/generateRenderer"):y.url&&q.isString(y.url)&&"esri.layers.CSVLayer"!==y.declaredClass?(this.url=y.url,this._url=l.urlToObject(this.url),this._url.path+="/generateRenderer"):this._features=y.graphics;this._handler=
q.hitch(this,this._handler);this.source=D&&D.source;this.gdbVersion=D&&D.gdbVersion;this.checkValueRange=D&&D.checkValueRange;this.registerConnectEvents()},_handler:function(y,D,B,H,G){try{if("esri.renderer.ClassBreaksRenderer"===y.declaredClass||"esri.renderer.UniqueValueRenderer"===y.declaredClass)var J=y;else J=e.fromJson(y),"classBreaks"===y.type&&J.setMaxInclusive(!0);if(this.checkValueRange){var I=new v(this.url),C=new z,f=new n;f.statisticType="min";f.onStatisticField=this._field;var r=new n;
r.statisticType="max";r.onStatisticField=this._field;C.outStatistics=[f,r];I.execute(C).then(q.hitch(this,function(w){w=w.features[0].attributes;for(var u in w)if(0===u.toLowerCase().indexOf("min"))var E=w[u];else var K=w[u];J=this._processRenderer(J,this._prefix,this._unitLabel,this._formatLabel,this._precision,E,K);this._successHandler([J],"onComplete",B,G)}))}else J=this._processRenderer(J,this._prefix,this._unitLabel,this._formatLabel,this._precision),this._successHandler([J],"onComplete",B,G)}catch(w){this._errorHandler(w,
H,G)}},_processRenderer:function(y,D,B,H,G,J,I){"esri.renderer.ClassBreaksRenderer"===y.declaredClass?p.forEach(y.infos,function(C,f){0===f&&void 0!==J&&null!==J&&(C.minValue=J);f===y.infos.length-1&&void 0!==I&&null!==I&&(C.classMaxValue=C.maxValue=I);G&&(C.classMaxValue=C.maxValue=Math.round(C.maxValue/G)*G,C.minValue=Math.round(C.minValue/G)*G);H&&(C.label=t.format(C.minValue)+" - "+t.format(C.maxValue));D&&(C.label=D+" "+C.label);B&&(C.label=C.label+" "+B)}):p.forEach(y.infos,function(C,f){0===
f&&void 0!==J&&null!==J&&(C.value=J);f===y.infos.length-1&&void 0!==I&&null!==I&&(C.value=I);H&&(C.label=t.format(C.value));D&&(C.label=D+" "+C.label);B&&(C.label=C.label+" "+B)});return y},execute:function(y,D,B){var H=this._handler,G=this._errorHandler;this._precision=y.precision;this._prefix=y.prefix;this._unitLabel=y.unitLabel;this._formatLabel=y.formatLabel;if(this._features=y.features||this._features){var J=new c;var I=this._features;L(["./generateRenderer"],function(r){var w;"esri.tasks.ClassBreaksDefinition"===
y.classificationDefinition.declaredClass?w=r.createClassBreaksRenderer({features:I,definition:y.classificationDefinition}):"esri.tasks.UniqueValueDefinition"===y.classificationDefinition.declaredClass&&(w=r.createUniqueValueRenderer({features:I,definition:y.classificationDefinition}));w?H(w,null,D,B,J):G(null,B,J)})}else{var C=q.mixin(y.toJson(),{f:"json"});this._field="esri.tasks.ClassBreaksDefinition"===y.classificationDefinition.declaredClass?y.classificationDefinition.classificationField:y.classificationDefinition.attributeField;
if(this.source){var f={source:this.source.toJson()};C.layer=g.toJson(f)}this.gdbVersion&&(C.gdbVersion=this.gdbVersion);J=new c(k._dfdCanceller);J._pendingDfd=h({url:this._url.path,content:C,callbackParamName:"callback",load:function(r,w){H(r,w,D,B,J)},error:function(r){G(r,B,J)}})}return J},onComplete:function(){}});a("extend-esri")&&q.setObject("tasks.GenerateRendererTask",d,b);return d})},"esri/tasks/UniqueValueDefinition":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel",
"./ClassificationDefinition"],function(L,d,q,p,t){L=L(t,{declaredClass:"esri.tasks.UniqueValueDefinition",type:"uniqueValueDef",attributeField:null,attributeField2:null,attributeField3:null,fieldDelimiter:null,toJson:function(){var g=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);d.mixin(g,
{type:this.type,uniqueValueFields:this.uniqueValueFields});this.fieldDelimiter&&d.mixin(g,{fieldDelimiter:this.fieldDelimiter});return g}});q("extend-esri")&&d.setObject("tasks.UniqueValueDefinition",L,p);return L})},"esri/tasks/ClassificationDefinition":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(L,d,q,p){L=L(null,{declaredClass:"esri.tasks.ClassificationDefinition",type:null,baseSymbol:null,colorRamp:null,toJson:function(){var t={};this.baseSymbol&&
d.mixin(t,{baseSymbol:this.baseSymbol.toJson()});this.colorRamp&&!d.isString(this.colorRamp)&&d.mixin(t,{colorRamp:this.colorRamp.toJson()});return t}});q("extend-esri")&&d.setObject("tasks.ClassificationDefinition",L,p);return L})},"esri/tasks/GenerateRendererParameters":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/json","dojo/has","../kernel"],function(L,d,q,p,t){L=L(null,{declaredClass:"esri.tasks.GenerateRendererParameters",classificationDefinition:null,where:null,precision:null,
prefix:null,unitLabel:null,formatLabel:null,toJson:function(){return{classificationDef:q.toJson(this.classificationDefinition.toJson()),where:this.where}}});p("extend-esri")&&d.setObject("tasks.GenerateRendererParameters",L,t);return L})},"esri/layers/GeoRSSLayer":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/json dojo/has ../kernel ../config ../request ../urlUtils ./ServiceGeneratedFeatureCollection".split(" "),function(L,d,q,p,t,g,c,a,b){L=L([b],{declaredClass:"esri.layers.GeoRSSLayer",
serviceUrl:a.getProtocolForWebResource()+"//utility.arcgis.com/sharing/rss",constructor:function(h,k){this._url=a.urlToObject(this.url=h);g.defaults.geoRSSService&&(this.serviceUrl=g.defaults.geoRSSService);this._createLayer()},parse:function(){return this._io=c({url:this.serviceUrl,content:{url:this.url,refresh:this.loaded?!0:void 0,outSR:this._outSR?q.toJson(this._outSR.toJson()):void 0},callbackParamName:"callback"})},_initLayer:function(h){this.inherited(arguments);this.loaded||(this.loaded=!0,
this.onLoad(this))}});p("extend-esri")&&d.setObject("layers.GeoRSSLayer",L,t);return L})},"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(L,d,q,p,t,g,c,a,b,h,k,l,e,n,m){L=L([e],{declaredClass:"esri.layers._ServiceGeneratedFeatureCollection",
constructor:function(v,z){this.pointSymbol=z&&z.pointSymbol;this.polylineSymbol=z&&z.polylineSymbol;this.polygonSymbol=z&&z.polygonSymbol;this._outSR=z&&(z.outSpatialReference||z.outSR)||new b({wkid:4326});this._options=q.mixin({},z)},parse:function(){console.error("parse function has not been implemented")},getFeatureLayers:function(){var v=[];this._fLayers&&(v=v.concat(this._fLayers));return v},onRefresh:function(){},onOpacityChange:function(){},refresh:function(){this.loaded&&this._map&&!this._io&&
this.visible&&this._createLayer()},_createLayer:function(v){var z=this;this._fireUpdateStart();v=this.parse(v);v.addCallback(function(y){z._io=null;z._initLayer(y)});v.addErrback(function(y){z._io=null;y=q.mixin(Error(),y);y.message="Unable to load resource: "+z.url+" "+(y.message||"");z._fireUpdateEnd(y);z.onError(y)})},_initLayer:function(v){this.loaded&&this._removeInternalLayers();this.name=v.name;this.description=v.description;this.snippet=v.snippet;this.featureInfos=v.featureInfos;this.fullExtent=
this.initialExtent=new h(v.lookAtExtent);this.copyright=v.author||v.copyright;var z;(v=q.getObject("featureCollection.layers",!1,v))&&0<v.length&&(this._fLayers=[],p.forEach(v,function(y,D){var B=q.getObject("featureSet.features",!1,y);B&&0<B.length&&(z=q.mixin({outFields:["*"],infoTemplate:y.popupInfo?new m(y.popupInfo):null,editable:!1},this._options),z.id&&(z.id=z.id+"_"+D),z.webgl=!1,y.layerDefinition.capabilities="Query,Data",y=new n(y,z),y.geometryType&&(this["_"+y.geometryType]=y),this._fLayers.push(y))},
this),0===this._fLayers.length&&delete this._fLayers);this.items=[];this._esriGeometryPoint&&(this.items=this.items.concat(this._esriGeometryPoint.graphics),this.pointSymbol&&(v=new l(this.pointSymbol),this._esriGeometryPoint.setRenderer(v)));this._esriGeometryPolyline&&(this.items=this.items.concat(this._esriGeometryPolyline.graphics),this.polylineSymbol&&(v=new l(this.polylineSymbol),this._esriGeometryPolyline.setRenderer(v)));this._esriGeometryPolygon&&(this.items=this.items.concat(this._esriGeometryPolygon.graphics),
this.polygonSymbol&&(v=new l(this.polygonSymbol),this._esriGeometryPolygon.setRenderer(v)));this._fireUpdateEnd();this.loaded&&(this._addInternalLayers(),this.onRefresh())},_addInternalLayers:function(){var v=this._map;this._fireUpdateStart();var z=v.spatialReference,y=this._outSR;if(z.wkid)var D=z._isWebMercator()&&y._isWebMercator()||z.wkid===y.wkid;else if(z.wkt)D=z.wkt===y.wkt;else{console.log("_setMap - map has invalid spatial reference");return}if(!D)if(z._isWebMercator()&&4326===y.wkid)this._converter=
k.geographicToWebMercator;else if(y._isWebMercator()&&4326===z.wkid)this._converter=k.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}(z=this._fLayers)&&0<z.length&&p.forEach(z,function(B){if(this._converter){var H=B.graphics,G,J,I=H?H.length:0;for(G=0;G<I;G++)(J=H[G].geometry)&&H[G].setGeometry(this._converter(J))}v.addLayer(B)},this);this.setVisibility(this.visible);
this._fireUpdateEnd()},_removeInternalLayers:function(){var v=this._map;v&&p.forEach(this.getFeatureLayers(),v.removeLayer,v)},setScaleRange:function(v,z){this.inherited(arguments);p.forEach(this.getFeatureLayers(),function(y){y.setScaleRange(v,z)});this._options.minScale=this.minScale;this._options.maxScale=this.maxScale},setOpacity:function(v){this.opacity!=v&&(p.forEach(this.getFeatureLayers(),function(z){z.setOpacity(v)}),this.opacity=this._options.opacity=v,this.onOpacityChange(v))},onVisibilityChange:function(v){this._fireUpdateStart();
p.forEach(this.getFeatureLayers(),function(z){z.setVisibility(v)});this._fireUpdateEnd()},_setMap:function(v,z){this.inherited(arguments);this._map=v;var y=this._div=t.create("div",null,z);g.set(y,"position","absolute");this._addInternalLayers();this.evaluateSuspension();return y},_unsetMap:function(v,z){this._io&&this._io.cancel();d.disconnect(this._extChgHandle);delete this._extChgHandle;this._removeInternalLayers();var y=this._div;y&&(z.removeChild(y),t.destroy(y));this._div=null;this.inherited(arguments)}});
c("extend-esri")&&q.setObject("layers._ServiceGeneratedFeatureCollection",L,a);return L})},"esri/dijit/analysis/ItemTypes":function(){define(["dojo/_base/lang","dojo/has","../../kernel"],function(L,d,q){var p={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"};d("extend-esri")&&L.setObject("dijit.analysis.itemTypes",p,q);return p})},"esri/dijit/analysis/FeatureRecordSetLayer":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../../tasks/DataFile","../../kernel"],function(L,d,q,p,t){L=L(p,{declaredClass:"esri.dijit.analysis.FeatureRecordSetLayer",constructor:function(g){g&&d.mixin(this,
g)},toJson:function(){var g={};this.url&&(g.url=this.url);this.filter&&(g.filter=this.filter);this.serviceToken&&(g.serviceToken=this.serviceToken);this.featureSet&&(g.featureSet=this.featureSet);this.layerDefinition&&(g.layerDefinition=this.layerDefinition);this.time&&(g.time=this.time);return g}});q("extend-esri")&&d.setObject("dijit.analysis.FeatureRecordSetLayer",L,t);return L})},"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(L,d,q,p,t,g,c,a,b,h,k,l,e,n,m,v,z,y,D,B,H,G,J){var I=L([n],{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:[G.GeometryTypes.Point,G.GeometryTypes.Point.MultiPoint,G.GeometryTypes.Line,G.GeometryTypes.Polygon],layerTypes:[v.FLAYER,v.BDATAFEATURE,v.BTABLE,v.TABLE],timeTypes:[G.TimeTypes.Instant,G.TimeTypes.Interval],checkGeometryType:!0,checkLayerType:!1,checkTimeFilter:!1,fetchType:['type:"'+v.MS+'"','type:"'+v.FS+'"'],constructor:function(C){d.mixin(this,C);this.filters={all:{},mycontent:{owners:this.self?[this.self.user.username]:[]},esriBoundaryLayers:{owners:["esri_boundaries"]}};this.i18n=
d.mixin({},J.browseLayersDlg);d.mixin(this.i18n,J.browseItems);d.mixin(this.i18n,J.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(C){var f=new t,r,w={f:"json"};C.url?(-1!==window.location.protocol.indexOf("https:")&&(C.url=C.url.replace("http:","https:")),z({url:C.url,content:w}).then(function(u){f.resolve(u)},d.hitch(this,function(u){r=u.details&&u.details.length?u.details.shift():"";u&&403===u.httpCode&&-1<r.indexOf("SSL Required")?(C.set("url",C.url.replace("http:","https:")),this._fetchServiceInfo(C).then(function(E){f.resolve(E)})):
(C.isLoaded=!0,f.resolve({error:u}))}))):f.resolve(null);return f},_addLayerToMap:function(C){return C.type===v.BIGDATA||C.type===v.CSV||C.type===v.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(C){if(C&&-1!==
q.indexOf([v.FS,v.MS,v.IS,v.BIGDATA,v.CSV,v.XLS],C.type)){if(C.type===v.CSV||C.type===v.XLS)C.url=C.itemUrl;this.plugIn._fetchServiceInfo(C).then(d.hitch(this,function(f){var r=[],w={f:"json"};f.layers&&(r=[].concat(r).concat(f.layers));f.tables&&0<f.tables.length&&(r=[].concat(r).concat(f.tables));f.children&&(r=f.children);!C||C.type!==v.CSV&&C.type!==v.XLS&&C.type!==v.IS||(r=[C]);if(!r.length)var u=this.plugIn.i18n.noDataMessages.noItemInfo;this.plugIn._createLayerGrid(p.create("div",null,c.byId(C.id+
"_details")),u);q.forEach(r,function(E,K){C.type===v.BIGDATA?(E.url=C.url+"/"+E.name,E.url=encodeURI(E.url)):E.url=C.type===v.CSV?C.itemUrl:C.type===v.IS?C.url:C.url+"/"+K;-1!==window.location.protocol.indexOf("https:")&&(E.url=E.url.replace("http:","https:"));z({url:E.url,content:w}).then(d.hitch(this,function(Q){E=d.mixin(E,Q);this.plugIn._store.put(E);this.plugIn._grid.refresh()}),d.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(C,f,r){f=C.name;var w='\x3ctr\x3e\x3ctd\x3e\x3cinput type\x3d"checkbox" class\x3d"js-layer-check" name\x3d"layers" value\x3d"'+f+' checked"\x3e\x3c/td\x3e\x3ctd\x3e',u="\x3c/td\x3e\x3ctd\x3e"+C.geometryType+"\x3c/td\x3e\x3c/tr\x3e";return C.itemUrl||C.url?w+'\x3ca class\x3d"'+(r||"")+'"\x3e'+f+"\x3c/a\x3e"+u:w+f+u},
_createLayerGrid:function(C,f){var r=L([B,H]);this._store=e(new l({idProperty:"name"}));this._atleastALayerAvailable=!1;this._grid=new r({store:this._store,query:d.hitch(this,function(w){var u=!0,E=!0,K=!0,Q=!0;this.checkGeometryType&&w.type!==v.IS&&(K=-1!==q.indexOf(this.geometryTypes,w.geometryType));this.checkTimeFilter&&(u=-1!==q.indexOf(this.timeTypes,this.getTimeType(w)));this.checkLayerType&&(E=-1!==q.indexOf(this.layerTypes,w.type));"function"===typeof this.customCheckHandler&&(Q=this.customCheckHandler(w));
w=w&&K&&u&&E&&Q;w||(this._grid.noDataMessage=this.getNoDataMessage({geomCheck:K,timeCheck:u,typeCheck:E,customCheck:Q}));!this._atleastALayerAvailable&&w&&(this._atleastALayerAvailable=w);k(".js-add-layer-checkbox",this.parent.infoPanel).forEach(function(V){a.set(V,"disabled",!this._atleastALayerAvailable)},this);return w}),selectionMode:"single","class":"esriAnalysisLayersGrid quiet-scroll",noDataMessage:f||this.i18n.noValidLayerMsg,allowSelect:d.hitch(this,function(w){var u;this.checkLayerType&&
w.data&&(u=-1!==q.indexOf(this.layerTypes,w.data.type));u=w.data.geometryType?-1!==q.indexOf(this.geometryTypes,w.data.geometryType)||this.checkLayerType&&u:!0;return w&&w.data&&u}),renderRow:d.hitch(this,this._renderer)},C);this._grid.startup();this._grid.on("dgrid-select,dgrid-deselect",d.hitch(this,function(w){w=w.grid.selection;var u=[];for(E in w)w[E]&&u.push(this._grid.row(E).data);var E={selection:u};k(".panel-actions .btn-main",this.parent.infoPanel).forEach(function(K){b.toggle(K,"disabled",
0===u.length)},this);u[0]&&(this._selectedLayer=u[0]);this.emit("layer-change",E)}))},hasTimeInfo:function(C){return C&&C.timeInfo},getTimeType:function(C){return C?D.isDefined(C.timeInfo)&&D.isDefined(C.timeInfo.startTimeField)&&!D.isDefined(C.timeInfo.endTimeField)?G.TimeTypes.Instant:D.isDefined(C.timeInfo)&&D.isDefined(C.timeInfo.startTimeField)&&D.isDefined(C.timeInfo.endTimeField)?G.TimeTypes.Interval:D.isDefined(C.time)&&D.isDefined(C.time.timeType)?C.time.timeType:!1:!1},getNoDataMessage:function(C){if(C.geomCheck)if(C.timeCheck){if(!C.typeCheck)return this.i18n.noDataMessages.typeCheckFailure;
if(!C.customCheck)return this.customCheckFailureMessage}else return this.i18n.noDataMessages.timeCheckFailure;else return this.i18n.noDataMessages.geomCheckFailure},getDateFields:function(C){return q.filter(C&&C.fields||[],function(f){return f&&"esriFieldTypeDate"===f.type})},_renderer:function(C){C.snippet=C.snippet||"";var f=p.create("div"),r=this._getLabel(C);p.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'+
C.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"'+r.icon+'"\x3e\x3c/span\x3e'+r.name+"\x3c/a\x3e"+(C.timeInfo||C.time&&"instant"===C.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",f);return f},_getLabel:function(C){var f={icon:"",name:""},r=C.geometryType;r===G.GeometryTypes.Point||r===G.GeometryTypes.MultiPoint?(f.name=this.i18n.points,f.icon="esri-icon-map-pin"):r===G.GeometryTypes.Polygon?(f.name=this.i18n.areas,f.icon="esri-icon-polygon"):r===G.GeometryTypes.Line?(f.name=this.i18n.lines,f.icon="esri-icon-polyline"):C.type===v.IS?(f.name=this.i18n.imageService,f.icon="esri-icon-layers"):(f.name=this.i18n.table,f.icon="esri-icon-table");return f}});
d.mixin(I,{add:function(C,f){C.plugIn||(f=f||{},f.parent=C,f.self=C.self,C.plugIn=new I(f))},remove:function(C){C.plugIn&&(C.plugIn.destroy(),delete C.plugIn)}});m("extend-esri")&&d.setObject("dijit.analysis.PluginLayers",I,y);return I})},"esri/dijit/analysis/AnalysisRegistry":function(){define(["dojo/_base/lang","dojo/has","../../kernel"],function(L,d,q){var p={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"}};d("extend-esri")&&L.setObject("dijit.analysis.AnalysisRegistry",p,q);return p})},"esri/dijit/analysis/PCSList":function(){define(["dojo/_base/lang","dojo/has","../../kernel"],function(L,d,q){var p=[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];d("extend-esri")&&L.setObject("dijit.analysis.PCSList",p,q);return p})},"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(L,d,q,p,t,g,c,a,b,h,k,l,e,n,m,v,z,y,D,B,H,G,J,I,C,f,r,w,u,E,K,Q,V,W,Y,ja,ba,fa,ua,xa){var va=n.defaults.map.zoomDuration;L=L([xa],{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(P,N){N=N||{};this.tileMode=null!=N.tileMode?N.tileMode:this.tileMode;this.useWebGL=null!=
N.useWebGL?N.useWebGL:this.useWebGL;this.roaming=null!=N.roaming?N.roaming:this.roaming;this.drawMode=null!=N.drawMode?N.drawMode:this.drawMode;this.bandIds=N.bandIds&&0<N.bandIds.length?N.bandIds:null;this.renderer=N.renderer;this._customModules=N.customModules;this.useMapTime=N.useMapTime;if(N.multidimensionalDefinition&&0<N.multidimensionalDefinition.length){var A=new E;A.multidimensionalDefinition=N.multidimensionalDefinition.map(function(M){return M.toJson?M:new K(M)});A.method=E.METHOD_NONE;
this.mosaicRule=A}this.infoTemplate=N.infoTemplate;this.drawMode||(this._contextType=N._contextType||N.drawType);this._supportLegacyPropMethods=!1!==N.legacySupport;this._rasterHandler=new ua({customModules:this._customModules});this._workInitPromise=this._rasterHandler.start();this.pixelData=null;this._initialize(P,N);b(this,"load",d.hitch(this,function(){k(this._rasterHandler._connected||this._rasterHandler._connectionPromise,d.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=d.hitch(this,this._animatePan2d)},setOpacity:function(P){this.opacity!==
P&&(this.opacity=P,this.onOpacityChange(P))},onOpacityChange:function(){},onRendererChange:function(){},refresh:function(){if(this.loaded&&this._map)if(!this._canDraw()||10>g("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(P,N,A,M){this._canDraw()&&(this.useWebGL||(A?this._context.clearRect(P,N,A,M):this._context.clearRect(0,0,this._map.width,this._map.height)))},getContext:function(){return this._context},
onResume:function(){this.inherited(arguments);this._toggleTime();v.show(this._div);if("css-transforms"===this._map.navigationMode){var P=this._map.__visibleDelta;this._left=this._tdx=P.x;this._top=this._tdy=P.y;a.set(this._div,e._css.names.transform,e._css.translate(this._left,this._top))}this._displayTimer=this._displayTimer||setTimeout(d.hitch(this,function(){this._extentChangeHandler(this._map.extent,null,!0)}),0)},onSuspend:function(){this.inherited(arguments);this._fireUpdateEnd();this._toggleTime();
v.hide(this._div);clearTimeout(this._displayTimer);this._displayTimer=null},redraw:function(){this.useWebGL&&this._glSetting&&(this._glSetting.hasNewTexture=!1);var P=this.tileMode?this.tileManager.originalPixelData:this.originalPixelData;if(this.tileMode?P&&(P.src||P.texture):P)if(this.tileMode)if(this.useWebGL)this._updateAllTilesOnce(P);else{this.tileManager.tiles.forEach(function(A){A&&(A.update=null,A.completed=!1,A.processedPixelBlock=null,A.renderedPixelBlock=null)});P.processedPixelBlock=
null;var N=this.raster.rasterFunction?this.raster.rasterFunction.read(P):{extent:P.extent,pixelBlock:P.src[this.tileManager.identifiers[0]]&&P.src[this.tileManager.identifiers[0]].pixelBlock};P.renderedPixelBlock=null;P=this._rasterRenderer?this._rasterRenderer.draw(N):N;this._drawOneFrame(P)}else this._supportLegacyPropMethods&&this.pixelFilter?this._setPixelData(this.originalPixelData):(P.processedPixelBlock=null,N=this.raster.rasterFunction?this.raster.rasterFunction.read(P):{extent:P.extent,pixelBlock:P.src?
P.src[this.tileManager.identifiers[0]]&&P.src[this.tileManager.identifiers[0]].pixelBlock:P.pixelBlock},P.renderedPixelBlock=null,P=this._rasterRenderer?this._rasterRenderer.draw(N):N,this._drawOneFrame(P))},getCurrentResolution:function(){var P=this._map.extent;return new r((P.xmax-P.xmin)/this._map.width,(P.ymax-P.ymin)/this._map.height,P.spatialReference)},getCustomRasterFields:function(P){var N=P?P.rasterAttributeTableFieldPrefix:this._rasterFieldPrefix,A={name:this._rasterFieldPrefix+"ServicePixelValue",
alias:"Pixel Value",domain:null,editable:!1,length:50,type:10.3<=this.version?"esriFieldTypeDouble":"esriFieldTypeString"};P=this.fields?d.clone(this.fields):[];P.push(A);(A=this.rasterAttributeTable&&this.rasterAttributeTable.fields)&&0<A.length&&(A=p.filter(A,function(M){return"esriFieldTypeOID"!==M.type&&"value"!==M.name.toLowerCase()}),A=p.map(A,function(M){var O=d.clone(M);O.name=N+M.name;return O}),P=P.concat(A));return P},setRenderer:function(P,N){if(this.loaded&&P){if(P.declaredClass&&-1<
P.declaredClass.indexOf("esri.layers.rasterLib")){this._rasterRenderer=P;this._rasterRenderer.bind({layer:this});var A=this.bandIds=P.bandIndex;this.raster&&this.raster.setFetchParameters({bandIds:A});this._params&&(this._params.bandIds=A&&0<A.length?A.join(","):null);this.renderer=this._getCommonRenderer(P)}else A=d.clone(P.toJson?P.toJson():P),"rasterStretch"===A.type&&(A.bandIndex=this.bandIds,A.bandIndex&&1<A.bandIndex.length||!A.bandIndex&&this.raster&&1<this.raster.rasterInfo.bandCount)&&(A.type=
"rgb"),this._rasterRenderer=ja.create(A),this.renderer=P.declaredClass?P:this._getCommonRenderer(this._rasterRenderer),this._rasterRenderer.bind({layer:this});if(this._map){if(this.loaded&&this._rasterHandler._connected){var M=this._rasterHandler.setRasterRenderer({layerId:this.id,data:this._rasterRenderer.toJson(!0)});this._updateTilingEffects()}N||(M?M.then(d.hitch(this,function(){this.redraw()})):this.redraw());this.onRendererChange()}}},setBandIds:function(P,N){this.bandIds=P;this.raster&&this.raster.setFetchParameters({bandIds:P});
this._params&&(this._params.bandIds=P&&0<P.length?P.join(","):null);this.setRenderer(this.renderer,N)},_setTime:function(P){P=P?P.toJson():null;this._params&&(this._params.time=P);this.raster.setFetchParameters({time:P});this.tileManager&&this.tileManager.tiles&&this.tileManager.resetTiles()},setInfoTemplate:function(P){this.infoTemplate=P;this._updateInfoTemplateFields(this.fields)},setMultiDimensionalDefinition:function(P,N){var A=P&&P.multidimensionalDefinition;if(A&&this.loaded){var M=A&&A[0].variableName;
""===M&&(M=this._multidimensionalInfo.variables[0].name,A.forEach(function(U){U.variableName=M}));if("ImageService"===this.raster.sourceType){var O=this.raster._getAllDimensionDefinition(A,M);O.defChanged&&(P.multidimensionalDefinition=O.definition,this.setMosaicRule(P,!0))}this.raster.setFetchParameters({multidimensionalDefinition:A});this.tileManager&&this.tileManager.tiles&&this.tileManager.resetTiles();M&&this._updateRasterInfo(M);N||this.refresh()}},_updateRasterInfo:function(P){var N=this.raster.rasterInfo,
A=this.getHistograms(P);P=this.getStatistics(P);(new l([A,P])).then(d.hitch(this,function(M){M[0][0]&&(N.histograms=M[0][1].histograms);M[1][0]&&(N.statistics=M[1][1]);this.refresh()}))},_updateInfoTemplateFields:function(P){if(P&&!(1>P.length)&&this.infoTemplate&&this.infoTemplate.info&&this.infoTemplate.info.fieldInfos&&!(1>this.infoTemplate.info.fieldInfos.length)){var N,A;var M=this.infoTemplate.info.fieldInfos;for(N=0;N<P.length;N++){var O=P[N];for(A=0;A<M.length;A++)if(M[A].fieldName.toLowerCase()===
O.name.toLowerCase()&&M[A].fieldName!==O.name){M[A].fieldName=O.name;break}}}},getPixelData:function(P){return this.tileMode?P?this.tileManager.originalPixelData.src&&this.tileManager.originalPixelData.src[this.tileManager.identifiers[0]]:null:this.inherited(arguments)},fetchPopupFromTiles:function(P){var N=new t;this.identify(P.geometry).then(function(A){var M=A.pixelValue;this.hasStdTime()&&M&&M.length&&null!=M[0]&&(M=M.map(function(X){return this.getStdTimeValue(X)}.bind(this)).join(", "));if(M){A=
{ObjectId:0,"Raster.ServicePixelValue":M};var O=this.rasterAttributeTable&&this.rasterAttributeTable.features;if(O&&0<O.length&&(O=p.filter(O,function(X){if(X&&X.attributes)return X.attributes.hasOwnProperty("Value")?X.attributes.Value==M:X.attributes.VALUE==M}),0<O.length&&(O=d.clone(O[0]))))for(var U in O.attributes)O.attributes.hasOwnProperty(U)&&(A[this._rasterFieldPrefix+U]=O.attributes[U]);U=new y(new C(this.projectedFullExtent||this.fullExtent),null,A);U.setInfoTemplate(this.infoTemplate);
U._layer=this;this._lastPopup=[U];N.resolve([U])}else this._lastPopup=[],N.resolve()}.bind(this),function(A){this._lastPopup=[];N.resolve(A)});return N},getPopupFromTiles:function(){return this._lastPopup},identify:function(P,N){return this.raster?this.raster.identify(P):(P=new t,P.reject("layer must be initialized to identify"),P.promise)},_getCommonRenderer:function(P){switch(P.rendererName){case "RGB":case "Stretch":return new H(P.toCommonRendererJson());case "UniqueValue":return new G(P.toCommonRendererJson());
case "ClassBreaks":return new B(P.toCommonRendererJson());case "Colormap":return new J(P.toCommonRendererJson());case "ShadedRelief":return new I(P.toCommonRendererJson())}},_getProjectedFullExtent:function(P){return this.raster.getProjectedFullExtent(P).then(d.hitch(this,function(N){this.projectedFullExtent=N}))},_initialize:function(P,N){N=N||{};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 A=N.raster?N.raster.url:P;A&&-1<A.toLowerCase().indexOf("/imageserver")&&this._supportLegacyPropMethods&&this._addLegacySupport(A,N);var M=d.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 O=this._loadCallback;O&&(delete this._loadCallback,O(this))});(P?W.create(d.mixin({url:P},N)):N.raster&&N.raster.open()).then(d.hitch(this,function(O){if(O){this.raster=O;var U=this._getSourceImageServiceRaster();this.url||(this.url=U&&U.url);this.url&&(this._url=z.urlToObject(P));var X=N.minScale,ia=N.maxScale,ca=O.tileInfo&&"Raster"===O.tileInfo.tileType;null==ia&&(ia=ca&&N.zoomFactor?O.tileInfo.lods[O.tileInfo.lods.length-1].scale/N.zoomFactor:this.maxScale);null==X&&(X=ca&&
N.zoomFactor?O.tileInfo.lods[0].scale*N.zoomFactor:this.minScale);U&&"ImageService"===U.sourceType&&this._supportLegacyPropMethods&&this._addGeneralProperties(P,N);this.initialExtent=this.fullExtent=this.extent=this.raster.rasterInfo.extent;this.spatialReference=this.extent.spatialReference;this.timeInfo=this.raster.rasterInfo.timeInfo?new u(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==X||this._hasMin||this.setMinScale(X);null==ia||this._hasMax||this.setMaxScale(ia);this._workInitPromise?this._workInitPromise.then(M,M):M()}else console.error("cannot create rasterx layer as the raster data source cannot be opened")}),this._errorHandler)},_getSourceImageServiceRaster:function(){var P=this.raster&&"Function"===this.raster.sourceType?1===this.raster.getMemberRasters().length?this.raster.getMemberRasters()[0]:null:this.raster;if(P&&"ImageService"===
P.sourceType)return P},_addLegacySupport:function(P,N){this._url=z.urlToObject(P);N=N||{};this.format=(P=N.imageServiceParameters)&&P.format;this.compressionTolerance=P&&P.compressionTolerance?P.compressionTolerance:.01;this.interpolation=P?P.interpolation:null;this.compressionQuality=P?P.compressionQuality:null;this.bandIds=P&&P.bandIds||N&&N.bandIds||null;this.mosaicRule||(this.mosaicRule=P?P.mosaicRule:null);this.renderingRule||(this.renderingRule=P?P.renderingRule:null);this.useMapDimensionValue=
N.hasOwnProperty("useMapDimensionValue")?!!N.useMapDimensionValue:!0;this.hasImageFilter=N.hasImageFilter;this.activeMapDimensions=N.activeMapDimensions;this._params=d.mixin({},this._url.query,{f:"image",interpolation:this.interpolation,format:this.format,compressionQuality:this.compressionQuality,bandIds:this.bandIds?this.bandIds.join(","):null},P?P.toJson():{});this.pixelFilter=N.pixelFilter;this.originalPixelData=this.pixelData=null;this._queryVisibleRastersHandler=d.hitch(this,this._queryVisibleRastersHandler);
this._useRenderingRuleAttributeTable=!1;this._rasterFunctionTemplateInfos={};this._customRenderingRuleId={};this._setDefaultFilter=function(){};var A={setInterpolation:"interpolation",setCompressionQuality:"compressionQuality",setCompressionTolerance:"compressionTolerance",setBandIds:"bandIds",setDefaultBandIds:"bandIds",setMosaicRule:"mosaicRule",setRenderingRule:"renderingRule",setImageFormat:"format"},M,O=new V;Object.keys(A).forEach(d.hitch(this,function(U){this[U]=d.hitch(this,function(X,ia){M=
{};M[A[U]]=X;this.raster&&(this.raster.setFetchParameters(M),O[U].bind(this)(X,ia))})}));this.setDisableClientCaching=function(U){O.setDisableClientCaching.bind(this)(U);var X=this._getSourceImageServiceRaster();X?X.disableClientCaching=U:null}.bind(this);this.setDefinitionExpression=O.setDefinitionExpression.bind(this);this.setUseMapTime=O.setUseMapTime.bind(this);this._toggleTime=O._toggleTime.bind(this);this._onTimeExtentChangeHandler=O._onTimeExtentChangeHandler.bind(this);this.setPixelFilter=
O.setPixelFilter.bind(this);this.getHistograms=O.getHistograms.bind(this);this.getRasterFunctionInfos=O.getRasterFunctionInfos.bind(this);this.getKeyProperties=O.getKeyProperties.bind(this);this.getRasterAttributeTable=O.getRasterAttributeTable.bind(this);this.getRenderingRuleServiceInfo=O.getRenderingRuleServiceInfo.bind(this);this._getRenderingRuleId=O._getRenderingRuleId.bind(this);this._isRenderingRuleAProcessingTemplate=O._isRenderingRuleAProcessingTemplate.bind(this);this.handleSpatialReferenceChange=
O.handleSpatialReferenceChange.bind(this);this.onRenderingChange=this.onRenderingChange||function(){};this.onSpatialReferenceChange=this.onSpatialReferenceChange||function(){};this.onMosaicRuleChange=this.onMosaicRuleChange||function(U){};this.setRasterRenderer=this.setRenderer;this.getMultidimensionalInfo=O.getMultidimensionalInfo.bind(this);this.getColormap=O.getColormap.bind(this);this.getRenderingRuleColormap=O.getRenderingRuleColormap.bind(this);this.getDefaultMultidimensionalDefinition=O.getDefaultMultidimensionalDefinition.bind(this);
this._getDefaultMultidimensionalDefinition=O._getDefaultMultidimensionalDefinition.bind(this);this._getDefaultDimensionValue=O._getDefaultDimensionValue.bind(this);this.getStatistics=O.getStatistics.bind(this)},_addGeneralProperties:function(){var P=this._getSourceImageServiceRaster();if(P){var N=["minScale","maxScale","tileInfo"];Object.keys(P.serviceInfo).forEach(function(O){null==this[O]&&-1===N.indexOf(O)&&(this[O]=P.serviceInfo[O])}.bind(this));this.pixelSizeX=parseFloat(this.pixelSizeX);this.pixelSizeY=
parseFloat(this.pixelSizeY);this.bands=P.rasterInfo.statistics;var A,M=[];this.fields=this.fields||[];for(A=0;A<this.fields.length;A++)M.push(new w(this.fields[A]));this.fields=M;this.version=this.currentVersion;this.defaultMosaicRule=P.serviceInfo.defaultMosaicRule}},setDefaultRenderer:function(){if(this.loaded&&this._canvas&&!this.pixelFilter){var P=ja.createDefaultRenderer(this);if(null!=P){var N=this.mosaicRule&&this.mosaicRule.multidimensionalDefinition&&0<this.mosaicRule.multidimensionalDefinition.length;
if(this._multidimensionalInfo&&N&&"Stretch"===P.rendererName){var A=this.mosaicRule.multidimensionalDefinition[0].variableName;(N=this._multidimensionalInfo.variables.filter(function(M){return M.name===A})[0])&&N.histograms&&N.histograms.length&&(P.histograms=N.histograms,6===P.stretchType&&(P.dra=!1));N&&N.statistics&&N.statistics.length&&(P.statistics=N.statistics.map(function(M){return[M.min,M.max,M.mean,M.stddev||M.standardDeviation]}),6!==P.stretchType&&(P.dra=!1))}this.setRenderer(P,!0)}}},
setDefaultInterpolation:function(){if(this.loaded&&this._canvas){var P=this.raster.serviceInfo&&this.raster.serviceInfo.defaultResamplingMethod;if(P)switch(P.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{P=this.raster.dataType&&this.raster.dataType.toLowerCase();var N=!!this.raster.rasterInfo.colormap;
this.raster.rasterInfo.vat||N||"thematic"===P||"StdTime"===P?"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(P,N){this.inherited(arguments);P.spatialReference&&
(P.spatialReference.ics||P.spatialReference.icsId)&&(this.roaming=this.useWebGL=this.tileMode=!1);if(this.tileMode){this.virtualTileInfo=new ba(null,{refTileInfo:P.tileInfo,spatialReference:P.spatialReference,extent:this.raster.rasterInfo.extent});var A=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=A.cols+","+A.rows;this.tileManager=new fa({tileInfo:A,layer:this,mapSR:P.spatialReference})}this._dragOrigin={x:0,y:0};A=this._div=c.create("div",null,N);var M={width:P.width+"px",height:P.height+"px",position:"absolute"};"css-transforms"===P.navigationMode?this.roaming&&this.tileMode&&this.useWebGL||(M[e._css.names.transform]=e._css.translate(P.__visibleDelta.x,P.__visibleDelta.y),this._left=P.__visibleDelta.x,this._top=P.__visibleDelta.y):this._left=this._top=0;a.set(A,M);
this._canvas=c.create("canvas",{width:P.width+"px",height:P.height+"px",style:"position: absolute;"},A);m.isDefined(this.opacity)&&a.set(A,"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&&(P.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=P.width;this._mapHeight=P.height;this._connects=[];this._connects.push(q.connect(P,"onPan",this,this._panHandler));this._connects.push(q.connect(P,"onPanEnd",this,this._panEndHandler));"css-transforms"===P.navigationMode?this._connects.push(q.connect(P,"onScale",this,this._onScaleHandler)):(this._connects.push(q.connect(P,"onZoom",this,this._onZoomHandler)),this._connects.push(q.connect(P,"onZoomEnd",this,
this._onZoomEndHandler)));this._connects.push(q.connect(P,"onResize",this,this._onResizeHandler));this._connects.push(q.connect(P,"onExtentChange",this,this._extentChangeHandler));this._connects.push(q.connect(this,"onVisibilityChange",this,this._visibilityChangeHandler));this._connects.push(q.connect(this,"onOpacityChange",this,this._opacityChangeHandler));this._startRect={left:0,top:0,width:P.width,height:P.height};this.evaluateSuspension();if(this.suspended&&!P.loaded)var O=q.connect(P,"onLoad",
this,function(){q.disconnect(O);O=null;this.evaluateSuspension()});return A},_unsetMap:function(P,N){this.useWebGL&&P.releaseWebGLContext(this);p.forEach(this._connects,q.disconnect,this);var A=this._div;A&&(N.removeChild(A),c.destroy(A));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(P){"CancelError"!==
P.name&&(this.clear(),this.onError(P))},_clonePixelData:function(P){if(null===P||P.texture)return P;var N={};P.extent&&(N.extent=d.clone(P.extent));var A=P.pixelBlock;null!=A&&(N.pixelBlock=A.clone());N.texture=P.texture;return N},_setPixelData:function(P){if(P){P=this._clonePixelData(P);this.pixelFilter&&(this.pixelFilter.filter?(this.pixelFilter.renderTexture=!0,this.pixelFilter.filter(P)):this.pixelFilter(P));this.pixelData=P;if(this._rasterReadPromise&&this._rasterReadPromise.isCanceled())return;
this._drawPixelData()}this._rasterReadPromise=null},_requestData:function(P,N,A){this._rasterReadPromise&&this._rasterReadPromise.cancel();P=d.clone(P)._normalize(!0);this._rasterReadPromise=this.raster.read({extent:P,width:this._map.width,height:this._map.height});this._rasterReadPromise.then(d.hitch(this,function(M){this._rasterReadPromise&&this._rasterReadPromise.isCanceled()||(this.originalPixelData=M&&M.srcData?{extent:M.extent,src:M.srcData}:M,this.useWebGL&&this._glSetting&&(this._glSetting.hasNewTexture=
!0),this._setPixelData(M))}),d.hitch(this,this._requestDataErrorHandler));return this._rasterReadPromise},_drawPixelData:function(P){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,e._css.names.transform,e._css.translate(this._left,this._top)),
a.set(this._canvas,e._css.names.transform,e._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&&(P=P||this.pixelData)&&P.pixelBlock){var N=this.pixelFilter?this.pixelData:this._rasterRenderer?this._rasterRenderer.draw(P):P;P=N.pixelBlock;var A=this._context,M=A.createImageData(P.width,P.height);M.data.set(P.getAsRGBA());N=N.extent;var O=this._map.extent,
U=this.getCurrentResolution(),X=0,ia=0;Math.abs(N.xmin-O.xmin)>U.x&&(X=Math.round((N.xmin-O.xmin)/U.x));Math.abs(O.ymax-N.ymax)>U.y&&(ia=Math.round((O.ymax-N.ymax)/U.y));"css-transforms"===this._map.navigationMode?(this._tdx=this._left,this._tdy=this._top,this._multiply=null,a.set(this._div,e._css.names.transform,e._css.translate(this._left,this._top)),a.set(this._canvas,e._css.names.transform,e._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(X,ia,P.width,P.height):this.clear();A.putImageData(M,X,ia,0,0,P.width,P.height);this._fireUpdateEnd()}},hasStdTime:function(){if(!this.hasMultidimensions||"StdTime"!==this.raster.dataType)return!1;var P=this.mosaicRule&&this.mosaicRule.multidimensionalDefinition,N=P&&P.length?P[0].variableName:this._defaultMultidimensionalDefinition[0].variableName;
return this.raster.rasterInfo.multidimensionalInfo.variables.some(function(A){if(A.name===N)return A.dimensions.some(function(M){return"StdTime"===M.name})})},getStdTimeValue:function(P){return(new Date(864E5*(P-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(P,N){return this.tileManager.updateTile(P,!0).then(d.hitch(this,function(A){(this._hasTilingEffects||this.useWebGL||N)&&this._drawOneFrame(A)}))},_drawOneFrame:function(P,N){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(P&&(P.renderedPixelBlock||P.pixelBlock)&&this._canDraw()&&this.drawMode){N=P.extent;var A=this._map.extent;if(!this._isExtentOutSide(N,A)){var M=P.pixelBlock||P.renderedPixelBlock,O=this._context,U=O.createImageData(M.width,
M.height);U.data.set((P.renderedPixelBlock||P.pixelBlock).getAsRGBA());P=this.getCurrentResolution();var X=0,ia=0;Math.abs(N.xmin-A.xmin)>P.x&&(X=Math.round((N.xmin-A.xmin)/P.x));Math.abs(A.ymax-N.ymax)>P.y&&(ia=Math.round((A.ymax-N.ymax)/P.y));O.putImageData(U,X,ia,0,0,M.width,M.height)}}else this._fireUpdateEnd()}},_isExtentOutSide:function(P,N){return P.xmax<=N.xmin||P.xmin>=N.xmax||P.ymax<=N.ymin||P.ymin>=N.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 P=this._context.getImageData(0,0,this._map.width,this._map.height);this.clear();this._context.putImageData(P,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,e._css.names.transform,e._css.translate(this._left,this._top)),a.set(this._canvas,e._css.names.transform,e._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 P=this._frames,N=0,A;for(A=0;A<P.length;A++)if(P[A].completed)N++;else if(P[A].tileData.renderedPixelBlock){P[A].completed=!0;var M=P[A].tileData;break}else if(P[A].tileData._fetched&&!P[A].tileData.src){P[A].completed=!0;break}else if(P[A].tileData.update&&P[A].tileData.update.isFulfilled()&&!P[A].tileData.renderedPixelBlock){P[A].completed=!0;break}else P[A].tileData.fetch&&(!0===P[A].tileData.fetch||P[A].tileData.fetch.isCanceled()||
P[A].tileData.fetch.isRejected())?(P[A].completed=!0,N++):this._isExtentOutSide(P[A].tileData.extent,this._map.extent)&&(P[A].completed=!0,N++);if(M){N++;var O=M.extent,U=this._map.extent,X=this.getCurrentResolution(),ia=A=0;Math.abs(O.xmin-U.xmin)>X.x&&(A=Math.round((O.xmin-U.xmin)/X.x));Math.abs(U.ymax-O.ymax)>X.y&&(ia=Math.round((U.ymax-O.ymax)/X.y));M.renderedPixelBlock?(O=M.renderedPixelBlock,U=this._context.createImageData(O.width,O.height),U.data.set(M.renderedPixelBlock.getAsRGBA()),this._context.putImageData(U,
A,ia,0,0,O.width,O.height)):this.clear(A,ia,M.width,M.height)}N===P.length?(this._animation=null,this._fireUpdateEnd()):this._animation=requestAnimationFrame(d.hitch(this,this._drawAllFrames))}else this._resetDrawing(),this._animation=requestAnimationFrame(d.hitch(this,this._drawAllFrames))},_fetchTiles:function(P,N){if(!this.suspended&&this.loaded){this._cancelAnimation();var A=this.tileManager,M=!(A.xformSetting.requireProjection&&A.xformSetting.requirePE)||Y.load();k(M,d.hitch(this,function(){A.updateExtent(P,
this.getCurrentResolution());this._resetCss=!1;A.fetchTiles(N);N&&(this._hasTilingEffects||this.useWebGL?this.useWebGL&&0<A.tiles.length?(A.fillupTiles(),A._validateRawPixelBlocks(A.originalPixelData)?this._updateAllTilesOnce(A.originalPixelData):A.originalPixelData&&A.originalPixelData.src&&A.tiles.some(function(O){return O.updateCompleted})&&this._context.clear(this._context.COLOR_BUFFER_BIT),A.tiles.forEach(d.hitch(this,function(O){O.update&&!O.updateCompleted&&O.update.then(function(U){O.updateCompleted||
(O.updateCompleted=!0);(this._hasTilingEffects||this.useWebGL)&&this._drawOneFrame(U)}.bind(this))}))):this._hasTilingEffects&&k(A.fetchAllCompleted.isResolved()||A.fetchAllCompleted,d.hitch(this,function(){this._updateAllTilesOnce(A.originalPixelData)})):(this._frames=A.tiles.map(function(O){return{completed:!1,tileData:O}}),this._drawAllFrames()))}))}},_redrawTiles:function(){this._fetchTiles(this._map.extent,!0)},_panHandler:function(P,N){this._drawTile=!1;"css-transforms"===this._map.navigationMode?
this.roaming&&this.tileMode&&this.useWebGL?(this._delta=N,!this._roamingAnimation&&this.tileMode&&(this._roamingAnimation=requestAnimationFrame(this._animatePan2d))):(this._left=this._map.__visibleDelta.x+N.x,this._top=this._map.__visibleDelta.y+N.y,a.set(this._div,e._css.names.transform,e._css.translate(this._left,this._top))):a.set(this._div,{left:this._startRect.left+N.x+"px",top:this._startRect.top+N.y+"px"});this.tileMode&&this._fetchTiles(P)},_panEndHandler:function(P,N){N&&(this._startRect.left+=
N.x,this._startRect.top+=N.y);this.oldData=null;this._roamingAnimation&&(cancelAnimationFrame(this._roamingAnimation),this._oldDelta=this._roamingAnimation=null)},_onScaleHandler:function(P,N){var A={},M=e._css.names;a.set(this._canvas,M.transition,N?"none":M.transformName+" "+va+"ms ease");this._matrix=P;P=this._multiply?h.multiply(P,this._multiply):P;if(this._tdx||this._tdy)P=h.multiply(P,{xx:1,xy:0,yx:0,yy:1,dx:-this._tdx,dy:-this._tdy});A[M.transform]=e._css.matrix(P);a.set(this._canvas,A)},_onZoomHandler:function(P,
N,A){var M=this._startRect;P=M.width*N;N*=M.height;var O=M.left-(P-M.width)*(A.x-M.left)/M.width;A=M.top-(N-M.height)*(A.y-M.top)/M.height;a.set(this._canvas,{left:O+"px",top:A+"px",width:P+"px",height:N+"px"});this._endRect={left:O,top:A,width:P,height:N}},_onZoomEndHandler:function(){this._endRect&&(this._startRect=this._endRect)},_onResizeHandler:function(P,N,A){a.set(this._div,{width:N+"px",height:A+"px"});a.set(this._canvas,{width:N+"px",height:A+"px"});this._startRect.width=this._canvas.width=
N;this._startRect.height=this._canvas.height=A;this.useWebGL&&this._glSetting&&(this._glSetting.pingpong=null,this._glSetting.branches=null)},_extentChangeHandler:function(P,N,A,M){if(this.loaded&&!this.suspended&&(!N||0!==N.x||0!==N.y||A)){this._drawTile=!0;"css-transforms"===this._map.navigationMode&&(N&&(this._dragOrigin.x+=N.x,this._dragOrigin.y+=N.y),this._left=this._map.__visibleDelta.x,this._top=this._map.__visibleDelta.y,this.roaming&&this.tileMode&&this.useWebGL||A||a.set(this._div,e._css.names.transform,
e._css.translate(this._left,this._top)),A&&(a.set(this._canvas,e._css.names.transition,"none"),this._multiply=this._multiply?h.multiply(this._matrix,this._multiply):this._matrix,this._levelChange=!0));this._fireUpdateStart();var O=this._map;N=this.raster.rasterFunction?this.raster.getMemberRasters().map(function(X){return X._rasterId}):[this.raster._rasterId];var U={};this.tileMode?((this.roaming||this.useWebGL)&&this.tileMode||(N.forEach(function(X,ia){U[X]={extent:O.extent,pixelBlock:new Q({width:O.width,
height:O.height,pixels:[],pixelType:"",mask:null,statistics:[]})}}),this.tileManager.originalPixelData={extent:O.extent,src:U}),this.projectedFullExtent?this._fetchTiles(P,!0):this._getProjectedFullExtent(O.spatialReference).then(d.hitch(this,function(){this._fetchTiles(P,!0)}))):this._requestData(O.extent,O.width,O.height)}},_visibilityChangeHandler:function(P){P?v.show(this._div):v.hide(this._div)},_opacityChangeHandler:function(P){a.set(this._div,"opacity",P)}});g("extend-esri")&&d.setObject("layers.RasterXLayer",
L,e);return L})},"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(L,d,q,p,t,g,c,a,b,h,k,l,e,n,m,v,z){L={customDrivers:[],create:function(y){if(y){if(y.url){var D=e.urlToObject(y.url);var B=
D.path;var H=D.query}D=y.serviceInfo;var G=y.rasterFxArgs||{},J=new p,I=q.hitch(this,function(w){console.error(w);this._trycustomDrivers(q.mixin({url:B},y),0,J)});if(B)if(-1===B.toLowerCase().indexOf("imageserver")&&-1===B.toLowerCase().indexOf("mapserver")){var C=new v(q.mixin({},y,{url:B}));y.rasterFx&&(C=new z({rasterFx:y.rasterFx,rasterFxArgs:q.mixin({},G,{raster:C})}));var f=C}else{f=new p;D=D||this._getServiceInfo(B,H);var r=q.hitch(this,function(w){w.bandCount?C=w.capabilities&&-1<w.capabilities.toLowerCase().indexOf("tileonly")?
new m(q.mixin({},{serviceInfo:w},H,y,{url:B})):new n(q.mixin({},{serviceInfo:w},H,y,{url:B})):w.tileInfo&&(C=new m(q.mixin({},{serviceInfo:w},H,this._options,{url:B})));y.rasterFx&&(C=new z({rasterFx:y.rasterFx,rasterFxArgs:q.mixin({},G,{raster:C})}));f.resolve(C)});a(D,r,I)}else f=C=new z({rasterFx:y.rasterFx,rasterFxArgs:q.mixin({},G,{raster:C})});a(f,q.hitch(this,function(w){w?w.open().then(q.hitch(this,function(u){J.resolve(w)}),I):I(Error("There is no raster to open"))}),I);return J.promise}},
register:function(y){this.customDrivers=this.customDrivers||[];0<this.customDrivers.filter(function(D){return D.sourceType===y.prototype.sourceType}).length||this.customDrivers.push(y)},_trycustomDrivers:function(y,D,B){B=B||new p;var H=this.customDrivers[D];if(H){var G=new H(y);G.open().then(q.hitch(this,function(J){B.resolve(G)}),q.hitch(this,function(J){this._trycustomDrivers(y,D+1,B)}))}else B.reject("cannot load layer "+(y&&y.url||""));return B.promise},_getServiceInfo:function(y,D){D=D||{};
var B=D.bandIds;D=D.renderingRule;var H=new p(l._dfdCanceller),G={f:"json"};B&&(G.bandIds=B);D&&(G.renderingRule=D.toJson?JSON.stringify(D.toJson()):JSON.stringify(D));H._pendingDfd=k({url:y,content:G,handleAs:"json",callbackParamName:"callback"});H._pendingDfd.then(function(J){H.callback(J)},function(J){H.errback(J)});return H.promise}};c("extend-esri")&&q.setObject("layers.rasterLib.raster.rasterFactory",L,b);return L})},"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(L,d,q,p,t,g,c,a,b,h,k,l,e,n,m,v,z,y,D,B,H,G,J,I,C,f){L=d([I],{declaredClass:"esri.layers.rasterLib.raster.ImageServiceRaster",sourceType:"ImageService",constructor:function(r){r&&(this._imageServiceParams=r.imageServiceParameters,this._commonReqParams=r._commonReqParams,this._imageServiceParams||(this._imageServiceParams={interpolation:r.interpolation,pixelType:r.pixelType,format:r.format||"lerc",compressionQuality:r.compressionQuality,bandIds:r.bandIds,noDataInterpretation:r.noDataInterpretation,
adjustAspectRatio:r.adjustAspectRatio,mosaicRule:r.mosaicRule,renderingRule:r.interpolation}))},open:function(){var r=new p;if(this.serviceInfo&&this.rasterInfo)return this.loaded=!0,this._findCredential(),this.setFetchParameters(this._imageServiceParams),r.resolve(this),r.promise;var w=this.serviceInfo||this._generateServiceInfo(this._imageServiceParams&&this._imageServiceParams.renderingRule),u=q.hitch(this,function(K){this._fixServiceInfo(K);this.serviceInfo=K;this._findCredential();var Q=this._parseRasterInfo(K),
V={};K.defaultMosaicMethod?(V.method=K.defaultMosaicMethod,V.operation=K.mosaicOperator,V.sortField=K.sortField,V.sortValue=K.sortValue):V.method=B.METHOD_NONE;this.serviceInfo.defaultMosaicRule=new B(V);this.serviceInfo.defaultMosaicRule.ascending=!0;K=this._getColormap(this);V=this._getHistograms(this);var W=this._getRasterAttributeTable(this),Y=this._getKeyProperties(this),ja=this._getMultidimensionalInfo(),ba=this._getSlices();(new b([K,V,W,Y,ja,ba])).then(q.hitch(this,function(fa){fa[0][0]&&
(Q.colormap=fa[0][1]);fa[1][0]&&(Q.histograms=fa[1][1]);fa[2][0]&&(Q.vat=fa[2][1]);fa[3][0]&&(Q.keyProperties=fa[3][1]);fa[4][0]&&(Q.multidimensionalInfo=fa[4][1]);this._slices=fa[5][0]?fa[5][1]:null;Q.keyProperties&&Q.keyProperties.DataType&&(this.dataType=Q.keyProperties.DataType);this.loaded=!0;this.rasterInfo=Q;this.setFetchParameters(this._imageServiceParams);r.resolve(this)}))}),E=q.hitch(this,function(K){this.loaded=!0;r.reject(K)});h(w,u,E);return r.promise},setFetchParameters:function(r,
w){if(w)this.imageServiceParams=r;else{var u=this.imageServiceParams;u&&r?Object.keys(r).forEach(function(E){u[E]=r[E]}):this.imageServiceParams=r}this._constructGetImageParams();this._getRasterIdentifier(!0)},read:function(r){if(r.pixelBlock||r.texture){var w=new p;w.resolve(r);return w.promise}if(!1===r.virtual&&this.tileInfo&&!this.tileInfo.virtual)return this.readTile(r);if(this._slices){var u=this._getSliceId();if(null==u)return w=new p,w.resolve(r),w.promise}var E=r.extent,K=E.spatialReference.wkid||
c.toJson(E.spatialReference.toJson(!1)),Q=r.timeExtent?r.timeExtent.toJson().join(","):null;w=this.url+"/exportImage";var V={};this._slices&&(V.sliceid=u);this.disableClientCaching&&(V._ts=(new Date).getTime());u=q.mixin({},this._commonReqParams,{bbox:E.xmin+","+E.ymin+","+E.xmax+","+E.ymax,imageSR:K,bboxSR:K,size:r.width+","+r.height,time:Q},V);return this._requestPixels({url:w,payload:u,decodeParams:{width:r.width,height:r.height,planes:null,pixelType:null,format:null,decodeFunc:null,isPoint:!1},
tileOptions:r})},readTile:function(r){var w=this.tileBoundary&&this.tileBoundary[r.level];if(w&&(w.minRow>r.row||w.maxRow<r.row||w.minCol>r.col||w.maxCol<r.col)){var u=new p;u.resolve(r);return u.promise}if(this._slices&&(u=this._getSliceId(),null==u))return u=new p,u.resolve(r),u.promise;w=this.url+"/tile/"+r.level+"/"+r.row+"/"+r.col;var E={width:this.tileInfo.cols,height:this.tileInfo.rows,planes:null,pixelType:null,format:null,decodeFunc:null,isPoint:"elevation"===r.tileType.toLowerCase()?!0:
!1};u=this._slices?"sliceid\x3d"+u+"\x26":"";u=this.disableClientCaching?"_ts\x3d "+(new Date).getTime():u.replace(/&$/,"");return this._requestPixels({url:w+(0<u.length?"?"+u:""),payload:{},decodeParams:E,tileOptions:r})},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 r=q.clone(this._imageServiceParams.multidimensionalDefinition),
w=q.clone(this._imageServiceParams.time);if(null==this._slices||null==w&&(null==r||0===r.length))return 0;var u=r||this.defaultMultidimensionalDefinition,E=u[0].variableName;u=this._getAllDimensionDefinition(u,E).definition;r=null;if(null==u||0===u.length)return null;if(w&&this.serviceInfo.timeInfo){if(null==w[1]||w[1]===w[0])var K=w[0];else{var Q=this.serviceInfo.timeInfo.startTimeField;K=this.rasterInfo.multidimensionalInfo.variables.find(function(Y){return Y.name===E}).dimensions.find(function(Y){return Y.name===
Q}).values.filter(function(Y){return Array.isArray(Y)?Math.max(Y[0],w[0])<Math.min(Y[1],w[1]):Y>=w[0]&&Y<=w[1]}).sort(function(Y,ja){Y=Array.isArray(Y)?Y[1]:Y;ja=Array.isArray(ja)?Y[1]:ja;return Math.abs(w[1]-Y)-Math.abs(w[1]-ja)})[0]||[w[1]]}u.some(function(Y){if(Y.dimensionName===Q)return Y.values[0]=K,!0;if(!Y.dimensionName)return Y.dimensionName=Q,Y.isSlice=!0,Y.values=[K],!0})||u.push({variableName:E,dimensionName:Q,isSlice:!0,values:[K]})}for(var V=0;V<this._slices.length;V++){var W=this._slices[V].multidimensionalDefinition;
if(W.length===u.length&&!W.some(function(Y){var ja=u.filter(function(fa){return Y.variableName===fa.variableName&&fa.dimensionName===Y.dimensionName})[0];if(!ja)return!0;var ba=Array.isArray(Y.values[0])?Y.values[0][0]:Y.values[0];ja=Array.isArray(ja.values[0])?ja.values[0][0]:ja.values[0];return ba!==ja})){r=V;break}}return r},_getAllDimensionDefinition:function(r,w){var u=r.map(function(K){return K.dimensionName}),E=!1;this.rasterInfo.multidimensionalInfo.variables.forEach(function(K){K.name!==
w||K.dimensions.length===r.length&&u[0]||(K.dimensions.forEach(function(Q){0>u.indexOf(Q.name)&&(u[0]?r.push({variableName:w,dimensionName:Q.name,values:[Q.values[0]]}):(r[0].dimensionName=Q.name,r[0].values=[Q.values[0]],Q[0]=Q.name))}),E=!0)},this);return{defChanged:E,definition:r}},_generateServiceInfo:function(r){var w=this.url,u=new p(y._dfdCanceller);u._pendingDfd=e({url:w,content:{f:"json",renderingRule:r?c.toJson(r.toJson()):null},handleAs:"json",callbackParamName:"callback"});u._pendingDfd.then(function(E){u.callback(E)},
function(E){u.errback(E)});return u},_fixServiceInfo:function(r){var w=r.spatialReference.wkid;r.tileInfo&&0===r.extent.xmin&&360===r.extent.xmax&&w&&null==z[w]&&(r.tileInfo.applyGCS360Transform=!0)},_parseRasterInfo:function(r){var w=new J;w.bandCount=r.bandCount;w.extent=new n(r.fullExtent);w.spatialReference=r.spatialReference;w.pixelType=r.pixelType;w.width=Math.floor((r.fullExtent.xmax-r.fullExtent.xmin)/r.pixelSizeX+.5);w.height=Math.floor((r.fullExtent.ymax-r.fullExtent.ymin)/r.pixelSizeY+
.5);w.cellSize=new m({x:r.pixelSizeX,y:r.pixelSizeY,spatialReference:r.spatialReference});var u;if(r.minValues&&0<r.minValues.length&&r.maxValues&&r.stdvValues&&r.meanValues){var E=[];for(u=0;u<r.minValues.length;u++)E.push({min:r.minValues[u],max:r.maxValues[u],mean:r.meanValues[u],stddev:r.stdvValues[u]});r.bandCount!==E.length&&(E=null)}this.dataType=r.serviceDataType?r.serviceDataType.replace("esriImageServiceDataType",""):"Generic";w.statistics=E;r.objectIdField&&r.fields&&(w.catalogInfo={objectIdField:r.objectIdField,
fields:r.fields});w.timeInfo=r.timeInfo;if(r.tileInfo){this.tileInfo=new f(r.tileInfo);this.tileInfo.tileType=r.cacheType||"Map";w.tileInfo=this.tileInfo;var K=w.extent,Q=this.tileInfo.origin,V=this.tileInfo.cols,W=this.tileInfo.rows;this.tileBoundary=this.tileInfo.lods.map(function(Y){return{minCol:Math.floor((K.xmin-Q.x+.1*Y.resolution)/V/Y.resolution),maxCol:Math.floor((K.xmax-Q.x-.1*Y.resolution)/V/Y.resolution),minRow:Math.floor((Q.y-K.ymax+.1*Y.resolution)/W/Y.resolution),maxRow:Math.floor((Q.y-
K.ymin-.1*Y.resolution)/W/Y.resolution)}})}return w},_getColormap:function(r){r=this.url+"/colormap";var w=new p(y._dfdCanceller),u={f:"json"},E=this.serviceInfo.hasColormap||this.rasterInfo&&this.rasterInfo.hasColormap;10<this.serviceInfo.currentVersion&&E?(w._pendingDfd=e({url:r,content:u,handleAs:"json",callbackParamName:"callback"}),w._pendingDfd.then(function(K){w.callback(K.colormap)},function(K){w.errback(K)})):w.callback(null);return w},_getHistograms:function(r){var w=this.url+"/histograms",
u=new p(y._dfdCanceller),E={f:"json"},K=this.serviceInfo.hasHistograms||this.rasterInfo&&this.rasterInfo.hasHistograms;r&&r.renderingRule&&(E.renderingRule=c.toJson(r.renderingRule.toJson()),K=!0);10<this.serviceInfo.currentVersion&&K?(u._pendingDfd=e({url:w,content:E,handleAs:"json",callbackParamName:"callback"}),u._pendingDfd.then(function(Q){u.callback(Q.histograms)},function(Q){u.errback(Q)})):u.callback(null);return u},_getRasterAttributeTable:function(r){var w=this.url+"/rasterAttributeTable",
u=new p(y._dfdCanceller),E={f:"json"},K=this.serviceInfo.hasRasterAttributeTable;r&&r.renderingRule&&(E.renderingRule=c.toJson(r.renderingRule.toJson()),K=!0);10<this.serviceInfo.currentVersion&&K?(u._pendingDfd=e({url:w,content:E,handleAs:"json",callbackParamName:"callback"}),u._pendingDfd.then(function(Q){u.callback(Q)},function(Q){u.errback(Q)})):u.callback(null);return u},_getKeyProperties:function(r){var w=this.url+"/keyProperties",u=new p(y._dfdCanceller),E={f:"json"};r&&r.renderingRule&&(E.renderingRule=
c.toJson(r.renderingRule.toJson()));10<this.serviceInfo.currentVersion?(u._pendingDfd=e({url:w,content:E,handleAs:"json",callbackParamName:"callback"}),u._pendingDfd.then(function(K){u.callback(K)},function(K){u.errback(K)})):u.callback(null);return u},_getMultidimensionalInfo:function(){var r=this.url+"/multidimensionalInfo",w=new p(y._dfdCanceller);10.3<=this.serviceInfo.currentVersion&&this.serviceInfo.hasMultidimensions?(w._pendingDfd=e({url:r,content:{f:"json"},handleAs:"json",callbackParamName:"callback"}),
w._pendingDfd.then(q.hitch(this,function(u){w.callback(u.multidimensionalInfo)}),function(u){w.errback(u)})):w.callback(null);return w},_getSlices:function(){var r=this.url+"/slices",w=new p(y._dfdCanceller);this.serviceInfo.hasMultidimensions?(w._pendingDfd=e({url:r,content:{f:"json"},handleAs:"json",callbackParamName:"callback"}),w._pendingDfd.then(q.hitch(this,function(u){w.callback(u.slices)}),function(u){w.errback(u)})):w.callback(null);return w},_initializationFailed:function(){},_constructGetImageParams:function(){var r=
this.imageServiceParams||{},w=q.mixin({},this._query,{f:"image",interpolation:r.interpolation,pixelType:r.pixelType,format:r.format||"lerc",compressionQuality:r.compressionQuality,bandIds:r.bandIds?r.bandIds.join(","):null,noData:null!=r.noData?r.noData.join(","):null,noDataInterpretation:r.noDataInterpretation,adjustAspectRatio:null==r.adjustAspectRatio?null:r.adjustAspectRatio,mosaicRule:r.mosaicRule?c.toJson(r.mosaicRule.toJson()):null,renderingRule:r.renderingRule?c.toJson(r.renderingRule.toJson()):
null,token:this.credential&&this.credential.token||null});"lerc"===w.format.toLowerCase()?(w.compressionTolerance=r.compressionTolerance,10.5<=this.serviceInfo.currentVersion&&(w.lercVersion=r.lercVersion||2)):"tiff"===w.format.toLowerCase()?w.compression=r.compression:-1<["jpg","jpeg","jpg","jpgpng"].indexOf(w.format.toLowerCase())&&(w.compression=r.compression);this._commonReqParams=w},_getRasterIdentifier:function(r){if(this._rasterId)return this._rasterId;r=this.url.replace("http:","").replace("https:",
"");var w=[],u=this.imageServiceParams||{};w.push(r);w.push(u.interpolation);w.push(u.pixelType);w.push(u.compressionQuality);w.push(u.bandIds?u.bandIds.join(","):"");w.push(u.mosaicRule?c.toJson(u.mosaicRule.toJson()):"");w.push(u.renderingRule?c.toJson(u.renderingRule.toJson()):"");r=w.join("|");return this._rasterId=this._computeSignature(r)},_wrapExtent:function(r){var w=r.spatialReference._getInfo();if(w){var u=w.valid[0];w=w.valid[1];if(r.xmin<u-this.resolution.x||r.xmax>w+this.resolution.y){var E=
new n((r.xmin-u)%(w-u),r.ymin,(r.xmax-w)%(w-u),r.ymax,r.spatialReference);E.xmax<E.xmin&&(E=null)}}return E||r}});a("extend-esri")&&q.setObject("layers.rasterLib.raster.ImageServiceRaster",L,k);return L})},"esri/layers/ImageServiceParameters":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/json dojo/has ../kernel ../lang".split(" "),function(L,d,q,p,t,g){L=L(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(c){var a=this.bbox||this.extent;c=(a=a&&c&&a._normalize(!0))?a.spatialReference.wkid||q.toJson(a.spatialReference.toJson()):null;var b=this.imageSpatialReference;a={bbox:a?a.xmin+","+a.ymin+","+a.xmax+","+a.ymax:null,bboxSR:c,size:null!==this.width&&null!==this.height?this.width+","+this.height:
null,imageSR:b?b.wkid||q.toJson(b.toJson()):c,format:this.format,interpolation:this.interpolation,compressionQuality:this.compressionQuality,bandIds:this.bandIds?this.bandIds.join(","):null,mosaicRule:this.mosaicRule?q.toJson(this.mosaicRule.toJson()):null,renderingRule:this.renderingRule?q.toJson(this.renderingRule.toJson()):null,renderer:this.renderer?q.toJson(this.renderer.toJson()):null,noData:this.noData,noDataInterpretation:this.noDataInterpretation,compressionTolerance:this.compressionTolerance,
adjustAspectRatio:this.adjustAspectRatio,lercVersion:this.lercVersion};c=this.timeExtent;a.time=c?c.toJson().join(","):null;return g.filter(a,function(h){if(null!==h&&void 0!==h)return!0})}});d.mixin(L,{INTERPOLATION_BILINEAR:"RSP_BilinearInterpolation",INTERPOLATION_CUBICCONVOLUTION:"RSP_CubicConvolution",INTERPOLATION_MAJORITY:"RSP_Majority",INTERPOLATION_NEARESTNEIGHBOR:"RSP_NearestNeighbor",NODATA_MATCH_ALL:"esriNoDataMatchAll",NODATA_MATCH_ANY:"esriNoDataMatchAny"});p("extend-esri")&&d.setObject("layers.ImageServiceParameters",
L,t);return L})},"esri/layers/rasterLib/raster/RasterInfo":function(){define(["dojo/_base/declare","dojo/_base/lang","../../../geometry/Extent","../../../SpatialReference","../tile/RasterTileInfo"],function(L,d,q,p,t){return L(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(g){d.mixin(this,g);this.extent=this.extent?this.extent.toJson?this.extent:new q(this.extent):null;this.spatialReference=this.spatialReference?this.spatialReference.toJson?this.spatialReference:new p(this.spatialReference):null;this.tileInfo=this.tileInfo?this.tileInfo.toJson?this.tileInfo:new t(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?d.clone(this.colormap):null,attributeTable:this.attributeTable?d.clone(this.attributeTable):null,multiDimensionalInfo:this.multiDimensionalInfo?d.clone(this.multiDimensionalInfo):null,statistics:this.statistics?d.clone(this.statistics):null,histograms:this.histograms?
d.clone(this.histograms):null,catalogInfo:this.catalogInfo?d.clone(this.catalogInfo):null,keyProperties:this.keyProperties?d.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?d.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(L,d,q,p,t,g,c){return L([c],{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,
b){if(a||b){var h=b&&b.refTileInfo;a?this.virtual=!1:(this.virtual=!0,d.mixin(this,{rows:b.rows||this.rows,cols:b.cols||this.cols,compressionQuality:b.compressionQuality||95,lercError:b.compressionTolerance||.01,spatialReference:b.spatialReference,origin:b.origin}),this.width=this.cols,this.height=this.rows,this.origin||(h?this.origin=h.origin:b.spatialReference.isWebMercator()||b.extent&&360<=Math.max(Math.abs(b.extent.xmin),Math.abs(b.extent.xmax))?this.origin={x:-2.0037508342787E7,y:2.0037508342787E7}:
-1<[4326,4269].indexOf(b.spatialReference.wkid)||360>Math.max(Math.abs(b.extent.xmin),Math.abs(b.extent.xmax))?this.origin={x:-180,y:90}:this.origin={x:b.extent.xmin,y:b.extent.ymax}))}},toJson:function(){var a=c.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(L,d,q,p,t,g,c,a,b,h,k,l,e,n,m,v,z,y,D,B,H,G,J,I,C){return d([l],{url:null,dataType:null,rasterInfo:null,tileInfo:null,serviceInfo:null,loaded:null,constructor:function(f){if(f){var r=f.url;r&&(r=y.urlToObject(r),this.url=r.path,this._query=r.query);this.dataType=f.dataType;this.serviceInfo=f.serviceInfo;this.rasterInfo=f.rasterInfo;this.tileInfo=f.tileInfo;this.serviceInfo=f.serviceInfo}},open:function(){},read:function(f){},identify:function(f){var r=new p,w=this.rasterInfo.extent;if(I.requirePE(w.spatialReference,
f.spatialReference))I.load().then(q.hitch(this,function(){u=I.project(f,w.spatialReference);r.resolve(u)}),function(){r.reject(Error("cannot project into this spatial reference"))});else{var u=I.project(f,w.spatialReference);r.resolve(u)}return r.then(q.hitch(this,function(E){var K=this.tileInfo,Q=K.origin,V=K.lods[K.lods.length-1],W=(E.x-Q.x)/K.cols/V.resolution;E=(Q.y-E.y)/K.rows/V.resolution;var Y=Math.round((E-Math.floor(E))*K.rows)*K.cols+Math.round((W-Math.floor(W))*K.cols);Q=new n(Q.x+V.resolution*
K.cols*W,Q.y-V.resolution*K.rows*(E+1),Q.x+V.resolution*K.cols*(W+1),Q.y-V.resolution*K.rows*E,w.spatialReference);var ja=this.getMemberRasters?this.getMemberRasters()[0]:this;return ja.read({level:V.level,row:Math.floor(E),col:Math.floor(W),extent:Q,width:K.cols,height:K.rows,virtual:ja.tileInfo.virtual,tileType:ja.tileInfo.tileType}).then(function(ba){return(ba=ba&&ba.pixelBlock)&&ba.pixels&&0<ba.pixels.length&&(!ba.mask||ba.mask[Y])?{pixelValue:ba.pixels.map(function(fa){return fa[Y]})}:{pixelValue:null}})}))},
getProjectedFullExtent:function(f,r){var w=new p;if(this.projectedFullExtent&&!r)return w.resolve(this.projectedFullExtent),w.promise;var u=this.rasterInfo.extent;if(I.requirePE(this.rasterInfo.extent.spatialReference,f))I.load().then(q.hitch(this,function(){E=I.project(u,f);this.projectedFullExtent=E=new n(E.toJson());w.resolve(E)}),function(){w.reject(Error("cannot project into this spatial reference"))});else{var E=I.project(u,f);this.projectedFullExtent=E=new n(E.toJson());w.resolve(E)}return w.promise},
setFetchParameters:function(f,r){},_setRasterHandler:function(f){this._rasterHandler=f;this.getMemberRasters&&this.getMemberRasters().forEach(q.hitch(this,function(r){r._rasterHandler=f}))},_findCredential:function(){this.url&&((this._credential=k.id&&k.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 J;this._rasterHandler.start().then(function(){this._rasterHandlerInitialized=
!0}.bind(this))},_requestPixels:function(f){var r=f.url,w=f.payload,u=f.decodeParams,E=f.tileOptions,K=new p(z._dfdCanceller);this._rasterHandler||this._initWorker();var Q=this._rasterHandler,V={};r={url:r,handleAs:"arraybuffer",content:w};f.headers&&(r.headers=f.headers);K._pendingDfd=e(r).then(q.hitch(this,function(W){(Q&&this._rasterHandlerInitialized?Q.decode({encodedData:W,decodeParams:u}):G.decode(W,u)).then(function(Y){V.pixelBlock=new H(Y);V.extent=E.extent;V.level=E.level;V.row=E.row;V.col=
E.col;V.width=E.width;V.height=E.height;z._resDfd(K,[V])},function(Y){z._resDfd(K,[Y],!0)})}),function(W){z._resDfd(K,[W],!0)});return K},_computeSignature:function(f){if("string"===typeof f){for(var r=new Uint8Array(f.length),w=0;w<f.length;w++)r[w]=f.charCodeAt(w);f=r}w=r=65535;for(var u=f.length,E=Math.floor(u/2),K=0;E;){var Q=359<=E?359:E;E-=Q;do r+=f[K++]<<8,w+=r+=f[K++];while(--Q);r=(r&65535)+(r>>>16);w=(w&65535)+(w>>>16)}u&1&&(w+=r+=f[K]<<8);return((w&65535)+(w>>>16)<<16|(r&65535)+(r>>>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(L,d,q,p,t,g,c,a,b,h,k){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 l=new ArrayBuffer(4),e=new Uint8Array(l);(new Uint32Array(l))[0]=
1;return 1===e[0]}(),decode:function(l,e){if(void 0===e||null===e)throw"missing decode options";var n;e.format&&(n=e.format.toUpperCase());"BSQ"!==n&&"BIP"!==n&&(n=this._getFormat(l));var m=e.decodeFunc;if(void 0===m||null===m)m=this._getFormatDecoderDfd(n);return m(l,e)},_getFormatDecoderDfd:function(l){var e=null;switch(l){case "LERC":e=this._decodeLerc;break;case "LERC2":e=this._decodeLerc2;break;case "JPEG":e=this._decodeJpeg;break;case "PNG":e=this._decodePng;break;case "BSQ":e=this._decodeBsq;
break;case "BIP":e=this._decodeBip;break;case "TIFF":e=this._decodeTiff;break;default:e=function(n,m){throw"The raster format is not supported";}}e=q.hitch(this,e);return function(n,m){var v=new p;m.isPoint&&m.width&&(m.width++,m.height++);n=e(n,m);m.isPoint&&m.width&&(this._interpolatePointGrid(n),m.width--,m.height--);v.resolve(n);return v}.bind(this)},_getFormat:function(l){l=new Uint8Array(l,0,10);var e="";if(255===l[0]&&216===l[1])e="JPEG";else if(137===l[0]&&80===l[1]&&78===l[2]&&71===l[3])e=
"PNG";else if(67===l[0]&&110===l[1]&&116===l[2]&&90===l[3]&&73===l[4]&&109===l[5]&&97===l[6]&&103===l[7]&&101===l[8]&&32===l[9])e="LERC";else if(76===l[0]&&101===l[1]&&114===l[2]&&99===l[3]&&50===l[4]&&32===l[5])e="LERC2";else if(-1<String.fromCharCode.apply(null,l).toLowerCase().indexOf("error"))e="ERROR";else if(73===l[0]&&73===l[1]&&42===l[2]&&0===l[3]||77===l[0]&&77===l[1]&&0===l[2]&&42===l[3])e="TIFF";return e},_validateDecodeParams:function(l){if(!l.height||Math.floor(l.height)!==l.height)throw"Height not provided.";
if(!l.width||Math.floor(l.width)!==l.width)throw"Width not provided.";},_decodeJpeg:function(l,e){if(!a)throw"The jpeg decoder module is not loaded.";this._validateDecodeParams(e);l=(new a).decode(l);if(!this._verifyResult(l,e))throw"The decoded image dimensions are incorrect.";e=new t({width:l.width,height:l.height,pixels:l.pixels,pixelType:"U8",mask:l.mask,statistics:null});e.calculateStatistics();return e},_decodePng:function(l,e){if(!b)throw"The png decoder module is not loaded.";this._validateDecodeParams(e);
l=new Uint8Array(l);var n=new b(l);l=new Uint8Array(e.width*e.height*4);n.copyToImageData(l,n.decodePixels());var m=n=0;m=new Uint8Array(e.width*e.height);for(n=0;n<e.width*e.height;n++)m[n]=l[4*n+3];var v=new t({width:e.width,height:e.height,pixels:[],pixelType:"U8",mask:m,statistics:[]});for(n=0;3>n;n++){var z=new Uint8Array(e.width*e.height);for(m=0;m<e.width*e.height;m++)z[m]=l[4*m+n];v.addData({pixels:z})}v.calculateStatistics();return v},_decodeBsq:function(l,e){if(!h)throw"The bsq decoder module is not loaded.";
this._validateDecodeParams(e);var n=e.noDataValue;e.pixelType=this._getpixelTypeAndNoData(e.pixelType);l=h.decodeBSQ(l,{bandCount:e.planes,width:e.width,height:e.height,pixelType:e.pixelType,noDataValue:n});e=new t({width:e.width,height:e.height,pixels:l.pixels,pixelType:e.pixelType,mask:l.maskData,statistics:null});e.calculateStatistics();return e},_decodeBip:function(l,e){this._validateDecodeParams(e);var n=e.noDataValue;e.pixelType=this._getpixelTypeAndNoData(e.pixelType);l=h.decodeBIP(l,{bandCount:e.planes,
width:e.width,height:e.height,pixelType:e.pixelType,noDataValue:n});e=new t({width:e.width,height:e.height,pixels:l.pixels,pixelType:e.pixelType,mask:l.maskData,statistics:null});e.calculateStatistics();return e},_decodeTiff:function(l,e){this._validateDecodeParams(e);e.pixelType=this._getpixelTypeAndNoData(e.pixelType);l=k.decode(l);l=new t({width:l.width,height:l.height,pixels:l.pixels,pixelType:l.pixelType,mask:l.maskData,statistics:null});l.calculateStatistics();return l},_decodeLerc:function(l,
e){if(!this._isPlatformLittleEndian)throw"lerc decoder is not supported on big endian platform";this._validateDecodeParams(e);var n=e.noDataValue;e.pixelType=this._getpixelTypeAndNoData(e.pixelType);for(var m=0,v,z=0,y,D=l.byteLength-10;z<D;){var B=g.decode(l,{inputOffset:z,encodedMaskData:v,returnMask:0===m?!0:!1,returnEncodedMask:0===m?!0:!1,returnFileInfo:!0,pixelType:e.pixelType,noDataValue:n});z=B.fileInfo.eofOffset;0===m&&(v=B.encodedMaskData,y=new t({width:e.width,height:e.height,pixels:[],
pixelType:e.pixelType,mask:B.maskData,statistics:[]}));m++;if(!this._verifyResult(B,e))throw"The decoded image dimensions are incorrect";y.addData({pixels:B.pixelData,statistics:{minValue:B.minValue,maxValue:B.maxValue,noDataValue:B.noDataValue}})}return y},_decodeLerc2:function(l,e){if(!this._isPlatformLittleEndian)throw"lerc2 decoder is not supported on big endian platform";this._validateDecodeParams(e);e.pixelType=this._getpixelTypeAndNoData(e.pixelType);for(var n=0,m,v,z,y=0,D,B=l.byteLength-
10,H=[],G,J=0;y<B;){v=c.decode(l,{inputOffset:y,maskData:m,returnFileInfo:!0});y=v.fileInfo.eofOffset;m=v.maskData;0===n&&(z=v.fileInfo.numValidPixel,D=new t({width:e.width,height:e.height,pixels:[],dimCount:v.dimCount||1,pixelType:v.fileInfo.pixelType,mask:m,statistics:[]}));v.fileInfo.mask&&0<v.fileInfo.mask.numBytes&&J++;m&&H.push(m);n++;if(!this._verifyResult(v,e))throw"The decoded image dimensions are incorrect";D.addData({pixels:v.pixelData,statistics:{minValue:v.minValue,maxValue:v.maxValue,
noDataValue:v.noDataValue,dimStats:v.dimStats}})}if(1<J){e=D.width*D.height;D.bandMasks=H;m=new Uint8Array(e);m.set(H[0]);for(z=1;z<H.length;z++)for(G=H[z],l=0;l<e;l++)m[l]&=G[l];for(l=z=0;l<e;l++)z+=G[l];D.mask=m}D.validPixelCount=z;return D},_interpolatePointGrid:function(l,e){var n=l.pixels;if(n&&0!==n.length){var m=n.length,v=l.width,z=l.mask,y=v-1,D=l.height-1,B=[],H,G;if(0===(null==e?1:e)){for(e=0;e<m;e++){var J=n[e];var I=new J.constructor(y*D);for(H=0;H<D;H++){var C=H*v;for(G=0;G<y;G++)I[H*
y+G]=J[C+G]}B.push(I)}if(z){var f=new Uint8Array(y*D);for(H=0;H<D;H++)for(C=H*v,G=0;G<y;G++)f[H*y+G]=z[C+G]}}else{for(e=0;e<m;e++){J=n[e];I=new J.constructor(y*D);for(H=0;H<D;H++)for(C=H*v,G=0;G<y;G++)I[H*y+G]=(J[C+G]+J[C+G+1]+J[C+v+G]+J[C+v+G+1])/4;B.push(I)}if(z)for(f=new Uint8Array(y*D),H=0;H<D;H++)for(C=H*v,G=0;G<y;G++)f[H*y+G]=Math.min.apply(null,[z[C+G],z[C+G+1],z[C+v+G],z[C+v+G+1]])}l.width=y;l.height=D;l.mask=f;l.pixels=B;return l}},_getpixelTypeAndNoData:function(l){return"U1"===l||"U2"===
l||"U4"===l||"U8"===l?"U8":l},_verifyResult:function(l,e){return l.height!==e.height||l.width!==e.width?!1:!0}}})},"esri/layers/rasterFormats/JpgPlus":function(){define(["dojo/_base/declare","./Zlib","./Jpg"],function(L,d,q){return L(null,{constructor:function(){},decode:function(p){var t=new Uint8Array(p);p=new q;p.parse(t);var g=p.numComponents,c=p.getData(p.width,p.height,!0),a=p.width*p.height,b=p.eof,h=0,k=0,l=0;if(b<t.length-1){k=(new d(t.subarray(b))).getBytes();var e=new Uint8Array(a);for(h=
t=0;h<k.length;h++)for(l=7;0<=l;l--)e[t++]=k[h]>>l&1}t=[];if(1===g)t=[c,c,c];else{for(h=0;3>h;h++)g=new Uint8Array(a),t.push(g);for(k=l=0;k<a;k++)for(h=0;3>h;h++)t[h][k]=c[l++]}return{width:p.width,height:p.height,pixels:t,mask:e}}})})},"esri/layers/rasterFormats/Zlib":function(){define([],function(){var L=function(){function d(){this.bufferLength=this.pos=0;this.eof=!1;this.buffer=null}d.prototype={ensureBuffer:function(q){var p=this.buffer,t=p?p.byteLength:0;if(q<t)return p;for(var g=512;g<q;)g<<=
1;q=new Uint8Array(g);for(g=0;g<t;++g)q[g]=p[g];return this.buffer=q},getByte:function(){for(var q=this.pos;this.bufferLength<=q;){if(this.eof)return null;this.readBlock()}return this.buffer[this.pos++]},getBytes:function(q){var p=this.pos;if(q){this.ensureBuffer(p+q);for(q=p+q;!this.eof&&this.bufferLength<q;)this.readBlock();var t=this.bufferLength;q>t&&(q=t)}else{for(;!this.eof;)this.readBlock();q=this.bufferLength}this.pos=q;return this.buffer.subarray(p,q)},lookChar:function(){for(var q=this.pos;this.bufferLength<=
q;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var q=this.pos;this.bufferLength<=q;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(q,p,t){for(var g=q+p;this.bufferLength<=g&&!this.eof;)this.readBlock();return new Stream(this.buffer,q,p,t)},skip:function(q){q||(q=1);this.pos+=q},reset:function(){this.pos=0}};return d}();return function(){function d(b){throw Error(b);
}function q(b){var h=0,k=b[h++],l=b[h++];-1!=k&&-1!=l||d("Invalid header in flate stream");8!=(k&15)&&d("Unknown compression method in flate stream");0!=((k<<8)+l)%31&&d("Bad FCHECK in flate stream");l&32&&d("FDICT bit set in flate stream");this.bytes=b;this.bytesPos=h;this.codeBuf=this.codeSize=0;L.call(this)}if(!self||!self.Uint32Array)return null;var p=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),t=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]),g=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]),c=[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];q.prototype=Object.create(L.prototype);q.prototype.getBits=function(b){for(var h=this.codeSize,k=this.codeBuf,l=this.bytes,e=this.bytesPos,n;h<b;)"undefined"==typeof(n=l[e++])&&d("Bad encoding in flate stream"),k|=n<<h,h+=8;this.codeBuf=k>>b;this.codeSize=h-=b;this.bytesPos=e;return k&(1<<b)-1};q.prototype.getCode=function(b){var h=b[0],k=b[1];b=this.codeSize;for(var l=
this.codeBuf,e=this.bytes,n=this.bytesPos;b<k;){var m;"undefined"==typeof(m=e[n++])&&d("Bad encoding in flate stream");l|=m<<b;b+=8}k=h[l&(1<<k)-1];h=k>>16;k&=65535;(0==b||b<h||0==h)&&d("Bad encoding in flate stream");this.codeBuf=l>>h;this.codeSize=b-h;this.bytesPos=n;return k};q.prototype.generateHuffmanTable=function(b){for(var h=b.length,k=0,l=0;l<h;++l)b[l]>k&&(k=b[l]);for(var e=1<<k,n=new Uint32Array(e),m=1,v=0,z=2;m<=k;++m,v<<=1,z<<=1)for(var y=0;y<h;++y)if(b[y]==m){var D=0,B=v;for(l=0;l<m;++l)D=
D<<1|B&1,B>>=1;for(l=D;l<e;l+=z)n[l]=m<<16|y;++v}return[n,k]};q.prototype.readBlock=function(){function b(D,B,H,G,J){for(D=D.getBits(H)+G;0<D--;)B[v++]=J}var h=this.getBits(3);h&1&&(this.eof=!0);h>>=1;if(0==h){var k=this.bytes,l=this.bytesPos,e;"undefined"==typeof(e=k[l++])&&d("Bad block header in flate stream");var n=e;"undefined"==typeof(e=k[l++])&&d("Bad block header in flate stream");n|=e<<8;"undefined"==typeof(e=k[l++])&&d("Bad block header in flate stream");h=e;"undefined"==typeof(e=k[l++])&&
d("Bad block header in flate stream");(h|e<<8)!=(~n&65535)&&d("Bad uncompressed block length in flate stream");this.codeSize=this.codeBuf=0;e=this.bufferLength;h=this.ensureBuffer(e+n);this.bufferLength=n=e+n;for(var m=e;m<n;++m){if("undefined"==typeof(e=k[l++])){this.eof=!0;break}h[m]=e}this.bytesPos=l}else{if(1==h)l=c,e=a;else if(2==h){h=this.getBits(5)+257;e=this.getBits(5)+1;k=this.getBits(4)+4;l=Array(p.length);for(var v=0;v<k;)l[p[v++]]=this.getBits(3);l=this.generateHuffmanTable(l);v=k=0;e=
h+e;for(n=Array(e);v<e;)m=this.getCode(l),16==m?b(this,n,2,3,k):17==m?b(this,n,3,3,k=0):18==m?b(this,n,7,11,k=0):n[v++]=k=m;l=this.generateHuffmanTable(n.slice(0,h));e=this.generateHuffmanTable(n.slice(h,e))}else d("Unknown block type in flate stream");n=(h=this.buffer)?h.length:0;for(m=this.bufferLength;;){var z=this.getCode(l);if(256>z)m+1>=n&&(h=this.ensureBuffer(m+1),n=h.length),h[m++]=z;else{if(256==z){this.bufferLength=m;break}z-=257;z=t[z];var y=z>>16;0<y&&(y=this.getBits(y));k=(z&65535)+y;
z=this.getCode(e);z=g[z];y=z>>16;0<y&&(y=this.getBits(y));z=(z&65535)+y;m+k>=n&&(h=this.ensureBuffer(m+k),n=h.length);for(y=0;y<k;++y,++m)h[m]=h[m-z]}}}};return q}()})},"esri/layers/rasterFormats/Jpg":function(){define([],function(){var L=function(){function d(q){this.message="JPEG error: "+q}d.prototype=Error();d.prototype.name="JpegError";return d.constructor=d}();return function(){function d(){this.decodeTransform=null;this.colorTransform=-1}function q(a,b){for(var h=0,k=[],l,e,n=16;0<n&&!a[n-
1];)n--;k.push({children:[],index:0});var m=k[0],v;for(l=0;l<n;l++){for(e=0;e<a[l];e++){m=k.pop();for(m.children[m.index]=b[h];0<m.index;)m=k.pop();m.index++;for(k.push(m);k.length<=l;)k.push(v={children:[],index:0}),m.children[m.index]=v.children,m=v;h++}l+1<n&&(k.push(v={children:[],index:0}),m.children[m.index]=v.children,m=v)}return k[0].children}function p(a,b,h,k,l,e,n,m,v){function z(){if(0<u)return u--,w>>u&1;w=a[b++];if(255===w){var N=a[b++];if(N)throw new L("unexpected marker "+(w<<8|N).toString(16));
}u=7;return w>>>7}function y(N){for(;;){N=N[z()];if("number"===typeof N)return N;if("object"!==typeof N)throw new L("invalid huffman sequence");}}function D(N){for(var A=0;0<N;)A=A<<1|z(),N--;return A}function B(N){if(1===N)return 1===z()?1:-1;var A=D(N);return A>=1<<N-1?A:A+(-1<<N)+1}function H(N,A){var M=y(N.huffmanTableDC);M=0===M?0:B(M);N.blockData[A]=N.pred+=M;for(M=1;64>M;){var O=y(N.huffmanTableAC),U=O&15;O>>=4;if(0===U){if(15>O)break;M+=16}else M+=O,N.blockData[A+c[M]]=B(U),M++}}function G(N,
A){var M=y(N.huffmanTableDC);M=0===M?0:B(M)<<v;N.blockData[A]=N.pred+=M}function J(N,A){N.blockData[A]|=z()<<v}function I(N,A){if(0<E)E--;else for(var M=e;M<=n;){var O=y(N.huffmanTableAC),U=O&15;O>>=4;if(0===U){if(15>O){E=D(O)+(1<<O)-1;break}M+=16}else M+=O,N.blockData[A+c[M]]=B(U)*(1<<v),M++}}function C(N,A){for(var M=e,O=0,U;M<=n;){U=c[M];switch(K){case 0:O=y(N.huffmanTableAC);U=O&15;O>>=4;if(0===U)15>O?(E=D(O)+(1<<O),K=4):(O=16,K=1);else{if(1!==U)throw new L("invalid ACn encoding");Q=B(U);K=O?
2:3}continue;case 1:case 2:N.blockData[A+U]?N.blockData[A+U]+=z()<<v:(O--,0===O&&(K=2===K?3:0));break;case 3:N.blockData[A+U]?N.blockData[A+U]+=z()<<v:(N.blockData[A+U]=Q<<v,K=0);break;case 4:N.blockData[A+U]&&(N.blockData[A+U]+=z()<<v)}M++}4===K&&(E--,0===E&&(K=0))}var f=h.mcusPerLine,r=b,w=0,u=0,E=0,K=0,Q,V=k.length,W,Y,ja,ba;m=h.progressive?0===e?0===m?G:J:0===m?I:C:H;var fa=0;h=1===V?k[0].blocksPerLine*k[0].blocksPerColumn:f*h.mcusPerColumn;for(var ua,xa;fa<h;){var va=l?Math.min(h-fa,l):h;for(W=
0;W<V;W++)k[W].pred=0;E=0;if(1===V){var P=k[0];for(ba=0;ba<va;ba++)m(P,64*((P.blocksPerLine+1)*(fa/P.blocksPerLine|0)+fa%P.blocksPerLine)),fa++}else for(ba=0;ba<va;ba++){for(W=0;W<V;W++)for(P=k[W],ua=P.h,xa=P.v,Y=0;Y<xa;Y++)for(ja=0;ja<ua;ja++)m(P,64*((P.blocksPerLine+1)*((fa/f|0)*P.v+Y)+(fa%f*P.h+ja)));fa++}u=0;(P=g(a,b))&&P.invalid&&(console.log("decodeScan - unexpected MCU data, next marker is: "+P.invalid),b=P.offset);P=P&&P.marker;if(!P||65280>=P)throw new L("marker was not found");if(65488<=
P&&65495>=P)b+=2;else break}(P=g(a,b))&&P.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+P.invalid),b=P.offset);return b-r}function t(a,b){a=b.blocksPerLine;for(var h=b.blocksPerColumn,k=new Int16Array(64),l=0;l<h;l++)for(var e=0;e<a;e++){var n=void 0,m=void 0,v=void 0,z=void 0,y=void 0,D=void 0,B=void 0,H=void 0,G=y=D=z=m=n=void 0,J=void 0,I=void 0,C=void 0,f=64*((b.blocksPerLine+1)*l+e),r=k,w=b.quantizationTable,u=b.blockData;if(!w)throw new L("missing required Quantization Table.");
for(var E=0;64>E;E+=8)n=u[f+E],H=u[f+E+1],B=u[f+E+2],D=u[f+E+3],y=u[f+E+4],z=u[f+E+5],v=u[f+E+6],m=u[f+E+7],n*=w[E],0===(H|B|D|y|z|v|m)?(n=5793*n+512>>10,r[E]=n,r[E+1]=n,r[E+2]=n,r[E+3]=n,r[E+4]=n,r[E+5]=n,r[E+6]=n,r[E+7]=n):(H*=w[E+1],B*=w[E+2],D*=w[E+3],y*=w[E+4],z*=w[E+5],v*=w[E+6],m*=w[E+7],C=5793*n+128>>8,I=5793*y+128>>8,J=B,G=v,y=2896*(H-m)+128>>8,m=2896*(H+m)+128>>8,D<<=4,z<<=4,C=C+I+1>>1,I=C-I,n=3784*J+1567*G+128>>8,J=1567*J-3784*G+128>>8,G=n,y=y+z+1>>1,z=y-z,m=m+D+1>>1,D=m-D,C=C+G+1>>1,G=
C-G,I=I+J+1>>1,J=I-J,n=2276*y+3406*m+2048>>12,y=3406*y-2276*m+2048>>12,m=n,n=799*D+4017*z+2048>>12,D=4017*D-799*z+2048>>12,z=n,r[E]=C+m,r[E+7]=C-m,r[E+1]=I+z,r[E+6]=I-z,r[E+2]=J+D,r[E+5]=J-D,r[E+3]=G+y,r[E+4]=G-y);for(w=0;8>w;++w)n=r[w],H=r[w+8],B=r[w+16],D=r[w+24],y=r[w+32],z=r[w+40],v=r[w+48],m=r[w+56],0===(H|B|D|y|z|v|m)?(n=5793*n+8192>>14,n=-2040>n?0:2024<=n?255:n+2056>>4,u[f+w]=n,u[f+w+8]=n,u[f+w+16]=n,u[f+w+24]=n,u[f+w+32]=n,u[f+w+40]=n,u[f+w+48]=n,u[f+w+56]=n):(C=5793*n+2048>>12,I=5793*y+2048>>
12,J=B,G=v,y=2896*(H-m)+2048>>12,m=2896*(H+m)+2048>>12,C=(C+I+1>>1)+4112,I=C-I,n=3784*J+1567*G+2048>>12,J=1567*J-3784*G+2048>>12,G=n,y=y+z+1>>1,z=y-z,m=m+D+1>>1,D=m-D,C=C+G+1>>1,G=C-G,I=I+J+1>>1,J=I-J,n=2276*y+3406*m+2048>>12,y=3406*y-2276*m+2048>>12,m=n,n=799*D+4017*z+2048>>12,D=4017*D-799*z+2048>>12,z=n,n=C+m,m=C-m,H=I+z,v=I-z,B=J+D,z=J-D,D=G+y,y=G-y,n=16>n?0:4080<=n?255:n>>4,H=16>H?0:4080<=H?255:H>>4,B=16>B?0:4080<=B?255:B>>4,D=16>D?0:4080<=D?255:D>>4,y=16>y?0:4080<=y?255:y>>4,z=16>z?0:4080<=z?
255:z>>4,v=16>v?0:4080<=v?255:v>>4,m=16>m?0:4080<=m?255:m>>4,u[f+w]=n,u[f+w+8]=H,u[f+w+16]=B,u[f+w+24]=D,u[f+w+32]=y,u[f+w+40]=z,u[f+w+48]=v,u[f+w+56]=m)}return b.blockData}function g(a,b,h){var k=a.length-1;h=h<b?h:b;if(b>=k)return null;var l=a[b]<<8|a[b+1];if(65472<=l&&65534>=l)return{invalid:null,marker:l,offset:b};for(b=a[h]<<8|a[h+1];!(65472<=b&&65534>=b);){if(++h>=k)return null;b=a[h]<<8|a[h+1]}return{invalid:l.toString(16),marker:b,offset:h}}if(!self||!self.Uint8ClampedArray)return null;var c=
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]);d.prototype={parse:function(a){function b(){var w=a[l]<<8|a[l+1];l+=2;return w}function h(){var w=b();w=l+w-2;var u=g(a,w,l);u&&u.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+u.invalid),w=u.offset);w=a.subarray(l,w);l+=w.length;return w}function k(w){for(var u=Math.ceil(w.samplesPerLine/
8/w.maxH),E=Math.ceil(w.scanLines/8/w.maxV),K=0;K<w.components.length;K++){r=w.components[K];var Q=Math.ceil(Math.ceil(w.samplesPerLine/8)*r.h/w.maxH),V=Math.ceil(Math.ceil(w.scanLines/8)*r.v/w.maxV);r.blockData=new Int16Array(64*E*r.v*(u*r.h+1));r.blocksPerLine=Q;r.blocksPerColumn=V}w.mcusPerLine=u;w.mcusPerColumn=E}var l=0,e=null,n=null,m=[],v=[],z=[],y=b();if(65496!==y)throw new L("SOI not found");for(y=b();65497!==y;){switch(y){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 D=
h();65504===y&&74===D[0]&&70===D[1]&&73===D[2]&&70===D[3]&&0===D[4]&&(e={version:{major:D[5],minor:D[6]},densityUnits:D[7],xDensity:D[8]<<8|D[9],yDensity:D[10]<<8|D[11],thumbWidth:D[12],thumbHeight:D[13],thumbData:D.subarray(14,14+3*D[12]*D[13])});65518===y&&65===D[0]&&100===D[1]&&111===D[2]&&98===D[3]&&101===D[4]&&(n={version:D[5]<<8|D[6],flags0:D[7]<<8|D[8],flags1:D[9]<<8|D[10],transformCode:D[11]});break;case 65499:y=b()+l-2;for(var B;l<y;){var H=a[l++],G=new Uint16Array(64);if(0===H>>4)for(D=
0;64>D;D++)B=c[D],G[B]=a[l++];else if(1===H>>4)for(D=0;64>D;D++)B=c[D],G[B]=b();else throw new L("DQT - invalid table spec");m[H&15]=G}break;case 65472:case 65473:case 65474:if(J)throw new L("Only single frame JPEGs supported");b();var J={};J.extended=65473===y;J.progressive=65474===y;J.precision=a[l++];J.scanLines=b();J.samplesPerLine=b();J.components=[];J.componentIds={};D=a[l++];for(y=G=H=0;y<D;y++){B=a[l];var I=a[l+1]>>4;var C=a[l+1]&15;H<I&&(H=I);G<C&&(G=C);I=J.components.push({h:I,v:C,quantizationId:a[l+
2],quantizationTable:null});J.componentIds[B]=I-1;l+=3}J.maxH=H;J.maxV=G;k(J);break;case 65476:B=b();for(y=2;y<B;){H=a[l++];G=new Uint8Array(16);for(D=I=0;16>D;D++,l++)I+=G[D]=a[l];C=new Uint8Array(I);for(D=0;D<I;D++,l++)C[D]=a[l];y+=17+I;(0===H>>4?z:v)[H&15]=q(G,C)}break;case 65501:b();var f=b();break;case 65498:b();B=a[l++];D=[];for(y=0;y<B;y++){H=J.componentIds[a[l++]];var r=J.components[H];H=a[l++];r.huffmanTableDC=z[H>>4];r.huffmanTableAC=v[H&15];D.push(r)}y=a[l++];B=a[l++];H=a[l++];y=p(a,l,
J,D,f,y,B,H>>4,H&15);l+=y;break;case 65535:255!==a[l]&&l--;break;default:if(255===a[l-3]&&192<=a[l-2]&&254>=a[l-2])l-=3;else throw new L("unknown marker "+y.toString(16));}y=b()}this.width=J.samplesPerLine;this.height=J.scanLines;this.jfif=e;this.eof=l;this.adobe=n;this.components=[];for(y=0;y<J.components.length;y++){r=J.components[y];if(e=m[r.quantizationId])r.quantizationTable=e;this.components.push({output:t(J,r),scaleX:r.h/J.maxH,scaleY:r.v/J.maxV,blocksPerLine:r.blocksPerLine,blocksPerColumn:r.blocksPerColumn})}this.numComponents=
this.components.length},_getLinearizedBlockData:function(a,b){var h=this.width/a,k=this.height/b,l,e,n=0,m=this.components.length,v=a*b*m,z=new Uint8ClampedArray(v),y=new Uint32Array(a);for(e=0;e<m;e++){var D=this.components[e];var B=D.scaleX*h;var H=D.scaleY*k;n=e;var G=D.output;var J=D.blocksPerLine+1<<3;for(l=0;l<a;l++)D=0|l*B,y[l]=(D&4294967288)<<3|D&7;for(B=0;B<b;B++)for(D=0|B*H,D=J*(D&4294967288)|(D&7)<<3,l=0;l<a;l++)z[n]=G[D+y[l]],n+=m}if(b=this.decodeTransform)for(e=0;e<v;)for(a=D=0;D<m;D++,
e++,a+=2)z[e]=(z[e]*b[a]>>8)+b[a+1];return z},_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 b,h,k,l=0,e=a.length;l<e;l+=3)b=a[l],h=a[l+1],k=a[l+2],a[l]=b-179.456+1.402*k,a[l+1]=b+135.459-.344*h-.714*k,a[l+2]=b-226.816+1.772*h;return a},_convertYcckToRgb:function(a){for(var b,h,k,l,e=0,n=0,m=a.length;n<m;n+=4)b=a[n],h=a[n+1],k=a[n+2],l=a[n+3],a[e++]=
-122.67195406894+h*(-6.60635669420364E-5*h+4.37130475926232E-4*k-5.4080610064599E-5*b+4.8449797120281E-4*l-.154362151871126)+k*(-9.57964378445773E-4*k+8.17076911346625E-4*b-.00477271405408747*l+1.53380253221734)+b*(9.61250184130688E-4*b-.00266257332283933*l+.48357088451265)+l*(-3.36197177618394E-4*l+.484791561490776),a[e++]=107.268039397724+h*(2.19927104525741E-5*h-6.40992018297945E-4*k+6.59397001245577E-4*b+4.26105652938837E-4*l-.176491792462875)+k*(-7.78269941513683E-4*k+.00130872261408275*b+7.70482631801132E-4*
l-.151051492775562)+b*(.00126935368114843*b-.00265090189010898*l+.25802910206845)+l*(-3.18913117588328E-4*l-.213742400323665),a[e++]=-20.810012546947+h*(-5.70115196973677E-4*h-2.63409051004589E-5*k+.0020741088115012*b-.00288260236853442*l+.814272968359295)+k*(-1.53496057440975E-5*k-1.32689043961446E-4*b+5.60833691242812E-4*l-.195152027534049)+b*(.00174418132927582*b-.00255243321439347*l+.116935020465145)+l*(-3.43531996510555E-4*l+.24165260232407);return a},_convertYcckToCmyk:function(a){for(var b,
h,k,l=0,e=a.length;l<e;l+=4)b=a[l],h=a[l+1],k=a[l+2],a[l]=434.456-b-1.402*k,a[l+1]=119.541-b+.344*h+.714*k,a[l+2]=481.816-b-1.772*h;return a},_convertCmykToRgb:function(a){for(var b,h,k,l,e=0,n=1/255,m=0,v=a.length;m<v;m+=4)b=a[m]*n,h=a[m+1]*n,k=a[m+2]*n,l=a[m+3]*n,a[e++]=255+b*(-4.387332384609988*b+54.48615194189176*h+18.82290502165302*k+212.25662451639585*l-285.2331026137004)+h*(1.7149763477362134*h-5.6096736904047315*k-17.873870861415444*l-5.497006427196366)+k*(-2.5217340131683033*k-21.248923337353073*
l+17.5119270841813)-l*(21.86122147463605*l+189.48180835922747),a[e++]=255+b*(8.841041422036149*b+60.118027045597366*h+6.871425592049007*k+31.159100130055922*l-79.2970844816548)+h*(-15.310361306967817*h+17.575251261109482*k+131.35250912493976*l-190.9453302588951)+k*(4.444339102852739*k+9.8632861493405*l-24.86741582555878)-l*(20.737325471181034*l+187.80453709719578),a[e++]=255+b*(.8842522430003296*b+8.078677503112928*h+30.89978309703729*k-.23883238689178934*l-14.183576799673286)+h*(10.49593273432072*
h+63.02378494754052*k+50.606957656360734*l-112.23884253719248)+k*(.03296041114873217*k+115.60384449646641*l-193.58209356861505)-l*(22.33816807309886*l+180.12613974708367);return a},getData:function(a,b,h){if(4<this.numComponents)throw new L("Unsupported color mode");a=this._getLinearizedBlockData(a,b);if(1===this.numComponents&&h){h=a.length;b=new Uint8ClampedArray(3*h);for(var k=0,l=0;l<h;l++){var e=a[l];b[k++]=e;b[k++]=e;b[k++]=e}return b}if(3===this.numComponents&&this._isColorConversionNeeded())return this._convertYccToRgb(a);
if(4===this.numComponents){if(this._isColorConversionNeeded())return h?this._convertYcckToRgb(a):this._convertYcckToCmyk(a);if(h)return this._convertCmykToRgb(a)}return a}};return d}()})},"esri/layers/rasterFormats/Png":function(){define(["./Zlib"],function(L){return function(){function d(p){var t,g;this.data=p;this.pos=8;this.palette=[];this.imgData=[];this.transparency={};this.animation=null;this.text={};for(g=null;;){var c=this.readUInt32();var a=p=void 0;p=[];for(a=0;4>a;++a)p.push(String.fromCharCode(this.data[this.pos++]));
p=p.join("");switch(p){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(c);break;case "fcTL":g&&this.animation.frames.push(g);this.pos+=
4;g={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()};p=this.readUInt16();c=this.readUInt16()||100;g.delay=1E3*p/c;g.disposeOp=this.data[this.pos++];g.blendOp=this.data[this.pos++];g.data=[];break;case "IDAT":case "fdAT":"fdAT"===p&&(this.pos+=4,c-=4);p=(null!=g?g.data:void 0)||this.imgData;for(a=0;0<=c?a<c:a>c;0<=c?++a:--a)p.push(this.data[this.pos++]);break;case "tRNS":this.transparency={};switch(this.colorType){case 3:this.transparency.indexed=
this.read(c);c=255-this.transparency.indexed.length;if(0<c)for(p=0;0<=c?p<c:p>c;0<=c?++p:--p)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(c)[0];break;case 2:this.transparency.rgb=this.read(c)}break;case "tEXt":a=this.read(c);c=a.indexOf(0);p=String.fromCharCode.apply(String,a.slice(0,c));this.text[p]=String.fromCharCode.apply(String,a.slice(c+1));break;case "IEND":g&&this.animation.frames.push(g);a:{switch(this.colorType){case 0:case 3:case 4:g=1;break a;
case 2:case 6:g=3;break a}g=void 0}this.colors=g;this.hasAlphaChannel=4===(t=this.colorType)||6===t;t=this.colors+(this.hasAlphaChannel?1:0);this.pixelBitlength=this.bits*t;a:{switch(this.colors){case 1:t="DeviceGray";break a;case 3:t="DeviceRGB";break a}t=void 0}this.colorSpace=t;this.imgData=new Uint8Array(this.imgData);return;default:this.pos+=c}this.pos+=4;if(this.pos>this.data.length)throw Error("Incomplete or corrupt PNG file");}}d.load=function(p,t,g){"function"===typeof t&&(g=t);var c=new XMLHttpRequest;
c.open("GET",p,!0);c.responseType="arraybuffer";c.onload=function(){var a=new Uint8Array(c.response||c.mozResponseArrayBuffer);a=new d(a);"function"===typeof(null!=t?t.getContext:void 0)&&a.render(t);return"function"===typeof g?g(a):void 0};return c.send(null)};d.prototype.read=function(p){var t;var g=[];for(t=0;0<=p?t<p:t>p;0<=p?++t:--t)g.push(this.data[this.pos++]);return g};d.prototype.readUInt32=function(){var p=this.data[this.pos++]<<24;var t=this.data[this.pos++]<<16;var g=this.data[this.pos++]<<
8;var c=this.data[this.pos++];return p|t|g|c};d.prototype.readUInt16=function(){var p=this.data[this.pos++]<<8;var t=this.data[this.pos++];return p|t};d.prototype.decodePixels=function(p){var t,g,c,a,b,h,k,l;null==p&&(p=this.imgData);if(0===p.length)return new Uint8Array(0);p=new L(p);p=p.getBytes();var e=this.pixelBitlength/8;var n=e*this.width;var m=new Uint8Array(n*this.height);var v=p.length;for(g=a=b=0;a<v;){switch(p[a++]){case 0:for(c=t=0;t<n;c=t+=1)m[g++]=p[a++];break;case 1:for(c=h=0;h<n;c=
h+=1){t=p[a++];var z=c<e?0:m[g-e];m[g++]=(t+z)%256}break;case 2:for(c=z=0;z<n;c=z+=1){t=p[a++];var y=(c-c%e)/e;h=b&&m[(b-1)*n+y*e+c%e];m[g++]=(h+t)%256}break;case 3:for(c=l=0;l<n;c=l+=1)t=p[a++],y=(c-c%e)/e,z=c<e?0:m[g-e],h=b&&m[(b-1)*n+y*e+c%e],m[g++]=(t+Math.floor((z+h)/2))%256;break;case 4:for(c=l=0;l<n;c=l+=1){t=p[a++];y=(c-c%e)/e;z=c<e?0:m[g-e];0===b?h=k=0:(h=m[(b-1)*n+y*e+c%e],k=y&&m[(b-1)*n+(y-1)*e+c%e]);var D=z+h-k;c=Math.abs(D-z);y=Math.abs(D-h);D=Math.abs(D-k);z=c<=y&&c<=D?z:y<=D?h:k;m[g++]=
(t+z)%256}break;default:throw Error("Invalid filter algorithm: "+p[a-1]);}b++}return m};d.prototype.decodePalette=function(){var p,t,g,c,a;var b=this.palette;var h=this.transparency.indexed||[];var k=new Uint8Array((h.length||0)+b.length);var l=g=p=t=0;for(c=b.length;g<c;l=g+=3)k[t++]=b[l],k[t++]=b[l+1],k[t++]=b[l+2],k[t++]=null!=(a=h[p++])?a:255;return k};d.prototype.copyToImageData=function(p,t){var g,c;var a=this.colors;var b=null;var h=this.hasAlphaChannel;this.palette.length&&(b=null!=(g=this._decodedPalette)?
g:this._decodedPalette=this.decodePalette(),a=4,h=!0);p=p.data||p;var k=p.length;var l=b||t;g=c=0;if(1===a)for(;g<k;)a=b?4*t[g/4]:c,c=l[a++],p[g++]=c,p[g++]=c,p[g++]=c,p[g++]=h?l[a++]:this.transparency.grayscale&&this.transparency.grayscale===c?0:255,c=a;else for(;g<k;)a=b?4*t[g/4]:c,p[g++]=l[a++],p[g++]=l[a++],p[g++]=l[a++],p[g++]=h?l[a++]:this.transparency.rgb&&this.transparency.rgb[1]===l[a-3]&&this.transparency.rgb[3]===l[a-2]&&this.transparency.rgb[5]===l[a-1]?0:255,c=a};d.prototype.decode=function(){var p=
new Uint8Array(this.width*this.height*4);this.copyToImageData(p,this.decodePixels());return p};var q=function(p){(void 0).clearRect(0,0,p.width,p.height);(void 0).putImageData(p,0,0);p=new Image;p.src=(void 0).toDataURL();return p};d.prototype.decodeFrames=function(p){var t,g;if(this.animation){var c=this.animation.frames;var a=[];var b=t=0;for(g=c.length;t<g;b=++t){b=c[b];var h=p.createImageData(b.width,b.height);var k=this.decodePixels(new Uint8Array(b.data));this.copyToImageData(h,k);b.imageData=
h;a.push(b.image=q(h))}return a}};d.prototype.renderFrame=function(p,t){var g=this.animation.frames;var c=g[t];g=g[t-1];0===t&&p.clearRect(0,0,this.width,this.height);1===(null!=g?g.disposeOp:void 0)?p.clearRect(g.xOffset,g.yOffset,g.width,g.height):2===(null!=g?g.disposeOp:void 0)&&p.putImageData(g.imageData,g.xOffset,g.yOffset);0===c.blendOp&&p.clearRect(c.xOffset,c.yOffset,c.width,c.height);return p.drawImage(c.image,c.xOffset,c.yOffset)};d.prototype.animate=function(p){var t,g=this;var c=0;var a=
this.animation;var b=a.numFrames;var h=a.frames;var k=a.numPlays;return(t=function(){var l=c++%b;var e=h[l];g.renderFrame(p,l);if(1<b&&c/b<k)return g.animation._timeout=setTimeout(t,e.delay)})()};d.prototype.stopAnimation=function(){var p;return clearTimeout(null!=(p=this.animation)?p._timeout:void 0)};d.prototype.render=function(p){p._png&&p._png.stopAnimation();p._png=this;p.width=this.width;p.height=this.height;p=p.getContext("2d");if(this.animation)return this.decodeFrames(p),this.animate(p);
var t=p.createImageData(this.width,this.height);this.copyToImageData(t,this.decodePixels());return p.putImageData(t,0,0)};return d}()})},"esri/layers/rasterFormats/Raw":function(){define([],function(){return{decodeBIP:function(L,d){var q=d.pixelType,p=d.bandCount,t=[],g=d.width*d.height,c=this.getBandCount(L,d);p=p||c;var a=L.byteLength-L.byteLength%(g*this._getPixelLength(q)),b=new q(L,0,g*c),h,k,l;for(h=0;h<p;h++){var e=new q(g);for(k=0;k<g;k++)e[k]=b[k*c+h];t.push(e)}a<L.byteLength-1&&(l=this._decodeMask(L.slice(a),
d));return{pixels:t,maskData:l}},decodeBSQ:function(L,d){var q=d.pixelType,p=d.bandCount;if(void 0===p||null===p)p=this.getBandCount(L,d);var t=[],g=d.width*d.height,c=g*p,a=L.byteLength-L.byteLength%(g*this._getPixelLength(q));q=new q(L,0,c);var b;for(c=0;c<p;c++)t.push(q.subarray(c*g,(c+1)*g));a<L.byteLength-1&&(b=this._decodeMask(L.slice(a),d));return{pixels:t,maskData:b}},getBandCount:function(L,d){return Math.floor(L.byteLength/(d.width*d.height*this._getPixelLength(d.pixelType)))},_getPixelLength:function(L){var d=
1;switch(L){case Uint8Array:case Int8Array:case Uint8ClampedArray:d=1;break;case Uint16Array:case Int16Array:d=2;break;case Uint32Array:case Int32Array:case Float32Array:d=4;break;case Float64Array:d=8}return d},_decodeMask:function(L,d){var q=d.width*d.height;if(8*L.byteLength<q)return null;L=new Uint8Array(L,0,Math.ceil(q/8));d=new Uint8Array(d.width*d.height);var p=0,t=0,g=0,c=0;for(g=0;g<L.length-1;g++)for(t=L[g],c=7;0<=c;c--)d[p++]=t>>c&1;for(c=7;p<q-1;)t=L[L.length-1],d[p++]=t>>c&1,c--;return d}}})},
"esri/layers/rasterFormats/TiffDecoder":function(){define(["./Jpg","./Zlib"],function(L,d){var q=function(){var c=new ArrayBuffer(4),a=new Uint8Array(c);c=new Uint32Array(c);a[0]=1;a[1]=2;a[2]=3;a[3]=4;return 67305985===c[0]},p=function(){var c=[];c[254]="NEWSUBFILETYPE";c[255]="SUBFILETYPE";c[256]="IMAGEWIDTH";c[257]="IMAGELENGTH";c[258]="BITSPERSAMPLE";c[259]="COMPRESSION";c[262]="PHOTOMETRICINTERPRETATION";c[263]="THRESHHOLDING";c[264]="CELLWIDTH";c[265]="CELLLENGTH";c[266]="FILLORDER";c[269]=
"DOCUMENTNAME";c[270]="IMAGEDESCRIPTION";c[271]="MAKE";c[272]="MODEL";c[273]="STRIPOFFSETS";c[274]="ORIENTATION";c[277]="SAMPLESPERPIXEL";c[278]="ROWSPERSTRIP";c[279]="STRIPBYTECOUNTS";c[280]="MINSAMPLEVALUE";c[281]="MAXSAMPLEVALUE";c[282]="XRESOLUTION";c[283]="YRESOLUTION";c[284]="PLANARCONFIGURATION";c[285]="PAGENAME";c[286]="XPOSITION";c[287]="YPOSITION";c[288]="FREEOFFSETS";c[289]="FREEBYTECOUNTS";c[290]="GRAYRESPONSEUNIT";c[291]="GRAYRESPONSECURVE";c[292]="T4OPTIONS";c[293]="T6OPTIONS";c[296]=
"RESOLUTIONUNIT";c[297]="PAGENUMBER";c[300]="COLORRESPONSEUNIT";c[301]="TRANSFERFUNCTION";c[305]="SOFTWARE";c[306]="DATETIME";c[315]="ARTIST";c[316]="HOSTCOMPUTER";c[317]="PREDICTOR";c[318]="WHITEPOINT";c[319]="PRIMARYCHROMATICITIES";c[320]="COLORMAP";c[321]="HALFTONEHINTS";c[322]="TILEWIDTH";c[323]="TILELENGTH";c[324]="TILEOFFSETS";c[325]="TILEBYTECOUNTS";c[326]="BADFAXLINES";c[327]="CLEANFAXDATA";c[328]="CONSECUTIVEBADFAXLINES";c[330]="SUBIFD";c[332]="INKSET";c[333]="INKNAMES";c[334]="NUMBEROFINKS";
c[336]="DOTRANGE";c[337]="TARGETPRINTER";c[338]="EXTRASAMPLES";c[339]="SAMPLEFORMAT";c[340]="SMINSAMPLEVALUE";c[341]="SMAXSAMPLEVALUE";c[342]="TRANSFERRANGE";c[347]="JPEGTABLES";c[512]="JPEGPROC";c[513]="JPEGIFOFFSET";c[514]="JPEGIFBYTECOUNT";c[515]="JPEGRESTARTINTERVAL";c[517]="JPEGLOSSLESSPREDICTORS";c[518]="JPEGPOINTTRANSFORM";c[519]="JPEGQTABLES";c[520]="JPEGDCTABLES";c[521]="JPEGACTABLES";c[529]="YCBCRCOEFFICIENTS";c[530]="YCBCRSUBSAMPLING";c[531]="YCBCRPOSITIONING";c[532]="REFERENCEBLACKWHITE";
c[33550]="GEOPIXELSCALE";c[33922]="GEOTIEPOINTS";c[33432]="COPYRIGHT";c[42112]="GDAL_METADATA";c[42113]="GDAL_NODATA";c[50844]="RPCCOEFFICIENT";c[34735]="GEOKEYDIRECTORY";c[34736]="GEODOUBLEPARAMS";c[34737]="GEOASCIIPARAMS";return c}(),t=[0,1,1,2,4,8,1,1,2,4,8,4,8],g=function(c,a){var b="UNKNOWN";3===c?b="F32":1===c?8>=a?b="U8":16>=a?b="U16":32>=a&&(b="U32"):2===c&&(8>=a?b="S8":16>=a?b="S16":32>=a&&(b="S32"));return b};return{decode:function(c){var a=new DataView(c,0,8),b=a.getUint16(0,!1);if(18761===
b)var h=!0;else if(19789===b)h=!1;else throw"unexpected endianess byte";if(42!==a.getUint16(2,h))throw"unexpected tiff identifier";var k=a.getUint32(4,h);var l=h;var e,n;var m=k;for(var v=[];m;){var z=(new DataView(c,m,2)).getUint16(0,l);var y=m+2;m=(new DataView(c,y+12*z,4)).getUint32(0,l);var D={};for(e=0;e<z;e++){var B=new DataView(c,y,12);var H=B.getUint16(0,l);var G=B.getUint16(2,l);var J=B.getUint32(4,l);var I=B.getUint32(8,l);y+=12;if(!(7===G||12<G)){var C=n={fieldTag:H,fieldType:G,fieldValueCount:J,
fieldValueOffset:I},f=void 0,r=void 0,w=c,u=l,E=[],K=n.fieldType,Q=n.fieldValueCount,V=n.fieldValueOffset,W=V,Y=t[K],ja=8*Y,ba=Q*Y,fa=Q*t[K]*8;if(32>=fa)if(u||(V>>>=32-fa),1===Q)E=[V];else for(f=0;f<Q;f++)E.push(V<<ja*f>>>32-ja);else for(W=V;W<V+ba;W+=Y){switch(K){case 1:r=(new DataView(w,W,1)).getUint8(0);break;case 2:r=(new DataView(w,W,1)).getUint8(0);break;case 3:r=(new DataView(w,W,2)).getUint16(0,u);break;case 4:r=(new DataView(w,W,4)).getUint32(0,u);break;case 5:r=(new DataView(w,W,4)).getUint32(0,
u)/(new DataView(w,W+4,4)).getUint32(0,u);break;case 6:r=(new DataView(w,W,1)).getInt8(0);break;case 8:r=(new DataView(w,W,2)).getInt16(0,u);break;case 9:r=(new DataView(w,W,4)).getInt32(0,u);break;case 10:r=(new DataView(w,W,4)).getInt32(0,u)/(new DataView(w,W+4,4)).getInt32(0,u);break;case 11:r=(new DataView(w,W,4)).getFloat32(0,u);break;case 12:r=(new DataView(w,W,8)).getFloat64(0,u);break;case 7:r=null;break;default:r=null}E.push(r)}if(2===K){var ua="",xa=E;E=[];for(f=0;f<xa.length;f++)0===xa[f]&&
""!==ua?(E.push(ua),ua=""):ua+=String.fromCharCode(xa[f]);""===ua&&0!==E.length||E.push(ua)}C.fieldValues=E;var va=D,P=p[H];void 0===P&&(P="unknown"+H);va[P]={type:G,values:n.fieldValues}}}v.push(D)}if(0===v.length)throw"no valid image file directory";var N,A=v[0],M=void 0===A.GDAL_NODATA||null===A.GDAL_NODATA?null:parseFloat(A.GDAL_NODATA.values[0]);if(A.TILEOFFSETS){var O=q()===l,U=A.TILEOFFSETS?A.TILEOFFSETS.values:void 0;if(void 0===U)var X=void 0;else{var ia=A.TILEBYTECOUNTS.values,ca=A.TILEWIDTH.values[0],
S=A.TILELENGTH.values[0],ea=A.IMAGEWIDTH.values[0],na=A.IMAGELENGTH.values[0],ha=ea*na,ma=A.BITSPERSAMPLE.values[0],x=A.SAMPLESPERPIXEL.values[0],F=A.SAMPLEFORMAT?A.SAMPLEFORMAT.values[0]:1,T=g(F,ma);if(1!==(A.PLANARCONFIGURATION?A.PLANARCONFIGURATION.values[0]:1))throw console.log("can only handle PLANARCONFIGURATION\x3d1"),"can only handle PLANARCONFIGURATION\x3d1";var R=A.COMPRESSION?A.COMPRESSION.values[0]:1;if(1!==R&&6!==R&&8!==R&&32946!==R)throw console.log("this compression is not supported at this moment"),
"this compression is not supported at this moment";if(3<F)X=void 0;else{if(3===F){var aa=new Float32Array(ha*x);var Z=Float32Array}else 1===F?8>=ma?(aa=new Uint8Array(ha*x),Z=Uint8Array):16>=ma?(aa=new Uint16Array(ha*x),Z=Uint16Array):32>=ma&&(aa=new Uint32Array(ha*x),Z=Uint32Array):2===F&&(8>=ma?(aa=new Int8Array(ha*x),Z=Int8Array):16>=ma?(aa=new Int16Array(ha*x),Z=Int16Array):32>=ma&&(aa=new Int32Array(ha*x),Z=Int32Array));var da,ka,la,pa,Ba,ta=Math.ceil(ea/ca);if(0===ma%8)for(da=0;da<U.length;da++){var qa=
Math.floor(da/ta)*S;var ra=da%ta*ca;var oa=(qa*ea+ra)*x;if("U8"===T||"S8"===T||O)if(8===R||32946===R){var sa=new Uint8Array(c,U[da],ia[da]);var za=new d(sa);var Oa=za.getBytes();var Ea=new ArrayBuffer(Oa.length);sa=new Uint8Array(Ea);sa.set(Oa);sa.length!==ca*S*x*ma/8&&console.log("tile byte counts is different than expected")}else if(6===R){sa=new Uint8Array(c,U[da],ia[da]);var Aa=new L;Aa.parse(sa);var Wa=Aa.getData(Aa.width,Aa.height);Ea=new ArrayBuffer(Wa.length);sa=new Uint8Array(Ea);sa.set(Wa)}else 1===
R&&(ia[da]!==ca*S*x*ma/8&&console.log("tile byte counts is different than expected"),Ea=c.slice(U[da],U[da]+ia[da]));else{if(8===R||32946===R){sa=new Uint8Array(c,U[da],ia[da]);za=new d(sa);sa=za.getBytes();Ea=new ArrayBuffer(sa.length);var Pa=new Uint8Array(Ea);sa.length!==ca*S*x*ma/8&&console.log("tile byte counts is different than expected")}else 1===R&&(ia[da]!==ca*S*x*ma/8&&console.log("tile byte counts is different than expected"),Ea=new ArrayBuffer(ia[da]),sa=new Uint8Array(c,U[da],ia[da]),
Pa=new Uint8Array(Ea));switch(T){case "U16":case "S16":for(la=0;la<sa.length;la+=2)Pa[la]=sa[la+1],Pa[la+1]=sa[la];break;case "U32":case "S32":case "F32":for(la=0;la<sa.length;la+=4)Pa[la]=sa[la+3],Pa[la+1]=sa[la+2],Pa[la+2]=sa[la+1],Pa[la+3]=sa[la]}}var hb=new Z(Ea);var ab=0;var bb=oa;var ib=Math.min(ca,ea-ra);var jb=Math.min(S,na-qa);for(pa=0;pa<jb;pa++)for(bb=oa+pa*ea*x,ab=pa*ca*x,Ba=0;Ba<ib*x;Ba++,bb++,ab++)aa[bb]=hb[ab]}var Xa={width:ea,height:na,pixelType:T};if(1===x)Xa.pixels=[aa];else for(Xa.pixels=
[],da=0;da<x;da++){var db=new Z(ha);for(ka=0;ka<ha;ka++)db[ka]=aa[ka*x+da];Xa.pixels.push(db)}X=Xa}}}else if(A.STRIPOFFSETS){var kb=q()===l,Ja=A.STRIPOFFSETS?A.STRIPOFFSETS.values:void 0;if(void 0===Ja)X=void 0;else{var Ka=A.STRIPBYTECOUNTS.values,Ra=A.ROWSPERSTRIP.values,La=A.IMAGEWIDTH.values[0],Sa=A.IMAGELENGTH.values[0],Ma=La*Sa,Fa=A.BITSPERSAMPLE.values[0],Da=A.SAMPLESPERPIXEL.values[0],Ta=A.SAMPLEFORMAT?A.SAMPLEFORMAT.values[0]:1,Ya=g(Ta,Fa);if(1!==(A.PLANARCONFIGURATION?A.PLANARCONFIGURATION.values[0]:
1))throw console.log("can only handle PLANARCONFIGURATION\x3d1"),"can only handle PLANARCONFIGURATION\x3d1";var Ga=A.COMPRESSION?A.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)X=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 wa,Ua,Ca,Va=Ra;if(0===Fa%8)for(wa=0;wa<Ja.length;wa++){var lb=wa*Ra*La*Da;Va=(wa+1)*Ra>Sa?Sa-wa*Ra:Ra;if("U8"===Ya||"S8"===Ya||kb)if(8===Ga||32946===Ga){var ya=new Uint8Array(c,Ja[wa],Ka[wa]);var cb=new d(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(c,Ja[wa],Ka[wa]);var Za=new L;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[wa]!==Va*La*Da*Fa/8&&console.log("strip byte counts is different than expected"),Ia=c.slice(Ja[wa],Ja[wa]+Ka[wa]));else{if(6===Ga||8===Ga||32946===Ga){ya=new Uint8Array(c,Ja[wa],Ka[wa]);cb=new d(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[wa]!==Va*La*Da*Fa/8&&console.log("strip byte counts is different than expected"),Ia=new ArrayBuffer(Ka[wa]),ya=new Uint8Array(c,Ja[wa],Ka[wa]),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=[],wa=0;wa<Da;wa++){var gb=new Na(Ma);for(Ua=0;Ua<Ma;Ua++)gb[Ua]=Ha[Ua*Da+wa];$a.pixels.push(gb)}X=$a}}}if(null!==M){X.maskData=new Uint8Array(X.width*X.height);if(1E24<Math.abs(M))for(N=0;N<X.width*X.height;N++)X.maskData[N]=1E-6>Math.abs((X.pixels[0][N]-M)/M)?0:1;else for(N=0;N<X.width*X.height;N++)X.maskData[N]=X.pixels[0][N]===M?0:
1;X.noDataValue=M}return X}}})},"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(L,d,q,p,t,g,c,a,b,h,k,l){function e(n){var m=new p;t(n).then(function(v){m.resolve()});return m.promise}
return function(){function n(m){this.customModules=m&&m.customModules}n.prototype.destroy=function(){this.stop();this.customModules=this.rasterLayer=null};n.prototype.start=function(){this.stop();var m=new p,v=0,z=this.customModules?this.customModules.length+1:1,y=b.getAbsMid("esri/layers/rasterLib/tile/RasterWorker",L,q),D=c.open(y,{client:this}).then(function(B){this._connection=B;v++;v===z&&(this._connected=!0,m.resolve())}.bind(this));this._openDL=[D];this.customModules&&this.customModules.forEach(function(B){D=
c.open(B,{client:this}).then(function(H){v++;v===z&&(this._connected=!0,m.resolve())});this._openDL.push(D);console.log(B)}.bind(this));return this._connectionPromise=m.promise};n.prototype.stop=function(){this._openDL?this._openDL.forEach(function(m){m.isFulfilled()||m.cancel()}.bind(this)):this._connectionPromise&&!this._connectionPromise.isFulfilled()&&this._connectionPromise.cancel();this._connection&&(this._connection.close(),this._connection=null)};n.prototype.decode=function(m){if(!this._connectionPromise.isFulfilled()||
!this._connection)return a.reject(Error("no connection"));var v={id:null};return this._connection.invoke("decode",m,[],v).then(function(z){z.targetWorker=v;return z})};n.prototype.process=function(m){if(!this._connectionPromise.isFulfilled()||!this._connection)return a.reject(Error("no connection"));var v={id:null};m.layerId=this.rasterLayer.layerId;var z=new p;this._connection.invoke("process",m,[],v).then(function(y){y.targetWorker=v;y.src?Object.keys(y.src).forEach(function(D){y.src[D].pixelBlock=
new g(y.src[D].pixelBlock)}):y.src=null;y.pixelBlock&&(y.pixelBlock=new g(y.pixelBlock));z.resolve(y)});return z.promise};n.prototype.render=function(m){if(!this._connectionPromise.isFulfilled()||!this._connection)return a.reject(Error("no connection"));var v={id:null};m.layerId=this.rasterLayer.layerId;return this._connection.invoke("render",m,[],v).then(function(z){z.targetWorker=v;z.pixelBlock=z.pixelBlock?new g(z.pixelBlock):null;return z})};n.prototype.setLayer=function(m){if(!this._connectionPromise.isFulfilled()||
!this._connection)return a.reject(Error("no connection"));this.rasterLayer=m;m=this._connection.broadcast("setLayer",m,[],{id:null});return e(m)};n.prototype.setRasterFunction=function(m){if(!this._connectionPromise.isFulfilled()||!this._connection)return a.reject(Error("no connection"));m=this._connection.broadcast("setRasterFunction",m,[],{id:null});return e(m)};n.prototype.setRasterRenderer=function(m){if(!this._connectionPromise.isFulfilled()||!this._connection)return a.reject(Error("no connection"));
m=this._connection.broadcast("setRasterRenderer",m,[],{id:null});return e(m)};return n}()})},"esri/layers/vectorTiles/core/workers":function(){define(["require","exports","./workers/workers"],function(L,d,q){Object.defineProperty(d,"__esModule",{value:!0});for(var p in q)d.hasOwnProperty(p)||(d[p]=q[p])})},"esri/layers/vectorTiles/core/workers/workers":function(){define("require exports dojo/sniff dojo/promise/all ../Logger ../promiseUtils ./Connection ./RemoteClient ./WorkerOwner".split(" "),function(L,
d,q,p,t,g,c,a,b){function h(){if(v)return v;for(var z=k+l,y=[],D=function(H){var G=b.create(H).then(function(J){return m[H]=J});y.push(G)},B=0;B<z;B++)D(B);return v=p(y).then(function(){})}Object.defineProperty(d,"__esModule",{value:!0});d.Connection=c;d.RemoteClient=a;(c=navigator.hardwareConcurrency)||(c=q("safari")&&q("mac")||q("trident")?8:2);var k=q("esri-workers-debug")?1:Math.max(1,Math.ceil(c/2)),l=q("esri-workers-debug")?1:Math.max(1,Math.floor(c/2)),e=t.getLogger("esri.core.workers"),n=
0,m=[];d.initialize=function(){h()};d.open=function(z,y,D){void 0===y&&(y={});if(Array.isArray(z))return new d.Connection(z.map(function(G){return new d.RemoteClient(G,y.client)}));if("string"!==typeof z){e.warn("workers-open:signature-deprecated","DEPRECATED: workers.open() changed signature.");var B=z;z=y;y={client:B,strategy:D?"dedicated":"distributed"}}var H=y.strategy||"distributed";return"local"===H?g.create(function(G){L([z],function(J){G(d.RemoteClient.connect(J))})}).then(function(G){return new d.Connection([new d.RemoteClient(G,
y.client)])}):h().then(function(){if("dedicated"===H){var G=k+n++;n%=l;return m[G].open(z).then(function(J){return new d.Connection([new d.RemoteClient(J,y.client)])})}return g.all(m.map(function(J){return J.open(z)})).then(function(J){return new d.Connection(J.map(function(I){return new d.RemoteClient(I,y.client)}))})})};d.terminate=function(){for(var z=0;z<m.length;z++)m[z]&&m[z].terminate();m.length=0};var v})},"esri/layers/vectorTiles/core/Logger":function(){define(["require","exports","dojo/has"],
function(L,d,q){var p={info:0,warn:1,error:2};L=function(){function t(g){void 0===g&&(g={});this.module=g.module||"";this.writer=g.writer||null;this.level=g.level||null;null!=g.enabled&&(this.enabled=!!g.enabled);t._loggers[this.module]=this;g=this.module.lastIndexOf(".");-1!==g&&(this.parent=t.getLogger(this.module.slice(0,g)))}t.prototype.log=function(g){for(var c=[],a=1;a<arguments.length;a++)c[a-1]=arguments[a];this._isEnabled()&&this._matchLevel(g)&&(a=this._inheritedWriter())&&a.apply(void 0,
[g,this.module].concat(c))};t.prototype.error=function(){for(var g=[],c=0;c<arguments.length;c++)g[c]=arguments[c];this.log.apply(this,["error"].concat(g))};t.prototype.warn=function(){for(var g=[],c=0;c<arguments.length;c++)g[c]=arguments[c];this.log.apply(this,["warn"].concat(g))};t.prototype.info=function(){for(var g=[],c=0;c<arguments.length;c++)g[c]=arguments[c];this.log.apply(this,["info"].concat(g))};t.prototype.getLogger=function(g){return t.getLogger(this.module+"."+g)};t.getLogger=function(g){var c=
t._loggers[g];c||(c=new t({module:g}));return c};t.prototype._parentWithMember=function(g,c){for(var a=this;a&&null==a[g];)a=a.parent;return a?a[g]:c};t.prototype._inheritedWriter=function(){return this._parentWithMember("writer",this._consoleWriter)};t.prototype._consoleWriter=function(g,c){for(var a=[],b=2;b<arguments.length;b++)a[b-2]=arguments[b];console[g].apply(console,["["+c+"]"].concat(a))};t.prototype._matchLevel=function(g){return p[this._parentWithMember("level","error")]<=p[g]};t.prototype._isEnabled=
function(){return this._parentWithMember("enabled",!0)};t._loggers={};return t}();d=L.getLogger("esri");q("dojo-debug-messages")?d.level="info":d.level="warn";return L})},"esri/layers/vectorTiles/core/promiseUtils":function(){define("require exports dojo/Deferred dojo/when dojo/promise/all ./Error".split(" "),function(L,d,q,p,t,g){function c(a){if(a){if("function"!==typeof a.forEach){var b=Object.keys(a),h=b.map(function(n){return a[n]});return c(h).then(function(n){var m={};b.forEach(function(v,
z){return m[v]=n[z]});return m})}var k=new q,l=[],e=a.length;0===e&&k.resolve(l);a.forEach(function(n){var m={promise:n};l.push(m);n.then(function(v){m.value=v}).catch(function(v){m.error=v}).then(function(){--e;0===e&&k.resolve(l)})});return k.promise}}Object.defineProperty(d,"__esModule",{value:!0});d.all=function(a){return t(a)};d.filter=function(a,b){var h=a.slice();return t(a.map(function(k,l){return b(k,l)})).then(function(k){return h.filter(function(l,e){return k[e]})})};d.eachAlways=c;d.create=
function(a,b){var h=new q(b);a(function(k){void 0===k&&(k=null);return p(k).then(h.resolve)},h.reject);return h.promise};d.reject=function(a){var b=new q;b.reject(a);return b.promise};d.resolve=function(a){void 0===a&&(a=null);var b=new q;b.resolve(a);return b.promise};d.after=function(a,b){void 0===b&&(b=null);var h=0,k=new q(function(){h&&(clearTimeout(h),h=0)});h=setTimeout(function(){k.resolve(b)},a);return k.promise};d.timeout=function(a,b,h){var k=0,l=new q(a.cancel);a.then(function(e){l.isFulfilled()||
(l.resolve(e),k&&(clearTimeout(k),k=0))});a.catch(function(e){l.isFulfilled()||(l.reject(e),k&&(clearTimeout(k),k=0))});k=setTimeout(function(){var e=h||new g("promiseUtils:timeout","The wrapped promise did not resolve within "+b+" ms");l.reject(e)},b);return l.promise};d.wrapCallback=function(a){var b=!1,h=new q(function(){return b=!0});a(function(k){b||h.resolve(k)});return h.promise};d.isThenable=function(a){return a&&"function"===typeof a.then};d.when=function(a){return p(a)}})},"esri/layers/vectorTiles/core/Error":function(){define(["require",
"exports","./tsSupport/extendsHelper","./lang","./Message"],function(L,d,q,p,t){L=function(g){function c(a,b,h){var k=g.call(this,a,b,h)||this;return k instanceof c?k:new c(a,b,h)}q(c,g);c.prototype.toJSON=function(){return{name:this.name,message:this.message,details:p.clone(this.details),dojoType:this.dojoType}};c.fromJSON=function(a){var b=new c(a.name,a.message,a.details);null!=a.dojoType&&(b.dojoType=a.dojoType);return b};return c}(t);L.prototype.type="error";return L})},"esri/layers/vectorTiles/core/tsSupport/extendsHelper":function(){define([],
function(){return function(){var L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,q){d.__proto__=q}||function(d,q){for(var p in q)q.hasOwnProperty(p)&&(d[p]=q[p])};return function(d,q){function p(){this.constructor=d}L(d,q);d.prototype=null===q?Object.create(q):(p.prototype=q.prototype,new p)}}()})},"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(L,d,q,p,
t,g){function c(n){return void 0!==n&&null!==n}function a(n){return c(n)?n:""}function b(n,m,v){var z=v.match(/([^\(]+)(\([^\)]+\))?/i),y=d.trim(z[1]);v=m[n];z=JSON.parse((z[2]?d.trim(z[2]):"{}").replace(/^\(/,"{").replace(/\)$/,"}").replace(/([{,])\s*([0-9a-zA-Z_]+)\s*:/gi,'$1"$2":').replace(/"\s*:\s*'/gi,'":"').replace(/'\s*(,|\})/gi,'"$1'));var D=z.utcOffset;if(-1===l.indexOf(y))y=d.getObject(y),d.isFunction(y)&&(v=y(v,n,m,z));else if("number"===typeof v||"string"===typeof v&&v&&!isNaN(Number(v)))switch(v=
Number(v),y){case "NumberFormat":n=d.mixin({},z);m=parseFloat(n.places);if(isNaN(m)||0>m)n.places=Infinity;return p.format(v,n);case "DateString":v=new Date(v);if(z.local||z.systemLocale)return z.systemLocale?v.toLocaleDateString()+(z.hideTime?"":" "+v.toLocaleTimeString()):v.toDateString()+(z.hideTime?"":" "+v.toTimeString());v=v.toUTCString();z.hideTime&&(v=v.replace(/\s+\d\d:\d\d:\d\d\s+(utc|gmt)/i,""));return v;case "DateFormat":return v=new Date(v),c(D)&&(v=q.add(v,"minute",v.getTimezoneOffset()-
D)),t.format(v,z)}return a(v)}function h(n,m){var v;if(m)for(v in n)n.hasOwnProperty(v)&&(void 0===n[v]?delete n[v]:n[v]instanceof Object&&h(n[v],!0));else for(v in n)n.hasOwnProperty(v)&&void 0===n[v]&&delete n[v];return n}function k(n){if(!n||"object"!=typeof n||d.isFunction(n))return n;if(n instanceof Int8Array||n instanceof Uint8Array||n instanceof Uint8ClampedArray||n instanceof Int16Array||n instanceof Int32Array||n instanceof Uint16Array||n instanceof Uint32Array||n instanceof Float32Array||
n instanceof Float64Array||n instanceof Date)return new n.constructor(n);if(n instanceof ArrayBuffer)return n.slice(0,n.byteLength);if("function"===typeof n.clone)n=n.clone();else if("function"===typeof n.map&&"function"===typeof n.forEach)n=n.map(k);else if("function"===typeof n.notifyChange&&"function"===typeof n.watch)n=n.clone();else{var m={},v,z={};for(v in n){var y=n[v];var D=!(v in z)||z[v]!==y;if(!(v in m)||m[v]!==y&&D)m[v]=k?k(y):y}n=m}return n}var l=["NumberFormat","DateString","DateFormat"],
e=/<\/?[^>]+>/g;return{equals:function(n,m){return n===m||"number"===typeof n&&isNaN(n)&&"number"===typeof m&&isNaN(m)||d.isFunction((n||{}).getTime)&&d.isFunction((m||{}).getTime)&&n.getTime()==m.getTime()||d.isFunction((n||{}).equals)&&n.equals(m)||d.isFunction((m||{}).equals)&&m.equals(n)||!1},mixin:d.mixin,valueOf:function(n,m){for(var v in n)if(n[v]==m)return v;return null},stripTags:function(n){if(n){var m=typeof n;if("string"===m)n=n.replace(e,"");else if("object"===m)for(var v in n)(m=n[v])&&
"string"===typeof m&&(m=m.replace(e,"")),n[v]=m}return n},substitute:function(n,m,v){if(c(v))if(d.isObject(v)){var z=v.first;var y=v.dateFormat;var D=v.numberFormat}else z=v;if(m&&"{*}"!==m)return d.replace(m,d.hitch({obj:n},function(H,G){H=G.split(":");return 1<H.length?(G=H[0],H.shift(),b(G,this.obj,H.join(":"))):y&&-1!==(y.properties||[]).indexOf(G)?b(G,this.obj,y.formatter||"DateString"):D&&-1!==(D.properties||[]).indexOf(G)?b(G,this.obj,D.formatter||"NumberFormat"):a(this.obj[G])}));m=[];var B;
m.push('\x3ctable class\x3d"esri-widget__table" summary\x3d"'+g.fieldsSummary+'"\x3e\x3ctbody\x3e');for(B in n)if(v=n[B],y&&-1!==(y.properties||[]).indexOf(B)?v=b(B,n,y.formatter||"DateString"):D&&-1!==(D.properties||[]).indexOf(B)&&(v=b(B,n,D.formatter||"NumberFormat")),m.push("\x3ctr\x3e\x3cth\x3e"+B+"\x3c/th\x3e\x3ctd\x3e"+a(v)+"\x3c/td\x3e\x3c/tr\x3e"),z)break;m.push("\x3c/tbody\x3e\x3c/table\x3e");return m.join("")},filter:function(n,m,v){m=[d.isString(n)?n.split(""):n,v||L.global,d.isString(m)?
new Function("item","index","array",m):m];v={};var z;n=m[0];for(z in n)m[2].call(m[z],n[z],z,n)&&(v[z]=n[z]);return v},startsWith:function(n,m,v){v=v||0;return n.indexOf(m,v)===v},endsWith:function(n,m,v){if("number"!==typeof v||!isFinite(v)||Math.floor(v)!==v||v>n.length)v=n.length;v-=m.length;n=n.indexOf(m,v);return-1!==n&&n===v},isDefined:c,fixJson:h,clone:k}})},"esri/layers/vectorTiles/core/Message":function(){define(["require","exports","dojo/string"],function(L,d,q){return function(){function p(t,
g,c){this instanceof p&&(this.name=t,this.message=g&&q.substitute(g,c,function(a){return null==a?"":a})||"",this.details=c)}p.prototype.toString=function(){return"["+this.name+"]: "+this.message};return p}()})},"esri/layers/vectorTiles/core/workers/Connection":function(){define(["require","exports","../promiseUtils"],function(L,d,q){return function(){function p(t){this._clientIdx=0;this._clients=t}p.prototype.broadcast=function(t,g,c){for(var a=[],b=0,h=this._clients;b<h.length;b++)a.push(h[b].invoke(t,
g,c));return a};p.prototype.close=function(){for(var t=0,g=this._clients;t<g.length;t++)g[t].close();this._clients=[]};p.prototype.invoke=function(t,g,c,a){var b=a&&a.client;if(!this._clients||!this._clients.length)return q.reject(Error("Connection closed"));null!=b&&-1!==this._clients.indexOf(b)||this._clients.some(function(h){return h.isBusy()?!1:(b=h,!0)})||(this._clientIdx=(this._clientIdx+1)%this._clients.length,b=this._clients[this._clientIdx]);t=b.invoke(t,g,c);a&&(a.client=b);return t};p.prototype.openPorts=
function(){return q.all(this._clients.map(function(t){return t.openPort()}))};return p}()})},"esri/layers/vectorTiles/core/workers/RemoteClient":function(){define("require exports dojo/Deferred ../Error ../promiseUtils ./utils".split(" "),function(L,d,q,p,t,g){function c(n,m){n["delete"](m)}var a=g.MessageType.CLOSE,b=g.MessageType.CANCEL,h=g.MessageType.INVOKE,k=g.MessageType.RESPONSE,l=g.MessageType.OPEN_PORT,e=function(){function n(m){this._timer=null;this._cancelledJobIds=new Set;this._invokeMessages=
[];this._invoke=m;this._timer=null;this._process=this._process.bind(this)}n.prototype.push=function(m){m.type===g.MessageType.CANCEL?this._cancelledJobIds.add(m.jobId):(this._invokeMessages.push(m),null===this._timer&&(this._timer=setTimeout(this._process,0)))};n.prototype.clear=function(){this._invokeMessages.length=0;this._cancelledJobIds.clear();this._timer=null};n.prototype._process=function(){this._timer=null;for(var m=0,v=this._invokeMessages;m<v.length;m++){var z=v[m];this._cancelledJobIds.has(z.jobId)||
this._invoke(z)}this._cancelledJobIds.clear();this._invokeMessages.length=0};return n}();return function(){function n(m,v,z){this._outJobs=new Map;this._inJobs=new Map;this._queue=new e(this._onInvoke.bind(this));this._onMessage=this._onMessage.bind(this);this._client=v;this._port=m;this._port.addEventListener("message",this._onMessage);this._port.start();this._channel=z}n.connect=function(m){var v=new MessageChannel;m="function"===typeof m?new m:"default"in m&&"function"===typeof m.default?new m.default:
m;m.remoteClient=new n(v.port1,m,v);return v.port2};n.prototype.close=function(){this._post({type:a});this._close()};n.prototype.isBusy=function(){return 0<this._outJobs.size};n.prototype.invoke=function(m,v,z){var y=this;if(!this._port)return t.reject(new p("remote-client:port-closed","Can't invoke(), port is closed"));var D=g.newJobId(),B=new q(function(){c(y._outJobs,D);y._post({type:b,jobId:D})});this._outJobs.set(D,B);this._post({type:h,jobId:D,methodName:m},v,z);return B.promise};n.prototype.openPort=
function(){var m=this,v=g.newJobId(),z=new q(function(){c(m._outJobs,v);m._post({type:b,jobId:v})});this._outJobs.set(v,z);this._post({type:l,jobId:v});return z.promise};n.prototype._close=function(){this._channel&&(this._channel=null);this._port.removeEventListener("message",this._onMessage);this._port.close();this._outJobs.forEach(function(m){m.cancel()});this._inJobs.clear();this._outJobs.clear();this._queue.clear();this._port=this._client=null};n.prototype._onMessage=function(m){if(m=g.receiveMessage(m))switch(m.type){case k:this._onResponse(m);
break;case h:this._queue.push(m);break;case b:this._onCancel(m);break;case a:this._close();break;case l:this._onOpenPort(m)}};n.prototype._onCancel=function(m){var v=this._inJobs,z=m.jobId,y=v.get(z);this._queue.push(m);y&&(c(v,z),y.cancel())};n.prototype._onInvoke=function(m){var v=this,z=m.methodName,y=m.jobId;m=m.data;var D=this._inJobs,B=this._client,H=B[z];try{if(!H&&z&&-1!==z.indexOf("."))for(var G=z.split("."),J=0;J<G.length-1;J++)B=B[G[J]],H=B[G[J+1]];if("function"!==typeof H)throw new TypeError(z+
" is not a function");var I=H.call(B,m,this)}catch(C){this._post({type:k,jobId:y,error:g.toInvokeError(C)});return}t.isThenable(I)?(D.set(y,I),I.then(function(C){D.has(y)&&(c(D,y),v._post({type:k,jobId:y},C))}).catch(function(C){D.has(y)&&(c(D,y),C&&"cancel"===C.dojoType||v._post({type:k,jobId:y,error:g.toInvokeError(C||{message:"Error encountered at method "+z})}))})):this._post({type:k,jobId:y},I)};n.prototype._onOpenPort=function(m){var v=new MessageChannel;new n(v.port1,this._client);this._post({type:k,
jobId:m.jobId},v.port2,[v.port2])};n.prototype._onResponse=function(m){var v=m.jobId,z=m.error;m=m.data;var y=this._outJobs;if(y.has(v)){var D=y.get(v);c(y,v);z?D.reject(p.fromJSON(JSON.parse(z))):D.resolve(m)}};n.prototype._post=function(m,v,z){return g.postMessage(this._port,m,v,z)};return n}()})},"esri/layers/vectorTiles/core/workers/utils":function(){define(["require","exports","dojo/has"],function(L,d,q){function p(g){return g&&"object"===typeof g&&("result"in g||"transferList"in g)}Object.defineProperty(d,
"__esModule",{value:!0});(function(g){g[g.HANDSHAKE=0]="HANDSHAKE";g[g.CONFIGURE=1]="CONFIGURE";g[g.CONFIGURED=2]="CONFIGURED";g[g.OPEN=3]="OPEN";g[g.OPENED=4]="OPENED";g[g.RESPONSE=5]="RESPONSE";g[g.INVOKE=6]="INVOKE";g[g.CANCEL=7]="CANCEL";g[g.CLOSE=8]="CLOSE";g[g.OPEN_PORT=9]="OPEN_PORT"})(d.MessageType||(d.MessageType={}));var t=0;d.newJobId=function(){return t++};d.isTranferableResult=p;d.toInvokeError=function(g){return g?g.toJSON?JSON.stringify(g):JSON.stringify({name:g.name,message:g.message,
details:g.details,stack:g.stack}):null};d.postMessage=function(g,c,a,b){2===arguments.length||void 0===a&&void 0===b?g.postMessage(c):(q("esri-workers-supports-transfer-arraybuffer")||(b?(b=b.filter(function(h){return!(h instanceof ArrayBuffer)}),b.length||(b=null)):p(a)&&a.transferList&&(a.transferList=a.transferList.filter(function(h){return!(h instanceof ArrayBuffer)}),a.transferList.length||(a.transferList=null))),b?(c.data=a,g.postMessage(c,b)):p(a)?(c.data=a.result,a.transferList?g.postMessage(c,
a.transferList):g.postMessage(c)):(c.data=a,g.postMessage(c)))};d.receiveMessage=function(g){return g?(g=g.data)?"string"===typeof g?JSON.parse(g):g:null:null}})},"esri/layers/vectorTiles/core/workers/WorkerOwner":function(){define("require exports dojo/Deferred ../../kernel ../Error ../Logger ../promiseUtils ./utils ./workerFactory".split(" "),function(L,d,q,p,t,g,c,a,b){var h=g.getLogger("esri.core.workers"),k=a.MessageType.CANCEL,l=a.MessageType.INVOKE,e=a.MessageType.OPEN,n=a.MessageType.OPENED,
m=a.MessageType.RESPONSE;return function(){function v(z,y){this._outJobs=new Map;this._inJobs=new Map;this.worker=z;this.id=y;z.addEventListener("message",this._onMessage.bind(this));z.addEventListener("error",function(D){D.preventDefault();h.error(D)})}v.create=function(z){return b.createWorker().then(function(y){return new v(y,z)})};v.prototype.terminate=function(){this.worker.terminate()};v.prototype.open=function(z){var y=this,D=a.newJobId(),B=new q(function(H){y._outJobs["delete"](D);y._post({type:k,
jobId:D})});this._outJobs.set(D,B);this._post({type:e,jobId:D,modulePath:z});return B.promise};v.prototype._onMessage=function(z){if(z=a.receiveMessage(z))switch(z.type){case n:case m:this._onResponse(z);break;case k:this._onCancel(z);break;case l:this._onInvoke(z)}};v.prototype._onCancel=function(z){(z=this._inJobs.get(z.jobId))&&z.cancel()};v.prototype._onInvoke=function(z){var y=this,D=z.methodName,B=z.jobId;z=z.data;var H=this._inJobs,G=p.workerMessages[D];try{if("function"!==typeof G)throw new TypeError(D+
" is not a function");var J=G.call(null,z)}catch(I){this._post({type:m,jobId:B,error:a.toInvokeError(I)});return}c.isThenable(J)?(H.set(B,J),J.then(function(I){H["delete"](B);y._post({type:m,jobId:B},I)}).catch(function(I){H["delete"](B);I||(I={message:"Error encountered at method"+D});I.dojoType&&"cancel"===I.dojoType||y._post({type:m,jobId:B,error:a.toInvokeError(I)})})):this._post({type:m,jobId:B},J)};v.prototype._onResponse=function(z){var y=z.jobId,D=z.error;z=z.data;var B=this._outJobs.get(y);
B&&(this._outJobs["delete"](y),D?B.reject(t.fromJSON(JSON.parse(D))):B.resolve(z))};v.prototype._post=function(z,y,D){return a.postMessage(this.worker,z,y,D)};return v}()})},"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(L,d,q,p,t,g,c,a,b,h,k,l,e){function n(G){return a.create(function(J){function I(f){if(f=
l.receiveMessage(f))switch(f.type){case H:f=G;var r=t.workers.loaderUrl||k.DEFAULT_LOADER_URL;if(null!=t["default"]){var w=q({},t);delete w["default"];w=JSON.parse(JSON.stringify(w))}else w=JSON.parse(JSON.stringify(t));var u=t.workers.loaderConfig;u=k.default({baseUrl:u.baseUrl,locale:p.locale,has:q({"config-deferredInstrumentation":0,"dojo-test-sniff":0,"esri-cors":1,"esri-secure-context":b("esri-secure-context"),"esri-workers-supports-transfer-arraybuffer":b("esri-workers-supports-transfer-arraybuffer"),
"events-keypress-typed":0,"host-webworker":1},u.has),map:q({},u.map),paths:q({},u.paths),packages:u.packages||[]});f.postMessage({type:B,configure:{esriConfig:w,loaderUrl:r,loaderConfig:u}});break;case D:G.removeEventListener("message",I),G.removeEventListener("error",C),J(G)}}function C(f){f.preventDefault();G.removeEventListener("message",I);G.removeEventListener("error",C);z.warn("Failed to create Worker. Fallback to execute module in main thread",f);G=new e;G.addEventListener("message",I);G.addEventListener("error",
C)}G.addEventListener("message",I);G.addEventListener("error",C)})}Object.defineProperty(d,"__esModule",{value:!0});var m=h.normalize(L.toUrl("./worker.js")),v=!h.hasSameOrigin(m,location.href),z=c.getLogger("esri.core.workers"),y=null,D=l.MessageType.CONFIGURED,B=l.MessageType.CONFIGURE,H=l.MessageType.HANDSHAKE;d.createWorker=function(){if(!b("esri-workers"))return n(new e);if(!v){var G=void 0;try{G=new Worker(m)}catch(J){z.warn("Failed to create Worker. Fallback to execute module in main thread",
event),G=new e}return n(G)}y||(y=g(m,{responseType:"text"}));return y.then(function(J){return new Worker(URL.createObjectURL(new Blob([J.data],{type:"text/javascript"})))}).catch(function(J){z.warn("Failed to create Worker. Fallback to execute module in main thread",J);return new e}).then(function(J){return n(J)})}})},"esri/layers/vectorTiles/core/tsSupport/assignHelper":function(){define([],function(){return Object.assign||function(L){for(var d,q=1,p=arguments.length;q<p;q++){d=arguments[q];for(var t in d)Object.prototype.hasOwnProperty.call(d,
t)&&(L[t]=d[t])}return L}})},"esri/layers/vectorTiles/config":function(){define(["require","exports","esri/config"],function(L,d,q){Object.defineProperty(q,"workers",{get:function(){return q.defaults.workers},set:function(p){return q.defaults.workers=p}});return q})},"esri/layers/vectorTiles/request":function(){define(["require","exports","esri/request","dojo/_base/lang","dojo/Deferred"],function(L,d,q,p,t){return function(g,c){g=p.mixin({},{url:g,failOk:!0},c);"array-buffer"===c.responseType?(g.handleAs=
"arraybuffer",delete g.responseType):c.responseType&&(g.handleAs=c.responseType,delete g.responseType);null!==c.query&&(g.content=g.query,delete g.query);if(c.hasOwnProperty("allowImageDataAccess")){var a={allowImageDataAccess:c.allowImageDataAccess};delete g.allowImageDataAccess}var b=new t(function(){h.isFulfilled()||h.cancel()});var h=q(g,a).then(function(k){b.resolve({data:k})}).catch(function(k){k&&null!=k.httpCode&&(k.details=k.details||{},k.details.httpStatus=k.httpCode);b.reject(k)});return b.promise}})},
"esri/layers/vectorTiles/core/sniff":function(){define(["require","exports","dojo/sniff","./global","../views/webgl/context-util"],function(L,d,q,p,t){function g(){var h={available:!1,version:0,majorPerformanceCaveat:!1,supportsHighPrecisionFragment:!1,supportsVertexShaderSamplers:!1,supportsElementIndexUint:!1,supportsStandardDerivatives:!1},k=document.createElement("canvas");if(!k)return h;var l=t.createContext(k,{failIfMajorPerformanceCaveat:!0},"webgl");!l&&(l=t.createContext(k,{},"webgl"))&&
(h.majorPerformanceCaveat=!0);if(!l)return h;k=l.getParameter(l.VERSION);if(!k)return h;if(k=k.match(/^WebGL\s+([\d.]*)/))h.version=parseFloat(k[1]),h.available=.94<=h.version,k=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_FLOAT),h.supportsHighPrecisionFragment=k&&0<k.precision,h.supportsVertexShaderSamplers=0<l.getParameter(l.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h.supportsElementIndexUint=null!==l.getExtension("OES_element_index_uint"),h.supportsStandardDerivatives=null!==l.getExtension("OES_standard_derivatives");
return h}function c(){var h={available:!1,version:0},k=document.createElement("canvas");if(!k)return h;k=t.createContext(k,{},"webgl2");if(!k)return h;h.available=!0;k=k.getParameter(k.VERSION);if(!k)return h;if(k=k.match(/^WebGL\s+([\d.]*)/))h.version=parseFloat(k[1]);return h}(function(){var h=navigator.userAgent,k=h.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i);h=h.match(/iPhone/i);k&&q.add("esri-mobile",k);h&&q.add("esri-iPhone",h);q.add("esri-phonegap",!!p.cordova);
q.add("esri-cors",q("esri-phonegap")||"XMLHttpRequest"in p&&"withCredentials"in new XMLHttpRequest);q.add("esri-geolocation",function(){return!!navigator.geolocation});q.add("esri-canvas-svg-support",function(){return!(q("trident")||q("ie"))});q.add("esri-secure-context",function(){if("isSecureContext"in p)return p.isSecureContext;if(p.location&&p.location.origin)return 0===p.location.origin.indexOf("https:")});q.add("esri-wasm","WebAssembly"in p);q("host-webworker")||(q.add("esri-workers","Worker"in
p),q.add("esri-script-sandbox",function(){return"MessageChannel"in p&&"HTMLIFrameElement"in p&&"sandbox"in HTMLIFrameElement.prototype}),q.add("esri-url-encodes-apostrophe",function(){var l=p.document.createElement("a");l.href="?'";return-1<l.href.indexOf("?%27")}),a||(a=g()),q.add("esri-webgl",a.available),q.add("esri-webgl-high-precision-fragment",a.supportsHighPrecisionFragment),q.add("esri-webgl-vertex-shader-samplers",a.supportsVertexShaderSamplers),q.add("esri-webgl-element-index-uint",a.supportsElementIndexUint),
q.add("esri-webgl-standard-derivatives",a.supportsStandardDerivatives),q.add("esri-webgl-major-performance-caveat",a.majorPerformanceCaveat),q.add("esri-featurelayer-webgl-labeling",!0),b||(b=c()),q.add("esri-webgl2",b.available))})();var a=null,b=null;return q})},"esri/layers/vectorTiles/core/global":function(){define(["require","exports"],function(L,d){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(L,d){function q(c,a,b){void 0===a&&(a={});switch(b){case "webgl":var h=["webgl","experimental-webgl","webkit-3d","moz-webgl"];break;case "webgl2":h=["webgl2"];break;default:h=["webgl","experimental-webgl","webkit-3d","moz-webgl"]}b=null;for(var k=0;k<h.length;k++){var l=h[k];try{b=c.getContext(l,a)}catch(e){}if(b)break}return b}function p(c,a){(c=c.parentNode)&&(c.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(d,"__esModule",{value:!0});d.createContextOrErrorHTML=function(c,a,b){void 0===a&&(a={});if(!window.WebGLRenderingContext)return p(c,t),null;a=q(c,a,b);return a?a:(p(c,g),null)};d.createContext=q;var t='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',g='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(L,d,q,p){function t(B){return q.normalize(B)}function g(B){return"data:"===B.slice(0,5)}function c(B){return a(B)||y.test(B)}function a(B){return B&&"/"===B[0]&&"/"===B[1]}function b(B){return q.urlToObject(B)}function h(B){if("string"===typeof B)return new p(l(B));B.scheme||(B.scheme=d.appUrl.scheme);return B}function k(B){if(g(B))return null;var H=B.indexOf("://");if(-1===H&&
a(B))H=2;else if(-1!==H)H+=3;else return null;H=B.indexOf("/",H);return-1===H?B:B.slice(0,H)}function l(B,H,G){void 0===H&&(H=d.appBaseUrl);if(a(B))return G&&G.preserveProtocolRelative?B:"http"===d.appUrl.scheme&&d.appUrl.authority===k(B).slice(2)?"http:"+B:"https:"+B;if(y.test(B))return B;"/"===B[0]&&(G=H.indexOf("//"),G=H.indexOf("/",G+2),H=-1===G?H:H.slice(0,G));return n(H,B)}function e(B,H,G){void 0===G&&(G=!1);B=h(B);H=h(H);return G||B.scheme===H.scheme?B.host.toLowerCase()===H.host.toLowerCase()&&
B.port===H.port:!1}function n(){for(var B=[],H=0;H<arguments.length;H++)B[H]=arguments[H];if(B&&B.length){H=[];if(c(B[0])){var G=B[0],J=G.indexOf("//");H.push(G.slice(0,J+1));z.test(B[0])&&(H[0]+="/");B[0]=G.slice(J+2)}else"/"===B[0][0]&&H.push("");B=B.reduce(function(I,C){return C?I.concat(C.split("/")):I},[]);for(G=0;G<B.length;G++)J=B[G],".."===J&&0<H.length?H.pop():!J||"."===J&&0!==H.length||H.push(J);return H.join("/")}}function m(B,H,G){if(!(H&&G&&B&&c(B)))return B;var J=B.indexOf("//"),I=B.indexOf("/",
J+2),C=B.indexOf(":",J+2);I=Math.min(0>I?B.length:I,0>C?B.length:C);if(B.slice(J+2,I).toLowerCase()!==H.toLowerCase())return B;H=B.slice(0,J+2);B=B.slice(I);return""+H+G+B}function v(B,H,G){void 0===H&&(H=d.appBaseUrl);if(!c(B))return B;var J=t(B),I=J.toLowerCase();H=t(H).toLowerCase().replace(/\/+$/,"");if((G=G?t(G).toLowerCase().replace(/\/+$/,""):null)&&0!==H.indexOf(G))return B;for(var C=function(w,u,E){E=w.indexOf(u,E);return-1===E?w.length:E},f=C(I,"/",I.indexOf("//")+2),r=-1;I.slice(0,f+1)===
H.slice(0,f)+"/";){r=f+1;if(f===I.length)break;f=C(I,"/",f+1)}if(-1===r||G&&r<G.length)return B;B=J.slice(r);J=H.slice(r-1).replace(/[^/]+/g,"").length;if(0<J)for(I=0;I<J;I++)B="../"+B;else B="./"+B;return B}Object.defineProperty(d,"__esModule",{value:!0});d.normalize=t;d.canUseXhr=function(B){return q.canUseXhr(B)};d.removeTrailingSlash=function(B){return B.replace(/\/+$/,"")};L=Function("return this")();d.appUrl=new p(L.location);d.appBaseUrl=function(){var B=d.appUrl.path;B=B.substring(0,B.lastIndexOf(B.split("/")[B.split("/").length-
1]));return d.appUrl.scheme+"://"+d.appUrl.host+(null!=d.appUrl.port?":"+d.appUrl.port:"")+B}();var z=/^\s*file:/i,y=/^\s*[a-z][a-z0-9-+.]*:[^0-9]/i;d.isDataProtocol=g;d.isAbsolute=c;d.isProtocolRelative=a;d.urlToObject=b;d.getOrigin=k;d.makeAbsolute=l;d.hasSameOrigin=e;d.join=n;d.removeFile=function(B){var H=0;if(c(B)){var G=B.indexOf("//");-1!==G&&(H=G+2)}G=B.lastIndexOf("/");return G<H?B:B.slice(0,G+1)};d.addProxy=function(B){return q.addProxy(B)};d.makeData=function(B){return B.isBase64?"data:"+
B.mediaType+";base64,"+B.data:"data:"+B.mediaType+","+B.data};var D=/^data:(.*?)(;base64)?,(.*)$/;d.dataComponents=function(B){return(B=B.match(D))?{mediaType:B[1],isBase64:!!B[2],data:B[3]}:null};d.changeDomain=m;d.read=function(B,H){var G=H&&H.url&&H.url.path;B&&G&&(B=l(B,G,{preserveProtocolRelative:!0}));(H=H&&H.portal)&&!H.isPortal&&H.urlKey&&H.customBaseUrl?(G=H.urlKey+"."+H.customBaseUrl,H=e(d.appUrl,d.appUrl.scheme+"://"+G)?m(B,H.portalHostname,G):m(B,G,H.portalHostname)):H=B;return H};d.write=
function(B,H){if(!B)return B;!c(B)&&H&&H.blockedRelativeUrls&&H.blockedRelativeUrls.push(B);var G=l(B);if(H){var J=H.verifyItemRelativeUrls&&H.verifyItemRelativeUrls.rootPath||H.url&&H.url.path;J&&(G=v(G,J,J),G!==B&&H.verifyItemRelativeUrls&&H.verifyItemRelativeUrls.writtenUrls.push(G))}B=G;G=(H=H&&H.portal)&&!H.isPortal&&H.urlKey&&H.customBaseUrl?m(B,H.urlKey+"."+H.customBaseUrl,H.portalHostname):B;return G};d.makeRelative=v;d.removeQueryParameters=function(B){B=b(B);Object.keys(B.query||{});return B.path}})},
"esri/layers/vectorTiles/core/workers/loaderConfig":function(){define(["require","exports","../tsSupport/assignHelper","dojo/has","../urlUtils"],function(L,d,q,p,t){Object.defineProperty(d,"__esModule",{value:!0});d.DEFAULT_LOADER_URL=t.makeAbsolute(t.removeQueryParameters(L.toUrl("./worker-init.js")));d.DEFAULT_CONFIG={baseUrl:function(){var g=t.removeQueryParameters(L.toUrl("dojo/x.js"));return t.makeAbsolute(g.slice(0,g.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"}}};d.default=
function(g){var c={async:g.async,isDebug:g.isDebug,locale:g.locale,baseUrl:g.baseUrl,has:q({},g.has),map:q({},g.map),packages:g.packages&&g.packages.concat()||[],paths:q({},g.paths)};g.hasOwnProperty("async")||(c.async=!0);g.hasOwnProperty("isDebug")||(c.isDebug=!1);g.baseUrl||(c.baseUrl=d.DEFAULT_CONFIG.baseUrl);d.DEFAULT_CONFIG.packages.forEach(function(k){a:{for(var l=c.packages,e=0;e<l.length;e++)if(l[e].name===k.name)break a;k=q({},k);e=t.removeQueryParameters(L.toUrl(k.name+"/x.js"));e=e.slice(0,
e.length-5);k.location=t.makeAbsolute(e);l.push(k)}});g=c.map=c.map||{};for(var a=0,b=Object.keys(d.DEFAULT_CONFIG.map);a<b.length;a++){var h=b[a];g[h]||(g[h]=d.DEFAULT_CONFIG.map[h])}return c}})},"esri/layers/vectorTiles/core/workers/WorkerFallback":function(){define(["require","exports","dojo/has","../global","./utils"],function(L,d,q,p,t){var g=function(){return function(){var b=this,h=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach(function(k){b[k]=
function(){for(var l=[],e=0;e<arguments.length;e++)l[e]=arguments[e];return h[k].apply(h,l)}})}}(),c=p.MutationObserver||p.WebKitMutationObserver,a=function(){if(p.process&&p.process.nextTick)var b=function(l){p.process.nextTick(l)};else if(p.Promise)b=function(l){p.Promise.resolve().then(l)};else if(c){var h=[],k=document.createElement("div");(new c(function(){for(;0<h.length;)h.shift()()})).observe(k,{attributes:!0});b=function(l){h.push(l);k.setAttribute("queueStatus","1")}}return b}();return function(){function b(){this._dispatcher=
new g;this._isInitialized=!1;this._workerPostMessage({type:t.MessageType.HANDSHAKE})}b.prototype.terminate=function(){};Object.defineProperty(b.prototype,"onmessage",{get:function(){return this._onmessageHandler},set:function(h){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler);(this._onmessageHandler=h)&&this.addEventListener("message",h)},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"onerror",{get:function(){return this._onerrorHandler},set:function(h){this._onerrorHandler&&
this.removeEventListener("error",this._onerrorHandler);(this._onerrorHandler=h)&&this.addEventListener("error",h)},enumerable:!0,configurable:!0});b.prototype.postMessage=function(h,k){var l=this;a(function(){l._workerMessageHandler(new MessageEvent("message",{data:h}))})};b.prototype.dispatchEvent=function(h){return this._dispatcher.dispatchEvent(h)};b.prototype.addEventListener=function(h,k,l){this._dispatcher.addEventListener(h,k,l)};b.prototype.removeEventListener=function(h,k,l){this._dispatcher.removeEventListener(h,
k,l)};b.prototype._workerPostMessage=function(h,k){var l=this;a(function(){l.dispatchEvent(new MessageEvent("message",{data:h}))})};b.prototype._workerMessageHandler=function(h){var k=this;if(h=t.receiveMessage(h)){var l=h.jobId;switch(h.type){case t.MessageType.CONFIGURE:this._isInitialized||this._workerPostMessage({type:t.MessageType.CONFIGURED});break;case t.MessageType.OPEN:h=h.modulePath,q("esri-webpack")?L(["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",h],function(e,n,m,v,z,y,D,B){switch(B){case "esri/views/vectorTiles/WorkerTileHandler":break;case "esri/views/2d/layers/features/Pipeline":n=m;break;case "esri/views/3d/layers/PointCloudWorker":n=v;break;case "esri/views/3d/layers/SceneLayerWorker":n=z;break;case "esri/layers/graphics/sources/support/CSVSourceWorker":n=
y;break;case "esri/views/3d/webgl-engine/lib/edgeRendering/EdgeProcessingWorker":n=D;break;default:n=B}e=e.connect(n);k._workerPostMessage({type:t.MessageType.OPENED,jobId:l,data:e})}):L(["./RemoteClient",h],function(e,n){e=e.connect(n);k._workerPostMessage({type:t.MessageType.OPENED,jobId:l,data:e})})}}};return b}()})},"esri/layers/vectorTiles/core/requireUtils":function(){define(["require","exports","dojo/Deferred"],function(L,d,q){function p(t,g){if(Array.isArray(g)){var c=new q;t(g,function(){for(var a=
[],b=0;b<arguments.length;b++)a[b]=arguments[b];c.resolve(a)});return c.promise}return p(t,[g]).then(function(a){return a[0]})}Object.defineProperty(d,"__esModule",{value:!0});d.when=p;d.getAbsMid=function(t,g,c){return g.toAbsMid?g.toAbsMid(t):c.id.replace(/\/[^\/]*$/gi,"/")+t}})},"esri/layers/rasterLib/function/rasterFunctionHelper":function(){define(["dojo/_base/declare","dojo/_base/lang","./rasterFunctionRegistry"],function(L,d,q){return{create:function(p,t){if(p){var g=p.renderTexture,c=Object.keys(p);
if(p.read&&!t)return p;p.read&&t&&(p=p.toJson());-1<c.indexOf("name")&&c.indexOf(!1)?(p=d.mixin({},p),t=this._parseV2(p,t)):(p="esri.layers.RasterFunction"===p.declaredClass?p.toJson():d.mixin({},p),t=this._parseV1(p,t));t.branchCount=t.updateBranchStructure();t.renderTexture||(t.renderTexture=!!g);return t}},_parseV1:function(p,t){var g=p.rasterFunction,c=p.rasterFunctionArguments,a=p.renderTexture||p.rasterFunctionArguments.renderTexture||!1,b,h,k,l,e,n,m;(l=c.raster||c.Raster)&&l.rasterFunction&&
(b=this._parseV1(l,t));(l=c.raster2||c.Raster2)&&l.rasterFunction&&(h=this._parseV1(l,t));(l=c.rasters||c.Rasters)&&0<l.length&&(k=l.map(d.hitch(this,function(v){return v&&v.rasterFunction?this._parseV1(v,t):v})));(l=c.dem||c.DEM)&&(l.functionName||l.rasterFunction)&&(e=this._parseV1(l,t));(l=c.fillRaster||c.FillRaster)&&(l.functionName||l.rasterFunction)&&(n=this._parseV1(l,t));l=q.functions[g];if(!l)return console.error("Function is not currently supported: "+g),null;g=new l(c);g.variableName&&
(l=c[g.variableName])&&(l.functionName||l.rasterFunction)&&(m=this._parseV1(l,t));p.outputPixelType&&(g.pixelType=p.outputPixelType);"$$"===b?g.functionArguments.raster=t&&t.raster:null!=b?g.functionArguments.raster=b:g.functionArguments.raster||(g.functionArguments.raster=t&&t.raster);null!=h&&(g.functionArguments.raster2=h);null!=k&&(g.functionArguments.rasters=k.map(function(v){"$$"===v&&(v=t&&t.raster);return v}));null!=e&&(g.functionArguments.dem=e);null!=n&&(g.functionArguments.fillRaster=n);
null!=m&&(g.functionArguments[g.variableName]=m);g.renderTexture=a;return g},_parseV2:function(p,t){if(!p)return null;p=d.clone(p);this._bindV2Args(p,t);var g={};this._convertTov1(p,g);return this._parseV1(g,t)},_bindV2Args:function(p,t){(p||t)&&Object.keys(p).forEach(function(g){p[g]["function"]&&p[g].arguments?this._bindV2Args(p[g].arguments,t):null!=t[p[g].name]&&(p[g].value=t[p[g].name])}.bind(this))},_convertV2Types:function(p){if(!p)return null;"ArgumentArray"===p.type?p.elements&&"RasterStatistics"===
p.elements[0].type&&(p=p.elements):p instanceof Array&&0===p.length&&(p=null);return p},_convertTov1:function(p,t){if((p||t)&&p["function"]){var g=p["function"],c=p.arguments;t.rasterFunction=g.type.replace("Function","");t.outputPixelType="UNKNOWN"===g.pixelType?"Unknown":g.pixelType;t.rasterFunctionArguments={};var a;Object.keys(c).forEach(function(b){c[b]["function"]&&c[b].arguments?(t.rasterFunctionArguments[b]={},this._convertTov1(c[b],t.rasterFunctionArguments[b])):(a=c[b].value,t.rasterFunctionArguments[b]=
"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(L,d,q,p,t,g,c,a,b,h,k,l,e,n,m,v,z,y){return function(){function D(J){J.prototype.supportWebGL&&(H[J.prototype.functionName]=J);J.prototype.support2D&&(B[J.prototype.functionName]=J);G[J.prototype.functionName]=J}var B={},H={},G={};D(q);D(p);D(t);D(g);D(c);D(a);D(b);D(h);D(k);D(l);D(e);D(n);D(m);D(v);D(z);D(y);return{cpu:B,gpu:H,functions:G,register:D,getFunction:function(J){return G[J]},support:function(J,I){return!!("gpu"===I?H:"cpu"===I?B:G)[J]}}}()})},"esri/layers/rasterLib/function/AspectFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../../WKIDUnitConversion ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./surfaceUtils".split(" "),
function(L,d,q,p,t,g,c,a){return L([q,c],{declaredClass:"esri.layers.rasterLib.function.AspectFunction",functionName:"Aspect",supportWebGL:!0,support2D:!0,constructor:function(b){this.functionArguments=this.mixinIgnoreCase({raster:null},b)},bind:function(){var b=this.getSourceRasterInfo();if(!b.raster)return Error("The raster input to aspect function is invalid.");this.rasterInfo=d.mixin(b.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(b){this._performance.start();b=a.aspect(b.raster);this._addPerformanceMetric(this._performance.elapsed());return b},readGL:function(b){this._performance.start();this._initializeProgram({fragment:g.aspect,fragmentName:"Aspect"});var h=this._setupTextureData(b.raster),k=this.bindFrameBuffer(),l=this.gl,e=l.drawingBufferWidth;l=l.drawingBufferHeight;var n=h.extent;
this._setUniforms({u_resolution:b&&b.raster&&b.raster.pixelBlock?[1/b.raster.pixelBlock.width,1/b.raster.pixelBlock.height]:[1/e,1/l],u_cellSize:[(n.xmax-n.xmin)/e,(n.ymax-n.ymin)/l]});this._bindTexture(h.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:h.extent,texture:k.texture}}})})},"esri/layers/rasterLib/function/RasterFunctionX":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/config ../raster/RasterInfo ../../../geometry/Extent ../../PixelBlock".split(" "),
function(L,d,q,p,t,g){return L(null,{functionName:null,functionArguments:null,pixelType:"Unknown",rasterInfo:null,constructor:function(c){c&&(this.pixelType=c.outputPixelType||c.OutputPixelType||this.pixelType,this.renderTexture=c.renderTexture,this._initFunction())},mixinIgnoreCase:function(c,a){var b=Object.keys(c),h=Object.keys(a),k,l,e=b.length;for(k=0;k<h.length;k++){var n=a[h[k]];if(null!=n)for(l=0;l<e;l++)if(b[l].toLowerCase()===h[k].toLowerCase()){c[b[l]]=n;break}}return c},bind:function(c){},
setProcessingContext:function(c){if(!c)throw"cannot bind to layer without options";this.useWebGL=!!c.useWebGL;this._tileMode=!!c.tileMode;this._glSetting=c.glSetting;this._rawRasterInfo=c.rawRasterInfo;this._xformSetting=c.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,b=this.functionArguments.raster2,
h=this.functionArguments.dem,k=this.functionArguments.fillRaster,l=this.functionArguments.rasters;a&&a.functionArguments&&a.setProcessingContext(c);b&&b.functionArguments&&b.setProcessingContext(c);h&&h.functionArguments&&h.setProcessingContext(c);k&&k.functionArguments&&k.setProcessingContext(c);if(l)for(a=0;a<l.length;a++)l[a]&&l[a].functionArguments&&l[a].setProcessingContext(c);this.bind()}},updateBranchStructure:function(){var c=0,a=this.functionArguments;a.raster&&a.raster.read&&a.raster.functionArguments&&
(c+=a.raster.updateBranchStructure());a.raster2&&a.raster2.read&&a.raster2.functionArguments&&(c+=a.raster2.updateBranchStructure(),a.raster2.isBranch=!0,a.raster&&a.raster.read&&(a.raster.isBranch=!0));a.rasters&&(c=a.rasters.length,a.rasters.forEach(function(b){b.read&&b.functionArguments&&(b.isBranch=!0)}));a.dem&&a.dem.read&&a.dem.functionArguments&&(c+=a.dem.updateBranchStructure());return 1===c?0:c},read:function(c){c=this.processRasterArgument(c);return this.useWebGL?this.readGL(c):this.read2D(c)},
hasTilingEffects:function(){return!1},read2D:function(){},readGL:function(){},getSourceRasterInfo:function(){var c,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=[],c=0;c<this.functionArguments.rasters.length;c++)a.rasters[c]=this._bindRaster(this.functionArguments.rasters[c]);else a.raster=this._bindRaster(this.functionArguments.raster);
return this.sourceRasterInfo=a},processRasterArgument:function(c){var a=this.bind();if(!0!==a)throw a;var b={};if(this.functionArguments.raster2)b.raster=this._readRaster(this.functionArguments.raster,c),b.raster2=this._readRaster(this.functionArguments.raster2,c);else if(this.functionArguments.rasters)for(b.rasters=[],a=0;a<this.functionArguments.rasters.length;a++)b.rasters[a]=this._readRaster(this.functionArguments.rasters[a],c);else b.raster=this._readRaster(this.functionArguments.raster,c);return b},
toJson:function(){var c=this.functionArguments,a=c.raster,b=c.raster2;c=c.rasters;a=a?a.toJson?a.toJson():a:null;b=b?b.toJson?b.toJson():b:null;var h;c&&0<c.length&&(h=c.map(function(k){return k.toJson?k.toJson():k}));c=d.mixin({},this.functionArguments);c.raster=a;c.raster2=b;c.rasters=h;c=this._fixRasterFunctionJson(c);return{rasterFunction:this.functionName,rasterFunctionArguments:c,outputPixelType:this.pixelType}},_initFunction:function(c){},_getIntegerRange:function(c){switch(c){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(c,a){return c&&"unknown"!==c.toLowerCase()?c:a},_clonePixelData:function(c){if(null==c)return c;var a={};c.extent&&(a.extent=new t(c.extent.xmin,c.extent.ymin,c.extent.xmax,c.extent.ymax,c.extent.spatialReference));c=c.pixelBlock;if(null==c)return a;a.pixelBlock=c.clone?c.clone():g.prototype.clone(c);
return a},_readRaster:function(c,a){if(null==c||"$$"===c)var b=this._clonePixelData(a.src[Object.keys(a.src)[0]]);else c&&c.rasterInfo&&!c.functionArguments?b=this._clonePixelData(a.src[c._rasterId]):isNaN(c)?c.read&&(b=c.functionArguments?c.read(a):this._clonePixelData(a)):(b=a.src?a.src[Object.keys(a.src)[0]]:a,a=b.pixelBlock,a=new Float32Array(a.width*a.height),a.fill(parseFloat(c)),b=this._clonePixelData(b),b.pixelBlock.pixels=[a],b.isConstant=!0);return b},_bindRaster:function(c){if(c&&"$$"!==
c)isNaN(c)?c.rasterInfo?a=c.rasterInfo:c.bind&&c.bind()&&(a=c.rasterInfo):a={};else var a=this._rawRasterInfo;a&&(a=a.clone?a.clone():new p(a),a.bandCount=a.bandCount||3);return a},_getOutputBand:function(c,a){switch(c){case "U8":c=new Uint8Array(a);break;case "U16":c=new Uint16Array(a);break;case "U32":c=new Uint32Array(a);break;case "S8":c=new Int8Array(a);break;case "S16":c=new Int16Array(a);break;case "S32":c=new Int32Array(a);break;case "U32":c=new Uint32Array(a);break;case "F32":c=new Float32Array(a);
break;case "F64":c=new Float64Array(a);break;default:c=new Float32Array(a)}return c},_clampBand:function(c,a,b){if(("F64"===a||"F32"===a)&&!b)return c;var h,k=this._getIntegerRange(a),l=c.length;if(k)for(b=k[1],k=k[0],a=this._getOutputBand(a,l),h=0;h<l;h++){var e=c[h];a[h]=e>b?b:e<k?k:e}else a=c;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(c){q.isDebug&&(self.rasterFunctionPerformance||(self.rasterFunctionPerformance=[]),self.rasterFunctionPerformance.push(c),50<self.rasterFunctionPerformance.length&&self.rasterFunctionPerformance.shift())},_fixRasterFunctionJson:function(c){for(var a in c)c.hasOwnProperty(a)&&(null==c[a]?delete c[a]:c[a]instanceof Object&&!c[a].sourceType&&this._fixRasterFunctionJson(c[a],!0));return c}})})},"esri/layers/rasterLib/function/pixelShaders":function(){define(["dojo/_base/declare",
"dojo/_base/lang","./pixelShaderScripts"],function(L,d,q){L={shaderType:"fragment",getShader:function(p,t){var g=p.createShader(p.FRAGMENT_SHADER);p.shaderSource(g,t);p.compileShader(g);p.getShaderParameter(g,p.COMPILE_STATUS)||(g=null);return g}};d.mixin(L,q);return L})},"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(L,d,q,p,t,g,c){return L(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 b=this._glSetting;this.isBranch?(b.branchIndex=(b.branchIndex+1)%b.branchCount,b=b.branches[b.branchIndex]):(b.pingpongIndex=(b.pingpongIndex+1)%b.pingpong.length,b=b.pingpong[b.pingpongIndex]);a.bindFramebuffer(a.FRAMEBUFFER,b.frameBuffer);a.viewport(0,0,a.drawingBufferWidth,a.drawingBufferHeight);return b},_initializeProgram:function(a){if(this.gl)try{var b=this.gl;b.viewport(0,
0,b.drawingBufferWidth,b.drawingBufferHeight);var h=this._glSetting.programUniforms,k="local"===this.functionName?"local"+this.functionArguments.operation:this.functionName,l=h[k];if(l)this._uniforms=l.uniforms,this.rasterProgram=l.program;else{var e=(this._useMesh=this._tileMode&&this._xformSetting.requireProjection)?t.mesh:t.basic,n=t.getShader(b,a.vertex||e),m=p.getShader(b,a.fragment),v=this._loadProgram(n,m),z={rasterProgram:g.getUniforms(b,v)};h[k]={uniforms:z,program:v};this.rasterProgram=
v;this._uniforms=z}b.useProgram(this.rasterProgram);var y=b.getAttribLocation(this.rasterProgram,"a_texCoord"),D=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,D);var B=g.createMesh(this._xformSetting.meshSize);b.bufferData(b.ARRAY_BUFFER,B,b.STATIC_DRAW);b.enableVertexAttribArray(y);b.vertexAttribPointer(y,2,b.FLOAT,!1,0,0);b.disable(b.DEPTH_TEST);b.blendFunc(b.SRC_ALPHA,b.ZERO);b.disable(b.BLEND);b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1);this._shaderInfo=
{fragment:a.fragmentName}}catch(H){console.error("webgl exception: "+H.message)}else console.error("WebGL is required.")},_setUniform:function(a,b,h){null!=b&&(h&&!this._uniforms[h]&&(this._uniforms[h]=g.getUniforms(this.gl,this[h])),h=h?this._uniforms[h]:this._uniforms.rasterProgram,(a=h[a]||h[a+"[0]"])&&g.setUniform(this.gl,a,b))},_setUniforms:function(a,b){var h=Object.keys(a),k,l=h.length;for(k=0;k<l;k++)this._setUniform(h[k],a[h[k]],b);this.rawInput?this._setUniform("u_flipY",!0,b):this._setUniform("u_flipY",
!1,b);this._tileMode?(this.rawInput?(a=this._xformSetting.offset,h=this._xformSetting.scale):(a=[0,0],h=[1,1]),this._setUniform("u_xformOffset",a,b),this._setUniform("u_xformScale",h,b),this._xformSetting.requireProjection&&(this.rawInput?(this._setupXformTexture(),this._setUniform("u_projection",!0,b),this._setUniform("u_transformGridSize",this._xformSetting.gridConfig.size,b),this._setUniform("u_transformSpacing",this._xformSetting.gridConfig.spacing,b),this._setUniform("u_targetImageSize",new Float32Array([this.gl.drawingBufferWidth,
this.gl.drawingBufferHeight]),b)):this._setUniform("u_projection",!1,b))):(a=[0,0],h=[1,1],this._setUniform("u_xformOffset",a,b),this._setUniform("u_xformScale",h,b));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,b){if(a.texture)return a;a.raster&&a.raster.pixelBlock&&
(a=a.raster);this.rawInput=!0;var h=b&&b.notOriginal,k=b&&b.bandIDs;b&&b.reCreate?b=!1:(b=this._tileMode?!this._xformSetting.hasNewTexture:!this._glSetting.hasNewTexture)&&this._originalBandIDs&&(b=k?this._originalBandIDs.join("")===k.join(""):!1);0<this._glSetting.branchCount&&(b=!1);if(b&&this.originalTexture)return{extent:a.extent,texture:this.originalTexture};b=this._createTexture();h||(this.originalTexture=b,this._originalBandIDs=k);h=this.gl;var l=a.pixelBlock;this._rawResolution=l?[1/a.pixelBlock.width,
1/a.pixelBlock.height]:[1/this.gl.drawingBufferWidth,1/this.gl.drawingBufferHeight];var e=0;k&&0<k.length&&l&&(e=Math.max.apply(null,k),l.pixels.length>e&&k&&(l.pixels=k.map(function(m){return l.pixels[m]}),l.statistics&&(l.statistics=k.map(function(m){return l.statistics[m]}))));k=l.width;e=l.height;h.getExtension("OES_texture_float");var n=l.getAsRGBAFloat();h.texImage2D(h.TEXTURE_2D,0,h.RGBA,k,e,0,h.RGBA,h.FLOAT,n);return{extent:a.extent,texture:b}},_setupPingPongTextures:function(){var a=this._glSetting;
if(!a||!a.pingpong){a.pingpong=[];var b=g.createBufferTexture(this.gl,!1);a.pingpong.push(b);b=g.createBufferTexture(this.gl,!1);a.pingpong.push(b);a.pingpongIndex=1}},_setupBranchingTextures:function(){var a=this._glSetting;if(!a||!a.branches){a.branches=[];var b=0,h=a.branchCount;if(0<h){for(b=0;b<h;b++){var k=g.createBufferTexture(this.gl,!1);a.branches.push(k)}a.branchIndex=h-1}}},_setupXformTexture:function(a){for(var b=this._createTexture(),h=this.gl,k=4*this._xformSetting.gridConfig.size[0],
l=this._xformSetting.gridConfig.size[1],e=new Float32Array(k*l*4),n=0,m=0;m<this._xformSetting.gridConfig.coefficients.length;m++)e[n++]=this._xformSetting.gridConfig.coefficients[m],2===m%3&&(e[n++]=1);h.getExtension("OES_texture_float");h.texImage2D(h.TEXTURE_2D,0,h.RGBA,k,l,0,h.RGBA,h.FLOAT,e);this._bindTexture(b,"u_transformGrid",a)},_createTexture:function(a){return g.createTexture(this.gl,a)},_bindTexture:function(a,b,h){b=b||"u_image";h=this._uniforms[h||"rasterProgram"];var k=this._getTextureIndex(b);
if(-1!==k){var l=this.gl;l.uniform1i(h[b].location,k);l.activeTexture(l.TEXTURE0+k);l.bindTexture(l.TEXTURE_2D,a)}},_getTextureIndex:function(a,b){b=this._uniforms[b||"rasterProgram"];if(!b||!b[a]||b[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 b=this.gl;this.renderTexture?(b.enable(b.BLEND),b.bindFramebuffer(b.FRAMEBUFFER,null)):b.disable(b.BLEND);
a||b.viewport(0,0,b.drawingBufferWidth,b.drawingBufferHeight);a=this._xformSetting.meshSize||[1,1];b.drawArrays(b.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 b=a.getAttribLocation(this.meshProgram,"a_texCoord"),h=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,h);h=this._xformSetting.meshSize||
[1,1];var k=g.createMesh(h,!0);a.bufferData(a.ARRAY_BUFFER,k,a.STATIC_DRAW);a.enableVertexAttribArray(b);a.vertexAttribPointer(b,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,h[0]*h[1]*10)}},_setupMeshProgram:function(){var a=t.getShader(this.gl,t.mesh),b=p.getShader(this.gl,p.constant);return this._loadProgram(a,b)},_loadProgram:function(a,b){return g.loadProgram(this.gl,a,b)},_getShaderScript:function(a,
b){b=document.getElementById(b);if(!b)return null;a="";for(b=b.firstChild;b;)3==b.nodeType&&(a+=b.textContent),b=b.nextSibling;return a}})})},"esri/layers/rasterLib/function/vertexShaders":function(){define(["dojo/_base/declare","dojo/_base/lang","./vertexShaderScripts"],function(L,d,q){L={shaderType:"vertex",getShader:function(p,t){var g=p.createShader(p.VERTEX_SHADER);p.shaderSource(g,t);p.compileShader(g);p.getShaderParameter(g,p.COMPILE_STATUS)||(g=null);return g}};d.mixin(L,q);return L})},"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 L={getUniforms:function(d,q){var p=d.getProgramParameter(q,d.ACTIVE_UNIFORMS),t,g,c={};for(t=0;t<p;t++)(g=d.getActiveUniform(q,t))&&(c[g.name]={location:d.getUniformLocation(q,g.name),info:g});return c},setUniform:function(d,q,p){var t=q.info,g=q.location,c=t.type;if(null==p)console.log("uniform "+q.info.name+" has null or undefined value");else switch(c){case d.FLOAT:1<t.size?0===p.length?console.log("uniform "+q.info.name+
" has length 0"):d.uniform1fv(g,p):d.uniform1f(g,p);break;case d.FLOAT_VEC2:if(0===p.length){console.log("uniform "+q.info.name+" has length 0");break}d.uniform2fv(g,p);break;case d.FLOAT_VEC3:if(0===p.length){console.log("uniform "+q.info.name+" has length 0");break}d.uniform3fv(g,p);break;case d.FLOAT_VEC4:if(0===p.length){console.log("uniform "+q.info.name+" has length 0");break}d.uniform4fv(g,p);break;case d.INT:case d.BOOL:1<t.size?0===p.length?console.log("uniform "+q.info.name+" has length 0"):
d.uniform1iv(g,p):d.uniform1i(g,p);break;case d.INT_VEC2:case d.BOOL_VEC2:if(0===p.length){console.log("uniform "+q.info.name+" has length 0");break}d.uniform2iv(g,p);break;case d.INT_VEC3:case d.BOOL_VEC3:if(0===p.length){console.log("uniform "+q.info.name+" has length 0");break}d.uniform3iv(g,p);break;case d.INT_VEC4:case d.BOOL_VEC4:0===p.length?console.log("uniform "+q.info.name+" has length 0"):d.uniform4iv(g,p)}},createTexture:function(d,q){var p=d.createTexture();d.bindTexture(d.TEXTURE_2D,
p);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,q?d.LINEAR:d.NEAREST);d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,q?d.LINEAR:d.NEAREST);return p},createBufferTexture:function(d,q,p){q=L.createTexture(d,q);d.getExtension("OES_texture_float");p=p||[d.drawingBufferWidth,d.drawingBufferHeight];d.texImage2D(d.TEXTURE_2D,0,d.RGBA,p[0],p[1],0,d.RGBA,d.FLOAT,null);p=d.createFramebuffer();
d.bindFramebuffer(d.FRAMEBUFFER,p);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,q,0);return{texture:q,frameBuffer:p}},getShader:function(d,q,p){p=p?d.createShader(d.VERTEX_SHADER):d.createShader(d.FRAGMENT_SHADER);d.shaderSource(p,q);d.compileShader(p);d.getShaderParameter(p,d.COMPILE_STATUS)||(console.log(d.getShaderInfoLog(p)),p=null);return p},loadProgram:function(d,q,p){var t=d.createProgram();d.attachShader(t,q);d.attachShader(t,p);d.linkProgram(t);d.getProgramParameter(t,
d.LINK_STATUS)||(console.warn("failed to load webgl program: "+d.getProgramInfoLog(t)),d.deleteProgram(t),t=null);return t},createMesh:function(d,q){if(!d||1===d[0]&&1===d[1])return new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);var p=d&&q?new Float32Array(d[0]*d[1]*20):new Float32Array(d[0]*d[1]*12);var t=.9998/d[1],g=.9998/d[0],c,a,b=0;for(c=0;c<d[1];c++)for(a=0;a<d[0];a++){var h=1E-4+t*c;var k=1E-4+g*a;d&&!q?(p[b++]=h,p[b++]=k,p[b++]=h+t,p[b++]=k,p[b++]=h,p[b++]=k+g,p[b++]=h,p[b++]=k+g,p[b++]=h+t,
p[b++]=k,p[b++]=h+t,p[b++]=k+g):(p[b++]=h,p[b++]=k,p[b++]=h,p[b++]=k+g,p[b++]=h,p[b++]=k+g,p[b++]=h+t,p[b++]=k+g,p[b++]=h+t,p[b++]=k+g,p[b++]=h+t,p[b++]=k,p[b++]=h,p[b++]=k,p[b++]=h+t,p[b++]=k,p[b++]=h,p[b++]=k+g,p[b++]=h+t,p[b++]=k)}return p}};return L})},"esri/layers/rasterLib/function/convolutionKernel":function(){define([],function(){var L={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(d){switch(d){case 0:return L.LineDetectionHorizontal;case 1:return L.LineDetectionVertical;case 2:return L.LineDetectionLeftDiagonal;case 3:return L.LineDetectionRightDiagonal;case 4:return L.GradientNorth;case 5:return L.GradientWest;case 6:return L.GradientEast;case 7:return L.GradientSouth;case 8:return L.GradientNorthEast;case 9:return L.GradientNorthWest;case 10:return L.SmoothArithmeticMean;case 11:return L.Smoothing3x3;case 12:return L.Smoothing5x5;
case 13:return L.Sharpening3x3;case 14:return L.Sharpening5x5;case 15:return L.Laplacian3x3;case 16:return L.Laplacian5x5;case 17:return L.SobelHorizontal;case 18:return L.SobelVertical;case 19:return L.Sharpen;case 20:return L.Sharpen2;case 21:return L.PointSpread;default:return L.Default}}};return L})},"esri/layers/rasterLib/function/surfaceUtils":function(){define(["dojo/_base/lang"],function(L){return{hillshade:function(d,q){if(null!==d&&null!==d.pixelBlock&&null!==d.pixelBlock.pixels){var p=
this._clonePixelBlock(d.pixelBlock),t=q.altitude,g=q.azimuth,c=q.zFactor,a=q.psPower,b=q.psFactor,h=q.hillshadeType,k=q.slopeType,l=q.isGCS;1===h&&(c*=2);q=p.width;var e=p.height,n=p.pixels[0],m=p.mask,v=new Uint8Array(q*e);m&&v.set(m);var z=new Uint8Array(q*e),y=(d.extent.xmax-d.extent.xmin)/q,D=(d.extent.ymax-d.extent.ymin)/e,B=c/(8*y),H=c/(8*D);.001<c&&l&&(B/=111E3,H/=111E3);3===k&&(l?(B=111E3*y,H=111E3*D,B=(c+Math.pow(B,a)*b)/(8*B),H=(c+Math.pow(H,a)*b)/(8*H)):(B=(c+Math.pow(y,a)*b)/(8*y),H=(c+
Math.pow(D,a)*b)/(8*D)));l=(90-t)*Math.PI/180;t=Math.cos(l);var G=(360-g+90)*Math.PI/180;g=Math.sin(l)*Math.cos(G);l=Math.sin(l)*Math.sin(G);c=[];a=[];b=[];y=[315,270,225,360,180,0];var J=[60,60,60,60,60,90];k=[3,5,3,2,1,4];var I=k.reduce(function(V,W){return V+W});D=k.map(function(V){return V/I});if(1===h){var C=y.length;for(k=0;k<C;k++)t=J[k],g=y[k],l=(90-t)*Math.PI/180,t=Math.cos(l),G=(360-g+90)*Math.PI/180,g=Math.sin(l)*Math.cos(G),l=Math.sin(l)*Math.sin(G),c.push(t),a.push(g),b.push(l)}var f=
0;for(k=1;k<e-1;k++)for(J=k*q,y=1;y<q-1;y++)if(m&&!m[J+y])z[J+y]=0;else{G=0;if(m&&(G=m[J-q+y-1]+m[J-q+y]+m[J-q+y+1]+m[J+y-1]+m[J+y+1]+m[J+q+y-1]+m[J+q+y]+m[J+q+y+1],7>G)){z[J+y]=0;v[J+y]=0;continue}if(7===G){var r=m[J-q+y-1]?n[J-q+y-1]:n[J+y];var w=m[J-q+y]?n[J-q+y]:n[J+y];var u=m[J-q+y+1]?n[J-q+y+1]:n[J+y];G=m[J+y-1]?n[J+y-1]:n[J+y];var E=m[J+y+1]?n[J+y+1]:n[J+y];f=m[J+q+y-1]?n[J+q+y-1]:n[J+y];var K=m[J+q+y]?n[J+q+y]:n[J+y];var Q=m[J+q+y+1]?n[J+q+y+1]:n[J+y]}else r=n[J-q+y-1],w=n[J-q+y],u=n[J-q+
y+1],G=n[J+y-1],E=n[J+y+1],f=n[J+q+y-1],K=n[J+q+y],Q=n[J+q+y+1];G=(u+E+E+Q-(r+G+G+f))*B;w=(f+K+K+Q-(r+w+w+u))*H;u=Math.sqrt(1+G*G+w*w);f=0;if(0===h)K=l*w-g*G,K=255*(t+K)/u,0>K&&(K=0),f=K;else if(1===h)for(r=0;r<C;r++)K=b[r]*w-a[r]*G,K=255*(c[r]+K)/u,0>K&&(K=0),f+=K*D[r];z[J+y]=f}for(k=0;k<e;k++)z[k*q]=z[k*q+1],z[(k+1)*q-1]=z[(k+1)*q-2];for(k=1;k<q-1;k++)z[k]=z[k+q],z[k+(e-1)*q]=z[k+(e-2)*q];p.pixelType="U8";p.pixels=[z];p.statistics=[{minValue:0,maxValue:255}];m&&(p.mask=v);return{extent:d.extent,
pixelBlock:p}}},slope:function(d,q){if(null!==d&&null!==d.pixelBlock&&null!==d.pixelBlock.pixels){var p=this._clonePixelBlock(d.pixelBlock),t=q.zFactor,g=q.psPower,c=q.psFactor,a=q.slopeType,b=q.isGCS;q=p.width;var h=p.height,k=p.pixels[0],l=p.mask,e=new Uint8Array(q*h);l&&e.set(l);var n=new Float32Array(q*h),m=(d.extent.xmax-d.extent.xmin)/q,v=(d.extent.ymax-d.extent.ymin)/h,z=t/(8*m),y=t/(8*v);1E-4>Math.abs(t-1)&&b&&(z/=111E3,y/=111E3);3===a&&(b?(z=111E3*m,y=111E3*v,z=(t+Math.pow(z,g)*c)/(8*z),
y=(t+Math.pow(y,g)*c)/(8*y)):(z=(t+Math.pow(m,g)*c)/(8*m),y=(t+Math.pow(v,g)*c)/(8*v)));for(t=1;t<h-1;t++)for(c=t*q,g=1;g<q-1;g++)if(l&&!l[c+g])n[c+g]=0;else{v=0;if(l&&(v=l[c-q+g-1]+l[c-q+g]+l[c-q+g+1]+l[c+g-1]+l[c+g+1]+l[c+q+g-1]+l[c+q+g]+l[c+q+g+1],7>v)){n[c+g]=0;e[c+g]=0;continue}if(7===v){v=l[c-q+g-1]?k[c-q+g-1]:k[c+g];b=l[c-q+g]?k[c-q+g]:k[c+g];m=l[c-q+g+1]?k[c-q+g+1]:k[c+g];var D=l[c+g-1]?k[c+g-1]:k[c+g];var B=l[c+g+1]?k[c+g+1]:k[c+g];var H=l[c+q+g-1]?k[c+q+g-1]:k[c+g];var G=l[c+q+g]?k[c+q+
g]:k[c+g];var J=l[c+q+g+1]?k[c+q+g+1]:k[c+g]}else v=k[c-q+g-1],b=k[c-q+g],m=k[c-q+g+1],D=k[c+g-1],B=k[c+g+1],H=k[c+q+g-1],G=k[c+q+g],J=k[c+q+g+1];D=(m+B+B+J-(v+D+D+H))*z;v=(H+G+G+J-(v+b+b+m))*y;v=Math.sqrt(D*D+v*v);n[c+g]=1===a||3===a?57.2957795*Math.atan(v):100*v}for(t=0;t<h;t++)n[t*q]=n[t*q+1],n[(t+1)*q-1]=n[(t+1)*q-2];for(t=1;t<q-1;t++)n[t]=n[t+q],n[t+(h-1)*q]=n[t+(h-2)*q];p.pixelType="F32";p.pixels=[n];p.statistics=[{minValue:0,maxValue:255}];l&&(p.mask=e);return{extent:d.extent,pixelBlock:p}}},
aspect:function(d){if(null!==d&&null!==d.pixelBlock&&null!==d.pixelBlock.pixels){var q=this._clonePixelBlock(d.pixelBlock),p=q.width,t=q.height,g=q.pixels[0],c=q.mask,a=new Uint8Array(p*t);c&&a.set(c);var b=new Float32Array(p*t),h=1/((d.extent.xmax-d.extent.xmin)/p),k=1/((d.extent.ymax-d.extent.ymin)/t),l,e;for(l=1;l<t-1;l++){var n=l*p;for(e=1;e<p-1;e++)if(c&&!c[n+e])b[n+e]=0;else{var m=0;if(c&&(m=c[n-p+e-1]+c[n-p+e]+c[n-p+e+1]+c[n+e-1]+c[n+e+1]+c[n+p+e-1]+c[n+p+e]+c[n+p+e+1],7>m)){b[n+e]=0;a[n+e]=
0;continue}if(7===m){m=c[n-p+e-1]?g[n-p+e-1]:g[n+e];var v=c[n-p+e]?g[n-p+e]:g[n+e];var z=c[n-p+e+1]?g[n-p+e+1]:g[n+e];var y=c[n+e-1]?g[n+e-1]:g[n+e];var D=c[n+e+1]?g[n+e+1]:g[n+e];var B=c[n+p+e-1]?g[n+p+e-1]:g[n+e];var H=c[n+p+e]?g[n+p+e]:g[n+e];var G=c[n+p+e+1]?g[n+p+e+1]:g[n+e]}else m=g[n-p+e-1],v=g[n-p+e],z=g[n-p+e+1],y=g[n+e-1],D=g[n+e+1],B=g[n+p+e-1],H=g[n+p+e],G=g[n+p+e+1];y=(z+D+D+G-(m+y+y+B))*h;m=(B+H+H+G-(m+v+v+z))*k;0===y&&0===m?m=-1:(m=90-57.29578*Math.atan2(m,-y),0>m&&(m+=360),360===m?
m=0:360<m&&(m%=360));b[n+e]=m}}for(l=0;l<t;l++)b[l*p]=b[l*p+1],b[(l+1)*p-1]=b[(l+1)*p-2];for(l=1;l<p-1;l++)b[l]=b[l+p],b[l+(t-1)*p]=b[l+(t-2)*p];q.pixelType="F32";q.pixels=[b];q.statistics={minValue:0,maxValue:360};c&&(q.mask=a);return{extent:d.extent,pixelBlock:q}}},_clonePixelBlock:function(d){return d.clone?d.clone():L.clone(d)}}})},"esri/layers/rasterLib/function/BandArithmeticFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./rasterIndex".split(" "),
function(L,d,q,p,t,g,c){return L([q,g],{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=d.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 b=c.calculate(a.pixelBlock,{bandIndexes:this.functionArguments.bandIndexes,method:this.functionArguments.method});this._addPerformanceMetric(this._performance.elapsed());"Unknown"!==this.pixelType&&(b.pixelType=this.pixelType);
return{extent:a.extent,pixelBlock:b}},readGL:function(a){this._performance.start();this._initializeProgram({fragment:t.bandArithmetic,fragmentName:"bandArithmetic"});var b=this.functionArguments.bandIndexes.trim().split(" ").map(function(e){return parseInt(e,10)});this._infraredBandID=b[0]-1;this._visibleBandID=b[1]-1;this._alterBand=2<Math.max(this._infraredBandID,this._visibleBandID)?!0:!1;a=this._setupTextureData(a.raster,this._alterBand&&2==b.length?{bandIDs:[this._infraredBandID,this._visibleBandID,
this._infraredBandID]}:{bandIDs:[b[0]-1,b[1]-1,b[2]-1]});var h=this.bindFrameBuffer(),k=this.functionArguments.method,l=2<b.length?b.slice(2):null;this._alterBand?this._setUniforms({u_method:k,u_bandId_nir:0,u_bandId_red:1,u_constants:l}):this._setUniforms({u_method:k,u_bandId_nir:b[0]-1,u_bandId_red:b[1]-1,u_constants:l});this._bindTexture(a.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:a.extent,texture:h.texture}}})})},"esri/layers/rasterLib/function/rasterIndex":function(){define(["dojo/_base/lang"],
function(L){return{calculate:function(d,q){if(d&&d.pixels&&d.pixels.length){var p=q&&q.bandIndexes;q=q&&q.method;var t=p.trim().split(" ").map(function(a){return parseInt(a,10)}).filter(function(a){return null!=a});d=this._clonePixelBlock(d);var g=d.pixels,c=d.mask;switch(q){case 1:g=this._calculateNDVI(c,g[t[0]-1],g[t[1]-1]);break;case 2:g=this._calculateSAVI(c,g[t[0]-1],g[t[1]-1],t[2]);break;case 3:g=this._calculateTSAVI(c,g[t[0]-1],g[t[1]-1],t[2],t[3],t[4]);break;case 4:g=this._calculateMSAVI(c,
g[t[0]-1],g[t[1]-1]);break;case 5:g=this._calculateGEMI(c,g[t[0]-1],g[t[1]-1]);break;case 6:g=this._calculatePVI(c,g[t[0]-1],g[t[1]-1],t[2],t[3]);break;case 7:g=this._calculateGVITM(c,g[t[0]-1],g[t[1]-1],g[t[2]-1],g[t[3]-1],g[t[4]-1],g[t[5]-1]);break;case 8:g=this._calculateSultan(c,g[t[0]-1],g[t[1]-1],g[t[2]-1],g[t[3]-1],g[t[4]-1],g[t[5]-1]);break;case 9:g=this._calculateVARI(c,g[t[0]-1],g[t[1]-1],g[t[2]-1]);break;case 0:g=this._calculateUserDefined(c,g,p)}d.pixels=g;d.pixelType="F32";d.calculateStatistics();
return d}},_clonePixelBlock:function(d){return d.clone?d.clone():L.clone(d)},_parseUserDefined:function(d,q){d=d.replace(" ","");0===d.indexOf("-")&&(d="0"+d);0===d.indexOf("+")&&(d=d.slice(1,d.length));d=d.split("");var p=[],t=[],g="+-*/()".split(""),c,a="";for(c=0;c<d.length;c++){var b=d[c];g.some(function(h){return h===b})?(""!==a&&t.push(parseFloat(a)),p.push(b),a=""):"b"===b.toLowerCase()?(c++,a=b.concat(d[c]),t.push(q[parseInt(a[1],10)-1]),a=""):(a=a.concat(b),c===d.length-1&&t.push(parseFloat(a)))}return{ops:p,
nums:t}},_op:function(d,q,p,t){if(p.constructor===Number&&t.constructor===Number)return p+t;var g;if(p.constructor===Number){var c=t.length;var a=p;p=new Float32Array(c);for(g=0;g<c;g++)p[g]=a}else if(c=p.length,t.constructor===Number)for(a=t,t=new Float32Array(c),g=0;g<c;g++)t[g]=a;a=new Float32Array(c);if(null==d)if("+"===q)for(g=0;g<c;g++)a[g]=p[g]+t[g];else if("-"===q)for(g=0;g<c;g++)a[g]=p[g]-t[g];else if("*"===q)for(g=0;g<c;g++)a[g]=p[g]*t[g];else{if("/"===q)for(g=0;g<c;g++)a[g]=p[g]/t[g]}else if("+"===
q)for(g=0;g<c;g++)d[g]&&(a[g]=p[g]+t[g]);else if("-"===q)for(g=0;g<c;g++)d[g]&&(a[g]=p[g]-t[g]);else if("*"===q)for(g=0;g<c;g++)d[g]&&(a[g]=p[g]*t[g]);else if("/"===q)for(g=0;g<c;g++)d[g]&&(a[g]=p[g]/t[g]);return a},_shrinkOp:function(d,q){d.splice(q,1);var p=q=0,t=0;do{for(q=t=p=0;q<d.length;q++)if("("===d[q])p=q;else if(")"===d[q]){t=q;break}t===p+1&&d.splice(p,2)}while(t===p+1);return d},_getPriorityOpIndex:function(d,q){if(1===d.length)return{opIndex:0,numIndex:0};var p=q=0,t=0,g=-1,c=0;for(q=
0;q<d.length;q++)if("("===d[q])p=q;else if(")"===d[q]){t=q;break}var a=0===t?d:d.slice(p+1,t);for(q=0;q<a.length;q++)if("*"===a[q]||"/"===a[q]){g=q;break}if(!(-1<g))for(q=0;q<a.length;q++)if("+"===a[q]||"-"===a[q]){g=q;break}0<t&&(g+=p+1);for(q=0;q<g;q++)"("===d[q]&&c++;return{opIndex:g,numIndex:g-c}},_calculateUserDefined:function(d,q,p){q=this._parseUserDefined(p,q);p=q.ops;for(var t=q.nums,g,c,a;0<p.length&&(q=this._getPriorityOpIndex(p,t),g=p[q.opIndex],c=t[q.numIndex],a=t[q.numIndex+1],g=this._op(d,
g,c,a),1!==p.length);)p=this._shrinkOp(p,q.opIndex),t.splice(q.numIndex,2,g);return[g]},_calculateNDVI:function(d,q,p){var t=p.length,g=new Float32Array(t),c;if(null==d)for(c=0;c<t;c++){var a=p[c];var b=q[c];g[c]=(b-a)/(b+a)}else for(c=0;c<t;c++)d[c]&&(a=p[c],b=q[c],g[c]=(b-a)/(b+a));return[g]},_calculateSAVI:function(d,q,p,t){var g=p.length,c=new Float32Array(g),a;if(null==d)for(a=0;a<g;a++){var b=p[a];var h=q[a];c[a]=(h-b)/(h+b+t)*(1+t)}else for(a=0;a<g;a++)d[a]&&(b=p[a],h=q[a],c[a]=(h-b)/(h+b+
t)*(1+t));return[c]},_calculateTSAVI:function(d,q,p,t,g,c){var a=p.length,b=new Float32Array(a),h=-g*t+c*(1+t*t);if(null==d)for(c=0;c<a;c++){var k=p[c];var l=q[c];b[c]=t*(l-t*k-g)/(g*l+k+h)}else for(c=0;c<a;c++)d[c]&&(k=p[c],l=q[c],b[c]=t*(l-t*k-g)/(g*l+k+h));return[b]},_calculateMSAVI:function(d,q,p){var t=p.length,g=new Float32Array(t),c;if(null==d)for(c=0;c<t;c++){var a=p[c];var b=q[c];g[c]=.5*(2*(b+1)-Math.sqrt(Math.pow(2*b+1,2)-8*(b-a)))}else for(c=0;c<t;c++)d[c]&&(g[c]=.5*(2*(b+1)-Math.sqrt(Math.pow(2*
b+1,2)-8*(b-a))));return[g]},_calculateGEMI:function(d,q,p){var t=p.length,g=new Float32Array(t),c;if(null==d)for(c=0;c<t;c++){var a=p[c];var b=q[c];b=(2*(b*b-a*a)+1.5*b+.5*a)/(b+a+.5);g[c]=b*(1-.25*b)-(a-.125)/(1-a)}else for(c=0;c<t;c++)d[c]&&(a=p[c],b=q[c],b=(2*(b*b-a*a)+1.5*b+.5*a)/(b+a+.5),g[c]=b*(1-.25*b)-(a-.125)/(1-a));return[g]},_calculatePVI:function(d,q,p,t,g){var c=p.length,a=new Float32Array(c),b,h=Math.sqrt(1+t*t);if(null==d)for(b=0;b<c;b++){var k=p[b];var l=q[b];a[b]=(l-t*k-g)/h}else for(b=
0;b<c;b++)d[b]&&(k=p[b],l=q[b],a[b]=(l-t*k-g)/h);return[a]},_calculateGVITM:function(d,q,p,t,g,c,a){var b=q.length,h=new Float32Array(b),k;if(null==d)for(k=0;k<b;k++)h[k]=-.2848*q[k]-.2435*p[k]-.5436*t[k]+.7243*g[k]+.084*c[k]-1.18*a[k];else for(k=0;k<b;k++)d[k]&&(h[k]=-.2848*q[k]-.2435*p[k]-.5436*t[k]+.7243*g[k]+.084*c[k]-1.18*a[k]);return[h]},_calculateSultan:function(d,q,p,t,g,c,a){p=q.length;var b=new Float32Array(p),h=new Float32Array(p),k=new Float32Array(p),l;if(null==d)for(l=0;l<p;l++)b[l]=
c[l]/a[l]*100,h[l]=c[l]/q[l]*100,k[l]=t[l]/g[l]*(c[l]/g[l])*100;else for(l=0;l<p;l++)d[l]&&(b[l]=c[l]/a[l]*100,h[l]=c[l]/q[l]*100,k[l]=t[l]/g[l]*(c[l]/g[l])*100);return[b,h,k]},_calculateVARI:function(d,q,p,t){var g=q.length,c=new Float32Array(g),a;if(null==d)for(a=0;a<g;a++){var b=q[a];var h=p[a];var k=t[a];c[a]=(h-b)/(h+b-k)}else for(a=0;a<g;a++)if(d[a])for(a=0;a<g;a++)b=q[a],h=p[a],k=t[a],c[a]=(h-b)/(h+b-k);return[c]}}})},"esri/layers/rasterLib/function/ColormapFunction":function(){define("dojo/_base/declare dojo/_base/lang ../../../renderers/colorRampGenerator ./RasterFunctionX ./pixelShaders ./RasterFunctionWebGLMixin ./rasterUtils".split(" "),
function(L,d,q,p,t,g,c){return L([p,g],{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 b=Object.keys(a[0].attributes);var h=b.filter(function(v){return"alpha"===
v.toLowerCase()})[0];var k=b.filter(function(v){return"value"===v.toLowerCase()})[0];var l=b.filter(function(v){return"red"===v.toLowerCase()})[0];var e=b.filter(function(v){return"green"===v.toLowerCase()})[0];var n=b.filter(function(v){return"blue"===v.toLowerCase()})[0];if(!(k&&l&&e&&n))throw"invalid colormap";a=a.map(function(v){return h?[v.attributes[k],v.attributes[l],v.attributes[e],v.attributes[n],v.attributes[h]]:[v.attributes[k],v.attributes[l],v.attributes[e],v.attributes[n]]});var m=1.1>
Math.max.apply(null,a.map(function(v){return v[1]}));b=h&&1.1>Math.max.apply(null,a.map(function(v){return v[4]}));if(m)for(m=0;m<a.length;m++)a[m][1]=Math.round(255*a[m][1]),a[m][2]=Math.round(255*a[m][2]),a[m][3]=Math.round(255*a[m][3]),b&&(a[m][4]=Math.round(255*a[m][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=d.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 b=c.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:b}},_binarySearchClr:function(a,b){for(var h=0,k=a.length-1,l=0,e=0;h<k;)if(l=Math.floor((h+k)/2),e=a[l],e[0]<b)h=l;else if(e[0]>b)k=l;else return e.slice(1);return null},_sortClr:function(a,b){var h,k=[];for(h=0;h<a.length;h++)k.push(a[h]);for(h=0;h<k.length-1;h++){var l=k[h];for(a=h+1;a<k.length;a++)l[0]>k[a][0]&&(l=k[a],k[a]=k[h],
k[h]=l)}if(b)for(h=0;h<k.length/2;h++)l=k[h],k[k.length-1-h]=k[h],k[h]=l;return k},_invertColorRamp:function(a){if(!a)return a;var b={type:a.type};"random"===a.type?b=a:"multipart"===a.type?b.colorRamps=a.colorRamps.map(function(h){return{fromColor:h.toColor,toColor:h.fromColor}}).reverse():(b.fromColor=a.toColor,b.toColor=a.fromColor);return b},_initialize:function(){this._indexedColormapOffset=0;if(this.functionArguments.colormap){var a=c.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?q.createMultiPartColorRamp(this._invertColorRamp(this.functionArguments.colorRamp)):q.createMultiPartColorRamp(this.functionArguments.colorRamp):this.invert?q.createAlgorithmicColorRamp(this._invertColorRamp(this.functionArguments.colorRamp)):
q.createAlgorithmicColorRamp(this.functionArguments.colorRamp):this.functionArguments.colormapName&&"random"===this.functionArguments.colormapName.toLowerCase()&&(this._indexedColormap=q.createRandomColorRamp())},_getIndexed2DColormap:function(){var a=this.functionArguments.colormap;if(!a)return null;var b=0;0>a[0][0]&&(b=a[0][0]);var h=[],k=5===a[0].length,l;for(l=0;l<a.length;l++)h[a[l][0]-b]=k?a[l].slice(1):a[l].slice(1).concat([255]);return h},_colorizeGL:function(a){this._performance.start();
this._initializeProgram({fragment:t.colormap,fragmentName:"Colormap"});var b=this._indexedColormap,h=this._indexedColormapOffset;this._clrTexture||(this._clrTexture=this._setupColormapTexture(b));var k=this._clrTexture,l=this.bindFrameBuffer();a=this._setupTextureData(a);this._setUniforms({u_indexedColormapOffset:h,u_indexedColormapMaxIndex:b.length/4-1});this._bindTexture(k,"u_image1");this._bindTexture(a.texture,"u_image");this._drawGL();return{extent:a.extent,texture:l.texture}},_setupColormapTexture:function(a){var b=
this._createTexture(),h=this.gl,k=a.length/4,l=new Float32Array(a.length),e,n=this.renderTexture?255:1;for(e=0;e<a.length;e++)l[e]=a[e]/n;h.getExtension("OES_texture_float");h.texImage2D(h.TEXTURE_2D,0,h.RGBA,k,1,0,h.RGBA,h.FLOAT,l);return b}})})},"esri/renderers/colorRampGenerator":function(){define(["dojo/_base/declare","dojo/_base/lang","../renderers/colorUtils"],function(L,d,q){return{createAlgorithmicColorRamp:function(p,t){if(!p)return null;var g=p.fromColor,c=p.toColor;if(!g||!c)return null;
void 0===g.r&&3<=g.length&&(g={r:g[0],g:g[1],b:g[2]});void 0===c.r&&3<=c.length&&(c={r:c[0],g:c[1],b:c[2]});var a=p.size||256;p=p.algorithm||"cie-lab";if(1===a)var b=[g.r,g.g,g.b,255];else if(2===a)b=[g.r,g.g,g.b,255,c.r,c.g,g.b,255];else if(-1<p.toLowerCase().indexOf("hsv")){b=q.toHSV(g);c=q.toHSV(c);a=a||256;var h=0===b.s,k=0===c.s;g=b.h;p=c.h;h&&!k?g=b.h=p:k&&!h&&(p=c.h=g);h=Math.abs(p-g);180>h?p=(p-g)/(a-1):(h=360-h,p=g>p?h/(a-1):-h/(a-1));h=(c.s-b.s)/(a-1);k=(c.v-b.v)/(a-1);var l=b.s;b=b.v;var e,
n=new Uint8Array(4*a);for(e=0;e<a-1;e++){var m=q.toRGB({h:g,s:l,v:b});n[4*e]=m.r;n[4*e+1]=m.g;n[4*e+2]=m.b;n[4*e+3]=255;g+=p;l+=h;b+=k;360<g?g-=360:0>g&&(g+=360)}m=q.toRGB(c);n[4*(a-1)]=m.r;n[4*(a-1)+1]=m.g;n[4*(a-1)+2]=m.b;n[4*(a-1)+3]=255;b=n}else if(-1<p.toLowerCase().indexOf("lch")){l=q.toLCH(g);c=q.toLCH(c);a=a||256;b=(c.l-l.l)/(a-1);g=(c.c-l.c)/(a-1);p=(c.h-l.h)/(a-1);h=l.l;k=l.c;l=l.h;n=new Uint8Array(4*a);for(e=0;e<a-1;e++)m=q.toRGB({l:h,c:k,h:l}),n[4*e]=m.r,n[4*e+1]=m.g,n[4*e+2]=m.b,n[4*
e+3]=255,h+=b,k+=g,l+=p;m=q.toRGB(c);n[4*(a-1)]=m.r;n[4*(a-1)+1]=m.g;n[4*(a-1)+2]=m.b;n[4*(a-1)+3]=255;b=n}else if(-1<p.toLowerCase().indexOf("lab")){l=q.toLAB(g);c=q.toLAB(c);a=a||256;b=(c.l-l.l)/(a-1);g=(c.a-l.a)/(a-1);p=(c.b-l.b)/(a-1);h=l.l;k=l.a;l=l.b;n=new Uint8Array(4*a);for(e=0;e<a-1;e++)m=q.toRGB({l:h,a:k,b:l}),n[4*e]=m.r,n[4*e+1]=m.g,n[4*e+2]=m.b,n[4*e+3]=255,h+=b,k+=g,l+=p;m=q.toRGB(c);n[4*(a-1)]=m.r;n[4*(a-1)+1]=m.g;n[4*(a-1)+2]=m.b;n[4*(a-1)+3]=255;b=n}if(t&&!1===t.flattened)for(t=b,
b=[],c=0;c<b/4;c++)b[c]=t.slice(4*c,4*c+4);return b},createMultiPartColorRamp:function(p,t){if(!p)return null;t=t&&d.clone(t)||{flattened:!0};var g=p.colorRamps;if(!g||0===g.length)return null;var c=p.size||256;p=Math.max(Math.floor(c/g.length),1);var a=Math.max(p,c-(g.length-1)*p),b=!1!==t.flattened;t.flattened=!0;c=(g.length-1)*p+a;var h=new Uint8Array(4*c);for(c=0;c<g.length;c++){var k={fromColor:g[c].fromColor,toColor:g[c].toColor,size:c===g.length-1?a:p};h instanceof Array?h.concat(this.createAlgorithmicColorRamp(k,
t)):h.set(this.createAlgorithmicColorRamp(k,t),p*c*4)}if(!b)for(t=h,h=[],c=0;c<h/4;c++)h[c]=t.slice(4*c,4*c+4);return h},createRandomColorRamp:function(p){p=p||{};var t=p.size||256,g=!1===p.flattened;var c=g?new Uint8Array(4*t):[];for(p=0;p<t;p++)g?(c[4*p]=Math.round(255*Math.random()),c[4*p+1]=Math.round(255*Math.random()),c[4*p+2]=Math.round(255*Math.random()),c[4*p+3]=255):c[p]=[Math.round(255*Math.random()),Math.round(255*Math.random()),Math.round(255*Math.random()),255];return c}}})},"esri/layers/rasterLib/function/rasterUtils":function(){define(["dojo/_base/lang"],
function(L){return{mask:function(d,q){if(d&&d.pixels&&d.pixels.length){d=this._clonePixelBlock(d);var p=q.includedRanges,t=q.noDataInterpretation;q=q.noDataValues;if(null===p&&null===q)return d;var g=d.pixels,c=d.mask,a=d.width*d.height,b=g.length,h;if(null!==q&&q.length!==b)throw"expect "+b+" elements in noDataValues";if(null!==p&&p.length!==2*b)throw"expect "+2*b+" elements in IncludeRanges";if(null==c){c=new Uint8Array(a);for(h=0;h<a;h++)c[h]=1;d.mask=c}if(0===t)for(t=0;t<b;t++){var k=g[t];var l=
null===p?null:p[2*t];var e=null===p?null:p[2*t+1];var n=null===q?null:parseFloat(q[t]);if(null===l||null===e)for(h=0;h<a;h++){if(c[h]){var m=k[h];m===n&&(c[h]=0)}}else if(null===n)for(h=0;h<a;h++)c[h]&&(m=k[h],m<l||m>e)&&(c[h]=0);else for(h=0;h<a;h++)c[h]&&(m=k[h],m<l||m>e||m===n)&&(c[h]=0)}else{var v=new Uint8Array(a);for(h=0;h<a;h++)v[h]=c[h];for(t=0;t<b;t++)if(k=g[t],l=null===p?null:p[2*t],e=null===p?null:p[2*t+1],n=null===q?null:parseFloat(q[t]),null===l||null===e)for(h=0;h<a;h++)v[h]&&(m=k[h],
m!==n&&(v=0));else if(null===n)for(h=0;h<a;h++)v[h]&&(m=k[h],m<=l&&m<=e&&(v=0));else for(h=0;h<a;h++)v[h]&&(m=k[h],m<=l&&m<=e&&m!==n&&(v=0));for(h=0;h<a;h++)c[h]&&v[h]&&(c[h]=0)}return d}},calculateStatisticsHistograms:function(d,q){d=this._clonePixelBlock(d);q=d.pixelType;var p=d.pixels,t=d.mask,g=p.length,c,a,b=[],h;for(c=0;c<g;c++){var k={min:-.5,max:255.5,size:256,counts:new Uint32Array(256)};var l=k.counts;var e=p[c];if("U8"===q)if(t)for(a=0;a<d.width*d.height;a++)t[a]&&l[e[a]]++;else for(a=
0;a<d.width*d.height;a++)l[e[a]]++;else{var n=d.statistics[c].minValue;var m=d.statistics[c].maxValue;k.min=n;k.max=m;m=(m-n)/256;var v=new Uint32Array(257);if(t)for(a=0;a<d.width*d.height;a++)t[a]&&v[Math.floor((e[a]-n)/m)]++;else for(a=0;a<d.width*d.height;a++)v[Math.floor((e[a]-n)/m)]++;for(a=0;255>a;a++)l[a]=v[a];l[255]=v[255]+v[256]}b.push(k);n=d.statistics[c].minValue;m=d.statistics[c].maxValue;for(a=v=h=e=0;a<k.size;a++)e+=l[a],h+=a*l[a];h/=e;for(a=0;a<k.size;a++)v+=l[a]*Math.pow(a-h,2);l=
Math.sqrt(v/(e-1));a=(h+.5)*(k.max-k.min)/k.size+k.min;k=l*(k.max-k.min)/k.size;d.statistics[c]={min:n,minValue:n,max:m,maxValue:m,mean:a,stddev:k}}d.histograms=b;return d},buildIndexedColormap:function(d,q){if(!d)return null;var p=0;0>d[0][0]&&(p=d[0][0]);var t=Math.max(256,d[d.length-1][0]-p);if(65536<t)return null;var g=new Uint8Array(4*t),c=[],a=0,b=5===d[0].length;if(q)for(c=d[a],q=c[0]-p;q<t;q++)g[4*q]=c[1],g[4*q+1]=c[2],g[4*q+2]=c[3],g[4*q+3]=b?c[4]:255,q===c[0]-p&&(c=a===d.length-1?c:d[++a]);
else for(q=0;q<d.length;q++)c=d[q],a=4*(c[0]-p),g[a]=c[1],g[a+1]=c[2],g[a+2]=c[3],g[a+3]=b?c[4]:255;return{indexedColormap:g,offset:p,alphaSpecified:b}},colorize:function(d,q){if(null!==d&&null!==d.pixels){d=this._clonePixelBlock(d);var p=d.pixels,t=d.width*d.height,g=d.mask,c=q.indexedColormap,a=q.indexedColormapOffset,b=c&&c.length-1,h=q.indexed2DColormap;q=q.alphaSpecified;if(3<=p.length)throw"colormap only works on single band image";var k=p[0],l=new Uint8Array(k.length),e=new Uint8Array(k.length),
n=new Uint8Array(k.length),m=0;if(c)if(g)for(p=0;p<t;p++)g[p]&&(m=4*(k[p]-a),m<a||m>b?g[p]=0:(l[p]=c[m],e[p]=c[m+1],n[p]=c[m+2],g[p]=c[m+3]));else{g=new Uint8Array(t);for(p=0;p<t;p++)m=4*(k[p]-a),m<a||m>b?g[p]=0:(l[p]=c[m],e[p]=c[m+1],n[p]=c[m+2],g[p]=c[m+3]);d.mask=g}else if(g)for(p=0;p<t;p++)g[p]&&(c=h[k[p]],l[p]=c[0],e[p]=c[1],n[p]=c[2],g[p]=c[3]);else{g=new Uint8Array(t);for(p=0;p<t;p++)c=h[k[p]],l[p]=c[0],e[p]=c[1],n[p]=c[2],g[p]=c[3];d.mask=g}d.pixels=[l,e,n];d.statistics=null;d.pixelType="U8";
d.maskIsAlpha=q;return d}},convolute:function(d,q){d=this._clonePixelBlock(d);var p=d.pixels,t=d.width,g=d.height,c=t*g,a=p.length,b,h,k,l,e=[],n=[],m=q.normalizedKernel,v=q.kernelRows,z=q.kernelCols;for(q=0;q<a;q++){var y=p[q];var D=new Float32Array(c);D.set(y);for(k=1;k<g-1;k++){var B=k*t;for(l=1;l<t-1;l++){for(b=n=0;b<v;b++)for(h=0;h<z;h++)n+=y[B+l+(b-1)*t+h-1]*m[b*z+h];D[B+l]=n}}e.push(D)}d.pixels=e;return d},contrastBrightnessStretch:function(d,q){if(null!==d&&null!==d.pixels){d=this._clonePixelBlock(d);
var p=d.pixels,t=d.mask,g=d.width*d.height,c=p.length;var a=q&&q.contrastOffset;q=q&&q.brightnessOffset;if("U8"!==d.pixelType)throw"the contrast and brightness function only supports 8 bit unsigned integer data";var b=this._createContrastBrightnessLUT(a,q);if(null==t)for(a=0;a<g;a++)for(q=0;q<c;q++)p[q][a]=b[p[q][a]];else for(a=0;a<g;a++)if(t[a])for(q=0;q<c;q++)p[q][a]=b[p[q][a]];d.pixelType="U8";return d}},isNull:function(d,q){if(null!==d&&null!==d.pixels){d=this._clonePixelBlock(d);q=d.mask;var p=
d.pixels[0],t=p.length,g;if(q){for(g=0;g<t;g++)p[g]=q[g]?0:1;d.mask=null}else if(p.fill)p.fill(0);else for(g=0;g<t;g++)p[g]=0;return d}},setNull:function(d){if(null!==q&&null!==q.pixels){var q=this._clonePixelBlock(d);d=q.mask;var p=q.pixels[0],t=p.length,g;d=d||new Uint8Array(t);for(g=0;g<t;g++)d[g]=p[g]?0:1;q.mask=d;return q}},local:function(d,q){if(!q)return d[0];var p=q.rasterCountNeeded;q=q.functor;var t=this._clonePixelBlock(d[0]);if(null!==t&&null!==t.pixels){var g=t.width*t.height,c;d=(c=
d[1])&&c.pixels[0];var a=c&&c.mask,b=t.mask,h=t.pixels[0];if(2===p)if(!b&&a)b=a;else if(b&&a)for(c=0;c<g;c++)b[c]=b[c]&&a[c]?1:0;t.mask=b;if(1===p)if(null==b)for(c=0;c<g;c++)h[c]=q(h[c]);else for(c=0;c<g;c++)b[c]&&(h[c]=q(h[c]));else if(2===p)if(null==b)for(c=0;c<g;c++)h[c]=q(h[c],d[c]);else for(c=0;c<g;c++)b[c]&&(h[c]=q(h[c],d[c]));t.mask=b;t.calculateStatistics();return t}},remapColor:function(d,q){d=this._clonePixelBlock(d);var p=d.width*d.height,t=q.length,g=Math.floor(t/2),c=q[Math.floor(g)],
a=q[0].value,b=q[q.length-1].value,h=d.pixels[0],k,l,e=!1,n=new Uint8Array(p),m=new Uint8Array(p),v=new Uint8Array(p),z=d.mask,y=4===q[0].mappedColor.length;z&&0!==z.length||(z=new Uint8Array(p),z.fill(y?255:1),d.mask=z);for(l=0;l<p;l++)if(z[l]){var D=h[l];if(D<a||D>b)n[l]=m[l]=v[l]=z[l]=0;else{e=!1;var B=g;var H=c;var G=0;for(k=t-1;1<k-G;){if(D===H.value){e=!0;break}D>H.value?G=B:k=B;B=Math.floor((G+k)/2);H=q[Math.floor(B)]}e||(H=D===q[k].value?q[k]:q[G]);n[l]=H.mappedColor[0];m[l]=H.mappedColor[1];
v[l]=H.mappedColor[2];z[l]=H.mappedColor[3]}}d.pixels=[n,m,v];d.mask=z;d.pixelType="u8";d.maskIsAlpha=y;return d},_clonePixelBlock:function(d){if(d.clone)return d.clone();var q=L.clone(d),p;if(d.pixels&&d.pixels[0]&&0<d.pixels[0].length&&!(q.pixels&&q.pixels[0]&&0<q.pixels[0].length)){q.pixels=[];var t=d.pixels.length;for(p=0;p<t;p++)q.pixels[p]=new d.pixels[p].constructor(d.pixels[p])}if(d.statistics)for(q.statistics=[],t=d.statistics.length,p=0;p<t;p++)q.statistics[p]=L.clone(d.statistics[p]);d.mask&&
(q.mask=new Uint8Array(d.mask));return q},_createContrastBrightnessLUT:function(d,q){if(this._contrastCache&&this._contrastCache.contrastOffset===d&&this._contrastCache.brightnessOffset===q)return this._contrastCache.lut;var p=Math.min(Math.max(d,-100),100),t=Math.min(Math.max(q,-100),100),g,c=new Uint8Array(256);for(g=0;256>g;g++){if(0<p&&100>p)var a=(200*g-25500+510*t)/(2*(100-p))+128;else 0>=p&&-100<p?a=(200*g-25500+510*t)*(100+p)/2E4+128:100===p?(a=200*g-25500+256*(100-p)+510*t,a=0<a?255:0):-100===
p&&(a=128);c[g]=255<a?255:0>a?0:a}this._contrastCache={contrastOffset:d,brightnessOffset:q,lut:c};return c}}})},"esri/layers/rasterLib/function/CompositeBandFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin".split(" "),function(L,d,q,p,t,g){return L([q,g],{declaredClass:"esri.layers.rasterLib.function.CompositeBandFunction",functionName:"CompositeBand",supportWebGL:!0,support2D:!0,constructor:function(c){this.functionArguments=
this.mixinIgnoreCase({rasters:null},c)},bind:function(c){c=this.getSourceRasterInfo(c);if(!c.rasters)return Error("The rasters input to composite band function is invalid.");var a=[],b=[],h=c.rasters.length,k;if(c.rasters[0].statistics)for(k=0;k<h;k++)a.push(c.rasters[k].statistics[0]);if(c.rasters[0].histograms)for(k=0;k<h;k++)b.push(c.rasters[k].histograms[0]);this.rasterInfo=d.mixin(c.rasters[0],{bandCount:h,pixelType:this._calculatePixelType(this.pixelType,c.rasters[0].pixelType),statistics:a,
histograms:b});return!0},read2D:function(c){c=c.rasters;if(null!=c&&0!==c.length){var a=this._clonePixelData(c[0]),b=a.pixelBlock,h=[],k=[];for(l=0;l<c.length;l++)h.push(c[l].pixelBlock.pixels[0]),k.push(c[l].pixelBlock.statistics[0]);b.pixels=h;b.stackedStatistics=k;b.planes=c.length;var l;k=b.width*b.height;for(l=0;l<c.length;l++)if(b=c[l].pixelBlock.mask,e&&b)for(h=0;h<k;h++)e[h]&=b[h];else var e=e||b;a.maks=e;return a}},readGL:function(c){this._performance.start();this._initializeProgram({fragment:t.compositeBand,
fragmentName:"CompositeBand"});var a=c.rasters;if(null!=a&&0!==a.length){a=a.length;var b,h=this.bindFrameBuffer();for(b=0;b<a;b++){var k=this._setupTextureData(c.rasters[b],{notOriginal:0<b});var l=0<b?b.toString():"";this._bindTexture(k.texture,"u_image"+l)}this._setUniforms({u_rasterCount:a});this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:k.extent,texture:h.texture}}}})})},"esri/layers/rasterLib/function/ContrastBrightnessFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./rasterUtils".split(" "),
function(L,d,q,p,t,g,c){return L([q,g],{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=d.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 b=c.contrastBrightnessStretch(a.pixelBlock,{contrastOffset:this.functionArguments.contrastOffset,brightnessOffset:this.functionArguments.brightnessOffset});"Unknown"!==
this.pixelType&&(b.pixelType=this.pixelType,b.pixels=b.pixels.map(d.hitch(this,function(h){return this._clampBand(h,b.pixelType)})));return{extent:a.extent,pixelBlock:b}}},readGL:function(a){return this._cbGL(a.raster)},_cbGL:function(a){this._performance.start();this._initializeProgram({fragment:t.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 b=this.bindFrameBuffer();this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:a.extent,texture:b.texture}}})})},"esri/layers/rasterLib/function/ConvolutionFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./convolutionKernel ./pixelShaders ./RasterFunctionWebGLMixin ./rasterUtils".split(" "),function(L,d,q,p,t,g,c,a){return L([q,
c],{declaredClass:"esri.layers.rasterLib.function.ConvolutionFunction",functionName:"Convolution",supportWebGL:!0,support2D:!0,constructor:function(b){this.functionArguments=this.mixinIgnoreCase({columns:3,rows:3,type:0,kernel:null,raster:null},b)},bind:function(b){b=this.getSourceRasterInfo(b);if(!b.raster)return Error("The raster input to convolution function is invalid.");this.rasterInfo=d.mixin(b.raster,{bandCount:b.raster.bandCount,pixelType:this._calculatePixelType(this.pixelType,b.raster.pixelType),
statistics:b.raster.statistics,histograms:b.raster.histograms});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType="Generic";return!0},read2D:function(b){this._performance.start();b=b.raster;var h=this._analyzeKernel(),k=a.convolute(b.pixelBlock,{normalizedKernel:h.normalizedKernel,kernelCols:this.functionArguments.columns,kernelRows:this.functionArguments.rows});this._addPerformanceMetric(this._performance.elapsed());"Unknown"!==this.pixelType&&
(k.pixelType=this.pixelType);k.pixels=k.pixels.map(d.hitch(this,function(l){return this._clampBand(l,k.pixelType)}));return{extent:b.extent,pixelBlock:k}},readGL:function(b){this._performance.start();this._initializeProgram({fragment:g.convolution,fragmentName:"Convolution"});var h=this._setupTextureData(b.raster),k=this.bindFrameBuffer(),l=this.gl,e=l.drawingBufferWidth;l=l.drawingBufferHeight;var n=this.functionArguments.kernel;this._setUniforms({u_resolution:b&&b.raster&&b.raster.pixelBlock?[1/
b.raster.pixelBlock.width,1/b.raster.pixelBlock.height]:[1/e,1/l],u_kernel:n,u_kernelSize:n.length});this._bindTexture(h.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:h.extent,texture:k.texture}},_analyzeKernel:function(){var b=this.functionArguments.kernel,h=b.reduce(function(e,n){return e+n});0!==h&&1!==h&&(b=b.map(function(e){return e/h}));var k,l=[];for(k=0;k<b.length;k++)l.some(function(e){return e===b[k]})||l.push(b[k]);return{normalizedKernel:b,
distinctValues:l}},_analyzeKernelPattern:function(){var b=this.functionArguments.rows,h=this.functionArguments.columns,k=this.functionArguments.kernel,l=[],e,n;for(e=0;e<b;e++)l.push({weights:k.slice(e*h,(e+1)*h)});var m;for(e=1;e<b;e++){var v=l[e].weights;for(k=0;k<e;k++)if(m=l[k].weights){var z=v[0]/m[0];for(n=1;n<h;n++)v[n]/m[n]!==z&&(z=null);null!==z&&(l[e]={row:k,factor:z})}}return l}})})},"esri/layers/rasterLib/function/ExtractBandFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin".split(" "),
function(L,d,q,p,t,g){return L([q,g],{declaredClass:"esri.layers.rasterLib.function.ExtractBandFunction",functionName:"ExtractBand",supportWebGL:!0,support2D:!0,constructor:function(c){this.functionArguments=this.mixinIgnoreCase({bandIDs:[],missingBandAction:0,raster:null},c)},bind:function(c){c=this.getSourceRasterInfo(c);if(!c.raster)return Error("The raster input to extract band function is invalid.");var a=[],b=c.raster.statistics,h=[],k=c.raster.histograms,l=this.functionArguments.bandIDs.length||
c.raster.bandCount;this.functionArguments.bandIDs.forEach(d.hitch(this,function(e){if(e>=l-1){if(1===this.functionArguments.missingBandAction)return Error("missing band "+e);e=l-1}if(0>e)return Error("missing band "+e);void 0!==b&&null!==b&&0<b.length&&a.push(b[e]);void 0!==k&&null!==k&&0<k.length&&h.push(k[e])}));this.rasterInfo=d.mixin(c.raster,{bandCount:l,pixelType:this._calculatePixelType(this.pixelType,c.raster.pixelType),statistics:a,histograms:h});return!0},read2D:function(c){c=this._clonePixelData(c.raster);
if(null!==c&&null!==c.pixelBlock&&null!==c.pixelBlock.pixels){this._performance.start();var a=c.pixelBlock,b=a.statistics,h=a.pixels,k=h.length;if(null==this.functionArguments.bandIDs)throw"missing bandIDs parameter";if(0===this.functionArguments.bandIDs.length)return c;var l=[],e=[];this.functionArguments.bandIDs.forEach(function(n){if(n>=k-1){if(1===this.functionArguments.missingBandAction)throw"missing band "+n;n=k-1}if(0>n)throw"missing band "+n;l.push(h[n]);void 0!==b&&null!==b&&0<b.length&&
e.push(b[n])});a.pixels=l;a.statistics=e;a.planes=this.functionArguments.bandIDs.length;return c}},readGL:function(c){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:t.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 b=!!(this._alterBand&&c.raster&&c.raster.texture);c=this._setupTextureData(c.raster,{bandIDs:a});var h=this.bindFrameBuffer();b?this._setUniforms({u_bandIDs:a,u_alterBand:this._alterBand}):this._setUniforms({u_bandIDs:a,u_alterBand:!1});this._bindTexture(c.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:c.extent,texture:h.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(L,d,q,p,t,g,c,a,b,h){return L([q,a],{declaredClass:"esri.layers.rasterLib.function.HillshadeFunction",functionName:"Hillshade",supportWebGL:!0,support2D:!0,renderTexture:!0,constructor:function(k){this.functionArguments=this.mixinIgnoreCase({hillshadeType:0,altitude:45,azimuth:315,zFactor:1,slopeType:1,psPower:.664,psFactor:.024,colorRamp:null,raster:null},k);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 l=this._weights.reduce(function(e,
n){return e+n});this._weights=this._weights.map(function(e){return e/l})},bind:function(k){k=this.getSourceRasterInfo(k);if(!k.raster)return Error("The raster input to hillshade function is invalid.");k.raster.statistics&&(this.srcStatistics=k.raster.statistics);this.rasterInfo=d.mixin(k.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(k){this._performance.start();k=k.raster;k=b.hillshade(k,{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:k.extent.spatialReference.wkid&&null==t[k.extent.spatialReference.wkid]});this._addPerformanceMetric(this._performance.elapsed());
return k},readGL:function(k){this._performance.start();this._initializeProgram({fragment:c.hillshade,fragmentName:"Hillshade"});this.functionArguments.colorRamp&&this._indexedColormap&&!this._clrTexture&&(this._clrTexture=this._setupColormapTexture(this._indexedColormap));var l=this._setupTextureData(k.raster),e=this.bindFrameBuffer(),n=this.gl,m=n.drawingBufferWidth;n=n.drawingBufferHeight;var v=l.extent,z=(v.xmax-v.xmin)/m,y=(v.ymax-v.ymin)/n,D=this.functionArguments.altitude,B=this.functionArguments.azimuth,
H=this.functionArguments.zFactor;1===this.functionArguments.hillshadeType&&(H*=2);var G=H/(8*z),J=H/(8*y);.001<H&&v.spatialReference.wkid&&null==t[v.spatialReference.wkid]&&(G/=111E3,J/=111E3);var I=this.functionArguments.psPower,C=this.functionArguments.psFactor;3===this.functionArguments.slopeType&&((G=v.spatialReference.wkid&&null==t[v.spatialReference.wkid])?(G=111E3*z,J=111E3*y,G=(H+Math.pow(G,I)*C)/(8*G),J=(H+Math.pow(J,I)*C)/(8*J)):(G=(H+Math.pow(z,I)*C)/(8*z),J=(H+Math.pow(y,I)*C)/(8*y)));
var f=(90-D)*Math.PI/180;D=Math.cos(f);var r=(360-B+90)*Math.PI/180;B=Math.sin(f)*Math.cos(r);f=Math.sin(f)*Math.sin(r);I=Array(6);C=Array(6);v=Array(6);var w=this._weights,u;if(1===this.functionArguments.hillshadeType){var E=this._azimuths.length;for(u=0;u<E;u++)D=this._altitudes[u],B=this._azimuths[u],f=(90-D)*Math.PI/180,D=Math.cos(f),r=(360-B+90)*Math.PI/180,B=Math.sin(f)*Math.cos(r),f=Math.sin(f)*Math.sin(r),I[u]=D,C[u]=B,v[u]=f}else I[0]=D,C[0]=B,v[0]=f;I=I.map(function(K){return parseFloat(K)});
C=C.map(function(K){return parseFloat(K)});v=v.map(function(K){return parseFloat(K)});this._setUniforms({u_cellSize:[z,y],u_zfactor:H,u_xFactor:G,u_yFactor:J,u_sinZcosA:B,u_sinZsinA:f,u_cosZ:D,u_sinZcosAs:C,u_sinZsinAs:v,u_cosZs:I,u_weights:w,u_hillshadeType:this.functionArguments.hillshadeType,u_resolution:k&&k.raster&&k.raster.pixelBlock?[1/k.raster.pixelBlock.width,1/k.raster.pixelBlock.height]:[1/m,1/n],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(l.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:l.extent,texture:e.texture}},_initializeColormap:function(){this._indexedColormapOffset=0;var k=this._indexedColormap,l=this.functionArguments.colorRamp;
this.functionArguments.colormap?(this._alphaSpecified=(l=h.buildIndexedColormap(this.functionArguments.colormap))&&l.alphaSpecified,this._indexedColormap=l&&l.indexedColormap,this._indexedColormapOffset=l&&l.offset):l?(this._indexedColormap="multipart"===l.type?this.invert?p.createMultiPartColorRamp(this._invertColorRamp(l)):p.createMultiPartColorRamp(l):this.invert?p.createAlgorithmicColorRamp(this._invertColorRamp(l)):p.createAlgorithmicColorRamp(l),l.fromColor&&l.toColor&&"000"===l.fromColor.slice(0,
3).join("")&&"255255255"===l.toColor.slice(0,3).join("")&&(this._clrTexture=this._indexedColormap=null)):this.functionArguments.colormapName?"random"===this.functionArguments.colormapName.toLowerCase()&&(this._indexedColormap=p.createRandomColorRamp()):this._clrTexture=this._indexedColormap=null;if(k&&this._indexedColormap){l=!0;for(var e=0;e<k.length;e++)if(k[e]!==this._indexedColormap[e]){l=!1;break}l||(this._clrTexture=null)}},_setupColormapTexture:function(k){var l=this._createTexture(),e=this.gl,
n=k.length/4,m=new Float32Array(k.length),v;for(v=0;v<k.length;v++)m[v]=k[v]/255;e.getExtension("OES_texture_float");e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,1,0,e.RGBA,e.FLOAT,m);return l}})})},"esri/layers/rasterLib/function/LocalFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./rasterUtils".split(" "),function(L,d,q,p,t,g,c){return L([q,g],{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 b=0;a.raster?b=a.raster.bandCount:a.rasters&&(b=Math.max.apply(null,a.rasters.map(function(h){return h.bandCount})));if(0===b)return Error("The raster input to local function is invalid. It only takes single band input.");a=a.raster||a.rasters.filter(function(h){return!!h.extent})[0];this.rasterInfo=d.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 b=[];b=a.raster?a.raster2?[a.raster,a.raster2]:[a.raster]:a.rasters;a=b.map(function(n){return n.pixelBlock});var h=this.functionArguments.operation;if(null===h)return b[0];this._performance.start();var k=this._getOperations(),l=k.operators[h-1];k=k.functors[h-1];
if(!this.functionArguments.rasters){if(1!==l)throw"no sufficient rasters, require "+l;}else if(999!==l&&this.functionArguments.rasters.length!==l)throw"number of rasters does not meet (short or exceed) the operation requirment, require "+l;var e=31===h?c.isNull(a[0]):50===h?c.setNull(a[0]):c.local(a,{rasterCountNeeded:l,functor:k});"Unknown"!==this.pixelType&&(e.pixelType=this.pixelType,e.pixels=e.pixels.map(d.hitch(this,function(n){return this._clampBand(n,e.pixelType)})));e.statistics||e.calculateStatistics();
return{extent:b[0].extent,pixelBlock:e}},readGL:function(a){this._performance.start();var b=this.functionArguments.operation,h=this._getWebGLOperations(),k=h.operators[b-1],l=t.local;h="result\x3d"+h.functors[b-1]+";";31!==b&&50!==b&&(h+="result \x3d vec4(result.rgb, a.a);");l=l.replace("vec4 replaceme"+k+";",h);h=this.gl.getParameter(this.gl.VERSION);var e="";if(-1<h.toLowerCase().indexOf("webgl 1.0")||-1<h.toLowerCase().indexOf("webgl 0."))e=this._getPolyfill(b);l=l.replace("vec4 polyfill;",e);
1<k&&(l=l.replace("gl_FragColor \x3d localOp1();","gl_FragColor \x3d localOp1();".replace("1",k.toString())));this._initializeProgram({fragment:l,fragmentName:"Local"});b=a.rasters;if(null!=b&&0!==b.length){b=b.length;h=this.bindFrameBuffer();for(k=0;k<b;k++){l=0<k?k.toString():"";var n=this._setupTextureData(a.rasters[k],{reCreate:!0});this._bindTexture(n.texture,"u_image"+l)}this._setUniforms({});this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:n.extent,texture:h.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,b){return a+b},function(a,b){return a-b},function(a,b){return a*b},function(a){return Math.sqrt(a)},function(a,b){return Math.pow(a,b)},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,b){return a&b},function(a,b){return a<<b},function(a){return~a},function(a,b){return a|b},function(a,b){return a>>b},function(a,b){return a^b},function(a,b){return a&&b},function(a){return!a},function(a,b){return a||b},function(a,b){return a!=b},function(a){return Math.cos(a)},function(a,b){return Math.cosh(a)},function(a,b){return a/b},function(a,b){return a==b},function(a){return Math.exp(a)},function(a){return Math.pow(10,a)},function(a){return Math.pow(2,
a)},function(a,b){return a>b?1:0},function(a,b){return a>=b?1:0},function(a,b){return Math.floor(a)},function(a){return!a},function(a){return a},function(a,b){return a<b?1:0},function(a,b){return a<=b?1:0},function(a){return Math.log(a)},function(a,b){return Math.log10(a)},function(a,b){return Math.log2(a)},999,999,999,999,999,999,function(a,b){return a%b},function(a){return-a},function(a,b){return a!=b?1:0},999,function(a,b){return Math.floor(a)},function(a,b){return Math.ceil(a)},function(a,b){return b?
0:a},function(a,b){return Math.sin(a)},function(a,b){return Math.sinh(a)},function(a,b){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,b){return Math.atan2(a,b)},function(a,b){return a/b},function(a,b){return Math.floor(a/b)},999,999,999,999,999,999,999,999,999,999,function(a,b,h){return a?b:h}]}},_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 b=
"";switch(a){case 9:b=this._polyfill.atanh;break;case 22:b=this._polyfill.cosh;break;case 52:b=this._polyfill.sinh;break;case 57:b=this._polyfill.tanh;break;case 59:b=this._polyfill.acosh;break;case 60:b=this._polyfill.asinh}return b},_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(L,d,q,p,t,g,c){return L([q,g],{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=d.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 b=c.mask(a.pixelBlock,{includedRanges:this.functionArguments.includedRanges,noDataInterpretation:this.functionArguments.noDataInterpretation,noDataValues:this.functionArguments.noDataValues});this._addPerformanceMetric(this._performance.elapsed());"Unknown"!==this.pixelType&&(b.pixelType=this.pixelType);return{extent:a.extent,pixelBlock:b}},readGL:function(a){this._performance.start();this._initializeProgram({fragment:t.mask,fragmentName:"Mask"});
a=this._setupTextureData(a.raster);var b=this.bindFrameBuffer(),h=this.functionArguments.includedRanges,k=this.functionArguments.noDataValues?this.functionArguments.noDataValues.map(function(l){return parseFloat(l,10)}):null;this._setUniforms({u_includedRanges:h,u_includedRanges_specified:h?!0:!1,u_noDataValues:k,u_noDataValues_specified:k?!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:b.texture}}})})},"esri/layers/rasterLib/function/NDVIFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./rasterIndex".split(" "),function(L,d,q,p,t,g,c){return L([q,g],{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=d.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 b=c.calculate(a.pixelBlock,{bandIndexes:[this.functionArguments.infraredBandID+1,this.functionArguments.visibleBandID+1].join(" "),method:1}),h;if(this.functionArguments.scaled){var k=b.pixels[0];var l=b.mask;var e=k.length;var n=new Uint8Array(e);if(null==l)for(h=0;h<e;h++)n[h]=100*k[h]+100&255;else for(h=0;h<e;h++)l[h]&&(n[h]=100*k[h]+100&255);b.pixels[0]=n;b.pixelType="U8"}this._addPerformanceMetric(this._performance.elapsed());
"Unknown"!==this.pixelType&&(b.pixelType=this.pixelType);return{extent:a.extent,pixelBlock:b}},readGL:function(a){this._performance.start();this._initializeProgram({fragment:t.ndvi,fragmentName:"NDVI"});var b=this.functionArguments.visibleBandID,h=this.functionArguments.infraredBandID,k=this.functionArguments.scaled||!1;this._alterBand=2<Math.max(h,b)?!0:!1;a=this._setupTextureData(a.raster,{bandIDs:this._alterBand?{bandIDs:[h,b,h]}:null});var l=this.bindFrameBuffer();this._alterBand?this._setUniforms({u_bandId_nir:0,
u_bandId_red:1,u_scaled:k}):this._setUniforms({u_bandId_nir:h,u_bandId_red:b,u_scaled:k});this._bindTexture(a.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:a.extent,texture:l.texture}}})})},"esri/layers/rasterLib/function/SlopeFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../../WKIDUnitConversion ../../PixelBlock ./pixelShaders ./RasterFunctionWebGLMixin ./surfaceUtils".split(" "),function(L,d,q,p,t,g,
c,a){return L([q,c],{declaredClass:"esri.layers.rasterLib.function.SlopeFunction",functionName:"Slope",supportWebGL:!0,support2D:!0,constructor:function(b){this.functionArguments=this.mixinIgnoreCase({zFactor:1,slopeType:1,psPower:.664,psFactor:.024,raster:null},b)},bind:function(b){b=this.getSourceRasterInfo(b);if(!b.raster)return Error("The raster input to slope function is invalid.");this.rasterInfo=d.mixin(b.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(b){this._performance.start();b=b.raster;b=a.slope(b,{zFactor:this.functionArguments.zFactor,psPower:this.functionArguments.psPower,psFactor:this.functionArguments.psFactor,slopeType:this.functionArguments.slopeType,isGCS:b.extent.spatialReference.wkid&&null==p[b.extent.spatialReference.wkid]});
this._addPerformanceMetric(this._performance.elapsed());return b},readGL:function(b){this._performance.start();this._initializeProgram({fragment:g.slope,fragmentName:"Slope"});var h=this._setupTextureData(b.raster),k=this.bindFrameBuffer(),l=this.gl,e=l.drawingBufferWidth;l=l.drawingBufferHeight;var n=h.extent;this._setUniforms({u_resolution:b&&b.raster&&b.raster.pixelBlock?[1/b.raster.pixelBlock.width,1/b.raster.pixelBlock.height]:[1/e,1/l],u_cellSize:[(n.xmax-n.xmin)/e,(n.ymax-n.ymin)/l],u_zfactor:this.functionArguments.zFactor});
this._bindTexture(h.texture,"u_image");this._drawGL();this._addPerformanceMetric(this._performance.elapsed());return{extent:h.extent,texture:k.texture}}})})},"esri/layers/rasterLib/function/StretchFunction":function(){define("dojo/_base/declare dojo/_base/lang ./RasterFunctionX ../../PixelBlock ./vertexShaders ./pixelShaders ./RasterFunctionWebGLMixin".split(" "),function(L,d,q,p,t,g,c){return L([q,c],{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=d.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(b){return b&&null!=b.min?[b.min,b.max,b.mean,b.stddev]:b}):null},_updateStatistisHistograms:function(a){var b=this.functionArguments,
h=b.histograms||this.srcHistograms;if(a&&a.pixelBlock&&a.pixelBlock.pixels){if(0===b.stretchType)this._statistics=b.statistics&&0<b.statistics.length?b.statistics:this.srcStatistics,this._histograms=h;else{var k=a.pixelBlock,l=k.pixels.length,e=6===b.stretchType&&(b.dra||!h)||3===b.stretchType&&b.dra;e&&(k.statistics||k.calculateStatistics(),this._calculateStatisticsHistograms(a));if(b.dra)if(k.statistics||k.calculateStatistics(),e)this._statistics=k.statistics,this._histograms=k.histograms;else for(b=
k.statistics,this._statistics=[],a=0;a<l;a++)this._statistics[a]=[b[a].minValue,b[a].maxValue,0,0];else this._statistics=b.statistics&&0<b.statistics.length?b.statistics:this.srcStatistics,this._histograms=h}this._statistics=this._convertStats(this._statistics);this._gammaCorrection=this._getGammaCorrection()}else this._statistics=b.statistics&&0<b.statistics.length?b.statistics:this.srcStatistics,this._histograms=h,this._gammaCorrection=this._getGammaCorrection(),this._statistics=this._convertStats(this._statistics)},
_getGammaCorrection:function(){var a=this.functionArguments.gamma;if(a){var b=[],h;for(h=0;h<a.length;h++)b[h]=1<a[h]?2<a[h]?6.5+Math.pow(a[h]-2,2.5):6.5+100*Math.pow(2-a[h],4):1;return b}},_stretch:function(a){if(null!==a&&null!==a.pixelBlock&&null!==a.pixelBlock.pixels&&0!==this.functionArguments.stretchType){this._updateStatistisHistograms(a);var b=a.pixelBlock,h=b.pixels;b=b.width*b.height;var k=h.length,l,e;this._createLUT(a);if(null==this.LUT)return this._filterNoLUT(a);var n=this.LUT,m=this.LUTOffset;
for(l=0;l<k;l++){var v=n[l];for(e=0;e<b;e++){var z=h[l][e];h[l][e]=v[z-m]}}a.pixelBlock.pixelType="U8"}},_calculateStatisticsHistograms:function(a){a=a.pixelBlock;var b=a.pixelType,h=a.pixels,k=a.mask,l=h.length,e,n,m=function(C){this.min=-.5;this.max=255.5;this.size=256;d.mixin(this,C);this.counts=this.counts||new Uint32Array(this.size)},v=[],z,y;for(e=0;e<l;e++){var D=new m;var B=D.counts;var H=h[e];if("U8"===b)if(k)for(n=0;n<a.width*a.height;n++)k[n]&&B[H[n]]++;else for(n=0;n<a.width*a.height;n++)B[H[n]]++;
else{var G=a.statistics[e].minValue;var J=a.statistics[e].maxValue;D.min=G;D.max=J;J=(J-G)/256;var I=new Uint32Array(257);if(k)for(n=0;n<a.width*a.height;n++)k[n]&&I[Math.floor((H[n]-G)/J)]++;else for(n=0;n<a.width*a.height;n++)I[Math.floor((H[n]-G)/J)]++;for(n=0;255>n;n++)B[n]=I[n];B[255]=I[255]+I[256]}v.push(D);H=[];G=a.statistics[e].minValue;J=a.statistics[e].maxValue;for(n=y=z=I=0;n<D.size;n++)I+=B[n],z+=n*B[n];z/=I;for(n=0;n<D.size;n++)y+=B[n]*Math.pow(n-z,2);B=Math.sqrt(y/(I-1));n=(z+.5)*(D.max-
D.min)/D.size+D.min;D=B*(D.max-D.min)/D.size;H.push(G);H.push(J);H.push(n);H.push(D);a.statistics[e]={min:G,minValue:G,max:J,maxValue:J,mean:n,stddev:D}}a.histograms=v},_getCutOffPoints:function(a){var b=this.functionArguments,h=999;a&&a.pixelBlock?h=a.pixelBlock.pixels.length:a&&a.texture&&(h=3);a=Math.min(h,this._statistics.length);var k=[],l=[],e,n;switch(b.stretchType){case 5:for(e=0;e<a;e++)k[e]=this._statistics[e][0],l[e]=this._statistics[e][1];break;case 3:for(e=0;e<a;e++)k[e]=this._statistics[e][2]-
b.numberOfStandardDeviations*this._statistics[e][3],l[e]=this._statistics[e][2]+b.numberOfStandardDeviations*this._statistics[e][3],k[e]<this._statistics[e][0]&&(k[e]=this._statistics[e][0]),l[e]>this._statistics[e][1]&&(l[e]=this._statistics[e][1]);break;case 6:for(e=0;e<a;e++){h=this._histograms[e];var m=new Uint32Array(h.size);var v=h.counts;var z=0;var y=-.5===h.min&&1===(h.max-h.min)/v?.5:0;for(n=0;n<h.size;n++)z+=v[n],m[n]=z;v=b.minPercent*z/100;for(n=0;n<h.size;n++)if(m[n]>v){k[e]=h.min+(h.max-
h.min)/h.size*(n+y);break}v=(1-b.maxPercent/100)*z;for(n=h.size-2;0<=n;n--)if(m[n]<v){l[e]=h.min+(h.max-h.min)/h.size*(n+2-y);break}}break;default:for(e=0;e<h;e++)k[e]=0,l[e]=255}return{minCutOff:k,maxCutOff:l}},_createLUT:function(a){var b=this.functionArguments,h=a.pixelBlock,k=h.pixelType;if("U8"===k||"U16"===k||"S8"===k||"S16"===k){if(this._LUTSignature&&(k=this._computeLutSignature(),k.length===this._LUTSignature.length&&!k.some(function(f,r){return f!==this._LUTSignature[r]}.bind(this))))return;
k=h.pixels.length;var l=[],e=[],n=b.max,m=b.min,v=b.gamma,z=n-m,y=this._getCutOffPoints(a);a=y.minCutOff;y=y.maxCutOff;var D=0,B=256;"S8"===h.pixelType?D=-127:"S16"===h.pixelType&&(D=-32767);if("U16"===h.pixelType||"S16"===h.pixelType)B=65536;for(h=0;h<k;h++)l[h]=y[h]-a[h];var H=this._gammaCorrection;if(b.useGamma)for(h=0;h<k;h++){var G=[];for(b=0;b<B;b++){var J=b+D;var I=(J-a[h])/l[h];var C=1;1<v[h]&&(C-=Math.pow(1/z,I*H[h]));J<y[h]&&J>a[h]?G[b]=Math.floor(C*z*Math.pow(I,1/v[h]))+m:J>y[h]?G[b]=n:
J<a[h]&&(G[b]=m)}e[h]=G}else for(h=0;h<k;h++){G=[];for(b=0;b<B;b++)J=b+D,G[b]=J<a[h]?m:J>y[h]?n:Math.floor((J-a[h])/l[h]*z)+m;e[h]=G}this.LUT=e;this.LUTOffset=D;this._LUTSignature=this._computeLutSignature()}},_computeLutSignature:function(){var a=this.functionArguments,b=[],h,k;b.push(a.stretchType);b.push(a.min);b.push(a.max);b.push(a.numberOfStandardDeviations);if(this._statistics)for(h=0;h<this._statistics.length;h++)for(k=0;k<this._statistics[h].length;k++)b.push(this._statistics[h][k]);b.push(a.dra?
1:0);b.push(a.minPercent);b.push(a.maxPercent);if(a.gamma)for(h=0;h<this._statistics.length;h++)b.push(a.gamma[h]);b.push(a.useGamma?1:0);return b},_filterNoLUT:function(a){if(null!==a&&null!==a.pixelBlock&&null!==a.pixelBlock.pixels){var b=this.functionArguments,h=a.pixelBlock,k=h.pixels,l=h.mask;h=h.width*h.height;var e=k.length,n=[],m=[],v=b.max,z=b.min,y=b.gamma,D=v-z;var B=this._getCutOffPoints(a);var H=B.minCutOff,G=B.maxCutOff;for(B=0;B<e;B++)n[B]=G[B]-H[B];if(b.useGamma&&null!==y&&y.length>=
e)for(B=0;B<e;B++)m[B]=1<y[B]?2<y[B]?6.5+Math.pow(y[B]-2,2.5):6.5+100*Math.pow(2-y[B],4):1;if(b.useGamma)if(void 0!==l&&null!==l)for(b=0;b<h;b++){if(l[b])for(B=0;B<e;B++){var J=k[B][b];var I=(J-H[B])/n[B];var C=1;1<y[B]&&(C-=Math.pow(1/D,I*m[B]));J<G[B]&&J>H[B]?k[B][b]=Math.floor(C*D*Math.pow(I,1/y[B]))+z:J>G[B]?k[B][b]=v:J<H[B]&&(k[B][b]=z)}}else for(b=0;b<h;b++)for(B=0;B<e;B++)J=k[B][b],I=(J-H[B])/n[B],C=1,1<y[B]&&(C-=Math.pow(1/D,I*m[B])),J<G[B]&&J>H[B]?k[B][b]=Math.floor(C*D*Math.pow(I,1/y[B]))+
z:J>G[B]?k[B][b]=v:J<H[B]&&(k[B][b]=z);else if(void 0!==l&&null!==l)for(b=0;b<h;b++){if(l[b])for(B=0;B<e;B++)J=k[B][b],J<G[B]&&J>H[B]?k[B][b]=Math.floor((J-H[B])/n[B]*D)+z:J>G[B]?k[B][b]=v:J<H[B]&&(k[B][b]=z)}else for(b=0;b<h;b++)for(B=0;B<e;B++)J=k[B][b],J<G[B]&&J>H[B]?k[B][b]=Math.floor((J-H[B])/n[B]*D)+z:J>G[B]?k[B][b]=v:J<H[B]&&(k[B][b]=z);a.pixelBlock.pixelType="U8";return a}},_computeGammaValues:function(a){var b=this._statistics.length,h,k=[];for(h=0;h<b;h++){var l=this._statistics[h][2];"U8"!==
a&&(l=255*(l-this._statistics[h][0])/(this._statistics[h][1]-this._statistics[h][0]));k.push(this._computeGammaValue(l))}return k},_computeGammaValue:function(a){if(0!==a&&!(255<a||0>a)){var b=0;0<a&&150!=a&&255>a&&(b=150>=a?45*Math.cos(.01047*a):17*Math.sin(.021*a));b=Math.log((a+b)/255);if(0!==b&&(a=Math.log(a/255)/b,!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 b=this.renderTexture,h,k=
a.pixelBlock&&a.pixelBlock.pixels&&a.pixelBlock.pixels.length||this.sourceRasterInfo.raster.bandCount,l=a.pixelBlock,e=this.gl,n=e.drawingBufferWidth,m=e.drawingBufferHeight;if(!l&&this.functionArguments.dra){var v=new Float32Array(n*m*4),z=new Uint8Array(n*m);var y=new Float32Array(n*m);var D=new Float32Array(n*m);var B=new Float32Array(n*m);e.checkFramebufferStatus(e.FRAMEBUFFER)==e.FRAMEBUFFER_COMPLETE&&e.readPixels(0,0,n,m,e.RGBA,e.FLOAT,v);for(h=0;h<n*m;h++)y[h]=v[4*h],D[h]=v[4*h+1],B[h]=v[4*
h+2],z[h]=v[4*h+3];a.pixelBlock=new p({width:n,height:m,pixels:[y,D,B],mask:z});a.pixelBlock.calculateStatistics()}!l&&this.functionArguments.dra&&this._useGPUStats?(y=new Float32Array(k),D=new Float32Array(k)):(this._updateStatistisHistograms(a),v=this._getCutOffPoints(a),y=new Float32Array(k),D=new Float32Array(k),y.set(v.minCutOff.slice(0,k)),D.set(v.maxCutOff.slice(0,k)));this._initializeProgram({fragment:g.stretch,fragmentName:"Stretch"});v=this._setupTextureData(a);z=this.bindFrameBuffer();
this.renderTexture=!1;this._performance.start();if(!l&&this.functionArguments.dra&&this._useGPUStats){this._setUniforms({u_sourceDim:[n,m],u_bandCount:k});if(1===k)var H=this._readMinMax(v,2);else{H=this._readMinMax(v,0);var G=this._readMinMax(v,1)}if(6===this.functionArguments.stretchType||3===this.functionArguments.stretchType&&this.functionArguments.dra)h=this._readHistogram(H,G,a),y=h.minCutOff||y,D=h.minCutOff||D}B=this.functionArguments.max-this.functionArguments.min;a=new Float32Array(k);for(h=
0;h<k;h++)a[h]=B/(D[h]-y[h]);this._useGPUStats&&this._initializeProgram({fragment:g.stretch,fragmentName:"Stretch"});e.blendFunc(e.SRC_ALPHA,e.ZERO);B=new Float32Array(3);var J=new Float32Array(3);for(h=0;3>h;h++)B[h]=this.functionArguments.min,J[h]=this.functionArguments.max;h=this.functionArguments.useGamma;var I=this.functionArguments.gamma,C=this._gammaCorrection;Array.isArray(I)&&I.length>=k||(h=!1);this._setUniforms({u_sourceDim:[n,m],u_bandCount:k,u_minOutput:B,u_maxOutput:J,u_minCutOff:y,
u_maxCutOff:D,u_factor:a,u_state:100,u_useGamma:h,u_gamma:I,u_scaled:!b,u_gammaCorrection:C,u_minMaxTexture:!l&&this.functionArguments.dra&&this._useGPUStats?!0:!1});this.renderTexture=b;e.viewport(0,0,n,m);this._bindTexture(v.texture,"u_image");!l&&this.functionArguments.dra&&this._useGPUStats&&(b=e.getUniformLocation(this.rasterProgram,"u_image1"),e.uniform1i(b,1),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,H.texture),1<k&&(k=e.getUniformLocation(this.rasterProgram,"u_image2"),e.uniform1i(k,
2),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,G.texture)));this._drawGL();return{extent:v.extent,texture:z.texture}},_readMinMax:function(a,b){var h=this.gl,k=a.width||h.drawingBufferWidth,l=a.height||h.drawingBufferHeight;this._setUniforms({u_state:b});this.renderTexture=!1;var e=a.texture;for(h.activeTexture(h.TEXTURE0);1<k||1<l;){var n=this._createTexture();b=Math.max(Math.ceil(k/2),1);var m=Math.max(Math.ceil(l/2),1);h.getExtension("OES_texture_float");h.texImage2D(h.TEXTURE_2D,0,
h.RGBA,b,m,0,h.RGBA,h.FLOAT,null);a=h.createFramebuffer();h.bindFramebuffer(h.FRAMEBUFFER,a);h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,n,0);h.viewport(0,0,b,m);h.bindTexture(h.TEXTURE_2D,e);this._setUniforms({u_sourceDim:[k,l]});k=b;l=m;this._drawGL(!0);e=n}a=new Float32Array(k*l*4);h.checkFramebufferStatus(h.FRAMEBUFFER)==h.FRAMEBUFFER_COMPLETE&&h.readPixels(0,0,k,l,h.RGBA,h.FLOAT,a);return{texture:n,minmax:a}},_readHistogram:function(a,b,h){if(a)try{var k=this.gl,l=k.drawingBufferWidth,
e=k.drawingBufferHeight,n,m,v;if(a.texture instanceof WebGLTexture){var z=!0;var y=[1,0,0,1];if(b){var D=a.minmax;var B=b.minmax}else D=[a.minmax[0]],B=[a.minmax[1]]}else for(B=b,D=a,y=new Float32Array(B.length),n=0;n<B.length;n++)y[n]=256/(B[n]-D[n]);var H=new Float32Array(l*e);for(v=0;v<H.length;v++)H[v]=v;if(!this.histogramProgram){var G=t.getShader(k,t.histogram),J=g.getShader(k,g.constant);this.histogramProgram=this._loadProgram(G,J)}k.blendFunc(k.ONE,k.ONE);k.enable(k.BLEND);k.useProgram(this.histogramProgram);
var I=k.getAttribLocation(this.histogramProgram,"a_pixelIndex"),C=k.createBuffer();k.bindBuffer(k.ARRAY_BUFFER,C);k.bufferData(k.ARRAY_BUFFER,H,k.STATIC_DRAW);k.enableVertexAttribArray(I);k.vertexAttribPointer(I,1,k.FLOAT,!1,0,0);var f=this._setupHistTexture(h),r=this._createTexture();k.getExtension("OES_texture_float");k.texImage2D(k.TEXTURE_2D,0,k.RGBA,257,1,0,k.RGBA,k.FLOAT,null);var w=k.createFramebuffer();k.bindFramebuffer(k.FRAMEBUFFER,w);k.framebufferTexture2D(k.FRAMEBUFFER,k.COLOR_ATTACHMENT0,
k.TEXTURE_2D,r,0);k.viewport(0,0,257,1);var u=k.getUniformLocation(this.histogramProgram,"u_image");k.uniform1i(u,0);k.activeTexture(k.TEXTURE0);k.bindTexture(k.TEXTURE_2D,f);var E=k.getUniformLocation(this.histogramProgram,"u_sourceDim");k.uniform2f(E,l,e);var K=k.getUniformLocation(this.histogramProgram,"u_bandCount");k.uniform1i(K,3);var Q=k.getUniformLocation(this.histogramProgram,"u_halfPixel");k.uniform2f(Q,.5/l,.5/e);var V=k.getUniformLocation(this.histogramProgram,"u_minMaxTexture");if(z){k.uniform1i(V,
1);var W=k.getUniformLocation(this.histogramProgram,"u_image1");k.uniform1i(W,1);k.activeTexture(k.TEXTURE1);k.bindTexture(k.TEXTURE_2D,a.texture);if(b){var Y=k.getUniformLocation(this.histogramProgram,"u_image2");k.uniform1i(Y,2);k.activeTexture(k.TEXTURE2);k.bindTexture(k.TEXTURE_2D,b.texture)}}else{var ja=k.getUniformLocation(this.histogramProgram,"u_mins");k.uniform4f(ja,D[0],D[0],D[0],D[0]);k.uniform1i(V,0)}var ba=k.getUniformLocation(this.histogramProgram,"u_color"),fa=k.getUniformLocation(this.histogramProgram,
"u_factors"),ua=k.getUniformLocation(this.histogramProgram,"u_size");k.uniform1f(ua,256);a=[];b=[];k.uniform4fv(ba,[1,0,0,1]);k.uniform4fv(fa,[y[0],0,0,1]);k.drawArrays(k.POINTS,0,H.length);var xa=this.sourceRasterInfo.raster.bandCount;1<xa&&(k.uniform4fv(ba,[0,1,0,1]),k.uniform4fv(fa,[0,y[0],0,1]),k.drawArrays(k.POINTS,0,H.length),k.uniform4fv(ba,[0,0,1,1]),k.uniform4fv(fa,[0,0,y[0],1]),k.drawArrays(k.POINTS,0,H.length));if(k.checkFramebufferStatus(k.FRAMEBUFFER)==k.FRAMEBUFFER_COMPLETE){var va=
new Float32Array(1028);k.readPixels(0,0,257,1,k.RGBA,k.FLOAT,va);k=0;var P=-.5===D[0]&&1===(B[0]-D[0])/256?.5:0;for(n=0;n<xa;n++){var N=new Float32Array(257);var A=new Float32Array(257);for(v=k=0;256>v;v++)k+=va[4*v+n],N[v]=k,A[v]=va[4*v+n];A[256]=va[1024+n];N[256]=k+va[1024+n];var M=this.functionArguments.minPercent*k/100;if(B){for(m=0;256>m;m++)if(N[m]>M){a[n]=D[0]+(B[0]-D[0])/256*(m+P);break}M=(1-this.functionArguments.maxPercent/100)*k;for(m=254;0<=m;m--)if(N[m]<M){b[n]=D[0]+(B[0]-D[0])/256*(m+
2-P);break}}}}return{histogram:va,minCutOff:a,maxCutOff:b}}catch(O){console.debug("webgl filter exception: "+O.message)}},_setupHistTexture:function(a){if(a instanceof WebGLTexture)return a;var b=this.originalHistTexture=this._createTexture(),h=this.gl;a=a.pixelBlock;var k=a.width,l=a.height;h.getExtension("OES_texture_float");this.rgbaFloatData=a.getAsRGBAFloat();h.texImage2D(h.TEXTURE_2D,0,h.RGBA,k,l,0,h.RGBA,h.FLOAT,this.rgbaFloatData);return b}})})},"esri/layers/rasterLib/function/RemapFunction":function(){define("dojo/_base/declare dojo/_base/lang ../../../renderers/colorRampGenerator ./RasterFunctionX ./pixelShaders ./RasterFunctionWebGLMixin ./rasterUtils".split(" "),
function(L,d,q,p,t,g,c){return L([p,g],{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 b=!(!this.functionArguments.outputColors&&!this.functionArguments.colorBreaks);
this.rasterInfo=d.mixin(a.raster,{bandCount:b?3:1,pixelType:this._calculatePixelType(this.pixelType,"U8"),statistics:null,histograms:null});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};this.rasterInfo.keyProperties.DataType=b?"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 b=c.remapColor(a.pixelBlock,this.functionArguments.colorBreaks);this._addPerformanceMetric(this._performance.elapsed());
return{extent:a.extent,pixelBlock:b}},_remapGL:function(a){this._performance.start();this._initializeProgram({fragment:t.remap,fragmentName:"Remap"});var b=new Uint8Array(64),h=this.functionArguments.colorBreaks;h.forEach(function(n,m){b[4*m]=n.mappedColor[0];b[4*m+1]=n.mappedColor[1];b[4*m+2]=n.mappedColor[2];b[4*m+3]=1>=n.mappedColor[3]?255*n.mappedColor[3]:n.mappedColor[3]});var k=h[h.length-1],l=k.mappedColor;b[60]=l[0];b[61]=l[1];b[62]=l[2];b[63]=1>=l[3]?255*l[3]:l[3];var e=new Float32Array(16);
h.forEach(function(n,m){e[m]=n.value});e[15]=k.value;this._clrTexture||(this._clrTexture=this._setupColormapTexture(b));h=this._clrTexture;k=this.bindFrameBuffer();a=this._setupTextureData(a);this._setUniforms({u_indexedColormapOffset:0,u_indexedColormapMaxIndex:b.length/4-1,u_breaks:e});this._bindTexture(h,"u_image1");this._bindTexture(a.texture,"u_image");this._drawGL();return{extent:a.extent,texture:k.texture}},_setupColormapTexture:function(a){var b=this._createTexture(),h=a.length/4,k=new Float32Array(a.length),
l=this.renderTexture?255:1,e,n=this.gl;for(e=0;e<a.length;e++)k[e]=a[e]/l;n.getExtension("OES_texture_float");n.texImage2D(n.TEXTURE_2D,0,n.RGBA,h,1,0,n.RGBA,n.FLOAT,k);return b}})})},"esri/layers/rasterLib/function/IdentityFunction":function(){define(["dojo/_base/declare","dojo/_base/lang","./pixelShaders","./RasterFunctionX","./RasterFunctionWebGLMixin"],function(L,d,q,p,t){return L([p,t],{declaredClass:"esri.layers.rasterLib.function.IdentityFunction",functionName:"Identity",supportWebGL:!0,support2D:!0,
constructor:function(g){this.functionArguments={raster:null}},bind:function(g){g=this.getSourceRasterInfo(g);if(!g.raster)return Error("The raster input to identity function is invalid.");this.rasterInfo=d.mixin(g.raster,{});return!0},read2D:function(g){return g.raster},readGL:function(g){this._initializeProgram({fragment:q.identity,fragmentName:"identity"});g=this._setupTextureData(g.raster);var c=this.bindFrameBuffer();this._bindTexture(g.texture,"u_image");this._drawGL();return{extent:g.extent,
texture:c.texture}}})})},"esri/layers/rasterLib/function/ResampleFunction":function(){define(["dojo/_base/declare","dojo/_base/lang","./pixelShaders","./RasterFunctionX","./RasterFunctionWebGLMixin"],function(L,d,q,p,t){return L([p,t],{declaredClass:"esri.layers.rasterLib.function.ResampleFunction",renderTexture:!0,resamplingOrigin:null,resamplingRatio:null,zFactor:1,functionName:"Resample",supportWebGL:!0,support2D:!1,constructor:function(g){this.functionArguments=this.mixinIgnoreCase({resamplingType:0},
g)},bind:function(g){g=this.getSourceRasterInfo(g);if(!g.raster)return Error("The raster input to convolution function is invalid.");this.rasterInfo=d.mixin(g.raster,{bandCount:g.raster.bandCount,pixelType:this._calculatePixelType(this.pixelType,g.raster.pixelType),statistics:g.raster.statistics,histograms:g.raster.histograms});this.rasterInfo.keyProperties=this.rasterInfo.keyProperties||{};return!0},readGL:function(g){this._performance.start();this._initializeProgram({fragment:q.resample,fragmentName:"Resample"});
var c=this._setupTextureData(g.raster),a=this.bindFrameBuffer(),b=this.gl,h=b.drawingBufferWidth;b=b.drawingBufferHeight;var k=g.raster;void 0!==k.pixelBlock?(c=c||this._setupTextureData(k),g=k.pixelBlock.width,k=k.pixelBlock.height):(c=c||k,g=h,k=b);this._setUniforms({u_resamplingRatio:this.resamplingRatio||[g/h,k/b],u_anchor:this.resamplingOrigin||[0,1],u_resamplingType:this.functionArguments.resamplingType,u_resolution:[1/h,1/b]});this._drawGL();this._addPerformanceMetric(this._performance.elapsed());
return{extent:c.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(L,d,q,p,t,g,c,a,b){var h=function(){function k(e){l[e.prototype.rendererName]=e}var l={};k(p);k(g);k(c);k(t);k(a);k(b);return l}();return{wellKnownRenderers:h,
isSupported:function(k){if(!k)return!1;var l=!0;h[k.rendererName]||(l=!1);return l},create:function(k){if(!k)return null;if(k.rendererName){var l=k.rendererName;k=k.rendererArguments}else l="uniqueValue rasterStretch rasterShadedRelief rgb rasterColormap classBreaks".split(" ").indexOf(k.type),l="UniqueValue Stretch ShadedRelief RGB Colormap ClassBreaks".split(" ")[l],"rasterStretch"===k.type&&k.bandIndex&&1<k.bandIndex.length&&(l="RGB");return(l=h[l])?new l(k):null},createDefaultRenderer:function(k){if(k&&
k.raster){var l=k.raster.rasterInfo,e=k.raster.dataType;if(l){var n=k.raster.rasterFunction,m=["Stretch","Colormap","ContrastAndBrightness"];if(n&&"U8"===l.pixelType&&-1<m.indexOf(n.functionName))n.renderTexture=!0;else if("Processed"!==e||!(k.useWebGL&&n&&n.renderTexture||!k.useWebGL&&"U8"===l.pixelType)){n&&(l=n.rasterInfo);n=l.bandCount;var v=l.colormap,z=l.vat;m=l.histograms;m&&0===m.length&&(m=null);var y=l.statistics&&l.statistics.map(function(H){return[H.min,H.max,H.mean,H.stddev]});if(1===
n&&v&&0<v.length)var D=this._getDefaultColormapRenderer(z,v);else if(1===n&&z&&z.features&&0<z.features.length)D=new t({});else{v=0;z=!1;e||!k.raster||!k.raster.tileInfo||void 0!==k.raster.tileInfo.tileType&&"Map"!==k.raster.tileInfo.tileType?"U8"===l.pixelType&&"Processed"===e?(v=5,y=y||[[0,255,0,0],[0,255,0,0],[0,255,0,0]],z=!1):"U8"===l.pixelType||"Elevation"===e?(v=5,z=y?!1:!0):"Scientific"===e||"StdTime"===e?(v=5,z=y?!1:!0,D=this._getDefaultScientificColorRamp()):m&&0<m.length?(v=6,z=!1):y?(v=
5,z=!1):(v=6,z=!0):(y=[[0,255,0,0],[0,255,0,0],[0,255,0,0]],v=5,z=!1);y||(v=5,z=!0);var B;3<=n&&!(k.bandIds||k.raster&&k.raster.imageServiceParams&&k.raster.imageServiceParams.bandIds)&&(B=this.getDefaultBandCombination(l));B&&(y=B.map(function(H){return y[H]}));k={stretchType:v,min:0,max:255,dra:z,minPercent:.25,maxPercent:.25,useGamma:!1,computeGamma:!1,statistics:y,histograms:m,numberOfStandardDeviations:2.5,bandIndex:B};1===n||B&&1===B.length?(D&&(k.colorRamp=D,k.invert=!1),D=new c(k)):D=new g(k)}return D}}}},
getDefaultBandCombination:function(k){var l=k.bandCount;if(1===l)return null;if(2===l)return[0];var e=(k=k.keyProperties)&&k.ChangeAnalysisParameters&&k.ChangeAnalysisParameters.AnalysisType;if(e&&("ccdc"===e.toLowerCase()||"landtrendr"===e.toLowerCase()))return[0];k=k&&k.BandProperties;var n;if(k&&k.length===l){var m=this.getWellKnownBandIndexes(k);k=m.red;e=m.green;var v=m.blue;m=m.nir;null!=k&&null!=e&&null!=v?n=[k,e,v]:null!=m&&null!=k&&null!=e&&(n=[m,k,e])}!n&&3<=l&&(n=[0,1,2]);return n},getWellKnownBandIndexes:function(k){for(var l=
{},e=0;e<k.length;e++){var n=k[e],m=n.BandName&&n.BandName.toLowerCase();"red"===m?l.red=e:"green"===m?l.green=e:"blue"===m?l.blue=e:"nearinfrared"===m||"nearinfrared_1"===m||"nir"===m?l.nir=e:n.WavelengthMax&&n.WavelengthMin&&(m=n.WavelengthMin,n=n.WavelengthMax,null==l.blue&&410<=m&&480>=m&&480<=n&&540>=n?l.blue=e:null==l.green&&490<=m&&560>=m&&560<=n&&610>=n?l.green=e:null==l.red&&595<=m&&670>=m&&660<=n&&730>=n?l.red=e:null==l.nir&&700<=m&&860>=m&&800<=n&&950>=n&&(l.nir=e))}return l},_getDefaultColormapRenderer:function(k,
l){if(l||l.length){var e=[],n=this._ratContainsColormap(k);if(n)var m=this._getRATValueClassNameMap(k);l.forEach(function(v){var z=m?m[v[0]]:v[0];e.push({color:[v[1],v[2],v[3]],value:v[0],label:n?null!=z?z:"":v[0]})});return new p({colormapInfos:e})}},_ratContainsColormap:function(k){if(!k||!k.fields)return!1;var l,e,n;return k.fields.some(function(m){m&&m.name&&(m=m.name.toLowerCase(),"red"===m&&(l=!0),"green"===m&&(e=!0),"blue"===m&&(n=!0));return l&&e&&n})},_getRATValueClassNameMap:function(k){if(!k||
!k.fields)return null;var l={},e,n;k.fields.forEach(function(m){if("classname"===m.name.toLowerCase()||"class_name"===m.name.toLowerCase())e=m.name;"value"===m.name.toLowerCase()&&(n=m.name)});k.features.forEach(function(m){m=m.attributes;l[m[n]]=e?m[e]:m[n]});return l},_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(k){return{fromColor:k.toColor,
toColor:k.fromColor}}).reverse()}}}})},"esri/layers/rasterLib/renderer/RasterColormapRenderer":function(){define(["dojo/_base/declare","dojo/_base/lang","./RasterRenderer","../function/ColormapFunction"],function(L,d,q,p){return L([q],{declaredClass:"esri.layers.rasterLib.renderer.RasterColormapRenderer",rendererName:"Colormap",renderTexture:!0,constructor:function(t){t&&t.colormapInfos&&(t.colormap=t.colormapInfos.map(function(g){return[g.value].concat(g.color)}));this._function=new p(t);this._function.outputPixelType=
"U8";this._function.renderTexture=!0},draw2D:function(t){this._updateColormapParameters();t=this._clonePixelData(t);return t=this._function._colorize(t)},drawGL:function(t){this._updateColormapParameters();this._function._colorizeGL(t)},toJson:function(){var t=this._function.toJson().rasterFunctionArguments;return{rendererName:this.rendererName,rendererArguments:t}},toCommonRendererJson:function(){return{type:"rasterColormap",colormapInfos:this.colormapInfos||this.colormap.map(function(t){return{value:t[0],
color:t.slice(1),label:t[0]}})}},_updateColormapParameters:function(){var t=this._function.functionArguments;t.colormap=this.colormap;t.colormapName=this.colormapName;t.colorRamp=this.colorRamp;t.colorRampName=this.colorRampName}})})},"esri/layers/rasterLib/renderer/RasterRenderer":function(){define(["dojo/_base/declare","dojo/_base/lang","../../../geometry/Extent","../../PixelBlock"],function(L,d,q,p){return L(null,{declaredClass:"esri.layers.rasterLib.renderer.RasterRenderer",raster:null,constructor:function(t){t=
t||{};this.raster=t.raster||t.Raster||this.raster;this.draw=d.hitch(this,this.draw);this.bind=d.hitch(this,this.bind);t=d.clone(t);Object.keys(t).forEach(function(g){null==t[g]&&delete t[g]});d.mixin(this,t)},bind:function(t){if(!t)throw"failed to bind without options";var g=t;t.layer&&(t=t.layer,g={id:t.id,rawRasterInfo:t.raster.rasterInfo,glSetting:t._glSetting,xformSetting:t.tileManager&&t.tileManager.xformSetting,useWebGL:t.useWebGL,resampling:t.tileMode&&t.tileManager&&t.tileManager.xformSetting.requireProjection&&
!t._hasTilingEffects&&"Thematic"!==t.raster.dataType?1:0,tileMode:t.tileMode});this._rawRasterInfo=g.rawRasterInfo;this.useWebGL=g.useWebGL;this._function&&this._function.setProcessingContext(d.mixin({useProcessedData:!0},g));this._processingContext=g},hasTilingEffects:function(){},draw:function(t){return this.useWebGL?this.drawGL(t):this.draw2D(t)},toJson:function(){},_clonePixelData:function(t){if(null==t)return t;var g={};t.extent&&(g.extent=new q(t.extent.xmin,t.extent.ymin,t.extent.xmax,t.extent.ymax,
t.extent.spatialReference));t=t.processedPixelBlock||t.pixelBlock;if(null==t)return g;g.pixelBlock=t.clone?t.clone():p.prototype.clone(t);return g}})})},"esri/layers/rasterLib/renderer/RasterUniqueValueRenderer":function(){define(["dojo/_base/declare","dojo/_base/lang","./RasterRenderer","../function/ColormapFunction","../../../renderers/colorRampGenerator"],function(L,d,q,p,t){return L([q],{declaredClass:"esri.layers.rasterLib.renderer.RasterUniqueValueRenderer",rendererName:"UniqueValue",field:"",
alias:"",uniqueValueInfos:null,constructor:function(g){g&&g.colormap&&(this.colormap=g.colormap,this._function=new p(g),this._function.outputPixelType="U8",this._function.renderTexture=!0)},bind:function(g){this.inherited(arguments);if(!this._function){var c=(this.raster&&this.raster.rasterInfo||this._rawRasterInfo).vat;if(!c)throw"uv renderer requires data source to have raster attribute table";var a=this.attributeField||this.field1||this.field,b=this.infos||this.uniqueValueInfos;this.defaultColor=
this.defaultColor||this.defaultSymbol&&this.defaultSymbol.color;var h=c.fields.filter(function(D){return"value"===D.name.toLowerCase()})[0];if(h)var k=h.name;a||((a=c.fields.filter(function(D){return-1<["classname","category"].indexOf(D.name.toLowerCase())})[0])||(a=c.fields.filter(function(D){return"esriFieldTypeString"===D.type})[0]),this.alias=(this.field=a=a&&a.name||k)&&a.alias||k);var l=[],e;if(!b){b=[];var n=c.fields.filter(function(D){return"alpha"===D.name.toLowerCase()})[0];var m=c.fields.filter(function(D){return"red"===
D.name.toLowerCase()})[0];var v=c.fields.filter(function(D){return"green"===D.name.toLowerCase()})[0];var z=c.fields.filter(function(D){return"blue"===D.name.toLowerCase()})[0];for(h=0;h<c.features.length;h++){var y=c.features[h].attributes;(e=b.some(function(D){D.value===y[a]}))||(n&&m&&v&&z?b.push({value:y[a],alias:y[a],color:[y[m.name],y[v.name],y[z.name],y[n.name]]}):m&&v&&z?b.push({value:y[a],alias:y[a],color:[y[m.name],y[v.name],y[z.name]]}):b.push({value:y[a],alias:y[a]}))}if(!(m&&v&&z))for(e=
t.createRandomColorRamp({size:b.length}),h=0;h<b.length;h++)b[h].color=e[h];this.uniqueValueInfos=b}if(b)b.forEach(function(D){l=l.concat(c.features.filter(function(B){return D.value==B.attributes[a]}).map(function(B){return[B.attributes[k]].concat(D.color||D.symbol&&D.symbol.color)}))}),this.defaultColor&&c.features.filter(function(D){l.some(function(B){return B[0]===D.attributes[k]})||l.push([D.attributes[k]].concat(this.defaultColor))});else throw"missing uniqueValueInfos property";this._function=
new p({colormap:l});this.colormap=l;this._function.outputPixelType="U8";this._function.renderTexture=!0;this._function.setProcessingContext(this._processingContext)}},draw2D:function(g){g=this._clonePixelData(g);return g=this._function._colorize(g)},drawGL:function(g){this._function._colorizeGL(g)},toJson:function(g){var c={field:this.field,uniqueValueInfos:this.uniqueValueInfos,defaultColor:this.defaultColor};g&&(c.colormap=this.colormap);return{rendererName:this.rendererName,rendererArguments:c}},
toCommonRendererJson:function(){var g=this.attributeField||this.field1||this.field,c=(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:g,uniqueValueInfos:c}}})})},"esri/layers/rasterLib/renderer/RasterRGBRenderer":function(){define("dojo/_base/declare dojo/_base/lang ./RasterRenderer ../function/StretchFunction ../function/ContrastBrightnessFunction ../function/rasterUtils".split(" "),
function(L,d,q,p,t,g){return L([q],{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(c){this.stretchType="number"===typeof this.stretchType?this.stretchType:"none   standardDeviation histogramEqualization minMax percentClip   sigmoid".split(" ").indexOf(this.stretchType);
c=d.mixin({},c,{stretchType:this.stretchType});this._stretchFunction=new p(c);this._stretchFunction.outputPixelType="U8";this._stretchFunction.renderTexture=!1;this.bandIndex=c.bandIndex||c.BandIndex;this._function=new t(c);this._function.functionArguments.raster=this._stretchFunction;this._function.renderTexture=!0},hasTilingEffects:function(){return this._stretchFunction.hasTilingEffects()},draw2D:function(c){this._updateStretchParameters();c=this._clonePixelData(c);if("U8"===c.pixelBlock.pixelType&&
!this.contrastOffset&&!this.brightnessOffset)return c;this._stretchFunction._stretch(c);var a=c.pixelBlock,b=this.bandIndex,h=Math.max.apply(null,b);a&&a.pixels.length>h&&b&&(a.pixels=b.map(function(k){return a.pixels[k]}),a.statistics&&(a.statistics=b.map(function(k){return a.statistics[k]})));if(this.contrastOffset||this.brightnessOffset)c.pixelBlock=g.contrastBrightnessStretch(c.pixelBlock,{contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset});return c},drawGL:function(c){this._updateStretchParameters();
c.pixelBlock&&(c=this._clonePixelData(c));var a=c.pixelBlock,b=this.bandIndex,h=Math.max.apply(null,b),k=this.statistics&&0<this.statistics.length?this.statistics:this._stretchFunction&&this._stretchFunction.srcStatistics,l=this.histograms&&0<this.histograms.length?this.histograms:this._stretchFunction&&this._stretchFunction.srcHistograms,e,n;a&&a.pixels.length>h&&b&&(a.pixels=b.map(function(m){return a.pixels[m]}),a.statistics&&(a.statistics=b.map(function(m){return a.statistics[m]})),k&&0<k.length&&
k.length!==b.length&&(e=b.map(function(m){return k[m]})),l&&0<l.length&&l.length!==b.length&&(n=b.map(function(m){return l[m]})));this._stretchFunction.functionArguments.statistics=e||k;this._stretchFunction.functionArguments.histograms=n||l;this.contrastOffset||this.brightnessOffset?(this._stretchFunction.renderTexture=!1,this._function.renderTexture=!0,c=this._stretchFunction._stretchGL(c),this._function._cbGL(c)):(this._stretchFunction.renderTexture=!0,this._stretchFunction._stretchGL(c))},toJson:function(){var c=
this._stretchFunction.toJson().rasterFunctionArguments;c.bandIndex=this.bandIndex;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",min:this.min,max:this.max,numberOfStandardDeviations:this.numberOfStandardDeviations,statistics:d.clone(this.statistics),
dra:this.dra,minPercent:this.minPercent,maxPercent:this.maxPercent,useGamma:this.useGamma,gamma:d.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/RasterStretchColorRampRenderer":function(){define("dojo/_base/declare dojo/_base/lang ./RasterRenderer ../function/ResampleFunction ../function/StretchFunction ../function/ContrastBrightnessFunction ../function/ColormapFunction ../function/rasterUtils".split(" "),function(L,d,q,p,t,g,c,a){return L([q],
{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(b){this.stretchType="number"===typeof this.stretchType?this.stretchType:"none   standardDeviation histogramEqualization minMax percentClip   sigmoid".split(" ").indexOf(this.stretchType);
b=d.mixin({},b,{stretchType:this.stretchType});Object.keys(b).forEach(function(h){null==b[h]&&delete b[h]});this._function=new g(b);this._stretchFunction=new t(b);this._stretchFunction.outputPixelType="U8";this._stretchFunction.renderTexture=!1;this._clrFunction=new c(b);this._clrFunction.functionArguments.raster=this._stretchFunction;this._clrFunction.renderTexture=!1;this._function.functionArguments.raster=this._clrFunction},hasTilingEffects:function(){return this._stretchFunction.hasTilingEffects()},
draw2D:function(b){this._updateStretchParameters();b=this._clonePixelData(b);if("U8"===b.pixelBlock.pixelType&&!(this.contrastOffset||this.brightnessOffset||this.colorRamp))return b;this._stretchFunction._stretch(b);var h=b.pixelBlock,k=this.bandIndex?this.bandIndex[0]:0;h&&1<h.pixels.length&&h.pixels.length>k&&(h.pixels=[h.pixels[k]],h.statistics&&(h.statistics=[h.statistics[k]]));this.colorRamp&&(b=this._clrFunction._colorize(b));if(this.contrastOffset||this.brightnessOffset)b.pixelBlock=a.contrastBrightnessStretch(b.pixelBlock,
{contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset});return b},drawGL:function(b){this._updateStretchParameters();b.pixelBlock&&(b=this._clonePixelData(b));var h=b.pixelBlock,k=this.bandIndex?this.bandIndex[0]||0:0,l=this.statistics&&0<this.statistics.length?this.statistics:this._stretchFunction&&this._stretchFunction.srcStatistics,e=this.histograms&&0<this.histograms.length?this.histograms:this._stretchFunction&&this._stretchFunction.srcHistograms,n,m;h&&1<h.pixels.length&&
h.pixels.length>k&&(h.pixels=[h.pixels[k]],h.statistics&&(h.statistics=[h.statistics[k]]),l&&l.length>k&&(n=[l[k]]),e&&e.length>k&&(m=[e[k]]));this._stretchFunction.functionArguments.statistics=n||l;this._stretchFunction.functionArguments.histograms=m||e;h=!!this.colorRamp;this.contrastOffset||this.brightnessOffset?(this._stretchFunction.renderTexture=!1,this._clrFunction.renderTexture=!1,this._function.renderTexture=!0,b=this._stretchFunction._stretchGL(b),h&&(b=this._clrFunction._colorizeGL(b)),
this._function._cbGL(b)):h?(this._stretchFunction.renderTexture=!1,this._clrFunction.renderTexture=!0,b=this._stretchFunction._stretchGL(b),this._clrFunction._colorizeGL(b)):(this._stretchFunction.renderTexture=!0,this._stretchFunction._stretchGL(b))},toJson:function(){var b=this._stretchFunction.toJson().rasterFunctionArguments;b.colorRamp=this.colorRamp||"";this.invert&&(b.invert=!0);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",colorRamp:this.colorRamp&&this.colorRamp.toJson?this.colorRamp.toJson():this.colorRamp,min:this.min,max:this.max,numberOfStandardDeviations:this.numberOfStandardDeviations,statistics:d.clone(this.statistics),dra:this.dra,minPercent:this.minPercent,maxPercent:this.maxPercent,useGamma:this.useGamma,
gamma:d.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/RasterClassBreaksRenderer":function(){define(["dojo/_base/declare","dojo/_base/lang","./RasterRenderer","../function/ColormapFunction","../function/RemapFunction"],function(L,d,q,p,t){return L([q],{declaredClass:"esri.layers.rasterLib.renderer.RasterClassBreaksRenderer",rendererName:"ClassBreaks",renderTexture:!0,constructor:function(g){g=g||{};this._function=new t(g);this._function.outputPixelType="U8";var c=
g.classBreakInfos;g=g.minValue;null!=g&&c&&(this._function.functionArguments.colorBreaks=this._getSortedColorBreaks(g,c))},bind:function(g){this.inherited(arguments);this.isColormapFunction=!1;var c=this.raster&&this.raster.rasterInfo||this._rawRasterInfo,a=c&&c.vat;if(a&&"u8"===c.pixelType.toLowerCase()&&this.classBreakInfos){var b=this.field;if(c=a.fields.filter(function(m){return"value"===m.name.toLowerCase()})[0])var h=c.name;var k=a.features.sort(function(m,v){return parseFloat(m.attributes[b])-
parseFloat(v.attributes[b])})[0].attributes[b];this.isColormapFunction=!0;var l=[],e=this.field,n=this.classBreakInfos;n.forEach(function(m,v){a.features.forEach(function(z){var y=n[v-1]&&n[v-1].classMaxValue||k;z.attributes[e]<=m.classMaxValue&&(z.attributes[e]>y||z.attributes[e]===k)&&(y=m.symbol.color,l.some(function(D){return D[0]===z.attributes[h]})||l.push([z.attributes[h]].concat(y)))})});this._function=new p({colormap:l});this.colormap=l;this._function.outputPixelType="U8";this._function.renderTexture=
!0}this._function&&this._function.setProcessingContext(d.mixin({useProcessedData:!0},this._processingContext))},draw2D:function(g){if(this.isColormapFunction)return this._updateColormapParameters(),g=this._clonePixelData(g),g=this._function._colorize(g);this._updateRemapParameters();return this._function._remap(g)},drawGL:function(g){this.isColormapFunction?(this._updateColormapParameters(),this._function._colorizeGL(g)):(this._function.renderTexture=!0,this._updateRemapParameters(),this._function._remapGL(g))},
toJson:function(){var g=this._function.toJson().rasterFunctionArguments;return{rendererName:this.rendererName,rendererArguments:g}},toCommonRendererJson:function(){var g,c=this.classBreakInfos,a=this.colorBreaks;if(null==c&&a)for(c=[],g=0;g<a.length-1;g++)c.push({classMaxValue:a[g+1].value,symbol:{color:a[g].mappedColor,type:"esriSFS",style:"esriSFSSolid"},label:a[g].value+" - "+a[g+1].value});return{type:"classBreaks",field:"Value",minValue:null!=this.minValue?this.minValue:a[0].value,classBreakInfos:c}},
_updateRemapParameters:function(){var g=this.classBreakInfos,c=this.minValue;null!=c&&g&&(this._function.functionArguments.colorBreaks=this._getSortedColorBreaks(c,g))},_getSortedColorBreaks:function(g,c){c=c.map(function(b){return{maxValue:b.classMaxValue,color:b.symbol.color}}).sort(function(b,h){return b.maxValue-h.maxValue});var a=[{value:g,mappedColor:c[0].color}];for(g=0;g<c.length;g++)a.push({value:c[g].maxValue,mappedColor:g===c.length-1?c[g].color:c[g+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(L,d,q,p,t,g,c){return L([q],{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=d.mixin({},a,{hillshadeType:this.hillshadeType,psPower:this.psPower,psFactor:this.psFactor,
slopeType:this.slopeType});Object.keys(a).forEach(function(b){null==a[b]&&delete a[b]});this._function=new t(a);this._hillshadeFunction=new p(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=c.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(L,d,q,p,t,g,c,a,b,h,k){L={requirePE:function(e,n){return!(e.equals(n)||e._canProject(n))},load:function(){var e=new q;if(!this._loadPromise)if(a.isSupported())this._loadPromise=a.load();else{var n=new q;n.reject("projection engine is not supported on this version of the browser, please try with a modern browser");this._loadPromise=n.promise}this._loadPromise.isFulfilled()?this._loadPromise.isResolved()?e.resolve():this._loadPromise.isRejected()&&e.resolve():(this._pendingdfds=this._pendingdfds||
[],this._pendingdfds.push(e),this._loadPromise.then(d.hitch(this,function(){this._pendingdfds.forEach(function(m){m.isFulfilled()||m.resolve()})}),d.hitch(this,function(){this._pendingdfds.forEach(function(m){m.isFulfilled()||m.reject()})})));return e.promise},computeError:function(e,n){return[Math.abs((e[0]+e[4]+e[4*n.rows]+e[4*n.rows+4])/4-e[2*n.rows+2]),Math.abs((e[1]+e[5]+e[4*n.rows+1]+e[4*n.rows+5])/4-e[2*n.rows+3])]},getDefaultDatumTransformationForDataset:function(e,n,m){if(!(n&&e.spatialReference&&
this.requirePE(e.spatialReference,n)&&a.isLoaded()))return null;e=new c(e.toJson());n=new h(n.toJson());return m?a.getTransformation(n,e.spatialReference,e):a.getTransformation(e.spatialReference,n,e)},project:function(e,n,m){if(!n||e.spatialReference.equals(n))return e;var v=a.isLoaded()?a:b;"esri.geometry.Extent"===e.declaredClass?e=new c(e.toJson()):"esri.geometry.Point"===e.declaredClass&&(e=new k(e.toJson()));n=new h(n.toJson());(e=v.project(e,n))&&"esri.geometry.Extent"===e.declaredClass?(e=
new c(e.toJson()),m&&(1E-5>Math.abs(e.xmin+180)&&1E-5>Math.abs(e.xmax-180)?(e.xmin=0,e.xmax=360):(0>e.xmin&&(e.xmin+=360,e.xmax+=360),0>e.xmax&&(e.xmax+=360)))):e&&"esri.geometry.Point"===e.declaredClass&&(e=new k(e.toJson()),m&&0>e.x&&(e.x+=360));return e},projectResolution:function(e,n,m){var v=m.xmin+(m.xmax-m.xmin)/2;m=m.ymin+(m.ymax-m.ymin)/2;e=new c(v,m,v+e.x,m+e.y,e.spatialReference);e=this.project(e,n);return new k(e.xmax-e.xmin,e.ymax-e.ymin,n)},getProjectionOffsetGrid:function(e,n,m,v,z,
y,D){null==D&&(D=[32,32]);var B=e.xmin,H=e.ymin,G=e.xmax,J=e.ymax,I=e.spatialReference,C=n.spatialReference,f=a.isLoaded()?a:b,r=z?-z:null,w=D[0]*m.x,u=D[1]*m.y;G={cols:Math.ceil((G-B)/w)+1,rows:Math.ceil((J-H)/u)+1};e=[];for(J=0;J<G.cols;J++){var E=K;var K=[];for(m=0;m<G.rows;m++){var Q=new k({x:B+w*J,y:H+u*m,spatialReference:I});Q=f.project(Q,C,y);if(!Q)return null;v&&0>Q.x&&(Q.x+=360);K.push(Q);0<J&&null!=r&&Q.x<E[m].x&&(Q.x+=z-r,Q.x<E[m].x&&(Q.x+=z-r));e.push((Q.x-n.xmin)/(n.xmax-n.xmin));e.push((Q.y-
n.ymin)/(n.ymax-n.ymin))}}n=this.computeError(e,G);v=new Float32Array((G.cols-1)*(G.rows-1)*12);z=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]);y=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(J=0;J<G.cols-1;J++)for(m=0;m<G.rows-1;m++){w=J*G.rows*2+2*m;B=e[w];H=e[w+1];K=e[w+2];I=e[w+3];w+=2*G.rows;C=e[w];f=e[w+1];r=e[w+2];u=e[w+3];E=0;Q=12*(m*(G.cols-1)+J);for(w=0;3>w;w++)v[Q++]=z[E++]*B+z[E++]*K+z[E++]*r;for(w=E=0;3>w;w++)v[Q++]=z[E++]*H+z[E++]*I+z[E++]*u;for(w=E=0;3>w;w++)v[Q++]=y[E++]*B+y[E++]*C+y[E++]*
r;for(w=E=0;3>w;w++)v[Q++]=y[E++]*H+y[E++]*f+y[E++]*u}return{offsets:e,error:n,coefficients:v,spacing:D,size:[G.cols-1,G.rows-1]}},getHalfWorldWidth:function(e){var n=e&&e.wkid;if(null!=n)return e.isWebMercator()&&(n=3857),null==g[n]?180:l[n]}};p("extend-esri")&&d.setObject("layers.rasterLib.raster.rasterProjectionHelper",L,t);var l={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 L})},"esri/geometry/projection":function(){define("require exports dojo/Deferred ./pe ../SpatialReference ./GeographicTransformation".split(" "),
function(L,d,q,p,t,g){function c(l,e,n,m,v){void 0===m&&(m=null);void 0===v&&(v=!1);if(null===m){var z=g.cacheKey(e,n);void 0!==k[z]?m=k[z]:(m=a(e,n,null),null===m&&(m=new g),k[z]=m)}return b._project(l,e,n instanceof t||!1===v?n:new t(n),m,v)}function a(l,e,n){void 0===n&&(n=null);l=b._getTransformation(l,e,n);return null!==l?g.fromGE(l):null}Object.defineProperty(d,"__esModule",{value:!0});var b=null;d.isLoaded=function(){return!!b&&p.isLoaded()};d.isSupported=function(){return p.isSupported()};
var h=null;d.load=function(){if(h)return h.promise;h=new q;var l=p.load();L(["./geometryEngine"],function(e){b=e;l.then(function(){b._enableProjection(p);h.resolve()},function(n){h.reject(n)})});return h.promise};d.project=function(l,e,n){void 0===n&&(n=null);return l instanceof Array?0===l.length?[]:c(l,l[0].spatialReference,e,n):c([l],l.spatialReference,e,n)[0]};var k={};d.projectMany=c;d.getTransformation=a;d.getTransformations=function(l,e,n){void 0===n&&(n=null);l=b._getTransformationBySuitability(l,
e,n);if(null!==l){e=[];for(n=0;n<l.length;n++)e.push(g.fromGE(l[n]));return e}return[]}})},"esri/geometry/pe":function(){define(["require","exports","../core/tsSupport/extendsHelper","dojo/Deferred","../core/sniff"],function(L,d,q,p,t){function g(z){function y(G,J,I){G[J]=I(G[J])}d._pe=z;l.init();e.init();n.init();m.init();v.init();d.PeGCSExtent=function(G){function J(){return null!==G&&G.apply(this,arguments)||this}q(J,G);J.prototype.destroy=function(){d._pe.destroy(this)};return J}(d._pe.PeGCSExtent);
for(var D=0,B=[d._pe.PeDatum,d._pe.PeGeogcs,d._pe.PeGeogtran,d._pe.PeObject,d._pe.PeParameter,d._pe.PePrimem,d._pe.PeProjcs,d._pe.PeSpheroid,d._pe.PeUnit];D<B.length;D++)z=B[D],y(z.prototype,"getName",function(G){return function(){return G.call(this,Array(l.PE_NAME_MAX))}});D=0;for(B=[d._pe.PeGeogtran,d._pe.PeProjcs];D<B.length;D++)z=B[D],y(z.prototype,"getParameters",function(G){return function(){for(var J=Array(l.PE_PARM_MAX),I=G.call(this),C=0;C<J.length;C++){var f=d._pe.getValue(I,"*");J[C]=f?
d._pe.wrapPointer(f,d._pe.PeParameter):null;I+=Int32Array.BYTES_PER_ELEMENT}return J}});y(d._pe.PeHorizon.prototype,"getCoord",function(G){return function(){var J=this.getSize();if(!J)return null;var I=[],C=G.call(this);h(I,J,C);return I}});y(d._pe.PeGTlistExtendedEntry.prototype,"getEntries",function(G){var J=d._pe._pe_getPeGTlistExtendedGTsSize();return function(){var I=null,C=G.call(this);if(!d._pe.compare(C,d._pe.NULL)){I=[C];var f=this.getSteps();if(1<f){C=d._pe.getPointer(C);for(var r=1;r<f;r++)I.push(d._pe.wrapPointer(C+
J*r,d._pe.PeGTlistExtendedGTs))}}return I}});var H=d._pe._pe_getPeHorizonSize();z=function(G){return function(){var J=this._cache;J||(this._cache=J=new Map);if(J.has(G))return J.get(G);var I=null,C=G.call(this);if(!d._pe.compare(C,d._pe.NULL)){I=[C];var f=C.getNump();if(1<f){C=d._pe.getPointer(C);for(var r=1;r<f;r++)I.push(d._pe.wrapPointer(C+H*r,d._pe.PeHorizon))}}J.set(G,I);return I}};y(d._pe.PeProjcs.prototype,"horizonGcsGenerate",z);y(d._pe.PeProjcs.prototype,"horizonPcsGenerate",z);d._pe.PeObject.prototype.toString=
function(G){void 0===G&&(G=l.PE_STR_OPTS_NONE);d._pe.ensureCache.prepare();var J=d._pe.getPointer(this),I=d._pe.ensureInt8(Array(l.PE_BUFFER_MAX));return d._pe.UTF8ToString(d._pe._pe_object_to_string_ext(J,G,I))}}function c(z){if(z){var y=d._pe.getClass(z);y&&(y=d._pe.getCache(y))&&(z=d._pe.getPointer(z))&&delete y[z]}}function a(z,y){var D=[];y=Array(y);for(var B=0;B<z;B++)D.push(d._pe.ensureInt8(y));return D}function b(z){if(Array.isArray(z[0])){var y=[];z.forEach(function(D){y.push(D[0],D[1])})}else y=
z;return y}function h(z,y,D,B){void 0===B&&(B=!1);if(B)for(B=0;B<2*y;B++)z[B]=d._pe.getValue(D+B*Float64Array.BYTES_PER_ELEMENT,"double");else{var H=0===z.length;for(B=0;B<y;B++)H&&(z[B]=Array(2)),z[B][0]=d._pe.getValue(D,"double"),z[B][1]=d._pe.getValue(D+Float64Array.BYTES_PER_ELEMENT,"double"),D+=2*Float64Array.BYTES_PER_ELEMENT}}Object.defineProperty(d,"__esModule",{value:!0});var k;d._pe=null;d.isLoaded=function(){return!!d._pe};d.isSupported=function(){return!!t("esri-wasm")};d.load=function(){if(k)return k.promise;
k=new p;L(["./support/pe-wasm"],function(z){z({locateFile:function(y){return L.toUrl("./support/"+y)},onAbort:function(y){k.reject(Error(y))}}).then(function(y){g(y);k.resolve()})});return k.promise};(function(z){function y(H,G,J){d._pe.ensureCache.prepare();var I=b(J),C=J===I;I=d._pe.ensureFloat64(I);(H=d._pe._pe_geog_to_proj(d._pe.getPointer(H),G,I))&&h(J,G,I,C);return H}function D(H,G,J){return B(H,G,J,0)}function B(H,G,J,I){d._pe.ensureCache.prepare();var C=b(J),f=J===C;C=d._pe.ensureFloat64(C);
(H=d._pe._pe_proj_to_geog_center(d._pe.getPointer(H),G,C,I))&&h(J,G,C,f);return H}z.geogToProj=y;z.projGeog=function(H,G,J,I){switch(I){case l.PE_TRANSFORM_P_TO_G:return D(H,G,J);case l.PE_TRANSFORM_G_TO_P:return y(H,G,J)}return 0};z.projToGeog=D;z.projToGeogCenter=B})(d.PeCSTransformations||(d.PeCSTransformations={}));var l;(function(z){z.init=function(){z.PE_BUFFER_MAX=d._pe.PeDefs.prototype.PE_BUFFER_MAX;z.PE_NAME_MAX=d._pe.PeDefs.prototype.PE_NAME_MAX;z.PE_MGRS_MAX=d._pe.PeDefs.prototype.PE_MGRS_MAX;
z.PE_USNG_MAX=d._pe.PeDefs.prototype.PE_USNG_MAX;z.PE_DD_MAX=d._pe.PeDefs.prototype.PE_DD_MAX;z.PE_DDM_MAX=d._pe.PeDefs.prototype.PE_DDM_MAX;z.PE_DMS_MAX=d._pe.PeDefs.prototype.PE_DMS_MAX;z.PE_UTM_MAX=d._pe.PeDefs.prototype.PE_UTM_MAX;z.PE_PARM_MAX=d._pe.PeDefs.prototype.PE_PARM_MAX;z.PE_TYPE_NONE=d._pe.PeDefs.prototype.PE_TYPE_NONE;z.PE_TYPE_GEOGCS=d._pe.PeDefs.prototype.PE_TYPE_GEOGCS;z.PE_TYPE_PROJCS=d._pe.PeDefs.prototype.PE_TYPE_PROJCS;z.PE_TYPE_GEOGTRAN=d._pe.PeDefs.prototype.PE_TYPE_GEOGTRAN;
z.PE_TYPE_COORDSYS=d._pe.PeDefs.prototype.PE_TYPE_COORDSYS;z.PE_TYPE_UNIT=d._pe.PeDefs.prototype.PE_TYPE_UNIT;z.PE_STR_OPTS_NONE=d._pe.PeDefs.prototype.PE_STR_OPTS_NONE;z.PE_STR_AUTH_NONE=d._pe.PeDefs.prototype.PE_STR_AUTH_NONE;z.PE_STR_AUTH_TOP=d._pe.PeDefs.prototype.PE_STR_AUTH_TOP;z.PE_STR_NAME_CANON=d._pe.PeDefs.prototype.PE_STR_NAME_CANON;z.PE_PARM_X0=d._pe.PeDefs.prototype.PE_PARM_X0;z.PE_PARM_ND=d._pe.PeDefs.prototype.PE_PARM_ND;z.PE_TRANSFORM_1_TO_2=d._pe.PeDefs.prototype.PE_TRANSFORM_1_TO_2;
z.PE_TRANSFORM_2_TO_1=d._pe.PeDefs.prototype.PE_TRANSFORM_2_TO_1;z.PE_TRANSFORM_P_TO_G=d._pe.PeDefs.prototype.PE_TRANSFORM_P_TO_G;z.PE_TRANSFORM_G_TO_P=d._pe.PeDefs.prototype.PE_TRANSFORM_G_TO_P;z.PE_HORIZON_RECT=d._pe.PeDefs.prototype.PE_HORIZON_RECT;z.PE_HORIZON_POLY=d._pe.PeDefs.prototype.PE_HORIZON_POLY;z.PE_HORIZON_LINE=d._pe.PeDefs.prototype.PE_HORIZON_LINE;z.PE_HORIZON_DELTA=d._pe.PeDefs.prototype.PE_HORIZON_DELTA}})(l=d.PeDefs||(d.PeDefs={}));(function(z){function y(G,J){var I=null,C=B[G];
C||(C={},B[G]=C);C.hasOwnProperty(String(J))?I=C[J]:(G=d._pe.PeFactory.prototype.factoryByType(G,J),d._pe.compare(G,d._pe.NULL)||(I=G,C[J]=I));return I=D(I)}function D(G){if(G){var J=G.getType();switch(J){case l.PE_TYPE_GEOGCS:G=d._pe.castObject(G,d._pe.PeGeogcs);break;case l.PE_TYPE_PROJCS:G=d._pe.castObject(G,d._pe.PeProjcs);break;case l.PE_TYPE_GEOGTRAN:G=d._pe.castObject(G,d._pe.PeGeogtran);break;default:J&l.PE_TYPE_UNIT&&(G=d._pe.castObject(G,d._pe.PeUnit))}}return G}var B={},H={};z.initialize=
function(){d._pe.PeFactory.prototype.initialize(null)};z.coordsys=function(G){return y(l.PE_TYPE_COORDSYS,G)};z.factoryByType=y;z.fromString=function(G,J){var I=null,C=H[G];C||(C={},H[G]=C);C.hasOwnProperty(J)?I=C[J]:(G=d._pe.PeFactory.prototype.fromString(G,J),d._pe.compare(G,d._pe.NULL)||(I=G,C[J]=I));return I=D(I)};z.geogcs=function(G){return y(l.PE_TYPE_GEOGCS,G)};z.geogtran=function(G){return y(l.PE_TYPE_GEOGTRAN,G)};z.getCode=function(G){return d._pe.PeFactory.prototype.getCode(G)};z.projcs=
function(G){return y(l.PE_TYPE_PROJCS,G)};z.unit=function(G){return y(l.PE_TYPE_UNIT,G)}})(d.PeFactory||(d.PeFactory={}));d.PeGCSExtent=null;var e;(function(z){var y;z.init=function(){z.PE_GTLIST_OPTS_COMMON=d._pe.PeGTlistExtended.prototype.PE_GTLIST_OPTS_COMMON;y=d._pe._pe_getPeGTlistExtendedEntrySize()};z.getGTlist=function(D,B,H,G,J,I){var C=null,f=new d._pe.PeInteger(I);try{var r=d._pe.PeGTlistExtended.prototype.getGTlist(D,B,H,G,J,f);if(I=f.val)if(C=[r],1<I){var w=d._pe.getPointer(r);for(D=1;D<
I;D++)C.push(d._pe.wrapPointer(w+y*D,d._pe.PeGTlistExtendedEntry))}}finally{d._pe.destroy(f)}return C}})(e=d.PeGTlistExtended||(d.PeGTlistExtended={}));(function(z){z.destroy=function(y){if(y&&y.length){for(var D=0;D<y.length;D++){var B=y[D];c(B);B.getEntries().forEach(function(H){c(H);H=H.getGeogtran();c(H);H.getParameters().forEach(c);[H.getGeogcs1(),H.getGeogcs2()].forEach(function(G){c(G);var J=G.getDatum();c(J);c(J.getSpheroid());c(G.getPrimem());c(G.getUnit())})})}d._pe.PeGTlistExtendedEntry.prototype.Delete(y[0])}}})(d.PeGTlistExtendedEntry||
(d.PeGTlistExtendedEntry={}));(function(z){z.geogToGeog=function(y,D,B,H,G){d._pe.ensureCache.prepare();var J=b(B),I=B===J;J=d._pe.ensureFloat64(J);var C=0;H&&(C=d._pe.ensureFloat64(H));(y=d._pe._pe_geog_to_geog(d._pe.getPointer(y),D,J,C,G))&&h(B,D,J,I);return y}})(d.PeGTTransformations||(d.PeGTTransformations={}));(function(z){function y(B,H,G,J,I,C){d._pe.ensureCache.prepare();switch(B){case "dd":var f=d._pe._pe_geog_to_dd;var r=l.PE_DD_MAX;break;case "ddm":f=d._pe._pe_geog_to_ddm;r=l.PE_DDM_MAX;
break;case "dms":f=d._pe._pe_geog_to_dms,r=l.PE_DMS_MAX}B=0;H&&(B=d._pe.getPointer(H));H=b(J);H=d._pe.ensureFloat64(H);r=a(G,r);J=d._pe.ensureInt32(r);if(I=f(B,G,H,I,J))for(f=0;f<G;f++)C[f]=d._pe.UTF8ToString(r[f]);return I}function D(B,H,G,J,I){d._pe.ensureCache.prepare();switch(B){case "dd":var C=d._pe._pe_dd_to_geog;break;case "ddm":C=d._pe._pe_ddm_to_geog;break;case "dms":C=d._pe._pe_dms_to_geog}B=0;H&&(B=d._pe.getPointer(H));H=J.map(function(f){return d._pe.ensureString(f)});J=d._pe.ensureInt32(H);
H=d._pe.ensureFloat64(Array(2*G));(C=C(B,G,J,H))&&h(I,G,H);return C}z.geog_to_dms=function(B,H,G,J,I){return y("dms",B,H,G,J,I)};z.dms_to_geog=function(B,H,G,J){return D("dms",B,H,G,J)};z.geog_to_ddm=function(B,H,G,J,I){return y("ddm",B,H,G,J,I)};z.ddm_to_geog=function(B,H,G,J){return D("ddm",B,H,G,J)};z.geog_to_dd=function(B,H,G,J,I){return y("dd",B,H,G,J,I)};z.dd_to_geog=function(B,H,G,J){return D("dd",B,H,G,J)}})(d.PeNotationDms||(d.PeNotationDms={}));var n;(function(z){z.init=function(){z.PE_MGRS_STYLE_NEW=
d._pe.PeNotationMgrs.prototype.PE_MGRS_STYLE_NEW;z.PE_MGRS_STYLE_OLD=d._pe.PeNotationMgrs.prototype.PE_MGRS_STYLE_OLD;z.PE_MGRS_STYLE_AUTO=d._pe.PeNotationMgrs.prototype.PE_MGRS_STYLE_AUTO;z.PE_MGRS_180_ZONE_1_PLUS=d._pe.PeNotationMgrs.prototype.PE_MGRS_180_ZONE_1_PLUS;z.PE_MGRS_ADD_SPACES=d._pe.PeNotationMgrs.prototype.PE_MGRS_ADD_SPACES};z.geog_to_mgrs_extended=function(y,D,B,H,G,J,I){d._pe.ensureCache.prepare();var C=0;y&&(C=d._pe.getPointer(y));y=b(B);B=d._pe.ensureFloat64(y);y=a(D,l.PE_MGRS_MAX);
var f=d._pe.ensureInt32(y);if(H=d._pe._pe_geog_to_mgrs_extended(C,D,B,H,G,J,f))for(G=0;G<D;G++)I[G]=d._pe.UTF8ToString(y[G]);return H};z.mgrs_to_geog_extended=function(y,D,B,H,G){d._pe.ensureCache.prepare();var J=0;y&&(J=d._pe.getPointer(y));y=B.map(function(I){return d._pe.ensureString(I)});B=d._pe.ensureInt32(y);y=d._pe.ensureFloat64(Array(2*D));(H=d._pe._pe_mgrs_to_geog_extended(J,D,B,H,y))&&h(G,D,y);return H}})(n=d.PeNotationMgrs||(d.PeNotationMgrs={}));(function(z){z.geog_to_usng=function(y,
D,B,H,G,J,I){d._pe.ensureCache.prepare();var C=0;y&&(C=d._pe.getPointer(y));y=b(B);B=d._pe.ensureFloat64(y);y=a(D,l.PE_MGRS_MAX);var f=d._pe.ensureInt32(y);if(H=d._pe._pe_geog_to_usng(C,D,B,H,G,J,f))for(G=0;G<D;G++)I[G]=d._pe.UTF8ToString(y[G]);return H};z.usng_to_geog=function(y,D,B,H){d._pe.ensureCache.prepare();var G=0;y&&(G=d._pe.getPointer(y));y=B.map(function(J){return d._pe.ensureString(J)});B=d._pe.ensureInt32(y);y=d._pe.ensureFloat64(Array(2*D));(G=d._pe._pe_usng_to_geog(G,D,B,y))&&h(H,D,
y);return G}})(d.PeNotationUsng||(d.PeNotationUsng={}));var m;(function(z){z.init=function(){z.PE_UTM_OPTS_NONE=d._pe.PeNotationUtm.prototype.PE_UTM_OPTS_NONE;z.PE_UTM_OPTS_ADD_SPACES=d._pe.PeNotationUtm.prototype.PE_UTM_OPTS_ADD_SPACES;z.PE_UTM_OPTS_NS=d._pe.PeNotationUtm.prototype.PE_UTM_OPTS_NS};z.geog_to_utm=function(y,D,B,H,G){d._pe.ensureCache.prepare();var J=0;y&&(J=d._pe.getPointer(y));y=b(B);B=d._pe.ensureFloat64(y);y=a(D,l.PE_UTM_MAX);var I=d._pe.ensureInt32(y);if(H=d._pe._pe_geog_to_utm(J,
D,B,H,I))for(J=0;J<D;J++)G[J]=d._pe.UTF8ToString(y[J]);return H};z.utm_to_geog=function(y,D,B,H,G){d._pe.ensureCache.prepare();var J=0;y&&(J=d._pe.getPointer(y));y=B.map(function(I){return d._pe.ensureString(I)});B=d._pe.ensureInt32(y);y=d._pe.ensureFloat64(Array(2*D));(H=d._pe._pe_utm_to_geog(J,D,B,H,y))&&h(G,D,y);return H}})(m=d.PeNotationUtm||(d.PeNotationUtm={}));var v;(function(z){var y=new Map;z.init=function(){z.PE_PCSINFO_OPTION_NONE=d._pe.PePCSInfo.prototype.PE_PCSINFO_OPTION_NONE;z.PE_PCSINFO_OPTION_DOMAIN=
d._pe.PePCSInfo.prototype.PE_PCSINFO_OPTION_DOMAIN;z.PE_POLE_OUTSIDE_BOUNDARY=d._pe.PePCSInfo.prototype.PE_POLE_OUTSIDE_BOUNDARY;z.PE_POLE_POINT=d._pe.PePCSInfo.prototype.PE_POLE_POINT};z.generate=function(D,B){void 0===B&&(B=z.PE_PCSINFO_OPTION_DOMAIN);var H;if(y.has(D)){var G=y.get(D);G[B]&&(H=G[B])}H||(H=d._pe.PePCSInfo.prototype.generate(D,B),G||(G=[],y.set(D,G)),G[B]=H);return H}})(v=d.PePCSInfo||(d.PePCSInfo={}));(function(z){z.version_string=function(){return d._pe.PeVersion.prototype.version_string()}})(d.PeVersion||
(d.PeVersion={}));d._init=g})},"esri/core/tsSupport/extendsHelper":function(){define([],function(){return function(){var L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,q){d.__proto__=q}||function(d,q){for(var p in q)q.hasOwnProperty(p)&&(d[p]=q[p])};return function(d,q){function p(){this.constructor=d}L(d,q);d.prototype=null===q?Object.create(q):(p.prototype=q.prototype,new p)}}()})},"esri/geometry/GeographicTransformation":function(){define(["require","exports","./GeographicTransformationStep"],
function(L,d,q){return function(){function p(t){this.steps=[];this._cached_projection={};this._chain="";this._gtlistentry=null;if(t&&t.steps){var g=0;for(t=t.steps;g<t.length;g++){var c=t[g];c instanceof q?this.steps.push(c):this.steps.push(new q({wkid:c.wkid,wkt:c.wkt,isInverse:c.isInverse}))}}}p.cacheKey=function(t,g){return[void 0!==t.wkid&&null!==t.wkid?t.wkid.toString():"-1",void 0!==t.wkt&&null!==t.wkt?t.wkt.toString():"",void 0!==g.wkid&&null!==g.wkid?g.wkid.toString():"-1",void 0!==g.wkt&&
null!==g.wkt?g.wkt.toString():""].join()};p.fromGE=function(t){var g=new p,c="",a=0;for(t=t.steps;a<t.length;a++){var b=q.fromGE(t[a]);g.steps.push(b);c+=b.uid.toString()+","}g._cached_projection={};g._gtlistentry=null;g._chain=c;return g};p.prototype.getInverse=function(){var t=new p;t.steps=[];for(var g=this.steps.length-1;0<=g;g--)t.steps.push(this.steps[g].getInverse());return t};p.prototype.getGTListEntry=function(){for(var t="",g=0,c=this.steps;g<c.length;g++)t+=c[g].uid.toString()+",";t!==
this._chain&&(this._gtlistentry=null,this._cached_projection={},this._chain=t);return this._gtlistentry};p.prototype.assignCachedGe=function(t,g,c){this._cached_projection[p.cacheKey(t,g)]=c};p.prototype.getCachedGeTransformation=function(t,g){for(var c="",a=0,b=this.steps;a<b.length;a++)c+=b[a].uid.toString()+",";c!==this._chain&&(this._gtlistentry=null,this._cached_projection={},this._chain=c);t=this._cached_projection[p.cacheKey(t,g)];return void 0===t?null:t};return p}()})},"esri/geometry/GeographicTransformationStep":function(){define(["require",
"exports"],function(L,d){var q=0;return function(){function p(t){void 0===t&&(t=null);this.uid=q++;t?(this._wkt=void 0!==t.wkt?t.wkt:null,this._wkid=void 0!==t.wkid?t.wkid:-1,this._isInverse=void 0!==t.isInverse?!0===t.isInverse:!1):(this._wkt=null,this._wkid=-1,this._isInverse=!1)}p.fromGE=function(t){var g=new p;g._wkt=t.wkt;g._wkid=t.wkid;g._isInverse=t.isInverse;return g};Object.defineProperty(p.prototype,"wkt",{get:function(){return this._wkt},set:function(t){this._wkt=t;this.uid=q++},enumerable:!0,
configurable:!0});Object.defineProperty(p.prototype,"wkid",{get:function(){return this._wkid},set:function(t){this._wkid=t;this.uid=q++},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"isInverse",{get:function(){return this._isInverse},set:function(t){this._isInverse=t;this.uid=q++},enumerable:!0,configurable:!0});p.prototype.getInverse=function(){var t=new p;t._wkt=this.wkt;t._wkid=this._wkid;t._isInverse=!this.isInverse;return t};return p}()})},"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(L,d,q,p,t,g,c,a,b,h,k,l,e,n,m,v,z,y,D,B,H,G,J){L=d([J],{declaredClass:"esri.layers.rasterLib.raster.TileServiceRaster",constructor:function(I){},open:function(){var I=new p,C=this.serviceInfo||this._getServiceInfo(null),f=q.hitch(this,function(w){this.serviceInfo=w;this.version=w.currentVersion;this.rasterInfo=this._parseRasterInfo(w);this.loaded=!0;this._getRasterIdentifier();I.resolve(this)}),r=q.hitch(this,function(w){this.loaded=!0;this._getRasterIdentifier();I.reject(w)});h(C,f,r);return I.promise},
read:function(I){var C=this.url+"/tile/"+I.level+"/"+I.row+"/"+I.col,f={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:C+(this.disableClientCaching?"?_ts\x3d "+(new Date).getTime():""),payload:{},decodeParams:f,tileOptions:I})},identify:function(I,C){null==C&&(C=this.tileInfo.lods[this.tileInfo.lods.length-1].level);var f=(I.x-this.tileInfo.origin.x)/
this.tileInfo.lods[C].resolution/this.tileInfo.cols;I=(this.tileInfo.origin.y-I.y)/this.tileInfo.lods[C].resolution/this.tileInfo.rows;var r=Math.floor(f),w=Math.floor(I),u=Math.floor((f-r)*this.tileInfo.cols);u=Math.min(u,this.tileInfo.cols-1);var E=Math.floor((I-w)*this.tileInfo.rows);E=Math.min(E,this.tileInfo.rows-1);var K=new p;this.read({level:C,row:w,col:r}).then(function(Q){var V=E*Q.width+u;Q&&Q.pixels&&0<Q.pixels.length?(Q=Q.mask?Q.mask[V]?Q.pixels.map(function(W){return W[V]}):null:Q.pixels.map(function(W){return W[V]}),
K.resolve(Q)):K.reject("no valid data")},function(Q){K.reject(Q)});return K.promise},setFetchParameters:function(I,C){},_getRasterIdentifier:function(){this._rasterId||(this._rasterId=this.url.replace("http:","").replace("https:",""));return this._rasterId},_getServiceInfo:function(){var I=this.url,C=new p(z._dfdCanceller);C._pendingDfd=e({url:I,content:{f:"json"},handleAs:"json",callbackParamName:"callback"});C._pendingDfd.then(function(f){C.callback(f)},function(f){C.errback(f)});return C},_parseRasterInfo:function(I){var C=
new G;C.extent=new n(I.fullExtent);C.spatialReference=new v(I.spatialReference);this.tileType=I.cacheType||"Map";switch(this.tileType){case "Map":C.bandCount=3;C.pixelType="U8";this.dataType="Processed";break;case "Elevation":C.bandCount=1;C.pixelType=I.pixelType||"F32";this.dataType="Elevation";break;case "Raster":C.bandCount=null,C.pixelType=null,this.dataType=I.serviceDataType&&I.serviceDataType.replace("esriImageServiceDataType","")||"Generic"}var f=I.tileInfo;C.width=Math.floor((I.fullExtent.xmax-
I.fullExtent.xmin)/f.lods[f.lods.length-1].resolution+.5);C.height=Math.floor((I.fullExtent.ymax-I.fullExtent.ymin)/f.lods[f.lods.length-1].resolution+.5);C.cellSize=new m({x:f.lods[f.lods.length-1].resolution,y:f.lods[f.lods.length-1].resolution,spatialReference:I.spatialReference});this.tileInfo=new H(f);this.tileInfo.tileType=this.tileType;return C}});a("extend-esri")&&q.setObject("layers.rasterLib.raster.TileServiceRaster",L,k);return L})},"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(L,d,q,p,t,g,c,a,b,h,k,l,e,n,m,v,z,y,D,B,H,G,J){L=d([J],{declaredClass:"esri.layers.rasterLib.raster.TileRaster",sourceType:"TileCache",_RECORD_SIZE:8,constructor:function(I){this._cloudBlobStorage=I&&I._cloudBlobStorage},open:function(){var I=new p,C=this.datasetInfo||this._getDatasetInfo(null),f=q.hitch(this,function(w){this.datasetInfo=w;this.rasterInfo=w=this._parseRasterInfo(w);this.tileType="Cache/LERC"===w.format?"Elevation":"Cache/MIXED"===w.format||"Cache/JPEG"===w.format||"Cache/PNG"===
w.format?"Map":"Raster";this.tileInfo=w.tileInfo;this.dataType=["Generic","Elevation","Processed"][["Raster","Elevation","Map"].indexOf(this.tileType)];this._HEADER_SIZE=w.packetSize*w.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();I.resolve(this)}),r=q.hitch(this,function(w){this.loaded=
!0;this._getRasterIdentifier();I.reject(w)});h(C,f,r);return I.promise},read:function(I){var C=new p,f=I.level,r=I.row,w=I.col,u=this._buildCacheFilePath(this.url,f,r,w),E=this._getIndexRecordFromBundle(f,r,w);e({url:u,content:{},headers:{Range:"bytes\x3d0-"+(this._HEADER_SIZE-1).toString()},handleAs:"arraybuffer"}).then(q.hitch(this,function(K,Q){if(!C.isCanceled()){console.log("time in ms request "+(new Date-V));var V=new Date;K=new Uint8Array(K);K=this._getTileEndAndContentType(K,E);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:u+(this.disableClientCaching?"?_ts\x3d "+(new Date).getTime():""),payload:{},headers:{Range:"bytes\x3d"+K.position.toString()+"-"+(K.position+K.recordSize).toString()},decodeParams:Q,tileOptions:I}).then(function(W){C.isCanceled()||C.resolve(W)},function(W){C.isCanceled()||C.reject(W)})}}));return C.promise},identify:function(){return null},
setFetchParameters:function(I,C){},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 e({url:this.url+"/conf.json",handleAs:"json",content:{}})},_parseRasterInfo:function(I){var C=new G;switch(I.pixelType){case 1:var f="U1";break;case 1:f="U2";break;case 2:f="U4";break;case 3:f="U8";break;case 4:f="S8";break;
case 5:f="U16";break;case 6:f="S16";break;case 7:f="U32";break;case 8:f="S32";break;case 9:f="F32";break;default:f="F32"}var r,w=[],u=I.LODInfos;for(r=0;r<u.levels.length;r++)w.push({level:u.levels[r],resolution:u.resolutions[r],scale:96/.0254*u.resolutions[r]});r=new v(I.extent.spatialReference||I.geodataXform.spatialReference);w=new H({rows:I.blockHeight,cols:I.blockWidth,dpi:96,format:I.format,compressionQuality:0,origin:I.origin,spatialReference:r,lods:w});C.pixelType=f;C.bandCount=I.bandCount;
C.spatialReference=r;C.extent=new n({xmin:I.extent.xmin,ymin:I.extent.ymin,xmax:I.extent.xmax,ymax:I.extent.ymax,spatialReference:r});C.cellSize=new m({x:I.pixelSizeX,y:I.pixelSizeY,spatialReference:r});C.width=Math.floor((C.extent.xmax-C.extent.xmin)/C.cellSize.x+.5);C.height=Math.floor((C.extent.ymax-C.extent.ymin)/C.cellSize.y+.5);C.statistics=I.statistics.map(function(E){Object.keys(E).forEach(function(K){isNaN(E[K])&&(E[K]=null)});return E});C.histograms=I.histograms;C.geodataXform=I.geodataXform;
C.packetSize=I.packetSize;C.format=I.format;C.compressionQuality=I.compressionQuality;C.tileInfo=w;return C},_getRasterIdentifier:function(){this._rasterId||(this._rasterId=this.url.replace("http:","").replace("https:",""));return this._rasterId},_buildCacheFilePath:function(I,C,f,r){var w=this.rasterInfo.packetSize;r=Math.floor(r/w)*w;f="R"+this._toHexString4(Math.floor(f/w)*w)+"C"+this._toHexString4(r);w="L";w=10<=C?w+C.toString():w+("0"+C.toString());return this._cloudBlobStorage?I+"/_alllayers/"+
w+"/"+f+".bundle":I+"/"+w+"_"+f+"/bundle"},_getIndexRecordFromBundle:function(I,C,f){I=this.rasterInfo.packetSize;C=C%I*I+f%I;if(0>C)throw"Invalid level / row / col";return C*this._RECORD_SIZE+64},_getTileEndAndContentType:function(I,C){I=I.subarray(C,C+8);C=0;var f;for(f=0;5>f;f++)C|=(I[f]&255)<<8*f;var r=C&0xffffffffff;C=0;for(f=5;8>f;f++)C|=(I[f]&255)<<8*(f-5);return{position:r,recordSize:C&0xffffffffff}},_toHexString4:function(I){I=I.toString(16);if(4!=I.length)for(var C=4-I.length;0<C--;)I="0"+
I;return I}});a("extend-esri")&&q.setObject("layers.rasterLib.raster.TileRaster",L,k);return L})},"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(L,d,q,p,t,g,c,a,b,h,k,l,e,n,m,v,z,y,D,B,H,G,J){L=d([G],{declaredClass:"esri.layers.rasterLib.raster.FunctionRaster",rasterFunction:null,sourceType:"Function",constructor:function(I){I&&I.rasterFx&&this._init(I.rasterFx,I.rasterFxArgs)},open:function(){var I=this.getMemberRasters().map(function(f){return f.open()});this.identifiers=this.getMemberRasters().map(function(f){return f._rasterId});var C=new p;(new b(I,null,null,!0)).then(function(f){f.some(function(r){return!r[0]})?C.reject(f):
(this.rasterFunction.bind(),this.rasterInfo=this.rasterFunction.rasterInfo,this.dataType=this.rasterInfo.keyProperties&&this.rasterInfo.keyProperties.DataType||"Generic",this.tileInfo=f[0][1].tileInfo,C.resolve(this))}.bind(this));return C.promise},getProjectedFullExtent:function(I){var C=new p;this.getMemberRasters()[0].getProjectedFullExtent(I).then(q.hitch(this,function(f){this.projectedFullExtent=f;C.resolve(f)}));return C.promise},setProcessingContext:function(I){var C=I;I.layer&&(I=I.layer,
C={id:I.id,rawRasterInfo:I.raster.rasterInfo,glSetting:I._glSetting,xformSetting:I.tileManager&&I.tileManager.xformSetting,useWebGL:I.useWebGL,resampling:I.tileMode&&I.tileManager&&I.tileManager.xformSetting.requireProjection&&!I._hasTilingEffects&&"Thematic"!==I.raster.dataType?1:0,tileMode:I.tileMode});this.rasterFunction.setProcessingContext(C);this._layerOptions=C},alterDefinition:function(I){if(I=I||this.rasterFunction)1===this.memberRasters.length&&!I._bindComplete&&(this.rasterFunction=J.create(I,
{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(I,C){var f=this.getMemberRasters();
f&&1===f.length&&f[0].setFetchParameters(I,C)},getMemberRasters:function(){this.memberRasters||(this.memberRasters=[],this._getMemberRasters(this.rasterFunction.functionArguments,this.memberRasters));return this.memberRasters},read:function(I){var C=new p(n._dfdCanceller);if(I.src){var f=this.rasterFunction.read(I);C.resolve(f);return C.promise}var r=this.getMemberRasters().map(function(K){return K.read(I)});r=new b(r);var w,u,E=this.identifiers;C._pendingDfd=r;r.then(q.hitch(this,function(K){if(w=
K.some(function(Q){return Q[0]}))u={},K.forEach(function(Q,V){u[E[V]]=Q[0]?Q[1]:null});f=u?this.rasterFunction.read({extent:I.extent,src:u}):null;f.srcData=u;C.resolve(f)}));return C},_init:function(I,C){if(this.rasterFunction=J.create(I,C))this.rasterFunction._bindComplete=!0;else throw"Cannot initialize a function raster without a raster function";},_getMemberRasters:function(I,C){var f=Object.keys(I),r,w,u;for(r=0;r<f.length;r++)if(u=I[f[r]]){var E=u instanceof Array?u:[u];for(w=0;w<E.length;w++)(u=
E[w])&&("function"===typeof u||"object"===typeof u)&&u.read&&(u.functionArguments?this._getMemberRasters(u.functionArguments,C):u.sourceType&&"Function"!==u.sourceType&&(u._identifier=u._getRasterIdentifier(),C.some(function(K){return K._identifier===u._identifier})||C.push(u)))}return C}});a("extend-esri")&&q.setObject("layers.rasterLib.raster.FunctionRaster",L,k);return L})},"esri/layers/rasterLib/DeferredList2":function(){define(["dojo/DeferredList"],function(L){return function(d,q,p,t,g){this.list=
d;q=new L(d,q,p,t,g);var c=q.resolve.bind(q),a=q.cancel.bind(q);q.cancel=function(){d&&d.forEach(function(b){b.cancel&&b.cancel()});a.apply(this,arguments)}.bind(q);q.resolve=function(){this.isFulfilled()||c.apply(this,arguments)}.bind(q);return q}})},"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(L,d,q,p,t,g,c,a,b,h,k){var l=function(e,n){var m;for(m=0;m<e.length;m++)if(n(e[m]))return m;return-1};return L(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(e){this.tiles=[];this.xformSetting={};this.mapSpatialReference=e&&e.mapSR;this.layer=e&&e.layer;this.identifiers=this.layer.raster.rasterFunction?
this.layer.raster.getMemberRasters().map(function(n){return n._rasterId}):[this.layer.raster._rasterId];(e=e&&e.tileInfo)&&this.setTileInfo(e)},setTileInfo:function(e){this.tileInfo=e;this.virtual=e.virtual;this.mapResolution=null;this.tiles.length=0;this.xformSetting.requireProjection=!this.virtual&&!this.mapSpatialReference.equals(this.tileInfo.spatialReference);this.xformSetting.requirePE=k.requirePE(this.mapSpatialReference,this.tileInfo.spatialReference);this.xformSetting.meshSize=this.xformSetting.requireProjection?
[this._defaultMatrixResolution,this._defaultMatrixResolution]:[1,1];this.halfWorldWidth=k.getHalfWorldWidth(e.spatialReference)},updateResolution:function(e,n){if(!(this.mapResolution&&e&&this._resolutionEqual(this.mapResolution.x,e.x)&&this._resolutionEqual(this.mapResolution.y,e.y))){this.resetTiles();var m=this.xformSetting.requireProjection;this.mapResolution=this.resolution=e;m&&(this.resolution=k.projectResolution(e,this.tileInfo.spatialReference,this.layer.projectedFullExtent||n));this._resolution=
this.resolution;e=this.resolution;if(!this.tileInfo.virtual){m=.75*Math.min(e.x,e.y)+.25*Math.max(e.x,e.y);if(m>=this.tileInfo.lods[0].resolution){var v=this.tileInfo.lods[0];this.ooe=!0}else{if(m<=this.tileInfo.lods[this.tileInfo.lods.length-1].resolution)v=this.tileInfo.lods[this.tileInfo.lods.length-1];else for(e=0;e<this.tileInfo.lods.length-1;e++)if(v=this.tileInfo.lods[e],n=this.tileInfo.lods[e+1],v.resolution>=m&&n.resolution<=m){v.resolution-m>m-n.resolution&&(v=n);break}this.ooe=!1}this.level=
v&&v.level;e=this.resolution=new a({x:v.resolution,y:v.resolution,spatialReference:this.tileInfo.spatialReference})}m=this.layer.raster.rasterInfo.extent;v=this.tileInfo.origin;n=this.tileInfo.cols;var z=this.tileInfo.rows;this.fullBoundary={rowStart:Math.floor((v.y-m.ymax)/e.y/z),rowEnd:Math.floor((v.y-m.ymin-e.y)/e.y/z),colStart:Math.floor((m.xmin-v.x)/e.x/n),colEnd:Math.floor((m.xmax-v.x-e.x)/e.x/n)};if(m=this.halfWorldWidth){z=Math.ceil(m/e.x/(n/2));var y=this.tileInfo.applyGCS360Transform?360:
m,D=Math.round(n-(y-v.x)/e.x%n);D===n&&(D=0);this.fullBoundary.colRange=z;this.fullBoundary.paddingRight=D;this.fullBoundary.paddingLeft=Math.round((z*n*e.x+v.x-y-(this.tileInfo.applyGCS360Transform?0:v.x+m))/e.x)}this.hasNewData=!0}},getXformGrid:function(){var e=this.mapExtent,n=this.layer._hasTilingEffects?this.extent:this.fullExtent,m=this.layer.getCurrentResolution(),v=JSON.stringify(e.toJson())+JSON.stringify(n.toJson());this._datumTransformationInitialized||(this._datumTransformationInitialized=
!0,this._datumTransformation=k.getDefaultDatumTransformationForDataset(this.layer.raster.rasterInfo.extent,e.spatialReference,!0));this._cachedExtentString&&this._cachedExtentString===v||(this._cachedExtentString=v,this._xformGrid=e=k.getProjectionOffsetGrid(e,n,m,this.tileInfo.applyGCS360Transform,this.halfWorldWidth,this._datumTransformation));e=this._xformGrid;this.xformSetting.meshSize=e&&e.size;return e},getWrapTimes:function(e){var n=k.getHalfWorldWidth(e.spatialReference);if(!n)return 0;var m=
2*n;n=this.tileInfo.applyGCS360Transform?0:-n;return Math.floor((e.xmax-n)/m)-Math.floor((e.xmin-n)/m)},normalizeCoordinate:function(e,n){if(!n)return 0;var m=2*n;if(0<e){for(;e>n;)e-=m;return e}for(;e<-n;)e+=m;return e},resetTiles:function(){this.tiles.forEach(d.hitch(this,function(e){e.fetch&&!e.fetch.isCanceled()&&e.fetch.cancel();e.update&&!e.update.isCanceled()&&e.update.cancel()}));this.tiles.length=0},updateExtent:function(e,n){this.mapExtent=this.extent=e;var m=this.xformSetting.requireProjection;
if(m){this.extent=k.project(e,this.tileInfo.spatialReference,this.tileInfo.applyGCS360Transform);if(!this.extent)return;this.extent.spatialReference=new c(this.extent.spatialReference.toJson())}this.updateResolution(n,e);var v=this.extent,z=this.tileInfo,y=z.cols,D=z.rows;n=this.resolution;var B=v;m=m?this.layer.raster.rasterInfo.extent:this.layer.raster.projectedFullExtent;this.ooe&&(B=this._getIntersect(v,m));var H=Math.floor((B.xmin-z.origin.x)/n.x/y)-this.prefetchBufferSize,G=Math.floor((B.xmax-
z.origin.x)/n.x/y)+this.prefetchBufferSize,J=null;e=this.getWrapTimes(e);var I=this.fullBoundary&&this.fullBoundary.colRange;e&&this.halfWorldWidth&&(G===H&&(J=H),G+=e*I);var C=this.halfWorldWidth&&this.tiles.length&&(e!==this.wrapTimes||J!==this._circlularColId);C&&(this._wrapSwitchCount=this._wrapSwitchCount?this._wrapSwitchCount+1:1);this.wrapTimes=e;this._circlularColId=J;var f=Math.floor((z.origin.y-B.ymax)/n.y/D)-this.prefetchBufferSize;J=Math.floor((z.origin.y-B.ymin)/n.y/D)+this.prefetchBufferSize;
this.tileBoundary={rowStart:f,rowEnd:J,colStart:H,colEnd:G};var r,w;((B=(J-f+1)*(G-H+1)>this._MAX_TILES||!this.virtual&&this._resolution.x>8*this.tileInfo.lods[0].resolution)||2<e||C)&&this.resetTiles();if(!(B||2<e)){C=this.tiles;B=!1;for(r=C.length-1;0<=r;r--){var u=C[r].row;var E=C[r].wrapCol;if(u<f||u>J||E<H||E>G)C[r].fetch&&!C[r].fetch.isCanceled()&&C[r].fetch.cancel(),C[r].update&&!C[r].update.isCanceled()&&C[r].update.cancel(),C.splice(r,1),B=!0}for(r=f;r<=J;r++)for(w=H;w<=G;w++){f=new g(z.origin.x+
n.x*y*w,z.origin.y-n.y*D*(r+1),z.origin.x+n.x*y*(w+1),z.origin.y-n.y*D*r,v.spatialReference);var K=e&&I?0<=w?w%I:I- -w%I:w;u=l(C,function(Q){return Q.row===r&&Q.col===K&&Q.wrapCol===w});E=m.xmax>=f.xmax?y:Math.round((m.xmax-f.xmin)/n.x);-1===u&&(C.push({row:r,col:K,wrapCol:w,cellsizeX:n.x,cellsizeY:n.y,width:y,height:D,actualWidth:E,extent:f,normalizedExtent:this._wrapExtent(f,K),pixelBlock:null,virtual:this.virtual,level:this.level,tileType:this.tileInfo.tileType||"Raster"}),B=!0)}B&&this._sortTiles();
n=this.tileInfo.rows*(this.tileBoundary.rowEnd-this.tileBoundary.rowStart+1);this.width=this.tileInfo.cols*(this.tileBoundary.colEnd-this.tileBoundary.colStart+1);this.height=n;this.count=C.length;n=Math.min.apply(null,C.map(function(Q){return Q.extent.xmin}));z=Math.max.apply(null,C.map(function(Q){return Q.extent.xmax}));y=Math.min.apply(null,C.map(function(Q){return Q.extent.ymin}));D=Math.max.apply(null,C.map(function(Q){return Q.extent.ymax}));n=this.fullExtent=new g(n,y,z,D,v.spatialReference);
if(this.layer.roaming||this.layer.useWebGL)this.layer._hasTilingEffects?(this.xformSetting.offset=[0,0],this.xformSetting.scale=[1,1]):(B&&(this._tilesChanged=!0),this.xformSetting.offset=[(v.xmin-n.xmin)/(n.xmax-n.xmin),-(n.ymin-v.ymin)/(n.ymax-n.ymin)],this.xformSetting.scale=[(v.xmax-v.xmin)/(n.xmax-n.xmin),(v.ymax-v.ymin)/(n.ymax-n.ymin)])}},fetchTiles:function(e){(this._tilesChanged||e)&&this._fetchTiles(e)},_fetchTiles:function(e){this._fetchCounter=0;var n=this.extent;this.fetchAllCompleted=
e?new q:null;(this._tilesChanged||e&&this.layer._hasTilingEffects)&&this.tiles.forEach(d.hitch(this,function(v){v.updateCompleted=!1}));var m={};!this.layer.roaming&&this.layer._hasTilingEffects&&e?(this.identifiers.forEach(function(v,z){m[v]={extent:this.extent,pixelBlock:new b({width:this.layer._map.width,height:this.layer._map.height,pixels:[],pixelType:"",mask:null,statistics:[]})}}.bind(this)),this.originalPixelData={extent:this.extent,src:m,isEmpty:!0}):this._tilesChanged&&(this.identifiers.forEach(function(v,
z){m[v]={extent:this.fullExtent,pixelBlock:new b({width:128,height:128,pixels:[],pixelType:"",mask:null,statistics:[]})}}.bind(this)),this.originalPixelData={extent:this.fullExtent,src:m,isEmpty:!0});this.tiles.forEach(d.hitch(this,function(v){if(v.fetch)v.update||(v.update=this.updateTile(v));else{if(this._isTileOutSide(v,n)){v.updateCompleted=!0;return}this._requestTile(v)}this.layer.roaming&&this.layer.useWebGL?this._fillPixelData(v):v.src&&e&&(this.layer._hasTilingEffects||this.layer.useWebGL)&&
(this._fillPixelData(v),this.layer._hasTilingEffects&&(v.updateCompleted=!0),v.processedPixelBlock=null,v.renderedPixelBlock=null)}));0===this._fetchCounter&&(this._fetched=!0);this._tilesChanged=!1;e&&this._updateFetchStatus()},updateTile:function(e,n){var m=new q;if(!e.src&&!e.fetch)return m.resolve(e),m.promise;p(e.src||e._fetched||e.fetch,d.hitch(this,function(){var v=this.layer.tileMode&&this.layer._rasterHandler&&!(this.layer._hasTilingEffects||this.layer.useWebGL),z=this.layer._drawTile,y=
this._validateRawPixelBlocks(e);this.layer._hasTilingEffects&&!this.layer.useWebGL&&(z=z&&(this._progressiveGlobal||n));if((n||!n&&y)&&(v||z||this.layer.roaming)){if(this.xformSetting.requireProjection&&this.layer.useWebGL&&(this.xformSetting.gridConfig=this.getXformGrid(),null==this.xformSetting.gridConfig))return m.cancel(),m.promise;this._processTile(e,n).then(d.hitch(this,function(D){m.isCanceled()||this._renderTile(D,n).then(d.hitch(this,function(B){this.hasNewData=!1;m.isCanceled()||m.resolve(B)}))}))}else n||
y||(e.updateCompleted=!0),this.layer.useWebGL||this.layer._hasTilingEffects?m.resolve(this.originalPixelData):m.resolve()}));return m.promise},setLayer:function(e){this.layer=e},fillupTiles:function(){this.tiles.forEach(d.hitch(this,function(e){e.update&&e.updateCompleted&&!e.filled&&(e.updateCompleted=!1,this._fillPixelData(e),e.updateCompleted=!0)}))},_validateRawPixelBlocks:function(e){return e&&e.src&&!this.identifiers.some(function(n){return!(e.src[n].pixelBlock&&0!==e.src[n].pixelBlock.validPixelCount&&
e.src[n].pixelBlock.pixels&&0<e.src[n].pixelBlock.pixels.length)})},_wrapExtent:function(e,n){if(e){if(this.tileInfo.applyGCS360Transform){var m=this.normalizeCoordinate(e.xmin,180);0>m&&(m+=360);return new g({xmin:m,ymin:e.ymin,xmax:e.xmax-e.xmin+m,ymax:e.ymax,spatialReference:e.spatialReference})}if(this.halfWorldWidth){m=null!=n?new g({xmin:this.tileInfo.origin.x+this.tileInfo.cols*n*this.resolution.x,ymin:e.ymin,xmax:this.tileInfo.origin.x+this.tileInfo.cols*(n+1)*this.resolution.x,ymax:e.ymax,
spatialReference:e.spatialReference}):new g({xmin:e.xmin,ymin:e.ymin,xmax:e.xmax,ymax:e.ymax,spatialReference:e.spatialReference});n=this.normalizeCoordinate(m.xmin,this.halfWorldWidth);var v=n-m.xmin;.01<Math.abs(v)&&(m.xmin=n,m.xmax+=v)}return m||e}},_getIntersect:function(e,n){return new g(Math.max(e.xmin,n.xmin),Math.max(e.ymin,n.ymin),Math.min(e.xmax,n.xmax),Math.min(e.ymax,n.ymax),e.spatialReference)},_isTileOutSide:function(e,n){var m=!1;if(e.virtual){var v=e.normalizedExtent;if(n=n||(this.xformSetting.requireProjection?
this.layer.raster.rasterInfo.extent:this.layer.raster.projectedFullExtent)){e=v.xmin-this.prefetchBufferSize*this.tileInfo.cols*this.resolution.x;m=v.ymin-this.prefetchBufferSize*this.tileInfo.rows*this.resolution.y;var z=v.xmax+this.prefetchBufferSize*this.tileInfo.cols*this.resolution.x;v=v.ymax+this.prefetchBufferSize*this.tileInfo.rows*this.resolution.y;m=z<=n.xmin||e>=n.xmax||v<=n.ymin||m>=n.ymax}else m=!1}else m=0>e.level||e.row<this.fullBoundary.rowStart||e.row>this.fullBoundary.rowEnd||e.col<
this.fullBoundary.colStart||e.col>this.fullBoundary.colEnd;return m},_resolutionEqual:function(e,n){return e===n||e&&n&&Math.abs(e-n)<Math.abs(n/1E4)?!0:!1},_requestTile:function(e){var n=this.identifiers,m;if(this._isTileOutSide(e)){var v=new q;e.updateCompleted=!0;v.resolve(null);v=v.promise}else v=this.layer.raster.rasterFunction?new t(this.layer.raster.getMemberRasters().map(function(z){return z.read(e)})):new t([this.layer.raster.read(e)]);e.fetch=v;this._fetchCounter++;p(e.src||e._fetched||
v,d.hitch(this,function(z){if(m=z&&z.some(function(D){return D[0]})){var y={};z.forEach(function(D,B){y[n[B]]=D[0]&&D[1]?{extent:D[1].extent,pixelBlock:D[1].pixelBlock,width:D[1].width,height:D[1].height}:null});e.src=y}else e.src=null;this._fetchCounter--;0===this._fetchCounter&&(this._fetched=!0);e._fetched=!0;this._updateFetchStatus()}),d.hitch(this,function(){this._fetchCounter--;0===this._fetchCounter&&(this._fetched=!0);e._fetched=!0;this._updateFetchStatus()}));e.update=this.updateTile(e)},
_updateFetchStatus:function(){this.layer._drawTile&&this.fetchAllCompleted&&!this.fetchAllCompleted.isResolved()&&!this.tiles.some(function(e){return!e._fetched})&&(this.tiles.forEach(d.hitch(this,function(e){this._fillPixelData(e)})),this.fetchAllCompleted.resolve())},_fillPixelData:function(e,n){if(e&&!e.updateCompleted)if(Math.abs(e.cellsizeX-this.resolution.x)>e.cellsizeX/10)e.updateCompleted=!0;else if(!1===this._validateRawPixelBlocks(e))e.updateCompleted=!0;else{var m=e.extent;if(this.layer.roaming||
this.layer.useWebGL&&!this.layer._hasTilingEffects){var v=this.fullExtent;var z=this.tileInfo.cols*(this.tileBoundary.colEnd-this.tileBoundary.colStart+1);var y=this.tileInfo.rows*(this.tileBoundary.rowEnd-this.tileBoundary.rowStart+1);n?this.originalPixelData.renderedPixelBlock||(this.originalPixelData.renderedPixelBlock=new b({width:z,height:y,pixels:[],pixelType:"",mask:null,statistics:[]})):this.identifiers.forEach(d.hitch(this,function(B){this.originalPixelData.src[B].pixelBlock.width=z;this.originalPixelData.src[B].pixelBlock.height=
y}))}else v=this.extent,z=this.layer._map.width,y=this.layer._map.height,n?this.originalPixelData.renderedPixelBlock||(this.originalPixelData.renderedPixelBlock=new b({width:z,height:y,pixels:[],pixelType:"",mask:null,statistics:[]})):this.identifiers.forEach(d.hitch(this,function(B){this.originalPixelData.src[B].pixelBlock.width=z;this.originalPixelData.src[B].pixelBlock.height=y}));if(v.xmax<=m.xmin||v.xmin>=m.xmax||v.ymax<=m.ymin||v.ymin>=m.ymax)return null;var D=this.originalPixelData.isEmpty=
!1;this.identifiers.forEach(d.hitch(this,function(B){e.src&&(this._fillPixelBlock(e.src[B],this.originalPixelData.src[B],{extent:v,width:z,height:y,normalizedExtent:e.normalizedExtent},!1),D=!0)}));e.filled=D;this.hasNewData=!0}},_fillPixelBlock:function(e,n,m,v){var z=e.extent,y=m.extent;v=m.width;var D=m.height;if(e.pixelBlock&&e.pixelBlock.pixels&&e.pixelBlock.pixels[0]){var B=(z.xmax-z.xmin)/e.width,H=Math.max(z.xmin,y.xmin),G=Math.min(z.ymax,y.ymax),J=Math.round((H-z.xmin)/B),I=e.width-Math.round(Math.abs(z.xmax-
Math.min(z.xmax,y.xmax))/B),C=Math.round(Math.abs(z.ymax-G)/B),f=e.height-Math.round((Math.max(z.ymin,y.ymin)-z.ymin)/B),r=this.halfWorldWidth;H=Math.round((H-y.xmin)/B);m=m.normalizedExtent;if(!(this.wrapTimes&&r&&z.xmin<-r)){if(this.wrapTimes&&r){if(this.tileInfo.applyGCS360Transform)360<z.xmin&&(H-=this.fullBoundary.paddingLeft);else if(z.xmin>r){H-=this.fullBoundary.paddingLeft;var w=this.normalizeCoordinate(z.xmin,r);var u=this.normalizeCoordinate(z.xmax,r)}else w=z.xmin,u=z.xmax;this.tileInfo.applyGCS360Transform?
m&&360>m.xmin&&360<m.xmax&&(I-=this.fullBoundary.paddingRight):m&&m.xmin<r&&m.xmax>r?I-=this.fullBoundary.paddingRight:w<r&&u>r&&(I-=this.fullBoundary.paddingRight)}w=Math.round(Math.abs(y.ymax-G)/B);u=e.pixelBlock.pixels.length;n=n.pixelBlock;m=e.width;z=n.mask||new Uint8Array(v*D);var E=e.pixelBlock,K=E.mask,Q=0;for(B=0;B<u;B++){G=E.pixels[B];r=n.pixels[B]||new G.constructor(v*D);for(e=C;e<f;e++)for(Q=(w+e-C)*v+H,y=J;y<I;y++)r[Q+y-J]=G[e*m+y];n.pixels[B]=r}if(K)for(e=C;e<f;e++)for(Q=(w+e-C)*v+H,
y=J;y<I;y++)z[Q+y-J]=K[e*m+y];else for(e=C;e<f;e++)for(Q=(w+e-C)*v+H,y=J;y<I;y++)z[Q+y-J]=1;n.pixelType=n.pixelType||E.pixelType;n.mask=z;if(!(n.statistics&&0<n.statistics.length))for(n.statistics=[],e=0;e<E.statistics.length;e++)n.statistics[e]={minValue:E.statistics[e].minValue,maxValue:E.statistics[e].maxValue};else if(E.statistics&&n.statistics)for(e=0;e<n.statistics.length;e++)n.statistics[e].minValue=Math.min(E.statistics[e].minValue,n.statistics[e].minValue),n.statistics[e].maxValue=Math.max(E.statistics[e].maxValue,
n.statistics[e].maxValue)}}},_processTile:function(e,n){var m=new q,v=this.layer._hasTilingEffects,z=this.layer.useWebGL,y=v||z,D=this.layer.raster.rasterFunction&&e&&(v||z||!e.processedPixelBlock);if(n)var B=e;else this._fillPixelData(e),B=y?this.originalPixelData:e;this.xformSetting.hasNewTexture=this.hasNewData;var H;D?(this.identifiers.forEach(function(G){if(0===B.src[G].pixelBlock.pixels.length||0===B.src[G].pixelBlock.pixels[0].length)H=!0}),H?m.resolve({extent:B.extent,processedPixelBlock:B.src[this.identifiers[0]],
pixelBlock:B.src[this.identifiers[0]]}):z?(this.processedPixelData=this.layer.raster.rasterFunction.read(B),m.resolve(this.processedPixelData)):this.layer._rasterHandler?this.layer._rasterHandler.process({extent:B.extent,src:B.src}).then(function(G){v?(this.processedPixelData=G,m.resolve(this.processedPixelData)):(e.processedPixelBlock=G.pixelBlock,m.resolve(e))}):(n=this.layer.raster.rasterFunction.read(e),e.processedPixelBlock=n.pixelBlock,m.resolve(e))):y?m.resolve(B.src[this.identifiers[0]]):
(e.pixelBlock=B.src[this.identifiers[0]]&&B.src[this.identifiers[0]].pixelBlock,m.resolve(e));return m.promise},_renderTile:function(e){var n=new q,m=this.layer._hasTilingEffects,v=this.layer.useWebGL,z=Math.abs((e.extent.xmax-e.extent.xmin)/e.width-this.layer.getCurrentResolution().x)>this.resolution.x/10;z=this.layer.useWebGL&&(z||this._isTileOutSide(e,this.layer._map.extent));this.xformSetting.hasNewTexture=this.hasNewData;this.layer._rasterRenderer&&e&&(e.texture||e.src||e.pixelBlock||e.processedPixelBlock)?
(this.layer._rasterRenderer.interpolation=this.layer.interpolation,v&&!z?(this.layer.raster.rasterFunction&&this.layer.raster.rasterFunction.renderTexture||this.layer._rasterRenderer.draw(e),n.resolve(e)):this.layer._rasterHandler?this.layer._rasterHandler.render({extent:e.extent,pixelBlock:e.processedPixelBlock||e.pixelBlock}).then(function(y){m?(y.renderedPixelBlock=y.pixelBlock,n.resolve(y)):(e.renderedPixelBlock=y.pixelBlock,n.resolve(e))}.bind(this)):(e.renderedPixelBlock=this.layer._rasterRenderer.draw(e).pixelBlock,
n.resolve(e))):(e.renderedPixelBlock=e.processedPixelBlock||e.pixelBlock,n.resolve(e));return n.promise},_sortTiles:function(){this.tiles.sort(function(e,n){return e.row<n.row||e.row==n.row&&e.col<n.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(L,d,q,p,t,g,c,a,b,h,k,l,e,n,m,v,z,y){function D(f){if(f){var r=g.map([f.FromColor,f.ToColor],function(w){w=z.toRGB({h:w.Hue,s:w.Saturation,v:w.Value});return[w.r,w.g,w.b]});return{fromColor:r[0],toColor:r[1],type:"algorithmic",algorithm:f.Algorithm}}}function B(f){if(f)return f=z.toHSV(z.getDojoColor(f)),{type:"HsvColor",Hue:f.h,Saturation:f.s,Value:f.v,AlphaValue:255}}function H(f){if(f){var r=f.toJson?f.toJson():void 0;return{Algorithm:r&&r.Algorithm||"esriHSVAlgorithm",type:"AlgorithmicColorRamp",
FromColor:B(f.fromColor),ToColor:B(f.toColor)}}}var G={},J,I,C;L.mixin(G,{fetchRFT:function(f,r,w,u,E){var K=new t;var Q=(Q=(Q=f.name)&&Q.slice(-8))&&".rft.xml"===Q.toLowerCase();return f&&f.itemDataUrl?Q?E?this.convertRFT({url:E+"/ConvertRasterFunctionTemplate",rft:{itemId:f.id},format:"json"},r,u,w):(w("errorUtilitiesServiceNotAvailable"),K.reject(Error("errorUtilitiesServiceNotAvailable")),K.promise):a({url:f.itemDataUrl,callbackParamName:"callback",content:{f:"json"},handleAs:"json",load:r,error:w}).then(u):
(w("errorRetrievingRFTItem"),K.reject(Error("errorRetrievingRFTItem")),K.promise)},convertRFT:function(f,r,w,u){var E=f.url,K=function(){C&&(C.remove(),C=null);I&&(I.remove(),I=null)};J||(J=new m(E),p(J,"error",K));I=p(J,"job-complete",function(Q){I&&(I.remove(),I=null);Q.jobInfo.jobStatus!==v.STATUS_SUCCEEDED?(K(),u(Q)):J.getResultData(Q.jobInfo.jobId,"outputRasterFunction")});C=p(J,"get-result-data-complete",function(Q){C&&(C.remove(),C=null);var V=Q&&Q.result&&Q.result.value;V&&V.url&&(Q={url:V.url,
handleAs:"json",load:w,error:u},V=(new d(V.url)).authority,-1===h.defaults.io.corsEnabledServers.indexOf(V)&&h.defaults.io.corsEnabledServers.push(V),a(Q))});f={inputRasterFunction:JSON.stringify(f.rft),format:f.format};return J.submitJob(f,r,null,u)},getRasterJsonFromLayer:function(f){if(!f)return null;var r=f.url;r&&0<r.indexOf("?token\x3d")&&(r=r.slice(0,r.indexOf("?token\x3d")));var w=f.credential||r&&c.id.findCredential(r);b.isDefined(w)&&(r=r+"?token\x3d"+w.token,w.referer&&(r+=w.referer));
r={url:r,name:f.name};f.renderingRule&&(r.renderingRule=f.renderingRule.toJson?f.renderingRule.toJson():f.renderingRule);f.mosaicRule&&(r.mosaicRule=f.mosaicRule.toJson?f.mosaicRule.toJson():f.mosaicRule);return r},getLayerIdfromRasterValue:function(f,r){if(f&&r){var w;g.some(r,function(u){if(u&&u.url===f.url&&u.name===f.name&&f.name)return w=u.id,!0});return w}},getColorRampFromArg:function(f){if(f){var r;if(f.type&&-1<f.type.toLowerCase().indexOf("colorramp"))var w=f;else f.value&&-1<f.value.type.toLowerCase().indexOf("colorramp")&&
(w=f.value);if(w)return f=w.type.toLowerCase(),"multipartcolorramp"===f?r=y.fromJson({type:"multipart",colorRamps:g.map(w.ArrayOfColorRamp,function(u){return D(u)})}):"algorithmiccolorramp"===f&&(r=y.fromJson(D(w))),r.id=r.name=w.Name,r}},getRFxArgColorRampValue:function(f){if(f){if(f.fromColor&&f.toColor)return L.mixin(H(f),{Name:f.name});if(f.colorRamps){var r=g.map(f.colorRamps,H);return{type:"MultiPartColorRamp",NumColorRamps:r.length,ArrayOfColorRamp:r,Name:f.name}}}},RFX_VARIABLE_TYPE:"RasterFunctionVariable",
RFX_TEMPLATE_TYPE:"RasterFunctionTemplate",ARGUMENT_ARRAY_TYPE:"ArgumentArray",getArgRFT:function(f){if(f){if("RasterFunctionTemplate"===f.type)return f;if(f.value&&"RasterFunctionTemplate"===f.value.type)return f.value}},getEnumData:function(f,r,w){if(Array.isArray(f))return f.forEach(function(u){u.key=u.key.toString()}),f},getImageServiceTitle:function(f){f=f.split("/");return f[f.length-2]},isReferencedObject:function(f){if(f&&b.isDefined(f._object_ref_id))return!0},functionTypes:{local:"LocalFunction",
gpAdapter:"GPAdapterFunction",pythonAdapter:"PythonAdapterFunction"},defaultRasterNodeProps:{name:"Raster",isDataset:!0,isPublic:!1,type:"RasterFunctionVariable"},getArcGISImageServiceLayerItem:function(f){if(f){f=L.clone(f);f.name||(f.name=this.getImageServiceTitle(f.url));var r=new l;f.mosaicRule&&(r.mosaicRule=new e(f.mosaicRule));f.renderingRule&&(r.renderingRule=new n(f.renderingRule));r=new k(f.url,{id:f.name+(new Date).toString(),imageServiceParameters:r});r.name=f.name;return r}},filterMDInfoIfMosiacRuleIsSet:function(f){var r=
L.clone(f.multidimensionalInfo),w=[],u=f.mosaicRule&&f.mosaicRule.multidimensionalDefinition;if(u&&0<u.length){var E=r.variables.filter(function(K){return u[0].variableName===K.name}.bind(this));if(!E||0===E.length)return r;E=E[0];w=L.clone(E);w.dimensions=[];u.forEach(function(K){var Q=E.dimensions.filter(function(ba){return K.dimensionName===ba.name}.bind(this));if(Q&&0!==Q.length){var V=(Q=Q[0])&&Q.values,W=0,Y=1,ja=K.values&&K.values.length;switch(K.values&&K.values[0].length||ja){case 1:W=V.indexOf(K.values[0]);
Y=W+1;break;case 2:W=V.indexOf(K.values[0][0]),Y=V.indexOf(K.values[0][1])+1}V=V.slice(W,Y);Q.values=V;w.dimensions.push(Q)}else w.dimensions=L.clone(E.dimensions)}.bind(this));r.variables=[w]}return r}});q("extend-esri")&&L.setObject("dijit.RasterFunctionEditor.utils",G,c);return G})},"widgets/Analysis/layerUtil":function(){define("dojo/_base/lang dojo/_base/array dojo/promise/all dojo/Deferred esri/layers/FeatureLayer esri/layers/GeoRSSLayer esri/layers/WFSLayer jimu/LayerInfos/LayerInfos".split(" "),
function(L,d,q,p,t,g,c,a){var b={getLayerObjects:function(){var h=new p,k=[];a.getInstanceSync().traversal(function(e){k.push(e)});var l=d.map(k,function(e){var n;return e.getItemInfo().then(function(m){m&&(n=m.getItem())}).then(function(){return e.getLayerType()}).then(function(m){"GeoRSSLayer"===m&&(e.isLeaf()||d.forEach(e.getSubLayers(),function(v){v.layerObject.name||(v.layerObject.name=v.title)}));return e.getLayerObjectTryUsingFeatureService()}).then(function(m){if(m)return m.itemInfo=n,m})});
q(l).then(function(e){var n=[];d.forEach(e,function(m,v){if(m&&m.geometryType)if(m instanceof t&&"esri.layers.StreamLayer"!==m.declaredClass||m instanceof g)m.id=m.id||k[v].id,n.push(m);else if(m instanceof c){var z=b.createFeatureCollectionJsonFromWFS(m);z=new t(z,{mode:t.MODE_SNAPSHOT,outFields:["*"]});z.id=m.id||k[v].id;z.title=m._layerName;z.name=m._layerName;z.capabilities?-1===z.capabilities.indexOf("Extract")&&(z.capabilities+=",Extract"):z.capabilities="Extract";n.push(z)}});h.resolve(n)},
function(){h.resolve([])});return h},getTableInfos:function(){var h=a.getInstanceSync();h=[].concat(h.getTableInfoArray(),h.getLayerInfoArray());return d.filter(h,function(k){return!0===k.isTable})},getTableLayerObjects:function(){var h=new p,k=b.getTableInfos();k=d.map(k,function(l){return l.getLayerObject()});q(k).then(function(l){l=d.filter(l,function(e){return null!==e});h.resolve(l)});return h},getMainGeometryType:function(h){var k=0,l=0,e=0;d.forEach(h.graphics,function(n){"point"===n.geometry.type?
k++:"polyline"===n.geometry.type?l++:"polygon"===n.geometry.type&&e++});return k>l&&k>e?"esriGeometryPoint":l>k&&l>e?"esriGeometryPolyline":"esriGeometryPolygon"},createFeatureCollectionJsonFromWFS:function(h){var k=b.getMainGeometryType(h),l={layerDefinition:null,featureSet:{features:[],geometryType:k}};l.layerDefinition={geometryType:k,objectIdField:"__OBJECTID",type:"Feature Layer",typeIdField:"",drawingInfo:{renderer:{type:"simple",symbol:("esriGeometryPoint"===k?h._pointSymbol:"esriGeometryPolyline"===
k?h._lineSymbol:h._polygonSymbol).toJson()},fixedSymbols:!0},fields:[{name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID"}],types:[],capabilities:"Query"};d.forEach(h.fields,function(n){-1<d.indexOf(["esriFieldTypeInteger","esriFieldTypeDouble","esriFieldTypeDate","esriFieldTypeString"],n.type)&&l.layerDefinition.fields.push(L.clone(n))});var e=[];d.forEach(h.graphics,function(n,m){var v=L.clone(n.attributes);v.__OBJECTID=m;e.push({geometry:n.geometry.toJson(),attributes:v})});l.featureSet.features=
e;return l}};return b})},"esri/layers/WFSLayer":function(){define("dojo/_base/declare dojo/_base/kernel dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/has dojo/on ../request ../kernel ../graphic ../renderers/jsonUtils ../symbols/jsonUtils ../Color ../symbols/SimpleMarkerSymbol ../symbols/SimpleLineSymbol ../symbols/SimpleFillSymbol ../SpatialReference ../geometry/webMercatorUtils ../geometry/Extent ../geometry/Point ../geometry/Multipoint ../geometry/Polyline ../geometry/Polygon ./LabelClass ./GraphicsLayer".split(" "),
function(L,d,q,p,t,g,c,a,b,h,k,l,e,n,m,v,z,y,D,B,H,G,J,I,C){L=L([C],{declaredClass:"esri.layers.WFSLayer",constructor:function(f){this.geometryType=this.describeFeatureTypeUrl=this.getFeatureUrl=this.layerNamespace="";this.fields=[];this.spatialReferences=[];this.fullExtent=null;this.visible=!0;this.renderer=null;this.id="WFSLayer";this._url="";this._version="1.1.0";this._layerName="";this._nsLayerNames={};this._layerDefinedGeometryType="esriGeometryComplex";this._wkid=3857;this._mode="snapshot";
this._maxFeatures=100;this._inverseResponse=this._inverseFilter=!1;this._nsGeometryFieldName=this._getFeatureRequest=this._nsFields="";this._graphicArray=[];this._gmlNS="http://www.opengis.net/gml";this._layerEventHandlers=[];this.customParameters=this._describeFeatureTypeCallback=this._getCapabilitiesCallback=null;this.showLabels=!0;this.labelingInfo=null;f&&(f.id&&(this.id=f.id),this.showLabels=null!==f.showLabels?f.showLabels:!0);this.onError=q.hitch(this,this.onError);this._errorSupport=q.hitch(this,
this._errorSupport);this._parseGml=q.hitch(this,this._parseGml);this._getCapabilities=q.hitch(this,this._getCapabilities);this._getCapabilitiesResponse=q.hitch(this,this._getCapabilitiesResponse);this._describeFeatureTypeResponse=q.hitch(this,this._describeFeatureTypeResponse);this._pointSymbol=new n(n.STYLE_CIRCLE,6,new m(m.STYLE_SOLID,new e([0,255,0]),1),new e([255,0,0]));this._lineSymbol=new m(m.STYLE_SOLID,new e([0,255,0]),3);this._polygonSymbol=new v(v.STYLE_SOLID,new m(m.STYLE_SOLID,new e([255,
0,0]),2),new e([255,255,0,.25]));this.loaded=!1;this._isProjectedOk=!0},initialize:function(f,r){f.id&&(this.id=f.id);f.url&&(this._url=f.url);f.version&&(this._version=f.version);this.customParameters=f.customParameters;this._getCapabilities(r)},selectLayer:function(f,r){this._layerName=f.layerName;this._wkid=f.wkid;this._mode=f.mode;this._maxFeatures=f.maxFeatures;this._inverseResponse=f.swapXY;this._inverseFilter=f.swapXYFilter;this.geometryType=f.geometryType;this._describeFeatureType(r);this.loaded=
!0},toJson:function(){var f={};f.id=this.id;f.url=this._url;f.version=this._version;f.mode="snapshot"===this._mode?0:1;f.name=this._layerName;f.geometryType=this.geometryType;f.wkid=this._wkid;f.maxFeatures=this._maxFeatures;f.swapXY=this._inverseResponse;f.swapXYFilter=this._inverseFilter;f.pointSymbol=this._pointSymbol.toJson();f.lineSymbol=this._lineSymbol.toJson();f.polygonSymbol=this._polygonSymbol.toJson();f.showLabels=this.showLabels;this.labelingInfo&&(f.labelingInfo=p.map(this.labelingInfo,
function(r){return r.toJson()}));this.customParameters&&(f.customParameters=this.customParameters);return f},fromJson:function(f,r){f.id&&(this.id=f.id);f.url&&(this._url=f.url);f.version&&(this._version=f.version);f.mode&&(this._mode=0===f.mode?"snapshot":"onDemand");f.name&&(this._layerName=f.name);f.geometryType&&(this.geometryType=f.geometryType);f.wkid&&(this._wkid=f.wkid);f.maxFeatures&&(this._maxFeatures=f.maxFeatures);f.swapXY&&(this._inverseResponse=f.swapXY);f.swapXYFilter&&(this._inverseFilter=
f.swapXYFilter);f.pointSymbol&&(this._pointSymbol=l.fromJson(f.pointSymbol));f.lineSymbol&&(this._lineSymbol=l.fromJson(f.lineSymbol));f.polygonSymbol&&(this._polygonSymbol=l.fromJson(f.polygonSymbol));this.showLabels=null!=f.showLabels?f.showLabels:!0;f.labelingInfo&&(this.labelingInfo=p.map(f.labelingInfo,function(w){return new I(w)}));this.customParameters=f.customParameters;this._getCapabilities(r);this.loaded=!0},setPointSymbol:function(f){this._pointSymbol=f},setLineSymbol:function(f){this._lineSymbol=
f},setPolygonSymbol:function(f){this._polygonSymbol=f},_setMap:function(f){this._map=f;var r=this.inherited(arguments);this._map&&(this._layerEventHandlers.push(this._map.on("extent-change",q.hitch(this,"refresh"))),this._layerEventHandlers.push(this.on("visibility-change",q.hitch(this,"_visibilityChange"))));this._getFeature();this.refresh();return r},_unsetMap:function(){for(var f=0;f<this._layerEventHandlers.length;f++)t.disconnect(this._layerEventHandlers[f]);this.refresh();this.inherited(arguments)},
refresh:function(){this.clear();this.redraw();"ondemand"===this._mode.toLowerCase()&&this._fireUpdateStart()},redraw:function(){if(this.visible)for(var f=0;f<this._graphicArray.length;f++){var r=this._graphicArray[f],w=r.geometry,u=null;"point"===w.type?u=this.renderer?this.renderer.getSymbol(r):this._pointSymbol:"multipoint"===w.type?u=this.renderer?this.renderer.getSymbol(r):this._pointSymbol:"polyline"===w.type?u=this.renderer?this.renderer.getSymbol(r):this._lineSymbol:"polygon"===w.type&&(u=
this.renderer?this.renderer.getSymbol(r):this._polygonSymbol);r.setSymbol(u);this.add(r)}},_visibilityChange:function(f){this.visible=f.visible;this.redraw()},onUpdateStart:function(){this._getFeature()},onUpdateEnd:function(){this.clear();this.redraw()},setLabelingInfo:function(f){f?(this.labelingInfo=f,this._fixLabelExpr()):delete this.labelingInfo;this.onLabelingInfoChange()},onLabelingInfoChange:function(){},_fixLabelExpr:function(){var f=/\[([^\[\]]+)\]/ig,r,w=this,u=function(E,K){E=w._getField(K,
!0);return"["+(E&&E.name||K)+"]"};p.forEach(this.labelingInfo,function(E){if(r=E.labelExpression)E.labelExpression=r.replace(f,u)})},_getField:function(f,r){var w=this.fields;if(!w||0===w.length)return null;var u;r&&(f=f.toLowerCase());p.some(w,function(E){var K=!1;(K=r?E&&E.name.toLowerCase()===f?!0:!1:E&&E.name===f?!0:!1)&&(u=E);return K});return u},setCustomParameters:function(f){this.customParameters=f;this._getFeature();this.refresh()},_getCapabilities:function(f){this._getCapabilitiesCallback=
f;f=q.trim(this._url);if(""===f)this.onError("WFSLayer: url is invalid");else if("1.0.0"!==this._version&&"1.1.0"!==this._version&&"2.0.0"!==this._version)this.onError("WFSLayer: version is invalid");else if(""!==f){var r=f.indexOf("?");r=this._checkForUrlInUrl(f,r);r="?"===f.charAt(f.length-1)?"":-1===r?"?":"\x26";f=f+r+"service\x3dWFS\x26request\x3dGetCapabilities\x26version\x3d"+this._version;f=this._appendCustomParameters(f);a({url:f,handleAs:"text",headers:{"Content-Type":null}},{usePost:!1}).then(this._getCapabilitiesResponse,
this._errorSupport)}},_errorSupport:function(f){this.onError(f)},_getCapabilitiesResponse:function(f){var r,w,u,E=new DOMParser;try{var K=E.parseFromString(f,"text/xml"),Q=this._readExceptionReport(K,f);if(Q)this.onError("WFSLayer: getCapabilities - returns exception: "+Q);else{var V=K.documentElement.attributes.getNamedItem("version");if(V){this._version=V.value;var W="2.0.0"===this._version?"http://www.opengis.net/wfs/2.0":"http://www.opengis.net/wfs";if("2.0.0"===this._version){var Y=K.getElementsByTagNameNS("http://www.opengis.net/ows/1.1",
"Operation");for(r=0;r<Y.length;r++){if((u=Y[r].attributes.getNamedItem("name"))&&"DescribeFeatureType"===u.value){var ja=Y[r].getElementsByTagNameNS("http://www.opengis.net/ows/1.1","Get");this.describeFeatureTypeUrl=ja[0].attributes.getNamedItem("xlink:href").value}if(u&&"GetFeature"===u.value){var ba=Y[r].getElementsByTagNameNS("http://www.opengis.net/ows/1.1","Post");this.getFeatureUrl=ba[0].attributes.getNamedItem("xlink:href").value}}}else if("1.1.0"===this._version)for(Y=K.getElementsByTagNameNS("http://www.opengis.net/ows",
"Operation"),r=0;r<Y.length;r++)(u=Y[r].attributes.getNamedItem("name"))&&"DescribeFeatureType"===u.value&&(ja=Y[r].getElementsByTagNameNS("http://www.opengis.net/ows","Get"),this.describeFeatureTypeUrl=ja[0].attributes.getNamedItem("xlink:href").value),u&&"GetFeature"===u.value&&(ba=Y[r].getElementsByTagNameNS("http://www.opengis.net/ows","Post"))&&ba.length&&(this.getFeatureUrl=ba[0].attributes.getNamedItem("xlink:href").value);else if("1.0.0"===this._version){var fa=K.getElementsByTagNameNS(W,
"DescribeFeatureType");if(!fa||!fa.length){this.onError("WFSLayer: getCapabilities - no describeFeatureType info");return}ja=fa[0].getElementsByTagNameNS(W,"Get");this.describeFeatureTypeUrl=ja[0].attributes.getNamedItem("onlineResource").value;var ua=K.getElementsByTagNameNS(W,"GetFeature");if(!ua||!ua.length){this.onError("WFSLayer: getCapabilities - no GetFeature info");return}(ba=ua[0].getElementsByTagNameNS(W,"Post"))&&ba.length&&(this.getFeatureUrl=ba[0].attributes.getNamedItem("onlineResource").value)}this._nsLayerNames=
{};f=[];var xa=K.getElementsByTagNameNS(W,"FeatureTypeList");for(r=0;r<xa.length;r++){var va=xa[r].getElementsByTagNameNS(W,"FeatureType");for(w=0;w<va.length;w++){var P=va[w],N=P.getElementsByTagNameNS(W,"Name")[0],A=N.textContent,M=A.indexOf(":"),O=A.substring(0,M),U=A.substring(M+1),X=N.lookupNamespaceURI(O);null===X&&(X=N.lookupNamespaceURI(null));this._nsLayerNames[U]={prefix:O,namespace:X};var ia=P.getElementsByTagNameNS(W,"Title"),ca=0<ia.length?ia[0].textContent:"";""===ca&&(ca=U);this.spatialReferences=
this._readFactoryCodes(this._version,P);var S=this._readDefaultBBOX(this._version,P);f.push({name:U,title:ca,spatialReferences:this.spatialReferences,extent:S})}}this._describeFeatureType();var ea=this._getCapabilitiesCallback;ea&&ea(f)}else this.onError("WFSLayer: getCapabilities - document not recognized.")}}catch(na){this.onError("WFSLayer: getCapabilities - parsing error")}},_readFactoryCodes:function(f,r){var w,u=[];if("2.0.0"===f||"1.1.0"===f){f=r.getElementsByTagNameNS("*","DefaultSRS");this._addCodeList(u,
f[0]);f=r.getElementsByTagNameNS("*","DefaultCRS");this._addCodeList(u,f[0]);f=r.getElementsByTagNameNS("*","OtherSRS");for(w=0;w<f.length;w++)this._addCodeList(u,f[w]);f=r.getElementsByTagNameNS("*","OtherCRS");for(w=0;w<f.length;w++)this._addCodeList(u,f[w])}else"1.0.0"===f&&(f=r.getElementsByTagNameNS("*","SRS"),this._addCodeList(u,f[0]));for(r=!1;0<u.length;){4326===u[0]&&(r=!0);break}r||u.push(4326);return u},_addCodeList:function(f,r){r&&(r=r.textContent.match(/\d+/g),0<r.length&&(r=parseInt(r[r.length-
1],10),84===r&&(r=4326),f.push(r)))},_readDefaultBBOX:function(f,r){if("2.0.0"===f||"1.1.0"===f){var w=r.getElementsByTagNameNS("*","WGS84BoundingBox");if(!w[0]||!w[0].attributes)return[];var u=w[0].getElementsByTagNameNS("*","LowerCorner");var E=w[0].getElementsByTagNameNS("*","UpperCorner");if(0>=u.length||0>=E.length)return[];var K=u[0].textContent;w=K.indexOf(" ");u=K.substring(0,w);K=K.substring(w+1);w=E[0].textContent;f=w.indexOf(" ");E=w.substring(0,f);w=w.substring(f+1)}else if("1.0.0"===
f){w=r.getElementsByTagNameNS("*","LatLongBoundingBox");if(!w[0]||!w[0].attributes)return[];u=w[0].attributes.getNamedItem("minx").value;K=w[0].attributes.getNamedItem("miny").value;E=w[0].attributes.getNamedItem("maxx").value;w=w[0].attributes.getNamedItem("maxy").value}u=parseFloat(u,10);K=parseFloat(K,10);E=parseFloat(E,10);w=parseFloat(w,10);return[u,K,E,w]},_describeFeatureType:function(f){if(""!==this._layerName)if(""===this.describeFeatureTypeUrl)this.onError("WFSLayer: invalid describeFeatureType url");
else if(""===this._wkid)this.onError("WFSLayer: invalid wkid");else if("snapshot"!==this._mode&&"onDemand"!==this._mode)this.onError("WFSLayer: invalid mode");else if(""===this._maxFeatures||0>this._maxFeatures||1E6<this._maxFeatures)this.onError("WFSLayer: invalid maxFeatures");else if(this._describeFeatureTypeCallback=f,f=q.trim(this.describeFeatureTypeUrl),""!==f){var r=f.indexOf("?");r=this._checkForUrlInUrl(f,r);var w="?"===f.charAt(f.length-1)?"":-1===r?"?":"\x26",u=this._nsLayerNames[this._layerName];
if(void 0===u)this.onError("WFSLayer: invalid layerName");else r=u.prefix,u=u.namespace,f=f+w+"service\x3dWFS\x26request\x3dDescribeFeatureType\x26version\x3d"+this._version,f+="\x26typeName\x3d",""!==r&&(f+=r+":"),f+=encodeURIComponent(this._layerName),""!==r&&(f+="\x26namespace\x3dxmlns("+r+"\x3d"+encodeURIComponent(u)+")"),f=this._appendCustomParameters(f),a({url:f,handleAs:"text",headers:{"Content-Type":null}},{usePost:!1}).then(this._describeFeatureTypeResponse,this._errorSupport)}},_describeFeatureTypeResponse:function(f){var r=
(new DOMParser).parseFromString(f,"text/xml");if(f=this._readExceptionReport(r,f))this.onError("WFSLayer: DescribeFeatureType - returns exception: "+f);else{this.fields=[];f=r.getElementsByTagNameNS("http://www.w3.org/2001/XMLSchema","schema");for(r=0;r<f.length;r++){var w=this._readAllFields(f[r]);null!==w&&(this._layerDefinedGeometryType=w[0],this.fields=w[1])}this.geometryType&&""!==this.geometryType||(this.geometryType=this._layerDefinedGeometryType);for(r=0;r<this.fields.length;r++)f=this.fields[r],
"esriFieldTypeGeometry"===f.type&&(this._nsGeometryFieldName=f.name);this.layerNamespace=this._nsLayerNames[this._layerName].namespace;if(0===this.fields.length)this.onError("WFSLayer: DescribeFeatureType - can't get fields");else this._getFeature(),(r=this._describeFeatureTypeCallback)&&r(this.fields)}},_readAllFields:function(f){for(var r=f.childNodes,w=0;w<r.length;w++){var u=r[w];if("element"===u.localName){var E=u.attributes;if(E.name.value===this._layerName)return(r=E.type)?(u=r.value,r=u.indexOf(":"),
u=u.substring(r+1),this._readFieldsFromGlobalComplextType(f,u)):this._readFieldsFromLocalComplextType(u)}}return null},_readFieldsFromGlobalComplextType:function(f,r){f=f.childNodes;for(var w=0;w<f.length;w++){var u=f[w];if("complexType"===u.localName&&u.attributes.name.value===r)return this._readFieldsFromLocalComplextType(u)}return null},_readFieldsFromLocalComplextType:function(f){for(var r=[],w="esriGeometryComplex",u=f.getElementsByTagNameNS("http://www.w3.org/2001/XMLSchema","element"),E=0;E<
u.length;E++){var K=u[E],Q="",V=K.attributes.getNamedItem("name");V&&(Q=V.value);if(""!==Q){var W=f="",Y=K.attributes.getNamedItem("type");V="unknown";if(null!==Y){W=Y.value;var ja=W.indexOf(":");f=W.substring(0,ja);W=W.substring(ja+1);V=Y.lookupNamespaceURI(f);null===V&&(V=Y.lookupNamespaceURI(null))}if(""===W){K=K.childNodes;for(var ba=0;ba<K.length;ba++)if(f=K[ba],"simpleType"===f.localName){f=f.childNodes;for(ba=0;ba<f.length;ba++)if(node2=f[ba],"restriction"===node2.localName){Y=node2.attributes.getNamedItem("base");
W=Y.value;ja=W.indexOf(":");f=W.substring(0,ja);W=W.substring(ja+1);break}if(""!==W)break}}K="Unknown";switch(W){case "integer":case "nonPositiveInteger":case "negativeInteger":case "long":case "int":case "short":case "byte":case "nonNegativeInteger":case "unsignedLong":case "unsignedInt":case "unsignedShort":case "unsignedByte":case "positiveInteger":K="esriFieldTypeInteger";r.push({name:Q,alias:Q,type:K,wfsNamespace:V});break;case "float":case "double":case "decimal":K="esriFieldTypeDouble";r.push({name:Q,
alias:Q,type:K,wfsNamespace:V});break;case "boolean":case "string":case "gYearMonth":case "gYear":case "gMonthDay":case "gDay":case "gMonth":case "anyURI":case "QName":case "NOTATION":case "normalizedString":case "token":case "language":case "IDREFS":case "ENTITIES":case "NMTOKEN":case "NMTOKENS":case "Name":case "NCName":case "ID":case "IDREF":case "ENTITY":K="esriFieldTypeString";r.push({name:Q,alias:Q,type:K,wfsNamespace:V});break;case "duration":case "dateTime":case "time":case "date":K="esriFieldTypeDate";
r.push({name:Q,alias:Q,type:K,wfsNamespace:V});break;case "PointPropertyType":case "MultiPointPropertyType":K="esriFieldTypeGeometry";w="esriGeometryPoint";r.push({name:Q,alias:Q,type:K,wfsNamespace:V});break;case "MultiCurvePropertyType":case "MultiLineStringPropertyType":K="esriFieldTypeGeometry";w="esriGeometryPolyline";r.push({name:Q,alias:Q,type:K,wfsNamespace:V});break;case "MultiSurfacePropertyType":case "MultiPolygonPropertyType":K="esriFieldTypeGeometry";w="esriGeometryPolygon";r.push({name:Q,
alias:Q,type:K,wfsNamespace:V});break;case "GeometryPropertyType":case "MultiGeometryPropertyType":K="esriFieldTypeGeometry",w="esriGeometryComplex",r.push({name:Q,alias:Q,type:K,wfsNamespace:V})}}}return[w,r]},_getFeature:function(){var f="\x3c?xml version\x3d'1.0' encoding\x3d'utf-8'?\x3e\n\x3cGetFeature \n xmlns:xsi\x3d'http://www.w3.org/2001/XMLSchema-instance'\n xmlns:gml\x3d'http://www.opengis.net/gml'\n xmlns:ogc\x3d'http://www.opengis.net/ogc'\n xmlns:wfs\x3d'http://www.opengis.net/wfs'\n";
f="2.0.0"===this._version?f+" xmlns\x3d'http://www.opengis.net/wfs/2.0'\n":f+" xmlns\x3d'http://www.opengis.net/wfs'\n";var r=this._nsLayerNames[this._layerName];if(void 0===r)this.onError("WFSLayer: invalid layerName");else{var w=r.prefix;r=r.namespace;if("ondemand"===this._mode.toLowerCase()&&""===this._nsGeometryFieldName)this.onError("WFSLayer: GetFeature - can't use 'onDemand' mode as geometryFieldName is unknown.");else if(f+=" xmlns:"+w+"\x3d'"+r+"'\n",f="2.0.0"===this._version?f+(" version\x3d'"+
this._version+"' service\x3d'WFS' count\x3d'"+this._maxFeatures+"'\x3e\n"):f+(" version\x3d'"+this._version+"' service\x3d'WFS' maxFeatures\x3d'"+this._maxFeatures+"'\x3e\n"),f="2.0.0"===this._version?f+(" \x3cQuery typeNames\x3d'"+w+":"+this._layerName+"' srsName\x3d'EPSG:"+this._wkid+"'\x3e\n"):f+(" \x3cwfs:Query typeName\x3d'"+w+":"+this._layerName+"' srsName\x3d'EPSG:"+this._wkid+"'\x3e\n"),"ondemand"===this._mode.toLowerCase()&&(f=f+"  \x3cogc:Filter xmlns:ogc\x3d'http://www.opengis.net/ogc'\x3e\n   \x3cogc:BBOX\x3e\n    \x3cogc:PropertyName\x3e"+
(w+":"+this._nsGeometryFieldName+"\x3c/ogc:PropertyName\x3e\n"),f+="    \x3cgml:Box srsName\x3d'EPSG:"+this._wkid+"'\x3e\n",f=this._inverseFilter?f+"      \x3cgml:coordinates\x3e{ymin},{xmin} {ymax},{xmax}\x3c/gml:coordinates\x3e\n":f+"      \x3cgml:coordinates\x3e{xmin},{ymin} {xmax},{ymax}\x3c/gml:coordinates\x3e\n",f+="    \x3c/gml:Box\x3e\n   \x3c/ogc:BBOX\x3e\n  \x3c/ogc:Filter\x3e\n"),f="2.0.0"===this._version?f+" \x3c/Query\x3e\n":f+" \x3c/wfs:Query\x3e\n",this._getFeatureRequest=f+"\x3c/GetFeature\x3e\n",
""===this.getFeatureUrl)this.onError("WFSLayer: getFeature - server doesn't support POST method.");else if(""!==this._getFeatureRequest&&this._map&&null!==this._map.spatialReference.wkid){f=this._getFeatureRequest;if("ondemand"===this._mode.toLowerCase()){f=this._map.extent.xmin;w=this._map.extent.ymin;r=this._map.extent.xmax;var u=this._map.extent.ymax,E={},K=this._map.spatialReference,Q=new z(this._wkid);this._projectFromSRToSR(K,Q,f,w,E)&&(f=E.x,w=E.y);this._projectFromSRToSR(K,Q,r,u,E)&&(r=E.x,
u=E.y);f=this._getFeatureRequest.replace(/{xmin}/,f).replace(/{ymin}/,w).replace(/{xmax}/,r).replace(/{ymax}/,u)}w=this._appendCustomParameters(this.getFeatureUrl);a({url:w,handleAs:"text",headers:{"Content-Type":"text/xml"},postData:f},{usePost:!0}).then(this._parseGml,this._errorSupport)}}},_parseGml:function(f){if(this._map&&this._map.spatialReference&&this._map.spatialReference.wkid){var r=(new DOMParser).parseFromString(f,"text/xml");if(f=this._readExceptionReport(r,f))this.onError("WFSLayer: GetFeature - returns exception: "+
f);else this._gmlNS="2.0.0"===this._version?"http://www.opengis.net/gml/3.2":"http://www.opengis.net/gml",""===this._wkid&&(this._wkid=this._map.spatialReference.wkid),this._graphicArray=this._readFeatureMembers(r,this._wkid,2,this._nsLayerNames[this._layerName].namespace,this._layerName),this.fullExtent=this._createFullExtent(this._graphicArray),this.onLabelingInfoChange(),"ondemand"===this._mode.toLowerCase()?this._fireUpdateEnd():this.refresh()}},_limit4326:function(f){for(var r=0;r<f.length;r++){var w=
f[r].geometry;4326===w.spatialReference.wkid&&(w.x=this._limit4326X(w.x),w.y=this._limit4326Y(w.y))}},_limit4326X:function(f){180<=f&&(f=179.99);-180>=f&&(f=-179.99);return f},_limit4326Y:function(f){90<=f&&(f=89.99);-90>=f&&(f=-89.99);return f},_createFullExtent:function(f){for(var r=null,w=0;w<f.length;w++){var u=f[w].geometry,E=null;(E="point"===u.geometryType?new D(u.x,u.y,u.x,u.y,u.spatialReference):u.getExtent())&&(r=null===r?E:r.union(E))}return r},_readExceptionReport:function(f,r){return 0<
f.getElementsByTagNameNS("*","ExceptionReport").length||0<f.getElementsByTagNameNS("*","ServiceExceptionReport").length?r:""},_readFeatureMembers:function(f,r,w,u,E){var K=this._readWkidFromNode(f);-1!=K&&(r=K);K=this._readSrsDimension(f);0!==K&&(w=K);var Q=[];var V=f.getElementsByTagNameNS("*","featureMembers");for(K=0;K<V.length;K++){var W=V[K];var Y=W.getElementsByTagNameNS(u,E);0===Y.length&&(Y=W.getElementsByTagNameNS(null,E));0===Y.length&&(Y=W.getElementsByTagNameNS("*",E));for(W=0;W<Y.length;W++)this._readLayer(Q,
Y[W],r,w)}V=f.getElementsByTagNameNS("*","featureMember");for(K=0;K<V.length;K++)for(W=V[K],Y=W.getElementsByTagNameNS(u,E),0===Y.length&&(Y=W.getElementsByTagNameNS(null,E)),0===Y.length&&(Y=W.getElementsByTagNameNS("*",E)),W=0;W<Y.length;W++)this._readLayer(Q,Y[W],r,w);V=f.getElementsByTagNameNS("*","member");for(K=0;K<V.length;K++)for(W=V[K],Y=W.getElementsByTagNameNS(u,E),0===Y.length&&(Y=W.getElementsByTagNameNS(null,E)),0===Y.length&&(Y=W.getElementsByTagNameNS("*",E)),W=0;W<Y.length;W++)this._readLayer(Q,
Y[W],r,w);return Q},_readLayer:function(f,r,w,u){var E=this._readSrsDimension(r);0!==E&&(u=E);var K=r.childNodes,Q="",V=null;for(r=0;r<K.length;r++){var W=K[r];if(1==W.nodeType&&(E=W.localName,"boundedBy"!==E)){W=this._readGeometry(W,w,u);if(!this._isProjectedOk){this._isProjectedOk=!0;console.error("WFSLayer: could not project geometry.");break}if(null!==W&&(V=W,Q=E,"point"!==V.geometryType||"esriGeometryPolygon"!==this.geometryType&&"esriGeometryPolyline"!==this.geometryType))break}}if(V){w={};
for(r=0;r<K.length;r++)if(W=K[r],E=W.localName,u=W.textContent,E!==Q)for(W=0;W<this.fields.length;W++){var Y=this.fields[W];Y.name==E&&(w[E]="esriFieldTypeDouble"===Y.type?parseFloat(u,10):"esriFieldTypeInteger"===Y.type?parseInt(u,10):u.trim())}this._convertWFSGeometryToGraphicObjects(f,V,w)}},_convertWFSGeometryToGraphicObjects:function(f,r,w){if("point"===r.geometryType&&("esriGeometryPoint"===this.geometryType||"esriGeometryComplex"===this.geometryType)){var u=new h;r=new B(r);u.setGeometry(r);
u.setAttributes(w);f.push(u)}else if("multipoint"===r.geometryType&&("esriGeometryPoint"===this.geometryType||"esriGeometryComplex"===this.geometryType))u=new h,r=new H(r),u.setGeometry(r),u.setAttributes(w),f.push(u);else if("polyline"===r.geometryType&&("esriGeometryPolyline"===this.geometryType||"esriGeometryComplex"===this.geometryType))u=new h,r=new G(r),u.setGeometry(r),u.setAttributes(w),f.push(u);else if("polygon"===r.geometryType&&("esriGeometryPolygon"===this.geometryType||"esriGeometryComplex"===
this.geometryType))u=new h,r=new J(r),u.setGeometry(r),u.setAttributes(w),f.push(u);else if("multigeometry"===r.geometryType)for(u=0;u<r.length;u++)this._convertWFSGeometryToGraphicObjects(f,r[u],w)},_readGeometry:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);var E=f.getElementsByTagNameNS(this._gmlNS,"MultiSurface");if(1<=E.length)for(u=0;u<E.length;)return this._readMultiSurface(E[u],r,w);E=f.getElementsByTagNameNS(this._gmlNS,"MultiCurve");
if(1<=E.length){var K=[];for(u=0;u<E.length;u++){var Q=this._readMultiCurve(E[u],r,w);for(f=0;f<Q.length;f++)K.push(Q[f])}return{geometryType:"polyline",paths:K,spatialReference:{wkid:this._map.spatialReference.wkid}}}E=f.getElementsByTagNameNS(this._gmlNS,"MultiGeometry");for(u=0;u<E.length;)return this._readMultiGeometry(E[u],r,w);E=f.getElementsByTagNameNS(this._gmlNS,"Geometry");for(u=0;u<E.length;)return this._readGeometry(E[u],r,w);E=f.getElementsByTagNameNS(this._gmlNS,"GeometryCollection");
for(u=0;u<E.length;)return this._readGeometryCollection(E[u],r,w);E=f.getElementsByTagNameNS(this._gmlNS,"Surface");for(u=0;u<E.length;)return this._readSurface(E[u],r,w);E=f.getElementsByTagNameNS(this._gmlNS,"Curve");for(u=0;u<E.length;)return this._readCurve(E[u],r,w);E=f.getElementsByTagNameNS(this._gmlNS,"MultiPolygon");for(u=0;u<E.length;)return this._readMultiPolygon(E[u],r,w);E=f.getElementsByTagNameNS(this._gmlNS,"Polygon");for(u=0;u<E.length;)return this._readPolygon(E[u],r,w);E=f.getElementsByTagNameNS(this._gmlNS,
"MultiLineString");for(u=0;u<E.length;)return this._readMultiLineString(E[u],r,w);E=f.getElementsByTagNameNS(this._gmlNS,"LineString");for(u=0;u<E.length;){r=this._readLineString(E[u],r,w);w={geometryType:"polyline",paths:[],spatialReference:{wkid:this._map.spatialReference.wkid}};u=[];for(f=0;f<r.length;f++)u.push(r[f]);w.paths.push(u);return w}E=f.getElementsByTagNameNS(this._gmlNS,"LinearRing");for(u=0;u<E.length;)return this._readLinearRing(E[u],r,w);E=f.getElementsByTagNameNS(this._gmlNS,"Box");
if(1<=E.length)for(u=0;u<E.length;)return this._readBox(E[u],r,w);E=f.getElementsByTagNameNS(this._gmlNS,"Envelope");for(u=0;u<E.length;)return this._readEnvelope(E[u],r,w);E=f.getElementsByTagNameNS(this._gmlNS,"MultiPoint");if(1<=E.length)for(u=0;u<E.length;)return this._readMultiPoint(E[u],r,w);E=f.getElementsByTagNameNS(this._gmlNS,"Point");for(u=0;u<E.length;)return this._readPoint(E[u],r,w);return null},_readGeometryCollection:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);
0!==u&&(w=u);u=[];u.geometryType="multigeometry";u.spatialReference={wkid:this._map.spatialReference.wkid};var E=f.getElementsByTagNameNS(this._gmlNS,"geometryMember");for(f=0;f<E.length;f++){var K=this._readGeometryMember(E[f],r,w);u.push(K)}return u},_readMultiGeometry:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);u=[];u.geometryType="multigeometry";u.spatialReference={wkid:this._map.spatialReference.wkid};var E=f.getElementsByTagNameNS(this._gmlNS,
"geometryMember");for(f=0;f<E.length;f++){var K=this._readGeometryMember(E[f],r,w);u.push(K)}return u},_readSurface:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);var E=[];E.geometryType="multigeometry";E.spatialReference={wkid:this._map.spatialReference.wkid};var K=f.getElementsByTagNameNS(this._gmlNS,"Point");for(u=0;u<K.length;u++)E.push(this._readPoint(K[u],r,w));K=f.getElementsByTagNameNS(this._gmlNS,"patches");for(u=0;u<K.length;u++){f=
this._readPatches(K[u],r,w);for(var Q=0;Q<f.length;Q++)E.push(f[Q])}return E},_readMultiSurface:function(f,r,w){var u;var E=this._readWkidFromNode(f);-1!=E&&(r=E);E=this._readSrsDimension(f);0!==E&&(w=E);var K=[];K.geometryType="multigeometry";K.spatialReference={wkid:this._map.spatialReference.wkid};var Q=f.getElementsByTagNameNS(this._gmlNS,"surfaceMember");for(E=0;E<Q.length;E++){var V=this._readSurfaceMember(Q[E],r,w);for(u=0;u<V.length;u++)K.push(V[u])}Q=f.getElementsByTagNameNS(this._gmlNS,
"surfaceMembers");for(E=0;E<Q.length;E++)for(f=this._readSurfaceMembers(Q[E],r,w),u=0;u<f.length;u++)K.push(f[u]);return K},_readCurve:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);u={geometryType:"polyline",paths:[],spatialReference:{wkid:this._map.spatialReference.wkid}};var E=f.getElementsByTagNameNS(this._gmlNS,"segments");for(f=0;f<E.length;f++)for(var K=this._readSegments(E[f],r,w),Q=0;Q<K.length;Q++)u.paths.push(K[Q]);return u},_readSegments:function(f,
r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);u=[];u.geometryType="multigeometry";u.spatialReference={wkid:this._map.spatialReference.wkid};var E=f.getElementsByTagNameNS(this._gmlNS,"LineStringSegment");for(f=0;f<E.length;f++){var K=this._readLineStringSegment(E[f],r,w);u.push(K)}return u},_readLineStringSegment:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);for(f=f.getElementsByTagNameNS(this._gmlNS,
"posList");0<f.length;)return this._readPosList(f[0],r,w)},_readMultiCurve:function(f,r,w){var u;var E=this._readWkidFromNode(f);-1!=E&&(r=E);E=this._readSrsDimension(f);0!==E&&(w=E);var K=[];K.spatialReference={wkid:this._map.spatialReference.wkid};var Q=f.getElementsByTagNameNS(this._gmlNS,"curveMember");for(E=0;E<Q.length;E++){var V=this._readCurveMember(Q[E],r,w);for(u=0;u<V.length;u++)K.push(V[u])}Q=f.getElementsByTagNameNS(this._gmlNS,"curveMembers");for(E=0;E<Q.length;E++)for(V=this._readCurveMembers(Q[E],
r,w),u=0;u<V.length;u++)K.push(V[u]);return K},_readGeometryMember:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);var E=f.getElementsByTagNameNS(this._gmlNS,"Point");for(u=0;u<E.length;)return this._readPoint(E[u],r,w);E=f.getElementsByTagNameNS(this._gmlNS,"LineString");for(u=0;u<E.length;){r=this._readLineString(E[u],r,w);w={geometryType:"polyline",paths:[],spatialReference:{wkid:this._map.spatialReference.wkid}};u=[];for(f=0;f<r.length;f++)u.push(r[f]);
w.paths.push(u);return w}E=f.getElementsByTagNameNS(this._gmlNS,"Polygon");for(u=0;u<E.length;)return this._readPolygon(E[u],r,w);return null},_readSurfaceMember:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);u=[];u.geometryType="multigeometry";u.spatialReference={wkid:this._map.spatialReference.wkid};var E=f.getElementsByTagNameNS(this._gmlNS,"Polygon");for(f=0;f<E.length;f++){var K=this._readPolygon(E[f],r,w);u.push(K)}return u},_readSurfaceMembers:function(f,
r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);u=[];u.geometryType="multigeometry";u.spatialReference={wkid:this._map.spatialReference.wkid};var E=f.getElementsByTagNameNS(this._gmlNS,"Polygon");for(f=0;f<E.length;f++){var K=this._readPolygon(E[f],r,w);u.push(K)}return u},_readCurveMember:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);u=[];u.geometryType="multigeometry";u.spatialReference={wkid:this._map.spatialReference.wkid};
var E=f.getElementsByTagNameNS(this._gmlNS,"LineString");for(f=0;f<E.length;f++){var K=this._readLineString(E[f],r,w);u.push(K)}return u},_readCurveMembers:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);u=[];u.geometryType="multigeometry";u.spatialReference={wkid:this._map.spatialReference.wkid};var E=f.getElementsByTagNameNS(this._gmlNS,"LineString");for(f=0;f<E.length;f++){var K=this._readLineString(E[f],r,w);u.push(K)}return u},_readBox:function(f,
r,w){var u,E,K,Q,V=this._readWkidFromNode(f);-1!=V&&(r=V);V=this._readSrsDimension(f);0!==V&&(w=V);V={geometryType:"polygon",rings:[],spatialReference:{wkid:this._map.spatialReference.wkid}};var W=f.getElementsByTagNameNS(this._gmlNS,"coordinates");for(u=0;u<W.length;u++)if(E=this._readCoordinates(W[u],r,w)){if(1<=E.length){var Y=K=E[0][0];var ja=Q=E[0][1]}1<=E.length&&(K=E[1][0],Q=E[1][1]);V.rings.push([[Y,ja],[Y,Q],[K,Q],[K,ja],[Y,ja]]);return V}W=f.getElementsByTagNameNS(this._gmlNS,"coord");return 2<=
W.length?((f=this._readCoord(W[0],r,w))&&1<=f.length&&(Y=K=f[0][0],ja=Q=f[0][1]),(r=this._readCoord(W[1],r,w))&&1<=r.length&&(K=r[0][0],Q=r[0][1]),V.rings.push([[Y,ja],[Y,Q],[K,Q],[K,ja],[Y,ja]]),V):null},_readEnvelope:function(f,r,w){var u,E;var K=this._readWkidFromNode(f);-1!=K&&(r=K);K=this._readSrsDimension(f);0!==K&&(w=K);var Q=f.getElementsByTagNameNS(this._gmlNS,"lowerCorner");for(K=0;K<Q.length;K++){var V=this._readCoordinates(Q[K],r,w);V&&(u=V[0])}Q=f.getElementsByTagNameNS(this._gmlNS,"upperCorner");
for(K=0;K<Q.length;K++)(f=this._readCoordinates(Q[K],r,w))&&(E=f[0]);return u&&E?{geometryType:"polygon",rings:[[[u[0],u[1]],[u[0],E[1]],[E[0],E[1]],[E[0],u[1]],[u[0],u[1]]]],spatialReference:{wkid:this._map.spatialReference.wkid}}:null},_readPolygon:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);var E={geometryType:"polygon",rings:[],spatialReference:{wkid:this._map.spatialReference.wkid}};var K=f.getElementsByTagNameNS(this._gmlNS,"outerBoundaryIs");
for(u=0;u<K.length;u++){var Q=this._readOuterBoundaryIs(K[u],r,w);E.rings.push(Q)}K=f.getElementsByTagNameNS(this._gmlNS,"innerBoundaryIs");for(u=0;u<K.length;u++)Q=this._readInnerBoundaryIs(K[u],r,w),E.rings.push(Q);K=f.getElementsByTagNameNS(this._gmlNS,"exterior");for(u=0;u<K.length;u++)Q=this._readExterior(K[u],r,w),E.rings.push(Q);K=f.getElementsByTagNameNS(this._gmlNS,"interior");for(u=0;u<K.length;u++)Q=this._readInterior(K[u],r,w),E.rings.push(Q);return E},_readPolygonMember:function(f,r,
w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);for(f=f.getElementsByTagNameNS(this._gmlNS,"Polygon");0<f.length;)return this._readPolygon(f[0],r,w);return null},_readMultiPolygon:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);u=[];u.geometryType="multigeometry";u.spatialReference={wkid:this._map.spatialReference.wkid};var E=f.getElementsByTagNameNS(this._gmlNS,"polygonMember");for(f=0;f<E.length;f++){var K=
this._readPolygonMember(E[f],r,w);u.push(K)}return u},_readOuterBoundaryIs:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);for(f=f.getElementsByTagNameNS(this._gmlNS,"LinearRing");0<f.length;)return this._readLinearRing(f[0],r,w);return null},_readInnerBoundaryIs:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);for(f=f.getElementsByTagNameNS(this._gmlNS,"LinearRing");0<f.length;)return this._readLinearRing(f[0],
r,w);return null},_readExterior:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);for(f=f.getElementsByTagNameNS(this._gmlNS,"LinearRing");0<f.length;)return this._readLinearRing(f[0],r,w);return null},_readInterior:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);for(f=f.getElementsByTagNameNS(this._gmlNS,"LinearRing");0<f.length;)return this._readLinearRing(f[0],r,w);return null},_readPatches:function(f,
r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);u=[];u.spatialReference={wkid:this._map.spatialReference.wkid};var E=f.getElementsByTagNameNS(this._gmlNS,"PolygonPatch");for(f=0;f<E.length;f++)u.push(this._readPolygon(E[f],r,w));return u},_readLineString:function(f,r,w){var u,E;var K=this._readWkidFromNode(f);-1!=K&&(r=K);K=this._readSrsDimension(f);0!==K&&(w=K);var Q=[];Q.spatialReference={wkid:this._map.spatialReference.wkid};var V=f.getElementsByTagNameNS(this._gmlNS,
"coordinates");for(K=0;K<V.length;K++)if(E=this._readCoordinates(V[K],r,w))for(u=0;u<E.length;u++){var W=E[u];Q.push(W)}V=f.getElementsByTagNameNS(this._gmlNS,"coord");for(K=0;K<V.length;K++)if(E=this._readCoord(V[K],r,w))for(u=0;u<E.length;u++)W=E[u],Q.push(W);V=f.getElementsByTagNameNS(this._gmlNS,"posList");for(K=0;K<V.length;K++)if(E=this._readPosList(V[K],r,w))for(u=0;u<E.length;u++)W=E[u],Q.push(W);return Q},_readLineStringMember:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);
u=this._readSrsDimension(f);0!==u&&(w=u);for(f=f.getElementsByTagNameNS(this._gmlNS,"LineString");0<f.length;)return this._readLineString(f[0],r,w);return null},_readMultiLineString:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);u={geometryType:"polyline",paths:[],spatialReference:{wkid:this._map.spatialReference.wkid}};var E=f.getElementsByTagNameNS(this._gmlNS,"lineStringMember");for(f=0;f<E.length;f++){var K=this._readLineStringMember(E[f],
r,w);K&&u.paths.push(K)}return 1<=u.paths.length?u:null},_readPoint:function(f,r,w){var u;var E=this._readWkidFromNode(f);-1!=E&&(r=E);E=this._readSrsDimension(f);0!==E&&(w=E);var K=f.getElementsByTagNameNS(this._gmlNS,"coordinates");for(E=0;E<K.length;E++)if(u=this._readCoordinates(K[E],r,w))return{geometryType:"point",x:u[0][0],y:u[0][1],spatialReference:{wkid:this._map.spatialReference.wkid}};K=f.getElementsByTagNameNS(this._gmlNS,"pos");for(E=0;E<K.length;E++)if((u=this._readPos(K[E],r,w))&&0<
u.length)return{geometryType:"point",x:u[0][0],y:u[0][1],spatialReference:{wkid:this._map.spatialReference.wkid}};K=f.getElementsByTagNameNS(this._gmlNS,"coord");for(E=0;E<K.length;E++)if(f=this._readCoord(K[E],r,w))return{geometryType:"point",x:f[0][0],y:f[0][1],spatialReference:{wkid:this._map.spatialReference.wkid}};return null},_readPointMember:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);for(f=f.getElementsByTagNameNS(this._gmlNS,"Point");0<
f.length;)return this._readPoint(f[0],r,w);return null},_readMultiPoint:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);u={geometryType:"multipoint",points:[],spatialReference:{wkid:this._map.spatialReference.wkid}};var E=f.getElementsByTagNameNS(this._gmlNS,"pointMember");for(f=0;f<E.length;f++){var K=this._readPointMember(E[f],r,w);K&&u.points.push([K.x,K.y])}return 1<=u.points.length?u:null},_readLinearRing:function(f,r,w){var u=this._readWkidFromNode(f);
-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);var E=f.getElementsByTagNameNS(this._gmlNS,"coordinates");for(u=0;u<E.length;)return this._readCoordinates(E[u],r,w);E=f.getElementsByTagNameNS(this._gmlNS,"posList");for(u=0;u<E.length;)return this._readCoordinates(E[u],r,w);E=f.getElementsByTagNameNS(this._gmlNS,"pos");for(u=0;u<E.length;)return this._readPos(E[u],r,w)},_readCoordinatesBody:function(f,r,w){var u=new z(f);r=r.trim();var E=[];E.spatialReference={wkid:this._map.spatialReference.wkid};
f=this._isReverse(f,this.version);if(r)if(2===w){if((r=r.match(/[0123456789.\-\+eE]+/g))&&2<=r.length)for(w=0;w<r.length;w+=2){var K=parseFloat(r[w]);var Q=parseFloat(r[w+1]);if(f){var V=Q;Q=K;K=V}V={};this._projectFromSRToSR(u,this._map.spatialReference,K,Q,V)&&(K=V.x,Q=V.y);E.push([K,Q])}}else if(3===w&&(r=r.match(/[0123456789.\-\+eE]+/g))&&3<=r.length)for(w=0;w<r.length;w+=3)K=parseFloat(r[w]),Q=parseFloat(r[w+1]),f&&(V=Q,Q=K,K=V),V={},this._projectFromSRToSR(u,this._map.spatialReference,K,Q,V)&&
(K=V.x,Q=V.y),E.push([K,Q]);return E},_readCoord:function(f,r,w){var u,E=this._readWkidFromNode(f);-1!=E&&(r=E);E=new z(r);var K=this._readSrsDimension(f);0!==K&&(w=K);var Q=this._isReverse(r,this.version),V=[];V.spatialReference={wkid:this._map.spatialReference.wkid};K=0;var W=f.getElementsByTagNameNS(this._gmlNS,"X");for(u=0;u<W.length;){K=this._readFloat(W[u],r,w);break}var Y=0;W=f.getElementsByTagNameNS(this._gmlNS,"Y");for(u=0;u<W.length;){Y=this._readFloat(W[u],r,w);break}Q&&(f=Y,Y=K,K=f);f=
{};this._projectFromSRToSR(E,this._map.spatialReference,K,Y,f)&&(K=f.x,Y=f.y);V.push(Q?[Y,K]:[K,Y]);return V},_readCoordinates:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);return this._readCoordinatesBody(r,f.textContent,w)},_readPos:function(f,r,w){var u=this._readWkidFromNode(f);-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);return this._readCoordinatesBody(r,f.textContent,w)},_readPosList:function(f,r,w){var u=this._readWkidFromNode(f);
-1!=u&&(r=u);u=this._readSrsDimension(f);0!==u&&(w=u);return this._readCoordinatesBody(r,f.textContent,w)},_projectFromSRToSR:function(f,r,w,u,E){if(y.canProject(f,r))return f=new B(w,u,f),r=y.project(f,r),E.x=r.x,E.y=r.y,!0;E.x=w;E.y=u;return this._isProjectedOk=!1},_readFloat:function(f){return(f=f.textContent)?parseFloat(f):0},_readSrsDimension:function(f){return f.attributes&&(f=f.attributes.getNamedItem("srsDimension"))?parseInt(f.value,10):0},_readWkidFromNode:function(f){return f.attributes&&
(f=f.attributes.getNamedItem("srsName"))&&(f=f.value.match(/\d+/g))&&0<f.length?(f=parseInt(f[f.length-1],10),84===f&&(f=4326),parseInt(f,10)):-1},_isReverse:function(f,r){return this._inverseResponse},_appendCustomParameters:function(f){if(this.customParameters)for(var r in this.customParameters)f+=(-1===f.indexOf("?")?"?":"\x26")+r+"\x3d"+encodeURIComponent(this.customParameters[r]);return f},_checkForUrlInUrl:function(f,r){var w=f.toLowerCase().lastIndexOf("http");-1<r&&w>r&&(-1<f.indexOf("?",
w)||-1!==f.indexOf("\x26",w)||(r=-1));return r}});g("extend-esri")&&q.setObject("layers.WFSLayer",L,b);return L})},"widgets/Analysis/toolValidate":function(){define(["dojo/_base/lang","dojo/_base/array","./layerUtil"],function(L,d,q){return{isValid:function(p,t,g){var c=!1;-1!==t.dijitID.indexOf("MergeLayers")?c=this.mergeAvailable(p):-1!==t.dijitID.indexOf("ExtractData")?c=this.extractAvailable(p,g):-1!==t.dijitID.indexOf("GeocodeLocationsFromTable")?c=this.geocodeLocationsFromTable():(g=null,"requiredParam"in
t&&(g=t.requiredParam),c=this.paramAvailable(p,t.analysisLayer,g));return c},geocodeLocationsFromTable:function(){var p=q.getTableInfos();return L.isArray(p)&&0<p.length},mergeAvailable:function(p){return d.some(p,function(t){return d.some(p,function(g){return g!==t&&g.geometryType===t.geometryType})})},extractAvailable:function(p,t){var g=t.getUser(),c=t.isPortal();d.forEach(p,function(a){var b="esri.layers.GeoRSSLayer"===a.declaredClass,h="esri.layers.CSVLayer"===a.declaredClass,k="esri.layers.FeatureLayer"===
a.declaredClass,l="esri.layers.WFSLayer"===a.declaredClass;k&&!a.url||b||h||l?this._addExtractCapability(a):k&&(t.isAdmin()&&(c&&a.itemInfo&&a.itemInfo.itemControl&&"admin"===a.itemInfo.itemControl||!c&&a.url&&-1<a.url.indexOf("/"+g.orgId+"/"))?this._addExtractCapability(a):g&&a.itemInfo&&a.itemInfo.owner&&a.itemInfo.owner===g.username&&(!c&&a.url&&-1<a.url.indexOf("/"+g.orgId+"/")||c)&&this._addExtractCapability(a))},this);return d.some(p,function(a){return a.capabilities&&0<=a.capabilities.indexOf("Extract")})},
_addExtractCapability:function(p){p.capabilities?-1===p.capabilities.indexOf("Extract")&&(p.capabilities+=",Extract"):p.capabilities="Extract";return!0},paramAvailable:function(p,t,g){var c=!1;var a=t.geomTypes;t=this.findMatchedFeatureLayers(p,a);0<t.length&&(g?(a=g.geomTypes,p=this.findMatchedFeatureLayers(p,a),0<p.length&&(t.length!==p.length?c=!0:1<t.length?c=!0:t[0]!==p[0]&&(c=!0))):c=!0);return c},findMatchedFeatureLayers:function(p,t){var g=[];d.forEach(p,L.hitch(this,function(c){c&&(1===t.length?
("*"===t[0]||t[0]===c.geometryType)&&g.push(c.id):-1<t.indexOf(c.geometryType)&&g.push(c.id))}));return g}}})},"widgets/Analysis/PrivilegeUtil":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/Deferred dojo/promise/all jimu/portalUtils jimu/portalUrlUtils jimu/Role esri/request esri/kernel esri/lang ./PortalAnalysis".split(" "),function(L,d,q,p,t,g,c,a,b,h,k,l){var e=null,n=L([],{userRole:null,userPortalUrl:null,portalAnalysis:null,portalSelf:null,portalUrl:null,licenseDef:null,
licenseLevel:null,federatedServers:null,constructor:function(m){this.portalUrl=m},_clearLoadedInfo:function(){this.portalUrl=this.portalSelf=this.portalAnalysis=this.userPortalUrl=this.userRole=null},loadPrivileges:function(m){m&&this.portalUrl!==m&&(this._clearLoadedInfo(),this.portalUrl=m);if(this._privilegeLoaded())return m=new p,m.resolve(!0),m;m=g.getPortal(this.portalUrl);var v=new p;(m.haveSignIn()?this._loadUserInfo(m):this._signIn(m)).then(d.hitch(this,function(z){z&&this.isPortal()?this.checkAnalysisLicense().then(function(){v.resolve(z)}):
v.resolve(z)}));return v},_signIn:function(m){return m.loadSelfInfo().then(d.hitch(this,function(v){var z=g.getPortal(v.portalHostname);return null===z?!1:z.signIn().then(d.hitch(this,function(y){return this._loadUserInfo(z,y)}),function(){return!1})}),function(){return!1})},_registerOrgCredential:function(m,v){v=c.getStandardPortalUrl(v);m=d.clone(m.toJson());v+="/sharing/rest";m.server=v;m.resources=[v];h.id.registerToken(m)},_loadUserInfo:function(m,v){var z=m.loadSelfInfo();m=m.getHelpMap();return t([z,
m]).then(d.hitch(this,function(y){var D=y[0];y=y[1]&&y[1].helpMap;var B={};y&&(B.helpMap=y.v&&y.m?y:{v:"1.0",m:y});this.userPortalUrl=D.urlKey?D.urlKey+"."+D.customBaseUrl:this.portalUrl;return D&&D.user?(this.userRole=new a({id:D.user.roleId?D.user.roleId:D.user.role,role:D.user.role}),D.user.privileges&&this.userRole.setPrivileges(D.user.privileges),this.portalSelf=d.mixin(D,B),v&&this._registerOrgCredential(v,this.userPortalUrl),this.portalAnalysis=new l(this.userRole,this.portalSelf),!0):!1}),
function(){return!1})},_privilegeLoaded:function(){return null!==this.portalSelf},getUser:function(){return this._privilegeLoaded()?this.portalSelf.user:null},isAdmin:function(){return this._privilegeLoaded()?this.userRole.isAdmin():!1},getUserPortal:function(){return this._privilegeLoaded()?this.userPortalUrl:null},isPortal:function(){return null!==this.portalSelf&&!0===this.portalSelf.isPortal},livingAtlasConfigEnabled:function(){return this.isPortal()?this.portalSelf&&this.portalSelf.livingAtlasGroupQuery&&
0<this.portalSelf.livingAtlasGroupQuery.length:!0},canPerformAnalysis:function(){return null!==this.portalAnalysis&&this.portalAnalysis.canPerformAnalysis()},canPerformSpatialAnalytics:function(){return null!==this.portalAnalysis&&this.portalAnalysis.canPerformSpatialAnalytics()},canPerformGeoAnalytics:function(){return null!==this.portalAnalysis&&this.portalAnalysis.canPerformGeoAnalytics()},canPerformRasterAnalysis:function(){return null!==this.portalAnalysis&&this.portalAnalysis.canPerformRasterAnalysis()},
canPerformGeoEnrichment:function(){return null!==this.portalAnalysis&&this.portalAnalysis._canPerformGeoEnrichment()},hasPrivileges:function(m){var v=m,z=!1;d.isArray(m)&&0<=m.indexOf("svradvanced")&&(z=!0,v=q.filter(m,function(y){return"svradvanced"!==y}));return z&&this.isPortal()?this.isAdvanceLicense()&&null!==this.portalAnalysis&&this.portalAnalysis.hasPrivileges(v):null!==this.portalAnalysis&&this.portalAnalysis.hasPrivileges(v)},isAdvanceLicense:function(){return"svradvanced"===this.licenseLevel},
getFederatedServers:function(){var m=new p;if(this.isPortal()&&this.userRole&&!this.federatedServers){var v=c.getSharingUrl(this.portalUrl)+"/portals/"+this.portalSelf.id+"/servers";b({url:v,content:{f:"json"}}).then(d.hitch(this,function(z){this.federatedServers=z.servers;m.resolve(this.federatedServers)}),d.hitch(this,function(z){console.log("cannot load federated servers",z);this.federatedServers=[];m.resolve([])}))}else m.resolve(this.federatedServers);return m},getLicense:function(m){var v=new p,
z;if(0===m.length)return v.resolve(null),v;m=q.filter(m,function(y){return"HOSTING_SERVER"===y.serverRole},this);0<m.length&&(z=m[0]);m=c.getSharingUrl(this.portalUrl);b({url:m+"/portals/"+this.portalSelf.id+"/servers/"+z.id,content:{f:"json"}}).then(d.hitch(this,function(y){var D=d.mixin({},y);y=k.isDefined(y.edition)||k.isDefined(y.level)?null:"svradvanced";this.licenseLevel=D.edition?D.edition.name:y;v.resolve({licenseInfo:D,licenseLevel:this.licenseLevel})}),d.hitch(this,function(y){console.log("cannot load hostingServer info",
y);v.resolve({})}));return v},checkAnalysisLicense:function(){var m=new p;this.licenseDef?this.licenseDef.isResolved()?m.resolve("svradvanced"===this.licenseLevel):this.licenseDef.then(d.hitch(this,function(){m.resolve("svradvanced"===this.licenseLevel)})):(this.licenseDef=this.getFederatedServers().then(d.hitch(this,function(v){return this.getLicense(v)})),this.licenseDef.then(d.hitch(this,function(){return m.resolve("svradvanced"===this.licenseLevel)})));return m}});n.getInstance=function(m){null===
e&&(e=new n(m));return e};return n})},"widgets/Analysis/PortalAnalysis":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/array","esri/lang"],function(L,d,q,p){return L([],{userRole:null,portalSelf:null,constructor:function(t,g){this.userRole=t;this.portalSelf=g},canPerformAnalysis:function(){var t=!1;this.userRole&&(this.userRole.isAdmin()||this.userRole.isPublisher())?t=!0:this.userRole&&this.userRole.isCustom()&&(t=this.userRole.canCreateItem()&&this.userRole.canPublishFeatures()&&
this.userRole.canUseSpatialAnalysis());this.portalSelf&&this.portalSelf.isPortal&&(t=t&&p.isDefined(this.portalSelf.helperServices.analysis)&&p.isDefined(this.portalSelf.helperServices.analysis.url));return t},canPerformSpatialAnalytics:function(){return p.isDefined(this.portalSelf.helperServices.analysis)&&p.isDefined(this.portalSelf.helperServices.analysis.url)},canPerformGeoAnalytics:function(){var t=p.isDefined(this.portalSelf.helperServices.geoanalytics)&&p.isDefined(this.portalSelf.helperServices.geoanalytics.url);
return this.canPerformAnalysis()&&t},canPerformRasterAnalysis:function(){var t=p.isDefined(this.portalSelf.helperServices.rasterAnalytics)&&p.isDefined(this.portalSelf.helperServices.rasterAnalytics.url);return this.canPerformAnalysis()&&t},hasPrivileges:function(t){return d.isArray(t)&&0<t.length?q.every(t,function(g){return"networkanalysis"===g?this._canPerformNetworkAnalysis():"geoenrichment"===g?this._canPerformGeoEnrichment():"elevation"===g?this._canPerformElevationAnalysis():"drivetimearea"===
g?this._canPerformDriveAnalysis():"planroutes"===g?this._canPerformPlanRoutesAnalysis():"od"===g?this._canPerformODAnalysis():"hydro"===g?this._canPerformHydroAnalysis():"loc"===g?this._canPerformLocAllocationAnalysis():!1},this):!0},_canPerformNetworkAnalysis:function(){var t=p.isDefined(this.portalSelf.helperServices.asyncClosestFacility)&&p.isDefined(this.portalSelf.helperServices.asyncServiceArea)&&p.isDefined(this.portalSelf.helperServices.asyncVRP);return this.canPerformAnalysis()&&t&&this.userRole.canUseNetworkAnalysis()},
_canPerformGeoEnrichment:function(){var t=p.isDefined(this.portalSelf.helperServices.geoenrichment);return this.canPerformAnalysis()&&t&&this.userRole.canUseGeoenrichment()},_canPerformElevationAnalysis:function(){var t=p.isDefined(this.portalSelf.helperServices.elevation);return this.canPerformAnalysis()&&t},_canPerformPlanRoutesAnalysis:function(){var t=p.isDefined(this.portalSelf.helperServices.routingUtilities)&&p.isDefined(this.portalSelf.helperServices.asyncVRP);return this.canPerformAnalysis()&&
t&&this.userRole.canUseNetworkAnalysis()},_canPerformODAnalysis:function(){var t=p.isDefined(this.portalSelf.helperServices.routingUtilities)&&p.isDefined(this.portalSelf.helperServices.asyncRoute);return this.canPerformAnalysis()&&t&&this.userRole.canUseNetworkAnalysis()},_canPerformDriveAnalysis:function(){var t=p.isDefined(this.portalSelf.helperServices.routingUtilities)&&p.isDefined(this.portalSelf.helperServices.asyncServiceArea);return this.canPerformAnalysis()&&t&&this.userRole.canUseNetworkAnalysis()},
_canPerformNearestAnalysis:function(){var t=p.isDefined(this.portalSelf.helperServices.routingUtilities)&&p.isDefined(this.portalSelf.helperServices.asyncClosestFacility);return this.canPerformAnalysis()&&t&&this.userRole.canUseNetworkAnalysis()},_canPerformLocAllocationAnalysis:function(){var t=p.isDefined(this.portalSelf.helperServices.routingUtilities)&&p.isDefined(this.portalSelf.helperServices.asyncLocationAllocation);return this.canPerformAnalysis()&&t&&this.userRole.canUseNetworkAnalysis()},
_canPerformHydroAnalysis:function(){var t=p.isDefined(this.portalSelf.helperServices.hydrology);return this.canPerformAnalysis()&&t}})})},"widgets/Analysis/toolSettings":function(){define(["dojo/_base/lang","dojo/_base/array"],function(L,d){var q={},p=0,t=[{id:p++,dijitID:"esri/dijit/analysis/AggregatePoints",name:"AggregatePoints",title:"aggregateTool",imgDisplay:"images/aggregate-points.png",usage:"aggregatePointsUsage",analysisLayer:{name:"pointLayer",geomTypes:["esriGeometryPoint","esriGeometryMultipoint"]},
requiredParam:{name:"polygonLayers",isArray:!0,geomTypes:["esriGeometryPolygon"]},icon:"images/AggregatePoints32.png"},{id:p++,dijitID:"esri/dijit/analysis/CalculateDensity",name:"CalculateDensity",title:"calculateDensity",imgDisplay:"images/calculate-density.png",usage:"calculateDensityUsage",analysisLayer:{name:"inputLayer",geomTypes:["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline"]},optionalParams:[{name:"boundingPolygonLayers",isArray:!0,geomTypes:["esriGeometryPolygon"]}],
icon:"images/CreateDensitySurface32.png",privileges:["svradvanced"]},{id:p++,dijitID:"esri/dijit/analysis/ChooseBestFacilities",name:"ChooseBestFacilities",title:"chooseBestFacilities",imgDisplay:"images/choose-best-facilities.png",analysisLayer:{name:"demandLocationLayer",geomTypes:["esriGeometryPoint","esriGeometryMultipoint"]},optionalParams:[{name:"demandLocationLayers",isArray:!0,geomTypes:["esriGeometryPoint","esriGeometryMultipoint"]},{name:"featureLayers",isArray:!0,geomTypes:["*"]},{name:"pointBarriers",
isArray:!0,geomTypes:["esriGeometryPoint"]},{name:"lineBarriers",isArray:!0,geomTypes:["esriGeometryPolyline"]},{name:"polygonBarriers",isArray:!0,geomTypes:["esriGeometryPolygon"]}],icon:"images/ChooseBestFacilities32.png",privileges:["loc"]},{id:p++,dijitID:"esri/dijit/analysis/ConnectOriginsToDestinations",name:"ConnectOriginsToDestinations",title:"connectOriginsToDestinations",imgDisplay:"images/connect-origins-to-destinations.png",usage:"connectOriginsToDestinationsUsage",analysisLayer:{name:"originsLayer",
geomTypes:["esriGeometryPoint"]},requiredParam:{name:"featureLayers",isArray:!0,geomTypes:["esriGeometryPoint"]},optionalParams:[{name:"pointBarriers",isArray:!0,geomTypes:["esriGeometryPoint"]},{name:"lineBarriers",isArray:!0,geomTypes:["esriGeometryPolyline"]},{name:"polygonBarriers",isArray:!0,geomTypes:["esriGeometryPolygon"]}],icon:"images/ConnectOriginstoDestinations32.png",privileges:["od"]},{id:p++,dijitID:"esri/dijit/analysis/CreateBuffers",name:"CreateBuffers",title:"createBuffers",imgDisplay:"images/create-buffers.png",
usage:"createBuffersUsage",analysisLayer:{name:"inputLayer",geomTypes:["*"]},icon:"images/CreateBuffers32.png"},{id:p++,dijitID:"esri/dijit/analysis/CreateDriveTimeAreas",name:"CreateDriveTimeAreas",title:"createDriveTimeAreas",imgDisplay:"images/create-drivetime.png",usage:"createDriveTimeAreasUsage",analysisLayer:{name:"inputLayer",geomTypes:["esriGeometryPoint"]},optionalParams:[{name:"pointBarriers",isArray:!0,geomTypes:["esriGeometryPoint"]},{name:"lineBarriers",isArray:!0,geomTypes:["esriGeometryPolyline"]},
{name:"polygonBarriers",isArray:!0,geomTypes:["esriGeometryPolygon"]}],icon:"images/CreateDriveTimeAreas32.png",cannotCancel:!0,privileges:["drivetimearea"]},{id:p++,dijitID:"esri/dijit/analysis/CreateViewshed",name:"CreateViewshed",title:"createViewshed",imgDisplay:"images/create-viewshed.png",usage:"createViewshedUsage",analysisLayer:{name:"inputLayer",geomTypes:["esriGeometryPoint"]},icon:"images/Viewshed32.png",privileges:["elevation"]},{id:p++,dijitID:"esri/dijit/analysis/CreateWatersheds",name:"CreateWatersheds",
title:"createWatershed",imgDisplay:"images/create-watersheds.png",usage:"createWatershedsUsage",analysisLayer:{name:"inputLayer",geomTypes:["esriGeometryPoint"]},icon:"images/Watershed32.png",privileges:["hydro"]},{id:p++,dijitID:"esri/dijit/analysis/DeriveNewLocations",name:"DeriveNewLocations",title:"deriveNewLocations",imgDisplay:"images/derive-new-locations.png",usage:"deriveNewLocationsUsage",analysisLayer:{name:"analysisLayer",geomTypes:["*"]},optionalParams:[{name:"inputLayers",isArray:!0,
geomTypes:["*"]}],icon:"images/FindNewLocations32.png"},{id:p++,dijitID:"esri/dijit/analysis/DissolveBoundaries",name:"DissolveBoundaries",title:"dissolveBoundaries",imgDisplay:"images/dissolve-boundaries.png",usage:"dissolveBoundariesUsage",analysisLayer:{name:"inputLayer",geomTypes:["esriGeometryPolygon"]},icon:"images/DissolveBoundaries32.png"},{id:p++,dijitID:"esri/dijit/analysis/EnrichLayer",name:"EnrichLayer",title:"enrichLayer",imgDisplay:"images/enrich-layer.png",usage:"enrichLayerUsage",
analysisLayer:{name:"inputLayer",geomTypes:["*"]},icon:"images/GeoenrichFeatures32.png",privileges:["geoenrichment"]},{id:p++,dijitID:"esri/dijit/analysis/ExtractData",name:"ExtractData",title:"extractData",imgDisplay:"images/extract-data.png",usage:"extractDataDesc",optionalParams:[{name:"featureLayers",isArray:!0,geomTypes:["*"]}],icon:"images/ClipAndShip32.png"},{id:p++,dijitID:"esri/dijit/analysis/FindCentroids",name:"FindCentroids",title:"findCentroids",imgDisplay:"images/find-centroids.png",
usage:"findCentroidsUsage",analysisLayer:{name:"inputLayer",geomTypes:["*"]},optionalParams:[{name:"inputLayers",isArray:!0,geomTypes:["*"]}],icon:"images/FindCentroid32.png",privileges:["svradvanced"]},{id:p++,dijitID:"esri/dijit/analysis/FindExistingLocations",name:"FindExistingLocations",title:"findExistingLocations",imgDisplay:"images/find-existing-locations.png",usage:"findExistingLocationsUsage",analysisLayer:{name:"analysisLayer",geomTypes:["*"]},optionalParams:[{name:"inputLayers",isArray:!0,
geomTypes:["*"]}],icon:"images/FindExistingLocations32.png"},{id:p++,dijitID:"esri/dijit/analysis/FindHotSpots",name:"FindHotSpots",title:"findHotSpots",imgDisplay:"images/find-hot-spots.png",usage:"findHotSpotsUsage",analysisLayer:{name:"analysisLayer",geomTypes:["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolygon"]},optionalParams:[{name:"aggregationPolygonLayers",isArray:!0,geomTypes:["esriGeometryPolygon"]},{name:"boundingPolygonLayers",isArray:!0,geomTypes:["esriGeometryPolygon"]}],
icon:"images/FindHotSpots32.png"},{id:p++,dijitID:"esri/dijit/analysis/FindNearest",name:"FindNearest",title:"findNearest",imgDisplay:"images/find-nearest.png",usage:"findNearestUsage",analysisLayer:{name:"analysisLayer",geomTypes:["*"]},requiredParam:{name:"nearLayers",isArray:!0,geomTypes:["*"]},optionalParams:[{name:"pointBarriers",isArray:!0,geomTypes:["esriGeometryPoint"]},{name:"lineBarriers",isArray:!0,geomTypes:["esriGeometryPolyline"]},{name:"polygonBarriers",isArray:!0,geomTypes:["esriGeometryPolygon"]}],
icon:"images/FindNearest32.png",cannotCancel:!0,privileges:["svradvanced"]},{id:p++,dijitID:"esri/dijit/analysis/FindOutliers",name:"FindOutliers",title:"findOutliers",imgDisplay:"images/find-outliers.png",usage:"findOutliersUsage",analysisLayer:{name:"analysisLayer",geomTypes:["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolygon"]},optionalParams:[{name:"aggregationPolygonLayers",isArray:!0,geomTypes:["esriGeometryPolygon"]},{name:"boundingPolygonLayers",isArray:!0,geomTypes:["esriGeometryPolygon"]}],
icon:"images/FindOutliers32.png"},{id:p++,dijitID:"esri/dijit/analysis/FindPointClusters",name:"FindPointClusters",title:"findPointClusters",imgDisplay:"images/find-point-clusters.png",usage:"findPointClustersUsage",analysisLayer:{name:"analysisLayer",geomTypes:["esriGeometryPoint"]},optionalParams:[{name:"analysisLayers",isArray:!0,geomTypes:["esriGeometryPoint"]}],icon:"images/FindPointClusters32.png"},{id:p++,dijitID:"esri/dijit/analysis/FindSimilarLocations",name:"FindSimilarLocations",title:"findSimilarLocations",
imgDisplay:"images/find-similar-locations.png",usage:"findSimilarLocationsUsage",analysisLayer:{name:"inputLayer",geomTypes:["*"]},optionalParams:[{name:"searchLayers",isArray:!0,geomTypes:["*"]}],icon:"images/FindSimilarLocations32.png"},{id:p++,dijitID:"esri/dijit/analysis/GeocodeLocationsFromTable",name:"GeocodeLocationsFromTable",title:"geocodeLocations",imgDisplay:"images/geocode-locations-from-table.png",usage:"geocodeLocationsUsage",icon:"images/GeocodeLocationsFromTable32.png",portalOnly:!0},
{id:p++,dijitID:"esri/dijit/analysis/InterpolatePoints",name:"InterpolatePoints",title:"interpolatePoints",imgDisplay:"images/interpolate-points.png",usage:"interpolatePointsUsage",analysisLayer:{name:"inputLayer",geomTypes:["esriGeometryPoint","esriGeometryMultipoint"]},optionalParams:[{name:"boundingPolygonLayers",isArray:!0,geomTypes:["esriGeometryPolygon"]},{name:"predictAtPointLayers",isArray:!0,geomTypes:["esriGeometryPoint"]}],icon:"images/CreateInterpolatedSurface32.png",privileges:["svradvanced"]},
{id:p++,dijitID:"esri/dijit/analysis/JoinFeatures",name:"JoinFeatures",title:"joinFeatures",imgDisplay:"images/join-features.png",usage:"joinFeaturesUsage",analysisLayer:{name:"targetLayer",geomTypes:["*"]},optionalParams:[{name:"targetLayers",isArray:!0,geomTypes:["*"]},{name:"joinLayers",isArray:!0,geomTypes:["*"]}],icon:"images/JoinFeatures32.png"},{id:p++,dijitID:"esri/dijit/analysis/MergeLayers",name:"MergeLayers",title:"mergeLayers",imgDisplay:"images/merge-layers.png",usage:"mergeLayersUsage",
analysisLayer:{name:"inputLayer",geomTypes:["*"]},requiredParam:{name:"mergeLayers",isArray:!0,geomTypes:["*"]},icon:"images/MergeLayers32.png"},{id:p++,dijitID:"esri/dijit/analysis/OverlayLayers",name:"OverlayLayers",title:"overlayLayers",imgDisplay:"images/overlay-layers.png",usage:"overlayLayersUsage",analysisLayer:{name:"inputLayer",geomTypes:["*"]},requiredParam:{name:"overlayLayer",isArray:!0,geomTypes:["*"]},optionalParams:[{name:"overlayLayers",isArray:!0,geomTypes:["*"]}],icon:"images/OverlayLayers32.png"},
{id:p++,dijitID:"esri/dijit/analysis/PlanRoutes",name:"PlanRoutes",title:"planRoutes",imgDisplay:"images/plan-routes.png",usage:"planRoutesUsage",analysisLayer:{name:"stopsLayer",geomTypes:["esriGeometryPoint"]},optionalParams:[{name:"featureLayers",isArray:!0,geomTypes:["esriGeometryPoint"]},{name:"stopsLayers",isArray:!0,geomTypes:["esriGeometryPoint"]},{name:"pointBarriers",isArray:!0,geomTypes:["esriGeometryPoint"]},{name:"lineBarriers",isArray:!0,geomTypes:["esriGeometryPolyline"]},{name:"polygonBarriers",
isArray:!0,geomTypes:["esriGeometryPolygon"]}],icon:"images/PlanRoutes32.png",cannotCancel:!0,privileges:["planroutes"]},{id:p++,dijitID:"esri/dijit/analysis/SummarizeCenterAndDispersion",name:"SummarizeCenterAndDispersion",title:"summarizeCenterAndDispersion",imgDisplay:"images/summarize-center-dispersion.png",usage:"summarizeCenterAndDispersionUsage",analysisLayer:{name:"analysisLayer",geomTypes:["esriGeometryPoint"]},optionalParams:[{name:"inputLayers",isArray:!0,geomTypes:["*"]}],icon:"images/SummarizeCenterAndDispersion32.png"},
{id:p++,dijitID:"esri/dijit/analysis/SummarizeNearby",name:"SummarizeNearby",title:"summarizeNearby",imgDisplay:"images/summarize-nearby.png",usage:"summarizeNearbyUsage",analysisLayer:{name:"sumNearbyLayer",geomTypes:["*"]},requiredParam:{name:"summaryLayers",isArray:!0,geomTypes:["*"]},icon:"images/SummarizeNearby32.png"},{id:p++,dijitID:"esri/dijit/analysis/SummarizeWithin",name:"SummarizeWithin",title:"summarizeWithin",imgDisplay:"images/summarize-within.png",usage:"summarizeWithinUsage",analysisLayer:{name:"sumWithinLayer",
geomTypes:["esriGeometryPolygon"]},requiredParam:{name:"summaryLayers",isArray:!0,geomTypes:["*"]},icon:"images/SummarizeWithin32.png"},{id:p++,dijitID:"esri/dijit/analysis/TraceDownstream",name:"TraceDownstream",title:"traceDownstream",imgDisplay:"images/trace-downstream.png",usage:"traceDownstreamUsage",analysisLayer:{name:"inputLayer",geomTypes:["esriGeometryPoint"]},optionalParams:[{name:"boundingPolygonLayers",isArray:!0,geomTypes:["esriGeometryPolygon"]}],icon:"images/TraceDownstream32.png",
privileges:["hydro"]}];q.findToolSetting=function(g){var c=null;d.some(t,function(a){if(a.name===g)return c=a,!0});return c};q.getAllSettings=function(g){var c=L.clone(t);return d.filter(c,function(a){return!0!==a.portalOnly||!0===g})};return q})},"widgets/Analysis/helpLink":function(){define(["dojo/_base/declare","dijit/_WidgetBase","dijit/_TemplatedMixin","dojo/dom-attr"],function(L,d,q,p){return L([d,q],{baseClass:"jimu-widget-analysis-helpLink",templateString:'\x3ca href\x3d"#" tabindex\x3d"-1"\x3e\x3cimg esriHelpTopic\x3d"toolDescription" data-dojo-attach-point\x3d"helpIcon"/\x3e\x3c/a\x3e',
postCreate:function(){this.inherited(arguments);p.set(this.helpIcon,"class",this.iconClassName);p.set(this.helpIcon,"src",this.folderUrl+"images/helpIcon.png");p.set(this.helpIcon,"title",this.toolLabel)}})})},"widgets/Analysis/_build-generate_module":function(){define(["dojo/text!./Widget.html","dojo/text!./css/style.css","dojo/i18n!./nls/strings"],function(){})},"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:widgets/Analysis/Widget.html":'\x3cdiv\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"widgetContent" class\x3d"analysis-widget-content"\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"toolListPanel" class\x3d"tool-list"\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"toolsSection" class\x3d"toolsSection" tabindex\x3d"0" data-a11y-label-by\x3d"analysis-tool-section-tip"\x3e\r\n        \x3cdiv class\x3d"execute-tip" data-a11y-label-id\x3d"analysis-tool-section-tip"\x3e\r\n          ${nls.executeAnalysisTip}\r\n        \x3c/div\x3e\r\n        \x3cdiv class\x3d"tools-table-container"\x3e\r\n          \x3cdiv data-dojo-attach-point\x3d"toolsTbody" class\x3d"tools-table"\x3e\r\n          \x3c/div\x3e\r\n        \x3c/div\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"noQueryTipSection" class\x3d"jimu-widget"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n\r\n    \x3cdiv data-dojo-attach-point\x3d"toolPanel" class\x3d"tool-panel" tabindex\x3d"0"\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"toolCtr" style\x3d"width:100%;height:90%"\x3e\x3c/div\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"toolLoadErrorNode" class\x3d"analysis-error-tip" style\x3d"display:none"\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n\r\n    \x3cdiv data-dojo-attach-point\x3d"messagePanel" class\x3d"message-panel" tabindex\x3d"0" data-a11y-label-by\x3d"analysis-msg-panel-title analysis-msg-panel-status analysis-msg-panel-outputtip"\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"inputHeader" class\x3d"input-header esriAnalysis"\x3e\r\n        \x3cimg data-dojo-attach-point\x3d"smallIcon" class\x3d"small-icon"/\x3e\r\n        \x3cspan data-dojo-attach-point\x3d"toolTitle" class\x3d"tool-title" data-a11y-label-id\x3d"analysis-msg-panel-title"\x3e\x3c/span\x3e\r\n      \x3c/div\x3e\r\n      \x3chr\x3e\r\n      \x3cdiv class\x3d"message-title"\x3e${nls.messages}\x3c/div\x3e\r\n      \x3cdiv class\x3d"message-status screen-readers-only" data-dojo-attach-point\x3d"messageStatusNode" data-a11y-label-id\x3d"analysis-msg-panel-status"\x3e\x3c/div\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"messageSection" class\x3d\'message-section\'\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"resultSection" style\x3d"display:none" \x3e\r\n        \x3cdiv class\x3d"message-title outputs"\x3e${nls.outputs}\x3c/div\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"outputSection" class\x3d\'result-section\'\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv class\x3d"job-message outputtip" data-dojo-attach-point\x3d"outputtip" data-a11y-label-id\x3d"analysis-msg-panel-outputtip"\x3e${nls.outputtip}\x3c/div\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"resultLoading" class\x3d"result-loading" style\x3d"display:none"\x3e\x3c/div\x3e\r\n      \x3cdiv data-dojo-attach-point\x3d"buttonSection" style\x3d"display:none" class\x3d"buttonNode"\x3e\r\n        \x3cdiv role\x3d"button" class\x3d"jimu-btn" data-dojo-attach-point\x3d"backBtn" tabindex\x3d"0"\r\n            data-dojo-attach-event\x3d"onclick: _switchToPrevious,onkeydown: a11y_switchToPrevious"\x3e${nls.back}\x3c/div\x3e\r\n        \x3cdiv role\x3d"button" class\x3d"jimu-btn" data-dojo-attach-point\x3d"homeBtn" tabindex\x3d"0"\r\n            data-dojo-attach-event\x3d"onclick: _switchToHome,onkeydown: a11y_switchToHome"\x3e${nls.home}\x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\r\n  \x3cdiv data-dojo-attach-point\x3d"shelter" data-dojo-type\x3d"jimu/dijit/LoadingIndicator" data-dojo-props\x3d\'hidden:true\'\x3e\x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:widgets/Analysis/css/style.css":".esriAnalysis .dijitComboBox{height: 30px !important;}.jimu-widget-analysis{position: relative; margin: -14px auto; width: 100%; height: 100%; min-width: 300px; min-height: 237px; overflow-x: hidden; -ms-overflow-x: hidden; overflow-y: auto; -ms-overflow-y: auto;}.jimu-nav-mode .jimu-widget-analysis .toolsSection:focus,.jimu-nav-mode .jimu-widget-analysis .toolsSection .tools-table-item:focus,.jimu-nav-mode .jimu-widget-analysis .tool-panel:focus,.jimu-nav-mode .jimu-widget-analysis .message-panel:focus {outline-offset: -2px !important;}.jimu-widget-analysis .toolsSection{margin-top: 7px;}.jimu-widget-analysis .execute-tip{font-size: 14px; color: #66699c; font-weight: bold;}.jimu-widget-analysis .tools-table-container{width: 100%;}.jimu-widget-analysis .tools-table{margin: 0 auto; padding-top: 10px; width: 100%; border-collapse: collapse;}.jimu-widget-analysis .tool-name{font-size: 14px; color: #686868;}.jimu-widget-analysis .tools-table-item{padding: 10px; height:107px; display: flex; flex-direction: row; justify-content: space-between; cursor: pointer;}.jimu-widget-analysis .tools-table-item.even{background-color: #ffffff;}.jimu-widget-analysis .tools-table-item.odd{background-color: #f0f0f0;}.jimu-widget-analysis .tools-table-item.disabled{background-color: #979797; cursor: default; border-bottom: 1px solid #ffffff;}.jimu-widget-analysis .tools-table-item .icon-section {display: flex; flex-direction: column; justify-content: space-between; max-width: 80%;}.jimu-widget-analysis .tools-table-item .icon-div .tool-icon{height: 60px; width: auto;}.jimu-widget-analysis .tools-table-item .tooltip-section{margin: 10px; display: flex; flex-direction: column; justify-content: center;}.jimu-widget-analysis .tooltip-icon{width: 16px; height: 16px; cursor: pointer;}.jimu-widget-analysis .tools-table-item:hover{background: #d9dde0;}.jimu-widget-analysis .tools-table-item.disabled:hover{background-color: #979797;}.jimu-widget-analysis .tool-params{width: 100%; height: 100%;}.jimu-widget-analysis .input-header{position: relative; width: 100%;}.jimu-widget-analysis .input-header .small-icon{margin-left: 15px;}.jimu-rtl .jimu-widget-analysis .input-header .small-icon{margin-left: auto; margin-right: 15px;}.jimu-widget-analysis .input-header .tool-title{margin-left: 15px; margin-bottom: 15px; font-size: 16px;}.jimu-rtl .jimu-widget-analysis .input-header .tool-title{margin-left: auto; margin-right: 15px;}.jimu-widget-analysis .input-header .help-icon{margin-top: 15px; cursor: pointer;}.jimu-widget-analysis .input-tip{width: 100%; height: auto; margin-top: 20px; font-size: 14px;}.jimu-widget-analysis .layerNode{position: relative; width:100%; margin: 0 auto; margin-top: 10px;}.jimu-widget-analysis .layerNode .param-name{margin-top: 15px; margin-bottom: 10px;}.jimu-widget-analysis .layer-name {height: 30px; line-height: 30px; width: 100%; border: solid 1px rgba(0,0,0,0.1); cursor: pointer;}.jimu-widget-analysis .tool-params .buttonNode{width: 100%; height: auto; margin-top: 20px; text-align: center;}.jimu-widget-analysis .switch-button{margin-left: 20px;}.jimu-rtl .jimu-widget-analysis .switch-button{margin-left: auto; margin-right: 20px;}.jimu-widget-analysis .tool-panel{width: 100%; height: auto; position: relative; top: -5px;}.jimu-widget-analysis .tool-panel .esriAnalysisCloseIcon{display:none !important;}.jimu-widget-analysis .jimu-btn{margin-left: 10px; margin-right: 10px;}.jimu-widget-analysis .toolpanel-button{text-align: center;}.jimu-widget-analysis .analysis-error-tip{width: 100%; min-height: 150px; margin-top: 30px; margin-left: 15px; margin-right: 15px; color:#ff0000; font-size: 14px;}.jimu-widget-analysis .message-panel{width: 100%; position: relative; top: 14px;}.jimu-widget-analysis .message-panel .message-title{margin-top: 20px; font-size: 14px; color: #66696c; font-weight: bold;}.jimu-widget-analysis .message-panel .message-title.outputs{margin-top: 30px;}.jimu-widget-analysis .message-panel .job-message{margin-top: 10px; font-size: 12px; color: #686868;}.jimu-widget-analysis .message-panel .job-message.outputtip{margin-top: 30px;}.jimu-widget-analysis .message-panel .job-message.success{color: #00B050;}.jimu-widget-analysis .message-panel .job-message.failed{color:#E84B4B;}.jimu-widget-analysis .message-panel .job-message.cancelled{color: #51B1FE;}.jimu-widget-analysis .message-panel .job-running-icon{width: 16px; height: 16px; margin-left: 10px;}.jimu-rtl .jimu-widget-analysis .message-panel .job-running-icon{margin-left: auto; margin-right: 10px;}.jimu-widget-analysis .message-panel .job-cancel-icon{width: 16px; height: 16px; cursor: pointer; margin-left: 10px;}.jimu-rtl .jimu-widget-analysis .message-panel .job-cancel-icon{margin-left: auto; margin-right: 10px;}.jimu-widget-analysis .message-panel .output-item{margin-top: 10px; color: #51B1FE; font-size: 12px; display: inline-block;}.jimu-widget-analysis .message-panel .output-item\x3ea{color: #51B1FE;}.jimu-widget-analysis .message-panel .button-section{width: 100%; margin-top: 20px;}.jimu-widget-analysis .message-panel .buttonNode{width: 100%; height: auto; margin-top: 20px; text-align: center;}.jimu-widget-analysis .result-section{width: 100%; margin-top: 15px; margin-bottom: 15px; font-size: 14px; color: #66699c;}.jimu-widget-analysis .result-loading{width: 100%; height: 40px; margin-top: 15px; margin-bottom: 15px; background-image: url(images/loading.gif); background-repeat: no-repeat; background-position: center;}.jimu-widget-analysis .hidden{display: none;}.jimu-widget-analysis .esriAnalysis .esriAnalysisSubmitButton{margin: 0 !important;}.jimu-rtl .jimu-widget-analysis .esriAnalysis .esriAnalysisSubmitButton{margin-right: 0; margin-left: auto;}.jimu-widget-analysis .esriAnalysis .dijitButton.calcite {display: inline-block !important;}.jimu-widget-analysis .esriAnalysis .esriAnalysisSubmitButton.dijitButton\x3espan.dijitButtonNode,.jimu-widget-analysis .esriAnalysis .dijitButton.calcite \x3e span.dijitButtonNode{cursor:pointer; min-width: 70px; display:inline-block; padding: 0 15px; font-size: 14px; text-align: center; background:#485566; vertical-align:middle; color:#ffffff; -webkit-border-radius:5px; -moz-border-radius:5px; -o-border-radius:5px; -ms-border-radius:5px; border-radius: 5px; border: 1px solid transparent; box-shadow: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}.jimu-widget-analysis .esriAnalysis .esriAnalysisSubmitButton.dijitButton\x3espan.dijitButtonNode .dijitButtonText,.jimu-widget-analysis .esriAnalysis .dijitButton.calcite \x3e span.dijitButtonNode .dijitButtonText {line-height: 32px;}.jimu-widget-analysis .esriAnalysis .esriAnalysisSubmitButton.dijitButtonHover\x3espan.dijitButtonNode,.jimu-widget-analysis .esriAnalysis .dijitButton.calcite.dijitButtonHover\x3espan.dijitButtonNode{background-color: #596d87; color: #ffffff;}.dijitDialog .esriAnalysis{overflow: hidden;}.dijitDialog .esriAnalysis .esriAnalysisSubmitButton{margin-left: 10px;}.jimu-rtl .dijitDialog .esriAnalysis .esriAnalysisSubmitButton{margin-left: auto; margin-right: 10px;}.dijitDialog .esriAnalysis .esriAnalysisCloseIcon{display: none !important;}.itemsGallery .galleryNode .galleryLabelContainer {height: 2.7em; text-align: left; line-height: 15px;}.jimu-widget-analysis .export-node {width: 16px; height: 16px; background-image: url(images/download.png); cursor: pointer; margin: 10px 10px 0 10px; display: inline-block;}.jimu-widget-analysis .export-node:hover {background-image: url(images/download_hover.png);}.esriAnalysis .dijitReset.dijitRight.dijitButtonNode.dijitArrowButton.dijitDownArrowButton.dijitArrowButtonContainer{width: 18px !important;}.esriAnalysis .esriAnalysisExpressionGrid .dijitButtonNode {height: auto;}.calcite.esriAnalysisEnrichDataBrowser {height: 480px; width: 720px;}",
"*now":function(L){L(['dojo/i18n!*preload*widgets/Analysis/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/_base/lang dojo/_base/html dojo/_base/array dojo/dom-style dojo/dom-attr dojo/dom-class dojo/dom-geometry dojo/Deferred dojo/on dijit/a11yclick ./a11y/Widget dojo/Evented dojo/query dojo/promise/all dojo/dom-construct dojo/i18n!esri/nls/jsapi dojo/json dijit/_WidgetsInTemplateMixin esri/request esri/tasks/JobInfo esri/tasks/FeatureSet esri/tasks/query esri/tasks/QueryTask esri/layers/FeatureLayer esri/dijit/PopupTemplate esri/dijit/analysis/utils esri/geometry/Extent jimu/BaseWidget jimu/dijit/ViewStack jimu/dijit/Message jimu/dijit/FeatureActionPopupMenu jimu/utils jimu/portalUtils jimu/portalUrlUtils jimu/LayerInfos/LayerInfos ./layerUtil ./toolValidate ./PrivilegeUtil ./toolSettings ./helpLink dojo/i18n!./setting/nls/strings dijit/form/Button jimu/dijit/LoadingIndicator".split(" "),function(L,
d,q,p,t,g,c,a,b,h,k,l,e,n,m,v,z,y,D,B,H,G,J,I,C,f,r,w,u,E,K,Q,V,W,Y,ja,ba,fa,ua,xa,va,P){L=L([u,D,e],{baseClass:"jimu-widget-analysis esriAnalysis",_hasContent:null,privilegeUtil:null,currentStack:0,toolCountInList:0,analysisMode:"default",postMixInProperties:function(){this.inherited(arguments);this.isRenderIdForAttrs=!0;d.mixin(this.nls,z.analysisTools);d.mixin(this.nls,window.jimuNls.common);this.nls.toolNotAvailable=P.toolNotAvailable},postCreate:function(){this.inherited(arguments);this.popupMenu=
Q.getInstance();this.privilegeUtil=ua.getInstance();this.viewStack=new E({viewType:"dom",views:[this.toolListPanel,this.toolPanel,this.messagePanel]});q.place(this.viewStack.domNode,this.widgetContent);this._switchView(0);this.a11y_addMessagePanelEvent()},_closeHelpDialog:function(){r._helpDialog&&"function"===typeof r._helpDialog.close&&r._helpDialog.close()},onClose:function(){this._closeHelpDialog();this._deactiveDrawTool();this._setDrawingLayersVisibility(!1);this._unbindAnalysisEvent()},onOpen:function(){this._setDrawingLayersVisibility(!0);
1===this.currentStack&&this._refreshAnalysisTool()},onDeActive:function(){this._deactiveDrawTool()},_refreshAnalysisTool:function(){this.shelter.show();ba.getLayerObjects().then(d.hitch(this,function(N){fa.isValid(N,this.currentToolSetting,this.privilegeUtil);this.shelter.hide();this._setIconAndLink(this.currentToolSetting);this._switchToAnalysisTool()}))},_checkValidation:function(){v.empty(this.toolsTbody);if(0===this.config.analysisTools.length){var N=new b;N.resolve();return N}this.shelter.show();
return this.privilegeUtil.loadPrivileges(this._getPortalUrl()).then(d.hitch(this,function(A){if(A&&this.privilegeUtil.canPerformAnalysis())return t.set(this.toolsSection,"display","block"),t.set(this.noQueryTipSection,"display","none"),this.a11y_initFirstFocusNode(),this._initToolList().then(d.hitch(this,function(){this.shelter.hide()}));this._noPrivilegeHandler(this.nls.privilegeError)}),d.hitch(this,function(){this._noPrivilegeHandler(this.nls.privilegeError);this.shelter.hide()}))},_clearContent:function(){v.empty(this.toolsTbody);
this.currentAnalysisDijit&&("function"===typeof this.currentAnalysisDijit.clear&&this.currentAnalysisDijit.clear(),this.currentAnalysisDijit=null,v.empty(this.toolCtr));this.currentToolSetting=null},_noPrivilegeHandler:function(N){this.shelter.hide();t.set(this.toolsSection,"display","none");g.set(this.noQueryTipSection,"innerHTML",V.stripHTML(N));t.set(this.noQueryTipSection,"display","block")},_initToolList:function(){t.set(this.homeBtn,"display","");this.toolCountInList=0;var N=null;return ba.getLayerObjects().then(d.hitch(this,
function(A){p.forEach(this.config.analysisTools,d.hitch(this,function(M,O){M=xa.findToolSetting(M.name);if(null!==M&&(M=d.mixin(M,this.config.analysisTools[O]),M.toolLabel||(M.toolLabel=this.nls[M.title]),this.privilegeUtil.hasPrivileges(M.privileges))){var U=fa.isValid(A,M,this.privilegeUtil);this._addTool(M,O,U);this.toolCountInList+=1;N=M}}));this.a11y_initLastFocusNode();1===this.toolCountInList&&(t.set(this.homeBtn,"display","none"),this.currentToolSetting=N)}),d.hitch(this,function(){console.error("layerUtil: getLayerObjects error")}))},
destroy:function(){this._clearContent();this.inherited(arguments)},_addTool:function(N,A,M){var O=v.create("div",{"class":"tools-table-item","data-toolname":N.name},this.toolsTbody);0===A%2?c.add(O,"even"):c.add(O,"odd");O.rowData=N;var U=v.create("div",{"class":"icon-section"},O);A=V.stripHTML(N.toolLabel);A=v.create("div",{"class":"tool-name jimu-ellipsis",title:A,innerHTML:V.stripHTML(A)},U);U=v.create("div",{"class":"icon-div"},U);v.create("img",{src:this.folderUrl+N.imgDisplay,"class":"tool-icon"},
U);U=v.create("div",{"class":"tooltip-section esriAnalysis"},O);if(N.showHelp){var X=N.dijitID.lastIndexOf("/");X=N.dijitID.substring(X+1);"geocodelocationsfromtable"===X.toLowerCase()&&(X="GeocodeLocationsfromTable");var ia=!Y.isOnline(this._getPortalUrl());X=new va({helpFileName:X,isSingleTenant:ia,iconClassName:"tooltip-icon",toolLabel:N.toolLabel,folderUrl:this.folderUrl,portalSelf:this.privilegeUtil.portalSelf});X.placeAt(U);try{r.initHelpLinks(X.domNode,!0)}catch(ca){console.log(ca)}}!0===M?
(g.set(O,"title",""),this.own(h(O,k,d.hitch(this,function(){this._setIconAndLink(N);this.currentToolSetting=N;this._switchToAnalysisTool()})))):(g.set(O,"title",this.nls.toolNotAvailable),c.remove(O,"even"),c.remove(O,"odd"),c.add(O,"disabled"));this.a11y_addTool(O,A,M)},_setIconAndLink:function(N){g.set(this.smallIcon,"src",this.folderUrl+N.icon);g.set(this.toolTitle,"innerHTML",V.stripHTML(N.toolLabel));var A=N.dijitID.lastIndexOf("/");A=N.dijitID.substring(A+1);this.helpLink&&(this.helpLink.destroy(),
this.helpLink=null);if(N.showHelp){var M=!Y.isOnline(this._getPortalUrl());"geocodelocationsfromtable"===A.toLowerCase()&&(A="GeocodeLocationsfromTable");this.helpLink=new va({helpFileName:A,isSingleTenant:M,iconClassName:"help-icon jimu-float-trailing",toolLabel:N.toolLabel,folderUrl:this.folderUrl,portalSelf:this.privilegeUtil.portalSelf});this.helpLink.placeAt(this.inputHeader);try{r.initHelpLinks(this.helpLink.domNode,!0)}catch(O){console.log(O)}}},_switchToAnalysisTool:function(){t.set(this.toolLoadErrorNode,
"display","none");this.shelter.show();require([this.currentToolSetting.dijitID],d.hitch(this,function(N){this.currentAnalysisDijit&&("function"===typeof this.currentAnalysisDijit.clear&&this.currentAnalysisDijit.clear(),this.currentAnalysisDijit=null,v.empty(this.toolCtr));var A=!Y.isOnline(this._getPortalUrl()),M={map:this.map,showSelectFolder:!0,helperServices:this.privilegeUtil.portalSelf.helperServices,portalUrl:this._getPortalUrl(this.privilegeUtil.getUserPortal()),portalSelf:this.privilegeUtil.portalSelf,
showCredits:this.currentToolSetting.showCredits,showHelp:this.currentToolSetting.showHelp,showChooseExtent:this.currentToolSetting.showChooseExtent,returnFeatureCollection:this.currentToolSetting.returnFeatureCollection,showReadyToUseLayers:this.privilegeUtil.livingAtlasConfigEnabled()&&this.currentToolSetting.showReadyToUseLayers,isSingleTenant:A,disableRunAnalysis:!0===this.currentToolSetting.disableRunAnalysis,analysisMode:this.analysisMode,showGeoAnalyticsParams:"bigdata"===this.analysisMode&&
this.privilegeUtil.canPerformGeoAnalytics(),showBrowseLayers:this.privilegeUtil.isPortal()&&"raster"!==this.analysisMode};this.privilegeUtil.portalSelf&&"enabled"===this.privilegeUtil.portalSelf.creditAssignments&&(M.checkCreditLimits=!0);if("findNearest"===this.currentToolSetting.title||"summarizeNearby"===this.currentToolSetting.title||"enrichLayer"===this.currentToolSetting.title)M.enableTravelModes=this.privilegeUtil.hasPrivileges(["networkanalysis"]);"joinFeatures"===this.currentToolSetting.title&&
(M.showTemporalJoin=M.showGeoAnalyticsParams,M.showJoinCondition=M.showGeoAnalyticsParams);if("findNearest"===this.currentToolSetting.title||"planRoutes"===this.currentToolSetting.title||"connectOriginsToDestinations"===this.currentToolSetting.title)M.showOutputType=!0===this.currentToolSetting.showOutputType;"findOutliers"===this.currentToolSetting.title&&(M.enableEnrichmentFields=this.privilegeUtil.canPerformGeoEnrichment(),M.allowChooseLabel=!1);A=ba.getLayerObjects();"geocodeLocations"===this.currentToolSetting.title&&
(this.privilegeUtil.portalSelf.helperServices.asyncGeocode&&(M.analysisGpServer=this.privilegeUtil.portalSelf.helperServices.asyncGeocode.url),M.checkCreditLimits=!1,M.showReadyToUseLayers=!1,M.showBrowseLayers=!0,M.showChooseExtent=!1,M.returnFeatureCollection=!1,A=ba.getTableLayerObjects());"returnFeatureCollection"in this.currentToolSetting&&(M.showSelectFolder=!this.currentToolSetting.returnFeatureCollection);A.then(d.hitch(this,function(O){M.showSelectAnalysisLayer=!0;"geocodeLocations"===this.currentToolSetting.title?
M.inputTables=O:this.currentToolSetting.analysisLayer&&(M[this.currentToolSetting.analysisLayer.name+"s"]=this._prepareLayers(O,this.currentToolSetting.analysisLayer.geomTypes),-1!==this.currentToolSetting.dijitID.indexOf("DeriveNewLocations")&&0<M[this.currentToolSetting.analysisLayer.name+"s"].length&&(M[this.currentToolSetting.analysisLayer.name]=M[this.currentToolSetting.analysisLayer.name+"s"][0]));O=this._prepareLayerParams(O);d.mixin(M,O);try{if(-1!==this.currentToolSetting.dijitID.indexOf("DeriveNewLocations")||
-1!==this.currentToolSetting.dijitID.indexOf("FindExistingLocations")||-1!==this.currentToolSetting.dijitID.indexOf("FindSimilarLocations"))M.primaryActionButttonClass="esriAnalysisSubmitButton";this.currentAnalysisDijit=new N(M,v.create("div",{style:{width:"100%"}},this.toolCtr));this.currentAnalysisDijit._setTitleAttr(this.currentToolSetting.toolLabel);this._bindAnalysisEvents(this.currentAnalysisDijit);this.currentAnalysisDijit.startup();this.currentDijitID=this.currentToolSetting.dijitID;var U=
n(".esriAnalysis .esriAnalysisSubmitButton",this.toolPanel)[0];if("undefined"!==typeof U){if(1<this.toolCountInList){c.add(U,"multiTool");var X=v.create("div",{"class":"toolpanel-button"});var ia=v.create("div",{"class":"jimu-btn",innerHTML:this.nls.back},X);v.place(X,U,"before");v.place(U,X);this.currentAnalysisDijit.own(h(ia,k,d.hitch(this,this._switchToPrevious)));this.a11y_analysisTool_backBtn(ia,U)}this.a11y_analysisTool_submitBtn(ia,U);this.a11y_analysisTool_toolPanel(ia,U)}}catch(ca){console.error(ca.message||
ca),g.set(this.toolLoadErrorNode,"innerHTML",V.stripHTML(ca.message||ca)),t.set(this.toolLoadErrorNode,"display","")}this._switchView(1);this.shelter.hide()}))}),d.hitch(this,function(N){this._switchView(1);g.set(this.toolLoadErrorNode,"innerHTML",V.stripHTML(N));t.set(this.toolLoadErrorNode,"display","");this.shelter.hide()}))},_prepareLayerParams:function(N){var A={};if("optionalParams"in this.currentToolSetting||"requiredParam"in this.currentToolSetting){if("requiredParam"in this.currentToolSetting){var M=
this._prepareLayers(N,this.currentToolSetting.requiredParam.geomTypes);A[this.currentToolSetting.requiredParam.name]=this.currentToolSetting.requiredParam.isArray?M:0<M.length?M[0]:null}"optionalParams"in this.currentToolSetting&&p.forEach(this.currentToolSetting.optionalParams,function(O){M=this._prepareLayers(N,O.geomTypes);A[O.name]=O.isArray?M:0<M.length?M[0]:null},this)}return A},_prepareLayers:function(N,A){var M,O=["point","polyline","polygon"],U=[];"*"!==A[0]&&(O=p.map(A,function(X){return V.getTypeByGeometryType(X)}));
p.forEach(N,function(X){"esri.layers.FeatureLayer"===X.declaredClass&&(M=V.getTypeByGeometryType(X.geometryType),0<=O.indexOf(M)&&(X.url||0<X.graphics.length)&&U.push(X))},this);return U},_deactivateGenerator:function(N){var A=this.currentAnalysisDijit;return function(){p.forEach(N,function(M){A[M]&&A[M].set("checked",!1)})}},_deactiveDrawTool:function(){if(this.currentAnalysisDijit){var N={calculateDensity:this._deactivateGenerator(["_bndgPolyDrawBtn"]),createViewshed:this._deactivateGenerator(["_analysisPointDrawBtn"]),
createWatershed:this._deactivateGenerator(["_analysisPointDrawBtn"]),extractData:d.hitch(this,function(){this.currentAnalysisDijit._drawExtentBtn&&this.currentAnalysisDijit._drawExtentBtn.set("checked",!1);this.currentAnalysisDijit._toolbar&&this.currentAnalysisDijit._toolbar.deactivate()}),findHotSpots:this._deactivateGenerator(["_boundingDrawBtn"]),findSimilarLocations:d.hitch(this,function(){this.currentAnalysisDijit._selectBtn&&this.currentAnalysisDijit._selectBtn.set("checked",!1);this.currentAnalysisDijit.selectionLayer&&
this.currentAnalysisDijit.selectionLayer.clearSelection()}),interpolatePoints:this._deactivateGenerator(["_bndgPolyDrawBtn","_predictPointDrawBtn"]),planRoutes:this._deactivateGenerator(["_startPointDrawBtn","_endPointDrawBtn"]),traceDownstream:this._deactivateGenerator(["_analysisPointDrawBtn","_bndgPolyDrawBtn"])};"function"===typeof N[this.currentToolSetting.title]&&(N[this.currentToolSetting.title].apply(this),this.map.setInfoWindowOnClick(!0))}},_setDrawingLayersVisibility:function(N){this.currentAnalysisDijit&&
"function"===typeof this.currentAnalysisDijit._getDrawLayerAttr&&p.forEach(this.currentAnalysisDijit._getDrawLayerAttr(),function(A){N?A.show():A.hide()})},_unbindAnalysisEvent:function(){this.startListener&&(this.startListener.remove(),this.startListener=null);this.submitListener&&(this.submitListener.remove(),this.submitListener=null);this.cancelListener&&(this.cancelListener.remove(),this.cancelListener=null);this.failedListener&&(this.failedListener.remove(),this.failedListener=null);this.succeedListener&&
(this.succeedListener.remove(),this.succeedListener=null);this.statusListener&&(this.statusListener.remove(),this.statusListener=null);this.resultListener&&(this.resultListener.remove(),this.resultListener=null);this.activeDrawListener&&(this.activeDrawListener.remove(),this.activeDrawListener=null);this.deactiveDrawListener&&(this.deactiveDrawListener.remove(),this.deactiveDrawListener=null)},_bindAnalysisEvents:function(N){this._unbindAnalysisEvent();this.startListener=h(N,"start",d.hitch(this,
this._onJobStart));this.submitListener=h(N,"job-submit",d.hitch(this,this._onJobSubmitted));this.cancelListener=h(N,"job-cancel",d.hitch(this,this._onJobCancelled));this.failedListener=h(N,"job-fail",d.hitch(this,this._onJobFailed));this.succeedListener=h(N,"job-success",d.hitch(this,this._onJobSucceed));this.statusListener=h(N,"job-status",d.hitch(this,this._onJobStatusChange));this.resultListener=h(N,"job-result",d.hitch(this,this._onJobResultData));this.activeDrawListener=h(N,"drawtool-activate",
d.hitch(this,function(){this.map.setInfoWindowOnClick(!1)}));this.deactiveDrawListener=h(N,"drawtool-deactivate",d.hitch(this,function(){this.map.setInfoWindowOnClick(!0)}))},_onJobStart:function(){this._clearMessageLogs();this.shelter.show();this._switchView(2);this.emit("start")},_onJobSubmitted:function(N){this.shelter.hide();this.outputProperties=null;N.OutputName&&(this.outputProperties=y.parse(N.OutputName,!0));this._appendMessage(this.nls[this.currentToolSetting.title]+" "+this.nls.jobSubmitted);
var A=v.create("div",{"class":"job-message waiting"},this.messageSection);v.create("img",{"class":"job-executing",src:this.folderUrl+"images/loading.gif"},A);this.emit("job-submit",N)},_onJobCancelled:function(N){N.jobStatus?this._appendMessage(this.nls.jobCancelled+": "+N.jobStatus,"cancelled"):this._appendMessage(this.nls.jobCancelled,"cancelled");this._onJobDone();t.set(this.buttonSection,"display","");this.emit("job-cancel",N)},_onJobFailed:function(N){this.shelter.hide();"warning"===N.type?(this.currentAnalysisDijit.set("disableRunAnalysis",
!1),this._switchView(1),new K({message:N.message})):(2!==this.currentStack&&(this._clearMessageLogs(),this._switchView(2)),this._appendMessage(this.nls.jobFailed+": "+(N.analysisReport||N.message),"failed"),this._onJobDone(),t.set(this.buttonSection,"display",""));this.emit("job-fail",N)},_onJobSucceed:function(N){this._appendMessage(this.nls.jobSuccess,"success");this._onJobDone();t.set(this.resultLoading,"display","");this.emit("job-success",N)},_onJobDone:function(){n("img.job-executing",this.messagePanel).forEach(function(N){v.destroy(N)})},
_onJobStatusChange:function(N){this.shelter.hide();N.jobId&&N.jobId!==this.currentToolJobId&&(this.currentToolJobId=N.jobId);if(N.jobStatus===H.STATUS_EXECUTING)this._appendExecutingMessage();else{switch(N.jobStatus){case H.STATUS_FAILED:case H.STATUS_CANCELLED:case H.STATUS_DELETED:case H.STATUS_TIMED_OUT:this.shelter.hide();"string"===typeof N.message&&this._appendMessage(N.message,"failed");this._onJobDone();t.set(this.buttonSection,"display","");break;case H.STATUS_SUCCEEDED:"string"===typeof N.message&&
this._appendMessage(N.message,"success"),this._onJobDone(),t.set(this.buttonSection,"display",""),t.set(this.resultLoading,"display","")}this.messagePanel.focus()}this.currentJobStatus=N.jobStatus;this.a11y_updateTitleForMsgDom(N.jobStatus,H);this.emit("job-status",N)},_onJobResultData:function(N){t.set(this.resultSection,"display","");t.set(this.buttonSection,"display","");var A=this._appendResultMessage(N);if(0<=this.currentToolSetting.dijitID.indexOf("ExtractData"))g.set(this.outputtip,"innerHTML",
V.stripHTML(this.nls.outputSaveInPortal)),t.set(this.resultLoading,"display","none");else if(g.set(this.outputtip,"innerHTML",V.stripHTML(this.nls.outputtip)),N.value.itemId){var M=null;"layerInfo"in N.value&&(M=N.value.layerInfo.popupInfo);this._fetchResultByItemId(A,N.value.itemId,M).then(d.hitch(this,function(){t.set(this.resultLoading,"display","none")}))}else if("layerDefinition"in N.value){var O={title:A?A:"output",fieldInfos:[]};p.forEach(N.value.layerDefinition.fields,function(U){U.name!==
N.value.layerDefinition.objectIdField&&O.fieldInfos.push({fieldName:U.name,visible:!0,label:U.alias,isEditable:!1})});M=new f(O);M=new C(N.value,{infoTemplate:M});M.title=A?A:"output";M.name=A?A:"output";this.map.addLayer(M);this._createExportNode(new G(N.value.featureSet));t.set(this.resultLoading,"display","none")}this.emit("job-result",N)},_fetchResultByItemId:function(N,A,M){return W.getPortal(this._getPortalUrl(this.privilegeUtil.getUserPortal())).getItemById(A).then(d.hitch(this,function(O){var U=
O.url||O.itemUrl;return B({url:U,content:{f:"json"},handleAs:"json"}).then(d.hitch(this,function(X){var ia=[],ca,S=X.tables||[],ea=X.layers||[];S.reverse();ea.reverse();p.forEach(S,function(na){var ha=U+"/"+na.id;ca=ja.getInstance(this.map,this.map.itemInfo).then(d.hitch(this,function(ma){ma.addTable({url:ha,title:N+" - "+na.name,options:{outFields:["*"]}});ia.push(this._createExportNodeForUrl(na.name,ha,!1))}));ia.push(ca)},this);p.forEach(ea,function(na){var ha=U+"/"+na.id,ma=null;1===ea.length&&
(ma=M);ca=this._buildFeatureLayer(na.name,ha,ma,A).then(d.hitch(this,function(x){x.title=na.name;this.map.addLayer(x)}));ia.push(this._createExportNodeForUrl(na.name,ha,!0));ia.push(ca)},this);X.initialExtent&&this.map.setExtent(new w(X.initialExtent));return m(ia)}))}))},_buildFeatureLayer:function(N,A,M,O){if(null!==M){var U=new b;M.title=N;M=new C(A,{mode:C.MODE_SNAPSHOT,infoTemplate:new f(M),outFields:["*"]});M._wabProperties={itemLayerInfo:{portalUrl:this.appConfig.portalUrl,itemId:O}};U.resolve(M);
return U}return B({url:A,content:{f:"json"},handleAs:"json"}).then(d.hitch(this,function(X){var ia={title:N,fieldInfos:[]};p.forEach(X.fields,function(S){S.name!==X.objectIdField&&ia.fieldInfos.push({fieldName:S.name,visible:!0,label:S.alias,isEditable:!1})});var ca=new C(A,{mode:C.MODE_SNAPSHOT,infoTemplate:new f(ia),outFields:["*"]});ca._wabProperties={itemLayerInfo:{portalUrl:this.appConfig.portalUrl,itemId:O}};return ca}),d.hitch(this,function(){var X=new C(A);X._wabProperties={itemLayerInfo:{portalUrl:this.appConfig.portalUrl,
itemId:O}};return X}))},_clearMessageLogs:function(){v.empty(this.messageSection);v.empty(this.outputSection);t.set(this.resultSection,"display","none");t.set(this.buttonSection,"display","none");t.set(this.resultLoading,"display","none")},_appendMessage:function(N,A){N=V.stripHTML(N);v.create("div",{"class":"job-message "+(A?A:""),innerHTML:N},this.messageSection);this.messageStatusNode.innerHTML=N},_appendExecutingMessage:function(){n("div.waiting",this.messagePanel).forEach(function(M){v.destroy(M)});
if(0===n("div.job-executing",this.messagePanel).length){var N=v.create("div",{"class":"job-message job-executing"},this.messageSection);v.create("span",{innerHTML:V.stripHTML(this.nls.executing)},N);v.create("img",{"class":"job-executing",src:this.folderUrl+"images/loading.gif"},N);var A=!1;!0===this.currentToolSetting.cannotCancel?A=!0:0<=this.currentToolSetting.dijitID.indexOf("EnrichLayer")&&this.currentAnalysisDijit&&this.currentAnalysisDijit.enableTravelModes&&(A=!0);A||(N=v.create("img",{"class":"job-cancel-icon job-executing",
src:this.folderUrl+"images/cancel.png",title:this.nls.cancelJob},N),this.own(h(N,k,d.hitch(this,this._cancelTask))),this.a11y_addAttrsAndEventForCancelBtn(N))}},_getLayerNameSuffix:function(N,A){return N===A?1:/_\d+$/.test(N)&&0===N.indexOf(A)?(N=N.split("_"),Number(N[N.length-1])+1):0},_appendResultMessage:function(N){if(N.outputLayerName||N.paramName){var A=N.outputLayerName||N.paramName,M=0,O=0,U;p.forEach(this.map.graphicsLayerIds,d.hitch(this,function(ca){U=this.map.getLayer(ca);O=this._getLayerNameSuffix(U.title,
A);M<O&&(M=O)}));p.forEach(this.map.layerIds,d.hitch(this,function(ca){ca=this.map.getLayer(ca);O=this._getLayerNameSuffix(ca.title,A);M<O&&(M=O)}));0<M&&(A=A+"_"+M);var X=v.create("div",{"class":"output-item"},this.outputSection);if(N.value&&N.value.itemId){var ia=Y.getItemDetailsPageUrl(this._getPortalUrl(this.privilegeUtil.getUserPortal()),N.value.itemId);"object"===typeof this.outputProperties&&N.value.itemId===this.outputProperties.itemProperties.itemId&&(A=this.outputProperties.serviceProperties.name);
N=v.create("a",{href:ia,target:"_blank",innerHTML:V.stripHTML(A)},X);this.a11y_addAttrsForOutputLink(N)}else g.set(X,"innerHTML",A);return A}return null},_createExportNodeForUrl:function(N,A,M){var O=new J;O.returnGeometry=M;O.outSpatialReference=this.map.spatialReference;O.outFields=["*"];O.where="1\x3d1";return(new I(A)).execute(O).then(d.hitch(this,function(U){var X=v.create("div",{},this.outputSection);v.create("div",{"class":"output-item",innerHTML:V.stripHTML(N)},X);this._createExportNode(U,
X)}),function(U){console.error(U.message?U.message:U)})},_createExportNode:function(N,A){A||(A=this.outputSection);A=v.create("div",{"class":"export-node"},A);this.a11y_addAttrsForExportNode(A);this.own(h(A,k,d.hitch(this,function(M){this._showActions(M,N)})))},_showActions:function(N,A){this.popupMenu.prepareActions(A,this.currentToolSetting.allowToExport).then(d.hitch(this,function(){var M=a.position(N.target);this.popupMenu._setFocusedNodeBeforeOpen();this.popupMenu.show(M)}))},_getPortalUrl:function(N){return N?
Y.getStandardPortalUrl(N):Y.getStandardPortalUrl(this.appConfig.portalUrl)},_cancelTask:function(){this.currentToolJobId&&this.currentAnalysisDijit&&this.currentAnalysisDijit.cancel({jobId:this.currentToolJobId})},_switchToPrevious:function(){this._deactiveDrawTool();2===this.currentStack?this._switchToAnalysisTool():this._switchView(0)},_switchToHome:function(){this._deactiveDrawTool();1<this.toolCountInList?this._switchView(0):this._switchToAnalysisTool()},_switchView:function(N){this._closeHelpDialog();
0===N?this._checkValidation().then(d.hitch(this,function(){0===this.toolCountInList?(this.currentStack=N,this.viewStack.switchView(N),this._noPrivilegeHandler(this.nls.noToolTip)):1===this.toolCountInList?(this._setIconAndLink(this.currentToolSetting),this._switchToAnalysisTool()):(this.currentStack=N,this.viewStack.switchView(N));this.a11y_switchView_toolList()})):(this.currentStack=N,this.viewStack.switchView(N),this.a11y_switchView_others(N,1))}});L.extend(l);return L});