text: (this["webpackJsonpmy-app"]=this["webpackJsonpmy-app"]||[]).push([[40,7],{1014:function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return L}));var s=i(0),r=i(4),n=i(12),a=i(1),o=(i(5),i(6),i(2)),c=i(311),l=i(636),h=i(567),u=i(613),d=i(534),f=i(621);let p=class extends f.a{renderChildren(t){if(t.drawPhase!==d.c.HIGHLIGHT)return;if(this.attributeView.bindTextures(t.context),!this.children.some(t=>t.hasData))return;super.renderChildren(t);const{painter:e}=t,i=e.effects.highlight;i.bind(t),t.context.setColorMask(!0,!0,!0,!0),t.context.clear(16384),this._renderChildren(t,i.defines.concat(["highlightAll"])),i.draw(t),i.unbind()}};p=Object(s.a)([Object(o.a)("esri.views.2d.layers.support.HighlightGraphicContainer")],p);var m=p,y=i(685),x=i(566),_=i(9),g=i(3),b=i(92),v=i(721),O=i(649),j=i(72),w=i(677);const T=t=>{let e=class extends t{initialize(){this.exportImageParameters=new v.a({layer:this.layer})}destroy(){this.exportImageParameters.destroy(),this.exportImageParameters=null}get exportImageVersion(){var t;return null==(t=this.exportImageParameters)||t.commitProperty("version"),this.commitProperty("timeExtent"),(this._get("exportImageVersion")||0)+1}async fetchPopupFeatures(t,e){const{layer:i}=this;if(!t)return Promise.reject(new _.a("mapimagelayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:i}));const s=this.get("view.scale"),r=[],a=async t=>{const i=0===t.minScale||s<=t.minScale,n=0===t.maxScale||s>=t.maxScale;if(t.visible&&i&&n)if(t.sublayers)t.sublayers.forEach(a);else if(t.popupEnabled){const i=Object(w.a)(t,{...e,defaultPopupTemplateEnabled:!1});Object(g.j)(i)&&r.unshift({sublayer:t,popupTemplate:i})}},o=i.sublayers.toArray().reverse().map(a);await Promise.all(o);const c=r.map(async({sublayer:i,popupTemplate:s})=>{await i.load().catch(()=>{});const r=i.createQuery(),n=Object(g.j)(e)?e.event:null,a=Object(O.a)({renderer:i.renderer,event:n}),o=this.createFetchPopupFeaturesQueryGeometry(t,a);r.geometry=o,r.outFields=await Object(w.b)(i,s);const c=await this._loadArcadeModules(s);return c&&c.arcadeUtils.hasGeometryOperations(s)||(r.maxAllowableOffset=o.width/a),(await i.queryFeatures(r)).features});return(await Object(n.j)(c)).reduce((t,e)=>e.value?[...t,...e.value]:t,[]).filter(t=>null!=t)}canResume(){var t;return!!super.canResume()&&(null==(t=this.timeExtent)||!t.isEmpty)}_loadArcadeModules(t){if(t.get("expressionInfos.length"))return Object(j.e)()}};return Object(s.a)([Object(a.b)()],e.prototype,"exportImageParameters",void 0),Object(s.a)([Object(a.b)({readOnly:!0})],e.prototype,"exportImageVersion",null),Object(s.a)([Object(a.b)()],e.prototype,"layer",void 0),Object(s.a)([Object(a.b)()],e.prototype,"suspended",void 0),Object(s.a)([Object(a.b)(b.a)],e.prototype,"timeExtent",void 0),e=Object(s.a)([Object(o.a)("esri.views.layers.MapImageLayerView")],e),e};var S=i(622),M=i(676);const I=r.a.getLogger("esri.views.2d.layers.MapImageLayerView2D");let R=class extends(T(Object(S.a)(Object(h.a)(x.a)))){constructor(){super(...arguments),this._highlightGraphics=new c.b}hitTest(){return null}update(t){this.strategy.update(t).catch(t=>{Object(n.m)(t)||I.error(t)})}attach(){const{imageMaxWidth:t,imageMaxHeight:e,version:i}=this.layer,s=i>=10.3,r=i>=10;this._bitmapContainer=new l.a,this.container.addChild(this._bitmapContainer);const n=new u.a({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new m(this.view.featuresTilingScheme)});this.container.addChild(n.container),this.strategy=new y.a({container:this._bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxWidth:t,imageMaxHeight:e,imageRotationSupported:s,imageNormalizationSupported:r,hidpi:!0}),this.handles.add(this.watch("exportImageVersion",()=>this.requestUpdate()),"exportImageVersion"),this.handles.add(this.watch("view.floors",()=>this.requestUpdate()),"view.floors"),this.requestUpdate()}detach(){this.handles.remove("exportImageVersion"),this.handles.remove("view.floors"),this.strategy.destroy(),this.container.removeAllChildren(),this._bitmapContainer.removeAllChildren()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}highlight(t,e){return this._highlightGraphics.add(t),{remove:()=>{this._highlightGraphics.remove(t)}}}createFetchPopupFeaturesQueryGeometry(t,e){return Object(M.a)(t,e,this.view)}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(t,e,i,s){return this.layer.fetchImage(t,e,i,{timeExtent:this.timeExtent,floors:this.view.floors,...s})}};Object(s.a)([Object(a.b)()],R.prototype,"strategy",void 0),Object(s.a)([Object(a.b)()],R.prototype,"updating",void 0),R=Object(s.a)([Object(o.a)("esri.views.2d.layers.MapImageLayerView2D")],R);var L=R},541:function(t,e,i){"use strict";i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return c})),i.d(e,"d",(function(){return h})),i.d(e,"e",(function(){return u})),i.d(e,"f",(function(){return l})),i.d(e,"g",(function(){return o})),i.d(e,"h",(function(){return n}));const s=0,r=100;function n(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}function a(t,e){return Math.sqrt(t*t+e*e)}function o(t){const e=a(t[0],t[1]);t[0]/=e,t[1]/=e}function c(t,e){return a(t[0]-e[0],t[1]-e[1])}function l(t){return"function"==typeof t}function h(t=2){return 1/Math.max(t,1)}function u(t,e){return[!!t.minScale&&e.scaleToZoom(t.minScale)||s,!!t.maxScale&&e.scaleToZoom(t.maxScale)||r]}},550:function(t,e,i){"use strict";var s,r;function n(t){switch(t){case"left":return s.Left;case"right":return s.Right;case"center":case"justify":return s.Center}}function a(t){switch(t){case"top":return r.Top;case"middle":return r.Center;case"baseline":return r.Baseline;case"bottom":return r.Bottom}}function o(t){switch(t){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return[s.Right,r.Bottom];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return[s.Center,r.Bottom];case"above-right":case"esriServerPointLabelPlacementAboveRight":return[s.Left,r.Bottom];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return[s.Right,r.Center];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":return[s.Center,r.Center];case"center-right":case"esriServerPointLabelPlacementCenterRight":return[s.Left,r.Center];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return[s.Right,r.Top];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return[s.Center,r.Top];case"below-right":case"esriServerPointLabelPlacementBelowRight":return[s.Left,r.Top];case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return[s.Center,r.Baseline];default:return console.debug("Found invalid placement type "+t),[s.Center,r.Center]}}function c(t){switch(t){case s.Right:return-1;case s.Center:return 0;case s.Left:return 1;default:return console.debug("Found invalid horizontal alignment "+t),0}}function l(t){switch(t){case r.Top:return 1;case r.Center:return 0;case r.Bottom:case r.Baseline:return-1;default:return console.debug("Found invalid vertical alignment "+t),0}}function h(t){switch(t){case"left":return s.Left;case"right":return s.Right;case"center":case"justify":return s.Center}}i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return o})),i.d(e,"c",(function(){return h})),i.d(e,"d",(function(){return n})),i.d(e,"e",(function(){return c})),i.d(e,"f",(function(){return a})),i.d(e,"g",(function(){return l})),function(t){t[t.Left=-1]="Left",t[t.Center=0]="Center",t[t.Right=1]="Right"}(s||(s={})),function(t){t[t.Top=1]="Top",t[t.Center=0]="Center",t[t.Bottom=-1]="Bottom",t[t.Baseline=2]="Baseline"}(r||(r={}))},551:function(t,e,i){"use strict";i.d(e,"a",(function(){return c}));var s=i(3),r=i(46),n=i(343),a=i(305);class o{static executeEffects(t,e){const i=Object(r.c)(e);let s=new n.a(i);for(const r of t){const t=Object(a.a)(r);t&&(s=t.execute(s,r,96/72))}return s}static next(t){const e=t.next();return Object(r.d)(e),e}}class c{bindFeature(t,e,i){}write(t,e,i){if(Object(s.i)(this._effects))return this._write(t,e);const r=o.executeEffects(this._effects,e.readLegacyGeometryForDisplay());let n=o.next(r);for(;n;)this._write(t,e,n),n=o.next(r)}_write(t,e,i){}}},552:function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var s=i(9);function r(t,e){if(t&&"name"in t){const i=t;return e&&e.error(new s.a(i.name,i.message,i.details)),!1}return!0}},554:function(t,e,i){"use strict";i.d(e,"a",(function(){return w})),i.d(e,"b",(function(){return j})),i.d(e,"c",(function(){return S})),i.d(e,"d",(function(){return k})),i.d(e,"e",(function(){return B})),i.d(e,"f",(function(){return V})),i.d(e,"g",(function(){return N})),i.d(e,"h",(function(){return R})),i.d(e,"i",(function(){return T})),i.d(e,"j",(function(){return I})),i.d(e,"k",(function(){return P})),i.d(e,"l",(function(){return M}));i(5);var s=i(3),r=i(18),n=i(76),a=i(327),o=i(29),c=i(300),l=i(68),h=i(118),u=i(17),d=i(250),f=i(83),p=i(24),m=i(67),y=i(550),x=i(583),_=i(558);const g=Math.PI/180,b=.04,v=Object(a.a)(),O=Object(c.a)(),j=512,w=50;function T(t,e){if(!e.isWrappable)return null;const[i,s]=Object(f.c)(e);return t[2]>s?[Object(l.g)([t[0],t[1],s,t[3]]),Object(l.g)([i,t[1],i+t[2]-s,t[3]])]:t[0]<i?[Object(l.g)([i,t[1],t[2],t[3]]),Object(l.g)([s-(i-t[0]),t[1],s,t[3]])]:null}function S(t,e,i,s,n,a,o){if(!s||!i.symbol)return t[0]=t[1]=t[2]=t[3]=0,e[0]=e[1]=e[2]=e[3]=0,t;const c=s;if(!Object(u.f)(c)){Object(h.a)(t,c);let s=e[0];0===s&&(s=function t(e){switch(e.symbol.type){case"esriSFS":case"esriPFS":{const t=e.symbol.outline;return t?t.width:0}case"esriSLS":return Object(r.c)(e.symbol.width);case"esriSMS":{const t=e.symbol,i=Object(r.c)(t.xoffset),s=Object(r.c)(t.yoffset);return Object(r.c)(t.size)+Math.sqrt(i*i+s*s)}case"esriPMS":{const t=e.symbol,i=Object(r.c)(t.xoffset),s=Object(r.c)(t.yoffset);return Object(r.c)(Math.max(t.width,t.height))+Math.sqrt(i*i+s*s)}case"esriTS":{const t=[0,0,0,0];N(t,e.symbol,e.mosaicItem);const i=Math.max(Math.abs(t[0]),Math.abs(t[1]));return Math.max(t[2],t[3])+i}case"expanded-cim":{const t=m.a.getEnvelope(e.symbol.data);return t.width!==-1/0&&t.height!==-1/0||(t.width=10,t.height=10,t.x=0,t.y=0),Object(r.c)(Math.sqrt(t.width*t.width+t.height*t.height))}case"composite-symbol":{if(!e.symbol.layers.length)return 0;const i=e.symbol.layers.length-1;return t({symbol:e.symbol.layers[i],mosaicItem:null})}default:return 0}}(i),e[0]=s);const a=n*s/2;return t[0]-=a,t[1]-=a,t[2]+=a,t[3]+=a,t}{const s=c.x,r=c.y;"esriTS"===i.symbol.type&&0===e[2]&&0===e[3]&&N(e,i.symbol,i.mosaicItem),function(t,e,i,s,r,n,a,o){let c;switch(s.type){case"esriSMS":case"esriPMS":c=B(e,i,s,n,a,0);break;case"esriTS":c=V(e,i,s,r,n,0);break;case"cim":case"CIMSymbolReference":case"expanded-cim":c=k(e,i,s,n,a,0)}let l,h,u=0;for(let d=0;d<c.rings[0].length-1;d++)h=c.rings[0][d],l=(e-h[0])*(e-h[0])+(i-h[1])*(i-h[1]),u=Math.max(u,l);u=Math.sqrt(u);let f=Object(d.b)(e-u,o),m=Object(d.b)(e+u,o);if(f>m){const t=Object(p.e)(o);if(t){const[e,i]=t.valid;f=e,m=i}}t[0]=f,t[1]=i-u,t[2]=m,t[3]=i+u}(t,s,r,i.symbol,e,n,a,o)}return t}function M(t){return"text"===t||"esriTS"===t}function I(t){return"simple-marker"===t||"picture-marker"===t||"esriSMS"===t||"esriPMS"===t}function R(t){switch(Object(s.q)(t.geometry).type){case"point":case"multipoint":return 0;case"polyline":return 1;case"polygon":case"extent":return 2}return 0}const L=Object(c.a)(),C=Object(c.a)(),z=Object(c.a)(),E=Object(c.a)(),F=Object(c.a)(),D=Object(c.a)(),A=Object(c.a)();function P(t,e,i,s){Object(o.m)(z,e,i);const r=t.paths;let n,a,c,l,h,u,d,f,p,m=1/0;for(let y=0;y<r.length;y++){const t=r[y];if(!(t.length<2))for(let r=1;r<t.length;r++)n=t[r-1][0],c=t[r-1][1],a=t[r][0],l=t[r][1],h=Math.min(n,a)-s,u=Math.min(c,l)-s,d=Math.max(n,a)+s,f=Math.max(c,l)+s,e<h||e>d||i<u||i>f||(Object(o.m)(L,n,c),Object(o.m)(C,a,l),Object(o.a)(E,C,L),Object(o.a)(F,L,z),Object(o.b)(D,E,Object(o.h)(E,F)/Object(o.h)(E,E)),Object(o.a)(A,F,D),p=Object(o.h)(A,A),m>p&&(m=p))}return Math.sqrt(m)<=s}function B(t,e,i,s,a,c){let l,h;const u=Object(r.c)(i.xoffset),d=Object(r.c)(i.yoffset),f=g*i.angle,p=g*c;switch(i.type){case"esriSMS":l=h=Object(r.c)(i.size);break;case"esriPMS":l=Object(r.c)(i.width),h=Object(r.c)(i.height)}a<b&&(s=b*s/a);const m=Object(n.d)(v);Object(n.h)(m,m,Object(o.m)(O,t,e)),Object(n.f)(m,m,p-f),Object(n.g)(m,m,Object(o.m)(O,s,-s)),Object(n.h)(m,m,Object(o.m)(O,u,-d));const y=[0,0];Object(o.n)(y,Object(o.m)(O,-.5*l,-.5*h),m);const x=[0,0];Object(o.n)(x,Object(o.m)(O,-.5*l,.5*h),m);const _=[0,0];Object(o.n)(_,Object(o.m)(O,.5*l,-.5*h),m);const j=[0,0];return Object(o.n)(j,Object(o.m)(O,.5*l,.5*h),m),{rings:[[y,_,j,x,y]]}}function k(t,e,i,s,a,c){const l=m.a.getEnvelope(i.data);if(!l)return null;a<b&&(s=b*s/a);const h=Object(r.c)(l.width),u=Object(r.c)(l.height),d=Object(r.c)(l.x),f=Object(r.c)(l.y),p=0*g,y=g*c,x=Object(n.d)(v);Object(n.h)(x,x,Object(o.m)(O,t,e)),Object(n.f)(x,x,y-p),Object(n.g)(x,x,Object(o.m)(O,s,s));const _=[0,0];Object(o.n)(_,Object(o.m)(O,d,f+u),x);const j=[0,0];Object(o.n)(j,Object(o.m)(O,d,f),x);const w=[0,0];Object(o.n)(w,Object(o.m)(O,d+h,f+u),x);const T=[0,0];return Object(o.n)(T,Object(o.m)(O,d+h,f),x),{rings:[[_,w,T,j,_]]}}function V(t,e,i,s,a,c){const l=Object(r.c)(i.xoffset),h=Object(r.c)(i.yoffset),u=g*i.angle,d=g*c,f=Object(n.d)(v);Object(n.h)(f,f,Object(o.m)(O,t,e)),Object(n.f)(f,f,d),Object(n.g)(f,f,Object(o.m)(O,a,-a));const p=s[0]+s[2]/2,m=s[1]+s[3]/2;Object(n.h)(f,f,Object(o.m)(O,l,-h)),Object(n.h)(f,f,Object(o.m)(O,p,m)),Object(n.f)(f,f,u),Object(n.h)(f,f,Object(o.m)(O,-p,-m));const y=[0,0];Object(o.n)(y,Object(o.m)(O,s[0],s[1]),f);const x=[0,0];Object(o.n)(x,Object(o.m)(O,s[0],s[1]+s[3]),f);const _=[0,0];Object(o.n)(_,Object(o.m)(O,s[0]+s[2],s[1]),f);const b=[0,0];return Object(o.n)(b,Object(o.m)(O,s[0]+s[2],s[1]+s[3]),f),{rings:[[y,_,b,x,y]]}}function N(t,e,i){if(!i||0===i.glyphMosaicItems.length)return t;const s=Object(_.a)(e.text)[1],n=i.glyphMosaicItems,a=Object(x.a)(n,s,{scale:Object(r.c)(e.font.size)/24,angle:e.angle,xOffset:e.xoffset,yOffset:e.yoffset,hAlign:Object(y.d)(e.horizontalAlignment||"center"),vAlign:Object(y.f)(e.verticalAlignment||"baseline"),maxLineWidth:Math.max(32,Math.min(e.lineWidth||512,512)),lineHeight:30*Math.max(.25,Math.min(e.lineHeight||1,4)),decoration:e.font.decoration||"none",isCIM:!1}).bounds;return t[0]=Object(r.c)(a.x-a.halfWidth),t[1]=Object(r.c)(a.y-a.halfHeight),t[2]=Object(r.c)(a.width),t[3]=Object(r.c)(a.height),t}},557:function(t,e,i){"use strict";i.d(e,"a",(function(){return j})),i.d(e,"b",(function(){return _})),i.d(e,"c",(function(){return g}));var s=i(9),r=i(5),n=i(4),a=i(49),o=i(3),c=i(12),l=i(338),h=i(333),u=i(533),d=i(538),f=i(573),p=i(593);const m=n.a.getLogger("esri.views.layers.2d.features.support.AttributeStore"),y=Object(f.b)(f.a,m),x=t=>(2147483648&t)>>>31,_=t=>2147483647&t;function g(t){return 1===x(t)}const b={sharedArrayBuffer:Object(r.a)("esri-shared-array-buffer"),atomics:Object(r.a)("esri-atomics")};function v(t,e){return i=>e(t(i))}class O{constructor(t,e,i,s){this.size=0,this.texelSize=4;const{pixelType:r,layout:n,textureOnly:a}=s;this.textureOnly=a||!1,this.pixelType=r,this._ctype=e,this.layout=n,this._resetRange(),this._shared=t,this.size=i,a||(this.data=this._initData(r,i,t,e))}get buffer(){return Object(o.a)(this.data,t=>t.buffer)}unsetComponentAllTexels(t,e){const i=Object(o.q)(this.data);for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]&=~e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(t,e){const i=Object(o.q)(this.data);for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]|=255&e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(t,e,i){const s=Object(o.q)(this.data);for(const r of i)s[r*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)}setComponentTexel(t,e,i){Object(o.q)(this.data)[i*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}unsetComponentTexel(t,e,i){Object(o.q)(this.data)[i*this.texelSize+t]&=~e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}getData(t,e){const i=_(t);return Object(o.q)(this.data)[i*this.texelSize+e]}setData(t,e,i){const s=_(t),r=1<<e;0!=(this.layout&r)?(this.data[s*this.texelSize+e]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)):m.error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}lock(){5121===this.pixelType&&this._shared&&b.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,1)}unlock(){5121===this.pixelType&&this._shared&&b.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,0)}expand(t){if(this.size=t,!this.textureOnly){const e=this._initData(this.pixelType,t,this._shared,this._ctype),i=Object(o.q)(this.data);e.set(i),this.data=e}}toMessage(){const t=this.dirtyStart,e=this.dirtyEnd,i=this.texelSize;if(t>e)return null;this._resetRange();const s=!(this._shared||"local"===this._ctype),r=this.pixelType,n=this.layout,a=Object(o.q)(this.data);return{start:t,end:e,data:s&&a.slice(t*i,(e+1)*i)||null,pixelType:r,layout:n}}_initData(t,e,i,s){const r=i&&"local"!==s?SharedArrayBuffer:ArrayBuffer,n=Object(d.j)(t),a=new n(new r(e*e*4*n.BYTES_PER_ELEMENT));for(let o=0;o<a.length;o+=4)a[o+1]=255;return a}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class j{constructor(t,e){this._client=t,this.config=e,this._attributeComputeMap=new Map,this._blocks=new Array,this._filters=new Array(u.k),this._targetType=0,this._abortController=Object(c.d)(),this._hasScaleExpr=!1,this._size=32,this._idsToHighlight=new Set;const i=e.supportsTextureFloat?5126:5121;y(`Creating AttributeStore ${b.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:5121,layout:1},{pixelType:5121,layout:15,textureOnly:!0},{pixelType:i,layout:15},{pixelType:i,layout:15}],this._blocks=this._blockDescriptors.map(()=>null)}destroy(){this._abortController.abort()}get hasScaleExpr(){return this._hasScaleExpr}get _signal(){return this._abortController.signal}update(t,e){this.config=e;const i=e.schema.processors[0].storage,s=Object(l.a)(this._schema,i);if((t.targets.feature||t.targets.aggregate)&&(t.storage.data=!0),s&&(Object(r.a)("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",s),t.storage.data=!0,this._schema=i,this._attributeComputeMap.clear(),!Object(o.i)(i))){switch(i.target){case"feature":this._targetType=0;break;case"aggregate":this._targetType=1}if("subtype"===i.type)for(const t in i.mapping){const e=i.mapping[t];if(Object(o.j)(e))for(const t of e.mapping)this._bindAttribute(t)}else for(const t of i.mapping)this._bindAttribute(t)}}onTileData(t,e){if(Object(o.i)(e.addOrUpdate))return;const i=e.addOrUpdate.getCursor();for(;i.next();){const t=i.getDisplayId();this.setAttributeData(t,i)}}invalidateResources(){this._createResourcesPromise=null,this._abortController.abort(),this._abortController=Object(c.d)()}async setHighlight(t,e){const i=this._getBlock(0),s=e.map(t=>_(t));i.lock(),i.unsetComponentAllTexels(0,1),i.setComponent(0,1,s),i.unlock(),this._idsToHighlight.clear();for(const r of t)this._idsToHighlight.add(r);await this.sendUpdates()}async updateFilters(t,e){const{config:i,service:s,spatialReference:n}=e,{filters:a}=i,o=a.map((t,e)=>this._updateFilter(t,e,s,n));(await Promise.all(o)).some(t=>t)&&(t.storage.filters=!0,Object(r.a)("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(t,e,i,s){const r=_(t);this._ensureSizeForTexel(r),this._getBlock(e).setData(t,i,s)}getData(t,e,i){return this._getBlock(e).getData(t,i)}getHighlightFlag(t){return this._idsToHighlight.has(t)?u.h:0}unsetAttributeData(t){const e=_(t);this._getBlock(0).setData(e,0,0)}setAttributeData(t,e){const i=_(t);if(this._ensureSizeForTexel(i),this._getBlock(0).setData(i,0,this.getFilterFlags(e)),this._targetType!==x(t))return;const s=this._attributeComputeMap,r=this.config.supportsTextureFloat?1:2;s.size&&s.forEach((t,s)=>{const n=s*r%4,o=Math.floor(s*r/4),c=this._getBlock(o+u.b),l=t(e);if(this.config.supportsTextureFloat)c.setData(i,n,l);else if(l===u.m)c.setData(i,n,255),c.setData(i,n+1,255);else{const t=Object(a.d)(Math.round(l),-32767,32766)+32768,e=255&t,s=(65280&t)>>8;c.setData(i,n,e),c.setData(i,n+1,s)}})}sendUpdates(){if(this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=Object(c.g)(),this._nextUpdate.promise;const t={blocks:this._blocks.map(t=>Object(o.j)(t)?t.toMessage():null)};return this._currUpdate=this._createResources().then(()=>{const e=()=>{if(this._currUpdate=null,this._nextUpdate){const t=this._nextUpdate;this._nextUpdate=null,this.sendUpdates().then(()=>t.resolve())}},i=this._client.update(t,this._signal).then(e).catch(e);return this._client.render(this._signal),i}).catch(t=>Object(c.m)(t)?(this._createResourcesPromise=null,this._createResources()):(m.error(new s.a("mapview-attribute-store","Encountered an error during client update",t)),Promise.resolve())),this._currUpdate}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}_bindAttribute(t){let e;if(null!=t.fieldIndex)t.normalizationField&&m.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),e=e=>e.getComputedNumericAtIndex(t.fieldIndex);else{if(!t.field)return;e=t.normalizationField?e=>{const i=e.readAttribute(t.normalizationField);return i?e.readAttribute(t.field)/i:null}:e=>e.readAttribute(t.field)}t.valueRepresentation&&(e=v(e,e=>Object(p.b)(e,t.valueRepresentation)));this._attributeComputeMap.set(t.binding,v(e,t=>null===t||isNaN(t)||t===1/0?u.m:t))}_createResources(){if(Object(o.j)(this._createResourcesPromise))return this._createResourcesPromise;this._getBlock(u.a),y("Initializing AttributeStore");const t={shared:b.sharedArrayBuffer&&!("local"===this._client.type),size:this._size,blocks:Object(o.l)(this._blocks,t=>({textureOnly:t.textureOnly,buffer:t.buffer,pixelType:t.pixelType}))},e=this._client.initialize(t,this._signal).catch(t=>{Object(c.m)(t)?this._createResourcesPromise=null:m.error(new s.a("mapview-attribute-store","Encountered an error during client initialization",t))});return this._createResourcesPromise=e,e.then(()=>Object(o.i)(this._createResourcesPromise)?this._createResources():void 0),e}_getBlock(t){const e=this._blocks[t];if(Object(o.j)(e))return e;y("Initializing AttributeBlock at index "+t);const i=b.sharedArrayBuffer,s=this._client.type,r=new O(i,s,this._size,this._blockDescriptors[t]);return this._blocks[t]=r,this._createResourcesPromise=null,r}_expand(){if(this._size<this.config.maxTextureSize){const t=this._size<<=1;return y("Expanding block size to",t,this._blocks),Object(o.g)(this._blocks,e=>e.expand(t)),this._createResourcesPromise=null,this._size=t,0}return m.error(new s.a("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}async _updateFilter(t,e,i,s){const r=this._filters[e],n=Object(o.j)(r)&&r.hash;if(!r&&!t)return!1;if(n===JSON.stringify(t))return!1;if(Object(o.i)(t)){if(!r)return!1;const t=1<<e+1,i=this._getBlock(0);return this._filters[e]=null,i.setComponentAllTexels(0,t),this.sendUpdates(),!0}const a=await this._getFilter(e,i);return await a.update(t,s),!0}async _getFilter(t,e){const s=this._filters[t];if(Object(o.j)(s))return s;const{default:r}=await i.e(59).then(i.bind(null,659)),n=new r({geometryType:e.geometryType,hasM:!1,hasZ:!1,timeInfo:e.timeInfo,fieldsIndex:new h.a(e.fields)});return this._filters[t]=n,n}isVisible(t){return!!(2&this._getBlock(0).getData(t,0))}getFilterFlags(t){let e=0;const i=(t=>1===x(t)?254:255)(t.getDisplayId());for(let r=0;r<this._filters.length;r++){const s=!!(i&1<<r),n=this._filters[r];e|=(!s||Object(o.i)(n)||n.check(t)?1:0)<<r}let s=0;if(this._idsToHighlight.size){const e=t.getObjectId();s=this.getHighlightFlag(e)}return e<<1|s}}},558:function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));const s=new(i(599).a);function r(t){if(!s.hasBidiChar(t))return[t,!1];let e;return e="rtl"===s.checkContextual(t)?"IDNNN":"ICNNN",[s.bidiTransform(t,e,"VLYSN"),!0]}},559:function(t,e,i){"use strict";i.d(e,"a",(function(){return D})),i.d(e,"b",(function(){return S})),i.d(e,"c",(function(){return w}));i(252),i(303),i(306),i(307),i(93);var s=i(231),r=(i(230),i(254),i(9)),n=i(5),a=i(7),o=i(4),c=i(3),l=i(18),h=i(89),u=i(534),d=i(538),f=i(537),p=i(568);var m=i(600),y=i(601),x=i(603),_=i(598);const g=o.a.getLogger("esri.views.2d.layers.features.schemaUtils"),b="ValidationError",v={esriGeometryPoint:["above-right","above-center","above-left","center-center","center-left","center-right","below-center","below-left","below-right"],esriGeometryPolygon:["always-horizontal"],esriGeometryPolyline:["center-along"],esriGeometryMultipoint:null};function O(t){return Object(f.h)(t)}function j(t){var e;return"line-marker"===t.type?{type:"line-marker",color:null==(e=t.color)?void 0:e.toJSON(),placement:t.placement,style:t.style}:Object(h.a)(t.toJSON()).toJSON()}function w(t,e,i){if(!t)return null;let s=0,r=!1,n=0;switch(Object(c.j)(e)&&(n=Object(m.b)(e),"visualVariables"in e&&(s=function(t){if(!t)return u.e.NONE;let e=0;for(const i of t)if("size"===i.type){const t=Object(p.a)(i);e|=t,"outline"===i.target&&(e|=t<<4)}else"color"===i.type?e|=u.e.COLOR:"opacity"===i.type?e|=u.e.OPACITY:"rotation"===i.type&&(e|=u.e.ROTATION);return e}(e.visualVariables||[]),r="dot-density"===e.type)),t.type){case"simple-fill":case"picture-fill":return function(t,e,i,s){const r=Object(f.g)(u.d.FILL,e,!1,i),n=s?O(r):r,a=t.clone(),o=a.outline;a.outline=null;const c=[],l={materialKey:n,hash:a.hash(),...j(a)};if(c.push(l),o){const t=Object(f.g)(u.d.LINE,e,!0,!1),i={materialKey:s?O(t):t,hash:o.hash(),...j(o)};c.push(i)}return{type:"composite-symbol",layers:c,hash:c.reduce((t,e)=>e.hash+t,"")}}(t,s,r,i);case"simple-marker":case"picture-marker":return function(t,e,i,s){const r=Object(f.g)(u.d.MARKER,e,!1,!1),n=s?O(r):r,a=j(t);return{materialKey:n,hash:t.hash(),...a,angle:t.angle,maxVVSize:i}}(t,s,n,i);case"simple-line":return function(t,e,i){const s=Object(f.g)(u.d.LINE,e,!1,!1),r=i?O(s):s,n=t.clone(),a=n.marker;n.marker=null;const o=[];if(o.push({materialKey:r,hash:n.hash(),...j(n)}),a){var c;const t=Object(f.g)(u.d.MARKER,e,!1,!1),s=i?O(t):t;a.color=null!=(c=a.color)?c:n.color,o.push({materialKey:s,hash:a.hash(),lineWidth:n.width,...j(a)})}return{type:"composite-symbol",layers:o,hash:o.reduce((t,e)=>e.hash+t,"")}}(t,s,i);case"text":return function(t,e,i,s){const r=Object(f.g)(u.d.TEXT,e,!1,!1),n=s?O(r):r,a=j(t);return{materialKey:n,hash:t.hash(),...a,angle:t.angle,maxVVSize:i}}(t,s,n,i);case"label":return function(t,e,i){const s=t.toJSON(),r=Object(f.g)(u.d.LABEL,e,!1,!1,s.labelPlacement);return{materialKey:i?O(r):r,hash:t.hash(),...s,labelPlacement:s.labelPlacement}}(t,s,i);case"cim":return{type:"cim",rendererKey:s,data:t.data,maxVVSize:n};case"web-style":return{...j(t),type:"web-style",hash:t.hash(),rendererKey:s,maxVVSize:n};default:throw new Error("symbol not supported "+t.type)}}function T(t,e){const i=Object(a.a)(t);return i.some(t=>function(t,e){const i=t.labelPlacement,s=v[e];if(!t.symbol)return g.warn("No ILabelClass symbol specified."),!0;if(!s)return g.error(new r.a("mapview-labeling:unsupported-geometry-type",`Unable to create labels for Feature Layer, ${e} is not supported`)),!0;if(!s.some(t=>t===i)){const r=s[0];i&&g.warn(`Found invalid label placement type ${i} for ${e}. Defaulting to ${r}`),t.labelPlacement=r}return!1}(t,e))?[]:i}function S(t){return Object(n.a)("esri-2d-update-debug")&&console.debug("Created new schema",M(t,!0)),M(t)}function M(t,e=!1){try{var i,n;const a=function(t,e=!1){const i=new Array;return i.push(function(t,e,i=!1){const n={indexCount:0,fields:{}},a="featureReduction"in t&&t.featureReduction,o=a?"aggregate":"feature";if("sublayers"in t){const e={type:"subtype",subtypeField:t.subtypeField,renderers:{}},s={type:"subtype",mapping:{},target:"feature"},a={type:"subtype",classes:{}},l={type:"symbol",target:"feature",aggregateFields:[],attributes:n,storage:s,mesh:{matcher:e,aggregateMatcher:null,labels:a,sortKey:null}},h=new Set;let u=0;for(const{renderer:d,subtypeCode:f,labelingInfo:p,labelsVisible:m}of t.sublayers){const t=D(n,o,d,i),l=F(n,o,d),y=m&&p;if("visualVariables"in d&&d.visualVariables&&d.visualVariables.length)throw new r.a(b,"Visual variables are currently not supported for subtype layers");if("dictionary"===t.type)throw new r.a(b,"Dictionary renderer is not supported in subtype layers");if("subtype"===t.type)throw new r.a(b,"Nested subtype renderers is not supported");if(Object(c.j)(l)&&"subtype"===l.type)throw new r.a(b,"Nested subtype storage is not supported");if(Object(c.j)(l)&&"dot-density"===l.type)throw new r.a(b,"Dot density attributes are not supported in subtype layers");if(h.has(f))throw new r.a(b,"Subtype codes for sublayers must be unique");h.add(f),e.renderers[f]=t,s.mapping[f]=l,y&&(a.classes[f]=y.map(t=>E(d,n,t,"feature",u++,i)))}return l}if("heatmap"===t.renderer.type){const{blurRadius:e,fieldOffset:i,field:s}=t.renderer;return{type:"heatmap",aggregateFields:[],attributes:n,target:o,storage:null,mesh:{blurRadius:e,fieldOffset:i,field:C(n,{target:o,field:s,resultType:"numeric"}).field}}}{const e=[],l="aggregate"===o?Object(x.b)(e,t.renderer,a,null):t.renderer;!function(t,e){const i={mesh:!0,storage:!0};for(const s of e){const{name:e,outStatistic:r}=s,{statisticType:n,onStatisticField:a}=r;let o=null,c=null,l=null;const h="numeric",u="feature";"onStatisticValueExpression"in r?c=z(t,{type:"expression",target:u,valueExpression:r.onStatisticValueExpression,resultType:h}).fieldIndex:"onStatisticNormalizationField"in r?(o=z(t,{type:"field",target:u,field:a,resultType:h}).field,l=r.onStatisticNormalizationField):o=z(t,{type:"field",target:u,field:a,resultType:h}).field,z(t,{type:"statistic",target:"aggregate",name:e,context:i,inField:o,inNormalizationField:l,inFieldIndex:c,statisticType:n})}}(n,e);const h=D(n,o,l,i);let u=null;const d=F(n,o,l),f=Object(_.a)(t.geometryType);let p=t.labelsVisible&&t.labelingInfo||[],m=[];if(a){if("selection"===a.type)throw new r.a(b,"Mapview does not support `selection` reduction type",a);if(a.symbol){const t=new s.a({symbol:a.symbol,visualVariables:"visualVariables"in l?l.visualVariables:null});u=D(n,o,t,i)}m=a&&a.labelsVisible&&a.labelingInfo||[]}p=T(p,f),m=T(m,f);let y=0;const v=[...p.map(t=>E(l,n,t,"feature",y++,i)),...m.map(t=>E(l,n,t,"aggregate",y++,i))],O=function(t,e){if(Object(c.i)(e)||!e.length)return null;e.length>1&&g.warn(`Layer rendering currently only supports ordering by 1 orderByInfo, but found ${e.length}. All but the first will be discarded`);const i=e[0],s="ascending"===i.order?"asc":"desc";if(i.field)return{field:i.field,order:s};if(i.valueExpression)return{fieldIndex:z(t,{type:"expression",target:"feature",valueExpression:i.valueExpression,resultType:"numeric"}).fieldIndex,order:s};return g.error(new r.a(b,"Expected to find a field or valueExpression for OrderByInfo",i)),null}(n,t.orderBy);return{type:"symbol",target:o,attributes:n,aggregateFields:e,storage:d,mesh:{matcher:h,labels:{type:"simple",classes:v},aggregateMatcher:u,sortKey:O}}}}(t,e)),i}(t,e),o={};return a.map(e=>function(t,e,i){switch(i.target){case"feature":return void L(t,R(e),i);case"aggregate":{if(!("featureReduction"in e))return;const s=e.featureReduction;if("selection"===s.type)throw new r.a(b,"Mapview does not support `selection` reduction type",s);return L(t,R(e),i),void function(t,e,i){t.aggregate||(t.aggregate={name:"aggregate",input:"feature",filters:null,attributes:{},params:{clusterRadius:Object(l.c)(e.clusterRadius/2),clusterPixelBuffer:64*Math.ceil(Object(l.c)(e.clusterMaxSize)/64),fields:i.aggregateFields}}),I(t.aggregate,i.attributes.fields)}(t,s,i)}}}(o,t,e)),{source:{definitionExpression:t.definitionExpression,fields:t.fields.map(t=>t.toJSON()),gdbVersion:t.gdbVersion,historicMoment:null==(i=t.historicMoment)?void 0:i.getTime(),outFields:t.availableFields,pixelBuffer:t.pixelBuffer,spatialReference:t.spatialReference.toJSON(),timeExtent:null==(n=t.timeExtent)?void 0:n.toJSON(),customParameters:t.customParameters},attributes:{fields:{},indexCount:0},processors:a,targets:o}}catch(a){if(a.fieldName===b)return g.error(a),null;throw a}}function I(t,e){for(const i in e){const s=e[i];if(s.target!==t.name)continue;const r=t.attributes[i];r?(r.context.mesh=r.context.mesh||s.context.mesh,r.context.storage=r.context.storage||s.context.storage):t.attributes[i]=s}return t}function R(t){var e,i,s,r,n;return[null!=(e=null==(i=t.filter)?void 0:i.toJSON())?e:null,null!=(s=null==(r=t.effect)||null==(n=r.filter)?void 0:n.toJSON())?s:null]}function L(t,e,i){return t.feature||(t.feature={name:"feature",input:"source",filters:e,attributes:{}}),I(t.feature,i.attributes.fields),t}function C(t,e){return e.field?z(t,{...e,type:"field",field:e.field}):e.valueExpression?z(t,{...e,type:"expression",valueExpression:e.valueExpression}):{field:null,fieldIndex:null}}function z(t,e){switch(e.type){case"expression":{const i=e.valueExpression;if(!t.fields[i]){const s=t.indexCount++;t.fields[i]={...e,name:i,fieldIndex:s}}return{fieldIndex:t.fields[i].fieldIndex}}case"label-expression":{const i=JSON.stringify(e.label);if(!t.fields[i]){const s=t.indexCount++;t.fields[i]={...e,name:i,fieldIndex:s}}return{fieldIndex:t.fields[i].fieldIndex}}case"field":{const i=e.field;return"aggregate"===e.target&&t.fields[i]||(t.fields[i]={...e,name:i}),{field:i}}case"statistic":return t.fields[e.name]={...e},{field:e.name}}}function E(t,e,i,s,r,n=!1){const a=z(e,{type:"label-expression",target:s,context:{mesh:!0},resultType:"string",label:{labelExpression:i.labelExpression,labelExpressionInfo:i.labelExpressionInfo?{expression:i.labelExpressionInfo.expression}:null,symbol:!!i.symbol,where:i.where}}),{fieldIndex:o}=a;return{...w(i,t,n),fieldIndex:o,target:s,index:r}}function F(t,e,i){switch(i.type){case"dot-density":return function(t,e,i){return i&&i.length?{type:"dot-density",mapping:i.map((i,s)=>{const{field:r,fieldIndex:n}=C(t,{valueExpression:i.valueExpression,field:i.field,resultType:"numeric",target:e});return{binding:s,field:r,fieldIndex:n}}),target:e}:{type:"dot-density",mapping:[],target:e}}(t,e,i.attributes);case"simple":case"class-breaks":case"unique-value":case"dictionary":return function(t,e,i){if(!i||!i.length)return{type:"visual-variable",mapping:[],target:e};const s={storage:!0},r="numeric";return{type:"visual-variable",mapping:Object(y.b)(i).map(i=>{var n;const a=Object(d.m)(i.type),{field:o,fieldIndex:c}=C(t,{target:e,valueExpression:i.valueExpression,field:i.field,context:s,resultType:r});switch(i.type){case"size":return"$view.scale"===i.valueExpression?null:{type:"size",binding:a,field:o,fieldIndex:c,normalizationField:C(t,{target:e,field:i.normalizationField,context:s,resultType:r}).field,valueRepresentation:null!=(n=i.valueRepresentation)?n:null};case"color":return{type:"color",binding:a,field:o,fieldIndex:c,normalizationField:C(t,{target:e,field:i.normalizationField,context:s,resultType:r}).field};case"opacity":return{type:"opacity",binding:a,field:o,fieldIndex:c,normalizationField:C(t,{target:e,field:i.normalizationField,context:s,resultType:r}).field};case"rotation":return{type:"rotation",binding:a,field:o,fieldIndex:c}}}).filter(t=>t),target:e}}(t,e,i.visualVariables);case"heatmap":return null}}function D(t,e,i,s=!1){const n=Object(c.r)(t,{indexCount:0,fields:{}});switch(i.type){case"simple":case"dot-density":return function(t,e,i,s=!1){const r=e.getSymbols();return{type:"simple",symbol:w(r.length?r[0]:null,e,s),isDotDensity:i}}(0,i,"dot-density"===i.type,s);case"class-breaks":return function(t,e,i,s=!1){const r=i.backgroundFillSymbol,{field:n,fieldIndex:a}=C(t,{target:e,field:i.field,valueExpression:i.valueExpression,resultType:"numeric",context:{mesh:!0,use:"renderer.field"}}),o=i.normalizationType,c="log"===o?"esriNormalizeByLog":"percent-of-total"===o?"esriNormalizeByPercentOfTotal":"field"===o?"esriNormalizeByField":null,l=i.classBreakInfos.map(t=>({symbol:w(t.symbol,i,s),min:t.minValue,max:t.maxValue})).sort((t,e)=>t.min-e.min);return{type:"interval",attributes:t.fields,field:n,fieldIndex:a,backgroundFillSymbol:w(r,i,s),defaultSymbol:w(i.defaultSymbol,i,s),intervals:l,normalizationField:i.normalizationField,normalizationTotal:i.normalizationTotal,normalizationType:c,isMaxInclusive:i.isMaxInclusive}}(n,e,i,s);case"unique-value":return function(t,e,i,s=!1){const n=[],a=i.backgroundFillSymbol,o={target:e,context:{mesh:!0},resultType:"string"};if(i.field&&"string"!=typeof i.field)throw new r.a(b,"Expected renderer.field to be a string",i);const{field:c,fieldIndex:l}=C(t,{...o,field:i.field,valueExpression:i.valueExpression});for(const r of i.uniqueValueInfos)n.push({value:""+r.value,symbol:w(r.symbol,i,s)});return{type:"map",attributes:t.fields,field:c,fieldIndex:l,field2:C(t,{...o,field:i.field2}).field,field3:C(t,{...o,field:i.field3}).field,fieldDelimiter:i.fieldDelimiter,backgroundFillSymbol:w(a,i),defaultSymbol:w(i.defaultSymbol,i),map:n}}(n,e,i,s);case"dictionary":return function(t,e,i=!1){return{type:"dictionary",renderer:e.toJSON()}}(0,i,s)}}},560:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));class s{constructor(t,e){this._pos=0;const i=e?this._roundToNearest(e,t.BYTES_PER_ELEMENT):40;this._array=new ArrayBuffer(i),this._buffer=new t(this._array),this._ctor=t,this._i16View=new Int16Array(this._array)}get length(){return this._pos}_roundToNearest(t,e){const i=Math.round(t);return i+(e-i%e)}_ensureSize(t){if(this._pos+t>=this._buffer.length){const e=this._roundToNearest(1.5*(this._array.byteLength+t*this._buffer.BYTES_PER_ELEMENT),this._buffer.BYTES_PER_ELEMENT),i=new ArrayBuffer(e),s=new this._ctor(i);s.set(this._buffer,0),this._array=i,this._buffer=s,this._i16View=new Int16Array(this._array)}}ensureSize(t){this._ensureSize(t)}writeF32(t){this._ensureSize(1);const e=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=t,this._pos++,e}push(t){this._ensureSize(1);const e=this._pos;return this._buffer[this._pos++]=t,e}writeFixed(t){this._buffer[this._pos++]=t}setValue(t,e){this._buffer[t]=e}i1616Add(t,e,i){this._i16View[2*t]+=e,this._i16View[2*t+1]+=i}getValue(t){return this._buffer[t]}incr(t){if(this._buffer.length<t)throw new Error("Increment index overflows the target buffer");this._buffer[t]++}decr(t){this._buffer[t]--}writeRegion(t){this._ensureSize(t.length);const e=this._pos;return this._buffer.set(t,this._pos),this._pos+=t.length,e}writeManyFrom(t,e,i){this._ensureSize(i-e);for(let s=e;s!==i;s++)this.writeFixed(t._buffer[s])}buffer(){const t=this._array.slice(0,4*this._pos);return this.destroy(),t}toArray(){const t=this._array,e=[];for(let i=0;i<t.byteLength/4;i++)e.push(t[i]);return e}seek(t){this._pos=t}destroy(){this._array=null,this._buffer=null}}},562:function(t,e,i){"use strict";i.d(e,"a",(function(){return O}));i(57);var s,r,n=i(5),a=i(3),o=i(575),c=i(299),l=i(103),h=i(563),u=i(17);let d=0;const f=null!=(s=Object(n.a)("featurelayer-simplify-thresholds"))?s:[.5,.5,.5,.5],p=f[0],m=f[1],y=f[2],x=f[3],_=null!=(r=Object(n.a)("featurelayer-simplify-payload-size-factors"))?r:[1,2,4],g=_[0],b=_[1],v=_[2];class O{constructor(t){this.type="FeatureSetReader",this.seen=!1,this.instance=0,this._tx=0,this._ty=0,this._sx=1,this._sy=1,this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._level=0,this.instance=t}static createInstance(){return d++,d=d>65535?0:d,d}get isEmpty(){return Object(a.j)(this._deleted)&&this._deleted.countSet()===this.getSize()}set level(t){this._level=t}getAreaSimplificationThreshold(t,e){let i=1;e>4e6?i=v:e>1e6?i=b:e>5e5&&(i=g);let s=0;t>4e3?s=x*i:t>2e3?s=y*i:t>100?s=m:t>15&&(s=p);let r=8;return this._level<4?r=1:this._level<5?r=2:this._level<6&&(r=4),s*r}setArcadeSpatialReference(t){this._arcadeSpatialReference=t}attachStorage(t){this._storage=t}getQuantizationTransform(){throw new Error("Unable to find transform for featureSet")}getStorage(){return this._storage}getComputedNumeric(t){return this.getComputedNumericAtIndex(0)}setComputedNumeric(t,e){return this.setComputedNumericAtIndex(e,0)}getComputedString(t){return this.getComputedStringAtIndex(0)}setComputedString(t,e){return this.setComputedStringAtIndex(0,e)}getComputedNumericAtIndex(t){return this._storage.getComputedNumericAtIndex(this.getDisplayId(),t)}setComputedNumericAtIndex(t,e){this._storage.setComputedNumericAtIndex(this.getDisplayId(),t,e)}getComputedStringAtIndex(t){return this._storage.getComputedStringAtIndex(this.getDisplayId(),t)}setComputedStringAtIndex(t,e){return this._storage.setComputedStringAtIndex(this.getDisplayId(),t,e)}transform(t,e,i,s){const r=this.copy();return r._tx+=t,r._ty+=e,r._sx*=i,r._sy*=s,r}readAttribute(t,e=!1){const i=this._readAttribute(t,e);if(void 0!==i)return i;for(const s of this._joined){s.setIndex(this.getIndex());const i=s._readAttribute(t,e);if(void 0!==i)return i}}readAttributes(){const t=this._readAttributes();for(const e of this._joined){e.setIndex(this.getIndex());const i=e._readAttributes();for(const e of Object.keys(i))t[e]=i[e]}return t}joinAttributes(t){this._joined.push(t)}readArcadeFeature(){return this}geometry(){const t=this.readHydratedGeometry(),e=Object(c.k)(t,this.geometryType,this.hasZ,this.hasM),i=Object(u.a)(e);return i&&(i.spatialReference=this._arcadeSpatialReference),i}field(t){return this.readAttribute(t,!0)}hasField(t){return!0}setField(t,e){}keys(){return[]}castToText(){return""}removeIds(t){if(Object(a.i)(this._objectIdToIndex)){const t=new Map,e=this.getCursor();for(;e.next();)t.set(e.getObjectId(),e.getIndex());this._objectIdToIndex=t}const e=this._objectIdToIndex;for(const i of t)e.has(i)&&this.removeAtIndex(e.get(i))}removeAtIndex(t){Object(a.i)(this._deleted)&&(this._deleted=h.a.create(this.getSize())),this._deleted.set(t)}readGeometryForDisplay(){return this.readUnquantizedGeometry(!0)}readLegacyGeometryForDisplay(){return this.readLegacyGeometry(!0)}*features(){const t=this.getCursor();for(;t.next();)yield t.readOptimizedFeature()}_getExists(){return Object(a.i)(this._deleted)||!this._deleted.has(this.getIndex())}_computeCentroid(){if("esriGeometryPolygon"!==this.geometryType)return null;const t=this.readUnquantizedGeometry();if(!t||t.hasIndeterminateRingOrder)return null;const e=Object(a.r)(this.getQuantizationTransform(),null);return Object(o.a)(new l.a,t,this.hasM,this.hasZ,e)}copyInto(t){t.seen=this.seen,t._storage=this._storage,t._arcadeSpatialReference=this._arcadeSpatialReference,t._joined=this._joined,t._tx=this._tx,t._ty=this._ty,t._sx=this._sx,t._sy=this._sy,t._deleted=this._deleted,t._objectIdToIndex=this._objectIdToIndex}}},563:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));class s{constructor(t,e){this._mask=0,this._buf=t,this._mask=e}static fromBuffer(t,e){return new s(t,e)}static create(t,e=4294967295){const i=new Uint32Array(Math.ceil(t/32));return new s(i,e)}_getIndex(t){return Math.floor(t/32)}has(t){const e=this._mask&t;return!!(this._buf[this._getIndex(e)]&1<<e%32)}hasRange(t,e){let i=t,s=e;for(;i%32&&i!==s;){if(this.has(i))return!0;i++}for(;s%32&&i!==s;){if(this.has(i))return!0;s--}if(i===s)return!1;for(let r=i/32;r!==s/32;r++)if(this._buf[r])return!0;return!1}set(t){const e=this._mask&t,i=this._getIndex(e),s=1<<e%32;this._buf[i]|=s}setRange(t,e){let i=t,s=e;for(;i%32&&i!==s;)this.set(i++);for(;s%32&&i!==s;)this.set(s--);if(i!==s)for(let r=i/32;r!==s/32;r++)this._buf[r]=4294967295}unset(t){const e=this._mask&t,i=this._getIndex(e),s=1<<e%32;this._buf[i]&=4294967295^s}resize(t){const e=this._buf,i=new Uint32Array(Math.ceil(t/32));i.set(e),this._buf=i}or(t){for(let e=0;e<this._buf.length;e++)this._buf[e]|=t._buf[e];return this}and(t){for(let e=0;e<this._buf.length;e++)this._buf[e]&=t._buf[e];return this}xor(t){for(let e=0;e<this._buf.length;e++)this._buf[e]^=t._buf[e];return this}ior(t){for(let e=0;e<this._buf.length;e++)this._buf[e]|=~t._buf[e];return this}iand(t){for(let e=0;e<this._buf.length;e++)this._buf[e]&=~t._buf[e];return this}ixor(t){for(let e=0;e<this._buf.length;e++)this._buf[e]^=~t._buf[e];return this}any(){for(let t=0;t<this._buf.length;t++)if(this._buf[t])return!0;return!1}copy(t){for(let e=0;e<this._buf.length;e++)this._buf[e]=t._buf[e];return this}clone(){return new s(this._buf.slice(),this._mask)}clear(){for(let t=0;t<this._buf.length;t++)this._buf[t]=0}forEachSet(t){for(let e=0;e<this._buf.length;e++){let i=this._buf[e],s=32*e;if(i)for(;i;)1&i&&t(s),i>>>=1,s++}}countSet(){let t=0;return this.forEachSet(e=>{t++}),t}}},564:function(t,e,i){"use strict";i.d(e,"a",(function(){return o})),i.d(e,"b",(function(){return c}));var s=i(42),r=i(5);let n=null,a=null;async function o(){return n||(n=async function(){const t=Object(r.a)("csp-restrictions")?await Promise.all([i.e(71),i.e(160)]).then(i.bind(null,651)).then((function(t){return t.l})):await i.e(98).then(i.bind(null,652)).then((function(t){return t.l}));a=await t.load({locateFile:()=>Object(s.a)("esri/core/libs/libtess/libtess.wasm")})}()),n}function c(t,e){const i=Math.max(t.length,128e3);return a.triangulate(t,e,i)}},565:function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var s=i(184),r=i(569),n=i(124);class a extends r.a{constructor(t,e,i,s,r,a=s,o=r){super(),this.triangleCountReportedInDebug=0,this.triangleCount=0,this.texture=null,this.key=new n.a(t),this.x=e,this.y=i,this.width=s,this.height=r,this.rangeX=a,this.rangeY=o}destroy(){this.texture&&(this.texture.dispose(),this.texture=null)}setTransform(t,e){const i=e/(t.resolution*t.pixelRatio),r=this.transforms.tileMat3,[n,a]=t.toScreenNoRotation([0,0],[this.x,this.y]),o=this.width/this.rangeX*i,c=this.height/this.rangeY*i;Object(s.k)(r,o,0,0,0,c,0,n,a,1),Object(s.h)(this.transforms.dvs,t.displayViewMat3,r)}}},566:function(t,e,i){"use strict";i.d(e,"a",(function(){return p}));var s=i(0),r=i(19),n=i(82),a=i(102),o=i(251),c=i(4),l=i(3),h=i(141),u=i(1),d=(i(5),i(6),i(2));let f=class extends(Object(a.b)(Object(o.a)(Object(h.b)(n.a.EventedMixin(r.a))))){constructor(t){super(t),this.layer=null,this.parent=null}initialize(){this.when().catch(t=>{if("layerview:create-error"!==t.name){const e=this.layer&&this.layer.id||"no id",i=this.layer&&this.layer.title||"no title";throw c.a.getLogger(this.declaredClass).error("#resolve()",`Failed to resolve layer view (layer title: '${i}', id: '${e}')`,t),t}})}get fullOpacity(){return Object(l.r)(this.get("layer.opacity"),1)*Object(l.r)(this.get("parent.fullOpacity"),1)}get suspended(){return!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){return!this.suspended&&!0===this.layer.legendEnabled}get updating(){return!!(this.updatingHandles&&this.updatingHandles.updating||this.isUpdating())}get updatingProgress(){return this.updating?0:1}get visible(){return!0===this.get("layer.visible")}set visible(t){void 0!==t?this._override("visible",t):this._clearOverride("visible")}canResume(){return!this.get("parent.suspended")&&this.get("view.ready")&&this.get("layer.loaded")&&this.visible||!1}getSuspendInfo(){const t=this.parent&&this.parent.suspended?this.parent.suspendInfo:{};return this.view&&this.view.ready||(t.viewNotReady=!0),this.layer&&this.layer.loaded||(t.layerNotLoaded=!0),this.visible||(t.layerInvisible=!0),t}isUpdating(){return!1}};Object(s.a)([Object(u.b)()],f.prototype,"fullOpacity",null),Object(s.a)([Object(u.b)()],f.prototype,"layer",void 0),Object(s.a)([Object(u.b)()],f.prototype,"parent",void 0),Object(s.a)([Object(u.b)({readOnly:!0})],f.prototype,"suspended",null),Object(s.a)([Object(u.b)({readOnly:!0})],f.prototype,"suspendInfo",null),Object(s.a)([Object(u.b)({readOnly:!0})],f.prototype,"legendEnabled",null),Object(s.a)([Object(u.b)({type:Boolean,readOnly:!0})],f.prototype,"updating",null),Object(s.a)([Object(u.b)({readOnly:!0})],f.prototype,"updatingProgress",null),Object(s.a)([Object(u.b)()],f.prototype,"visible",null),f=Object(s.a)([Object(d.a)("esri.views.layers.LayerView")],f);var p=f},567:function(t,e,i){"use strict";i.d(e,"a",(function(){return M}));var s=i(0),r=i(22),n=i(98),a=i(16),o=i(1),c=(i(5),i(6),i(4),i(2)),l=i(596),h=i(10);let u=class extends h.a{};u=Object(s.a)([Object(c.a)("esri.views.layers.support.ClipArea")],u);var d,f=u;let p=d=class extends f{constructor(){super(...arguments),this.type="rect",this.left=null,this.right=null,this.top=null,this.bottom=null}clone(){return new d({left:this.left,right:this.right,top:this.top,bottom:this.bottom})}get version(){return(this._get("version")||0)+1}};Object(s.a)([Object(o.b)({type:[Number,String],json:{write:!0}})],p.prototype,"left",void 0),Object(s.a)([Object(o.b)({type:[Number,String],json:{write:!0}})],p.prototype,"right",void 0),Object(s.a)([Object(o.b)({type:[Number,String],json:{write:!0}})],p.prototype,"top",void 0),Object(s.a)([Object(o.b)({type:[Number,String],json:{write:!0}})],p.prototype,"bottom",void 0),Object(s.a)([Object(o.b)({readOnly:!0})],p.prototype,"version",null),p=d=Object(s.a)([Object(c.a)("esri.views.layers.support.ClipRect")],p);var m,y=p,x=(i(57),i(77)),_=i(17),g=i(34),b=i(87);const v={base:x.a,key:"type",typeMap:{extent:g.a,polygon:b.a}};let O=m=class extends f{constructor(){super(...arguments),this.type="geometry",this.geometry=null}get version(){return(this._get("version")||0)+1}clone(){return new m({geometry:this.geometry.clone()})}};Object(s.a)([Object(o.b)({types:v,json:{read:_.a,write:!0}})],O.prototype,"geometry",void 0),Object(s.a)([Object(o.b)({readOnly:!0})],O.prototype,"version",null),O=m=Object(s.a)([Object(c.a)("esri.views.layers.support.Geometry")],O);var j=O;let w=class extends f{constructor(){super(...arguments),this.type="path",this.path=[]}get version(){return(this._get("version")||0)+1}};Object(s.a)([Object(o.b)({type:[[[Number]]],json:{write:!0}})],w.prototype,"path",void 0),Object(s.a)([Object(o.b)({readOnly:!0})],w.prototype,"version",null),w=Object(s.a)([Object(c.a)("esri.views.layers.support.Path")],w);var T=w;const S=r.a.ofType({key:"type",base:f,typeMap:{rect:y,path:T,geometry:j}}),M=t=>{let e=class extends t{constructor(){super(...arguments),this.clips=new S,this.moving=!1,this.attached=!1,this.lastUpdateId=-1,this.updateRequested=!1}initialize(){var t;this.container||(this.container=new l.a),this.container.fadeTransitionEnabled=!0,this.container.opacity=0,this.container.clips=this.clips,this.handles.add([Object(a.a)(this,"suspended",t=>{this.container&&(this.container.visible=!t),this.view&&!t&&this.updateRequested&&this.view.requestUpdate()},!0),Object(a.a)(this,["layer.opacity","container"],()=>{var t,e;this.container&&(this.container.opacity=null!=(t=null==(e=this.layer)?void 0:e.opacity)?t:1)},!0),Object(a.a)(this,["layer.blendMode"],t=>{this.container&&(this.container.blendMode=t)},!0),Object(a.a)(this,["layer.effect"],t=>{this.container&&(this.container.effect=t)},!0),this.clips.on("change",()=>{this.container.clips=this.clips,this.notifyChange("clips")})]),null!=(t=this.view)&&t.whenLayerView?this.view.whenLayerView(this.layer).then(t=>{t!==this||this.attached||this.destroyed||(this.attach(),this.requestUpdate(),this.attached=!0)},()=>{}):this.when().then(()=>{this.attached||this.destroyed||(this.attach(),this.requestUpdate(),this.attached=!0)},()=>{})}destroy(){this.attached&&(this.detach(),this.attached=!1),this.handles.remove("initialize"),this.updateRequested=!1}get updating(){return!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())}isVisibleAtScale(t){let e=!0;const i=this.layer,s=i.minScale,r=i.maxScale;if(null!=s&&null!=r){let i=!s,n=!r;!i&&t<=s&&(i=!0),!n&&t>=r&&(n=!0),e=i&&n}return e}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.suspended||this.view.requestUpdate())}processUpdate(t){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",t),this.updateRequested&&!this.suspended&&(this.updateRequested=!1,this.update(t))):this.updateRequested=!1}isUpdating(){return!1}isRendering(){return!1}canResume(){return!!super.canResume()&&this.isVisibleAtScale(this.view.scale)}};return Object(s.a)([Object(o.b)({type:S,set(t){const e=Object(n.b)(t,this._get("clips"),S);this._set("clips",e)}})],e.prototype,"clips",void 0),Object(s.a)([Object(o.b)()],e.prototype,"moving",void 0),Object(s.a)([Object(o.b)()],e.prototype,"attached",void 0),Object(s.a)([Object(o.b)()],e.prototype,"container",void 0),Object(s.a)([Object(o.b)()],e.prototype,"suspended",void 0),Object(s.a)([Object(o.b)({readOnly:!0})],e.prototype,"updateParameters",void 0),Object(s.a)([Object(o.b)()],e.prototype,"updateRequested",void 0),Object(s.a)([Object(o.b)()],e.prototype,"updating",null),Object(s.a)([Object(o.b)()],e.prototype,"view",void 0),e=Object(s.a)([Object(c.a)("esri.views.2d.layers.LayerView2D")],e),e}},568:function(t,e,i){"use strict";i.d(e,"a",(function(){return c}));var s=i(9),r=i(4),n=i(534),a=i(538);const o=r.a.getLogger("esri.views.2d.engine.webgl");function c(t){return Object(a.o)(t.minDataValue)&&Object(a.o)(t.maxDataValue)&&null!=t.minSize&&null!=t.maxSize?n.e.SIZE_MINMAX_VALUE:(t.expression&&"view.scale"===t.expression||t.valueExpression&&"$view.scale"===t.valueExpression)&&Array.isArray(t.stops)?n.e.SIZE_SCALE_STOPS:(null!=t.field||t.expression&&"view.scale"!==t.expression||t.valueExpression&&"$view.scale"!==t.valueExpression)&&(Array.isArray(t.stops)||"levels"in t&&t.levels)?n.e.SIZE_FIELD_STOPS:(null!=t.field||t.expression&&"view.scale"!==t.expression||t.valueExpression&&"$view.scale"!==t.valueExpression)&&null!=t.valueUnit?n.e.SIZE_UNIT_VALUE:(o.error(new s.a("mapview-bad-type","Found invalid size VisualVariable",t)),n.e.NONE)}},570:function(t,e,i){"use strict";i.d(e,"a",(function(){return l}));var s=i(5),r=i(534),n=i(589),a=i(623),o=i(620);const c=(t,e)=>t.key.level-e.key.level!=0?t.key.level-e.key.level:t.key.row-e.key.row!=0?t.key.row-e.key.row:t.key.col-e.key.col;class l extends n.a{constructor(t){super(),this._tileInfoView=t}get requiresDedicatedFBO(){return!1}renderChildren(t){this.sortChildren(c),this.setStencilReference(),super.renderChildren(t)}createRenderParams(t){const{state:e}=t,i=super.createRenderParams(t);return i.requiredLevel=this._tileInfoView.getClosestInfoForScale(e.scale).level,i.displayLevel=this._tileInfoView.tileInfo.scaleToZoom(e.scale),i}prepareRenderPasses(t){const e=super.prepareRenderPasses(t);return e.push(t.registerRenderPass({name:"stencil",brushes:[o.a],drawPhase:r.c.DEBUG|r.c.MAP|r.c.HIGHLIGHT,target:()=>this.getStencilTarget()})),Object(s.a)("esri-tiles-debug")&&e.push(t.registerRenderPass({name:"tileInfo",brushes:[a.a],drawPhase:r.c.DEBUG,target:()=>this.children})),e}getStencilTarget(){return this.children}updateTransforms(t){for(const e of this.children){const i=this._tileInfoView.getTileResolution(e.key);e.setTransform(t,i)}}setStencilReference(){let t=1;for(const e of this.children)e.stencilRef=t++}}},572:function(t,e,i){"use strict";i.d(e,"a",(function(){return d})),i.d(e,"b",(function(){return m})),i.d(e,"c",(function(){return x}));var s=i(3),r=i(302),n=i(587),a=i(24),o=i(38);const c=[0,0];function l(t,e){if(!e)return null;if("x"in e){const i={x:0,y:0};return[i.x,i.y]=t(e.x,e.y,c),null!=e.z&&(i.z=e.z),null!=e.m&&(i.m=e.m),i}if("xmin"in e){const i={xmin:0,ymin:0,xmax:0,ymax:0};return[i.xmin,i.ymin]=t(e.xmin,e.ymin,c),[i.xmax,i.ymax]=t(e.xmax,e.ymax,c),e.hasZ&&(i.zmin=e.zmin,i.zmax=e.zmax,i.hasZ=!0),e.hasM&&(i.mmin=e.mmin,i.mmax=e.mmax,i.hasM=!0),i}return"rings"in e?{rings:h(e.rings,t),hasM:e.hasM,hasZ:e.hasZ}:"paths"in e?{paths:h(e.paths,t),hasM:e.hasM,hasZ:e.hasZ}:"points"in e?{points:u(e.points,t),hasM:e.hasM,hasZ:e.hasZ}:void 0}function h(t,e){const i=[];for(const s of t)i.push(u(s,e));return i}function u(t,e){const i=[];for(const s of t){const t=e(s[0],s[1],[0,0]);i.push(t),s.length>2&&t.push(s[2]),s.length>3&&t.push(s[3])}return i}async function d(t,e){if(!e)return;const i=Array.isArray(t)?t.map(t=>Object(s.j)(t.geometry)&&t.geometry.spatialReference):[t];await Object(r.d)(i.map(t=>({source:t,dest:e})))}const f=l.bind(null,o.c),p=l.bind(null,o.f);function m(t,e,i){return t?(i||(i=e,e=t.spatialReference),Object(a.l)(e)&&Object(a.l)(i)&&!Object(a.d)(e,i)?Object(o.a)(e,i)?Object(a.p)(i)?f(t):p(t):Object(r.j)(n.a,[t],e,i,null)[0]:t):t}const y=new class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(t,e,i){if(!t||!t.length||!e||!i||Object(a.d)(e,i))return t;const s={geometries:t,inSpatialReference:e,outSpatialReference:i,resolve:null};return this._jobs.push(s),new Promise(t=>{s.resolve=t,null===this._timer&&(this._timer=setTimeout(this._process,10))})}_process(){this._timer=null;const t=this._jobs.shift();if(!t)return;const{geometries:e,inSpatialReference:i,outSpatialReference:s,resolve:c}=t;Object(o.a)(i,s)?Object(a.p)(s)?c(e.map(f)):c(e.map(p)):c(Object(r.j)(n.a,e,i,s,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};function x(t,e,i){return y.push(t,e,i)}},573:function(t,e,i){"use strict";i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return s}));const s=(t,e)=>t&&((...t)=>e.warn("DEBUG:",...t))||(()=>null),r=!1},574:function(t,e,i){"use strict";function s(t){const e=new Array(t.length);for(let i=0;i<t.length;i++)e[i]=t.charCodeAt(i);return e}i.d(e,"a",(function(){return s}))},575:function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var s=i(3);function r(t,e){return t?e?4:3:e?3:2}function n(t,e,i,n,c){if(Object(s.i)(e)||!e.lengths.length)return null;const l="upperLeft"===(null==c?void 0:c.originPosition)?-1:1;t.lengths.length&&(t.lengths.length=0),t.coords.length&&(t.coords.length=0);const h=t.coords,u=[],d=i?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:f,coords:p}=e,m=r(i,n);let y=0;for(const s of f){const t=a(d,p,y,s,i,n,l);t&&u.push(t),y+=s*m}if(u.sort((t,e)=>{let s=l*t[2]-l*e[2];return 0===s&&i&&(s=t[4]-e[4]),s}),u.length){let t=6*u[0][2];h[0]=u[0][0]/t,h[1]=u[0][1]/t,i&&(t=6*u[0][4],h[2]=0!==t?u[0][3]/t:0),(h[0]<d[0]||h[0]>d[1]||h[1]<d[2]||h[1]>d[3]||i&&(h[2]<d[4]||h[2]>d[5]))&&(h.length=0)}if(!h.length){const t=e.lengths[0]?o(p,0,f[0],i,n):null;if(!t)return null;h[0]=t[0],h[1]=t[1],i&&t.length>2&&(h[2]=t[2])}return t}function a(t,e,i,s,n,a,o=1){const c=r(n,a);let l=i,h=i+c,u=0,d=0,f=0,p=0,m=0;for(let r=0,x=s-1;r<x;r++,l+=c,h+=c){const i=e[l],s=e[l+1],r=e[l+2],a=e[h],o=e[h+1],c=e[h+2];let y=i*o-a*s;p+=y,u+=(i+a)*y,d+=(s+o)*y,n&&(y=i*c-a*r,f+=(r+c)*y,m+=y),i<t[0]&&(t[0]=i),i>t[1]&&(t[1]=i),s<t[2]&&(t[2]=s),s>t[3]&&(t[3]=s),n&&(r<t[4]&&(t[4]=r),r>t[5]&&(t[5]=r))}if(p*o>0&&(p*=-1),m*o>0&&(m*=-1),!p)return null;const y=[u,d,.5*p];return n&&(y[3]=f,y[4]=.5*m),y}function o(t,e,i,s,n){const a=r(s,n);let o=e,d=e+a,f=0,p=0,m=0,y=0;for(let r=0,x=i-1;r<x;r++,o+=a,d+=a){const e=t[o],i=t[o+1],r=t[o+2],n=t[d],a=t[d+1],x=t[d+2],_=s?l(e,i,r,n,a,x):c(e,i,n,a);if(_)if(f+=_,s){const t=u(e,i,r,n,a,x);p+=_*t[0],m+=_*t[1],y+=_*t[2]}else{const t=h(e,i,n,a);p+=_*t[0],m+=_*t[1]}}return f>0?s?[p/f,m/f,y/f]:[p/f,m/f]:i>0?s?[t[e],t[e+1],t[e+2]]:[t[e],t[e+1]]:null}function c(t,e,i,s){const r=i-t,n=s-e;return Math.sqrt(r*r+n*n)}function l(t,e,i,s,r,n){const a=s-t,o=r-e,c=n-i;return Math.sqrt(a*a+o*o+c*c)}function h(t,e,i,s){return[t+.5*(i-t),e+.5*(s-e)]}function u(t,e,i,s,r,n){return[t+.5*(s-t),e+.5*(r-e),i+.5*(n-i)]}},576:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));class s{constructor(t=0,e=0,i=0,s=0){this.x=t,this.y=e,this.width=i,this.height=s}get isEmpty(){return this.width<=0||this.height<=0}union(t){this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.width=Math.max(this.width,t.width),this.height=Math.max(this.height,t.height)}}},577:function(t,e,i){"use strict";i.d(e,"a",(function(){return f}));var s=i(18),r=i(550),n=i(540),a=i(533),o=i(536),c=i(537),l=i(541),h=i(578),u=i(551),d=i(558);class f extends(Object(h.a)(u.a)){constructor(t,e,i,n,l,h,u,d,f,p,m,y,x,_,g,b,v,O=!1,j,w){super(),this._xOffset=Object(s.c)(y),this._yOffset=Object(s.c)(x),this._decoration=f||"none",this._color=n,this._haloColor=l,this._haloSize=Math.min(Math.floor(5*Object(s.c)(Object(s.e)(i))),127),this._size=Math.min(Math.round(Object(s.c)(e)),127);const T=Math.min(Math.round(Object(s.c)(e)),127);this._referenceSize=Math.round(Math.sqrt(256*T)),this._scale=this._size/24,this._angle=m,this._justify=Object(r.c)(h||"center"),this._xAlignD=Object(r.d)(h||"center"),this._yAlignD=Object(r.f)(u||"baseline"),this._baseline="baseline"===(u||"baseline"),this._bitset=(1===d?1:0)|(p?1:0)<<1;const S=c.e.load(t);S.sdf=!0,this._materialKey=S.data,this._lineWidth=Object(s.c)(_)||512,this._lineHeight=g||1,this._textPlacement=b,this._effects=v,this._isCIM=O,this._minMaxZoom=Object(o.a)(Math.round(j*a.l),Math.round(w*a.l))}static fromText(t,e){const i=new f(t.materialKey,t.font.size,t.haloSize||0,t.color&&Object(n.d)(t.color)||0,t.haloColor&&Object(n.d)(t.haloColor)||0,t.horizontalAlignment,t.verticalAlignment,0,t.font.decoration,!1,t.angle||0,t.xoffset,t.yoffset,t.lineWidth,t.lineHeight,null,null,!1,l.b,l.a),[,s]=Object(d.a)(t.text);return i.bindTextInfo(e,s),i._vertexBoundsScale=t.maxVVSize?t.maxVVSize/t.font.size:1,i}static fromCIMText(t,e,i){const s=t.scaleFactor||1,r=t.size*t.sizeRatio*s,[a,o]=Object(l.e)(t.scaleInfo,i),c=new f(t.materialKey,r,t.outlineSize*t.sizeRatio,Object(n.c)(t.color),Object(n.c)(t.outlineColor),t.horizontalAlignment,t.verticalAlignment,t.alignment,t.decoration,t.colorLocked,t.angle,t.offsetX*t.sizeRatio*s,t.offsetY*t.sizeRatio*s,512,1,t.markerPlacement,t.effects,!0,a,o),[,h]=Object(d.a)(t.text);return c.bindTextInfo(e,h),c._vertexBoundsScale=t.maxVVSize?t.maxVVSize/r:1,c}}},578:function(t,e,i){"use strict";i.d(e,"a",(function(){return d}));var s=i(3),r=i(18),n=i(299),a=i(579),o=i(533),c=i(534),l=i(536),h=i(537),u=i(583);const d=t=>class extends t{constructor(...t){super(...t),this._isCIM=!1,this._vertexBoundsScale=1,this.geometryType=c.d.TEXT,this._aux=Object(l.b)(0,0,this._referenceSize,this._bitset)}bindTextInfo(t,e){t&&t.length?this._shapingInfo=Object(s.a)(t,t=>Object(u.a)(t,e,{scale:this._scale,angle:this._angle,xOffset:this._xOffset,yOffset:this._yOffset,hAlign:this._xAlignD,vAlign:this._yAlignD,maxLineWidth:Math.max(32,Math.min(this._lineWidth,512)),lineHeight:o.j*Math.max(.25,Math.min(this._lineHeight,4)),decoration:this._decoration,isCIM:this._isCIM})):this._shapingInfo=null}_write(t,e,i){const s=e.getDisplayId();this._writeGeometry(t,e,s,i)}_writeGeometry(t,e,i,r){const a=this._shapingInfo;if(Object(s.i)(a))return;if(Object(s.j)(this._textPlacement)){const s=null!=r?r:e.readLegacyGeometryForDisplay();return this._writePlacedText(t,i,s,a)}const o=r?Object(n.p)(Object(n.d)(r),2):"esriGeometryPolygon"===e.geometryType?e.readCentroid():e.readGeometryForDisplay();if(!Object(s.i)(o)){if(o.isPoint){const[e,s]=o.coords;return this._writeGlyphs(t,i,{x:e,y:s},a)}o.forEachVertex((e,s)=>this._writeGlyphs(t,i,{x:e,y:s},a))}}_writePlacedText(t,e,i,n){const o=Object(s.q)(this._textPlacement),c=a.a.getPlacement(i,o,Object(r.c)(1));if(!c)return;let l=c.next();for(;null!=l;){const i=l.getAngle();n.setRotation(i);const s=l.tx,r=l.ty;s<0||s>=512||r<0||r>=512||(this._writeGlyphs(t,e,{x:s,y:r},n),n.setRotation(-i)),l=c.next()}}_writeGlyphs(t,e,i,s){const r=h.e.load(this._materialKey),n=Object(l.a)(Math.round(8*i.x),Math.round(8*i.y)),a=this._vertexBoundsScale,o=s.bounds,c=2*Math.max(o.width,o.height);for(const l of s.glyphs)r.textureBinding=l.textureBinding,t.recordStart(e,r.data,this.geometryType,!1,!0),t.vertexBounds(i.x+o.x+this._xOffset,i.y+o.y-this._yOffset,c*a,c*a),this._writeVertices(t,e,n,l),t.recordEnd()}_writeGlyph(t,e,i,s,r){const n=h.e.load(this._materialKey),a=Object(l.a)(Math.round(8*i),Math.round(8*s));n.textureBinding=r.textureBinding,t.recordStart(e,n.data,this.geometryType,!1,!0);const o=r.bounds,c=this._vertexBoundsScale;t.vertexBounds(i+o.x*c,s+o.y*c,o.width*c,o.height*c),this._writeVertices(t,e,a,r),t.recordEnd()}_writeVertices(t,e,i,s){const r=t.vertexCount();this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.upperLeft),t.vertexWrite(s.texcoords.upperLeft),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.upperRight),t.vertexWrite(s.texcoords.upperRight),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.lowerLeft),t.vertexWrite(s.texcoords.lowerLeft),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.lowerRight),t.vertexWrite(s.texcoords.lowerRight),t.vertexEnd(),t.indexWrite(r+0),t.indexWrite(r+1),t.indexWrite(r+2),t.indexWrite(r+1),t.indexWrite(r+3),t.indexWrite(r+2)}_writeVertexCommon(t,e,i,s){const r=this._color,n=this._haloColor,a=Object(l.b)(0,0,this._referenceSize,this._bitset),o=Object(l.b)(0,0,this._size,this._haloSize);t.vertexWrite(i),t.vertexWrite(e),t.vertexWrite(r),t.vertexWrite(n),t.vertexWrite(o),t.vertexWrite(a),t.vertexWrite(this._minMaxZoom)}}},579:function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var s=i(46),r=i(305);class n{static getPlacement(t,e,i){const n=Object(r.b)(e);if(!n)return null;const a=Object(s.c)(t);return n.execute(a,e,i)}}},580:function(t,e,i){"use strict";i.d(e,"a",(function(){return p}));var s=i(3),r=i(18),n=i(327),a=i(300),o=i(540),c=i(533),l=i(536),h=i(537),u=i(541),d=i(581),f=i(551);class p extends(Object(d.a)(f.a)){constructor(t,e,i,s,r,o,u,d,f,p,m,y,x,_,g,b,v,O,j,w,T,S,M){super(),this.angle=s,this.height=u,this.width=o,this.xOffset=e*j,this.yOffset=i*j,this._markerPlacement=w,this._effects=T,this._anchorX=.5-(.5+b)*g.width/g.width,this._anchorY=.5-(.5+v)*g.height/g.height,this._minMaxZoom=Object(l.a)(Math.round(S*c.l),Math.round(M*c.l));const I=(1===_?1:0)|(m?1:0)<<1|(x?1:0)<<2|(y?1:0)<<3,R=g&&g.sdf,L=h.d.load(t);L.sdf=R,L.pattern=!0,L.textureBinding=g.textureBinding,this._materialKey=L.data,this._fillColor=r,this._outlineColor=f,this._sizeOutlineWidth=Object(l.b)(Math.round(Math.min(Math.sqrt(128*o),255)),Math.round(Math.min(Math.sqrt(128*u),255)),Math.round(Math.min(Math.sqrt(128*p),255)),Math.round(Math.min(Math.sqrt(128*d),255)));const C=g.rect.x+c.p,z=g.rect.y+c.p,E=C+g.width,F=z+g.height;this._offsets.xUpperLeft=C,this._offsets.yUpperLeft=z,this._offsets.xUpperRight=E,this._offsets.yUpperRight=z,this._offsets.xBottomLeft=C,this._offsets.yBottomLeft=F,this._offsets.xBottomRight=E,this._offsets.yBottomRight=F,this._texUpperLeft=Object(l.a)(C,z),this._texUpperRight=Object(l.a)(E,z),this._texBottomLeft=Object(l.a)(C,F),this._texBottomRight=Object(l.a)(E,F),o*=O,u*=O,o*=j,u*=j;const D=Math.round(64*O);this._bitestAndDistRatio=Object(l.a)(I,D),this._computedWidth=o,this._computedHeight=u;const A=Object(a.a)(),P=Object(n.a)();this._applyTransformation(P,A)}static fromCIMMarker(t,e,i){const n=e&&e.width||1,a=e&&e.height||1,c=t.size,l=n/a*t.scaleX,h=t.scaleSymbolsProportionally&&t.frameHeight?c/t.frameHeight:1,d=Object(o.c)(t.color),f=Object(o.c)(t.outlineColor),m=Object(r.c)(c),y=m*l,x=Object(r.c)(t.offsetX||0),_=Object(r.c)(t.offsetY||0),g=Object(r.c)(t.outlineWidth||0)*h,b=t.alignment||0,v=Object(r.c)(t.referenceSize),[O,j]=Object(u.e)(t.scaleInfo,i);let w=t.rotation||0;t.rotateClockwise||(w=-w);let T=0,S=0;const M=t.anchorPoint;M&&(t.isAbsoluteAnchorPoint?c&&(T=-M.x/(c*l),S=M.y/c):(T=M.x,S=M.y));const I=new p(t.materialKey,x,_,w,d,y,m,v,f,g,t.colorLocked,t.scaleSymbolsProportionally,!1,b,e,T,S,t.sizeRatio,Object(s.r)(t.scaleFactor,1),t.markerPlacement,t.effects,O,j);return I._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/y:1,I._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/m:1,I}static fromPictureMarker(t,e){const i=Math.round(Object(r.c)(t.width)),s=Math.round(Object(r.c)(t.height)),n=c.o,a=Math.round(Object(r.c)(t.xoffset||0)),o=Math.round(Object(r.c)(t.yoffset||0)),l=new p(t.materialKey,a,o,t.angle,n,i,s,s,0,0,!1,!1,!1,0,e,0,0,1,1,null,null,u.b,u.a);return l._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.width:1,l._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.height:1,l}static fromSimpleMarker(t,e){const i=Object(o.d)(t.color),s=Math.round(Object(r.c)(t.size)),n=s,a=Math.round(Object(r.c)(t.xoffset||0)),c=Math.round(Object(r.c)(t.yoffset||0)),l=t.style,h=t.outline,d=0|(h&&h.color&&Object(o.d)(h.color)),f=0|(h&&h.width&&Math.round(Object(r.c)(h.width))),m=new p(t.materialKey,a,c,t.angle,i,s,n,n,d,f,!1,!1,"esriSMSCross"===l||"esriSMSX"===l,0,e,0,0,126/64,1,null,null,u.b,u.a);return m.boundsType="esriSMSCircle"===l?"circle":"square",m._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.size:1,m._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.size:1,m}static fromLineSymbolMarker(t,e){const i=Object(o.d)(t.color),s=Math.round(Object(r.c)(6*t.lineWidth)),n=s,a="cross"===t.style||"x"===t.style;let c;switch(t.placement){case"begin-end":c="Both";break;case"begin":c="JustBegin";break;case"end":c="JustEnd";break;default:c="None"}const l={type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:c,offsetAlongLine:0},h=new p(t.materialKey,0,0,0,i,s,n,n/6,i,a?Math.round(Object(r.c)(t.lineWidth)):0,!1,!1,a,1,e,0,0,126/64,1,l,null,u.b,u.a);return h.boundsType="circle"===t.style?"circle":"square",h}}},581:function(t,e,i){"use strict";i.d(e,"a",(function(){return p}));var s=i(3),r=i(18),n=i(76),a=i(327),o=i(29),c=i(300),l=i(299),h=i(579),u=i(534),d=i(536);const f=3.14159265359/180,p=t=>class extends t{constructor(...t){super(...t),this.angle=0,this.xOffset=0,this.yOffset=0,this.width=0,this.height=0,this.boundsType="square",this._anchorX=0,this._anchorY=0,this._computedWidth=0,this._computedHeight=0,this._vertexBoundsScaleX=1,this._vertexBoundsScaleY=1,this._offsets={xUpperLeft:0,yUpperLeft:0,xUpperRight:0,yUpperRight:0,xBottomLeft:0,yBottomLeft:0,xBottomRight:0,yBottomRight:0},this.geometryType=u.d.MARKER}_write(t,e,i){const s=e.getDisplayId();t.recordStart(s,this._materialKey,this.geometryType,!1,!0),this._writeGeometry(t,e,s,i),t.recordEnd()}_writeGeometry(t,e,i,r){if(Object(s.j)(this._markerPlacement))return this._writePlacedMarkers(t,e,r);const n=r?Object(l.p)(Object(l.d)(r),2):"esriGeometryPolygon"===e.geometryType?e.readCentroid():e.readGeometryForDisplay();if(!Object(s.i)(n)){if(n.isPoint){const[e,s]=n.coords;if(!t.hasAggregates&&t.hasPixelBufferEnabled&&(e<-1||e>=513||s<-1||s>=513))return;return this._writeVertices(t,i,this._getPos(e,s),e,s)}n.forEachVertex((e,s)=>this._writeVertices(t,i,this._getPos(e,s),e,s))}}_writePlacedMarkers(t,e,i){const n=null!=i?i:e.readLegacyGeometryForDisplay(),o=h.a.getPlacement(n,Object(s.q)(this._markerPlacement),Object(r.c)(1));if(!o)return;const l=e.getDisplayId(),u=Object(c.a)(),d=Object(a.a)();let p=o.next();for(;null!=p;){const{tx:e,ty:i}=p;e>=-128&&e<=640&&i>=-128&&i<=640&&(this._applyTransformation(d,u,p.getAngle()/f),this._writeVertices(t,l,this._getPos(e,i),e,i)),p=o.next()}}_writeVertices(t,e,i,s,r){const n=t.vertexCount();t.vertexBounds(s+this.xOffset,r-this.yOffset,this._computedWidth*this._vertexBoundsScaleX,this._computedHeight*this._vertexBoundsScaleY),t.vertexWrite(i),t.vertexWrite(this._offsetUpperLeft),t.vertexWrite(this._texUpperLeft),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetUpperRight),t.vertexWrite(this._texUpperRight),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetBottomLeft),t.vertexWrite(this._texBottomLeft),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetBottomRight),t.vertexWrite(this._texBottomRight),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.indexWrite(n+0),t.indexWrite(n+1),t.indexWrite(n+2),t.indexWrite(n+1),t.indexWrite(n+3),t.indexWrite(n+2)}_applyTransformation(t,e,i=0){Object(n.d)(t),Object(n.h)(t,t,Object(c.b)(this.xOffset,-this.yOffset)),this.angle+i!==0&&Object(n.f)(t,t,f*(this.angle+i));const s=this._computedWidth,r=this._computedHeight,a=(this._anchorX-.5)*s,l=(this._anchorY-.5)*r;Object(o.m)(e,a,l),Object(o.n)(e,e,t),this._offsetUpperLeft=Object(d.a)(16*e[0],16*e[1]),this._offsets.xUpperLeft=e[0],this._offsets.yUpperLeft=e[1],Object(o.m)(e,a+s,l),Object(o.n)(e,e,t),this._offsetUpperRight=Object(d.a)(16*e[0],16*e[1]),this._offsets.xUpperRight=e[0],this._offsets.yUpperRight=e[1],Object(o.m)(e,a,l+r),Object(o.n)(e,e,t),this._offsetBottomLeft=Object(d.a)(16*e[0],16*e[1]),this._offsets.xBottomLeft=e[0],this._offsets.yBottomLeft=e[1],Object(o.m)(e,a+s,l+r),Object(o.n)(e,e,t),this._offsetBottomRight=Object(d.a)(16*e[0],16*e[1]),this._offsets.xBottomRight=e[0],this._offsets.yBottomRight=e[1]}_getPos(t,e){return Object(d.a)(Math.round(8*t),Math.round(8*e))}}},582:function(t,e,i){"use strict";i.d(e,"a",(function(){return Lt})),i.d(e,"b",(function(){return Rt}));var s=i(9),r=i(4),n=i(12),a=i(337),o=i(49),c=i(18),l=i(540),h=i(533),u=i(561),d=i(536),f=i(537),p=i(541),m=i(3),y=i(299),x=i(534),_=(i(618),i(564)),g=i(103),b=i(595);function v(t,e,i,s,r,n,a){W=0;const o=(s-i)*n,c=r&&r.length,l=c?(r[0]-i)*n:o;let h,u,d,f,p,m=O(e,i,s,0,l,n,!0);if(m&&m.next!==m.prev){if(c&&(m=function(t,e,i,s,r,n){const a=new Array;for(let o=0,c=s.length;o<c;o++){const r=O(t,e,i,s[o]*n,o<c-1?s[o+1]*n:i*n,n,!1);r===r.next&&(r.steiner=!0),a.push(R(r))}a.sort(P);for(const o of a)L(o,r),r=j(r,r.next);return r}(e,i,s,r,m,n)),o>80*n){h=d=e[0+i*n],u=f=e[1+i*n];for(let t=n;t<l;t+=n){const s=e[t+i*n],r=e[t+1+i*n];h=Math.min(h,s),u=Math.min(u,r),d=Math.max(d,s),f=Math.max(f,r)}p=Math.max(d-h,f-u),p=0!==p?1/p:0}w(m,t,n,h,u,p,a,0)}}function O(t,e,i,s,r,n,a){let o;if(a===function(t,e,i,s,r,n){let a=0;for(let o=s,c=r-n;o<r;o+=n)a+=(t[c+e*n]-t[o+e*n])*(t[o+1+e*n]+t[c+1+e*n]),c=o;return a}(t,e,0,s,r,n)>0)for(let c=s;c<r;c+=n)o=M(c+e*n,t[c+e*n],t[c+1+e*n],o);else for(let c=r-n;c>=s;c-=n)o=M(c+e*n,t[c+e*n],t[c+1+e*n],o);return o&&A(o,o.next)&&(I(o),o=o.next),o}function j(t,e=t){if(!t)return t;let i,s=t;do{if(i=!1,s.steiner||!A(s,s.next)&&0!==C(s.prev,s,s.next))s=s.next;else{if(I(s),s=e=s.prev,s===s.next)break;i=!0}}while(i||s!==e);return e}function w(t,e,i,s,r,n,a,o){if(!t)return;!o&&n&&(t=function t(e,i,s,r){for(let n;n!==e;n=n.next){if(n=n||e,null===n.z&&(n.z=D(n.x,n.y,i,s,r)),n.prev.next!==n||n.next.prev!==n)return n.prev.next=n,n.next.prev=n,t(e,i,s,r);n.prevZ=n.prev,n.nextZ=n.next}return e.prevZ.nextZ=null,e.prevZ=null,function(t){let e,i=1;for(;;){let s,r=t;t=null,e=null;let n=0;for(;r;){n++,s=r;let a=0;for(;a<i&&s;a++)s=s.nextZ;let o=i;for(;a>0||o>0&&s;){let i;0===a?(i=s,s=s.nextZ,o--):0!==o&&s?r.z<=s.z?(i=r,r=r.nextZ,a--):(i=s,s=s.nextZ,o--):(i=r,r=r.nextZ,a--),e?e.nextZ=i:t=i,i.prevZ=e,e=i}r=s}if(e.nextZ=null,i*=2,n<2)return t}}(e)}(t,s,r,n));let c=t;for(;t.prev!==t.next;){const l=t.prev,h=t.next;if(n?S(t,s,r,n):T(t))e.push(l.index/i+a),e.push(t.index/i+a),e.push(h.index/i+a),I(t),t=h.next,c=h.next;else if((t=h)===c){o?1===o?w(t=B(t,e,i,a),e,i,s,r,n,a,2):2===o&&k(t,e,i,s,r,n,a):w(j(t),e,i,s,r,n,a,1);break}}}function T(t){const e=t.prev,i=t,s=t.next;if(C(e,i,s)>=0)return!1;let r=t.next.next;const n=r;let a=0;for(;r!==t.prev&&(0===a||r!==n);){if(a++,E(e.x,e.y,i.x,i.y,s.x,s.y,r.x,r.y)&&C(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function S(t,e,i,s){const r=t.prev,n=t,a=t.next;if(C(r,n,a)>=0)return!1;const o=r.x<n.x?r.x<a.x?r.x:a.x:n.x<a.x?n.x:a.x,c=r.y<n.y?r.y<a.y?r.y:a.y:n.y<a.y?n.y:a.y,l=r.x>n.x?r.x>a.x?r.x:a.x:n.x>a.x?n.x:a.x,h=r.y>n.y?r.y>a.y?r.y:a.y:n.y>a.y?n.y:a.y,u=D(o,c,e,i,s),d=D(l,h,e,i,s);let f=t.prevZ,p=t.nextZ;for(;f&&f.z>=u&&p&&p.z<=d;){if(f!==t.prev&&f!==t.next&&E(r.x,r.y,n.x,n.y,a.x,a.y,f.x,f.y)&&C(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,p!==t.prev&&p!==t.next&&E(r.x,r.y,n.x,n.y,a.x,a.y,p.x,p.y)&&C(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;f&&f.z>=u;){if(f!==t.prev&&f!==t.next&&E(r.x,r.y,n.x,n.y,a.x,a.y,f.x,f.y)&&C(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&E(r.x,r.y,n.x,n.y,a.x,a.y,p.x,p.y)&&C(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function M(t,e,i,s){const r=U.create(t,e,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function I(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function R(t){let e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function L(t,e){if(e=function(t,e){let i=e;const s=t.x,r=t.y;let n,a=-1/0;do{if(r<=i.y&&r>=i.next.y&&i.next.y!==i.y){const t=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=s&&t>a){if(a=t,t===s){if(r===i.y)return i;if(r===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!n)return null;if(s===a)return n.prev;const o=n,c=n.x,l=n.y;let h,u=1/0;for(i=n.next;i!==o;)s>=i.x&&i.x>=c&&s!==i.x&&E(r<l?s:a,r,c,l,r<l?a:s,r,i.x,i.y)&&(h=Math.abs(r-i.y)/(s-i.x),(h<u||h===u&&i.x>n.x)&&F(i,t)&&(n=i,u=h)),i=i.next;return n}(t,e)){const i=N(e,t);j(i,i.next)}}function C(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function z(t,e,i,s){return!!(A(t,e)&&A(i,s)||A(t,s)&&A(i,e))||C(t,e,i)>0!=C(t,e,s)>0&&C(i,s,t)>0!=C(i,s,e)>0}function E(t,e,i,s,r,n,a,o){return(r-a)*(e-o)-(t-a)*(n-o)>=0&&(t-a)*(s-o)-(i-a)*(e-o)>=0&&(i-a)*(n-o)-(r-a)*(s-o)>=0}function F(t,e){return C(t.prev,t,t.next)<0?C(t,e,t.next)>=0&&C(t,t.prev,e)>=0:C(t,e,t.prev)<0||C(t,t.next,e)<0}function D(t,e,i,s,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-s)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function A(t,e){return t.x===e.x&&t.y===e.y}function P(t,e){return t.x-e.x}function B(t,e,i,s){let r=t;do{const n=r.prev,a=r.next.next;!A(n,a)&&z(n,r,r.next,a)&&F(n,a)&&F(a,n)&&(e.push(n.index/i+s),e.push(r.index/i+s),e.push(a.index/i+s),I(r),I(r.next),r=t=a),r=r.next}while(r!==t);return r}function k(t,e,i,s,r,n,a){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.index!==t.index&&V(o,t)){let c=N(o,t);return o=j(o,o.next),c=j(c,c.next),w(o,e,i,s,r,n,a,0),void w(c,e,i,s,r,n,a,0)}t=t.next}o=o.next}while(o!==t)}function V(t,e){return t.next.index!==e.index&&t.prev.index!==e.index&&!function(t,e){let i=t;do{if(i.index!==t.index&&i.next.index!==t.index&&i.index!==e.index&&i.next.index!==e.index&&z(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&F(t,e)&&F(e,t)&&function(t,e){let i=t,s=!1;const r=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!=i.next.y>n&&i.next.y!==i.y&&r<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)}function N(t,e){const i=U.create(t.index,t.x,t.y),s=U.create(e.index,e.x,e.y),r=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,s.next=i,i.prev=s,n.next=s,s.prev=n,s}class U{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(t,e,i){const s=W<G.length?G[W++]:new U;return s.index=t,s.x=e,s.y=i,s.prev=null,s.next=null,s.z=null,s.prevZ=null,s.nextZ=null,s.steiner=!1,s}}const G=new Array;let W=0;for(let Ct=0;Ct<8096;Ct++)G.push(new U);const q=new b.b(0,0,0,1,0),K=new b.b(0,0,0,1,0);function Z(t,e,i){let s=0;for(let r=1;r<i;r++){const i=t[2*(e+r-1)],n=t[2*(e+r-1)+1];s+=(t[2*(e+r)]-i)*(t[2*(e+r)+1]+n)}return s}function H(t,e,i,s,r){let n=0;for(let a=i;a<s;a+=3){const i=2*(t.getValue(a)-r),s=2*(t.getValue(a+1)-r),o=2*(t.getValue(a+2)-r);n+=Math.abs((e[i]-e[o])*(e[s+1]-e[i+1])-(e[i]-e[s])*(e[o+1]-e[i+1]))}return n}q.setExtent(h.D),K.setExtent(h.D);const Y=t=>class extends t{constructor(...t){super(...t),this.forceLibtess=!1,this.geometryType=x.d.FILL}_write(t,e,i){const s="esriGeometryPoint"===e.geometryType,r=f.a.load(this._materialKey);t.recordStart(e.getDisplayId(),this._materialKey,this.geometryType,r.dotDensity,s),this._writeGeometry(t,e,r,i,s),t.recordEnd()}_writeGeometry(t,e,i,s,r){const n=this._getGeometry(e,s,r);if(Object(m.i)(n))return;const a=t.indexCount();if(!(n.maxLength>100)&&!this.forceLibtess&&function(t,e){const{coords:i,lengths:s,hasIndeterminateRingOrder:r}=e,n=t.indexWriter(),a=t.vertexCount();if(r)return!1;const o=n.length;let c=0;for(let l=0;l<s.length;){let t=l,e=s[l],r=Z(i,c,e);const h=[];for(;++t<s.length;){const n=s[t],a=Z(i,c+e,n);if(!(a>0))break;r+=a,h.push(c+e),e+=n}const u=n.length;v(n,i,c,c+e,h,2,a);const d=H(n,i,u,n.length,a),f=Math.abs(r);if(Math.abs((d-f)/Math.max(1e-7,f))>1e-5)return n.seek(o),!1;l=t,c+=e}return!0}(t,n))return void(!(a===t.indexCount())&&this._writeVertices(t,e,n.coords,n.lengths,i));const o=function(t,e){const i=t.indexWriter(),s=t.vertexCount(),{coords:r,lengths:n}=e,{buffer:a,vertexCount:o}=Object(_.b)(r,n);i.ensureSize(o);for(let c=0;c<o;c++)i.push(c+s);return a}(t,n);a!==t.indexCount()&&this._writeVertices(t,e,o,[o.length/2],i)}_writeVertices(t,e,i,s,r){const n=e.getDisplayId();let a=0;const o=s.reduce((t,e)=>t+e),c=r.dotDensity?4:10;t.vertexEnsureSize(c*o);for(const l of s){const s=l+a;for(let o=a;o<s;o++){const s=i[2*o],a=i[2*o+1],c=Object(d.a)(1*s,1*a);t.vertexBounds(s,a,0,0),t.vertexWrite(c),t.vertexWrite(n),r.dotDensity?t.vertexWriteF32(1/Math.abs(e.readGeometryArea())):(t.vertexWrite(this.fillColor),t.vertexWrite(this.tl),t.vertexWrite(this.br),t.vertexWrite(this.aux1),t.vertexWrite(this.aux2),t.vertexWrite(this.aux3),t.vertexWrite(this._minMaxZoom))}a+=l}}_getGeometry(t,e,i){const s=e?Object(y.p)(Object(y.d)(e),2):t.readGeometryForDisplay();return s?function(t,e){if(Object(m.i)(t))return null;if(!function(t,e,i){let s=0;for(let r=0;r<t.lengths.length;r++){const n=t.lengths[r];for(let r=0;r<n;r++){const n=t.coords[2*(r+s)],a=t.coords[2*(r+s)+1];if(n<e||n>i||a<e||a>i)return!0}s+=n}return!1}(t,-128,h.D+128))return t;q.setPixelMargin(e),q.reset(3);let i=0;for(let a=0;a<t.lengths.length;a++){const e=t.lengths[a];let s=t.coords[2*(0+i)],r=t.coords[2*(0+i)+1];q.moveTo(s,r);for(let n=1;n<e;n++)s=t.coords[2*(n+i)],r=t.coords[2*(n+i)+1],q.lineTo(s,r);q.close(),i+=e}const s=q.result(!1);if(!s)return null;const r=[],n=[];for(const a of s){let t=0;for(const e of a)n.push(e.x),n.push(e.y),t++;r.push(t)}return new g.a(r,n)}(s,i?256:8):null}};var X=i(304),J=i(551);const Q=r.a.getLogger("esri.views.2d.engine.webgl.WGLDynamicMeshTemplate");class $ extends J.a{constructor(t){super(),this._ongoingMaterialRequestMap=new Map,this._materialCache=new Map,this._dynamicPropertyMap=new Map,this._cimLayer=t}analyze(t,e,i,s){const r=e.readLegacyFeature(),n=this._materialCache,a=this._cimLayer.materialHash;if(!a)return Q.error("A Dynamic mesh template must have a material hash value or function!"),Promise.reject(null);const o="function"==typeof a?a(r,i,s):a;if(n.has(o)){const t=n.get(o);return Promise.resolve(t)}if(this._ongoingMaterialRequestMap.has(o))return this._ongoingMaterialRequestMap.get(o);const c=Object(X.a)(this._cimLayer.cim,this._cimLayer.materialOverrides);c.mosaicHash=o;const l=t.getMosaicItem(c).then(t=>(this._ongoingMaterialRequestMap.delete(o),n.set(o,t),t)).catch(t=>(this._ongoingMaterialRequestMap.delete(o),Q.error(".analyze()",t.message),null));return this._ongoingMaterialRequestMap.set(o,l),l}}var tt=i(552);class et extends(Y($)){constructor(t,e,i){var s;if(super(t),this._minMaxZoom=Object(d.a)(Math.round(e*h.l),Math.round(i*h.l)),Object(p.f)(t.color)){const e=(e,i,s)=>{const r=t.color(e,i,s);return r&&Object(l.c)(r)||0};this._dynamicPropertyMap.set("fillColor",e)}else{const e=t.color;this.fillColor=e&&Object(l.c)(e)||0}let r=0;Object(p.f)(t.height)||(r=t.height||0);const n="CIMMarkerPlacementInsidePolygon"===(null==(s=t.cim.placement)?void 0:s.type)&&t.cim.placement.shiftOddRows?2:1;this._dynamicPropertyMap.set("_height",(e,i,s)=>Object(p.f)(t.height)?t.height(e,i,s)*n:r*n);let a=0;Object(p.f)(t.offsetX)||(a=Object(c.c)(t.offsetX||0)+128,a>255&&(a=255));this._dynamicPropertyMap.set("_offsetX",(e,i,s)=>{if(Object(p.f)(t.offsetX)){let r=Object(c.c)(t.offsetX(e,i,s))+128;return r>255&&(r=255),r}return a});let o=1;Object(p.f)(t.scaleX)||(o=t.scaleX||1);this._dynamicPropertyMap.set("_scaleX",(e,i,s)=>Object(p.f)(t.scaleX)?t.scaleX(e,i,s):o);let m=0;Object(p.f)(t.offsetY)||(m=Object(c.c)(-t.offsetY||0)+128,m>255&&(m=255));this._dynamicPropertyMap.set("_offsetY",(e,i,s)=>{if(Object(p.f)(t.offsetY)){let r=Object(c.c)(-t.offsetY(e,i,s))+128;return r>255&&(r=255),r}return m});let y=0;Object(p.f)(t.angle)||(y=Object(u.d)(t.angle)||0);this._dynamicPropertyMap.set("_angle",(e,i,s)=>Object(p.f)(t.angle)?Object(u.d)(t.angle(e,i,s)):y),this._effects=t.effects,this._cimFillLayer=t,this._fillMaterialKey=f.a.load(t.materialKey)}static fromCIMFill(t,e){const[i,s]=Object(p.e)(t.scaleInfo,e);return new et(t,i,s)}bindFeature(t,e,i){const s=t.readLegacyFeature();this._dynamicPropertyMap.forEach((t,r)=>{this[r]=t(s,e,i)});const r=this._fillMaterialKey,n=this._materialCache,a=this._cimFillLayer;this.aux3=Object(d.b)(0,0,this._angle,a.colorLocked?1:0);const l=(0,a.materialHash)(s,e,i),u=n.get(l);let f=null;if(u&&Object(tt.a)(u.spriteMosaicItem)&&(f=u.spriteMosaicItem),f){const{rect:t,width:e,height:i}=f,s=t.x+h.p,n=t.y+h.p,a=s+e,l=n+i;let u=Object(o.k)(Object(c.c)(this._height));u>255?u=255:u<=0&&(u=Object(o.k)(l-n));let p=Object(o.k)(Object(c.c)(this._height/i*e||0));p>255?p=255:p<=0&&(p=Object(o.k)(a-s));const m=this._scaleX,y=1;this.tl=Object(d.a)(s,n),this.br=Object(d.a)(a,l),this.aux1=Object(d.b)(p,u,this._offsetX,this._offsetY),this.aux2=Object(d.a)(128*m,128*y),r.sdf=f.sdf,r.pattern=!0,r.textureBinding=f.textureBinding}else this.tl=0,this.br=0,this.aux1=0,this.aux2=0,r.sdf=!1,r.pattern=!1,r.textureBinding=0;this._materialKey=r.data}}var it=i(594);const st=t=>class extends t{constructor(...t){super(...t),this.tessellationProperties={},this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0},this.geometryType=x.d.LINE}_initializeTessellator(t){const e=f.c.load(this._materialKey),i=this._tessellationOptions,s=e.vvSizeFieldStops||e.vvSizeMinMaxValue||e.vvSizeScaleStops||e.vvSizeUnitValue,r=this.tessellationProperties._halfWidth<h.C;this.tessellationProperties.minMaxZoom=this._minMaxZoom;const n=r&&!t&&!s;i.wrapDistance=65535,i.textured=this._isDashed||this._hasPattern,i.offset=this.tessellationProperties.offset,i.halfWidth=this.tessellationProperties._halfWidth;const a=n?0:1;this._lineTessellator=new it.a(rt(this.tessellationProperties,a,a),nt(this.tessellationProperties),n)}_write(t,e,i){const s="esriGeometryPoint"===e.geometryType;t.recordStart(e.getDisplayId(),this._materialKey,this.geometryType,!1,s),this._writeGeometry(t,e,i,s),t.recordEnd()}_writeGeometry(t,e,i,s){const r=null!=i?i:e.readLegacyGeometryForDisplay(),n=this._getLines(r,s);Object(m.i)(n)||this._writeVertices(t,e,n)}_getLines(t,e){if(Object(m.i)(t))return null;const i=t.paths||t.rings;return Object(m.i)(i)?null:function(t,e){K.setPixelMargin(e);const i=K,s=-e,r=h.D+e;let n=[],a=!1,o=0;for(;o<t.length;){const e=[],c=t[o];if(!c)return null;i.reset(2);let[l,h]=c[0];if(a)i.moveTo(l,h);else{if(l<s||l>r||h<s||h>r){a=!0;continue}e.push({x:l,y:h})}let u=!1;const d=c.length;for(let t=1;t<d;++t)if(l+=c[t][0],h+=c[t][1],a)i.lineTo(l,h);else{if(l<s||l>r||h<s||h>r){u=!0;break}e.push({x:l,y:h})}if(u)a=!0;else{if(a){const t=i.resultWithStarts();if(t)for(const e of t)n.push(e)}else n.push({line:e,start:0});o++,a=!1}}return n=n.filter(t=>t.line.length>1),0===n.length?null:n}(i,e?256:16)}_writeVertices(t,e,i){const s=e.getDisplayId(),r=t.vertexCount(),n=this.tessellationProperties,a=this._tessellationOptions;n.out=t,n.id=s,n.indexCount=0,n.vertexCount=0,n.offset=r,a.capType=this._capType,a.joinType=this._joinType;for(const{line:o,start:c}of i)a.initialDistance=c%65535,this._lineTessellator.tessellate(o,a)}},rt=(t,e,i)=>(s,r,n,a,o,c,l,h,u,f,p)=>{const m=Object(d.a)(p,Math.ceil(1024*t._halfWidth)),y=Object(d.b)(Math.round(31*l),Math.round(31*h),Math.round(31*u),Math.round(31*f)),x=Object(d.b)(31*o,31*c,0,t._bitset),_=t.out;return _.vertexBounds(s,r,e,i),_.vertexWrite(Object(d.a)(8*s,8*r)),_.vertexWrite(t.id),_.vertexWrite(t._fillColor),_.vertexWrite(y),_.vertexWrite(m),_.vertexWrite(t._tl),_.vertexWrite(t._br),_.vertexWrite(x),_.vertexWrite(Object(d.a)(Math.ceil(1024*t._halfReferenceWidth),0)),_.vertexWrite(t.minMaxZoom),_.vertexEnd(),t.offset+t.vertexCount++},nt=t=>(e,i,s)=>{const r=t.out;r.indexWrite(e),r.indexWrite(i),r.indexWrite(s),t.indexCount+=3};class at extends(st($)){constructor(t,e,i){super(t),this._minMaxZoom=Object(d.a)(Math.round(e*h.l),Math.round(i*h.l)),this._cimLineLayer=t;let s=0;Object(p.f)(t.width)||(s=.5*Object(c.c)(t.width));if(this._dynamicPropertyMap.set("_halfWidth",(e,i,r)=>Object(p.f)(t.width)?.5*Object(c.c)(t.width(e,i,r)):s),Object(p.f)(t.cap)?this._dynamicPropertyMap.set("_capType",t.cap):this._capType=t.cap,Object(p.f)(t.join)?this._dynamicPropertyMap.set("_joinType",t.join):this._joinType=t.join,Object(p.f)(t.color)){const e=(e,i,s)=>{const r=t.color(e,i,s);return r&&Object(l.c)(r)||0};this._dynamicPropertyMap.set("_fillColor",e)}else{const e=t.color;this._fillColor=e&&Object(l.c)(e)||0}if(Object(p.f)(t.miterLimit)){const e=(e,i,s)=>Object(p.d)(t.miterLimit(e,i,s));this._dynamicPropertyMap.set("_miterLimitCosine",e)}else this._miterLimitCosine=Object(p.d)(t.miterLimit);this._scaleFactor=t.scaleFactor||1,this._isDashed=t.isDashed,this._effects=t.effects,this.tessellationProperties._bitset=t.colorLocked?1:0,this._materialKey=t.materialKey,this._initializeTessellator(!0)}static fromCIMLine(t,e){const[i,s]=Object(p.e)(t.scaleInfo,e);return new at(t,i,s)}bindFeature(t,e,i){const s=t.readLegacyFeature();this._dynamicPropertyMap.forEach((t,r)=>{this[r]=t(s,e,i)}),this._halfWidth*=this._scaleFactor;const r=this._materialCache,n=(0,this._cimLineLayer.materialHash)(s,e,i),a=r.get(n);let o=null;if(a&&Object(tt.a)(a.spriteMosaicItem)&&(o=a.spriteMosaicItem),o){this._hasPattern=!0;const{rect:t,width:e,height:i}=o,s=t.x+h.p,r=t.y+h.p,n=s+e,a=r+i;this.tessellationProperties._tl=Object(d.a)(s,r),this.tessellationProperties._br=Object(d.a)(n,a)}else this._hasPattern=!1,this.tessellationProperties._tl=0,this.tessellationProperties._br=0;this.tessellationProperties._fillColor=this._fillColor,this.tessellationProperties._halfWidth=this._halfWidth,this.tessellationProperties.offset=0,this.tessellationProperties._halfReferenceWidth=this.tessellationProperties._halfWidth;const c=f.c.load(this._materialKey);o&&(c.sdf=o.sdf,c.pattern=!0,c.textureBinding=o.textureBinding),this._materialKey=c.data}}var ot=i(327),ct=i(300),lt=i(581);const ht=Object(ct.a)(),ut=Object(ot.a)(),dt=r.a.getLogger("esri.views.2d.engine.webgl.WGLDynamicMarkerTemplate");class ft extends(Object(lt.a)($)){constructor(t,e,i){if(super(t),this._cimMarkerLayer=t,this._minMaxZoom=Object(d.a)(Math.round(e*h.l),Math.round(i*h.l)),Object(p.f)(t.color)){const e=(e,i,s)=>Object(l.c)(t.color(e,i,s));this._dynamicPropertyMap.set("_fillColor",e)}else this._fillColor=Object(l.c)(t.color);if(Object(p.f)(t.outlineColor)){const e=(e,i,s)=>Object(l.c)(t.outlineColor(e,i,s));this._dynamicPropertyMap.set("_outlineColor",e)}else this._outlineColor=Object(l.c)(t.outlineColor);if(Object(p.f)(t.size)){const e=(e,i,s)=>Object(c.c)(t.size(e,i,s));this._dynamicPropertyMap.set("_size",e)}else this._size=Object(c.c)(t.size)||0;if(Object(p.f)(t.scaleX)?this._dynamicPropertyMap.set("_scaleX",t.scaleX):this._scaleX=t.scaleX||1,Object(p.f)(t.offsetX)){const e=(e,i,s)=>Object(c.c)(t.offsetX(e,i,s));this._dynamicPropertyMap.set("xOffset",e)}else this.xOffset=Object(c.c)(t.offsetX)||0;if(Object(p.f)(t.offsetY)){const e=(e,i,s)=>Object(c.c)(t.offsetY(e,i,s));this._dynamicPropertyMap.set("yOffset",e)}else this.yOffset=Object(c.c)(t.offsetY)||0;if(Object(p.f)(t.outlineWidth)){const e=(e,i,s)=>Object(c.c)(t.outlineWidth(e,i,s));this._dynamicPropertyMap.set("_outlineWidth",e)}else this._outlineWidth=Object(c.c)(t.outlineWidth)||0;Object(p.f)(t.rotation)?this._dynamicPropertyMap.set("_angle",t.rotation):this._angle=t.rotation||0,this._scaleFactor=Object(m.r)(t.scaleFactor,1),this._markerPlacement=t.markerPlacement,this._effects=t.effects,this._bitSet=(1===t.alignment?1:0)|(t.colorLocked?1:0)<<1|(t.scaleSymbolsProportionally?1:0)<<3,this._materialKey=t.materialKey}static fromCIMMarker(t,e){const[i,s]=Object(p.e)(t.scaleInfo,e);return new ft(t,i,s)}bindFeature(t,e,i){const r=t.readLegacyFeature();this._dynamicPropertyMap.forEach((t,s)=>{this[s]=t(r,e,i)});const n=this._cimMarkerLayer.materialHash,a="function"==typeof n?n(r,e,i):n,o=this._materialCache.get(a);if(!o||!Object(tt.a)(o.spriteMosaicItem)||!o.spriteMosaicItem)return void dt.error(new s.a("mapview-cim","Encountered an error when binding feature"));const l=o.spriteMosaicItem,u=this._cimMarkerLayer.sizeRatio,p=l.width/l.height*this._scaleX,m=this._cimMarkerLayer.rotateClockwise?this._angle:-this._angle;let y=this._size,x=y*p;const _=this.xOffset,g=this.yOffset;this.xOffset*=this._scaleFactor,this.yOffset*=this._scaleFactor;const b=this._cimMarkerLayer.scaleSymbolsProportionally&&this._cimMarkerLayer.frameHeight?this._size/Object(c.c)(this._cimMarkerLayer.frameHeight):1,v=this._outlineWidth*b,O=Object(c.c)(this._cimMarkerLayer.referenceSize);let j=0,w=0;const T=this._cimMarkerLayer.anchorPoint;T&&(this._cimMarkerLayer.isAbsoluteAnchorPoint?this._size&&(j=-T.x/(this._size*p),w=T.y/this._size):(j=T.x,w=T.y)),this._sizeOutlineWidth=Object(d.b)(Math.round(Math.min(Math.sqrt(128*x),255)),Math.round(Math.min(Math.sqrt(128*y),255)),Math.round(Math.min(Math.sqrt(128*v),255)),Math.round(Math.min(Math.sqrt(128*O),255))),this.angle=m;const S=Math.round(64*u);this._bitestAndDistRatio=Object(d.a)(this._bitSet,S);const M=l.rect.x+h.p,I=l.rect.y+h.p,R=M+l.width,L=I+l.height;this._texUpperLeft=Object(d.a)(M,I),this._texUpperRight=Object(d.a)(R,I),this._texBottomLeft=Object(d.a)(M,L),this._texBottomRight=Object(d.a)(R,L);const C=f.d.load(this._materialKey);C.sdf=l.sdf,C.pattern=!0,C.textureBinding=l.textureBinding,this._materialKey=C.data,this._anchorX=.5-(.5+j)*l.width/l.width,this._anchorY=.5-(.5+w)*l.height/l.height,x*=u,y*=u,x*=this._scaleFactor,y*=this._scaleFactor,x*=l.rect.width/l.width,y*=l.rect.height/l.height,this._computedWidth=x,this._computedHeight=y,this._applyTransformation(ut,ht),this.xOffset=_,this.yOffset=g}}var pt=i(550),mt=i(578),yt=i(574);class xt extends(Object(mt.a)($)){constructor(t,e,i){super(t),this._horizontalAlignment="center",this._verticalAlignment="middle",this._textToGlyphs=new Map,this._minMaxZoom=Object(d.a)(Math.round(e*h.l),Math.round(i*h.l));const s=t.scaleFactor||1;if(this._cimTextLayer=t,Object(p.f)(t.color)){const e=(e,i,s)=>Object(l.c)(t.color(e,i,s));this._dynamicPropertyMap.set("_color",e)}else this._color=Object(l.c)(t.color);if(Object(p.f)(t.color)){const e=(e,i,s)=>Object(l.c)(t.outlineColor(e,i,s));this._dynamicPropertyMap.set("_haloColor",e)}else this._haloColor=Object(l.c)(t.outlineColor);let r;Object(p.f)(t.size)||(r=Math.min(Math.round(Object(c.c)(t.size*t.sizeRatio)),127));if(this._dynamicPropertyMap.set("_size",(e,i,s)=>Object(p.f)(t.size)?Math.min(Math.round(Object(c.c)(t.size(e,i,s)*t.sizeRatio)),127):r),Object(p.f)(t.outlineSize)){const e=(e,i,s)=>Math.min(Math.floor(5*Object(c.c)(t.outlineSize(e,i,s)*t.sizeRatio)),127);this._dynamicPropertyMap.set("_haloSize",e)}else this._haloSize=Math.min(Math.floor(5*Object(c.c)(t.outlineSize*t.sizeRatio)),127);let n;Object(p.f)(t.offsetX)||(n=Math.round(Object(c.c)(t.offsetX*t.sizeRatio)));let a;this._dynamicPropertyMap.set("_xOffset",(e,i,s)=>Object(p.f)(t.offsetX)?Math.round(Object(c.c)(t.offsetX(e,i,s)*t.sizeRatio)):n),Object(p.f)(t.offsetY)||(a=Math.round(Object(c.c)(t.offsetY*t.sizeRatio)));this._dynamicPropertyMap.set("_yOffset",(e,i,s)=>Object(p.f)(t.offsetY)?Math.round(Object(c.c)(t.offsetY(e,i,s)*t.sizeRatio)):a),Object(p.f)(t.angle)?this._dynamicPropertyMap.set("_angle",t.angle):this._angle=t.angle,Object(p.f)(t.horizontalAlignment)?this._dynamicPropertyMap.set("_horizontalAlignment",t.horizontalAlignment):this._horizontalAlignment=t.horizontalAlignment,Object(p.f)(t.verticalAlignment)?this._dynamicPropertyMap.set("_verticalAlignment",t.verticalAlignment):this._verticalAlignment=t.verticalAlignment,this._scaleFactor=s,Object(p.f)(t.text)?this._dynamicPropertyMap.set("_text",t.text):this._text=t.text;const o=Math.min(Math.round(Object(c.c)(t.referenceSize*t.sizeRatio)),127);this._referenceSize=Math.round(Math.sqrt(256*o)),this._materialKey=t.materialKey;const u=f.f.load(this._materialKey);u.sdf=!0,this._bitset=(1===t.alignment?1:0)|(t.colorLocked?1:0)<<1,this._materialKey=u.data,this._decoration="none",this._lineHeight=1,this._lineWidth=512,this._textPlacement=t.markerPlacement,this._effects=t.effects,this._isCIM=!0}static fromCIMText(t,e){const[i,s]=Object(p.e)(t.scaleInfo,e);return new xt(t,i,s)}async analyze(t,e,i,s){const r=e.readLegacyFeature(),n=function(t,e,i,s){return"string"==typeof t.text?t.text:"function"==typeof t.text?t.text(e,i,s):""}(this._cimTextLayer,r,i,s),a=await t.getMosaicItem(this._cimTextLayer.cim,Object(yt.a)(n));return this._textToGlyphs.set(n,a.glyphMosaicItems),a}bindFeature(t,e,i){const s=t.readLegacyFeature();if(this._dynamicPropertyMap.forEach((t,r)=>{this[r]=t(s,e,i)}),!this._text||0===this._text.length)return void(this._shapingInfo=null);this._size*=this._scaleFactor,this._scale=this._size/24,this._xOffset*=this._scaleFactor,this._yOffset*=this._scaleFactor,this._xAlignD=Object(pt.d)(this._horizontalAlignment||"center"),this._yAlignD=Object(pt.f)(this._verticalAlignment||"baseline");const r=this._textToGlyphs.get(this._text);this.bindTextInfo(r,!1)}}class _t extends(Y(J.a)){constructor(t,e,i,s,r,n,a,o,c,l,u){super(),this._effects=c;const p=f.a.load(t);e&&(p.sdf=e.sdf,p.pattern=!0,p.textureBinding=e.textureBinding),this.fillColor=i,this.tl=s,this.br=r,this.aux1=n,this.aux2=a,this.aux3=o,this._minMaxZoom=Object(d.a)(Math.round(l*h.l),Math.round(u*h.l)),this._materialKey=p.data}static fromCIMFill(t,e,i){const s=t.color,r=s&&Object(l.c)(s)||0,n=t.materialKey,[a,f]=Object(p.e)(t.scaleInfo,i);if(!e){const e=Object(d.b)(0,0,0,t.colorLocked?1:0);return new _t(n,null,r,0,0,0,0,e,t.effects,a,f)}const{rect:m,width:y,height:x}=e,_=m.x+h.p,g=m.y+h.p,b=_+y,v=g+x;let O=Object(o.k)(x);O>255?O=255:O<=0&&(O=Object(o.k)(v-g));let j=Object(o.k)(y||0);j>255?j=255:j<=0&&(j=Object(o.k)(b-_));let w=Object(c.c)(t.offsetX||0)+128;w>255&&(w=255);let T=Object(c.c)(-t.offsetY||0)+128;T>255&&(T=255);const S=t.scaleX||1,M=Object(d.a)(_,g),I=Object(d.a)(b,v),R=Object(d.b)(j,O,w,T),L=Object(d.a)(128*S,128),C=Object(d.b)(0,0,Object(u.b)(t.angle),t.colorLocked?1:0);return new _t(n,e,r,M,I,R,L,C,t.effects,a,f)}static fromSimpleFill(t,e,i=!1){const{color:s}=t,r=s&&"esriSFSNull"!==t.style&&Object(l.d)(s)||0,n=Object(d.b)(0,0,0,i?255:0),a=t.materialKey;if(!e)return new _t(a,null,r,0,0,0,0,n,null,p.b,p.a);const{rect:c,width:u,height:f}=e,m=c.x+h.p,y=c.y+h.p,x=m+u,_=y+f,g=Object(d.a)(m,y),b=Object(d.a)(x,_),v=Object(d.b)(Object(o.k)(x-m),Object(o.k)(_-y),0,0),O=Object(d.a)(128,128);return new _t(a,e,r,g,b,v,O,n,null,p.b,p.a)}static fromPictureFill(t,e,i=!1){const s=h.o,{rect:r,width:n,height:a}=e,l=r.x+h.p,u=r.y+h.p,f=l+n,m=u+a,y=Object(d.a)(l,u),x=Object(d.a)(f,m);let _=Object(o.k)(Object(c.c)(t.width));_>255&&(_=255);let g=Object(o.k)(Object(c.c)(t.height));g>255&&(g=255);let b=Object(c.c)(t.xoffset)+128;b>255&&(b=255);let v=Object(c.c)(-t.yoffset)+128;v>255&&(v=255);const O=Object(d.b)(_,g,b,v),j=Object(d.a)(128*t.xscale,128*t.yscale),w=Object(d.b)(0,0,0,i?255:0),T=t.materialKey;return new _t(T,e,s,y,x,O,j,w,null,p.b,p.a)}}var gt=i(538);const bt=r.a.getLogger("esri.views.2d.engine.webgl.WGLLineTemplate");class vt extends(st(J.a)){constructor(t,e,i,s,r,n,a,o,c,l,u,m,y,x,_,g,b){super();const v=f.c.load(t);e&&(v.sdf=e.sdf,v.pattern=!0,v.textureBinding=e.textureBinding),this._capType=s,this._joinType=r,this._miterLimitCosine=Object(p.d)(n),this.tessellationProperties._fillColor=a,this.tessellationProperties._tl=o,this.tessellationProperties._br=c,this._hasPattern=l,this._isDashed=u,this._isColorLocked=m,this._zOrder=x,this._effects=_,this._minMaxZoom=Object(d.a)(Math.round(g*h.l),Math.round(b*h.l)),this._materialKey=v.data,this.tessellationProperties._bitset=m?1:0,this.tessellationProperties._halfWidth=.5*i,this.tessellationProperties._halfReferenceWidth=.5*y,this.tessellationProperties.offset=0,this._initializeTessellator(!1)}static fromCIMLine(t,e,i){const s=t.color,r=t.scaleFactor||1,n=t.isDashed;let a=t.cap;n&&1===a&&(a=2);const o=t.join,u=Object(c.c)(t.width)*r,f=Object(c.c)(t.referenceWidth),m=Object(c.c)(t.miterLimit),y=s&&Object(l.c)(s)||0,[x,_]=Object(p.e)(t.scaleInfo,i);if(!e)return new vt(t.materialKey,e,u,a,o,m,y,0,0,!1,n,t.colorLocked,f,t.zOrder,t.effects,x,_);const{rect:g,width:b,height:v}=e,O=g.x+h.p,j=g.y+h.p,w=O+b,T=j+v,S=Object(d.a)(O,j),M=Object(d.a)(w,T);return new vt(t.materialKey,e,u,a,o,m,y,S,M,!0,n,t.colorLocked,f,t.zOrder,t.effects,x,_)}static fromSimpleLine(t,e){const{color:i}=t,s="esriSLSSolid"!==t.style&&"esriSLSNull"!==t.style,r=Object(gt.h)(t.cap||"round"),n=Object(gt.i)(t.join||"round");let a=i&&"esriSLSNull"!==t.style&&Object(l.d)(i)||0;"esriSLSNull"===t.style&&(a=0);const o=Object(c.c)(t.width),u=t.miterLimit;if(!e)return new vt(t.materialKey,e,o,r,n,u,a,0,0,!1,s,!1,o,0,null,p.b,p.a);const{rect:f,width:m,height:y}=e,x=f.x+h.p,_=f.y+h.p,g=x+m,b=_+y,v=Object(d.a)(x,_),O=Object(d.a)(g,b);return new vt(t.materialKey,e,o,r,n,u,a,v,O,!0,s,!1,o,0,null,p.b,p.a)}static fromPictureLineSymbol(t,e,i,s){return bt.error("PictureLineSymbol support does not exist!"),null}}var Ot=i(580),jt=i(577);class wt{constructor(){this._resolver=null}isHeld(){return!!this._resolver}async acquire(){if(!this._resolver)return this._resolver=Object(n.g)(),Promise.resolve();await this._resolver.promise,await this.acquire()}release(){const t=this._resolver;this._resolver=null,t.resolve()}}var Tt=i(559);const St=r.a.getLogger("esri.views.2d.engine.webgl.mesh.templates.WGLTemplateStore"),Mt=new Array;function It(t,e){const i=t.length;return t.push(null),e.then(e=>t[i]=e),t}function Rt(t){return!!(1&t)}class Lt{constructor(t,e){this._idCounter=1,this._templateIdCounter=1,this._idToTemplateGroup=new Map,this._symbolToTemplate=new Map,this._fetchQueue=[],this._idToResolver=new Map,this._cimTemplateCache=new Map,this._cimAnalyses=[],this._lock=new wt,this._fetchResource=t,this._tileInfo=e}get _markerError(){return this._errorTemplates.marker[0]}get _fillError(){return this._errorTemplates.fill[0]}get _lineError(){return this._errorTemplates.line[0]}get _textError(){return this._errorTemplates.line[0]}createTemplateGroup(t,e){this._initErrorTemplates();const i=t.hash;if(this._symbolToTemplate.has(i))return this._symbolToTemplate.get(i);const s=new Array;e&&this._createMeshTemplates(s,e,!0),this._createMeshTemplates(s,t,!1);const r=this._createGroupId("expanded-cim"===t.type);return this._idToTemplateGroup.set(r,s),this._symbolToTemplate.set(i,r),r}getTemplateGroup(t){return this._idToTemplateGroup.has(t)?this._idToTemplateGroup.get(t):Mt}getDynamicTemplateGroup(t){return this._idToTemplateGroup.has(t)?(Rt(t)||St.error("mapview-template-store",`Id ${t} does not refer to a dynamic template`),this._idToTemplateGroup.get(t)):Mt}getMosaicItem(t,e){const i=this._createTemplateId(),s=new Promise(t=>this._idToResolver.set(i,t));return this._fetchQueue.push({symbol:t,id:i,glyphIds:e}),s}finalize(t){return this._fetchQueue.length||this._lock.isHeld()?async function(t,e,i){try{await t.acquire(),await e(i),t.release()}catch(s){throw t.release(),s}}(this._lock,this._fetchAllQueuedResources.bind(this),t):Promise.resolve()}_initErrorTemplates(){this._errorTemplates||(this._errorTemplates={fill:this._createMeshTemplates([],Object(Tt.c)(a.c),!1),marker:this._createMeshTemplates([],Object(Tt.c)(a.b),!1),line:this._createMeshTemplates([],Object(Tt.c)(a.d),!1)})}_fetchAllQueuedResources(t){if(!this._fetchQueue.length)return Promise.resolve();const e=this._fetchQueue,i=this._cimAnalyses;return this._fetchQueue=[],this._cimAnalyses=[],Promise.all(i).then(()=>this._fetchResource(e,t).then(t=>{for(const{id:e,mosaicItem:i}of t)this._idToResolver.get(e)(i),this._idToResolver.delete(e)})).catch(t=>{Object(n.m)(t)?this._fetchQueue=this._fetchQueue.concat(e):"worker:port-closed"===t.name||St.error(new s.a("mapview-template-store","Unable to fetch requested texture resources",t))})}_createGroupId(t){return this._idCounter++<<1|(t?1:0)}_createTemplateId(){return this._templateIdCounter++}async _createSMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return Object(tt.a)(e,St)?Ot.a.fromSimpleMarker(t,e):this._markerError}async _createPMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return Object(tt.a)(e,St)?Ot.a.fromPictureMarker(t,e):this._markerError}async _createSFS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return Object(tt.a)(i,St)?_t.fromSimpleFill(t,i,e):this._fillError}async _createPFS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return Object(tt.a)(i,St)?_t.fromPictureFill(t,i,e):this._fillError}async _createSLS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return Object(tt.a)(i,St)?vt.fromSimpleLine(t,i):this._lineError}async _createLMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return Object(tt.a)(e,St)?Ot.a.fromLineSymbolMarker(t,e):this._markerError}async _createTS(t){const{glyphMosaicItems:e}=await this.getMosaicItem(t);return jt.a.fromText(t,e)}async _createCIMText(t){const{glyphMosaicItems:e}=await this.getMosaicItem(t.cim,Object(yt.a)(t.text));return Object(tt.a)(e,St)?jt.a.fromCIMText(t,e,this._tileInfo):this._textError}async _createCIMFill(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t.cim);return Object(tt.a)(e,St)?_t.fromCIMFill(t,e,this._tileInfo):this._fillError}async _createCIMLine(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t.cim);return Object(tt.a)(e,St)?vt.fromCIMLine(t,e,this._tileInfo):this._lineError}async _createCIMMarker(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t.cim);return Object(tt.a)(e,St)?Ot.a.fromCIMMarker(t,e,this._tileInfo):this._markerError}async _createCIM(t){const e=t.templateHash;if(this._cimTemplateCache.has(e))return this._cimTemplateCache.get(e);const i={...t,cim:{...t.cim,mosaicHash:t.materialHash}};let s;switch(i.type){case"marker":s=this._createCIMMarker(i);break;case"line":s=this._createCIMLine(i);break;case"fill":s=this._createCIMFill(i);break;case"text":s=this._createCIMText(i)}return s.then(t=>this._cimTemplateCache.set(e,t)),s}_createDynamicCIM(t){const e=t.templateHash;if(this._cimTemplateCache.has(e))return this._cimTemplateCache.get(e);let i;switch(t.type){case"marker":i=ft.fromCIMMarker(t,this._tileInfo);break;case"line":i=at.fromCIMLine(t,this._tileInfo);break;case"fill":i=et.fromCIMFill(t,this._tileInfo);break;case"text":i=xt.fromCIMText(t,this._tileInfo)}return this._cimTemplateCache.set(e,i),i}_createPrimitiveMeshTemplates(t,e,i){switch(e.type){case"esriSMS":return It(t,this._createSMS(e));case"esriPMS":return It(t,this._createPMS(e));case"esriSFS":return It(t,this._createSFS(e,i));case"line-marker":return It(t,this._createLMS(e));case"esriPFS":return It(t,this._createPFS(e,i));case"esriSLS":return It(t,this._createSLS(e,!1));case"esriTS":return It(t,this._createTS(e));default:return St.error("Unable to create mesh template for unknown symbol type {: $ }{symbol.type}"),t}}_createMeshTemplates(t,e,i){if(-1!==e.type.indexOf("3d"))return St.error("3D symbols are not supported with MapView"),t;if("expanded-cim"===e.type){for(const i of e.layers)"function"==typeof i.materialHash?t.push(this._createDynamicCIM(i)):It(t,this._createCIM(i));return t}if("composite-symbol"===e.type){for(const s of e.layers)this._createPrimitiveMeshTemplates(t,s,i);return t}return"cim"===e.type||"label"===e.type||"web-style"===e.type?t:this._createPrimitiveMeshTemplates(t,e,i)}}},583:function(t,e,i){"use strict";i.d(e,"a",(function(){return g}));var s=i(76),r=i(327),n=i(29),a=i(300),o=i(550),c=i(536),l=i(576),h=i(49);class u{constructor(t,e,i,s){this.center=Object(a.b)(t,e),this.centerT=Object(a.a)(),this.halfWidth=i/2,this.halfHeight=s/2,this.width=i,this.height=s}get x(){return this.center[0]}get y(){return this.center[1]}get blX(){return this.center[0]+this.halfWidth}get blY(){return this.center[1]+this.halfHeight}get trX(){return this.center[0]-this.halfWidth}get trY(){return this.center[1]-this.halfHeight}get xmin(){return this.x-this.halfWidth}get xmax(){return this.x+this.halfWidth}get ymin(){return this.y-this.halfHeight}get ymax(){return this.y+this.halfHeight}set x(t){this.center[0]=t}set y(t){this.center[1]=t}clone(){return new u(this.x,this.y,this.width,this.height)}serialize(t){return t.writeF32(this.center[0]),t.writeF32(this.center[1]),t.push(this.width),t.push(this.height),t}findCollisionDelta(t,e=4){const i=Math.abs(t.centerT[0]-this.centerT[0]),s=Math.abs(t.centerT[1]-this.centerT[1]),r=(t.halfWidth+this.halfWidth+e)/i,n=(t.halfHeight+this.halfHeight+e)/s,a=Math.min(r,n);return Object(h.j)(a)}extend(t){const e=Math.min(this.xmin,t.xmin),i=Math.min(this.ymin,t.ymin),s=Math.max(this.xmax,t.xmax)-e,r=Math.max(this.ymax,t.ymax)-i,n=e+s/2,a=i+r/2;this.width=s,this.height=r,this.halfWidth=s/2,this.halfHeight=r/2,this.x=n,this.y=a}static deserialize(t){const e=t.readF32(),i=t.readF32(),s=t.readInt32(),r=t.readInt32();return new u(e,i,s,r)}}const d=Math.PI/180;class f{constructor(t,e,i,s){this._rotationT=Object(r.a)(),this._xBounds=0,this._yBounds=0,this.minZoom=0,this.maxZoom=255,this._bounds=null;const n=i.rect,a=new Float32Array(8);t*=s,e*=s;const o=i.code?n.width*s:i.metrics.width,c=i.code?n.height*s:i.metrics.height;a[0]=t,a[1]=e,a[2]=t+o,a[3]=e,a[4]=t,a[5]=e+c,a[6]=t+o,a[7]=e+c,this._data=a,this._setTextureCoords(n),this._scale=s,this._mosaic=i,this.x=t,this.y=e,this.maxOffset=Math.max(t+o,e+c)}get width(){return this._mosaic.metrics.width*this._scale}get mosaic(){return this._mosaic}set angle(t){this._angle=t,Object(s.d)(this._rotationT),Object(s.f)(this._rotationT,this._rotationT,-t),this._setOffsets(this._data)}get angle(){return this._angle}get xTopLeft(){return this._data[0]}get yTopLeft(){return this._data[1]}get xBottomRight(){return this._data[6]}get yBottomRight(){return this._data[7]}get texcoords(){return this._texcoords}get textureBinding(){return this._mosaic.textureBinding}get offsets(){return this._offsets||this._setOffsets(this._data),this._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const{height:t,width:e}=this._mosaic.metrics,i=e*this._scale,n=Math.abs(t)*this._scale,a=new Float32Array(8);a[0]=this.x,a[1]=this.y,a[2]=this.x+i,a[3]=this.y,a[4]=this.x,a[5]=this.y+n,a[6]=this.x+i,a[7]=this.y+n;const o=Object(s.e)(Object(r.a)(),this._rotationT,this._T);Object(r.b)(a,a,o);let c=1/0,l=1/0,h=0,d=0;for(let s=0;s<4;s++){const t=a[2*s],e=a[2*s+1];c=Math.min(c,t),l=Math.min(l,e),h=Math.max(h,t),d=Math.max(d,e)}const f=h-c,p=d-l,m=c+f/2,y=l+p/2;this._bounds=new u(m,y,f,p)}return this._bounds}setTransform(t){this._T=t,this._offsets=null}_setOffsets(t){this._offsets||(this._offsets={upperLeft:0,upperRight:0,lowerLeft:0,lowerRight:0});const e=this._offsets,i=new Float32Array(8),n=Object(s.e)(Object(r.a)(),this._rotationT,this._T);Object(r.b)(i,t,n),e.upperLeft=Object(c.a)(8*i[0],8*i[1]),e.upperRight=Object(c.a)(8*i[2],8*i[3]),e.lowerLeft=Object(c.a)(8*i[4],8*i[5]),e.lowerRight=Object(c.a)(8*i[6],8*i[7])}_setTextureCoords({x:t,y:e,width:i,height:s}){this._texcoords={upperLeft:Object(c.a)(t,e),upperRight:Object(c.a)(t+i,e),lowerLeft:Object(c.a)(t,e+s),lowerRight:Object(c.a)(t+i,e+s)}}}const p=(t,e)=>({code:0,page:0,sdf:!0,rect:new l.a(0,0,11,8),textureBinding:e,metrics:{advance:0,height:4,width:t,left:0,top:0}});class m{constructor(t,e,i){this._rotation=0,this._decorate(t,e,i),this.glyphs=t,this.bounds=this._createBounds(t),this.isMultiline=e.length>1,this._hasRotation=0!==i.angle,this._T=this._createGlyphTransform(this.bounds,i);for(const s of t)s.setTransform(this._T)}setRotation(t){if(0===t&&0===this._rotation)return;this._rotation=t;const e=this._T,i=Object(s.b)(Object(r.a)(),t);Object(s.e)(e,i,e);for(const s of this.glyphs)s.setTransform(this._T)}_decorate(t,e,i){if(!i.decoration||"none"===i.decoration||!t.length)return;const s=i.scale,r="underline"===i.decoration?30:20,n=t[0].textureBinding;for(const a of e){const e=a.startX*s,i=a.startY*s,o=(a.width+a.glyphWidthEnd)*s;t.push(new f(e,i+r*s,p(o,n),1))}}get boundsT(){const t=this.bounds,e=Object(n.m)(Object(a.a)(),t.x,t.y);if(Object(n.n)(e,e,this._T),this._hasRotation){const i=Math.max(t.width,t.height);return new u(e[0],e[1],i,i)}return new u(e[0],e[1],t.width,t.height)}_createBounds(t){let e=1/0,i=1/0,s=0,r=0;for(const o of t)e=Math.min(e,o.xTopLeft),i=Math.min(i,o.yTopLeft),s=Math.max(s,o.xTopLeft+o.width),r=Math.max(r,o.yBottomRight);const n=s-e,a=r-i;return new u(e+n/2,i+a/2,n,a)}_createGlyphTransform(t,e){const i=d*e.angle,o=Object(r.a)(),c=Object(a.a)();return Object(s.h)(o,o,Object(n.m)(c,e.xOffset,-e.yOffset)),e.isCIM?Object(s.f)(o,o,i):(Object(s.h)(o,o,Object(n.m)(c,t.x,t.y)),Object(s.f)(o,o,i),Object(s.h)(o,o,Object(n.m)(c,-t.x,-t.y))),o}}class y{constructor(t,e,i,s,r,n){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(e,i)),this.end=Math.max(0,Math.max(e,i)),this.end<t.length&&(this.glyphWidthEnd=t[this.end].metrics.width),this.width=s,this.yMin=r,this.yMax=n}}const x=t=>10===t,_=t=>32===t;function g(t,e,i){const s=i.scale,r=new Array,n=function(t,e,i){const s=new Array,r=1/i.scale,n=i.maxLineWidth*r,a=e?t.length-1:0,o=e?-1:t.length,c=e?-1:1;let l=a,h=0,u=0,d=l,f=d,p=0,m=1/0,g=0;for(;l!==o;){const{code:e,metrics:i}=t[l],r=Math.abs(i.top);if(x(e)||_(e)||(m=Math.min(m,r),g=Math.max(g,r+i.height)),x(e))l!==a&&(s.push(new y(t,d,l-c,h,m,g)),m=1/0,g=0),h=0,d=l+c,f=l+c,u=0;else if(_(e))f=l+c,u=0,p=i.advance,h+=i.advance;else if(h>n){if(f!==d){const e=f-2*c;h-=p,s.push(new y(t,d,e,h-u,m,g)),m=1/0,g=0,d=f,h=u}else s.push(new y(t,d,l-c,h,m,g)),m=1/0,g=0,d=l,f=l,h=0;h+=i.advance,u+=i.advance}else h+=i.advance,u+=i.advance;l+=c}const b=new y(t,d,l-c,h,m,g);return b.start>=0&&b.end<t.length&&s.push(b),s}(t,e,i),a=function(t,e){let i=0;for(let n=0;n<t.length;n++){const{width:e}=t[n];i=Math.max(e,i)}const s="underline"===e.decoration?4:0,r=t[0].yMin;return{x:0,y:r,height:t[t.length-1].yMax+e.lineHeight*(t.length-1)+s-r,width:i}}(n,i),{vAlign:c,hAlign:l}=i,h=c===o.a.Baseline?1:0,u=h?0:c-1,d=(1-h)*-a.y+u*(a.height/2)+-26*(h?1:0);for(let o=0;o<n.length;o++){const{start:e,end:a,width:c}=n[o];let h=-1*(l+1)*(c/2)-3;const u=o*i.lineHeight+d-3;n[o].startX=h,n[o].startY=u;for(let i=e;i<=a;i++){const e=t[i];if(x(e.code))continue;const n=new f(h+e.metrics.left,u-e.metrics.top,e,s);h+=e.metrics.advance,r.push(n)}}return new m(r,n,i)}},584:function(t,e,i){"use strict";i.d(e,"a",(function(){return h}));i(41);var s=i(304),r=i(534),n=i(537);const a={marker:r.d.MARKER,fill:r.d.FILL,line:r.d.LINE,text:r.d.TEXT};class o{constructor(t,e,i,s){const r={minScale:null==e?void 0:e.minScale,maxScale:null==e?void 0:e.maxScale},o=function(t){return t.minScale||t.maxScale?t.minScale+"-"+t.maxScale:""}(r);this.layers=t,this.data=e,this.hash=this._createHash()+o,this.rendererKey=i;for(const c of t){const t=a[c.type];c.materialKey=Object(n.g)(t,this.rendererKey,!1,!1),c.maxVVSize=s,c.scaleInfo=r,c.templateHash+=o}}get type(){return"expanded-cim"}_createHash(){let t="";for(const e of this.layers)t+=e.templateHash;return t}}var c=i(105);const l=async(t,e)=>new o(await Object(s.b)(t.data,e),t.data,t.rendererKey,t.maxVVSize),h=async(t,e,i)=>{if(!t)return null;if("cim"===t.type)return l(t,e);if("web-style"===t.type){const s=c.a.fromJSON(t),r={type:"cim",data:(await s.fetchCIMSymbol(i)).data,rendererKey:t.rendererKey,maxVVSize:t.maxVVSize};return l(r,e)}return t}},586:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));class s{constructor(t,e){this.x=t,this.y=e}clone(){return new s(this.x,this.y)}equals(t,e){return t===this.x&&e===this.y}isEqual(t){return t.x===this.x&&t.y===this.y}setCoords(t,e){this.x=t,this.y=e}normalize(){const t=this.x,e=this.y,i=Math.sqrt(t*t+e*e);this.x/=i,this.y/=i}rightPerpendicular(){const t=this.x;this.x=this.y,this.y=-t}move(t,e){this.x+=t,this.y+=e}assign(t){this.x=t.x,this.y=t.y}assignAdd(t,e){this.x=t.x+e.x,this.y=t.y+e.y}assignSub(t,e){this.x=t.x-e.x,this.y=t.y-e.y}rotate(t,e){const i=this.x,s=this.y;this.x=i*t-s*e,this.y=i*e+s*t}scale(t){this.x*=t,this.y*=t}length(){const t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}static distance(t,e){const i=e.x-t.x,s=e.y-t.y;return Math.sqrt(i*i+s*s)}static add(t,e){return new s(t.x+e.x,t.y+e.y)}static sub(t,e){return new s(t.x-e.x,t.y-e.y)}}},587:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));const s={convertToGEGeometry:function(t,e){return null==e?null:t.convertJSONToGeometry(e)},exportPoint:function(t,e,i){const s=new r(t.getPointX(e),t.getPointY(e),i),n=t.hasZ(e),a=t.hasM(e);return n&&(s.z=t.getPointZ(e)),a&&(s.m=t.getPointM(e)),s},exportPolygon:function(t,e,i){return new n(t.exportPaths(e),i,t.hasZ(e),t.hasM(e))},exportPolyline:function(t,e,i){return new a(t.exportPaths(e),i,t.hasZ(e),t.hasM(e))},exportMultipoint:function(t,e,i){return new o(t.exportPoints(e),i,t.hasZ(e),t.hasM(e))},exportExtent:function(t,e,i){const s=t.hasZ(e),r=t.hasM(e),n=new c(t.getXMin(e),t.getYMin(e),t.getXMax(e),t.getYMax(e),i);if(s){const i=t.getZExtent(e);n.zmin=i.vmin,n.zmax=i.vmax}if(r){const i=t.getMExtent(e);n.mmin=i.vmin,n.mmax=i.vmax}return n}};class r{constructor(t,e,i){this.x=t,this.y=e,this.spatialReference=i,this.z=void 0,this.m=void 0}}class n{constructor(t,e,i,s){this.rings=t,this.spatialReference=e,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),s&&(this.hasM=s)}}class a{constructor(t,e,i,s){this.paths=t,this.spatialReference=e,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),s&&(this.hasM=s)}}class o{constructor(t,e,i,s){this.points=t,this.spatialReference=e,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),s&&(this.hasM=s)}}class c{constructor(t,e,i,s,r){this.xmin=t,this.ymin=e,this.xmax=i,this.ymax=s,this.spatialReference=r,this.zmin=void 0,this.zmax=void 0,this.mmin=void 0,this.mmax=void 0}}},588:function(t,e,i){"use strict";i.d(e,"a",(function(){return o}));var s=i(3),r=i(299),n=i(142),a=i(562);class o extends a.a{constructor(t,e,i){super(t),this._featureIndex=-1,this._dateFields=new Set,this._geometryType=i,this._features=e}static fromFeatures(t,e,i){const s=Object(r.c)([],t,e,!1,!1,i);for(let r=0;r<s.length;r++)s[r].displayId=t[r].displayId;return o.fromOptimizedFeatures(s,e)}static fromFeatureSet(t,e){const i=Object(r.b)(t,e);return o.fromOptimizedFeatureSet(i)}static fromOptimizedFeatureSet(t){const{features:e,geometryType:i}=t,s=o.fromOptimizedFeatures(e,i);s._exceededTransferLimit=t.exceededTransferLimit,s._transform=t.transform;for(const r of t.fields)"esriFieldTypeDate"===r.type&&s._dateFields.add(r.name);return s}static fromOptimizedFeatures(t,e,i){const s=a.a.createInstance(),r=new o(s,t,e);return r._transform=i,r}get _current(){return this._features[this._featureIndex]}get geometryType(){return this._geometryType}get hasFeatures(){return!!this._features.length}get hasNext(){return this._featureIndex+1<this._features.length}get exceededTransferLimit(){return this._exceededTransferLimit}get hasZ(){return!1}get hasM(){return!1}removeIds(t){const e=new Set(t);this._features=this._features.filter(t=>!e.has(t.objectId))}append(t){for(const e of t)this._features.push(e)}getSize(){return this._features.length}getCursor(){return this.copy()}getQuantizationTransform(){return this._transform}getAttributeHash(){let t="";for(const e in this._current.attributes)t+=this._current.attributes[e];return t}getIndex(){return this._featureIndex}setIndex(t){this._featureIndex=t}getObjectId(){return this._current.objectId}getDisplayId(){return this._current.displayId}setDisplayId(t){this._current.displayId=t}getGroupId(){return this._current.groupId}setGroupId(t){this._current.groupId=t}copy(){const t=new o(this.instance,this._features,this.geometryType);return this.copyInto(t),t}next(){for(;++this._featureIndex<this._features.length&&!this._getExists(););return this._featureIndex<this._features.length}readLegacyFeature(){return Object(r.i)(this._current,this.geometryType,this.hasZ,this.hasM)}readOptimizedFeature(){return this._current}readLegacyPointGeometry(){return this.readGeometry()?{x:this.getX(),y:this.getY()}:null}readLegacyGeometry(){const t=this.readGeometry();return Object(r.k)(t,this.geometryType,this.hasZ,this.hasM)}readLegacyCentroid(){const t=this.readCentroid();return Object(s.i)(t)?null:{x:t.coords[0]*this._sx+this._tx,y:t.coords[1]*this._sy+this._ty}}readGeometryArea(){return Object(n.c)(this._current)?Object(r.s)(this._current.geometry,2):0}readUnquantizedGeometry(){const t=this.readGeometry();if("esriGeometryPoint"===this.geometryType||!t)return t;const e=t.clone();return function({coords:t,lengths:e}){let i=0;for(const s of e){for(let e=1;e<s;e++)t[2*(i+e)]+=t[2*(i+e)-2],t[2*(i+e)+1]+=t[2*(i+e)-1];i+=s}}(e),e}readHydratedGeometry(){const t=this._current.geometry;if(Object(s.i)(t))return null;const e=t.clone();return Object(s.j)(this._transform)&&Object(r.z)(e,e,this.hasZ,this.hasM,this._transform),e}getXHydrated(){if(!Object(n.c)(this._current))return 0;const t=this._current.geometry.coords[0],e=this.getQuantizationTransform();return Object(s.i)(e)?t:t*e.scale[0]+e.translate[0]}getYHydrated(){if(!Object(n.c)(this._current))return 0;const t=this._current.geometry.coords[1],e=this.getQuantizationTransform();return Object(s.i)(e)?t:e.translate[1]-t*e.scale[1]}getX(){return Object(n.c)(this._current)?this._current.geometry.coords[0]*this._sx+this._tx:0}getY(){return Object(n.c)(this._current)?this._current.geometry.coords[1]*this._sy+this._ty:0}readGeometry(){if(!Object(n.c)(this._current))return null;const t=this._current.geometry.clone();if(t.isPoint)return t.coords[0]=t.coords[0]*this._sx+this._tx,t.coords[1]=t.coords[1]*this._sy+this._ty,t;let e=0;for(const i of t.lengths)t.coords[2*e]=t.coords[2*e]*this._sx+this._tx,t.coords[2*e+1]=t.coords[2*e+1]*this._sy+this._ty,e+=i;return t}readCentroid(){if(!Object(n.c)(this._current))return null;if(!this._current.centroid){const t=this._computeCentroid();if(!t)return null;t.coords[0]=(t.coords[0]-this._tx)/this._sx,t.coords[1]=(t.coords[1]-this._ty)/this._sy,this._current.centroid=t}const t=this._current.centroid.clone();return t.coords[0]=t.coords[0]*this._sx+this._tx,t.coords[1]=t.coords[1]*this._sx+this._ty,t}_readAttribute(t,e){const i=this._current.attributes[t];if(void 0!==i)return null!=i&&e&&this._dateFields.has(t)?new Date(i):i;const s=this.readAttributes(),r=t.toLocaleLowerCase().trim();for(const n in s)if(n.toLocaleLowerCase().trim()===r){const t=this._current.attributes[n];return null!=t&&e&&this._dateFields.has(n)?new Date(t):t}}copyInto(t){super.copyInto(t),t._featureIndex=this._featureIndex,t._transform=this._transform,t._dateFields=this._dateFields}_readAttributes(){return this._current.attributes}}},591:function(t,e,i){"use strict";i.d(e,"a",(function(){return f})),i.d(e,"b",(function(){return s}));const s={Base64:0,Hex:1,String:2,Raw:3};function r(t,e){const i=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(i>>16)<<16|65535&i}function n(t){const e=[];for(let i=0,s=8*t.length;i<s;i+=8)e[i>>5]|=(255&t.charCodeAt(i/8))<<i%32;return e}function a(t){const e=[];for(let i=0,s=32*t.length;i<s;i+=8)e.push(String.fromCharCode(t[i>>5]>>>i%32&255));return e.join("")}function o(t,e,i,s,n,a){return r(function(t,e){return t<<e|t>>>32-e}(r(r(e,t),r(s,a)),n),i)}function c(t,e,i,s,r,n,a){return o(e&i|~e&s,t,e,r,n,a)}function l(t,e,i,s,r,n,a){return o(e&s|i&~s,t,e,r,n,a)}function h(t,e,i,s,r,n,a){return o(e^i^s,t,e,r,n,a)}function u(t,e,i,s,r,n,a){return o(i^(e|~s),t,e,r,n,a)}function d(t,e){t[e>>5]|=128<<e%32,t[14+(e+64>>>9<<4)]=e;let i=1732584193,s=-271733879,n=-1732584194,a=271733878;for(let o=0;o<t.length;o+=16){const e=i,d=s,f=n,p=a;i=c(i,s,n,a,t[o+0],7,-680876936),a=c(a,i,s,n,t[o+1],12,-389564586),n=c(n,a,i,s,t[o+2],17,606105819),s=c(s,n,a,i,t[o+3],22,-1044525330),i=c(i,s,n,a,t[o+4],7,-176418897),a=c(a,i,s,n,t[o+5],12,1200080426),n=c(n,a,i,s,t[o+6],17,-1473231341),s=c(s,n,a,i,t[o+7],22,-45705983),i=c(i,s,n,a,t[o+8],7,1770035416),a=c(a,i,s,n,t[o+9],12,-1958414417),n=c(n,a,i,s,t[o+10],17,-42063),s=c(s,n,a,i,t[o+11],22,-1990404162),i=c(i,s,n,a,t[o+12],7,1804603682),a=c(a,i,s,n,t[o+13],12,-40341101),n=c(n,a,i,s,t[o+14],17,-1502002290),s=c(s,n,a,i,t[o+15],22,1236535329),i=l(i,s,n,a,t[o+1],5,-165796510),a=l(a,i,s,n,t[o+6],9,-1069501632),n=l(n,a,i,s,t[o+11],14,643717713),s=l(s,n,a,i,t[o+0],20,-373897302),i=l(i,s,n,a,t[o+5],5,-701558691),a=l(a,i,s,n,t[o+10],9,38016083),n=l(n,a,i,s,t[o+15],14,-660478335),s=l(s,n,a,i,t[o+4],20,-405537848),i=l(i,s,n,a,t[o+9],5,568446438),a=l(a,i,s,n,t[o+14],9,-1019803690),n=l(n,a,i,s,t[o+3],14,-187363961),s=l(s,n,a,i,t[o+8],20,1163531501),i=l(i,s,n,a,t[o+13],5,-1444681467),a=l(a,i,s,n,t[o+2],9,-51403784),n=l(n,a,i,s,t[o+7],14,1735328473),s=l(s,n,a,i,t[o+12],20,-1926607734),i=h(i,s,n,a,t[o+5],4,-378558),a=h(a,i,s,n,t[o+8],11,-2022574463),n=h(n,a,i,s,t[o+11],16,1839030562),s=h(s,n,a,i,t[o+14],23,-35309556),i=h(i,s,n,a,t[o+1],4,-1530992060),a=h(a,i,s,n,t[o+4],11,1272893353),n=h(n,a,i,s,t[o+7],16,-155497632),s=h(s,n,a,i,t[o+10],23,-1094730640),i=h(i,s,n,a,t[o+13],4,681279174),a=h(a,i,s,n,t[o+0],11,-358537222),n=h(n,a,i,s,t[o+3],16,-722521979),s=h(s,n,a,i,t[o+6],23,76029189),i=h(i,s,n,a,t[o+9],4,-640364487),a=h(a,i,s,n,t[o+12],11,-421815835),n=h(n,a,i,s,t[o+15],16,530742520),s=h(s,n,a,i,t[o+2],23,-995338651),i=u(i,s,n,a,t[o+0],6,-198630844),a=u(a,i,s,n,t[o+7],10,1126891415),n=u(n,a,i,s,t[o+14],15,-1416354905),s=u(s,n,a,i,t[o+5],21,-57434055),i=u(i,s,n,a,t[o+12],6,1700485571),a=u(a,i,s,n,t[o+3],10,-1894986606),n=u(n,a,i,s,t[o+10],15,-1051523),s=u(s,n,a,i,t[o+1],21,-2054922799),i=u(i,s,n,a,t[o+8],6,1873313359),a=u(a,i,s,n,t[o+15],10,-30611744),n=u(n,a,i,s,t[o+6],15,-1560198380),s=u(s,n,a,i,t[o+13],21,1309151649),i=u(i,s,n,a,t[o+4],6,-145523070),a=u(a,i,s,n,t[o+11],10,-1120210379),n=u(n,a,i,s,t[o+2],15,718787259),s=u(s,n,a,i,t[o+9],21,-343485551),i=r(i,e),s=r(s,d),n=r(n,f),a=r(a,p)}return[i,s,n,a]}function f(t,e=s.Hex){const i=e||s.Base64,r=d(n(t),8*t.length);switch(i){case s.Raw:return r;case s.Hex:return function(t){const e="0123456789abcdef",i=[];for(let s=0,r=4*t.length;s<r;s++)i.push(e.charAt(t[s>>2]>>s%4*8+4&15)+e.charAt(t[s>>2]>>s%4*8&15));return i.join("")}(r);case s.String:return a(r);case s.Base64:return function(t){const e=[];for(let i=0,s=4*t.length;i<s;i+=3){const s=(t[i>>2]>>i%4*8&255)<<16|(t[i+1>>2]>>(i+1)%4*8&255)<<8|t[i+2>>2]>>(i+2)%4*8&255;for(let r=0;r<4;r++)8*i+6*r>32*t.length?e.push("="):e.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(s>>6*(3-r)&63))}return e.join("")}(r)}}},593:function(t,e,i){"use strict";i.d(e,"a",(function(){return f})),i.d(e,"b",(function(){return l}));var s=i(3),r=i(18),n=i(540),a=i(533),o=i(534),c=i(568);function l(t,e){if(!t||!e)return t;switch(e){case"radius":case"distance":return 2*t;case"diameter":case"width":return t;case"area":return Math.sqrt(t)}return t}function h(t){return t.map(t=>function(t){return{value:t.value,size:Object(r.e)(t.size)}}(t))}function u(t){if("string"==typeof t||"number"==typeof t)return Object(r.e)(t);const e=t;return{type:"size",expression:e.expression,stops:h(e.stops)}}const d=t=>{const e=[],i=[],s=h(t),n=s.length;for(let o=0;o<6;o++){const t=s[Math.min(o,n-1)];e.push(t.value),i.push(null==t.size?a.m:Object(r.c)(t.size))}return{values:new Float32Array(e),sizes:new Float32Array(i)}};function f(t){const e=t&&t.length>0?{}:null,i=e?{}:null;if(!e)return{vvFields:e,vvRanges:i};for(const s of t)if(s.field&&(e[s.type]=s.field),"size"===s.type){i.size||(i.size={});const t=s;switch(Object(c.a)(t)){case o.e.SIZE_MINMAX_VALUE:i.size.minMaxValue={minDataValue:t.minDataValue,maxDataValue:t.maxDataValue,minSize:u(t.minSize),maxSize:u(t.maxSize)};break;case o.e.SIZE_SCALE_STOPS:i.size.scaleStops={stops:h(t.stops)};break;case o.e.SIZE_FIELD_STOPS:if(t.levels){const e={};for(const i in t.levels)e[i]=d(t.levels[i]);i.size.fieldStops={type:"level-dependent",levels:e}}else i.size.fieldStops={type:"static",...d(t.stops)};break;case o.e.SIZE_UNIT_VALUE:i.size.unitValue={unit:t.valueUnit,valueRepresentation:t.valueRepresentation}}}else if("color"===s.type)i.color=y(s);else if("opacity"===s.type)i.opacity=p(s);else if("rotation"===s.type){const t=s;i.rotation={type:t.rotationType}}return{vvFields:e,vvRanges:i}}function p(t){const e={values:[0,0,0,0,0,0,0,0],opacities:[0,0,0,0,0,0,0,0]};if("string"==typeof t.field){if(!t.stops)return null;{if(t.stops.length>8)return null;const i=t.stops;for(let t=0;t<8;++t){const s=i[Math.min(t,i.length-1)];e.values[t]=s.value,e.opacities[t]=s.opacity}}}else{if(!(t.stops&&t.stops.length>=0))return null;{const i=t.stops&&t.stops.length>=0&&t.stops[0].opacity;for(let t=0;t<8;t++)e.values[t]=1/0,e.opacities[t]=i}}return e}function m(t,e,i){t[4*e+0]=i.r/255,t[4*e+1]=i.g/255,t[4*e+2]=i.b/255,t[4*e+3]=i.a}function y(t){if(Object(s.i)(t))return null;if(t.normalizationField)return null;const e={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]};if("string"==typeof t.field){if(!t.stops)return null;{if(t.stops.length>8)return null;e.field=t.field;const i=t.stops;for(let t=0;t<8;++t){const s=i[Math.min(t,i.length-1)];e.values[t]=s.value,m(e.colors,t,s.color)}}}else{if(!(t.stops&&t.stops.length>=0))return null;{const i=t.stops&&t.stops.length>=0&&t.stops[0].color;for(let t=0;t<8;t++)e.values[t]=1/0,m(e.colors,t,i)}}for(let i=0;i<32;i+=4)Object(n.b)(e.colors,i,!0);return e}},594:function(t,e,i){"use strict";i.d(e,"a",(function(){return p}));var s=i(533);function r(t,e){return t.x===e.x&&t.y===e.y}function n(t){if(!t)return;const e=t.length;if(e<=1)return;let i=0;for(let s=1;s<e;s++)r(t[s],t[i])||++i===s||(t[i]=t[s]);t.length=i+1}function a(t,e){return t.x=e.y,t.y=-e.x,t}function o(t,e){return t.x=-e.y,t.y=e.x,t}function c(t,e){return t.x=e.x,t.y=e.y,t}function l(t,e){return t.x=-e.x,t.y=-e.y,t}function h(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function u(t,e){return t.x*e.y-t.y*e.x}function d(t,e){return t.x*e.x+t.y*e.y}function f(t,e,i,s){return t.x=e.x*i+e.y*s,t.y=e.x*s-e.y*i,t}class p{constructor(t,e,i){this.writeVertex=t,this.writeTriangle=e,this.canUseThinTessellation=i,this.prevNormal={x:void 0,y:void 0},this.nextNormal={x:void 0,y:void 0},this.textureNormalLeft={x:0,y:1},this.textureNormalRight={x:0,y:-1},this.textureNormal={x:void 0,y:void 0},this.joinNormal={x:void 0,y:void 0},this.inner={x:void 0,y:void 0},this.outer={x:void 0,y:void 0},this.roundStart={x:void 0,y:void 0},this.roundEnd={x:void 0,y:void 0},this.startBreak={x:void 0,y:void 0},this.endBreak={x:void 0,y:void 0},this.innerPrev={x:void 0,y:void 0},this.innerNext={x:void 0,y:void 0},this.bevelStart={x:void 0,y:void 0},this.bevelEnd={x:void 0,y:void 0},this.bevelMiddle={x:void 0,y:void 0}}tessellate(t,e){n(t),this.canUseThinTessellation&&e.halfWidth<s.C&&!e.offset?this.tessellateThin_(t,e):this.tessellate_(t,e)}tessellateThin_(t,e){if(t.length<2)return;const i=e.wrapDistance||65535;let s=e.initialDistance||0,r=!1,n=t[0].x,a=t[0].y;const o=t.length;for(let c=1;c<o;++c){r&&(r=!1,s=0);let e=t[c].x,o=t[c].y,l=e-n,h=o-a,u=Math.sqrt(l*l+h*h);if(l/=u,h/=u,s+u>i){r=!0;const t=(i-s)/u;u=i-s,e=(1-t)*n+t*e,o=(1-t)*a+t*o,--c}const d=this.writeVertex(n,a,0,0,l,h,h,-l,0,-1,s),f=this.writeVertex(n,a,0,0,l,h,-h,l,0,1,s);s+=u;const p=this.writeVertex(e,o,0,0,l,h,h,-l,0,-1,s),m=this.writeVertex(e,o,0,0,l,h,-h,l,0,1,s);this.writeTriangle(d,f,p),this.writeTriangle(f,p,m),n=e,a=o}}tessellate_(t,e){const i=t[0],s=t[t.length-1],n=r(i,s),p=n?3:2;if(t.length<p)return;const m=e.pixelCoordRatio,y=null!=e.capType?e.capType:0,x=null!=e.joinType?e.joinType:2,_=null!=e.miterLimit?Math.min(e.miterLimit,4):2,g=null!=e.roundLimit?Math.min(e.roundLimit,1.05):1.05,b=null!=e.halfWidth?e.halfWidth:2,v=!!e.textured;let O,j,w=null,T=null;const S=this.prevNormal,M=this.nextNormal;let I=-1,R=-1;const L=this.joinNormal;let C,z;const E=this.textureNormalLeft,F=this.textureNormalRight,D=this.textureNormal;let A=-1,P=-1;const B=e.wrapDistance||65535;let k=e.initialDistance||0;const V=this.writeVertex,N=this.writeTriangle,U=function(t,e,i,s,r,n){const a=V(O,j,C,z,i,s,t,e,r,n,k);return A>=0&&P>=0&&a>=0&&N(A,P,a),A=P,P=a,a};n&&(w=t[t.length-2],M.x=s.x-w.x,M.y=s.y-w.y,R=h(M),M.x/=R,M.y/=R);let G=!1;for(let r=0;r<t.length;++r){if(G&&(G=!1,k=0),w&&(S.x=-M.x,S.y=-M.y,I=R,k+I>B&&(G=!0)),G){const e=(B-k)/I;I=B-k,w={x:(1-e)*w.x+e*t[r].x,y:(1-e)*w.y+e*t[r].y},--r}else w=t[r];O=w.x,j=w.y;const e=r<=0&&!G,i=r===t.length-1;if(e||(k+=I),T=i?n?t[1]:null:t[r+1],T?(M.x=T.x-O,M.y=T.y-j,R=h(M),M.x/=R,M.y/=R):(M.x=void 0,M.y=void 0),!n){if(e){o(L,M),C=L.x,z=L.y,2===y&&(U(-M.y-M.x,M.x-M.y,M.x,M.y,0,-1),U(M.y-M.x,-M.x-M.y,M.x,M.y,0,1)),1===y&&(U(-M.y-M.x,M.x-M.y,M.x,M.y,-1,-1),U(M.y-M.x,-M.x-M.y,M.x,M.y,-1,1)),1!==y&&0!==y||(U(-M.y,M.x,M.x,M.y,0,-1),U(M.y,-M.x,M.x,M.y,0,1));continue}if(i){a(L,S),C=L.x,z=L.y,1!==y&&0!==y||(U(S.y,-S.x,-S.x,-S.y,0,-1),U(-S.y,S.x,-S.x,-S.y,0,1)),2===y&&(U(S.y-S.x,-S.x-S.y,-S.x,-S.y,0,-1),U(-S.y-S.x,S.x-S.y,-S.x,-S.y,0,1)),1===y&&(U(S.y-S.x,-S.x-S.y,-S.x,-S.y,1,-1),U(-S.y-S.x,S.x-S.y,-S.x,-S.y,1,1));continue}}let s,p,V=-u(S,M);if(Math.abs(V)<.01)d(S,M)>0?(L.x=S.x,L.y=S.y,V=1,s=Number.MAX_VALUE,p=!0):(o(L,M),V=1,s=1,p=!1);else{L.x=(S.x+M.x)/V,L.y=(S.y+M.y)/V,s=h(L);const t=(s-1)*b*m;p=s>4||t>I&&t>R}C=L.x,z=L.y;let N=x;switch(x){case 0:s<1.05&&(N=2);break;case 1:s<g&&(N=2);break;case 2:s>_&&(N=0)}switch(N){case 2:if(U(L.x,L.y,-S.x,-S.y,0,-1),U(-L.x,-L.y,-S.x,-S.y,0,1),i)break;if(v){const t=G?0:k;A=this.writeVertex(O,j,C,z,M.x,M.y,L.x,L.y,0,-1,t),P=this.writeVertex(O,j,C,z,M.x,M.y,-L.x,-L.y,0,1,t)}break;case 0:{const t=V<0;let e,s,r,n;if(t){const t=A;A=P,P=t,e=E,s=F}else e=F,s=E;if(p)r=t?o(this.innerPrev,S):a(this.innerPrev,S),n=t?a(this.innerNext,M):o(this.innerNext,M);else{const e=t?l(this.inner,L):c(this.inner,L);r=e,n=e}const h=t?a(this.bevelStart,S):o(this.bevelStart,S);U(r.x,r.y,-S.x,-S.y,e.x,e.y);const u=U(h.x,h.y,-S.x,-S.y,s.x,s.y);if(i)break;const d=t?o(this.bevelEnd,M):a(this.bevelEnd,M);if(p){const t=this.writeVertex(O,j,C,z,-S.x,-S.y,0,0,0,0,k);A=this.writeVertex(O,j,C,z,M.x,M.y,n.x,n.y,e.x,e.y,k),P=this.writeVertex(O,j,C,z,M.x,M.y,d.x,d.y,s.x,s.y,k),this.writeTriangle(u,t,P)}else{if(v){const t=this.bevelMiddle;t.x=(h.x+d.x)/2,t.y=(h.y+d.y)/2,f(D,t,-S.x,-S.y),U(t.x,t.y,-S.x,-S.y,D.x,D.y),f(D,t,M.x,M.y),A=this.writeVertex(O,j,C,z,M.x,M.y,t.x,t.y,D.x,D.y,k),P=this.writeVertex(O,j,C,z,M.x,M.y,n.x,n.y,e.x,e.y,k)}else{const t=A;A=P,P=t}U(d.x,d.y,M.x,M.y,s.x,s.y)}if(t){const t=A;A=P,P=t}break}case 1:{const t=V<0;let e,r;if(t){const t=A;A=P,P=t,e=E,r=F}else e=F,r=E;const n=t?l(this.inner,L):c(this.inner,L);let h,u;p?(h=t?o(this.innerPrev,S):a(this.innerPrev,S),u=t?a(this.innerNext,M):o(this.innerNext,M)):(h=n,u=n);const m=t?a(this.roundStart,S):o(this.roundStart,S),y=t?o(this.roundEnd,M):a(this.roundEnd,M),x=U(h.x,h.y,-S.x,-S.y,e.x,e.y),_=U(m.x,m.y,-S.x,-S.y,r.x,r.y);if(i)break;const g=this.writeVertex(O,j,C,z,-S.x,-S.y,0,0,0,0,k);p||this.writeTriangle(A,P,g);const b=l(this.outer,n),w=this.writeVertex(O,j,C,z,M.x,M.y,y.x,y.y,r.x,r.y,k);let T,I;const R=s>2;if(R){let e;s!==Number.MAX_VALUE?(b.x/=s,b.y/=s,e=d(S,b),e=(s*(e*e-1)+1)/e):e=-1,T=t?a(this.startBreak,S):o(this.startBreak,S),T.x+=S.x*e,T.y+=S.y*e,I=t?o(this.endBreak,M):a(this.endBreak,M),I.x+=M.x*e,I.y+=M.y*e}f(D,b,-S.x,-S.y);const B=this.writeVertex(O,j,C,z,-S.x,-S.y,b.x,b.y,D.x,D.y,k);f(D,b,M.x,M.y);const N=v?this.writeVertex(O,j,C,z,M.x,M.y,b.x,b.y,D.x,D.y,k):B,G=g,W=v?this.writeVertex(O,j,C,z,M.x,M.y,0,0,0,0,k):g;let q=-1,K=-1;if(R&&(f(D,T,-S.x,-S.y),q=this.writeVertex(O,j,C,z,-S.x,-S.y,T.x,T.y,D.x,D.y,k),f(D,I,M.x,M.y),K=this.writeVertex(O,j,C,z,M.x,M.y,I.x,I.y,D.x,D.y,k)),v?R?(this.writeTriangle(G,_,q),this.writeTriangle(G,q,B),this.writeTriangle(W,N,K),this.writeTriangle(W,K,w)):(this.writeTriangle(G,_,B),this.writeTriangle(W,N,w)):R?(this.writeTriangle(g,_,q),this.writeTriangle(g,q,K),this.writeTriangle(g,K,w)):(this.writeTriangle(g,_,B),this.writeTriangle(g,N,w)),p?(A=this.writeVertex(O,j,C,z,M.x,M.y,u.x,u.y,e.x,e.y,k),P=w):(A=v?this.writeVertex(O,j,C,z,M.x,M.y,u.x,u.y,e.x,e.y,k):x,this.writeTriangle(A,W,w),P=w),t){const t=A;A=P,P=t}break}}}}}},595:function(t,e,i){"use strict";i.d(e,"a",(function(){return c})),i.d(e,"b",(function(){return o}));var s=i(533),r=i(586),n=i(561);class a{constructor(t,e,i){this.ratio=t,this.x=e,this.y=i}}class o{constructor(t,e,i,r=8,n=8){this.lines=[],this.starts=[],this.validateTessellation=!0,this.pixelRatio=r,this.pixelMargin=n,this.tileSize=s.D*r,this.dz=t,this.yPos=e,this.xPos=i}setPixelMargin(t){t!==this.pixelMargin&&(this.pixelMargin=t,this.setExtent(this._extent))}setExtent(t){this._extent=t,this.finalRatio=this.tileSize/t*(1<<this.dz);let e=this.pixelRatio*this.pixelMargin;e/=this.finalRatio;const i=t>>this.dz;e>i&&(e=i),this.margin=e,this.xmin=i*this.xPos-e,this.ymin=i*this.yPos-e,this.xmax=this.xmin+i+2*e,this.ymax=this.ymin+i+2*e}reset(t){this.type=t,this.lines=[],this.starts=[],this.line=null,this.start=0}moveTo(t,e){this._pushLine(),this._prevIsIn=this._isIn(t,e),this._moveTo(t,e,this._prevIsIn),this._prevPt=new r.a(t,e),this._firstPt=new r.a(t,e),this._dist=0}lineTo(t,e){const i=this._isIn(t,e),s=new r.a(t,e),n=r.a.distance(this._prevPt,s);let o,c,l,h,u,d,f,p;if(i)this._prevIsIn?this._lineTo(t,e,!0):(o=this._prevPt,c=s,l=this._intersect(c,o),this.start=this._dist+n*(1-this._r),this._lineTo(l.x,l.y,!0),this._lineTo(c.x,c.y,!0));else if(this._prevIsIn)c=this._prevPt,o=s,l=this._intersect(c,o),this._lineTo(l.x,l.y,!0),this._lineTo(o.x,o.y,!1);else{const t=this._prevPt,e=s;if(t.x<=this.xmin&&e.x<=this.xmin||t.x>=this.xmax&&e.x>=this.xmax||t.y<=this.ymin&&e.y<=this.ymin||t.y>=this.ymax&&e.y>=this.ymax)this._lineTo(e.x,e.y,!1);else{const i=[];if((t.x<this.xmin&&e.x>this.xmin||t.x>this.xmin&&e.x<this.xmin)&&(h=(this.xmin-t.x)/(e.x-t.x),p=t.y+h*(e.y-t.y),p<=this.ymin?d=!1:p>=this.ymax?d=!0:i.push(new a(h,this.xmin,p))),(t.x<this.xmax&&e.x>this.xmax||t.x>this.xmax&&e.x<this.xmax)&&(h=(this.xmax-t.x)/(e.x-t.x),p=t.y+h*(e.y-t.y),p<=this.ymin?d=!1:p>=this.ymax?d=!0:i.push(new a(h,this.xmax,p))),(t.y<this.ymin&&e.y>this.ymin||t.y>this.ymin&&e.y<this.ymin)&&(h=(this.ymin-t.y)/(e.y-t.y),f=t.x+h*(e.x-t.x),f<=this.xmin?u=!1:f>=this.xmax?u=!0:i.push(new a(h,f,this.ymin))),(t.y<this.ymax&&e.y>this.ymax||t.y>this.ymax&&e.y<this.ymax)&&(h=(this.ymax-t.y)/(e.y-t.y),f=t.x+h*(e.x-t.x),f<=this.xmin?u=!1:f>=this.xmax?u=!0:i.push(new a(h,f,this.ymax))),0===i.length)u?d?this._lineTo(this.xmax,this.ymax,!0):this._lineTo(this.xmax,this.ymin,!0):d?this._lineTo(this.xmin,this.ymax,!0):this._lineTo(this.xmin,this.ymin,!0);else if(i.length>1&&i[0].ratio>i[1].ratio)this.start=this._dist+n*i[1].ratio,this._lineTo(i[1].x,i[1].y,!0),this._lineTo(i[0].x,i[0].y,!0);else{this.start=this._dist+n*i[0].ratio;for(let t=0;t<i.length;t++)this._lineTo(i[t].x,i[t].y,!0)}this._lineTo(e.x,e.y,!1)}}this._dist+=n,this._prevIsIn=i,this._prevPt=s}close(){if(this.line.length>2){const t=this._firstPt,e=this._prevPt;t.x===e.x&&t.y===e.y||this.lineTo(t.x,t.y);const i=this.line;let s=i.length;for(;s>=4&&(i[0].x===i[1].x&&i[0].x===i[s-2].x||i[0].y===i[1].y&&i[0].y===i[s-2].y);)i.pop(),i[0].x=i[s-2].x,i[0].y=i[s-2].y,--s}}result(t=!0){return this._pushLine(),0===this.lines.length?null:(3===this.type&&t&&l.simplify(this.tileSize,this.margin*this.finalRatio,this.lines),this.lines)}resultWithStarts(){if(2!==this.type)throw new Error("Only valid for lines");this._pushLine();const t=this.lines,e=t.length;if(0===e)return null;const i=[];for(let s=0;s<e;s++)i.push({line:t[s],start:this.starts[s]||0});return i}_isIn(t,e){return t>=this.xmin&&t<=this.xmax&&e>=this.ymin&&e<=this.ymax}_intersect(t,e){let i,s,n;if(e.x>=this.xmin&&e.x<=this.xmax)s=e.y<=this.ymin?this.ymin:this.ymax,n=(s-t.y)/(e.y-t.y),i=t.x+n*(e.x-t.x);else if(e.y>=this.ymin&&e.y<=this.ymax)i=e.x<=this.xmin?this.xmin:this.xmax,n=(i-t.x)/(e.x-t.x),s=t.y+n*(e.y-t.y);else{s=e.y<=this.ymin?this.ymin:this.ymax,i=e.x<=this.xmin?this.xmin:this.xmax;const r=(i-t.x)/(e.x-t.x),a=(s-t.y)/(e.y-t.y);r<a?(n=r,s=t.y+r*(e.y-t.y)):(n=a,i=t.x+a*(e.x-t.x))}return this._r=n,new r.a(i,s)}_pushLine(){this.line&&(1===this.type?this.line.length>0&&(this.lines.push(this.line),this.starts.push(this.start)):2===this.type?this.line.length>1&&(this.lines.push(this.line),this.starts.push(this.start)):3===this.type&&this.line.length>3&&(this.lines.push(this.line),this.starts.push(this.start))),this.line=[],this.start=0}_moveTo(t,e,i){3!==this.type?i&&(t=Math.round((t-(this.xmin+this.margin))*this.finalRatio),e=Math.round((e-(this.ymin+this.margin))*this.finalRatio),this.line.push(new r.a(t,e))):(i||(t<this.xmin&&(t=this.xmin),t>this.xmax&&(t=this.xmax),e<this.ymin&&(e=this.ymin),e>this.ymax&&(e=this.ymax)),t=Math.round((t-(this.xmin+this.margin))*this.finalRatio),e=Math.round((e-(this.ymin+this.margin))*this.finalRatio),this.line.push(new r.a(t,e)),this._is_h=!1,this._is_v=!1)}_lineTo(t,e,i){let s,n;if(3!==this.type)if(i){if(t=Math.round((t-(this.xmin+this.margin))*this.finalRatio),e=Math.round((e-(this.ymin+this.margin))*this.finalRatio),this.line.length>0&&(s=this.line[this.line.length-1],s.equals(t,e)))return;this.line.push(new r.a(t,e))}else this.line&&this.line.length>0&&this._pushLine();else if(i||(t<this.xmin&&(t=this.xmin),t>this.xmax&&(t=this.xmax),e<this.ymin&&(e=this.ymin),e>this.ymax&&(e=this.ymax)),t=Math.round((t-(this.xmin+this.margin))*this.finalRatio),e=Math.round((e-(this.ymin+this.margin))*this.finalRatio),this.line&&this.line.length>0){s=this.line[this.line.length-1];const i=s.x===t,a=s.y===e;if(i&&a)return;this._is_h&&i||this._is_v&&a?(s.x=t,s.y=e,n=this.line[this.line.length-2],n.x===t&&n.y===e?(this.line.pop(),this.line.length<=1?(this._is_h=!1,this._is_v=!1):(n=this.line[this.line.length-2],this._is_h=n.x===t,this._is_v=n.y===e)):(this._is_h=n.x===t,this._is_v=n.y===e)):(this.line.push(new r.a(t,e)),this._is_h=i,this._is_v=a)}else this.line.push(new r.a(t,e))}}class c{setExtent(t){this._ratio=4096===t?1:4096/t}get validateTessellation(){return this._ratio<1}reset(t){this.lines=[],this.line=null}moveTo(t,e){this.line&&this.lines.push(this.line),this.line=[];const i=this._ratio;this.line.push(new r.a(t*i,e*i))}lineTo(t,e){const i=this._ratio;this.line.push(new r.a(t*i,e*i))}close(){const t=this.line;t&&!t[0].isEqual(t[t.length-1])&&t.push(t[0])}result(){return this.line&&this.lines.push(this.line),0===this.lines.length?null:this.lines}}class l{static simplify(t,e,i){if(!i)return;const s=-e,r=t+e,n=-e,a=t+e,o=[],c=[],h=i.length;for(let l=0;l<h;++l){const t=i[l];if(!t||t.length<2)continue;let e,h=t[0];const u=t.length;for(let i=1;i<u;++i)e=t[i],h.x===e.x&&(h.x<=s&&(h.y>e.y?(o.push(l),o.push(i),o.push(0),o.push(-1)):(c.push(l),c.push(i),c.push(0),c.push(-1))),h.x>=r&&(h.y<e.y?(o.push(l),o.push(i),o.push(1),o.push(-1)):(c.push(l),c.push(i),c.push(1),c.push(-1)))),h.y===e.y&&(h.y<=n&&(h.x<e.x?(o.push(l),o.push(i),o.push(2),o.push(-1)):(c.push(l),c.push(i),c.push(2),c.push(-1))),h.y>=a&&(h.x>e.x?(o.push(l),o.push(i),o.push(3),o.push(-1)):(c.push(l),c.push(i),c.push(3),c.push(-1)))),h=e}if(0===o.length||0===c.length)return;l.fillParent(i,c,o),l.fillParent(i,o,c);const u=[];l.calcDeltas(u,c,o),l.calcDeltas(u,o,c),l.addDeltas(u,i)}static fillParent(t,e,i){const s=i.length,r=e.length;for(let a=0;a<r;a+=4){const r=e[a],o=e[a+1],c=e[a+2],l=t[r][o-1],h=t[r][o];let u=8092,d=-1;for(let e=0;e<s;e+=4){if(i[e+2]!==c)continue;const s=i[e],r=i[e+1],a=t[s][r-1],o=t[s][r];switch(c){case 0:case 1:if(Object(n.a)(l.y,a.y,o.y)&&Object(n.a)(h.y,a.y,o.y)){const t=Math.abs(o.y-a.y);t<u&&(u=t,d=e)}break;case 2:case 3:if(Object(n.a)(l.x,a.x,o.x)&&Object(n.a)(h.x,a.x,o.x)){const t=Math.abs(o.x-a.x);t<u&&(u=t,d=e)}}}e[a+3]=d}}static calcDeltas(t,e,i){const s=e.length;for(let r=0;r<s;r+=4){const s=[],n=l.calcDelta(r,e,i,s);t.push(e[r]),t.push(e[r+1]),t.push(e[r+2]),t.push(n)}}static calcDelta(t,e,i,s){const r=e[t+3];if(-1===r)return 0;const n=s.length;return n>1&&s[n-2]===r?0:(s.push(r),l.calcDelta(r,i,e,s)+1)}static addDeltas(t,e){const i=t.length;let s=0;for(let r=0;r<i;r+=4){const e=t[r+3];e>s&&(s=e)}for(let r=0;r<i;r+=4){const i=e[t[r]],n=t[r+1],a=s-t[r+3];switch(t[r+2]){case 0:i[n-1].x-=a,i[n].x-=a,1===n&&(i[i.length-1].x-=a),n===i.length-1&&(i[0].x-=a);break;case 1:i[n-1].x+=a,i[n].x+=a,1===n&&(i[i.length-1].x+=a),n===i.length-1&&(i[0].x+=a);break;case 2:i[n-1].y-=a,i[n].y-=a,1===n&&(i[i.length-1].y-=a),n===i.length-1&&(i[0].y-=a);break;case 3:i[n-1].y+=a,i[n].y+=a,1===n&&(i[i.length-1].y+=a),n===i.length-1&&(i[0].y+=a)}}}}},597:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));i(308);function s(t,e,i,s){const r=t.clone(),n=1<<r.level,a=r.col+e,o=r.row+i;return s&&a<0?(r.col=a+n,r.world-=1):a>=n?(r.col=a-n,r.world+=1):r.col=a,r.row=o,r}},598:function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));const s=new(i(21).a)({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch",mesh:"mesh"});function r(t){return s.toJSON(t)}},599:function(t,e,i){"use strict";i.d(e,"a",(function(){return w}));const s=[["(",")"],[")","("],["<",">"],[">","<"],["[","]"],["]","["],["{","}"],["}","{"],["\xab","\xbb"],["\xbb","\xab"],["\u2039","\u203a"],["\u203a","\u2039"],["\u207d","\u207e"],["\u207e","\u207d"],["\u208d","\u208e"],["\u208e","\u208d"],["\u2264","\u2265"],["\u2265","\u2264"],["\u2329","\u232a"],["\u232a","\u2329"],["\ufe59","\ufe5a"],["\ufe5a","\ufe59"],["\ufe5b","\ufe5c"],["\ufe5c","\ufe5b"],["\ufe5d","\ufe5e"],["\ufe5e","\ufe5d"],["\ufe64","\ufe65"],["\ufe65","\ufe64"]],r=["\u0622","\u0623","\u0625","\u0627"],n=["\ufef5","\ufef7","\ufef9","\ufefb"],a=["\ufef6","\ufef8","\ufefa","\ufefc"],o=["\u0627","\u0628","\u062a","\u062b","\u062c","\u062d","\u062e","\u062f","\u0630","\u0631","\u0632","\u0633","\u0634","\u0635","\u0636","\u0637","\u0638","\u0639","\u063a","\u0641","\u0642","\u0643","\u0644","\u0645","\u0646","\u0647","\u0648","\u064a","\u0625","\u0623","\u0622","\u0629","\u0649","\u0644","\u0645","\u0646","\u0647","\u0648","\u064a","\u0625","\u0623","\u0622","\u0629","\u0649","\u06cc","\u0626","\u0624"],c=["\ufe8d","\ufe8f","\ufe95","\ufe99","\ufe9d","\ufea1","\ufea5","\ufea9","\ufeab","\ufead","\ufeaf","\ufeb1","\ufeb5","\ufeb9","\ufebd","\ufec1","\ufec5","\ufec9","\ufecd","\ufed1","\ufed5","\ufed9","\ufedd","\ufee1","\ufee5","\ufee9","\ufeed","\ufef1","\ufe87","\ufe83","\ufe81","\ufe93","\ufeef","\ufbfc","\ufe89","\ufe85","\ufe70","\ufe72","\ufe74","\ufe76","\ufe78","\ufe7a","\ufe7c","\ufe7e","\ufe80","\ufe89","\ufe85"],l=["\ufe8e","\ufe90","\ufe96","\ufe9a","\ufe9e","\ufea2","\ufea6","\ufeaa","\ufeac","\ufeae","\ufeb0","\ufeb2","\ufeb6","\ufeba","\ufebe","\ufec2","\ufec6","\ufeca","\ufece","\ufed2","\ufed6","\ufeda","\ufede","\ufee2","\ufee6","\ufeea","\ufeee","\ufef2","\ufe88","\ufe84","\ufe82","\ufe94","\ufef0","\ufbfd","\ufe8a","\ufe86","\ufe70","\ufe72","\ufe74","\ufe76","\ufe78","\ufe7a","\ufe7c","\ufe7e","\ufe80","\ufe8a","\ufe86"],h=["\ufe8e","\ufe92","\ufe98","\ufe9c","\ufea0","\ufea4","\ufea8","\ufeaa","\ufeac","\ufeae","\ufeb0","\ufeb4","\ufeb8","\ufebc","\ufec0","\ufec4","\ufec8","\ufecc","\ufed0","\ufed4","\ufed8","\ufedc","\ufee0","\ufee4","\ufee8","\ufeec","\ufeee","\ufef4","\ufe88","\ufe84","\ufe82","\ufe94","\ufef0","\ufbff","\ufe8c","\ufe86","\ufe71","\ufe72","\ufe74","\ufe77","\ufe79","\ufe7b","\ufe7d","\ufe7f","\ufe80","\ufe8c","\ufe86"],u=["\ufe8d","\ufe91","\ufe97","\ufe9b","\ufe9f","\ufea3","\ufea7","\ufea9","\ufeab","\ufead","\ufeaf","\ufeb3","\ufeb7","\ufebb","\ufebf","\ufec3","\ufec7","\ufecb","\ufecf","\ufed3","\ufed7","\ufedb","\ufedf","\ufee3","\ufee7","\ufeeb","\ufeed","\ufef3","\ufe87","\ufe83","\ufe81","\ufe93","\ufeef","\ufbfe","\ufe8b","\ufe85","\ufe70","\ufe72","\ufe74","\ufe76","\ufe78","\ufe7a","\ufe7c","\ufe7e","\ufe80","\ufe8b","\ufe85"],d=["\u0621","\u0622","\u0623","\u0624","\u0625","\u0627","\u0629","\u062f","\u0630","\u0631","\u0632","\u0648","\u0649"],f=["\u064b","\u064b","\u064c","\u061f","\u064d","\u061f","\u064e","\u064e","\u064f","\u064f","\u0650","\u0650","\u0651","\u0651","\u0652","\u0652","\u0621","\u0622","\u0622","\u0623","\u0623","\u0624","\u0624","\u0625","\u0625","\u0626","\u0626","\u0626","\u0626","\u0627","\u0627","\u0628","\u0628","\u0628","\u0628","\u0629","\u0629","\u062a","\u062a","\u062a","\u062a","\u062b","\u062b","\u062b","\u062b","\u062c","\u062c","\u062c","\u062c","\u062d","\u062d","\u062d","\u062d","\u062e","\u062e","\u062e","\u062e","\u062f","\u062f","\u0630","\u0630","\u0631","\u0631","\u0632","\u0632","\u0633","\u0633","\u0633","\u0633","\u0634","\u0634","\u0634","\u0634","\u0635","\u0635","\u0635","\u0635","\u0636","\u0636","\u0636","\u0636","\u0637","\u0637","\u0637","\u0637","\u0638","\u0638","\u0638","\u0638","\u0639","\u0639","\u0639","\u0639","\u063a","\u063a","\u063a","\u063a","\u0641","\u0641","\u0641","\u0641","\u0642","\u0642","\u0642","\u0642","\u0643","\u0643","\u0643","\u0643","\u0644","\u0644","\u0644","\u0644","\u0645","\u0645","\u0645","\u0645","\u0646","\u0646","\u0646","\u0646","\u0647","\u0647","\u0647","\u0647","\u0648","\u0648","\u0649","\u0649","\u064a","\u064a","\u064a","\u064a","\ufef5","\ufef6","\ufef7","\ufef8","\ufef9","\ufefa","\ufefb","\ufefc","\u061f","\u061f","\u061f"],p=["\u0621","\u0641"],m=["\u063a","\u064a"],y=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],x=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],_=10,g=12,b=18,v=["UBAT_L","UBAT_R","UBAT_EN","UBAT_AN","UBAT_ON","UBAT_B","UBAT_S","UBAT_AL","UBAT_WS","UBAT_CS","UBAT_ES","UBAT_ET","UBAT_NSM","UBAT_LRE","UBAT_RLE","UBAT_PDF","UBAT_LRO","UBAT_RLO","UBAT_BN"],O=[100,0,0,0,0,101,102,103,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,104,4,4,4,0,4,0,4,0,4,4,4,0,0,4,4,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,4,4,0,0,4,4,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,105,7,7,106,107],j=[[b,b,b,b,b,b,b,b,b,6,5,6,8,5,b,b,b,b,b,b,b,b,b,b,b,b,b,b,5,5,5,6,8,4,4,11,11,11,4,4,4,4,4,_,9,_,9,9,2,2,2,2,2,2,2,2,2,2,9,4,4,4,4,4,4,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,4,4,4,4,4,4,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,4,4,4,4,b,b,b,b,b,b,5,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,9,4,11,11,11,11,4,4,4,4,0,4,4,b,4,4,11,11,2,2,4,0,4,4,4,2,0,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,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,4,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,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,0,0,0,0,0,0,4,4,0,0,0,0,0,0,0,4,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,0,0,0,0,0,0,0,4,0,4,4,4,4,4,4,4,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,1,g,1,g,g,1,g,g,1,g,4,4,4,4,4,4,4,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4,4,4,1,1,1,1,1,4,4,4,4,4,4,4,4,4,4,4],[3,3,3,3,4,4,4,4,7,11,11,7,9,7,4,4,g,g,g,g,g,g,g,g,g,g,g,7,4,4,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,3,3,3,3,3,3,3,3,3,3,11,3,3,7,7,7,g,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,g,g,g,g,g,g,g,3,4,g,g,g,g,g,g,7,7,g,g,4,g,g,g,g,7,7,2,2,2,2,2,2,2,2,2,2,7,7,7,7,7,7],[7,7,7,7,7,7,7,7,7,7,7,7,7,7,4,7,7,g,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,4,4,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,g,g,g,g,g,g,g,g,g,g,g,7,4,4,4,4,4,4,4,4,4,4,4,4,4,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,g,g,g,g,g,g,g,g,g,1,1,4,4,4,4,1,4,4,4,4,4],[8,8,8,8,8,8,8,8,8,8,8,b,b,b,0,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,8,5,13,14,15,16,17,9,11,11,11,11,11,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,9,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,8,b,b,b,b,b,4,4,4,4,4,b,b,b,b,b,b,2,0,4,4,2,2,2,2,2,2,_,_,4,4,4,0,2,2,2,2,2,2,2,2,2,2,_,_,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4],[0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,4,4,4,4,4,1,g,1,1,1,1,1,1,1,1,1,1,_,1,1,1,1,1,1,1,1,1,1,1,1,1,4,1,1,1,1,1,4,1,4,1,1,4,1,1,4,1,1,1,1,1,1,1,1,1,1,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7],[g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,g,g,g,g,g,g,g,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,9,4,9,4,4,9,4,4,4,4,4,4,4,4,4,11,4,4,_,_,4,4,4,4,4,11,11,4,4,4,4,4,7,7,7,7,7,4,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,4,4,b],[4,4,4,11,11,11,4,4,4,4,4,_,9,_,9,9,2,2,2,2,2,2,2,2,2,2,9,4,4,4,4,4,4,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,4,4,4,4,4,4,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,4,4,4,4,4,4,4,4,4,4,4,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,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,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,4,4,4,0,0,0,0,0,0,4,4,0,0,0,0,0,0,4,4,0,0,0,0,0,0,4,4,0,0,0,4,4,4,11,11,4,4,4,11,11,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4]];class w{constructor(){this.inputFormat="ILYNN",this.outputFormat="VLNNN",this.sourceToTarget=[],this.targetToSource=[],this.levels=[]}bidiTransform(t,e,i){if(this.sourceToTarget=[],this.targetToSource=[],!t)return"";if(function(t,e,i){q=[],Z=[];for(let s=0;s<i;s++)t[s]=s,e[s]=s,q[s]=s}(this.sourceToTarget,this.targetToSource,t.length),!this.checkParameters(e,i))return t;e=this.inputFormat,i=this.outputFormat;let s=t;const o=H,h=N(e.charAt(1)),d=N(i.charAt(1)),p=("I"===e.charAt(0)?"L":e.charAt(0))+h,m=("I"===i.charAt(0)?"L":i.charAt(0))+d,y=e.charAt(2)+i.charAt(2);o.defInFormat=p,o.defOutFormat=m,o.defSwap=y;const x=function t(e,i,s,r,n){const a=function(t,e,i){if(void 0===e.inFormat&&(e.inFormat=i.defInFormat),void 0===e.outFormat&&(e.outFormat=i.defOutFormat),void 0===e.swap&&(e.swap=i.defSwap),e.inFormat===e.outFormat)return e;const s=e.inFormat.substring(0,1),r=e.outFormat.substring(0,1);let n,a=e.inFormat.substring(1,4),o=e.outFormat.substring(1,4);return"C"===a.charAt(0)&&(n=T(t),a="ltr"===n||"rtl"===n?n.toUpperCase():"L"===e.inFormat.charAt(2)?"LTR":"RTL",e.inFormat=s+a),"C"===o.charAt(0)&&(n=T(t),"rtl"===n?o="RTL":"ltr"===n?(n=function(t){const e=t.split("");return e.reverse(),T(e.join(""))}(t),o=n.toUpperCase()):o="L"===e.outFormat.charAt(2)?"LTR":"RTL",e.outFormat=r+o),e}(e,{inFormat:i,outFormat:s,swap:r},n);if(a.inFormat===a.outFormat)return e;i=a.inFormat,s=a.outFormat,r=a.swap;const o=i.substring(0,1),c=i.substring(1,4),l=s.substring(0,1),h=s.substring(1,4);if(n.inFormat=i,n.outFormat=s,n.swap=r,"L"===o&&"VLTR"===s){if("LTR"===c)return n.dir=J,S(e,n);if("RTL"===c)return n.dir=Q,S(e,n)}if("V"===o&&"V"===l)return n.dir="RTL"===c?Q:J,R(e,n);if("L"===o&&"VRTL"===s)return"LTR"===c?(n.dir=J,e=S(e,n)):(n.dir=Q,e=S(e,n)),R(e);if("VLTR"===i&&"LLTR"===s)return n.dir=J,S(e,n);if("V"===o&&"L"===l&&c!==h)return e=R(e),"RTL"===c?t(e,"LLTR","VLTR",r,n):t(e,"LRTL","VRTL",r,n);if("VRTL"===i&&"LRTL"===s)return t(e,"LRTL","VRTL",r,n);if("L"===o&&"L"===l){const i=n.swap;return n.swap=i.substr(0,1)+"N","RTL"===c?(n.dir=Q,e=S(e,n),n.swap="N"+i.substr(1,2),n.dir=J,e=S(e,n)):(n.dir=J,e=S(e,n),n.swap="N"+i.substr(1,2),e=t(e,"VLTR","LRTL",n.swap,n)),e}return e}(t,p,m,y,o);let _=!1;return"R"===i.charAt(1)?_=!0:"C"!==i.charAt(1)&&"D"!==i.charAt(1)||(_="rtl"===this.checkContextual(x)),this.sourceToTarget=q,this.targetToSource=function(t){const e=new Array(t.length);for(let i=0;i<t.length;i++)e[t[i]]=i;return e}(this.sourceToTarget),K=this.targetToSource,s=e.charAt(3)===i.charAt(3)?x:"S"===i.charAt(3)?function(t,e,i){if(0===e.length)return"";void 0===t&&(t=!0),void 0===i&&(i=!0);const s=(e=String(e)).split("");let r=0,o=1,h=s.length;t||(r=s.length-1,o=-1,h=1);const d=function(t,e,i,s,r){let o=0;const h=[];let d=0;for(let f=e;f*i<s;f+=i)if(C(t[f])||V(t[f])){if("\u0644"===t[f]&&E(t,f+i,i,s)){t[f]=G(t[f+i],0===o?n:a),f+=i,U(t,f,i,s),r&&(h[d]=f,d++),o=0;continue}const e=t[f];1===o?t[f]=z(t,f+i,i,s)?B(t[f]):k(t[f],l):!0===z(t,f+i,i,s)?t[f]=k(t[f],u):t[f]=k(t[f],c),V(e)||(o=1),!0===P(e)&&(o=0)}else o=0;return h}(s,r,o,h,i);let f="";for(let n=0;n<s.length;n++)i&&L(d,d.length,n)>-1?(W(K,n,!t,-1),q.splice(n,1)):f+=s[n];return f}(_,x,!0):function(t,e,i){if(0===t.length)return"";void 0===i&&(i=!0),void 0===e&&(e=!0);let s="";const n=(t=String(t)).split("");for(let a=0;a<t.length;a++){let o=!1;if(n[a]>="\ufe70"&&n[a]<"\ufeff"){const c=t.charCodeAt(a);n[a]>="\ufef5"&&n[a]<="\ufefc"?(e?(a>0&&i&&" "===n[a-1]?s=s.substring(0,s.length-1)+"\u0644":(s+="\u0644",o=!0),s+=r[(c-65269)/2]):(s+=r[(c-65269)/2],s+="\u0644",a+1<t.length&&i&&" "===n[a+1]?a++:o=!0),o&&(W(K,a,!0,1),q.splice(a,0,q[a]))):s+=f[c-65136]}else s+=n[a]}return s}(x,_,!0),this.sourceToTarget=q,this.targetToSource=K,this.levels=Z,s}_inputFormatSetter(t){if(!$.test(t))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.inputFormat=t}_outputFormatSetter(t){if(!$.test(t))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.outputFormat=t}checkParameters(t,e){return t?this._inputFormatSetter(t):t=this.inputFormat,e?this._outputFormatSetter(e):e=this.outputFormat,t!==e}checkContextual(t){let e=T(t);if("ltr"!==e&&"rtl"!==e){try{e=document.dir.toLowerCase()}catch(i){}"ltr"!==e&&"rtl"!==e&&(e="ltr")}return e}hasBidiChar(t){return tt.test(t)}}function T(t){const e=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(t);return e?e[0]<="z"?"ltr":"rtl":""}function S(t,e){const i=t.split(""),s=[];return M(i,s,e),function(t,e,i){if(0!==i.hiLevel&&i.swap.substr(0,1)!==i.swap.substr(1,2))for(let s=0;s<t.length;s++)1===e[s]&&(t[s]=A(t[s]))}(i,s,e),F(2,i,s,e),F(1,i,s,e),Z=s,i.join("")}function M(t,e,i){const s=t.length,r=i.dir?x:y;let n=0,a=-1;const o=[],c=[];i.hiLevel=i.dir,i.lastArabic=!1,i.hasUbatAl=!1,i.hasUbatB=!1,i.hasUbatS=!1;for(let l=0;l<s;l++)o[l]=I(t[l]);for(let l=0;l<s;l++){const s=n,h=D(t,o,c,l,i);c[l]=h,n=r[s][h];const u=240&n;n&=15;const d=r[n][Y];if(e[l]=d,u>0)if(16===u){for(let t=a;t<l;t++)e[t]=1;a=-1}else a=-1;if(r[n][X])-1===a&&(a=l);else if(a>-1){for(let t=a;t<l;t++)e[t]=d;a=-1}5===o[l]&&(e[l]=0),i.hiLevel|=d}i.hasUbatS&&function(t,e,i,s){for(let r=0;r<i;r++)if(6===t[r]){e[r]=s.dir;for(let i=r-1;i>=0&&8===t[i];i--)e[i]=s.dir}}(o,e,s,i)}function I(t){const e=t.charCodeAt(0),i=O[e>>8];return i<100?i:j[i-100][255&e]}function R(t,e){const i=t.split("");if(e){const t=[];M(i,t,e),Z=t}return i.reverse(),q.reverse(),i.join("")}function L(t,e,i){for(let s=0;s<e;s++)if(t[s]===i)return s;return-1}function C(t){for(let e=0;e<p.length;e++)if(t>=p[e]&&t<=m[e])return!0;return!1}function z(t,e,i,s){for(;e*i<s&&V(t[e]);)e+=i;return!!(e*i<s&&C(t[e]))}function E(t,e,i,s){for(;e*i<s&&V(t[e]);)e+=i;let n=" ";if(!(e*i<s))return!1;n=t[e];for(let a=0;a<r.length;a++)if(r[a]===n)return!0;return!1}function F(t,e,i,s){if(s.hiLevel<t)return;if(1===t&&s.dir===Q&&!s.hasUbatB)return e.reverse(),void q.reverse();const r=e.length;let n,a,o,c,l,h=0;for(;h<r;){if(i[h]>=t){for(n=h+1;n<r&&i[n]>=t;)n++;for(a=h,o=n-1;a<o;a++,o--)c=e[a],e[a]=e[o],e[o]=c,l=q[a],q[a]=q[o],q[o]=l;h=n}h++}}function D(t,e,i,s,r){const n=e[s];return{UBAT_L:()=>(r.lastArabic=!1,0),UBAT_R:()=>(r.lastArabic=!1,1),UBAT_ON:()=>4,UBAT_AN:()=>3,UBAT_EN:()=>r.lastArabic?3:2,UBAT_AL:()=>(r.lastArabic=!0,r.hasUbatAl=!0,1),UBAT_WS:()=>4,UBAT_CS:()=>{let t,n;return s<1||s+1>=e.length||2!==(t=i[s-1])&&3!==t||2!==(n=e[s+1])&&3!==n?4:(r.lastArabic&&(n=3),n===t?n:4)},UBAT_ES:()=>2===(s>0?i[s-1]:5)&&s+1<e.length&&2===e[s+1]?2:4,UBAT_ET:()=>{if(s>0&&2===i[s-1])return 2;if(r.lastArabic)return 4;let t=s+1;const n=e.length;for(;t<n&&11===e[t];)t++;return t<n&&2===e[t]?2:4},UBAT_NSM:()=>{if("VLTR"===r.inFormat){const i=e.length;let r=s+1;for(;r<i&&e[r]===g;)r++;if(r<i){const i=t[s].charCodeAt[0],n=i>=1425&&i<=2303||64286===i,a=e[r];if(n&&(1===a||7===a))return 1}}return s<1||5===e[s-1]?4:i[s-1]},UBAT_B:()=>(r.lastArabic=!0,r.hasUbatB=!0,r.dir),UBAT_S:()=>(r.hasUbatS=!0,4),UBAT_LRE:()=>(r.lastArabic=!1,4),UBAT_RLE:()=>(r.lastArabic=!1,4),UBAT_LRO:()=>(r.lastArabic=!1,4),UBAT_RLO:()=>(r.lastArabic=!1,4),UBAT_PDF:()=>(r.lastArabic=!1,4),UBAT_BN:()=>4}[v[n]]()}function A(t){let e,i=0,r=s.length-1;for(;i<=r;)if(e=Math.floor((i+r)/2),t<s[e][0])r=e-1;else{if(!(t>s[e][0]))return s[e][1];i=e+1}return t}function P(t){for(let e=0;e<d.length;e++)if(d[e]===t)return!0;return!1}function B(t){for(let e=0;e<o.length;e++)if(t===o[e])return h[e];return t}function k(t,e){for(let i=0;i<o.length;i++)if(t===o[i])return e[i];return t}function V(t){return t>="\u064b"&&t<="\u0655"}function N(t){return"L"===t?"LTR":"R"===t?"RTL":"C"===t?"CLR":"D"===t?"CRL":""}function U(t,e,i,s){for(;e*i<s&&V(t[e]);)e+=i;return e*i<s&&(t[e]=" ",!0)}function G(t,e){for(let i=0;i<r.length;i++)if(t===r[i])return e[i];return t}function W(t,e,i,s){for(let r=0;r<t.length;r++)(t[r]>e||!i&&t[r]===e)&&(t[r]+=s)}let q=[],K=[],Z=[];const H={dir:0,defInFormat:"LLTR",defoutFormat:"VLTR",defSwap:"YN",inFormat:"LLTR",outFormat:"VLTR",swap:"YN",hiLevel:0,lastArabic:!1,hasUbatAl:!1,hasBlockSep:!1,hasSegSep:!1,defOutFormat:""},Y=5,X=6,J=0,Q=1,$=/^[(I|V)][(L|R|C|D)][(Y|N)][(S|N)][N]$/,tt=/[\u0591-\u06ff\ufb1d-\ufefc]/},600:function(t,e,i){"use strict";i.d(e,"a",(function(){return h})),i.d(e,"b",(function(){return l}));var s=i(18),r=i(67),n=i(186),a=i(533),o=i(554);const c={"simple-marker":1,"picture-marker":1,text:0,"simple-line":0,"simple-fill":0,"picture-fill":0,cim:1,"web-style":1};function l(t){if(!("visualVariables"in t))return 0;if(!t.hasVisualVariables("size"))return 0;const e=t.getVisualVariablesForType("size");if(!e[0])return 0;const i=e[0];if("outline"===i.target)return 0;if("stops"===i.transformationType)return i.stops.map(t=>t.size).reduce(x,0);if("clamped-linear"===i.transformationType){let t=-1/0,e=-1/0;return t="number"==typeof i.maxSize?i.maxSize:i.maxSize.stops.map(t=>t.size).reduce(x,0),e="number"==typeof i.minSize?i.minSize:i.minSize.stops.map(t=>t.size).reduce(x,0),Math.max(t,e)}return"real-world-size"===i.transformationType?30:void 0}async function h(t,e,i){if(!t||i&&"cluster"===i.type)return 0;if("heatmap"===t.type)return Math.round(3*t.blurRadius);if("dot-density"===t.type)return 0;if("dictionary"===t.type)return"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?100:200;const r=t.getSymbols(),n=l(t),a=[];for(const s of r)a.push(m(s,n));const o=await Promise.all(a);return Object(s.c)(o.reduce(x,0))}const u=[0,0,0,0];function d(t,e){return null==t?e:t}const f={sdf:!0,code:99,metrics:a.c.metrics,rect:new n.a(0,0,24,24),page:0,textureBinding:2};async function p(t,e){if("simple-marker"===t.type){const i=Math.max(d(t.size,12),e);return y(t)+.707*i}if("picture-marker"===t.type){const i=Math.max(d(t.height,12),e),s=d(t.width,12)*(i/d(t.height,12))/2,r=i/2;return y(t)+Math.sqrt(s*s+r*r)}if("text"===t.type){const e=function(t){const e=t.text&&t.text.length;if(!e)return{glyphMosaicItems:[f]};const i=[];for(let s=0;s<e;s++)i.push({...f,code:t.text.charCodeAt(s)});return{glyphMosaicItems:i}}(t);Object(o.g)(u,t.toJSON(),e);const i=Math.abs(u[0]),s=Math.abs(u[1]),r=u[2],n=u[3];return Math.max(i,s)+Math.max(r,n)}if("simple-line"===t.type){const i=t,s=Math.max(d(i.width,.75),e)/2;return i.marker?Math.max(6*i.width,2*e):s}if("simple-fill"===t.type||"picture-fill"===t.type)return Math.max(function(t,e){return null==t.outline?e:d(t.outline.width,e)}(t,0),e)/2;if("cim"===t.type){const e=r.a.getEnvelope(t.data);return e?Math.sqrt(e.width*e.width+e.height*e.height):0}return"web-style"===t.type?p(await t.fetchCIMSymbol(),e):0}async function m(t,e){return function(t){return t.type in c}(t)?Math.min(await p(t,e),75):0}function y(t){const e=d(t.xoffset,0),i=d(t.yoffset,0);return Math.sqrt(e*e+i*i)}function x(t,e){return Math.max(t,e)}},601:function(t,e,i){"use strict";i.d(e,"a",(function(){return a})),i.d(e,"b",(function(){return o}));var s=i(4),r=i(18);const n=s.a.getLogger("esri.renderers.visualVariables.support.utils"),a=t=>{if(!("visualVariables"in t)||!t.visualVariables||!t.visualVariables.length)return t;const e=t.clone(),i=e.visualVariables.map(t=>c(t)?l(t):t);return e.visualVariables=i,e};function o(t){return t.map(t=>c(t)?l(t.clone()):t)}function c(t){return("size"===t.type||"color"===t.type||"opacity"===t.type)&&null!=t.stops}function l(t){return t.stops=function(t,e){return e.length<=8?e:(n.warn(`Found ${e.length} Visual Variable stops, but MapView only supports 8. Displayed stops will be simplified.`),e.length>16?function(t,e){const[i,...s]=e,n=s.pop(),a=s[0].value,o=s[s.length-1].value,c=(o-a)/6,l=[];for(let u=a;u<o;u+=c){let i=0;for(;u>=s[i].value;)i++;const n=s[i],a=e[i-1],o=u-a.value,c=n.value===a.value?1:o/(n.value-a.value);if("color"===t){const t=s[i],r=e[i-1],n=t.color.clone();n.r=h(r.color.r,n.r,c),n.g=h(r.color.g,n.g,c),n.b=h(r.color.b,n.b,c),n.a=h(r.color.a,n.a,c),l.push({value:u,color:n,label:t.label})}else if("size"===t){const t=s[i],n=e[i-1],a=Object(r.e)(t.size),o=h(Object(r.e)(n.size),a,c);l.push({value:u,size:o,label:t.label})}else{const t=s[i],r=h(e[i-1].opacity,t.opacity,c);l.push({value:u,opacity:r,label:t.label})}}return[i,...l,n]}(t,e):function(t){const[e,...i]=t,s=i.pop();for(;i.length>6;){let t=0,e=0;for(let s=1;s<i.length;s++){const r=i[s-1],n=i[s],a=Math.abs(n.value-r.value);a>e&&(e=a,t=s)}i.splice(t,1)}return[e,...i,s]}(e))}(t.type,t.stops),t}function h(t,e,i){return(1-i)*t+i*e}},602:function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var s=i(3);class r{constructor(t,e,i){this.pixelBlock=t,this.extent=e,this.originalPixelBlock=i}get width(){return Object(s.j)(this.pixelBlock)?this.pixelBlock.width:0}get height(){return Object(s.j)(this.pixelBlock)?this.pixelBlock.height:0}render(t){const e=this.pixelBlock;if(Object(s.i)(e))return;const i=this.filter({pixelBlock:e});if(Object(s.i)(i.pixelBlock))return;const r=i.pixelBlock.getAsRGBA(),n=t.createImageData(i.pixelBlock.width,i.pixelBlock.height);n.data.set(r),t.putImageData(n,0,0)}getRenderedRasterPixels(){const t=this.filter({pixelBlock:this.pixelBlock});return Object(s.i)(t.pixelBlock)?null:{width:t.pixelBlock.width,height:t.pixelBlock.height,renderedRasterPixels:new Uint8Array(t.pixelBlock.getAsRGBA().buffer)}}}},603:function(t,e,i){"use strict";i.d(e,"a",(function(){return j})),i.d(e,"b",(function(){return b})),i.d(e,"c",(function(){return v})),i.d(e,"d",(function(){return w}));var s,r=i(9),n=i(5),a=i(4),o=i(3),c=i(591),l=i(253),h=i(344),u=i(0),d=i(7),f=i(1),p=(i(6),i(2)),m=i(14),y=i(100);let x=s=class extends l.a{writeLevels(t,e,i){for(const s in t){const t=this.levels[s];return void(e.stops=t)}}clone(){return new s({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:Object(y.c)(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:Object(y.c)(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:this.stops&&this.stops.map(t=>t.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions&&this.legendOptions.clone(),levels:Object(d.a)(this.levels)})}};Object(u.a)([Object(f.b)()],x.prototype,"levels",void 0),Object(u.a)([Object(m.a)("levels")],x.prototype,"writeLevels",null),x=s=Object(u.a)([Object(p.a)("esri.views.2d.engine.LevelDependentSizeVariable")],x);const _=a.a.getLogger("esri.views.2d.layers.support.clusterUtils");n.a.add("esri-cluster-arcade-enabled",!0);const g=Object(n.a)("esri-cluster-arcade-enabled"),b=(t,e,i,s)=>{const r=e.clone();if(!w(r))return r;if(i.fields)for(const n of i.fields)T(t,n);if("visualVariables"in r){const e=(r.visualVariables||[]).filter(t=>"$view.scale"!==t.valueExpression),n=v(e);e.forEach(e=>{"rotation"===e.type?e.field?e.field=M(t,e.field,"avg_angle"):e.valueExpression&&(e.field=S(t,e.valueExpression,"avg_angle"),e.valueExpression=null):e.normalizationField?(e.field=M(t,e.field,"norm",e.normalizationField),e.normalizationField=null):e.field?e.field=M(t,e.field,"avg"):(e.field=S(t,e.valueExpression,"avg"),e.valueExpression=null)}),Object(o.i)(n)&&!O(e)&&(e.push(j(i,s)),r.dynamicClusterSize=!0),r.visualVariables=e}switch(r.type){case"simple":break;case"unique-value":r.field?r.field=M(t,r.field,"mode"):r.valueExpression&&(r.field=S(t,r.valueExpression,"mode"),r.valueExpression=null);break;case"class-breaks":r.normalizationField?(r.field=M(t,r.field,"norm",r.normalizationField),r.normalizationField=null):r.field?r.field=M(t,r.field,"avg"):(r.field=S(t,r.valueExpression,"avg"),r.valueExpression=null)}return r},v=t=>{for(const e of t)if("size"===e.type)return e;return null},O=t=>{for(const e of t)if("cluster_count"===e.field)return!0;return!1},j=(t,e)=>{const i=[new h.a({value:0,size:0}),new h.a({value:1})];if(Object(o.i)(e))return new l.a({field:"cluster_count",stops:[...i,new h.a({value:2,size:0})]});const s=Object.keys(e).reduce((s,r)=>({...s,[r]:[...i,new h.a({value:Math.max(2,e[r].minValue),size:t.clusterMinSize}),new h.a({value:Math.max(3,e[r].maxValue),size:t.clusterMaxSize})]}),{});return new x({field:"cluster_count",levels:s})},w=t=>{const e=e=>_.error(new r.a("Unsupported-renderer",e,{renderer:t}));if("unique-value"===t.type){if(t.field2||t.field3)return e("FeatureReductionCluster does not support multi-field UniqueValueRenderers"),!1}else if("class-breaks"===t.type){if(t.normalizationField){const i=t.normalizationType;if("field"!==i)return e("FeatureReductionCluster does not support a normalizationType of "+i),!1}}else if("simple"!==t.type)return e("FeatureReductionCluster does not support renderers of type "+t.type),!1;if(!g){if("valueExpression"in t&&t.valueExpression)return e("FeatureReductionCluster does not currently support renderer.valueExpression. Support will be added in a future release"),!1;if(("visualVariables"in t&&t.visualVariables||[]).some(t=>!(!("valueExpression"in t)||!t.valueExpression)))return e("FeatureReductionCluster does not currently support visualVariables with a valueExpression. Support will be added in a future release"),!1}return!0};function T(t,e){const{name:i,outStatistic:s}=e,{onStatisticField:n,onStatisticValueExpression:a,statisticType:o}=s;if(a){const e=Object(c.a)(a.toLowerCase());t.push({name:i,outStatistic:{onStatisticField:e,onStatisticValueExpression:a,statisticType:o}})}else n?t.push({name:i,outStatistic:{onStatisticField:n,statisticType:o}}):_.error(new r.a("mapview-unsupported-field","Unable to handle field",{field:e}))}function S(t,e,i){const s=Object(c.a)(e),r="mode"===i?"cluster_type_"+s:"cluster_avg_"+s;return t.some(t=>t.name===r)||t.push({name:r,outStatistic:{onStatisticField:s,onStatisticValueExpression:e,statisticType:i}}),r}function M(t,e,i,s){if("cluster_count"===e||t.some(t=>t.name===e))return e;const r=function(t,e,i){switch(t){case"avg":case"avg_angle":return"cluster_avg_"+e;case"mode":return"cluster_type_"+e;case"norm":{const t=i,s="field",r=e.toLowerCase()+",norm:"+s+","+t.toLowerCase();return"cluster_avg_"+Object(c.a)(r)}}}(i,e,s);return t.some(t=>t.name===r)||("norm"===i?t.push({name:r,outStatistic:{onStatisticField:e,onStatisticNormalizationField:s,statisticType:i}}):t.push({name:r,outStatistic:{onStatisticField:e,statisticType:i}})),r}},604:function(t,e,i){"use strict";i.d(e,"a",(function(){return h}));var s=i(76),r=i(184),n=i(248),a=i(29),o=i(300),c=i(533),l=i(565);class h extends l.a{constructor(t,e,i){super(t,e,i,c.D,c.D)}destroy(){super.destroy(),this._transforms&&h.TransformCache.release(this.key.hash)}setTransform(t,e){if(t.version===this.transforms.version)return;this.transforms.version=t.version;const i=e/(t.resolution*t.pixelRatio),n=this.transforms.tileMat3,[c,l]=t.toScreenNoRotation([0,0],[this.x,this.y]),h=this.width/this.rangeX*i,u=this.height/this.rangeY*i;Object(r.k)(n,h,0,0,0,u,0,c,l,1),Object(r.h)(this.transforms.dvs,t.displayViewMat3,n);const d=this.transforms.labelMat2d,f=t.getScreenTransform(d,e),p=Object(o.a)();Object(a.n)(p,[this.x,this.y],f),Object(s.d)(d),Object(s.h)(d,d,p),Object(s.e)(d,t.viewMat2d,d)}_createTransforms(){return h.TransformCache.acquire(this.key.hash)}}h.TransformCache=new class{acquire(t){return{refCount:1,version:-1,labelMat2d:Object(n.b)(),tileMat3:Object(n.b)(),dvs:Object(n.b)()}}release(t){}}},605:function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var s=i(3),r=i(533);const n=2147483647;class a{constructor(t){this._head=t,this._cursor=t}static from(t,e=0,i=t.byteLength/o.BYTES_PER_RECORD-e){const s=new o(new Int32Array(t,e*o.BYTES_PER_RECORD,i*o.ELEMENTS_PER_RECORD));return new a(s)}size(){let t=this._cursor,e=0;for(;t;)e+=t.size(),t=t._link;return e}get id(){return this._cursor.id}set id(t){this._cursor.id=t}get materialKey(){return this._cursor.materialKey}set materialKey(t){this._cursor.materialKey=t}get insertAfter(){return this._cursor.insertAfter}get indexFrom(){return this._cursor.indexFrom}set indexFrom(t){this._cursor.indexFrom=t}get indexCount(){return this._cursor.indexCount}set indexCount(t){this._cursor.indexCount=t}get vertexFrom(){return this._cursor.vertexFrom}set vertexFrom(t){this._cursor.vertexFrom=t}get vertexCount(){return this._cursor.vertexCount}set vertexCount(t){this._cursor.vertexCount=t}get sortKey(){return this._cursor.sortKey}set sortKey(t){this._cursor.sortKey=t}get index(){return this._cursor._indexStart+this._cursor._index}seekIndex(t){let e=t;for(this._cursor=this._head;this._cursor;){const t=this._cursor.size();if(e<t)return this._cursor._index=e,!0;e-=t,this._cursor=this._cursor._link}return!1}forEach(t){const e=this.getCursor();for(;e.next();)t(e)}link(t){if(!this._head)return void(this._head=t._head);let e=this._head;for(;e._link;)e=e._link;e._link=t._head,e._link._indexStart=e._indexStart+e.size()}getCursor(){return this.copy()}lookup(t){for(this._cursor=this._head;this._cursor&&!this._cursor.lookup(t);){if(!this._cursor._link)return!1;this._cursor=this._cursor._link}return!!this._cursor}copy(){var t;const e=new a(null==(t=this._head)?void 0:t.copy());if(!e._head)return e;let i=e._head,s=e._head._link;for(;s;)i._link=s.copy(),i=s,s=i._link;return e}next(){return!!this._cursor&&(!!this._cursor.next()||!!this._cursor._link&&(this._cursor=this._cursor._link,this.next()))}peekId(){var t;return null!=(t=this._cursor.peekId())?t:this._cursor._link.peekId()}delete(t){let e=this._head,i=null;for(;e;){if(e.delete(t))return e.isEmpty()&&(Object(s.j)(i)&&(i._link=e._link),e===this._head&&(this._head=e._link),e===this._cursor&&(this._cursor=e._link)),!0;i=e,e=e._link}return!1}}a.ELEMENTS_PER_RECORD=r.d,a.BYTES_PER_RECORD=a.ELEMENTS_PER_RECORD*Int32Array.BYTES_PER_ELEMENT;class o{constructor(t){this._link=null,this._index=-1,this._indexStart=0,this._deletedCount=0,this._offsets={instance:null},this._packedRecords=t}static from(t,e=0,i=t.byteLength/this.BYTES_PER_RECORD-e){return new o(new Int32Array(t,e*this.BYTES_PER_RECORD,i*this.ELEMENTS_PER_RECORD))}delete(t){const e=this._index,i=this.lookup(t);if(i)for(this.id=n,++this._deletedCount;this.next()&&this.id===t;)this.id=n,++this._deletedCount;return this._index=e,i}isEmpty(){return this._deletedCount===this.size()}link(t){this._link?this._link.link(t):this._link=t}lookup(t){if(Object(s.i)(this._offsets.instance)){this._offsets.instance=new Map;const t=this.copy();t._index=-1;let e=0;for(;t.next();)t.id!==e&&(this._offsets.instance.set(t.id,t._index),e=t.id)}if(!this._offsets.instance.has(t))return!1;const e=this._index;return this._index=this._offsets.instance.get(t),this.id!==n||(this._index=e,!1)}get id(){return this._packedRecords[this._index*o.ELEMENTS_PER_RECORD]}set id(t){this._packedRecords[this._index*o.ELEMENTS_PER_RECORD]=t}get materialKey(){return this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+1]}set materialKey(t){this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+1]=t}get insertAfter(){return this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+2]}get indexFrom(){return this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+3]}set indexFrom(t){this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+3]=t}get indexCount(){return this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+4]}set indexCount(t){this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+4]=t}get vertexFrom(){return this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+5]}set vertexFrom(t){this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+5]=t}get vertexCount(){return this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+6]}set vertexCount(t){this._packedRecords[this._index*o.ELEMENTS_PER_RECORD+6]=t}get sortKey(){return this._packedRecordsF32||(this._packedRecordsF32=new Float32Array(this._packedRecords.buffer)),this._packedRecordsF32[this._index*o.ELEMENTS_PER_RECORD+7]}set sortKey(t){this._packedRecordsF32||(this._packedRecordsF32=new Float32Array(this._packedRecords.buffer)),this._packedRecordsF32[this._index*o.ELEMENTS_PER_RECORD+7]=t}get index(){return this._index}size(){return this._packedRecords.length/o.ELEMENTS_PER_RECORD}next(){for(;++this._index<this.size()&&this.id===n;);return this._index<this.size()}peekId(){const t=(this._index+1)*o.ELEMENTS_PER_RECORD;return t>=this._packedRecords.length?0:this._packedRecords[t]}getCursor(){return this.copy()}copy(){const t=new o(this._packedRecords);return t._indexStart=this._indexStart,t._link=this._link,t._index=this._index,t._offsets=this._offsets,t._deletedCount=this._deletedCount,t}}o.ELEMENTS_PER_RECORD=r.d,o.BYTES_PER_RECORD=o.ELEMENTS_PER_RECORD*Int32Array.BYTES_PER_ELEMENT},606:function(t,e,i){"use strict";i.d(e,"a",(function(){return d}));var s=i(9),r=i(4),n=i(340),a=i(72),o=i(584),c=i(35),l=i(309),h=i(559);const u=r.a.getLogger("esri/views/2d/engine/webgl/util/Matcher");async function d(t,e,i){switch(t.type){case"simple":return f.fromBasicRenderer(t,e,i);case"map":return y.fromUVRenderer(t,e,i);case"interval":return m.fromCBRenderer(t,e,i);case"dictionary":return x.fromDictionaryRenderer(t,e,i);case"subtype":return p.fromSubtypes(t,e,i)}}class f{constructor(){this.type="feature",this._defaultResult=null}static async fromBasicRenderer(t,e,i){const s=new f;if(t.symbol){const r=await Object(o.a)(t.symbol,i),n=e.createTemplateGroup(r,null);s.setDefault(n)}return s}size(){return 1}getDefault(){return this._defaultResult}setDefault(t){this._defaultResult=t}match(t,e,i,s,r){return this.getDefault()}async analyze(t,e,i,s,r){return null}}class p extends f{constructor(t,e){super(),this._subMatchers=t,this._subtypeField=e}static async fromSubtypes(t,e,i){const s=new Map,r=[];for(const n in t.renderers){const a=parseInt(n,10),o=d(t.renderers[n],e,i).then(t=>s.set(a,t));r.push(o)}return await Promise.all(r),new p(s,t.subtypeField)}match(t,e,i,s,r){const n=e.readAttribute(this._subtypeField),a=this._subMatchers.get(n);return a?a.match(t,e,i,s,r):null}}class m extends f{constructor(t,e,i,s){super(),this.type="interval",this._intervals=[],this._isMaxInclusive=e,this._fieldIndex=s,this._field=t,this._normalizationInfo=i}static async fromCBRenderer(t,e,i){const{isMaxInclusive:s,normalizationField:r,normalizationTotal:n,normalizationType:a}=t,c=t.field,l=new m(c,s,{normalizationField:r,normalizationTotal:n,normalizationType:a},t.fieldIndex),h=await Object(o.a)(t.backgroundFillSymbol,i);await Promise.all(t.intervals.map(async t=>{const s=await Object(o.a)(t.symbol,i),r=await e.createTemplateGroup(s,h),n={min:t.min,max:t.max};l.add(n,r)}));const u=await Object(o.a)(t.defaultSymbol,i);if(u){const t=await e.createTemplateGroup(u,h);l.setDefault(t)}return l}add(t,e){this._intervals.push({interval:t,result:e}),this._intervals.sort((t,e)=>t.interval.min-e.interval.min)}size(){return super.size()+this._intervals.length}match(t,e,i,s,r){if(null==this._fieldIndex&&!this._field)return this.getDefault();const n=null!=this._fieldIndex?e.getComputedNumericAtIndex(this._fieldIndex):this._getValueFromField(e);if(!n&&(null==n||isNaN(n)))return this.getDefault();for(let a=0;a<this._intervals.length;a++){const{interval:t,result:e}=this._intervals[a],i=n>=t.min,s=this._isMaxInclusive?n<=t.max:n<t.max;if(i&&s)return e}return this.getDefault()}_needsNormalization(){const t=this._normalizationInfo;return t&&(t.normalizationField||t.normalizationTotal||t.normalizationType)}_getValueFromField(t){const e=t.readAttribute(this._field);if(!this._needsNormalization()||null==e)return e;const{normalizationField:i,normalizationTotal:s,normalizationType:r}=this._normalizationInfo,n=!!i&&t.readAttribute(i);if(r)switch(r){case"esriNormalizeByField":return n?e/n:void 0;case"esriNormalizeByLog":return Math.log(e)*Math.LOG10E;case"esriNormalizeByPercentOfTotal":return e/s*100;default:return void u.error("Found unknown normalization type: "+r)}else u.error("Normalization is required, but no type was set!")}}class y extends f{constructor(t,e,i){super(),this.type="map",this._nullResult=null,this._resultsMap=new Map,this._fieldsIndex=i,this._fields=t,this._seperator=e||""}static async fromUVRenderer(t,e,i){const s=t.fieldDelimiter,r=[t.field];t.field2&&r.push(t.field2),t.field3&&r.push(t.field3);const n=await Object(o.a)(t.backgroundFillSymbol,i),a=new y(r,s,t.fieldIndex);await Promise.all(t.map.map(async t=>{const s=await Object(o.a)(t.symbol,i),r=await e.createTemplateGroup(s,n);"<Null>"===t.value?a.setNullResult(r):a.add(t.value,r)}));const c=await Object(o.a)(t.defaultSymbol,i);if(c){const t=await e.createTemplateGroup(c,n);a.setDefault(t)}return a}setNullResult(t){this._nullResult=t}add(t,e){this._resultsMap.set(t.toString(),e)}size(){return super.size()+this._resultsMap.size}match(t,e,i,s,r){if(null==this._fieldsIndex&&!this._fields)return this.getDefault();const n=null!=this._fieldsIndex?e.getComputedStringAtIndex(this._fieldsIndex):this._getValueFromFields(e);if(null!==this._nullResult&&(null==n||""===n||"<Null>"===n))return this._nullResult;if(!n&&null==n)return this.getDefault();const a=n.toString();return this._resultsMap.has(a)?this._resultsMap.get(a):this.getDefault()}_getValueFromFields(t){const e=[];for(const i of this._fields){const s=t.readAttribute(i);null==s||""===s?e.push("<Null>"):e.push(s)}return e.join(this._seperator)}}class x extends f{constructor(t,e,i,s){super(),this.type="dictionary",this._groupIdCache=new n.a(100),this._renderer=t,this._fieldMap=t.fieldMap,this._symbolFields=t.getSymbolFields(),this._templates=e,this._info=i,this._scaleFn=s}static async fromDictionaryRenderer(t,e,s){const r=(await Promise.resolve().then(i.bind(null,303))).default.fromJSON(t.renderer);await r.fetchResources({spatialReference:s.spatialReference,fields:s.fields});const n=await async function(t,e){const i=t||1;if("number"==typeof i)return(t,e,s)=>i;const s=await Object(a.d)(i,e.spatialReference,e.fields);return(t,i,r)=>Object(l.a)(s,t,{$view:r},e.geometryType,i)||1}(r.scaleExpression,s);return new x(r,e,s,n)}async _analyzeFeature(t,e,i,r){const n=t.readLegacyFeature(),a=this._scaleFn(n,e,i),l=this._attributeHash(n)+"-"+a,d=this._groupIdCache.get(l);if(d)return d;const f={...i,spatialReference:this._info.spatialReference,abortOptions:r,fields:this._info.fields},p=await this._renderer.getSymbolAsync(n,f),m=Object(h.c)(p,this._renderer),y=Object(o.a)(m,this._info,r).then(t=>{if("expanded-cim"!==t.type)return u.error(new s.a("mapview-bad-type",`Found unexpected type ${t.type} in dictionary response`)),null;t.hash+="-"+a;for(const e of t.layers)e.scaleFactor=a,e.templateHash+="-"+a,"text"===e.type&&"string"==typeof e.text&&e.text.indexOf("[")>-1&&(e.text=Object(c.c)(this._fieldMap,e.text,e.cim.textCase));return this._templates.createTemplateGroup(t,null)});return this._groupIdCache.put(l,y,1),y}async analyze(t,e,i,s,r){const n=e.getCursor(),a=[];for(;n.next();)a.push(this._analyzeFeature(n,i,s,r));return Promise.all(a)}match(t,e,i,s,r){return null}_attributeHash(t){let e="";for(const i of this._symbolFields){const s=this._fieldMap[i];s&&(e+=t.attributes[s]+"-")}return e}}},607:function(t,e,i){"use strict";i.d(e,"a",(function(){return u}));var s=i(3),r=i(184),n=i(248),a=i(300),o=(i(545),i(546),i(5),i(544),i(543),i(549),i(548),i(542)),c=(i(547),i(569)),l=i(602);function h(t,e,i){const s={target:3553,pixelFormat:6408,internalFormat:6408,dataType:5121,wrapMode:33071};return e&&i&&(s.width=e,s.height=i),new o.a(t,s)}class u extends c.a{constructor(t=null,e,i=!0){super(),this.requestRenderOnSourceChangedEnabled=i,this._textureInvalidated=!0,this.stencilRef=0,this.coordScale=[1,1],this._height=void 0,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._width=void 0,this.x=0,this.y=0,this.blendFunction=e,this.source=t,this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null)}get isSourceScaled(){return this.width!==this.sourceWidth||this.height!==this.sourceHeight}get height(){return void 0!==this._height?this._height:this.sourceHeight}set height(t){this._height=t}get source(){return this._source}set source(t){this._source=t,this.invalidateTexture()}get sourceHeight(){return this._source instanceof HTMLImageElement?this._source.naturalHeight:this._source.height}get sourceWidth(){return this._source instanceof HTMLImageElement?this._source.naturalWidth:this._source.width}get width(){return void 0!==this._width?this._width:this.sourceWidth}set width(t){this._width=t}beforeRender(t){super.beforeRender(t),this.updateTexture(t.context)}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRenderOnSourceChangedEnabled&&this.requestRender())}_createTransforms(){return{dvs:Object(n.b)()}}setTransform(t){const e=Object(r.b)(this.transforms.dvs),[i,s]=t.toScreenNoRotation([0,0],[this.x,this.y]),n=this.resolution/this.pixelRatio/t.resolution,o=n*this.width,c=n*this.height,l=Math.PI*this.rotation/180;Object(r.c)(e,e,Object(a.b)(i,s)),Object(r.c)(e,e,Object(a.b)(o/2,c/2)),Object(r.j)(e,e,-l),Object(r.c)(e,e,Object(a.b)(-o/2,-c/2)),Object(r.g)(e,e,Object(a.b)(o,c)),Object(r.h)(this.transforms.dvs,t.displayViewMat3,e)}setSamplingProfile(t){this._texture&&(t.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(t.samplingMode))}bind(t,e){this._texture&&t.bindTexture(this._texture,e)}updateTexture(t){var e;if(!this.stage)return null==(e=this._texture)||e.dispose(),void(this._texture=null);if(!this._textureInvalidated)return;this._textureInvalidated=!1,this._texture||(this.source?this._texture=h(t,this.sourceWidth,this.sourceHeight):this._texture=h(t));const i=this.source;if(i){if(this._texture.resize(this.sourceWidth,this.sourceHeight),(r=i)&&"render"in r)if(i instanceof l.a){const t=i.getRenderedRasterPixels();this._texture.setData(Object(s.j)(t)?t.renderedRasterPixels:null)}else this._texture.setData(function(t){const e=document.createElement("canvas");return e.width=t.width,e.height=t.height,t.render(e.getContext("2d")),e}(i));else(function(t){return t&&!("render"in t)})(i)&&this._texture.setData(i);this.ready()}else this._texture.setData(null);var r}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}}},608:function(t,e,i){"use strict";i.d(e,"a",(function(){return p}));i(403),i(336);var s=i(124),r=(i(401),i(402),i(533)),n=i(534),a=i(538);const o=new Map;o.set(n.d.MARKER,{multiplier:1,indicesPerRecord:6,verticesPerRecord:4}),o.set(n.d.LINE,{multiplier:1,indicesPerRecord:24,verticesPerRecord:8}),o.set(n.d.FILL,{multiplier:1,indicesPerRecord:10,verticesPerRecord:10}),o.set(n.d.TEXT,{multiplier:8,indicesPerRecord:6,verticesPerRecord:4}),o.set(n.d.LABEL,{multiplier:8,indicesPerRecord:6,verticesPerRecord:4});var c=i(560);class l{constructor(t,e,i){this._start={index:0,vertex:0};const s=function(t,e,i){const{indicesPerRecord:s,multiplier:n,verticesPerRecord:a}=o.get(t);return{recordBytes:i*r.d*Uint32Array.BYTES_PER_ELEMENT,indexBytes:n*s*i*Uint32Array.BYTES_PER_ELEMENT,vertexBytes:n*a*i*e}}(t,e,i),n=e/4;this.geometryType=t,this._records=new c.a(Int32Array,s.recordBytes),this._indices=new c.a(Uint32Array,s.indexBytes),this._vertices=new c.a(Uint32Array,s.vertexBytes),this._metrics=new c.a(Float32Array,0),this._strideInt=n}serialize(t){const e=this._records.buffer(),i=this._indices.buffer(),s=this._vertices.buffer(),r=this._metrics.length?this._metrics.buffer():null,n=4*this._strideInt;return t.push(e,i,s),{stride:n,records:e,indices:i,vertices:s,metrics:r}}get strideInt(){return this._strideInt}get recordCount(){return this._records.length/r.d}get vertexCount(){return this._vertices.length/this._strideInt}get indexCount(){return this._indices.length}get indexWriter(){return this._indices}get vertexWriter(){return this._vertices}get metricWriter(){return this._metrics}vertexEnsureSize(t){this._vertices.ensureSize(t)}indexEnsureSize(t){this._indices.ensureSize(t)}recordStart(){this._start.index=this._indices.length,this._start.vertex=this._vertices.length}recordEnd(t,e,i,s,r,n,a,o){this._records.push(t),this._records.push(e),this._records.push(i),this._records.push(s),this._records.push(r),this._records.push(n),this._records.push(a),this._records.writeF32(o)}writeIndex(t){this._indices.push(t)}writeVertex(t){this._vertices.push(t)}writeVertexF32(t){this._vertices.writeF32(t)}copyLastFrom(t,e,i){const s=t._records.length-r.d,n=t._records.getValue(s),a=t._records.getValue(s+1),o=t._records.getValue(s+2),c=t._records.getValue(s+4),l=t._records.getValue(s+6),h=t._records.getValue(s+7),u=this._vertices.length,d=(t._start.vertex-this._vertices.length)/this._strideInt,f=this._indices.length,p=this.vertexCount;for(let r=t._start.index;r!==t._indices.length;r++){const e=t._indices.getValue(r);this._indices.push(e-d)}for(let r=t._start.vertex;r!==t._vertices.length;r++){const e=t._vertices.getValue(r);this._vertices.push(e)}for(let r=u;r<=this._vertices.length;r+=this._strideInt)this._vertices.i1616Add(r,e,i);this._records.push(n),this._records.push(a),this._records.push(o),this._records.push(f),this._records.push(c),this._records.push(p),this._records.push(l),this._records.push(h)}}var h=i(557),u=i(597);function d(t){switch(t){case 1:case 8:case 32:return-1;case 2:case 64:return 0;case 4:case 16:case 128:return 1}}function f(t){switch(t){case 1:case 2:case 4:return-1;case 8:case 16:return 0;case 32:case 64:case 128:return 1}}class p{constructor(t,e,i,s,r){this._hasDotDensity=!1,this._hasAggregate=!1,this.hasRecords=!1,this._data={self:new Map,neighbors:new Array},this._current={geometryType:0,writer:null,overlaps:0,start:0,insertAfter:0,sortKey:0,id:0,materialKey:0,indexStart:0,vertStart:0,isDotDensity:!1,bufferingEnabled:!1,metricBoxLenPointer:0},this.hint=e,this.tileKey=t,this._hasDotDensity=i,this._hasAggregate=s,this._pixelBufferEnabled=r}get hasAggregates(){return this._hasAggregate}get hasPixelBufferEnabled(){return this._pixelBufferEnabled}serialize(t){const e=[];return e.push(this._serializeTileVertexData(this.tileKey,this.tileKey,this._data.self)),this._data.neighbors.forEach((i,r)=>{const n=1<<r,a=d(n),o=f(n),c=Object(u.a)(new s.a(this.tileKey),a,o,t),l=this._serializeTileVertexData(this.tileKey,c.id,i.vertexData);l.message.bufferIds=i.displayIds,e.push(l)}),e}_serializeTileVertexData(t,e,i){var s,r,a,o,c;const l=new Array;return{message:{tileKeyOrigin:t,tileKey:e,data:{[n.d.MARKER]:null==(s=i.get(n.d.MARKER))?void 0:s.serialize(l),[n.d.FILL]:null==(r=i.get(n.d.FILL))?void 0:r.serialize(l),[n.d.LINE]:null==(a=i.get(n.d.LINE))?void 0:a.serialize(l),[n.d.TEXT]:null==(o=i.get(n.d.TEXT))?void 0:o.serialize(l),[n.d.LABEL]:null==(c=i.get(n.d.LABEL))?void 0:c.serialize(l)}},transferList:l}}featureStart(t,e){this._current.insertAfter=t,this._current.sortKey=e}featureEnd(){}recordStart(t,e,i,s,r){this._current.writer=this._getVertexWriter(i,s),this._current.overlaps=0,this._current.indexStart=this._current.writer.indexCount,this._current.vertStart=this._current.writer.vertexCount,this._current.bufferingEnabled=r,this._current.id=t,this._current.materialKey=e,this._current.geometryType=i,this._current.isDotDensity=!1,this._current.writer.recordStart()}recordCount(){return this._current.writer.recordCount}vertexCount(){return this._current.writer.vertexCount}indexCount(){return this._current.writer.indexCount}vertexEnsureSize(t){this._current.writer.vertexEnsureSize(t)}indexEnsureSize(t){this._current.writer.indexEnsureSize(t)}vertexBounds(t,e,i,s){this._current.bufferingEnabled&&this._addOverlap(t,e,i,s)}vertexWrite(t){this._current.writer.writeVertex(t)}vertexWriteF32(t){this._current.writer.writeVertexF32(t)}vertexEnd(){}vertexWriter(){return this._current.writer.vertexWriter}indexWrite(t){this._current.writer.writeIndex(t)}indexWriter(){return this._current.writer.indexWriter}metricWriter(){return this._current.writer.metricWriter}metricStart(t,e,i,s,r,a,o,c){this._current.writer=this._getVertexWriter(n.d.LABEL,!1);const l=this._current.writer.metricWriter;l.push(Object(h.b)(t)),l.push(e),l.push(i),l.push(s),l.push(r),l.push(a),l.push(o),l.push(c),l.push(255),this._current.metricBoxLenPointer=l.push(0)}metricEnd(){const t=this._current.writer.metricWriter;0===t.getValue(this._current.metricBoxLenPointer)&&t.seek(t.length-10)}metricBoxWrite(t,e,i,s){const r=this._current.writer.metricWriter;r.incr(this._current.metricBoxLenPointer),r.push(0),r.push(0),r.push(t),r.push(e),r.push(i),r.push(s)}recordEnd(){const t=this._current.indexStart,e=this._current.writer.indexCount;if(t===e)return!1;this.hasRecords=!0;const i=e-t,s=this._current.vertStart,o=this._current.writer.vertexCount-s;if(this._current.writer.recordEnd(this._current.id,this._current.materialKey,this._current.insertAfter,t,i,s,o,this._current.sortKey),!this._pixelBufferEnabled||this._hasAggregate||0===this._current.overlaps||this._current.geometryType===n.d.LABEL)return!0;const c=this._current.writer;for(let n=0;n<8;n++){const t=1<<n;if(this._current.overlaps&t){this._data.neighbors[n]||(this._data.neighbors[n]={vertexData:new Map,displayIds:new Set});const e=this._data.neighbors[n],i=this._current.geometryType;if(!e.vertexData.has(i)){const t=Object(a.l)(i,this._current.isDotDensity).geometry,s=new l(i,t,r.n);e.vertexData.set(i,s)}const s=e.vertexData.get(this._current.geometryType),o=8,h=512*-d(t)*o,u=512*-f(t)*o;s.copyLastFrom(c,h,u),e.displayIds.add(this._current.id)}}return!0}_addOverlap(t,e,i,s){const n=255^((t<0+i?148:t>=r.D-i?41:189)|(e<0+s?224:e>=r.D-s?7:231));this._current.overlaps|=n}_getVertexWriter(t,e){if(!this._data.self.has(t)){const e=this._data.self,i=Object(a.l)(t,this._hasDotDensity).geometry;e.set(t,new l(t,i,this.hint.records))}return this._data.self.get(t)}}},609:function(t,e,i){"use strict";i.d(e,"a",(function(){return F}));i(5);var s=i(3),r=i(12),n=i(564),a=i(9),o=i(4),c=i(49),l=i(18),h=i(550),u=i(540),d=i(533),f=i(534),p=i(536),m=i(537),y=i(632),x=i(541);function _(t){return t.length-1}function g(t){let e=0;for(let i=0;i<_(t);i++)e+=b(t,i);return e}function b(t,e,i=1){const[s,r]=function(t,e){return t[e+1]}(t,e);return Math.sqrt(s*s+r*r)*i}class v{constructor(t,e,i,s,r){this._segments=t,this._index=e,this._distance=i,this._xStart=s,this._yStart=r,this._done=!1}static create(t){return new v(t,0,0,t[0][0],t[0][1])}clone(){return new v(this._segments,this._index,this._distance,this.xStart,this.yStart)}equals(t){return this._index===t._index||t._index===this._index-1&&(0===this._distance||1===t._distance)||t._index===this._index+1&&(1===this._distance||0===t._distance)}leq(t){return this._index<t._index||this._index===t._index&&this._distance<=t._distance}geq(t){return this._index>t._index||this._index===t._index&&this._distance>=t._distance}get _segment(){return this._segments[this._index+1]}get angle(){const t=this.dy,e=(0*t+-1*-this.dx)/(1*this.length);let i=Math.acos(e);return t>0&&(i=2*Math.PI-i),i}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){const{dx:t,dy:e}=this;return Math.sqrt(t*t+e*e)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1<_(this._segments)}next(){return this.hasNext()?(this._xStart+=this.dx,this._yStart+=this.dy,this._distance=0,this._index+=1,this):null}prev(){return this.hasPrev()?(this._index-=1,this._xStart-=this.dx,this._yStart-=this.dy,this._distance=1,this):(this._done=!0,null)}_seekBackwards(t,e){const i=this.backwardLength;if(t<=i)return this._distance=(i-t)/this.length,this;let s=this.backwardLength;for(;this.prev();){if(s+this.length>t)return this._seekBackwards(t-s);s+=this.length}return this._distance=0,e?this:null}seek(t,e=!1){if(t<0)return this._seekBackwards(Math.abs(t),e);if(t<=this.remainingLength)return this._distance=(this.backwardLength+t)/this.length,this;let i=this.remainingLength;for(;this.next();){if(i+this.length>t)return this.seek(t-i,e);i+=this.length}return this._distance=1,e?this:null}}function O(t,e,i){const s=g(t),r=v.create(t),n=s/2,a=(s-e)/2,o=Math.floor(a/e),c=n-o*e;r.seek(c);for(let l=-o;l<=o;l++)r.x<512&&r.x>=0&&r.y<512&&r.y>=0&&i(r.clone(),l,n+l*e,s),r.seek(e)}function j(t,e){const i=1e-6;if(e<=0)return;const s=t.length;if(s<3)return;const r=[];let n=0;r.push(0);for(let u=1;u<s;u++)n+=Object(x.c)(t[u],t[u-1]),r.push(n);e=Math.min(e,.2*n);const a=[];a.push(t[0][0]),a.push(t[0][1]);const o=t[s-1][0],c=t[s-1][1],l=Object(x.h)([0,0],t[0],t[1]);Object(x.g)(l),t[0][0]+=e*l[0],t[0][1]+=e*l[1],Object(x.h)(l,t[s-1],t[s-2]),Object(x.g)(l),t[s-1][0]+=e*l[0],t[s-1][1]+=e*l[1];for(let u=1;u<s;u++)r[u]+=e;r[s-1]+=e;const h=.5*e;for(let u=1;u<s-1;u++){let n=0,o=0,c=0;for(let s=u-1;s>=0&&!(r[s+1]<r[u]-h);s--){const a=h+r[s+1]-r[u],l=r[s+1]-r[s],d=r[u]-r[s]<h?1:a/l;if(Math.abs(d)<i)break;const f=d*d,p=d*a-.5*f*l,m=d*l/e,y=t[s+1],x=t[s][0]-y[0],_=t[s][1]-y[1];n+=m/p*(y[0]*d*a+.5*f*(a*x-l*y[0])-f*d*l*x/3),o+=m/p*(y[1]*d*a+.5*f*(a*_-l*y[1])-f*d*l*_/3),c+=m}for(let a=u+1;a<s&&!(r[a-1]>r[u]+h);a++){const s=h-r[a-1]+r[u],l=r[a]-r[a-1],d=r[a]-r[u]<h?1:s/l;if(Math.abs(d)<i)break;const f=d*d,p=d*s-.5*f*l,m=d*l/e,y=t[a-1],x=t[a][0]-y[0],_=t[a][1]-y[1];n+=m/p*(y[0]*d*s+.5*f*(s*x-l*y[0])-f*d*l*x/3),o+=m/p*(y[1]*d*s+.5*f*(s*_-l*y[1])-f*d*l*_/3),c+=m}a.push(n/c),a.push(o/c)}a.push(o),a.push(c);for(let u=0,d=0;u<s;u++)t[u][0]=a[d++],t[u][1]=a[d++]}var w=i(577);const T=o.a.getLogger("esri.views.2d.engine.webgl.WGLLabelTemplate");const S=function(t){const e=new Map;return i=>(e.has(i)||e.set(i,t(i)),e.get(i))}(t=>{let e=0;if(0===t)return 1/0;for(;!(t%2);)e++,t/=2;return e}),M=t=>Math.floor(127*t+127),I=t=>Math.floor(10*t),R=t=>Math.round(t*(254/360));class L extends w.a{constructor(t,e,i,s){super(t,i.font.size,i.haloSize||0,i.color&&Object(u.d)(i.color)||0,i.haloColor&&Object(u.d)(i.haloColor)||0,i.horizontalAlignment,i.verticalAlignment,Object(y.a)(e.labelPlacement)?1:0,i.font.decoration,!1,i.angle||0,i.xoffset,i.yoffset,i.lineWidth,i.lineHeight,null,null,null,null,null),this._outLineLabelAngle=0,this._refPlacementPadding=0,this._refPlacementDirX=0,this._refPlacementDirY=0,this._refOffsetX=0,this._refOffsetY=0,this._zoomLevel=0,this.geometryType=f.d.LABEL;const r=function(t,e){const i=!!t.minScale&&e.scaleToZoom(t.minScale)||0;return Object(c.d)(i,0,25.5)}(e,s),n=function(t,e){const i=!!t.maxScale&&e.scaleToZoom(t.maxScale)||255;return Object(c.d)(i,0,25.5)}(e,s),a=e.labelPlacement,[o,p]=Object(h.b)(a);this._xAlignD=o,this._yAlignD=p,this._minZoom=r,this._maxZoom=n,this._refPlacementPadding=Object(l.c)(i.haloSize)+d.B;const x=m.b.load(t);x.sdf=!0,this._materialKey=x.data}static fromLabelClass(t,e){if("esriServerLinePlacementCenterAlong"===t.labelPlacement){const e=t.symbol;e.xoffset=0,e.yoffset=0,e.angle=0,e.font.decoration="none"}return new L(t.materialKey,t,t.symbol,e)}get _shapedBox(){return Object(s.q)(this._shapingInfo).bounds}setZoomLevel(t){this._zoomLevel=t}bindReferenceTemplate(t){let e=Object(h.e)(this._xAlignD),i=Object(h.g)(this._yAlignD);if(this._refOffsetX=0,this._refOffsetY=0,Object(s.i)(t))return void(this._refSymbolAndPlacementOffset=Object(p.b)(0,0,M(e),M(i)));if("circle"===t.boundsType&&(e||i)){const t=Math.sqrt(e*e+i*i);e/=t,i/=t}const r=Math.max(t.height,t.width),n=4*this._refPlacementPadding;this._refSymbolAndPlacementOffset=Object(p.b)(n,r,M(e),M(i)),this._referenceSize=r,this._refPlacementDirX=e,this._refPlacementDirY=i,this._refOffsetX=t.xOffset,this._refOffsetY=t.yOffset}_write(t,e){if(Object(s.i)(this._shapingInfo))return;const i=this._shapingInfo,r=e.getDisplayId(),n="esriGeometryPolygon"===e.geometryType?e.readLegacyCentroid():e.readLegacyGeometry();if(n)switch(this.current={out:t,inId:r,inShaping:i,zoomLevel:this._zoomLevel},e.geometryType){case"esriGeometryPolyline":this._placeLineLabels(n);break;case"esriGeometryPoint":case"esriGeometryPolygon":this._placePointLabels(n);break;default:((t,e="mapview-labeling")=>{T.error(new a.a(e,t))})("mapview-labeling",`Geometry of type ${e.geometryType} is not supported`)}}_isVisible(t,e){const i=I(this.current.zoomLevel);return I(t)<=i&&i<=I(e)}_placePointLabels(t){const{out:e,inId:i,inShaping:s}=this.current;this._writeGlyphs(e,i,t,s)}_placeLineLabels(t){const e=function(t,e){const i=e;for(let s=0;s<t.length;s++){let e=t[s];const r=[];r.push(e[0]);for(let t=1;t<e.length;t++){let[i,s]=r[t-1];i+=e[t][0],s+=e[t][1],r.push([i,s])}j(r,i);const n=[];n.push(r[0]);for(let t=1;t<r.length;t++){const[e,i]=r[t-1],[s,a]=r[t],o=Math.round(s-e),c=Math.round(a-i);n.push([o,c])}t[s]=n,e=n}return t}(t.paths,this.current.inShaping.bounds.width),i=this._placeSubdivGlyphs.bind(this),s=(this._shapedBox.width+128)/2;for(const r of e)O(r,s,i)}_placeSubdivGlyphs(t,e,i,s){const r=S(e),n=this._shapedBox.width/2,a=Math.min(i,s-i),o=Object(c.j)(a/(8+n/2)),l=0===e?o:Math.min(r,o),h=Math.max(this._minZoom,this.current.zoomLevel+1-l),u=this.current.zoomLevel-h,d=this._shapedBox.width/2*2**u;this.current.inShaping.isMultiline?0===e&&this._placeStraight(t,h):this._placeCurved(t,h,d)}_placeStraight(t,e){const{out:i,inId:s,inShaping:r}=this.current;this._writeGlyphs(i,s,t,r,e)}_placeCurved(t,e,i){const{out:s,inId:r}=this.current;s.metricStart(r,e,t.x,t.y,0,0,0,0);const n=t.clone(),a=t.angle*(180/Math.PI)%360,o=(t.angle*(180/Math.PI)+180)%360;this._outLineLabelAngle=R(a),this._placeFirst(n,e,1),this._placeBack(t,n,e,i,1),this._placeForward(t,n,e,i,1),this._outLineLabelAngle=R(o),this._placeFirst(n,e,0),this._placeBack(t,n,e,i,0),this._placeForward(t,n,e,i,0),s.metricEnd()}_placeBack(t,e,i,s,r){const n=t.clone();let a=t.backwardLength+0;for(;n.prev()&&!(a>=s);)this._placeOnSegment(n,e,a,i,-1,r),a+=n.length+0}_placeForward(t,e,i,s,r){const n=t.clone();let a=t.remainingLength+0;for(;n.next()&&!(a>=s);)this._placeOnSegment(n,e,a,i,1,r),a+=n.length+0}_placeFirst(t,e,i){const s=t,r=this.current.inShaping,n=r.glyphs,a=this.current.zoomLevel,{out:o,inId:l}=this.current;for(const h of n){const n=h.x>r.bounds.x?i:1-i,u=n*t.remainingLength+(1-n)*t.backwardLength,d=Math.abs(h.x+h.width/2-r.bounds.x),f=Math.max(0,a+Object(c.j)(d/(u+0))),p=Math.max(e,f);if(h.maxZoom=25,h.angle=t.angle+(1-i)*Math.PI,h.minZoom=p,this._writeGlyph(o,l,s.x,s.y,h),i&&this._isVisible(h.minZoom,h.maxZoom)){const t=h.bounds;o.metricBoxWrite(t.center[0],t.center[1],t.width,t.height)}}}_placeOnSegment(t,e,i,s,r,n){const a=this.current.inShaping.glyphs,{out:o,inId:l}=this.current,h=this.current.inShaping,u=this.current.zoomLevel,d=t.dx/t.length,f=t.dy/t.length,p={x:t.x+i*-r*d,y:t.y+i*-r*f};for(const m of a){const a=m.x>h.bounds.x?n:1-n;if(!(a&&1===r||!a&&-1===r))continue;const d=Math.abs(m.x+m.width/2-h.bounds.x),f=Math.max(0,u+Object(c.j)(d/i)-.1),y=Math.max(s,u+Object(c.j)(d/(i+t.length+0)));if(0!==f&&(m.angle=t.angle+(1-n)*Math.PI,m.minZoom=y,m.maxZoom=f,this._writeGlyph(o,l,p.x,p.y,m),n&&this._isVisible(m.minZoom,m.maxZoom))){const i=m.bounds,s=t.x-e.x,r=t.y-e.y;o.metricBoxWrite(i.center[0]+s,i.center[1]+r,i.width,i.height)}}}_writeGlyphs(t,e,i,s,r=this._minZoom){if(i.x<0||i.x>=512||i.y<0||i.y>=512)return;const n=i.x+this._refOffsetX,a=i.y-this._refOffsetY;for(const h of s.glyphs)h.minZoom=r,h.maxZoom=this._maxZoom,this._writeGlyph(t,e,n,a,h);const o=this._refPlacementDirX,c=this._refPlacementDirY,l=s.boundsT;t.metricStart(e,r,n,a,o,c,this._referenceSize,this._materialKey),t.metricBoxWrite(l.center[0],l.center[1],l.width,l.height),t.metricEnd()}_writeVertexCommon(t,e,i,s){const r=this._color,n=this._haloColor,a=Object(p.b)(0,0,this._size,this._haloSize),o=Math.max(s.minZoom,this._minZoom),c=Math.min(s.maxZoom,this._maxZoom),l=Object(p.b)(I(o),I(c),this._outLineLabelAngle,0);t.vertexWrite(i),t.vertexWrite(e),t.vertexWrite(r),t.vertexWrite(n),t.vertexWrite(a),t.vertexWrite(this._refSymbolAndPlacementOffset),t.vertexWrite(l)}}var C=i(580),z=i(582),E=i(557);class F{constructor(t,e,i){this._loadPromise=Object(n.a)(),this._geometryType=t,this._idField=e,this._templateStore=i}update(t,e){Object(s.j)(t.mesh.labels)&&(this._labelTemplates=this._createLabelTemplates(t.mesh.labels,e)),this._schema=t}_createLabelTemplates(t,e){const i=new Map;if("simple"===t.type){for(const s of t.classes){const t=L.fromLabelClass(s,e);i.set(s.index,t)}return i}for(const s in t.classes){const r=t.classes[s];for(const t of r){const s=L.fromLabelClass(t,e);i.set(t.index,s)}}return i}get templates(){return this._templateStore}async analyze(t,e,i,n,a,o){if(Object(r.n)(o))return;let c;"dictionary"===e.type&&(c=await e.analyze(this._idField,t.copy(),n,a,o));let l=0;for(;t.next();){let r;if(r=c?c[l++]:Object(s.j)(i)&&Object(E.c)(t.getDisplayId())&&1!==t.readAttribute("cluster_count")?i.match(this._idField,t,this._geometryType,n,a):e.match(this._idField,t,this._geometryType,n,a),t.setGroupId(r),Object(z.b)(r)){const e=this._templateStore.getDynamicTemplateGroup(r);for(const i of e)i&&i.analyze&&i.analyze(this._templateStore,t,n,a)}}return await this._loadPromise,this._templateStore.finalize(o)}async analyzeGraphics(t,e,i,s,n){if(Object(r.n)(n))return;const a=t.getCursor();for(e&&await e.analyze(this._idField,a.copy(),i,s,n);a.next();){let t=a.getGroupId();if(null!=t&&-1!==t||(t=e.match(this._idField,a,a.geometryType,i,s),a.setGroupId(t)),Object(z.b)(t)){const e=this._templateStore.getDynamicTemplateGroup(t);for(const t of e)t&&t.analyze&&t.analyze(this._templateStore,a,i,s)}a.setGroupId(t)}return await this._loadPromise,this._templateStore.finalize(n)}writeGraphic(t,e,i){const s=e.getGroupId(),r=e.getDisplayId(),n=this._templateStore.getTemplateGroup(s);if(t.featureStart(e.insertAfter,0),null!=r){if(Object(z.b)(s))for(const t of n)t.bindFeature(e,null,null);if(n){for(const s of n)s&&s.write(t,e,i);t.featureEnd()}}}writeCursor(t,e,i,r,n,a){const o=e.getGroupId(),c=e.getDisplayId(),l=this._templateStore.getTemplateGroup(o),h=this._schema.mesh.sortKey;let u=0;if(Object(s.j)(h)&&(u=null!=h.fieldIndex?e.getComputedNumericAtIndex(h.fieldIndex):null!=h.field?e.readAttribute(h.field):e.readAttribute(this._idField),u*="asc"===h.order?1:-1),t.featureStart(0,null==u||isNaN(u)?0:u),null!=c&&l){if(Object(z.b)(o))for(const t of l)t.bindFeature(e,i,r);for(const i of l)i.write(t,e,n);if(Object(s.j)(a)&&t.hasRecords){const i=a&&this._findLabelRef(l);this._writeLabels(t,e,a,i,n)}t.featureEnd()}}_findLabelRef(t){for(const e of t)if(e instanceof C.a)return e;return null}_writeLabels(t,e,i,r,n){for(const a of i)if(Object(s.j)(a)&&a){const{glyphs:i,rtl:s,index:o}=a,c=this._labelTemplates.get(o);c.setZoomLevel(n),c.bindReferenceTemplate(r),c.bindTextInfo(i,s),c.write(t,e,null)}}}},610:function(t,e,i){"use strict";i.d(e,"a",(function(){return I}));var s=i(12),r=i(234),n=i(9),a=i(5),o=i(4),c=i(3),l=(i(545),i(546)),h=(i(544),i(543),i(549),i(548),i(542)),u=(i(547),i(533)),d=i(538),f=i(573);const p=o.a.getLogger("esri.views.2d.engine.webgl.AttributeStoreView"),m=Object(f.b)(f.a,p),y=t=>2147483647&t;class x{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:n}=t,a=Object(d.j)(r);this.shared=i,this.pixelType=r,this.size=e,this.textureOnly=n,n||(this.data=new a(Object(c.q)(s))),this._resetRange()}destroy(){Object(c.a)(this._texture,t=>t.dispose());for(const t in this._fbos)Object(c.a)(this._fbos[t],e=>{"0"===t&&e.detachColorTexture(),e.dispose()}),this._fbos[t]=null;this._texture=null}get _textureDesc(){return{target:3553,wrapMode:33071,pixelFormat:6408,dataType:this.pixelType,samplingMode:9728,width:this.size,height:this.size}}setData(t,e,i){const s=y(t),r=Object(c.q)(this.data),n=s*this.texelSize+e;!r||n>=r.length||(r[n]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(Object(c.i)(this.data))return null;const i=y(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return Object(c.r)(this._texture,()=>this._initTexture(t))}getFBO(t,e=0){if(Object(c.i)(this._fbos[e])){const i={colorTarget:0,depthStencilTarget:0},s=0===e?this.getTexture(t):this._textureDesc;this._fbos[e]=new l.a(t,i,s)}return this._fbos[e]}get locked(){return!(5121!==this.pixelType||!this.shared||this.textureOnly||!Object(a.a)("esri-atomics")||!this.data)&&1===Atomics.load(this.data,0)}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(t,e){if(!this.locked){try{const e=this.dirtyStart,i=this.dirtyEnd;if(!this.hasDirty)return;this._resetRange();const s=Object(c.q)(this.data).buffer,r=this.getTexture(t),a=4,o=(e-e%this.size)/this.size,l=(i-i%this.size)/this.size,h=o,u=this.size,f=l,m=o*this.size*a,y=(u+f*this.size)*a-m,x=Object(d.j)(this.pixelType),_=new x(s,m*x.BYTES_PER_ELEMENT,y),g=this.size,b=f-h+1;if(b>this.size)return void p.error(new n.a("mapview-webgl","Out-of-bounds index when updating AttributeData"));r.updateData(0,0,h,g,b,_)}catch(i){}e()}}update(t){const{data:e,start:i,end:s}=t;if(Object(c.j)(e)){const s=this.data,r=i*this.texelSize;for(let i=0;i<e.length;i++){const n=1<<i%this.texelSize;t.layout&n&&(s[r+i]=e[i])}}this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,s)}resize(t,e){const i=this.size;if(this.size=e,this.textureOnly)return void(i!==this.size&&(this._lastTexture=this._texture,this._texture=null));const s=Object(d.j)(this.pixelType);this.destroy(),this.data=new s(Object(c.q)(t.buffer))}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(t){const e=new h.a(t,this._textureDesc,Object(c.r)(this.data,void 0));if(Object(c.j)(this._lastTexture)&&this._fbos[0]){const i=this._lastTexture.descriptor.width,s=this._lastTexture.descriptor.height,r=this._lastTexture.descriptor.dataType,n=this._lastTexture.descriptor.pixelFormat,a=this.getFBO(t),o=Object(d.k)(r),c=new(Object(d.j)(r))(new ArrayBuffer(i*s*o*this.texelSize)),l=t.getBoundFramebufferObject(),{x:h,y:u,width:f,height:p}=t.getViewport();t.bindFramebuffer(a),a.readPixels(0,0,i,s,n,r,c),e.updateData(0,0,0,2*i,s/2,c),t.setViewport(h,u,f,p),t.bindFramebuffer(l)}return this.destroy(),this._texture=e,this._texture}}class _{constructor(t){this._onUpdate=t,this._initialized=!1,this._forceNextUpload=!1,this._locked=!1}initialize(t){const{blocks:e,shared:i,size:s}=t;if(this.shared=i,this.size=s,m("Initializing AttributeStoreView",t),Object(c.i)(this._data))this._data=Object(c.l)(e,t=>new x(t,s,i));else for(let r=0;r<this._data.length;r++){const t=this._data[r],n=e[r];Object(c.j)(n)&&(Object(c.i)(t)?this._data[r]=new x(n,s,i):t.resize(n,s))}this._initialized=!0}destroy(){Object(c.a)(this._data,t=>Object(c.l)(t,t=>t.destroy())),Object(c.a)(this._defaultTexture,t=>t.dispose())}isUpdating(){const t=this._data;if(Object(c.i)(t))return!0;const e=Object(c.j)(this._pendingAttributeUpdate),i=e;return Object(a.a)("esri-2d-log-updating")&&console.log(`Updating AttributeStoreView ${i}\n  -> hasPendingUpdate ${e}`),i}getBlock(t){return Object(c.i)(this._data)?null:this._data[t]}setLabelMinZoom(t,e){this.setData(t,0,1,e)}getLabelMinZoom(t){return this.getData(t,0,1,255)}getFilterFlags(t){return this.getData(t,0,0,0)}getVVSize(t){return this.getData(t,u.b,0,0)}getData(t,e,i,s){if(!this._data)return 0;const r=Object(c.q)(this._data)[e];if(Object(c.i)(r))return 0;const n=r.getData(t,i);return Object(c.j)(n)?n:s}setData(t,e,i,s){const r=Object(c.q)(this._data)[e];Object(c.q)(r).setData(t,i,s)}lockTextureUpload(){this._locked=!0}unlockTextureUpload(){this._locked=!1}forceTextureUpload(){this._forceNextUpload=!0}async requestUpdate(t){if(this._pendingAttributeUpdate)return void p.error(new n.a("mapview-webgl","Tried to update attribute data with a pending update"));const e=Object(s.g)();return m("AttributeStoreView Update Requested",t),this._pendingAttributeUpdate={data:t,resolver:e},e.promise}update(){if(this._initialized&&Object(c.j)(this._pendingAttributeUpdate)){const{data:t,resolver:e}=this._pendingAttributeUpdate,i=Object(c.q)(this._data);for(let s=0;s<t.blocks.length;s++){const e=t.blocks[s],r=i[s];Object(c.a)(r,t=>Object(c.a)(e,e=>{m("Updating block "+s,e),t.update(e)}))}this._pendingAttributeUpdate=null,e(),this._onUpdate()}}bindTextures(t,e=!0){this.update();const i=this._getDefaultTexture(t);if(!this._initialized)return t.bindTexture(i,u.q),void(e&&(t.bindTexture(i,u.r),t.bindTexture(i,u.s),t.bindTexture(i,u.t)));const s=Object(c.q)(this._data);this._locked&&!this._forceNextUpload||(Object(c.g)(s,e=>e.updateTexture(t,()=>this._onUpdate())),this._forceNextUpload=!1),t.bindTexture(Object(c.m)(s[0],i,e=>e.getTexture(t)),u.q),e&&(t.bindTexture(Object(c.m)(s[1],i,e=>e.getTexture(t)),u.r),t.bindTexture(Object(c.m)(s[2],i,e=>e.getTexture(t)),u.s),t.bindTexture(Object(c.m)(s[3],i,e=>e.getTexture(t)),u.t))}_getDefaultTexture(t){if(Object(c.i)(this._defaultTexture)){const e={wrapMode:33071,pixelFormat:6408,dataType:5121,samplingMode:9728,width:1,height:1};this._defaultTexture=new h.a(t,e,new Uint8Array(4))}return this._defaultTexture}}var g=i(570),b=i(23),v=i(18),O=i(39),j=i(210),w=i(335);function T(t,e){const i=e.length;if(t<e[0].value||1===i)return e[0].size;for(let s=1;s<i;s++)if(t<e[s].value){const i=(t-e[s-1].value)/(e[s].value-e[s-1].value);return e[s-1].size+i*(e[s].size-e[s-1].size)}return e[i-1].size}function S(t,e,i=0){if(Object(c.i)(e))return t[i+0]=0,t[i+1]=0,t[i+2]=0,void(t[i+3]=0);const{r:s,g:r,b:n,a:a}=e;t[i+0]=s*a/255,t[i+1]=r*a/255,t[i+2]=n*a/255,t[i+3]=a}class M{constructor(){this.symbolLevels=[],this.vvColorValues=new Float32Array(8),this.vvColors=new Float32Array(32),this.vvOpacityValues=new Float32Array(8),this.vvOpacities=new Float32Array(8),this.vvSizeMinMaxValue=new Float32Array(4),this.ddColors=new Float32Array(32),this.ddBackgroundColor=new Float32Array(4),this.ddActiveDots=new Float32Array(8),this._vvMaterialParameters={vvSizeEnabled:!1,vvColorEnabled:!1,vvRotationEnabled:!1,vvRotationType:"geographic",vvOpacityEnabled:!1}}getSizeVVFieldStops(t){const e=this._vvSizeFieldStops;switch(e.type){case"static":return e;case"level-dependent":return Object(c.r)(e.levels[t],()=>{let i=1/0,s=0;for(const o in e.levels){const e=parseFloat(o),r=Math.abs(t-e);r<i&&(i=r,s=e)}if(i===1/0)return{sizes:new Float32Array([0,0,0,0,0,0]),values:new Float32Array([0,0,0,0,0,0])};const r=2**((t-s)/2),n=Object(c.q)(e.levels[s]),a=new Float32Array(n.values);return a[2]*=r,a[3]*=r,{sizes:Object(c.q)(n.sizes),values:a}})}}get vvMaterialParameters(){return this._vvMaterialParameters}update(t){Object(c.j)(this._vvInfo)&&this._updateVisualVariables(this._vvInfo.vvRanges,t)}setInfo(t,e,i){Object(c.j)(i)&&i.forEach(t=>this._updateEffects(t)),this._vvInfo=e,"dot-density"===t.type&&this._updateDotDensityInfo(t)}getVariation(){return{ddDotBlending:this.ddDotBlending,outsideLabelsVisible:this.outsideLabelsVisible,oesTextureFloat:Object(w.a)().supportsTextureFloat}}getVariationHash(){return(this.ddDotBlending?1:0)|(this.outsideLabelsVisible?1:0)<<1}_updateEffects(t){Object(c.j)(t)&&t.filter&&t.filter.enabled&&(this.outsideLabelsVisible=t.excludedLabelsVisible)}_updateVisualVariables(t,e){const i=this._vvMaterialParameters;if(i.vvOpacityEnabled=!1,i.vvSizeEnabled=!1,i.vvColorEnabled=!1,i.vvRotationEnabled=!1,!t)return;const s=t.size;if(s){if(i.vvSizeEnabled=!0,s.minMaxValue){const t=s.minMaxValue;let i,r;if(Object(d.n)(t.minSize)&&Object(d.n)(t.maxSize))if(Object(d.o)(t.minSize)&&Object(d.o)(t.maxSize))i=Object(v.c)(t.minSize),r=Object(v.c)(t.maxSize);else{const s=e.scale;i=Object(v.c)(T(s,t.minSize.stops)),r=Object(v.c)(T(s,t.maxSize.stops))}this.vvSizeMinMaxValue.set([t.minDataValue,t.maxDataValue,i,r])}if(s.scaleStops&&(this.vvSizeScaleStopsValue=Object(v.c)(T(e.scale,s.scaleStops.stops))),s.unitValue){const t=Object(O.d)(e.spatialReference)/j.a[s.unitValue.unit];this.vvSizeUnitValueToPixelsRatio=t/e.resolution}s.fieldStops&&(this._vvSizeFieldStops=s.fieldStops)}const r=t.color;r&&(i.vvColorEnabled=!0,this.vvColorValues.set(r.values),this.vvColors.set(r.colors));const n=t.opacity;n&&(i.vvOpacityEnabled=!0,this.vvOpacityValues.set(n.values),this.vvOpacities.set(n.opacities));const a=t.rotation;a&&(i.vvRotationEnabled=!0,i.vvRotationType=a.type)}_updateDotDensityInfo(t){const e=t.attributes;this.ddDotValue=t.dotValue,this.ddDotScale=t.referenceScale,this.ddDotSize=t.dotSize,this.ddDotBlending=t.dotBlendingEnabled,this.ddSeed=t.seed;for(let i=0;i<u.e;i++){const t=i>=e.length?new b.a([0,0,0,0]):e[i].color;S(this.ddColors,t,4*i)}for(let i=0;i<8;i++)this.ddActiveDots[i]=i<t.attributes.length?1:0;S(this.ddBackgroundColor,t.backgroundColor)}}class I extends g.a{constructor(t){super(t),this._rendererInfo=new M,this._materialItemsRequestQueue=new r.a,this.attributeView=new _(()=>this.onAttributeStoreUpdate())}destroy(){this.removeAllChildren(),this.children.forEach(t=>t.destroy()),this.attributeView.destroy(),this._materialItemsRequestQueue.clear()}setRendererInfo(t,e,i){this._rendererInfo.setInfo(t,e,i),this.requestRender()}async getMaterialItems(t,e){if(!t||0===t.length)return null;const i=Object(s.g)();return this._materialItemsRequestQueue.push({items:t,abortOptions:e,resolver:i}),this.requestRender(),i.promise}doRender(t){if(t.context.capabilities.enable("textureFloat"),t.context.capabilities.enable("vao"),this._materialItemsRequestQueue.length>0){let e=this._materialItemsRequestQueue.pop();for(;e;)this._processMaterialItemRequest(t,e),e=this._materialItemsRequestQueue.pop()}super.doRender(t)}renderChildren(t){for(const e of this.children)e.commit(t);this._rendererInfo.update(t.state),super.renderChildren(t)}createRenderParams(t){const e=super.createRenderParams(t);return e.rendererInfo=this._rendererInfo,e.attributeView=this.attributeView,e}onAttributeStoreUpdate(){}_processMaterialItemRequest(t,{items:e,abortOptions:i,resolver:s}){const{painter:r,pixelRatio:n}=t,a=e.map(t=>r.textureManager.rasterizeItem(t.symbol,n,t.glyphIds,i));Promise.all(a).then(t=>{if(!this.stage)return void s.reject();const i=t.map((t,i)=>({id:e[i].id,mosaicItem:t}));s.resolve(i)},s.reject)}}},611:function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));class s{constructor(){this._freeIds=[],this._idCounter=1}createId(t=!1){return function(t,e){return((e?2147483648:0)|t)>>>0}(this._getFreeId(),t)}releaseId(t){this._freeIds.push(t)}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}var r=i(563);function n(t,e,i){if(!(t.length>e))for(;t.length<=e;)t.push(i)}class a{constructor(){this._numerics=[],this._strings=[],this._idGenerator=new s,this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[]}createBitset(){const t=this._bitsets.length;return this._bitsets.push(r.a.create(this._allocatedSize,2147483647)),t+1}getBitset(t){return this._bitsets[t-1]}_expand(){this._allocatedSize<<=1;for(const t of this._bitsets)t.resize(this._allocatedSize)}_ensureNumeric(t,e){this._numerics[t]||(this._numerics[t]=[]),n(this._numerics[t],e,0)}_ensureInstanceId(t){n(this._instanceIds,t,0)}_ensureString(t,e){this._strings[t]||(this._strings[t]=[]),n(this._strings[t],e,null)}createDisplayId(t=!1){const e=this._idGenerator.createId();return e>this._allocatedSize&&this._expand(),((t,e)=>((e?2147483648:0)|t)>>>0)(e,t)}releaseDisplayId(t){for(const e of this._bitsets)e.unset(t);return this._idGenerator.releaseId(2147483647&t)}getComputedNumeric(t,e){return this.getComputedNumericAtIndex(2147483647&t,0)}setComputedNumeric(t,e,i){return this.setComputedNumericAtIndex(2147483647&t,i,0)}getComputedString(t,e){return this.getComputedStringAtIndex(2147483647&t,0)}setComputedString(t,e,i){return this.setComputedStringAtIndex(2147483647&t,0,i)}getComputedNumericAtIndex(t,e){const i=2147483647&t;return this._ensureNumeric(e,i),this._numerics[e][i]}setComputedNumericAtIndex(t,e,i){const s=2147483647&t;this._ensureNumeric(e,s),this._numerics[e][s]=i}getInstanceId(t){const e=2147483647&t;return this._ensureInstanceId(e),this._instanceIds[e]}setInstanceId(t,e){const i=2147483647&t;this._ensureInstanceId(i),this._instanceIds[i]=e}getComputedStringAtIndex(t,e){const i=2147483647&t;return this._ensureString(e,i),this._strings[e][i]}setComputedStringAtIndex(t,e,i){const s=2147483647&t;this._ensureString(e,s),this._strings[e][s]=i}getXMin(t){return this._bounds[4*(2147483647&t)]}getYMin(t){return this._bounds[4*(2147483647&t)+1]}getXMax(t){return this._bounds[4*(2147483647&t)+2]}getYMax(t){return this._bounds[4*(2147483647&t)+3]}setBounds(t,e){const i=e.readHydratedGeometry();if(!i||!i.coords.length)return!1;let s=1/0,r=1/0,a=-1/0,o=-1/0;i.forEachVertex((t,e)=>{s=Math.min(s,t),r=Math.min(r,e),a=Math.max(a,t),o=Math.max(o,e)});const c=2147483647&t;return n(this._bounds,4*c+4,0),this._bounds[4*c]=s,this._bounds[4*c+1]=r,this._bounds[4*c+2]=a,this._bounds[4*c+3]=o,!0}}},613:function(t,e,i){"use strict";i.d(e,"a",(function(){return Yt}));var s=i(0),r=i(19),n=i(102),a=(i(5),i(3)),o=i(12),c=i(18),l=i(1),h=(i(6),i(4),i(2)),u=i(87),d=i(26),f=i(68),p=i(185),m=i(17),y=i(118),x=i(249),_=i(83),g=i(24);function b(t){if(!t)return null;if("mesh"===t.type)return t.toJSON();let e=null;const i=t.spatialReference,s=Object(g.e)(i);if(!s)return t.toJSON();const r=i.isWebMercator?102100:4326,n=_.a[r].maxX,a=_.a[r].minX,o=_.a[r].plus180Line,c=_.a[r].minus180Line;let l;const h=t.toJSON();if(Object(m.f)(h))l=v(h,n,a);else if(Object(m.e)(h))h.points=h.points.map(t=>v(t,n,a)),l=h;else if(Object(m.d)(h))l=function(t,e){if(!e)return t;const i=function(t,e){const i=[],{ymin:s,ymax:r}=t,n=t.xmax-t.xmin,a=t.xmin,o=t.xmax;let c;const[l,h]=e.valid;c=O(t.xmin,e);const u=c.x,d=c.frameId;c=O(t.xmax,e);const f=c.x,p=c.frameId,m=u===f&&n>0;if(n>2*h){const t={xmin:a<o?u:f,ymin:s,xmax:h,ymax:r},e={xmin:l,ymin:s,xmax:a<o?f:u,ymax:r},n={xmin:0,ymin:s,xmax:h,ymax:r},c={xmin:l,ymin:s,xmax:0,ymax:r},m=[],y=[];j(t,n)&&m.push(d),j(t,c)&&y.push(d),j(e,n)&&m.push(p),j(e,c)&&y.push(p);for(let i=d+1;i<p;i++)m.push(i),y.push(i);i.push({extent:t,frameIds:[d]},{extent:e,frameIds:[p]},{extent:n,frameIds:m},{extent:c,frameIds:y})}else u>f||m?i.push({extent:{xmin:u,ymin:s,xmax:h,ymax:r},frameIds:[d]},{extent:{xmin:l,ymin:s,xmax:f,ymax:r},frameIds:[p]}):i.push({extent:{xmin:u,ymin:s,xmax:f,ymax:r},frameIds:[d]});return i}(t,e).map(t=>t.extent);return i.length<2?i[0]||t:i.length>2?(t.xmin=e.valid[0],t.xmax=e.valid[1],t):{rings:i.map(t=>[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]])}}(h,s);else if(Object(m.g)(h)||Object(m.h)(h)){const t=S;Object(y.a)(t,h);const i={xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]},s=Object(_.d)(i.xmin,a)*(2*n),r=0===s?h:function(t,e){const i=Object(_.b)(t);for(const s of i)for(const t of s)t[0]+=e;return t}(h,s);i.xmin+=s,i.xmax+=s,Object(x.b)(i,o)&&i.xmax!==n||Object(x.b)(i,c)&&i.xmin!==a?e=r:l=r}else l=t.toJSON();return null!==e?(new T).cut(e,n):l}function v(t,e,i){if(Array.isArray(t)){const s=t[0];if(s>e){const i=Object(_.d)(s,e);t[0]=s+i*(-2*e)}else if(s<i){const e=Object(_.d)(s,i);t[0]=s+e*(-2*i)}}else{const s=t.x;if(s>e){const i=Object(_.d)(s,e);t.x+=i*(-2*e)}else if(s<i){const e=Object(_.d)(s,i);t.x+=e*(-2*i)}}return t}function O(t,e){const[i,s]=e.valid,r=2*s;let n,a=0;return t>s?(n=Math.ceil(Math.abs(t-s)/r),t-=n*r,a=n):t<i&&(n=Math.ceil(Math.abs(t-i)/r),t+=n*r,a=-n),{x:t,frameId:a}}function j(t,e){const{xmin:i,ymin:s,xmax:r,ymax:n}=e;return w(t,i,s)&&w(t,i,n)&&w(t,r,n)&&w(t,r,s)}function w(t,e,i){return e>=t.xmin&&e<=t.xmax&&i>=t.ymin&&i<=t.ymax}class T{cut(t,e){let i;if(t.rings)this.closed=!0,i=t.rings,this.minPts=4;else{if(!t.paths)return null;this.closed=!1,i=t.paths,this.minPts=2}const s=i.length,r=-2*e;for(let n=0;n<s;n++){const t=i[n];if(t&&t.length>=this.minPts){const e=[];for(const i of t)e.push([i[0]+r,i[1]]);i.push(e)}}return this.closed?t.rings=i:t.paths=i,t}}const S=Object(f.g)();var M=i(572),I=i(584),R=i(337),L=i(533);class C{constructor(){this._dirties=[{vertexFrom:-1,vertexCount:-1,indexFrom:-1,indexCount:-1,allDirty:!1},{vertexFrom:-1,vertexCount:-1,indexFrom:-1,indexCount:-1,allDirty:!1},{vertexFrom:-1,vertexCount:-1,indexFrom:-1,indexCount:-1,allDirty:!1},{vertexFrom:-1,vertexCount:-1,indexFrom:-1,indexCount:-1,allDirty:!1},{vertexFrom:-1,vertexCount:-1,indexFrom:-1,indexCount:-1,allDirty:!1}]}hasDirty(){return this._dirties.some(t=>-1!==t.indexCount||t.allDirty)}markAllClean(){for(const t of this._dirties)t.indexFrom=-1,t.indexCount=-1,t.vertexFrom=-1,t.vertexCount=-1,t.allDirty=!1}markAllDirty(){for(const t of this._dirties)t.allDirty=!0}forEach(t){for(let e=0;e<this._dirties.length;++e){const{indexCount:i,indexFrom:s,vertexCount:r,vertexFrom:n,allDirty:a}=this._dirties[e],o={};let c,l=!1;(a||-1!==n&&r>0)&&(o.geometry={count:r,from:n,allDirty:a},l=!0),(a||-1!==s&&i>0)&&(c={count:i,from:s,allDirty:a},l=!0),l&&t({indices:c,vertices:o},e)}}markDirtyIndices(t,e,i){const s=this._dirties[t],r=e,n=i;if(!s.allDirty)if(-1!==s.indexCount){const t=Math.min(s.indexFrom,r),e=Math.max(s.indexFrom+s.indexCount,r+n)-t;s.indexFrom=t,s.indexCount=e}else s.indexFrom=r,s.indexCount=n}markDirtyVertices(t,e,i,s){const r=this._dirties[t],n=i,a=s;if(!r.allDirty)if(-1!==r.vertexCount){const t=Math.min(r.vertexFrom,n),e=Math.max(r.vertexFrom+r.vertexCount,n+a)-t;r.vertexFrom=t,r.vertexCount=e}else r.vertexFrom=n,r.vertexCount=a}}class z{constructor(t){this._largestRange=null,this._parent=t,this._updateLargestRange()}get largestRange(){return this._largestRange}rangeCreated(t){(!this._largestRange||t.count>this._largestRange.count)&&(this._largestRange=t)}rangeResized(t,e){t===this._largestRange?t.count<e&&this._updateLargestRange():(!this._largestRange||t.count>this._largestRange.count)&&(this._largestRange=t)}findBestRange(t){let e=this._parent._freeHead,i=null;for(;null!==e;)e.count>=t&&(!i||e.count-t<i.count-t)&&(i=e),e=e.next;return i}findAdjacentRanges(t,e){let i=!0,s=!1,r=null,n=this._parent._freeHead;for(;i&&!s;){const a=null!==r?r.from+r.count:0,o=null!==n?n.from:this._parent._size;t>=a&&t+e<=o?(i=!1,s=!0):null!==n?(r=n,n=n.next):i=!1}return[r,n]}_updateLargestRange(){let t=null,e=this._parent._freeHead;for(;null!==e;)(!t||e.count>t.count)&&(t=e),e=e.next;this._largestRange=t}}class E{constructor(t,e){this._allocated=0,this._size=t,this._freeHead=t>0?{from:0,count:t,prev:null,next:null}:null,this._bookKeeper=e||new z(this),this._freeHead&&this._bookKeeper.rangeCreated(this._freeHead)}allocate(t){const e=this._bookKeeper.findBestRange(t);if(null===e)return-1;const i=e.from,s=e.count;if(e.from+=t,e.count-=t,this._bookKeeper.rangeResized(e,i,s),this._allocated+=t,0===e.count){const t=null!==e.prev?this._freeHead:e.next;E._removeRange(e),this._freeHead=t}return i}free(t,e){const[i,s]=this._bookKeeper.findAdjacentRanges(t,e),r={from:t,count:e,prev:i,next:s};if(null!==i&&(i.next=r),null!==s&&(s.prev=r),this._bookKeeper.rangeCreated(r),this._allocated-=e,null!==s&&r.from+r.count===s.from){const t=r.from,e=r.count;E._fuse(r,s),E._removeRange(s),this._bookKeeper.rangeResized(r,t,e),this._bookKeeper.rangeResized(s,void 0,0)}if(null!==i&&i.from+i.count===r.from){const t=i.from,e=i.count;E._fuse(i,r),E._removeRange(r),this._bookKeeper.rangeResized(i,t,e),this._bookKeeper.rangeResized(r,void 0,0)}this._freeHead=null!==r.prev?this._freeHead:r}get fragmentation(){const t=this._size-this._allocated;return 0===t?0:1-this._bookKeeper.largestRange.count/t}static _removeRange(t){null!==t.prev?null!==t.next?(t.prev.next=t.next,t.next.prev=t.prev):t.prev.next=null:null!==t.next&&(t.next.prev=null)}static _fuse(t,e){t.count+=e.count,t.next=e.next,e.from+=e.count,e.count=0,null!==e.next&&(e.next.prev=t)}}var F=i(538);const D=["FILL","LINE","MARKER","TEXT","LABEL"];class A{constructor(t,e,i,s){this._strides=t,this._displayList=e,this._freeListsAndStorage={},this._dirtyMap=null,this._dirtyMap=i;for(const r in t){this._freeListsAndStorage[r]={vtxFreeList:s?new E(s):null,idxFreeList:s?new E(s):null,vertexBuffers:{},indexBuffer:s?new Uint32Array(s):null};for(const e in t[r])this._freeListsAndStorage[r].vertexBuffers[e]={data:s?Object(F.b)(s,t[r][e]):null,stride:t[r][e]}}}static fromTileData(t,e){const i=function(t){const e=t.getStrides(),i={};for(let s=0;s<e.length;s++)i[D[s]]=e[s];return i}(t),s=[0,0,0,0,0],r=[0,0,0,0,0],n=t.tileDisplayData.displayObjects;for(const o of n)for(const t of o.displayRecords)s[t.geometryType]=Math.max(s[t.geometryType],t.vertexFrom+t.vertexCount),r[t.geometryType]=Math.max(r[t.geometryType],t.indexFrom+t.indexCount);const a=new A(i,t.tileDisplayData.displayList,e,null);for(let o=0;o<t.tileBufferData.geometries.length;++o){const e=s[o],i=r[o],n=t.tileBufferData.geometries[o],c=D[o],l=a._storageFor(c),h=t.tileBufferData.geometries[o].indexBuffer;let u;l.indexBuffer=h,l.idxFreeList=new E(h.length),l.idxFreeList.allocate(i);for(const s in n.vertexBuffer){const e=t.tileBufferData.geometries[o].vertexBuffer[s];l.vertexBuffers[s].data=e.data,l.vertexBuffers[s].stride=e.stride;const i=Object(F.p)(e.stride),r=e.data.length*i/e.stride;u||(u=r)}l.vtxFreeList=new E(u),l.vtxFreeList.allocate(e)}return a}delete(t){const e=D[t.geometryType];this._freeVertices(e,t.vertexFrom,t.vertexCount),this._freeIndices(e,t.indexFrom,t.indexCount),this._displayList.removeFromList(t),t.vertexFrom=void 0,t.indexFrom=void 0}setMeshData(t,e,i,s,r){const n=D[t.geometryType];let a,o;t.meshData=null,void 0===t.vertexFrom?(o=e.vertexCount,a=this._allocateVertices(n,o)):e.vertexCount>t.vertexCount?(this._freeVertices(n,t.vertexFrom,t.vertexCount),o=e.vertexCount,a=this._allocateVertices(n,o)):e.vertexCount===t.vertexCount?(a=t.vertexFrom,o=t.vertexCount):(this._freeVertices(n,t.vertexFrom+e.vertexCount,t.vertexCount-e.vertexCount),a=t.vertexFrom,o=e.vertexCount);let c,l,h,u=!0;if(void 0===t.indexFrom?(c=r,h=e.indexCount,l=this._allocateIndices(n,h)):e.indexCount>t.indexCount?(c=this._displayList.removeFromList(t),this._freeIndices(n,t.indexFrom,t.indexCount),h=e.indexCount,l=this._allocateIndices(n,h)):e.indexCount===t.indexCount?(u=!1,l=t.indexFrom,h=t.indexCount):(c=this._displayList.removeFromList(t),this._freeIndices(n,t.indexFrom+e.indexCount,t.indexCount-e.indexCount),l=t.indexFrom,h=e.indexCount),-1!==a&&-1!==l){const r=this._storageFor(n);if(Object(F.d)(a,l,r.vertexBuffers,r.indexBuffer,e,i,s),t.vertexFrom=a,t.indexFrom=l,t.vertexCount=e.vertexCount,t.indexCount=e.indexCount,this._dirtyMap){this._dirtyMap.markDirtyIndices(t.geometryType,t.indexFrom,t.indexCount);for(const e in i)this._dirtyMap.markDirtyVertices(t.geometryType,e,t.vertexFrom,t.vertexCount)}return u&&this._displayList.addToList(t,c),!0}return-1!==a&&this._freeVertices(n,a,o),-1!==l&&this._freeIndices(n,l,h),t.setMeshDataFromBuffers(e,i,s),t.vertexFrom=void 0,t.vertexCount=0,t.indexFrom=void 0,t.indexCount=0,!1}tryAddMeshData(t,e){const i=e.vertexBuffer,s=e.indexBuffer,r=D[t.geometryType],n=this._allocateVertices(r,t.vertexCount);if(-1===n)return this._freeVertices(r,n,t.vertexCount),!1;const a=this._allocateIndices(r,t.indexCount);if(-1===a)return this._freeVertices(r,n,t.vertexCount),this._freeIndices(r,a,t.indexCount),!1;const o=this._storageFor(r);if(Object(F.d)(n,a,o.vertexBuffers,o.indexBuffer,t,i,s),t.vertexFrom=n,t.indexFrom=a,this._dirtyMap){this._dirtyMap.markDirtyIndices(t.geometryType,t.indexFrom,t.indexCount);for(const e in i)this._dirtyMap.markDirtyVertices(t.geometryType,e,n,t.vertexCount)}return this._displayList.addToList(t),!0}_allocateVertices(t,e){const i=this._storageFor(t),s=i.vtxFreeList.allocate(e);return-1===s||i.vtxFreeList.fragmentation>.5?-1:s}_freeVertices(t,e,i){this._storageFor(t).vtxFreeList.free(e,i)}_freeIndices(t,e,i){this._storageFor(t).idxFreeList.free(e,i)}_allocateIndices(t,e){const i=this._storageFor(t),s=i.idxFreeList.allocate(e);return-1===s||i.idxFreeList.fragmentation>.5?-1:s}_storageFor(t){return this._freeListsAndStorage[t]}_stridesFor(t,e){return this._strides[t][e]}}var P=i(545),B=(i(546),i(544),i(543),i(549),i(548),i(542),i(547));class k{constructor(t){this.geometryMap=Object(F.e)(()=>({indexBuffer:P.a.createIndex(t,35044),vao:null}),(e,i)=>({vertexBuffer:P.a.createVertex(t,F.a[i])}))}dispose(){for(let t=0;t<5;t++){const e=this.geometryMap[t];if(e){e.data.vao&&e.data.vao.dispose(!1),e.data.indexBuffer&&e.data.indexBuffer.dispose();for(const t in e.buffers)e.buffers[t]&&e.buffers[t].data.vertexBuffer.dispose()}}}get(t){const e=this.geometryMap[t];return{draw(t,i,s,r,n){if(!e.data.vao){const r={};for(const t in e.buffers)r[t]=e.buffers[t].data.vertexBuffer;e.data.vao=new B.a(t,s,i,r,e.data.indexBuffer)}const a=e.data.vao;t.bindVAO(a),t.drawElements(4,n,5125,Uint32Array.BYTES_PER_ELEMENT*r),t.bindVAO(null)}}}has(t){return null!=this.geometryMap[t]}upload(t,e){e.forEach((e,i)=>{this._upload(e,i,t)})}_upload(t,e,i){if(t.indices&&(t.indices.allDirty?this._uploadIndices(i,e):null!=t.indices.from&&null!=t.indices.count&&this._uploadIndices(i,e,t.indices.from,t.indices.count)),t.vertices){const s=t.vertices;for(const t in s){const r=s[t];r.allDirty?this._uploadVertices(i,e,t):null!=r.from&&null!=r.count&&this._uploadVertices(i,e,t,r.from,r.count)}}}_uploadVertices(t,e,i,s,r){const n=this.geometryMap[e];if(!n)return;const a=t.geometries[e].vertexBuffer[i];if(!a)return;const o=a.stride,c=a.data.buffer;n.buffers[i]&&c.byteLength>0&&(null!=s&&null!=r?n.buffers[i].data.vertexBuffer.setSubData(c,s*o,s*o,(s+r)*o):n.buffers[i].data.vertexBuffer.setData(c))}_uploadIndices(t,e,i,s){const r=this.geometryMap[e];if(!r)return;const n=t.geometries[e].indexBuffer.buffer;r.data.indexBuffer&&n.byteLength>0&&(null!=i&&null!=s?r.data.indexBuffer.setSubData(n,4*i,4*i,4*(i+s)):r.data.indexBuffer.setData(n))}}var V=i(604);class N extends V.a{constructor(){super(...arguments),this._data=null,this._displayList=null,this._lastCommitTime=0,this._hasData=!1,this._invalidated=!1,this._wglBuffers=null,this._dirtyMap=new C}destroy(){super.destroy(),this.clear()}get hasData(){return!!this._hasData}get displayObjects(){var t;return null!=(t=this._displayObjects)?t:[]}getGeometry(t){return this._wglBuffers&&this._wglBuffers.has(t)?this._wglBuffers.get(t):null}getDisplayList(){return this._displayList}patch(t){if(!0===t.clear)return this.clear(),void(this._hasData=!1);const e=t.addOrUpdate,i=t.remove;!this._data&&e&&e.tileDisplayData.displayObjects.length?(e.tileDisplayData.computeDisplayList(),this._dirtyMap=new C,this._dispRecStore=A.fromTileData(e,this._dirtyMap),this._data=e,this._dirtyMap.markAllDirty(),this._hasData=!0,t.end&&this.ready()):this._data&&(e&&e.tileDisplayData.displayObjects.length||i.length)?this._doPatchData(t):t.end&&this.ready(),t.end&&!this._data&&this.clear(),this.requestRender(),this.emit("change")}commit(t){t.time&&t.time===this._lastCommitTime||(this._lastCommitTime=t.time,this.visible&&this._data&&(this._wglBuffers||(this._wglBuffers=new k(t.context)),(this._dirtyMap.hasDirty()||this._invalidated)&&(this._invalidated=!1,this._wglBuffers.upload(this._data.tileBufferData,this._dirtyMap),this._displayList=this._data.tileDisplayData.displayList.clone(),this._displayObjects=this._data.tileDisplayData.displayObjects.slice(),this._dirtyMap.markAllClean())))}clear(){this._data=null,this._displayList=null,this._dispRecStore=null,this._wglBuffers&&(this._wglBuffers.dispose(),this._wglBuffers=null)}_doPatchData(t){this._invalidated=!0,this._patchData(t)||(this._dirtyMap.markAllDirty(),this._data.reshuffle(),this._dispRecStore=A.fromTileData(this._data,this._dirtyMap)),this.requestRender()}_patchData(t){let e=!0;const i=t.addOrUpdate&&t.addOrUpdate.tileDisplayData&&t.addOrUpdate.tileDisplayData.displayObjects||[],s=(t.remove||[]).slice();for(const r of i)null!=r.insertAfter&&s.push(r.id);for(const r of s){const t=this._data.tileDisplayData.displayObjectRegistry.get(r);if(t){this._data.tileDisplayData.displayList.removeFromList(t.displayRecords);for(const i of t.displayRecords)this._dispRecStore.delete(i);this._data.tileDisplayData.displayObjectRegistry.delete(r);const e=this._data.tileDisplayData.displayObjects.indexOf(t);this._data.tileDisplayData.displayObjects.splice(e,1)}}for(const r of i){let i,s=this._data.tileDisplayData.displayObjectRegistry.get(r.id);if(s){const t=s.displayRecords;s.set(r),s.displayRecords=t;const e=s.displayRecords.length;for(let i=0;i<e;++i){const t=s.displayRecords[i],e=r.displayRecords[i];(i>=r.displayRecords.length||t.geometryType!==e.geometryType||t.symbolLevel!==e.symbolLevel||t.zOrder!==e.zOrder||t.materialKey!==e.materialKey)&&(this._dispRecStore.delete(s.displayRecords[i]),i<r.displayRecords.length&&(s.displayRecords[i]=void 0))}s.displayRecords.length=r.displayRecords.length}else{let t;s=r.copy(),s.displayRecords=[],this._data.tileDisplayData.displayObjectRegistry.set(r.id,s);const e=this._data.tileDisplayData.displayObjects;if(null!=s.insertAfter)if(i={},s.insertAfter>=0){const i=this._data.tileDisplayData.displayObjectRegistry.get(s.insertAfter);i?(t=e.indexOf(i)+1,t<e.length?e.splice(t,0,s):(e.push(s),t=e.length)):(e.push(s),t=e.length)}else e.unshift(s),t=0;else e.push(s),t=e.length;if(i){const s=r.displayRecords.length>0?1:0;let n=0;for(let r=t-1;r>=0&&n<s;--r)for(let t=e[r].displayRecords.length-1;t>=0&&n<s;--t){const s=e[r].displayRecords[t],a=this._data.tileDisplayData.displayList.getDPInfoType();i[a]||(i[a]=s,++n)}}}const n=r.displayRecords.length;for(let a=0;a<n;++a){const n=r.displayRecords[a];let o=s.displayRecords[a];o?(o.meshData=n.meshData,o.materialKey=n.materialKey):(o=n.copy(),o.vertexFrom=void 0,o.indexFrom=void 0,s.displayRecords[a]=o);const c=n.geometryType,l=this._data.tileDisplayData.displayList.getDPInfoType(),h=t.addOrUpdate.tileBufferData.geometries[c],u=h.vertexBuffer,d=h.indexBuffer;let f;i&&(f=i[l]?this._data.tileDisplayData.displayList.splitAfter(i[l]):-1),e=this._dispRecStore.setMeshData(o,n,u,d,f)&&e,i&&null!=o.indexFrom&&null!=o.indexFrom&&(i[l]=o)}}return e}}class U{constructor(){this._byGeometryType=null}get satisfied(){return!this._byGeometryType}reset(){this._byGeometryType=null}verticesFor(t){return this._byGeometryType?this._byGeometryType[t].vertices:0}indicesFor(t){return this._byGeometryType?this._byGeometryType[t].indices:0}needMore(t,e,i){if(!e&&!i)return;this._byGeometryType||(this._byGeometryType=[{vertices:0,indices:0},{vertices:0,indices:0},{vertices:0,indices:0},{vertices:0,indices:0},{vertices:0,indices:0}]);const s=this._byGeometryType[t];s.vertices+=e,s.indices+=i}}class G{constructor(){this.geometries=[{indexBuffer:void 0,vertexBuffer:{}},{indexBuffer:void 0,vertexBuffer:{}},{indexBuffer:void 0,vertexBuffer:{}},{indexBuffer:void 0,vertexBuffer:{}},{indexBuffer:void 0,vertexBuffer:{}}]}clone(){const t=new G;for(let e=0;e<this.geometries.length;e++){const i=this.geometries[e],s=t.geometries[e];s.indexBuffer=i.indexBuffer.slice(),s.vertexBuffer={};for(const t in i.vertexBuffer){const{data:e,stride:r}=i.vertexBuffer[t];s.vertexBuffer[t]={data:e.slice(),stride:r}}}return t}static deserialize(t){const e=new G;for(let i=0;i<5;++i){e.geometries[i].indexBuffer=new Uint32Array(t.geometries[i].indexBuffer),e.geometries[i].vertexBuffer={};for(const s in t.geometries[i].vertexBuffer)e.geometries[i].vertexBuffer[s]={data:Object(F.c)(t.geometries[i].vertexBuffer[s].data,t.geometries[i].vertexBuffer[s].stride),stride:t.geometries[i].vertexBuffer[s].stride}}return e}serialize(){const t={geometries:[{indexBuffer:this.geometries[0].indexBuffer.buffer,vertexBuffer:{}},{indexBuffer:this.geometries[1].indexBuffer.buffer,vertexBuffer:{}},{indexBuffer:this.geometries[2].indexBuffer.buffer,vertexBuffer:{}},{indexBuffer:this.geometries[3].indexBuffer.buffer,vertexBuffer:{}},{indexBuffer:this.geometries[4].indexBuffer.buffer,vertexBuffer:{}}]};for(let e=0;e<5;++e)for(const i in this.geometries[e].vertexBuffer)t.geometries[e].vertexBuffer[i]={data:this.geometries[e].vertexBuffer[i].data.buffer,stride:this.geometries[e].vertexBuffer[i].stride};return t}getBuffers(){const t=[];for(let e=0;e<5;++e){t.push(this.geometries[e].indexBuffer.buffer);for(const i in this.geometries[e].vertexBuffer)t.push(this.geometries[e].vertexBuffer[i].data.buffer)}return t}}var W=i(534);function q(t,e,i,...s){e<t.length?t.splice(e,i,...s):t.push(...s)}const K=new Map;K.set(W.c.MAP,[W.d.FILL,W.d.LINE,W.d.MARKER,W.d.TEXT]),K.set(W.c.LABEL,[W.d.LABEL]),K.set(W.c.LABEL_ALPHA,[W.d.LABEL]);class Z{constructor(){this.symbolLevels=[]}replay(t,e,i){for(const s of this.symbolLevels)for(const r of s.zLevels){const s=r.geometryDPInfo.unified;if(s)for(const r of s){const s=t.painter.getGeometryBrush(r.geometryType),n=e.getGeometry(r.geometryType),a={geometryType:r.geometryType,materialKey:r.materialKey,indexFrom:r.indexFrom,indexCount:r.indexCount,draw:(t,e,i)=>{n.draw(t,e,i,r.indexFrom,r.indexCount)}};s.prepareState(t,e),s.drawGeometry(t,e,a,i)}}}get empty(){return!this.symbolLevels||0===this.symbolLevels.length}clear(){this.symbolLevels.length=0}addToList(t,e){if(Array.isArray(t))for(const i of t)this._addToList(i,e);else this._addToList(t,e)}removeFromList(t){Array.isArray(t)||(t=[t]);let e=null;for(const i of t)e=this._removeFromList(i);return e}clone(){const t=new Z;for(const e of this.symbolLevels)t.symbolLevels.push(e.clone());return t}splitAfter(t){const e=this._getDisplayList(t.symbolLevel,t.zOrder),i=e.length,s=t.indexFrom+t.indexCount;for(let r=0;r<i;++r){const i=e[r];if(i.geometryType===t.geometryType&&s>i.indexFrom&&s<=i.indexFrom+i.indexCount){if(s<i.indexFrom+i.indexCount){const t=new H;t.geometryType=i.geometryType,t.materialKey=i.materialKey,t.indexFrom=s,t.indexCount=i.indexFrom+i.indexCount-s,e.splice(r+1,0,t),i.indexCount=s-i.indexFrom}return r}}}_addToList(t,e){const i=t.symbolLevel,s=t.zOrder,r=this._getDisplayList(i,s),n=null!=e?e:r.length-1,a=n>=0&&n<r.length?r[n]:null;if(null!==a&&a.materialKey===t.materialKey&&a.indexFrom+a.indexCount===t.indexFrom&&a.geometryType===t.geometryType)a.indexCount+=t.indexCount;else{const e=new H;e.indexFrom=t.indexFrom,e.indexCount=t.indexCount,e.materialKey=t.materialKey,e.geometryType=t.geometryType,q(r,n+1,0,e)}}_removeFromList(t){const e=t.symbolLevel,i=t.zOrder,s=this._getDisplayList(e,i),r=s.length;let n;for(let a=0;a<r;++a){const e=s[a];if(t.indexFrom+t.indexCount>e.indexFrom&&t.indexFrom<e.indexFrom+e.indexCount&&e.geometryType===t.geometryType){n=a;break}}if(void 0!==n){const e=s[n];if(t.indexFrom===e.indexFrom)return e.indexCount-=t.indexCount,e.indexFrom+=t.indexCount,0===e.indexCount&&q(s,n,1),n-1;if(t.indexFrom+t.indexCount===e.indexFrom+e.indexCount)return e.indexCount-=t.indexCount,0===e.indexCount?(q(s,n,1),n-1):n;{const i=e.indexFrom,r=t.indexFrom-e.indexFrom,a=t.indexCount,o=e.indexFrom+e.indexCount-(t.indexFrom+t.indexCount);e.indexCount=r;const c=new H;return c.geometryType=e.geometryType,c.materialKey=e.materialKey,c.indexFrom=i+r+a,c.indexCount=o,q(s,n+1,0,c),n}}return null}_getDisplayList(t,e){let i;const s=this.symbolLevels.length;for(let a=0;a<s;a++)if(this.symbolLevels[a].symbolLevel===t){i=this.symbolLevels[a];break}let r;i||(i=new J,i.symbolLevel=t,this.symbolLevels.push(i));const n=i.zLevels.length;for(let a=0;a<n;a++)if(i.zLevels[a].zLevel===e){r=i.zLevels[a];break}return r||(r=new X,r.geometryDPInfo=new Y,r.zLevel=e,i.zLevels.push(r)),r.geometryDPInfo.unified||(r.geometryDPInfo.unified=[]),r.geometryDPInfo.unified}getDPInfoType(){return"unified"}}class H{constructor(){this.materialKey=null,this.indexFrom=0,this.indexCount=0}clone(){const t=new H;return t.geometryType=this.geometryType,t.materialKey=this.materialKey,t.indexFrom=this.indexFrom,t.indexCount=this.indexCount,t}}class Y{constructor(){this.fill=null,this.line=null,this.marker=null,this.text=null,this.label=null,this.unified=null}clone(){const t=new Y;return t.fill=this.fill&&this.fill.map(t=>t.clone()),t.line=this.line&&this.line.map(t=>t.clone()),t.marker=this.marker&&this.marker.map(t=>t.clone()),t.text=this.text&&this.text.map(t=>t.clone()),t.label=this.label&&this.label.map(t=>t.clone()),t.unified=this.unified&&this.unified.map(t=>t.clone()),t}}class X{constructor(){this.geometryDPInfo=new Y}clone(){const t=new X;return t.zLevel=this.zLevel,t.geometryDPInfo=this.geometryDPInfo.clone(),t}}class J{constructor(){this.zLevels=[]}clone(){const t=new J;t.symbolLevel=this.symbolLevel;for(const e of this.zLevels)t.zLevels.push(e.clone());return t}}class Q{constructor(){this.vertexData=new Map,this.vertexCount=0,this.indexData=[]}clear(){this.vertexData.clear(),this.vertexCount=0,this.indexData=[]}update(t,e,i){for(const s in t)this.vertexData.set(s,t[s]);for(const s in this.vertexData)null===t[s]&&this.vertexData.delete(s);this.vertexCount=e,this.indexData=i}}class ${constructor(t,e,i,s=0,r=0){this.id=t,this.geometryType=e,this.materialKey=i,this.minZoom=s,this.maxZoom=r,this.meshData=null,this.symbolLevel=0,this.zOrder=0,this.vertexFrom=0,this.vertexCount=0,this.indexFrom=0,this.indexCount=0}get sortKey(){return void 0===this._sortKey&&this._computeSortKey(),this._sortKey}clone(){return this.copy()}copy(){const t=new $(this.id,this.geometryType,this.materialKey);return t.vertexFrom=this.vertexFrom,t.vertexCount=this.vertexCount,t.indexFrom=this.indexFrom,t.indexCount=this.indexCount,t.zOrder=this.zOrder,t.symbolLevel=this.symbolLevel,t.meshData=this.meshData,t.minZoom=this.minZoom,t.maxZoom=this.maxZoom,t}setMeshDataFromBuffers(t,e,i){const s=new Q;for(const r in e){const i=e[r].stride,n=e[r].data,a=[],o=Object(F.p)(i);for(let e=0;e<i*t.vertexCount/o;++e)a[e]=n[e+i*t.vertexFrom/o];s.vertexData.set(r,a)}s.indexData.length=0;for(let r=0;r<t.indexCount;++r)s.indexData[r]=i[r+t.indexFrom]-t.vertexFrom;s.vertexCount=t.vertexCount,this.meshData=s}readMeshDataFromBuffers(t,e){this.meshData?this.meshData.clear():this.meshData=new Q;for(const i in t){const e=t[i].stride,s=t[i].data,r=[],n=Object(F.p)(e);for(let t=0;t<e*this.vertexCount/n;++t)r[t]=s[t+e*this.vertexFrom/n];this.meshData.vertexData.set(i,r)}this.meshData.indexData.length=0;for(let i=0;i<this.indexCount;++i)this.meshData.indexData[i]=e[i+this.indexFrom]-this.vertexFrom;this.meshData.vertexCount=this.vertexCount}writeMeshDataToBuffers(t,e,i,s){for(const r in e){const i=e[r].stride,s=this.meshData.vertexData.get(r),n=e[r].data,a=Object(F.p)(i);for(let e=0;e<i*this.meshData.vertexCount/a;++e)n[e+i*t/a]=s[e]}for(let r=0;r<this.meshData.indexData.length;++r)s[r+i]=this.meshData.indexData[r]+t;this.vertexFrom=t,this.vertexCount=this.meshData.vertexCount,this.indexFrom=i,this.indexCount=this.meshData.indexData.length}static writeAllMeshDataToBuffers(t,e,i){let s=0,r=0;for(const n of t)n.writeMeshDataToBuffers(s,e,r,i),s+=n.vertexCount,r+=n.indexCount}_computeSortKey(){this._sortKey=(31&this.symbolLevel)<<12|(127&this.zOrder)<<4|7&this.geometryType}serialize(t){return t.push(this.geometryType),t.push(this.materialKey),t.push(this.vertexFrom),t.push(this.vertexCount),t.push(this.indexFrom),t.push(this.indexCount),t.push(this.minZoom),t.push(this.maxZoom),t}static deserialize(t,e){const i=t.readInt32(),s=t.readInt32(),r=new $(e.id,i,s);return r.vertexFrom=t.readInt32(),r.vertexCount=t.readInt32(),r.indexFrom=t.readInt32(),r.indexCount=t.readInt32(),r.minZoom=t.readInt32(),r.maxZoom=t.readInt32(),r}}function tt(t,e){if(null!==e){t.push(e.length);for(const i of e)i.serialize(t);return t}t.push(0)}class et{constructor(t){this.insertAfter=null,this.id=t,this.displayRecords=[]}copy(){const t=new et(this.id);return t.set(this),t}clone(){const t=new et(this.id);return t.displayRecords=this.displayRecords.map(t=>t.clone()),t.insertAfter=this.insertAfter,t}set(t){this.id=t.id,this.displayRecords=t.displayRecords,this.insertAfter=t.insertAfter}serialize(t){return t.push(this.id),tt(t,this.displayRecords),t}static deserialize(t){const e=t.readInt32(),i=new et(e),s={id:e};return i.displayRecords=function(t,e,i){const s=t.readInt32(),r=new Array(s);for(let n=0;n<r.length;n++)r[n]=e.deserialize(t,i);return r}(t,$,s),i}}class it{constructor(){}get displayObjectRegistry(){if(!this._displayObjectRegistry){this._displayObjectRegistry=new Map;for(const t of this.displayObjects)this._displayObjectRegistry.set(t.id,t)}return this._displayObjectRegistry}get displayList(){return this._displayList}computeDisplayList(){this._displayList=new Z;for(const t of this.displayObjects)for(const e of t.displayRecords)this._displayList.addToList(e)}clone(){const t=new it;return this.displayObjects&&(t.displayObjects=this.displayObjects.map(t=>t.clone())),t}serialize(t){return tt(t,this.displayObjects),t}_deserializeObjects(t){const e=t.readInt32(),i=new Array(e),s=new Map;for(let r=0;r<i.length;++r){const e=et.deserialize(t);i[r]=e,s.set(e.id,e)}this.displayObjects=i,this._displayList=null,this._displayObjectRegistry=s}static deserialize(t){const e=new it;return e._deserializeObjects(t),e}}var st=i(605);class rt{constructor(t,e){this.data=t,this.stride=e}static decode(t){const e=Object(F.c)(t.data,t.stride),i=t.stride;return new rt(e,i)}static fromVertexVector(t){const e=Object(F.c)(t.data.buffer(),t.stride),i=t.stride;return new rt(e,i)}}class nt{constructor(t,e,i){this.geometryType=t,this.indexBuffer=new Uint32Array(e),this.namedBuffers=i}static decode(t){const e=t.geometryType,i=t.indexBuffer,s={};for(const r in t.namedBuffers)s[r]=rt.decode(t.namedBuffers[r]);return new nt(e,i,s)}static fromVertexData(t,e){const i=t.indices,s=Object(F.c)(t.vertices,t.stride),r=t.stride,n={geometry:new rt(s,r)};return new nt(e,i,n)}static fromVertexVectors(t){const e=t.geometryType,i=t.indexVector.buffer(),s={};for(const r in t.namedVectors)s[r]=rt.fromVertexVector(t.namedVectors[r]);return new nt(e,i,s)}}var at=i(560);class ot{constructor(t,e){this.data=t,this.stride=e}get vertexCount(){const t=this.stride/4,e=this.data.length/t;return e!==(0|e)&&console.debug("Corrupted stride"),e}transfer(t,e){const i=this.data.buffer();t.vertexCount=this.vertexCount,t.data=i,t.stride=this.stride,e.push(i)}}class ct{constructor(t,e,i=!1){this.geometryType=t,this.indexVector=new at.a(Uint32Array,6*e),this.namedVectors={};const s=Object(F.l)(t,i);for(const r in s){const t=s[r];let i;switch(t%4){case 0:case 2:i=new at.a(Uint32Array,t*e);break;case 1:case 3:i=new at.a(Uint8Array,t*e)}this.namedVectors[r]=new ot(i,t)}}get(t){return this.namedVectors[t].data}getVector(t){return this.namedVectors[t]}transfer(t,e){const i=this.indexVector.buffer(),s={};e.push(i);for(const r in this.namedVectors){const t=this.namedVectors[r];s[r]={},t.transfer(s[r],e)}t.geometryType=this.geometryType,t.indexBuffer=i,t.namedBuffers=s,this.destroy()}intoBuffers(){const t=nt.fromVertexVectors(this);return this.destroy(),t}destroy(){this.indexVector=null,this.namedVectors=null}}const lt=new U,ht=new U;function ut(t,e){const i={};for(const s in t){const r={data:Object(F.b)(e,t[s]),stride:t[s]};i[s]=r}return i}class dt{constructor(){this.tileDisplayData=null,this.tileBufferData=null}reshuffle(){lt.reset();const t=function(t){const e=[[],[],[],[],[]],i=t;for(const s of i)for(const t of s.displayRecords)e[t.geometryType].push(t);return e}(this.tileDisplayData.displayObjects);for(const s of t)for(const t of s)t&&lt.needMore(t.geometryType,t.meshData?t.meshData.vertexCount:t.vertexCount,t.meshData?t.meshData.indexData.length:t.indexCount);const e=t.length,i=new G;for(let s=0;s<e;++s){i.geometries[s].indexBuffer=new Uint32Array(Math.round(1.5*lt.indicesFor(s)));const t=[];for(const i in this.tileBufferData.geometries[s].vertexBuffer)t.push(this.tileBufferData.geometries[s].vertexBuffer[i].stride);const e=dt._computeVertexAlignment(t),r=Math.round(1.5*lt.verticesFor(s)),n=dt._align(r,e);for(const a in this.tileBufferData.geometries[s].vertexBuffer){const t=this.tileBufferData.geometries[s].vertexBuffer[a].stride;i.geometries[s].vertexBuffer[a]={stride:t,data:Object(F.b)(n,t)}}}ht.reset(),this.tileDisplayData.displayList.clear();for(let s=0;s<e;++s){const e=t[s];for(const t of e){if(t.meshData)t.writeMeshDataToBuffers(ht.verticesFor(s),i.geometries[s].vertexBuffer,ht.indicesFor(s),i.geometries[s].indexBuffer),t.meshData=null;else{const e=this.tileBufferData.geometries[s].vertexBuffer,r=this.tileBufferData.geometries[s].indexBuffer,n=i.geometries[s].vertexBuffer,a=i.geometries[s].indexBuffer,o=ht.verticesFor(s),c=ht.indicesFor(s);Object(F.d)(o,c,n,a,t,e,r),t.vertexFrom=o,t.indexFrom=c}ht.needMore(s,t.vertexCount,t.indexCount)}}for(const s of this.tileDisplayData.displayObjects)this.tileDisplayData.displayList.addToList(s.displayRecords);this.tileBufferData=i}getStrides(){const t=[];for(let e=0;e<this.tileBufferData.geometries.length;++e){const i=this.tileBufferData.geometries[e];t[e]={};for(const s in i.vertexBuffer)t[e][s]=i.vertexBuffer[s].stride}return t}clone(){const t=new dt;return t.tileBufferData=this.tileBufferData.clone(),t.tileDisplayData=this.tileDisplayData.clone(),t}_guessSize(){const{displayObjects:t}=this.tileDisplayData,e=Math.min(t.length,4);let i=0;for(let s=0;s<e;s++)i=Math.max(i,t[s].displayRecords.length);return 2*(12*t.length+t.length*i*40)}serialize(){const t=this.tileBufferData.serialize(),e=this.tileBufferData.getBuffers(),i=this.tileDisplayData.serialize(new at.a(Int32Array,this._guessSize())).buffer();return e.push(i),{result:{displayData:i,bufferData:t},transferList:e}}static fromVertexData(t,e){const i={},s=new Map;for(const r of e)s.set(r.id,r);return Object(F.g)(e=>{const r=t.data[e];if(Object(a.j)(r)){const t=st.a.from(r.records).getCursor();for(;t.next();){const i=t.id,r=t.materialKey,n=t.indexFrom,a=t.indexCount,o=t.vertexFrom,c=t.vertexCount,l=s.get(i),h=new $(i,e,r);h.indexFrom=n,h.indexCount=a,h.vertexFrom=o,h.vertexCount=c,l.displayRecords.push(h)}i[e]=nt.fromVertexData(r,e)}else i[e]=new ct(e,0).intoBuffers()}),dt.fromMeshData({displayObjects:e,vertexBuffersMap:i})}static fromMeshData(t){const e=new dt,i=new it,s=new G;i.displayObjects=t.displayObjects;for(const r in t.vertexBuffersMap){const e=t.vertexBuffersMap[r];s.geometries[r].indexBuffer=e.indexBuffer,s.geometries[r].vertexBuffer=e.namedBuffers}return e.tileDisplayData=i,e.tileBufferData=s,e}static bind(t,e){const i=new dt;return i.tileDisplayData=t,i.tileBufferData=e,i}static create(t,e){const i=new dt;i.tileDisplayData=new it,i.tileDisplayData.displayObjects=t;const s=[0,0,0,0,0],r=[0,0,0,0,0],n=[[],[],[],[],[]];for(const c of t)for(const t of c.displayRecords)n[t.geometryType].push(t),s[t.geometryType]+=t.meshData.vertexCount,r[t.geometryType]+=t.meshData.indexData.length;const a=new G,o=function(t){return[t.fill||{},t.line||{},t.icon||{},t.text||{},t.label||{}]}(e);for(let c=0;c<5;c++){const t=new Uint32Array(r[c]),e=ut(o[c],s[c]);$.writeAllMeshDataToBuffers(n[c],e,t),a.geometries[c]={indexBuffer:t,vertexBuffer:e}}return i.tileBufferData=a,i}static _align(t,e){const i=t%e;return 0===i?t:t+(e-i)}static _computeVertexAlignment(t){let e=!1,i=!1;for(const s of t)s%4==2?e=!0:s%4!=0&&(i=!0);return i?4:e?2:1}}var ft=i(608),pt=i(609),mt=i(582),yt=i(558),xt=i(606),_t=i(559),gt=i(557),bt=i(611),vt=i(299),Ot=i(562),jt=i(588);class wt extends jt.a{constructor(t,e){super(t,e,null)}static from(t){const e=Ot.a.createInstance(),i=[],s=t.filter(t=>!!t.geometry);for(const r of s){const t=Object(m.c)(r.geometry);Object(vt.e)(i,[r],t,!1,!1,"uid")}return new wt(e,i)}get geometryType(){const t=this._current;return t?t.geometryType:null}get insertAfter(){return this._current.insertAfter}readGraphic(){return this._current}getCursor(){return this.copy()}copy(){const t=new wt(this.instance,this._features);return this.copyInto(t),t}}var Tt=i(39),St=i(342),Mt=i(78),It=i(256),Rt=i(250),Lt=i(35),Ct=i(347),zt=i(232),Et=i(103),Ft=i(554);const Dt=new Et.a,At=new Et.a;function Pt(t){t.coords.length=0,t.lengths.length=0}class Bt{constructor(){this.bounds=Object(f.g)(),this.graphic=null,this.size=[0,0,0,0]}static acquire(t=null,e,i,s,r,n){let a;return 0===Bt._pool.length?a=new Bt:(a=Bt._pool.pop(),this._set.delete(a)),a.acquire(t,e,i,s,r,n),a}static release(t){t&&!this._set.has(t)&&(t.release(),this._pool.push(t),this._set.add(t))}static getCentroidQuantized(t,e){if(Object(m.g)(t.geometry)){const i=t.symbol;if(Object(a.i)(i))return null;if(Object(Ft.j)(i.type)||Object(Ft.l)(i.type)){const i=Object(Ct.a)(t.geometry);return Object(zt.b)(e,{},{x:i[0],y:i[1]},!1,!1)}}return null}acquire(t=null,e,i,s,r,n){t&&this.set(t,e,i,s,r,n)}release(){this.graphic=null,this.symbolResource=null,this.geometry=null}get symbol(){return this.symbolResource.symbol}set(t,e,i,s,r,n){this.graphic=t,this.geometry=i,this.symbolResource=e,this.resolution=s,this.updateBounds(s,r,n)}updateBounds(t,e,i){Object(Ft.c)(this.bounds,this.size,this.symbolResource,this.geometry,t,e,i)}getGeometryQuantized(t,e,i){const s=this.geometry;if(Object(m.g)(s)){const e=s.rings;if(1===e.length&&2===e[0].length)return Object(zt.a)(t,{paths:[[e[0][0],e[0][1]]]})}else{if(Object(m.h)(s))return Pt(Dt),Pt(At),Object(vt.h)(Dt,s),Object(vt.q)(At,Dt,s.hasZ,s.hasM,"esriGeometryPolyline",t.scale[0]),Object(vt.u)(Dt,At,s.hasZ,s.hasM,"esriGeometryPolyline",t),Object(vt.o)(Dt,s.hasZ,s.hasM);if(Object(m.e)(s)){const r=this.resolution*this.size[0],[n,a]=Object(_.c)(i),o=a-n,c=s.points.filter(t=>{if(t[0]+r>a||t[0]-r<n){const i=[...t];return t[0]+r>a?i[0]-=o:i[0]+=o,Object(f.e)(e,t,r)||Object(f.e)(e,i,r)}return Object(f.e)(e,t,r)});return 0===c.length?{points:c}:Object(zt.a)(t,{points:c})}}return Object(zt.a)(t,this.geometry)}}Bt._pool=[],Bt._set=new Set;const kt={minX:0,minY:0,maxX:0,maxY:0},Vt=Object(f.g)();function Nt(t,e,i,s,r){return kt.minX=e,kt.minY=i,kt.maxX=s,kt.maxY=r,t.search(kt)}function Ut(t){return{minX:t.bounds[0],minY:t.bounds[1],maxX:t.bounds[2],maxY:t.bounds[3]}}class Gt{constructor(t,e,i,s,r,n){this._graphics=s,this._onAdd=r,this._onRemove=n,this._index=Object(St.a)(9,Ut),this._itemByGraphic=new Map,this._currentLevel=-1/0,this._tileInfoView=t,this._uidFieldName=i;const a=t.getClosestInfoForScale(e);a&&(this._currentLevel=a.level,this._resolution=this._tileInfoView.getTileResolution(a.level));const o=t.spatialReference;this._metersPerUnit=Object(g.l)(o)?Object(Tt.c)(t.spatialReference):1}hitTest(t,e,i,s,r){t=Object(Rt.b)(t,this._tileInfoView.spatialReference);const n=.5*s*i;Vt[0]=t-n,Vt[1]=e-n,Vt[2]=t+n,Vt[3]=e+n;const a=.5*s*(i+Ft.a),o=Nt(this._index,t-a,e-a,t+a,e+a);if(!o||0===o.length)return[];const l={x:t,y:e},h=[];let u;for(const d of o)if(d.graphic.visible)switch(Object(m.c)(d.geometry)){case"esriGeometryPoint":{const t=d.symbol;if(!t)continue;const e=d.geometry,{x:i,y:n}=e,a=s*this._metersPerUnit;let o;switch(t.type){case"esriTS":o=Object(Ft.f)(i,n,t,d.size,s,r);break;case"expanded-cim":o=Object(Ft.d)(i,n,t,s,a,r);break;case"esriSMS":case"esriPMS":o=Object(Ft.e)(i,n,t,s,a,r)}Object(Mt.g)(o,l)&&h.push(d)}break;case"esriGeometryPolyline":{const i=d.symbol;let r=0;if("expanded-cim"===i.type){const t=i.layers;if(!t||0===t.length)continue;const e=t.findIndex(t=>"line"===t.type);if(-1===e)continue;const s=t[e];r=Object(Lt.d)(s.width,null,null)}else{const t=i.layers;if(!t||0===t.length)continue;r=t[0].width}u=1.5*s*window.devicePixelRatio*Object(c.c)(r),Object(Ft.k)(d.geometry,t,e,u)&&h.push(d)}break;case"esriGeometryEnvelope":{const t=d.geometry,e=Object(f.l)(t.xmin,t.ymin,t.xmax,t.ymax);Object(f.n)(e,Vt)&&h.push(d);break}case"esriGeometryPolygon":{if(Object(Mt.g)(d.geometry,l)){h.push(d);break}const t=Object(It.b)(d.geometry);if(Math.abs(t.ymax-t.ymin)<5*s||Math.abs(t.xmax-t.xmin)<5*s){const e=Object(f.l)(t.xmin,t.ymin,t.xmax,t.ymax);Object(f.n)(e,Vt)&&h.push(d)}break}case"esriGeometryMultipoint":{const t=d.symbol;if(!t)continue;const e=d.geometry.points;let i;for(let n=0;n<e.length;n++)if(i="esriTS"===t.type?Object(Ft.f)(e[n][0],e[n][1],t,d.size,s,r):Object(Ft.e)(e[n][0],e[n][1],t,s,s*this._metersPerUnit,r),Object(Mt.g)(i,l)){h.push(d);break}break}}return h.sort((t,e)=>{const i=Object(Ft.h)(t.graphic),s=Object(Ft.h)(e.graphic);return i===s?e.zorder-t.zorder:i-s}),h.map(t=>t.graphic)}getGraphicsData(t,e,i){const s=this._searchForItems(e);if(0===s.length||0===i.length)return[];s.sort((t,e)=>t.zorder-e.zorder),s[0].insertAfter=-1;for(let l=1;l<s.length;l++)s[l].insertAfter=s[l-1].graphic.uid;s.sort((t,e)=>t.graphic.uid-e.graphic.uid),i.sort((t,e)=>t.uid-e.uid);let r,n=0,a=0;const o=[],c={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]};for(const l of i){for(a=-2;n<s.length;)if(r=s[n],n++,l.uid===r.graphic.uid){a=r.insertAfter;break}if(!r.geometry||-2===a)continue;const i=r.getGeometryQuantized(c,e.bounds,this._tileInfoView.spatialReference),h={...r.graphic.attributes};h[this._uidFieldName]=l.uid,null==r.groupId&&(r.groupId=t.createTemplateGroup(r.symbol,null)),o.push({centroid:Bt.getCentroidQuantized(r,c),geometry:i,attributes:h,symbol:r.symbol,groupId:r.groupId,insertAfter:a,zorder:r.zorder})}return o.sort((t,e)=>t.zorder-e.zorder),o}queryTileData(t,e){if(0===this._graphics.length)return[];const{bounds:i,resolution:s}=e,r=this._searchForItems(e),n=[];return 0===r.length||this._createTileGraphics(n,t,r,{originPosition:"upperLeft",scale:[s,s],translate:[i[0],i[3]]},e),n}has(t){return this._itemByGraphic.has(t)}getBounds(t){return this._itemByGraphic.has(t)?this._itemByGraphic.get(t).bounds:null}addOrModify(t,e,i){if(!t)return;this.has(t)&&this.remove(t),this._onAdd(t);const s=Bt.acquire(t,e,i,this._resolution,this._resolution*this._metersPerUnit,this._tileInfoView.spatialReference);return this._itemByGraphic.set(t,s),i&&this._index.insert(s),s.bounds}remove(t){if(!this._itemByGraphic.has(t))return;this._onRemove(t);const e=this._itemByGraphic.get(t);this._index.remove(e),this._itemByGraphic.delete(t)}updateZ(){const t=this._graphics.items;let e,i;for(let s=0;s<t.length;s++)i=t[s],e=this._itemByGraphic.get(i),e&&(e.zorder=s)}update(t,e,i){const s=this._itemByGraphic.get(t);s.groupId=null;const r=Object(f.c)(s.bounds);return s.size[0]=s.size[1]=0,this._index.remove(s),s.set(t,e,i,this._resolution,this._resolution*this._metersPerUnit,this._tileInfoView.spatialReference),i&&this._index.insert(s),{oldBounds:r,newBounds:s.bounds}}updateLevel(t){if(this._currentLevel===t)return;this._currentLevel=t;const e=this._tileInfoView,i=e.getTileResolution(t);this._resolution=i,this._index.clear();const s=this._itemByGraphic,r=[];for(const[n,a]of s)a.updateBounds(this._resolution,this._resolution*this._metersPerUnit,e.spatialReference),a.geometry&&r.push(a);this._index.load(r)}clear(){this._itemByGraphic.clear(),this._index.clear()}_createTileGraphics(t,e,i,s,r){const n=this._uidFieldName,a=this._tileInfoView.spatialReference,{bounds:o}=r;let c,l,h,u;i.sort((t,e)=>t.zorder-e.zorder);for(let d=0;d<i.length;d++){h=i[d],c=h.graphic,l=h.getGeometryQuantized(s,o,a),u=0===d?-1:i[d-1].graphic.uid;const r={...h.graphic.attributes};r[n]=c.uid,null==h.groupId&&(h.groupId=e.createTemplateGroup(h.symbol,null)),t.push({centroid:Bt.getCentroidQuantized(h,s),geometry:l,attributes:r,symbol:h.symbol,groupId:h.groupId,insertAfter:u,zorder:h.zorder})}}_searchForItems(t){const e=this._tileInfoView.spatialReference,i=t.bounds;if(e.isWrappable){const[s,r]=Object(_.c)(e),n=Math.abs(i[2]-r)<1e-5,a=Math.abs(i[0]-s)<1e-5;if((!n||!a)&&(n||a)){const e=t.resolution;let a;a=Object(f.g)(n?[s,i[1],s+e*Ft.a,i[3]]:[r-e*Ft.a,i[1],r,i[3]]);const o=Nt(this._index,i[0],i[1],i[2],i[3]),c=Nt(this._index,a[0],a[1],a[2],a[3]);return[...new Set([...o,...c])]}}return Nt(this._index,i[0],i[1],i[2],i[3])}}var Wt=i(251);const qt=t=>{let e=class extends(Object(Wt.a)(t)){constructor(){super(...arguments),this.graphics=null,this.renderer=null}};return Object(s.a)([Object(l.b)()],e.prototype,"graphics",void 0),Object(s.a)([Object(l.b)()],e.prototype,"renderer",void 0),Object(s.a)([Object(l.b)()],e.prototype,"updating",void 0),Object(s.a)([Object(l.b)()],e.prototype,"view",void 0),e=Object(s.a)([Object(h.a)("esri.views.layers.GraphicsView")],e),e};var Kt=i(335);function Zt(t,e,i){if(i.has(t))return i.get(t);const s={tile:e,addedOrModified:[],removed:[]};return i.set(t,s),s}let Ht=class extends(qt(Object(n.b)(r.a))){constructor(t){super(t),this._storage=new bt.a,this._displayIds=new Map,this._controller=new AbortController,this._tiles=new Map,this._graphicStoreUpdate=!1,this._graphicsSet=new Set,this._matcher=Promise.resolve(null),this._tileUpdateSet=new Set,this._tilesToUpdate=new Map,this._graphicIdToAbortController=new Map,this._attached=!1,this._highlightIds=new Map,this._updatingGraphicsTimer=null,this._hashToExpandedSymbol=new Map,this._hashTpExpandedSymbolPromise=new Map,this._processing=!1,this._needsProcessing=!1,this._pendingUpdate={added:new Set,updated:new Set,removed:new Set},this.lastUpdateId=-1,this.updateRequested=!1,this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}_createMatcher(t,e){if(t){const i=Object(_t.a)({indexCount:0,fields:{}},"feature",t);this._matcher=Object(xt.a)(i,e,null)}}_createDisplayId(t){return this._displayIds.has(t)||this._displayIds.set(t,this._storage.createDisplayId()),this._displayIds.get(t)}initialize(){this._attributeStore=new gt.a({type:"local",initialize:t=>Promise.resolve(this.container.attributeView.initialize(t)),update:t=>this.container.attributeView.requestUpdate(t),render:()=>this.container.requestRender()},Object(Kt.a)()),this.container.hasHighlight=()=>!!this._highlightIds.size;this._graphicStore=new Gt(this.view.featuresTilingScheme,this.view.state.scale,this.uid,this.graphics,t=>{this._createDisplayId(t.uid),this._setFilterState(t.uid,t.visible)},t=>{const e=this._displayIds.get(t.uid);this._displayIds.delete(t.uid),this._storage.releaseDisplayId(e)});const t=new mt.a(this.container.getMaterialItems.bind(this.container),this.view.featuresTilingScheme.tileInfo);this._createMatcher(this.renderer,t),this._meshFactory=new pt.a(null,this.uid,t),this._templateStore=t,this.handles.add([this.watch("renderer",e=>{this._createMatcher(e,t);for(const t of this.graphics)this._pendingUpdate.updated.add(t);this.requestUpdate()}),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{this.graphics.items.length>0&&this._graphicsChangeHandler({target:this.graphics,added:this.graphics.items,removed:[],moved:[]}),this.handles.add(this.graphics.on("change",t=>this._graphicsChangeHandler(t)),"graphics"),this._attached=!0,this.notifyChange("updating")})]);const e=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:e,removed:[]})}destroy(){this._updatingGraphicsTimer&&(clearTimeout(this._updatingGraphicsTimer),this._updatingGraphicsTimer=null,this.notifyChange("updating")),this._controller.abort(),this.container.destroy(),this._set("graphics",null),this._graphicStore.clear(),this._attributeStore=null,this._hashToExpandedSymbol.clear(),this.view=null,this.renderer=null}get updating(){return!this._attached||null!==this._updatingGraphicsTimer||this._tileUpdateSet.size>0||this._tilesToUpdate.size>0}hitTest(t,e){if(!this.view||!this.view.position)return Promise.resolve(null);const i=this.view.toMap(Object(c.a)(t,e));return this.searchFeatures(i).then(t=>t&&t.length?t[0]:null)}async searchFeatures(t,e=2){return this._graphicStore.hitTest(t.x,t.y,e,this.view.state.resolution,this.view.state.rotation)}update(t){Object(o.v)(this._controller.signal);const e=t.state,i=this.view.featuresTilingScheme.getClosestInfoForScale(e.scale).level;if(this._graphicStore.updateLevel(i),this._graphicStoreUpdate=!0,this.updateRequested=!1,this._pendingUpdate.updated.size>0){if(!this._processing)return void this._updateGraphics();this._needsProcessing=!0}}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback())}processUpdate(t){this.updateRequested&&(this.updateRequested=!1,this.update(t))}graphicUpdateHandler(t){const{graphic:e,property:i,newValue:s}=t;switch(i){case"attributes":break;case"geometry":case"symbol":this._pendingUpdate.updated.add(e),this.requestUpdate();break;case"visible":this._setFilterState(e.uid,s),this._attributeStore.sendUpdates()}}addHighlight(t){for(const e of t)if(this._highlightIds.has(e)){const t=this._highlightIds.get(e);this._highlightIds.set(e,t+1)}else this._highlightIds.set(e,1);this._updateHighlight()}removeHighlight(t){for(const e of t)if(this._highlightIds.has(e)){const t=this._highlightIds.get(e)-1;0===t?this._highlightIds.delete(e):this._highlightIds.set(e,t)}this._updateHighlight()}_updateHighlight(){const t=Array.from(this._highlightIds.keys()),e=t.map(t=>this._displayIds.get(t));this._attributeStore.setHighlight(t,e)}_getIntersectingTiles(t){const e=this._graphicStore.getBounds(t);if(!e||0===Object(f.p)(e)||0===Object(f.m)(e))return[];const i=Object(Ft.i)(e,this.view.spatialReference);return Object(a.j)(i)?[...new Set([...this.view.graphicsTileStore.boundsIntersections(i[0]),...this.view.graphicsTileStore.boundsIntersections(i[1])])]:this.view.graphicsTileStore.boundsIntersections(e)}async _updateTile(t){Object(o.v)(this._controller.signal);const e=t.tile,i=this._getGraphicsData(this._templateStore,e,t.addedOrModified),s=await this._processGraphics(e,i);return Object(o.v)(this._controller.signal),this._patchTile(e.key,{type:"update",addOrUpdate:s,remove:t.removed,end:!0,clear:!1,sort:!1}),s}_patchTile(t,e){if(!this._tiles.has(t))return;const i=this._tiles.get(t);this.container.onTileData(i,e),this.container.requestRender()}_graphicsChangeHandler(t){const e=this._pendingUpdate;for(const i of t.added)e.added.add(i);for(const i of t.moved)e.updated.add(i);for(const i of t.removed)this._pendingUpdate.added.has(i)?e.added.delete(i):e.removed.add(i);this._processing?this._needsProcessing=!0:this._updateGraphics()}_getGraphicsToUpdate(){const t={added:[],removed:[],updated:[]};if(!this.graphics)return t;const e=this._pendingUpdate;for(const i of this.graphics.items)e.added.has(i)?t.added.push(i):e.updated.has(i)&&t.updated.push(i);for(const i of e.removed)this._graphicStore.has(i)&&t.removed.push(i);return e.added.clear(),e.removed.clear(),e.updated.clear(),t}async _updateGraphics(){this._processing=!0;const{added:t,removed:e,updated:i}=this._getGraphicsToUpdate(),s=this._tilesToUpdate;let r;try{if(!this._graphicStoreUpdate){const t=this.view.state,e=this.view.featuresTilingScheme.getClosestInfoForScale(t.scale).level;this._graphicStore.updateLevel(e)}const n=[],a=new Array(t.length+e.length);for(let t=0;t<i.length;t++){const e=i[t],o=this._getIntersectingTiles(e);for(const t of o)r=t.id,Zt(r,t,s).removed.push(this._displayIds.get(e.uid));n.push(this._updateGraphic(e,null)),a[t]=e}const o=i.length;for(let e=0;e<t.length;e++){const i=t[e];a[o+e]=i,this._graphicsSet.add(i),n.push(this._addGraphic(i))}for(const t of e){this._abortProcessingGraphic(t.uid);const e=this._getIntersectingTiles(t);for(const i of e)r=i.id,Zt(r,i,s).removed.push(this._displayIds.get(t.uid));this._graphicsSet.delete(t),this._graphicStore.remove(t)}let c;this._flipUpdatingGraphics(),await Promise.all(n);for(let t=0;t<a.length;t++){c=a[t];const e=this._getIntersectingTiles(c);for(const t of e)r=t.id,Zt(r,t,s).addedOrModified.push(c)}this._graphicStore.updateZ();const l=[];for(const[t,e]of s)l.push(this._updateTile(e));await Promise.all(l)}catch(n){Object(o.m)(n)}for(const a of e)try{const t=await this._getSymbolForGraphic(a,{});t&&this._hashToExpandedSymbol.delete(t.hash())}catch(n){Object(o.m)(n)}s.clear(),this.notifyChange("updating"),this._processing=!1,this._needsProcessing&&(this._needsProcessing=!1,this._updateGraphics())}_getArcadeInfo(t){const e=(t.attributes?Object.keys(t.attributes):[]).map(e=>({name:e,alias:e,type:"string"==typeof t.attributes[e]?"esriFieldTypeString":"esriFieldTypeDouble"}));return Object(a.i)(t.geometry)?null:{geometryType:Object(m.c)(t.geometry),spatialReference:d.a.fromJSON(t.geometry.spatialReference),fields:e}}async _getSymbolForGraphic(t,e){return Object(o.v)(this._controller.signal),Object(a.j)(t.symbol)?t.symbol:Object(a.j)(this.renderer)?this.renderer.getSymbolAsync(t,{scale:this.view.scale,abortOptions:e}):this._getNullSymbol(t)}async _getSymbolResources(t,e){if(Object(o.v)(this._controller.signal),!this.container.stage)return null;const i=await this._getSymbolForGraphic(t,e),s=i.hash();let r=this._hashToExpandedSymbol.get(s);if(!r){let a=this._hashTpExpandedSymbolPromise.get(s);if(a)r=await a,Object(o.v)(this._controller.signal);else{const c=this._getArcadeInfo(t),l=Object(_t.c)(i);a=Object(I.a)(l,c,e),this._hashTpExpandedSymbolPromise.set(s,a);try{r=await a,this._hashTpExpandedSymbolPromise.delete(s),this._hashToExpandedSymbol.set(s,r)}catch(n){this._hashTpExpandedSymbolPromise.delete(s),Object(o.v)(n)}}}if("esriTS"===r.type){const t=[],[e]=Object(yt.a)(r.text);for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));const i={symbol:r,id:0,glyphIds:t},[{mosaicItem:s}]=await this.container.getMaterialItems([i]);return{symbol:r,mosaicItem:s}}return{symbol:r,mosaicItem:null}}async _projectAndNormalizeGeometry(t,e){if(Object(o.v)(this._controller.signal),Object(a.i)(t.geometry)||"mesh"===t.geometry.type)return null;let i=t.geometry;if(Object(m.g)(i)){const t=i.rings;i.rings=t}else if(Object(m.h)(i)){const t=i.paths;i.paths=t}else if(Object(m.d)(i)){const s=await this._getSymbolForGraphic(t,e);Object(o.v)(this._controller.signal),i=Object(Ft.j)(s.type)||Object(Ft.l)(s.type)?i.center:u.a.fromExtent(i)}await Object(M.a)(i.spatialReference,this.view.spatialReference);const s=b(i),r=Object(M.b)(s,i.spatialReference,this.view.spatialReference);return Object(p.a)(r),r}_onTileUpdate(t){const e=Object(g.e)(this.view.spatialReference);if(t.added&&t.added.length>0)for(const i of t.added)this._addNewTile(i,e);if(t.removed&&t.removed.length>0)for(const i of t.removed)this._removeTile(i.key)}async _addGraphic(t){this._abortProcessingGraphic(t.uid),Object(o.v)(this._controller.signal);const e=Object(o.d)();this._graphicIdToAbortController.set(t.uid,e);const i={signal:e.signal};try{await this._addOrUpdateGraphic(t,i),Object(o.v)(this._controller.signal),this._graphicIdToAbortController.delete(t.uid)}catch(s){if(this._graphicIdToAbortController.delete(t.uid),!Object(o.m)(s))throw s}}async _updateGraphic(t,e){Object(o.v)(this._controller.signal);const i=this._projectAndNormalizeGeometry(t,e),s=this._getSymbolResources(t,e),[r,n]=await Promise.all([i,s]);Object(o.v)(this._controller.signal),this._graphicStore.addOrModify(t,n,r)}async _addOrUpdateGraphic(t,e){Object(o.v)(this._controller.signal);const i=this._projectAndNormalizeGeometry(t,e),s=this._getSymbolResources(t,e);try{const[e,r]=await Promise.all([i,s]);Object(o.v)(this._controller.signal),this._addProjectedGraphic(t,r,e)}catch(r){if(!Object(o.m)(r))throw r}}_addProjectedGraphic(t,e,i){this._graphicsSet.has(t)&&this._graphicStore.addOrModify(t,e,i)}_addTile(t){const e=this.view.featuresTilingScheme.getTileBounds(Object(f.g)(),t),i=new N(t,e[0],e[3]);return this._tiles.set(t,i),this.container.addChild(i),i}async _addNewTile(t,e){const i=this._addTile(t.key),s=this._graphicStore.queryTileData(this._templateStore,t);if(0===s.length)return;if(e){const i=Math.round((e.valid[1]-e.valid[0])/t.resolution);for(const t of s)t.geometry&&(Object(m.f)(t.geometry)||Object(m.e)(t.geometry))&&this._wrapPoints(t,i)}const r=t.key;this._tileUpdateSet.add(t.key),this.notifyChange("updating");try{const e={type:"update",clear:!1,addOrUpdate:await this._processGraphics(t,s),remove:[],end:!0,sort:!1};i.patch(e),this._tileUpdateSet.delete(r),this.notifyChange("updating")}catch(n){if(this._tileUpdateSet.delete(r),this.notifyChange("updating"),!Object(o.m)(n))throw n}}_removeTile(t){if(!this._tiles.has(t))return;const e=this._tiles.get(t);this.container.removeChild(e),e.destroy(),this._tiles.delete(t)}_setFilterState(t,e){const i=this._displayIds.get(t),s=this._attributeStore.getHighlightFlag(t);this._attributeStore.setData(i,0,0,s|(e?L.g:0))}_getGraphicsData(t,e,i){const s=Object(g.e)(this.view.spatialReference),r=this._graphicStore.getGraphicsData(t,e,i);if(s){const t=Math.round((s.valid[1]-s.valid[0])/e.resolution);for(const e of r)e.geometry&&(Object(m.f)(e.geometry)||Object(m.e)(e.geometry))&&this._wrapPoints(e,t)}return r}_wrapPoints(t,e){const i=t.geometry;Object(m.e)(i)?this._wrapMultipoint(i,e):this._wrapPoint(t,e)}_wrapMultipoint(t,e){const i=t.points,s=[];let r=0,n=0;for(const[a,o]of i){if(s.push([a+r,o]),r=0,e===Ft.b){const t=5*Ft.a;a+n<t?(s.push([e,0]),r=-e):a+n>Ft.b-t&&(s.push([-e,0]),r=e)}else a+n<-Ft.a?(s.push([e,0]),r=-e):a+n>Ft.b+Ft.a&&(s.push([-e,0]),r=e);n+=a}t.points=s}_wrapPoint(t,e){const i=t.geometry;if(e===Ft.b){const s=5*Ft.a;i.x<s?t.geometry={points:[[i.x,i.y],[e,0]]}:i.x>Ft.b-s&&(t.geometry={points:[[i.x,i.y],[-e,0]]})}else i.x<-Ft.a?t.geometry={points:[[i.x,i.y],[e,0]]}:i.x>Ft.b+Ft.a&&(t.geometry={points:[[i.x,i.y],[-e,0]]})}async _processGraphics(t,e,i){if(!e||!e.length||!this._meshFactory)return null;const s=wt.from(e),r=this._meshFactory,n=await this._matcher;return await r.analyzeGraphics(s,n,null,null,i),this._attributeStore.sendUpdates(),this._processAnalyzedGraphics(t,s)}_processAnalyzedGraphics(t,e){const i=this._meshFactory,s=e.getSize(),r=e.getCursor(),n={features:s,records:s,metrics:0},a=new ft.a(t.key.id,n,!1,!1,!1),o=[];for(;r.next();){const e=r.readGraphic();e.insertAfter=-1===e.insertAfter?-1:this._displayIds.get(e.insertAfter),e.displayId=this._displayIds.get(e.attributes[this.uid]);const s=new et(e.displayId);s.insertAfter=e.insertAfter,o.push(s),i.writeGraphic(a,r,t.level)}const c=t.tileInfoView.tileInfo.isWrappable,l=a.serialize(c);if(1!==l.length)return new dt;const h=l[0].message;return dt.fromVertexData(h,o)}_abortProcessingGraphic(t){this._graphicIdToAbortController.has(t)&&this._graphicIdToAbortController.get(t).abort()}_getNullSymbol(t){const e=t.geometry;return Object(m.h)(e)?R.d:Object(m.g)(e)||Object(m.d)(e)?R.c:R.b}_flipUpdatingGraphics(){this._updatingGraphicsTimer&&clearTimeout(this._updatingGraphicsTimer),this._updatingGraphicsTimer=setTimeout(()=>{this._updatingGraphicsTimer=null,this.notifyChange("updating")},160),this.notifyChange("updating")}};Object(s.a)([Object(l.b)({constructOnly:!0})],Ht.prototype,"requestUpdateCallback",void 0),Object(s.a)([Object(l.b)()],Ht.prototype,"container",void 0),Object(s.a)([Object(l.b)({constructOnly:!0})],Ht.prototype,"graphics",void 0),Object(s.a)([Object(l.b)()],Ht.prototype,"updating",null),Object(s.a)([Object(l.b)()],Ht.prototype,"view",void 0),Object(s.a)([Object(l.b)()],Ht.prototype,"updateRequested",void 0),Ht=Object(s.a)([Object(h.a)("esri.views.2d.layers.support.GraphicsView2D")],Ht);var Yt=Ht},621:function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var s=i(610);class r extends s.a{constructor(t){super(t),this.hasHighlight=()=>!0}get hasLabels(){return!1}onTileData(t,e){t.patch(e),this.contains(t)||this.addChild(t),this.requestRender()}onTileError(t){t.clear(),this.contains(t)||this.addChild(t)}_renderChildren(t,e){for(const i of this.children)i.isReady&&i.hasData&&(i.commit(t),t.context.setStencilFunction(514,i.stencilRef,255),i._displayList.replay(t,i,e))}}},622:function(t,e,i){"use strict";i.d(e,"a",(function(){return l}));var s=i(0),r=i(4),n=i(12),a=i(16),o=i(1),c=(i(5),i(6),i(2));const l=t=>{let e=class extends t{initialize(){this.handles.add(Object(a.b)(this,"layer","refresh",()=>{this.doRefresh().catch(t=>{Object(n.m)(t)||r.a.getLogger(this.declaredClass).error(t)})}),"RefreshableLayerView")}};return Object(s.a)([Object(o.b)()],e.prototype,"layer",void 0),e=Object(s.a)([Object(c.a)("esri.layers.mixins.RefreshableLayerView")],e),e}},636:function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var s=i(630),r=i(534),n=i(589);class a extends n.a{get requiresDedicatedFBO(){return this.children.some(t=>"additive"===t.blendFunction)}prepareRenderPasses(t){const e=t.registerRenderPass({name:"bitmap",brushes:[s.a.bitmap],target:()=>this.children,drawPhase:r.c.MAP});return[...super.prepareRenderPasses(t),e]}}},644:function(t,e,i){"use strict";function s(t){var e;const i=t.layer;return"floorInfo"in i&&null!=(e=i.floorInfo)&&e.floorField&&"floors"in t.view?a(t.view.floors,i.floorInfo.floorField):null}function r(t,e){var i;return"floorInfo"in e&&null!=(i=e.floorInfo)&&i.floorField?a(t,e.floorInfo.floorField):null}function n(t,e){const{definitionExpression:i}=e;return t?i?`(${i}) AND (${t})`:t:i}function a(t,e){if(null==t||!t.length)return null;const i=t.filter(t=>""!==t).map(t=>`'${t}'`);return i.push("''"),`${e} IN (${i.join(",")}) OR ${e} IS NULL`}i.d(e,"a",(function(){return n})),i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return r}))},649:function(t,e,i){"use strict";function s(t,e){return e?"xoffset"in e&&e.xoffset?Math.max(t,Math.abs(e.xoffset)):"yoffset"in e&&e.yoffset?Math.max(t,Math.abs(e.yoffset||0)):t:t}function r(t,e){return"number"==typeof t?t:t&&t.stops&&t.stops.length?function(t){let e=0,i=0;for(let s=0;s<t.length;s++){const r=t[s].size;"number"==typeof r&&(e+=r,i++)}return e/i}(t.stops):e}function n(t,e){if(!e)return t;const i=e.filter(t=>"size"===t.type).map(e=>{const{maxSize:i,minSize:s}=e;return(r(i,t)+r(s,t))/2});let s=0;const n=i.length;if(0===n)return t;for(let r=0;r<n;r++)s+=i[r];const a=Math.floor(s/n);return Math.max(a,t)}function a(t){const e=t&&t.renderer,i="touch"===(t&&t.event&&t.event.pointerType)?9:6;if(!e)return i;const r="visualVariables"in e?n(i,e.visualVariables):i;if("simple"===e.type)return s(r,e.symbol);if("unique-value"===e.type){let t=r;return e.uniqueValueInfos.forEach(e=>{t=s(t,e.symbol)}),t}if("class-breaks"===e.type){let t=r;return e.classBreakInfos.forEach(e=>{t=s(t,e.symbol)}),t}return e.type,r}i.d(e,"a",(function(){return a}))},676:function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));i(57);var s=i(3),r=i(39),n=(i(649),i(34));function a(t,e,i,a=new n.a){let o;if("2d"===i.type)o=e*i.resolution;else if("3d"===i.type){const n=i.overlayPixelSizeInMapUnits(t),a=i.basemapSpatialReference;o=Object(s.j)(a)&&!a.equals(i.spatialReference)?Object(r.d)(a)/Object(r.d)(i.spatialReference):e*n}const c=t.x-o,l=t.y-o,h=t.x+o,u=t.y+o,{spatialReference:d}=i;return a.xmin=Math.min(c,h),a.ymin=Math.min(l,u),a.xmax=Math.max(c,h),a.ymax=Math.max(l,u),a.spatialReference=d,a}new n.a},677:function(t,e,i){"use strict";i.d(e,"a",(function(){return a})),i.d(e,"b",(function(){return n}));var s=i(3),r=i(44);async function n(t,e=t.popupTemplate){if(!Object(s.j)(e))return[];const i=await e.getRequiredFields(t.fieldsIndex),{lastEditInfoEnabled:n}=e,{objectIdField:a,typeIdField:o,globalIdField:c,relationships:l}=t;if(i.includes("*"))return["*"];const h=n?await Object(r.n)(t):[],u=Object(r.j)(t.fieldsIndex,[...i,...h]);return o&&u.push(o),u&&a&&t.fieldsIndex.has(a)&&-1===u.indexOf(a)&&u.push(a),u&&c&&t.fieldsIndex.has(c)&&-1===u.indexOf(c)&&u.push(c),l&&l.forEach(e=>{const{keyField:i}=e;u&&i&&t.fieldsIndex.has(i)&&-1===u.indexOf(i)&&u.push(i)}),u}function a(t,e){return t.popupTemplate?t.popupTemplate:Object(s.j)(e)&&e.defaultPopupTemplateEnabled&&Object(s.j)(t.defaultPopupTemplate)?t.defaultPopupTemplate:null}},678:function(t,e,i){"use strict";function s(t,e,i){return e.flatten(({sublayers:t})=>t).length!==t.length||(!!t.some(t=>t.originIdOf("minScale")>i||t.originIdOf("maxScale")>i||t.originIdOf("renderer")>i||t.originIdOf("labelingInfo")>i||t.originIdOf("opacity")>i||t.originIdOf("labelsVisible")>i||t.originIdOf("source")>i)||!n(t,e))}function r(t,e,i){return!!t.some(t=>{const e=t.source;return!(!e||"map-layer"===e.type&&e.mapLayerId===t.id&&(!e.gdbVersion||e.gdbVersion===i.gdbVersion))||t.originIdOf("renderer")>2||t.originIdOf("labelingInfo")>2||t.originIdOf("opacity")>2||t.originIdOf("labelsVisible")>2})||!n(t,e)}function n(t,e){if(!t||!t.length)return!0;const i=e.slice().reverse().flatten(({sublayers:t})=>t&&t.toArray().reverse()).map(t=>t.id).toArray();if(t.length>i.length)return!1;let s=0;const r=i.length;for(const{id:n}of t){for(;s<r&&i[s]!==n;)s++;if(s>=r)return!1}return!0}function a(t){return!!t&&t.some(t=>null!=t.minScale||t.layerDefinition&&null!=t.layerDefinition.minScale)}i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return s}))},685:function(t,e,i){"use strict";i.d(e,"a",(function(){return S}));var s=i(0),r=i(19),n=i(12),a=i(1),o=(i(5),i(6),i(4),i(2)),c=i(34),l=i(68),h=i(24),u=i(329);const d=Math.PI/180;function f(t,e){const i=e.rotation*d,s=Math.abs(Math.cos(i)),r=Math.abs(Math.sin(i)),[n,a]=e.size;return t[0]=Math.round(a*r+n*s),t[1]=Math.round(a*s+n*r),t}var p=i(607),m=i(336),y=i(124);const x=Object(l.g)(),_=[0,0],g=new y.a(0,0,0,0),b=2048,v=2048,O=!1,j=!1,w=!1;let T=class extends r.a{constructor(t){super(t),this._imagePromise=null,this.bitmaps=[],this.hidpi=w,this.imageMaxWidth=b,this.imageMaxHeight=v,this.imageRotationSupported=O,this.imageNormalizationSupported=j,this.update=Object(n.i)(async(t,e)=>{if(!t.stationary||this.destroyed)return null;const i=t.state,s=Object(h.e)(i.spatialReference),r=this.hidpi?t.pixelRatio:1,n=this.imageNormalizationSupported&&i.worldScreenWidth&&i.worldScreenWidth<i.size[0];n?(_[0]=i.worldScreenWidth,_[1]=i.size[1]):this.imageRotationSupported?(_[0]=i.size[0],_[1]=i.size[1]):f(_,i);const a=Math.floor(_[0]*r)>this.imageMaxWidth||Math.floor(_[1]*r)>this.imageMaxHeight,o=s&&(i.extent.xmin<s.valid[0]||i.extent.xmax>s.valid[1]),c=!this.imageNormalizationSupported&&o,l=!a&&!c,u=this.imageRotationSupported?i.rotation:0;if(l){const t=n?i.paddedViewState.center:i.center;this._imagePromise=this._singleExport(i,_,t,i.resolution,u,r,e)}else{let t=Math.min(this.imageMaxWidth,this.imageMaxHeight);c&&(t=Math.min(i.worldScreenWidth,t)),this._imagePromise=this._tiledExport(i,t,u,r,e)}return this._imagePromise.then(async t=>{if(this._imagePromise=null,!this.destroyed){this.bitmaps=null!=t?t:[];for(const e of this.container.children)t.includes(e)||e.fadeOut().then(()=>{e.remove()});for(const e of t)this.container.addChild(e),e.fadeIn()}}).catch(t=>{throw this._imagePromise=null,t})},5e3)}destroy(){this.bitmaps=[]}get updating(){return!this.destroyed&&null!==this._imagePromise}updateExports(t){for(const e of this.container.children){if(!e.visible||!e.stage)return;t(e),e.invalidateTexture(),e.requestRender()}}async _export(t,e,i,s,r,n){const a=await this.fetchSource(t,Math.floor(e*r),Math.floor(i*r),{rotation:s,pixelRatio:r,signal:n}),o=new p.a(a,"additive");return o.x=t.xmin,o.y=t.ymax,o.resolution=t.width/e,o.rotation=s,o.pixelRatio=r,o}async _singleExport(t,e,i,s,r,n,a){!function(t,e,i,s){const[r,n]=e,[a,o]=s,c=.5*i;t[0]=r-c*a,t[1]=n-c*o,t[2]=r+c*a,t[3]=n+c*o}(x,i,s,e);const o=new c.a(x[0],x[1],x[2],x[3],t.spatialReference);return[await this._export(o,e[0],e[1],r,n,a)]}_tiledExport(t,e,i,s,r){const n=u.a.create({size:e,spatialReference:t.spatialReference,scales:[t.scale]}),a=new m.a(n),o=a.getTileCoverage(t);if(!o)return null;const l=[];return o.forEach((n,o,h,u)=>{g.set(n,o,h,u),a.getTileBounds(x,g);const d=new c.a(x[0],x[1],x[2],x[3],t.spatialReference);l.push(this._export(d,e,e,i,s,r))}),Promise.all(l)}};Object(s.a)([Object(a.b)()],T.prototype,"_imagePromise",void 0),Object(s.a)([Object(a.b)()],T.prototype,"bitmaps",void 0),Object(s.a)([Object(a.b)()],T.prototype,"container",void 0),Object(s.a)([Object(a.b)()],T.prototype,"fetchSource",void 0),Object(s.a)([Object(a.b)()],T.prototype,"hidpi",void 0),Object(s.a)([Object(a.b)()],T.prototype,"imageMaxWidth",void 0),Object(s.a)([Object(a.b)()],T.prototype,"imageMaxHeight",void 0),Object(s.a)([Object(a.b)()],T.prototype,"imageRotationSupported",void 0),Object(s.a)([Object(a.b)()],T.prototype,"imageNormalizationSupported",void 0),Object(s.a)([Object(a.b)()],T.prototype,"requestUpdate",void 0),Object(s.a)([Object(a.b)()],T.prototype,"updating",null),T=Object(s.a)([Object(o.a)("esri.views.2d.layers.support.ExportStrategy")],T);var S=T},721:function(t,e,i){"use strict";i.d(e,"a",(function(){return f}));var s=i(0),r=i(19),n=i(102),a=i(3),o=i(1),c=(i(5),i(6),i(4),i(2)),l=i(92),h=i(678),u=i(644);const d={visible:"visibleSublayers",definitionExpression:"layerDefs",labelingInfo:"hasDynamicLayers",labelsVisible:"hasDynamicLayers",opacity:"hasDynamicLayers",minScale:"visibleSublayers",maxScale:"visibleSublayers",renderer:"hasDynamicLayers",source:"hasDynamicLayers"};let f=class extends(Object(n.b)(r.a)){constructor(t){super(t),this.floors=null,this.scale=0}destroy(){this.layer=null}get dynamicLayers(){if(!this.hasDynamicLayers)return null;const t=this.visibleSublayers.map(t=>{const e=Object(u.c)(this.floors,t);return t.toExportImageJSON(e)});return t.length?JSON.stringify(t):null}get hasDynamicLayers(){return this.layer&&Object(h.a)(this.visibleSublayers,this.layer.serviceSublayers,this.layer)}set layer(t){this._get("layer")!==t&&(this._set("layer",t),this.handles.remove("layer"),t&&this.handles.add([t.allSublayers.on("change",()=>this.notifyChange("visibleSublayers")),t.on("sublayer-update",t=>this.notifyChange(d[t.propertyName]))],"layer"))}get layers(){const t=this.visibleSublayers;return t?t.length?"show:"+t.map(t=>t.id).join(","):"show:-1":null}get layerDefs(){var t;const e=!(null==(t=this.floors)||!t.length),i=this.visibleSublayers.filter(t=>null!=t.definitionExpression||e&&null!=t.floorInfo);return i.length?JSON.stringify(i.reduce((t,e)=>{const i=Object(u.c)(this.floors,e),s=Object(a.j)(i)?Object(u.a)(i,e):e.definitionExpression;return t[e.id]=s,t},{})):null}get version(){this.commitProperty("layers"),this.commitProperty("layerDefs"),this.commitProperty("dynamicLayers"),this.commitProperty("timeExtent");const t=this.layer;return t&&(t.commitProperty("dpi"),t.commitProperty("imageFormat"),t.commitProperty("imageTransparency"),t.commitProperty("gdbVersion")),(this._get("version")||0)+1}get visibleSublayers(){const t=[];if(!this.layer)return t;const e=this.layer.sublayers,i=e=>{const s=this.scale,r=0===s,n=0===e.minScale||s<=e.minScale,a=0===e.maxScale||s>=e.maxScale;e.visible&&(r||n&&a)&&(e.sublayers?e.sublayers.forEach(i):t.unshift(e))};e&&e.forEach(i);const s=this._get("visibleSublayers");return!s||s.length!==t.length||s.some((e,i)=>t[i]!==e)?t:s}toJSON(){const t=this.layer;let e={dpi:t.dpi,format:t.imageFormat,transparent:t.imageTransparency,gdbVersion:t.gdbVersion||null};return this.hasDynamicLayers&&this.dynamicLayers?e.dynamicLayers=this.dynamicLayers:e={...e,layers:this.layers,layerDefs:this.layerDefs},e}};Object(s.a)([Object(o.b)({readOnly:!0})],f.prototype,"dynamicLayers",null),Object(s.a)([Object(o.b)()],f.prototype,"floors",void 0),Object(s.a)([Object(o.b)({readOnly:!0})],f.prototype,"hasDynamicLayers",null),Object(s.a)([Object(o.b)()],f.prototype,"layer",null),Object(s.a)([Object(o.b)({readOnly:!0})],f.prototype,"layers",null),Object(s.a)([Object(o.b)({readOnly:!0})],f.prototype,"layerDefs",null),Object(s.a)([Object(o.b)({type:Number})],f.prototype,"scale",void 0),Object(s.a)([Object(o.b)(l.a)],f.prototype,"timeExtent",void 0),Object(s.a)([Object(o.b)({readOnly:!0})],f.prototype,"version",null),Object(s.a)([Object(o.b)({readOnly:!0})],f.prototype,"visibleSublayers",null),f=Object(s.a)([Object(c.a)("esri.layers.mixins.ExportImageParameters")],f)}}]);
  //# sourceMappingURL=40.7b374685.chunk.js.map