// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built require({cache:{"esri/views/2d/engine/Stage":function(){define("exports ../../../core/Error ../../../core/has ../../../core/maybe ../../../core/scheduling ../../../core/signal ../../../core/libs/gl-matrix-2/factories/mat3f32 ../../../symbols/cim/cimAnalyzer ./Container ./ManagedCanvas ./webgl/definitions ./webgl/enums ./webgl/Painter ./webgl/PooledUint32Array ./webgl/Profiler ./webgl/TileReshuffleManager ./webgl/shaderGraph/techniques/TechniqueRegistry ./webgl/shaderGraph/techniques/mesh/MeshWriterRegistry ../support/Timeline ../../support/screenshotUtils ../../webgl/enums ../../webgl/FramebufferObject ../../webgl/RenderbufferDescriptor ../../webgl/RenderingContext ../../webgl/TextureDescriptor ../../../core/imageUtils".split(" "), function(e,g,q,h,m,l,d,b,a,f,n,c,r,k,p,t,w,u,y,x,v,A,z,B,D,F){class E extends a.Container{constructor(C,G){super();this.meshWriterRegistry=new u.MeshWriterRegistry;this._trash=new Set;this._lastFrameRenderTime=this._renderRemainingTime=0;this._renderRequested=l.signal(!1);this.stage=this;this._stationary=!0;this._reshuffleManager=new t.TileReshuffleManager;this._canvas=new f.ManagedCanvas(C);this.context=new B.RenderingContext(this._canvas.gl,G.contextOptions??{});this.painter=new r(this.context, this);this._cimAnalyzer=new b.CIMAnalyzer(this.painter.textureManager.resourceManager);q("esri-2d-profiler")&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),C.appendChild(this._debugOutput));const H=()=>this._highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null, context:this.context,painter:this.painter,timeline:G.timeline||new y.Timeline,renderingOptions:G.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new p.Profiler(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return H()},reshuffleManager:this._reshuffleManager,backgroundColor:G.backgroundColor};this._taskHandle=m.addFrameTask({render:K=>this.renderFrame(K)});this._taskHandle.pause();this._lostWebGLContextHandle=this._canvas.events.on("webgl-context-lost", K=>this.emit("webgl-error",{error:new g("webgl-context-lost",K.statusMessage)}));this._bufferPool=new k.ArrayBufferPool;w.startup()}destroy(){w.shutdown(this.context);this.removeAllChildren();this._emptyTrash();this._taskHandle=h.removeMaybe(this._taskHandle);this._lostWebGLContextHandle=h.removeMaybe(this._lostWebGLContextHandle);this._canvas.destroy();this._debugOutput?.parentNode?.removeChild(this._debugOutput);this._bufferPool.destroy();this.painter.dispose();this.context.dispose();this._canvas= null}get textureManager(){return this.painter.textureManager}get backgroundColor(){return this._renderParameters.backgroundColor}set backgroundColor(C){this._renderParameters.backgroundColor=C;this.requestRender()}get bufferPool(){return this._bufferPool}get cimAnalyzer(){return this._cimAnalyzer}get renderingOptions(){return this._renderingOptions}set renderingOptions(C){this._renderingOptions=C;this.requestRender()}get renderRequested(){return this._renderRequested.value}get state(){return this._state}set state(C){this._state= C;this.requestRender()}get stationary(){return this._stationary}set stationary(C){this._stationary!==C&&(this._stationary=C,this.requestRender())}trashDisplayObject(C){this._trash.add(C);this.requestRender()}untrashDisplayObject(C){return this._trash.delete(C)}requestRender(){this._renderRemainingTime=2E3;this.renderRequested||(this._renderRequested.value=!0,this._taskHandle.resume())}renderFrame(C){this._renderRemainingTime-=this._lastFrameRenderTime?C.time-this._lastFrameRenderTime:0;0>=this._renderRemainingTime&& this._taskHandle.pause();this._lastFrameRenderTime=C.time;this._renderRequested.value=!1;this._renderParameters.state=this._state;this._renderParameters.stationary=this.stationary;this._renderParameters.pixelRatio=window.devicePixelRatio;this._renderParameters.globalOpacity=1;this._renderParameters.time=C.time;this._renderParameters.deltaTime=C.deltaTime;this._renderParameters.effects=null;this.processRender(this._renderParameters);this._emptyTrash()}_createTransforms(){return{displayViewScreenMat3:d.create()}}renderChildren(C){for(const G of this.children)G.beforeRender(C); this._reshuffleManager.reshuffle(n.MAX_TILE_RESHUFFLES_PER_FRAME);this._canvas.render(C,()=>this._renderChildren(this.children,C));for(const G of this.children)G.afterRender(C)}_renderChildren(C,G){const H=this.context;this.painter.textureUploadManager.upload();H.resetInfo();G.profiler.recordStart("drawLayers");G.dataUploadCounter=0;this.painter.beforeRenderPhases(G,G.backgroundColor,this.state.padding);G.drawPhase=c.WGLDrawPhase.MAP;for(const K of C)K.processRender(G);if(this.children.some(K=>K.hasHighlight)){G.drawPhase= c.WGLDrawPhase.HIGHLIGHT;for(const K of C)K.processRender(G)}if(this.children.some(K=>K.hasLabels)){G.drawPhase=c.WGLDrawPhase.LABEL;for(const K of C)K.processRender(G)}if(q("esri-tiles-debug")){G.drawPhase=c.WGLDrawPhase.DEBUG;for(const K of C)K.processRender(G)}this.painter.afterRenderPhases(G);G.profiler.recordEnd("drawLayers");H.logInfo()}doRender(C){const G=this.context,{state:H,pixelRatio:K}=C;this._canvas.resize(C);G.setViewport(0,0,K*H.size[0],K*H.size[1]);G.setDepthWriteEnabled(!0);G.setStencilWriteMask(255); this.renderChildren(C)}async takeScreenshot(C,G,H,K){const J=Math.round(this.state.size[0]*C.resolutionScale),O=Math.round(this.state.size[1]*C.resolutionScale);var Q=C.resolutionScale,T=this.context,I=this._state.clone();if(null!=K){const L=I.viewpoint;I.viewpoint.rotation=K;I.viewpoint=L}K={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:I,pixelRatio:Q,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1,backgroundColor:H};H=new D.TextureDescriptor(J, O);H.wrapMode=v.TextureWrapMode.CLAMP_TO_EDGE;H.internalFormat=v.SizedPixelFormat.RGBA8;H.isImmutable=!0;H=new A.FramebufferObject(T,H,new z.RenderbufferDescriptor(v.RenderbufferFormat.DEPTH_STENCIL,J,O));Q=T.getBoundFramebufferObject();I=T.getViewport();T.bindFramebuffer(H);T.setViewport(0,0,J,O);this._renderChildren(G??this.children,K);G=this._readbackScreenshot(H,{...C.cropArea,y:O-(C.cropArea.y+C.cropArea.height)});T.bindFramebuffer(Q);T.setViewport(I.x,I.y,I.width,I.height);this.requestRender(); T=await G;1===C.outputScale?C=T:(C=new ImageData(Math.round(T.width*C.outputScale),Math.round(T.height*C.outputScale)),x.resampleHermite(T,C,!0));H.dispose();return C}async _readbackScreenshot(C,G){const H=F.createEmptyImageData(G.width,G.height,document.createElement("canvas"));await C.readPixelsAsync(G.x,G.y,G.width,G.height,v.PixelFormat.RGBA,v.PixelType.UNSIGNED_BYTE,new Uint8Array(H.data.buffer));return H}_emptyTrash(){for(;0A.effects?.find(z=>"CIMGeometricEffectDashes"===z.type&&null!=z.dashTemplate));v=v.find(A=>A.effects?.find(z=>"CIMGeometricEffectAddControlPoints"===z.type));return!!x||!!v}function u(x){return h.clone(x).map(v=>({...v,propertyName:r.uncapitalize(v.propertyName)}))}class y{constructor(x){this._cimLayers=[];this._poMap={};this._primitiveOverrides= [];x&&(this._resourceManager=x)}analyzeSymbolReference(x,v,A){this._cimLayers=A??[];if(!x)return this._cimLayers;this._reset();if(x.primitiveOverrides){this._primitiveOverrides=x.primitiveOverrides;for(const z of this._primitiveOverrides)(A=z.valueExpressionInfo)?this._setPoMap(z.primitiveName,z.propertyName,A):null!=z.value&&(A=z.value,z.propertyName.includes("Color")&&(g.isRGB(A)&&(A=r.colorToArray(A)),A=r.normalizeAlpha(A)),this._setPoMap(z.primitiveName,z.propertyName,A))}this._analyzeSymbol(x.symbol, v);return this._cimLayers}_reset(){this._cimLayers=[];this._poMap={};this._primitiveOverrides=[]}_analyzeSymbol(x,v){switch(x?.type){case "CIMPointSymbol":case "CIMLineSymbol":case "CIMPolygonSymbol":this._analyzeMultiLayerSymbol(x,v)}}_analyzeMultiLayerSymbol(x,v){const A=x?.symbolLayers;if(A){var z=x.effects,B=f.Alignment.SCREEN,D=r.getSize(x)??0;"CIMPointSymbol"===x.type&&"Map"===x.angleAlignment&&(B=f.Alignment.MAP);for(var F="CIMPolygonSymbol"===x.type,E=A.length;E--;){const K=A[E];if(!K||!1=== K.enable)continue;let J;z?.length&&(J=[...z]);var C=K.effects;C?.length&&(z?J.push(...C):J=[...C]);C=null;if(J){C=[];for(const O of J){var G=n.OverrideHelper.findEffectOverrides(O,this._primitiveOverrides);G&&C.push(G)}}n.OverrideHelper.findApplicableOverrides(K,this._primitiveOverrides,[]);switch(K.type){case "CIMSolidFill":this._analyzeSolidFill(K,C);break;case "CIMPictureFill":this._analyzePictureFill(K,C);break;case "CIMHatchFill":this._analyzeHatchFill(K,C);break;case "CIMGradientFill":this._analyzeGradientFill(K, C);break;case "CIMSolidStroke":this._analyzeSolidStroke(K,C,F,D);break;case "CIMPictureStroke":this._analyzePictureStroke(K,C,F,D);break;case "CIMGradientStroke":this._analyzeGradientStroke(K,C,F,D);break;case "CIMCharacterMarker":case "CIMPictureMarker":case "CIMVectorMarker":if("CIMLineSymbol"===x.type||"CIMPolygonSymbol"===x.type)B=(B=K.markerPlacement)&&B.angleToLine?f.Alignment.MAP:f.Alignment.SCREEN;G=[];var H=K.primitiveName;H&&G.push(H);H=F&&r.isCIMMarkerStrokePlacement(K.markerPlacement); this._analyzeMarker(K,C,null,G,B,D,v,[],!1,H);break;default:m.getLogger("esri.symbols.cim.cimAnalyzer").error("Cannot analyze CIM layer",K.type)}}}}_analyzeSolidFill(x,v){const {primitiveName:A,type:z}=x,B=r.normalizeAlpha(x.color);this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!x.colorLocked,color:this._getValueOrOverrideExpression(z,A,"Color",B),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:v,applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!1})}_analyzePictureFill(x, v){const {primitiveName:A,type:z}=x,B=r.getTintColor(x),D=r.getNumericValue(x.height,a.defaultCIMValues.CIMPictureFill.height);let F=r.getNumericValue(x.scaleX,1);if("width"in x&&"number"===typeof x.width){var E=x.width;let C=1;const G=this._resourceManager.getResource(x.url);null!=G&&(C=G.width/G.height);F/=D/E*C}E={type:"sprite-rasterization-param",resource:x,overrides:this._getPrimitiveMaterialOverrides(A,z)};this._cimLayers.push({type:"fill",spriteRasterizationParam:E,colorLocked:!!x.colorLocked, effects:v,color:this._getValueOrOverrideExpression(z,A,"TintColor",B),height:this._getValueOrOverrideExpression(z,A,"Height",D),scaleX:this._getValueOrOverrideExpression(z,A,"ScaleX",F),angle:this._getValueOrOverrideExpression(z,A,"Rotation",r.getNumericValue(x.rotation)),offsetX:this._getValueOrOverrideExpression(z,A,"OffsetX",r.getNumericValue(x.offsetX)),offsetY:this._getValueOrOverrideExpression(z,A,"OffsetY",r.getNumericValue(x.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeHatchFill(x, v){const {primitiveName:A,type:z}=x;var B=this._analyzeMaterialOverrides(A,["Rotation","OffsetX","OffsetY"]);B=r.normalizePrimitiveOverrideProps(B);let D=[255,255,255,1],F=!1;if(x.lineSymbol?.symbolLayers)for(const C of x.lineSymbol.symbolLayers){if("CIMSolidStroke"!==C.type)continue;const G=C.primitiveName??A;F||!G||C.colorLocked||null==this._poMap[G]?.Color&&null==this._poMap[G]?.StrokeColor||(D=r.normalizeAlpha(C.color),D=this._maybeGetValueOrOverrideExpression(G,"StrokeColor")??this._getValueOrOverrideExpression(z, G,"Color",D),F=!0);var E=this._maybeGetValueOrOverrideExpression(G,"StrokeWidth");if(E){let H=null,K=null;"number"===typeof E?H=E:K=E.valueExpressionInfo;(E=B.find(J=>"strokeWidth"===J.propertyName))?E.propertyName="width":(E={type:"CIMPrimitiveOverride",primitiveName:G,propertyName:"width",valueExpressionInfo:K,value:H,defaultValue:r.getDefaultCIMValue(z,"width")},B.push(E))}}this._cimLayers.push({type:"fill",spriteRasterizationParam:{type:"sprite-rasterization-param",resource:x,overrides:B},colorLocked:!!x.colorLocked, effects:v,color:D,height:this._getValueOrOverrideExpression(z,A,"Separation",r.getNumericValue(x.separation,a.defaultCIMValues.CIMHatchFill.separation)),scaleX:1,angle:this._getValueOrOverrideExpression(z,A,"Rotation",r.getNumericValue(x.rotation)),offsetX:this._getValueOrOverrideExpression(z,A,"OffsetX",r.getNumericValue(x.offsetX)),offsetY:this._getValueOrOverrideExpression(z,A,"OffsetY",r.getNumericValue(x.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!F})}_analyzeGradientFill(x, v){this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!x.colorLocked,effects:v,color:[128,128,128,1],height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeSolidStroke(x,v,A,z){const {primitiveName:B,type:D}=x,F=r.normalizeAlpha(x.color),E=r.getNumericValue(x.width,a.defaultCIMValues.CIMSolidStroke.width),C=r.getEnum(x.capStyle,a.defaultCIMValues.CIMSolidStroke.capstyle),G=r.getEnum(x.joinStyle,a.defaultCIMValues.CIMSolidStroke.joinstyle), H=x.miterLimit;let K=[];this._analyzePrimitiveOverrides(B,v,null,null)&&(K=this._getPrimitiveMaterialOverrides(B,D));let J,O;if(v&&Array.isArray(v)&&0z.primitiveName===x));A.forEach(z=>z.defaultValue=r.getDefaultCIMValue(v,z.propertyName.toLowerCase()));return A}_analyzeMaterialOverrides(x,v){return this._primitiveOverrides.filter(A=>A.primitiveName!==x||!v.includes(A.propertyName))}}e.CIMAnalyzer=y;e.analyzeCIMResource=function(x,v){if(!v||0===v.length)return x;x=h.clone(x);n.OverrideHelper.applyOverrides(x, v);return x};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/core/fontUtils":function(){define(["exports","../config"],function(e,g){function q(n){if(!n)return"arial-unicode-ms";n=n.toLowerCase().split(" ").join("-");switch(n){case "serif":return"noto-serif";case "sans-serif":return"arial-unicode-ms";case "monospace":return"ubuntu-mono";case "fantasy":return"cabin-sketch";case "cursive":return"redressed";default:return n}}function h(n){const c=l(n)+d(n);return q(n.family)+(0< c.length?c:"-regular")}function m(n){const c=l(n)+d(n);return(n.family||"arial-unicode-ms")+(0{n.delete(c.fontFace)}); b.clear();a.clear()};e.defaultFontFamily="arial-unicode-ms";e.getFontFamily=q;e.getFullyQualifiedFontName=h;e.isCachedFontFace=function(n){return a.has(n)};e.loadFont=async function(n){const c=m(n),r=h(n),k=b.get(c);if(k)return k.promise;const p=new FontFace(n.family,`url('${g.fontsUrl}/woff2/${r}.${"woff2"}') format('${"woff2"}')`,{style:n.style,weight:n.weight}),t=document.fonts;if(t.has(p)&&"loading"===p.status)return p.loaded;n=p.load().then(()=>{t.add(p);return p});b.set(c,new f(p,n));a.add(p); return n};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/CIMSymbolHelper":function(){define("exports ../../core/BidiText ../../core/has ../../core/lang ../../core/Logger ../../core/RandomLCG ../../core/screenUtils ../../geometry/support/aaBoundingRect ../../geometry/support/boundsUtils ../Font ./CIMPlacements ./CIMSymbolDrawHelper ./defaultCIMValues ./enums ./utils ../support/defaults ../../views/2d/engine/vectorTiles/GeometryUtils ../../views/2d/engine/webgl/definitions ../../views/2d/engine/webgl/mesh/templates/shapingUtils ../../views/2d/layers/graphics/graphicsUtils".split(" "), function(e,g,q,h,m,l,d,b,a,f,n,c,r,k,p,t,w,u,y,x){function v(N,P,U){switch(P.type){case "CIMSymbolReference":return v(N,P.symbol,U);case "CIMPointSymbol":null==U&&(U={x:0,y:0});N.drawSymbol(P,U);break;case "CIMLineSymbol":null==U&&(U={paths:[[[0,0],[10,0]]]});N.drawSymbol(P,U);break;case "CIMPolygonSymbol":null==U&&(U={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]});N.drawSymbol(P,U);break;case "CIMTextSymbol":N.drawSymbol(P,{x:0,y:0});break;case "CIMVectorMarker":U=new n.Placement,N.drawMarker(P,U)}return N.envelope()} function A(N){if(!N)return 0;switch(N.type){case "CIMMarkerPlacementAlongLineSameSize":return Math.abs(N.offset);case "CIMMarkerPlacementAlongLineRandomSize":return Math.abs(N.offset);case "CIMMarkerPlacementAtExtremities":return Math.abs(N.offset);case "CIMMarkerPlacementAtMeasuredUnits":return Math.abs(N.offset);case "CIMMarkerPlacementAtRatioPositions":return Math.abs(N.offset);case "CIMMarkerPlacementInsidePolygon":return 0;case "CIMMarkerPlacementOnLine":return Math.abs(N.offset);case "CIMMarkerPlacementOnVertices":return Math.abs(N.offset); case "CIMMarkerPlacementPolygonCenter":return 0;default:return 0}}function z(N){if(!N)return 0;switch(N.type){case "CIMGeometricEffectArrow":return Math.abs(.5*N.width);case "CIMGeometricEffectBuffer":return Math.abs(N.size);case "CIMGeometricEffectControlMeasureLine":return 500;case "CIMGeometricEffectExtension":return Math.abs(N.length);case "CIMGeometricEffectJog":return Math.abs(.5*N.length);case "CIMGeometricEffectMove":return Math.max(Math.abs(p.getNumericValue(N.offsetX)),Math.abs(p.getNumericValue(N.offsetY))); case "CIMGeometricEffectOffset":return Math.abs(N.offset);case "CIMGeometricEffectOffsetTangent":return Math.abs(N.offset);case "CIMGeometricEffectRadial":return Math.abs(N.length);case "CIMGeometricEffectRegularPolygon":return Math.abs(N.radius);case "CIMGeometricEffectRotate":return 0;case "CIMGeometricEffectScale":return 0;case "CIMGeometricEffectTaperedPolygon":return.5*Math.max(Math.abs(N.fromWidth),Math.abs(N.toWidth));case "CIMGeometricEffectWave":return Math.abs(N.amplitude);case "CIMGeometricEffectDonut":return Math.abs(N.width); default:return 0}}function B(N){if(!N)return 0;let P=0;for(const U of N)P+=z(U);return P}function D(N,P){if(N)switch(N.type){case "CIMPointSymbol":case "CIMLineSymbol":case "CIMPolygonSymbol":if(N=N.symbolLayers)for(const U of N)switch(P(U),U.type){case "CIMVectorMarker":if(N=U.markerGraphics)for(const Y of N)Y&&(N=Y.symbol)&&D(N,P)}}}function F(N,P,U){N.effects&&null==P.geometryEngine&&(P.geometryEnginePromise?U.push(P.geometryEnginePromise):p.isGeometryEngineRequired(N.effects)&&(P.geometryEnginePromise= p.importGeometryEngine(),U.push(P.geometryEnginePromise),P.geometryEnginePromise.then(Y=>P.geometryEngine=Y)))}function E(N){if(!N)return null;let P=null;const {cap:U,color:Y,join:ba,miterLimit:Z,style:aa,width:ca}=N;"solid"!==aa&&"none"!==aa&&"esriSLSSolid"!==aa&&"esriSLSNull"!==aa&&(P=[{type:"CIMGeometricEffectDashes",dashTemplate:S(aa,U),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]);return{type:"CIMSolidStroke",color:"esriSLSNull"!==aa&&"none"!==aa?V(Y):[0,0,0,0],capStyle:T(U), joinStyle:I(ba),miterLimit:Z,width:ca,effects:P}}const C=Math.PI,G=C/2,H=Math.PI/180,K=96/72,J=()=>m.getLogger("esri.symbols.cim.CIMSymbolHelper");class O{static getSymbolInflateSize(N,P,U,Y,ba){N||=[0,0,0,0];return P?this._getInflateSize(N,P,U,Y,ba):N}static safeSize(N){const P=Math.max(Math.abs(N[0]),Math.abs(N[2]));N=Math.max(Math.abs(N[1]),Math.abs(N[3]));return Math.sqrt(P*P+N*N)}static _vectorMarkerBounds(N,P,U,Y){let ba=!0;const Z=b.create();if(P?.markerGraphics)for(const aa of P.markerGraphics)P= [0,0,0,0],aa.geometry&&(a.getBoundsXY(Z,aa.geometry),P[0]=0,P[1]=0,P[2]=0,P[3]=0,this.getSymbolInflateSize(P,aa.symbol,U,0,Y),Z[0]+=P[0],Z[1]+=P[1],Z[2]+=P[2],Z[3]+=P[3],ba?(N[0]=Z[0],N[1]=Z[1],N[2]=Z[2],N[3]=Z[3],ba=!1):(N[0]=Math.min(N[0],Z[0]),N[1]=Math.min(N[1],Z[1]),N[2]=Math.max(N[2],Z[2]),N[3]=Math.max(N[3],Z[3])));return N}static _getInflateSize(N,P,U,Y,ba){return void 0!==P.symbolLayers?(N=this._getLayersInflateSize(N,P.symbolLayers,U,Y,ba),P=B(P.effects),0ia.width&&0{switch(Z.type){case "CIMSolidStroke":null!= Z.width&&(Z.width*=P);Z.effects?.forEach(aa=>{"CIMGeometricEffectDashes"===aa.type&&(aa.dashTemplate=aa.dashTemplate?.map(ca=>ca*P))});break;case "CIMVectorMarker":null!=Z.size&&(Z.size*=P),Z=Z.markerPlacement,null!=Z&&"placementTemplate"in Z&&(Z.placementTemplate=Z.placementTemplate.map(aa=>aa*P))}});for(var ba=this._getLineSymbolPeriod(N)||4;4>ba;)ba*=2;ba/=2;return{type:"CIMVectorMarker",frame:{xmin:-ba,xmax:ba,ymin:-Y,ymax:Y},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[-ba,0], [ba,0]]]},symbol:N}],size:U}}static fetchResources(N,P,U,Y=null){if(!N||!P)return U;D(N,ba=>{F(ba,P,U);"url"in ba&&ba.url&&U.push(P.fetchResource(ba.url,{signal:Y}))});return U}static fetchFonts(N,P,U){if(N&&P)if("symbolLayers"in N&&N.symbolLayers)for(const Z of N.symbolLayers){if("CIMVectorMarker"===Z.type&&Z.markerGraphics)for(const aa of Z.markerGraphics)aa?.symbol&&Q.fetchFonts(aa.symbol,P,U)}else if("CIMTextSymbol"===N.type){const {fontFamilyName:Z,fontStyleName:aa}=N;if(Z&&"calcitewebcoreicons"!== Z.toLowerCase()){var {style:Y,weight:ba}=p.fromCIMFontStyle(aa);N=p.fromCIMFontDecoration(N);N=new f({family:Z,style:Y,weight:ba,decoration:N});U.push(P.loadFont(N).catch(()=>{J().error(`Unsupported font ${Z} in CIM symbol`)}))}}}static _getLineSymbolPeriod(N){if(N){const P=this._getEffectsRepeat(N.effects);if(P)return P;if(N.symbolLayers)for(const U of N.symbolLayers)if(U){if(N=this._getEffectsRepeat(U.effects))return N;switch(U.type){case "CIMCharacterMarker":case "CIMPictureMarker":case "CIMVectorMarker":case "CIMObjectMarker3D":case "CIMglTFMarker3D":if(N= this._getPlacementRepeat(U.markerPlacement))return N}}}return 0}static _getEffectsRepeat(N){if(N)for(var P of N)if(P)switch(P.type){case "CIMGeometricEffectDashes":if((N=P.dashTemplate)&&N.length){P=0;for(const U of N)P+=U;N.length&1&&(P*=2);return P}break;case "CIMGeometricEffectWave":return P.period;default:J().error(`unsupported geometric effect type ${P.type}`)}return 0}static _getPlacementRepeat(N){if(N)switch(N.type){case "CIMMarkerPlacementAlongLineSameSize":case "CIMMarkerPlacementAlongLineRandomSize":case "CIMMarkerPlacementAlongLineVariableSize":if((N= N.placementTemplate)&&N.length){let P=0;for(const U of N)P+=+U;N.length&1&&(P*=2);return P}}return 0}static fromCIMInsidePolygon(N){var P=N.markerPlacement;const U={...N,markerPlacement:null,anchorPoint:null};N=Math.abs(P.stepX);const Y=Math.abs(P.stepY);var ba=(P.randomness??100)/100;let Z,aa;if("Random"===P.gridType){var ca=d.px2pt(u.randomInsidePolygonTextureSize);const ea=Math.max(Math.floor(ca/N),1),ia=Math.max(Math.floor(ca/Y),1);ca=ea*N/2;Z=ia*Y/2;aa=2*Z;P=new l(P.seed);const ha=ba*N/1.5,ja= ba*Y/1.5;ba=[];for(let ka=0;ka({type:"CIMMarkerGraphic",geometry:ea,symbol:{type:"CIMPointSymbol", symbolLayers:[U]}}));return{type:"CIMVectorMarker",frame:{xmin:-ca,xmax:ca,ymin:-Z,ymax:Z},markerGraphics:N,size:aa}}}const T=N=>{if(!N)return k.LineCapStyle.Butt;switch(N){case "butt":return k.LineCapStyle.Butt;case "square":return k.LineCapStyle.Square;case "round":return k.LineCapStyle.Round}},I=N=>{if(!N)return k.LineJoinStyle.Miter;switch(N){case "miter":return k.LineJoinStyle.Miter;case "round":return k.LineJoinStyle.Round;case "bevel":return k.LineJoinStyle.Bevel}},L=N=>{if(null==N)return"Center"; switch(N){case "left":return"Left";case "right":return"Right";case "center":return"Center"}},R=N=>{if(null==N)return"Center";switch(N){case "baseline":return"Baseline";case "top":return"Top";case "middle":return"Center";case "bottom":return"Bottom"}},V=N=>{if(!N)return[0,0,0,0];const {r:P,g:U,b:Y,a:ba}=N;return[P,U,Y,255*ba]},S=(N,P)=>{const U=q("safari")?.001:0;P="butt"===P;switch(N){case "dash":case "esriSLSDash":return P?[4,3]:[3,4];case "dash-dot":case "esriSLSDashDot":return P?[4,3,1,3]:[3,4, U,4];case "dot":case "esriSLSDot":return P?[1,3]:[U,4];case "long-dash":case "esriSLSLongDash":return P?[8,3]:[7,4];case "long-dash-dot":case "esriSLSLongDashDot":return P?[8,3,1,3]:[7,4,U,4];case "long-dash-dot-dot":case "esriSLSDashDotDot":return P?[8,3,1,3,1,3]:[7,4,U,4,U,4];case "short-dash":case "esriSLSShortDash":return P?[4,1]:[3,2];case "short-dash-dot":case "esriSLSShortDashDot":return P?[4,1,1,1]:[3,2,U,2];case "short-dash-dot-dot":case "esriSLSShortDashDotDot":return P?[4,1,1,1,1,1]:[3, 2,U,2,U,2];case "short-dot":case "esriSLSShortDot":return P?[1,1]:[U,2];case "solid":case "esriSLSSolid":case "none":return J().error("Unexpected: style does not require rasterization"),[0,0];default:return J().error(`Tried to rasterize SLS, but found an unexpected style: ${N}!`),[0,0]}},X=(N,P=100)=>{var U=P/2,Y;if("circle"===N||"esriSMSCircle"===N){var ba=Math.acos(1-.25/U);P=Math.ceil(C/ba/4);0===P&&(P=1);ba=G/P;P*=4;N=[];N.push([U,0]);for(Y=1;Y=z[0]?"ltr":"rtl":""}function h(z,B){z=z.split("");const D=[];m(z,D,B);if(0!==B.hiLevel&&B.swap.substr(0,1)!==B.swap.substr(1,2))for(let C=0;Ce.swapTable[G][0])H= G+1;else{E=e.swapTable[G][1];break b}}z[F]=E}a(2,z,D,B);a(1,z,D,B);y=D;return z.join("")}function m(z,B,D){const F=z.length;var E=D.dir?e.impTabRtl:e.impTabLtr,C=0,G=-1;const H=[],K=[];D.hiLevel=D.dir;D.lastArabic=!1;D.hasUbatAl=!1;D.hasUbatB=!1;D.hasUbatS=!1;for(var J=0;J>8];H[O]=T=e.arabicAlefBetIntervalsBegine[B]&&z<=e.arabicAlefBetIntervalsEnd[B])return!0;return!1}function b(z, B,D,F){for(;B*D=z){for(C=E+1;C=z;)C++;for(G=C-1;E{E.lastArabic=!1;return e.ubatL},UBAT_R:()=>{E.lastArabic=!1;return e.ubatR},UBAT_ON:()=>e.ubatOn,UBAT_AN:()=>e.ubatAn,UBAT_EN:()=>E.lastArabic?e.ubatAn: e.ubatEn,UBAT_AL:()=>{E.lastArabic=!0;E.hasUbatAl=!0;return e.ubatR},UBAT_WS:()=>e.ubatOn,UBAT_CS:()=>{let C,G;if(1>F||F+1>=B.length||(C=D[F-1])!==e.ubatEn&&C!==e.ubatAn||(G=B[F+1])!==e.ubatEn&&G!==e.ubatAn)return e.ubatOn;E.lastArabic&&(G=e.ubatAn);return G===C?G:e.ubatOn},UBAT_ES:()=>(0{if(0{if("VLTR"===E.inFormat){for(var C=B.length,G=F+1;G=C||64286===C)&&(G===e.ubatR||G===e.ubatAl)))return e.ubatR}return 1>F||B[F-1]===e.ubatB?e.ubatOn:D[F-1]},UBAT_B:()=>{E.lastArabic=!0;E.hasUbatB=!0;return E.dir},UBAT_S:()=>{E.hasUbatS=!0;return e.ubatOn},UBAT_LRE:()=>{E.lastArabic=!1;return e.ubatOn},UBAT_RLE:()=>{E.lastArabic=!1;return e.ubatOn}, UBAT_LRO:()=>{E.lastArabic=!1;return e.ubatOn},UBAT_RLO:()=>{E.lastArabic=!1;return e.ubatOn},UBAT_PDF:()=>{E.lastArabic=!1;return e.ubatOn},UBAT_BN:()=>e.ubatOn}[e.typesNames[B[F]]]()}function n(z,B){for(let D=0;D=z}function r(z){return"L"===z?"LTR":"R"===z?"RTL":"C"===z?"CLR":"D"===z?"CRL":""}function k(z,B){for(let D=0;DB||!D&&z[E]===B)z[E]+=F}class t{constructor(){this.inputFormat="ILYNN";this.outputFormat="VLNNN";this.sourceToTarget=[];this.targetToSource=[];this.levels=[]}bidiTransform(z,B,D){this.sourceToTarget=[];this.targetToSource=[];if(!z)return"";var F=this.sourceToTarget,E=this.targetToSource,C=z.length;w=[];y=[];for(var G=0;GF[E]?(G=B.charCodeAt(E),"\ufef5"<=F[E]&&"\ufefc">=F[E]?(D?(0-R&&VV&&(V=-V);for(var X=0,N=.5*V;X>N;)X-=V;for(;X<-N;)X+=V;var P=a.create();f.getBoundsXY(P,I);P[0]-=N;P[1]-=N;P[2]+=N;P[3]+=N;for(var U=[[P[0],P[1]], [P[0],P[3]],[P[2],P[3]],[P[2],P[1]]];180S;)S+=180;P=Math.cos(S*C);var Y=Math.sin(S*C);S=-V*Y;N=V*P;X=A.getNumericValue(L.offsetX)*R;R*=A.getNumericValue(L.offsetY);X=X*Y-R*P;var ba;var Z=R=Number.MAX_VALUE;var aa=ba=-Number.MAX_VALUE;for(var ca of U){var ea=ca[0];const ia=ca[1];U=P*ea+Y*ia;ea=-Y*ea+P*ia;Z=Math.min(Z,U);R=Math.min(R,ea);aa=Math.max(aa,U);ba=Math.max(ba,ea)}R=Math.floor(R/V)*V;ca=P*Z-Y*R-S*X/V;Z=Y*Z+P*R-N*X/V;U=P*aa-Y*R-S*X/V;P=Y*aa+P*R-N*X/V;V=1+Math.round((ba-R)/ V);X=[];for(Y=0;Y=V)){var S=R.width;R=R.height;if(S&&R){R=S/R;var X=A.getNumericValue(I.scaleX,1);S=G.createIdentity();var N=I.anchorPoint;if(N){var P=N.x;N=N.y;"Absolute"!==I.anchorPointUnits&&(P*=V*R*X,N*=V);S.translate(-P,-N)}R=A.getNumericValue(I.rotation);I.rotateClockwise&&(R=-R);this._mapRotation&& (R+=this._mapRotation);R&&S.rotate(R*C);R=A.getNumericValue(I.offsetX);X=A.getNumericValue(I.offsetY);if(R||X){if(this._mapRotation){N=C*this._mapRotation;P=Math.cos(N);N=Math.sin(N);const U=R*N+X*P;R=R*P-X*N;X=U}S.translate(R,X)}R=this.geomUnitsPerPoint();1!==R&&S.scale(R,R);(R=L.getAngle())&&S.rotate(R);S.translate(L.tx,L.ty);this.push(S,!1);this.drawImage(I,V);this.pop()}}}}drawVectorMarker(I,L){if(I){var R=I.markerGraphics;if(R){var V=A.getNumericValue(I.size,w.defaultCIMValues.CIMVectorMarker.size), S=I.frame,X=S?S.ymax-S.ymin:0;X=V&&X?V/X:1;V=G.createIdentity();S&&V.translate(.5*-(S.xmax+S.xmin),.5*-(S.ymax+S.ymin));var N=I.anchorPoint;if(N){var P=N.x;N=N.y;"Absolute"!==I.anchorPointUnits?S&&(P*=S.xmax-S.xmin,N*=S.ymax-S.ymin):(P/=X,N/=X);V.translate(-P,-N)}1!==X&&V.scale(X,X);S=A.getNumericValue(I.rotation);I.rotateClockwise&&(S=-S);this._mapRotation&&(S+=this._mapRotation);S&&V.rotate(S*C);S=A.getNumericValue(I.offsetX);X=A.getNumericValue(I.offsetY);if(S||X){if(this._mapRotation){N=C*this._mapRotation; P=Math.cos(N);N=Math.sin(N);const U=S*N+X*P;S=S*P-X*N;X=U}V.translate(S,X)}S=this.geomUnitsPerPoint();1!==S&&V.scale(S,S);(S=L.getAngle())&&V.rotate(S);V.translate(L.tx,L.ty);this.push(V,I.scaleSymbolsProportionally);for(const U of R)if(U?.symbol&&U.geometry||m.getLogger("esri.symbols.cim.CIMSymbolDrawHelper").error("Invalid marker graphic",U),I=U.textString,"number"===typeof I&&(I=I.toString()),this.drawSymbol(U.symbol,U.geometry,I),this._earlyReturn)break;this.pop()}}}drawTextSymbol(I,L,R){if(I&& c.isPoint(L)&&!(0>=A.getNumericValue(I.height,w.defaultCIMValues.CIMTextSymbol.height))){var V=G.createIdentity(),S=A.getNumericValue(I.angle);(S=-S)&&V.rotate(S*C);S=A.getNumericValue(I.offsetX);var X=A.getNumericValue(I.offsetY);(S||X)&&V.translate(S,X);S=this.geomUnitsPerPoint();1!==S&&V.scale(S,S);V.translate(L.x,L.y);this.push(V,!1);this.drawText(I,R);this.pop()}}}class K extends H{constructor(I,L){super(I,L);this.reset()}reset(){this._xmin=this._ymin=Infinity;this._xmax=this._ymax=-Infinity; this._clipCount=0}envelope(){return new x(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return a.fromValues(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(I){!I||0=R||(L=Math.max(.5*this.transformSize(A.getNumericValue(R, w.defaultCIMValues.CIMSolidStroke.width)),.25),c.isPolygon(I)?this._processPath(I.rings,L):c.isPolyline(I)?this._processPath(I.paths,L):c.isExtent(I)?(I=Q(I))&&this._processPath(I.rings,L):console.error("drawSolidStroke unexpected geometry type!"))}drawMarkerLayer(I,L){c.isPolygon(L)&&I.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===I.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===I.markerPlacement.type&&I.markerPlacement.clipAtBoundary)?this._processPath(L.rings,0):super.drawMarkerLayer(I, L)}drawHatchFill(I,L){this.drawSolidFill(I)}drawPictureFill(I,L){this.drawSolidFill(I)}drawGradientFill(I,L){this.drawSolidFill(I)}drawPictureStroke(I,L){this.drawSolidStroke(I,null,L.width)}drawGradientStroke(I,L){this.drawSolidStroke(I,null,L.width)}pushClipPath(I){this.drawSolidFill(I);this._clipCount++}popClipPath(){this._clipCount--}drawImage(I,L){var {url:R}=I;I=A.getNumericValue(I.scaleX,1);let V=I*L;var S=L;R=this._resourceManager.getResource(R);null!=R&&(S=R.height/R.width,V=I*(L?1this._xmax&&(this._xmax=I[0]+L);I[1]- Lthis._ymax&&(this._ymax=I[1]+L)}}class J extends H{constructor(){super(...arguments);this._searchPoint=[0,0];this._searchDistPoint=0;this._textInfo=null}hitTest(I,L,R,V,S,X){X*=d.pt2px(1);this.setTransform();this.setGeomUnitsPerPoint(X);this._searchPoint=[(I[0]+I[2])/2,(I[1]+I[3])/2];this._searchDistPoint=(I[2]-I[0])/2/X;this._textInfo=V;this._mapRotation=L&&("CIMPointSymbol"===L.type&&"Map"!==L.angleAlignment||"CIMTextSymbol"===L.type)?S:0;q("esri-mobile")|| (I=d.px2pt(z.hittestToleranceSmallSymbol*window.devicePixelRatio),V=d.px2pt(z.hittestSmallSymbolThreshold),("CIMLineSymbol"!==L?.type&&"CIMPolygonSymbol"!==L?.type||!L.symbolLayers?.some(A.isCIMFill))&&"CIMMeshSymbol"!==L?.type&&(A.getSize(L)??0)P.xTopLeft&&L-P.yBottomRight&&R<-P.yTopLeft){this._earlyReturn= !0;break}}}_hitTestFill(I){let L=null;if(c.isExtent(I))L=[[[I.xmin,I.ymin],[I.xmin,I.ymax],[I.xmax,I.ymax],[I.xmax,I.ymin],[I.xmin,I.ymin]]];else if(c.isPolygon(I))L=I.rings;else if(c.isPolyline(I))L=I.paths;else return;I=this.reverseTransformPt(this._searchPoint);let R=0;for(var V of L){const S=V.length;for(let X=1;XI[1]!==P[1]>I[1]&&(0<(P[0]-N[0])*(I[1]-N[1])-(P[1]-N[1])*(I[0]-N[0])?R++:R--)}}0!==R&&(this._earlyReturn=!0);this._earlyReturn||(V=this.reverseTransformScalar(this._searchDistPoint)* this.prevGeomUnitsPerPoint(),F(I,L,V)&&(this._earlyReturn=!0))}_hitTestStroke(I,L){let R=null;if(c.isExtent(I))R=[[[I.xmin,I.ymin],[I.xmin,I.ymax],[I.xmax,I.ymax],[I.xmax,I.ymin],[I.xmin,I.ymin]]];else if(c.isPolygon(I))R=I.rings;else if(c.isPolyline(I))R=I.paths;else return;I=this.reverseTransformPt(this._searchPoint);L=A.getNumericValue(L,w.defaultCIMValues.CIMSolidStroke.width)*this.geomUnitsPerPoint();const V=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint();F(I, R,L/2+V)&&(this._earlyReturn=!0)}}class O extends H{constructor(I,L,R,V){super(L,R);this._applyAdditionalRenderProps=V;this._colorSubstitutionHelper=new k;this._ctx=I}drawSolidFill(I,L){if(I){if(c.isPolygon(I))this._buildPath(I.rings,!0);else if(c.isPolyline(I))this._buildPath(I.paths,!0);else if(c.isExtent(I))this._buildPath(Q(I).rings,!0);else if(c.isMultipoint(I))console.log("CanvasDrawHelper.drawSolidFill - No implementation!");else return;I=this._ctx;I.fillStyle="string"===typeof L?L:"rgba("+ Math.round(L[0])+","+Math.round(L[1])+","+Math.round(L[2])+","+(L[3]??255)/255+")";I.fill("evenodd")}}drawSolidStroke(I,L,R,V,S,X){if(I&&L&&0!==R){if(c.isPolygon(I))this._buildPath(I.rings,!0);else if(c.isPolyline(I))this._buildPath(I.paths,!1);else if(c.isExtent(I))this._buildPath(Q(I).rings,!0);else{console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");return}I=this._ctx;I.strokeStyle="string"===typeof L?L:"rgba("+Math.round(L[0])+","+Math.round(L[1])+","+Math.round(L[2])+","+(L[3]?? 255)/255+")";I.lineWidth=Math.max(this.transformSize(R),.5);this._setCapStyle(V);this._setJoinStyle(S);I.miterLimit=X;I.stroke()}}pushClipPath(I){this._ctx.save();if(c.isPolygon(I))this._buildPath(I.rings,!0);else if(c.isPolyline(I))this._buildPath(I.paths,!0);else if(c.isExtent(I))this._buildPath(Q(I).rings,!0);else return;this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(I,L){const {colorSubstitutions:R,url:V,tintColor:S}=I;I=A.getNumericValue(I.scaleX,1);var X=this._resourceManager.getResource(V); if(null!=X){var N=X.width/X.height*L,P=L;L||(N=X.width,P=X.height);var U=A.isSVGImage(V)||"src"in X&&A.isSVGImage(X.src);L="getFrame"in X?y.getFirstFrame(X):X;R&&(L=this._colorSubstitutionHelper.applyColorSubstituition(L,R));this._applyAdditionalRenderProps&&!U&&S&&(L=this._colorSubstitutionHelper.tintImageData(L,S));X=this.transformPt([0,0]);var [Y,ba]=this.getTransformAngle();U=this.transformSize(1);var Z=this._ctx;Z.save();Z.setTransform({m11:I*U*Y,m12:I*U*ba,m21:-U*ba,m22:U*Y,m41:X[0],m42:X[1]}); Z.drawImage(L,-N/2,-P/2,N,P);Z.restore()}}drawText(I,L){if(L&&0!==L.length&&(this._textRasterizer||(this._textRasterizer=new v),I=E(I),I.size*=this.transformSize(d.px2pt(1)),L=this._textRasterizer.rasterizeText(L,I))){var {size:R,anchorX:V,anchorY:S,canvas:X}=L;L=R[0]*(V+.5);I=R[1]*(S-.5);var N=this._ctx,P=this.transformPt([0,0]),[U,Y]=this.getTransformAngle();N.save();N.setTransform({m11:1*U,m12:1*Y,m21:-1*Y,m22:1*U,m41:P[0]-1*L,m42:P[1]+1*I});N.drawImage(X,0,0);N.restore()}}drawPictureFill(I,L){if(I){var {colorSubstitutions:R, height:V,offsetX:S,offsetY:X,rotation:N,scaleX:P,tintColor:U,url:Y}=L;L=this._resourceManager.getResource(Y);if(null!=L){if(c.isPolygon(I))this._buildPath(I.rings,!0);else if(c.isPolyline(I))this._buildPath(I.paths,!0);else if(c.isExtent(I))this._buildPath(Q(I).rings,!0);else if(c.isMultipoint(I))console.log("CanvasDrawHelper.drawPictureFill - No implementation!");else return;I=this._ctx;var ba=A.isSVGImage(Y)||"src"in L&&A.isSVGImage(L.src),Z="getFrame"in L?y.getFirstFrame(L):L;R&&(Z=this._colorSubstitutionHelper.applyColorSubstituition(Z, R));if(this._applyAdditionalRenderProps){if(ba||U&&(Z=this._colorSubstitutionHelper.tintImageData(Z,U)),ba=I.createPattern(Z,"repeat"),Z=this.transformSize(1),N||=0,S=S?Z*S:0,X=X?Z*X:0,V&&=Z*V,Z=V?V/L.height:1,L=P&&V?P*V/L.width:1,0!==N||1!==Z||1!==L||0!==S||0!==X){const aa=new DOMMatrix;aa.rotateSelf(0,0,-N).translateSelf(S,X).scaleSelf(L,Z,1);ba.setTransform(aa)}}else ba=I.createPattern(Z,"repeat");I.save();I.fillStyle=ba;I.fill("evenodd");I.restore()}}}drawPictureStroke(I,L){if(I){var {colorSubstitutions:R, capStyle:V,joinStyle:S,miterLimit:X,tintColor:N,url:P,width:U}=L;L=this._resourceManager.getResource(P);if(null!=L){if(c.isPolygon(I))var Y=I.rings;else if(c.isPolyline(I))Y=I.paths;else if(c.isExtent(I))Y=Q(I).rings;else{c.isMultipoint(I)&&console.log("CanvasDrawHelper.drawPictureStroke - No implementation!");return}U||(U=L.width);I=A.isSVGImage(P)||"src"in L&&A.isSVGImage(L.src);var ba="getFrame"in L?y.getFirstFrame(L):L;R&&(ba=this._colorSubstitutionHelper.applyColorSubstituition(ba,R));this._applyAdditionalRenderProps&& (I||N&&(ba=this._colorSubstitutionHelper.tintImageData(ba,N)));L=Math.max(this.transformSize(d.pt2px(U)),.5);I=L/ba.width;var Z=this._ctx;ba=Z.createPattern(ba,"repeat-y");Z.save();this._setCapStyle(V);this._setJoinStyle(S);void 0!==X&&(Z.miterLimit=X);Z.lineWidth=L;var aa;for(let ja of Y){ja=h.clone(ja);var ca=aa=void 0,ea=void 0;let ka=ca=void 0;Y=ja;for(var ia=Y[0],ha=1;ha=ca-ea?(Y.splice(ha-1,1),ia=aa): (aa=ia,ia=Y[ha],ha++),ea=ca;if(ja&&!(1>=ja.length))for(Y=this.transformPt(ja[0]),ea=1;eaI?{spatialReference:I.spatialReference,rings:[[[I.xmin,I.ymin],[I.xmin,I.ymax],[I.xmax,I.ymax],[I.xmax,I.ymin],[I.xmin,I.ymin]]]}:null,T=(I,L,R)=>{switch(I){case "ExtraLeading":return 1+L/R;case "Multiple":return L;case "Exact":return L/R}};e.CIMSymbolDrawHelper=H;e.CanvasDrawHelper=O;e.EnvDrawHelper=K;e.HittestDrawHelper=J;e.Transformation=G;e.cDegToRad=C;e.lineGapType2LineHeight=T;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/GeometryCursor":function(){define(["exports", "../core/lang","./geometryCursorCollectUtils","./support/jsonUtils","../layers/graphics/OptimizedGeometry"],function(e,g,q,h,m){function l(c){if(h.isPolygon(c))c=[c.rings,"esriGeometryPolygon"];else if(h.isPolyline(c))c=[c.paths,"esriGeometryPolyline"];else if(h.isMultipoint(c))c=[[c.points],"esriGeometryMultipoint"];else if(h.isExtent(c))c=[[[[c.xmin,c.ymin],[c.xmin,c.ymax],[c.xmax,c.ymax],[c.xmax,c.ymin],[c.xmin,c.ymin]]],"esriGeometryEnvelope"];else if(h.isPoint(c)){const r=[c.x,c.y];c.z&&r.push(c.z); c.m&&r.push(c.m);c=[[[r]],"esriGeometryPoint"]}else c=[[],"esriGeometryPolyline"];return c}class d{static fromOptimized(c,r,k=!1,p=!1,t=1){return(new b).initialize(c,r,k,p,t)}static fromJSON(c,r=!1,k=!1){const [p,t]=l(c);return(new a).initialize(p,t,r,k,1)}static fromOptimizedCIM(c,r,k=!1,p=!1,t=1){return(new f).initialize(c,r,k,p,t)}static fromJSONCIM(c,r=!1,k=!1,p=1){const [t,w]=l(c);return(new n).initialize(t,w,r,k,p)}static fromFeatureSetReader(c){const r=c.readGeometryForDisplay();c=c.geometryType; return r&&c?this.fromOptimized(r,c):null}static fromFeatureSetReaderCIM(c){const r=c.readGeometryForDisplay();c=c.geometryType;return r&&c?this.fromOptimizedCIM(r,c):null}static createEmptyOptimized(c,r=!1,k=!1,p=1){return(new b).initialize(new m,c,r,k,p)}static createEmptyJSON(c,r=!1,k=!1){return(new a).initialize([],c,r,k,1)}static createEmptyOptimizedCIM(c,r=!1,k=!1,p=1){return(new f).initialize(new m,c,r,k,p)}static createEmptyJSONCIM(c,r=!1,k=!1,p=1){return(new n).initialize([],c,r,k,p)}asJSON(){const c= q.collectMultipath(this);return"esriGeometryEnvelope"===this.geometryType?{xmin:c[0][0][0],ymin:c[0][0][1],xmax:c[0][2][0],ymax:c[0][2][1]}:"esriGeometryMultipoint"===this.geometryType?{points:c.flat()}:"esriGeometryPoint"===this.geometryType?{x:c[0][0][0],y:c[0][0][1]}:"esriGeometryPolygon"===this.geometryType?{rings:c}:{paths:c}}getCurrentRingArea(){if(3>this.pathSize)return 0;let c=0,r,k;this.seekPathStart();if(!this.nextPoint())return 0;r=this.x;k=this.y;const p=r,t=k;for(;this.nextPoint();)c+= (r-this.x)*(k+this.y),r=this.x,k=this.y;return-.5*(c+(r-p)*(k+t))}invertY(){this.yFactor*=-1}}class b extends d{constructor(){super(...arguments);this._end=-1}initialize(c,r,k,p,t){this.hasZ=k;this.hasM=p;this.geometryType=r;this._stride=2+Number(k)+Number(p);this._geometry=c;this._pathIndex=-1;this._pathOffset=0;this._pointOffset=-this._stride;this._end=-1;this.yFactor=t;return this}reset(){this.initialize(this._geometry,this.geometryType,this.hasZ,this.hasM,this.yFactor)}seekPath(c){if(0<=c&&c< this.totalSize){if(this._pathIndexc)for(;this._pathIndex>c&&this.prevPath(););return!0}return!1}seekPathStart(){this._pointOffset=this._pathOffset-this._stride}seekPathEnd(){this._pointOffset=this._end}seekInPath(c){c=this._pathOffset+c*this._stride;return 0<=c&&c=this._pathOffset}nextPath(){if(this.pathIndex>= this.totalSize-1)return!1;0<=this._pathIndex&&(this._pathOffset+=this._stride*this.pathSize);this._pathIndex++;this._pointOffset=this._pathOffset-this._stride;this._end=this._pointOffset+this._stride+this._stride*this.pathSize;return!0}prevPath(){if(0>=this.pathIndex)return!1;this._pathIndex--;this._end=this._pathOffset;this._pathOffset-=this._stride*this.pathSize;this._pointOffset=this._pathOffset-this._stride;return!0}pathLength(){const c=this._end,r=this._stride,k=this._geometry.coords;let p=0; for(let t=this._pathOffset+r;tc+r)}get pathSize(){const {lengths:c}=this._geometry;return this._geometry.isPoint?1:0>this._pathIndex||this._pathIndex>c.length-1?0:c[this._pathIndex]}get totalSize(){return this._geometry.isPoint?1:this._geometry.lengths.length}get x(){return this._geometry.coords[this._pointOffset]}set x(c){this._geometry.coords[this._pointOffset]= c}get y(){return this.yFactor*this._geometry.coords[this._pointOffset+1]}set y(c){this._geometry.coords[this._pointOffset+1]=this.yFactor*c}get z(){return this._geometry.coords[this._pointOffset+2]}set z(c){this._geometry.coords[this._pointOffset+2]=c}get m(){return this._geometry.coords[this._pointOffset+(this.hasZ?3:2)]}set m(c){this._geometry.coords[this._pointOffset+3]=c}get pathIndex(){return this._pathIndex}get _coordIndex(){return this._pointOffset/this._stride}}class a extends d{initialize(c, r,k,p,t){this._paths=c;this.geometryType=r;this.hasZ=k;this.hasM=p;this._pathIndex=this._pointIndex=-1;this.yFactor=t;this._mIndex=this.hasZ?3:2;return this}reset(){this._pathIndex=this._pointIndex=-1}seekPath(c){this._pathIndex=c;this._pointIndex=-1;return 0<=c&&cc.length).reduce((c,r)=>c+r)}get pathSize(){return 0>this._pathIndex||this._pathIndex>this.totalSize-1?-1:this._paths[this._pathIndex].length}get totalSize(){return this._paths.length}get x(){return this._currentPoint[0]}set x(c){this._currentPoint[0]=c}get y(){return this.yFactor*this._currentPoint[1]}set y(c){this._currentPoint[1]=this.yFactor*c}get z(){return this._currentPoint[2]}set z(c){this._currentPoint[2]=c}get m(){return this._currentPoint[this._mIndex]}set m(c){this._currentPoint[this._mIndex]= c}get pathIndex(){return this._pathIndex}}class f extends b{initialize(c,r,k,p,t){super.initialize(c,r,k,p,t);this._controlPoints||(this._controlPoints=this._controlPoints=Array(this.totalSize).fill(void 0).map(w=>new Set));return this}startPath(){super.startPath();this._controlPoints.push(new Set)}clone(){const c=(new f).initialize(this._geometry.clone(),this.geometryType,this.hasZ,this.hasM,this.yFactor);c._controlPoints=this._controlPoints;return c}setControlPoint(){this._controlPoints[this.pathIndex].add(this._coordIndex)}getControlPoint(){return this._controlPoints[this.pathIndex].has(this._coordIndex)}setControlPointAt(c){this._controlPoints[this.pathIndex].add(c)}getControlPointAt(c){return this._controlPoints[this.pathIndex].has(c)}} class n extends a{initialize(c,r,k,p,t){return super.initialize(c,r,k,p,t)}clone(){return(new n).initialize(g.clone(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}setControlPoint(){this._paths[this.pathIndex][this._pointIndex][4]=1}getControlPoint(){return 1===this._paths[this.pathIndex][this._pointIndex][4]}setControlPointAt(c){this._paths[this.pathIndex][c][4]=1}getControlPointAt(c){return 1===this._paths[this.pathIndex][c][4]}}e.GeometryCursor=d;Object.defineProperty(e,Symbol.toStringTag, {value:"Module"})})},"esri/symbols/cim/CIMEffects":function(){define(["exports","../../geometry/GeometryCursor","../../geometry/support/TileClipper"],function(e,g,q){let h;class m{constructor(l){this._geometry=l}next(){const l=this._geometry;this._geometry=null;return l}}e.SimpleEffectCursor=m;e.clipCursorToTileExtent=function(l,d){h||=new q.TileClipper(0,0,0,1);var b="esriGeometryPolygon"===l.geometryType;const a=b?3:2;h.reset(b?q.GeometryType.Polygon:q.GeometryType.LineString);h.setPixelMargin(d+ 1);h.setExtent(512);let f;for(;l.nextPath();)if(!(l.pathSize>=this._dz;f>a&&(f=a);this._margin=f;this._xmin=a*this._xPos-f;this._ymin=a*this._yPos-f;this._xmax=this._xmin+a+2*f;this._ymax=this._ymin+a+2*f}reset(a){this._type=a;this._lines=[];this._starts=[];this._line=null;this._start=0}moveTo(a,f){this._pushLine();this._prevIsIn=this._isIn(a,f);this._moveTo(a,f,this._prevIsIn); this._prevPt=new g(a,f);this._firstPt=new g(a,f);this._dist=0}lineTo(a,f){const n=this._isIn(a,f),c=new g(a,f),r=g.distance(this._prevPt,c);if(n)if(this._prevIsIn)this._lineTo(a,f,!0);else{var k=this._prevPt;var p=c;a=this._intersect(p,k);this._start=this._dist+r*(1-this._r);this._lineTo(a.x,a.y,!0);this._lineTo(p.x,p.y,!0)}else if(this._prevIsIn)p=this._prevPt,k=c,a=this._intersect(p,k),this._lineTo(a.x,a.y,!0),this._lineTo(k.x,k.y,!1);else{const w=this._prevPt;if(!(w.x<=this._xmin&&c.x<=this._xmin|| w.x>=this._xmax&&c.x>=this._xmax||w.y<=this._ymin&&c.y<=this._ymin||w.y>=this._ymax&&c.y>=this._ymax)){a=[];if(w.xthis._xmin||w.x>this._xmin&&c.x=this._ymax?p=!0:a.push(new q(f,this._xmin,t))}if(w.xthis._xmax||w.x>this._xmax&&c.x=this._ymax?p=!0:a.push(new q(f,this._xmax,t));if(w.ythis._ymin|| w.y>this._ymin&&c.y=this._xmax?k=!0:a.push(new q(f,t,this._ymin));if(w.ythis._ymax||w.y>this._ymax&&c.y=this._xmax?k=!0:a.push(new q(f,t,this._ymax));if(0===a.length)k?p?this._lineTo(this._xmax,this._ymax,!0):this._lineTo(this._xmax,this._ymin,!0):p?this._lineTo(this._xmin,this._ymax,!0):this._lineTo(this._xmin,this._ymin, !0);else if(1a[1].ratio)this._start=this._dist+r*a[1].ratio,this._lineTo(a[1].x,a[1].y,!0),this._lineTo(a[0].x,a[0].y,!0);else for(this._start=this._dist+r*a[0].ratio,k=0;k=this._xmin&&a<=this._xmax&&f>=this._ymin&&f<=this._ymax}_intersect(a,f){let n,c,r;if(f.x>=this._xmin&&f.x<=this._xmax)c=f.y<=this._ymin?this._ymin:this._ymax,r=(c-a.y)/(f.y-a.y),n=a.x+r*(f.x-a.x);else if(f.y>=this._ymin&&f.y<=this._ymax)n=f.x<=this._xmin?this._xmin:this._xmax,r=(n-a.x)/(f.x-a.x),c=a.y+r*(f.y-a.y);else{c=f.y<=this._ymin?this._ymin:this._ymax;n=f.x<=this._xmin?this._xmin:this._xmax;const k=(n-a.x)/(f.x-a.x),p=(c-a.y)/(f.y-a.y);kthis._xmax&&(a=this._xmax),fthis._ymax&&(f=this._ymax)),a=Math.round((a-(this._xmin+this._margin))*this._finalRatio),f=Math.round((f-(this._ymin+this._margin))*this._finalRatio),this._line.push(new g(a,f)),this._isV=this._isH=!1)}_lineTo(a,f,n){if(this._type!==e.GeometryType.Polygon)if(n){a= Math.round((a-(this._xmin+this._margin))*this._finalRatio);f=Math.round((f-(this._ymin+this._margin))*this._finalRatio);if(0this._xmax&&(a=this._xmax),fthis._ymax&&(f=this._ymax)),a=Math.round((a-(this._xmin+this._margin))*this._finalRatio),f=Math.round((f-(this._ymin+ this._margin))*this._finalRatio),this._line&&0=this._line.length?this._isV=this._isH=!1:(n=this._line[this._line.length-2],this._isH=n.x===a,this._isV=n.y===f)):(this._isH=n.x===a,this._isV=n.y===f)):this._isV&&r?(n.x=a,n.y=f,n=this._line[this._line.length-2],n.x===a&&n.y===f?(this._line.pop(),1>=this._line.length?this._isV= this._isH=!1:(n=this._line[this._line.length-2],this._isH=n.x===a,this._isV=n.y===f)):(this._isH=n.x===a,this._isV=n.y===f)):(this._line.push(new g(a,f)),this._isH=c,this._isV=r))}else this._line.push(new g(a,f))}}class m{setExtent(a){this._ratio=4096===a?1:4096/a}get validateTessellation(){return 1>this._ratio}reset(a){this._lines=[];this._line=null}moveTo(a,f){this._line&&this._lines.push(this._line);this._line=[];const n=this._ratio;this._line.push(new g(a*n,f*n))}lineTo(a,f){const n=this._ratio; this._line.push(new g(a*n,f*n))}close(){const a=this._line;a&&!a[0].isEqual(a[a.length-1])&&a.push(a[0])}result(){this._line&&this._lines.push(this._line);return 0===this._lines.length?null:this._lines}}var l;(function(a){a[a.sideLeft=0]="sideLeft";a[a.sideRight=1]="sideRight";a[a.sideTop=2]="sideTop";a[a.sideBottom=3]="sideBottom"})(l||={});class d{static simplify(a,f,n){if(n){var c=-f,r=a+f,k=-f,p=a+f;a=[];f=[];var t=n.length;for(let w=0;wu.length)continue;let y=u[0], x;const v=u.length;for(let A=1;Ax.y?(a.push(w),a.push(A),a.push(l.sideLeft),a.push(-1)):(f.push(w),f.push(A),f.push(l.sideLeft),f.push(-1))),y.x>=r&&(y.y=p&&(y.x>x.x?(a.push(w),a.push(A),a.push(l.sideBottom),a.push(-1)): (f.push(w),f.push(A),f.push(l.sideBottom),f.push(-1)))),y=x}0!==a.length&&0!==f.length&&(d.fillParent(n,f,a),d.fillParent(n,a,f),c=[],d.calcDeltas(c,f,a),d.calcDeltas(c,a,f),d.addDeltas(c,n))}}static fillParent(a,f,n){const c=n.length,r=f.length;for(let u=0;uc&&(c=k)}for(r=0;ra>=f&&a<=n||a>=n&&a<=f;e.Point=g;e.SimpleBuilder=m;e.TileClipper=h;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/CIMImageColorSubstitutionHelper":function(){define(function(){class e{applyColorSubstituition(g,q){if(!q)return g;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));const {width:h,height:m}=g,l=this._rasterizationCanvas,d=l.getContext("2d",{willReadFrequently:!0});g!==l&&(l.width=h,l.height=m,d.drawImage(g, 0,0,h,m));g=d.getImageData(0,0,h,m).data;if(q)for(var b of q)if(b&&b.oldColor&&4===b.oldColor.length&&b.newColor&&4===b.newColor.length){const [a,f,n,c]=b.oldColor,[r,k,p,t]=b.newColor;if(a!==r||f!==k||n!==p||c!==t)for(q=0;qq.length)return g;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas")); const {width:h,height:m}=g,l=this._rasterizationCanvas,d=l.getContext("2d",{willReadFrequently:!0});g!==l&&(l.width=h,l.height=m,d.drawImage(g,0,0,h,m));g=d.getImageData(0,0,h,m);g=new Uint8Array(g.data);q=[q[0]/255,q[1]/255,q[2]/255,q[3]/255];for(let b=0;bf.length)return null;var c=f[f.length-2];f=f[f.length-1];c=[f[0]-c[0], f[1]-c[1]];this._curveHelper.normalize(c);return[f[0]+c[1]*n,f[1]-c[0]*n]}}e.EffectArrow=b;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/CIMCursor":function(){define(["exports","./CIMEffects","./CIMPlacements"],function(e,g,q){class h{constructor(l,d=!0,b=!0,a=0){this.isClosed=!1;this.geometryCursor=null;this.geometryCursor=!d&&"esriGeometryPolygon"===l.geometryType||!b&&"esriGeometryPolyline"===l.geometryType?null:l;this.geomUnitsPerPoint=a;this.iteratePath=this.iterateMultiPath= !1;this.internalPlacement=new q.Placement}next(){if(!this.geometryCursor)return null;const l=this.processMultiPath(this.geometryCursor);this.iterateMultiPath&&l||(this.geometryCursor=null);return l}processMultiPath(l){for(;this.iteratePath||l.pathIndex=a?[m,l]:this.getCoord2D(m,l,d,b,a);m=1<=f?[d,b]:this.getCoord2D(m,l,d,b,f);return[a,m]}getSubCurve(m,l,d){const b=g.GeometryCursor.createEmptyOptimizedCIM("esriGeometryPolyline");return this.appendSubCurve(b,m,l,d)?b:null}appendSubCurve(m,l,d,b){m.startPath();l.seekPathStart(); let a=0;var f=!0;if(!l.nextPoint())return!1;var n=l.x;let c=l.y;for(;l.nextPoint();){const r=this.getLength(n,c,l.x,l.y);if(0!==r){if(f){if(a+r>d){const k=(d-a)/r;let p=1;f=!1;a+r>=b&&(p=(b-a)/r,f=!0);(n=this.cut(n,c,l.x,l.y,k,p))&&m.pushPoints(n);if(f)break;f=!1}}else{if(a+r>b){(l=this.cut(n,c,l.x,l.y,0,(b-a)/r))&&m.pushPoint(l[1]);break}m.pushXY(l.x,l.y)}a+=r}n=l.x;c=l.y}return!0}getCIMPointAlong(m,l){if(!m.nextPoint())return null;let d=0,b,a,f,n;b=m.x;for(a=m.y;m.nextPoint();b=f,a=n){f=m.x;n=m.y; const c=this.getLength(b,a,f,n);if(0!==c){if(d+c>l)return this.getCoord2D(b,a,f,n,(l-d)/c);d+=c}}return null}offset(m,l,d,b,a){if(!m||2>m.length)return null;var f=0,n=m[f++];for(a=f;f=l)1>w&&(k=[k[0]-p[0],k[1]-p[1]],this.normalize(k),p=Math.sqrt((1+w)/2),p>1/b&&(p=-Math.abs(l)/p,c.push([r[0]-k[0]*p,r[1]-k[1]*p])));else switch(d){case q.GeometricEffectOffsetMethod.Mitered:if(n=Math.sqrt((1+w)/2),0w){c.push([r[0]+p[1]*l,r[1]-p[0]*l]);n=Math.floor(2.5*(1-w));if(0t?(c.push([r[0]+(p[1]+p[0])*l,r[1]+(p[1]-p[0])*l]),c.push([r[0]+(k[1]-k[0])*l,r[1]-(k[0]+k[1])*l])):(n=Math.sqrt((1+Math.abs(w))/2),k=[k[0]- p[0],k[1]-p[1]],this.normalize(k),p=l/n,c.push([r[0]-k[0]*p,r[1]-k[1]*p]))}}else k=[r[0]-n[0],r[1]-n[1]],this.normalize(k),c.push([r[0]+k[1]*l,r[1]-k[0]*l]);else k=[y[0]-r[0],y[1]-r[1]],this.normalize(k),c.push([r[0]+k[1]*l,r[1]-k[0]*l]);n=r;r=y}if(c.length<(f?3:2))return null;f&&c.push([c[0][0],c[0][1]]);return c}}e.CurveHelper=h;e.pixelTolerance=.03;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/enums":function(){define(["exports"],function(e){e.CapType=void 0; (function(g){g[g.BUTT=0]="BUTT";g[g.ROUND=1]="ROUND";g[g.SQUARE=2]="SQUARE";g[g.UNKNOWN=4]="UNKNOWN"})(e.CapType||(e.CapType={}));e.JoinType=void 0;(function(g){g[g.BEVEL=0]="BEVEL";g[g.ROUND=1]="ROUND";g[g.MITER=2]="MITER";g[g.UNKNOWN=4]="UNKNOWN"})(e.JoinType||(e.JoinType={}));e.Alignment=void 0;(function(g){g[g.SCREEN=0]="SCREEN";g[g.MAP=1]="MAP"})(e.Alignment||(e.Alignment={}));e.ExternalColorMixMode=void 0;(function(g){g[g.Tint=0]="Tint";g[g.Ignore=1]="Ignore";g[g.Multiply=99]="Multiply"})(e.ExternalColorMixMode|| (e.ExternalColorMixMode={}));e.ExtremityPlacement=void 0;(function(g){g.Both="Both";g.JustBegin="JustBegin";g.JustEnd="JustEnd";g.None="None"})(e.ExtremityPlacement||(e.ExtremityPlacement={}));e.FillMode=void 0;(function(g){g[g.Mosaic=0]="Mosaic";g[g.Centered=1]="Centered"})(e.FillMode||(e.FillMode={}));e.FontEffects=void 0;(function(g){g[g.Normal=0]="Normal";g[g.Superscript=1]="Superscript";g[g.Subscript=2]="Subscript"})(e.FontEffects||(e.FontEffects={}));e.FontEncoding=void 0;(function(g){g[g.MSSymbol= 0]="MSSymbol";g[g.Unicode=1]="Unicode"})(e.FontEncoding||(e.FontEncoding={}));e.FontType=void 0;(function(g){g[g.Unspecified=0]="Unspecified";g[g.TrueType=1]="TrueType";g[g.PSOpenType=2]="PSOpenType";g[g.TTOpenType=3]="TTOpenType";g[g.Type1=4]="Type1"})(e.FontType||(e.FontType={}));e.AngleAlignment=void 0;(function(g){g[g.Display=0]="Display";g[g.Map=1]="Map"})(e.AngleAlignment||(e.AngleAlignment={}));e.AnimatedSymbolRepeatType=void 0;(function(g){g.None="None";g.Loop="Loop";g.Oscillate="Oscillate"})(e.AnimatedSymbolRepeatType|| (e.AnimatedSymbolRepeatType={}));e.DominantSizeAxis=void 0;(function(g){g[g.Z=0]="Z";g[g.X=1]="X";g[g.Y=2]="Y"})(e.DominantSizeAxis||(e.DominantSizeAxis={}));e.RotationOrder=void 0;(function(g){g[g.XYZ=0]="XYZ";g[g.ZXY=1]="ZXY";g[g.YXZ=2]="YXZ"})(e.RotationOrder||(e.RotationOrder={}));e.BalloonCalloutStyle=void 0;(function(g){g[g.Rectangle=0]="Rectangle";g[g.RoundedRectangle=1]="RoundedRectangle";g[g.Oval=2]="Oval"})(e.BalloonCalloutStyle||(e.BalloonCalloutStyle={}));e.BlendingMode=void 0;(function(g){g[g.None= 0]="None";g[g.Alpha=1]="Alpha";g[g.Screen=2]="Screen";g[g.Multiply=3]="Multiply";g[g.Add=4]="Add"})(e.BlendingMode||(e.BlendingMode={}));e.BlockProgression=void 0;(function(g){g[g.TTB=0]="TTB";g[g.RTL=1]="RTL";g[g.BTT=2]="BTT"})(e.BlockProgression||(e.BlockProgression={}));e.BillBoardMode=void 0;(function(g){g[g.None=0]="None";g[g.SignPost=1]="SignPost";g[g.FaceNearPlane=2]="FaceNearPlane"})(e.BillBoardMode||(e.BillBoardMode={}));e.CGAAttributeType=void 0;(function(g){g[g.Float=0]="Float";g[g.String= 1]="String";g[g.Boolean=2]="Boolean"})(e.CGAAttributeType||(e.CGAAttributeType={}));e.ClippingType=void 0;(function(g){g[g.Intersect=0]="Intersect";g[g.Subtract=1]="Subtract"})(e.ClippingType||(e.ClippingType={}));e.GeometricEffectArrowType=void 0;(function(g){g.OpenEnded="OpenEnded";g.Block="Block";g.Crossed="Crossed"})(e.GeometricEffectArrowType||(e.GeometricEffectArrowType={}));e.GeometricEffectControlMeasureLineRule=void 0;(function(g){g.FullGeometry="FullGeometry";g.PerpendicularFromFirstSegment= "PerpendicularFromFirstSegment";g.ReversedFirstSegment="ReversedFirstSegment";g.PerpendicularToSecondSegment="PerpendicularToSecondSegment";g.SecondSegmentWithTicks="SecondSegmentWithTicks";g.DoublePerpendicular="DoublePerpendicular";g.OppositeToFirstSegment="OppositeToFirstSegment";g.TriplePerpendicular="TriplePerpendicular";g.HalfCircleFirstSegment="HalfCircleFirstSegment";g.HalfCircleSecondSegment="HalfCircleSecondSegment";g.HalfCircleExtended="HalfCircleExtended";g.OpenCircle="OpenCircle";g.CoverageEdgesWithTicks= "CoverageEdgesWithTicks";g.GapExtentWithDoubleTicks="GapExtentWithDoubleTicks";g.GapExtentMidline="GapExtentMidline";g.Chevron="Chevron";g.PerpendicularWithArc="PerpendicularWithArc";g.ClosedHalfCircle="ClosedHalfCircle";g.TripleParallelExtended="TripleParallelExtended";g.ParallelWithTicks="ParallelWithTicks";g.Parallel="Parallel";g.PerpendicularToFirstSegment="PerpendicularToFirstSegment";g.ParallelOffset="ParallelOffset";g.OffsetOpposite="OffsetOpposite";g.OffsetSame="OffsetSame";g.CircleWithArc= "CircleWithArc";g.DoubleJog="DoubleJog";g.PerpendicularOffset="PerpendicularOffset";g.LineExcludingLastSegment="LineExcludingLastSegment";g.MultivertexArrow="MultivertexArrow";g.CrossedArrow="CrossedArrow";g.ChevronArrow="ChevronArrow";g.ChevronArrowOffset="ChevronArrowOffset";g.PartialFirstSegment="PartialFirstSegment";g.Arch="Arch";g.CurvedParallelTicks="CurvedParallelTicks";g.Arc90Degrees="Arc90Degrees";g.TipWithPerpendicularAndTicks="TipWithPerpendicularAndTicks"})(e.GeometricEffectControlMeasureLineRule|| (e.GeometricEffectControlMeasureLineRule={}));e.GeometricEffectDonutMethod=void 0;(function(g){g.Mitered="Mitered";g.Bevelled="Bevelled";g.Rounded="Rounded";g.Square="Square";g.TrueBuffer="TrueBuffer"})(e.GeometricEffectDonutMethod||(e.GeometricEffectDonutMethod={}));e.GeometricEffectEnclosingPolygonMethod=void 0;(function(g){g.ClosePath="ClosePath";g.ConvexHull="ConvexHull";g.RectangularBox="RectangularBox"})(e.GeometricEffectEnclosingPolygonMethod||(e.GeometricEffectEnclosingPolygonMethod={})); e.GeometricEffectExtensionOrigin=void 0;(function(g){g.BeginningOfLine="BeginningOfLine";g.EndOfLine="EndOfLine"})(e.GeometricEffectExtensionOrigin||(e.GeometricEffectExtensionOrigin={}));e.GeometricEffectOffsetMethod=void 0;(function(g){g.Mitered="Mitered";g.Bevelled="Bevelled";g.Rounded="Rounded";g.Square="Square"})(e.GeometricEffectOffsetMethod||(e.GeometricEffectOffsetMethod={}));e.GeometricEffectOffsetOption=void 0;(function(g){g.Fast="Fast";g.Accurate="Accurate"})(e.GeometricEffectOffsetOption|| (e.GeometricEffectOffsetOption={}));e.GeometricEffectOffsetTangentMethod=void 0;(function(g){g.BeginningOfLine="BeginningOfLine";g.EndOfLine="EndOfLine"})(e.GeometricEffectOffsetTangentMethod||(e.GeometricEffectOffsetTangentMethod={}));e.GeometricEffectWaveform=void 0;(function(g){g.Sinus="Sinus";g.Square="Square";g.Triangle="Triangle";g.Random="Random"})(e.GeometricEffectWaveform||(e.GeometricEffectWaveform={}));e.GlyphHinting=void 0;(function(g){g[g.None=0]="None";g[g.Default=1]="Default";g[g.Force= 2]="Force"})(e.GlyphHinting||(e.GlyphHinting={}));e.GradientAlignment=void 0;(function(g){g[g.Buffered=0]="Buffered";g[g.Left=1]="Left";g[g.Right=2]="Right";g[g.AlongLine=3]="AlongLine"})(e.GradientAlignment||(e.GradientAlignment={}));e.GradientFillMethod=void 0;(function(g){g[g.Linear=0]="Linear";g[g.Rectangular=1]="Rectangular";g[g.Circular=2]="Circular";g[g.Buffered=3]="Buffered"})(e.GradientFillMethod||(e.GradientFillMethod={}));e.GradientStrokeType=void 0;(function(g){g[g.Discrete=0]="Discrete"; g[g.Continuous=1]="Continuous"})(e.GradientStrokeType||(e.GradientStrokeType={}));e.GradientStrokeMethod=void 0;(function(g){g[g.AcrossLine=0]="AcrossLine";g[g.AloneLine=1]="AloneLine"})(e.GradientStrokeMethod||(e.GradientStrokeMethod={}));e.HorizontalAlignment=void 0;(function(g){g[g.Left=0]="Left";g[g.Right=1]="Right";g[g.Center=2]="Center";g[g.Justify=3]="Justify"})(e.HorizontalAlignment||(e.HorizontalAlignment={}));e.LeaderLineStyle=void 0;(function(g){g[g.Base=0]="Base";g[g.MidPoint=1]="MidPoint"; g[g.ThreePoint=2]="ThreePoint";g[g.FourPoint=3]="FourPoint";g[g.Underline=4]="Underline";g[g.CircularCW=5]="CircularCW";g[g.CircularCCW=6]="CircularCCW"})(e.LeaderLineStyle||(e.LeaderLineStyle={}));e.LineCapStyle=void 0;(function(g){g.Butt="Butt";g.Round="Round";g.Square="Square"})(e.LineCapStyle||(e.LineCapStyle={}));e.LineDashEnding=void 0;(function(g){g.NoConstraint="NoConstraint";g.HalfPattern="HalfPattern";g.HalfGap="HalfGap";g.FullPattern="FullPattern";g.FullGap="FullGap";g.Custom="Custom"})(e.LineDashEnding|| (e.LineDashEnding={}));e.LineDecorationStyle=void 0;(function(g){g[g.None=-1]="None";g[g.Custom=0]="Custom";g[g.Circle=1]="Circle";g[g.OpenArrow=2]="OpenArrow";g[g.ClosedArrow=3]="ClosedArrow";g[g.Diamond=4]="Diamond"})(e.LineDecorationStyle||(e.LineDecorationStyle={}));e.LineGapType=void 0;(function(g){g[g.ExtraLeading=0]="ExtraLeading";g[g.Multiple=1]="Multiple";g[g.Exact=2]="Exact"})(e.LineGapType||(e.LineGapType={}));e.LineJoinStyle=void 0;(function(g){g.Bevel="Bevel";g.Round="Round";g.Miter= "Miter"})(e.LineJoinStyle||(e.LineJoinStyle={}));e.ExpressionReturnType=void 0;(function(g){g[g.Default=0]="Default";g[g.String=1]="String";g[g.Numeric=2]="Numeric"})(e.ExpressionReturnType||(e.ExpressionReturnType={}));e.MarkerPlacementType=void 0;(function(g){g[g.InsidePolygon=0]="InsidePolygon";g[g.PolygonCenter=1]="PolygonCenter";g[g.RandomlyInsidePolygon=2]="RandomlyInsidePolygon"})(e.MarkerPlacementType||(e.MarkerPlacementType={}));e.MaterialMode=void 0;(function(g){g[g.Tint=0]="Tint";g[g.Replace= 1]="Replace";g[g.Multiply=2]="Multiply"})(e.MaterialMode||(e.MaterialMode={}));e.PlacementClip=void 0;(function(g){g[g.ClipAtBoundary=0]="ClipAtBoundary";g[g.RemoveIfCenterOutsideBoundary=1]="RemoveIfCenterOutsideBoundary";g[g.DoNotTouchBoundary=2]="DoNotTouchBoundary";g[g.DoNotClip=3]="DoNotClip"})(e.PlacementClip||(e.PlacementClip={}));e.PlacementEndings=void 0;(function(g){g.NoConstraint="NoConstraint";g.WithMarkers="WithMarkers";g.WithFullGap="WithFullGap";g.WithHalfGap="WithHalfGap";g.Custom= "Custom"})(e.PlacementEndings||(e.PlacementEndings={}));e.PlacementGridType=void 0;(function(g){g.Fixed="Fixed";g.Random="Random";g.RandomFixedQuantity="RandomFixedQuantity"})(e.PlacementGridType||(e.PlacementGridType={}));e.PlacementOnLineRelativeTo=void 0;(function(g){g.LineMiddle="LineMiddle";g.LineBeginning="LineBeginning";g.LineEnd="LineEnd";g.SegmentMidpoint="SegmentMidpoint"})(e.PlacementOnLineRelativeTo||(e.PlacementOnLineRelativeTo={}));e.PlacementPolygonCenterMethod=void 0;(function(g){g.OnPolygon= "OnPolygon";g.CenterOfMass="CenterOfMass";g.BoundingBoxCenter="BoundingBoxCenter"})(e.PlacementPolygonCenterMethod||(e.PlacementPolygonCenterMethod={}));e.PlacementRandomlyAlongLineRandomization=void 0;(function(g){g[g.Low=0]="Low";g[g.Medium=1]="Medium";g[g.High=2]="High"})(e.PlacementRandomlyAlongLineRandomization||(e.PlacementRandomlyAlongLineRandomization={}));e.PlacementStepPosition=void 0;(function(g){g[g.MarkerCenter=0]="MarkerCenter";g[g.MarkerBounds=1]="MarkerBounds"})(e.PlacementStepPosition|| (e.PlacementStepPosition={}));e.PointSymbolCalloutScale=void 0;(function(g){g[g.None=0]="None";g[g.PropUniform=1]="PropUniform";g[g.PropNonuniform=2]="PropNonuniform";g[g.DifUniform=3]="DifUniform";g[g.DifNonuniform=4]="DifNonuniform"})(e.PointSymbolCalloutScale||(e.PointSymbolCalloutScale={}));e.Simple3DLineStyle=void 0;(function(g){g.Tube="Tube";g.Strip="Strip";g.Wall="Wall"})(e.Simple3DLineStyle||(e.Simple3DLineStyle={}));e.SizeVariationMethod=void 0;(function(g){g[g.Random=0]="Random";g[g.Increasing= 1]="Increasing";g[g.Decreasing=2]="Decreasing";g[g.IncreasingThenDecreasing=3]="IncreasingThenDecreasing"})(e.SizeVariationMethod||(e.SizeVariationMethod={}));e.SymbolUnits=void 0;(function(g){g[g.Relative=0]="Relative";g[g.Absolute=1]="Absolute"})(e.SymbolUnits||(e.SymbolUnits={}));e.TextCase=void 0;(function(g){g[g.Normal=0]="Normal";g[g.LowerCase=1]="LowerCase";g[g.Allcaps=2]="Allcaps"})(e.TextCase||(e.TextCase={}));e.TextReadingDirection=void 0;(function(g){g[g.LTR=0]="LTR";g[g.RTL=1]="RTL"})(e.TextReadingDirection|| (e.TextReadingDirection={}));e.TextureFilter=void 0;(function(g){g.Draft="Draft";g.Picture="Picture";g.Text="Text"})(e.TextureFilter||(e.TextureFilter={}));e.VerticalAlignment=void 0;(function(g){g[g.Top=0]="Top";g[g.Center=1]="Center";g[g.Baseline=2]="Baseline";g[g.Bottom=3]="Bottom"})(e.VerticalAlignment||(e.VerticalAlignment={}));e.VerticalGlyphOrientation=void 0;(function(g){g[g.Right=0]="Right";g[g.Upright=1]="Upright"})(e.VerticalGlyphOrientation||(e.VerticalGlyphOrientation={}));e.WaterbodySize= void 0;(function(g){g[g.Small=0]="Small";g[g.Medium=1]="Medium";g[g.Large=2]="Large"})(e.WaterbodySize||(e.WaterbodySize={}));e.WaveStrength=void 0;(function(g){g[g.Calm=0]="Calm";g[g.Rippled=1]="Rippled";g[g.Slight=2]="Slight";g[g.Moderate=3]="Moderate"})(e.WaveStrength||(e.WaveStrength={}));Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectBuffer":function(){define("exports ../../../geometry ../../../geometry/GeometryCursor ../../../geometry/geometryCursorCollectUtils ../CIMEffects ../CurveHelper ../enums ../../../geometry/SpatialReference".split(" "), function(e,g,q,h,m,l,d,b){class a{static local(){null===a.instance&&(a.instance=new a);return a.instance}execute(n,c,r,k,p,t){return new f(n,c,r,k,p,t)}}a.instance=null;class f{constructor(n,c,r,k,p,t){this._inputGeometries=n;this._tileKey=k;this._geometryEngine=p;this._curveHelper=new l.CurveHelper;this._size=(void 0!==c.size?c.size:1)*r;this._maxInflateSize=t*r;this._offsetFlattenError=l.pixelTolerance*r}next(){for(var n;n=this._inputGeometries.next();){if(0===this._size)return n;if("esriGeometryEnvelope"=== n.geometryType)if(0this._size&&(c=n.asJSON(),0.95*p&&(r=.95*p);p=.5*t;var w=this._leftPerp(k);r=[c[0]+k[0]*r,c[1]+ k[1]*r];var u=a.length-1;c=[];c.push(f?[-w[0],-w[1]]:w);var y=[-k[0],-k[1]];for(f=1;fw?[-y[0],-y[1]]:y);y=k}c.push(this._rightPerp(y));for(u=c.length-1;0f.length)return[];const w=this._cp2(f,-4,1),u=this._cp3(f,w,.882353,-1.94),y=[];y.push(this._mid(w,u));y.push(c);a.push(y); break;case m.GeometricEffectControlMeasureLineRule.SecondSegmentWithTicks:if(3>f.length)return[];const x=this._cp2(f,-4,1),v=this._cp3(f,x,.882353,-1.94),A=this._sub(v,x);let z;z=0=la;la++)ja.push(this._add(Z,aa)),this._rotateDirect(aa,ca,ea);ja.push(ka);a.push(ja);break;case m.GeometricEffectControlMeasureLineRule.HalfCircleSecondSegment:const na=this._cp2(f,0,-1),qa=this._cp3(f,na,1,-1);let oa=this._sub(c,na);this._normalize(oa);const ua=this._crossProduct(oa,this._sub(qa,na))/2;this._leftPerpendicular(oa);const sa=[na[0]+oa[0]*ua,na[1]+oa[1]*ua];oa=this._sub(na,sa);const M=Math.cos(Math.PI/18);let W=Math.sin(Math.PI/18);0=la;la++)this._rotateDirect(oa,M,W),da.push(this._add(sa,oa));a.push(da);break;case m.GeometricEffectControlMeasureLineRule.HalfCircleExtended:const fa=this._cp2(f,0,-2),ma=this._cp3(f,fa,1,-1);let ta;if(4<=n)ta=f[3];else{const la=this._sub(c,fa);ta=this._add(ma,la)}const za=this._dist(fa,ma)/2/.75,cb=this._sub(fa,c);this._normalize(cb,za);const db=this._sub(ma,ta);this._normalize(db,za);a.push([ta,ma]);const rb=[this._clone(ma)];this._addBezier3(rb,ma,this._add(ma,db),this._add(fa,cb),fa,4); rb.push(c);a.push(rb);break;case m.GeometricEffectControlMeasureLineRule.OpenCircle:const Hb=this._cp2(f,-2,0),Ib=this._sub(Hb,c),jc=Math.cos(Math.PI/18),kc=-Math.sin(Math.PI/18),Jb=[Hb];for(let la=1;33>=la;la++)this._rotateDirect(Ib,jc,kc),Jb.push(this._add(c,Ib));a.push(Jb);break;case m.GeometricEffectControlMeasureLineRule.CoverageEdgesWithTicks:const Fa=this._cp2(f,0,-1);let Ua;if(3<=n)Ua=f[2];else{const la=this._sub(Fa,c),pa=this._leftPerp(la);Ua=[c[0]+pa[0]-.25*la[0],c[1]+pa[1]-.25*la[1]]}let Kb; if(4<=n)Kb=f[3];else{const la=this._mid(c,Fa),pa=this._sub(c,Fa);this._normalize(pa);this._leftPerpendicular(pa);const ra=this._crossProduct(pa,this._sub(Ua,la));this._rightPerpendicular(pa);Kb=[Ua[0]+pa[0]*ra*2,Ua[1]+pa[1]*ra*2]}const Ga=this._sub(Fa,c);let eb,Ha;eb=0.95*Ia&&(gb=.95*Ia);const Nb=[c[0]+va[0]*gb,c[1]+va[1]*gb];let wa=this._leftPerp(va),hb=[];hb.push([Nb[0]-wa[0]*Va,Nb[1]-wa[1]*Va]);hb.push([Nb[0]+wa[0]*Va,Nb[1]+wa[1]*Va]);a.push(hb);if(4<=n){const la=f[3];let pa=this._dotProduct(va,this._sub(la,c));pa<.1*Ia?pa=.1*Ia:pa>.9*Ia&&(pa=.9*Ia);const ra=[c[0]+va[0]*pa,c[1]+ va[1]*pa],xa=this._crossProduct(va,this._sub(la,c)),qc=[];qc.push([ra[0]-wa[0]*xa,ra[1]-wa[1]*xa]);qc.push([ra[0]+wa[0]*xa,ra[1]+wa[1]*xa]);a.push(qc)}const Lc=[fb[0]+wa[0]*Va,fb[1]+wa[1]*Va];wa=this._sub(fb,Lc);const gd=Math.cos(Math.PI/18);let rc=Math.sin(Math.PI/18);0>Va&&(rc=-rc);hb=[c,fb];for(let la=1;9>=la;la++)this._rotateDirect(wa,gd,rc),hb.push(this._add(Lc,wa));a.push(hb);break;case m.GeometricEffectControlMeasureLineRule.ClosedHalfCircle:const sc=this._cp2(f,2,0),Mc=this._mid(c,sc),Nc= this._sub(sc,Mc),hd=Math.cos(Math.PI/18),id=Math.sin(Math.PI/18),Oc=[c,sc];for(let la=1;18>=la;la++)this._rotateDirect(Nc,hd,id),Oc.push(this._add(Mc,Nc));a.push(Oc);break;case m.GeometricEffectControlMeasureLineRule.TripleParallelExtended:const Wa=this._cp2(f,0,-2),tc=this._cp3(f,Wa,1,-2),Xa=this._mid(c,Wa),Ja=this._sub(tc,Wa);this._normalize(Ja);const Pc=Math.abs(this._crossProduct(Ja,this._sub(Xa,Wa)))/2,ib=this._dist(Wa,tc),Qc=[Wa,c];Qc.push([c[0]+Ja[0]*ib*.5,c[1]+Ja[1]*ib*.5]);a.push(Qc);const jb= [];jb.push([Xa[0]-Ja[0]*Pc,Xa[1]-Ja[1]*Pc]);jb.push([Xa[0]+Ja[0]*ib*.375,Xa[1]+Ja[1]*ib*.375]);h.setId(jb[jb.length-1],1);jb.push([Xa[0]+Ja[0]*ib*.75,Xa[1]+Ja[1]*ib*.75]);a.push(jb);a.push([Wa,tc]);break;case m.GeometricEffectControlMeasureLineRule.ParallelWithTicks:const sb=this._cp2(f,3,0),uc=this._cp3(f,sb,.5,-1),tb=this._sub(uc,sb);this._normalize(tb);const Rc=this._crossProduct(tb,this._sub(uc,c));this._leftPerpendicular(tb);this._addAngledTicks(a,c,sb,uc);this._addAngledTicks(a,this._mix(c, 1,tb,Rc),this._mix(sb,1,tb,Rc),this._mid(c,sb));break;case m.GeometricEffectControlMeasureLineRule.Parallel:const ub=this._cp2(f,3,0),jd=this._cp3(f,ub,.5,-1),vc=this._sub(ub,c);this._normalize(vc);const Ob=this._leftPerp(vc),Pb=this._crossProduct(vc,this._sub(jd,c));let vb=[c,ub];a.push(vb);vb=[];vb.push([c[0]+Ob[0]*Pb,c[1]+Ob[1]*Pb]);vb.push([ub[0]+Ob[0]*Pb,ub[1]+Ob[1]*Pb]);a.push(vb);break;case m.GeometricEffectControlMeasureLineRule.PerpendicularToFirstSegment:const wc=this._cp2(f,3,0),kd=this._cp3(f, wc,.5,-1),Qb=this._mid(c,wc),Ya=this._sub(wc,c);this._normalize(Ya);const Rb=this._crossProduct(Ya,this._sub(kd,c));this._leftPerpendicular(Ya);const xc=[];xc.push([Qb[0]-Ya[0]*Rb*.25,Qb[1]-Ya[1]*Rb*.25]);xc.push([Qb[0]+Ya[0]*Rb*1.25,Qb[1]+Ya[1]*Rb*1.25]);a.push(xc);break;case m.GeometricEffectControlMeasureLineRule.ParallelOffset:const kb=this._cp2(f,3,0),ld=this._cp3(f,kb,.5,-1),Aa=this._sub(kb,c);this._normalize(Aa);const Na=this._crossProduct(Aa,this._sub(ld,c));this._leftPerpendicular(Aa);const yc= [];yc.push([c[0]-Aa[0]*Na,c[1]-Aa[1]*Na]);yc.push([kb[0]-Aa[0]*Na,kb[1]-Aa[1]*Na]);a.push(yc);const zc=[];zc.push([c[0]+Aa[0]*Na,c[1]+Aa[1]*Na]);zc.push([kb[0]+Aa[0]*Na,kb[1]+Aa[1]*Na]);a.push(zc);break;case m.GeometricEffectControlMeasureLineRule.OffsetOpposite:const Sb=this._cp2(f,3,0),md=this._cp3(f,Sb,.5,-1),Za=this._sub(Sb,c);this._normalize(Za);const Tb=this._crossProduct(Za,this._sub(md,c));this._leftPerpendicular(Za);const Ac=[];Ac.push([c[0]-Za[0]*Tb,c[1]-Za[1]*Tb]);Ac.push([Sb[0]-Za[0]* Tb,Sb[1]-Za[1]*Tb]);a.push(Ac);break;case m.GeometricEffectControlMeasureLineRule.OffsetSame:const Ub=this._cp2(f,3,0),nd=this._cp3(f,Ub,.5,-1),$a=this._sub(Ub,c);this._normalize($a);const Vb=this._crossProduct($a,this._sub(nd,c));this._leftPerpendicular($a);const Bc=[];Bc.push([c[0]+$a[0]*Vb,c[1]+$a[1]*Vb]);Bc.push([Ub[0]+$a[0]*Vb,Ub[1]+$a[1]*Vb]);a.push(Bc);break;case m.GeometricEffectControlMeasureLineRule.CircleWithArc:let Oa=this._cp2(f,3,0);const Cc=this._cp3(f,Oa,.5,-1);let lb,Wb;if(4<=n)lb= f[3],Wb=0=la;la++)this._rotateDirect(Sc,od,pd),wb.push(this._add(c,Sc));this._add90DegArc(wb,Oa,lb,Cc,Wb);h.setId(wb[wb.length- 8],1);a.push(wb);break;case m.GeometricEffectControlMeasureLineRule.DoubleJog:let Pa=this._cp2(f,-3,1),ab=this._cp3(f,Pa,-1,-.5),La;if(4<=n)La=f[3];else{const la=c;c=Pa;La=ab;const pa=this._dist(c,la),ra=this._dist(La,la);let xa=30*this._geomUnitsPerPoint;.5*pathis._crossProduct(ya,this._sub(c,ab))?this._rotateDirect(ya,Qa,Qa):this._rotateDirect(ya,Qa,-Qa);Ba=[];Ba.push(ab);Ba.push(this._add(Uc,ya));Ba.push(this._sub(Uc,ya));Ba.push(La);a.push(Ba); break;case m.GeometricEffectControlMeasureLineRule.PerpendicularOffset:const Yb=this._cp2(f,-4,1),Vc=this._cp3(f,Yb,.882353,-1.94),xb=this._sub(Vc,Yb);0.95* Zb-mb&&(nb=.95*Zb-mb);const ac=[yb[0]+Ca[0]*nb,yb[1]+Ca[1]*nb],bc=this._leftPerp(Ca),cc=[];cc.push([ac[0]+bc[0]*$b+Ca[0]*mb,ac[1]+bc[1]*$b+Ca[1]*mb]);cc.push(c);cc.push([ac[0]-bc[0]*$b+Ca[0]*mb,ac[1]-bc[1]*$b+Ca[1]*mb]);a.push(cc);break;case m.GeometricEffectControlMeasureLineRule.ChevronArrowOffset:const [zb,bd]=this._arrowLastSeg(f),Da=this._sub(c,zb),dc=this._norm(Da);this._normalize(Da);const ec=this._crossProduct(Da,this._sub(bd,zb));let ob=this._dotProduct(Da,this._sub(bd,zb));ob<.05*dc?ob= .05*dc:ob>.95*dc&&(ob=.95*dc);const Ab=[zb[0]+Da[0]*ob,zb[1]+Da[1]*ob];this._leftPerpendicular(Da);const fc=[];fc.push([Ab[0]+Da[0]*ec*.5,Ab[1]+Da[1]*ec*.5]);fc.push(this._mid(Ab,c));fc.push([Ab[0]-Da[0]*ec*.5,Ab[1]-Da[1]*ec*.5]);a.push(fc);break;case m.GeometricEffectControlMeasureLineRule.PartialFirstSegment:const [Bb,wd]=this._arrowLastSeg(f),Cb=this._sub(c,Bb),gc=this._norm(Cb);this._normalize(Cb);let pb=this._dotProduct(Cb,this._sub(wd,Bb));pb<.05*gc?pb=.05*gc:pb>.95*gc&&(pb=.95*gc);a.push([Bb, [Bb[0]+Cb[0]*pb,Bb[1]+Cb[1]*pb]]);break;case m.GeometricEffectControlMeasureLineRule.Arch:const Dc=this._cp2(f,0,-1),hc=this._cp3(f,Dc,.5,1),cd=this._sub(c,Dc),xd=this._mix(hc,1,cd,.55),yd=this._mix(hc,1,cd,-.55),Ec=[c];this._addBezier2(Ec,c,xd,hc,4);this._addBezier2(Ec,hc,yd,Dc,4);a.push(Ec);break;case m.GeometricEffectControlMeasureLineRule.CurvedParallelTicks:const Ra=this._cp2(f,-4,1),Db=this._cp3(f,Ra,.882353,-1.94),bb=this._sub(Db,Ra);0la;la++){const pa=ic[2*la+1],ra=[this._clone(pa)];ra.push(this._add(pa,[bb[0]/4,bb[1]/4]));a.push(ra)}break;case m.GeometricEffectControlMeasureLineRule.Arc90Degrees:const Gc=this._cp2(f,0,-1),Bd=this._cp3(f,Gc,.5,1),ed=[Gc];this._add90DegArc(ed, Gc,c,Bd);a.push(ed);break;case m.GeometricEffectControlMeasureLineRule.TipWithPerpendicularAndTicks:const [Hc,fd]=this._arrowLastSeg(f),qb=10*this._geomUnitsPerPoint,Ea=this._sub(c,Hc),Eb=this._norm(Ea);this._normalize(Ea);let Ka=this._crossProduct(Ea,this._sub(fd,Hc)),Fb=this._dotProduct(Ea,this._sub(fd,Hc));Fb<.05*Eb?Fb=.05*Eb:Fb>.95*Eb-qb&&(Fb=.95*Eb-qb);const Sa=this._leftPerp(Ea),Ma=[c[0]-Ea[0]*qb,c[1]-Ea[1]*qb],Ta=.5*Math.max(Eb-Fb-qb,qb);Ka=Math.abs(Ka);const Gb=[];Gb.push([Ma[0]+Sa[0]*(Ka+ Ta)-Ea[0]*Ta,Ma[1]+Sa[1]*(Ka+Ta)-Ea[1]*Ta]);Gb.push([Ma[0]+Sa[0]*Ka,Ma[1]+Sa[1]*Ka]);Gb.push([Ma[0]-Sa[0]*Ka,Ma[1]-Sa[1]*Ka]);Gb.push([Ma[0]-Sa[0]*(Ka+Ta)-Ea[0]*Ta,Ma[1]-Sa[1]*(Ka+Ta)-Ea[1]*Ta]);a.push(Gb);a.push([Ma,c]);break;default:a.push(f)}}return a}}e.EffectControlMeasureLine=l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectCut":function(){define(["exports","../../../geometry/GeometryCursor","../CIMCursor","../CurveHelper"],function(e,g,q,h){class m{static local(){null=== m.instance&&(m.instance=new m);return m.instance}execute(d,b,a,f,n){return new l(d,b,a)}}m.instance=null;class l extends q.PathEffectCursor{constructor(d,b,a){super(d,!0,!0);this._curveHelper=new h.CurveHelper;this._beginCut=(void 0!==b.beginCut?b.beginCut:1)*a;this._endCut=(void 0!==b.endCut?b.endCut:1)*a;this._middleCut=(void 0!==b.middleCut?b.middleCut:0)*a;this._invert=void 0!==b.invert?b.invert:!1;0>this._beginCut&&(this._beginCut=0);0>this._endCut&&(this._endCut=0);0>this._middleCut&&(this._middleCut= 0)}processPath(d){const {_beginCut:b,_endCut:a,_middleCut:f}=this,n=d.pathLength(),c=g.GeometryCursor.createEmptyOptimizedCIM("esriGeometryPolyline");if(!this._invert)if(0===b&&0===a&&0===f)for(c.startPath();d.nextPoint();)c.pushXY(d.x,d.y);else b+a+f=n)for(c.startPath();d.nextPoint();)c.pushXY(d.x,d.y);else this._curveHelper.appendSubCurve(c, d,0,b),this._curveHelper.appendSubCurve(c,d,.5*(n-f),.5*(n+f)),this._curveHelper.appendSubCurve(c,d,n-a,a);return 0===c.totalSize?null:c}}e.EffectCut=m;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectDashes":function(){define("exports ../../../geometry/GeometryCursor ../../../geometry/geometryCursorCollectUtils ../../../geometry/support/coordsUtils ../CIMCursor ../enums ../GeometryWalker ../utils".split(" "),function(e,g,q,h,m,l,d,b){class a{static local(){null=== a.instance&&(a.instance=new a);return a.instance}execute(n,c,r,k,p){return new f(n,c,r,k)}}a.instance=null;class f extends m.PathEffectCursor{constructor(n,c,r,k){super(n,!0,!0);this._firstCurve=null;this._walker=new d.GeometryWalker;this._walker.updateTolerance(r);this._endings=c.lineDashEnding;this._customDashPos=-(c.offsetAlongLine??0)*r;this._offsetAtEnd=(c.customEndingOffset??0)*r;this._tileKey=k;n=b.normalizeDashTemplate(c).dashTemplate;null==n&&(n=[]);n.length%2&&(n=[...n,...n]);c=0;for(k= 0;kp&&(p=1E-7);c+=p}this._patternLength=c;this._numOfDashesPerPattern=n.length/2;this._pattern=new d.DashPattern;this._pattern.init(n,!0);this._pattern.scale(r)}processPath(n){if(0===this._pattern.length())return this.iteratePath=!1,n=q.collectPath(n),g.GeometryCursor.fromJSONCIM({paths:[n]});if(!this.iteratePath){var c=!0;switch(this._endings){default:this._pattern.extPtGap=0;break;case l.LineDashEnding.FullPattern:this.isClosed||(this._pattern.extPtGap=.5* this._pattern.firstValue());break;case l.LineDashEnding.FullGap:this.isClosed||(this._pattern.extPtGap=.5*this._pattern.lastValue());break;case l.LineDashEnding.NoConstraint:this.isClosed||(c=!1);break;case l.LineDashEnding.Custom:this.isClosed||(this._pattern.extPtGap=.5*this._offsetAtEnd)}var r=n.pathLength();if(this._pattern.isEmpty()||r<.1*this._pattern.length()||!this._walker.init(n,this._pattern,c))return n=q.collectPath(n),g.GeometryCursor.fromJSONCIM({paths:[n]})}if(this.iteratePath)n=this._pattern.nextValue(); else{switch(this._endings){default:c=.5*this._pattern.firstValue();break;case l.LineDashEnding.HalfGap:c=.5*-this._pattern.lastValue();break;case l.LineDashEnding.FullGap:c=-this._pattern.lastValue();break;case l.LineDashEnding.FullPattern:c=0;break;case l.LineDashEnding.NoConstraint:case l.LineDashEnding.Custom:c=-this._customDashPos}n=c/this._pattern.length();n-=Math.floor(n);c=n*this._pattern.length();this._pattern.reset();n=this._pattern.nextValue();for(r=!1;c>=n;)c-=n,n=this._pattern.nextValue(), r=!r;n-=c;r?(this._walker.nextPosition(n),n=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(n),n=this._pattern.nextValue(),this._walker.nextPosition(n),n=this._pattern.nextValue())}if(c=this._walker.nextCurve(n))if(this._walker.isPathEnd()){if(this.iteratePath=!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)c.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else n=this._pattern.nextValue(),!this._walker.nextPosition(n)|| this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(c.pushCursor(this._firstCurve),this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,c=this._firstCurve,this._firstCurve=null;c?.reset();return c}isClippingRequired(n){n=q.collectMultipath(n);let c=0;for(const r of n)c+=h.getPathLength(r);return 1E3c&&(c=1E-7);this._values.push(c);this._length+=c}a&&b.length&1&&(this._length*=2);if(0===this._length)return!1;this.ctrlPtGap=this.extPtGap=0; this._currentValue=-1;return!0}scale(b){const a=this._values?this._values.length:0;for(let f=0;fa.segmentLength+this._tolerance;)if(f&&(0===f.pathSize&&(0===c?(c=a.segment[0],f.pushXY(c[0],c[1])):f.pushPoint(this.getSegCoord2D(a.segment,c))),c=a.segment[1],f.pushXY(c[0],c[1])),c=0,b-=(a.segmentLength-a.abscissa)/this._partLengthRatio,this._partSegCount)a.segment=this._nextSegment(),a.segmentLength=this.getSegLength(a.segment),a.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart()){if(n=== e.EndType.FAIL)return!1;a.segmentLength=this.getSegLength(a.segment);a.isPartEnd=!0;n===e.EndType.END?(a.abscissa=a.segmentLength,a.isPathEnd=!0):a.abscissa=a.segmentLength+b;return!0}this._currentPosition.copyTo(a)}a.abscissa+=b*this._partLengthRatio;f&&(0===f.pathSize&&(0===c?f.pushPoint(a.segment[0]):f.pushPoint(this.getSegCoord2D(a.segment,c))),b=a.abscissa/a.segmentLength,1===b?f.pushPoint(a.segment[1]):f.pushPoint(this.getSegCoord2D(a.segment,b)));!this._partSegCount&&Math.abs(a.abscissa-a.segmentLength)< this._tolerance&&(a.isPathEnd=this._partIsLast,a.isPartEnd=!0);return!0}_getPoint(b){return this.getSegCoord2D(this._currentPosition.segment,0>=b.segmentLength?0:b.abscissa/b.segmentLength)}_getAngleCS(b){return this.getSegAngleCS(this._currentPosition.segment,0>=b.segmentLength?0:b.abscissa/b.segmentLength)}_setPosAtNextPart(){for(;this._partSegCount;)this._hasNextSegment()&&this._nextSegment(),this._partSegCount--;if(!this._hasNextSegment())return!1;this._partLength=0;this._partIsLast=!0;for(this._partSegCount= 0;this._hasNextSegment();)if(this._partLength+=this.getSegLength(this._nextSegment()),this._partSegCount++,this._pathCursor.getControlPointAt(this._getEndPointIndex())){this._partIsLast=!this._hasNextSegment();break}for(var b=this._partSegCount;b;)this._previousSegment(),--b;this._currentPosition.segment=this._nextSegment();this._currentPosition.segmentLength=this.getSegLength(this._currentPosition.segment);this._currentPosition.abscissa=0;this._currentPosition.isPathEnd=this._currentPosition.isPartEnd= !1;--this._partSegCount;b=this._getStartPointIndex();this._ctrlPtBegin=this._pathCursor.getControlPointAt(b);b=b+this._partSegCount+1;b>=this._pathCursor.pathSize&&(b=0);this._ctrlPtEnd=this._pathCursor.getControlPointAt(b);if(0=f&&(f=0this._partLengthRatio&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._segMath.min(f.xmax- f.xmin,f.ymax-f.ymin)-2*this._width?a:q.GeometryCursor.fromJSONCIM({paths:[[[f.xmin+this._width,f.ymin+this._width],[f.xmax-this._width,f.ymin+this._width],[f.xmax-this._width,f.ymax-this._width],[f.xmin+this._width,f.ymax-this._width],[f.xmin+this._width,f.ymin+this._width]],[[f.xmin,f.ymin],[f.xmin,f.ymax],[f.xmax,f.ymax],[f.xmax,f.ymin],[f.xmin,f.ymin]]]})}if("esriGeometryPolygon"===a.geometryType){if(0===this._width)return a.clone();var n=this._geometryEngine;if(null==n)break;if(a=this._tileKey? h.clipCursorToTileExtent(a,this._maxInflateSize):a.clone()){if(n=n.buffer(l.WebMercator,a.asJSON(),-this._width,1))for(f of n.rings)if(f){a.startPath();for(const c of f.reverse())a.pushXY(c[0],a.yFactor*c[1])}return a}}}return null}}e.EffectDonut=d;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/EffectJog":function(){define(["exports","../../../geometry/GeometryCursor","../CIMCursor","../CurveHelper"],function(e,g,q,h){class m{static local(){null===m.instance&& (m.instance=new m);return m.instance}execute(d,b,a,f,n){return new l(d,b,a)}}m.instance=null;class l extends q.PathEffectCursor{constructor(d,b,a){super(d,!1,!0);this._curveHelper=new h.CurveHelper;this._length=(void 0!==b.length?b.length:20)*a;this._angle=void 0!==b.angle?b.angle:225;this._position=void 0!==b.position?b.position:50;0>this._length&&(this._length=-this._length);20>this._position&&(this._position=20);80=this._height&&(this._height=Math.abs(this._height));0>=this._period&&(this._period=Math.abs(this._period)); this._pattern=new h.DashPattern;this._pattern.addValue(this._period);this._pattern.addValue(this._period);this._walker=new h.GeometryWalker;this._walker.updateTolerance(a)}next(){for(var d=this._inputGeometries.next();d;){if(0===this._height||0===this._period||(d=this._processGeom(d)))return d;d=this._inputGeometries.next()}return null}_processGeom(d){const b=g.GeometryCursor.createEmptyOptimizedCIM(d.geometryType);for(;d.nextPath();){b.startPath();const a=d.pathLength();if(this._walker.init(d,this._pattern))switch(this._style){default:this._constructCurve(b, a,!1);break;case q.GeometricEffectWaveform.Square:this._constructSquare(b,a);break;case q.GeometricEffectWaveform.Triangle:this._constructTriangle(b,a);break;case q.GeometricEffectWaveform.Random:this._constructCurve(b,a,!0)}else for(;d.nextPoint();)b.pushXY(d.x,d.y)}return b}_constructCurve(d,b,a){var f=Math.round(b/this._period);0===f&&(f=1);const n=this._period/16,c=1/(16*f+1);b=2*Math.PI*b/(b/f);f=2*Math.PI*Math.random();const r=2*Math.PI*Math.random(),k=2*Math.PI*Math.random(),p=.75-Math.random()/ 2,t=.75-Math.random()/2,w=new h.Pos;this._walker.curPointAndAngle(w);d.pushPoint(w.pt);let u=0;for(;;)if(this._walker.nextPointAndAngle(n,w)){const y=u;u+=c;let x;if(a){const v=this._height/2*(1+.3*Math.sin(p*b*y+f));x=v*Math.sin(b*y+r);x+=v*Math.sin(t*b*y+k);x/=2}else x=.5*this._height*Math.sin(.5*b*y);d.pushXY(w.pt[0]-x*w.sa,w.pt[1]+x*w.ca)}else{d.pushPoint(this._walker.getPathEnd());break}}_constructSquare(d,b){Math.round(b/this._period);for(b=!0;;){let a=!1;if(this._walker.curPositionIsValid()){const f= new h.Pos;this._walker.curPointAndAngle(f);const n=new h.Pos;if(this._walker.nextPointAndAngle(this._period,n)){const c=new h.Pos;this._walker.nextPointAndAngle(this._period,c)&&(b?(d.pushPoint(f.pt),b=!1):d.pushPoint(f.pt),d.pushXY(f.pt[0]-this._height/2*f.sa,f.pt[1]+this._height/2*f.ca),d.pushXY(n.pt[0]-this._height/2*n.sa,n.pt[1]+this._height/2*n.ca),d.pushXY(n.pt[0]+this._height/2*n.sa,n.pt[1]-this._height/2*n.ca),d.pushXY(c.pt[0]+this._height/2*c.sa,c.pt[1]-this._height/2*c.ca),a=!0)}}if(!a){d.pushPoint(this._walker.getPathEnd()); break}}}_constructTriangle(d,b){Math.round(b/this._period);for(b=!0;;){let a=!1;if(this._walker.curPositionIsValid()){const f=new h.Pos;this._walker.curPointAndAngle(f);const n=new h.Pos;if(this._walker.nextPointAndAngle(this._period/2,n)){const c=new h.Pos;this._walker.nextPointAndAngle(this._period,c)&&(this._walker.nextPosition(this._period/2)&&(b?(d.pushPoint(f.pt),b=!1):d.pushPoint(f.pt),d.pushXY(n.pt[0]-this._height/2*n.sa,n.pt[1]+this._height/2*n.ca),d.pushXY(c.pt[0]+this._height/2*c.sa,c.pt[1]- this._height/2*c.ca)),a=!0)}}if(!a){d.pushPoint(this._walker.getPathEnd());break}}}}e.EffectWave=m;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/placements/PlacementAlongLineSameSize":function(){define(["exports","../CIMCursor","../enums","../GeometryWalker"],function(e,g,q,h){class m{static local(){null===m.instance&&(m.instance=new m);return m.instance}execute(d,b,a,f,n){return new l(d,b,a)}}m.instance=null;class l extends g.PathTransformationCursor{constructor(d, b,a){super(d);this._geometryWalker=new h.GeometryWalker;this._geometryWalker.updateTolerance(a);this._angleToLine=b.angleToLine??!0;this._offset=(b.offset?b.offset:0)*a;this._originalEndings=b.endings;this._offsetAtEnd=(b.customEndingOffset?b.customEndingOffset:0)*a;this._position=-(b.offsetAlongLine?b.offsetAlongLine:0)*a;this._pattern=new h.DashPattern;this._pattern.init(b.placementTemplate,!1);this._pattern.scale(a);this._endings=this._originalEndings}processPath(d){if(this._pattern.isEmpty())return null; if(this.iteratePath)var b=this._pattern.nextValue();else{this._endings=this._originalEndings===q.PlacementEndings.WithFullGap&&this.isClosed?q.PlacementEndings.WithMarkers:this._originalEndings;this._pattern.extPtGap=0;let a=!0;switch(this._endings){case q.PlacementEndings.NoConstraint:b=-this._position;b=this._adjustPosition(b);a=!1;break;default:b=-this._pattern.lastValue()/2;break;case q.PlacementEndings.WithFullGap:b=-this._pattern.lastValue();this._pattern.extPtGap=this._pattern.lastValue(); break;case q.PlacementEndings.WithMarkers:b=0;break;case q.PlacementEndings.Custom:b=-this._position,b=this._adjustPosition(b),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(d,this._pattern,a))return null;this._pattern.reset();for(d=0;b>d;)b-=d,d=this._pattern.nextValue();b=d-b;this.iteratePath=!0}d=new h.Pos;if(!this._geometryWalker.nextPointAndAngle(b,d)||this._endings===q.PlacementEndings.WithFullGap&&this._geometryWalker.isPathEnd())return this.iteratePath=!1,null;if(this._endings=== q.PlacementEndings.WithMarkers&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed))return null;this.internalPlacement.setTranslate(d.pt[0]-this._offset*d.sa,d.pt[1]+this._offset*d.ca);this._angleToLine&&this.internalPlacement.setRotateCS(d.ca,d.sa);return this.internalPlacement}_adjustPosition(d){d/=this._pattern.length();d-=Math.floor(d);return d*this._pattern.length()}}e.PlacementAlongLineSameSize=m;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/placements/PlacementAtExtremities":function(){define(["exports", "../CIMCursor","../CurveHelper","../enums"],function(e,g,q,h){class m{static local(){null===m.instance&&(m.instance=new m);return m.instance}execute(d,b,a,f,n){return new l(d,b,a)}}m.instance=null;class l extends g.PathTransformationCursor{constructor(d,b,a){super(d,!1,!0);this._curveHelper=new q.CurveHelper;this._placePerPart=b.placePerPart??!1;this._angleToLine=void 0!==b.angleToLine?b.angleToLine:!0;this._offset=void 0!==b.offset?b.offset*a:0;this._type=b.extremityPlacement;this._position=void 0!== b.offsetAlongLine?b.offsetAlongLine*a:0;this._beginProcessed=!1}processMultiPath(d){return this._placePerPart?super.processMultiPath(d):this.processPath(d)}processPath(d){let b;switch(this._type){default:this._beginProcessed?(b=this._atExtremities(d,this._position,!1),this.iteratePath=this.iterateMultiPath=this._beginProcessed=!1):(b=this._atExtremities(d,this._position,!0),this.iteratePath=this.iterateMultiPath=this._beginProcessed=!0);break;case h.ExtremityPlacement.JustBegin:b=this._atExtremities(d, this._position,!0);break;case h.ExtremityPlacement.JustEnd:b=this._atExtremities(d,this._position,!1);case h.ExtremityPlacement.None:}return b}_atExtremities(d,b,a){this._placePerPart||(a?d.seekPath(0):d.seekPath(d.totalSize-1));a||d.seekPathEnd();if(a?d.nextPoint():d.prevPoint()){let f=0,[n,c]=[0,0],[r,k]=[d.x,d.y];for(;a?d.nextPoint():d.prevPoint();){n=r;c=k;r=d.x;k=d.y;const p=this._curveHelper.getLength(n,c,r,k);if(f+p>b){d=(b-f)/p;const [t,w]=this._curveHelper.getAngleCS(n,c,r,k,d);d=this._curveHelper.getCoord2D(n, c,r,k,d);this.internalPlacement.setTranslate(d[0]-this._offset*w,d[1]+this._offset*t);this._angleToLine&&this.internalPlacement.setRotateCS(-t,-w);return this.internalPlacement}f+=p}}return null}}e.PlacementAtExtremities=m;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/placements/PlacementAtRatioPositions":function(){define(["exports","../CIMCursor","../GeometryWalker"],function(e,g,q){class h{static local(){null===h.instance&&(h.instance=new h);return h.instance}execute(l, d,b,a,f){return new m(l,d,b)}}h.instance=null;class m extends g.PathTransformationCursor{constructor(l,d,b){super(l);this._walker=new q.GeometryWalker;this._walker.updateTolerance(b);this._angleToLine=void 0!==d.angleToLine?d.angleToLine:!0;this._offset=void 0!==d.offset?d.offset*b:0;this._beginGap=void 0!==d.beginPosition?d.beginPosition*b:0;this._endGap=void 0!==d.endPosition?d.endPosition*b:0;this._flipFirst=void 0!==d.flipFirst?d.flipFirst:!0;this._pattern=new q.DashPattern;this._pattern.init(d.positionArray, !1,!1);this._subPathLen=0;this._posCount=this._pattern.size();this._isFirst=!0;this._prevPos=0}processPath(l){if(this._pattern.isEmpty())return null;if(this.iteratePath){l=this._pattern.nextValue()*this._subPathLen;var d=this._beginGap+l;l=d-this._prevPos;this._prevPos=d}else{this._posCount=this._pattern.size();this._isFirst=!0;this._prevPos=0;this._subPathLen=l.pathLength()-this._beginGap-this._endGap;if(0>this._subPathLen)return this.iteratePath=!1,null;if(!this._walker.init(l,this._pattern,!1))return null; this._pattern.reset();l=this._pattern.nextValue()*this._subPathLen;d=this._beginGap+l;l=d-this._prevPos;this._prevPos=d;this.iteratePath=!0}d=new q.Pos;if(!this._walker.nextPointAndAngle(l,d,q.EndType.END))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(d.pt[0]-this._offset*d.sa,d.pt[1]+this._offset*d.ca);l=this._isFirst&&this._flipFirst;let b;this._angleToLine?(b=d.ca,d=d.sa):(b=1,d=0);l&&(b=-b,d=-d);this.internalPlacement.setRotateCS(b,d);this._isFirst=!1;this._posCount--;0=== this._posCount&&(this.iteratePath=!1);return this.internalPlacement}}e.PlacementAtRatioPositions=h;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/placements/PlacementInsidePolygon":function(){define(["exports","../../../core/RandomLCG","../CIMPlacements","../enums"],function(e,g,q,h){class m{static local(){null===m.instance&&(m.instance=new m);return m.instance}execute(d,b,a,f,n){return new l(d,b,a,f,n)}}m.instance=null;class l{constructor(d,b,a,f,n){this._currentY= this._currentX=this._yMax=this._yMin=this._xMax=this._xMin=0;this._accelerationMap=null;this._testInsidePolygon=!1;this._verticalSubdivision=!0;this._stepX=Math.abs(b.stepX??16)*a;this._stepY=Math.abs(b.stepY??16)*a;this._stepX=Math.round(128*this._stepX)/128;this._stepY=Math.round(128*this._stepY)/128;if(0!==this._stepX&&0!==this._stepY){this._gridType=b.gridType??h.PlacementGridType.Fixed;if(this._gridType===h.PlacementGridType.Random)this._randomLCG=new g(1*(b.seed??13)),this._randomness=(b.randomness?? 100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._offsetY=this._offsetX=this._sinAngle=0,this._buildRandomValues();else{this._randomness=0;this._gridAngle=b.gridAngle??0;this._shiftOddRows=b.shiftOddRows??!1;this._offsetX=(b.offsetX??0)*a;this._offsetY=(b.offsetY??0)*a;this._cosAngle=Math.cos(this._gridAngle/180*Math.PI);this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI);if(this._stepX)if(0>this._offsetX)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>= .5*this._stepX;)this._offsetX-=this._stepX;if(this._stepY)if(0>this._offsetY)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}this._graphicOriginY=this._graphicOriginX=0;if(null!=f){const [c,r,k,p]=f.split("/");b=parseFloat(c);a=parseFloat(r);f=parseFloat(k);this._graphicOriginX=512*-(parseFloat(p)*2**b+f);this._graphicOriginY=512*a;this._testInsidePolygon=!0}this._internalPlacement=new q.Placement;this._calculateMinMax(d); this._geometryCursor=d}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!l._randValues){l._randValues=[];for(let d=0;24>d;d++)for(let b=0;24>b;b++)l._randValues.push(this._randomLCG.getFloat()),l._randValues.push(this._randomLCG.getFloat())}}_calculateMinMax(d){this._yMax=this._yMin=this._xMax=this._xMin=0;let b,a,f,n,c,r,k,p;b=a=k=c=Number.MAX_VALUE;f=n=p=r=-Number.MAX_VALUE;var t=1!==this._cosAngle;for(d.reset();d.nextPath();)for(;d.nextPoint();){var w=d.x;var u= d.y;var y=w-this._graphicOriginX-this._offsetX;var x=u-this._graphicOriginY-this._offsetY;if(t){var v=this._cosAngle*y-this._sinAngle*x;y=this._sinAngle*y+this._cosAngle*x}else v=y,y=x;b=Math.min(b,v);f=Math.max(f,v);a=Math.min(a,y);n=Math.max(n,y);c=Math.min(c,u);r=Math.max(r,u);k=Math.min(k,w);p=Math.max(p,w)}c=c!==Number.MAX_VALUE?c:-512-this._stepY;r=r!==-Number.MAX_VALUE?r:this._stepY;k=k!==Number.MAX_VALUE?k:-this._stepX;p=p!==-Number.MAX_VALUE?p:512+this._stepX;this._polygonMin=(this._verticalSubdivision= r-c>=p-k)?c:k;if(this._testInsidePolygon){v=0-this._graphicOriginX-this._offsetX-this._stepX;u=512-this._graphicOriginX-this._offsetX+this._stepX;w=-512-this._graphicOriginY-this._offsetY-this._stepY;y=0-this._graphicOriginY-this._offsetY+this._stepY;if(t){t=[[v,w],[v,y],[u,w],[u,y]];v=w=Number.MAX_VALUE;u=y=-Number.MAX_VALUE;for(const A of t)t=this._cosAngle*A[0]-this._sinAngle*A[1],x=this._sinAngle*A[0]+this._cosAngle*A[1],v=Math.min(v,t),u=Math.max(u,t),w=Math.min(w,x),y=Math.max(y,x)}b=b!==Number.MAX_VALUE? Math.max(b,v):v;a=a!==Number.MAX_VALUE?Math.max(a,w):w;f=f!==-Number.MAX_VALUE?Math.min(f,u):u;n=n!==-Number.MAX_VALUE?Math.min(n,y):y}this._xMin=Math.round(b/this._stepX);this._xMax=Math.round(f/this._stepX);this._yMin=Math.round(a/this._stepY);this._yMax=Math.round(n/this._stepY);this._currentX=this._xMax+1;this._currentY=this._yMin-1;this._buildAccelerationMap(d,k,p,c,r)}_buildAccelerationMap(d,b,a,f,n){d.reset();const c=new Map,r=this._verticalSubdivision;a=r?n-f:a-b;n=Math.ceil(a/10);if(!(1>= n)){a=Math.floor(a/n);n++;this._delta=a;var k,p;if(r){n=-512-2*this._stepY;var t=2*this._stepY;var w=f}else n=-2*this._stepX,t=512+2*this._stepX,w=b;for(;d.nextPath();)if(!(2>d.pathSize)&&d.nextPoint()){var u=d.x;for(k=d.y;d.nextPoint();u=b,k=f){b=d.x;f=d.y;if(r){if(k===f||kt&&f>t)continue;var y=Math.min(k,f);var x=Math.max(k,f)}else{if(u===b||ut&&b>t)continue;y=Math.min(u,b);x=Math.max(u,b)}for(;yp&&(x=b,v=f,A=c,z=A.get(y),z||(z=[],A.set(y,z)),z.push([[u,k],[x,v]]))}}this._accelerationMap=c}}_nextInside(){for(;;){if(this._currentX>this._xMax){this._currentY++;if(this._currentY>this._yMax)return null;this._currentX=this._xMin;this._shiftOddRows&&this._currentY%2&&this._currentX--}var d=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(d+=.5*this._stepX);const b=this._currentY*this._stepY+this._offsetY;this._currentX++; let a;if(this._gridType===h.PlacementGridType.Random){const f=(this._currentX%24+24)%24,n=(this._currentY%24+24)%24;a=this._graphicOriginX+d+this._stepX*this._randomness*(.5-l._randValues[24*n+f])*2/3;d=this._graphicOriginY+b+this._stepY*this._randomness*(.5-l._randValues[24*n+f+1])*2/3}else a=this._graphicOriginX+this._cosAngle*d+this._sinAngle*b,d=this._graphicOriginY-this._sinAngle*d+this._cosAngle*b;if(!this._testInsidePolygon||this._isInsidePolygon(a,d,this._geometryCursor))return this._internalPlacement.setTranslate(a, d),this._internalPlacement}}_isInsidePolygon(d,b,a){if(null==this._accelerationMap){var f=0,n;let k;d+=1E-6;b+=1E-6;for(a.reset();a.nextPath();)if(a.nextPoint()){var c=a.x;for(n=a.y;a.nextPoint();c=r,n=k){var r=a.x;k=a.y;n>b!==k>b&&(0<(r-c)*(b-n)-(k-n)*(d-c)?f++:f--)}}return 0!==f}d+=1E-6;b+=1E-6;a=this._verticalSubdivision;n=this._accelerationMap.get(Math.floor(((a?b:d)-this._polygonMin)/this._delta));if(!n)return!1;c=0;for(f of n){n=f[0];r=f[1];if(a){if(n[1]>b===r[1]>b)continue;n=(r[0]-n[0])*(b- n[1])-(r[1]-n[1])*(d-n[0])}else{if(n[0]>d===r[0]>d)continue;n=(r[1]-n[1])*(d-n[0])-(r[0]-n[0])*(b-n[1])}0b){d=(b-n)/t;const [w,u]=this._curveHelper.getAngleCS(c,r,k,p,d);d=this._curveHelper.getCoord2D(c,r,k,p,d);a=f?-this._offset:this._offset;this.internalPlacement.setTranslate(d[0]- a*u,d[1]+a*w);this._angleToLine&&(f?this.internalPlacement.setRotateCS(-w,-u):this.internalPlacement.setRotateCS(w,u));return this.internalPlacement}c=k;r=p;n+=t}}return null}}e.PlacementOnLine=m;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/placements/PlacementOnVertices":function(){define(["exports","../CIMCursor","../CurveHelper"],function(e,g,q){function h(d,b){const a=Math.PI;for(;Math.abs(b-d)>a+2E-15;)b=b-d>a?b-2*a:b+2*a;return(d+b)/2}class m{static local(){null=== m.instance&&(m.instance=new m);return m.instance}execute(d,b,a,f,n){return new l(d,b,a)}}m.instance=null;class l extends g.PathTransformationCursor{constructor(d,b,a){super(d);this._curveHelper=new q.CurveHelper;this._angleToLine=void 0!==b.angleToLine?b.angleToLine:!0;this._offset=void 0!==b.offset?b.offset*a:0;this._endPoints=void 0!==b.placeOnEndPoints?b.placeOnEndPoints:!0;this._controlPoints=void 0!==b.placeOnControlPoints?b.placeOnControlPoints:!0;this._regularVertices=void 0!==b.placeOnRegularVertices? b.placeOnRegularVertices:!0;this._tags=[];this._tagIterator=0}processPath(d){this.iteratePath||(this._preparePath(d),this.iteratePath=!0);if(this._tagIterator>=this._tags.length)return this._tagIterator=this._tags.length=0,this.iteratePath=!1,null;d=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(d[2]);let b=d[0],a=d[1];if(0!==this._offset){const f=Math.cos(d[2]);b-=this._offset*Math.sin(d[2]);a+=this._offset*f}this.internalPlacement.setTranslate(b,a);this._tagIterator++; return this.internalPlacement}_preparePath(d){this._tagIterator=this._tags.length=0;d.seekPathStart();const b=d.isClosed();let a=0,f=!1,n=0,c=0;d.seekPathStart();if(d.nextPoint()){let r=d.x,k=d.y,p=d.getControlPoint(),t=!0,w=d.nextPoint();for(;w;){const u=d.x,y=d.y,x=d.getControlPoint();if(this._angleToLine||0!==this._offset)n=this._curveHelper.getAngle(r,k,u,y,0);t?(t=!1,b?(a=n,f=p):(this._endPoints||this._controlPoints&&p)&&this._tags.push([r,k,n])):p?this._controlPoints&&this._tags.push([r,k,h(c, n)]):this._regularVertices&&this._tags.push([r,k,h(c,n)]);if(this._angleToLine||0!==this._offset)c=this._curveHelper.getAngle(r,k,u,y,1);(w=d.nextPoint())||(b?x||f?this._controlPoints&&this._tags.push([u,y,h(c,a)]):this._regularVertices&&this._tags.push([u,y,h(c,a)]):(this._endPoints||this._controlPoints&&x)&&this._tags.push([u,y,c]));r=u;k=y;p=x}}this._tagIterator=0}}e.PlacementOnVertices=m;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/placements/PlacementPolygonCenter":function(){define("exports ../../../geometry/support/boundsUtils ../../../geometry/support/centroid ../../../geometry/support/labelPoint ../CIMPlacements ../enums".split(" "), function(e,g,q,h,m,l){class d{static local(){null===d.instance&&(d.instance=new d);return d.instance}execute(a,f,n,c,r){return new b(a,f,n)}}d.instance=null;class b{constructor(a,f,n){this._geometryCursor=a;this._offsetX=void 0!==f.offsetX?f.offsetX*n:0;this._offsetY=void 0!==f.offsetY?f.offsetY*n:0;this._method=void 0!==f.method?f.method:l.PlacementPolygonCenterMethod.OnPolygon;this._internalPlacement=new m.Placement}next(){const a=this._geometryCursor;this._geometryCursor=null;return a?this._polygonCenter(a): null}_polygonCenter(a){let f=!1;switch(this._method){case l.PlacementPolygonCenterMethod.CenterOfMass:if(a=q.weightedAreaCentroid(a))this._internalPlacement.setTranslate(a[0]+this._offsetX,a[1]+this._offsetY),f=!0;break;case l.PlacementPolygonCenterMethod.BoundingBoxCenter:if(a=g.getCursorBoundsXY(a))this._internalPlacement.setTranslate((a[2]+a[0])/2+this._offsetX,(a[3]+a[1])/2+this._offsetY),f=!0;break;default:a=h.getLabelPoint(a),null!==a&&(this._internalPlacement.setTranslate(a[0]+this._offsetX, a[1]+this._offsetY),f=!0)}return f?this._internalPlacement:null}}e.PlacementPolygonCenter=d;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/labelPoint":function(){define("exports ../../core/PriorityQueue ./aaBoundingRect ./boundsUtils ./centroid ./coordsUtils ./intersectsBase".split(" "),function(e,g,q,h,m,l,d){function b(p,t){let w=0,u,y,x,v;for(t.reset();t.nextPath()&&t.nextPoint();)for(u=t.x,y=t.y;t.nextPoint();u=x,y=v)x=t.x,v=t.y,y>p[1]!==v>p[1]&&(0<(x-u)* (p[1]-y)-(v-y)*(p[0]-u)?w++:w--);return 0!==w}function a(p,t,w){if(w&&b(p,t))return{coord:p,distance:0};w=Infinity;let u=0,y=0;var x=[0,0];let v=[0,0];const A=[0,0];for(t.reset();t.nextPath()&&t.nextPoint();)if(!(2>t.pathSize))for(x[0]=t.x,x[1]=t.y;t.nextPoint();x=v)v=[t.x,t.y],l.projectPointOnLineSeg(A,p,x,v),x=c(p,A),xp.pathSize))for(D[0][0]=p.x,D[0][1]=p.y;p.nextPoint();D[0][0]=D[1][0],D[0][1]=D[1][1]){D[1][0]=p.x;D[1][1]=p.y;a:{var E=F;var C=D;if(2>C.length){E=null;break a}E||=q.create();const [H,K]=C[0],[J,O]=C[1];E[0]=Math.min(H,J);E[1]=Math.min(K,O);E[2]=Math.max(H,J);E[3]=Math.max(K,O)}if(null!==E){z[0]=t[0][0];z[1]=t[0][1];B[0]=t[1][0];B[1]=t[1][1];a:{E=F;C=z;var G=B;let H=n(C,E),K=n(G,E);const J=E[0],O=E[1],Q=E[2],T=E[3]; if(H&K){E=0;break a}if(!(H|K)){E=4;break a}const I=(H?1:0)|(K?2:0);do{const L=G[0]-C[0],R=G[1]-C[1];if(L>R)H&3?(H&1?(C[1]+=R*(J-C[0])/L,C[0]=J):(C[1]+=R*(Q-C[0])/L,C[0]=Q),H=n(C,E)):K&3?(K&1?(G[1]+=R*(J-G[0])/L,G[0]=J):(G[1]+=R*(Q-G[0])/L,G[0]=Q),K=n(G,E)):H?(H&4?(C[0]+=L*(O-C[1])/R,C[1]=O):(C[0]+=L*(T-C[1])/R,C[1]=T),H=n(C,E)):(K&4?(G[0]+=L*(O-G[1])/R,G[1]=O):(G[0]+=L*(T-G[1])/R,G[1]=T),K=n(G,E));else if(H&12?(H&4?(C[0]+=L*(O-C[1])/R,C[1]=O):(C[0]+=L*(T-C[1])/R,C[1]=T),H=n(C,E)):K&12?(K&4?(G[0]+= L*(O-G[1])/R,G[1]=O):(G[0]+=L*(T-G[1])/R,G[1]=T),K=n(G,E)):H?(H&1?(C[1]+=R*(J-C[0])/L,C[0]=J):(C[1]+=R*(Q-C[0])/L,C[0]=Q),H=n(C,E)):(K&1?(G[1]+=R*(J-G[0])/L,G[0]=J):(G[1]+=R*(Q-G[0])/L,G[0]=Q),K=n(G,E)),H&K){E=0;break a}}while(H|K);E=I}0!==E&&d.segmentIntersects(t[0],t[1],D[0],D[1],u)&&(E=u[1],y>x?Et[2]?1:0)<<1|(p[1]t[3]?1:0)<<3}function c(p,t){return(p[0]-t[0])* (p[0]-t[0])+(p[1]-t[1])*(p[1]-t[1])}function r(p,t){if(pt)return 1;if(p===t)return 0;p=isNaN(p);t=isNaN(t);return pt?1:0}class k{constructor(p,t,w,u){this.x=p;this.y=t;this.cellSize=w;this.distancefromCellCenter=l.distanceFromPointToPolygon(p,t,u);this.maxDistanceToPolygon=this.distancefromCellCenter+this.cellSize*Math.SQRT2}}e.getLabelPoint=function(p){if(0===p.totalSize)return null;var t=h.getCursorBoundsXY(p);if(!t)return null;var w=8.8818E-14*(Math.abs(t[0])+Math.abs(t[2])+ Math.abs(t[1])+Math.abs(t[3])+1),u=0,y=0;p.reset();for(var x=0;p.nextPath();x++){var v=p.getCurrentRingArea();v>y&&(y=v,u=x)}p.seekPath(u);if(0===p.pathSize)return null;p.seekPathStart();v=h.getCursorPathBounds(p);if(Math.abs(y)<=2*w*w)return[(v[0]+v[2])/2,(v[1]+v[3])/2];p.seekPathStart();var A=m.ringCentroidCursorXY(p,q.create());if(null===A)return null;if(4>p.totalPoints)return A;y=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]];u=[NaN,NaN,NaN,NaN];x=[NaN,NaN,NaN,NaN];var z=!1,B=a(A,p,!0);0===B.distance&& (z=!0,y[0][0]=A[0],y[0][1]=A[1],B=a(A,p,!1));u[0]=B.distance;x[0]=0;var D=[NaN,NaN];let F=!1,E=.25,C=-1;B=NaN;do{B=NaN;var G=v[0];y[1]=f(p,G+(v[2]-G)*E,w,t);isNaN(y[1][0])||isNaN(y[1][1])||(B=a(y[1],p,!1),B=B.distance);if(!isNaN(B)&&B>w&&b(y[1],p))F=!0,u[1]=B,x[1]=c(y[1],A);else if(!isNaN(B)&&B>C&&(C=B,D[0]=y[1][0],D[1]=y[1][1]),E-=.01,.1>E)if(0<=C)F=!0,u[1]=C,y[1][0]=D[0],y[1][1]=D[1],x[1]=c(y[1],A);else break}while(!F);F=!1;E=.5;C=-1;G=.01;let H=1;do{B=NaN;var K=v[0];y[2]=f(p,K+(v[2]-K)*E,w,t); isNaN(y[2][0])||isNaN(y[2][1])||(B=a(y[2],p,!1),B=B.distance);if(!isNaN(B)&&B>w&&b(y[2],p))F=!0,u[2]=B,x[2]=c(y[2],A);else if(!isNaN(B)&&B>C)C=B,D[0]=y[2][0],D[1]=y[2][1];else if(B>C&&(C=B,D[0]=y[2][0],D[1]=y[2][1]),E=.5+G*H,G+=.01,H*=-1,.3>E||.7w&&b(y[3],p))F=!0,u[3]=B,x[3]=c(y[3], A);else if(B>C&&(C=B,D[0]=y[3][0],D[1]=y[3][1]),E+=.01,.9v;v++)for(z=t;3>z;z++)A=x[z],D=x[z+1],0t;t++){switch(t){case 0:v=2*u[p[t]];break;case 1:v=1.66666666*u[p[t]];break;case 2:v=1.33333333*u[p[t]];break;case 3:v=u[p[t]]}v>w&&(w=v,x=p[t])}return y[x]};e.getPolylabelPoint=function(p){if(!p.nextPath()||!p.pathSize)return null; var t=h.getCursorPathBounds(p),w=t[2]-t[0],u=t[3]-t[1];if(0===w||0===u)return[t[0]+w/2,t[1]+u/2];const y=Math.max(Math.min(w,u)/100,1),x=new g((z,B)=>B.maxDistanceToPolygon-z.maxDistanceToPolygon);u=Math.min(w,u);w=u/2;let v=0,A=0;for(v=t[0];vt.distancefromCellCenter&&(t=u),u.maxDistanceToPolygon- t.distancefromCellCenter<=y||(w=u.cellSize/2,x.enqueue(new k(u.x-w,u.y-w,w,p)),x.enqueue(new k(u.x+w,u.y-w,w,p)),x.enqueue(new k(u.x-w,u.y+w,w,p)),x.enqueue(new k(u.x+w,u.y+w,w,p)));return[t.x,t.y]};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/core/PriorityQueue":function(){define(function(){class e{constructor(q=g){this._data=[];this._compare=q}get size(){return this._data.length}enqueue(q){if(null!=q){var {_data:h,_compare:m}=this;h.push(q);q=h.length-1>>>0;for(var l=h[q];0< q;){const d=q-1>>1,b=h[d];if(0>=m(b,l))h[d]=l,h[q]=b,q=d;else break}}}dequeue(){const {_data:q,_compare:h}=this,m=q[0];var l=q.pop();if(0===q.length)return m;q[0]=l;l=0;const d=q.length,b=q[0];let a;let f=null;for(;;){var n=2*l+1;const c=2*l+2;f=null;n=h(n,b)||null!==f&&0>=h(n,a))&&(f=c);if(null===f)break;q[l]=q[f];q[f]=b;l=f}return m}}const g=(q,h)=>qh?1:0;return e})},"esri/symbols/cim/imageUtils":function(){define(["exports"],function(e){e.getFirstFrame= function(g){const q=g.getFrame(0);if(q instanceof HTMLImageElement||q instanceof HTMLCanvasElement)return q;const h=document.createElement("canvas");h.width=g.width;h.height=g.height;g=h.getContext("2d");q instanceof ImageData?g.putImageData(q,0,0):g.drawImage(q,0,0);return h};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/Rect":function(){define(function(){class e{constructor(g=0,q=0,h=0,m=0){this.x=g;this.y=q;this.width=h;this.height=m}static fromExtent(g){return new e(g.xmin, -g.ymax,g.xmax-g.xmin,g.ymax-g.ymin)}get isEmpty(){return 0>=this.width||0>=this.height}union(g){this.x=Math.min(this.x,g.x);this.y=Math.min(this.y,g.y);this.width=Math.max(this.width,g.width);this.height=Math.max(this.height,g.height)}}return e})},"esri/symbols/cim/TextRasterizer":function(){define(["../../core/screenUtils","../support/textUtils"],function(e,g){function q(l){return`rgba(${l.slice(0,3).toString()},${l[3]})`}function h(l,d){var b=d.font;b=`${b.style} ${b.weight} ${e.pt2px(Math.max(d.size, .5)*d.pixelRatio).toFixed(1)}px ${b.family}, sans-serif`;l.font=b;l.textBaseline="top";switch(d.horizontalAlignment){case "left":d="left";break;case "right":d="right";break;case "center":d="center";break;default:d="left"}l.textAlign=d}class m{constructor(l){l&&(this._textRasterizationCanvas=l)}rasterizeText(l,d){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const b=this._textRasterizationCanvas;var a=b.getContext("2d",{willReadFrequently:!0});h(a, d);this._parameters=d;this._textLines=l.split(/\r?\n/);this._lineHeight=this._computeLineHeight();const {decoration:f,weight:n}=d.font;this._lineThroughWidthOffset=f&&"line-through"===f?.1*this._lineHeight:0;var c=(l=null!=d.backgroundColor||null!=d.borderLine)?g.backgroundPadding:0,r=this._computeTextWidth(a,d)+2*c,k=this._lineHeight*this._textLines.length+2*c;b.width=r+2*this._lineThroughWidthOffset;b.height=k;if(0===b.width||0===b.height)return b.width=b.height=1,{size:[0,0],image:new Uint32Array(0), sdf:!1,simplePattern:!1,anchorX:0,anchorY:0,canvas:b};this._renderedLineHeight=Math.round(this._lineHeight*d.pixelRatio);this._renderedHaloSize=e.pt2px(d.halo.size)*d.pixelRatio;this._renderedWidth=r*d.pixelRatio;this._renderedHeight=k*d.pixelRatio;this._lineThroughWidthOffset*=d.pixelRatio;r=d.halo&&d.halo.color?d.halo.color:[0,0,0,0];this._fillStyle=q(d.color??[0,0,0,0]);this._haloStyle=`rgb(${r.slice(0,3).toString()})`;r=this._renderedLineHeight;var p=this._renderedHaloSize;a.save();a.clearRect(0, 0,b.width,b.height);h(a,d);k=c*d.pixelRatio;c=a.textAlign;var t=this._renderedWidth-2*k;c=("center"===c?.5*t:"right"===c?t:0)+p+k;k=p+k;p=0p;p++){const t=(.6+.1*p)*k; l.lineWidth=t;l.strokeText(r,d,b);a&&"none"!==a&&this._renderDecoration(l,d,b,a,f,t)}b+=n}}computeTextSize(l,d){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const b=this._textRasterizationCanvas;var a=b.getContext("2d");h(a,d);this._parameters=d;this._textLines=l.split(/\r?\n/);this._lineHeight=this._computeLineHeight();l=this._computeTextWidth(a,d);a=this._lineHeight*this._textLines.length;b.width=l;b.height=a;return[l*d.pixelRatio,a*d.pixelRatio]}_computeTextWidth(l, d){let b=0;for(const a of this._textLines)b=Math.max(b,l.measureText(a).width);d=d.font;if("italic"===d.style||"oblique"===d.style||"string"===typeof d.weight&&("bold"===d.weight||"bolder"===d.weight)||"number"===typeof d.weight&&600h.transformMat2d(t,t,p));return{topLeft:k[0],topRight:k[1],bottomLeft:k[2],bottomRight:k[3]}}const f=Math.PI/180;class n{constructor(k,p,t,w){this._rotationT=q.create();this.minZoom=this._yBounds=this._xBounds=0;this.maxZoom=255;this._bounds=null;const u=t.rect,y=new Float32Array(8);k*=w;p*=w;const x=t.code?u.width*w:t.metrics.width,v=t.code?u.height*w:t.metrics.height;this.width=x;this.height=v;y[0]=k;y[1]=p;y[2]=k+x;y[3]=p;y[4]=k;y[5]=p+v;y[6]= k+x;y[7]=p+v;this._data=y;this._setTextureCoords(u);this._scale=w;this._mosaic=t;this.x=k;this.y=p;this.maxOffset=Math.max(k+x,p+v)}get mosaic(){return this._mosaic}set angle(k){this._angle=k;g.fromRotation(this._rotationT,-k);this._setOffsets()}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(){this._offsets|| this._setOffsets();return this._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const {height:u,width:y}=this._mosaic.metrics;var k=y*this._scale,p=Math.abs(u)*this._scale,t=new Float32Array(8);t[0]=this.x;t[1]=this.y;t[2]=this.x+k;t[3]=this.y;t[4]=this.x;t[5]=this.y+p;t[6]=this.x+k;t[7]=this.y+p;k=g.multiply(q.create(),this._rotationT,this._transform);q.transformMany(t,t,k);p=k=Infinity;let x=0;var w=0;for(let v= 0;4>v;v++){const A=t[2*v],z=t[2*v+1];k=Math.min(k,A);p=Math.min(p,z);x=Math.max(x,A);w=Math.max(w,z)}t=x-k;w-=p;this._bounds=new b(k+t/2,p+w/2,t,w)}return this._bounds}setTransform(k){this._transform=k;this._offsets=null}_setOffsets(){this._offsets||(this._offsets={topLeft:[0,0],topRight:[0,0],bottomLeft:[0,0],bottomRight:[0,0]});const k=g.multiply(q.create(),this._rotationT,this._transform);this._offsets.topLeft[0]=this._data[0];this._offsets.topLeft[1]=this._data[1];this._offsets.topRight[0]=this._data[2]; this._offsets.topRight[1]=this._data[3];this._offsets.bottomLeft[0]=this._data[4];this._offsets.bottomLeft[1]=this._data[5];this._offsets.bottomRight[0]=this._data[6];this._offsets.bottomRight[1]=this._data[7];h.transformMat2d(this._offsets.topLeft,this._offsets.topLeft,k);h.transformMat2d(this._offsets.topRight,this._offsets.topRight,k);h.transformMat2d(this._offsets.bottomLeft,this._offsets.bottomLeft,k);h.transformMat2d(this._offsets.bottomRight,this._offsets.bottomRight,k)}_setTextureCoords({x:k, y:p,width:t,height:w}){this._texcoords={topLeft:[k,p],topRight:[k+t,p],bottomLeft:[k,p+w],bottomRight:[k+t,p+w]}}}class c{constructor(k,p,t){this._rotation=0;this._decorate(k,p,t);this.glyphs=k;this.bounds=this._createBounds(k);this.isMultiline=1x&&(C!==E?(J=C-2*z,D-=G,k.push(new r(u,E,J,D-F,H,K)),H=Infinity,K=0,E=C,D=F):(k.push(new r(u,E,B-z,D,H,K)),H=Infinity,K=0,C=E=B,D=0)),D+=Q.advance,F+=Q.advance);B+=z}x=new r(u,E,B-z,D,H,K);0<=x.start&&x.end=this.width||0>=this.height}union(g){this.x=Math.min(this.x,g.x);this.y=Math.min(this.y,g.y);this.width=Math.max(this.width,g.width);this.height=Math.max(this.height,g.height)}}return e})},"esri/views/2d/engine/webgl/collisions/BoundingBox":function(){define(["../../../../../core/libs/gl-matrix-2/factories/vec2f32"], function(e){class g{constructor(q,h,m,l){this.computedY=this.computedX=0;this.center=e.fromValues(q,h);this.centerT=e.create();this.halfWidth=m/2;this.halfHeight=l/2;this.width=m;this.height=l}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(q){this.center[0]=q}set y(q){this.center[1]=q}clone(){return new g(this.x,this.y,this.width,this.height)}serialize(q){q.writeF32(this.center[0]);q.writeF32(this.center[1]);q.push(this.width);q.push(this.height);return q}findCollisionDelta(q,h=4){return Math.log2(Math.min((q.halfWidth+this.halfWidth+h)/Math.abs(q.centerT[0]-this.centerT[0]),(q.halfHeight+this.halfHeight+h)/Math.abs(q.centerT[1]-this.centerT[1])))}extend(q){const h= Math.min(this.xmin,q.xmin),m=Math.min(this.ymin,q.ymin),l=Math.max(this.xmax,q.xmax)-h;q=Math.max(this.ymax,q.ymax)-m;this.width=l;this.height=q;this.halfWidth=l/2;this.halfHeight=q/2;this.x=h+l/2;this.y=m+q/2}static deserialize(q){const h=q.readF32(),m=q.readF32(),l=q.readInt32();q=q.readInt32();return new g(h,m,l,q)}}return g})},"esri/views/2d/layers/graphics/graphicsUtils":function(){define("exports ../../../../core/screenUtils ../../../../geometry/Polygon ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/spatialReferenceUtils ../../engine/webgl/definitions".split(" "), function(e,g,q,h,m,l){e.getLineWidth=function(d){const b=g.px2pt(l.minTextLineWidth),a=g.px2pt(l.maxTextLineWidth);return Math.max(b,Math.min(d||a,a))};e.intersectingInternationalDateline=function(d,b){b=m.getInfo(b);if(!b)return null;const [a,f]=b.valid;return d[2]>f?[h.create([d[0],d[1],f,d[3]]),h.create([a,d[1],a+d[2]-f,d[3]])]:d[0]=n&&f<=c||f>=c&&f<=n};e.c2pi=2*l;e.cDegTo256=b;e.cDegToRad=l/180;e.cInfinity=m;e.cPi=l;e.cRadTo256=d;e.degToByte=function(f){return h(f*b,256)};e.distanceFromToPolylineWithinThreshold=function(f,n,c,r){let k,p,t;r*=r;for(const w of c){const u=w.length; if(!(2>u)){c=w[0].x;k=w[0].y;for(let y=1;yn!==p.y>n&&(0<(p.x-k.x)*(n-k.y)-(p.y-k.y)*(f-k.x)?r++:r--)}return 0!==r};e.positiveMod=h;e.radToByte=function(f){return h(f*d,256)};e.sqr=function(f){return f*f};e.translateAnchor=function(f,n,c,r){f=new q.Point(f[0],f[1]);f.scale(r);"viewport"===n&&(n=Math.PI/180*-c,f.rotate(Math.cos(n),Math.sin(n)));return f};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/SDFHelper":function(){define(["exports","../../core/floatRGBA","../../geometry/support/jsonUtils", "./Rect","../../views/2d/engine/webgl/definitions"],function(e,g,q,h,m){function l(b){switch(b.type){case "CIMPointSymbol":b=b.symbolLayers;if(!b||1!==b.length)return null;b=b[0];return"CIMVectorMarker"!==b.type?null:l(b);case "CIMVectorMarker":b=b.markerGraphics;if(!b||1!==b.length)return null;var a=b[0];if(!a)return null;b=a.geometry;if(!b)return null;a=a.symbol;return!a||"CIMPolygonSymbol"!==a.type&&"CIMLineSymbol"!==a.type||a.symbolLayers?.some(f=>!!f.effects)?null:{type:"sdf",geom:b,asFill:"CIMPolygonSymbol"=== a.type}}}function d(b){let a=Infinity,f=-Infinity,n=Infinity,c=-Infinity;for(const r of b)for(const k of r)k[0]f&&(f=k[0]),k[1]c&&(c=k[1]);return[a,n,f,c]}e.buildSDF=function(b){var a=b.geom;var f=a?a.rings?a.rings:a.paths?a.paths:void 0!==a.xmin&&void 0!==a.ymin&&void 0!==a.xmax&&void 0!==a.ymax?[[[a.xmin,a.ymin],[a.xmin,a.ymax],[a.xmax,a.ymax],[a.xmax,a.ymin],[a.xmin,a.ymin]]]:null:null;a=Infinity;var n=-Infinity;var c=Infinity;var r=-Infinity;for(var k of f)for(var p of k)p[0]< a&&(a=p[0]),p[0]>n&&(n=p[0]),p[1]r&&(r=p[1]);c=new h(a,c,n-a,r-c);k=m.defaultSdfTextureSize;p=m.spritePadding;a=Math.floor(.5*(.5*k-p));r=(k-2*(a+p))/Math.max(c.width,c.height);k=Math.round(c.width*r)+2*a;p=Math.round(c.height*r)+2*a;n=[];for(var t of f)if(t&&1B&&(B=0);v>k&&(v=k);0>A&&(A=0);z>p&&(z=p);x=u[0]-r[0];const G=u[1]-r[1],H=x*x+G*G;for(;BE?(J=r[0],E=r[1]):E>H?(J= u[0],E=u[1]):(E/=H,J=r[0]+E*x,E=r[1]+E*G);D=(D-J)*(D-J)+(F-E)*(F-E);F=(p-K-1)*k+B;Dk-a&&(c=k-a),up-a&&(r=p-a);uu!==w[1]>u){A=u+.5;v=(p-u-1)*k;for(z=f;zf;f++)a+=d[b+f]*m[f];return a}const h=[1,256,65536,16777216],m=[1/256,1/65536,1/16777216,1/4294967296],l=q(new Uint8ClampedArray([255,255,255,255]));e.packFloatRGBA=function(d,b,a=0){d=g.clamp(d,0,l);for(let c=0;4>c;c++){var f=Math,n=d*h[c];b[a+c]=f.floor.call(f,256*(n-Math.floor(n)))}};e.unpackFloatRGBA=q;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/effects/CIMEffectHelper":function(){define("exports ../../../geometry/GeometryCursor ../../../geometry/geometryCursorCollectUtils ../CIMEffects ../CIMOperators ../CIMSymbolHelper".split(" "), function(e,g,q,h,m,l){const d=96/72;class b{static executeEffects(a,f,n,c){const r=l.getEffectsInflateSize(a);f=new h.SimpleEffectCursor(f);for(const k of a)(a=m.getEffectOperator(k))&&(f=a.execute(f,k,d,n,c,r));return f}static applyEffects(a,f,n){if(!a)return f;var c=l.getEffectsInflateSize(a);f=new h.SimpleEffectCursor(g.GeometryCursor.fromJSONCIM(f));for(var r of a)(a=m.getEffectOperator(r))&&(f=a.execute(f,r,1,null,n,c));c=[];for(r=null;n=f.next();)c.push(...q.collectMultipath(n)),r=n.geometryType; return 0===c.length||null===r?null:"esriGeometryPolygon"===r?{rings:c}:{paths:c}}}e.CIMEffectHelper=b;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/Container":function(){define(["exports","../../../core/libs/gl-matrix-2/factories/mat3f32","../../../layers/effects/EffectView","./DisplayObject","../layers/support/util"],function(e,g,q,h,m){class l extends h.DisplayObject{constructor(){super(...arguments);this._childrenSet=new Set;this._needsSort=!1;this._children= [];this._highlightGradient=this._highlightOptions=this._effectView=null}get blendMode(){return this._blendMode}set blendMode(d){this._blendMode=d;this.requestRender()}get children(){return this._children}get clips(){return this._clips}set clips(d){this._clips=d;this.children.forEach(b=>b.clips=d)}get computedEffects(){return this._effectView?.effects??null}get effect(){return this._effectView?.effect??""}set effect(d){if(this._effectView||d)this._effectView||(this._effectView=new q.EffectView),this._effectView.effect= d,this.requestRender()}get highlightOptions(){return this._highlightOptions}set highlightOptions(d){d?this._highlightOptions?.equals(d)||(this._highlightOptions=d,this._highlightGradient=m.createOrReuseHighlightGradient(this._highlightGradient,d),this.requestRender()):(this._highlightOptions=null,this._highlightGradient&&(this._highlightGradient.destroy(),this._highlightGradient=null,this.requestRender()))}get hasBlending(){return!!this.blendMode}get hasHighlight(){return this.children.some(d=>d.hasHighlight)}get hasLabels(){return this.children.some(d=> d.hasLabels)}get requiresDedicatedFBO(){return this.children.some(d=>"blendMode"in d&&d.blendMode&&"normal"!==d.blendMode)}updateTransitionProperties(d,b){super.updateTransitionProperties(d,b);this._effectView&&(this._effectView.transitionStep(d,b),this._effectView.transitioning&&this.requestRender())}doRender(d){d=this.createRenderParams(d);const {painter:b}=d;b.beforeRenderLayer(d,this._clips?.length?255:0,this.computedOpacity);this.renderChildren(d);b.afterRenderLayer(d,this.computedOpacity)}addChild(d){return this.addChildAt(d, this.children.length)}addChildAt(d,b=this.children.length){if(!d||this.contains(d))return d;this._needsSort=!0;const a=d.parent;a&&a!==this&&a.removeChild(d);b>=this.children.length?this.children.push(d):this.children.splice(b,0,d);this._childrenSet.add(d);d.parent=this;d.stage=this.stage;this!==this.stage&&(d.clips=this.clips);this.requestRender();return d}contains(d){return this._childrenSet.has(d)}endTransitions(){super.endTransitions();this._effectView&&(this._effectView.endTransitions(),this.requestRender())}removeAllChildren(){this._childrenSet.clear(); this._needsSort=!0;for(const d of this.children)this!==this.stage&&(d.clips=null),d.stage=null,d.parent=null;this.children.length=0}removeChild(d){return this.contains(d)?this.removeChildAt(this.children.indexOf(d)):d}removeChildAt(d){if(0>d||d>=this.children.length)return null;this._needsSort=!0;d=this.children.splice(d,1)[0];this._childrenSet.delete(d);this!==this.stage&&(d.clips=null);d.stage=null;d.parent=null;return d}sortChildren(d){this._needsSort&&(this.children.sort(d),this._needsSort=!1)}beforeRender(d){super.beforeRender(d); for(const b of this.children)b.beforeRender(d)}afterRender(d){super.afterRender(d);for(const b of this.children)b.afterRender(d)}_createTransforms(){return{displayViewScreenMat3:g.create()}}onAttach(){super.onAttach();const d=this.stage;for(const b of this.children)b.stage=d}onDetach(){super.onDetach();for(const d of this.children)d.stage=null}renderChildren(d){for(const b of this.children)b.processRender(d)}createRenderParams(d){return{...d,requireFBO:this.requiresDedicatedFBO,blendMode:this.blendMode, effects:this.computedEffects,globalOpacity:d.globalOpacity*this.computedOpacity,inFadeTransition:this.inFadeTransition,highlightGradient:this._highlightGradient||d.highlightGradient}}}e.Container=l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/layers/effects/EffectView":function(){define("exports ../../chunks/tslib.es6 ../../core/Accessor ../../core/has ../../core/lang ../../core/Logger ../../core/accessorSupport/decorators/property ../../core/accessorSupport/decorators/subclass ./parser ./utils".split(" "), function(e,g,q,h,m,l,d,b,a,f){function n(k){k=a.parse(k)||[];var p=(p=k[0])?"type"in p:!1;return p?[{scale:-1,effects:k}]:k}function c(k,p,t){return k[0]?.effects&&p[0]?.effects?(-1===k[0]?.scale||-1===p[0]?.scale)&&(1=t?!1:f.canInterpolateEffects(k[0].effects,p[0].effects):!0}function r(k,p,t){const w=k.length>p.length?k:p;k=k.length>p.length?p:k;var u=k[k.length-1];p=u?.scale??t;u=u?.effects??[];for(let y=k.length;y=p[0].scale)var y=w=p[0].effects;else if(k<=p[t].scale)y=w=p[t].effects;else for(let x=0;x=k&&A.scale<=k){u=(k-v.scale)/(A.scale-v.scale);w=v.effects;y=A.effects; break}}for(k=0;kd?Math.max(d,a-l):Math.min(d,a+l),this.computedVisible=0w?0e.getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient"),f=[0,0,0,0];class n{constructor(){this.type="single";this._convertedHighlightOptions={fillColor:[.2* .75,.6*.75,.675,.75],outlineColor:[.2*.9,.54,.81,.9],outlinePosition:h.highlightSizing.outlinePosition,outlineWidth:h.highlightSizing.outlineWidth,innerHaloWidth:h.highlightSizing.innerHaloWidth,outerHaloWidth:h.highlightSizing.outerHaloWidth};this._shadeTexChanged=!0;this._texelData=new Uint8Array(4*h.shadeTextureSize);this._minMaxDistance=[0,0]}setHighlightOptions(c){function r(v,A,z){x[0]=(1-z)*v[0]+z*A[0];x[1]=(1-z)*v[1]+z*A[1];x[2]=(1-z)*v[2]+z*A[2];x[3]=(1-z)*v[3]+z*A[3]}const k=this._convertedHighlightOptions; b(c,k);c=k.outlinePosition-k.outlineWidth/2-k.outerHaloWidth;const p=k.outlinePosition-k.outlineWidth/2,t=k.outlinePosition+k.outlineWidth/2,w=k.outlinePosition+k.outlineWidth/2+k.innerHaloWidth;var u=Math.sqrt(Math.PI/2)*h.sigma,y=Math.abs(c)>u?Math.round(10*(Math.abs(c)-u))/10:0;u=Math.abs(w)>u?Math.round(10*(Math.abs(w)-u))/10:0;y&&!u?a().error("The outer rim of the highlight is "+y+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards)."): !y&&u?a().error("The inner rim of the highlight is "+u+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."):y&&u&&a().error("The highlight is "+Math.max(y,u)+"px away from the edge of the feature; consider reducing some width values.");const x=[void 0,void 0,void 0,void 0];({_texelData:u}=this);for(let v=0;vc.stencilRef,compare:m.CompareFunction.EQUAL,mask:255,op:{fail:m.StencilOperation.KEEP,zFail:m.StencilOperation.KEEP,zPass:m.StencilOperation.REPLACE}}}},f={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:!1},n={...a,color:{write:[!0,!0,!0,!0],blendMode:"delete"}};e.getFeaturePipelineState=function(c){return b(c)?f:d(c)&&"clear"===c.passOptions.stepType?n:a};e.getFeatureUniforms=function(c,r){const {attributeView:k,context:p}=c;var t=k.getUniforms(p); r=l(c,r);if(b(c)){var {position:w,distance:u,smallSymbolDistance:y,smallSymbolSizeThreshold:x}=c.passOptions;var v={position:w,distance:u,smallSymbolDistance:y,smallSymbolSizeThreshold:x}}else v=null;if(d(c)){var {activeReasons:A,highlightAll:z}=c.passOptions;c={activeReasons:A,highlightAll:z?1:0}}else c=null;return{storage:t,view:r,hittestRequest:v,highlight:c}};e.getLocalTileOffset=function(c){const {row:r,col:k}=c.key;c=k*q.tileSize;const p=r*q.tileSize;return{tileOffsetFromLocalOrigin:[c%q.maxRepresentableInt, p%q.maxRepresentableInt],maxIntsToLocalOrigin:[Math.floor(c/q.maxRepresentableInt),Math.floor(p/q.maxRepresentableInt)]}};e.getSelectionDefines=function(c){return{inside:c.selection===h.FeatureSelection.InsideEffect,outside:c.selection===h.FeatureSelection.OutsideEffect}};e.getViewUniforms=l;e.isHighlight=d;e.isHittest=b;e.resolveDynamicUniforms=function(c,r,k){const p={};for(const t in k)p[t]=k[t]instanceof Function?k[t](c,r):k[t];return p};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})}, "esri/views/2d/engine/webgl/enums":function(){define(["exports"],function(e){e.WGLGeometryType=void 0;(function(g){g[g.FILL=0]="FILL";g[g.LINE=1]="LINE";g[g.MARKER=2]="MARKER";g[g.TEXT=3]="TEXT";g[g.LABEL=4]="LABEL"})(e.WGLGeometryType||(e.WGLGeometryType={}));e.WGLDrawPhase=void 0;(function(g){g[g.NONE=0]="NONE";g[g.MAP=1]="MAP";g[g.LABEL=2]="LABEL";g[g.LABEL_ALPHA=4]="LABEL_ALPHA";g[g.HITTEST=8]="HITTEST";g[g.HIGHLIGHT=16]="HIGHLIGHT";g[g.CLIP=32]="CLIP";g[g.DEBUG=64]="DEBUG";g[g.NUM_DRAW_PHASES= 9]="NUM_DRAW_PHASES"})(e.WGLDrawPhase||(e.WGLDrawPhase={}));e.VVBinding=void 0;(function(g){g[g.SIZE=0]="SIZE";g[g.COLOR=1]="COLOR";g[g.OPACITY=2]="OPACITY";g[g.ROTATION=3]="ROTATION"})(e.VVBinding||(e.VVBinding={}));e.WGLVVTarget=void 0;(function(g){g[g.MINMAX_TARGETS_OUTLINE=128]="MINMAX_TARGETS_OUTLINE";g[g.SCALE_TARGETS_OUTLINE=256]="SCALE_TARGETS_OUTLINE";g[g.FIELD_TARGETS_OUTLINE=512]="FIELD_TARGETS_OUTLINE";g[g.UNIT_TARGETS_OUTLINE=1024]="UNIT_TARGETS_OUTLINE"})(e.WGLVVTarget||(e.WGLVVTarget= {}));e.MosaicType=void 0;(function(g){g[g.SPRITE=0]="SPRITE";g[g.GLYPH=1]="GLYPH"})(e.MosaicType||(e.MosaicType={}));e.WGLSymbologyType=void 0;(function(g){g[g.DEFAULT=0]="DEFAULT";g[g.SIMPLE=1]="SIMPLE";g[g.DOT_DENSITY=2]="DOT_DENSITY";g[g.OUTLINE_FILL=3]="OUTLINE_FILL";g[g.OUTLINE_FILL_SIMPLE=4]="OUTLINE_FILL_SIMPLE";g[g.HEATMAP=5]="HEATMAP";g[g.PIE_CHART=6]="PIE_CHART"})(e.WGLSymbologyType||(e.WGLSymbologyType={}));e.FeatureSelection=void 0;(function(g){g[g.All=0]="All";g[g.Highlight=1]="Highlight"; g[g.InsideEffect=2]="InsideEffect";g[g.OutsideEffect=3]="OutsideEffect"})(e.FeatureSelection||(e.FeatureSelection={}));e.FeatureBatchingStrategy=void 0;(function(g){g[g.BATCHING=0]="BATCHING";g[g.STRICT_ORDER=1]="STRICT_ORDER";g[g.STRICT_MARKERS_AND_TEXT=2]="STRICT_MARKERS_AND_TEXT"})(e.FeatureBatchingStrategy||(e.FeatureBatchingStrategy={}));e.FeatureSymbologyDrawOrder=void 0;(function(g){g[g.FILL=0]="FILL";g[g.LINE=1]="LINE";g[g.MARKER=2]="MARKER";g[g.TEXT=3]="TEXT"})(e.FeatureSymbologyDrawOrder|| (e.FeatureSymbologyDrawOrder={}));Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/ManagedCanvas":function(){define("exports ../../../core/Evented ../../../core/events ../../../core/handleUtils ../../../core/has ../../../core/mathUtils ../../../core/libs/gl-matrix-2/math/mat2d ../../../core/libs/gl-matrix-2/factories/mat2df64 ../../webgl/contextUtils".split(" "),function(e,g,q,h,m,l,d,b,a){class f{constructor(n){this.events=new g;this._hasMajorPerformanceCaveat= !1;this._lastRenderFrameCounter=0;this._canvas=document.createElement("canvas");this._canvas.setAttribute("style","width: 100%; height:100%; display:block; willChange:transform");const c={failIfMajorPerformanceCaveat:!0,alpha:!0,antialias:!1,depth:!0,stencil:!0};n.appendChild(this._canvas);n=a.createContext(this._canvas,c);n||(n=a.createContext(this._canvas,{...c,failIfMajorPerformanceCaveat:!1}),this._hasMajorPerformanceCaveat=!0);this._gl=n;this._handles=h.handlesGroup([q.on(this._canvas,"webglcontextlost", r=>this.events.emit("webgl-context-lost",r))])}destroy(){this._canvas.parentNode?.removeChild(this._canvas);this._canvas=null;this._handles.remove();this._gl=null}get gl(){return this._gl}render(n,c){if(this._hasMajorPerformanceCaveat||m("esri-force-performance-mode")){if(++this._lastRenderFrameCounter>=m("esri-performance-mode-frames-between-render")&&(c(),this._lastRenderViewState=n.state.clone(),this._lastRenderFrameCounter=0),this._lastRenderViewState){const [r,k,p,t,w,u]=this._computeViewTransform(this._lastRenderViewState, n.state);this._canvas.style.transform=`matrix(${r}, ${k}, ${p}, ${t}, ${w}, ${u})`}}else c()}resize(n){const c=this._canvas,r=c.style,{state:{size:k},pixelRatio:p}=n;n=k[0];const t=k[1],w=Math.round(n*p),u=Math.round(t*p);if(c.width!==w||c.height!==u)c.width=w,c.height=u;r.width=n+"px";r.height=t+"px"}_computeViewTransform(n,c){const [r,k]=n.center,[p,t]=c.center,[w,u]=n.toScreen([0,0],p,t),[y,x]=n.toScreen([0,0],r,k),v=y-w,A=x-u,z=n.scale/c.scale;n=c.rotation-n.rotation;c=b.create();d.identity(c); d.scale(c,c,[z,z]);d.rotate(c,c,l.deg2rad(n));d.translate(c,c,[v,A]);return c}}e.ManagedCanvas=f;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/Painter":function(){define("../../../../core/has ../../../../core/maybe ../brushes ../vectorTiles/shaders/VTLMaterialManager ./BitBlitRenderer ./enums ./MaterialManager ./TextureManager ./TextureUploadManager ./VertexStream ./WorldExtentClipRenderer ./effects/AnimationEffect ./effects/BlendEffect ./effects/FeatureEffect ./effects/HighlightEffect ./effects/HittestEffect ./effects/post-processing/EffectManager ./painter/RenderPass ./shaderGraph/techniques/TechniqueProgramCache ../../../webgl/enums ../../../webgl/FramebufferObject ../../../webgl/Renderbuffer ../../../webgl/RenderbufferDescriptor ../../../webgl/TextureDescriptor".split(" "), function(e,g,q,h,m,l,d,b,a,f,n,c,r,k,p,t,w,u,y,x,v,A,z,B){function D(E,C,G,H){return E!==l.WGLDrawPhase.LABEL_ALPHA&&E!==l.WGLDrawPhase.LABEL&&E!==l.WGLDrawPhase.HIGHLIGHT&&(1!==H||null!=C&&"normal"!==C||null!=G&&0E.dispose()),this._brushCache.clear(),this._brushCache=null); if(this._fbos){let E;for(E in this._fbos)this._fbos[E]&&this._fbos[E].dispose()}for(const E of this._fboPool)E.dispose();this._fboPool.length=0;if(this.effects){let E;for(E in this.effects)this.effects[E]&&this.effects[E].dispose()}this._effectsManager.dispose();this._blendEffect.dispose(this.context);this._vtlMaterialManager=g.disposeMaybe(this._vtlMaterialManager)}clearShaderCache(){this._programCache.destroy();this._programCache=new y.TechniqueProgramCache}get blitRenderer(){return this._blitRenderer}get vectorTilesMaterialManager(){return this._vtlMaterialManager}getFbos(){if(!this._fbos)throw Error("InternalError: Painter FBOs not initialized"); return this._fbos}acquireFbo(E,C){if(0{this._brushCache.has(G)||this._brushCache.set(G,new G);return this._brushCache.get(G)});return new u(C,E)}blitTexture(E,C,G,H=1){E.setBlendingEnabled(!0);E.setBlendFunctionSeparate(x.BlendFactor.ONE,x.BlendFactor.ONE_MINUS_SRC_ALPHA,x.BlendFactor.ONE,x.BlendFactor.ONE_MINUS_SRC_ALPHA);E.setColorMask(!0, !0,!0,!0);this._blitRenderer.render(E,C,G,H);this._currentPipelineStateNeedsUpdate=!0}getPostProcessingEffects(E){return this._effectsManager.getPostProcessingEffects(E)}updateFBOs(E,C){if(E!==this._lastWidth||C!==this._lastHeight)if(this._lastWidth=E,this._lastHeight=C,this._fbos)for(var G in this._fbos)this._fbos[G].resize(E,C);else G=new B.TextureDescriptor(E,C),G.samplingMode=x.TextureSamplingMode.NEAREST,G.wrapMode=x.TextureWrapMode.CLAMP_TO_EDGE,E=new z.RenderbufferDescriptor(x.RenderbufferFormat.DEPTH_STENCIL, E,C),this._stencilBuf=new A.Renderbuffer(this.context,E),this._fbos={output:new v.FramebufferObject(this.context,G,this._stencilBuf),effect0:new v.FramebufferObject(this.context,G,this._stencilBuf)}}_applyEffects(E,C,G){const {context:H}=E;C=this._effectsManager.getPostProcessingEffects(C);for(const {postProcessingEffect:K,effect:J}of C)H.bindFramebuffer(G),K.draw(E,G,J);this._currentPipelineStateNeedsUpdate=!0}setShader(E){this._shaderState.shader=E.shader;this._shaderState.uniforms=E.uniforms;this._shaderState.defines= E.defines;this._shaderState.optionalAttributes=E.optionalAttributes;this._shaderState.useComputeBuffer=E.useComputeBuffer??!1}setPipelineState(E){E!==this._currentPipelineState&&(this._currentPipelineState=E,this._currentPipelineStateNeedsUpdate=!0)}submitDraw(E,C){const {shader:G,uniforms:H,defines:K,optionalAttributes:J}=this._shaderState,O=E.context;var Q=C.getAttributePrecisionPackFactors();Q=this._programCache.getProgram(G,Q,H,K??{},J??{});Q.setUniforms(H);Q.bind(O);this.updatePipelineState(O); this.setStencilRef(O,C);C.draw(E,G.locationInfo);Q.cleanupTemporaryTextures();return{vertexShader:Q.vertexShader,fragmentShader:Q.fragmentShader}}submitDrawQuad(E){const {shader:C,uniforms:G,defines:H,optionalAttributes:K}=this._shaderState,J=this._programCache.getProgram(C,{},G,H??{},K??{});J.setUniforms(G);J.bind(E);this.updatePipelineState(E);this._quadMesh.draw();E.bindVAO(null);J.cleanupTemporaryTextures()}submitDrawMesh(E,C,G){const {shader:H,uniforms:K,defines:J,optionalAttributes:O}=this._shaderState, Q=this._programCache.getProgram(H,{},K,J??{},O??{});Q.setUniforms(K);Q.bind(E);this.updatePipelineState(E);if(G)for(const T of G)C.bind(E,T),C.draw(E);else for(G=0;Gk||y||b.isSourceScaled||b.rotation?m.bilinear:m.nearest}else p=m[f.samplingMode];k=n.materialManager.getProgram(this._desc,p.defines);if(r&&null!=c&&!k.compiled)c(); else{d.timeline.begin(this.name);"additive"===b.blendFunction?a.setBlendFunctionSeparate(h.BlendFactor.ONE,h.BlendFactor.ONE,h.BlendFactor.ONE,h.BlendFactor.ONE):a.setBlendFunctionSeparate(h.BlendFactor.ONE,h.BlendFactor.ONE_MINUS_SRC_ALPHA,h.BlendFactor.ONE,h.BlendFactor.ONE_MINUS_SRC_ALPHA);a.setStencilFunction(h.CompareFunction.EQUAL,b.stencilRef,255);this._quad||(this._quad=new g(a,[0,0,1,0,0,1,1,1]));var {coordScale:t,computedOpacity:w,transforms:u}=b;b.setSamplingProfile(p);b.bind(d.context, e.textureBindingBitmap);a.useProgram(k);k.setUniformMatrix3fv("u_dvsMat3",u.displayViewScreenMat3);k.setUniform1i("u_texture",e.textureBindingBitmap);k.setUniform2fv("u_coordScale",t);k.setUniform1f("u_opacity",w);this._quad.draw();d.timeline.end(this.name)}}}}return l})},"esri/views/2d/engine/webgl/VertexStream":function(){define(["./shaderGraph/techniques/mesh/utils","../../../webgl/BufferObject","../../../webgl/enums","../../../webgl/VertexArrayObject","../../../webgl/VertexElementDescriptor"], function(e,g,q,h,m){class l{constructor(d,b){this._rctx=d;this._attributes=[{name:"position",offset:0,type:q.DataType.SHORT,count:2}];this.layout={hash:e.vertexLayoutHash(this._attributes),attributes:this._attributes,stride:4};this._vertexBuffer=g.BufferObject.createVertex(d,q.Usage.STATIC_DRAW,new Uint16Array(b));this._vao=new h.VertexArrayObject(d,new Map([["a_position",0]]),{geometry:[new m.VertexElementDescriptor("a_position",2,q.DataType.SHORT,0,4)]},{geometry:this._vertexBuffer});this._count= b.length/2}bind(){this._rctx.bindVAO(this._vao)}unbind(){this._rctx.bindVAO(null)}dispose(){this._vao.dispose()}draw(){this._rctx.bindVAO(this._vao);this._rctx.drawArrays(q.PrimitiveType.TRIANGLE_STRIP,0,this._count)}}return l})},"esri/views/2d/engine/webgl/shaderGraph/techniques/mesh/utils":function(){define(["exports","../../../../../../../core/string"],function(e,g){function q(h,m,l,d,b,a,f){if(h.primitiveName===m)for(const n in h)if(n===l){m=d?.readWithDefault(b,a,h[n]&&f);"text"===h.type&&(m= m.toString());h[n]=m;return}if("type"in h&&null!=h.type)switch(h.type){case "CIMPointSymbol":case "CIMLineSymbol":case "CIMPolygonSymbol":if(h.symbolLayers)for(const n of h.symbolLayers)q(n,m,l,d,b,a,f);break;case "CIMHatchFill":h.lineSymbol&&q(h.lineSymbol,m,l,d,b,a,f);break;case "CIMSolidStroke":case "CIMSolidFill":case "CIMVectorMarker":if("CIMVectorMarker"===h.type&&h.markerGraphics)for(const n of h.markerGraphics)q(n,m,l,d,b,a,f),q(n.symbol,m,l,d,b,a,f)}}e.applyComputedValue=q;e.getLineClippingMargin= function(h){const m=h.width;return null!=h.effects?400:Math.max(1.25*m,8)};e.vertexLayoutHash=function(h){h=h.map(({name:m,count:l,type:d})=>`${m}.${l}.${d}`).join(",");return g.numericHash(h)};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/VertexElementDescriptor":function(){define(["exports"],function(e){class g{constructor(q,h,m,l,d,b=!1,a=0){this.name=q;this.count=h;this.type=m;this.offset=l;this.stride=d;this.normalized=b;this.divisor=a}}e.VertexElementDescriptor= g;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/brushes/WGLBrush":function(){define(function(){class e{constructor(){this.name=this.constructor.name||"UnnamedBrush";this.brushEffect=null}prepareState(g,q){}draw(g,q,h){}drawMany(g,q,h){for(const m of q)m.visible&&this.draw(g,m,h)}}return e})},"esri/views/2d/engine/webgl/brushes/BrushClip":function(){define("../../../../../core/libs/gl-matrix-2/factories/vec4f32 ../Utils ./WGLBrush ../shaders/BackgroundPrograms ../../../../webgl/enums ../../../../webgl/ProgramTemplate".split(" "), function(e,g,q,h,m,l){class d extends q{constructor(){super(...arguments);this._color=e.fromValues(0,1,0,1)}dispose(){this._program&&this._program.dispose()}prepareState({context:b}){b.setStencilTestEnabled(!0);b.setBlendingEnabled(!1);b.setFaceCullingEnabled(!1);b.setColorMask(!1,!1,!1,!1);b.setStencilOp(m.StencilOperation.KEEP,m.StencilOperation.KEEP,m.StencilOperation.REPLACE);b.setStencilWriteMask(255);b.setStencilFunction(m.CompareFunction.ALWAYS,0,255)}draw(b,a){const {context:f,state:n,requestRender:c, allowDelayedRender:r}=b;b=g.createProgramDescriptor("clip",{geometry:[{location:0,name:"a_pos",count:2,type:m.DataType.SHORT}]});a=a.getVAO(f,n,b.attributes,b.bufferLayouts);null!=a.indexBuffer&&(this._program||(this._program=l.createProgram(f,h.background)),r&&null!=c&&!this._program.compiled?c():(f.useProgram(this._program),this._program.setUniform2fv("u_coord_range",[1,1]),this._program.setUniform4fv("u_color",this._color),this._program.setUniformMatrix3fv("u_dvsMat3",n.displayMat3),f.bindVAO(a), f.drawElements(m.PrimitiveType.TRIANGLES,a.indexBuffer.size,m.DataType.UNSIGNED_INT,0),f.bindVAO()))}}return d})},"esri/core/libs/gl-matrix-2/factories/vec4f32":function(){define(["exports"],function(e){function g(){return new Float32Array(4)}function q(y){const x=new Float32Array(4);x[0]=y[0];x[1]=y[1];x[2]=y[2];x[3]=y[3];return x}function h(y,x,v,A){const z=new Float32Array(4);z[0]=y;z[1]=x;z[2]=v;z[3]=A;return z}function m(y,x){return new Float32Array(y,x,4)}function l(){return g()}function d(){return h(1, 1,1,1)}function b(){return h(1,0,0,0)}function a(){return h(0,1,0,0)}function f(){return h(0,0,1,0)}function n(){return h(0,0,0,1)}const c=g(),r=d(),k=b(),p=a(),t=f(),w=n(),u=Object.freeze(Object.defineProperty({__proto__:null,ONES:r,UNIT_W:w,UNIT_X:k,UNIT_Y:p,UNIT_Z:t,ZEROS:c,clone:q,create:g,createView:m,fromValues:h,ones:d,unitW:n,unitX:b,unitY:a,unitZ:f,zeros:l},Symbol.toStringTag,{value:"Module"}));e.ONES=r;e.UNIT_W=w;e.UNIT_X=k;e.UNIT_Y=p;e.UNIT_Z=t;e.ZEROS=c;e.clone=q;e.create=g;e.createView= m;e.fromValues=h;e.ones=d;e.unitW=n;e.unitX=b;e.unitY=a;e.unitZ=f;e.vec4f32=u;e.zeros=l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/Utils":function(){define("exports ../../../../core/Error ../../../../core/Logger ../../../../symbols/cim/enums ../../../../core/RandomLCG ../../../../core/has ../../../webgl/checkWebGLError ../../../webgl/enums ../../../webgl/FramebufferObject ../../../../chunks/builtins ../../../webgl/GLObjectType ../../../webgl/getDataTypeBytes ../../../webgl/Texture ../../../webgl/TextureDescriptor ../../../webgl/VertexElementDescriptor".split(" "), function(e,g,q,h,m,l,d,b,a,f,n,c,r,k,p){function t(y){const x={};for(const v in y){let A=0;x[v]=y[v].map(z=>{const B=new p.VertexElementDescriptor(z.name,z.count,z.type,A,0,z.normalized||!1);A+=z.count*c.getDataTypeBytes(z.type);return B});x[v]?.forEach(z=>z.stride=A)}return x}const w=()=>q.getLogger("esri.views.2d.engine.webgl.Utils"),u=new Map;e.charCodes=function(y){const x=[];for(let v=0;v {if(!u.has(y)){const z=t(x);var v=z;var A={};for(const B in v){const D=v[B];A[B]=D?.length?D[0].stride:0}v=A;A=new Map;for(const B in x)for(const D of x[B])A.set(D.name,D.location);u.set(y,{strides:v,bufferLayouts:z,attributes:A})}return u.get(y)};e.createTexture=function(y,x,v){const A=new k.TextureDescriptor(x.width,x.height);A.dataType=x.dataType;x.depth&&(A.depth=x.depth);x.flipped&&(A.flipped=x.flipped);x.hasMipmap&&(A.hasMipmap=x.hasMipmap);A.internalFormat=x.internalFormat;x.isImmutable&&(A.isImmutable= x.isImmutable);x.isOpaque&&(A.isOpaque=x.isOpaque);x.maxAnisotropy&&(A.maxAnisotropy=x.maxAnisotropy);A.pixelFormat=x.pixelFormat;x.preMultiplyAlpha&&(A.preMultiplyAlpha=x.preMultiplyAlpha);x.samplingMode&&(A.samplingMode=x.samplingMode);x.target&&(A.target=x.target);A.uniform=x.uniform;x.unpackAlignment&&(A.unpackAlignment=x.unpackAlignment);x.wrapMode&&(A.wrapMode=x.wrapMode);return new r.Texture(y,A,v)};e.discardUrlIfHasUrlHash=function(y){return"url"in y&&"urlHash"in y?{...y,url:""}:y};e.getCapType= function(y){switch(y){case "butt":return h.CapType.BUTT;case "round":return h.CapType.ROUND;case "square":return h.CapType.SQUARE;default:return w().error(new g("mapview-invalid-type",`Cap type ${y} is not a valid option. Defaulting to round`)),h.CapType.ROUND}};e.getJoinType=function(y){switch(y){case "miter":return h.JoinType.MITER;case "bevel":return h.JoinType.BEVEL;case "round":return h.JoinType.ROUND;default:return w().error(new g("mapview-invalid-type",`Join type ${y} is not a valid option. Defaulting to round`)), h.JoinType.ROUND}};e.getPixelArrayCtor=function(y){switch(y){case b.PixelType.UNSIGNED_BYTE:return Uint8Array;case b.PixelType.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case b.PixelType.FLOAT:return Float32Array;default:w().error(new g("webgl-utils",`Unable to handle type ${y}`))}};e.getPixelBytes=function(y){switch(y){case b.PixelType.UNSIGNED_BYTE:return 1;case b.PixelType.UNSIGNED_SHORT_4_4_4_4:return 2;case b.PixelType.FLOAT:return 4;default:w().error(new g("webgl-utils",`Unable to handle type ${y}`))}}; e.isSVGImage=y=>y.includes("data:image/svg+xml");e.isValidSVG=y=>{if(!y)return!1;y=y.trim();return/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(y)&&/[\dz]$/i.test(y)&&4{d&&=d[b]});return d}}(g));e.resolveIncludes=function(m){return h.resolveIncludes(m)};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})}, "esri/views/2d/engine/webgl/shaders/sources/shaderRepository":function(){define(function(){return{background:{"background.frag":"uniform lowp vec4 u_color;\nvoid main() {\ngl_FragColor \x3d u_color;\n}","background.vert":"attribute vec2 a_pos;\nuniform highp mat3 u_dvsMat3;\nuniform mediump vec2 u_coord_range;\nuniform mediump float u_depth;\nvoid main() {\nvec3 v_pos \x3d u_dvsMat3 * vec3(u_coord_range * a_pos, 1.0);\ngl_Position \x3d vec4(v_pos.xy, 0.0, 1.0);\n}"},bitBlit:{"bitBlit.frag":"uniform lowp sampler2D u_tex;\nuniform lowp float u_opacity;\nvarying mediump vec2 v_uv;\nvoid main() {\nlowp vec4 color \x3d texture2D(u_tex, v_uv);\ngl_FragColor \x3d color * u_opacity;\n}", "bitBlit.vert":"attribute vec2 a_pos;\nattribute vec2 a_tex;\nvarying mediump vec2 v_uv;\nvoid main(void) {\ngl_Position \x3d vec4(a_pos , 0.0, 1.0);\nv_uv \x3d a_tex;\n}"},blend:{"blend.frag":"precision mediump float;\nuniform sampler2D u_layerTexture;\nuniform lowp float u_opacity;\nuniform lowp float u_inFadeOpacity;\n#ifndef NORMAL\nuniform sampler2D u_backbufferTexture;\n#endif\nvarying mediump vec2 v_uv;\nfloat rgb2v(in vec3 c) {\nreturn max(c.x, max(c.y, c.z));\n}\nvec3 rgb2hsv(in vec3 c) {\nvec4 K \x3d vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\nvec4 p \x3d c.g \x3c c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);\nvec4 q \x3d c.r \x3c p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);\nfloat d \x3d q.x - min(q.w, q.y);\nfloat e \x3d 1.0e-10;\nreturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);\n}\nvec3 hsv2rgb(in vec3 c) {\nvec4 K \x3d vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\nvec3 p \x3d abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\nreturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\nvec3 tint(in vec3 Cb, in vec3 Cs) {\nfloat vIn \x3d rgb2v(Cb);\nvec3 hsvTint \x3d rgb2hsv(Cs);\nvec3 hsvOut \x3d vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z);\nreturn hsv2rgb(hsvOut);\n}\nfloat overlay(in float Cb, in float Cs) {\nreturn (1.0 - step(0.5, Cs)) * (1.0 - 2.0 * (1.0 - Cs ) * (1.0 - Cb)) + step(0.5, Cs) * (2.0 * Cs * Cb);\n}\nfloat colorDodge(in float Cb, in float Cs) {\nreturn (Cb \x3d\x3d 0.0) ? 0.0 : (Cs \x3d\x3d 1.0) ? 1.0 : min(1.0, Cb / (1.0 - Cs));\n}\nfloat colorBurn(in float Cb, in float Cs) {\nreturn (Cb \x3d\x3d 1.0) ? 1.0 : (Cs \x3d\x3d 0.0) ? 0.0 : 1.0 - min(1.0, (1.0 - Cb) / Cs);\n}\nfloat hardLight(in float Cb, in float Cs) {\nreturn (1.0 - step(0.5, Cs)) * (2.0 * Cs * Cb) + step(0.5, Cs) * (1.0 - 2.0 * (1.0 - Cs) * (1.0 - Cb));\n}\nfloat reflectBlend(in float Cb, in float Cs) {\nreturn (Cs \x3d\x3d 1.0) ? Cs : min(Cb * Cb / (1.0 - Cs), 1.0);\n}\nfloat softLight(in float Cb, in float Cs) {\nif (Cs \x3c\x3d 0.5) {\nreturn Cb - (1.0 - 2.0 * Cs) * Cb * (1.0 - Cb);\n}\nif (Cb \x3c\x3d 0.25) {\nreturn Cb + (2.0 * Cs - 1.0) * Cb * ((16.0 * Cb - 12.0) * Cb + 3.0);\n}\nreturn Cb + (2.0 * Cs - 1.0) * (sqrt(Cb) - Cb);\n}\nfloat vividLight(in float Cb, in float Cs) {\nreturn (1.0 - step(0.5, Cs)) * colorBurn(Cb, 2.0 * Cs) + step(0.5, Cs) * colorDodge(Cb, (2.0 * (Cs - 0.5)));\n}\nfloat minv3(in vec3 c) {\nreturn min(min(c.r, c.g), c.b);\n}\nfloat maxv3(in vec3 c) {\nreturn max(max(c.r, c.g), c.b);\n}\nfloat lumv3(in vec3 c) {\nreturn dot(c, vec3(0.3, 0.59, 0.11));\n}\nfloat satv3(vec3 c) {\nreturn maxv3(c) - minv3(c);\n}\nvec3 clipColor(vec3 color) {\nfloat lum \x3d lumv3(color);\nfloat mincol \x3d minv3(color);\nfloat maxcol \x3d maxv3(color);\nif (mincol \x3c 0.0) {\ncolor \x3d lum + ((color - lum) * lum) / (lum - mincol);\n}\nif (maxcol \x3e 1.0) {\ncolor \x3d lum + ((color - lum) * (1.0 - lum)) / (maxcol - lum);\n}\nreturn color;\n}\nvec3 setLum(vec3 cbase, vec3 clum) {\nfloat lbase \x3d lumv3(cbase);\nfloat llum \x3d lumv3(clum);\nfloat ldiff \x3d llum - lbase;\nvec3 color \x3d cbase + vec3(ldiff);\nreturn clipColor(color);\n}\nvec3 setLumSat(vec3 cbase, vec3 csat, vec3 clum)\n{\nfloat minbase \x3d minv3(cbase);\nfloat sbase \x3d satv3(cbase);\nfloat ssat \x3d satv3(csat);\nvec3 color;\nif (sbase \x3e 0.0) {\ncolor \x3d (cbase - minbase) * ssat / sbase;\n} else {\ncolor \x3d vec3(0.0);\n}\nreturn setLum(color, clum);\n}\nvoid main() {\nvec4 src \x3d texture2D(u_layerTexture, v_uv);\n#ifdef NORMAL\ngl_FragColor \x3d src * u_opacity;\n#else\nvec4 dst \x3d texture2D(u_backbufferTexture, v_uv);\nvec3 Cs \x3d src.a \x3d\x3d 0.0 ? src.rgb : vec3(src.rgb / src.a);\nvec3 Cb \x3d dst.a \x3d\x3d 0.0 ? dst.rgb : vec3(dst.rgb / dst.a);\nfloat as \x3d u_opacity * src.a;\nfloat ab \x3d dst.a;\n#ifdef DESTINATION_OVER\ngl_FragColor \x3d vec4(as * Cs * (1.0 - ab) + ab * Cb, as + ab - as * ab);\n#endif\n#ifdef SOURCE_IN\nvec4 color \x3d vec4(as * Cs * ab, as * ab);\nvec4 fadeColor \x3d (1.0 - u_opacity) * u_inFadeOpacity * vec4(ab * Cb, ab);\ngl_FragColor \x3d color + fadeColor;\n#endif\n#ifdef DESTINATION_IN\nvec4 color \x3d vec4(ab * Cb * as, ab * as);\nvec4 fadeColor \x3d (1.0 - u_opacity) * u_inFadeOpacity * vec4(ab * Cb, ab);\ngl_FragColor \x3d color + fadeColor;\n#endif\n#ifdef SOURCE_OUT\ngl_FragColor \x3d vec4(as * Cs * (1.0 - ab), as * (1.0 - ab));\n#endif\n#ifdef DESTINATION_OUT\ngl_FragColor \x3d vec4(ab * Cb * (1.0 - as), ab * (1.0 - as));\n#endif\n#ifdef SOURCE_ATOP\ngl_FragColor \x3d vec4(as * Cs * ab + ab * Cb * (1.0 - as), ab);\n#endif\n#ifdef DESTINATION_ATOP\ngl_FragColor \x3d vec4(as * Cs * (1.0 - ab) + ab * Cb * as, as);\n#endif\n#ifdef XOR\ngl_FragColor \x3d vec4(as * Cs * (1.0 - ab) + ab * Cb * (1.0 - as),\nas * (1.0 - ab) + ab * (1.0 - as));\n#endif\n#ifdef MULTIPLY\ngl_FragColor \x3d vec4(as * Cs * ab * Cb + (1.0 - ab) * as * Cs + (1.0 - as) * ab * Cb,\nas + ab * (1.0 - as));\n#endif\n#ifdef SCREEN\ngl_FragColor \x3d vec4((Cs + Cb - Cs * Cb) * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef OVERLAY\nvec3 f \x3d vec3(overlay(Cb.r, Cs.r), overlay(Cb.g, Cs.g), overlay(Cb.b, Cs.b));\ngl_FragColor \x3d vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef DARKEN\ngl_FragColor \x3d vec4(min(Cs, Cb) * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef LIGHTER\ngl_FragColor \x3d vec4(as * Cs + ab * Cb, as + ab);\n#endif\n#ifdef LIGHTEN\ngl_FragColor \x3d vec4(max(Cs, Cb) * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef COLOR_DODGE\nvec3 f \x3d clamp(vec3(colorDodge(Cb.r, Cs.r), colorDodge(Cb.g, Cs.g), colorDodge(Cb.b, Cs.b)), vec3(0.0), vec3(1.0));\ngl_FragColor \x3d vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef COLOR_BURN\nvec3 f \x3d vec3(colorBurn(Cb.r, Cs.r), colorBurn(Cb.g, Cs.g), colorBurn(Cb.b, Cs.b));\ngl_FragColor \x3d vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef HARD_LIGHT\nvec3 f \x3d vec3(hardLight(Cb.r, Cs.r), hardLight(Cb.g, Cs.g), hardLight(Cb.b, Cs.b));\ngl_FragColor \x3d vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef SOFT_LIGHT\nvec3 f \x3d vec3(softLight(Cb.r, Cs.r), softLight(Cb.g, Cs.g), softLight(Cb.b, Cs.b));\ngl_FragColor \x3d vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef DIFFERENCE\ngl_FragColor \x3d vec4(abs(Cb - Cs) * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef EXCLUSION\nvec3 f \x3d Cs + Cb - 2.0 * Cs * Cb;\ngl_FragColor \x3d vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef INVERT\ngl_FragColor \x3d vec4((1.0 - Cb) * as * ab + Cb * ab * (1.0 - as), ab);\n#endif\n#ifdef VIVID_LIGHT\nvec3 f \x3d vec3(clamp(vividLight(Cb.r, Cs.r), 0.0, 1.0),\nclamp(vividLight(Cb.g, Cs.g), 0.0, 1.0),\nclamp(vividLight(Cb.b, Cs.b), 0.0, 1.0));\ngl_FragColor \x3d vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef HUE\nvec3 f \x3d setLumSat(Cs,Cb,Cb);\ngl_FragColor \x3d vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef SATURATION\nvec3 f \x3d setLumSat(Cb,Cs,Cb);\ngl_FragColor \x3d vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef COLOR\nvec3 f \x3d setLum(Cs,Cb);\ngl_FragColor \x3d vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef LUMINOSITY\nvec3 f \x3d setLum(Cb,Cs);\ngl_FragColor \x3d vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef PLUS\ngl_FragColor \x3d clamp(vec4(src.r + Cb.r, src.g + Cb.g, src.b + Cb.b, as + ab), 0.0, 1.0);\n#endif\n#ifdef MINUS\ngl_FragColor \x3d vec4(clamp(vec3(Cb.r - src.r, Cb.g - src.g, Cb.b - src.b), 0.0, 1.0), ab * as);\n#endif\n#ifdef AVERAGE\nvec3 f \x3d (Cb + Cs) / 2.0;\ngl_FragColor \x3d vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef REFLECT\nvec3 f \x3d clamp(vec3(reflectBlend(Cb.r, Cs.r),\nreflectBlend(Cb.g, Cs.g),\nreflectBlend(Cb.b, Cs.b)), vec3(0.0), vec3(1.0));\ngl_FragColor \x3d vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#endif\n}", "blend.vert":"attribute vec2 a_position;\nvarying mediump vec2 v_uv;\nvoid main(void) {\ngl_Position \x3d vec4(a_position , 0.0, 1.0);\nv_uv \x3d (a_position + 1.0) / 2.0;\n}"},debug:{overlay:{"overlay.frag":"precision mediump float;\nvarying vec4 v_color;\nvoid main(void) {\ngl_FragColor \x3d v_color;\n}","overlay.vert":"attribute vec3 a_PositionAndFlags;\nuniform mat3 u_dvsMat3;\nuniform vec4 u_colors[4];\nuniform float u_opacities[4];\nvarying vec4 v_color;\nvoid main(void) {\nvec2 position \x3d a_PositionAndFlags.xy;\nfloat flags \x3d a_PositionAndFlags.z;\nint colorIndex \x3d int(mod(flags, 4.0));\nvec4 color;\nfor (int i \x3d 0; i \x3c 4; i++) {\ncolor \x3d u_colors[i];\nif (i \x3d\x3d colorIndex) {\nbreak;\n}\n}\nint opacityIndex \x3d int(mod(floor(flags / 4.0), 4.0));\nfloat opacity;\nfor (int i \x3d 0; i \x3c 4; i++) {\nopacity \x3d u_opacities[i];\nif (i \x3d\x3d opacityIndex) {\nbreak;\n}\n}\nv_color \x3d color * opacity;\ngl_Position \x3d vec4((u_dvsMat3 * vec3(position, 1.0)).xy, 0.0, 1.0);\n}"}}, dot:{dot:{"dot.frag":"precision mediump float;\nvarying vec4 v_color;\nvarying float v_dotRatio;\nvarying float v_invEdgeRatio;\nuniform highp float u_tileZoomFactor;\nvoid main()\n{\nfloat dist \x3d length(gl_PointCoord - vec2(.5, .5)) * 2.;\nfloat alpha \x3d smoothstep(0., 1., v_invEdgeRatio * (dist - v_dotRatio) + 1.);\ngl_FragColor \x3d v_color * alpha;\n}","dot.vert":"precision highp float;\nattribute vec2 a_pos;\nuniform sampler2D u_texture;\nuniform highp mat3 u_dvsMat3;\nuniform highp float u_tileZoomFactor;\nuniform highp float u_dotSize;\nuniform highp float u_pixelRatio;\nvarying vec2 v_pos;\nvarying vec4 v_color;\nvarying float v_dotRatio;\nvarying float v_invEdgeRatio;\nconst float EPSILON \x3d 0.000001;\nvoid main()\n{\nmat3 tileToTileTexture \x3d mat3( 1., 0., 0.,\n0., -1., 0.,\n0., 1., 1. );\nvec3 texCoords \x3d tileToTileTexture * vec3(a_pos.xy / 512., 1.);\nv_color \x3d texture2D(u_texture, texCoords.xy);\nfloat smoothEdgeWidth \x3d max(u_dotSize / 2., 1.) ;\nfloat z \x3d 0.;\nz +\x3d 2.0 * step(v_color.a, EPSILON);\ngl_PointSize \x3d (smoothEdgeWidth + u_dotSize);\ngl_Position \x3d vec4((u_dvsMat3 * vec3(a_pos + .5, 1.)).xy, z, 1.);\nv_dotRatio \x3d u_dotSize / gl_PointSize;\nv_invEdgeRatio \x3d -1. / ( smoothEdgeWidth / gl_PointSize );\ngl_PointSize *\x3d (u_pixelRatio * u_tileZoomFactor);\n}"}}, filtering:{"bicubic.glsl":"vec4 computeWeights(float v) {\nfloat b \x3d 1.0 / 6.0;\nfloat v2 \x3d v * v;\nfloat v3 \x3d v2 * v;\nfloat w0 \x3d b * (-v3 + 3.0 * v2 - 3.0 * v + 1.0);\nfloat w1 \x3d b * (3.0 * v3 - 6.0 * v2 + 4.0);\nfloat w2 \x3d b * (-3.0 * v3 + 3.0 * v2 + 3.0 * v + 1.0);\nfloat w3 \x3d b * v3;\nreturn vec4(w0, w1, w2, w3);\n}\nvec4 bicubicOffsetsAndWeights(float v) {\nvec4 w \x3d computeWeights(v);\nfloat g0 \x3d w.x + w.y;\nfloat g1 \x3d w.z + w.w;\nfloat h0 \x3d 1.0 - (w.y / g0) + v;\nfloat h1 \x3d 1.0 + (w.w / g1) - v;\nreturn vec4(h0, h1, g0, g1);\n}\nvec4 sampleBicubicBSpline(sampler2D sampler, vec2 coords, vec2 texSize) {\nvec2 eX \x3d vec2(1.0 / texSize.x, 0.0);\nvec2 eY \x3d vec2(0.0, 1.0 / texSize.y);\nvec2 texel \x3d coords * texSize - 0.5;\nvec3 hgX \x3d bicubicOffsetsAndWeights(fract(texel).x).xyz;\nvec3 hgY \x3d bicubicOffsetsAndWeights(fract(texel).y).xyz;\nvec2 coords10 \x3d coords + hgX.x * eX;\nvec2 coords00 \x3d coords - hgX.y * eX;\nvec2 coords11 \x3d coords10 + hgY.x * eY;\nvec2 coords01 \x3d coords00 + hgY.x * eY;\ncoords10 \x3d coords10 - hgY.y * eY;\ncoords00 \x3d coords00 - hgY.y * eY;\nvec4 color00 \x3d texture2D(sampler, coords00);\nvec4 color10 \x3d texture2D(sampler, coords10);\nvec4 color01 \x3d texture2D(sampler, coords01);\nvec4 color11 \x3d texture2D(sampler, coords11);\ncolor00 \x3d mix(color00, color01, hgY.z);\ncolor10 \x3d mix(color10, color11, hgY.z);\ncolor00 \x3d mix(color00, color10, hgX.z);\nreturn color00;\n}", "bilinear.glsl":"vec4 sampleBilinear(sampler2D sampler, vec2 coords, vec2 texSize) {\nvec2 texelStart \x3d floor(coords * texSize);\nvec2 coord0 \x3d texelStart / texSize;\nvec2 coord1 \x3d (texelStart + vec2(1.0, 0.0)) / texSize;\nvec2 coord2 \x3d (texelStart + vec2(0.0, 1.0)) / texSize;\nvec2 coord3 \x3d (texelStart + vec2(1.0, 1.0)) / texSize;\nvec4 color0 \x3d texture2D(sampler, coord0);\nvec4 color1 \x3d texture2D(sampler, coord1);\nvec4 color2 \x3d texture2D(sampler, coord2);\nvec4 color3 \x3d texture2D(sampler, coord3);\nvec2 blend \x3d fract(coords * texSize);\nvec4 color01 \x3d mix(color0, color1, blend.x);\nvec4 color23 \x3d mix(color2, color3, blend.x);\nvec4 color \x3d mix(color01, color23, blend.y);\n#ifdef NNEDGE\nfloat alpha \x3d floor(color0.a * color1.a * color2.a * color3.a + 0.5);\ncolor \x3d color * alpha + (1.0 - alpha) * texture2D(sampler, coords);\n#endif\nreturn color;\n}", "epx.glsl":"vec4 sampleEPX(sampler2D sampler, float size, vec2 coords, vec2 texSize) {\nvec2 invSize \x3d 1.0 / texSize;\nvec2 texel \x3d coords * texSize;\nvec2 texel_i \x3d floor(texel);\nvec2 texel_frac \x3d fract(texel);\nvec4 colorP \x3d texture2D(sampler, texel_i * invSize);\nvec4 colorP1 \x3d vec4(colorP);\nvec4 colorP2 \x3d vec4(colorP);\nvec4 colorP3 \x3d vec4(colorP);\nvec4 colorP4 \x3d vec4(colorP);\nvec4 colorA \x3d texture2D(sampler, (texel_i - vec2(0.0, 1.0)) * invSize);\nvec4 colorB \x3d texture2D(sampler, (texel_i + vec2(1.0, 0.0)) * invSize);\nvec4 colorC \x3d texture2D(sampler, (texel_i - vec2(1.0, 0.0)) * invSize);\nvec4 colorD \x3d texture2D(sampler, (texel_i + vec2(0.0, 1.0)) * invSize);\nif (colorC \x3d\x3d colorA \x26\x26 colorC !\x3d colorD \x26\x26 colorA !\x3d colorB) {\ncolorP1 \x3d colorA;\n}\nif (colorA \x3d\x3d colorB \x26\x26 colorA !\x3d colorC \x26\x26 colorB !\x3d colorD) {\ncolorP2 \x3d colorB;\n}\nif (colorD \x3d\x3d colorC \x26\x26 colorD !\x3d colorB \x26\x26 colorC !\x3d colorA) {\ncolorP3 \x3d colorC;\n}\nif (colorB \x3d\x3d colorD \x26\x26 colorB !\x3d colorA \x26\x26 colorD !\x3d colorC) {\ncolorP4 \x3d colorD;\n}\nvec4 colorP12 \x3d mix(colorP1, colorP2, texel_frac.x);\nvec4 colorP34 \x3d mix(colorP1, colorP2, texel_frac.x);\nreturn mix(colorP12, colorP34, texel_frac.y);\n}"}, fx:{integrate:{"integrate.frag":"precision mediump float;\nuniform lowp sampler2D u_sourceTexture;\nuniform lowp sampler2D u_maskTexture;\nuniform mediump float u_zoomLevel;\nuniform highp float u_timeDelta;\nuniform highp float u_animationTime;\nvarying highp vec2 v_texcoord;\n#include \x3cmaterials/utils.glsl\x3e\nvoid main()\n{\n#ifdef DELTA\nvec4 texel \x3d texture2D(u_sourceTexture, v_texcoord);\nvec4 data0 \x3d texture2D(u_maskTexture, v_texcoord);\nfloat flags \x3d data0.r * 255.0;\nfloat groupMinZoom \x3d data0.g * 255.0;\nfloat epsilon \x3d 5.;\nfloat wouldClip \x3d float(groupMinZoom \x3c epsilon);\nfloat direction \x3d wouldClip * 1.0 + (1.0 - wouldClip) * -1.0;\nfloat dt \x3d u_timeDelta / max(u_animationTime, 0.0001);\nvec4 nextState \x3d vec4(texel + direction * dt);\ngl_FragColor \x3d vec4(nextState);\n#elif defined(UPDATE)\nvec4 texel \x3d texture2D(u_sourceTexture, v_texcoord);\ngl_FragColor \x3d texel;\n#endif\n}", "integrate.vert":"precision mediump float;\nattribute vec2 a_pos;\nvarying highp vec2 v_texcoord;\nvoid main()\n{\nv_texcoord \x3d a_pos;\ngl_Position \x3d vec4(a_pos * 2.0 - 1.0, 0.0, 1.0);\n}"}},heatmap:{heatmapResolve:{"heatmapResolve.frag":"precision highp float;\n#ifdef HEATMAP_PRECISION_HALF_FLOAT\n#define COMPRESSION_FACTOR 4.0\n#else\n#define COMPRESSION_FACTOR 1.0\n#endif\nuniform sampler2D u_texture;\nuniform sampler2D u_gradient;\nuniform vec2 u_densityMinAndInvRange;\nuniform float u_densityNormalization;\nvarying vec2 v_uv;\nvoid main() {\nvec4 data \x3d texture2D(u_texture, v_uv);\nfloat density \x3d data.r * COMPRESSION_FACTOR;\ndensity *\x3d u_densityNormalization;\ndensity \x3d (density - u_densityMinAndInvRange.x) * u_densityMinAndInvRange.y;\nvec4 color \x3d texture2D(u_gradient, vec2(density, 0.5));\ngl_FragColor \x3d vec4(color.rgb * color.a, color.a);\n}", "heatmapResolve.vert":"precision highp float;\nattribute vec2 a_pos;\nvarying vec2 v_uv;\nvoid main() {\nv_uv \x3d a_pos;\ngl_Position \x3d vec4(a_pos * 2.0 - 1.0, 1., 1.);\n}"}},highlight:{"blur.frag":"varying mediump vec2 v_texcoord;\nuniform mediump vec4 u_direction;\nuniform mediump mat4 u_channelSelector;\nuniform mediump float u_sigma;\nuniform sampler2D u_texture;\nmediump float gauss1(mediump vec2 dir) {\nreturn exp(-dot(dir, dir) / (2.0 * u_sigma * u_sigma));\n}\nmediump vec4 selectChannel(mediump vec4 sample) {\nreturn u_channelSelector * sample;\n}\nvoid accumGauss1(mediump float i, inout mediump float tot, inout mediump float weight) {\nmediump float w \x3d gauss1(i * u_direction.xy);\ntot +\x3d selectChannel(texture2D(u_texture, v_texcoord + i * u_direction.zw))[3] * w;\nweight +\x3d w;\n}\nvoid main(void) {\nmediump float tot \x3d 0.0;\nmediump float weight \x3d 0.0;\naccumGauss1(-5.0, tot, weight);\naccumGauss1(-4.0, tot, weight);\naccumGauss1(-3.0, tot, weight);\naccumGauss1(-2.0, tot, weight);\naccumGauss1(-1.0, tot, weight);\naccumGauss1(0.0, tot, weight);\naccumGauss1(1.0, tot, weight);\naccumGauss1(2.0, tot, weight);\naccumGauss1(3.0, tot, weight);\naccumGauss1(4.0, tot, weight);\naccumGauss1(5.0, tot, weight);\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, tot / weight);\n}", "highlight.frag":"varying mediump vec2 v_texcoord;\nuniform sampler2D u_texture;\nuniform mediump float u_sigma;\nuniform sampler2D u_shade;\nuniform mediump vec2 u_minMaxDistance;\nmediump float estimateDistance() {\nmediump float y \x3d texture2D(u_texture, v_texcoord)[3];\nconst mediump float y0 \x3d 0.5;\nmediump float m0 \x3d 1.0 / (sqrt(2.0 * 3.1415) * u_sigma);\nmediump float d \x3d (y - y0) / m0;\nreturn d;\n}\nmediump vec4 shade(mediump float d) {\nmediump float mappedDistance \x3d (d - u_minMaxDistance.x) / (u_minMaxDistance.y - u_minMaxDistance.x);\nmappedDistance \x3d clamp(mappedDistance, 0.0, 1.0);\nreturn texture2D(u_shade, vec2(mappedDistance, 0.5));\n}\nvoid main(void) {\nmediump float d \x3d estimateDistance();\ngl_FragColor \x3d shade(d);\n}", "textured.vert":"attribute mediump vec2 a_position;\nattribute mediump vec2 a_texcoord;\nvarying mediump vec2 v_texcoord;\nvoid main(void) {\ngl_Position \x3d vec4(a_position, 0.0, 1.0);\nv_texcoord \x3d a_texcoord;\n}"},magnifier:{"magnifier.frag":"uniform lowp vec4 u_background;\nuniform mediump sampler2D u_readbackTexture;\nuniform mediump sampler2D u_maskTexture;\nuniform mediump sampler2D u_overlayTexture;\nuniform bool u_maskEnabled;\nuniform bool u_overlayEnabled;\nvarying mediump vec2 v_texCoord;\nconst lowp float barrelFactor \x3d 1.1;\nlowp vec2 barrel(lowp vec2 uv) {\nlowp vec2 uvn \x3d uv * 2.0 - 1.0;\nif (uvn.x \x3d\x3d 0.0 \x26\x26 uvn.y \x3d\x3d 0.0) {\nreturn vec2(0.5, 0.5);\n}\nlowp float theta \x3d atan(uvn.y, uvn.x);\nlowp float r \x3d pow(length(uvn), barrelFactor);\nreturn r * vec2(cos(theta), sin(theta)) * 0.5 + 0.5;\n}\nvoid main(void)\n{\nlowp vec4 color \x3d texture2D(u_readbackTexture, barrel(v_texCoord));\ncolor \x3d (color + (1.0 - color.a) * u_background);\nlowp float mask \x3d u_maskEnabled ? texture2D(u_maskTexture, v_texCoord).a : 1.0;\ncolor *\x3d mask;\nlowp vec4 overlayColor \x3d u_overlayEnabled ? texture2D(u_overlayTexture, v_texCoord) : vec4(0);\ngl_FragColor \x3d overlayColor + (1.0 - overlayColor.a) * color;\n}", "magnifier.vert":"precision mediump float;\nattribute mediump vec2 a_pos;\nuniform mediump vec4 u_drawPos;\nvarying mediump vec2 v_texCoord;\nvoid main(void)\n{\nv_texCoord \x3d a_pos;\ngl_Position \x3d vec4(u_drawPos.xy + vec2(a_pos - 0.5) * u_drawPos.zw, 0.0, 1.0);\n}"},materials:{"attributeData.glsl":"uniform highp sampler2D filterFlags;\nuniform highp sampler2D animation;\nuniform highp sampler2D gpgpu;\nuniform highp sampler2D visualVariableData;\nuniform highp sampler2D dataDriven0;\nuniform highp sampler2D dataDriven1;\nuniform highp sampler2D dataDriven2;\nuniform float size;\nhighp vec2 getAttributeDataCoords(in highp vec3 id) {\nhighp vec3 texel \x3d unpackDisplayIdTexel(id);\nhighp float u32 \x3d float(int(texel.r) + int(texel.g) * 256 + int(texel.b) * 256 * 256);\nhighp float col \x3d mod(u32, size);\nhighp float row \x3d (u32 - col) / size;\nhighp float u \x3d col / size;\nhighp float v \x3d row / size;\nreturn vec2(u, v);\n}\nhighp vec2 getAttributeDataTextureCoords(in highp vec3 id) {\nreturn (getAttributeDataCoords(id) * 2.0) - 1.0 + (.5 / vec2(size));\n}\nhighp vec4 getFilterData(in highp vec3 id) {\nvec2 coords \x3d getAttributeDataCoords(id);\nreturn texture2D(filterFlags, coords);\n}\nhighp vec4 getAnimation(in highp vec3 id) {\nhighp vec2 coords \x3d getAttributeDataCoords(id);\nreturn texture2D(animation, coords);\n}\nhighp vec4 getVisualVariableData(in highp vec3 id) {\nhighp vec2 coords \x3d getAttributeDataCoords(id);\nreturn texture2D(visualVariableData, coords);\n}\nhighp vec4 getDataDriven0(in highp vec3 id) {\nhighp vec2 coords \x3d getAttributeDataCoords(id);\nreturn texture2D(dataDriven0, coords);\n}\nhighp vec4 getDataDriven1(in highp vec3 id) {\nhighp vec2 coords \x3d getAttributeDataCoords(id);\nreturn texture2D(dataDriven1, coords);\n}\nhighp vec4 getGPGPU(in highp vec3 id) {\nhighp vec2 coords \x3d getAttributeDataCoords(id);\nreturn texture2D(gpgpu, coords);\n}\nhighp vec4 getDataDriven2(in highp vec3 id) {\nhighp vec2 coords \x3d getAttributeDataCoords(id);\nreturn texture2D(dataDriven2, coords);\n}\nfloat u88VVToFloat(in vec2 v) {\nbool isMagic \x3d v.x \x3d\x3d 255.0 \x26\x26 v.y \x3d\x3d 255.0;\nif (isMagic) {\nreturn NAN_MAGIC_NUMBER;\n}\nreturn (v.x + v.y * float(0x100)) - 32768.0;\n}", "barycentric.glsl":"float inTriangle(vec3 bary) {\nvec3 absBary \x3d abs(bary);\nreturn step((absBary.x + absBary.y + absBary.z), 1.05);\n}\nvec3 xyToBarycentric(in vec2 pos, in vec2 v0, in vec2 v1, in vec2 v2) {\nmat3 xyToBarycentricMat3 \x3d mat3(\nv1.x * v2.y - v2.x * v1.y, v2.x * v0.y - v0.x * v2.y, v0.x * v1.y - v1.x * v0.y,\nv1.y - v2.y, v2.y - v0.y, v0.y - v1.y,\nv2.x - v1.x, v0.x - v2.x, v1.x - v0.x\n);\nfloat A2 \x3d v0.x * (v1.y - v2.y) + v1.x * (v2.y - v0.y) + v2.x * (v0.y - v1.y);\nreturn (1. / A2) * xyToBarycentricMat3 * vec3(1., pos);\n}", "constants.glsl":"const float C_DEG_TO_RAD \x3d 3.14159265359 / 180.0;\nconst float C_256_TO_RAD \x3d 3.14159265359 / 128.0;\nconst float C_RAD_TO_DEG \x3d 180.0 / 3.141592654;\nconst float POSITION_PRECISION \x3d 1.0 / 8.0;\nconst float FILL_POSITION_PRECISION \x3d 1.0 / 1.0;\nconst float SOFT_EDGE_RATIO \x3d 1.0;\nconst float THIN_LINE_WIDTH_FACTOR \x3d 1.1;\nconst float THIN_LINE_HALF_WIDTH \x3d 1.0;\nconst float EXTRUDE_SCALE_PLACEMENT_PADDING \x3d 1.0 / 4.0;\nconst float OFFSET_PRECISION \x3d 1.0 / 8.0;\nconst float OUTLINE_SCALE \x3d 1.0 / 5.0;\nconst float SDF_FONT_SIZE \x3d 24.0;\nconst float MAX_SDF_DISTANCE \x3d 8.0;\nconst float PLACEMENT_PADDING \x3d 8.0;\nconst float EPSILON \x3d 0.00001;\nconst float EPSILON_HITTEST \x3d 0.05;\nconst int MAX_FILTER_COUNT \x3d 2;\nconst int ATTR_VV_SIZE \x3d 0;\nconst int ATTR_VV_COLOR \x3d 1;\nconst int ATTR_VV_OPACITY \x3d 2;\nconst int ATTR_VV_ROTATION \x3d 3;\nconst highp float NAN_MAGIC_NUMBER \x3d 1e-30;\nconst int BITSET_GENERIC_LOCK_COLOR \x3d 1;\nconst int BITSET_GENERIC_CONSIDER_ALPHA_ONLY \x3d 4;\nconst int BITSET_MARKER_ALIGNMENT_MAP \x3d 0;\nconst int BITSET_MARKER_OUTLINE_ALLOW_COLOR_OVERRIDE \x3d 2;\nconst int BITSET_MARKER_SCALE_SYMBOLS_PROPORTIONALLY \x3d 3;\nconst int BITSET_TYPE_FILL_OUTLINE \x3d 0;\nconst int BITSET_FILL_RANDOM_PATTERN_OFFSET \x3d 2;\nconst int BITSET_FILL_HAS_UNRESOLVED_REPLACEMENT_COLOR \x3d 3;\nconst int BITSET_FILL_HAS_PATTERN_HEIGHT_PRECISION_FACTOR \x3d 5;\nconst int BITSET_FILL_HAS_PATTERN_WIDTH_PRECISION_FACTOR \x3d 6;\nconst int BITSET_LINE_SCALE_DASH \x3d 2;", fill:{"common.glsl":"#include \x3cmaterials/symbologyTypeUtils.glsl\x3e\n#ifdef PATTERN\nuniform mediump vec2 u_mosaicSize;\nvarying mediump float v_sampleAlphaOnly;\n#endif\n#if SYMBOLOGY_TYPE \x3d\x3d SYMBOLOGY_TYPE_DOT_DENSITY\nuniform lowp vec4 u_isActive[ 2 ];\nuniform highp float u_dotValue;\nuniform highp float u_tileDotsOverArea;\nuniform highp float u_dotTextureDotCount;\nuniform mediump float u_tileZoomFactor;\n#endif\nvarying highp vec3 v_id;\nvarying lowp vec4 v_color;\nvarying lowp float v_opacity;\nvarying mediump vec4 v_aux1;\n#ifdef PATTERN\nvarying mediump vec2 v_tileTextureCoord;\n#endif\n#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE\nvarying lowp float v_isOutline;\n#endif\n#if SYMBOLOGY_TYPE \x3d\x3d SYMBOLOGY_TYPE_DOT_DENSITY\nvarying highp vec2 v_dotTextureCoords;\nvarying highp vec4 v_dotThresholds[ 2 ];\n#endif", "fill.frag":"precision highp float;\n#include \x3cmaterials/constants.glsl\x3e\n#include \x3cmaterials/utils.glsl\x3e\n#include \x3cmaterials/fill/common.glsl\x3e\n#ifdef PATTERN\nuniform lowp sampler2D u_texture;\n#endif\n#if SYMBOLOGY_TYPE \x3d\x3d SYMBOLOGY_TYPE_DOT_DENSITY\nuniform mediump mat4 u_dotColors[ 2 ];\nuniform sampler2D u_dotTextures[ 2 ];\nuniform vec4 u_dotBackgroundColor;\n#endif\n#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE\n#include \x3cmaterials/shared/line/common.glsl\x3e\n#include \x3cmaterials/shared/line/line.frag\x3e\nlowp vec4 drawLine() {\nfloat v_lineWidth \x3d v_aux1.x;\nvec2 v_normal \x3d v_aux1.yz;\nLineData inputs \x3d LineData(\nv_color,\nv_normal,\nv_lineWidth,\nv_opacity,\nv_id\n);\nreturn shadeLine(inputs);\n}\n#endif\nlowp vec4 drawFill() {\nlowp vec4 out_color \x3d vec4(0.);\n#ifdef HITTEST\nout_color \x3d v_color;\n#elif defined(PATTERN)\nmediump vec4 v_tlbr \x3d v_aux1;\nmediump vec2 normalizedTextureCoord \x3d mod(v_tileTextureCoord, 1.0);\nmediump vec2 samplePos \x3d mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord);\nlowp vec4 color \x3d texture2D(u_texture, samplePos);\nif (v_sampleAlphaOnly \x3e 0.5) {\ncolor.rgb \x3d vec3(color.a);\n}\nout_color \x3d v_opacity * v_color * color;\n#elif SYMBOLOGY_TYPE \x3d\x3d SYMBOLOGY_TYPE_DOT_DENSITY \x26\x26 !defined(HIGHLIGHT)\nvec4 textureThresholds0 \x3d texture2D(u_dotTextures[0], v_dotTextureCoords);\nvec4 textureThresholds1 \x3d texture2D(u_dotTextures[1], v_dotTextureCoords);\nvec4 difference0 \x3d v_dotThresholds[0] - textureThresholds0;\nvec4 difference1 \x3d v_dotThresholds[1] - textureThresholds1;\n#ifdef DD_DOT_BLENDING\nvec4 isPositive0 \x3d step(0.0, difference0);\nvec4 isPositive1 \x3d step(0.0, difference1);\nfloat weightSum \x3d dot(isPositive0, difference0) + dot(isPositive1, difference1);\nfloat lessThanEqZero \x3d step(weightSum, 0.0);\nfloat greaterThanZero \x3d 1.0 - lessThanEqZero ;\nfloat divisor \x3d (weightSum + lessThanEqZero);\nvec4 weights0 \x3d difference0 * isPositive0 / divisor;\nvec4 weights1 \x3d difference1 * isPositive1 / divisor;\nvec4 dotColor \x3d u_dotColors[0] * weights0 + u_dotColors[1] * weights1;\nvec4 preEffectColor \x3d greaterThanZero * dotColor + lessThanEqZero * u_dotBackgroundColor;\n#else\nfloat diffMax \x3d max(max4(difference0), max4(difference1));\nfloat lessThanZero \x3d step(diffMax, 0.0);\nfloat greaterOrEqZero \x3d 1.0 - lessThanZero;\nvec4 isMax0 \x3d step(diffMax, difference0);\nvec4 isMax1 \x3d step(diffMax, difference1);\nvec4 dotColor \x3d u_dotColors[0] * isMax0 + u_dotColors[1] * isMax1;\nvec4 preEffectColor \x3d greaterOrEqZero * dotColor + lessThanZero * u_dotBackgroundColor;\n#endif\nout_color \x3d preEffectColor;\n#else\nout_color \x3d v_opacity * v_color;\n#endif\n#ifdef HIGHLIGHT\nout_color.a \x3d 1.0;\n#endif\nreturn out_color;\n}\nvoid main() {\n#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE\nif (v_isOutline \x3e 0.5) {\ngl_FragColor \x3d drawLine();\n} else {\ngl_FragColor \x3d drawFill();\n}\n#else\ngl_FragColor \x3d drawFill();\n#endif\n}", "fill.vert":"#include \x3cmaterials/symbologyTypeUtils.glsl\x3e\n#define PACKED_LINE\nprecision highp float;\nattribute float a_bitset;\n#if SYMBOLOGY_TYPE \x3d\x3d SYMBOLOGY_TYPE_DOT_DENSITY\nattribute float a_inverseArea;\nvec4 a_color \x3d vec4(0.0, 0.0, 0.0, 1.0);\nvec2 a_zoomRange \x3d vec2(0.0, 10000.0);\n#else\nattribute vec4 a_color;\nattribute vec4 a_aux2;\nattribute vec4 a_aux3;\n#ifndef SYMBOLOGY_TYPE_IS_SIMPLE_LIKE\nattribute vec4 a_aux1;\nattribute vec2 a_zoomRange;\n#else\nvec2 a_zoomRange \x3d vec2(0.0, 10000.0);\n#endif\n#endif\nuniform vec2 u_tileOffset;\nuniform vec2 u_maxIntNumOfCrossing;\n#include \x3cutil/encoding.glsl\x3e\n#include \x3cmaterials/vcommon.glsl\x3e\n#include \x3cmaterials/fill/common.glsl\x3e\n#include \x3cmaterials/fill/hittest.glsl\x3e\nconst float INV_SCALE_COMPRESSION_FACTOR \x3d 1.0 / 128.0;\nconst float MAX_REPRESENTABLE_INT \x3d 16777216.0;\n#if SYMBOLOGY_TYPE \x3d\x3d SYMBOLOGY_TYPE_DOT_DENSITY\nvec4 dotThreshold(vec4 featureAttrOverFeatureArea, float dotValue, float tileDotsOverArea) {\nreturn featureAttrOverFeatureArea * (1.0 / dotValue) * (1.0 / tileDotsOverArea);\n}\n#endif\n#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE\n#include \x3cmaterials/shared/line/common.glsl\x3e\n#include \x3cmaterials/shared/line/line.vert\x3e\nvoid drawLine(out lowp vec4 out_color, out highp vec3 out_pos) {\nLineData outputs \x3d buildLine(\nout_pos,\na_id,\na_pos,\na_color,\n(a_aux3.xy - 128.) / 16.,\n(a_aux3.zw - 128.) / 16.,\n0.,\na_aux2.z / 16.,\na_bitset,\nvec4(0.),\nvec2(0.),\na_aux2.w / 16.\n);\nv_id \x3d outputs.id;\nv_opacity \x3d outputs.opacity;\nv_aux1 \x3d vec4(outputs.lineHalfWidth, outputs.normal, 0.);\nout_color \x3d outputs.color;\n}\n#endif\nvoid drawFill(out lowp vec4 out_color, out highp vec3 out_pos) {\nfloat a_bitSet \x3d a_bitset;\nout_color \x3d getColor(a_color, a_bitSet, BITSET_GENERIC_LOCK_COLOR);\nv_opacity \x3d getOpacity();\nv_id \x3d norm(a_id);\n#if SYMBOLOGY_TYPE \x3d\x3d SYMBOLOGY_TYPE_DOT_DENSITY\nmat3 tileToTileNormalized \x3d mat3( 2. / 512., 0., 0.,\n0., -2. / 512., 0.,\n-1., 1., 1. );\nout_pos \x3d tileToTileNormalized * vec3((a_pos * FILL_POSITION_PRECISION), 1.);\n#else\nout_pos \x3d u_dvsMat3 * vec3(a_pos * FILL_POSITION_PRECISION, 1.);\n#endif\n#ifdef PATTERN\nvec4 a_tlbr \x3d a_aux1;\nfloat a_width \x3d a_aux2.x;\nfloat a_height \x3d a_aux2.y;\nvec2 a_offset \x3d a_aux2.zw;\nvec2 a_scale \x3d a_aux3.xy;\nfloat a_angle \x3d a_aux3.z;\nif (getBit(a_bitset, BITSET_FILL_HAS_PATTERN_WIDTH_PRECISION_FACTOR) \x3e 0.5) {\na_width *\x3d INV_SCALE_COMPRESSION_FACTOR;\n}\nif (getBit(a_bitset, BITSET_FILL_HAS_PATTERN_HEIGHT_PRECISION_FACTOR) \x3e 0.5) {\na_height *\x3d INV_SCALE_COMPRESSION_FACTOR;\n}\nvec2 scale \x3d INV_SCALE_COMPRESSION_FACTOR * a_scale;\nfloat width \x3d u_zoomFactor * a_width * scale.x;\nfloat height \x3d u_zoomFactor * a_height * scale.y;\nfloat angle \x3d C_256_TO_RAD * a_angle;\nfloat sinA \x3d sin(angle);\nfloat cosA \x3d cos(angle);\nfloat dx \x3d 0.0;\nfloat dy \x3d 0.0;\nif (getBit(a_bitset, BITSET_FILL_RANDOM_PATTERN_OFFSET) \x3e 0.5) {\nfloat id \x3d rgba2float(vec4(a_id, 0.0));\ndx \x3d rand(vec2(id, 0.0));\ndy \x3d rand(vec2(0.0, id));\n}\nmat3 patternMatrix \x3d mat3(cosA / width, sinA / height, 0,\n-sinA / width, cosA / height, 0,\ndx, dy, 1);\nvec2 patternSize \x3d vec2(a_width, a_height);\nvec2 numPatternsPerMaxInt \x3d vec2(MAX_REPRESENTABLE_INT) / patternSize;\nvec2 maxIntCrossingOffsetCorrection \x3d patternSize * fract(u_maxIntNumOfCrossing * numPatternsPerMaxInt);\nvec2 tileOffset \x3d u_tileOffset + maxIntCrossingOffsetCorrection - 0.5 * patternSize;\ntileOffset \x3d vec2(tileOffset.x * cosA - tileOffset.y * sinA, tileOffset.x * sinA + tileOffset.y * cosA);\ntileOffset \x3d mod(tileOffset, patternSize);\nvec2 symbolOffset \x3d u_zoomFactor * scale * vec2(a_offset - tileOffset) / vec2(width, height);\nv_tileTextureCoord \x3d (patternMatrix * vec3(a_pos * FILL_POSITION_PRECISION, 1.0)).xy - symbolOffset;\nv_aux1 \x3d a_tlbr / u_mosaicSize.xyxy;\nv_sampleAlphaOnly \x3d getBit(a_bitset, BITSET_GENERIC_CONSIDER_ALPHA_ONLY);\nif (getBit(a_bitSet, BITSET_FILL_HAS_UNRESOLVED_REPLACEMENT_COLOR) \x3e 0.5) {\n#ifdef VV_COLOR\nv_sampleAlphaOnly *\x3d (1.0 - float(isNan(VV_ADATA[ATTR_VV_COLOR]))) * (1.0 - getBit(a_bitSet, BITSET_GENERIC_LOCK_COLOR));\n#else\nv_sampleAlphaOnly \x3d 0.0;\n#endif\n}\n#elif SYMBOLOGY_TYPE \x3d\x3d SYMBOLOGY_TYPE_DOT_DENSITY\nvec4 ddAttributeData0 \x3d getAttributeData2(a_id) * u_isActive[0] * a_inverseArea;\nvec4 ddAttributeData1 \x3d getAttributeData3(a_id) * u_isActive[1] * a_inverseArea;\nfloat size \x3d u_tileZoomFactor * 512.0 * 1.0 / u_pixelRatio;\nv_dotThresholds[0] \x3d dotThreshold(ddAttributeData0, u_dotValue, u_tileDotsOverArea);\nv_dotThresholds[1] \x3d dotThreshold(ddAttributeData1, u_dotValue, u_tileDotsOverArea);\nv_dotTextureCoords \x3d (a_pos * FILL_POSITION_PRECISION + 0.5) / size;\n#endif\n}\n#ifdef HITTEST\nvoid draw(out lowp vec4 out_color, out highp vec3 out_pos) {\n#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE\nif (getBit(a_bitset, BITSET_TYPE_FILL_OUTLINE) \x3e 0.5) {\nout_pos \x3d vec3(0., 0., 2.);\nreturn;\n}\n#endif\nhittestFill(out_color, out_pos);\ngl_PointSize \x3d 1.0;\n}\n#elif defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE)\nvoid draw(out lowp vec4 out_color, out highp vec3 out_pos) {\nv_isOutline \x3d getBit(a_bitset, BITSET_TYPE_FILL_OUTLINE);\nif (v_isOutline \x3e 0.5) {\ndrawLine(out_color, out_pos);\n} else {\ndrawFill(out_color, out_pos);\n}\n}\n#else\n#define draw drawFill\n#endif\nvoid main()\n{\nINIT;\nhighp vec3 pos \x3d vec3(0.);\nhighp vec4 color \x3d vec4(0.);\ndraw(color, pos);\nv_color \x3d color;\ngl_Position \x3d vec4(clip(v_color, pos, getFilterFlags(), a_zoomRange), 1.0);\n}", "hittest.glsl":"#ifdef HITTEST\n#include \x3cmaterials/hittest/common.glsl\x3e\nattribute vec2 a_pos1;\nattribute vec2 a_pos2;\nvoid hittestFill(\nout lowp vec4 out_color,\nout highp vec3 out_pos\n) {\nvec3 pos \x3d u_viewMat3 * u_tileMat3 * vec3(a_pos * FILL_POSITION_PRECISION, 1.);\nvec3 pos1 \x3d u_viewMat3 * u_tileMat3 * vec3(a_pos1 * FILL_POSITION_PRECISION, 1.);\nvec3 pos2 \x3d u_viewMat3 * u_tileMat3 * vec3(a_pos2 * FILL_POSITION_PRECISION, 1.);\nfloat hittestDist \x3d u_hittestDist;\nfloat dist \x3d distPointTriangle(u_hittestPos, pos.xy, pos1.xy, pos2.xy);\nout_pos \x3d vec3(getAttributeDataTextureCoords(a_id), 0.0);\nif (dist \x3c 0. || dist \x3e\x3d hittestDist) {\nout_pos.z +\x3d 2.0;\n}\nout_color \x3d vec4(1. / 255., 0, 0, dist \x3d\x3d 0. ? (1. / 255.) : 0.);\n}\n#endif"}, hittest:{"common.glsl":"#ifdef HITTEST\nuniform float hittestDist;\nuniform highp vec2 hittestPos;\nfloat projectScalar(vec2 a, vec2 b) {\nreturn dot(a, normalize(b));\n}\nfloat distPointSegment(vec2 p0, vec2 p1, vec2 p2) {\nvec2 L \x3d p2 - p1;\nvec2 A \x3d p0 - p1;\nfloat projAL \x3d projectScalar(A, L);\nfloat t \x3d clamp(projAL / length(L), 0., 1.);\nreturn distance(p0, p1 + t * (p2 - p1));\n}\nvoid hittestMarker(out lowp vec4 out_color, out highp vec3 out_pos, in highp vec3 pos, float size) {\nfloat dist \x3d distance(pos, vec3(hittestPos, 1.));\nout_pos \x3d vec3(getAttributeDataTextureCoords(a_id), 0.0);\nif ((dist - size) \x3e hittestDist) {\nout_pos.z +\x3d 2.0;\n}\nout_color \x3d vec4(1. / 255., 0, 0, (dist - size) \x3c 0. ? (1. / 255.) : 0.);\n}\nfloat intersectPointTriangleBary(vec2 p, vec2 a, vec2 b, vec2 c) {\nreturn inTriangle(xyToBarycentric(p, a, b, c));\n}\nfloat distPointTriangle(vec2 p, vec2 a, vec2 b, vec2 c) {\nvec2 ba \x3d b - a;\nvec2 ca \x3d c - a;\nfloat crossProduct \x3d ba.x * ca.y - ca.x * ba.y;\nbool isParallel \x3d crossProduct \x3c EPSILON_HITTEST \x26\x26 crossProduct \x3e -EPSILON_HITTEST;\nif (isParallel) {\nreturn -1.;\n}\nif (intersectPointTriangleBary(p.xy, a, b, c) \x3d\x3d 1.) {\nreturn 0.;\n}\nfloat distAB \x3d distPointSegment(p, a, b);\nfloat distBC \x3d distPointSegment(p, b, c);\nfloat distCA \x3d distPointSegment(p, c, a);\nreturn min(min(distAB, distBC), distCA);\n}\n#endif"}, icon:{"common.glsl":"#include \x3cutil/encoding.glsl\x3e\nuniform lowp vec2 u_mosaicSize;\nvarying lowp vec4 v_color;\nvarying highp vec3 v_id;\nvarying highp vec4 v_sizeTex;\nvarying mediump vec3 v_pos;\nvarying lowp float v_opacity;\nuniform lowp sampler2D u_texture;\n#ifdef SDF\nvarying lowp vec4 v_outlineColor;\nvarying mediump float v_outlineWidth;\nvarying mediump float v_distRatio;\nvarying mediump float v_overridingOutlineColor;\nvarying mediump float v_isThin;\n#endif\n#ifdef SDF\nvec4 getColor(vec2 v_size, vec2 v_tex) {\n#ifdef HITTEST\nlowp vec4 fillPixelColor \x3d vec4(1.0);\n#else\nlowp vec4 fillPixelColor \x3d v_color;\n#endif\nfloat d \x3d 0.5 - rgba2float(texture2D(u_texture, v_tex));\nfloat size \x3d max(v_size.x, v_size.y);\nfloat dist \x3d d * size * SOFT_EDGE_RATIO * v_distRatio;\nfillPixelColor *\x3d clamp(0.5 - dist, 0.0, 1.0);\nfloat outlineWidth \x3d v_outlineWidth;\n#ifdef HIGHLIGHT\noutlineWidth \x3d max(outlineWidth, 4.0 * v_isThin);\n#endif\nif (outlineWidth \x3e 0.25) {\nlowp vec4 outlinePixelColor \x3d v_overridingOutlineColor * v_color + (1.0 - v_overridingOutlineColor) * v_outlineColor;\nfloat clampedOutlineSize \x3d min(outlineWidth, size);\noutlinePixelColor *\x3d clamp(0.5 - abs(dist) + clampedOutlineSize * 0.5, 0.0, 1.0);\nreturn v_opacity * ((1.0 - outlinePixelColor.a) * fillPixelColor + outlinePixelColor);\n}\nreturn v_opacity * fillPixelColor;\n}\n#else\nvec4 getColor(vec2 _v_size, vec2 v_tex) {\nlowp vec4 texColor \x3d texture2D(u_texture, v_tex);\nreturn v_opacity * texColor * v_color;\n}\n#endif", heatmapAccumulate:{"common.glsl":"varying lowp vec4 v_hittestResult;\nvarying mediump vec2 v_offsetFromCenter;\nvarying highp float v_fieldValue;","heatmapAccumulate.frag":"precision mediump float;\n#include \x3cmaterials/icon/heatmapAccumulate/common.glsl\x3e\n#ifdef HEATMAP_PRECISION_HALF_FLOAT\n#define COMPRESSION_FACTOR 0.25\n#else\n#define COMPRESSION_FACTOR 1.0\n#endif\nuniform lowp sampler2D u_texture;\nvoid main() {\n#ifdef HITTEST\ngl_FragColor \x3d v_hittestResult;\n#else\nfloat radius \x3d length(v_offsetFromCenter);\nfloat shapeWeight \x3d step(radius, 1.0);\nfloat oneMinusRadiusSquared \x3d 1.0 - radius * radius;\nfloat kernelWeight \x3d oneMinusRadiusSquared * oneMinusRadiusSquared;\ngl_FragColor \x3d vec4(shapeWeight * kernelWeight * v_fieldValue * COMPRESSION_FACTOR);\n#endif\n}", "heatmapAccumulate.vert":"precision highp float;\nattribute vec2 a_vertexOffset;\nvec4 a_color \x3d vec4(0.0);\nvec2 a_zoomRange \x3d vec2(0.0, 10000.0);\nuniform float u_radius;\nuniform float u_isFieldActive;\n#include \x3cmaterials/vcommon.glsl\x3e\n#include \x3cmaterials/hittest/common.glsl\x3e\n#include \x3cmaterials/icon/heatmapAccumulate/common.glsl\x3e\nvoid main() {\nfloat filterFlags \x3d getFilterFlags();\n#ifdef HITTEST\nhighp vec4 out_hittestResult \x3d vec4(0.);\nhighp vec3 out_pos \x3d vec3(0.);\nvec3 pos \x3d u_viewMat3 * u_tileMat3 * vec3(a_pos * POSITION_PRECISION, 1.0);\nhittestMarker(out_hittestResult, out_pos, pos, u_radius);\nv_hittestResult \x3d out_hittestResult;\ngl_PointSize \x3d 1.;\ngl_Position \x3d vec4(clip(a_color, out_pos, filterFlags, a_zoomRange), 1.0);\n#else\nv_offsetFromCenter \x3d sign(a_vertexOffset);\nv_fieldValue \x3d getAttributeData2(a_id).x * u_isFieldActive + 1.0 - u_isFieldActive;\nvec3 centerPos \x3d u_dvsMat3 * vec3(a_pos * POSITION_PRECISION, 1.0);\nvec3 vertexPos \x3d centerPos + u_displayViewMat3 * vec3(v_offsetFromCenter, 0.0) * u_radius;\ngl_Position \x3d vec4(clip(a_color, vertexPos, filterFlags, a_zoomRange), 1.0);\n#endif\n}"}, "hittest.glsl":"#ifdef HITTEST\n#include \x3cmaterials/hittest/common.glsl\x3e\nattribute vec2 a_vertexOffset1;\nattribute vec2 a_vertexOffset2;\nattribute vec2 a_texCoords1;\nattribute vec2 a_texCoords2;\nvec2 getTextureCoords(in vec3 bary, in vec2 texCoords0, in vec2 texCoords1, in vec2 texCoords2) {\nreturn texCoords0 * bary.x + texCoords1 * bary.y + texCoords2 * bary.z;\n}\nvoid hittestIcon(\ninout lowp vec4 out_color,\nout highp vec3 out_pos,\nin vec3 pos,\nin vec3 offset,\nin vec2 size,\nin float scaleFactor,\nin float isMapAligned\n) {\nout_pos \x3d vec3(getAttributeDataTextureCoords(a_id), 0.0);\nvec3 posBase \x3d u_viewMat3 * u_tileMat3 * pos;\nvec3 offset1 \x3d scaleFactor * vec3(a_vertexOffset1 / 16.0, 0.);\nvec3 offset2 \x3d scaleFactor * vec3(a_vertexOffset2 / 16.0, 0.);\nvec2 pos0 \x3d (posBase + getMatrixNoDisplay(isMapAligned) * offset).xy;\nvec2 pos1 \x3d (posBase + getMatrixNoDisplay(isMapAligned) * offset1).xy;\nvec2 pos2 \x3d (posBase + getMatrixNoDisplay(isMapAligned) * offset2).xy;\nvec3 bary0 \x3d xyToBarycentric(u_hittestPos + vec2(-u_hittestDist, -u_hittestDist), pos0, pos1, pos2);\nvec3 bary1 \x3d xyToBarycentric(u_hittestPos + vec2(0., -u_hittestDist), pos0, pos1, pos2);\nvec3 bary2 \x3d xyToBarycentric(u_hittestPos + vec2(u_hittestDist, -u_hittestDist), pos0, pos1, pos2);\nvec3 bary3 \x3d xyToBarycentric(u_hittestPos + vec2(-u_hittestDist, 0.), pos0, pos1, pos2);\nvec3 bary4 \x3d xyToBarycentric(u_hittestPos, pos0, pos1, pos2);\nvec3 bary5 \x3d xyToBarycentric(u_hittestPos + vec2(u_hittestDist, 0.), pos0, pos1, pos2);\nvec3 bary6 \x3d xyToBarycentric(u_hittestPos + vec2(-u_hittestDist, u_hittestDist), pos0, pos1, pos2);\nvec3 bary7 \x3d xyToBarycentric(u_hittestPos + vec2(0., u_hittestDist), pos0, pos1, pos2);\nvec3 bary8 \x3d xyToBarycentric(u_hittestPos + vec2(u_hittestDist, u_hittestDist), pos0, pos1, pos2);\nvec2 tex0 \x3d a_texCoords / u_mosaicSize;\nvec2 tex1 \x3d a_texCoords1 / u_mosaicSize;\nvec2 tex2 \x3d a_texCoords2 / u_mosaicSize;\nfloat alphaSum \x3d 0.;\nalphaSum +\x3d inTriangle(bary0) * getColor(size, getTextureCoords(bary0, tex0, tex1, tex2)).a;\nalphaSum +\x3d inTriangle(bary1) * getColor(size, getTextureCoords(bary1, tex0, tex1, tex2)).a;\nalphaSum +\x3d inTriangle(bary2) * getColor(size, getTextureCoords(bary2, tex0, tex1, tex2)).a;\nalphaSum +\x3d inTriangle(bary3) * getColor(size, getTextureCoords(bary3, tex0, tex1, tex2)).a;\nalphaSum +\x3d inTriangle(bary4) * getColor(size, getTextureCoords(bary4, tex0, tex1, tex2)).a;\nalphaSum +\x3d inTriangle(bary5) * getColor(size, getTextureCoords(bary5, tex0, tex1, tex2)).a;\nalphaSum +\x3d inTriangle(bary6) * getColor(size, getTextureCoords(bary6, tex0, tex1, tex2)).a;\nalphaSum +\x3d inTriangle(bary7) * getColor(size, getTextureCoords(bary7, tex0, tex1, tex2)).a;\nout_pos.z +\x3d step(alphaSum, .05) * 2.0;\nout_color \x3d vec4(1. / 255., 0., 0., alphaSum / 255.);\n}\n#endif", "icon.frag":"precision mediump float;\n#include \x3cmaterials/constants.glsl\x3e\n#include \x3cmaterials/utils.glsl\x3e\n#include \x3cmaterials/icon/common.glsl\x3e\nvoid main()\n{\n#ifdef HITTEST\nvec4 color \x3d v_color;\n#else\nvec4 color \x3d getColor(v_sizeTex.xy, v_sizeTex.zw);\n#endif\n#ifdef HIGHLIGHT\ncolor.a \x3d step(1.0 / 255.0, color.a);\n#endif\ngl_FragColor \x3d color;\n}","icon.vert":"precision highp float;\nattribute vec4 a_color;\nattribute vec4 a_outlineColor;\nattribute vec4 a_sizeAndOutlineWidth;\nattribute vec2 a_vertexOffset;\nattribute vec2 a_texCoords;\nattribute vec2 a_bitSetAndDistRatio;\nattribute vec2 a_zoomRange;\n#include \x3cmaterials/vcommon.glsl\x3e\n#include \x3cmaterials/icon/common.glsl\x3e\n#include \x3cmaterials/icon/hittest.glsl\x3e\nfloat getMarkerScaleFactor(inout vec2 size, in float referenceSize) {\n#ifdef VV_SIZE\nfloat f \x3d getSize(size.y) / size.y;\nfloat sizeFactor \x3d size.y / referenceSize;\nreturn getSize(referenceSize) / referenceSize;\n#else\nreturn 1.;\n#endif\n}\nvoid main()\n{\nINIT;\nfloat a_bitSet \x3d a_bitSetAndDistRatio.x;\nvec3 pos \x3d vec3(a_pos * POSITION_PRECISION, 1.0);\nvec2 size \x3d a_sizeAndOutlineWidth.xy * a_sizeAndOutlineWidth.xy / 128.0;\nvec3 offset \x3d vec3(a_vertexOffset / 16.0, 0.);\nfloat outlineSize \x3d a_sizeAndOutlineWidth.z * a_sizeAndOutlineWidth.z / 128.0;\nfloat isMapAligned \x3d getBit(a_bitSet, BITSET_MARKER_ALIGNMENT_MAP);\nfloat referenceSize \x3d a_sizeAndOutlineWidth.w * a_sizeAndOutlineWidth.w / 128.0;\nfloat scaleSymbolProportionally \x3d getBit(a_bitSet, BITSET_MARKER_SCALE_SYMBOLS_PROPORTIONALLY);\nfloat scaleFactor \x3d getMarkerScaleFactor(size, referenceSize);\nsize.xy *\x3d scaleFactor;\noffset.xy *\x3d scaleFactor;\noutlineSize *\x3d scaleSymbolProportionally * (scaleFactor - 1.0) + 1.0;\nvec2 v_tex \x3d a_texCoords / u_mosaicSize;\nfloat filterFlags \x3d getFilterFlags();\nv_color \x3d getColor(a_color, a_bitSet, BITSET_GENERIC_LOCK_COLOR);\nv_opacity \x3d getOpacity();\nv_id \x3d norm(a_id);\nv_pos \x3d u_dvsMat3 * pos + getMatrix(isMapAligned) * getRotation() * offset;\nv_sizeTex \x3d vec4(size.xy, v_tex.xy);\n#ifdef SDF\nv_isThin \x3d getBit(a_bitSet, BITSET_MARKER_OUTLINE_ALLOW_COLOR_OVERRIDE);\n#ifdef VV_COLOR\nv_overridingOutlineColor \x3d v_isThin;\n#else\nv_overridingOutlineColor \x3d 0.0;\n#endif\nv_outlineWidth \x3d min(outlineSize, max(max(size.x, size.y) - 0.99, 0.0));\nv_outlineColor \x3d a_outlineColor;\nv_distRatio \x3d a_bitSetAndDistRatio.y / 128.0;\n#endif\n#ifdef HITTEST\nhighp vec4 out_color \x3d vec4(0.);\nhighp vec3 out_pos \x3d vec3(0.);\nhittestIcon(out_color, out_pos, pos, offset, size, scaleFactor, isMapAligned);\nv_color \x3d out_color;\ngl_PointSize \x3d 1.;\ngl_Position \x3d vec4(clip(v_color, out_pos, filterFlags, a_zoomRange), 1.0);\n#else\ngl_Position \x3d vec4(clip(v_color, v_pos, filterFlags, a_zoomRange), 1.0);\n#endif\n}"}, label:{"common.glsl":"uniform mediump float u_zoomLevel;\nuniform mediump float u_mapRotation;\nuniform mediump float u_mapAligned;\nuniform mediump vec2 u_mosaicSize;\nvarying mediump float v_antialiasingWidth;\nvarying mediump float v_edgeDistanceOffset;\nvarying mediump vec2 v_tex;\nvarying mediump vec4 v_color;\nvarying lowp vec4 v_animation;","label.frag":"#include \x3cmaterials/text/text.frag\x3e","label.vert":"precision highp float;\n#include \x3cmaterials/vcommon.glsl\x3e\n#include \x3cmaterials/text/common.glsl\x3e\nattribute vec4 a_color;\nattribute vec4 a_haloColor;\nattribute vec4 a_texAndSize;\nattribute vec4 a_refSymbolAndPlacementOffset;\nattribute vec4 a_glyphData;\nattribute vec2 a_vertexOffset;\nattribute vec2 a_texCoords;\nuniform float u_isHaloPass;\nuniform float u_isBackgroundPass;\nuniform float u_mapRotation;\nuniform float u_mapAligned;\nfloat getZ(in float minZoom, in float maxZoom, in float angle) {\nfloat glyphAngle \x3d angle * 360.0 / 254.0;\nfloat mapAngle \x3d u_mapRotation * 360.0 / 254.0;\nfloat diffAngle \x3d min(360.0 - abs(mapAngle - glyphAngle), abs(mapAngle - glyphAngle));\nfloat z \x3d 0.0;\nz +\x3d u_mapAligned * (2.0 * (1.0 - step(minZoom, u_currentZoom)));\nz +\x3d u_mapAligned * 2.0 * step(90.0, diffAngle);\nz +\x3d 2.0 * (1.0 - step(u_currentZoom, maxZoom));\nreturn z;\n}\nvoid main()\n{\nINIT;\nfloat groupMinZoom \x3d getMinZoom();\nfloat glyphMinZoom \x3d a_glyphData.x;\nfloat glyphMaxZoom \x3d a_glyphData.y;\nfloat glyphAngle \x3d a_glyphData.z;\nfloat a_isBackground \x3d a_glyphData.w;\nfloat a_minZoom \x3d max(groupMinZoom, glyphMinZoom);\nfloat a_placementPadding \x3d a_refSymbolAndPlacementOffset.x * EXTRUDE_SCALE_PLACEMENT_PADDING;\nvec2 a_placementDir \x3d unpack_u8_nf32(a_refSymbolAndPlacementOffset.zw);\nfloat a_refSymbolSize \x3d a_refSymbolAndPlacementOffset.y;\nfloat fontSize \x3d a_texAndSize.z;\nfloat haloSize \x3d a_texAndSize.w * OUTLINE_SCALE;\nvec2 vertexOffset \x3d a_vertexOffset * OFFSET_PRECISION;\nvec3 pos \x3d vec3(a_pos * POSITION_PRECISION, 1.0);\nfloat z \x3d getZ(a_minZoom, glyphMaxZoom, glyphAngle);\nfloat fontScale \x3d fontSize / SDF_FONT_SIZE;\nfloat halfSize \x3d getSize(a_refSymbolSize) / 2.0;\nfloat animation \x3d pow(getAnimationState(), vec4(2.0)).r;\nfloat isText \x3d 1.0 - a_isBackground;\nfloat isBackground \x3d u_isBackgroundPass * a_isBackground;\nvec4 nonHaloColor \x3d (isBackground + isText) * a_color;\nv_color \x3d animation * ((1.0 - u_isHaloPass) * nonHaloColor + (u_isHaloPass * a_haloColor));\nv_opacity \x3d 1.0;\nv_tex \x3d a_texCoords / u_mosaicSize;\nv_edgeDistanceOffset \x3d u_isHaloPass * haloSize / fontScale / MAX_SDF_DISTANCE;\nv_antialiasingWidth \x3d 0.105 * SDF_FONT_SIZE / fontSize / u_pixelRatio;\nvec2 placementOffset \x3d a_placementDir * (halfSize + a_placementPadding);\nvec3 glyphOffset \x3d u_displayMat3 * vec3(vertexOffset + placementOffset, 0.0);\nvec3 v_pos \x3d vec3((u_dvsMat3 * pos + glyphOffset).xy, z);\nfloat isHidden \x3d u_isBackgroundPass * isText + (1.0 - u_isBackgroundPass) * a_isBackground;\nv_pos.z +\x3d 2.0 * isHidden;\ngl_Position \x3d vec4(v_pos, 1.0);\n#ifdef DEBUG\nv_color \x3d vec4(a_color.rgb, z \x3d\x3d 0.0 ? 1.0 : 0.645);\n#endif\n}"}, line:{"common.glsl":"varying lowp vec4 v_color;\nvarying highp vec3 v_id;\nvarying mediump vec2 v_normal;\nvarying mediump float v_lineHalfWidth;\nvarying lowp float v_opacity;\n#ifdef PATTERN\nvarying mediump vec4 v_tlbr;\nvarying mediump vec2 v_patternSize;\n#endif\n#if defined(PATTERN) || defined(SDF)\nvarying highp float v_accumulatedDistance;\n#endif\n#ifdef SDF\nvarying mediump float v_lineWidthRatio;\n#endif","hittest.glsl":"#include \x3cmaterials/hittest/common.glsl\x3e\n#ifdef HITTEST\nattribute vec2 a_pos1;\nattribute vec2 a_pos2;\nvoid hittestLine(out lowp vec4 out_color, out highp vec3 out_pos, float halfWidth) {\nvec3 pos \x3d u_viewMat3 * u_tileMat3 * vec3(a_pos * POSITION_PRECISION, 1.);\nvec3 pos1 \x3d u_viewMat3 * u_tileMat3 * vec3(a_pos1 * POSITION_PRECISION, 1.);\nvec3 pos2 \x3d u_viewMat3 * u_tileMat3 * vec3(a_pos2 * POSITION_PRECISION, 1.);\nvec3 outTextureCoords \x3d vec3(getAttributeDataTextureCoords(a_id), 0.0);\nfloat dist \x3d min(distPointSegment(u_hittestPos, pos.xy, pos1.xy),\ndistPointSegment(u_hittestPos, pos.xy, pos2.xy)) - halfWidth;\nout_pos \x3d vec3(getAttributeDataTextureCoords(a_id), 0.0);\nif (dist \x3e\x3d u_hittestDist) {\nout_pos.z +\x3d 2.0;\n}\nout_color \x3d vec4(1. / 255., 0, 0, dist \x3c\x3d 0. ? (1. / 255.) : 0.);\n}\n#endif", "line.frag":"precision lowp float;\n#include \x3cutil/encoding.glsl\x3e\n#include \x3cmaterials/constants.glsl\x3e\n#include \x3cmaterials/symbologyTypeUtils.glsl\x3e\n#include \x3cmaterials/line/common.glsl\x3e\n#include \x3cmaterials/shared/line/common.glsl\x3e\n#include \x3cmaterials/shared/line/line.frag\x3e\n#ifdef HITTEST\nvoid main() {\ngl_FragColor \x3d v_color;\n}\n#else\nvoid main() {\nLineData inputs \x3d LineData(\nv_color,\nv_normal,\nv_lineHalfWidth,\nv_opacity,\n#ifndef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE\n#ifdef PATTERN\nv_tlbr,\nv_patternSize,\n#endif\n#ifdef SDF\nv_lineWidthRatio,\n#endif\n#if defined(PATTERN) || defined(SDF)\nv_accumulatedDistance,\n#endif\n#endif\nv_id\n);\ngl_FragColor \x3d shadeLine(inputs);\n}\n#endif", "line.vert":"precision highp float;\nattribute vec4 a_color;\nattribute vec4 a_offsetAndNormal;\nattribute vec2 a_accumulatedDistanceAndHalfWidth;\nattribute vec4 a_tlbr;\nattribute vec4 a_segmentDirection;\nattribute vec2 a_aux;\nattribute vec2 a_zoomRange;\n#include \x3cmaterials/vcommon.glsl\x3e\n#include \x3cmaterials/symbologyTypeUtils.glsl\x3e\n#include \x3cmaterials/line/common.glsl\x3e\n#include \x3cmaterials/line/hittest.glsl\x3e\n#include \x3cmaterials/shared/line/common.glsl\x3e\n#include \x3cmaterials/shared/line/line.vert\x3e\n#ifdef HITTEST\nvoid draw() {\nfloat aa \x3d 0.5 * u_antialiasing;\nfloat a_halfWidth \x3d a_accumulatedDistanceAndHalfWidth.y / 16.;\nfloat a_cimHalfWidth \x3d a_aux.x / 16. ;\nvec2 a_offset \x3d a_offsetAndNormal.xy / 16.;\nfloat baseWidth \x3d getBaseLineHalfWidth(a_halfWidth, a_cimHalfWidth);\nfloat halfWidth \x3d getLineHalfWidth(baseWidth, aa);\nhighp vec3 pos \x3d vec3(0.);\nv_color \x3d vec4(0.);\nhittestLine(v_color, pos, halfWidth);\ngl_PointSize \x3d 1.;\ngl_Position \x3d vec4(clip(v_color, pos, getFilterFlags(), a_zoomRange), 1.0);\n}\n#else\nvoid draw()\n{\nhighp vec3 pos \x3d vec3(0.);\nLineData outputs \x3d buildLine(\npos,\na_id,\na_pos,\na_color,\na_offsetAndNormal.xy / 16.,\na_offsetAndNormal.zw / 16.,\na_accumulatedDistanceAndHalfWidth.x,\na_accumulatedDistanceAndHalfWidth.y / 16.,\na_segmentDirection.w,\na_tlbr,\na_segmentDirection.xy / 16.,\na_aux.x / 16.\n);\nv_id \x3d outputs.id;\nv_color \x3d outputs.color;\nv_normal \x3d outputs.normal;\nv_lineHalfWidth \x3d outputs.lineHalfWidth;\nv_opacity \x3d outputs.opacity;\n#ifndef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE\n#ifdef PATTERN\nv_tlbr \x3d outputs.tlbr;\nv_patternSize \x3d outputs.patternSize;\n#endif\n#ifdef SDF\nv_lineWidthRatio \x3d outputs.lineWidthRatio;\n#endif\n#if defined(PATTERN) || defined(SDF)\nv_accumulatedDistance \x3d outputs.accumulatedDistance;\n#endif\n#endif\ngl_Position \x3d vec4(clip(outputs.color, pos, getFilterFlags(), a_zoomRange), 1.0);\n}\n#endif\nvoid main() {\nINIT;\ndraw();\n}"}, pie:{"pie.common.glsl":"uniform float outlineWidth;\nuniform mediump float sectorThreshold;\nvarying vec3 v_id;\nvarying vec3 v_pos;\nvarying vec2 v_offset;\nvarying vec4 v_color;\nvarying float v_size;\nvarying float v_numOfEntries;\nvarying float v_maxSectorAngle;\nvarying vec2 v_filteredSectorToColorId[numberOfFields];\nvarying vec2 v_texCoords;\nvarying float v_outlineWidth;\nvarying float v_opacity;\nstruct FilteredChartInfo {\nfloat endSectorAngle;\nint colorId;\n};","pie.frag":"precision highp float;\n#include \x3cutil/atan2.glsl\x3e\n#include \x3cmaterials/constants.glsl\x3e\n#include \x3cmaterials/utils.glsl\x3e\n#include \x3cmaterials/pie/pie.common.glsl\x3e\nuniform lowp vec4 colors[numberOfFields];\nuniform lowp vec4 defaultColor;\nuniform lowp vec4 othersColor;\nuniform lowp vec4 outlineColor;\nuniform float donutRatio;\nlowp vec4 getSectorColor(in int index, in vec2 filteredSectorToColorId[numberOfFields]) {\nmediump int colorIndex \x3d int(filteredSectorToColorId[index].y);\nreturn colors[colorIndex];\n}\nconst int OTHER_SECTOR_ID \x3d 255;\n#ifdef HITTEST\nvec4 getColor() {\nfloat distanceSize \x3d length(v_offset) * v_size;\nfloat donutSize \x3d donutRatio * v_size;\nfloat alpha \x3d step(donutSize, distanceSize) * (1.0 - step(v_size, distanceSize));\nreturn v_color;\n}\n#else\nvec4 getColor() {\nfloat angle \x3d 90.0 - C_RAD_TO_DEG * atan2(v_offset.y, v_offset.x);\nif (angle \x3c 0.0) {\nangle +\x3d 360.0;\n} else if (angle \x3e 360.0) {\nangle \x3d mod(angle, 360.0);\n}\nint numOfEntries \x3d int(v_numOfEntries);\nfloat maxSectorAngle \x3d v_maxSectorAngle;\nlowp vec4 fillColor \x3d (maxSectorAngle \x3e 0.0 || sectorThreshold \x3e 0.0) ? othersColor : defaultColor;\nlowp vec4 prevColor \x3d vec4(0.0);\nlowp vec4 nextColor \x3d vec4(0.0);\nfloat startSectorAngle \x3d 0.0;\nfloat endSectorAngle \x3d 0.0;\nif (angle \x3c maxSectorAngle) {\nfor (int index \x3d 0; index \x3c numberOfFields; ++index) {\nstartSectorAngle \x3d endSectorAngle;\nendSectorAngle \x3d v_filteredSectorToColorId[index].x;\nif (endSectorAngle \x3e angle) {\nfillColor \x3d getSectorColor(index, v_filteredSectorToColorId);\nprevColor \x3d sectorThreshold !\x3d 0.0 \x26\x26 index \x3d\x3d 0 \x26\x26 abs(360.0 - maxSectorAngle) \x3c EPSILON ? othersColor :\ngetSectorColor(index \x3e 0 ? index - 1 : numOfEntries - 1, v_filteredSectorToColorId);\nnextColor \x3d sectorThreshold !\x3d 0.0 \x26\x26 abs(endSectorAngle - maxSectorAngle) \x3c EPSILON ? othersColor :\ngetSectorColor(index \x3c numOfEntries - 1 ? index + 1 : 0, v_filteredSectorToColorId);\nbreak;\n}\nif (index \x3d\x3d numOfEntries - 1) {\nbreak;\n}\n}\n} else {\nprevColor \x3d getSectorColor(numOfEntries - 1, v_filteredSectorToColorId);\nnextColor \x3d getSectorColor(0, v_filteredSectorToColorId);\nstartSectorAngle \x3d maxSectorAngle;\nendSectorAngle \x3d 360.0;\n}\nlowp vec4 outlineColor \x3d outlineColor;\nfloat offset \x3d length(v_offset);\nfloat distanceSize \x3d offset * v_size;\nif (startSectorAngle !\x3d 0.0 || endSectorAngle !\x3d 360.0) {\nfloat distanceToStartSector \x3d (angle - startSectorAngle);\nfloat distanceToEndSector \x3d (endSectorAngle - angle);\nfloat sectorThreshold \x3d 0.6;\nfloat beginSectorAlpha \x3d smoothstep(0.0, sectorThreshold, distanceToStartSector * offset);\nfloat endSectorAlpha \x3d smoothstep(0.0, sectorThreshold, distanceToEndSector * offset);\nif (endSectorAlpha \x3e 0.0) {\nfillColor \x3d mix(nextColor, fillColor, endSectorAlpha);\n} else if (beginSectorAlpha \x3e 0.0) {\nfillColor \x3d mix(prevColor, fillColor, beginSectorAlpha);\n}\n}\nfloat donutSize \x3d donutRatio * (v_size - v_outlineWidth);\nfloat endOfDonut \x3d donutSize - v_outlineWidth;\nfloat aaThreshold \x3d 0.75;\nfloat innerCircleAlpha \x3d endOfDonut - aaThreshold \x3e 0.0 ? smoothstep(endOfDonut - aaThreshold, endOfDonut + aaThreshold, distanceSize) : 1.0;\nfloat outerCircleAlpha \x3d 1.0 - smoothstep(v_size - aaThreshold, v_size + aaThreshold , distanceSize);\nfloat circleAlpha \x3d innerCircleAlpha * outerCircleAlpha;\nfloat startOfOutline \x3d v_size - v_outlineWidth;\nif (startOfOutline \x3e 0.0 \x26\x26 v_outlineWidth \x3e 0.25) {\nfloat outlineFactor \x3d smoothstep(startOfOutline - aaThreshold, startOfOutline + aaThreshold, distanceSize);\nfloat innerLineFactor \x3d donutSize - aaThreshold \x3e 0.0 ? 1.0 - smoothstep(donutSize - aaThreshold, donutSize + aaThreshold , distanceSize) : 0.0;\nfillColor \x3d mix(fillColor, outlineColor, innerLineFactor + outlineFactor);\n}\nreturn v_opacity * circleAlpha * fillColor;\n}\n#endif\nvoid main()\n{\nvec4 color \x3d getColor();\n#ifdef highlight\ncolor.a \x3d step(1.0 / 255.0, color.a);\n#endif\ngl_FragColor \x3d color;\n}", "pie.vert":"#include \x3cmaterials/constants.glsl\x3e\n#include \x3cmaterials/utils.glsl\x3e\n#include \x3cmaterials/barycentric.glsl\x3e\n#include \x3cmaterials/vcommon.glsl\x3e\n#include \x3cmaterials/vv.glsl\x3e\n#include \x3cmaterials/attributeData.glsl\x3e\n#include \x3cmaterials/pie/pie.common.glsl\x3e\n#include \x3cmaterials/hittest/common.glsl\x3e\nattribute float a_bitSet;\nattribute vec2 a_offset;\nattribute vec2 a_texCoords;\nattribute vec2 a_size;\nattribute float a_referenceSize;\nattribute vec2 a_zoomRange;\nint filterValue(in float sectorAngle,\nin int currentIndex,\ninout FilteredChartInfo filteredInfo,\ninout vec2 filteredSectorToColorId[numberOfFields]) {\nif (sectorAngle \x3e sectorThreshold * 360.0) {\nfilteredInfo.endSectorAngle +\x3d sectorAngle;\nfilteredSectorToColorId[filteredInfo.colorId] \x3d vec2(filteredInfo.endSectorAngle, currentIndex);\n++filteredInfo.colorId;\n}\nreturn 0;\n}\nint filterValues(inout vec2 filteredSectorToColorId[numberOfFields],\ninout FilteredChartInfo filteredInfo,\nin float sectorAngles[numberOfFields]) {\nfor (int index \x3d 0; index \x3c numberOfFields; ++index) {\nfloat sectorValue \x3d sectorAngles[index];\nfilterValue(sectorValue, index, filteredInfo, filteredSectorToColorId);\n}\nreturn filteredInfo.colorId;\n}\nvec2 getMarkerSize(inout vec2 offset, inout vec2 baseSize, inout float outlineSize, in float a_referenceSize, in float bitSet) {\nvec2 outSize \x3d baseSize;\n#ifdef VV_SIZE\nfloat r \x3d getSize(a_referenceSize, currentScale) / a_referenceSize;\noutSize.xy *\x3d r;\noffset.xy *\x3d r;\nfloat scaleSymbolProportionally \x3d getBit(bitSet, BITSET_MARKER_SCALE_SYMBOLS_PROPORTIONALLY);\noutlineSize *\x3d scaleSymbolProportionally * (r - 1.0) + 1.0;\n#endif\nreturn outSize;\n}\nvec3 getOffset(in vec2 in_offset, float a_bitSet) {\nfloat isMapAligned \x3d getBit(a_bitSet, BITSET_MARKER_ALIGNMENT_MAP);\nvec3 offset \x3d vec3(in_offset, 0.0);\nreturn getMatrix(isMapAligned) * offset;\n}\nfloat filterNaNValues(in float value) {\nreturn value !\x3d NAN_MAGIC_NUMBER \x26\x26 value \x3e 0.0 ? value : 0.0;\n}\nvoid main()\n{\nINIT;\nvec2 a_size \x3d a_size;\nvec2 a_offset \x3d a_offset / 16.0;\nfloat outlineSize \x3d outlineWidth;\nfloat a_bitSet \x3d a_bitSet;\nfloat a_referenceSize \x3d a_referenceSize;\nvec2 a_texCoords \x3d a_texCoords / 4.0;\nvec2 markerSize \x3d getMarkerSize(a_offset, a_size, outlineSize, a_referenceSize, a_bitSet);\nfloat filterFlags \x3d getFilterFlags();\nvec3 pos \x3d vec3(a_pos / 10.0, 1.0);\nv_opacity \x3d getOpacity();\nv_id \x3d norm(a_id);\nv_pos \x3d displayViewScreenMat3 * pos + getOffset(a_offset, a_bitSet);\nv_offset \x3d sign(a_texCoords - 0.5);\nv_size \x3d max(markerSize.x, markerSize.y);\nv_outlineWidth \x3d outlineSize;\nfloat attributeData[10];\nvec4 attributeData3 \x3d getDataDriven0(a_id);\nattributeData[0] \x3d filterNaNValues(attributeData3.x);\nattributeData[1] \x3d filterNaNValues(attributeData3.y);\nattributeData[2] \x3d filterNaNValues(attributeData3.z);\nattributeData[3] \x3d filterNaNValues(attributeData3.w);\n#if (numberOfFields \x3e 4)\nvec4 attributeData4 \x3d getDataDriven1(a_id);\nattributeData[4] \x3d filterNaNValues(attributeData4.x);\nattributeData[5] \x3d filterNaNValues(attributeData4.y);\nattributeData[6] \x3d filterNaNValues(attributeData4.z);\nattributeData[7] \x3d filterNaNValues(attributeData4.w);\n#endif\n#if (numberOfFields \x3e 8)\nvec4 attributeData5 \x3d getDataDriven2(a_id);\nattributeData[8] \x3d filterNaNValues(attributeData5.x);\nattributeData[9] \x3d filterNaNValues(attributeData5.y);\n#endif\nfloat sum \x3d 0.0;\nfor (int i \x3d 0; i \x3c numberOfFields; ++i) {\nsum +\x3d attributeData[i];\n}\nfloat sectorAngles[numberOfFields];\nfor (int i \x3d 0; i \x3c numberOfFields; ++i) {\nsectorAngles[i] \x3d 360.0 * attributeData[i] / sum;\n}\nvec2 filteredSectorToColorId[numberOfFields];\nFilteredChartInfo filteredInfo \x3d FilteredChartInfo(0.0, 0);\nint numOfEntries \x3d filterValues(filteredSectorToColorId, filteredInfo, sectorAngles);\nv_numOfEntries \x3d float(numOfEntries);\nv_maxSectorAngle \x3d filteredInfo.endSectorAngle;\nv_filteredSectorToColorId \x3d filteredSectorToColorId;\n#ifdef HITTEST\nhighp vec3 out_pos \x3d vec3(0.0);\nv_color \x3d vec4(0.0);\nhittestMarker(v_color, out_pos, viewMat3 * tileMat3 * pos, v_size);\ngl_PointSize \x3d 1.0;\ngl_Position \x3d vec4(clip(v_color, out_pos, filterFlags, a_zoomRange), 1.0);\n#else\ngl_Position \x3d vec4(clip(v_color, v_pos, filterFlags, a_zoomRange), 1.0);\n#endif\n}"}, shared:{line:{"common.glsl":"#if !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) \x26\x26 defined(PATTERN)\nuniform mediump vec2 u_mosaicSize;\nvarying mediump float v_sampleAlphaOnly;\n#endif\nstruct LineData {\nlowp vec4 color;\nmediump vec2 normal;\nmediump float lineHalfWidth;\nlowp float opacity;\n#ifndef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE\n#ifdef PATTERN\nmediump vec4 tlbr;\nmediump vec2 patternSize;\n#endif\n#ifdef SDF\nmediump float lineWidthRatio;\n#endif\n#if defined(PATTERN) || defined(SDF)\nhighp float accumulatedDistance;\n#endif\n#endif\nhighp vec3 id;\n};", "line.frag":"uniform lowp float u_blur;\n#if !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) \x26\x26 !defined(HIGHLIGHT)\n#if defined(PATTERN) || defined(SDF)\nuniform sampler2D u_texture;\nuniform highp float u_pixelRatio;\n#endif\n#endif\n#if defined(SDF) \x26\x26 !defined(HIGHLIGHT) \x26\x26 !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE)\nlowp vec4 getLineColor(LineData line) {\nmediump float adjustedPatternWidth \x3d line.patternSize.x * 2.0 * line.lineWidthRatio;\nmediump float relativeTexX \x3d fract(line.accumulatedDistance / adjustedPatternWidth);\nmediump float relativeTexY \x3d 0.5 + 0.25 * line.normal.y;\nmediump vec2 texCoord \x3d mix(line.tlbr.xy, line.tlbr.zw, vec2(relativeTexX, relativeTexY));\nmediump float d \x3d rgba2float(texture2D(u_texture, texCoord)) - 0.5;\nfloat dist \x3d d * line.lineHalfWidth;\nreturn line.opacity * clamp(0.5 - dist, 0.0, 1.0) * line.color;\n}\n#elif defined(PATTERN) \x26\x26 !defined(HIGHLIGHT) \x26\x26 !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE)\nlowp vec4 getLineColor(LineData line) {\nmediump float lineHalfWidth \x3d line.lineHalfWidth;\nmediump float adjustedPatternHeight \x3d line.patternSize.y * 2.0 * lineHalfWidth / line.patternSize.x;\nmediump float relativeTexY \x3d fract(line.accumulatedDistance / adjustedPatternHeight);\nmediump float relativeTexX \x3d 0.5 + 0.5 * line.normal.y;\nmediump vec2 texCoord \x3d mix(line.tlbr.xy, line.tlbr.zw, vec2(relativeTexX, relativeTexY));\nlowp vec4 color \x3d texture2D(u_texture, texCoord);\n#ifdef VV_COLOR\nif (v_sampleAlphaOnly \x3e 0.5) {\ncolor.rgb \x3d vec3(color.a);\n}\n#endif\nreturn line.opacity * line.color * color;\n}\n#else\nlowp vec4 getLineColor(LineData line) {\nreturn line.opacity * line.color;\n}\n#endif\nvec4 shadeLine(LineData line)\n{\nmediump float thinLineFactor \x3d max(THIN_LINE_WIDTH_FACTOR * step(line.lineHalfWidth, THIN_LINE_HALF_WIDTH), 1.0);\nmediump float fragDist \x3d length(line.normal) * line.lineHalfWidth;\nlowp float alpha \x3d clamp(thinLineFactor * (line.lineHalfWidth - fragDist) / (u_blur + thinLineFactor - 1.0), 0.0, 1.0);\nlowp vec4 out_color \x3d getLineColor(line) * alpha;\n#ifdef HIGHLIGHT\nout_color.a \x3d step(1.0 / 255.0, out_color.a);\n#endif\n#ifdef ID\nif (out_color.a \x3c 1.0 / 255.0) {\ndiscard;\n}\nout_color \x3d vec4(line.id, 0.0);\n#endif\nreturn out_color;\n}", "line.vert":"float getBaseLineHalfWidth(in float lineHalfWidth, in float referenceHalfWidth) {\n#ifdef VV_SIZE\nfloat refLineWidth \x3d 2.0 * referenceHalfWidth;\nreturn 0.5 * (lineHalfWidth / max(referenceHalfWidth, EPSILON)) * getSize(refLineWidth);\n#else\nreturn lineHalfWidth;\n#endif\n}\nfloat getLineHalfWidth(in float baseWidth, in float aa) {\nfloat halfWidth \x3d max(baseWidth + aa, 0.45) + 0.1 * aa;\n#ifdef HIGHLIGHT\nhalfWidth \x3d max(halfWidth, 2.0);\n#endif\nreturn halfWidth;\n}\nvec2 getDist(in vec2 offset, in float halfWidth) {\nfloat thinLineFactor \x3d max(THIN_LINE_WIDTH_FACTOR * step(halfWidth, THIN_LINE_HALF_WIDTH), 1.0);\nreturn thinLineFactor * halfWidth * offset;\n}\nLineData buildLine(\nout vec3 out_pos,\nin vec3 in_id,\nin vec2 in_pos,\nin vec4 in_color,\nin vec2 in_offset,\nin vec2 in_normal,\nin float in_accumulatedDist,\nin float in_lineHalfWidth,\nin float in_bitSet,\nin vec4 in_tlbr,\nin vec2 in_segmentDirection,\nin float in_referenceHalfWidth\n)\n{\nfloat aa \x3d 0.5 * u_antialiasing;\nfloat baseWidth \x3d getBaseLineHalfWidth(in_lineHalfWidth, in_referenceHalfWidth);\nfloat halfWidth \x3d getLineHalfWidth(baseWidth, aa);\nfloat z \x3d 2.0 * step(baseWidth, 0.0);\nvec2 dist \x3d getDist(in_offset, halfWidth);\nvec3 offset \x3d u_displayViewMat3 * vec3(dist, 0.0);\nvec3 pos \x3d u_dvsMat3 * vec3(in_pos * POSITION_PRECISION, 1.0) + offset;\n#ifdef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE\nvec4 color \x3d in_color;\nfloat opacity \x3d 1.0;\n#else\nvec4 color \x3d getColor(in_color, in_bitSet, BITSET_GENERIC_LOCK_COLOR);\nfloat opacity \x3d getOpacity();\n#ifdef SDF\nconst float SDF_PATTERN_HALF_WIDTH \x3d 15.5;\nfloat scaleDash \x3d getBit(in_bitSet, BITSET_LINE_SCALE_DASH);\nfloat lineWidthRatio \x3d (scaleDash * max(halfWidth - 0.55 * u_antialiasing, 0.25) + (1.0 - scaleDash)) / SDF_PATTERN_HALF_WIDTH;\n#endif\n#endif\n#if !defined(SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE) \x26\x26 defined(PATTERN)\nv_sampleAlphaOnly \x3d getBit(in_bitSet, BITSET_GENERIC_CONSIDER_ALPHA_ONLY);\n#endif\nout_pos \x3d vec3(pos.xy, z);\nreturn LineData(\ncolor,\nin_normal,\nhalfWidth,\nopacity,\n#ifndef SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE\n#ifdef PATTERN\nin_tlbr / u_mosaicSize.xyxy,\nvec2(in_tlbr.z - in_tlbr.x, in_tlbr.w - in_tlbr.y),\n#endif\n#ifdef SDF\nlineWidthRatio,\n#endif\n#if defined(PATTERN) || defined(SDF)\nin_accumulatedDist * u_zoomFactor + dot(in_segmentDirection, dist),\n#endif\n#endif\nnorm(in_id)\n);\n}"}}, "symbologyTypeUtils.glsl":"#if SYMBOLOGY_TYPE \x3d\x3d SYMBOLOGY_TYPE_OUTLINE_FILL || SYMBOLOGY_TYPE \x3d\x3d SYMBOLOGY_TYPE_OUTLINE_FILL_SIMPLE\n#define SYMBOLOGY_TYPE_IS_OUTLINE_FILL_LIKE\n#endif\n#if SYMBOLOGY_TYPE \x3d\x3d SYMBOLOGY_TYPE_SIMPLE || SYMBOLOGY_TYPE \x3d\x3d SYMBOLOGY_TYPE_OUTLINE_FILL_SIMPLE\n#define SYMBOLOGY_TYPE_IS_SIMPLE_LIKE\n#endif",text:{"common.glsl":"uniform highp vec2 u_mosaicSize;\nvarying highp vec3 v_id;\nvarying mediump vec3 v_pos;\nvarying lowp float v_opacity;\nvarying lowp vec4 v_color;\nvarying highp vec2 v_tex;\nvarying mediump float v_antialiasingWidth;\nvarying mediump float v_edgeDistanceOffset;\nvarying lowp float v_transparency;", "hittest.glsl":"#include \x3cmaterials/hittest/common.glsl\x3e","text.frag":"precision mediump float;\n#include \x3cmaterials/text/common.glsl\x3e\nuniform lowp sampler2D u_texture;\n#ifdef HITTEST\nvec4 getColor() {\nreturn v_color;\n}\n#else\nvec4 getColor()\n{\nfloat SDF_CUTOFF \x3d (2.0 / 8.0);\nfloat SDF_BASE_EDGE_DIST \x3d 1.0 - SDF_CUTOFF;\nlowp float dist \x3d texture2D(u_texture, v_tex).a;\nmediump float edge \x3d SDF_BASE_EDGE_DIST - v_edgeDistanceOffset;\n#ifdef HIGHLIGHT\nedge /\x3d 2.0;\n#endif\nlowp float aa \x3d v_antialiasingWidth;\nlowp float alpha \x3d smoothstep(edge - aa, edge + aa, dist);\nreturn alpha * v_color * v_opacity;\n}\n#endif\nvoid main()\n{\ngl_FragColor \x3d getColor();\n}", "text.vert":"precision highp float;\n#include \x3cmaterials/utils.glsl\x3e\n#include \x3cmaterials/vcommon.glsl\x3e\n#include \x3cmaterials/text/common.glsl\x3e\n#include \x3cmaterials/text/hittest.glsl\x3e\nattribute vec4 a_color;\nattribute vec4 a_haloColor;\nattribute vec4 a_texFontSize;\nattribute vec4 a_aux;\nattribute vec2 a_zoomRange;\nattribute vec2 a_vertexOffset;\nattribute vec2 a_texCoords;\nuniform float u_isHaloPass;\nuniform float u_isBackgroundPass;\nfloat getTextSize(inout vec2 offset, inout float baseSize, in float referenceSize) {\n#ifdef VV_SIZE\nfloat r \x3d getSize(referenceSize) / referenceSize;\nbaseSize *\x3d r;\noffset.xy *\x3d r;\nreturn baseSize;\n#endif\nreturn baseSize;\n}\nvoid main()\n{\nINIT;\nfloat a_isBackground \x3d a_aux.y;\nfloat a_referenceSize \x3d a_aux.z * a_aux.z / 256.0;\nfloat a_bitSet \x3d a_aux.w;\nfloat a_fontSize \x3d a_texFontSize.z;\nvec2 a_offset \x3d a_vertexOffset * OFFSET_PRECISION;\nvec3 in_pos \x3d vec3(a_pos * POSITION_PRECISION, 1.0);\nfloat fontSize \x3d getTextSize(a_offset, a_fontSize, a_referenceSize);\nfloat fontScale \x3d fontSize / SDF_FONT_SIZE;\nvec3 offset \x3d getRotation() * vec3(a_offset, 0.0);\nmat3 extrudeMatrix \x3d getBit(a_bitSet, 0) \x3d\x3d 1.0 ? u_displayViewMat3 : u_displayMat3;\nfloat isText \x3d 1.0 - a_isBackground;\nfloat isBackground \x3d u_isBackgroundPass * a_isBackground;\nvec4 nonHaloColor \x3d (isBackground * a_color) + (isText * getColor(a_color, a_bitSet, 1));\nv_color \x3d u_isHaloPass * a_haloColor + (1.0 - u_isHaloPass) * nonHaloColor;\nv_opacity \x3d getOpacity();\nv_id \x3d norm(a_id);\nv_tex \x3d a_texCoords / u_mosaicSize;\nv_pos \x3d u_dvsMat3 * in_pos + extrudeMatrix * offset;\nfloat isHidden \x3d u_isBackgroundPass * isText + (1.0 - u_isBackgroundPass) * a_isBackground;\nv_pos.z +\x3d 2.0 * isHidden;\nv_edgeDistanceOffset \x3d u_isHaloPass * OUTLINE_SCALE * a_texFontSize.w / fontScale / MAX_SDF_DISTANCE;\nv_antialiasingWidth \x3d 0.105 * SDF_FONT_SIZE / fontSize / u_pixelRatio;\n#ifdef HITTEST\nhighp vec3 out_pos \x3d vec3(0.);\nv_color \x3d vec4(0.);\nhittestMarker(v_color, out_pos, u_viewMat3 * u_tileMat3 * vec3(a_pos * POSITION_PRECISION, 1.0)\n+ u_tileMat3 * offset, fontSize / 2.);\ngl_PointSize \x3d 1.;\ngl_Position \x3d vec4(clip(v_color, out_pos, getFilterFlags(), a_zoomRange), 1.0);\n#else\ngl_Position \x3d vec4(clip(v_color, v_pos, getFilterFlags(), a_zoomRange), 1.0);\n#endif\n}"}, "utils.glsl":"float rshift(in float u32, in int amount) {\nreturn floor(u32 / pow(2.0, float(amount)));\n}\nfloat getBit(in float bitset, in int bitIndex) {\nfloat offset \x3d pow(2.0, float(bitIndex));\nreturn mod(floor(bitset / offset), 2.0);\n}\nconst int highlightReasonsLength \x3d 3;\nfloat getFilterBit(in float bitset, in int bitIndex) {\nreturn getBit(bitset, bitIndex + highlightReasonsLength);\n}\nfloat getHighlightBit(in float bitset, in int bitIndex) {\nreturn getBit(bitset, bitIndex);\n}\nhighp vec3 unpackDisplayIdTexel(in highp vec3 bitset) {\nfloat isAggregate \x3d getBit(bitset.b, 7);\nreturn (1.0 - isAggregate) * bitset + isAggregate * (vec3(bitset.rgb) - vec3(0.0, 0.0, float(0x80)));\n}\nvec4 unpack(in float u32) {\nfloat r \x3d mod(rshift(u32, 0), 255.0);\nfloat g \x3d mod(rshift(u32, 8), 255.0);\nfloat b \x3d mod(rshift(u32, 16), 255.0);\nfloat a \x3d mod(rshift(u32, 24), 255.0);\nreturn vec4(r, g, b, a);\n}\nvec3 norm(in vec3 v) {\nreturn v /\x3d 255.0;\n}\nvec4 norm(in vec4 v) {\nreturn v /\x3d 255.0;\n}\nfloat max4(vec4 target) {\nreturn max(max(max(target.x, target.y), target.z), target.w);\n}\nvec2 unpack_u8_nf32(vec2 bytes) {\nreturn (bytes - 127.0) / 127.0;\n}\nhighp float rand(in vec2 co) {\nhighp float a \x3d 12.9898;\nhighp float b \x3d 78.233;\nhighp float c \x3d 43758.5453;\nhighp float dt \x3d dot(co, vec2(a,b));\nhighp float sn \x3d mod(dt, 3.14);\nreturn fract(sin(sn) * c);\n}", "vcommon.glsl":"#include \x3cmaterials/constants.glsl\x3e\n#include \x3cmaterials/utils.glsl\x3e\n#include \x3cmaterials/attributeData.glsl\x3e\n#include \x3cmaterials/vv.glsl\x3e\n#include \x3cmaterials/barycentric.glsl\x3e\nattribute vec2 a_pos;\nattribute highp vec3 a_id;\nuniform highp mat3 displayViewScreenMat3;\nuniform highp mat3 displayViewMat3;\nuniform highp mat3 displayMat3;\nuniform highp mat3 tileMat3;\nuniform highp mat3 viewMat3;\nuniform highp float pixelRatio;\nuniform mediump float zoomFactor;\nuniform mediump float antialiasing;\nuniform mediump float currentScale;\nuniform mediump float currentZoom;\nuniform mediump float metersPerSRUnit;\nvec4 VV_ADATA \x3d vec4(0.0);\nvoid loadVisualVariableData(inout vec4 target) {\ntarget.rgba \x3d getVisualVariableData(a_id);\n}\n#ifdef VV\n#define INIT loadVisualVariableData(VV_ADATA)\n#else\n#define INIT\n#endif\nvec4 getColor(in vec4 a_color, in float a_bitSet, int index) {\n#ifdef VV_COLOR\nfloat isColorLocked \x3d getBit(a_bitSet, index);\nreturn getVVColor(VV_ADATA[ATTR_VV_COLOR], a_color, isColorLocked);\n#else\nreturn a_color;\n#endif\n}\nfloat getOpacity() {\n#ifdef VV_OPACITY\nreturn getVVOpacity(VV_ADATA[ATTR_VV_OPACITY]);\n#else\nreturn 1.0;\n#endif\n}\nfloat getSize(in float in_size, in float currentScale) {\n#ifdef VV_SIZE\nreturn getVVSize(in_size, VV_ADATA[ATTR_VV_SIZE], currentScale);\n#else\nreturn in_size;\n#endif\n}\nmat3 getRotation() {\n#ifdef VV_ROTATION\nreturn getVVRotationMat3(mod(VV_ADATA[ATTR_VV_ROTATION], 360.0));\n#else\nreturn mat3(1.0);\n#endif\n}\nfloat getFilterFlags() {\n#ifdef IGNORES_SAMPLER_PRECISION\nreturn ceil(getFilterData(a_id).x * 255.0);\n#else\nreturn getFilterData(a_id).x * 255.0;\n#endif\n}\nvec4 getAnimationState() {\nreturn getAnimation(a_id);\n}\nfloat getMinZoom() {\nvec4 data0 \x3d getFilterData(a_id) * 255.0;\nreturn data0.g;\n}\nmat3 getMatrixNoDisplay(float isMapAligned) {\nreturn isMapAligned * viewMat3 * tileMat3 + (1.0 - isMapAligned) * tileMat3;\n}\nmat3 getMatrix(float isMapAligned) {\nreturn isMapAligned * displayViewMat3 + (1.0 - isMapAligned) * displayMat3;\n}\nfloat checkHighlightBit(float filterFlags, int index) {\nreturn getHighlightBit(filterFlags, index);\n}\nfloat checkHighlight(float filterFlags) {\nfloat result \x3d checkHighlightBit(filterFlags, 0);\nfor (int i \x3d 1; i \x3c highlightReasonsLength; i++) {\nresult \x3d result + checkHighlightBit(filterFlags, i);\n}\nreturn step(0.1, result);\n}\nvec3 clip(inout vec4 color, inout vec3 pos, in float filterFlags, in vec2 minMaxZoom) {\npos.z +\x3d 2.0 * (1.0 - getFilterBit(filterFlags, 0));\n#ifdef inside\npos.z +\x3d 2.0 * (1.0 - getFilterBit(filterFlags, 1));\n#elif defined(outside)\npos.z +\x3d 2.0 * getFilterBit(filterFlags, 1);\n#elif defined(highlight)\n#if !defined(highlight_all)\npos.z +\x3d 2.0 * (1.0 - checkHighlight(filterFlags));\n#endif\n#endif\npos.z +\x3d 2.0 * (step(minMaxZoom.y, currentZoom) + (1.0 - step(minMaxZoom.x, currentZoom)));\nreturn pos;\n}", "vv.glsl":"#if defined(VV_SIZE_MIN_MAX_VALUE) || defined(VV_SIZE_SCALE_STOPS) || defined(VV_SIZE_FIELD_STOPS) || defined(VV_SIZE_UNIT_VALUE)\n#define VV_SIZE\n#endif\n#if defined(VV_COLOR) || defined(VV_SIZE) || defined(VV_OPACITY) || defined(VV_ROTATION)\n#define VV\n#endif\n#ifdef VV_COLOR\nuniform highp float colorValues[8];\nuniform vec4 colors[8];\n#endif\n#ifdef VV_SIZE_MIN_MAX_VALUE\nuniform highp vec4 minMaxValueAndSize;\n#endif\n#ifdef VV_SIZE_SCALE_STOPS\nuniform highp float values[8];\nuniform float sizes[8];\n#endif\n#ifdef VV_SIZE_FIELD_STOPS\nuniform highp float values[8];\nuniform float sizes[8];\n#endif\n#ifdef VV_SIZE_UNIT_VALUE\nuniform highp float unitMeterRatio;\n#endif\n#ifdef VV_OPACITY\nuniform highp float opacityValues[8];\nuniform float opacities[8];\n#endif\n#ifdef VV_ROTATION\nuniform lowp float rotationType;\n#endif\nbool isNan(float val) {\nreturn (val \x3d\x3d NAN_MAGIC_NUMBER);\n}\n#ifdef VV_SIZE_MIN_MAX_VALUE\nfloat getVVMinMaxSize(float sizeValue, float fallback) {\nif (isNan(sizeValue)) {\nreturn fallback;\n}\nfloat interpolationRatio \x3d (sizeValue - minMaxValueAndSize.x) / (minMaxValueAndSize.y - minMaxValueAndSize.x);\ninterpolationRatio \x3d clamp(interpolationRatio, 0.0, 1.0);\nreturn minMaxValueAndSize.z + interpolationRatio * (minMaxValueAndSize.w - minMaxValueAndSize.z);\n}\n#endif\n#ifdef VV_SIZE_SCALE_STOPS\nfloat getVVScaleStopsSize(float currentScale) {\nfloat outSize;\nif (currentScale \x3c\x3d values[0]) {\noutSize \x3d sizes[0];\n} else {\nif (currentScale \x3e\x3d values[7]) {\noutSize \x3d sizes[7];\n} else {\nint index;\nindex \x3d -1;\nfor (int i \x3d 0; i \x3c 8; i++) {\nif (values[i] \x3e currentScale) {\nindex \x3d i;\nbreak;\n}\n}\nint prevIndex \x3d index - 1;\nfloat a \x3d currentScale - values[prevIndex];\nfloat b \x3d values[index] - values[prevIndex];\noutSize \x3d mix(sizes[prevIndex], sizes[index], a / b);\n}\n}\nreturn outSize;\n}\n#endif\n#ifdef VV_SIZE_FIELD_STOPS\nconst int VV_SIZE_N \x3d 8;\nfloat getVVStopsSize(float sizeValue, float fallback) {\nif (isNan(sizeValue)) {\nreturn fallback;\n}\nif (sizeValue \x3c\x3d values[0]) {\nreturn sizes[0];\n}\nfor (int i \x3d 1; i \x3c VV_SIZE_N; ++i) {\nif (values[i] \x3e\x3d sizeValue) {\nfloat f \x3d (sizeValue - values[i-1]) / (values[i] - values[i-1]);\nreturn mix(sizes[i-1], sizes[i], f);\n}\n}\nreturn sizes[VV_SIZE_N - 1];\n}\n#endif\n#ifdef VV_SIZE_UNIT_VALUE\nfloat getVVUnitValue(float sizeValue, float fallback) {\nif (isNan(sizeValue)) {\nreturn fallback;\n}\nreturn sizeValue * (metersPerSRUnit / unitMeterRatio);\n}\n#endif\n#ifdef VV_OPACITY\nconst int VV_OPACITY_N \x3d 8;\nfloat getVVOpacity(float opacityValue) {\nif (isNan(opacityValue)) {\nreturn 1.0;\n}\nif (opacityValue \x3c\x3d opacityValues[0]) {\nreturn opacities[0];\n}\nfor (int i \x3d 1; i \x3c VV_OPACITY_N; ++i) {\nif (opacityValues[i] \x3e\x3d opacityValue) {\nfloat f \x3d (opacityValue - opacityValues[i-1]) / (opacityValues[i] - opacityValues[i-1]);\nreturn mix(opacities[i-1], opacities[i], f);\n}\n}\nreturn opacities[VV_OPACITY_N - 1];\n}\n#endif\n#ifdef VV_ROTATION\nmat4 getVVRotation(float rotationValue) {\nif (isNan(rotationValue)) {\nreturn mat4(1, 0, 0, 0,\n0, 1, 0, 0,\n0, 0, 1, 0,\n0, 0, 0, 1);\n}\nfloat rotation \x3d rotationValue;\nif (rotationType \x3d\x3d 1.0) {\nrotation \x3d 90.0 - rotation;\n}\nfloat angle \x3d C_DEG_TO_RAD * rotation;\nfloat sinA \x3d sin(angle);\nfloat cosA \x3d cos(angle);\nreturn mat4(cosA, sinA, 0, 0,\n-sinA, cosA, 0, 0,\n0, 0, 1, 0,\n0, 0, 0, 1);\n}\nmat3 getVVRotationMat3(float rotationValue) {\nif (isNan(rotationValue)) {\nreturn mat3(1, 0, 0,\n0, 1, 0,\n0, 0, 1);\n}\nfloat rotation \x3d rotationValue;\nif (rotationType \x3d\x3d 1.0) {\nrotation \x3d 90.0 - rotation;\n}\nfloat angle \x3d C_DEG_TO_RAD * -rotation;\nfloat sinA \x3d sin(angle);\nfloat cosA \x3d cos(angle);\nreturn mat3(cosA, -sinA, 0,\nsinA, cosA, 0,\n0, 0, 1);\n}\n#endif\n#ifdef VV_COLOR\nconst int VV_COLOR_N \x3d 8;\nvec4 getVVColor(float colorValue, vec4 fallback, float isColorLocked) {\nif (isNan(colorValue) || isColorLocked \x3d\x3d 1.0) {\nreturn fallback;\n}\nif (colorValue \x3c\x3d colorValues[0]) {\nreturn colors[0];\n}\nfor (int i \x3d 1; i \x3c VV_COLOR_N; ++i) {\nif (colorValues[i] \x3e\x3d colorValue) {\nfloat f \x3d (colorValue - colorValues[i-1]) / (colorValues[i] - colorValues[i-1]);\nreturn mix(colors[i-1], colors[i], f);\n}\n}\nreturn colors[VV_COLOR_N - 1];\n}\n#endif\nfloat getVVSize(in float size, in float vvSize, in float currentScale) {\n#ifdef VV_SIZE_MIN_MAX_VALUE\nreturn getVVMinMaxSize(vvSize, size);\n#elif defined(VV_SIZE_SCALE_STOPS)\nfloat outSize \x3d getVVScaleStopsSize(currentScale);\nreturn isNan(outSize) ? size : outSize;\n#elif defined(VV_SIZE_FIELD_STOPS)\nfloat outSize \x3d getVVStopsSize(vvSize, size);\nreturn isNan(outSize) ? size : outSize;\n#elif defined(VV_SIZE_UNIT_VALUE)\nreturn getVVUnitValue(vvSize, size);\n#else\nreturn size;\n#endif\n}"}, overlay:{overlay:{"overlay.frag":"precision lowp float;\nuniform lowp sampler2D u_texture;\nuniform lowp float u_opacity;\nvarying mediump vec2 v_uv;\nvoid main() {\nvec4 color \x3d texture2D(u_texture, v_uv);\ngl_FragColor \x3d color * u_opacity;\n}","overlay.vert":"precision mediump float;\nattribute vec2 a_pos;\nattribute vec2 a_uv;\nuniform highp mat3 u_dvsMat3;\nuniform mediump vec2 u_perspective;\nuniform highp float u_wrapAroundShift;\nuniform mediump vec2 u_texSize;\nvarying mediump vec2 v_uv;\nvoid main(void) {\nv_uv \x3d a_uv / u_texSize;\nfloat w \x3d 1.0 + dot(a_uv, u_perspective);\nvec3 pos \x3d u_dvsMat3 * vec3(a_pos + vec2(u_wrapAroundShift, 0.0), 1.0);\ngl_Position \x3d vec4(w * pos.xy, 0.0, w);\n}"}}, "post-processing":{blit:{"blit.frag":"precision mediump float;\nuniform sampler2D u_texture;\nvarying vec2 v_uv;\nvoid main() {\ngl_FragColor \x3d texture2D(u_texture, v_uv);\n}"},bloom:{composite:{"composite.frag":"precision mediump float;\nvarying vec2 v_uv;\nuniform sampler2D u_blurTexture1;\nuniform sampler2D u_blurTexture2;\nuniform sampler2D u_blurTexture3;\nuniform sampler2D u_blurTexture4;\nuniform sampler2D u_blurTexture5;\nuniform float u_bloomStrength;\nuniform float u_bloomRadius;\nuniform float u_bloomFactors[NUMMIPS];\nuniform vec3 u_bloomTintColors[NUMMIPS];\nfloat lerpBloomFactor(const in float factor) {\nfloat mirrorFactor \x3d 1.2 - factor;\nreturn mix(factor, mirrorFactor, u_bloomRadius);\n}\nvoid main() {\nvec4 color \x3d u_bloomStrength * (\nlerpBloomFactor(u_bloomFactors[0]) * vec4(u_bloomTintColors[0], 1.0) * texture2D(u_blurTexture1, v_uv) +\nlerpBloomFactor(u_bloomFactors[1]) * vec4(u_bloomTintColors[1], 1.0) * texture2D(u_blurTexture2, v_uv) +\nlerpBloomFactor(u_bloomFactors[2]) * vec4(u_bloomTintColors[2], 1.0) * texture2D(u_blurTexture3, v_uv) +\nlerpBloomFactor(u_bloomFactors[3]) * vec4(u_bloomTintColors[3], 1.0) * texture2D(u_blurTexture4, v_uv) +\nlerpBloomFactor(u_bloomFactors[4]) * vec4(u_bloomTintColors[4], 1.0) * texture2D(u_blurTexture5, v_uv)\n);\ngl_FragColor \x3d clamp(color, 0.0, 1.0);\n}"}, gaussianBlur:{"gaussianBlur.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nuniform vec2 u_texSize;\nuniform vec2 u_direction;\nvarying vec2 v_uv;\n#define KERNEL_RADIUS RADIUS\n#define SIGMA RADIUS\nfloat gaussianPdf(in float x, in float sigma) {\nreturn 0.39894 * exp(-0.5 * x * x / ( sigma * sigma)) / sigma;\n}\nvoid main() {\nvec2 invSize \x3d 1.0 / u_texSize;\nfloat fSigma \x3d float(SIGMA);\nfloat weightSum \x3d gaussianPdf(0.0, fSigma);\nvec4 pixelColorSum \x3d texture2D(u_colorTexture, v_uv) * weightSum;\nfor (int i \x3d 1; i \x3c KERNEL_RADIUS; i ++) {\nfloat x \x3d float(i);\nfloat w \x3d gaussianPdf(x, fSigma);\nvec2 uvOffset \x3d u_direction * invSize * x;\nvec4 sample1 \x3d texture2D(u_colorTexture, v_uv + uvOffset);\nvec4 sample2 \x3d texture2D(u_colorTexture, v_uv - uvOffset);\npixelColorSum +\x3d (sample1 + sample2) * w;\nweightSum +\x3d 2.0 * w;\n}\ngl_FragColor \x3d pixelColorSum /weightSum;\n}"}, luminosityHighPass:{"luminosityHighPass.frag":"precision mediump float;\nuniform sampler2D u_texture;\nuniform vec3 u_defaultColor;\nuniform float u_defaultOpacity;\nuniform float u_luminosityThreshold;\nuniform float u_smoothWidth;\nvarying vec2 v_uv;\nvoid main() {\nvec4 texel \x3d texture2D(u_texture, v_uv);\nvec3 luma \x3d vec3(0.299, 0.587, 0.114);\nfloat v \x3d dot(texel.xyz, luma);\nvec4 outputColor \x3d vec4(u_defaultColor.rgb, u_defaultOpacity);\nfloat alpha \x3d smoothstep(u_luminosityThreshold, u_luminosityThreshold + u_smoothWidth, v);\ngl_FragColor \x3d mix(outputColor, texel, alpha);\n}"}}, blur:{gaussianBlur:{"gaussianBlur.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nuniform vec2 u_texSize;\nuniform vec2 u_direction;\nuniform float u_sigma;\nvarying vec2 v_uv;\n#define KERNEL_RADIUS RADIUS\nfloat gaussianPdf(in float x, in float sigma) {\nreturn 0.39894 * exp(-0.5 * x * x / ( sigma * sigma)) / sigma;\n}\nvoid main() {\nvec2 invSize \x3d 1.0 / u_texSize;\nfloat fSigma \x3d u_sigma;\nfloat weightSum \x3d gaussianPdf(0.0, fSigma);\nvec4 pixelColorSum \x3d texture2D(u_colorTexture, v_uv) * weightSum;\nfor (int i \x3d 1; i \x3c KERNEL_RADIUS; i ++) {\nfloat x \x3d float(i);\nfloat w \x3d gaussianPdf(x, fSigma);\nvec2 uvOffset \x3d u_direction * invSize * x;\nvec4 sample1 \x3d texture2D(u_colorTexture, v_uv + uvOffset);\nvec4 sample2 \x3d texture2D(u_colorTexture, v_uv - uvOffset);\npixelColorSum +\x3d (sample1 + sample2) * w;\nweightSum +\x3d 2.0 * w;\n}\ngl_FragColor \x3d pixelColorSum /weightSum;\n}"}, "radial-blur":{"radial-blur.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nvarying vec2 v_uv;\nconst float sampleDist \x3d 1.0;\nconst float sampleStrength \x3d 2.2;\nvoid main(void) {\nfloat samples[10];\nsamples[0] \x3d -0.08;\nsamples[1] \x3d -0.05;\nsamples[2] \x3d -0.03;\nsamples[3] \x3d -0.02;\nsamples[4] \x3d -0.01;\nsamples[5] \x3d 0.01;\nsamples[6] \x3d 0.02;\nsamples[7] \x3d 0.03;\nsamples[8] \x3d 0.05;\nsamples[9] \x3d 0.08;\nvec2 dir \x3d 0.5 - v_uv;\nfloat dist \x3d sqrt(dir.x * dir.x + dir.y * dir.y);\ndir \x3d dir / dist;\nvec4 color \x3d texture2D(u_colorTexture,v_uv);\nvec4 sum \x3d color;\nfor (int i \x3d 0; i \x3c 10; i++) {\nsum +\x3d texture2D(u_colorTexture, v_uv + dir * samples[i] * sampleDist);\n}\nsum *\x3d 1.0 / 11.0;\nfloat t \x3d dist * sampleStrength;\nt \x3d clamp(t, 0.0, 1.0);\ngl_FragColor \x3d mix(color, sum, t);\n}"}}, dra:{"dra.frag":"precision mediump float;\nuniform sampler2D u_minColor;\nuniform sampler2D u_maxColor;\nuniform sampler2D u_texture;\nvarying vec2 v_uv;\nvoid main() {\nvec4 minColor \x3d texture2D(u_minColor, vec2(0.5));\nvec4 maxColor \x3d texture2D(u_maxColor, vec2(0.5));\nvec4 color \x3d texture2D(u_texture, v_uv);\nvec3 minColorUnpremultiply \x3d minColor.rgb / minColor.a;\nvec3 maxColorUnpremultiply \x3d maxColor.rgb / maxColor.a;\nvec3 colorUnpremultiply \x3d color.rgb / color.a;\nvec3 range \x3d maxColorUnpremultiply - minColorUnpremultiply;\ngl_FragColor \x3d vec4(color.a * (colorUnpremultiply - minColorUnpremultiply) / range, color.a);\n}", "min-max":{"min-max.frag":"#extension GL_EXT_draw_buffers : require\nprecision mediump float;\n#define CELL_SIZE 2\nuniform sampler2D u_minTexture;\nuniform sampler2D u_maxTexture;\nuniform vec2 u_srcResolution;\nuniform vec2 u_dstResolution;\nvarying vec2 v_uv;\nvoid main() {\nvec2 srcPixel \x3d floor(gl_FragCoord.xy) * float(CELL_SIZE);\nvec2 onePixel \x3d vec2(1.0) / u_srcResolution;\nvec2 uv \x3d (srcPixel + 0.5) / u_srcResolution;\nvec4 minColor \x3d vec4(1.0);\nvec4 maxColor \x3d vec4(0.0);\nfor (int y \x3d 0; y \x3c CELL_SIZE; ++y) {\nfor (int x \x3d 0; x \x3c CELL_SIZE; ++x) {\nvec2 offset \x3d uv + vec2(x, y) * onePixel;\nminColor \x3d min(minColor, texture2D(u_minTexture, offset));\nmaxColor \x3d max(maxColor, texture2D(u_maxTexture, offset));\n}\n}\ngl_FragData[0] \x3d minColor;\ngl_FragData[1] \x3d maxColor;\n}"}}, "drop-shadow":{composite:{"composite.frag":"precision mediump float;\nuniform sampler2D u_layerFBOTexture;\nuniform sampler2D u_blurTexture;\nuniform vec4 u_shadowColor;\nuniform vec2 u_shadowOffset;\nuniform highp mat3 u_displayViewMat3;\nvarying vec2 v_uv;\nvoid main() {\nvec3 offset \x3d u_displayViewMat3 * vec3(u_shadowOffset, 0.0);\nvec4 layerColor \x3d texture2D(u_layerFBOTexture, v_uv);\nvec4 blurColor \x3d texture2D(u_blurTexture, v_uv - offset.xy / 2.0);\ngl_FragColor \x3d ((1.0 - layerColor.a) * blurColor.a * u_shadowColor + layerColor);\n}"}}, "edge-detect":{"frei-chen":{"frei-chen.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nuniform vec2 u_texSize;\nvarying vec2 v_uv;\nvec2 texel \x3d vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y);\nmat3 G[9];\nconst mat3 g0 \x3d mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );\nconst mat3 g1 \x3d mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );\nconst mat3 g2 \x3d mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );\nconst mat3 g3 \x3d mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );\nconst mat3 g4 \x3d mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );\nconst mat3 g5 \x3d mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );\nconst mat3 g6 \x3d mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );\nconst mat3 g7 \x3d mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );\nconst mat3 g8 \x3d mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );\nvoid main() {\nG[0] \x3d g0,\nG[1] \x3d g1,\nG[2] \x3d g2,\nG[3] \x3d g3,\nG[4] \x3d g4,\nG[5] \x3d g5,\nG[6] \x3d g6,\nG[7] \x3d g7,\nG[8] \x3d g8;\nmat3 I;\nfloat cnv[9];\nvec3 sample;\nfor (float i \x3d 0.0; i \x3c 3.0; i++) {\nfor (float j \x3d 0.0; j \x3c 3.0; j++) {\nsample \x3d texture2D(u_colorTexture, v_uv + texel * vec2(i - 1.0,j - 1.0)).rgb;\nI[int(i)][int(j)] \x3d length(sample);\n}\n}\nfor (int i \x3d 0; i \x3c 9; i++) {\nfloat dp3 \x3d dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);\ncnv[i] \x3d dp3 * dp3;\n}\nfloat M \x3d (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);\nfloat S \x3d (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);\ngl_FragColor \x3d vec4(vec3(sqrt(M / S)), texture2D(u_colorTexture, v_uv).a);\n}"}, sobel:{"sobel.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nvarying vec2 v_uv;\nuniform vec2 u_texSize;\nvec2 texel \x3d vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y);\nmat3 G[2];\nconst mat3 g0 \x3d mat3( 1.0, 2.0, 1.0, 0.0, 0.0, 0.0, -1.0, -2.0, -1.0 );\nconst mat3 g1 \x3d mat3( 1.0, 0.0, -1.0, 2.0, 0.0, -2.0, 1.0, 0.0, -1.0 );\nvoid main() {\nmat3 I;\nfloat cnv[2];\nvec3 sample;\nG[0] \x3d g0;\nG[1] \x3d g1;\nfor (float i \x3d 0.0; i \x3c 3.0; i++) {\nfor (float j \x3d 0.0; j \x3c 3.0; j++) {\nsample \x3d texture2D( u_colorTexture, v_uv + texel * vec2(i-1.0,j-1.0) ).rgb;\nI[int(i)][int(j)] \x3d length(sample);\n}\n}\nfor (int i \x3d 0; i \x3c 2; i++) {\nfloat dp3 \x3d dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);\ncnv[i] \x3d dp3 * dp3;\n}\ngl_FragColor \x3d vec4(vec3(0.5 * sqrt(cnv[0] * cnv[0] + cnv[1] * cnv[1])), texture2D(u_colorTexture, v_uv).a);\n}"}}, "edge-enhance":{"edge-enhance.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nvarying vec2 v_uv;\nuniform vec2 u_texSize;\nvec2 texel \x3d vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y);\nmat3 G[2];\nconst mat3 g0 \x3d mat3( 1.0, 0.0, -1.0, 1.0, 0.0, -1.0, 1.0, 0.0, -1.0 );\nconst mat3 g1 \x3d mat3( 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, -1.0, -1.0, -1.0 );\nvoid main() {\nmat3 I;\nfloat cnv[2];\nvec3 sample;\nG[0] \x3d g0;\nG[1] \x3d g1;\nfor (float i \x3d 0.0; i \x3c 3.0; i++) {\nfor (float j \x3d 0.0; j \x3c 3.0; j++) {\nsample \x3d texture2D( u_colorTexture, v_uv + texel * vec2(i-1.0,j-1.0) ).rgb;\nI[int(i)][int(j)] \x3d length(sample);\n}\n}\nfor (int i \x3d 0; i \x3c 2; i++) {\nfloat dp3 \x3d dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);\ncnv[i] \x3d dp3 * dp3;\n}\nvec4 color \x3d texture2D(u_colorTexture, v_uv);\ngl_FragColor \x3d vec4(0.5 * sqrt(cnv[0] * cnv[0] + cnv[1] * cnv[1]) * color);\n}"}, filterEffect:{"filterEffect.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nuniform mat4 u_coefficients;\nvarying vec2 v_uv;\nvoid main() {\nvec4 color \x3d texture2D(u_colorTexture, v_uv);\nvec4 rgbw \x3d u_coefficients * vec4(color.a \x3e 0.0 ? color.rgb / color.a : vec3(0.0), 1.0);\nfloat a \x3d color.a;\ngl_FragColor \x3d vec4(a * rgbw.rgb, a);\n}"},pp:{"pp.vert":"precision mediump float;\nattribute vec2 a_position;\nvarying vec2 v_uv;\nvoid main() {\ngl_Position \x3d vec4(a_position, 0.0, 1.0);\nv_uv \x3d (a_position + 1.0) / 2.0;\n}"}}, raster:{bitmap:{"bitmap.frag":"precision mediump float;\nvarying highp vec2 v_texcoord;\nuniform sampler2D u_texture;\nuniform highp vec2 u_coordScale;\nuniform lowp float u_opacity;\n#include \x3cfiltering/bicubic.glsl\x3e\nvoid main() {\n#ifdef BICUBIC\nvec4 color \x3d sampleBicubicBSpline(u_texture, v_texcoord, u_coordScale);\n#else\nvec4 color \x3d texture2D(u_texture, v_texcoord);\n#endif\ngl_FragColor \x3d vec4(color.rgb * u_opacity, color.a * u_opacity);\n}","bitmap.vert":"precision mediump float;\nattribute vec2 a_pos;\nuniform highp mat3 u_dvsMat3;\nuniform highp vec2 u_coordScale;\nvarying highp vec2 v_texcoord;\nvoid main()\n{\nv_texcoord \x3d a_pos;\ngl_Position \x3d vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0);\n}"}, common:{"common.glsl":"uniform sampler2D u_image;\nuniform int u_bandCount;\nuniform bool u_flipY;\nuniform float u_opacity;\nuniform int u_resampling;\nuniform vec2 u_srcImageSize;\n#ifdef APPLY_PROJECTION\n#include \x3craster/common/projection.glsl\x3e\n#endif\n#ifdef BICUBIC\n#include \x3cfiltering/bicubic.glsl\x3e\n#endif\n#ifdef BILINEAR\n#include \x3cfiltering/bilinear.glsl\x3e\n#endif\nvec2 getPixelLocation(vec2 coords) {\nvec2 targetLocation \x3d u_flipY ? vec2(coords.s, 1.0 - coords.t) : coords;\n#ifdef APPLY_PROJECTION\ntargetLocation \x3d projectPixelLocation(targetLocation);\n#endif\nreturn targetLocation;\n}\nbool isOutside(vec2 coords){\nif (coords.t\x3e1.00001 ||coords.t\x3c-0.00001 || coords.s\x3e1.00001 ||coords.s\x3c-0.00001) {\nreturn true;\n} else {\nreturn false;\n}\n}\nvec4 getPixel(vec2 pixelLocation) {\n#ifdef BICUBIC\nvec4 color \x3d sampleBicubicBSpline(u_image, pixelLocation, u_srcImageSize);\n#elif defined(BILINEAR)\nvec4 color \x3d sampleBilinear(u_image, pixelLocation, u_srcImageSize);\n#else\nvec4 color \x3d texture2D(u_image, pixelLocation);\n#endif\nreturn color;\n}", "common.vert":"precision mediump float;\nattribute vec2 a_pos;\nuniform highp mat3 u_dvsMat3;\nuniform highp vec2 u_coordScale;\nuniform highp float u_scale;\nuniform highp vec2 u_offset;\nvarying highp vec2 v_texcoord;\nvoid main()\n{\nv_texcoord \x3d a_pos * u_scale + u_offset;\ngl_Position \x3d vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0);\n}","contrastBrightness.glsl":"uniform float u_contrastOffset;\nuniform float u_brightnessOffset;\nvec4 adjustContrastBrightness(vec4 currentPixel, bool isFloat) {\nvec4 pixelValue \x3d isFloat ? currentPixel * 255.0 : currentPixel;\nfloat maxI \x3d 255.0;\nfloat mid \x3d 128.0;\nfloat c \x3d u_contrastOffset;\nfloat b \x3d u_brightnessOffset;\nvec4 v;\nif (c \x3e 0.0 \x26\x26 c \x3c 100.0) {\nv \x3d (200.0 * pixelValue - 100.0 * maxI + 2.0 * maxI * b) / (2.0 * (100.0 - c)) + mid;\n} else if (c \x3c\x3d 0.0 \x26\x26 c \x3e -100.0) {\nv \x3d (200.0 * pixelValue - 100.0 * maxI + 2.0 * maxI * b) * (100.0 + c) / 20000.0 + mid;\n} else if (c \x3d\x3d 100.0) {\nv \x3d (200.0 * pixelValue - 100.0 * maxI + (maxI + 1.0) * (100.0 - c) + 2.0 * maxI * b);\nv \x3d (sign(v) + 1.0) / 2.0;\n} else if (c \x3d\x3d -100.0) {\nv \x3d vec4(mid, mid, mid, currentPixel.a);\n}\nvec3 rgb \x3d clamp(v.rgb / 255.0, 0.0, 1.0);\nreturn vec4(rgb, currentPixel.a);\n}", "getSurfaceValues.glsl":"#include \x3craster/common/mirror.glsl\x3e\nvoid getSurfaceValues(sampler2D imageTexture, vec2 texCoord, vec2 srcImageSize, inout float values[10]) {\nvec2 onePixel \x3d 1.0 / srcImageSize;\nvec4 va \x3d texture2D(imageTexture, mirror(texCoord + onePixel * vec2(-1.0, -1.0)));\nvec4 vb \x3d texture2D(imageTexture, mirror(texCoord + onePixel * vec2(0.0, -1.0)));\nvec4 vc \x3d texture2D(imageTexture, mirror(texCoord + onePixel * vec2(1.0, -1.0)));\nvec4 vd \x3d texture2D(imageTexture, mirror(texCoord + onePixel * vec2(-1.0, 0.0)));\nvec4 ve \x3d texture2D(imageTexture, mirror(texCoord));\nvec4 vf \x3d texture2D(imageTexture, mirror(texCoord + onePixel * vec2(1.0, 0.0)));\nvec4 vg \x3d texture2D(imageTexture, mirror(texCoord + onePixel * vec2(-1.0, 1.0)));\nvec4 vh \x3d texture2D(imageTexture, mirror(texCoord + onePixel * vec2(0.0, 1.0)));\nvec4 vi \x3d texture2D(imageTexture, mirror(texCoord + onePixel * vec2(1.0, 1.0)));\nfloat alpha \x3d va.a * vb.a * vc.a * vd.a * ve.a * vf.a * vg.a * vh.a * vi.a;\nvalues[0] \x3d va.r;\nvalues[1] \x3d vb.r;\nvalues[2] \x3d vc.r;\nvalues[3] \x3d vd.r;\nvalues[4] \x3d ve.r;\nvalues[5] \x3d vf.r;\nvalues[6] \x3d vg.r;\nvalues[7] \x3d vh.r;\nvalues[8] \x3d vi.r;\nvalues[9] \x3d alpha;\n}", "inverse.glsl":"float invertValue(float value) {\nfloat s \x3d sign(value);\nreturn (s * s) / (value + abs(s) - 1.0);\n}","mirror.glsl":"vec2 mirror(vec2 pos) {\nvec2 pos1 \x3d abs(pos);\nreturn step(pos1, vec2(1.0, 1.0)) * pos1 + step(1.0, pos1) * (2.0 - pos1);\n}","projection.glsl":"uniform sampler2D u_transformGrid;\nuniform vec2 u_transformSpacing;\nuniform vec2 u_transformGridSize;\nuniform vec2 u_targetImageSize;\nvec2 projectPixelLocation(vec2 coords) {\n#ifdef LOOKUP_PROJECTION\nvec4 pv \x3d texture2D(u_transformGrid, coords);\nreturn vec2(pv.r, pv.g);\n#endif\nvec2 index_image \x3d floor(coords * u_targetImageSize);\nvec2 oneTransformPixel \x3d vec2(0.25 / u_transformGridSize.s, 1.0 / u_transformGridSize.t);\nvec2 index_transform \x3d floor(index_image / u_transformSpacing) / u_transformGridSize;\nvec2 pos \x3d fract((index_image + vec2(0.5, 0.5)) / u_transformSpacing);\nvec2 srcLocation;\nvec2 transform_location \x3d index_transform + oneTransformPixel * 0.5;\nif (pos.s \x3c\x3d pos.t) {\nvec4 ll_abc \x3d texture2D(u_transformGrid, vec2(transform_location.s, transform_location.t));\nvec4 ll_def \x3d texture2D(u_transformGrid, vec2(transform_location.s + oneTransformPixel.s, transform_location.t));\nsrcLocation.s \x3d dot(ll_abc.rgb, vec3(pos, 1.0));\nsrcLocation.t \x3d dot(ll_def.rgb, vec3(pos, 1.0));\n} else {\nvec4 ur_abc \x3d texture2D(u_transformGrid, vec2(transform_location.s + 2.0 * oneTransformPixel.s, transform_location.t));\nvec4 ur_def \x3d texture2D(u_transformGrid, vec2(transform_location.s + 3.0 * oneTransformPixel.s, transform_location.t));\nsrcLocation.s \x3d dot(ur_abc.rgb, vec3(pos, 1.0));\nsrcLocation.t \x3d dot(ur_def.rgb, vec3(pos, 1.0));\n}\nreturn srcLocation;\n}"}, flow:{"getFadeOpacity.glsl":"uniform float u_decayRate;\nuniform float u_fadeToZero;\nfloat getFadeOpacity(float x) {\nfloat cutOff \x3d mix(0.0, exp(-u_decayRate), u_fadeToZero);\nreturn (exp(-u_decayRate * x) - cutOff) / (1.0 - cutOff);\n}","getFragmentColor.glsl":"vec4 getFragmentColor(vec4 color, float dist, float size, float featheringSize) {\nfloat featheringStart \x3d clamp(0.5 - featheringSize / size, 0.0, 0.5);\nif (dist \x3e featheringStart) {\ncolor *\x3d 1.0 - (dist - featheringStart) / (0.5 - featheringStart);\n}\nreturn color;\n}", imagery:{"imagery.frag":"precision highp float;\nvarying vec2 v_texcoord;\nuniform sampler2D u_texture;\nuniform float u_Min;\nuniform float u_Max;\nuniform float u_featheringSize;\n#include \x3craster/flow/vv.glsl\x3e\nfloat getIntensity(float v) {\nreturn u_Min + v * (u_Max - u_Min);\n}\nvoid main(void) {\nvec4 sampled \x3d texture2D(u_texture, v_texcoord);\nfloat intensity \x3d getIntensity(sampled.r);\ngl_FragColor \x3d getColor(intensity);\ngl_FragColor.a *\x3d getOpacity(sampled.r);\ngl_FragColor.a *\x3d sampled.a;\ngl_FragColor.rgb *\x3d gl_FragColor.a;\n}", "imagery.vert":"attribute vec2 a_position;\nattribute vec2 a_texcoord;\nuniform mat3 u_dvsMat3;\nvarying vec2 v_texcoord;\nvoid main(void) {\nvec2 xy \x3d (u_dvsMat3 * vec3(a_position, 1.0)).xy;\ngl_Position \x3d vec4(xy, 0.0, 1.0);\nv_texcoord \x3d a_texcoord;\n}"},particles:{"particles.frag":"precision highp float;\nvarying vec4 v_color;\nvarying vec2 v_texcoord;\nvarying float v_size;\nuniform float u_featheringSize;\n#include \x3craster/flow/getFragmentColor.glsl\x3e\nvoid main(void) {\ngl_FragColor \x3d getFragmentColor(v_color, length(v_texcoord - 0.5), v_size, u_featheringSize);\n}", "particles.vert":"attribute vec4 a_xyts0;\nattribute vec4 a_xyts1;\nattribute vec4 a_typeIdDurationSeed;\nattribute vec4 a_extrudeInfo;\nuniform mat3 u_dvsMat3;\nuniform mat3 u_displayViewMat3;\nuniform float u_time;\nuniform float u_trailLength;\nuniform float u_flowSpeed;\nvarying vec4 v_color;\nvarying vec2 v_texcoord;\nvarying float v_size;\nuniform float u_featheringSize;\nuniform float u_introFade;\n#include \x3craster/flow/vv.glsl\x3e\n#include \x3craster/flow/getFadeOpacity.glsl\x3e\nvoid main(void) {\nvec2 position0 \x3d a_xyts0.xy;\nfloat t0 \x3d a_xyts0.z;\nfloat speed0 \x3d a_xyts0.w;\nvec2 position1 \x3d a_xyts1.xy;\nfloat t1 \x3d a_xyts1.z;\nfloat speed1 \x3d a_xyts1.w;\nfloat type \x3d a_typeIdDurationSeed.x;\nfloat id \x3d a_typeIdDurationSeed.y;\nfloat duration \x3d a_typeIdDurationSeed.z;\nfloat seed \x3d a_typeIdDurationSeed.w;\nvec2 e0 \x3d a_extrudeInfo.xy;\nvec2 e1 \x3d a_extrudeInfo.zw;\nfloat animationPeriod \x3d duration + u_trailLength;\nfloat scaledTime \x3d u_time * u_flowSpeed;\nfloat randomizedTime \x3d scaledTime + seed * animationPeriod;\nfloat t \x3d mod(randomizedTime, animationPeriod);\nfloat fUnclamped \x3d (t - t0) / (t1 - t0);\nfloat f \x3d clamp(fUnclamped, 0.0, 1.0);\nfloat clampedTime \x3d mix(t0, t1, f);\nfloat speed \x3d mix(speed0, speed1, f);\nvec2 extrude;\nvec2 position;\nfloat fadeOpacity;\nfloat introOpacity;\nif (type \x3d\x3d 2.0) {\nif (fUnclamped \x3c 0.0 || (fUnclamped \x3e 1.0 \x26\x26 t1 !\x3d duration)) {\ngl_Position \x3d vec4(0.0, 0.0, -2.0, 1.0);\nreturn;\n}\nvec2 ortho \x3d mix(e0, e1, f);\nvec2 parallel;\nparallel \x3d normalize(position1 - position0) * 0.5;\nif (id \x3d\x3d 1.0) {\nextrude \x3d ortho;\nv_texcoord \x3d vec2(0.5, 0.0);\n} else if (id \x3d\x3d 2.0) {\nextrude \x3d -ortho;\nv_texcoord \x3d vec2(0.5, 1.0);\n} else if (id \x3d\x3d 3.0) {\nextrude \x3d ortho + parallel;\nv_texcoord \x3d vec2(1.0, 0.0);\n} else if (id \x3d\x3d 4.0) {\nextrude \x3d -ortho + parallel;\nv_texcoord \x3d vec2(1.0, 1.0);\n}\nfadeOpacity \x3d getFadeOpacity((t - clampedTime) / u_trailLength);\nintroOpacity \x3d 1.0 - exp(-clampedTime);\nv_size \x3d getSize(speed);\nv_color \x3d getColor(speed);\nv_color.a *\x3d getOpacity(speed);\nposition \x3d mix(position0, position1, f);\n} else {\nif (fUnclamped \x3c 0.0) {\ngl_Position \x3d vec4(0.0, 0.0, -2.0, 1.0);\nreturn;\n}\nif (id \x3d\x3d 1.0) {\nextrude \x3d e0;\nv_texcoord \x3d vec2(0.5, 0.0);\nfadeOpacity \x3d getFadeOpacity((t - t0) / u_trailLength);\nintroOpacity \x3d 1.0 - exp(-t0);\nv_size \x3d getSize(speed0);\nv_color \x3d getColor(speed0);\nv_color.a *\x3d getOpacity(speed0);\nposition \x3d position0;\n} else if (id \x3d\x3d 2.0) {\nextrude \x3d -e0;\nv_texcoord \x3d vec2(0.5, 1.0);\nfadeOpacity \x3d getFadeOpacity((t - t0) / u_trailLength);\nintroOpacity \x3d 1.0 - exp(-t0);\nv_size \x3d getSize(speed0);\nv_color \x3d getColor(speed0);\nv_color.a *\x3d getOpacity(speed0);\nposition \x3d position0;\n} else if (id \x3d\x3d 3.0) {\nextrude \x3d mix(e0, e1, f);\nv_texcoord \x3d vec2(0.5, 0.0);\nfadeOpacity \x3d getFadeOpacity((t - clampedTime) / u_trailLength);\nintroOpacity \x3d 1.0 - exp(-clampedTime);\nv_size \x3d getSize(speed);\nv_color \x3d getColor(speed);\nv_color.a *\x3d getOpacity(speed);\nposition \x3d mix(position0, position1, f);\n} else if (id \x3d\x3d 4.0) {\nextrude \x3d -mix(e0, e1, f);\nv_texcoord \x3d vec2(0.5, 1.0);\nfadeOpacity \x3d getFadeOpacity((t - clampedTime) / u_trailLength);\nintroOpacity \x3d 1.0 - exp(-clampedTime);\nv_size \x3d getSize(speed);\nv_color \x3d getColor(speed);\nv_color.a *\x3d getOpacity(speed);\nposition \x3d mix(position0, position1, f);\n}\n}\nvec2 xy \x3d (u_dvsMat3 * vec3(position, 1.0) + u_displayViewMat3 * vec3(extrude * v_size, 0.0)).xy;\ngl_Position \x3d vec4(xy, 0.0, 1.0);\nv_color.a *\x3d fadeOpacity;\nv_color.a *\x3d mix(1.0, introOpacity, u_introFade);\nv_color.rgb *\x3d v_color.a;\n}"}, streamlines:{"streamlines.frag":"precision highp float;\nvarying float v_side;\nvarying float v_time;\nvarying float v_totalTime;\nvarying float v_timeSeed;\nvarying vec4 v_color;\nvarying float v_size;\nuniform float u_time;\nuniform float u_trailLength;\nuniform float u_flowSpeed;\nuniform float u_featheringSize;\nuniform float u_introFade;\n#include \x3craster/flow/getFragmentColor.glsl\x3e\n#include \x3craster/flow/getFadeOpacity.glsl\x3e\nvoid main(void) {\nfloat t \x3d mod(v_timeSeed * (v_totalTime + u_trailLength) + u_time * u_flowSpeed, v_totalTime + u_trailLength) - v_time;\nvec4 color \x3d v_color * step(0.0, t) * getFadeOpacity(t / u_trailLength);\ncolor *\x3d mix(1.0, 1.0 - exp(-v_time), u_introFade);\ngl_FragColor \x3d getFragmentColor(color, length((v_side + 1.0) / 2.0 - 0.5), v_size, u_featheringSize);\n}", "streamlines.vert":"attribute vec3 a_positionAndSide;\nattribute vec3 a_timeInfo;\nattribute vec2 a_extrude;\nattribute float a_speed;\nuniform mat3 u_dvsMat3;\nuniform mat3 u_displayViewMat3;\nvarying float v_time;\nvarying float v_totalTime;\nvarying float v_timeSeed;\nvarying vec4 v_color;\nvarying float v_side;\nvarying float v_size;\nuniform float u_featheringSize;\n#include \x3craster/flow/vv.glsl\x3e\nvoid main(void) {\nvec4 lineColor \x3d getColor(a_speed);\nfloat lineOpacity \x3d getOpacity(a_speed);\nfloat lineSize \x3d getSize(a_speed);\nvec2 position \x3d a_positionAndSide.xy;\nv_side \x3d a_positionAndSide.z;\nvec2 xy \x3d (u_dvsMat3 * vec3(position, 1.0) + u_displayViewMat3 * vec3(a_extrude * lineSize, 0.0)).xy;\ngl_Position \x3d vec4(xy, 0.0, 1.0);\nv_time \x3d a_timeInfo.x;\nv_totalTime \x3d a_timeInfo.y;\nv_timeSeed \x3d a_timeInfo.z;\nv_color \x3d lineColor;\nv_color.a *\x3d lineOpacity;\nv_color.rgb *\x3d v_color.a;\nv_size \x3d lineSize;\n}"}, "vv.glsl":"#define MAX_STOPS 8\n#ifdef VV_COLOR\nuniform float u_color_stops[MAX_STOPS];\nuniform vec4 u_color_values[MAX_STOPS];\nuniform int u_color_count;\n#else\nuniform vec4 u_color;\n#endif\n#ifdef VV_OPACITY\nuniform float u_opacity_stops[MAX_STOPS];\nuniform float u_opacity_values[MAX_STOPS];\nuniform int u_opacity_count;\n#else\nuniform float u_opacity;\n#endif\n#ifdef VV_SIZE\nuniform float u_size_stops[MAX_STOPS];\nuniform float u_size_values[MAX_STOPS];\nuniform int u_size_count;\n#else\nuniform float u_size;\n#endif\nuniform float u_featheringOffset;\nvec4 getColor(float x) {\n#ifdef VV_COLOR\nvec4 color \x3d u_color_values[0];\n{\nfor (int i \x3d 1; i \x3c MAX_STOPS; i++) {\nif (i \x3e\x3d u_color_count) {\nbreak;\n}\nfloat x1 \x3d u_color_stops[i - 1];\nif (x \x3c x1) {\nbreak;\n}\nfloat x2 \x3d u_color_stops[i];\nvec4 y2 \x3d u_color_values[i];\nif (x \x3c x2) {\nvec4 y1 \x3d u_color_values[i - 1];\ncolor \x3d y1 + (y2 - y1) * (x - x1) / (x2 - x1);\n} else {\ncolor \x3d y2;\n}\n}\n}\n#else\nvec4 color \x3d u_color;\n#endif\nreturn color;\n}\nfloat getOpacity(float x) {\n#ifdef VV_OPACITY\nfloat opacity \x3d u_opacity_values[0];\n{\nfor (int i \x3d 1; i \x3c MAX_STOPS; i++) {\nif (i \x3e\x3d u_opacity_count) {\nbreak;\n}\nfloat x1 \x3d u_opacity_stops[i - 1];\nif (x \x3c x1) {\nbreak;\n}\nfloat x2 \x3d u_opacity_stops[i];\nfloat y2 \x3d u_opacity_values[i];\nif (x \x3c x2) {\nfloat y1 \x3d u_opacity_values[i - 1];\nopacity \x3d y1 + (y2 - y1) * (x - x1) / (x2 - x1);\n} else {\nopacity \x3d y2;\n}\n}\n}\n#else\nfloat opacity \x3d u_opacity;\n#endif\nreturn opacity;\n}\nfloat getSize(float x) {\n#ifdef VV_SIZE\nfloat size \x3d u_size_values[0];\n{\nfor (int i \x3d 1; i \x3c MAX_STOPS; i++) {\nif (i \x3e\x3d u_size_count) {\nbreak;\n}\nfloat x1 \x3d u_size_stops[i - 1];\nif (x \x3c x1) {\nbreak;\n}\nfloat x2 \x3d u_size_stops[i];\nfloat y2 \x3d u_size_values[i];\nif (x \x3c x2) {\nfloat y1 \x3d u_size_values[i - 1];\nsize \x3d y1 + (y2 - y1) * (x - x1) / (x2 - x1);\n} else {\nsize \x3d y2;\n}\n}\n}\n#else\nfloat size \x3d u_size;\n#endif\nreturn size + 2.0 * u_featheringSize * u_featheringOffset;\n}"}, hillshade:{"hillshade.frag":"precision mediump float;\nvarying highp vec2 v_texcoord;\n#include \x3craster/common/common.glsl\x3e\nuniform int u_hillshadeType;\nuniform float u_sinZcosAs[6];\nuniform float u_sinZsinAs[6];\nuniform float u_cosZs[6];\nuniform float u_weights[6];\nuniform vec2 u_factor;\nuniform float u_minValue;\nuniform float u_maxValue;\n#include \x3craster/lut/colorize.glsl\x3e\n#include \x3craster/common/getSurfaceValues.glsl\x3e\nvec3 rgb2hsv(vec3 c) {\nvec4 K \x3d vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\nvec4 p \x3d c.g \x3c c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);\nvec4 q \x3d c.r \x3c p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);\nfloat d \x3d q.x - min(q.w, q.y);\nfloat e \x3d 1.0e-10;\nreturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);\n}\nvec3 hsv2rgb(vec3 c) {\nvec4 K \x3d vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\nvec3 p \x3d abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\nreturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\nvec4 overlay(float val, float minValue, float maxValue, float hillshade) {\nval \x3d clamp((val - minValue) / (maxValue - minValue), 0.0, 1.0);\nvec4 rgb \x3d colorize(vec4(val, val, val, 1.0), 255.0);\nvec3 hsv \x3d rgb2hsv(rgb.xyz);\nhsv.z \x3d hillshade;\nreturn vec4(hsv2rgb(hsv), 1.0) * rgb.a;\n}\nvoid main() {\nvec2 pixelLocation \x3d getPixelLocation(v_texcoord);\nif (isOutside(pixelLocation)) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn;\n}\nvec4 currentPixel \x3d getPixel(pixelLocation);\nif (currentPixel.a \x3d\x3d 0.0) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn;\n}\nfloat pv[10];\ngetSurfaceValues(u_image, pixelLocation, u_srcImageSize, pv);\nfloat alpha \x3d pv[9];\nfloat dzx \x3d (pv[2] + 2.0 * pv[5] + pv[8] - pv[0] - 2.0 * pv[3] - pv[6]) * u_factor.s;\nfloat dzy \x3d (pv[6] + 2.0 * pv[7] + pv[8] - pv[0] - 2.0 * pv[1] - pv[2]) * u_factor.t;\nfloat dzd \x3d sqrt(1.0 + dzx * dzx + dzy * dzy);\nfloat hillshade \x3d 0.0;\nif (u_hillshadeType \x3d\x3d 0){\nfloat cosDelta \x3d u_sinZsinAs[0] * dzy - u_sinZcosAs[0] * dzx;\nfloat z \x3d (u_cosZs[0] + cosDelta) / dzd;\nif (z \x3c 0.0) z \x3d 0.0;\nhillshade \x3d z;\n} else {\nfor (int k \x3d 0; k \x3c 6; k++) {\nfloat cosDelta \x3d u_sinZsinAs[k] * dzy - u_sinZcosAs[k] * dzx;\nfloat z \x3d (u_cosZs[k] + cosDelta) / dzd;\nif (z \x3c 0.0) z \x3d 0.0;\nhillshade \x3d hillshade + z * u_weights[k];\nif (k \x3d\x3d 5) break;\n}\n}\n#ifdef APPLY_COLORMAP\ngl_FragColor \x3d overlay(pv[4], u_minValue, u_maxValue, hillshade) * alpha * u_opacity;\n#else\ngl_FragColor \x3d vec4(hillshade, hillshade, hillshade, 1.0) * alpha * u_opacity;\n#endif\n}"}, lut:{"colorize.glsl":"uniform sampler2D u_colormap;\nuniform float u_colormapOffset;\nuniform float u_colormapMaxIndex;\nvec4 colorize(vec4 currentPixel, float scaleFactor) {\nfloat clrIndex \x3d clamp(currentPixel.r * scaleFactor - u_colormapOffset, 0.0, u_colormapMaxIndex);\nvec2 clrPosition \x3d vec2((clrIndex + 0.5) / (u_colormapMaxIndex + 1.0), 0.0);\nvec4 color \x3d texture2D(u_colormap, clrPosition);\nvec4 result \x3d vec4(color.rgb, color.a * currentPixel.a);\nreturn result;\n}","lut.frag":"precision mediump float;\nvarying highp vec2 v_texcoord;\n#include \x3craster/common/common.glsl\x3e\n#include \x3craster/lut/colorize.glsl\x3e\nvoid main() {\nvec2 pixelLocation \x3d getPixelLocation(v_texcoord);\nif (isOutside(pixelLocation)) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn;\n}\nvec4 currentPixel \x3d getPixel(pixelLocation);\nvec4 result \x3d colorize(currentPixel, 1.0);\ngl_FragColor \x3d vec4(result.xyz, 1.0) * result.a * u_opacity;\n}"}, magdir:{"magdir.frag":"precision mediump float;\nvarying vec4 v_color;\nuniform lowp float u_opacity;\nvoid main() {\ngl_FragColor \x3d v_color * u_opacity;\n}","magdir.vert":"precision mediump float;\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_vv;\nuniform highp mat3 u_dvsMat3;\nuniform highp vec2 u_coordScale;\nuniform vec2 u_symbolSize;\nuniform vec2 u_symbolPercentRange;\nuniform vec2 u_dataRange;\nuniform float u_rotation;\nuniform vec4 u_colors[12];\nvarying vec4 v_color;\nvoid main()\n{\nfloat angle \x3d a_offset.y + u_rotation;\n#ifndef ROTATION_GEOGRAPHIC\nangle \x3d 3.14159265359 * 2.0 - angle - 3.14159265359 / 2.0;\n#endif\nvec2 offset \x3d vec2(cos(angle), sin(angle)) * a_offset.x;\n#ifdef DATA_RANGE\nfloat valuePercentage \x3d clamp((a_vv.y - u_dataRange.x) / (u_dataRange.y - u_dataRange.x), 0.0, 1.0);\nfloat sizeRatio \x3d u_symbolPercentRange.x + valuePercentage * (u_symbolPercentRange.y - u_symbolPercentRange.x);\nfloat sizePercentage \x3d clamp(sizeRatio, u_symbolPercentRange.x, u_symbolPercentRange.y);\n#else\nfloat sizePercentage \x3d (u_symbolPercentRange.x + u_symbolPercentRange.y) / 2.0;\n#endif\nvec2 pos \x3d a_pos + offset * sizePercentage * u_symbolSize;\nv_color \x3d u_colors[int(a_vv.x)];\ngl_Position \x3d vec4(u_dvsMat3 * vec3(pos * u_coordScale, 1.0), 1.0);\n}"}, reproject:{"reproject.frag":"precision mediump float;\nvarying vec2 v_texcoord;\n#include \x3craster/common/common.glsl\x3e\nvoid main() {\nvec2 pixelLocation \x3d getPixelLocation(v_texcoord);\nif (isOutside(pixelLocation)) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 1.0);\nreturn;\n}\nvec4 currentPixel \x3d getPixel(pixelLocation);\ngl_FragColor \x3d vec4(currentPixel.rgb, 1.0) * currentPixel.a * u_opacity;\n}","reproject.vert":"precision mediump float;\nattribute vec2 a_position;\nvarying highp vec2 v_texcoord;\nvoid main()\n{\nv_texcoord \x3d a_position;\ngl_Position \x3d vec4(2.0 * (a_position - 0.5), 0.0, 1.0);\n}"}, rfx:{aspect:{"aspect.frag":"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texcoord;\nuniform vec2 u_cellSize;\nuniform vec2 u_srcImageSize;\n#include \x3craster/common/getSurfaceValues.glsl\x3e\nconst float pi \x3d 3.14159265359;\nvoid main() {\nfloat pv[10];\ngetSurfaceValues(u_image, v_texcoord, u_srcImageSize, pv);\nfloat alpha \x3d pv[9];\nfloat dzx \x3d (pv[2] + 2.0 * pv[5] + pv[8] - pv[0] - 2.0 * pv[3] - pv[6]) / (8.0 * u_cellSize[0]);\nfloat dzy \x3d -(pv[6] + 2.0 * pv[7] + pv[8] - pv[0] - 2.0 * pv[1] - pv[2]) / (8.0 * u_cellSize[1]);\nalpha *\x3d sign(abs(dzx) + abs(dzy));\nfloat aspect_rad \x3d (dzx \x3d\x3d 0.0) ? (step(0.0, dzy) * 0.5 * pi + step(dzy, 0.0) * 1.5 * pi) : mod((2.5 * pi + atan(dzy, -dzx)), 2.0 * pi);\nfloat aspect \x3d aspect_rad * 180.0 / pi;\ngl_FragColor \x3d vec4(aspect, aspect, aspect, 1.0) * alpha;\n}"}, bandarithmetic:{"bandarithmetic.frag":"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texcoord;\nuniform mediump mat3 u_bandIndexMat3;\nuniform float u_adjustments[3];\n#include \x3craster/common/inverse.glsl\x3e\nvoid main() {\nvec4 pv \x3d texture2D(u_image, v_texcoord);\nvec3 pv2 \x3d u_bandIndexMat3 * pv.rgb;\nfloat nir \x3d pv2.r;\nfloat red \x3d pv2.g;\nfloat index;\n#ifdef NDXI\nindex \x3d (nir - red) * invertValue(nir + red);\n#elif defined(SR)\nindex \x3d nir * invertValue(red);\n#elif defined(CI)\nindex \x3d nir * invertValue(red) - 1.0;\n#elif defined(SAVI)\nindex \x3d (nir - red) * invertValue(nir + red + u_adjustments[0]) * (1.0 + u_adjustments[0]);\n#elif defined(TSAVI)\nfloat s \x3d u_adjustments[0];\nfloat a \x3d u_adjustments[1];\nfloat x \x3d u_adjustments[2];\nfloat y \x3d -a * s + x * (1.0 + s * s);\nindex \x3d (s * (nir - s * red - a)) * invertValue(a * nir + red + y);\n#elif defined(MSAVI)\nfloat nir2 \x3d 2.0 * nir + 1.0;\nindex \x3d 0.5 * (nir2 - sqrt(nir2 * nir2 - 8.0 * (nir - red)));\n#elif defined(GEMI)\nfloat eta \x3d (2.0 * (nir * nir - red * red) + 1.5 * nir + 0.5 * red) * invertValue(nir + red + 0.5);\nindex \x3d eta * (1.0 - 0.25 * eta) - (red - 0.125) * invertValue(1.0 - red);\n#elif defined(PVI)\nfloat a \x3d u_adjustments[0];\nfloat b \x3d u_adjustments[1];\nfloat y \x3d sqrt(1.0 + a * a);\nindex \x3d (nir - a * red - b) * invertValue(y);\n#elif defined(VARI)\nindex \x3d (pv2.g - pv2.r) * invertValue(pv2.g + pv2.r - pv2.b);\n#elif defined(MTVI)\nfloat green \x3d pv2.b;\nfloat v \x3d sqrt(pow((2.0 * nir + 1.0), 2.0) - (6.0 * nir - 5.0 * sqrt(red)) - 0.5);\nindex \x3d 1.5 * (1.2 * (nir - green) - 2.5 * (red - green)) * invertValue(v);\n#elif defined(RTVICORE)\nfloat green \x3d pv2.b;\nindex \x3d 100.0 * (nir - red) - 10.0 * (nir - green);\n#elif defined(EVI)\nfloat blue \x3d pv2.b;\nfloat denom \x3d nir + 6.0 * red - 7.5 * blue + 1.0;\nindex \x3d (2.5 * (nir - red)) * invertValue(denom);\n#elif defined(WNDWI)\nfloat g \x3d pv2.r;\nfloat n \x3d pv2.g;\nfloat s \x3d pv2.s;\nfloat a \x3d u_adjustments[0];\nfloat denom \x3d g + a * n + (1.0 - a) * s;\nindex \x3d (g - a * n - (1 - a) * s) * invertValue(denom);\n#elif defined(BAI)\nindex \x3d invertValue(pow((0.1 - red), 2.0) + pow((0.06 - nir), 2.0));\n#else\ngl_FragColor \x3d pv;\nreturn;\n#endif\ngl_FragColor \x3d vec4(index, index, index, pv.a);\n}"}, compositeband:{"compositeband.frag":"precision mediump float;\nuniform sampler2D u_image;\nuniform sampler2D u_image1;\nuniform sampler2D u_image2;\n#ifdef ONE_CONSTANT\nuniform float u_image1Const;\n#ifdef TWO_CONSTANT\nuniform float u_image2Const;\n#endif\nuniform mat3 u_imageSwap;\n#endif\nvarying vec2 v_texcoord;\nvoid main() {\nvec4 pv0 \x3d texture2D(u_image, v_texcoord);\nfloat a \x3d pv0.r;\nfloat alpha \x3d pv0.a;\n#ifdef TWO_CONSTANT\nfloat b \x3d u_image1Const;\nfloat c \x3d u_image2Const;\nvec3 abc \x3d u_imageSwap * vec3(a, b, c);\na \x3d abc.s;\nb \x3d abc.t;\nc \x3d abc.p;\n#elif defined(ONE_CONSTANT)\nvec4 pv1 \x3d texture2D(u_image1, v_texcoord);\nfloat b \x3d pv1.r;\nfloat c \x3d u_image1Const;\nvec3 abc \x3d u_imageSwap * vec3(a, b, c);\na \x3d abc.s;\nb \x3d abc.t;\nc \x3d abc.p;\nalpha *\x3d pv1.a;\n#else\nvec4 pv1 \x3d texture2D(u_image1, v_texcoord);\nvec4 pv2 \x3d texture2D(u_image2, v_texcoord);\nfloat b \x3d pv1.r;\nfloat c \x3d pv2.r;\nalpha \x3d alpha * pv1.a * pv2.a;\n#endif\ngl_FragColor \x3d vec4(a, b, c, alpha);\n}"}, computechange:{"computechange.frag":"precision mediump float;\nuniform sampler2D u_image;\nuniform sampler2D u_image1;\n#ifdef ONE_CONSTANT\nuniform float u_image1Const;\nuniform mat3 u_imageSwap;\n#endif\nvarying vec2 v_texcoord;\nuniform vec2 u_domainRange;\n#include \x3craster/common/inverse.glsl\x3e\nvoid main() {\nvec4 pv0 \x3d texture2D(u_image, v_texcoord);\nfloat a \x3d pv0.r;\n#ifdef ONE_CONSTANT\nfloat b \x3d u_image1Const;\nvec3 abc \x3d u_imageSwap * vec3(a, b, 0);\na \x3d abc.s;\nb \x3d abc.t;\n#else\nvec4 pv1 \x3d texture2D(u_image1, v_texcoord);\nfloat b \x3d pv1.r;\n#endif\nfloat result \x3d a;\nfloat alpha \x3d pv0.a;\n#ifdef DIFFERENCE\nresult \x3d a - b;\n#elif defined(RELATIVE)\nresult \x3d (a - b) * invertValue(max(abs(a), abs(b)));\n#endif\nbool isInvalid \x3d result \x3c u_domainRange.s || result \x3e u_domainRange.t;\nresult \x3d isInvalid ? 0.0 : result;\nalpha *\x3d float(!isInvalid);\n#ifdef ROUND_OUTPUT\nresult \x3d floor(result + 0.5);\n#endif\ngl_FragColor \x3d vec4(result, result, result, alpha);\n}"}, contrast:{"contrast.frag":"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texcoord;\n#include \x3craster/common/contrastBrightness.glsl\x3e\nvoid main() {\nvec4 pv \x3d texture2D(u_image, v_texcoord);\nvec4 result \x3d adjustContrastBrightness(pv, false) ;\ngl_FragColor \x3d vec4(result.rgb * 255.0, result.a);\n}"},convolution:{"convolution.frag":"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texcoord;\nuniform vec2 u_srcImageSize;\n#define KERNEL_SIZE_ROWS ROWS\n#define KERNEL_SIZE_COLS COLS\nuniform vec2 u_clampRange;\nuniform float u_kernel[25];\n#include \x3craster/common/mirror.glsl\x3e\nvoid main() {\nvec3 rgb \x3d vec3(0.0, 0.0, 0.0);\nvec2 resolution \x3d 1.0 / u_srcImageSize;\nfloat rowOffset \x3d -float(floor(float(KERNEL_SIZE_ROWS) / 2.0));\nfloat colOffset \x3d -float(floor(float(KERNEL_SIZE_COLS) / 2.0));\nfloat alpha \x3d 1.0;\nfor (int row \x3d 0; row \x3c KERNEL_SIZE_ROWS; row++) {\nfloat pos_row \x3d rowOffset + float(row);\nfor (int col \x3d 0; col \x3c KERNEL_SIZE_COLS; col++) {\nvec2 pos \x3d v_texcoord + vec2(colOffset + float(col), pos_row) * resolution;\nvec4 pv \x3d texture2D(u_image, mirror(pos));\nrgb +\x3d pv.rgb * u_kernel[row * KERNEL_SIZE_COLS + col];\nalpha *\x3d pv.a;\n}\n}\nrgb \x3d clamp(rgb, u_clampRange.s, u_clampRange.t);\ngl_FragColor \x3d vec4(rgb * alpha, alpha);\n}"}, curvature:{"curvature.frag":"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texcoord;\nuniform float u_zlFactor;\nuniform vec2 u_srcImageSize;\n#include \x3craster/common/getSurfaceValues.glsl\x3e\nvoid main() {\nfloat pv[10];\ngetSurfaceValues(u_image, v_texcoord, u_srcImageSize, pv);\nfloat alpha \x3d pv[9];\nfloat d \x3d ((pv[3] + pv[5]) * 0.5 - pv[4]);\nfloat e \x3d ((pv[1] + pv[7]) * 0.5 - pv[4]);\nfloat curvature \x3d 0.0;\n#ifdef STANDARD\ncurvature \x3d -u_zlFactor * (d + e);\ngl_FragColor \x3d vec4(curvature, curvature, curvature, alpha);\n#else\nfloat f \x3d (-pv[0] + pv[2] + pv[6] - pv[8]) / 4.0;\nfloat g \x3d (-pv[3] + pv[5]) / 2.0;\nfloat h \x3d (pv[1] - pv[7]) / 2.0;\nfloat g2 \x3d g * g;\nfloat h2 \x3d h * h;\n#ifdef PROFILE\ncurvature \x3d (u_zlFactor * (d * g2 + e * h2 + f * g * h)) / (g2 + h2);\n#else\ncurvature \x3d (-u_zlFactor * (d * h2 + e * g2 - f * g * h)) / (g2 + h2);\n#endif\n#endif\ngl_FragColor \x3d vec4(curvature, curvature, curvature, alpha);\n}"}, extractband:{"extractband.frag":"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texcoord;\nuniform mediump mat3 u_bandIndexMat3;\nvoid main() {\nvec4 pv \x3d texture2D(u_image, v_texcoord);\nvec3 pv2 \x3d u_bandIndexMat3 * pv.rgb;\ngl_FragColor \x3d vec4(pv2, pv.a);\n}"},focalstatistics:{"focalstatistics.frag":"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texcoord;\nuniform vec2 u_srcImageSize;\n#define KERNEL_SIZE_ROWS ROWS\n#define KERNEL_SIZE_COLS COLS\nuniform vec2 u_clampRange;\n#include \x3craster/common/mirror.glsl\x3e\n#include \x3craster/common/inverse.glsl\x3e\nvoid main() {\nvec2 resolution \x3d 1.0 / u_srcImageSize;\nfloat rowOffset \x3d -float(floor(float(KERNEL_SIZE_ROWS) / 2.0));\nfloat colOffset \x3d -float(floor(float(KERNEL_SIZE_COLS) / 2.0));\nfloat count \x3d 0.0;\n#ifdef STDDEV\nvec3 sum \x3d vec3(0.0, 0.0, 0.0);\nvec3 sum2 \x3d vec3(0.0, 0.0, 0.0);\n#endif\nvec4 currentPixel \x3d texture2D(u_image, v_texcoord);\nvec3 rgb \x3d currentPixel.rgb;\nfor (int row \x3d 0; row \x3c KERNEL_SIZE_ROWS; row++) {\nfloat pos_row \x3d rowOffset + float(row);\nfor (int col \x3d 0; col \x3c KERNEL_SIZE_COLS; col++) {\nvec2 pos \x3d v_texcoord + vec2(colOffset + float(col), pos_row) * resolution;\nvec4 pv \x3d texture2D(u_image, mirror(pos));\ncount +\x3d pv.a;\n#ifdef MIN\nrgb \x3d min(rgb, pv.rgb);\n#elif defined(MAX)\nrgb \x3d max(rgb, pv.rgb);\n#elif defined(MEAN)\nrgb +\x3d pv.rgb;\n#elif defined(STDDEV)\nsum +\x3d pv.rgb;\nsum2 +\x3d (pv.rgb * pv.rgb);\n#endif\n}\n}\n#ifdef MEAN\nrgb *\x3d invertValue(count);\n#elif defined(STDDEV)\nrgb \x3d sqrt((sum2 - sum * sum * invertValue(count)) * invertValue(count));\n#endif\nfloat alpha \x3d step(0.9999, count);\nrgb \x3d clamp(rgb, u_clampRange.s, u_clampRange.t);\n#ifdef FILL\nrgb \x3d (1.0 - currentPixel.a) * rgb + currentPixel.a * currentPixel.rgb;\n#endif\ngl_FragColor \x3d vec4(rgb * alpha, alpha);\n}"}, grayscale:{"grayscale.frag":"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texcoord;\nuniform vec3 u_weights;\nvoid main() {\nvec4 pv \x3d texture2D(u_image, v_texcoord);\nfloat value \x3d dot(u_weights, pv.rgb);\ngl_FragColor \x3d vec4(value, value, value, pv.a);\n}"},local:{"local.frag":"precision mediump float;\nuniform sampler2D u_image;\nuniform sampler2D u_image1;\n#ifdef ONE_CONSTANT\nuniform float u_image1Const;\n#ifdef TWO_CONSTANT\nuniform float u_image2Const;\n#endif\nuniform mat3 u_imageSwap;\n#endif\nvarying vec2 v_texcoord;\nuniform vec2 u_domainRange;\n#include \x3craster/common/inverse.glsl\x3e\nvoid main() {\nvec4 pv0 \x3d texture2D(u_image, v_texcoord);\nfloat a \x3d pv0.r;\n#ifdef TWO_IMAGES\n#ifdef ONE_CONSTANT\nfloat b \x3d u_image1Const;\nvec3 abc \x3d u_imageSwap * vec3(a, b, 0);\na \x3d abc.s;\nb \x3d abc.t;\n#else\nvec4 pv1 \x3d texture2D(u_image1, v_texcoord);\nfloat b \x3d pv1.r;\n#endif\n#elif defined(CONDITIONAL)\n#ifdef TWO_CONSTANT\nfloat b \x3d u_image1Const;\nfloat c \x3d u_image2Const;\nvec3 abc \x3d u_imageSwap * vec3(a, b, c);\na \x3d abc.s;\nb \x3d abc.t;\nc \x3d abc.p;\n#elif defined(ONE_CONSTANT)\nvec4 pv1 \x3d texture2D(u_image1, v_texcoord);\nfloat b \x3d pv1.r;\nfloat c \x3d u_image1Const;\nvec3 abc \x3d u_imageSwap * vec3(a, b, c);\na \x3d abc.s;\nb \x3d abc.t;\nc \x3d abc.p;\n#else\nvec4 pv1 \x3d texture2D(u_image1, v_texcoord);\nvec4 pv2 \x3d texture2D(u_image2, v_texcoord);\nfloat b \x3d pv1.r;\nfloat c \x3d pv2.r;\n#endif\n#endif\nfloat result \x3d a;\nfloat alpha \x3d pv0.a;\n#ifdef PLUS\nresult \x3d a + b;\n#elif defined(MINUS)\nresult \x3d a - b;\n#elif defined(TIMES)\nresult \x3d a * b;\n#elif defined(DIVIDE)\nresult \x3d a * invertValue(b);\nalpha *\x3d float(abs(sign(b)));\n#elif defined(FLOATDIVIDE)\nresult \x3d a * invertValue(b);\nalpha *\x3d float(abs(sign(b)));\n#elif defined(FLOORDIVIDE)\nresult \x3d floor(a * invertValue(b));\nalpha *\x3d float(abs(sign(b)));\n#elif defined(SQUARE)\nresult \x3d a * a;\n#elif defined(SQRT)\nresult \x3d sqrt(a);\n#elif defined(POWER)\nresult \x3d pow(a, b);\n#elif defined(LN)\nresult \x3d a \x3c\x3d 0.0 ? 0.0: log(a);\nalpha *\x3d float(a \x3e 0.0);\n#elif defined(LOG_1_0)\nresult \x3d a \x3c\x3d 0.0 ? 0.0: log2(a) * invertValue(log2(10.0));\nalpha *\x3d float(a \x3e 0.0);\n#elif defined(LOG_2)\nresult \x3d a \x3c\x3d 0.0 ? 0.0: log2(a);\nalpha *\x3d float(a \x3e 0.0);\n#elif defined(EXP)\nresult \x3d exp(a);\n#elif defined(EXP_1_0)\nresult \x3d pow(10.0, a);\n#elif defined(EXP_2)\nresult \x3d pow(2.0, a);\n#elif defined(ROUNDDOWN)\nresult \x3d floor(a);\n#elif defined(ROUNDUP)\nresult \x3d ceil(a);\n#elif defined(INT)\nresult \x3d float(sign(a)) * floor(abs(a));\n#elif defined(MOD)\nresult \x3d mod(a, b);\n#elif defined(NEGATE)\nresult \x3d -a;\n#elif defined(ABS)\nresult \x3d abs(a);\n#elif defined(ACOS)\nresult \x3d abs(a) \x3e 1.0 ? 0.0: acos(a);\nalpha *\x3d step(abs(a), 1.00001);\n#elif defined(ACOSH)\nresult \x3d acosh(a);\n#elif defined(ASIN)\nresult \x3d abs(a) \x3e 1.0 ? 0.0: asin(a);\nalpha *\x3d step(abs(a), 1.00001);\n#elif defined(ASINH)\nresult \x3d asinh(a);\n#elif defined(ATAN)\nresult \x3d atan(a);\n#elif defined(ATANH)\nresult \x3d abs(a) \x3e 1.0 ? 0.0: atanh(a);\nalpha *\x3d step(abs(a), 1.0);\n#elif defined(ATAN_2)\nresult \x3d atan(a, b);\n#elif defined(COS)\nresult \x3d cos(a);\n#elif defined(COSH)\nresult \x3d cosh(a);\n#elif defined(SIN)\nresult \x3d sin(a);\n#elif defined(SINH)\nresult \x3d sinh(a);\n#elif defined(TAN)\nresult \x3d tan(a);\n#elif defined(TANH)\nresult \x3d tanh(a);\n#elif defined(BITWISEAND)\nresult \x3d a \x26 b;\n#elif defined(BITWISEOR)\nresult \x3d a | b;\n#elif defined(BITWISELEFTSHIFT)\nresult \x3d a \x3c\x3c b;\n#elif defined(BITWISERIGHTSHIFT)\nresult \x3d a \x3e\x3e b;\n#elif defined(BITWISENOT)\nresult \x3d ~a;\n#elif defined(BITWISEXOR)\nresult \x3d a ^ b;\n#elif defined(BOOLEANAND)\nresult \x3d float((a !\x3d 0.0) \x26\x26 (b !\x3d 0.0));\n#elif defined(BOOLEANNOT)\nresult \x3d float(a \x3d\x3d 0.0);\n#elif defined(BOOLEANOR)\nresult \x3d float((a !\x3d 0.0) || (b !\x3d 0.0));\n#elif defined(BOOLEANXOR)\nresult \x3d float((a !\x3d 0.0) ^^ (b !\x3d 0.0));\n#elif defined(GREATERTHAN)\nresult \x3d float(a \x3e b);\n#elif defined(GREATERTHANEQUAL)\nresult \x3d float(a \x3e\x3d b);\n#elif defined(LESSTHAN)\nresult \x3d float(a \x3c b);\n#elif defined(LESSTHANEQUAL)\nresult \x3d float(a \x3c\x3d b);\n#elif defined(EQUALTO)\nresult \x3d float(a \x3d\x3d b);\n#elif defined(NOTEQUAL)\nresult \x3d float(a !\x3d b);\n#elif defined(ISNULL)\nresult \x3d float(alpha \x3d\x3d 0.0);\nalpha \x3d 1.0;\n#elif defined(SETNULL)\nfloat maskValue \x3d float(a \x3d\x3d 0.0);\nresult \x3d maskValue * b;\nalpha *\x3d maskValue;\n#elif defined(CONDITIONAL)\nfloat weight \x3d float(abs(sign(a)));\nresult \x3d weight * b + (1.0 - weight) * c;\n#endif\nbool isInvalid \x3d result \x3c u_domainRange.s || result \x3e u_domainRange.t;\nresult \x3d isInvalid ? 0.0 : result;\nalpha *\x3d float(!isInvalid);\n#ifdef ROUND_OUTPUT\nresult \x3d floor(result + 0.5);\n#endif\ngl_FragColor \x3d vec4(result, result, result, alpha);\n}"}, mask:{"mask.frag":"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texcoord;\n#define LEN_INCLUDED_RANGES 6\n#define LEN_NODATA_VALUES 6\nuniform highp float u_includedRanges[6];\nuniform highp float u_noDataValues[6];\nfloat maskFactor(float bandValue, float fromValue, float to) {\nfloat factor \x3d 1.0;\nfor (int i \x3d 0; i \x3c LEN_NODATA_VALUES; i++) {\nfactor *\x3d float(u_noDataValues[i] !\x3d bandValue);\n}\nfactor *\x3d step(fromValue, bandValue) * step(bandValue, to);\nreturn factor;\n}\nvoid main() {\nvec4 pv \x3d texture2D(u_image, v_texcoord);\nfloat redFactor \x3d maskFactor(pv.r, u_includedRanges[0], u_includedRanges[1]);\n#ifdef MULTI_BAND\nfloat greenFactor \x3d maskFactor(pv.g, u_includedRanges[2], u_includedRanges[3]);\nfloat blueFactor \x3d maskFactor(pv.b, u_includedRanges[4], u_includedRanges[5]);\nfloat maskFactor \x3d redFactor * greenFactor * blueFactor;\ngl_FragColor \x3d pv * maskFactor;\n#else\ngl_FragColor \x3d pv * redFactor;\n#endif\n}"}, ndvi:{"ndvi.frag":"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texcoord;\nuniform mediump mat3 u_bandIndexMat3;\n#include \x3craster/common/inverse.glsl\x3e\nvoid main() {\nvec4 pv \x3d texture2D(u_image, v_texcoord);\nvec3 pv2 \x3d u_bandIndexMat3 * pv.rgb;\nfloat nir \x3d pv2.r;\nfloat red \x3d pv2.g;\nfloat index \x3d (nir - red) * invertValue(nir + red);\n#ifdef SCALED\nindex \x3d floor((index + 1.0) * 100.0 + 0.5);\n#endif\ngl_FragColor \x3d vec4(index, index, index, pv.a);\n}"}, remap:{"remap.frag":"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texcoord;\n#define LEN_REMAP_RANGES 18\n#define LEN_NODATA_RANGES 12\nuniform highp float u_rangeMaps[18];\nuniform highp float u_noDataRanges[12];\nuniform highp float u_unmatchMask;\nuniform vec2 u_clampRange;\nvoid main() {\nvec4 pv \x3d texture2D(u_image, v_texcoord);\nfloat factor \x3d 1.0;\nfloat bandValue \x3d pv.r;\nfor (int i \x3d 0; i \x3c LEN_NODATA_RANGES; i+\x3d2) {\nfloat inside \x3d 1.0 - step(u_noDataRanges[i], bandValue) * step(bandValue, u_noDataRanges[i+1]);\nfactor *\x3d inside;\n}\nfloat mapValue \x3d 0.0;\nfloat includeMask \x3d 0.0;\nfor (int i \x3d 0; i \x3c LEN_REMAP_RANGES; i+\x3d3) {\nfloat stepMask \x3d step(u_rangeMaps[i], bandValue) * step(bandValue, u_rangeMaps[i+1]);\nincludeMask \x3d (1.0 - stepMask) * includeMask + stepMask;\nmapValue \x3d (1.0 - stepMask) * mapValue + stepMask * u_rangeMaps[i+2];\n}\nbandValue \x3d factor * (mapValue + (1.0 - includeMask) * u_unmatchMask * pv.r);\nfloat bandMask \x3d factor * max(u_unmatchMask, includeMask);\nbandValue \x3d clamp(bandValue, u_clampRange.s, u_clampRange.t);\ngl_FragColor \x3d vec4(bandValue, bandValue, bandValue, bandMask * pv.a);\n}"}, slope:{"slope.frag":"precision mediump float;\nuniform sampler2D u_image;\nvarying vec2 v_texcoord;\nuniform vec2 u_cellSize;\nuniform float u_zFactor;\nuniform vec2 u_srcImageSize;\nuniform float u_pixelSizePower;\nuniform float u_pixelSizeFactor;\n#include \x3craster/common/getSurfaceValues.glsl\x3e\nvoid main() {\nfloat pv[10];\ngetSurfaceValues(u_image, v_texcoord, u_srcImageSize, pv);\nfloat alpha \x3d pv[9];\nfloat xf \x3d (u_zFactor + pow(u_cellSize[0], u_pixelSizePower) * u_pixelSizeFactor) / (8.0 * u_cellSize[0]);\nfloat yf \x3d (u_zFactor + pow(u_cellSize[1], u_pixelSizePower) * u_pixelSizeFactor) / (8.0 * u_cellSize[1]);\nfloat dzx \x3d (pv[2] + 2.0 * pv[5] + pv[8] - pv[0] - 2.0 * pv[3] - pv[6]) * xf;\nfloat dzy \x3d -(pv[6] + 2.0 * pv[7] + pv[8] - pv[0] - 2.0 * pv[1] - pv[2]) * yf;\nfloat rise2run \x3d sqrt(dzx * dzx + dzy * dzy);\n#ifdef PERCENT_RISE\nfloat percentRise \x3d rise2run * 100.0;\ngl_FragColor \x3d vec4(percentRise, percentRise, percentRise, alpha);\n#else\nfloat degree \x3d atan(rise2run) * 57.2957795;\ngl_FragColor \x3d vec4(degree, degree, degree, alpha);\n#endif\n}"}, stretch:{"stretch.frag":"precision mediump float;\nuniform sampler2D u_image;\nvarying highp vec2 v_texcoord;\nuniform float u_minCutOff[3];\nuniform float u_maxCutOff[3];\nuniform float u_minOutput;\nuniform float u_maxOutput;\nuniform float u_factor[3];\nuniform float u_gamma[3];\nuniform float u_gammaCorrection[3];\nfloat stretchOneValue(float val, float minCutOff, float maxCutOff, float minOutput, float maxOutput, float factor, float gamma, float gammaCorrection) {\nval \x3d clamp(val, minCutOff, maxCutOff);\nfloat stretchedVal;\n#ifdef USE_GAMMA\nfloat tempf \x3d 1.0;\nfloat outRange \x3d maxOutput - minOutput;\nfloat relativeVal \x3d (val - minCutOff) / (maxCutOff - minCutOff);\ntempf -\x3d step(1.0, gamma) * sign(gamma - 1.0) * pow(1.0 / outRange, relativeVal * gammaCorrection);\nstretchedVal \x3d tempf * outRange * pow(relativeVal, 1.0 / gamma) + minOutput;\nstretchedVal \x3d clamp(stretchedVal, minOutput, maxOutput);\n#else\nstretchedVal \x3d minOutput + (val - minCutOff) * factor;\n#endif\n#ifdef ROUND_OUTPUT\nstretchedVal \x3d floor(stretchedVal + 0.5);\n#endif\nreturn stretchedVal;\n}\nvoid main() {\nvec4 currentPixel \x3d texture2D(u_image, v_texcoord);\nfloat redVal \x3d stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_gamma[0], u_gammaCorrection[0]);\n#ifdef MULTI_BAND\nfloat greenVal \x3d stretchOneValue(currentPixel.g, u_minCutOff[1], u_maxCutOff[1], u_minOutput, u_maxOutput, u_factor[1], u_gamma[1], u_gammaCorrection[1]);\nfloat blueVal \x3d stretchOneValue(currentPixel.b, u_minCutOff[2], u_maxCutOff[2], u_minOutput, u_maxOutput, u_factor[2], u_gamma[2], u_gammaCorrection[2]);\ngl_FragColor \x3d vec4(redVal, greenVal, blueVal, currentPixel.a);\n#else\ngl_FragColor \x3d vec4(redVal, redVal, redVal, currentPixel.a);\n#endif\n}"}, vs:{"vs.vert":"precision mediump float;\nattribute vec2 a_pos;\nuniform highp mat3 u_dvsMat3;\nuniform highp vec2 u_coordScale;\nvarying highp vec2 v_texcoord;\nvoid main()\n{\nv_texcoord \x3d a_pos;\ngl_Position \x3d vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0);\n}"}},scalar:{"scalar.frag":"precision mediump float;\nuniform lowp float u_opacity;\nvarying vec2 v_pos;\nconst vec4 outlineColor \x3d vec4(0.2, 0.2, 0.2, 1.0);\nconst float outlineSize \x3d 0.02;\nconst float innerRadius \x3d 0.25;\nconst float outerRadius \x3d 0.42;\nconst float innerSquareLength \x3d 0.15;\nvoid main() {\nmediump float dist \x3d length(v_pos);\nmediump float fillalpha1 \x3d smoothstep(outerRadius, outerRadius + outlineSize, dist);\nfillalpha1 *\x3d (1.0-smoothstep(outerRadius + outlineSize, outerRadius + 0.1 + outlineSize, dist));\n#ifdef INNER_CIRCLE\nmediump float fillalpha2 \x3d smoothstep(innerRadius, innerRadius + outlineSize, dist);\nfillalpha2 *\x3d (1.0-smoothstep(innerRadius + outlineSize, innerRadius + 0.1 + outlineSize, dist));\n#else\nmediump float fillalpha2 \x3d (abs(v_pos.x) \x3c innerSquareLength ? 1.0 : 0.0) * (abs(v_pos.y) \x3c innerSquareLength ? 1.0 : 0.0);\n#endif\ngl_FragColor \x3d (fillalpha2 + fillalpha1) * outlineColor * u_opacity;\n}", "scalar.vert":"precision mediump float;\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_vv;\nuniform highp mat3 u_dvsMat3;\nuniform highp vec2 u_coordScale;\nuniform vec2 u_symbolSize;\nuniform vec2 u_symbolPercentRange;\nuniform vec2 u_dataRange;\nvarying vec2 v_pos;\nvoid main()\n{\n#ifdef DATA_RANGE\nfloat valuePercentage \x3d clamp((a_vv.y - u_dataRange.x) / (u_dataRange.y - u_dataRange.x), 0.0, 1.0);\nfloat sizeRatio \x3d u_symbolPercentRange.x + valuePercentage * (u_symbolPercentRange.y - u_symbolPercentRange.x);\nfloat sizePercentage \x3d clamp(sizeRatio, u_symbolPercentRange.x, u_symbolPercentRange.y);\n#else\nfloat sizePercentage \x3d (u_symbolPercentRange.x + u_symbolPercentRange.y) / 2.0;\n#endif\nvec2 size \x3d u_symbolSize * sizePercentage;\nvec2 pos \x3d a_pos + a_offset * size;\nv_pos \x3d a_offset;\ngl_Position \x3d vec4(u_dvsMat3 * vec3(pos * u_coordScale, 1.0), 1.0);\n}"}, stretch:{"stretch.frag":"precision mediump float;\nvarying highp vec2 v_texcoord;\n#include \x3craster/common/common.glsl\x3e\nuniform float u_minCutOff[3];\nuniform float u_maxCutOff[3];\nuniform float u_minOutput;\nuniform float u_maxOutput;\nuniform float u_factor[3];\nuniform bool u_useGamma;\nuniform float u_gamma[3];\nuniform float u_gammaCorrection[3];\n#include \x3craster/lut/colorize.glsl\x3e\nfloat stretchOneValue(float val, float minCutOff, float maxCutOff, float minOutput, float maxOutput, float factor, bool useGamma, float gamma, float gammaCorrection) {\nif (val \x3e\x3d maxCutOff) {\nreturn maxOutput;\n} else if (val \x3c\x3d minCutOff) {\nreturn minOutput;\n}\nfloat stretchedVal;\nif (useGamma) {\nfloat tempf \x3d 1.0;\nfloat outRange \x3d maxOutput - minOutput;\nfloat relativeVal \x3d (val - minCutOff) / (maxCutOff - minCutOff);\nif (gamma \x3e 1.0) {\ntempf -\x3d pow(1.0 / outRange, relativeVal * gammaCorrection);\n}\nstretchedVal \x3d (tempf * outRange * pow(relativeVal, 1.0 / gamma) + minOutput) / 255.0;\n} else {\nstretchedVal \x3d minOutput + (val - minCutOff) * factor;\n}\nreturn stretchedVal;\n}\nvoid main() {\nvec2 pixelLocation \x3d getPixelLocation(v_texcoord);\nif (isOutside(pixelLocation)) {\ngl_FragColor \x3d vec4(0.0, 0.0, 0.0, 0.0);\nreturn;\n}\nvec4 currentPixel \x3d getPixel(pixelLocation);\n#ifdef NOOP\ngl_FragColor \x3d vec4(currentPixel.rgb, 1.0) * currentPixel.a * u_opacity;\nreturn;\n#endif\nif (u_bandCount \x3d\x3d 1) {\nfloat grayVal \x3d stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]);\n#ifdef APPLY_COLORMAP\nvec4 result \x3d colorize(vec4(grayVal, grayVal, grayVal, 1.0), u_useGamma ? 255.0 : 1.0);\ngl_FragColor \x3d vec4(result.xyz, 1.0) * result.a * currentPixel.a * u_opacity;\n#else\ngl_FragColor \x3d vec4(grayVal, grayVal, grayVal, 1.0) * currentPixel.a * u_opacity;\n#endif\n} else {\nfloat redVal \x3d stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]);\nfloat greenVal \x3d stretchOneValue(currentPixel.g, u_minCutOff[1], u_maxCutOff[1], u_minOutput, u_maxOutput, u_factor[1], u_useGamma, u_gamma[1], u_gammaCorrection[1]);\nfloat blueVal \x3d stretchOneValue(currentPixel.b, u_minCutOff[2], u_maxCutOff[2], u_minOutput, u_maxOutput, u_factor[2], u_useGamma, u_gamma[2], u_gammaCorrection[2]);\ngl_FragColor \x3d vec4(redVal, greenVal, blueVal, 1.0) * currentPixel.a * u_opacity;\n}\n}"}}, stencil:{"stencil.frag":"void main() {\ngl_FragColor \x3d vec4(1.0, 1.0, 1.0, 1.0);\n}","stencil.vert":"attribute vec2 a_pos;\nuniform mat3 u_worldExtent;\nvoid main() {\ngl_Position \x3d vec4(u_worldExtent * vec3(a_pos, 1.0), 1.0);\n}"},test:{"TestShader.common.glsl":"#ifndef RETURN_RED\nvarying vec4 v_color;\n#endif\nvarying vec2 v_offset;","TestShader.frag":"precision highp float;\n#include \x3ctest/TestShader.common.glsl\x3e\nvoid main() {\nif (v_offset.x \x3e -.5 \x26\x26 v_offset.y \x3e -.5 \x26\x26 v_offset.x \x3c .5 \x26\x26 v_offset.y \x3c .5) {\ndiscard;\n}\n#ifdef RETURN_RED\ngl_FragColor \x3d vec4(1., 0., 0., 1.);\n#else\ngl_FragColor \x3d v_color;\n#endif\n}", "TestShader.vert":"const float POS_PRECISION_FACTOR \x3d 10.;\nconst float OFFSET_PRECISION_FACTOR \x3d 10.;\nconst float SIZE_PRECISION_FACTOR \x3d 10.;\nattribute vec2 a_pos_packed;\nattribute vec2 a_offset_packed;\nattribute float a_size_packed;\n#ifdef DATA_DRIVEN_COLOR\nconst float u_dataDrivenColor_validValues[4] \x3d float[4](0., 0., 1., 0.);\nuniform vec4 u_dataDrivenColor_colorFallback;\nuniform vec4 u_dataDrivenColor_color;\n#endif\nuniform float u_view_zoomLevel;\n#include \x3ctest/TestShader.common.glsl\x3e\n#ifdef DATA_DRIVEN_COLOR\nvec4 getColor(float value) {\nint index \x3d -1;\nfor (int i \x3d 0; i \x3c 4; i++) {\nif (u_dataDrivenColor_validValues[i] \x3d\x3d value) {\nindex \x3d i;\nbreak;\n}\n}\nif (index \x3d\x3d -1) {\nreturn u_dataDrivenColor_colorFallback;\n}\nreturn u_dataDrivenColor_color;\n}\n#endif\nvoid main() {\nvec2 a_pos \x3d a_pos_packed / POS_PRECISION_FACTOR;\nvec2 a_offset \x3d a_offset_packed / OFFSET_PRECISION_FACTOR;\nfloat a_size \x3d a_size_packed / SIZE_PRECISION_FACTOR;\nvec4 color \x3d vec4(1., 0., 0., 1.);\n#ifdef DATA_DRIVEN_COLOR\ncolor \x3d getColor(1.);\n#endif\nvec2 offsetScaled \x3d a_offset * a_size;\nvec4 pos \x3d vec4(a_pos.xy + offsetScaled, 0., 1.);\ngl_Position \x3d pos;\n#ifndef RETURN_RED\nv_color \x3d color;\n#endif\nv_offset \x3d a_offset;\n}"}, tileInfo:{"tileInfo.frag":"uniform mediump sampler2D u_texture;\nvarying mediump vec2 v_tex;\nvoid main(void) {\nlowp vec4 color \x3d texture2D(u_texture, v_tex);\ncolor.rgb *\x3d color.a;\ngl_FragColor \x3d color;\n}","tileInfo.vert":"attribute vec2 a_pos;\nuniform highp mat3 u_dvsMat3;\nuniform mediump float u_depth;\nuniform mediump vec2 u_coord_ratio;\nuniform mediump vec2 u_delta;\nuniform mediump vec2 u_dimensions;\nvarying mediump vec2 v_tex;\nvoid main() {\nmediump vec2 offset \x3d u_coord_ratio * vec2(u_delta + a_pos * u_dimensions);\nvec3 v_pos \x3d u_dvsMat3 * vec3(offset, 1.0);\ngl_Position \x3d vec4(v_pos.xy, 0.0, 1.0);\nv_tex \x3d a_pos;\n}"}, util:{"atan2.glsl":"float atan2(in float y, in float x) {\nfloat t0, t1, t2, t3, t4;\nt3 \x3d abs(x);\nt1 \x3d abs(y);\nt0 \x3d max(t3, t1);\nt1 \x3d min(t3, t1);\nt3 \x3d 1.0 / t0;\nt3 \x3d t1 * t3;\nt4 \x3d t3 * t3;\nt0 \x3d - 0.013480470;\nt0 \x3d t0 * t4 + 0.057477314;\nt0 \x3d t0 * t4 - 0.121239071;\nt0 \x3d t0 * t4 + 0.195635925;\nt0 \x3d t0 * t4 - 0.332994597;\nt0 \x3d t0 * t4 + 0.999995630;\nt3 \x3d t0 * t3;\nt3 \x3d (abs(y) \x3e abs(x)) ? 1.570796327 - t3 : t3;\nt3 \x3d x \x3c 0.0 ? 3.141592654 - t3 : t3;\nt3 \x3d y \x3c 0.0 ? -t3 : t3;\nreturn t3;\n}", "encoding.glsl":"const vec4 rgba2float_factors \x3d vec4(\n255.0 / (256.0),\n255.0 / (256.0 * 256.0),\n255.0 / (256.0 * 256.0 * 256.0),\n255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n);\nfloat rgba2float(vec4 rgba) {\nreturn dot(rgba, rgba2float_factors);\n}"}}})},"esri/views/2d/engine/webgl/brushes/BrushOverlay":function(){define(["../definitions","../Utils","./WGLBrush","../../../../webgl/enums"],function(e,g,q,h){class m extends q{constructor(){super(...arguments);this._desc={vsPath:"overlay/overlay", fsPath:"overlay/overlay",attributes:new Map([["a_pos",0],["a_uv",1]])}}dispose(){}prepareState({context:l}){l.setBlendingEnabled(!0);l.setColorMask(!0,!0,!0,!0);l.setBlendFunctionSeparate(h.BlendFactor.ONE,h.BlendFactor.ONE_MINUS_SRC_ALPHA,h.BlendFactor.ONE,h.BlendFactor.ONE_MINUS_SRC_ALPHA);l.setStencilWriteMask(0);l.setStencilTestEnabled(!0);l.setStencilFunction(h.CompareFunction.GREATER,255,255)}draw(l,d){const {context:b,painter:a,requestRender:f,allowDelayedRender:n}=l;if(d.isReady){var {computedOpacity:c, dvsMat3:r,isWrapAround:k,perspectiveTransform:p,texture:t,wrapAroundShift:w}=d;l.timeline.begin(this.name);var u=a.materialManager.getProgram(this._desc);if(n&&null!=f&&!u.compiled)f();else{var y=g.createProgramDescriptor("overlay",{geometry:[{location:0,name:"a_pos",count:2,type:h.DataType.FLOAT}],tex:[{location:1,name:"a_uv",count:2,type:h.DataType.UNSIGNED_SHORT}]});if(y=d.getVAO(b,y.bufferLayouts,y.attributes))b.bindVAO(y),b.useProgram(u),b.bindTexture(t,e.textureBindingBitmap),u.setUniformMatrix3fv("u_dvsMat3", r),u.setUniform1i("u_texture",e.textureBindingBitmap),u.setUniform1f("u_opacity",c),u.setUniform2fv("u_perspective",p),u.setUniform2fv("u_texSize",d.textureSize),u.setUniform1f("u_wrapAroundShift",0),d.draw(l.context),k&&(u.setUniform1f("u_wrapAroundShift",w),d.draw(l.context)),b.bindVAO(),l.timeline.end(this.name)}}}}return m})},"esri/views/2d/engine/webgl/brushes/WGLBrushStencil":function(){define("../../../../../core/libs/gl-matrix-2/factories/vec4f32 ../DefaultVertexAttributeLayouts ./WGLBrush ../shaders/BackgroundPrograms ../../../../webgl/BufferObject ../../../../webgl/enums ../../../../webgl/ProgramTemplate ../../../../webgl/VertexArrayObject".split(" "), function(e,g,q,h,m,l,d,b){class a extends q{constructor(){super(...arguments);this._color=e.fromValues(1,0,0,1);this._initialized=!1}dispose(){this._solidProgram&&(this._solidProgram.dispose(),this._solidProgram=null);this._solidVertexArrayObject&&(this._solidVertexArrayObject.dispose(),this._solidVertexArrayObject=null)}prepareState({context:f}){f.setDepthWriteEnabled(!1);f.setDepthTestEnabled(!1);f.setStencilTestEnabled(!0);f.setBlendingEnabled(!1);f.setColorMask(!1,!1,!1,!1);f.setStencilOp(l.StencilOperation.KEEP, l.StencilOperation.KEEP,l.StencilOperation.REPLACE);f.setStencilWriteMask(255)}draw(f,n){const {context:c,requestRender:r,allowDelayedRender:k}=f;this._initialized||this._initialize(c);k&&null!=r&&!this._solidProgram.compiled?r():(c.setStencilFunctionSeparate(l.Face.FRONT_AND_BACK,l.CompareFunction.GREATER,n.stencilRef,255),c.bindVAO(this._solidVertexArrayObject),c.useProgram(this._solidProgram),this._solidProgram.setUniformMatrix3fv("u_dvsMat3",n.transforms.displayViewScreenMat3),this._solidProgram.setUniform2fv("u_coord_range", [n.rangeX,n.rangeY]),this._solidProgram.setUniform1f("u_depth",0),this._solidProgram.setUniform4fv("u_color",this._color),c.drawArrays(l.PrimitiveType.TRIANGLE_STRIP,0,4),c.bindVAO())}_initialize(f){if(this._initialized)return!0;const n=d.createProgram(f,h.background);if(!n)return!1;var c=new Int8Array([0,0,1,0,0,1,1,1]);c=m.BufferObject.createVertex(f,l.Usage.STATIC_DRAW,c);f=new b.VertexArrayObject(f,h.background.attributes,g.Pos2b,{geometry:c});this._solidProgram=n;this._solidVertexArrayObject= f;return this._initialized=!0}}return a})},"esri/views/2d/engine/webgl/DefaultVertexAttributeLayouts":function(){define(["exports","../../../webgl/enums","../../../webgl/VertexElementDescriptor"],function(e,g,q){const h={geometry:[new q.VertexElementDescriptor("a_pos",2,g.DataType.BYTE,0,2)]},m={geometry:[new q.VertexElementDescriptor("a_pos",2,g.DataType.BYTE,0,4),new q.VertexElementDescriptor("a_tex",2,g.DataType.BYTE,2,4)]};g={geometry:[new q.VertexElementDescriptor("a_pos",2,g.DataType.UNSIGNED_SHORT, 0,4)]};e.Pos2b=h;e.Pos2us=g;e.PosTex2b=m;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/brushes/WGLBrushTileDebugInfo":function(){define("../../../../../core/libs/gl-matrix-2/factories/vec4f32 ../DefaultVertexAttributeLayouts ../FeatureTile ./WGLBrush ../shaders/BackgroundPrograms ../shaders/TileInfoPrograms ../../../../webgl/BufferObject ../../../../webgl/enums ../../../../webgl/ProgramTemplate ../../../../webgl/Texture ../../../../webgl/TextureDescriptor ../../../../webgl/VertexArrayObject".split(" "), function(e,g,q,h,m,l,d,b,a,f,n,c){class r extends h{constructor(){super(...arguments);this._color=e.fromValues(1,0,0,1)}dispose(){this._outlineProgram?.dispose();this._outlineProgram=null;this._tileInfoProgram?.dispose();this._tileInfoProgram=null;this._outlineVertexArrayObject?.dispose();this._outlineVertexArrayObject=null;this._tileInfoVertexArrayObject?.dispose();this._ctx=this._tileInfoVertexArrayObject=null}prepareState({context:k}){k.setBlendingEnabled(!0);k.setBlendFunctionSeparate(b.BlendFactor.ONE, b.BlendFactor.ONE_MINUS_SRC_ALPHA,b.BlendFactor.ONE,b.BlendFactor.ONE_MINUS_SRC_ALPHA);k.setColorMask(!0,!0,!0,!0);k.setStencilWriteMask(0);k.setStencilTestEnabled(!1)}draw(k,p){const {context:t,requestRender:w,allowDelayedRender:u}=k;if(!(!p.isReady&&p instanceof q.FeatureTile&&p.hasData))if(this._loadWGLResources(t),!u||null==w||this._outlineProgram.compiled&&this._tileInfoProgram.compiled){t.bindVAO(this._outlineVertexArrayObject);t.useProgram(this._outlineProgram);this._outlineProgram.setUniformMatrix3fv("u_dvsMat3", p.transforms.displayViewScreenMat3);this._outlineProgram.setUniform2f("u_coord_range",p.rangeX,p.rangeY);this._outlineProgram.setUniform1f("u_depth",0);this._outlineProgram.setUniform4fv("u_color",this._color);t.drawArrays(b.PrimitiveType.LINE_STRIP,0,4);if(k=this._getTexture(t,p))t.bindVAO(this._tileInfoVertexArrayObject),t.useProgram(this._tileInfoProgram),t.bindTexture(k,0),this._tileInfoProgram.setUniformMatrix3fv("u_dvsMat3",p.transforms.displayViewScreenMat3),this._tileInfoProgram.setUniform1f("u_depth", 0),this._tileInfoProgram.setUniform2f("u_coord_ratio",p.rangeX/p.width,p.rangeY/p.height),this._tileInfoProgram.setUniform2f("u_delta",0,0),this._tileInfoProgram.setUniform2f("u_dimensions",k.descriptor.width,k.descriptor.height),t.drawArrays(b.PrimitiveType.TRIANGLE_STRIP,0,4);t.bindVAO()}else w()}_loadWGLResources(k){if(!this._outlineProgram||!this._tileInfoProgram){var p=a.createProgram(k,m.background),t=a.createProgram(k,l.tileInfo),w=new Int8Array([0,0,1,0,1,1,0,1]);w=d.BufferObject.createVertex(k, b.Usage.STATIC_DRAW,w);w=new c.VertexArrayObject(k,m.background.attributes,g.Pos2b,{geometry:w});var u=new Int8Array([0,0,1,0,0,1,1,1]);u=d.BufferObject.createVertex(k,b.Usage.STATIC_DRAW,u);k=new c.VertexArrayObject(k,l.tileInfo.attributes,g.Pos2b,{geometry:u});this._outlineProgram=p;this._tileInfoProgram=t;this._outlineVertexArrayObject=w;this._tileInfoVertexArrayObject=k}}_getTexture(k,p){if(!this._ctx){var t=document.createElement("canvas");t.width=512;t.height=512;this._ctx=t.getContext("2d")}p.tileDebugInfoTexture|| (t=new n.TextureDescriptor,t.wrapMode=b.TextureWrapMode.CLAMP_TO_EDGE,t.samplingMode=b.TextureSamplingMode.LINEAR,t.isImmutable=!0,t.width=512,t.height=512,p.tileDebugInfoTexture=new f.Texture(k,t));k=this._ctx;k.clearRect(0,0,k.canvas.width,k.canvas.height);k.textAlign="left";k.textBaseline="top";k.font="14px sans-serif";k.lineWidth=2;k.fillStyle="white";k.strokeStyle="black";var {debugSlot:w}=p;t=8+99.2*w;w=`${w}) ${p.key.id} (${p.constructor.name})`;k.strokeText(w,8,t);k.fillText(w,8,t);t+=16; ({debugInfo:w}=p);if(w){const {length:y,minOrderedLength:x,minUnorderedLength:v,triangleCount:A}=w.display;if(0=this._attributeEpoch?(g("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.ready [epoch=${u}]`),this.ready(),this.requestRender(), !0):!1}get labelMetrics(){return this._metrics}get hasData(){return!!this._meshes.size}get needsUpload(){return this._invalidated}get _uploadAllowed(){return!this.enableDeferredUploads||this._nextUploadAllowed}upload(){this._nextUploadAllowed=!0}getDisplayList(u,y){if(this._uploadAllowed&&this._invalidated){this._entities.sort((x,v)=>{const A=v.sortKey,z=x.sortKey;return z===A?x.id-v.id:z-A});y===b.FeatureBatchingStrategy.BATCHING&&this.reshuffle(!0);this._displayList=a.DisplayList.fromDisplayEntities(this._entities, this,u,y);for(const x of this._meshes.values())x.upload();this.debugInfo.display.length=this._displayList.length;this.debugInfo.display.minOrderedLength=this._displayList.minOrderedLength;this.debugInfo.display.minUnorderedLength=this._displayList.minUnorderedLength;this.requestRender();this._nextUploadAllowed=this._invalidated=!1}return this._displayList}getMesh(u){if(!this._meshes.has(u))throw Error(`InternalError: Unable to find VAO for instance: ${u}`);return this._meshes.get(u)}getSortKeys(u){const y= new Map;for(const {id:x,sortKey:v}of this._entities)if(u.has(x)&&y.set(x,v),y.size===u.size)break;return y}onMessage(u){switch(u.type){case "append":this._onAppendMessage(u);break;case "update":this._onUpdateMessage(u)}this._aggregateMemoryStats();this.requestRender();if(u.end){g("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.end [epoch=${u.attributeEpoch}]`);if(!u.attributeEpoch)throw Error("InternalError: Attribute epoch not defined.");this._attributeEpoch=u.attributeEpoch; this._encounteredEnd=!0}}_onAppendMessage(u){g("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.append`,{append:r.debugMeshDataInfo(u?.append)});u.clear&&this.clear();if(u.append){var y=p.deserializeList(new k(u.append.entities),d);this._insert(y,u.append.data,!1)}}_onUpdateMessage(u){g("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.update`,{isPixelBuffer:u.isPixelBuffer,modify:r.debugMeshDataInfo(u.modify),remove:u.remove});const y=p.deserializeList(new k(u.modify.entities), d);var x=y.map(A=>A.id);const v=u.isPixelBuffer??!1;x=[...u.remove,...x];v?this._removeByIdsFromBuffer(x):this._removeByIds(x);this._insert(y,u.modify.data,v)}reshuffle(u=!1){if(!this.destroyed){var y=new Map;for(const x of this._entities)for(const v of x.records){const A=this._meshes.get(v.instanceId);let z=y.get(A);z||(z=new f.ReshufflePlan(u),y.set(A,z));z.copyRecord(v)}for(const [x,v]of y)x.reshuffle(v);this._invalidated=!0;this._aggregateMemoryStats();g("esri-2d-update-debug")&&q.getLogger("esri.views.2d.engine.webgl.FeatureTile").info(`Tile ${this.key.id} was reshuffled.`)}}copyPixelBufferedEntitesFrom(u, y,x,v){x*=l.tileSize;v*=l.tileSize;for(const z of u._entities){let B=null;for(const D of z.records)if(D.overlaps&y){var A=u.getMesh(D.instanceId);A=this._ensureMesh(D.instanceId,A.layout).copyRecordFrom(A,D,x,v);B||(B=new d(z.id,z.sortKey),this._entityIdsFromBuffer.add(z.id),this._entities.push(B));B.records.push(A)}}this._invalidated=!0}_ensureMesh(u,y){this._meshes.has(u)||this._meshes.set(u,new c.MappedMesh(this._stage.bufferPool,y));return this._meshes.get(u)}_insert(u,y,x){if(u.length){this._removeDuplicatedBufferedEntites(u); y=this._insertVertexData(y);for(const v of u){for(const A of v.records)A.updateBaseOffsets(y.get(A.instanceId));x?this._tryInsertBufferedEntity(v):this._insertEntity(v)}this._invalidated=!0}}_insertVertexData(u){const y=new Map;for(const x of u){const {instanceId:v,layout:A}=x;u=this._ensureMesh(v,A).append(x);if(x.metrics){const z=p.deserializeList(new k(x.metrics),n.LabelMetric)??[];this._metrics.push(...z)}y.set(v,u)}return y}_insertEntity(u){g("esri-2d-update-debug")&&this._entityIds.has(u.id)&& console.error(`Tile ${this.key.id} insertEnitty: Already have entityId ${u.id}`);this._entityIds.add(u.id);this._entities.push(u)}_tryInsertBufferedEntity(u){this._entityIds.has(u.id)?this._removeRecordsFromMesh(u.records):(this._entityIdsFromBuffer.add(u.id),this._entities.push(u))}_removeDuplicatedBufferedEntites(u){if(this._entityIdsFromBuffer.size){var y=[];for(const x of u)this._entityIdsFromBuffer.has(x.id)&&y.push(x.id);this._removeByIds(y)}}_removeByIdsFromBuffer(u){this._removeByIds(u.filter(y=> this._entityIdsFromBuffer.has(y)))}_removeByIds(u){if(0!==u.length){u=new Set(u);var y=[];for(const x of this._entities)u.has(x.id)?this._remove(x):y.push(x);this._entities=y;this._invalidated=!0}}_remove(u){this._removeRecordsFromMesh(u.records);this._entityIds.delete(u.id);this._entityIdsFromBuffer.delete(u.id)}_removeRecordsFromMesh(u){for(const y of u){const {instanceId:x,indexStart:v,indexCount:A,vertexStart:z,vertexCount:B}=y;this._meshes.get(x)?.remove(v,A,z,B)}}_aggregateMemoryStats(){this.debugInfo.memory.bytesUsed= 0;this.debugInfo.memory.bytesReserved=0;for(const [,u]of this._meshes)this.debugInfo.memory.bytesUsed+=u.memoryStats.bytesUsed,this.debugInfo.memory.bytesReserved+=u.memoryStats.bytesReserved}get _needsReshuffle(){if(this.destroyed)return!1;const {bytesUsed:u,bytesReserved:y}=this.debugInfo.memory,{minOrderedLength:x,length:v}=this.debugInfo.display;return y>l.RESHUFFLING_EXEMPT_MEMORY_BYTES&&u/yl.RESHUFFLING_EXEMPT_DRAW_CALLS&&x/v=-r&&k[0]=-r&&k[1]{h=Math.max(h,m.end-m.start)});return h}firstFit(h){if(null==this._head)return null;var m=null;let l=this._head;for(;l;){const d=l.data.end-l.data.start;if(d===h)return m?m.next=l.next:this._head=l.next,l.data.start;if(d>h)return m=l.data.start,l.data.start+=h,m;m=l;l=l.next}return null}free(h,m){const l= h+m;if(null==this._head)this._head=new g({start:h,end:l});else if(l<=this._head.data.start)if(l===this._head.data.start)this._head.data.start-=m;else{var d=new g({start:h,end:l});d.next=this._head;this._head=d}else{d=this._head;for(var b=d.next;b;){if(b.data.start>=l){if(d.data.end===h){d.data.end+=m;d.data.end===b.data.start&&(d.data.end+=b.data.end-b.data.start,d.next=b.next);return}if(b.data.start===l){b.data.start-=m;return}h=new g({start:h,end:l});h.next=d.next;d.next=h;return}d=b;b=b.next}h=== d.data.end?d.data.end+=m:(h=new g({start:h,end:l}),d.next=h)}}clear(){this._head=null}}e.FreeList=q;e.List=g;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/ReshufflePlan":function(){define(["exports"],function(e){class g{constructor(q){this._indexOnly=q;this.vertex={count:0,operations:[]};this.index={count:0,operations:[]}}copyRecord(q){let h=0;this._indexOnly||(h=this.vertex.count-q.vertexStart,this.vertex.operations.push({srcFrom:q.vertexStart,dstFrom:this.vertex.count, count:q.vertexCount,mutate:0}),q.vertexStart=this.vertex.count,this.vertex.count+=q.vertexCount);let m=!1;if(this._indexOnly&&1<=this.index.operations.length){const l=this.index.operations[this.index.operations.length-1];l.srcFrom+l.count===q.indexStart&&(l.count+=q.indexCount,m=!0)}m||this.index.operations.push({srcFrom:q.indexStart,dstFrom:this.index.count,count:q.indexCount,mutate:h});q.indexStart=this.index.count;this.index.count+=q.indexCount}}e.ReshufflePlan=g;Object.defineProperty(e,Symbol.toStringTag, {value:"Module"})})},"esri/views/2d/engine/webgl/collisions/LabelMetric":function(){define(["exports","./BoundingBox","../util/serializationUtils"],function(e,g,q){class h{constructor(m,l,d,b,a,f,n,c,r=[]){this.entityTexel=m;this.anchorX=l;this.anchorY=d;this.directionX=b;this.directionY=a;this.maxScale=f;this.minScale=n;this.referenceBounds=c;this.bounds=r}serialize(m){m.push(this.entityTexel);m.writeF32(this.anchorX);m.writeF32(this.anchorY);m.writeF32(this.directionX);m.writeF32(this.directionY); m.writeF32(this.maxScale);m.writeF32(this.minScale);null===this.referenceBounds?(m.writeF32(0),m.writeF32(0),m.writeF32(0)):(m.writeF32(this.referenceBounds.size),m.writeF32(this.referenceBounds.offsetX),m.writeF32(this.referenceBounds.offsetY));q.serializeList(m,this.bounds)}static deserialize(m){const l=m.readInt32(),d=m.readF32(),b=m.readF32(),a=m.readF32(),f=m.readF32(),n=m.readF32(),c=m.readF32(),r=m.readF32(),k=m.readF32(),p=m.readF32();m=q.deserializeList(m,g)??[];return new h(l,d,b,a,f,n, c,{size:r,offsetX:k,offsetY:p},m)}}e.LabelMetric=h;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/cpuMapped/MappedMesh":function(){define("exports ../../../../../core/maybe ../number ./Buffer ../shaderGraph/techniques/mesh/dataViewUtils ../../../../webgl/enums ../../../../webgl/VertexArrayObject".split(" "),function(e,g,q,h,m,l,d){function b(n,c){const r=[],k=n.attributes.filter(p=>c.locations.has(p.name));for(const p of k)r.push({name:p.name,type:p.type, count:p.count,divisor:0,normalized:p.normalized??!1,offset:p.offset,stride:n.stride});return{geometry:r}}function a(n,c){const r=[];var k=n.attributes.filter(p=>c.locations.has(p.name));for(const p of k)r.push({name:p.name,type:p.type,count:p.count,divisor:0,normalized:p.normalized??!1,offset:p.offset,stride:n.stride}),k=c.computeAttributeMap[p.name],null!=k&&2===k.length&&(r.push({name:k[0],count:p.count,divisor:0,type:p.type,normalized:p.normalized??!1,offset:p.offset+n.stride,stride:n.stride}), r.push({name:k[1],count:p.count,divisor:0,type:p.type,normalized:p.normalized??!1,offset:p.offset+2*n.stride,stride:n.stride}));return{geometry:r}}class f{constructor(n,c){this._bufferPool=n;this._layout=c;this._invalidated=!1;this._position=this._layout.attributes.find(r=>"pos"===r.name||"position"===r.name);if(!this._position)throw Error("InternalError: Unable to find position attribute");}destroy(){this._indexBuffer=g.destroyMaybe(this._indexBuffer);this._vertexBuffer=g.destroyMaybe(this._vertexBuffer); this._computeVAO?.disposeVAOOnly();this._geometryVAO?.disposeVAOOnly()}get layout(){return this._layout}getDrawArgs(n,c,r,k){return k?{primitive:l.PrimitiveType.POINTS,count:c/3,offset:r/3}:{primitive:n,count:c,offset:r}}getAttributePrecisionPackFactors(){const n={};for(const c of this.layout.attributes)c.packPrecisionFactor&&(n[c.name]=c.packPrecisionFactor);return n}getDebugVertexInfo(n=!1){if(!this._vertexBuffer)return null;const c=this._layout,r=c.stride;var k=this._vertexBuffer.getView(0,this._vertexBuffer.byteSize); const p=new DataView(k.slice().buffer);k=k.byteLength/r;n&&(k=this._indexBuffer.fillPointer/3);const t=this._indexBuffer.getView(0,this._indexBuffer.byteSize);let w=0;const u=[];for(let y=0;y>10&31)-15;b=(l&1023)/1024;-15>>15?-1:1)*2**d*b};e.i16=function(l){return g(l,-32768,32767)};e.i1616to32=function(l,d){return 65535&l|d<<16};e.i32=function(l){return g(l,-2147483648,2147483647)};e.i8=function(l){return g(l,-128,127)};e.i8816to32=function(l,d,b){return l&255|(d&255)<<8|b<<16};e.i8888to32=function(l,d,b,a){return l&255|(d&255)<<8|(b&255)<<16|a<<24};e.numTo32=function(l){return l| 0};e.toFloat32=function(l){m[0]=l;return h[0]};e.toUint16=function(l){var d=q(l);l=d>>>31;var b=d&8388607;d=(d>>>23&255)-127;if(15d)return 0;-14>d&&(b=(b+8388608)/2**(-14-d),d=-15);var a=b/8192;b=Math.floor(a);a-=b;b=1023>b&&(.5>>8,(l&16711680)>>>16,(l&4278190080)>>>24]};e.u4u4to8= function(l,d){return 15&l|(15&d)<<4};e.u8=function(l){return g(l,0,255)};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/cpuMapped/Buffer":function(){define("exports ../../../../../core/has ../../../../../core/maybe ../PooledUint32Array ./FreeList ../../../../webgl/BufferObject ../../../../webgl/enums".split(" "),function(e,g,q,h,m,l,d){class b{constructor(a,f,n,c){this._pool=c;c=h.PooledUint32Array.create(f*n*Uint32Array.BYTES_PER_ELEMENT,this._pool);this.size= f;this.strideInt=n;this.bufferType=a;this.dirty={start:Infinity,end:0};this.memoryStats={bytesUsed:0,bytesReserved:f*n*Uint32Array.BYTES_PER_ELEMENT};this._gpu=null;this._cpu=c;this.clear()}get elementSize(){return this._cpu.length/this.strideInt}get intSize(){return this.fillPointer*this.strideInt}get byteSize(){return this.intSize*Uint32Array.BYTES_PER_ELEMENT}get invalidated(){return 0=a)&&a*this.strideInt>this._cpu.length-this.fillPointer){this.invalidate();const f=this._cpu.length/ this.strideInt;a=Math.round(1.25*(f+a));this._cpu.expand(a*this.strideInt*Uint32Array.BYTES_PER_ELEMENT);this.freeList.free(f,a-f);this.memoryStats.bytesReserved+=(a-f)*this.strideInt*Uint32Array.BYTES_PER_ELEMENT}}set(a,f){this._cpu.array[a]!==f&&(this._cpu.array[a]=f,this.dirty.start=Math.min(a,this.dirty.start),this.dirty.end=Math.max(a+1,this.dirty.end))}getGPUBuffer(a,f=!1){if(!this.bufferSize)return null;if(f){if("index"!==this.bufferType)throw Error("Tired to get triangle buffer, but target is not an index buffer"); null==this._gpuComputeTriangles&&(this._gpuComputeTriangles=this._createComputeBuffer(a));return this._gpuComputeTriangles}null==this._gpu&&(this._gpu=this._createBuffer(a));return this._gpu}getView(a,f){return this._cpu.getUint32View(a,f/Uint32Array.BYTES_PER_ELEMENT)}get bufferSize(){return this._cpu.length/this.strideInt}maxAvailableSpace(){return this.freeList.maxAvailableSpace()}insert(a,f,n,c){const r=n*this.strideInt;if(!r)return 0;a=new Uint32Array(a,f*this.strideInt*Uint32Array.BYTES_PER_ELEMENT, r);f=this.freeList.firstFit(n);q.assertIsSome(f,"First fit region must be defined");const k=f*this.strideInt;this._cpu.array.set(a,k);if(0!==c)for(let p=0;pa,c=this._cpu,r=h.PooledUint32Array.create(a,this._pool);n||r.array.set(this._cpu.getUint32View(0,this.intSize));for(const k of f)if(n||k.srcFrom!==k.dstFrom||0!==k.mutate)for(this.dirty.start=Math.min(this.dirty.start,k.dstFrom*this.strideInt),this.dirty.end=Math.max(this.dirty.end,(k.dstFrom+k.count)*this.strideInt),f=0;f=d.BYTE_LENGTH)return new Uint32Array(a/ Uint32Array.BYTES_PER_ELEMENT);for(const f of this._pages){const n=f.acquireUint32Array(a);if(null!=n)return n}a=this._addPage().acquireUint32Array(a);q.assertIsSome(a,"Expected to allocate page");return a}releaseUint32Array(a){this._bytesAllocated-=a.byteLength;m&&console.log(`Freeing ${a.byteLength}, (${this._bytesAllocated} / ${this._bytesTotal})`);const f=this._pagesByBuffer.get(a.buffer);f&&f.releaseUint32Array(a)}_addPage(){const a=new d;this._pages.push(a);this._pagesByBuffer.set(a.buffer, a);return a}}e.ArrayBufferPool=b;e.PooledUint32Array=l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/mesh/dataViewUtils":function(){define(["exports","../../../number","../../../../../../webgl/enums"],function(e,g,q){e.packDataView=function(h,m,l,d){const b=l.packPrecisionFactor??1;switch(l.type){case q.DataType.BYTE:if(1===l.count)h.setInt8(d+l.offset,m*b);else for(var a=0;am.vtlHighResCutoff?2:1;const C=this._programOptions;C.pattern=B;y=x.getMaterialProgram(r,y,C);if(t&&null!=p&&!y.compiled)p();else{r.bindVAO(this._vao);r.useProgram(y);if(B){v=D.getMosaicItemPosition(z,!0);if(null!=v){const {tl:G,br:H,page:K}=v;F=H[0]-G[0];E=H[1]-G[1];v=D.getPageSize(K);null!=v&&(D.bind(r,b.TextureSamplingMode.LINEAR,K,m.vtlTextureBindingUnitSprites),y.setUniform4f("u_tlbr", G[0],G[1],H[0],H[1]),y.setUniform2fv("u_mosaicSize",v),y.setUniform1i("u_texture",m.vtlTextureBindingUnitSprites))}y.setUniform1f("u_opacity",A)}else A*=v[3],this._color[0]=A*v[0],this._color[1]=A*v[1],this._color[2]=A*v[2],this._color[3]=A,y.setUniform4fv("u_color",this._color);y.setUniform1f("u_depth",u.z||0);for(const G of c)y.setUniform1f("u_coord_range",G.rangeX),y.setUniformMatrix3fv("u_dvsMat3",G.transforms.displayViewScreenMat3),B&&(u=n*G.width*Math.max(2**(Math.round(w)-G.key.level),1),c= u/g.nextPowerOfTwo(F),u/=g.nextPowerOfTwo(E),this._patternMatrix[0]=c,this._patternMatrix[4]=u,y.setUniformMatrix3fv("u_pattern_matrix",this._patternMatrix)),r.setStencilFunction(b.CompareFunction.EQUAL,0,255),r.drawArrays(b.PrimitiveType.TRIANGLE_STRIP,0,4)}}_loadWGLResources(n){if(!this._vao){var {context:c,styleLayer:r}=n;n=r.backgroundMaterial;var k=new Int8Array([0,0,1,0,0,1,1,1]);k=d.BufferObject.createVertex(c,b.Usage.STATIC_DRAW,k);this._vao=new a.VertexArrayObject(c,n.getAttributeLocations(), n.getLayoutInfo(),{geometry:k})}}}e.WGLBrushVTLBackground=f;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/brushes/WGLBrushVTLCircle":function(){define(["exports","../../vectorTiles/style/StyleDefinition","./WGLBrush","../../../../webgl/enums"],function(e,g,q,h){class m extends q{constructor(){super(...arguments);this._programOptions={id:!1}}dispose(){}drawMany(l,d){const {context:b,displayLevel:a,requiredLevel:f,state:n,painter:c,spriteMosaic:r,styleLayerUID:k, requestRender:p,allowDelayedRender:t}=l;if(d.some(v=>v.layerData.get(k)?.circleIndexCount??!1)){l=l.styleLayer;var w=l.circleMaterial,u=c.vectorTilesMaterialManager,y=l.getPaintValue("circle-translate",a),x=l.getPaintValue("circle-translate-anchor",a);u=u.getMaterialProgram(b,w,this._programOptions);if(t&&null!=p&&!u.compiled)p();else{b.useProgram(u);u.setUniformMatrix3fv("u_displayMat3",x===g.TranslateAnchor.VIEWPORT?n.displayMat3:n.displayViewMat3);u.setUniform2fv("u_circleTranslation",y);u.setUniform1f("u_depth", l.z);u.setUniform1f("u_antialiasingWidth",1.2);y=-1;for(const v of d)v.layerData.has(k)&&(v.key.level!==y&&(y=v.key.level,w.setDataUniforms(u,a,l,y,r)),d=v.layerData.get(k),d.circleIndexCount&&(d.prepareForRendering(b),x=d.vao,null!=x&&(b.bindVAO(x),u.setUniformMatrix3fv("u_dvsMat3",v.transforms.displayViewScreenMat3),f!==v.key.level?b.setStencilFunction(h.CompareFunction.EQUAL,v.stencilRef,255):b.setStencilFunction(h.CompareFunction.GREATER,255,255),b.drawElements(h.PrimitiveType.TRIANGLES,d.circleIndexCount, h.DataType.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*d.circleIndexStart),v.triangleCount+=d.circleIndexCount/3)))}}}}e.WGLBrushVTLCircle=m;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/style/StyleDefinition":function(){define(["exports","../../../../../symbols/cim/enums"],function(e,g){e.StyleLayerType=void 0;(function(h){h[h.BACKGROUND=0]="BACKGROUND";h[h.FILL=1]="FILL";h[h.LINE=2]="LINE";h[h.SYMBOL=3]="SYMBOL";h[h.CIRCLE=4]="CIRCLE"})(e.StyleLayerType|| (e.StyleLayerType={}));e.Visibility=void 0;(function(h){h[h.VISIBLE=0]="VISIBLE";h[h.NONE=1]="NONE"})(e.Visibility||(e.Visibility={}));e.SymbolPlacement=void 0;(function(h){h[h.POINT=0]="POINT";h[h.LINE=1]="LINE";h[h.LINE_CENTER=2]="LINE_CENTER"})(e.SymbolPlacement||(e.SymbolPlacement={}));e.RotationAlignment=void 0;(function(h){h[h.MAP=0]="MAP";h[h.VIEWPORT=1]="VIEWPORT";h[h.AUTO=2]="AUTO"})(e.RotationAlignment||(e.RotationAlignment={}));e.TextJustification=void 0;(function(h){h[h.AUTO=0]="AUTO"; h[h.LEFT=1]="LEFT";h[h.CENTER=2]="CENTER";h[h.RIGHT=3]="RIGHT"})(e.TextJustification||(e.TextJustification={}));e.SymbolAnchor=void 0;(function(h){h[h.CENTER=0]="CENTER";h[h.LEFT=1]="LEFT";h[h.RIGHT=2]="RIGHT";h[h.TOP=3]="TOP";h[h.BOTTOM=4]="BOTTOM";h[h.TOP_LEFT=5]="TOP_LEFT";h[h.TOP_RIGHT=6]="TOP_RIGHT";h[h.BOTTOM_LEFT=7]="BOTTOM_LEFT";h[h.BOTTOM_RIGHT=8]="BOTTOM_RIGHT"})(e.SymbolAnchor||(e.SymbolAnchor={}));e.TextTransform=void 0;(function(h){h[h.NONE=0]="NONE";h[h.UPPERCASE=1]="UPPERCASE";h[h.LOWERCASE= 2]="LOWERCASE"})(e.TextTransform||(e.TextTransform={}));e.TranslateAnchor=void 0;(function(h){h[h.MAP=0]="MAP";h[h.VIEWPORT=1]="VIEWPORT"})(e.TranslateAnchor||(e.TranslateAnchor={}));e.TextWritingMode=void 0;(function(h){h[h.HORIZONTAL=0]="HORIZONTAL";h[h.VERTICAL=1]="VERTICAL"})(e.TextWritingMode||(e.TextWritingMode={}));class q{}q.backgroundLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:e.Visibility.VISIBLE}};q.fillLayoutDefinition={visibility:{type:"enum",values:["visible", "none"],default:e.Visibility.VISIBLE}};q.lineLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:e.Visibility.VISIBLE},"line-cap":{type:"enum",values:["butt","round","square"],default:g.CapType.BUTT},"line-join":{type:"enum",values:["bevel","round","miter"],default:g.JoinType.MITER},"line-miter-limit":{type:"number",default:2},"line-round-limit":{type:"number",default:1.05}};q.symbolLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:e.Visibility.VISIBLE}, "symbol-avoid-edges":{type:"boolean",default:!1},"symbol-placement":{type:"enum",values:["point","line","line-center"],default:e.SymbolPlacement.POINT},"symbol-sort-key":{type:"number",default:-1},"symbol-spacing":{type:"number",minimum:1,default:250},"icon-allow-overlap":{type:"boolean",default:!1},"icon-anchor":{type:"enum",values:"center left right top bottom top-left top-right bottom-left bottom-right".split(" "),default:e.SymbolAnchor.CENTER},"icon-ignore-placement":{type:"boolean",default:!1}, "icon-image":{type:"string"},"icon-keep-upright":{type:"boolean",default:!1},"icon-offset":{type:"array",value:"number",length:2,default:[0,0]},"icon-optional":{type:"boolean",default:!1},"icon-padding":{type:"number",minimum:0,default:2},"icon-rotate":{type:"number",default:0},"icon-rotation-alignment":{type:"enum",values:["map","viewport","auto"],default:e.RotationAlignment.AUTO},"icon-size":{type:"number",minimum:0,default:1},"text-allow-overlap":{type:"boolean",default:!1},"text-anchor":{type:"enum", values:"center left right top bottom top-left top-right bottom-left bottom-right".split(" "),default:e.SymbolAnchor.CENTER},"text-field":{type:"string"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"]},"text-ignore-placement":{type:"boolean",default:!1},"text-justify":{type:"enum",values:["auto","left","center","right"],default:e.TextJustification.CENTER},"text-keep-upright":{type:"boolean",default:!0},"text-letter-spacing":{type:"number",default:0}, "text-line-height":{type:"number",default:1.2},"text-max-angle":{type:"number",minimum:0,default:45},"text-max-width":{type:"number",minimum:0,default:10},"text-offset":{type:"array",value:"number",length:2,default:[0,0]},"text-optional":{type:"boolean",default:!1},"text-padding":{type:"number",minimum:0,default:2},"text-rotate":{type:"number",default:0},"text-rotation-alignment":{type:"enum",values:["map","viewport","auto"],default:e.RotationAlignment.AUTO},"text-size":{type:"number",minimum:0,default:16}, "text-transform":{type:"enum",values:["none","uppercase","lowercase"],default:e.TextTransform.NONE},"text-writing-mode":{type:"array",value:"enum",values:["horizontal","vertical"],default:[e.TextWritingMode.HORIZONTAL]}};q.circleLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:e.Visibility.VISIBLE}};q.backgroundPaintDefinition={"background-color":{type:"color",default:[0,0,0,1]},"background-opacity":{type:"number",minimum:0,maximum:1,default:1},"background-pattern":{type:"string"}}; q.fillPaintDefinition={"fill-antialias":{type:"boolean",default:!0},"fill-color":{type:"color",default:[0,0,0,1]},"fill-opacity":{type:"number",minimum:0,maximum:1,default:1},"fill-outline-color":{type:"color",default:[0,0,0,0]},"fill-pattern":{type:"string"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0]},"fill-translate-anchor":{type:"enum",values:["map","viewport"],default:e.TranslateAnchor.MAP}};q.linePaintDefinition={"line-blur":{type:"number",minimum:0,default:0},"line-color":{type:"color", default:[0,0,0,1]},"line-dasharray":{type:"array",value:"number",default:[]},"line-gap-width":{type:"number",minimum:0,default:0},"line-offset":{type:"number",default:0},"line-opacity":{type:"number",minimum:0,maximum:1,default:1},"line-pattern":{type:"string"},"line-translate":{type:"array",value:"number",length:2,default:[0,0]},"line-translate-anchor":{type:"enum",values:["map","viewport"],default:e.TranslateAnchor.MAP},"line-width":{type:"number",minimum:0,default:1}};q.symbolPaintDefinition={"icon-color":{type:"color", default:[0,0,0,1]},"icon-halo-blur":{type:"number",minimum:0,default:0},"icon-halo-color":{type:"color",default:[0,0,0,0]},"icon-halo-width":{type:"number",minimum:0,default:0},"icon-opacity":{type:"number",minimum:0,maximum:1,default:1},"icon-translate":{type:"array",value:"number",length:2,default:[0,0]},"icon-translate-anchor":{type:"enum",values:["map","viewport"],default:e.TranslateAnchor.MAP},"text-color":{type:"color",default:[0,0,0,1]},"text-halo-blur":{type:"number",minimum:0,default:0}, "text-halo-color":{type:"color",default:[0,0,0,0]},"text-halo-width":{type:"number",minimum:0,default:0},"text-opacity":{type:"number",minimum:0,maximum:1,default:1},"text-translate":{type:"array",value:"number",length:2,default:[0,0]},"text-translate-anchor":{type:"enum",values:["map","viewport"],default:e.TranslateAnchor.MAP}};q.rasterPaintDefinition={"raster-opacity":{type:"number",minimum:0,maximum:1,default:1},"raster-hue-rotate":{type:"number",default:0},"raster-brightness-min":{type:"number", minimum:0,maximum:1,default:0},"raster-brightness-max":{type:"number",minimum:0,maximum:1,default:1},"raster-saturation":{type:"number",minimum:-1,maximum:1,default:0},"raster-contrast":{type:"number",minimum:-1,maximum:1,default:0},"raster-fade-duration":{type:"number",minimum:0,default:300}};q.circlePaintDefinition={"circle-blur":{type:"number",minimum:0,default:0},"circle-color":{type:"color",default:[0,0,0,1]},"circle-opacity":{type:"number",minimum:0,maximum:1,default:1},"circle-radius":{type:"number", minimum:0,default:5},"circle-stroke-color":{type:"color",default:[0,0,0,1]},"circle-stroke-opacity":{type:"number",minimum:0,maximum:1,default:1},"circle-stroke-width":{type:"number",minimum:0,default:0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0]},"circle-translate-anchor":{type:"enum",values:["map","viewport"],default:e.TranslateAnchor.MAP}};e.StyleDefinition=q;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/brushes/WGLBrushVTLFill":function(){define(["exports", "../../vectorTiles/style/StyleDefinition","../definitions","./WGLBrush","../../../../webgl/enums"],function(e,g,q,h,m){const l=1/65536;class d extends h{constructor(){super(...arguments);this._fillProgramOptions={id:!1,pattern:!1};this._outlineProgramOptions={id:!1}}dispose(){}drawMany(b,a){const {displayLevel:f,renderPass:n,spriteMosaic:c,styleLayerUID:r}=b;var k=!1;for(var p of a)if(p.layerData.has(r)){var t=p.layerData.get(r);if(0x,w&&"opaque"!==n&&!u&&this._drawOutline(b,r,k,a,v,A))}}_drawFill(b,a,f,n,c,r,k,p,t){if(!k||t||null!=p){var {context:w,displayLevel:u,state:y,painter:x,pixelRatio:v,spriteMosaic:A,requestRender:z,allowDelayedRender:B}=b;b=f.fillMaterial;var D=x.vectorTilesMaterialManager,F=v>q.vtlHighResCutoff?2:1,E=this._fillProgramOptions;E.pattern=k;D=D.getMaterialProgram(w,b,E);if(B&&null!=z&&!D.compiled)z(); else{w.useProgram(D);null!=p&&({page:p}=p,E=A.getPageSize(p),null!=E&&(A.bind(w,m.TextureSamplingMode.LINEAR,p,q.vtlTextureBindingUnitSprites),D.setUniform2fv("u_mosaicSize",E),D.setUniform1i("u_texture",q.vtlTextureBindingUnitSprites)));D.setUniformMatrix3fv("u_displayMat3",r===g.TranslateAnchor.VIEWPORT?y.displayMat3:y.displayViewMat3);D.setUniform2fv("u_fillTranslation",c);D.setUniform1f("u_depth",f.z+l);c=-1;for(const C of n)if(C.layerData.has(a)&&(C.key.level!==c&&(c=C.key.level,b.setDataUniforms(D, u,f,c,A)),n=C.layerData.get(a),n.fillIndexCount&&(n.prepareForRendering(w),r=n.fillVAO,null!=r))){w.bindVAO(r);D.setUniformMatrix3fv("u_dvsMat3",C.transforms.displayViewScreenMat3);w.setStencilFunction(m.CompareFunction.EQUAL,C.stencilRef,255);k&&D.setUniform1f("u_patternFactor",C.rangeX/(F*C.width*Math.max(2**(Math.round(u)-C.key.level),1)));if(t){r=n.patternMap;if(!r)continue;for(const [G,H]of r)r=A.getPageSize(G),null!=r&&(A.bind(w,m.TextureSamplingMode.LINEAR,G,q.vtlTextureBindingUnitSprites), D.setUniform2fv("u_mosaicSize",r),D.setUniform1i("u_texture",q.vtlTextureBindingUnitSprites),w.drawElements(m.PrimitiveType.TRIANGLES,H[1],m.DataType.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*H[0]))}else w.drawElements(m.PrimitiveType.TRIANGLES,n.fillIndexCount,m.DataType.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*n.fillIndexStart);C.triangleCount+=n.fillIndexCount/3}}}}_drawOutline(b,a,f,n,c,r){const {context:k,displayLevel:p,state:t,painter:w,pixelRatio:u,spriteMosaic:y,requestRender:x,allowDelayedRender:v}= b;b=f.outlineMaterial;const A=.75/u,z=w.vectorTilesMaterialManager.getMaterialProgram(k,b,this._outlineProgramOptions);if(v&&null!=x&&!z.compiled)x();else{k.useProgram(z);z.setUniformMatrix3fv("u_displayMat3",r===g.TranslateAnchor.VIEWPORT?t.displayMat3:t.displayViewMat3);z.setUniform2fv("u_fillTranslation",c);z.setUniform1f("u_depth",f.z+l);z.setUniform1f("u_outline_width",A);c=-1;for(const B of n)B.layerData.has(a)&&(B.key.level!==c&&(c=B.key.level,b.setDataUniforms(z,p,f,c,y)),n=B.layerData.get(a), n.prepareForRendering(k),n.outlineIndexCount&&(r=n.outlineVAO,null!=r&&(k.bindVAO(r),z.setUniformMatrix3fv("u_dvsMat3",B.transforms.displayViewScreenMat3),k.setStencilFunction(m.CompareFunction.EQUAL,B.stencilRef,255),k.drawElements(m.PrimitiveType.TRIANGLES,n.outlineIndexCount,m.DataType.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*n.outlineIndexStart),B.triangleCount+=n.outlineIndexCount/3)))}}}e.WGLBrushVTLFill=d;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/brushes/WGLBrushVTLLine":function(){define(["exports", "../../vectorTiles/style/StyleDefinition","../definitions","./WGLBrush","../../../../webgl/enums"],function(e,g,q,h,m){class l extends h{constructor(){super(...arguments);this._programOptions={id:!1,pattern:!1,sdf:!1}}dispose(){}drawMany(d,b){const {context:a,displayLevel:f,state:n,painter:c,pixelRatio:r,spriteMosaic:k,styleLayerUID:p,requestRender:t,allowDelayedRender:w}=d;if(b.some(G=>G.layerData.get(p)?.lineIndexCount??!1)){d=d.styleLayer;var u=d.lineMaterial,y=c.vectorTilesMaterialManager,x=d.getPaintValue("line-translate", f),v=d.getPaintValue("line-translate-anchor",f),A=d.getPaintProperty("line-pattern"),z=void 0!==A,B=z&&A.isDataDriven;if(z&&!B){A=A.getValue(f);var D=k.getMosaicItemPosition(A)}var F;A=!1;if(!z){var E=d.getPaintProperty("line-dasharray");A=(F=void 0!==E)&&E.isDataDriven;F&&!A&&(D=E.getValue(f),D=d.getDashKey(D,d.getLayoutValue("line-cap",f)),D=k.getMosaicItemPosition(D))}E=1/r;var C=this._programOptions;C.pattern=z;C.sdf=F;F=y.getMaterialProgram(a,u,C);if(w&&null!=t&&!F.compiled)t();else{a.useProgram(F); F.setUniformMatrix3fv("u_displayViewMat3",n.displayViewMat3);F.setUniformMatrix3fv("u_displayMat3",v===g.TranslateAnchor.VIEWPORT?n.displayMat3:n.displayViewMat3);F.setUniform2fv("u_lineTranslation",x);F.setUniform1f("u_depth",d.z);F.setUniform1f("u_antialiasing",E);D&&null!=D&&({page:x}=D,v=k.getPageSize(x),null!=v&&(k.bind(a,m.TextureSamplingMode.LINEAR,x,q.vtlTextureBindingUnitSprites),F.setUniform2fv("u_mosaicSize",v),F.setUniform1i("u_texture",q.vtlTextureBindingUnitSprites)));x=-1;for(const G of b)if(G.layerData.has(p)&& (G.key.level!==x&&(x=G.key.level,u.setDataUniforms(F,f,d,x,k)),F.setUniform1f("u_zoomFactor",2**(f-x)/r),b=G.layerData.get(p),b.lineIndexCount&&(b.prepareForRendering(a),v=b.vao,null!=v))){a.bindVAO(v);F.setUniformMatrix3fv("u_dvsMat3",G.transforms.displayViewScreenMat3);a.setStencilFunction(m.CompareFunction.EQUAL,G.stencilRef,255);if(B||A){v=b.patternMap;if(!v)continue;for(const [H,K]of v)v=k.getPageSize(H),null!=v&&(k.bind(a,m.TextureSamplingMode.LINEAR,H,q.vtlTextureBindingUnitSprites),F.setUniform2fv("u_mosaicSize", v),F.setUniform1i("u_texture",q.vtlTextureBindingUnitSprites),a.drawElements(m.PrimitiveType.TRIANGLES,K[1],m.DataType.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*K[0]))}else a.drawElements(m.PrimitiveType.TRIANGLES,b.lineIndexCount,m.DataType.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*b.lineIndexStart);G.triangleCount+=b.lineIndexCount/3}}}}}e.WGLBrushVTLLine=l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/brushes/WGLBrushVTLSymbol":function(){define("exports ../../../../../core/libs/gl-matrix-2/factories/vec2f32 ../../vectorTiles/decluttering/config ../../vectorTiles/style/StyleDefinition ../definitions ../GeometryUtils ./WGLBrush ../../../../webgl/enums".split(" "), function(e,g,q,h,m,l,d,b){const a=1/65536;class f extends d{constructor(){super(...arguments);this._iconProgramOptions={id:!1,sdf:!1};this._sdfProgramOptions={id:!1};this._spritesTextureSize=g.create()}dispose(){}drawMany(n,c){const r=n.styleLayer;this._drawIcons(n,r,c);this._drawText(n,r,c)}_drawIcons(n,c,r){const {context:k,displayLevel:p,painter:t,spriteMosaic:w,state:u,styleLayerUID:y,requestRender:x,allowDelayedRender:v}=n,A=c.iconMaterial;var z=t.vectorTilesMaterialManager;let B;var D=!1;for(var F of r)if(F.layerData.has(y)&& (B=F.layerData.get(y),0{this._renderGlyphRange(k,T,I,t,O,H,G,Q)}))))}}}}_renderGlyphRange(n,c,r,k,p,t,w,u){k.bind(n,b.TextureSamplingMode.LINEAR,r,m.vtlTextureBindingUnitGlyphs);t&&(p.setUniform1f("u_halo",1),n.drawElements(b.PrimitiveType.TRIANGLES,c[1],b.DataType.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*c[0]),u.triangleCount+=c[1]/3);w&&(p.setUniform1f("u_halo", 0),n.drawElements(b.PrimitiveType.TRIANGLES,c[1],b.DataType.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*c[0]),u.triangleCount+=c[1]/3)}_setStencilState(n,c){const {context:r,is3D:k,stencilSymbols:p}=n;r.setStencilTestEnabled(!0);p?(r.setStencilWriteMask(255),r.setStencilFunction(b.CompareFunction.ALWAYS,c.stencilRef,255)):(r.setStencilWriteMask(0),k?r.setStencilFunction(b.CompareFunction.EQUAL,c.stencilRef,255):r.setStencilFunction(b.CompareFunction.GREATER,255,255))}}e.WGLBrushVTLSymbol=f;Object.defineProperty(e, Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/decluttering/config":function(){define(["exports"],function(e){e.collisionGridCellSize=32;e.declutterBudget=1.5;e.declutterTiles=!0;e.fadeDuration=200;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/GeometryUtils":function(){define(["exports"],function(e){function g(l,d){l%=d;return 0<=l?l:l+d}const q=128/Math.PI,h=256/360,m=1/Math.LN2;e.between=function(l,d,b){return l>=d&&l<=b|| l>=b&&l<=d};e.degToByte=function(l){return g(l*h,256)};e.interpolate=function(l,d,b){return l*(1-b)+d*b};e.log2=function(l){return Math.log(l)*m};e.positiveMod=g;e.radToByte=function(l){return g(l*q,256)};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/shaders/VTLMaterialManager":function(){define(["../enums","./Programs"],function(e,g){class q{constructor(){this._programByKey=new Map}dispose(){this._programByKey.forEach(h=>h.dispose());this._programByKey.clear()}getMaterialProgram(h, m,l){const d=m.key<<3|this._getMaterialOptionsValue(m.type,l);if(this._programByKey.has(d))return this._programByKey.get(d);var b=this._getProgramTemplate(m.type);({shaders:b}=b);const {vertexShader:a,fragmentShader:f}=b(l);l=m.getShaderHeader();b=m.getShaderMain();l=a.replace("#pragma header",l).replace("#pragma main",b);h=h.programCache.acquire(l,f,m.getAttributeLocations());this._programByKey.set(d,h);return h}_getMaterialOptionsValue(h,m){switch(h){case e.ShaderProgramType.BACKGROUND:return(m.pattern? 1:0)<<1;case e.ShaderProgramType.FILL:return(m.pattern?1:0)<<1;case e.ShaderProgramType.OUTLINE:return 0;case e.ShaderProgramType.LINE:return(m.sdf?1:0)<<2|(m.pattern?1:0)<<1;case e.ShaderProgramType.ICON:return(m.sdf?1:0)<<1;case e.ShaderProgramType.CIRCLE:return 0;case e.ShaderProgramType.TEXT:return 0;default:return 0}}_getProgramTemplate(h){switch(h){case e.ShaderProgramType.BACKGROUND:return g.background;case e.ShaderProgramType.CIRCLE:return g.circle;case e.ShaderProgramType.FILL:return g.fill; case e.ShaderProgramType.ICON:return g.icon;case e.ShaderProgramType.LINE:return g.line;case e.ShaderProgramType.OUTLINE:return g.outline;case e.ShaderProgramType.TEXT:return g.text;default:return null}}}return q})},"esri/views/2d/engine/vectorTiles/enums":function(){define(["exports"],function(e){e.BucketType=void 0;(function(g){g[g.FILL=1]="FILL";g[g.LINE=2]="LINE";g[g.SYMBOL=3]="SYMBOL";g[g.CIRCLE=4]="CIRCLE"})(e.BucketType||(e.BucketType={}));e.ShaderProgramType=void 0;(function(g){g[g.BACKGROUND= 0]="BACKGROUND";g[g.FILL=1]="FILL";g[g.OUTLINE=2]="OUTLINE";g[g.LINE=3]="LINE";g[g.ICON=4]="ICON";g[g.CIRCLE=5]="CIRCLE";g[g.TEXT=6]="TEXT";g[g.TILEINFO=7]="TILEINFO"})(e.ShaderProgramType||(e.ShaderProgramType={}));e.StyleUpdateType=void 0;(function(g){g[g.PAINTER_CHANGED=0]="PAINTER_CHANGED";g[g.LAYOUT_CHANGED=1]="LAYOUT_CHANGED";g[g.LAYER_CHANGED=2]="LAYER_CHANGED";g[g.LAYER_REMOVED=3]="LAYER_REMOVED";g[g.SPRITES_CHANGED=4]="SPRITES_CHANGED"})(e.StyleUpdateType||(e.StyleUpdateType={}));Object.defineProperty(e, Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/shaders/Programs":function(){define(["exports","./sources/resolver","../../../../webgl/programUtils"],function(e,g,q){e.background={shaders:h=>({vertexShader:q.glslifyDefineMap({PATTERN:h.pattern})+g.resolveIncludes("background/background.vert"),fragmentShader:q.glslifyDefineMap({PATTERN:h.pattern})+g.resolveIncludes("background/background.frag")})};e.circle={shaders:h=>({vertexShader:g.resolveIncludes("circle/circle.vert"), fragmentShader:g.resolveIncludes("circle/circle.frag")})};e.fill={shaders:h=>({vertexShader:q.glslifyDefineMap({PATTERN:h.pattern})+g.resolveIncludes("fill/fill.vert"),fragmentShader:q.glslifyDefineMap({PATTERN:h.pattern})+g.resolveIncludes("fill/fill.frag")})};e.icon={shaders:h=>({vertexShader:q.glslifyDefineMap({SDF:h.sdf})+g.resolveIncludes("icon/icon.vert"),fragmentShader:q.glslifyDefineMap({SDF:h.sdf})+g.resolveIncludes("icon/icon.frag")})};e.line={shaders:h=>({vertexShader:q.glslifyDefineMap({PATTERN:h.pattern, SDF:h.sdf})+g.resolveIncludes("line/line.vert"),fragmentShader:q.glslifyDefineMap({PATTERN:h.pattern,SDF:h.sdf})+g.resolveIncludes("line/line.frag")})};e.outline={shaders:h=>({vertexShader:g.resolveIncludes("outline/outline.vert"),fragmentShader:g.resolveIncludes("outline/outline.frag")})};e.text={shaders:h=>({vertexShader:g.resolveIncludes("text/text.vert"),fragmentShader:g.resolveIncludes("text/text.frag")})};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/shaders/sources/resolver":function(){define(["exports", "./shaderRepository","../../../../../webgl/ShaderCompiler"],function(e,g,q){const h=new q.ShaderCompiler(function(m){let l=g;m.split("/").forEach(d=>{l&&=l[d]});return l});e.resolveIncludes=function(m){return h.resolveIncludes(m)};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/vectorTiles/shaders/sources/shaderRepository":function(){define(function(){return{background:{"background.frag":"#ifdef PATTERN\nuniform lowp float u_opacity;\nuniform lowp sampler2D u_texture;\nvarying mediump vec4 v_tlbr;\nvarying mediump vec2 v_tileTextureCoord;\n#else\nuniform lowp vec4 u_color;\n#endif\nvoid main() {\n#ifdef PATTERN\nmediump vec2 normalizedTextureCoord \x3d mod(v_tileTextureCoord, 1.0);\nmediump vec2 samplePos \x3d mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord);\nlowp vec4 color \x3d texture2D(u_texture, samplePos);\ngl_FragColor \x3d u_opacity * color;\n#else\ngl_FragColor \x3d u_color;\n#endif\n}", "background.vert":"precision mediump float;\nattribute vec2 a_pos;\nuniform highp mat3 u_dvsMat3;\nuniform mediump float u_coord_range;\nuniform mediump float u_depth;\n#ifdef PATTERN\nuniform mediump mat3 u_pattern_matrix;\nvarying mediump vec2 v_tileTextureCoord;\nuniform mediump vec4 u_tlbr;\nuniform mediump vec2 u_mosaicSize;\nvarying mediump vec4 v_tlbr;\n#endif\nvoid main() {\ngl_Position \x3d vec4((u_dvsMat3 * vec3(u_coord_range * a_pos, 1.0)).xy, u_depth, 1.0);\n#ifdef PATTERN\nv_tileTextureCoord \x3d (u_pattern_matrix * vec3(a_pos, 1.0)).xy;\nv_tlbr \x3d u_tlbr / u_mosaicSize.xyxy;\n#endif\n}"}, circle:{"circle.frag":"precision lowp float;\nvarying lowp vec4 v_color;\nvarying lowp vec4 v_stroke_color;\nvarying mediump float v_blur;\nvarying mediump float v_stroke_width;\nvarying mediump float v_radius;\nvarying mediump vec2 v_offset;\nvoid main()\n{\nmediump float dist \x3d length(v_offset);\nmediump float alpha \x3d smoothstep(0.0, -v_blur, dist - 1.0);\nlowp float color_mix_ratio \x3d v_stroke_width \x3c 0.01 ? 0.0 : smoothstep(-v_blur, 0.0, dist - v_radius / (v_radius + v_stroke_width));\ngl_FragColor \x3d alpha * mix(v_color, v_stroke_color, color_mix_ratio);\n}", "circle.vert":"precision mediump float;\nattribute vec2 a_pos;\n#pragma header\nvarying lowp vec4 v_color;\nvarying lowp vec4 v_stroke_color;\nvarying mediump float v_blur;\nvarying mediump float v_stroke_width;\nvarying mediump float v_radius;\nvarying mediump vec2 v_offset;\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform mediump vec2 u_circleTranslation;\nuniform mediump float u_depth;\nuniform mediump float u_antialiasingWidth;\nvoid main()\n{\n#pragma main\nv_color \x3d color * opacity;\nv_stroke_color \x3d stroke_color * stroke_opacity;\nv_stroke_width \x3d stroke_width;\nv_radius \x3d radius;\nv_blur \x3d max(blur, u_antialiasingWidth / (radius + stroke_width));\nmediump vec2 offset \x3d vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\nv_offset \x3d offset;\nmediump vec3 pos \x3d u_dvsMat3 * vec3(a_pos * 0.5, 1.0) + u_displayMat3 * vec3((v_radius + v_stroke_width) * offset + u_circleTranslation, 0.0);\ngl_Position \x3d vec4(pos.xy, u_depth, 1.0);\n}"}, fill:{"fill.frag":"precision lowp float;\n#ifdef PATTERN\nuniform lowp sampler2D u_texture;\nvarying mediump vec2 v_tileTextureCoord;\nvarying mediump vec4 v_tlbr;\n#endif\nvarying lowp vec4 v_color;\nvec4 mixColors(vec4 color1, vec4 color2) {\nfloat compositeAlpha \x3d color2.a + color1.a * (1.0 - color2.a);\nvec3 compositeColor \x3d color2.rgb + color1.rgb * (1.0 - color2.a);\nreturn vec4(compositeColor, compositeAlpha);\n}\nvoid main()\n{\n#ifdef PATTERN\nmediump vec2 normalizedTextureCoord \x3d fract(v_tileTextureCoord);\nmediump vec2 samplePos \x3d mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord);\nlowp vec4 color \x3d texture2D(u_texture, samplePos);\ngl_FragColor \x3d v_color[3] * color;\n#else\ngl_FragColor \x3d v_color;\n#endif\n}", "fill.vert":"precision mediump float;\nattribute vec2 a_pos;\n#pragma header\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform mediump float u_depth;\nuniform mediump vec2 u_fillTranslation;\n#ifdef PATTERN\n#include \x3cutil/util.glsl\x3e\nuniform mediump vec2 u_mosaicSize;\nuniform mediump float u_patternFactor;\nvarying mediump vec2 v_tileTextureCoord;\nvarying mediump vec4 v_tlbr;\n#endif\nvarying lowp vec4 v_color;\nvoid main()\n{\n#pragma main\nv_color \x3d color * opacity;\n#ifdef PATTERN\nfloat patternWidth \x3d nextPOT(tlbr.z - tlbr.x);\nfloat patternHeight \x3d nextPOT(tlbr.w - tlbr.y);\nfloat scaleX \x3d 1.0 / (patternWidth * u_patternFactor);\nfloat scaleY \x3d 1.0 / (patternHeight * u_patternFactor);\nmat3 patterMat \x3d mat3(scaleX, 0.0, 0.0,\n0.0, -scaleY, 0.0,\n0.0, 0.0, 1.0);\nv_tileTextureCoord \x3d (patterMat * vec3(a_pos, 1.0)).xy;\nv_tlbr \x3d tlbr / u_mosaicSize.xyxy;\n#endif\nvec3 pos \x3d u_dvsMat3 * vec3(a_pos, 1.0) + u_displayMat3 * vec3(u_fillTranslation, 0.0);\ngl_Position \x3d vec4(pos.xy, u_depth, 1.0);\n}"}, icon:{"icon.frag":"precision mediump float;\nuniform lowp sampler2D u_texture;\n#ifdef SDF\nuniform lowp vec4 u_color;\nuniform lowp vec4 u_outlineColor;\n#endif\nvarying mediump vec2 v_tex;\nvarying lowp float v_opacity;\nvarying mediump vec2 v_size;\nvarying lowp vec4 v_color;\n#ifdef SDF\nvarying mediump flaot v_halo_width;\n#endif\n#include \x3cutil/encoding.glsl\x3e\nvec4 mixColors(vec4 color1, vec4 color2) {\nfloat compositeAlpha \x3d color2.a + color1.a * (1.0 - color2.a);\nvec3 compositeColor \x3d color2.rgb + color1.rgb * (1.0 - color2.a);\nreturn vec4(compositeColor, compositeAlpha);\n}\nvoid main()\n{\n#ifdef SDF\nlowp vec4 fillPixelColor \x3d v_color;\nfloat d \x3d rgba2float(texture2D(u_texture, v_tex)) - 0.5;\nconst float softEdgeRatio \x3d 0.248062016;\nfloat size \x3d max(v_size.x, v_size.y);\nfloat dist \x3d d * softEdgeRatio * size;\nfillPixelColor *\x3d clamp(0.5 - dist, 0.0, 1.0);\nif (v_halo_width \x3e 0.25) {\nlowp vec4 outlinePixelColor \x3d u_outlineColor;\nconst float outlineLimitRatio \x3d (16.0 / 86.0);\nfloat clampedOutlineSize \x3d softEdgeRatio * min(v_halo_width, outlineLimitRatio * max(v_size.x, v_size.y));\noutlinePixelColor *\x3d clamp(0.5 - (abs(dist) - clampedOutlineSize), 0.0, 1.0);\ngl_FragColor \x3d v_opacity * mixColors(fillPixelColor, outlinePixelColor);\n}\nelse {\ngl_FragColor \x3d v_opacity * fillPixelColor;\n}\n#else\nlowp vec4 texColor \x3d texture2D(u_texture, v_tex);\ngl_FragColor \x3d v_opacity * texColor;\n#endif\n}", "icon.vert":"attribute vec2 a_pos;\nattribute vec2 a_vertexOffset;\nattribute vec4 a_texAngleRange;\nattribute vec4 a_levelInfo;\nattribute float a_opacityInfo;\n#pragma header\nvarying lowp vec4 v_color;\n#ifdef SDF\nvarying mediump float v_halo_width;\n#endif\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform highp mat3 u_displayViewMat3;\nuniform mediump vec2 u_iconTranslation;\nuniform vec2 u_mosaicSize;\nuniform mediump float u_depth;\nuniform mediump float u_mapRotation;\nuniform mediump float u_level;\nuniform lowp float u_keepUpright;\nuniform mediump float u_fadeDuration;\nvarying mediump vec2 v_tex;\nvarying lowp float v_opacity;\nvarying mediump vec2 v_size;\nconst float C_OFFSET_PRECISION \x3d 1.0 / 8.0;\nconst float C_256_TO_RAD \x3d 3.14159265359 / 128.0;\nconst float C_DEG_TO_RAD \x3d 3.14159265359 / 180.0;\nconst float tileCoordRatio \x3d 1.0 / 8.0;\nuniform highp float u_time;\nvoid main()\n{\n#pragma main\nv_color \x3d color;\nv_opacity \x3d opacity;\n#ifdef SDF\nv_halo_width \x3d halo_width;\n#endif\nfloat modded \x3d mod(a_opacityInfo, 128.0);\nfloat targetOpacity \x3d (a_opacityInfo - modded) / 128.0;\nfloat startOpacity \x3d modded / 127.0;\nfloat interpolatedOpacity \x3d clamp(startOpacity + 2.0 * (targetOpacity - 0.5) * u_time / u_fadeDuration, 0.0, 1.0);\nv_opacity *\x3d interpolatedOpacity;\nmediump float a_angle \x3d a_levelInfo[1];\nmediump float a_minLevel \x3d a_levelInfo[2];\nmediump float a_maxLevel \x3d a_levelInfo[3];\nmediump vec2 a_tex \x3d a_texAngleRange.xy;\nmediump float delta_z \x3d 0.0;\nmediump float rotated \x3d mod(a_angle + u_mapRotation, 256.0);\ndelta_z +\x3d (1.0 - step(u_keepUpright, 0.0)) * step(64.0, rotated) * (1.0 - step(192.0, rotated));\ndelta_z +\x3d 1.0 - step(a_minLevel, u_level);\ndelta_z +\x3d step(a_maxLevel, u_level);\ndelta_z +\x3d step(v_opacity, 0.0);\nvec2 offset \x3d C_OFFSET_PRECISION * a_vertexOffset;\nv_size \x3d abs(offset);\n#ifdef SDF\noffset \x3d (120.0 / 86.0) * offset;\n#endif\nmediump vec3 pos \x3d u_dvsMat3 * vec3(a_pos, 1.0) + u_displayViewMat3 * vec3(size * offset, 0.0) + u_displayMat3 * vec3(u_iconTranslation, 0.0);\ngl_Position \x3d vec4(pos.xy, u_depth + delta_z, 1.0);\nv_tex \x3d a_tex.xy / u_mosaicSize;\n}"}, line:{"line.frag":"precision lowp float;\nvarying mediump vec2 v_normal;\nvarying highp float v_accumulatedDistance;\nvarying mediump float v_lineHalfWidth;\nvarying lowp vec4 v_color;\nvarying mediump float v_blur;\n#if defined (PATTERN) || defined(SDF)\nvarying mediump vec4 v_tlbr;\nvarying mediump vec2 v_patternSize;\nvarying mediump float v_widthRatio;\nuniform sampler2D u_texture;\nuniform mediump float u_antialiasing;\n#endif\n#ifdef SDF\n#include \x3cutil/encoding.glsl\x3e\n#endif\nvoid main()\n{\nmediump float fragDist \x3d length(v_normal) * v_lineHalfWidth;\nlowp float alpha \x3d clamp((v_lineHalfWidth - fragDist) / v_blur, 0.0, 1.0);\n#ifdef PATTERN\nmediump float relativeTexX \x3d fract(v_accumulatedDistance / (v_patternSize.x * v_widthRatio));\nmediump float relativeTexY \x3d 0.5 + v_normal.y * v_lineHalfWidth / (v_patternSize.y * v_widthRatio);\nmediump vec2 texCoord \x3d mix(v_tlbr.xy, v_tlbr.zw, vec2(relativeTexX, relativeTexY));\nlowp vec4 color \x3d texture2D(u_texture, texCoord);\ngl_FragColor \x3d alpha * v_color[3] * color;\n#elif defined(SDF)\nmediump float relativeTexX \x3d fract((v_accumulatedDistance * 0.5) / (v_patternSize.x * v_widthRatio));\nmediump float relativeTexY \x3d 0.5 + 0.25 * v_normal.y;\nmediump vec2 texCoord \x3d mix(v_tlbr.xy, v_tlbr.zw, vec2(relativeTexX, relativeTexY));\nmediump float d \x3d rgba2float(texture2D(u_texture, texCoord)) - 0.5;\nfloat dist \x3d d * (v_lineHalfWidth + u_antialiasing / 2.0);\ngl_FragColor \x3d alpha * clamp(0.5 - dist, 0.0, 1.0) * v_color;\n#else\ngl_FragColor \x3d alpha * v_color;\n#endif\n}", "line.vert":"precision mediump float;\nattribute vec2 a_pos;\nattribute vec4 a_extrude_offset;\nattribute vec4 a_dir_normal;\nattribute vec2 a_accumulatedDistance;\n#pragma header\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform highp mat3 u_displayViewMat3;\nuniform mediump float u_zoomFactor;\nuniform mediump vec2 u_lineTranslation;\nuniform mediump float u_antialiasing;\nuniform mediump float u_depth;\nvarying mediump vec2 v_normal;\nvarying highp float v_accumulatedDistance;\nconst float scale \x3d 1.0 / 31.0;\nconst mediump float tileCoordRatio \x3d 8.0;\n#if defined (SDF)\nconst mediump float sdfPatternHalfWidth \x3d 15.5;\n#endif\n#if defined (PATTERN) || defined(SDF)\nuniform mediump vec2 u_mosaicSize;\nvarying mediump vec4 v_tlbr;\nvarying mediump vec2 v_patternSize;\nvarying mediump float v_widthRatio;\n#endif\nvarying lowp vec4 v_color;\nvarying mediump float v_lineHalfWidth;\nvarying mediump float v_blur;\nvoid main()\n{\n#pragma main\nv_color \x3d color * opacity;\nv_blur \x3d blur + u_antialiasing;\nv_normal \x3d a_dir_normal.zw * scale;\n#if defined (PATTERN) || defined(SDF)\nv_tlbr \x3d tlbr / u_mosaicSize.xyxy;\nv_patternSize \x3d vec2(tlbr.z - tlbr.x, tlbr.y - tlbr.w);\n#if defined (PATTERN)\nv_widthRatio \x3d width / v_patternSize.y;\n#else\nv_widthRatio \x3d width / sdfPatternHalfWidth / 2.0;\n#endif\n#endif\nv_lineHalfWidth \x3d (width + u_antialiasing) * 0.5;\nmediump vec2 dir \x3d a_dir_normal.xy * scale;\nmediump vec2 offset_ \x3d a_extrude_offset.zw * scale * offset;\nmediump vec2 dist \x3d v_lineHalfWidth * scale * a_extrude_offset.xy;\nmediump vec3 pos \x3d u_dvsMat3 * vec3(a_pos + offset_ * tileCoordRatio / u_zoomFactor, 1.0) + u_displayViewMat3 * vec3(dist, 0.0) + u_displayMat3 * vec3(u_lineTranslation, 0.0);\ngl_Position \x3d vec4(pos.xy, u_depth, 1.0);\n#if defined (PATTERN) || defined(SDF)\nv_accumulatedDistance \x3d a_accumulatedDistance.x * u_zoomFactor / tileCoordRatio + dot(dir, dist + offset_);\n#endif\n}"}, outline:{"outline.frag":"varying lowp vec4 v_color;\nvarying mediump vec2 v_normal;\nvoid main()\n{\nlowp float dist \x3d abs(v_normal.y);\nlowp float alpha \x3d smoothstep(1.0, 0.0, dist);\ngl_FragColor \x3d alpha * v_color;\n}","outline.vert":"attribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_xnormal;\n#pragma header\nvarying lowp vec4 v_color;\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform mediump vec2 u_fillTranslation;\nuniform mediump float u_depth;\nuniform mediump float u_outline_width;\nvarying lowp vec2 v_normal;\nconst float scale \x3d 1.0 / 15.0;\nvoid main()\n{\n#pragma main\nv_color \x3d color * opacity;\nv_normal \x3d a_xnormal;\nmediump vec2 dist \x3d u_outline_width * scale * a_offset;\nmediump vec3 pos \x3d u_dvsMat3 * vec3(a_pos, 1.0) + u_displayMat3 * vec3(dist + u_fillTranslation, 0.0);\ngl_Position \x3d vec4(pos.xy, u_depth, 1.0);\n}"}, text:{"text.frag":"uniform lowp sampler2D u_texture;\nvarying lowp vec2 v_tex;\nvarying lowp vec4 v_color;\nvarying mediump float v_edgeWidth;\nvarying mediump float v_edgeDistance;\nvoid main()\n{\nlowp float dist \x3d texture2D(u_texture, v_tex).a;\nmediump float alpha \x3d smoothstep(v_edgeDistance - v_edgeWidth, v_edgeDistance + v_edgeWidth, dist);\ngl_FragColor \x3d alpha * v_color;\n}","text.vert":"attribute vec2 a_pos;\nattribute vec2 a_vertexOffset;\nattribute vec4 a_texAngleRange;\nattribute vec4 a_levelInfo;\nattribute float a_opacityInfo;\n#pragma header\nvarying lowp vec4 v_color;\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform highp mat3 u_displayViewMat3;\nuniform mediump vec2 u_textTranslation;\nuniform vec2 u_mosaicSize;\nuniform mediump float u_depth;\nuniform mediump float u_mapRotation;\nuniform mediump float u_level;\nuniform lowp float u_keepUpright;\nuniform mediump float u_fadeDuration;\nvarying lowp vec2 v_tex;\nconst float offsetPrecision \x3d 1.0 / 8.0;\nconst mediump float edgePos \x3d 0.75;\nuniform mediump float u_antialiasingWidth;\nvarying mediump float v_edgeDistance;\nvarying mediump float v_edgeWidth;\nuniform lowp float u_halo;\nconst float sdfFontScale \x3d 1.0 / 24.0;\nconst float sdfPixel \x3d 3.0;\nuniform highp float u_time;\nvoid main()\n{\n#pragma main\nif (u_halo \x3e 0.5)\n{\nv_color \x3d halo_color * opacity;\nhalo_width *\x3d sdfPixel;\nhalo_blur *\x3d sdfPixel;\n}\nelse\n{\nv_color \x3d color * opacity;\nhalo_width \x3d 0.0;\nhalo_blur \x3d 0.0;\n}\nfloat modded \x3d mod(a_opacityInfo, 128.0);\nfloat targetOpacity \x3d (a_opacityInfo - modded) / 128.0;\nfloat startOpacity \x3d modded / 127.0;\nfloat interpolatedOpacity \x3d clamp(startOpacity + 2.0 * (targetOpacity - 0.5) * u_time / u_fadeDuration, 0.0, 1.0);\nv_color *\x3d interpolatedOpacity;\nmediump float a_angle \x3d a_levelInfo[1];\nmediump float a_minLevel \x3d a_levelInfo[2];\nmediump float a_maxLevel \x3d a_levelInfo[3];\nmediump vec2 a_tex \x3d a_texAngleRange.xy;\nmediump float a_visMinAngle \x3d a_texAngleRange.z;\nmediump float a_visMaxAngle \x3d a_texAngleRange.w;\nmediump float delta_z \x3d 0.0;\nmediump float angle \x3d mod(a_angle + u_mapRotation, 256.0);\nif (a_visMinAngle \x3c a_visMaxAngle)\n{\ndelta_z +\x3d (1.0 - step(u_keepUpright, 0.0)) * (step(a_visMaxAngle, angle) + (1.0 - step(a_visMinAngle, angle)));\n}\nelse\n{\ndelta_z +\x3d (1.0 - step(u_keepUpright, 0.0)) * (step(a_visMaxAngle, angle) * (1.0 - step(a_visMinAngle, angle)));\n}\ndelta_z +\x3d 1.0 - step(a_minLevel, u_level);\ndelta_z +\x3d step(a_maxLevel, u_level);\ndelta_z +\x3d step(v_color[3], 0.0);\nv_tex \x3d a_tex.xy / u_mosaicSize;\nv_edgeDistance \x3d edgePos - halo_width / size;\nv_edgeWidth \x3d (u_antialiasingWidth + halo_blur) / size;\nmediump vec3 pos \x3d u_dvsMat3 * vec3(a_pos, 1.0) + sdfFontScale * u_displayViewMat3 * vec3(offsetPrecision * size * a_vertexOffset, 0.0) + u_displayMat3 * vec3(u_textTranslation, 0.0);\ngl_Position \x3d vec4(pos.xy, u_depth + delta_z, 1.0);\n}"}, util:{"encoding.glsl":"const vec4 rgba2float_factors \x3d vec4(\n255.0 / (256.0),\n255.0 / (256.0 * 256.0),\n255.0 / (256.0 * 256.0 * 256.0),\n255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n);\nfloat rgba2float(vec4 rgba) {\nreturn dot(rgba, rgba2float_factors);\n}","util.glsl":"float nextPOT(in float x) {\nreturn pow(2.0, ceil(log2(abs(x))));\n}"}}})},"esri/views/2d/engine/webgl/BitBlitRenderer":function(){define("exports ../../../../core/maybe ./DefaultVertexAttributeLayouts ./shaders/BitBlitPrograms ../../../webgl/BufferObject ../../../webgl/enums ../../../webgl/ProgramTemplate ../../../webgl/VertexArrayObject".split(" "), function(e,g,q,h,m,l,d,b){class a{constructor(){this._initialized=!1}dispose(){this._program=g.disposeMaybe(this._program);this._vertexArrayObject=g.disposeMaybe(this._vertexArrayObject)}render(f,n,c,r){f&&(this._initialized||this._initialize(f),f.setBlendFunctionSeparate(l.BlendFactor.ONE,l.BlendFactor.ONE_MINUS_SRC_ALPHA,l.BlendFactor.ONE,l.BlendFactor.ONE_MINUS_SRC_ALPHA),f.bindVAO(this._vertexArrayObject),f.useProgram(this._program),n.setSamplingMode(c),f.bindTexture(n,0),this._program.setUniform1i("u_tex", 0),this._program.setUniform1f("u_opacity",r),f.drawArrays(l.PrimitiveType.TRIANGLE_STRIP,0,4),f.bindTexture(null,0),f.bindVAO())}_initialize(f){if(this._initialized)return!0;const n=d.createProgram(f,h.bitBlit);if(!n)return!1;const c=new Int8Array(16);c[0]=-1;c[1]=-1;c[2]=0;c[3]=0;c[4]=1;c[5]=-1;c[6]=1;c[7]=0;c[8]=-1;c[9]=1;c[10]=0;c[11]=1;c[12]=1;c[13]=1;c[14]=1;c[15]=1;f=new b.VertexArrayObject(f,h.bitBlit.attributes,q.PosTex2b,{geometry:m.BufferObject.createVertex(f,l.Usage.STATIC_DRAW,c)});this._program= n;this._vertexArrayObject=f;return this._initialized=!0}}e.BitBlitRenderer=a;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaders/BitBlitPrograms":function(){define(["exports","./sources/resolver"],function(e,g){g={shaders:{vertexShader:g.resolveIncludes("bitBlit/bitBlit.vert"),fragmentShader:g.resolveIncludes("bitBlit/bitBlit.frag")},attributes:new Map([["a_pos",0],["a_tex",1]])};e.bitBlit=g;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})}, "esri/views/2d/engine/webgl/MaterialManager":function(){define(["./shaders/MaterialPrograms"],function(e){class g{constructor(q){this._rctx=q;this._programByKey=new Map}dispose(){this._programByKey.forEach(q=>q.dispose());this._programByKey.clear()}getProgram(q,h=[]){const m=q.vsPath+"."+q.fsPath+JSON.stringify(h);if(this._programByKey.has(m))return this._programByKey.get(m);h={...h.map(a=>"string"===typeof a?{name:a,value:!0}:a).reduce((a,f)=>({...a,[f.name]:f.value}),{})};const {vsPath:l,fsPath:d, attributes:b}=q;q=e.createProgramTemplate(l,d,b,h);q=this._rctx.programCache.acquire(q.shaders.vertexShader,q.shaders.fragmentShader,q.attributes);if(!q)throw Error("Unable to get program for key: ${key}");this._programByKey.set(m,q);return q}}return g})},"esri/views/2d/engine/webgl/shaders/MaterialPrograms":function(){define(["exports","./sources/resolver","../../../../webgl/programUtils"],function(e,g,q){e.createProgramTemplate=(h,m,l,d)=>{h+=h.substring(h.lastIndexOf("/"));m+=m.substring(m.lastIndexOf("/")); const b={};for(const f in d){let n=void 0;var a=f;n=""+a[0].toUpperCase();for(let c=1;cd.getLogger("esri.views.2d.engine.webgl.TextureManager").error(new h(C,G,H));class F{static fromMosaic(C,G){return new F(C,G.page,G.sdf)}constructor(C,G,H){this.mosaicType=C;this.page=G;this.sdf=H}}class E{constructor(C){this._requestRender= C;this._resourceManager=new n;this._invalidFontsMap=new Map;this._sdfConverter=new u(k.svgSdfTextureInnerSize);this._bindingInfos=[];this._hashToBindingIndex=new Map;this._ongoingRasterizations=new Map;this._imageRequestQueue=new A.QueueProcessor({concurrency:10,process:async(G,H)=>{b.throwIfAborted(H);try{return await g(G,{responseType:"image",signal:H})}catch(K){if(!b.isAbortError(K))throw new h("mapview-invalid-resource",`Could not fetch requested resource at ${G}`,K);throw K;}}});this._spriteMosaic= new y(2048,2048,500);this._glyphSource=new w(`${e.fontsUrl}/{fontstack}/{range}.pbf`);this._glyphMosaic=new t(1024,1024,this._glyphSource);this._rasterizer=new r(this.resourceManager)}dispose(){this._spriteMosaic.dispose();this._glyphMosaic.dispose();this._rasterizer.dispose();this._sdfConverter.dispose();this._sdfConverter=this._glyphMosaic=this._spriteMosaic=null;this._hashToBindingIndex.clear();this._bindingInfos=this._hashToBindingIndex=null;this._ongoingRasterizations.clear();this._ongoingRasterizations= null;this._imageRequestQueue.clear();this._imageRequestQueue=null;this._resourceManager.destroy()}get sprites(){return this._spriteMosaic}get glyphs(){return this._glyphMosaic}get resourceManager(){return this._resourceManager}async rasterizeItem(C,G){if(null==C)return D("mapview-null-resource","Unable to rasterize null resource"),null;if("cim-rasterization-info"!==C.type)return D("mapview-unexpected-resource","Unable to rasterize resource"),null;({resource:C}=C);if("text"===C.type){G=await this._rasterizeText(C, G);for(var H of G.glyphs)this._setTextureBinding(p.MosaicType.GLYPH,H);return G}(H=await this._rasterizeSprite(C,G))&&this._setTextureBinding(p.MosaicType.SPRITE,H);return H}getMosaicInfo(C,G,H=!1){C=this._getTextureBindingInfo(C,G,H);return C?{size:C.size,texture:{texture:C.texture,unit:"sprite"===C.type?k.textureBindingSpriteAtlas:k.textureBindingGlyphAtlas}}:(D("mapview-invalid-resource",`Unable to find resource for ${G}`),{size:[0,0],texture:{texture:null,unit:0}})}_getTextureBindingInfo(C,G, H){var K=this._bindingInfos[G-1];G=K.page;H=H?z.TextureSamplingMode.LINEAR_MIPMAP_LINEAR:z.TextureSamplingMode.LINEAR;switch(K.mosaicType){case p.MosaicType.SPRITE:K=this.sprites.getWidth(G);var J=this.sprites.getHeight(G);K=[K,J];C=this._spriteMosaic.getTexture(C,G);C.setSamplingMode(H);return{type:"sprite",texture:C,size:K};case p.MosaicType.GLYPH:return K=[this.glyphs.width,this.glyphs.height],J=this._glyphMosaic.getTexture(C,G),this._glyphMosaic.bind(C,H,G,k.textureBindingGlyphAtlas),J.setSamplingMode(H), {type:"glyph",texture:J,size:K};default:return D("mapview-texture-manager",`Cannot handle unknown type ${K.mosaicType}`),null}}_hashMosaic(C,G){return 1|C<<1|(G.sdf?1:0)<<2|G.page<<3}_setTextureBinding(C,G){const H=this._hashMosaic(C,G);this._hashToBindingIndex.has(H)||(C=F.fromMosaic(C,G),this._hashToBindingIndex.set(H,this._bindingInfos.length+1),this._bindingInfos.push(C));G.textureBinding=this._hashToBindingIndex.get(H)}async _rasterizeText(C,G){const {font:H,textString:K}=C;C=m.getFullyQualifiedFontName(H); var J=this._invalidFontsMap.has(C);const [O,Q]=q.bidiText(K),T=x.charCodes(O);try{return J=J?"arial-unicode-ms-regular":C,l("esri-2d-stabilize-glyphs")&&await this._glyphMosaic.preloadASCIIGlyphCache(J),{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(J,T,G),isRightToLeft:Q}}catch(I){return D("mapview-invalid-resource",`Couldn't find font ${C}. Falling back to Arial Unicode MS Regular`),this._invalidFontsMap.set(C,!0),{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems("arial-unicode-ms-regular", T,G),isRightToLeft:Q}}}_hashSpriteResource(C){switch(C.type){case "path":return`path:${C.path}.${C.asFill?1:0}`;case "CIMPictureMarker":return`${C.type}:${C.url}:${C.size}`;case "CIMPictureFill":return`${C.type}:${C.url}:${C.height}`;case "CIMPictureStroke":return`${C.type}:${C.url}:${C.width}`;case "dash":return`dash:${C.capStyle}.${C.dashTemplate.join("")}`;case "sdf":return`sdf:${JSON.stringify(C.geom)}.${C.asFill?1:0}`;case "fill-style":return`fill_style:${C.style}`;case "animated":return JSON.stringify(x.discardUrlIfHasUrlHash(C)); case "CIMHatchFill":return JSON.stringify(C);case "CIMVectorMarker":return JSON.stringify(C)}}async _rasterizeSprite(C,G){if(!C)return null;const H=f.numericHash(this._hashSpriteResource(C));if(this._spriteMosaic.has(H))return this._spriteMosaic.getSpriteItem(H);if("url"in C&&C.url||"CIMPictureFill"===C.type||"CIMPictureStroke"===C.type||"CIMPictureMarker"===C.type||"CIMVectorMarker"===C.type){const K=[];c.CIMSymbolHelper.fetchResources({type:"CIMPointSymbol",symbolLayers:[C]},this._resourceManager, K);0this._ongoingRasterizations.delete(C));return G}async _handleSVG(C, G,H){const K=[k.svgSdfTextureInnerSize,k.svgSdfTextureInnerSize],{asFill:J}=C;C=await this._sdfConverter.draw(C.path,J,H);return this._addItemToMosaic(G,K,{type:"static",data:new Uint32Array(C.buffer)},!1,!0,!0)}async _handleGIFOrPNG(C,G,H){const K=this.resourceManager.getResource(C.url);if(null==K)return null;const {width:J,height:O}=K;if(K instanceof HTMLImageElement){if("animated"===C.type)return D("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null; const {size:T,sdf:I,image:L}=this._rasterizer.rasterizeImageResource(J,O,K,"colorSubstitutions"in C?C.colorSubstitutions:void 0);return this._addItemToMosaic(G,T,{type:"static",data:L},B(C),I,!1)}let Q;"animated"===C.type?(H=!1,Q={playAnimation:C.playAnimation,reverseAnimation:C.reverseAnimation,randomizeStartTime:C.randomizeStartTime,randomizeStartSeed:C.randomizeStartSeed,startTimeOffset:C.startTimeOffset,duration:C.duration,repeatType:C.repeatType,repeatDelay:C.repeatDelay},C=C.startGroup||0): (H=B(C),Q={},C=0);C=new v.AnimatableTextureResource(K,this._requestRender,Q,C);return this._addItemToMosaic(G,[C.width,C.height],{type:"animated",data:C},H,!1,!1)}async _handleImage(C,G,H){const K=C.url;var J;(J=K&&(K.includes(".gif")||null!=K&&K.startsWith("data:image/gif")))||(J=K&&(K.includes(".png")||null!=K&&K.startsWith("data:image/png")));if(J)return this._handleGIFOrPNG(C,G,H);if("animated"===C.type)return D("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."), null;try{let O;const Q=this.resourceManager.getResource(K);if(null!=Q&&Q instanceof HTMLImageElement)O=Q;else{const {data:R}=await this._imageRequestQueue.push(K,{...H});O=R}x.isSVGImage(K)&&("width"in C&&"height"in C?(O.width=a.pt2px(C.width),O.height=a.pt2px(C.height)):"cim"in C&&(O.width=a.pt2px(C.width??C.scaleX*C.size),O.height=a.pt2px(C.size)));if(!O.width||!O.height)return null;const {size:T,sdf:I,image:L}=this._rasterizer.rasterizeImageResource(O.width,O.height,O,"colorSubstitutions"in C? C.colorSubstitutions:void 0);return this._addItemToMosaic(G,T,{type:"static",data:L},B(C),I,!1)}catch(O){if(!b.isAbortError(O))throw new h("mapview-invalid-resource",`Could not fetch requested resource at ${K}. ${O.message}`);throw O;}}_addItemToMosaic(C,G,H,K,J,O,Q){return this._spriteMosaic.addSpriteItem(C,G,H,K,J,O,Q)}}return E})},"esri/symbols/cim/CIMResourceManager":function(){define(["../../core/fontUtils","../../core/imageUtils"],function(e,g){class q{constructor(){this._resourceMap=new Map; this._inFlightResourceMap=new Map;this.geometryEnginePromise=this.geometryEngine=null}destroy(){this._inFlightResourceMap.clear();this._resourceMap.clear()}getResource(h){return this._resourceMap.get(h)??null}async fetchResource(h,m){var l=this._resourceMap.get(h);if(l)return{width:l.width,height:l.height};if(l=this._inFlightResourceMap.get(h))return l.then(d=>({width:d.width,height:d.height}));l=g.getImageData(h,m);this._inFlightResourceMap.set(h,l);return l.then(d=>{this._inFlightResourceMap.delete(h); this._resourceMap.set(h,d);return{width:d.width,height:d.height}},()=>({width:0,height:0}))}deleteResource(h){this._inFlightResourceMap.delete(h);this._resourceMap.delete(h)}loadFont(h){return e.loadFont(h)}}return q})},"esri/symbols/cim/Rasterizer":function(){define("./CIMSymbolHelper ./rasterizingUtils ./Rect ./SDFHelper ./utils ../../views/2d/engine/webgl/definitions".split(" "),function(e,g,q,h,m,l){function d(a){if(!a)return null;const [f,n,c]=h.buildSDF(a);return f?{size:[n,c],image:new Uint32Array(f.buffer), sdf:!0,simplePattern:!0,anchorX:0,anchorY:0}:null}class b{constructor(a){this._resourceManager=a;this._cachedRasterizationCanvas=null}dispose(){this._cachedRasterizationCanvas=null}get _canvas(){this._cachedRasterizationCanvas||(this._cachedRasterizationCanvas=document.createElement("canvas"));return this._cachedRasterizationCanvas}rasterizeJSONResource(a){switch(a.type){case "dash":const [f,n,c]=g.rasterizeDash(a.dashTemplate,a.capStyle);return{size:[n,c],image:new Uint32Array(f.buffer),sdf:!0,simplePattern:!0, anchorX:0,anchorY:0};case "fill-style":const [r,k,p,t]=g.rasterizeFillStyle(this._canvas,a,l.patternFillRasterizationScale);return{size:[k,p],image:new Uint32Array(r.buffer),sdf:!1,simplePattern:!0,anchorX:0,anchorY:0,rasterizationScale:t};case "sdf":return d(a);case "CIMHatchFill":case "CIMVectorMarker":case "CIMPictureMarker":return this._rasterizeCIMJSONResource(a)}}_rasterizeCIMJSONResource(a){switch(a.type){case "CIMHatchFill":return a=e.CIMSymbolHelper.fromCIMHatchFill(a,l.patternFillRasterizationScale), this._rasterizeCIMVectorMarker(a);case "CIMPictureMarker":return a=e.CIMSymbolHelper.fromCIMInsidePolygon(a),this._rasterizeCIMVectorMarker(a);case "CIMVectorMarker":if("CIMMarkerPlacementInsidePolygon"===a.markerPlacement?.type)return a=e.CIMSymbolHelper.fromCIMInsidePolygon(a),this._rasterizeCIMVectorMarker(a);const f=h.getSDFInfo(a);return f&&!a.avoidSDFRasterization?d(f):this._rasterizeCIMVectorMarker(a,!1)}}_rasterizeCIMVectorMarker(a,f=!0){f=f?q.fromExtent(a.frame):null;const [n,c,r,k,p]=e.CIMSymbolHelper.rasterize(this._canvas, a,f,this._resourceManager);return n?{size:[c,r],image:new Uint32Array(n.buffer),sdf:!1,simplePattern:!1,anchorX:k,anchorY:p}:null}rasterizeImageResource(a,f,n,c){this._canvas.width=a;this._canvas.height=f;var r=this._canvas.getContext("2d",{willReadFrequently:!0});n instanceof ImageData?r.putImageData(n,0,0):(n.setAttribute("width",`${a}px`),n.setAttribute("height",`${f}px`),r.drawImage(n,0,0,a,f));n=r.getImageData(0,0,a,f);n=new Uint8Array(n.data);if(c)for(var k of c)if(k&&k.oldColor&&4===k.oldColor.length&& k.newColor&&4===k.newColor.length){const [p,t,w,u]=k.oldColor,[y,x,v,A]=k.newColor;if(p!==y||t!==x||w!==v||u!==A)for(c=0;c{n.delete(c)}).catch(k=>{n.delete(c);g.throwIfNotAbortError(k)}));return n.get(c)}class f{constructor(n,c,r){this.height=this.width=0;this._dirties=[];this._glyphData=[];this._currentPage=0;this._glyphCache={};this._textures=[];this._rangePromises=new Map;this._preloadCache={};this.width=n;this.height=c;this._glyphSource=r;this._binPack=new h(n-4,c-4);this._glyphData.push(new Uint8Array(n*c));this._dirties.push(!0);this._textures.push(null); this._initDecorationGlyphs()}dispose(){this._binPack=null;for(const n of this._textures)n&&n.dispose();this._textures.length=0;this._glyphData.length=0}_initDecorationGlyphs(){var n=[117,149,181,207,207,181,149,117];const c=[];var r=[];for(let k=0;kt;t++){const w=3<=k&&5>k&&3<=t&&8>t?255:0;c.push(p);r.push(w)}}n={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(c)};r={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(r)}; this._recordGlyph(n);this._recordGlyph(r)}getTexture(n,c){if(!this._textures[c]){const r=new d.TextureDescriptor;r.pixelFormat=m.PixelFormat.ALPHA;r.wrapMode=m.TextureWrapMode.CLAMP_TO_EDGE;r.width=this.width;r.height=this.height;this._textures[c]=new l.Texture(n,r,new Uint8Array(this.width*this.height))}this._dirties[c]&&(this._textures[c].setData(this._glyphData[c]),this._dirties[c]=!1);return this._textures[c]}async getGlyphItems(n,c,r){const k=this._getGlyphCache(n);await this._fetchRanges(n, c,r);return c.map(p=>this._getMosaicItem(k,n,p))}bind(n,c,r,k){r=this.getTexture(n,r);r.setSamplingMode(c);n.bindTexture(r,k)}preloadASCIIGlyphCache(n){var c=this._preloadCache[n];if(null!=c)return c;c=this._glyphSource.preloadASCIIRange(n).then(()=>{const r=this._getGlyphCache(n);for(let k=0;256>k;k++)this._getMosaicItem(r,n,k)});return this._preloadCache[n]=c}_getGlyphCache(n){this._glyphCache[n]||(this._glyphCache[n]={});return this._glyphCache[n]}_invalidate(){this._dirties[this._currentPage]= !0}async _fetchRanges(n,c,r){const k=[];b(c).forEach(p=>{k.push(this._fetchRange(n,p,r))});await Promise.all(k)}async _fetchRange(n,c,r){if(!(256this._glyphSource.getRange(n,c,r))}_getMosaicItem(n,c,r){if(!n[r]){c=this._glyphSource.getGlyph(c,r);if(!c?.metrics)return{rect:new q(0,0,0,0),page:0,metrics:{left:0,width:0,height:0,advance:0,top:0},code:r,sdf:!0};const k=this._recordGlyph(c);n[r]={rect:k,page:this._currentPage,metrics:c.metrics,code:r,sdf:!0};this._invalidate()}return n[r]}_recordGlyph(n){var c= n.metrics;if(0===c.width)c=new q(0,0,0,0);else{const r=c.width+6,k=c.height+6;c=this._binPack.allocate(r,k);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(null),this._initDecorationGlyphs(),this._binPack=new h(this.width-4,this.height-4),c=this._binPack.allocate(r,k));const p=this._glyphData[this._currentPage];n=n.bitmap; let t,w;if(n)for(let u=0;uthis._width||h>this._height)return new e;let m=null,l=-1;for(let d=0;dq&&this._free.push(new e(m.x+ q,m.y,m.width-q,h)),m.height>h&&this._free.push(new e(m.x,m.y+h,m.width,m.height-h))):(m.width>q&&this._free.push(new e(m.x+q,m.y,m.width-q,m.height)),m.height>h&&this._free.push(new e(m.x,m.y+h,q,m.height-h)));return new e(m.x,m.y,q,h)}release(q){for(let h=0;h{a.addRange(d,new q(new g(new Uint8Array(c.data),new DataView(c.data))))})}async preloadASCIIRange(l){const d=this._getFontStack(l);l=this._baseURL.replace("{fontstack}", l).replace("{range}","0-255");l=await e(l,{responseType:"array-buffer"});l=new q(new g(new Uint8Array(l.data),new DataView(l.data)));for(let b=0;255>=b;b++)d.getRange(b)||d.addRange(b,l)}getGlyph(l,d){if(l=this._getFontStack(l))if(l=l.getRange(Math.floor(d/256)))return{metrics:l.getMetrics(d),bitmap:l.getBitmap(d)}}_getFontStack(l){let d=this._glyphInfo[l];d||=this._glyphInfo[l]=new h;return d}}return m})},"esri/views/2d/engine/webgl/SDFConverter":function(){define(["../../../../core/floatRGBA","../../../../core/promiseUtils"], function(e,g){class q{constructor(h,m=2){this._textureSize=h;this._rasterizationScale=m;this._canvasSize=this._textureSize*this._rasterizationScale;this._svg=null;({_canvasSize:h}=this);m=document.createElement("canvas");m.width=m.height=h;this._context=m.getContext("2d",{willReadFrequently:!1});this._gridOuter=new Float64Array(h*h);this._gridInner=new Float64Array(h*h);this._f=new Float64Array(h);this._d=new Float64Array(h);this._z=new Float64Array(h+1);this._v=new Int16Array(h)}dispose(){this._context= this._gridOuter=this._gridInner=this._f=this._d=this._z=this._v=null;this._svg&&(document.body.removeChild(this._svg),this._svg=null)}draw(h,m,l){const {_canvasSize:d,_textureSize:b,_rasterizationScale:a}=this,f=b/4;this._initSVG();const n=this.createSVGString(h,m);return new Promise((c,r)=>{const k=new Image;k.src="data:image/svg+xml; charset\x3dutf8, "+encodeURIComponent(n);k.onload=()=>{k.onload=null;this._context.clearRect(0,0,d,d);this._context.drawImage(k,0,0,d,d);var t=this._context.getImageData(0, 0,d,d);const w=new Uint8Array(b*b*4);for(var u=0;ur(g.createAbortError()))})}_initSVG(){if(!this._svg){const h=document.createElementNS("http://www.w3.org/2000/svg","svg");h.setAttribute("style","position: absolute;");h.setAttribute("width","0");h.setAttribute("height","0");h.setAttribute("aria-hidden","true");h.setAttribute("role","presentation");document.body.appendChild(h);this._svg=h}return this._svg}createSVGString(h,m){const l=this._initSVG(),d=document.createElementNS("http://www.w3.org/2000/svg","path");d.setAttribute("d",h);l.appendChild(d); h=d.getBBox();var b=h.width/h.height;const a=this._canvasSize/2;let f,n;1${l.innerHTML}`;l.removeChild(d);return m}_edt(h, m,l){const d=this._f,b=this._d,a=this._v,f=this._z;for(var n=0;n=this._mosaicPages.length?-1:this._mosaicPages[k].size[0]}getHeight(k){return k>=this._mosaicPages.length?-1:this._mosaicPages[k].size[1]}getPageTexture(k){return k=v.width||0>=v.height)return null;y={type:"sprite",rect:v,width:p[0],height:p[1],sdf:u,simplePattern:y,rasterizationScale:x,page:A};this._mosaicRects.set(k,y);f(t)&&(g("esri-mosaic-debug")&&this._showDebugSprite(p,t.data),this._copy({rect:v,spriteSize:p,spriteData:t.data,page:A, pageSize:z,repeat:w,sdf:u}));return y}hasItemsToProcess(){return 0!==this._spriteCopyQueue.length}processNextItem(){const k=this._spriteCopyQueue.pop();k&&this._copy(k)}getMosaicItemPosition(k){k=this.getSpriteItem(k);const p=k?.rect;if(!p)return null;p.width=k.width;p.height=k.height;const t=q.spritePadding,w=this._mosaicPages[k.page].size;return{size:[k.width,k.height],tl:[(p.x+t)/w[0],(p.y+t)/w[1]],br:[(p.x+t+k.width)/w[0],(p.y+t+k.height)/w[1]],page:k.page}}bind(k,p,t=0,w=0){const u=this._mosaicPages[t], y=u.mosaicsData;let x=u.texture;x||(x=n(k,u.size),u.texture=x);x.setSamplingMode(p);f(y)?(k.bindTexture(x,w),u.dirty&&(x.setData(new Uint8Array(y.data.buffer)),x.generateMipmap(),g("esri-mosaic-debug")&&this._showDebugPage(t))):(y.data.loadFrame(x),k.bindTexture(x,w),x.generateMipmap());u.dirty=!1}getTexture(k,p=0){const t=this._mosaicPages[p],w=t.mosaicsData;let u=t.texture;u||(u=n(k,t.size),t.texture=u);f(w)?t.dirty&&(u.setData(new Uint8Array(w.data.buffer)),u.generateMipmap(),g("esri-mosaic-debug")&& this._showDebugPage(p)):(w.data.loadFrame(u),u.generateMipmap());t.dirty=!1;return u}dispose(){this._binPack=null;for(const p of this._mosaicPages){var k=p.texture;k&&k.dispose();k=p.mosaicsData;f(k)||k.data.destroy()}this._mosaicPages=null;this._mosaicRects.clear()}static _copyBits(k,p,t,w,u,y,x,v,A,z,B){let D=w*p+t;x=v*y+x;if(B)for(x-=y,B=-1;B<=z;B++,D=((B+z)%z+w)*p+t,x+=y)for(v=-1;v<=A;v++)u[x+v]=k[D+(v+A)%A];else for(t=0;t= this._mosaicPages.length)){var p=this._mosaicPages[k.page],t=p.mosaicsData;if(!f(p.mosaicsData))throw new e("mapview-invalid-resource","unsuitable data type!");c._copyBits(k.spriteData,k.spriteSize[0],0,0,t.data,k.pageSize[0],k.rect.x+q.spritePadding,k.rect.y+q.spritePadding,k.spriteSize[0],k.spriteSize[1],k.repeat);p.dirty=!0}}_allocateImage(k,p){k+=2*q.spritePadding;p+=2*q.spritePadding;var t=Math.max(k,p);if(this._maxItemSize&&this._maxItemSize=t.width?(t=this._mosaicPages[this._currentPage],!t.dirty&&f(t.mosaicsData)&&(t.mosaicsData.data=null),this._currentPage=this._mosaicPages.length,this._mosaicPages.push({mosaicsData:{type:"static",data:new Uint32Array(this._pageWidth*this._pageHeight)},size:[this._pageWidth,this._pageHeight], dirty:!0,texture:void 0}),this._binPack=new l(this._pageWidth,this._pageHeight),this._allocateImage(k,p)):[t,this._currentPage,[this._pageWidth,this._pageHeight]]}_showDebugSprite([k,p],t){const w=document.createElement("canvas");w.width=k;w.height=p;w.setAttribute("style",`position: absolute; top: ${4+204*r++}px; right: 208px; width: 200px; height: 200px; border: 1px solid black;`);const u=w.getContext("2d");k=new ImageData(k,p);k.data.set(new Uint8Array(t.buffer));u.putImageData(k,0,0);document.body.appendChild(w)}_showDebugPage(k){const {size:[p, t],mosaicsData:w}=this._mosaicPages[k];if(f(w)){var u=`mosaicDebugPage${k}`,y=document.getElementById(u)??document.createElement("canvas");y.id=u;y.width=p;y.height=t;y.setAttribute("style",`position: absolute; top: ${4+204*k}px; right: 4px; width: 200px; height: 200px; border: 1px solid black;`);k=y.getContext("2d");u=new ImageData(p,t);u.data.set(new Uint8Array(w.data.buffer));k.putImageData(u,0,0);document.body.appendChild(y)}}}let r=0;return c})},"esri/views/2d/engine/webgl/animatedFormats/AnimatableTextureResource":function(){define(["exports", "../definitions","./utils"],function(e,g,q){class h{constructor(m,l,d,b){this._animation=m;this._frameData=null;this.frameCount=this._animation.frameDurations.length;this.width=this._animation.width;this.height=this._animation.height;this._playHandle=q.play(this._animation,d,b,a=>{this._frameData=a;l.requestRender()})}destroy(){this._playHandle.remove()}loadFrame(m){const l=this._frameData;null!=l&&(m.updateData(0,g.spritePadding,g.spritePadding,"width"in l?l.width:l.codedWidth,"height"in l?l.height: l.codedHeight,l),this._frameData=null)}}e.AnimatableTextureResource=h;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/animatedFormats/utils":function(){define("exports ../../../../../core/handleUtils ../../../../../core/time ../../../../../geometry/support/meshUtils/exporters/gltf/imageutils ../../../../../symbols/cim/enums ../grouping".split(" "),function(e,g,q,h,m,l){function d(t){return q.Milliseconds(t.frameDurations.reduce((w,u)=>w+u,0))}function b(t){const {width:w, height:u}=t,y=t.frameDurations.reverse();return{frameCount:t.frameCount,duration:t.duration,frameDurations:y,getFrame:x=>t.getFrame(t.frameDurations.length-1-x),width:w,height:u}}function a(t,w){const {width:u,height:y,getFrame:x}=t,v=w/t.duration;w=t.frameDurations.map(A=>q.Milliseconds(A*v));return{frameCount:t.frameCount,duration:t.duration,frameDurations:w,getFrame:x,width:u,height:y}}function f(t,w){const {width:u,height:y,getFrame:x}=t,v=t.frameDurations.slice(),A=v.shift();v.unshift(q.Milliseconds(A+ w));return{frameCount:t.frameCount,duration:t.duration+w,frameDurations:v,getFrame:x,width:u,height:y}}function n(t,w){const {width:u,height:y,getFrame:x}=t,v=t.frameDurations.slice(),A=v.pop();v.push(q.Milliseconds(A+w));return{frameCount:t.frameCount,duration:t.duration+w,frameDurations:v,getFrame:x,width:u,height:y}}function c(t,w,u,y){let {repeatType:x}=w;null==x&&(x=m.AnimatedSymbolRepeatType.Loop);!0===w.reverseAnimation&&(t=b(t));null!=w.duration&&(t=a(t,q.Milliseconds(1E3*w.duration)));if(null!= w.repeatDelay){const v=1E3*w.repeatDelay;x===m.AnimatedSymbolRepeatType.Loop?t=n(t,q.Milliseconds(v)):x===m.AnimatedSymbolRepeatType.Oscillate&&(t=f(n(t,q.Milliseconds(v/2)),q.Milliseconds(v/2)))}null!=w.startTimeOffset?w=q.Milliseconds(1E3*w.startTimeOffset):null!=w.randomizeStartTime?(w=l.getRandomValue(u,null!=w.randomizeStartSeed?w.randomizeStartSeed:82749913),w=q.Milliseconds(w*d(t))):w=q.Milliseconds(0);return new r(t,w,x,y)}class r{constructor(t,w,u,y){this._animation=t;this._repeatType=u; this._onFrameData=y;this._direction=1;this._currentFrame=0;this.timeToFrame=this._animation.frameDurations[this._currentFrame];for(t=0;w>t;)t+=this.timeToFrame,this.nextFrame();w=this._animation.getFrame(this._currentFrame);this._onFrameData(w)}nextFrame(){this._currentFrame+=this._direction;if(0{A.nextFrame();z=A.timeToFrame;x()},z):void 0}const v=null!=w.playAnimation?w.playAnimation:!0,A=c(t,w,u,y);let z=A.timeToFrame,B;x();return g.makeHandle(()=>v&&clearTimeout(B))};e.prependDelay=f;e.resize=function(t,w,u){k??=document.createElement("canvas");p??=k.getContext("2d");const {canvas:y, ctx:x}={canvas:k,ctx:p};y.width=w;y.height=u;const v=[],A=t.frameDurations.length;for(let z=0;zv[z],frameCount:t.frameCount,duration:t.duration}};e.reverse=b;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/meshUtils/exporters/gltf/imageutils":function(){define(["exports", "../../../../../core/has","../../../../../core/Error","../../../../../core/promiseUtils","../../../../../core/urlUtils"],function(e,g,q,h,m){function l(b){if(!(b instanceof HTMLImageElement))return"image/png";b=b.src;return m.isDataProtocol(b)?(b=m.dataComponents(b),"image/jpeg"===b?.mediaType?b.mediaType:"image/png"):/\.png$/i.test(b)?"image/png":/\.(jpg|jpeg)$/i.test(b)?"image/jpeg":"image/png"}function d(b){if(b instanceof HTMLCanvasElement)return b;if(b instanceof HTMLVideoElement)return null; const a=document.createElement("canvas");a.width=b.width;a.height=b.height;const f=a.getContext("2d");b instanceof HTMLImageElement?f.drawImage(b,0,0,b.width,b.height):b instanceof ImageData&&f.putImageData(b,0,0);return a}e.encodeBase64DataUri=function(b){const a=[];b=new Uint8Array(b);for(let f=0;ff.toBlob(c,n));h.throwIfAborted(a);if(!b)throw new q("imageToArrayBuffer","Failed to encode image");b=await b.arrayBuffer();h.throwIfAborted(a);return{data:b,type:n}};e.imageToDataURI=function(b){b=d(b);return null!=b?b.toDataURL():""};e.imageTypeToCanvas=d;e.isArrayBufferPNG=function(b){if(8>b.byteLength)return!1;b=new Uint8Array(b);return 137===b[0]&&80===b[1]&&78===b[2]&&71===b[3]&&13===b[4]&&10===b[5]&&26===b[6]&&10===b[7]};Object.defineProperty(e, Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/grouping":function(){define(["exports","../../../../core/string"],function(e,g){function q(h,m){if("string"===typeof h)h=g.numericHash(h+`-seed(${m})`);else{let l=12;h^=m;do h=107*(h>>8^h)+l|0;while(0!==--l)}return(1+h/-2147483648)/2}e.getRandomValue=q;e.getStartGroup=function(h){return Math.floor(10*q(h,53290320))};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/TextureUploadManager":function(){define(["exports", "../../../../core/promiseUtils","./definitions"],function(e,g,q){class h{constructor(m){this._queue=[];this._refreshable=m}destroy(){this._queue=[]}enqueueTextureUpdate(m,l){const d=g.createResolver(),b=q.textureUploadManagerChunkSize,a=Math.ceil(m.height/b);g.throwIfAborted(l);for(let f=0;fd.reject(f));return d.promise}upload(){let m= 0;for(;this._queue.length;){var l=performance.now();const d=this._queue.shift();if(d&&(null==d.options.signal||!d.options.signal.aborted)){switch(d.type){case "chunk":this._uploadChunk(d);break;case "no-chunk":this._uploadNoChunk(d)}l=performance.now()-l;m+=l;if(m+l>=q.textureUploadManagerBudget)break}}this._queue.length&&this._refreshable.requestRender()}_uploadChunk(m){const {request:l,resolver:d,chunkOffset:b,chunkIsLast:a,destHeight:f}=m,{data:n,texture:c,width:r}=l;null!=n&&(c.updateData(0,0, b,r,f,n,b),a&&d.resolve())}_uploadNoChunk(m){const {request:l,resolver:d}=m,{data:b,texture:a}=l;a.setData(b);d.resolve()}}e.TextureUploadManager=h;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/WorldExtentClipRenderer":function(){define("exports ../../../../core/maybe ../../../../core/libs/gl-matrix-2/math/common ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f32 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ./VertexStream ./shaders/StencilPrograms ../../../webgl/enums ../../../webgl/ProgramTemplate".split(" "), function(e,g,q,h,m,l,d,b,a,f,n,c){const r=l.fromValues(-.5,-.5);class k{constructor(){this._centerNdc=b.create();this._pxToNdc=b.create();this._worldDimensionsPx=b.create();this._mat3=m.create();this._initialized=!1}dispose(){this._program=g.disposeMaybe(this._program);this._quad=g.disposeMaybe(this._quad)}render(p,t,w){const {context:u}=p;p=this._updateGeometry(p,w);if(null!=t){const {r:y,g:x,b:v,a:A}=t;u.setClearColor(A*y/255,A*x/255,A*v/255,A)}else u.setClearColor(0,0,0,0);u.setStencilFunction(n.CompareFunction.ALWAYS, 0,255);u.setStencilWriteMask(255);p?(u.setClearStencil(0),u.clear(u.gl.STENCIL_BUFFER_BIT|u.gl.COLOR_BUFFER_BIT),this._initialized||this._initialize(u),u.setDepthWriteEnabled(!1),u.setDepthTestEnabled(!1),u.setColorMask(!1,!1,!1,!1),u.setBlendingEnabled(!1),u.setStencilOp(n.StencilOperation.KEEP,n.StencilOperation.KEEP,n.StencilOperation.REPLACE),u.setStencilFunction(n.CompareFunction.ALWAYS,1,255),u.setStencilTestEnabled(!0),u.useProgram(this._program),this._program.setUniformMatrix3fv("u_worldExtent", this._mat3),this._quad.draw(),this._quad.unbind()):(u.setClearStencil(1),u.clear(u.gl.STENCIL_BUFFER_BIT|u.gl.COLOR_BUFFER_BIT))}_initialize(p){if(!this._initialized){var t=c.createProgram(p,f.stencil);t&&(this._program=t,this._quad=new a(p,[0,0,1,0,0,1,1,1]),this._initialized=!0)}}_updateGeometry(p,t){const {state:w,pixelRatio:u}=p,{size:y,rotation:x}=w,v=Math.round(y[0]*u),A=Math.round(y[1]*u);if(!w.spatialReference.isWrappable)return!1;p=q.toRadian(x);const z=Math.abs(Math.cos(p)),B=Math.abs(Math.sin(p)), D=Math.round(u*w.worldScreenWidth);if(Math.round(v*z+A*B)<=D)return!1;const F=(t.left-t.right)*u/v;t=(t.bottom-t.top)*u/A;d.set(this._worldDimensionsPx,D,v*B+A*z,1);d.set(this._pxToNdc,2/v,-2/A,1);d.set(this._centerNdc,F,t,1);t=this._mat3;h.fromTranslation(t,this._centerNdc);h.scale(t,t,this._pxToNdc);0!==x&&h.rotate(t,t,p);h.scale(t,t,this._worldDimensionsPx);h.translate(t,t,r);return!0}}e.WorldExtentRenderer=k;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaders/StencilPrograms":function(){define(["exports", "./sources/resolver"],function(e,g){g={shaders:{vertexShader:g.resolveIncludes("stencil/stencil.vert"),fragmentShader:g.resolveIncludes("stencil/stencil.frag")},attributes:new Map([["a_pos",0]])};e.stencil=g;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/effects/AnimationEffect":function(){define(["exports","../../../../../core/has","../definitions","../VertexStream","./Effect"],function(e,g,q,h,m){class l extends m.Effect{constructor(){super(...arguments); this.defines=[];this._desc={vsPath:"fx/integrate",fsPath:"fx/integrate",attributes:new Map([["a_position",0]])}}dispose(){this._quad&&this._quad.dispose()}bind(){}unbind(){}draw(d,b){if(b?.size){var {context:a,renderingOptions:f}=d;this._quad||(this._quad=new h(a,[0,0,1,0,0,1,1,1]));var n=a.getBoundFramebufferObject(),{x:c,y:r,width:k,height:p}=a.getViewport(),t=b.getBlock(q.AttributeDataType.Animation);if(null!=t){var w=b.getUniforms(a);a.setViewport(0,0,b.size,b.size);b=w.filterFlags;var u=w.animation, y=g("featurelayer-animation-enabled")?f.labelsAnimationTime:1;w=t.getFBO(a,1);a.unbindTexture(w.colorTexture);this._computeDelta(d,w,u,b,y);t=t.getFBO(a);a.unbindTexture(t.colorTexture);this._updateAnimationState(d,w,t);a.bindFramebuffer(n);a.setViewport(c,r,k,p)}}}_computeDelta(d,b,a,f,n){const {context:c,painter:r,displayLevel:k}=d,p=r.materialManager.getProgram(this._desc,["delta"]);c.bindFramebuffer(b);c.setColorMask(!0,!0,!0,!0);c.setClearColor(0,0,0,0);c.clear(c.gl.COLOR_BUFFER_BIT);c.useProgram(p); if(!("type"in f.texture&&"type"in a.texture))throw Error("InternalError: Expected to find texture");c.bindTexture(f.texture,f.unit);c.bindTexture(a.texture,a.unit);p.setUniform1i("u_maskTexture",f.unit);p.setUniform1i("u_sourceTexture",a.unit);p.setUniform1f("u_timeDelta",d.deltaTime);p.setUniform1f("u_animationTime",n);p.setUniform1f("u_zoomLevel",Math.round(10*k));this._quad.draw()}_updateAnimationState(d,b,a){const {context:f,painter:n}=d;d=n.materialManager.getProgram(this._desc,["update"]);f.bindTexture(b.colorTexture, 1);f.useProgram(d);d.setUniform1i("u_sourceTexture",1);f.bindFramebuffer(a);f.setColorMask(!0,!0,!0,!0);f.setClearColor(0,0,0,0);f.clear(f.gl.COLOR_BUFFER_BIT);this._quad.draw()}}e.AnimationEffect=l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/effects/Effect":function(){define(["exports"],function(e){class g{constructor(){this.name=this.constructor.name}createOptions(q,h){return null}}e.Effect=g;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})}, "esri/views/2d/engine/webgl/effects/BlendEffect":function(){define("exports ../../../../../core/Error ../../../../../core/Logger ../../../../../core/maybe ../enums ../VertexStream ../shaders/BlendPrograms ../../../../webgl/enums ../../../../webgl/Texture ../../../../webgl/TextureDescriptor".split(" "),function(e,g,q,h,m,l,d,b,a,f){const n=()=>q.getLogger("esri.views.2d.engine.webgl.effects.blendEffects.BlendEffect");class c{constructor(){this._size=[0,0]}dispose(r){this._backBufferTexture=h.disposeMaybe(this._backBufferTexture); this._quad=h.disposeMaybe(this._quad)}draw(r,k,p,t,w){const {context:u,drawPhase:y}=r;this._setupShader(u);t&&"normal"!==t&&y!==m.WGLDrawPhase.LABEL?this._drawBlended(r,k,p,t,w):(r=d.createProgramTemplate("normal"),(r=u.programCache.acquire(r.shaders.vertexShader,r.shaders.fragmentShader,r.attributes))?(u.useProgram(r),k.setSamplingMode(p),u.bindTexture(k,0),r.setUniform1i("u_layerTexture",0),r.setUniform1f("u_opacity",w),u.setBlendingEnabled(!0),u.setBlendFunction(b.BlendFactor.ONE,b.BlendFactor.ONE_MINUS_SRC_ALPHA), k=this._quad,k.draw(),k.unbind(),r.dispose()):n().error(new g("mapview-BlendEffect",'Error creating shader program for blend mode "normal"')))}_drawBlended(r,k,p,t,w){const {context:u,state:y,pixelRatio:x,inFadeTransition:v}=r;var {size:A}=y,z=u.getBoundFramebufferObject();let B;null!=z?(B=z.width,A=z.height):(B=Math.round(x*A[0]),A=Math.round(x*A[1]));this._createOrResizeTexture(r,B,A);r=this._backBufferTexture;z.copyToTexture(0,0,B,A,0,0,r);u.setStencilTestEnabled(!1);u.setStencilWriteMask(0);u.setBlendingEnabled(!0); u.setDepthTestEnabled(!1);u.setDepthWriteEnabled(!1);z=d.createProgramTemplate(t);(z=u.programCache.acquire(z.shaders.vertexShader,z.shaders.fragmentShader,z.attributes))?(u.useProgram(z),r.setSamplingMode(p),u.bindTexture(r,0),z.setUniform1i("u_backbufferTexture",0),k.setSamplingMode(p),u.bindTexture(k,1),z.setUniform1i("u_layerTexture",1),z.setUniform1f("u_opacity",w),z.setUniform1f("u_inFadeOpacity",v?1:0),u.setBlendFunction(b.BlendFactor.ONE,b.BlendFactor.ZERO),k=this._quad,k.draw(),k.unbind(), z.dispose(),u.setBlendFunction(b.BlendFactor.ONE,b.BlendFactor.ONE_MINUS_SRC_ALPHA)):n().error(new g("mapview-BlendEffect",`Error creating shader program for blend mode ${t}`))}_setupShader(r){this._quad||(this._quad=new l(r,[-1,-1,1,-1,-1,1,1,1]))}_createOrResizeTexture(r,k,p){({context:r}=r);if(null===this._backBufferTexture||k!==this._size[0]||p!==this._size[1]){if(this._backBufferTexture)this._backBufferTexture.resize(k,p);else{const t=new f.TextureDescriptor;t.internalFormat=b.PixelFormat.RGBA; t.wrapMode=b.TextureWrapMode.CLAMP_TO_EDGE;t.width=k;t.height=p;this._backBufferTexture=new a.Texture(r,t)}this._size[0]=k;this._size[1]=p}}}e.BlendEffect=c;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaders/BlendPrograms":function(){define(["exports","./sources/resolver"],function(e,g){e.createProgramTemplate=function(q){return{attributes:new Map([["a_pos",0],["a_tex",1]]),shaders:{vertexShader:`#define ${q.replace("-","_").toUpperCase()}\n`+g.resolveIncludes("blend/blend.vert"), fragmentShader:`#define ${q.replace("-","_").toUpperCase()}\n`+g.resolveIncludes("blend/blend.frag")}}};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/effects/FeatureEffect":function(){define(["exports","./Effect","../../../../webgl/enums"],function(e,g,q){class h extends g.Effect{constructor(m){super();this.name=this.constructor.name;this.defines=[m]}dispose(){}bind({context:m,painter:l}){this._prev=m.getBoundFramebufferObject();l=l.getFbos().effect0; m.bindFramebuffer(l);m.setColorMask(!0,!0,!0,!0);m.setClearColor(0,0,0,0);m.clear(m.gl.COLOR_BUFFER_BIT)}unbind(){}draw(m,l){const {context:d,painter:b}=m;l=b.getPostProcessingEffects(l);const a=d.getBoundFramebufferObject();for(const {postProcessingEffect:f,effect:n}of l)f.draw(m,a,n);d.bindFramebuffer(this._prev);d.setStencilTestEnabled(!1);b.blitTexture(d,a.colorTexture,q.TextureSamplingMode.NEAREST);d.setStencilTestEnabled(!0)}}e.FeatureEffect=h;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})}, "esri/views/2d/engine/webgl/effects/HighlightEffect":function(){define("../../../../../core/has ../BitBlitRenderer ./Effect ./highlight/HighlightRenderer ./highlight/HighlightSurfaces ../../../../webgl/enums".split(" "),function(e,g,q,h,m,l){class d extends q.Effect{constructor(){super(...arguments);this.defines=["highlight"];this._hlRenderer=new h;this._height=this._width=void 0;this._boundFBO=null;this._hlSurfaces=new m;this._adjustedHeight=this._adjustedWidth=void 0;this._blitRenderer=new g.BitBlitRenderer}dispose(){this._hlSurfaces?.dispose(); this._hlRenderer?.dispose();this._boundFBO=null}bind(b){const {context:a,painter:f}=b,{width:n,height:c}=a.getViewport(),r=f.getFbos().effect0;this.setup(b,n,c);a.bindFramebuffer(r);a.setColorMask(!0,!0,!0,!0);a.setClearColor(0,0,0,0);a.clear(a.gl.COLOR_BUFFER_BIT)}unbind(){}setup({context:b},a,f){this._width=a;this._height=f;const n=a%4,c=f%4;a+=2>n?-n:4-n;f+=2>c?-c:4-c;this._adjustedWidth=a;this._adjustedHeight=f;this._boundFBO=b.getBoundFramebufferObject();a=Math.round(1*a);f=Math.round(1*f);this._hlRenderer.setup(b, a,f);this._hlSurfaces.setup(b,a,f)}draw(b){const {context:a,passOptions:f}=b;b=f.activeGradient;const n=a.getBoundFramebufferObject();a.setViewport(0,0,1*this._adjustedWidth,1*this._adjustedHeight);a.bindFramebuffer(this._hlSurfaces.sharedBlur1Fbo);a.setStencilTestEnabled(!1);a.setClearColor(0,0,0,0);a.clear(a.gl.COLOR_BUFFER_BIT);this._blitRenderer.render(a,n.colorTexture,l.TextureSamplingMode.NEAREST,1);a.setStencilTestEnabled(!1);a.setBlendingEnabled(!1);a.setColorMask(!1,!1,!1,!0);a.bindFramebuffer(this._hlSurfaces.sharedBlur2Fbo); a.setClearColor(0,0,0,0);a.clear(a.gl.COLOR_BUFFER_BIT);this._hlRenderer.preBlur(a,this._hlSurfaces.sharedBlur1Tex);a.bindFramebuffer(this._hlSurfaces.sharedBlur1Fbo);a.setClearColor(0,0,0,0);a.clear(a.gl.COLOR_BUFFER_BIT);this._hlRenderer.finalBlur(a,this._hlSurfaces.sharedBlur2Tex);a.bindFramebuffer(this._boundFBO);a.setBlendingEnabled(!0);a.setColorMask(!0,!0,!0,!0);a.setViewport(0,0,this._width,this._height);this._hlRenderer.renderHighlight(a,this._hlSurfaces.sharedBlur1Tex,b);this._boundFBO= null}}return d})},"esri/views/2d/engine/webgl/effects/highlight/HighlightRenderer":function(){define("../../definitions ./parameters ../../shaders/HighlightPrograms ../../../../../webgl/BufferObject ../../../../../webgl/enums ../../../../../webgl/ProgramTemplate ../../../../../webgl/VertexArrayObject ../../../../../webgl/VertexElementDescriptor".split(" "),function(e,g,q,h,m,l,d,b){class a{constructor(){this._height=this._width=void 0;this._resources=null}dispose(){this._resources&&(this._resources.quadGeometry.dispose(), this._resources.quadVAO.dispose(),this._resources.highlightProgram.dispose(),this._resources.blurProgram.dispose(),this._resources=null)}preBlur(f,n){f.bindTexture(n,e.textureBindingHighlight0);f.useProgram(this._resources.blurProgram);this._resources.blurProgram.setUniform4fv("u_direction",[1,0,1/this._width,0]);this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",g.alphaToRgbaChannelSelectorMatrix);f.bindVAO(this._resources.quadVAO);f.drawArrays(m.PrimitiveType.TRIANGLE_STRIP,0,4); f.bindVAO()}finalBlur(f,n){f.bindTexture(n,e.textureBindingHighlight0);f.useProgram(this._resources.blurProgram);this._resources.blurProgram.setUniform4fv("u_direction",[0,1,0,1/this._height]);this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",g.rgbaToRgbaChannelSelectorMatrix);f.bindVAO(this._resources.quadVAO);f.drawArrays(m.PrimitiveType.TRIANGLE_STRIP,0,4);f.bindVAO()}renderHighlight(f,n,c){f.bindTexture(n,e.textureBindingHighlight0);f.useProgram(this._resources.highlightProgram); c.applyHighlightOptions(f,this._resources.highlightProgram);f.bindVAO(this._resources.quadVAO);f.setBlendingEnabled(!0);f.setBlendFunction(m.BlendFactor.ONE,m.BlendFactor.ONE_MINUS_SRC_ALPHA);f.drawArrays(m.PrimitiveType.TRIANGLE_STRIP,0,4);f.bindVAO()}_initialize(f,n,c){this._width=n;this._height=c;n=h.BufferObject.createVertex(f,m.Usage.STATIC_DRAW,(new Int8Array([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1])).buffer);c=new d.VertexArrayObject(f,new Map([["a_position",0],["a_texcoord",1]]),{geometry:[new b.VertexElementDescriptor("a_position", 2,m.DataType.BYTE,0,4),new b.VertexElementDescriptor("a_texcoord",2,m.DataType.UNSIGNED_BYTE,2,4)]},{geometry:n});const r=l.createProgram(f,q.highlight),k=l.createProgram(f,q.blur);f.useProgram(r);r.setUniform1i("u_texture",e.textureBindingHighlight0);r.setUniform1i("u_shade",e.textureBindingHighlight1);r.setUniform1f("u_sigma",g.sigma);f.useProgram(k);k.setUniform1i("u_texture",e.textureBindingHighlight0);k.setUniform1f("u_sigma",g.sigma);this._resources={quadGeometry:n,quadVAO:c,highlightProgram:r, blurProgram:k}}setup(f,n,c){this._resources?(this._width=n,this._height=c):this._initialize(f,n,c)}}return a})},"esri/views/2d/engine/webgl/shaders/HighlightPrograms":function(){define(["exports","./sources/resolver"],function(e,g){const q={shaders:{vertexShader:g.resolveIncludes("highlight/textured.vert"),fragmentShader:g.resolveIncludes("highlight/highlight.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])};g={shaders:{vertexShader:g.resolveIncludes("highlight/textured.vert"),fragmentShader:g.resolveIncludes("highlight/blur.frag")}, attributes:new Map([["a_position",0],["a_texcoord",1]])};e.blur=g;e.highlight=q;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/effects/highlight/HighlightSurfaces":function(){define(["../../../../../webgl/enums","../../../../../webgl/FramebufferObject","../../../../../webgl/RenderbufferDescriptor","../../../../../webgl/TextureDescriptor"],function(e,g,q,h){function m(d,b,a){const f=new h.TextureDescriptor(b,a);f.wrapMode=e.TextureWrapMode.CLAMP_TO_EDGE; return new g.FramebufferObject(d,f,new q.RenderbufferDescriptor(e.RenderbufferFormat.STENCIL_INDEX8,b,a))}class l{constructor(){this._height=this._width=void 0;this._resources=null}dispose(){this._resources&&(this._resources.sharedBlur1Fbo.dispose(),this._resources.sharedBlur2Fbo.dispose(),this._resources=null)}_initialize(d,b,a){this._width=b;this._height=a;const f=m(d,b,a);d=m(d,b,a);this._resources={sharedBlur1Fbo:f,sharedBlur2Fbo:d}}setup(d,b,a){!this._resources||this._width===b&&this._height=== a||this.dispose();this._resources||this._initialize(d,b,a)}get sharedBlur1Tex(){return this._resources.sharedBlur1Fbo.colorTexture}get sharedBlur1Fbo(){return this._resources.sharedBlur1Fbo}get sharedBlur2Tex(){return this._resources.sharedBlur2Fbo.colorTexture}get sharedBlur2Fbo(){return this._resources.sharedBlur2Fbo}}return l})},"esri/views/2d/engine/webgl/effects/HittestEffect":function(){define(["exports","../../../../../core/has","../definitions","./Effect","../../../../webgl/enums"],function(e, g,q,h,m){class l extends h.Effect{constructor(){super(...arguments);this.name=this.constructor.name;this.defines=["hittest"]}dispose(){null!=this._fbo&&this._fbo.dispose()}createOptions({pixelRatio:d},b){if(!b.length)return null;var a=b.shift();b=a.x;const f=a.y;this._outstanding=a;a=g("esri-mobile");return{type:"hittest",distance:(a?q.hittestToleranceMobile:q.hittestToleranceDesktop)*d,smallSymbolDistance:(a?q.hittestToleranceMobile:q.hittestToleranceSmallSymbol)*d,smallSymbolSizeThreshold:q.hittestSmallSymbolThreshold, position:[b,f]}}bind(d){const {context:b,attributeView:a}=d;a.size&&(d=a.getBlock(q.AttributeDataType.GPGPU),null!=d&&(d=d.getFBO(b),b.setViewport(0,0,a.size,a.size),b.bindFramebuffer(d),b.setColorMask(!0,!0,!0,!0),b.setClearColor(0,0,0,0),b.clear(b.gl.COLOR_BUFFER_BIT|b.gl.DEPTH_BUFFER_BIT)))}unbind(){}draw(d){if(null!=this._outstanding){var b=this._outstanding;this._outstanding=null;this._resolve(d,b.resolvers)}}async _resolve(d,b){const {context:a,attributeView:f}=d;d=f.getBlock(q.AttributeDataType.GPGPU); if(null==d)b.forEach(r=>r.resolve([]));else{var n=d.getFBO(a);d=new Uint8Array(n.width*n.height*4);try{await n.readPixelsAsync(0,0,n.width,n.height,m.PixelFormat.RGBA,m.PixelType.UNSIGNED_BYTE,d)}catch(r){b.forEach(k=>k.resolve([]));return}var c=[];for(n=0;nr.resolve(c))}}}e.HittestEffect=l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/effects/post-processing/EffectManager":function(){define("exports ./Bloom ./Blur ./Colorize ./DropShadow ./Opacity".split(" "), function(e,g,q,h,m,l){const d={colorize:()=>new h.Colorize,blur:()=>new q.Blur,bloom:()=>new g.Bloom,opacity:()=>new l.Opacity,"drop-shadow":()=>new m.DropShadow};class b{constructor(){this._effectMap=new Map}dispose(){this._effectMap.forEach(a=>a.dispose());this._effectMap.clear()}getPostProcessingEffects(a){if(!a||0===a.length)return[];const f=[];for(const n of a){a:switch(a=n.type,a){case "bloom":case "blur":case "opacity":case "drop-shadow":break a;default:a="colorize"}let c=this._effectMap.get(a); c||(c=d[a](),this._effectMap.set(a,c));f.push({postProcessingEffect:c,effect:n})}return f}}e.EffectManager=b;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/effects/post-processing/Bloom":function(){define("exports ../../../../../../core/maybe ../../VertexStream ../../../../../webgl/enums ../../../../../webgl/FramebufferObject ../../../../../webgl/TextureDescriptor".split(" "),function(e,g,q,h,m,l){const d=[1,0],b=[0,1],a=[1,.8,.6,.4,.2],f=[1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1];class n{constructor(){this._compositeFBO=this._intensityFBO=null;this._mipsFBOs=Array(5);this._nMips=5;this._kernelSizeArray=[3,5,7,9,11];this._size=[0,0];this._programDesc={luminosityHighPass:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/luminosityHighPass",attributes:new Map([["a_position",0]])},gaussianBlur:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/gaussianBlur",attributes:new Map([["a_position",0]])},composite:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/composite", attributes:new Map([["a_position",0]])},blit:{vsPath:"post-processing/pp",fsPath:"post-processing/blit",attributes:new Map([["a_position",0]])}}}dispose(){this._quad=g.disposeMaybe(this._quad);this._intensityFBO=g.disposeMaybe(this._intensityFBO);this._compositeFBO=g.disposeMaybe(this._compositeFBO);if(this._mipsFBOs){for(let c=0;c!0);this.forceDrawByDisplayOrder=!!m.forceDrawByDisplayOrder}render(h){const {context:m,profiler:l}=h,d=this._targetFn();var b=this.drawPhase&h.drawPhase;l.recordPassStart(this.name);if(b){this.enableDefaultDraw()&&this._doRender(h,d);l.recordPassEnd();for(const a of this.effects){if(!a.enable())continue;b=a.apply;const f= a.args?.(),n=m.getViewport(),c=m.getBoundFramebufferObject(),r=h.passOptions;this._bindEffect(h,b,f);this._doRender(h,d,b.defines);this._drawAndUnbindEffect(h,b,n,c,r,f)}}}_doRender(h,m,l){if(null!=m){var {profiler:d,context:b}=h;for(const a of this.brushes){d.recordBrushStart(a.name);if(null!=a.brushEffect){const f=b.getViewport(),n=b.getBoundFramebufferObject(),c=h.passOptions;this._bindEffect(h,a.brushEffect);this._drawWithBrush(a,h,m,l);this._drawAndUnbindEffect(h,a.brushEffect,f,n,c)}else this._drawWithBrush(a, h,m,l);d.recordBrushEnd()}}}_drawWithBrush(h,m,l,d){e.isArrayLike(l)?(h.prepareState(m,d),h.drawMany(m,l,d)):l.visible&&(h.prepareState(m,d),h.draw(m,l,d))}_bindEffect(h,m,l){const {profiler:d}=h;d.recordPassStart(this.name+"."+m.name);m.bind(h,l);m=m.createOptions(h,l);h.passOptions=m}_drawAndUnbindEffect(h,m,l,d,b,a){const {profiler:f,context:n}=h;h.passOptions=b;f.recordBrushStart(m.name);m.draw(h,a);m.unbind(h,a);n.bindFramebuffer(d);const {x:c,y:r,width:k,height:p}=l;n.setViewport(c,r,k,p);f.recordBrushEnd(); f.recordPassEnd()}}return q})},"esri/views/2d/engine/webgl/shaderGraph/techniques/TechniqueProgramCache":function(){define(["exports"],function(e){class g{constructor(){this._programCache=new Map}destroy(){for(const q of this._programCache.values())q.destroy();this._programCache.clear()}getProgram(q,h,m,l,d){const b=q.getShaderKey(h,m,l,d);let a=this._programCache.get(b);a||(a=q.getProgram(h,m,l,d),this._programCache.set(b,a));return a}}e.TechniqueProgramCache=g;Object.defineProperty(e,Symbol.toStringTag, {value:"Module"})})},"esri/views/2d/engine/webgl/Profiler":function(){define(["exports","../../../../core/CircularArray","../../../../core/Evented","../../../../core/has","../../../webgl/capabilities/DisjointTimerQuery"],function(e,g,q,h,m){const l=h("esri-2d-profiler");class d{constructor(b,a){this._events=new q;this._entries=new Map;this._timings=new g(10);this._currentSummary=this._currentBrush=this._currentPass=this._currentContainer=null;if(l){this._ext=m.createDisjointTimerQuery(b.gl,{});this._debugOutput= a;var f=b.gl;if(this.enableCommandLogging)for(var n in f)if("function"===typeof f[n]){const c=f[n],r=n.includes("draw");f[n]=(...k)=>{this._events.emit("command",{container:this._currentContainer,pass:this._currentPass,brush:this._currentBrush,method:n,args:k,isDrawCommand:r});this._currentSummary&&(this._currentSummary.commands++,r&&this._currentSummary.drawCommands++);return c.apply(f,k)}}}}get enableCommandLogging(){return!("object"===typeof l&&l.disableCommands)}recordContainerStart(b){l&&(this._currentContainer= b)}recordContainerEnd(){l&&(this._currentContainer=null)}recordPassStart(b){l&&(this._currentPass=b,this._initSummary())}recordPassEnd(){l&&(this._currentPass=null,this._emitSummary())}recordBrushStart(b){l&&(this._currentBrush=b)}recordBrushEnd(){l&&(this._currentBrush=null)}recordStart(b){if(l&&null!=this._ext){if(this._entries.has(b)){const r=this._entries.get(b);var a=this._ext.resultAvailable(r.query),f=this._ext.disjoint();if(a&&!f){a=this._ext.getResult(r.query)/1E6;f=0;if(null!=this._timings.enqueue(a)){f= this._timings.entries;const k=f.length;let p=0;for(var n of f)p+=n;f=p/k}n=a.toFixed(2);a=f?f.toFixed(2):"--";this.enableCommandLogging?(console.groupCollapsed(`Frame report for ${b}, ${n} ms (${a} last 10 avg)\n${r.commandsLen} Commands (${r.drawCommands} draw)`),console.log("RenderPass breakdown: "),console.table(r.summaries),console.log("Commands: ",r.commands),console.groupEnd()):console.log(`Frame report for ${b}, ${n} ms (${a} last 10 avg)`);this._debugOutput.innerHTML=`${n} (${a})`}for(const k of r.handles)k.remove(); this._ext.deleteQuery(r.query);this._entries.delete(b)}const c={name:b,query:this._ext.createQuery(),commands:[],commandsLen:0,drawCommands:0,summaries:[],handles:[]};this.enableCommandLogging&&(c.handles.push(this._events.on("command",r=>{c.commandsLen++;c.commands.push(r);r.isDrawCommand&&c.drawCommands++})),c.handles.push(this._events.on("summary",r=>{c.summaries.push(r)})));this._ext.beginTimeElapsed(c.query);this._entries.set(b,c)}}recordEnd(b){l&&null!=this._ext&&this._entries.has(b)&&this._ext.endTimeElapsed()}_initSummary(){this.enableCommandLogging&& (this._currentSummary={container:this._currentContainer,pass:this._currentPass,drawCommands:0,commands:0})}_emitSummary(){this.enableCommandLogging&&this._currentSummary&&this._events.emit("summary",this._currentSummary)}}e.Profiler=d;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/core/CircularArray":function(){define(function(){class e{constructor(g){this._start=this.size=0;this.maxSize=g;this._buffer=Array(g)}get entries(){return this._buffer}enqueue(g){if(this.size===this.maxSize){const q= this._buffer[this._start];this._buffer[this._start]=g;this._start=(this._start+1)%this.maxSize;return q}this._buffer[(this._start+this.size++)%this.maxSize]=g;return null}dequeue(){if(0===this.size)return null;const g=this._buffer[this._start];this._buffer[this._start]=null;this.size--;this._start=(this._start+1)%this.maxSize;return g}peek(){return 0===this.size?null:this._buffer[this._start]}peekLast(){return 0===this.size?null:this._buffer[(this._start+(this.size-1))%this.maxSize]}find(g){if(0=== this.size)return null;for(const q of this._buffer)if(null!=q&&g(q))return q;return null}clear(g){let q=this.dequeue();for(;null!=q;)g&&g(q),q=this.dequeue()}}return e})},"esri/views/webgl/capabilities/DisjointTimerQuery":function(){define(["exports"],function(e){class g{constructor(q,h,m,l,d,b,a,f,n){this.createQuery=q;this.deleteQuery=h;this.resultAvailable=m;this.getResult=l;this.disjoint=d;this.beginTimeElapsed=b;this.endTimeElapsed=a;this.createTimestamp=f;this.timestampBits=n}}e.hasRunningElapsedTimer= !1;e.DisjointTimerQuery=g;e.createDisjointTimerQuery=function(q,h){if(h.disjointTimerQuery)return null;let m=q.getExtension("EXT_disjoint_timer_query_webgl2");return m?new g(()=>q.createQuery(),l=>{q.deleteQuery(l);e.hasRunningElapsedTimer=!1},l=>q.getQueryParameter(l,q.QUERY_RESULT_AVAILABLE),l=>q.getQueryParameter(l,q.QUERY_RESULT),()=>q.getParameter(m.GPU_DISJOINT_EXT),l=>{e.hasRunningElapsedTimer||(e.hasRunningElapsedTimer=!0,q.beginQuery(m.TIME_ELAPSED_EXT,l))},()=>{q.endQuery(m.TIME_ELAPSED_EXT); e.hasRunningElapsedTimer=!1},l=>m.queryCounterEXT(l,m.TIMESTAMP_EXT),()=>q.getQuery(m.TIMESTAMP_EXT,m.QUERY_COUNTER_BITS_EXT)):(m=q.getExtension("EXT_disjoint_timer_query"))?new g(()=>m.createQueryEXT(),l=>{m.deleteQueryEXT(l);e.hasRunningElapsedTimer=!1},l=>m.getQueryObjectEXT(l,m.QUERY_RESULT_AVAILABLE_EXT),l=>m.getQueryObjectEXT(l,m.QUERY_RESULT_EXT),()=>q.getParameter(m.GPU_DISJOINT_EXT),l=>{e.hasRunningElapsedTimer||(e.hasRunningElapsedTimer=!0,m.beginQueryEXT(m.TIME_ELAPSED_EXT,l))},()=>{m.endQueryEXT(m.TIME_ELAPSED_EXT); e.hasRunningElapsedTimer=!1},l=>m.queryCounterEXT(l,m.TIMESTAMP_EXT),()=>m.getQueryEXT(m.TIMESTAMP_EXT,m.QUERY_COUNTER_BITS_EXT)):null};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/TileReshuffleManager":function(){define(["exports"],function(e){class g{constructor(){this._candidateTiles=[]}schedule(q){this._candidateTiles.includes(q)||this._candidateTiles.push(q)}reshuffle(q){const h=[];for(const m of this._candidateTiles)0(v,A)=>{c(v,"builtins",{builtin:x,propertyKey:A})};const r=(x,v)=>(A,z)=>{A.constructor.builtins.push({builtin:x,propertyKey:z,typeCtor:v})};class k{}k.builtins=[];g.__decorate([r("gl_VertexID",d.Int)],k.prototype,"glVertexID",void 0);class p{}class t{}t.builtins=[];g.__decorate([r("gl_FragCoord",d.Vec4)], t.prototype,"glFragCoord",void 0);g.__decorate([r("gl_PointCoord",d.Vec2)],t.prototype,"glPointCoord",void 0);class w{}g.__decorate([q("gl_FragColor")],w.prototype,"glFragColor",void 0);class u{constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}}class y{constructor(){this.logShader=!1;this.computeAttributes={}}get vertexInput(){const x=this._shaderModuleClass.inputs.findLast(v=>"vertex"===v.propertyKey&&0===v.parameterIndex);if(!x)throw Error("Unable to find vertex input parameter"); return x}get computeInput(){return this._shaderModuleClass.inputs.findLast(x=>"vertex"===x.propertyKey&&1===x.parameterIndex)}get fragmentInput(){const x=this._shaderModuleClass.inputs.findLast(v=>"fragment"===v.propertyKey);if(!x)throw Error("Unable to find fragment input parameter");return x}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...(this.computeInput?.inputCtor.locations??[])]}get locationsMap(){const x= new Map,v=new Set;for(const A of this.locations)v.has(A.index)?h.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${A.propertyKey} to ${A.index}. Index already in use`,{locationsMap:x}):(x.set(A.propertyKey,A.index),v.add(A.index));return x}get locationInfo(){if(!this._locationInfo){const x=this.locationsMap,v=Array.from(x.entries()).map(([A,z])=>`${A}.${z}`).join(".");this._locationInfo={hash:m.numericHash(v),locations:x, computeAttributeMap:this.computeAttributes}}return this._locationInfo}get renamedLocationsMap(){const x=new Map;for(const v of this.locations)x.set("a_"+v.propertyKey,v.index);return x}get optionPropertyKeys(){if(!this._optionPropertyKeys){const x=new Set;for(const v of this._options)x.add(v.propertyKey);this._optionPropertyKeys=x}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options?? []}get _uniforms(){return this._shaderModuleClass.uniforms??[]}getProgram(x,v,A,z){try{const {vertex:B,fragment:D,uniformBindings:F}=this._generateShaders(x,v,A,z);return new n.TypedShaderProgram(B,D,this.renamedLocationsMap,this.locationInfo,F,this.transformFeedbackBindings)}catch(B){return new n.TypedShaderProgram("","",this.renamedLocationsMap,this.locationInfo,[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(x){var v=this._options.find(A=>A.propertyKey===x);if(v)return{type:"option", className:v.typeCtor};v=this._uniforms.find(A=>A.propertyKey===x);if(!v)throw Error(`Unable to find uniform class type for property: ${x}`);return{type:"required",className:v.typeCtor}}getShaderKey(x,v,A,z){const B=Object.keys(x).map(C=>`${C}.${x[C]}`).join("."),D=Object.keys(A).map(C=>`${C}.${A[C]}`).join("."),F=Object.keys(z).map(C=>`${C}.${z[C]}`).join("."),E=Object.keys(v).filter(C=>this.optionPropertyKeys.has(C)&&v[C]).join(".");return`${this.constructor.name}.${B}.${D}.${F}.${E}`}_generateShaders(x, v,A,z){const B=[];this._setDefines(A);this._setOptionalUniforms(B,v);this._setRequiredUniforms(B);v=this._hydrateVertexInput(z);z=this._injectPackPrecisionFactor(v,x);x=(A=this._hydrateComputeInput())&&this._injectComputePackPrecisionFactor(A,x);const D=this.vertex(z,x);x=this._hydrateFragmentInput(D);z=this.fragment(x);const F=new Set;for(var E in z)f.setReachableUids(F,z[E]);E=this._getVertexInputBuiltins();E=a.ShaderGraphContext.createVertex({...v,...A},D,E,B,this.transformFeedbackBindings,F); (new b.GlslShaderWriter).write(E);v=this._getFragmentInputBuiltins(z);v.set("glPointCoord","gl_PointCoord");v=a.ShaderGraphContext.createFragment(x,z,v,B,E,this.transformFeedbackBindings);(new b.GlslShaderWriter).write(v);v=this._createShaderBuilder(E,v);E=v.generate("vertex",!1);v=v.generate("fragment",!1);this.logShader&&(console.log(E),console.log(v));return{vertex:E,fragment:v,uniformBindings:B}}_setDefines(x){for(const v in x)this[v]=x[v]}_setOptionalUniforms(x,v){for(const A of this._options)this[A.propertyKey]= v[A.propertyKey]?this._hydrateUniformGroup(x,A):null}_setRequiredUniforms(x){for(const v of this._uniforms)this[v.propertyKey]=this._hydrateUniformGroup(x,v)}_hydrateUniformGroup(x,v){const A=new v.typeCtor;for(const z of A._uniforms??[]){const B=new z.typeCtor,D=`u_${v.propertyKey}_${z.propertyKey}`,F=B.type,E=[v.propertyKey,z.propertyKey].join(".");if("type"in z.typeCtor&&"array"===z.typeCtor.type){const C=B;x.push({shaderModulePath:E,uniformName:D,uniformType:F,uniformArrayLength:C.size,uniformArrayElementType:C.elementType.type, uniformHydrated:B})}else x.push({shaderModulePath:E,uniformName:D,uniformType:F,uniformHydrated:B});A[z.propertyKey]=B}return A}_hydrateVertexInput(x){var v=this.vertexInput.inputCtor;const A=v.locations.reduce((z,B)=>!1===x[B.propertyKey]?z:{...z,[B.propertyKey]:new B.typeCtor},{});for(const {propertyKey:z,typeCtor:B}of v.builtins)v=new B,A[z]=v;return A}_hydrateComputeInput(){return null==this.computeInput?null:this.computeInput.inputCtor.locations.reduce((x,v)=>({...x,[v.propertyKey]:new v.typeCtor}), {})}_injectPackPrecisionFactor(x,v){const A={};for(const z in x){const B=x[z],D=v[z];if(D){if("float"!==B.type&&"vec2"!==B.type&&"vec3"!==B.type&&"vec4"!==B.type)throw Error(`InternalError: packPrecisionFactor requires GenType, but found ${B.type}`);A[z]=B.divide(new d.Float(D))}else A[z]=B}return A}_injectComputePackPrecisionFactor(x,v){const A={},z=new Map;for(var B in this.computeAttributes)for(var D of this.computeAttributes[B]??[])z.set(D,B);for(const F in x)if(B=x[F],D=z.get(F))if(D=v[D]){if("float"!== B.type&&"vec2"!==B.type&&"vec3"!==B.type&&"vec4"!==B.type)throw Error(`InternalError: packPrecisionFactor requires GenType, but found ${B.type}`);A[F]=B.divide(new d.Float(D))}else A[F]=B;return A}_hydrateFragmentInput(x){const v={};for(const A in x)v[A]=x[A];for(const {propertyKey:A,typeCtor:z}of t.builtins)x=new z,v[A]=x;return v}_getVertexInputBuiltins(){const x=this.vertexInput.inputCtor,v=new Map;for(const {builtin:A,propertyKey:z}of x.builtins)v.set(z,A);return v}_getFragmentInputBuiltins(x){x= x.constructor;const v=new Map;for(const A of x.builtins??[])v.set(A.propertyKey,A.builtin);return v}_createShaderBuilder(x,v){const A=new l.ShaderBuilder2D;this._insertDebugInfo(A);x.insertVertexShader(A);v.insertFragmentShader(A);return A}_insertDebugInfo(x){x.vertex.code.add("// DEFINES: ");x.vertex.code.add("// --------------------------------------------------------- ");for(const v of this._defines)this[v.propertyKey]?x.vertex.code.add(`// ${v.propertyKey}: true`):x.vertex.code.add(`// ${v.propertyKey}: false`); x.vertex.code.add("");x.vertex.code.add("// OPTIONS: ");x.vertex.code.add("// --------------------------------------------------------- ");for(const v of this._options)this[v.propertyKey]?x.vertex.code.add(`// ${v.propertyKey}: true`):x.vertex.code.add(`// ${v.propertyKey}: false`)}}e.ComputeVertexInput=p;e.FragmentInput=t;e.FragmentOutput=w;e.GraphShaderModule=y;e.UniformGroup=u;e.VertexInput=k;e.builtin=q;e.define=(x,v)=>{c(x,"defines",{propertyKey:v})};e.input=x=>(v,A,z)=>{c(v,"inputs",{inputCtor:x, propertyKey:A,parameterIndex:z})};e.location=function(x,v){return(A,z)=>{c(A,"locations",{typeCtor:v,propertyKey:z,parameterIndex:null,index:x})}};e.option=x=>(v,A)=>{c(v,"options",{typeCtor:x,propertyKey:A})};e.transformFeedback=function(x){return(v,A)=>{c(v,"transformFeedbackBindings",{propertyKey:A,parameterIndex:null,index:x})}};e.uniform=x=>(v,A)=>{c(v,"uniforms",{typeCtor:x,propertyKey:A})};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/ShaderBuilder2D":function(){define("exports ../../../../../core/Error ../../../../../core/has ../../../../../core/Logger ../../../../3d/webgl-engine/core/shaderTechnique/BindType ../../../../3d/webgl-engine/lib/Util".split(" "), function(e,g,q,h,m,l){function d(w=!0){return`#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif\n${w?"out vec4 fragColor;":""}\n`}class b{constructor(){this._includedModules=new Map}include(w,u){this._includedModules.has(w)?this._includedModules.get(w):(this._includedModules.set(w,u),w(this.builder,u))}}class a extends b{constructor(){super(...arguments);this.vertex=new c;this.fragment= new c;this.attributes=new r;this.varyings=new k;this.extensions=new p;this.constants=new t}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(w,u=!0){const y=this.extensions.generateSource(w),x=this.attributes.generateSource(w),v=this.varyings.generateSource(w);var A="vertex"===w?this.vertex:this.fragment;const z=A.uniforms.generateSource(),B=A.code.generateSource();w="vertex"===w?"precision highp float;\nprecision highp sampler2D;":d(u);A=this.constants.generateSource().concat(A.constants.generateSource()); return`${u?"#version 300 es":""}\n${y.join("\n")}\n${w}\n${A.join("\n")}\n${z.join("\n")}\n${x.join("\n")}\n${v.join("\n")}\n${B.join("\n")}`}generateBindPass(w){const u=new Map;this.vertex.uniforms.entries.forEach(v=>{const A=v.bind[m.BindType.Pass];A&&u.set(v.name,A)});this.fragment.uniforms.entries.forEach(v=>{const A=v.bind[m.BindType.Pass];A&&u.set(v.name,A)});const y=Array.from(u.values()),x=y.length;return(v,A)=>{for(let z=0;z {const A=v.bind[m.BindType.Draw];A&&u.set(v.name,A)});this.fragment.uniforms.entries.forEach(v=>{const A=v.bind[m.BindType.Draw];A&&u.set(v.name,A)});const y=Array.from(u.values()),x=y.length;return(v,A,z)=>{for(let B=0;Bnull!=w.arraySize?`uniform ${w.type} ${w.name}[${w.arraySize}];`:`uniform ${w.type} ${w.name};`)}get entries(){return Array.from(this._entries.values())}}class n{constructor(){this._entries=[]}add(w){this._entries.push(w)}generateSource(){return this._entries}} class c extends b{constructor(){super(...arguments);this.uniforms=new f;this.code=new n;this.constants=new t}get builder(){return this}}class r{constructor(){this._entries=[]}add(w,u){this._entries.push([w,u])}generateSource(w){return"fragment"===w?[]:this._entries.map(u=>`in ${u[1]} ${u[0]};`)}}class k{constructor(){this._entries=new Map}add(w,u){this._entries.has(w)&&l.assert(this._entries.get(w)===u);this._entries.set(w,u)}generateSource(w){const u=[];this._entries.forEach((y,x)=>u.push("vertex"=== w?`out ${y} ${x};`:`in ${y} ${x};`));return u}}class p{constructor(){this._entries=new Set}add(w){this._entries.add(w)}generateSource(w){const u="vertex"===w?p.ALLOWLIST_VERTEX:p.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter(y=>u.includes(y)).map(y=>`#extension ${y} : enable`)}}p.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"];p.ALLOWLIST_VERTEX=[];class t{constructor(){this._entries=new Set}add(w,u,y){let x="ERROR_CONSTRUCTOR_STRING";switch(u){case "float":x= t._numberToFloatStr(y);break;case "int":x=t._numberToIntStr(y);break;case "bool":x=y.toString();break;case "vec2":x=`vec2(${t._numberToFloatStr(y[0])}, ${t._numberToFloatStr(y[1])})`;break;case "vec3":x=`vec3(${t._numberToFloatStr(y[0])}, ${t._numberToFloatStr(y[1])}, ${t._numberToFloatStr(y[2])})`;break;case "vec4":x=`vec4(${t._numberToFloatStr(y[0])}, ${t._numberToFloatStr(y[1])}, ${t._numberToFloatStr(y[2])}, ${t._numberToFloatStr(y[3])})`; break;case "ivec2":x=`ivec2(${t._numberToIntStr(y[0])}, ${t._numberToIntStr(y[1])})`;break;case "ivec3":x=`ivec3(${t._numberToIntStr(y[0])}, ${t._numberToIntStr(y[1])}, ${t._numberToIntStr(y[2])})`;break;case "ivec4":x=`ivec4(${t._numberToIntStr(y[0])}, ${t._numberToIntStr(y[1])}, ${t._numberToIntStr(y[2])}, ${t._numberToIntStr(y[3])})`; break;case "mat2":case "mat3":case "mat4":x=`${u}(${Array.prototype.map.call(y,v=>t._numberToFloatStr(v)).join(", ")})`}this._entries.add(`const ${u} ${w} = ${x};`);return this}static _numberToIntStr(w){return w.toFixed(0)}static _numberToFloatStr(w){return Number.isInteger(w)?w.toFixed(1):w.toString()}generateSource(){return Array.from(this._entries)}}e.Code=n;e.Includes=b;e.ShaderBuilder2D=a;e.Stage=c;e.Uniforms=f;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderTechnique/BindType":function(){define(["exports"], function(e){e.BindType=void 0;var g=e.BindType||(e.BindType={});g[g.Pass=0]="Pass";g[g.Draw=1]="Draw";Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/Util":function(){define(["exports","../../../../core/libs/gl-matrix-2/factories/vec2f64","../../../../chunks/vec42","../../../../core/libs/gl-matrix-2/factories/vec4f64"],function(e,g,q,h){function m(b,a){if(!b)throw a=a||"Assertion",new d(`${a} at ${Error(a).stack}`);}const l=h.create();class d{constructor(b){this.message= b}toString(){return`AssertException: ${this.message}`}}e.assert=m;e.isTranslationMatrix=function(b){return 1===b[0]&&0===b[1]&&0===b[2]&&0===b[3]&&0===b[4]&&1===b[5]&&0===b[6]&&0===b[7]&&0===b[8]&&0===b[9]&&1===b[10]&&0===b[11]&&1===b[15]};e.logWithBase=function(b,a){return Math.log(b)/Math.log(a)};e.project=function(b,a,f,n,c){l[0]=b[0];l[1]=b[1];l[2]=b[2];l[3]=1;q.transformMat4(l,l,a);2k&&(c=r,r=k,k=c);let p=(f[1]-b[1])/a[1],t=(n[1]-b[1])/a[1];p>t&&(c=p,p=t,t=c);if(r>t||p>k)return!1;p>r&&(r=p);tb&&(c=f,f=b,b=c);if(r>b||f>k)return!1;bk?!1:!0};e.rayRay2D=function(b,a,f,n,c,r=g.create()){const k=(n[c]-f[c])*(a[0]-b[0])-(n[0]-f[0])*(a[c]-b[c]);if(0===k)return!1;f=((n[0]-f[0])*(b[c]-f[c])-(n[c]- f[c])*(b[0]-f[0]))/k;r[0]=b[0]+f*(a[0]-b[0]);r[1]=b[c]+f*(a[c]-b[c]);return!0};e.setMatrixTranslation3=function(b,a,f,n){b[12]=a;b[13]=f;b[14]=n};e.verify=function(b,a){b||console.warn("Verify failed: "+(a||"")+"\n"+Error("verify").stack)};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/graph/glsl":function(){define(["exports","../../../../../../chunks/tslib.es6","./ShaderGraphNode"],function(e,g,q){function h(M){switch(M.type){case "uint":return ha; case "uvec2":return e.Vec2;case "uvec3":return e.Vec3;case "uvec4":return e.Vec4;default:throw Error("Found unexpected type");}}function m(M){switch(M.type){case "float":return e.UInt;case "vec2":return e.UVec2;case "vec3":return e.UVec3;case "vec4":return e.UVec4;default:throw Error("Found unexpected type");}}function l(M){switch(M.type){case "int":return ha;case "ivec2":return e.Vec2;case "ivec3":return e.Vec3;case "ivec4":return e.Vec4;default:throw Error("Found unexpected type");}}function d(M){switch(M.type){case "float":return ka; case "vec2":return e.IVec2;case "vec3":return e.IVec3;case "vec4":return e.IVec4;default:throw Error("Found unexpected type");}}function b(M){switch(M.type){case "bool":case "float":case "int":case "uint":return ja;case "bvec2":case "vec2":case "ivec2":case "uvec2":return e.BVec2;case "bvec3":case "vec3":case "ivec3":case "uvec3":return e.BVec3;case "bvec4":case "vec4":case "ivec4":case "uvec4":return e.BVec4;default:throw Error("Unable to handle type");}}function a(M){switch(M.type){case "float":case "int":case "uint":case "bool":case "sampler2D":return 1; case "vec2":case "ivec2":case "uvec2":case "bvec2":return 2;case "vec3":case "ivec3":case "uvec3":case "bvec3":return 3;case "vec4":case "ivec4":case "uvec4":case "bvec4":return 4;case "mat2":return 4;case "mat3":return 9;case "mat4":return 16;case "array":return M.size*a(M.elementType)}}function f(M){const W=[["float","vec2","vec3","vec4"],["int","ivec2","ivec3","ivec4"],["uint","uvec2","uvec3","uvec4"],["bool","bvec2","bvec3","bvec4"]];for(const da of W)if(da.includes(M))return da.map(fa=>ua[fa]); throw Error("Unable to find type family");}function n(M){return new Proxy(M,{get(W,da){if("constructor"===da)return new Proxy(W.constructor,{construct(fa,ma,ta){fa=new fa(...ma);return n(fa)}});if(da in W)return W[da];if("string"===typeof da)return W=f(M.type),p(M,da,W[da.length-1])}})}function c(M){return new Proxy(M,{construct(W,da,fa){W=new W(...da);return n(W)}})}function r(M){return new Proxy(M,{get(W,da){if(da in W)return W[da];if("string"===typeof da&&(W=parseInt(da,10),!isNaN(W)))return p(M, `[${W}]`,M.elementType.constructor)}})}function k(M,W){return"number"===typeof M?new W(M):M}function p(M,W,da){M=new da(new q.ShaderPropertyAccessNode(W,M,da));M.isImplicit=!0;return M}function t(M,W,da,fa=null){if(fa){const ma=new fa;M=new fa(new q.ShaderFunctionNode(M,[W,da],!0,!1,ma));M.isImplicit=!0;return M}if("float"===W.type||"int"===W.type||("mat2"===W.type||"mat3"===W.type||"mat4"===W.type)&&"float"!==da.type)return M=new da.constructor(new q.ShaderFunctionNode(M,[W,da],!0,!1,da.constructor)), M.isImplicit=!0,M;M=new W.constructor(new q.ShaderFunctionNode(M,[W,da],!0,!1,W.constructor));M.isImplicit=!0;return M}function w(M,W,da=W.constructor){M=new da(new q.ShaderFunctionNode(M,[W],!1,!1,da));M.isImplicit=!0;return M}function u(M,W,da,fa=W.constructor){M=new fa(new q.ShaderFunctionNode(M,[W,da],!1,!1,fa));M.isImplicit=!0;return M}function y(M,W,da,fa,ma=W.constructor){M=new ma(new q.ShaderFunctionNode(M,[W,da,fa],!1,!1,ma));M.isImplicit=!0;return M}function x(M){return D(M,sa(-1))}function v(M, W,da,fa){return new W(new q.ShaderBlockNode(M,W,da,fa))}function A(M,W,da=0,fa=M.size){da=(new ka(da)).setMutable().setDebugName("FindIndexIterator");M=M.get(da);W=W(M).setDebugName("FindIndexPredicate");return v({iter:da},ka,W,({out:ma,iter:ta,subgraph:za})=>`\n${ma} = -1;\n\nfor (; ${ta} < ${fa}; ${ta}++) {\n\n${za.body}\n\n if (${za.varName}) {\n ${ma} = ${ta};\n break;\n }\n\n}\n`).setDebugName("FindIndexBlock")}function z(M,W,da=0,fa=M.size){return v({array:M},ka,null,({out:ma,array:ta})=> `\n${ma} = -1;\nfor (int i = ${da}; i < ${fa}; i++) {\n bool condition;\n ${W({array:ta,i:"i",out:"condition"})}\n if (condition) {\n ${ma} = i;\n break;\n }\n}\n`).setDebugName("GlslFindIndexBlock")}function B(M,W,da){W="function"===typeof W?W():W;da="function"===typeof da?da():da;M=new W.constructor(new q.ShaderConditionNode(M,W,da));M.isImplicit=!0;return M}function D(M,W){return t("*",M,W)}function F(M,W){return t("/",M,W)}function E(M,W){return t("+",M,W)}function C(M,W){return t("-", M,W)}function G(...M){return 1>=M.length?M[0]:M.slice(1).reduce((W,da)=>H(W,da),M[0])}function H(M,W){return t("||",M,W,ja)}function K(...M){return 1>=M.length?M[0]:M.slice(1).reduce((W,da)=>t("\x26\x26",W,da,ja),M[0])}function J(M){return w("all",M,ja)}function O(M){return w("any",M,ja)}function Q(M){return w("cos",M)}function T(M){return w("sin",M)}var I,L,R,V,S,X,N,P,U,Y,ba,Z,aa,ca;class ea extends Error{}e.FixedArray=I=class extends q.ShaderPrimitiveNode{constructor(M,W){super();this.elementType= M;this.size=W;this.children=[];this.type="array"}clone(){const M=new I(this.elementType,this.size);super.cloneInto(M);return M}get(M){return"number"===typeof M?(M=new ka(M),M.isImplicit=!0,p(this,M,this.elementType.constructor)):p(this,M,this.elementType.constructor)}last(){return this.get(this.size-1)}first(){return this.get(0)}findIndex(M,W,da){return A(this,M,W,da)}glslFindIndex(M,W,da){return z(this,M,W,da)}static ofType(M,W){return new Proxy(I,{construct(da,fa){return new I(new M,W)}})}};e.FixedArray.type= "array";e.FixedArray=I=g.__decorate([function(M){return new Proxy(M,{construct(W,da,fa){W=new W(...da);return r(W)}})}],e.FixedArray);class ia extends q.ShaderPrimitiveNode{constructor(){super(...arguments);this.type="sampler2D";this.children=[]}clone(){const M=new ia;M.children=this.children.map(q.cloneShaderNode);super.cloneInto(M);return M}}ia.type="sampler2D";class ha extends q.ShaderPrimitiveNode{constructor(M){super();this.type="float";this.children=[M]}clone(){const M=new ha(q.cloneShaderNode(this.children[0])); super.cloneInto(M);return M}multiply(M){return"number"===typeof M?D(this,k(M,ha)):D(this,M)}divide(M){return"number"===typeof M?F(this,k(M,ha)):F(this,M)}add(M){return"number"===typeof M?E(this,k(M,ha)):E(this,M)}subtract(M){return"number"===typeof M?C(this,k(M,ha)):C(this,M)}}ha.type="float";e.Vec2=L=class extends q.ShaderPrimitiveNode{constructor(M,W){super();this.type="vec2";this.children=[M,W].filter(da=>null!=da)}clone(){const M=new L(q.cloneShaderNode(this.children[0]),q.cloneShaderNode(this.children[1])); super.cloneInto(M);return M}get 0(){return p(this,"[0]",ha)}get 1(){return p(this,"[1]",ha)}get 2(){throw new ea;}get 3(){throw new ea;}multiply(M){return D(this,"number"===typeof M?k(M,ha):M)}divide(M){return F(this,"number"===typeof M?k(M,ha):M)}add(M){return E(this,"number"===typeof M?k(M,ha):M)}subtract(M){return C(this,"number"===typeof M?k(M,ha):M)}};e.Vec2.type="vec2";e.Vec2=L=g.__decorate([c],e.Vec2);e.Vec3=R=class extends q.ShaderPrimitiveNode{constructor(M,W,da){super();this.type="vec3"; this.children=[M,W,da].filter(fa=>null!=fa)}get 0(){return p(this,"[0]",ha)}get 1(){return p(this,"[1]",ha)}get 2(){return p(this,"[2]",ha)}get 3(){throw new ea;}clone(){const M=new R(q.cloneShaderNode(this.children[0]),q.cloneShaderNode(this.children[1]),q.cloneShaderNode(this.children[2]));super.cloneInto(M);return M}multiply(M){return D(this,"number"===typeof M?k(M,ha):M)}divide(M){return F(this,"number"===typeof M?k(M,ha):M)}add(M){return E(this,"number"===typeof M?k(M,ha):M)}subtract(M){return C(this, "number"===typeof M?k(M,ha):M)}};e.Vec3.type="vec3";e.Vec3=R=g.__decorate([c],e.Vec3);e.Vec4=V=class extends q.ShaderPrimitiveNode{constructor(M,W,da,fa){super();this.type="vec4";this.children=[M,W,da,fa].filter(ma=>null!=ma)}clone(){const M=new V(q.cloneShaderNode(this.children[0]),q.cloneShaderNode(this.children[1]),q.cloneShaderNode(this.children[2]),q.cloneShaderNode(this.children[3]));super.cloneInto(M);return M}get 0(){return p(this,"[0]",ha)}get 1(){return p(this,"[1]",ha)}get 2(){return p(this, "[2]",ha)}get 3(){return p(this,"[3]",ha)}multiply(M){return D(this,"number"===typeof M?k(M,ha):M)}divide(M){return F(this,"number"===typeof M?k(M,ha):M)}add(M){return E(this,"number"===typeof M?k(M,ha):M)}subtract(M){return C(this,"number"===typeof M?k(M,ha):M)}};e.Vec4.type="vec4";e.Vec4=V=g.__decorate([c],e.Vec4);e.UInt=S=class extends q.ShaderPrimitiveNode{constructor(M){super();this.type="uint";this.children=[M]}clone(){const M=new S(q.cloneShaderNode(this.children[0]));super.cloneInto(M);return M}}; e.UInt.type="uint";e.UInt=S=g.__decorate([c],e.UInt);e.UVec2=X=class extends q.ShaderPrimitiveNode{constructor(M,W){super();this.type="uvec2";this.children=[M,W].filter(da=>null!=da)}clone(){const M=new X(q.cloneShaderNode(this.children[0]),q.cloneShaderNode(this.children[1]));super.cloneInto(M);return M}};e.UVec2.type="uvec2";e.UVec2=X=g.__decorate([c],e.UVec2);e.UVec3=N=class extends q.ShaderPrimitiveNode{constructor(M,W,da){super();this.type="uvec3";this.children=[M,W,da].filter(fa=>null!=fa)}clone(){const M= new N(q.cloneShaderNode(this.children[0]),q.cloneShaderNode(this.children[1]),q.cloneShaderNode(this.children[2]));super.cloneInto(M);return M}};e.UVec3.type="uvec3";e.UVec3=N=g.__decorate([c],e.UVec3);e.UVec4=P=class extends q.ShaderPrimitiveNode{constructor(M,W,da,fa){super();this.type="uvec4";this.children=[M,W,da,fa].filter(ma=>null!=ma)}clone(){const M=new P(q.cloneShaderNode(this.children[0]),q.cloneShaderNode(this.children[1]),q.cloneShaderNode(this.children[2]),q.cloneShaderNode(this.children[3])); super.cloneInto(M);return M}};e.UVec4.type="uvec4";e.UVec4=P=g.__decorate([c],e.UVec4);class ja extends q.ShaderPrimitiveNode{constructor(M){super();this.type="bool";this.children=[M]}and(M){return K(this,M)}or(M){return G(this,M)}clone(){const M=new ja(q.cloneShaderNode(this.children[0]));super.cloneInto(M);return M}}ja.type="bool";e.BVec2=U=class extends q.ShaderPrimitiveNode{constructor(M,W){super();this.type="bvec2";this.children=[M,W].filter(da=>null!=da)}all(){return J(this)}any(){return O(this)}clone(){const M= new U(q.cloneShaderNode(this.children[0]),q.cloneShaderNode(this.children[1]));super.cloneInto(M);return M}};e.BVec2.type="bvec2";e.BVec2=U=g.__decorate([c],e.BVec2);e.BVec3=Y=class extends q.ShaderPrimitiveNode{constructor(M,W,da){super();this.type="bvec3";this.children=[M,W,da].filter(fa=>null!=fa)}all(){return J(this)}any(){return O(this)}clone(){const M=new Y(q.cloneShaderNode(this.children[0]),q.cloneShaderNode(this.children[1]),q.cloneShaderNode(this.children[2]));super.cloneInto(M);return M}}; e.BVec3.type="bvec3";e.BVec3=Y=g.__decorate([c],e.BVec3);e.BVec4=ba=class extends q.ShaderPrimitiveNode{constructor(M,W,da,fa){super();this.type="bvec4";this.children=[M,W,da,fa].filter(ma=>null!=ma)}all(){return J(this)}any(){return O(this)}clone(){const M=new ba(q.cloneShaderNode(this.children[0]),q.cloneShaderNode(this.children[1]),q.cloneShaderNode(this.children[2]),q.cloneShaderNode(this.children[3]));super.cloneInto(M);return M}};e.BVec4.type="bvec4";e.BVec4=ba=g.__decorate([c],e.BVec4);class ka extends q.ShaderPrimitiveNode{constructor(M){super(); this.type="int";this.children=[M]}multiply(M){return D(this,k(M,ka))}add(M){return E(this,k(M,ka))}subtract(M){return C(this,k(M,ka))}divide(M){return F(this,k(M,ka))}clone(){const M=new ka(q.cloneShaderNode(this.children[0]));super.cloneInto(M);return M}}ka.type="int";e.IVec2=Z=class extends q.ShaderPrimitiveNode{constructor(M,W){super();this.type="ivec2";this.children=[M,W].filter(da=>null!=da)}clone(){const M=new Z(q.cloneShaderNode(this.children[0]),q.cloneShaderNode(this.children[1]));super.cloneInto(M); return M}};e.IVec2.type="ivec2";e.IVec2=Z=g.__decorate([c],e.IVec2);e.IVec3=aa=class extends q.ShaderPrimitiveNode{constructor(M,W,da){super();this.type="ivec3";this.children=[M,W,da].filter(fa=>null!=fa)}clone(){const M=new aa(q.cloneShaderNode(this.children[0]),q.cloneShaderNode(this.children[1]),q.cloneShaderNode(this.children[2]));super.cloneInto(M);return M}};e.IVec3.type="ivec3";e.IVec3=aa=g.__decorate([c],e.IVec3);e.IVec4=ca=class extends q.ShaderPrimitiveNode{constructor(M,W,da,fa){super(); this.type="ivec4";this.children=[M,W,da,fa].filter(ma=>null!=ma)}clone(){const M=new ca(q.cloneShaderNode(this.children[0]),q.cloneShaderNode(this.children[1]),q.cloneShaderNode(this.children[2]),q.cloneShaderNode(this.children[3]));super.cloneInto(M);return M}};e.IVec4.type="ivec4";e.IVec4=ca=g.__decorate([c],e.IVec4);class na extends q.ShaderPrimitiveNode{constructor(M,W,da,fa){super();this.type="mat2";this.children=[M,W,da,fa]}clone(){const M=new na(q.cloneShaderNode(this.children[0]),q.cloneShaderNode(this.children[1]), q.cloneShaderNode(this.children[2]),q.cloneShaderNode(this.children[3]));super.cloneInto(M);return M}}na.type="mat2";class qa extends q.ShaderPrimitiveNode{static identity(){return new qa(1,0,0,0,1,0,0,0,1)}static fromRotation(M){const W=T(M);M=Q(M);return new qa(M,W,0,x(W),M,0,0,0,1)}constructor(M,W,da,fa,ma,ta,za,cb,db){super();this.type="mat3";this.children=[M,W,da,fa,ma,ta,za,cb,db]}add(M){return E(this,M)}multiply(M){return D(this,M)}clone(){const M=new qa(q.cloneShaderNode(this.children[0]), q.cloneShaderNode(this.children[1]),q.cloneShaderNode(this.children[2]),q.cloneShaderNode(this.children[3]),q.cloneShaderNode(this.children[4]),q.cloneShaderNode(this.children[5]),q.cloneShaderNode(this.children[6]),q.cloneShaderNode(this.children[7]),q.cloneShaderNode(this.children[8]));super.cloneInto(M);return M}}qa.type="mat3";class oa extends q.ShaderPrimitiveNode{static identity(){return new oa(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}constructor(M,W,da,fa,ma,ta,za,cb,db,rb,Hb,Ib,jc,kc,Jb,Fa){super(); this.type="mat4";this.children=[M,W,da,fa,ma,ta,za,cb,db,rb,Hb,Ib,jc,kc,Jb,Fa]}static fromColumns(M,W,da,fa){return new oa(M.x,M.y,M.z,M.w,W.x,W.y,W.z,W.w,da.x,da.y,da.z,da.w,fa.x,fa.y,fa.z,fa.w)}multiply(M){return D(this,M)}clone(){const M=new oa(q.cloneShaderNode(this.children[0]),q.cloneShaderNode(this.children[1]),q.cloneShaderNode(this.children[2]),q.cloneShaderNode(this.children[3]),q.cloneShaderNode(this.children[4]),q.cloneShaderNode(this.children[5]),q.cloneShaderNode(this.children[6]),q.cloneShaderNode(this.children[7]), q.cloneShaderNode(this.children[8]),q.cloneShaderNode(this.children[9]),q.cloneShaderNode(this.children[10]),q.cloneShaderNode(this.children[11]),q.cloneShaderNode(this.children[12]),q.cloneShaderNode(this.children[13]),q.cloneShaderNode(this.children[14]),q.cloneShaderNode(this.children[15]));super.cloneInto(M);return M}}oa.type="mat4";const ua={float:ha,vec2:e.Vec2,vec3:e.Vec3,vec4:e.Vec4,int:ka,ivec2:e.IVec2,ivec3:e.IVec3,ivec4:e.IVec4,uint:e.UInt,uvec2:e.UVec2,uvec3:e.UVec3,uvec4:e.UVec4,bool:ja, bvec2:e.BVec2,bvec3:e.BVec3,bvec4:e.BVec4},sa=(...M)=>new ha(...M);e.Bool=ja;e.Float=ha;e.Int=ka;e.Mat2=na;e.Mat3=qa;e.Mat4=oa;e.Sampler2D=ia;e._or=H;e.abs=function(M){return w("abs",M)};e.acos=function(M){return w("acos",M)};e.acosh=function(M){return w("acosh",M)};e.add=E;e.all=J;e.and=K;e.any=O;e.asin=function(M){return w("asin",M)};e.asinh=function(M){return w("asinh",M)};e.atan=function(M,W){return null==W?w("atan",M):u("atan",M,W,M.constructor)};e.atanh=function(M){return w("atanh",M)};e.bitAnd= function(M,W){return t("\x26",M,W)};e.bitOr=function(M,W){return t("|",M,W)};e.bitRShift=function(M,W){return t("\x3e\x3e",M,W)};e.bitShift=function(M,W){return t("\x3c\x3c",M,W)};e.bitXor=function(M,W){return t("^",M,W)};e.block=v;e.ceil=function(M){return w("ceil",M)};e.clamp=function(M,W,da){return y("clamp",M,W,da,M.constructor)};e.cond=function(...M){var W=M.map(([fa,ma])=>"function"===typeof ma?[fa,ma()]:[fa,ma]);M=W[0][1].constructor;const da=W.findIndex(fa=>!0===fa[0]);if(-1===da)throw Error("A cond must have a fallthrough case with `true`/; "); W=W.slice(0,da).reduceRight((fa,ma)=>B(ma[0],ma[1],fa),W[da][1]);M=new M(W);M.isImplicit=!0;return M};e.cos=Q;e.cosh=function(M){return w("cosh",M)};e.cross=function(M,W){return u("cross",M,W,M.constructor)};e.dFdx=function(M){return w("dFdX",M)};e.dFdy=function(M){return w("dFdY",M)};e.definePropertyAccess=p;e.degrees=function(M){return w("degrees",M)};e.determinant=function(M){return w("determinant",M,ha)};e.distance=function(M,W){return u("distance",M,W,ha)};e.divide=F;e.dot=function(M,W){return u("dot", M,W,ha)};e.equal=function(M,W){return t("\x3d\x3d",M,W,ja)};e.equalComponent=function(M,W){return u("equal",M,W,b(M))};e.exp=function(M){return w("exp",M)};e.exp2=function(M){return w("exp2",M)};e.faceforward=function(M,W,da){return y("faceforward",M,W,da)};e.findIndex=A;e.float=sa;e.floatBitsToInt=function(M){return w("floatBitsToInt",M,d(M))};e.floatBitsToUint=function(M){return w("floatBitsToUint",M,m(M))};e.floor=function(M){return w("floor",M)};e.fract=function(M){return w("fract",M)};e.fwidth= function(M){return w("fwidth",M)};e.getTypeElementLengthForType=a;e.glslFindIndex=z;e.greaterThan=function(M,W){return t("\x3e",M,W,ja)};e.greaterThanComponent=function(M,W){return u("greaterThan",M,W,b(M))};e.greaterThanEqual=function(M,W){return t("\x3e\x3d",M,W,ja)};e.greaterThanEqualComponent=function(M,W){return u("greaterThanEqual",M,W,b(M))};e.ifElse=B;e.int=(...M)=>new ka(...M);e.intBitsToFloat=function(M){return w("intBitsToFloat",M,l(M))};e.inverse=function(M){return w("inverse",M,ha)}; e.inversesqrt=function(M){return w("inversesqrt",M)};e.isinf=function(M){return w("isinf",M,b(M))};e.isnan=function(M){return w("isnan",M,b(M))};e.length=function(M){return w("length",M,ha)};e.lessThan=function(M,W){return t("\x3c",M,W,ja)};e.lessThanComponent=function(M,W){return u("lessThan",M,W,b(M))};e.lessThanEqual=function(M,W){return t("\x3c\x3d",M,W,ja)};e.lessThanEqualComponent=function(M,W){return u("lessThanEqual",M,W,b(M))};e.log=function(M){return w("log",M)};e.log2=function(M){return w("log2", M)};e.mat2=(...M)=>new na(...M);e.mat3=(...M)=>new qa(...M);e.mat4=(...M)=>new oa(...M);e.matrixCompMult=function(M,W){return u("matrixCompMult",M,W)};e.max=function(M,W){return u("max",M,W)};e.min=function(M,W){return u("min",M,W)};e.mix=function(M,W,da){return y("mix",M,W,da)};e.mod=function(M,W){return u("mod",M,W)};e.modf=function(M,W){throw Error("modf not implemented");};e.multiply=D;e.namedScope=function(M,W){M="function"===typeof M?M():M;W=new M.constructor((new q.ShaderScopeNode(M)).setDebugName(W)); W.isImplicit=!0;return W};e.negate=x;e.normalize=function(M){return w("normalize",M)};e.not=function(M){return"bool"===M.type?w("!",M):w("not",M)};e.notEqual=function(M,W){return t("!\x3d",M,W,ja)};e.notEqualComponent=function(M,W){return u("notEqual",M,W,b(M))};e.or=G;e.outerProduct=function(M,W){throw Error("Impl type?");};e.packHalf2x16=function(M){return w("packHalf2x16",M,e.UInt)};e.packSnorm2x16=function(M){return w("packSnorm2x16",M,e.UInt)};e.packUnorm2x16=function(M){return w("packUnorm2x16", M,e.UInt)};e.pow=function(M,W){return u("pow",M,W)};e.radians=function(M){return w("radians",M)};e.reflect=function(M,W){return u("reflect",M,W)};e.refract=function(M,W,da){return y("refract",M,W,da)};e.round=function(M){return w("round",M)};e.roundEven=function(M){return w("roundEven",M)};e.sign=function(M){return w("sign",M)};e.sin=T;e.sinh=function(M){return w("sinh",M)};e.smoothstep=function(M,W,da){return y("smoothstep",M,W,da)};e.sqrt=function(M){return w("sqrt",M)};e.step=function(M,W){return u("step", M,W,W.constructor)};e.subtract=C;e.tan=function(M){return w("tan",M)};e.tanh=function(M){return w("tanh",M)};e.texelFetch=function(M,W,da){throw Error("Impl type");};e.texelFetchOffset=function(M,W,da,fa){throw Error("Impl type");};e.texture=function(M,W,da){throw Error("Impl type");};e.texture2D=function(M,W){return u("texture2D",M,W,e.Vec4)};e.textureGrad=function(M,W,da,fa){throw Error("Impl type");};e.textureGradOffset=function(M,W,da,fa,ma){throw Error("Impl type");};e.textureLod=function(M, W,da){throw Error("Impl type");};e.textureLodOffset=function(M,W,da,fa){throw Error("Impl type");};e.textureOffset=function(M,W,da,fa){throw Error("Impl type");};e.textureProj=function(M,W,da){throw Error("Impl type");};e.textureProjGrad=function(M,W,da,fa){throw Error("Impl type");};e.textureProjGradOffset=function(M,W,da,fa,ma){throw Error("Impl type");};e.textureProjLod=function(M,W,da){throw Error("Impl type");};e.textureProjLodOffset=function(M,W,da,fa){throw Error("Impl type");};e.textureProjOffset= function(M,W,da,fa){throw Error("Impl type");};e.textureSize=function(M,W){throw Error("Impl type");};e.transformFloatToInt=d;e.transformFloatToUInt=m;e.transformIntToFloat=l;e.transformTypeToBooleanType=b;e.transformUIntToFloat=h;e.transpose=function(M){return w("transpose",M)};e.trunc=function(M){return w("trunc",M)};e.uintBitsToFloat=function(M){return w("uintBitsToFloat",M,h(M))};e.unpackHalf2x16=function(M){return w("unpackHalf2x16",M,e.Vec2)};e.unpackSnorm2x16=function(M){return w("unpackSnorm2x16", M,e.Vec2)};e.unpackUnorm2x16=function(M){return w("unpackUnorm2x16",M,e.Vec2)};e.vec2=(...M)=>new e.Vec2(...M);e.vec3=(...M)=>new e.Vec3(...M);e.vec4=(...M)=>new e.Vec4(...M);e.when=function(M,W){M=new W.constructor(new q.ShaderConditionNode(M,W,null));M.isImplicit=!0;return M};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphNode":function(){define(["exports"],function(e){function g(c){return c.split(" ").map((r,k)=>0this.captureList[c]).concat(this.subgraph??[])}clone(){var c={};for(const r in this.captureList)c[r]=q(this.captureList[r]);c=new f(c,this.returnType,this.subgraph?q(this.subgraph.child): this.subgraph,this.generator);this.cloneInto(c);return c}}class n extends h{constructor(c,r,k,p,t,w=!1){super();this.token=c;this._children=r;this.isInfix=k;this.isPropertyAccess=p;this.returnType=t;this.isTernary=w;this.shaderType="function-node"}get children(){return this._children}clone(){const c=new n(this.token,this._children.map(q),this.isInfix,this.isPropertyAccess,this.returnType,this.isTernary);this.cloneInto(c);return c}}e.ShaderBlockNode=f;e.ShaderConditionNode=a;e.ShaderFunctionNode=n; e.ShaderNode=h;e.ShaderPrimitiveNode=m;e.ShaderPropertyAccessNode=b;e.ShaderScopeNode=l;e.ShaderTextNode=d;e.cloneShaderNode=q;e.setReachableUids=function(c,r){const k=[];for(k.push(r);k.length;)if(r=k.pop(),"object"===typeof r&&!c.has(r.uid)){c.add(r.uid);for(const p of r.children)k.push(p)}};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/graph/GlslGraphWriter":function(){define(["exports"],function(e){function g(h,m,l){m=m.split("\n");for(const d of m)if(d.trim().length){m= "";const b=l??"000";null!=l&&(m+=`/*id:${b}*/ `);h.body+=m.padEnd(14);h.body+=" ".repeat(h.indent)+d+"\n"}}class q{write(h){for(const m of h.rootOutputNodes())h.shouldPruneOutputNode(m)||(m.variableName=this._write(h,m.node));return h}_createVarName(h,m){let l="";"boolean"!==typeof m&&"number"!==typeof m&&m.debugInfo.name&&(l=`${m.debugInfo.name}_`);return`${l}v${h.varCount++}`}_write(h,m,l=!1){if("number"===typeof m||"boolean"===typeof m)return m.toString();let d=h.getEmit(m);if(d)return d;switch(m.shaderType){case "scope-node":d= this._writeScopeNode(h,m);break;case "primitive-node":d=this._writePrimitiveNode(h,m,l);break;case "function-node":d=this._writeFunctionNode(h,m);break;case "property-access-node":d=this._writePropertyAccessNode(h,m);break;case "text-node":d=m.text;break;case "block-node":d=this._writeBlockNode(h,m);break;case "condition-node":d=this._writeConditionNode(h,m)}h.setEmit(m,d);return d}_writeScopeNode(h,m){var l=new m.child.constructor;l.setDebugName(m.debugInfo.name);l=this._write(h,l,!0);g(h,`{ /*ScopeStart: ${m.uid} ${m.debugInfo.name}*/`); h.indent+=2;const d=this._write(h,m.child);g(h,`${l} = ${d};`);h.indent-=2;g(h,`} /*ScopeEnd: ${m.uid} ${m.debugInfo.name}*/`);return l}_writeConditionNode(h,m){var l=new m.ifTrue.constructor;l=this._write(h,l,!0);var d=this._write(h,m.condition);g(h,`if (${d}) {`);h.indent+=2;d=h.createSubgraphContext();const b=this._write(d,m.ifTrue);h.body+=d.body;b&&g(h,`${l} = ${b};`);h.indent-=2;g(h,"}");m.ifFalse&&(g(h,"else {"),h.indent+=2,d=h.createSubgraphContext(),m=this._write(d,m.ifFalse),h.body+=d.body, m&&g(h,`${l} = ${m};`),h.indent-=2,g(h,"}"));return l}_writeBlockNode(h,m){const {captureList:l,generator:d,returnType:b}=m;var a={};for(var f in l)if(l[f]){var n=this._write(h,l[f]);a[f]=n}f=new b;f=this._write(h,f,!0);a.out=f;m.subgraph&&(n=h.createSubgraphContext(),m=this._write(n,m.subgraph.child),a.subgraph={varName:m,body:n.body});a=d(a);g(h,"{\n");h.indent+=2;g(h,a);h.indent-=2;g(h,"}\n");return f}_writePropertyAccessNode(h,m){const l=this._write(h,m.target);return"string"===typeof m.property&& m.property.includes("[")?`${l}${m.property}`:"string"!==typeof m.property?(h=this._write(h,m.property),`${l}[${h}]`):`${l}.${m.property}`}_writeFunctionNode(h,m){const l=m.returnType.type;if(m.isInfix){const [a,f]=m.children.map(n=>this._write(h,n));var d=this._createVarName(h,m);g(h,`${l.padEnd(5)} ${d} = ${a} ${m.token} ${f};`,m.uid);return d}d=m.children.map(a=>this._write(h,a)).join(", ");const b=this._createVarName(h,m);g(h,`${l.padEnd(5)} ${b} = ${m.token}(${d});`,m.uid);return b}_writePrimitiveNode(h, m,l=!1){var d=h.getInput(m);if(d)return d.isUsed=!0,d.variableName;d=1===m.children.length&&m.children[0]?.type===m.type;if(m.isImplicit||d)return this._write(h,m.children[0]);d=this._createVarName(h,m);if(l)return g(h,`${m.type.padEnd(5)} ${d};`,m.uid),d;if((l=!m.debugInfo.name&&!m.isMutable)&&"float"===m.type&&"number"===typeof m.children[0])return Number.isInteger(m.children[0])?m.children[0].toFixed(1):m.children[0].toString();if(l&&"int"===m.type&&"number"===typeof m.children[0]&&Number.isInteger(m.children[0]))return m.children[0].toString(); const b=m.children.map(a=>this._write(h,a)).join(", ");if("array"===m.type)return g(h,`${m.type.padEnd(5)} ${d} = [${b}];`,m.uid),d;if(l)return`${m.type}(${b})`;g(h,`${m.type.padEnd(5)} ${d} = ${m.type}(${b});`,m.uid);return d}}e.GlslShaderWriter=q;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext":function(){define(["exports","./ShaderGraphNode"],function(e,g){class q{constructor(l,d,b){this.variableName=l;this.variableInputType= d;this.node=b;this.type="shader-input";this.isUsed=!1}clone(){return new q(this.variableName,this.variableInputType,g.cloneShaderNode(this.node))}}class h{constructor(l,d,b){this.outVariableName=l;this.outVariableType=d;this.node=b;this.type="shader-output"}clone(){const l=new h(this.outVariableName,this.outVariableType,g.cloneShaderNode(this.node));l.variableName=this.variableName;return l}}class m{static createVertex(l,d,b,a,f,n){const c=[];for(const r in l){const k=l[r],p=b.get(r);p?c.push(new q(p, "builtin",k)):c.push(new q("a_"+r,"attribute",k))}for(const r of a)c.push(new q(r.uniformName,"uniform",r.uniformHydrated));l=[];for(const r in d)b=d[r],"glPosition"===r?l.push(new h("gl_Position","builtin",b)):"glPointSize"===r?l.push(new h("gl_PointSize","builtin",b)):l.push(new h("v_"+r,"varying",b));return new m(c,l,f,n)}static createFragment(l,d,b,a,f,n){const c=[];f=Array.from(f.rootOutputNodes());for(var r in l){const p=l[r];var k=b.get(r);k?c.push(new q(k,"builtin",p)):(k=f.find(t=>t.node=== p))&&c.push(new q(k.outVariableName,k.outVariableType,p))}for(const p of a)c.push(new q(p.uniformName,"uniform",p.uniformHydrated));l=[];for(const p in d)if(a=d[p],r=b.get(p),"discard"===p)l.push(new h(null,"discard",a));else if(r)l.push(new h(r,"builtin",a));else throw Error(`Member ${p} in shader fragment output shoule be tagged as builtin`);return new m(c,l,n)}constructor(l,d,b,a){this.type="shader-graph-context";this.indent=0;this.body="";this.varCount=0;this._inputShaderTypesByNodeUid=new Map; this._nodeEmitMap=new Map;for(const f of l)this._inputShaderTypesByNodeUid.set(f.node.uid,f);this._outputShaderTypes=d;this._transformFeedbackBindings=b;this._transformFeedbackNames=new Set(b.map(f=>"v_"+f.propertyKey));this._usedInFragmentShader=a}shouldPruneOutputNode(l){return!this._usedInFragmentShader||"builtin"===l.outVariableType||this._transformFeedbackNames.has(l.outVariableName)?!1:!this._usedInFragmentShader.has(l.node.uid)}setEmit(l,d){this._nodeEmitMap.set(l.uid,d)}getEmit(l){return this._nodeEmitMap.get(l.uid)}inputs(){return this._inputShaderTypesByNodeUid.values()}getInput(l){return this._inputShaderTypesByNodeUid.get(l.uid)}*rootOutputNodes(){for(const l of this._outputShaderTypes)yield l}*nodes(){const l= [];for(var d of this._outputShaderTypes.values())l.push(d.node);for(;l.length;)d=l.pop(),"number"!==typeof d&&"boolean"!==typeof d&&l.push(...d.children.filter(Boolean)),yield d}*nodesOfTypeOrFunction(){for(const l of this.nodes())"number"!==typeof l&&"boolean"!==typeof l&&(yield l)}createSubgraphContext(){const l=this.clone();l.body="";l.indent=this.indent+2;l._nodeEmitMap=new Map(this._nodeEmitMap);return l}clone(){const l=new m([],this._outputShaderTypes,this._transformFeedbackBindings,this._usedInFragmentShader); l._inputShaderTypesByNodeUid=this._inputShaderTypesByNodeUid;l.indent=this.indent;l.body=this.body;l.varCount=this.varCount;l._nodeEmitMap=this._nodeEmitMap;return l}insertVertexShader(l){l.vertex.code.add("");this._insertInputs(l,"vertex");l.vertex.code.add("");l.vertex.code.add("// OUTPUTS: ");l.vertex.code.add("// --------------------------------------------------------- ");for(const d of this.rootOutputNodes()){const b="builtin"===d.outVariableType;this.shouldPruneOutputNode(d)||(b?l.vertex.code.add(`// ${d.outVariableType.padEnd(7)} ${d.node.type.padEnd(9)} ${d.outVariableName};`): l.vertex.code.add(`${d.outVariableType.padEnd(10)} ${d.node.type.padEnd(9)} ${d.outVariableName};`))}l.vertex.code.add("");l.vertex.code.add("void main() {");l.vertex.code.add(" "+this.body.split("\n").join("\n "));for(const d of this.rootOutputNodes())this.shouldPruneOutputNode(d)||l.vertex.code.add(" "+`${d.outVariableName} = ${d.variableName};`);l.vertex.code.add("}")}insertFragmentShader(l){this._insertInputs(l,"fragment");l.fragment.code.add("");l.fragment.code.add("void main() {");l.fragment.code.add(" "+ this.body.split("\n").join("\n "));for(const d of this.rootOutputNodes())"discard"===d.outVariableType?(l.fragment.code.add(" // TODO: Should ensure codegen for discard appears first in fragment shader"),l.fragment.code.add(" "+`if (${d.variableName}) {`),l.fragment.code.add(" discard;"),l.fragment.code.add(" }"),l.fragment.code.add(" ")):l.fragment.code.add(" "+`${d.outVariableName} = ${d.variableName};`);l.fragment.code.add("}")}_insertInputs(l,d){l[d].code.add("// INPUTS: ");l[d].code.add("// --------------------------------------------------------- "); for(const b of this.inputs())b.isUsed&&"builtin"!==b.variableInputType&&("array"===b.node.type?l[d].code.add(`${b.variableInputType.padEnd(10)} ${b.node.elementType.type.padEnd(9)} ${b.variableName}[${b.node.size}];`):l[d].code.add(`${b.variableInputType.padEnd(10)} ${b.node.type.padEnd(9)} ${b.variableName};`))}}e.ShaderGraphContext=m;e.ShaderInput=q;e.ShaderOutput=h;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram":function(){define("exports ../../../../../../core/Error ../../../../../../core/Logger ../../../../../../core/object ../../../../../../core/RandomLCG ../../../../../../core/has ../../../../../webgl/checkWebGLError ../../../../../webgl/enums ../../../../../webgl/FramebufferObject ../../../../../webgl/Program ../../../../../webgl/GLObjectType ../../../../../webgl/Texture ../../Utils".split(" "), function(e,g,q,h,m,l,d,b,a,f,n,c,r){function k(t,w,u){const y=w.length;y!==u&&(t=new g("Invalid Uniform",`Invalid length, expected ${u} but got ${y}`,{uniformName:t,values:w}),q.getLogger("esri.views.2d.engine.webgl.shaderGraph.typed.TypedShaderProgram").errorOnce(t))}class p{constructor(t,w,u,y,x,v){this._vao=this._program=null;this._temporaryTextures=[];this.vertexShader=t;this.fragmentShader=w;this._locations=u;this._locationInfo=y;this._uniformBindings=x;this._transformFeedbackBindings=v}destroy(){this._program&& this._program.dispose();this.cleanupTemporaryTextures()}get locations(){return this._locations}get locationInfo(){return this._locationInfo}setUniforms(t){this._uniforms=t}cleanupTemporaryTextures(){for(const t of this._temporaryTextures)t.dispose();this._temporaryTextures=[]}bind(t){const w=this._uniforms;if(!this._program){var u=new Map;for(const [x,v]of this._locations)u.set(x,v);var y=[];for(const x of this._transformFeedbackBindings??[]){const {index:v,propertyKey:A}=x;y[v]=`v_${A}`}this._program= new f.Program(t,this.vertexShader,this.fragmentShader,u,new Map,y)}u=this._program;t.useProgram(u);for(const x of this._uniformBindings){const {shaderModulePath:v,uniformName:A,uniformType:z,uniformArrayLength:B}=x;y=h.getDeepValue(v,w);if(null==y){if("sampler2D"===z)continue;throw Error(`Failed to find uniform value for ${v}`);}switch("array"===z?x.uniformArrayElementType:z){case "sampler2D":const {unit:D,texture:F}=y;u.setUniform1i(A,D);"type"in F?t.bindTexture(F,D):(y=r.createTexture(t,F.descriptor, F.data),t.bindTexture(y,D));break;case "int":if(!B){u.setUniform1i(A,y);break}k(x.uniformName,y,B);u.setUniform1iv(A,y);break;case "float":if(!B){u.setUniform1f(A,y);break}k(x.uniformName,y,B);u.setUniform1fv(A,y);break;case "vec2":if(!B){u.setUniform2f(A,y[0],y[1]);break}k(x.uniformName,y,B);u.setUniform2fv(A,y.flat());break;case "vec3":if(!B){u.setUniform3f(A,y[0],y[1],y[2]);break}k(x.uniformName,y,B);u.setUniform3fv(A,y.flat());break;case "vec4":if(!B){u.setUniform4f(A,y[0],y[1],y[2],y[3]);break}k(x.uniformName, y,B);u.setUniform4fv(A,y.flat());break;case "mat3":u.setUniformMatrix3fv(A,y.flat());break;case "mat4":u.setUniformMatrix4fv(A,y.flat());break;default:throw Error(`Unable to set uniform for type ${z}`);}}}}e.TypedShaderProgram=p;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader":function(){define("exports ../../../../../../../chunks/tslib.es6 ../../../../highlightReasons ../../GraphShaderModule ../../graph/glsl ./EntityStorage ./ShaderHighlight ./ShaderHittest ./utils ./ViewInfo".split(" "), function(e,g,q,h,m,l,d,b,a,f){class n extends h.VertexInput{}g.__decorate([h.location(0,m.Vec3)],n.prototype,"id",void 0);g.__decorate([h.location(1,m.Float)],n.prototype,"bitset",void 0);g.__decorate([h.location(2,m.Vec2)],n.prototype,"pos",void 0);class c extends h.ComputeVertexInput{}g.__decorate([h.location(14,m.Vec2)],c.prototype,"nextPos1",void 0);g.__decorate([h.location(15,m.Vec2)],c.prototype,"nextPos2",void 0);class r extends h.FragmentInput{}class k extends h.GraphShaderModule{clip(p,t){let w= new m.Float(0);p=this.storage.getFilterFlags(p);w=w.add(m.float(2).multiply(m.float(1).subtract(a.getFilterBit(p,0))));this.inside?w=w.add(m.float(2).multiply(m.float(1).subtract(a.getFilterBit(p,1)))):this.outside?w=w.add(m.float(2).multiply(a.getFilterBit(p,1))):this.highlight&&(w=w.add(m.float(2).multiply(m.float(1).subtract(this._checkHighlight(p)))));null!=t&&(p=(new m.Float(1)).subtract(m.step(t.x,this.view.currentZoom)),t=m.step(t.y,this.view.currentZoom),w=w.add((new m.Float(2)).multiply(p.add(t)))); return w}getFragmentOutput(p,t,w=new m.Float(1/255)){const u=new h.FragmentOutput;u.glFragColor=this._maybeWriteHittest(t)??this._maybeHighlight(p,w)??p;return u}_maybeHighlight(p,t){return this.highlight?new m.Vec4(p.rgb,m.step(t,p.a)):null}_checkHighlight(p){let t=this._checkHighlightBit(p,0);for(let w=1;w{const t=l(f,n,c),w=l(f,c,r),u=l(f,r,n);return g.min(g.min(t,w),u)}])}e.distPointSegment=l;e.distPointTriangle=a;e.failHittest=function(f){return f.distance.add(1)};e.hittestFill=function(f,n,c){const {viewMat3:r,tileMat3:k}=f.view,p=r.multiply(k);n=p.multiply(new g.Vec3(n.pos,1));const t=p.multiply(new g.Vec3(c.nextPos1,1));c=p.multiply(new g.Vec3(c.nextPos2,1));return a(f.hittestRequest.position,n.xy,t.xy,c.xy)};e.hittestMarker= function(f,n,c){return g.distance(f,c).subtract(n)};e.inTriangle=d;e.projectScalar=m;e.xyToBarycentric=b;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources":function(){define("exports ../../../../../../../core/RandomLCG ../../../definitions ../../../meshing/SimpleMesh ../mesh/utils ../../../../../../webgl/enums ../../../../../../webgl/FramebufferObject ../../../../../../webgl/Renderbuffer ../../../../../../webgl/RenderbufferDescriptor ../../../../../../webgl/Texture ../../../../../../webgl/TextureDescriptor".split(" "), function(e,g,q,h,m,l,d,b,a,f,n){class c{constructor(){this._dotTextureSize=0;this._dotMesh=this._dotTextures=null}destroy(){this._disposeTextures();this._dotFBO&&this._dotFBO.dispose();this._dotMesh&&this._dotMesh.destroy()}getFBO(r){if(null==this._dotFBO){var k=q.tileSize;const p=q.tileSize,t=new n.TextureDescriptor(k,p);t.samplingMode=l.TextureSamplingMode.NEAREST;t.wrapMode=l.TextureWrapMode.CLAMP_TO_EDGE;k=new b.Renderbuffer(r,new a.RenderbufferDescriptor(l.RenderbufferFormat.DEPTH_STENCIL,k, p));this._dotFBO=new d.FramebufferObject(r,t,k)}return this._dotFBO}getDotDensityMesh(r){if(null==this._dotMesh){var k=q.tileSize;const p=k*k,t=new Int16Array(2*p);for(let w=0;w{const f=this.values.findIndex(k=>h.greaterThan(k,d));var n=this.values.get(f);const c=f.subtract(1),r=this.values.get(c);n=d.subtract(r).divide(n.subtract(r));return h.mix(this.colors.get(c),this.colors.get(f),n)}])}}g.__decorate([q.uniform(h.FixedArray.ofType(h.Vec4,8))],l.prototype,"colors",void 0);g.__decorate([q.uniform(h.FixedArray.ofType(h.Float,8))],l.prototype, "values",void 0);e.VisualVariableColor=l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/shaders/VisualVariableOpacity":function(){define(["exports","../../../../../../../chunks/tslib.es6","../../GraphShaderModule","../../graph/glsl","./utils"],function(e,g,q,h,m){class l extends q.UniformGroup{getOpacity(d){return h.cond([m.isNan(d),new h.Float(1)],[h.lessThanEqual(d,this.opacityValues.first()),this.opacities.first()],[h.greaterThanEqual(d, this.opacityValues.last()),this.opacities.last()],[!0,()=>{const b=this.opacityValues.findIndex(c=>h.greaterThan(c,d));var a=this.opacityValues.get(b);const f=b.subtract(1),n=this.opacityValues.get(f);a=d.subtract(n).divide(a.subtract(n));return h.mix(this.opacities.get(f),this.opacities.get(b),a)}])}}g.__decorate([q.uniform(h.FixedArray.ofType(h.Float,8))],l.prototype,"opacities",void 0);g.__decorate([q.uniform(h.FixedArray.ofType(h.Float,8))],l.prototype,"opacityValues",void 0);e.VisualVariableOpacity= l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/shaders/vvUtils":function(){define(["exports","../../graph/glsl"],function(e,g){function q(h){return null!=h.visualVariableSizeMinMaxValue||null!=h.visualVariableSizeScaleStops||null!=h.visualVariableSizeStops||null!=h.visualVariableSizeUnitValue}e.getVisualVariableColor=function(h,m,l,d=new g.Bool(!1)){if(null==h.visualVariableColor)return l;m=h.storage.getColorValue(m);return h.visualVariableColor.getColor(m, l,d)};e.getVisualVariableOpacity=function(h,m){if(null==h.visualVariableOpacity)return new g.Float(1);m=h.storage.getOpacityValue(m);return h.visualVariableOpacity.getOpacity(m)};e.getVisualVariableRotation=function(h,m){if(null==h.visualVariableRotation)return g.Mat3.identity();m=h.storage.getRotationValue(m);return h.visualVariableRotation.getVVRotationMat3(m)};e.getVisualVariableSize=function(h,m,l){return q(h)?(m=h.storage.getSizeValue(m),h.visualVariableSizeMinMaxValue?.getSize(m,l)??h.visualVariableSizeScaleStops?.getSizeForViewScale(h.view.currentScale)?? h.visualVariableSizeStops?.getSize(m,l)??h.visualVariableSizeUnitValue?.getSize(m,l)):l};e.hasVisualVariableSize=q;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique":function(){define(["exports","../FeatureTechnique","../featureTechniqueUtils","../TechniqueType","../shaders/ComplexFillShader"],function(e,g,q,h,m){class l extends g.FeatureTechnique{constructor(){super(...arguments);this.type=h.TechniqueType.ComplexFill; this.shaders={geometry:new m.ComplexFillShader}}render(d,b){const {context:a,painter:f}=d,n=b.instance.getInput();f.setShader({shader:this.shaders.geometry,uniforms:{...q.resolveDynamicUniforms(d,b.target,n.uniforms),...q.getFeatureUniforms(d,b.target),mosaicInfo:f.textureManager.getMosaicInfo(a,b.textureKey),localTileOffset:q.getLocalTileOffset(b.target)},defines:{...q.getSelectionDefines(d)},optionalAttributes:n.optionalAttributes,useComputeBuffer:q.isHittest(d)});f.setPipelineState(q.getFeaturePipelineState(d)); f.submitDraw(d,b)}}e.ComplexFillTechnique=l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader":function(){define("exports ../../../../../../../chunks/tslib.es6 ../../GraphShaderModule ../../graph/glsl ./AFeatureShader ./constants ./FillShader ./LocalTileOffset ./MosaicInfo ./utils".split(" "),function(e,g,q,h,m,l,d,b,a,f){function n(t,w){var u=t.view.requiredZoomFactor,y=new h.Vec2(w.width,w.height),x=y.multiply(w.scale).multiply(u), v=w.angle.multiply(l.c256ToRad);const A=h.sin(v);v=h.cos(v);var z=w.id;var B=h.equal(f.getBit(w.bitset,l.bitsetFillRandomPatternOffset),h.float(1));z=f.rgba2float(new h.Vec4(z,0));B=h.ifElse(B,h.mat3(v.divide(x.x),A.divide(x.y),0,h.negate(A.divide(x.x)),v.divide(x.y),0,f.rand(h.vec2(z,0)),f.rand(h.vec2(0,z)),1),h.mat3(v.divide(x.x),A.divide(x.y),0,h.negate(A.divide(x.x)),v.divide(x.y),0,0,0,1));y=t.localTileOffset.getPatternOffsetAtTileOrigin(y,A,v);u=u.multiply(w.scale).multiply(w.offset.subtract(y)).divide(x); x=new h.Vec3(w.pos,1);u=B.multiply(x).xy.subtract(u);x=w.tlbr.divide(t.mosaicInfo.size.xyxy);y=f.getBit(w.bitset,l.bitsetGenericConsiderAlphaOnly);null!=t.visualVariableColor&&(y=h.ifElse(f.isNan(t.storage.getColorValue(w.id)),new h.Float(0),y));return{tileTextureCoord:u,tlbr:x,sampleAlphaOnly:y}}function c(t,w){var u=h.mod(w.tileTextureCoord,new h.Float(1));u=h.mix(w.tlbr.xy,w.tlbr.zw,u);t=h.texture2D(t.mosaicInfo.texture,u);t=h.ifElse(h.greaterThan(w.sampleAlphaOnly,new h.Float(.5)),t.aaaa,t);return w.color.multiply(t)} class r extends d.FillVertexInput{}g.__decorate([q.location(5,h.Vec4)],r.prototype,"tlbr",void 0);g.__decorate([q.location(6,h.Float)],r.prototype,"width",void 0);g.__decorate([q.location(7,h.Float)],r.prototype,"height",void 0);g.__decorate([q.location(8,h.Vec2)],r.prototype,"offset",void 0);g.__decorate([q.location(9,h.Vec2)],r.prototype,"scale",void 0);g.__decorate([q.location(10,h.Float)],r.prototype,"angle",void 0);class k extends m.FeatureFragmentInput{}class p extends d.FillShader{vertex(t, w){return{...super.vertex(t,w),...n(this,t)}}fragment(t){const w=c(this,t);return this.getFragmentOutput(w,t,new h.Float(0))}}g.__decorate([q.uniform(a.MosaicInfo)],p.prototype,"mosaicInfo",void 0);g.__decorate([q.uniform(b.LocalTileOffset)],p.prototype,"localTileOffset",void 0);g.__decorate([g.__param(0,q.input(r)),g.__param(1,q.input(m.BaseHittestVertexInput))],p.prototype,"vertex",null);g.__decorate([g.__param(0,q.input(k))],p.prototype,"fragment",null);e.ComplexFillFragmentInput=k;e.ComplexFillShader= p;e.ComplexFillVertexInput=r;e.getComplexFillFragmentColor=c;e.getComplexFillVertexData=n;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/shaders/LocalTileOffset":function(){define(["exports","../../../../../../../chunks/tslib.es6","../../GraphShaderModule","../../graph/glsl","./constants"],function(e,g,q,h,m){class l extends q.UniformGroup{getPatternOffsetAtTileOrigin(d,b=new h.Float(0),a=new h.Float(1)){var f=(new h.Vec2(m.maxRepresentableInt)).divide(d); f=d.multiply(h.fract(this.maxIntsToLocalOrigin.multiply(f))).add(this.tileOffsetFromLocalOrigin).subtract((new h.Float(.5)).multiply(d));f=new h.Vec2(f.x.multiply(a).subtract(f.y.multiply(b)),f.x.multiply(b).add(f.y.multiply(a)));return h.mod(f,d)}}g.__decorate([q.uniform(h.Vec2)],l.prototype,"tileOffsetFromLocalOrigin",void 0);g.__decorate([q.uniform(h.Vec2)],l.prototype,"maxIntsToLocalOrigin",void 0);e.LocalTileOffset=l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/shaders/MosaicInfo":function(){define(["exports", "../../../../../../../chunks/tslib.es6","../../GraphShaderModule","../../graph/glsl"],function(e,g,q,h){class m extends q.UniformGroup{}g.__decorate([q.uniform(h.Vec2)],m.prototype,"size",void 0);g.__decorate([q.uniform(h.Sampler2D)],m.prototype,"texture",void 0);e.MosaicInfo=m;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique":function(){define("exports ../FeatureTechnique ../featureTechniqueUtils ../TechniqueType ../line/utils ../shaders/ComplexOutlineFillShader".split(" "), function(e,g,q,h,m,l){class d extends g.FeatureTechnique{constructor(){super(...arguments);this.type=h.TechniqueType.ComplexOutlineFill;this.shaders={geometry:new l.ComplexOutlineFillShader}}render(b,a){const {context:f,painter:n,pixelRatio:c}=b,r=a.instance.getInput();n.setShader({shader:this.shaders.geometry,uniforms:{...q.resolveDynamicUniforms(b,a.target,r.uniforms),...q.getFeatureUniforms(b,a.target),antialiasingControls:m.getAntialiasingControls(c),mosaicInfo:n.textureManager.getMosaicInfo(f, a.textureKey),localTileOffset:q.getLocalTileOffset(a.target)},defines:{...q.getSelectionDefines(b)},optionalAttributes:r.optionalAttributes,useComputeBuffer:q.isHittest(b)});n.setPipelineState(q.getFeaturePipelineState(b));n.submitDraw(b,a)}}e.ComplexOutlineFillTechnique=d;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/line/utils":function(){define(["exports"],function(e){e.getAntialiasingControls=function(g){g=1/g;return{antialiasing:g, blur:0+g}};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexOutlineFillShader":function(){define("exports ../../../../../../../chunks/tslib.es6 ../../GraphShaderModule ../../graph/glsl ./AFeatureShader ./ComplexFillShader ./hittestUtils ./LineShader ./LocalTileOffset ./MosaicInfo ./OutlineFillShader ./PatternOutlineFillShader".split(" "),function(e,g,q,h,m,l,d,b,a,f,n,c){class r extends m.FeatureVertexInput{}g.__decorate([q.location(3, h.Vec4)],r.prototype,"color",void 0);g.__decorate([q.location(4,h.Vec4)],r.prototype,"tlbr",void 0);g.__decorate([q.location(5,h.Float)],r.prototype,"angle",void 0);g.__decorate([q.location(6,h.Float)],r.prototype,"aux1",void 0);g.__decorate([q.location(7,h.Float)],r.prototype,"aux2",void 0);g.__decorate([q.location(8,h.Vec2)],r.prototype,"aux3",void 0);g.__decorate([q.location(9,h.Vec2)],r.prototype,"aux4",void 0);g.__decorate([q.location(10,h.Vec2)],r.prototype,"zoomRange",void 0);class k extends c.PatternOutlineFillFragmentInput{} class p extends n.AOutlineFillShader{vertex(t,w){const {aux1:u,aux2:y,aux3:x,aux4:v}=t;var A={...t,width:u,height:y,offset:x,scale:v.multiply(.0625)},z={...t,halfWidth:u,referenceHalfWidth:y,offset:x,normal:v.subtract(128).multiply(.0625)};z=n.getOutlineFillVertexData(this,z);A=l.getComplexFillVertexData(this,A);const B=h.greaterThan(z.isOutline,new h.Float(.5));return{...z,...A,...this.maybeRunHittest(t,w,B)}}fragment(t){var {isOutline:w}=t;w=h.greaterThan(w,new h.Float(.5));var u=b.getLineFragmentColor(t, this.antialiasingControls.blur);const y=l.getComplexFillFragmentColor(this,t);u=h.ifElse(w,u,y);w=h.ifElse(w,new h.Float(1/255),new h.Float(0));return this.getFragmentOutput(u,t,w)}hittest(t,w,u){return h.ifElse(u,d.failHittest(this.hittestRequest),d.hittestFill(this,t,w))}}g.__decorate([q.uniform(f.MosaicInfo)],p.prototype,"mosaicInfo",void 0);g.__decorate([q.uniform(a.LocalTileOffset)],p.prototype,"localTileOffset",void 0);g.__decorate([g.__param(0,q.input(r)),g.__param(1,q.input(m.BaseHittestVertexInput))], p.prototype,"vertex",null);g.__decorate([g.__param(0,q.input(k))],p.prototype,"fragment",null);e.ComplexOutlineFillShader=p;e.ComplexOutlineFillVertexInput=r;e.packPrecision=16;e.signedToUnsignedByte=128;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader":function(){define("exports ../../../../../../../chunks/tslib.es6 ../../GraphShaderModule ../../graph/glsl ./AFeatureShader ./constants ./hittestUtils ./VisualVariableColor ./VisualVariableOpacity ./VisualVariableSizeMinMaxValue ./VisualVariableSizeScaleStops ./VisualVariableSizeStops ./VisualVariableSizeUnitValue ./vvUtils".split(" "), function(e,g,q,h,m,l,d,b,a,f,n,c,r,k){function p(z){return h.max((new h.Float(l.thinLineWidthFactor)).multiply(h.step(z,new h.Float(l.thinLineHalfWidth))),new h.Float(1))}function t(z,B){const {halfWidth:D,normal:F}=z;z=p(D);const E=h.length(F).multiply(D);return h.clamp(z.multiply(D.subtract(E)).divide(B.add(z).subtract(new h.Float(1))),new h.Float(0),new h.Float(1))}function w(z,B){const {id:D,offset:F,pos:E,normal:C,zoomRange:G}=B,{displayViewScreenMat3:H,displayViewMat3:K}=z.view,J=k.getVisualVariableColor(z, D,B.color),O=k.getVisualVariableOpacity(z,D);{const {id:L,halfWidth:R,referenceHalfWidth:V}=B;k.hasVisualVariableSize(z)?(B=(new h.Float(2)).multiply(V),B=k.getVisualVariableSize(z,L,B),B=(new h.Float(.5)).multiply(R.divide(h.max(V,new h.Float(l.epsilon)))).multiply(B)):B=R}var Q=(new h.Float(.5)).multiply(z.antialiasingControls.antialiasing);Q=h.max(B.add(Q),new h.Float(.45)).add((new h.Float(.1)).multiply(Q));const T=p(Q).multiply(Q).multiply(F);var I=K.multiply(new h.Vec3(T,new h.Float(0)));I= H.multiply(new h.Vec3(E,new h.Float(1))).add(I);z=(new h.Float(2)).multiply(h.step(B,new h.Float(0))).add(z.clip(D,G));I=new h.Vec4(I.xy,z,1);z=new h.Vec4(I.xy,z,1);return{color:J,opacity:O,halfWidth:Q,normal:C,scaledOffset:T,scaledHalfWidth:B,glPosition:z}}function u(z,B){const {opacity:D,color:F}=z;z=t(z,B);return D.multiply(F).multiply(z)}class y extends m.FeatureVertexInput{}g.__decorate([q.location(3,h.Vec4)],y.prototype,"color",void 0);g.__decorate([q.location(4,h.Vec2)],y.prototype,"offset", void 0);g.__decorate([q.location(5,h.Vec2)],y.prototype,"normal",void 0);g.__decorate([q.location(6,h.Float)],y.prototype,"halfWidth",void 0);g.__decorate([q.location(7,h.Float)],y.prototype,"referenceHalfWidth",void 0);g.__decorate([q.location(8,h.Vec2)],y.prototype,"zoomRange",void 0);class x extends m.FeatureFragmentInput{}class v extends q.UniformGroup{}g.__decorate([q.uniform(h.Float)],v.prototype,"antialiasing",void 0);g.__decorate([q.uniform(h.Float)],v.prototype,"blur",void 0);class A extends m.AFeatureShader{constructor(){super(...arguments); this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(z,B){const D=w(this,z);return{...D,...this.maybeRunHittest(z,B,D.halfWidth)}}fragment(z){const B=u(z,this.antialiasingControls.blur);return this.getFragmentOutput(B,z)}hittest(z,B,D){const {viewMat3:F,tileMat3:E}=this.view;var C=F.multiply(E);z=C.multiply(new h.Vec3(z.pos,1));const G=C.multiply(new h.Vec3(B.nextPos1,1));B=C.multiply(new h.Vec3(B.nextPos2,1));const {distance:H,smallSymbolDistance:K,smallSymbolSizeThreshold:J}=this.hittestRequest; C=h.step(D,J.multiply(.5)).multiply(H.subtract(K));const O=this.hittestRequest.position;return h.min(d.distPointSegment(O,z.xy,G.xy),d.distPointSegment(O,z.xy,B.xy)).subtract(D).add(C)}}g.__decorate([q.uniform(v)],A.prototype,"antialiasingControls",void 0);g.__decorate([q.option(b.VisualVariableColor)],A.prototype,"visualVariableColor",void 0);g.__decorate([q.option(a.VisualVariableOpacity)],A.prototype,"visualVariableOpacity",void 0);g.__decorate([q.option(f.VisualVariableSizeMinMaxValue)],A.prototype, "visualVariableSizeMinMaxValue",void 0);g.__decorate([q.option(n.VisualVariableSizeScaleStops)],A.prototype,"visualVariableSizeScaleStops",void 0);g.__decorate([q.option(c.VisualVariableSizeStops)],A.prototype,"visualVariableSizeStops",void 0);g.__decorate([q.option(r.VisualVariableSizeUnitValue)],A.prototype,"visualVariableSizeUnitValue",void 0);g.__decorate([g.__param(0,q.input(y)),g.__param(1,q.input(m.BaseHittestVertexInput))],A.prototype,"vertex",null);g.__decorate([g.__param(0,q.input(x))], A.prototype,"fragment",null);e.AntialiasingControls=v;e.LineFragmentInput=x;e.LineShader=A;e.LineVertexInput=y;e.getLineAntialiasing=t;e.getLineFragmentColor=u;e.getLineVertexData=w;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/shaders/VisualVariableSizeMinMaxValue":function(){define(["exports","../../../../../../../chunks/tslib.es6","../../GraphShaderModule","../../graph/glsl","./utils"],function(e,g,q,h,m){class l extends q.UniformGroup{getSize(d, b){const a=this.minMaxValueAndSize.xy,f=this.minMaxValueAndSize.zw;return h.ifElse(m.isNan(d),b,()=>{var n=d.subtract(a.x).divide(a.y.subtract(a.x));n=h.clamp(n,new h.Float(0),new h.Float(1));return f.x.add(n.multiply(f.y.subtract(f.x)))})}}g.__decorate([q.uniform(h.Vec4)],l.prototype,"minMaxValueAndSize",void 0);e.VisualVariableSizeMinMaxValue=l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/shaders/VisualVariableSizeScaleStops":function(){define(["exports", "../../../../../../../chunks/tslib.es6","../../GraphShaderModule","../../graph/glsl"],function(e,g,q,h){class m extends q.UniformGroup{getSizeForViewScale(l){return h.cond([h.lessThanEqual(l,this.values.first()),this.sizes.first()],[h.greaterThanEqual(l,this.values.last()),this.sizes.last()],[!0,()=>{const d=this.values.findIndex(n=>h.greaterThan(n,l));var b=this.values.get(d);const a=d.subtract(1),f=this.values.get(a);b=l.subtract(f).divide(b.subtract(f));return h.mix(this.sizes.get(a),this.sizes.get(d), b)}])}}g.__decorate([q.uniform(h.FixedArray.ofType(h.Float,8))],m.prototype,"sizes",void 0);g.__decorate([q.uniform(h.FixedArray.ofType(h.Float,8))],m.prototype,"values",void 0);e.VisualVariableSizeScaleStops=m;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/shaders/VisualVariableSizeStops":function(){define(["exports","../../../../../../../chunks/tslib.es6","../../GraphShaderModule","../../graph/glsl","./utils"],function(e,g,q,h, m){class l extends q.UniformGroup{getSize(d,b){const a=h.cond([m.isNan(d),b],[h.lessThanEqual(d,this.values.first()),this.sizes.first()],[h.greaterThanEqual(d,this.values.last()),this.sizes.last()],[!0,()=>{const f=this.values.findIndex(k=>h.greaterThan(k,d));var n=this.values.get(f);const c=f.subtract(1),r=this.values.get(c);n=d.subtract(r).divide(n.subtract(r));return h.mix(this.sizes.get(c),this.sizes.get(f),n)}]);return h.ifElse(m.isNan(a),b,a)}}g.__decorate([q.uniform(h.FixedArray.ofType(h.Float, 8))],l.prototype,"sizes",void 0);g.__decorate([q.uniform(h.FixedArray.ofType(h.Float,8))],l.prototype,"values",void 0);e.VisualVariableSizeStops=l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/shaders/VisualVariableSizeUnitValue":function(){define(["exports","../../../../../../../chunks/tslib.es6","../../GraphShaderModule","../../graph/glsl","./utils"],function(e,g,q,h,m){class l extends q.UniformGroup{getSize(d,b){return h.ifElse(m.isNan(d), b,d.multiply(this.unitValueToPixelsRatio))}}g.__decorate([q.uniform(h.Float)],l.prototype,"unitValueToPixelsRatio",void 0);e.VisualVariableSizeUnitValue=l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader":function(){define("exports ../../../../../../../chunks/tslib.es6 ../../GraphShaderModule ../../graph/glsl ./AFeatureShader ./constants ./hittestUtils ./LineShader ./utils ./VisualVariableColor ./VisualVariableOpacity ./VisualVariableSizeMinMaxValue ./VisualVariableSizeScaleStops ./VisualVariableSizeStops ./VisualVariableSizeUnitValue ./vvUtils".split(" "), function(e,g,q,h,m,l,d,b,a,f,n,c,r,k,p,t){function w(A,z,B){const {id:D,bitset:F}=z,E=a.getBit(F,l.bitsetTypeFillOutline),C=h.greaterThan(E,new h.Float(.5)),G=b.getLineVertexData(A,z),H=h.ifElse(C,G.halfWidth,new h.Float(0));var K=t.getVisualVariableOpacity(A,D),J=t.getVisualVariableColor(A,D,z.color);K=h.ifElse(C,z.color,J.multiply(K));J=A.view.displayViewScreenMat3.multiply(new h.Vec3(z.pos.xy,1));const O=A.clip(z.id);J=new h.Vec4(J.xy,O,1);J=h.ifElse(C,G.glPosition,J);A=B&&A.maybeRunHittest(z, B,C);return{isOutline:E,color:K,opacity:new h.Float(1),halfWidth:H,normal:G.normal,glPosition:J,...A}}class u extends m.FeatureVertexInput{}g.__decorate([q.location(3,h.Vec2)],u.prototype,"offset",void 0);g.__decorate([q.location(4,h.Vec4)],u.prototype,"color",void 0);g.__decorate([q.location(5,h.Vec2)],u.prototype,"normal",void 0);g.__decorate([q.location(6,h.Float)],u.prototype,"halfWidth",void 0);g.__decorate([q.location(7,h.Float)],u.prototype,"referenceHalfWidth",void 0);g.__decorate([q.location(8, h.Vec2)],u.prototype,"zoomRange",void 0);class y extends b.LineFragmentInput{}class x extends m.AFeatureShader{constructor(){super(...arguments);this.computeAttributes={pos:["nextPos1","nextPos2"]}}}g.__decorate([q.uniform(b.AntialiasingControls)],x.prototype,"antialiasingControls",void 0);g.__decorate([q.option(f.VisualVariableColor)],x.prototype,"visualVariableColor",void 0);g.__decorate([q.option(n.VisualVariableOpacity)],x.prototype,"visualVariableOpacity",void 0);g.__decorate([q.option(c.VisualVariableSizeMinMaxValue)], x.prototype,"visualVariableSizeMinMaxValue",void 0);g.__decorate([q.option(r.VisualVariableSizeScaleStops)],x.prototype,"visualVariableSizeScaleStops",void 0);g.__decorate([q.option(k.VisualVariableSizeStops)],x.prototype,"visualVariableSizeStops",void 0);g.__decorate([q.option(p.VisualVariableSizeUnitValue)],x.prototype,"visualVariableSizeUnitValue",void 0);class v extends x{vertex(A,z){return w(this,A,z)}fragment(A){const {color:z,isOutline:B}=A;var D=h.greaterThan(B,new h.Float(.5)),F=b.getLineFragmentColor(A, this.antialiasingControls.blur);F=h.ifElse(D,F,z);D=h.ifElse(D,new h.Float(1/255),new h.Float(0));return this.getFragmentOutput(F,A,D)}hittest(A,z,B){return h.ifElse(B,d.failHittest(this.hittestRequest),d.hittestFill(this,A,z))}}g.__decorate([g.__param(0,q.input(u)),g.__param(1,q.input(m.BaseHittestVertexInput))],v.prototype,"vertex",null);g.__decorate([g.__param(0,q.input(y))],v.prototype,"fragment",null);e.AOutlineFillShader=x;e.OutlineFillFragmentInput=y;e.OutlineFillShader=v;e.OutlineFillVertexInput= u;e.getOutlineFillVertexData=w;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternOutlineFillShader":function(){define("exports ../../../../../../../chunks/tslib.es6 ../../GraphShaderModule ../../graph/glsl ./AFeatureShader ./LineShader ./LocalTileOffset ./MosaicInfo ./OutlineFillShader ./PatternFillShader".split(" "),function(e,g,q,h,m,l,d,b,a,f){class n extends a.OutlineFillVertexInput{}g.__decorate([q.location(9,h.Vec4)], n.prototype,"tlbr",void 0);g.__decorate([q.location(10,h.Float)],n.prototype,"inverseRasterizationScale",void 0);class c extends a.OutlineFillFragmentInput{}class r extends a.OutlineFillShader{vertex(k,p){return{...a.getOutlineFillVertexData(this,k,p),...f.getPatternFillVertexData(this,k)}}fragment(k){var {isOutline:p}=k;p=h.greaterThan(p,new h.Float(.5));var t=l.getLineFragmentColor(k,this.antialiasingControls.blur);const w=f.getPatternFillFragmentColor(k,this.mosaicInfo);t=h.ifElse(p,t,w);p=h.ifElse(p, new h.Float(1/255),new h.Float(0));return this.getFragmentOutput(t,k,p)}}g.__decorate([q.uniform(b.MosaicInfo)],r.prototype,"mosaicInfo",void 0);g.__decorate([q.uniform(d.LocalTileOffset)],r.prototype,"localTileOffset",void 0);g.__decorate([g.__param(0,q.input(n)),g.__param(1,q.input(m.BaseHittestVertexInput))],r.prototype,"vertex",null);g.__decorate([g.__param(0,q.input(c))],r.prototype,"fragment",null);e.PatternOutlineFillFragmentInput=c;e.PatternOutlineFillShader=r;e.PatternOutlineFillVertexInput= n;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternFillShader":function(){define("exports ../../../../../../../chunks/tslib.es6 ../../GraphShaderModule ../../graph/glsl ./AFeatureShader ./FillShader ./LocalTileOffset ./MosaicInfo".split(" "),function(e,g,q,h,m,l,d,b){function a(k,p){var t=p.tlbr.xy,w=p.tlbr.zw,u=w.x.subtract(t.x);t=t.y.subtract(w.y);u=(new h.Vec2(u,t)).multiply(p.inverseRasterizationScale);t=u.multiply(k.view.requiredZoomFactor); w=new h.Float(1);const y=new h.Float(0);w=new h.Mat3(w.divide(t.x),y.divide(t.y),0,h.negate(y.divide(t.x)),w.divide(t.y),0,0,0,1);u=k.localTileOffset.getPatternOffsetAtTileOrigin(u).divide(t);t=new h.Vec3(p.pos,1);u=w.multiply(t).xy.subtract(u);k=p.tlbr.divide(k.mosaicInfo.size.xyxy);return{tileTextureCoord:u,tlbr:k}}function f(k,p){var t=h.mod(k.tileTextureCoord,new h.Float(1));t=h.mix(k.tlbr.xy,k.tlbr.zw,t);p=h.texture2D(p.texture,t);return k.color.multiply(p)}class n extends l.FillVertexInput{} g.__decorate([q.location(5,h.Vec4)],n.prototype,"tlbr",void 0);g.__decorate([q.location(6,h.Float)],n.prototype,"inverseRasterizationScale",void 0);class c extends m.FeatureFragmentInput{}class r extends l.FillShader{vertex(k,p){return{...super.vertex(k,p),...a(this,k)}}fragment(k){const p=f(k,this.mosaicInfo);return this.getFragmentOutput(p,k,new h.Float(0))}}g.__decorate([q.uniform(b.MosaicInfo)],r.prototype,"mosaicInfo",void 0);g.__decorate([q.uniform(d.LocalTileOffset)],r.prototype,"localTileOffset", void 0);g.__decorate([g.__param(0,q.input(n)),g.__param(1,q.input(m.BaseHittestVertexInput))],r.prototype,"vertex",null);g.__decorate([g.__param(0,q.input(c))],r.prototype,"fragment",null);e.PatternFillFragmentInput=c;e.PatternFillShader=r;e.PatternFillVertexInput=n;e.getPatternFillFragmentColor=f;e.getPatternFillVertexData=a;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/fill/FillTechnique":function(){define(["exports","../FeatureTechnique", "../featureTechniqueUtils","../TechniqueType","../shaders/FillShader"],function(e,g,q,h,m){class l extends g.FeatureTechnique{constructor(){super(...arguments);this.type=h.TechniqueType.Fill;this.shaders={geometry:new m.FillShader}}render(d,b){const {painter:a}=d,f=b.instance.getInput();a.setShader({shader:this.shaders.geometry,uniforms:{...q.resolveDynamicUniforms(d,b.target,f.uniforms),...q.getFeatureUniforms(d,b.target)},defines:q.getSelectionDefines(d),optionalAttributes:f.optionalAttributes, useComputeBuffer:q.isHittest(d)});a.setPipelineState(q.getFeaturePipelineState(d));a.submitDraw(d,b)}}e.FillTechnique=l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillTechnique":function(){define("exports ../FeatureTechnique ../featureTechniqueUtils ../TechniqueType ../line/utils ../shaders/OutlineFillShader".split(" "),function(e,g,q,h,m,l){class d extends g.FeatureTechnique{constructor(){super(...arguments);this.type= h.TechniqueType.OutlineFill;this.shaders={geometry:new l.OutlineFillShader}}render(b,a){const {painter:f,pixelRatio:n}=b,c=a.instance.getInput();f.setShader({shader:this.shaders.geometry,uniforms:{...q.resolveDynamicUniforms(b,a.target,c.uniforms),...q.getFeatureUniforms(b,a.target),antialiasingControls:m.getAntialiasingControls(n)},defines:{...q.getSelectionDefines(b)},optionalAttributes:c.optionalAttributes,useComputeBuffer:q.isHittest(b)});f.setPipelineState(q.getFeaturePipelineState(b));f.submitDraw(b, a)}}e.OutlineFillTechnique=d;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique":function(){define(["exports","../FeatureTechnique","../featureTechniqueUtils","../TechniqueType","../shaders/PatternFillShader"],function(e,g,q,h,m){class l extends g.FeatureTechnique{constructor(){super(...arguments);this.type=h.TechniqueType.PatternFill;this.shaders={geometry:new m.PatternFillShader}}render(d,b){const {context:a, painter:f}=d,n=b.instance.getInput();f.setShader({shader:this.shaders.geometry,uniforms:{...q.resolveDynamicUniforms(d,b.target,n.uniforms),...q.getFeatureUniforms(d,b.target),mosaicInfo:f.textureManager.getMosaicInfo(a,b.textureKey),localTileOffset:q.getLocalTileOffset(b.target)},defines:{...q.getSelectionDefines(d)},optionalAttributes:n.optionalAttributes,useComputeBuffer:q.isHittest(d)});f.setPipelineState(q.getFeaturePipelineState(d));f.submitDraw(d,b)}}e.PatternFillTechnique=l;Object.defineProperty(e, Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique":function(){define("exports ../FeatureTechnique ../featureTechniqueUtils ../TechniqueType ../line/utils ../shaders/PatternOutlineFillShader".split(" "),function(e,g,q,h,m,l){class d extends g.FeatureTechnique{constructor(){super(...arguments);this.type=h.TechniqueType.PatternOutlineFill;this.shaders={geometry:new l.PatternOutlineFillShader}}render(b,a){const {context:f,painter:n, pixelRatio:c}=b,r=a.instance.getInput();n.setShader({shader:this.shaders.geometry,uniforms:{...q.resolveDynamicUniforms(b,a.target,r.uniforms),...q.getFeatureUniforms(b,a.target),antialiasingControls:m.getAntialiasingControls(c),mosaicInfo:n.textureManager.getMosaicInfo(f,a.textureKey),localTileOffset:q.getLocalTileOffset(a.target)},defines:{...q.getSelectionDefines(b)},optionalAttributes:r.optionalAttributes,useComputeBuffer:q.isHittest(b)});n.setPipelineState(q.getFeaturePipelineState(b));n.submitDraw(b, a)}}e.PatternOutlineFillTechnique=d;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique":function(){define("exports ../FeatureTechnique ../featureTechniqueUtils ../TechniqueType ./HeatmapResources ../shaders/HeatmapAccumulateShader ../shaders/HeatmapResolveShader ../../../../../../webgl/enums".split(" "),function(e,g,q,h,m,l,d,b){function a(p){return p.key.level+1}function f(p,t){const {referenceScale:w,radius:u}= p.uniforms;return u*(0!==w?w/t.scale:1)}class n extends g.FeatureTechnique{constructor(){super(...arguments);this.type=h.TechniqueType.Heatmap;this.shaders={accumulate:new l.HeatmapAccumulateShader,resolve:new d.HeatmapResolveShader};this.postProcessingEnabled=!0;this._isBound=!1;this._resources=new Map;this.overrideStencilRef=a}shutdown(p){super.shutdown(p);this._resources.get(p)?.destroy();this._resources.delete(p);this._prevFBO=null;this._unbind()}render(p,t){const {context:w,painter:u,state:y}= p;var x=t.instance.getInput();const {isFieldActive:v}=x.uniforms,A=this._getOrCreateResourcesRecord(w),z=A.loadQualityProfile(w);q.isHighlight(p)||(q.isHittest(p)||this._bind(p,A,x),u.setShader({shader:this.shaders.accumulate,uniforms:{...q.getFeatureUniforms(p,t.target),kernelControls:{radius:f(x,y),isFieldActive:v?1:0}},defines:{...q.getSelectionDefines(p),...z.defines},optionalAttributes:{},useComputeBuffer:q.isHittest(p)}),x=q.isHittest(p)?r:c,u.setPipelineState(x),u.submitDraw(p,t))}postProcess(p, t){if(!q.isHittest(p)&&!q.isHighlight(p)){var {context:w,painter:u}=p,y=this._resources.get(w);if(null!=this._prevFBO&&null!=this._prevViewport&&y?.initialized){({defines:p}=y.loadQualityProfile(w));var {minDensity:x,maxDensity:v,radius:A}=t.getInput().uniforms;t=y.accumulateFramebuffer;y=y.resolveGradientTexture;u.setShader({shader:this.shaders.resolve,uniforms:{accumulatedDensity:{texture:{unit:8,texture:t.colorTexture},minAndInvRange:[x,1/(v-x)],normalization:3/(A*A*Math.PI)},gradient:{texture:{unit:9, texture:y}}},defines:p,optionalAttributes:{},useComputeBuffer:!1});w.bindFramebuffer(this._prevFBO);w.setViewport(0,0,this._prevViewport.width,this._prevViewport.height);w.bindTexture(t.colorTexture,8);w.bindTexture(y,9);u.setPipelineState(k);u.submitDrawQuad(w);this._unbind()}}}_getOrCreateResourcesRecord(p){let t=this._resources.get(p);null==t&&(t=new m.HeatmapResources,this._resources.set(p,t));return t}_unbind(){this._prevViewport=this._prevFBO=null;this._isBound=!1}_bind(p,t,w){if(!this._isBound){var {context:u, state:y,pixelRatio:x}=p;p=u.getBoundFramebufferObject();var v=u.getViewport();this._prevFBO=p;this._prevViewport=v;var {gradient:A,gradientHash:z}=w.uniforms;t.ensureResolveGradientTexture(u,z,A);var {width:B,height:D}=v;w=f(w,y);v=1.5{var a=this._getNormalizedAngle(b).multiply(m.cDegToRad); const f=h.sin(a);a=h.cos(a);return new h.Mat4(a,f,0,0,f.multiply(new h.Float(-1)),a,0,0,0,0,1,0,0,0,0,1)})}getVVRotationMat3(b){return h.ifElse(l.isNan(b),h.Mat3.identity(),()=>{var a=this._getNormalizedAngle(b).multiply(m.cDegToRad);const f=h.sin(a);a=h.cos(a);return new h.Mat3(a,f,0,f.multiply(new h.Float(-1)),a,0,0,0,1)})}_getNormalizedAngle(b){const a=h.equal(this.rotationType,new h.Float(m.RotationType.Arithmatic));return h.ifElse(a,(new h.Float(90)).subtract(b),b)}}g.__decorate([q.uniform(h.Float)], d.prototype,"rotationType",void 0);e.VisualVariableRotation=d;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/line/LineTechnique":function(){define("exports ../../../enums ../FeatureTechnique ../featureTechniqueUtils ../TechniqueType ./utils ../shaders/LineShader".split(" "),function(e,g,q,h,m,l,d){class b extends q.FeatureTechnique{constructor(){super(...arguments);this.type=m.TechniqueType.Line;this.shaders={geometry:new d.LineShader}; this.symbologyPlane=g.FeatureSymbologyDrawOrder.LINE}render(a,f){const {painter:n,pixelRatio:c}=a,r=f.instance.getInput();n.setShader({shader:this.shaders.geometry,uniforms:{...h.resolveDynamicUniforms(a,f.target,r.uniforms),...h.getFeatureUniforms(a,f.target),antialiasingControls:l.getAntialiasingControls(c)},defines:{...h.getSelectionDefines(a)},optionalAttributes:r.optionalAttributes,useComputeBuffer:h.isHittest(a)});n.setPipelineState(h.getFeaturePipelineState(a));n.submitDraw(a,f)}}e.LineTechnique= b;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique":function(){define("exports ../../../enums ../FeatureTechnique ../featureTechniqueUtils ../TechniqueType ./utils ../shaders/TexturedLineShader".split(" "),function(e,g,q,h,m,l,d){class b extends q.FeatureTechnique{constructor(){super(...arguments);this.type=m.TechniqueType.TexturedLine;this.shaders={geometry:new d.TexturedLineShader};this.symbologyPlane=g.FeatureSymbologyDrawOrder.LINE}render(a, f){const {context:n,painter:c,pixelRatio:r}=a,k=f.instance.getInput();c.setShader({shader:this.shaders.geometry,uniforms:{...h.resolveDynamicUniforms(a,f.target,k.uniforms),...h.getFeatureUniforms(a,f.target),antialiasingControls:l.getAntialiasingControls(r),mosaicInfo:c.textureManager.getMosaicInfo(n,f.textureKey)},defines:{...h.getSelectionDefines(a)},optionalAttributes:k.optionalAttributes,useComputeBuffer:h.isHittest(a)});c.setPipelineState(h.getFeaturePipelineState(a));c.submitDraw(a,f)}}e.TexturedLineTechnique= b;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/shaders/TexturedLineShader":function(){define("exports ../../../../../../../chunks/tslib.es6 ../../../../../../../symbols/cim/constants ../../GraphShaderModule ../../graph/glsl ./AFeatureShader ./constants ./LineShader ./MosaicInfo ./utils".split(" "),function(e,g,q,h,m,l,d,b,a,f){class n extends b.LineVertexInput{}g.__decorate([h.location(9,m.Float)],n.prototype,"accumulatedDistance", void 0);g.__decorate([h.location(10,m.Vec2)],n.prototype,"segmentDirection",void 0);g.__decorate([h.location(11,m.Vec4)],n.prototype,"tlbr",void 0);class c extends b.LineFragmentInput{}class r extends b.LineShader{_getLineWidthRatio(k,p){const t=new m.Float(q.dashRadius);k=f.getBit(k.bitset,d.bitsetLineScaleDash);return k.multiply(m.max(p,new m.Float(.25))).add((new m.Float(1)).subtract(k)).divide(t)}_getSDFAlpha(k){const {halfWidth:p,normal:t,tlbr:w,patternSize:u,accumulatedDistance:y,lineWidthRatio:x}= k;k=u.x.multiply(new m.Float(2)).multiply(x);k=m.fract(y.divide(k));const v=(new m.Float(.25)).multiply(t.y).add(new m.Float(.5));k=m.mix(w.xy,w.zw,new m.Vec2(k,v));k=f.rgba2float(m.texture2D(this.mosaicInfo.texture,k)).subtract(new m.Float(.5)).multiply(p);k=m.clamp((new m.Float(.5)).subtract(k),new m.Float(0),new m.Float(1));return new m.Vec4(k)}_getPatternColor(k){const {halfWidth:p,normal:t,color:w,accumulatedDistance:u,patternSize:y,sampleAlphaOnly:x,tlbr:v}=k;k=y.y.multiply((new m.Float(2)).multiply(p).divide(y.x)); k=m.fract(u.divide(k));const A=(new m.Float(.5)).multiply(t.y).add(new m.Float(.5));k=m.mix(v.xy,v.zw,new m.Vec2(A,k));k=m.texture2D(this.mosaicInfo.texture,k);null!=this.visualVariableColor&&(k=m.ifElse(m.greaterThan(x,new m.Float(.5)),new m.Vec4(w.a),w));return k}vertex(k,p){const {segmentDirection:t,tlbr:w,bitset:u}=k,y=b.getLineVertexData(this,k),x=k.accumulatedDistance.divide(this.view.displayZoomFactor).add(m.dot(t,y.scaledOffset)),v=new m.Vec2(w.z.subtract(w.x),w.w.subtract(w.y)),A=w.divide(this.mosaicInfo.size.xyxy), z=f.getBit(u,d.bitsetLineIsSdf),B=f.getBit(u,d.bitsetGenericConsiderAlphaOnly),D=m.ifElse(m.greaterThan(z,new m.Float(.5)),this._getLineWidthRatio(k,y.scaledHalfWidth),new m.Float(1));return{...y,tlbr:A,patternSize:v,accumulatedDistance:x,isSDF:z,sampleAlphaOnly:B,lineWidthRatio:D,...this.maybeRunHittest(k,p,y.halfWidth)}}fragment(k){const {color:p,opacity:t,isSDF:w}=k;var u=b.getLineAntialiasing(k,this.antialiasingControls.blur);const y=m.ifElse(m.greaterThan(w,new m.Float(.5)),this._getSDFAlpha(k), this._getPatternColor(k));u=p.multiply(t).multiply(u).multiply(y);return this.getFragmentOutput(u,k)}}g.__decorate([h.uniform(a.MosaicInfo)],r.prototype,"mosaicInfo",void 0);g.__decorate([g.__param(0,h.input(n)),g.__param(1,h.input(l.BaseHittestVertexInput))],r.prototype,"vertex",null);e.TexturedLineFragmentInput=c;e.TexturedLineShader=r;e.TexturedLineVertexInput=n;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique":function(){define("exports ../../../enums ../FeatureTechnique ../featureTechniqueUtils ../TechniqueType ./MarkerShader".split(" "), function(e,g,q,h,m,l){class d extends q.FeatureTechnique{constructor(){super(...arguments);this.type=m.TechniqueType.Marker;this.shaders={geometry:new l.MarkerShader};this.symbologyPlane=g.FeatureSymbologyDrawOrder.MARKER}render(b,a){const {context:f,painter:n}=b,c=a.instance.getInput();n.setShader({shader:this.shaders.geometry,uniforms:{...h.resolveDynamicUniforms(b,a.target,c.uniforms),...h.getFeatureUniforms(b,a.target),mosaicInfo:n.textureManager.getMosaicInfo(f,a.textureKey,!0)},defines:{...h.getSelectionDefines(b)}, optionalAttributes:c.optionalAttributes,useComputeBuffer:h.isHittest(b)});n.setPipelineState(h.getFeaturePipelineState(b));n.submitDraw(b,a)}}e.MarkerTechnique=d;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader":function(){define("exports ../../../../../../../chunks/tslib.es6 ../../GraphShaderModule ../../graph/glsl ./markerConstants ../shaders/AFeatureShader ../shaders/constants ../shaders/hittestUtils ../shaders/MosaicInfo ../shaders/utils ../shaders/VisualVariableColor ../shaders/VisualVariableOpacity ../shaders/VisualVariableRotation ../shaders/VisualVariableSizeMinMaxValue ../shaders/VisualVariableSizeScaleStops ../shaders/VisualVariableSizeStops ../shaders/VisualVariableSizeUnitValue ../shaders/vvUtils".split(" "), function(e,g,q,h,m,l,d,b,a,f,n,c,r,k,p,t,w,u){function y(D,F,E,C){return F.multiply(D.x).add(E.multiply(D.y)).add(C.multiply(D.z))}function x(D){return D.multiply(D).divide(128)}class v extends l.FeatureVertexInput{}g.__decorate([q.location(3,h.Vec4)],v.prototype,"color",void 0);g.__decorate([q.location(4,h.Vec4)],v.prototype,"outlineColor",void 0);g.__decorate([q.location(5,h.Vec2)],v.prototype,"offset",void 0);g.__decorate([q.location(6,h.Vec2)],v.prototype,"textureUV",void 0);g.__decorate([q.location(7, h.Vec4)],v.prototype,"sizing",void 0);g.__decorate([q.location(8,h.Float)],v.prototype,"placementAngle",void 0);g.__decorate([q.location(9,h.Float)],v.prototype,"sizeRatio",void 0);g.__decorate([q.location(10,h.Vec2)],v.prototype,"zoomRange",void 0);class A extends q.ComputeVertexInput{}g.__decorate([q.location(12,h.Vec2)],A.prototype,"offsetNextVertex1",void 0);g.__decorate([q.location(13,h.Vec2)],A.prototype,"offsetNextVertex2",void 0);g.__decorate([q.location(14,h.Vec2)],A.prototype,"textureUVNextVertex1", void 0);g.__decorate([q.location(15,h.Vec2)],A.prototype,"textureUVNextVertex2",void 0);class z extends l.FeatureFragmentInput{}class B extends l.AFeatureShader{constructor(){super(...arguments);this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],textureUV:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(D,F){var E=x(D.sizing.x),C=x(D.sizing.y),G=x(D.sizing.z),H=D.placementAngle;const K=f.getBit(D.bitset,m.MarkerConstants.bitset.isSDF),J=f.getBit(D.bitset,m.MarkerConstants.bitset.isMapAligned); var O=f.getBit(D.bitset,m.MarkerConstants.bitset.scaleSymbolsProportionally),Q=f.getBitBool(D.bitset,m.MarkerConstants.bitset.colorLocked),T=u.getVisualVariableOpacity(this,D.id);Q=u.getVisualVariableColor(this,D.id,D.color,Q).multiply(T);T=this.view.displayViewScreenMat3.multiply(new h.Vec3(D.pos.xy,1));G=u.getVisualVariableSize(this,D.id,G).divide(G);E=E.multiply(G);var I=D.offset.xy.multiply(G);O=C.multiply(O.multiply(G.subtract(1)).add(1));O=h.min(O,h.max(E.subtract(.99),new h.Float(0)));C=h.max(O, new h.Float(1));O=h.min(O,new h.Float(1));H=h.Mat3.fromRotation(H.multiply(d.c256ToRad));var L=u.getVisualVariableRotation(this,D.id);H=this._getViewRotationMatrix(J).multiply(L).multiply(H).multiply(new h.Vec3(I.xy,0));I=this.clip(D.id,D.zoomRange);T=new h.Vec4(T.xy.add(H.xy),I,1);H=D.textureUV.divide(this.mosaicInfo.size);O=D.outlineColor.multiply(O);I=f.getBit(D.bitset,m.MarkerConstants.bitset.overrideOutlineColor);L=D.sizeRatio.multiply(E).multiply(.5);return{glPosition:T,color:Q,textureUV:H, outlineColor:O,outlineSize:C,distanceToPx:L,isSDF:K,overrideOutlineColor:I,...this.maybeRunHittest(D,F,{pos:D.pos,size:E,sizeCorrection:G,isMapAligned:J,outlineSize:C,distanceToPx:L,isSDF:K})}}fragment(D){const F=this._getColor(D.textureUV,D);return this.getFragmentOutput(F,D)}hittest(D,F,E){return h.ifElse(h.lessThan(E.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(D,F,E),this._hittestMarker(D,F,E))}_getViewRotationMatrix(D){const F=this.view.displayViewMat3,E=this.view.displayMat3, C=(new h.Float(1)).subtract(D);return F.multiply(D).add(E.multiply(C))}_getViewScreenMatrix(D){const F=this.view.viewMat3.multiply(this.view.tileMat3),E=this.view.tileMat3,C=(new h.Float(1)).subtract(D);return F.multiply(D).add(E.multiply(C))}_getColor(D,F){return h.ifElse(h.equal(F.isSDF,new h.Float(1)),this._getSDFColor(D,F),this._getSpriteColor(D,F))}_getSpriteColor(D,F){return h.texture2D(this.mosaicInfo.texture,D).multiply(F.color)}_getSDFColor(D,F){D=h.texture2D(this.mosaicInfo.texture,D);var E= (new h.Float(.5)).subtract(f.rgba2float(D)).multiply(F.distanceToPx).multiply(d.softEdgeRatio);D=h.clamp((new h.Float(.5)).subtract(E),new h.Float(0),new h.Float(1));D=F.color.multiply(D);var C=F.outlineSize;this.highlight&&(C=h.max(C,F.overrideOutlineColor.multiply(4)));C=C.multiply(.5);E=h.abs(E).subtract(C);E=h.clamp((new h.Float(.5)).subtract(E),new h.Float(0),new h.Float(1));F=h.mix(F.outlineColor,F.color,F.overrideOutlineColor).multiply(E);return(new h.Float(1)).subtract(F.a).multiply(D).add(F)}_hittestSmallMarker(D, F,E){const {position:C,distance:G,smallSymbolDistance:H}=this.hittestRequest;D=G.subtract(H);const {viewMat3:K,tileMat3:J}=this.view;F=K.multiply(J).multiply(new h.Vec3(E.pos,1)).xy;E=E.size.multiply(.5);return h.distance(F,C).subtract(E).add(D)}_hittestMarker(D,F,E){const {pos:C,sizeCorrection:G,isMapAligned:H}=E;var K=new h.Vec3(D.offset.multiply(G),0),J=new h.Vec3(F.offsetNextVertex1.multiply(G),0),O=new h.Vec3(F.offsetNextVertex2.multiply(G),0);const {viewMat3:Q,tileMat3:T}=this.view;var I=Q.multiply(T).multiply(new h.Vec3(C, 1)),L=this._getViewScreenMatrix(H);K=I.add(L.multiply(K)).xy;J=I.add(L.multiply(J)).xy;O=I.add(L.multiply(O)).xy;I=this.hittestRequest.distance;L=b.distPointTriangle(this.hittestRequest.position,C,J,O);return h.ifElse(h.greaterThan(L,I),L,this._hittestSamples(K,J,O,D,F,E))}_hittestSamples(D,F,E,C,G,H){const {outlineSize:K,isSDF:J,distanceToPx:O}=H;var Q=this.hittestRequest.position;const T=this.hittestRequest.distance;H=b.xyToBarycentric(Q.add(new h.Vec2(h.negate(T),h.negate(T))),D,F,E);const I=b.xyToBarycentric(Q.add(new h.Vec2(0, h.negate(T))),D,F,E),L=b.xyToBarycentric(Q.add(new h.Vec2(T,h.negate(T))),D,F,E),R=b.xyToBarycentric(Q.add(new h.Vec2(h.negate(T),0)),D,F,E),V=b.xyToBarycentric(Q,D,F,E),S=b.xyToBarycentric(Q.add(new h.Vec2(T,0)),D,F,E),X=b.xyToBarycentric(Q.add(new h.Vec2(h.negate(T),T)),D,F,E),N=b.xyToBarycentric(Q.add(new h.Vec2(0,T)),D,F,E);D=b.xyToBarycentric(Q.add(new h.Vec2(T,T)),D,F,E);C=C.textureUV.divide(this.mosaicInfo.size);F=G.textureUVNextVertex1.divide(this.mosaicInfo.size);G=G.textureUVNextVertex2.divide(this.mosaicInfo.size); E={color:new h.Vec4(1),outlineColor:new h.Vec4(1),overrideOutlineColor:new h.Float(1),outlineSize:K,distanceToPx:O,isSDF:J};Q=new h.Float(0);Q=Q.add(b.inTriangle(H).multiply(this._getColor(y(H,C,F,G),E).a));Q=Q.add(b.inTriangle(I).multiply(this._getColor(y(I,C,F,G),E).a));Q=Q.add(b.inTriangle(L).multiply(this._getColor(y(L,C,F,G),E).a));Q=Q.add(b.inTriangle(R).multiply(this._getColor(y(R,C,F,G),E).a));Q=Q.add(b.inTriangle(V).multiply(this._getColor(y(V,C,F,G),E).a));Q=Q.add(b.inTriangle(S).multiply(this._getColor(y(S, C,F,G),E).a));Q=Q.add(b.inTriangle(X).multiply(this._getColor(y(X,C,F,G),E).a));Q=Q.add(b.inTriangle(N).multiply(this._getColor(y(N,C,F,G),E).a));Q=Q.add(b.inTriangle(D).multiply(this._getColor(y(D,C,F,G),E).a));return h.step(Q,new h.Float(.05)).multiply(b.failHittest(this.hittestRequest))}}g.__decorate([q.option(n.VisualVariableColor)],B.prototype,"visualVariableColor",void 0);g.__decorate([q.option(c.VisualVariableOpacity)],B.prototype,"visualVariableOpacity",void 0);g.__decorate([q.option(r.VisualVariableRotation)], B.prototype,"visualVariableRotation",void 0);g.__decorate([q.option(k.VisualVariableSizeMinMaxValue)],B.prototype,"visualVariableSizeMinMaxValue",void 0);g.__decorate([q.option(p.VisualVariableSizeScaleStops)],B.prototype,"visualVariableSizeScaleStops",void 0);g.__decorate([q.option(t.VisualVariableSizeStops)],B.prototype,"visualVariableSizeStops",void 0);g.__decorate([q.option(w.VisualVariableSizeUnitValue)],B.prototype,"visualVariableSizeUnitValue",void 0);g.__decorate([q.uniform(a.MosaicInfo)], B.prototype,"mosaicInfo",void 0);g.__decorate([g.__param(0,q.input(v)),g.__param(1,q.input(A))],B.prototype,"vertex",null);g.__decorate([g.__param(0,q.input(z))],B.prototype,"fragment",null);e.MarkerFragmentInput=z;e.MarkerShader=B;e.MarkerVertexInput=v;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/markers/markerConstants":function(){define(["exports"],function(e){e.MarkerConstants={bitset:{isSDF:0,isMapAligned:1,scaleSymbolsProportionally:2, overrideOutlineColor:3,colorLocked:4}};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique":function(){define("exports ../../../enums ../FeatureTechnique ../featureTechniqueUtils ../TechniqueType ./PieChartShader".split(" "),function(e,g,q,h,m,l){class d extends q.FeatureTechnique{constructor(){super(...arguments);this.type=m.TechniqueType.PieChart;this.shaders={geometry:new l.PieChartShader};this.symbologyPlane= g.FeatureSymbologyDrawOrder.MARKER}render(b,a){const {painter:f}=b,{instance:n,target:c}=a,r=this.shaders.geometry,k=n.getInput(),p=k.uniforms.numberOfFields,t=h.isHittest(b),w=h.getFeatureUniforms(b,c),u=h.getSelectionDefines(b);r.setNumberOfFields(p);f.setShader({shader:r,uniforms:{...h.resolveDynamicUniforms(b,a.target,k.uniforms.shader),...w.storage,...w.view,hittestUniforms:w.hittestRequest?{hittestDist:w.hittestRequest?.distance,hittestPos:w.hittestRequest?.position}:null},defines:{VV_SIZE_MIN_MAX_VALUE:!!k.uniforms.shader.visualVariableSizeMinMaxValue, VV_SIZE_SCALE_STOPS:!!k.uniforms.shader.visualVariableSizeScaleStops,VV_SIZE_FIELD_STOPS:!!k.uniforms.shader.visualVariableSizeStops,VV_SIZE_UNIT_VALUE:!!k.uniforms.shader.visualVariableSizeUnitValue,VV_OPACITY:!!k.uniforms.shader.visualVariableOpacity,HITTEST:t,highlight:w.highlight?1:0,...u,numberOfFields:p},optionalAttributes:{},useComputeBuffer:t});f.setPipelineState(h.getFeaturePipelineState(b));f.submitDraw(b,a)}}e.PieChartTechnique=d;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})}, "esri/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartShader":function(){define(["exports","../../GLSLShaderModule","../../graph/glsl","../../../shaders/sources/resolver"],function(e,g,q,h){const m={hittestDist:q.Float,hittestPos:q.Vec2},l={filterFlags:q.Sampler2D,animation:q.Sampler2D,visualVariableData:q.Sampler2D,dataDriven0:q.Sampler2D,dataDriven1:q.Sampler2D,dataDriven2:q.Sampler2D,gpgpu:q.Sampler2D,size:q.Float},d={displayViewScreenMat3:q.Mat3,displayViewMat3:q.Mat3,displayMat3:q.Mat3, viewMat3:q.Mat3,tileMat3:q.Mat3,displayZoomFactor:q.Float,requiredZoomFactor:q.Float,tileOffset:q.Vec2,currentScale:q.Float,currentZoom:q.Float,metersPerSRUnit:q.Float};class b extends g.GLSLShaderModule{constructor(){super(...arguments);this.vertexShader=h.resolveIncludes("materials/pie/pie.vert");this.fragmentShader=h.resolveIncludes("materials/pie/pie.frag");this.required={...l,...d,outlineWidth:q.Float,colors:q.FixedArray,defaultColor:q.Vec4,othersColor:q.Vec4,outlineColor:q.Vec4,donutRatio:q.Float, sectorThreshold:q.Float};this.options={hittestUniforms:m,visualVariableSizeMinMaxValue:{minMaxValueAndSize:q.Vec4},visualVariableSizeScaleStops:{sizes:{...q.FixedArray.ofType(q.Float,8),type:"array",elementType:q.Float,size:8},values:{...q.FixedArray.ofType(q.Float,8),type:"array",elementType:q.Float,size:8}},visualVariableSizeStops:{sizes:{...q.FixedArray.ofType(q.Float,8),type:"array",elementType:q.Float,size:8},values:{...q.FixedArray.ofType(q.Float,8),type:"array",elementType:q.Float,size:8}}, visualVariableSizeUnitValue:{unitValueToPixelsRatio:q.Float},visualVariableOpacity:{opacities:{...q.FixedArray.ofType(q.Float,8),type:"array",elementType:q.Float,size:8},opacityValues:{...q.FixedArray.ofType(q.Float,8),type:"array",elementType:q.Float,size:8}}};this.locations={pos:{index:0,type:q.Vec2},id:{index:1,type:q.Vec3},bitset:{index:2,type:q.Float},offset:{index:3,type:q.Vec2},texCoords:{index:4,type:q.Vec2},size:{index:5,type:q.Vec2},referenceSize:{index:6,type:q.Float},zoomRange:{index:7, type:q.Vec2}};this.defines={VV_SIZE_MIN_MAX_VALUE:"boolean",VV_SIZE_SCALE_STOPS:"boolean",VV_SIZE_FIELD_STOPS:"boolean",VV_SIZE_UNIT_VALUE:"boolean",VV_OPACITY:"boolean",HITTEST:"boolean",numberOfFields:"number",highlight:"boolean",inside:"boolean",outside:"boolean"}}setNumberOfFields(a){this.required.colors={...q.FixedArray.ofType(q.Vec4,a),type:"array",elementType:q.Vec4,size:a}}}e.PieChartShader=b;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/GLSLShaderModule":function(){define(["exports", "../../../../../core/string","./typed/TypedShaderProgram"],function(e,g,q){class h{constructor(){this.computeAttributes={}}get locationsMap(){const m=new Map;for(const l in this.locations)m.set(l,this.locations[l].index);return m}get optionPropertyKeys(){this._optionPropertyKeys||(this._optionPropertyKeys=new Set(Object.keys(this.options)));return this._optionPropertyKeys}get _transformFeedbackBindings(){return[]}get locationInfo(){if(!this._locationInfo){const m=this.locationsMap,l=Array.from(m.entries()).map(([d, b])=>`${d}.${b}`).join(".");this._locationInfo={hash:g.numericHash(l),locations:m,computeAttributeMap:this.computeAttributes}}return this._locationInfo}get renamedLocationsMap(){const m=new Map;for(const [l,d]of this.locationsMap.entries())m.set("a_"+l,d);return m}getShaderKey(m,l,d){const b=Object.keys(m).map(f=>`${f}.${m[f]}`).join("."),a=Object.keys(d).filter(f=>d[f]).map(f=>`${f}_${d[f].toString()}`).join(".");l=Object.keys(l).filter(f=>this.optionPropertyKeys.has(f)).join(".");return`${b}.${a}.${l}`}getProgram(m, l,d,b){b=m="";for(const a in d)if(d[a]){const f="boolean"===typeof d[a]?`#define ${a}\n`:`#define ${a} ${d[a]}\n`;m+=f;b+=f}m+=this.vertexShader;b+=this.fragmentShader;return new q.TypedShaderProgram(m,b,this.renamedLocationsMap,this.locationInfo,this._getUniformBindings(l),this._transformFeedbackBindings)}_getUniformBindings(m){const l=[];for(var d in this.required){var b=this.required[d];l.push({uniformHydrated:null,shaderModulePath:d,uniformName:d,uniformType:b.type,uniformArrayElementType:"array"=== b.type?b.elementType?.type:void 0,uniformArrayLength:"array"===b.type?b.size:void 0})}for(const a in m)if(d=this.options[a],m[a])for(const f in d)b=d[f],l.push({uniformHydrated:null,shaderModulePath:`${a}.${f}`,uniformName:f,uniformType:b.type,uniformArrayElementType:"array"===b.type?b.elementType?.type:void 0,uniformArrayLength:"array"===b.type?b.size:void 0});return l}}e.GLSLShaderModule=h;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique":function(){define("exports ../../../enums ../FeatureTechnique ../featureTechniqueUtils ../TechniqueType ./TextShader".split(" "), function(e,g,q,h,m,l){class d extends q.FeatureTechnique{constructor(){super(...arguments);this.type=m.TechniqueType.Text;this.shaders={geometry:new l.TextShader};this.symbologyPlane=g.FeatureSymbologyDrawOrder.TEXT}render(b,a){const {context:f,painter:n}=b,c=h.getSelectionDefines(b);var r=a.instance.getInput();r={shader:this.shaders.geometry,uniforms:{...h.resolveDynamicUniforms(b,a.target,r.uniforms),...h.getFeatureUniforms(b,a.target),mosaicInfo:n.textureManager.getMosaicInfo(f,a.textureKey)}, defines:{...c,isHaloPass:!1,isBackgroundPass:!0,isLabel:!1},optionalAttributes:r.optionalAttributes,useComputeBuffer:h.isHittest(b)};n.setShader(r);n.setPipelineState(h.getFeaturePipelineState(b));n.submitDraw(b,a);n.setShader({...r,defines:{...c,isHaloPass:!0,isBackgroundPass:!1,isLabel:!1}});n.submitDraw(b,a);n.setShader({...r,defines:{...c,isHaloPass:!1,isBackgroundPass:!1,isLabel:!1}});n.submitDraw(b,a)}}e.TextTechnique=d;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry":function(){define("exports ../TechniqueType ../dotDensity/DotDensityMeshWriter ../fill/ComplexFillMeshWriter ../fill/ComplexOutlineFillMeshWriter ../fill/FillMeshWriter ../fill/OutlineFillMeshWriter ../fill/PatternFillMeshWriter ../fill/PatternOutlineFillMeshWriter ../heatmap/HeatmapMeshWriter ../labels/LabelMeshWriter ../line/LineMeshWriter ../line/TexturedLineMeshWriter ../markers/MarkerMeshWriter ./MeshWriterInputEvaluator ../pieChart/PieChartMeshWriter ../text/TextMeshWriter".split(" "), function(e,g,q,h,m,l,d,b,a,f,n,c,r,k,p,t,w){class u{async createMeshWriter(y,x,v,A){const z=this._getMeshWriter(A.techniqueType);y=await p.MeshWriterInputEvaluator.create(y,x,A.inputParams);v=new z(A.id,y,A.optionalAttributes,v);await v.loadDependencies();return v}_getMeshWriter(y){switch(y){case g.TechniqueType.Fill:return l.FillMeshWriter;case g.TechniqueType.DotDensity:return q.DotDensityMeshWriter;case g.TechniqueType.ComplexFill:return h.ComplexFillMeshWriter;case g.TechniqueType.PatternFill:return b.PatternFillMeshWriter; case g.TechniqueType.OutlineFill:return d.OutlineFillMeshWriter;case g.TechniqueType.PatternOutlineFill:return a.PatternOutlineFillMeshWriter;case g.TechniqueType.ComplexOutlineFill:return m.ComplexOutlineFillMeshWriter;case g.TechniqueType.Marker:return k.MarkerMeshWriter;case g.TechniqueType.PieChart:return t.PieChartMeshWriter;case g.TechniqueType.Text:return w.TextMeshWriter;case g.TechniqueType.Line:return c.LineMeshWriter;case g.TechniqueType.TexturedLine:return r.TexturedLineMeshWriter;case g.TechniqueType.Heatmap:return f.HeatmapMeshWriter; case g.TechniqueType.Label:return n.LabelMeshWriter;case g.TechniqueType.Test:throw Error("Internal Error: Found invalid mesh writer");}}}e.MeshWriterRegistry=u;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter":function(){define(["exports","../fill/AFillMeshWriter","../../../../../../webgl/enums"],function(e,g,q){const h={createComputedParams:l=>l,optionalAttributes:{},attributes:{id:{type:q.DataType.UNSIGNED_BYTE, count:3,pack:"id"},bitset:{type:q.DataType.UNSIGNED_BYTE,count:1},pos:{type:q.DataType.SHORT,count:2,pack:"position",packPrecisionFactor:10},inverseArea:{type:q.DataType.FLOAT,count:1,packTessellation:({inverseArea:l})=>l}}};class m extends g.AFillMeshWriter{constructor(){super(...arguments);this.vertexSpec=h}createTesselationParams(l){return{inverseArea:1/l.readGeometryArea()}}}e.DotDensityMeshWriter=m;e.dotDensityVertexSpec=h;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter":function(){define(["exports", "../../../../../../../core/has","../../../../../../../geometry/libtess","../../../mesh/templates/templateUtils","../mesh/MeshWriter"],function(e,g,q,h,m){const l=g("featurelayer-fast-triangulation-enabled");class d extends m.MeshWriter{async loadDependencies(){await Promise.all([super.loadDependencies(),q.loadLibtess()])}_write(b,a,f){f=f?.asOptimized()??a.readGeometryForDisplay();if(f=this._clip(f))b.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(b,a,f),b.recordEnd()}_clip(b){return b? h.clipMarshall(b,this.hasEffects?256:8):null}_writeGeometry(b,a,f){const n=100e(["../chunks/libtess-asm"],b,a))).then(b=>b.libtessAsm):await (new Promise((b,a)=>e(["../chunks/libtess"], b,a))).then(b=>b.libtess)).default({locateFile:b=>q.getAssetUrl(`esri/core/libs/libtess/${b}`)})}let l=null,d=null;g.loadLibtess=async function(){l||=m();return l};g.triangulate=function(b,a){return d.triangulate(b,a,Math.max(b.length,128E3))};Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/mesh/templates/templateUtils":function(){define("exports ../../../../../../chunks/earcut ../../../../../../geometry/libtess ../../../../../../geometry/support/TileClipper ../../../../../../layers/graphics/OptimizedGeometry ../../definitions ../bufcut".split(" "), function(e,g,q,h,m,l,d){function b(c,r,k){let p=0;for(let t=1;tr||xr){t=!0;continue}u.push({x:y,y:x})}let v=!1;for(;c.nextPoint();)if(y=c.x,x=c.y,t)n.lineTo(y,x);else{if(yr||xr){v=!0;break}u.push({x:y,y:x})}if(v)t=!0;else{if(t){if(t=n.resultWithStarts())for(const A of t)p.push(A)}else p.push({line:u,start:0});w= c.nextPath();t=!1}}p=p.filter(u=>1y||y>k||-128>x||x>k){k=!0;break a}}p+=w}k=!1}if(!k)return c;f.setPixelMargin(r);f.reset(h.GeometryType.Polygon);r=0;for(k=0;k80*C){var N=O=F[0];var P=G=F[1];for(T=C;TO&&(O=E),Q>G&&(G=Q);O=Math.max(O-N,G-P);O=0!==O?1/O:0}b(K,J,C,N,P,O);return J}function l(F, E,C,G,H){if(H===0=E;H-=G)K=A(H,F[H],F[H+1],K);K&&t(K,K.next)&&(F=K.next,z(K),K=F);return K}function d(F,E){if(!F)return F;E||=F;do{var C=!1;if(F.steiner||!t(F,F.next)&&0!==p(F.prev,F,F.next))F=F.next;else{E=F.prev;z(F);F=E;if(F===F.next)break;C=!0}}while(C||F!==E);return E}function b(F,E,C,G,H,K,J){if(F){if(!J&&K){var O=F,Q=O;do null===Q.z&&(Q.z=r(Q.x,Q.y,G,H,K)),Q.prevZ=Q.prev,Q=Q.nextZ=Q.next;while(Q!==O);Q.prevZ.nextZ=null; Q.prevZ=null;O=Q;var T,I,L,R,V=1;do{Q=O;var S=O=null;for(I=0;Q;){I++;var X=Q;for(T=L=0;TV!==S.next.y>V&&S.next.y!==S.y&&L<(S.next.x-S.x)*(V-S.y)/(S.next.y-S.y)+S.x&&(I=!I),S=S.next;while(S!==Q);S=I}S=S&&(p(Q.prev,Q,X.prev)||p(Q,X.prev,X))||t(Q,X)&&0F.x?H.x>K.x?H.x:K.x:F.x>K.x?F.x:K.x,O=H.y>F.y?H.y>K.y?H.y:K.y:F.y>K.y?F.y:K.y,Q=r(H.x=Q&&G&&G.z<=E;){if(C!==F.prev&&C!==F.next&&k(H.x,H.y,F.x,F.y,K.x,K.y,C.x,C.y)&&0<=p(C.prev,C,C.next))return!1;C=C.prevZ;if(G!==F.prev&&G!==F.next&&k(H.x,H.y,F.x,F.y,K.x,K.y,G.x,G.y)&&0<=p(G.prev,G,G.next))return!1;G=G.nextZ}for(;C&&C.z>= Q;){if(C!==F.prev&&C!==F.next&&k(H.x,H.y,F.x,F.y,K.x,K.y,C.x,C.y)&&0<=p(C.prev,C,C.next))return!1;C=C.prevZ}for(;G&&G.z<=E;){if(G!==F.prev&&G!==F.next&&k(H.x,H.y,F.x,F.y,K.x,K.y,G.x,G.y)&&0<=p(G.prev,G,G.next))return!1;G=G.nextZ}return!0}function f(F,E){return F.x-E.x}function n(F){if(F.next.prev===F)return F;let E=F;do{const C=E.next;if(C.prev===E||C===E||C===F)break;E=C}while(1);return E}function c(F,E){var C=E,G=F.x,H=F.y,K=-Infinity;do{if(H<=C.y&&H>=C.next.y&&C.next.y!==C.y){var J=C.x+(H-C.y)* (C.next.x-C.x)/(C.next.y-C.y);if(J<=G&&J>K){K=J;if(J===G){if(H===C.y)return C;if(H===C.next.y)return C.next}var O=C.x=C.x&&C.x>=J&&G!==C.x&&k(HO.x)&&(L=C.x===O.x)){L=O;var R=C;L=0>p(L.prev,L,R.prev)&&0>p(R.next,L,L.next)}L&&(O=C,T=I)}C=C.next}while(C!==E);return O}function r(F, E,C,G,H){F=32767*(F-C)*H;E=32767*(E-G)*H;F=(F|F<<8)&16711935;F=(F|F<<4)&252645135;F=(F|F<<2)&858993459;E=(E|E<<8)&16711935;E=(E|E<<4)&252645135;E=(E|E<<2)&858993459;return(F|F<<1)&1431655765|((E|E<<1)&1431655765)<<1}function k(F,E,C,G,H,K,J,O){return 0<=(H-J)*(E-O)-(F-J)*(K-O)&&0<=(F-J)*(G-O)-(C-J)*(E-O)&&0<=(C-J)*(K-O)-(H-J)*(G-O)}function p(F,E,C){return(E.y-F.y)*(C.x-E.x)-(E.x-F.x)*(C.y-E.y)}function t(F,E){return F.x===E.x&&F.y===E.y}function w(F,E,C,G){var H=y(p(F,E,C)),K=y(p(F,E,G)),J=y(p(C, G,F)),O=y(p(C,G,E));return H!==K&&J!==O||0===H&&u(F,C,E)||0===K&&u(F,G,E)||0===J&&u(C,F,G)||0===O&&u(C,E,G)?!0:!1}function u(F,E,C){return E.x<=Math.max(F.x,C.x)&&E.x>=Math.min(F.x,C.x)&&E.y<=Math.max(F.y,C.y)&&E.y>=Math.min(F.y,C.y)}function y(F){return 0F?-1:0}function x(F,E){return 0>p(F.prev,F,F.next)?0<=p(F,E,F.next)&&0<=p(F,F.prev,E):0>p(F,E,F.prev)||0>p(F,F.next,E)}function v(F,E){var C=new B(F.i,F.x,F.y),G=new B(E.i,E.x,E.y),H=F.next,K=E.prev;F.next=E;E.prev=F;C.next=H;H.prev=C;G.next= C;C.prev=G;K.next=G;G.prev=K;return G}function A(F,E,C,G){F=new B(F,E,C);G?(F.next=G.next,F.prev=G,G.next.prev=F,G.next=F):(F.prev=F,F.next=F);return F}function z(F){F.next.prev=F.prev;F.prev.next=F.next;F.prevZ&&(F.prevZ.nextZ=F.nextZ);F.nextZ&&(F.nextZ.prevZ=F.prevZ)}function B(F,E,C){this.i=F;this.x=E;this.y=C;this.nextZ=this.prevZ=this.z=this.next=this.prev=null;this.steiner=!1}function D(F,E,C,G){for(var H=0,K=C-G;E=B;D-=F)C=l(D+A*F,v[D+A*F],v[D+1+A*F],C);C&&p(C,C.next)&&(d(C),C=C.next);return C}function q(v,A=v){if(!v)return v; let z;do if(z=!1,v.steiner||!p(v,v.next)&&0!==f(v.prev,v,v.next))v=v.next;else{d(v);v=A=v.prev;if(v===v.next)break;z=!0}while(z||v!==A);return A}function h(v,A,z,B,D,F,E,C){if(v){!C&&F&&(v=a(v,B,D,F));for(var G=v;v.prev!==v.next;){var H=v.prev,K=v.next;if(F)var J=m(v,B,D,F);else a:{J=v;var O=J.prev,Q=J;const T=J.next;if(0<=f(O,Q,T)){J=!1;break a}let I=J.next.next;const L=I;let R=0;for(;I!==J.prev&&(0===R||I!==L);){R++;if(c(O.x,O.y,Q.x,Q.y,T.x,T.y,I.x,I.y)&&0<=f(I.prev,I,I.next)){J=!1;break a}I=I.next}J= !0}if(J)A.push(H.index/z+E),A.push(v.index/z+E),A.push(K.index/z+E),d(v),G=v=K.next;else if(v=K,v===G){if(!C)h(q(v),A,z,B,D,F,E,1);else if(1===C){C=A;G=z;H=E;K=v;do J=K.prev,O=K.next.next,!p(J,O)&&n(J,K,K.next,O)&&r(J,O)&&r(O,J)&&(C.push(J.index/G+H),C.push(K.index/G+H),C.push(O.index/G+H),d(K),d(K.next),K=v=O),K=K.next;while(K!==v);v=K;h(v,A,z,B,D,F,E,2)}else if(2===C)a:{C=v;do{for(G=C.next.next;G!==C.prev;){if(H=C.index!==G.index){J=J=J=void 0;H=C;K=G;if(J=H.next.index!==K.index&&H.prev.index!== K.index){b:{J=H;do{if(J.index!==H.index&&J.next.index!==H.index&&J.index!==K.index&&J.next.index!==K.index&&n(J,J.next,H,K)){J=!0;break b}J=J.next}while(J!==H);J=!1}J=!J}if(J=J&&r(H,K)&&r(K,H)){J=H;O=!1;Q=(H.x+K.x)/2;K=(H.y+K.y)/2;do J.y>K!==J.next.y>K&&J.next.y!==J.y&&Q<(J.next.x-J.x)*(K-J.y)/(J.next.y-J.y)+J.x&&(O=!O),J=J.next;while(J!==H);J=O}H=J}if(H){v=w(C,G);C=q(C,C.next);v=q(v,v.next);h(C,A,z,B,D,F,E,0);h(v,A,z,B,D,F,E,0);break a}G=G.next}C=C.next}while(C!==v)}break}}}}function m(v,A,z,B){const D= v.prev,F=v.next;if(0<=f(D,v,F))return!1;const E=D.x>v.x?D.x>F.x?D.x:F.x:v.x>F.x?v.x:F.x,C=D.y>v.y?D.y>F.y?D.y:F.y:v.y>F.y?v.y:F.y,G=k(D.x=G&&B&&B.z<=A;){if(z!==v.prev&&z!==v.next&&c(D.x,D.y,v.x,v.y,F.x,F.y,z.x,z.y)&&0<=f(z.prev,z,z.next))return!1;z=z.prevZ;if(B!==v.prev&&B!==v.next&&c(D.x,D.y,v.x,v.y,F.x,F.y,B.x,B.y)&&0<=f(B.prev,B,B.next))return!1;B=B.nextZ}for(;z&&z.z>= G;){if(z!==v.prev&&z!==v.next&&c(D.x,D.y,v.x,v.y,F.x,F.y,z.x,z.y)&&0<=f(z.prev,z,z.next))return!1;z=z.prevZ}for(;B&&B.z<=A;){if(B!==v.prev&&B!==v.next&&c(D.x,D.y,v.x,v.y,F.x,F.y,B.x,B.y)&&0<=f(B.prev,B,B.next))return!1;B=B.nextZ}return!0}function l(v,A,z,B){v=u.create(v,A,z);B?(v.next=B.next,v.prev=B,B.next.prev=v,B.next=v):(v.prev=v,v.next=v);return v}function d(v){v.next.prev=v.prev;v.prev.next=v.next;v.prevZ&&(v.prevZ.nextZ=v.nextZ);v.nextZ&&(v.nextZ.prevZ=v.prevZ)}function b(v,A){let z=A;const B= v.x,D=v.y;let F=-Infinity,E;do{if(D<=z.y&&D>=z.next.y&&z.next.y!==z.y){var C=z.x+(D-z.y)*(z.next.x-z.x)/(z.next.y-z.y);if(C<=B&&C>F){F=C;if(C===B){if(D===z.y)return z;if(D===z.next.y)return z.next}E=z.x=z.x&&z.x>=C&&B!==z.x&&c(DE.x)&&r(z,v)&&(E=z,H=K)),z=z.next;return E}function a(v, A,z,B){for(var D;D!==v;D=D.next){D=D||v;null===D.z&&(D.z=k(D.x,D.y,A,z,B));if(D.prev.next!==D||D.next.prev!==D)return D.prev.next=D,D.next.prev=D,a(v,A,z,B);D.prevZ=D.prev;D.nextZ=D.next}v.prevZ.nextZ=null;v.prevZ=null;a:for(z=1;;){B=v;A=v=null;let F=0;for(;B;){F++;D=B;let E=0;for(;EF)break a}return v} function f(v,A,z){return(A.y-v.y)*(z.x-A.x)-(A.x-v.x)*(z.y-A.y)}function n(v,A,z,B){return p(v,A)&&p(z,B)||p(v,B)&&p(z,A)?!0:0f(v.prev,v,v.next)?0<=f(v,A,v.next)&&0<=f(v,v.prev,A):0>f(v,A,v.prev)||0>f(v,v.next,A)}function k(v,A,z,B,D){v=32767*(v-z)*D;A=32767*(A-B)*D;v=(v|v<<8)&16711935;v=(v|v<<4)&252645135;v= (v|v<<2)&858993459;A=(A|A<<8)&16711935;A=(A|A<<4)&252645135;A=(A|A<<2)&858993459;return(v|v<<1)&1431655765|((A|A<<1)&1431655765)<<1}function p(v,A){return v.x===A.x&&v.y===A.y}function t(v,A){return v.x-A.x}function w(v,A){const z=u.create(v.index,v.x,v.y),B=u.create(A.index,A.x,A.y),D=v.next,F=A.prev;v.next=A;A.prev=v;z.next=D;D.prev=z;B.next=z;z.prev=B;F.next=B;B.prev=F;return B}class u{constructor(){this.y=this.x=this.index=0;this.nextZ=this.prevZ=this.z=this.next=this.prev=null;this.steiner=!1}static create(v, A,z){const B=xv;v++)y.push(new u);e.bufcut=function(v,A,z,B,D,F,E){x=0;var C=(B-z)*F,G=D&&D.length;const H=G?(D[0]-z)*F:C;var K=g(A,z,B,0,H,F,!0);if(K&&K.next!==K.prev){var J;if(G){const L=[];for(let R=0,V=D.length;R80*F){var T=C=A[z*F];var I=J=A[1+z*F];for(Q=F;Qthis.vertexSpec.createComputedParams(n)}get _vertexPack(){if(!this._cachedVertexPack){const d=m.MeshWriterVertexPack.fromVertexSpec(this.vertexSpec,this._enabledOptionalAttributes); this._evaluator.hasDynamicProperties||d.pack(this._evaluator.evaluatedMeshParams,this._viewParams);this._cachedVertexPack=d}return this._cachedVertexPack}get evaluatedMeshParams(){return this._evaluator.evaluatedMeshParams}get hasEffects(){return!!this.evaluatedMeshParams.effects}get instanceId(){return this._instanceId}get attributeLayout(){return this._vertexPack.attributeLayout}setReferences(d){this._references=d}getBoundsInfo(){return null}getTileInfo(){return this._viewParams.tileInfo}async loadDependencies(){var d; a:{if(d=this._evaluator.inputMeshParams.effects?.effectInfos)for(const b of d)switch(b.effect.type){case "CIMGeometricEffectBuffer":case "CIMGeometricEffectOffset":case "CIMGeometricEffectDonut":d=!0;break a}d=!1}d&&await h.loadGeometryEngine()}enqueueRequest(d,b,a){this._evaluator.hasDynamicProperties&&this._evaluator.enqueueRequest(d,b,a)}write(d,b,a,f,n){this.ensurePacked(b,a,f);if((b=this.evaluatedMeshParams.effects)&&0!==b.length){if(f=a.readGeometryForDisplay()?.clone()){f=g.GeometryCursor.fromOptimizedCIM(f, a.geometryType);var c=h.getGeometryEngine();f.invertY();for(b=q.CIMEffectHelper.executeEffects(b,f,d.id||"",c);f=b.next();)f.invertY(),this._write(d,a,f,n)}}else this._write(d,a,void 0,n)}ensurePacked(d,b,a){this._evaluator.hasDynamicProperties&&(d=this._evaluator.evaluateMeshParams(d,b,a),this._vertexPack.pack(d,this._viewParams))}_writeVertex(d,b,a,f,n){this._vertexPack.writeVertex(d,b,a,f,this.evaluatedMeshParams,n)}}e.MeshWriter=l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})}, "esri/views/2d/engine/webgl/shaderGraph/techniques/mesh/loadGeometryEngine":function(){define(["require","exports"],function(e,g){let q=null;g.getGeometryEngine=function(){return q};g.loadGeometryEngine=async function(){q=await new Promise((h,m)=>e(["../../../../../../../geometry/geometryEngineJSON"],h,m))};Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterVertexPack":function(){define(["exports","../../../number","./AlignedVertexSpec", "./dataViewUtils"],function(e,g,q,h){class m{static fromVertexSpec(l,d){l=q.AlignedVertexSpec.fromVertexSpec(l,d);return new m(l)}constructor(l){this._spec=l;this._packed=new Uint8Array(this._spec.stride*this._spec.packVertexCount);this._packedU32View=new Uint32Array(this._packed.buffer);this._dataView=new DataView(this._packed.buffer)}get attributeLayout(){return this._spec.attributeLayout}get stride(){return this._spec.stride}writeVertex(l,d,b,a,f,n){for(let k=0;k({name:a.name,count:a.count,offset:a.offset,type:a.type,packPrecisionFactor:a.packPrecisionFactor,normalized:a.normalized??!1})),hash:b,stride:this.stride}}return this._attributeLayout}}e.AlignedVertexSpec=d;e.sortByAlignment=l;Object.defineProperty(e, Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter":function(){define("exports ../../../../../../../core/screenUtils ../../../../vectorTiles/GeometryUtils ./meshWriterUtils ./PatternFillMeshWriter ../shaders/constants ../../../../../../webgl/enums".split(" "),function(e,g,q,h,m,l,d){function b(c){const {sprite:r,aspectRatio:k,scaleProportionally:p}=c;var t=g.pt2px(c.height);c=0=t?t=r.width:p&&(t*=r.width/r.height); return{width:t,height:c}}function a(c){const {applyRandomOffset:r,sampleAlphaOnly:k}=c;return h.packBitset([[l.bitsetFillRandomPatternOffset,r],[l.bitsetGenericConsiderAlphaOnly,k]])}const f={createComputedParams:c=>c,optionalAttributes:m.patternFillVertexSpec.optionalAttributes,attributes:{...m.patternFillVertexSpec.attributes,bitset:{count:1,type:d.DataType.UNSIGNED_BYTE,pack:a},width:{count:1,type:d.DataType.HALF_FLOAT,pack:c=>b(c).width},height:{count:1,type:d.DataType.HALF_FLOAT,pack:c=>b(c).height}, offset:{count:2,type:d.DataType.HALF_FLOAT,pack:({offsetX:c,offsetY:r})=>[g.pt2px(c),-g.pt2px(r)]},scale:{count:2,type:d.DataType.UNSIGNED_BYTE,packPrecisionFactor:16,pack:({scaleX:c,scaleY:r})=>[c,r]},angle:{count:1,type:d.DataType.UNSIGNED_BYTE,pack:({angle:c})=>q.degToByte(c)}}};class n extends m.PatternFillMeshWriter{constructor(){super(...arguments);this.vertexSpec=f}}e.ComplexFillMeshWriter=n;e.complexFillVertexSpec=f;e.getPatternSize=b;e.packComplexFillBitset=a;Object.defineProperty(e,Symbol.toStringTag, {value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/fill/meshWriterUtils":function(){define(["exports","../../../../../../../Color","../../../../../../../core/Error","../../../../../../../core/Logger","../../../../../../../symbols/cim/enums"],function(e,g,q,h,m){e.getBitMask=function(l){return 1<d,optionalAttributes:q.fillVertexSpec.optionalAttributes,attributes:{...q.fillVertexSpec.attributes,tlbr:{count:4,type:h.DataType.UNSIGNED_SHORT,pack:({sprite:d})=>{const {rect:b,width:a,height:f}=d;d=b.x+g.spritePadding;const n= b.y+g.spritePadding;return[d,n,d+a,n+f]}},inverseRasterizationScale:{count:1,type:h.DataType.BYTE,packPrecisionFactor:16,pack:({sprite:d})=>1/d.rasterizationScale}}};class l extends q.FillMeshWriter{constructor(){super(...arguments);this.vertexSpec=m}_write(d,b,a){a=a?.asOptimized()??b.readGeometryForDisplay();if(a=this._clip(a))d.recordStart(this.instanceId,this.attributeLayout,this.evaluatedMeshParams.sprite?.textureBinding),this._writeGeometry(d,b,a),d.recordEnd()}}e.PatternFillMeshWriter=l;e.patternFillVertexSpec= m;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter":function(){define(["exports","../../../definitions","./AFillMeshWriter","./meshWriterUtils","../../../../../../webgl/enums"],function(e,g,q,h,m){const l={createComputedParams:b=>b,optionalAttributes:{zoomRange:{type:m.DataType.SHORT,count:2,packPrecisionFactor:g.minMaxZoomPrecisionFactor,pack:({scaleInfo:b},{tileInfo:a})=>h.getMinMaxZoom(b,a)}},attributes:{id:{type:m.DataType.UNSIGNED_BYTE, count:3,pack:"id"},bitset:{type:m.DataType.UNSIGNED_BYTE,count:1},pos:{type:m.DataType.SHORT,count:2,pack:"position",packPrecisionFactor:10},color:{type:m.DataType.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:b})=>h.processColorInput(b)}}};class d extends q.AFillMeshWriter{constructor(){super(...arguments);this.vertexSpec=l}createTesselationParams(b){return null}}e.FillMeshWriter=d;e.fillVertexSpec=l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter":function(){define("exports ../../../../../../../core/screenUtils ../../../../../../../geometry/GeometryCursor ./ComplexFillMeshWriter ./meshWriterUtils ./OutlineFillMeshWriter ../shaders/ComplexOutlineFillShader ../shaders/constants ../../../../../../webgl/enums".split(" "), function(e,g,q,h,m,l,d,b,a){const f=h.complexFillVertexSpec,n={createComputedParams:p=>p,optionalAttributes:f.optionalAttributes,attributes:{...f.attributes,bitset:{type:a.DataType.UNSIGNED_BYTE,count:1,pack:p=>h.packComplexFillBitset(p)},aux1:{count:1,type:a.DataType.HALF_FLOAT,pack:p=>h.getPatternSize(p).width},aux2:{count:1,type:a.DataType.HALF_FLOAT,pack:p=>h.getPatternSize(p).height},aux3:{count:2,type:a.DataType.HALF_FLOAT,pack:({offsetX:p,offsetY:t})=>[g.pt2px(p),g.pt2px(t)]},aux4:{count:2, type:a.DataType.UNSIGNED_BYTE,pack:({scaleX:p,scaleY:t})=>[p*d.packPrecision,t*d.packPrecision]}}},c={createComputedParams:p=>p,optionalAttributes:f.optionalAttributes,attributes:{...f.attributes,color:l.outlineFillVertexSpec_Outline.attributes.color,bitset:{type:a.DataType.UNSIGNED_BYTE,count:1,pack:p=>m.packBitset([[b.bitsetTypeFillOutline,!0]])},aux1:{count:1,type:a.DataType.HALF_FLOAT,pack:p=>g.pt2px(.5*p.width)},aux2:{count:1,type:a.DataType.HALF_FLOAT,pack:p=>g.pt2px(.5*p.referenceWidth)},aux3:{count:2, type:a.DataType.HALF_FLOAT,packTessellation:({extrusionOffsetX:p,extrusionOffsetY:t})=>[p,t]},aux4:{count:2,type:a.DataType.UNSIGNED_BYTE,packTessellation:({normalX:p,normalY:t})=>[p*d.packPrecision+d.signedToUnsignedByte,t*d.packPrecision+d.signedToUnsignedByte]}}};class r extends l.OutlineFillOutlineMeshWriter{constructor(){super(...arguments);this.vertexSpec=c}}class k extends l.OutlineFillMeshWriter{constructor(){super(...arguments);this.vertexSpec=n}_createOutlineWriter(p,t,w,u){return new r(p, t,w,u)}_write(p,t,w){w=w?.asOptimized()??t.readGeometryForDisplay();if(w=this._clip(w))p.recordStart(this.instanceId,this.attributeLayout,this.evaluatedMeshParams.sprite?.textureBinding),this._writeGeometry(p,t,w),this._lineMeshWriter.writeLineVertices(p,q.GeometryCursor.fromOptimizedCIM(w,"esriGeometryPolyline"),t),p.recordEnd()}ensurePacked(p,t,w){super.ensurePacked(p,t,w);this._lineMeshWriter.ensurePacked(p,t,w)}enqueueRequest(p,t,w){super.enqueueRequest(p,t,w);this._lineMeshWriter.enqueueRequest(p, t,w)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}}e.ComplexOutlineFillMeshWriter=k;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter":function(){define("exports ../../../../../../../geometry/GeometryCursor ../../../mesh/templates/templateUtils ./FillMeshWriter ./meshWriterUtils ../line/LineMeshWriter ../mesh/utils ../shaders/constants ../../../../../../webgl/enums".split(" "), function(e,g,q,h,m,l,d,b,a){const f={createComputedParams:k=>k,optionalAttributes:l.LineVertexSpec.optionalAttributes,attributes:{...l.LineVertexSpec.attributes,bitset:{type:a.DataType.UNSIGNED_BYTE,count:1,pack:k=>0},color:{type:a.DataType.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:k})=>m.processColorInput(k)}}},n={createComputedParams:k=>k,optionalAttributes:l.LineVertexSpec.optionalAttributes,attributes:{...l.LineVertexSpec.attributes,bitset:{type:a.DataType.UNSIGNED_BYTE,count:1,pack:k=> m.packBitset([[b.bitsetTypeFillOutline,!0]])},color:{type:a.DataType.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:k})=>m.processColorInput(k)}}};class c extends l.LineMeshWriter{constructor(){super(...arguments);this.vertexSpec=n}}class r extends h.FillMeshWriter{constructor(k,p,t,w){super(k,p,t,w);this.vertexSpec=f;this._lineMeshWriter=this._createOutlineWriter(k,p,t,w)}_createOutlineWriter(k,p,t,w){return new c(k,p,t,w)}_write(k,p,t){t=t?.asOptimized()??p.readGeometryForDisplay();if(t= this._clip(t))k.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(k,p,t),this._lineMeshWriter.writeLineVertices(k,g.GeometryCursor.fromOptimizedCIM(t,"esriGeometryPolyline"),p),k.recordEnd()}_clip(k){return k?q.clipMarshall(k,d.getLineClippingMargin(this.evaluatedMeshParams)):null}ensurePacked(k,p,t){super.ensurePacked(k,p,t);this._lineMeshWriter.ensurePacked(k,p,t)}enqueueRequest(k,p,t){super.enqueueRequest(k,p,t);this._lineMeshWriter.enqueueRequest(k,p,t)}async loadDependencies(){await Promise.all([super.loadDependencies(), this._lineMeshWriter.loadDependencies()])}}e.OutlineFillMeshWriter=r;e.OutlineFillOutlineMeshWriter=c;e.outlineFillVertexSpec_Fill=f;e.outlineFillVertexSpec_Outline=n;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter":function(){define("exports ../../../../../../../core/screenUtils ../../../../../../../geometry/GeometryCursor ../../../definitions ../../../TurboLine ../../../mesh/templates/templateUtils ../fill/meshWriterUtils ../mesh/MeshWriter ../mesh/utils ../../../../../../webgl/enums".split(" "), function(e,g,q,h,m,l,d,b,a,f){class n{constructor(){this.distance=this.directionY=this.directionX=this.normalY=this.normalX=this.extrusionOffsetY=this.extrusionOffsetX=0}}const c={createComputedParams:p=>p,optionalAttributes:{zoomRange:{type:f.DataType.SHORT,count:2,packPrecisionFactor:h.minMaxZoomPrecisionFactor,pack:({scaleInfo:p},{tileInfo:t})=>d.getMinMaxZoom(p,t)}},attributes:{id:{type:f.DataType.UNSIGNED_BYTE,count:3,pack:"id"},pos:{type:f.DataType.SHORT,count:2,pack:"position",packPrecisionFactor:10}, bitset:{type:f.DataType.UNSIGNED_BYTE,count:1},color:{type:f.DataType.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:p})=>d.processColorInput(p)},offset:{type:f.DataType.BYTE,count:2,packPrecisionFactor:16,packTessellation:({extrusionOffsetX:p,extrusionOffsetY:t})=>[d.packRounded(p,16),d.packRounded(t,16)]},normal:{type:f.DataType.BYTE,count:2,packPrecisionFactor:16,packTessellation:({normalX:p,normalY:t})=>[d.packRounded(p,16),d.packRounded(t,16)]},halfWidth:{type:f.DataType.HALF_FLOAT,count:1, pack:({width:p})=>g.pt2px(.5*p)},referenceHalfWidth:{type:f.DataType.HALF_FLOAT,count:1,pack:({referenceWidth:p})=>g.pt2px(.5*p)}}};class r{constructor(){this.vertexBounds=this.vertexFrom=this.vertexCount=this.indexCount=this.bitset=this.id=0}}class k extends b.MeshWriter{constructor(p,t,w,u){super(p,t,w,u);this.vertexSpec=c;this._currentWrite=new r;this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:65535,textured:!1};this._tessParams=new n;this._initializeTessellator()}writeLineVertices(p, t,w){t=this._getLines(t);null!=t&&this._writeVertices(p,w,t)}_initializeTessellator(){this._lineTessellator=new m.LineTessellation(this._writeTesselatedVertex.bind(this),this._writeTriangle.bind(this),!0)}_write(p,t,w){(w=w??q.GeometryCursor.fromFeatureSetReaderCIM(t))&&this._writeGeometry(p,t,w)}_writeGeometry(p,t,w,u){p.recordStart(this.instanceId,this.attributeLayout,u);this.writeLineVertices(p,w,t);p.recordEnd()}_getLines(p){return l.clipLinesMarshall(p,a.getLineClippingMargin(this.evaluatedMeshParams))}_writeVertices(p, t,w){const {_currentWrite:u,_tessellationOptions:y,evaluatedMeshParams:x}=this,{width:v,capType:A,joinType:z,miterLimit:B,hasSizeVV:D}=x,F=g.pt2px(.5*v);y.halfWidth=F;y.capType=d.processLineCapInput(A);y.joinType=d.processLineJoinInput(z);y.miterLimit=B;const E=!D;u.out=p;u.id=t.getDisplayId();u.vertexCount=0;u.indexCount=0;u.vertexFrom=p.vertexCount();u.vertexBounds=E&&F=p)){var t=0;for(let w= 1;wc.length)){var k=r.wrapDistance||65535;r=r.initialDistance||0;var p=!1,t=c[0].x,w=c[0].y,u=c.length;for(let A=1;Ak){p=!0;var v=(k-r)/x;x=k-r;z=(1-v)*t+v*z;B=(1-v)*w+v*B;--A}v=this._writeVertex(t,w,0,0,y,D, D,-y,0,-1,r);t=this._writeVertex(t,w,0,0,y,D,-D,y,0,1,r);r+=x;x=this._writeVertex(z,B,0,0,y,D,D,-y,0,-1,r);y=this._writeVertex(z,B,0,0,y,D,-D,y,0,1,r);this._writeTriangle(v,t,x);this._writeTriangle(t,x,y);t=z;w=B}}}_tessellate(c,r){var k=c[c.length-1];const p=h(c[0],k);if(!(c.length<(p?3:2))){var t=r.pixelCoordRatio,w=null!=r.capType?r.capType:g.CapType.BUTT,u=null!=r.joinType?r.joinType:g.JoinType.MITER,y=null!=r.miterLimit?Math.min(r.miterLimit,4):2,x=null!=r.roundLimit?Math.min(r.roundLimit,1.05): 1.05,v=null!=r.halfWidth?r.halfWidth:2,A=!!r.textured,z=null,B=this._prevNormal,D=this._nextNormal,F=-1,E=-1,C=this._joinNormal,G=this._textureNormalLeft,H=this._textureNormalRight,K=this._textureNormal,J=-1,O=-1,Q=r.wrapDistance||65535,T=r.initialDistance||0,I=this._writeVertex,L=this._writeTriangle;r=(ka,na,qa,oa,ua,sa)=>{ka=I(V,S,P,U,qa,oa,ka,na,ua,sa,T);0<=J&&0<=O&&0<=ka&&L(J,O,ka);J=O;return O=ka};if(p){var R=c[c.length-2];D.x=k.x-R.x;D.y=k.y-R.y;E=a(D);D.x/=E;D.y/=E}k=!1;for(let ka=0;kaQ&&(k=!0));k?(z=(Q-T)/F,F=Q-T,R={x:(1-z)*R.x+z*c[ka].x,y:(1-z)*R.y+z*c[ka].y},--ka):R=c[ka];var V=R.x;var S=R.y;var X=0>=ka&&!k,N=ka===c.length-1;X||(T+=F);(z=N?p?c[1]:null:c[ka+1])?(D.x=z.x-V,D.y=z.y-S,E=a(D),D.x/=E,D.y/=E):(D.x=void 0,D.y=void 0);if(!p){if(X){l(C,D);var P=C.x;var U=C.y;w===g.CapType.SQUARE&&(r(-D.y-D.x,D.x-D.y,D.x,D.y,0,-1),r(D.y-D.x,-D.x-D.y,D.x,D.y,0,1));w===g.CapType.ROUND&&(r(-D.y-D.x,D.x-D.y,D.x,D.y,-1,-1),r(D.y-D.x,-D.x-D.y,D.x,D.y, -1,1));if(w===g.CapType.ROUND||w===g.CapType.BUTT)r(-D.y,D.x,D.x,D.y,0,-1),r(D.y,-D.x,D.x,D.y,0,1);continue}if(N){m(C,B);P=C.x;U=C.y;if(w===g.CapType.ROUND||w===g.CapType.BUTT)r(B.y,-B.x,-B.x,-B.y,0,-1),r(-B.y,B.x,-B.x,-B.y,0,1);w===g.CapType.SQUARE&&(r(B.y-B.x,-B.x-B.y,-B.x,-B.y,0,-1),r(-B.y-B.x,B.x-B.y,-B.x,-B.y,0,1));w===g.CapType.ROUND&&(r(B.y-B.x,-B.x-B.y,-B.x,-B.y,1,-1),r(-B.y-B.x,B.x-B.y,-B.x,-B.y,1,1));continue}}var Y=void 0;X=-(B.x*D.y-B.y*D.x);.01>Math.abs(X)?0F&&z>E);P=C.x;U=C.y;var ba=u;switch(u){case g.JoinType.BEVEL:1.05>Y&&(ba=g.JoinType.MITER);break;case g.JoinType.ROUND:Yy&&(ba=g.JoinType.BEVEL)}switch(ba){case g.JoinType.MITER:r(C.x,C.y,-B.x,-B.y,0,-1);r(-C.x,-C.y,-B.x,-B.y,0,1);if(N)break;A&&(z=k?0:T,J=this._writeVertex(V,S,P,U,D.x,D.y,C.x,C.y,0,-1,z),O=this._writeVertex(V, S,P,U,D.x,D.y,-C.x,-C.y,0,1,z));break;case g.JoinType.BEVEL:X=0>X;var Z=void 0;X?(ba=J,J=O,O=ba,Z=G,ba=H):(Z=H,ba=G);var aa=void 0,ca=void 0;z?(aa=X?l(this._innerPrev,B):m(this._innerPrev,B),ca=X?m(this._innerNext,D):l(this._innerNext,D)):aa=ca=X?b(this._inner,C):d(this._inner,C);Y=X?m(this._bevelStart,B):l(this._bevelStart,B);r(aa.x,aa.y,-B.x,-B.y,Z.x,Z.y);aa=r(Y.x,Y.y,-B.x,-B.y,ba.x,ba.y);if(N)break;N=X?l(this._bevelEnd,D):m(this._bevelEnd,D);z?(z=this._writeVertex(V,S,P,U,-B.x,-B.y,0,0,0,0,T), J=this._writeVertex(V,S,P,U,D.x,D.y,ca.x,ca.y,Z.x,Z.y,T),O=this._writeVertex(V,S,P,U,D.x,D.y,N.x,N.y,ba.x,ba.y,T),this._writeTriangle(aa,z,O)):(A?(z=this._bevelMiddle,z.x=(Y.x+N.x)/2,z.y=(Y.y+N.y)/2,f(K,z,-B.x,-B.y),r(z.x,z.y,-B.x,-B.y,K.x,K.y),f(K,z,D.x,D.y),J=this._writeVertex(V,S,P,U,D.x,D.y,z.x,z.y,K.x,K.y,T),O=this._writeVertex(V,S,P,U,D.x,D.y,ca.x,ca.y,Z.x,Z.y,T)):(z=J,J=O,O=z),r(N.x,N.y,D.x,D.y,ba.x,ba.y));X&&(z=J,J=O,O=z);break;case g.JoinType.ROUND:X=0>X;var ea=void 0;X?(ba=J,J=O,O=ba,ba= G,ea=H):(ba=H,ea=G);var ia=X?b(this._inner,C):d(this._inner,C);z?(ca=X?l(this._innerPrev,B):m(this._innerPrev,B),Z=X?m(this._innerNext,D):l(this._innerNext,D)):Z=ca=ia;aa=X?m(this._roundStart,B):l(this._roundStart,B);var ha=X?l(this._roundEnd,D):m(this._roundEnd,D);ca=r(ca.x,ca.y,-B.x,-B.y,ba.x,ba.y);aa=r(aa.x,aa.y,-B.x,-B.y,ea.x,ea.y);if(N)break;N=this._writeVertex(V,S,P,U,-B.x,-B.y,0,0,0,0,T);z||this._writeTriangle(J,O,N);ia=b(this._outer,ia);ea=this._writeVertex(V,S,P,U,D.x,D.y,ha.x,ha.y,ea.x, ea.y,T);let na,qa;if(ha=2a,attributes:{...h.patternFillVertexSpec.attributes,...q.outlineFillVertexSpec_Fill.attributes}},l={optionalAttributes:h.patternFillVertexSpec.optionalAttributes,createComputedParams:a=>a,attributes:{...h.patternFillVertexSpec.attributes,...q.outlineFillVertexSpec_Outline.attributes}};class d extends q.OutlineFillOutlineMeshWriter{constructor(){super(...arguments);this.vertexSpec=l}}class b extends q.OutlineFillMeshWriter{constructor(){super(...arguments); this.vertexSpec=m}_createOutlineWriter(a,f,n,c){return new d(a,f,n,c)}_write(a,f,n){n=n?.asOptimized()??f.readGeometryForDisplay();if(n=this._clip(n))a.recordStart(this.instanceId,this.attributeLayout,this.evaluatedMeshParams.sprite?.textureBinding),this._writeGeometry(a,f,n),this._lineMeshWriter.writeLineVertices(a,g.GeometryCursor.fromOptimizedCIM(n,"esriGeometryPolyline"),f),a.recordEnd()}ensurePacked(a,f,n){super.ensurePacked(a,f,n);this._lineMeshWriter.ensurePacked(a,f,n)}enqueueRequest(a,f, n){super.enqueueRequest(a,f,n);this._lineMeshWriter.enqueueRequest(a,f,n)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}}e.PatternOutlineFillMeshWriter=b;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter":function(){define(["exports","../mesh/MeshWriter","../../../../../../webgl/enums"],function(e,g,q){const h={createComputedParams:l=>l,optionalAttributes:{}, attributes:{pos:{type:q.DataType.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:q.DataType.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:q.DataType.UNSIGNED_BYTE,count:1},offset:{type:q.DataType.BYTE,count:2,packAlternating:{count:4,pack:()=>[[-1,-1],[1,-1],[-1,1],[1,1]]}}}};class m extends g.MeshWriter{constructor(){super(...arguments);this.vertexSpec=h}_write(l,d){l.recordStart(this.instanceId,this.attributeLayout);const b=d.getDisplayId();if("esriGeometryPoint"===d.geometryType){const a= d.readXForDisplay();d=d.readYForDisplay();this._writeQuad(l,b,a,d)}else"esriGeometryMultipoint"===d.geometryType&&d.readGeometryForDisplay()?.forEachVertex((a,f)=>{0<=a&&512>=a&&0<=f&&512>=f&&this._writeQuad(l,b,a,f)});l.recordEnd()}_writeQuad(l,d,b,a){const f=l.vertexCount();this._writeVertex(l,d,b,a);l.indexWrite(f+0);l.indexWrite(f+1);l.indexWrite(f+2);l.indexWrite(f+1);l.indexWrite(f+3);l.indexWrite(f+2)}}e.HeatmapMeshWriter=m;e.heatmapVertexSpec=h;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})}, "esri/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter":function(){define("exports ../../../../../../../core/MapUtils ../../../../../../../core/screenUtils ../../../../../../../core/libs/gl-matrix-2/math/mat2d ../../../../../../../core/libs/gl-matrix-2/factories/mat2df32 ../../../../../../../core/libs/gl-matrix-2/math/vec2 ../../../../../../../core/libs/gl-matrix-2/factories/vec2f32 ../../../../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../../../../layers/graphics/featureConversionUtils ../../../../../../../layers/graphics/OptimizedGeometry ../../../alignmentUtils ../../../DisplayId ../../../collisions/BoundingBox ../../../collisions/LabelMetric ../../../mesh/templates/segmentUtils ../fill/meshWriterUtils ../text/TextMeshWriter".split(" "), function(e,g,q,h,m,l,d,b,a,f,n,c,r,k,p,t,w){function u(v,A,z){const {coords:B,lengths:D}=A;A=b.create();const F=b.create(),E=b.create(),C=b.create(),G=b.create(),H=b.create();let K=0;for(let O=0;O{let A=0;if(0===v)return Infinity;for(;!(v%2);)A++,v/=2;return A});class x extends w.TextMeshWriter{constructor(){super(...arguments);this._zoomLevel=0}_write(v,A,z,B){this._zoomLevel=B||0;if(null!=z)throw Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(A.geometryType){case "esriGeometryPoint":return z= A.readXForDisplay(),B=A.readYForDisplay(),this._writePoint(v,z,B,A);case "esriGeometryEnvelope":case "esriGeometryPolygon":case "esriGeometryMultipoint":z=A.readCentroidForDisplay();if(!z)break;const [D,F]=z.coords;return this._writePoint(v,D,F,A);case "esriGeometryPolyline":this._writeLines(v,A)}}_writePoint(v,A,z,B){const D=this._getShaping();if(D){var F=this._getPointReferenceBounds();F||={offsetX:0,offsetY:0,size:0};var E=D.boundsT,C=n.getXAnchorDirection(this.evaluatedMeshParams.horizontalAlignment), G=n.getYAnchorDirection(this.evaluatedMeshParams.verticalAlignment),H=this.evaluatedMeshParams.scaleInfo?.maxScale??0,K=this.evaluatedMeshParams.scaleInfo?.minScale??0,J=c.getDisplayIdTexel(B.getDisplayId());v.metricStart(new k.LabelMetric(J,A,z,C,G,H,K,F));v.metricBoxWrite(E);this._writeGlyphs(v,B.getDisplayId(),A,z,D,0,F);v.metricEnd()}}_getPointReferenceBounds(){if(!this._references)return null;for(const v of this._references){const A=v.getBoundsInfo();if(A)return A}return null}_writeLines(v,A){const {scaleInfo:z, verticalAlignment:B}=this.evaluatedMeshParams;var D=this.evaluatedMeshParams.repeatLabelDistance||128;const F=this._getShaping("middle");if(F){var E=(C,G,H,K)=>this._placeSubdivGlyphs(C,G,H,K);D=(F.bounds.width+D)/2;this._current={out:v,id:A.getDisplayId(),shaping:F,zoomRange:t.getMinMaxZoom(z,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0},offsetDirection:null};(this._verticalPlacement="bottom"===B?"above":"top"===B?"below":null)?this._writeAboveAndBelowAlong(A, E,D):this._writeCenterAlong(A,E,D)}}_writeAboveAndBelowAlong(v,A,z){const {repeatLabel:B,fontSize:D}=this.evaluatedMeshParams;var {shaping:F}=this._current,E=q.pt2px(D);if(v=v.readGeometryForDisplay()){var C=new f;a.generalizeOptimizedGeometry(C,v,!1,!1,"esriGeometryPolyline",1);v=u(new f,C,E);E=u(new f,C,-E);E=a.convertToGeometry(E,"esriGeometryPolyline",!1,!1);v=a.convertToGeometry(v,"esriGeometryPolyline",!1,!1);v=p.smoothPaths(v.paths,F.bounds.width);F=p.smoothPaths(E.paths,F.bounds.width);this._current.offsetDirection= "above";for(const G of v)p.pathDivide(G,z,A,!!B);this._current.offsetDirection="below";for(const G of F)p.pathDivide(G,z,A,!!B)}}_writeCenterAlong(v,A,z){const {repeatLabel:B}=this.evaluatedMeshParams,{shaping:D}=this._current;v=p.smoothPaths(v.readLegacyGeometryForDisplay().paths,D.bounds.width);for(const F of v)p.pathDivide(F,z,A,!!B)}_placeSubdivGlyphs(v,A,z,B){const {allowOverrun:D,labelPosition:F,repeatLabelDistance:E}=this.evaluatedMeshParams,C=this._current.zoomRange[0];var G=y(A),H=this._current.shaping.bounds.width/ 2,K=Math.sqrt(E||128)/2;z=Math.min(z,B-z);H=this._current.shaping.isMultiline?w.maxLabelZoom:Math.log2(z/(K+H/2));G=Math.max(C,this._zoomLevel+1-(0===A?H:Math.min(G,H)));H=this._zoomLevel-G;K=this._current.shaping.bounds.width/2*2**H;this._current.shaping.isMultiline?0===A&&this._placeStraight(v,G):D&&0>H?this._placeStraightAlong(v,C):"parallel"===F?this._placeStraightAlong(v,G):"curved"===F&&this._placeCurved(v,G,K)}_placeStraight(v,A){const {out:z,id:B,shaping:D,referenceBounds:F}=this._current, {x:E,y:C}=v;var G=c.getDisplayIdTexel(B);z.metricStart(new k.LabelMetric(G,v.x,v.y,0,0,this.evaluatedMeshParams.scaleInfo?.maxScale??0,this.evaluatedMeshParams.scaleInfo?.minScale??0,null));z.metricBoxWrite(D.boundsT);G=(180/Math.PI*v.angle+180)%360;this._writeGlyphs(z,B,E,C,D,0,F,{clipAngle:180/Math.PI*v.angle%360,mapAligned:!0,isLineLabel:!0,minZoom:A});this._writeGlyphs(z,B,E,C,D,0,F,{clipAngle:G,mapAligned:!0,isLineLabel:!0,minZoom:A});z.metricEnd()}_placeCurved(v,A,z){const {out:B,id:D}=this._current, F=v.clone(),E=180/Math.PI*v.angle%360,C=(180/Math.PI*v.angle+180)%360,G=c.getDisplayIdTexel(D);B.metricStart(new k.LabelMetric(G,v.x,v.y,0,0,this.evaluatedMeshParams.scaleInfo?.maxScale??0,this.evaluatedMeshParams.scaleInfo?.minScale??0,null));this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||(this._placeFirst(F,A,1,E),this._placeBack(v,F,A,z,1,E),this._placeForward(v,F,A,z,1,E));this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||(this._placeFirst(F, A,0,C),this._placeBack(v,F,A,z,0,C),this._placeForward(v,F,A,z,0,C));B.metricEnd()}_placeStraightAlong(v,A){const {out:z,id:B,shaping:D,zoomRange:F,referenceBounds:E}=this._current,{boxBorderLineColor:C,boxBackgroundColor:G}=this.evaluatedMeshParams,H=v.clone(),K=180/Math.PI*v.angle%360,J=(180/Math.PI*v.angle+180)%360;if(0=B);)this._placeOnSegment(E,A,v,z,-1,D,F),v+=E.length+0}_placeForward(v,A,z,B,D,F){const E=v.clone();for(v=v.remainingLength+0;E.next()&&!(v>=B);)this._placeOnSegment(E,A,v,z,1,D,F),v+=E.length+0}_placeFirst(v, A,z,B,D=!1){const {out:F,id:E,shaping:C,zoomRange:G,referenceBounds:H}=this._current;var K=C.glyphs;for(const J of K)K=J.x>C.bounds.x?z:1-z,K=Math.max(0,this._zoomLevel+Math.log2(Math.abs(J.x+J.width/2-C.bounds.x)/(K*v.remainingLength+(1-K)*v.backwardLength))),K=Math.max(A,D?0:K),J.maxZoom=Math.min(G[1],w.maxLabelZoom),J.angle=v.angle+(1-z)*Math.PI,J.minZoom=Math.max(G[0],K),this._writeLineGlyph(F,E,v.x,v.y,C.bounds,J,B,H,!0),z&&this._isVisible(J.minZoom,J.maxZoom)&&F.metricBoxWrite(J.bounds)}_placeOnSegment(v, A,z,B,D,F,E){const {out:C,id:G,shaping:H,referenceBounds:K}=this._current;var J=H.glyphs,O=v.x+v.dx/v.length*-D*z,Q=v.y+v.dy/v.length*-D*z;for(const I of J)if((J=I.x>H.bounds.x?F:1-F)&&1===D||!J&&-1===D){var T=Math.abs(I.x+I.width/2-H.bounds.x);J=Math.max(0,this._zoomLevel+Math.log2(T/z)-.1);T=Math.max(B,this._zoomLevel+Math.log2(T/(z+v.length+0)));0!==J&&(I.angle=v.angle+(1-F)*Math.PI,I.minZoom=T,I.maxZoom=J,this._writeLineGlyph(C,G,O,Q,H.bounds,I,E,K,!0),F&&this._isVisible(I.minZoom,I.maxZoom)&& (J=I.bounds,J=new r(J.center[0]+(v.x-A.x),J.center[1]+(v.y-A.y),J.width,J.height),C.metricBoxWrite(J)))}}_writeLineGlyph(v,A,z,B,D,F,E,C,G){const H=z+D.x,K=B+D.y;D=2*Math.max(D.width,D.height)*(this.evaluatedMeshParams.minPixelBuffer?this.evaluatedMeshParams.minPixelBuffer/this._textMeshTransformProps.fontSize:1);v.recordStart(this.instanceId,this.attributeLayout,F.textureBinding);v.recordBounds(H,K,D,D);const {texcoords:J,offsets:O}=F;this._writeQuad(v,A,z,B,{texcoords:J,offsets:O,fontSize:this._textMeshTransformProps.fontSize, color:t.processColorInput(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:C,minZoom:Math.max(this._current.zoomRange[0],F.minZoom),maxZoom:Math.min(this._current.zoomRange[1],F.maxZoom),clipAngle:E,mapAligned:G,isLineLabel:!0});v.recordEnd()}_isVisible(v,A){const z=this._zoomLevel;return v<=z&&z<=A}}e.LabelMeshWriter=x;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/DisplayId":function(){define(["exports"],function(e){e.aggregateValidFiltersMask= 254;e.createDisplayId=function(g,q){return((q?8388608:0)|g)>>>0};e.displayIdTexelMask=8388607;e.displayIdTypeAggregate=1;e.displayIdTypeFeature=0;e.displayIdTypeMask=8388608;e.getDisplayIdFilterMask=g=>1===(g&8388608)>>>23?254:255;e.getDisplayIdTexel=g=>g&8388607;e.getDisplayIdType=g=>(g&8388608)>>>23;e.isAggregateId=function(g){return 1===(g&8388608)>>>23};e.nonAggregateValidFiltersMask=255;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/mesh/templates/segmentUtils":function(){define(["exports", "../../../../../../symbols/cim/constants"],function(e,g){function q(f,n,c){f[0]=n[0]-c[0];f[1]=n[1]-c[1];return f}function h(f){var n=f[0];var c=f[1];n=Math.sqrt(n*n+c*c);f[0]/=n;f[1]/=n}function m(f){return f.length-1}function l(f){let n=0;for(let c=0;cf._index||this._index===f._index&&this._distance>=f._distance}get _segment(){return this._segments[this._index+1]}get angle(){const f=this.dy;let n=Math.acos((0*f+-1*-this.dx)/(1*this.length));0f)return this._seekBackwards(f-c);c+=this.length}this._distance=0;return n?this:null}seek(f,n=!1){if(0>f)return this._seekBackwards(Math.abs(f), n);if(f<=this.remainingLength)return this._distance=(this.backwardLength+f)/this.length,this;let c=this.remainingLength;for(;this.next();){if(c+this.length>f)return this.seek(f-c,n);c+=this.length}this._distance=1;return n?this:null}}e.SegmentCursor=a;e.pathDivide=function(f,n,c,r=!0){const k=l(f);f=a.create(f);const p=k/2;if(r){r=Math.floor(Math.max((k-n)/2,0)/n);f.seek(p-r*n);for(let t=-r;t<=r;t++)Math.abs(f.x)=r)break a;const K=c.length;if(3>K)break a;const J=[];var k=0;J.push(0);for(var p=1;pMath.abs(A))break;var z=A*A,B=A*x-.5*z*v,D=A*v/r,F=c[y+1],E=c[y][0]-F[0],C=c[y][1]-F[1];O+=D/B*(F[0]*A*x+.5*z*(x*E-v*F[0])-z* A*v*E/3);Q+=D/B*(F[1]*A*x+.5*z*(x*C-v*F[1])-z*A*v*C/3);T+=D}for(y=w+1;yJ[w]+t);y++){x=t-J[y-1]+J[w];v=J[y]-J[y-1];A=J[y]-J[w]Math.abs(A))break;z=A*A;B=A*x-.5*z*v;D=A*v/r;F=c[y-1];E=c[y][0]-F[0];C=c[y][1]-F[1];O+=D/B*(F[0]*A*x+.5*z*(x*E-v*F[0])-z*A*v*E/3);Q+=D/B*(F[1]*A*x+.5*z*(x*C-v*F[1])-z*A*v*C/3);T+=D}p.push(O/T);p.push(Q/T)}p.push(k);p.push(u);for(let O=0,Q=0;OE,optionalAttributes:{zoomRange:{type:k.DataType.UNSIGNED_SHORT, count:2,packPrecisionFactor:d.minMaxZoomPrecisionFactor,packTessellation:({minZoom:E,maxZoom:C})=>[E||0,C||28]},clipAngle:{type:k.DataType.UNSIGNED_BYTE,count:1,packTessellation:({clipAngle:E})=>Math.round(254/360*(E||0))},referenceSymbol:{type:k.DataType.BYTE,count:4,packPrecisionFactor:1,packTessellation:(E,C)=>{if(!E.referenceBounds)return[0,0,0,0];const G=l.getXDirection(C.horizontalAlignment);C=l.getYDirection(C.verticalAlignment);const {offsetX:H,offsetY:K,size:J}=E.referenceBounds;return[q.pt2px(H), -q.pt2px(K),q.pt2px(J),G+1<<2|C+1]}}},attributes:{pos:{type:k.DataType.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:k.DataType.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:k.DataType.UNSIGNED_BYTE,count:1,packTessellation:({isBackground:E,mapAligned:C})=>a.packBitset([[c.bitsetTextIsBackground,E],[c.bitsetTextIsMapAligned,!!C]])},offset:{type:k.DataType.SHORT,count:2,packPrecisionFactor:8,packAlternating:{count:4,packTessellation:({offsets:E})=>{const {bottomLeft:C,bottomRight:G, topLeft:H,topRight:K}=E;return[H,K,C,G]}}},textureUV:{type:k.DataType.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,packTessellation:({texcoords:E})=>{const {bottomLeft:C,bottomRight:G,topLeft:H,topRight:K}=E;return[H,K,C,G]}}},color:{type:k.DataType.UNSIGNED_BYTE,count:4,normalized:!0,packTessellation:({color:E})=>E},fontSize:{type:k.DataType.UNSIGNED_SHORT,count:1,packPrecisionFactor:4,packTessellation:({fontSize:E})=>q.pt2px(E)},referenceSize:{type:k.DataType.UNSIGNED_BYTE,count:1, packPrecisionFactor:4,packTessellation:({fontSize:E},{referenceSize:C})=>q.pt2px(C??E)},haloColor:{type:k.DataType.UNSIGNED_BYTE,count:4,normalized:!0,pack:({haloColor:E})=>a.processColorInput(E)},haloFontSize:{type:k.DataType.UNSIGNED_SHORT,count:1,packPrecisionFactor:4,pack:({haloFontSize:E})=>q.pt2px(E)}}};class F extends n.MeshWriter{constructor(){super(...arguments);this.vertexSpec=D;this._textMeshParamsPropsInitialized=!1}ensurePacked(E,C,G){super.ensurePacked(E,C,G);if(!this._textMeshParamsPropsInitialized|| this._evaluator.hasDynamicProperties)this._textMeshTransformProps=new r.TextMeshTransformProps(this.evaluatedMeshParams),this._textMeshParamsPropsInitialized=!0}_write(E,C,G){const H=this._getShaping();if(H){var K=C.getDisplayId();if(null!=this.evaluatedMeshParams.placement)return this._writePlacedTextMarkers(E,C,H,G);if(G?.nextPath())return G.nextPoint(),this._writeGlyphs(E,K,G.x,G.y,H,0);if("esriGeometryPolygon"===C.geometryType){C=C.readCentroidForDisplay();if(!C)return;const [J,O]=C.coords;return this._writeGlyphs(E, K,J,O,H,0)}if("esriGeometryMultipoint"===C.geometryType)C.readGeometryForDisplay()?.forEachVertex((J,O)=>this._writeGlyphs(E,K,J,O,H,0));else return G=C.readXForDisplay(),C=C.readYForDisplay(),this._writeGlyphs(E,K,G,C,H,0)}}_writePlacedTextMarkers(E,C,G,H){if(H=H??h.GeometryCursor.fromFeatureSetReaderCIM(C))if(H=m.CIMMarkerPlacementHelper.getPlacement(H,-1,this.evaluatedMeshParams.placement,q.pt2px(1),E.id,f.getGeometryEngine())){C=C.getDisplayId();for(var K=H.next();null!=K;){const J=K.tx,O=-K.ty; K=-K.getAngle();this._writeGlyphs(E,C,J,O,G,K);K=H.next()}}}_getShaping(E){const C=this._textMeshTransformProps,G=this.evaluatedMeshParams;if(!G.glyphs?.glyphs.length)return null;const H=Math.round(q.pt2px(C.fontSize)),K=q.pt2px(C.offsetX),J=q.pt2px(C.offsetY),O=g.clamp(q.pt2px(G.lineWidth),d.minTextLineWidth,d.maxTextLineWidth),Q=d.magicLabelLineHeight*g.clamp(G.lineHeightRatio,.25,4);return b.shapeGlyphs(G.glyphs,{scale:H/d.glyphSize,angle:C.postAngle,xOffset:K,yOffset:J,horizontalAlignment:G.horizontalAlignment, verticalAlignment:E||G.verticalAlignment,maxLineWidth:O,lineHeight:Q,decoration:G.decoration,borderLineSizePx:q.pt2px(G.boxBorderLineSize),hasBackground:!!G.boxBackgroundColor,useCIMAngleBehavior:G.useCIMAngleBehavior})}_writeGlyphs(E,C,G,H,K,J,O,Q){const T=this.evaluatedMeshParams;var I=this._textMeshTransformProps;const L=I.fontSize;var R=q.pt2px(I.offsetX),V=q.pt2px(I.offsetY);const [S,X]=a.getMinMaxZoom(T.scaleInfo,this.getTileInfo());0!==J&&K.setRotation(J);I=K.bounds;R=G+I.x+R;V=H+I.y-V;I=2* Math.max(I.width,I.height)*(T.minPixelBuffer?T.minPixelBuffer/L:1);K.textBox&&(E.recordStart(this.instanceId,this.attributeLayout,K.glyphs[0].textureBinding),E.recordBounds(R,V,I,I),this._writeTextBox(E,C,G,H,K.textBox,O,Q),E.recordEnd());for(const N of K.glyphs){E.recordStart(this.instanceId,this.attributeLayout,N.textureBinding);E.recordBounds(R,V,I,I);const {texcoords:P,offsets:U}=N;this._writeQuad(E,C,G,H,{texcoords:P,offsets:U,fontSize:L,color:a.processColorInput(T.color),isBackground:!1,referenceBounds:O, minZoom:S,maxZoom:X,...Q});E.recordEnd()}0!==J&&K.setRotation(-J)}_writeTextBox(E,C,G,H,K,J,O){const Q=this.evaluatedMeshParams,{fontSize:T}=this._textMeshTransformProps,{boxBackgroundColor:I,boxBorderLineColor:L}=Q;J={isBackground:!0,fontSize:T,referenceBounds:J,...O};I&&(this._writeQuad(E,C,G,H,{texcoords:w,offsets:K.main,color:a.processColorInput(I),...J}),L||(this._writeQuad(E,C,G,H,{texcoords:v,offsets:K.top,color:a.processColorInput(I),...J}),this._writeQuad(E,C,G,H,{texcoords:A,offsets:K.bot, color:a.processColorInput(I),...J}),this._writeQuad(E,C,G,H,{texcoords:z,offsets:K.left,color:a.processColorInput(I),...J}),this._writeQuad(E,C,G,H,{texcoords:B,offsets:K.right,color:a.processColorInput(I),...J})));L&&(this._writeQuad(E,C,G,H,{texcoords:y,offsets:K.top,color:a.processColorInput(L),...J}),this._writeQuad(E,C,G,H,{texcoords:y,offsets:K.bot,color:a.processColorInput(L),...J}),this._writeQuad(E,C,G,H,{texcoords:x,offsets:K.left,color:a.processColorInput(L),...J}),this._writeQuad(E,C, G,H,{texcoords:x,offsets:K.right,color:a.processColorInput(L),...J}))}_writeQuad(E,C,G,H,K){const J=E.vertexCount();this._writeVertex(E,C,G,H,K);E.indexWrite(J+0);E.indexWrite(J+1);E.indexWrite(J+2);E.indexWrite(J+1);E.indexWrite(J+3);E.indexWrite(J+2)}}e.TextMeshWriter=F;e.TextVertexSpec=D;e.maxLabelZoom=28;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/cim/placements/CIMMarkerPlacementHelper":function(){define(["exports","../CIMOperators"],function(e,g){class q{static getPlacement(h, m,l,d,b,a){const f=g.getPlacementOperator(l);if(!f)return null;-1===m&&h.invertY();return f.execute(h,l,d,b,a)}}e.CIMMarkerPlacementHelper=q;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/text/TextParams":function(){define(["exports","../../../../../../../symbols/cim/utils"],function(e,g){class q{constructor(h){const {offsetX:m,offsetY:l,postAngle:d,fontSize:b,scaleFactor:a,transforms:f}=h;this.offsetX=m;this.offsetY=l;this.postAngle= d;this.fontSize=Math.min(b,96);(this.transforms=f)&&1f,optionalAttributes:m.LineVertexSpec.optionalAttributes,attributes:{...m.LineVertexSpec.attributes,bitset:{type:d.DataType.UNSIGNED_BYTE,count:1,pack:({shouldSampleAlphaOnly:f,shouldScaleDash:n,isSDF:c})=>h.packBitset([[l.bitsetGenericConsiderAlphaOnly,f],[l.bitsetLineScaleDash,n],[l.bitsetLineIsSdf,c]])},tlbr:{type:d.DataType.UNSIGNED_SHORT,count:4,pack:({sprite:f})=>{const {rect:n,width:c,height:r}=f;f=n.x+q.spritePadding;const k=n.y+q.spritePadding; return[f,k,f+c,k+r]}},accumulatedDistance:{type:d.DataType.UNSIGNED_SHORT,count:1,packTessellation:({distance:f})=>f},segmentDirection:{type:d.DataType.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:f,directionY:n})=>[f,n]}}};class a extends m.LineMeshWriter{constructor(f,n,c,r){super(f,n,c,r);this.vertexSpec=b;this._tessellationOptions.textured=!0}_write(f,n,c){if(c=c??g.GeometryCursor.fromFeatureSetReaderCIM(n)){var {sprite:r}=this.evaluatedMeshParams;this._writeGeometry(f,n, c,r?.textureBinding)}}}e.TexturedLineMeshWriter=a;e.texturedLineVertexSpec=b;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter":function(){define("exports ../../../../../../../core/screenUtils ../../../../../../../core/libs/gl-matrix-2/math/mat2d ../../../../../../../core/libs/gl-matrix-2/factories/mat2df32 ../../../../../../../core/libs/gl-matrix-2/math/vec2 ../../../../../../../geometry/GeometryCursor ../../../../../../../symbols/cim/constants ../../../../../../../symbols/cim/enums ../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper ../../../definitions ../fill/meshWriterUtils ./ComputedMarkerParams ./markerConstants ../mesh/loadGeometryEngine ../mesh/MeshWriter ../../../../../../webgl/enums".split(" "), function(e,g,q,h,m,l,d,b,a,f,n,c,r,k,p,t){function w(A,z,B,D,F=!1){A=h.create();F=F?1:-1;q.identity(A);(z||B)&&q.translate(A,A,[z,-B]);D&&q.rotate(A,A,F*u*-D);return A}const u=3.14159265359/180,y=128/Math.PI,x={createComputedParams:A=>c.ComputedMarkerParams.from(A),optionalAttributes:{zoomRange:{type:t.DataType.SHORT,count:2,packPrecisionFactor:f.minMaxZoomPrecisionFactor,pack:({scaleInfo:A},{tileInfo:z})=>n.getMinMaxZoom(A,z)}},attributes:{pos:{type:t.DataType.SHORT,count:2,pack:"position",packPrecisionFactor:10}, id:{type:t.DataType.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:t.DataType.UNSIGNED_BYTE,count:1,pack:({sprite:A,alignment:z,scaleSymbolsProportionally:B,overrideOutlineColor:D,colorLocked:F})=>{let E=0;A.sdf&&(E|=n.getBitMask(r.MarkerConstants.bitset.isSDF));z===b.Alignment.MAP&&(E|=n.getBitMask(r.MarkerConstants.bitset.isMapAligned));B&&(E|=n.getBitMask(r.MarkerConstants.bitset.scaleSymbolsProportionally));D&&(E|=n.getBitMask(r.MarkerConstants.bitset.overrideOutlineColor));F&&(E|=n.getBitMask(r.MarkerConstants.bitset.colorLocked)); return E}},offset:{type:t.DataType.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({angle:A,computedWidth:z,computedHeight:B,anchorX:D,anchorY:F,offsetX:E,offsetY:C,rotateClockwise:G})=>{A=w(0,E,C,-A,G);D=-(.5+D)*z;G=-(.5-F)*B;F=[D,G];E=[D+z,G];C=[D,G+B];z=[D+z,G+B];m.transformMat2d(F,F,A);m.transformMat2d(E,E,A);m.transformMat2d(C,C,A);m.transformMat2d(z,z,A);return[F,E,C,z]}}},textureUV:{type:t.DataType.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({texXmax:A, texXmin:z,texYmax:B,texYmin:D})=>[[z,D],[A,D],[z,B],[A,B]]}},color:{type:t.DataType.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:A})=>n.processColorInput(A)},outlineColor:{type:t.DataType.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:A})=>n.processColorInput(A)},sizing:{type:t.DataType.UNSIGNED_BYTE,count:4,pack:({rawWidth:A,rawHeight:z,outlineSize:B,referenceSize:D})=>[n.packByteSqrt(Math.max(A,z),128),n.packByteSqrt(B,128),n.packByteSqrt(D,128),0]},placementAngle:{type:t.DataType.UNSIGNED_BYTE, count:1,packTessellation:({placementAngle:A})=>{A*=y;A%=256;return Math.abs(0<=A?A:A+256)}},sizeRatio:{type:t.DataType.UNSIGNED_SHORT,count:1,packPrecisionFactor:64,pack:({sizeRatio:A})=>A}}};class v extends p.MeshWriter{constructor(){super(...arguments);this.vertexSpec=x}getBoundsInfo(){return this.evaluatedMeshParams.boundsInfo}_write(A,z,B){var D=this.evaluatedMeshParams.sprite?.textureBinding;const F=z.getDisplayId();A.recordStart(this.instanceId,this.attributeLayout,D);D=this.evaluatedMeshParams.minPixelBuffer; const E=Math.max(this.evaluatedMeshParams.computedWidth,D),C=Math.max(this.evaluatedMeshParams.computedHeight,D),G=this.evaluatedMeshParams.offsetX,H=-this.evaluatedMeshParams.offsetY;if(null!=this.evaluatedMeshParams.placement)this._writePlacedMarkers(A,z,B,E,C);else if(B?.nextPath())B.nextPoint(),z=B.x,B=B.y,A.recordBounds(z+G,B+H,E,C),this._writeQuad(A,F,z,B);else if("esriGeometryPolygon"===z.geometryType){z=z.readCentroidForDisplay();if(!z)return;const [K,J]=z.coords;A.recordBounds(K+G,J+H,E, C);this._writeQuad(A,F,K,J)}else"esriGeometryPoint"===z.geometryType?(B=z.readXForDisplay(),z=z.readYForDisplay(),A.recordBounds(B+G,z+H,E,C),this._writeQuad(A,F,B,z)):z.readGeometryForDisplay()?.forEachVertex((K,J)=>{A.recordBounds(K+G,J+H,E,C);Math.abs(K)>d.maxTileCoordValue||Math.abs(J)>d.maxTileCoordValue||this._writeQuad(A,F,K,J)});A.recordEnd()}_writePlacedMarkers(A,z,B,D,F){if(B=B??l.GeometryCursor.fromFeatureSetReaderCIM(z)?.clone())if(B=a.CIMMarkerPlacementHelper.getPlacement(B,-1,this.evaluatedMeshParams.placement, g.pt2px(1),A.id,k.getGeometryEngine())){z=z.getDisplayId();for(var E=B.next(),C=this.evaluatedMeshParams.offsetX,G=-this.evaluatedMeshParams.offsetY;null!=E;){const H=E.tx,K=-E.ty;Math.abs(H)>d.maxTileCoordValue||Math.abs(K)>d.maxTileCoordValue?E=B.next():(E=-E.getAngle(),A.recordBounds(H+C,K+G,D,F),this._writeQuad(A,z,H,K,E),E=B.next())}}}_writeQuad(A,z,B,D,F){const E=A.vertexCount();this._writeVertex(A,z,B,D,null==F?null:{placementAngle:F});A.indexWrite(E+0);A.indexWrite(E+1);A.indexWrite(E+2); A.indexWrite(E+1);A.indexWrite(E+3);A.indexWrite(E+2)}}e.MarkerMeshWriter=v;e.MarkerVertexSpec=x;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/markers/ComputedMarkerParams":function(){define(["exports","../../../../../../../core/screenUtils","../../../../../../../symbols/cim/enums","../../../../../../../symbols/cim/utils","../../../definitions"],function(e,g,q,h,m){class l{static from(d){return"width"in d?this.fromSimpleMeshParams(d): this.fromComplexMeshParams(d)}static fromSimpleMeshParams(d){const b=new l(d.sprite,d.color,d.outlineColor,d.minPixelBuffer,d.placement,d.scaleInfo,d.effects),{type:a,width:f,height:n,angle:c,alignment:r,outlineSize:k,referenceSize:p,sprite:t,overrideOutlineColor:w}=d;b.rawWidth=g.pt2px(f);b.rawHeight=g.pt2px(n);b.angle=c;b.alignment=r;b.outlineSize=g.pt2px(k);b.referenceSize=g.pt2px(p);b.overrideOutlineColor=w;b.offsetX=g.pt2px(d.offsetX);b.offsetY=g.pt2px(d.offsetY);"simple"!==a||t.sdf||(b.rawWidth= t.width,b.rawHeight=t.height);b.sizeRatio=t.sdf?2:1;b._computeSize(d,!1);return b}static fromComplexMeshParams(d){const b=new l(d.sprite,d.color,d.outlineColor,d.minPixelBuffer,d.placement,d.scaleInfo,d.effects);let {alignment:a,transforms:f,size:n,scaleX:c,anchorX:r,anchorY:k,angle:p,colorLocked:t,frameHeight:w,widthRatio:u,offsetX:y,offsetY:x,outlineSize:v,referenceSize:A,scaleFactor:z,sizeRatio:B,isAbsoluteAnchorPoint:D,rotateClockwise:F,scaleSymbolsProportionally:E,sprite:C}=d;if(f&&0r?d:c)+w,d);this.computedHeight=Math.min(r+w,t)}else this.computedWidth=d,this.computedHeight=t;b=n?Math.max(a.width,a.height)/Math.max(d,t):1;w=.5*(d-this.computedWidth)* b;var u=.5*(t-this.computedHeight)*b;b=a.rect.x+m.spritePadding+w;n=a.rect.y+m.spritePadding+u;w=b+a.width-2*w;u=n+a.height-2*u;this.texXmin=Math.floor(b);this.texYmin=Math.floor(n);this.texXmax=Math.ceil(w);this.texYmax=Math.ceil(u);this.computedWidth*=(this.texXmax-this.texXmin)/(w-b);this.computedHeight*=(this.texYmax-this.texYmin)/(u-n);this.anchorX*=d/this.computedWidth;this.anchorY*=t/this.computedHeight}}e.ComputedMarkerParams=l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})}, "esri/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterInputEvaluator":function(){define("exports ../../../../../../../core/arrayUtils ../../../../../../../core/Error ../../../../../../../core/lang ../../../../../../../core/Logger ../../../grouping ./utils ../../../../../layers/features/support/DictionaryValue".split(" "),function(e,g,q,h,m,l,d,b){async function a(k,p,t=!1){const {defaultValue:w,valueExpressionInfo:u,value:y}=p;if(u){const {expression:x}=u;return(k=await k.createComputedField({expression:x}, t))?{...p,computed:k,defaultValue:w}:null}return{...p,computed:new b.DictionaryValue(y),defaultValue:w}}async function f(k,p){const {defaultValue:t,valueExpressionInfo:w}=p,{expression:u}=w;return(k=await k.createComputedField({expression:u}))?{...p,computed:k,defaultValue:t}:null}const n=k=>"boolean"!==typeof k&&"number"!==typeof k&&"valueExpressionInfo"in k,c=k=>k.some(p=>{for(const t in p)if(n(p[t]))return!0;return!1});class r{static async create(k,p,t){const w={},u=new Map,y=new Map,x=new Map, v=new Map,A=new Map;for(const B in t){const D=t[B];if(null==D||"object"!==typeof D)w[B]=D;else if(Array.isArray(D)){if("object"===typeof D[0])throw Error(`InternalError: Cannot handle ${B}. Nested array params are not supported`);w[B]=D}else if("valueExpressionInfo"in D)if(D.value)w[B]=D.value;else{var z=await f(k,D);z?(u.set(B,z),w[B]=null):w[B]=D.defaultValue}else switch(D.type){case "cim-effect-infos":if(D.effectInfos.some(F=>F.overrides.length)){y.set(B,{effects:await Promise.all(D.effectInfos.map(async F=> {const E=F.overrides.map(C=>a(k,C));return{effect:F.effect,compiledOverrides:(await Promise.all(E)).filter(g.isSome)}}))});break}w[B]=D.effectInfos.map(F=>F.effect);break;case "cim-marker-placement-param":D.overrides.length&&x.set(B,{placementInfo:D,compiledOverrides:(await Promise.all(D.overrides.map(F=>a(k,F)))).filter(g.isSome)});w[B]=D.placement;break;case "text-rasterization-param":if(D.overrides.length){z=D.overrides.map(F=>a(k,F,D.useLegacyLabelEvaluationRules));v.set(B,{compiledOverrides:(await Promise.all(z)).filter(g.isSome), rasterizationParam:D,objectIdToResourceId:new Map});continue}w[B]=await p.fetchResourceImmediate({type:"cim-rasterization-info",resource:D.resource})??null;break;case "sprite-rasterization-param":if(D.overrides.length){z=D.overrides.map(F=>a(k,F));v.set(B,{compiledOverrides:(await Promise.all(z)).filter(g.isSome),rasterizationParam:D,objectIdToResourceId:new Map});continue}if("animated"===D.resource.type){v.set(B,{compiledOverrides:[],rasterizationParam:D,objectIdToResourceId:new Map});continue}w[B]= await p.fetchResourceImmediate({type:"cim-rasterization-info",resource:D.resource})??null;break;case "cim-marker-transform-param":({params:z}=D);if(c(z)){const F={compiledMarkerInfos:[]};await Promise.all(z.map(async E=>{const C={props:{}};for(const G in E)if(n(E[G])){const H=await f(k,E[G]);C.compiledExpressionMap||(C.compiledExpressionMap=new Map);const K=C.compiledExpressionMap;H&&K.set(G,H)}else C.props[G]=E[G];F.compiledMarkerInfos.push(C)}));A.set(B,F)}else w[B]={type:"cim-marker-transform-info", infos:z};break;default:w[B]=D}}return new r(t,w,u,y,x,v,A)}constructor(k,p,t,w,u,y,x){this.inputMeshParams=k;this._resolvedMeshParams=p;this._dynamicProperties=t;this._dynamicEffectProperties=w;this._dynamicPlacementProperties=u;this._dynamicAsyncProperties=y;this._dynamicTransformProperties=x;this.evaluator=v=>v}get hasDynamicProperties(){return!!(this._dynamicProperties.size||this._dynamicAsyncProperties.size||this._dynamicEffectProperties.size||this._dynamicTransformProperties.size||this._dynamicPlacementProperties.size)}get evaluatedMeshParams(){this._evaluatedMeshParams|| (this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams));return this._evaluatedMeshParams}enqueueRequest(k,p,t){for(const u of this._dynamicAsyncProperties.values()){var w=h.clone(u.rasterizationParam.resource);"animated"===u.rasterizationParam.resource.type&&u.rasterizationParam.resource.randomizeStartTime&&(w.primitiveName="__RESERVED__PRIMITIVE__NAME__",w.startGroup=l.getStartGroup(p.getObjectId()||0));for(const {primitiveName:y,propertyName:x,computed:v,defaultValue:A,valueExpressionInfo:z}of u.compiledOverrides)try{d.applyComputedValue(w, "animated"===u.rasterizationParam.resource.type?w.primitiveName:y,x,v,p,t,A)}catch(B){m.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.mesh.MeshWriterInputEvaluator").errorOnce(new q("invalid-arcade-expression",`Encountered an error when evaluating the arcade expression '${z?.expression}' (primitive: '${y}', property: '${x}')`,B))}w=k.enqueueRequest({type:"cim-rasterization-info",resource:w});u.objectIdToResourceId.set(p.getObjectId(),w)}}evaluateMeshParams(k,p,t){for(const [y,x]of this._dynamicProperties.entries())this._resolvedMeshParams[y]= x.computed.readWithDefault(p,t,x.defaultValue);for(const [y,x]of this._dynamicPlacementProperties.entries())for(const {computed:v,defaultValue:A,propertyName:z}of x.compiledOverrides){var w=v.readWithDefault(p,t,A);x.placementInfo.placement[z]=w;this._resolvedMeshParams[y]=x.placementInfo.placement}for(const [y,x]of this._dynamicEffectProperties.entries())for(var u of x.effects){for(const {computed:v,defaultValue:A,propertyName:z}of u.compiledOverrides)w=v.readWithDefault(p,t,A),u.effect[z]=w;this._resolvedMeshParams[y]= x.effects.map(v=>v.effect)}for(const [y,x]of this._dynamicTransformProperties.entries()){u={type:"cim-marker-transform-info",infos:[]};for(const v of x.compiledMarkerInfos){w={...v.props};if(v.compiledExpressionMap)for(const [A,z]of v.compiledExpressionMap){const B=z.computed.readWithDefault(p,t,z.defaultValue);w[A]="number"===typeof B||"boolean"===typeof B?B:z.defaultValue}u.infos.push(w)}this._resolvedMeshParams[y]=u}for(const [y,x]of this._dynamicAsyncProperties.entries())t=x.objectIdToResourceId.get(p.getObjectId()), null!=t&&(t=k.getResource(t),this._resolvedMeshParams[y]=t);this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams);return this.evaluatedMeshParams}}e.MeshWriterInputEvaluator=r;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/features/support/DictionaryValue":function(){define(["exports","./AComputedField"],function(e,g){class q extends g.AComputedField{constructor(h){super();this._value=h}resize(h){}read(h,m){return this._value}readWithDefault(h,m, l){return this._value}referencesScale(){return!1}referencesGeometry(){return!1}}e.DictionaryValue=q;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/features/support/AComputedField":function(){define(["exports"],function(e){class g{destroy(){}}e.AComputedField=g;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter":function(){define(["exports","../../../../../../../core/screenUtils", "../fill/meshWriterUtils","../mesh/MeshWriter","../../../../../../webgl/enums"],function(e,g,q,h,m){const l={createComputedParams:b=>b,optionalAttributes:{},attributes:{pos:{type:m.DataType.SHORT,count:2,packPrecisionFactor:10,pack:"position"},id:{type:m.DataType.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:m.DataType.UNSIGNED_BYTE,count:1,pack:b=>0},offset:{type:m.DataType.SHORT,count:2,packPrecisionFactor:16,packAlternating:{count:4,pack:({size:b})=>{b=g.pt2px(b);const a=-b/2,f=-b/2;return[[a, f],[a+b,f],[a,f+b],[a+b,f+b]]}}},texCoords:{type:m.DataType.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:()=>[[0,1],[1,1],[0,0],[1,0]]}},size:{type:m.DataType.UNSIGNED_BYTE,count:2,pack:({size:b})=>[b,b]},referenceSize:{type:m.DataType.UNSIGNED_BYTE,count:1,pack:({size:b})=>g.pt2px(b)},zoomRange:{type:m.DataType.UNSIGNED_BYTE,count:2,pack:({scaleInfo:b},{tileInfo:a})=>q.getMinMaxZoom(b,a)}}};class d extends h.MeshWriter{constructor(){super(...arguments);this.vertexSpec=l}_write(b, a){const f=a.getDisplayId();var n=this.evaluatedMeshParams.minPixelBuffer,c=Math.max(g.pt2px(this.evaluatedMeshParams.size),n);if("esriGeometryPoint"===a.geometryType)n=a.readXForDisplay(),a=a.readYForDisplay();else{a=a.readCentroidForDisplay();if(!a)return;n=a?.coords[0];a=a?.coords[1]}b.recordStart(this.instanceId,this.attributeLayout);b.recordBounds(n,a,c,c);c=b.vertexCount();this._writeVertex(b,f,n,a);b.indexWrite(c+0);b.indexWrite(c+1);b.indexWrite(c+2);b.indexWrite(c+1);b.indexWrite(c+3);b.indexWrite(c+ 2);b.recordEnd()}}e.PieChartMeshWriter=d;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/RenderingContext":function(){define("exports ../../core/maybe ../../core/promiseUtils ../../core/time ./checkWebGLError ./ContextState ./enums ./InstanceCounter ./Parameters ./ProgramCache ./renderState ./Texture ./Util ./WebGLDriverTest ./capabilities/Capabilities".split(" "),function(e,g,q,h,m,l,d,b,a,f,n,c,r,k,p){function t(u,y,x,v){y?v!==y&&u.bindBuffer(x,y.glName):u.bindBuffer(x, null);return y}function w(u,y){switch(u){case d.PrimitiveType.POINTS:return 2*y;case d.PrimitiveType.TRIANGLES:return y/3;case d.PrimitiveType.TRIANGLE_STRIP:return y-2;case d.PrimitiveType.TRIANGLE_FAN:return y-2;default:return 0}}e.RenderingContext=class{constructor(u,y){this.gl=u;this.instanceCounter=new b.InstanceCounter;this.programCache=new f.ProgramCache(this);this._transformFeedbackRequestInfo=null;this._state=new l.ContextState;this._numOfTriangles=this._numOfDrawCalls=0;this._loadExtensions(); this.configure(y)}configure(u){this._capabilities=new p.Capabilities(this.gl,u);this._parameters=new a.Parameters(this.gl,this._capabilities,u);c.Texture.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;u=this.gl.getParameter(this.gl.VIEWPORT);this._state=new l.ContextState;this._state.viewport={x:u[0],y:u[1],width:u[2],height:u[3]};this._stateTracker=new n.StateTracker({setBlending:y=>{y?(this.setBlendingEnabled(!0),this.setBlendEquationSeparate(y.opRgb,y.opAlpha),this.setBlendFunctionSeparate(y.srcRgb, y.dstRgb,y.srcAlpha,y.dstAlpha),y=y.color,this.setBlendColor(y.r,y.g,y.b,y.a)):this.setBlendingEnabled(!1)},setCulling:y=>{y?(this.setFaceCullingEnabled(!0),this.setCullFace(y.face),this.setFrontFace(y.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:y=>{y?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(y.factor,y.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:y=>{y?(this.setDepthTestEnabled(!0),this.setDepthFunction(y.func)):this.setDepthTestEnabled(!1)},setStencilTest:y=> {if(y){this.setStencilTestEnabled(!0);const x=y.function;this.setStencilFunction(x.func,x.ref,x.mask);y=y.operation;this.setStencilOp(y.fail,y.zFail,y.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:y=>{y?(this.setDepthWriteEnabled(!0),this.setDepthRange(y.zNear,y.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:y=>{y?this.setColorMask(y.r,y.g,y.b,y.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:y=>{y?this.setStencilWriteMask(y.mask):this.setStencilWriteMask(0)},setDrawBuffers:y=> {y?this.setDrawBuffers(y.buffers):({drawFramebuffer:y}=this._state,null===y?this.setDrawBuffers([d.SpecialDrawBuffers.BACK]):0===y.colorAttachments.length?this.setDrawBuffers([d.SpecialDrawBuffers.NONE]):this.setDrawBuffers([d.ColorAttachment.COLOR_ATTACHMENT0]))}});this.enforceState();g.disposeMaybe(this._driverTest);this._driverTest=new k.WebGLDriverTest(this)}dispose(){g.disposeMaybe(this._driverTest);this.programCache.dispose();this.bindVAO(null);this.unbindBuffer(d.BufferType.ARRAY_BUFFER);this.unbindBuffer(d.BufferType.ELEMENT_ARRAY_BUFFER); this.unbindBuffer(d.BufferType.UNIFORM_BUFFER);this._state.uniformBufferBindingPoints.length=0;this.unbindBuffer(d.BufferType.PIXEL_PACK_BUFFER);this.unbindBuffer(d.BufferType.PIXEL_UNPACK_BUFFER);this.unbindBuffer(d.BufferType.COPY_READ_BUFFER);this.unbindBuffer(d.BufferType.COPY_WRITE_BUFFER);this._state.textureUnitMap.length=0;m.webglDebugEnabled()&&console.log(this.instanceCounter.resourceInformation)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}setPipelineState(u){this._stateTracker.setPipeline(u)}setBlendingEnabled(u){this._state.blend!== u&&(!0===u?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=u,this._stateTracker.invalidateBlending())}externalProgramUpdate(){this._state.program?.stop();this._state.program=null}externalTextureUnitUpdate(u,y){for(let x=0;xA===u[z]))if(u.length>this.parameters.maxDrawBuffers)console.error("Setting more active draw buffers than GL.MAX_DRAW_BUFFERS allows.");else{if(x){if(1=this.parameters.maxTextureImageUnits|| 0>y)&&console.error("Input texture unit is out of range of available units!");const v=this._state.textureUnitMap[y];if(null==u?.glName)return null!=v&&(this.setActiveTexture(y,x),this.gl.bindTexture(v.descriptor.target,null)),this._state.textureUnitMap[y]=null,v;if(!x&&v===u)return u.isDirty&&(this.setActiveTexture(y,x),u.applyChanges()),v;this.setActiveTexture(y,x);this.gl.bindTexture(u.descriptor.target,u.glName);u.applyChanges();this._state.textureUnitMap[y]=u;return v}unbindTexture(u){if(null!= u)for(let y=0;y=this.parameters.maxUniformBufferBindings||0>y)return console.error("Uniform buffer binding point is out of range!"),null;u=u===d.BufferType.UNIFORM_BUFFER?this._state.uniformBufferBindingPoints:this._state.transformBufferBindingPoints; let x=u[y];null==x&&(x={buffer:null,offset:0,size:0},u[y]=x);return x}bindBufferBase(u,y,x){const v=this._getBufferBinding(u,y);null==v||v.buffer===x&&0===v.offset&&0===v.size||(this.gl.bindBufferBase(u,y,x?x.glName:null),v.buffer=x,v.offset=0,v.size=0)}bindBufferRange(u,y,x,v,A){const z=this._getBufferBinding(u,y);null==z||z.buffer===x&&z.offset===v&&z.size===A||(0!==v%this._parameters.uniformBufferOffsetAlignment?console.error("Uniform buffer binding offset is not a multiple of the context offset alignment"): (this.gl.bindBufferRange(u,y,x.glName,v,A),z.buffer=x,z.offset=v,z.size=A))}bindUBO(u,y,x,v){null==y?this.bindBufferBase(d.BufferType.UNIFORM_BUFFER,u,null):(m.webglDebugEnabled()&&(v??y.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),y.initialize(),void 0!==x&&void 0!==v?this.bindBufferRange(d.BufferType.UNIFORM_BUFFER,u,y.buffer,x,v):this.bindBufferBase(d.BufferType.UNIFORM_BUFFER,u,y.buffer))}unbindUBO(u){for(let y= 0,x=this._state.uniformBufferBindingPoints.length;yl+(b{q.has(l)||q.set(l,new Map);l=q.get(l);l.set(d??0,l.get(d??0)??1)});this._active.clear();let h=0;const m=[];q.forEach((l,d)=>{let b=0;l.forEach((a,f)=>b+=a*f);l.set(-1,b);h+=b;m.push([d,l])});q.clear();m.sort((l,d)=>d[1].get(-1)-l[1].get(-1));return m.reduce((l,[d,b])=>{const a=Math.round(b.get(-1)/1024);b.delete(-1);b=Array.from(b.values()).reduce((f, n)=>f+n,0);return l+=` ${a}KB from ${b} allocations at ${d}\n`},`Total unestimated ${this._objectType} memory: ${Math.round(h/1024)}KB\n`)}}e.AllocationTracer=g;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/Parameters":function(){define(["exports"],function(e){class g{constructor(q,h,m){h=h.textureFilterAnisotropic;m=m.maxAnisotropy??Infinity;this.versionString=q.getParameter(q.VERSION);this.maxVertexTextureImageUnits=q.getParameter(q.MAX_VERTEX_TEXTURE_IMAGE_UNITS); this.maxVertexAttributes=q.getParameter(q.MAX_VERTEX_ATTRIBS);this.maxMaxAnisotropy=h?Math.min(q.getParameter(h.MAX_TEXTURE_MAX_ANISOTROPY),m):1;this.maxTextureImageUnits=q.getParameter(q.MAX_TEXTURE_IMAGE_UNITS);this.maxTextureSize=q.getParameter(q.MAX_TEXTURE_SIZE);this.maxRenderbufferSize=q.getParameter(q.MAX_RENDERBUFFER_SIZE);this.maxViewportDims=q.getParameter(q.MAX_VIEWPORT_DIMS);this.maxUniformBufferBindings=q.getParameter(q.MAX_UNIFORM_BUFFER_BINDINGS);this.maxVertexUniformBlocks=q.getParameter(q.MAX_VERTEX_UNIFORM_BLOCKS); this.maxFragmentUniformBlocks=q.getParameter(q.MAX_FRAGMENT_UNIFORM_BLOCKS);this.maxUniformBlockSize=q.getParameter(q.MAX_UNIFORM_BLOCK_SIZE);this.uniformBufferOffsetAlignment=q.getParameter(q.UNIFORM_BUFFER_OFFSET_ALIGNMENT);this.maxArrayTextureLayers=q.getParameter(q.MAX_ARRAY_TEXTURE_LAYERS);this.maxSamples=q.getParameter(q.MAX_SAMPLES);this.maxDrawBuffers=q.getParameter(q.MAX_DRAW_BUFFERS)}}e.Parameters=g;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/renderState":function(){define(["exports", "../3d/webgl-engine/lib/basicInterfaces","./enums"],function(e,g,q){function h(L){return F.intern(L)}function m(L){return E.intern(L)}function l(L){return C.intern(L)}function d(L){return G.intern(L)}function b(L){return H.intern(L)}function a(L){return K.intern(L)}function f(L){return J.intern(L)}function n(L){return O.intern(L)}function c(L){return Q.intern(L)}function r(L){return"["+L.join(",")+"]"}function k(L){return L?r([L.srcRgb,L.srcAlpha,L.dstRgb,L.dstAlpha,L.opRgb,L.opAlpha,L.color.r,L.color.g, L.color.b,L.color.a]):null}function p(L){return L?r([L.face,L.mode]):null}function t(L){return L?r([L.factor,L.units]):null}function w(L){return L?r([L.func]):null}function u(L){return L?r([L.function.func,L.function.ref,L.function.mask,L.operation.fail,L.operation.zFail,L.operation.zPass]):null}function y(L){return L?r([L.zNear,L.zFar]):null}function x(L){return L?r([L.r,L.g,L.b,L.a]):null}function v(L){return L?r([L.mask]):null}function A(L){return L?r(L.buffers):null}const z={face:q.Face.BACK, mode:q.CullMode.CCW},B={face:q.Face.FRONT,mode:q.CullMode.CCW};class D{constructor(L,R){this._makeKey=L;this._makeRef=R;this._interns=new Map}intern(L){if(!L)return null;const R=this._makeKey(L),V=this._interns;V.has(R)||V.set(R,this._makeRef(L));return V.get(R)??null}}const F=new D(k,L=>({__tag:"Blending",...L})),E=new D(p,L=>({__tag:"Culling",...L})),C=new D(t,L=>({__tag:"PolygonOffset",...L})),G=new D(w,L=>({__tag:"DepthTest",...L})),H=new D(u,L=>({__tag:"StencilTest",...L})),K=new D(y,L=>({__tag:"DepthWrite", ...L})),J=new D(x,L=>({__tag:"ColorWrite",...L})),O=new D(v,L=>({__tag:"StencilWrite",...L})),Q=new D(A,L=>({__tag:"DrawBuffers",...L})),T=new D(function(L){return L?r([k(L.blending),p(L.culling),t(L.polygonOffset),w(L.depthTest),u(L.stencilTest),y(L.depthWrite),x(L.colorWrite),v(L.stencilWrite),A(L.drawBuffers)]):null},L=>({blending:h(L.blending),culling:m(L.culling),polygonOffset:l(L.polygonOffset),depthTest:d(L.depthTest),stencilTest:b(L.stencilTest),depthWrite:a(L.depthWrite),colorWrite:f(L.colorWrite), stencilWrite:n(L.stencilWrite),drawBuffers:c(L.drawBuffers)}));class I{constructor(L){this._drawBuffersInvalid=this._stencilWriteInvalid=this._colorWriteInvalid=this._depthWriteInvalid=this._stencilTestInvalid=this._depthTestInvalid=this._polygonOffsetInvalid=this._cullingInvalid=this._blendingInvalid=this._pipelineInvalid=!0;this._stateSetters=L}setPipeline(L){if(this._pipelineInvalid||L!==this._pipeline)this._setBlending(L.blending),this._setCulling(L.culling),this._setPolygonOffset(L.polygonOffset), this._setDepthTest(L.depthTest),this._setStencilTest(L.stencilTest),this._setDepthWrite(L.depthWrite),this._setColorWrite(L.colorWrite),this._setStencilWrite(L.stencilWrite),this._setDrawBuffers(L.drawBuffers),this._pipeline=L;this._pipelineInvalid=!1}invalidateBlending(){this._pipelineInvalid=this._blendingInvalid=!0}invalidateCulling(){this._pipelineInvalid=this._cullingInvalid=!0}invalidatePolygonOffset(){this._pipelineInvalid=this._polygonOffsetInvalid=!0}invalidateDepthTest(){this._pipelineInvalid= this._depthTestInvalid=!0}invalidateStencilTest(){this._pipelineInvalid=this._stencilTestInvalid=!0}invalidateDepthWrite(){this._pipelineInvalid=this._depthWriteInvalid=!0}invalidateColorWrite(){this._pipelineInvalid=this._colorWriteInvalid=!0}invalidateStencilWrite(){this._pipelineInvalid=this._stencilTestInvalid=!0}invalidateDrawBuffers(){this._pipelineInvalid=this._drawBuffersInvalid=!0}_setBlending(L){this._blending=this._setSubState(L,this._blending,this._blendingInvalid,this._stateSetters.setBlending); this._blendingInvalid=!1}_setCulling(L){this._culling=this._setSubState(L,this._culling,this._cullingInvalid,this._stateSetters.setCulling);this._cullingInvalid=!1}_setPolygonOffset(L){this._polygonOffset=this._setSubState(L,this._polygonOffset,this._polygonOffsetInvalid,this._stateSetters.setPolygonOffset);this._polygonOffsetInvalid=!1}_setDepthTest(L){this._depthTest=this._setSubState(L,this._depthTest,this._depthTestInvalid,this._stateSetters.setDepthTest);this._depthTestInvalid=!1}_setStencilTest(L){this._stencilTest= this._setSubState(L,this._stencilTest,this._stencilTestInvalid,this._stateSetters.setStencilTest);this._stencilTestInvalid=!1}_setDepthWrite(L){this._depthWrite=this._setSubState(L,this._depthWrite,this._depthWriteInvalid,this._stateSetters.setDepthWrite);this._depthWriteInvalid=!1}_setColorWrite(L){this._colorWrite=this._setSubState(L,this._colorWrite,this._colorWriteInvalid,this._stateSetters.setColorWrite);this._colorWriteInvalid=!1}_setStencilWrite(L){this._stencilWrite=this._setSubState(L,this._stencilWrite, this._stencilWriteInvalid,this._stateSetters.setStencilWrite);this._stencilTestInvalid=!1}_setDrawBuffers(L){this._drawBuffers=this._setSubState(L,this._drawBuffers,this._drawBuffersInvalid,this._stateSetters.setDrawBuffers);this._drawBuffersInvalid=!1}_setSubState(L,R,V,S){if(V||L!==R)S(L),this._pipelineInvalid=!0;return L}}e.StateTracker=I;e.backFaceCullingParams=z;e.cullingParams=L=>L===g.CullFaceOptions.Back?z:L===g.CullFaceOptions.Front?B:null;e.defaultColorWriteParams={r:!0,g:!0,b:!0,a:!0}; e.defaultDepthWriteParams={zNear:0,zFar:1};e.frontFaceCullingParams=B;e.makeBlending=h;e.makeColorWrite=f;e.makeCulling=m;e.makeDepthTest=d;e.makeDepthWrite=a;e.makeDrawBuffers=c;e.makePipelineState=function(L){return T.intern(L)};e.makePolygonOffset=l;e.makeStencilTest=b;e.makeStencilWrite=n;e.separateBlendingParams=function(L,R,V,S,X=q.BlendOperation.ADD,N=q.BlendOperation.ADD,P=[0,0,0,0]){return{srcRgb:L,srcAlpha:R,dstRgb:V,dstAlpha:S,opRgb:X,opAlpha:N,color:{r:P[0],g:P[1],b:P[2],a:P[3]}}};e.simpleBlendingParams= function(L,R,V=q.BlendOperation.ADD,S=[0,0,0,0]){return{srcRgb:L,srcAlpha:L,dstRgb:R,dstAlpha:R,opRgb:V,opAlpha:V,color:{r:S[0],g:S[1],b:S[2],a:S[3]}}};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/lib/basicInterfaces":function(){define(["exports"],function(e){e.CullFaceOptions=void 0;(function(g){g[g.None=0]="None";g[g.Front=1]="Front";g[g.Back=2]="Back";g[g.COUNT=3]="COUNT"})(e.CullFaceOptions||(e.CullFaceOptions={}));e.DepthTestFunction=void 0;(function(g){g[g.Less= 0]="Less";g[g.Lequal=1]="Lequal";g[g.COUNT=2]="COUNT"})(e.DepthTestFunction||(e.DepthTestFunction={}));e.RenderRequestType=void 0;(function(g){g[g.BACKGROUND=0]="BACKGROUND";g[g.UPDATE=1]="UPDATE"})(e.RenderRequestType||(e.RenderRequestType={}));e.ResourceState=void 0;(function(g){g[g.NOT_LOADED=0]="NOT_LOADED";g[g.LOADING=1]="LOADING";g[g.LOADED=2]="LOADED"})(e.ResourceState||(e.ResourceState={}));e.StencilBits=void 0;(function(g){g[g.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded";g[g.OutlineVisualElementMask= 2]="OutlineVisualElementMask"})(e.StencilBits||(e.StencilBits={}));e.Object3DState=void 0;(function(g){g[g.Highlight=0]="Highlight";g[g.MaskOccludee=1]="MaskOccludee";g[g.COUNT=2]="COUNT"})(e.Object3DState||(e.Object3DState={}));e.AlphaDiscardMode=void 0;(function(g){g[g.Blend=0]="Blend";g[g.Opaque=1]="Opaque";g[g.Mask=2]="Mask";g[g.MaskBlend=3]="MaskBlend";g[g.COUNT=4]="COUNT"})(e.AlphaDiscardMode||(e.AlphaDiscardMode={}));e.Decorations=void 0;(function(g){g[g.OFF=0]="OFF";g[g.ON=1]="ON"})(e.Decorations|| (e.Decorations={}));e.TextureEncodingMimeType=void 0;(function(g){g.DDS_ENCODING="image/vnd-ms.dds";g.KTX2_ENCODING="image/ktx2";g.BASIS_ENCODING="image/x.basis"})(e.TextureEncodingMimeType||(e.TextureEncodingMimeType={}));Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/WebGLDriverTest":function(){define(["exports","./testAppleAmdDrawArrays","./testDoublePrecisionArithmetic","./testFloatBufferBlend","./testSVGPremultipliedAlpha"],function(e,g,q,h,m){class l{constructor(d){this.rctx= d;this.floatBufferBlend=new h.FloatBufferBlend(d);this.svgPremultipliesAlpha=new m.SVGPremultipliedAlpha(d);this.doublePrecisionRequiresObfuscation=new q.DoublePrecisionRequiresObfuscation(d);this.drawArraysRequiresIndicesTypeReset=new g.DrawArraysRequiresIndicesTypeReset(d)}dispose(){this.doublePrecisionRequiresObfuscation.dispose();this.svgPremultipliesAlpha.dispose();this.floatBufferBlend.dispose();this.drawArraysRequiresIndicesTypeReset.dispose()}}e.WebGLDriverTest=l;Object.defineProperty(e,Symbol.toStringTag, {value:"Module"})})},"esri/views/webgl/testAppleAmdDrawArrays":function(){define("exports ../../core/has ../3d/webgl-engine/core/shaderModules/interfaces ./AppleAmdDriverHelper ./BufferObject ./enums ./FramebufferObject ./TextureDescriptor ./WebGLDriverTestModule".split(" "),function(e,g,q,h,m,l,d,b,a){class f extends a.WebGLDriverTestModule{constructor(n){super();this._rctx=n;this._helperProgram=null;g("mac")&&g("chrome")&&(this._program=this._prepareProgram(),this._helperProgram=this._prepareHelperProgram())}dispose(){super.dispose(); this._helperProgram?.dispose();this._helperProgram=null}_test(n){const c=this._rctx,r=c.getBoundFramebufferObject(),{x:k,y:p,width:t,height:w}=c.getViewport();c.resetState();var u=new b.TextureDescriptor(1);u.wrapMode=l.TextureWrapMode.CLAMP_TO_EDGE;u.samplingMode=l.TextureSamplingMode.NEAREST;u=new d.FramebufferObject(c,u);const y=m.BufferObject.createIndex(this._rctx,l.Usage.STATIC_DRAW,new Uint8Array([0]));c.bindFramebuffer(u);c.setViewport(0,0,1,1);c.useProgram(this._helperProgram);c.bindBuffer(y, l.BufferType.ELEMENT_ARRAY_BUFFER);c.drawElements(l.PrimitiveType.POINTS,1,l.DataType.UNSIGNED_BYTE,0);c.useProgram(n);c.bindVAO(null);c.drawArrays(l.PrimitiveType.TRIANGLES,0,258);n=new Uint8Array(4);u.readPixels(0,0,1,1,l.PixelFormat.RGBA,l.PixelType.UNSIGNED_BYTE,n);c.setViewport(k,p,t,w);c.bindFramebuffer(r);u.dispose();y.dispose();return 255===n[0]}_prepareProgram(){const n=`#version 300 es\n precision highp float;\n\n out float triangleId;\n\n const vec3 triangleVertices[3] = vec3[3](vec3(-0.5, -0.5, 0.0), vec3(0.5, -0.5, 0.0), vec3(0.0, 0.5, 0.0));\n\n void main(void) {\n triangleId = floor(float(gl_VertexID)/3.0);\n\n vec3 position = triangleVertices[gl_VertexID % 3];\n float offset = triangleId / ${q.glsl.float(85)};\n position.z = 0.5 - offset;\n\n gl_Position = vec4(position, 1.0);\n }\n `, c=`#version 300 es\n precision highp float;\n\n in float triangleId;\n\n out vec4 fragColor;\n\n void main(void) {\n fragColor = triangleId == ${q.glsl.float(85)} ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);\n }\n `;return this._rctx.programCache.acquire(n,c,new Map([]))}_prepareHelperProgram(){const n=h.AppleAmdDriverHelper.getShaderSources();return this._rctx.programCache.acquire(n.vertex,n.fragment,new Map([]))}}e.DrawArraysRequiresIndicesTypeReset=f;Object.defineProperty(e, Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/webgl-engine/core/shaderModules/interfaces":function(){define(["exports"],function(e){function g(m,...l){let d="";for(let b=0;bh.loseContext()}: null};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/LabelManager":function(){define("exports ../../chunks/tslib.es6 ../../core/Accessor ../../core/Error ../../core/has ../../core/Logger ../../core/accessorSupport/decorators/property ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ./engine/webgl/collisions/CollisionEngine".split(" "),function(e,g,q,h,m,l,d,b,a,f){e.LabelManager=class extends q{constructor(n){super(n);this._lastUpdate=0;this.collisionEngine= new f.CollisionEngine;this.lastUpdateId=-1;this.updateRequested=!1;this.view=null}get updating(){m("esri-2d-log-updating")&&console.log(`Updating LabelManager ${this.updateRequested}:\n-> updateRequested: ${this.updateRequested}`);return this.updateRequested}update(n){const c=performance.now();32<=c-this._lastUpdate?(this._lastUpdate=c,this.doUpdate(n)):this.requestUpdate()}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view?.requestUpdate())}processUpdate(n){this.updateRequested&& (this.updateRequested=!1,this.update(n))}doUpdate(n){const c=this.view;if(c)try{const r=n.state.scale,k=c.featuresTilingScheme.getClosestInfoForScale(r).level;this.collisionEngine.run(c.allLayerViews.items,n,r,k)}catch(r){}}};g.__decorate([d.property()],e.LabelManager.prototype,"updateRequested",void 0);g.__decorate([d.property()],e.LabelManager.prototype,"updating",null);g.__decorate([d.property()],e.LabelManager.prototype,"view",void 0);e.LabelManager=g.__decorate([a.subclass("esri.views.2d.LabelManager")], e.LabelManager);Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/collisions/CollisionEngine":function(){define(["exports","../../../../../core/has","../definitions","./CollisionGrid"],function(e,g,q,h){function m(b,a){b=b.children.slice();b.sort((f,n)=>f.tileAge-n.tileAge);b.forEach(f=>{null!=f.labelMetrics&&f.isReady&&a(f,f.labelMetrics)})}function l(b,a){return(!b.minScale||b.minScale>=a)&&(!b.maxScale||b.maxScale<=a)}class d{run(b,a,f,n){const c=[];for(let r= b.length-1;0<=r;r--){const k=b[r];k.labelingCollisionInfos?.length&&c.push(...k.labelingCollisionInfos)}g("esri-2d-update-debug")&&c.length&&console.debug("CollisionEngine.run");this._transformMetrics(c);this._runCollision(c,a,f,n);for(const r of c)r.container.requestRender()}_runCollision(b,a,f,n){const [c,r]=a.state.size,k=new h.CollisionBitsetGrid(c,r,a.pixelRatio);for(const {container:p,deconflictionEnabled:t,visible:w}of b){const u=p.attributeView;t?w?(this._prepare(p),this._collideVisible(k, p,f,n),this._collideInvisible(k,p)):m(p,(y,x)=>{for(const v of x)u.setLabelMinZoom(v.entityTexel,255)}):m(p,(y,x)=>{for(const v of x)l(v,f)?(u.setLabelMinZoom(v.entityTexel,0),w&&k.insertMetrics(v)):u.setLabelMinZoom(v.entityTexel,254)})}}_isFiltered(b,a,f){b=a.getFilterFlags(b);a=null==f.featureEffect||f.featureEffect.excludedLabelsVisible||!!(b&q.effectFlag0);return!((!f.hasFilter||b&q.filterFlag0)&&a)}_prepare(b){const a=b.attributeView,f=new Set;m(b,(n,c)=>{for(const r of c)n=r.entityTexel,f.has(n)|| (f.add(n),this._isFiltered(n,a,b.layerView)?a.setLabelMinZoom(n,254):0!==a.getLabelMinZoom(n)?a.setLabelMinZoom(n,255):a.setLabelMinZoom(n,0))})}_collideVisible(b,a,f,n){const c=a.attributeView,r=new Set;m(a,(k,p)=>{for(var t=0;t{for(var k=0;k{const k=a.attributeView;c=c.transforms.labelMat2d;c[4]=Math.round(c[4]);c[5]=Math.round(c[5]);const p="polyline"===f;for(const y of r){const {entityTexel:x,anchorX:v,anchorY:A}=y;var t=y.referenceBounds?.size??0;r=n[0];if(null!=r){var w=k.getVVSize(x);r=r(w);t=isNaN(r)||null==r||Infinity=== r?t:r}r=t/2*y.directionX;t=t/2*y.directionY;for(const z of y.bounds){w=v;var u=A;p?(w=w+z.x+r,u=u+z.y+t,w=c[0]*w+c[2]*u+c[4],u=c[1]*w+c[3]*u+c[5],z.computedX=Math.floor(w),z.computedY=Math.floor(u)):(w=c[0]*v+c[2]*A+c[4],u=c[1]*v+c[3]*A+c[5],u=u+z.y+t,z.computedX=w+z.x+r,z.computedY=u)}}})}}e.CollisionEngine=d;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/collisions/CollisionGrid":function(){define(["exports","../../../../../core/mathUtils","../definitions", "../../../layers/features/support/StaticBitSet"],function(e,g,q,h){class m{constructor(l,d,b){this._width=l*b;this._height=d*b;this._pixelRatio=b;l=Math.ceil(this._width/1);d=Math.ceil(this._height/1);this._cols=l;this._rows=d;this._cells=h.StaticBitSet.create(l*d)}insertMetrics(l){this._markMetrics(l)}hasCollision(l){let d=0;for(const {computedX:b,computedY:a,width:f,height:n}of l.bounds)switch(this._collide(b,a,(f+q.labelPlacementOffsetPadding)*this._pixelRatio,(n+q.labelPlacementOffsetPadding)* this._pixelRatio)){case 2:return 2;case 1:d++}return d===l.bounds.length?1:0}getCellId(l,d){return l+d*this._cols}has(l){return this._cells.has(l)}hasRange(l,d){return this._cells.hasRange(l,d)}set(l){this._cells.set(l)}setRange(l,d){this._cells.setRange(l,d)}_collide(l,d,b,a){l-=b/2;d-=a/2;b=l+b;var f=d+a;if(0>b||0>f||l>this._width||d>this._height)return 1;a=g.clamp(Math.floor(l/1),0,this._cols);var n=g.clamp(Math.floor(d/1),0,this._rows);l=g.clamp(Math.ceil(b/1),0,this._cols);d=g.clamp(Math.ceil(f/ 1),0,this._rows);for(b=n;b<=d;b++)for(f=a;f<=l;f++)if(n=this.getCellId(f,b),this.has(n))return 2;return 0}_mark(l,d,b,a,f){l-=b/2;d-=a/2;b=l+b;f=d+a;a=g.clamp(Math.floor(l/1),0,this._cols);d=g.clamp(Math.floor(d/1),0,this._rows);b=g.clamp(Math.ceil(b/1),0,this._cols);for(l=g.clamp(Math.ceil(f/1),0,this._rows);d<=l;d++)for(f=a;f<=b;f++){const n=this.getCellId(f,d);this.set(n)}return!1}_markMetrics(l){for(const {computedX:d,computedY:b,width:a,height:f}of l.bounds)this._mark(d,b,(a+q.labelPlacementOffsetPadding)* this._pixelRatio,(f+q.labelPlacementOffsetPadding)*this._pixelRatio,l.entityTexel)}}e.CollisionBitsetGrid=m;e.hasCollision=2;e.none=0;e.outsideExtent=1;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/features/support/StaticBitSet":function(){define(["exports"],function(e){class g{static fromBuffer(q,h){return new g(q,h)}static create(q,h=4294967295){q=new Uint32Array(Math.ceil(q/32));return new g(q,h)}constructor(q,h){this._mask=0;this._buf=q;this._mask=h}_getIndex(q){return Math.floor(q/ 32)}has(q){q&=this._mask;return!!(this._buf[this._getIndex(q)]&1<>>=1,l++}}countSet(){let q=0;this.forEachSet(h=>{q++});return q}} e.StaticBitSet=g;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/graphics/GraphicsView2D":function(){define("../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/arrayUtils ../../../../core/has ../../../../core/Identifiable ../../../../core/maybe ../../../../core/promiseUtils ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/accessorSupport/decorators/subclass ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/jsonUtils ../../../../layers/support/FieldsIndex ../../../../symbols/cim/CIMSymbolHelper ../../../../symbols/cim/OverrideHelper ../../../../symbols/support/defaults ../../engine/webgl/definitions ../../engine/webgl/FeatureTile ../../engine/webgl/mesh/MeshData ../../engine/webgl/mesh/factories/ResourceProxy ../../engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas ../features/schema/processor/StorageSchema ../features/support/AttributeStore ../features/support/ComputedAttributeStorage ../features/support/FeatureMetadata ../features/support/GraphicsReader ./GraphicStore ../support/FeatureCommandQueue ../support/UpdateTracking2D".split(" "), function(e,g,q,h,m,l,d,b,a,f,n,c,r,k,p,t,w,u,y,x,v,A,z,B,D,F,E,C,G,H){class K{static getOrCreate(J,O,Q){let T=O.get(J.id);T||(T=new K(J,Q),O.set(J.id,T));return T}static fromItems(J,O,Q){J=new K(J,Q);J.addedOrModified.push(...O);return J}constructor(J,O){this.tile=J;this.metadata=O;this.addedOrModified=[];this.removed=[]}get reader(){this._reader||(this._reader=E.GraphicsReader.from(this.addedOrModified,this.tile,this.metadata));return this._reader}}g=class extends m.IdentifiableMixin(g){constructor(J){super(J); this._attached=!1;this._tiles=new Map;this._controller=new AbortController;this._hashToSymbolInfo=new Map;this._lastCleanup=performance.now();this._cleanupRequired=!0;this.lastUpdateId=-1;this.renderer=null;this._updateTracking=new H.UpdateTracking2D({debugName:"GraphicsView2D"});this.updateRequested=!1;this.defaultPointSymbolEnabled=!0;this._commandQueue=new G({process:O=>{switch(O.type){case "update":return this._update();default:throw Error("InternalError: Unsupported command");}}});this.graphicUpdateHandler= this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy();this.renderer=this.view=null;this._set("graphics",null);this._controller.abort();this._graphicStore.clear();this._attributeStore=null;this._hashToSymbolInfo.clear();this._updateTracking.destroy();this._commandQueue.destroy()}_initAttributeStore(){this._storage=new D.ComputedAttributeStorage({spatialReference:this.view.spatialReference,fields:new k});this._attributeStore=new B.AttributeStore({isLocal:!0,update:O=>{h("esri-2d-update-debug")&& console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:O});this.container.attributeView.requestUpdate(O);this.container.requestRender();h("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:O})}});const J=z.createStorageSchema(null,[]);this._attributeStore.update(J,this._storage,null);this.container.checkHighlight=()=>this._attributeStore.hasHighlight}initialize(){this._initAttributeStore();this._metadata= F.GraphicsMetadata.create(this.view.spatialReference);this._resourceProxy=new v.ResourceProxy({fetch:J=>Promise.all(J.map(O=>this.view.stage.textureManager.rasterizeItem(O))),fetchDictionary:J=>{throw Error("InternalError: Graphics do not support Dictionary requests");}});this.addHandles([b.watch(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{this.addHandles([this.graphics.on("change",()=>this._pushUpdate())]); this._graphicStore=new C(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore);this._attached=!0;this.requestUpdate();this._pushUpdate()})]);this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);this._onTileUpdate({added:this.view.graphicsTileStore.tiles,removed:[]})}get _effectiveRenderer(){return"function"===typeof this.renderer?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){const J= !this._attached||this._updateTracking.updating;h("esri-2d-log-updating")&&console.log(`Updating GraphicsView2D: ${J}\n -> attaching ${!this._attached}\n -> updateTracking ${this._updateTracking.updating}`);return J}hitTest(J){if(!this.view||this.view.suspended)return[];const {resolution:O,rotation:Q}=this.view.state;J=this._graphicStore.hitTest(J.x,J.y,2,O,Q);const T=new Set(J),I=this.graphics.items.reduce((L,R)=>{T.has(R.uid)&&L.set(R.uid,R);return L},new Map);return J.map(L=>I.get(L)).filter(q.isSome)}requestUpdate(){this.updateRequested|| (this.updateRequested=!0,this.requestUpdateCallback());this.notifyChange("updating")}processUpdate(J){this.updateRequested&&(this.updateRequested=!1,this.update(J))}viewChange(){this.requestUpdate()}setHighlight(J){const O=[];for(const {objectId:Q,highlightFlags:T}of J){const I=this._graphicStore.getItem(Q)?.displayId;O.push({objectId:Q,highlightFlags:T,displayId:I})}this._attributeStore.setHighlight(O,J);this._pushUpdate()}graphicUpdateHandler(J){this._pushUpdate()}update(J){this.updateRequested= !1;this._attached&&this._graphicStore.updateLevel(J.state.resolution)}pushUpdate(){this._pushUpdate()}_pushUpdate(){d.ignoreAbortErrors(this._commandQueue.push({type:"update"}))}async _update(){try{h("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`);const J=await this._graphicStore.update(this.graphics,Q=>this._getSymbolForGraphic(Q),Q=>this._ensureSymbolResource(Q));if(!J.hasAnyUpdate()){this._attributeStore.sendUpdates();return}J.removed.length&&(this._cleanupRequired= !0);h("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,J);const O=this._createTileMessages(J);await this._fetchResources(O);this._write(O);for(const Q of J.added)this._setFilterState(Q);for(const Q of J.updated)this._setFilterState(Q);h("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,J);this._attributeStore.sendUpdates();h("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,J)}catch(J){}this._cleanupSharedResources()}_createTileMessages(J){const O= new Map;for(var Q of J.added){var T=this.view.graphicsTileStore.getIntersectingTiles(Q.bounds);for(const I of T)K.getOrCreate(I,O,this._metadata).addedOrModified.push(Q)}for(const I of J.updated){Q=this.view.graphicsTileStore.getIntersectingTiles(I.prevBounds);T=this.view.graphicsTileStore.getIntersectingTiles(I.bounds);for(const L of Q)K.getOrCreate(L,O,this._metadata).removed.push(I.displayId);for(const L of T)K.getOrCreate(L,O,this._metadata).addedOrModified.push(I)}for(const I of J.removed){J= this.view.graphicsTileStore.getIntersectingTiles(I.bounds);for(const L of J)K.getOrCreate(L,O,this._metadata).removed.push(I.displayId)}return Array.from(O.values())}async _fetchResources(J){for(const {tile:O,reader:Q}of J){h("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${O.id}] GraphicsView fetchResources`,J);const T=Q.getCursor();for(;T.next();)for(const I of T.getMeshWriters())I.enqueueRequest(this._resourceProxy,T,O.createArcadeEvaluationOptions(this.view.timeZone))}await this._resourceProxy.fetchEnqueuedResources()}_write(J){for(const O of J){h("esri-2d-update-debug")&& console.debug(`Id[${this.layerId}] Tile[${O.tile.id}] GraphicsView write`,O);J=this._writeMeshes(O);let Q=this._tiles.get(O.tile.key);Q||=this._createFeatureTile(O.tile.key);h("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${O.tile.id}] GraphicsView onTileData`,O);this.container.onTileData(Q,{type:"update",modify:J,remove:O.removed,end:!1,attributeEpoch:this._attributeStore.epoch});this.container.requestRender()}}_writeMeshes(J){const O=new x.MeshData(J.tile.id),Q=J.reader.getCursor(); for(;Q.next();){O.entityStart(Q.getDisplayId(),Q.getZOrder());for(const T of Q.getMeshWriters())T.write(O,this._resourceProxy,Q,J.tile.createArcadeEvaluationOptions(this.view.timeZone),J.tile.level);O.entityEnd()}return{...O.serialize().message,tileId:J.tile.id}}_setFilterState(J){const O=J.displayId,Q=this._attributeStore.getHighlightFlags(J.objectId);this._attributeStore.setData(O,0,0,Q|(J.visible?u.filterFlag0:0))}_getSymbolForGraphic(J){return null!=J.symbol?J.symbol:null!=this._effectiveRenderer? this._effectiveRenderer.getSymbol(J):this._getNullSymbol(J)}async _ensureSymbolResource(J){if(J.symbol){var O=await this._getSymbolInfo(J.symbol);if(O){var Q=O.linearCIM.filter(T=>"text"===T.type);0null));return this._hashToSymbolInfo.get(O)}async _createSymbolInfo(J, O){O=await this._convertToCIMSymbol(O);const Q=await this._createLinearCIM(O),T=await this._createMeshWriters(O,Q);return{hash:J,cimSymbol:O,linearCIM:Q,meshWriters:T}}async _convertToCIMSymbol(J){J=p.symbolToCIM(J);return"web-style"===J.type?(await J.fetchCIMSymbol()).data:J}async _createLinearCIM(J){await Promise.all(p.CIMSymbolHelper.fetchResources(J.symbol,this._cimResourceManager,[]));return this.view.stage.cimAnalyzer.analyzeSymbolReference(J,!1)}async _createMeshWriters(J,O){d.throwIfAborted(this._controller.signal); const Q=this.view.stage.meshWriterRegistry;J=await A.createGraphicSymbolMeshSchemas(J,O,this.container.instanceStore);return Promise.all(J.map(T=>Q.createMeshWriter(this._storage,this._resourceProxy,{tileInfo:this.view.featuresTilingScheme.tileInfo},T)))}_onTileUpdate(J){if(J.added&&0{({textString:X}=X.symbolLayers[0].markerGraphics[0]);T.push({type:"cim-rasterization-info", resource:{type:"text",textString:X||"",font:V.font}});R.text=V.textString=X||""});Q.push(L)}else T.push({type:"cim-rasterization-info",resource:V})}0this.view.stage.textureManager.rasterizeItem(R));J=await Promise.all(J);l.assertIsSome(J);Q=new Map;for(I=0;IJ- this._lastCleanup)){this._cleanupRequired=!1;this._lastCleanup=J;J=new Set;for(var O of this._graphicStore.items())J.add(O.symbolResource?.symbolInfo.hash);O=new Set(this._hashToSymbolInfo.keys());for(const Q of O.values())J.has(Q)||this._hashToSymbolInfo.delete(Q)}}}};e.__decorate([a.property()],g.prototype,"_effectiveRenderer",null);e.__decorate([a.property({constructOnly:!0})],g.prototype,"layerId",void 0);e.__decorate([a.property({constructOnly:!0})],g.prototype,"requestUpdateCallback",void 0); e.__decorate([a.property()],g.prototype,"container",void 0);e.__decorate([a.property({constructOnly:!0})],g.prototype,"graphics",void 0);e.__decorate([a.property()],g.prototype,"renderer",void 0);e.__decorate([a.property()],g.prototype,"_updateTracking",void 0);e.__decorate([a.property()],g.prototype,"updating",null);e.__decorate([a.property()],g.prototype,"view",void 0);e.__decorate([a.property()],g.prototype,"updateRequested",void 0);e.__decorate([a.property()],g.prototype,"defaultPointSymbolEnabled", void 0);return g=e.__decorate([n.subclass("esri.views.2d.layers.graphics.GraphicsView2D")],g)})},"esri/views/2d/engine/webgl/mesh/MeshData":function(){define(["exports","../DisplayEntity","../DisplayRecord","./VertexDataWriter","../util/Writer"],function(e,g,q,h,m){class l{constructor(d,b=0){this._id=d;this._sizeHint=b;this._entitySortKeyIndex=this._entityIdIndex=this._entityCountOffset=this._entityRecordCountOffset=0;this._didEntityStart=!1;this._instanceIdToVertexData=new Map;this._recordVertexCount= this._recordVertexStart=this._recordIndexCount=this._recordIndexStart=0;this._current={metric:null,writer:null,start:0,sortKey:0,instanceId:0,layoutHash:0,indexStart:0,vertexStart:0,textureKey:0,metricBoxLenPointer:0};this._entities=new m(Uint32Array,this._sizeHint*g.byteSizeHint);this._entityCountOffset=this._entities.push(0)}get id(){return this._id}serialize(){const d=[],b=[],a=this._entities.buffer();for(const f of this._instanceIdToVertexData.values())b.push(f.serialize(d));return{message:{data:b, entities:a},transferList:d}}vertexCount(){return this._current.writer?.vertexCount??0}indexCount(){return this._current.writer?.indexCount??0}vertexEnsureSize(d){this._current.writer.vertexEnsureSize(d)}indexEnsureSize(d){this._current.writer.indexEnsureSize(d)}vertexWrite(d){this._current.writer.writeVertex(d)}vertexWriteRegion(d){this._current.writer.writeVertexRegion(d)}vertexWriteF32(d){this._current.writer.writeVertexF32(d)}recordBounds(d,b,a,f){}indexWrite(d){this._current.writer.writeIndex(d)}metricStart(d){this._current.metric= d}metricEnd(){this._current.metric.bounds.length&&this._current.writer.writeMetric(this._current.metric)}metricBoxWrite(d){this._current.metric.bounds.push(d)}entityStart(d,b=d){this._entityIdIndex=this._entities.push(d);this._entitySortKeyIndex=this._entities.writeF32(b);this._entityRecordCountOffset=this._entities.push(0);this._didEntityStart=!0}entityRecordCount(){return this._entities.getValue(this._entityRecordCountOffset)}entityEnd(){this._didEntityStart&&(0===this.entityRecordCount()?this._entities.seek(this._entityIdIndex): this._entities.incr(this._entityCountOffset),this._didEntityStart=!1)}recordCount(){return this._entities.getValue(this._entityRecordCountOffset)}recordStart(d,b,a=0){this._current.writer=this._getVertexWriter(d,b);this._current.indexStart=this._current.writer.indexCount;this._current.vertexStart=this._current.writer.vertexCount;this._current.instanceId=d;this._current.layoutHash=b.hash;this._current.textureKey=a}recordEnd(d=0){const b=this._current.vertexStart,a=this._current.writer.vertexCount- b;if(!a)return!1;const f=this._current.indexStart,n=this._current.writer.indexCount-f;this._recordIndexStart=f;this._recordIndexCount=n;this._recordVertexStart=b;this._recordVertexCount=a;this._entities.incr(this._entityRecordCountOffset);q.write(this._entities,this._current.instanceId,this._current.textureKey,f,n,b,a,d);return!0}copyLast(d,b){var a=this._recordVertexStart+this._recordVertexCount;this._entities.incr(this._entityRecordCountOffset);q.write(this._entities,this._current.instanceId,this._current.textureKey, this._recordIndexStart+this._recordIndexCount,this._recordIndexCount,a,this._recordVertexCount,0);var f=this._current.writer.indexWriter;const n=this._current.writer.vertexWriter;var c=this._recordIndexStart+this._recordIndexCount,r=this._recordVertexCount;for(var k=this._recordIndexStart;k!==c;k++){const p=f.getValue(k);f.push(p+r)}f=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT;r=this._recordVertexStart*f;for(c=(this._recordVertexStart+this._recordVertexCount)*f;r!==c;r++)k=n.getValue(r), n.push(k);c=this._current.writer.layout.position;r=c.packPrecisionFactor??1;c=c.offset/Uint32Array.BYTES_PER_ELEMENT;d*=r;b*=r;for(a*=f;a<=n.length;a+=f)n.i1616Add(a+c,d,b)}copyLastFrom(d,b,a){var f=d._entities.getValue(d._entityIdIndex),n=this._entities.getValue(this._entityIdIndex);f!==n&&(n=d._entities.getValueF32(d._entitySortKeyIndex),this.entityStart(f,n));this.recordStart(d._current.instanceId,d._current.writer.layout,d._current.textureKey);f=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT; var c=this._current.vertexStart,r=d._current.vertexStart-c;const k=this._current.writer.indexWriter;n=this._current.writer.vertexWriter;const p=d._current.writer.indexWriter;var t=d._current.writer.vertexWriter;for(let w=d._current.indexStart;w!==p.length;w++){const u=p.getValue(w);k.push(u-r)}for(d=d._current.vertexStart*f;d!==t.length;d++)r=t.getValue(d),n.push(r);d=this._current.writer.layout.position;t=d.packPrecisionFactor??1;d=d.offset/Uint32Array.BYTES_PER_ELEMENT;b*=t;a*=t;for(c*=f;c<=n.length;c+= f)n.i1616Add(c+d,b,a);this.recordEnd()}_getVertexWriter(d,b){const a=this._instanceIdToVertexData;a.has(d)||a.set(d,new h.VertexDataWriter(d,b,this._sizeHint));return a.get(d)}}e.MeshData=l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/mesh/VertexDataWriter":function(){define(["exports","../util/Writer"],function(e,g){class q{constructor(h,m,l=0){const d=6*l*Uint32Array.BYTES_PER_ELEMENT;l=4*l*m.stride;const b=m.stride/4,a=m.attributes.find(f=>"pos"=== f.name||"position"===f.name);if(!a)throw Error("InternalError: Unable to find position attribute");this.layout={...m,position:a};this._indices=new g(Uint32Array,d);this._vertices=new g(Uint32Array,l);this._metrics=new g(Uint32Array,0);this._metricCountOffset=this._metrics.push(0);this._strideInt=b;this._instanceId=h}serialize(h){const m=this._indices.buffer(),l=this._vertices.buffer(),d=this._metrics.length?this._metrics.buffer():null;h.push(m,l);return{instanceId:this._instanceId,layout:this.layout, indices:m,vertices:l,metrics:d}}get strideInt(){return this._strideInt}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(h){this._vertices.ensureSize(h)}indexEnsureSize(h){this._indices.ensureSize(h)}writeIndex(h){this._indices.push(h)}writeVertex(h){this._vertices.push(h)}writeVertexRegion(h){this._vertices.writeRegion(h)}writeVertexF32(h){this._vertices.writeF32(h)}writeMetric(h){this._metrics.incr(this._metricCountOffset); h.serialize(this._metrics)}}e.VertexDataWriter=q;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/util/Writer":function(){define(function(){class e{get length(){return this._pos}constructor(g,q){this._pos=0;q=q?this._roundToNearest(q,g.BYTES_PER_ELEMENT):40;this._array=new ArrayBuffer(q);this._buffer=new g(this._array);this._ctor=g;this._i16View=new Int16Array(this._array)}_roundToNearest(g,q){g=Math.round(g);return 1===q?g:g+(q-g%q)}_ensureSize(g){if(this._pos+ g>=this._buffer.length){g=this._roundToNearest(1.25*(this._array.byteLength+g*this._buffer.BYTES_PER_ELEMENT),this._buffer.BYTES_PER_ELEMENT);g=new ArrayBuffer(g);const q=new this._ctor(g);q.set(this._buffer,0);this._array=g;this._buffer=q;this._i16View=new Int16Array(this._array)}}ensureSize(g){this._ensureSize(g)}writeF32(g){this._ensureSize(1);const q=this._pos;(new Float32Array(this._array,4*this._pos,1))[0]=g;this._pos++;return q}push(g){this._ensureSize(1);const q=this._pos;this._buffer[this._pos++]= g;return q}writeFixed(g){this._buffer[this._pos++]=g}setValue(g,q){this._buffer[g]=q}i1616Add(g,q,h){this._i16View[2*g]+=q;this._i16View[2*g+1]+=h}getValue(g){return this._buffer[g]}getValueF32(g){return(new Float32Array(this._array,4*g,1))[0]}incr(g){if(this._buffer.lengthx.value-v.value);var y=b.padStops(u,8);u=y.map(({value:x})=>x);y=y.map(({color:x})=>b.premultiplyColor(x));return{values:u,colors:y}}function n(u){if(!u.stops?.length)return null;u=u.stops.sort((x,v)=>x.value-v.value);var y=b.padStops(u,8);u=y.map(({value:x})=>x);y=y.map(({opacity:x})=>x);return{opacityValues:u,opacities:y}}function c(u){return{rotationType:"geographic"===u.rotationType?d.RotationType.Geographic: d.RotationType.Arithmatic}}function r(u){if(!u.stops?.length)return null;if(u.stops.some(v=>v.useMaxValue||v.useMinValue))return(v,A)=>{const z=v.statisticsByLevel.get(A.key.level);v=u.stops.map(B=>{const D=B.useMaxValue?z?.get(u.field)?.maxValue??0:B.useMinValue?z?.get(u.field)?.minValue??0:B.value;B=B.size?q.pt2px(B.size):l.nanMagicNumber;return{value:D,size:B}}).sort((B,D)=>B.value-D.value);A=b.padStops(v,8);v=A.map(({value:B})=>B);A=A.map(({size:B})=>B);return{values:v,sizes:A}};var y=u.stops.sort((v, A)=>v.value-A.value),x=b.padStops(y,8);y=x.map(({value:v})=>v);x=x.map(({size:v})=>q.pt2px(v));return{values:y,sizes:x}}function k(u){return y=>{({state:y}=y);return{unitValueToPixelsRatio:h.getMetersPerUnitForSR(y.spatialReference)/m.meterIn[u.valueUnit??"meters"]/y.resolution}}}function p(u,y){const x=y.length;if(u{B=z.state.scale;z=q.pt2px(p(B,v.stops));B=q.pt2px(p(B,A.stops));return{minMaxValueAndSize:[y,x,z,B]}};if("object"===typeof v||"object"===typeof A)throw Error("InternalError: Found a partial VisualVariableSizeMinMaxValue");return{minMaxValueAndSize:[y,x,q.pt2px(v),q.pt2px(A)]}}const w={visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null, visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null};e.createVisualVariableColor=f;e.createVisualVariableOpacity=n;e.createVisualVariableRotation=c;e.createVisualVariableSizeMinMaxValue=t;e.createVisualVariableSizeScaleStops=function(u){if(!u.stops?.length)return null;u=u.stops.sort((x,v)=>x.value-v.value);var y=b.padStops(u,8);u=y.map(({value:x})=>x);y=y.map(({size:x})=>q.pt2px(x));return{values:u,sizes:y}};e.createVisualVariableSizeStops= r;e.createVisualVariableSizeUnitValue=k;e.createVisualVariableUniforms=function(u){const y={...w};if(!(u&&"visualVariables"in u&&u.visualVariables))return y;for(const x of a.simplifyVisualVariables(u.visualVariables))switch(x.type){case "color":y.visualVariableColor=f(x);break;case "opacity":y.visualVariableOpacity=n(x);break;case "rotation":y.visualVariableRotation=c(x);break;case "size":switch(u=x,"number"===typeof u.minDataValue&&"number"===typeof u.maxDataValue&&null!=u.minSize&&null!=u.maxSize? "min-max":"$view.scale"===u?.valueExpression&&Array.isArray(u.stops)?"scale-stops":null==u.field&&"$view.scale"===u?.valueExpression||!(Array.isArray(u.stops)||"levels"in u&&u.levels)?null!=u.field||"$view.scale"!==u?.valueExpression?"unit-value":null:"field-stops"){case "field-stops":y.visualVariableSizeStops=r(x);break;case "scale-stops":"outline"===x.target?y.visualVariableSizeOutlineScaleStops=r(x):y.visualVariableSizeScaleStops=r(x);break;case "min-max":y.visualVariableSizeMinMaxValue=t(x);break; case "unit-value":y.visualVariableSizeUnitValue=k(x)}}return y};e.getMaxSizeVVSize=function(u,y=128,x=1.25){if(u.visualVariableSizeMinMaxValue)return u.visualVariableSizeMinMaxValue instanceof Function?128:Math.max(u.visualVariableSizeMinMaxValue.minMaxValueAndSize[3]*x,y);if(u.visualVariableSizeScaleStops){if(u.visualVariableSizeScaleStops instanceof Function)return 128;u=u.visualVariableSizeScaleStops.sizes;return Math.max(u[u.length-1]*x,y)}if(u.visualVariableSizeStops){if(u.visualVariableSizeStops instanceof Function)return 128;u=u.visualVariableSizeStops.sizes;return Math.max(u[u.length-1]*x,y)}return u.visualVariableSizeUnitValue?256:0};e.noVisualVariables=w;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/features/schema/processor/schemaUtils":function(){define(["exports"],function(e){e.padStops=function(g,q){g=g.slice(0,q);q-=g.length;for(let h=0;hq.getLogger("esri.views.2d.layers.features.support.rendererUtils"); e.isRendererSupported=function(b){if(!b)return!0;switch(b.type){case "heatmap":if(!l()){const a=m.getWebGLCapabilities();b=["supportsColorBufferFloat","supportsColorBufferFloatBlend","supportsColorBufferHalfFloat"].filter(f=>!a[f]).join(", ");d().errorOnce(new g("webgl-missing-extension",`Missing WebGL2 requirements for Heatmap: ${b}`));return!1}}return!0};e.simplifyVisualVariables=function(b){return b.map(a=>{if(("size"===a.type||"color"===a.type||"opacity"===a.type)&&null!=a.stops){a=a.clone(); var f=a.type;var n=a.stops??[];if(8>=n.length)f=n;else if(d().warn(`Found ${n.length} Visual Variable stops, but MapView only supports ${8}. Displayed stops will be simplified.`),16=z[t].value;)t++;var w=z[t],u=n[t-1],y=r-u.value;w=w.value===u.value?1:y/(w.value-u.value);"color"===f?(u=z[t],t=n[t-1],y=u.color.clone(),y.r=(1-w)*t.color.r+w*y.r,y.g=(1-w)*t.color.g+w*y.g,y.b= (1-w)*t.color.b+w*y.b,y.a=(1-w)*t.color.a+w*y.a,B.push({value:r,color:y,label:u.label})):"size"===f?(u=z[t],y=n[t-1],t=h.toPt(u.size),y=h.toPt(y.size),B.push({value:r,size:(1-w)*y+w*t,label:u.label})):(u=z[t],B.push({value:r,opacity:(1-w)*n[t-1].opacity+w*u.opacity,label:u.label}))}f=[A,...B,c]}else{var [x,...v]=n;for(f=v.pop();6c&&(c=p,n=k);v.splice(n,1)}f=[x,...v,f]}a.stops=f}return a})};Object.defineProperty(e,Symbol.toStringTag, {value:"Module"})})},"esri/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema":function(){define("exports ../../../../../../../symbols/cim/CIMSymbolHelper ../../../../../../../symbols/cim/defaultCIMValues ../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry ../VisualVariablesSchema ./utils".split(" "),function(e,g,q,h,m,l){function d(t){return t.minScale||t.maxScale?{minScale:t.minScale??0,maxScale:t.maxScale??0}:null}function b(t){if(null==t)return null;if(Array.isArray(t)){const [w, u,y,x]=t;return[w,u,y,255*x]}return"string"===typeof t?t:{...t,defaultValue:b(t?.defaultValue)}}function a(t,w,u,{scaleInfo:y,scaleExpression:x}){const v=l.hasSizeVVUniform(u);return[t.createMeshInfo({size:w.size,scaleX:w.scaleX,anchorX:w.anchorPoint.x,anchorY:w.anchorPoint.y,angle:w.rotation,color:b(w.color)??[0,0,0,0],colorLocked:w.colorLocked,frameHeight:w.frameHeight,widthRatio:w.widthRatio,scaleInfo:y,offsetX:w.offsetX,offsetY:w.offsetY,outlineColor:b(w.outlineColor)??[0,0,0,0],outlineSize:w.outlineWidth, referenceSize:w.referenceSize||q.defaultCIMValues.CIMVectorMarker.size,rotateClockwise:w.rotateClockwise,scaleFactor:x??1,sizeRatio:w.sizeRatio,alignment:w.alignment,isAbsoluteAnchorPoint:w.isAbsoluteAnchorPoint,scaleSymbolsProportionally:w.scaleSymbolsProportionally,sprite:w.spriteRasterizationParam,hasSizeVV:v,placement:w.markerPlacement,effects:w.effects?{type:"cim-effect-infos",effectInfos:w.effects}:null,transforms:w.transform,minPixelBuffer:m.getMaxSizeVVSize(u)})]}function f(t,w,{scaleInfo:u}){return[t.createMeshInfo({color:b(w.color)?? [0,0,0,0],scaleInfo:u,effects:w.effects?{type:"cim-effect-infos",effectInfos:w.effects}:null})]}function n(t,w,u,{scaleInfo:y}){if(!w.spriteRasterizationParam)throw Error("InternalError: Sprite should always be defined");u=!!w.hasUnresolvedReplacementColor&&(!u||w.colorLocked);u=w.sampleAlphaOnly&&!u;const x=w.spriteRasterizationParam;return[t.createMeshInfo({color:b(w.color)??[0,0,0,0],height:w.height,aspectRatio:w.scaleX,offsetX:w.offsetX,offsetY:w.offsetY,scaleX:1,scaleY:1,angle:w.angle,applyRandomOffset:w.applyRandomOffset, sampleAlphaOnly:u,scaleProportionally:"CIMHatchFill"===x.resource.type,sprite:x,scaleInfo:y,effects:w.effects?{type:"cim-effect-infos",effectInfos:w.effects}:null})]}function c(t,w,{scaleInfo:u}){return{color:b(t.color)??[0,0,0,0],width:t.width,referenceWidth:t.referenceWidth,capType:t.cap,joinType:t.join,miterLimit:t.miterLimit,scaleInfo:u,hasSizeVV:w,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null}}function r(t,w,u,y){if(w.spriteRasterizationParam)throw Error("InternalError: Sprite should not be defined"); w=c(w,u,y);return[t.createMeshInfo(w)]}function k(t,w,u,y){const {spriteRasterizationParam:x,scaleDash:v,sampleAlphaOnly:A}=w;if(!x)throw Error("InternalError: Sprite should be defined");return[t.createMeshInfo({...c(w,u,y),shouldScaleDash:v??!1,shouldSampleAlphaOnly:A,isSDF:"CIMPictureStroke"!==x.resource.type,sprite:x})]}function p(t,w,u,{scaleInfo:y,scaleExpression:x}){return[t.createMeshInfo({boxBackgroundColor:b(w.backgroundColor),boxBorderLineColor:b(w.borderLineColor),boxBorderLineSize:w.borderLineWidth?? 0,color:b(w.color)??[0,0,0,0],offsetX:w.offsetX,offsetY:w.offsetY,postAngle:w.angle,fontSize:w.size,referenceSize:w.referenceSize,decoration:w.decoration,haloColor:b(w.outlineColor)??[0,0,0,0],haloFontSize:w.outlineSize,lineWidth:w.lineWidth||512,lineHeightRatio:1,horizontalAlignment:w.horizontalAlignment??"center",verticalAlignment:w.verticalAlignment??"baseline",useCIMAngleBehavior:!1,glyphs:w.textRasterizationParam,scaleInfo:y,effects:w.effects?{type:"cim-effect-infos",effectInfos:w.effects}:null, placement:w.markerPlacement,transforms:w.transform,scaleFactor:x??1,minPixelBuffer:m.getMaxSizeVVSize(u),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,isLineLabel:!1})]}e.createComplexFillMeshInfos=n;e.createComplexMarkerMeshInfos=a;e.createComplexSimpleFillMeshInfos=f;e.createComplexSimpleLineMeshInfos=r;e.createComplexSymbolInstances=async function(t,w){const {cimResourceManager:u,cimAnalyzer:y,scaleExpression:x}=w.schemaOptions;await Promise.all(g.CIMSymbolHelper.fetchResources(t.symbol, u,[]));var v=y.analyzeSymbolReference(t,!1);t={scaleInfo:d(t),scaleExpression:x};const A=[];for(const C of v)switch(C.type){case "marker":v=A;var z=v.push;var B=C;var D=t;const {uniforms:G,schemaOptions:H}=w;var {store:F}=H;F=F.ensureInstance(h.Techniques.marker,{uniforms:B.isOutline?{...m.noVisualVariables,visualVariableSizeScaleStops:G.visualVariableSizeOutlineScaleStops}:{visualVariableColor:G.visualVariableColor,visualVariableOpacity:G.visualVariableOpacity,visualVariableSizeMinMaxValue:G.visualVariableSizeMinMaxValue, visualVariableSizeScaleStops:G.visualVariableSizeScaleStops,visualVariableSizeStops:G.visualVariableSizeStops,visualVariableSizeUnitValue:G.visualVariableSizeUnitValue,visualVariableRotation:G.visualVariableRotation},optionalAttributes:{zoomRange:!!D.scaleInfo}});B=a(F,B,G,D);z.call(v,...B);break;case "fill":v=A;z=v.push;a:{D=C;F=w;B=t;if(!D.spriteRasterizationParam){const {uniforms:T,schemaOptions:I}=F;({store:F}=I);F=F.ensureInstance(h.Techniques.fill,{uniforms:{visualVariableColor:D.colorLocked? null:T.visualVariableColor,visualVariableOpacity:T.visualVariableOpacity},optionalAttributes:{zoomRange:!!B.scaleInfo}});B=f(F,D,B);break a}const {uniforms:O,schemaOptions:Q}=F;({store:F}=Q);F=F.ensureInstance(h.Techniques.complexFill,{uniforms:{visualVariableColor:D.colorLocked?null:O.visualVariableColor,visualVariableOpacity:O.visualVariableOpacity},optionalAttributes:{zoomRange:!!B.scaleInfo}});B=n(F,D,null!=O.visualVariableColor,B)}z.call(v,...B);break;case "line":v=A;z=v.push;{B=C;D=t;const {uniforms:O, schemaOptions:Q}=w;var {store:E}=Q;F=B.isOutline?{...m.noVisualVariables,visualVariableSizeScaleStops:O.visualVariableSizeOutlineScaleStops}:{visualVariableColor:B.colorLocked?null:O.visualVariableColor,visualVariableOpacity:O.visualVariableOpacity,visualVariableSizeMinMaxValue:O.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:O.visualVariableSizeScaleStops,visualVariableSizeStops:O.visualVariableSizeStops,visualVariableSizeUnitValue:O.visualVariableSizeUnitValue};const T={uniforms:F,optionalAttributes:{zoomRange:!!D.scaleInfo}}; F=!!(F.visualVariableSizeMinMaxValue||F.visualVariableSizeScaleStops||F.visualVariableSizeStops||F.visualVariableSizeUnitValue);B.spriteRasterizationParam?(E=E.ensureInstance(h.Techniques.texturedLine,T),B=k(E,B,F,D)):(E=E.ensureInstance(h.Techniques.line,T),B=r(E,B,F,D))}z.call(v,...B);break;case "text":v=A;z=v.push;B=C;D=t;const {uniforms:K,schemaOptions:J}=w;({store:F}=J);F=F.ensureInstance(h.Techniques.text,{uniforms:{visualVariableColor:B.colorLocked?null:K.visualVariableColor,visualVariableOpacity:K.visualVariableOpacity, visualVariableRotation:K.visualVariableRotation,visualVariableSizeMinMaxValue:K.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:K.visualVariableSizeScaleStops,visualVariableSizeStops:K.visualVariableSizeStops,visualVariableSizeUnitValue:K.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!D.scaleInfo,referenceSymbol:!1,clipAngle:!1}});B=p(F,B,K,D);z.call(v,...B)}return A};e.createComplexTextMeshInfos=p;e.createComplexTexturedLineMeshInfos=k;e.getScaleInfo=d;Object.defineProperty(e, Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/features/schema/processor/symbols/utils":function(){define(["exports"],function(e){e.hasRotationVVUniform=function(g){return!!g.visualVariableRotation};e.hasSizeVVUniform=function(g){return!!(g.visualVariableSizeMinMaxValue||g.visualVariableSizeScaleStops||g.visualVariableSizeStops||g.visualVariableSizeUnitValue||g.visualVariableSizeOutlineScaleStops)};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/features/schema/processor/StorageSchema":function(){define(["exports", "../../../../../../core/arrayUtils","../../../../engine/webgl/enums","../../support/rendererUtils","../../../../../webgl/capabilities"],function(e,g,q,h,m){function l(r){switch(r){case "opacity":return q.VVBinding.OPACITY;case "color":return q.VVBinding.COLOR;case "rotation":return q.VVBinding.ROTATION;case "size":return q.VVBinding.SIZE;default:return null}}function d(r){if(!r)return[];switch(r.type){case "simple":case "class-breaks":case "unique-value":case "dictionary":return n(r);case "dot-density":return b(r); case "pie-chart":return a(r);case "heatmap":return f(r)}}function b(r){const k=[];for(const p of r.attributes)k.push({binding:k.length,expression:p.valueExpression,field:p.field});return k}function a(r){const k=n(r);let p=4;for(const t of r.attributes)k.push({binding:p++,expression:t.valueExpression,field:t.field});return k}function f({valueExpression:r,field:k}){return r||k?[{binding:0,expression:r,field:k}]:[]}function n(r){return"visualVariables"in r&&r.visualVariables?.length?h.simplifyVisualVariables(r.visualVariables).map(k=> c(k)).filter(g.isSome):[]}function c(r){switch(r.type){case "size":return r="$view.scale"===r.valueExpression?null:{binding:l(r.type),field:r.field,normalizationField:r.normalizationField,expression:r.valueExpression,valueRepresentation:r.valueRepresentation},r;case "color":return{binding:l(r.type),field:r.field,normalizationField:r.normalizationField,expression:r.valueExpression};case "opacity":return{binding:l(r.type),field:r.field,normalizationField:r.normalizationField,expression:r.valueExpression}; case "rotation":return{binding:l(r.type),expression:r.valueExpression,field:r.field}}}e.createDotDensityBindings=b;e.createHeatmapBindings=f;e.createPieChartBindings=a;e.createStorageSchema=function(r,k){const p=m.getWebGLCapabilities();return{type:"simple",filters:k,capabilities:{maxTextureSize:p.maxTextureSize},bindings:d(r)}};e.createVVBindings=n;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/features/support/AttributeStore":function(){define("exports ../../../../../core/Error ../../../../../core/has ../../../../../core/Logger ../../../../../core/accessorSupport/diffUtils ../../../engine/highlightReasons ../../../engine/webgl/definitions ../../../engine/webgl/DisplayId ../../../engine/webgl/Utils ../../../engine/webgl/shaderGraph/techniques/shaders/constants ../../../engine/webgl/util/debug ./DisplayIdGenerator ./FeatureFilter ../../../../webgl/enums".split(" "), function(e,g,q,h,m,l,d,b,a,f,n,c,r,k){function p(v,A){if(!v||!A)return v;switch(A){case "radius":case "distance":return 2*v;case "area":return Math.sqrt(v)}return v}const t=()=>h.getLogger("esri.views.layers.2d.features.support.AttributeStore"),w=n.createDebugLogger(n.DEBUG_ATTR_UPDATES,t());var u=q("esri-shared-array-buffer");q("esri-atomics");class y{constructor(v,A,z){this.size=0;this.texelSize=4;this.dirtyEnd=this.dirtyStart=0;const {pixelType:B,layout:D,textureOnly:F}=A;this.textureOnly=F||!1; this.pixelType=B;this.layout=D;this._resetRange();this.size=v;this.isLocal=z;F||(this.data=this._initData(B,v))}get buffer(){return this.data?.buffer}unsetComponentAllTexels(v,A){const z=this.data;for(let B=0;BA)return null;this._resetRange();const B= this.pixelType,D=this.layout,F=this.data;z=!this.isLocal&&F.slice(v*z,(A+1)*z)||null;return{start:v,end:A,data:z,pixelType:B,layout:D}}_initData(v,A){var z=ArrayBuffer;v=a.getPixelArrayCtor(v);A=new v(new z(A*A*4*v.BYTES_PER_ELEMENT));for(z=0;znull)}}get referencesScale(){return this._referencesScale}get referencesGeometry(){return this._referencesGeometry}get hasHighlight(){return 0E?r.create({geometryType:z.geometryType,hasM:!1,hasZ:!1,timeInfo:z.timeInfo,fieldsIndex:z.fieldsIndex,spatialReference:B??z.spatialReference,filterJSON:E}):null))),"subtype"===v.type){this._attributeComputeInfo={isSubtype:!0, subtypeField:v.subtypeField,map:new Map};this._referencesGeometry=this._referencesScale=!1;for(const E in v.bindings)await Promise.all(v.bindings[E].map(async C=>{C=await this._bind(A,C,parseInt(E,10));this._referencesGeometry=this._referencesGeometry||(C?.referencesGeometry()??!1);this._referencesScale=this._referencesScale||(C?.referencesScale()??!1)}))}else this._attributeComputeInfo={isSubtype:!1,map:new Map},await Promise.all(v.bindings.map(async E=>{E=await this._bind(A,E);this._referencesGeometry= this._referencesGeometry||(E?.referencesGeometry()??!1);this._referencesScale=this._referencesScale||(E?.referencesScale()??!1)}))}setHighlight(v,A){const z=this._getBlock(0);z.unsetComponentAllTexels(0,(1<{const C=1*E%4;E=this._getBlock(Math.floor(1*E/4)+d.AttributeDataType.VV);let G=F.field?.read(A,z);F.valueRepresentation&&(G=p(G,F.valueRepresentation));if(null===G||isNaN(G)||Infinity===G||-Infinity===G)G=f.nanMagicNumber;E.setData(B,C,G)}))}get epoch(){return this._epoch}sendUpdates(){const v=this._blocks.map(z=>null!=z?z.toMessage():null),A=this._getInitArgs();q("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start");this._client.update({initArgs:A, blockData:v,version:this.version,sendUpdateEpoch:this._epoch});this._epoch+=1;q("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(v){for(;v>=this._size*this._size&&!this._expand(););}async _bind(v,A,z){v=await v.createComputedField(A);const {valueRepresentation:B}=A,D=this._attributeComputeInfo;if(D.isSubtype){const F=D.map.get(z)??new Map;F.set(A.binding,{field:v,valueRepresentation:B});D.map.set(z,F)}else D.map.set(A.binding,{field:v,valueRepresentation:B}); return v}_getInitArgs(){if(this._initialized)return null;this._initialized=!0;this._getBlock(d.AttributeDataType.Animation);this._getBlock(d.AttributeDataType.GPGPU);return{blockSize:this._size,blockDescriptors:this._blocks.map(v=>null!=v?{textureOnly:v.textureOnly,buffer:v.buffer,pixelType:v.pixelType}:null)}}_getBlock(v){var A=this._blocks[v];if(null!=A)return A;w(`Initializing AttributeBlock at index ${v}`);A=new y(this._size,this._blockDescriptors[v],this._client.isLocal);this._blocks[v]=A;this._initialized= !1;return A}_expand(){if(this._sizeg&&((...h)=>q.warn("DEBUG:",...h))||(()=>null);Object.defineProperty(e,Symbol.toStringTag, {value:"Module"})})},"esri/views/2d/layers/features/support/DisplayIdGenerator":function(){define(["exports","../../../engine/webgl/DisplayId"],function(e,g){class q{constructor(m){this.data=m;this._referenceCount=0}increment(){this._referenceCount+=1}decrement(){--this._referenceCount}empty(){return 0===this._referenceCount}}class h{constructor(){this._freeIdsGenerationA=[];this._freeIdsGenerationB=[];this._idCounter=1;this._freeIds=this._freeIdsGenerationA;this._objectIdToDisplayId=new Map}createIdForObjectId(m){let l= this._objectIdToDisplayId.get(m);l?l.increment():(l=new q(g.createDisplayId(this._getFreeId(),!1)),l.increment(),this._objectIdToDisplayId.set(m,l));return l.data}releaseIdForObjectId(m){const l=this._objectIdToDisplayId.get(m);l&&(l.decrement(),l.empty()&&(this._objectIdToDisplayId.delete(m),this._freeIds.push(l.data)))}releaseAll(){for(const m of this._objectIdToDisplayId.values())this._freeIds.push(m.data);this._objectIdToDisplayId.clear()}incrementGeneration(){this._freeIds=this._freeIds===this._freeIdsGenerationA? this._freeIdsGenerationB:this._freeIdsGenerationA}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}e.DisplayIdGenerator=h;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/features/support/FeatureFilter":function(){define("../../../../../core/Error ../../../../../core/Logger ../../../../../geometry/support/aaBoundingRect ../../../../../geometry/support/boundsUtils ../../../../../layers/graphics/data/queryUtils ../../../../../layers/graphics/data/spatialQuerySupport ../../../../../layers/graphics/data/timeSupport ../../../../../rest/support/Query ../FeatureStoreQueryAdapter ./whereUtils".split(" "), function(e,g,q,h,m,l,d,b,a,f){class n{constructor(c){this._geometryBounds=q.create();this._idToVisibility=new Map;this._serviceInfo=c}static async create(c){const r=new n(c);await r.update(c.filterJSON,c.spatialReference);return r}get hash(){return this._hash}check(c){return this._applyFilter(c)}clear(){const c=this._resetAllHiddenIds();this.update();return{show:c,hide:[]}}invalidate(){this._idToVisibility.forEach((c,r)=>{this._idToVisibility.set(r,0)})}setKnownIds(c){for(const r of c)this._idToVisibility.set(r, 1)}setTrue(c){const r=[],k=[],p=new Set(c);this._idToVisibility.forEach((t,w)=>{t=!!(this._idToVisibility.get(w)&1);const u=p.has(w);!t&&u?r.push(w):t&&!u&&k.push(w);this._idToVisibility.set(w,u?3:0)});return{show:r,hide:k}}createQuery(){const {geometry:c,spatialRel:r,where:k,timeExtent:p,objectIds:t}=this;return b.fromJSON({geometry:c,spatialRel:r,where:k,timeExtent:p,objectIds:t})}async update(c,r){this._hash=JSON.stringify(c);c=await m.normalizeQueryLike(c,null,r);await Promise.all([this._setGeometryFilter(c), this._setIdFilter(c),this._setAttributeFilter(c),this._setTimeFilter(c)])}async _setAttributeFilter(c){c?.where?(this._clause=await f.createWhereClause(c.where,this._serviceInfo.fieldsIndex),this.where=c.where):this.where=this._clause=null}_setIdFilter(c){this._idsToShow=c?.objectIds&&new Set(c.objectIds);this._idsToHide=c?.hiddenIds&&new Set(c.hiddenIds);this.objectIds=c?.objectIds}async _setGeometryFilter(c){if(c?.geometry){var r=c.geometry;c=c.spatialRel||"esriSpatialRelIntersects";var k=await l.getSpatialQueryOperator(c, r,this._serviceInfo.geometryType,this._serviceInfo.hasZ,this._serviceInfo.hasM);h.getBoundsXY(this._geometryBounds,r);this._spatialQueryOperator=k;this.geometry=r;this.spatialRel=c}else this.spatialRel=this.geometry=this._spatialQueryOperator=null}_setTimeFilter(c){this.timeExtent=this._timeOperator=null;c?.timeExtent&&(this._serviceInfo.timeInfo?(this.timeExtent=c.timeExtent,this._timeOperator=d.getTimeOperator(this._serviceInfo.timeInfo,c.timeExtent,a.FeatureStoreQueryAdapter.Shared)):(c=new e("feature-layer-view:time-filter-not-available", "Unable to apply time filter, as layer doesn't have time metadata.",c.timeExtent),g.getLogger("esri.views.2d.layers.features.controllers.FeatureFilter").error(c)))}_applyFilter(c){return this._filterByGeometry(c)&&this._filterById(c)&&this._filterByTime(c)&&this._filterByExpression(c)}_filterByExpression(c){return this.where?this._clause(c):!0}_filterById(c){return(!this._idsToHide?.size||!this._idsToHide.has(c.getObjectId()))&&(!this._idsToShow?.size||this._idsToShow.has(c.getObjectId()))}_filterByGeometry(c){return this.geometry? (c=c.readGeometryWorldSpace())?this._spatialQueryOperator(c):!1:!0}_filterByTime(c){return null==this._timeOperator?!0:this._timeOperator(c)}_resetAllHiddenIds(){const c=[];this._idToVisibility.forEach((r,k)=>{r&1||(this._idToVisibility.set(k,1),c.push(k))});return c}}return n})},"esri/layers/graphics/data/queryUtils":function(){define("require exports ../../../core/jsonMap ../../../core/unitUtils ../../../geometry/projection ../../../geometry/support/extentUtils ../../../geometry/support/jsonUtils ../../../geometry/support/normalizeUtils ../../../geometry/support/spatialReferenceUtils ./projectionSupport".split(" "), function(e,g,q,h,m,l,d,b,a,f){async function n(w,u,y){if(!w)return null;var {where:x}=w;w.where=x=x?.trim();if(!x||/^1 *= *1$/.test(x)||u&&u===x)w.where=null;if(!w.geometry)return w;u=await r(w);w.distance=0;w.units=null;"esriSpatialRelEnvelopeIntersects"===w.spatialRel&&({spatialReference:x}=w.geometry,u=l.getGeometryExtent(u),u.spatialReference=x);if(u){await f.checkProjectionSupport(u.spatialReference,y);x=u.spatialReference;u=c(u,y)&&d.isExtent(u)?{spatialReference:x,rings:[[[u.xmin,u.ymin],[u.xmin, u.ymax],[u.xmax,u.ymax],[u.xmax,u.ymin],[u.xmin,u.ymin]]]}:u;x=(await b.normalizeCentralMeridian(d.fromJSON(u)))[0];if(null==x)throw t;const v="quantizationParameters"in w&&w.quantizationParameters?.tolerance||"maxAllowableOffset"in w&&w.maxAllowableOffset||0;u=v&&c(u,y)?{densificationStep:8*v}:void 0;x=x.toJSON();u=f.project(x,x.spatialReference,y,u);if(!u)throw t;u.spatialReference=y;w.geometry=u}return w}function c(w,u){if(!w)return!1;const y=w.spatialReference;return(d.isExtent(w)||d.isPolygon(w)|| d.isPolyline(w))&&!a.equals(y,u)&&!m.canProjectWithoutEngine(y,u)}async function r(w){const {distance:u,units:y}=w,x=w.geometry;if(null==u||"vertexAttributes"in x)return x;var v=x.spatialReference;w=y?p.fromJSON(y):h.getUnitString(v);v=v&&(a.isGeographic(v)||a.isWebMercator(v))?x:await f.checkProjectionSupport(v,a.wgs84).then(()=>f.project(x,a.wgs84));return(await k())(v.spatialReference,v,u,w)}async function k(){return(await new Promise((w,u)=>e(["../../../geometry/geometryEngineJSON"],w,u))).geodesicBuffer} const p=new q.JSONMap({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),t=Object.freeze({});g.normalizeQuery=async function(w,u,y){const {outFields:x,orderByFields:v,groupByFieldsForStatistics:A,outStatistics:z}=w;if(x)for(var B=0;Bnull!=u.geometry?u.geometry.spatialReference:null).filter(g.isSome):[t],await h.initializeProjection(t.map(u=>({source:u,dest:w}))))};e.project=function(t,w,u,y){if(!t)return t;u||(u=w,w=t.spatialReference);return l.isValid(w)&&l.isValid(u)&&!l.equals(w,u)?d.canProject(w,u)?(t=l.isWebMercator(u)?c(t):r(t),t.spatialReference=u,t):h.projectMany(m.jsonAdapter,[t],w,u,null,y)[0]:t};e.projectMany=function(t, w,u,y){return p.push(t,w,u,y)};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/geometryAdapters/json":function(){define(["exports"],function(e){class g{constructor(d,b,a){this.x=d;this.y=b;this.spatialReference=a;this.m=this.z=void 0}}class q{constructor(d,b,a,f){this.rings=d;this.spatialReference=b;this.hasM=this.hasZ=void 0;a&&(this.hasZ=a);f&&(this.hasM=f)}}class h{constructor(d,b,a,f){this.paths=d;this.spatialReference=b;this.hasM=this.hasZ=void 0;a&&(this.hasZ= a);f&&(this.hasM=f)}}class m{constructor(d,b,a,f){this.points=d;this.spatialReference=b;this.hasM=this.hasZ=void 0;a&&(this.hasZ=a);f&&(this.hasM=f)}}class l{constructor(d,b,a,f,n){this.xmin=d;this.ymin=b;this.xmax=a;this.ymax=f;this.spatialReference=n;this.mmax=this.mmin=this.zmax=this.zmin=void 0}}e.jsonAdapter={convertToGEGeometry:function(d,b){return null==b?null:d.convertJSONToGeometry(b)},exportPoint:function(d,b,a){a=new g(d.getPointX(b),d.getPointY(b),a);const f=d.hasZ(b),n=d.hasM(b);f&&(a.z= d.getPointZ(b));n&&(a.m=d.getPointM(b));return a},exportPolygon:function(d,b,a){return new q(d.exportPaths(b),a,d.hasZ(b),d.hasM(b))},exportPolyline:function(d,b,a){return new h(d.exportPaths(b),a,d.hasZ(b),d.hasM(b))},exportMultipoint:function(d,b,a){return new m(d.exportPoints(b),a,d.hasZ(b),d.hasM(b))},exportExtent:function(d,b,a){var f=d.hasZ(b);const n=d.hasM(b);a=new l(d.getXMin(b),d.getYMin(b),d.getXMax(b),d.getYMax(b),a);f&&(f=d.getZExtent(b),a.zmin=f.vmin,a.zmax=f.vmax);n&&(d=d.getMExtent(b), a.mmin=d.vmin,a.mmax=d.vmax);return a}};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/data/spatialQuerySupport":function(){define("require exports ../../../core/Error ../../../geometry/support/contains ../../../geometry/support/intersects ../../../geometry/support/jsonUtils ../../../geometry/support/spatialReferenceUtils ../contains ../featureConversionUtils ../OptimizedGeometry ./geometryUtils ./projectionSupport".split(" "),function(e,g,q,h,m,l,d,b,a,f,n, c){function r(){return new Promise((u,y)=>e(["../../../geometry/geometryEngineJSON"],u,y))}const k={esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"intersects",esriSpatialRelIndexIntersects:null,esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:null};var p={esriSpatialRelIntersects:!0,esriSpatialRelContains:!0, esriSpatialRelWithin:!0,esriSpatialRelCrosses:!0,esriSpatialRelDisjoint:!0,esriSpatialRelTouches:!0,esriSpatialRelOverlaps:!0,esriSpatialRelEnvelopeIntersects:!0,esriSpatialRelIndexIntersects:!1,esriSpatialRelRelation:!1},t={esriGeometryPoint:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!0},w={esriGeometryPoint:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!1};g.canQueryWithRBush=function(u){if(l.isExtent(u))return!0; if(l.isPolygon(u)){for(const y of u.rings)if(5!==y.length||y[0][0]!==y[1][0]||y[0][0]!==y[4][0]||y[2][0]!==y[3][0]||y[0][1]!==y[3][1]||y[0][1]!==y[4][1]||y[1][1]!==y[2][1])return!1;return!0}return!1};g.checkSpatialQuerySupport=async function(u,y,x){const {spatialRel:v,geometry:A}=u;if(A){if(null==v||!0!==p[v])throw new q("unsupported-query","Unsupported query spatial relationship",{query:u});if(d.isValid(A.spatialReference)&&d.isValid(x)){if(null==A||!0!==t[l.getJsonType(A)])throw new q("unsupported-query", "Unsupported query geometry type",{query:u});if(null==y||!0!==w[y])throw new q("unsupported-query","Unsupported layer geometry type",{query:u});if(u.outSR)return c.checkProjectionSupport(u.geometry?.spatialReference,u.outSR)}}};g.getSpatialQueryOperator=function(u,y,x,v,A){if(l.isPolygon(y)&&"esriGeometryPoint"===x&&("esriSpatialRelIntersects"===u||"esriSpatialRelContains"===u)){const z=a.convertFromPolygon(new f,y,!1,!1);return Promise.resolve(B=>b.polygonContainsPoint(z,!1,!1,B))}if(l.isPolygon(y)&& "esriGeometryMultipoint"===x){const z=a.convertFromPolygon(new f,y,!1,!1);if("esriSpatialRelContains"===u)return Promise.resolve(B=>b.polygonContainsMultipoint(z,!1,!1,B,v,A))}if(l.isExtent(y)&&"esriGeometryPoint"===x&&("esriSpatialRelIntersects"===u||"esriSpatialRelContains"===u))return Promise.resolve(z=>h.extentContainsPoint(y,n.getGeometry(x,v,A,z)));if(l.isExtent(y)&&"esriGeometryMultipoint"===x&&"esriSpatialRelContains"===u)return Promise.resolve(z=>h.extentContainsMultipoint(y,n.getGeometry(x, v,A,z)));if(l.isExtent(y)&&"esriSpatialRelIntersects"===u){const z=m.getExtentIntersector(x);return Promise.resolve(B=>z(y,n.getGeometry(x,v,A,B)))}return r().then(z=>{const B=z[k[u]].bind(null,y.spatialReference,y);return D=>B(n.getGeometry(x,v,A,D))})};Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/intersects":function(){define(["exports","./intersectsBase"],function(e,g){e.extentIntersectsExtent=g.extentIntersectsExtent;e.extentIntersectsMultipoint=g.extentIntersectsMultipoint; e.extentIntersectsPoint=g.extentIntersectsPoint;e.extentIntersectsPolygon=g.extentIntersectsPolygon;e.extentIntersectsPolyline=g.extentIntersectsPolyline;e.getFeatureExtentIntersector=g.getFeatureExtentIntersector;e.isSelfIntersecting=g.isSelfIntersecting;e.segmentIntersects=g.segmentIntersects;e.getExtentIntersector=function(q){return"mesh"===q?g.extentIntersectsExtent:g.getFeatureExtentIntersector(q)};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/contains":function(){define(["exports"], function(e){function g(q,h,m,l,d){if(!q)return!1;h=h?m?4:3:m?3:2;const {coords:b,lengths:a}=q;m=!1;q=0;for(const n of a){var f=q;for(let c=q,r=q+n*h;c=d||f=d)&&k+(d-p)/(f-p)*(t-k)"_geVersion"!== a?f:void 0;e.cleanFromGeometryEngine=function(a){return a&&"_geVersion"in a?JSON.parse(JSON.stringify(a,b)):a};e.getGeometry=function(a,f,n,c,r,k,p=f,t=n){const w=f&&p,u=n&&t;c=null!=c?"coords"in c?c:c.geometry:null;if(null==c)return null;if(r)return f=g.generalizeOptimizedGeometry(m,c,f,n,a,r,p,t),k&&(f=g.quantizeOptimizedGeometry(l,f,w,u,a,k)),d[a]?.(f,w,u)??null;if(k)return k=g.quantizeOptimizedGeometry(l,c,f,n,a,k,p,t),d[a]?.(k,w,u)??null;g.removeZMValues(h,c,f,n,p,t);return d[a]?.(h,w,u)??null}; e.transformCentroid=function(a,f,n,c=a.hasZ,r=a.hasM){if(null==f)return null;const k=a.hasZ&&c,p=a.hasM&&r;return n?(a=g.quantizeOptimizedGeometry(l,f,a.hasZ,a.hasM,"esriGeometryPoint",n,c,r),g.convertToPoint(a,k,p)):g.convertToPoint(f,k,p)};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/data/timeSupport":function(){define(["exports"],function(e){function g(m,l,d,b,a){if(null!=b&&null!=a)return f=>{const n=m(f,l);f=m(f,d);return(null==n||n<=a)&&(null==f||f>= b)};if(null!=b)return f=>{f=m(f,d);return null==f||f>=b};if(null!=a)return f=>{f=m(f,l);return null==f||f<=a}}function q(m,l,d,b){if(null!=d&&null!=b&&d===b)return a=>m(a,l)===d;if(null!=d&&null!=b)return a=>{a=m(a,l);return null!=a&&a>=d&&a<=b};if(null!=d)return a=>{a=m(a,l);return null!=a&&a>=d};if(null!=b)return a=>{a=m(a,l);return null!=a&&a<=b}}function h(){return()=>!1}e.getTimeExtent=async function(m,l){if(!m)return null;const d=l.featureAdapter,{startTimeField:b,endTimeField:a}=m;let f=Number.POSITIVE_INFINITY, n=Number.NEGATIVE_INFINITY;if(b&&a)await l.forEach(c=>{const r=d.getAttribute(c,b);c=d.getAttribute(c,a);null==r||isNaN(r)||(f=Math.min(f,r));null==c||isNaN(c)||(n=Math.max(n,c))});else{const c=b||a;await l.forEach(r=>{r=d.getAttribute(r,c);null==r||isNaN(r)||(f=Math.min(f,r),n=Math.max(n,r))})}return{start:f,end:n}};e.getTimeOperator=function(m,l,d){if(!l||!m)return null;const {startTimeField:b,endTimeField:a}=m;if(!b&&!a)return null;const {start:f,end:n}=l;if(null===f&&null===n)return null;if(void 0=== f&&void 0===n)return h();m=d.getAttributeAsTimestamp?.bind(d)??d.getAttribute.bind(d);return b&&a?g(m,b,a,f,n):q(m,b||a,f,n)};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/features/FeatureStoreQueryAdapter":function(){define(["exports"],function(e){class g{getObjectId(q){return q.getObjectId()}getAttributes(q){return q.readAttributes()}getAttribute(q,h){return q.readAttribute(h)}getAttributeAsTimestamp(q,h){return q.readAttributeAsTimestamp(h)}cloneWithGeometry(q, h){return q}getGeometry(q){return q.readGeometryWorldSpace()}getCentroid(q,h){return q.readCentroidForDisplay()}}g.Shared=new g;e.FeatureStoreQueryAdapter=g;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/features/support/whereUtils":function(){define(["exports","../../../../../core/Error","../../../../../core/Logger","../../../../../core/sql"],function(e,g,q,h){const m=()=>q.getLogger("esri.views.2d.layers.features.support.whereUtils"),l={getAttribute(d,b){return d.readAttribute(b)}}; e.createWhereClause=async function(d,b){try{const a=await h.parseWhereClause(d,b);if(!a.isStandardized){const f=new g("mapview - bad input","Unable to apply filter's definition expression, as expression is not standardized.",a);m().error(f)}return f=>{f=f.readArcadeFeature();try{return a.testFeature(f,l)}catch(n){return m().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",d),!0}}}catch(a){return m().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause", d),f=>!0}};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/features/support/ComputedAttributeStorage":function(){define("exports ../../../../../core/Error ../../../../../core/Logger ../../../../../geometry/support/aaBoundingBox ../../../engine/webgl/DisplayId ./CachedField ./ComputedExpression ./ComputedLegacyLabelExpression ./NormalizedField ./StaticBitSet ./whereUtils".split(" "),function(e,g,q,h,m,l,d,b,a,f,n){function c(p,t,w){if(!(p.length>t))for(;p.length<= t;)p.push(w)}const r=()=>q.getLogger("esri.views.2d.layers.features.support.ComputedAttributeStorage");class k{constructor(p){this._numerics=[];this._strings=[];this._allocatedSize=256;this._bitsets=[];this._instanceIds=[];this._bounds=[];this._dirtyBitset=this.getBitset(this.createBitset());this.compilationOptions=p}createBitset(){const p=this._bitsets.length;this._bitsets.push(f.StaticBitSet.create(this._allocatedSize,m.displayIdTexelMask));return p+1}async createComputedField(p,t=!1){if(p.expression)try{if(!this.compilationOptions)throw Error("InternalError: Compilation options not defined"); return t?b.ComputedLegacyLabelExpression.create(p.expression,this.compilationOptions):await d.ComputedExpression.create(p.expression,this.compilationOptions)}catch(w){return p=new g("featurelayer","Failed to compile arcade expression",{error:w,expression:p.expression}),r().error(p),null}if(p.normalizationType||p.normalizationField)return new a.NormalizedField(p.field,p);if(p.field)return new l.CachedField(p.field);p=new g("featurelayer","Unable to create computed field. No expression or field found", {info:p});r().error(p);return null}async createWhereClause(p){return p?n.createWhereClause(p,this.compilationOptions.fields):null}getBitset(p){return this._bitsets[p-1]}getComputedNumeric(p,t){return this.getComputedNumericAtIndex(p&m.displayIdTexelMask,0)}setComputedNumeric(p,t,w){return this.setComputedNumericAtIndex(p&m.displayIdTexelMask,w,0)}getComputedString(p,t){return this.getComputedStringAtIndex(p&m.displayIdTexelMask,0)}setComputedString(p,t,w){return this.setComputedStringAtIndex(p&m.displayIdTexelMask, 0,w)}getComputedNumericAtIndex(p,t){p&=m.displayIdTexelMask;this._ensureNumeric(t,p);return this._numerics[t][p]}setComputedNumericAtIndex(p,t,w){p&=m.displayIdTexelMask;this._ensureNumeric(t,p);this._numerics[t][p]=w}getPackedChunkId(p){p&=m.displayIdTexelMask;this._ensureInstanceId(p);return this._instanceIds[p]}setPackedChunkId(p,t){p&=m.displayIdTexelMask;this._ensureInstanceId(p);this._instanceIds[p]=t}getComputedStringAtIndex(p,t){p&=m.displayIdTexelMask;this._ensureString(t,p);return this._strings[t][p]}setComputedStringAtIndex(p, t,w){p&=m.displayIdTexelMask;this._ensureString(t,p);this._strings[t][p]=w}getXMin(p){return this._bounds[4*(p&m.displayIdTexelMask)]}getYMin(p){return this._bounds[4*(p&m.displayIdTexelMask)+1]}getXMax(p){return this._bounds[4*(p&m.displayIdTexelMask)+2]}getYMax(p){return this._bounds[4*(p&m.displayIdTexelMask)+3]}setBounds(p,t,w=!1){const u=p&m.displayIdTexelMask;if(!w&&!this._dirtyBitset.has(p))return 4294967295!==this._bounds[4*u];this._dirtyBitset.unset(p);p=t.readGeometryWorldSpace();c(this._bounds, 4*u+4,0);if(!p||!p.coords.length)return this._bounds[4*u]=4294967295,this._bounds[4*u+1]=4294967295,this._bounds[4*u+2]=4294967295,this._bounds[4*u+3]=4294967295,!1;let y=Infinity,x=Infinity,v=-Infinity,A=-Infinity;p.forEachVertex((z,B)=>{y=Math.min(y,z);x=Math.min(x,B);v=Math.max(v,z);A=Math.max(A,B)});this._bounds[4*u]=y;this._bounds[4*u+1]=x;this._bounds[4*u+2]=v;this._bounds[4*u+3]=A;return!0}getBounds(p,t){const w=this.getXMin(t),u=this.getYMin(t),y=this.getXMax(t);t=this.getYMax(t);h.fromRectValues(p, w,u,y,t);return 4294967295!==w}_ensureNumeric(p,t){this._numerics[p]||(this._numerics[p]=[]);c(this._numerics[p],t,0)}_ensureInstanceId(p){c(this._instanceIds,p,0)}_ensureString(p,t){this._strings[p]||(this._strings[p]=[]);c(this._strings[p],t,null)}}e.ComputedAttributeStorage=k;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/features/support/CachedField":function(){define(["exports","./AComputedField"],function(e,g){class q extends g.AComputedField{constructor(h){super(); this._field=h}resize(h){throw Error("Method not implemented.");}read(h,m){return h.readAttribute(this._field)}readWithDefault(h,m){return h.readAttribute(this._field)}referencesScale(){return!1}referencesGeometry(){return!1}}e.CachedField=q;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/features/support/ComputedExpression":function(){define(["exports","../../../../../core/string","../../../../../support/arcadeOnDemand","../../../arcade/callExpressionWithCursor", "./AComputedField"],function(e,g,q,h,m){class l extends m.AComputedField{static async create(d,b){b=await q.createRendererExpression(d,b.spatialReference,b.fields);d=g.numericHash(d);return new l(b,d)}constructor(d,b){super();this._compiled=d;this._cacheKey=b}resize(d){}read(d,b){return this.referencesScale()||"system"!==b.$view.timeZone?h.callExpressionWithCursor(this._compiled,d,b):this._readCached(d,b)}readWithDefault(d,b,a){return this.referencesScale()||"system"!==b.$view.timeZone?h.callExpressionWithCursorWithDefault(this._compiled, d,b,a):this._readWithDefaultCached(d,b,a)}referencesScale(){return this._compiled?.referencesScale()??!1}referencesGeometry(){return this._compiled?.referencesGeometry()??!1}_readCached(d,b){d.setCache(this._cacheKey);if(d.hasCachedValue())return d.getCachedValue();b=h.callExpressionWithCursor(this._compiled,d,b);d.setCachedValue(b);return b}_readWithDefaultCached(d,b,a){d.setCache(this._cacheKey);if(d.hasCachedValue())return d.getCachedValue();b=h.callExpressionWithCursorWithDefault(this._compiled, d,b,a);d.setCachedValue(b);return b}}e.ComputedExpression=l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/arcade/callExpressionWithCursor":function(){define(["exports","../../../core/has","../../../core/Logger"],function(e,g,q){function h(m){return null==m||Infinity===m||-Infinity===m||"number"===typeof m&&isNaN(m)}e.callExpressionWithCursor=function(m,l,d){if(null==m)return null;const b=l.readArcadeFeature();l.contextTimeZone=d.$view?.timeZone;try{return m.evaluate({...d, $feature:b},m.services)}catch(a){return q.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",a),null}};e.callExpressionWithCursorWithDefault=function(m,l,d,b){if(null==m)return null!=b?b:null;const a=l.readArcadeFeature();l.contextTimeZone=d.$view?.timeZone;m=m.evaluate({...d,$feature:a},m.services);return h(m)?null!=b?b:null:m};e.isBadArcadeResult=h;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/features/support/ComputedLegacyLabelExpression":function(){define(["exports", "../../../../../layers/support/labelFormatUtils","../../../../../layers/support/labelUtils","../../../arcade/callExpressionWithCursor","./AComputedField"],function(e,g,q,h,m){class l extends m.AComputedField{static async create(d,b){const a=q.sqlToTemplateString(d);return new l(f=>a.replaceAll(/{[^}]*}/g,n=>{const c=n.slice(1,-1),r=f.metadata.fieldsIndex.get(c);if(null==r)return n;n=f.readAttribute(c);return null==n?"":g.formatField(n,r)}))}constructor(d){super();this._evaluator=d}resize(d){}read(d, b){return this._evaluator(d)}readWithDefault(d,b,a){d=this._evaluator(d);return h.isBadArcadeResult(d)?a:d}referencesScale(){return!1}referencesGeometry(){return!1}}e.ComputedLegacyLabelExpression=l;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/labelFormatUtils":function(){define("exports ../../core/Error ../../core/Logger ../../core/sql ../../intl/date ../../intl/number ./domainUtils ./fieldUtils ./labelUtils ../../support/arcadeOnDemand".split(" "),function(e, g,q,h,m,l,d,b,a,f){function n(p,t){if(null==p)return"";const w=t.domain;if(w)if("codedValue"===w.type||"coded-value"===w.type)for(var u of w.codedValues){if(u.code===p)return u.name}else if("range"===w.type){const {max:y,min:x}=d.getDomainRange(t);u=+p;if(null!=x&&null!=y&&x<=u&&u<=y)return w.name}b.isDateField(t)?p=m.formatDate(p,m.convertDateFormatToIntlOptions("short-date")):b.isNumericField(t)&&(p=l.formatNumber(+p));return p||""}const c=()=>q.getLogger("esri.layers.support.labelFormatUtils"), r={type:"simple",evaluate(){return null}},k={getAttribute(p,t){return p.field(t)}};e.createLabelFunction=async function(p,t,w){if(!p||!p.symbol||!t)return r;const u=p.where,y=a.getLabelExpression(p);if("arcade"===y.type){const x=await f.createLabelExpression(y.expression,w,t);if(null==x)return r;p={type:"arcade",evaluate(v,A){try{const z="attributes"in v?x.repurposeFeature(v):v;z.contextTimeZone=A??null;const B=x.evaluate({$view:{timeZone:A},$feature:z},x.services);if(null!=B)return B.toString()}catch(z){c().error(new g("arcade-expression-error", "Encountered an error when evaluating label expression for feature",{error:z,feature:v,expression:y}))}return null},needsHydrationToEvaluate(){return null==a.getSingleFieldArcadeExpression(y.expression)}}}else p={type:"simple",evaluate(x){return y.expression.replaceAll(/{[^}]*}/g,v=>{var A=v.slice(1,-1);A=t.get(A);if(!A)return v;v=null;"attributes"in x?x&&x.attributes&&(v=x.attributes[A.name]):v=x.field(A.name);return null==v?"":n(v,A)})}};if(u){let x;try{x=await h.parseWhereClause(u,t)}catch(A){return c().error(new g("bad-where-clause", "Encountered an error when evaluating where clause, ignoring",{where:u,error:A})),r}const v=p.evaluate;p.evaluate=(A,z)=>{const B="attributes"in A?void 0:k;try{if(x.testFeature(A,B))return v(A,z)}catch(D){c().error(new g("bad-where-clause","Encountered an error when evaluating where clause for feature",{where:u,feature:A,error:D}))}return null}}return p};e.formatField=n;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/features/support/NormalizedField":function(){define(["exports", "./AComputedField"],function(e,g){class q extends g.AComputedField{constructor(h,m){super();this._field=h;this._normalizationInfo=m}resize(h){throw Error("Method not implemented.");}read(h,m){return this._readNormalized(h)}readWithDefault(h,m){return this._readNormalized(h)}referencesScale(){return!1}referencesGeometry(){return!1}_readNormalized(h){const m=h.readAttribute(this._field);if(null==m)return null;const {normalizationField:l,normalizationTotal:d,normalizationType:b}=this._normalizationInfo; h=h.readAttribute(l);switch(b??"esriNormalizeByField"){case "esriNormalizeByField":return h?(h||void 0)&&m/h:null;case "esriNormalizeByLog":return Math.log(m)*Math.LOG10E;case "esriNormalizeByPercentOfTotal":return d?m/d*100:null}}}e.NormalizedField=q;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/features/support/FeatureMetadata":function(){define(["exports","../../../../../geometry/SpatialReference","../../../../../layers/support/FieldsIndex"],function(e,g, q){class h{static minimal(l,d,b=[]){return new h({geometryType:l,fields:b,objectIdField:d,subtypes:null,subtypeField:null,types:null,globalIdField:null,spatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null})}constructor(l){this._options=l;this._fieldsIndex="fieldsIndex"in l?q.fromJSON(l.fieldsIndex):new q(l.fields);l.spatialReference&&(this._spatialReference=g.fromJSON(l.spatialReference));this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex, geometryType:this.geometryType,objectIdField:this.objectIdField,globalIdField:this._options.globalIdField,spatialReference:this._spatialReference,timeInfo:this._options.timeInfo,typeIdField:this._options.typeIdField??void 0,types:this._options.types??void 0,subtypeField:this._options.subtypeField,subtypes:this._options.subtypes??void 0}}get fieldsIndex(){return this._fieldsIndex}get geometryType(){return this._options.geometryType}get subtypeField(){return this._options.subtypeField}get timeInfo(){return this._options.timeInfo}get objectIdField(){return this._options.objectIdField}get globalIdField(){return this._options.globalIdField}get arcadeSchema(){return this._arcadeSchema}get spatialReference(){return this._spatialReference}get timeReferenceUnknownClient(){return this._options.timeReferenceUnknownClient}} class m extends h{static create(l){return new m({fields:[],objectIdField:"uid",geometryType:null,spatialReference:l,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:null})}}e.FeatureMetadata=h;e.GraphicsMetadata=m;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/features/support/GraphicsReader":function(){define("exports ../../../../../geometry/support/centroid ../../../../../geometry/support/jsonUtils ../../../../../layers/graphics/featureConversionUtils ../../../../../layers/graphics/OptimizedGeometry ../../../engine/webgl/definitions ./FeatureSetReader".split(" "), function(e,g,q,h,m,l,d){class b extends d.FeatureSetReader{static from(a,f,n){return new b(a,f,n)}constructor(a,f,n){super(n);this._items=a;this._tile=f;this._index=-1;this._cachedGeometry=null;a=f.lod;a.wrap&&(this._wrappingInfo={worldSizeX:a.worldSize[0]})}get _current(){return this._items[this._index]}getItem(){return this._current}getZOrder(){return this._current.zOrder}getMeshWriters(){return this._current.symbolResource?.symbolInfo.meshWriters??[]}hasField(a){return null!=this._current.attributes[a]}field(a){return this.readAttribute(a)}get geometryType(){const a= q.getJsonType(this._current.geometry);return"esriGeometryPoint"===a?"esriGeometryMultipoint":a}getCursor(){return this.copy()}copy(){const a=new b(this._items,this._tile,this.metadata);this.copyInto(a);return a}copyInto(a){super.copyInto(a);a._cachedGeometry=this._cachedGeometry;a._index=this._index}get fields(){throw Error("Fields reading not supported to graphics.");}get hasFeatures(){return!!this._items.length}get hasNext(){return this._index+1l.tileSize*(c-1)&&(a[f]=n-l.tileSize*c)}_readX(){const a=this._readGeometry();return null!=a?a.coords[0]:0}_readY(){const a=this._readGeometry();return null!=a?a.coords[1]:0}_readServerCentroid(){switch(this.geometryType){case "esriGeometryPolygon":var a=g.polygonCentroid(this._current.projectedGeometry); a=new m([],a);return h.quantizeOptimizedGeometry(new m,a,this.hasZ,this.hasM,this.geometryType,this._tile.transform);case "esriGeometryPolyline":return a=g.ringsCentroid(this._current.projectedGeometry.paths,this.hasZ),a=new m([],a),h.quantizeOptimizedGeometry(new m,a,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}return null}_readAttribute(a,f){f=this._current.attributes[a];if(void 0!==f)return f;a=a.toLowerCase();for(const n in this._current.attributes)if(n.toLowerCase()===a)return this._current.attributes[n]}_readAttributes(){return this._current.attributes}} e.GraphicsReader=b;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/features/support/FeatureSetReader":function(){define("exports ../../../../../geometry ../../../../../arcade/ArcadeDate ../../../../../core/has ../../../../../core/maybe ../../../../../core/sql/DateOnly ../../../../../core/sql/TimeOnly ../../../../../geometry/GeometryCursor ../../../../../geometry/support/aaBoundingBox ../../../../../geometry/support/labelPoint ../../../../../layers/graphics/centroid ../../../../../layers/graphics/featureConversionUtils ../../../../../layers/graphics/OptimizedFeature ../../../../../layers/graphics/OptimizedGeometry ../../../../../time/timeZoneUtils ./FeatureSetCache ./StaticBitSet ../../../../../geometry/support/jsonUtils".split(" "), function(e,g,q,h,m,l,d,b,a,f,n,c,r,k,p,t,w,u){function y(H,K,J){if(!(H.length>K))for(;H.length<=K;)H.push(J)}g=h("featurelayer-simplify-thresholds")??[.5,.5,.5,.5];const x=g[0],v=g[1],A=g[2],z=g[3];g=h("featurelayer-simplify-payload-size-factors")??[1,2,4];const B=g[0],D=g[1],F=g[2],E=h("featurelayer-simplify-mobile-factor")??2,C=h("esri-mobile");class G{constructor(H){this.metadata=H;this.type="FeatureSetReader";this._deleted=null;this._joined=[];this._objectIdToIndex=null;this._boundsBuffer=[]; this._caches=new Map;this.arcadeDeclaredClass="esri.arcade.Feature";this._contextTimeZone=null}get isEmpty(){return null!=this._deleted&&this._deleted.countSet()===this.getSize()}getAreaSimplificationThreshold(H,K){let J=1;const O=C?E:1;4E6{T=Math.min(T,V);I=Math.min(I,S);L=Math.max(L,V);R=Math.max(R,S)});this.setBoundsXMin(T);this.setBoundsYMin(I);this.setBoundsXMax(L);this.setBoundsYMax(R);a.fromRectValues(H,T,I,L,R);return!0}K=this.getBoundsXMin();const J=this.getBoundsYMin(),O=this.getBoundsXMax(),Q=this.getBoundsYMax();a.fromRectValues(H,K,J,O,Q);return!0}getBoundsXMin(){return this._boundsBuffer[4* this.getIndex()]}setBoundsXMin(H){this._boundsBuffer[4*this.getIndex()]=H}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(H){this._boundsBuffer[4*this.getIndex()+1]=H}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(H){this._boundsBuffer[4*this.getIndex()+2]=H}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(H){this._boundsBuffer[4*this.getIndex()+3]=H}readAttributeAsTimestamp(H){H=this.readAttribute(H);return"string"=== typeof H?(new Date(H)).getTime():"number"===typeof H||null==H?H:null}readAttribute(H,K=!1){var J=this._readAttribute(H,K);if(void 0!==J)return J;for(const O of this._joined)if(O.setIndex(this.getIndex()),J=O._readAttribute(H,K),void 0!==J)return J}readAttributes(){const H=this._readAttributes();for(const K of this._joined){K.setIndex(this.getIndex());const J=K._readAttributes();for(const O of Object.keys(J))H[O]=J[O]}return H}joinAttributes(H){this._joined.push(H)}removeIds(H){if(null==this._objectIdToIndex){var K= new Map;const J=this.getCursor();for(;J.next();){const O=J.getObjectId();m.assertIsSome(O);K.set(O,J.getIndex())}this._objectIdToIndex=K}K=this._objectIdToIndex;for(const J of H.values())K.has(J)&&this._removeAtIndex(K.get(J))}readOptimizedFeatureWorldSpace(){var H=this.readGeometryWorldSpace();const K=this.readAttributes(),J=this.readCentroidWorldSpace();H=new r.OptimizedFeature(H,K,J);H.objectId=this.getObjectId();H.displayId=this.getDisplayId();return H}readLegacyFeatureForDisplay(){const H=this.readCentroidForDisplay(); return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(H&&{x:H.coords[0],y:H.coords[1]})??null}}readLegacyFeatureWorldSpace(){const H=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(H&&{x:H.coords[0],y:H.coords[1]})??null}}readLegacyGeometryForDisplay(){const H=this.readGeometryForDisplay();return c.convertToGeometry(H,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const H= this._readX(),K=this.getInTransform();return null==K?H:H*K.scale[0]+K.translate[0]}readYWorldSpace(){const H=this._readY(),K=this.getInTransform();return null==K?H:K.translate[1]-H*K.scale[1]}readGeometryForDisplay(){var H=this._readGeometryDeltaDecoded(!0);return H?H:(H=this._createGeometryFromServerCentroid())?H.deltaDecode():null}readGeometryWorldSpace(){var H=this._readGeometry();H||=this._createGeometryFromServerCentroid();if(!H)return null;H=H.clone();const K=this.getInTransform();null!=K&& c.unquantizeOptimizedGeometry(H,H,this.hasZ,this.hasM,K);return H}readCentroidForDisplay(){const H=this.readGeometryForDisplay();return H?this._computeDisplayCentroid(H):this._readServerCentroid()}readCentroidWorldSpace(){var H=this.readGeometryForDisplay();H=H?this._computeDisplayCentroid(H):this._readServerCentroid();if(!H)return null;H=H.clone();const K=this.getInTransform();null!=K&&c.unquantizeOptimizedGeometry(H,H,this.hasZ,this.hasM,K);return H}setCache(H){let K=this._caches.get(H);null==K&& (K=new t.FeatureSetCache(this.getSize()),this._caches.set(H,K));this._activeCache=K}setCachedValue(H){this._activeCache.set(this.getIndex(),H)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}_readGeometryDeltaDecoded(H){H=this._readGeometry(H);return"esriGeometryPoint"!==this.geometryType&&H&&this.getInTransform()?H.deltaDecode():H}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(H){this._contextTimeZone= H}readArcadeFeature(){return this}hasField(H){return this.fields.has(H)||this._joined.some(K=>K.hasField(H))}geometry(){var H=this.readGeometryWorldSpace();H=c.convertToGeometry(H,this.geometryType,this.hasZ,this.hasM);if(H=u.fromJSON(H)){if(!this.metadata.spatialReference)throw Error("InternalError: Expected spatial reference to be defined");H.spatialReference=this.metadata.spatialReference}return H}autocastArcadeDate(H,K){return K&&K instanceof Date?this.isUnknownDateTimeField(H)?q.ArcadeDate.unknownDateJSToArcadeDate(K): q.ArcadeDate.dateJSAndZoneToArcadeDate(K,this.contextTimeZone??p.system):K}isUnknownDateTimeField(H){return this.metadata.fieldsIndex.getTimeZone(H)===p.unknown}field(H){let K=this.fields.get(H);if(K)switch(K.type){case "date-only":case "esriFieldTypeDateOnly":return l.DateOnly.fromReader(this.readAttribute(H,!1));case "time-only":case "esriFieldTypeTimeOnly":return d.TimeOnly.fromReader(this.readAttribute(H,!1));case "esriFieldTypeTimestampOffset":case "timestamp-offset":return q.ArcadeDate.fromReaderAsTimeStampOffset(this.readAttribute(H, !1));case "date":case "esriFieldTypeDate":return this.autocastArcadeDate(H,this.readAttribute(H,!0));default:return this.readAttribute(H,!1)}for(const J of this._joined)if(J.setIndex(this.getIndex()),K=J.fields.get(H))switch(K.type){case "date-only":case "esriFieldTypeDateOnly":return l.DateOnly.fromReader(J._readAttribute(H,!1));case "time-only":case "esriFieldTypeTimeOnly":return d.TimeOnly.fromReader(J._readAttribute(H,!1));case "esriFieldTypeTimestampOffset":case "timestamp-offset":return q.ArcadeDate.fromReaderAsTimeStampOffset(J._readAttribute(H, !1));case "date":case "esriFieldTypeDate":return this.autocastArcadeDate(H,J._readAttribute(H,!0));default:return this.readAttribute(H,!1)}throw Error(`Field ${H} does not exist`);}setField(H,K){throw Error("Unable to update feature attribute values, feature is readonly");}keys(){return this.fields.fields.map(H=>H.name)}castToText(H=!1){if(!H)return JSON.stringify(this.readLegacyFeatureForDisplay());H=this.readLegacyFeatureForDisplay();if(!H)return JSON.stringify(null);H={geometry:H.geometry,attributes:{...(H.attributes?? {})}};for(const K in H.attributes){const J=H.attributes[K];J instanceof Date&&(H.attributes[K]=J.getTime())}return JSON.stringify(H)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(H=null){return{attributes:this._readAttributes(),geometry:!0===H?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(H,K=null){return Promise.resolve(this.castAsJson(K))}_getExists(){return null==this._deleted||!this._deleted.has(this.getIndex())}_computeDisplayCentroid(H){if(null== this.getInTransform())return n.getCentroidOptimizedGeometry(new k,H,this.hasM,this.hasZ);H=b.GeometryCursor.fromOptimized(H,this.geometryType);H.yFactor*=-1;return(H=f.getLabelPoint(H))?(H[1]*=-1,new k([],H)):null}copyInto(H){H._joined=this._joined;H._deleted=this._deleted;H._objectIdToIndex=this._objectIdToIndex;H._boundsBuffer=this._boundsBuffer;H._activeCache=this._activeCache;H._caches=this._caches;H._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const H=this.readGeometryWorldSpace(); return c.convertToGeometry(H,this.geometryType,!1,!1)}_createGeometryFromServerCentroid(){const H=this._readServerCentroid();if(!H)return null;const [K,J]=H.coords;return this._createQuantizedExtrudedGeometry(K,J)}_createQuantizedExtrudedGeometry(H,K){return"esriGeometryPolyline"===this.geometryType?this._createQuantizedExtrudedLine(H,K):this._createQuantizedExtrudedQuad(H,K)}_createQuantizedExtrudedQuad(H,K){return new k([5],[H-1,K,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(H,K){return new k([2], [H-1,K+1,1,-1])}_removeAtIndex(H){null==this._deleted&&(this._deleted=w.StaticBitSet.create(this.getSize()));this._deleted.set(H)}}e.FeatureSetReader=G;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/ArcadeDate":function(){define(["exports","../core/string","../core/sql/UnknownTimeZone","../chunks/datetime"],function(e,g,q,h){function m(f,n,c){return fc?f-c:0}function l(f,n=!0){if(f instanceof h.Zone)return f;if("system"===f.toLowerCase())return"system";if("utc"=== f.toLowerCase())return"UTC";if("unknown"===f.toLowerCase())return q.UnknownTimeZone.instance;if(/^[+-]?[0-9]{1,2}([:][0-9]{2})?$/.test(f)){const c=h.FixedOffsetZone.parseSpecifier("UTC"+(f.startsWith("+")||f.startsWith("-")?"":"+")+f);if(c)return c}f=h.IANAZone.create(f);if(!f.isValid){if(n)throw new b(e.ArcadeDateErrorCodes.TimeZoneNotRecognized);return null}return f}e.ArcadeDateErrorCodes=void 0;(e.ArcadeDateErrorCodes||(e.ArcadeDateErrorCodes={})).TimeZoneNotRecognized="TimeZoneNotRecognized"; const d={[e.ArcadeDateErrorCodes.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class b extends Error{constructor(f,n){super(g.replace(d[f],n));this.declaredRootClass="esri.arcade.arcadedate.dateerror";Error.captureStackTrace&&Error.captureStackTrace(this,b)}}class a{constructor(f){this._date=f;this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(f=0,n=1,c=1,r=0,k=0,p=0,t=0,w){if(isNaN(f)||isNaN(n)||isNaN(c)||isNaN(r)||isNaN(k)||isNaN(p)||isNaN(t))return null;const u= h.DateTime.local(f,n).daysInMonth;f=h.DateTime.fromObject({day:1>c?1:c>u?u:c,year:f,month:1>n?1:12r?0:23k?0:59p?0:59t?0:999this.hour&&0<=this.minute&&60>this.minute&&0<=this.second&&60>this.second&&0<=this.millisecond&&1E3>this.millisecond}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(0d?null:new l(Math.floor(d/36E5%24),Math.floor(d/6E4%60),Math.floor(d/1E3%60),Math.floor(d%1E3))}static fromDateJS(d){return new l(d.getHours(),d.getMinutes(),d.getSeconds(), d.getMilliseconds())}static fromDateTime(d){return new l(d.hour,d.minute,d.second,d.millisecond)}static fromSqlTimeStampOffset(d){return this.fromDateTime(d.toDateTime())}static fromString(d,b=null){if(""===d||null===d)return null;const a=[];if(b)(b=m(b))&&a.push(b);else if(null===b||""===b)a.push("HH:mm:ss"),a.push("HH:mm:ss.SSS"),a.push("hh:mm:ss a"),a.push("hh:mm:ss.SSS a"),a.push("HH:mm"),a.push("hh:mm a"),a.push("H:mm"),a.push("h:mm a"),a.push("H:mm:ss"),a.push("h:mm:ss a"),a.push("H:mm:ss.SSS"), a.push("h:mm:ss.SSS a");for(const f of a)if(b=h.DateTime.fromFormat(d,f),b.isValid)return new l(b.hour,b.minute,b.second,b.millisecond);return null}plus(d,b){switch(d){case "days":case "years":case "months":return this.clone();case "hours":case "minutes":case "seconds":case "milliseconds":return l.fromDateTime(this.toUTCDateTime().plus({[d]:b}))}return null}toUTCDateTime(){return h.DateTime.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(d,b){switch(b.toLowerCase()){case "days":case "day":case "d":return this.toUTCDateTime().diff(d.toUTCDateTime(), "days").days;case "months":case "month":return this.toUTCDateTime().diff(d.toUTCDateTime(),"months").months;case "minutes":case "minute":case "m":return"M"===b?this.toUTCDateTime().diff(d.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(d.toUTCDateTime(),"minutes").minutes;case "seconds":case "second":case "s":return this.toUTCDateTime().diff(d.toUTCDateTime(),"seconds").seconds;case "milliseconds":case "millisecond":case "ms":return this.toUTCDateTime().diff(d.toUTCDateTime(),"milliseconds").milliseconds; case "hours":case "hour":case "h":return this.toUTCDateTime().diff(d.toUTCDateTime(),"hours").hours;case "years":case "year":case "y":return this.toUTCDateTime().diff(d.toUTCDateTime(),"years").years;default:return this.toUTCDateTime().diff(d.toUTCDateTime(),"milliseconds").milliseconds}}}e.TimeOnly=l;e.standardizeTimeFormat=m;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/kernel":function(){define(["exports","../geometry/Extent"],function(e,g){e.cloneGeometry=function(q){if(null== q)return null;const h=q.clone();void 0!==q.cache._geVersion&&(h.cache._geVersion=q.cache._geVersion);return h};e.convertLinearUnitsToCode=function(q){if(null==q)return null;if("number"===typeof q)return q;q=q.toLowerCase();q=q.replaceAll(/\s/g,"");q=q.replaceAll("-","");switch(q){case "meters":case "meter":case "m":case "squaremeters":case "squaremeter":return 9001;case "miles":case "mile":case "squaremile":case "squaremiles":return 9093;case "kilometers":case "kilometer":case "squarekilometers":case "squarekilometer":case "km":return 9036; case "yard":case "yd":case "yards":case "squareyards":case "squareyard":return 9096;case "feet":case "ft":case "foot":case "squarefeet":case "squarefoot":return 9002;case "nmi":case "nauticalmile":case "nauticalmiles":case "squarenauticalmile":case "squarenauticalmiles":return 9030}return null};e.convertSquareUnitsToCode=function(q){if(null==q)return null;if("number"===typeof q)return q;q=q.toLowerCase();q=q.replaceAll(/\s/g,"");q=q.replaceAll("-","");switch(q){case "meters":case "meter":case "m":case "squaremeters":case "squaremeter":return 109404; case "miles":case "mile":case "squaremile":case "squaremiles":return 109439;case "kilometers":case "kilometer":case "squarekilometers":case "squarekilometer":case "km":return 109414;case "acres":case "acre":case "ac":return 109402;case "hectares":case "hectare":case "ha":return 109401;case "yard":case "yd":case "yards":case "squareyards":case "squareyard":return 109442;case "feet":case "ft":case "foot":case "squarefeet":case "squarefoot":return 109405;case "nmi":case "nauticalmile":case "nauticalmiles":case "squarenauticalmile":case "squarenauticalmiles":return 109409}return null}; e.isInteger=function(q){return"number"===typeof q&&isFinite(q)&&Math.floor(q)===q};e.sameGeomType=function(q,h){return q===h||"point"===q&&"esriGeometryPoint"===h||"polyline"===q&&"esriGeometryPolyline"===h||"polygon"===q&&"esriGeometryPolygon"===h||"extent"===q&&"esriGeometryEnvelope"===h||"multipoint"===q&&"esriGeometryMultipoint"===h||"point"===h&&"esriGeometryPoint"===q||"polyline"===h&&"esriGeometryPolyline"===q||"polygon"===h&&"esriGeometryPolygon"===q||"extent"===h&&"esriGeometryEnvelope"=== q||"multipoint"===h&&"esriGeometryMultipoint"===q?!0:!1};e.shapeExtent=function(q){if(null==q)return null;switch(q.type){case "polygon":case "multipoint":case "polyline":return q.extent;case "point":return new g({xmin:q.x,ymin:q.y,xmax:q.x,ymax:q.y,spatialReference:q.spatialReference});case "extent":return q}return null};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/centroid":function(){define(["exports"],function(e){function g(h,m,l,d,b,a){a=b?a?4:3:a?3:2; let f=l,n=l+a,c=0,r=0,k=l=0,p=0;for(let t=0,w=d-1;th[1]&&(h[1]=d);uh[3]&&(h[3]=u);b&&(yh[5]&&(h[5]=y))}0{let w=p[2]-t[2];0===w&&l&&(w=p[4]-t[4]);return w});a.length&&(r=6*a[0][2], b[0]=a[0][0]/r,b[1]=a[0][1]/r,l&&(r=6*a[0][4],b[2]=0!==r?a[0][3]/r:0),b[0]f[1]||b[1]f[3]||l&&(b[2]f[5]))&&(b.length=0);if(!b.length)if(m=m.lengths[0]?q(c,0,n[0],l,d):null)b[0]=m[0],b[1]=m[1],l&&2D.objectId)}queryItems(t){return 0=== this._items.size?[]:this._searchForItems(t)}clear(){this._items.clear();this._index=null}async _updateItem(t,w){await t.projectAndNormalize(this._outSpatialReference);await w(t);({size:w}=t);w[0]=w[1]=w[2]=w[3]=0;this._getSymbolBounds(t.bounds,t.symbolResource,t.projectedGeometry,t.size,0)}_searchIndex(t,w,u,y){this._boundsDirty&&(this._items.forEach(x=>this._getSymbolBounds(x.bounds,x.symbolResource,x.projectedGeometry,x.size,0)),this._boundsDirty=!1);this._index||(this._index=q.rbush(9,x=>({minX:x.bounds[0], minY:x.bounds[1],maxX:x.bounds[2],maxY:x.bounds[3]})),this._index.load(Array.from(this._items.values())));return this._index.search({minX:t,minY:w,maxX:u,maxY:y})}_searchForItems(t){var w=this._tileInfoView.spatialReference,u=t.bounds,y=d.getInfo(w);if(y&&w.isWrappable){const [x,v]=y.valid;w=1E-5>Math.abs(u[2]-v);y=1E-5>Math.abs(u[0]-x);if(!(w&&y||!w&&!y))return t=t.resolution,t=w?h.create([x,u[1],x+t*c.pixelBuffer,u[3]]):h.create([v-t*c.pixelBuffer,u[1],v,u[3]]),u=this._searchIndex(u[0],u[1],u[2], u[3]),t=this._searchIndex(t[0],t[1],t[2],t[3]),[...(new Set([...u,...t]))]}return this._searchIndex(u[0],u[1],u[2],u[3])}_getSymbolBounds(t,w,u,y,x){if(!w||!w.symbolInfo.linearCIM||!u)return null;t||=h.create();m.getBoundsXY(t,u);if(!y||0===y[0]&&0===y[1]&&0===y[2]&&0===y[3]){const {textInfo:v,symbolInfo:A}=w;w=A.cimSymbol;y||=[0,0,0,0];x=a.CIMSymbolInflatedSizeHelper.getSymbolInflateSize(y,w.symbol,this._cimResourceManager,x,v);y[0]=g.pt2px(x[0]);y[1]=g.pt2px(x[1]);y[2]=g.pt2px(x[2]);y[3]=g.pt2px(x[3])}x= this._resolution;y=a.CIMSymbolInflatedSizeHelper.safeSize(y);t[0]-=y*x;t[1]-=y*x;t[2]+=y*x;t[3]+=y*x;return t}}return p})},"esri/views/2d/layers/graphics/GraphicStoreItem":function(){define("exports ../../../../geometry/support/aaBoundingRect ../../../../geometry/support/coordsUtils ../../../../geometry/support/jsonUtils ../../../../geometry/support/normalizeUtilsSync ../../../../layers/graphics/data/projectionSupport ./graphicsUtils".split(" "),function(e,g,q,h,m,l,d){class b{static fromGraphic(a, f,n,c){return new b(a.geometry,f,{...a.attributes},a.visible,a.uid,n,c)}constructor(a,f,n,c,r,k,p){this.geometry=a;this.symbol=f;this.attributes=n;this.visible=c;this.objectId=r;this.zOrder=k;this.displayId=p;this.bounds=g.create();this.prevBounds=g.create();this.size=[0,0,0,0]}get linearCIM(){return this.symbolResource?.symbolInfo.linearCIM}update(a,f,n){if(this.geometry===a.geometry&&JSON.stringify(this.attributes)===JSON.stringify(a.attributes)&&this.symbol===f&&this.zOrder===n&&this.visible=== a.visible)return!1;this.prevBounds=this.bounds;this.bounds=g.create();this.zOrder=n;this.geometry=a.geometry;this.attributes={...a.attributes};this.symbol=f;this.visible=a.visible;this.projectedGeometry=this.symbolResource=null;return!0}async projectAndNormalize(a){let f=this.geometry;if(f&&f.spatialReference&&"mesh"!==f.type){"extent"===f.type&&(f=d.polygonFromExtent(f));await l.checkProjectionSupport(f.spatialReference,a);var n=m.normalizeCentralMeridianForDisplay(f);n&&((a=l.project(n,f.spatialReference, a))&&q.closeRingsAndFixWinding(a),this.projectedGeometry=h.isExtent(a)?d.polygonFromExtent(a):a)}}}e.GraphicStoreItem=b;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/normalizeUtilsSync":function(){define("exports ../../core/JSONSupport ./aaBoundingRect ./boundsUtils ./coordsUtils ./jsonUtils ./normalizeUtilsCommon ./spatialReferenceUtils".split(" "),function(e,g,q,h,m,l,d,b){function a(v,A){if(null==v)return null;var z=v.spatialReference,B=b.getInfo(z);v=g.isSerializable(v)? v.toJSON():v;if(!B)return v;z=b.isWebMercator(z)?102100:4326;const D=d.cutParams[z].maxX,F=d.cutParams[z].minX;if(l.isPoint(v))return n(v,D,F);if(l.isMultipoint(v))v.points=v.points.map(E=>n(E,D,F));else{if(l.isExtent(v))return f(v,B);if(l.isPolygon(v)||l.isPolyline(v)){z=h.getBoundsXY(y,v);B=z[0];z=z[2];const E=2*d.offsetMagnitude(B,F)*D;v=0===E?v:d.updatePolyGeometry(v,E);B+=E;z+=E;return z>D?t(v,D,A):BB.extent);return 2> z.length?z[0]||v:2[[B.xmin,B.ymin],[B.xmin,B.ymax],[B.xmax,B.ymax],[B.xmax,B.ymin],[B.xmin,B.ymin]])}}function n(v,A,z){if(Array.isArray(v)){var B=v[0];B>A?(z=d.offsetMagnitude(B,A),v[0]=B+-2*z*A):BA?(z=d.offsetMagnitude(B,A),v.x+=-2*z*A):B2*H){C={xmin:FO||v?z.push(new u({xmin:K,ymin:B,xmax:H,ymax:D},[J]),new u({xmin:G,ymin:B,xmax:O, ymax:D},[Q])):z.push(new u({xmin:K,ymin:B,xmax:O,ymax:D},[J]));return z}function r(v,A){const [z,B]=A.valid;A=2*B;var D=0;v>B?(D=Math.ceil(Math.abs(v-B)/A),v-=D*A):v=v.xmin&&A<=v.xmax&&z>=v.ymin&&z<=v.ymax?!0:!1}function t(v,A,z=!0){const B=!l.isPolyline(v);B&&m.closeRings(v);if(z)return(new x).cut(v,A); z=B?v.rings:v.paths;const D=B?4:2,F=z.length;A*=-2;for(let E=0;E=D){const G=[];for(const H of C)G.push([H[0]+A,H[1]]);z.push(G)}}B?v.rings=z:v.paths=z;return v}function w(v,A,z){const B=v.length;1=this._minPts&&A.push(B);z=-2*this._xCut;for(const B of this._linesOut)if(B&&B.length>=this._minPts){for(const D of B)D[0]+=z;A.push(B)}this._closed?v.rings=A:v.paths=A;return v}moveTo(v){this._pushLineIn();this._pushLineOut();this._prevSide= this._side(v[0]);this._moveTo(v[0],v[1],this._prevSide);this._firstPt=this._prevPt=v}lineTo(v){const A=this._side(v[0]);if(-1===A*this._prevSide){const z=this._intersect(this._prevPt,v);this._lineTo(this._xCut,z,0);this._prevSide=0}this._lineTo(v[0],v[1],A);this._prevSide=A;this._prevPt=v}close(){const v=this._firstPt,A=this._prevPt;v[0]===A[0]&&v[1]===A[1]||this.lineTo(v);this._checkClosingPt(this._lineIn);this._checkClosingPt(this._lineOut)}_moveTo(v,A,z){this._closed?(this._lineIn.push([0>=z?v: this._xCut,A]),this._lineOut.push([0<=z?v:this._xCut,A])):(0>=z&&this._lineIn.push([v,A]),0<=z&&this._lineOut.push([v,A]))}_lineTo(v,A,z){this._closed?(w(this._lineIn,0>=z?v:this._xCut,A),w(this._lineOut,0<=z?v:this._xCut,A)):0>z?(0===this._prevSide&&this._pushLineOut(),this._lineIn.push([v,A])):0this._prevSide?(this._lineIn.push([v,A]),this._lineOut.push([v,A])):0this._xCut?1:0}_intersect(v,A){return v[1]+(this._xCut-v[0])/(A[0]-v[0])*(A[1]-v[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn);this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut);this._lineOut=[]}}e.CutVertical= x;e.normalizeCentralMeridianForDisplay=function(v){return a(v,!1)};e.normalizeCentralMeridianSync=function(v){return a(v,!0)};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/graphics/GraphicUpdateMessage":function(){define(["exports"],function(e){class g{constructor(q,h,m){this.added=q;this.updated=h;this.removed=m}hasAnyUpdate(){return!!(this.added.length||this.updated.length||this.removed.length)}}e.GraphicUpdateMessage=g;Object.defineProperty(e,Symbol.toStringTag, {value:"Module"})})},"esri/views/2d/layers/support/FeatureCommandQueue":function(){define(["../../../../core/promiseUtils","./UpdateTracking2D","../../../support/QueueProcessor"],function(e,g,q){class h{constructor(m){this.updateTracking=new g.UpdateTracking2D({debugName:"FeatureCommandQueue"});this._queueProcessor=new q.QueueProcessor({concurrency:1,process:m.process})}destroy(){this.updateTracking.destroy();this._queueProcessor.destroy();this.clear()}clear(){this._queueProcessor.clear()}async push(m){return e.ignoreAbortErrors(this.updateTracking.addPromise(this._doPush(m)))}async _doPush(m){const l= this._queueProcessor,d=l.last();switch(m.type){case "update":case "highlight":if(d?.type===m.type)break;return l.push(m);case "edit-by-id":case "edit-by-feature":return l.push(m)}}}return h})},"esri/views/2d/layers/support/UpdateTracking2D":function(){define("exports ../../../../chunks/tslib.es6 ../../../../core/Accessor ../../../../core/has ../../../../core/ReactiveMap ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/support/UpdatingHandles".split(" "), function(e,g,q,h,m,l,d,b,a,f,n){e.UpdateTracking2D=class extends q{constructor(c){super(c);this.debugName="";this._updatingHandles=new n.UpdatingHandles;this._idToUpdatingState=new m}get updating(){const c=this._updatingHandles.updating||Array.from(this._idToUpdatingState.values()).some(r=>r);if(h("esri-2d-log-updating")){const r=Array.from(this._idToUpdatingState.entries()).map(([k,p])=>`-> ${k}: ${p}`).join("\n");console.log(`${this.debugName}: Updating: ${c}\n-> Handles: ${this._updatingHandles.updating}\n${r}`)}return c}addUpdateTracking(c, r){const k=l.watch(()=>r.updating,p=>this._idToUpdatingState.set(c,p),{sync:!0});this.addHandles(k)}addPromise(c){return this._updatingHandles.addPromise(c)}};g.__decorate([d.property({constructOnly:!0})],e.UpdateTracking2D.prototype,"debugName",void 0);g.__decorate([d.property({readOnly:!0})],e.UpdateTracking2D.prototype,"updating",null);e.UpdateTracking2D=g.__decorate([f.subclass("esri.views.2d.layers.support.UpdateTracking2D")],e.UpdateTracking2D);Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})}, "esri/views/2d/layers/graphics/GraphicContainer":function(){define(["../../engine/webgl/enums","./AGraphicContainer","../support/util"],function(e,g,q){class h extends g.AGraphicContainer{renderChildren(m){for(const l of this.children)l.setTransform(m.state);super.renderChildren(m);this.attributeView.update();if(this.children.some(l=>l.hasData)){switch(m.drawPhase){case e.WGLDrawPhase.MAP:this._renderChildren(m,e.FeatureSelection.All);break;case e.WGLDrawPhase.HIGHLIGHT:this.hasHighlight&&this._renderHighlight(m)}this._boundsRenderer&& this._boundsRenderer.doRender(m)}}_renderHighlight(m){q.renderHighlight(m,!1,l=>{this._renderChildren(l,e.FeatureSelection.Highlight)})}}return h})},"esri/views/2d/layers/graphics/AGraphicContainer":function(){define("exports ../../../../core/maybe ../../engine/AFeatureContainer ../../engine/webgl/enums ../../engine/webgl/shaderGraph/techniques/GraphicInstanceStore ./GraphicBoundsRenderer".split(" "),function(e,g,q,h,m,l){class d extends q.AFeatureContainer{constructor(b){super(b);this._instanceStore= new m.GraphicInstanceStore;this.checkHighlight=()=>!0}destroy(){super.destroy();this._boundsRenderer=g.destroyMaybe(this._boundsRenderer)}get instanceStore(){return this._instanceStore}enableRenderingBounds(b){this._boundsRenderer=new l(b);this.requestRender()}get hasHighlight(){return this.checkHighlight()}onTileData(b,a){b.onMessage(a);this.contains(b)||this.addChild(b);this.requestRender()}_renderChildren(b,a){b.selection=a;for(const f of this.children)f.visible&&f.getDisplayList(this._instanceStore, h.FeatureBatchingStrategy.STRICT_ORDER)?.render(b)}}e.AGraphicContainer=d;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/AFeatureContainer":function(){define(["exports","./webgl/AttributeStoreView","./webgl/TileContainer"],function(e,g,q){class h extends q{constructor(m){super(m);this._statisticsByLevel=new Map;this.attributeView=new g.AttributeStoreView}destroy(){this.children.forEach(m=>m.destroy());this.removeAllChildren();this.attributeView.destroy()}doRender(m){m.context.capabilities.enable("textureFloatLinear"); super.doRender(m)}createRenderParams(m){m=super.createRenderParams(m);m.attributeView=this.attributeView;m.instanceStore=this._instanceStore;m.statisticsByLevel=this._statisticsByLevel;return m}}e.AFeatureContainer=h;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/AttributeStoreView":function(){define("exports ../../../../core/Error ../../../../core/has ../../../../core/Logger ./definitions ./DisplayId ./Utils ../../../webgl/enums ../../../webgl/FramebufferObject ../../../webgl/Texture ../../../webgl/TextureDescriptor".split(" "), function(e,g,q,h,m,l,d,b,a,f,n){class c{constructor(k,p,t){this._lastTexture=this._texture=null;this._fbos={};this.texelSize=4;const {buffer:w,pixelType:u,textureOnly:y}=k;k=d.getPixelArrayCtor(u);this.blockIndex=t;this.pixelType=u;this.size=p;this.textureOnly=y;y||(this.data=new k(w));this._resetRange()}destroy(){this._texture?.dispose();for(const k in this._fbos){const p=this._fbos[k];p&&("0"===k&&p.detachColorTexture(),p.dispose());this._fbos[k]=null}this._texture=null}get _textureDesc(){const k= new n.TextureDescriptor;k.wrapMode=b.TextureWrapMode.CLAMP_TO_EDGE;k.samplingMode=b.TextureSamplingMode.NEAREST;k.dataType=this.pixelType;k.width=this.size;k.height=this.size;return k}setData(k,p,t){k=l.getDisplayIdTexel(k);const w=this.data;p=k*this.texelSize+p;!w||p>=w.length||(w[p]=t,this.dirtyStart=Math.min(this.dirtyStart,k),this.dirtyEnd=Math.max(this.dirtyEnd,k))}getData(k,p){if(null==this.data)return null;k=l.getDisplayIdTexel(k)*this.texelSize+p;return!this.data||k>=this.data.length?null: this.data[k]}getTexture(k){return this._texture??this._initTexture(k)}getFBO(k,p=0){if(!this._fbos[p]){const t=0===p?this.getTexture(k):this._textureDesc;this._fbos[p]=new a.FramebufferObject(k,t)}return this._fbos[p]}get hasDirty(){return this.dirtyEnd>=this.dirtyStart}updateTexture(k,p){try{const D=this.dirtyStart,F=this.dirtyEnd;if(this.hasDirty){q("esri-2d-update-debug")&&console.debug(`Version[${p}] AttributeStoreView.updateTexture`,{start:D,end:F,firstBytes:new Uint8Array(this.data.buffer.slice(0, 16)),block:this});this._resetRange();var t=this.data.buffer,w=this.getTexture(k),u=(D-D%this.size)/this.size,y=(F-F%this.size)/this.size,x=u*this.size*4,v=4*(this.size+y*this.size)-x,A=d.getPixelArrayCtor(this.pixelType),z=new A(t,x*A.BYTES_PER_ELEMENT,v),B=this.size;k=y-u+1;k>this.size?h.getLogger("esri.views.2d.engine.webgl.AttributeStoreView").error(new g("mapview-webgl","Out-of-bounds index when updating AttributeData")):w.updateData(0,0,u,B,k,z)}}catch(D){}}update(k){const {data:p,start:t,end:w}= k;if(null!=p&&null!=this.data){const u=this.data,y=t*this.texelSize;for(let x=0;xnull!=t?new c(t, this.size,w):null);else for(k=0;k0!==b.key.level-a.key.level?b.key.level-a.key.level:0!==b.key.row-a.key.row?b.key.row-a.key.row:b.key.col- a.key.col;class d extends q{constructor(b){super();this._tileInfoView=b}renderChildren(b){this.sortChildren(l);this.setStencilReference(b);super.renderChildren(b)}createRenderParams(b){const {state:a}=b;b=super.createRenderParams(b);b.requiredLevel=this._tileInfoView.getClosestInfoForScale(a.scale).level;b.displayLevel=this._tileInfoView.tileInfo.scaleToZoom(a.scale);return b}prepareRenderPasses(b){const a=super.prepareRenderPasses(b);a.push(b.registerRenderPass({name:"stencil",brushes:[h],drawPhase:g.WGLDrawPhase.DEBUG| g.WGLDrawPhase.MAP|g.WGLDrawPhase.HIGHLIGHT|g.WGLDrawPhase.LABEL,target:()=>this.getStencilTarget()}));e("esri-tiles-debug")&&a.push(b.registerRenderPass({name:"tileInfo",brushes:[m],drawPhase:g.WGLDrawPhase.DEBUG,target:()=>this.children}));return a}getStencilTarget(){return this.children}setStencilReference(b){b=1;for(const a of this.children)a.stencilRef=b++}}return d})},"esri/views/2d/engine/webgl/WGLContainer":function(){define(["../../../../core/has","../brushes","../Container","./ClippingInfo", "./enums"],function(e,g,q,h,m){class l extends q.Container{set clips(d){super.clips=d;this._updateClippingInfo(d)}renderChildren(d){d.painter.setPipelineState(null);null==this._renderPasses&&(this._renderPasses=this.prepareRenderPasses(d.painter));for(const b of this._renderPasses)try{b.render(d)}catch(a){}}prepareRenderPasses(d){return[d.registerRenderPass({name:"clip",brushes:[g.brushes.clip],target:()=>this._clippingInfos,drawPhase:m.WGLDrawPhase.MAP|m.WGLDrawPhase.LABEL|m.WGLDrawPhase.LABEL_ALPHA| m.WGLDrawPhase.DEBUG|m.WGLDrawPhase.HIGHLIGHT})]}_updateClippingInfo(d){null!=this._clippingInfos&&(this._clippingInfos.forEach(b=>b.destroy()),this._clippingInfos=null);null!=d&&d.length&&(this._clippingInfos=d.items.map(b=>h.fromClipArea(this.stage,b)));this.requestRender()}}return l})},"esri/views/2d/engine/webgl/ClippingInfo":function(){define("../../../../core/Error ../../../../core/Logger ../../../../core/reactiveUtils ../../../../core/libs/gl-matrix-2/factories/mat3f32 ../DisplayObject ./Mesh2D ../../support/clippingUtils ../../../webgl/VertexArrayObject".split(" "), function(e,g,q,h,m,l,d,b){class a extends m.DisplayObject{constructor(f,n){super();this._clip=n;this._cache={};this.stage=f;this._handle=q.watch(()=>n.version,()=>this._invalidate());this.ready()}static fromClipArea(f,n){return new a(f,n)}_destroyGL(){null!=this._cache.mesh&&(this._cache.mesh.destroy(),this._cache.mesh=null);null!=this._cache.vao&&(this._cache.vao.dispose(),this._cache.vao=null)}destroy(){this._destroyGL();this._handle.remove()}getVAO(f,n,c,r){const [k,p]=n.size;if("geometry"===this._clip.type|| this._lastWidth!==k||this._lastHeight!==p)this._lastWidth=k,this._lastHeight=p,this._destroyGL();if(null==this._cache.vao){n=this._createMesh(n,this._clip);const t=n.getIndexBuffer(f),w=n.getVertexBuffers(f);this._cache.mesh=n;this._cache.vao=new b.VertexArrayObject(f,c,r,w,t)}return this._cache.vao}_createTransforms(){return{displayViewScreenMat3:h.create()}}_invalidate(){this._destroyGL();this.requestRender()}_createMesh(f,n){switch(n.type){case "rect":return l.fromScreenExtent(d.createScreenExtent(n, f.size[0],f.size[1]));case "path":return l.fromPath(n);case "geometry":return l.fromGeometry(f,n);default:return g.getLogger("esri.views.2d.engine.webgl.ClippingInfo").error(new e("mapview-bad-type","Unable to create ClippingInfo mesh from clip of type: ${clip.type}")),l.fromScreenExtent({xmin:0,ymin:0,xmax:1,ymax:1})}}}return a})},"esri/views/2d/engine/webgl/Mesh2D":function(){define("../../../../core/Error ../../../../core/Logger ../../../../chunks/earcut ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../layers/graphics/featureConversionUtils ../../../../layers/graphics/OptimizedGeometry ./number ../../../webgl/BufferObject ../../../webgl/enums".split(" "), function(e,g,q,h,m,l,d,b,a,f){const n=({coords:r,lengths:k},p)=>{const t=[];for(let y=0,x=0;yA))break;w.push(x+k[y]-v)}u=r.slice(2*v,2*(x+k[y]));w=q.earcut(u,w,2);for(const A of w)t.push(A+v)}return t};class c{constructor(r,k,p,t=!1){this._cache={};this.vertices=r;this.indices=k;this.primitiveType=p;this.isMapSpace= t}static fromPath(r){var k=l.convertFromNestedArray(new d,r.path,!1,!1);r=k.coords;k=new Uint32Array(n(k,!0));const p=new Uint32Array(r.length/2);for(let t=0;t({...p,[t]:a.BufferObject.createVertex(r,k,this.vertices[t])}),{}));return this._cache.vertexBuffers}}return c})},"esri/views/2d/engine/webgl/shaderGraph/techniques/GraphicInstanceStore":function(){define(["exports","./TechniqueInstance","./TechniqueRegistry","./mesh/instanceIdUtils"],function(e, g,q,h){function m(a,f){return new g.FeatureTechniqueInstance(h.castInstanceId(l++),a,f)}let l=0;const d={visualVariableColor:null,visualVariableOpacity:null,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableRotation:null,visualVariableSizeOutlineScaleStops:null};class b{constructor(){this.instances={fill:m(q.Techniques.fill,{uniforms:d,optionalAttributes:{zoomRange:!0}}),marker:m(q.Techniques.marker,{uniforms:d, optionalAttributes:{zoomRange:!0}}),line:m(q.Techniques.line,{uniforms:d,optionalAttributes:{zoomRange:!0}}),text:m(q.Techniques.text,{uniforms:d,optionalAttributes:{zoomRange:!0,referenceSymbol:!1,clipAngle:!1}}),complexFill:m(q.Techniques.complexFill,{uniforms:d,optionalAttributes:{zoomRange:!0}}),texturedLine:m(q.Techniques.texturedLine,{uniforms:d,optionalAttributes:{zoomRange:!0}})};this._instancesById=Object.values(this.instances).reduce((a,f)=>{a.set(f.instanceId,f);return a},new Map)}getInstance(a){return this._instancesById.get(a)}} e.GraphicInstanceStore=b;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/TechniqueInstance":function(){define(["exports","./mesh/instanceIdUtils"],function(e,g){class q{constructor(h,m,l){this._instanceId=h;this.techniqueRef=m;this._input=l}get instanceId(){return g.castStrictInstanceId(this._instanceId)}createMeshInfo(h){return{id:g.castStrictInstanceId(this._instanceId),techniqueType:this.techniqueRef.type,inputParams:h,optionalAttributes:this._input.optionalAttributes}}getInput(){return this._input}setInput(h){this._input= h}}e.FeatureTechniqueInstance=q;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/shaderGraph/techniques/mesh/instanceIdUtils":function(){define(["exports"],function(e){e.castInstanceId=function(g){return g};e.castStrictInstanceId=function(g){return g};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/layers/graphics/GraphicBoundsRenderer":function(){define("../../../../core/maybe ../../../../core/libs/gl-matrix-2/math/mat3 ../../../../core/libs/gl-matrix-2/factories/mat3f32 ../../../../core/libs/gl-matrix-2/factories/vec2f32 ../../../../core/libs/gl-matrix-2/factories/vec3f32 ../../../../geometry/support/normalizeUtils ../../engine/DisplayObject ../../engine/webgl/Utils ../../../webgl/BufferObject ../../../webgl/enums ../../../webgl/VertexArrayObject".split(" "), function(e,g,q,h,m,l,d,b,a,f,n){const c=Math.PI/180;class r extends d.DisplayObject{constructor(p){super();this._indexBuffer=this._vertexBuffer=this._vao=this._program=null;this._dvsMat3=q.create();this._localOrigin={x:0,y:0};this._getBounds=p}destroy(){this._vao&&(this._vao.dispose(),this._indexBuffer=this._vertexBuffer=this._vao=null);this._program=e.disposeMaybe(this._program)}doRender(p){const {context:t}=p,w=this._getBounds();1>w.length||(this._createShaderProgram(t),this._updateMatricesAndLocalOrigin(p), this._updateBufferData(t,w),t.setBlendingEnabled(!0),t.setDepthTestEnabled(!1),t.setStencilWriteMask(0),t.setStencilTestEnabled(!1),t.setBlendFunction(f.BlendFactor.ONE,f.BlendFactor.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0),p=this._program,t.bindVAO(this._vao),t.useProgram(p),p.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),t.gl.lineWidth(1),t.drawElements(f.PrimitiveType.LINES,8*w.length,f.DataType.UNSIGNED_INT,0),t.bindVAO())}_createTransforms(){return{displayViewScreenMat3:q.create()}}_createShaderProgram(p){this._program|| (this._program=p.programCache.acquire("precision highp float;\n uniform mat3 u_dvsMat3;\n\n attribute vec2 a_position;\n\n void main() {\n mediump vec3 pos \x3d u_dvsMat3 * vec3(a_position, 1.0);\n gl_Position \x3d vec4(pos.xy, 0.0, 1.0);\n }","precision mediump float;\n void main() {\n gl_FragColor \x3d vec4(0.75, 0.0, 0.0, 0.75);\n }",k().attributes))}_updateMatricesAndLocalOrigin(p){var {state:t}=p;const {displayMat3:w,size:u,resolution:y, pixelRatio:x,rotation:v,viewpoint:A}=t;p=c*v;const {x:z,y:B}=A.targetGeometry;t=l.normalizeMapX(z,t.spatialReference);this._localOrigin.x=t;this._localOrigin.y=B;t=x*u[0];const D=x*u[1],F=y*t,E=y*D,C=g.identity(this._dvsMat3);g.multiply(C,C,w);g.translate(C,C,h.fromValues(t/2,D/2));g.scale(C,C,m.fromValues(u[0]/F,-D/E,1));g.rotate(C,C,-p)}_updateBufferData(p,t){const {x:w,y:u}=this._localOrigin,y=new Float32Array(8*t.length),x=new Uint32Array(8*t.length);let v=0,A=0;for(const z of t)z&&(y[2*v]=z[0]- w,y[2*v+1]=z[1]-u,y[2*v+2]=z[0]-w,y[2*v+3]=z[3]-u,y[2*v+4]=z[2]-w,y[2*v+5]=z[3]-u,y[2*v+6]=z[2]-w,y[2*v+7]=z[1]-u,x[A]=v+0,x[A+1]=v+3,x[A+2]=v+3,x[A+3]=v+2,x[A+4]=v+2,x[A+5]=v+1,x[A+6]=v+1,x[A+7]=v+0,v+=4,A+=8);this._vertexBuffer?this._vertexBuffer.setData(y.buffer):this._vertexBuffer=a.BufferObject.createVertex(p,f.Usage.DYNAMIC_DRAW,y.buffer);this._indexBuffer?this._indexBuffer.setData(x):this._indexBuffer=a.BufferObject.createIndex(p,f.Usage.DYNAMIC_DRAW,x);this._vao||(t=k(),this._vao=new n.VertexArrayObject(p, t.attributes,t.bufferLayouts,{geometry:this._vertexBuffer},this._indexBuffer))}}const k=()=>b.createProgramDescriptor("bounds",{geometry:[{location:0,name:"a_position",count:2,type:f.DataType.FLOAT}]});return r})},"esri/views/2d/navigation/MapViewNavigation":function(){define("../../../chunks/tslib.es6 ../../../Viewpoint ../../../core/Accessor ../../../core/has ../../../core/maybe ../../../core/time ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/Point ../viewpointUtils ./ZoomBox ./actions/Pan ./actions/Pinch ./actions/Rotate".split(" "), function(e,g,q,h,m,l,d,b,a,f,n,c,r,k,p,t){const w=new g({targetGeometry:new n}),u=[0,0];g=class extends q{constructor(y){super(y);this.animationManager=this._lastEventTimestamp=this._endTimer=null;this.interacting=!1}initialize(){this.pan=new k({navigation:this});this.rotate=new t({navigation:this});this.pinch=new p({navigation:this});this.zoomBox=new r({view:this.view,navigation:this})}destroy(){this.pan=m.destroyMaybe(this.pan);this.rotate=m.destroyMaybe(this.rotate);this.pinch=m.destroyMaybe(this.pinch); this.zoomBox=m.destroyMaybe(this.zoomBox);this.animationManager=null}begin(){this.stop();this._set("interacting",!0)}end(){this._lastEventTimestamp=performance.now();this._startTimer(250)}async zoom(y,x=this._getDefaultAnchor()){this.begin();if(this.view.constraints.snapToZoom&&this.view.constraints.effectiveLODs)return 1>y?this.zoomIn(x):this.zoomOut(x);this.setViewpoint(x,y,0,[0,0])}async zoomIn(y){var x=this.view;x=x.constraints.snapToNextScale(x.scale);return this._zoomToScale(x,y)}async zoomOut(y){var x= this.view;x=x.constraints.snapToPreviousScale(x.scale);return this._zoomToScale(x,y)}setViewpoint(y,x,v,A){this.begin();this.view.stateManager.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,y,x,v,A);this.end()}setViewpointImmediate(y,x=0,v=[0,0],A=this._getDefaultAnchor()){this.view.stateManager.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,A,y,x,v)}continuousRotateClockwise(){const y=this.view.viewpoint;this.animationManager?.animateContinuous(y, x=>{c.rotateBy(x,x,-1)})}continuousRotateCounterclockwise(){const y=this.view.viewpoint;this.animationManager?.animateContinuous(y,x=>{c.rotateBy(x,x,1)})}resetRotation(){this.view.constraints.rotationEnabled&&(this.view.rotation=0)}continuousPanLeft(){this._continuousPan([-10,0])}continuousPanRight(){this._continuousPan([10,0])}continuousPanUp(){this._continuousPan([0,10])}continuousPanDown(){this._continuousPan([0,-10])}continuousPanVector({x:y,y:x}){this._continuousPan([10*y,10*x])}stop(){this.pan.stopMomentumNavigation(); this.animationManager?.stop();this.end();null!==this._endTimer&&(clearTimeout(this._endTimer),this._endTimer=null,this._set("interacting",!1))}_continuousPan(y){const x=this.view.viewpoint;this.animationManager?.animateContinuous(x,v=>{c.translateBy(v,v,y);this.view.constraints.constrainByGeometry(v)})}_startTimer(y){return null!==this._endTimer?this._endTimer:this._endTimer=setTimeout(()=>{this._endTimer=null;const x=performance.now()-(this._lastEventTimestamp??0);250>x?this._endTimer=this._startTimer(x): this._set("interacting",!1)},y)}_getDefaultAnchor(){const {size:y,padding:{left:x,right:v,top:A,bottom:z}}=this.view;u[0]=.5*(y[0]-v+x);u[1]=.5*(y[1]-z+A);return u}async _zoomToScale(y,x=this._getDefaultAnchor()){const {view:v}=this,{constraints:A,scale:z,viewpoint:B,size:D,padding:F}=v,E=A.canZoomInTo(y),C=A.canZoomOutTo(y);if(!(yz&&!C))return c.padAndScaleAndRotateBy(w,B,y/z,0,x,D,F),A.constrainByGeometry(w),v.goTo(w,{animate:!0,animationMode:"always",duration:l.Milliseconds(h("mapview-essential-goto-duration")), pickClosestTarget:!1})}_scaleRotateTranslateViewpoint(y,x,v,A,z){var {view:B}=this;const {size:D,padding:F,constraints:E,scale:C,viewpoint:G}=B;var H=C*v;B=E.canZoomInTo(H);H=E.canZoomOutTo(H);if(1>v&&!B||1this._handleDrag(c,1),f.ViewEventPriorities.INTERNAL),n.on("drag",["Shift","Control"],c=>this._handleDrag(c,-1),f.ViewEventPriorities.INTERNAL)])}_start(){this._createContainer(); this._createOverlay();this.navigation.begin()}_update(n,c,r,k){this._box.x=n;this._box.y=c;this._box.width=r;this._box.height=k;this._rafId||(this._rafId=requestAnimationFrame(this._redraw))}_end(n,c,r,k,p){const t=this.view;n=t.toMap(h.createScreenPoint(n+.5*r,c+.5*k));r=Math.max(r/t.width,k/t.height);-1===p&&(r=1/r);this._destroyOverlay();this.navigation.end();t.goTo({center:n,scale:t.scale*r},{animationMode:"always",duration:m.Milliseconds(q("mapview-essential-goto-duration"))})}_updateBox(n,c, r,k){const p=this._boxShape;p.setAttributeNS(null,"x",""+n);p.setAttributeNS(null,"y",""+c);p.setAttributeNS(null,"width",""+r);p.setAttributeNS(null,"height",""+k);p.setAttributeNS(null,"class","esri-zoom-box__outline")}_updateBackground(n,c,r,k){this._backgroundShape.setAttributeNS(null,"d",this._toSVGPath(n,c,r,k,this.view.width,this.view.height))}_createContainer(){const n=document.createElement("div");n.className="esri-zoom-box__container";this.view.root.appendChild(n);this._container=n}_createOverlay(){var n= this.view.width,c=this.view.height;const r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttributeNS(null,"d","M 0 0 L "+n+" 0 L "+n+" "+c+" L 0 "+c+" Z");r.setAttributeNS(null,"class","esri-zoom-box__overlay-background");n=document.createElementNS("http://www.w3.org/2000/svg","rect");c=document.createElementNS("http://www.w3.org/2000/svg","svg");c.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink");c.setAttributeNS(null,"class","esri-zoom-box__overlay"); c.appendChild(r);c.appendChild(n);this._container.appendChild(c);this._backgroundShape=r;this._boxShape=n;this._overlay=c}_destroyOverlay(){this._container&&this._container.parentNode&&this._container.parentNode.removeChild(this._container);this._container=this._backgroundShape=this._boxShape=this._overlay=null}_toSVGPath(n,c,r,k,p,t){r=n+r;k=c+k;return"M 0 0 L "+p+" 0 L "+p+" "+t+" L 0 "+t+" ZM "+n+" "+c+" L "+n+" "+k+" L "+r+" "+k+" L "+r+" "+c+" Z"}_handleDrag(n,c){var r=n.x,k=n.y,p=n.origin.x; const t=n.origin.y;let w;r>p?(w=p,p=r-p):(w=r,p-=r);k>t?(r=t,k-=t):(r=k,k=t-k);switch(n.action){case "start":this._start();break;case "update":this._update(w,r,p,k);break;case "end":this._end(w,r,p,k,c)}n.stopPropagation()}_redraw(){if(this._rafId&&(this._rafId=null,this._overlay)){var {x:n,y:c,width:r,height:k}=this._box;this._updateBox(n,c,r,k);this._updateBackground(n,c,r,k);this._rafId=requestAnimationFrame(this._redraw)}}};e.__decorate([l.property()],g.prototype,"navigation",void 0);e.__decorate([l.property()], g.prototype,"view",null);return g=e.__decorate([a.subclass("esri.views.2d.navigation.ZoomBox")],g)})},"esri/views/2d/navigation/actions/Pan":function(){define("../../../../chunks/tslib.es6 ../../../../geometry ../../../../Viewpoint ../../../../core/Accessor ../../../../core/reactiveUtils ../../../../core/screenUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../viewpointUtils ../../../navigation/PanPlanarMomentumEstimator ../../../../geometry/Point".split(" "), function(e,g,q,h,m,l,d,b,a,f,n,c,r,k,p,t){g=class extends h{constructor(w){super(w);this.animationTime=0;this.momentumEstimator=new p.PanPlanarMomentumEstimator(500,6,.92);this.momentum=null;this.tmpMomentum=r.create();this.momentumFinished=!1;this.viewpoint=new q({targetGeometry:new t,scale:0,rotation:0});this._previousDrag=null;m.when(()=>this.momentumFinished,()=>this.navigation.stop())}begin(w,u){this.navigation.begin();this.momentumEstimator.reset();this.addToEstimator(u);this._previousDrag= u}update(w,u){this.addToEstimator(u);let y=u.center.x,x=u.center.y;const v=this._previousDrag;y=v?v.center.x-y:-y;x=v?x-v.center.y:x;w.viewpoint=k.translateBy(this.viewpoint,w.viewpoint,[y||0,x||0]);this._previousDrag=u}end(w,u){this.addToEstimator(u);this.momentum=w.navigation.effectiveMomentumEnabled?this.momentumEstimator.evaluateMomentum():null;this.animationTime=0;if(this.momentum)this.onAnimationUpdate(w);this._previousDrag=null;this.navigation.end()}addToEstimator(w){var u=w.center.x;const y= w.center.y,x=l.createScreenPointArray(-u,y);u=r.fromValues(-u,y,0);this.momentumEstimator.add(x,u,.001*w.timestamp)}onAnimationUpdate(w){this.navigation.animationManager?.animateContinuous(w.viewpoint,(u,y)=>{const {momentum:x,animationTime:v,tmpMomentum:A}=this;var z=this.momentumFinished=!x||x.isFinished(v);y*=.001;z||(z=x.valueDelta(v,y),c.scale(A,x.direction,z),k.translateBy(u,u,A),w.constraints.constrainByGeometry(u));this.animationTime+=y})}stopMomentumNavigation(){this.momentum&&(this.momentumEstimator.reset(), this.momentum=null,this.navigation.stop())}};e.__decorate([d.property()],g.prototype,"momentumFinished",void 0);e.__decorate([d.property()],g.prototype,"viewpoint",void 0);e.__decorate([d.property()],g.prototype,"navigation",void 0);return g=e.__decorate([n.subclass("esri.views.2d.navigation.actions.Pan")],g)})},"esri/views/navigation/PanPlanarMomentumEstimator":function(){define(["exports","../../chunks/vec32","../../core/libs/gl-matrix-2/factories/vec3f64","./FilteredFiniteDifference","./Momentum"], function(e,g,q,h,m){class l extends m.Momentum{constructor(b,a,f,n,c){super(b,a,f);this._sceneVelocity=n;this.direction=c}value(b){return super.valueFromInitialVelocity(this._sceneVelocity,b)}}class d{constructor(b=300,a=12,f=.84){this._minimumInitialVelocity=b;this._stopVelocity=a;this._friction=f;this.enabled=!0;this._time=new h.FilteredFiniteDifference(.6);this._screen=[new h.FilteredFiniteDifference(.4),new h.FilteredFiniteDifference(.4)];this._scene=[new h.FilteredFiniteDifference(.6),new h.FilteredFiniteDifference(.6), new h.FilteredFiniteDifference(.6)];this._tmpDirection=q.create()}add(b,a,f){!this.enabled||this._time.hasLastValue()&&.015>this._time.computeDelta(f)||(this._screen[0].update(b[0]),this._screen[1].update(b[1]),this._scene[0].update(a[0]),this._scene[1].update(a[1]),this._scene[2].update(a[2]),this._time.update(f))}reset(){this._screen[0].reset();this._screen[1].reset();this._scene[0].reset();this._scene[1].reset();this._scene[2].reset();this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta()|| !this._time.hasFilteredDelta())return null;var b=this._screen[0].filteredDelta,a=this._screen[1].filteredDelta;b=null==b||null==a?0:Math.sqrt(b*b+a*a);a=this._time.filteredDelta;b=null==a||null==b?0:b/a;return Math.abs(b)this.duration}get friction(){return this._friction}value(q){return this.valueFromInitialVelocity(this._initialVelocity,q)}valueDelta(q,h){const m=this.value(q);return this.value(q+h)-m}valueFromInitialVelocity(q,h){h=Math.min(h,this.duration);const m=1-this.friction;return q*(m**h-1)/Math.log(m)}} e.Momentum=g;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/navigation/actions/Pinch":function(){define("../../../../chunks/tslib.es6 ../../../../Viewpoint ../../../../core/Accessor ../../../../core/reactiveUtils ../../../../core/accessorSupport/decorators/property ../../../../core/has ../../../../core/Logger ../../../../core/RandomLCG ../../../../core/accessorSupport/decorators/subclass ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../geometry/Point ../../viewpointUtils ../../../navigation/RotationMomentumEstimator ../../../navigation/ZoomMomentumEstimator".split(" "), function(e,g,q,h,m,l,d,b,a,f,n,c,r,k,p){q=class extends q{constructor(t){super(t);this._animationTime=0;this._momentumFinished=!1;this._previousRadius=this._previousAngle=0;this._previousCenter=null;this._rotationMomentumEstimator=new k.RotationMomentumEstimator(.6,.15,.95);this._rotationDirection=1;this._startRadius=this._startAngle=0;this._updateTimestamp=null;this._zoomDirection=1;this._zoomMomentumEstimator=new p.ZoomMomentumEstimator;this._zoomOnly=null;this.viewpoint=new g({targetGeometry:new c, scale:0,rotation:0});this.rotateMomentum=this.zoomMomentum=null;this.addHandles(h.when(()=>this._momentumFinished,()=>this.navigation.stop()))}begin(t,w){this.navigation.begin();this._rotationMomentumEstimator.reset();this._zoomMomentumEstimator.reset();this._zoomOnly=null;this._previousAngle=this._startAngle=w.angle;this._previousRadius=this._startRadius=w.radius;this._previousCenter=w.center;this._updateTimestamp=null;t.constraints.rotationEnabled&&this.addToRotateEstimator(0,w.timestamp);this.addToZoomEstimator(w, 1)}update(t,w){null===this._updateTimestamp&&(this._updateTimestamp=w.timestamp);const u=w.angle,y=w.radius,x=w.center,v=Math.abs(180*(u-this._startAngle)/Math.PI),A=Math.abs(y-this._startRadius),z=this._startRadius/y;if(this._previousRadius&&this._previousCenter){const B=y/this._previousRadius;let D=180*(u-this._previousAngle)/Math.PI;this._rotationDirection=0<=D?1:-1;this._zoomDirection=1<=B?1:-1;t.constraints.rotationEnabled?(null===this._zoomOnly&&200t}canZoomOut(t){const w=t.scale;t=t.constraints.effectiveMinScale;return 0===t||w{var y=!this.canZoomIn(t)&&1this._zoomDirection, x=!this.rotateMomentum||this.rotateMomentum.isFinished(this._animationTime);y=y||!this.zoomMomentum||this.zoomMomentum.isFinished(this._animationTime);u*=.001;this._momentumFinished=x&&y;if(!this._momentumFinished){x=this.rotateMomentum?Math.abs(this.rotateMomentum.valueDelta(this._animationTime,u))*this._rotationDirection*180/Math.PI:0;y=this.zoomMomentum?Math.abs(this.zoomMomentum.valueDelta(this._animationTime,u)):1;const A=n.create();var v=n.create();if(this._previousCenter){f.set(A,this._previousCenter.x, this._previousCenter.y);r.getPaddingScreenTranslation(v,t.size,t.padding);f.add(A,A,v);const {constraints:z,scale:B}=t;v=B*y;1>y&&!z.canZoomInTo(v)?(y=B/z.effectiveMaxScale,this.rotateMomentum=this.zoomMomentum=null):1Math.PI;)h-=2*Math.PI;for(;h<-Math.PI;)h+=2*Math.PI;h=l+h}super.add(h,m)}}e.RotationMomentumEstimator=q;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/navigation/MomentumEstimator":function(){define(["exports","../../core/mathUtils","./FilteredFiniteDifference","./Momentum"],function(e,g, q,h){class m{constructor(l=2.5,d=.01,b=.95,a=12){this._minimumInitialVelocity=l;this._stopVelocity=d;this._friction=b;this._maxVelocity=a;this.enabled=!0;this.value=new q.FilteredFiniteDifference(.8);this.time=new q.FilteredFiniteDifference(.3)}add(l,d){if(this.enabled&&null!=d){if(this.time.hasLastValue()){if(.01>this.time.computeDelta(d))return;if(this.value.hasFilteredDelta()){const b=this.value.computeDelta(l);0>this.value.filteredDelta*b&&this.value.reset()}}this.time.update(d);this.value.update(l)}}reset(){this.value.reset(); this.time.reset()}evaluateMomentum(){if(!this.enabled||!this.value.hasFilteredDelta()||!this.time.hasFilteredDelta())return null;let l=this.value.filteredDelta/this.time.filteredDelta;l=g.clamp(l,-this._maxVelocity,this._maxVelocity);return Math.abs(l)v.version,()=>{this.visible=v.visible&&null!=v.position&&0[v.maskUrl,v.overlayUrl],()=>this._reloadResources()),l.watch(()=>v.size,()=>{this._disposeRenderResources();this.requestRender()})])}_createTransforms(){return{displayViewScreenMat3:b.create()}}doRender(v){const A=v.context;if(!this._resourcesTask)this._reloadResources();else if(v.drawPhase===c.WGLDrawPhase.MAP&&this._canRender()){this._updateResources(v); var z=this._magnifier;if(null!=z.position){var B=v.pixelRatio,D=z.size*B,F=Math.ceil(1/z.factor*D);this._readbackTexture.resize(F,F);var {size:E}=v.state;v=B*E[0];E=B*E[1];var C=.5*F,G=.5*F,H=h.clamp(B*z.position.x,C,v-C-1),K=h.clamp(E-B*z.position.y,G,E-G-1);A.setBlendingEnabled(!0);C=H-C;G=K-G;var J=this._readbackTexture;A.bindTexture(J,0);A.gl.copyTexImage2D(J.descriptor.target,0,J.descriptor.pixelFormat,C,G,F,F,0);F=(F=this.backgroundColor)?[F.a*F.r/255,F.a*F.g/255,F.a*F.b/255,F.a]:[1,1,1,1]; H=-1+(H+z.offset.x*B)/v*2;B=-1+(K-z.offset.y*B)/E*2;v=D/v*2;D=D/E*2;E=this._program;A.bindVAO(this._vertexArrayObject);A.bindTexture(this._overlayTexture,6);A.bindTexture(this._maskTexture,7);A.useProgram(E);E.setUniform4fv("u_background",F);E.setUniform1i("u_readbackTexture",0);E.setUniform1i("u_overlayTexture",6);E.setUniform1i("u_maskTexture",7);E.setUniform4f("u_drawPos",H,B,v,D);E.setUniform1i("u_maskEnabled",z.maskEnabled?1:0);E.setUniform1i("u_overlayEnabled",z.overlayEnabled?1:0);A.setStencilTestEnabled(!1); A.setColorMask(!0,!0,!0,!0);A.drawArrays(t.PrimitiveType.TRIANGLE_STRIP,0,4);A.bindVAO()}}}_canRender(){return this._mask&&this._overlay&&null!=this._magnifier}_reloadResources(){this._resourcesTask&&this._resourcesTask.abort();const v=null!=this._magnifier?this._magnifier.maskUrl:null,A=null!=this._magnifier?this._magnifier.overlayUrl:null;this._resourcesTask=g.createTask(async z=>{const B=null==v||null==A?k.loadMagnifierResources(z):null,D=null!=v?e(v,{responseType:"image",signal:z}).then(C=>C.data): B.then(C=>C.mask);z=null!=A?e(A,{responseType:"image",signal:z}).then(C=>C.data):B.then(C=>C.overlay);const [F,E]=await Promise.all([D,z]);this._mask=F;this._overlay=E;this._disposeRenderResources();this.requestRender()});this.updatingHandles.addPromise(this._resourcesTask.promise)}_disposeRenderResources(){this._readbackTexture=m.disposeMaybe(this._readbackTexture);this._overlayTexture=m.disposeMaybe(this._overlayTexture);this._maskTexture=m.disposeMaybe(this._maskTexture);this._vertexArrayObject= m.disposeMaybe(this._vertexArrayObject);this._program=m.disposeMaybe(this._program)}_updateResources(v){v.pixelRatio!==this._resourcePixelRatio&&this._disposeRenderResources();if(!this._readbackTexture){var A=v.context;this._resourcePixelRatio=v.pixelRatio;var z=Math.ceil(this._magnifier.size*v.pixelRatio);this._program=r.createMagnifierProgram(A);var B=new Uint16Array([0,1,0,0,1,1,1,0]);this._vertexArrayObject=new y.VertexArrayObject(A,r.magnifierProgramTemplate.attributes,n.Pos2us,{geometry:p.BufferObject.createVertex(A, t.Usage.STATIC_DRAW,B)});this._overlay.width=z;this._overlay.height=z;B=new u.TextureDescriptor;B.internalFormat=t.PixelFormat.RGBA;B.wrapMode=t.TextureWrapMode.CLAMP_TO_EDGE;B.samplingMode=t.TextureSamplingMode.NEAREST;B.flipped=!0;B.preMultiplyAlpha=!d.isSVG(this._overlay.src)||!v.context.driverTest.svgPremultipliesAlpha.result;this._overlayTexture=new w.Texture(A,B,this._overlay);this._mask.width=z;this._mask.height=z;B.pixelFormat=B.internalFormat=t.PixelFormat.ALPHA;this._maskTexture=new w.Texture(A, B,this._mask);v=1/this._magnifier.factor;B.pixelFormat=B.internalFormat=t.PixelFormat.RGBA;B.width=B.height=Math.ceil(v*z);B.samplingMode=t.TextureSamplingMode.LINEAR;B.flipped=!1;this._readbackTexture=new w.Texture(A,B)}}}return x})},"esri/views/2d/engine/webgl/shaders/MagnifierPrograms":function(){define(["exports","./sources/resolver","../../../../webgl/ProgramTemplate"],function(e,g,q){const h={shaders:{vertexShader:g.resolveIncludes("magnifier/magnifier.vert"),fragmentShader:g.resolveIncludes("magnifier/magnifier.frag")}, attributes:new Map([["a_pos",0]])};e.createMagnifierProgram=function(m){return q.createProgram(m,h)};e.magnifierProgramTemplate=h;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/magnifier/resources":function(){define(["require","exports","../../core/promiseUtils","../../support/requestImageUtils"],function(e,g,q,h){const m=l=>Object.freeze(Object.defineProperty({__proto__:null,default:l},Symbol.toStringTag,{value:"Module"}));g.loadMagnifierResources=async function(l){var d= new Promise((a,f)=>e(["./mask-svg"],n=>a(m(n)),f)),b=new Promise((a,f)=>e(["./overlay-svg"],n=>a(m(n)),f));d=h.requestImage((await d).default,{signal:l});b=h.requestImage((await b).default,{signal:l});b={mask:await d,overlay:await b};q.throwIfAborted(l);return b};Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})})},"esri/support/requestImageUtils":function(){define(["exports","../request"],function(e,g){e.requestImage=async function(q,h){({data:q}=await g(q,{responseType:"image",...h})); return q};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/mat4":function(){define(["exports","./math/mat4"],function(e,g){e.mat4=g.mat4;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/mat4f32":function(){define(["exports","./factories/mat4f32"],function(e,g){e.mat4f32=g.mat4f32;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/vec3f32":function(){define(["exports","./factories/vec3f32"], function(e,g){e.vec3f32=g.vec3f32;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/vec4f32":function(){define(["exports","./factories/vec4f32"],function(e,g){e.vec4f32=g.vec4f32;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/Bitmap":function(){define("exports ../../../core/promiseUtils ../../../core/libs/gl-matrix-2/math/mat3 ../../../core/libs/gl-matrix-2/factories/mat3f32 ../../../core/libs/gl-matrix-2/factories/vec2f32 ./DisplayObject ./ImageryBitmapSource ../../webgl/enums ../../webgl/Texture ../../webgl/TextureDescriptor".split(" "), function(e,g,q,h,m,l,d,b,a,f){function n(k){return k&&"render"in k}function c(k){const p=document.createElement("canvas");p.width=k.width;p.height=k.height;k.render(p.getContext("2d"));return p}class r extends l.DisplayObject{constructor(k=null,p=!1){super();this.blendFunction="standard";this._sourceHeight=this._sourceWidth=0;this._textureInvalidated=!1;this._texture=null;this.stencilRef=0;this.coordScale=[1,1];this._height=void 0;this.pixelRatio=1;this.rotation=this.resolution=0;this._source=null; this._width=void 0;this.y=this.x=0;this.immutable=p;this.source=k;this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null);null!=this._uploadStatus&&(this._uploadStatus.controller.abort(),this._uploadStatus=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(k){this._height=k}get source(){return this._source}set source(k){if(null!= k||null!=this._source)this._source=k,this.invalidateTexture(),this.requestRender()}get width(){return void 0!==this._width?this._width:this._sourceWidth}set width(k){this._width=k}beforeRender(k){super.beforeRender(k);this.updateTexture(k)}async setSourceAsync(k,p){null!=this._uploadStatus&&this._uploadStatus.controller.abort();const t=new AbortController,w=g.createResolver();g.onAbortOrThrow(p,()=>t.abort());g.onAbortOrThrow(t,u=>w.reject(u));this._uploadStatus={controller:t,resolver:w};this.source= k;return w.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this._source instanceof HTMLImageElement?(this._sourceHeight=this._source.naturalHeight,this._sourceWidth=this._source.naturalWidth):this._source&&(this._sourceHeight=this._source.height,this._sourceWidth=this._source.width))}updateTransitionProperties(k,p){64<=k&&(this.inFadeTransition=this.fadeTransitionEnabled=!1);super.updateTransitionProperties(k,p)}setTransform(k){const p=q.identity(this.transforms.displayViewScreenMat3), [t,w]=k.toScreenNoRotation([0,0],[this.x,this.y]);var u=this.resolution/this.pixelRatio/k.resolution;const y=u*this.width;u*=this.height;const x=Math.PI*this.rotation/180;q.translate(p,p,m.fromValues(t,w));q.translate(p,p,m.fromValues(y/2,u/2));q.rotate(p,p,-x);q.translate(p,p,m.fromValues(-y/2,-u/2));q.scaleByVec2(p,p,m.fromValues(y,u));q.multiply(this.transforms.displayViewScreenMat3,k.displayViewMat3,p)}setSamplingProfile(k){this._texture&&(k.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(), this._texture.setSamplingMode(k.samplingMode))}bind(k,p){this._texture&&k.bindTexture(this._texture,p)}async updateTexture({context:k,painter:p}){if(this._textureInvalidated)if(this._textureInvalidated=!1,this._texture||(this._texture=this._createTexture(k)),this.source){this._texture.resize(this._sourceWidth,this._sourceHeight);k=this.source;k=n(k)?k instanceof d?k.getRenderedRasterPixels()?.renderedRasterPixels:c(k):k;try{if(null!=this._uploadStatus){const {controller:t,resolver:w}=this._uploadStatus, u={signal:t.signal},{width:y,height:x}=this;await p.textureUploadManager.enqueueTextureUpdate({data:k,texture:this._texture,width:y,height:x},u);w.resolve();this._uploadStatus=null}else this._texture.setData(k);this.ready()}catch(t){g.throwIfNotAbortError(t)}}else this._texture.setData(null)}onDetach(){this.destroy()}_createTransforms(){return{displayViewScreenMat3:h.create()}}_createTexture(k){const p=this.immutable,t=new f.TextureDescriptor;t.internalFormat=p?b.SizedPixelFormat.RGBA8:b.PixelFormat.RGBA; t.wrapMode=b.TextureWrapMode.CLAMP_TO_EDGE;t.isImmutable=p;t.width=this._sourceWidth;t.height=this._sourceHeight;return new a.Texture(k,t)}}e.Bitmap=r;e.isImageSource=n;e.rasterize=c;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/ImageryBitmapSource":function(){define(function(){class e{constructor(g,q,h){this.pixelBlock=g;this.extent=q;this.originalPixelBlock=h}get width(){return null!=this.pixelBlock?this.pixelBlock.width:0}get height(){return null!=this.pixelBlock? this.pixelBlock.height:0}render(g){var q=this.pixelBlock;if(null!=q){var h=this.filter({extent:this.extent,pixelBlock:this.originalPixelBlock??q});null!=h.pixelBlock&&(h.pixelBlock.maskIsAlpha&&(h.pixelBlock.premultiplyAlpha=!0),q=h.pixelBlock.getAsRGBA(),h=g.createImageData(h.pixelBlock.width,h.pixelBlock.height),h.data.set(q),g.putImageData(h,0,0))}}getRenderedRasterPixels(){const g=this.filter({extent:this.extent,pixelBlock:this.pixelBlock});if(null==g.pixelBlock)return null;g.pixelBlock.maskIsAlpha&& (g.pixelBlock.premultiplyAlpha=!0);return{width:g.pixelBlock.width,height:g.pixelBlock.height,renderedRasterPixels:new Uint8Array(g.pixelBlock.getAsRGBA().buffer)}}}return e})},"esri/views/2d/engine/BitmapContainer":function(){define(["exports","./brushes","./webgl/enums","./webgl/WGLContainer"],function(e,g,q,h){class m extends h{constructor(){super(...arguments);this._hasCrossfade=!1}get requiresDedicatedFBO(){return super.requiresDedicatedFBO||this._hasCrossfade}beforeRender(l){super.beforeRender(l); this._manageFade()}prepareRenderPasses(l){const d=l.registerRenderPass({name:"bitmap",brushes:[g.brushes.bitmap],target:()=>this.children,drawPhase:q.WGLDrawPhase.MAP});return[...super.prepareRenderPasses(l),d]}_manageFade(){2<=this.children.reduce((l,d)=>l+(d.inFadeTransition?1:0),0)?(this.children.forEach(l=>l.blendFunction="additive"),this._hasCrossfade=!0):(this.children.forEach(l=>l.blendFunction="standard"),this._hasCrossfade=!1)}}e.BitmapContainer=m;Object.defineProperty(e,Symbol.toStringTag, {value:"Module"})})},"esri/views/2d/engine/BitmapTile":function(){define(["exports","../../../core/libs/gl-matrix-2/factories/mat3f32","./Bitmap","./webgl/TiledDisplayObject"],function(e,g,q,h){class m extends h.TiledDisplayObject{constructor(l,d,b,a,f,n,c=null){super(l,d,b,a,f,n);this.bitmap=new q.Bitmap(c);this.bitmap.coordScale=[f,n];this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy();this.bitmap.destroy()}beforeRender(l){this.bitmap.beforeRender(l);super.beforeRender(l)}afterRender(l){this.bitmap.afterRender(l); super.afterRender(l)}set stencilRef(l){this.bitmap.stencilRef=l}get stencilRef(){return this.bitmap.stencilRef}_createTransforms(){return{displayViewScreenMat3:g.create(),tileMat3:g.create()}}setTransform(l){super.setTransform(l);this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap&&(this.bitmap.stage=null)}}e.BitmapTile=m;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/BitmapTileContainer":function(){define("exports ../../../geometry/support/aaBoundingRect ./BitmapTile ./brushes ./webgl/enums ./webgl/TileContainer".split(" "), function(e,g,q,h,m,l){class d extends l{get requiresDedicatedFBO(){return this.children.some(b=>"additive"===b.bitmap.blendFunction)}createTile(b){const a=this._tileInfoView.getTileBounds(g.create(),b),f=this._tileInfoView.getTileResolution(b.level),[n,c]=this._tileInfoView.tileInfo.size;return new q.BitmapTile(b,f,a[0],a[3],n,c)}prepareRenderPasses(b){const a=b.registerRenderPass({name:"bitmap (tile)",brushes:[h.brushes.bitmap],target:()=>this.children.map(f=>f.bitmap),drawPhase:m.WGLDrawPhase.MAP}); return[...super.prepareRenderPasses(b),a]}doRender(b){this.visible&&b.drawPhase===m.WGLDrawPhase.MAP&&super.doRender(b)}}e.BitmapTileContainer=d;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/color":function(){define(["exports","./number"],function(e,g){e.premultiplyAlpha=function(q,h=0,m=!1){const l=q[h+3];q[h]*=l;q[h+1]*=l;q[h+2]*=l;m||(q[h+3]*=255);return q};e.premultiplyAlphaRGBA=function(q){if(!q)return 0;const {r:h,g:m,b:l,a:d}=q;return g.i8888to32(h* d,m*d,l*d,255*d)};e.premultiplyAlphaRGBAArray=function(q){if(!q)return 0;const [h,m,l,d]=q;return g.i8888to32(d/255*h,d/255*m,d/255*l,d)};e.writeColor=function(q,h,m=0){if(null==h)q[m]=0,q[m+1]=0,q[m+2]=0,q[m+3]=0;else{var {r:l,g:d,b,a}=h;q[m]=l*a/255;q[m+1]=d*a/255;q[m+2]=b*a/255;q[m+3]=a}};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})},"esri/views/2d/engine/webgl/util/Matcher":function(){define(["exports"],function(e){class g{constructor(){this._backgroundFillResult=this._defaultResult= null}static async from(q,h){const m=new g;m.setDefault(await q.createMeshWriters(h.meshes));return m}size(){return 1}getDefault(){return this._defaultResult}setDefault(q){this._defaultResult=q}getBackgroundFill(){return this._backgroundFillResult}setBackgroundFill(q){this._backgroundFillResult=q}match(q,h){return(q=this.doMatch(q,h)||this.getDefault())&&0q.LabelManager});e.GraphicsView2D=h;e.GraphicContainer=m;e.MapViewNavigation=l;e.MagnifierView2D=d;Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});