@arcgis/core 4.33.0-next.20250402 → 4.33.0-next.20250404

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/WebScene.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/0669220e7acacd9c652a.js +1 -0
  4. package/assets/esri/core/workers/chunks/0cec53e6f1464c69448d.js +1 -0
  5. package/assets/esri/core/workers/chunks/{30a047bd66f333bb7d2d.js → 1364744b15b327abd5a1.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{628395830c78b95b46dc.js → 290aed587aa647226b46.js} +1 -1
  7. package/assets/esri/core/workers/chunks/358a3a9326615d5e6d3b.js +1 -0
  8. package/assets/esri/core/workers/chunks/35ab75010817f1525e54.js +1 -0
  9. package/assets/esri/core/workers/chunks/386ea90e87254b0282ec.js +1 -0
  10. package/assets/esri/core/workers/chunks/61737e442b1f8e86164e.js +1 -0
  11. package/assets/esri/core/workers/chunks/69e606267dc5842ebf9d.js +1 -0
  12. package/assets/esri/core/workers/chunks/7099564a8853b81ba181.js +1 -0
  13. package/assets/esri/core/workers/chunks/8221f2e540abe1e0f048.js +1 -0
  14. package/assets/esri/core/workers/chunks/b06e3ba73f353592c81d.js +1 -0
  15. package/assets/esri/core/workers/chunks/{322cb1b1871d03b69f0a.js → baab3f0bdf78b6165fd6.js} +102 -102
  16. package/assets/esri/core/workers/chunks/c20ec58c7bc7d5893049.js +1 -0
  17. package/assets/esri/core/workers/chunks/c2d0fc13f4b746318a38.js +1 -0
  18. package/assets/esri/core/workers/chunks/{7e00122014d0a55363a8.js → ccb289911e7445b17763.js} +1 -1
  19. package/assets/esri/core/workers/chunks/eaead9e927ebadcf2cc3.js +1 -0
  20. package/assets/esri/core/workers/chunks/ed517687b3728fd2eb64.js +1 -0
  21. package/core/typedArrayUtil.js +1 -1
  22. package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
  23. package/geometry/Polygon.js +1 -1
  24. package/geometry/support/HalfFloatArray.js +1 -1
  25. package/geometry/support/buffer/BufferView.js +1 -1
  26. package/geometry/support/buffer/internals/Vec2.js +1 -1
  27. package/geometry/support/float16.js +5 -0
  28. package/interfaces.d.ts +591 -26
  29. package/layers/BuildingSceneLayer.js +1 -1
  30. package/layers/ParquetLayer.d.ts +4 -0
  31. package/layers/SceneLayer.js +1 -1
  32. package/package.json +2 -2
  33. package/portal/schemas/definitions.js +1 -1
  34. package/support/revision.js +1 -1
  35. package/undoredo/support/Services.js +1 -1
  36. package/views/2d/engine/Stage.js +1 -1
  37. package/views/2d/engine/vectorTiles/decluttering/CollisionJob.js +1 -1
  38. package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
  39. package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
  40. package/views/2d/engine/webgl/Painter.js +1 -1
  41. package/views/2d/engine/webgl/effects/highlight/HighlightSurfaces.js +1 -1
  42. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
  43. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapResources.js +1 -1
  44. package/views/2d/layers/StreamLayerView2D.js +1 -1
  45. package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
  46. package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
  47. package/views/3d/environment/PrecipitationTechnique.js +1 -1
  48. package/views/3d/environment/SimpleAtmosphereTechnique.js +1 -1
  49. package/views/3d/layers/DrapedSubView3D.js +1 -1
  50. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  51. package/views/3d/terrain/PatchGeometry.js +1 -1
  52. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  53. package/views/3d/terrain/TerrainAttributes.js +1 -1
  54. package/views/3d/terrain/support/MultiSizeFramebuffer.js +1 -1
  55. package/views/3d/webgl/formats.js +1 -1
  56. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  57. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +16 -16
  58. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +5 -5
  59. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  60. package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
  61. package/views/3d/webgl-engine/effects/haze/HazeTechnique.js +1 -1
  62. package/views/3d/webgl-engine/effects/highlight/HighlightApplyTechnique.js +1 -1
  63. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
  64. package/views/3d/webgl-engine/effects/magnifier/MagnifierTechnique.js +1 -1
  65. package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
  66. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
  67. package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
  68. package/views/3d/webgl-engine/lib/ChangeSet.js +1 -1
  69. package/views/3d/webgl-engine/lib/GLMaterials.js +1 -1
  70. package/views/3d/webgl-engine/lib/ITexture.js +1 -1
  71. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  72. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  73. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  74. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  75. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  76. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  77. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  78. package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
  79. package/views/3d/webgl-engine/lib/TextureUpdater.js +5 -0
  80. package/views/3d/webgl-engine/lib/VertexAttribute.js +1 -1
  81. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  82. package/views/3d/webgl-engine/lib/rendererUtils.js +1 -1
  83. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  84. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  85. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  86. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  87. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  88. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  89. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  90. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  91. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  92. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  93. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  94. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
  95. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
  96. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  97. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  98. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  99. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  100. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
  101. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
  102. package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
  103. package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
  104. package/views/3d/webgl-engine/shaders/ViewshedTechnique.js +1 -1
  105. package/views/SceneView.js +1 -1
  106. package/views/layers/ParquetLayerView.d.ts +4 -0
  107. package/views/support/TextureCompressionWorker.js +1 -1
  108. package/views/webgl/FramebufferObject.js +1 -1
  109. package/views/webgl/Texture.js +1 -1
  110. package/views/webgl/Util.js +1 -1
  111. package/views/webgl/checkWebGLError.js +1 -1
  112. package/views/webgl/enums.js +1 -1
  113. package/views/webgl/renderState.js +1 -1
  114. package/views/webgl/testFloatBufferBlend.js +1 -1
  115. package/views/webgl/textureUtils.js +1 -1
  116. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  117. package/widgets/Editor/UpdateWorkflow.js +1 -1
  118. package/widgets/Editor/workflowUtils.js +1 -1
  119. package/widgets/Editor.js +1 -1
  120. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  121. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  122. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  123. package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
  124. package/widgets/FeatureForm.js +1 -1
  125. package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
  126. package/widgets/support/GridControls.js +1 -1
  127. package/widgets/support/UtilityNetworkAssociations/utils/getFeatureTitle.js +1 -1
  128. package/assets/esri/core/workers/chunks/1d322685016263f86cf5.js +0 -1
  129. package/assets/esri/core/workers/chunks/2219d970ece5676ca6ee.js +0 -1
  130. package/assets/esri/core/workers/chunks/401ff3c83789c72e9ac9.js +0 -1
  131. package/assets/esri/core/workers/chunks/555c95b149e3a82a4460.js +0 -1
  132. package/assets/esri/core/workers/chunks/6828e4936db0121a9638.js +0 -1
  133. package/assets/esri/core/workers/chunks/6e679703b5d6fc1b91a5.js +0 -1
  134. package/assets/esri/core/workers/chunks/6f3731f19497cbc6ea74.js +0 -1
  135. package/assets/esri/core/workers/chunks/7649d59b0b7d53818a29.js +0 -1
  136. package/assets/esri/core/workers/chunks/a56da688088404259481.js +0 -1
  137. package/assets/esri/core/workers/chunks/e6469173c65531d6524a.js +0 -1
  138. package/assets/esri/core/workers/chunks/e8312c999b3f0c9ef09e.js +0 -1
  139. package/assets/esri/core/workers/chunks/e9e517a2141e504eec64.js +0 -1
  140. package/assets/esri/core/workers/chunks/fa9ef9e8eae505371965.js +0 -1
  141. package/assets/esri/core/workers/chunks/fb5b852d0f72df014377.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{isPowerOfTwo as e,clamp as t}from"../../../core/mathUtils.js";import{empty as n}from"../../../geometry/support/aaBoundingBox.js";import{fromValues as o}from"../../../geometry/support/aaBoundingRect.js";import{sampleElevation as s}from"./ElevationData.js";import{PatchType as r}from"./interfaces.js";import{NeighborIndex as i}from"./NeighborIndex.js";import{PatchGeometryLUT as a}from"./PatchGeometryLUT.js";import{neighborTileIfLoadedOrSelf as c,zeroToFour as l}from"./PatchRenderData.js";import{internalAssert as u,enableTerrainInternalChecks as d,neighborEdgeIndices as f,almostEquals as m}from"./terrainUtils.js";import{isCornerNeighbor as g}from"./Tile.js";import{compareTilesByLij as p}from"./tileUtils.js";import{compressNormal as x}from"../webgl-engine/lib/Normals.js";const h=65536;function M(e,t){const{tile:o,geometry:s,geometryState:i}=e,{extentInRadians:a,surface:c}=o,{isWebMercator:l,renderer:u}=c,{numVerticesPerSide:d,wireframe:f}=i,m=d-1,g=(d-2)**2,p=l&&(t===r.HAS_SOUTH_POLE||t===r.HAS_BOTH_POLES),x=l&&(t===r.HAS_NORTH_POLE||t===r.HAS_BOTH_POLES),h=((p?1:0)+(x?1:0))*ge*d,M=de(i),v=g+h+4*M,V=u.tileGeometryCache.acquire(v);s.numVerticesPerSide=d,s.vertexAttributes=V,s.maxEdgeVertexCount=M;const{boundingBox:B}=s;n(B);const b=E(e);se.update(m,a,b),y(e),s.poleVerticesStartIndex=g;const L=S(e,p,x);s.edgeVerticesStartIndex=g+h,Q(e),I(e),_(s,L,f),e.intersectionData=null}function S(e,t,n){const{tile:o,localOrigin:s,geometry:r}=e,{extent:i,ellipsoid:a}=o,{boundingBox:c,numVerticesPerSide:l,vertexAttributes:u,poleVerticesStartIndex:d}=r,f=l-1,m=s[0],g=s[1],p=s[2],h=a.radius,M=i[1],S=i[3],y=[];let v=d;const V=(e,t)=>{const n=t*l;ue(-m,-g,e*h-p,c),y.push(new ne(1===e,n,1===e?0:2,v,ge));const o=C(-1===e?M:S,h),s=e*Math.PI/2-o,r=.99*(1===e?1:-1),i=h+0,{position:a,uv0:d}=u,{typedBuffer:V,typedBufferStride:B}=u.normalCompressed;for(let l=1;l<=ge;++l){const e=o+s*(l/ge),t=Math.cos(e),n=Math.sin(e);for(let o=0;o<=f;o++){const e=o/f,s=se.sinLonLUT[o],l=se.cosLonLUT[o]*t,u=s*t,h=n,M=l*i-m,S=u*i-g,y=h*i-p;ue(M,S,y,c),a.setValues(v,M,S,y),d.setValues(v,e,r),x(V,v,l,u,h,B),++v}}};return t&&V(-1,0),n&&V(1,f),y}function y(e){const{tile:t}=e;if(!t.intersectsClippingArea)return;const{geometry:n,geometryState:o,localOrigin:r}=e,{numVerticesPerSide:i,samplerData:a}=o,c=i-2,l=i-1,{vertexAttributes:u,boundingBox:d}=n,{position:f,uv0:m}=u,{typedBuffer:g,typedBufferStride:p}=u.normalCompressed,{extent:h}=t,M=h[0],S=h[2],y=h[1],v=h[3],V=t.ellipsoid.radius,B=r[0],I=r[1],b=r[2],L=f.typedBuffer,C=f.typedBufferStride,A=1/l;let P=0;if(1<=c){const e=A,t=y*(1-e)+v*e,n=se.sinLatLUT[1],o=se.cosLatLUT[1];for(let r=1;r<=c;r++){const i=r*A,c=M*(1-i)+S*i,l=se.sinLonLUT[r],u=se.cosLonLUT[r],f=V+s(c,t,a),g=f*u*o-B,p=f*l*o-I,x=f*n-b;ue(g,p,x,d);const h=(r-1)*C;L[h]=g,L[h+1]=p,L[h+2]=x,m.setValues(r-1,i,e)}}for(let E=1;E<=c;E++){const e=E*A,t=y*(1-e)+v*e,n=se.sinLatLUT[E],o=se.cosLatLUT[E],r=E+1,i=r*A,u=y*(1-i)+v*i,f=se.sinLatLUT[r],h=se.cosLatLUT[r],O=se.sinLonLUT[0],T=se.cosLonLUT[0],D=V+s(M,t,a);let R=T*o*D-B,U=O*o*D-I,N=n*D-b;const w=P*C;let j=L[w],F=L[w+1],H=L[w+2];for(let v=1;v<=c;v++){const e=v*A,r=M*(1-e)+S*e,O=se.sinLonLUT[v],T=se.cosLonLUT[v];let D=0,w=0,q=0;if(v<c){const e=(P+1)*C;D=L[e],w=L[e+1],q=L[e+2]}else{const e=se.sinLonLUT[l],r=se.cosLonLUT[l],i=V+s(S,t,a);D=r*o*i-B,w=e*o*i-I,q=n*i-b}const _=R,W=U,k=N;R=j,U=F,N=H,j=D,F=w,H=q;const z=D-_,G=w-W,J=q-k;let K=0,Q=0,X=0;if(E>1){const e=(P-c)*C;K=L[e],Q=L[e+1],X=L[e+2]}else{const e=se.sinLatLUT[0],t=se.cosLatLUT[0],n=V+s(r,y,a);K=T*t*n-B,Q=O*t*n-I,X=e*n-b}const Y=V+s(r,u,a),Z=T*h*Y-B,$=O*h*Y-I,ee=f*Y-b;if(E<c){const t=P+c,n=t*C;L[n]=Z,L[n+1]=$,L[n+2]=ee,ue(Z,$,ee,d),m.setValues(t,e,i)}const te=K-Z,ne=Q-$,oe=X-ee;let re=T*o,ie=O*o,ae=n;ae*ae<.999&&(re=J*ne-G*oe,ie=z*oe-J*te,ae=G*te-z*ne);const ce=1/Math.sqrt(re*re+ie*ie+ae*ae);x(g,P,re*ce,ie*ce,ae*ce,p),++P}}}function v(e){e.tile.intersectsClippingArea&&(I(e),ee(e),e.intersectionData=null)}function V(e){e.tile.intersectsClippingArea&&(X(e),I(e),ee(e),te(e),e.intersectionData=null)}function B(e){e.tile.intersectsClippingArea&&(L(e),b(e,!0),ee(e),e.intersectionData=null)}function I(e){e.tile.intersectsClippingArea&&(L(e),b(e))}function b(t,n=!1){const{geometry:o,geometryState:r,tile:i,localOrigin:a}=t,{level:l,extent:g,extentInRadians:x,ellipsoid:h}=i,M=h.radius,S=x[0],y=x[2],v=x[1],V=x[3],{samplerData:B}=r,I=g[0],b=g[2],L=g[1],C=g[3],A=E(t),{boundingBox:P,vertexAttributes:O}=o,T=a[0],D=a[1],R=a[2],{position:U,uv0:N}=O,w=U.typedBuffer,j=U.typedBufferStride;for(let E=0;E<4;++E){const a=1===E||3===E,x=r.edgeResolutions[E];u(e(x));const h=x+1,O=c(i,r.edgePeerNeighbors[E]);if(ae(i,O,E)){Y(t,E,O);continue}const U=null!=O;u(!U||O.level===i.level),u(!U||p(i,O)<=0);const F=O?.renderData,H=F?.geometryState;if(d){const e=i.surface;if(!O&&e&&!e.updatingRootTiles){const t=f[E],n=i.findNeighborTile(t,(e=>e.loaded||e.leaf||e.level===i.level));n?n.intersectsClippingArea&&(u(!n.loaded),u(!n.leaf),u(n.level===l)):u(null==e?.rootTiles||!i.shouldHaveNeighbor(t))}}const q=1===E?g[2]:g[0],_=O?.extent,W=_&&a?1===E?_[0]:_[2]:q,k=0===E?g[3]:g[1],z=1===E?1:0,G=0===E?1:0,J=1===E?y:S,K=0===E?V:v,Q=Math.sin(J),X=Math.cos(J),Z=Math.sin(K),$=Math.cos(K),ee=H?.samplerData,te=U?(e,t,n)=>.5*(s(e,t,B)+s(n,t,ee)):(e,t,n)=>s(e,t,B),ne=o.outerEdgesOffsetAndLength[2*E+0],oe=n&&h>3?h-3:1,se=null!=B&&B.some((e=>null!=e)),re=null!=ee&&ee.some((e=>null!=e)),ie=se||re,ce=1/x,le=ne;u(!_||m(_[2]-_[0],g[2]-g[0]));(()=>{const e=1===E?-1:3===E?1:0,t=0===E?-1:2===E?1:0,n=(g[2]-g[0])*ce,r=e*n,i=t*n,c=a?e*((y-S)*ce):0,l=a?0:t*ce,u=G,d=a?J+c:J,f=a?Math.sin(d):Q,m=a?Math.cos(d):X,p=a?J-c:J,x=a?Math.sin(p):Q,v=a?Math.cos(p):X,V=a?K:A(u+l),O=a?Z:Math.sin(V),F=a?$:Math.cos(V),H=a?K:A(u-l),_=a?Z:Math.sin(H),Y=a?$:Math.cos(H);let ne=0,se=0,re=0;{const e=0*ce,t=a?q:I*(1-e)+b*e,n=a?W:t,o=a?L*(1-e)+C*e:k,s=a?J:S*(1-e)+y*e,r=a?Q:Math.sin(s),i=a?X:Math.cos(s),c=a?A(e):K,l=a?Math.sin(c):Z,u=a?Math.cos(c):$,d=M+te(t,o,n);ne=i*u*d,se=r*u*d,re=l*d}let ae=0,de=0,fe=0;{const e=1*ce,t=a?q:I*(1-e)+b*e,n=a?W:t,o=a?L*(1-e)+C*e:k,s=a?J:S*(1-e)+y*e,r=a?Q:Math.sin(s),i=a?X:Math.cos(s),c=a?A(e):K,l=a?Math.sin(c):Z,u=a?Math.cos(c):$,d=M+te(t,o,n);ae=i*u*d,de=r*u*d,fe=l*d}for(let g=1;g<h-1;g+=oe){let e=0,t=0,n=0;{const o=(g+1)*ce,s=a?q:I*(1-o)+b*o,r=a?W:s,i=a?L*(1-o)+C*o:k,c=a?J:S*(1-o)+y*o,l=a?Q:Math.sin(c),u=a?X:Math.cos(c),d=a?A(o):K,f=a?Math.sin(d):Z,m=a?Math.cos(d):$,p=M+te(s,i,r);e=u*m*p,t=l*m*p,n=f*p}const c=e,l=t,u=n,d=ae,p=de,h=fe;ae=c,de=l,fe=u;{const e=le+g,t=e*j,n=d-T,o=p-D,s=h-R;w[t]=n,w[t+1]=o,w[t+2]=s,ue(n,o,s,P);const r=g*ce,i=a?z:r,c=a?r:G;N.setValues(e,i,c)}const V=ne,H=se,oe=re;ne=d,se=p,re=h;const me=d,ge=p,pe=h,xe=1/Math.sqrt(me*me+ge*ge+pe*pe),he=pe*xe;let Me=0,Se=0,ye=0;if(ie&&he*he<.999){let e=0,t=0,n=0;{const o=0===E?-1:1;e=o*(c-V),t=o*(l-H),n=o*(u-oe)}{const o=g*ce,c=a?q:I*(1-o)+b*o,l=a?W:c,u=a?L*(1-o)+C*o:k,d=a?J:S*(1-o)+y*o,p=a?Q:Math.sin(d),h=a?X:Math.cos(d),V=a?A(o):K,P=a?Math.sin(V):Z,T=a?Math.cos(V):$;let D=me,R=ge,N=pe;if(U){const e=M+s(l-r,u-i,ee),t=a?T:Y;D=(a?v:h)*t*e,R=(a?x:p)*t*e,N=(a?P:_)*e}{const o=M+s(c+r,u+i,B),l=a?T:F,d=(a?m:h)*l*o,g=(a?f:p)*l*o,x=(a?P:O)*o;U||(D=2*me-d,R=2*ge-g,N=2*pe-x);const S=3===E?-1:1,y=S*(D-d),v=S*(R-g),V=S*(N-x);Me=n*v-t*V,Se=e*V-n*y,ye=t*y-e*v;const I=1/Math.sqrt(Me*Me+Se*Se+ye*ye);Me*=I,Se*=I,ye*=I}}}else Me=me*xe,Se=ge*xe,ye=pe*xe;o.setEdgeNormalFromValues(E,g,Me,Se,ye)}})()}}function L(e){Z(e)}function C(e,t){return Math.PI/2-2*Math.atan(Math.exp(-e/t))}function A(e,t,n,o){return C(e*(1-o)+t*o,n)}function P(e,t,n){return e*(1-n)+t*n}function E(e){const{tile:t}=e;if(t.surface.isWebMercator){const e=t.extent,n=t.ellipsoid.radius;return t=>A(e[1],e[3],n,t)}const n=t.extentInRadians;return e=>P(n[1],n[3],e)}function O(e,t){const{tile:o,geometryState:s,geometry:r}=e,{extent:i,surface:a}=o,{wireframe:c}=s,l=i[0],u=i[1],d=i[2]-l,f=i[3]-u,{numVerticesPerSide:m,clippingArea:g}=s,p=null!=g?Math.max(0,(g[0]-l)/d):0,x=null!=g?Math.max(0,(g[1]-u)/f):0,h=null!=g?Math.min(1,(g[2]-l)/d):1,M=null!=g?Math.min(1,(g[3]-u)/f):1,S=(m-2)**2,y=de(s),v=S+4*y,V=a.renderer.tileGeometryCache.acquire(v),{boundingBox:B}=r;n(B),r.numVerticesPerSide=m,r.vertexAttributes=V,r.maxEdgeVertexCount=y,r.minu=p,r.minv=x,r.maxu=h,r.maxv=M,T(e),r.edgeVerticesStartIndex=S,Q(e),N(e),_(r,[],c),e.intersectionData=null}function T(e){const n=e.tile;if(!n.intersectsClippingArea)return;const{geometry:o,geometryState:r,localOrigin:i}=e,{samplerData:a,clippingArea:c,numVerticesPerSide:l}=r,{surface:u,extent:d,ellipsoid:f}=n,{isWebMercatorOnPlateCarree:m}=u,g=null!=c?c:re,p=d[0],h=d[1],M=d[2],S=d[3],y=Math.max(p,g[0]),v=Math.min(M,g[2]),V=Math.max(h,g[1]),B=Math.min(S,g[3]),I=f.radius,b=n.horizontalScale,L=l-1,C=l-2,{minu:A,minv:P,maxu:E,maxv:O,boundingBox:T,vertexAttributes:D}=o,{position:R,uv0:U}=D,{typedBuffer:N,typedBufferStride:w}=D.normalCompressed,j=i[0],F=i[1],H=i[2],q=R.typedBuffer,_=R.typedBufferStride;let W=0;const k=t(h,V,B),z=m?(Math.PI/2-2*Math.atan(Math.exp(-k/I)))*I:k*b,G=1/L,J=t(h*(1-G)+S*G,V,B);let K=z,Q=m?(Math.PI/2-2*Math.atan(Math.exp(-J/I)))*I:J*b;for(let X=1;X<=C;X++){const e=X/L,n=t(h*(1-e)+S*e,V,B),o=t(e,P,O),r=Q,i=(X-1)/L,c=t(h*(1-i)+S*i,V,B),l=K,u=(X+1)/L,d=t(h*(1-u)+S*u,V,B),f=m?(Math.PI/2-2*Math.atan(Math.exp(-d/I)))*I:d*b,g=t(u,P,O);K=Q,Q=f;const D=t(p,y,v);let R=D*b,k=s(D,n,a);const z=1/L,G=t(z,A,E),J=t(p*(1-G)+M*G,y,v);let Y=G,Z=J,$=J*b,ee=s(J,n,a);if(1===X){const e=$-j,n=K-F,s=ee-H,r=0*_;q[r]=e,q[r+1]=n,q[r+2]=s,ue(e,n,s,T);const i=t(z,A,E);U.setValues(W,i,o)}for(let m=1;m<=C;m++){const e=$,i=ee,u=(m+1)/L,h=t(u,A,E),S=t(p*(1-u)+M*u,y,v),V=Z;Z=S;{const e=W+1,t=e*_;if(1===X||m===C){const i=S*b,c=s(S,n,a);if(1===X&&m<C){const n=i-j,s=r-F,a=c-H;q[t]=n,q[t+1]=s,q[t+2]=a,ue(n,s,a,T),U.setValues(e,h,o)}$=i,ee=c}else $=q[t]+j,ee=q[t+2]+H}const B=$,I=ee,P=R,O=k;R=e,k=i;const D=(W-C)*_,z=1===X?s(V,c,a):q[D+2]+H,G=s(V,d,a);if(X<C){const t=W+C,n=t*_,o=e-j,s=f-F,r=G-H;q[n]=o,q[n+1]=s,q[n+2]=r,ue(o,s,r,T);const i=Y;Y=h,U.setValues(t,i,g)}{const e=B-P,t=l-f,n=t*(I-O),o=e*(z-G),s=-t*e,r=n*n+o*o+s*s;if(0===r)x(N,W,0,0,1,w);else{const e=1/Math.sqrt(r);x(N,W,n*e,o*e,s*e,w)}}++W}}}function D(e,t){e.tile.intersectsClippingArea&&(j(e),w(e,!0),ee(e),e.intersectionData=null)}function R(e,t){e.tile.intersectsClippingArea&&(X(e),N(e),ee(e),te(e),e.intersectionData=null)}function U(e,t){e.tile.intersectsClippingArea&&(N(e),ee(e),e.intersectionData=null)}function N(e,t){e.tile.intersectsClippingArea&&(j(e),w(e,!1))}function w(n,o){const{geometry:r,geometryState:i,localOrigin:a}=n,l=n.tile,{surface:m,extent:g}=l,{clippingArea:x,samplerData:h}=i,M=null!=x?x:re,S=g[0],y=g[2],v=g[1],V=g[3],B=[V>M[3],y>M[2],v<M[1],S<M[0]],I=l.horizontalScale,b=q(m.isWebMercatorOnPlateCarree,l.ellipsoid.radius,I),{minu:L,minv:C,maxu:A,maxv:P,boundingBox:E}=r,O=Math.max(S,M[0]),T=Math.min(y,M[2]),D=Math.max(v,M[1]),R=Math.min(V,M[3]),U=a[0],N=a[1],w=a[2];for(let j=0;j<4;++j){const a=1===j||3===j,g=i.edgeResolutions[j];u(e(g));const x=g+1,M=B[j],F=c(l,i.edgePeerNeighbors[j]);if(!M&&ae(l,F,j)){Y(n,j,F);continue}const H=null!=F&&!M,q=F?.renderData,_=q?.geometryState;if(d&&(u(!H||F.level===l.level),u(!H||p(l,F)<=0),l&&!F&&!m.updatingRootTiles)){const e=f[j],t=l.findNeighborTile(e,(e=>e.loaded||e.leaf||e.level===l.level));m.updatingRootTiles||(t?t.intersectsClippingArea&&(u(!t.loaded),u(!t.leaf),u(t.level===l.level)):u(null==m?.rootTiles||!l.shouldHaveNeighbor(e)))}const W=t(1===j?y:S,O,T),k=t(0===j?V:v,D,R),z=_?.samplerData,G=o&&x>3?x-3:1,J=t(1===j?1:0,L,A),K=t(0===j?1:0,C,P),Q=H?(e,t)=>.5*(s(e,t,z)+s(e,t,h)):(e,t)=>s(e,t,h),X=(y-S)/g,Z=a?1===j?X:-X:0,$=a?0:0===j?X:-X,ee=-Z,te=-$;let ne=0,oe=0,se=0;{const e=0/g,n=a?W:t(S*(1-e)+y*e,O,T),o=a?t(v*(1-e)+V*e,D,R):k,s=Q(n,o);ne=n*I,oe=b(o),se=s}let re=0,ie=0,ce=0;{const e=1/g,n=a?W:t(S*(1-e)+y*e,O,T),o=a?t(v*(1-e)+V*e,D,R):k,s=Q(n,o);re=n*I,ie=b(o),ce=s}for(let e=1;e<x-1;e+=G){const n=e/g,o=re,i=ie,c=ce;{const s=a?J:t(n,L,A),l=a?t(n,C,P):K,u=o-U,d=i-N,f=c-w;ue(o,d,f,E),r.setEdgeVertexFromValuesRawPositionUV(j,e,u,d,f,s,l)}{const n=(e+1)/g,o=a?W:t(S*(1-n)+y*n,O,T),s=a?t(v*(1-n)+V*n,D,R):k,r=Q(o,s);re=o*I,ie=b(s),ce=r}const l=re,u=ce,d=ne,f=oe,m=se;ne=o,oe=i,se=c;let p=0,x=0,M=0;if(a){const e=ie-i,r=u-c,a=f-i,l=m-c,d=t(v*(1-n)+V*n,D,R),g=W+ee,S=g*I-o,y=s(g,d,h)-c,B=3===j?-1:1;if(p=B*(-a+e)*y,x=B*S*(-l+r),M=-B*S*(-a+e),H){const t=W+Z,n=t*I-o;p=(-a+e)*(y-(s(t,d,z)-c)),x=(S-n)*(-l+r),M=-(S-n)*(-a+e)}}else{const e=l-o,r=u-c,a=d-o,f=m-c,g=t(S*(1-n)+y*n,O,T),v=k+te,V=s(g,v,h)-c,B=b(v)-i,I=2===j?-1:1;if(p=I*B*(-f+r),x=I*(-a+e)*V,M=-I*B*(-a+e),H){const t=g,n=k+$,o=b(n)-i;p=(-B+o)*(-f+r),x=(-a+e)*(-V+(s(t,n,z)-c)),M=-(-B+o)*(-a+e)}}const B=1/Math.sqrt(p*p+x*x+M*M);r.setEdgeNormalFromValues(j,e,p*B,x*B,M*B)}}}function j(e,t){Z(e)}function F(e,t){return(Math.PI/2-2*Math.atan(Math.exp(-e/t)))*t}function H(e,t){return e*t}function q(e,t,n){return e?e=>F(e,t):e=>H(e,n)}function _(e,t,n){const{numVerticesPerSide:o,vertexAttributes:s,maxEdgeVertexCount:r}=e,i=o-1,a=s.count,c=2*(o-3)*(o-3),u=4*(i+r-3),d=l.reduce(((t,n)=>t+(i+e.getEdgeCount(n)-3)),0),f=t.reduce(((e,t)=>e+i*(2*(t.latitudeResolution-1)+1)),0),m=3*(n?2:1),g=(c+u+f)*m,p=a>=h?new Uint32Array(g):new Uint16Array(g);for(let l=0;l<g;++l)p[l]=0;e.indices=p,e.indexCount=(c+d+f)*m,e.poleIndicesStartIndex=c*m,e.edgeIndicesStartIndex=(c+f)*m,n?(G(e),J(e,t),K(e)):(W(e),k(e,t),z(e))}function W(e){const{numVerticesPerSide:t,indices:n,vertexAttributes:o}=e,{position:s}=o,{typedBuffer:r,typedBufferStride:i}=s,a=t-2,c=t-3,l=0,u=t-3;let d=0;for(let f=0;f<c;++f){const e=f*a;for(let t=l;t<u;++t){const o=e+t,s=o+1,c=s+a,l=c-1;fe(o,s,c,l,i,r)?(n[d]=o,n[d+1]=s,n[d+2]=c,n[d+3]=c,n[d+4]=l,n[d+5]=o):(n[d]=o,n[d+1]=s,n[d+2]=l,n[d+3]=l,n[d+4]=s,n[d+5]=c),d+=6}}}function k(e,t){const{numVerticesPerSide:n,indices:o,poleIndicesStartIndex:s}=e,r=n-1;let i=s;for(const a of t){const t=a.isNorth?1:2,s=a.isNorth?2:1,c=a.isNorth?3:4,l=a.isNorth?4:3;let u=e.getEdgeVertexIndex(a.connectedOuterEdgeOffset,0),d=1;for(let e=0;e<a.latitudeResolution;++e){const f=0===e?a.rowOffset:u+n;for(let n=0;n<r;n++){const r=f+n;o[i]=u,o[i+t]=u+1,o[i+s]=r,e<a.latitudeResolution-1?(o[i+c]=u+1,o[i+l]=r+1,o[i+5]=r,i+=6):i+=3,u+=d}u=f,d=1}}}function z(e){const{indices:t,numVerticesPerSide:n,edgeIndicesStartIndex:o}=e,s=n-1,r=s-2;let i=o;for(let a=0;a<4;++a){const n=le[a];let o=0,c=0;const l=e.getEdgeCount(a),d=n.count;u(d===s-1);const f=1===a||2===a,m=f?1:2,g=f?2:1,p=e.getEdgeFirstVertexIndex(a),x=1,h=n.vertex0Index,M=n.stride;for(;o<l-1||c<d-1;){const e=h+c*M,n=p+o*x,a=o<l-1,u=c<d-1,f=a&&(!u||(a?0+s*(o+.5)/(l-1):0)<=(u?1+r*(c+.5)/(d-1):0));f?++o:++c;const S=f?n+x:e+M;t[i]=e,t[i+m]=n,t[i+g]=S,i+=3}}e.indexCount=i}function G(e){const{indices:t,numVerticesPerSide:n,vertexAttributes:o}=e,{position:s}=o,{typedBuffer:r,typedBufferStride:i}=s,a=n-2;let c=0;for(let l=0;l<n-3;++l){const e=l*a;for(let o=0;o<n-3;++o){const n=l*a+o,s=n+1,u=s+a,d=u-1,f=e+o,m=f+1,g=m+a;fe(f,m,g,g-1,i,r)?(me(t,c,n,s,u),c+=6,me(t,c,u,d,n)):(me(t,c,n,s,d),c+=6,me(t,c,d,u,s)),c+=6}}}function J(e,t){const{indices:n,numVerticesPerSide:o,poleIndicesStartIndex:s}=e,r=o-1;let i=s;for(const a of t){const t=a.connectedOuterEdgeOffset;let s=e.getEdgeVertexIndex(t,0),c=1;for(let e=0;e<a.latitudeResolution;++e){const t=0===e?a.rowOffset:s+o;for(let o=0;o<r;o++)me(n,i,s,s+1,t+o),i+=6,e<a.latitudeResolution-1&&(me(n,i,s+1,t+o+1,t+o),i+=6),s+=c;s=t,c=1}}}function K(e){const{indices:t,numVerticesPerSide:n,edgeIndicesStartIndex:o}=e,s=n-1,r=s-2;let i=o;for(let a=0;a<4;++a){const n=le[a];let o=0,c=0;const l=e.getEdgeCount(a),d=n.count;u(d===s-1);const f=1===a||2===a,m=f?1:3,g=f?3:1,p=e.getEdgeFirstVertexIndex(a),x=1,h=n.vertex0Index,M=n.stride;for(;o<l-1||c<d-1;){const e=h+c*M,n=p+o*x,a=o<l-1,u=c<d-1,f=a&&(!u||(a?0+s*(o+.5)/(l-1):0)<=(u?1+r*(c+.5)/(d-1):0));f?++o:++c;const S=f?n+x:e+M;t[i]=e,t[i+m]=n,t[i+m+1]=n,t[i+g]=S,t[i+g+1]=S,t[i+5]=e,i+=6}}e.indexCount=i}function Q(e){const{geometry:t,geometryState:n}=e,{edgeResolutions:o}=n,{numVerticesPerSide:s,edgeVerticesStartIndex:r}=t,i=s-2;let a=r;for(let c=0;c<4;++c){{const e=0===c||2===c,t=(0===c?i-1:0)*i+(1===c?i-1:0),n=(e?0:1)*i+(e?1:0),o=le[c];o.vertex0Index=t,o.stride=n,o.count=i}{const e=o[c]+1;t.outerEdgesOffsetAndLength[2*c+0]=a,t.outerEdgesOffsetAndLength[2*c+1]=e,a+=e}}}function X(e){Q(e),e.geometryState.wireframe?K(e.geometry):z(e.geometry)}function Y(n,o,s){const{geometryState:r,geometry:i,tile:a,localOrigin:c}=n,l=1===o||3===o,d=r.edgeResolutions[o];u(e(d));const f=d+1,{boundingBox:m,minu:g,minv:p,maxu:x,maxv:h,vertexAttributes:M}=i,S=t(1===o?1:0,g,x),y=t(0===o?1:0,p,h),v=s.renderData,V=v.geometryState,B=v.geometry,I=(o+2)%4,b=B.getEdgeCount(I),L=a.getNeighborEdgeStartVertexIndex(o,s)*d,C=d*2**(a.level-s.level);u(V.edgeResolutions[I]===C),u(b-1===C);const A=v.localOrigin[0]-c[0],P=v.localOrigin[1]-c[1],E=v.localOrigin[2]-c[2],O=i.getEdgeFirstVertexIndex(o),{position:T,uv0:D}=M,R=T.typedBuffer,U=T.typedBufferStride,N=M.normalCompressed,w=N.typedBuffer,j=N.typedBufferStride,F=B.vertexAttributes,H=B.getEdgeFirstVertexIndex(I),q=F.position.typedBuffer,_=F.position.typedBufferStride,W=F.normalCompressed.typedBuffer,k=F.normalCompressed.typedBufferStride;for(let e=1;e<f-1;++e){const n=O+e,o=H+(L+e),s=n*U,r=o*_,i=q[r]+A,a=q[r+1]+P,c=q[r+2]+E;R[s]=i,R[s+1]=a,R[s+2]=c,ue(i,a,c,m);const u=n*j,f=o*k;w[u]=W[f],w[u+1]=W[f+1];const M=e/d,v=l?S:t(M,g,x),V=l?t(M,p,h):y;D.setValues(n,v,V)}}function Z(e){const{geometry:n,geometryState:o,localOrigin:r}=e,{clippingArea:i,samplerData:a}=o,{minu:c,minv:l,maxu:d,maxv:f,boundingBox:m,vertexAttributes:g}=n,x=e.tile,{surface:h,ellipsoid:M,extent:S,extentInRadians:y,horizontalScale:v}=x,V="local"===h.view?.viewingMode,B=M.radius;let I=0,b=0,L=0;const C=(e,t,n)=>{const o=y[0===t?1:3],s=y[0===e?0:2],r=Math.cos(o),i=Math.sin(o),a=Math.sin(s),c=Math.cos(s),l=B+n;I=c*r*l,b=a*r*l,L=i*l},A=V?(()=>{const e=i,n=null!=e&&(S[3]>e[3]||S[2]>e[2]||S[1]<e[1]||S[0]<e[0]),o=q(h.isWebMercatorOnPlateCarree,B,v);return(s,r,i)=>{const a=0===s?S[0]:S[2],c=0===r?S[1]:S[3],l=n?t(a,e[0],e[2]):a,u=n?t(c,e[1],e[3]):c,d=i;I=l*v,b=o(u),L=d}})():C;let P=0,O=0,T=0,D=0,R=0,U=0,N=0,w=0,j=0;const F=V&&h.isWebMercatorOnPlateCarree,H=(e,t,n,o,s)=>{let r=0,i=0,a=0;if(V){const e=t*v,s=F?(Math.PI/2-2*Math.atan(Math.exp(-n/B)))*B:n*v;r=e-I,i=s-b,a=o-L}else{const s=E(e),c=e.tile,l=c.extent,u=c.extentInRadians,d=(t-l[0])/(l[2]-l[0]),f=(n-l[1])/(l[3]-l[1]),m=u[0]*(1-d)+u[2]*d,g=s(f),p=Math.cos(g),x=Math.sin(g),h=Math.sin(m),M=Math.cos(m),S=B+o;r=M*p*S-I,i=h*p*S-b,a=x*S-L}switch(s){case 0:N+=r,w+=i,j+=a;break;case 1:D-=r,R-=i,U-=a;break;case 2:N-=r,w-=i,j-=a;break;case 3:D+=r,R+=i,U+=a}},_=i??re,W=S[0],k=S[2],z=S[1],G=S[3],J=[G>_[3],k>_[2],z<_[1],W<_[0]],K=Math.max(W,_[0]),Q=Math.min(k,_[2]),X=Math.max(z,_[1]),Y=Math.min(G,_[3]),Z=e=>Math.max(_[0],Math.min(_[2],e)),ee=e=>Math.max(_[1],Math.min(_[3],e)),te=e=>{const t=o.cornerNeighborCornerTiles;P=0,O=0,T=1,D=0,R=0,U=0,N=0,w=0,j=0;let n=1/0;for(let o=0;o<4;++o){const s=t[4*e+o];n=Math.min(n,s?.level??1/0)}for(let o=0;o<4;++o){const s=t[4*e+o];ie[o]=s?.level===n?s:null}let r=1,i=0;for(let o=0;o<4;++o){const e=ie[o];e&&(r=Math.max(r,e?.renderData.geometryState.numVerticesPerSide),i=e.extent[2]-e.extent[0])}const a=i,c=r;u(c>1);const l=a/c;for(let o=0;o<4;++o){const e=ie[(o+3)%4],t=ie[o%4];if(!e&&!t)continue;const n=0===o?1:1===o?2:2===o?3:0,r=0===o?2:1===o?3:2===o?0:1;if(e&&t){const i=oe[o][0]*l,a=oe[o][1]*l,c=e.extent,u=Z(c[0===n||1===n?2:0]+i),d=ee(c[0===n||3===n?3:1]+a),f=t.extent,m=Z(f[0===r||1===r?2:0]+i),g=ee(f[0===r||3===r?3:1]+a),p=e.renderData,x=t.renderData,h=s(u,d,p.geometryState.samplerData),M=s(m,g,x.geometryState.samplerData);H(p,u,d,.5*(h+M),o)}else{const i=e??t,a=e?n:r,c=i.extent,u=oe[o],d=Z(c[0===a||1===a?2:0]+u[0]*l),f=ee(c[0===a||3===a?3:1]+u[1]*l),m=i.renderData,g=s(d,f,m.geometryState.samplerData);H(m,d,f,g,o)}}if(!V){const e=Math.sqrt(I*I+b*b+L*L);P=I/e,O=b/e,T=L/e}if(V||T*T<.999){const e=Math.sqrt(D*D+R*R+U*U);D/=e,R/=e,U/=e;const t=Math.sqrt(N*N+w*w+j*j);N/=t,w/=t,j/=t,P=U*w-R*j,O=D*j-U*N,T=R*N-D*w;const n=1/Math.sqrt(P*P+O*O+T*T);P*=n,O*=n,T*=n}},ne=o.cornerNeighborCornerTiles;for(let E=0;E<4;++E){const e=E,i=(E+1)%4,h=0===E||1===E?1:0,M=0===E||3===E?1:0,S=t(h,c,d),y=t(M,l,f),v=n.getEdgeFirstVertexIndex(e),V=n.getEdgeCount(e),B=0===E||3===E?V-1:0,C=n.getEdgeFirstVertexIndex(i),D=n.getEdgeCount(i),R=0===E||1===E?D-1:0;let U=-1;for(let t=0;t<4;++t){const e=ne[4*E+t],n=ne[4*E+U];e&&(-1===U||p(n,e)>0)&&(U=t)}const N=U,w=ne[4*E+N];if(w!==x){const e=x.level-w.level,t=2**e,n=[w.lij[0]+e,w.lij[1]*t,w.lij[2]*t],s=[n[1]+t===x.lij[1],0===E&&(1===N||0===N&&w!==ne[4*E+3])||1===E&&(0===N||1===N&&w!==ne[4*E+2]),n[1]===x.lij[1]+1,2===E&&(3===N||2===N&&w!==ne[4*E+1])||3===E&&(2===N||3===N&&w!==ne[4*E+0])],i=s.reduce(((e,t)=>e+(t?1:0)),0);u(1===i||2===i);let a=-1,c=-1;const l=w.renderData;if(1===i){const e=s.findIndex((e=>e));u(0<=e&&e<=3),a=(e+2)%4;const t=o.edgeResolutions[e];c=x.getNeighborEdgeStartVertexIndex(e,w)*t+t*(0===e&&0===E||1===e&&0===E||2===e&&1===E||3===e&&3===E?1:0)}else{u(s[1]||s[3]),a=s[1]?3:1;const e=l.geometryState.edgeResolutions[a];c=0===E||3===E?0:e}const d=l.geometry;{const e=v+B,t=C+R,n=d.getEdgeFirstVertexIndex(a)+c,o=d.vertexAttributes,s=l.localOrigin,i=o.position,u=i.typedBuffer,f=n*i.typedBufferStride,p=u[f]+s[0]-r[0],x=u[f+1]+s[1]-r[1],h=u[f+2]+s[2]-r[2];ue(p,x,h,m);const M=g.position,V=M.typedBuffer,I=e*M.typedBufferStride;V[I]=p,V[I+1]=x,V[I+2]=h;const b=t*M.typedBufferStride;V[b]=p,V[b+1]=x,V[b+2]=h;const L=g.uv0;L.setValues(e,S,y),L.setValues(t,S,y);{const s=o.normalCompressed.typedBuffer,r=n*o.normalCompressed.typedBufferStride,i=g.normalCompressed,a=i.typedBuffer;{const t=e*i.typedBufferStride;a[t]=s[r],a[t+1]=s[r+1]}{const e=t*i.typedBufferStride;a[e]=s[r],a[e+1]=s[r+1]}}}}else{const o=J[e],c=J[i];let l;if(o||c){const e=t(W*(1-h)+k*h,K,Q),n=t(z*(1-M)+G*M,X,Y);l=s(e,n,a)}else l=$(ne,E);A(h,M,l),te(E);const u=I-r[0],d=b-r[1],f=L-r[2];ue(u,d,f,m),n.setEdgeVertexFromValuesRawPositionUVNormal(e,B,u,d,f,S,y,P,O,T),n.setEdgeVertexFromValuesRawPositionUVNormal(i,R,u,d,f,S,y,P,O,T)}}for(let t=0;t<4;++t)ie[t]=null}function $(e,t){const n=4*t,o=l.reduce(((t,o)=>Math.min(t,e[n+o]?.level??1/0)),1/0);d&&(u(!e[n+0]||!e[n+2]||g(e[n+0],e[n+2],i.SOUTH_WEST)),u(!e[n+1]||!e[n+3]||g(e[n+1],e[n+3],i.NORTH_WEST)));let r=0,a=0;for(let i=0;i<4;++i){const t=e[n+i];if(t&&t.level===o){const e=0===i||1===i,n=0===i||3===i,o=t.extent,c=o[e?0:2],l=o[n?1:3],u=t.renderData?.geometryState?.samplerData;a+=s(c,l,u),r++}}const c=r?a/r:0;return u(null!=c),c}function ee(e){const{vao:t,geometry:n}=e,{vertexAttributes:o,edgeVerticesStartIndex:s}=n,r=o.position.typedBuffer;t.vertexBuffers.get("geometry").setSubData(r,s,s,r.length)}function te(e){const{vao:t,geometry:n}=e,{indices:o,indexCount:s,edgeIndicesStartIndex:r}=n;t.indexBuffer.setSubData(o,r,r,s)}class ne{constructor(e,t,n,o,s){this.isNorth=e,this.connectedRowOffset=t,this.connectedOuterEdgeOffset=n,this.rowOffset=o,this.latitudeResolution=s}}const oe=[[0,1],[1,0],[0,-1],[-1,0]],se=new a,re=o(-1/0,-1/0,1/0,1/0),ie=[null,null,null,null];function ae(e,t,n){if(!t)return!1;const o=p(e,t);return o>0||0===o&&n>=2}class ce{constructor(){this.vertex0Index=0,this.stride=1,this.count=0}getVertexIndex(e){return u(0<=e&&e<this.count),this.vertex0Index+this.stride*e}}const le=[new ce,new ce,new ce,new ce];function ue(e,t,n,o){e<o[0]?o[0]=e:e>o[3]&&(o[3]=e),t<o[1]?o[1]=t:t>o[4]&&(o[4]=t),n<o[2]?o[2]=n:n>o[5]&&(o[5]=n)}function de(e){const{edgeResolutions:t,numVerticesPerSide:n}=e,o=1+Math.max(...t);return Math.max(n,o)}function fe(e,t,n,o,s,r){const i=e*s,a=r[i],c=r[i+1],l=r[i+2],u=t*s,d=r[u],f=r[u+1],m=r[u+2],g=n*s,p=r[g],x=r[g+1],h=r[g+2],M=o*s,S=r[M],y=r[M+1],v=r[M+2];return(d-S)*(d-S)+(f-y)*(f-y)+(m-v)*(m-v)>(a-p)*(a-p)+(c-x)*(c-x)+(l-h)*(l-h)}function me(e,t,n,o,s){e[t]=n,e[t+1]=o,e[t+2]=o,e[t+3]=s,e[t+4]=s,e[t+5]=n}const ge=6;export{O as createPlanarGlobePatch,M as createSphericalGlobePatch,B as updateCornerSpherical,D as updateCornersPlanar,R as updateEdgeElevationsAndResolutionsPlanar,V as updateEdgeElevationsAndResolutionsSpherical,U as updateEdgesAndCornersPlanar,v as updateEdgesAndCornersSpherical};
5
+ import{isPowerOfTwo as e,clamp as t}from"../../../core/mathUtils.js";import{maxUint16 as n}from"../../../core/typedArrayUtil.js";import{empty as o}from"../../../geometry/support/aaBoundingBox.js";import{fromValues as r}from"../../../geometry/support/aaBoundingRect.js";import{sampleElevation as s}from"./ElevationData.js";import{PatchType as i}from"./interfaces.js";import{NeighborIndex as a}from"./NeighborIndex.js";import{PatchGeometryLUT as c}from"./PatchGeometryLUT.js";import{neighborTileIfLoadedOrSelf as l,zeroToFour as u}from"./PatchRenderData.js";import{internalAssert as d,enableTerrainInternalChecks as f,neighborEdgeIndices as m,almostEquals as g}from"./terrainUtils.js";import{isCornerNeighbor as h}from"./Tile.js";import{compareTilesByLij as p}from"./tileUtils.js";import{compressNormal as x}from"../webgl-engine/lib/Normals.js";const M=65536;function S(e,t){const{tile:n,geometry:r,geometryState:s}=e,{extentInRadians:a,surface:c}=n,{isWebMercator:l,renderer:u}=c,{numVerticesPerSide:d,wireframe:f}=s,m=d-1,g=(d-2)**2,h=l&&(t===i.HAS_SOUTH_POLE||t===i.HAS_BOTH_POLES),p=l&&(t===i.HAS_NORTH_POLE||t===i.HAS_BOTH_POLES),x=((h?1:0)+(p?1:0))*he*d,M=fe(s),S=g+x+4*M,V=u.tileGeometryCache.acquire(S);r.numVerticesPerSide=d,r.vertexAttributes=V,r.maxEdgeVertexCount=M;const{boundingBox:B}=r;o(B);const I=O(e);se.update(m,a,I),v(e),r.poleVerticesStartIndex=g;const L=y(e,h,p);r.edgeVerticesStartIndex=g+x,X(e),b(e),W(r,L,f),e.intersectionData=null}function y(e,t,o){const{tile:r,localOrigin:s,geometry:i}=e,{extent:a,ellipsoid:c}=r,{boundingBox:l,numVerticesPerSide:u,vertexAttributes:d,poleVerticesStartIndex:f}=i,m=u-1,g=s[0],h=s[1],p=s[2],M=c.radius,S=a[1],y=a[3],v=[];let V=f;const B=(e,t)=>{const o=t*u;de(-g,-h,e*M-p,l),v.push(new oe(1===e,o,1===e?0:2,V,he));const r=A(-1===e?S:y,M),s=e*Math.PI/2-r,i=.99*(1===e?1:-1),a=M+0,{position:c,uv0:f}=d,{typedBuffer:B,typedBufferStride:I}=d.normalCompressed;for(let u=1;u<=he;++u){const e=r+s*(u/he),t=Math.cos(e),o=Math.sin(e);for(let r=0;r<=m;r++){const e=r/m,s=se.sinLonLUT[r],u=se.cosLonLUT[r]*t,d=s*t,M=o,S=u*a-g,y=d*a-h,v=M*a-p;de(S,y,v,l),c.setValues(V,S,y,v),f.setValues(V,Math.round(e*n),Math.round(i*n)),x(B,V,u,d,M,I),++V}}};return t&&B(-1,0),o&&B(1,m),v}function v(e){const{tile:t}=e;if(!t.intersectsClippingArea)return;const{geometry:o,geometryState:r,localOrigin:i}=e,{numVerticesPerSide:a,samplerData:c}=r,l=a-2,u=a-1,{vertexAttributes:d,boundingBox:f}=o,{position:m,uv0:g}=d,{typedBuffer:h,typedBufferStride:p}=d.normalCompressed,{extent:M}=t,S=M[0],y=M[2],v=M[1],V=M[3],B=t.ellipsoid.radius,I=i[0],b=i[1],L=i[2],C=m.typedBuffer,A=m.typedBufferStride,P=1/u;let E=0;if(1<=l){const e=P,t=v*(1-e)+V*e,o=se.sinLatLUT[1],r=se.cosLatLUT[1];for(let i=1;i<=l;i++){const a=i*P,l=S*(1-a)+y*a,u=se.sinLonLUT[i],d=se.cosLonLUT[i],m=B+s(l,t,c),h=m*d*r-I,p=m*u*r-b,x=m*o-L;de(h,p,x,f);const M=(i-1)*A;C[M]=h,C[M+1]=p,C[M+2]=x,g.setValues(i-1,Math.round(a*n),Math.round(e*n))}}for(let O=1;O<=l;O++){const e=O*P,t=v*(1-e)+V*e,o=se.sinLatLUT[O],r=se.cosLatLUT[O],i=O+1,a=i*P,d=v*(1-a)+V*a,m=se.sinLatLUT[i],M=se.cosLatLUT[i],T=se.sinLonLUT[0],D=se.cosLonLUT[0],R=B+s(S,t,c);let U=D*r*R-I,N=T*r*R-b,w=o*R-L;const j=E*A;let F=C[j],H=C[j+1],q=C[j+2];for(let V=1;V<=l;V++){const e=V*P,i=S*(1-e)+y*e,T=se.sinLonLUT[V],D=se.cosLonLUT[V];let R=0,j=0,_=0;if(V<l){const e=(E+1)*A;R=C[e],j=C[e+1],_=C[e+2]}else{const e=se.sinLonLUT[u],n=se.cosLonLUT[u],i=B+s(y,t,c);R=n*r*i-I,j=e*r*i-b,_=o*i-L}const W=U,k=N,z=w;U=F,N=H,w=q,F=R,H=j,q=_;const G=R-W,J=j-k,K=_-z;let Q=0,X=0,Y=0;if(O>1){const e=(E-l)*A;Q=C[e],X=C[e+1],Y=C[e+2]}else{const e=se.sinLatLUT[0],t=se.cosLatLUT[0],n=B+s(i,v,c);Q=D*t*n-I,X=T*t*n-b,Y=e*n-L}const Z=B+s(i,d,c),$=D*M*Z-I,ee=T*M*Z-b,te=m*Z-L;if(O<l){const t=E+l,o=t*A;C[o]=$,C[o+1]=ee,C[o+2]=te,de($,ee,te,f),g.setValues(t,Math.round(e*n),Math.round(a*n))}const ne=Q-$,oe=X-ee,re=Y-te;let ie=D*r,ae=T*r,ce=o;ce*ce<.999&&(ie=K*oe-J*re,ae=G*re-K*ne,ce=J*ne-G*oe);const le=1/Math.sqrt(ie*ie+ae*ae+ce*ce);x(h,E,ie*le,ae*le,ce*le,p),++E}}}function V(e){e.tile.intersectsClippingArea&&(b(e),te(e),e.intersectionData=null)}function B(e){e.tile.intersectsClippingArea&&(Y(e),b(e),te(e),ne(e),e.intersectionData=null)}function I(e){e.tile.intersectsClippingArea&&(C(e),L(e,!0),te(e),e.intersectionData=null)}function b(e){e.tile.intersectsClippingArea&&(C(e),L(e))}function L(t,o=!1){const{geometry:r,geometryState:i,tile:a,localOrigin:c}=t,{level:u,extent:h,extentInRadians:x,ellipsoid:M}=a,S=M.radius,y=x[0],v=x[2],V=x[1],B=x[3],{samplerData:I}=i,b=h[0],L=h[2],C=h[1],A=h[3],P=O(t),{boundingBox:E,vertexAttributes:T}=r,D=c[0],R=c[1],U=c[2],{position:N,uv0:w}=T,j=N.typedBuffer,F=N.typedBufferStride;for(let O=0;O<4;++O){const c=1===O||3===O,x=i.edgeResolutions[O];d(e(x));const M=x+1,T=l(a,i.edgePeerNeighbors[O]);if(ce(a,T,O)){Z(t,O,T);continue}const N=null!=T;d(!N||T.level===a.level),d(!N||p(a,T)<=0);const H=T?.renderData,q=H?.geometryState;if(f){const e=a.surface;if(!T&&e&&!e.updatingRootTiles){const t=m[O],n=a.findNeighborTile(t,(e=>e.loaded||e.leaf||e.level===a.level));n?n.intersectsClippingArea&&(d(!n.loaded),d(!n.leaf),d(n.level===u)):d(null==e?.rootTiles||!a.shouldHaveNeighbor(t))}}const _=1===O?h[2]:h[0],W=T?.extent,k=W&&c?1===O?W[0]:W[2]:_,z=0===O?h[3]:h[1],G=1===O?1:0,J=0===O?1:0,K=1===O?v:y,Q=0===O?B:V,X=Math.sin(K),Y=Math.cos(K),$=Math.sin(Q),ee=Math.cos(Q),te=q?.samplerData,ne=N?(e,t,n)=>.5*(s(e,t,I)+s(n,t,te)):(e,t,n)=>s(e,t,I),oe=r.outerEdgesOffsetAndLength[2*O+0],re=o&&M>3?M-3:1,se=null!=I&&I.some((e=>null!=e)),ie=null!=te&&te.some((e=>null!=e)),ae=se||ie,le=1/x,ue=oe;d(!W||g(W[2]-W[0],h[2]-h[0]));(()=>{const e=1===O?-1:3===O?1:0,t=0===O?-1:2===O?1:0,o=(h[2]-h[0])*le,i=e*o,a=t*o,l=c?e*((v-y)*le):0,u=c?0:t*le,d=J,f=c?K+l:K,m=c?Math.sin(f):X,g=c?Math.cos(f):Y,p=c?K-l:K,x=c?Math.sin(p):X,V=c?Math.cos(p):Y,B=c?Q:P(d+u),T=c?$:Math.sin(B),H=c?ee:Math.cos(B),q=c?Q:P(d-u),W=c?$:Math.sin(q),Z=c?ee:Math.cos(q);let oe=0,se=0,ie=0;{const e=0*le,t=c?_:b*(1-e)+L*e,n=c?k:t,o=c?C*(1-e)+A*e:z,r=c?K:y*(1-e)+v*e,s=c?X:Math.sin(r),i=c?Y:Math.cos(r),a=c?P(e):Q,l=c?Math.sin(a):$,u=c?Math.cos(a):ee,d=S+ne(t,o,n);oe=i*u*d,se=s*u*d,ie=l*d}let ce=0,fe=0,me=0;{const e=1*le,t=c?_:b*(1-e)+L*e,n=c?k:t,o=c?C*(1-e)+A*e:z,r=c?K:y*(1-e)+v*e,s=c?X:Math.sin(r),i=c?Y:Math.cos(r),a=c?P(e):Q,l=c?Math.sin(a):$,u=c?Math.cos(a):ee,d=S+ne(t,o,n);ce=i*u*d,fe=s*u*d,me=l*d}for(let h=1;h<M-1;h+=re){let e=0,t=0,o=0;{const n=(h+1)*le,r=c?_:b*(1-n)+L*n,s=c?k:r,i=c?C*(1-n)+A*n:z,a=c?K:y*(1-n)+v*n,l=c?X:Math.sin(a),u=c?Y:Math.cos(a),d=c?P(n):Q,f=c?Math.sin(d):$,m=c?Math.cos(d):ee,g=S+ne(r,i,s);e=u*m*g,t=l*m*g,o=f*g}const l=e,u=t,d=o,f=ce,p=fe,M=me;ce=l,fe=u,me=d;{const e=ue+h,t=e*F,o=f-D,r=p-R,s=M-U;j[t]=o,j[t+1]=r,j[t+2]=s,de(o,r,s,E);const i=h*le,a=c?G:i,l=c?i:J;w.setValues(e,Math.round(a*n),Math.round(l*n))}const B=oe,q=se,re=ie;oe=f,se=p,ie=M;const ge=f,he=p,pe=M,xe=1/Math.sqrt(ge*ge+he*he+pe*pe),Me=pe*xe;let Se=0,ye=0,ve=0;if(ae&&Me*Me<.999){let e=0,t=0,n=0;{const o=0===O?-1:1;e=o*(l-B),t=o*(u-q),n=o*(d-re)}{const o=h*le,r=c?_:b*(1-o)+L*o,l=c?k:r,u=c?C*(1-o)+A*o:z,d=c?K:y*(1-o)+v*o,f=c?X:Math.sin(d),p=c?Y:Math.cos(d),M=c?P(o):Q,B=c?Math.sin(M):$,E=c?Math.cos(M):ee;let D=ge,R=he,U=pe;if(N){const e=S+s(l-i,u-a,te),t=c?E:Z;D=(c?V:p)*t*e,R=(c?x:f)*t*e,U=(c?B:W)*e}{const o=S+s(r+i,u+a,I),l=c?E:H,d=(c?g:p)*l*o,h=(c?m:f)*l*o,x=(c?B:T)*o;N||(D=2*ge-d,R=2*he-h,U=2*pe-x);const M=3===O?-1:1,y=M*(D-d),v=M*(R-h),V=M*(U-x);Se=n*v-t*V,ye=e*V-n*y,ve=t*y-e*v;const b=1/Math.sqrt(Se*Se+ye*ye+ve*ve);Se*=b,ye*=b,ve*=b}}}else Se=ge*xe,ye=he*xe,ve=pe*xe;r.setEdgeNormalFromValues(O,h,Se,ye,ve)}})()}}function C(e){$(e)}function A(e,t){return Math.PI/2-2*Math.atan(Math.exp(-e/t))}function P(e,t,n,o){return A(e*(1-o)+t*o,n)}function E(e,t,n){return e*(1-n)+t*n}function O(e){const{tile:t}=e;if(t.surface.isWebMercator){const e=t.extent,n=t.ellipsoid.radius;return t=>P(e[1],e[3],n,t)}const n=t.extentInRadians;return e=>E(n[1],n[3],e)}function T(e,t){const{tile:n,geometryState:r,geometry:s}=e,{extent:i,surface:a}=n,{wireframe:c}=r,l=i[0],u=i[1],d=i[2]-l,f=i[3]-u,{numVerticesPerSide:m,clippingArea:g}=r,h=null!=g?Math.max(0,(g[0]-l)/d):0,p=null!=g?Math.max(0,(g[1]-u)/f):0,x=null!=g?Math.min(1,(g[2]-l)/d):1,M=null!=g?Math.min(1,(g[3]-u)/f):1,S=(m-2)**2,y=fe(r),v=S+4*y,V=a.renderer.tileGeometryCache.acquire(v),{boundingBox:B}=s;o(B),s.numVerticesPerSide=m,s.vertexAttributes=V,s.maxEdgeVertexCount=y,s.minu=h,s.minv=p,s.maxu=x,s.maxv=M,D(e),s.edgeVerticesStartIndex=S,X(e),w(e),W(s,[],c),e.intersectionData=null}function D(e){const o=e.tile;if(!o.intersectsClippingArea)return;const{geometry:r,geometryState:i,localOrigin:a}=e,{samplerData:c,clippingArea:l,numVerticesPerSide:u}=i,{surface:d,extent:f,ellipsoid:m}=o,{isWebMercatorOnPlateCarree:g}=d,h=null!=l?l:ie,p=f[0],M=f[1],S=f[2],y=f[3],v=Math.max(p,h[0]),V=Math.min(S,h[2]),B=Math.max(M,h[1]),I=Math.min(y,h[3]),b=m.radius,L=o.horizontalScale,C=u-1,A=u-2,{minu:P,minv:E,maxu:O,maxv:T,boundingBox:D,vertexAttributes:R}=r,{position:U,uv0:N}=R,{typedBuffer:w,typedBufferStride:j}=R.normalCompressed,F=a[0],H=a[1],q=a[2],_=U.typedBuffer,W=U.typedBufferStride;let k=0;const z=t(M,B,I),G=g?(Math.PI/2-2*Math.atan(Math.exp(-z/b)))*b:z*L,J=1/C,K=t(M*(1-J)+y*J,B,I);let Q=G,X=g?(Math.PI/2-2*Math.atan(Math.exp(-K/b)))*b:K*L;for(let Y=1;Y<=A;Y++){const e=Y/C,o=t(M*(1-e)+y*e,B,I),r=t(e,E,T),i=X,a=(Y-1)/C,l=t(M*(1-a)+y*a,B,I),u=Q,d=(Y+1)/C,f=t(M*(1-d)+y*d,B,I),m=g?(Math.PI/2-2*Math.atan(Math.exp(-f/b)))*b:f*L,h=t(d,E,T);Q=X,X=m;const R=t(p,v,V);let U=R*L,z=s(R,o,c);const G=1/C,J=t(G,P,O),K=t(p*(1-J)+S*J,v,V);let Z=J,$=K,ee=K*L,te=s(K,o,c);if(1===Y){const e=ee-F,o=Q-H,s=te-q,i=0*W;_[i]=e,_[i+1]=o,_[i+2]=s,de(e,o,s,D);const a=t(G,P,O);N.setValues(k,Math.round(a*n),Math.round(r*n))}for(let g=1;g<=A;g++){const e=ee,a=te,d=(g+1)/C,M=t(d,P,O),y=t(p*(1-d)+S*d,v,V),B=$;$=y;{const e=k+1,t=e*W;if(1===Y||g===A){const a=y*L,l=s(y,o,c);if(1===Y&&g<A){const o=a-F,s=i-H,c=l-q;_[t]=o,_[t+1]=s,_[t+2]=c,de(o,s,c,D),N.setValues(e,Math.round(M*n),Math.round(r*n))}ee=a,te=l}else ee=_[t]+F,te=_[t+2]+q}const I=ee,b=te,E=U,T=z;U=e,z=a;const R=(k-A)*W,G=1===Y?s(B,l,c):_[R+2]+q,J=s(B,f,c);if(Y<A){const t=k+A,o=t*W,r=e-F,s=m-H,i=J-q;_[o]=r,_[o+1]=s,_[o+2]=i,de(r,s,i,D);const a=Z;Z=M,N.setValues(t,Math.round(a*n),Math.round(h*n))}{const e=I-E,t=u-m,n=t*(b-T),o=e*(G-J),r=-t*e,s=n*n+o*o+r*r;if(0===s)x(w,k,0,0,1,j);else{const e=1/Math.sqrt(s);x(w,k,n*e,o*e,r*e,j)}}++k}}}function R(e,t){e.tile.intersectsClippingArea&&(F(e),j(e,!0),te(e),e.intersectionData=null)}function U(e,t){e.tile.intersectsClippingArea&&(Y(e),w(e),te(e),ne(e),e.intersectionData=null)}function N(e,t){e.tile.intersectsClippingArea&&(w(e),te(e),e.intersectionData=null)}function w(e,t){e.tile.intersectsClippingArea&&(F(e),j(e,!1))}function j(n,o){const{geometry:r,geometryState:i,localOrigin:a}=n,c=n.tile,{surface:u,extent:g}=c,{clippingArea:h,samplerData:x}=i,M=null!=h?h:ie,S=g[0],y=g[2],v=g[1],V=g[3],B=[V>M[3],y>M[2],v<M[1],S<M[0]],I=c.horizontalScale,b=_(u.isWebMercatorOnPlateCarree,c.ellipsoid.radius,I),{minu:L,minv:C,maxu:A,maxv:P,boundingBox:E}=r,O=Math.max(S,M[0]),T=Math.min(y,M[2]),D=Math.max(v,M[1]),R=Math.min(V,M[3]),U=a[0],N=a[1],w=a[2];for(let j=0;j<4;++j){const a=1===j||3===j,g=i.edgeResolutions[j];d(e(g));const h=g+1,M=B[j],F=l(c,i.edgePeerNeighbors[j]);if(!M&&ce(c,F,j)){Z(n,j,F);continue}const H=null!=F&&!M,q=F?.renderData,_=q?.geometryState;if(f&&(d(!H||F.level===c.level),d(!H||p(c,F)<=0),c&&!F&&!u.updatingRootTiles)){const e=m[j],t=c.findNeighborTile(e,(e=>e.loaded||e.leaf||e.level===c.level));u.updatingRootTiles||(t?t.intersectsClippingArea&&(d(!t.loaded),d(!t.leaf),d(t.level===c.level)):d(null==u?.rootTiles||!c.shouldHaveNeighbor(e)))}const W=t(1===j?y:S,O,T),k=t(0===j?V:v,D,R),z=_?.samplerData,G=o&&h>3?h-3:1,J=t(1===j?1:0,L,A),K=t(0===j?1:0,C,P),Q=H?(e,t)=>.5*(s(e,t,z)+s(e,t,x)):(e,t)=>s(e,t,x),X=(y-S)/g,Y=a?1===j?X:-X:0,$=a?0:0===j?X:-X,ee=-Y,te=-$;let ne=0,oe=0,re=0;{const e=0/g,n=a?W:t(S*(1-e)+y*e,O,T),o=a?t(v*(1-e)+V*e,D,R):k,r=Q(n,o);ne=n*I,oe=b(o),re=r}let se=0,ie=0,ae=0;{const e=1/g,n=a?W:t(S*(1-e)+y*e,O,T),o=a?t(v*(1-e)+V*e,D,R):k,r=Q(n,o);se=n*I,ie=b(o),ae=r}for(let e=1;e<h-1;e+=G){const n=e/g,o=se,i=ie,c=ae;{const s=a?J:t(n,L,A),l=a?t(n,C,P):K,u=o-U,d=i-N,f=c-w;de(o,d,f,E),r.setEdgeVertexFromValuesRawPositionUV(j,e,u,d,f,s,l)}{const n=(e+1)/g,o=a?W:t(S*(1-n)+y*n,O,T),r=a?t(v*(1-n)+V*n,D,R):k,s=Q(o,r);se=o*I,ie=b(r),ae=s}const l=se,u=ae,d=ne,f=oe,m=re;ne=o,oe=i,re=c;let h=0,p=0,M=0;if(a){const e=ie-i,r=u-c,a=f-i,l=m-c,d=t(v*(1-n)+V*n,D,R),g=W+ee,S=g*I-o,y=s(g,d,x)-c,B=3===j?-1:1;if(h=B*(-a+e)*y,p=B*S*(-l+r),M=-B*S*(-a+e),H){const t=W+Y,n=t*I-o;h=(-a+e)*(y-(s(t,d,z)-c)),p=(S-n)*(-l+r),M=-(S-n)*(-a+e)}}else{const e=l-o,r=u-c,a=d-o,f=m-c,g=t(S*(1-n)+y*n,O,T),v=k+te,V=s(g,v,x)-c,B=b(v)-i,I=2===j?-1:1;if(h=I*B*(-f+r),p=I*(-a+e)*V,M=-I*B*(-a+e),H){const t=g,n=k+$,o=b(n)-i;h=(-B+o)*(-f+r),p=(-a+e)*(-V+(s(t,n,z)-c)),M=-(-B+o)*(-a+e)}}const B=1/Math.sqrt(h*h+p*p+M*M);r.setEdgeNormalFromValues(j,e,h*B,p*B,M*B)}}}function F(e,t){$(e)}function H(e,t){return(Math.PI/2-2*Math.atan(Math.exp(-e/t)))*t}function q(e,t){return e*t}function _(e,t,n){return e?e=>H(e,t):e=>q(e,n)}function W(e,t,n){const{numVerticesPerSide:o,vertexAttributes:r,maxEdgeVertexCount:s}=e,i=o-1,a=r.count,c=2*(o-3)*(o-3),l=4*(i+s-3),d=u.reduce(((t,n)=>t+(i+e.getEdgeCount(n)-3)),0),f=t.reduce(((e,t)=>e+i*(2*(t.latitudeResolution-1)+1)),0),m=3*(n?2:1),g=(c+l+f)*m,h=a>=M?new Uint32Array(g):new Uint16Array(g);for(let u=0;u<g;++u)h[u]=0;e.indices=h,e.indexCount=(c+d+f)*m,e.poleIndicesStartIndex=c*m,e.edgeIndicesStartIndex=(c+f)*m,n?(J(e),K(e,t),Q(e)):(k(e),z(e,t),G(e))}function k(e){const{numVerticesPerSide:t,indices:n,vertexAttributes:o}=e,{position:r}=o,{typedBuffer:s,typedBufferStride:i}=r,a=t-2,c=t-3,l=0,u=t-3;let d=0;for(let f=0;f<c;++f){const e=f*a;for(let t=l;t<u;++t){const o=e+t,r=o+1,c=r+a,l=c-1;me(o,r,c,l,i,s)?(n[d]=o,n[d+1]=r,n[d+2]=c,n[d+3]=c,n[d+4]=l,n[d+5]=o):(n[d]=o,n[d+1]=r,n[d+2]=l,n[d+3]=l,n[d+4]=r,n[d+5]=c),d+=6}}}function z(e,t){const{numVerticesPerSide:n,indices:o,poleIndicesStartIndex:r}=e,s=n-1;let i=r;for(const a of t){const t=a.isNorth?1:2,r=a.isNorth?2:1,c=a.isNorth?3:4,l=a.isNorth?4:3;let u=e.getEdgeVertexIndex(a.connectedOuterEdgeOffset,0),d=1;for(let e=0;e<a.latitudeResolution;++e){const f=0===e?a.rowOffset:u+n;for(let n=0;n<s;n++){const s=f+n;o[i]=u,o[i+t]=u+1,o[i+r]=s,e<a.latitudeResolution-1?(o[i+c]=u+1,o[i+l]=s+1,o[i+5]=s,i+=6):i+=3,u+=d}u=f,d=1}}}function G(e){const{indices:t,numVerticesPerSide:n,edgeIndicesStartIndex:o}=e,r=n-1,s=r-2;let i=o;for(let a=0;a<4;++a){const n=ue[a];let o=0,c=0;const l=e.getEdgeCount(a),u=n.count;d(u===r-1);const f=1===a||2===a,m=f?1:2,g=f?2:1,h=e.getEdgeFirstVertexIndex(a),p=1,x=n.vertex0Index,M=n.stride;for(;o<l-1||c<u-1;){const e=x+c*M,n=h+o*p,a=o<l-1,d=c<u-1,f=a&&(!d||(a?0+r*(o+.5)/(l-1):0)<=(d?1+s*(c+.5)/(u-1):0));f?++o:++c;const S=f?n+p:e+M;t[i]=e,t[i+m]=n,t[i+g]=S,i+=3}}e.indexCount=i}function J(e){const{indices:t,numVerticesPerSide:n,vertexAttributes:o}=e,{position:r}=o,{typedBuffer:s,typedBufferStride:i}=r,a=n-2;let c=0;for(let l=0;l<n-3;++l){const e=l*a;for(let o=0;o<n-3;++o){const n=l*a+o,r=n+1,u=r+a,d=u-1,f=e+o,m=f+1,g=m+a;me(f,m,g,g-1,i,s)?(ge(t,c,n,r,u),c+=6,ge(t,c,u,d,n)):(ge(t,c,n,r,d),c+=6,ge(t,c,d,u,r)),c+=6}}}function K(e,t){const{indices:n,numVerticesPerSide:o,poleIndicesStartIndex:r}=e,s=o-1;let i=r;for(const a of t){const t=a.connectedOuterEdgeOffset;let r=e.getEdgeVertexIndex(t,0),c=1;for(let e=0;e<a.latitudeResolution;++e){const t=0===e?a.rowOffset:r+o;for(let o=0;o<s;o++)ge(n,i,r,r+1,t+o),i+=6,e<a.latitudeResolution-1&&(ge(n,i,r+1,t+o+1,t+o),i+=6),r+=c;r=t,c=1}}}function Q(e){const{indices:t,numVerticesPerSide:n,edgeIndicesStartIndex:o}=e,r=n-1,s=r-2;let i=o;for(let a=0;a<4;++a){const n=ue[a];let o=0,c=0;const l=e.getEdgeCount(a),u=n.count;d(u===r-1);const f=1===a||2===a,m=f?1:3,g=f?3:1,h=e.getEdgeFirstVertexIndex(a),p=1,x=n.vertex0Index,M=n.stride;for(;o<l-1||c<u-1;){const e=x+c*M,n=h+o*p,a=o<l-1,d=c<u-1,f=a&&(!d||(a?0+r*(o+.5)/(l-1):0)<=(d?1+s*(c+.5)/(u-1):0));f?++o:++c;const S=f?n+p:e+M;t[i]=e,t[i+m]=n,t[i+m+1]=n,t[i+g]=S,t[i+g+1]=S,t[i+5]=e,i+=6}}e.indexCount=i}function X(e){const{geometry:t,geometryState:n}=e,{edgeResolutions:o}=n,{numVerticesPerSide:r,edgeVerticesStartIndex:s}=t,i=r-2;let a=s;for(let c=0;c<4;++c){{const e=0===c||2===c,t=(0===c?i-1:0)*i+(1===c?i-1:0),n=(e?0:1)*i+(e?1:0),o=ue[c];o.vertex0Index=t,o.stride=n,o.count=i}{const e=o[c]+1;t.outerEdgesOffsetAndLength[2*c+0]=a,t.outerEdgesOffsetAndLength[2*c+1]=e,a+=e}}}function Y(e){X(e),e.geometryState.wireframe?Q(e.geometry):G(e.geometry)}function Z(o,r,s){const{geometryState:i,geometry:a,tile:c,localOrigin:l}=o,u=1===r||3===r,f=i.edgeResolutions[r];d(e(f));const m=f+1,{boundingBox:g,minu:h,minv:p,maxu:x,maxv:M,vertexAttributes:S}=a,y=t(1===r?1:0,h,x),v=t(0===r?1:0,p,M),V=s.renderData,B=V.geometryState,I=V.geometry,b=(r+2)%4,L=I.getEdgeCount(b),C=c.getNeighborEdgeStartVertexIndex(r,s)*f,A=f*2**(c.level-s.level);d(B.edgeResolutions[b]===A),d(L-1===A);const P=V.localOrigin[0]-l[0],E=V.localOrigin[1]-l[1],O=V.localOrigin[2]-l[2],T=a.getEdgeFirstVertexIndex(r),{position:D,uv0:R}=S,U=D.typedBuffer,N=D.typedBufferStride,w=S.normalCompressed,j=w.typedBuffer,F=w.typedBufferStride,H=I.vertexAttributes,q=I.getEdgeFirstVertexIndex(b),_=H.position.typedBuffer,W=H.position.typedBufferStride,k=H.normalCompressed.typedBuffer,z=H.normalCompressed.typedBufferStride;for(let e=1;e<m-1;++e){const o=T+e,r=q+(C+e),s=o*N,i=r*W,a=_[i]+P,c=_[i+1]+E,l=_[i+2]+O;U[s]=a,U[s+1]=c,U[s+2]=l,de(a,c,l,g);const d=o*F,m=r*z;j[d]=k[m],j[d+1]=k[m+1];const S=e/f,V=u?y:t(S,h,x),B=u?t(S,p,M):v;R.setValues(o,Math.round(V*n),Math.round(B*n))}}function $(e){const{geometry:o,geometryState:r,localOrigin:i}=e,{clippingArea:a,samplerData:c}=r,{minu:l,minv:u,maxu:f,maxv:m,boundingBox:g,vertexAttributes:h}=o,x=e.tile,{surface:M,ellipsoid:S,extent:y,extentInRadians:v,horizontalScale:V}=x,B="local"===M.view?.viewingMode,I=S.radius;let b=0,L=0,C=0;const A=(e,t,n)=>{const o=v[0===t?1:3],r=v[0===e?0:2],s=Math.cos(o),i=Math.sin(o),a=Math.sin(r),c=Math.cos(r),l=I+n;b=c*s*l,L=a*s*l,C=i*l},P=B?(()=>{const e=a,n=null!=e&&(y[3]>e[3]||y[2]>e[2]||y[1]<e[1]||y[0]<e[0]),o=_(M.isWebMercatorOnPlateCarree,I,V);return(r,s,i)=>{const a=0===r?y[0]:y[2],c=0===s?y[1]:y[3],l=n?t(a,e[0],e[2]):a,u=n?t(c,e[1],e[3]):c,d=i;b=l*V,L=o(u),C=d}})():A;let E=0,T=0,D=0,R=0,U=0,N=0,w=0,j=0,F=0;const H=B&&M.isWebMercatorOnPlateCarree,q=(e,t,n,o,r)=>{let s=0,i=0,a=0;if(B){const e=t*V,r=H?(Math.PI/2-2*Math.atan(Math.exp(-n/I)))*I:n*V;s=e-b,i=r-L,a=o-C}else{const r=O(e),c=e.tile,l=c.extent,u=c.extentInRadians,d=(t-l[0])/(l[2]-l[0]),f=(n-l[1])/(l[3]-l[1]),m=u[0]*(1-d)+u[2]*d,g=r(f),h=Math.cos(g),p=Math.sin(g),x=Math.sin(m),M=Math.cos(m),S=I+o;s=M*h*S-b,i=x*h*S-L,a=p*S-C}switch(r){case 0:w+=s,j+=i,F+=a;break;case 1:R-=s,U-=i,N-=a;break;case 2:w-=s,j-=i,F-=a;break;case 3:R+=s,U+=i,N+=a}},W=a??ie,k=y[0],z=y[2],G=y[1],J=y[3],K=[J>W[3],z>W[2],G<W[1],k<W[0]],Q=Math.max(k,W[0]),X=Math.min(z,W[2]),Y=Math.max(G,W[1]),Z=Math.min(J,W[3]),$=e=>Math.max(W[0],Math.min(W[2],e)),te=e=>Math.max(W[1],Math.min(W[3],e)),ne=e=>{const t=r.cornerNeighborCornerTiles;E=0,T=0,D=1,R=0,U=0,N=0,w=0,j=0,F=0;let n=1/0;for(let r=0;r<4;++r){const o=t[4*e+r];n=Math.min(n,o?.level??1/0)}for(let r=0;r<4;++r){const o=t[4*e+r];ae[r]=o?.level===n?o:null}let o=1,i=0;for(let r=0;r<4;++r){const e=ae[r];e&&(o=Math.max(o,e?.renderData.geometryState.numVerticesPerSide),i=e.extent[2]-e.extent[0])}const a=i,c=o;d(c>1);const l=a/c;for(let r=0;r<4;++r){const e=ae[(r+3)%4],t=ae[r%4];if(!e&&!t)continue;const n=0===r?1:1===r?2:2===r?3:0,o=0===r?2:1===r?3:2===r?0:1;if(e&&t){const i=re[r][0]*l,a=re[r][1]*l,c=e.extent,u=$(c[0===n||1===n?2:0]+i),d=te(c[0===n||3===n?3:1]+a),f=t.extent,m=$(f[0===o||1===o?2:0]+i),g=te(f[0===o||3===o?3:1]+a),h=e.renderData,p=t.renderData,x=s(u,d,h.geometryState.samplerData),M=s(m,g,p.geometryState.samplerData);q(h,u,d,.5*(x+M),r)}else{const i=e??t,a=e?n:o,c=i.extent,u=re[r],d=$(c[0===a||1===a?2:0]+u[0]*l),f=te(c[0===a||3===a?3:1]+u[1]*l),m=i.renderData,g=s(d,f,m.geometryState.samplerData);q(m,d,f,g,r)}}if(!B){const e=Math.sqrt(b*b+L*L+C*C);E=b/e,T=L/e,D=C/e}if(B||D*D<.999){const e=Math.sqrt(R*R+U*U+N*N);R/=e,U/=e,N/=e;const t=Math.sqrt(w*w+j*j+F*F);w/=t,j/=t,F/=t,E=N*j-U*F,T=R*F-N*w,D=U*w-R*j;const n=1/Math.sqrt(E*E+T*T+D*D);E*=n,T*=n,D*=n}},oe=r.cornerNeighborCornerTiles;for(let O=0;O<4;++O){const e=O,a=(O+1)%4,M=0===O||1===O?1:0,S=0===O||3===O?1:0,y=t(M,l,f),v=t(S,u,m),V=o.getEdgeFirstVertexIndex(e),B=o.getEdgeCount(e),I=0===O||3===O?B-1:0,A=o.getEdgeFirstVertexIndex(a),R=o.getEdgeCount(a),U=0===O||1===O?R-1:0;let N=-1;for(let t=0;t<4;++t){const e=oe[4*O+t],n=oe[4*O+N];e&&(-1===N||p(n,e)>0)&&(N=t)}const w=N,j=oe[4*O+w];if(j!==x){const e=x.level-j.level,t=2**e,o=[j.lij[0]+e,j.lij[1]*t,j.lij[2]*t],s=[o[1]+t===x.lij[1],0===O&&(1===w||0===w&&j!==oe[4*O+3])||1===O&&(0===w||1===w&&j!==oe[4*O+2]),o[1]===x.lij[1]+1,2===O&&(3===w||2===w&&j!==oe[4*O+1])||3===O&&(2===w||3===w&&j!==oe[4*O+0])],a=s.reduce(((e,t)=>e+(t?1:0)),0);d(1===a||2===a);let c=-1,l=-1;const u=j.renderData;if(1===a){const e=s.findIndex((e=>e));d(0<=e&&e<=3),c=(e+2)%4;const t=r.edgeResolutions[e];l=x.getNeighborEdgeStartVertexIndex(e,j)*t+t*(0===e&&0===O||1===e&&0===O||2===e&&1===O||3===e&&3===O?1:0)}else{d(s[1]||s[3]),c=s[1]?3:1;const e=u.geometryState.edgeResolutions[c];l=0===O||3===O?0:e}const f=u.geometry;{const e=V+I,t=A+U,o=f.getEdgeFirstVertexIndex(c)+l,r=f.vertexAttributes,s=u.localOrigin,a=r.position,d=a.typedBuffer,m=o*a.typedBufferStride,p=d[m]+s[0]-i[0],x=d[m+1]+s[1]-i[1],M=d[m+2]+s[2]-i[2];de(p,x,M,g);const S=h.position,B=S.typedBuffer,b=e*S.typedBufferStride;B[b]=p,B[b+1]=x,B[b+2]=M;const L=t*S.typedBufferStride;B[L]=p,B[L+1]=x,B[L+2]=M;const C=h.uv0;C.setValues(e,Math.round(y*n),Math.round(v*n)),C.setValues(t,Math.round(y*n),Math.round(v*n));{const n=r.normalCompressed.typedBuffer,s=o*r.normalCompressed.typedBufferStride,i=h.normalCompressed,a=i.typedBuffer;{const t=e*i.typedBufferStride;a[t]=n[s],a[t+1]=n[s+1]}{const e=t*i.typedBufferStride;a[e]=n[s],a[e+1]=n[s+1]}}}}else{const n=K[e],r=K[a];let l;if(n||r){const e=t(k*(1-M)+z*M,Q,X),n=t(G*(1-S)+J*S,Y,Z);l=s(e,n,c)}else l=ee(oe,O);P(M,S,l),ne(O);const u=b-i[0],d=L-i[1],f=C-i[2];de(u,d,f,g),o.setEdgeVertexFromValuesRawPositionUVNormal(e,I,u,d,f,y,v,E,T,D),o.setEdgeVertexFromValuesRawPositionUVNormal(a,U,u,d,f,y,v,E,T,D)}}for(let t=0;t<4;++t)ae[t]=null}function ee(e,t){const n=4*t,o=u.reduce(((t,o)=>Math.min(t,e[n+o]?.level??1/0)),1/0);f&&(d(!e[n+0]||!e[n+2]||h(e[n+0],e[n+2],a.SOUTH_WEST)),d(!e[n+1]||!e[n+3]||h(e[n+1],e[n+3],a.NORTH_WEST)));let r=0,i=0;for(let a=0;a<4;++a){const t=e[n+a];if(t&&t.level===o){const e=0===a||1===a,n=0===a||3===a,o=t.extent,c=o[e?0:2],l=o[n?1:3],u=t.renderData?.geometryState?.samplerData;i+=s(c,l,u),r++}}const c=r?i/r:0;return d(null!=c),c}function te(e){const{vao:t,geometry:n}=e,{vertexAttributes:o,edgeVerticesStartIndex:r}=n,s=o.position.typedBuffer;t.vertexBuffers.get("geometry").setSubData(s,r,r,s.length)}function ne(e){const{vao:t,geometry:n}=e,{indices:o,indexCount:r,edgeIndicesStartIndex:s}=n;t.indexBuffer.setSubData(o,s,s,r)}class oe{constructor(e,t,n,o,r){this.isNorth=e,this.connectedRowOffset=t,this.connectedOuterEdgeOffset=n,this.rowOffset=o,this.latitudeResolution=r}}const re=[[0,1],[1,0],[0,-1],[-1,0]],se=new c,ie=r(-1/0,-1/0,1/0,1/0),ae=[null,null,null,null];function ce(e,t,n){if(!t)return!1;const o=p(e,t);return o>0||0===o&&n>=2}class le{constructor(){this.vertex0Index=0,this.stride=1,this.count=0}getVertexIndex(e){return d(0<=e&&e<this.count),this.vertex0Index+this.stride*e}}const ue=[new le,new le,new le,new le];function de(e,t,n,o){e<o[0]?o[0]=e:e>o[3]&&(o[3]=e),t<o[1]?o[1]=t:t>o[4]&&(o[4]=t),n<o[2]?o[2]=n:n>o[5]&&(o[5]=n)}function fe(e){const{edgeResolutions:t,numVerticesPerSide:n}=e,o=1+Math.max(...t);return Math.max(n,o)}function me(e,t,n,o,r,s){const i=e*r,a=s[i],c=s[i+1],l=s[i+2],u=t*r,d=s[u],f=s[u+1],m=s[u+2],g=n*r,h=s[g],p=s[g+1],x=s[g+2],M=o*r,S=s[M],y=s[M+1],v=s[M+2];return(d-S)*(d-S)+(f-y)*(f-y)+(m-v)*(m-v)>(a-h)*(a-h)+(c-p)*(c-p)+(l-x)*(l-x)}function ge(e,t,n,o,r){e[t]=n,e[t+1]=o,e[t+2]=o,e[t+3]=r,e[t+4]=r,e[t+5]=n}const he=6;export{T as createPlanarGlobePatch,S as createSphericalGlobePatch,I as updateCornerSpherical,R as updateCornersPlanar,U as updateEdgeElevationsAndResolutionsPlanar,B as updateEdgeElevationsAndResolutionsSpherical,N as updateEdgesAndCornersPlanar,V as updateEdgesAndCornersSpherical};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{newLayout as e}from"../support/buffer/InterleavedLayout.js";import{VertexAttribute as r}from"../webgl-engine/lib/VertexAttribute.js";const t=e().vec3f(r.POSITION).vec2f16(r.UV0).vec2i16(r.NORMALCOMPRESSED,{glNormalized:!0});export{t as terrainAttributesLayout};
5
+ import{newLayout as e}from"../support/buffer/InterleavedLayout.js";import{VertexAttribute as r}from"../webgl-engine/lib/VertexAttribute.js";const t=e().vec3f(r.POSITION).vec2u16(r.UV0,{glNormalized:!0}).vec2i16(r.NORMALCOMPRESSED,{glNormalized:!0});export{t as terrainAttributesLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{RenderbufferFormat as e}from"../../../webgl/enums.js";import{FramebufferObject as t}from"../../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as r}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as s}from"../../../webgl/TextureDescriptor.js";class o{constructor(e){this._rctx=e,this._fbos=new Map}get(e){return this._getPool(e)}dispose(){this._fbos.forEach((e=>e.dispose())),this._fbos.clear()}_getPool(o){const i=this._fbos.get(o);if(i)return i;const f=new t(this._rctx,new s(o),new r(e.DEPTH24_STENCIL8,o));return this._fbos.set(o,f),f}}export{o as MultiSizeFramebuffer};
5
+ import{SizedDepthStencilFormat as e}from"../../../webgl/enums.js";import{FramebufferObject as t}from"../../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as r}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as s}from"../../../webgl/TextureDescriptor.js";class o{constructor(e){this._rctx=e,this._fbos=new Map}get(e){return this._getPool(e)}dispose(){this._fbos.forEach((e=>e.dispose())),this._fbos.clear()}_getPool(o){const i=this._fbos.get(o);if(i)return i;const f=new t(this._rctx,new s(o),new r(e.DEPTH24_STENCIL8,o));return this._fbos.set(o,f),f}}export{o as MultiSizeFramebuffer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{RenderbufferFormat as R}from"../../webgl/enums.js";var G;!function(R){R[R.R8=33321]="R8",R[R.R8UI=33330]="R8UI",R[R.RG8=33323]="RG8",R[R.RG8UI=33336]="RG8UI",R[R.RGBA4=32854]="RGBA4",R[R.RGBA8=32856]="RGBA8",R[R.RGBA8_MIPMAP=42843]="RGBA8_MIPMAP",R[R.R16F=33325]="R16F",R[R.RGBA16F=34842]="RGBA16F"}(G||(G={}));const A=R.DEPTH_COMPONENT16;export{G as ColorFormat,A as DepthRenderbuffer16f};
5
+ import{SizedDepthFormat as R}from"../../webgl/enums.js";var G;!function(R){R[R.R8=33321]="R8",R[R.R8UI=33330]="R8UI",R[R.RG8=33323]="RG8",R[R.RG8UI=33336]="RG8UI",R[R.RGBA4=32854]="RGBA4",R[R.RGBA8=32856]="RGBA8",R[R.RGBA8_MIPMAP=42843]="RGBA8_MIPMAP",R[R.R16F=33325]="R16F",R[R.RGBA16F=34842]="RGBA16F"}(G||(G={}));const A=R.DEPTH_COMPONENT16;export{G as ColorFormat,A as DepthRenderbuffer16f};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{ColorFormat as t,DepthRenderbuffer16f as r}from"../../webgl/formats.js";import{ManagedColorAttachment as a}from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthAttachment as o}from"../../webgl/ManagedDepthAttachment.js";import n from"../../webgl/ManagedFBO.js";import{AttachmentType as i}from"../../webgl/ManagedFBOResource.js";import{FBOPool as c}from"./FBOPool.js";import{PixelFormat as h,SizedPixelFormat as s,TextureWrapMode as m,TextureSamplingMode as l,PixelType as d,DepthStencilAttachment as _,RenderbufferFormat as p,ColorAttachment0 as u}from"../../../webgl/enums.js";import{FramebufferObject as f}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as w}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as E}from"../../../webgl/RenderbufferDescriptor.js";import{Texture as C}from"../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../webgl/TextureDescriptor.js";class A{constructor(e){this.rctx=e,this._acquired=new Set,this._cache=new c(e.newCache,"FBOCache"),this._depthCache=new c(e.newCache,"DepthAttachmentCache"),this._colorCache=new c(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.()}frameEnd(){const e=this.debugCallback;e&&this._acquired.forEach((t=>t.type===i.FBO&&e(t.name,t.fbo,t.numberOfColorAttachments)))}get usedMemory(){return Array.from(this._acquired.values()).reduce(((e,t)=>e+("getTexture"in t?t.getTexture()?.usedMemory??0:t.cachedMemory)),this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e}acquire(r,a,o,i=t.RGBA8){const c=T(i,r,a);let h=this._cache.pop(c);if(h){h.retain(),h.setName(o);const t=this.rctx.getBoundFramebufferObject();if(this.rctx.bindFramebuffer(h.fbo),this.rctx.setDrawBuffers([u]),!h.fbo)throw new e("renderer","attempt to use a not existing framebuffer");this.rctx.unbindTexture(h.fbo.colorTexture),this.rctx.bindFramebuffer(t)}else h=new n(c,o,new f(this.rctx,{...P[i],width:r,height:a}),(e=>{e??=_;const t=this._acquireDepth(e,h.fbo.width,h.fbo.height,`${h.name} depth`);return h.attachDepth(t),t.release(),h}),((e,o,n)=>{o??=t.RGBA8;const i=this._acquireColor(o,r,a,n??`${h.name} color ${e}`);return this.rctx.unbindTexture(i.attachment),h.attachColor(i,e),i.release(),h}),(()=>{this.debugCallback?.(h.name,h.fbo,h.numberOfColorAttachments),h.fbo?.invalidateAttachments([u],!0),this._acquired.delete(h),h.detachAll(),this._cache.put(h)}));return this._trackHandle(h)}acquireDepth(e,t,r,a){return this._acquireDepth(e,t,r,a)}_acquireDepth(e,t,r,a){const n=T(e,t,r),i=this._depthCache.pop(n);if(i)return i.retain(),i.name=a,this._trackHandle(i);const c=new o(n,e===_?new C(this.rctx,{...j[e],width:t,height:r}):new w(this.rctx,{...j[e],width:t,height:r}),(()=>{this._acquired.delete(c),this._depthCache.put(c)}));return c.name=a,this._trackHandle(c)}_acquireColor(e,t,r,o){const n=T(e,t,r),i=this._colorCache.pop(n);if(i)return i.retain(),i.name=o,this._trackHandle(i);const c=new a(n,new C(this.rctx,{...P[e],width:t,height:r}),(()=>{this._acquired.delete(c),this._colorCache.put(c)}));return c.name=o,this._trackHandle(c)}_trackHandle(e){return this._acquired.add(e),e}}const M=new n("default","default",null,(()=>M),(()=>M),(()=>{}));function T(e,t,r){return`${e}x${t}x${r}`}M.release=()=>!1;const R=new b;R.pixelFormat=h.RED,R.internalFormat=s.R8,R.wrapMode=m.CLAMP_TO_EDGE;const g=new b;g.pixelFormat=h.RED_INTEGER,g.internalFormat=s.R8UI,g.wrapMode=m.CLAMP_TO_EDGE,g.samplingMode=l.NEAREST;const F=new b;F.pixelFormat=h.RG,F.internalFormat=s.RG8,F.wrapMode=m.CLAMP_TO_EDGE;const x=new b;x.pixelFormat=h.RG_INTEGER,x.internalFormat=s.RG8UI,x.wrapMode=m.CLAMP_TO_EDGE,x.samplingMode=l.NEAREST;const D=new b;D.internalFormat=s.RGBA4,D.dataType=d.UNSIGNED_SHORT_4_4_4_4,D.wrapMode=m.CLAMP_TO_EDGE;const G=new b;G.wrapMode=m.CLAMP_TO_EDGE;const O=new b;O.wrapMode=m.CLAMP_TO_EDGE,O.samplingMode=l.LINEAR_MIPMAP_LINEAR,O.hasMipmap=!0,O.maxAnisotropy=8;const N=new b;N.pixelFormat=h.RED,N.dataType=d.HALF_FLOAT,N.internalFormat=s.R16F,N.samplingMode=l.NEAREST;const y=new b;y.dataType=d.HALF_FLOAT,y.internalFormat=s.RGBA16F,y.samplingMode=l.NEAREST;const P={[t.R8]:R,[t.R8UI]:g,[t.RG8]:F,[t.RG8UI]:x,[t.RGBA4]:D,[t.RGBA8]:G,[t.RGBA8_MIPMAP]:O,[t.R16F]:N,[t.RGBA16F]:y},L=new b;L.pixelFormat=h.DEPTH_STENCIL,L.dataType=d.UNSIGNED_INT_24_8,L.samplingMode=l.NEAREST,L.wrapMode=m.CLAMP_TO_EDGE,L.internalFormat=h.DEPTH24_STENCIL8;const j={[_]:L,[r]:new E(p.DEPTH_COMPONENT16,4)};export{A as FBOCache,M as defaultWebGLFBO};
5
+ import e from"../../../../core/Error.js";import{ColorFormat as t,DepthRenderbuffer16f as r}from"../../webgl/formats.js";import{ManagedColorAttachment as a}from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthAttachment as o}from"../../webgl/ManagedDepthAttachment.js";import n from"../../webgl/ManagedFBO.js";import{AttachmentType as i}from"../../webgl/ManagedFBOResource.js";import{FBOPool as c}from"./FBOPool.js";import{PixelFormat as h,SizedPixelFormat as s,TextureWrapMode as m,TextureSamplingMode as l,PixelType as d,UnsizedDepthFormat as _,SizedDepthStencilFormat as p,DepthStencilAttachment as u,SizedDepthFormat as f,ColorAttachment0 as w}from"../../../webgl/enums.js";import{FramebufferObject as E}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as C}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as b}from"../../../webgl/RenderbufferDescriptor.js";import{Texture as A}from"../../../webgl/Texture.js";import{TextureDescriptor as M}from"../../../webgl/TextureDescriptor.js";class T{constructor(e){this.rctx=e,this._acquired=new Set,this._cache=new c(e.newCache,"FBOCache"),this._depthCache=new c(e.newCache,"DepthAttachmentCache"),this._colorCache=new c(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.()}frameEnd(){const e=this.debugCallback;e&&this._acquired.forEach((t=>t.type===i.FBO&&e(t.name,t.fbo,t.numberOfColorAttachments)))}get usedMemory(){return Array.from(this._acquired.values()).reduce(((e,t)=>e+("getTexture"in t?t.getTexture()?.usedMemory??0:t.cachedMemory)),this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e}acquire(r,a,o,i=t.RGBA8){const c=g(i,r,a);let h=this._cache.pop(c);if(h){h.retain(),h.setName(o);const t=this.rctx.getBoundFramebufferObject();if(this.rctx.bindFramebuffer(h.fbo),this.rctx.setDrawBuffers([w]),!h.fbo)throw new e("renderer","attempt to use a not existing framebuffer");this.rctx.unbindTexture(h.fbo.colorTexture),this.rctx.bindFramebuffer(t)}else h=new n(c,o,new E(this.rctx,{...j[i],width:r,height:a}),(e=>{e??=u;const t=this._acquireDepth(e,h.fbo.width,h.fbo.height,`${h.name} depth`);return h.attachDepth(t),t.release(),h}),((e,o,n)=>{o??=t.RGBA8;const i=this._acquireColor(o,r,a,n??`${h.name} color ${e}`);return this.rctx.unbindTexture(i.attachment),h.attachColor(i,e),i.release(),h}),(()=>{this.debugCallback?.(h.name,h.fbo,h.numberOfColorAttachments),h.fbo?.invalidateAttachments([w],!0),this._acquired.delete(h),h.detachAll(),this._cache.put(h)}));return this._trackHandle(h)}acquireDepth(e,t,r,a){return this._acquireDepth(e,t,r,a)}_acquireDepth(e,t,r,a){const n=g(e,t,r),i=this._depthCache.pop(n);if(i)return i.retain(),i.name=a,this._trackHandle(i);const c=new o(n,e===u?new A(this.rctx,{...I[e],width:t,height:r}):new C(this.rctx,{...I[e],width:t,height:r}),(()=>{this._acquired.delete(c),this._depthCache.put(c)}));return c.name=a,this._trackHandle(c)}_acquireColor(e,t,r,o){const n=g(e,t,r),i=this._colorCache.pop(n);if(i)return i.retain(),i.name=o,this._trackHandle(i);const c=new a(n,new A(this.rctx,{...j[e],width:t,height:r}),(()=>{this._acquired.delete(c),this._colorCache.put(c)}));return c.name=o,this._trackHandle(c)}_trackHandle(e){return this._acquired.add(e),e}}const R=new n("default","default",null,(()=>R),(()=>R),(()=>{}));function g(e,t,r){return`${e}x${t}x${r}`}R.release=()=>!1;const F=new M;F.pixelFormat=h.RED,F.internalFormat=s.R8,F.wrapMode=m.CLAMP_TO_EDGE;const x=new M;x.pixelFormat=h.RED_INTEGER,x.internalFormat=s.R8UI,x.wrapMode=m.CLAMP_TO_EDGE,x.samplingMode=l.NEAREST;const D=new M;D.pixelFormat=h.RG,D.internalFormat=s.RG8,D.wrapMode=m.CLAMP_TO_EDGE;const G=new M;G.pixelFormat=h.RG_INTEGER,G.internalFormat=s.RG8UI,G.wrapMode=m.CLAMP_TO_EDGE,G.samplingMode=l.NEAREST;const O=new M;O.internalFormat=s.RGBA4,O.dataType=d.UNSIGNED_SHORT_4_4_4_4,O.wrapMode=m.CLAMP_TO_EDGE;const N=new M;N.wrapMode=m.CLAMP_TO_EDGE;const y=new M;y.wrapMode=m.CLAMP_TO_EDGE,y.samplingMode=l.LINEAR_MIPMAP_LINEAR,y.hasMipmap=!0,y.maxAnisotropy=8;const P=new M;P.pixelFormat=h.RED,P.dataType=d.HALF_FLOAT,P.internalFormat=s.R16F,P.samplingMode=l.NEAREST;const L=new M;L.dataType=d.HALF_FLOAT,L.internalFormat=s.RGBA16F,L.samplingMode=l.NEAREST;const j={[t.R8]:F,[t.R8UI]:x,[t.RG8]:D,[t.RG8UI]:G,[t.RGBA4]:O,[t.RGBA8]:N,[t.RGBA8_MIPMAP]:y,[t.R16F]:P,[t.RGBA16F]:L},B=new M;B.pixelFormat=_.DEPTH_STENCIL,B.dataType=d.UNSIGNED_INT_24_8,B.samplingMode=l.NEAREST,B.wrapMode=m.CLAMP_TO_EDGE,B.internalFormat=p.DEPTH24_STENCIL8;const I={[u]:B,[r]:new b(f.DEPTH_COMPONENT16,4)};export{T as FBOCache,R as defaultWebGLFBO};
@@ -2,18 +2,18 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{fromValues as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{Float2PassUniform as o}from"../../shaderModules/Float2PassUniform.js";import{Float3PassUniform as a}from"../../shaderModules/Float3PassUniform.js";import{Float4PassUniform as r}from"../../shaderModules/Float4PassUniform.js";import{Float4sPassUniform as i}from"../../shaderModules/Float4sPassUniform.js";import{FloatPassUniform as t}from"../../shaderModules/FloatPassUniform.js";import{FloatsPassUniform as v}from"../../shaderModules/FloatsPassUniform.js";import{glsl as l}from"../../shaderModules/glsl.js";import{VertexAttribute as s}from"../../../lib/VertexAttribute.js";import{vvColorNumber as c,VisualVariablePassParameters as p}from"../../../materials/VisualVariablePassParameters.js";const f=8;function n(e,p){e.attributes.add(s.POSITION,"vec3"),e.attributes.add(s.PROFILEVERTEXANDNORMAL,"vec4"),e.attributes.add(s.FEATUREVALUE,"vec4"),e.attributes.add(s.PROFILEAUXDATA,"vec2"),e.attributes.add(s.PROFILERIGHT,"vec2"),e.attributes.add(s.PROFILEUP,"vec2");const n=e.vertex;n.code.add(l`bool isCapVertex() {
6
- return featureValue.w == 1.0;
7
- }`),n.uniforms.add(new o("size",(e=>e.size))),p.vvSize?(n.uniforms.add(new a("vvSizeMinSize",(e=>e.vvSize.minSize)),new a("vvSizeMaxSize",(e=>e.vvSize.maxSize)),new a("vvSizeOffset",(e=>e.vvSize.offset)),new a("vvSizeFactor",(e=>e.vvSize.factor)),new a("vvSizeFallback",(e=>e.vvSize.fallback))),n.code.add(l`vec2 getSize() {
8
- float value = featureValue.x;
5
+ import{fromValues as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{Float2PassUniform as o}from"../../shaderModules/Float2PassUniform.js";import{Float3PassUniform as a}from"../../shaderModules/Float3PassUniform.js";import{Float4PassUniform as i}from"../../shaderModules/Float4PassUniform.js";import{Float4sPassUniform as r}from"../../shaderModules/Float4sPassUniform.js";import{FloatPassUniform as t}from"../../shaderModules/FloatPassUniform.js";import{FloatsPassUniform as v}from"../../shaderModules/FloatsPassUniform.js";import{glsl as l}from"../../shaderModules/glsl.js";import{VertexAttribute as s}from"../../../lib/VertexAttribute.js";import{vvColorNumber as c,VisualVariablePassParameters as p}from"../../../materials/VisualVariablePassParameters.js";const n=8;function f(e,p){const{attributes:f,vertex:d}=e;f.add(s.POSITION,"vec3"),f.add(s.PROFILEVERTEXANDNORMAL,"vec4"),f.add(s.PROFILEAUXDATA,"vec3"),f.add(s.PROFILERIGHT,"vec2"),f.add(s.PROFILEUP,"vec2"),d.code.add(l`bool isCapVertex() {
6
+ return profileAuxData.z == 1.0;
7
+ }`),d.uniforms.add(new o("size",(e=>e.size)));const{vvSize:u,vvColor:m,vvOpacity:x}=p;u?(f.add(s.SIZEFEATUREATTRIBUTE,"float"),d.uniforms.add(new a("vvSizeMinSize",(e=>e.vvSize.minSize)),new a("vvSizeMaxSize",(e=>e.vvSize.maxSize)),new a("vvSizeOffset",(e=>e.vvSize.offset)),new a("vvSizeFactor",(e=>e.vvSize.factor)),new a("vvSizeFallback",(e=>e.vvSize.fallback))),d.code.add(l`vec2 getSize() {
8
+ float value = sizeFeatureAttribute;
9
9
  if (isnan(value)) {
10
10
  return vvSizeFallback.xz;
11
11
  }
12
12
  return size * clamp(vvSizeOffset + value * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).xz;
13
- }`)):n.code.add(l`vec2 getSize(){
13
+ }`)):d.code.add(l`vec2 getSize(){
14
14
  return size;
15
- }`),p.vvOpacity?(n.constants.add("vvOpacityNumber","int",f),n.uniforms.add(new v("vvOpacityValues",(e=>e.vvOpacity.values),f),new v("vvOpacityOpacities",(e=>e.vvOpacity.opacityValues),f),new t("vvOpacityFallback",(e=>e.vvOpacity.fallback))),n.code.add(l`vec4 applyOpacity(vec4 color) {
16
- float value = featureValue.z;
15
+ }`),x?(f.add(s.OPACITYFEATUREATTRIBUTE,"float"),d.constants.add("vvOpacityNumber","int",n),d.uniforms.add(new v("vvOpacityValues",(e=>e.vvOpacity.values),n),new v("vvOpacityOpacities",(e=>e.vvOpacity.opacityValues),n),new t("vvOpacityFallback",(e=>e.vvOpacity.fallback))),d.code.add(l`vec4 applyOpacity(vec4 color) {
16
+ float value = opacityFeatureAttribute;
17
17
  if (isnan(value)) {
18
18
  return vec4(color.rgb, vvOpacityFallback);
19
19
  }
@@ -27,10 +27,10 @@ return vec4( color.xyz, mix(vvOpacityOpacities[i-1], vvOpacityOpacities[i], f));
27
27
  }
28
28
  }
29
29
  return vec4( color.xyz, vvOpacityOpacities[vvOpacityNumber - 1]);
30
- }`)):n.code.add(l`vec4 applyOpacity(vec4 color){
30
+ }`)):d.code.add(l`vec4 applyOpacity(vec4 color){
31
31
  return color;
32
- }`),p.vvColor?(n.constants.add("vvColorNumber","int",c),n.uniforms.add(new v("vvColorValues",(e=>e.vvColor.values),c),new i("vvColorColors",(e=>e.vvColor.colors),c),new r("vvColorFallback",(e=>e.vvColor.fallback))),n.code.add(l`vec4 getColor() {
33
- float value = featureValue.y;
32
+ }`),m?(f.add(s.COLORFEATUREATTRIBUTE,"float"),d.constants.add("vvColorNumber","int",c),d.uniforms.add(new v("vvColorValues",(e=>e.vvColor.values),c),new r("vvColorColors",(e=>e.vvColor.colors),c),new i("vvColorFallback",(e=>e.vvColor.fallback))),d.code.add(l`vec4 getColor() {
33
+ float value = colorFeatureAttribute;
34
34
  if (isnan(value)) {
35
35
  return applyOpacity(vvColorFallback);
36
36
  }
@@ -44,9 +44,9 @@ return applyOpacity(mix(vvColorColors[i-1], vvColorColors[i], f));
44
44
  }
45
45
  }
46
46
  return applyOpacity(vvColorColors[vvColorNumber - 1]);
47
- }`)):n.code.add(l`vec4 getColor(){
47
+ }`)):d.code.add(l`vec4 getColor(){
48
48
  return applyOpacity(vec4(1, 1, 1, 1));
49
- }`),n.code.add(l`vec3 decompressAxis(vec2 axis) {
49
+ }`),d.code.add(l`vec3 decompressAxis(vec2 axis) {
50
50
  float z = 1.0 - abs(axis.x) - abs(axis.y);
51
51
  return normalize(vec3(axis + sign(axis) * min(z, 0.0), z));
52
52
  }
@@ -55,14 +55,14 @@ vec2 size = getSize();
55
55
  vec3 origin = position;
56
56
  vec3 right = decompressAxis(profileRight);
57
57
  vec3 up = decompressAxis(profileUp);
58
- vec2 profileVertex = profileVertexAndNormal.xy * size;`),n.code.add(l`if(isCapVertex()) {
58
+ vec2 profileVertex = profileVertexAndNormal.xy * size;`),d.code.add(l`if(isCapVertex()) {
59
59
  float positionOffsetAlongProfilePlaneNormal = profileAuxData.x * size[0];
60
60
  vec3 forward = cross(up, right);
61
61
  vec3 offset = right * profileVertex.x + up * profileVertex.y + forward * positionOffsetAlongProfilePlaneNormal;
62
62
  return origin + offset;
63
63
  }
64
64
  vec2 rotationRight = vec2(profileAuxData.x, profileAuxData.y);
65
- float maxDistance = length(rotationRight);`),n.code.add(l`rotationRight = maxDistance > 0.0 ? normalize(rotationRight) : vec2(0, 0);
65
+ float maxDistance = length(rotationRight);`),d.code.add(l`rotationRight = maxDistance > 0.0 ? normalize(rotationRight) : vec2(0, 0);
66
66
  float rx = dot(profileVertex, rotationRight);
67
67
  if (abs(rx) > maxDistance) {
68
68
  vec2 rotationUp = vec2(-rotationRight.y, rotationRight.x);
@@ -71,7 +71,7 @@ profileVertex = rotationRight * maxDistance * sign(rx) + rotationUp * ry;
71
71
  }
72
72
  vec3 offset = right * profileVertex.x + up * profileVertex.y;
73
73
  return origin + offset;
74
- }`),n.code.add(l`vec3 localNormal() {
74
+ }`),d.code.add(l`vec3 localNormal() {
75
75
  vec3 right = decompressAxis(profileRight);
76
76
  vec3 up = decompressAxis(profileUp);
77
77
  vec3 normal = right * profileVertexAndNormal.z + up * profileVertexAndNormal.w;
@@ -80,4 +80,4 @@ vec3 forward = cross(up, right);
80
80
  normal += forward * profileAuxData.y;
81
81
  }
82
82
  return normal;
83
- }`)}class u extends p{constructor(){super(...arguments),this.size=e(1,1)}}export{n as PathVertexPosition,u as PathVertexPositionPassParameters};
83
+ }`)}class d extends p{constructor(){super(...arguments),this.size=e(1,1)}}export{f as PathVertexPosition,d as PathVertexPositionPassParameters};
@@ -2,14 +2,14 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{VisualVariables as i}from"../shading/VisualVariables.glsl.js";import{Float3PassUniform as t}from"../../shaderModules/Float3PassUniform.js";import{FloatPassUniform as e}from"../../shaderModules/FloatPassUniform.js";import{FloatsPassUniform as a}from"../../shaderModules/FloatsPassUniform.js";import{glsl as v}from"../../shaderModules/glsl.js";import{VertexAttribute as r}from"../../../lib/VertexAttribute.js";const o=8;function c(c,l){const s=c.vertex;s.uniforms.add(new e("intrinsicWidth",(i=>i.width))),l.vvSize?(c.attributes.add(r.SIZEFEATUREATTRIBUTE,"float"),s.uniforms.add(new t("vvSizeMinSize",(i=>i.vvSize.minSize)),new t("vvSizeMaxSize",(i=>i.vvSize.maxSize)),new t("vvSizeOffset",(i=>i.vvSize.offset)),new t("vvSizeFactor",(i=>i.vvSize.factor)),new t("vvSizeFallback",(i=>i.vvSize.fallback))),s.code.add(v`float getSize() {
5
+ import{VisualVariables as i}from"../shading/VisualVariables.glsl.js";import{Float3PassUniform as e}from"../../shaderModules/Float3PassUniform.js";import{FloatPassUniform as a}from"../../shaderModules/FloatPassUniform.js";import{FloatsPassUniform as t}from"../../shaderModules/FloatsPassUniform.js";import{glsl as v}from"../../shaderModules/glsl.js";import{VertexAttribute as r}from"../../../lib/VertexAttribute.js";const o=8;function c(c,l){const{vertex:s,attributes:n}=c;s.uniforms.add(new a("intrinsicWidth",(i=>i.width))),l.vvSize?(n.add(r.SIZEFEATUREATTRIBUTE,"float"),s.uniforms.add(new e("vvSizeMinSize",(i=>i.vvSize.minSize)),new e("vvSizeMaxSize",(i=>i.vvSize.maxSize)),new e("vvSizeOffset",(i=>i.vvSize.offset)),new e("vvSizeFactor",(i=>i.vvSize.factor)),new e("vvSizeFallback",(i=>i.vvSize.fallback))),s.code.add(v`float getSize() {
6
6
  if (isnan(sizeFeatureAttribute)) {
7
7
  return vvSizeFallback.x;
8
8
  }
9
9
  return intrinsicWidth * clamp(vvSizeOffset + sizeFeatureAttribute * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).x;
10
- }`)):(c.attributes.add(r.SIZE,"float"),s.code.add(v`float getSize(){
10
+ }`)):(n.add(r.SIZE,"float"),s.code.add(v`float getSize(){
11
11
  return intrinsicWidth * size;
12
- }`)),l.vvOpacity?(c.attributes.add(r.OPACITYFEATUREATTRIBUTE,"float"),s.constants.add("vvOpacityNumber","int",8),s.uniforms.add(new a("vvOpacityValues",(i=>i.vvOpacity.values),o),new a("vvOpacityOpacities",(i=>i.vvOpacity.opacityValues),o),new e("vvOpacityFallback",(i=>i.vvOpacity.fallback))),s.code.add(v`float interpolateOpacity(float value){
12
+ }`)),l.vvOpacity?(n.add(r.OPACITYFEATUREATTRIBUTE,"float"),s.constants.add("vvOpacityNumber","int",8),s.uniforms.add(new t("vvOpacityValues",(i=>i.vvOpacity.values),o),new t("vvOpacityOpacities",(i=>i.vvOpacity.opacityValues),o),new a("vvOpacityFallback",(i=>i.vvOpacity.fallback))),s.code.add(v`float interpolateOpacity(float value){
13
13
  if (isnan(value)) {
14
14
  return vvOpacityFallback;
15
15
  }
@@ -28,8 +28,8 @@ vec4 applyOpacity( vec4 color ){
28
28
  return vec4(color.xyz, interpolateOpacity(opacityFeatureAttribute));
29
29
  }`)):s.code.add(v`vec4 applyOpacity( vec4 color ){
30
30
  return color;
31
- }`),l.vvColor?(c.include(i,l),c.attributes.add(r.COLORFEATUREATTRIBUTE,"float"),s.code.add(v`vec4 getColor(){
31
+ }`),l.vvColor?(c.include(i,l),n.add(r.COLORFEATUREATTRIBUTE,"float"),s.code.add(v`vec4 getColor(){
32
32
  return applyOpacity(interpolateVVColor(colorFeatureAttribute));
33
- }`)):(c.attributes.add(r.COLOR,"vec4"),s.code.add(v`vec4 getColor(){
33
+ }`)):(n.add(r.COLOR,"vec4"),s.code.add(v`vec4 getColor(){
34
34
  return applyOpacity(color);
35
35
  }`))}export{c as RibbonVertexPosition};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/Logger.js";import{disposeMaybe as i}from"../../../../../core/maybe.js";import{Default3D as t}from"../../lib/DefaultVertexAttributeLocations.js";import{Program as r}from"../../lib/Program.js";import{PrimitiveType as o}from"../../../../webgl/enums.js";import{makePipelineState as s,blendWithPremultipliedAlpha as n,defaultColorWrite as a}from"../../../../webgl/renderState.js";const p=()=>e.getLogger("esri.views.3d.webgl.ShaderTechnique");class l{constructor(e,s,n,a=t){this.locations=a,this.primitiveType=o.TRIANGLES,this.key=s.key,this._program=new r(e.rctx,n.get().build(s),a),this._pipeline=this.initializePipeline(s),this.reload=async t=>{t&&await n.reload(),this.key.equals(s.key)||p().warn("Configuration was changed after construction, cannot reload shader.",n),i(this._program),this._program=new r(e.rctx,n.get().build(s),a),this._pipeline=this.initializePipeline(s)}}destroy(){this._program=i(this._program),this._pipeline=null}get program(){return this._program}get compiled(){return this.program.compiled}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,i){return this._pipeline}initializePipeline(e){return s({blending:n,colorWrite:a})}}export{l as ShaderTechnique};
5
+ import e from"../../../../../core/Logger.js";import{disposeMaybe as i}from"../../../../../core/maybe.js";import{Default3D as t}from"../../lib/DefaultVertexAttributeLocations.js";import{Program as r}from"../../lib/Program.js";import{PrimitiveType as o}from"../../../../webgl/enums.js";import{makePipelineState as s,premultipliedAlpha as n,defaultColorWrite as a}from"../../../../webgl/renderState.js";const p=()=>e.getLogger("esri.views.3d.webgl.ShaderTechnique");class l{constructor(e,s,n,a=t){this.locations=a,this.primitiveType=o.TRIANGLES,this.key=s.key,this._program=new r(e.rctx,n.get().build(s),a),this._pipeline=this.initializePipeline(s),this.reload=async t=>{t&&await n.reload(),this.key.equals(s.key)||p().warn("Configuration was changed after construction, cannot reload shader.",n),i(this._program),this._program=new r(e.rctx,n.get().build(s),a),this._pipeline=this.initializePipeline(s)}}destroy(){this._program=i(this._program),this._pipeline=null}get program(){return this._program}get compiled(){return this.program.compiled}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,i){return this._pipeline}initializePipeline(e){return s({blending:n,colorWrite:a})}}export{l as ShaderTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Accessor.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";const t={required:[]},s={required:[r.Depth]};class n extends e{precompile(e){return!!this.acquireTechniques(e)}consumes(){return t}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}modify(e){}get numGeometries(){return 0}get hasOccludees(){return!1}get hasEmissions(){return!1}forEachGeometry(e){}queryRenderOccludedState(e){return!1}}class u extends n{}class o extends n{}export{o as AsyncRenderPlugin,s as ConsumesDepth,t as ConsumesNone,u as SyncRenderPlugin};
5
+ import e from"../../../../core/Accessor.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";const t={required:[]},s={required:[r.Depth]};class n extends e{precompile(e){return!!this.acquireTechniques(e)}consumes(){return t}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}modify(e,r){}get numGeometries(){return 0}get hasOccludees(){return!1}get hasEmissions(){return!1}forEachGeometry(e){}queryRenderOccludedState(e){return!1}}class u extends n{}class o extends n{}export{o as AsyncRenderPlugin,s as ConsumesDepth,t as ConsumesNone,u as SyncRenderPlugin};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ChapmanApproximationParameters as e}from"../../../environment/ChapmanApproximation.glsl.js";import{ReloadableShaderModule as r}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{H as s}from"../../../../../chunks/Haze.glsl.js";import{CompareFunction as t,BlendFactor as n}from"../../../../webgl/enums.js";import{makePipelineState as i,keepSourceValues as l,defaultColorWrite as a,separateBlendingParams as m}from"../../../../webgl/renderState.js";class c extends e{constructor(){super(...arguments),this.hazeStrength=1}}class p extends o{constructor(e,o){super(e,o,new r(s,(()=>import("./Haze.glsl.js"))))}initializePipeline(e){return e.reduced?i({blending:l,depthTest:{func:t.ALWAYS},colorWrite:a}):i({blending:m(n.ONE,n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ONE),colorWrite:a})}}export{c as HazePassParameters,p as HazeTechnique};
5
+ import{ChapmanApproximationParameters as e}from"../../../environment/ChapmanApproximation.glsl.js";import{ReloadableShaderModule as r}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{H as s}from"../../../../../chunks/Haze.glsl.js";import{CompareFunction as t,BlendFactor as n}from"../../../../webgl/enums.js";import{makePipelineState as i,copySource as l,defaultColorWrite as a,separateBlendingParams as m}from"../../../../webgl/renderState.js";class c extends e{constructor(){super(...arguments),this.hazeStrength=1}}class p extends o{constructor(e,o){super(e,o,new r(s,(()=>import("./Haze.glsl.js"))))}initializePipeline(e){return e.reduced?i({blending:l,depthTest:{func:t.ALWAYS},colorWrite:a}):i({blending:m(n.ONE,n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ONE),colorWrite:a})}}export{c as HazePassParameters,p as HazeTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{H as i}from"../../../../../chunks/HighlightApply.glsl.js";import{makePipelineState as o,premultipliedAlphaToPremultipliedAlpha as s,defaultColorWrite as l}from"../../../../webgl/renderState.js";class t extends r{constructor(r,o){super(r,o,new e(i,(()=>import("../../shaders/HighlightApply.glsl.js"))))}initializePipeline(){return o({blending:s,colorWrite:l})}}export{t as HighlightApplyTechnique};
5
+ import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{H as i}from"../../../../../chunks/HighlightApply.glsl.js";import{makePipelineState as o,unpremultipliedAlphaToPremultipliedAlpha as s,defaultColorWrite as l}from"../../../../webgl/renderState.js";class t extends r{constructor(r,o){super(r,o,new e(i,(()=>import("../../shaders/HighlightApply.glsl.js"))))}initializePipeline(){return o({blending:s,colorWrite:l})}}export{t as HighlightApplyTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{fromValues as e}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ReadShadowMapPassParameters as r}from"../../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{ReloadableShaderModule as i}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{S as s}from"../../../../../chunks/ShadowHighlight.glsl.js";import{PrimitiveType as t}from"../../../../webgl/enums.js";import{makePipelineState as a,premultipliedAlphaToPremultipliedAlpha as h,defaultColorWrite as l}from"../../../../webgl/renderState.js";class d extends r{constructor(){super(...arguments),this.shadowColor=e(1,0,1,1),this.shadowOpacity=.2,this.occludedShadowOpacity=.1,this.opacityElevation=1,this.dayNightTerminator=1}}class c extends o{constructor(e,r){super(e,r,new i(s,(()=>import("../../shaders/ShadowHighlight.glsl.js")))),this.primitiveType=t.TRIANGLE_STRIP}initializePipeline(){return a({blending:h,colorWrite:l,depthTest:null,depthWrite:null})}}export{d as ShadowHighlightPassParameters,c as ShadowHighlightTechnique};
5
+ import{fromValues as e}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ReadShadowMapPassParameters as r}from"../../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{ReloadableShaderModule as i}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{S as s}from"../../../../../chunks/ShadowHighlight.glsl.js";import{PrimitiveType as t}from"../../../../webgl/enums.js";import{makePipelineState as a,unpremultipliedAlphaToPremultipliedAlpha as h,defaultColorWrite as l}from"../../../../webgl/renderState.js";class d extends r{constructor(){super(...arguments),this.shadowColor=e(1,0,1,1),this.shadowOpacity=.2,this.occludedShadowOpacity=.1,this.opacityElevation=1,this.dayNightTerminator=1}}class c extends o{constructor(e,r){super(e,r,new i(s,(()=>import("../../shaders/ShadowHighlight.glsl.js")))),this.primitiveType=t.TRIANGLE_STRIP}initializePipeline(){return a({blending:h,colorWrite:l,depthTest:null,depthWrite:null})}}export{d as ShadowHighlightPassParameters,c as ShadowHighlightTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../../chunks/Magnifier.glsl.js";import{makePipelineState as s,blendWithPremultipliedAlpha as o,defaultColorWrite as t}from"../../../../webgl/renderState.js";class l extends r{constructor(r,s){super(r,s,new e(i,(()=>import("../../shaders/Magnifier.glsl.js"))))}initializePipeline(){return s({blending:o,depthTest:null,depthWrite:null,colorWrite:t})}}export{l as MagnifierTechnique};
5
+ import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../../chunks/Magnifier.glsl.js";import{makePipelineState as s,premultipliedAlpha as o,defaultColorWrite as t}from"../../../../webgl/renderState.js";class l extends r{constructor(r,s){super(r,s,new e(i,(()=>import("../../shaders/Magnifier.glsl.js"))))}initializePipeline(){return s({blending:o,depthTest:null,depthWrite:null,colorWrite:t})}}export{l as MagnifierTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{create as e}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ReloadableShaderModule as r}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as s}from"../../core/shaderTechnique/ShaderTechnique.js";import{S as o}from"../../../../../chunks/Stars.glsl.js";import{CompareFunction as t}from"../../../../webgl/enums.js";import{NoParameters as i}from"../../../../webgl/NoParameters.js";import{makePipelineState as m,premultipliedAlphaToPremultipliedAlpha as a,defaultColorWrite as l}from"../../../../webgl/renderState.js";class n extends i{constructor(){super(...arguments),this.modelMatrix=e()}}class c extends s{constructor(e,s){super(e,s,new r(o,(()=>import("./Stars.glsl.js"))))}initializePipeline(){return m({blending:a,depthTest:{func:t.LEQUAL},colorWrite:l})}}export{n as StarPassParameters,c as StarsTechnique};
5
+ import{create as e}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ReloadableShaderModule as r}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as s}from"../../core/shaderTechnique/ShaderTechnique.js";import{S as o}from"../../../../../chunks/Stars.glsl.js";import{CompareFunction as t}from"../../../../webgl/enums.js";import{NoParameters as i}from"../../../../webgl/NoParameters.js";import{makePipelineState as m,unpremultipliedAlphaToPremultipliedAlpha as a,defaultColorWrite as l}from"../../../../webgl/renderState.js";class n extends i{constructor(){super(...arguments),this.modelMatrix=e()}}class c extends s{constructor(e,s){super(e,s,new r(o,(()=>import("./Stars.glsl.js"))))}initializePipeline(){return m({blending:a,depthTest:{func:t.LEQUAL},colorWrite:l})}}export{n as StarPassParameters,c as StarsTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as s}from"../../../../../chunks/OITBlend.glsl.js";import{ColorAttachment0 as o,ColorAttachment1 as i}from"../../../../webgl/enums.js";import{makePipelineState as n,premultipliedAlphaToPremultipliedAlpha as l,defaultColorWrite as t}from"../../../../webgl/renderState.js";class a extends r{constructor(r,o){super(r,o,new e(s,(()=>import("./OITBlend.glsl.js"))))}initializePipeline(e){return n({blending:l,colorWrite:t,drawBuffers:e.hasEmission?{buffers:[o,i]}:{buffers:[o]}})}}export{a as OITBlendTechnique};
5
+ import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as s}from"../../../../../chunks/OITBlend.glsl.js";import{ColorAttachment0 as o,ColorAttachment1 as i}from"../../../../webgl/enums.js";import{makePipelineState as n,unpremultipliedAlphaToPremultipliedAlpha as l,defaultColorWrite as t}from"../../../../webgl/renderState.js";class a extends r{constructor(r,o){super(r,o,new e(s,(()=>import("./OITBlend.glsl.js"))))}initializePipeline(e){return n({blending:l,colorWrite:t,drawBuffers:e.hasEmission?{buffers:[o,i]}:{buffers:[o]}})}}export{a as OITBlendTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{isFloat16Array as r,Float16Array as t}from"@petamoriken/float16";import{nativeArrayMaxSize as o,isUint16Array as a}from"../../../../core/typedArrayUtil.js";function e(e){if(e.length<o)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return r(e)?t.from(e):a(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}export{e as cloneAttributeData};
5
+ import{nativeArrayMaxSize as r,isFloat16Array as t,isUint16Array as o}from"../../../../core/typedArrayUtil.js";import{getFloat16ArrayConstructor as a}from"../../../../geometry/support/float16.js";function e(e){if(e.length<r)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return t(e)?a().from(e):o(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}export{e as cloneAttributeData};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/PooledArray.js";class s{constructor(){this.adds=new e,this.removes=new e,this.updates=new e({allocator:e=>e||new r,deallocator:e=>(e.renderGeometry=null,e)})}clear(){this.adds.clear(),this.removes.clear(),this.updates.clear()}prune(){this.adds.prune(),this.removes.prune(),this.updates.prune()}get empty(){return 0===this.adds.length&&0===this.removes.length&&0===this.updates.length}}class r{}class t{constructor(){this.adds=new Array,this.removes=new Array,this.updates=new Array}}export{s as ChangeSet,t as MaterialChangeSet,r as RenderGeometryUpdate};
5
+ import e from"../../../../core/PooledArray.js";class s{constructor(){this.adds=new e,this.removes=new e,this.updates=new e({allocator:e=>e||new r,deallocator:e=>(e.renderGeometry=null,e)})}clear(){this.adds.clear(),this.removes.clear(),this.updates.clear()}prune(){this.adds.prune(),this.removes.prune(),this.updates.prune()}get empty(){return 0===this.adds.length&&0===this.removes.length&&0===this.updates.length}}class r{}class t{constructor(e){this.pending=e,this.adds=new Array,this.removes=new Array,this.updates=new Array}clearAddsAndRemoves(){this.adds.forEach((e=>this.pending.adds.removeUnordered(e))),this.removes.forEach((e=>this.pending.removes.removeUnordered(e))),this.adds.length=0,this.removes.length=0}clearUpdates(){this.updates.forEach((e=>this.pending.updates.removeUnordered(e))),this.updates.length=0}clear(){this.clearUpdates(),this.clearAddsAndRemoves()}}export{s as ChangeSet,t as MaterialChangeSet,r as RenderGeometryUpdate};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ResourceState as s}from"./basicInterfaces.js";class t{constructor(s,t){this._material=s,this._repository=t,this._map=new Map}dispose(){this._map.forEach(((s,t)=>{null!=s&&this._repository.release(this._material,t)}))}load(t,e,r){const i=this._material.produces.get(e);if(!i?.(r))return null;this._map.has(r)||this._map.set(r,this._repository.acquire(this._material,e,r));const a=this._map.get(r);if(null!=a){if(a.ensureResources(t)===s.LOADED)return a;this._repository.requestRender()}return null}}export{t as GLMaterials};
5
+ import{ResourceState as s}from"./basicInterfaces.js";class t{constructor(s,t){this._material=s,this._repository=t,this._map=new Map}dispose(){this._map.forEach(((s,t)=>{null!=s&&this._repository.release(this._material,t)}))}load(t,e,r){const i=this._material.produces.get(e);if(!i?.(r))return null;this._map.has(r)||this._map.set(r,this._repository.acquire(this._material,e,r));const a=this._map.get(r);if(a){if(a.ensureResources(t)===s.LOADED)return a;this._repository.requestRender()}return null}}export{t as GLMaterials};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- function e(e){return!!e.frameUpdate}export{e as isFrameUpdateTexture};
5
+ function t(t){return!!t.update}export{t as isUpdatableTexture};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{isColorEmission as r}from"../core/shaderLibrary/ShaderOutput.js";import{OITPass as e}from"./OITPass.js";import{BlendFactor as n,CompareFunction as t,ColorAttachment0 as o,ColorAttachment1 as u,ColorAttachment2 as s}from"../../../webgl/enums.js";import{separateBlendingParams as c,premultipliedAlphaToPremultipliedAlpha as a,defaultDepthWrite as l}from"../../../webgl/renderState.js";const f=c(n.ONE,n.ZERO,n.ONE,n.ONE_MINUS_SRC_ALPHA);function i(r){return r===e.FrontFace?null:f}function N(r){switch(r){case e.NONE:return a;case e.ColorAlpha:return f;case e.FrontFace:case e.COUNT:return null}}function p(r){if(r.draped)return null;switch(r.oitPass){case e.NONE:case e.FrontFace:return r.writeDepth?l:null;case e.ColorAlpha:case e.COUNT:return null}}const O=5e5,m={factor:-1,units:-2};function E(r){return r?m:null}function h(r,n=t.LESS){return r===e.NONE||r===e.FrontFace?n:t.LEQUAL}function F(n,t){const c=r(t);return n===e.ColorAlpha?c?{buffers:[o,u,s]}:{buffers:[o,u]}:c?{buffers:[o,u]}:null}export{m as OITPolygonOffset,O as OITPolygonOffsetLimit,N as blending,f as blendingColorAlpha,p as depthWrite,F as getDrawBuffers,E as getOITPolygonOffset,i as oitBlending,h as oitDepthTest};
5
+ import{isColorEmission as r}from"../core/shaderLibrary/ShaderOutput.js";import{OITPass as e}from"./OITPass.js";import{BlendFactor as n,CompareFunction as t,ColorAttachment0 as o,ColorAttachment1 as u,ColorAttachment2 as s}from"../../../webgl/enums.js";import{separateBlendingParams as c,unpremultipliedAlphaToPremultipliedAlpha as a,defaultDepthWrite as l}from"../../../webgl/renderState.js";const f=c(n.ONE,n.ZERO,n.ONE,n.ONE_MINUS_SRC_ALPHA);function i(r){return r===e.FrontFace?null:f}function N(r){switch(r){case e.NONE:return a;case e.ColorAlpha:return f;case e.FrontFace:case e.COUNT:return null}}function p(r){if(r.draped)return null;switch(r.oitPass){case e.NONE:case e.FrontFace:return r.writeDepth?l:null;case e.ColorAlpha:case e.COUNT:return null}}const O=5e5,m={factor:-1,units:-2};function E(r){return r?m:null}function h(r,n=t.LESS){return r===e.NONE||r===e.FrontFace?n:t.LEQUAL}function F(n,t){const c=r(t);return n===e.ColorAlpha?c?{buffers:[o,u,s]}:{buffers:[o,u]}:c?{buffers:[o,u]}:null}export{m as OITPolygonOffset,O as OITPolygonOffsetLimit,N as blending,f as blendingColorAlpha,p as depthWrite,F as getDrawBuffers,E as getOITPolygonOffset,i as oitBlending,h as oitDepthTest};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{floatSubArray as e}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as i}from"../../../../geometry/support/HalfFloatArray.js";import{newIntArray as s,compactIndices as r}from"../../../../geometry/support/Indices.js";import{newShortArray as o}from"../../../../geometry/support/ShortArray.js";import{compressNormal as h}from"./Normals.js";class n{constructor(t,r,h,n,a,p={}){this.path=t,this.profile=r,this.extruder=h,this.startCap=n,this.endCap=a,this.options=p,this._extrusionVertexCount=0;const l=this.path.vertices.length-2;this.numExtrusionProfiles=h.numProfilesPerJoin()*l+2,this.numVerticesTotal=r.vertices.length*this.numExtrusionProfiles,this.startCap.vertexBufferStart=this.numVerticesTotal;const u=this.startCap.numVertices;this.numVerticesTotal+=u,this.endCap.vertexBufferStart=this.numVerticesTotal;const x=this.endCap.numVertices;this.numVerticesTotal+=x,this.pathVertexData=s(1*this.numVerticesTotal),this.profileRightAxes=o(2*this.numVerticesTotal),this.profileUpAxes=o(2*this.numVerticesTotal),this.profileVertexAndNormals=i(4*this.numVerticesTotal),this.profileAuxData=i(2*this.numVerticesTotal),this.positions=e(t.positions,t.offset,3*t.vertices.length),this._rebuildGeometry(),this._buildTopology()}get usedMemory(){return t(this.pathVertexData,this.profileRightAxes,this.profileUpAxes,this.profileVertexAndNormals,this.profileAuxData)+this.path.usedMemory+this.profile.usedMemory}emitVertex(t,e,i,s,r){let o=4*this._extrusionVertexCount;if(this.profileVertexAndNormals[o]=i[0],this.profileVertexAndNormals[o+1]=i[1],this.profileVertexAndNormals[o+2]=s[0],this.profileVertexAndNormals[o+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,o=2*this._extrusionVertexCount,r){const e=this.path.vertices[t],i=e.maxStretchDistance;this.profileAuxData[o]=e.rotationRight[0]*i,this.profileAuxData[o+1]=e.rotationRight[1]*i}else this.profileAuxData[o]=this.profileAuxData[o+1]=0;h(this.profileRightAxes,this._extrusionVertexCount,e.right[0],e.right[1],e.right[2]),h(this.profileUpAxes,this._extrusionVertexCount,e.up[0],e.up[1],e.up[2]),++this._extrusionVertexCount}emitCapVertex(t,e,i,s,r,o){let n=4*this._extrusionVertexCount;this.profileVertexAndNormals[n]=i[0],this.profileVertexAndNormals[n+1]=i[1],this.profileVertexAndNormals[n+2]=s[0],this.profileVertexAndNormals[n+3]=s[1],n=2*this._extrusionVertexCount,this.profileAuxData[n]=r,this.profileAuxData[n+1]=o,h(this.profileRightAxes,this._extrusionVertexCount,e.right[0],e.right[1],e.right[2]),h(this.profileUpAxes,this._extrusionVertexCount,e.up[0],e.up[1],e.up[2]),this.pathVertexData[this._extrusionVertexCount]=t,++this._extrusionVertexCount}_rebuildGeometry(){this._extrusionVertexCount=0;const{positions:t,offset:i,vertices:s}=this.path;this.positions=e(t,i,3*s.length);let r=0;const o=(t,e,i,s,o)=>this.emitCapVertex(r,t,e,i,s,o),h=(t,e,i,s)=>this.emitVertex(r,t,e,i,s);for(this.startCap.rebuildConnectingProfileGeometry(s[r],this.profile,o),r=1;r<s.length-1;++r)this.extruder.extrude(s[r],this.profile,h);this.endCap.rebuildConnectingProfileGeometry(s[r],this.profile,o),r=0,this.startCap.rebuildCapGeometry(s[r],o),r=s.length-1,this.endCap.rebuildCapGeometry(s[r],o)}_buildTopology(){const t=this.profile.vertices.length,e=this.profile.numSegments,i=this.numExtrusionProfiles-1;let s=3*(2*(e*i));this.startCap.indexBufferStart=s,this.startCap.firstProfileVertexIndex=0,s+=this.startCap.numIndices,this.endCap.indexBufferStart=s,this.endCap.firstProfileVertexIndex=t*(this.numExtrusionProfiles-1);const o=new Array,h=new Array,n=(t,e,i)=>{o.push(t),o.push(e),o.push(i),h.push(this.pathVertexData[t]),h.push(this.pathVertexData[e]),h.push(this.pathVertexData[i])};for(let r=0;r<e;++r){const e=this.profile.indices[2*r],s=this.profile.indices[2*r+1];for(let r=0;r<i;++r){const i=r*t+e,o=(r+1)*t+s,h=r*t+s;n(i,(r+1)*t+e,o),n(i,o,h)}}this.startCap.buildTopology(this.path.vertices[0],n),this.endCap.buildTopology(this.path.vertices[this.path.vertices.length-1],n),this.vertexIndices=r(o),this.pathVertexIndices=r(h)}onPathChanged(){this._rebuildGeometry()}}export{n as PathBuilder};
5
+ import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{floatSubArray as e}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as i}from"../../../../geometry/support/HalfFloatArray.js";import{newIntArray as s,compactIndices as r}from"../../../../geometry/support/Indices.js";import{newShortArray as o}from"../../../../geometry/support/ShortArray.js";import{compressNormal as h}from"./Normals.js";class a{constructor(t,r,h,a,n,p={}){this.path=t,this.profile=r,this.extruder=h,this.startCap=a,this.endCap=n,this.options=p,this._extrusionVertexCount=0;const l=this.path.vertices.length-2;this.numExtrusionProfiles=h.numProfilesPerJoin()*l+2,this.numVerticesTotal=r.vertices.length*this.numExtrusionProfiles,this.startCap.vertexBufferStart=this.numVerticesTotal;const u=this.startCap.numVertices;this.numVerticesTotal+=u,this.endCap.vertexBufferStart=this.numVerticesTotal;const x=this.endCap.numVertices;this.numVerticesTotal+=x,this.pathVertexData=s(1*this.numVerticesTotal),this.profileRightAxes=o(2*this.numVerticesTotal),this.profileUpAxes=o(2*this.numVerticesTotal),this.profileVertexAndNormals=i(4*this.numVerticesTotal),this.profileAuxData=i(3*this.numVerticesTotal),this.positions=e(t.positions,t.offset,3*t.vertices.length),this._rebuildGeometry(),this._buildTopology()}get usedMemory(){return t(this.pathVertexData,this.profileRightAxes,this.profileUpAxes,this.profileVertexAndNormals,this.profileAuxData)+this.path.usedMemory+this.profile.usedMemory}emitVertex(t,e,i,s,r){let o=4*this._extrusionVertexCount;if(this.profileVertexAndNormals[o]=i[0],this.profileVertexAndNormals[o+1]=i[1],this.profileVertexAndNormals[o+2]=s[0],this.profileVertexAndNormals[o+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,o=3*this._extrusionVertexCount,r){const e=this.path.vertices[t],i=e.maxStretchDistance;this.profileAuxData[o]=e.rotationRight[0]*i,this.profileAuxData[o+1]=e.rotationRight[1]*i}else this.profileAuxData[o]=this.profileAuxData[o+1]=0;this.profileAuxData[o+2]=0,h(this.profileRightAxes,this._extrusionVertexCount,e.right[0],e.right[1],e.right[2]),h(this.profileUpAxes,this._extrusionVertexCount,e.up[0],e.up[1],e.up[2]),++this._extrusionVertexCount}emitCapVertex(t,e,i,s,r,o){let a=4*this._extrusionVertexCount;this.profileVertexAndNormals[a]=i[0],this.profileVertexAndNormals[a+1]=i[1],this.profileVertexAndNormals[a+2]=s[0],this.profileVertexAndNormals[a+3]=s[1],a=3*this._extrusionVertexCount,this.profileAuxData[a]=r,this.profileAuxData[a+1]=o,this.profileAuxData[a+2]=1,h(this.profileRightAxes,this._extrusionVertexCount,e.right[0],e.right[1],e.right[2]),h(this.profileUpAxes,this._extrusionVertexCount,e.up[0],e.up[1],e.up[2]),this.pathVertexData[this._extrusionVertexCount]=t,++this._extrusionVertexCount}_rebuildGeometry(){this._extrusionVertexCount=0;const{positions:t,offset:i,vertices:s}=this.path;this.positions=e(t,i,3*s.length);let r=0;const o=(t,e,i,s,o)=>this.emitCapVertex(r,t,e,i,s,o),h=(t,e,i,s)=>this.emitVertex(r,t,e,i,s);for(this.startCap.rebuildConnectingProfileGeometry(s[r],this.profile,o),r=1;r<s.length-1;++r)this.extruder.extrude(s[r],this.profile,h);this.endCap.rebuildConnectingProfileGeometry(s[r],this.profile,o),r=0,this.startCap.rebuildCapGeometry(s[r],o),r=s.length-1,this.endCap.rebuildCapGeometry(s[r],o)}_buildTopology(){const t=this.profile.vertices.length,e=this.profile.numSegments,i=this.numExtrusionProfiles-1;let s=3*(2*(e*i));this.startCap.indexBufferStart=s,this.startCap.firstProfileVertexIndex=0,s+=this.startCap.numIndices,this.endCap.indexBufferStart=s,this.endCap.firstProfileVertexIndex=t*(this.numExtrusionProfiles-1);const o=new Array,h=new Array,a=(t,e,i)=>{o.push(t),o.push(e),o.push(i),h.push(this.pathVertexData[t]),h.push(this.pathVertexData[e]),h.push(this.pathVertexData[i])};for(let r=0;r<e;++r){const e=this.profile.indices[2*r],s=this.profile.indices[2*r+1];for(let r=0;r<i;++r){const i=r*t+e,o=(r+1)*t+s,h=r*t+s;a(i,(r+1)*t+e,o),a(i,o,h)}}this.startCap.buildTopology(this.path.vertices[0],a),this.endCap.buildTopology(this.path.vertices[this.path.vertices.length-1],a),this.vertexIndices=r(o),this.pathVertexIndices=r(h)}onPathChanged(){this._rebuildGeometry()}}export{a as PathBuilder};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{copy as t,set as e,length as s,normalize as i,dot as r,scale as o,add as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{e as h,i as l}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newFloatArray as u}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as m}from"../../../../geometry/support/Indices.js";import{Attribute as d,Vertices as f}from"./Attribute.js";import{decompressNormal as b,compressNormal as v}from"./Normals.js";import{intersectTriangles as g}from"./RayIntersections.js";import{VertexAttribute as A}from"./VertexAttribute.js";class x{constructor(t){this.builder=t}onPathChanged(t){this.builder.onPathChanged()}}class I extends x{constructor(t){super(t),this.color=p(255,255,255,255),this._size=n(),this.positions=u(3*this.builder.numVerticesTotal),this.normals=new Int16Array(2*this.builder.numVerticesTotal)}bakeVertexColors(t){this.color[0]=255*t[0],this.color[1]=255*t[1],this.color[2]=255*t[2],this.color[3]=255*(t.length>3?t[3]:1)}bake(n){t(this._size,n);const{numVerticesTotal:c,pathVertexData:p,path:u,positions:m,profileRightAxes:d,profileUpAxes:f,profileVertexAndNormals:g,profileAuxData:A}=this.builder;for(let t=0;t<c;++t){let c=p[t];const x=0===c||c===u.vertices.length-1;c*=3;const I=V;let D=0,E=0;const T=b(w,d,t),C=b(j,f,t),N=4*t,y=e(O,g[N]*n[0],g[N+1]*n[1]),L=2*t;if(x)h(I,C,T),D=A[L]*n[0],E=A[L+1];else{const t=P,n=R;e(t,A[L],A[L+1]);const h=s(t);i(t,t);const c=r(y,t);if(Math.abs(c)>h){e(n,-t[1],t[0]);const s=r(y,n);o(t,t,h*Math.sign(c)),o(n,n,s),a(y,t,n)}l(I,0,0,0)}const z=T[0]*y[0]+C[0]*y[1],F=T[1]*y[0]+C[1]*y[1],M=T[2]*y[0]+C[2]*y[1],U=3*t;this.positions[U]=m[c]+z+I[0]*D,this.positions[U+1]=m[c+1]+F+I[1]*D,this.positions[U+2]=m[c+2]+M+I[2]*D;const k=g[N+2],S=g[N+3];v(this.normals,t,T[0]*k+C[0]*S+I[0]*E,T[1]*k+C[1]*S+I[1]*E,T[2]*k+C[2]*S+I[2]*E)}}createGeometryData(){const t=this.builder.vertexIndices;return[[A.POSITION,new d(this.positions,t,3,!0)],[A.NORMALCOMPRESSED,new d(this.normals,t,2,!0)],[A.COLOR,new d(this.color,m(t.length),4,!0)]]}onPathChanged(t){super.onPathChanged(t),this.bake(this.size)}intersect(t,e,s,i){const r=this.builder.vertexIndices,o=new f(this.positions,3),a=r.length/3;g(t,e,0,a,r,o,void 0,s,((t,e,s)=>i(t,s,e,!1)))}get size(){return this._size}}class D extends x{constructor(t,e,s,i){super(t),this.sizeAttributeValue=e,this.colorAttributeValue=s,this.opacityAttributeValue=i,this.vvData=null,this.baked=new I(t),this.vvData=u(4*this.builder.path.vertices.length);for(let r=0;r<this.builder.path.vertices.length;++r){this.vvData[4*r]=e,this.vvData[4*r+1]=s,this.vvData[4*r+2]=i;const t=0===r||r===this.builder.path.vertices.length-1;this.vvData[4*r+3]=t?1:0}}createGeometryData(){const t=this.builder,{pathVertexIndices:e,vertexIndices:s}=t;return[[A.POSITION,new d(t.positions,e,3,!0)],[A.PROFILEVERTEXANDNORMAL,new d(t.profileVertexAndNormals,s,4,!0)],[A.FEATUREVALUE,new d(this.vvData,e,4,!0)],[A.PROFILEAUXDATA,new d(t.profileAuxData,s,2,!0)],[A.PROFILERIGHT,new d(t.profileRightAxes,s,2,!0)],[A.PROFILEUP,new d(t.profileUpAxes,s,2,!0)]]}onPathChanged(t){super.onPathChanged(t);const e=t.getMutableAttribute(A.POSITION);e&&(e.data=this.builder.positions)}}const O=n(),P=n(),R=n(),V=c(),w=c(),j=c();export{D as FastUpdatePathGeometry,x as PathGeometryData,I as StaticPathGeometry};
5
+ import{copy as t,set as e,length as s,normalize as i,dot as r,scale as o,add as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{e as l,i as h}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newFloatArray as m}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as u}from"../../../../geometry/support/HalfFloatArray.js";import{getZeroIndexArray as f}from"../../../../geometry/support/Indices.js";import{Attribute as d,Vertices as A}from"./Attribute.js";import{decompressNormal as b,compressNormal as g}from"./Normals.js";import{intersectTriangles as v}from"./RayIntersections.js";import{VertexAttribute as I}from"./VertexAttribute.js";class x{constructor(t){this.builder=t}onPathChanged(t){this.builder.onPathChanged()}}class T extends x{constructor(t){super(t),this.color=p(255,255,255,255),this._size=a(),this.positions=m(3*this.builder.numVerticesTotal),this.normals=new Int16Array(2*this.builder.numVerticesTotal)}bakeVertexColors(t){this.color[0]=255*t[0],this.color[1]=255*t[1],this.color[2]=255*t[2],this.color[3]=255*(t.length>3?t[3]:1)}bake(a){t(this._size,a);const{numVerticesTotal:c,pathVertexData:p,positions:m,profileRightAxes:u,profileUpAxes:f,profileVertexAndNormals:d,profileAuxData:A}=this.builder;for(let t=0;t<c;++t){let c=p[t];c*=3;const v=w;let I=0,x=0;const T=b(C,u,t),O=b(V,f,t),j=4*t,y=e(R,d[j]*a[0],d[j+1]*a[1]),U=3*t;if(1===A[U+2])l(v,O,T),I=A[U]*a[0],x=A[U+1];else{const t=E,a=P;e(t,A[U],A[U+1]);const l=s(t);i(t,t);const c=r(y,t);if(Math.abs(c)>l){e(a,-t[1],t[0]);const s=r(y,a);o(t,t,l*Math.sign(c)),o(a,a,s),n(y,t,a)}h(v,0,0,0)}const F=T[0]*y[0]+O[0]*y[1],N=T[1]*y[0]+O[1]*y[1],_=T[2]*y[0]+O[2]*y[1];this.positions[U]=m[c]+F+v[0]*I,this.positions[U+1]=m[c+1]+N+v[1]*I,this.positions[U+2]=m[c+2]+_+v[2]*I;const z=d[j+2],D=d[j+3];g(this.normals,t,T[0]*z+O[0]*D+v[0]*x,T[1]*z+O[1]*D+v[1]*x,T[2]*z+O[2]*D+v[2]*x)}}createGeometryData(){const t=this.builder.vertexIndices;return[[I.POSITION,new d(this.positions,t,3,!0)],[I.NORMALCOMPRESSED,new d(this.normals,t,2,!0)],[I.COLOR,new d(this.color,f(t.length),4,!0)]]}onPathChanged(t){super.onPathChanged(t),this.bake(this.size)}intersect(t,e,s,i){const r=this.builder.vertexIndices,o=new A(this.positions,3),n=r.length/3;v(t,e,0,n,r,o,void 0,s,((t,e,s)=>i(t,s,e,!1)))}get size(){return this._size}}class O extends x{constructor(t,e,s,i){super(t),this.sizeAttributeValue=e,this.colorAttributeValue=s,this.opacityAttributeValue=i,this.baked=new T(t),this._vvSize=m(this.builder.path.vertices.length).fill(e),this._vvColor=u(this.builder.path.vertices.length).fill(s),this._vvOpacity=u(this.builder.path.vertices.length).fill(i)}createGeometryData(){const t=this.builder,{pathVertexIndices:e,vertexIndices:s}=t;return[[I.POSITION,new d(t.positions,e,3,!0)],[I.PROFILEVERTEXANDNORMAL,new d(t.profileVertexAndNormals,s,4,!0)],[I.PROFILEAUXDATA,new d(t.profileAuxData,s,3,!0)],[I.PROFILERIGHT,new d(t.profileRightAxes,s,2,!0)],[I.PROFILEUP,new d(t.profileUpAxes,s,2,!0)],[I.SIZEFEATUREATTRIBUTE,new d(this._vvSize,e,1,!0)],[I.COLORFEATUREATTRIBUTE,new d(this._vvColor,e,1,!0)],[I.OPACITYFEATUREATTRIBUTE,new d(this._vvOpacity,e,1,!0)]]}onPathChanged(t){super.onPathChanged(t);const e=t.getMutableAttribute(I.POSITION);e&&(e.data=this.builder.positions)}}const R=a(),E=a(),P=a(),w=c(),C=c(),V=c();export{O as FastUpdatePathGeometry,x as PathGeometryData,T as StaticPathGeometry};