(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-8745edba"],{"2d39":function(e,t,s){"use strict";s.d(t,"a",(function(){return a}));var i=s("3b1a"),r=s("c84e"),n=s("9a02");class a extends n["a"]{get requiresDedicatedFBO(){return this.children.some(e=>"additive"===e.blendFunction)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"bitmap",brushes:[i["a"].bitmap],target:()=>this.children,drawPhase:r["c"].MAP});return[...super.prepareRenderPasses(e),t]}}},"46bf":function(e,t,s){"use strict";s.r(t),s.d(t,"default",(function(){return oe}));var i=s("a4ee"),r=s("8d60"),n=s("7ffa"),a=s("e92d"),o=s("b2b2"),l=s("f4cc"),h=s("477c"),c=s("59b2"),d=(s("cea0"),s("d386")),u=s("0f1c"),p=s("9180"),y=s("7f83"),_=s("ff93"),f=s("81af"),g=s("c24e"),b=s("ba6a"),m=s("ae54");const w=512,v=1e-6,S=(e,t)=>e+1/(1<<2*t);class x{constructor(e,t){this._tiles=new Map,this._tileCache=new g["a"](40,e=>e.dispose()),this._viewSize=[0,0],this._visibleTiles=new Map,this.acquireTile=e.acquireTile,this.releaseTile=e.releaseTile,this.tileInfoView=e.tileInfoView,this._container=t}destroy(){for(const[e,t]of this._tiles)t.dispose();this._tiles=null,this._tileCache.clear(),this._tileCache=null}update(e){this._updateCacheSize(e);const t=this.tileInfoView,s=t.getTileCoverage(e.state,0,"smallest"),{spans:i,lodInfo:r}=s,{level:n}=r,a=this._tiles,o=new Set,l=new Set;for(const{row:c,colFrom:d,colTo:u}of i)for(let e=d;e<=u;e++){const t=m["a"].getId(n,c,r.normalizeCol(e),r.getWorldForColumn(e)),s=this._getOrAcquireTile(t);o.add(t),s.processed()?this._addToContainer(s):l.add(new m["a"](t))}for(const[c,d]of a)d.isCoverage=o.has(c);for(const c of l)this._findPlaceholdersForMissingTiles(c,o);let h=!1;for(const[c,d]of a)d.neededForCoverage=o.has(c),d.neededForCoverage||d.isHoldingForFade&&t.intersects(s,d.key)&&o.add(c),d.isFading&&(h=!0);for(const[c,d]of this._tiles)o.has(c)||this._releaseTile(c);return b["a"].pool.release(s),!h}clear(){this._tiles.clear(),this._tileCache.clear(),this._visibleTiles.clear()}clearCache(){this._tileCache.clear()}_findPlaceholdersForMissingTiles(e,t){const s=[];for(const[r,n]of this._tiles)this._addPlaceholderChild(s,n,e,t);const i=s.reduce(S,0);Math.abs(1-i)0;){if(i--,r>>=1,n>>=1,s.level===i&&s.row===r&&s.col===n&&s.world===a)return!0;if(o.has(`${i}/${r}/${n}/${a}`))return!1}return!1}_updateCacheSize(e){const t=e.state.size;if(t[0]===this._viewSize[0]&&t[1]===this._viewSize[1])return;const s=Math.ceil(t[0]/w)+1,i=Math.ceil(t[1]/w)+1;this._viewSize[0]=t[0],this._viewSize[1]=t[1],this._tileCache.maxSize=5*s*i}}function T(e){const[t,s,i,r]=e.split("/"),n=parseInt(t,10);return 0===n?null:`${n-1}/${parseInt(s,10)>>1}/${parseInt(i,10)>>1}/${parseInt(r,10)}`}function R(e,t){const s=t.level-e.level;return e.row===t.row>>s&&e.col===t.col>>s&&e.world===t.world}var O=s("66b9"),C=s("ce6d"),P=s("db21"),I=s("cba1"),j=s("51b2"),k=s("ac41f"),D=s("d5e4"),L=s("bc05"),A=s("ef89");const M=.5,E=1e-6;class q extends C["a"]{constructor(e,t){super(),this.styleRepository=e,this._tileToHandle=new Map,this._viewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._declutterViewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._completed=!1,this._symbolRepository=new D["a"](4096,t,()=>new I["b"]),this._symbolDeclutterer=new k["a"](t,this._symbolRepository,(e,t,s)=>new j["a"](e,t,s,this.styleRepository,this._zoom,this._viewState.rotation),(e,t)=>{e.allSymbolsFadingOut=!0,e.lastOpacityUpdate=t,Object(L["d"])(e,t,!0),e.decluttered=!0,e.requestRender()},(e,t)=>this.styleRepository.getStyleLayerByUID(e.styleLayerUID).z-this.styleRepository.getStyleLayerByUID(t.styleLayerUID).z,e=>{const t=this.styleRepository.getStyleLayerByUID(e);if(this._zoom+E=t.maxzoom)return!1;const s=t.getLayoutProperty("visibility");return!s||s.getValue()!==A["j"].NONE})}addTile(e){e.decluttered=!1,this._tileToHandle.set(e,e.on("symbols-changed",()=>{this._symbolRepository.add(e),this.restartDeclutter()})),this._symbolRepository.add(e),this.restartDeclutter()}removeTile(e){const t=this._tileToHandle.get(e);t&&(this._symbolRepository.removeTile(e),this.restartDeclutter(),t.remove(),this._tileToHandle.delete(e))}update(e,t){return this._zoom=e,this._viewState={scale:t.scale,rotation:t.rotation,center:[t.center[0],t.center[1]],size:[t.size[0],t.size[1]]},this._continueDeclutter(),this._completed}restartDeclutter(){this._completed=!1,this._symbolDeclutterer.restart(),this._notifyUnstable()}clear(){this._completed=!1,this._symbolRepository=null,this._symbolDeclutterer.restart(),this._tileToHandle.forEach(e=>e.remove()),this._tileToHandle.clear()}get stale(){return this._zoom!==this._declutterZoom||this._viewState.size[0]!==this._declutterViewState.size[0]||this._viewState.size[1]!==this._declutterViewState.size[1]||this._viewState.scale!==this._declutterViewState.scale||this._viewState.rotation!==this._declutterViewState.rotation}deleteStyleLayers(e){this._symbolRepository.deleteStyleLayers(e)}_continueDeclutter(){this._completed&&!this.stale||(this._symbolDeclutterer.running||(this._declutterZoom=this._zoom,this._declutterViewState.center[0]=this._viewState.center[0],this._declutterViewState.center[1]=this._viewState.center[1],this._declutterViewState.rotation=this._viewState.rotation,this._declutterViewState.scale=this._viewState.scale,this._declutterViewState.size[0]=this._viewState.size[0],this._declutterViewState.size[1]=this._viewState.size[1],this._symbolDeclutterer.restart()),this._symbolDeclutterer.setScreenSize(this._viewState.size[0],this._viewState.size[1]),this._completed=this._symbolDeclutterer.continue(P["b"]),this._completed&&this._scheduleNotifyStable())}_scheduleNotifyStable(){Object(o["k"])(this._stableNotificationHandle)&&clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=setTimeout(()=>{this._stableNotificationHandle=null,this.emit("fade-complete")},(1+M)*P["d"])}_notifyUnstable(){Object(o["k"])(this._stableNotificationHandle)&&(clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=null),this.emit("fade-start")}}var B=s("c84e"),H=s("8c71"),U=s("e4b1");class z extends U["a"]{_createTransforms(){return{dvs:Object(H["b"])(),tileMat3:Object(H["b"])()}}}var N=s("6722"),V=s("d17d");const F=1e-6;function G(e,t){if(e){const s=e.getLayoutProperty("visibility");if(!s||s.getValue()!==A["j"].NONE&&(void 0===e.minzoom||e.minzoom=t-F))return!0}return!1}class Q extends N["a"]{constructor(e){super(e),this._backgroundTiles=[],this._pointToCallbacks=new Map}destroy(){this.removeAllChildren(),this._spriteMosaic&&(this._spriteMosaic.dispose(),this._spriteMosaic=null),this._glyphMosaic&&(this._glyphMosaic.dispose(),this._glyphMosaic=null),Object(o["k"])(this._symbolFader)&&(this._symbolFader.clear(),this._symbolFader=null),this._styleRepository=null,this._backgroundTiles=[],this._pointToCallbacks.clear()}setStyleResources(e,t,s){if(this._spriteMosaic=e,this._glyphMosaic=t,this._styleRepository=s,Object(o["j"])(this._symbolFader)){const e=new q(this._styleRepository,this.children);e.on("fade-start",()=>{this.emit("fade-start"),this.requestRender()}),e.on("fade-complete",()=>{this.emit("fade-complete"),this.requestRender()}),this._symbolFader=e}Object(o["t"])(this._symbolFader).styleRepository=s}setSpriteMosaic(e){this._spriteMosaic.dispose(),this._spriteMosaic=e}deleteStyleLayers(e){Object(o["k"])(this._symbolFader)&&this._symbolFader.deleteStyleLayers(e)}async hitTest(e){const t=Object(l["g"])();return this._pointToCallbacks.set(e,t),this.requestRender(),t.promise}enterTileInvalidation(){for(const e of this.children)e.invalidating=!0}createRenderParams(e){return{...super.createRenderParams(e),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic,hasClipping:!!this._clippingInfos}}doRender(e){!this.visible||e.drawPhase!==B["c"].MAP&&e.drawPhase!==B["c"].DEBUG||void 0===this._spriteMosaic||super.doRender(e)}addChild(e){return super.addChild(e),Object(o["k"])(this._symbolFader)?this._symbolFader.addTile(e):e.decluttered=!0,this.requestRender(),e}removeChild(e){return Object(o["k"])(this._symbolFader)&&this._symbolFader.removeTile(e),this.requestRender(),super.removeChild(e)}renderChildren(e){const{drawPhase:t}=e;if(t!==B["c"].DEBUG){if(this._doRender(e),this._pointToCallbacks.size>0){e.drawPhase=B["c"].HITTEST;const s=e.painter.effects.hittestVTL;s.bind(e),this._doRender(e),s.draw(e,this._pointToCallbacks),s.unbind(e),e.drawPhase=t}}else super.renderChildren(e)}removeAllChildren(){for(let e=0;ee.neededForCoverage&&e.hasData())}restartDeclutter(){Object(o["k"])(this._symbolFader)&&this._symbolFader.restartDeclutter()}_doRender(e){const{context:t}=e,s=this._styleRepository;if(!s)return;const i=s.layers;let r=!0;e.drawPhase===B["c"].HITTEST&&(r=!1),s.backgroundBucketIds.length>0&&(e.renderPass="background",this._renderBackgroundLayers(e,s.backgroundBucketIds)),super.renderChildren(e),e.drawPhase===B["c"].MAP&&this._fade(e.displayLevel,e.state);const n=this.children.filter(e=>e.visible&&e.hasData());if(!n||0===n.length)return t.bindVAO(),t.setStencilTestEnabled(!0),void t.setBlendingEnabled(!0);for(const a of n)a.triangleCount=0;t.setStencilWriteMask(0),t.setColorMask(!0,!0,!0,!0),t.setStencilOp(V["w"].KEEP,V["w"].KEEP,V["w"].REPLACE),t.setStencilTestEnabled(!0),t.setBlendingEnabled(!1),t.setDepthTestEnabled(!0),t.setDepthWriteEnabled(!0),t.setDepthFunction(V["h"].LEQUAL),t.setClearDepth(1),t.clear(t.gl.DEPTH_BUFFER_BIT),e.renderPass="opaque";for(let a=i.length-1;a>=0;a--)this._renderStyleLayer(i[a],e,n);t.setDepthWriteEnabled(!1),t.setBlendingEnabled(r),t.setBlendFunctionSeparate(V["b"].ONE,V["b"].ONE_MINUS_SRC_ALPHA,V["b"].ONE,V["b"].ONE_MINUS_SRC_ALPHA),e.renderPass="translucent";for(let a=0;ae.decluttered):s.filter(e=>e.neededForCoverage),"vtlSymbol"!==a){const i=t.displayLevel;if(0===s.length||void 0!==e.minzoom&&e.minzoom>=i+F||void 0!==e.maxzoom&&e.maxzoom>1,t.col>>1,t.world);return m["a"].pool.release(t),s}getTileCoverage(e,t,s){const i=super.getTileCoverage(e,t,s);if(!i)return i;const r=1<e.row>=0&&e.rowt[0].scale)return t[0].level;let s,i;for(let r=0;ri.scale)return s=t[r],s.level+(s.scale-e)/(s.scale-i.scale);return t[t.length-1].level}}_initializeFullCacheLODs(e){let t;if(0===e[0].level)t=e.map(e=>({level:e.level,resolution:e.resolution,scale:e.scale}));else{const e=this.tileInfo.size[0],s=this.tileInfo.spatialReference;t=X["a"].create({size:e,spatialReference:s}).lods.map(e=>({level:e.level,resolution:e.resolution,scale:e.scale}))}for(let s=0;s0?this._tileHandlerPromise=this._applyStyleChanges():(this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.state=e.state,this._parseQueue.state=e.state,this._tileManager.update(e)||this.requestUpdate(),this._parseQueue.resume(),this._fetchQueue.resume()))}attach(){const{style:e}=this.layer.currentStyleInfo;this._styleRepository=new W["a"](e),this._tileInfoView=new te(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new Q(this._tileInfoView),this._tileHandler=new f["a"](this.layer,this._styleRepository,window.devicePixelRatio||1),this.container.addChild(this._vectorTileContainer),this._start(),this.handles.add([this._vectorTileContainer.on("fade-start",()=>{this.fading=!0,this.notifyChange("updating"),this.requestUpdate()}),this._vectorTileContainer.on("fade-complete",()=>{var e;null==(e=this._collisionBoxesDisplay)||e.requestRender(),this.fading=!1,this.notifyChange("updating"),this.requestUpdate()}),Object(h["e"])(()=>this.layer.symbolCollisionBoxesVisible,e=>{e?(this._collisionBoxesDisplay=new Z({render:e=>this._renderCollisionBoxes(e.context)}),this.container.addChild(this._collisionBoxesDisplay)):(this.container.removeChild(this._collisionBoxesDisplay),this._collisionBoxesDisplay=null)},h["a"]),this.layer.on("paint-change",e=>{if(e.isDataDriven)this._styleChanges.push({type:_["c"].PAINTER_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate();else{const t=this._styleRepository,s=t.getLayerById(e.layer);if(!s)return;const i=s.type===A["c"].SYMBOL;t.setPaintProperties(e.layer,e.paint),i&&this._vectorTileContainer.restartDeclutter(),this._vectorTileContainer.requestRender()}}),this.layer.on("layout-change",e=>{const t=this._styleRepository,s=t.getLayerById(e.layer);if(!s)return;const i=Object(u["a"])(s.layout,e.layout);if(!Object(o["j"])(i)){if(Object(u["b"])(i,"visibility")&&1===ae(i))return t.setLayoutProperties(e.layer,e.layout),s.type===A["c"].SYMBOL&&this._vectorTileContainer.restartDeclutter(),void this._vectorTileContainer.requestRender();this._styleChanges.push({type:_["c"].LAYOUT_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate()}}),this.layer.on("style-layer-visibility-change",e=>{const t=this._styleRepository,s=t.getLayerById(e.layer);s&&(t.setStyleLayerVisibility(e.layer,e.visibility),s.type===A["c"].SYMBOL&&this._vectorTileContainer.restartDeclutter(),this._vectorTileContainer.requestRender())}),this.layer.on("style-layer-change",e=>{this._styleChanges.push({type:_["c"].LAYER_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate()}),this.layer.on("delete-style-layer",e=>{this._styleChanges.push({type:_["c"].LAYER_REMOVED,data:e}),this.notifyChange("updating"),this.requestUpdate()}),this.layer.on("load-style",()=>this._loadStyle()),this.layer.on("spriteSource-change",e=>{this._newSpriteSource=e.spriteSource,this._styleChanges.push({type:_["c"].SPRITES_CHANGED,data:null});const t=this._styleRepository.layers;for(const s of t)switch(s.type){case A["c"].SYMBOL:s.getLayoutProperty("icon-image")&&this._styleChanges.push({type:_["c"].LAYOUT_CHANGED,data:{layer:s.id,layout:s.layout}});break;case A["c"].LINE:s.getPaintProperty("line-pattern")&&this._styleChanges.push({type:_["c"].PAINTER_CHANGED,data:{layer:s.id,paint:s.paint,isDataDriven:s.isPainterDataDriven()}});break;case A["c"].FILL:s.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:_["c"].PAINTER_CHANGED,data:{layer:s.id,paint:s.paint,isDataDriven:s.isPainterDataDriven()}})}this.notifyChange("updating"),this.requestUpdate()})],this.declaredClass)}detach(){var e,t;this._stop(),this.container.removeAllChildren(),null==(e=this._vectorTileContainer)||e.destroy(),this._vectorTileContainer=null,null==(t=this._tileHandler)||t.destroy(),this._tileHandler=null,this.handles.remove(this.declaredClass)}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this._collisionBoxesDisplay&&this._vectorTileContainer.restartDeclutter(),this.requestUpdate()}supportsSpatialReference(e){var t;return Object(y["d"])(null==(t=this.layer.tileInfo)?void 0:t.spatialReference,e)}canResume(){let e=super.canResume();const{currentStyleInfo:t}=this.layer;if(e&&null!=t&&t.layerDefinition){const s=this.view.scale,{minScale:i,maxScale:r}=t.layerDefinition;t&&t.layerDefinition&&(i&&is&&(e=!1))}return e}isUpdating(){const e=this._vectorTileContainer.children;return!this._isTileHandlerReady||!this._fetchQueue||!this._parseQueue||this._fetchQueue.updating||this._parseQueue.updating||e.length>0&&e.filter(e=>e.invalidating).length>0||this.fading}acquireTile(e){const t=this._createVectorTile(e);return this._tileHandlerPromise.then(()=>{this._fetchQueue.push(t.key).then(e=>this._parseQueue.push({key:t.key,data:e})).then(e=>{t.once("attach",()=>this.requestUpdate()),t.setData(e),this.requestUpdate(),this.notifyChange("updating")}).catch(e=>{this.notifyChange("updating"),Object(l["m"])(e)||re.error(e)})}),t}releaseTile(e){const t=e.key.id;this._fetchQueue.abort(t),this._parseQueue.abort(t),this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new x({acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const e=new AbortController,t=this._tileHandler.start({signal:e.signal}).then(()=>{this._fetchQueue=new se["a"]({tileInfoView:this._tileInfoView,process:(e,t)=>this._getTileData(e,t),concurrency:15}),this._parseQueue=new se["a"]({tileInfoView:this._tileInfoView,process:(e,t)=>this._parseTileData(e,t),concurrency:8}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(e=>{this._vectorTileContainer.setStyleResources(e,this._tileHandler.glyphMosaic,this._styleRepository),this.requestUpdate()}),this._tileHandlerAbortController=e,this._tileHandlerPromise=t}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const e=this._tileHandlerAbortController;e&&e.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue&&(this._fetchQueue.destroy(),this._fetchQueue=null),this._parseQueue&&(this._parseQueue.destroy(),this._parseQueue=null),this._tileManager&&(this._tileManager.destroy(),this._tileManager=null),this._vectorTileContainer.removeAllChildren()}async _getTileData(e,t){const s=await this._tileHandler.fetchTileData(e,t);return this.notifyChange("updating"),s}async _parseTileData(e,t){return this._tileHandler.parseTileData(e,t)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this._tileManager.clearCache();const e=this._styleChanges;try{await this._tileHandler.updateStyle(e)}catch(a){re.error("error applying vector-tiles style update",a.message),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0}const t=this._styleRepository,s=[];e.forEach(e=>{if(e.type!==_["c"].LAYER_REMOVED)return;const i=e.data,r=t.getLayerById(i.layer);r&&s.push(r.uid)});const i=[];let r;e.forEach(e=>{const s=e.type,n=e.data;switch(s){case _["c"].PAINTER_CHANGED:t.setPaintProperties(n.layer,n.paint),r=n.layer;break;case _["c"].LAYOUT_CHANGED:t.setLayoutProperties(n.layer,n.layout),r=n.layer;break;case _["c"].LAYER_REMOVED:return void t.deleteStyleLayer(n.layer);case _["c"].LAYER_CHANGED:t.setStyleLayer(n.layer,n.index),r=n.layer.id;break;case _["c"].SPRITES_CHANGED:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(this._newSpriteSource)),this._newSpriteSource=null,r=null}const a=t.getLayerById(r);a&&i.push(a.uid)});const n=this._vectorTileContainer.children;if(s.length>0){this._vectorTileContainer.deleteStyleLayers(s);for(const e of n)e.deleteLayerData(s)}if(this._fetchQueue.resume(),this._parseQueue.resume(),i.length>0){const e=[];for(const t of n){const s=this._fetchQueue.push(t.key).then(e=>this._parseQueue.push({key:t.key,data:e,styleLayerUIDs:i})).then(e=>t.setData(e));e.push(s)}await Promise.all(e)}this._styleChanges=[],this._isTileHandlerReady=!0,this.notifyChange("updating"),this.requestUpdate()}async _loadStyle(){const{style:e}=this.layer.currentStyleInfo,t=Object(n["a"])(e);this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this.notifyChange("updating"),this._styleRepository=new W["a"](t),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:s}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,t),await this._tileHandlerPromise}catch(r){if(!Object(l["m"])(r))throw r}if(s.aborted)return this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.notifyChange("updating"),void this.requestUpdate();const i=await this._tileHandler.spriteMosaic;this._vectorTileContainer.setStyleResources(i,this._tileHandler.glyphMosaic,this._styleRepository),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.notifyChange("updating"),this.requestUpdate()}_createVectorTile(e){const t=this._tileInfoView.getTileBounds(Object(p["l"])(),e);return new O["a"](e,t[0],t[3],512,512,this._styleRepository)}_renderCollisionBoxes(e){for(const t of this._vectorTileContainer.children)if(t.symbols){const s=[];for(const[e,i]of t.symbols)s.push(...i);Object(J["a"])(e,s)}}};function ae(e){if(Object(o["j"])(e))return 0;switch(e.type){case"partial":return Object.keys(e.diff).length;case"complete":return Math.max(Object.keys(e.oldValue).length,Object.keys(e.newValue).length);case"collection":return Object.keys(e.added).length+Object.keys(e.changed).length+Object.keys(e.removed).length}}Object(i["a"])([Object(c["b"])()],ne.prototype,"_fetchQueue",void 0),Object(i["a"])([Object(c["b"])()],ne.prototype,"_parseQueue",void 0),Object(i["a"])([Object(c["b"])()],ne.prototype,"_isTileHandlerReady",void 0),Object(i["a"])([Object(c["b"])()],ne.prototype,"fading",void 0),ne=Object(i["a"])([Object(d["a"])("esri.views.2d.layers.VectorTileLayerView2D")],ne);const oe=ne},"51b2":function(e,t,s){"use strict";s.d(t,"a",(function(){return l}));var i=s("8c71"),r=s("db21"),n=s("bc05"),a=s("ef89");function o(e,t,s,i,r,n){const{iconRotationAlignment:o,textRotationAlignment:l,iconTranslate:h,iconTranslateAnchor:c,textTranslate:d,textTranslateAnchor:u}=i;let p=0;for(const y of e.colliders){const[e,i]=0===y.partIndex?h:d,_=0===y.partIndex?c:u,f=y.minLod<=n&&n<=y.maxLod;p+=f?0:1,y.enabled=f,y.xScreen=y.xTile*r[0]+y.yTile*r[3]+r[6],y.yScreen=y.xTile*r[1]+y.yTile*r[4]+r[7],_===a["i"].MAP?(y.xScreen+=s*e-t*i,y.yScreen+=t*e+s*i):(y.xScreen+=e,y.yScreen+=i),a["a"].VIEWPORT===(0===y.partIndex?o:l)?(y.dxScreen=y.dxPixels,y.dyScreen=y.dyPixels):(y.dxScreen=s*(y.dxPixels+y.width/2)-t*(y.dyPixels+y.height/2)-y.width/2,y.dyScreen=t*(y.dxPixels+y.width/2)+s*(y.dyPixels+y.height/2)-y.height/2)}e.colliders.length>0&&p===e.colliders.length&&(e.unique.show=!1)}class l{constructor(e,t,s,a,o,l){this._symbols=e,this._styleRepository=a,this._zoom=o,this._currentLayerCursor=0,this._currentSymbolCursor=0,this._styleProps=new Map,this._allNeededMatrices=new Map,this._gridIndex=new n["a"](t,s,r["a"]),this._si=Math.sin(Math.PI*l/180),this._co=Math.cos(Math.PI*l/180);for(const r of e)for(const e of r.symbols)this._allNeededMatrices.has(e.tile)||this._allNeededMatrices.set(e.tile,Object(i["a"])(e.tile.transforms.tileUnitsToPixels))}work(e){const t=this._gridIndex;function s(e){const s=e.xScreen+e.dxScreen,i=e.yScreen+e.dyScreen,r=s+e.width,n=i+e.height,[a,o,l,h]=t.getCellSpan(s,i,r,n);for(let c=o;c<=h;c++)for(let e=a;e<=l;e++){const a=t.cells[c][e];for(const e of a){const t=e.xScreen+e.dxScreen,a=e.yScreen+e.dyScreen,o=t+e.width,l=a+e.height;if(!(ro||nl))return!0}}return!1}const i=performance.now();for(;this._currentLayerCursore)return!1;const n=t.symbols[this._currentSymbolCursor];if(!n.unique.show)continue;o(n,this._si,this._co,r,this._allNeededMatrices.get(n.tile),this._zoom);const a=n.unique;if(!a.show)continue;const{iconAllowOverlap:l,iconIgnorePlacement:h,textAllowOverlap:c,textIgnorePlacement:d}=r;for(const e of n.colliders){if(!e.enabled)continue;const t=a.parts[e.partIndex];t.show&&(!(e.partIndex?c:l)&&s(e)&&(e.hard?a.show=!1:t.show=!1))}if(a.show)for(const e of n.colliders){if(!e.enabled)continue;if(e.partIndex?d:h)continue;if(!a.parts[e.partIndex].show)continue;const t=e.xScreen+e.dxScreen,s=e.yScreen+e.dyScreen,i=t+e.width,r=s+e.height,[n,o,l,c]=this._gridIndex.getCellSpan(t,s,i,r);for(let a=o;a<=c;a++)for(let t=n;t<=l;t++)this._gridIndex.cells[a][t].push(e)}}}return!0}_getProperties(e){const t=this._styleProps.get(e);if(t)return t;const s=this._zoom,i=this._styleRepository.getStyleLayerByUID(e),r=i.getLayoutValue("symbol-placement",s)!==a["e"].POINT;let n=i.getLayoutValue("icon-rotation-alignment",s);n===a["a"].AUTO&&(n=r?a["a"].MAP:a["a"].VIEWPORT);let o=i.getLayoutValue("text-rotation-alignment",s);o===a["a"].AUTO&&(o=r?a["a"].MAP:a["a"].VIEWPORT);const l=i.getPaintValue("icon-translate",s),h=i.getPaintValue("icon-translate-anchor",s),c=i.getPaintValue("text-translate",s),d=i.getPaintValue("text-translate-anchor",s),u={iconAllowOverlap:i.getLayoutValue("icon-allow-overlap",s),iconIgnorePlacement:i.getLayoutValue("icon-ignore-placement",s),textAllowOverlap:i.getLayoutValue("text-allow-overlap",s),textIgnorePlacement:i.getLayoutValue("text-ignore-placement",s),iconRotationAlignment:n,textRotationAlignment:o,iconTranslateAnchor:h,iconTranslate:l,textTranslateAnchor:d,textTranslate:c};return this._styleProps.set(e,u),u}}},"566d":function(e,t,s){"use strict";s.d(t,"a",(function(){return P}));var i=s("a4ee"),r=s("2c4f"),n=s("7d7d"),a=s("ce50"),o=s("477c"),l=s("59b2"),h=(s("b50f"),s("c120"),s("cea0"),s("d386")),c=s("00c0"),d=s("6a0ed");s("e92d"),s("2dd4");let u=class extends d["a"]{};u=Object(i["a"])([Object(h["a"])("esri.views.layers.support.ClipArea")],u);const p=u;var y;let _=y=class extends p{constructor(){super(...arguments),this.type="rect",this.left=null,this.right=null,this.top=null,this.bottom=null}clone(){return new y({left:this.left,right:this.right,top:this.top,bottom:this.bottom})}get version(){return(this._get("version")||0)+1}};Object(i["a"])([Object(l["b"])({type:[Number,String],json:{write:!0}})],_.prototype,"left",void 0),Object(i["a"])([Object(l["b"])({type:[Number,String],json:{write:!0}})],_.prototype,"right",void 0),Object(i["a"])([Object(l["b"])({type:[Number,String],json:{write:!0}})],_.prototype,"top",void 0),Object(i["a"])([Object(l["b"])({type:[Number,String],json:{write:!0}})],_.prototype,"bottom",void 0),Object(i["a"])([Object(l["b"])({readOnly:!0})],_.prototype,"version",null),_=y=Object(i["a"])([Object(h["a"])("esri.views.layers.support.ClipRect")],_);const f=_;s("e06a");var g,b=s("3760"),m=s("a9ab"),w=s("3af1"),v=s("1219");const S={base:b["a"],key:"type",typeMap:{extent:w["a"],polygon:v["a"]}};let x=g=class extends p{constructor(){super(...arguments),this.type="geometry",this.geometry=null}get version(){return(this._get("version")||0)+1}clone(){return new g({geometry:this.geometry.clone()})}};Object(i["a"])([Object(l["b"])({types:S,json:{read:m["a"],write:!0}})],x.prototype,"geometry",void 0),Object(i["a"])([Object(l["b"])({readOnly:!0})],x.prototype,"version",null),x=g=Object(i["a"])([Object(h["a"])("esri.views.layers.support.Geometry")],x);const T=x;let R=class extends p{constructor(){super(...arguments),this.type="path",this.path=[]}get version(){return(this._get("version")||0)+1}};Object(i["a"])([Object(l["b"])({type:[[[Number]]],json:{write:!0}})],R.prototype,"path",void 0),Object(i["a"])([Object(l["b"])({readOnly:!0})],R.prototype,"version",null),R=Object(i["a"])([Object(h["a"])("esri.views.layers.support.Path")],R);const O=R,C=r["a"].ofType({key:"type",base:p,typeMap:{rect:f,path:O,geometry:T}}),P=e=>{let t=class extends e{constructor(){super(...arguments),this.attached=!1,this.clips=new C,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1}initialize(){var e,t,s,i;const r=null==(e=null==(t=this.view)?void 0:t.spatialReferenceLocked)||e;(null==(s=this.view)?void 0:s.spatialReference)&&r&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new a["a"]("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new c["a"]),this.container.fadeTransitionEnabled=!0,this.container.opacity=0,this.container.clips=this.clips,this.handles.add([Object(o["e"])(()=>this.suspended,e=>{this.container&&(this.container.visible=!e),this.view&&!e&&this.updateRequested&&this.view.requestUpdate()},o["d"]),Object(o["e"])(()=>{var e,t;return null!=(e=null==(t=this.layer)?void 0:t.opacity)?e:1},e=>{this.container&&(this.container.opacity=e)},o["d"]),Object(o["e"])(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",e=>{this.container&&(this.container.blendMode=e)},o["d"]),Object(o["e"])(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,e=>{this.container&&(this.container.effect=e)},o["d"]),Object(o["b"])(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)})]),null!=(i=this.view)&&i.whenLayerView?this.view.whenLayerView(this.layer).then(e=>{e===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}destroy(){this.processDetach(),this.updateRequested=!1}get spatialReferenceSupported(){var e;const t=null==(e=this.view)?void 0:e.spatialReference;return null==t||this.supportsSpatialReference(t)}get updating(){var e;return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!(null==(e=this.updatingHandles)||!e.updating))}get visibleAtCurrentScale(){return this.isVisibleAtScale(this.view.scale)}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.detach(),this.updateRequested=!1)}isVisibleAtScale(e){const t=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;if(!t)return!0;const{minScale:s,maxScale:i}=t;return(0===s||e<=s)&&(0===i||e>=i)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.suspended||this.view.requestUpdate())}processUpdate(e){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",e),this.updateRequested&&!this.suspended&&(this.updateRequested=!1,this.update(e))):this.updateRequested=!1}hitTest(e,t){return Promise.resolve(null)}supportsSpatialReference(e){return!0}canResume(){return!!this.spatialReferenceSupported&&!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const e=super.getSuspendInfo(),t=!this.spatialReferenceSupported,s=this.visibleAtCurrentScale;return t&&(e.spatialReferenceNotSupported=t),s&&(e.outsideScaleRange=s),e}};return Object(i["a"])([Object(l["b"])()],t.prototype,"attached",void 0),Object(i["a"])([Object(l["b"])({type:C,set(e){const t=Object(n["b"])(e,this._get("clips"),C);this._set("clips",t)}})],t.prototype,"clips",void 0),Object(i["a"])([Object(l["b"])()],t.prototype,"container",void 0),Object(i["a"])([Object(l["b"])()],t.prototype,"moving",void 0),Object(i["a"])([Object(l["b"])({readOnly:!0})],t.prototype,"spatialReferenceSupported",null),Object(i["a"])([Object(l["b"])({readOnly:!0})],t.prototype,"updateParameters",void 0),Object(i["a"])([Object(l["b"])()],t.prototype,"updateRequested",void 0),Object(i["a"])([Object(l["b"])()],t.prototype,"updating",null),Object(i["a"])([Object(l["b"])()],t.prototype,"view",void 0),Object(i["a"])([Object(l["b"])({readOnly:!0})],t.prototype,"visibleAtCurrentScale",null),t=Object(i["a"])([Object(h["a"])("esri.views.2d.layers.LayerView2D")],t),t}},6722:function(e,t,s){"use strict";s.d(t,"a",(function(){return h}));var i=s("c120"),r=s("c84e"),n=s("9a02"),a=s("6f75"),o=s("ec5e");const l=(e,t)=>e.key.level-t.key.level!=0?e.key.level-t.key.level:e.key.row-t.key.row!=0?e.key.row-t.key.row:e.key.col-t.key.col;class h extends n["a"]{constructor(e){super(),this._tileInfoView=e}get requiresDedicatedFBO(){return!1}renderChildren(e){this.sortChildren(l),this.setStencilReference(e),super.renderChildren(e)}createRenderParams(e){const{state:t}=e,s=super.createRenderParams(e);return s.requiredLevel=this._tileInfoView.getClosestInfoForScale(t.scale).level,s.displayLevel=this._tileInfoView.tileInfo.scaleToZoom(t.scale),s}prepareRenderPasses(e){const t=super.prepareRenderPasses(e);return t.push(e.registerRenderPass({name:"stencil",brushes:[o["a"]],drawPhase:r["c"].DEBUG|r["c"].MAP|r["c"].HIGHLIGHT,target:()=>this.getStencilTarget()})),Object(i["a"])("esri-tiles-debug")&&t.push(e.registerRenderPass({name:"tileInfo",brushes:[a["a"]],drawPhase:r["c"].DEBUG,target:()=>this.children})),t}getStencilTarget(){return this.children}updateTransforms(e){for(const t of this.children){const s=this._tileInfoView.getTileResolution(t.key);t.setTransform(e,s)}}setStencilReference(e){let t=1;for(const s of this.children)s.stencilRef=t++}}},"81af":function(e,t,s){"use strict";s.d(t,"a",(function(){return v}));var i=s("f4cc"),r=s("e041"),n=s("dfa0"),a=s("a9c0");class o{constructor(e,t){this._width=0,this._height=0,this._free=[],this._width=e,this._height=t,this._free.push(new a["a"](0,0,e,t))}get width(){return this._width}get height(){return this._height}allocate(e,t){if(e>this._width||t>this._height)return new a["a"];let s=null,i=-1;for(let r=0;re&&this._free.push(new a["a"](s.x+e,s.y,s.width-e,t)),s.height>t&&this._free.push(new a["a"](s.x,s.y+t,s.width,s.height-t))):(s.width>e&&this._free.push(new a["a"](s.x+e,s.y,s.width-e,s.height)),s.height>t&&this._free.push(new a["a"](s.x,s.y+t,e,s.height-t))),new a["a"](s.x,s.y,e,t))}release(e){for(let t=0;t{if(t<=256){const s=e+t;if(this._rangePromises.has(s))l.push(this._rangePromises.get(s));else{const r=i.getRange(e,t).then(()=>{this._rangePromises.delete(s)},()=>{this._rangePromises.delete(s)});this._rangePromises.set(s,r),l.push(r)}}}),Promise.all(l).then(()=>{let r=this._glyphIndex[e];r||(r={},this._glyphIndex[e]=r);for(const n of t){const t=r[n];if(t){s[n]={sdf:!0,rect:t.rect,metrics:t.metrics,page:t.page,code:n};continue}const l=i.getGlyph(e,n);if(!l||!l.metrics)continue;const h=l.metrics;let c;if(0===h.width)c=new a["a"](0,0,0,0);else{const e=3,t=h.width+2*e,s=h.height+2*e;let i=t%4?4-t%4:4,r=s%4?4-s%4:4;1===i&&(i=5),1===r&&(r=5),c=this._binPack.allocate(t+i,s+r),c.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(void 0),this._binPack=new o(this.width-4,this.height-4),c=this._binPack.allocate(t+i,s+r));const n=this._glyphData[this._currentPage],a=l.bitmap;let d,u;if(a)for(let o=0;o{s.addRange(t,new p(new u["a"](new Uint8Array(e.data),new DataView(e.data))))}).catch(()=>{s.addRange(t,new p)})}getGlyph(e,t){const s=this._getFontStack(e);if(!s)return;const i=Math.floor(t/256);if(i>256)return;const r=s.getRange(i);return r?{metrics:r.getMetrics(t),bitmap:r.getBitmap(t)}:void 0}_getFontStack(e){let t=this._glyphInfo[e];return t||(t=this._glyphInfo[e]=new y),t}}var f=s("793f");const g="dasharray-";class b{constructor(e,t,s=0){this._size=[],this._mosaicsData=[],this._textures=[],this._dirties=[],this._maxItemSize=0,this._currentPage=0,this._pageWidth=0,this._pageHeight=0,this._mosaicRects={},this.pixelRatio=1,(e<=0||t<=0)&&console.error("Sprites mosaic defaultWidth and defaultHeight must be greater than zero!"),this._pageWidth=e,this._pageHeight=t,s>0&&(this._maxItemSize=s),this._binPack=new o(e-4,t-4)}dispose(){this._binPack=null,this._mosaicRects={};for(const e of this._textures)e&&e.dispose();this._textures.length=0}getWidth(e){return e>=this._size.length?-1:this._size[e][0]}getHeight(e){return e>=this._size.length?-1:this._size[e][1]}getPageSize(e){return e>=this._size.length?null:this._size[e]}setSpriteSource(e){if(this.dispose(),this.pixelRatio=e.devicePixelRatio,0===this._mosaicsData.length){this._binPack=new o(this._pageWidth-4,this._pageHeight-4);const e=Math.floor(this._pageWidth),t=Math.floor(this._pageHeight),s=new Uint32Array(e*t);this._mosaicsData[0]=s,this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0)}this._sprites=e}getSpriteItem(e,t=!1){let s,i,r=this._mosaicRects[e];if(r)return r;if(!this._sprites||"loaded"!==this._sprites.loadStatus)return null;if(e&&e.startsWith(g)?([s,i]=this._rasterizeDash(e),t=!0):s=this._sprites.getSpriteInfo(e),!s||!s.width||!s.height||s.width<0||s.height<0)return null;const n=s.width,a=s.height,[o,l,h]=this._allocateImage(n,a);return o.width<=0?null:(this._copy(o,s,l,h,t,i),r={rect:o,width:n,height:a,sdf:s.sdf,simplePattern:!1,pixelRatio:s.pixelRatio,page:l},this._mosaicRects[e]=r,r)}getSpriteItems(e){const t={};for(const s of e)t[s.name]=this.getSpriteItem(s.name,s.repeat);return t}getMosaicItemPosition(e,t){const s=this.getSpriteItem(e,t),i=s&&s.rect;if(!i)return null;i.width=s.width,i.height=s.height;const r=s.width,n=s.height,a=2;return{tl:[i.x+a,i.y+a],br:[i.x+a+r,i.y+a+n],page:s.page}}bind(e,t,s=0,i=0){this._textures[s]||(this._textures[s]=new h["a"](e,{pixelFormat:l["p"].RGBA,dataType:l["q"].UNSIGNED_BYTE,wrapMode:l["B"].CLAMP_TO_EDGE,width:this._size[s][0],height:this._size[s][1]},new Uint8Array(this._mosaicsData[s].buffer)));const r=this._textures[s];r.setSamplingMode(t),this._dirties[s]&&r.setData(new Uint8Array(this._mosaicsData[s].buffer)),e.bindTexture(r,i),this._dirties[s]=!1}static _copyBits(e,t,s,i,r,n,a,o,l,h,c){let d=i*t+s,u=o*n+a;if(c){u-=n;for(let a=-1;a<=h;a++,d=((a+h)%h+i)*t+s,u+=n)for(let t=-1;t<=l;t++)r[u+t]=e[d+(t+l)%l]}else for(let p=0;p=this._mosaicsData.length)return;const a=new Uint32Array(n?n.buffer:this._sprites.image.buffer),o=this._mosaicsData[s];o&&a||console.error("Source or target images are uninitialized!");const l=2,h=n?t.width:this._sprites.width;b._copyBits(a,h,t.x,t.y,o,i[0],e.x+l,e.y+l,t.width,t.height,r),this._dirties[s]=!0}_allocateImage(e,t){e+=2,t+=2;const s=Math.max(e,t);if(this._maxItemSize&&this._maxItemSizethis._spriteMosaic)}get glyphMosaic(){return this._glyphMosaic}async start(e){this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,e),this._spriteSourcePromise.then(e=>{this._spriteMosaic=new b(1024,1024,250),this._spriteMosaic.setSpriteSource(e)});const t=new _(this._layer.currentStyleInfo.glyphsUrl?Object(r["e"])(this._layer.currentStyleInfo.glyphsUrl,{...this._layer.customParameters,token:this._layer.apiKey}):null);this._glyphMosaic=new c(1024,1024,t),this._broadcastPromise=Object(n["b"])("WorkerTileHandler",{client:this,schedule:e.schedule,signal:e.signal}).then(t=>(this._connection=t,Promise.all(this._connection.broadcast("setStyle",this._layer.currentStyleInfo.style,e))))}async updateStyle(e){return await this._broadcastPromise,this._broadcastPromise=Promise.all(this._connection.broadcast("updateStyle",e)),this._broadcastPromise}setSpriteSource(e){const t=new b(1024,1024,250);return t.setSpriteSource(e),this._spriteMosaic=t,this._spriteSourcePromise=Promise.resolve(e),t}async setStyle(e,t){await this._broadcastPromise,this._styleRepository=e,this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,null),this._spriteSourcePromise.then(e=>{this._spriteMosaic=new b(1024,1024,250),this._spriteMosaic.setSpriteSource(e)});const s=new _(this._layer.currentStyleInfo.glyphsUrl?Object(r["e"])(this._layer.currentStyleInfo.glyphsUrl,{...this._layer.customParameters,token:this._layer.apiKey}):null);return this._glyphMosaic=new c(1024,1024,s),this._broadcastPromise=Promise.all(this._connection.broadcast("setStyle",t)),this._broadcastPromise}fetchTileData(e,t){return this._getRefKeys(e,t).then(e=>{const s=this._layer.sourceNameToSource,i=[];for(const t in s)i.push(t);return this._getSourcesData(i,e,t)})}parseTileData(e,t){const s=e&&e.data;if(!s)return Promise.resolve(null);const{sourceName2DataAndRefKey:i,transferList:r}=s;return 0===Object.keys(i).length?Promise.resolve(null):this._broadcastPromise.then(()=>this._connection.getAvailableClient().then(s=>s.invoke("createTileAndParse",{key:e.key.id,sourceName2DataAndRefKey:i,styleLayerUIDs:e.styleLayerUIDs},{...t,transferList:r})))}async getSprites(e){return await this._spriteSourcePromise,this._spriteMosaic.getSpriteItems(e)}getGlyphs(e){return this._glyphMosaic.getGlyphItems(e.font,e.codePoints)}perfReport({key:e,milliseconds:t}){Object(m["b"])(e,t,"ms")}async _getTilePayload(e,t,s){const r=w["a"].pool.acquire(e.id),n=this._layer.sourceNameToSource[t],{level:a,row:o,col:l}=r;w["a"].pool.release(r);try{return{protobuff:await n.requestTile(a,o,l,s),sourceName:t}}catch(h){if(Object(i["m"])(h))throw h;return{protobuff:null,sourceName:t}}}_getRefKeys(e,t){const s=this._layer.sourceNameToSource,r=new Array;for(const i in s){const n=s[i].getRefKey(e,t);r.push(n)}return Object(i["j"])(r)}_getSourcesData(e,t,s){const r=[];for(let i=0;i{const s={},i=[];for(let r=0;r0){const n=t[r].value.id;s[e[r].value.sourceName]={refKey:n,protobuff:e[r].value.protobuff},i.push(e[r].value.protobuff)}return{sourceName2DataAndRefKey:s,transferList:i}})}}},"894c":function(e,t,s){"use strict";s.d(t,"a",(function(){return r}));var i=s("b2b2");class r{constructor(e,t,s){this.pixelBlock=e,this.extent=t,this.originalPixelBlock=s}get width(){return Object(i["k"])(this.pixelBlock)?this.pixelBlock.width:0}get height(){return Object(i["k"])(this.pixelBlock)?this.pixelBlock.height:0}render(e){const t=this.pixelBlock;if(Object(i["j"])(t))return;const s=this.filter({pixelBlock:t});if(Object(i["j"])(s.pixelBlock))return;const r=s.pixelBlock.getAsRGBA(),n=e.createImageData(s.pixelBlock.width,s.pixelBlock.height);n.data.set(r),e.putImageData(n,0,0)}getRenderedRasterPixels(){const e=this.filter({pixelBlock:this.pixelBlock});return Object(i["j"])(e.pixelBlock)?null:{width:e.pixelBlock.width,height:e.pixelBlock.height,renderedRasterPixels:new Uint8Array(e.pixelBlock.getAsRGBA().buffer)}}}},"9a02":function(e,t,s){"use strict";s.d(t,"a",(function(){return P}));s("c120");var i=s("b2b2"),r=s("8c71"),n=s("3b1a"),a=s("00c0"),o=s("ce50"),l=s("e92d"),h=s("7c4b"),c=s("9812"),d=s("3349"),u=s("02f1"),p=s("6655"),y=s("8152"),_=s("d114"),f=s("7ce4"),g=s("d17d");const b=l["a"].getLogger("esri.views.2d.engine.webgl.Mesh2D"),m=e=>{switch(e.BYTES_PER_ELEMENT){case 1:return g["k"].UNSIGNED_BYTE;case 2:return g["k"].UNSIGNED_SHORT;case 4:return g["k"].UNSIGNED_INT;default:throw new o["a"]("Cannot get DataType of array")}},w=(e,t,s,i)=>{let r=0;for(let n=1;n0:r<0},v=({coords:e,lengths:t},s)=>{const i=[];for(let r=0,n=0;r({...s,[i]:f["a"].createVertex(e,t,this.vertices[i])}),{})),this._cache.vertexBuffers}}var x=s("0fa6");const T=l["a"].getLogger("esri.views.2d.engine.webgl.ClippingInfo"),R=e=>parseFloat(e)/100;class O extends h["a"]{constructor(e,t){super(),this._clip=t,this._cache={},this.stage=e,this._handle=t.watch("version",()=>this._invalidate()),this.ready()}static fromClipArea(e,t){return new O(e,t)}_destroyGL(){Object(i["k"])(this._cache.mesh)&&(this._cache.mesh.destroy(),this._cache.mesh=null),Object(i["k"])(this._cache.vao)&&(this._cache.vao.dispose(),this._cache.vao=null)}destroy(){this._destroyGL(),this._handle.remove()}getVAO(e,t,s,r){const[n,a]=t.size;if("geometry"!==this._clip.type&&this._lastWidth===n&&this._lastHeight===a||(this._lastWidth=n,this._lastHeight=a,this._destroyGL()),Object(i["j"])(this._cache.vao)){const i=this._createMesh(t,this._clip),n=i.getIndexBuffer(e),a=i.getVertexBuffers(e);this._cache.mesh=i,this._cache.vao=new x["a"](e,s,r,a,n)}return this._cache.vao}_createTransforms(){return{dvs:Object(r["b"])()}}_invalidate(){this._destroyGL(),this.requestRender()}_createScreenRect(e,t){const[s,i]=e.size,r="string"==typeof t.left?R(t.left)*s:t.left,n="string"==typeof t.right?R(t.right)*s:t.right,a="string"==typeof t.top?R(t.top)*i:t.top,o="string"==typeof t.bottom?R(t.bottom)*i:t.bottom,l=r,h=a;return{x:l,y:h,width:Math.max(s-n-l,0),height:Math.max(i-o-h,0)}}_createMesh(e,t){switch(t.type){case"rect":return S.fromRect(this._createScreenRect(e,t));case"path":return S.fromPath(t);case"geometry":return S.fromGeometry(e,t);default:return T.error(new o["a"]("mapview-bad-type","Unable to create ClippingInfo mesh from clip of type: ${clip.type}")),S.fromRect({x:0,y:0,width:1,height:1})}}}var C=s("c84e");class P extends a["a"]{constructor(){super(...arguments),this.name=this.constructor.name}set clips(e){this._clips=e,this.children.forEach(t=>t.clips=e),this._updateClippingInfo()}_createTransforms(){return{dvs:Object(r["b"])()}}doRender(e){const t=this.createRenderParams(e),{painter:s,globalOpacity:i,profiler:r,drawPhase:n}=t,a=n===C["c"].LABEL||n===C["c"].HIGHLIGHT?1:i*this.computedOpacity;r.recordContainerStart(this.name),s.beforeRenderLayer(t,this._clippingInfos?255:0,a),this.updateTransforms(e.state),this.renderChildren(t),s.compositeLayer(t,a),r.recordContainerEnd()}renderChildren(e){Object(i["j"])(this._renderPasses)&&(this._renderPasses=this.prepareRenderPasses(e.painter));for(const s of this.children)s.beforeRender(e);for(const s of this._renderPasses)try{s.render(e)}catch(t){}for(const s of this.children)s.afterRender(e)}createRenderParams(e){return e.requireFBO=this.requiresDedicatedFBO,e}prepareRenderPasses(e){return[e.registerRenderPass({name:"clip",brushes:[n["a"].clip],target:()=>this._clippingInfos,drawPhase:C["c"].MAP|C["c"].LABEL|C["c"].LABEL_ALPHA|C["c"].DEBUG|C["c"].HIGHLIGHT})]}updateTransforms(e){for(const t of this.children)t.setTransform(e)}onAttach(){super.onAttach(),this._updateClippingInfo()}onDetach(){super.onDetach(),this._updateClippingInfo()}_updateClippingInfo(){if(Object(i["k"])(this._clippingInfos)&&(this._clippingInfos.forEach(e=>e.destroy()),this._clippingInfos=null),!this.stage)return;const e=this._clips;Object(i["k"])(e)&&e.length&&(this._clippingInfos=e.items.map(e=>O.fromClipArea(this.stage,e))),this.requestRender()}}},ac41f:function(e,t,s){"use strict";s.d(t,"a",(function(){return a}));var i=s("b2b2"),r=s("db21");function n(e,t){if(e.priority-t.priority)return e.priority-t.priority;const s=e.tile.key,i=t.tile.key;return s.world-i.world?s.world-i.world:s.level-i.level?s.level-i.level:s.row-i.row?s.row-i.row:s.col-i.col?s.col-i.col:e.xTile-t.xTile?e.xTile-t.xTile:e.yTile-t.yTile}class a{constructor(e,t,s,i,r,n){this._visibleTiles=e,this._symbolRepository=t,this._createCollisionJob=s,this._assignTileSymbolsOpacity=i,this._symbolLayerSorter=r,this._isLayerVisible=n,this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}get running(){return this._running}setScreenSize(e,t){this._screenWidth===e&&this._screenHeight===t||this.restart(),this._screenWidth=e,this._screenHeight=t}restart(){this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}continue(e){if(this._selectionJob||(this._selectionJob=this._createSelectionJob()),!this._selectionJobCompleted){const t=performance.now();if(!this._selectionJob.work(e))return!1;if(this._selectionJobCompleted=!0,0===(e=Math.max(0,e-(performance.now()-t))))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){const t=performance.now();if(!this._collisionJob.work(e))return!1;if(this._collisionJobCompleted=!0,0===(e=Math.max(0,e-(performance.now()-t))))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const t=performance.now();if(!this._opacityJob.work(e))return!1;if(this._opacityJobCompleted=!0,0===(e=Math.max(0,e-(performance.now()-t))))return!1}return this._running=!1,!0}_createSelectionJob(){const e=this._symbolRepository.uniqueSymbols;for(let n=0;na)return!1;let e=null,t=!1,i=!1;for(const s of o.tileSymbols)if(!i||!t){const r=s.tile;(!e||r.isCoverage||r.neededForCoverage&&!t)&&(e=s,(r.neededForCoverage||r.isCoverage)&&(i=!0),r.isCoverage&&(t=!0))}if(e.selectedForRendering=!0,i){c.symbols.push(e),o.show=!0;for(const e of o.parts)e.show=!0}else o.show=!1}}for(const e of t)e.symbols.sort(n);return!0}const o=this._symbolLayerSorter;return{work:a,get sortedSymbols(){return t.sort(o)}}}_createOpacityJob(){const e=this._assignTileSymbolsOpacity,t=this._visibleTiles;let s=0;function r(t,s){const i=t.symbols;for(const[e,r]of i)o(r,s);e(t,s);for(const e of t.childrenTiles)r(e,s)}return{work(e){const n=performance.now();for(;se)return!1;const a=t[s];Object(i["k"])(a.parentTile)||r(a,performance.now())}return!0}}}}function o(e,t){for(const s of e){const e=s.unique;for(const s of e.parts){const i=s.targetOpacity>.5?1:-1;s.startOpacity+=i*((t-s.startTime)/r["d"]),s.startOpacity=Math.min(Math.max(s.startOpacity,0),1),s.startTime=t,s.targetOpacity=e.show&&s.show?1:0}}}},bf7f:function(e,t,s){"use strict";function i(e,t,s,i,r,n){e.fillStyle=t,e.fillRect(s,i,r,n)}function r(e,t,s,i,r,n){e.strokeStyle=t,e.strokeRect(s,i,r,n)}function n(e,t){const s=window.COLLISION_XRAY;for(let n=0;nr[e].max)&&(r[e].max=t)}s.d(t,"a",(function(){return n})),s.d(t,"b",(function(){return a}))},c73a:function(e,t,s){"use strict";s.d(t,"a",(function(){return _}));var i=s("b2b2"),r=s("1c92"),n=s("8c71"),a=s("738e"),o=s("7c4b"),l=s("894c"),h=s("d17d"),c=s("a1ff");function d(e){return e&&"render"in e}function u(e){return e&&!("render"in e)}function p(e){const t=document.createElement("canvas");return t.width=e.width,t.height=e.height,e.render(t.getContext("2d")),t}function y(e,t,s){const i={target:h["A"].TEXTURE_2D,pixelFormat:h["p"].RGBA,internalFormat:h["p"].RGBA,dataType:h["q"].UNSIGNED_BYTE,wrapMode:h["B"].CLAMP_TO_EDGE};return t&&s&&(i.width=t,i.height=s),new c["a"](e,i)}class _ extends o["a"]{constructor(e=null,t,s=!0){super(),this.requestRenderOnSourceChangedEnabled=s,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=t,this.source=e,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(e){this._height=e}get source(){return this._source}set source(e){this._source=e,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(e){this._width=e}beforeRender(e){super.beforeRender(e),this.updateTexture(e.context)}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRenderOnSourceChangedEnabled&&this.requestRender())}_createTransforms(){return{dvs:Object(n["b"])()}}setTransform(e){const t=Object(r["b"])(this.transforms.dvs),[s,i]=e.toScreenNoRotation([0,0],[this.x,this.y]),n=this.resolution/this.pixelRatio/e.resolution,o=n*this.width,l=n*this.height,h=Math.PI*this.rotation/180;Object(r["c"])(t,t,Object(a["b"])(s,i)),Object(r["c"])(t,t,Object(a["b"])(o/2,l/2)),Object(r["n"])(t,t,-h),Object(r["c"])(t,t,Object(a["b"])(-o/2,-l/2)),Object(r["j"])(t,t,Object(a["b"])(o,l)),Object(r["l"])(this.transforms.dvs,e.displayViewMat3,t)}setSamplingProfile(e){this._texture&&(e.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(e.samplingMode))}bind(e,t){this._texture&&e.bindTexture(this._texture,t)}updateTexture(e){var t;if(!this.stage)return null==(t=this._texture)||t.dispose(),void(this._texture=null);if(!this._textureInvalidated)return;this._textureInvalidated=!1,this._texture||(this.source?this._texture=y(e,this.sourceWidth,this.sourceHeight):this._texture=y(e));const s=this.source;if(s){if(this._texture.resize(this.sourceWidth,this.sourceHeight),d(s))if(s instanceof l["a"]){const e=s.getRenderedRasterPixels();this._texture.setData(Object(i["k"])(e)?e.renderedRasterPixels:null)}else this._texture.setData(p(s));else u(s)&&this._texture.setData(s);this.ready()}else this._texture.setData(null)}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}}},d5e4:function(e,t,s){"use strict";s.d(t,"a",(function(){return l}));var i=s("b2b2"),r=s("bc05");const n=32,a=8,o=64;class l{constructor(e,t,s){this.tileCoordRange=e,this._visibleTiles=t,this._createUnique=s,this._tiles=new Map,this._uniqueSymbolsReferences=new Map}get uniqueSymbols(){return Object(i["j"])(this._uniqueSymbolLayerArray)&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}add(e,t){this._uniqueSymbolLayerArray=null;let s=this._tiles.get(e.id);s||(s={symbols:new Map},this._tiles.set(e.id,s));const i=new Map;if(t)for(const r of t)s.symbols.has(r)&&(i.set(r,s.symbols.get(r)),s.symbols.delete(r));else for(const[r,n]of e.layerData)s.symbols.has(r)&&(i.set(r,s.symbols.get(r)),s.symbols.delete(r));this._removeSymbols(i);const l=e.symbols,h=new Map;for(const[c,d]of l){let e=d.length;if(e>=n){let t=this.tileCoordRange;do{t/=2,e/=4}while(e>a&&t>o);const i=new r["a"](this.tileCoordRange,this.tileCoordRange,t);h.set(c,{flat:d,index:i}),s.symbols.set(c,{flat:d,index:i});for(const e of d)i.getCell(e.xTile,e.yTile).push(e)}else h.set(c,{flat:d}),s.symbols.set(c,{flat:d})}this._addSymbols(e.key,l)}deleteStyleLayers(e){this._uniqueSymbolLayerArray=null;for(const[t,s]of this._tiles){const i=new Map;for(const t of e)s.symbols.has(t)&&(i.set(t,s.symbols.get(t)),s.symbols.delete(t));this._removeSymbols(i),0===s.symbols.size&&this._tiles.delete(t)}}removeTile(e){this._uniqueSymbolLayerArray=null;const t=this._tiles.get(e.id);if(!t)return;const s=new Map;for(const[i,r]of e.symbols)t.symbols.has(i)&&(s.set(i,t.symbols.get(i)),t.symbols.delete(i));this._removeSymbols(s),0===t.symbols.size&&this._tiles.delete(e.id)}_removeSymbols(e){for(const[t,{flat:s}]of e)for(const e of s){const s=e.unique,i=s.tileSymbols,r=i.length-1;for(let t=0;tt.level){const s=e.key.level-t.level;if(e.key.row>>s!==t.row||e.key.col>>s!==t.col)return}if(t.level>e.key.level){const s=t.level-e.key.level;if(t.row>>s!==e.key.row||t.col>>s!==e.key.col)return}if(t.equals(e.key)){for(const i of e.childrenTiles)this._matchSymbols(i,t,s);return}const n=new Map;for(const[a,o]of s){const s=[];for(const i of o){const n=Object(r["c"])(this.tileCoordRange,i.xTile,t.level,t.col,e.key.level,e.key.col),a=Object(r["c"])(this.tileCoordRange,i.yTile,t.level,t.row,e.key.level,e.key.row);n>=0&&n=0&&a0&&n.set(a,l)}for(const i of e.childrenTiles)this._matchSymbols(i,t,n)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsReferences,t=new Array(e.size);let s,i=0;for(const[r,n]of e){const e=new Array(n.size);s=0;for(const t of n)e[s++]=t;t[i]={styleLayerUID:r,uniqueSymbols:e},i++}return t}}}}]); //# sourceMappingURL=chunk-8745edba.776363db.js.map