@arcgis/core 5.2.0-next.74 → 5.2.0-next.75

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 (196) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/0502641d9a214b37ff29.js +1 -0
  3. package/assets/esri/core/workers/chunks/0d3b2d9a19383bb63f0a.js +1 -0
  4. package/assets/esri/core/workers/chunks/0d9fe49812554e7d7ba7.js +1 -0
  5. package/assets/esri/core/workers/chunks/0daaa89de339e8ea4b81.js +1 -0
  6. package/assets/esri/core/workers/chunks/{1ca04ecf010e68863014.js → 0eb35e09765fd74eb698.js} +1 -1
  7. package/assets/esri/core/workers/chunks/12234a63d3fa4bc25e7e.js +1 -0
  8. package/assets/esri/core/workers/chunks/18e0e993c0c39c962e61.js +1 -0
  9. package/assets/esri/core/workers/chunks/{859dd86c921053bf03a1.js → 1c49c9472167a2e0c923.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{cf360767310fb45660a8.js → 1cf8fb704c48ac3d3b15.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{2e44978ee677aa23163d.js → 2435ef7d11f8dbb920b7.js} +1 -1
  12. package/assets/esri/core/workers/chunks/2501d9459f6d14c797e5.js +1 -0
  13. package/assets/esri/core/workers/chunks/2740f755c3a322cbd477.js +1 -0
  14. package/assets/esri/core/workers/chunks/27f574acf52f2c8bc2c9.js +1 -0
  15. package/assets/esri/core/workers/chunks/2b93888e61ca638490cf.js +1 -0
  16. package/assets/esri/core/workers/chunks/2f4ed8a63d57636a4ebe.js +1 -0
  17. package/assets/esri/core/workers/chunks/{31d19bb72a9e79b30070.js → 30818b5ff0ce51b25d6f.js} +1 -1
  18. package/assets/esri/core/workers/chunks/3235e14fedb19dd94807.js +1 -0
  19. package/assets/esri/core/workers/chunks/36ec5b84e551ab08b24a.js +1 -0
  20. package/assets/esri/core/workers/chunks/3c28e2040cb4fb716eaa.js +1 -0
  21. package/assets/esri/core/workers/chunks/3c32471785bc8570e41c.js +1 -0
  22. package/assets/esri/core/workers/chunks/4046bd65d7d0677f4600.js +1 -0
  23. package/assets/esri/core/workers/chunks/4295822fa6ef743c76f1.js +1 -0
  24. package/assets/esri/core/workers/chunks/{35fd2f765d2cb3f59a22.js → 42d5ed44111bea77ec71.js} +115 -115
  25. package/assets/esri/core/workers/chunks/43713bc6f7eea07259d0.js +1 -0
  26. package/assets/esri/core/workers/chunks/{a0a1f0bd3648738354a6.js → 43a65cab888d43954564.js} +1 -1
  27. package/assets/esri/core/workers/chunks/44a786aba84918f2b247.js +1 -0
  28. package/assets/esri/core/workers/chunks/46873badbd6ce8ff4e1e.js +1 -0
  29. package/assets/esri/core/workers/chunks/4d7a3b3aaf876da0891b.js +1 -0
  30. package/assets/esri/core/workers/chunks/{509aecafbc629bee1c15.js → 4fe2cca405180af23364.js} +1 -1
  31. package/assets/esri/core/workers/chunks/50b08415e072a49bc572.js +1 -0
  32. package/assets/esri/core/workers/chunks/519af918050b47f93516.js +1 -0
  33. package/assets/esri/core/workers/chunks/{bd311c85437743cf7d2f.js → 53d165b4f30fd64e5d8a.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{1a3afee3ecd806b4aa81.js → 552d6aecc7d88d16227b.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{bff75cc7413bf0d319db.js → 5627f562dea8bae2f346.js} +1 -1
  36. package/assets/esri/core/workers/chunks/5ba3a30b7cbfa9e3aa62.js +1 -0
  37. package/assets/esri/core/workers/chunks/{0e81c6d4f1c81f9b0a1b.js → 5e1d84e97de0e662aaa9.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{2baa16ec8559e77c226f.js → 64a1ffc221e5b63b43fb.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{9ca59077712e45ef4d56.js → 6743d726e45e7b660505.js} +1 -1
  40. package/assets/esri/core/workers/chunks/69b0dcd7bcd8ec42e2c3.js +1 -0
  41. package/assets/esri/core/workers/chunks/6b783f440c4a5d36e879.js +1 -0
  42. package/assets/esri/core/workers/chunks/6dddd3df31961b9fda12.js +1 -0
  43. package/assets/esri/core/workers/chunks/6fc3553c52af6ace926d.js +1 -0
  44. package/assets/esri/core/workers/chunks/702b2381acf4d1f90094.js +1 -0
  45. package/assets/esri/core/workers/chunks/{9e25f715cda59c686a4c.js → 792303e4090c0c70c4ff.js} +1 -1
  46. package/assets/esri/core/workers/chunks/7a24cc0f3b4eff2bdb8e.js +1 -0
  47. package/assets/esri/core/workers/chunks/7dc5aedc964eacd1be5a.js +1 -0
  48. package/assets/esri/core/workers/chunks/841c81c280114412c95b.js +1 -0
  49. package/assets/esri/core/workers/chunks/8a36b999cbd65dd2f16c.js +1 -0
  50. package/assets/esri/core/workers/chunks/8ae3a6ddc87bf8315583.js +1 -0
  51. package/assets/esri/core/workers/chunks/9cff18e6f751d1b3085e.js +1 -0
  52. package/assets/esri/core/workers/chunks/{b6d26d9738c0787acc38.js → a6a2a4a2bae0d327d7ed.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{c1a4d499a30f3d80567b.js → a7a7d3289d4ca95f545f.js} +1 -1
  54. package/assets/esri/core/workers/chunks/abb6c76d5dba3559a68e.js +1 -0
  55. package/assets/esri/core/workers/chunks/b14961a9f1f40028f141.js +1 -0
  56. package/assets/esri/core/workers/chunks/b6cd165d0e58598f28a5.js +1 -0
  57. package/assets/esri/core/workers/chunks/{f1727b4a32cb6f36a5e6.js → b78f509fd8e95f728178.js} +1 -1
  58. package/assets/esri/core/workers/chunks/b9d1bb106737a05290e1.js +1 -0
  59. package/assets/esri/core/workers/chunks/{faa55265020591fd2224.js → bc0395777c5c1adb1ddb.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{94368a097e6190ce3c7a.js → c37b28f200b704ae6002.js} +1 -1
  61. package/assets/esri/core/workers/chunks/cff6390b863361eaeeed.js +1 -0
  62. package/assets/esri/core/workers/chunks/d1c7c877edc6948f3801.js +1 -0
  63. package/assets/esri/core/workers/chunks/d2172583ee6e481a66aa.js +1 -0
  64. package/assets/esri/core/workers/chunks/{193aed69de2dec4f36b6.js → d633e98b0dfa0490e4de.js} +1 -1
  65. package/assets/esri/core/workers/chunks/d8eca13c127b443141b7.js +1 -0
  66. package/assets/esri/core/workers/chunks/ddd8f6154e265dbb6f9f.js +1 -0
  67. package/assets/esri/core/workers/chunks/de601f0d5a2a282d2efd.js +1 -0
  68. package/assets/esri/core/workers/chunks/{fdca9873914b9dbd9244.js → e59101f1d060d0a30a65.js} +1 -1
  69. package/assets/esri/core/workers/chunks/eb1a86159dbc098f06fe.js +1 -0
  70. package/assets/esri/core/workers/chunks/{b3b53cf0a3a30164d337.js → ee9eb381e675d2d01260.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{264fd750691d517ab1f3.js → f43a0edf58941e2ac78e.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{4abd54518e35050feb90.js → f78acff510ca615d42e4.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{01c92e68fb17cf2d0e08.js → f7a5c4d22a24e1ac433c.js} +1 -1
  74. package/chunks/GaussianSplat.glsl.js +8 -8
  75. package/chunks/GaussianSplatShadow.glsl.js +4 -5
  76. package/chunks/OccludedGeometryDepth.glsl.js +5 -0
  77. package/chunks/ShadowCastVisualize.glsl.js +2 -2
  78. package/config.js +1 -1
  79. package/core/importUtils.js +2 -0
  80. package/geometry/operators/importUtils.js +2 -0
  81. package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
  82. package/geometry/support/normalizeUtils.d.ts +17 -15
  83. package/geometry/support/normalizeUtils.js +1 -1
  84. package/kernel.js +1 -1
  85. package/layers/FeatureLayer.d.ts +1 -1
  86. package/layers/graphics/data/QueryEngine.js +1 -1
  87. package/layers/graphics/data/queryUtils.js +1 -1
  88. package/layers/graphics/hydratedFeatures.js +1 -1
  89. package/package.json +1 -1
  90. package/portal/schemas/definitions.js +1 -1
  91. package/rest/geoprocessor/utils.js +1 -1
  92. package/rest/identify.js +1 -1
  93. package/rest/imageService.js +1 -1
  94. package/rest/query/operations/query.js +1 -1
  95. package/rest/query/operations/queryAttributeBins.js +1 -1
  96. package/rest/query/operations/queryPivot.js +1 -1
  97. package/rest/query/operations/queryTopFeatures.js +1 -1
  98. package/support/revision.js +1 -1
  99. package/symbols/cim/CIMEffects.js +1 -1
  100. package/symbols/cim/utils.js +1 -1
  101. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  102. package/views/2d/layers/support/RouteLayerInteraction.js +1 -1
  103. package/views/2d/viewpointUtils.js +1 -1
  104. package/views/3d/environment/EnvironmentManager.js +1 -1
  105. package/views/3d/interactive/Manipulator3D.js +1 -1
  106. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  107. package/views/3d/interactive/manipulatorUtils.js +1 -1
  108. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  109. package/views/3d/support/hitTest.js +1 -1
  110. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatCovariance.glsl.js +8 -3
  111. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js +8 -2
  112. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowAccumulator.js +2 -0
  113. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowCastAccumulate.glsl.js +2 -0
  114. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowCastAccumulateTechnique.js +2 -0
  115. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowCastAccumulateTechniqueConfiguration.js +2 -0
  116. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowCastClear.glsl.js +2 -0
  117. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowCastClearTechnique.js +2 -0
  118. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowCastMaskTechnique.js +2 -0
  119. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowCastRenderer.js +2 -0
  120. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowCastVisualize.glsl.js +2 -0
  121. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowCastVisualizeTechnique.js +2 -0
  122. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowCastVisualizeTechniqueConfiguration.js +2 -0
  123. package/views/3d/webgl-engine/lib/CutFillVisualization.js +1 -1
  124. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  125. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  126. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  127. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  128. package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +28 -21
  129. package/views/3d/webgl-engine/shaders/OccludedGeometryDepth.glsl.js +2 -0
  130. package/views/3d/webgl-engine/shaders/OccludedGeometryDepthTechnique.js +2 -0
  131. package/views/selection/SelectionOperation.js +1 -1
  132. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  133. package/widgets/support/SelectionList/GroupLayerItem.d.ts +8 -1
  134. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  135. package/widgets/support/SelectionList/LayerItem.d.ts +8 -1
  136. package/widgets/support/SelectionList/LayerItem.js +1 -1
  137. package/widgets/support/SelectionList/SelectionListViewModel.d.ts +29 -1
  138. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  139. package/widgets/support/SelectionList.js +1 -1
  140. package/widgets/support/SelectionToolbar.js +1 -1
  141. package/assets/esri/core/workers/chunks/0dbf31a663b5220a3136.js +0 -1
  142. package/assets/esri/core/workers/chunks/0df660dfd941cff3ea1d.js +0 -1
  143. package/assets/esri/core/workers/chunks/1418c03c4ab87f7ab5f4.js +0 -1
  144. package/assets/esri/core/workers/chunks/160b204cbf5bda2a29e9.js +0 -1
  145. package/assets/esri/core/workers/chunks/1cc063aa2ddf44bbd515.js +0 -1
  146. package/assets/esri/core/workers/chunks/2a2ed7bd44010f24c2dd.js +0 -1
  147. package/assets/esri/core/workers/chunks/2bdb9b5365869081c936.js +0 -1
  148. package/assets/esri/core/workers/chunks/3d6b2d5ae647e140abaf.js +0 -1
  149. package/assets/esri/core/workers/chunks/44e8cd4b3dad777ab0c9.js +0 -1
  150. package/assets/esri/core/workers/chunks/45ccca01db0027b9dc16.js +0 -1
  151. package/assets/esri/core/workers/chunks/4cf2b0558a4acc141429.js +0 -1
  152. package/assets/esri/core/workers/chunks/4e129b9f5772a06e580c.js +0 -1
  153. package/assets/esri/core/workers/chunks/5441f96cdd0660229efe.js +0 -1
  154. package/assets/esri/core/workers/chunks/553be2bd69bd311477ea.js +0 -1
  155. package/assets/esri/core/workers/chunks/56bbde1dff96b423fbb9.js +0 -1
  156. package/assets/esri/core/workers/chunks/613e799377bdb767c955.js +0 -1
  157. package/assets/esri/core/workers/chunks/623d5518bca227f643bd.js +0 -1
  158. package/assets/esri/core/workers/chunks/62811bca7ad2100c023c.js +0 -1
  159. package/assets/esri/core/workers/chunks/64176f7ae719289a2f79.js +0 -1
  160. package/assets/esri/core/workers/chunks/73f77f5a6907cb8d9a35.js +0 -1
  161. package/assets/esri/core/workers/chunks/76b573143d1a65fdbcb6.js +0 -1
  162. package/assets/esri/core/workers/chunks/7b5b66ae79e0287e3ade.js +0 -1
  163. package/assets/esri/core/workers/chunks/7e373d9c98ce910db9d2.js +0 -1
  164. package/assets/esri/core/workers/chunks/86a4057572755b403548.js +0 -1
  165. package/assets/esri/core/workers/chunks/877594b6db08da98acd7.js +0 -1
  166. package/assets/esri/core/workers/chunks/98e6c1d035755a074d24.js +0 -1
  167. package/assets/esri/core/workers/chunks/a27cdf4c29dd50a6dab1.js +0 -1
  168. package/assets/esri/core/workers/chunks/a294dd12b5c708ce04af.js +0 -1
  169. package/assets/esri/core/workers/chunks/a9053ad0f4e8c4705665.js +0 -1
  170. package/assets/esri/core/workers/chunks/b33d870cbfa238762c5e.js +0 -1
  171. package/assets/esri/core/workers/chunks/b599b7dadce8b8bc88f6.js +0 -1
  172. package/assets/esri/core/workers/chunks/b984b808d383974ca3d8.js +0 -1
  173. package/assets/esri/core/workers/chunks/c25dc9073e73d6b44d88.js +0 -1
  174. package/assets/esri/core/workers/chunks/c45a5bcf26659daf02a1.js +0 -1
  175. package/assets/esri/core/workers/chunks/c46f79d5b7712adbbd1c.js +0 -1
  176. package/assets/esri/core/workers/chunks/c866b66ba72d96453899.js +0 -1
  177. package/assets/esri/core/workers/chunks/c873383e7dae35dc1a61.js +0 -1
  178. package/assets/esri/core/workers/chunks/d08f81d545930a79fb2e.js +0 -1
  179. package/assets/esri/core/workers/chunks/d607cf154218d20e4114.js +0 -1
  180. package/assets/esri/core/workers/chunks/da6134c7883531f21afe.js +0 -1
  181. package/assets/esri/core/workers/chunks/e4a2eefffe16cd5bb20f.js +0 -1
  182. package/assets/esri/core/workers/chunks/e602b91d8fdc36a92530.js +0 -1
  183. package/assets/esri/core/workers/chunks/ebfb3cdc0df15eb05d75.js +0 -1
  184. package/assets/esri/core/workers/chunks/f721756a6c1593f96409.js +0 -1
  185. package/assets/esri/core/workers/chunks/fb51f823b25c827c6b29.js +0 -1
  186. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +0 -2
  187. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +0 -2
  188. package/views/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +0 -2
  189. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +0 -2
  190. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechniqueConfiguration.js +0 -2
  191. package/views/3d/webgl-engine/shaders/ShadowCastClear.glsl.js +0 -2
  192. package/views/3d/webgl-engine/shaders/ShadowCastClearTechnique.js +0 -2
  193. package/views/3d/webgl-engine/shaders/ShadowCastMaskTechnique.js +0 -2
  194. package/views/3d/webgl-engine/shaders/ShadowCastVisualize.glsl.js +0 -2
  195. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +0 -2
  196. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as i,abortMaybe as r,destroyMaybe as a,releaseMaybe as n,releaseReferencedMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as l,initial as u,sync as m}from"../../../../core/reactiveUtils.js";import{signal as _}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as b,invert as g,multiply as f,copy as P}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as A,create as I}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as E}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as w,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as T}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as S,InternalRenderCategory as O,AllRenderNodeOutputs as D,AllInternalRenderNodeOutputs as R}from"../../webgl.js";import{minNearDistanceInMeters as N}from"../../state/NearFarHeuristic.js";import{debugFlags as G}from"../../support/debugFlags.js";import{computeShadowsEnabled as F}from"../../support/sunUtils.js";import{FBOCache as H}from"../core/FBOCache.js";import{RenderPassManager as x}from"../core/renderPasses/RenderPassManager.js";import{isColor as y}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as v}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as M}from"../effects/RenderNodes.js";import{RenderPluginManager as L}from"../effects/RenderPluginManager.js";import{WeatherFader as U}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as q}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as j}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as B,renderHighlightBuffer as V}from"../effects/highlight/Highlight.js";import{OITBlend as k}from"../effects/transparency/OITBlend.js";import{AnimationTimer as W}from"./AnimationTimer.js";import{AnimationTimeStep as Q}from"./AnimationTimeStep.js";import{BoundingInfo as z}from"./BoundingInfo.js";import{Compositor as Y}from"./Compositor.js";import{DepthRange as J}from"./DepthRange.js";import{depthRangeFromScene as X}from"./depthRangeUtils.js";import{MainFramebuffer as $}from"./MainFramebuffer.js";import{NavigationDepthCache as K}from"./NavigationDepthCache.js";import{blendingColorAlphaClear as Z}from"./OrderIndependentTransparency.js";import{RenderContext as ee,defaultRenderOccludedMask as te}from"./RenderContext.js";import{RendererBase as se}from"./RendererBase.js";import{setupFeatureDefaults as ie}from"./RenderFeature.js";import{RenderPluginInput as re}from"./RenderPluginInput.js";import{ShadowMap as ae}from"./ShadowMap.js";import ne from"./SliceHelper.js";import{MergedRenderer as he}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as oe}from"../parts/renderUtils.js";import{RendererPerformanceInfo as de,PerformanceCategory as le}from"../statistics/RendererPerformanceInfo.js";import{ColorAttachment1 as ue,PixelType as me,ColorAttachment2 as _e,ColorAttachment0 as pe,DrawBufferNone as ce}from"../../../webgl/enums.js";const be=has("disable-feature:async-navigation-3d-depth-readback");let ge=class extends se{constructor(e,t,s,i,r){super({stage:e}),this._techniques=s,this._rctx=i,this._requestRender=r,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new x,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=w(0,0,0,1),this._sliceHelper=new ne,this._shadowAccumulator=null,this._shadowCastOptions=null,this.sceneDepthRange=_(J.Infinite),this._state=_(2),this._hasGlobalIlluminationFlag=!!has("enable-feature:global-illumination"),this._hasAnimations=!1,this._animationTimestep=new Q,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=_(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new re,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(const t of Re)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new H(i),this._compositor=new Y(i,s),this._renderStateFeatures=_(ie(e.view.qualityProfile));const a=new ae(this._fboCache,e.viewingMode);this._renderContext=new ee(this._rctx,a,s),this._framebuffer=new $(this._fboCache,this._bindParameters),this._performanceInfo=new de(this._rctx),this._blit=new j(s),this.navigationDepthCache=new K(this._rctx,this._fboCache,s,()=>this._requestRender(0)),this._nodes=new M(this._renderContext),this._plugins=new L({renderContext:this._renderContext,techniques:s,materials:t,requestRender:r,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new U({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>r(),l),d(()=>G.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},r()},u),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():C;E(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),r()},l),d(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=v,l),d(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},m),d(()=>this._bindParameters.clouds.data?.state,()=>r(),m),d(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,r()},u),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},l)])}destroy(){this._gpuTimerHandle=i(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator=null,this._shadowCastOptions=null,this._loadEdgeViewTask=r(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.navigationDepthCache.destroy(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,z.prune(),he.prune(),T()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new k(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=ie(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,s){this._renderStateFeatures.mutate(i=>i.set(t,e,s)),this._requestRender()}setTime(e){this._renderContext.time=e}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this.isFeatureEnabled(3)&&!this._inGlobeView}get hasGlobalIllumination(){return this._hasGlobalIlluminationFlag&&this.hasAmbientIllumination}get hasGlobalIlluminationHighQuality(){return this.hasGlobalIllumination&&this.isFeatureEnabled(10)}get _keepGlobalIlluminationShadingAlive(){return this._hasGlobalIlluminationFlag&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get _emissions(){const e=this._plugins.emissions;return this._hasTransparentGeometry?e:1===e||3===e?1:0}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}setShadowAccumulator(e){this._shadowAccumulator=e,this._shadowCastOptions&&e.setParameters(this._shadowCastOptions)}_releaseFBOs(){this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._bindParameters.globalIllumination=n(this._bindParameters.globalIllumination),this._bindParameters.reprojection.lastFrameDepth=n(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=n(this._bindParameters.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=s(async e=>{const{EdgeView:t}=await(import("./edgeRendering/EdgeView.js"));o(e);const s=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:xe(this.stage.view.resourceController)});return this.addHandles(d(()=>s.updating,()=>this._requestRender(),m)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&b(this._bindParameters.reprojection.matrix,A)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}modifyShadowsEnabled(){const e=this.stage.view.environmentManager.referencePositionGeographic,t=null==e||F(e[2],this.stage.viewingMode),s=this.stage.view.environment.lighting.directShadowsEnabled&&t;this._bindParameters.shadowMap.enabled!==s&&(this._bindParameters.shadowMap.enabled=s,this._requestRender(1))}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){e.shadowCast&&(this._shadowCastOptions={...this._shadowCastOptions,...e.shadowCast},this._shadowAccumulator?.setParameters(e.shadowCast))}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}addRenderer(e){this._plugins.add(e)}removeRenderer(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this._occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get _occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...Ce),has.water=this._plugins.produces(4,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new W(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?i(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,s=!1){try{return this._isRendering=!0,this._render(e,t,s)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new oe(this._pluginInput.get(S.FINAL),null)}_render(e,t,s){const i=0===t;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:r,contentCamera:a,mode:o,alignPixelEnabled:d}=e;this._state.value=o,this._bindParameters.frameRendererTarget=t,this._bindParameters.output=0,this._bindParameters.emissions=this._emissions,this._bindParameters.alignPixelEnabled=d,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const l=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=l?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(O.VIEWSHED),this._bindParameters.cutFillComputationEnabled=this._nodes.produces(O.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(O.CUTFILL_COLOR),this._ensureBindParameters(r,a),this._plugins.sortTestsTransparentOrderedSlots(Se),this._plugins.prepareRender(),this._hasTransparentGeometry=this._plugins.produces(1,...Pe),this._renderOverlay(),r.setGLViewport(this._rctx);const u=this._framebuffer,m=u.initialize(r.fullWidth,r.fullHeight,this._backgroundColor),_=this._needsLastFrameColor;_?(m?.retain(_-1),m?.setName("last frame color"),this._bindParameters.reprojection.lastFrameColor?.release(),this._bindParameters.reprojection.lastFrameColor=m):m?.release(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!s,this._precompilePrepasses(),this.performanceInfo.advance(le.PREPARE);const p=this._computeShadowDepthRange(r);this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(r,a,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p),u.bind(),this._bindParameters.mainDepth=u.depth.attachment,this._precompileShaders(i),this._bindParameters.output=0,this._renderOpaque(),this._renderPreTransparent(),this._renderTransparent(),this.hasReflections&&(this._bindParameters.depth=h(this._bindParameters.depth),this._bindParameters.reprojection.lastFrameColor=h(this._bindParameters.reprojection.lastFrameColor)),this._bindParameters.shadowMap.disposeOutput(5),u.update(e=>this._renderNodes(O.CUTFILL_COMPUTATION,e)),this._pluginInput.set(O.FOCUSAREA,this._renderFocusAreaGeometry()),u.update(e=>this._renderNodes(O.TRANSPARENT_ENVIRONMENT,e)),u.update(e=>this._renderNodes(O.VIEWSHED,e)),u.update(e=>this._renderNodes(O.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),u.update(e=>this._renderNodes(O.FOCUSAREA_COLOR,e)),u.update(e=>this._renderNodes(O.CUTFILL_COLOR,e)),this._pluginInput.release(O.FOCUSAREA),this._pluginInput.release(O.GROUND_DEPTH),u.update(e=>this._renderNodes(O.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===t?this._renderObjectAndLayerIdColor():null;u.update(e=>this._renderNodes(S.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=n(this._bindParameters.shadowHighlight),u.update(e=>this._renderNodes(O.ANTIALIASING,e));const b=this._hasTransparentGeometry?2:1,g=this._bindParameters.emissions;let f;return this._bindParameters.emissions=0,this._hasHUDHighlights&&u.update(e=>this._renderHUD(b,e)),u.update(e=>this._renderNodes(O.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||u.update(e=>this._renderHUD(b,e)),this._bindParameters.emissions=g,u.update(e=>this._renderNodes(O.MAGNIFIER,e)),u.update(e=>this._renderNodes(S.FINAL,e)),i&&(this._blit.toFramebuffer(u.color,this._bindParameters),be||2!==o&&0!==o||this.navigationDepthCache.update(this._bindParameters,u.depth.attachment,this._renderContext.time)),this._bindParameters.reprojection.lastFrameDepth?.release(),this._bindParameters.reprojection.lastFrameEmission?.release(),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth?.release(),this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth,0!==this._emissions&&(this._bindParameters.reprojection.lastFrameEmission?.release(),this._bindParameters.reprojection.lastFrameEmission=u.color.obtainAttachment(ue))),this._testsNeedsDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._releaseFBOs(),u.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(f=u.color,f.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new oe(f,c)}_precompileShaders(e){++this._plugins.context.techniques.precompiling;const t=this._bindParameters;t.output=0;const s=t.emissions;if(this._precompileOpaqueGeometry(),this._nodes.precompile(t.hasOpaqueEmission,O.OPAQUE_ENVIRONMENT,O.GAUSSIAN_SPLAT,O.OPAQUE_OCCLUSION_QUERY,O.VOXEL),this._precompileOpaqueGeometry(),t.output=3,this._plugins.precompile(...Ae),t.output=0,this._plugins.precompile(...Ae),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(t,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(t,!1,1),this._precompileTransparentGeometry(),t.hasTransparentEmission&&(t.emissions=3)}this._nodes.precompile(t.hasOpaqueEmission,O.FOCUSAREA),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,t),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(t.hasOpaqueEmission,O.TRANSPARENT_ENVIRONMENT,O.VIEWSHED,O.CUTFILL_COMPUTATION,O.CUTFILL_COLOR,O.LASERLINES,O.FOCUSAREA_COLOR,O.OCCLUDED,O.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=s,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(t.hasEmissions,O.HIGHLIGHT_COLOR)),t.highlightMixTexture=null,this._nodes.precompile(t.hasEmissions,S.COMPOSITE,O.MAGNIFIER),this._nodes.precompile(t.hasEmissions,O.TRANSPARENT_NO_DEPTH),this._plugins.precompile(8),t.hasOpaqueEmission&&(t.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.precompile(8),t.transparentWithoutDepthEmissionDimmingPass=!1),e&&this._blit.precompile(),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(O.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(le.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces(O.OBJECT_AND_LAYER_ID_COLOR))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:s}=this._framebuffer.size;let i=this.fboCache.acquire(t,s,O.OBJECT_AND_LAYER_ID_COLOR).acquireDepth(14);return i=this._renderNodes(O.OBJECT_AND_LAYER_ID_COLOR,i),--this._techniques.precompiling,this._bindParameters.output=e,i}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e;if(s||t){const e=s?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const r=Math.max(e,i);this._animationTimestep.frame(r,s)}}readAccumulatedShadow(e){return this._shadowAccumulator?.readAccumulatedShadow(e[0],e[1])??0}readMainDepth(e,t){const{mainDepth:s,camera:i}=this._bindParameters;if(!s)return;const r=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(r.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(C),this._compositor.blitDepthToLinearDepth(this._bindParameters,s),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),r.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,me.UNSIGNED_BYTE,t),r.release()}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:s,height:i}=this._framebuffer.size,r=this.fboCache.acquire(s,i,"edges");r.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C),t.render(this._bindParameters,e),r.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,r.getTexture()),r.release(),this.performanceInfo.advance(1===e?le.OPAQUE_EDGES:le.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(le.OVERLAY)}_renderShadowMap(e,t,s,i){if(!this.shadowsEnabled)return;const r=this._bindParameters.shadowMap;if(r.start(e,s,i,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,r),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);const s=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(O.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=s,r.disposeOutput(6),r.clear(),this._renderShadowCascades(7,r)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=h(this._bindParameters.depth)),this.performanceInfo.advance(O.SHADOWMAP)}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const s=this._bindParameters.output,i=6!==e;t.bindFramebuffer();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e),i&&this._renderShadowNodes(t.renderTarget);t.finish(e),this._bindParameters.output=s}_renderShadowNodes(e){this._renderInternalNodeCategory(O.SHADOWMAP,e)}get _needsLastFrameColor(){return+this.hasReflections+ +this.hasGlobalIllumination}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this.hasGlobalIllumination+ +this._testsNeedsDepth+ +this._needsShadowHighlight}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){this._bindParameters.depth=n(this._bindParameters.depth);const e=this._pluginInput.get("normals");if(e){this._pluginInput.set(O.AMBIENT_ILLUMINATION,this._hasGlobalIlluminationFlag?this._renderGlobalIllumination():this._renderSSAO());const t=this._needsDepth;t?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth=e.obtainDepthTexture(),this._bindParameters.depth?.retain(t-1),this.performanceInfo.advance(le.DEPTH)):e.detachDepth(),this.hasAmbientIllumination&&this._pluginInput.release("normals")}else this._hasGlobalIlluminationFlag&&(this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"geometry depth",14);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._renderGaussianSplatPrepassDepth(i),this._bindParameters.depth=i.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),i.release(),this.performanceInfo.advance(le.DEPTH)}_renderGaussianSplatPrepassDepth(e){const t=this._shadowAccumulator;if(!t?.active||!t.requireGeometryDepth)return;const s=this._bindParameters.output;this._bindParameters.output=3,this._renderInternalNodeCategory(O.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=s}_renderGaussianSplatDepthAndNormals(e){const t=this._bindParameters.output;this._bindParameters.output=4,this._renderInternalNodeCategory(O.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=t}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||!!this._shadowAccumulator?.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return J.Zero;const t=X(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.union(this._nodes.queryDepthRange(O.SHADOWMAP,e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=J.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<q)return void(this.sceneDepthRange.value=J.Infinite);const t=e.clone();t.near=N,t.far=1e10;const s=X(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){return this._nodes.require("normals",...D,O.VIEWSHED,O.LASERLINES)+(this.hasAmbientIllumination?1:0)}_precompilePrepasses(){const e=!!this._normalsRequired;if(e?(this._precompilePlugins(4,Ie),this._needsDepth&&this._precompilePlugins(3,Ee)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(this._bindParameters.hasEmission,O.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator?.active&&(this._nodes.precompile(!1,O.SHADOW_ACCUMULATION),this._precompileAllGeometry(5)),this._shadowAccumulator?.active||e){const t=this._bindParameters.output;this._bindParameters.output=e?4:3,this._nodes.precompile(!1,O.GAUSSIAN_SPLAT_DEPTH),this._bindParameters.output=t}(this.shadowsEnabled||this._shadowAccumulator?.active)&&this._nodes.precompile(!1,O.SHADOWMAP),this.hasAmbientIllumination&&e&&this._nodes.precompile(this._bindParameters.hasEmission,O.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"normals");i.acquireDepth(14),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._bindParameters.output=4,this._plugins.render(...Ie),this._renderGaussianSplatDepthAndNormals(i);const r=this._nodes.optional("normals",...D,O.VIEWSHED);return i.retain(e+r-1),this.performanceInfo.advance(le.NORMALS),i}_renderSSAO(){this._bindParameters.globalIlluminationEnabled=!1;const e=this._pluginInput.get("normals");return this.hasAmbientIllumination&&e?(this._bindParameters.ssao=this._nodes.produce(O.AMBIENT_ILLUMINATION,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(le.AMBIENT_ILLUMINATION),this._bindParameters.ssao):null}_renderGlobalIllumination(){const e=this._bindParameters;if(!this.hasGlobalIllumination)return this._releaseGlobalIlluminationBuffers(),e.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive,null;const t=this._nodes.produce(O.AMBIENT_ILLUMINATION,this._pluginInput);return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIllumination=t,this._bindParameters.globalIlluminationEnabled=!0,this.performanceInfo.advance(this.hasGlobalIlluminationHighQuality?le.AMBIENT_ILLUMINATION_HIGH_QUALITY:le.AMBIENT_ILLUMINATION),e.globalIllumination}_releaseGlobalIlluminationBuffers(){const e=this._bindParameters;e.reprojection.lastFrameColor=h(e.reprojection.lastFrameColor),e.reprojection.lastFrameDepth=n(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=n(e.reprojection.lastFrameEmission),e.globalIllumination=h(e.globalIllumination),e.globalIlluminationEnabled=!1}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...Ae),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...we);this._renderContext.renderOccludedMask=te}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...we),this._renderContext.renderOccludedMask=te}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Oe[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){const e=this._bindParameters.output;this._bindParameters.output=8,this._precompileAllGeometry(8),this._nodes.precompile(!1,O.SHADOWMAP),this._bindParameters.output=e}precompileCutFillDepth(){this._precompilePlugins(9,De)}_precompilePlugins(e,t){const s=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=s}renderViewshedShadowMap(e,t){const{camera:s,contentCamera:i}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._renderShadowNodes(t),this._ensureBindParametersCamera(s,i),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=r}renderCutFillDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...De),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=i}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,O.GROUND_DEPTH,14);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,256),this._framebuffer.bind(),s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...Ee)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...fe),this._nodes.precompile(this._bindParameters.hasEmission,"opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...fe)}_renderTransparentGeometry(){this._plugins.render(...Pe),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...Ae)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=this._bindParameters.hudRenderStyle,i=this._bindParameters.emissions;this._bindParameters.emissions=0,this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...Ce),this._bindParameters.output=2,this._plugins.precompile(...Ce),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...Ce)),this._bindParameters.emissions=i,this._bindParameters.output=t,this._bindParameters.hudRenderStyle=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const i=!!t.getTexture(ue);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),i),s.release(),this.performanceInfo.advance(0===e?le.HUD_OCCLUDED:le.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:s}=this,{width:i,height:r}=this._framebuffer.size,{highlights:a}=s,n=a.length>B?3:1,h=e.acquire(i,r,"highlights",n);h.acquireDepth(14);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),V(t,e,i,r,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(le.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...R)+this._nodes.optional("highlights",...R)-1),h}_renderHighlightGeometries(){this._plugins.render(...Te),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e){const t=this._shadowAccumulator;if(!t)return;t.updateDepthRange(e);const s=t.requireGeometryDepth;this._bindParameters.output=0;const i=this._nodes.produce(O.SHADOW_ACCUMULATION,this._pluginInput);t.didAccumulate&&this.performanceInfo.advance(le.ACCUMULATED_SHADOWS),this._pluginInput.set(O.SHADOW_ACCUMULATION,null),i?.release(),s&&(this._bindParameters.depth=h(this._bindParameters.depth))}renderShadowAccumulationShadowMap(e,t,s,i,r){const a=this.stage.view.qualitySettings.maximumPixelRatio;this._bindParameters.renderingShadowAnalysisMap=!0;try{s.start(e,i,r,!0,a),this._renderShadowCascades(5,s),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t)}finally{this._bindParameters.renderingShadowAnalysisMap=!1}}_precompileTransparentGeometry(){y(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...Pe),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...Pe),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...Pe)}_renderOIT(e,t=2){const s=1===e,{width:i,height:r}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const l=s?"oit hud":"oit",u=this.fboCache.acquire(i,r,l,o).acquireColor(ue,this.hasFloatBlend?7:0,"oit alpha"),m=h.hasEmission&&(0===e||1!==t);m&&u.acquireColor(_e,o,"oit emissive"),s||u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer(Z),m&&this._rctx.clearBuffer(2,Z),a(),u.detachDepth(),h.output=2;const _=this.fboCache.acquire(i,r,s?"oit front hud":"oit front");m&&_.acquireColor(ue,o,"oit front emissive"),s?_.acquireDepth(this._hudDepthFormat):_.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(_.fbo),this._rctx.clearFramebuffer(C,s),a(),_.detachDepth();const p=this._pluginsHas.occludedHudElements&&!s,c=p&&0!==h.emissions?_e:ue;let b;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(b=this.fboCache.acquire(i,r,"oit composite hud"),this._rctx.bindFramebuffer(b.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(0!==h.emissions&&this._framebuffer.ensureEmissionAttachment(),p&&(this._framebuffer.color.acquireColor(c,0,"hud occlusion"),this._rctx.clearBuffer(c-pe,C)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,u,_,h,p,e,this._fboCache.debugCallback),b?.detachDepth(),s||(m&&(this._bindParameters.emissions=3),p&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(c))),_.release(),u.release(),h.output=d,b}get _hudDepthFormat(){return this.isFeatureEnabled(7)?14:13}get _needsOpaquePass(){return this.plugins.produces(0,...fe)||this.plugins.produces(5,...fe)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(O.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));const t=this._framebuffer;t.update(t=>this._renderNodes(S.OPAQUE,t,e)),this.fboCache.debugCallback?.(S.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(O.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(O.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(O.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(O.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(O.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(O.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(O.VOXEL,e)),this.fboCache.debugCallback?.(O.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){const e=this._framebuffer;if(this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(S.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(S.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=n(this._bindParameters.ssao),e.update(e=>this._renderNodes(O.TRANSPARENT_NO_DEPTH,e)),this.fboCache.debugCallback?.(O.TRANSPARENT_NO_DEPTH,e.color.fbo),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){const e=this._rctx.setDrawBuffers([ce,ue]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(le.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),this._fboCache.debugCallback?.(e,i.fbo),i}_renderInternalNodeCategory(e,t){if(!t)return;const s=t.name;try{this._renderNodes(e,t)}finally{this._pluginInput.set(e,null),t.setName(s)}}_ensureBindParameters(e,t){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(),this._ensureBindParametersScreenSpaceReflections(),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,this.renderContext.time,this.stage.view.qualitySettings.fadeDuration,this.stage.view.state.stationary),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(){const{time:e}=this.renderContext,{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){null==this._ssrEnableTime&&(this._ssrEnableTime=e);const s=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=s>0?Math.min(s,e-this._ssrEnableTime)/s:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination))return void(this._reprojectionMatrix=A);const{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:s}=e,i=!s.equals(t);if(i?(g(Ge,t.viewMatrix),g(Ne,t.projectionMatrix),f(Fe,Ge,Ne),f(Fe,s.viewMatrix,Fe),f(Fe,s.projectionMatrix,Fe),this._reprojectionMatrix=Fe):this._reprojectionMatrix=A,this.hasGlobalIllumination){const{viewMatrix:t}=e;i?(f(He,s.viewMatrix,Ge),P(t,He)):P(t,A)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,i){this._bindParameters.updateLighting(e,t,s,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([p()],ge.prototype,"_inGlobeView",void 0),e([p({readOnly:!0})],ge.prototype,"highResolutionAtmosphere",null),e([p()],ge.prototype,"_edgeView",void 0),e([p()],ge.prototype,"updating",null),ge=e([c("esri.views.3d.webgl-engine.lib.Renderer")],ge);const fe=[0,1,2,3],Pe=[7,6,4,5],Ae=[7,6],Ie=[0,1,2,4,...Ae],Ee=[3,5],we=[2,4,8],Ce=[16,12,14,13],Te=[4,5,2,3,0,1,...Ae],Se=[4,8,5,11],Oe={0:[13],1:[12],2:[13,12],3:[13,12]},De=[0,1,...Ae],Re=["normals","highlights"],Ne=I(),Ge=I(),Fe=I(),He=I();function xe(e){return t=>e.immediate.schedule(t)}export{ge as Renderer};
2
+ import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as i,abortMaybe as r,destroyMaybe as a,releaseMaybe as n,releaseReferencedMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as l,initial as u,sync as _}from"../../../../core/reactiveUtils.js";import{signal as m}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as b,invert as f,multiply as g,copy as P}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as A,create as I}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as E}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as w,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as T}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as S,InternalRenderCategory as O,AllRenderNodeOutputs as D,AllInternalRenderNodeOutputs as R}from"../../webgl.js";import{minNearDistanceInMeters as N}from"../../state/NearFarHeuristic.js";import{debugFlags as G}from"../../support/debugFlags.js";import{FBOCache as F}from"../core/FBOCache.js";import{RenderPassManager as H}from"../core/renderPasses/RenderPassManager.js";import{isColor as x}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as y}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as v}from"../effects/RenderNodes.js";import{RenderPluginManager as L}from"../effects/RenderPluginManager.js";import{WeatherFader as M}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as U}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as q}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as j,renderHighlightBuffer as B}from"../effects/highlight/Highlight.js";import{OITBlend as V}from"../effects/transparency/OITBlend.js";import{AnimationTimer as k}from"./AnimationTimer.js";import{AnimationTimeStep as W}from"./AnimationTimeStep.js";import{BoundingInfo as Q}from"./BoundingInfo.js";import{Compositor as z}from"./Compositor.js";import{DepthRange as Y}from"./DepthRange.js";import{depthRangeFromScene as J}from"./depthRangeUtils.js";import{MainFramebuffer as X}from"./MainFramebuffer.js";import{NavigationDepthCache as $}from"./NavigationDepthCache.js";import{blendingColorAlphaClear as K}from"./OrderIndependentTransparency.js";import{RenderContext as Z,defaultRenderOccludedMask as ee}from"./RenderContext.js";import{RendererBase as te}from"./RendererBase.js";import{setupFeatureDefaults as se}from"./RenderFeature.js";import{RenderPluginInput as ie}from"./RenderPluginInput.js";import{ShadowMap as re}from"./ShadowMap.js";import ae from"./SliceHelper.js";import{MergedRenderer as ne}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as he}from"../parts/renderUtils.js";import{RendererPerformanceInfo as oe,PerformanceCategory as de}from"../statistics/RendererPerformanceInfo.js";import{ColorAttachment1 as le,PixelType as ue,ColorAttachment2 as _e,ColorAttachment0 as me,DrawBufferNone as pe}from"../../../webgl/enums.js";const ce=has("disable-feature:async-navigation-3d-depth-readback");let be=class extends te{constructor(e,t,s,i,r){super({stage:e}),this._techniques=s,this._rctx=i,this._requestRender=r,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new H,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=w(0,0,0,1),this._sliceHelper=new ae,this._shadowAccumulator=null,this._shadowCastOptions=null,this.sceneDepthRange=m(Y.Infinite),this._state=m(2),this._hasGlobalIlluminationFlag=!!has("enable-feature:global-illumination"),this._hasAnimations=!1,this._animationTimestep=new W,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=m(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new ie,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(const t of De)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new F(i),this._compositor=new z(i,s),this._renderStateFeatures=m(se(e.view.qualityProfile));const a=new re(this._fboCache,e.viewingMode);this._renderContext=new Z(this._rctx,a,s),this._framebuffer=new X(this._fboCache,this._bindParameters),this._performanceInfo=new oe(this._rctx),this._blit=new q(s),this.navigationDepthCache=new $(this._rctx,this._fboCache,s,()=>this._requestRender(0)),this._nodes=new v(this._renderContext),this._plugins=new L({renderContext:this._renderContext,techniques:s,materials:t,requestRender:r,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new M({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>r(),l),d(()=>G.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},r()},u),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():C;E(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),r()},l),d(()=>e.view.environmentManager.shadowsAvailable,e=>{this._bindParameters.shadowMap.enabled=e,this._requestRender(1)},l),d(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=y,l),d(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},_),d(()=>this._bindParameters.clouds.data?.state,()=>r(),_),d(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,r()},u),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},l)])}destroy(){this._gpuTimerHandle=i(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator=null,this._shadowCastOptions=null,this._loadEdgeViewTask=r(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.navigationDepthCache.destroy(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,Q.prune(),ne.prune(),T()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new V(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=se(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,s){this._renderStateFeatures.mutate(i=>i.set(t,e,s)),this._requestRender()}setTime(e){this._renderContext.time=e}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this.isFeatureEnabled(3)&&!this._inGlobeView}get hasGlobalIllumination(){return this._hasGlobalIlluminationFlag&&this.hasAmbientIllumination}get hasGlobalIlluminationHighQuality(){return this.hasGlobalIllumination&&this.isFeatureEnabled(10)}get _keepGlobalIlluminationShadingAlive(){return this._hasGlobalIlluminationFlag&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get _emissions(){const e=this._plugins.emissions;return this._hasTransparentGeometry?e:1===e||3===e?1:0}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}setShadowAccumulator(e){this._shadowAccumulator=e,this._shadowCastOptions&&e.setParameters(this._shadowCastOptions)}_releaseFBOs(){this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._bindParameters.globalIllumination=n(this._bindParameters.globalIllumination),this._bindParameters.reprojection.lastFrameDepth=n(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=n(this._bindParameters.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=s(async e=>{const{EdgeView:t}=await(import("./edgeRendering/EdgeView.js"));o(e);const s=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:He(this.stage.view.resourceController)});return this.addHandles(d(()=>s.updating,()=>this._requestRender(),_)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&b(this._bindParameters.reprojection.matrix,A)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){e.shadowCast&&(this._shadowCastOptions={...this._shadowCastOptions,...e.shadowCast},this._shadowAccumulator?.setParameters(e.shadowCast))}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}addRenderer(e){this._plugins.add(e)}removeRenderer(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this._occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get _occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...we),has.water=this._plugins.produces(4,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new k(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?i(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,s=!1){try{return this._isRendering=!0,this._render(e,t,s)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new he(this._pluginInput.get(S.FINAL),null)}_render(e,t,s){const i=0===t;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:r,contentCamera:a,mode:o,alignPixelEnabled:d}=e;this._state.value=o,this._bindParameters.frameRendererTarget=t,this._bindParameters.output=0,this._bindParameters.emissions=this._emissions,this._bindParameters.alignPixelEnabled=d,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const l=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=l?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(O.VIEWSHED),this._bindParameters.cutFillComputationEnabled=this._nodes.produces(O.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(O.CUTFILL_COLOR),this._ensureBindParameters(r,a),this._plugins.sortTestsTransparentOrderedSlots(Te),this._plugins.prepareRender(),this._hasTransparentGeometry=this._plugins.produces(1,...ge),this._renderOverlay(),r.setGLViewport(this._rctx);const u=this._framebuffer,_=u.initialize(r.fullWidth,r.fullHeight,this._backgroundColor),m=this._needsLastFrameColor;m?(_?.retain(m-1),_?.setName("last frame color"),this._bindParameters.reprojection.lastFrameColor?.release(),this._bindParameters.reprojection.lastFrameColor=_):_?.release(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!s,this._precompilePrepasses(),this.performanceInfo.advance(de.PREPARE);const p=this._computeShadowDepthRange(r);this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(r,a,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p),u.bind(),this._bindParameters.mainDepth=u.depth.attachment,this._precompileShaders(i),this._bindParameters.output=0,this._renderOpaque(),this._renderPreTransparent(),this._renderTransparent(),this.hasReflections&&(this._bindParameters.depth=h(this._bindParameters.depth),this._bindParameters.reprojection.lastFrameColor=h(this._bindParameters.reprojection.lastFrameColor)),this._bindParameters.shadowMap.disposeOutput(5),u.update(e=>this._renderNodes(O.CUTFILL_COMPUTATION,e)),this._pluginInput.set(O.FOCUSAREA,this._renderFocusAreaGeometry()),u.update(e=>this._renderNodes(O.TRANSPARENT_ENVIRONMENT,e)),u.update(e=>this._renderNodes(O.VIEWSHED,e)),u.update(e=>this._renderNodes(O.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),u.update(e=>this._renderNodes(O.FOCUSAREA_COLOR,e)),u.update(e=>this._renderNodes(O.CUTFILL_COLOR,e)),this._pluginInput.release(O.FOCUSAREA),this._pluginInput.release(O.GROUND_DEPTH),u.update(e=>this._renderNodes(O.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===t?this._renderObjectAndLayerIdColor():null;u.update(e=>this._renderNodes(S.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=n(this._bindParameters.shadowHighlight),u.update(e=>this._renderNodes(O.ANTIALIASING,e));const b=this._hasTransparentGeometry?2:1,f=this._bindParameters.emissions;let g;return this._bindParameters.emissions=0,this._hasHUDHighlights&&u.update(e=>this._renderHUD(b,e)),u.update(e=>this._renderNodes(O.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||u.update(e=>this._renderHUD(b,e)),this._bindParameters.emissions=f,u.update(e=>this._renderNodes(O.MAGNIFIER,e)),u.update(e=>this._renderNodes(S.FINAL,e)),i&&(this._blit.toFramebuffer(u.color,this._bindParameters),ce||2!==o&&0!==o||this.navigationDepthCache.update(this._bindParameters,u.depth.attachment,this._renderContext.time)),this._bindParameters.reprojection.lastFrameDepth?.release(),this._bindParameters.reprojection.lastFrameEmission?.release(),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth?.release(),this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth,0!==this._emissions&&(this._bindParameters.reprojection.lastFrameEmission?.release(),this._bindParameters.reprojection.lastFrameEmission=u.color.obtainAttachment(le))),this._testsNeedsDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._releaseFBOs(),u.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(g=u.color,g.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new he(g,c)}_precompileShaders(e){++this._plugins.context.techniques.precompiling;const t=this._bindParameters;t.output=0;const s=t.emissions;if(this._precompileOpaqueGeometry(),this._nodes.precompile(t.hasOpaqueEmission,O.OPAQUE_ENVIRONMENT,O.GAUSSIAN_SPLAT,O.OPAQUE_OCCLUSION_QUERY,O.VOXEL),this._precompileOpaqueGeometry(),t.output=3,this._plugins.precompile(...Pe),t.output=0,this._plugins.precompile(...Pe),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(t,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(t,!1,1),this._precompileTransparentGeometry(),t.hasTransparentEmission&&(t.emissions=3)}this._nodes.precompile(t.hasOpaqueEmission,O.FOCUSAREA),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,t),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(t.hasOpaqueEmission,O.TRANSPARENT_ENVIRONMENT,O.VIEWSHED,O.CUTFILL_COMPUTATION,O.CUTFILL_COLOR,O.LASERLINES,O.FOCUSAREA_COLOR,O.OCCLUDED,O.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=s,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(t.hasEmissions,O.HIGHLIGHT_COLOR)),t.highlightMixTexture=null,this._nodes.precompile(t.hasEmissions,S.COMPOSITE,O.MAGNIFIER),this._nodes.precompile(t.hasEmissions,O.TRANSPARENT_NO_DEPTH),this._plugins.precompile(8),t.hasOpaqueEmission&&(t.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.precompile(8),t.transparentWithoutDepthEmissionDimmingPass=!1),e&&this._blit.precompile(),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(O.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(de.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces(O.OBJECT_AND_LAYER_ID_COLOR))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:s}=this._framebuffer.size;let i=this.fboCache.acquire(t,s,O.OBJECT_AND_LAYER_ID_COLOR).acquireDepth(14);return i=this._renderNodes(O.OBJECT_AND_LAYER_ID_COLOR,i),--this._techniques.precompiling,this._bindParameters.output=e,i}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e;if(s||t){const e=s?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const r=Math.max(e,i);this._animationTimestep.frame(r,s)}}readAccumulatedShadow(e){return this._shadowAccumulator?.readAccumulatedShadow(e[0],e[1])??0}readMainDepth(e,t){const{mainDepth:s,camera:i}=this._bindParameters;if(!s)return;const r=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(r.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(C),this._compositor.blitDepthToLinearDepth(this._bindParameters,s),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),r.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,ue.UNSIGNED_BYTE,t),r.release()}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:s,height:i}=this._framebuffer.size,r=this.fboCache.acquire(s,i,"edges");r.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C),t.render(this._bindParameters,e),r.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,r.getTexture()),r.release(),this.performanceInfo.advance(1===e?de.OPAQUE_EDGES:de.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(de.OVERLAY)}_renderShadowMap(e,t,s,i){if(!this.shadowsEnabled)return;const r=this._bindParameters.shadowMap;if(r.start(e,s,i,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,r),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);const s=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(O.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=s,r.disposeOutput(6),r.clear(),this._renderShadowCascades(7,r)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=h(this._bindParameters.depth)),this.performanceInfo.advance(O.SHADOWMAP)}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const s=this._bindParameters.output,i=6!==e;t.bindFramebuffer();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e),i&&this._renderShadowNodes(t.renderTarget);t.finish(e),this._bindParameters.output=s}_renderShadowNodes(e){this._renderInternalNodeCategory(O.SHADOWMAP,e)}get _needsLastFrameColor(){return+this.hasReflections+ +this.hasGlobalIllumination}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this.hasGlobalIllumination+ +this._testsNeedsDepth+ +this._needsShadowHighlight}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){this._bindParameters.depth=n(this._bindParameters.depth);const e=this._pluginInput.get("normals");if(e){this._pluginInput.set(O.AMBIENT_ILLUMINATION,this._hasGlobalIlluminationFlag?this._renderGlobalIllumination():this._renderSSAO());const t=this._needsDepth;t?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth=e.obtainDepthTexture(),this._bindParameters.depth?.retain(t-1),this.performanceInfo.advance(de.DEPTH)):e.detachDepth(),this.hasAmbientIllumination&&this._pluginInput.release("normals")}else this._hasGlobalIlluminationFlag&&(this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"geometry depth",14);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._renderGaussianSplatPrepassDepth(i),this._bindParameters.depth=i.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),i.release(),this.performanceInfo.advance(de.DEPTH)}_renderGaussianSplatPrepassDepth(e){const t=this._shadowAccumulator;if(!t?.active||!t.requireGeometryDepth)return;const s=this._bindParameters.output;this._bindParameters.output=3,this._renderInternalNodeCategory(O.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=s}_renderGaussianSplatDepthAndNormals(e){const t=this._bindParameters.output;this._bindParameters.output=4,this._renderInternalNodeCategory(O.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=t}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||!!this._shadowAccumulator?.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return Y.Zero;const t=J(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.union(this._nodes.queryDepthRange(O.SHADOWMAP,e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=Y.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<U)return void(this.sceneDepthRange.value=Y.Infinite);const t=e.clone();t.near=N,t.far=1e10;const s=J(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){return this._nodes.require("normals",...D,O.VIEWSHED,O.LASERLINES)+(this.hasAmbientIllumination?1:0)}_precompilePrepasses(){const e=!!this._normalsRequired;if(e?(this._precompilePlugins(4,Ae),this._needsDepth&&this._precompilePlugins(3,Ie)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(this._bindParameters.hasEmission,O.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator?.active&&(this._nodes.precompile(!1,O.SHADOW_ACCUMULATION),this._precompileAllGeometry(5)),this._shadowAccumulator?.active||e){const t=this._bindParameters.output;this._bindParameters.output=e?4:3,this._nodes.precompile(!1,O.GAUSSIAN_SPLAT_DEPTH),this._bindParameters.output=t}(this.shadowsEnabled||this._shadowAccumulator?.active)&&this._nodes.precompile(!1,O.SHADOWMAP),this.hasAmbientIllumination&&e&&this._nodes.precompile(this._bindParameters.hasEmission,O.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"normals");i.acquireDepth(14),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._bindParameters.output=4,this._plugins.render(...Ae),this._renderGaussianSplatDepthAndNormals(i);const r=this._nodes.optional("normals",...D,O.VIEWSHED);return i.retain(e+r-1),this.performanceInfo.advance(de.NORMALS),i}_renderSSAO(){this._bindParameters.globalIlluminationEnabled=!1;const e=this._pluginInput.get("normals");return this.hasAmbientIllumination&&e?(this._bindParameters.ssao=this._nodes.produce(O.AMBIENT_ILLUMINATION,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(de.AMBIENT_ILLUMINATION),this._bindParameters.ssao):null}_renderGlobalIllumination(){const e=this._bindParameters;if(!this.hasGlobalIllumination)return this._releaseGlobalIlluminationBuffers(),e.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive,null;const t=this._nodes.produce(O.AMBIENT_ILLUMINATION,this._pluginInput);return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIllumination=t,this._bindParameters.globalIlluminationEnabled=!0,this.performanceInfo.advance(this.hasGlobalIlluminationHighQuality?de.AMBIENT_ILLUMINATION_HIGH_QUALITY:de.AMBIENT_ILLUMINATION),e.globalIllumination}_releaseGlobalIlluminationBuffers(){const e=this._bindParameters;e.reprojection.lastFrameColor=h(e.reprojection.lastFrameColor),e.reprojection.lastFrameDepth=n(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=n(e.reprojection.lastFrameEmission),e.globalIllumination=h(e.globalIllumination),e.globalIlluminationEnabled=!1}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...Pe),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...Ee);this._renderContext.renderOccludedMask=ee}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...Ee),this._renderContext.renderOccludedMask=ee}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Se[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){const e=this._bindParameters.output;this._bindParameters.output=8,this._precompileAllGeometry(8),this._nodes.precompile(!1,O.SHADOWMAP),this._bindParameters.output=e}precompileCutFillDepth(){this._precompilePlugins(9,Oe)}_precompilePlugins(e,t){const s=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=s}renderViewshedShadowMap(e,t){const{camera:s,contentCamera:i}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._renderShadowNodes(t),this._ensureBindParametersCamera(s,i),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=r}renderCutFillDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Oe),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=i}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,O.GROUND_DEPTH,14);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,256),this._framebuffer.bind(),s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...Ie)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...fe),this._nodes.precompile(this._bindParameters.hasEmission,"opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...fe)}_renderTransparentGeometry(){this._plugins.render(...ge),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...Pe)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=this._bindParameters.hudRenderStyle,i=this._bindParameters.emissions;this._bindParameters.emissions=0,this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...we),this._bindParameters.output=2,this._plugins.precompile(...we),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...we)),this._bindParameters.emissions=i,this._bindParameters.output=t,this._bindParameters.hudRenderStyle=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const i=!!t.getTexture(le);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),i),s.release(),this.performanceInfo.advance(0===e?de.HUD_OCCLUDED:de.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:s}=this,{width:i,height:r}=this._framebuffer.size,{highlights:a}=s,n=a.length>j?3:1,h=e.acquire(i,r,"highlights",n);h.acquireDepth(14);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),B(t,e,i,r,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(de.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...R)+this._nodes.optional("highlights",...R)-1),h}_renderHighlightGeometries(){this._plugins.render(...Ce),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e){const t=this._shadowAccumulator;if(!t)return;t.updateDepthRange(e);const s=t.requireGeometryDepth;this._bindParameters.output=0;const i=this._nodes.produce(O.SHADOW_ACCUMULATION,this._pluginInput);t.didAccumulate&&this.performanceInfo.advance(de.ACCUMULATED_SHADOWS),this._pluginInput.set(O.SHADOW_ACCUMULATION,null),i?.release(),s&&(this._bindParameters.depth=h(this._bindParameters.depth))}renderShadowAccumulationShadowMap(e,t,s,i,r){const a=this.stage.view.qualitySettings.maximumPixelRatio;this._bindParameters.renderingShadowAnalysisMap=!0;try{s.start(e,i,r,!0,a),this._renderShadowCascades(5,s),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t)}finally{this._bindParameters.renderingShadowAnalysisMap=!1}}_precompileTransparentGeometry(){x(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...ge),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...ge),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...ge)}_renderOIT(e,t=2){const s=1===e,{width:i,height:r}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const l=s?"oit hud":"oit",u=this.fboCache.acquire(i,r,l,o).acquireColor(le,this.hasFloatBlend?7:0,"oit alpha"),_=h.hasEmission&&(0===e||1!==t);_&&u.acquireColor(_e,o,"oit emissive"),s||u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer(K),_&&this._rctx.clearBuffer(2,K),a(),u.detachDepth(),h.output=2;const m=this.fboCache.acquire(i,r,s?"oit front hud":"oit front");_&&m.acquireColor(le,o,"oit front emissive"),s?m.acquireDepth(this._hudDepthFormat):m.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(m.fbo),this._rctx.clearFramebuffer(C,s),a(),m.detachDepth();const p=this._pluginsHas.occludedHudElements&&!s,c=p&&0!==h.emissions?_e:le;let b;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(b=this.fboCache.acquire(i,r,"oit composite hud"),this._rctx.bindFramebuffer(b.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(0!==h.emissions&&this._framebuffer.ensureEmissionAttachment(),p&&(this._framebuffer.color.acquireColor(c,0,"hud occlusion"),this._rctx.clearBuffer(c-me,C)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,u,m,h,p,e,this._fboCache.debugCallback),b?.detachDepth(),s||(_&&(this._bindParameters.emissions=3),p&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(c))),m.release(),u.release(),h.output=d,b}get _hudDepthFormat(){return this.isFeatureEnabled(7)?14:13}get _needsOpaquePass(){return this.plugins.produces(0,...fe)||this.plugins.produces(5,...fe)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(O.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));const t=this._framebuffer;t.update(t=>this._renderNodes(S.OPAQUE,t,e)),this.fboCache.debugCallback?.(S.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(O.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(O.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(O.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(O.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(O.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(O.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(O.VOXEL,e)),this.fboCache.debugCallback?.(O.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){const e=this._framebuffer;if(this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(S.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(S.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=n(this._bindParameters.ssao),e.update(e=>this._renderNodes(O.TRANSPARENT_NO_DEPTH,e)),this.fboCache.debugCallback?.(O.TRANSPARENT_NO_DEPTH,e.color.fbo),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){const e=this._rctx.setDrawBuffers([pe,le]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(de.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),this._fboCache.debugCallback?.(e,i.fbo),i}_renderInternalNodeCategory(e,t){if(!t)return;const s=t.name;try{this._renderNodes(e,t)}finally{this._pluginInput.set(e,null),t.setName(s)}}_ensureBindParameters(e,t){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(),this._ensureBindParametersScreenSpaceReflections(),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,this.renderContext.time,this.stage.view.qualitySettings.fadeDuration,this.stage.view.state.stationary),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(){const{time:e}=this.renderContext,{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){null==this._ssrEnableTime&&(this._ssrEnableTime=e);const s=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=s>0?Math.min(s,e-this._ssrEnableTime)/s:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination))return void(this._reprojectionMatrix=A);const{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:s}=e,i=!s.equals(t);if(i?(f(Ne,t.viewMatrix),f(Re,t.projectionMatrix),g(Ge,Ne,Re),g(Ge,s.viewMatrix,Ge),g(Ge,s.projectionMatrix,Ge),this._reprojectionMatrix=Ge):this._reprojectionMatrix=A,this.hasGlobalIllumination){const{viewMatrix:t}=e;i?(g(Fe,s.viewMatrix,Ne),P(t,Fe)):P(t,A)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,i){this._bindParameters.updateLighting(e,t,s,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([p()],be.prototype,"_inGlobeView",void 0),e([p({readOnly:!0})],be.prototype,"highResolutionAtmosphere",null),e([p()],be.prototype,"_edgeView",void 0),e([p()],be.prototype,"updating",null),be=e([c("esri.views.3d.webgl-engine.lib.Renderer")],be);const fe=[0,1,2,3],ge=[7,6,4,5],Pe=[7,6],Ae=[0,1,2,4,...Pe],Ie=[3,5],Ee=[2,4,8],we=[16,12,14,13],Ce=[4,5,2,3,0,1,...Pe],Te=[4,8,5,11],Se={0:[13],1:[12],2:[13,12],3:[13,12]},Oe=[0,1,...Pe],De=["normals","highlights"],Re=I(),Ne=I(),Ge=I(),Fe=I();function He(e){return t=>e.immediate.schedule(t)}export{be as Renderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{toConst as r}from"../../../../core/compilerUtils.js";import{unpackFloatRGBA as i}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import s from"../../../../core/Logger.js";import{removeMaybe as n,destroyMaybe as o}from"../../../../core/maybe.js";import{when as a,initial as h,watch as l,syncAndInitial as d}from"../../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../../core/scheduling.js";import{signal as p}from"../../../../core/signal.js";import{Milliseconds as m}from"../../../../core/time.js";import{property as u,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{isMoon as g,isMars as w}from"../../../../geometry/ellipsoidUtils.js";import{debugFlags as _}from"../../support/debugFlags.js";import{ComponentObjectCollection as v}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as x}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as j}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{ChapmanAtmosphere as y}from"../effects/atmosphere/ChapmanAtmosphere.js";import{LocalAtmosphere as b}from"../effects/atmosphere/LocalAtmosphere.js";import{MarsAtmosphere as R}from"../effects/atmosphere/MarsAtmosphere.js";import{CloudsComposition as A}from"../effects/clouds/CloudsComposition.js";import{Fog as C}from"../effects/fog/Fog.js";import{ObjectAndLayerID as S}from"../effects/geometry/ObjectAndLayerID.js";import{olidEnabled as T}from"../effects/geometry/olidUtils.js";import{RenderOccluded as U}from"../effects/geometry/RenderOccluded.js";import{GlobalIllumination as D}from"../effects/globalIllumination/GlobalIllumination.js";import{Glow as M}from"../effects/glow/Glow.js";import{Haze as O}from"../effects/haze/Haze.js";import{Highlight as q}from"../effects/highlight/Highlight.js";import{ShadowHighlight as F}from"../effects/highlight/ShadowHighlight.js";import{ShadowHighlightBuffer as L}from"../effects/highlight/ShadowHighlightBuffer.js";import{Magnifier as k}from"../effects/magnifier/Magnifier.js";import{SMAA as W}from"../effects/smaa/SMAA.js";import{SSAO as B}from"../effects/ssao/SSAO.js";import{Stars as E}from"../effects/stars/Stars.js";import{EmissionComposite as I}from"../lib/EmissionComposite.js";import{GLMaterialRepository as H}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as G}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as P}from"../lib/Renderer.js";import{RenderingContext as N}from"../lib/RenderingContext.js";import{RenderingContextOptions as z}from"../lib/RenderingContextOptions.js";import{ShadowAccumulator as V}from"../lib/ShadowAccumulator.js";import{ShadowCastRenderer as X}from"../lib/ShadowCastRenderer.js";import{TextureRepository as Q}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as J}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as K}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as Y}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as Z}from"./contextCache.js";import{removeLoadedShaderModules as $}from"./renderUtils.js";import{ScreenshotManager as ee,ScreenshotContext as te}from"./ScreenshotManager.js";import{contextCache as re}from"./testUtils.js";import{noBudget as ie}from"../../../support/Scheduler.js";import{checkWebGLError as se}from"../../../webgl/checkWebGLError.js";const ne=has("disable-feature:async-navigation-3d-depth-readback");let oe=class extends t{constructor(e,t){super(e),this.olidRenderHelper=T()?new G:null,this.waterTextures=new Y,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this.glow=null,this._fog=p(null),this.globalIllumination=null,this.shadowAccumulator=null,this.test=null,this._initializeContext(t);const{memoryController:r}=t.view.resourceController;this.stippleTextures=K(this._rctx,r),this.markerTextures=J(this._rctx,r),this.techniques=new j(new x(this._rctx,this.stippleTextures,this.waterTextures,this.markerTextures)),this.textures=new Q(t),this.addHandles(this.textures.events.on("changed",e=>this.requestRender(e)));const i=new H(this.textures,this.techniques,()=>this.requestRender(),()=>this.requestRender());this.renderer=new P(t,i,this.techniques,this._rctx,e=>this.requestRender(e)),this.addHandles([a(()=>t.view.ready,()=>this._createRenderNodes(),h),l(()=>this.waterTextures.updating,()=>this.requestRender(),h),l(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),d)]);const s={renderScene:(e,t,r,i)=>(this.renderer.setTime(t),this.renderer.render(e,r,i)),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,r,i)=>t.options.screenshot.renderOverlay(e,r,i)};this._screenshotManager=new ee(this._rctx,s,e=>t.view.overlayManager.updateOverlays(ie,e.camera,0)),this._registerFrameTask(t)}destroy(){const e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=n(this._frameTask),this.techniques.destroy(),this._componentObjectCollection=o(this._componentObjectCollection),this._screenshotManager.destroy(),this.renderer.destroy(),this.textures.destroy(),this.waterTextures.destroy(),this.markerTextures.destroy(),this.stippleTextures.destroy(),this._canvas=null,this._rctx=o(this._rctx),this.test?.destroy()}_createRenderNodes(){const{view:e,viewingMode:t}=this.stage;this.shadowAccumulator=new V({view:e}),this.shadowAccumulator.accumulationRenderer=new X({view:e,data:this.shadowAccumulator}),this.renderer.setShadowAccumulator(this.shadowAccumulator),new E({view:e}),g(e.spatialReference)||(this.glow=new M({view:e}),2===t?new b({view:e}):w(e.spatialReference)?new R({view:e}):(new y({view:e}),new A({view:e}),new O({view:e}),this._fog.value=new C({view:e}))),has("enable-feature:global-illumination")?this.globalIllumination=new D({view:e}):new B({view:e}),new W({view:e,isEnabled:()=>this.renderer.hasSMAA}),new k({view:e}),new q({view:e}),new L({view:e}),new F({view:e,viewingMode:t}),new I({view:e}),new U({view:e}),T()&&new S({view:e})}requestRender(e=1){switch(e){case 2:this.view.state.fading=!0;case 1:this._needsUpdate=!0,this.globalIllumination?.resetAccumulatedFrames();case 0:this._needsRender=!0}}get updating(){const e=this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this.textures.updating||this.waterTextures.updating;return e&&_.UPDATING&&console.log(" RenderView:",this._needsUpdate,this._needsWaterReflectionUpdate,this.renderer.updating,this.textures.updating,this.waterTextures.updating),e}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(r(e))}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,r,i,s,n=s){let o=ne?this._readMainDepthSynchronously(t,r,i,s,n):this.renderer.navigationDepthCache.getMinimalDepthForArea(t,r,i,s,n)??Number.MAX_VALUE;if(e){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);null!=s&&o>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(o=s)}return o===Number.MAX_VALUE?void 0:o}whenRepresentativeDepthForArea(e,t,r,i,s,n=1){return this.renderer.navigationDepthCache.whenRepresentativeDepthForArea(e,t,r,i,s,n)}_readMainDepthSynchronously(e,t,r,i,s){const n=r.constrainWindowSize(e,t,i*r.pixelRatio,s*r.pixelRatio),o=this._ensureLinearDepthArrayBuffer(n);this.renderer.readMainDepth(n,o);let a=Number.MAX_VALUE;for(let h=0;h<n[2]*n[3];h++){const e=this._linearDepthFromTexture(4*h,o,r.nearFar);a>e&&e!==r.nearFar[0]&&e!==r.nearFar[1]&&(a=e)}return a}_linearDepthFromTexture(e,t,r){return i(t,e)*(r[1]-r[0])+r[0]}_ensureLinearDepthArrayBuffer(e){const t=4*e[2]*e[3];return(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){$(),await this.techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){const t=e.view.state;let r=!1,i=0,s=!1;const n={preRender:({time:s})=>{r=this.updating,i=this._needsUpdate?1:0,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),s=this.test?.time??s;const n=m(s-this._lastAnimationUpdate);this.view.state.animationsEnabled&&(n>this.renderer.animationTimestep||r||this._needsRender)&&(this.renderer.updateAnimation(t,s)&&this.requestRender(0),this._lastAnimationUpdate=s)},render:({time:e})=>{if(e=this.test?.time??e,this.renderer.setTime(e),(this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const e=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this.renderer.render(t,0),s=!0,e&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this.view.state.animationsEnabled&&this.textures.update();const r=new te(t,this.renderer.fboCache);e=this.test?.time??e,this._screenshotManager.update(r,e)},finish:()=>{s&&(this.renderer.finish(2===t.mode?i:1),s=!1)}};this._frameTask=c(n)}_initializeContext(e){const{options:t}=e,r=t.canvas??document.createElement("canvas");r.setAttribute("style","width: 100%; height:100%; display:block;"),this._canvas=r;const i={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},n=r.getContext("webgl2",i);if(null==n)return void s.getLogger(this).error("A WebGL2 context could not be created.");se(n,!0),this._rctx=ae(n,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&s.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested");const{container:o}=e;!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(o.style.backgroundColor="black"),o.contains(r)||o.appendChild(r)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}get _viewingMode(){return this.stage.viewingMode}get stage(){return this.view.stage}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get componentObjectCollection(){return this._componentObjectCollection??=new v(this.renderer.renderPassManager,this._viewingMode,this.view.spatialReference.isWebMercator),this._componentObjectCollection}updateQualitySettings(e){null!=this.test?.time&&null!=e.fadeDuration&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=m(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.view.qualitySettings.maxTexturePixels})}get fog(){return r(this._fog.value)}};function ae(e,t){const r=new z(t);if(re.enabled){let t=he.get(e);return 1===t?.refCount?(t.configure(r),t.ref(),t):(t=new N(e,r),he.set(e,t),t.ref(),t)}return new N(e,r)}e([u({type:Boolean,readOnly:!0})],oe.prototype,"updating",null),e([u({constructOnly:!0})],oe.prototype,"view",void 0),e([u({readOnly:!0})],oe.prototype,"componentObjectCollection",null),e([u()],oe.prototype,"_componentObjectCollection",void 0),e([u()],oe.prototype,"_needsUpdate",void 0),e([u()],oe.prototype,"_needsWaterReflectionUpdate",void 0),oe=e([f("esri.views.3d.webgl-engine.parts.RenderView")],oe);const he=Z();export{oe as RenderView};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{toConst as r}from"../../../../core/compilerUtils.js";import{unpackFloatRGBA as i}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import s from"../../../../core/Logger.js";import{removeMaybe as n,destroyMaybe as o}from"../../../../core/maybe.js";import{when as a,initial as h,watch as l,syncAndInitial as d}from"../../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../../core/scheduling.js";import{signal as p}from"../../../../core/signal.js";import{Milliseconds as m}from"../../../../core/time.js";import{property as u,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{isMoon as g,isMars as w}from"../../../../geometry/ellipsoidUtils.js";import{debugFlags as _}from"../../support/debugFlags.js";import{ComponentObjectCollection as v}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as x}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as j}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{ChapmanAtmosphere as y}from"../effects/atmosphere/ChapmanAtmosphere.js";import{LocalAtmosphere as b}from"../effects/atmosphere/LocalAtmosphere.js";import{MarsAtmosphere as R}from"../effects/atmosphere/MarsAtmosphere.js";import{CloudsComposition as A}from"../effects/clouds/CloudsComposition.js";import{Fog as C}from"../effects/fog/Fog.js";import{ObjectAndLayerID as S}from"../effects/geometry/ObjectAndLayerID.js";import{olidEnabled as T}from"../effects/geometry/olidUtils.js";import{RenderOccluded as U}from"../effects/geometry/RenderOccluded.js";import{GlobalIllumination as D}from"../effects/globalIllumination/GlobalIllumination.js";import{Glow as M}from"../effects/glow/Glow.js";import{Haze as O}from"../effects/haze/Haze.js";import{Highlight as q}from"../effects/highlight/Highlight.js";import{ShadowHighlight as F}from"../effects/highlight/ShadowHighlight.js";import{ShadowHighlightBuffer as L}from"../effects/highlight/ShadowHighlightBuffer.js";import{Magnifier as k}from"../effects/magnifier/Magnifier.js";import{ShadowAccumulator as W}from"../effects/shadowAccumulation/ShadowAccumulator.js";import{ShadowCastRenderer as B}from"../effects/shadowAccumulation/ShadowCastRenderer.js";import{SMAA as E}from"../effects/smaa/SMAA.js";import{SSAO as I}from"../effects/ssao/SSAO.js";import{Stars as H}from"../effects/stars/Stars.js";import{EmissionComposite as G}from"../lib/EmissionComposite.js";import{GLMaterialRepository as P}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as N}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as z}from"../lib/Renderer.js";import{RenderingContext as V}from"../lib/RenderingContext.js";import{RenderingContextOptions as X}from"../lib/RenderingContextOptions.js";import{TextureRepository as Q}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as J}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as K}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as Y}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as Z}from"./contextCache.js";import{removeLoadedShaderModules as $}from"./renderUtils.js";import{ScreenshotManager as ee,ScreenshotContext as te}from"./ScreenshotManager.js";import{contextCache as re}from"./testUtils.js";import{noBudget as ie}from"../../../support/Scheduler.js";import{checkWebGLError as se}from"../../../webgl/checkWebGLError.js";const ne=has("disable-feature:async-navigation-3d-depth-readback");let oe=class extends t{constructor(e,t){super(e),this.olidRenderHelper=T()?new N:null,this.waterTextures=new Y,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this.glow=null,this._fog=p(null),this.globalIllumination=null,this.shadowAccumulator=null,this.test=null,this._initializeContext(t);const{memoryController:r}=t.view.resourceController;this.stippleTextures=K(this._rctx,r),this.markerTextures=J(this._rctx,r),this.techniques=new j(new x(this._rctx,this.stippleTextures,this.waterTextures,this.markerTextures)),this.textures=new Q(t),this.addHandles(this.textures.events.on("changed",e=>this.requestRender(e)));const i=new P(this.textures,this.techniques,()=>this.requestRender(),()=>this.requestRender());this.renderer=new z(t,i,this.techniques,this._rctx,e=>this.requestRender(e)),this.addHandles([a(()=>t.view.ready,()=>this._createRenderNodes(),h),l(()=>this.waterTextures.updating,()=>this.requestRender(),h),l(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),d)]);const s={renderScene:(e,t,r,i)=>(this.renderer.setTime(t),this.renderer.render(e,r,i)),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,r,i)=>t.options.screenshot.renderOverlay(e,r,i)};this._screenshotManager=new ee(this._rctx,s,e=>t.view.overlayManager.updateOverlays(ie,e.camera,0)),this._registerFrameTask(t)}destroy(){const e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=n(this._frameTask),this.techniques.destroy(),this._componentObjectCollection=o(this._componentObjectCollection),this._screenshotManager.destroy(),this.renderer.destroy(),this.textures.destroy(),this.waterTextures.destroy(),this.markerTextures.destroy(),this.stippleTextures.destroy(),this._canvas=null,this._rctx=o(this._rctx),this.test?.destroy()}_createRenderNodes(){const{view:e,viewingMode:t}=this.stage;this.shadowAccumulator=new W({view:e}),this.shadowAccumulator.accumulationRenderer=new B({view:e,data:this.shadowAccumulator}),this.renderer.setShadowAccumulator(this.shadowAccumulator),new H({view:e}),g(e.spatialReference)||(this.glow=new M({view:e}),2===t?new b({view:e}):w(e.spatialReference)?new R({view:e}):(new y({view:e}),new A({view:e}),new O({view:e}),this._fog.value=new C({view:e}))),has("enable-feature:global-illumination")?this.globalIllumination=new D({view:e}):new I({view:e}),new E({view:e,isEnabled:()=>this.renderer.hasSMAA}),new k({view:e}),new q({view:e}),new L({view:e}),new F({view:e,viewingMode:t}),new G({view:e}),new U({view:e}),T()&&new S({view:e})}requestRender(e=1){switch(e){case 2:this.view.state.fading=!0;case 1:this._needsUpdate=!0,this.globalIllumination?.resetAccumulatedFrames();case 0:this._needsRender=!0}}get updating(){const e=this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this.textures.updating||this.waterTextures.updating;return e&&_.UPDATING&&console.log(" RenderView:",this._needsUpdate,this._needsWaterReflectionUpdate,this.renderer.updating,this.textures.updating,this.waterTextures.updating),e}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(r(e))}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,r,i,s,n=s){let o=ne?this._readMainDepthSynchronously(t,r,i,s,n):this.renderer.navigationDepthCache.getMinimalDepthForArea(t,r,i,s,n)??Number.MAX_VALUE;if(e){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);null!=s&&o>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(o=s)}return o===Number.MAX_VALUE?void 0:o}whenRepresentativeDepthForArea(e,t,r,i,s,n=1){return this.renderer.navigationDepthCache.whenRepresentativeDepthForArea(e,t,r,i,s,n)}_readMainDepthSynchronously(e,t,r,i,s){const n=r.constrainWindowSize(e,t,i*r.pixelRatio,s*r.pixelRatio),o=this._ensureLinearDepthArrayBuffer(n);this.renderer.readMainDepth(n,o);let a=Number.MAX_VALUE;for(let h=0;h<n[2]*n[3];h++){const e=this._linearDepthFromTexture(4*h,o,r.nearFar);a>e&&e!==r.nearFar[0]&&e!==r.nearFar[1]&&(a=e)}return a}_linearDepthFromTexture(e,t,r){return i(t,e)*(r[1]-r[0])+r[0]}_ensureLinearDepthArrayBuffer(e){const t=4*e[2]*e[3];return(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){$(),await this.techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){const t=e.view.state;let r=!1,i=0,s=!1;const n={preRender:({time:s})=>{r=this.updating,i=this._needsUpdate?1:0,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),s=this.test?.time??s;const n=m(s-this._lastAnimationUpdate);this.view.state.animationsEnabled&&(n>this.renderer.animationTimestep||r||this._needsRender)&&(this.renderer.updateAnimation(t,s)&&this.requestRender(0),this._lastAnimationUpdate=s)},render:({time:e})=>{if(e=this.test?.time??e,this.renderer.setTime(e),(this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const e=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this.renderer.render(t,0),s=!0,e&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this.view.state.animationsEnabled&&this.textures.update();const r=new te(t,this.renderer.fboCache);e=this.test?.time??e,this._screenshotManager.update(r,e)},finish:()=>{s&&(this.renderer.finish(2===t.mode?i:1),s=!1)}};this._frameTask=c(n)}_initializeContext(e){const{options:t}=e,r=t.canvas??document.createElement("canvas");r.setAttribute("style","width: 100%; height:100%; display:block;"),this._canvas=r;const i={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},n=r.getContext("webgl2",i);if(null==n)return void s.getLogger(this).error("A WebGL2 context could not be created.");se(n,!0),this._rctx=ae(n,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&s.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested");const{container:o}=e;!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(o.style.backgroundColor="black"),o.contains(r)||o.appendChild(r)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}get _viewingMode(){return this.stage.viewingMode}get stage(){return this.view.stage}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get componentObjectCollection(){return this._componentObjectCollection??=new v(this.renderer.renderPassManager,this._viewingMode,this.view.spatialReference.isWebMercator),this._componentObjectCollection}updateQualitySettings(e){null!=this.test?.time&&null!=e.fadeDuration&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=m(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.view.qualitySettings.maxTexturePixels})}get fog(){return r(this._fog.value)}};function ae(e,t){const r=new X(t);if(re.enabled){let t=he.get(e);return 1===t?.refCount?(t.configure(r),t.ref(),t):(t=new V(e,r),he.set(e,t),t.ref(),t)}return new V(e,r)}e([u({type:Boolean,readOnly:!0})],oe.prototype,"updating",null),e([u({constructOnly:!0})],oe.prototype,"view",void 0),e([u({readOnly:!0})],oe.prototype,"componentObjectCollection",null),e([u()],oe.prototype,"_componentObjectCollection",void 0),e([u()],oe.prototype,"_needsUpdate",void 0),e([u()],oe.prototype,"_needsWaterReflectionUpdate",void 0),oe=e([f("esri.views.3d.webgl-engine.parts.RenderView")],oe);const he=Z();export{oe as RenderView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- 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{VertexNormalPassParameters as a,VertexNormalDrawParameters as c}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{ReloadableShader as h}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as u}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as m}from"../effects/geometry/olidUtils.js";import{depthWrite as p,blending as d,depthTest as f}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBase as g,stencilBaseAllZeros as v,stencilWriteMaskOn as b}from"../lib/StencilUtils.js";import{getRenderInstanceDataLayout as S}from"../lib/lodRendering/RenderInstanceData.js";import{advancedMRRFactors as y}from"../materials/pbrUtils.js";import{polygonOffset as j}from"../materials/PolygonOffset.js";import{D as P}from"../../../../chunks/DefaultMaterial.glsl.js";import{makePipelineState as T,cullingParams as x,defaultColorWrite as C}from"../../../webgl/renderState.js";import{alphaCutoff as O}from"../../../../webscene/support/AlphaCutoff.js";class D extends a{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=y,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.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,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.modelTransformation=null,this.drivenOpacity=!1,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=O,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class V extends c{constructor(){super(...arguments),this.origin=r(),this.slicePlaneLocalOrigin=this.origin}}let w=class extends u{constructor(e,t){let i=l(z(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat(l(S(t)))),super(e,t,i),this.shader=new h(P,()=>import("./DefaultMaterial.glsl.js")),this.ignoreUnused=!0}_makePipeline(e,t){const{output:i,transparent:s,cullFace:r,customDepthTest:o,hasOccludees:l}=e;return T({blending:s?d(i,!1,e.emissionDimmingPass):null,culling:M(e)?x(r):null,depthTest:f(i,A(o)),depthWrite:p(e),colorWrite:C,stencilWrite:l?b:null,stencilTest:l?t?g:v:null,polygonOffset:j(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t,i){return i?this._occludeePipelineState:super.getPipeline(e,t,i)}};function A(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function M(e){return 0!==e.cullFace||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}function z(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",{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&m()&&t.vec4u8("olidColor"),t}w=e([t("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],w);export{V as DefaultMaterialDrawParameters,D as DefaultMaterialPassParameters,w as DefaultMaterialTechnique,z as getLayout,M as isCullingRequired};
2
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as s,freeze as i,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{VertexNormalPassParameters as a,VertexNormalDrawParameters as c}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{ReloadableShader as h}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as u}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as m}from"../effects/geometry/olidUtils.js";import{depthWrite as p,blending as d,depthTest as f}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBase as g,stencilBaseAllZeros as v,stencilWriteMaskOn as b}from"../lib/StencilUtils.js";import{getRenderInstanceDataLayout as S}from"../lib/lodRendering/RenderInstanceData.js";import{advancedMRRFactors as y}from"../materials/pbrUtils.js";import{polygonOffset as j}from"../materials/PolygonOffset.js";import{D as P}from"../../../../chunks/DefaultMaterial.glsl.js";import{makePipelineState as T,cullingParams as x,defaultColorWrite as C}from"../../../webgl/renderState.js";import{alphaCutoff as O}from"../../../../webscene/support/AlphaCutoff.js";class D extends a{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=y,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.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=s,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=i(.2,.2,.2),this.diffuse=i(.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.modelTransformation=null,this.drivenOpacity=!1,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=O,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class V extends c{constructor(){super(...arguments),this.origin=r(),this.slicePlaneLocalOrigin=this.origin}}let w=class extends u{constructor(e,t){let s=l(z(t));t.instanced&&t.instancedDoublePrecision&&(s=s.concat(l(S(t)))),super(e,t,s),this.shader=new h(P,()=>import("./DefaultMaterial.glsl.js")),this.ignoreUnused=!0}_makePipeline(e,t){const{output:s,transparent:i,cullFace:r,customDepthTest:o,hasOccludees:l}=e;return T({blending:i?d(s,!1,e.emissionDimmingPass):null,culling:M(e)?x(r):null,depthTest:f(s,A(o)),depthWrite:p(e),colorWrite:C,stencilWrite:l?b:null,stencilTest:l?t?g:v:null,polygonOffset:j(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t,s){return s?this._occludeePipelineState:super.getPipeline(e,t,s)}};function A(e){switch(e){case 1:return 515;case 0:case 4:return 513;case 2:return 516;case 3:return 514}}function M(e){return 0!==e.cullFace||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}function z(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",{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&m()&&t.vec4u8("olidColor"),t}w=e([t("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],w);export{V as DefaultMaterialDrawParameters,D as DefaultMaterialPassParameters,w as DefaultMaterialTechnique,z as getLayout,M as isCullingRequired};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as o}from"../materials/TriangleTechniqueConfiguration.js";class s extends o{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1,this.renderOccluded=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}}e([t({count:4})],s.prototype,"alphaDiscardMode",void 0),e([t({count:3})],s.prototype,"doubleSidedMode",void 0),e([t({count:8})],s.prototype,"pbrMode",void 0),e([t({count:3})],s.prototype,"cullFace",void 0),e([t({count:3})],s.prototype,"normalType",void 0),e([t({count:3})],s.prototype,"customDepthTest",void 0),e([t({count:8})],s.prototype,"emissionSource",void 0),e([t()],s.prototype,"hasVertexColors",void 0),e([t()],s.prototype,"hasSymbolColors",void 0),e([t()],s.prototype,"hasVerticalOffset",void 0),e([t()],s.prototype,"hasColorTexture",void 0),e([t()],s.prototype,"hasMetallicRoughnessTexture",void 0),e([t()],s.prototype,"hasOcclusionTexture",void 0),e([t()],s.prototype,"hasNormalTexture",void 0),e([t()],s.prototype,"hasScreenSizePerspective",void 0),e([t()],s.prototype,"hasVertexTangents",void 0),e([t()],s.prototype,"hasOccludees",void 0),e([t()],s.prototype,"instanced",void 0),e([t()],s.prototype,"instancedDoublePrecision",void 0),e([t()],s.prototype,"hasModelTransformation",void 0),e([t()],s.prototype,"offsetBackfaces",void 0),e([t()],s.prototype,"hasVVSize",void 0),e([t()],s.prototype,"hasVVColor",void 0),e([t()],s.prototype,"receiveShadows",void 0),e([t()],s.prototype,"hasShadowHighlights",void 0),e([t()],s.prototype,"receiveAmbientOcclusion",void 0),e([t()],s.prototype,"receiveGlobalIllumination",void 0),e([t()],s.prototype,"textureAlphaPremultiplied",void 0),e([t()],s.prototype,"instancedFeatureAttribute",void 0),e([t()],s.prototype,"instancedColor",void 0),e([t()],s.prototype,"writeDepth",void 0),e([t()],s.prototype,"snowCover",void 0),e([t()],s.prototype,"hasColorTextureTransform",void 0),e([t()],s.prototype,"hasEmissionTextureTransform",void 0),e([t()],s.prototype,"hasNormalTextureTransform",void 0),e([t()],s.prototype,"hasOcclusionTextureTransform",void 0),e([t()],s.prototype,"hasMetallicRoughnessTextureTransform",void 0);export{s as DefaultMaterialTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as o}from"../materials/TriangleTechniqueConfiguration.js";class s extends o{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1,this.renderOccluded=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}}e([t({count:4})],s.prototype,"alphaDiscardMode",void 0),e([t({count:3})],s.prototype,"doubleSidedMode",void 0),e([t({count:8})],s.prototype,"pbrMode",void 0),e([t({count:3})],s.prototype,"cullFace",void 0),e([t({count:3})],s.prototype,"normalType",void 0),e([t({count:4})],s.prototype,"customDepthTest",void 0),e([t({count:8})],s.prototype,"emissionSource",void 0),e([t()],s.prototype,"hasVertexColors",void 0),e([t()],s.prototype,"hasSymbolColors",void 0),e([t()],s.prototype,"hasVerticalOffset",void 0),e([t()],s.prototype,"hasColorTexture",void 0),e([t()],s.prototype,"hasMetallicRoughnessTexture",void 0),e([t()],s.prototype,"hasOcclusionTexture",void 0),e([t()],s.prototype,"hasNormalTexture",void 0),e([t()],s.prototype,"hasScreenSizePerspective",void 0),e([t()],s.prototype,"hasVertexTangents",void 0),e([t()],s.prototype,"hasOccludees",void 0),e([t()],s.prototype,"instanced",void 0),e([t()],s.prototype,"instancedDoublePrecision",void 0),e([t()],s.prototype,"hasModelTransformation",void 0),e([t()],s.prototype,"offsetBackfaces",void 0),e([t()],s.prototype,"hasVVSize",void 0),e([t()],s.prototype,"hasVVColor",void 0),e([t()],s.prototype,"receiveShadows",void 0),e([t()],s.prototype,"hasShadowHighlights",void 0),e([t()],s.prototype,"receiveAmbientOcclusion",void 0),e([t()],s.prototype,"receiveGlobalIllumination",void 0),e([t()],s.prototype,"textureAlphaPremultiplied",void 0),e([t()],s.prototype,"instancedFeatureAttribute",void 0),e([t()],s.prototype,"instancedColor",void 0),e([t()],s.prototype,"writeDepth",void 0),e([t()],s.prototype,"snowCover",void 0),e([t()],s.prototype,"hasColorTextureTransform",void 0),e([t()],s.prototype,"hasEmissionTextureTransform",void 0),e([t()],s.prototype,"hasNormalTextureTransform",void 0),e([t()],s.prototype,"hasOcclusionTextureTransform",void 0),e([t()],s.prototype,"hasMetallicRoughnessTextureTransform",void 0);export{s as DefaultMaterialTechniqueConfiguration};
@@ -1,14 +1,14 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{set as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{RejectBySlicePass as i}from"../core/shaderLibrary/Slice.glsl.js";import{positionOutsideClipSpace as n}from"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{GaussianSplatCovariance as t}from"../core/shaderLibrary/util/GaussianSplatCovariance.glsl.js";import{GaussianSplatEvaluation as o}from"../core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js";import{GaussianSplatTextureFetch as r}from"../core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js";import{GaussianSplatUnpacking as s}from"../core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import{QuaternionToRotationMatrix as c}from"../core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import{Float2BindUniform as l}from"../core/shaderModules/Float2BindUniform.js";import{Float2PassUniform as u}from"../core/shaderModules/Float2PassUniform.js";import{Float3PassUniform as d}from"../core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as m}from"../core/shaderModules/FloatPassUniform.js";import{glsl as f,If as p}from"../core/shaderModules/glsl.js";import{Matrix4BindUniform as v}from"../core/shaderModules/Matrix4BindUniform.js";import{Texture2DUintPassUniform as g}from"../core/shaderModules/Texture2DUintPassUniform.js";function x(a,n){const{clippingEnabled:u,needsFragmentPosition:p}=n,{fragment:x,varyings:P,vertex:h}=a;P.add("conic","vec3"),P.add("gaussianLogAlphaCutoff","float"),P.add("offsetFromCenter","vec2"),p&&P.add("fragmentPositionCameraRelative","vec3"),h.uniforms.add(new g("splatOrderTexture",e=>e.splatOrder),new g("splatAtlasTexture",e=>e.splatAtlas),new g("splatHeaderTexture",e=>e.splatHeader),new m("minSplatRadius",e=>e.minSplatRadius),new l("inverseScreenSize",({camera:a})=>e(F,1/a.fullWidth,1/a.fullHeight)),new v("proj",e=>e.camera.projectionMatrix),new v("view",e=>e.camera.viewMatrix),new l("nearFar",e=>e.camera.nearFar)),u&&(h.uniforms.add(new d("clipMin",e=>e.clipMinCameraRelative),new d("clipMax",e=>e.clipMaxCameraRelative)),p&&x.uniforms.add(new d("clipMin",e=>e.clipMinCameraRelative),new d("clipMax",e=>e.clipMaxCameraRelative))),h.include(s),h.include(r),h.include(c),h.include(t),h.include(o),h.include(i,n),x.include(o),p&&x.include(i,n),x.main.add(f`
2
+ import{set as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{RejectBySlicePass as i}from"../core/shaderLibrary/Slice.glsl.js";import{positionOutsideClipSpace as n}from"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{GaussianSplatCovariance as t}from"../core/shaderLibrary/util/GaussianSplatCovariance.glsl.js";import{GaussianSplatEvaluation as o}from"../core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js";import{GaussianSplatTextureFetch as r}from"../core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js";import{GaussianSplatUnpacking as s}from"../core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import{QuaternionToRotationMatrix as c}from"../core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import{Float2BindUniform as l}from"../core/shaderModules/Float2BindUniform.js";import{Float2PassUniform as u}from"../core/shaderModules/Float2PassUniform.js";import{Float3PassUniform as d}from"../core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as m}from"../core/shaderModules/FloatPassUniform.js";import{glsl as p,If as f}from"../core/shaderModules/glsl.js";import{Matrix4BindUniform as v}from"../core/shaderModules/Matrix4BindUniform.js";import{Texture2DUintPassUniform as g}from"../core/shaderModules/Texture2DUintPassUniform.js";function x(a,n){const{clippingEnabled:u,needsFragmentPosition:f}=n,{fragment:x,varyings:P,vertex:h}=a;P.add("conic","vec3"),P.add("gaussianLogAlphaCutoff","float"),P.add("offsetFromCenter","vec2"),f&&P.add("fragmentPositionCameraRelative","vec3"),h.uniforms.add(new g("splatOrderTexture",e=>e.splatOrder),new g("splatAtlasTexture",e=>e.splatAtlas),new g("splatHeaderTexture",e=>e.splatHeader),new m("minSplatRadius",e=>e.minSplatRadius),new l("inverseScreenSize",({camera:a})=>e(F,1/a.fullWidth,1/a.fullHeight)),new v("proj",e=>e.camera.projectionMatrix),new v("view",e=>e.camera.viewMatrix),new l("nearFar",e=>e.camera.nearFar)),u&&(h.uniforms.add(new d("clipMin",e=>e.clipMinCameraRelative),new d("clipMax",e=>e.clipMaxCameraRelative)),f&&x.uniforms.add(new d("clipMin",e=>e.clipMinCameraRelative),new d("clipMax",e=>e.clipMaxCameraRelative))),h.include(s),h.include(r),h.include(c),h.include(t),h.include(o),h.include(i,n),x.include(o),f&&x.include(i,n),x.main.add(p`
3
3
  ${j(n)}
4
- `)}function P(e,a){e.include(x,a),e.vertex.uniforms.add(new m("focalLength",e=>e.focalLength),new u("tanFov",e=>e.tanFov))}function h(e){e.uniforms.add(new g("splatFadingTexture",e=>e.splatFading)),e.code.add(f`float applyGaussianSplatFading(float opacity, uint gaussianIndex) {
4
+ `)}function P(e,a){e.include(x,a),e.vertex.uniforms.add(new m("focalLength",e=>e.focalLength),new u("tanFov",e=>e.tanFov))}function h(e){e.uniforms.add(new g("splatFadingTexture",e=>e.splatFading)),e.code.add(p`float applyGaussianSplatFading(float opacity, uint gaussianIndex) {
5
5
  uint pageIndex = fetchGaussianPageIndex(gaussianIndex);
6
6
  uint fadingTextureWidth = uint(textureSize(splatFadingTexture, 0).x);
7
7
  uint fadeX = pageIndex % fadingTextureWidth;
8
8
  uint fadeY = pageIndex / fadingTextureWidth;
9
9
  uint opacityModifier = texelFetch(splatFadingTexture, ivec2(fadeX, fadeY), 0).r;
10
10
  return opacity * float(opacityModifier) / 255.0;
11
- }`)}function y(e,a){const{clippingEnabled:i,hasSlicePlane:t}=e;return f`
11
+ }`)}function y(e,a){const{clippingEnabled:i,hasSlicePlane:t}=e;return p`
12
12
  gl_Position = ${n};
13
13
 
14
14
  if (opacity < ${a}) {
@@ -17,14 +17,14 @@ return opacity * float(opacityModifier) / 255.0;
17
17
 
18
18
  vec3 cameraRelativePosition = fetchGaussianCameraRelativePosition(gaussianIndex, packedGaussian);
19
19
 
20
- ${p(i,f`
20
+ ${f(i,p`
21
21
  if (cameraRelativePosition.x < clipMin.x || cameraRelativePosition.y < clipMin.y || cameraRelativePosition.z < clipMin.z ||
22
22
  cameraRelativePosition.x > clipMax.x || cameraRelativePosition.y > clipMax.y || cameraRelativePosition.z > clipMax.z) {
23
23
  return;
24
24
  }
25
25
  `)}
26
26
 
27
- ${p(t,f`
27
+ ${f(t,p`
28
28
  if (rejectBySlice(cameraRelativePosition)) {
29
29
  return;
30
30
  }
@@ -35,10 +35,10 @@ return opacity * float(opacityModifier) / 255.0;
35
35
  if (viewPos.z > -nearFar.x || viewPos.z < -nearFar.y) {
36
36
  return;
37
37
  }
38
- `}const M=f`vec3 covarianceA;
38
+ `}const R=p`vec3 covarianceA;
39
39
  vec3 covarianceB;
40
40
  computePackedGaussianCovariance3D(packedGaussian, covarianceA, covarianceB);
41
- float covariance3D[6] = float[6](covarianceA.x, covarianceA.y, covarianceA.z, covarianceB.x, covarianceB.y, covarianceB.z);`;function C(e){return f`
41
+ float covariance3D[6] = float[6](covarianceA.x, covarianceA.y, covarianceA.z, covarianceB.x, covarianceB.y, covarianceB.z);`;function M(e,a){return p`
42
42
  float determinant = computeGaussianCovarianceDeterminant(covariance2D);
43
43
  if (determinant <= 0.0) {
44
44
  return;
@@ -48,32 +48,39 @@ float covariance3D[6] = float[6](covarianceA.x, covarianceA.y, covarianceA.z, co
48
48
  gaussianLogAlphaCutoff = ${e};
49
49
  float gaussianEllipseThreshold = computeGaussianEllipseThreshold(gaussianLogAlphaCutoff);
50
50
  vec2 axisLengths = computeGaussianAxisLengths(eigenvalues, gaussianEllipseThreshold);
51
+ vec2 screenRadii = computeGaussianScreenRadii(covariance2D, gaussianEllipseThreshold);
51
52
  float maxRadius = max(axisLengths.x, axisLengths.y);
52
53
 
53
- if (rejectGaussianByMinimumRadius(maxRadius, opacity, minSplatRadius)) {
54
+ if (rejectGaussianByMinimumRadius(maxRadius, ${a}, minSplatRadius)) {
54
55
  return;
55
56
  }
56
- `}const R=f`vec2 clipSpacePixelScale = 2.0 * inverseScreenSize;
57
- if (rejectGaussianByScreenBounds(ndcPos.xy, maxRadius, clipSpacePixelScale)) {
57
+ `}const S=p`vec2 clipSpacePixelScale = 2.0 * inverseScreenSize;
58
+ if (rejectGaussianByScreenBounds(ndcPos.xy, screenRadii, clipSpacePixelScale)) {
58
59
  return;
59
60
  }
60
61
  offsetFromCenter = computeGaussianQuadOffset(covariance2D, eigenvalues, axisLengths, gl_VertexID);
61
- conic = computeGaussianConic(covariance2D, determinant);`;function S(e,a){return f`
62
- ${y(e,f.float(a))}
62
+ conic = computeGaussianConic(covariance2D, determinant);`;function C(e,a){return p`
63
+ ${y(e,p.float(a))}
63
64
 
64
- ${M}
65
+ ${R}
65
66
  vec3 covariance2D = computeGaussianCovariance2D(viewPos.xyz, focalLength, tanFov, covariance3D, view);
67
+ float minimumRadiusOpacity = opacity;
68
+ float opacityScale = regularizeGaussianCovariance(covariance2D);
69
+ opacity *= opacityScale;
70
+ if (opacity < ${p.float(a)}) {
71
+ return;
72
+ }
66
73
 
67
- ${C(`${f.float(Math.log(a))} - log(opacity)`)}
74
+ ${M(`${p.float(Math.log(a))} - log(opacity)`,"minimumRadiusOpacity")}
68
75
 
69
76
  ${w(e)}
70
- `}function w(e){return f`
77
+ `}function w(e){return p`
71
78
  vec4 projPos = proj * viewPos;
72
79
  float invW = 1.0 / (projPos.w + 1e-7);
73
80
  vec3 ndcPos = projPos.xyz * invW;
74
- ${R}
81
+ ${S}
75
82
 
76
- ${p(e.needsFragmentPosition,f`
83
+ ${f(e.needsFragmentPosition,p`
77
84
  float viewSpacePixelScale = -viewPos.z / focalLength;
78
85
  vec3 fragmentViewOffset = vec3(offsetFromCenter * viewSpacePixelScale, 0.0);
79
86
  fragmentPositionCameraRelative = cameraRelativePosition + transpose(mat3(view)) * fragmentViewOffset;
@@ -81,17 +88,17 @@ conic = computeGaussianConic(covariance2D, determinant);`;function S(e,a){return
81
88
 
82
89
  vec2 quadClipPosition = ndcPos.xy + offsetFromCenter * clipSpacePixelScale - inverseScreenSize;
83
90
  gl_Position = vec4(quadClipPosition, ndcPos.z, 1.0);
84
- `}function j(e){const{clippingEnabled:a,needsFragmentPosition:i,hasSlicePlane:n}=e;return f`
85
- ${p(i&&a,f`
91
+ `}function j(e){const{clippingEnabled:a,needsFragmentPosition:i,hasSlicePlane:n}=e;return p`
92
+ ${f(i&&a,p`
86
93
  if (fragmentPositionCameraRelative.x < clipMin.x || fragmentPositionCameraRelative.y < clipMin.y || fragmentPositionCameraRelative.z < clipMin.z ||
87
94
  fragmentPositionCameraRelative.x > clipMax.x || fragmentPositionCameraRelative.y > clipMax.y || fragmentPositionCameraRelative.z > clipMax.z) {
88
95
  discard;
89
96
  }
90
97
  `)}
91
- ${p(i&&n,f`if (rejectBySlice(fragmentPositionCameraRelative)) { discard; }`)}
98
+ ${f(i&&n,p`if (rejectBySlice(fragmentPositionCameraRelative)) { discard; }`)}
92
99
 
93
100
  float gaussianExponent = evaluateGaussianExponent(conic, offsetFromCenter);
94
101
  if (gaussianExponent > 0.0 || gaussianExponent < gaussianLogAlphaCutoff) {
95
102
  discard;
96
103
  }
97
- `}const F=a();export{h as GaussianSplatFading,x as GaussianSplatPass,P as GaussianSplatPerspectivePass,C as gaussianSplatComputeEllipse,R as gaussianSplatComputeQuad,y as gaussianSplatCullAndTransformVertex,S as gaussianSplatPerspectiveVertex,M as gaussianSplatUnpackCovariance3D};
104
+ `}const F=a();export{h as GaussianSplatFading,x as GaussianSplatPass,P as GaussianSplatPerspectivePass,M as gaussianSplatComputeEllipse,S as gaussianSplatComputeQuad,y as gaussianSplatCullAndTransformVertex,C as gaussianSplatPerspectiveVertex,R as gaussianSplatUnpackCovariance3D};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import"../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../core/shaderModules/Matrix4DrawUniform.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{O as OccludedGeometryDepthPassParameters,b as build}from"../../../../chunks/OccludedGeometryDepth.glsl.js";
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ReloadableShader as t}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{Pos3 as s}from"../lib/DefaultVertexBufferLayouts.js";import{a as o}from"../../../../chunks/OccludedGeometryDepth.glsl.js";import{makePipelineState as l,defaultDepthWrite as c,cullingParams as n}from"../../../webgl/renderState.js";let p=class extends i{constructor(e,r){super(e,r,s),this.shader=new t(o,()=>import("./OccludedGeometryDepth.glsl.js"))}initializePipeline(){return this._pipelines=[u(0),u(1),u(2)],this._pipelines[0]}getPipeline(e,r){return this._pipelines[r.cullFace]}};function u(e){return l({colorWrite:null,culling:n(e),depthTest:{func:513},depthWrite:c})}p=e([r("esri.views.3d.webgl-engine.shaders.OccludedGeometryDepthTechnique")],p);export{p as OccludedGeometryDepthTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{createTask as t}from"../../core/asyncUtils.js";import o from"../../core/Collection.js";import{EventedAccessor as r}from"../../core/Evented.js";import{makeHandle as s}from"../../core/handleUtils.js";import i from"../../core/Logger.js";import{abortMaybe as n}from"../../core/maybe.js";import{debounce as l,onAbort as c,ignoreAbortErrors as a}from"../../core/promiseUtils.js";import{on as p}from"../../core/reactiveUtils.js";import{createScreenPoint as d}from"../../core/screenUtils.js";import{property as h,subclass as m}from"../../core/accessorSupport/decorators.js";import y from"../../geometry/Point.js";import u from"../../geometry/Polygon.js";import{isClockwise as v}from"../../geometry/support/coordsUtils.js";import{sketchKeys as _,selectionKeys as g}from"../interactive/keybindings.js";import{getSelectionFromGeometry as f}from"../../widgets/support/Selector2D/selectorUtils.js";import{getSelectionFromScreenSelector as w}from"../../widgets/support/Selector3D/selectorUtils.js";let T=class extends r{constructor(e){super(e),this._completed=!1,this._isConstraintKeyDown=!1,this._processTask=null,this.createTool="rectangle",this.mode=null,this.persistSelection=!0,this.returnFeatureTitleFields=!1,this.returnGeometry=!0,this.selection=new o,this.selectionManager=null,this.selectOnComplete=!0,this.sources=null,this.toolName="",this.type="add",this._process=l(async(e,o)=>{const{callback:r,completed:s}=e,i=t(async t=>{const{effectiveSelectionManager:o,returnFeatureTitleFields:i,returnGeometry:n,selection:l,sources:c,view:a}=this;if(!c?.length&&!o.sources.length||!a)return void l.removeAll();const p="3d"===a.type&&"screenSelector"in e&&e.screenSelector&&null!=c?await w({selector:e.screenSelector,signal:t,sources:c,view:a}):"selector"in e&&e.selector&&null!=c?await f({returnFeatureTitleFields:i,returnGeometry:n,selector:e.selector,signal:t,sources:c,view:a}):[];if(l.removeAll(),l.addMany(p),s&&this.persistSelection)switch(this.effectiveType){case"remove":o.updateSelection({current:[],added:[],removed:p});break;case"replace":o.clear(),o.updateSelection({current:p,added:[],removed:[]});break;default:o.updateSelection({current:p,added:[],removed:[]})}r?.()});return c(o,()=>i.abort()),this._processTask=i,i.promise},S),this._onOperationFinish=this._onOperationFinish.bind(this)}initialize(){this._setup()}get _defaultMode(){return"polygon"===this.createTool?"click":"hybrid"}get _selectionArea(){const e=this._tool.coordinates;if(0===e.length)return;const t=d(),o=this.view.spatialReference,r=e=>{t.x=e[0],t.y=e[1];const o=this.view.toMap(t);return[o?.x??0,o?.y??0]};if(1===e.length||e.every(([t,o])=>t===e[0][0]&&o===e[0][1])){const[t,s]=r(e[0]);return new y({x:t,y:s,spatialReference:o})}const s=e.map(r);if(0===s.length)return;v(s)||s.reverse();return new u({spatialReference:o,rings:[s]})}get _screenSelector(){const e=this._tool.coordinates;if(0===e.length)return;const t=e=>d(e[0],e[1]);return 1===e.length||e.every(([t,o])=>t===e[0][0]&&o===e[0][1])?t(e[0]):e.map(t)}get completed(){return this._completed}get effectiveSelectionManager(){return this.selectionManager??this.view.selectionManager}get effectiveType(){const e=this.type??"add";if(this._isConstraintKeyDown)switch(e){case"add":return"remove";case"remove":case"replace":return"add";default:return e}return e}get processingFinalSelection(){return!(!this._processTask||!this._tool?.drawOperation?.isCompleted)}cancel(){this.selection.removeAll(),this._onOperationFinish(!0)}destroy(){this._toolImportController=n(this._toolImportController)}async _setup(){const{createTool:e,view:t}=this;if(await t.whenReady(),this.destroyed||this._toolImportController)return;const o=new AbortController;this._toolImportController=o;const r=await(import("../draw/DrawScreenTool.js"));if(o.signal.aborted)return;const n=Symbol();try{this._tool=new r.DrawScreenTool({view:t,mode:this.mode??this._defaultMode,geometryType:e,cursor:"point"===e?"default":"crosshair"})}finally{this._toolImportController=null}this._tool?(this.selectOnComplete||this.addHandles(this._tool.on(["cursor-update","vertex-add","vertex-remove"],()=>{this._syncConstraintKeyDown(),a(this._process(this._selectionProcessParams))}),n),this._syncConstraintKeyDown(),this.addHandles([p(()=>t,"key-down",e=>{if(!e.repeat)switch(this._syncConstraintKeyDown(),e.key){case _.constraint:this._tool.uniformSizeToggled=!0,e.stopPropagation();break;case _.center:this._tool.centeredToggled=!0,e.stopPropagation()}}),p(()=>t,"key-up",e=>{switch(this._syncConstraintKeyDown(),e.key){case _.constraint:this._tool.uniformSizeToggled=!1,e.stopPropagation();break;case _.center:this._tool.centeredToggled=!1,e.stopPropagation()}}),this.selection.on("change",({added:e,removed:t})=>this.emit("selection-change",{operationType:this.effectiveType,added:e,removed:t})),this._tool.on("complete",async e=>{this._syncConstraintKeyDown(),this.removeHandles(n),e.aborted?this.cancel():(this._tool.cursor="progress",await this._process({...this._selectionProcessParams,callback:this._onOperationFinish,completed:!0}))})],n),this.addHandles(s(()=>t.tools.remove(this._tool))),t.addAndActivateTool(this._tool)):i.getLogger(this).warn("Unable to import Draw module. SelectionOperation failed to load.")}_syncConstraintKeyDown(){const{inputManager:e}=this.view;this._isConstraintKeyDown=g.invertType.some(t=>e.isModifierKeyDown(t))}get _selectionProcessParams(){return"3d"===this.view.type?{screenSelector:this._screenSelector}:{selector:this._selectionArea}}_onOperationFinish(e=!1){this.removeAllHandles(),this._processTask?.abort(),this._completed=!0,this.emit("complete",{aborted:e,operationType:this.effectiveType,selection:this.selection.toArray(),toolName:this.toolName})}};e([h()],T.prototype,"_completed",void 0),e([h()],T.prototype,"_defaultMode",null),e([h()],T.prototype,"_isConstraintKeyDown",void 0),e([h()],T.prototype,"_processTask",void 0),e([h()],T.prototype,"_selectionArea",null),e([h()],T.prototype,"_screenSelector",null),e([h()],T.prototype,"completed",null),e([h({constructOnly:!0})],T.prototype,"createTool",void 0),e([h()],T.prototype,"effectiveSelectionManager",null),e([h()],T.prototype,"effectiveType",null),e([h({constructOnly:!0})],T.prototype,"mode",void 0),e([h()],T.prototype,"persistSelection",void 0),e([h()],T.prototype,"processingFinalSelection",null),e([h()],T.prototype,"returnFeatureTitleFields",void 0),e([h()],T.prototype,"returnGeometry",void 0),e([h({readOnly:!0})],T.prototype,"selection",void 0),e([h({constructOnly:!0})],T.prototype,"selectionManager",void 0),e([h({constructOnly:!0})],T.prototype,"selectOnComplete",void 0),e([h()],T.prototype,"sources",void 0),e([h({constructOnly:!0})],T.prototype,"toolName",void 0),e([h()],T.prototype,"type",void 0),e([h({constructOnly:!0})],T.prototype,"view",void 0),T=e([m("esri.views.selection.SelectionOperation")],T);const S=100,C=T;export{C as default};
2
+ import{__decorate as e}from"tslib";import{createTask as t}from"../../core/asyncUtils.js";import o from"../../core/Collection.js";import{EventedAccessor as r}from"../../core/Evented.js";import{makeHandle as s}from"../../core/handleUtils.js";import i from"../../core/Logger.js";import{abortMaybe as n}from"../../core/maybe.js";import{debounce as l,onAbort as c,ignoreAbortErrors as a}from"../../core/promiseUtils.js";import{on as p}from"../../core/reactiveUtils.js";import{createScreenPoint as d}from"../../core/screenUtils.js";import{property as h,subclass as m}from"../../core/accessorSupport/decorators.js";import y from"../../geometry/Point.js";import u from"../../geometry/Polygon.js";import{isClockwise as v}from"../../geometry/support/coordsUtils.js";import{sketchKeys as _,selectionKeys as g}from"../interactive/keybindings.js";import{getSelectionFromGeometry as f}from"../../widgets/support/Selector2D/selectorUtils.js";import{getSelectionFromScreenSelector as w}from"../../widgets/support/Selector3D/selectorUtils.js";let T=class extends r{constructor(e){super(e),this._completed=!1,this._isConstraintKeyDown=!1,this._processTask=null,this.createTool="rectangle",this.mode=null,this.persistSelection=!0,this.returnFeatureTitleFields=!1,this.returnGeometry=!0,this.selection=new o,this.selectionManager=null,this.selectOnComplete=!0,this.sources=null,this.toolName="",this.type="add",this._process=l(async(e,o)=>{const{callback:r,completed:s}=e,i=t(async t=>{const{effectiveSelectionManager:o,returnFeatureTitleFields:i,returnGeometry:n,selection:l,sources:c,view:a}=this;if(!c?.length&&!o.sources.length||!a)return void l.removeAll();const p="3d"===a.type&&"screenSelector"in e&&e.screenSelector&&null!=c?await w({selector:e.screenSelector,signal:t,sources:c,view:a}):"selector"in e&&e.selector&&null!=c?await f({returnFeatureTitleFields:i,returnGeometry:n,selector:e.selector,signal:t,sources:c,view:a}):[];if(l.removeAll(),l.addMany(p),s&&this.persistSelection)switch(this.effectiveType){case"remove":o.updateSelection({current:[],added:[],removed:p});break;case"replace":o.clear(),o.updateSelection({current:p,added:[],removed:[]});break;default:o.updateSelection({current:p,added:[],removed:[]})}r?.()});return c(o,()=>i.abort()),this._processTask=i,i.promise},S),this._onOperationFinish=this._onOperationFinish.bind(this)}async initialize(){await this._setup()}get _defaultMode(){return"polygon"===this.createTool?"click":"hybrid"}get _selectionArea(){const e=this._tool.coordinates;if(0===e.length)return;const t=d(),o=this.view.spatialReference,r=e=>{t.x=e[0],t.y=e[1];const o=this.view.toMap(t);return[o?.x??0,o?.y??0]};if(1===e.length||e.every(([t,o])=>t===e[0][0]&&o===e[0][1])){const[t,s]=r(e[0]);return new y({x:t,y:s,spatialReference:o})}const s=e.map(r);if(0===s.length)return;v(s)||s.reverse();return new u({spatialReference:o,rings:[s]})}get _screenSelector(){const e=this._tool.coordinates;if(0===e.length)return;const t=e=>d(e[0],e[1]);return 1===e.length||e.every(([t,o])=>t===e[0][0]&&o===e[0][1])?t(e[0]):e.map(t)}get completed(){return this._completed}get effectiveSelectionManager(){return this.selectionManager??this.view.selectionManager}get effectiveType(){const e=this.type??"add";if(this._isConstraintKeyDown)switch(e){case"add":return"remove";case"remove":case"replace":return"add";default:return e}return e}get processingFinalSelection(){return!(!this._processTask||!this._tool?.drawOperation?.isCompleted)}cancel(){this.selection.removeAll(),this._onOperationFinish(!0)}destroy(){this._toolImportController=n(this._toolImportController)}async _setup(){const{createTool:e,view:t}=this;if(await t.whenReady(),this.destroyed||this._toolImportController)return;const o=new AbortController;this._toolImportController=o;const r=await(import("../draw/DrawScreenTool.js"));if(o.signal.aborted)return;const n=Symbol();try{this._tool=new r.DrawScreenTool({view:t,mode:this.mode??this._defaultMode,geometryType:e,cursor:"point"===e?"default":"crosshair"})}finally{this._toolImportController=null}this._tool?(this.selectOnComplete||this.addHandles(this._tool.on(["cursor-update","vertex-add","vertex-remove"],()=>{this._syncConstraintKeyDown(),a(this._process(this._selectionProcessParams))}),n),this._syncConstraintKeyDown(),this.addHandles([p(()=>t,"key-down",e=>{if(!e.repeat)switch(this._syncConstraintKeyDown(),e.key){case _.constraint:this._tool.uniformSizeToggled=!0,e.stopPropagation();break;case _.center:this._tool.centeredToggled=!0,e.stopPropagation()}}),p(()=>t,"key-up",e=>{switch(this._syncConstraintKeyDown(),e.key){case _.constraint:this._tool.uniformSizeToggled=!1,e.stopPropagation();break;case _.center:this._tool.centeredToggled=!1,e.stopPropagation()}}),this.selection.on("change",({added:e,removed:t})=>this.emit("selection-change",{operationType:this.effectiveType,added:e,removed:t})),this._tool.on("complete",async e=>{this._syncConstraintKeyDown(),this.removeHandles(n),e.aborted?this.cancel():(this._tool.cursor="progress",await this._process({...this._selectionProcessParams,callback:this._onOperationFinish,completed:!0}))})],n),this.addHandles(s(()=>t.tools.remove(this._tool))),t.addAndActivateTool(this._tool)):i.getLogger(this).warn("Unable to import Draw module. SelectionOperation failed to load.")}_syncConstraintKeyDown(){const{inputManager:e}=this.view;this._isConstraintKeyDown=g.invertType.some(t=>e.isModifierKeyDown(t))}get _selectionProcessParams(){return"3d"===this.view.type?{screenSelector:this._screenSelector}:{selector:this._selectionArea}}_onOperationFinish(e=!1){this.removeAllHandles(),this._processTask?.abort(),this._completed=!0,this.emit("complete",{aborted:e,operationType:this.effectiveType,selection:this.selection.toArray(),toolName:this.toolName})}};e([h()],T.prototype,"_completed",void 0),e([h()],T.prototype,"_defaultMode",null),e([h()],T.prototype,"_isConstraintKeyDown",void 0),e([h()],T.prototype,"_processTask",void 0),e([h()],T.prototype,"_selectionArea",null),e([h()],T.prototype,"_screenSelector",null),e([h()],T.prototype,"completed",null),e([h({constructOnly:!0})],T.prototype,"createTool",void 0),e([h()],T.prototype,"effectiveSelectionManager",null),e([h()],T.prototype,"effectiveType",null),e([h({constructOnly:!0})],T.prototype,"mode",void 0),e([h()],T.prototype,"persistSelection",void 0),e([h()],T.prototype,"processingFinalSelection",null),e([h()],T.prototype,"returnFeatureTitleFields",void 0),e([h()],T.prototype,"returnGeometry",void 0),e([h({readOnly:!0})],T.prototype,"selection",void 0),e([h({constructOnly:!0})],T.prototype,"selectionManager",void 0),e([h({constructOnly:!0})],T.prototype,"selectOnComplete",void 0),e([h()],T.prototype,"sources",void 0),e([h({constructOnly:!0})],T.prototype,"toolName",void 0),e([h()],T.prototype,"type",void 0),e([h({constructOnly:!0})],T.prototype,"view",void 0),T=e([m("esri.views.selection.SelectionOperation")],T);const S=100,C=T;export{C as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{isSome as o}from"../../../core/arrayUtils.js";import{ClonableMixin as l}from"../../../core/Clonable.js";import a from"../../../core/Collection.js";import{IdentifiableMixin as i}from"../../../core/Identifiable.js";import{ignoreAbortErrors as s,debounce as n}from"../../../core/promiseUtils.js";import{watch as u,initial as d}from"../../../core/reactiveUtils.js";import{property as y,subclass as h}from"../../../core/accessorSupport/decorators.js";import{getFixedFieldName as p,isRelatableFeatureSupportedLayer as c,findRelatedLayer as g}from"../../../popup/support/featureUtils.js";import C from"../../../rest/support/RelationshipQuery.js";import{getFieldsInTitleAndDesc as b}from"../../FeatureForm/featureFormUtils.js";const F=100;let _=class extends(l(i(r))){constructor(e){super(e),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featuresPerPage=10,this.activeCategory=null,this.allCategories=null,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.orderByFields=null,this.featureCount=0,this.relationshipId=null,this.showAllEnabled=!1,this.title=null,this._cancelQuery=()=>{const{_queryAbortController:e}=this;e&&e.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:e}=this;e&&e.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:e}=this;e&&e.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const e=new AbortController;this._queryAbortController=e,await s(this._query()),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const e=new AbortController;this._queryFeatureCountAbortController=e,await s(this._queryFeatureCount()),this._queryFeatureCountAbortController===e&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{const e=new AbortController;this._queryPageAbortController=e,await s(this._queryPage()),this._queryPageAbortController===e&&(this._queryPageAbortController=null)},this._queryDebounced=n(this._queryController,F),this._queryFeatureCountDebounced=n(this._queryFeatureCountController,F),this._queryPageDebounced=n(this._queryPageController,F),this._query=async()=>{const{_queryAbortController:e,relatedFeatures:t}=this;this.featureCount&&("subtype-group"!==this.relatedLayer?.type||this.activeCategory)&&(this._destroyRelatedFeatureViewModels(),this.featurePage=1,t.destroyAll(),this.destroyed||t.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:e?.signal}))))},this.addHandles([u(()=>[this.displayCount,this.graphic,this.layer,this.layer?.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount,this.activeCategory],()=>this._queryDebounced(),d),u(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),u(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery,this.activeCategory],()=>this._queryFeatureCountDebounced())])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.destroyAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:t,featureCount:r}=this,o=1,l=Math.ceil(r/t)||1;this._set("featurePage",Math.min(Math.max(e,o),l))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:t}=this;return e&&t?.loaded?e.map(e=>{const r=e.clone();return r.field=p(e.field,t),r}):e??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get canLoad(){return!!this.map&&null!=this.relationshipId&&"number"==typeof this.objectId}get canQuery(){const e=this.layer?.capabilities?.queryRelated;return!!(this.relatedLayer&&this.relationship&&null!=this.relationshipId&&null!=this.objectId&&e?.supportsCount&&e?.supportsPagination)}get allCategoriesCount(){return this.allCategories?.length??0}get categories(){const{allCategories:e}=this;return this.showAllEnabled?e:e?.slice(0,this.displayCount)??null}set displayCount(e){const t=0,r=10,o=3;this._set("displayCount",Math.min(Math.max(e??o,t),r))}get displayCount(){return this._get("displayCount")}get itemDescriptionFieldName(){return this.orderByFieldsFixedCasing[0]?.field||null}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedFeatures(){return this._get("relatedFeatures")||new a}get relatedLayer(){const{layer:e,map:t,relationship:r}=this;if(!e?.loaded||!t||!r)return null;const o="subtype-sublayer"===e.type&&e.parent&&c(e.parent)?e.parent:e;return g(t,o,r)??null}get relatedLayerKeyField(){const{relatedLayer:e,relationshipId:t}=this;return e?.loaded&&null!=t?e.relationships?.find(e=>e.id===t)?.keyField:null}get relatedLayerKeyFields(){const{relatedLayer:e}=this;return e?.loaded?e.relationships?.map(e=>e.keyField).filter(o)??[]:[]}get relationship(){const{relationshipId:e,layer:t}=this;return null!=e&&t?.loaded?t.relationships?.find(({id:t})=>t===e)??null:null}get relationshipKey(){const{relationshipKeyField:e}=this;return(e&&this.graphic?.attributes?.[e])??null}get relationshipKeyField(){return this.relationship?.keyField||null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new a}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:r,canQuery:o,_loaded:l,canLoad:a}=this;return t||a&&!l?"loading":e||r?"querying":o?"ready":"disabled"}getRelatedFeatureByObjectId(e){return this.relatedFeatures.find(t=>t.getObjectId()===e)}refresh(){this._queryFeatureCountDebounced()}_destroyRelatedFeatureViewModels(){this.relatedFeatureViewModels?.destroyAll()}async _queryFeatureCount(){const{layer:e,relatedLayer:t}=this;await(e?.load()),await(t?.load());const{_queryFeatureCountAbortController:r,activeCategory:l,canQuery:a,objectId:i,relatedLayerKeyField:s,relationshipId:n,relationshipKey:u,supportsCacheHint:d}=this;if(!a||!e||!t||null==i)return this._set("featureCount",0),void this._set("allCategories",null);if("subtype-group"===t?.type&&!l){if(this._set("featureCount",0),this._destroyRelatedFeatureViewModels(),this.featurePage=1,this.relatedFeatures.destroyAll(),s&&null!=u){const{default:e}=await(import("../../../smartMapping/statistics/uniqueValues.js")),{uniqueValueInfos:l}=await e({layer:t,sqlWhere:`${s} = '${u}'`,field:t.subtypeField,signal:r?.signal}),a=l.map(({count:e,value:r})=>{const o=t.subtypes?.find(e=>e.code===r)?.name;return null!=r&&o?{count:e,value:r,name:o}:void 0}).filter(o);this._set("allCategories",a)}return}const{historicMoment:y,gdbVersion:h}=e,p=new C({cacheHint:d,gdbVersion:h,historicMoment:y,relationshipId:n,returnGeometry:!1,objectIds:[i],where:this._getRelationshipWhereClause(t)}),c=await e.queryRelatedFeaturesCount(p,{signal:r?.signal});this._set("allCategories",null),this._set("featureCount",c[i]||0)}_getRelationshipWhereClause(e){const{activeCategory:t}=this,r=e.createQuery(),o="subtypeField"in e?e.subtypeField:void 0,l=t&&o?`${o} = ${t.value}`:void 0,a=r.where;return a&&l?`(${a}) AND (${l})`:a??l}_sliceFeatures(e){const{showAllEnabled:t,displayCount:r}=this;return t?e:r?e.slice(0,r):[]}async _queryPage(){const{relatedFeatures:e,featurePage:t,showAllEnabled:r,_queryPageAbortController:o,featureCount:l}=this;!r||t<2||!l||"subtype-group"===this.relatedLayer?.type&&!this.activeCategory||e.addMany(await this._queryRelatedFeatures({signal:o?.signal}))}async _queryRelatedFeatures(e){const{displayCount:t,featureCount:r,featurePage:o,featuresPerPage:l,layer:a,orderByFieldsFixedCasing:i,relatedLayer:s,relatedLayerKeyFields:n,relationshipId:u,showAllEnabled:d,supportsCacheHint:y}=this,{canQuery:h,objectId:p}=this;if(!h||!a||!s||null==p)return[];const c=d?((o-1)*l+r)%r:0,g=d?l:t,F=s.objectIdField,_="subtypeField"in s?s.subtypeField:void 0,m=[...i.map(e=>e.field),...b(s),...n,F,_].filter(f),q=i.map(e=>`${e.field} ${e.order}`),{historicMoment:A,gdbVersion:w}=a,P=new C({orderByFields:q,start:c,num:g,outFields:m,cacheHint:y,historicMoment:A,gdbVersion:w,relationshipId:u,returnGeometry:!1,objectIds:[p],where:this._getRelationshipWhereClause(s)}),v=await a.queryRelatedFeatures(P,{signal:e?.signal}),I=v[p]?.features||[];return"subtype-group"===s.type&&_?I.forEach(e=>{const t=e.attributes[_],r=s.findSublayerForSubtypeCode?.(t);e.sourceLayer=r,e.layer=r}):I.forEach(e=>{e.sourceLayer=s,e.layer=s}),I}};function f(e){return null!=e&&""!==e}e([y()],_.prototype,"_loaded",void 0),e([y()],_.prototype,"_queryAbortController",void 0),e([y()],_.prototype,"_queryPageAbortController",void 0),e([y()],_.prototype,"_queryFeatureCountAbortController",void 0),e([y({value:1})],_.prototype,"featurePage",null),e([y()],_.prototype,"featuresPerPage",void 0),e([y({readOnly:!0})],_.prototype,"orderByFieldsFixedCasing",null),e([y({readOnly:!0})],_.prototype,"supportsCacheHint",null),e([y({readOnly:!0})],_.prototype,"canLoad",null),e([y({readOnly:!0})],_.prototype,"canQuery",null),e([y()],_.prototype,"activeCategory",void 0),e([y({readOnly:!0})],_.prototype,"allCategories",void 0),e([y({readOnly:!0})],_.prototype,"allCategoriesCount",null),e([y({readOnly:!0})],_.prototype,"categories",null),e([y()],_.prototype,"description",void 0),e([y({value:3})],_.prototype,"displayCount",null),e([y({type:t})],_.prototype,"graphic",void 0),e([y({readOnly:!0})],_.prototype,"itemDescriptionFieldName",null),e([y()],_.prototype,"layer",void 0),e([y()],_.prototype,"map",void 0),e([y({readOnly:!0})],_.prototype,"objectId",null),e([y({readOnly:!0})],_.prototype,"objectIdField",null),e([y()],_.prototype,"orderByFields",void 0),e([y({readOnly:!0})],_.prototype,"relatedFeatures",null),e([y({readOnly:!0})],_.prototype,"relatedLayer",null),e([y({readOnly:!0})],_.prototype,"relatedLayerKeyField",null),e([y({readOnly:!0})],_.prototype,"relatedLayerKeyFields",null),e([y({readOnly:!0})],_.prototype,"relationship",null),e([y({readOnly:!0})],_.prototype,"relationshipKey",null),e([y({readOnly:!0})],_.prototype,"relationshipKeyField",null),e([y({readOnly:!0})],_.prototype,"featureCount",void 0),e([y({readOnly:!0})],_.prototype,"relatedFeatureViewModels",null),e([y()],_.prototype,"relationshipId",void 0),e([y()],_.prototype,"showAllEnabled",void 0),e([y()],_.prototype,"state",null),e([y()],_.prototype,"title",void 0),_=e([h("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],_);export{_ as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{isSome as o}from"../../../core/arrayUtils.js";import{ClonableMixin as l}from"../../../core/Clonable.js";import a from"../../../core/Collection.js";import{IdentifiableMixin as i}from"../../../core/Identifiable.js";import{ignoreAbortErrors as s,debounce as n}from"../../../core/promiseUtils.js";import{watch as u,initial as d}from"../../../core/reactiveUtils.js";import{property as y,subclass as h}from"../../../core/accessorSupport/decorators.js";import{getFixedFieldName as p,isRelatableFeatureSupportedLayer as c,findRelatedLayer as g}from"../../../popup/support/featureUtils.js";import C from"../../../rest/support/RelationshipQuery.js";import{getFieldsInTitleAndDesc as b}from"../../FeatureForm/featureFormUtils.js";const F=100;let _=class extends(l(i(r))){constructor(e){super(e),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featuresPerPage=10,this.activeCategory=null,this.allCategories=null,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.orderByFields=null,this.featureCount=0,this.relationshipId=null,this.showAllEnabled=!1,this.title=null,this._cancelQuery=()=>{const{_queryAbortController:e}=this;e&&e.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:e}=this;e&&e.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:e}=this;e&&e.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const e=new AbortController;this._queryAbortController=e,await s(this._query()),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const e=new AbortController;this._queryFeatureCountAbortController=e,await s(this._queryFeatureCount()),this._queryFeatureCountAbortController===e&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{const e=new AbortController;this._queryPageAbortController=e,await s(this._queryPage()),this._queryPageAbortController===e&&(this._queryPageAbortController=null)},this._queryDebounced=n(this._queryController,F),this._queryFeatureCountDebounced=n(this._queryFeatureCountController,F),this._queryPageDebounced=n(this._queryPageController,F),this._query=async()=>{const{_queryAbortController:e,relatedFeatures:t}=this;this.featureCount&&("subtype-group"!==this.relatedLayer?.type||this.activeCategory)&&(this._destroyRelatedFeatureViewModels(),this.featurePage=1,t.destroyAll(),this.destroyed||t.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:e?.signal}))))},this.addHandles([u(()=>[this.displayCount,this.graphic,this.layer,this.layer?.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount,this.activeCategory],()=>this._queryDebounced().catch(()=>{}),d),u(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced().catch(()=>{})),u(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery,this.activeCategory],()=>this._queryFeatureCountDebounced().catch(()=>{}))])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.destroyAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:t,featureCount:r}=this,o=1,l=Math.ceil(r/t)||1;this._set("featurePage",Math.min(Math.max(e,o),l))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:t}=this;return e&&t?.loaded?e.map(e=>{const r=e.clone();return r.field=p(e.field,t),r}):e??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get canLoad(){return!!this.map&&null!=this.relationshipId&&"number"==typeof this.objectId}get canQuery(){const e=this.layer?.capabilities?.queryRelated;return!!(this.relatedLayer&&this.relationship&&null!=this.relationshipId&&null!=this.objectId&&e?.supportsCount&&e?.supportsPagination)}get allCategoriesCount(){return this.allCategories?.length??0}get categories(){const{allCategories:e}=this;return this.showAllEnabled?e:e?.slice(0,this.displayCount)??null}set displayCount(e){const t=0,r=10,o=3;this._set("displayCount",Math.min(Math.max(e??o,t),r))}get displayCount(){return this._get("displayCount")}get itemDescriptionFieldName(){return this.orderByFieldsFixedCasing[0]?.field||null}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedFeatures(){return this._get("relatedFeatures")||new a}get relatedLayer(){const{layer:e,map:t,relationship:r}=this;if(!e?.loaded||!t||!r)return null;const o="subtype-sublayer"===e.type&&e.parent&&c(e.parent)?e.parent:e;return g(t,o,r)??null}get relatedLayerKeyField(){const{relatedLayer:e,relationshipId:t}=this;return e?.loaded&&null!=t?e.relationships?.find(e=>e.id===t)?.keyField:null}get relatedLayerKeyFields(){const{relatedLayer:e}=this;return e?.loaded?e.relationships?.map(e=>e.keyField).filter(o)??[]:[]}get relationship(){const{relationshipId:e,layer:t}=this;return null!=e&&t?.loaded?t.relationships?.find(({id:t})=>t===e)??null:null}get relationshipKey(){const{relationshipKeyField:e}=this;return(e&&this.graphic?.attributes?.[e])??null}get relationshipKeyField(){return this.relationship?.keyField||null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new a}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:r,canQuery:o,_loaded:l,canLoad:a}=this;return t||a&&!l?"loading":e||r?"querying":o?"ready":"disabled"}getRelatedFeatureByObjectId(e){return this.relatedFeatures.find(t=>t.getObjectId()===e)}refresh(){this._queryFeatureCountDebounced().catch(()=>{})}_destroyRelatedFeatureViewModels(){this.relatedFeatureViewModels?.destroyAll()}async _queryFeatureCount(){const{layer:e,relatedLayer:t}=this;await(e?.load()),await(t?.load());const{_queryFeatureCountAbortController:r,activeCategory:l,canQuery:a,objectId:i,relatedLayerKeyField:s,relationshipId:n,relationshipKey:u,supportsCacheHint:d}=this;if(!a||!e||!t||null==i)return this._set("featureCount",0),void this._set("allCategories",null);if("subtype-group"===t?.type&&!l){if(this._set("featureCount",0),this._destroyRelatedFeatureViewModels(),this.featurePage=1,this.relatedFeatures.destroyAll(),s&&null!=u){const{default:e}=await(import("../../../smartMapping/statistics/uniqueValues.js")),{uniqueValueInfos:l}=await e({layer:t,sqlWhere:`${s} = '${u}'`,field:t.subtypeField,signal:r?.signal}),a=l.map(({count:e,value:r})=>{const o=t.subtypes?.find(e=>e.code===r)?.name;return null!=r&&o?{count:e,value:r,name:o}:void 0}).filter(o);this._set("allCategories",a)}return}const{historicMoment:y,gdbVersion:h}=e,p=new C({cacheHint:d,gdbVersion:h,historicMoment:y,relationshipId:n,returnGeometry:!1,objectIds:[i],where:this._getRelationshipWhereClause(t)}),c=await e.queryRelatedFeaturesCount(p,{signal:r?.signal});this._set("allCategories",null),this._set("featureCount",c[i]||0)}_getRelationshipWhereClause(e){const{activeCategory:t}=this,r=e.createQuery(),o="subtypeField"in e?e.subtypeField:void 0,l=t&&o?`${o} = ${t.value}`:void 0,a=r.where;return a&&l?`(${a}) AND (${l})`:a??l}_sliceFeatures(e){const{showAllEnabled:t,displayCount:r}=this;return t?e:r?e.slice(0,r):[]}async _queryPage(){const{relatedFeatures:e,featurePage:t,showAllEnabled:r,_queryPageAbortController:o,featureCount:l}=this;!r||t<2||!l||"subtype-group"===this.relatedLayer?.type&&!this.activeCategory||e.addMany(await this._queryRelatedFeatures({signal:o?.signal}))}async _queryRelatedFeatures(e){const{displayCount:t,featureCount:r,featurePage:o,featuresPerPage:l,layer:a,orderByFieldsFixedCasing:i,relatedLayer:s,relatedLayerKeyFields:n,relationshipId:u,showAllEnabled:d,supportsCacheHint:y}=this,{canQuery:h,objectId:p}=this;if(!h||!a||!s||null==p)return[];const c=d?((o-1)*l+r)%r:0,g=d?l:t,F=s.objectIdField,_="subtypeField"in s?s.subtypeField:void 0,m=[...i.map(e=>e.field),...b(s),...n,F,_].filter(f),q=i.map(e=>`${e.field} ${e.order}`),{historicMoment:A,gdbVersion:w}=a,P=new C({orderByFields:q,start:c,num:g,outFields:m,cacheHint:y,historicMoment:A,gdbVersion:w,relationshipId:u,returnGeometry:!1,objectIds:[p],where:this._getRelationshipWhereClause(s)}),v=await a.queryRelatedFeatures(P,{signal:e?.signal}),I=v[p]?.features||[];return"subtype-group"===s.type&&_?I.forEach(e=>{const t=e.attributes[_],r=s.findSublayerForSubtypeCode?.(t);e.sourceLayer=r,e.layer=r}):I.forEach(e=>{e.sourceLayer=s,e.layer=s}),I}};function f(e){return null!=e&&""!==e}e([y()],_.prototype,"_loaded",void 0),e([y()],_.prototype,"_queryAbortController",void 0),e([y()],_.prototype,"_queryPageAbortController",void 0),e([y()],_.prototype,"_queryFeatureCountAbortController",void 0),e([y({value:1})],_.prototype,"featurePage",null),e([y()],_.prototype,"featuresPerPage",void 0),e([y({readOnly:!0})],_.prototype,"orderByFieldsFixedCasing",null),e([y({readOnly:!0})],_.prototype,"supportsCacheHint",null),e([y({readOnly:!0})],_.prototype,"canLoad",null),e([y({readOnly:!0})],_.prototype,"canQuery",null),e([y()],_.prototype,"activeCategory",void 0),e([y({readOnly:!0})],_.prototype,"allCategories",void 0),e([y({readOnly:!0})],_.prototype,"allCategoriesCount",null),e([y({readOnly:!0})],_.prototype,"categories",null),e([y()],_.prototype,"description",void 0),e([y({value:3})],_.prototype,"displayCount",null),e([y({type:t})],_.prototype,"graphic",void 0),e([y({readOnly:!0})],_.prototype,"itemDescriptionFieldName",null),e([y()],_.prototype,"layer",void 0),e([y()],_.prototype,"map",void 0),e([y({readOnly:!0})],_.prototype,"objectId",null),e([y({readOnly:!0})],_.prototype,"objectIdField",null),e([y()],_.prototype,"orderByFields",void 0),e([y({readOnly:!0})],_.prototype,"relatedFeatures",null),e([y({readOnly:!0})],_.prototype,"relatedLayer",null),e([y({readOnly:!0})],_.prototype,"relatedLayerKeyField",null),e([y({readOnly:!0})],_.prototype,"relatedLayerKeyFields",null),e([y({readOnly:!0})],_.prototype,"relationship",null),e([y({readOnly:!0})],_.prototype,"relationshipKey",null),e([y({readOnly:!0})],_.prototype,"relationshipKeyField",null),e([y({readOnly:!0})],_.prototype,"featureCount",void 0),e([y({readOnly:!0})],_.prototype,"relatedFeatureViewModels",null),e([y()],_.prototype,"relationshipId",void 0),e([y()],_.prototype,"showAllEnabled",void 0),e([y()],_.prototype,"state",null),e([y()],_.prototype,"title",void 0),_=e([h("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],_);export{_ as default};
@@ -9,7 +9,7 @@ import type { ParentItem, SelectionListParentLayer, SyncOptions } from "./types.
9
9
  *
10
10
  * @internal
11
11
  */
12
- export interface GroupLayerItemProperties extends ItemBaseProperties, Partial<Pick<GroupLayerItem, "items">> {
12
+ export interface GroupLayerItemProperties extends ItemBaseProperties, Partial<Pick<GroupLayerItem, "expanded" | "items">> {
13
13
  /**
14
14
  * Layer containing the sublayer that contains the selected features.
15
15
  *
@@ -33,6 +33,13 @@ export type RequiredConstructProperties = Pick<GroupLayerItem, "layer">;
33
33
  export default class GroupLayerItem extends ItemBase {
34
34
  /** @internal */
35
35
  constructor(properties: GroupLayerItemProperties);
36
+ /**
37
+ * Indicates the item is expanded in the selection list.
38
+ *
39
+ * @default true
40
+ * @internal
41
+ */
42
+ accessor expanded: boolean;
36
43
  /**
37
44
  * Set of child layer items. Can also be another GroupLayerItem in the case of SubtypeGroupLayer or KnowledgeGraphLayer.
38
45
  *
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as r}from"../../../core/accessorSupport/decorators.js";import s from"./ItemBase.js";let o=class extends s{constructor(e){super(e),this.items=[],this.layer=null}get layers(){const{layer:e}=this;return"group"===e.type||"knowledge-graph"===e.type?e.layers.toArray().reverse():"subtype-group"===e.type?e.sublayers.toArray().reverse():[]}get maxVisibleFeatureCountExceeded(){return this.items.some(e=>e.maxVisibleFeatureCountExceeded)}get total(){return this.items.reduce((e,t)=>e+t.total,0)}get visible(){return this.items.some(e=>e.visible)}get visibleTotal(){return this.items.reduce((e,t)=>e+t.visibleTotal,0)}reset(){this.items.forEach(e=>e.reset())}async sync({controller:e,promises:t}){const{layers:r,viewModel:s}=this;this.items=s.layersToItems({controller:e,groupLayerItem:this,layers:r,promises:t})}};e([t()],o.prototype,"items",void 0),e([t()],o.prototype,"layer",void 0),e([t()],o.prototype,"layers",null),e([t()],o.prototype,"maxVisibleFeatureCountExceeded",null),e([t()],o.prototype,"total",null),e([t()],o.prototype,"visible",null),e([t()],o.prototype,"visibleTotal",null),o=e([r("esri.widgets.support.SelectionList.GroupLayerItem")],o);const i=o;export{i as default};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as r}from"../../../core/accessorSupport/decorators.js";import s from"./ItemBase.js";let o=class extends s{constructor(e){super(e),this.expanded=!0,this.items=[],this.layer=null}get layers(){const{layer:e}=this;return"group"===e.type||"knowledge-graph"===e.type?e.layers.toArray().reverse():"subtype-group"===e.type?e.sublayers.toArray().reverse():[]}get maxVisibleFeatureCountExceeded(){return this.items.some(e=>e.maxVisibleFeatureCountExceeded)}get total(){return this.items.reduce((e,t)=>e+t.total,0)}get visible(){return this.items.some(e=>e.visible)}get visibleTotal(){return this.items.reduce((e,t)=>e+t.visibleTotal,0)}reset(){this.items.forEach(e=>e.reset())}async sync({controller:e,promises:t}){const{layers:r,viewModel:s}=this;this.items=s.layersToItems({controller:e,groupLayerItem:this,layers:r,promises:t})}};e([t()],o.prototype,"expanded",void 0),e([t()],o.prototype,"items",void 0),e([t()],o.prototype,"layer",void 0),e([t()],o.prototype,"layers",null),e([t()],o.prototype,"maxVisibleFeatureCountExceeded",null),e([t()],o.prototype,"total",null),e([t()],o.prototype,"visible",null),e([t()],o.prototype,"visibleTotal",null),o=e([r("esri.widgets.support.SelectionList.GroupLayerItem")],o);const i=o;export{i as default};