(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-355e99e4","chunk-2d0cc20b"],{"4d38":function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return l}));var s=i("a4ee"),r=i("2c4f"),a=i("7d7d"),n=i("59b2"),c=(i("b50f"),i("c120"),i("cea0"),i("d386")),o=i("365a");let h=class extends o["a"]{constructor(e){super(e),this.type="group",this.layerViews=new r["a"]}initialize(){this.handles.add([this.layerViews.on("change",e=>this._layerViewsChangeHandler(e)),this.layer.watch("visibilityMode",()=>this._visibilityModeHandler(),!0),this.watch("visible",()=>this._visibleHandler(),!0)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}set layerViews(e){this._set("layerViews",Object(a["b"])(e,this._get("layerViews")))}get updatingProgress(){return 0===this.layerViews.length?1:this.layerViews.reduce((e,t)=>e+t.updatingProgress,0)/this.layerViews.length}isUpdating(){return this.layerViews.some(e=>e.updating)}_hasLayerViewVisibleOverrides(){return this.layerViews.some(e=>e._isOverridden("visible"))}_findLayerViewForLayer(e){return e&&this.layerViews.find(t=>t.layer===e)}_firstVisibleOnLayerOrder(){const e=this.layer.layers.find(e=>{const t=this._findLayerViewForLayer(e);return t&&t.visible});return e&&this._findLayerViewForLayer(e)}_enforceExclusiveVisibility(e){this._hasLayerViewVisibleOverrides()&&(e||!(e=this._firstVisibleOnLayerOrder())&&this.layerViews.length>0&&(e=this._findLayerViewForLayer(this.layer.layers.getItemAt(0))),this.layerViews.forEach(t=>{t.visible=t===e}))}_layerViewsChangeHandler(e){this.handles.remove("grouplayerview:visible"),this.handles.add(this.layerViews.map(e=>e.watch("visible",t=>this._layerViewVisibleHandler(t,e),!0)).toArray(),"grouplayerview:visible");const t=e.added[e.added.length-1];let i=null;t&&t.visible&&(i=t),this._enforceVisibility(i)}_enforceVisibility(e){if(this._hasLayerViewVisibleOverrides())switch(this.layer.visibilityMode){case"inherited":{const e=this.visible;this.layerViews.forEach(t=>{t.visible=e});break}case"exclusive":this._enforceExclusiveVisibility(e)}}_visibilityModeHandler(){this._enforceVisibility()}_layerViewVisibleHandler(e,t){if(this._hasLayerViewVisibleOverrides())switch(this.layer.visibilityMode){case"inherited":e!==this.visible&&(t.visible=this.visible);break;case"exclusive":this._enforceExclusiveVisibility(e&&t)}}_visibleHandler(){var e;this._hasLayerViewVisibleOverrides()&&"inherited"===(null==(e=this.layer)?void 0:e.visibilityMode)&&this._enforceVisibility()}};Object(s["a"])([Object(n["b"])({cast:a["a"]})],h.prototype,"layerViews",null),Object(s["a"])([Object(n["b"])({readOnly:!0})],h.prototype,"updatingProgress",null),Object(s["a"])([Object(n["b"])()],h.prototype,"view",void 0),h=Object(s["a"])([Object(c["a"])("esri.views.layers.GroupLayerView")],h);const l=h},"566d":function(e,t,i){"use strict";i.d(t,"a",(function(){return L}));var s=i("a4ee"),r=i("2c4f"),a=i("7d7d"),n=i("ce50"),c=i("477c"),o=i("59b2"),h=(i("b50f"),i("c120"),i("cea0"),i("d386")),l=i("00c0"),d=i("6a0ed");i("e92d"),i("2dd4");let p=class extends d["a"]{};p=Object(s["a"])([Object(h["a"])("esri.views.layers.support.ClipArea")],p);const u=p;var b;let y=b=class extends u{constructor(){super(...arguments),this.type="rect",this.left=null,this.right=null,this.top=null,this.bottom=null}clone(){return new b({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}})],y.prototype,"left",void 0),Object(s["a"])([Object(o["b"])({type:[Number,String],json:{write:!0}})],y.prototype,"right",void 0),Object(s["a"])([Object(o["b"])({type:[Number,String],json:{write:!0}})],y.prototype,"top",void 0),Object(s["a"])([Object(o["b"])({type:[Number,String],json:{write:!0}})],y.prototype,"bottom",void 0),Object(s["a"])([Object(o["b"])({readOnly:!0})],y.prototype,"version",null),y=b=Object(s["a"])([Object(h["a"])("esri.views.layers.support.ClipRect")],y);const f=y;i("e06a");var g,v=i("3760"),w=i("a9ab"),O=i("3af1"),m=i("1219");const _={base:v["a"],key:"type",typeMap:{extent:O["a"],polygon:m["a"]}};let j=g=class extends u{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(s["a"])([Object(o["b"])({types:_,json:{read:w["a"],write:!0}})],j.prototype,"geometry",void 0),Object(s["a"])([Object(o["b"])({readOnly:!0})],j.prototype,"version",null),j=g=Object(s["a"])([Object(h["a"])("esri.views.layers.support.Geometry")],j);const R=j;let x=class extends u{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}})],x.prototype,"path",void 0),Object(s["a"])([Object(o["b"])({readOnly:!0})],x.prototype,"version",null),x=Object(s["a"])([Object(h["a"])("esri.views.layers.support.Path")],x);const V=x,S=r["a"].ofType({key:"type",base:u,typeMap:{rect:f,path:V,geometry:R}}),L=e=>{let t=class extends e{constructor(){super(...arguments),this.attached=!1,this.clips=new S,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1}initialize(){var e,t,i,s;const r=null==(e=null==(t=this.view)?void 0:t.spatialReferenceLocked)||e;(null==(i=this.view)?void 0:i.spatialReference)&&r&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new n["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 l["a"]),this.container.fadeTransitionEnabled=!0,this.container.opacity=0,this.container.clips=this.clips,this.handles.add([Object(c["e"])(()=>this.suspended,e=>{this.container&&(this.container.visible=!e),this.view&&!e&&this.updateRequested&&this.view.requestUpdate()},c["d"]),Object(c["e"])(()=>{var e,t;return null!=(e=null==(t=this.layer)?void 0:t.opacity)?e:1},e=>{this.container&&(this.container.opacity=e)},c["d"]),Object(c["e"])(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",e=>{this.container&&(this.container.blendMode=e)},c["d"]),Object(c["e"])(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,e=>{this.container&&(this.container.effect=e)},c["d"]),Object(c["b"])(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)})]),null!=(s=this.view)&&s.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:i,maxScale:s}=t;return(0===i||e<=i)&&(0===s||e>=s)}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,i=this.visibleAtCurrentScale;return t&&(e.spatialReferenceNotSupported=t),i&&(e.outsideScaleRange=i),e}};return Object(s["a"])([Object(o["b"])()],t.prototype,"attached",void 0),Object(s["a"])([Object(o["b"])({type:S,set(e){const t=Object(a["b"])(e,this._get("clips"),S);this._set("clips",t)}})],t.prototype,"clips",void 0),Object(s["a"])([Object(o["b"])()],t.prototype,"container",void 0),Object(s["a"])([Object(o["b"])()],t.prototype,"moving",void 0),Object(s["a"])([Object(o["b"])({readOnly:!0})],t.prototype,"spatialReferenceSupported",null),Object(s["a"])([Object(o["b"])({readOnly:!0})],t.prototype,"updateParameters",void 0),Object(s["a"])([Object(o["b"])()],t.prototype,"updateRequested",void 0),Object(s["a"])([Object(o["b"])()],t.prototype,"updating",null),Object(s["a"])([Object(o["b"])()],t.prototype,"view",void 0),Object(s["a"])([Object(o["b"])({readOnly:!0})],t.prototype,"visibleAtCurrentScale",null),t=Object(s["a"])([Object(h["a"])("esri.views.2d.layers.LayerView2D")],t),t}},"9a02":function(e,t,i){"use strict";i.d(t,"a",(function(){return L}));i("c120");var s=i("b2b2"),r=i("8c71"),a=i("3b1a"),n=i("00c0"),c=i("ce50"),o=i("e92d"),h=i("7c4b"),l=i("9812"),d=i("3349"),p=i("02f1"),u=i("6655"),b=i("8152"),y=i("d114"),f=i("7ce4"),g=i("d17d");const v=o["a"].getLogger("esri.views.2d.engine.webgl.Mesh2D"),w=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 c["a"]("Cannot get DataType of array")}},O=(e,t,i,s)=>{let r=0;for(let a=1;a0:r<0},m=({coords:e,lengths:t},i)=>{const s=[];for(let r=0,a=0;r({...i,[s]:f["a"].createVertex(e,t,this.vertices[s])}),{})),this._cache.vertexBuffers}}var j=i("0fa6");const R=o["a"].getLogger("esri.views.2d.engine.webgl.ClippingInfo"),x=e=>parseFloat(e)/100;class V 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 V(e,t)}_destroyGL(){Object(s["k"])(this._cache.mesh)&&(this._cache.mesh.destroy(),this._cache.mesh=null),Object(s["k"])(this._cache.vao)&&(this._cache.vao.dispose(),this._cache.vao=null)}destroy(){this._destroyGL(),this._handle.remove()}getVAO(e,t,i,r){const[a,n]=t.size;if("geometry"!==this._clip.type&&this._lastWidth===a&&this._lastHeight===n||(this._lastWidth=a,this._lastHeight=n,this._destroyGL()),Object(s["j"])(this._cache.vao)){const s=this._createMesh(t,this._clip),a=s.getIndexBuffer(e),n=s.getVertexBuffers(e);this._cache.mesh=s,this._cache.vao=new j["a"](e,i,r,n,a)}return this._cache.vao}_createTransforms(){return{dvs:Object(r["b"])()}}_invalidate(){this._destroyGL(),this.requestRender()}_createScreenRect(e,t){const[i,s]=e.size,r="string"==typeof t.left?x(t.left)*i:t.left,a="string"==typeof t.right?x(t.right)*i:t.right,n="string"==typeof t.top?x(t.top)*s:t.top,c="string"==typeof t.bottom?x(t.bottom)*s:t.bottom,o=r,h=n;return{x:o,y:h,width:Math.max(i-a-o,0),height:Math.max(s-c-h,0)}}_createMesh(e,t){switch(t.type){case"rect":return _.fromRect(this._createScreenRect(e,t));case"path":return _.fromPath(t);case"geometry":return _.fromGeometry(e,t);default:return R.error(new c["a"]("mapview-bad-type","Unable to create ClippingInfo mesh from clip of type: ${clip.type}")),_.fromRect({x:0,y:0,width:1,height:1})}}}var S=i("c84e");class L extends n["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:i,globalOpacity:s,profiler:r,drawPhase:a}=t,n=a===S["c"].LABEL||a===S["c"].HIGHLIGHT?1:s*this.computedOpacity;r.recordContainerStart(this.name),i.beforeRenderLayer(t,this._clippingInfos?255:0,n),this.updateTransforms(e.state),this.renderChildren(t),i.compositeLayer(t,n),r.recordContainerEnd()}renderChildren(e){Object(s["j"])(this._renderPasses)&&(this._renderPasses=this.prepareRenderPasses(e.painter));for(const i of this.children)i.beforeRender(e);for(const i of this._renderPasses)try{i.render(e)}catch(t){}for(const i of this.children)i.afterRender(e)}createRenderParams(e){return e.requireFBO=this.requiresDedicatedFBO,e}prepareRenderPasses(e){return[e.registerRenderPass({name:"clip",brushes:[a["a"].clip],target:()=>this._clippingInfos,drawPhase:S["c"].MAP|S["c"].LABEL|S["c"].LABEL_ALPHA|S["c"].DEBUG|S["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(s["k"])(this._clippingInfos)&&(this._clippingInfos.forEach(e=>e.destroy()),this._clippingInfos=null),!this.stage)return;const e=this._clips;Object(s["k"])(e)&&e.length&&(this._clippingInfos=e.items.map(e=>V.fromClipArea(this.stage,e))),this.requestRender()}}},d86a:function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return d}));var s=i("a4ee"),r=(i("e92d"),i("cea0"),i("b50f"),i("c120"),i("2dd4"),i("d386")),a=i("9a02"),n=i("d17d");class c extends a["a"]{constructor(){super(...arguments),this.requiresDedicatedFBO=!1}dispose(){}doRender(e){const t=this.createRenderParams(e),{context:i,painter:s,profiler:r}=t;this._prevFBO=i.getBoundFramebufferObject(),r.recordContainerStart(this.name);const a=this._getFbo(t),c=s.getRenderTarget();i.bindFramebuffer(a),s.setRenderTarget(a),i.setDepthWriteEnabled(!0),i.setColorMask(!0,!0,!0,!0),i.setClearColor(0,0,0,0),i.setClearDepth(1),i.clear(i.gl.COLOR_BUFFER_BIT|i.gl.DEPTH_BUFFER_BIT),i.setDepthWriteEnabled(!1);for(const n of this.children)n.beforeRender(e);for(const n of this.children)n.processRender(t);for(const n of this.children)n.afterRender(e);s.setRenderTarget(c),s.releaseFbo(a),i.bindFramebuffer(this._prevFBO),s.beforeRenderLayer(t,this._clippingInfos?255:0,this.computedOpacity),i.setStencilTestEnabled(!1),i.setStencilWriteMask(0),s.blitTexture(i,a.colorTexture,n["z"].NEAREST),s.compositeLayer(t,this.computedOpacity),r.recordContainerEnd()}createRenderParams(e){return{...super.createRenderParams(e),blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:1}}_getFbo(e){const{context:t,painter:i}=e,{width:s,height:r}=t.getViewport();return i.acquireFbo(s,r)}}var o=i("566d"),h=i("4d38");let l=class extends(Object(o["a"])(h["default"])){constructor(){super(...arguments),this.container=new c}attach(){this._updateStageChildren(),this.handles.add(this.layerViews.on("after-changes",()=>this._updateStageChildren()),"grouplayerview2d")}detach(){this.handles.remove("grouplayerview2d"),this.container.removeAllChildren()}update(e){}moveStart(){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,t)=>this.container.addChildAt(e.container,t))}};l=Object(s["a"])([Object(r["a"])("esri.views.2d.layers.GroupLayerView2D")],l);const d=l}}]); //# sourceMappingURL=chunk-355e99e4.503bb593.js.map