@arcgis/core 5.0.0-next.30 → 5.0.0-next.32

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 (182) hide show
  1. package/Basemap.js +1 -1
  2. package/applications/SceneViewer/sceneViewerUtils.d.ts +3 -0
  3. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/{406d270ae2b3cf9e1f1b.js → 05e55118dc0023d500fc.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{93fe46be3c7fe34b5361.js → 1432e789aa4cba627337.js} +1 -1
  7. package/assets/esri/core/workers/chunks/1dd867fa7c58c06b79ea.js +1 -0
  8. package/assets/esri/core/workers/chunks/{6e9d731cb20307b83ab0.js → 1e55f152b60145f33b61.js} +1 -1
  9. package/assets/esri/core/workers/chunks/22d66d1c8dfccdbbcf30.js +1 -0
  10. package/assets/esri/core/workers/chunks/27bd88e1101873d4ce12.js +1 -0
  11. package/assets/esri/core/workers/chunks/{5f2cf73fb2944f82661d.js → 433d249c35c56bf15806.js} +34 -34
  12. package/assets/esri/core/workers/chunks/444026d1938c1078ca97.js +1 -0
  13. package/assets/esri/core/workers/chunks/{a425ffec91d07bbfeb80.js → 565358ea8d1bdc4d1ebc.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{b2fbb44e219232e61cbd.js → 794960ec36e11f4416c2.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{0bfb7db0a151a5e85dd1.js → 8ad6595ad44c2d60c1ce.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{11bb437437272d8f3e2c.js → 9252854b512237b6a0ef.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{e615983fab688d515205.js → 944dfa9309da8f49a616.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{f2f4e34247882eceb50d.js → a2cee5ac0d4df0108425.js} +3 -3
  19. package/assets/esri/core/workers/chunks/a4b7ba8aec109beb5b4d.js +1 -0
  20. package/assets/esri/core/workers/chunks/{d769c1b18e2710e0388b.js → a6324f5f560ffadc6e5d.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{a091623bbfb3d771c8d8.js → d8db2c51b2fb42f37b2a.js} +1 -1
  22. package/assets/esri/core/workers/chunks/da517b4b07d4d27ce94c.js +1 -0
  23. package/assets/esri/core/workers/chunks/{984bb0943d07c86b7e77.js → ded3ef385d5a3a2ec8ca.js} +1 -1
  24. package/assets/esri/core/workers/chunks/defc6b50df5018bd9e86.js +1 -0
  25. package/assets/esri/core/workers/chunks/ed1dabed10ff9f4e0369.js +1 -0
  26. package/assets/esri/core/workers/chunks/{14dc21fe66c7b98fb456.js → f3127bdf28a1d9b8db27.js} +1 -1
  27. package/assets/esri/core/workers/chunks/fee942ef802a162e0248.js +1 -0
  28. package/assets/esri/themes/base/widgets/_Attribution.scss +8 -0
  29. package/assets/esri/themes/dark/main.css +1 -1
  30. package/assets/esri/themes/light/main.css +1 -1
  31. package/assets/esri/themes/light/view.css +1 -1
  32. package/chunks/BlendLayers.glsl.js +1 -1
  33. package/config.js +1 -1
  34. package/core/Message.js +1 -1
  35. package/core/deprecate.js +1 -1
  36. package/core/keyboard.js +5 -0
  37. package/geometry/Circle.js +1 -1
  38. package/geometry/Extent.js +1 -1
  39. package/geometry/geodesicUtils.js +5 -0
  40. package/geometry/support/geodesicUtils.js +1 -1
  41. package/interfaces.d.ts +482 -190
  42. package/kernel.js +1 -1
  43. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  44. package/layers/graphics/OptimizedGeometry.js +1 -1
  45. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  46. package/layers/knowledgeGraph/SessionMemoryStorage.js +1 -1
  47. package/layers/support/BuildingFilterBlock.js +1 -1
  48. package/package.json +2 -2
  49. package/rest/support/QueryMixin.js +1 -1
  50. package/support/revision.js +1 -1
  51. package/views/2d/analysis/AreaMeasurement/AreaMeasurementController.js +1 -1
  52. package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementController.js +1 -1
  53. package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
  54. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  55. package/views/2d/grid/gridUtils.js +1 -1
  56. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  57. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  58. package/views/2d/layers/MediaLayerView2D.js +1 -1
  59. package/views/2d/layers/OGCFeatureLayerView2D.js +1 -1
  60. package/views/2d/layers/StreamLayerView2D.js +1 -1
  61. package/views/3d/GroundView3D.js +1 -1
  62. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  63. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  64. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  65. package/views/3d/layers/DimensionLayerView3D.js +1 -1
  66. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  67. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  68. package/views/3d/layers/I3SMeshView3D.js +1 -1
  69. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  70. package/views/3d/layers/LineOfSightLayerView3D.js +1 -1
  71. package/views/3d/layers/MediaLayerView3D.js +1 -1
  72. package/views/3d/layers/OGCFeatureLayerView3D.js +1 -1
  73. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  74. package/views/3d/layers/StreamLayerView3D.js +1 -1
  75. package/views/3d/layers/ViewshedLayerView3D.js +1 -1
  76. package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
  77. package/views/3d/layers/graphics/LabelDeconflictor.js +1 -1
  78. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  79. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  80. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  81. package/views/3d/support/Attribution3D.js +5 -0
  82. package/views/3d/terrain/TileBlendTechniqueConfiguration.js +1 -1
  83. package/views/3d/terrain/TileCompositor.js +1 -1
  84. package/views/3d/terrain/TileRenderer.js +1 -1
  85. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  86. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  87. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  88. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  89. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  90. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +6 -6
  91. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +4 -4
  92. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  93. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  94. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  95. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  96. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  97. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  98. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  99. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  100. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  101. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  102. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  103. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  104. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  105. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  106. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  107. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +4 -4
  108. package/views/Attribution.js +5 -0
  109. package/views/DOMContainer.js +1 -1
  110. package/views/SceneView.js +1 -1
  111. package/views/View.js +1 -1
  112. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  113. package/views/draw/support/managers/DrawTooltipManager.js +5 -0
  114. package/views/interactive/sketch/constraintUtils.js +1 -1
  115. package/views/interactive/sketch/constraints.js +1 -1
  116. package/views/interactive/tooltip/content/TooltipContentDynamic.js +5 -0
  117. package/views/interactive/tooltip/content/tooltipContentFactory.js +1 -1
  118. package/views/interactive/tooltip/fields/TooltipField.js +1 -1
  119. package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +5 -0
  120. package/views/layers/DimensionLayerView.js +1 -1
  121. package/views/layers/DimensionLayerViewMixin.js +5 -0
  122. package/views/layers/FeatureLayerView.js +1 -1
  123. package/views/layers/FeatureLayerViewMixin.d.ts +2 -2
  124. package/views/layers/FeatureLayerViewMixin.js +5 -0
  125. package/views/layers/ImageryLayerView.js +1 -1
  126. package/views/layers/ImageryLayerViewMixin.js +5 -0
  127. package/views/layers/LayerView.js +1 -1
  128. package/views/layers/LineOfSightLayerView.js +1 -1
  129. package/views/layers/LineOfSightLayerViewMixin.js +5 -0
  130. package/views/layers/MediaLayerView.js +1 -1
  131. package/views/layers/MediaLayerViewMixin.js +5 -0
  132. package/views/layers/OGCFeatureLayerView.js +1 -1
  133. package/views/layers/PointCloudLayerView.js +1 -1
  134. package/views/layers/StreamLayerView.js +1 -1
  135. package/views/layers/ViewshedLayerView.js +1 -1
  136. package/views/layers/ViewshedLayerViewMixin.js +5 -0
  137. package/views/support/AttributionItem.d.ts +4 -0
  138. package/views/support/AttributionItem.js +5 -0
  139. package/views/support/LayerLayerViewInfo.js +1 -1
  140. package/views/support/LayerViewManager.js +1 -1
  141. package/views/support/PromiseQueue.js +1 -1
  142. package/views/support/angularMeasurementUtils.js +1 -1
  143. package/views/support/attributionUtils.js +5 -0
  144. package/views/support/drapedUtils.js +1 -1
  145. package/views/support/geodesicAreaMeasurementUtils.js +1 -1
  146. package/views/support/geodesicLengthMeasurementUtils.js +1 -1
  147. package/views/support/geodesicMeasurementUtils.js +1 -1
  148. package/views/ui/2d/DefaultUI2D.js +1 -1
  149. package/views/ui/3d/DefaultUI3D.js +1 -1
  150. package/webscene/Environment.js +1 -1
  151. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  152. package/widgets/Attribution/AttributionViewModel.js +1 -1
  153. package/widgets/Attribution.js +1 -1
  154. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  155. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  156. package/widgets/ElevationProfile/ElevationProfileLine.js +1 -1
  157. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  158. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  159. package/widgets/ElevationProfile.js +1 -1
  160. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  161. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  162. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
  163. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  164. package/widgets/Popup.js +1 -1
  165. package/widgets/ScaleBar/ScaleBarViewModel.js +1 -1
  166. package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
  167. package/widgets/Widget.js +1 -1
  168. package/widgets/support/decorators/accessibleHandler.js +1 -1
  169. package/widgets/support/forms/expressions/FormExpressionArcadeExecutor.js +1 -1
  170. package/widgets/support/jsxWidgetSupport.js +1 -1
  171. package/widgets/support/widget.js +1 -1
  172. package/widgets/support/widgetUtils.js +1 -1
  173. package/assets/esri/core/workers/chunks/25143b919e75d5d2da05.js +0 -1
  174. package/assets/esri/core/workers/chunks/2d17ed5321ca05acb8e3.js +0 -1
  175. package/assets/esri/core/workers/chunks/447b53a9280b2b19b7a6.js +0 -1
  176. package/assets/esri/core/workers/chunks/6ce7ca6bebdc61d8eada.js +0 -1
  177. package/assets/esri/core/workers/chunks/8fbda0b85731ac77e1d8.js +0 -1
  178. package/assets/esri/core/workers/chunks/98c32d10a2344cd7a50b.js +0 -1
  179. package/assets/esri/core/workers/chunks/b66e41d626a7d1b81d48.js +0 -1
  180. package/assets/esri/core/workers/chunks/d5b464ff83ce29b51968.js +0 -1
  181. package/assets/esri/core/workers/chunks/d777d7cb8df3f21ac97e.js +0 -1
  182. package/layers/support/attributionUtils.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{equals as r,binaryIndexOf as s}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import n from"../../../../../core/Logger.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as o,destroyMaybe as a}from"../../../../../core/maybe.js";import{isAbortError as l,onAbortOrThrow as c}from"../../../../../core/promiseUtils.js";import{property as d,subclass as h}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as u,transpose as m,invert as g}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as p}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{h as _,d as y,a as b,g as j}from"../../../../../chunks/vec32.js";import{create as w,clone as O}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as E}from"../../../../../core/support/UpdatingHandles.js";import{c as v}from"../../../../../chunks/vec33.js";import{maxElevationOffset as x}from"../../collections/Component/Material/shader/ComponentData.glsl.js";import{TwoVectorPosition as M}from"../../core/util/TwoVectorPosition.js";import{Attribute as T}from"../Attribute.js";import{GridLocalOriginFactory as R}from"../GridLocalOriginFactory.js";import{applyToModelMatrix as C}from"../localOriginHelper.js";import{LocalOriginManager as P}from"../LocalOriginManager.js";import{Object3D as A}from"../Object3D.js";import{VertexArrayObject as D}from"../VertexArrayObject.js";import{VertexLayout as k,glVertexLayout as L,EdgeInputBufferLayout as S,RegularEdgeInstancesGLLayout as U,SilhouetteEdgeInstancesGLLayout as V}from"./bufferLayouts.js";import{EdgeRenderer as q,lineWidthFractionFactor as H,extensionLengthOffset as B}from"./EdgeRenderer.js";import{EdgePassParameters as F}from"./EdgeShaderParameters.js";import{EdgeWorkerHandle as I}from"./EdgeWorkerHandle.js";import{generateStrokesTexture as N}from"./strokes.js";import{determineRendererType as W,determineEdgeTransparency as z,determineObjectTransparency as G,fillComponentBufferIndices as K}from"./util.js";import{BufferManager as J}from"../TextureBackedBuffer/BufferManager.js";import{VertexBuffer as Q}from"../../../../webgl/VertexBuffer.js";const X=128;let Y=class extends t{constructor(e){super(e),this._updatingHandles=new E,this._objectEntries=new Map,this._pendingDeletions=new Map,this._renderers=new Map,this._gpuMemoryUsage=0,this._workerAbort=new AbortController,this._tmpModelPosition=w(),this._localOrigins=new P(new R(e.renderSR));const t=k.createBuffer(4);for(let r=0;r<4;r++)t.sideness.set(r,0,0===r||3===r?0:1),t.sideness.set(r,1,0===r||1===r?0:1);this._vertexBuffer=new Q(e.rctx,L,t.buffer)}initialize(){this._workerHandle=new I(this.schedule),this._componentColorManager=new J(this.rctx,fe)}destroy(){this.destroyed||(this._objectEntries.forEach(e=>this._discardObjectEntry(e)),this._objectEntries.clear(),this._pendingDeletions.forEach(e=>this._discardObjectEntry(e)),this._pendingDeletions.clear(),this._strokesTexture=o(this._strokesTexture),this._componentColorManager=a(this._componentColorManager),this._workerAbort.abort(),this._workerHandle.destroy(),this._vertexBuffer.dispose(),this._renderers.clear(),this._updatingHandles.destroy(),this._set("schedule",pe))}get updating(){return this._updatingHandles.updating}get usedMemory(){return this._gpuMemoryUsage}shouldRender(){return this._renderers.size>0}async addComponentObject(e,t,r,s,n,i,o){if(this.hasObject(e))return this._getObjectMemoryUsage(e);let a;const l=new ee(null,new Promise(e=>a=e),e.obb.center,e.obb.radius);this._objectEntries.set(e,l);const c=await this._updatingHandles.addPromise(this._addComponentGeometry(e.transform,l,t,r,s,n,i,o));return this.setNeedsRender(),a(),c}async addOrUpdateObject3D(e,t,r,s){if(this.destroyed)return void n.getLogger(this).warn("Attempt to add an object to a destroyed instance");const i=new AbortController;let o;const{center:a,radius:c}=e.boundingVolumeWorldSpace.bounds,d=new ee(i,new Promise(e=>o=e),a,c),h=this._objectEntries.get(e);h&&(this._pendingDeletions.has(e)?this._discardObjectEntry(h):this._pendingDeletions.set(e,h)),this._objectEntries.set(e,d);try{const n=new Array;if(e.geometries.length>1&&$(e))n.push(this._addObjectMergedGeometries(e,d,t,r,s));else for(const i of e.geometries)i.material.supportsEdges&&n.push(this._addGeometry(e,d,i,t,r,s));await this._updatingHandles.addPromise(Promise.all(n)),this._removePendingDeletion(e)}catch(u){l(u)?this._discardObjectEntry(d):this._removePendingDeletion(e)}finally{this.setNeedsRender(),o()}}removeObject(e){const t=this._objectEntries.get(e);this._objectEntries.delete(e),this._discardObjectEntry(t),this._removePendingDeletion(e)}_removePendingDeletion(e){const t=this._pendingDeletions.get(e);this._pendingDeletions.delete(e),this._discardObjectEntry(t)}async _getObjectEntry(e){const t=this._objectEntries.get(e);if(!t)throw new Error("no object");return await t.loaded,null==t.loaded?null:t}fastUpdateObject3DEdgesTransform(e){if(this.destroyed)return!1;const t=this._objectEntries.get(e);if(!t)return!1;const{geometries:r}=e,{renderables:s}=t;if(0===r.length||0===s.length)return!0;if(s.length>1)return!1;const[n]=s,i=n.transform;if(!(i instanceof se))return!1;const[o]=r;if(o.localOrigin!==i.origin.origin)return!1;const a=f(),l=this._computeModelTransformWithLocalOrigin(e,o,a);return n.transform=new se(a,l),this.setNeedsRender(),!0}_discardObjectEntry(e){e&&(e.abort?.abort(),e.renderables.length&&(e.renderables.forEach(e=>this._removeRenderable(e)),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this._objectEntries.has(e)}async updateAllComponentOpacities(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));if(null==r)return;const s=Array.isArray(t)?e=>t[e]:()=>t;r.renderables.forEach(e=>{const{meta:t,buffer:r}=e.components,n=t.length,i=r.textureBuffer.getScalarField("opacity");for(let o=0;o<n;o++){const e=s(o),r=t[o],n=r.index;r.material.opacity=e,i.set(n,255*e)}this._updateTransparency(e)}),this.setNeedsRender()}async _getObjectMemoryUsage(e){const t=await this._getObjectEntry(e);return t?t.renderables.reduce((e,t)=>e+t.statistics.gpuMemoryUsage,0):0}async updateAllComponentMaterials(e,t,r,s){const n=e instanceof A,i=W(t),o=q.getKey(i,r,n),a=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=a&&(a.renderables.forEach(e=>{if(o!==e.rendererKey){const t=this._renderers.get(e.rendererKey),s=this._acquireRenderer(i,r,n);t.removeRenderable(e),--t.refCount,e.rendererKey=o,s.addRenderable(e)}if(Array.isArray(t))for(let r=0;r<t.length;r++)e.components.meta[r].material=t[r];else e.components.meta[0].material=t;s&&oe(e.components),this._updateTransparency(e)}),this.setNeedsRender())}async updateAllVerticalOffsets(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=r&&this._updateAllVerticalOffsets(r,t)}_updateAllVerticalOffsets(e,t){e.renderables.forEach(e=>{const r=e.components.meta;for(let s=0;s<r.length;s++)e.components.meta[s].verticalOffset=t?.[s]??0;oe(e.components)}),this.setNeedsRender()}async updateObjectVisibility(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));r&&(r.renderables.forEach(e=>e.visible=t),this.setNeedsRender())}render(e,t){if(null==this._componentColorManager)return;this._localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,s=w(),n=new M;let i=0,o=0;if(this._renderers.forEach(r=>{0!==r.refCount?(++this.techniques.precompiling,r.forEachRenderable(t=>{t.visible&&(i+=t.statistics.averageEdgeLength,o++,t.regular&&r.acquireTechnique(e,!1),t.silhouette&&r.acquireTechnique(e,!0))},t),--this.techniques.precompiling):this._renderers.delete(r.key)}),this._componentColorManager.garbageCollect(),this._componentColorManager.updateTextures(),0===o)return;const a=new F(40*i/o,t);_(s,r[3],r[7],r[11]),n.set(s),y(a.transformWorldFromViewTH,n.high),y(a.transformWorldFromViewTL,n.low),u(a.transformViewFromCameraRelativeRS,e.camera.viewMatrix),m(ge,a.transformViewFromCameraRelativeRS),g(a.transformNormalViewFromGlobal,ge),a.transformProjFromView=e.camera.projectionMatrix,this._updateObjectCameraDistances(e),this._renderers.forEach(t=>{ae(t,e,a),le(t,e,a)})}_updateTransparency(e){const t=z(e.components.meta),r=G(e.components.meta);t===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=t,e.objectTransparency=r,this._renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,t,r){e.getCombinedShaderTransformation(t,r);const s=null!=t.localOrigin?this._localOrigins.register(t.localOrigin):this._localOrigins.acquire(_(this._tmpModelPosition,r[12],r[13],r[14]));return t.localOrigin=s.origin,C(s.origin.vec3,r),s}_createComponentBuffers(e){if(null==this._componentColorManager)return null;const t=new Array,r=this._componentColorManager.getBuffer(e.length),s=r.acquireIndices(e.length);for(let i=0;i<e.length;i++){const r=e[i],n=s[i];t.push({index:n,verticalOffset:0,material:r})}const n=new te(r,t);return oe(n),n}_extractEdges(e,t,r,s,n,i,o=i.length){return o<X&&(n=!0),this._workerHandle.process({data:r,indices:i,indicesLength:o,writerSettings:t,skipDeduplicate:s},e,n)}_createRenderable(e,t,r,s,n){const i=t=>new re(new D(this.rctx,new Map([["vertices",this._vertexBuffer],["instances",0===t?new Q(this.rctx,U,e.regular.instancesData.buffer):new Q(this.rctx,V,e.silhouette.instancesData.buffer)]])),0===t?e.regular.lodInfo:e.silhouette.lodInfo),o=e.regular.lodInfo.lengths.length>0?i(0):null,a=e.silhouette.lodInfo.lengths.length>0?i(1):null,l=(o?.vao.usedMemory??0)+(a?.vao.usedMemory??0);return new ne(o,a,{gpuMemoryUsage:l,externalMemoryUsage:n,averageEdgeLength:e.averageEdgeLength},r,z(t.meta),G(t.meta),t,s)}async _addGeometry(e,t,r,s,n,i){if(r.edgeIndicesLength<=0)return;const o=r.attributes.get("position"),a=f(),l=this._computeModelTransformWithLocalOrigin(e,r,a),c=new me(o,a,l);return this._addPositionData(t,c,r.edgeIndicesLength,s,n,i)}async _addPositionData(e,t,r,s,n,i=!1){if(null==e.loaded)return;const o=this._createComponentBuffers([s]);if(null==o)return;const a=this._acquireRenderer(s.type,n,!0),{modelTransform:l,origin:c}=t,d=t.position.indices,h=t.position,u=h.data.length/h.size,m=S.createBuffer(u);for(let f=0;f<u;f++)m.position.set(f,0,h.data[f*h.size]),m.position.set(f,1,h.data[f*h.size+1]),m.position.set(f,2,h.data[f*h.size+2]);K(o.meta,[0,m.componentIndex.count],m.componentIndex);const g=await this._updatingHandles.addPromise(this._extractEdges(e.abort?.signal||this._workerAbort.signal,a.writerSettings,m,!1,i,d,r));if(null==e.loaded)return;const p=this._createRenderable(g,o,new se(l,c),a.key,!1);e.renderables.push(p),a.addRenderable(p),this._gpuMemoryUsage+=p.statistics.gpuMemoryUsage}async _addComponentGeometry(e,t,r,s,n,i,o,a){if(null==t.loaded)return 0;const l=this._createComponentBuffers(i);if(null==l)return 0;const c=W(i),d=this._acquireRenderer(c,o||!1,!1),h=S.createBuffer(r.length/3);v(h.position.typedBuffer,r,h.position.typedBufferStride,3),K(l.meta,n,h.componentIndex,s);const u=!0,m=d.writerSettings,g=await this._updatingHandles.addPromise(this._extractEdges(this._workerAbort.signal,m,h,u,!1,s));if(null==t.loaded)return 0;const p=this._createRenderable(g,l,e,d.key,!0);return t.renderables.push(p),d.addRenderable(p),this._updateAllVerticalOffsets(t,a),p.statistics.gpuMemoryUsage}async _addObjectMergedGeometries(e,t,r,s,n){const i=new Map;let o=0,a=0,l=null;const c=e.geometries.filter(e=>{if(e.edgeIndicesLength<=0||!e.material.supportsEdges)return!1;!l&&e.localOrigin&&(l=e);const t=e.positionAttribute;return a+=t.data.length/t.size,o+=e.edgeIndicesLength,!0});if(0===c.length)return;const d=a>=65536?Uint32Array:Uint16Array,h=o?new d(o):null,u=[];let m=0;c.forEach(e=>{const t=e.attributes.get("position"),r=t.indices;let s=i.get(t.data);if(null==s){s=u.length/3;for(let e=0;e<t.data.length;e+=t.size)u.push(t.data[e]),u.push(t.data[e+1]),u.push(t.data[e+2]);i.set(t.data,s)}for(let n=0;n<e.edgeIndicesLength;n++)h[m++]=s+r[n]});const g=l||e.geometries[0],p=f(),_=this._computeModelTransformWithLocalOrigin(e,g,p);for(let f=0;f<e.geometries.length;f++)e.geometries[f].localOrigin=_.origin;const y=new me(new T(u,h,3),p,_);await this._updatingHandles.addPromise(this._addPositionData(t,y,h.length,r,s,n))}_acquireRenderer(e,t,r){const s=q.getKey(e,t,r);let n=this._renderers.get(s);return null==this._strokesTexture&&(this._strokesTexture=N(this.rctx)),n||(n=new q(this.rctx,this.techniques,{type:e,hasSlicePlane:t,strokesTexture:this._strokesTexture,legacy:r,spherical:1===this.viewingMode}),this._renderers.set(s,n)),++n.refCount,n}_removeRenderable(e){Z(e.regular),Z(e.silhouette);const t=this._renderers.get(e.rendererKey);if(t){t.removeRenderable(e),--t.refCount,this._localOrigins.release(e.transform.origin),this._gpuMemoryUsage-=e.statistics.externalMemoryUsage?0:e.statistics.gpuMemoryUsage;for(const t of e.components.meta)e.components.buffer.releaseIndex(t.index)}}_updateObjectCameraDistances(e){const t=e.camera.eye,r=e.camera.viewForward,s=w(),n=e=>{b(s,e.center,t);const n=j(s,r),i=e.radius,o=n<-i?1/0:n<i?0:n-i;e.renderables.forEach(e=>e.distanceToCamera=o)};this._objectEntries.forEach(n),this._pendingDeletions.forEach(n)}get test(){}};function Z(e){e?.vao&&(e.vao.buffer("instances")?.dispose(),e.vao.disposeVAOOnly(),e.vao=null)}function $(e){let t=null,s=null;for(const n of e.geometries){if(n.material.supportsEdges){if(t){if(!r(t,n.transformation))return!1}else t=n.transformation;if(s||null==n.localOrigin){if(null!=s?.localOrigin&&null!=n.localOrigin&&s.localOrigin.id!==n.localOrigin.id)return!1}else s=n}}return!0}e([d({constructOnly:!0})],Y.prototype,"rctx",void 0),e([d({constructOnly:!0})],Y.prototype,"renderSR",void 0),e([d({constructOnly:!0})],Y.prototype,"viewingMode",void 0),e([d({constructOnly:!0})],Y.prototype,"techniques",void 0),e([d({constructOnly:!0})],Y.prototype,"setNeedsRender",void 0),e([d({constructOnly:!0})],Y.prototype,"schedule",void 0),e([d({readOnly:!0})],Y.prototype,"_updatingHandles",void 0),e([d({readOnly:!0})],Y.prototype,"updating",null),Y=e([h("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView")],Y);class ee{constructor(e,t,r,s){this.abort=e,this.radius=s,this.renderables=new Array;const n=e?c(e.signal,()=>e.abort()):null;this.loaded=t,this.loaded.then(()=>{null!=this.loaded&&(this.loaded=!0),this.abort=null,n?.remove()}),this.center=O(r)}}class te{constructor(e,t){this.buffer=e,this.meta=t}}class re{constructor(e,t){this.vao=e,this.lod=t}}class se{constructor(e,t){this.modelMatrix=e,this.origin=t}}class ne{constructor(e,t,r,s,n,i,o,a){this.regular=e,this.silhouette=t,this.statistics=r,this.transform=s,this.edgeTransparency=n,this.objectTransparency=i,this.components=o,this.rendererKey=a,this.distanceToCamera=0,this.visible=!0}}class ie extends ne{}function oe(e){const{meta:t,buffer:r}=e,s=r.textureBuffer,n=s.getVec4Field("color"),o=s.getScalarField("lineWidth"),a=s.getScalarField("extensionLength"),l=s.getScalarField("materialType"),c=s.getScalarField("opacity"),d=s.getScalarField("elevationOffset");for(let h=0;h<t.length;h++){const e=t[h].material,r=t[h].index,s=i(Math.round(e.size*H),0,255),u=i(e.extensionLength,-B,255-B)+B,m=255*e.opacity,g=e.color,p=255*g[0],f=255*g[1],_=255*g[2],y=255*g[3];n.setValues(r,p,f,_,y),o.set(r,s),a.set(r,u),l.set(r,e.type),c.set(r,m),d.set(r,t[h].verticalOffset)}}function ae(e,t,r){let s,n;const i=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable(i=>{if(!ce(i)||!i.visible)return;s??=e.acquireTechnique(t,!1),n??=e.rctx.bindTechnique(s,t,r);const a=ue(i.regular.lod.lengths,i.distanceToCamera,o);e.renderRegularEdges(n,i,r,t,a)},i)}function le(e,t,r){let s,n;const i=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable(i=>{if(!he(i)||!i.visible)return;s??=e.acquireTechnique(t,!0),n??=e.rctx.bindTechnique(s,t,r);const a=ue(i.silhouette.lod.lengths,i.distanceToCamera,o);e.renderSilhouetteEdges(n,i,r,t,a)},i)}function ce(e){return null!=e.regular}class de extends ne{}function he(e){return null!=e.silhouette}function ue(e,t,r){const n=t*r,i=s(e,n,!0);return-1===i?n<e[0]?e.length:0:e.length-i}class me{constructor(e,t,r){this.position=e,this.modelTransform=t,this.origin=r}}const ge=p(),pe=()=>Promise.reject(),fe=[{name:"color",type:"vec4u8"},{name:"lineWidth",type:"u8"},{name:"extensionLength",type:"u8"},{name:"materialType",type:"u8"},{name:"opacity",type:"u8"},{name:"elevationOffset",type:"packed-f32",maxValue:x}];export{Y as EdgeView,se as LegacyTransform,ie as RegularRenderable,ne as Renderable,de as SilhouetteRenderable};
5
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{equals as r,binaryIndexOf as s}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import n from"../../../../../core/Logger.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as o,destroyMaybe as a}from"../../../../../core/maybe.js";import{isAbortError as l,onAbortOrThrow as c}from"../../../../../core/promiseUtils.js";import{property as d,subclass as h}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as u,transpose as g,invert as m}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as p}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{h as _,d as y,a as b,g as w}from"../../../../../chunks/vec32.js";import{create as j,clone as O}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as E}from"../../../../../core/support/UpdatingHandles.js";import{c as v}from"../../../../../chunks/vec33.js";import{maxElevationOffset as x}from"../../collections/Component/Material/shader/ComponentData.glsl.js";import{TwoVectorPosition as M}from"../../core/util/TwoVectorPosition.js";import{Attribute as T}from"../Attribute.js";import{GridLocalOriginFactory as R}from"../GridLocalOriginFactory.js";import{applyToModelMatrix as C}from"../localOriginHelper.js";import{LocalOriginManager as A}from"../LocalOriginManager.js";import{Object3D as P}from"../Object3D.js";import{VertexArrayObject as D}from"../VertexArrayObject.js";import{VertexLayout as k,glVertexLayout as L,EdgeInputBufferLayout as S,RegularEdgeInstancesGLLayout as U,SilhouetteEdgeInstancesGLLayout as q}from"./bufferLayouts.js";import{EdgeRenderer as H,lineWidthFractionFactor as V,extensionLengthOffset as B}from"./EdgeRenderer.js";import{EdgePassParameters as I}from"./EdgeShaderParameters.js";import{EdgeWorkerHandle as F}from"./EdgeWorkerHandle.js";import{generateStrokesTexture as N}from"./strokes.js";import{determineRendererType as W,determineEdgeTransparency as z,determineObjectTransparency as G,fillComponentBufferIndices as K}from"./util.js";import{BufferManager as J}from"../TextureBackedBuffer/BufferManager.js";import{VertexBuffer as Q}from"../../../../webgl/VertexBuffer.js";const X=128;let Y=class extends t{constructor(e){super(e),this._updatingHandles=new E,this._objectEntries=new Map,this._pendingDeletions=new Map,this._renderers=new Map,this._gpuMemoryUsage=0,this._workerAbort=new AbortController,this._tmpModelPosition=j(),this._localOrigins=new A(new R(e.renderSR));const t=k.createBuffer(4);for(let r=0;r<4;r++)t.sideness.set(r,0,0===r||3===r?0:1),t.sideness.set(r,1,0===r||1===r?0:1);this._vertexBuffer=new Q(e.rctx,L,t.buffer)}initialize(){this._workerHandle=new F(this.schedule),this._componentColorManager=new J(this.rctx,fe)}destroy(){this.destroyed||(this._objectEntries.forEach(e=>this._discardObjectEntry(e)),this._objectEntries.clear(),this._pendingDeletions.forEach(e=>this._discardObjectEntry(e)),this._pendingDeletions.clear(),this._strokesTexture=o(this._strokesTexture),this._componentColorManager=a(this._componentColorManager),this._workerAbort.abort(),this._workerHandle.destroy(),this._vertexBuffer.dispose(),this._renderers.clear(),this._updatingHandles.destroy(),this._set("schedule",pe))}get updating(){return this._updatingHandles.updating}get usedMemory(){return this._gpuMemoryUsage}shouldRender(){return this._renderers.size>0}async addComponentObject(e,t,r,s,n,i,o){if(this.hasObject(e))return this._getObjectMemoryUsage(e);let a;const l=new ee(null,new Promise(e=>a=e),e.obb.center,e.obb.radius);this._objectEntries.set(e,l);const c=await this._updatingHandles.addPromise(this._addComponentGeometry(e.transform,l,t,r,s,n,i,o));return this.setNeedsRender(),a(),c}async addOrUpdateObject3D(e,t,r,s){if(this.destroyed)return void n.getLogger(this).warn("Attempt to add an object to a destroyed instance");const i=new AbortController;let o;const{center:a,radius:c}=e.boundingVolumeWorldSpace.bounds,d=new ee(i,new Promise(e=>o=e),a,c),h=this._objectEntries.get(e);h&&(this._pendingDeletions.has(e)?this._discardObjectEntry(h):this._pendingDeletions.set(e,h)),this._objectEntries.set(e,d);try{const n=new Array;if(e.geometries.length>1&&$(e))n.push(this._addObjectMergedGeometries(e,d,t,r,s));else for(const i of e.geometries)i.material.supportsEdges&&n.push(this._addGeometry(e,d,i,t,r,s));await this._updatingHandles.addPromise(Promise.all(n)),this._removePendingDeletion(e)}catch(u){l(u)?this._discardObjectEntry(d):this._removePendingDeletion(e)}finally{this.setNeedsRender(),o()}}removeObject(e){const t=this._objectEntries.get(e);this._objectEntries.delete(e),this._discardObjectEntry(t),this._removePendingDeletion(e)}_removePendingDeletion(e){const t=this._pendingDeletions.get(e);this._pendingDeletions.delete(e),this._discardObjectEntry(t)}async _getObjectEntry(e){const t=this._objectEntries.get(e);if(!t)throw new Error("no object");return await t.loaded,null==t.loaded?null:t}fastUpdateObject3DEdgesTransform(e){if(this.destroyed)return!1;const t=this._objectEntries.get(e);if(!t)return!1;const{geometries:r}=e,{renderables:s}=t;if(0===r.length||0===s.length)return!0;if(s.length>1)return!1;const[n]=s,i=n.transform;if(!(i instanceof se))return!1;const[o]=r;if(o.localOrigin!==i.origin.origin)return!1;const a=f(),l=this._computeModelTransformWithLocalOrigin(e,o,a);return n.transform=new se(a,l),this.setNeedsRender(),!0}_discardObjectEntry(e){e&&(e.abort?.abort(),e.renderables.length&&(e.renderables.forEach(e=>this._removeRenderable(e)),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this._objectEntries.has(e)}async updateAllComponentOpacities(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));if(null==r)return;const s=Array.isArray(t)?e=>t[e]:()=>t;r.renderables.forEach(e=>{const{meta:t,buffer:r}=e.components,n=t.length,i=r.textureBuffer.getScalarField("opacity");for(let o=0;o<n;o++){const e=s(o),r=t[o],n=r.index;r.material.opacity=e,i.set(n,255*e)}this._updateTransparency(e)}),this.setNeedsRender()}async _getObjectMemoryUsage(e){const t=await this._getObjectEntry(e);return t?t.renderables.reduce((e,t)=>e+t.statistics.gpuMemoryUsage,0):0}async updateAllComponentMaterials(e,t,r,s){const n=e instanceof P,i=W(t),o=H.getKey(i,r,n),a=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=a&&(a.renderables.forEach(e=>{if(o!==e.rendererKey){const t=this._renderers.get(e.rendererKey),s=this._acquireRenderer(i,r,n);t.removeRenderable(e),--t.refCount,e.rendererKey=o,s.addRenderable(e)}if(Array.isArray(t))for(let r=0;r<t.length;r++)e.components.meta[r].material=t[r];else e.components.meta[0].material=t;s&&oe(e.components),this._updateTransparency(e)}),this.setNeedsRender())}async updateAllVerticalOffsets(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=r&&this._updateAllVerticalOffsets(r,t)}_updateAllVerticalOffsets(e,t){e.renderables.forEach(e=>{const r=e.components.meta;for(let s=0;s<r.length;s++)e.components.meta[s].verticalOffset=t?.[s]??0;oe(e.components)}),this.setNeedsRender()}async updateObjectVisibility(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));r&&(r.renderables.forEach(e=>e.visible=t),this.setNeedsRender())}render(e,t){if(null==this._componentColorManager)return;this._localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,s=j(),n=new M;let i=0,o=0;if(this._renderers.forEach(r=>{0!==r.refCount?(++this.techniques.precompiling,r.forEachRenderable(t=>{t.visible&&(i+=t.statistics.averageEdgeLength,o++,t.regular&&r.acquireTechnique(e,!1),t.silhouette&&r.acquireTechnique(e,!0))},t),--this.techniques.precompiling):this._renderers.delete(r.key)}),this._componentColorManager.garbageCollect(),this._componentColorManager.updateTextures(),0===o)return;const a=new I(40*i/o,t);_(s,r[3],r[7],r[11]),n.set(s),y(a.transformWorldFromViewTH,n.high),y(a.transformWorldFromViewTL,n.low),u(a.transformViewFromCameraRelativeRS,e.camera.viewMatrix),g(me,a.transformViewFromCameraRelativeRS),m(a.transformNormalViewFromGlobal,me),this._updateObjectCameraDistances(e),this._renderers.forEach(t=>{ae(t,e,a),le(t,e,a)})}_updateTransparency(e){const t=z(e.components.meta),r=G(e.components.meta);t===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=t,e.objectTransparency=r,this._renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,t,r){e.getCombinedShaderTransformation(t,r);const s=null!=t.localOrigin?this._localOrigins.register(t.localOrigin):this._localOrigins.acquire(_(this._tmpModelPosition,r[12],r[13],r[14]));return t.localOrigin=s.origin,C(s.origin.vec3,r),s}_createComponentBuffers(e){if(null==this._componentColorManager)return null;const t=new Array,r=this._componentColorManager.getBuffer(e.length),s=r.acquireIndices(e.length);for(let i=0;i<e.length;i++){const r=e[i],n=s[i];t.push({index:n,verticalOffset:0,material:r})}const n=new te(r,t);return oe(n),n}_extractEdges(e,t,r,s,n,i,o=i.length){return o<X&&(n=!0),this._workerHandle.process({data:r,indices:i,indicesLength:o,writerSettings:t,skipDeduplicate:s},e,n)}_createRenderable(e,t,r,s,n){const i=t=>new re(new D(this.rctx,new Map([["vertices",this._vertexBuffer],["instances",0===t?new Q(this.rctx,U,e.regular.instancesData.buffer):new Q(this.rctx,q,e.silhouette.instancesData.buffer)]])),0===t?e.regular.lodInfo:e.silhouette.lodInfo),o=e.regular.lodInfo.lengths.length>0?i(0):null,a=e.silhouette.lodInfo.lengths.length>0?i(1):null,l=(o?.vao.usedMemory??0)+(a?.vao.usedMemory??0);return new ne(o,a,{gpuMemoryUsage:l,externalMemoryUsage:n,averageEdgeLength:e.averageEdgeLength},r,z(t.meta),G(t.meta),t,s)}async _addGeometry(e,t,r,s,n,i){if(r.edgeIndicesLength<=0)return;const o=r.attributes.get("position"),a=f(),l=this._computeModelTransformWithLocalOrigin(e,r,a),c=new ge(o,a,l);return this._addPositionData(t,c,r.edgeIndicesLength,s,n,i)}async _addPositionData(e,t,r,s,n,i=!1){if(null==e.loaded)return;const o=this._createComponentBuffers([s]);if(null==o)return;const a=this._acquireRenderer(s.type,n,!0),{modelTransform:l,origin:c}=t,d=t.position.indices,h=t.position,u=h.data.length/h.size,g=S.createBuffer(u);for(let f=0;f<u;f++)g.position.set(f,0,h.data[f*h.size]),g.position.set(f,1,h.data[f*h.size+1]),g.position.set(f,2,h.data[f*h.size+2]);K(o.meta,[0,g.componentIndex.count],g.componentIndex);const m=await this._updatingHandles.addPromise(this._extractEdges(e.abort?.signal||this._workerAbort.signal,a.writerSettings,g,!1,i,d,r));if(null==e.loaded)return;const p=this._createRenderable(m,o,new se(l,c),a.key,!1);e.renderables.push(p),a.addRenderable(p),this._gpuMemoryUsage+=p.statistics.gpuMemoryUsage}async _addComponentGeometry(e,t,r,s,n,i,o,a){if(null==t.loaded)return 0;const l=this._createComponentBuffers(i);if(null==l)return 0;const c=W(i),d=this._acquireRenderer(c,o||!1,!1),h=S.createBuffer(r.length/3);v(h.position.typedBuffer,r,h.position.typedBufferStride,3),K(l.meta,n,h.componentIndex,s);const u=!0,g=d.writerSettings,m=await this._updatingHandles.addPromise(this._extractEdges(this._workerAbort.signal,g,h,u,!1,s));if(null==t.loaded)return 0;const p=this._createRenderable(m,l,e,d.key,!0);return t.renderables.push(p),d.addRenderable(p),this._updateAllVerticalOffsets(t,a),p.statistics.gpuMemoryUsage}async _addObjectMergedGeometries(e,t,r,s,n){const i=new Map;let o=0,a=0,l=null;const c=e.geometries.filter(e=>{if(e.edgeIndicesLength<=0||!e.material.supportsEdges)return!1;!l&&e.localOrigin&&(l=e);const t=e.positionAttribute;return a+=t.data.length/t.size,o+=e.edgeIndicesLength,!0});if(0===c.length)return;const d=a>=65536?Uint32Array:Uint16Array,h=o?new d(o):null,u=[];let g=0;c.forEach(e=>{const t=e.attributes.get("position"),r=t.indices;let s=i.get(t.data);if(null==s){s=u.length/3;for(let e=0;e<t.data.length;e+=t.size)u.push(t.data[e]),u.push(t.data[e+1]),u.push(t.data[e+2]);i.set(t.data,s)}for(let n=0;n<e.edgeIndicesLength;n++)h[g++]=s+r[n]});const m=l||e.geometries[0],p=f(),_=this._computeModelTransformWithLocalOrigin(e,m,p);for(let f=0;f<e.geometries.length;f++)e.geometries[f].localOrigin=_.origin;const y=new ge(new T(u,h,3),p,_);await this._updatingHandles.addPromise(this._addPositionData(t,y,h.length,r,s,n))}_acquireRenderer(e,t,r){const s=H.getKey(e,t,r);let n=this._renderers.get(s);return null==this._strokesTexture&&(this._strokesTexture=N(this.rctx)),n||(n=new H(this.rctx,this.techniques,{type:e,hasSlicePlane:t,strokesTexture:this._strokesTexture,legacy:r,spherical:1===this.viewingMode}),this._renderers.set(s,n)),++n.refCount,n}_removeRenderable(e){Z(e.regular),Z(e.silhouette);const t=this._renderers.get(e.rendererKey);if(t){t.removeRenderable(e),--t.refCount,this._localOrigins.release(e.transform.origin),this._gpuMemoryUsage-=e.statistics.externalMemoryUsage?0:e.statistics.gpuMemoryUsage;for(const t of e.components.meta)e.components.buffer.releaseIndex(t.index)}}_updateObjectCameraDistances(e){const t=e.camera.eye,r=e.camera.viewForward,s=j(),n=e=>{b(s,e.center,t);const n=w(s,r),i=e.radius,o=n<-i?1/0:n<i?0:n-i;e.renderables.forEach(e=>e.distanceToCamera=o)};this._objectEntries.forEach(n),this._pendingDeletions.forEach(n)}get test(){}};function Z(e){e?.vao&&(e.vao.buffer("instances")?.dispose(),e.vao.disposeVAOOnly(),e.vao=null)}function $(e){let t=null,s=null;for(const n of e.geometries){if(n.material.supportsEdges){if(t){if(!r(t,n.transformation))return!1}else t=n.transformation;if(s||null==n.localOrigin){if(null!=s?.localOrigin&&null!=n.localOrigin&&s.localOrigin.id!==n.localOrigin.id)return!1}else s=n}}return!0}e([d({constructOnly:!0})],Y.prototype,"rctx",void 0),e([d({constructOnly:!0})],Y.prototype,"renderSR",void 0),e([d({constructOnly:!0})],Y.prototype,"viewingMode",void 0),e([d({constructOnly:!0})],Y.prototype,"techniques",void 0),e([d({constructOnly:!0})],Y.prototype,"setNeedsRender",void 0),e([d({constructOnly:!0})],Y.prototype,"schedule",void 0),e([d({readOnly:!0})],Y.prototype,"_updatingHandles",void 0),e([d({readOnly:!0})],Y.prototype,"updating",null),Y=e([h("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView")],Y);class ee{constructor(e,t,r,s){this.abort=e,this.radius=s,this.renderables=new Array;const n=e?c(e.signal,()=>e.abort()):null;this.loaded=t,this.loaded.then(()=>{null!=this.loaded&&(this.loaded=!0),this.abort=null,n?.remove()}),this.center=O(r)}}class te{constructor(e,t){this.buffer=e,this.meta=t}}class re{constructor(e,t){this.vao=e,this.lod=t}}class se{constructor(e,t){this.modelMatrix=e,this.origin=t}}class ne{constructor(e,t,r,s,n,i,o,a){this.regular=e,this.silhouette=t,this.statistics=r,this.transform=s,this.edgeTransparency=n,this.objectTransparency=i,this.components=o,this.rendererKey=a,this.distanceToCamera=0,this.visible=!0}}class ie extends ne{}function oe(e){const{meta:t,buffer:r}=e,s=r.textureBuffer,n=s.getVec4Field("color"),o=s.getScalarField("lineWidth"),a=s.getScalarField("extensionLength"),l=s.getScalarField("materialType"),c=s.getScalarField("opacity"),d=s.getScalarField("elevationOffset");for(let h=0;h<t.length;h++){const e=t[h].material,r=t[h].index,s=i(Math.round(e.size*V),0,255),u=i(e.extensionLength,-B,255-B)+B,g=255*e.opacity,m=e.color,p=255*m[0],f=255*m[1],_=255*m[2],y=255*m[3];n.setValues(r,p,f,_,y),o.set(r,s),a.set(r,u),l.set(r,e.type),c.set(r,g),d.set(r,t[h].verticalOffset)}}function ae(e,t,r){let s,n;const i=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable(i=>{if(!ce(i)||!i.visible)return;s??=e.acquireTechnique(t,!1),n??=e.rctx.bindTechnique(s,t,r);const a=ue(i.regular.lod.lengths,i.distanceToCamera,o);e.renderRegularEdges(n,i,r,t,a)},i)}function le(e,t,r){let s,n;const i=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable(i=>{if(!he(i)||!i.visible)return;s??=e.acquireTechnique(t,!0),n??=e.rctx.bindTechnique(s,t,r);const a=ue(i.silhouette.lod.lengths,i.distanceToCamera,o);e.renderSilhouetteEdges(n,i,r,t,a)},i)}function ce(e){return null!=e.regular}class de extends ne{}function he(e){return null!=e.silhouette}function ue(e,t,r){const n=t*r,i=s(e,n,!0);return-1===i?n<e[0]?e.length:0:e.length-i}class ge{constructor(e,t,r){this.position=e,this.modelTransform=t,this.origin=r}}const me=p(),pe=()=>Promise.reject(),fe=[{name:"color",type:"vec4u8"},{name:"lineWidth",type:"u8"},{name:"extensionLength",type:"u8"},{name:"materialType",type:"u8"},{name:"opacity",type:"u8"},{name:"elevationOffset",type:"packed-f32",maxValue:x}];export{Y as EdgeView,se as LegacyTransform,ie as RegularRenderable,ne as Renderable,de as SilhouetteRenderable};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{freeze as t,create as i,ZEROS as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{isColor as l}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as a}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{ReloadableShader as n}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as c,depthOnlyOutputBuffersOr as m}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as u}from"../effects/geometry/olidUtils.js";import{OITPolygonOffset as p,oitDepthTest as f,blending as h,getDrawBuffers as d}from"../lib/OrderIndependentTransparency.js";import{stencilBaseAllZerosParams as b,stencilWriteMaskOn as g}from"../lib/StencilUtils.js";import{advancedMRRFactors as j}from"./pbrUtils.js";import{P as v}from"../../../../chunks/Path.glsl.js";import{makePipelineState as S,defaultColorWrite as y,defaultDepthWrite as P,frontFaceCullingParams as T}from"../../../webgl/renderState.js";class V extends a{constructor(){super(...arguments),this.ambient=t(.2,.2,.2),this.diffuse=t(.8,.8,.8),this.opacity=1,this.origin=i(),this.modelTransformation=null,this.mrrFactors=j,this.emissiveStrength=0,this.emissiveSource=1,this.emissiveBaseColor=s}}let x=class extends c{constructor(e,r){super(e,r,z(r).locations),this.shader=new n(v,()=>import("../shaders/Path.glsl.js"))}initializePipeline(e){const{output:r,hasEmission:t,transparent:i,hasSlicePlane:s,doubleSidedMode:o,hasOccludees:a,oitPass:n}=e,c=0===n,u=2===n;return S({blending:l(r)&&i?h(n):null,culling:s&&!i&&0!==o?T:null,depthTest:{func:f(n)},depthWrite:c||u?P:null,drawBuffers:m(r,d(n,t)),colorWrite:y,stencilWrite:a?g:null,stencilTest:a?b:null,polygonOffset:c||u?null:p})}};function z(e){const r=o().vec3f("position").vec4f16("profileVertexAndNormal").vec2i16("profileRight",{glNormalized:!0}).vec2i16("profileUp",{glNormalized:!0});return e.hasVVSize&&r.f32("sizeFeatureAttribute"),e.hasVVColor&&r.f32("colorFeatureAttribute"),e.hasVVOpacity&&r.f32("opacityFeatureAttribute"),u()&&r.vec4u8("olidColor"),r.vec3f16("profileAuxData"),r.freeze()}x=e([r("esri.views.3d.webgl-engine.materials.PathTechnique")],x);export{V as PathPassParameters,x as PathTechnique,z as getLayout};
5
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{freeze as t,create as i,ZEROS as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{isColor as l}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as a}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{ReloadableShader as n}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as c,depthOnlyOutputBuffersOr as m}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as u}from"../effects/geometry/olidUtils.js";import{OITPolygonOffset as p,depthTest as f,blending as h,drawBuffers as d}from"../lib/OrderIndependentTransparency.js";import{stencilBaseAllZerosParams as b,stencilWriteMaskOn as g}from"../lib/StencilUtils.js";import{advancedMRRFactors as j}from"./pbrUtils.js";import{P as v}from"../../../../chunks/Path.glsl.js";import{makePipelineState as S,defaultColorWrite as y,defaultDepthWrite as P,frontFaceCullingParams as T}from"../../../webgl/renderState.js";class V extends a{constructor(){super(...arguments),this.ambient=t(.2,.2,.2),this.diffuse=t(.8,.8,.8),this.opacity=1,this.origin=i(),this.modelTransformation=null,this.mrrFactors=j,this.emissiveStrength=0,this.emissiveSource=1,this.emissiveBaseColor=s}}let x=class extends c{constructor(e,r){super(e,r,z(r).locations),this.shader=new n(v,()=>import("../shaders/Path.glsl.js"))}initializePipeline(e){const{output:r,hasEmission:t,transparent:i,hasSlicePlane:s,doubleSidedMode:o,hasOccludees:a,oitPass:n}=e,c=0===n,u=2===n;return S({blending:l(r)&&i?h(n):null,culling:s&&!i&&0!==o?T:null,depthTest:f(n),depthWrite:c||u?P:null,drawBuffers:m(r,d(n,t)),colorWrite:y,stencilWrite:a?g:null,stencilTest:a?b:null,polygonOffset:c||u?null:p})}};function z(e){const r=o().vec3f("position").vec4f16("profileVertexAndNormal").vec2i16("profileRight",{glNormalized:!0}).vec2i16("profileUp",{glNormalized:!0});return e.hasVVSize&&r.f32("sizeFeatureAttribute"),e.hasVVColor&&r.f32("colorFeatureAttribute"),e.hasVVOpacity&&r.f32("opacityFeatureAttribute"),u()&&r.vec4u8("olidColor"),r.vec3f16("profileAuxData"),r.freeze()}x=e([r("esri.views.3d.webgl-engine.materials.PathTechnique")],x);export{V as PathPassParameters,x as PathTechnique,z as getLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{WaterDistortionPassParameters as s}from"../core/shaderLibrary/shading/WaterDistortion.glsl.js";import{ReloadableShader as t}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as i}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as a,getDrawBuffers as n,depthWrite as l,oitDepthTest as c,blending as d}from"../lib/OrderIndependentTransparency.js";import{PositionUvf32OlidLayout as m,PositionUvf32Layout as p}from"./DefaultLayouts.js";import{W as f}from"../../../../chunks/WaterSurface.glsl.js";import{makePipelineState as u,defaultColorWrite as h}from"../../../webgl/renderState.js";class g extends s{}let j=class extends o{constructor(e,r){super(e,r,i()?m.locations:p.locations),this.shader=new t(f,()=>import("../shaders/WaterSurface.glsl.js"))}initializePipeline(e){const{oitPass:r,output:s,hasEmission:t,transparent:o,draped:i}=e;return u({blending:2!==s&&8!==s&&9!==s&&o?d(r):null,depthTest:i?null:{func:c(r)},depthWrite:l(e),drawBuffers:n(r,t),colorWrite:h,polygonOffset:a(e)})}};j=e([r("esri.views.3d.webgl-engine.materials.WaterTechnique")],j);export{g as WaterMaterialPassParameters,j as WaterTechnique};
5
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{WaterDistortionPassParameters as s}from"../core/shaderLibrary/shading/WaterDistortion.glsl.js";import{ReloadableShader as t}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as i}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as a,drawBuffers as n,depthWrite as l,depthTest as c,blending as d}from"../lib/OrderIndependentTransparency.js";import{PositionUvf32OlidLayout as m,PositionUvf32Layout as p}from"./DefaultLayouts.js";import{W as f}from"../../../../chunks/WaterSurface.glsl.js";import{makePipelineState as u,defaultColorWrite as h}from"../../../webgl/renderState.js";class g extends s{}let j=class extends o{constructor(e,r){super(e,r,i()?m.locations:p.locations),this.shader=new t(f,()=>import("../shaders/WaterSurface.glsl.js"))}initializePipeline(e){const{oitPass:r,output:s,hasEmission:t,transparent:o,draped:i}=e;return u({blending:2!==s&&8!==s&&9!==s&&o?d(r):null,depthTest:i?null:c(r),depthWrite:l(e),drawBuffers:n(r,t),colorWrite:h,polygonOffset:a(e)})}};j=e([r("esri.views.3d.webgl-engine.materials.WaterTechnique")],j);export{g as WaterMaterialPassParameters,j as WaterTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{getDrawBuffers as t,depthWrite as i,oitDepthTest as n,blending as a}from"../lib/OrderIndependentTransparency.js";import{PositionUvLayout as c}from"../materials/DefaultLayouts.js";import{C as l}from"../../../../chunks/CheckerBoard.glsl.js";import{makePipelineState as d,defaultColorWrite as p}from"../../../webgl/renderState.js";let m=class extends o{constructor(e,r){super(e,r,c.locations),this.shader=new s(l,()=>import("./CheckerBoard.glsl.js"))}initializePipeline(e){const{oitPass:r,transparent:s,polygonOffset:o,hasEmission:c}=e,l=0===r,m=2===r;return d({blending:s?a(r):null,depthTest:{func:n(r)},depthWrite:i(e),drawBuffers:t(r,c),colorWrite:p,polygonOffset:l||m?o?f:null:{factor:-1,units:-25}})}};m=e([r("esri.views.3d.webgl-engine.shaders.CheckerBoardTechnique")],m);const f={factor:0,units:-25};export{m as CheckerBoardTechnique};
5
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{drawBuffers as t,depthWrite as i,depthTest as n,blending as a}from"../lib/OrderIndependentTransparency.js";import{PositionUvLayout as l}from"../materials/DefaultLayouts.js";import{C as c}from"../../../../chunks/CheckerBoard.glsl.js";import{makePipelineState as d,defaultColorWrite as p}from"../../../webgl/renderState.js";let m=class extends o{constructor(e,r){super(e,r,l.locations),this.shader=new s(c,()=>import("./CheckerBoard.glsl.js"))}initializePipeline(e){const{oitPass:r,transparent:s,polygonOffset:o,hasEmission:l}=e,c=0===r,m=2===r;return d({blending:s?a(r):null,depthTest:n(r),depthWrite:i(e),drawBuffers:t(r,l),colorWrite:p,polygonOffset:c||m?o?h:null:{factor:-1,units:-25}})}};m=e([r("esri.views.3d.webgl-engine.shaders.CheckerBoardTechnique")],m);const h={factor:0,units:-25};export{m as CheckerBoardTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l,depthOnlyOutputBuffersOr as n}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as a}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as c,depthWrite as p,oitDepthTest as u,blending as m,getDrawBuffers as f}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as d,stencilBaseAllZerosParams as h,stencilWriteMaskOn as g}from"../lib/StencilUtils.js";import{VisualVariablePassParameters as j}from"../materials/VisualVariablePassParameters.js";import{C as b}from"../../../../chunks/ColorMaterial.glsl.js";import{makePipelineState as P,defaultColorWrite as S,cullingParams as T}from"../../../webgl/renderState.js";class v extends j{constructor(){super(...arguments),this.color=t}}let y=class extends l{constructor(e,r){super(e,r,w(r).locations),this.shader=new s(b,()=>import("./ColorMaterial.glsl.js"))}_createPipeline(e,r){const{oitPass:t,output:o,hasEmission:s,transparent:l,cullFace:a,draped:j,hasOccludees:b,polygonOffset:v}=e,y=0===t;return P({blending:i(o)&&l?m(t):null,culling:T(a),depthTest:j?null:{func:u(t)},depthWrite:p(e),drawBuffers:n(o,f(t,s)),colorWrite:S,stencilWrite:b?g:null,stencilTest:b?r?d:h:null,polygonOffset:y?v?C:null:c(e)})}initializePipeline(e){return this._occludeePipelineState=this._createPipeline(e,!0),this._createPipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}};y=e([r("esri.views.3d.webgl-engine.shaders.ColorMaterialTechnique")],y);const C={factor:1,units:1};function w(e){const r=o().vec3f("position");return a()&&r.vec4u8("olidColor"),e.hasVVColor?r.f32("colorFeatureAttribute"):r.vec4u8("color"),r.freeze()}export{v as ColorMaterialPassParameters,y as ColorMaterialTechnique,w as getLayout};
5
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l,depthOnlyOutputBuffersOr as n}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as a}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as c,depthWrite as p,depthTest as u,blending as m,drawBuffers as f}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as d,stencilBaseAllZerosParams as h,stencilWriteMaskOn as g}from"../lib/StencilUtils.js";import{VisualVariablePassParameters as j}from"../materials/VisualVariablePassParameters.js";import{C as b}from"../../../../chunks/ColorMaterial.glsl.js";import{makePipelineState as P,defaultColorWrite as S,cullingParams as T}from"../../../webgl/renderState.js";class v extends j{constructor(){super(...arguments),this.color=t}}let y=class extends l{constructor(e,r){super(e,r,w(r).locations),this.shader=new s(b,()=>import("./ColorMaterial.glsl.js"))}_createPipeline(e,r){const{oitPass:t,output:o,hasEmission:s,transparent:l,cullFace:a,draped:j,hasOccludees:b,polygonOffset:v}=e,y=0===t;return P({blending:i(o)&&l?m(t):null,culling:T(a),depthTest:j?null:u(t),depthWrite:p(e),drawBuffers:n(o,f(t,s)),colorWrite:S,stencilWrite:b?g:null,stencilTest:b?r?d:h:null,polygonOffset:y?v?C:null:c(e)})}initializePipeline(e){return this._occludeePipelineState=this._createPipeline(e,!0),this._createPipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}};y=e([r("esri.views.3d.webgl-engine.shaders.ColorMaterialTechnique")],y);const C={factor:1,units:1};function w(e){const r=o().vec3f("position");return a()&&r.vec4u8("olidColor"),e.hasVVColor?r.f32("colorFeatureAttribute"):r.vec4u8("color"),r.freeze()}export{v as ColorMaterialPassParameters,y as ColorMaterialTechnique,w as getLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../../../core/has.js";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{getDrawBuffers as i}from"../lib/OrderIndependentTransparency.js";import{a as t}from"../../../../chunks/Compositing.glsl.js";import{makePipelineState as n,defaultColorWrite as a,premultipliedAlpha as c,unpremultipliedAlphaToPremultipliedAlpha as d}from"../../../webgl/renderState.js";let l=class extends o{constructor(){super(...arguments),this.shader=new s(t,()=>import("./Compositing.glsl.js"))}initializePipeline(e){const{blitMode:r,blendEmissive:s}=e;switch(r){case 0:case 3:return n({colorWrite:a,drawBuffers:i(0,s)});case 1:return n({blending:d,colorWrite:a,drawBuffers:i(0,s)});default:return n({blending:c,colorWrite:a,drawBuffers:i(0,s)})}}};l=e([r("esri.views.3d.webgl-engine.shaders.CompositingTechnique")],l);export{l as CompositingTechnique};
5
+ import{__decorate as e}from"tslib";import"../../../../core/has.js";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{drawBuffers as i}from"../lib/OrderIndependentTransparency.js";import{a as t}from"../../../../chunks/Compositing.glsl.js";import{makePipelineState as n,defaultColorWrite as a,premultipliedAlpha as c,unpremultipliedAlphaToPremultipliedAlpha as d}from"../../../webgl/renderState.js";let l=class extends o{constructor(){super(...arguments),this.shader=new s(t,()=>import("./Compositing.glsl.js"))}initializePipeline(e){const{blitMode:r,blendEmissive:s}=e;switch(r){case 0:case 3:return n({colorWrite:a,drawBuffers:i(0,s)});case 1:return n({blending:d,colorWrite:a,drawBuffers:i(0,s)});default:return n({blending:c,colorWrite:a,drawBuffers:i(0,s)})}}};l=e([r("esri.views.3d.webgl-engine.shaders.CompositingTechnique")],l);export{l as CompositingTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as i,freeze as s,create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{glLayout as l}from"../../support/buffer/glUtil.js";import{newLayout as n}from"../../support/buffer/InterleavedLayout.js";import{isColor as a}from"../core/shaderLibrary/ShaderOutput.js";import{VertexNormalPassParameters as c,VertexNormalDrawParameters as h}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{ReloadableShader as u}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as p,depthOnlyOutputBuffersOr as m}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as d}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as f,depthWrite as v,oitDepthTest as b,blending as g,getDrawBuffers as S}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as y,stencilBaseAllZerosParams as j,stencilWriteMaskOn as x}from"../lib/StencilUtils.js";import{getRenderInstanceDataLayout as C}from"../lib/lodRendering/RenderInstanceData.js";import{advancedMRRFactors as P}from"../materials/pbrUtils.js";import{D as T}from"../../../../chunks/DefaultMaterial.glsl.js";import{makePipelineState as O,cullingParams as w,defaultColorWrite as D}from"../../../webgl/renderState.js";import{fromLayouts as V}from"../../../webgl/VertexAttributeLocations.js";import{alphaCutoff as A}from"../../../../webscene/support/AlphaCutoff.js";class M extends c{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=P,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrength=0,this.emissiveSource=1,this.emissiveBaseColor=i,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=s(.2,.2,.2),this.diffuse=s(.8,.8,.8),this.externalColor=o(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=r(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=A,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class k extends h{constructor(){super(...arguments),this.origin=r(),this.slicePlaneLocalOrigin=this.origin}}let z=class extends p{constructor(e,t){const i=[l(R(t))];t.instanced&&t.instancedDoublePrecision&&i.push(l(C(t))),super(e,t,V(i)),this.shader=new u(T,()=>import("./DefaultMaterial.glsl.js"))}_makePipeline(e,t){const{oitPass:i,output:s,hasEmission:r,transparent:o,cullFace:l,customDepthTest:n,hasOccludees:c}=e;return O({blending:a(s)&&o?g(i):null,culling:L(e)?w(l):null,depthTest:{func:b(i,F(n))},depthWrite:v(e),drawBuffers:m(s,S(i,r)),colorWrite:D,stencilWrite:c?x:null,stencilTest:c?t?y:j:null,polygonOffset:f(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}};function F(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function L(e){return 0!==e.cullFace||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}function R(e){const t=n().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color"),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&d()&&t.vec4u8("olidColor"),t}z=e([t("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],z);export{k as DefaultMaterialDrawParameters,M as DefaultMaterialPassParameters,z as DefaultMaterialTechnique,R as getLayout};
5
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as i,freeze as s,create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{glLayout as l}from"../../support/buffer/glUtil.js";import{newLayout as n}from"../../support/buffer/InterleavedLayout.js";import{isColor as a}from"../core/shaderLibrary/ShaderOutput.js";import{VertexNormalPassParameters as c,VertexNormalDrawParameters as h}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{ReloadableShader as u}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as p,depthOnlyOutputBuffersOr as m}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as d}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as f,depthWrite as v,depthTest as b,blending as g,drawBuffers as S}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as y,stencilBaseAllZerosParams as j,stencilWriteMaskOn as x}from"../lib/StencilUtils.js";import{getRenderInstanceDataLayout as C}from"../lib/lodRendering/RenderInstanceData.js";import{advancedMRRFactors as P}from"../materials/pbrUtils.js";import{D as T}from"../../../../chunks/DefaultMaterial.glsl.js";import{makePipelineState as O,cullingParams as w,defaultColorWrite as D}from"../../../webgl/renderState.js";import{fromLayouts as V}from"../../../webgl/VertexAttributeLocations.js";import{alphaCutoff as A}from"../../../../webscene/support/AlphaCutoff.js";class M extends c{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=P,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrength=0,this.emissiveSource=1,this.emissiveBaseColor=i,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=s(.2,.2,.2),this.diffuse=s(.8,.8,.8),this.externalColor=o(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=r(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=A,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class k extends h{constructor(){super(...arguments),this.origin=r(),this.slicePlaneLocalOrigin=this.origin}}let z=class extends p{constructor(e,t){const i=[l(R(t))];t.instanced&&t.instancedDoublePrecision&&i.push(l(C(t))),super(e,t,V(i)),this.shader=new u(T,()=>import("./DefaultMaterial.glsl.js"))}_makePipeline(e,t){const{oitPass:i,output:s,hasEmission:r,transparent:o,cullFace:l,customDepthTest:n,hasOccludees:c}=e;return O({blending:a(s)&&o?g(i):null,culling:L(e)?w(l):null,depthTest:b(i,F(n)),depthWrite:v(e),drawBuffers:m(s,S(i,r)),colorWrite:D,stencilWrite:c?x:null,stencilTest:c?t?y:j:null,polygonOffset:f(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}};function F(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function L(e){return 0!==e.cullFace||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}function R(e){const t=n().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color"),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&d()&&t.vec4u8("olidColor"),t}z=e([t("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],z);export{k as DefaultMaterialDrawParameters,M as DefaultMaterialPassParameters,z as DefaultMaterialTechnique,R as getLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{glLayout as t}from"../../support/buffer/glUtil.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{isColor as s}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as i}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as n}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as l}from"../effects/geometry/olidUtils.js";import{getDrawBuffers as a,blending as c}from"../lib/OrderIndependentTransparency.js";import{H as u}from"../../../../chunks/HUDMaterial.glsl.js";import{PrimitiveType as f}from"../../../webgl/enums.js";import{makePipelineState as p,defaultColorWrite as m,defaultDepthWrite as d}from"../../../webgl/renderState.js";import{fromLayouts as h}from"../../../webgl/VertexAttributeLocations.js";let b=class extends n{constructor(e,r){super(e,r,h([g,w()].map(t))),this.shader=new i(u,()=>import("./HUDMaterial.glsl.js")),this.primitiveType=r.occlusionPass?f.POINTS:f.TRIANGLE_STRIP}initializePipeline(e){const{oitPass:r,hasEmission:t,hasPolygonOffset:o,draped:i,output:n,depthTestEnabled:l,occlusionPass:u}=e,f=l&&!i&&!(1===r)&&!u&&!(8===n);return p({blending:s(n)?c(r,!0):null,depthTest:l&&!i?{func:515}:null,depthWrite:f?d:null,drawBuffers:a(r,t),colorWrite:m,polygonOffset:o?v:null})}};b=e([r("esri.views.3d.webgl-engine.shaders.HUDMaterialTechnique")],b);const v={factor:0,units:-4},g=o().vec2u8("uv0",{glNormalized:!0}),j=o().vec3f("position").vec3f("normal").vec4i16("uvi").vec4u8("color").vec2f("size").f32("rotation").vec4f("centerOffsetAndDistance").vec4f("featureAttribute"),T=j.clone().vec4u8("olidColor");function w(){return l()?T:j}export{b as HUDMaterialTechnique,g as baseLayout,w as getInstanceLayout,j as instanceLayout,T as olidInstanceLayout};
5
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{glLayout as t}from"../../support/buffer/glUtil.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{isColor as s}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as i}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as n}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as l}from"../effects/geometry/olidUtils.js";import{drawBuffers as a,blending as c}from"../lib/OrderIndependentTransparency.js";import{H as u}from"../../../../chunks/HUDMaterial.glsl.js";import{PrimitiveType as f}from"../../../webgl/enums.js";import{makePipelineState as p,defaultColorWrite as m,defaultDepthWrite as d}from"../../../webgl/renderState.js";import{fromLayouts as h}from"../../../webgl/VertexAttributeLocations.js";let b=class extends n{constructor(e,r){super(e,r,h([g,w()].map(t))),this.shader=new i(u,()=>import("./HUDMaterial.glsl.js")),this.primitiveType=r.occlusionPass?f.POINTS:f.TRIANGLE_STRIP}initializePipeline(e){const{oitPass:r,hasEmission:t,hasPolygonOffset:o,draped:i,output:n,depthTestEnabled:l,occlusionPass:u}=e,f=l&&!i&&!(1===r)&&!u&&!(8===n);return p({blending:s(n)?c(r,!0):null,depthTest:l&&!i?{func:515}:null,depthWrite:f?d:null,drawBuffers:a(r,t),colorWrite:m,polygonOffset:o?v:null})}};b=e([r("esri.views.3d.webgl-engine.shaders.HUDMaterialTechnique")],b);const v={factor:0,units:-4},g=o().vec2u8("uv0",{glNormalized:!0}),j=o().vec3f("position").vec3f("normal").vec4i16("uvi").vec4u8("color").vec2f("size").f32("rotation").vec4f("centerOffsetAndDistance").vec4f("featureAttribute"),T=j.clone().vec4u8("olidColor");function w(){return l()?T:j}export{b as HUDMaterialTechnique,g as baseLayout,w as getInstanceLayout,j as instanceLayout,T as olidInstanceLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as i}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{oitPolygonOffset as l,getDrawBuffers as o,depthWrite as n,oitDepthTest as a,blending as c}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as p,stencilBaseAllZerosParams as u,stencilWriteMaskOn as m}from"../lib/StencilUtils.js";import{PositionUvLayout as d}from"../materials/DefaultLayouts.js";import{I as h}from"../../../../chunks/ImageMaterial.glsl.js";import{makePipelineState as f,defaultColorWrite as g,cullingParams as j}from"../../../webgl/renderState.js";let P=class extends s{constructor(e,t){super(e,t,S(t).locations),this.shader=new i(h,()=>import("./ImageMaterial.glsl.js"))}_getPipelineState(e,t){const{oitPass:i,output:s,hasEmission:d,hasOccludees:h,cullFace:P}=e;return f({blending:r(s)?c(i,!0):null,culling:j(P),depthTest:{func:a(i)},depthWrite:n(e),drawBuffers:o(i,d),colorWrite:g,stencilWrite:h?m:null,stencilTest:h?t?p:u:null,polygonOffset:l(e)})}initializePipeline(e){return this._occludeePipeline=this._getPipelineState(e,!0),this._getPipelineState(e,!1)}getPipeline(e){return e?this._occludeePipeline:super.getPipeline()}};function S(e){let t=d;return e.perspectiveInterpolation&&(t=t.clone().f32("perspectiveDivide")),t}P=e([t("esri.views.3d.webgl-engine.shaders.ImageMaterialTechnique")],P);export{P as ImageMaterialTechnique,S as getLayout};
5
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as i}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{oitPolygonOffset as l,drawBuffers as o,depthWrite as n,depthTest as a,blending as p}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as c,stencilBaseAllZerosParams as u,stencilWriteMaskOn as m}from"../lib/StencilUtils.js";import{PositionUvLayout as d}from"../materials/DefaultLayouts.js";import{I as h}from"../../../../chunks/ImageMaterial.glsl.js";import{makePipelineState as f,defaultColorWrite as g,cullingParams as j}from"../../../webgl/renderState.js";let P=class extends s{constructor(e,t){super(e,t,S(t).locations),this.shader=new i(h,()=>import("./ImageMaterial.glsl.js"))}_getPipelineState(e,t){const{oitPass:i,output:s,hasEmission:d,hasOccludees:h,cullFace:P}=e;return f({blending:r(s)?p(i,!0):null,culling:j(P),depthTest:a(i),depthWrite:n(e),drawBuffers:o(i,d),colorWrite:g,stencilWrite:h?m:null,stencilTest:h?t?c:u:null,polygonOffset:l(e)})}initializePipeline(e){return this._occludeePipeline=this._getPipelineState(e,!0),this._getPipelineState(e,!1)}getPipeline(e){return e?this._occludeePipeline:super.getPipeline()}};function S(e){let t=d;return e.perspectiveInterpolation&&(t=t.clone().f32("perspectiveDivide")),t}P=e([t("esri.views.3d.webgl-engine.shaders.ImageMaterialTechnique")],P);export{P as ImageMaterialTechnique,S as getLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as l}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s,depthOnlyOutputBuffersOr as n}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as o,oitDepthTest as c,blending as p,getDrawBuffers as a}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as u,stencilBaseAllZerosParams as d,stencilWriteMaskOn as h,stencilToolTransparentOccluderParams as f,depthCompareAlways as m,stencilToolMaskOccluderParams as P,stencilWriteMaskOff as T,depthCompareLess as b}from"../lib/StencilUtils.js";import{L as g}from"../../../../chunks/LineMarker.glsl.js";import{makePipelineState as W,defaultColorWrite as _,unpremultipliedAlphaToPremultipliedAlpha as S}from"../../../webgl/renderState.js";let j=class extends s{constructor(e,t){super(e,t,k(t).locations),this.shader=new l(g,()=>import("./LineMarker.glsl.js"))}_makePipelineState(e,t){const{output:i,hasEmission:l,oitPass:s,space:f,hasOccludees:m}=e;return W({blending:r(i)?p(s):null,depthTest:0===f?null:{func:c(s)},depthWrite:o(e),drawBuffers:n(i,a(s,l)),colorWrite:_,stencilWrite:m?h:null,stencilTest:m?t?u:d:null,polygonOffset:{factor:0,units:-10}})}initializePipeline(e){return e.occluder?(this._occluderPipelineTransparent=W({blending:S,depthTest:m,depthWrite:null,colorWrite:_,stencilWrite:null,stencilTest:f}),this._occluderPipelineOpaque=W({blending:S,depthTest:m,depthWrite:null,colorWrite:_,stencilWrite:T,stencilTest:P}),this._occluderPipelineMaskWrite=W({blending:null,depthTest:b,depthWrite:null,colorWrite:null,stencilWrite:h,stencilTest:u})):this._occluderPipelineTransparent=this._occluderPipelineOpaque=this._occluderPipelineMaskWrite=null,this._occludeePipelineState=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){return e?this._occludeePipelineState:11===t?this._occluderPipelineTransparent??super.getPipeline():10===t?this._occluderPipelineOpaque??super.getPipeline():this._occluderPipelineMaskWrite??super.getPipeline()}};function k(e){const t=i().vec3f("position").vec4f16("previousDelta").vec2f16("uv0");return e.hasVVColor?t.f32("colorFeatureAttribute"):t.vec4u8("color",{glNormalized:!0}),e.hasVVOpacity&&t.f32("opacityFeatureAttribute"),e.hasVVSize?t.f32("sizeFeatureAttribute"):t.f16("size"),e.worldSpace&&t.vec3f16("normal"),t.freeze()}j=e([t("esri.views.3d.webgl-engine.shaders.LineMarkerTechnique")],j);export{j as LineMarkerTechnique,k as getLayout};
5
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as l}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s,depthOnlyOutputBuffersOr as n}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as o,depthTest as c,blending as p,drawBuffers as a}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as u,stencilBaseAllZerosParams as d,stencilWriteMaskOn as h,stencilToolTransparentOccluderParams as f,depthCompareAlways as m,stencilToolMaskOccluderParams as P,stencilWriteMaskOff as T,depthCompareLess as b}from"../lib/StencilUtils.js";import{L as g}from"../../../../chunks/LineMarker.glsl.js";import{makePipelineState as W,defaultColorWrite as _,unpremultipliedAlphaToPremultipliedAlpha as S}from"../../../webgl/renderState.js";let j=class extends s{constructor(e,t){super(e,t,k(t).locations),this.shader=new l(g,()=>import("./LineMarker.glsl.js"))}_makePipelineState(e,t){const{output:i,hasEmission:l,oitPass:s,space:f,hasOccludees:m}=e;return W({blending:r(i)?p(s):null,depthTest:0===f?null:c(s),depthWrite:o(e),drawBuffers:n(i,a(s,l)),colorWrite:_,stencilWrite:m?h:null,stencilTest:m?t?u:d:null,polygonOffset:{factor:0,units:-10}})}initializePipeline(e){return e.occluder?(this._occluderPipelineTransparent=W({blending:S,depthTest:m,depthWrite:null,colorWrite:_,stencilWrite:null,stencilTest:f}),this._occluderPipelineOpaque=W({blending:S,depthTest:m,depthWrite:null,colorWrite:_,stencilWrite:T,stencilTest:P}),this._occluderPipelineMaskWrite=W({blending:null,depthTest:b,depthWrite:null,colorWrite:null,stencilWrite:h,stencilTest:u})):this._occluderPipelineTransparent=this._occluderPipelineOpaque=this._occluderPipelineMaskWrite=null,this._occludeePipelineState=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){return e?this._occludeePipelineState:11===t?this._occluderPipelineTransparent??super.getPipeline():10===t?this._occluderPipelineOpaque??super.getPipeline():this._occluderPipelineMaskWrite??super.getPipeline()}};function k(e){const t=i().vec3f("position").vec4f16("previousDelta").vec2f16("uv0");return e.hasVVColor?t.f32("colorFeatureAttribute"):t.vec4u8("color",{glNormalized:!0}),e.hasVVOpacity&&t.f32("opacityFeatureAttribute"),e.hasVVSize?t.f32("sizeFeatureAttribute"):t.f16("size"),e.worldSpace&&t.vec3f16("normal"),t.freeze()}j=e([t("esri.views.3d.webgl-engine.shaders.LineMarkerTechnique")],j);export{j as LineMarkerTechnique,k as getLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as t}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{getDrawBuffers as o}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as l,stencilBaseAllZerosParams as n,stencilWriteMaskOn as a,depthCompareLess as p}from"../lib/StencilUtils.js";import{PositionColorLayout as c,PositionLayout as u}from"../materials/DefaultLayouts.js";import{N as m}from"../../../../chunks/NativeLine.glsl.js";import{PrimitiveType as d}from"../../../webgl/enums.js";import{makePipelineState as h,defaultColorWrite as f,defaultDepthWrite as j,unpremultipliedAlphaToPremultipliedAlpha as b}from"../../../webgl/renderState.js";let g=class extends s{constructor(e,r){super(e,r,r.hasVertexColors?c.locations:u.locations),this.shader=new t(m,()=>import("./NativeLine.glsl.js")),this.primitiveType=d.LINES}initializePipeline(e){const{hasOccludees:r,output:t,hasEmission:s,transparent:c,oitPass:u}=e,m=(e,i=null,t=null)=>h({blending:i,depthTest:p,depthWrite:t,colorWrite:f,stencilWrite:r?a:null,stencilTest:r?e?l:n:null,drawBuffers:o(u,s)});return i(t)?(this._occludeePipeline=m(!0,c?b:null,j),m(!1,c?b:null,j)):m(!1)}getPipeline(e){return e?this._occludeePipeline:super.getPipeline()}};g=e([r("esri.views.3d.webgl-engine.shaders.NativeLineTechnique")],g);export{g as NativeLineTechnique};
5
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as t}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{drawBuffers as o}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as l,stencilBaseAllZerosParams as n,stencilWriteMaskOn as a,depthCompareLess as p}from"../lib/StencilUtils.js";import{PositionColorLayout as c,PositionLayout as u}from"../materials/DefaultLayouts.js";import{N as m}from"../../../../chunks/NativeLine.glsl.js";import{PrimitiveType as d}from"../../../webgl/enums.js";import{makePipelineState as h,defaultColorWrite as f,defaultDepthWrite as j,unpremultipliedAlphaToPremultipliedAlpha as b}from"../../../webgl/renderState.js";let g=class extends s{constructor(e,r){super(e,r,r.hasVertexColors?c.locations:u.locations),this.shader=new t(m,()=>import("./NativeLine.glsl.js")),this.primitiveType=d.LINES}initializePipeline(e){const{hasOccludees:r,output:t,hasEmission:s,transparent:c,oitPass:u}=e,m=(e,i=null,t=null)=>h({blending:i,depthTest:p,depthWrite:t,colorWrite:f,stencilWrite:r?a:null,stencilTest:r?e?l:n:null,drawBuffers:o(u,s)});return i(t)?(this._occludeePipeline=m(!0,c?b:null,j),m(!1,c?b:null,j)):m(!1)}getPipeline(e){return e?this._occludeePipeline:super.getPipeline()}};g=e([r("esri.views.3d.webgl-engine.shaders.NativeLineTechnique")],g);export{g as NativeLineTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as o}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s,depthOnlyOutputBuffersOr as n}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as l}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as c,depthWrite as a,oitDepthTest as p,blending as u,getDrawBuffers as d}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as f,stencilBaseAllZerosParams as m,stencilWriteMaskOn as h}from"../lib/StencilUtils.js";import{P as g}from"../../../../chunks/Pattern.glsl.js";import{makePipelineState as P,defaultColorWrite as S,cullingParams as b}from"../../../webgl/renderState.js";let j=class extends s{constructor(e,t){super(e,t,T(t).locations),this.shader=new o(g,()=>import("./Pattern.glsl.js"))}_setPipelineState(e,t){const{oitPass:r,output:o,hasEmission:s,cullFace:l,draped:g,hasOccludees:j,polygonOffset:T}=e,y=0===r;return P({blending:i(o)?u(r):null,culling:b(l),depthTest:g?null:{func:p(r)},depthWrite:a(e),drawBuffers:n(o,d(r,s)),colorWrite:S,stencilWrite:j?h:null,stencilTest:j?t?f:m:null,polygonOffset:y?T?v:null:c(e)})}initializePipeline(e){return this._occludeePipelineState=this._setPipelineState(e,!0),this._setPipelineState(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}};j=e([t("esri.views.3d.webgl-engine.shaders.PatternTechnique")],j);const v={factor:1,units:1};function T(e){const t=r().vec3f("position").vec4f("uvMapSpace");return e.draped||t.mat3f("boundingRect"),e.hasVVColor?t.f32("colorFeatureAttribute"):t.vec4u8("color"),l()&&t.vec4u8("olidColor"),t.freeze()}export{j as PatternTechnique,T as getLayout};
5
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as o}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s,depthOnlyOutputBuffersOr as n}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as l}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as c,depthWrite as a,depthTest as p,blending as u,drawBuffers as d}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as f,stencilBaseAllZerosParams as m,stencilWriteMaskOn as h}from"../lib/StencilUtils.js";import{P as g}from"../../../../chunks/Pattern.glsl.js";import{makePipelineState as P,defaultColorWrite as S,cullingParams as b}from"../../../webgl/renderState.js";let j=class extends s{constructor(e,t){super(e,t,T(t).locations),this.shader=new o(g,()=>import("./Pattern.glsl.js"))}_setPipelineState(e,t){const{oitPass:r,output:o,hasEmission:s,cullFace:l,draped:g,hasOccludees:j,polygonOffset:T}=e,y=0===r;return P({blending:i(o)?u(r):null,culling:b(l),depthTest:g?null:p(r),depthWrite:a(e),drawBuffers:n(o,d(r,s)),colorWrite:S,stencilWrite:j?h:null,stencilTest:j?t?f:m:null,polygonOffset:y?T?v:null:c(e)})}initializePipeline(e){return this._occludeePipelineState=this._setPipelineState(e,!0),this._setPipelineState(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}};j=e([t("esri.views.3d.webgl-engine.shaders.PatternTechnique")],j);const v={factor:1,units:1};function T(e){const t=r().vec3f("position").vec4f("uvMapSpace");return e.draped||t.mat3f("boundingRect"),e.hasVVColor?t.f32("colorFeatureAttribute"):t.vec4u8("color"),l()&&t.vec4u8("olidColor"),t.freeze()}export{j as PatternTechnique,T as getLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../../../core/has.js";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l,depthOnlyOutputBuffersOr as n}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as o}from"../effects/geometry/olidUtils.js";import{OITPolygonOffset as c,depthWrite as u,oitDepthTest as a,blending as p,getDrawBuffers as f}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as d,stencilBaseAllZerosParams as h,stencilWriteMaskOn as m,stencilToolTransparentOccluderParams as b,depthCompareAlways as g,stencilToolMaskOccluderParams as P,stencilWriteMaskOff as T,depthCompareLess as W}from"../lib/StencilUtils.js";import{R as j}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as y}from"../../../webgl/enums.js";import{makePipelineState as O,defaultColorWrite as S,unpremultipliedAlphaToPremultipliedAlpha as _}from"../../../webgl/renderState.js";let v=class extends l{constructor(e,t){super(e,t,L(t).locations),this.shader=new s(j,()=>import("./RibbonLine.glsl.js")),this.primitiveType=t.wireframe?y.LINES:y.TRIANGLE_STRIP}_makePipelineState(e,t){const{oitPass:i,output:s,hasEmission:l,hasOccludees:o,hasPolygonOffset:b}=e,g=0===i,P=2===i;return O({blending:r(s)?p(i):null,depthTest:{func:a(i)},depthWrite:u(e),drawBuffers:n(s,f(i,l)),colorWrite:S,stencilWrite:o?m:null,stencilTest:o?t?d:h:null,polygonOffset:g||P?b?w:null:c})}initializePipeline(e){if(e.occluder){const t=e.hasPolygonOffset?w:null,{output:i,hasOccludees:r}=e;this._occluderPipelineTransparent=O({blending:_,polygonOffset:t,depthTest:g,depthWrite:null,colorWrite:S,stencilWrite:null,stencilTest:r?b:null,drawBuffers:n(i)}),this._occluderPipelineOpaque=O({blending:_,polygonOffset:t,depthTest:r?g:W,depthWrite:null,colorWrite:S,stencilWrite:r?T:null,stencilTest:r?P:null,drawBuffers:n(i)}),this._occluderPipelineMaskWrite=O({blending:null,polygonOffset:t,depthTest:W,depthWrite:null,colorWrite:null,stencilWrite:r?m:null,stencilTest:r?d:null,drawBuffers:n(i)})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(e)return this._occludeePipeline;switch(t){case 11:return this._occluderPipelineTransparent??super.getPipeline();case 10:return this._occluderPipelineOpaque??super.getPipeline();default:return this._occluderPipelineMaskWrite??super.getPipeline()}}};v=e([t("esri.views.3d.webgl-engine.shaders.RibbonLineTechnique")],v);const w={factor:0,units:-4};function L(e){const t=i().vec3f("position").vec4f16("previousDelta").vec4f16("nextDelta").f32("u0").vec2f16("lineParameters");return e.hasVVColor?t.f32("colorFeatureAttribute"):t.vec4u8("color",{glNormalized:!0}),e.hasVVSize?t.f32("sizeFeatureAttribute"):t.f32("size"),e.hasVVOpacity&&t.f32("opacityFeatureAttribute"),o()&&t.vec4u8("olidColor"),e.hasAnimation&&t.vec4f16("timeStamps"),t}export{v as RibbonLineTechnique,L as getLayout};
5
+ import{__decorate as e}from"tslib";import"../../../../core/has.js";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l,depthOnlyOutputBuffersOr as n}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as o}from"../effects/geometry/olidUtils.js";import{OITPolygonOffset as c,depthWrite as u,depthTest as a,blending as p,drawBuffers as f}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as d,stencilBaseAllZerosParams as h,stencilWriteMaskOn as m,stencilToolTransparentOccluderParams as b,depthCompareAlways as g,stencilToolMaskOccluderParams as P,stencilWriteMaskOff as T,depthCompareLess as W}from"../lib/StencilUtils.js";import{R as j}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as y}from"../../../webgl/enums.js";import{makePipelineState as O,defaultColorWrite as S,unpremultipliedAlphaToPremultipliedAlpha as _}from"../../../webgl/renderState.js";let v=class extends l{constructor(e,t){super(e,t,L(t).locations),this.shader=new s(j,()=>import("./RibbonLine.glsl.js")),this.primitiveType=t.wireframe?y.LINES:y.TRIANGLE_STRIP}_makePipelineState(e,t){const{oitPass:i,output:s,hasEmission:l,hasOccludees:o,hasPolygonOffset:b}=e,g=0===i,P=2===i;return O({blending:r(s)?p(i):null,depthTest:a(i),depthWrite:u(e),drawBuffers:n(s,f(i,l)),colorWrite:S,stencilWrite:o?m:null,stencilTest:o?t?d:h:null,polygonOffset:g||P?b?w:null:c})}initializePipeline(e){if(e.occluder){const t=e.hasPolygonOffset?w:null,{output:i,hasOccludees:r}=e;this._occluderPipelineTransparent=O({blending:_,polygonOffset:t,depthTest:g,depthWrite:null,colorWrite:S,stencilWrite:null,stencilTest:r?b:null,drawBuffers:n(i)}),this._occluderPipelineOpaque=O({blending:_,polygonOffset:t,depthTest:r?g:W,depthWrite:null,colorWrite:S,stencilWrite:r?T:null,stencilTest:r?P:null,drawBuffers:n(i)}),this._occluderPipelineMaskWrite=O({blending:null,polygonOffset:t,depthTest:W,depthWrite:null,colorWrite:null,stencilWrite:r?m:null,stencilTest:r?d:null,drawBuffers:n(i)})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(e)return this._occludeePipeline;switch(t){case 11:return this._occluderPipelineTransparent??super.getPipeline();case 10:return this._occluderPipelineOpaque??super.getPipeline();default:return this._occluderPipelineMaskWrite??super.getPipeline()}}};v=e([t("esri.views.3d.webgl-engine.shaders.RibbonLineTechnique")],v);const w={factor:0,units:-4};function L(e){const t=i().vec3f("position").vec4f16("previousDelta").vec4f16("nextDelta").f32("u0").vec2f16("lineParameters");return e.hasVVColor?t.f32("colorFeatureAttribute"):t.vec4u8("color",{glNormalized:!0}),e.hasVVSize?t.f32("sizeFeatureAttribute"):t.f32("size"),e.hasVVOpacity&&t.f32("opacityFeatureAttribute"),o()&&t.vec4u8("olidColor"),e.hasAnimation&&t.vec4f16("timeStamps"),t}export{v as RibbonLineTechnique,L as getLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{isColor as t}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPolygonOffset as n,getDrawBuffers as a,depthWrite as l,blending as d}from"../lib/OrderIndependentTransparency.js";import{S as c}from"../../../../chunks/ShadedColorMaterial.glsl.js";import{makePipelineState as p,defaultColorWrite as u,cullingParams as f}from"../../../webgl/renderState.js";let h=class extends i{constructor(e,r){super(e,r,m(r).locations),this.shader=new s(c,()=>import("./ShadedColorMaterial.glsl.js"))}initializePipeline(e){const{oitPass:r,hasEmission:o,output:s,transparent:i,cullFace:c,shadingEnabled:h}=e,m=0===r,b=2===r;return p({blending:t(s)&&i?d(r):null,culling:f(c),depthTest:{func:b?513:h?515:513},depthWrite:l(e),drawBuffers:a(r,o),colorWrite:u,polygonOffset:m||b?null:n})}};function m(e){const r=o().vec3f("position").vec3f("normal");return e.screenSizeEnabled&&r.vec3f("offset"),r}h=e([r("esri.views.3d.webgl-engine.shaders.ShadedColorMaterialTechnique")],h);export{h as ShadedColorMaterialTechnique,m as getLayout};
5
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{isColor as t}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPolygonOffset as n,drawBuffers as a,depthWrite as l,blending as d}from"../lib/OrderIndependentTransparency.js";import{S as c}from"../../../../chunks/ShadedColorMaterial.glsl.js";import{makePipelineState as p,defaultColorWrite as u,cullingParams as f}from"../../../webgl/renderState.js";let h=class extends i{constructor(e,r){super(e,r,m(r).locations),this.shader=new s(c,()=>import("./ShadedColorMaterial.glsl.js"))}initializePipeline(e){const{oitPass:r,hasEmission:o,output:s,transparent:i,cullFace:c,shadingEnabled:h}=e,m=0===r,b=2===r;return p({blending:t(s)&&i?d(r):null,culling:f(c),depthTest:{func:b?513:h?515:513},depthWrite:l(e),drawBuffers:a(r,o),colorWrite:u,polygonOffset:m||b?null:n})}};function m(e){const r=o().vec3f("position").vec3f("normal");return e.screenSizeEnabled&&r.vec3f("offset"),r}h=e([r("esri.views.3d.webgl-engine.shaders.ShadedColorMaterialTechnique")],h);export{h as ShadedColorMaterialTechnique,m as getLayout};
@@ -2,15 +2,15 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{fromValues as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{IsNaN as r}from"../../../core/shaderLibrary/util/IsNaN.glsl.js";import{Float2BindUniform as e}from"../../../core/shaderModules/Float2BindUniform.js";import{glsl as a}from"../../../core/shaderModules/glsl.js";import{Matrix3PassUniform as s}from"../../../core/shaderModules/Matrix3PassUniform.js";import{Matrix4BindUniform as t}from"../../../core/shaderModules/Matrix4BindUniform.js";import{Matrix4PassUniform as l}from"../../../core/shaderModules/Matrix4PassUniform.js";const i=o(.5,-4e-4);function c(o,c){const m=o.vertex;m.include(r),m.constants.add("depthBias","vec2",i),m.uniforms.add(new e("inverseViewport",o=>o.inverseViewport)),c.legacy?(m.uniforms.add(new t("proj",o=>o.camera.projectionMatrix)),m.code.add(a`vec2 calculateProjectedBiasXY(vec4 projPos, vec3 globalNormal) {
5
+ import{fromValues as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{IsNaN as r}from"../../../core/shaderLibrary/util/IsNaN.glsl.js";import{Float2BindUniform as e}from"../../../core/shaderModules/Float2BindUniform.js";import{glsl as a}from"../../../core/shaderModules/glsl.js";import{Matrix3PassUniform as s}from"../../../core/shaderModules/Matrix3PassUniform.js";import{Matrix4BindUniform as t}from"../../../core/shaderModules/Matrix4BindUniform.js";const l=o(.5,-4e-4);function i(o,i){const c=o.vertex;c.include(r),c.constants.add("depthBias","vec2",l),c.uniforms.add(new e("inverseViewport",o=>o.inverseViewport)),i.legacy?(c.uniforms.add(new t("proj",o=>o.camera.projectionMatrix)),c.code.add(a`vec2 calculateProjectedBiasXY(vec4 projPos, vec3 globalNormal) {
6
6
  float offsetXY = depthBias.x;
7
7
  vec4 projNormal = proj * localView * vec4(globalNormal, 0.0);
8
8
  return offsetXY * projPos.w * 2.0 * inverseViewport * normalize(projNormal.xyz).xy;
9
- }`)):(m.uniforms.add(new s("transformNormalViewFromGlobal",o=>o.transformNormalViewFromGlobal),new l("transformProjFromView",o=>o.transformProjFromView)),m.code.add(a`vec2 calculateProjectedBiasXY(vec4 projPos, vec3 globalNormal) {
9
+ }`)):(c.uniforms.add(new s("transformNormalViewFromGlobal",o=>o.transformNormalViewFromGlobal),new t("transformProjFromView",o=>o.camera.projectionMatrix)),c.code.add(a`vec2 calculateProjectedBiasXY(vec4 projPos, vec3 globalNormal) {
10
10
  float offsetXY = depthBias.x;
11
11
  vec4 projNormal = transformProjFromView * vec4(transformNormalViewFromGlobal * globalNormal, 0.0);
12
12
  return offsetXY * projPos.w * 2.0 * inverseViewport * normalize(projNormal.xyz).xy;
13
- }`)),m.code.add(a`float _calculateProjectedBiasZ(vec4 projPos) {
13
+ }`)),c.code.add(a`float _calculateProjectedBiasZ(vec4 projPos) {
14
14
  float offsetZ = depthBias.y;
15
15
  return sqrt(max(projPos.z,0.0)) * offsetZ;
16
16
  }
@@ -21,4 +21,4 @@ projPos.xy += offsetXY;
21
21
  }
22
22
  projPos.z += _calculateProjectedBiasZ(projPos);
23
23
  return projPos;
24
- }`)}export{c as AdjustProjectedPosition};
24
+ }`)}export{i as AdjustProjectedPosition};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as e}from"tslib";import t from"../core/Accessor.js";import{makeHandle as s}from"../core/handleUtils.js";import{isActivationKey as i}from"../core/keyboard.js";import{watch as o}from"../core/reactiveUtils.js";import{addFrameTask as r}from"../core/scheduling.js";import{property as n,subclass as a}from"../core/accessorSupport/decorators.js";import{setCalciteModeClass as c}from"../support/modeUtils.js";import{globalCss as h}from"../widgets/support/globalCss.js";const d="esri-attribution",l={poweredBy:`${d}__powered-by`,sources:`${d}__sources`,sourcesOpen:`${d}__sources--open`,link:`${d}__link`};let u=class extends t{constructor(e){super(e),this._previousSourceHeight=0,this._opened=!1,this._overflowing=!1,this._changeSet=new Set,this._toggleState=()=>{(this._opened||this._overflowing)&&(this._opened=!this._opened,this._invalidate("opened"))},this.surface=document.createElement("div"),this._task=r({render:()=>{this._update(),this._task.pause(),this._changeSet.clear()}}),this.addHandles(this._task)}initialize(){const e=document.createElement("div");c(e),e.classList.add("esri-view-attribution"),e.classList.add("esri-attribution"),this._set("surface",e),e.innerHTML=`\n <div class="${l.sources}" dir="ltr"></div>\n <div class="${l.poweredBy}">\n Powered by\n <a class="${l.link}" href="https://www.esri.com/" rel="noreferrer" target="_blank">Esri</a>\n </div>`,this.addHandles([this.surface,o(()=>this.attributionItems,()=>this._invalidate("attributionItems"))]);const t=e.querySelector(`.${l.sources}`);this._previousSourceHeight=t.clientHeight;const r=new ResizeObserver(()=>{this._invalidate("overflow")});r.observe(t),this.addHandles(s(()=>r.disconnect()));const n=new MutationObserver(()=>{this._invalidate("overflow")});n.observe(t,{childList:!0,subtree:!0,characterData:!0}),this.addHandles(s(()=>n.disconnect())),t.onclick=this._toggleState,t.onkeydown=e=>{i(e.key)&&(e.preventDefault(),this._toggleState())}}_invalidate(e){this._changeSet.add(e),this._task.resume()}_update(){const e=this.surface.querySelector(`.${l.sources}`);if(this._changeSet.has("overflow")){const{clientHeight:t,clientWidth:s,scrollWidth:i}=e,o=t<this._previousSourceHeight;this._previousSourceHeight=t,this._opened?o&&(this._opened=!1):o||(this._overflowing=i>s)}if(this._changeSet.has("overflow")||this._changeSet.has("opened")){const t=this._opened||this._overflowing,s=t?"0":"";e.setAttribute("tabindex",s),e.classList.toggle(h.interactive,t),e.classList.toggle(l.sourcesOpen,this._opened)}this._changeSet.has("attributionItems")&&(e.innerText=this.attributionItems?.map(e=>e.text).join(" | ")??"")}};e([n()],u.prototype,"attributionItems",void 0),e([n({readOnly:!0})],u.prototype,"surface",void 0),u=e([a("esri.views.Attribution")],u);export{u as Attribution};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{byId as t,reparent as s}from"../core/domUtils.js";import{on as i}from"../core/events.js";import{makeHandle as r}from"../core/handleUtils.js";import n from"../core/Logger.js";import{removeMaybe as o}from"../core/maybe.js";import{watch as a,initial as l}from"../core/reactiveUtils.js";import{addFrameTask as h}from"../core/scheduling.js";import{property as d,subclass as u}from"../core/accessorSupport/decorators.js";import c from"./overlay/ViewOverlay.js";const p=[0,0];function m(e){const t=(e.ownerDocument||window.document).defaultView,s=e.getBoundingClientRect();return p[0]=s.left+(t?.pageXOffset??0),p[1]=s.top+(t?.pageYOffset??0),p}function f(e){e&&(e.textContent="",e.parentNode&&e.parentNode.removeChild(e))}function y(e){const t=document.createElement("div");return e.appendChild(t),t}const g=16,_=750,v=512,w=2,C=p=>{const C=p;let b=class extends C{constructor(...e){super(...e),this._freqInfo={freq:g,time:_},this._overlayRenderTaskHandle=null,this.aria={},this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([a(()=>this.cursor,e=>{const{surface:t}=this;t&&t.setAttribute("data-cursor",e)}),a(()=>this.navigating,e=>{const{surface:t}=this;t&&t.setAttribute("data-navigating",e.toString())}),a(()=>[this.aria,this.surface],()=>this._updateAria(),{initial:!0})])}initialize(){const e=this;this.addHandles([a(()=>this.ui,(e,t)=>this._handleUIChange(e,t),l),e.on("focus",()=>this.notifyChange("focused")),e.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui?.destroy(),this.container=null)}get container(){return this._get("container")??null}set container(e){const i=this._get("container"),r=t(e);if(r||"string"!=typeof e||n.getLogger(this).error("#container",`element with id '${e}' not found`),i===r)return;if(this._stopMeasuring(),i&&(i.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(f(this.root),this._set("root",null)),this.userContent&&(s(this.userContent,i),f(this.userContent),this._set("userContent",null))),!r)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);r.classList.add("esri-view");const l=document.createElement("div");l.className="esri-view-user-storage",s(r,l),r.appendChild(l),this._set("userContent",l);const d=document.createElement("div");d.className="esri-view-root",r.insertBefore(d,r.firstChild),this._set("root",d);const u=document.createElement("div");u.className="esri-view-surface",u.setAttribute("role","application"),u.tabIndex=0,d.appendChild(u),this._set("surface",u);const p=new c;d.appendChild(p.surface),this._set("overlay",p),this.addHandles(a(()=>p.needsRender,e=>{e&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=h({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=o(this._overlayRenderTaskHandle)})),this.forceDOMReadyCycle(),this._set("container",r),this._startMeasuring()}get focused(){const e=document.activeElement===this.surface;return document.hasFocus()&&e}get size(){return[this.width,this.height]}set ui(e){const t=this._get("ui");t!==e&&t?.destroy(),this._set("ui",e)}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(e,t,s){const i=this.position;return e-=i?i[0]:0,t-=i?i[1]:0,s?(s[0]=e,s[1]=t):s=[e,t],s}containerToPage(e,t,s){const i=this.position;return e+=i?i[0]:0,t+=i?i[1]:0,s?(s[0]=e,s[1]=t):s=[e,t],s}_updateAria(){const{surface:e,aria:t}=this;e&&(e.ariaLabelledByElements=t?.labelledByElements??null,e.ariaDescribedByElements=t?.describedByElements??null,e.ariaLabel=t?.label??null,e.ariaDescription=t?.description??null)}_handleUIChange(e,t){this.removeHandles("ui"),t&&t!==e&&t.destroy(),e&&(e.view=this,this.addHandles(a(()=>this.root,t=>{e.container=t?y(t):null},l),"ui")),this._set("ui",e)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const e=this._freqInfo;e.freq=g,e.time=_;const t=h({prepare:e=>{const s=this._measure(),i=this._freqInfo;if(i.time+=e.deltaTime,s&&(i.freq=g,this._get("resizing")||this._set("resizing",!0)),i.time<i.freq)return;i.time=0;const r=this._position();i.freq=r||s?g:Math.min(_,i.freq*w),!s&&i.freq>=v&&(t.pause(),this._get("resizing")&&this._set("resizing",!1))}}),s=new ResizeObserver(s=>{e.freq=g,e.time=_,t.resume()});null!=this.container&&s.observe(this.container);const n=r(()=>s.disconnect());this.addHandles([i(window,"resize",()=>{e.freq=g,e.time=_,t.resume()}),n,t],"measuring"),this._measure(),this._position()}_measure(){const e=this.container,t=e?e.clientWidth:0,s=e?e.clientHeight:0;if(0===t||0===s)return this.suspended||this._set("suspended",!0),!1;const i=this.width,r=this.height;if(t===i&&s===r)return this.suspended&&this._set("suspended",!1),!1;this._set("width",t),this._set("height",s),this.suspended&&this._set("suspended",!1);return this.emit("resize",{oldWidth:i,oldHeight:r,width:t,height:s}),!0}_position(){const e=this.container,t=this.position,s=e&&m(e);return!!s&&((!t||s[0]!==t[0]||s[1]!==t[1])&&(this._set("position",[s[0],s[1]]),!0))}forceDOMReadyCycle(){}};return e([d()],b.prototype,"aria",void 0),e([d()],b.prototype,"container",null),e([d({readOnly:!0})],b.prototype,"focused",null),e([d({readOnly:!0})],b.prototype,"height",void 0),e([d()],b.prototype,"messagesCommon",void 0),e([d({type:c})],b.prototype,"overlay",void 0),e([d({readOnly:!0})],b.prototype,"position",void 0),e([d({readOnly:!0})],b.prototype,"resizing",void 0),e([d({readOnly:!0})],b.prototype,"root",void 0),e([d({value:null,readOnly:!0})],b.prototype,"size",null),e([d({readOnly:!0})],b.prototype,"surface",void 0),e([d({readOnly:!0})],b.prototype,"suspended",void 0),e([d({nonNullable:!0})],b.prototype,"ui",null),e([d({readOnly:!0})],b.prototype,"userContent",void 0),e([d({readOnly:!0})],b.prototype,"width",void 0),e([d()],b.prototype,"widthBreakpoint",void 0),b=e([u("esri.views.DOMContainer")],b),b};export{C as DOMContainer};
5
+ import{__decorate as t}from"tslib";import{byId as e,reparent as i}from"../core/domUtils.js";import{on as s}from"../core/events.js";import{makeHandle as r}from"../core/handleUtils.js";import n from"../core/Logger.js";import{destroyMaybe as o,removeMaybe as a}from"../core/maybe.js";import{watch as h,initial as l}from"../core/reactiveUtils.js";import{addFrameTask as d}from"../core/scheduling.js";import{property as u,subclass as c}from"../core/accessorSupport/decorators.js";import{Attribution as p}from"./Attribution.js";import m from"./overlay/ViewOverlay.js";const f=[0,0];function _(t){const e=(t.ownerDocument||window.document).defaultView,i=t.getBoundingClientRect();return f[0]=i.left+(e?.pageXOffset??0),f[1]=i.top+(e?.pageYOffset??0),f}function y(t){t&&(t.textContent="",t.parentNode&&t.parentNode.removeChild(t))}const g=16,v=750,b=512,w=2,C=f=>{const C=f;let H=class extends C{constructor(...t){super(...t),this._freqInfo={freq:g,time:v},this._overlayRenderTaskHandle=null,this.aria={},this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([h(()=>this.cursor,t=>{const{surface:e}=this;e&&e.setAttribute("data-cursor",t)}),h(()=>this.navigating,t=>{const{surface:e}=this;e&&e.setAttribute("data-navigating",t.toString())}),h(()=>[this.aria,this.surface],()=>this._updateAria(),{initial:!0})])}initialize(){const t=this;this.addHandles([h(()=>this.ui,(t,e)=>this._handleUIChange(t,e),l),t.on("focus",()=>this.notifyChange("focused")),t.on("blur",()=>this.notifyChange("focused")),h(()=>this.attributionItems,t=>{this._attribution&&(this._attribution.attributionItems=t)}),h(()=>this.attributionVisible,t=>{t?!this._attribution&&t&&(this._attribution=new p({attributionItems:this.attributionItems}),this.root&&this.root.appendChild(this._attribution.surface)):this._attribution=o(this._attribution)},l)])}destroy(){this.destroyed||(this.ui?.destroy(),this.container=null)}get container(){return this._get("container")??null}set container(t){const s=this._get("container"),r=e(t);if(r||"string"!=typeof t||n.getLogger(this).error("#container",`element with id '${t}' not found`),s===r)return;if(this._stopMeasuring(),s&&(s.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this._attribution=o(this._attribution),this.root&&(y(this.root),this._set("root",null)),this.userContent&&(i(this.userContent,s),y(this.userContent),this._set("userContent",null))),!r)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);r.classList.add("esri-view");const l=document.createElement("div");l.className="esri-view-user-storage",i(r,l),r.appendChild(l),this._set("userContent",l);const u=document.createElement("div");u.className="esri-view-root",r.insertBefore(u,r.firstChild),this._set("root",u);const c=document.createElement("div");c.className="esri-view-surface",c.setAttribute("role","application"),c.tabIndex=0,u.appendChild(c),this._set("surface",c);const f=new m;u.appendChild(f.surface),this._set("overlay",f),this.addHandles(h(()=>f.needsRender,t=>{t&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=d({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=a(this._overlayRenderTaskHandle)}));const _=new p({attributionItems:this.attributionItems});u.appendChild(_.surface),this._attribution=_,this.forceDOMReadyCycle(),this._set("container",r),this._startMeasuring()}get focused(){const t=document.activeElement===this.surface;return document.hasFocus()&&t}get size(){return[this.width,this.height]}set ui(t){const e=this._get("ui");e!==t&&e?.destroy(),this._set("ui",t)}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(t,e,i){const s=this.position;return t-=s?s[0]:0,e-=s?s[1]:0,i?(i[0]=t,i[1]=e):i=[t,e],i}containerToPage(t,e,i){const s=this.position;return t+=s?s[0]:0,e+=s?s[1]:0,i?(i[0]=t,i[1]=e):i=[t,e],i}_updateAria(){const{surface:t,aria:e}=this;t&&(t.ariaLabelledByElements=e?.labelledByElements??null,t.ariaDescribedByElements=e?.describedByElements??null,t.ariaLabel=e?.label??null,t.ariaDescription=e?.description??null)}_handleUIChange(t,e){this.removeHandles("ui"),e&&e!==t&&e.destroy(),t&&(t.view=this,this.addHandles(h(()=>this.root,e=>{if(e){const i=document.createElement("div");e.insertBefore(i,this._attribution?.surface??null),t.container=i}else t.container=null},l),"ui")),this._set("ui",t)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const t=this._freqInfo;t.freq=g,t.time=v;const e=d({prepare:t=>{const i=this._measure(),s=this._freqInfo;if(s.time+=t.deltaTime,i&&(s.freq=g,this._get("resizing")||this._set("resizing",!0)),s.time<s.freq)return;s.time=0;const r=this._position();s.freq=r||i?g:Math.min(v,s.freq*w),!i&&s.freq>=b&&(e.pause(),this._get("resizing")&&this._set("resizing",!1))}}),i=new ResizeObserver(i=>{t.freq=g,t.time=v,e.resume()});null!=this.container&&i.observe(this.container);const n=r(()=>i.disconnect());this.addHandles([s(window,"resize",()=>{t.freq=g,t.time=v,e.resume()}),n,e],"measuring"),this._measure(),this._position()}_measure(){const t=this.container,e=t?t.clientWidth:0,i=t?t.clientHeight:0;if(0===e||0===i)return this.suspended||this._set("suspended",!0),!1;const s=this.width,r=this.height;if(e===s&&i===r)return this.suspended&&this._set("suspended",!1),!1;this._set("width",e),this._set("height",i),this.suspended&&this._set("suspended",!1);return this.emit("resize",{oldWidth:s,oldHeight:r,width:e,height:i}),!0}_position(){const t=this.container,e=this.position,i=t&&_(t);return!!i&&((!e||i[0]!==e[0]||i[1]!==e[1])&&(this._set("position",[i[0],i[1]]),!0))}forceDOMReadyCycle(){}};return t([u()],H.prototype,"aria",void 0),t([u()],H.prototype,"container",null),t([u({readOnly:!0})],H.prototype,"focused",null),t([u({readOnly:!0})],H.prototype,"height",void 0),t([u()],H.prototype,"messagesCommon",void 0),t([u({type:m})],H.prototype,"overlay",void 0),t([u({readOnly:!0})],H.prototype,"position",void 0),t([u({readOnly:!0})],H.prototype,"resizing",void 0),t([u({readOnly:!0})],H.prototype,"root",void 0),t([u({value:null,readOnly:!0})],H.prototype,"size",null),t([u({readOnly:!0})],H.prototype,"surface",void 0),t([u({readOnly:!0})],H.prototype,"suspended",void 0),t([u({nonNullable:!0})],H.prototype,"ui",null),t([u({readOnly:!0})],H.prototype,"userContent",void 0),t([u({readOnly:!0})],H.prototype,"width",void 0),t([u()],H.prototype,"widthBreakpoint",void 0),H=t([c("esri.views.DOMContainer")],H),H};export{C as DOMContainer};