// All material copyright ESRI, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.7/esri/copyright.txt for details. //>>built require({cache:{"esri/core/workers":function(){define(["require","exports","./workers/workers"],function(p,g,b){Object.defineProperty(g,"__esModule",{value:!0});for(var a in b)g.hasOwnProperty(a)||(g[a]=b[a])})},"esri/core/workers/workers":function(){define("require exports dojo/sniff dojo/promise/all ../Logger ../promiseUtils ./Connection ./RemoteClient ./WorkerOwner".split(" "),function(p,g,b,a,e,d,c,k,f){function l(){if(q)return q;for(var b=h+n,c=[],d=function(a){var b=f.create(a).then(function(b){return u[a]= b});c.push(b)},e=0;e=a[0]?b.portrait:b.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},m={xsmall:544,small:768,medium:992,large:1200};return function(c){function n(){var a=null!==c&&c.apply(this,arguments)||this;a._breakpointsHandles=new f;a.breakpoints=m;a.orientation=null;a.widthBreakpoint=null;a.heightBreakpoint=null;return a} b(n,c);n.prototype.initialize=function(){this._breakpointsHandles.add([l.init(this,["breakpoints","size"],this._updateClassNames)])};n.prototype.destroy=function(){this.destroyed||(this._removeActiveClassNames(),this._breakpointsHandles.destroy(),this._breakpointsHandles=null)};n.prototype._updateClassNames=function(){if(this.container){var a=k.acquire(),b=k.acquire(),c=!1,d,e,h;for(d in r)e=this[d],h=r[d].getValue({viewSize:this.size,breakpoints:this.breakpoints}),e!==h&&(c=!0,this[d]=h,b.push(r[d].valueToClassName[e]), a.push(r[d].valueToClassName[h]));c&&(this._applyClassNameChanges(a,b),k.release(a),k.release(b))}};n.prototype._applyClassNameChanges=function(a,b){var c=this.container;c&&(d.remove(c,b),d.add(c,a))};n.prototype._removeActiveClassNames=function(){var a=this.container;if(a)for(var b in r)d.remove(a,r[b].valueToClassName[this[b]])};a([h.property({set:function(a){var b=this._get("breakpoints");if(a!==b){b=(b=a)&&b.xsmall=document.body.clientWidth||b>=document.body.clientHeight)}), "dom-size");this._set("container",a);this._startMeasuring();a=new m({enabled:!0,view:this});this._set("popupManager",a)}else this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),this._set("container",null)}},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"focused",{get:function(){return document.activeElement===this.surface},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"size",{get:function(){return[this.width, this.height]},enumerable:!0,configurable:!0});f.prototype.blur=function(){this.surface&&this.surface.blur()};f.prototype.focus=function(){this.surface&&this.surface.focus()};f.prototype.pageToContainer=function(a,b,c){var d=this.position;a-=d[0];b-=d[1];c?(c[0]=a,c[1]=b):c=[a,b];return c};f.prototype.containerToPage=function(a,b,c){var d=this.position;a+=d[0];b+=d[1];c?(c[0]=a,c[1]=b):c=[a,b];return c};f.prototype._handleUIChange=function(a,b){b&&(this._domHandles.remove("ui"),b.destroy());a&&this._wireUI(a); this._set("ui",a)};f.prototype._wireUI=function(a){this._domHandles.remove("ui");a&&(a.view=this,this._domHandles.add([n.init(this,"root",function(b){a.container=b?d.create("div",null,b):null}),n.init(this,"popup",function(b,c){c&&(a.remove(c,"popup"),c!==b&&c.destroy());b&&(b.view=a.view,a.add(b,{key:"popup",position:"manual"}))})],"ui"))};f.prototype._focusEvent=function(a){this.notifyChange("focused");this.emit("focus",{native:a})};f.prototype._blurEvent=function(a){this.notifyChange("focused"); this.emit("blur",{native:a})};f.prototype._stopMeasuring=function(){this._domHandles.remove("measuring");this._get("resizing")&&this._set("resizing",!1)};f.prototype._startMeasuring=function(){var a=this,b=this._freqInfo;b.freq=16;b.time=750;this._domHandles.add([c(window,"resize",function(){b.freq=16;b.time=750}),h.addFrameTask({prepare:function(b){var c=a._measure(),d=a._freqInfo;d.time+=b.deltaTime;c&&(d.freq=16,a._get("resizing")||a._set("resizing",!0));d.timea.width-f.right||"left"===e&&d.x-c/2a.height-f.bottom?!0:!1};q.prototype._determineCurrentAlignment=function(){var a=this._pointerOffsetInPx,b=this._containerNode,c=this._mainContainerNode,e=this.viewModel,f=e.screenLocation,e=e.view;if(!f||!e||!b)return"top-center";if(!this._isScreenLocationWithinView(f,e))return this._get("currentAlignment")|| "top-center";var h=c?window.getComputedStyle(c,null):null,c=h?parseInt(h.getPropertyValue("max-height").replace(/[^-\d\.]/g,""),10):0,h=h?parseInt(h.getPropertyValue("height").replace(/[^-\d\.]/g,""),10):0,k=d.getContentBox(b),b=k.w+a,k=Math.max(k.h,c,h)+a,a=this._isOutsideView({popupHeight:k,popupWidth:b,screenLocation:f,side:"right",view:e}),c=this._isOutsideView({popupHeight:k,popupWidth:b,screenLocation:f,side:"left",view:e}),h=this._isOutsideView({popupHeight:k,popupWidth:b,screenLocation:f, side:"top",view:e}),f=this._isOutsideView({popupHeight:k,popupWidth:b,screenLocation:f,side:"bottom",view:e});return c?h?"bottom-right":"top-right":a?h?"bottom-left":"top-left":h?f?"top-center":"bottom-center":"top-center"};q.prototype._getCurrentAlignment=function(){var a=this.alignment;return this.dockEnabled?null:"auto"===a?this._determineCurrentAlignment():"function"===typeof a?a.call(this):a};q.prototype._setCurrentAlignment=function(){this._set("currentAlignment",this._getCurrentAlignment())}; q.prototype._setCurrentDockPosition=function(){this._set("currentDockPosition",this._getCurrentDockPosition())};q.prototype._getDockPosition=function(){var a=this.get("dockOptions.position");return"auto"===a?this._determineCurrentDockPosition():"function"===typeof a?a.call(this):a};q.prototype._getCurrentDockPosition=function(){return this.dockEnabled?this._getDockPosition():null};q.prototype._wouldDockTo=function(){return this.dockEnabled?null:this._getDockPosition()};q.prototype._renderFeatureMenuItemNode= function(a,b,d,e){var f=b===d;e=(h={},h["esri-popup__feature-menu-item--selected"]=f,h);h=f?v.tsx("span",{key:B("feature-menu-selected-feature-"+d),title:c.selectedFeature,"aria-label":c.selectedFeature,class:"esri-icon-check-mark"}):null;a=v.tsx("span",{innerHTML:a.title||c.untitled});return v.tsx("li",{role:"menuitem",tabIndex:-1,key:B("feature-menu-feature-"+d),classes:e,class:"esri-popup__feature-menu-item",bind:this,"data-feature-index":b,onkeyup:this._handleFeatureMenuItemKeyup,onclick:this._selectFeature, onkeydown:this._selectFeature},v.tsx("span",{class:"esri-popup__feature-menu-title"},a,h));var h};q.prototype._renderFeatureMenuNode=function(a,b,c,d){var e=this;return 1f||d>f&&e<=f||a<=c&&b>c||a>c&&b<=c};q.prototype._updateDockEnabledForViewSize=function(a,b){if(a&&b){var c=this.get("viewModel.view.padding")||{left:0,right:0,top:0,bottom:0},d=c.left+c.right,e=c.top+c.bottom,c=[],f=[];c[0]=a[0]-d;c[1]=a[1]-e;f[0]=b[0]-d;f[1]=b[1]-e;a=this.dockOptions;this._dockingThresholdCrossed(c,f,a.breakpoint)&&this._setDockEnabledForViewSize(a);this._setCurrentDockPosition()}};q.prototype._focusDockButtonNode=function(a){this._focusDockButton&& (this._focusDockButton=!1,a.focus())};q.prototype._mainContainerNodeUpdated=function(a){this._mainContainerNode=a;this._focusContainer?(this._focusContainer=!1,a.focus()):this._blurContainer&&(this._blurContainer=!1,a.blur())};q.prototype._featureMenuNodeUpdated=function(a){(this._featureMenuNode=a)&&this._focusFirstFeature&&(this._focusFirstFeature=!1,a=a.querySelectorAll("li"),a.length&&a[0].focus())};q.prototype._focusFeatureMenuButtonNode=function(a){this._focusFeatureMenuButton&&(this._focusFeatureMenuButton= !1,a.focus())};q.prototype._featureMenuViewportNodeUpdated=function(a){a&&(a.scrollTop=0)};q.prototype._toggleScreenLocationEnabled=function(){var a=this.dockEnabled,b=this.viewModel;b&&(b.screenLocationEnabled=this.visible&&!a)};q.prototype._shouldDockAtCurrentViewSize=function(a){a=a.breakpoint;var b=this.get("viewModel.view.ui"),c=b.width,b=b.height;if(isNaN(c)||isNaN(b))return!1;c=a.hasOwnProperty("width")&&c<=a.width;a=a.hasOwnProperty("height")&&b<=a.height;return c||a};q.prototype._setDockEnabledForViewSize= function(a){a.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(a))};q.prototype._getPageText=function(a,b){return l.substitute({index:b+1,total:a},c.pageText)};q.prototype._destroySpinner=function(){var a=this._spinner,b=this.view;a&&(b&&b.ui.remove(this._spinner,"popup-spinner"),a.destroy(),this._spinner=null)};q.prototype._createSpinner=function(a){a&&(this._spinner=new u({view:a}),a.ui.add(this._spinner,{key:"popup-spinner",position:"manual"}))};q.prototype._toggleCollapsed=function(){this.collapsed= !this.collapsed};q.prototype._close=function(){this.close();this.view&&this.view.focus()};q.prototype._toggleDockEnabled=function(){this.dockEnabled=!this.dockEnabled;this._focusDockButton=!0;this.scheduleRender()};q.prototype._toggleFeatureMenu=function(){var a=!this.featureMenuOpen;this._featureMenuOpenChanged(a);this.featureMenuOpen=a};q.prototype._triggerAction=function(a){this.viewModel.triggerAction(a.currentTarget["data-action-index"])};q.prototype._selectFeature=function(a){a=a.currentTarget["data-feature-index"]; isNaN(a)||(this.viewModel.selectedFeatureIndex=a)};q.prototype._next=function(){this.next()};q.prototype._previous=function(){this.previous()};a([r.aliasOf("viewModel.actions"),v.renderable()],q.prototype,"actions",void 0);a([r.property()],q.prototype,"alignment",void 0);a([r.aliasOf("viewModel.autoCloseEnabled")],q.prototype,"autoCloseEnabled",void 0);a([r.aliasOf("viewModel.content"),v.renderable()],q.prototype,"content",void 0);a([r.property(),v.renderable()],q.prototype,"collapsed",void 0);a([r.property(), v.renderable()],q.prototype,"collapseEnabled",void 0);a([r.property({readOnly:!0,dependsOn:["dockEnabled","alignment"]}),v.renderable()],q.prototype,"currentAlignment",null);a([r.property({readOnly:!0,dependsOn:["viewModel.view.ready","dockEnabled","dockOptions"]}),v.renderable()],q.prototype,"currentDockPosition",null);a([r.property(),v.renderable()],q.prototype,"dockOptions",null);a([r.property(),v.renderable()],q.prototype,"dockEnabled",void 0);a([r.aliasOf("viewModel.featureCount"),v.renderable()], q.prototype,"featureCount",void 0);a([r.property({dependsOn:["viewModel.visible"]}),v.renderable()],q.prototype,"featureMenuOpen",null);a([r.aliasOf("viewModel.features"),v.renderable()],q.prototype,"features",void 0);a([r.property(),v.renderable()],q.prototype,"featureNavigationEnabled",void 0);a([r.aliasOf("viewModel.highlightEnabled")],q.prototype,"highlightEnabled",void 0);a([r.aliasOf("viewModel.location"),v.renderable()],q.prototype,"location",void 0);a([r.property({readOnly:!0}),v.renderable()], q.prototype,"featureWidgets",void 0);a([r.aliasOf("viewModel.promises")],q.prototype,"promises",void 0);a([r.aliasOf("viewModel.selectedFeature"),v.renderable()],q.prototype,"selectedFeature",void 0);a([r.aliasOf("viewModel.selectedFeatureIndex"),v.renderable()],q.prototype,"selectedFeatureIndex",void 0);a([r.property({readOnly:!0}),v.renderable()],q.prototype,"selectedFeatureWidget",void 0);a([r.property()],q.prototype,"spinnerEnabled",void 0);a([r.aliasOf("viewModel.title"),v.renderable()],q.prototype, "title",void 0);a([r.aliasOf("viewModel.updateLocationEnabled")],q.prototype,"updateLocationEnabled",void 0);a([r.aliasOf("viewModel.view")],q.prototype,"view",void 0);a([r.property({type:t}),v.renderable("viewModel.screenLocation viewModel.screenLocationEnabled viewModel.state viewModel.pendingPromisesCount viewModel.promiseCount viewModel.waitingForResult".split(" ")),v.vmEvent(["triggerAction","trigger-action"])],q.prototype,"viewModel",void 0);a([r.aliasOf("viewModel.visible"),v.renderable()], q.prototype,"visible",void 0);a([r.aliasOf("viewModel.clear")],q.prototype,"clear",null);a([r.aliasOf("viewModel.next")],q.prototype,"next",null);a([r.aliasOf("viewModel.previous")],q.prototype,"previous",null);a([r.aliasOf("viewModel.triggerAction")],q.prototype,"triggerAction",null);a([v.accessibleHandler()],q.prototype,"_toggleCollapsed",null);a([v.accessibleHandler()],q.prototype,"_close",null);a([v.accessibleHandler()],q.prototype,"_toggleDockEnabled",null);a([v.accessibleHandler()],q.prototype, "_toggleFeatureMenu",null);a([v.accessibleHandler()],q.prototype,"_triggerAction",null);a([v.accessibleHandler()],q.prototype,"_selectFeature",null);a([v.accessibleHandler()],q.prototype,"_next",null);a([v.accessibleHandler()],q.prototype,"_previous",null);return q=a([r.subclass("esri.widgets.Popup")],q)}(r.declared(q))})},"esri/widgets/Feature":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/i18n!./Feature/nls/Feature dojo/keys ../core/promiseUtils ../core/watchUtils ../core/accessorSupport/decorators ./Widget ./Feature/FeatureViewModel ./Feature/support/attachmentUtils ./support/uriUtils ./support/widget".split(" "), function(p,g,b,a,e,d,c,k,f,l,h,n,r,m){function u(a,b){return void 0===b?"esri-feature__"+a:"esri-feature__"+a+"-"+b}return function(l){function q(a){a=l.call(this)||this;a._chartMap=new Map;a._activeMediaMap=new Map;a._chartRequirePromise=null;a._refreshTimers=new Map;a._mediaInfo=new Map;a.contentEnabled=null;a.graphic=null;a.title=null;a.view=null;a.viewModel=new h;return a}b(q,l);q.prototype.postInitialize=function(){var a=this;this.own(k.init(this,"viewModel.content",function(){return a._setupMediaRefreshTimers()}))}; q.prototype.destroy=function(){this._clearMediaRefreshTimers();this._activeMediaMap.clear();this._activeMediaMap=null;this._cancelChartModules();this._destroyCharts()};q.prototype.render=function(){var a=m.tsx("div",{key:u("loading-container"),class:"esri-feature__loading-container"},m.tsx("span",{class:m.join("esri-icon-loading-indicator esri-rotating","esri-feature__loading-spinner")})),a=this.viewModel.waitingForContent?a:this._renderContent();return m.tsx("div",{class:"esri-feature"},m.tsx("div", {class:"esri-feature__size-container"},m.tsx("div",{class:"esri-feature__main-container"},a)))};q.prototype.goToMedia=function(a,b){this._setContentElementMedia(a,b)};q.prototype.nextMedia=function(a){this._pageContentElementMedia(a,"next")};q.prototype.previousMedia=function(a){this._pageContentElementMedia(a,"previous")};q.prototype._cancelChartModules=function(){this._chartRequirePromise&&this._chartRequirePromise.cancel()};q.prototype._destroyChart=function(a){var b=this._chartMap.get(a);b&&(b.chart.destroy(), b.tooltip.destroy());this._chartMap.delete(a)};q.prototype._destroyCharts=function(){this._chartMap.forEach(function(a){a.chart.destroy();a.tooltip.destroy()});this._chartMap.clear()};q.prototype._renderContent=function(){this._destroyCharts();var a=this.viewModel.content;if("string"===typeof a)return m.tsx("div",{key:u("content-string"),innerHTML:a});if(m.isWidget(a))return m.tsx("div",{key:u("content-widget")},a.render());if(a instanceof HTMLElement)return m.tsx("div",{key:u("content-html-element"), bind:a,afterCreate:this._attachToNode});if(m.isWidgetBase(a))return m.tsx("div",{key:u("content-dijit"),bind:a.domNode,afterCreate:this._attachToNode});if(Array.isArray(a))return a.length?m.tsx("div",{key:u("content-content-elements")},a.map(this._renderContentElement,this)):null};q.prototype._renderContentElement=function(a,b){switch(a.type){case "attachments":return this._renderAttachments(a,b);case "fields":return this._renderFields(a,b);case "media":return this._renderMedia(a,b);case "text":return this._renderText(a, b);default:return null}};q.prototype._renderAttachmentInfo=function(a){var b=a.attachmentInfo,c=a.supportsResizeAttachments,d=b.contentType;a=b.name;var f=b.url,h=c&&n.isSupportedImage(d),k=-1===f.indexOf("?")?"?":"\x26",d=h?""+f+k+"w\x3d48":n.getIconPath(d),h=(l={},l["esri-feature__attachment-item-mask--icon"]=!h,l),l=(r={},r["esri-feature__attachments-image--resizable"]=c,r);return m.tsx("li",{class:"esri-feature__attachments-item",key:b},m.tsx("a",{class:"esri-feature__attachments-item-link",href:f, target:"_blank"},m.tsx("div",{classes:h,class:"esri-feature__attachment-item-mask"},m.tsx("img",{alt:a,classes:l,class:"esri-feature__attachments-image",title:a,src:d}),m.tsx("span",{class:"esri-feature__attachments-image-overlay"},m.tsx("span",{"aria-hidden":"true",class:"esri-feature__attachments-link-icon esri-icon-link-external"}))),m.tsx("span",{class:"esri-feature__attachments-filename"},a||e.noTitle)));var l,r};q.prototype._renderAttachments=function(a,b){var c=this,d=a.displayType,f=(b=a.attachmentInfos)&& b.length,h=this.get("graphic.layer.capabilities.operations.supportsResizeAttachments"),d=(k={},k["esri-feature__attachments--list"]="preview"!==d,k["esri-feature__attachments--preview"]="preview"===d,k);return f?m.tsx("div",{key:u("attachments-element"),class:m.join("esri-feature__attachments","esri-feature__content-element"),classes:d},m.tsx("div",{class:"esri-feature__attachments-title"},e.attach),m.tsx("ul",{class:"esri-feature__attachments-items"},b.map(function(b,d){return c._renderAttachmentInfo({attachmentInfo:b, attachmentInfoIndex:d,supportsResizeAttachments:h,contentElement:a})}))):null;var k};q.prototype._forceLTR=function(a){return"\x26lrm;"+a};q.prototype._renderFieldInfo=function(a,b){var c=this.viewModel.formattedAttributes,d=c?c.content[b]||c.global:null,e=a.fieldName,c=a.label||e,d=d?null==d[e]?"":d[e]:"";a=!(!a.format||!a.format.dateFormat);d="number"!==typeof d||a?r.autoLink(d):this._forceLTR(d);a=(f={},f["esri-feature__field-data--date"]=a,f);return m.tsx("tr",{key:u("fields-element-info-row", b)},m.tsx("th",{key:u("fields-element-info-row-header",b),class:"esri-feature__field-header",innerHTML:c}),m.tsx("td",{key:u("fields-element-info-row-data",b),class:"esri-feature__field-data",classes:a,innerHTML:d}));var f};q.prototype._renderFields=function(a,b){var c=this;return(a=a.fieldInfos)?m.tsx("div",{key:u("fields-element",b),class:m.join("esri-feature__fields","esri-feature__content-element")},m.tsx("table",{class:"esri-table",summary:e.fieldsSummary,key:u("fields-element-table",b)},m.tsx("tbody", {key:u("fields-element-table-body",b)},a.map(function(a){return c._renderFieldInfo(a,b)})))):null};q.prototype._shouldOpenInNewTab=function(a){void 0===a&&(a="");return!/^(?:mailto:|tel:)/.test(a.trim().toLowerCase())};q.prototype._clearMediaRefreshTimers=function(){this._refreshTimers.forEach(function(a){return clearTimeout(a)});this._refreshTimers.clear()};q.prototype._clearMediaRefreshTimer=function(a){var b=this._refreshTimers.get(a);b&&(clearTimeout(b),this._refreshTimers.delete(a))};q.prototype._getImageSource= function(a,b){var c=-1!==a.indexOf("?")?"\x26":"?";a=a.split("#");var d=a[1],d=void 0===d?"":d;return""+a[0]+c+"timestamp\x3d"+b+(d?"#":"")+d};q.prototype._setupMediaRefreshTimer=function(a){var b=this.get("viewModel.content");if(Array.isArray(b)&&(b=b[a])&&"media"===b.type){var c=this._activeMediaMap.get(a);isNaN(c)&&(c=0);(b=b.mediaInfos[c])&&"image"===b.type&&b.refreshInterval&&this._setRefreshTimeout(a,b)}};q.prototype._setupMediaRefreshTimers=function(){var a=this;this._clearMediaRefreshTimers(); var b=this.get("viewModel.content");Array.isArray(b)&&b.forEach(function(b,c){return a._setupMediaRefreshTimer(c)})};q.prototype._updateMediaInfoTimestamp=function(a,b){var c=Date.now();this._mediaInfo.set(b,{timestamp:c,sourceURL:this._getImageSource(a,c)});this.scheduleRender()};q.prototype._setRefreshTimeout=function(a,b){var c=this,d=b.refreshInterval,e=b.value;d&&(b=6E4*d,this._updateMediaInfoTimestamp(e.sourceURL,a),b=setInterval(function(){c._updateMediaInfoTimestamp(e.sourceURL,a)},b),this._refreshTimers.set(a, b))};q.prototype._renderMediaInfoType=function(a,b){var c=a.value,d=a.title,d=void 0===d?"":d,e=a.type,f=a.refreshInterval,h=c.sourceURL,c=c.linkURL;if("image"===e)return a=this._shouldOpenInNewTab(c)?"_self":"_blank",h=(f=f?this._mediaInfo.get(b):null)?f.sourceURL:h,b=m.tsx("img",{alt:d,key:u("media-image-"+(f?f.timestamp:0),b),src:h}),(d=c?m.tsx("a",{title:d,href:c,target:a},b):null)?d:b;if(-1!==e.indexOf("chart"))return m.tsx("div",{key:u("chart",b),bind:this,"data-media-info":a,"data-content-element-index":b, class:"esri-feature__media-chart",afterCreate:this._getChartDependencies,afterUpdate:this._getChartDependencies})};q.prototype._getChartDependencies=function(a){var b=this,d=a["data-media-info"],e=a["data-content-element-index"],f=d.value,h=f.theme||"Claro",k=d.type,l=h;"string"===typeof h&&(l=h.replace(/\./g,"/"));this._cancelChartModules();this._chartRequirePromise=c.create(function(a){return p(["dojox/charting/Chart2D","dojox/charting/action2d/Tooltip","dojox/charting/themes/"+l],function(){for(var b= [],c=0;c\&]/gim,function(a){return"\x26#"+a.charCodeAt(0)+";"})}var z=n.getLogger("esri.widgets.FeatureViewModel"),y=/^\s*expression\//i,A=new f("cancelled-query","cancelled feature query"),C=k.getFormat("short-date-short-time"),D="DateFormat"+C;return function(e){function f(a){a=e.call(this)||this;a._handles=new l;a._featurePromise=void 0;a._layerDateFields= [];a.content=null;a.contentEnabled=!0;a.formattedAttributes=null;a.title="";a.view=null;return a}b(f,e);f.prototype.destroy=function(){this._clear();this._handles.destroy();this.graphic=this.view=this._handles=null};Object.defineProperty(f.prototype,"graphic",{get:function(){return this._get("graphic")||null},set:function(a){if(a){var b=t.getSourceLayer(a);this._layerDateFields=b?this._getDateFields(b):[]}this._set("graphic",a);this._graphicChanged(a)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype, "waitingForContent",{get:function(){var a=this._featurePromise;return a?!a.isFulfilled():!1},enumerable:!0,configurable:!0});f.prototype._clear=function(){this._cancelFeatureQuery();this._set("title","");this._set("content",null);this._set("formattedAttributes",null)};f.prototype._graphicChanged=function(a){var b=this,c=this._handles;c&&(c.remove("graphic"),this._clear(),a&&(c.add(m.watch(this,["graphic.popupTemplate.title","graphic.popupTemplate.content","graphic.popupTemplate.fieldInfos","contentEnabled"], function(){b._graphicChanged(b.graphic)}),"graphic"),this._featurePromise=this._queryFeature().then(function(){b.notifyChange("waitingForContent")}).catch(function(a){b.notifyChange("waitingForContent");a!==A&&z.log("error","error loading template",a);throw a;}),this.notifyChange("waitingForContent")))};f.prototype._cancelFeatureQuery=function(){var a=this._featurePromise;a&&!a.isFulfilled()&&a.cancel(A)};f.prototype._compileContent=function(a,b){var c=this;if(a&&(a.nodeName||a&&v.isWidgetBase(a)|| v.isWidget(a)))return a;if("string"===typeof a)return this._compileText({type:"text",text:a}).text;if(Array.isArray(a))return a.map(function(a,d){d=(d=b&&b[d])&&d.value;var f=a.type;if("attachments"===f)return c._compileAttachments(a,d);if("fields"===f)return c._compileFields(a);if("media"===f)return c._compileMedia(a);if("text"===f)return c._compileText(a)});a&&z.warn("invalid content type.")};f.prototype._compileFields=function(a){var b=this,c=this.graphic;a=h.clone(a);var d=c.get("popupTemplate.expressionInfos"), c=a.fieldInfos?void 0:c.get("popupTemplate.fieldInfos"),c=a.fieldInfos||h.clone(c),f=[];c&&c.forEach(function(a){var c=a.fieldName.toLowerCase();if(!a.hasOwnProperty("visible")||a.visible)c=b._isExpressionField(c)?b._getExpressionInfo(d,c):null,a.label=c?c.title:a.label,f.push(a)});a.fieldInfos=f;return a};f.prototype._setImageValue=function(a,b,c){var d=a.linkURL;a.sourceURL=h.substitute(b,this._fixTokens(a.sourceURL,c));a.sourceURL&&d&&(a.linkURL=(""+h.substitute(b,this._fixTokens(d,c))).trim())}; f.prototype._compileMedia=function(a){var b=this,c=this._layerDateFields,d=this.graphic;a=h.clone(a);var f=a.mediaInfos||[],e=d.attributes,k=t.getSourceLayer(d),l=this.formattedAttributes.global,n={dateFormat:{properties:c,formatter:D}};a.mediaInfos=f.map(function(a){if(a=h.clone(a)){var c=a.value,d=a.type,f=a.title?b._processFieldsInLinks(b._fixTokens(a.title,k),e):"",r=a.caption?b._processFieldsInLinks(b._fixTokens(a.caption,k),e):"";a.title=f?(""+h.substitute(l,f,n)).trim():"";a.caption=r?(""+ h.substitute(l,r,n)).trim():"";if("image"===d)return b._setImageValue(c,l,k),a;if("pie-chart"===d||"line-chart"===d||"column-chart"===d||"bar-chart"===d)return b._setChartValue(c,l,k),a}});return a};f.prototype._compileText=function(a){var b=this._layerDateFields,c=this.graphic;if((a=h.clone(a))&&a.text){var d=t.getSourceLayer(c),f=c.attributes,c=this.formattedAttributes.global,b={dateFormat:{properties:b,formatter:D}},d=this._processFieldsInLinks(this._fixTokens(a.text,d),f);a.text=(""+h.substitute(c, d,b)).trim()}return a};f.prototype._compileTitle=function(){var a=this._layerDateFields,b=this.graphic,c=b.get("popupTemplate.title"),d=b.attributes,f=t.getSourceLayer(b),a={dateFormat:{properties:a,formatter:D}},e=this.formattedAttributes.global;return"function"===typeof c?c.call(null,{graphic:b}):"string"===typeof c&&c?(b=this._processFieldsInLinks(this._fixTokens(c,f),d),(""+h.substitute(e,b,a)).trim()):""};f.prototype._getExpressionInfo=function(a,b){if(this._isExpressionField(b)){var c=b.replace(y, "").toLowerCase(),d;a.some(function(a){if(a.name.toLowerCase()===c)return d=a,!0});return d}};f.prototype._fixTokens=function(a,b){return a.replace(/(\{([^\{\r\n]+)\})/g,function(a,c,d){return(a=B(b,d))?"{"+a.name+"}":c})};f.prototype._encodeAttributes=function(a){var b=a?h.clone(a):{};Object.keys(b).forEach(function(a){var c=b[a];"string"===typeof c&&(c=encodeURIComponent(c).replace(/\'/g,"\x26apos;"),b[a]=c)});return b};f.prototype._formatAttributesToFieldInfos=function(a,b,c){var d=this,f=h.clone(this._layerDateFields); a.forEach(function(e){var h=d._getFixedFieldName(e.fieldName,b);e.fieldName=h;c[h]=d._formatValue(c[h],{fieldInfos:a,fieldName:h,layer:b});f&&e.format&&e.format.dateFormat&&(e=f.indexOf(h),-1a||!b?-1:(a+b)%b;this._set("selectedFeatureIndex",a)},enumerable:!0,configurable:!0});Object.defineProperty(g.prototype,"state",{get:function(){return this.get("view.ready")?"ready":"disabled"},enumerable:!0,configurable:!0}); g.prototype.centerAtLocation=function(){var a=this.location,b=this.view;return a&&b?b.goTo({target:a,scale:b.scale},this.goToOptions):f.reject(new c(this.declaredClass+"::Cannot center at location without a location and view."))};g.prototype.clear=function(){this.set({promises:[],features:[],content:null,title:null,location:null})};g.prototype.open=function(a){this.set(e({visible:!1},{updateLocationEnabled:!1,promises:[]},a));this._setVisibleWhenContentExists()};g.prototype.triggerAction=function(a){(a= this.actions.getItemAt(a))&&this.emit("trigger-action",{action:a})};g.prototype.next=function(){this.selectedFeatureIndex+=1;return this};g.prototype.previous=function(){--this.selectedFeatureIndex;return this};g.prototype.zoomToLocation=function(){var a=this,b=this.location,d=this.selectedFeature,e=this.view,k=this.zoomFactor;if(!b||!e)return f.reject(new c(this.declaredClass+"::Cannot zoom to location without a location and view."));var k=e.scale/k,h=this.get("selectedFeature.geometry"),l=d&&"3d"=== e.type,b=(l=h||l)?d:b,n=l&&h&&"point"===h.type&&this._isScreenSize(d);return e.goTo({target:b,scale:n?k:void 0},this.goToOptions).then(function(){n&&"point"===h.type&&(a.location=h)})};g.prototype._setVisibleWhenContentExists=function(){var a=this,b=this._handles,c=this.promiseCount;b.remove("pendingVisible");c?(c=l.init(this,"pendingPromisesCount",function(c){a.featureCount&&(a.set("visible",!0),b.remove("pendingVisible"));c||b.remove("pendingVisible")}),b.add(c,"pendingVisible")):this.set("visible", !0)};g.prototype._autoClose=function(){this.autoCloseEnabled&&(this.visible=!1)};g.prototype._isScreenSize=function(a){var b=this.view;if("3d"!==b.type||"esri.Graphic"!==a.declaredClass)return!0;if((b=b.getViewForGraphic(a))&&b.whenGraphicBounds){var c=!1;b.whenGraphicBounds(a,{useViewElevation:!0}).then(function(a){c=!a||!a.boundingBox||a.boundingBox[0]===a.boundingBox[3]&&a.boundingBox[1]===a.boundingBox[4]&&a.boundingBox[2]===a.boundingBox[5]});return c}return!0};g.prototype._getSelectedFeatureActions= function(){this._originalActions&&(this.actions=this._originalActions,this._originalActions=null);var a=this.actions.filter(function(a){return!a.temporary}),b=this.get("selectedFeature.popupTemplate");b&&b.overwriteActions&&(this._originalActions=a);this.actions=this._getNewActions(b,a)};g.prototype._getNewActions=function(a,b){if(!a||!a.actions)return b;var c=a.actions;c.forEach(function(a){a.temporary=!0});return a.overwriteActions?c:b.concat(c)};g.prototype._getPointFromGeometry=function(a){return a? "point"===a.type?a:"extent"===a.type?a.center:"polygon"===a.type?a.centroid:"multipoint"===a.type||"polyline"===a.type?a.extent.center:null:null};g.prototype._centerAtLocation=function(){var a=this.location,b=this.updateLocationEnabled,c=this.get("view.extent");b&&c&&a&&!c.contains(a)&&this.centerAtLocation()};g.prototype._highlightFeature=function(){this._handles.remove("highlight");var a=this.selectedFeature,b=this.highlightEnabled,c=this.view,d=this.visible;a&&c&&b&&d&&(b=a.layer)&&(c=q(b,c))&& "function"===typeof c.highlight&&(b=b.objectIdField,d=a.attributes,a=c.highlight(d&&d[b]||a,{}),this._handles.add(a,"highlight"))};g.prototype._updateFeatures=function(a,b){var d=this.features;a&&b&&b.length&&!(!this._validatePromise(a)||b instanceof c||b instanceof Error)&&(d.length?(a=b.filter(function(a){return-1===d.indexOf(a)}),this.features=d.concat(a)):this.features=b)};g.prototype._validatePromise=function(a){return a&&(!a.isCanceled||!a.isCanceled())};a([h.property({type:d.ofType(m)})],g.prototype, "actions",void 0);a([h.property()],g.prototype,"goToOptions",void 0);a([h.property()],g.prototype,"autoCloseEnabled",void 0);a([h.property()],g.prototype,"content",void 0);a([h.property({readOnly:!0,dependsOn:["features"]})],g.prototype,"featureCount",null);a([h.property()],g.prototype,"features",null);a([h.property()],g.prototype,"highlightEnabled",void 0);a([h.property({type:n})],g.prototype,"location",null);a([h.property({readOnly:!0,dependsOn:["promises"]})],g.prototype,"pendingPromisesCount", null);a([h.property({readOnly:!0,dependsOn:["featureCount","pendingPromisesCount"]})],g.prototype,"waitingForResult",null);a([h.property({readOnly:!0,dependsOn:["promises"]})],g.prototype,"promiseCount",null);a([h.property()],g.prototype,"promises",null);a([h.property({value:null,readOnly:!0,dependsOn:["features","selectedFeatureIndex","updateLocationEnabled"]})],g.prototype,"selectedFeature",null);a([h.property({value:-1})],g.prototype,"selectedFeatureIndex",null);a([h.property({readOnly:!0,dependsOn:["view.ready"]})], g.prototype,"state",null);a([h.property()],g.prototype,"title",void 0);a([h.property()],g.prototype,"updateLocationEnabled",void 0);a([h.property()],g.prototype,"view",void 0);a([h.property()],g.prototype,"visible",void 0);a([h.property()],g.prototype,"zoomFactor",void 0);a([h.property()],g.prototype,"centerAtLocation",null);a([h.property()],g.prototype,"clear",null);a([h.property()],g.prototype,"triggerAction",null);a([h.property()],g.prototype,"next",null);a([h.property()],g.prototype,"previous", null);a([h.property()],g.prototype,"zoomToLocation",null);return g=a([h.subclass("esri.widgets.Popup.PopupViewModel")],g)}(h.declared(u))})},"esri/views/MapViewBase":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/_base/lang ../geometry ../Viewpoint ../core/Error ../core/Handles ../core/Logger ../core/promiseUtils ../core/accessorSupport/decorators ../geometry/support/webMercatorUtils ./View ./ViewAnimation ./2d/AnimationManager ./2d/FrameTask ./2d/MapViewConstraints ./2d/PaddedViewState ./2d/viewpointUtils".split(" "), function(p,g,b,a,e,d,c,k,f,l,h,n,r,m,u,q,t,x,v,B){var w=l.getLogger("esri.views.MapView");return function(l){function m(a){var b=l.call(this,a)||this;b._frameTask=new t(b);b._mapViewBaseHandles=new f;b._setup=!1;b.fullOpacity=1;b.interacting=!1;b.initialExtent=null;b.resizeAlign="center";b.type="2d";b.constraints=new x;b.padding={top:0,right:0,bottom:0,left:0};var c=function(){this._set("updating",this.layerViewManager.factory.working||this.allLayerViews.some(function(a){return!0===a.updating}))}.bind(b), d=b._mapViewBaseHandles;d.add([b.watch("viewpoint",function(a){return b._flipStationary()},!0),b.on("resize",function(a){return b._resizeHandler(a)}),b.watch("animationManager.animation",function(a){b.animation=a}),b.allLayerViews.on("change",function(){c();d.remove("layerViewsUpdating");d.add(b.allLayerViews.map(function(a){return a.watch("updating",c)}).toArray(),"layerViewsUpdating")})]);b.watch("ready",function(a){a?b._startup():b._tearDown()});return b}b(m,l);m.prototype.destroy=function(){this.destroyed|| (this._set("ready",!1),this._mapViewBaseHandles.removeAll(),this.layerViewManager.clear(),this._frameTask.destroy(),this._tearDown(),this._gotoTask=this._mapViewBaseHandles=this._frameTask=null)};Object.defineProperty(m.prototype,"animation",{set:function(a){var b=this,c=this._get("animation");a!==c&&(c&&c.stop(),!a||a.isFulfilled()?this._set("animation",null):(this._set("animation",a),c=function(){a===b._get("animation")&&(b._set("animation",null),b._frameTask.requestFrame())},a.when(c,c,function(a){b.state&& (b.state.viewpoint=a)})))},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"center",{get:function(){if(!this._setup)return this._get("center");var a=this.content.center;return new d.Point({x:a[0],y:a[1],spatialReference:this.content.spatialReference})},set:function(a){if(null!=a)if(this._normalizeInput(a))if(this._setup){var b=this.viewpoint;B.centerAt(b,b,a);this.viewpoint=b}else this._set("center",a),this.notifyChange("initialExtentRequired");else w.error("#center","incompatible spatialReference "+ JSON.stringify(a.spatialReference)+" with view's spatialReference "+JSON.stringify(this.spatialReference))},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"constraints",{set:function(a){var b=this,c=this._get("constraints");c&&(this._mapViewBaseHandles.remove("constraints"),c.destroy());this._set("constraints",a);a&&(this._setup&&(a.view=this,this.state.viewpoint=a.fit(this.content.viewpoint)),this._mapViewBaseHandles.add(a.on("update",function(){b._setup&&b.state&&(b.state.viewpoint= a.fit(b.content.viewpoint))}),"constraints"))},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"extent",{get:function(){return this._setup?this.content.extent.clone():this._get("extent")},set:function(a){if(null!=a){var b=this._normalizeInput(a);b?b.width&&b.height?this._setup?(a=this.viewpoint,B.setExtent(a,a,b,this.size,{constraints:this.constraints}),this.viewpoint=a):(this._set("extent",b),this._set("center",null),this._set("viewpoint",null),this._set("scale",0),this._set("zoom", -1),this.notifyChange("initialExtentRequired")):w.error("#extent","invalid extent size"):w.error("#center","incompatible spatialReference "+JSON.stringify(a.spatialReference)+" with view's spatialReference "+JSON.stringify(this.spatialReference))}},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"initialExtentRequired",{get:function(){var a=this.extent,b=this.center,c=this.scale,d=this.viewpoint,e=this.zoom;return this.get("map.initialViewProperties.viewpoint")||a||b&&(0!==c||-1!== e)||d?!1:!0},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"padding",{get:function(){return this._setup?this.state.padding:this._get("padding")},set:function(a){this._setup?(this.state.padding=a,this._set("padding",this.state.padding)):this._set("padding",a)},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"rotation",{get:function(){return this._setup?this.content.rotation:this._get("rotation")},set:function(a){if(!isNaN(a))if(this._setup){var b=this.viewpoint; B.rotateTo(b,b,a);this.viewpoint=b}else this._set("rotation",a)},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"scale",{get:function(){return this._setup?this.content.scale:this._get("scale")},set:function(a){if(a&&!isNaN(a))if(this._setup){var b=this.viewpoint;B.scaleTo(b,b,a);this.viewpoint=b}else{this._set("scale",a);this._set("zoom",-1);if(a=this._get("extent"))this._set("extent",null),this._set("center",a.center);this.notifyChange("initialExtentRequired")}},enumerable:!0, configurable:!0});Object.defineProperty(m.prototype,"stationary",{get:function(){return!this.animation&&!this.interacting&&!this._get("resizing")&&!this._stationaryTimer},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"viewpoint",{get:function(){if(!this._setup)return this._get("viewpoint");var a=this.content;return a&&a.viewpoint.clone()},set:function(a){if(null!=a){var b=this._normalizeInput(a);b?this._setup?(a=B.create(),B.copy(a,b),this.constraints.constrain(a,this.content.viewpoint), this.state.viewpoint=a,this._frameTask.requestFrame(),this._set("viewpoint",a)):(this._set("viewpoint",b),this._set("extent",null),this._set("center",null),this._set("zoom",-1),this._set("scale",0),this.notifyChange("initialExtentRequired")):!a.scale||isNaN(a.scale)?w.error("#viewpoint","invalid scale value of "+a.scale):a.targetGeometry?w.error("#viewpoint","incompatible spatialReference "+JSON.stringify(a.targetGeometry.spatialReference)+" with view's spatialReference "+JSON.stringify(this.spatialReference)): w.error("#viewpoint","geometry not defined")}},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"zoom",{get:function(){return this._setup?this.constraints.scaleToZoom(this.scale):this._get("zoom")},set:function(a){if(null!=a){if(!this._setup){this.notifyChange("initialExtentRequired");this._set("zoom",a);this._set("scale",0);var b=this._get("extent");b&&(this._set("extent",null),this._set("center",b.center))}this.constraints.effectiveLODs&&(b=this.viewpoint,B.scaleTo(b,b,this.constraints.zoomToScale(a)), this.viewpoint=b,this._set("zoom",this.constraints.scaleToZoom(this.scale)))}},enumerable:!0,configurable:!0});m.prototype.goTo=function(a,b){this.animation&&(this.animation=null);if(this._setup)return b=e.mixin({animate:!0},b),a=B.createAsync(a,this),this._gotoTask={},b.animate?this._gotoAnimated(a,b):this._gotoImmediate(a,b);w.error("#goTo()","MapView cannot be used before it is ready")};m.prototype.hitTest=function(a,b){return h.reject("Should be implemented by subclasses")};m.prototype.toMap= function(a,b,c){if(!this._setup)return null;a&&null!=a.x&&(c=b,b=a.y,a=a.x);var e=[0,0];this.state.toMap(e,[a,b]);c=c||new d.Point;c.x=e[0];c.y=e[1];c.spatialReference=this.spatialReference;return c};m.prototype.isTileInfoRequired=function(){return!0};m.prototype.toScreen=function(a,b,c,e){if(!this._setup)return null;a&&"object"===typeof a?(e=b||new d.ScreenPoint,a=this._normalizeInput(a),b=a.y,a=a.x):e="number"===typeof c||null==c?e||new d.ScreenPoint:c||new d.ScreenPoint;a=[a,b];this.state.toScreen(a, a);e.x=a[0];e.y=a[1];return e};m.prototype.pixelSizeAt=function(a,b){if(!this._setup)return NaN;a&&null!=a.x&&(b=a.y,a=a.x);return this.content.pixelSizeAt([a,b])};m.prototype.requestLayerViewUpdate=function(a){this._setup&&this._frameTask.requestLayerViewUpdate(a)};m.prototype.getDefaultSpatialReference=function(){return this.get("map.initialViewProperties.spatialReference")||this.get("defaultsFromMap.spatialReference")||null};m.prototype.isSpatialReferenceSupported=function(a,b){if(b||this._get("ready"))return!0; b=this._normalizeInput(this._get("center"),a);var c=this._normalizeInput(this._get("extent"),a),d=this._normalizeInput(this._get("viewpoint"),a),e=this._userSpatialReference,f=null,h=null;(d=d&&d.targetGeometry)&&("extent"===d.type?f=d:"point"===d.type&&(h=d));d=this._normalizeInput(this.get("map.initialViewProperties.viewpoint.targetGeometry.extent"),a);a=this._normalizeInput(this.initialExtent,a);a=c||f||d||a;return b||h||a&&a.center?!0:(e&&w.error("The view could not be initialized with the spatialReference "+ e.wkid+".","Try specifying an extent or a center and scale"),!1)};m.prototype._createOrReplaceAnimation=function(a){if(!this.animation||this.animation.done)this.animation=new u;this.animation.update(a);return this.animation};m.prototype._cancellableGoTo=function(a,b,c){var d=this,e=c.then(function(){a===d._gotoTask&&(d.animation=null)}).catch(function(c){a===d._gotoTask&&(d.animation=null,b.done||b.stop());throw c;}),f=h.create(function(a){return a(e)},function(){a!==d._gotoTask||b.done||b.stop()}); b.catch(function(){a===d._gotoTask&&f.cancel()});return f};m.prototype._gotoImmediate=function(a,b){var c=this,d=this._gotoTask,e=this._createOrReplaceAnimation(a);a=a.then(function(a){if(d!==c._gotoTask)throw new k("view:goto-interrupted","Goto was interrupted");c.viewpoint=e.target=a;e.finish()});return this._cancellableGoTo(d,e,a)};m.prototype._gotoAnimated=function(a,b){var c=this,d=this._gotoTask,e=this._createOrReplaceAnimation(a);a=a.then(function(a){if(d!==c._gotoTask)throw new k("view:goto-interrupted", "Goto was interrupted");e.update(a);c.animationManager.animate(e,c.viewpoint,b);return e.when().then(function(){})});return this._cancellableGoTo(d,e,a)};m.prototype._resizeHandler=function(a){var b=this.state;if(b){var c=this.content.viewpoint,d=this.content.size.concat();b.size=[a.width,a.height];B.resize(c,c,d,this.content.size,this.resizeAlign);c=this.constraints.constrain(c,null);this.state.viewpoint=c}};m.prototype._startup=function(){if(!this._setup){var a=this.constraints,b=this._get("zoom"), d=this._get("scale"),e=this._normalizeInput(this._get("center")),f=this._normalizeInput(this._get("extent")),h=this._get("rotation"),k=this._normalizeInput(this._get("viewpoint"));a.view=this;a.effectiveLODs?-1!==b&&(d=a.zoomToScale(b)):b=-1;var l=null,n=null,r=0,b=k&&k.rotation,m=k&&k.targetGeometry;m&&("extent"===m.type?l=m:"point"===m.type&&(n=m,r=k.scale));k=this._normalizeInput(this.get("map.initialViewProperties.viewpoint.targetGeometry.extent"));m=this._normalizeInput(this.initialExtent);f= f||l||k||m;e=e||n||f&&f.center;d=d||r||f&&B.extentToScale(f,this.size);h=new c({targetGeometry:e,scale:d,rotation:h||b||0});a.fit(h);this._set("animationManager",new q);this._set("state",new v({padding:this._get("padding"),size:this.size,viewpoint:h}));this._set("content",this.state.content);this._setup=!0}};m.prototype._tearDown=function(){if(this._setup){this._setup=!1;this._stationaryTimer&&(clearTimeout(this._stationaryTimer),this._stationaryTimer=null,this.notifyChange("stationary"));var a=this._get("content"), b=a.center,c=a.spatialReference,b=new d.Point({x:b[0],y:b[1],spatialReference:c});this._set("viewpoint",null);this._set("extent",null);this._set("center",b);this._set("zoom",-1);this._set("rotation",a.rotation);this._set("scale",a.scale);this._set("spatialReference",c);this.constraints.view=null;this.animationManager.destroy();this._set("animationManager",null);this._set("state",null);this._set("content",null);this.animation=null}};m.prototype._flipStationary=function(){var a=this;this._stationaryTimer&& clearTimeout(this._stationaryTimer);this._stationaryTimer=setTimeout(function(){a._stationaryTimer=null;a.notifyChange("stationary")},160);this.notifyChange("stationary")};m.prototype._normalizeInput=function(a,b){void 0===b&&(b=this.spatialReference);var c=a&&a.targetGeometry||a;return b?c?b.equals(c.spatialReference)?a:r.canProject(c,b)?a&&"esri.Viewpoint"===a.declaredClass?(a.targetGeometry=r.project(c,b),a):r.project(c,b):null:null:a};a([n.property()],m.prototype,"animation",null);a([n.property({readOnly:!0})], m.prototype,"animationManager",void 0);a([n.property({value:null,type:d.Point,dependsOn:["content.center"]})],m.prototype,"center",null);a([n.property({type:x})],m.prototype,"constraints",null);a([n.property({readOnly:!0})],m.prototype,"content",void 0);a([n.property({value:null,type:d.Extent,dependsOn:["content.extent"]})],m.prototype,"extent",null);a([n.property()],m.prototype,"fullOpacity",void 0);a([n.property({readOnly:!0})],m.prototype,"interacting",void 0);a([n.property({type:d.Extent})],m.prototype, "initialExtent",void 0);a([n.property({dependsOn:["map.initialViewProperties.viewpoint"]})],m.prototype,"initialExtentRequired",null);a([n.property({value:{top:0,right:0,bottom:0,left:0},cast:function(a){return e.mixin({top:0,right:0,bottom:0,left:0},a)}})],m.prototype,"padding",null);a([n.property()],m.prototype,"resizeAlign",void 0);a([n.property({value:0,type:Number,dependsOn:["content.rotation"]})],m.prototype,"rotation",null);a([n.property({value:0,type:Number,dependsOn:["content.scale"]})], m.prototype,"scale",null);a([n.property({type:d.SpatialReference,dependsOn:["map.initialViewProperties.spatialReference","defaultsFromMap.isSpatialReferenceDone"]})],m.prototype,"spatialReference",void 0);a([n.property({readOnly:!0})],m.prototype,"state",void 0);a([n.property()],m.prototype,"stationary",null);a([n.property({readOnly:!0})],m.prototype,"type",void 0);a([n.property({value:null,type:c,dependsOn:["content.viewpoint"]})],m.prototype,"viewpoint",null);a([n.property({value:-1,dependsOn:["content.scale"]})], m.prototype,"zoom",null);return m=a([n.subclass("esri.views.MapViewBase")],m)}(n.declared(m))})},"esri/views/2d/AnimationManager":function(){define("../../core/Accessor ../../core/scheduling ../../core/now ../ViewAnimation ./unitBezier ./viewpointUtils".split(" "),function(p,g,b,a,e,d){var c=function(a,b,c,d){var f=a.targetGeometry,k=b.targetGeometry;d?"string"===typeof d&&(d=e.parse(d)||e.ease):d=e.ease;this.easing=d;this.duration=c;this.sCenterX=f.x;this.sCenterY=f.y;this.sScale=a.scale;this.sRotation= a.rotation;this.tCenterX=k.x;this.tCenterY=k.y;this.tScale=b.scale;this.tRotation=b.rotation;this.dCenterX=this.tCenterX-this.sCenterX;this.dCenterY=this.tCenterY-this.sCenterY;this.dScale=this.tScale-this.sScale;this.dRotation=this.tRotation-this.sRotation;180this.dRotation&&(this.dRotation+=360)};c.prototype.applyRatio=function(a,b){var c=this.easing(b),d,e;1<=b?(b=this.tCenterX,d=this.tCenterY,e=this.tRotation,c=this.tScale):(b=this.sCenterX+c*this.dCenterX, d=this.sCenterY+c*this.dCenterY,e=this.sRotation+c*this.dRotation,c=this.sScale+c*this.dScale);a.targetGeometry.x=b;a.targetGeometry.y=d;a.scale=c;a.rotation=e};return p.createSubclass({constructor:function(){this._updateTask=g.addFrameTask({postRender:this._postRender.bind(this)});this._updateTask.pause()},getDefaults:function(){return{viewpoint:d.create()}},properties:{animation:null,duration:{value:200},transition:{value:null},easing:{value:e.ease},viewpoint:null},animate:function(a,e,l){this.stop(); d.copy(this.viewpoint,e);this.transition=new c(this.viewpoint,a.target,l&&l.duration||this.duration,l&&l.easing||this.easing);a.always(function(){this.animation===a&&this._updateTask&&("finished"===a.state&&(this.transition.applyRatio(this.viewpoint,1),this.animation._dfd.progress(this.viewpoint)),this._updateTask.pause(),this.updateFunction=this.animation=null)}.bind(this));this._startTime=b();this._updateTask.resume();return this.animation=a},animateContinous:function(c,d){this.stop();this.updateFunction= d;this.viewpoint=c;var e=new a({target:c.clone()});e.always(function(){this.animation===e&&this._updateTask&&(this._updateTask.pause(),this.updateFunction=this.animation=null)}.bind(this));this._startTime=b();this._updateTask.resume();return this.animation=e},stop:function(){this.animation&&(this.animation.stop(),this.updateFunction=this.animation=null)},_postRender:function(c){var d=this.animation;d&&d.state!==a.STOPPED?(this.updateFunction?this.updateFunction(this.viewpoint,c.deltaTime):(c=(b()- this._startTime)/this.transition.duration,d=1<=c,this.transition.applyRatio(this.viewpoint,c),d&&this.animation.finish()),this.animation._dfd.progress(this.viewpoint)):this._updateTask.pause()}})})},"esri/views/2d/unitBezier":function(){define([],function(){var p=function(b,a,e,d){function c(a,b){var c,d,e,h;b=null==b?1E-6:b;e=a;for(d=0;8>d;d++){h=((l*e+f)*e+k)*e-a;if(Math.abs(h)Math.abs(c))break;e-=h/c}c=0;d=1;e=a;if(ed)return d;for(;ch?c=e:d=e;e=.5*(d-c)+c}return e}var k=3*b,f=3*(e-b)-k,l=1-k-f,h=3*a,n=3*(d-a)-h,r=1-h-n;return function(a,b){a=c(a,b);return((r*a+n)*a+h)*a}},g=/^cubic-bezier\((.*)\)/;p.parse=function(b){var a=p[b]||null;!a&&(b=g.exec(b))&&(b=b[1].split(",").map(function(a){return parseFloat(a.trim())}),4!==b.length||b.some(function(a){return isNaN(a)})||(a=p.apply(p,b)));return a};p.ease=p(.25,.1,.25,1);p.linear=p(0,0,1,1);p.easeIn=p["ease-in"]=p(.42,0,1,1);p.easeOut=p["ease-out"]= p(0,0,.58,1);p.easeInOut=p["ease-in-out"]=p(.42,0,.58,1);return p})},"esri/views/2d/viewpointUtils":function(){define("require exports ../../Viewpoint ../../core/Error ../../core/promiseUtils ../../geometry/Extent ../../geometry/Geometry ../../geometry/Point ../../geometry/SpatialReference ../../geometry/support/scaleUtils ../../geometry/support/spatialReferenceUtils ../../geometry/support/webMercatorUtils ../../geometry/support/webMercatorUtils ./libs/gl-matrix/common ./libs/gl-matrix/mat2d ./libs/gl-matrix/vec2".split(" "), function(p,g,b,a,e,d,c,k,f,l,h,n,r,m,u,q){function t(a,b,c,d){return d&&c&&!d.equals(c)&&n.canProject(d,c)&&d.isWebMercator?(d.isWebMercator?(c=b[1],89.99999c&&(c=-89.99999),c=Math.sin(m.toRadian(c)),a=q.set(a,6378137*m.toRadian(b[0]),3189068.5*Math.log((1+c)/(1-c)))):(c=m.toDegree(b[0]/6378137),a=q.set(a,c-360*Math.floor((c+180)/360),m.toDegree(.5*Math.PI-2*Math.atan(Math.exp(-1*b[1]/6378137))))),a):q.copy(a,b)}function x(a){return a.wkid?a:a.spatialReference||f.WGS84}function v(a, b){return b.type?q.set(a,b.x,b.y):q.copy(a,b)}function B(a,b){return Math.max(a.width/b[0],a.height/b[1])*G(a.spatialReference)}function w(a,b,e){var f;if(!a)return null;if(Array.isArray(a)&&2===a.length&&"number"===typeof a[0]&&"number"===typeof a[1])return new k(a);if(a.reduce)return a.reduce(function(a,c){return w(c,b,a)},e);a instanceof c?f=a:a.geometry&&(f=a.geometry);if(!f)return null;a="point"===f.type?new d({xmin:f.x,ymin:f.y,xmax:f.x,ymax:f.y,spatialReference:f.spatialReference}):f.extent; if(!a)return null;f=n.canProject(a,b);if(!a.spatialReference.equals(b)&&f)a=n.project(a,b);else if(!f)return null;return e=e?e.union(a):a.clone()}function z(a,c){if(!a)return new b({targetGeometry:new k,scale:0,rotation:0});var e=c.spatialReference,f=c.size,h=c.viewpoint,l=c.constraints,m=null;"esri.Viewpoint"===a.declaredClass?m=a:a.viewpoint?m=a.viewpoint:a.target&&"esri.Viewpoint"===a.target.declaredClass&&(m=a.target);var u=null;if(m&&m.targetGeometry)u=m.targetGeometry;else if(a instanceof d)u= a;else if(a||a&&(a.hasOwnProperty("center")||a.hasOwnProperty("extent")||a.hasOwnProperty("target")))u=w(a.center,e)||w(a.extent,e)||w(a.target,e)||w(a,e);!u&&h&&h.targetGeometry?u=h.targetGeometry:!u&&c.extent&&(u=c.extent);var g=x(u);e||(e=x(c.spatialReference||c.extent||u));if(!r.canProject(u,e)&&g&&!g.equals(e))return null;var y=v(q.create(),u.center?u.center:u),g=new k(t(y,y,g,e),e),y=null,y=m&&m.targetGeometry&&"point"===m.targetGeometry.type?m.scale:a.hasOwnProperty("scale")&&a.scale?a.scale: a.hasOwnProperty("zoom")&&-1!==a.zoom&&l&&l.effectiveLODs?l.zoomToScale(a.zoom):Array.isArray(u)||"point"===u.type||"extent"===u.type&&0===u.width&&0===u.height?c.extent&&n.canProject(c.extent,e)?B(n.project(c.extent,e),f):c.extent?B(c.extent,f):h.scale:n.canProject(u.extent,e)?B(n.project(u.extent,e),f):B(u.extent,f);c=0;m?c=m.rotation:a.hasOwnProperty("rotation")?c=a.rotation:h&&(c=h.rotation);a=new b({targetGeometry:g,scale:y,rotation:c});l&&(a=l.fit(a),l.rotationEnabled||(a.rotation=c));return a} function y(a,b){var c=a.targetGeometry,d=b.targetGeometry;c.x=d.x;c.y=d.y;c.spatialReference=d.spatialReference;a.scale=b.scale;a.rotation=b.rotation;return a}function A(a,b,c){return c?q.set(a,.5*(b[0]-c.right+c.left),.5*(b[1]-c.bottom+c.top)):q.scale(a,b,.5)}function C(a,b,c,d){g.getTransform(a,b,c,d);return u.invert(a,a)}function D(a,b,c){var d=m.toRadian(b.rotation)||0;b=Math.abs(Math.cos(d));d=Math.abs(Math.sin(d));return q.set(a,Math.round(c[1]*d+c[0]*b),Math.round(c[1]*b+c[0]*d))}function E(a){return a.scale* (1/(39.37*l.getMetersPerUnitForSR(a.targetGeometry.spatialReference)*96))}function G(a){return 39.37*l.getMetersPerUnitForSR(a)*96}function F(a){return a.isWrappable?(a=h.getInfo(a),a.valid[1]-a.valid[0]):0}function K(a,b){return Math.round(F(a)/b)}Object.defineProperty(g,"__esModule",{value:!0});var J=180/Math.PI;g.extentToScale=B;g.create=z;g.copy=y;g.getAnchor=A;g.getExtent=function(){var a=q.create();return function(b,c,d){var e=c.targetGeometry;v(a,e);c=.5*E(c);b.xmin=a[0]-c*d[0];b.ymin=a[1]- c*d[1];b.xmax=a[0]+c*d[0];b.ymax=a[1]+c*d[1];b.spatialReference=e.spatialReference;return b}}();g.setExtent=function(a,b,c,d,e){g.centerAt(a,b,c.center);a.scale=B(c,d);e&&e.constraints&&e.constraints.constrain(a);return a};g.getOuterExtent=function(){var a=q.create(),b=q.create();return function(c,d,e){v(a,d.targetGeometry);D(b,d,e);e=.5*E(d);c.set({xmin:a[0]-e*b[0],ymin:a[1]-e*b[1],xmax:a[0]+e*b[0],ymax:a[1]+e*b[1],spatialReference:d.targetGeometry.spatialReference});return c}}();g.getClippedExtent= function(){var a=q.create(),b=q.create();return function(c,d,e){var f=E(d),h=d.targetGeometry.spatialReference,k=K(h,f);v(a,d.targetGeometry);D(b,d,e);h.isWrappable&&b[0]>k&&(b[0]=k);d=.5*f;c.set({xmin:a[0]-d*b[0],ymin:a[1]-d*b[1],xmax:a[0]+d*b[0],ymax:a[1]+d*b[1],spatialReference:h});return c}}();g.getOuterSize=D;g.getPaddingScreenTranslation=function(){var a=q.create();return function(b,c,d){return q.sub(b,q.scale(b,c,.5),A(a,c,d))}}();var H=function(){var a=u.create(),b=q.create();return function(c, d,e,f){var h=E(d);d=m.toRadian(d.rotation)||0;q.set(b,h,h);u.fromScaling(a,b);u.rotate(a,a,d);u.translate(a,a,g.getPaddingScreenTranslation(b,e,f));u.translate(a,a,[0,f.top-f.bottom]);return q.set(c,a[4],a[5])}}();g.getResolution=E;g.getResolutionToScaleFactor=G;g.getMatrix=function(){var a=q.create(),b=q.create(),c=q.create();return function(d,e,f,h,k,l){q.negate(a,e);q.scale(b,f,.5*l);q.set(c,1/h*l,-1/h*l);u.identity(d);u.translate(d,d,b);k&&u.rotate(d,d,k);u.scale(d,d,c);u.translate(d,d,a);return d}}(); g.getTransform=function(){var a=q.create();return function(b,c,d,e){var f=E(c),h=m.toRadian(c.rotation)||0;v(a,c.targetGeometry);return g.getMatrix(b,a,d,f,h,e)}}();g.getTransformNoRotation=function(){var a=q.create();return function(b,c,d,e){var f=E(c);v(a,c.targetGeometry);return g.getMatrix(b,a,d,f,0,e)}}();g.getWorldWidth=F;g.getWorldScreenWidth=K;g.createAsync=function(b,c){if(b=z(b,c))return e.resolve(b);b=new a("viewpointUtils-createAsync:different-spatialReference","Target spatialReference cannot be projected and is different from out spatialReference"); return e.reject(b)};g.angleBetween=function(){var a=q.create(),b=q.create(),c=q.create();return function(d,e,f){q.subtract(a,d,e);q.normalize(a,a);q.subtract(b,d,f);q.normalize(b,b);q.cross(c,a,b);d=Math.acos(q.dot(a,b)/(q.length(a)*q.length(b)))*J;0>c[2]&&(d=-d);isNaN(d)&&(d=0);return d}}();g.addPadding=function(){var a=q.create();return function(b,c,d,e){var f=b.targetGeometry;y(b,c);H(a,c,d,e);f.x+=a[0];f.y+=a[1];return b}}();g.removePadding=function(){var a=q.create();return function(b,c,d,e){var f= b.targetGeometry;y(b,c);H(a,c,d,e);f.x-=a[0];f.y-=a[1];return b}}();g.centerAt=function(){var a=q.create();return function(b,c,d){y(b,c);c=b.targetGeometry;var e=x(d),f=x(c);v(a,d);t(a,a,e,f);c.x=a[0];c.y=a[1];return b}}();g.pixelSizeAt=function(a,b,c){return E(b)};g.resize=function(){var a=q.create();return function(b,c,d,e,f){f||(f="center");q.sub(a,d,e);q.scale(a,a,.5);d=a[0];e=a[1];switch(f){case "center":q.set(a,0,0);break;case "left":q.set(a,-d,0);break;case "top":q.set(a,0,e);break;case "right":q.set(a, d,0);break;case "bottom":q.set(a,0,-e);break;case "top-left":q.set(a,-d,e);break;case "bottom-left":q.set(a,-d,-e);break;case "top-right":q.set(a,d,e);break;case "bottom-right":q.set(a,d,-e)}g.translateBy(b,c,a);return b}}();g.rotateBy=function(a,b,c){y(a,b);a.rotation+=c;return a};g.rotateTo=function(a,b,c){y(a,b);a.rotation=c;return a};g.scaleBy=function(){var a=q.create();return function(b,c,d,e,f){y(b,c);isNaN(d)||0===d||(g.toMap(a,e,c,f),b.scale=c.scale*d,g.toScreen(a,a,b,f),g.translateBy(b, b,q.set(a,a[0]-e[0],e[1]-a[1])));return b}}();g.scaleTo=function(a,b,c){y(a,b);a.scale=c;return a};g.scaleAndRotateBy=function(){var a=q.create();return function(b,c,d,e,f,h){y(b,c);isNaN(d)||0===d||(g.toMap(a,f,c,h),b.scale=c.scale*d,b.rotation+=e,g.toScreen(a,a,b,h),g.translateBy(b,b,q.set(a,a[0]-f[0],f[1]-a[1])));return b}}();g.padAndScaleAndRotateBy=function(){var a=q.create(),b=q.create();return function(c,d,e,f,h,k,l){g.getPaddingScreenTranslation(b,k,l);q.add(a,h,b);return f?g.scaleAndRotateBy(c, d,e,f,a,k):g.scaleBy(c,d,e,a,k)}}();g.toMap=function(){var a=u.create();return function(b,c,d,e){return q.transformMat2d(b,c,C(a,d,e,1))}}();g.toScreen=function(){var a=u.create();return function(b,c,d,e){return q.transformMat2d(b,c,g.getTransform(a,d,e,1))}}();g.translateBy=function(){var a=q.create(),b=u.create();return function(c,d,e){y(c,d);var f=E(d),h=c.targetGeometry;u.fromRotation(b,m.toRadian(d.rotation)||0);u.scale(b,b,q.fromValues(f,f));q.transformMat2d(a,e,b);h.x+=a[0];h.y+=a[1];return c}}()})}, "esri/views/2d/libs/gl-matrix/common":function(){define([],function(){if(!p)var p=1E-6;if(!g)var g="undefined"!==typeof Float32Array?Float32Array:Array;if(!b)var b=Math.random;var a={GLMAT_EPSILON:p,GLMAT_ARRAY_TYPE:g,GLMAT_RANDOM:b,setMatrixArrayType:function(b){a.GLMAT_ARRAY_TYPE=b}},e=Math.PI/180,d=180/Math.PI;a.toRadian=function(a){return a*e};a.toDegree=function(a){return a*d};a.setMatrixArrayType(Array);return a})},"esri/views/2d/libs/gl-matrix/mat2d":function(){define(["./common"],function(p){var g= p.GLMAT_ARRAY_TYPE;p={create:function(){var b=new g(6);b[0]=1;b[1]=0;b[2]=0;b[3]=1;b[4]=0;b[5]=0;return b},clone:function(b){var a=new g(6);a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];a[4]=b[4];a[5]=b[5];return a},copy:function(b,a){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];return b},identity:function(b){b[0]=1;b[1]=0;b[2]=0;b[3]=1;b[4]=0;b[5]=0;return b},invert:function(b,a){var e=a[0],d=a[1],c=a[2],k=a[3],f=a[4];a=a[5];var l=e*k-d*c;if(!l)return null;l=1/l;b[0]=k*l;b[1]=-d*l;b[2]= -c*l;b[3]=e*l;b[4]=(c*a-k*f)*l;b[5]=(d*f-e*a)*l;return b},determinant:function(b){return b[0]*b[3]-b[1]*b[2]},multiply:function(b,a,e){var d=a[0],c=a[1],k=a[2],f=a[3],l=a[4];a=a[5];var h=e[0],n=e[1],r=e[2],m=e[3],u=e[4];e=e[5];b[0]=d*h+k*n;b[1]=c*h+f*n;b[2]=d*r+k*m;b[3]=c*r+f*m;b[4]=d*u+k*e+l;b[5]=c*u+f*e+a;return b}};p.mul=p.multiply;p.rotate=function(b,a,e){var d=a[0],c=a[1],k=a[2],f=a[3],l=a[4];a=a[5];var h=Math.sin(e);e=Math.cos(e);b[0]=d*e+k*h;b[1]=c*e+f*h;b[2]=d*-h+k*e;b[3]=c*-h+f*e;b[4]=l; b[5]=a;return b};p.scale=function(b,a,e){var d=a[1],c=a[2],k=a[3],f=a[4],l=a[5],h=e[0];e=e[1];b[0]=a[0]*h;b[1]=d*h;b[2]=c*e;b[3]=k*e;b[4]=f;b[5]=l;return b};p.translate=function(b,a,e){var d=a[0],c=a[1],k=a[2],f=a[3],l=a[4];a=a[5];var h=e[0];e=e[1];b[0]=d;b[1]=c;b[2]=k;b[3]=f;b[4]=d*h+k*e+l;b[5]=c*h+f*e+a;return b};p.fromRotation=function(b,a){var e=Math.sin(a);a=Math.cos(a);b[0]=a;b[1]=e;b[2]=-e;b[3]=a;b[4]=0;b[5]=0;return b};p.fromScaling=function(b,a){b[0]=a[0];b[1]=0;b[2]=0;b[3]=a[1];b[4]=0;b[5]= 0;return b};p.fromTranslation=function(b,a){b[0]=1;b[1]=0;b[2]=0;b[3]=1;b[4]=a[0];b[5]=a[1];return b};p.str=function(b){return"mat2d("+b[0]+", "+b[1]+", "+b[2]+", "+b[3]+", "+b[4]+", "+b[5]+")"};p.frob=function(b){return Math.sqrt(Math.pow(b[0],2)+Math.pow(b[1],2)+Math.pow(b[2],2)+Math.pow(b[3],2)+Math.pow(b[4],2)+Math.pow(b[5],2)+1)};return p})},"esri/views/2d/libs/gl-matrix/vec2":function(){define(["./common"],function(p){var g=p.GLMAT_ARRAY_TYPE,b=p.GLMAT_RANDOM,a={create:function(){var a=new g(2); a[0]=0;a[1]=0;return a},clone:function(a){var b=new g(2);b[0]=a[0];b[1]=a[1];return b},fromValues:function(a,b){var c=new g(2);c[0]=a;c[1]=b;return c},copy:function(a,b){a[0]=b[0];a[1]=b[1];return a},set:function(a,b,c){a[0]=b;a[1]=c;return a},add:function(a,b,c){a[0]=b[0]+c[0];a[1]=b[1]+c[1];return a},subtract:function(a,b,c){a[0]=b[0]-c[0];a[1]=b[1]-c[1];return a}};a.sub=a.subtract;a.multiply=function(a,b,c){a[0]=b[0]*c[0];a[1]=b[1]*c[1];return a};a.mul=a.multiply;a.divide=function(a,b,c){a[0]= b[0]/c[0];a[1]=b[1]/c[1];return a};a.div=a.divide;a.min=function(a,b,c){a[0]=Math.min(b[0],c[0]);a[1]=Math.min(b[1],c[1]);return a};a.max=function(a,b,c){a[0]=Math.max(b[0],c[0]);a[1]=Math.max(b[1],c[1]);return a};a.scale=function(a,b,c){a[0]=b[0]*c;a[1]=b[1]*c;return a};a.scaleAndAdd=function(a,b,c,k){a[0]=b[0]+c[0]*k;a[1]=b[1]+c[1]*k;return a};a.distance=function(a,b){var c=b[0]-a[0];a=b[1]-a[1];return Math.sqrt(c*c+a*a)};a.dist=a.distance;a.squaredDistance=function(a,b){var c=b[0]-a[0];a=b[1]- a[1];return c*c+a*a};a.sqrDist=a.squaredDistance;a.length=function(a){var b=a[0];a=a[1];return Math.sqrt(b*b+a*a)};a.len=a.length;a.squaredLength=function(a){var b=a[0];a=a[1];return b*b+a*a};a.sqrLen=a.squaredLength;a.negate=function(a,b){a[0]=-b[0];a[1]=-b[1];return a};a.inverse=function(a,b){a[0]=1/b[0];a[1]=1/b[1];return a};a.normalize=function(a,b){var c=b[0],d=b[1],c=c*c+d*d;0=b};e.prototype.canZoomOutTo=function(a){var b=this.effectiveMinScale;return 0===b||a<=b};e.prototype.constrain=function(a,b){if(!this.enabled)return a;this._zoom.constrain(a,b);this._rotation.constrain(a,b);return a};e.prototype.fit=function(a){if(!this.enabled||!this.snapToZoom)return a;this._zoom.fit(a);return a};e.prototype.zoomToScale=function(a){return this._zoom.zoomToScale(a)};e.prototype.scaleToZoom= function(a){return this._zoom.scaleToZoom(a)};e.prototype.snapScale=function(a){return this._zoom.snapToClosestScale(a)};e.prototype.snapToNextScale=function(a){return this._zoom.snapToNextScale(a)};e.prototype.snapToPreviousScale=function(a){return this._zoom.snapToPreviousScale(a)};a([c.property({readOnly:!0,aliasOf:"_zoom.effectiveLODs"})],e.prototype,"effectiveLODs",void 0);a([c.property({readOnly:!0,aliasOf:"_zoom.effectiveMinScale"})],e.prototype,"effectiveMinScale",void 0);a([c.property({readOnly:!0, aliasOf:"_zoom.effectiveMaxScale"})],e.prototype,"effectiveMaxScale",void 0);a([c.property({readOnly:!0,aliasOf:"_zoom.effectiveMinZoom"})],e.prototype,"effectiveMinZoom",void 0);a([c.property({readOnly:!0,aliasOf:"_zoom.effectiveMaxZoom"})],e.prototype,"effectiveMaxZoom",void 0);a([c.property()],e.prototype,"enabled",void 0);a([c.property({type:[k]})],e.prototype,"lods",void 0);a([c.property()],e.prototype,"minScale",void 0);a([c.property()],e.prototype,"maxScale",void 0);a([c.property()],e.prototype, "minZoom",void 0);a([c.property()],e.prototype,"maxZoom",void 0);a([c.property()],e.prototype,"rotationEnabled",void 0);a([c.property()],e.prototype,"snapToZoom",void 0);a([c.property()],e.prototype,"view",void 0);a([c.property({type:f,dependsOn:["rotationEnabled"]})],e.prototype,"_rotation",null);a([c.property({dependsOn:["view.spatialReference","view.defaultsFromMap.tileInfo"]})],e.prototype,"_defaultLODs",null);a([c.property({readOnly:!0,type:l,dependsOn:"lods minZoom maxZoom minScale maxScale snapToZoom _defaultLODs".split(" ")})], e.prototype,"_zoom",null);return e=a([c.subclass("esri.views.2d.MapViewConstraints")],e)}(c.declared(e,d))})},"esri/views/2d/constraints/RotationConstraint":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/accessorSupport/decorators".split(" "),function(p,g,b,a,e,d){return function(c){function e(){var a=null!==c&&c.apply(this,arguments)||this;a.enabled=!0;a.rotationEnabled=!0;return a}b(e,c); f=e;e.prototype.constrain=function(a,b){if(!this.enabled||!b)return a;this.rotationEnabled||(a.rotation=b.rotation);return a};e.prototype.clone=function(){return new f({enabled:this.enabled,rotationEnabled:this.rotationEnabled})};a([d.property()],e.prototype,"enabled",void 0);a([d.property()],e.prototype,"rotationEnabled",void 0);return e=f=a([d.subclass("esri.views.2d.constraints.RotationConstraint")],e);var f}(d.declared(e))})},"esri/views/2d/constraints/ZoomConstraint":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/Accessor ../../../core/accessorSupport/decorators ../../../layers/support/LOD".split(" "), function(p,g,b,a,e,d,c){return function(e){function f(){var a=null!==e&&e.apply(this,arguments)||this;a._lodByScale={};a._scales=[];a.effectiveLODs=null;a.effectiveMinZoom=-1;a.effectiveMaxZoom=-1;a.effectiveMinScale=0;a.effectiveMaxScale=0;a.enabled=!0;a.lods=null;a.minZoom=-1;a.maxZoom=-1;a.minScale=0;a.maxScale=0;a.snapToZoom=!0;return a}b(f,e);k=f;f.prototype.initialize=function(){var a=this,b=this.lods,c=this.minScale,d=this.maxScale,e=this.minZoom,f=this.maxZoom,k=-1,l=-1,g=!1,B=!1;0!==c&&0!== d&&c=p.scale&&(k=p.level,g=!0);!B&&0=p.scale&&(l=w?w.level:-1,B=!0);w=p}-1===e&&(e=0===c?0:k);-1===f&&(f=0===d?b.length-1:l);e=Math.max(e,0);e=Math.min(e,b.length-1);f=Math.max(f,0);f=Math.min(f,b.length-1);e>f&&(c=[f,e],e=c[0],f=c[1]);c=b[e].scale;d=b[f].scale;b.splice(0, e);b.splice(f-e+1,b.length);b.forEach(function(b,c){a._lodByScale[b.scale]=b;a._scales[c]=b.scale});this._set("effectiveLODs",b);this._set("effectiveMinZoom",e);this._set("effectiveMaxZoom",f)}this._set("effectiveMinScale",c);this._set("effectiveMaxScale",d)};f.prototype.constrain=function(a,b){if(!this.enabled||b&&a.scale===b.scale)return a;var c=this.effectiveMinScale,d=this.effectiveMaxScale,e=a.targetGeometry,f=b&&b.targetGeometry,h=0!==c&&a.scale>c;if(0!==d&&a.scale=a)return b[0];if(a>=b.length)return b[b.length-1];var c=Math.round(a);return b[c]+(c-a)*(b[Math.round(a-.5)]-b[c])};f.prototype.scaleToZoom=function(a){if(!this.effectiveLODs)return-1;var b=this._scales,c=0,d=b.length-1,e,f;for(c;ca&&fc)return null;var d=h.clone(this.screenCenter),e=l.fromTranslation(l.create(),d);l.rotate(e,e,b);h.negate(d,d);l.translate(e,e,d);h.transformMat2d(d,this.paddedScreenCenter,e);return{top:-Math.round(c),left:Math.round(d[0]-.5*a),right:Math.round(d[0]+.5*a),bottom:+Math.round(c)}},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"padding", {set:function(a){this._set("padding",a||new n);this._updateContent()},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"size",{set:function(a){this._set("size",a);this._updateContent()},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"paddedScreenCenter",{get:function(){var a=this.content.size,b=this.padding,a=h.scale(h.create(),a,.5);a[0]+=b.left;a[1]+=b.top;return a},enumerable:!0,configurable:!0});Object.defineProperty(m.prototype,"viewpoint",{set:function(a){var b= a.clone();this.content.viewpoint=a;c.addPadding(b,a,this._get("size"),this._get("padding"));this._set("viewpoint",c.addPadding(b.clone(),a,this._get("size"),this._get("padding")))},enumerable:!0,configurable:!0});m.prototype._updateContent=function(){var a=h.create(),b=this._get("size"),c=this._get("padding");if(b&&c){var d=this.content;h.set(a,c.left+c.right,c.top+c.bottom);h.subtract(a,b,a);d.size=a;if(a=d.viewpoint)this.viewpoint=a}};a([d.shared({transform:{dependsOn:["padding"]}})],m.prototype, "properties",void 0);a([d.property({dependsOn:["worldScreenWidth","rotation","paddedScreenCenter","screenCenter"],readOnly:!0})],m.prototype,"clipRect",null);a([d.property()],m.prototype,"content",void 0);a([d.property({type:n})],m.prototype,"padding",null);a([d.property()],m.prototype,"size",null);a([d.property({dependsOn:["size","padding"],readOnly:!0})],m.prototype,"paddedScreenCenter",null);a([d.property()],m.prototype,"viewpoint",null);return m=a([d.subclass("esri.views.2d.PaddedViewState")], m)}(d.declared(k))})},"esri/views/2d/ViewState":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../Viewpoint ../../core/JSONSupport ../../core/accessorSupport/decorators ../../geometry/Extent ./viewpointUtils ./libs/gl-matrix/mat2d ./libs/gl-matrix/vec2".split(" "),function(p,g,b,a,e,d,c,k,f,l,h){var n=[0,0];return function(d){function m(){for(var a=[],b=0;b=this.numChildren?this.children.push(a):this.children.splice(b,0,a);this._childrenSet.add(a);b=this._childrenToDetach.indexOf(a);-1=e.RENDERING&&this.requestRender();return a};c.prototype.contains=function(a){return this._childrenSet.has(a)};c.prototype.getChildIndex=function(a){return this.children.indexOf(a)}; c.prototype.getChildAt=function(a){return 0>a||a>this.children.length?null:this.children[a]};c.prototype.removeAllChildren=function(){for(var a=this.numChildren;a--;)this.removeChildAt(0)};c.prototype.removeChild=function(a){return this.contains(a)?this.removeChildAt(this.getChildIndex(a)):a};c.prototype.removeChildAt=function(a){if(0>a||a>=this.children.length)return null;a=this.children.splice(a,1)[0];this._childrenSet["delete"](a);if(a.attached)this._childrenToDetach.push(a),this._renderPhase>= e.RENDERING&&this.requestRender();else{var b=this._childrenToAttach.indexOf(a);-1=e.RENDERING&&this.requestRender()};c.prototype.setChildIndex=function(a,b){var c=this.getChildIndex(a);-1=e.RENDERING&&this.requestRender())};c.prototype.sortChildren=function(a){this._renderPhase>e.RENDERING&&this.requestRender(); return this.children.sort(a)};c.prototype.attachChildren=function(a){var b=this._childrenToAttach;if(0!==b.length)for(var c=0,d=!1;!d;)d=b[c],this.attachChild(d,a)?(d.attached=!0,d.parent=this,b.splice(c,1)):++c,d=b.length===c};c.prototype.renderChildren=function(a){for(var b=this.children,c=b.length,d=0;d=k?k:255,g[h+1]=255>=d?d:255,g[h+2]=255>=e?e:255);q.putImageData(t,0,0);q=B[b.format?b.format.toLowerCase():"png"];g=1;void 0!==b.quality&&(g=b.quality/100);b=c.toDataURL(q,g); return a.resolve({dataURL:b,x:0,y:0,width:m,height:r})};g.prototype.prepareChildrenRenderParameters=function(a){if(!this.attached||!this._renderingContext)return null;a=v(a);var b=this._renderingContext,c=b.gl;b.setDepthWriteEnabled(!0);b.setStencilWriteMask(255);b.setClearColor(0,0,0,0);b.setClearDepth(1);b.setClearStencil(0);b.clear(c.COLOR_BUFFER_BIT|c.DEPTH_BUFFER_BIT|c.STENCIL_BUFFER_BIT);b.setViewport(0,0,this.element.width,this.element.height);b.setDepthWriteEnabled(!1);a.context=b;a.painter= this._painter;return a};g.prototype.attachChild=function(a,b){return a.attach(b)};g.prototype.detachChild=function(a,b){return a.detach(b)};g.prototype.renderChild=function(a,b){return a.processRender(b)};g.prototype._resizeCanvas=function(a){var b=this.element,c=b.style,d=a.state,e=a.pixelRatio;a=Math.round(d.width*e);e=Math.round(d.height*e);if(b.width!==a||b.height!==e)b.width=a,b.height=e;c.width=d.width+"px";c.height=d.height+"px"};g.prototype._initializeClipRenderer=function(a){if(this._clipRendererInitialized)return!0; this._blitRenderer=new d;var b={a_pos:0},c=new q(a,k.stencilVS,k.stencilFS,b);if(!c)return!1;var e=r.createVertex(a,35040,32),f=new Uint16Array([0,1,2,2,1,3]),f=r.createIndex(a,35044,f);a=new x(a,b,{geometry:[{name:"a_pos",count:2,type:5126,offset:0,stride:8,normalized:!1,divisor:0}]},{geometry:e},f);this._clipStencilProgram=c;this._clipVBO=e;this._clipVAO=a;return this._clipRendererInitialized=!0};return g}(e)})},"esri/views/2d/engine/webgl/BitBlitRenderer":function(){define("require exports ./shaders/glShaderSnippets ../../../webgl/BufferObject ../../../webgl/Program ../../../webgl/VertexArrayObject".split(" "), function(p,g,b,a,e,d){return function(){function c(){this._initialized=!1}c.prototype.render=function(a,b,c,d){a&&(this._initialized||this._initialize(a),a.setBlendFunctionSeparate(1,771,1,771),a.bindVAO(this._vertexArrayObject),a.bindProgram(this._program),b.setSamplingMode(c),a.bindTexture(b,0),this._program.setUniform1i("u_tex",0),this._program.setUniform1f("u_opacity",d),a.drawArrays(5,0,4),a.bindVAO())};c.prototype._initialize=function(c){if(this._initialized)return!0;var f={a_pos:0,a_tex:1}, k=new e(c,b.bitblitVS,b.bitblitFS,f);if(!k)return!1;var h=new Int8Array(16);h[0]=-1;h[1]=-1;h[2]=0;h[3]=0;h[4]=1;h[5]=-1;h[6]=1;h[7]=0;h[8]=-1;h[9]=1;h[10]=0;h[11]=1;h[12]=1;h[13]=1;h[14]=1;h[15]=1;c=new d(c,f,{geometry:[{name:"a_pos",count:2,type:5120,offset:0,stride:4,normalized:!1,divisor:0},{name:"a_tex",count:2,type:5120,offset:2,stride:4,normalized:!1,divisor:0}]},{geometry:a.createVertex(c,35044,h)});this._program=k;this._vertexArrayObject=c;return this._initialized=!0};return c}()})},"esri/views/2d/engine/webgl/shaders/glShaderSnippets":function(){define("require exports dojo/text!./backgroundShaders.xml dojo/text!./bitblitShaders.xml dojo/text!./stencilShaders.xml dojo/text!./tileInfo.xml ../../../../webgl/ShaderSnippets".split(" "), function(p,g,b,a,e,d,c){p=new c;c.parse(b,p);c.parse(a,p);c.parse(e,p);c.parse(d,p);return p})},"esri/views/webgl/ShaderSnippets":function(){define(["require","exports","dojox/xml/parser"],function(p,g,b){return function(){function a(a){if(a)for(var b in a)this[b]=a[b]}a.parse=function(a,d){a=b.parse(a).getElementsByTagName("snippet");for(var c=/\$[a-zA-Z][a-zA-Z0-9]*(?:\([^\(\)]*\))?[ \t]*/,e=/[\$\s]+/g,f=/\(([^\(\)]*)\)/,l=0;la&&console.error("Buffer size cannot be negative!"),34963===this._bufferType&&b)switch(this._indexType=b,this._size=a,b){case 5123:a*=2;break;case 5125:a*=4}}else b=a.byteLength,a instanceof Uint16Array&&(b/=2,this._indexType=5123),a instanceof Uint32Array&&(b/=4,this._indexType=5125),this._size=b;b=this._context.getBoundVAO();this._context.bindVAO(null); this._context.bindBuffer(this);this._context.gl.bufferData(this._bufferType,a,this._usage);this._context.bindVAO(b)}};b.prototype.setSubData=function(a,b,d,c){void 0===b&&(b=0);void 0===d&&(d=0);if(a){(0>b||b>=this._size)&&console.error("offset is out of range!");var e=b,f=d,l=c,h=a.byteLength;a instanceof Uint16Array&&(h/=2,e*=2,f*=2,l*=2);a instanceof Uint32Array&&(h/=4,e*=4,f*=4,l*=4);void 0===c&&(c=h-1);d>=c&&console.error("end must be bigger than start!");b+d-c>this._size&&console.error("An attempt to write beyond the end of the buffer!"); b=this._context.getBoundVAO();this._context.bindVAO(null);this._context.bindBuffer(this);this._context.gl.bufferSubData(this._bufferType,e,(a instanceof ArrayBuffer?a:a.buffer).slice(f,l));this._context.bindVAO(b)}};b._nextId=0;return b}()})},"esri/views/webgl/Program":function(){define(["require","exports","dojo/has","./ShaderTranspiler"],function(p,g,b,a){return function(){function b(a,c,e,f,l){void 0===l&&(l={});this._glName=this._context=null;this._locations={};this._id=void 0;this._initialized= !1;this._fShader=this._vShader=null;this._defines={};this._nameToUniformLocation={};this._nameToAttribLocation={};this._nameToUniform1={};this._nameToUniform2={};this._nameToUniform3={};this._nameToUniform4={};this._nameToUniformMatrix3={};this._nameToUniformMatrix4={};a||console.error("RenderingContext isn't initialized!");0===c.length&&console.error("Shaders source should not be empty!");this._context=a;this._vertexShaderSource=c;this._fragmentShaderSource=e;if(Array.isArray(l))for(a=0;aa&&(b=(" "+a).slice(-3));return b};b.prototype._addLineNumbers=function(a){var c=2;return a.replace(/\n/g,function(){return"\n"+b._padToThree(c++)+":"})}; b.prototype._loadShader=function(b){var c=35633===b,d=c?this._vertexShaderSource:this._fragmentShaderSource,e;e="";for(var l in this._defines)e+="#define "+l+" "+this._defines[l]+"\n";e+=d;"webgl2"===this._context.contextVersion&&(e=a.transpileShader(e,c?"vertex":"fragment"));c=this._context.gl;b=c.createShader(b);c.shaderSource(b,e);c.compileShader(b);c.getShaderParameter(b,c.COMPILE_STATUS)||(console.error(c.getShaderInfoLog(b)),console.error(this._addLineNumbers(e)),"webgl2"===this._context.contextVersion&& (console.log("Shader source before transpilation:"),console.log(d)));return b};b._matrix4Equal=function(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]&&a[4]===b[4]&&a[5]===b[5]&&a[6]===b[6]&&a[7]===b[7]&&a[8]===b[8]&&a[9]===b[9]&&a[10]===b[10]&&a[11]===b[11]&&a[12]===b[12]&&a[13]===b[13]&&a[14]===b[14]&&a[15]===b[15]};b._matrix3Equal=function(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]&&a[4]===b[4]&&a[5]===b[5]&&a[6]===b[6]&&a[7]===b[7]&&a[8]===b[8]};b._arraysEqual= function(a,b){if(a.length!==b.length)return!1;for(var c=0;c=f.count){if(k.enableVertexAttribArray(r),k.vertexAttribPointer(r,f.count,f.type,f.normalized,f.stride,f.offset+m),f.divisor&&0q;q++)k.enableVertexAttribArray(r+q),k.vertexAttribPointer(r+q,4,f.type,f.normalized,f.stride,f.offset+16*q+m),f.divisor&&0a.bounds[2]||h[0]a.bounds[3])}).length)return[];k=a.context;this._hittestFBO||(this._hittestFBO=t.create(k,{colorTarget:0,depthStencilTarget:3,width:c,height:c}));var l=k.getViewport(),m=k.getBoundFramebufferObject();k.bindFramebuffer(this._hittestFBO); k.setViewport(0,0,c,c);this._drawClippingRects(a,b);var n=k.gl;k.setClearColor(1,1,1,1);k.clear(n.COLOR_BUFFER_BIT);k.setBlendingEnabled(!1);k.setStencilWriteMask(0);this._drawPhases(a,b,[d.WGLDrawPhase.HITTEST]);k.setBlendingEnabled(!0);this._hittestFBO.readPixels(0,0,c,c,6408,5121,x);a=c*c;b=new Set;for(c=0;ca[5]&a[0]>a[10]?(d=2*Math.sqrt(1+a[0]-a[5]-a[10]),b[3]=(a[6]-a[9])/d,b[0]=.25*d,b[1]=(a[1]+a[4])/d,b[2]=(a[8]+a[2])/d):a[5]>a[10]?(d=2*Math.sqrt(1+a[5]-a[0]-a[10]),b[3]=(a[8]-a[2])/d,b[0]=(a[1]+a[4])/d,b[1]=.25*d,b[2]=(a[6]+a[9])/d):(d=2*Math.sqrt(1+a[10]-a[0]-a[5]),b[3]=(a[1]-a[4])/d,b[0]=(a[8]+a[2])/d,b[1]=(a[6]+a[9])/d,b[2]=.25*d);return b};g.fromRotationTranslationScale=function(b,a,e,d){var c=a[0],k=a[1],f=a[2],l=a[3],h=c+c,n=k+k,r=f+ f;a=c*h;var m=c*n,c=c*r,g=k*n,k=k*r,f=f*r,h=l*h,n=l*n,l=l*r,r=d[0],q=d[1];d=d[2];b[0]=(1-(g+f))*r;b[1]=(m+l)*r;b[2]=(c-n)*r;b[3]=0;b[4]=(m-l)*q;b[5]=(1-(a+f))*q;b[6]=(k+h)*q;b[7]=0;b[8]=(c+n)*d;b[9]=(k-h)*d;b[10]=(1-(a+g))*d;b[11]=0;b[12]=e[0];b[13]=e[1];b[14]=e[2];b[15]=1;return b};g.fromRotationTranslationScaleOrigin=function(b,a,e,d,c){var k=a[0],f=a[1],l=a[2],h=a[3],n=k+k,r=f+f,m=l+l;a=k*n;var g=k*r,k=k*m,q=f*r,f=f*m,l=l*m,n=h*n,r=h*r,h=h*m,m=d[0],t=d[1];d=d[2];var x=c[0],v=c[1];c=c[2];b[0]=(1- (q+l))*m;b[1]=(g+h)*m;b[2]=(k-r)*m;b[3]=0;b[4]=(g-h)*t;b[5]=(1-(a+l))*t;b[6]=(f+n)*t;b[7]=0;b[8]=(k+r)*d;b[9]=(f-n)*d;b[10]=(1-(a+q))*d;b[11]=0;b[12]=e[0]+x-(b[0]*x+b[4]*v+b[8]*c);b[13]=e[1]+v-(b[1]*x+b[5]*v+b[9]*c);b[14]=e[2]+c-(b[2]*x+b[6]*v+b[10]*c);b[15]=1;return b};g.fromQuat=function(b,a){var e=a[0],d=a[1],c=a[2];a=a[3];var k=e+e,f=d+d,l=c+c,e=e*k,h=d*k,d=d*f,n=c*k,r=c*f,c=c*l,k=a*k,f=a*f;a*=l;b[0]=1-d-c;b[1]=h+a;b[2]=n-f;b[3]=0;b[4]=h-a;b[5]=1-e-c;b[6]=r+k;b[7]=0;b[8]=n+f;b[9]=r-k;b[10]=1- e-d;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return b};g.frustum=function(b,a,e,d,c,k,f){var l=1/(e-a),h=1/(c-d),n=1/(k-f);b[0]=2*k*l;b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=2*k*h;b[6]=0;b[7]=0;b[8]=(e+a)*l;b[9]=(c+d)*h;b[10]=(f+k)*n;b[11]=-1;b[12]=0;b[13]=0;b[14]=f*k*2*n;b[15]=0;return b};g.perspective=function(b,a,e,d,c){a=1/Math.tan(a/2);var k=1/(d-c);b[0]=a/e;b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=a;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=(c+d)*k;b[11]=-1;b[12]=0;b[13]=0;b[14]=2*c*d*k;b[15]=0;return b};g.perspectiveFromFieldOfView= function(b,a,e,d){var c=Math.tan(a.upDegrees*Math.PI/180),k=Math.tan(a.downDegrees*Math.PI/180),f=Math.tan(a.leftDegrees*Math.PI/180);a=Math.tan(a.rightDegrees*Math.PI/180);var l=2/(f+a),h=2/(c+k);b[0]=l;b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=h;b[6]=0;b[7]=0;b[8]=-((f-a)*l*.5);b[9]=(c-k)*h*.5;b[10]=d/(e-d);b[11]=-1;b[12]=0;b[13]=0;b[14]=d*e/(e-d);b[15]=0;return b};g.ortho=function(b,a,e,d,c,k,f){var l=1/(a-e),h=1/(d-c),n=1/(k-f);b[0]=-2*l;b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=-2*h;b[6]=0;b[7]=0;b[8]=0;b[9]= 0;b[10]=2*n;b[11]=0;b[12]=(a+e)*l;b[13]=(c+d)*h;b[14]=(f+k)*n;b[15]=1;return b};g.lookAt=function(b,a,e,d){var c,k,f,l,h,n,r,m,u=a[0],q=a[1];a=a[2];f=d[0];l=d[1];k=d[2];r=e[0];d=e[1];c=e[2];if(Math.abs(u-r)=b&&a<=c||a>=c&&a<=b}})},"esri/views/2d/engine/webgl/MaterialManager":function(){define("require exports ./enums ./MaterialInfoUtils ./shaders/fillShaderSnippets ./shaders/iconShaderSnippets ./shaders/lineShaderSnippets ./shaders/textShaderSnippets ../../../webgl/ShaderVariations".split(" "), function(p,g,b,a,e,d,c,k,f){return function(){function l(){this._programRep=new Map;this.isInitialize=!1}l.prototype.initialize=function(a){if(!this.isInitialize){var b=new f("text",["textVS","textFS"],[],k,a);b.addDefine("ID","ID",[!0,!0],"ID");b.addDefine("HIGHLIGHT","HIGHLIGHT",[!1,!1],"HIGHLIGHT");b.addDefine("SDF","SDF",[!1,!1],"SDF");b.addDefine("VV_SIZE_MIN_MAX_VALUE","VV_SIZE_MIN_MAX_VALUE",[!0,!1],"VV_SIZE_MIN_MAX_VALUE");b.addDefine("VV_SIZE_SCALE_STOPS","VV_SIZE_SCALE_STOPS",[!0,!1],"VV_SIZE_SCALE_STOPS"); b.addDefine("VV_SIZE_FIELD_STOPS","VV_SIZE_FIELD_STOPS",[!0,!1],"VV_SIZE_FIELD_STOPS");b.addDefine("VV_SIZE_UNIT_VALUE","VV_SIZE_UNIT_VALUE",[!0,!1],"VV_SIZE_UNIT_VALUE");b.addDefine("VV_COLOR","VV_COLOR",[!0,!1],"VV_COLOR");b.addDefine("VV_ROTATION","VV_ROTATION",[!0,!1],"VV_ROTATION");b.addDefine("VV_OPACITY","VV_OPACITY",[!0,!1],"VV_OPACITY");b.addDefine("VERTEX_VISIBILITY","VERTEX_VISIBILITY",[!1,!1],"VERTEX_VISIBILITY");b.addDefine("PATTERN","PATTERN",[!1,!1],"PATTERN");b.addDefine("HEATMAP", "HEATMAP",[!1,!1],"HEATMAP");var h=new f("icon",["iconVS","iconFS"],[],d,a);h.addDefine("ID","ID",[!0,!0],"ID");h.addDefine("HIGHLIGHT","HIGHLIGHT",[!0,!0],"HIGHLIGHT");h.addDefine("SDF","SDF",[!0,!0],"SDF");h.addDefine("VV_SIZE_MIN_MAX_VALUE","VV_SIZE_MIN_MAX_VALUE",[!0,!1],"VV_SIZE_MIN_MAX_VALUE");h.addDefine("VV_SIZE_SCALE_STOPS","VV_SIZE_SCALE_STOPS",[!0,!1],"VV_SIZE_SCALE_STOPS");h.addDefine("VV_SIZE_FIELD_STOPS","VV_SIZE_FIELD_STOPS",[!0,!1],"VV_SIZE_FIELD_STOPS");h.addDefine("VV_SIZE_UNIT_VALUE", "VV_SIZE_UNIT_VALUE",[!0,!1],"VV_SIZE_UNIT_VALUE");h.addDefine("VV_COLOR","VV_COLOR",[!0,!1],"VV_COLOR");h.addDefine("VV_ROTATION","VV_ROTATION",[!0,!1],"VV_ROTATION");h.addDefine("VV_OPACITY","VV_OPACITY",[!0,!1],"VV_OPACITY");h.addDefine("VERTEX_VISIBILITY","VERTEX_VISIBILITY",[!1,!1],"VERTEX_VISIBILITY");h.addDefine("PATTERN","PATTERN",[!0,!0],"PATTERN");h.addDefine("HEATMAP","HEATMAP",[!0,!0],"HEATMAP");var l=new f("fill",["fillVS","fillFS"],[],e,a);l.addDefine("ID","ID",[!0,!0],"ID");l.addDefine("HIGHLIGHT", "HIGHLIGHT",[!0,!0],"HIGHLIGHT");l.addDefine("SDF","SDF",[!1,!1],"SDF");l.addDefine("VV_SIZE_MIN_MAX_VALUE","VV_SIZE_MIN_MAX_VALUE",[!1,!1],"VV_SIZE_MIN_MAX_VALUE");l.addDefine("VV_SIZE_SCALE_STOPS","VV_SIZE_SCALE_STOPS",[!1,!1],"VV_SIZE_SCALE_STOPS");l.addDefine("VV_SIZE_FIELD_STOPS","VV_SIZE_FIELD_STOPS",[!1,!1],"VV_SIZE_FIELD_STOPS");l.addDefine("VV_SIZE_UNIT_VALUE","VV_SIZE_UNIT_VALUE",[!1,!1],"VV_SIZE_UNIT_VALUE");l.addDefine("VV_COLOR","VV_COLOR",[!0,!1],"VV_COLOR");l.addDefine("VV_ROTATION", "VV_ROTATION",[!1,!1],"VV_ROTATION");l.addDefine("VV_OPACITY","VV_OPACITY",[!0,!1],"VV_OPACITY");l.addDefine("VERTEX_VISIBILITY","VERTEX_VISIBILITY",[!1,!1],"VERTEX_VISIBILITY");l.addDefine("PATTERN","PATTERN",[!0,!0],"PATTERN");l.addDefine("HEATMAP","HEATMAP",[!1,!1],"HEATMAP");a=new f("line",["lineVS","lineFS"],[],c,a);a.addDefine("ID","ID",[!0,!0],"ID");a.addDefine("HIGHLIGHT","HIGHLIGHT",[!0,!0],"HIGHLIGHT");a.addDefine("SDF","SDF",[!0,!0],"SDF");a.addDefine("VV_SIZE_MIN_MAX_VALUE","VV_SIZE_MIN_MAX_VALUE", [!0,!1],"VV_SIZE_MIN_MAX_VALUE");a.addDefine("VV_SIZE_SCALE_STOPS","VV_SIZE_SCALE_STOPS",[!0,!1],"VV_SIZE_SCALE_STOPS");a.addDefine("VV_SIZE_FIELD_STOPS","VV_SIZE_FIELD_STOPS",[!0,!1],"VV_SIZE_FIELD_STOPS");a.addDefine("VV_SIZE_UNIT_VALUE","VV_SIZE_UNIT_VALUE",[!0,!1],"VV_SIZE_UNIT_VALUE");a.addDefine("VV_COLOR","VV_COLOR",[!0,!1],"VV_COLOR");a.addDefine("VV_ROTATION","VV_ROTATION",[!0,!1],"VV_ROTATION");a.addDefine("VV_OPACITY","VV_OPACITY",[!0,!1],"VV_OPACITY");a.addDefine("VERTEX_VISIBILITY","VERTEX_VISIBILITY", [!1,!1],"VERTEX_VISIBILITY");a.addDefine("PATTERN","PATTERN",[!0,!0],"PATTERN");a.addDefine("HEATMAP","HEATMAP",[!1,!1],"HEATMAP");this._textShaderVariations=b;this._fillShaderVariations=l;this._iconShaderVariations=h;this._lineShaderVariations=a;this.isInitialize=!0}};l.prototype.getProgram=function(c,d,e){c|=d===b.WGLDrawPhase.HITTEST?4:0;c|=d===b.WGLDrawPhase.HIGHLIGHT?8:0;if(this._programRep[c])return this._programRep[c];if(!this._iconShaderVariations||!this._fillShaderVariations||!this._lineShaderVariations)return null; d=a.getMaterialVariations(c);var f;switch(d.geometryType){case b.WGLGeometryType.MARKER:f=this._iconShaderVariations.getProgram(d.variations,null,null,e);break;case b.WGLGeometryType.TEXT:f=this._textShaderVariations.getProgram(d.variations,null,null,e);break;case b.WGLGeometryType.FILL:f=this._fillShaderVariations.getProgram(d.variations,null,null,e);break;case b.WGLGeometryType.LINE:f=this._lineShaderVariations.getProgram(d.variations,null,null,e)}f&&(this._programRep[c]=f);return f};return l}()})}, "esri/views/2d/engine/webgl/MaterialInfoUtils":function(){define(["require","exports","./enums","./MaterialInfo","./MaterialKeyInfo"],function(p,g,b,a,e){function d(a){var b=[];b[0]=a.sdf?!0:!1;b[1]=a.vvSizeMinMaxValue?!0:!1;b[2]=a.vvSizeScaleStops?!0:!1;b[3]=a.vvSizeFieldStops?!0:!1;b[4]=a.vvSizeUnitValue?!0:!1;b[5]=a.vvColor?!0:!1;b[6]=a.vvRotation?!0:!1;b[7]=a.vvOpacity?!0:!1;b[8]=a.visibility?!0:!1;b[9]=a.pattern?!0:!1;b[10]=a.heatmap?!0:!1;return b.reduce(function(a,b,c){b&&(a|=1<>=2;return{geometryType:b,variations:[0!==(a&1),0!==(a&2),0!==(a&4),0!==(a&8),0!==(a&16),0!==(a&32),0!==(a&64),0!==(a&128),0!==(a&256),0!==(a&512),0!==(a&1024),0!==(a&2048),0!==(a&4096)]}}})},"esri/views/2d/engine/webgl/MaterialInfo":function(){define(["require","exports", "./MaterialInfoUtils_updateMaterialVariations","./MaterialKeyInfo","./util/serializationUtils"],function(p,g,b,a,e){Object.defineProperty(g,"__esModule",{value:!0});var d=function(){function a(a,b,c){this.unit=a;this.pageId=b;this.semantic=c}a.prototype.clone=function(){return new a(this.unit,this.pageId,this.semantic)};a.prototype.serialize=function(a){a.writeInt32(this.unit);a.writeInt32(this.pageId);return a};a.deserialize=function(b){var c=b.readInt32();b=b.readInt32();return new a(c,b,"u_texture")}; return a}();g.TexBindingInfo=d;var c=function(){function a(a,b){this.name=a;this.value=b}a.prototype.clone=function(){return new a(this.name,this.value)};a.prototype.serialize=function(a){a.writeInt32(this.value);return a};a.deserialize=function(b){b=b.readInt32();return new a("u_my_param",b)};return a}();g.MaterialParam=c;p=function(){function k(){this.texBindingInfo=[];this.materialParams=[]}k.prototype.copy=function(b){this.materialParams=b.materialParams.map(function(a){return a.clone()});this.texBindingInfo= b.texBindingInfo.map(function(a){return a.clone()});b.materialKeyInfo&&(this.materialKeyInfo=new a,this.materialKeyInfo.copy(b.materialKeyInfo));this.materialKey=b.materialKey};k.prototype.serialize=function(a){a.writeInt32(this.materialKey);e.serializeList(a,this.texBindingInfo);e.serializeList(a,this.materialParams);return a};k.deserialize=function(f){var l=new k;l.materialKey=f.readInt32();l.texBindingInfo=e.deserializeList(f,d);l.materialParams=e.deserializeList(f,c);l.materialKeyInfo=new a;b(l.materialKeyInfo, l.materialKey);return l};return k}();g.default=p})},"esri/views/2d/engine/webgl/MaterialInfoUtils_updateMaterialVariations":function(){define(["require","exports"],function(p,g){return function(b,a){b.geometryType=a&3;a>>=2;b.sdf=0!==(a&4);b.vvSizeMinMaxValue=0!==(a&8);b.vvSizeScaleStops=0!==(a&16);b.vvSizeFieldStops=0!==(a&32);b.vvSizeUnitValue=0!==(a&64);b.vvColor=0!==(a&128);b.vvRotation=0!==(a&256);b.vvOpacity=0!==(a&512);b.visibility=0!==(a&1024);b.pattern=0!==(a&2048);b.heatmap=0!==(a&4096); return b}})},"esri/views/2d/engine/webgl/MaterialKeyInfo":function(){define(["require","exports"],function(p,g){return function(){function b(){this.heatmap=this.pattern=this.visibility=this.vvOpacity=this.vvRotation=this.vvColor=this.vvSizeUnitValue=this.vvSizeFieldStops=this.vvSizeScaleStops=this.vvSizeMinMaxValue=this.sdf=!1}b.prototype.copy=function(a){this.geometryType=a.geometryType;this.sdf=a.sdf;this.vvSizeMinMaxValue=a.vvSizeMinMaxValue;this.vvSizeScaleStops=a.vvSizeScaleStops;this.vvSizeFieldStops= a.vvSizeFieldStops;this.vvSizeUnitValue=a.vvSizeUnitValue;this.vvColor=a.vvColor;this.vvRotation=a.vvRotation;this.vvOpacity=a.vvOpacity;this.visibility=a.visibility;this.pattern=a.pattern;this.heatmap=a.heatmap};return b}()})},"esri/views/2d/engine/webgl/util/serializationUtils":function(){define(["require","exports"],function(p,g){Object.defineProperty(g,"__esModule",{value:!0});g.serializeList=function(b,a){if(null===a)b.writeInt32(0);else{b.writeInt32(a.length);for(var e=0;er;r++)n.affectsShaderTypes[r]&&(n.shaderSnippetSuffixes&&(e[r]+=n.shaderSnippetSuffixes[m],f[r]+=n.shaderSnippetSuffixes[m]),n.defineStr&&m&&(l.push(n.defineStr),f[r]+=n.shaderNameSuffixes))}return{programName:c,shaderSnippetNames:e,shaderNames:f,defines:l}};return e}()})},"esri/views/webgl/Util":function(){define(["require","exports","../../core/tsSupport/assignHelper", "../../core/Error"],function(p,g,b,a){return function(){function e(){}e.vertexCount=function(a,b){return a.vertexBuffers[b].size/e.getStride(a.layout[b])};e.getStride=function(a){return a[0].stride};e.getBytesPerElement=function(a){switch(a){case 5126:return 4;case 5124:return 4;case 5125:return 4;case 5122:return 2;case 5123:return 2;case 5120:return 1;case 5121:return 1;default:throw Error("Unknown data type");}};e.addDescriptor=function(a,b,k,f,l,h){var c=e.getBytesPerElement(f);if(0>1;a|=a>>2;a|=a>>4;a|=a>>8;a|=a>>16;a++;return a};g.toUint32= function(e){b[0]=e;return a[0]};g.i1616to32=function(a,b){return 65535&a|b<<16};g.i8888to32=function(a,b,c,k){return a&255|(b&255)<<8|(c&255)<<16|k<<24};g.i8816to32=function(a,b,c){return a&255|(b&255)<<8|c<<16};g.numTo32=function(a){return a|0}})},"esri/views/2d/engine/webgl/SymbolProperties":function(){define(["require","exports","../../../../core/ObjectPool"],function(p,g,b){Object.defineProperty(g,"__esModule",{value:!0});p=function(){function a(){this.color=[0,0,0,0];this.haloColor=[0,0,0,0]; this.haloSize=0;this.size=12;this.vAnchor=this.hAnchor=this.offsetY=this.offsetX=this.angle=0}a.prototype.acquire=function(a,b,c,k,f,l,h,n,r){this.color=a;this.haloColor=b;this.haloSize=c;this.size=k;this.angle=f;this.offsetX=l;this.offsetY=h;this.hAnchor=n;this.vAnchor=r};a.prototype.release=function(){this.color[0]=this.color[1]=this.color[2]=this.color[3]=0;this.vAnchor=this.hAnchor=this.offsetY=this.offsetX=this.angle=this.size=this.haloSize=this.haloColor[0]=this.haloColor[1]=this.haloColor[2]= this.haloColor[3]=0};a.pool=new b(a);return a}();g.TextProperties=p})},"esri/views/2d/engine/webgl/brushes/WGLBrushInfo":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../GeometryUtils ./WGLBrush ../shaders/glShaderSnippets ../../../../webgl/BufferObject ../../../../webgl/Program ../../../../webgl/Texture ../../../../webgl/VertexArrayObject".split(" "),function(p,g,b,a,e,d,c,k,f,l){Object.defineProperty(g,"__esModule",{value:!0});p=function(e){function h(){var a=e.call(this)|| this;a._initialized=!1;a._maxWidth=0;a._color=new Float32Array([1,0,0,1]);return a}b(h,e);h.prototype.draw=function(a,b){a=a.context;this._initialized||this._initialize(a);a.bindVAO(this._outlineVertexArrayObject);a.bindProgram(this._outlineProgram);this._outlineProgram.setUniformMatrix4fv("u_transformMatrix",b.tileTransform.transform);this._outlineProgram.setUniform2fv("u_normalized_origin",b.tileTransform.displayCoord);this._outlineProgram.setUniform1f("u_coord_range",512);this._outlineProgram.setUniform1f("u_depth", 0);this._outlineProgram.setUniform4fv("u_color",this._color);a.setLineWidth(2);a.drawArrays(3,0,4);a.bindVAO();var c=this._getTexture(a,b);c&&(a.bindVAO(this._tileInfoVertexArrayObject),a.bindProgram(this._tileInfoProgram),a.bindTexture(c,0),this._tileInfoProgram.setUniformMatrix4fv("u_transformMatrix",b.tileTransform.transform),this._tileInfoProgram.setUniform2fv("u_normalized_origin",b.tileTransform.displayCoord),this._tileInfoProgram.setUniform1f("u_depth",0),this._tileInfoProgram.setUniform1f("u_coord_ratio", 1),this._tileInfoProgram.setUniform2f("u_delta",8,8),this._tileInfoProgram.setUniform2f("u_dimensions",c.descriptor.width,c.descriptor.height),a.drawArrays(5,0,4),a.bindVAO())};h.prototype._initialize=function(a){if(this._initialized)return!0;var b={a_pos:0},e=new k(a,d.backgroundVS,d.backgroundFS,b),f=new k(a,d.tileInfoVS,d.tileInfoFS,b),h={geometry:[{name:"a_pos",count:2,type:5120,offset:0,stride:2,normalized:!1,divisor:0}]},n=new Int8Array([0,0,1,0,1,1,0,1]),n=c.createVertex(a,35044,n),n=new l(a, b,h,{geometry:n}),r=new Int8Array([0,0,1,0,0,1,1,1]),r=c.createVertex(a,35044,r);a=new l(a,b,h,{geometry:r});this._outlineProgram=e;this._tileInfoProgram=f;this._outlineVertexArrayObject=n;this._tileInfoVertexArrayObject=a;return this._initialized=!0};h.prototype._getTexture=function(b,c){if(c.texture)return c.texture;this._canvas||(this._canvas=document.createElement("canvas"),this._canvas.setAttribute("id","canvas2d"),this._canvas.setAttribute("width","256"),this._canvas.setAttribute("height","32"), this._canvas.setAttribute("style","display:none"));var d=c.key.id,e=this._canvas.getContext("2d");e.font="24px sans-serif";e.textAlign="left";e.textBaseline="middle";var h=e.measureText(d),h=Math.pow(2,Math.ceil(a.log2(h.width+2)));h>this._maxWidth&&(this._maxWidth=h);e.clearRect(0,0,this._maxWidth,32);e.fillStyle="blue";e.fillText(d,0,16);c.texture=new f(b,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728},this._canvas);return c.texture};return h}(e.default);g.default=p})},"esri/views/2d/engine/webgl/brushes/WGLBrush":function(){define(["require", "exports"],function(p,g){Object.defineProperty(g,"__esModule",{value:!0});p=function(){return function(){}}();g.default=p})},"esri/views/webgl/Texture":function(){define(["require","exports"],function(p,g){return function(){function b(a,e,d){this._glName=this._context=null;this._id=-1;this._desc=void 0;this._wrapModeDirty=this._samplingModeDirty=!1;this._boundToUnits=new Set;this._context=a;this._desc={pixelFormat:e.pixelFormat,internalFormat:e.internalFormat,dataType:e.dataType,target:e.target?e.target: 3553,samplingMode:e.samplingMode?e.samplingMode:9729,wrapMode:e.wrapMode?e.wrapMode:10497,maxAnisotropy:e.maxAnisotropy,flipped:void 0!==e.flipped?e.flipped:!1,hasMipmap:void 0!==e.hasMipmap?e.hasMipmap:!1,level:void 0!==e.level?e.level:0,unpackAlignment:e.unpackAlignment?e.unpackAlignment:4,width:e.width,height:e.height,preMultiplyAlpha:void 0!==e.preMultiplyAlpha?e.preMultiplyAlpha:!1};this._id=++b._nextId;this.setData(d)}Object.defineProperty(b.prototype,"id",{get:function(){return this._id},enumerable:!0, configurable:!0});Object.defineProperty(b.prototype,"glName",{get:function(){return this._glName},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"descriptor",{get:function(){return this._desc},enumerable:!0,configurable:!0});b.prototype.dispose=function(){var a=this;if(this._context){if(this._glName){var b=this._context.gl;this._boundToUnits.forEach(function(b){a._context.bindTexture(null,b)});b.deleteTexture(this._glName);this._glName=null}this._context=null}};b.prototype.resize= function(a,b){var d=this._desc;if(d.width!==a||d.height!==b)d.width=a,d.height=b,this.setData(null)};b.prototype.setData=function(a){var e=this._context.gl;this._glName||(this._glName=e.createTexture());void 0===a&&(a=null);null===a&&(this._desc.width=this._desc.width||4,this._desc.height=this._desc.height||4);var d=this._context.getBoundTexture(0);this._context.bindTexture(this,0);var c=this._desc;b._validateTexture(c);e.pixelStorei(e.UNPACK_ALIGNMENT,c.unpackAlignment);e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, c.flipped?1:0);e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,c.preMultiplyAlpha);if(a instanceof ImageData||a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement)c.width&&c.height&&console.assert(a.width===c.width&&a.height===c.height),e.texImage2D(e.TEXTURE_2D,c.level,c.internalFormat?c.internalFormat:c.pixelFormat,c.pixelFormat,c.dataType,a),void 0===this._desc.width&&(this._desc.width=a.width),void 0===this._desc.height&&(this._desc.height=a.height);else{null!= c.width&&null!=c.height||console.error("Width and height must be specified!");var k=c.internalFormat?c.internalFormat:c.pixelFormat,f=c.pixelFormat;e.DEPTH24_STENCIL8&&k===e.DEPTH_STENCIL&&(k=e.DEPTH24_STENCIL8);e.texImage2D(e.TEXTURE_2D,c.level,k,c.width,c.height,0,f,c.dataType,a)}c.hasMipmap&&this.generateMipmap();b._applySamplingMode(e,this._desc);b._applyWrapMode(e,this._desc);b._applyAnisotropicFilteringParameters(this._context,this._desc);this._context.bindTexture(d,0)};b.prototype.updateData= function(a,b,d,c,k,f){f||console.error("An attempt to use uninitialized data!");this._glName||console.error("An attempt to update uninitialized texture!");var e=this._context.gl,h=this._desc,n=this._context.getBoundTexture(0);this._context.bindTexture(this,0);(0>b||0>d||c>h.width||k>h.height||b+c>h.width||d+k>h.height)&&console.error("An attempt to update out of bounds of the texture!");f instanceof ImageData||f instanceof HTMLImageElement||f instanceof HTMLCanvasElement||f instanceof HTMLVideoElement? (console.assert(f.width===c&&f.height===k),e.texSubImage2D(e.TEXTURE_2D,a,b,d,h.pixelFormat,h.dataType,f)):e.texSubImage2D(e.TEXTURE_2D,a,b,d,c,k,h.pixelFormat,h.dataType,f);this._context.bindTexture(n,0)};b.prototype.generateMipmap=function(){var a=this._desc;a.hasMipmap||(a.hasMipmap=!0,b._validateTexture(a));9729===a.samplingMode?(this._samplingModeDirty=!0,a.samplingMode=9985):9728===a.samplingMode&&(this._samplingModeDirty=!0,a.samplingMode=9984);a=this._context.getBoundTexture(0);this._context.bindTexture(this, 0);var e=this._context.gl;e.generateMipmap(e.TEXTURE_2D);this._context.bindTexture(a,0)};b.prototype.setSamplingMode=function(a){a!==this._desc.samplingMode&&(this._desc.samplingMode=a,b._validateTexture(this._desc),this._samplingModeDirty=!0)};b.prototype.setWrapMode=function(a){a!==this._desc.wrapMode&&(this._desc.wrapMode=a,b._validateTexture(this._desc),this._wrapModeDirty=!0)};b.prototype.applyChanges=function(){var a=this._context.gl,e=this._desc;this._samplingModeDirty&&(b._applySamplingMode(a, e),this._samplingModeDirty=!1);this._wrapModeDirty&&(b._applyWrapMode(a,e),this._wrapModeDirty=!1)};b.prototype.setBoundToUnit=function(a,b){b?this._boundToUnits.add(a):this._boundToUnits.delete(a)};b._isPowerOfTwo=function(a){return 0===(a&a-1)};b._validateTexture=function(a){(0>a.width||0>a.height)&&console.error("Negative dimension parameters are not allowed!");b._isPowerOfTwo(a.width)&&b._isPowerOfTwo(a.height)||(33071!==a.wrapMode&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"), a.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))};b._applySamplingMode=function(a,b){var d=b.samplingMode;if(9985===d||9987===d)d=9729;else if(9984===d||9986===d)d=9728;a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,d);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,b.samplingMode)};b._applyWrapMode=function(a,b){a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,b.wrapMode);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,b.wrapMode)};b._applyAnisotropicFilteringParameters= function(a,b){if(null!=b.maxAnisotropy){var d=a.capabilities.textureFilterAnisotropic;d&&(a=a.gl,a.texParameterf(a.TEXTURE_2D,d.TEXTURE_MAX_ANISOTROPY,b.maxAnisotropy))}};b._nextId=0;return b}()})},"esri/views/2d/engine/webgl/brushes/WGLBrushStencil":function(){define("require exports ../../../../../core/tsSupport/extendsHelper ../../../../../core/libs/gl-matrix/vec4 ./WGLBrush ../shaders/glShaderSnippets ../../../../webgl/BufferObject ../../../../webgl/Program ../../../../webgl/VertexArrayObject".split(" "), function(p,g,b,a,e,d,c,k,f){Object.defineProperty(g,"__esModule",{value:!0});p=function(e){function h(){var b=e.call(this)||this;b._color=a.create();b._initialized=!1;b._color.set([1,0,0,1]);return b}b(h,e);h.prototype.dispose=function(){this._solidProgram&&(this._solidProgram.dispose(),this._solidProgram=null);this._solidVertexArrayObject&&(this._solidVertexArrayObject.dispose(),this._solidVertexArrayObject=null)};h.prototype.draw=function(a,b){a=a.context;this._initialized||this._initialize(a); a.setStencilFunctionSeparate(1032,519,b.stencilRef,255);a.bindVAO(this._solidVertexArrayObject);a.bindProgram(this._solidProgram);this._solidProgram.setUniformMatrix4fv("u_transformMatrix",b.tileTransform.transform);this._solidProgram.setUniform2fv("u_normalized_origin",b.tileTransform.displayCoord);this._solidProgram.setUniform1f("u_coord_range",512);this._solidProgram.setUniform1f("u_depth",0);this._solidProgram.setUniform4fv("u_color",this._color);a.drawArrays(5,0,4);a.bindVAO()};h.prototype._initialize= function(a){if(this._initialized)return!0;var b={a_pos:0},e=new k(a,d.backgroundVS,d.backgroundFS,b);if(!e)return!1;var h=new Int8Array([0,0,1,0,0,1,1,1]),h=c.createVertex(a,35044,h);a=new f(a,b,{geometry:[{name:"a_pos",count:2,type:5120,offset:0,stride:2,normalized:!1,divisor:0}]},{geometry:h});this._solidProgram=e;this._solidVertexArrayObject=a;return this._initialized=!0};return h}(e.default);g.default=p})},"esri/core/libs/gl-matrix/vec4":function(){define(["./common"],function(p){var g={create:function(){var b= new p.ARRAY_TYPE(4);b[0]=0;b[1]=0;b[2]=0;b[3]=0;return b},clone:function(b){var a=new p.ARRAY_TYPE(4);a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];return a},fromValues:function(b,a,e,d){var c=new p.ARRAY_TYPE(4);c[0]=b;c[1]=a;c[2]=e;c[3]=d;return c},copy:function(b,a){b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];return b},set:function(b,a,e,d,c){b[0]=a;b[1]=e;b[2]=d;b[3]=c;return b},add:function(b,a,e){b[0]=a[0]+e[0];b[1]=a[1]+e[1];b[2]=a[2]+e[2];b[3]=a[3]+e[3];return b},subtract:function(b,a,e){b[0]=a[0]- e[0];b[1]=a[1]-e[1];b[2]=a[2]-e[2];b[3]=a[3]-e[3];return b}};g.sub=g.subtract;g.multiply=function(b,a,e){b[0]=a[0]*e[0];b[1]=a[1]*e[1];b[2]=a[2]*e[2];b[3]=a[3]*e[3];return b};g.mul=g.multiply;g.divide=function(b,a,e){b[0]=a[0]/e[0];b[1]=a[1]/e[1];b[2]=a[2]/e[2];b[3]=a[3]/e[3];return b};g.div=g.divide;g.ceil=function(b,a){b[0]=Math.ceil(a[0]);b[1]=Math.ceil(a[1]);b[2]=Math.ceil(a[2]);b[3]=Math.ceil(a[3]);return b};g.floor=function(b,a){b[0]=Math.floor(a[0]);b[1]=Math.floor(a[1]);b[2]=Math.floor(a[2]); b[3]=Math.floor(a[3]);return b};g.min=function(b,a,e){b[0]=Math.min(a[0],e[0]);b[1]=Math.min(a[1],e[1]);b[2]=Math.min(a[2],e[2]);b[3]=Math.min(a[3],e[3]);return b};g.max=function(b,a,e){b[0]=Math.max(a[0],e[0]);b[1]=Math.max(a[1],e[1]);b[2]=Math.max(a[2],e[2]);b[3]=Math.max(a[3],e[3]);return b};g.round=function(b,a){b[0]=Math.round(a[0]);b[1]=Math.round(a[1]);b[2]=Math.round(a[2]);b[3]=Math.round(a[3]);return b};g.scale=function(b,a,e){b[0]=a[0]*e;b[1]=a[1]*e;b[2]=a[2]*e;b[3]=a[3]*e;return b};g.scaleAndAdd= function(b,a,e,d){b[0]=a[0]+e[0]*d;b[1]=a[1]+e[1]*d;b[2]=a[2]+e[2]*d;b[3]=a[3]+e[3]*d;return b};g.distance=function(b,a){var e=a[0]-b[0],d=a[1]-b[1],c=a[2]-b[2];b=a[3]-b[3];return Math.sqrt(e*e+d*d+c*c+b*b)};g.dist=g.distance;g.squaredDistance=function(b,a){var e=a[0]-b[0],d=a[1]-b[1],c=a[2]-b[2];b=a[3]-b[3];return e*e+d*d+c*c+b*b};g.sqrDist=g.squaredDistance;g.length=function(b){var a=b[0],e=b[1],d=b[2];b=b[3];return Math.sqrt(a*a+e*e+d*d+b*b)};g.len=g.length;g.squaredLength=function(b){var a=b[0], e=b[1],d=b[2];b=b[3];return a*a+e*e+d*d+b*b};g.sqrLen=g.squaredLength;g.negate=function(b,a){b[0]=-a[0];b[1]=-a[1];b[2]=-a[2];b[3]=-a[3];return b};g.inverse=function(b,a){b[0]=1/a[0];b[1]=1/a[1];b[2]=1/a[2];b[3]=1/a[3];return b};g.normalize=function(b,a){var e=a[0],d=a[1],c=a[2];a=a[3];var k=e*e+d*d+c*c+a*a;0c?-c:4-c;d+=2>e?-e:4-e;this._width=b;this._height=d;this._boundFBO=a.getBoundFramebufferObject();b=Math.round(.75*b);d=Math.round(.75*d);this._hlRenderer.setup(a,b,d);this._hlSurfaces.setup(a,b,d)};d.prototype.setHighlightOptions=function(a){this._hlRenderer.setHighlightOptions({fillColor:a.fillColor, outlineColor:a.outlineColor,outlineWidth:.75*a.outlineWidth,outerHaloWidth:.75*a.outerHaloWidth,innerHaloWidth:.75*a.innerHaloWidth,outlinePosition:.75*a.outlinePosition})};d.prototype.startMaskDraw=function(a){a.bindFramebuffer(this._hlSurfaces.sharedBlur1Fbo);a.setClearColor(0,0,0,0);a.setClearStencil(0);a.clear(a.gl.COLOR_BUFFER_BIT|a.gl.STENCIL_BUFFER_BIT);a.setViewport(0,0,.75*this._width,.75*this._height)};d.prototype.draw=function(a){a.setStencilTestEnabled(!1);a.setBlendingEnabled(!1);a.bindFramebuffer(this._hlSurfaces.sharedBlur2Fbo); a.setClearColor(0,0,0,0);a.clear(a.gl.COLOR_BUFFER_BIT);this._hlRenderer.preBlur(a,this._hlSurfaces.sharedBlur1Tex);b("esri-feature-highlight-debug")?(a.bindFramebuffer(null),a.clear(a.gl.COLOR_BUFFER_BIT),this._hlRenderer.finalBlur(a,this._hlSurfaces.sharedBlur2Tex)):(a.bindFramebuffer(this._hlSurfaces.sharedBlur1Fbo),a.setClearColor(0,0,0,0),a.clear(a.gl.COLOR_BUFFER_BIT),this._hlRenderer.finalBlur(a,this._hlSurfaces.sharedBlur2Tex),a.bindFramebuffer(this._boundFBO),a.setBlendingEnabled(!0),a.setViewport(0, 0,this._width,this._height),this._hlRenderer.renderHighlight(a,this._hlSurfaces.sharedBlur1Tex),this._boundFBO=null)};return d}()})},"esri/views/2d/engine/webgl/painter/highlight/HighlightRenderer":function(){define("require exports ../../shaders/hlShaderSnippets ../../../../../webgl/BufferObject ../../../../../webgl/ShaderVariations ../../../../../webgl/Texture ../../../../../webgl/VertexArrayObject".split(" "),function(p,g,b,a,e,d,c){var k=[void 0,void 0,void 0,1],f=[3,4],l=[0,0,0,0,0,0,0,0,0,0, 0,0,1,1,1,1],h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return function(){function n(){this._height=this._width=void 0;this._highlightOptions={fillColor:[.2,.6,.9,.75],outlineColor:[.2,.6,.9,.9],outlinePosition:0,outlineWidth:3.4,innerHaloWidth:2,outerHaloWidth:3.3};this._resources=null}n.prototype._initialize=function(h,l,n){this._width=l;this._height=n;l=new a(h,34962,35044,(new Int8Array([-128,-128,0,0,127,-128,255,0,-128,127,0,255,127,127,255,255])).buffer);n=new c(h,{a_position:0,a_texcoord:1},{geometry:[{name:"a_position", count:2,type:5120,offset:0,stride:4,normalized:!0},{name:"a_texcoord",count:2,type:5121,offset:2,stride:4,normalized:!0}]},{geometry:l});var m=(new e("hl",["texturedVS","highlightFS"],[],b,h,{a_position:0,a_texcoord:1})).getProgram([]),r=(new e("hl",["texturedVS","blurFS"],[],b,h,{a_position:0,a_texcoord:1})).getProgram([]);m.setUniform1i("u_texture",f[0]);m.setUniform1i("u_shade",f[1]);m.setUniform4fv("u_sigmas",k);r.setUniform1i("u_texture",f[0]);r.setUniform4fv("u_sigmas",k);h=new d(h,{target:3553, pixelFormat:6408,dataType:5121,wrapMode:33071,width:256,height:1,samplingMode:9728});this._resources={quadGeometry:l,quadVAO:n,highlightProgram:m,blurProgram:r,shadeTex:h}};n.prototype.setHighlightOptions=function(a){function b(a,b,c){n[0]=(1-c)*a[0]+c*b[0];n[1]=(1-c)*a[1]+c*b[1];n[2]=(1-c)*a[2]+c*b[2];n[3]=(1-c)*a[3]+c*b[3]}this._highlightOptions=a;if(this._resources){var c=a.outlinePosition-a.outlineWidth/2-a.outerHaloWidth,d=a.outlinePosition-a.outlineWidth/2,e=a.outlinePosition+a.outlineWidth/ 2,f=a.outlinePosition+a.outlineWidth/2+a.innerHaloWidth,h=Math.sqrt(Math.PI/2)*k[3],l=Math.abs(c)>h?Math.round(10*(Math.abs(c)-h))/10:0,h=Math.abs(f)>h?Math.round(10*(Math.abs(f)-h))/10:0;l&&!h?console.warn("The outer rim of the highlight is "+l+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards)."):!l&&h?console.warn("The inner rim of the highlight is "+h+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."): l&&h&&console.warn("The highlight is "+Math.max(l,h)+"px away from the edge of the feature; consider reducing some width values.");for(var l=new Uint8Array(1024),n=[void 0,void 0,void 0,void 0],r=0;256>r;++r)h=c+r/255*(f-c),ha||0>b||0>f||0>l)&&console.error("Offsets cannot be negative!");(0>=c||0>=k)&&console.error("Copy width and height must be greater than zero!");var d=this._desc,e=h.descriptor;3553!== h.descriptor.target&&console.error("Texture target must be TEXTURE_2D!");(a+c>d.width||b+k>d.height||f+c>e.width||l+k>e.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");d=this._context;d.bindTexture(h);d.bindFramebuffer(this);d.gl.copyTexSubImage2D(3553,0,f,l,a,b,c,k)};a.prototype.readPixels=function(a,b,c,k,f,l,h){(0>=c||0>=k)&&console.error("Copy width and height must be greater than zero!");h||console.error("Target memory is not initialized!"); this._context.bindFramebuffer(this);this._context.gl.readPixels(a,b,c,k,f,l,h)};a.prototype.resize=function(e,d){var c=this._desc;if(c.width!==e||c.height!==d)if(this._initialized)c.width=e,c.height=d,this._colorAttachment instanceof b?(k=this._colorAttachment,c=k.descriptor,c.width=e,c.height=d,this._colorAttachment.dispose(),this._colorAttachment=new b(this._context,c),a._validateTextureDimensions(k.descriptor,this._desc)):this._colorAttachment&&this._disposeColorAttachment(),null!=this._depthStencilTexture? (c=this._depthStencilTexture.descriptor,c.width=e,c.height=d,this._depthStencilTexture.dispose(),this._depthStencilTexture=new b(this._context,c)):(this._depthAttachment||this._stencilAttachment)&&this._disposeDepthStencilAttachments(),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1;else{c.width=e;c.height=d;if(this._colorAttachment instanceof b){var k=this._colorAttachment;k.resize(e,d)}this._depthStencilTexture&&this._depthStencilTexture.resize(e, d)}};a.prototype.initialize=function(){if(this._initialized)return!1;var a=this._context.gl;this._glName&&a.deleteFramebuffer(this._glName);var d=a.createFramebuffer(),c=this._desc;a.bindFramebuffer(a.FRAMEBUFFER,d);if(!this._colorAttachment)if(0===c.colorTarget)this._colorAttachment=new b(this._context,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,wrapMode:33071,width:c.width,height:c.height});else{var k=a.createRenderbuffer();a.bindRenderbuffer(a.RENDERBUFFER,k);a.renderbufferStorage(a.RENDERBUFFER, a.RGBA4,c.width,c.height);a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.RENDERBUFFER,k);this._colorAttachment=k}this._colorAttachment instanceof b&&a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,this._colorAttachment.glName,0);switch(c.depthStencilTarget){case 1:case 3:k=a.createRenderbuffer();a.bindRenderbuffer(a.RENDERBUFFER,k);var f=1===c.depthStencilTarget?a.DEPTH_ATTACHMENT:a.DEPTH_STENCIL_ATTACHMENT;a.renderbufferStorage(a.RENDERBUFFER,1===c.depthStencilTarget? a.DEPTH_COMPONENT16:a.DEPTH_STENCIL,c.width,c.height);a.framebufferRenderbuffer(a.FRAMEBUFFER,f,a.RENDERBUFFER,k);this._depthAttachment=k;break;case 2:k=a.createRenderbuffer();a.bindRenderbuffer(a.RENDERBUFFER,k);a.renderbufferStorage(a.RENDERBUFFER,a.STENCIL_INDEX8,c.width,c.height);a.framebufferRenderbuffer(a.FRAMEBUFFER,a.STENCIL_ATTACHMENT,a.RENDERBUFFER,k);this._stencilAttachment=k;break;case 4:this._depthStencilTexture||(this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!"), this._depthStencilTexture=new b(this._context,{target:3553,pixelFormat:34041,dataType:34042,samplingMode:9728,wrapMode:33071,width:c.width,height:c.height})),a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.TEXTURE_2D,this._depthStencilTexture.glName,0)}a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!");this._glName=d;return this._initialized=!0};a.prototype._disposeColorAttachment=function(){if(this._colorAttachment instanceof b){var a=this._colorAttachment;if(this._initialized){this._context.bindFramebuffer(this);var d=this._context.gl;d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,null,0)}a.dispose()}else this._colorAttachment instanceof WebGLRenderbuffer&&(a=this._colorAttachment,d=this._context.gl,this._initialized&&(this._context.bindFramebuffer(this),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.RENDERBUFFER,null)),this._context.gl.deleteRenderbuffer(a));this._colorAttachment= null};a.prototype._disposeDepthStencilAttachments=function(){var a=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);var b=this._context.gl;b.framebufferRenderbuffer(b.FRAMEBUFFER,1===this._desc.depthStencilTarget?b.DEPTH_ATTACHMENT:b.DEPTH_STENCIL_ATTACHMENT,b.RENDERBUFFER,null)}a.deleteRenderbuffer(this._depthAttachment);this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),b=this._context.gl, b.framebufferRenderbuffer(b.FRAMEBUFFER,b.STENCIL_ATTACHMENT,b.RENDERBUFFER,null)),a.deleteRenderbuffer(this._stencilAttachment),this._stencilAttachment=null);this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),a=this._context.gl,a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.TEXTURE_2D,null,0)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)};a._validateTextureDimensions=function(a,b){console.assert(0<=a.width&&0<=a.height);3553!== a.target&&console.error("Texture type must be TEXTURE_2D!");void 0!==b.width&&0<=b.width&&void 0!==b.height&&0<=b.height?b.width===a.width&&b.height===a.height||console.error("Color attachment texture must match the framebuffer's!"):(b.width=a.width,b.height=a.height)};a._nextId=0;return a}()})},"esri/views/support/screenshotUtils":function(){define(["require","exports","dojo/_base/lang"],function(p,g,b){Object.defineProperty(g,"__esModule",{value:!0});g.adjustScreenshotSettings=function(a,e){a=b.mixin({format:"png", quality:100},a||{});var d,c;a.includePadding?(d=e.width,c=e.height):(d=e.width-e.padding.left-e.padding.right,c=e.height-e.padding.top-e.padding.bottom);var k=d/c;void 0!==a.width&&void 0===a.height?a.height=a.width/k:void 0!==a.height&&void 0===a.width&&(a.width=k*a.height);void 0!==a.height&&(a.height=Math.floor(a.height));void 0!==a.width&&(a.width=Math.floor(a.width));a.area||a.includePadding||(a.area={x:e.padding.left,y:e.padding.top,width:d,height:c});return a};g.resampleHermite=function(a, b,d,c,k,f,l){void 0===l&&(l=!0);var e=b/k;d/=f;for(var n=Math.ceil(e/2),g=Math.ceil(d/2),m=0;m=t&&(t=2*t*t*t-3*t*t+1,0a[F+3]&&(t=t*a[F+3]/250),B+=t*a[F],w+=t*a[F+1],z+=t*a[F+2],p+=t))}c[q]=B/p;c[q+1]= w/p;c[q+2]=z/p;c[q+3]=y/v}}})},"esri/views/webgl/RenderingContext":function(){define(["require","exports","./enums","./capabilities/isWebGL2Context","./capabilities/load"],function(p,g,b,a,e){return function(){function d(b,d){this.gl=null;this._blendEnabled=!1;this._blendColorState={r:0,g:0,b:0,a:0};this._blendFunctionState={srcRGB:1,dstRGB:0,srcAlpha:1,dstAlpha:0};this._blendEquationState={mode:32774,modeAlpha:32774};this._colorMaskState={r:!0,g:!0,b:!0,a:!0};this._polygonCullingEnabled=!1;this._cullFace= 1029;this._frontFace=2305;this._scissorTestEnabled=!1;this._scissorRect={x:0,y:0,width:0,height:0};this._depthTestEnabled=!1;this._depthFunction=513;this._clearDepth=1;this._depthWriteEnabled=!0;this._depthRange={zNear:0,zFar:1};this._viewport=null;this._polygonOffsetFillEnabled=this._stencilTestEnabled=!1;this._polygonOffset=[0,0];this._stencilFunction={face:1032,func:519,ref:0,mask:1};this._clearStencil=0;this._stencilWriteMask=1;this._stencilOperation={face:1032,fail:7680,zFail:7680,zPass:7680}; this._lineWidth=1;this._clearColor={r:0,g:0,b:0,a:0};this._activeFramebuffer=this._activeIndexBuffer=this._activeVertexBuffer=this._activeShaderProgram=null;this._activeTextureUnit=0;this._textureUnitMap={};this.contextVersion=a.default(b)?"webgl2":"webgl";this.gl=b;b instanceof WebGLRenderingContext&&this.gl.getExtension("OES_element_index_uint");this._capabilities=e.loadCapabilities(b,d);b=this.gl.getParameter(this.gl.VIEWPORT);this._viewport={x:b[0],y:b[1],width:b[2],height:b[3]};b=this.capabilities.textureFilterAnisotropic; this._parameters={versionString:this.gl.getParameter(this.gl.VERSION),maxVertexTextureImageUnits:this.gl.getParameter(this.gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxVertexAttributes:this.gl.getParameter(this.gl.MAX_VERTEX_ATTRIBS),maxMaxAnisotropy:b?this.gl.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY):void 0,maxTextureImageUnits:this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS)};this.enforceState()}Object.defineProperty(d.prototype,"contextAttributes",{get:function(){return this.gl.getContextAttributes()}, enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"parameters",{get:function(){return this._parameters},enumerable:!0,configurable:!0});d.prototype.dispose=function(){this.bindVAO(null);this.unbindBuffer(34962);this.unbindBuffer(34963);this._textureUnitMap={};this.gl=null};d.prototype.setBlendingEnabled=function(a){this._blendEnabled!==a&&(!0===a?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._blendEnabled=a)};d.prototype.setBlendColor=function(a,b,d,e){if(a!==this._blendColorState.r|| b!==this._blendColorState.g||d!==this._blendColorState.b||e!==this._blendColorState.a)this.gl.blendColor(a,b,d,e),this._blendColorState.r=a,this._blendColorState.g=b,this._blendColorState.b=d,this._blendColorState.a=e};d.prototype.setBlendFunction=function(a,b){if(a!==this._blendFunctionState.srcRGB||b!==this._blendFunctionState.dstRGB)this.gl.blendFunc(a,b),this._blendFunctionState.srcRGB=a,this._blendFunctionState.srcAlpha=a,this._blendFunctionState.dstRGB=b,this._blendFunctionState.dstAlpha=b}; d.prototype.setBlendFunctionSeparate=function(a,b,d,e){if(this._blendFunctionState.srcRGB!==a||this._blendFunctionState.srcAlpha!==d||this._blendFunctionState.dstRGB!==b||this._blendFunctionState.dstAlpha!==e)this.gl.blendFuncSeparate(a,b,d,e),this._blendFunctionState.srcRGB=a,this._blendFunctionState.srcAlpha=d,this._blendFunctionState.dstRGB=b,this._blendFunctionState.dstAlpha=e};d.prototype.setBlendEquation=function(a){this._blendEquationState.mode!==a&&(this.gl.blendEquation(a),this._blendEquationState.mode= a,this._blendEquationState.modeAlpha=a)};d.prototype.setBlendEquationSeparate=function(a,b){if(this._blendEquationState.mode!==a||this._blendEquationState.modeAlpha!==b)this.gl.blendEquationSeparate(a,b),this._blendEquationState.mode=a,this._blendEquationState.modeAlpha=b};d.prototype.setColorMask=function(a,b,d,e){if(this._colorMaskState.r!==a||this._colorMaskState.g!==b||this._colorMaskState.b!==d||this._colorMaskState.a!==e)this.gl.colorMask(a,b,d,e),this._colorMaskState.r=a,this._colorMaskState.g= b,this._colorMaskState.b=d,this._colorMaskState.a=e};d.prototype.setClearColor=function(a,b,d,e){if(this._clearColor.r!==a||this._clearColor.g!==b||this._clearColor.b!==d||this._clearColor.a!==e)this.gl.clearColor(a,b,d,e),this._clearColor.r=a,this._clearColor.g=b,this._clearColor.b=d,this._clearColor.a=e};d.prototype.setFaceCullingEnabled=function(a){this._polygonCullingEnabled!==a&&(!0===a?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._polygonCullingEnabled=a)};d.prototype.setPolygonOffsetFillEnabled= function(a){this._polygonOffsetFillEnabled!==a&&(!0===a?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._polygonOffsetFillEnabled=a)};d.prototype.setPolygonOffset=function(a,b){if(this._polygonOffset[0]!==a||this._polygonOffset[1]!==b)this._polygonOffset[0]=a,this._polygonOffset[1]=b,this.gl.polygonOffset(a,b)};d.prototype.setCullFace=function(a){this._cullFace!==a&&(this.gl.cullFace(a),this._cullFace=a)};d.prototype.setFrontFace=function(a){this._frontFace!== a&&(this.gl.frontFace(a),this._frontFace=a)};d.prototype.setScissorTestEnabled=function(a){this._scissorTestEnabled!==a&&(!0===a?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._scissorTestEnabled=a)};d.prototype.setScissorRect=function(a,b,d,e){if(this._scissorRect.x!==a||this._scissorRect.y!==b||this._scissorRect.width!==d||this._scissorRect.height!==e)this.gl.scissor(a,b,d,e),this._scissorRect.x=a,this._scissorRect.y=b,this._scissorRect.width=d,this._scissorRect.height= e};d.prototype.setDepthTestEnabled=function(a){this._depthTestEnabled!==a&&(!0===a?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._depthTestEnabled=a)};d.prototype.setClearDepth=function(a){this._clearDepth!==a&&(this.gl.clearDepth(a),this._clearDepth=a)};d.prototype.setDepthFunction=function(a){this._depthFunction!==a&&(this.gl.depthFunc(a),this._depthFunction=a)};d.prototype.setDepthWriteEnabled=function(a){this._depthWriteEnabled!==a&&(this.gl.depthMask(a),this._depthWriteEnabled= a)};d.prototype.setDepthRange=function(a,b){if(this._depthRange.zNear!==a||this._depthRange.zFar!==b)this.gl.depthRange(a,b),this._depthRange.zNear=a,this._depthRange.zFar=b};d.prototype.setStencilTestEnabled=function(a){this._stencilTestEnabled!==a&&(!0===a?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._stencilTestEnabled=a)};d.prototype.setClearStencil=function(a){a!==this._clearStencil&&(this.gl.clearStencil(a),this._clearStencil=a)};d.prototype.setStencilFunction= function(a,b,d){if(this._stencilFunction.func!==a||this._stencilFunction.ref!==b||this._stencilFunction.mask!==d)this.gl.stencilFunc(a,b,d),this._stencilFunction.face=1032,this._stencilFunction.func=a,this._stencilFunction.ref=b,this._stencilFunction.mask=d};d.prototype.setStencilFunctionSeparate=function(a,b,d,e){if(this._stencilFunction.face!==a||this._stencilFunction.func!==b||this._stencilFunction.ref!==d||this._stencilFunction.mask!==e)this.gl.stencilFuncSeparate(a,b,d,e),this._stencilFunction.face= a,this._stencilFunction.func=b,this._stencilFunction.ref=d,this._stencilFunction.mask=e};d.prototype.setStencilWriteMask=function(a){this._stencilWriteMask!==a&&(this.gl.stencilMask(a),this._stencilWriteMask=a)};d.prototype.setStencilOp=function(a,b,d){if(this._stencilOperation.fail!==a||this._stencilOperation.zFail!==b||this._stencilOperation.zPass!==d)this.gl.stencilOp(a,b,d),this._stencilOperation.face=1032,this._stencilOperation.fail=a,this._stencilOperation.zFail=b,this._stencilOperation.zPass= d};d.prototype.setStencilOpSeparate=function(a,b,d,e){if(this._stencilOperation.face!==a||this._stencilOperation.fail!==b||this._stencilOperation.zFail!==d||this._stencilOperation.zPass!==e)this.gl.stencilOpSeparate(a,b,d,e),this._stencilOperation.face=a,this._stencilOperation.face=a,this._stencilOperation.fail=b,this._stencilOperation.zFail=d,this._stencilOperation.zPass=e};d.prototype.setLineWidth=function(a){var b=this._lineWidth;this._lineWidth!==a&&(this.gl.lineWidth(a),this._lineWidth=a);return b}; d.prototype.setActiveTexture=function(a){var c=this._activeTextureUnit;0<=a&&a!==this._activeTextureUnit&&(this.gl.activeTexture(b.BASE_TEXTURE_UNIT+a),this._activeTextureUnit=a);return c};d.prototype.clear=function(a){a&&this.gl.clear(a)};d.prototype.drawArrays=function(a,b,d){this.gl.drawArrays(a,b,d)};d.prototype.drawElements=function(a,b,d,e){5123===d?this.gl.drawElements(a,b,d,e):5125===d&&this.gl.drawElements(a,b,d,e)};Object.defineProperty(d.prototype,"capabilities",{get:function(){return this._capabilities}, enumerable:!0,configurable:!0});d.prototype.setViewport=function(a,b,d,e){var c=this._viewport;if(c.x!==a||c.y!==b||c.width!==d||c.height!==e)c.x=a,c.y=b,c.width=d,c.height=e,this.gl.viewport(a,b,d,e)};d.prototype.getViewport=function(){return{x:this._viewport.x,y:this._viewport.y,width:this._viewport.width,height:this._viewport.height}};d.prototype.bindProgram=function(a){a?this._activeShaderProgram!==a&&(a.initialize(),this.gl.useProgram(a.glName),this._activeShaderProgram=a):(this.gl.useProgram(null), this._activeShaderProgram=null)};d.prototype.bindTexture=function(a,b){void 0===b&&(b=0);-1===d._MAX_TEXTURE_IMAGE_UNITS&&(d._MAX_TEXTURE_IMAGE_UNITS=this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS));(b>=d._MAX_TEXTURE_IMAGE_UNITS||0>b)&&console.error("Input texture unit is out of range of available units!");var c=this._textureUnitMap[b];this.setActiveTexture(b);null==a||null==a.glName?(null!=c&&(this.gl.bindTexture(c.descriptor.target,null),c.setBoundToUnit(b,!1)),this._textureUnitMap[b]=null): c&&c.id===a.id?a.applyChanges():(this.gl.bindTexture(a.descriptor.target,a.glName),a.setBoundToUnit(b,!0),a.applyChanges(),this._textureUnitMap[b]=a)};d.prototype.bindFramebuffer=function(a){a?this._activeFramebuffer!==a&&(a.initialize()||this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,a.glName),this._activeFramebuffer=a):(this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null),this._activeFramebuffer=null)};d.prototype.bindBuffer=function(a){a&&(34962===a.bufferType?this._activeVertexBuffer=d._bindBuffer(this.gl, a,a.bufferType,this._activeVertexBuffer):this._activeIndexBuffer=d._bindBuffer(this.gl,a,a.bufferType,this._activeIndexBuffer))};d.prototype.unbindBuffer=function(a){34962===a?this._activeVertexBuffer=d._bindBuffer(this.gl,null,a,this._activeVertexBuffer):this._activeIndexBuffer=d._bindBuffer(this.gl,null,a,this._activeIndexBuffer)};d.prototype.bindVAO=function(a){a?this._activeVertexArrayObject&&this._activeVertexArrayObject.id===a.id||(a.bind(),this._activeVertexArrayObject=a):this._activeVertexArrayObject&& (this._activeVertexArrayObject.unbind(),this._activeVertexArrayObject=null)};d.prototype.getBoundTexture=function(a){return this._textureUnitMap[a]};d.prototype.getBoundFramebufferObject=function(){return this._activeFramebuffer};d.prototype.getBoundVAO=function(){return this._activeVertexArrayObject};d.prototype.resetState=function(){this.bindProgram(null);this.bindVAO(null);this.bindFramebuffer(null);this.unbindBuffer(34962);this.unbindBuffer(34963);for(var a=0;a=Math.abs(c-f.x)&&25>=h)return!0}},prepareEvent:function(a){var b=t.cloneEvent(a),c=b.preventDefault;b.preventDefault=function(){a.preventDefault();c()};b.pointerId=this.POINTER_ID;b.isPrimary=!0;b.pointerType=this.POINTER_TYPE;return b},prepareButtonsForMove:function(a,b){var c=F.get(this.POINTER_ID);a.buttons=0!==b.which&&c?c.buttons:0;b.buttons=a.buttons},mousedown:function(a){if(!this.isEventSimulatedFromTouch(a)){var b= F.get(this.POINTER_ID),c=this.prepareEvent(a);J||(c.buttons=K[c.button],b&&(c.buttons|=b.buttons),a.buttons=c.buttons);F.set(this.POINTER_ID,a);b&&0!==b.buttons?t.move(c):t.down(c)}},mousemove:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);J||this.prepareButtonsForMove(b,a);b.button=-1;F.set(this.POINTER_ID,a);t.move(b)}},mouseup:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=F.get(this.POINTER_ID),c=this.prepareEvent(a);if(!J){var d=K[c.button];c.buttons= b?b.buttons&~d:0;a.buttons=c.buttons}F.set(this.POINTER_ID,a);c.buttons&=~K[c.button];0===c.buttons?t.up(c):t.move(c)}},mouseover:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);J||this.prepareButtonsForMove(b,a);b.button=-1;F.set(this.POINTER_ID,a);t.enterOver(b)}},mouseout:function(a){if(!this.isEventSimulatedFromTouch(a)){var b=this.prepareEvent(a);J||this.prepareButtonsForMove(b,a);b.button=-1;t.leaveOut(b)}},cancel:function(a){a=this.prepareEvent(a);t.cancel(a); this.deactivateMouse()},deactivateMouse:function(){F.delete(this.POINTER_ID)}},U=t.captureInfo,V=x.findTarget.bind(x),Y=x.allShadows.bind(x),O=t.pointermap,Z,R={events:["touchstart","touchmove","touchend","touchcancel"],register:function(a){Z.enableOnSubtree(a)},unregister:function(a){},elementAdded:function(a){var b=a.getAttribute("touch-action"),c=this.touchActionToScrollType(b);c&&(a._scrollType=c,t.listen(a,this.events),Y(a).forEach(function(a){a._scrollType=c;t.listen(a,this.events)},this))}, elementRemoved:function(a){a._scrollType=void 0;t.unlisten(a,this.events);Y(a).forEach(function(a){a._scrollType=void 0;t.unlisten(a,this.events)},this)},elementChanged:function(a,b){var c=a.getAttribute("touch-action"),d=this.touchActionToScrollType(c);b=this.touchActionToScrollType(b);d&&b?(a._scrollType=d,Y(a).forEach(function(a){a._scrollType=d},this)):b?this.elementRemoved(a):d&&this.elementAdded(a)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/}, touchActionToScrollType:function(a){var b=this.scrollTypes;if("none"===a)return"none";if(a===b.XSCROLLER)return"X";if(a===b.YSCROLLER)return"Y";if(b.SCROLLER.exec(a))return"XY"},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(a){return this.firstTouch===a.identifier},setPrimaryTouch:function(a){if(0===O.size||1===O.size&&O.has(1))this.firstTouch=a.identifier,this.firstXY={X:a.clientX,Y:a.clientY},this.scrolling=!1,this.cancelResetClickCount()},removePrimaryPointer:function(a){a.isPrimary&& (this.firstXY=this.firstTouch=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var a=function(){this.clickCount=0;this.resetId=null}.bind(this);this.resetId=setTimeout(a,200)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(a){var b=0;if("touchstart"===a||"touchmove"===a)b=1;return b},touchToPointer:function(a){var b=this.currentTouchEvent,c=t.cloneEvent(a),d=c.pointerId=a.identifier+2;c.target=U[d]||V(c);c.bubbles= !0;c.cancelable=!0;c.detail=this.clickCount;c.button=0;c.buttons=this.typeToButtons(b.type);c.width=a.radiusX||a.webkitRadiusX||0;c.height=a.radiusY||a.webkitRadiusY||0;c.pressure=a.force||a.webkitForce||.5;c.isPrimary=this.isPrimaryTouch(a);c.pointerType=this.POINTER_TYPE;c.altKey=b.altKey;c.ctrlKey=b.ctrlKey;c.metaKey=b.metaKey;c.shiftKey=b.shiftKey;var e=this;c.preventDefault=function(){e.scrolling=!1;e.firstXY=null;b.preventDefault()};return c},processTouches:function(a,b){var c=a.changedTouches; this.currentTouchEvent=a;a=0;for(var d;a=Math.abs(a["client"+c]-this.firstXY[c])}this.firstXY=null;return b}},findTouch:function(a,b){for(var c=0,d=a.length,e;c=b.length){var c=[];O.forEach(function(a,d){1===d||this.findTouch(b,d-2)||c.push(a.out)},this);c.forEach(this.cancelOut,this)}},touchstart:function(a){this.vacuumTouches(a);this.setPrimaryTouch(a.changedTouches[0]);this.dedupSynthMouse(a);this.scrolling||(this.clickCount++,this.processTouches(a,this.overDown))},overDown:function(a){O.set(a.pointerId,{target:a.target,out:a,outTarget:a.target});t.enterOver(a);t.down(a)},touchmove:function(a){this.scrolling||(this.shouldScroll(a)? (this.scrolling=!0,this.touchcancel(a)):(a.preventDefault(),this.processTouches(a,this.moveOverOut)))},moveOverOut:function(a){var b=O.get(a.pointerId);if(b){var c=b.out,d=b.outTarget;t.move(a);c&&d!==a.target&&(c.relatedTarget=a.target,a.relatedTarget=d,c.target=d,a.target?(t.leaveOut(c),t.enterOver(a)):(a.target=d,a.relatedTarget=null,this.cancelOut(a)));b.out=a;b.outTarget=a.target}},touchend:function(a){this.dedupSynthMouse(a);this.processTouches(a,this.upOut)},upOut:function(a){this.scrolling|| (t.up(a),t.leaveOut(a));this.cleanUpPointer(a)},touchcancel:function(a){this.processTouches(a,this.cancelOut)},cancelOut:function(a){t.cancel(a);t.leaveOut(a);this.cleanUpPointer(a)},cleanUpPointer:function(a){O.delete(a.pointerId);this.removePrimaryPointer(a)},dedupSynthMouse:function(a){var b=H.lastTouches;a=a.changedTouches[0];this.isPrimaryTouch(a)&&(a={x:a.clientX,y:a.clientY},b.push(a),b=function(a,b){b=a.indexOf(b);-1p;p++)a[p]=String.fromCharCode(p);for(p=1;25>p;p++)a[111+p]="F"+p;for(p=65;91>p;p++)a[p]= [String.fromCharCode(p+32),String.fromCharCode(p)];var e={Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"};g.eventKey=function(b){if(void 0!==b.key)return e[b.key]||b.key;var c=a[b.keyCode];return Array.isArray(c)?b.shiftKey?c[1]:c[0]:c};g.isSystemModifier=function(a){switch(a){case "Ctrl":case "Alt":case "Shift":case "Meta":case "Primary":return!0}}})},"esri/views/input/InputManager":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/Accessor ../../core/Logger ../../core/now ../../core/accessorSupport/decorators ./keys ./recognizers ./handlers/LatestPointerType".split(" "), function(p,g,b,a,e,d,c,k,f,l,h){Object.defineProperty(g,"__esModule",{value:!0});var n=d.getLogger("esri.views.input.InputManager");p=function(d){function e(a,b){a=d.call(this)||this;a._pointerCaptures=new Map;a._nameToGroup={};a._handlers=[];a._currentPropagation=null;a._sourceEvents=new Set;a._keyModifiers=new Set;a._activeKeyModifiers=new Set;a.primaryKey=f.primaryKey;a.latestPointerType="mouse";a._installRecognizers();return a}b(e,d);e.prototype.normalizeCtorArgs=function(a,b){this._browserEvents= a;this._browserEvents.onEventReceived=this._onEventReceived.bind(this);this._recognizers=b;this._recognizers||(this._recognizers=l.defaults.map(function(a){return new a}));return{}};e.prototype.destroy=function(){for(var a=0,b=Object.keys(this._nameToGroup);aa.keyModifiers.length?-1:1}},h=0,k=b.handler.incomingEventMatches;hb.priorityIndex?-1:1};e.prototype._sortHandlersPriority=function(a){for(var b=[],c=0;c Math.PI;)d-=2*Math.PI;for(;d<-Math.PI;)d+=2*Math.PI;d=a.lastAngle+d;a.lastAngle=d;c+=d-a.initialAngle});c/=a.size||1;return{angle:c,radius:b.radius,center:b.center}}function k(a){var b=new Map;a.forEach(function(a,c){return b.set(c,a.event)});return b}function f(a,b){a=a.event;return Math.atan2(a.y-b.center.y,a.x-b.center.x)}Object.defineProperty(g,"__esModule",{value:!0});p=function(a){function e(){var b=a.call(this,!1)||this;b.startStateModifiers=new Set;b.activePointerMap=new Map;b.isDragging= !1;b.drag=b.registerOutgoing("drag");b.registerIncoming("pointer-drag",b.handlePointerDrag.bind(b));b.registerIncoming("pointer-up",b.handlePointerUpAndPointerLost.bind(b));b.registerIncoming("pointer-capture-lost",b.handlePointerUpAndPointerLost.bind(b));return b}b(e,a);e.prototype.createPayload=function(a,b,c,d){return{action:a,pointerType:this.pointerType,button:this.mouseButton,buttons:b.buttons,timestamp:d,pointers:k(this.activePointerMap),pointer:b,angle:c.angle,radius:c.radius,center:c.center}}; e.prototype.addPointer=function(a){var b=a.native.pointerId,e=c(this.activePointerMap).angle;a={event:a,initialAngle:0,lastAngle:0};this.activePointerMap.set(b,a);b=f(a,d(this.activePointerMap));a.initialAngle=b;a.lastAngle=b;this.updatePointerAngles(e)};e.prototype.updatePointer=function(a){if(!a||null!=a.x||null!=a.y){var b=this.activePointerMap.get(a.native.pointerId);b?b.event=a:this.addPointer(a)}};e.prototype.removePointer=function(a){var b=c(this.activePointerMap).angle;this.activePointerMap.delete(a); this.updatePointerAngles(b)};e.prototype.updatePointerAngles=function(a){var b=c(this.activePointerMap);this.activePointerMap.forEach(function(c){c.initialAngle=f(c,b)-a;c.lastAngle=f(c,b)-a})};e.prototype.emitEvent=function(a,b,d){var e=c(this.activePointerMap);this.drag.emit(this.createPayload(a,b,e,d),void 0,this.startStateModifiers)};e.prototype.handlePointerUpAndPointerLost=function(a){var b=a.data.native.pointerId,c=a.timestamp;this.activePointerMap.get(b)&&(1===this.activePointerMap.size?(this.updatePointer(a.data), this.emitEvent("end",a.data,c),this.isDragging=!1,this.removePointer(b)):(this.removePointer(b),this.emitEvent("removed",a.data,a.timestamp)))};e.prototype.handlePointerDrag=function(a){var b=a.data,c=b.currentEvent,d=a.timestamp;switch(b.action){case "start":case "update":this.isDragging?this.activePointerMap.has(c.native.pointerId)?(this.updatePointer(c),this.emitEvent("update",c,d)):(this.addPointer(c),this.emitEvent("added",c,d)):(this.updatePointer(c),this.pointerType=a.data.startEvent.pointerType, this.mouseButton=a.data.startEvent.button,this.startStateModifiers=a.modifiers,this.isDragging=!0,this.emitEvent("start",c,d))}};return e}(a.InputHandler);g.Drag=p;(function(a){a[a.Left=0]="Left";a[a.Middle=1]="Middle";a[a.Right=2]="Right";a[a.Back=3]="Back";a[a.Forward=4]="Forward";a[a.Undefined=-1]="Undefined"})(g.Button||(g.Button={}))})},"esri/views/input/recognizers/support":function(){define(["require","exports"],function(p,g){Object.defineProperty(g,"__esModule",{value:!0});g.manhattanDistance= function(b,a){return Math.abs(a.x-b.x)+Math.abs(a.y-b.y)};g.euclideanDistance=function(b,a){var e=a.x-b.x;b=a.y-b.y;return Math.sqrt(e*e+b*b)};g.fitCircleLSQ=function(b,a){a?(a.radius=0,a.center.x=0,a.center.y=0):a={radius:0,center:{x:0,y:0}};if(0===b.length)return a;if(1===b.length)return a.center.x=b[0].x,a.center.y=b[0].y,a;if(2===b.length){var e=b[0];b=b[1];var d=[b.x-e.x,b.y-e.y],c=d[0],d=d[1];a.radius=Math.sqrt(c*c+d*d)/2;a.center.x=(e.x+b.x)/2;a.center.y=(e.y+b.y)/2;return a}for(var k=0,f= 0,l=0;l("touch"===b.native.pointerType?this.movementUntilTouchDrag:this.movementUntilMouseDrag)&&this.startDragging(a),c.previousEvent=b)};c.prototype.startDragging=function(a){var b=this,c=a.data,d=c.native.pointerId;this._pointerState.forEach(function(e){0!==e.holdTimeout&&(clearTimeout(e.holdTimeout),e.holdTimeout=0);e.isDragging||(e.modifiers=a.modifiers,e.isDragging= !0,d===e.startEvent.native.pointerId?b._pointerDrag.emit(b._createPointerDragData("start",e,c)):b._pointerDrag.emit(b._createPointerDragData("start",e,e.previousEvent),a.timestamp))})};c.prototype._handlePointerUpOrLost=function(a){var b=a.data,c=b.native.pointerId,d=this._pointerState.get(c);d&&(0!==d.holdTimeout&&clearTimeout(d.holdTimeout),d.isDragging?this._pointerDrag.emit(this._createPointerDragData("end",d,b),void 0,d.modifiers):d.downButton===b.native.button&&a.timestamp-d.startTimestamp<= this.maximumClickDelay&&!d.holdEmitted&&this._immediateClick.emit(b),this._pointerState.delete(c),this.stopCapturingPointer(b.native),0===this._pointerState.size&&this._moveHandle.pause())};return c}(a.InputHandler);g.PointerClickHoldAndDrag=p})},"esri/views/input/recognizers/SingleAndDoubleClick":function(){define(["require","exports","../../../core/tsSupport/extendsHelper","../InputHandler","./support"],function(p,g,b,a,e){Object.defineProperty(g,"__esModule",{value:!0});g.DefaultParameters={maximumDoubleClickDelay:250, maximumDoubleClickDistance:10,maximumDoubleTouchDelay:350,maximumDoubleTouchDistance:35};p=function(a){function c(b,c,d,e){void 0===b&&(b=g.DefaultParameters.maximumDoubleClickDelay);void 0===c&&(c=g.DefaultParameters.maximumDoubleClickDistance);void 0===d&&(d=g.DefaultParameters.maximumDoubleTouchDelay);void 0===e&&(e=g.DefaultParameters.maximumDoubleTouchDistance);var f=a.call(this,!1)||this;f.maximumDoubleClickDelay=b;f.maximumDoubleClickDistance=c;f.maximumDoubleTouchDelay=d;f.maximumDoubleTouchDistance= e;f._pointerState=new Map;f._click=f.registerOutgoing("click");f._doubleClick=f.registerOutgoing("double-click");f.registerIncoming("immediate-click",f._handleImmediateClick.bind(f));return f}b(c,a);c.prototype.onUninstall=function(){this._pointerState.forEach(function(a){0!==a.doubleClickTimeout&&(clearTimeout(a.doubleClickTimeout),a.doubleClickTimeout=0)})};c.prototype._pointerId=function(a){a=a.native;return"mouse"===a.pointerType?a.pointerId+":"+a.button:""+a.pointerType};c.prototype._handleImmediateClick= function(a){var b=a.data,c=this._pointerId(b),d=this._pointerState.get(c);if(d){clearTimeout(d.doubleClickTimeout);d.doubleClickTimeout=0;var k="touch"===b.native.pointerType?this.maximumDoubleTouchDistance:this.maximumDoubleClickDistance;e.manhattanDistance(d.event.data,b)>k?(this._doubleClickTimeoutExceeded(c),this._startClick(a)):(this._doubleClick.emit(b,void 0,d.event.modifiers),this._pointerState.delete(c))}else this._startClick(a)};c.prototype._startClick=function(a){var b=this,c=this._pointerId(a.data); this._pointerState.set(c,{event:a,doubleClickTimeout:setTimeout(function(){return b._doubleClickTimeoutExceeded(c)},"touch"===a.data.native.pointerType?this.maximumDoubleTouchDelay:this.maximumDoubleClickDelay)})};c.prototype._doubleClickTimeoutExceeded=function(a){var b=this._pointerState.get(a);this._click.emit(b.event.data,void 0,b.event.modifiers);b.doubleClickTimeout=0;this._pointerState.delete(a)};return c}(a.InputHandler);g.SingleAndDoubleClick=p})},"esri/views/input/recognizers/VerticalTwoFingerDrag":function(){define(["require", "exports","../../../core/tsSupport/extendsHelper","../DragEventSeparator","../InputHandler"],function(p,g,b,a,e){Object.defineProperty(g,"__esModule",{value:!0});p=function(d){function c(b,c){void 0===b&&(b=20);void 0===c&&(c=40);var e=d.call(this,!1)||this;e._threshold=b;e._maxDelta=c;e.state="ready";e.emittedArtificalEnd2=!1;e._vertical=e.registerOutgoing("vertical-two-finger-drag");e._artificalDrag=e.registerOutgoing("drag");e.dragEventSeparator=new a.DragEventSeparator({start:function(a,b){return e.observeStart(a, b)},update:function(a,b,c){return e.observeUpdate(a,b,c)},end:function(a,b){return e.observeEnd(a,b)}});e.registerIncoming("drag",function(a){return e.dragEventSeparator.handle(a)});return e}b(c,d);Object.defineProperty(c.prototype,"failed",{get:function(){return"failed"===this.state},enumerable:!0,configurable:!0});c.prototype.observeStart=function(a,b){1===a&&this.emittedArtificalEnd2&&(this.emittedArtificalEnd2=!1,this._artificalDrag.emit({action:"start",button:b.data.button,buttons:b.data.buttons, pointerType:b.data.pointerType,timestamp:b.data.timestamp,pointers:b.data.pointers,pointer:b.data.pointer,angle:b.data.angle,radius:b.data.radius,center:b.data.center,artifical:!0}),b.stopPropagation());this.state=2===a?"ready":"failed"};c.prototype.observeUpdate=function(a,b,c){"failed"!==this.state&&2===a&&("active"===this.state?(this._vertical.emit({delta:b.data.center.y-this._thresholdReachedCenter.y,action:"update"}),b.stopPropagation()):this.checkMovementWithinLimits(b.data,c.data)?this.checkVerticalThresholdReached(b.data, c.data)&&(this.state="active",this.emittedArtificalEnd2=!0,this._thresholdReachedCenter=b.data.center,this._artificalDrag.emit({action:"end",button:b.data.button,buttons:b.data.buttons,pointerType:b.data.pointerType,timestamp:b.data.timestamp,pointers:b.data.pointers,pointer:b.data.pointer,angle:b.data.angle,radius:b.data.radius,center:b.data.center,artifical:!0}),this._vertical.emit({delta:b.data.center.y-this._thresholdReachedCenter.y,action:"begin"}),b.stopPropagation()):this.state="failed")}; c.prototype.observeEnd=function(a,b){"active"===this.state&&(this._vertical.emit({delta:b.data.center.y-this._thresholdReachedCenter.y,action:"end"}),this.state="ready",b.stopPropagation())};c.prototype.checkMovementWithinLimits=function(a,b){var c=-Infinity,d=Infinity,e=-Infinity,f=Infinity;b.pointers.forEach(function(a){c=Math.max(c,a.x);d=Math.min(d,a.x);e=Math.max(e,a.y);f=Math.min(f,a.y)});var k=-Infinity,g=Infinity,q=-Infinity,t=Infinity;a.pointers.forEach(function(a){k=Math.max(k,a.x);g=Math.min(g, a.x);q=Math.max(q,a.y);t=Math.min(t,a.y)});return Math.abs(a.center.x-b.center.x)=this._threshold};return c}(e.InputHandler);g.VerticalTwoFingerDrag=p})},"esri/views/input/handlers/LatestPointerType":function(){define(["require", "exports","../../../core/tsSupport/extendsHelper","../InputHandler"],function(p,g,b,a){Object.defineProperty(g,"__esModule",{value:!0});p=function(a){function d(b){var c=a.call(this,!0)||this;c._onChange=b;c._value="mouse";c.registerIncoming("pointer-down",function(a){c._setValue("touch"===a.data.native.pointerType?"touch":"mouse")});c._moveHandler=c.registerIncoming("pointer-move",function(a){c._setValue("touch"===a.data.native.pointerType?"touch":"mouse")});c._moveHandler.pause();return c}b(d,a); d.prototype._setValue=function(a){a!==this._value&&("touch"===a?this._moveHandler.resume():this._moveHandler.pause(),this._value=a,this._onChange(a))};return d}(a.InputHandler);g.LatestPointerType=p})},"esri/views/input/ViewEvents":function(){define("require exports ../../core/tsSupport/extendsHelper ../../geometry/ScreenPoint ../3d/support/mathUtils ./InputHandler".split(" "),function(p,g,b,a,e,d){function c(a){return!!f[a]}function k(a){for(var b=0;b=h;l--)b.children[l].removeShape();return b};g.drawShape=function(a,b,c,e,f){var h=[];"extent"===c.type&&(c=d.fromExtent(c));if("polyline"===c.type|| "polygon"===c.type){for(var k=f.length,l=0;l(" "+c+" ").indexOf(" "+b+" "))&&a.setAttribute("className",c+(c?" ":"")+b)};l._removeClass=function(a,b){var c=a.getAttribute("className");c&&a.setAttribute("className",c.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)"),"$1$2"))};h._getFontMeasurements=function(){var b= {"1em":0,"1ex":0,"100%":0,"12pt":0,"16px":0,"xx-small":0,"x-small":0,small:0,medium:0,large:0,"x-large":0,"xx-large":0},c,d;a("ie")&&(d=e.doc.documentElement.style.fontSize||"",d||(e.doc.documentElement.style.fontSize="100%"));var f=k.create("div",{style:{position:"absolute",left:"0",top:"-100px",width:"30px",height:"1000em",borderWidth:"0",margin:"0",padding:"0",outline:"none",lineHeight:"1",overflow:"hidden"}},e.body());for(c in b)f.style.fontSize=c,b[c]=16*Math.round(12*f.offsetHeight/16)/12/1E3; a("ie")&&(e.doc.documentElement.style.fontSize=d);e.body().removeChild(f);return b};var n=null;h._getCachedFontMeasurements=function(a){if(a||!n)n=h._getFontMeasurements();return n};var r=null,m={};h._getTextBox=function(a,b,c){var d,h,l=arguments.length,g;r||(r=k.create("div",{style:{position:"absolute",top:"-10000px",left:"0",visibility:"hidden"}},e.body()));d=r;d.className="";h=d.style;h.borderWidth="0";h.margin="0";h.padding="0";h.outline="0";if(1a?c:b?" "+c:c},makeFontString:function(a){return a.style+" "+a.variant+" "+a.weight+" "+a.size+" "+a.family},splitFontString:function(a){var b=l.getDefault("Font");a=a.split(/\s+/);if(!(5>a.length)){b.style=a[0];b.variant=a[1];b.weight=a[2];var c=a[3].indexOf("/");b.size=0>c?a[3]:a[3].substring(0,c);var d=4;0>c&&("/"==a[4]?d=6:"/"==a[4].charAt(0)&&(d=5));dm&&(p=t,m=q)}m>k?(b(a,k,f,g,p+1),b(a,k,f,p, h)):(f(c[0],c[1]),f(l[0],l[1]))}var a=Math.round,e=Math.abs,d=Math.sqrt;return function(){function c(){this._transform=null}c.prototype.update=function(a,b){this._transform=a;this._resolution=b};c.prototype.toScreenPoint=function(a,b,c){this.transformPoint(b.x+c*this._resolution,b.y,function(b,c){a.x=b;a.y=c});return a};c.prototype.toScreenPath=function(a,c){var d=this,e=null!=a.paths;a=e?a.paths:a.rings;var f="",k=function(a,b){a+=c*d._resolution;d.transformPoint(a,b,function(a,b){isNaN(a)||isNaN(b)|| (f+=a,f+=",",f+=b,f+=" ")})};if(a)for(var g=a.length,p=0;pa.width?0:a.width;b.setAttribute("stroke",a.color.toCss());b.setAttribute("stroke-opacity",a.color.a);b.setAttribute("stroke-width",f);b.setAttribute("stroke-linecap",a.cap);"number"===typeof a.join? (b.setAttribute("stroke-linejoin","miter"),b.setAttribute("stroke-miterlimit",a.join)):b.setAttribute("stroke-linejoin",a.join);var h=a.style.toLowerCase();h in k.dasharray&&(h=k.dasharray[h]);if(h instanceof Array){for(var h=d._toArray(h),g=0;gh[g]&&(h[g]=1);for(g=1;ga.width?0:a.width).toFixed(8)),d.setAttribute("height",(0>a.height?0:a.height).toFixed(8)),k._setAttributeNS(d,k.xmlns.xlink,"xlink:href",a.src),f.appendChild(d);else for(f.setAttribute("gradientUnits","userSpaceOnUse"),b=0;ba?0:a;this.rawNode.setAttribute(b,a)}this.bbox=null;return this};g.prototype._moveToFront=function(){this.rawNode.parentNode.appendChild(this.rawNode);return this};g.prototype._moveToBack=function(){this.rawNode.parentNode.insertBefore(this.rawNode,this.rawNode.parentNode.firstChild);return this};g.prototype._removeClipNode=function(){var c,d=a.get(this.rawNode,"clip-path");d&&(c= b.byId(d.match(/gfx_clip[\d]+/)[0]))&&c.parentNode.removeChild(c);return c};g.prototype.moveToFront=function(){var a=this.getParent();a&&(a._moveChildToFront(this),this._moveToFront());return this};g.prototype.moveToBack=function(){var a=this.getParent();a&&(a._moveChildToBack(this),this._moveToBack());return this};g.prototype.removeShape=function(a){this.parent&&this.parent.remove(this,a);return this};g.prototype._setParent=function(a,b){this.parent=a;return this._updateParentMatrix(b)};g.prototype._updateParentMatrix= function(a){this.parentMatrix=a?f.clone(a):null;return this._applyTransform()};g.prototype._getRealMatrix=function(){for(var a=f.clone(this.matrix||f.create()),b=this.parent;b;)b.matrix&&a&&f.multiply(a,b.matrix,a),b=b.parent;return a};return g}();g.default=p})},"esri/views/2d/libs/gfx/svg":function(){define(["require","exports","dojo/dom"],function(p,g,b){Object.defineProperty(g,"__esModule",{value:!0});g.xmlns={xlink:"http://www.w3.org/1999/xlink",svg:"http://www.w3.org/2000/svg"};g.dasharray={solid:"none", shortdash:[4,1],shortdot:[1,1],shortdashdot:[4,1,1,1],shortdashdotdot:[4,1,1,1,1,1],dot:[1,3],dash:[4,3],longdash:[8,3],dashdot:[4,3,1,3],longdashdot:[8,3,1,3],longdashdotdot:[8,3,1,3,1,3]};g._createElementNS=function(a,b){return document.createElementNS?document.createElementNS(a,b):document.createElement(b)};g._setAttributeNS=function(a,b,d,c){return a.setAttributeNS?a.setAttributeNS(b,d,c):a.setAttribute(d,c)};g._createTextNode=function(a){return document.createTextNode(a)};g._createFragment=function(){return document.createDocumentFragment()}; g.getRef=function(a){return a&&"none"!==a?a.match(/^url\(#.+\)$/)?b.byId(a.slice(5,-1)):a.match(/^#dojoUnique\d+$/)?b.byId(a.slice(1)):null:null}})},"esri/views/2d/libs/gfx/Group":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojox/gfx/_base ./Circle ./Container ./Image ./Path ./Rect ./svg ./Text".split(" "),function(p,g,b,a,e,d,c,k,f,l,h){Object.defineProperty(g,"__esModule",{value:!0});p=function(d){function g(){return null!==d&&d.apply(this,arguments)||this}b(g,d); g.prototype.setRawNode=function(a){this.rawNode=a;this.rawNode.__gfxObject__=this};g.prototype.destroy=function(){d.prototype.clear.call(this,!0);d.prototype.destroy.call(this)};g.prototype.createShape=function(b){switch(b.type){case a.defaultPath.type:return this.createPath(b);case a.defaultRect.type:return this.createRect(b);case a.defaultCircle.type:return this.createCircle(b);case a.defaultImage.type:return this.createImage(b);case a.defaultText.type:return this.createText(b)}console.error("[gfx] unknown shape", b);return null};g.prototype.createGroup=function(){return this.createObject(g)};g.prototype.createRect=function(a){return this.createObject(f.default,a)};g.prototype.createCircle=function(a){return this.createObject(e.default,a)};g.prototype.createImage=function(a){return this.createObject(c.default,a)};g.prototype.createText=function(a){return this.createObject(h.default,a)};g.prototype.createPath=function(a){return this.createObject(k.default,a)};g.prototype.createObject=function(a,b){if(!this.rawNode)return null; var c=new a;a=l._createElementNS(l.xmlns.svg,a.nodeType);c.setRawNode(a);c.setShape(b);this.add(c);return c};g.nodeType="g";return g}(d.default);g.default=p})},"esri/views/2d/libs/gfx/Container":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojox/gfx/matrix ./Shape ./svg".split(" "),function(p,g,b,a,e,d){Object.defineProperty(g,"__esModule",{value:!0});p=function(c){function e(){var a=null!==c&&c.apply(this,arguments)||this;a.children=[];a._batch=0;return a}b(e,c);e.prototype.openBatch= function(){this._batch||(this.fragment=d._createFragment());++this._batch;return this};e.prototype.closeBatch=function(){this._batch=0e?0:e;b.setAttribute(c,e)}b.setAttribute("preserveAspectRatio","none");d._setAttributeNS(b,d.xmlns.xlink,"xlink:href",this.shape.src);b.__gfxObject__=this;return this};e.prototype.getBoundingBox=function(){return this.shape};e.prototype.setStroke=function(){return this};e.prototype.setFill= function(){return this};e.nodeType="image";return e}(e.default);g.default=p})},"esri/views/2d/libs/gfx/Path":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/_base/lang dojox/gfx/_base dojox/gfx/matrix ./Shape".split(" "),function(p,g,b,a,e,d,c){Object.defineProperty(g,"__esModule",{value:!0});p=function(c){function f(b){var d=c.call(this)||this;d.segments=[];d.tbbox=null;d.absolute=!0;d.last={};d.segmented=!1;d._validSegments={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,z:0}; d._2PI=2*Math.PI;d.rawNode=b;d.shape=a.clone(e.defaultPath);return d}b(f,c);f.prototype.setAbsoluteMode=function(a){this._confirmSegmented();this.absolute="string"===typeof a?"absolute"===a:a;return this};f.prototype.getAbsoluteMode=function(){this._confirmSegmented();return this.absolute};f.prototype.getBoundingBox=function(){this._confirmSegmented();return this.bbox&&"l"in this.bbox?{x:this.bbox.l,y:this.bbox.t,width:this.bbox.r-this.bbox.l,height:this.bbox.b-this.bbox.t}:null};f.prototype._getRealBBox= function(){this._confirmSegmented();if(this.tbbox)return this.tbbox;var a=this.bbox,b=this._getRealMatrix();this.bbox=null;for(var c=this.segments.length,d=0;da&&(this.bbox.l=a),this.bbox.rb&&(this.bbox.t=b),this.bbox.b=c&&(a={action:a,args:b.slice(0,b.length-b.length%c)},this.segments.push(a),this._updateWithSegment(a)):(a={action:a,args:[]},this.segments.push(a),this._updateWithSegment(a)))};f.prototype._collectArgs=function(a,b){for(var c=0;cb?0:b;this.rawNode.setAttribute(c,b)}null!=this.shape.r&&(this.rawNode.setAttribute("ry", this.shape.r),this.rawNode.setAttribute("rx",this.shape.r));return this};c.nodeType="rect";return c}(e.default);g.default=p})},"esri/views/2d/libs/gfx/Text":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/has dojox/gfx/_base ./Shape ./svg".split(" "),function(p,g,b,a,e,d,c){Object.defineProperty(g,"__esModule",{value:!0});var k=a("chrome")?"auto":"optimizeLegibility";p=function(a){function d(b){var c=a.call(this)||this;c.fontStyle=null;c.shape=e.getDefault("Text"); c.rawNode=b;return c}b(d,a);d.prototype.getFont=function(){return this.fontStyle};d.prototype.setFont=function(a){this.fontStyle="string"===typeof a?e.splitFontString(a):e.makeParameters(e.defaultFont,a);this._setFont();return this};d.prototype._setFont=function(){var a=this.fontStyle;this.rawNode.setAttribute("font-style",a.style);this.rawNode.setAttribute("font-weight",a.weight);this.rawNode.setAttribute("font-size",a.size);this.rawNode.setAttribute("font-family",a.family)};d.prototype.setShape= function(a){this.shape=e.makeParameters(this.shape,a);this.bbox=null;a=this.rawNode;var b=this.shape;a.setAttribute("x",b.x);a.setAttribute("y",b.y);a.setAttribute("text-anchor",b.align);a.setAttribute("text-decoration",b.decoration);a.setAttribute("rotate",b.rotated?90:0);a.setAttribute("kerning",b.kerning?"auto":0);a.setAttribute("text-rendering",k);a.firstChild?a.firstChild.nodeValue=b.text:a.appendChild(c._createTextNode(b.text));return this};d.prototype.getTextWidth=function(){var a=this.rawNode, b=a.parentNode,a=a.cloneNode(!0);a.style.visibility="hidden";var c=0,d=a.firstChild.nodeValue;b.appendChild(a);if(""!==d)for(;!c;)c=a.getBBox?parseInt(a.getBBox().width,10):68;b.removeChild(a);return c};d.prototype.getBoundingBox=function(){var a=null;if(this.getShape().text)try{a=this.rawNode.getBBox()}catch(n){a={x:0,y:0,width:0,height:0}}return a};d.nodeType="text";return d}(d.default);g.default=p})},"esri/views/2d/libs/gfx/Surface":function(){define("require exports ../../../../core/tsSupport/extendsHelper dojo/dom-construct dojo/has dojo/_base/array dojox/gfx/_base ./Circle ./Container ./Group ./Image ./Path ./Rect ./svg ./Text".split(" "), function(p,g,b,a,e,d,c,k,f,l,h,n,r,m,u){Object.defineProperty(g,"__esModule",{value:!0});var q=navigator.userAgent,t=534a?0:a;b=0>b?0:b;this.rawNode.setAttribute("width",a);this.rawNode.setAttribute("height",b);t&&(this.rawNode.style.width=a,this.rawNode.style.height=b);return this};g.prototype.getDimensions=function(){return this.rawNode?{width:c.normalizedLength(this.rawNode.getAttribute("width")),height:c.normalizedLength(this.rawNode.getAttribute("height"))}: null};g.prototype.getEventSource=function(){return this.rawNode};g.prototype._getRealMatrix=function(){return null};g.prototype.createShape=function(a){switch(a.type){case c.defaultPath.type:return this.createPath(a);case c.defaultRect.type:return this.createRect(a);case c.defaultCircle.type:return this.createCircle(a);case c.defaultImage.type:return this.createImage(a);case c.defaultText.type:return this.createText(a)}console.error("[gfx] unknown shape",a);return null};g.prototype.createGroup=function(){return this.createObject(l.default)}; g.prototype.createRect=function(a){return this.createObject(r.default,a)};g.prototype.createCircle=function(a){return this.createObject(k.default,a)};g.prototype.createImage=function(a){return this.createObject(h.default,a)};g.prototype.createText=function(a){return this.createObject(u.default,a)};g.prototype.createPath=function(a){return this.createObject(n.default,a)};g.prototype.createObject=function(a,b){if(!this.rawNode)return null;var c=new a;a=m._createElementNS(m.xmlns.svg,a.nodeType);c.setRawNode(a); c.setShape(b);this.add(c);return c};return g}(f.default);g.default=p})},"esri/views/2d/libs/gfx/svgSurface":function(){define(["require","exports","dojo/dom","./Surface","./svg"],function(p,g,b,a,e){Object.defineProperty(g,"__esModule",{value:!0});g.createSurface=function(d,c,g){var f=new a.default;f.rawNode=e._createElementNS(e.xmlns.svg,"svg");f.rawNode.setAttribute("overflow","hidden");c&&f.rawNode.setAttribute("width",0>c?0:c);g&&f.rawNode.setAttribute("height",0>g?0:g);c=e._createElementNS(e.xmlns.svg, "defs");f.rawNode.appendChild(c);f.defNode=c;f._parent=b.byId(d);f._parent.appendChild(f.rawNode);return f}})},"esri/views/layers/GraphicsView":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../Graphic ../../core/Accessor ../../core/Collection ../../core/accessorSupport/decorators".split(" "),function(p,g,b,a,e,d,c,k){return function(d){function f(){var a=null!==d&&d.apply(this,arguments)||this;a.graphics=null;a.renderer=null;a.view= null;return a}b(f,d);a([k.property({type:c.ofType(e)})],f.prototype,"graphics",void 0);a([k.property()],f.prototype,"renderer",void 0);a([k.property()],f.prototype,"view",void 0);return f=a([k.subclass("esri.views.layers.GraphicsView")],f)}(k.declared(d))})},"esri/views/2d/navigation/MapViewNavigation":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../Viewpoint ../../../core/Accessor ../../../core/accessorSupport/decorators ../../../geometry/Point ../viewpointUtils ./ZoomBox ./actions/Pan ./actions/Pinch ./actions/Rotate".split(" "), function(p,g,b,a,e,d,c,k,f,l,h,n,r){var m=new e({targetGeometry:new k}),u=[0,0];return function(d){function e(a){a=d.call(this)||this;a.animationManager=null;return a}b(e,d);e.prototype.initialize=function(){this.pan=new h({navigation:this});this.rotate=new r({navigation:this});this.pinch=new n({navigation:this});this.zoomBox=new l({view:this.view,navigation:this})};e.prototype.destroy=function(){this.zoomBox.destroy();this.animationManager=this.zoomBox=null};e.prototype.begin=function(){this._set("interacting", !0)};e.prototype.end=function(){this._set("interacting",!1)};e.prototype.zoom=function(a,b){void 0===b&&(b=this._getDefaultAnchor());this.stop();this.begin();if(this.view.constraints.snapToZoom&&this.view.constraints.effectiveLODs)return 1>a?this.zoomIn(b):this.zoomOut(b);this.setViewpoint(b,a,0)};e.prototype.zoomIn=function(a){void 0===a&&(a=this._getDefaultAnchor());var b=this.view,c=b.scale,d=b.constraints.snapToNextScale(c);return b.goTo(this._scaleAndRotateViewpoint(m,a,d/c,0))};e.prototype.zoomOut= function(a){void 0===a&&(a=this._getDefaultAnchor());var b=this.view,c=b.scale,d=b.constraints.snapToPreviousScale(c);return b.goTo(this._scaleAndRotateViewpoint(m,a,d/c,0))};e.prototype.setViewpoint=function(a,b,c){this.begin();this.view.state.viewpoint=this._scaleAndRotateViewpoint(m,a,b,c);this.end()};e.prototype.animateViewpoint=function(a,b,c){return this.view.goTo(this._scaleAndRotateViewpoint(m,a,b,c))};e.prototype.continousRotateClockwise=function(){var a=this.get("view.viewpoint");this.animationManager.animateContinous(a, function(a){f.rotateBy(a,a,-1)})};e.prototype.continousRotateCounterclockwise=function(){var a=this.get("view.viewpoint");this.animationManager.animateContinous(a,function(a){f.rotateBy(a,a,1)})};e.prototype.resetRotation=function(){this.view.rotation=0};e.prototype.continousPanLeft=function(){var a=this.get("view.viewpoint");this.animationManager.animateContinous(a,function(a){f.translateBy(a,a,[-10,0])})};e.prototype.continousPanRight=function(){var a=this.get("view.viewpoint");this.animationManager.animateContinous(a, function(a){f.translateBy(a,a,[10,0])})};e.prototype.continousPanUp=function(){var a=this.get("view.viewpoint");this.animationManager.animateContinous(a,function(a){f.translateBy(a,a,[0,10])})};e.prototype.continousPanDown=function(){var a=this.get("view.viewpoint");this.animationManager.animateContinous(a,function(a){f.translateBy(a,a,[0,-10])})};e.prototype.stop=function(){this.pan.stopMomentumNavigation();this.animationManager.stop();this.end()};e.prototype._getDefaultAnchor=function(){var a=this.view.size; u[0]=.5*a[0];u[1]=.5*a[1];return u};e.prototype._scaleAndRotateViewpoint=function(a,b,c,d){var e=this.view,h=e.size,g=e.padding,k=e.constraints,l=e.viewpoint,m=e.scale*c,e=k.canZoomInTo(m),k=k.canZoomOutTo(m);return 1>c&&!e||1e?(g=e,e=c-e):(g=c,e-=c);d>f?(c=f,d-=f):(c=d,d=f-d);switch(a.action){case "start":this._start(g,c,e,d);break;case "update":this._update(g,c,e,d);break;case "end":this._end(g,c,e,d,b)}a.stopPropagation()};e.prototype._redraw=function(){if(this._rafId&&(this._rafId=null,this._overlay)){var a=this._box,b=a.x,c=a.y,d=a.width,a=a.height; this._updateBox(b,c,d,a);this._updateBackground(b,c,d,a);this._rafId=requestAnimationFrame(this._redraw)}};a([d.property()],e.prototype,"navigation",void 0);a([d.property()],e.prototype,"view",null);return e=a([d.subclass("esri.views.2d.navigation.ZoomBox")],e)}(d.declared(e))})},"esri/views/2d/navigation/actions/Pan":function(){define("require exports ../../../../core/tsSupport/declareExtendsHelper ../../../../core/tsSupport/decorateHelper ../../../../core/Accessor ../../../../core/accessorSupport/decorators ../../viewpointUtils ../../../3d/lib/glMatrix ../../../navigation/PanPlanarMomentumEstimator".split(" "), function(p,g,b,a,e,d,c,k,f){return function(e){function h(a){var b=e.call(this)||this;b.animationTime=0;b.momentumEstimator=new f.PanPlanarMomentumEstimator(500,6,.92);b.momentum=null;b.tmpMomentum=k.vec3.create();b.momentumFinished=!1;b.viewpoint=c.create();b.watch("momentumFinished",function(a){a&&b.navigation.stop()});return b}b(h,e);h.prototype.begin=function(a,b){this.navigation.begin();this.momentumEstimator.reset();this.addToEstimator(b);this.previousDrag=b};h.prototype.update=function(a,b){this.addToEstimator(b); var d=b.center.x,e=b.center.y,f=this.previousDrag,d=f?f.center.x-d:-d,e=f?e-f.center.y:e;a.viewpoint=c.translateBy(this.viewpoint,a.viewpoint,[d||0,e||0]);this.previousDrag=b};h.prototype.end=function(a,b){this.addToEstimator(b);this.momentum=this.momentumEstimator.evaluateMomentum();this.animationTime=0;if(this.momentum)this.onAnimationUpdate(a);this.previousDrag=null;this.navigation.end()};h.prototype.addToEstimator=function(a){var b=k.vec3.createFrom(-a.center.x,a.center.y,0);this.momentumEstimator.add(b, b,.001*a.timestamp)};h.prototype.onAnimationUpdate=function(a){var b=this;this.navigation.animationManager.animateContinous(a.viewpoint,function(d,e){b.momentumFinished=!b.momentum||b.momentum.isFinished(b.animationTime);e*=.001;if(!b.momentumFinished){var f=b.momentum.valueDelta(b.animationTime,e);k.vec3.scale(b.momentum.direction,f,b.tmpMomentum);a.viewpoint=c.translateBy(d,d,b.tmpMomentum)}b.animationTime+=e})};h.prototype.stopMomentumNavigation=function(){this.momentum&&(this.momentumEstimator.reset(), this.momentum=null,this.navigation.stop())};a([d.property()],h.prototype,"momentumFinished",void 0);a([d.property()],h.prototype,"viewpoint",void 0);a([d.property()],h.prototype,"navigation",void 0);return h=a([d.subclass("esri.views.2d.navigation.actions.Pan")],h)}(d.declared(e))})},"esri/views/navigation/PanPlanarMomentumEstimator":function(){define("require exports ../../core/tsSupport/extendsHelper ../3d/lib/glMatrix ./FilteredFiniteDifference ./Momentum".split(" "),function(p,g,b,a,e,d){Object.defineProperty(g, "__esModule",{value:!0});var c=function(a){function c(b,c,d,e,f){b=a.call(this,b,c,d)||this;b.sceneVelocity=e;b.direction=f;return b}b(c,a);c.prototype.value=function(b){return a.prototype.valueFromInitialVelocity.call(this,this.sceneVelocity,b)};return c}(d.Momentum);g.PanPlanarMomentum=c;p=function(){function b(b,c,d){void 0===b&&(b=300);void 0===c&&(c=12);void 0===d&&(d=.84);this.minimumInitialVelocity=b;this.stopVelocity=c;this.friction=d;this.time=new e.FilteredFiniteDifference(.6);this.screen= [new e.FilteredFiniteDifference(.4),new e.FilteredFiniteDifference(.4)];this.scene=[new e.FilteredFiniteDifference(.6),new e.FilteredFiniteDifference(.6),new e.FilteredFiniteDifference(.6)];this.tmpDirection=a.vec3d.create()}b.prototype.add=function(a,b,c){this.time.hasLastValue&&.015>this.time.computeDelta(c)||(this.screen[0].update(a[0]),this.screen[1].update(a[1]),this.scene[0].update(b[0]),this.scene[1].update(b[1]),this.scene[2].update(b[2]),this.time.update(c))};b.prototype.reset=function(){this.screen[0].reset(); this.screen[1].reset();this.scene[0].reset();this.scene[1].reset();this.scene[2].reset();this.time.reset()};b.prototype.evaluateMomentum=function(){if(!this.screen[0].hasFilteredDelta)return null;var a=this.screen[0].filteredDelta,b=this.screen[1].filteredDelta,a=Math.sqrt(a*a+b*b)/this.time.filteredDelta;return Math.abs(a)this.duration};Object.defineProperty(a.prototype,"friction",{get:function(){return this._friction},enumerable:!0,configurable:!0});a.prototype.value=function(a){return this.valueFromInitialVelocity(this._initialVelocity,a)};a.prototype.valueDelta=function(a,b){var c=this.value(a);return this.value(a+b)-c};a.prototype.valueFromInitialVelocity=function(a,b){b=Math.min(b,this.duration); var c=1-this.friction;return a*(Math.pow(c,b)-1)/Math.log(c)};return a}();g.Momentum=p})},"esri/views/2d/navigation/actions/Pinch":function(){define("require exports ../../../../core/tsSupport/declareExtendsHelper ../../../../core/tsSupport/decorateHelper ../../../../core/Accessor ../../../../core/accessorSupport/decorators ../../viewpointUtils ../../libs/gl-matrix/vec2 ../../../navigation/RotationMomentumEstimator ../../../navigation/ZoomMomentumEstimator".split(" "),function(p,g,b,a,e,d,c,k,f,l){return function(e){function h(a){var b= e.call(this,a)||this;b._animationTime=0;b._momentumFinished=!1;b._rotateMomentumEstimator=new f.RotationMomentumEstimator(.6,.15,.95);b._rotationDirection=1;b._zoomDirection=1;b._zoomFirst=null;b._zoomMomentumEstimator=new l.ZoomMomentumEstimator;b.zoomMomentum=null;b.rotateMomentum=null;b.viewpoint=c.create();b.watch("_momentumFinished",function(a){a&&b.navigation.stop()});return b}b(h,e);h.prototype.begin=function(a,b){this.navigation.begin();this._rotateMomentumEstimator.reset();this._zoomMomentumEstimator.reset(); this._previousAngle=this._startAngle=b.angle;this._previousRadius=this._startRadius=b.radius;this._startTimestamp=b.timestamp;a.constraints.rotationEnabled&&this.addToRotateEstimator(0,b.timestamp);this.addToZoomEstimator(b,1)};h.prototype.update=function(a,b){if(!(100>b.timestamp-this._startTimestamp)){var c=b.angle,d=b.radius,e=b.center,f=180*Math.abs(c-this._startAngle)/Math.PI,h=Math.abs(d-this._startRadius);if(!(1>=f&&1>=h)){var g=this._startRadius/d;this._previousRadius&&(d/=this._previousRadius, c=180*(c-this._previousAngle)/Math.PI,this._rotationDirection=0<=c?1:-1,this._zoomDirection=1<=d?1:-1,f=h-f,null==this._zoomFirst&&(this._zoomFirst=0a};h.prototype.canZoomOut=function(a){var b=a.scale;a=a.constraints.effectiveMinScale;return 0===a||bb._zoomDirection,h=!b.rotateMomentum||b.rotateMomentum.isFinished(b._animationTime),f=f||!b.zoomMomentum||b.zoomMomentum.isFinished(b._animationTime);e*=.001;b._momentumFinished=h&&f;if(!b._momentumFinished){var h= b.rotateMomentum?Math.abs(b.rotateMomentum.valueDelta(b._animationTime,e))*b._rotationDirection*180/Math.PI:0,f=b.zoomMomentum?Math.abs(b.zoomMomentum.valueDelta(b._animationTime,e)):1,g=k.create(),l=k.create();b._center&&(k.set(g,b._center.x,b._center.y),c.getPaddingScreenTranslation(l,a.size,a.padding),k.add(g,g,l),c.scaleAndRotateBy(d,a.viewpoint,f,h,g,a.size))}b._animationTime+=e})};h.prototype.stopMomentumNavigation=function(){if(this.rotateMomentum||this.zoomMomentum)this.rotateMomentum&&(this._rotateMomentumEstimator.reset(), this.rotateMomentum=null),this.zoomMomentum&&(this._zoomMomentumEstimator.reset(),this.zoomMomentum=null),this.navigation.stop()};a([d.property()],h.prototype,"_momentumFinished",void 0);a([d.property()],h.prototype,"viewpoint",void 0);a([d.property()],h.prototype,"navigation",void 0);return h=a([d.subclass("esri.views.2d.navigation.actions.Pinch")],h)}(d.declared(e))})},"esri/views/navigation/RotationMomentumEstimator":function(){define(["require","exports","../../core/tsSupport/extendsHelper","./MomentumEstimator"], function(p,g,b,a){Object.defineProperty(g,"__esModule",{value:!0});p=function(a){function d(b,d,e,g){void 0===b&&(b=3);void 0===d&&(d=.01);void 0===e&&(e=.95);void 0===g&&(g=12);return a.call(this,b,d,e,g)||this}b(d,a);d.prototype.add=function(b,d){if(this.value.hasLastValue){var c=this.value.lastValue;for(b-=c;b>Math.PI;)b-=2*Math.PI;for(;b<-Math.PI;)b+=2*Math.PI;b=c+b}a.prototype.add.call(this,b,d)};return d}(a.MomentumEstimator);g.RotationMomentumEstimator=p})},"esri/views/navigation/MomentumEstimator":function(){define("require exports ../../core/tsSupport/extendsHelper ../3d/support/mathUtils ./FilteredFiniteDifference ./Momentum".split(" "), function(p,g,b,a,e,d){Object.defineProperty(g,"__esModule",{value:!0});p=function(){function b(a,b,c,d){void 0===a&&(a=2.5);void 0===b&&(b=.01);void 0===c&&(c=.95);void 0===d&&(d=12);this.minimumInitialVelocity=a;this.stopVelocity=b;this.friction=c;this.maxVelocity=d;this.value=new e.FilteredFiniteDifference(.8);this.time=new e.FilteredFiniteDifference(.3)}b.prototype.add=function(a,b){if(this.time.hasLastValue){if(.01>this.time.computeDelta(b))return;if(this.value.hasFilteredDelta){var c=this.value.computeDelta(a); 0>this.value.filteredDelta*c&&this.value.reset()}}this.time.update(b);this.value.update(a)};b.prototype.reset=function(){this.value.reset();this.time.reset()};b.prototype.evaluateMomentum=function(){if(!this.value.hasFilteredDelta)return null;var b=this.value.filteredDelta/this.time.filteredDelta,b=a.clamp(b,-this.maxVelocity,this.maxVelocity);return Math.abs(b)=d.length?this._placeComponent(b,a,"last"):this._placeComponent(b, d[c],"before")):this._placeComponent(b,a,"last")};g.prototype._placeComponent=function(a,b,c){var e=a.widget;e&&!e._started&&"function"===typeof e.postMixInProperties&&"function"===typeof e.buildRendering&&"function"===typeof e.postCreate&&"function"===typeof e.startup&&a.widget.startup();d.place(a.node,b,c)};g.prototype._applyViewPadding=function(){var a=this.container;a&&c.set(a,this._toPxPosition(this._getViewPadding()))};g.prototype._applyUIPadding=function(){this._innerContainer&&c.set(this._innerContainer, this._toPxPosition(this.padding))};g.prototype._toPxPosition=function(a){return{top:this._toPxUnit(a.top),left:this._toPxUnit(a.left),right:this._toPxUnit(a.right),bottom:this._toPxUnit(a.bottom)}};g.prototype._toPxUnit=function(a){return 0===a?0:a+"px"};g.prototype._findByComponent=function(a){var b=null,c;this._components.some(function(d){(c=d===a)&&(b=d);return c});return b};g.prototype._findById=function(a){var b=null,c;this._components.some(function(d){(c=d.id===a)&&(b=d);return c});return b}; g.prototype._findByNode=function(a){var b=null,c;this._components.some(function(d){(c=d.node===a)&&(b=d);return c});return b};a([r.property()],g.prototype,"container",null);a([r.property({dependsOn:["view.height"]})],g.prototype,"height",null);a([r.property()],g.prototype,"padding",void 0);a([r.cast("padding")],g.prototype,"castPadding",null);a([r.property()],g.prototype,"view",void 0);a([r.property({dependsOn:["view.width"]})],g.prototype,"width",null);return g=a([r.subclass("esri.views.ui.UI")], g)}(r.declared(f,l))})},"esri/widgets/Attribution":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/i18n!./Attribution/nls/Attribution ../core/watchUtils ../core/accessorSupport/decorators ./Widget ./Attribution/AttributionViewModel ./support/widget".split(" "),function(p,g,b,a,e,d,c,k,f,l){return function(g){function h(a){a=g.call(this)||this;a._isOpen=!1;a._attributionTextOverflowed=!1;a._prevSourceNodeHeight=0;a.iconClass="esri-icon-description"; a.itemDelimiter=" | ";a.label=e.widgetLabel;a.view=null;a.viewModel=new f;return a}b(h,g);h.prototype.postInitialize=function(){var a=this;this.own(d.on(this,"viewModel.items","change",function(){return a.scheduleRender()}))};Object.defineProperty(h.prototype,"attributionText",{get:function(){return this.viewModel.items.reduce(function(a,b){-1===a.indexOf(b.text)&&a.push(b.text);return a},[]).join(this.itemDelimiter)},enumerable:!0,configurable:!0});h.prototype.render=function(){var a=(b={},b["esri-attribution--open"]= this._isOpen,b);return l.tsx("div",{bind:this,class:"esri-attribution esri-widget",classes:a,onclick:this._toggleState,onkeydown:this._toggleState},this._renderSourcesNode(),l.tsx("div",{class:"esri-attribution__powered-by"},"Powered by ",l.tsx("a",{target:"_blank",href:"http://www.esri.com/",class:"esri-attribution__link"},"Esri")));var b};h.prototype._renderSourcesNode=function(){var a=this._isOpen,b=this._isInteractive(),c=this.attributionText,a=(d={},d["esri-attribution__sources--open"]=a,d["esri-interactive"]= b,d);return l.tsx("div",{afterCreate:this._afterSourcesNodeCreate,afterUpdate:this._afterSourcesNodeUpdate,bind:this,class:"esri-attribution__sources",classes:a,innerHTML:c,role:b?"button":void 0,tabIndex:b?0:-1});var d};h.prototype._afterSourcesNodeCreate=function(a){this._prevSourceNodeHeight=a.clientWidth};h.prototype._afterSourcesNodeUpdate=function(a){var b=!1,c=a.clientHeight;a=a.scrollWidth>=a.clientWidth;var d=this._attributionTextOverflowed!==a;this._attributionTextOverflowed=a;d&&(b=!0); this._isOpen&&(a=c=b)return"";a=a[b];var e=d.center.clone().normalize(),f={};return a.filter(function(a){var b= !f[a.id]&&a.extent.contains(e);b&&(f[a.id]=!0);return b}).sort(function(a,b){return b.score-a.score||a.objectId-b.objectId}).map(function(a){return a.attribution}).join(", ")};a([l.property({readOnly:!0,type:d})],g.prototype,"items",void 0);a([l.property({dependsOn:["view.ready"],readOnly:!0})],g.prototype,"state",null);a([l.property()],g.prototype,"view",void 0);return g=a([l.subclass("esri.widgets.Attribution.AttributionViewModel")],g)}(l.declared(e))})},"esri/widgets/Compass":function(){define("require exports ../core/tsSupport/declareExtendsHelper ../core/tsSupport/decorateHelper dojo/i18n!./Compass/nls/Compass ../core/accessorSupport/decorators ./Widget ./Compass/CompassViewModel ./support/widget".split(" "), function(p,g,b,a,e,d,c,k,f){return function(c){function g(a){a=c.call(this)||this;a.activeMode=null;a.iconClass="esri-icon-locate-circled";a.label=e.widgetLabel;a.modes=null;a.view=null;a.viewModel=new k;return a}b(g,c);g.prototype.reset=function(){};g.prototype.render=function(){var a=this.viewModel.orientation,b=this.viewModel.state,c="disabled"===b,d="compass"===("rotation"===b?"rotation":"compass"),b=(g={},g["esri-disabled"]=c,g["esri-compass--active"]="device-orientation"===this.viewModel.activeMode, g["esri-interactive"]=!c,g),g=(h={},h["esri-icon-compass"]=d,h["esri-icon-dial"]=!d,h);return f.tsx("div",{bind:this,class:"esri-compass esri-widget-button esri-widget",classes:b,onclick:this._start,onkeydown:this._start,role:"button",tabIndex:c?-1:0,"aria-label":e.reset,title:e.reset},f.tsx("span",{"aria-hidden":"true",class:"esri-compass__icon",classes:g,styles:this._toRotationTransform(a)}),f.tsx("span",{class:"esri-icon-font-fallback-text"},e.reset));var g,h};g.prototype._start=function(){var a= this.viewModel;a.nextMode();a.startMode()};g.prototype._toRotationTransform=function(a){return{transform:"rotateZ("+a.z+"deg)"}};a([d.aliasOf("viewModel.activeMode")],g.prototype,"activeMode",void 0);a([d.property()],g.prototype,"iconClass",void 0);a([d.property()],g.prototype,"label",void 0);a([d.aliasOf("viewModel.modes")],g.prototype,"modes",void 0);a([d.aliasOf("viewModel.view")],g.prototype,"view",void 0);a([d.property({type:k}),f.renderable(["viewModel.orientation","viewModel.state"])],g.prototype, "viewModel",void 0);a([d.aliasOf("viewModel.reset")],g.prototype,"reset",null);a([f.accessibleHandler()],g.prototype,"_start",null);return g=a([d.subclass("esri.widgets.Compass")],g)}(d.declared(c))})},"esri/widgets/Compass/CompassViewModel":function(){define("require exports ../../core/tsSupport/declareExtendsHelper ../../core/tsSupport/decorateHelper ../../core/Accessor ../../core/Handles ../../core/Logger ../../core/promiseUtils ../../core/watchUtils ../../core/accessorSupport/decorators".split(" "), function(p,g,b,a,e,d,c,k,f,l){var h=c.getLogger("esri.widgets.CompassViewModel");return function(c){function e(a){a=c.call(this,a)||this;a._handles=new d;a.canUseHeading=!1;a.orientation={x:0,y:0,z:0};a.view=null;a._updateForCamera=a._updateForCamera.bind(a);a._updateForRotation=a._updateForRotation.bind(a);a._updateRotationWatcher=a._updateRotationWatcher.bind(a);a._updateViewHeading=a._updateViewHeading.bind(a);a._checkHeadingSupport=a._checkHeadingSupport.bind(a);a._canUseHeading();return a}b(e, c);e.prototype.initialize=function(){this._handles.add(f.init(this,"view",this._updateRotationWatcher))};e.prototype.destroy=function(){this._removeCheckHeadingListener();this._removeOrientationListener();this._handles.destroy();this.view=this._handles=null};Object.defineProperty(e.prototype,"activeMode",{get:function(){var a=this._get("activeMode");return a?a:(a=this.modes)?a[0]:"none"},set:function(a){this.stopMode();this._set("activeMode",a);void 0===a&&this._clearOverride("activeMode")},enumerable:!0, configurable:!0});Object.defineProperty(e.prototype,"canShowNorth",{get:function(){var a=this.get("view.spatialReference");return a&&(a.isWebMercator||a.isWGS84)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"modes",{get:function(){return this._get("modes")||["reset"]},set:function(a){this._set("modes",a);void 0===a&&this._clearOverride("modes")},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"state",{get:function(){return this.get("view.ready")?this.canShowNorth? "compass":"rotation":"disabled"},enumerable:!0,configurable:!0});e.prototype.previousMode=function(){var a=this.modes;2>a.length||(a=a.indexOf(this.activeMode),this._paginateMode(a-1))};e.prototype.nextMode=function(){var a=this.modes;2>a.length||(a=a.indexOf(this.activeMode),this._paginateMode(a+1))};e.prototype.startMode=function(){var a=this.activeMode;"reset"===a&&this.reset();"device-orientation"===a&&(this._removeOrientationListener(),this._addOrientationListener())};e.prototype.stopMode=function(){"device-orientation"=== this.activeMode&&this._removeOrientationListener()};e.prototype.reset=function(){if(this.get("view.ready")){var a={};"2d"===this.view.type?a.rotation=0:a.heading=0;this.view.goTo(a)}};e.prototype._supportsDeviceOrientation=function(){return"DeviceOrientationEvent"in window};e.prototype._paginateMode=function(a){var b=this.modes;this.activeMode=b[(a+b.length)%b.length]};e.prototype._supportsHeading=function(a){var b="number"===typeof a.webkitCompassHeading;return"number"===typeof a.compassHeading|| b||!1};e.prototype._getAccuracy=function(a){return a.compassAccuracy||a.webkitCompassAccuracy||0};e.prototype._getHeading=function(a){return a.webkitCompassHeading||a.compassHeading||void 0};e.prototype._removeCheckHeadingListener=function(){this._supportsDeviceOrientation()&&window.removeEventListener("deviceorientation",this._checkHeadingSupport)};e.prototype._checkHeadingSupport=function(a){this._supportsHeading(a)&&this._set("canUseHeading",!0);this._removeCheckHeadingListener()};e.prototype._canUseHeading= function(){var a=this;this._supportsDeviceOrientation()&&(window.addEventListener("deviceorientation",this._checkHeadingSupport),k.after(500).then(function(){a._removeCheckHeadingListener()}))};e.prototype._getHeadingAdjustment=function(a,b){if("orientation"in window){b=window.orientation;if("number"!==typeof b)return a;a+=b;return 360a?a+360:a}return a};e.prototype._updateViewHeading=function(a){var b=this.view,c=this._getHeading(a),d=this._getAccuracy(a);!b||!b.stationary||"number"!== typeof c||0>c||360b},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"canZoomOut",{get:function(){var a=this.get("view.scale"),b=this.get("view.constraints.effectiveMinScale");return 0===b||a=b&&(e=!0);a=d&&e}return a};a([d.property()],f.prototype,"attached",void 0);a([d.property()],f.prototype,"container",void 0);a([d.property()],f.prototype,"moving",void 0);a([d.property({dependsOn:["moving"]})],f.prototype,"rendering",null);a([d.property({dependsOn:["view.scale","layer.minScale","layer.maxScale"]})],f.prototype,"suspended",void 0);a([d.property({readOnly:!0})], f.prototype,"updateParameters",void 0);a([d.property()],f.prototype,"updateRequested",void 0);a([d.property({dependsOn:["updateRequested","attached"]})],f.prototype,"updating",null);a([d.property()],f.prototype,"view",void 0);return f=a([d.subclass("esri.views.2d.layers.LayerView2D")],f)}(d.declared(c))})},"esri/views/2d/layers/FeatureLayerView2D":function(){define("require exports ../../../core/tsSupport/declareExtendsHelper ../../../core/tsSupport/decorateHelper ../../../core/tsSupport/paramHelper dojo/has ../../../Graphic ../../../core/Collection ../../../core/Error ../../../core/Handles ../../../core/promiseUtils ../../../core/accessorSupport/decorators ../../../layers/graphics/QueryEngine ../../../layers/graphics/controllers/support/controllerUtils ../engine/DOMContainer ../engine/webgl/rendererInfoUtils ./LayerView2D ./support/FeaturesView2D ../../layers/RefreshableLayerView".split(" "), function(p,g,b,a,e,d,c,k,f,l,h,n,r,m,u,q,t,x,v){function B(a){return a&&null!=a._proxy}function w(a){return a&&null!=a.update}return function(e){function g(){var a=null!==e&&e.apply(this,arguments)||this;a._handles=new l;a.container=new u;return a}b(g,e);g.prototype.highlight=function(a,b){var d=this;b=this.featuresView;var e;a instanceof c?e=[a.getAttribute(this.layer.objectIdField)]:"number"===typeof a?e=[a]:k.isCollection(a)?e=a.map(function(a){return a.getAttribute(d.layer.objectIdField)}).toArray(): Array.isArray(a)&&0c;++c){var e=a[Math.min(c, a.length-1)];b.values[c]=e.value;b.opacities[c]=e.opacity}}else if(a.opacityValues){if(!d.isDefined(a.minDataValue)||!d.isDefined(a.maxDataValue)||2!==a.opacityValues.length)return null;b.values[0]=a.minDataValue;b.opacities[0]=a.opacityValues[0];b.values[1]=a.maxDataValue;b.opacities[1]=a.opacityValues[1];for(c=2;8>c;++c)b.values[c]=a.maxDataValue,b.opacities[c]=a.opacityValues[1]}else return null;else if(a.stops&&0<=a.stops.length||a.opacityValues&&0<=a.opacityValues.length)for(a=a.stops&&0<=a.stops.length? a.stops[0].opacity:a.opacityValues[0],c=0;8>c;c++)b.values[c]=Infinity,b.opacities[c]=a;else return null;return b}Object.defineProperty(g,"__esModule",{value:!0});g.getTypeOfSizeVisualVariable=k;g.getVisualVariableSizeValueRepresentationRatio=function(a,b){if(!a||!b)return a;switch(b){case "radius":case "distance":return 2*a;case "area":return Math.sqrt(a)}return a};g.stopToSizeStop=f;g.normalizeSizeStops=l;g.normalizeSizeElement=h;g.getVisualVariablesFields=function(a){var b=a&&0q;q++){var w=d[Math.min(q,r-1)];m.push(w.value);p.push(b.pt2px(w.size))}g.size.fieldStops={values:m,sizes:p};break;case e.WGLVVFlag.SIZE_UNIT_VALUE:g.size.unitValue={unit:d.valueUnit,valueRepresentation:d.valueRepresentation}}else if("color"===m)for(m=c.convertVisualVariables([d],{modelSize:null,symbolSize:null,unitInMeters:1,transformation:null}),g.color=m.color,q=0;32>q;q+=4)a.premultiplyAlpha(g.color.colors,q,!0);else"opacity"===m?g.opacity=n(d):"rotation"=== m&&(g.rotation={type:d.rotationType})});return{vvFields:f,vvRanges:g}}})},"esri/views/3d/layers/support/FastSymbolUpdates":function(){define(["require","exports","../../../../renderers/support/utils","../graphics/graphicUtils","../../lib/glMatrix"],function(p,g,b,a,e){function d(a){return null!==a&&void 0!==a}function c(a){return"number"===typeof a}function k(a,b){a&&a.push(b)}function f(a,e,f,g,h){var m=a.minSize,n=a.maxSize;if(a.expression)return k(h,"Could not convert size info: expression not supported"), !1;if(a.useSymbolValue)return a=g.symbolSize[f],e.minSize[f]=a,e.maxSize[f]=a,e.offset[f]=e.minSize[f],e.factor[f]=0,e.type[f]=1,!0;if(d(a.field)){if(d(a.stops)){if(2===a.stops.length&&c(a.stops[0].size)&&c(a.stops[1].size))return l(a.stops[0].size,a.stops[1].size,a.stops[0].value,a.stops[1].value,e,f),e.type[f]=1,!0;k(h,"Could not convert size info: stops only supported with 2 elements");return!1}if(c(m)&&c(n)&&d(a.minDataValue)&&d(a.maxDataValue))return l(m,n,a.minDataValue,a.maxDataValue,e,f), e.type[f]=1,!0;if(null!=b.meterIn[a.valueUnit])return e.minSize[f]=-Infinity,e.maxSize[f]=Infinity,e.offset[f]=0,e.factor[f]=1/b.meterIn[a.valueUnit],e.type[f]=1,!0;"unknown"===a.valueUnit?k(h,"Could not convert size info: proportional size not supported"):k(h,"Could not convert size info: scale-dependent size not supported");return!1}if(!d(a.field)){if(a.stops&&a.stops[0]&&c(a.stops[0].size))return e.minSize[f]=a.stops[0].size,e.maxSize[f]=a.stops[0].size,e.offset[f]=e.minSize[f],e.factor[f]=0,e.type[f]= 1,!0;if(c(m))return e.minSize[f]=m,e.maxSize[f]=m,e.offset[f]=m,e.factor[f]=0,e.type[f]=1,!0}k(h,"Could not convert size info: unsupported variant of sizeInfo");return!1}function l(a,b,c,d,e,f){d=0d;++d){var e=b.unitInMeters;1===a.type[d]&&(e*=b.modelSize[d],a.type[d]=2);a.minSize[d]/=e;a.maxSize[d]/=e;a.offset[d]/=e;a.factor[d]/=e}if(0!==a.type[0])b=0;else if(0!==a.type[1])b=1;else if(0!==a.type[2])b=2;else return k(c,"No size axis contains a valid size or scale"), !1;for(d=0;3>d;++d)0===a.type[d]&&(a.minSize[d]=a.minSize[b],a.maxSize[d]=a.maxSize[b],a.offset[d]=a.offset[b],a.factor[d]=a.factor[b],a.type[d]=a.type[b]);return!0}function r(a,b,c){a[4*b+0]=c.r/255;a[4*b+1]=c.g/255;a[4*b+2]=c.b/255;a[4*b+3]=c.a}function m(a,b,c){if(a.normalizationField)return k(c,"Could not convert color info: unsupported property"),null;if("string"===typeof a.field)if(a.stops){if(8c;++c){var e=a[Math.min(c,a.length-1)];b.color.values[c]=e.value;r(b.color.colors,c,e.color)}}else if(a.colors){if(!d(a.minDataValue)||!d(a.maxDataValue))return k(c,"Could not convert color info: missing data values"),null;if(2!==a.colors.length)return k(c,"Could not convert color info: invalid colors array"),null;b.color={field:a.field,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};b.color.values[0]=a.minDataValue;r(b.color.colors,0,a.colors[0]);b.color.values[1]=a.maxDataValue;r(b.color.colors,1,a.colors[1]);for(c=2;8>c;++c)b.color.values[c]=a.maxDataValue,r(b.color.colors,c,a.colors[1])}else return k(c,"Could not convert color info: missing stops or colors"),null;else if(a.stops&&0<=a.stops.length||a.colors&&0<=a.colors.length)for(a=a.stops&&0<=a.stops.length?a.stops[0].color:a.colors[0],b.color={field:null,values:[0, 0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},c=0;8>c;c++)b.color.values[c]=Infinity,r(b.color.colors,c,a);else return k(c,"Could not convert color info: no field and no colors/stops"),null;return b}function u(a,b,c,d){a=2===c&&"arithmetic"===a.rotationType;b.offset[c]=a?90:0;b.factor[c]=a?-1:1;b.type[c]=1}function q(a,b,c){if("string"!==typeof a.field)return k(c,"Could not convert rotation info: field is not a string"),null;if(!b.rotation)b.rotation={field:a.field, offset:[0,0,0],factor:[1,1,1],type:[0,0,0]};else if(a.field)if(!b.rotation.field)b.rotation.field=a.field;else if(a.field!==b.rotation.field)return k(c,"Could not convert rotation info: multiple fields in use"),null;switch(a.axis){case "tilt":return u(a,b.rotation,0,c),b;case "roll":return u(a,b.rotation,1,c),b;case null:case void 0:case "heading":return u(a,b.rotation,2,c),b;default:return k(c,'Could not convert rotation info: unknown axis "'+a.axis+'""'),null}}function t(a,b,c){if(!a)return null; var d=!b.supportedTypes||!!b.supportedTypes.size,e=!b.supportedTypes||!!b.supportedTypes.color,f=!b.supportedTypes||!!b.supportedTypes.rotation;return(a=a.reduce(function(a,g){if(!a)return a;if(g.valueExpression)return k(c,"Could not convert visual variables: arcade expressions not supported"),null;switch(g.type){case "size":return d?h(g,a,b,c):a;case "color":return e?m(g,a,c):a;case "rotation":return f?q(g,a,c):a;default:return k(c,"Could not convert visual variables: unsupported type "+g.type), null}},{size:null,color:null,rotation:null}))&&a.size&&!n(a.size,b,c)?null:a}function x(a,b,c){if(!!a!==!!b||a&&a.field!==b.field)return!1;if(a&&"rotation"===c)for(c=0;3>c;c++)if(a.type[c]!==b.type[c]||a.offset[c]!==b.offset[c]||a.factor[c]!==b.factor[c])return!1;return!0}function v(a,b){var c={vvSizeEnabled:!1,vvSizeMinSize:null,vvSizeMaxSize:null,vvSizeOffset:null,vvSizeFactor:null,vvSizeValue:null,vvColorEnabled:!1,vvColorValues:null,vvColorColors:null,vvSymbolAnchor:null,vvSymbolRotation:null}, d=a&&null!=a.size;a&&a.size?(c.vvSizeEnabled=!0,c.vvSizeMinSize=a.size.minSize,c.vvSizeMaxSize=a.size.maxSize,c.vvSizeOffset=a.size.offset,c.vvSizeFactor=a.size.factor):a&&d&&(c.vvSizeValue=b.transformation.scale);a&&d&&(c.vvSymbolAnchor=b.transformation.anchor,c.vvSymbolRotation=b.transformation.rotation);a&&a.color&&(c.vvColorEnabled=!0,c.vvColorValues=a.color.values,c.vvColorColors=a.color.colors);return c}Object.defineProperty(g,"__esModule",{value:!0});g.convertVisualVariables=t;g.initFastSymbolUpdatesState= function(a,b,c){return b&&a&&!a.disableFastUpdates?(a=t(a.visualVariables,c))?{enabled:!0,visualVariables:a,materialParameters:v(a,c),customTransformation:a&&null!=a.size}:{enabled:!1}:{enabled:!1}};g.updateFastSymbolUpdatesState=function(a,b,c){if(!b||!a.enabled)return!1;var d=a.visualVariables;b=t(b.visualVariables,c);if(!(b&&x(d.size,b.size,"size")&&x(d.color,b.color,"color")&&x(d.rotation,b.rotation,"rotation")))return!1;a.visualVariables=b;a.materialParameters=v(b,c);a.customTransformation=b&& null!=b.size;return!0};g.getMaterialParams=v;var B;(function(b){var c=e.mat4d,d=e.vec3,f=c.create(),g=d.create();b.evaluateModelTransform=function(b,d,e){if(!b.vvSizeEnabled)return e;c.identity(f);c.multiply(e,f,f);a.computeObjectRotation(b.vvSymbolRotation[2],b.vvSymbolRotation[0],b.vvSymbolRotation[1],f);if(b.vvSizeEnabled){for(e=0;3>e;++e){var h=b.vvSizeOffset[e]+d[0]*b.vvSizeFactor[e],k=e;var l=b.vvSizeMinSize[e],m=b.vvSizeMaxSize[e],h=hm?m:h;g[k]=h}c.scale(f,g,f)}else c.scale(f,b.vvSizeValue, f);c.translate(f,b.vvSymbolAnchor,f);return f}})(B||(B={}));g.evaluateModelTransform=B.evaluateModelTransform})},"esri/views/3d/layers/graphics/graphicUtils":function(){define(["require","exports","../../../../geometry","../../../../geometry/support/webMercatorUtils","../../lib/glMatrix"],function(p,g,b,a,e){function d(c,d){var e=c.spatialReference;e.equals(d)||(e.isWebMercator&&d.wkid===b.SpatialReference.WGS84.wkid?a.webMercatorToGeographic(c,!1,c):d.isWebMercator&&e.wkid===b.SpatialReference.WGS84.wkid&& a.geographicToWebMercator(c,!1,c))}function c(a){if(Array.isArray(a)){for(var b=0;bg;++g)f[g]=a&&null!=a[g]?a[g]:c&&null!=c[g]?c[g]:e[g];f[3]=null!=b?b:null!=d?d:e[3];return f};g.computeObjectScale=function(a,b,c,d){void 0===a&&(a=l);void 0===d&&(d=1);var e=Array(3);if(null== b||null==c)e[0]=1,e[1]=1,e[2]=1;else{for(var f=void 0,g=0,h=2;0<=h;h--){var k=a[h],m=void 0,n=null!=k,p=0===h&&!f&&!n,r=c[h];"symbolValue"===k||p?m=0!==r?b[h]/r:1:n&&"proportional"!==k&&isFinite(k)&&(m=0!==r?k/r:1);null!=m&&(f=e[h]=m,g=Math.max(g,Math.abs(m)))}for(h=2;0<=h;h--)null==e[h]?e[h]=f:0===e[h]&&(e[h]=.001*g)}for(h=2;0<=h;h--)e[h]/=d;return e};g.computeSizeWithResourceSize=function(a,b){var c=b.width,d=b.depth,e=b.height;b=b.isPrimitive?10:1;if(null==c&&null==e&&null==d)return[b*a[0],b*a[1], b*a[2]];for(var c=[c,d,e],f,d=0;3>d;d++)if(e=c[d],null!=e){f=e/a[d];break}for(d=0;3>d;d++)null==c[d]&&(c[d]=a[d]*f);return c};g.validateSymbolLayerSize=function(a){null!=a.isPrimitive&&(a=[a.width,a.depth,a.height]);return c(a)?null:"Symbol sizes may not be negative values"};g.computeObjectRotation=function(a,b,c,d){void 0===d&&(d=f.identity());a=a||0;b=b||0;c=c||0;0!==a&&f.rotateZ(d,-a/180*Math.PI,d);0!==b&&f.rotateX(d,b/180*Math.PI,d);0!==c&&f.rotateY(d,c/180*Math.PI,d);return d}})},"esri/views/2d/layers/support/FeaturesView2D":function(){define("require exports ../../../../core/tsSupport/declareExtendsHelper ../../../../core/tsSupport/decorateHelper ../../../../Graphic ../../../../core/Collection ../../../../core/Handles ../../../../core/Logger ../../../../core/promiseUtils ../../../../core/accessorSupport/decorators ../../../../renderers/support/renderingInfoUtils ../../../../symbols/Symbol3D ../../engine/graphics/GFXGroup ../../engine/graphics/GFXObject ../../engine/graphics/GFXSurface ../../../layers/GraphicsView".split(" "), function(p,g,b,a,e,d,c,k,f,l,h,n,r,m,u,q){var t=k.getLogger("esri.views.2d.layers.support.FeaturesView2D");return function(g){function k(){for(var a=[],b=0;bg)){c.save();var k=d.toScreen(e,this.x,this.y),d=k[0],k=k[1];.99g?c.translate(Math.round(d),Math.round(k)):(c.translate(d,k),c.scale(g,g));a&&c.rotate(a*Math.PI/180);b.rotation&&(c.translate(.5*this.width,.5*this.height),c.rotate(-b.rotation*Math.PI/180),c.translate(.5*-this.width,.5*-this.height));a=(this.x-b.x)/b.resolution;g=-(this.y-b.y)/b.resolution;d=this.resolution/ b.resolution*b.width;k=this.resolution/b.resolution*b.height;c.clearRect(0,0,this.width,this.height);b.draw(c,Math.round(a),Math.round(g),Math.round(d),Math.round(k),0,0,this.width,this.height);c.restore()}};return c}(a)})},"esri/views/2d/engine/BitmapContainer":function(){define("require exports ../../../core/tsSupport/extendsHelper ../../../core/tsSupport/decorateHelper ../ViewState ../viewStateUtils ./Container".split(" "),function(p,g,b,a,e,d,c){var k=[0,0];return function(a){function c(){var b= null!==a&&a.apply(this,arguments)||this;b._childrenCanvas=null;b._childrenRenderParameters={context:null,pixelRatio:1,state:new e,stationary:!0};return b}b(c,a);c.prototype.attach=function(b){this._childrenCanvas||(this._childrenCanvas=document.createElement("canvas"),this._childrenRenderParameters.context=this._childrenCanvas.getContext("2d"));return a.prototype.attach.call(this,b)};c.prototype.detach=function(b){a.prototype.detach.call(this,b);this._childrenCanvas=null;this._childrenRenderParameters.context= null};c.prototype.doRender=function(b){this.visible&&a.prototype.doRender.call(this,b)};c.prototype.prepareChildrenRenderParameters=function(a){var b=this._childrenCanvas,c=this._childrenRenderParameters,e=a.state,f=e.pixelRatio,g=c.state;g.copy(e);var h=d.getOuterSize(k,e),e=h[0],h=h[1],e=e*f,h=h*f;g.size=k;g.viewpoint.rotation=0;b.width!==e||b.height!==h?(b.width=e,b.height=h):c.context.clearRect(0,0,e,h);c.pixelRatio=a.pixelRatio;return c};c.prototype.beforeRenderChildren=function(a,b){this.sortChildren(function(a, b){return b.resolution-a.resolution})};c.prototype.afterRenderChildren=function(a,b){var c=a.context;a=a.state;var d=b.context;b=b.state;0===a.rotation?c.drawImage(d.canvas,0,0):(c.save(),c.translate(.5*a.width,.5*a.height),c.rotate(a.rotation*Math.PI/180),c.translate(.5*-a.width,.5*-a.height),c.drawImage(d.canvas,.5*(a.width-b.width),.5*(a.height-b.height)),c.restore())};return c}(c)})},"esri/views/2d/viewStateUtils":function(){define(["require","exports"],function(p,g){Object.defineProperty(g,"__esModule", {value:!0});var b=Math.PI/180;g.snapToPixel=function(a,b,d){var c=d.resolution;d=d.size;a[0]=c*(Math.round(b[0]/c)+d[0]%2*.5);a[1]=c*(Math.round(b[1]/c)+d[1]%2*.5);return a};g.getOuterSize=function(a,e){var d=e.rotation*b,c=Math.abs(Math.cos(d)),d=Math.abs(Math.sin(d)),g=e.size;e=g[0];g=g[1];a[0]=Math.round(g*d+e*c);a[1]=Math.round(g*c+e*d);return a};g.getBBox=function(a,b,d,c){var e=b[0];b=b[1];var f=c[0];c=c[1];d*=.5;a[0]=e-d*f;a[1]=b-d*c;a[2]=e+d*f;a[3]=b+d*c;return a};g.bboxIntersects=function(a, b){var d=a[1],c=a[2],e=a[3],f=b[0],g=b[1],h=b[3];return!(a[0]>b[2]||ch||e