@arcgis/core 4.27.0-next.20230521 → 4.27.0-next.20230522

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 (173) hide show
  1. package/Graphic.js +1 -1
  2. package/arcade/featureset/actions/SpatialFilter.js +1 -1
  3. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  4. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  5. package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
  6. package/arcade/functions/featuresetbase.js +1 -1
  7. package/assets/esri/core/workers/RemoteClient.js +1 -1
  8. package/assets/esri/core/workers/chunks/0d02856e55d20b99fc8b.js +1 -0
  9. package/assets/esri/core/workers/chunks/{69242c66492717c7388c.js → 0fcb8d408696075338e2.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{1edc5c06874cb12c5478.js → 17f313e548281bb5db3e.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{b91c155de9a89e4e6971.js → 187c3b971ed0fc4363ef.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{85c6ce93aa41e6b65997.js → 18db07d739a713cc0465.js} +1 -1
  13. package/assets/esri/core/workers/chunks/28286014a575042619ee.js +1 -0
  14. package/assets/esri/core/workers/chunks/{692dfeb2e255fdc0ade2.js → 39288fa69561d21f04f8.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{2b9d3e60977934a6d471.js → 3bc6b5f0643364749ef8.js} +1 -1
  16. package/assets/esri/core/workers/chunks/45e5ad704d18dd0857ce.js +1 -0
  17. package/assets/esri/core/workers/chunks/{62d9d15f0d00a75da42c.js → 4670b17ae2ed3c13d344.js} +1 -1
  18. package/assets/esri/core/workers/chunks/4d24efa01d1accc5a5f0.js +1 -0
  19. package/assets/esri/core/workers/chunks/52575f021a14dd961de8.js +1 -0
  20. package/assets/esri/core/workers/chunks/{6312783626bacf52df7a.js → 55486c644e8b01326a0d.js} +1 -1
  21. package/assets/esri/core/workers/chunks/5576858f56314afcb4d5.js +1 -0
  22. package/assets/esri/core/workers/chunks/5a4c04bf4f57e74457c5.js +1 -0
  23. package/assets/esri/core/workers/chunks/70d6e5edf05ef7079fa8.js +1 -0
  24. package/assets/esri/core/workers/chunks/71bdf8f10aee0077f681.js +1 -0
  25. package/assets/esri/core/workers/chunks/72b2c3c8e76da699690c.js +1 -0
  26. package/assets/esri/core/workers/chunks/78ce0b1af62435d8ebf4.js +1 -0
  27. package/assets/esri/core/workers/chunks/791f529e90135398b3d5.js +1 -0
  28. package/assets/esri/core/workers/chunks/8d3abfe6fdc5ac8d6cb7.js +1 -0
  29. package/assets/esri/core/workers/chunks/96d339abcd917f1f0ae1.js +1 -0
  30. package/assets/esri/core/workers/chunks/97cdbec7532cfcdf9ad2.js +1 -0
  31. package/assets/esri/core/workers/chunks/{f3f6035a17f7dcd19675.js → 9ab400a89dd701778d2c.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{1488b3d48232844b8bb4.js → 9fe349f43d5ff5a4ac2d.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{22396dd3717d17a5d235.js → a1c31bb8c12831539328.js} +1 -1
  34. package/assets/esri/core/workers/chunks/b4e2dc6b3d06b426e596.js +1 -0
  35. package/assets/esri/core/workers/chunks/{48abcb2d88f22e6e9fde.js → c2cb9fa18c77f0c5104e.js} +1 -1
  36. package/assets/esri/core/workers/chunks/cad7a2092ea7f51dbd8b.js +1 -0
  37. package/assets/esri/core/workers/chunks/d725dbbdeb05322e6d88.js +1 -0
  38. package/assets/esri/core/workers/chunks/df3e497d12ed77bae168.js +1 -0
  39. package/assets/esri/core/workers/chunks/{4d5f71d84c85f45c97ea.js → ed6f6e539a915ba9e64d.js} +1 -1
  40. package/assets/esri/core/workers/chunks/fb080339bfaf32731ca6.js +1 -0
  41. package/assets/esri/themes/base/_core.scss +2 -0
  42. package/assets/esri/themes/base/widgets/_FloorFilter.scss +6 -0
  43. package/assets/esri/themes/base/widgets/_UtilityNetworkValidateTopology.scss +40 -0
  44. package/assets/esri/themes/dark/main.css +1 -1
  45. package/assets/esri/themes/light/main.css +1 -1
  46. package/assets/esri/themes/light/view.css +1 -1
  47. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  48. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  49. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  50. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  51. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  52. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  53. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  54. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  55. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  56. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  57. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  58. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  59. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  60. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  61. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  62. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  63. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  64. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  65. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  66. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  67. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  68. package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
  69. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  70. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  71. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  72. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  73. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  74. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  75. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  76. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  77. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  78. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  79. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  80. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  81. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  82. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  83. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  84. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  85. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  86. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology.json +1 -1
  87. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_en.json +1 -1
  88. package/chunks/mat4.js +1 -1
  89. package/core/accessorSupport/write.js +1 -1
  90. package/core/fontUtils.js +1 -1
  91. package/core/libs/gl-matrix-2/math/mat4.js +1 -1
  92. package/geometry/Mesh.js +1 -1
  93. package/geometry/support/MeshGeoreferencedRelativeVertexSpace.d.ts +4 -0
  94. package/geometry/support/MeshGeoreferencedRelativeVertexSpace.js +5 -0
  95. package/geometry/support/MeshGeoreferencedVertexSpace.d.ts +4 -0
  96. package/geometry/support/MeshGeoreferencedVertexSpace.js +5 -0
  97. package/geometry/support/MeshLocalVertexSpace.d.ts +4 -0
  98. package/geometry/support/MeshLocalVertexSpace.js +5 -0
  99. package/geometry/support/MeshTransform.d.ts +4 -0
  100. package/geometry/support/MeshTransform.js +1 -1
  101. package/geometry/support/meshUtils/ElevationSamplerWorker.js +1 -1
  102. package/geometry/support/meshUtils/centerAt.js +1 -1
  103. package/geometry/support/meshUtils/exporters/gltf/geometry.js +1 -1
  104. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  105. package/geometry/support/meshUtils/geographicUtils.js +1 -1
  106. package/geometry/support/meshUtils/georeference.js +1 -1
  107. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  108. package/geometry/support/meshUtils/merge.js +1 -1
  109. package/geometry/support/meshUtils/offset.js +1 -1
  110. package/geometry/support/meshUtils/primitives.js +1 -1
  111. package/geometry/support/meshUtils/rotate.js +1 -1
  112. package/geometry/support/meshUtils/scale.js +1 -1
  113. package/interfaces.d.ts +227 -1
  114. package/layers/VoxelWasmPerSceneView.js +1 -1
  115. package/layers/graphics/data/attributeSupport.js +1 -1
  116. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  117. package/networks/support/TopologyValidationJobInfo.js +1 -1
  118. package/package.json +1 -1
  119. package/popup/FieldInfo.js +1 -1
  120. package/portal/Portal.js +1 -1
  121. package/rest/support/FeatureSet.js +1 -1
  122. package/rest/support/meshFeatureSet.js +1 -1
  123. package/support/revision.js +1 -1
  124. package/symbols/cim/cimAnalyzer.js +1 -1
  125. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  126. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  127. package/views/3d/interactive/editingTools/meshFastUpdateUtils.js +1 -1
  128. package/views/3d/interactive/editingTools/moveGraphic/GraphicMoveTool.js +1 -1
  129. package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
  130. package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateMeshAdapter.js +1 -1
  131. package/views/3d/interactive/editingTools/transformGraphic/undoRecords.js +1 -1
  132. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  133. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  134. package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
  135. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  136. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  137. package/views/3d/state/utils/navigationUtils.js +1 -1
  138. package/views/3d/support/DisplayQualityProfile.js +1 -1
  139. package/views/3d/support/QualitySettings.js +1 -1
  140. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  141. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  142. package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
  143. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  144. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  145. package/views/interactive/dragEventPipeline.js +1 -1
  146. package/widgets/BasemapGallery/support/PortalBasemapsSource.js +1 -1
  147. package/widgets/Editor/Edits.js +1 -1
  148. package/widgets/Editor/Upload.js +1 -1
  149. package/widgets/Editor/workflowUtils.js +1 -1
  150. package/widgets/Feature/support/featureUtils.js +1 -1
  151. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  152. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +5 -0
  153. package/widgets/UtilityNetworkValidateTopology.js +5 -0
  154. package/assets/esri/core/workers/chunks/163bf2e13abbdd298374.js +0 -1
  155. package/assets/esri/core/workers/chunks/23f73f81aea461c0c6e6.js +0 -1
  156. package/assets/esri/core/workers/chunks/2640204c4655aa535ccb.js +0 -1
  157. package/assets/esri/core/workers/chunks/2bf42d060f877566b989.js +0 -1
  158. package/assets/esri/core/workers/chunks/34ec9623a1bece86a82b.js +0 -1
  159. package/assets/esri/core/workers/chunks/3bf52139340827794c3b.js +0 -1
  160. package/assets/esri/core/workers/chunks/52d02021e858820bc4fa.js +0 -1
  161. package/assets/esri/core/workers/chunks/64b8f65e2ef6cbf08380.js +0 -1
  162. package/assets/esri/core/workers/chunks/78aede1e114deefacb54.js +0 -1
  163. package/assets/esri/core/workers/chunks/7ef100158ca28631fcaf.js +0 -1
  164. package/assets/esri/core/workers/chunks/93ad67930aa7d4a4b0ac.js +0 -1
  165. package/assets/esri/core/workers/chunks/964795dfb57f0d0635d0.js +0 -1
  166. package/assets/esri/core/workers/chunks/99ce0a202dcd3d7dc290.js +0 -1
  167. package/assets/esri/core/workers/chunks/abe6c99a1a719543dbe8.js +0 -1
  168. package/assets/esri/core/workers/chunks/c3bf44146fddfe8990f7.js +0 -1
  169. package/assets/esri/core/workers/chunks/cbe817e966b57599bafd.js +0 -1
  170. package/assets/esri/core/workers/chunks/e15b5d7e46a834eacc57.js +0 -1
  171. package/assets/esri/core/workers/chunks/e1e0b3580e2c3098c9f4.js +0 -1
  172. package/assets/esri/core/workers/chunks/e305d20e4424451cab5b.js +0 -1
  173. package/assets/esri/core/workers/chunks/e6836c84470fb6bd25bf.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import t from"../../../../core/Logger.js";import{B as e,m as a,c as r,f as s,a as o}from"../../../../chunks/mat4.js";import{c as i}from"../../../../chunks/mat4f64.js";import{g as n}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import{perObjectElevationAligner as l}from"./ElevationAligners.js";import{evaluateElevationInfoAtPoint as f}from"./elevationAlignmentUtils.js";import{setContextFeature as c}from"./featureExpressionInfoUtils.js";import{Graphics3DObject3DGraphicLayer as h}from"./Graphics3DObject3DGraphicLayer.js";t.getLogger("esri.views.3d.layers.graphics.Graphics3DMeshObject3DGraphicLayer");class g extends h{constructor(){super(...arguments),this._originalGeometries=[],this._fastTransformUpdatesEnabled=!1}get fastTransformUpdatesEnabled(){return this._fastTransformUpdatesEnabled}enableFastTransformUpdates(t,a){if(this._fastTransformUpdatesEnabled)return;this._fastTransformUpdatesEnabled=!0;const{stageObject:r}=this,s=r.geometries.slice();r.removeAllGeometries();const o=e(d,r.transformation),i=a.getOrigin(o);for(const e of s){const a=t(e.material),s=e.instantiate({material:a});s.localOrigin=i,r.addGeometry(s)}this._originalGeometries=s}disableFastTransformUpdates(t){if(!this._fastTransformUpdatesEnabled)return;this._fastTransformUpdatesEnabled=!1;const{stageObject:e}=this,a=e.geometries.map((e=>t(e.material)));e.removeAllGeometries();for(let r=0;r<this._originalGeometries.length;r++){const t=this._originalGeometries[r],s=a[r];s.setParameters({modelTransformation:null}),s===t.material?e.addGeometry(t):e.addGeometry(t.instantiate({material:s}))}this._originalGeometries.length=0}updateFastLocalOrigin(t,a,r){if(!this._fastTransformUpdatesEnabled)return;const{stageObject:s}=this;if(0===s.geometries.length)return;const o=s.geometries[0].localOrigin,i=e(d,t),n=r.getOrigin(i);n!==o&&(s.clearShaderTransformation(),s.transformation=t,s.geometries.forEach((t=>{t.transformation=a.localMatrix,t.localOrigin=n})))}updateTransform(t,e,r){const{stageObject:s}=this;if(!this._fastTransformUpdatesEnabled)return s.clearShaderTransformation(),s.transformation=t,void s.geometries.forEach((t=>{t.transformation=e.localMatrix}));const o=s.transformation,i=s.geometries[0].transformation,n=t,m=e.localMatrix,l=a(p,o,i),f=a(T,n,m);s.shaderTransformation=n,this._setFastMaterialTransformation({matA:l,matB:f});const c=()=>m;for(const a of s.geometries)a.shaderTransformer=c;this.resetEdgeObject(r)}alignWithElevation(t,e,s,o){if(!this._fastTransformUpdatesEnabled)return void super.alignWithElevation(t,e,s,o);null!=s&&c(this.elevationContext.featureExpressionInfoContext,s);const i=(a,r)=>f(a,t,this.elevationContext,e,r),{stageObject:n}=this;if(!n.geometries[0].material.parameters.modelTransformation)return;const m=n.transformation,h=n.geometries[0].transformation,g=a(p,m,h),d=r(b,n.shaderTransformation);this.alignedSampledElevation=l(this,this.elevationContext,t.spatialReference,i,e,d),n.shaderTransformation=d;const u=n.geometries[0].shaderTransformation,j=a(T,d,u);this._setFastMaterialTransformation({matA:g,matB:j}),this.resetEdgeObject(o)}_setFastMaterialTransformation({matA:t,matB:e}){const{stageObject:r}=this;if(0===r.geometries.length)return;const i=r.geometries[0].localOrigin,m=s(E,n(d,i.vec3,-1)),l=a(u,m,t),f=a(j,m,e),c=o(u,l),h=a(j,f,c);for(const a of r.geometries)a.material.setParameters({modelTransformation:h})}}const d=m(),p=i(),T=i(),b=i(),u=i(),j=i(),E=i();export{g as Graphics3DMeshObject3DGraphicLayer};
5
+ import"../../../../core/has.js";import t from"../../../../core/Logger.js";import{B as e,m as r,c as a,f as s,a as o}from"../../../../chunks/mat4.js";import{I as i,c as n}from"../../../../chunks/mat4f64.js";import{g as m}from"../../../../chunks/vec3.js";import{c as f}from"../../../../chunks/vec3f64.js";import{perObjectElevationAligner as l}from"./ElevationAligners.js";import{evaluateElevationInfoAtPoint as c}from"./elevationAlignmentUtils.js";import{setContextFeature as h}from"./featureExpressionInfoUtils.js";import{Graphics3DObject3DGraphicLayer as g}from"./Graphics3DObject3DGraphicLayer.js";t.getLogger("esri.views.3d.layers.graphics.Graphics3DMeshObject3DGraphicLayer");class d extends g{constructor(){super(...arguments),this._originalGeometries=[],this._fastTransformUpdatesEnabled=!1}get fastTransformUpdatesEnabled(){return this._fastTransformUpdatesEnabled}enableFastTransformUpdates(t,r){if(this._fastTransformUpdatesEnabled)return;this._fastTransformUpdatesEnabled=!0;const{stageObject:a}=this,s=a.geometries.slice();a.removeAllGeometries();const o=e(p,a.transformation),i=r.getOrigin(o);for(const e of s){const r=t(e.material),s=e.instantiate({material:r});s.localOrigin=i,a.addGeometry(s)}this._originalGeometries=s}disableFastTransformUpdates(t){if(!this._fastTransformUpdatesEnabled)return;this._fastTransformUpdatesEnabled=!1;const{stageObject:e}=this,r=e.geometries.map((e=>t(e.material)));e.removeAllGeometries();for(let a=0;a<this._originalGeometries.length;a++){const t=this._originalGeometries[a],s=r[a];s.setParameters({modelTransformation:null}),s===t.material?e.addGeometry(t):e.addGeometry(t.instantiate({material:s}))}this._originalGeometries.length=0}updateFastLocalOrigin(t,r,a){if(!this._fastTransformUpdatesEnabled)return;const{stageObject:s}=this;if(0===s.geometries.length)return;const o=s.geometries[0].localOrigin,n=e(p,t),m=a.getOrigin(n);if(m===o)return;const f=r?.localMatrix??i;s.clearShaderTransformation(),s.transformation=t,s.geometries.forEach((t=>{t.transformation=f,t.localOrigin=m}))}updateTransform(t,e,a){const{stageObject:s}=this,o=e?.localMatrix??i;if(!this._fastTransformUpdatesEnabled)return s.clearShaderTransformation(),s.transformation=t,s.geometries.forEach((t=>{t.transformation=o})),void this.resetEdgeObject(a);const n=s.transformation,m=s.geometries[0].transformation,f=t,l=o,c=r(T,n,m),h=r(b,f,l);s.shaderTransformation=f,this._setFastMaterialTransformation({matA:c,matB:h});const g=()=>l;for(const r of s.geometries)r.shaderTransformer=g;this.resetEdgeObject(a)}alignWithElevation(t,e,s,o){if(!this._fastTransformUpdatesEnabled)return void super.alignWithElevation(t,e,s,o);null!=s&&h(this.elevationContext.featureExpressionInfoContext,s);const i=(r,a)=>c(r,t,this.elevationContext,e,a),{stageObject:n}=this;if(!n.geometries[0].material.parameters.modelTransformation)return;const m=n.transformation,f=n.geometries[0].transformation,g=r(T,m,f),d=a(u,n.shaderTransformation);this.alignedSampledElevation=l(this,this.elevationContext,t.spatialReference,i,e,d),n.shaderTransformation=d;const p=n.geometries[0].shaderTransformation,j=r(b,d,p);this._setFastMaterialTransformation({matA:g,matB:j}),this.resetEdgeObject(o)}_setFastMaterialTransformation({matA:t,matB:e}){const{stageObject:a}=this;if(0===a.geometries.length)return;const i=a.geometries[0].localOrigin,n=s(O,m(p,i.vec3,-1)),f=r(j,n,t),l=r(E,n,e),c=o(j,f),h=r(E,l,c);for(const r of a.geometries)r.material.setParameters({modelTransformation:h})}}const p=f(),T=n(),b=n(),u=n(),j=n(),E=n(),O=n();export{d as Graphics3DMeshObject3DGraphicLayer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import t from"../../../../core/Error.js";import{generateUUID as o}from"../../../../core/uuid.js";import{projectBoundingSphere as n,canProjectWithoutEngine as r,isLoaded as s,load as a,projectBuffer as l}from"../../../../geometry/projection.js";import{newDoubleArray as i}from"../../../../geometry/support/DoubleArray.js";import{k as u}from"../../../../chunks/sphere.js";import{loadImageAsync as d}from"../../../../support/requestUtils.js";import{EncodedMeshTexture as c}from"../../glTF/internal/resourceUtils.js";import{TextureUsage as m,TextureEncoding as h}from"./enums.js";import{hasAdvancedMaterialParameters as f}from"./I3SMaterialUtil.js";import{CullFaceOptions as p}from"../../webgl-engine/lib/basicInterfaces.js";class x{constructor(e,t){this._id2Meta=new Map,this._oid2Meta=new Map,this._nextMeshNodeId=2,this._indexSR=e,this._renderSR=t}get indexSR(){return this._indexSR}get renderSR(){return this._renderSR}createMeshNodeInfo(e,t){const r="mesh"+this._nextMeshNodeId++,s=e.extent,a=s.spatialReference,l=this._indexSR,i=g(s,e.origin);n(i,a,i,l);return{type:"mesh",id:r,version:o(),oid:t,mbs:i,componentNodeIds:[],mesh:e,nodeIndex:null}}addMeshNode(e,t){t.nodeIndex=e,this._id2Meta.set(t.id,t),this._oid2Meta.set(t.oid,t)}getMeshNodeIndex(e){const t=this._oid2Meta.get(e);return null==t||"mesh"!==t.type?null:t.nodeIndex}removeNode(e){if(null==e)return;const t=this._id2Meta.get(e);null!=t&&(this._id2Meta.delete(e),"mesh"===t.type&&this._oid2Meta.delete(t.oid))}async loadNodeJSON(e){const o=this._id2Meta.get(e);if(null==o)throw new t(`I3SClientNodeLoader::loadNodeJSON unable to find node ${e}`);switch(o.type){case"mesh":return this._loadMeshNodeJSON(o);case"mesh-component":return this._loadMeshComponentNodeJSON(o);default:throw new t(`I3SClientNodeLoader::loadNodeJSON unable to handle node ${e}`)}}async _loadMeshNodeJSON(e){const t=e.id,o=await e.mesh.load();if(null==o.components)return{id:t,version:null,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null};const n=[];let r=0;for(const s of o.components){const o=`${t}-component${r++}`,a={type:"mesh-component",id:o,mbs:e.mbs,component:s,meshNodeInfo:e,textureData:new Map};this._id2Meta.set(a.id,a),e.componentNodeIds.push(o),n.push({id:a.id,href:null,mbs:a.mbs,obb:null})}return{id:t,version:null,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:n}}updateNodeIndex(e,t,o){if(null==e)return;const n=this._id2Meta.get(e);n&&"mesh"===n.type&&(n.nodeIndex=o)}async _loadMeshComponentNodeJSON(e){return{id:e.id,version:e.meshNodeInfo.version,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null,isEmpty:!1}}async loadNodeData(e,o){const n=e.id,u=this._id2Meta.get(n);if(null==u||"mesh-component"!==u.type)throw new t(`Failed to load client node data for node ${e.id} (unexpected node info)`);const d=u.meshNodeInfo.mesh,c=u.meshNodeInfo.oid,m=u.component,{material:h,requiredTextures:f,textureData:p}=await y(m.material);if(null!=p)for(const t of p)null!=t&&u.textureData.set(t.id,t);const x={params:{material:h},type:"ArrayBufferView"},g=d.origin,b={featureDataPosition:[g.x,g.y,g.z],featureIds:[],geometries:[x]},w={attributeData:{},loadedAttributes:[]},I=d.vertexAttributes.position;let N=null;null!=d.transform?N=d.transform.project(I,this._indexSR):(r(d.spatialReference,this._indexSR)||s()||await a(),N=i(I.length),l(I,d.spatialReference,0,N,this._indexSR,0,N.length/3));for(let t=0;t<N.length;t+=3)N[t]-=g.x,N[t+1]-=g.y,N[t+2]-=g.z;const{geometryBuffer:T,geometryDescriptor:R}=M(N,m.faces,d.vertexAttributes.normal,d.vertexAttributes.uv,d.vertexAttributes.color,c);return{geometryData:b,attributeDataInfo:w,geometryBuffer:T,geometryDescriptor:R,requiredTextures:f,textureData:p}}async loadTextures(e,t,o){const n=e.id,r=this._id2Meta.get(n);if(null==r||"mesh-component"!==r.type)throw new Error(`Failed to load textures for node ${e.id} (unexpected node info)`);const s=[];for(const a of t)s.push(r.textureData.get(a.id)||null);return s}}function g(e,t){const o=[1,-1],n=[.5*e.width,.5*e.height,e.hasZ?.5*(e.zmax-e.zmin):0],r=e.center;let s=0;if(e.hasZ)for(let a=0;a<2;++a)for(let e=0;e<2;++e)for(let l=0;l<2;++l){const i=r.x+o[a]*n[0]-t.x,u=r.y+o[e]*n[1]-t.y,d=r.z+o[l]*n[2]-t.z;s=Math.max(i*i+u*u+d*d,s)}else for(let a=0;a<2;++a)for(let e=0;e<2;++e){const l=r.x+o[a]*n[0]-t.x,i=r.y+o[e]*n[1]-t.y;s=Math.max(l*l+i*i,s)}return u([t.x,t.y,t.z],Math.sqrt(s))}async function y(t){const o=[],n=[];if(null==t){return{material:{alphaMode:"opaque",alphaCutoff:.1,doubleSided:!0,cullFace:0,normalTextureId:-1,emissiveTextureId:-1,occlusionTextureId:-1,emissiveFactor:[0,0,0],metallicRoughness:{baseColorFactor:[1,1,1,1],baseColorTextureId:-1,metallicRoughnessTextureId:-1,metallicFactor:0,roughnessFactor:.6000000238418579},wrapTextures:!1,hasParametersFromSource:!0},requiredTextures:o,textureData:n}}const r=w(t);"auto"===t.alphaMode&&console.warn('alphaMode "auto" not supported by I3S PBRMaterial - defaulting to "blend".');return{material:{alphaMode:"auto"===t.alphaMode?"blend":t.alphaMode,alphaCutoff:t.alphaCutoff,doubleSided:t.doubleSided,cullFace:t.doubleSided?p.None:p.Back,normalTextureId:await b(t.normalTexture,o,n,m.Normal),emissiveTextureId:r?await b(t.emissiveTexture,o,n,m.Emissive):-1,occlusionTextureId:r?await b(t.occlusionTexture,o,n,m.Occlusion):-1,emissiveFactor:r&&null!=t.emissiveColor?e.toUnitRGB(t.emissiveColor):[0,0,0],metallicRoughness:{baseColorFactor:null!=t.color?e.toUnitRGBA(t.color):[1,1,1,1],baseColorTextureId:await b(t.colorTexture,o,n,m.Color),metallicRoughnessTextureId:r?await b(t.metallicRoughnessTexture,o,n,m.MetallicRoughness):-1,metallicFactor:r?t.metallic:0,roughnessFactor:r?t.roughness:0},wrapTextures:!0,hasParametersFromSource:!f({normalTexture:t.normalTexture,emissiveTexture:r?t.emissiveTexture:null,occlusionTexture:r?t.occlusionTexture:null,metallicRoughnessTexture:r?t.metallicRoughnessTexture:null,metallicFactor:r?t.metallic:null,roughnessFactor:r?t.roughness:null})},requiredTextures:o,textureData:n}}async function b(e,o,n,r){if(null==e)return-1;const s=e.data,a=e.url;if(null!=s){if(s instanceof HTMLImageElement||s instanceof HTMLCanvasElement){const e=n.length;return n.push({id:e,usage:r,data:s,encoding:h.PNG,downsampled:!1}),o.push({id:e,usage:r,encodings:[{name:void 0,encoding:h.PNG}]}),e}if(s instanceof HTMLVideoElement)return-1;if(s instanceof ImageData)throw new t("ImageData textures not supported yet for client side I3S nodes");if(s instanceof c)throw new t("EncodedMeshTexture textures not supported yet for client side I3S nodes")}else if(null!=a){const e=new Image;e.src=a;const t=await d(e,e.src,!1,void 0),s=n.length;return n.push({id:s,usage:r,data:t,encoding:h.PNG,downsampled:!1}),o.push({id:s,usage:r,encodings:[{name:void 0,encoding:h.PNG}]}),s}return-1}function w(e){return e.hasOwnProperty("metallicRoughnessTexture")}function M(e,t,o,n,r,s){const a=1,l=t.length/3,i=3*l;let u=0,d=0,c=!1,m=0,h=!1,f=0,p=!1,x=0,g=0,y=0;u+=N,u+=N,d=u,u+=3*i*T,null!=o&&(c=!0,m=u,u+=3*i*T),null!=n&&(h=!0,f=u,u+=2*i*T),null!=r&&(p=!0,x=u,u+=4*i*R),g=u,u+=a*S,y=u,u+=2*a*N;const b=new ArrayBuffer(u),w=new Uint8Array(b);I(w,0,i),I(w,N,a);const M=new Float32Array(b,d),D=null!=o?new Float32Array(b,m):null,v=null!=n?new Float32Array(b,f):null,_=null!=r?new Uint8Array(b,x):null;for(let I=0;I<l;++I){const s=3*I;for(let a=0;a<3;++a){const l=t[s+a],i=3*l,u=9*I+3*a;if(M[u]=e[i],M[u+1]=e[i+1],M[u+2]=e[i+2],null!=D&&(D[u]=o[i],D[u+1]=o[i+1],D[u+2]=o[i+2]),null!=v){const e=2*l,t=6*I+2*a;v[t]=n[e],v[t+1]=n[e+1]}if(null!=_){const e=4*l,t=12*I+4*a;_[t]=r[e],_[t+1]=r[e+1],_[t+2]=r[e+2],_[t+3]=r[e+3]}}}I(w,g,s),I(w,g+N,s/2**32),I(w,y,0),I(w,y+N,l-1);return{geometryBuffer:b,geometryDescriptor:{isDraco:!1,isLegacy:!0,color:p,normal:c,uv0:h,uvRegion:!1,featureIndex:!0}}}function I(e,t,o){e[t]=255&o,e[t+1]=255&o>>8,e[t+2]=255&o>>16,e[t+3]=255&o>>24}const N=4,T=4,R=1,S=8;export{x as I3SClientNodeLoader,M as createGeometryData};
5
+ import e from"../../../../Color.js";import t from"../../../../core/Error.js";import{generateUUID as o}from"../../../../core/uuid.js";import{projectBoundingSphere as n,canProjectWithoutEngine as r,isLoaded as s,load as a,projectBuffer as l}from"../../../../geometry/projection.js";import{newDoubleArray as i}from"../../../../geometry/support/DoubleArray.js";import{k as u}from"../../../../chunks/sphere.js";import{project as d}from"../../../../geometry/support/meshUtils/georeference.js";import{loadImageAsync as c}from"../../../../support/requestUtils.js";import{EncodedMeshTexture as m}from"../../glTF/internal/resourceUtils.js";import{TextureUsage as h,TextureEncoding as f}from"./enums.js";import{hasAdvancedMaterialParameters as p}from"./I3SMaterialUtil.js";import{CullFaceOptions as x}from"../../webgl-engine/lib/basicInterfaces.js";class g{constructor(e,t){this._id2Meta=new Map,this._oid2Meta=new Map,this._nextMeshNodeId=2,this._indexSR=e,this._renderSR=t}get indexSR(){return this._indexSR}get renderSR(){return this._renderSR}createMeshNodeInfo(e,t){const r="mesh"+this._nextMeshNodeId++,s=e.extent,a=s.spatialReference,l=this._indexSR,i=y(s,e.origin);n(i,a,i,l);return{type:"mesh",id:r,version:o(),oid:t,mbs:i,componentNodeIds:[],mesh:e,nodeIndex:null}}addMeshNode(e,t){t.nodeIndex=e,this._id2Meta.set(t.id,t),this._oid2Meta.set(t.oid,t)}getMeshNodeIndex(e){const t=this._oid2Meta.get(e);return null==t||"mesh"!==t.type?null:t.nodeIndex}removeNode(e){if(null==e)return;const t=this._id2Meta.get(e);null!=t&&(this._id2Meta.delete(e),"mesh"===t.type&&this._oid2Meta.delete(t.oid))}async loadNodeJSON(e){const o=this._id2Meta.get(e);if(null==o)throw new t(`I3SClientNodeLoader::loadNodeJSON unable to find node ${e}`);switch(o.type){case"mesh":return this._loadMeshNodeJSON(o);case"mesh-component":return this._loadMeshComponentNodeJSON(o);default:throw new t(`I3SClientNodeLoader::loadNodeJSON unable to handle node ${e}`)}}async _loadMeshNodeJSON(e){const t=e.id,o=await e.mesh.load();if(null==o.components)return{id:t,version:null,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null};const n=[];let r=0;for(const s of o.components){const o=`${t}-component${r++}`,a={type:"mesh-component",id:o,mbs:e.mbs,component:s,meshNodeInfo:e,textureData:new Map};this._id2Meta.set(a.id,a),e.componentNodeIds.push(o),n.push({id:a.id,href:null,mbs:a.mbs,obb:null})}return{id:t,version:null,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:n}}updateNodeIndex(e,t,o){if(null==e)return;const n=this._id2Meta.get(e);n&&"mesh"===n.type&&(n.nodeIndex=o)}async _loadMeshComponentNodeJSON(e){return{id:e.id,version:e.meshNodeInfo.version,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null,isEmpty:!1}}async loadNodeData(e,o){const n=e.id,u=this._id2Meta.get(n);if(null==u||"mesh-component"!==u.type)throw new t(`Failed to load client node data for node ${e.id} (unexpected node info)`);const c=u.meshNodeInfo.mesh,m=u.meshNodeInfo.oid,h=u.component,{material:f,requiredTextures:p,textureData:x}=await b(h.material);if(null!=x)for(const t of x)null!=t&&u.textureData.set(t.id,t);const g={params:{material:f},type:"ArrayBufferView"},{vertexSpace:y,origin:w,transform:M}=c,N={featureDataPosition:[w.x,w.y,w.z??0],featureIds:[],geometries:[g]},T={attributeData:{},loadedAttributes:[]},R=c.vertexAttributes.position;let S=null;y.isRelative?S=d(M,y,R,this._indexSR):(r(c.spatialReference,this._indexSR)||s()||await a(),S=i(R.length),l(R,c.spatialReference,0,S,this._indexSR,0,S.length/3));for(let t=0;t<S.length;t+=3)S[t]-=w.x,S[t+1]-=w.y,S[t+2]-=w.z??0;const{geometryBuffer:v,geometryDescriptor:D}=I(S,h.faces,c.vertexAttributes.normal,c.vertexAttributes.uv,c.vertexAttributes.color,m);return{geometryData:N,attributeDataInfo:T,geometryBuffer:v,geometryDescriptor:D,requiredTextures:p,textureData:x}}async loadTextures(e,t,o){const n=e.id,r=this._id2Meta.get(n);if(null==r||"mesh-component"!==r.type)throw new Error(`Failed to load textures for node ${e.id} (unexpected node info)`);const s=[];for(const a of t)s.push(r.textureData.get(a.id)||null);return s}}function y(e,t){const o=[1,-1],n=[.5*e.width,.5*e.height,e.hasZ?.5*(e.zmax-e.zmin):0],r=e.center;let s=0;if(e.hasZ)for(let a=0;a<2;++a)for(let e=0;e<2;++e)for(let l=0;l<2;++l){const i=r.x+o[a]*n[0]-t.x,u=r.y+o[e]*n[1]-t.y,d=r.z+o[l]*n[2]-t.z;s=Math.max(i*i+u*u+d*d,s)}else for(let a=0;a<2;++a)for(let e=0;e<2;++e){const l=r.x+o[a]*n[0]-t.x,i=r.y+o[e]*n[1]-t.y;s=Math.max(l*l+i*i,s)}return u([t.x,t.y,t.z],Math.sqrt(s))}async function b(t){const o=[],n=[];if(null==t){return{material:{alphaMode:"opaque",alphaCutoff:.1,doubleSided:!0,cullFace:0,normalTextureId:-1,emissiveTextureId:-1,occlusionTextureId:-1,emissiveFactor:[0,0,0],metallicRoughness:{baseColorFactor:[1,1,1,1],baseColorTextureId:-1,metallicRoughnessTextureId:-1,metallicFactor:0,roughnessFactor:.6000000238418579},wrapTextures:!1,hasParametersFromSource:!0},requiredTextures:o,textureData:n}}const r=M(t);"auto"===t.alphaMode&&console.warn('alphaMode "auto" not supported by I3S PBRMaterial - defaulting to "blend".');return{material:{alphaMode:"auto"===t.alphaMode?"blend":t.alphaMode,alphaCutoff:t.alphaCutoff,doubleSided:t.doubleSided,cullFace:t.doubleSided?x.None:x.Back,normalTextureId:await w(t.normalTexture,o,n,h.Normal),emissiveTextureId:r?await w(t.emissiveTexture,o,n,h.Emissive):-1,occlusionTextureId:r?await w(t.occlusionTexture,o,n,h.Occlusion):-1,emissiveFactor:r&&null!=t.emissiveColor?e.toUnitRGB(t.emissiveColor):[0,0,0],metallicRoughness:{baseColorFactor:null!=t.color?e.toUnitRGBA(t.color):[1,1,1,1],baseColorTextureId:await w(t.colorTexture,o,n,h.Color),metallicRoughnessTextureId:r?await w(t.metallicRoughnessTexture,o,n,h.MetallicRoughness):-1,metallicFactor:r?t.metallic:0,roughnessFactor:r?t.roughness:0},wrapTextures:!0,hasParametersFromSource:!p({normalTexture:t.normalTexture,emissiveTexture:r?t.emissiveTexture:null,occlusionTexture:r?t.occlusionTexture:null,metallicRoughnessTexture:r?t.metallicRoughnessTexture:null,metallicFactor:r?t.metallic:null,roughnessFactor:r?t.roughness:null})},requiredTextures:o,textureData:n}}async function w(e,o,n,r){if(null==e)return-1;const s=e.data,a=e.url;if(null!=s){if(s instanceof HTMLImageElement||s instanceof HTMLCanvasElement){const e=n.length;return n.push({id:e,usage:r,data:s,encoding:f.PNG,downsampled:!1}),o.push({id:e,usage:r,encodings:[{name:void 0,encoding:f.PNG}]}),e}if(s instanceof HTMLVideoElement)return-1;if(s instanceof ImageData)throw new t("ImageData textures not supported yet for client side I3S nodes");if(s instanceof m)throw new t("EncodedMeshTexture textures not supported yet for client side I3S nodes")}else if(null!=a){const e=new Image;e.src=a;const t=await c(e,e.src,!1,void 0),s=n.length;return n.push({id:s,usage:r,data:t,encoding:f.PNG,downsampled:!1}),o.push({id:s,usage:r,encodings:[{name:void 0,encoding:f.PNG}]}),s}return-1}function M(e){return e.hasOwnProperty("metallicRoughnessTexture")}function I(e,t,o,n,r,s){const a=1,l=t.length/3,i=3*l;let u=0,d=0,c=!1,m=0,h=!1,f=0,p=!1,x=0,g=0,y=0;u+=T,u+=T,d=u,u+=3*i*R,null!=o&&(c=!0,m=u,u+=3*i*R),null!=n&&(h=!0,f=u,u+=2*i*R),null!=r&&(p=!0,x=u,u+=4*i*S),g=u,u+=a*v,y=u,u+=2*a*T;const b=new ArrayBuffer(u),w=new Uint8Array(b);N(w,0,i),N(w,T,a);const M=new Float32Array(b,d),I=null!=o?new Float32Array(b,m):null,D=null!=n?new Float32Array(b,f):null,_=null!=r?new Uint8Array(b,x):null;for(let N=0;N<l;++N){const s=3*N;for(let a=0;a<3;++a){const l=t[s+a],i=3*l,u=9*N+3*a;if(M[u]=e[i],M[u+1]=e[i+1],M[u+2]=e[i+2],null!=I&&(I[u]=o[i],I[u+1]=o[i+1],I[u+2]=o[i+2]),null!=D){const e=2*l,t=6*N+2*a;D[t]=n[e],D[t+1]=n[e+1]}if(null!=_){const e=4*l,t=12*N+4*a;_[t]=r[e],_[t+1]=r[e+1],_[t+2]=r[e+2],_[t+3]=r[e+3]}}}N(w,g,s),N(w,g+T,s/2**32),N(w,y,0),N(w,y+T,l-1);return{geometryBuffer:b,geometryDescriptor:{isDraco:!1,isLegacy:!0,color:p,normal:c,uv0:h,uvRegion:!1,featureIndex:!0}}}function N(e,t,o){e[t]=255&o,e[t+1]=255&o>>8,e[t+2]=255&o>>16,e[t+3]=255&o>>24}const T=4,R=4,S=1,v=8;export{g as I3SClientNodeLoader,I as createGeometryData};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../request.js";import s from"../../../../core/Accessor.js";import{splitIntoChunks as i}from"../../../../core/arrayUtils.js";import{resultOrAbort as r,result as n}from"../../../../core/asyncUtils.js";import{estimateStringByteSize as o,estimateNumberByteSize as a}from"../../../../core/byteSizeEstimations.js";import d from"../../../../core/Collection.js";import c from"../../../../core/Logger.js";import{destroyMaybe as h,abortMaybe as l}from"../../../../core/maybe.js";import{whenOrAbort as u}from"../../../../core/promiseUtils.js";import{watch as m,initial as g}from"../../../../core/reactiveUtils.js";import{property as y}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/has.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import{formatNumber as _}from"../../../../intl/number.js";import{getMaximumQuerySize as b,queryAllJSON as f}from"../../../../layers/support/featureQueryAll.js";import{assetMapFromAssetMapsJSON as O,extractMesh as C}from"../../../../rest/support/meshFeatureSet.js";import{direct3DObjectFeatureLayerDisplayEnabled as j,i3sPatchingEnabled as I,sceneLayerEditingEnabled as v}from"../../../../support/featureFlags.js";import F from"../FeatureLayerView3D.js";let A=class extends s{constructor(e){super(e),this._warnMaximumChangedObjectsExceeded=!1,this._maximumNumberOfEditOVerrides=G,this._original3DOFLDefinitionExpression=null,this._interactiveEditingSessions=new d,this.geometryOverrides=new d,this._clientGeometryCache=new Map,this._associatedLayerView=null,this._attributeChangedObjectIds=new Set,this._geometryChangedObjectIds=new Set,this._pendingFetchChangedObjectIds=null,this._pendingFetchAbortController=new AbortController}initialize(){this._memCache=this.memoryController.newCache(`i3s-attribute-overrides-${this.layer.uid}`),this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds(this._pendingFetchAbortController?.signal),this._pendingFetchChangedObjectIds.then((async()=>{this._pendingFetchAbortController=null,this._pendingFetchChangedObjectIds=null})),this.is3DOFL&&null!=this._associatedLayer&&(j()?this._associatedLayer.load().then((e=>{this.destroyed||(this._original3DOFLDefinitionExpression=e.definitionExpression,this.addHandles(m((()=>this._definitionExpression),(t=>e.definitionExpression=t),g)),this._associatedLayerView=new F({layer:this._associatedLayer,view:this.view}))})):I())}destroy(){this.is3DOFL&&null!=this._associatedLayer&&(j()?null!=this._associatedLayerView&&(this._associatedLayer.definitionExpression=this._original3DOFLDefinitionExpression):I()),this._set("layer",null),this._memCache=h(this._memCache),this._pendingFetchAbortController=l(this._pendingFetchAbortController),this._pendingFetchChangedObjectIds=null}get is3DOFL(){return v()&&null!=this._associatedLayer&&null!=this._associatedLayer.infoFor3D}get sortedGeometryChangedObjectIds(){return this.is3DOFL?[...this._geometryChangedObjectIds].sort(((e,t)=>e-t)):[]}get editSessionGeometryChangedObjectIds(){return this.is3DOFL?this._interactiveEditingSessions.toArray().filter((e=>e.isActive)).map((e=>e.objectId)).sort(((e,t)=>e-t)):[]}get _associatedLayer(){return null==this.layer?null:this.layer.associatedLayer}get _definitionExpression(){const e=this.sortedGeometryChangedObjectIds;return 0===e.length?"1 = 0":`OBJECTID IN (${e.join(",")})`}get updating(){if(!this.is3DOFL)return!1;if(j()){return!(null!=this._associatedLayerView)||null!=this._associatedLayerView&&this._associatedLayerView.updating}return I(),!1}get isEmpty(){return null==this._pendingFetchChangedObjectIds&&0===this._attributeChangedObjectIds.size&&0===this._geometryChangedObjectIds.size}createInteractiveEditSession(e){this._attributeChangedObjectIds.add(e),this.notifyChange("_attributeChangedObjectIds");const t=v()&&I()&&null!=this.is3DOFL,s=this._clientGeometryCache.get(e);t&&(this._geometryChangedObjectIds.add(e),this.notifyChange("_geometryChangedObjectIds"));const i=this._interactiveEditingSessions,r=new L(e,{rollback:()=>{i.remove(r),t&&this.updateGeometry(e,null!=s?s.mesh:null)},commit:(s,i)=>{for(const[t,r]of s)this.updateAttributeValue(e,t,r);t&&void 0!==i&&this.updateGeometry(e,i),this.notifyChange("editSessionGeometryChangedObjectIds")}});return i.unshift(r),r}async applyAttributeOverrides(e,t,s){if(null==t)return;const{loadedAttributes:i,attributeData:r}=t;if(null==i||0===i.length||null==r)return;if(this._pendingFetchChangedObjectIds&&await u(this._pendingFetchChangedObjectIds,s),0===this._attributeChangedObjectIds.size)return;const n={loadedAttributes:i,attributeData:r},o=this._getOverridesFromCache(e,n,this._attributeChangedObjectIds),{objectIds:a,fieldNames:d}=o;if(0===a.length||0===d.length)return;const c=await this._queryOverridesFromAssociatedLayer(a,d,!1,s);null!=c&&this._processOverridesFromAssociatedLayer(e,c,d,n)}updateGeometry(e,t){this._geometryChangedObjectIds.add(e);const s=this._clientGeometryCache.get(e);if(null!=s&&(this.geometryOverrides.remove(s),this._clientGeometryCache.delete(e)),null!=t){const s={oid:e,mesh:t};this.geometryOverrides.add(s),this._clientGeometryCache.set(e,s)}this.notifyChange("_geometryChangedObjectIds")}updateAttributeValue(e,t,s){this._attributeChangedObjectIds.add(e),this._cacheAttributeValue(e,t,s),this.notifyChange("_attributeChangedObjectIds")}_cacheAttributeValue(e,t,s){this._memCache.put(this._getAttributeCacheKey(e,t),s,this._memCacheAttributeValueSize(s))}_cacheGeometry(e,t){this._memCache.put(this._getGeometryCacheKey(e),t,this._memCacheGeometrySize(t))}_getOverridesFromCache(e,{loadedAttributes:t,attributeData:s},i){const r=new Set,n=new Array;if(this.is3DOFL&&0===Object.keys(s).length)return{objectIds:Array.from(e),fieldNames:t.map((e=>e.name))};for(const a of t)n[a.index]=s[a.name];const o=new Set;for(let a=0;a<e.length;a++){const s=e[a];if(i.has(s))for(const e of t){const t=this._attributeFromCache(s,e.index);void 0===t?(r.add(s),o.add(e.name)):n[e.index][a]=t}}return{objectIds:Array.from(r),fieldNames:Array.from(o)}}_attributeFromCache(e,t){const s=this._fromInteractiveEditingSession(e,t);if(void 0!==s)return s;const i=this._getAttributeCacheKey(e,t);return this._memCache.get(i)}_fromInteractiveEditingSession(e,t){if(null!=this._interactiveEditingSessions)for(const s of this._interactiveEditingSessions){if(s.objectId!==e)continue;const i=s.getAttribute(t);if(void 0!==i)return i}}_getAttributeCacheKey(e,t){return`${e}-${t}`}_getGeometryCacheKey(e){return`${e}-geometry`}async _queryOverridesFromAssociatedLayer(e,t,s,n){if(0===e.length||!1===s&&0===t.length)return null;e=e.sort(((e,t)=>e-t)),this._warnMaximumChangedObjectsExceeded&&(this._warnMaximumChangedObjectsExceeded=!1,this._logMaximumObjectsExceededWarning());const o=this.layer.associatedLayer;if(null==o)return null;const a=s&&this.is3DOFL&&I(),d=[o.objectIdField,...t];a&&null!=o.globalIdField&&d.push(o.globalIdField);const c=o.createQuery();c.where="1=1",c.returnGeometry=s,c.outFields=d,c.cacheHint=!0,c.objectIds=e;const h=b(o),l=e.length>h?i(e,h).map((e=>{const t=c.clone();return t.objectIds=e,r(f(o,t,{signal:n}))})):[r(f(o,c,{signal:n}))],u=await Promise.all(l);if(a&&null!=o.infoFor3D){const e=o.infoFor3D,t=o.spatialReference,s=[];for(const i of u){if(!i.ok)continue;const r=i.value;if(null==r.assetMaps)continue;const n=O(e,r.assetMaps);for(const i of r.features){const o=C(i,r.globalIdFieldName,t,e,n),a=i;null!=o?(a.geometry=o,s.push(a)):a.geometry=null}}return s}return u.reduce(((e,t)=>e.concat(t.ok?t.value.features:[])),[])}_logMaximumObjectsExceededWarning(){let e=`The number of edited objects that are not yet cached in the scene service exceeds the maximum limit. Attribute changes will only be available for the first ${_(this._maximumNumberOfEditOVerrides)} objects. Please consider re-caching the scene service`;const t=this.layer.portalItem;t&&t.loaded?e+=` (${t.portal.url}/home/item.html?id=${t.id}#settings)`:e+=` (${this.layer.parsedUrl.path})`,c.getLogger("esri.views.3d.layers.i3s.I3SOverrides").warn("#queryOverrides()",this.layer.title,`${e}.`)}_processOverridesFromAssociatedLayer(e,t,s,{loadedAttributes:i,attributeData:r}){const n=this._associatedLayer;if(null==n)return;const o=n.objectIdField,a=s.map((t=>(t in r||(r[t]=new Array(e.length)),r[t]))),d=new Map(i.map((e=>[e.name,e.index]))),c=s.map((e=>d.get(e))),h=new Map(Array.from(e,((e,t)=>[e,t])));for(const l of t){const e=l.attributes[o];for(let t=0;t<s.length;t++){const i=c[t],r=h.get(e),n=l.attributes[s[t]];a[t][r]=n,this._cacheAttributeValue(e,i,n)}}}_memCacheAttributeValueSize(e){return"string"==typeof e?o(e):a()}_memCacheGeometrySize(e){return 256}async _fetchChangedObjectIds(e){const s=this.layer;if(await s.load({signal:e}),this._geometryChangedObjectIds.clear(),this._attributeChangedObjectIds.clear(),null==s.associatedLayer||!s.associatedLayer.capabilities?.operations?.supportsChangeTracking)return;const i=this._getFetchChangedObjectIdsServerGen();if(null==i)return;const r=s.associatedLayer.layerId,o=this.is3DOFL,a=await n(t(`${s.associatedLayer.url}/extractChanges`,{method:"post",query:{f:"json",returnIdsOnly:!0,layers:`[${r}]`,returnUpdates:!0,returnDeletes:o,returnInserts:o,layerServerGens:JSON.stringify([{id:r,serverGen:i}])},timeout:w,signal:e}));if(a.ok&&1===a.value.data?.edits?.length){const t=a.value.data.edits[0]?.objectIds,i=t?.adds,r=t?.updates,n=t?.deletes;let o=[];null!=i&&(o=o.concat(i)),null!=r&&(o=o.concat(r)),null!=n&&(o=o.concat(n));const d=Math.min(this._maximumNumberOfEditOVerrides,o.length);d<o.length&&(this._warnMaximumChangedObjectsExceeded=!0);const c=o.sort(((e,t)=>e-t));for(let e=0;e<d;e++)this._attributeChangedObjectIds.add(c[e]),this._geometryChangedObjectIds.add(c[e]);if(this.is3DOFL&&I()&&this._geometryChangedObjectIds.size>0){const t=await this._queryOverridesFromAssociatedLayer(Array.from(this._geometryChangedObjectIds),[],!0,e);if(null!=t)for(const e of t)null!=e.geometry&&this.updateGeometry(e.attributes[s.associatedLayer.objectIdField],e.geometry)}}this.notifyChange("_attributeChangedObjectIds"),this.notifyChange("_geometryChangedObjectIds")}_getFetchChangedObjectIdsServerGen(){const e=this.layer;if(null!=e.serviceUpdateTimeStamp&&null!=e.serviceUpdateTimeStamp.lastUpdate)return e.serviceUpdateTimeStamp.lastUpdate;const t=e.associatedLayer;return null!=t&&null!=t.serverGens&&null!=t.serverGens.minServerGen?t.serverGens.minServerGen:null}get test(){const e=Array.from(this._attributeChangedObjectIds),t=this._pendingFetchChangedObjectIds,s=this;return{changedObjectIds:e,pendingFetchChangedObjectIds:t,get maximumNumberOfEditOVerrides(){return s._maximumNumberOfEditOVerrides},set maximumNumberOfEditOVerrides(e){s._maximumNumberOfEditOVerrides=e}}}};e([y({constructOnly:!0})],A.prototype,"view",void 0),e([y({constructOnly:!0})],A.prototype,"layer",void 0),e([y({readOnly:!0})],A.prototype,"is3DOFL",null),e([y()],A.prototype,"_interactiveEditingSessions",void 0),e([y({readOnly:!0})],A.prototype,"sortedGeometryChangedObjectIds",null),e([y({readOnly:!0})],A.prototype,"editSessionGeometryChangedObjectIds",null),e([y({readOnly:!0})],A.prototype,"geometryOverrides",void 0),e([y()],A.prototype,"_clientGeometryCache",void 0),e([y()],A.prototype,"_associatedLayer",null),e([y()],A.prototype,"_associatedLayerView",void 0),e([y({constructOnly:!0})],A.prototype,"memoryController",void 0),e([y()],A.prototype,"_attributeChangedObjectIds",void 0),e([y()],A.prototype,"_geometryChangedObjectIds",void 0),e([y()],A.prototype,"_pendingFetchChangedObjectIds",void 0),e([y()],A.prototype,"_definitionExpression",null),e([y()],A.prototype,"updating",null),e([y()],A.prototype,"isEmpty",null),A=e([p("esri.views.3d.layers.i3s.I3SOverrides")],A);class L{constructor(e,t){this.objectId=e,this._options=t,this._updates=new Map,this._updatedGeometry=void 0,this._state=E.ACTIVE}getAttribute(e){return this._updates.get(e)}setAttribute(e,t){this.isActive&&this._updates.set(e,t)}getGeometry(){return this._updatedGeometry}setGeometry(e){this.isActive&&(this._updatedGeometry=e)}rollback(){this.isActive&&(this._state=E.ROLLED_BACK,this._options.rollback(),this._updatedGeometry=void 0)}commit(){this.isActive&&(this._state=E.COMMITTED,this._options.commit(this._updates,this._updatedGeometry),this._updates.clear(),this._updatedGeometry=void 0)}get isActive(){return this._state===E.ACTIVE}}var E;!function(e){e[e.ACTIVE=0]="ACTIVE",e[e.COMMITTED=1]="COMMITTED",e[e.ROLLED_BACK=2]="ROLLED_BACK"}(E||(E={}));const w=1e4,G=5e4;export{A as I3SOverrides};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../request.js";import s from"../../../../core/Accessor.js";import{splitIntoChunks as i}from"../../../../core/arrayUtils.js";import{resultOrAbort as r,result as o}from"../../../../core/asyncUtils.js";import{estimateStringByteSize as n,estimateNumberByteSize as a}from"../../../../core/byteSizeEstimations.js";import d from"../../../../core/Collection.js";import c from"../../../../core/Logger.js";import{destroyMaybe as h,abortMaybe as l}from"../../../../core/maybe.js";import{whenOrAbort as u}from"../../../../core/promiseUtils.js";import{watch as m,initial as g}from"../../../../core/reactiveUtils.js";import{property as y}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/has.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import{formatNumber as _}from"../../../../intl/number.js";import{getMaximumQuerySize as b,queryAllJSON as f}from"../../../../layers/support/featureQueryAll.js";import{assetMapFromAssetMapsJSON as O,extractMesh as C}from"../../../../rest/support/meshFeatureSet.js";import{direct3DObjectFeatureLayerDisplayEnabled as j,i3sPatchingEnabled as I,sceneLayerEditingEnabled as v}from"../../../../support/featureFlags.js";import F from"../FeatureLayerView3D.js";let A=class extends s{constructor(e){super(e),this._warnMaximumChangedObjectsExceeded=!1,this._maximumNumberOfEditOVerrides=G,this._original3DOFLDefinitionExpression=null,this._interactiveEditingSessions=new d,this.geometryOverrides=new d,this._clientGeometryCache=new Map,this._associatedLayerView=null,this._attributeChangedObjectIds=new Set,this._geometryChangedObjectIds=new Set,this._pendingFetchChangedObjectIds=null,this._pendingFetchAbortController=new AbortController}initialize(){this._memCache=this.memoryController.newCache(`i3s-attribute-overrides-${this.layer.uid}`),this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds(this._pendingFetchAbortController?.signal),this._pendingFetchChangedObjectIds.then((async()=>{this._pendingFetchAbortController=null,this._pendingFetchChangedObjectIds=null})),this.is3DOFL&&null!=this._associatedLayer&&(j()?this._associatedLayer.load().then((e=>{this.destroyed||(this._original3DOFLDefinitionExpression=e.definitionExpression,this.addHandles(m((()=>this._definitionExpression),(t=>e.definitionExpression=t),g)),this._associatedLayerView=new F({layer:this._associatedLayer,view:this.view}))})):I())}destroy(){this.is3DOFL&&null!=this._associatedLayer&&(j()?null!=this._associatedLayerView&&(this._associatedLayer.definitionExpression=this._original3DOFLDefinitionExpression):I()),this._set("layer",null),this._memCache=h(this._memCache),this._pendingFetchAbortController=l(this._pendingFetchAbortController),this._pendingFetchChangedObjectIds=null}get is3DOFL(){return v()&&null!=this._associatedLayer&&null!=this._associatedLayer.infoFor3D}get sortedGeometryChangedObjectIds(){return this.is3DOFL?[...this._geometryChangedObjectIds].sort(((e,t)=>e-t)):[]}get editSessionGeometryChangedObjectIds(){return this.is3DOFL?this._interactiveEditingSessions.toArray().filter((e=>e.isActive)).map((e=>e.objectId)).sort(((e,t)=>e-t)):[]}get _associatedLayer(){return null==this.layer?null:this.layer.associatedLayer}get _definitionExpression(){const e=this.sortedGeometryChangedObjectIds;return 0===e.length?"1 = 0":`OBJECTID IN (${e.join(",")})`}get updating(){if(!this.is3DOFL)return!1;if(j()){return!(null!=this._associatedLayerView)||null!=this._associatedLayerView&&this._associatedLayerView.updating}return I(),!1}get isEmpty(){return null==this._pendingFetchChangedObjectIds&&0===this._attributeChangedObjectIds.size&&0===this._geometryChangedObjectIds.size}createInteractiveEditSession(e){this._attributeChangedObjectIds.add(e),this.notifyChange("_attributeChangedObjectIds");const t=v()&&I()&&null!=this.is3DOFL,s=this._clientGeometryCache.get(e);t&&(this._geometryChangedObjectIds.add(e),this.notifyChange("_geometryChangedObjectIds"));const i=this._interactiveEditingSessions,r=new L(e,{rollback:()=>{i.remove(r),t&&this.updateGeometry(e,null!=s?s.mesh:null)},commit:(s,i)=>{for(const[t,r]of s)this.updateAttributeValue(e,t,r);t&&void 0!==i&&this.updateGeometry(e,i),this.notifyChange("editSessionGeometryChangedObjectIds")}});return i.unshift(r),r}async applyAttributeOverrides(e,t,s){if(null==t)return;const{loadedAttributes:i,attributeData:r}=t;if(null==i||0===i.length||null==r)return;if(this._pendingFetchChangedObjectIds&&await u(this._pendingFetchChangedObjectIds,s),0===this._attributeChangedObjectIds.size)return;const o={loadedAttributes:i,attributeData:r},n=this._getOverridesFromCache(e,o,this._attributeChangedObjectIds),{objectIds:a,fieldNames:d}=n;if(0===a.length||0===d.length)return;const c=await this._queryOverridesFromAssociatedLayer(a,d,!1,s);null!=c&&this._processOverridesFromAssociatedLayer(e,c,d,o)}updateGeometry(e,t){this._geometryChangedObjectIds.add(e);const s=this._clientGeometryCache.get(e);if(null!=s&&(this.geometryOverrides.remove(s),this._clientGeometryCache.delete(e)),null!=t){const s={oid:e,mesh:t};this.geometryOverrides.add(s),this._clientGeometryCache.set(e,s)}this.notifyChange("_geometryChangedObjectIds")}updateAttributeValue(e,t,s){this._attributeChangedObjectIds.add(e),this._cacheAttributeValue(e,t,s),this.notifyChange("_attributeChangedObjectIds")}_cacheAttributeValue(e,t,s){this._memCache.put(this._getAttributeCacheKey(e,t),s,this._memCacheAttributeValueSize(s))}_cacheGeometry(e,t){this._memCache.put(this._getGeometryCacheKey(e),t,this._memCacheGeometrySize(t))}_getOverridesFromCache(e,{loadedAttributes:t,attributeData:s},i){const r=new Set,o=new Array;if(this.is3DOFL&&0===Object.keys(s).length)return{objectIds:Array.from(e),fieldNames:t.map((e=>e.name))};for(const a of t)o[a.index]=s[a.name];const n=new Set;for(let a=0;a<e.length;a++){const s=e[a];if(i.has(s))for(const e of t){const t=this._attributeFromCache(s,e.index);void 0===t?(r.add(s),n.add(e.name)):o[e.index][a]=t}}return{objectIds:Array.from(r),fieldNames:Array.from(n)}}_attributeFromCache(e,t){const s=this._fromInteractiveEditingSession(e,t);if(void 0!==s)return s;const i=this._getAttributeCacheKey(e,t);return this._memCache.get(i)}_fromInteractiveEditingSession(e,t){if(null!=this._interactiveEditingSessions)for(const s of this._interactiveEditingSessions){if(s.objectId!==e)continue;const i=s.getAttribute(t);if(void 0!==i)return i}}_getAttributeCacheKey(e,t){return`${e}-${t}`}_getGeometryCacheKey(e){return`${e}-geometry`}async _queryOverridesFromAssociatedLayer(e,t,s,o){if(0===e.length||!1===s&&0===t.length)return null;e=e.sort(((e,t)=>e-t)),this._warnMaximumChangedObjectsExceeded&&(this._warnMaximumChangedObjectsExceeded=!1,this._logMaximumObjectsExceededWarning());const n=this.layer.associatedLayer;if(null==n)return null;const a=s&&this.is3DOFL&&I(),d=[n.objectIdField,...t];a&&null!=n.globalIdField&&d.push(n.globalIdField);const c=n.createQuery();c.where="1=1",c.returnGeometry=s,c.outFields=d,c.cacheHint=!0,c.objectIds=e;const h=b(n),l=e.length>h?i(e,h).map((e=>{const t=c.clone();return t.objectIds=e,r(f(n,t,{signal:o}))})):[r(f(n,c,{signal:o}))],u=await Promise.all(l);if(a&&null!=n.infoFor3D){const e=n.infoFor3D,t=n.spatialReference,s=[];for(const i of u){if(!i.ok)continue;const r=i.value;if(null==r.assetMaps)continue;const o=O(e,r.assetMaps);for(const i of r.features){const n=C(i,r.globalIdFieldName,t,e,o),a=i;null!=n?(a.geometry=n,s.push(a)):a.geometry=null}}return s}return u.reduce(((e,t)=>e.concat(t.ok?t.value.features:[])),[])}_logMaximumObjectsExceededWarning(){let e=`The number of edited objects that are not yet cached in the scene service exceeds the maximum limit. Attribute changes will only be available for the first ${_(this._maximumNumberOfEditOVerrides)} objects. Please consider re-caching the scene service`;const t=this.layer.portalItem;t&&t.loaded?e+=` (${t.portal.url}/home/item.html?id=${t.id}#settings)`:e+=` (${this.layer.parsedUrl.path})`,c.getLogger("esri.views.3d.layers.i3s.I3SOverrides").warn("#queryOverrides()",this.layer.title,`${e}.`)}_processOverridesFromAssociatedLayer(e,t,s,{loadedAttributes:i,attributeData:r}){const o=this._associatedLayer;if(null==o)return;const n=o.objectIdField,a=s.map((t=>(t in r||(r[t]=new Array(e.length)),r[t]))),d=new Map(i.map((e=>[e.name,e.index]))),c=s.map((e=>d.get(e))),h=new Map(Array.from(e,((e,t)=>[e,t])));for(const l of t){const e=l.attributes[n];for(let t=0;t<s.length;t++){const i=c[t],r=h.get(e),o=l.attributes[s[t]];a[t][r]=o,this._cacheAttributeValue(e,i,o)}}}_memCacheAttributeValueSize(e){return"string"==typeof e?n(e):a()}_memCacheGeometrySize(e){return 256}async _fetchChangedObjectIds(e){const s=this.layer;await s.load({signal:e}),this._geometryChangedObjectIds.clear(),this._attributeChangedObjectIds.clear();const{associatedLayer:i}=s;if(null==i||!i.capabilities?.operations?.supportsChangeTracking)return;const r=this._getFetchChangedObjectIdsServerGen();if(null==r)return;const n=i.layerId,a=this.is3DOFL,d={f:"json",returnIdsOnly:!0,layers:`[${n}]`,returnUpdates:!0,returnDeletes:a,returnInserts:a,layerServerGens:JSON.stringify([{id:n,serverGen:r}])};if(a){const e=i.infoFor3D;d.fieldsToCompare=JSON.stringify({fields:[...Object.values(e.transformFieldRoles),e.sourceHashField]})}const c=await o(t(`${i.url}/extractChanges`,{method:"post",query:d,timeout:w,signal:e}));if(c.ok&&1===c.value.data?.edits?.length){const t=c.value.data.edits[0],s=t?.objectIds,r=t?.fieldUpdates,o=s?.adds??[],n=s?.updates??[],a=s?.deletes??[],d=[...o,...n,...a],h=[...o,...r??n,...a],l=Math.min(this._maximumNumberOfEditOVerrides,d.length);l<d.length&&(this._warnMaximumChangedObjectsExceeded=!0);const u=d.sort(((e,t)=>e-t));for(let e=0;e<l;++e){const t=u[e];this._attributeChangedObjectIds.add(t)}for(const e of h)this._geometryChangedObjectIds.add(e);if(this.is3DOFL&&I()&&this._geometryChangedObjectIds.size>0){const t=await this._queryOverridesFromAssociatedLayer(Array.from(this._geometryChangedObjectIds),[],!0,e);if(null!=t)for(const e of t)null!=e.geometry&&this.updateGeometry(e.attributes[i.objectIdField],e.geometry)}}this.notifyChange("_attributeChangedObjectIds"),this.notifyChange("_geometryChangedObjectIds")}_getFetchChangedObjectIdsServerGen(){const e=this.layer;if(null!=e.serviceUpdateTimeStamp&&null!=e.serviceUpdateTimeStamp.lastUpdate)return e.serviceUpdateTimeStamp.lastUpdate;const t=e.associatedLayer;return null!=t&&null!=t.serverGens&&null!=t.serverGens.minServerGen?t.serverGens.minServerGen:null}get test(){const e=Array.from(this._attributeChangedObjectIds),t=this._pendingFetchChangedObjectIds,s=this;return{changedObjectIds:e,pendingFetchChangedObjectIds:t,get maximumNumberOfEditOVerrides(){return s._maximumNumberOfEditOVerrides},set maximumNumberOfEditOVerrides(e){s._maximumNumberOfEditOVerrides=e}}}};e([y({constructOnly:!0})],A.prototype,"view",void 0),e([y({constructOnly:!0})],A.prototype,"layer",void 0),e([y({readOnly:!0})],A.prototype,"is3DOFL",null),e([y()],A.prototype,"_interactiveEditingSessions",void 0),e([y({readOnly:!0})],A.prototype,"sortedGeometryChangedObjectIds",null),e([y({readOnly:!0})],A.prototype,"editSessionGeometryChangedObjectIds",null),e([y({readOnly:!0})],A.prototype,"geometryOverrides",void 0),e([y()],A.prototype,"_clientGeometryCache",void 0),e([y()],A.prototype,"_associatedLayer",null),e([y()],A.prototype,"_associatedLayerView",void 0),e([y({constructOnly:!0})],A.prototype,"memoryController",void 0),e([y()],A.prototype,"_attributeChangedObjectIds",void 0),e([y()],A.prototype,"_geometryChangedObjectIds",void 0),e([y()],A.prototype,"_pendingFetchChangedObjectIds",void 0),e([y()],A.prototype,"_definitionExpression",null),e([y()],A.prototype,"updating",null),e([y()],A.prototype,"isEmpty",null),A=e([p("esri.views.3d.layers.i3s.I3SOverrides")],A);class L{constructor(e,t){this.objectId=e,this._options=t,this._updates=new Map,this._updatedGeometry=void 0,this._state=E.ACTIVE}getAttribute(e){return this._updates.get(e)}setAttribute(e,t){this.isActive&&this._updates.set(e,t)}getGeometry(){return this._updatedGeometry}setGeometry(e){this.isActive&&(this._updatedGeometry=e)}rollback(){this.isActive&&(this._state=E.ROLLED_BACK,this._options.rollback(),this._updatedGeometry=void 0)}commit(){this.isActive&&(this._state=E.COMMITTED,this._options.commit(this._updates,this._updatedGeometry),this._updates.clear(),this._updatedGeometry=void 0)}get isActive(){return this._state===E.ACTIVE}}var E;!function(e){e[e.ACTIVE=0]="ACTIVE",e[e.COMMITTED=1]="COMMITTED",e[e.ROLLED_BACK=2]="ROLLED_BACK"}(E||(E={}));const w=1e4,G=5e4;export{A as I3SOverrides};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as o,asinClamped as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as a}from"../../../../core/screenUtils.js";import{d as i,j as s,m as c,e as l}from"../../../../chunks/mat4.js";import{I as m,c as u}from"../../../../chunks/mat4f64.js";import{s as p}from"../../../../chunks/vec2.js";import{a as f}from"../../../../chunks/vec2f64.js";import{b as h,m as M,a as y,l as g,g as d,h as b,s as j,n as v,e as z,d as x,c as P,f as I}from"../../../../chunks/vec3.js";import{c as k}from"../../../../chunks/vec3f64.js";import{create as w,axis as S,fromPoints as E,wrapAxisAngle as A}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as H,vectorCoordinates as U}from"../../../../geometry/support/coordinateSystem.js";import{create as G,intersectRay as q,fromNormalAndOffset as C}from"../../../../geometry/support/plane.js";import{b as F,i as R,c as V}from"../../../../chunks/sphere.js";import{angle as T}from"../../../../geometry/support/vector.js";import{sm4d as O,sv3d as W}from"../../../../geometry/support/vectorStacks.js";import{fromScreen as B,fromScreenAtEye as D}from"../../support/geometryUtils/ray.js";import{intersectScreen as J}from"../../support/geometryUtils/sphere.js";import{Camera as K}from"../../webgl-engine/lib/Camera.js";import{TERRAIN_ID as L}from"../../webgl-engine/lib/verticalOffsetUtils.js";var N;!function(t){t[t.Ellipsoid=0]="Ellipsoid",t[t.Silhouette=1]="Silhouette"}(N||(N={}));const Q=30,X=[1,3e8],Y=80,Z=8,$=200,_=1508e5,tt=5,et=50,nt=5,ot=10,rt=90,at={exclude:new Set([L])};function it(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function st(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function ct(t,e,n){const o=i(O.get(),n[3],S(n));null==o||s(o,m)||(h(oe,t.eye,e),M(oe,oe,o),t.eye=y(oe,oe,e),h(oe,t.center,e),M(oe,oe,o),t.center=y(oe,oe,e),t.up=M(oe,t.up,o))}function lt(t,e,n,o){return q(t,B(e,n,ce),o)}function mt(t,e,n,o){return q(t,D(e,n,ce),o)}function ut(t,e,n,o){const r=W.get();let a=1-n;h(r,e,t.eye);const i=g(r);let s=i*(1-a);a>=0&&s<o&&(s=o,a=-(s-i)/i),Math.abs(i-s)<1e-6||(d(r,r,a),t.eye=y(oe,t.eye,r),t.center=b(oe,t.center,e,a))}function pt(t,e,n){e.getScreenCenter(ft),J(t,e,ft,oe)&&(e.center=oe);const o=e.distance,r=o*n;if(Math.abs(o-r)<1e-6)return;const a=d(W.get(),e.viewForward,r);e.eye=h(oe,e.center,a)}const ft=a();function ht(t,e){j(e,0,0,0);for(const n of t)y(e,e,n);d(e,e,1/t.length)}function Mt(t,e,n,o){return Math.sin(t/g(e))*(n+o.radius)}function yt(t,e,n,o){return Mt(Math.PI/2,e,n,o)+(t-Math.PI/2)}var gt;!function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal"}(gt||(gt={}));const dt={Elevation:3e4,Angle:e(16)},bt={Pole:.95,Angle:e(18),Tilt:45},jt=e(80);function vt(t,e,n,o,r,a){const i=k(),s=V();let c=!0,l=!0;return t.intersectScreen(n,i,a)?s[3]=g(i):(l=!1,e.aboveGround&&r!==N.Ellipsoid?s[3]=Math.max(g(e.center),.9*o.radius):s[3]=g(e.eye)-e.relativeElevation,r===N.Silhouette?It(s,e,n,i):c=J(s,e,n,i)),{sphere:s,scenePickPoint:c?i:null,hasGeometryIntersection:l}}function zt(t,e,n){if(g(t.eye)-n.radius>dt.Elevation)return gt.Horizontal;D(t,e,le);return-Math.sign(t.relativeElevation)*(.5*Math.PI+T(t.eye,le.direction))<dt.Angle?gt.Vertical:gt.Horizontal}function xt(t,e,n){h(Pt,n,e),t.eye=h(oe,t.eye,Pt),t.center=h(oe,t.center,Pt)}const Pt=k();function It(t,e,n,o){const r=D(e,n,ce);return null!=r&&(F(t,r,kt),R(t,r,o)?!(x(kt,r.origin)<x(o,r.origin))||(P(o,kt),!1):(h(wt,e.eye,e.center),v(wt,wt),C(wt,-z(v(wt,wt),kt),St),q(St,r,o),!1))}const kt=k(),wt=k(),St=G();function Et(a,i,s,c,l,m){let u=0;if(I(ie,a,i),h(re,a,i),g(a)<=l||!c.aboveGround){I(s,re,c.eye);const p=z(a,i)/(g(a)*g(i));if(p<.9999)u=o(p);else{const t=g(I(k(),a,i))/(g(a)*g(i));u=r(t)}const f=Math.cos(n(t.normalize(e(m)),0,jt));u=-u-Math.max(0,g(i)-l)/(f*l)}else h(At,c.eye,c.center),I(s,re,At),u=-g(re)/l;return v(s,s),d(s,s,g(ie)),u}const At=k();function Ht(r,a,i,s){let c,l;const m=Math.cos(n(t.normalize(e(s)),0,jt));return c=a>i?-(a-i)/(m*i):a<-i?Math.PI-(a+i)/(m*i):o(a/i),l=r>i?-(r-i)/(m*i):r<-i?Math.PI-(r+i)/(m*i):o(r/i),(l-c)*i}function Ut(t,e,n,o,r,a,i,s,c,l){const m=Ht(t[2],e[2],a[3],s),u=c?Ht(t[0],e[0],a[3],180):e[0]-t[0],f=Math.sin(i)*u-Math.cos(i)*m,h=Math.cos(i)*u+Math.sin(i)*m;v(oe,r);const M=c?f/Math.sqrt(Math.abs(a[3]**2-z(n,oe)**2)):f/a[3],y=h/Math.sqrt(Math.abs(a[3]**2-z(n,o)**2));p(l,M,y)}function Gt(t,e,n,o,r,a,i,s,c,l){I(ie,t,e),H(a.up,a.eye,Lt,Nt,Qt),H([0,0,1],a.eye,Dt,Jt,Kt),P(n,Jt),P(o,Dt),v(n,n),d(n,n,g(ie)),U(t,v(Nt,Nt),v(Qt,Qt),v(Lt,Lt),Xt),U(e,Nt,Qt,Lt,Yt),Ut(Xt,Yt,t,Dt,Jt,i,s,c,l,r)}function qt(t,e,n,o,r,a,s){i(_t,r,o),i(te,s,a),c(ee,_t,te),h(e,t,n),M(e,e,ee),y(e,e,n)}function Ct(t,e,n,o,r,a){i(_t,o,n),i(te,a,r),c(ee,_t,te),h(oe,t.eye,e),M(oe,oe,ee),t.eye=y(oe,oe,e),h(oe,t.center,e),M(oe,oe,ee),t.center=y(oe,oe,e),h(oe,t.up,e),M(oe,oe,ee),t.up=y(oe,oe,e)}function Ft(t,e,n,o,r,a){return(Math.abs(o)>Math.PI-bt.Angle||Math.abs(o)<bt.Angle)&&(Math.abs(t[2])<n*bt.Pole||Math.abs(e)>n)&&a.aboveGround&&r<bt.Tilt}function Rt(t,e,n,o,r,a){if(a)E(n,o,$t),ct(e,t,$t);else{const a=Et(n,o,se,e,t[3],r);ct(e,t,A(se,a))}}function Vt(t,e,n,o,r,a,i){const s=i?20:1,c=1e-12;let l,m;P(ne,o),ae.copyFrom(e);for(let u=0;u<s&&x(n,ne)>c&&(l=x(n,ne),Gt(n,ne,Jt,Dt,Zt,ae,t,r,a,i),Ct(ae,t,Dt,Zt[1],Jt,Zt[0]),qt(ne,ne,t,Dt,Zt[1],Jt,Zt[0]),m=x(n,ne),m<l||0===u);u++)e.copyFrom(ae)}function Tt(n,o,r,a,i,s,c){Ft(r,z(o.up,r),n[3],-t.normalize(e(i)),s,o)?Vt(n,o,r,a,-t.normalize(e(i)),s,c):Rt(n,o,r,a,s,c)}function Ot(t,e,n,o,r,a){const{eye:i}=t;H([0,0,1],i,Dt,Jt,Kt);const s=e.translation[0]*n.pan,c="zoom"===r.mode?0:e.translation[1]*n.pan,m=Math.max(Math.sqrt(Math.abs(1-z(t.center,Dt)**2/g(t.center)**2)),.5),u=(Math.sin(a)*c+Math.cos(a)*s)/m,p=-Math.cos(a)*c+Math.sin(a)*s;switch(l(o.pan.matrix,o.pan.matrix,u,Dt),o.pan.enabled=!0,r.mode){case"pan":l(o.pan.matrix,o.pan.matrix,p,Jt),o.pan.enabled=!0;break;case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Wt(t,e,n,o,r){const{eye:a,viewRight:i}=t,s=I(W.get(),i,a),c=e.translation[0]*n.pan;switch(0!==c&&(l(o.pan.matrix,o.pan.matrix,-c,s),o.pan.enabled=!0),r.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(l(o.pan.matrix,o.pan.matrix,t,i),o.pan.enabled=!0);break}case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Bt(n,o,r,a,i,s,c,l,m){Ft(n.center,z(n.up,n.center),g(n.center),-t.normalize(e(s)),c,o)?Ot(o,r,a,l,m,-t.normalize(e(i))):Wt(o,r,a,l,m)}const Dt=k(),Jt=k(),Kt=k(),Lt=k(),Nt=k(),Qt=k(),Xt=k(),Yt=k(),Zt=f(),$t=w(),_t=u(),te=u(),ee=u(),ne=k(),oe=k(),re=k(),ae=new K,ie=k(),se=k(),ce={origin:k(),direction:k()},le={origin:k(),direction:k()};export{X as DISTANCE_CLAMP_VALUES,et as MIN_HEIGHT_LIMIT,gt as NavigationMode,tt as PAN_DISTANCE_MODIFIER,Q as PIVOT_DISTANCE_MODIFIER,bt as PreservingHeadingThreshold,nt as ROTATE_PIVOT_DISTANCE_MODIFIER,ot as ROTATE_PIVOT_MIN_DISTANCE_MODIFIER,rt as ROTATE_SCREEN_PIXEL_AREA,Y as SCREEN_PIXEL_AREA,N as SpherePickPointFallback,jt as TiltThresholdPanningSpeed,dt as VerticalPanTresholds,Z as ZOOM_DISTANCE_MODIFIER,_ as ZOOM_MAX_DISTANCE_MODIFIER,$ as ZOOM_MIN_DISTANCE_MODIFIER,xt as applyPanPlanar,Rt as applyPanSphericalDirectRotation,Vt as applyPanSphericalPreserveHeading,ct as applyRotation,Ct as applyRotationWithTwoAxes,pt as applyZoomOnSphere,ut as applyZoomToPoint,ht as centroid,at as contentIntersectorOptions,zt as decideNavigationMode,lt as intersectPlaneFromScreenPoint,mt as intersectPlaneFromScreenPointAtEye,Ht as lengthFromPoints,it as normalizeCoordinate,st as normalizeRotationDelta,yt as offSurfaceTiltToEyeTiltGlobal,Mt as onSurfaceTiltToEyeTiltGlobal,Bt as panMotionToRotationMatrix,Tt as panToPosition,vt as pickPointAndInitSphere,Ft as preserveHeadingThreshold,qt as rotatePointAroundTwoAxes,Et as rotationAngleAndAxisDirectRotation,Gt as rotationAnglesAndAxesHeadingPreserving,Ut as rotationAnglesHeadingPreserving,It as sphereOrPlanePointFromScreenPoint};
5
+ import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as o,asinClamped as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as a}from"../../../../core/screenUtils.js";import{d as i,h as s,m as c,e as l}from"../../../../chunks/mat4.js";import{I as m,c as u}from"../../../../chunks/mat4f64.js";import{s as p}from"../../../../chunks/vec2.js";import{a as f}from"../../../../chunks/vec2f64.js";import{b as h,m as M,a as y,l as g,g as d,h as b,s as v,n as j,e as z,d as x,c as P,f as I}from"../../../../chunks/vec3.js";import{c as k}from"../../../../chunks/vec3f64.js";import{create as w,axis as S,fromPoints as E,wrapAxisAngle as A}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as H,vectorCoordinates as U}from"../../../../geometry/support/coordinateSystem.js";import{create as G,intersectRay as q,fromNormalAndOffset as C}from"../../../../geometry/support/plane.js";import{b as F,i as R,c as V}from"../../../../chunks/sphere.js";import{angle as T}from"../../../../geometry/support/vector.js";import{sm4d as O,sv3d as W}from"../../../../geometry/support/vectorStacks.js";import{fromScreen as B,fromScreenAtEye as D}from"../../support/geometryUtils/ray.js";import{intersectScreen as J}from"../../support/geometryUtils/sphere.js";import{Camera as K}from"../../webgl-engine/lib/Camera.js";import{TERRAIN_ID as L}from"../../webgl-engine/lib/verticalOffsetUtils.js";var N;!function(t){t[t.Ellipsoid=0]="Ellipsoid",t[t.Silhouette=1]="Silhouette"}(N||(N={}));const Q=30,X=[1,3e8],Y=80,Z=8,$=200,_=1508e5,tt=5,et=50,nt=5,ot=10,rt=90,at={exclude:new Set([L])};function it(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function st(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function ct(t,e,n){const o=i(O.get(),n[3],S(n));null==o||s(o,m)||(h(oe,t.eye,e),M(oe,oe,o),t.eye=y(oe,oe,e),h(oe,t.center,e),M(oe,oe,o),t.center=y(oe,oe,e),t.up=M(oe,t.up,o))}function lt(t,e,n,o){return q(t,B(e,n,ce),o)}function mt(t,e,n,o){return q(t,D(e,n,ce),o)}function ut(t,e,n,o){const r=W.get();let a=1-n;h(r,e,t.eye);const i=g(r);let s=i*(1-a);a>=0&&s<o&&(s=o,a=-(s-i)/i),Math.abs(i-s)<1e-6||(d(r,r,a),t.eye=y(oe,t.eye,r),t.center=b(oe,t.center,e,a))}function pt(t,e,n){e.getScreenCenter(ft),J(t,e,ft,oe)&&(e.center=oe);const o=e.distance,r=o*n;if(Math.abs(o-r)<1e-6)return;const a=d(W.get(),e.viewForward,r);e.eye=h(oe,e.center,a)}const ft=a();function ht(t,e){v(e,0,0,0);for(const n of t)y(e,e,n);d(e,e,1/t.length)}function Mt(t,e,n,o){return Math.sin(t/g(e))*(n+o.radius)}function yt(t,e,n,o){return Mt(Math.PI/2,e,n,o)+(t-Math.PI/2)}var gt;!function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal"}(gt||(gt={}));const dt={Elevation:3e4,Angle:e(16)},bt={Pole:.95,Angle:e(18),Tilt:45},vt=e(80);function jt(t,e,n,o,r,a){const i=k(),s=V();let c=!0,l=!0;return t.intersectScreen(n,i,a)?s[3]=g(i):(l=!1,e.aboveGround&&r!==N.Ellipsoid?s[3]=Math.max(g(e.center),.9*o.radius):s[3]=g(e.eye)-e.relativeElevation,r===N.Silhouette?It(s,e,n,i):c=J(s,e,n,i)),{sphere:s,scenePickPoint:c?i:null,hasGeometryIntersection:l}}function zt(t,e,n){if(g(t.eye)-n.radius>dt.Elevation)return gt.Horizontal;D(t,e,le);return-Math.sign(t.relativeElevation)*(.5*Math.PI+T(t.eye,le.direction))<dt.Angle?gt.Vertical:gt.Horizontal}function xt(t,e,n){h(Pt,n,e),t.eye=h(oe,t.eye,Pt),t.center=h(oe,t.center,Pt)}const Pt=k();function It(t,e,n,o){const r=D(e,n,ce);return null!=r&&(F(t,r,kt),R(t,r,o)?!(x(kt,r.origin)<x(o,r.origin))||(P(o,kt),!1):(h(wt,e.eye,e.center),j(wt,wt),C(wt,-z(j(wt,wt),kt),St),q(St,r,o),!1))}const kt=k(),wt=k(),St=G();function Et(a,i,s,c,l,m){let u=0;if(I(ie,a,i),h(re,a,i),g(a)<=l||!c.aboveGround){I(s,re,c.eye);const p=z(a,i)/(g(a)*g(i));if(p<.9999)u=o(p);else{const t=g(I(k(),a,i))/(g(a)*g(i));u=r(t)}const f=Math.cos(n(t.normalize(e(m)),0,vt));u=-u-Math.max(0,g(i)-l)/(f*l)}else h(At,c.eye,c.center),I(s,re,At),u=-g(re)/l;return j(s,s),d(s,s,g(ie)),u}const At=k();function Ht(r,a,i,s){let c,l;const m=Math.cos(n(t.normalize(e(s)),0,vt));return c=a>i?-(a-i)/(m*i):a<-i?Math.PI-(a+i)/(m*i):o(a/i),l=r>i?-(r-i)/(m*i):r<-i?Math.PI-(r+i)/(m*i):o(r/i),(l-c)*i}function Ut(t,e,n,o,r,a,i,s,c,l){const m=Ht(t[2],e[2],a[3],s),u=c?Ht(t[0],e[0],a[3],180):e[0]-t[0],f=Math.sin(i)*u-Math.cos(i)*m,h=Math.cos(i)*u+Math.sin(i)*m;j(oe,r);const M=c?f/Math.sqrt(Math.abs(a[3]**2-z(n,oe)**2)):f/a[3],y=h/Math.sqrt(Math.abs(a[3]**2-z(n,o)**2));p(l,M,y)}function Gt(t,e,n,o,r,a,i,s,c,l){I(ie,t,e),H(a.up,a.eye,Lt,Nt,Qt),H([0,0,1],a.eye,Dt,Jt,Kt),P(n,Jt),P(o,Dt),j(n,n),d(n,n,g(ie)),U(t,j(Nt,Nt),j(Qt,Qt),j(Lt,Lt),Xt),U(e,Nt,Qt,Lt,Yt),Ut(Xt,Yt,t,Dt,Jt,i,s,c,l,r)}function qt(t,e,n,o,r,a,s){i(_t,r,o),i(te,s,a),c(ee,_t,te),h(e,t,n),M(e,e,ee),y(e,e,n)}function Ct(t,e,n,o,r,a){i(_t,o,n),i(te,a,r),c(ee,_t,te),h(oe,t.eye,e),M(oe,oe,ee),t.eye=y(oe,oe,e),h(oe,t.center,e),M(oe,oe,ee),t.center=y(oe,oe,e),h(oe,t.up,e),M(oe,oe,ee),t.up=y(oe,oe,e)}function Ft(t,e,n,o,r,a){return(Math.abs(o)>Math.PI-bt.Angle||Math.abs(o)<bt.Angle)&&(Math.abs(t[2])<n*bt.Pole||Math.abs(e)>n)&&a.aboveGround&&r<bt.Tilt}function Rt(t,e,n,o,r,a){if(a)E(n,o,$t),ct(e,t,$t);else{const a=Et(n,o,se,e,t[3],r);ct(e,t,A(se,a))}}function Vt(t,e,n,o,r,a,i){const s=i?20:1,c=1e-12;let l,m;P(ne,o),ae.copyFrom(e);for(let u=0;u<s&&x(n,ne)>c&&(l=x(n,ne),Gt(n,ne,Jt,Dt,Zt,ae,t,r,a,i),Ct(ae,t,Dt,Zt[1],Jt,Zt[0]),qt(ne,ne,t,Dt,Zt[1],Jt,Zt[0]),m=x(n,ne),m<l||0===u);u++)e.copyFrom(ae)}function Tt(n,o,r,a,i,s,c){Ft(r,z(o.up,r),n[3],-t.normalize(e(i)),s,o)?Vt(n,o,r,a,-t.normalize(e(i)),s,c):Rt(n,o,r,a,s,c)}function Ot(t,e,n,o,r,a){const{eye:i}=t;H([0,0,1],i,Dt,Jt,Kt);const s=e.translation[0]*n.pan,c="zoom"===r.mode?0:e.translation[1]*n.pan,m=Math.max(Math.sqrt(Math.abs(1-z(t.center,Dt)**2/g(t.center)**2)),.5),u=(Math.sin(a)*c+Math.cos(a)*s)/m,p=-Math.cos(a)*c+Math.sin(a)*s;switch(l(o.pan.matrix,o.pan.matrix,u,Dt),o.pan.enabled=!0,r.mode){case"pan":l(o.pan.matrix,o.pan.matrix,p,Jt),o.pan.enabled=!0;break;case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Wt(t,e,n,o,r){const{eye:a,viewRight:i}=t,s=I(W.get(),i,a),c=e.translation[0]*n.pan;switch(0!==c&&(l(o.pan.matrix,o.pan.matrix,-c,s),o.pan.enabled=!0),r.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(l(o.pan.matrix,o.pan.matrix,t,i),o.pan.enabled=!0);break}case"zoom":o.zoom=-e.translation[1]*n.zoom}}function Bt(n,o,r,a,i,s,c,l,m){Ft(n.center,z(n.up,n.center),g(n.center),-t.normalize(e(s)),c,o)?Ot(o,r,a,l,m,-t.normalize(e(i))):Wt(o,r,a,l,m)}const Dt=k(),Jt=k(),Kt=k(),Lt=k(),Nt=k(),Qt=k(),Xt=k(),Yt=k(),Zt=f(),$t=w(),_t=u(),te=u(),ee=u(),ne=k(),oe=k(),re=k(),ae=new K,ie=k(),se=k(),ce={origin:k(),direction:k()},le={origin:k(),direction:k()};export{X as DISTANCE_CLAMP_VALUES,et as MIN_HEIGHT_LIMIT,gt as NavigationMode,tt as PAN_DISTANCE_MODIFIER,Q as PIVOT_DISTANCE_MODIFIER,bt as PreservingHeadingThreshold,nt as ROTATE_PIVOT_DISTANCE_MODIFIER,ot as ROTATE_PIVOT_MIN_DISTANCE_MODIFIER,rt as ROTATE_SCREEN_PIXEL_AREA,Y as SCREEN_PIXEL_AREA,N as SpherePickPointFallback,vt as TiltThresholdPanningSpeed,dt as VerticalPanTresholds,Z as ZOOM_DISTANCE_MODIFIER,_ as ZOOM_MAX_DISTANCE_MODIFIER,$ as ZOOM_MIN_DISTANCE_MODIFIER,xt as applyPanPlanar,Rt as applyPanSphericalDirectRotation,Vt as applyPanSphericalPreserveHeading,ct as applyRotation,Ct as applyRotationWithTwoAxes,pt as applyZoomOnSphere,ut as applyZoomToPoint,ht as centroid,at as contentIntersectorOptions,zt as decideNavigationMode,lt as intersectPlaneFromScreenPoint,mt as intersectPlaneFromScreenPointAtEye,Ht as lengthFromPoints,it as normalizeCoordinate,st as normalizeRotationDelta,yt as offSurfaceTiltToEyeTiltGlobal,Mt as onSurfaceTiltToEyeTiltGlobal,Bt as panMotionToRotationMatrix,Tt as panToPosition,jt as pickPointAndInitSphere,Ft as preserveHeadingThreshold,qt as rotatePointAroundTwoAxes,Et as rotationAngleAndAxisDirectRotation,Gt as rotationAnglesAndAxesHeadingPreserving,Ut as rotationAnglesHeadingPreserving,It as sphereOrPlanePointFromScreenPoint};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../core/has.js";import{Milliseconds as e}from"../../../core/time.js";class a{static isValidProfile(e){return e in a.profiles}static getDefaultProfile(){return has("esri-iPhone")?"low":"medium"}static apply(e,i){const o=a.profiles[e];i.graphics3D.maxTotalNumberOfFeatures=o.graphics3D.maxTotalNumberOfFeatures,i.graphics3D.maxTotalNumberOfPrimitives=o.graphics3D.maxTotalNumberOfPrimitives,i.graphics3D.polygonLodFactor=o.graphics3D.polygonLodFactor,i.graphics3D.polylineLodFactor=o.graphics3D.polylineLodFactor,i.graphics3D.snapshotAvailable=o.graphics3D.snapshotAvailable,i.graphics3D.skipHighSymbolLods=o.graphics3D.skipHighSymbolLods;const t=i.sceneService.object,r=o.sceneService.object;t.lodFactor=r.lodFactor,t.lodCrossfadeinDuration=r.lodCrossfadeinDuration,t.lodCrossfadeoutDuration=r.lodCrossfadeoutDuration,t.lodCrossfadeUncoveredDuration=r.lodCrossfadeUncoveredDuration,i.sceneService.point.lodFactor=o.sceneService.point.lodFactor,i.sceneService.integratedMesh.lodFactor=o.sceneService.integratedMesh.lodFactor,i.sceneService.pointCloud.lodFactor=o.sceneService.pointCloud.lodFactor,i.sceneService.uncompressedTextureDownsamplingEnabled=o.sceneService.uncompressedTextureDownsamplingEnabled,i.tiledSurface.lodBias=o.tiledSurface.lodBias,i.tiledSurface.angledSplitBias=o.tiledSurface.angledSplitBias,i.tiledSurface.reduceTileLevelDifferences=o.tiledSurface.reduceTileLevelDifferences,i.tiledSurface.textureFadeDuration=o.tiledSurface.textureFadeDuration,i.heatmap.pixelRatio=o.heatmap.pixelRatio,i.heatmap.maxTotalNumberOfFeatures=o.heatmap.maxTotalNumberOfFeatures,i.fadeDuration=o.fadeDuration,i.antialiasingEnabled=o.antialiasingEnabled,i.physicallyBasedRenderingEnabled=o.physicalBasedRenderingEnabled,i.highQualityTransparency=o.highQualityTransparency,i.highQualityAtmosphere=o.highQualityAtmosphere,i.reflections=o.reflections,i.ambientOcclusion=o.ambientOcclusion,i.memoryLimit=o.memoryLimit,i.additionalCacheMemory=o.additionalCacheMemory,i.frameRate=o.frameRate,i.maximumPixelRatio=o.maximumPixelRatio}}function i(){const a=!!has("esri-mobile"),i=!!has("ios"),o=e(400);return{low:{graphics3D:{maxTotalNumberOfFeatures:25e3,maxTotalNumberOfPrimitives:85e4,polygonLodFactor:.5,polylineLodFactor:1,snapshotAvailable:!1,skipHighSymbolLods:!0},heatmap:{pixelRatio:.125,maxTotalNumberOfFeatures:25e3},sceneService:{object:{lodFactor:.2,lodCrossfadeinDuration:e(0),lodCrossfadeoutDuration:e(0),lodCrossfadeUncoveredDuration:e(0)},point:{lodFactor:1},integratedMesh:{lodFactor:.6},pointCloud:{lodFactor:.5},uncompressedTextureDownsamplingEnabled:!0},tiledSurface:{lodBias:-1,angledSplitBias:.5,reduceTileLevelDifferences:!1,textureFadeDuration:e(0)},fadeDuration:e(0),antialiasingEnabled:!1,physicalBasedRenderingEnabled:!1,highQualityTransparency:!1,highQualityAtmosphere:!1,reflections:!1,ambientOcclusion:!1,memoryLimit:200,additionalCacheMemory:0,frameRate:0,maximumPixelRatio:1},medium:{graphics3D:{maxTotalNumberOfFeatures:5e4,maxTotalNumberOfPrimitives:17e5,polygonLodFactor:a?.8:1,polylineLodFactor:a?1.2:1.5,snapshotAvailable:!i,skipHighSymbolLods:!1},heatmap:{pixelRatio:.25,maxTotalNumberOfFeatures:5e4},sceneService:{object:{lodFactor:1,lodCrossfadeinDuration:e(0),lodCrossfadeoutDuration:e(0),lodCrossfadeUncoveredDuration:o},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1},uncompressedTextureDownsamplingEnabled:a},tiledSurface:{lodBias:0,angledSplitBias:1,reduceTileLevelDifferences:!has("disable-feature:reduce-map-tile-levels"),textureFadeDuration:o},fadeDuration:o,antialiasingEnabled:!0,physicalBasedRenderingEnabled:!0,highQualityTransparency:!0,highQualityAtmosphere:!1,reflections:!1,ambientOcclusion:!1,memoryLimit:a?600:750,additionalCacheMemory:a?0:150,frameRate:0,maximumPixelRatio:1},high:{graphics3D:{maxTotalNumberOfFeatures:5e4,maxTotalNumberOfPrimitives:17e5,polygonLodFactor:a?1.2:2,polylineLodFactor:a?1.2:2,snapshotAvailable:!i,skipHighSymbolLods:!1},heatmap:{pixelRatio:.5,maxTotalNumberOfFeatures:5e4},sceneService:{object:{lodFactor:1,lodCrossfadeinDuration:e(0),lodCrossfadeoutDuration:e(0),lodCrossfadeUncoveredDuration:o},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1},uncompressedTextureDownsamplingEnabled:!1},tiledSurface:{lodBias:0,angledSplitBias:1,reduceTileLevelDifferences:!has("disable-feature:reduce-map-tile-levels"),textureFadeDuration:o},fadeDuration:o,antialiasingEnabled:!0,physicalBasedRenderingEnabled:!0,highQualityTransparency:!0,highQualityAtmosphere:!0,reflections:!0,ambientOcclusion:!0,memoryLimit:a?900:1500,additionalCacheMemory:0,frameRate:0,maximumPixelRatio:a?1:1/0}}}a.test={reset(){const e=i();for(const i of Object.keys(e))a.profiles[i]=e[i]}},function(e){e.profiles=i()}(a||(a={}));const o=a;export{o as default};
5
+ import has from"../../../core/has.js";import{Milliseconds as e}from"../../../core/time.js";class a{static isValidProfile(e){return e in a.profiles}static getDefaultProfile(){return has("esri-iPhone")?"low":"medium"}static apply(e,i){const o=a.profiles[e];i.graphics3D.maxTotalNumberOfFeatures=o.graphics3D.maxTotalNumberOfFeatures,i.graphics3D.maxTotalNumberOfPrimitives=o.graphics3D.maxTotalNumberOfPrimitives,i.graphics3D.polygonLodFactor=o.graphics3D.polygonLodFactor,i.graphics3D.polylineLodFactor=o.graphics3D.polylineLodFactor,i.graphics3D.snapshotAvailable=o.graphics3D.snapshotAvailable,i.graphics3D.skipHighSymbolLods=o.graphics3D.skipHighSymbolLods;const t=i.sceneService.object,r=o.sceneService.object;t.lodFactor=r.lodFactor,t.lodCrossfadeinDuration=r.lodCrossfadeinDuration,t.lodCrossfadeoutDuration=r.lodCrossfadeoutDuration,t.lodCrossfadeUncoveredDuration=r.lodCrossfadeUncoveredDuration,i.sceneService.point.lodFactor=o.sceneService.point.lodFactor,i.sceneService.integratedMesh.lodFactor=o.sceneService.integratedMesh.lodFactor,i.sceneService.pointCloud.lodFactor=o.sceneService.pointCloud.lodFactor,i.sceneService.uncompressedTextureDownsamplingEnabled=o.sceneService.uncompressedTextureDownsamplingEnabled,i.tiledSurface.lodBias=o.tiledSurface.lodBias,i.tiledSurface.angledSplitBias=o.tiledSurface.angledSplitBias,i.tiledSurface.reduceTileLevelDifferences=o.tiledSurface.reduceTileLevelDifferences,i.tiledSurface.textureFadeDuration=o.tiledSurface.textureFadeDuration,i.heatmap.pixelRatio=o.heatmap.pixelRatio,i.heatmap.maxTotalNumberOfFeatures=o.heatmap.maxTotalNumberOfFeatures,i.fadeDuration=o.fadeDuration,i.antialiasingEnabled=o.antialiasingEnabled,i.physicallyBasedRenderingEnabled=o.physicalBasedRenderingEnabled,i.highQualityTransparency=o.highQualityTransparency,i.highResolutionAtmosphere=o.highResolutionAtmosphere,i.reflections=o.reflections,i.ambientOcclusion=o.ambientOcclusion,i.memoryLimit=o.memoryLimit,i.additionalCacheMemory=o.additionalCacheMemory,i.frameRate=o.frameRate,i.maximumPixelRatio=o.maximumPixelRatio}}function i(){const a=!!has("esri-mobile"),i=!!has("ios"),o=e(400);return{low:{graphics3D:{maxTotalNumberOfFeatures:25e3,maxTotalNumberOfPrimitives:85e4,polygonLodFactor:.5,polylineLodFactor:1,snapshotAvailable:!1,skipHighSymbolLods:!0},heatmap:{pixelRatio:.125,maxTotalNumberOfFeatures:25e3},sceneService:{object:{lodFactor:.2,lodCrossfadeinDuration:e(0),lodCrossfadeoutDuration:e(0),lodCrossfadeUncoveredDuration:e(0)},point:{lodFactor:1},integratedMesh:{lodFactor:.6},pointCloud:{lodFactor:.5},uncompressedTextureDownsamplingEnabled:!0},tiledSurface:{lodBias:-1,angledSplitBias:.5,reduceTileLevelDifferences:!1,textureFadeDuration:e(0)},fadeDuration:e(0),antialiasingEnabled:!1,physicalBasedRenderingEnabled:!1,highQualityTransparency:!1,highResolutionAtmosphere:!1,reflections:!1,ambientOcclusion:!1,memoryLimit:200,additionalCacheMemory:0,frameRate:0,maximumPixelRatio:1},medium:{graphics3D:{maxTotalNumberOfFeatures:5e4,maxTotalNumberOfPrimitives:17e5,polygonLodFactor:a?.8:1,polylineLodFactor:a?1.2:1.5,snapshotAvailable:!i,skipHighSymbolLods:!1},heatmap:{pixelRatio:.25,maxTotalNumberOfFeatures:5e4},sceneService:{object:{lodFactor:1,lodCrossfadeinDuration:e(0),lodCrossfadeoutDuration:e(0),lodCrossfadeUncoveredDuration:o},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1},uncompressedTextureDownsamplingEnabled:a},tiledSurface:{lodBias:0,angledSplitBias:1,reduceTileLevelDifferences:!has("disable-feature:reduce-map-tile-levels"),textureFadeDuration:o},fadeDuration:o,antialiasingEnabled:!0,physicalBasedRenderingEnabled:!0,highQualityTransparency:!0,highResolutionAtmosphere:!1,reflections:!1,ambientOcclusion:!1,memoryLimit:a?600:750,additionalCacheMemory:a?0:150,frameRate:0,maximumPixelRatio:1},high:{graphics3D:{maxTotalNumberOfFeatures:5e4,maxTotalNumberOfPrimitives:17e5,polygonLodFactor:a?1.2:2,polylineLodFactor:a?1.2:2,snapshotAvailable:!i,skipHighSymbolLods:!1},heatmap:{pixelRatio:.5,maxTotalNumberOfFeatures:5e4},sceneService:{object:{lodFactor:1,lodCrossfadeinDuration:e(0),lodCrossfadeoutDuration:e(0),lodCrossfadeUncoveredDuration:o},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1},uncompressedTextureDownsamplingEnabled:!1},tiledSurface:{lodBias:0,angledSplitBias:1,reduceTileLevelDifferences:!has("disable-feature:reduce-map-tile-levels"),textureFadeDuration:o},fadeDuration:o,antialiasingEnabled:!0,physicalBasedRenderingEnabled:!0,highQualityTransparency:!0,highResolutionAtmosphere:!0,reflections:!0,ambientOcclusion:!0,memoryLimit:a?900:1500,additionalCacheMemory:0,frameRate:0,maximumPixelRatio:a?1:1/0}}}a.test={reset(){const e=i();for(const i of Object.keys(e))a.profiles[i]=e[i]}},function(e){e.profiles=i()}(a||(a={}));const o=a;export{o as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import{Milliseconds as o}from"../../../core/time.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";let r=class extends e{constructor(){super(...arguments),this.minTotalNumberOfFeatures=2e3,this.maxTotalNumberOfFeatures=5e4,this.maxTotalNumberOfPrimitives=17e5,this.snapshotAvailable=!0,this.polygonLodFactor=1,this.polylineLodFactor=1,this.skipHighSymbolLods=!1}};t([i()],r.prototype,"minTotalNumberOfFeatures",void 0),t([i()],r.prototype,"maxTotalNumberOfFeatures",void 0),t([i()],r.prototype,"maxTotalNumberOfPrimitives",void 0),t([i()],r.prototype,"snapshotAvailable",void 0),t([i()],r.prototype,"polygonLodFactor",void 0),t([i()],r.prototype,"polylineLodFactor",void 0),t([i()],r.prototype,"skipHighSymbolLods",void 0),r=t([s("esri.views.3d.support.QualitySettings.Graphics3DSettings")],r);let p=class extends e{constructor(){super(...arguments),this.lodFactor=1}};t([i()],p.prototype,"lodFactor",void 0),p=t([s("esri.views.3d.support.QualitySettings.LoDFactorSettings")],p);let a=class extends p{constructor(){super(...arguments),this.lodCrossfadeinDuration=o(0),this.lodCrossfadeoutDuration=o(0),this.lodCrossfadeUncoveredDuration=o(0)}};a=t([s("esri.views.3d.support.QualitySettings.LoDFactor3DObjectSettings")],a);let n=class extends e{constructor(){super(...arguments),this.object=new a,this.point=new p,this.integratedMesh=new p,this.pointCloud=new p,this.uncompressedTextureDownsamplingEnabled=!1}};t([i({type:a})],n.prototype,"object",void 0),t([i({type:p})],n.prototype,"point",void 0),t([i({type:p})],n.prototype,"integratedMesh",void 0),t([i({type:p})],n.prototype,"pointCloud",void 0),t([i()],n.prototype,"uncompressedTextureDownsamplingEnabled",void 0),n=t([s("esri.views.3d.support.QualitySettings.SceneServiceSettings")],n);let d=class extends e{constructor(){super(...arguments),this.lodBias=0,this.angledSplitBias=1,this.reduceTileLevelDifferences=!0,this.textureFadeDuration=o(400)}};t([i()],d.prototype,"lodBias",void 0),t([i()],d.prototype,"angledSplitBias",void 0),t([i()],d.prototype,"reduceTileLevelDifferences",void 0),t([i()],d.prototype,"textureFadeDuration",void 0),d=t([s("esri.views.3d.support.QualitySettings.TiledSurfaceSettings")],d);let l=class extends e{constructor(){super(...arguments),this.pixelRatio=1,this.maxTotalNumberOfFeatures=5e4}};t([i()],l.prototype,"pixelRatio",void 0),t([i()],l.prototype,"maxTotalNumberOfFeatures",void 0),l=t([s("esri.views.3d.support.QualitySettings.HeatmapSettings")],l);let c=class extends e{constructor(){super(...arguments),this.graphics3D=new r,this.sceneService=new n,this.tiledSurface=new d,this.heatmap=new l,this.fadeDuration=o(400),this.antialiasingEnabled=!0,this.physicallyBasedRenderingEnabled=!1,this.highQualityTransparency=!0,this.highQualityAtmosphere=!1,this.reflections=!1,this.ambientOcclusion=!1,this.memoryLimit=750,this.additionalCacheMemory=0,this.frameRate=void 0,this.maximumPixelRatio=1/0}};t([i({type:r})],c.prototype,"graphics3D",void 0),t([i({type:n})],c.prototype,"sceneService",void 0),t([i({type:d})],c.prototype,"tiledSurface",void 0),t([i({type:l})],c.prototype,"heatmap",void 0),t([i()],c.prototype,"fadeDuration",void 0),t([i()],c.prototype,"antialiasingEnabled",void 0),t([i()],c.prototype,"physicallyBasedRenderingEnabled",void 0),t([i()],c.prototype,"highQualityTransparency",void 0),t([i()],c.prototype,"highQualityAtmosphere",void 0),t([i()],c.prototype,"reflections",void 0),t([i()],c.prototype,"ambientOcclusion",void 0),t([i()],c.prototype,"memoryLimit",void 0),t([i()],c.prototype,"additionalCacheMemory",void 0),t([i()],c.prototype,"frameRate",void 0),t([i()],c.prototype,"maximumPixelRatio",void 0),c=t([s("esri.views.3d.support.QualitySettings.QualitySettings")],c);const u=c;export{u as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import{Milliseconds as o}from"../../../core/time.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";let r=class extends e{constructor(){super(...arguments),this.minTotalNumberOfFeatures=2e3,this.maxTotalNumberOfFeatures=5e4,this.maxTotalNumberOfPrimitives=17e5,this.snapshotAvailable=!0,this.polygonLodFactor=1,this.polylineLodFactor=1,this.skipHighSymbolLods=!1}};t([i()],r.prototype,"minTotalNumberOfFeatures",void 0),t([i()],r.prototype,"maxTotalNumberOfFeatures",void 0),t([i()],r.prototype,"maxTotalNumberOfPrimitives",void 0),t([i()],r.prototype,"snapshotAvailable",void 0),t([i()],r.prototype,"polygonLodFactor",void 0),t([i()],r.prototype,"polylineLodFactor",void 0),t([i()],r.prototype,"skipHighSymbolLods",void 0),r=t([s("esri.views.3d.support.QualitySettings.Graphics3DSettings")],r);let p=class extends e{constructor(){super(...arguments),this.lodFactor=1}};t([i()],p.prototype,"lodFactor",void 0),p=t([s("esri.views.3d.support.QualitySettings.LoDFactorSettings")],p);let a=class extends p{constructor(){super(...arguments),this.lodCrossfadeinDuration=o(0),this.lodCrossfadeoutDuration=o(0),this.lodCrossfadeUncoveredDuration=o(0)}};a=t([s("esri.views.3d.support.QualitySettings.LoDFactor3DObjectSettings")],a);let n=class extends e{constructor(){super(...arguments),this.object=new a,this.point=new p,this.integratedMesh=new p,this.pointCloud=new p,this.uncompressedTextureDownsamplingEnabled=!1}};t([i({type:a})],n.prototype,"object",void 0),t([i({type:p})],n.prototype,"point",void 0),t([i({type:p})],n.prototype,"integratedMesh",void 0),t([i({type:p})],n.prototype,"pointCloud",void 0),t([i()],n.prototype,"uncompressedTextureDownsamplingEnabled",void 0),n=t([s("esri.views.3d.support.QualitySettings.SceneServiceSettings")],n);let d=class extends e{constructor(){super(...arguments),this.lodBias=0,this.angledSplitBias=1,this.reduceTileLevelDifferences=!0,this.textureFadeDuration=o(400)}};t([i()],d.prototype,"lodBias",void 0),t([i()],d.prototype,"angledSplitBias",void 0),t([i()],d.prototype,"reduceTileLevelDifferences",void 0),t([i()],d.prototype,"textureFadeDuration",void 0),d=t([s("esri.views.3d.support.QualitySettings.TiledSurfaceSettings")],d);let l=class extends e{constructor(){super(...arguments),this.pixelRatio=1,this.maxTotalNumberOfFeatures=5e4}};t([i()],l.prototype,"pixelRatio",void 0),t([i()],l.prototype,"maxTotalNumberOfFeatures",void 0),l=t([s("esri.views.3d.support.QualitySettings.HeatmapSettings")],l);let c=class extends e{constructor(){super(...arguments),this.graphics3D=new r,this.sceneService=new n,this.tiledSurface=new d,this.heatmap=new l,this.fadeDuration=o(400),this.antialiasingEnabled=!0,this.physicallyBasedRenderingEnabled=!1,this.highQualityTransparency=!0,this.highResolutionAtmosphere=!1,this.reflections=!1,this.ambientOcclusion=!1,this.memoryLimit=750,this.additionalCacheMemory=0,this.frameRate=void 0,this.maximumPixelRatio=1/0}};t([i({type:r})],c.prototype,"graphics3D",void 0),t([i({type:n})],c.prototype,"sceneService",void 0),t([i({type:d})],c.prototype,"tiledSurface",void 0),t([i({type:l})],c.prototype,"heatmap",void 0),t([i()],c.prototype,"fadeDuration",void 0),t([i()],c.prototype,"antialiasingEnabled",void 0),t([i()],c.prototype,"physicallyBasedRenderingEnabled",void 0),t([i()],c.prototype,"highQualityTransparency",void 0),t([i()],c.prototype,"highResolutionAtmosphere",void 0),t([i()],c.prototype,"reflections",void 0),t([i()],c.prototype,"ambientOcclusion",void 0),t([i()],c.prototype,"memoryLimit",void 0),t([i()],c.prototype,"additionalCacheMemory",void 0),t([i()],c.prototype,"frameRate",void 0),t([i()],c.prototype,"maximumPixelRatio",void 0),c=t([s("esri.views.3d.support.QualitySettings.QualitySettings")],c);const u=c;export{u as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import i from"../../../../core/Accessor.js";import e from"../../../../core/Logger.js";import{lerp as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as s,createRenderScreenPointArray3 as h}from"../../../../core/screenUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as a,m as p,q as _,h as u,a as v,t as l,u as c}from"../../../../chunks/mat4.js";import{c as w}from"../../../../chunks/mat4f64.js";import{c as d,m as y}from"../../../../chunks/vec2.js";import{f as g}from"../../../../chunks/vec2f64.js";import{b as f,i as m,c as x,k as M,w as T,e as D,E as j,z as R,g as F,l as P,s as O,f as V,n as S,r as C}from"../../../../chunks/vec3.js";import{c as I}from"../../../../chunks/vec3f64.js";import{b,h as E,g as L,c as k,i as H,t as U}from"../../../../chunks/vec4.js";import{f as B,c as G}from"../../../../chunks/vec4f64.js";import{create as A,copy as z,fromMatrix as W}from"../../../../geometry/support/frustum.js";import{create as X}from"../../../../geometry/support/ray.js";import{projectPointSignedLength as Y}from"../../../../geometry/support/vector.js";import{ViewingMode as q}from"../../../ViewingMode.js";import{fovd2fovx as N,fovx2fovd as J,fovd2fovy as K,fovy2fovd as Q}from"./fov.js";var Z;let $=Z=class extends i{constructor(t={}){super(t),this._center=I(),this._up=I(),this._viewUp=I(),this._viewForward=I(),this._viewRight=I(),this._ray=X(),this._viewport=B(0,0,1,1),this._padding=B(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=g(1,1e3),this._viewDirty=!0,this._viewMatrix=w(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=w(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=w(),this._frustumDirty=!0,this._frustum=A(),this._fullViewport=G(),this._pixelRatio=1,this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return f(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){a(this._viewMatrix,t),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),this._viewForward}get viewUp(){return this._ensureViewClean(),this._viewUp}get viewRight(){return this._ensureViewClean(),this._viewRight}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=b(G(),this._viewport,1/this.pixelRatio),i=this._get("screenViewport");return i&&E(t,i)?i:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[ht.LEFT],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[ht.BOTTOM],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[ht.RIGHT]+this._padding[ht.LEFT]}set fullWidth(t){this.width=t-(this._padding[ht.RIGHT]+this._padding[ht.LEFT])}get fullHeight(){return this._viewport[3]+this._padding[ht.TOP]+this._padding[ht.BOTTOM]}set fullHeight(t){this.height=t-(this._padding[ht.TOP]+this._padding[ht.BOTTOM])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[ht.LEFT],this._fullViewport[1]=this._viewport[1]-this._padding[ht.BOTTOM],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){L(this._padding,t)||(this._viewport[0]+=t[ht.LEFT]-this._padding[ht.LEFT],this._viewport[1]+=t[ht.BOTTOM]-this._padding[ht.BOTTOM],this._viewport[2]-=t[ht.RIGHT]+t[ht.LEFT]-(this._padding[ht.RIGHT]+this._padding[ht.LEFT]),this._viewport[3]-=t[ht.TOP]+t[ht.BOTTOM]-(this._padding[ht.TOP]+this._padding[ht.BOTTOM]),k(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&(p(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){const t=this.width,i=this.height,e=this.near*Math.tan(this.fovY/2),r=e*this._aspect,s=_(w(),-r*(1+2*this._padding[ht.LEFT]/t),r*(1+2*this._padding[ht.RIGHT]/t),-e*(1+2*this._padding[ht.BOTTOM]/i),e*(1+2*this._padding[ht.TOP]/i),this.near,this.far),h=this._get("projectionMatrix");return h&&u(h,s)?h:s}get inverseProjectionMatrix(){return v(w(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||w()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return N(this._fov,this.width,this.height)}set fovX(t){this._fov=J(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return K(this._fov,this.width,this.height)}set fovY(t){this._fov=Q(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return m(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&(v(this._viewInverseTransposeMatrix,this.viewMatrix),l(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const i=2*t-1;return 2*this.near*this.far/(this.far+this.near-i*(this.far-this.near))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}copyFrom(t){x(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,k(this._viewport,t.viewport),this.notifyChange("_viewport"),k(this._padding,t.padding),this.notifyChange("_padding"),d(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.relativeElevation=t.relativeElevation;const i=t;return this._viewDirty=i._viewDirty,this._viewDirty||(a(this._viewMatrix,t.viewMatrix),x(this._viewRight,t.viewRight),x(this._viewUp,t.viewUp),x(this._viewForward,t.viewForward)),this._viewProjectionDirty=!0,this._frustumDirty=i._frustumDirty,this._frustumDirty||(z(this._frustum,t.frustum),this._frustumDirty=!1),i._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:(a(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),k(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up}clone(){return(new Z).copyFrom(this)}equals(t){return M(this.eye,t.eye)&&M(this.center,t.center)&&M(this.up,t.up)&&L(this._viewport,t.viewport)&&L(this._padding,t.padding)&&y(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation}almostEquals(t){if(Math.abs(t.fov-this._fov)>=.001||H(t.padding,this._padding)>=1||H(this.screenViewport,t.screenViewport)>=1)return!1;T(et,t.eye,t.center),T(rt,this.eye,this.center);const i=D(et,rt),e=j(et),r=j(rt),s=5e-4;return i*i>=(1-1e-10)*e*r&&R(t.eye,this.eye)<Math.max(e,r)*s*s}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs(Y(this.viewForward,f(et,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,i){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(i||1)))}getScreenCenter(t=s()){return t[0]=(this.padding[ht.LEFT]+this.width/2)/this.pixelRatio,t[1]=(this.padding[ht.TOP]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,i=.5,e=.5){return t[0]=this.padding[ht.LEFT]+this.width*i,t[1]=this.padding[ht.BOTTOM]+this.height*e,t[2]=.5,t}setGLViewport(t){const i=this.viewport,e=this.padding;t.setViewport(i[0]-e[3],i[1]-e[2],i[2]+e[1]+e[3],i[3]+e[0]+e[2])}applyProjection(t,i){t!==tt&&x(tt,t),tt[3]=1,U(tt,tt,this.projectionMatrix);const e=Math.abs(tt[3]);F(tt,tt,1/e);const s=this.fullViewport;i[0]=r(0,s[0]+s[2],.5+.5*tt[0]),i[1]=r(0,s[1]+s[3],.5+.5*tt[1]),i[2]=.5*(tt[2]+1),i[3]=e}unapplyProjection(t,i){const e=this.fullViewport;tt[0]=(t[0]/(e[0]+e[2])*2-1)*t[3],tt[1]=(t[1]/(e[1]+e[3])*2-1)*t[3],tt[2]=(2*t[2]-1)*t[3],tt[3]=t[3],null!=this.inverseProjectionMatrix&&(U(tt,tt,this.inverseProjectionMatrix),i[0]=tt[0],i[1]=tt[1],i[2]=tt[2])}projectToScreen(t,i){return this.projectToRenderScreen(t,st),this.renderToScreen(st,i),i}projectToRenderScreen(t,i){if(tt[0]=t[0],tt[1]=t[1],tt[2]=t[2],tt[3]=1,U(tt,tt,this.viewProjectionMatrix),0===tt[3])return null;F(tt,tt,1/Math.abs(tt[3]));const e=this.fullViewport;return"x"in i?(i.x=r(0,e[0]+e[2],.5+.5*tt[0]),i.y=r(0,e[1]+e[3],.5+.5*tt[1])):(i[0]=r(0,e[0]+e[2],.5+.5*tt[0]),i[1]=r(0,e[1]+e[3],.5+.5*tt[1]),i.length>2&&(i[2]=.5*(tt[2]+1))),i}unprojectFromScreen(t,i){return this.unprojectFromRenderScreen(this.screenToRender(t,st),i)}unprojectFromRenderScreen(t,i){if(p(it,this.projectionMatrix,this.viewMatrix),!v(it,it))return null;const e=this.fullViewport;return tt[0]=2*(t[0]-e[0])/e[2]-1,tt[1]=2*(t[1]-e[1])/e[3]-1,tt[2]=2*t[2]-1,tt[3]=1,U(tt,tt,it),0===tt[3]?null:(i[0]=tt[0]/tt[3],i[1]=tt[1]/tt[3],i[2]=tt[2]/tt[3],i)}constrainWindowSize(t,i,e,r){const s=t*this.pixelRatio,h=i*this.pixelRatio,o=Math.max(s-e/2,0),n=Math.max(this.fullHeight-h-r/2,0),a=-Math.min(s-e/2,0),p=-Math.min(this.fullHeight-h-r/2,0);return[o,n,e-a- -Math.min(this.fullWidth-s-e/2,0),r-p- -Math.min(h-r/2,0)]}computeUp(t){t===q.Global?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,i){const e=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return i[0]=e,i[1]=r,i}renderToScreen(t,i){const e=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;i[0]=e,i[1]=r}_computeUpGlobal(){f(et,this.center,this.eye);const t=P(this.center);t<1?(O(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs(D(et,this.center))>.9999*P(et)*t||(V(this._up,et,this.center),V(this._up,this._up,et),S(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_computeUpLocal(){C(et,this.eye,this.center),Math.abs(et[2])<=.9999&&(F(et,et,et[2]),O(this._up,-et[0],-et[1],1-et[2]),S(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_compareAndSetView(t,i,r=""){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?M(t,i)||(x(i,t),this._markViewDirty(),r.length&&this.notifyChange(r)):e.getLogger("esri.views.3d.webgl-engine.lib.Camera").warn("Camera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&(W(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&(c(this._viewMatrix,this.eye,this.center,this.up),O(this._viewForward,-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10]),O(this._viewUp,this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9]),O(this._viewRight,this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8]),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};t([o()],$.prototype,"_center",void 0),t([o()],$.prototype,"_up",void 0),t([o()],$.prototype,"_viewport",void 0),t([o()],$.prototype,"_padding",void 0),t([o()],$.prototype,"_fov",void 0),t([o()],$.prototype,"_nearFar",void 0),t([o()],$.prototype,"_pixelRatio",void 0),t([o()],$.prototype,"pixelRatio",null),t([o()],$.prototype,"eye",null),t([o()],$.prototype,"center",null),t([o()],$.prototype,"up",null),t([o({readOnly:!0})],$.prototype,"nearFar",null),t([o()],$.prototype,"near",null),t([o()],$.prototype,"far",null),t([o()],$.prototype,"viewport",null),t([o({readOnly:!0})],$.prototype,"screenViewport",null),t([o()],$.prototype,"x",null),t([o()],$.prototype,"y",null),t([o()],$.prototype,"width",null),t([o()],$.prototype,"height",null),t([o()],$.prototype,"fullWidth",null),t([o()],$.prototype,"fullHeight",null),t([o({readOnly:!0})],$.prototype,"_aspect",null),t([o()],$.prototype,"padding",null),t([o({readOnly:!0})],$.prototype,"projectionMatrix",null),t([o({readOnly:!0})],$.prototype,"inverseProjectionMatrix",null),t([o()],$.prototype,"fov",null),t([o()],$.prototype,"fovX",null),t([o()],$.prototype,"fovY",null),$=Z=t([n("esri.views.3d.webgl-engine.lib.Camera")],$);const tt=G(),it=w(),et=I(),rt=I(),st=h();var ht;!function(t){t[t.TOP=0]="TOP",t[t.RIGHT=1]="RIGHT",t[t.BOTTOM=2]="BOTTOM",t[t.LEFT=3]="LEFT"}(ht||(ht={}));export{$ as Camera,ht as PaddingSide};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import i from"../../../../core/Accessor.js";import e from"../../../../core/Logger.js";import{lerp as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as s,createRenderScreenPointArray3 as h}from"../../../../core/screenUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as a,m as p,q as _,j as u,a as v,t as l,u as c}from"../../../../chunks/mat4.js";import{c as w}from"../../../../chunks/mat4f64.js";import{c as d,m as y}from"../../../../chunks/vec2.js";import{f as g}from"../../../../chunks/vec2f64.js";import{b as f,i as m,c as x,k as M,w as T,e as D,E as j,z as R,g as F,l as P,s as O,f as V,n as S,r as C}from"../../../../chunks/vec3.js";import{c as I}from"../../../../chunks/vec3f64.js";import{b,h as E,g as L,c as k,i as H,t as U}from"../../../../chunks/vec4.js";import{f as B,c as G}from"../../../../chunks/vec4f64.js";import{create as A,copy as z,fromMatrix as W}from"../../../../geometry/support/frustum.js";import{create as X}from"../../../../geometry/support/ray.js";import{projectPointSignedLength as Y}from"../../../../geometry/support/vector.js";import{ViewingMode as q}from"../../../ViewingMode.js";import{fovd2fovx as N,fovx2fovd as J,fovd2fovy as K,fovy2fovd as Q}from"./fov.js";var Z;let $=Z=class extends i{constructor(t={}){super(t),this._center=I(),this._up=I(),this._viewUp=I(),this._viewForward=I(),this._viewRight=I(),this._ray=X(),this._viewport=B(0,0,1,1),this._padding=B(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=g(1,1e3),this._viewDirty=!0,this._viewMatrix=w(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=w(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=w(),this._frustumDirty=!0,this._frustum=A(),this._fullViewport=G(),this._pixelRatio=1,this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return f(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){a(this._viewMatrix,t),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),this._viewForward}get viewUp(){return this._ensureViewClean(),this._viewUp}get viewRight(){return this._ensureViewClean(),this._viewRight}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=b(G(),this._viewport,1/this.pixelRatio),i=this._get("screenViewport");return i&&E(t,i)?i:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[ht.LEFT],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[ht.BOTTOM],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[ht.RIGHT]+this._padding[ht.LEFT]}set fullWidth(t){this.width=t-(this._padding[ht.RIGHT]+this._padding[ht.LEFT])}get fullHeight(){return this._viewport[3]+this._padding[ht.TOP]+this._padding[ht.BOTTOM]}set fullHeight(t){this.height=t-(this._padding[ht.TOP]+this._padding[ht.BOTTOM])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[ht.LEFT],this._fullViewport[1]=this._viewport[1]-this._padding[ht.BOTTOM],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){L(this._padding,t)||(this._viewport[0]+=t[ht.LEFT]-this._padding[ht.LEFT],this._viewport[1]+=t[ht.BOTTOM]-this._padding[ht.BOTTOM],this._viewport[2]-=t[ht.RIGHT]+t[ht.LEFT]-(this._padding[ht.RIGHT]+this._padding[ht.LEFT]),this._viewport[3]-=t[ht.TOP]+t[ht.BOTTOM]-(this._padding[ht.TOP]+this._padding[ht.BOTTOM]),k(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&(p(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){const t=this.width,i=this.height,e=this.near*Math.tan(this.fovY/2),r=e*this._aspect,s=_(w(),-r*(1+2*this._padding[ht.LEFT]/t),r*(1+2*this._padding[ht.RIGHT]/t),-e*(1+2*this._padding[ht.BOTTOM]/i),e*(1+2*this._padding[ht.TOP]/i),this.near,this.far),h=this._get("projectionMatrix");return h&&u(h,s)?h:s}get inverseProjectionMatrix(){return v(w(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||w()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return N(this._fov,this.width,this.height)}set fovX(t){this._fov=J(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return K(this._fov,this.width,this.height)}set fovY(t){this._fov=Q(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return m(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&(v(this._viewInverseTransposeMatrix,this.viewMatrix),l(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const i=2*t-1;return 2*this.near*this.far/(this.far+this.near-i*(this.far-this.near))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}copyFrom(t){x(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,k(this._viewport,t.viewport),this.notifyChange("_viewport"),k(this._padding,t.padding),this.notifyChange("_padding"),d(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.relativeElevation=t.relativeElevation;const i=t;return this._viewDirty=i._viewDirty,this._viewDirty||(a(this._viewMatrix,t.viewMatrix),x(this._viewRight,t.viewRight),x(this._viewUp,t.viewUp),x(this._viewForward,t.viewForward)),this._viewProjectionDirty=!0,this._frustumDirty=i._frustumDirty,this._frustumDirty||(z(this._frustum,t.frustum),this._frustumDirty=!1),i._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:(a(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),k(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up}clone(){return(new Z).copyFrom(this)}equals(t){return M(this.eye,t.eye)&&M(this.center,t.center)&&M(this.up,t.up)&&L(this._viewport,t.viewport)&&L(this._padding,t.padding)&&y(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation}almostEquals(t){if(Math.abs(t.fov-this._fov)>=.001||H(t.padding,this._padding)>=1||H(this.screenViewport,t.screenViewport)>=1)return!1;T(et,t.eye,t.center),T(rt,this.eye,this.center);const i=D(et,rt),e=j(et),r=j(rt),s=5e-4;return i*i>=(1-1e-10)*e*r&&R(t.eye,this.eye)<Math.max(e,r)*s*s}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs(Y(this.viewForward,f(et,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,i){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(i||1)))}getScreenCenter(t=s()){return t[0]=(this.padding[ht.LEFT]+this.width/2)/this.pixelRatio,t[1]=(this.padding[ht.TOP]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,i=.5,e=.5){return t[0]=this.padding[ht.LEFT]+this.width*i,t[1]=this.padding[ht.BOTTOM]+this.height*e,t[2]=.5,t}setGLViewport(t){const i=this.viewport,e=this.padding;t.setViewport(i[0]-e[3],i[1]-e[2],i[2]+e[1]+e[3],i[3]+e[0]+e[2])}applyProjection(t,i){t!==tt&&x(tt,t),tt[3]=1,U(tt,tt,this.projectionMatrix);const e=Math.abs(tt[3]);F(tt,tt,1/e);const s=this.fullViewport;i[0]=r(0,s[0]+s[2],.5+.5*tt[0]),i[1]=r(0,s[1]+s[3],.5+.5*tt[1]),i[2]=.5*(tt[2]+1),i[3]=e}unapplyProjection(t,i){const e=this.fullViewport;tt[0]=(t[0]/(e[0]+e[2])*2-1)*t[3],tt[1]=(t[1]/(e[1]+e[3])*2-1)*t[3],tt[2]=(2*t[2]-1)*t[3],tt[3]=t[3],null!=this.inverseProjectionMatrix&&(U(tt,tt,this.inverseProjectionMatrix),i[0]=tt[0],i[1]=tt[1],i[2]=tt[2])}projectToScreen(t,i){return this.projectToRenderScreen(t,st),this.renderToScreen(st,i),i}projectToRenderScreen(t,i){if(tt[0]=t[0],tt[1]=t[1],tt[2]=t[2],tt[3]=1,U(tt,tt,this.viewProjectionMatrix),0===tt[3])return null;F(tt,tt,1/Math.abs(tt[3]));const e=this.fullViewport;return"x"in i?(i.x=r(0,e[0]+e[2],.5+.5*tt[0]),i.y=r(0,e[1]+e[3],.5+.5*tt[1])):(i[0]=r(0,e[0]+e[2],.5+.5*tt[0]),i[1]=r(0,e[1]+e[3],.5+.5*tt[1]),i.length>2&&(i[2]=.5*(tt[2]+1))),i}unprojectFromScreen(t,i){return this.unprojectFromRenderScreen(this.screenToRender(t,st),i)}unprojectFromRenderScreen(t,i){if(p(it,this.projectionMatrix,this.viewMatrix),!v(it,it))return null;const e=this.fullViewport;return tt[0]=2*(t[0]-e[0])/e[2]-1,tt[1]=2*(t[1]-e[1])/e[3]-1,tt[2]=2*t[2]-1,tt[3]=1,U(tt,tt,it),0===tt[3]?null:(i[0]=tt[0]/tt[3],i[1]=tt[1]/tt[3],i[2]=tt[2]/tt[3],i)}constrainWindowSize(t,i,e,r){const s=t*this.pixelRatio,h=i*this.pixelRatio,o=Math.max(s-e/2,0),n=Math.max(this.fullHeight-h-r/2,0),a=-Math.min(s-e/2,0),p=-Math.min(this.fullHeight-h-r/2,0);return[o,n,e-a- -Math.min(this.fullWidth-s-e/2,0),r-p- -Math.min(h-r/2,0)]}computeUp(t){t===q.Global?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,i){const e=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return i[0]=e,i[1]=r,i}renderToScreen(t,i){const e=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;i[0]=e,i[1]=r}_computeUpGlobal(){f(et,this.center,this.eye);const t=P(this.center);t<1?(O(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs(D(et,this.center))>.9999*P(et)*t||(V(this._up,et,this.center),V(this._up,this._up,et),S(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_computeUpLocal(){C(et,this.eye,this.center),Math.abs(et[2])<=.9999&&(F(et,et,et[2]),O(this._up,-et[0],-et[1],1-et[2]),S(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_compareAndSetView(t,i,r=""){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?M(t,i)||(x(i,t),this._markViewDirty(),r.length&&this.notifyChange(r)):e.getLogger("esri.views.3d.webgl-engine.lib.Camera").warn("Camera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&(W(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&(c(this._viewMatrix,this.eye,this.center,this.up),O(this._viewForward,-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10]),O(this._viewUp,this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9]),O(this._viewRight,this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8]),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};t([o()],$.prototype,"_center",void 0),t([o()],$.prototype,"_up",void 0),t([o()],$.prototype,"_viewport",void 0),t([o()],$.prototype,"_padding",void 0),t([o()],$.prototype,"_fov",void 0),t([o()],$.prototype,"_nearFar",void 0),t([o()],$.prototype,"_pixelRatio",void 0),t([o()],$.prototype,"pixelRatio",null),t([o()],$.prototype,"eye",null),t([o()],$.prototype,"center",null),t([o()],$.prototype,"up",null),t([o({readOnly:!0})],$.prototype,"nearFar",null),t([o()],$.prototype,"near",null),t([o()],$.prototype,"far",null),t([o()],$.prototype,"viewport",null),t([o({readOnly:!0})],$.prototype,"screenViewport",null),t([o()],$.prototype,"x",null),t([o()],$.prototype,"y",null),t([o()],$.prototype,"width",null),t([o()],$.prototype,"height",null),t([o()],$.prototype,"fullWidth",null),t([o()],$.prototype,"fullHeight",null),t([o({readOnly:!0})],$.prototype,"_aspect",null),t([o()],$.prototype,"padding",null),t([o({readOnly:!0})],$.prototype,"projectionMatrix",null),t([o({readOnly:!0})],$.prototype,"inverseProjectionMatrix",null),t([o()],$.prototype,"fov",null),t([o()],$.prototype,"fovX",null),t([o()],$.prototype,"fovY",null),$=Z=t([n("esri.views.3d.webgl-engine.lib.Camera")],$);const tt=G(),it=w(),et=I(),rt=I(),st=h();var ht;!function(t){t[t.TOP=0]="TOP",t[t.RIGHT=1]="RIGHT",t[t.BOTTOM=2]="BOTTOM",t[t.LEFT=3]="LEFT"}(ht||(ht={}));export{$ as Camera,ht as PaddingSide};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{NestedMap as i}from"../../../../core/NestedMap.js";import{RenderState as e}from"../../../support/RenderState.js";var t;function a(a=!has("disable-feature:high-quality-idle")){const s=new i;return a?(s.set(e.IDLE,t.Antialiasing,!0),s.set(e.IDLE,t.HighQualityTransparency,!0),s.set(e.IDLE,t.HighQualityAtmosphere,!0),s.set(e.IDLE,t.SSAO,!0),s.set(e.IDLE,t.WaterReflection,!0),s.set(e.IDLE,t.PhysicalPixelRendering,!has("esri-mobile"))):(s.set(e.ANIMATING,t.HighQualityShadows,!0),s.set(e.INTERACTING,t.HighQualityShadows,!0)),s.set(e.IDLE,t.HighQualityShadows,!0),s.set(e.IDLE,t.HighQualityVoxel,!0),s}!function(i){i[i.Antialiasing=0]="Antialiasing",i[i.HighQualityTransparency=1]="HighQualityTransparency",i[i.HighQualityVoxel=2]="HighQualityVoxel",i[i.HighQualityAtmosphere=3]="HighQualityAtmosphere",i[i.SSAO=4]="SSAO",i[i.WaterReflection=5]="WaterReflection",i[i.HighQualityShadows=6]="HighQualityShadows",i[i.PhysicalPixelRendering=7]="PhysicalPixelRendering"}(t||(t={}));export{t as RenderFeature,a as setupFeatureDefaults};
5
+ import has from"../../../../core/has.js";import{NestedMap as e}from"../../../../core/NestedMap.js";import{RenderState as i}from"../../../support/RenderState.js";var o;function t(t=!has("disable-feature:high-quality-idle")){const s=new e;return t?(s.set(i.IDLE,o.Antialiasing,!0),s.set(i.IDLE,o.HighQualityTransparency,!0),s.set(i.IDLE,o.HighResolutionAtmosphere,!0),s.set(i.IDLE,o.SSAO,!0),s.set(i.IDLE,o.WaterReflection,!0),s.set(i.IDLE,o.PhysicalPixelRendering,!has("esri-mobile"))):(s.set(i.ANIMATING,o.HighResolutionShadows,!0),s.set(i.INTERACTING,o.HighResolutionShadows,!0)),s.set(i.IDLE,o.HighResolutionShadows,!0),s.set(i.IDLE,o.HighResolutionVoxel,!0),s}!function(e){e[e.Antialiasing=0]="Antialiasing",e[e.HighQualityTransparency=1]="HighQualityTransparency",e[e.HighResolutionVoxel=2]="HighResolutionVoxel",e[e.HighResolutionAtmosphere=3]="HighResolutionAtmosphere",e[e.SSAO=4]="SSAO",e[e.WaterReflection=5]="WaterReflection",e[e.HighResolutionShadows=6]="HighResolutionShadows",e[e.PhysicalPixelRendering=7]="PhysicalPixelRendering"}(o||(o={}));export{o as RenderFeature,t as setupFeatureDefaults};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import t from"../../../../core/PooledArray.js";import{isPromiseLike as n,createAbortError as s}from"../../../../core/promiseUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{union as a}from"./depthRange.js";import{RenderOccludedFlag as l}from"./Material.js";import{RenderSlot as u}from"./RenderSlot.js";let d=class extends r{constructor(e){super({}),this._context=e,this._renderPlugins=new t,this._slots=[];for(let r=0;r<u.MAX_SLOTS;++r)this._slots[r]=[]}normalizeCtorArgs(){return{}}add(e,r,t){const o=()=>{if(t?.aborted)throw r.uninitializeRenderContext(),s();this._renderPlugins.push(r);for(const t of e)this._slots[t].push(r);this._context.requestRender()},i=r.initializeRenderContext(this._context,t);if(n(i))return i.then(o);o(),this.notifyChange("updating")}remove(e){if(null!=this._renderPlugins.removeUnordered(e)){for(let r=0;r<this._slots.length;++r)this._slots[r]=this._slots[r].filter((r=>r!==e));e.uninitializeRenderContext(),this._context.requestRender(),this.notifyChange("updating")}}prepareRender(){this._renderPlugins.forAll((e=>{e.prepareRender&&e.prepareRender(this._context.renderContext)}))}updateAnimation(e){let r=!1;return this._renderPlugins.forAll((t=>{t.updateAnimation&&(r=t.updateAnimation(e)||r)})),r}prepareSlots(e){for(const r of e)this._context.renderContext.bindParameters.slot=r,this._slots[r].filter((e=>{e.canRender&&(p(e)&&e.prepareTechnique(this._context.renderContext),h(e)&&e.prepareTechniques(this._context.renderContext))}))}render(){const e=this._slots[this._context.renderContext.bindParameters.slot],r=new Array;e.filter((e=>{if(!e.canRender)return!1;if(p(e)){const t=e.prepareTechnique(this._context.renderContext);return null!=t&&(r.push(t),!0)}if(h(e)){const t=e.prepareTechniques(this._context.renderContext);return null!=t&&(r.push(t),!0)}return r.push(null),!0})).forEach(((e,t)=>e.render(this._context.renderContext,r[t])))}queryDepthRange(e){const r=c;return r.near=1/0,r.far=-1/0,this._renderPlugins.forAll((t=>{if(t.queryDepthRange){const n=t.queryDepthRange(e);n&&a(r,n,r)}})),r}get updating(){return this._renderPlugins.some((e=>e.running))}get needsTransparentPass(){return this._renderPlugins.some((e=>!!e.needsTransparentPass))}get needsHighlight(){return this._renderPlugins.some((e=>!!e.needsHighlight))}get needsLinearDepth(){return this._renderPlugins.some((e=>!!e.needsLinearDepth))}get needsLaserlineWithContrastControl(){const e=this._slots[u.LASERLINES_CONTRAST_CONTROL];return!!e&&e.length>0}get renderOccludedFlags(){return this._renderPlugins.reduce(((e,r)=>e|r.renderOccludedFlags),l.None)}};function p(e){return"prepareTechnique"in e}function h(e){return"prepareTechniques"in e}e([o()],d.prototype,"_renderPlugins",void 0),e([o({readOnly:!0})],d.prototype,"updating",null),d=e([i("esri.views.3d.webgl-engine.lib.RenderPluginManager")],d);const c={near:0,far:0};export{d as RenderPluginManager};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import t from"../../../../core/PooledArray.js";import{isPromiseLike as n,createAbortError as s}from"../../../../core/promiseUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{union as l}from"./depthRange.js";import{RenderOccludedFlag as u}from"./Material.js";import{RenderSlot as a}from"./RenderSlot.js";let d=class extends r{constructor(e){super({}),this._context=e,this._renderPlugins=new t,this._slots=[];for(let r=0;r<a.MAX_SLOTS;++r)this._slots[r]=[]}normalizeCtorArgs(){return{}}add(e,r,t){const o=()=>{if(t?.aborted)throw r.uninitializeRenderContext(),s();this._renderPlugins.push(r);for(const t of e)this._slots[t].push(r);this._context.requestRender()},i=r.initializeRenderContext(this._context,t);if(n(i))return i.then(o);o(),this.notifyChange("_renderPlugins")}remove(e){if(null!=this._renderPlugins.removeUnordered(e)){for(let r=0;r<this._slots.length;++r)this._slots[r]=this._slots[r].filter((r=>r!==e));e.uninitializeRenderContext(),this._context.requestRender(),this.notifyChange("_renderPlugins")}}prepareRender(){this._renderPlugins.forAll((e=>{e.prepareRender&&e.prepareRender(this._context.renderContext)}))}updateAnimation(e){let r=!1;return this._renderPlugins.forAll((t=>{t.updateAnimation&&(r=t.updateAnimation(e)||r)})),r}prepareSlots(e){for(const r of e)this._context.renderContext.bindParameters.slot=r,this._slots[r].filter((e=>{e.canRender&&(p(e)&&e.prepareTechnique(this._context.renderContext),h(e)&&e.prepareTechniques(this._context.renderContext))}))}render(){const e=this._slots[this._context.renderContext.bindParameters.slot],r=new Array;e.filter((e=>{if(!e.canRender)return!1;if(p(e)){const t=e.prepareTechnique(this._context.renderContext);return null!=t&&(r.push(t),!0)}if(h(e)){const t=e.prepareTechniques(this._context.renderContext);return null!=t&&(r.push(t),!0)}return r.push(null),!0})).forEach(((e,t)=>e.render(this._context.renderContext,r[t])))}queryDepthRange(e){const r=c;return r.near=1/0,r.far=-1/0,this._renderPlugins.forAll((t=>{if(t.queryDepthRange){const n=t.queryDepthRange(e);n&&l(r,n,r)}})),r}get updating(){return this._renderPlugins.some((e=>e.running))}get needsTransparentPass(){return this._renderPlugins.some((e=>e.needsTransparentPass))}get needsHighlight(){return this._renderPlugins.some((e=>e.needsHighlight))}get needsLinearDepth(){return this._renderPlugins.some((e=>e.needsLinearDepth))}get needsLaserlineWithContrastControl(){const e=this._slots[a.LASERLINES_CONTRAST_CONTROL];return!!e&&e.length>0}get renderOccludedFlags(){return this._renderPlugins.reduce(((e,r)=>e|r.renderOccludedFlags),u.None)}};function p(e){return"prepareTechnique"in e}function h(e){return"prepareTechniques"in e}e([o()],d.prototype,"_renderPlugins",void 0),e([o({readOnly:!0})],d.prototype,"updating",null),d=e([i("esri.views.3d.webgl-engine.lib.RenderPluginManager")],d);const c={near:0,far:0};export{d as RenderPluginManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{update as t}from"../../../../core/arrayUtils.js";import s from"../../../../core/Handles.js";import has from"../../../../core/has.js";import{removeMaybe as i,disposeMaybe as a,destroyMaybe as n,applySome as h}from"../../../../core/maybe.js";import o from"../../../../core/PooledArray.js";import{watch as d,syncAndInitial as l,initial as _,sync as p}from"../../../../core/reactiveUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{h as u,a as f,m as T}from"../../../../chunks/mat4.js";import{I as g,c as R}from"../../../../chunks/mat4f64.js";import{a as A}from"../../../../chunks/boundedPlane.js";import E from"../../support/debugFlags.js";import{TransparencyMode as S}from"../../terrain/TerrainRenderer.js";import{RenderPassManager as P}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as b}from"../core/shaderLibrary/ShaderOutput.js";import{HUDTransparencyRenderStyle as y}from"../core/shaderLibrary/hud/HUDUniforms.js";import{AnimationTimeStep as I}from"./AnimationTimeStep.js";import{Decorations as O,RenderRequestType as C,StencilBits as D}from"./basicInterfaces.js";import{BoundingInfo as w}from"./BoundingInfo.js";import{ZERO as x,union as N}from"./depthRange.js";import{depthRangeFromScene as L}from"./depthRangeUtils.js";import{createEmptyDepthTexture as H}from"./glUtil3D.js";import{Highlight as M}from"./Highlight.js";import{RenderOccludedFlag as v}from"./Material.js";import{OffscreenRendering as U}from"./OffscreenRendering.js";import{RenderContext as F}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as j}from"./rendererUtils.js";import{RenderFeature as q,setupFeatureDefaults as G}from"./RenderFeature.js";import{RenderPluginManager as V}from"./RenderPluginManager.js";import{RenderSlot as B}from"./RenderSlot.js";import{ShadowAccumulator as Q}from"./ShadowAccumulator.js";import{ShadowHighlight as k}from"./ShadowHighlight.js";import{ShadowMap as W,SnapshotSlot as Y}from"./ShadowMap.js";import X from"./SliceHelper.js";import{SmaaRenderPass as z}from"./SmaaRenderPass.js";import{SSAOHelper as J}from"./SSAOHelper.js";import{TransparencyPassType as K}from"./TransparencyPassType.js";import{EdgeView as Z}from"./edgeRendering/EdgeView.js";import{Transparency as $}from"./edgeRendering/interfaces.js";import{MergedRenderer as ee}from"../materials/renderers/MergedRenderer.js";import{AlphaMode as re}from"../shaders/CompositingTechniqueConfiguration.js";import{RendererPerformanceInfo as te,PerformanceCategory as se}from"../statistics/RendererPerformanceInfo.js";import{RenderState as ie}from"../../../support/RenderState.js";import{ClearBufferBit as ae,PixelFormat as ne,PixelType as he}from"../../../webgl/enums.js";let oe=class extends r{get _bindParameters(){return this._renderContext.bindParameters}isFeatureEnabled(e,r=this._state){return this._renderStateFeatures.get(r,e)??!1}setFeatureEnabled(e,r,t){this._renderStateFeatures.set(r,e,t),this.notifyChange("_renderStateFeatures"),this._requestRender()}get _antialiasing(){return this._antialiasingEnabled||this.isFeatureEnabled(q.Antialiasing)}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(q.HighQualityTransparency)}get hasReflections(){return this.hasWater&&(this._ssrEnabled||this.isFeatureEnabled(q.WaterReflection))}get hasWater(){return this._hasWater||this._hasOverlayWater}constructor(e,r,t,i,a,n,h,p){super({}),this._stage=e,this._materialRepository=r,this._techniqueRepository=i,this._rctx=a,this._compositingHelper=n,this._magnifierHelper=h,this._requestRender=p,this._materialRenderers=new o,this._needsTransparentPass=!1,this._hasHUDElements=!1,this._hasHighlights=!1,this._hasWater=!1,this._hasOverlayWater=!1,this._renderOverlay=e=>{},this._isRendering=!1,this._fallbackDepthStencilTexture=null,this._sliceHelper=new X,this._state=ie.IDLE,this._renderStateFeatures=G(),this._antialiasingEnabled=!0,this._highQualityTransparencyEnabled=!0,this._terrainRenderingEnabled=!0,this._terrainTransparency=S.Opaque,this._ssrEnabled=!1,this._ssaoEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new I,this._handles=new s,this._renderHiddenTransparentEdges=()=>{},this._oitUsed=!1,this._smaaPass=new z(this._rctx,i),p(),this._offscreen=new U(this._rctx,this._compositingHelper),this.performanceInfo=new te(this._rctx),this._shadowMap=new W(this._rctx,e.viewingMode),this._ssaoHelper=new J(e.view,i,this._rctx,p),this._highlight=new M(i,this._rctx),this._shadowHighlight=new k(this._rctx,e.viewingMode),this._shadowAccumulator=new Q(this._rctx,i,e,(e=>{const r=this.shadowsEnabled;this._shadowMap.enabled=!0,this._prepare(e.camera,e.contentCamera),this._renderPlugins.prepareRender(),this._shadowMap.enabled=r}),((e,r,t)=>{e.shadowMap.start(e.camera,r,t,!0,this._stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(b.Shadow,e.shadowMap),e.camera.setGLViewport(this._rctx),this._prepare(e.camera,e.contentCamera)}),p),this._renderContext=new F(this._rctx,this._offscreen,this._shadowMap,this._ssaoHelper,this._sliceHelper),this._renderPlugins=new V({renderContext:this._renderContext,techniqueRepository:i,textureRepository:t,materialRepository:this._materialRepository,requestRender:p,controller:e}),this.renderPassManager=new P(this._rctx,this._techniqueRepository),this._renderPlugins.add(this.renderPassManager.slots(),this.renderPassManager),this._handles.add([d((()=>this._stage.view.state.camera),(()=>p()),l),d((()=>E.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges($.TRANSPARENT):()=>{},p()}),_),d((()=>this._ssaoEnabled||this.isFeatureEnabled(q.SSAO)),(e=>this._ssaoHelper.enabled=e),l)])}normalizeCtorArgs(){return{}}destroy(){this._handles.destroy(),this._smaaPass.dispose(),this._gpuTimerHandle=i(this._gpuTimerHandle),this._materialRenderers.forAll((e=>e.dispose())),this._materialRenderers.clear(),this._offscreen.dispose(),this._fallbackDepthStencilTexture=a(this._fallbackDepthStencilTexture),this._shadowMap.dispose(),this._ssaoHelper.destroy(),this._highlight.dispose(),this._shadowHighlight.dispose(),this._shadowAccumulator.dispose(),this._edgeView=n(this._edgeView),this.renderPassManager.destroy(),w.prune()}disposeOffscreenBuffers(){this._offscreen.dispose(),this._shadowMap.disposeOffscreenBuffers(),this._smaaPass.disable(),this._ssaoHelper.disposeOffscreenBuffers()}get updating(){return this._antialiasing&&this._smaaPass.updating||null!=this._edgeView&&this._edgeView.updating||this._shadowAccumulator.running||this._renderPlugins.updating||!this.isCameraFinal}ensureEdgeView(){if(null==this._edgeView){const e=this._stage.view.resourceController;this._edgeView=new Z({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniqueRepository:this._techniqueRepository,setNeedsRender:()=>this._requestRender(),schedule:ue(e)}),this._handles.add(d((()=>h(this._edgeView,(e=>e.updating))),(()=>this._requestRender()),p)),this._requestRender()}return this._edgeView}get edgeView(){return this._edgeView}get isCameraFinal(){return u(this._bindParameters.ssr.reprojectionMatrix,g)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this.notifyChange("isCameraFinal")}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:r,_bindParameters:t}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.qualitySettings?.ambientOcclusion&&this._ssaoEnabled!==e.qualitySettings.ambientOcclusion&&(this._ssaoEnabled=e.qualitySettings.ambientOcclusion,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&r.maxCascades!==e.shadowMapMaxCascades&&(r.maxCascades=e.shadowMapMaxCascades,this._requestRender()),null!=e.environment){null!=e.environment.weather&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=!!e.weatherVisible);const r="virtual"!==e.environment.lighting.type;t.enableFillLights!==r&&(t.enableFillLights=r,this._requestRender())}e.background&&this._offscreen.background!==e.background&&(this._offscreen.background=e.background,this._requestRender()),void 0!==e.antialiasingEnabled&&this._antialiasingEnabled!==e.antialiasingEnabled&&(this._antialiasingEnabled=e.antialiasingEnabled,this._requestRender()),void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.defaultHighlightOptions&&(this._highlight.setDefaultOptions(e.defaultHighlightOptions),this._shadowHighlight.setDefaultOptions(e.defaultHighlightOptions),this._requestRender()),void 0!==e.overlays&&this._bindParameters.overlays!==e.overlays&&(this._bindParameters.overlays=e.overlays,this._requestRender()),void 0!==e.hasOverlayWater&&this._hasOverlayWater!==e.hasOverlayWater&&(this._hasOverlayWater=e.hasOverlayWater,this._requestRender()),void 0!==e.renderOverlay&&this._renderOverlay!==e.renderOverlay&&(this._renderOverlay=e.renderOverlay,this._requestRender()),void 0!==e.slicePlane&&this._sliceHelper.plane!==e.slicePlane&&(this._sliceHelper.plane=e.slicePlane,this._requestRender()),void 0!==e.terrainRenderingEnabled&&this._terrainRenderingEnabled!==e.terrainRenderingEnabled&&(this._terrainRenderingEnabled=e.terrainRenderingEnabled,this._requestRender()),void 0!==e.terrainTransparency&&this._terrainTransparency!==e.terrainTransparency&&(this._terrainTransparency=e.terrainTransparency,this._requestRender()),void 0!==e.shadowCastOptions&&this._shadowAccumulator.setOptions(e.shadowCastOptions)}get hasSlicePlane(){return!!this._sliceHelper.plane}get renderPlugins(){return this._renderPlugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}modify(e,r){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:t,removes:s,updates:i}=e;if(0===t.length&&0===s.length&&0===i.length)return;const a=j(e);let n=!1;a.forEach(((t,s)=>{if(r.done)return;let i=this._materialRenderers.find((e=>e.material===s));null==i&&t.adds.length>0&&(i=new ee(this._rctx,this._materialRepository,s),this._materialRenderers.push(i)),i&&(i.modify(t),i.isEmpty&&(n=!0)),t.removes.forEach((r=>e.removes.removeUnordered(r))),t.adds.forEach((r=>e.adds.removeUnordered(r))),t.updates.forEach((r=>e.updates.removeUnordered(r))),r.madeProgress()})),n&&this._materialRenderers.filterInPlace((e=>!e.isEmpty||(e.dispose(),!1))),this._hasHighlights=this._materialRenderers.some((e=>e.hasHighlights)),this._bindParameters.hasOccludees=this._materialRenderers.some((e=>e.hasOccludees)),this._hasWater=this._materialRenderers.some((e=>e.hasWater)),this._hasHUDElements=this._materialRenderers.some((e=>e.requiresSlot(B.LINE_CALLOUTS_HUD_DEPTH,b.Color)||e.requiresSlot(B.HUD_MATERIAL,b.Color)||e.requiresSlot(B.LABEL_MATERIAL,b.Color))),this._requestRender()}updateAnimation(e){const r=this._hasAnimations;return this._hasAnimations=!1,this._materialRenderers.forAll((r=>this._hasAnimations=r.updateAnimation(e)||this._hasAnimations)),this._hasAnimations=this._renderPlugins.updateAnimation(e)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?i(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}render(e,r,t,s,i){this._isRendering=!0,this._oitUsed=!1,this.performanceInfo.startFrame();const{camera:a,contentCamera:n,mode:h,alignPixelEnabled:o}=t;this._state=h,this._renderOverlay(i),this.performanceInfo.advance(se.OVERLAY),this._renderContext.time=i,this._bindParameters.transparencyPassType=K.NONE,this._bindParameters.alignPixelEnabled=o;const d=this._offscreen;d.setupRenderTarget(this.hasReflections);const l=A(this._sliceHelper.plane);s===O.OFF&&(this._sliceHelper.plane=null),this._rctx.bindFramebuffer(e),a.setGLViewport(this._rctx),this._prepare(a,n),this._renderPlugins.prepareRender(),this.performanceInfo.advance(se.PREPARE);const _=this._computeDepthRange(a);this._renderShadowMap(e,a,this._bindParameters.lighting.mainLight.direction,_),this.performanceInfo.advance(se.SHADOW_MAP),d.initializeFrame(a),this._ensureBindParameters(a,n);const p=this._terrainRenderingEnabled&&(this._terrainTransparency===S.Semitransparent||this._terrainTransparency===S.TransparentWithDraped),c=this._highQualityTransparency&&p,m=this._needsTransparentPass||this._renderPlugins.needsTransparentPass;this._prepareShaders(c,m),this._renderLinearDepth(),this.performanceInfo.advance(se.LINEAR_DEPTH),this._accumulateShadows(_,a,n),this.performanceInfo.advance(se.ACCUMULATED_SHADOWS),this._renderNormal(),this.performanceInfo.advance(se.NORMALS),this._ensureBindParametersSSR(i),this._renderSSAO(i),this.performanceInfo.advance(se.SSAO),this._renderContext.output=b.Color,d.bindFramebuffer(),this._renderOpaqueGeometry(),this.performanceInfo.advance(se.OPAQUE),this._renderTerrainLinearDepth(c),this._setMultipassTerrain(c),this._renderEdges($.OPAQUE),this.performanceInfo.advance(se.OPAQUE_EDGES),this._offscreen.bindTarget(this._offscreen.currentColorTarget,this._offscreen.mainDepth),this._renderSlot(B.VOXEL),this.performanceInfo.advance(se.VOXEL),this._renderHiddenTransparentEdges(),m&&(this._oitEnabled?this._renderOITPass(de.Geometry):this._renderTransparentGeometry()),this.performanceInfo.advance(se.TRANSPARENT),this._renderGeometryLinearDepth(c);const u=this._renderHUDVisibility(c);c||this._renderInternalSlot(B.LINE_CALLOUTS),this.performanceInfo.advance(se.HUD_VISIBILITY),this._renderObjectAndLayerIdColor(r),this.performanceInfo.advance(se.OBJECT_AND_LAYER_ID_COLOR),this._renderEdges($.TRANSPARENT,c),this.performanceInfo.advance(se.TRANSPARENT_EDGES),this._renderTransparentTerrain(),p&&u&&(c?this._renderLineCallouts(y.Occluded):d.compositeTransparentTerrainOntoHUDVisibility(this._bindParameters),this._renderHUD(y.Occluded,d.framebuffer),this.performanceInfo.advance(se.HUD_OCCLUDED)),this.performanceInfo.advance(se.TRANSPARENT_TERRAIN),this._setTerrainCulling(!1),p&&(d.compositeTransparentTerrainOntoMain(this._bindParameters),c&&(this._renderEdges($.OPAQUE),this.performanceInfo.advance(se.OPAQUE_EDGES),m&&(this._oitEnabled?this._renderOITPass(de.Geometry):this._renderTransparentGeometry()),this.performanceInfo.advance(se.TRANSPARENT),this._renderEdges($.TRANSPARENT),this.performanceInfo.advance(se.TRANSPARENT_EDGES))),c&&this._renderLineCallouts(y.NotOccluded),this._setMultipassEnabled(!1),this._shadowAccumulator.render(this._bindParameters),d.renderToTargets((()=>{this._renderInternalSlot(B.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderSlot(B.POSTPROCESSING_ENVIRONMENT_TRANSPARENT),this._renderSlot(B.LASERLINES)}),d.currentColorTarget,d.mainDepth),this.performanceInfo.advance(se.ENVIRONMENT),this._renderPlugins.needsLaserlineWithContrastControl&&d.renderTmpAndCompositeToMain((()=>this._renderSlot(B.LASERLINES_CONTRAST_CONTROL)),this._bindParameters,re.PremultipliedAlpha),this.performanceInfo.advance(se.LASER_LINE),this._renderOccluded(),this.performanceInfo.advance(se.OCCLUDED);const f=s===O.ON&&this._magnifierHelper.enabled,T=f&&null==e?this._offscreen.getFramebuffer(this._offscreen.tmpColor,this._offscreen.tmpDepth):e;this._rctx.bindFramebuffer(T);const g=this._offscreen.colorTexture;this._renderAntiAliasing(g)||null==g||this._compositingHelper.composite(this._bindParameters,g,re.None),this.performanceInfo.advance(se.ANTIALIASING),this._renderHUD(y.NotOccluded,T),this.performanceInfo.advance(se.HUD),this._renderHighlights(T,this._bindParameters),this.performanceInfo.advance(se.HIGHLIGHTS),f&&this._magnifierHelper.render(this._rctx,this._bindParameters),T!==e&&(this._rctx.bindFramebuffer(e),this._compositingHelper.composite(this._bindParameters,this._offscreen.tmpColorTexture,re.None)),this._disposeOITBuffers(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this._sliceHelper.plane=l,this._isRendering=!1,this.onPostRender&&this.onPostRender(),this.performanceInfo.finishFrame()}_prepareShaders(e,r){this._renderContext.output=b.Color,this._prepareOpaqueGeometrySlots(),this._setMultipassTerrain(e),this._prepareSlots(B.TRANSPARENT_TERRAIN),this._setMultipassTerrain(!1),e||this._prepareInternalSlots(this._materialRenderers,B.LINE_CALLOUTS),r&&this._prepareTransparencySlots(),this._prepareInternalSlots(this._materialRenderers,B.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._prepareSlots(B.POSTPROCESSING_ENVIRONMENT_TRANSPARENT,B.LASERLINES),this._rctx.gl.flush()}_renderObjectAndLayerIdColor(e){if(null!=e&&has("enable-feature:objectAndLayerId-rendering")){const r=this._renderContext.output;this._rctx.bindFramebuffer(e),this._offscreen.renderToFBO((()=>this._renderGeometryAndTransparentTerrainPass(b.ObjectAndLayerIdColor)),[0,0,0,0],!0,!0),this._rctx.bindFramebuffer(e),this._offscreen.renderToFBO((()=>{this._bindParameters.renderTransparentlyOccludedHUD=y.NotOccluded,this._renderInternalSlot(B.HUD_MATERIAL)}),void 0,!0,!0),this._renderContext.output=r}}finish(e){this._hasAnimations||this._animationTimestep.clear();const r=this.performanceInfo.gpuSamplingEnabled,t=e===C.BACKGROUND;if(t||r){const e=t?this.performanceInfo.elapsedTime:0,s=r?this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.getError(),i=Math.max(e,s);this._animationTimestep.frame(i,t)}}readDepthPixels(e,r,t){const s=this._offscreen.bindTarget(this._offscreen.linearDepth,this._offscreen.tmpDepth);if(!this._needsLinearDepth){this._ensureBindParameters(e,e),this._bindParameters.camera.setGLViewport(this._rctx),this._rctx.setClearColor(0,0,0,0);const r=ae.COLOR_BUFFER_BIT|ae.DEPTH_BUFFER_BIT|ae.STENCIL_BUFFER_BIT;this._rctx.clearSafe(r),this._renderGeometryAndTransparentTerrainPass(b.Depth)}s.readPixels(r[0],r[1],r[2],r[3],ne.RGBA,he.UNSIGNED_BYTE,t)}readHUDVisibility(e,r,t,s,i){this._offscreen.bindTarget(this._offscreen.hudVisibility).readPixels(e,r,t,s,ne.RGBA,he.UNSIGNED_BYTE,i)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_setMultipassTerrain(e){this._setMultipassEnabled(e),this._setTerrainCulling(e)}_setMultipassEnabled(e){this._bindParameters.multipassTerrain.enabled=this._bindParameters.multipassGeometry.enabled=e}_setTerrainCulling(e){this._bindParameters.multipassTerrain.cullAboveGround=e}_prepareSlots(...e){this._renderPlugins.prepareSlots(e)}_renderSlot(e){this._bindParameters.slot=e,this._renderPlugins.render()}_renderEdges(e,r=!1){const t=this._edgeView;null!=t&&t.shouldRender()&&this._offscreen.renderTmpAndCompositeToMain((()=>t.render(this._bindParameters,e)),this._bindParameters,re.Alpha,r)}_renderShadowMap(e,r,t,s){const i=this._shadowMap;i.enabled&&(i.start(r,t,s,this.isFeatureEnabled(q.HighQualityShadows),this._stage.view.qualitySettings.maximumPixelRatio),this._shadowHighlight.updateParameters(r,t),this._needsShadowHighlight?(this._renderShadowCascades(b.ShadowHighlight,this._shadowMap,(e=>i.takeCascadeSnapshotTo(e,Y.Highlight))),i.clear(),this._renderShadowCascades(b.ShadowExcludeHighlight,this._shadowMap,(e=>{i.takeCascadeSnapshotTo(e,Y.Default),this._renderGeometryAndTransparentTerrainPass(b.ShadowHighlight)}))):this._renderShadowCascades(b.Shadow),i.finish(e),r.setGLViewport(this._rctx))}_renderShadowCascades(e,r=this._shadowMap,t=(e=>{})){for(const s of r.cascades)s.camera.setGLViewport(this._rctx),this._prepare(s.camera,s.camera),this._renderGeometryAndTransparentTerrainPass(e),t(s)}get _needsLinearDepth(){return this._ssaoHelper.active||this._renderPlugins.needsLinearDepth||this.hasReflections||this._needsShadowHighlight||this._needsShadowCast}_renderLinearDepth(){this._needsLinearDepth?this._offscreen.renderToTargets((()=>this._renderGeometryAndTransparentTerrainPass(b.Depth)),this._offscreen.linearDepth,this._offscreen.tmpDepth,[0,0,0,0],!0,!0):this._offscreen.disposeTarget(this._offscreen.linearDepth),this._bindParameters.linearDepthTexture=this._offscreen.linearDepthTexture}_renderTerrainLinearDepth(e){if(e){const e=this._renderContext.output;this._renderContext.output=b.Depth,this._offscreen.renderToTargets((()=>this._renderTransparentTerrain()),this._offscreen.terrainLinearDepth,this._offscreen.tmpDepth,[-1e10,-1e10,-1e10,1],!0,!0),this._renderContext.output=e}else this._offscreen.disposeTarget(this._offscreen.terrainLinearDepth);this._bindParameters.multipassTerrain.linearDepthTexture=this._offscreen.terrainLinearDepthTexture}_renderGeometryLinearDepth(e){if(e){const e=this._renderContext.output;this._offscreen.renderToTargets((()=>this._renderGeometryPass(b.Depth)),this._offscreen.geometryLinearDepth,this._offscreen.tmpDepth,[1,1,1,1],!0,!0),this._renderContext.output=e}else this._offscreen.disposeTarget(this._offscreen.geometryLinearDepth);this._bindParameters.multipassGeometry.linearDepthTexture=this._offscreen.geometryLinearDepthTexture}get _needsNormal(){return this._ssaoHelper.active}_renderNormal(){this._needsNormal?this._offscreen.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(b.Normal)}),this._offscreen.normal,this._offscreen.tmpDepth,[0,0,0,0],!0,!0):this._offscreen.disposeTarget(this._offscreen.normal)}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowCast}_computeDepthRange(e){if(!this._needsDepthRange)return x;const r=L(e,this._materialRenderers,this._stage.layers);return N(r,this.renderPlugins.queryDepthRange(e)),r.near=Math.max(e.near,r.near),r.far=Math.min(e.far,r.far),r}_renderGeometryAndTransparentTerrainPass(e){this._renderContext.output=e,this._prepareSlots(B.TRANSPARENT_TERRAIN),this._renderGeometryPass(e),this._renderTransparentTerrain()}_renderGeometryPass(e){this._renderContext.output=e,this._prepareSlots(B.TRANSPARENT_MATERIAL),this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderSSAO(e){this._ssaoHelper.render(this._bindParameters,e,this._offscreen.linearDepthTexture,this._offscreen.normalTexture)}_prepareOpaqueGeometrySlots(){this._prepareSlots(B.INTEGRATED_MESH,B.OPAQUE_TERRAIN,B.OPAQUE_MATERIAL,B.POSTPROCESSING_ENVIRONMENT_OPAQUE),this._prepareInternalSlots(this._materialRenderers,B.OPAQUE_MATERIAL)}_renderOpaqueGeometry(){this._renderSlot(B.INTEGRATED_MESH),this._renderSlot(B.OPAQUE_TERRAIN),this._renderInternalSlot(B.OPAQUE_MATERIAL),this._renderSlot(B.OPAQUE_MATERIAL),this._renderSlot(B.POSTPROCESSING_ENVIRONMENT_OPAQUE)}_renderTransparentGeometry(){this._renderInternalSlot(B.TRANSPARENT_MATERIAL),this._renderSlot(B.TRANSPARENT_MATERIAL)}_renderTransparentTerrain(){this._renderSlot(B.TRANSPARENT_TERRAIN)}_renderHUDVisibility(e){let r=!1;return this._renderContext.offscreenRenderingHelper&&this._renderContext.offscreenRenderingHelper.renderHUDVisibility((()=>{this._bindParameters.hudVisibilityTexture=this._renderContext.offscreenRenderingHelper.hudVisibilityTexture,r=this._renderInternalSlot(B.OCCLUSION_PIXELS)}),e),r}_renderLineCallouts(e){this._bindParameters.renderTransparentlyOccludedHUD=e,e===y.Occluded?this._offscreen.renderToTargets((()=>this._renderInternalSlot(B.LINE_CALLOUTS)),this._offscreen.currentColorTarget,this._offscreen.tmpDepth,void 0,!0,!0):this._renderInternalSlot(B.LINE_CALLOUTS)}_renderHUD(e,r){this._hasHUDElements&&(this._oitEnabled?(this._renderOITPass(de.HUD,e),this._rctx.bindFramebuffer(r),this._compositingHelper.composite(this._bindParameters,this._offscreen.hudColorTexture,re.PremultipliedAlpha)):e===y.Occluded?this._offscreen.renderToTargets((()=>this._renderHUDElements(y.Occluded)),this._offscreen.currentColorTarget,this._offscreen.tmpDepth,void 0,!0,!0):this._renderHUDElements(e))}_renderHUDElements(e){this._bindParameters.renderTransparentlyOccludedHUD=e,this._prepareInternalSlots(this._materialRenderers,B.LINE_CALLOUTS_HUD_DEPTH,B.HUD_MATERIAL,B.LABEL_MATERIAL),this._renderInternalSlot(B.LINE_CALLOUTS_HUD_DEPTH),this._renderInternalSlot(B.HUD_MATERIAL),this._renderInternalSlot(B.LABEL_MATERIAL)}get _needsHighlight(){return this._hasHighlights||this._renderPlugins.needsHighlight}get _needsShadowHighlight(){return this._shadowMap.enabled&&this._shadowHighlight.isVisible&&this._needsHighlight}_renderHighlights(e,r){if(!this._needsHighlight)return void this._offscreen.disposeTarget(this._offscreen.highlight);const t=this._highlight,s=this._offscreen.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(b.Highlight),this._rctx.clearSafe(ae.DEPTH_BUFFER_BIT),this._renderHUDElements(y.Both)}),this._offscreen.highlight,this._offscreen.tmpDepth,[0,0,0,0],!0,!0);this._bindParameters.highlightColorTexture=s.colorTexture,this._needsShadowHighlight&&this._shadowHighlight.render(r,e),t.render(this._bindParameters,s,e)}get _needsShadowCast(){return this._shadowAccumulator.isAccumulating}_accumulateShadows(e,r,t){this._needsShadowCast&&null!=this._offscreen.linearDepthTexture&&this._shadowAccumulator.renderAccumulation(this._offscreen.linearDepthTexture,e,r,t)}_prepareTransparencySlots(){this._renderContext.output=b.Alpha,this._bindParameters.transparencyPassType=K.Alpha,this._prepareInternalSlots(this._materialRenderers,B.TRANSPARENT_MATERIAL),this._prepareSlots(B.TRANSPARENT_MATERIAL),this._renderContext.output=b.Color,this._bindParameters.transparencyPassType=K.Color,this._prepareInternalSlots(this._materialRenderers,B.TRANSPARENT_MATERIAL),this._prepareSlots(B.TRANSPARENT_MATERIAL),this._bindParameters.transparencyPassType=K.FrontFace,this._prepareInternalSlots(this._materialRenderers,B.TRANSPARENT_MATERIAL),this._prepareSlots(B.TRANSPARENT_MATERIAL),this._bindParameters.transparencyPassType=K.NONE}_renderOITPass(e,r=y.Both){const t=e===de.HUD,s=t?()=>this._renderHUDElements(r):()=>this._renderTransparentGeometry(),i=e=>{this._bindParameters.transparencyPassType=e,this._offscreen.renderOITPass(s,e,t)},a=this._renderContext.output;this._renderContext.output=b.Alpha,i(K.Alpha),this._renderContext.output=b.Color,i(K.Color),i(K.FrontFace),this._offscreen.compositeTransparentOntoOpaque(this._bindParameters,t),this._bindParameters.transparencyPassType=K.NONE,this._renderContext.output=a,this._oitUsed=!0}_disposeOITBuffers(){this._oitUsed||(this._offscreen.disposeTarget(this._offscreen.alphaFloatTarget),this._offscreen.disposeTarget(this._offscreen.colorFloatTarget),this._offscreen.disposeTarget(this._offscreen.frontFaceTarget))}_renderOccluded(){let e=0;_e.clear(),this._materialRenderers.forAll((r=>{r.material&&r.material.isVisible()&&r.material.renderOccluded===v.OccludeAndTransparentStencil&&(e|=r.material.renderOccluded,_e.push(r))}));const r=this._offscreen,t=(t,s,i,a,n)=>{0!=(e&s)&&(r.renderToTargets(i,r.tmpColor,r.mainDepth,[0,0,0,0],a,n),r.compositeOccludedOntoMain(this._bindParameters,t))};0!==_e.length&&(this._prepareInternalSlots(_e,B.OCCLUDER_MATERIAL,B.TRANSPARENT_OCCLUDER_MATERIAL),this._renderInternalSlot(B.OCCLUDER_MATERIAL,_e),t(.5,v.OccludeAndTransparentStencil,(()=>this._renderInternalSlot(B.TRANSPARENT_OCCLUDER_MATERIAL,_e)),!1,!1)),_e.clear(),this._materialRenderers.forAll((r=>{r.material&&r.material.isVisible()&&(r.material.renderOccluded===v.OccludeAndTransparent||r.material.renderOccluded===v.Transparent||r.material.renderOccluded===v.Opaque)&&(e|=r.material.renderOccluded,_e.push(r))}));const s=this._renderPlugins.renderOccludedFlags;if(e|=s,!e)return;const i=e=>{this._renderContext.renderOccludedMask=e,this._prepareInternalSlots(_e,B.OPAQUE_MATERIAL,B.TRANSPARENT_MATERIAL,B.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),s>v.Occlude&&this._renderSlot(B.OCCLUDED_TERRAIN),this._renderInternalSlot(B.OPAQUE_MATERIAL,_e),this._renderInternalSlot(B.TRANSPARENT_MATERIAL,_e),this._renderInternalSlot(B.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,_e),this._renderContext.resetRenderOccludedMask()};this._renderContext.output=b.Color,t(.5,v.OccludeAndTransparent,(()=>i(v.OccludeAndTransparent)),!0,D.OutlineVisualElementMask),t(.5,v.Transparent,(()=>i(v.Transparent)),!0,D.OutlineVisualElementMask),t(1,v.Opaque,(()=>i(v.Opaque)),!0,D.OutlineVisualElementMask),_e.clear()}_renderAntiAliasing(e){if(this._antialiasing){if(this._smaaPass.enable((()=>this._requestRender()))&&null!=e)return this._smaaPass.render(e),!0}else this._smaaPass.disable();return!1}_prepare(e,r){this._needsTransparentPass=this._materialRenderers.some((e=>e.requiresSlot(B.TRANSPARENT_MATERIAL,b.Color))),this._bindParameters.camera=e,this._bindParameters.contentCamera=r}_ensureBindParameters(e,r){this._bindParameters.camera=e,this._bindParameters.contentCamera=r;const t=this._renderContext.offscreenRenderingHelper;this._bindParameters.hudVisibilityTexture=t.hudVisibilityTexture,this._bindParameters.mainColorTexture=t.mainColorTexture,this._bindParameters.highlightDepthTexture=t.depthTexture??this._getFallbackDepthTexture()}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.enabled=this.hasReflections,this._bindParameters.ssr.enabled){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=g:(f(ce,this._bindParameters.camera.viewMatrix),f(pe,this._bindParameters.camera.projectionMatrix),T(me,ce,pe),T(me,this._renderContext.lastFrameCamera.viewMatrix,me),T(me,this._renderContext.lastFrameCamera.projectionMatrix,me),this._reprojectionMatrix=me),this._bindParameters.ssr.lastFrameColorTexture=this._offscreen.lastFrameColorTexture;const r=this._stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=r>0?Math.min(r,e-this._ssrEnableTime)/r:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=g,this._bindParameters.ssr.lastFrameColorTexture=null,this._ssrEnableTime=null}_prepareInternalSlots(e,...r){for(const t of r)this._bindParameters.slot=t,e.forAll((e=>{e.material.shouldRender(this._renderContext)&&e.prepareTechnique(this._renderContext)}))}_renderInternalSlot(e,r=this._materialRenderers){let t=!1;return this._bindParameters.slot=e,r.forAll((e=>{if(e.material.shouldRender(this._renderContext)){const r=e.prepareTechnique(this._renderContext);null!=r&&(e.render(this._renderContext,r),t=!0)}})),t}_getFallbackDepthTexture(){return this._fallbackDepthStencilTexture||(this._fallbackDepthStencilTexture=H(this._rctx)),this._fallbackDepthStencilTexture}get gpuMemoryUsage(){return{offscreen:this._offscreen?.gpuMemoryUsage??0,highlights:(this._highlight?.gpuMemoryUsage??0)+(this._shadowHighlight?.gpuMemoryUsage??0),shadows:this._shadowMap?.gpuMemoryUsage??0,ssao:this._ssaoHelper?.gpuMemoryUsage??0}}get test(){const e=this;return{offscreen:this._offscreen,shadowMap:this._shadowMap,ssao:this._ssaoHelper,highlight:this._highlight,lighting:this._bindParameters.lighting,materialRenderers:this._materialRenderers,shadowAccumulator:this._shadowAccumulator,weatherIsFading:this._bindParameters.cloudsFade.isFading,resetRenderStateFeatures:()=>{e._renderStateFeatures=G()},getFramebufferTexture:r=>{switch(r){case le.Color:return e._offscreen.colorTexture;case le.LinearDepth:return e._offscreen.linearDepthTexture;case le.Normals:return e._offscreen.normalTexture;case le.ShadowMap:return e._shadowMap.depthTexture;case le.HudVisibility:return e._offscreen.hudVisibilityTexture;case le.Highlight:return e._offscreen.highlightTexture}}}}};var de,le;e([c()],oe.prototype,"_renderPlugins",void 0),e([c()],oe.prototype,"_shadowAccumulator",void 0),e([c()],oe.prototype,"_state",void 0),e([c()],oe.prototype,"_renderStateFeatures",void 0),e([c()],oe.prototype,"_antialiasingEnabled",void 0),e([c({readOnly:!0})],oe.prototype,"_antialiasing",null),e([c()],oe.prototype,"_ssaoEnabled",void 0),e([c()],oe.prototype,"_smaaPass",void 0),e([c({autoDestroy:!0})],oe.prototype,"_edgeView",void 0),e([c()],oe.prototype,"updating",null),e([c()],oe.prototype,"isCameraFinal",null),oe=e([m("esri.views.3d.webgl-engine.lib.Renderer")],oe),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(de||(de={})),function(e){e[e.Color=0]="Color",e[e.LinearDepth=1]="LinearDepth",e[e.Normals=2]="Normals",e[e.ShadowMap=3]="ShadowMap",e[e.HudVisibility=4]="HudVisibility",e[e.Highlight=5]="Highlight"}(le||(le={}));const _e=new o,pe=R(),ce=R(),me=R();function ue(e){return r=>e.immediate.schedule(r)}export{le as FramebufferId,oe as Renderer};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{update as t}from"../../../../core/arrayUtils.js";import s from"../../../../core/Handles.js";import has from"../../../../core/has.js";import{removeMaybe as i,disposeMaybe as a,destroyMaybe as n,applySome as h}from"../../../../core/maybe.js";import o from"../../../../core/PooledArray.js";import{watch as d,syncAndInitial as l,initial as _,sync as p}from"../../../../core/reactiveUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{j as u,a as f,m as T}from"../../../../chunks/mat4.js";import{I as g,c as R}from"../../../../chunks/mat4f64.js";import{a as A}from"../../../../chunks/boundedPlane.js";import E from"../../support/debugFlags.js";import{TransparencyMode as S}from"../../terrain/TerrainRenderer.js";import{RenderPassManager as P}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as b}from"../core/shaderLibrary/ShaderOutput.js";import{HUDTransparencyRenderStyle as y}from"../core/shaderLibrary/hud/HUDUniforms.js";import{AnimationTimeStep as I}from"./AnimationTimeStep.js";import{Decorations as O,RenderRequestType as C,StencilBits as D}from"./basicInterfaces.js";import{BoundingInfo as w}from"./BoundingInfo.js";import{ZERO as x,union as N}from"./depthRange.js";import{depthRangeFromScene as L}from"./depthRangeUtils.js";import{createEmptyDepthTexture as H}from"./glUtil3D.js";import{Highlight as M}from"./Highlight.js";import{RenderOccludedFlag as v}from"./Material.js";import{OffscreenRendering as U}from"./OffscreenRendering.js";import{RenderContext as F}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as j}from"./rendererUtils.js";import{RenderFeature as q,setupFeatureDefaults as G}from"./RenderFeature.js";import{RenderPluginManager as V}from"./RenderPluginManager.js";import{RenderSlot as B}from"./RenderSlot.js";import{ShadowAccumulator as Q}from"./ShadowAccumulator.js";import{ShadowHighlight as k}from"./ShadowHighlight.js";import{ShadowMap as W,SnapshotSlot as Y}from"./ShadowMap.js";import X from"./SliceHelper.js";import{SmaaRenderPass as z}from"./SmaaRenderPass.js";import{SSAOHelper as J}from"./SSAOHelper.js";import{TransparencyPassType as K}from"./TransparencyPassType.js";import{EdgeView as Z}from"./edgeRendering/EdgeView.js";import{Transparency as $}from"./edgeRendering/interfaces.js";import{MergedRenderer as ee}from"../materials/renderers/MergedRenderer.js";import{AlphaMode as re}from"../shaders/CompositingTechniqueConfiguration.js";import{RendererPerformanceInfo as te,PerformanceCategory as se}from"../statistics/RendererPerformanceInfo.js";import{RenderState as ie}from"../../../support/RenderState.js";import{ClearBufferBit as ae,PixelFormat as ne,PixelType as he}from"../../../webgl/enums.js";let oe=class extends r{get _bindParameters(){return this._renderContext.bindParameters}isFeatureEnabled(e,r=this._state){return this._renderStateFeatures.get(r,e)??!1}setFeatureEnabled(e,r,t){this._renderStateFeatures.set(r,e,t),this.notifyChange("_renderStateFeatures"),this._requestRender()}get _antialiasing(){return this._antialiasingEnabled||this.isFeatureEnabled(q.Antialiasing)}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(q.HighQualityTransparency)}get hasReflections(){return this.hasWater&&(this._ssrEnabled||this.isFeatureEnabled(q.WaterReflection))}get hasWater(){return this._hasWater||this._hasOverlayWater}constructor(e,r,t,i,a,n,h,p){super({}),this._stage=e,this._materialRepository=r,this._techniqueRepository=i,this._rctx=a,this._compositingHelper=n,this._magnifierHelper=h,this._requestRender=p,this._materialRenderers=new o,this._needsTransparentPass=!1,this._hasHUDElements=!1,this._hasHighlights=!1,this._hasWater=!1,this._hasOverlayWater=!1,this._renderOverlay=e=>{},this._isRendering=!1,this._fallbackDepthStencilTexture=null,this._sliceHelper=new X,this._state=ie.IDLE,this._renderStateFeatures=G(),this._antialiasingEnabled=!0,this._highQualityTransparencyEnabled=!0,this._terrainRenderingEnabled=!0,this._terrainTransparency=S.Opaque,this._ssrEnabled=!1,this._ssaoEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new I,this._handles=new s,this._renderHiddenTransparentEdges=()=>{},this._oitUsed=!1,this._smaaPass=new z(this._rctx,i),p(),this._offscreen=new U(this._rctx,this._compositingHelper),this.performanceInfo=new te(this._rctx),this._shadowMap=new W(this._rctx,e.viewingMode),this._ssaoHelper=new J(e.view,i,this._rctx,p),this._highlight=new M(i,this._rctx),this._shadowHighlight=new k(this._rctx,e.viewingMode),this._shadowAccumulator=new Q(this._rctx,i,e,(e=>{const r=this.shadowsEnabled;this._shadowMap.enabled=!0,this._prepare(e.camera,e.contentCamera),this._renderPlugins.prepareRender(),this._shadowMap.enabled=r}),((e,r,t)=>{e.shadowMap.start(e.camera,r,t,!0,this._stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(b.Shadow,e.shadowMap),e.camera.setGLViewport(this._rctx),this._prepare(e.camera,e.contentCamera)}),p),this._renderContext=new F(this._rctx,this._offscreen,this._shadowMap,this._ssaoHelper,this._sliceHelper),this._renderPlugins=new V({renderContext:this._renderContext,techniqueRepository:i,textureRepository:t,materialRepository:this._materialRepository,requestRender:p,controller:e}),this.renderPassManager=new P(this._rctx,this._techniqueRepository),this._renderPlugins.add(this.renderPassManager.slots(),this.renderPassManager),this._handles.add([d((()=>this._stage.view.state.camera),(()=>p()),l),d((()=>E.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges($.TRANSPARENT):()=>{},p()}),_),d((()=>this._ssaoEnabled||this.isFeatureEnabled(q.SSAO)),(e=>this._ssaoHelper.enabled=e),l)])}normalizeCtorArgs(){return{}}destroy(){this._handles.destroy(),this._smaaPass.dispose(),this._gpuTimerHandle=i(this._gpuTimerHandle),this._materialRenderers.forAll((e=>e.dispose())),this._materialRenderers.clear(),this._offscreen.dispose(),this._fallbackDepthStencilTexture=a(this._fallbackDepthStencilTexture),this._shadowMap.dispose(),this._ssaoHelper.destroy(),this._highlight.dispose(),this._shadowHighlight.dispose(),this._shadowAccumulator.dispose(),this._edgeView=n(this._edgeView),this.renderPassManager.destroy(),w.prune()}disposeOffscreenBuffers(){this._offscreen.dispose(),this._shadowMap.disposeOffscreenBuffers(),this._smaaPass.disable(),this._ssaoHelper.disposeOffscreenBuffers()}get updating(){return this._antialiasing&&this._smaaPass.updating||null!=this._edgeView&&this._edgeView.updating||this._shadowAccumulator.running||this._renderPlugins.updating||!this.isCameraFinal}ensureEdgeView(){if(null==this._edgeView){const e=this._stage.view.resourceController;this._edgeView=new Z({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniqueRepository:this._techniqueRepository,setNeedsRender:()=>this._requestRender(),schedule:ue(e)}),this._handles.add(d((()=>h(this._edgeView,(e=>e.updating))),(()=>this._requestRender()),p)),this._requestRender()}return this._edgeView}get edgeView(){return this._edgeView}get isCameraFinal(){return u(this._bindParameters.ssr.reprojectionMatrix,g)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this.notifyChange("isCameraFinal")}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:r,_bindParameters:t}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.qualitySettings?.ambientOcclusion&&this._ssaoEnabled!==e.qualitySettings.ambientOcclusion&&(this._ssaoEnabled=e.qualitySettings.ambientOcclusion,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&r.maxCascades!==e.shadowMapMaxCascades&&(r.maxCascades=e.shadowMapMaxCascades,this._requestRender()),null!=e.environment){null!=e.environment.weather&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=!!e.weatherVisible);const r="virtual"!==e.environment.lighting.type;t.enableFillLights!==r&&(t.enableFillLights=r,this._requestRender())}e.background&&this._offscreen.background!==e.background&&(this._offscreen.background=e.background,this._requestRender()),void 0!==e.antialiasingEnabled&&this._antialiasingEnabled!==e.antialiasingEnabled&&(this._antialiasingEnabled=e.antialiasingEnabled,this._requestRender()),void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.defaultHighlightOptions&&(this._highlight.setDefaultOptions(e.defaultHighlightOptions),this._shadowHighlight.setDefaultOptions(e.defaultHighlightOptions),this._requestRender()),void 0!==e.overlays&&this._bindParameters.overlays!==e.overlays&&(this._bindParameters.overlays=e.overlays,this._requestRender()),void 0!==e.hasOverlayWater&&this._hasOverlayWater!==e.hasOverlayWater&&(this._hasOverlayWater=e.hasOverlayWater,this._requestRender()),void 0!==e.renderOverlay&&this._renderOverlay!==e.renderOverlay&&(this._renderOverlay=e.renderOverlay,this._requestRender()),void 0!==e.slicePlane&&this._sliceHelper.plane!==e.slicePlane&&(this._sliceHelper.plane=e.slicePlane,this._requestRender()),void 0!==e.terrainRenderingEnabled&&this._terrainRenderingEnabled!==e.terrainRenderingEnabled&&(this._terrainRenderingEnabled=e.terrainRenderingEnabled,this._requestRender()),void 0!==e.terrainTransparency&&this._terrainTransparency!==e.terrainTransparency&&(this._terrainTransparency=e.terrainTransparency,this._requestRender()),void 0!==e.shadowCastOptions&&this._shadowAccumulator.setOptions(e.shadowCastOptions)}get hasSlicePlane(){return!!this._sliceHelper.plane}get renderPlugins(){return this._renderPlugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}modify(e,r){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:t,removes:s,updates:i}=e;if(0===t.length&&0===s.length&&0===i.length)return;const a=j(e);let n=!1;a.forEach(((t,s)=>{if(r.done)return;let i=this._materialRenderers.find((e=>e.material===s));null==i&&t.adds.length>0&&(i=new ee(this._rctx,this._materialRepository,s),this._materialRenderers.push(i)),i&&(i.modify(t),i.isEmpty&&(n=!0)),t.removes.forEach((r=>e.removes.removeUnordered(r))),t.adds.forEach((r=>e.adds.removeUnordered(r))),t.updates.forEach((r=>e.updates.removeUnordered(r))),r.madeProgress()})),n&&this._materialRenderers.filterInPlace((e=>!e.isEmpty||(e.dispose(),!1))),this._hasHighlights=this._materialRenderers.some((e=>e.hasHighlights)),this._bindParameters.hasOccludees=this._materialRenderers.some((e=>e.hasOccludees)),this._hasWater=this._materialRenderers.some((e=>e.hasWater)),this._hasHUDElements=this._materialRenderers.some((e=>e.requiresSlot(B.LINE_CALLOUTS_HUD_DEPTH,b.Color)||e.requiresSlot(B.HUD_MATERIAL,b.Color)||e.requiresSlot(B.LABEL_MATERIAL,b.Color))),this._requestRender()}updateAnimation(e){const r=this._hasAnimations;return this._hasAnimations=!1,this._materialRenderers.forAll((r=>this._hasAnimations=r.updateAnimation(e)||this._hasAnimations)),this._hasAnimations=this._renderPlugins.updateAnimation(e)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?i(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}render(e,r,t,s,i){this._isRendering=!0,this._oitUsed=!1,this.performanceInfo.startFrame();const{camera:a,contentCamera:n,mode:h,alignPixelEnabled:o}=t;this._state=h,this._renderOverlay(i),this.performanceInfo.advance(se.OVERLAY),this._renderContext.time=i,this._bindParameters.transparencyPassType=K.NONE,this._bindParameters.alignPixelEnabled=o;const d=this._offscreen;d.setupRenderTarget(this.hasReflections);const l=A(this._sliceHelper.plane);s===O.OFF&&(this._sliceHelper.plane=null),this._rctx.bindFramebuffer(e),a.setGLViewport(this._rctx),this._prepare(a,n),this._renderPlugins.prepareRender(),this.performanceInfo.advance(se.PREPARE);const _=this._computeDepthRange(a);this._renderShadowMap(e,a,this._bindParameters.lighting.mainLight.direction,_),this.performanceInfo.advance(se.SHADOW_MAP),d.initializeFrame(a),this._ensureBindParameters(a,n);const p=this._terrainRenderingEnabled&&(this._terrainTransparency===S.Semitransparent||this._terrainTransparency===S.TransparentWithDraped),c=this._highQualityTransparency&&p,m=this._needsTransparentPass||this._renderPlugins.needsTransparentPass;this._prepareShaders(c,m),this._renderLinearDepth(),this.performanceInfo.advance(se.LINEAR_DEPTH),this._accumulateShadows(_,a,n),this.performanceInfo.advance(se.ACCUMULATED_SHADOWS),this._renderNormal(),this.performanceInfo.advance(se.NORMALS),this._ensureBindParametersSSR(i),this._renderSSAO(i),this.performanceInfo.advance(se.SSAO),this._renderContext.output=b.Color,d.bindFramebuffer(),this._renderOpaqueGeometry(),this.performanceInfo.advance(se.OPAQUE),this._renderTerrainLinearDepth(c),this._setMultipassTerrain(c),this._renderEdges($.OPAQUE),this.performanceInfo.advance(se.OPAQUE_EDGES),this._offscreen.bindTarget(this._offscreen.currentColorTarget,this._offscreen.mainDepth),this._renderSlot(B.VOXEL),this.performanceInfo.advance(se.VOXEL),this._renderHiddenTransparentEdges(),m&&(this._oitEnabled?this._renderOITPass(de.Geometry):this._renderTransparentGeometry()),this.performanceInfo.advance(se.TRANSPARENT),this._renderGeometryLinearDepth(c);const u=this._renderHUDVisibility(c);c||this._renderInternalSlot(B.LINE_CALLOUTS),this.performanceInfo.advance(se.HUD_VISIBILITY),this._renderObjectAndLayerIdColor(r),this.performanceInfo.advance(se.OBJECT_AND_LAYER_ID_COLOR),this._renderEdges($.TRANSPARENT,c),this.performanceInfo.advance(se.TRANSPARENT_EDGES),this._renderTransparentTerrain(),p&&u&&(c?this._renderLineCallouts(y.Occluded):d.compositeTransparentTerrainOntoHUDVisibility(this._bindParameters),this._renderHUD(y.Occluded,d.framebuffer),this.performanceInfo.advance(se.HUD_OCCLUDED)),this.performanceInfo.advance(se.TRANSPARENT_TERRAIN),this._setTerrainCulling(!1),p&&(d.compositeTransparentTerrainOntoMain(this._bindParameters),c&&(this._renderEdges($.OPAQUE),this.performanceInfo.advance(se.OPAQUE_EDGES),m&&(this._oitEnabled?this._renderOITPass(de.Geometry):this._renderTransparentGeometry()),this.performanceInfo.advance(se.TRANSPARENT),this._renderEdges($.TRANSPARENT),this.performanceInfo.advance(se.TRANSPARENT_EDGES))),c&&this._renderLineCallouts(y.NotOccluded),this._setMultipassEnabled(!1),this._shadowAccumulator.render(this._bindParameters),d.renderToTargets((()=>{this._renderInternalSlot(B.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderSlot(B.POSTPROCESSING_ENVIRONMENT_TRANSPARENT),this._renderSlot(B.LASERLINES)}),d.currentColorTarget,d.mainDepth),this.performanceInfo.advance(se.ENVIRONMENT),this._renderPlugins.needsLaserlineWithContrastControl&&d.renderTmpAndCompositeToMain((()=>this._renderSlot(B.LASERLINES_CONTRAST_CONTROL)),this._bindParameters,re.PremultipliedAlpha),this.performanceInfo.advance(se.LASER_LINE),this._renderOccluded(),this.performanceInfo.advance(se.OCCLUDED);const f=s===O.ON&&this._magnifierHelper.enabled,T=f&&null==e?this._offscreen.getFramebuffer(this._offscreen.tmpColor,this._offscreen.tmpDepth):e;this._rctx.bindFramebuffer(T);const g=this._offscreen.colorTexture;this._renderAntiAliasing(g)||null==g||this._compositingHelper.composite(this._bindParameters,g,re.None),this.performanceInfo.advance(se.ANTIALIASING),this._renderHUD(y.NotOccluded,T),this.performanceInfo.advance(se.HUD),this._renderHighlights(T,this._bindParameters),this.performanceInfo.advance(se.HIGHLIGHTS),f&&this._magnifierHelper.render(this._rctx,this._bindParameters),T!==e&&(this._rctx.bindFramebuffer(e),this._compositingHelper.composite(this._bindParameters,this._offscreen.tmpColorTexture,re.None)),this._disposeOITBuffers(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this._sliceHelper.plane=l,this._isRendering=!1,this.onPostRender&&this.onPostRender(),this.performanceInfo.finishFrame()}_prepareShaders(e,r){this._renderContext.output=b.Color,this._prepareOpaqueGeometrySlots(),this._setMultipassTerrain(e),this._prepareSlots(B.TRANSPARENT_TERRAIN),this._setMultipassTerrain(!1),e||this._prepareInternalSlots(this._materialRenderers,B.LINE_CALLOUTS),r&&this._prepareTransparencySlots(),this._prepareInternalSlots(this._materialRenderers,B.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._prepareSlots(B.POSTPROCESSING_ENVIRONMENT_TRANSPARENT,B.LASERLINES),this._rctx.gl.flush()}_renderObjectAndLayerIdColor(e){if(null!=e&&has("enable-feature:objectAndLayerId-rendering")){const r=this._renderContext.output;this._rctx.bindFramebuffer(e),this._offscreen.renderToFBO((()=>this._renderGeometryAndTransparentTerrainPass(b.ObjectAndLayerIdColor)),[0,0,0,0],!0,!0),this._rctx.bindFramebuffer(e),this._offscreen.renderToFBO((()=>{this._bindParameters.renderTransparentlyOccludedHUD=y.NotOccluded,this._renderInternalSlot(B.HUD_MATERIAL)}),void 0,!0,!0),this._renderContext.output=r}}finish(e){this._hasAnimations||this._animationTimestep.clear();const r=this.performanceInfo.gpuSamplingEnabled,t=e===C.BACKGROUND;if(t||r){const e=t?this.performanceInfo.elapsedTime:0,s=r?this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.getError(),i=Math.max(e,s);this._animationTimestep.frame(i,t)}}readDepthPixels(e,r,t){const s=this._offscreen.bindTarget(this._offscreen.linearDepth,this._offscreen.tmpDepth);if(!this._needsLinearDepth){this._ensureBindParameters(e,e),this._bindParameters.camera.setGLViewport(this._rctx),this._rctx.setClearColor(0,0,0,0);const r=ae.COLOR_BUFFER_BIT|ae.DEPTH_BUFFER_BIT|ae.STENCIL_BUFFER_BIT;this._rctx.clearSafe(r),this._renderGeometryAndTransparentTerrainPass(b.Depth)}s.readPixels(r[0],r[1],r[2],r[3],ne.RGBA,he.UNSIGNED_BYTE,t)}readHUDVisibility(e,r,t,s,i){this._offscreen.bindTarget(this._offscreen.hudVisibility).readPixels(e,r,t,s,ne.RGBA,he.UNSIGNED_BYTE,i)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_setMultipassTerrain(e){this._setMultipassEnabled(e),this._setTerrainCulling(e)}_setMultipassEnabled(e){this._bindParameters.multipassTerrain.enabled=this._bindParameters.multipassGeometry.enabled=e}_setTerrainCulling(e){this._bindParameters.multipassTerrain.cullAboveGround=e}_prepareSlots(...e){this._renderPlugins.prepareSlots(e)}_renderSlot(e){this._bindParameters.slot=e,this._renderPlugins.render()}_renderEdges(e,r=!1){const t=this._edgeView;null!=t&&t.shouldRender()&&this._offscreen.renderTmpAndCompositeToMain((()=>t.render(this._bindParameters,e)),this._bindParameters,re.Alpha,r)}_renderShadowMap(e,r,t,s){const i=this._shadowMap;i.enabled&&(i.start(r,t,s,this.isFeatureEnabled(q.HighResolutionShadows),this._stage.view.qualitySettings.maximumPixelRatio),this._shadowHighlight.updateParameters(r,t),this._needsShadowHighlight?(this._renderShadowCascades(b.ShadowHighlight,this._shadowMap,(e=>i.takeCascadeSnapshotTo(e,Y.Highlight))),i.clear(),this._renderShadowCascades(b.ShadowExcludeHighlight,this._shadowMap,(e=>{i.takeCascadeSnapshotTo(e,Y.Default),this._renderGeometryAndTransparentTerrainPass(b.ShadowHighlight)}))):this._renderShadowCascades(b.Shadow),i.finish(e),r.setGLViewport(this._rctx))}_renderShadowCascades(e,r=this._shadowMap,t=(e=>{})){for(const s of r.cascades)s.camera.setGLViewport(this._rctx),this._prepare(s.camera,s.camera),this._renderGeometryAndTransparentTerrainPass(e),t(s)}get _needsLinearDepth(){return this._ssaoHelper.active||this._renderPlugins.needsLinearDepth||this.hasReflections||this._needsShadowHighlight||this._needsShadowCast}_renderLinearDepth(){this._needsLinearDepth?this._offscreen.renderToTargets((()=>this._renderGeometryAndTransparentTerrainPass(b.Depth)),this._offscreen.linearDepth,this._offscreen.tmpDepth,[0,0,0,0],!0,!0):this._offscreen.disposeTarget(this._offscreen.linearDepth),this._bindParameters.linearDepthTexture=this._offscreen.linearDepthTexture}_renderTerrainLinearDepth(e){if(e){const e=this._renderContext.output;this._renderContext.output=b.Depth,this._offscreen.renderToTargets((()=>this._renderTransparentTerrain()),this._offscreen.terrainLinearDepth,this._offscreen.tmpDepth,[-1e10,-1e10,-1e10,1],!0,!0),this._renderContext.output=e}else this._offscreen.disposeTarget(this._offscreen.terrainLinearDepth);this._bindParameters.multipassTerrain.linearDepthTexture=this._offscreen.terrainLinearDepthTexture}_renderGeometryLinearDepth(e){if(e){const e=this._renderContext.output;this._offscreen.renderToTargets((()=>this._renderGeometryPass(b.Depth)),this._offscreen.geometryLinearDepth,this._offscreen.tmpDepth,[1,1,1,1],!0,!0),this._renderContext.output=e}else this._offscreen.disposeTarget(this._offscreen.geometryLinearDepth);this._bindParameters.multipassGeometry.linearDepthTexture=this._offscreen.geometryLinearDepthTexture}get _needsNormal(){return this._ssaoHelper.active}_renderNormal(){this._needsNormal?this._offscreen.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(b.Normal)}),this._offscreen.normal,this._offscreen.tmpDepth,[0,0,0,0],!0,!0):this._offscreen.disposeTarget(this._offscreen.normal)}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowCast}_computeDepthRange(e){if(!this._needsDepthRange)return x;const r=L(e,this._materialRenderers,this._stage.layers);return N(r,this.renderPlugins.queryDepthRange(e)),r.near=Math.max(e.near,r.near),r.far=Math.min(e.far,r.far),r}_renderGeometryAndTransparentTerrainPass(e){this._renderContext.output=e,this._prepareSlots(B.TRANSPARENT_TERRAIN),this._renderGeometryPass(e),this._renderTransparentTerrain()}_renderGeometryPass(e){this._renderContext.output=e,this._prepareSlots(B.TRANSPARENT_MATERIAL),this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderSSAO(e){this._ssaoHelper.render(this._bindParameters,e,this._offscreen.linearDepthTexture,this._offscreen.normalTexture)}_prepareOpaqueGeometrySlots(){this._prepareSlots(B.INTEGRATED_MESH,B.OPAQUE_TERRAIN,B.OPAQUE_MATERIAL,B.POSTPROCESSING_ENVIRONMENT_OPAQUE),this._prepareInternalSlots(this._materialRenderers,B.OPAQUE_MATERIAL)}_renderOpaqueGeometry(){this._renderSlot(B.INTEGRATED_MESH),this._renderSlot(B.OPAQUE_TERRAIN),this._renderInternalSlot(B.OPAQUE_MATERIAL),this._renderSlot(B.OPAQUE_MATERIAL),this._renderSlot(B.POSTPROCESSING_ENVIRONMENT_OPAQUE)}_renderTransparentGeometry(){this._renderInternalSlot(B.TRANSPARENT_MATERIAL),this._renderSlot(B.TRANSPARENT_MATERIAL)}_renderTransparentTerrain(){this._renderSlot(B.TRANSPARENT_TERRAIN)}_renderHUDVisibility(e){let r=!1;return this._renderContext.offscreenRenderingHelper&&this._renderContext.offscreenRenderingHelper.renderHUDVisibility((()=>{this._bindParameters.hudVisibilityTexture=this._renderContext.offscreenRenderingHelper.hudVisibilityTexture,r=this._renderInternalSlot(B.OCCLUSION_PIXELS)}),e),r}_renderLineCallouts(e){this._bindParameters.renderTransparentlyOccludedHUD=e,e===y.Occluded?this._offscreen.renderToTargets((()=>this._renderInternalSlot(B.LINE_CALLOUTS)),this._offscreen.currentColorTarget,this._offscreen.tmpDepth,void 0,!0,!0):this._renderInternalSlot(B.LINE_CALLOUTS)}_renderHUD(e,r){this._hasHUDElements&&(this._oitEnabled?(this._renderOITPass(de.HUD,e),this._rctx.bindFramebuffer(r),this._compositingHelper.composite(this._bindParameters,this._offscreen.hudColorTexture,re.PremultipliedAlpha)):e===y.Occluded?this._offscreen.renderToTargets((()=>this._renderHUDElements(y.Occluded)),this._offscreen.currentColorTarget,this._offscreen.tmpDepth,void 0,!0,!0):this._renderHUDElements(e))}_renderHUDElements(e){this._bindParameters.renderTransparentlyOccludedHUD=e,this._prepareInternalSlots(this._materialRenderers,B.LINE_CALLOUTS_HUD_DEPTH,B.HUD_MATERIAL,B.LABEL_MATERIAL),this._renderInternalSlot(B.LINE_CALLOUTS_HUD_DEPTH),this._renderInternalSlot(B.HUD_MATERIAL),this._renderInternalSlot(B.LABEL_MATERIAL)}get _needsHighlight(){return this._hasHighlights||this._renderPlugins.needsHighlight}get _needsShadowHighlight(){return this._shadowMap.enabled&&this._shadowHighlight.isVisible&&this._needsHighlight}_renderHighlights(e,r){if(!this._needsHighlight)return void this._offscreen.disposeTarget(this._offscreen.highlight);const t=this._highlight,s=this._offscreen.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(b.Highlight),this._rctx.clearSafe(ae.DEPTH_BUFFER_BIT),this._renderHUDElements(y.Both)}),this._offscreen.highlight,this._offscreen.tmpDepth,[0,0,0,0],!0,!0);this._bindParameters.highlightColorTexture=s.colorTexture,this._needsShadowHighlight&&this._shadowHighlight.render(r,e),t.render(this._bindParameters,s,e)}get _needsShadowCast(){return this._shadowAccumulator.isAccumulating}_accumulateShadows(e,r,t){this._needsShadowCast&&null!=this._offscreen.linearDepthTexture&&this._shadowAccumulator.renderAccumulation(this._offscreen.linearDepthTexture,e,r,t)}_prepareTransparencySlots(){this._renderContext.output=b.Alpha,this._bindParameters.transparencyPassType=K.Alpha,this._prepareInternalSlots(this._materialRenderers,B.TRANSPARENT_MATERIAL),this._prepareSlots(B.TRANSPARENT_MATERIAL),this._renderContext.output=b.Color,this._bindParameters.transparencyPassType=K.Color,this._prepareInternalSlots(this._materialRenderers,B.TRANSPARENT_MATERIAL),this._prepareSlots(B.TRANSPARENT_MATERIAL),this._bindParameters.transparencyPassType=K.FrontFace,this._prepareInternalSlots(this._materialRenderers,B.TRANSPARENT_MATERIAL),this._prepareSlots(B.TRANSPARENT_MATERIAL),this._bindParameters.transparencyPassType=K.NONE}_renderOITPass(e,r=y.Both){const t=e===de.HUD,s=t?()=>this._renderHUDElements(r):()=>this._renderTransparentGeometry(),i=e=>{this._bindParameters.transparencyPassType=e,this._offscreen.renderOITPass(s,e,t)},a=this._renderContext.output;this._renderContext.output=b.Alpha,i(K.Alpha),this._renderContext.output=b.Color,i(K.Color),i(K.FrontFace),this._offscreen.compositeTransparentOntoOpaque(this._bindParameters,t),this._bindParameters.transparencyPassType=K.NONE,this._renderContext.output=a,this._oitUsed=!0}_disposeOITBuffers(){this._oitUsed||(this._offscreen.disposeTarget(this._offscreen.alphaFloatTarget),this._offscreen.disposeTarget(this._offscreen.colorFloatTarget),this._offscreen.disposeTarget(this._offscreen.frontFaceTarget))}_renderOccluded(){let e=0;_e.clear(),this._materialRenderers.forAll((r=>{r.material&&r.material.isVisible()&&r.material.renderOccluded===v.OccludeAndTransparentStencil&&(e|=r.material.renderOccluded,_e.push(r))}));const r=this._offscreen,t=(t,s,i,a,n)=>{0!=(e&s)&&(r.renderToTargets(i,r.tmpColor,r.mainDepth,[0,0,0,0],a,n),r.compositeOccludedOntoMain(this._bindParameters,t))};0!==_e.length&&(this._prepareInternalSlots(_e,B.OCCLUDER_MATERIAL,B.TRANSPARENT_OCCLUDER_MATERIAL),this._renderInternalSlot(B.OCCLUDER_MATERIAL,_e),t(.5,v.OccludeAndTransparentStencil,(()=>this._renderInternalSlot(B.TRANSPARENT_OCCLUDER_MATERIAL,_e)),!1,!1)),_e.clear(),this._materialRenderers.forAll((r=>{r.material&&r.material.isVisible()&&(r.material.renderOccluded===v.OccludeAndTransparent||r.material.renderOccluded===v.Transparent||r.material.renderOccluded===v.Opaque)&&(e|=r.material.renderOccluded,_e.push(r))}));const s=this._renderPlugins.renderOccludedFlags;if(e|=s,!e)return;const i=e=>{this._renderContext.renderOccludedMask=e,this._prepareInternalSlots(_e,B.OPAQUE_MATERIAL,B.TRANSPARENT_MATERIAL,B.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),s>v.Occlude&&this._renderSlot(B.OCCLUDED_TERRAIN),this._renderInternalSlot(B.OPAQUE_MATERIAL,_e),this._renderInternalSlot(B.TRANSPARENT_MATERIAL,_e),this._renderInternalSlot(B.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,_e),this._renderContext.resetRenderOccludedMask()};this._renderContext.output=b.Color,t(.5,v.OccludeAndTransparent,(()=>i(v.OccludeAndTransparent)),!0,D.OutlineVisualElementMask),t(.5,v.Transparent,(()=>i(v.Transparent)),!0,D.OutlineVisualElementMask),t(1,v.Opaque,(()=>i(v.Opaque)),!0,D.OutlineVisualElementMask),_e.clear()}_renderAntiAliasing(e){if(this._antialiasing){if(this._smaaPass.enable((()=>this._requestRender()))&&null!=e)return this._smaaPass.render(e),!0}else this._smaaPass.disable();return!1}_prepare(e,r){this._needsTransparentPass=this._materialRenderers.some((e=>e.requiresSlot(B.TRANSPARENT_MATERIAL,b.Color))),this._bindParameters.camera=e,this._bindParameters.contentCamera=r}_ensureBindParameters(e,r){this._bindParameters.camera=e,this._bindParameters.contentCamera=r;const t=this._renderContext.offscreenRenderingHelper;this._bindParameters.hudVisibilityTexture=t.hudVisibilityTexture,this._bindParameters.mainColorTexture=t.mainColorTexture,this._bindParameters.highlightDepthTexture=t.depthTexture??this._getFallbackDepthTexture()}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.enabled=this.hasReflections,this._bindParameters.ssr.enabled){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=g:(f(ce,this._bindParameters.camera.viewMatrix),f(pe,this._bindParameters.camera.projectionMatrix),T(me,ce,pe),T(me,this._renderContext.lastFrameCamera.viewMatrix,me),T(me,this._renderContext.lastFrameCamera.projectionMatrix,me),this._reprojectionMatrix=me),this._bindParameters.ssr.lastFrameColorTexture=this._offscreen.lastFrameColorTexture;const r=this._stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=r>0?Math.min(r,e-this._ssrEnableTime)/r:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=g,this._bindParameters.ssr.lastFrameColorTexture=null,this._ssrEnableTime=null}_prepareInternalSlots(e,...r){for(const t of r)this._bindParameters.slot=t,e.forAll((e=>{e.material.shouldRender(this._renderContext)&&e.prepareTechnique(this._renderContext)}))}_renderInternalSlot(e,r=this._materialRenderers){let t=!1;return this._bindParameters.slot=e,r.forAll((e=>{if(e.material.shouldRender(this._renderContext)){const r=e.prepareTechnique(this._renderContext);null!=r&&(e.render(this._renderContext,r),t=!0)}})),t}_getFallbackDepthTexture(){return this._fallbackDepthStencilTexture||(this._fallbackDepthStencilTexture=H(this._rctx)),this._fallbackDepthStencilTexture}get gpuMemoryUsage(){return{offscreen:this._offscreen?.gpuMemoryUsage??0,highlights:(this._highlight?.gpuMemoryUsage??0)+(this._shadowHighlight?.gpuMemoryUsage??0),shadows:this._shadowMap?.gpuMemoryUsage??0,ssao:this._ssaoHelper?.gpuMemoryUsage??0}}get test(){const e=this;return{offscreen:this._offscreen,shadowMap:this._shadowMap,ssao:this._ssaoHelper,highlight:this._highlight,lighting:this._bindParameters.lighting,materialRenderers:this._materialRenderers,shadowAccumulator:this._shadowAccumulator,weatherIsFading:this._bindParameters.cloudsFade.isFading,resetRenderStateFeatures:()=>{e._renderStateFeatures=G()},getFramebufferTexture:r=>{switch(r){case le.Color:return e._offscreen.colorTexture;case le.LinearDepth:return e._offscreen.linearDepthTexture;case le.Normals:return e._offscreen.normalTexture;case le.ShadowMap:return e._shadowMap.depthTexture;case le.HudVisibility:return e._offscreen.hudVisibilityTexture;case le.Highlight:return e._offscreen.highlightTexture}}}}};var de,le;e([c()],oe.prototype,"_renderPlugins",void 0),e([c()],oe.prototype,"_shadowAccumulator",void 0),e([c()],oe.prototype,"_state",void 0),e([c()],oe.prototype,"_renderStateFeatures",void 0),e([c()],oe.prototype,"_antialiasingEnabled",void 0),e([c({readOnly:!0})],oe.prototype,"_antialiasing",null),e([c()],oe.prototype,"_ssaoEnabled",void 0),e([c()],oe.prototype,"_smaaPass",void 0),e([c({autoDestroy:!0})],oe.prototype,"_edgeView",void 0),e([c()],oe.prototype,"updating",null),e([c()],oe.prototype,"isCameraFinal",null),oe=e([m("esri.views.3d.webgl-engine.lib.Renderer")],oe),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(de||(de={})),function(e){e[e.Color=0]="Color",e[e.LinearDepth=1]="LinearDepth",e[e.Normals=2]="Normals",e[e.ShadowMap=3]="ShadowMap",e[e.HudVisibility=4]="HudVisibility",e[e.Highlight=5]="Highlight"}(le||(le={}));const _e=new o,pe=R(),ce=R(),me=R();function ue(e){return r=>e.immediate.schedule(r)}export{le as FramebufferId,oe as Renderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import o from"../../../../Color.js";import{loadFont as t}from"../../../../core/fontUtils.js";import r from"../../../../core/Logger.js";import{pt2px as e}from"../../../../core/screenUtils.js";import{Z as i}from"../../../../chunks/vec4f64.js";class n{constructor(o){this.definition=o,this.key=JSON.stringify(o),this.haloSize=Math.round(o.halo.size),this.textStyle=this._colorToRGBA(o.color),this.haloStyle=this._colorToRGB(o.halo.color),this.backgroundStyle=0!==o.background.color[3]?this._colorToRGBA(o.background.color):null}fontString(o){const t=this.definition.font;return`${t.style} ${t.weight} ${o}px ${t.family}, sans-serif`}_colorToRGB(o){return`rgb(${o.slice(0,3).map((o=>Math.floor(255*o))).toString()})`}_colorToRGBA(o){return`rgba(${o.slice(0,3).map((o=>Math.floor(255*o))).toString()},${o[3]})`}static async fromSymbol(l,a){const c=l?.material?.color,f=o.toUnitRGBA(c)??i,u=null!=l.size?e(l.size):12,g=l.lineHeight,m=null!=l.background?o.toUnitRGBA(l.background.color):i,h={family:l.font?.family??"sans-serif",decoration:l.font?.decoration??"none",weight:l.font?.weight??"normal",style:l.font?.style??"normal"},d=l.halo,y=null!=d&&null!=d.color&&d.size>0?{size:e(d.size),color:o.toUnitRGBA(d.color)}:{size:0,color:i},b=new n({color:f,size:u,background:{color:m,padding:null!=l.background?[.65*u,.5*u]:[0,0],borderRadius:null!=l.background?u*(6/16):0},lineSpacingFactor:g,font:h,halo:y,pixelRatio:a});if(l.font){let o=!1;const e=b.fontString(u);try{o=(await document.fonts.load(e)).length>0}catch(p){r.getLogger("esri.views.3d.webgl-engine.lib.TextRenderParameters").warnOnce(`Failed to preload font '${e}'. Some text symbology may be rendered using the default browser font.`)}if(!o&&!s.has(l.font.family))try{await t(l.font),o=!0}catch(p){}}return b}}const s=new Set(["Arial","Times New Roman","Courier New","serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","math","emoji","fangsong"]);export{n as TextRenderParameters};
5
+ import o from"../../../../Color.js";import{isCachedFontFace as t,loadFont as r}from"../../../../core/fontUtils.js";import e from"../../../../core/Logger.js";import{pt2px as i}from"../../../../core/screenUtils.js";import{Z as n}from"../../../../chunks/vec4f64.js";class s{constructor(o){this.definition=o,this.key=JSON.stringify(o),this.haloSize=Math.round(o.halo.size),this.textStyle=this._colorToRGBA(o.color),this.haloStyle=this._colorToRGB(o.halo.color),this.backgroundStyle=0!==o.background.color[3]?this._colorToRGBA(o.background.color):null}fontString(o){const t=this.definition.font;return`${t.style} ${t.weight} ${o}px ${t.family}, sans-serif`}_colorToRGB(o){return`rgb(${o.slice(0,3).map((o=>Math.floor(255*o))).toString()})`}_colorToRGBA(o){return`rgba(${o.slice(0,3).map((o=>Math.floor(255*o))).toString()},${o[3]})`}static async fromSymbol(a,c){const f=a?.material?.color,m=o.toUnitRGBA(f)??n,u=null!=a.size?i(a.size):12,g=a.lineHeight,h=null!=a.background?o.toUnitRGBA(a.background.color):n,d={family:a.font?.family??"sans-serif",decoration:a.font?.decoration??"none",weight:a.font?.weight??"normal",style:a.font?.style??"normal"},y=a.halo,b=null!=y&&null!=y.color&&y.size>0?{size:i(y.size),color:o.toUnitRGBA(y.color)}:{size:0,color:n},p=new s({color:m,size:u,background:{color:h,padding:null!=a.background?[.65*u,.5*u]:[0,0],borderRadius:null!=a.background?u*(6/16):0},lineSpacingFactor:g,font:d,halo:b,pixelRatio:c});if(a.font){let o=!1;const i=p.fontString(u);try{o=(await document.fonts.load(i)).some((o=>!t(o)))}catch(w){e.getLogger("esri.views.3d.webgl-engine.lib.TextRenderParameters").warnOnce(`Failed to preload font '${i}'. Some text symbology may be rendered using the default browser font.`)}if(!o&&!l.has(a.font.family))try{await r(a.font)}catch(w){}}return p}}const l=new Set(["Arial","Times New Roman","Courier New","serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","math","emoji","fangsong"]);export{s as TextRenderParameters};