@arcgis/core 4.27.0-rc.1 → 4.27.0-rc.2

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 (98) hide show
  1. package/README.md +2 -2
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{92e7f224a80195e606d6.js → 1f69fb9687de9ebfcf90.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{0a02ac5628d1739372c6.js → 2b55295590b4a0503749.js} +1 -1
  5. package/assets/esri/core/workers/chunks/471f6eba213412b82840.js +1 -0
  6. package/assets/esri/core/workers/chunks/{f339db2b599fa9585283.js → 5e6471dd2a08e66b47d0.js} +79 -81
  7. package/assets/esri/core/workers/chunks/{474d9b334812533bab36.js → 6cd248d065f6d1616294.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{d8bd3f498b3fa8153404.js → 6f510f28526c73ab453c.js} +1 -1
  9. package/assets/esri/core/workers/chunks/83e3d104886b48f00397.js +1 -0
  10. package/assets/esri/core/workers/chunks/{3c5a64a545272f148e93.js → 9621b7d8d951aa881686.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{b6e173eddaad4244cb5f.js → b31974524932e638df8c.js} +1 -1
  12. package/assets/esri/core/workers/chunks/da57eba2fe25495ea217.js +1 -0
  13. package/assets/esri/core/workers/chunks/dabd889e064c4e7807fa.js +1 -0
  14. package/assets/esri/core/workers/chunks/f35895e03c036d67b3ed.js +1 -0
  15. package/assets/esri/core/workers/chunks/{c6efe2e04ea6a55bb6e3.js → f6e68befe2812b90b40d.js} +1 -1
  16. package/assets/esri/themes/base/widgets/_Feature.scss +4 -0
  17. package/assets/esri/themes/base/widgets/_FeatureContent.scss +9 -2
  18. package/assets/esri/themes/base/widgets/_ScaleRangeSlider.scss +1 -0
  19. package/assets/esri/themes/dark/main.css +1 -1
  20. package/assets/esri/themes/light/main.css +1 -1
  21. package/assets/esri/themes/light/view.css +1 -1
  22. package/chunks/DefaultMaterial.glsl.js +3 -2
  23. package/chunks/ShadowCastAccumulate.glsl.js +1 -1
  24. package/core/timeUtils.js +1 -1
  25. package/geometry/Mesh.js +1 -1
  26. package/geometry/support/meshVertexSpaceUtils.js +5 -0
  27. package/interfaces.d.ts +179 -31
  28. package/kernel.js +1 -1
  29. package/layers/VideoLayer.js +1 -1
  30. package/layers/graphics/controllers/StreamController.js +1 -1
  31. package/layers/graphics/data/QueryEngine.js +1 -1
  32. package/layers/graphics/data/attributeSupport.js +1 -1
  33. package/layers/graphics/editingSupport.js +1 -1
  34. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  35. package/layers/video/VideoController.js +1 -1
  36. package/layers/video/videoUtils.js +5 -0
  37. package/package.json +1 -1
  38. package/rest/support/meshFeatureSet.js +1 -1
  39. package/smartMapping/symbology/flow.js +1 -1
  40. package/statistics/utils.js +1 -1
  41. package/support/revision.js +1 -1
  42. package/symbols/cim/CIMSymbolHelper.js +1 -1
  43. package/views/2d/layers/StreamLayerView2D.js +1 -1
  44. package/views/2d/layers/features/sources/StreamSource.js +1 -1
  45. package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
  46. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  47. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  48. package/views/3d/layers/I3SMeshView3D.js +1 -1
  49. package/views/3d/layers/II3SMeshView3D.js +1 -1
  50. package/views/3d/layers/SceneLayerView3D.js +1 -1
  51. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  52. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  53. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  54. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  55. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  56. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  57. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  58. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  59. package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +3 -9
  60. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +12 -9
  61. package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js +10 -10
  62. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +2 -2
  63. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js +2 -2
  64. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +8 -8
  65. package/views/3d/webgl-engine/core/shaderModules/Matrix4sDrawUniform.js +1 -1
  66. package/views/3d/webgl-engine/lib/ShadowHighlight.js +1 -1
  67. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  68. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  69. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  70. package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
  71. package/views/3d/webgl-engine/shaders/AtmosphereCompositingTechnique.js +1 -1
  72. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  73. package/views/3d/webgl-engine/shaders/ShadowHighlightTechnique.js +1 -1
  74. package/views/draw/DrawGraphicTool.js +1 -1
  75. package/views/layers/GroupLayerView.js +1 -1
  76. package/widgets/Daylight/DaylightViewModel.js +1 -1
  77. package/widgets/Editor/EditorViewModel.js +1 -1
  78. package/widgets/Editor/UpdateWorkflow.js +1 -1
  79. package/widgets/Editor/Workflow.js +1 -1
  80. package/widgets/Editor/workflowUtils.js +1 -1
  81. package/widgets/Editor.js +1 -1
  82. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  83. package/widgets/Feature/FeatureRelationship.js +1 -1
  84. package/widgets/FeatureForm/EditableInput.d.ts +2 -2
  85. package/widgets/FeatureTable/FieldColumn.js +1 -1
  86. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  87. package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
  88. package/widgets/UtilityNetworkTrace/support/ResultAreaHandler.js +1 -1
  89. package/widgets/UtilityNetworkTrace.js +1 -1
  90. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +1 -1
  91. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  92. package/widgets/ValuePicker/ValuePickerBaseComponent.js +1 -1
  93. package/widgets/ValuePicker.js +1 -1
  94. package/assets/esri/core/workers/chunks/07651ef8348f702d59ac.js +0 -1
  95. package/assets/esri/core/workers/chunks/39714837f9d3708e3806.js +0 -1
  96. package/assets/esri/core/workers/chunks/785a6c925f29bc962992.js +0 -1
  97. package/assets/esri/core/workers/chunks/90da1ed112b82712d0ef.js +0 -1
  98. package/assets/esri/core/workers/chunks/b5fc6f2044ed047c5afd.js +0 -1
@@ -2,7 +2,7 @@
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{I as e}from"./mat4f64.js";import{ForwardLinearDepth as r}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js";import{Offset as o}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js";import{ShaderOutput as a}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as i}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as l}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{InstancedDoublePrecision as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import{NormalAttribute as t,NormalType as n}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{PositionAttribute as d}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js";import{SymbolColor as c}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js";import{TextureCoordinateAttribute as m}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexColor as g}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js";import{VertexNormal as u}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js";import{VerticalOffset as p}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{DefaultMaterialAuxiliaryPasses as v}from"../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import{ComputeNormalTexture as h}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import{EvaluateAmbientOcclusion as f}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as b,addAmbientBoostFactor as w,addLightingGlobalFactor as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightIntensity as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{multipassTerrainTest as C}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{Normals as T}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js";import{PhysicallyBasedRendering as L}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import{PhysicallyBasedRenderingParameters as j,PBRMode as M}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapPass as P,ReadShadowMapDraw as $}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{colorTextureUV as O,normalTextureUV as N,emissiveTextureUV as A,occlusionTextureUV as S,metallicRoughnessTextureUV as E}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl.js";import{VisualVariables as V}from"../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js";import{symbolAlphaCutoff as D}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{DiscardOrAdjustAlphaPass as _}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl.js";import{MixExternalColor as U}from"../views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js";import{addProjViewLocalOrigin as B,addCameraPosition as F}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as I}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as R}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as z}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as W}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{Matrix4PassUniform as k}from"../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js";import{ShaderBuilder as G}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as q}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{TransparencyPassType as H}from"../views/3d/webgl-engine/lib/TransparencyPassType.js";import{VertexAttribute as J}from"../views/3d/webgl-engine/lib/VertexAttribute.js";function K(K){const Q=new G,{vertex:X,fragment:Y,varyings:Z}=Q;if(B(X,K),Q.include(d),Z.add("vpos","vec3"),Q.include(V,K),Q.include(s,K),Q.include(p,K),K.hasColorTextureTransform&&Q.include(O),K.output===a.Color||K.output===a.Alpha){K.hasNormalTextureTransform&&Q.include(N),K.hasEmissionTextureTransform&&Q.include(A),K.hasOcclusionTextureTransform&&Q.include(S),K.hasMetallicRoughnessTextureTransform&&Q.include(E),F(X,K),Q.include(t,K),Q.include(l,K);const a=K.normalType===n.Attribute||K.normalType===n.Compressed;a&&K.offsetBackfaces&&Q.include(o),Q.include(h,K),Q.include(u,K),K.instancedColor&&Q.attributes.add(J.INSTANCECOLOR,"vec4"),Z.add("vPositionLocal","vec3"),Q.include(m,K),Q.include(r,K),Q.include(c,K),Q.include(g,K),X.uniforms.add(new R("externalColor",(e=>e.externalColor))),Z.add("vcolorExt","vec4"),K.hasMultipassTerrain&&Z.add("depth","float"),K.hasModelTransformation&&X.uniforms.add(new k("model",(r=>null!=r.modelTransformation?r.modelTransformation:e))),X.code.add(W`
5
+ import{I as e}from"./mat4f64.js";import{ForwardLinearDepth as r}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js";import{Offset as o}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js";import{ShaderOutput as a}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as i}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as s}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{InstancedDoublePrecision as l}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import{NormalAttribute as t,NormalType as n}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{PositionAttribute as d}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js";import{SymbolColor as c}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js";import{TextureCoordinateAttribute as m}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexColor as g}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js";import{VertexNormal as u}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js";import{VerticalOffset as p}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{DefaultMaterialAuxiliaryPasses as v}from"../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import{ComputeNormalTexture as h}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import{EvaluateAmbientOcclusion as f}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as b,addAmbientBoostFactor as w,addLightingGlobalFactor as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightIntensity as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{multipassTerrainTest as C}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{Normals as T}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js";import{PhysicallyBasedRendering as L}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import{PhysicallyBasedRenderingParameters as j,PBRMode as M}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapPass as P,ReadShadowMapDraw as $}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{colorTextureUV as O,normalTextureUV as N,emissiveTextureUV as A,occlusionTextureUV as S,metallicRoughnessTextureUV as E}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl.js";import{VisualVariables as V}from"../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js";import{symbolAlphaCutoff as D}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js";import{DiscardOrAdjustAlphaPass as _}from"../views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl.js";import{MixExternalColor as U}from"../views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js";import{addProjViewLocalOrigin as B,addCameraPosition as F}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as I}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as R}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as z}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as W}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{Matrix4PassUniform as k}from"../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js";import{ShaderBuilder as G}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as q}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{TransparencyPassType as H}from"../views/3d/webgl-engine/lib/TransparencyPassType.js";import{VertexAttribute as J}from"../views/3d/webgl-engine/lib/VertexAttribute.js";function K(K){const Q=new G,{vertex:X,fragment:Y,varyings:Z}=Q;if(B(X,K),Q.include(d),Z.add("vpos","vec3"),Q.include(V,K),Q.include(l,K),Q.include(p,K),K.hasColorTextureTransform&&Q.include(O),K.output===a.Color||K.output===a.Alpha){K.hasNormalTextureTransform&&Q.include(N),K.hasEmissionTextureTransform&&Q.include(A),K.hasOcclusionTextureTransform&&Q.include(S),K.hasMetallicRoughnessTextureTransform&&Q.include(E),F(X,K),Q.include(t,K),Q.include(s,K);const a=K.normalType===n.Attribute||K.normalType===n.Compressed;a&&K.offsetBackfaces&&Q.include(o),Q.include(h,K),Q.include(u,K),K.instancedColor&&Q.attributes.add(J.INSTANCECOLOR,"vec4"),Z.add("vPositionLocal","vec3"),Q.include(m,K),Q.include(r,K),Q.include(c,K),Q.include(g,K),X.uniforms.add(new R("externalColor",(e=>e.externalColor))),Z.add("vcolorExt","vec4"),K.hasMultipassTerrain&&Z.add("depth","float");const i=K.hasModelTransformation;i&&X.uniforms.add(new k("model",(r=>r.modelTransformation??e))),X.code.add(W`
6
6
  void main(void) {
7
7
  forwardNormalizedVertexColor();
8
8
  vcolorExt = externalColor;
@@ -15,12 +15,13 @@ import{I as e}from"./mat4f64.js";import{ForwardLinearDepth as r}from"../views/3d
15
15
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
16
16
  } else {
17
17
  vpos = calculateVPos();
18
+ ${i?"vpos = (model * vec4(vpos, 1.0)).xyz;":""}
18
19
  vPositionLocal = vpos - view[3].xyz;
19
20
  vpos = subtractOrigin(vpos);
20
21
  ${a?W`vNormalWorld = dpNormal(vvLocalNormal(normalModel()));`:""}
21
22
  vpos = addVerticalOffset(vpos, localOrigin);
22
23
  ${K.hasVertexTangents?"vTangent = dpTransformVertexTangent(tangent);":""}
23
- gl_Position = transformPosition(proj, view, ${K.hasModelTransformation?"model,":""} vpos);
24
+ gl_Position = transformPosition(proj, view, vpos);
24
25
  ${a&&K.offsetBackfaces?"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""}
25
26
  }
26
27
 
@@ -2,7 +2,7 @@
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{a as e,w as a}from"./mat4.js";import{c as r}from"./mat4f64.js";import{ScreenSpacePass as o}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadLinearDepth as s}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadLinearDepth.glsl.js";import{ReadShadowMapBindParameters as i,ReadShadowMapPass as t}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{CameraSpace as d}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{RgbaFloatEncoding as l}from"../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import{Float2PassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{glsl as c}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{Matrix4PassUniform as p}from"../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js";import{ShaderBuilder as h}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";class w extends i{}const u=255,g=1/u;function f(r){const i=new h,w=i.fragment;return w.include(l),w.include(s),i.include(d),i.include(o),i.include(t,r),w.uniforms.add(new m("depthMap",(e=>e.linearDepthTexture)),new p("inverseViewMatrix",((r,o)=>e(v,a(v,o.camera.viewMatrix,o.camera.center)))),new n("nearFar",((e,a)=>a.camera.nearFar))),w.constants.add("sampleValue","float",g),w.code.add(c`void main(void) {
5
+ import{a as e,w as a}from"./mat4.js";import{c as r}from"./mat4f64.js";import{ScreenSpacePass as o}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadLinearDepth as s}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadLinearDepth.glsl.js";import{ReadShadowMapPassParameters as i,ReadShadowMapPass as t}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{CameraSpace as d}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{RgbaFloatEncoding as l}from"../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import{Float2PassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{glsl as c}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{Matrix4PassUniform as p}from"../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js";import{ShaderBuilder as h}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";class w extends i{}const u=255,g=1/u;function f(r){const i=new h,w=i.fragment;return w.include(l),w.include(s),i.include(d),i.include(o),i.include(t,r),w.uniforms.add(new m("depthMap",(e=>e.linearDepthTexture)),new p("inverseViewMatrix",((r,o)=>e(v,a(v,o.camera.viewMatrix,o.camera.center)))),new n("nearFar",((e,a)=>a.camera.nearFar))),w.constants.add("sampleValue","float",g),w.code.add(c`void main(void) {
6
6
  float depth = rgba2float(texture(depthMap, uv));
7
7
  if (depth == 0.0) {
8
8
  discard;
package/core/timeUtils.js CHANGED
@@ -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.js";const e={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8},t={milliseconds:{getter:"getMilliseconds",setter:"setMilliseconds",multiplier:1},seconds:{getter:"getSeconds",setter:"setSeconds",multiplier:1},minutes:{getter:"getMinutes",setter:"setMinutes",multiplier:1},hours:{getter:"getHours",setter:"setHours",multiplier:1},days:{getter:"getDate",setter:"setDate",multiplier:1},weeks:{getter:"getDate",setter:"setDate",multiplier:7},months:{getter:"getMonth",setter:"setMonth",multiplier:1},years:{getter:"getFullYear",setter:"setFullYear",multiplier:1},decades:{getter:"getFullYear",setter:"setFullYear",multiplier:10},centuries:{getter:"getFullYear",setter:"setFullYear",multiplier:100}};function s(e,t){const s=new Date(e,t+1,1);return s.setDate(0),s.getDate()}function n(e,n,r){const l=new Date(e.getTime());if(n&&r){const e=t[r],{getter:u,setter:i,multiplier:a}=e;if("months"===r){const e=s(l.getFullYear(),l.getMonth()+n);l.getDate()>e&&l.setDate(e)}l[i](l[u]()+n*a)}return l}function r(e,t,s="milliseconds"){const n=e.getTime(),r=g(t,s,"milliseconds");return new Date(n+r)}function l(e,t){switch(t){case"milliseconds":return new Date(e.getTime());case"seconds":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds());case"minutes":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes());case"hours":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours());case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate());case"weeks":return new Date(e.getFullYear(),e.getMonth(),e.getDate()-e.getDay());case"months":return new Date(e.getFullYear(),e.getMonth(),1);case"years":return new Date(e.getFullYear(),0,1);case"decades":return new Date(e.getFullYear()-e.getFullYear()%10,0,1);case"centuries":return new Date(e.getFullYear()-e.getFullYear()%100,0,1);default:return new Date}}function u(e,t,s="milliseconds"){const n=new Date(g(t,s,"milliseconds"));return n.setUTCFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n}function i(e,t="milliseconds"){const s=g(e.getUTCHours(),"hours","milliseconds"),n=g(e.getUTCMinutes(),"minutes","milliseconds"),r=g(e.getUTCSeconds(),"seconds","milliseconds");return g(s+n+r+e.getUTCMilliseconds(),"milliseconds",t)}function a(e,t){const s=new Date(e.getTime());return s.setUTCFullYear(t.getFullYear(),t.getMonth(),t.getDate()),s}function o(e){const t=new Date(0);return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),t}function g(t,s,n){if(0===t)return 0;return t*e[s]/e[n]}export{g as convertTime,u as makeUTCTime,n as offsetDate,r as offsetDateUTC,a as resetUTCDate,i as timeSinceUTCMidnight,l as truncateDate,o as truncateLocalTime};
5
+ import"./has.js";const e={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8},t={milliseconds:{getter:"getMilliseconds",setter:"setMilliseconds",multiplier:1},seconds:{getter:"getSeconds",setter:"setSeconds",multiplier:1},minutes:{getter:"getMinutes",setter:"setMinutes",multiplier:1},hours:{getter:"getHours",setter:"setHours",multiplier:1},days:{getter:"getDate",setter:"setDate",multiplier:1},weeks:{getter:"getDate",setter:"setDate",multiplier:7},months:{getter:"getMonth",setter:"setMonth",multiplier:1},years:{getter:"getFullYear",setter:"setFullYear",multiplier:1},decades:{getter:"getFullYear",setter:"setFullYear",multiplier:10},centuries:{getter:"getFullYear",setter:"setFullYear",multiplier:100}};function s(e,t){const s=new Date(e,t+1,1);return s.setDate(0),s.getDate()}function n(e,n,r){const l=new Date(e.getTime());if(n&&r){const e=t[r],{getter:u,setter:i,multiplier:a}=e;if("months"===r){const e=s(l.getFullYear(),l.getMonth()+n);l.getDate()>e&&l.setDate(e)}l[i](l[u]()+n*a)}return l}function r(e,t,s="milliseconds"){const n=e.getTime(),r=g(t,s,"milliseconds");return new Date(n+r)}function l(e,t){switch(t){case"milliseconds":return new Date(e.getTime());case"seconds":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds());case"minutes":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes());case"hours":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours());case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate());case"weeks":return new Date(e.getFullYear(),e.getMonth(),e.getDate()-e.getDay());case"months":return new Date(e.getFullYear(),e.getMonth(),1);case"years":return new Date(e.getFullYear(),0,1);case"decades":return new Date(e.getFullYear()-e.getFullYear()%10,0,1);case"centuries":return new Date(e.getFullYear()-e.getFullYear()%100,0,1);default:return new Date}}function u(e,t,s="milliseconds"){const n=new Date(g(t,s,"milliseconds"));return n.setUTCFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n}function i(e,t="milliseconds"){const s=g(e.getUTCHours(),"hours","milliseconds"),n=g(e.getUTCMinutes(),"minutes","milliseconds"),r=g(e.getUTCSeconds(),"seconds","milliseconds");return g(s+n+r+e.getUTCMilliseconds(),"milliseconds",t)}function a(e,t){const s=new Date(e.getTime());return s.setUTCFullYear(t.getFullYear(),t.getMonth(),t.getDate()),s}function o(e){const t=new Date(0);return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),t}function g(t,s,n){if(0===t)return 0;return t*e[s]/e[n]}function c(e){return e instanceof Date&&!isNaN(e.getTime())}export{g as convertTime,c as isValidDate,u as makeUTCTime,n as offsetDate,r as offsetDateUTC,a as resetUTCDate,i as timeSinceUTCMidnight,l as truncateDate,o as truncateLocalTime};
package/geometry/Mesh.js CHANGED
@@ -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"../core/Error.js";import{HandleOwnerMixin as r}from"../core/HandleOwner.js";import o from"../core/Loadable.js";import s from"../core/Logger.js";import{EsriPromiseMixin as n}from"../core/Promise.js";import{whenOrAbort as i}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{c as l}from"../chunks/vec3f64.js";import m from"./Extent.js";import h from"./Geometry.js";import u from"./Point.js";import f from"./Polygon.js";import{composeAxes as d,create as g}from"./support/axisAngleDegrees.js";import x from"./support/MeshComponent.js";import y from"./support/MeshGeoreferencedRelativeVertexSpace.js";import v from"./support/MeshGeoreferencedVertexSpace.js";import j from"./support/MeshLocalVertexSpace.js";import w from"./support/MeshTransform.js";import{MeshVertexAttributes as b}from"./support/MeshVertexAttributes.js";import{triangulate as S}from"./support/triangulationUtils.js";import{getProjectedExtent as L,getExtentFromPositions as A}from"./support/meshUtils/bounds.js";import{centerAt as M}from"./support/meshUtils/centerAt.js";import{project as P}from"./support/meshUtils/georeference.js";import{loadExternal as R}from"./support/meshUtils/loadExternal.js";import{Metadata as F}from"./support/meshUtils/Metadata.js";import{offset as E}from"./support/meshUtils/offset.js";import{convertUnitGeometry as U,createUnitSizeBox as C,extractSingleFaceOfBox as _,createUnitSizeSphere as z,createUnitSizeCylinder as G,convertPlaneSizeParameter as O,createUnitSizePlane as T}from"./support/meshUtils/primitives.js";import{rotate as V}from"./support/meshUtils/rotate.js";import{scale as B}from"./support/meshUtils/scale.js";var k;const D="esri.geometry.Mesh",W={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:v,"georeferenced-relative":y,local:j}};let N=k=class extends(r(o.LoadableMixin(n(h)))){constructor(e){super(e),this.components=null,this.vertexSpace=new v,this.transform=null,this.metadata=new F,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new b,this.type="mesh"}initialize(){(0===this.metadata.externalSources.length||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when((()=>{this.handles.add(a((()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map((e=>e.clone()))})),(()=>this._clearSources()),{once:!0,sync:!0}))}))}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):null!=this.metadata.displaySource?.extent}get _transformedExtent(){const{components:e,spatialReference:t,vertexAttributes:r,vertexSpace:o}=this,s=r.position;if(0===s.length||e&&0===e.length)return new m({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:t});if("local"===o.type){const{_untransformedExtent:e,transform:r}=this;return L(e,r,o,t)}if("georeferenced-relative"===o.type){const{transform:e}=this,r=P(t,e,o,s,t);return A(r,t)}return A(s,t)}get _untransformedExtent(){return A(this.vertexAttributes.position,this.spatialReference)}get anchor(){const{vertexSpace:e}=this;if(e.isRelative)return e.getOriginPoint(this.spatialReference);const{center:t,zmin:r}=this._transformedExtent;return new u({x:t.x,y:t.y,z:r,spatialReference:this.spatialReference})}get origin(){const{vertexSpace:e}=this;return e.isRelative?e.getOriginPoint(this.spatialReference):this._transformedExtent.center}get extent(){return this.loaded||null==this.metadata?.displaySource?.extent?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this.loaded?(this.components||(this.components=[]),this.components.push(x.from(e)),this.notifyChange("components")):s.getLogger(this).error("addComponent()","Mesh must be loaded before applying operations")}removeComponent(e){if(this.loaded){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}s.getLogger(this).error("removeComponent()","Provided component is not part of the list of components")}else s.getLogger(this).error("removeComponent()","Mesh must be loaded before applying operations")}rotate(e,t,r,o){return d(e,t,r,H),V(this,H,o),this}offset(e,t,r,o){return this.loaded?(Z[0]=e,Z[1]=t,Z[2]=r,E(this,Z,o),this):(s.getLogger(this).error("offset()","Mesh must be loaded before applying operations"),this)}scale(e,t){return this.loaded?(B(this,e,t),this):(s.getLogger(this).error("scale()","Mesh must be loaded before applying operations"),this)}centerAt(e,t){return this.loaded?(M(this,e,t),this):(s.getLogger(this).error("centerAt()","Mesh must be loaded before applying operations"),this)}load(e){const{metadata:{displaySource:t}}=this;return t&&this.addResolvingPromise(R(this,t,e)),Promise.resolve(this)}addExternalSources(e){this.metadata.externalSources.addMany(e)}updateDisplaySource(e){this.metadata.displaySource=e}clone(){let e=null;if(this.components){const t=new Map,r=new Map;e=this.components.map((e=>e.cloneWithDeduplication(t,r)))}const t={components:e,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes.clone(),vertexSpace:this.vertexSpace.clone(),transform:this.transform?.clone()??null,metadata:this.metadata.clone()};return new k(t)}cloneShallow(){return new k({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const t=import("./support/meshUtils/exporters/gltf/gltfexport.js"),r=this.load(),o=await Promise.all([t,r]),{toBinaryGLTF:s}=o[0];return s(this,e)}get memoryUsage(){let e=0;if(e+=this.vertexAttributes.memoryUsage,null!=this.components)for(const t of this.components)e+=t.memoryUsage;return e}_clearSources(){this.metadata.clearSources()}static createBox(e,t){if(!(e instanceof u))return s.getLogger(D).error(".createBox()","expected location to be a Point instance"),null;const r=new k(U(C(),e,t));return t&&t.imageFace&&"all"!==t.imageFace?_(r,t.imageFace):r}static createSphere(e,t){return e instanceof u?new k(U(z(t&&t.densificationFactor||0),e,t)):(s.getLogger(D).error(".createSphere()","expected location to be a Point instance"),null)}static createCylinder(e,t){return e instanceof u?new k(U(G(t&&t.densificationFactor||0),e,t)):(s.getLogger(D).error(".createCylinder()","expected location to be a Point instance"),null)}static createPlane(e,t){if(!(e instanceof u))return s.getLogger(D).error(".createPlane()","expected location to be a Point instance"),null;const r=t?.facing??"up",o=O(r,t?.size);return new k(U(T(r),e,{...t,size:o}))}static createFromPolygon(e,t){if(!(e instanceof f))return s.getLogger(D).error(".createFromPolygon()","expected polygon to be a Polygon instance"),null;const r=S(e);return new k({vertexAttributes:new b({position:r.position}),components:[new x({faces:r.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new v})}static async createFromGLTF(e,r,o){if(!(e instanceof u))throw s.getLogger(D).error(".createfromGLTF()","expected location to be a Point instance"),new t("invalid-input","Expected location to be a Point instance");const{loadGLTFMesh:n}=await i(import("./support/meshUtils/loadGLTFMesh.js"),o);return new k(await n(e,r,o))}static async createFromFiles(e,r,o){if(!(e instanceof u)){const e="Expected location to be a Point instance";throw s.getLogger(D).error(".createFromFiles()",e),new t("invalid-input",e)}const n=k.createWithExternalSource(e,r),i=o?.layer;if(!i){const e="A layer is needed to convert the files";throw s.getLogger(D).error(".createFromFiles()",e),new t("invalid-input",e)}const[a]=await i.uploadAssets([n],o);return a}static createWithExternalSource(e,t,r){const o=r?.extent??null,{x:s,y:n,z:i,spatialReference:a}=e,c=r?.transform?.clone()??new w,p=r?.vertexSpace??new j({origin:[s,n,i??0]}),l={source:t,extent:o},m=new F;return m.externalSources.push(l),new k({metadata:m,transform:c,vertexSpace:p,spatialReference:a})}static createIncomplete(e,r){const{x:o,y:s,z:n,spatialReference:i}=e,a=r?.transform?.clone()??new w,c=r?.vertexSpace??new j({origin:[o,s,n??0]}),p=new k({transform:a,vertexSpace:c,spatialReference:i});return p.addResolvingPromise(Promise.reject(new t("mesh-incomplete","Mesh resources are not complete"))),p}};e([c({type:[x],json:{write:!0}})],N.prototype,"components",void 0),e([c({nonNullable:!0,types:W,constructOnly:!0,json:{write:!0}})],N.prototype,"vertexSpace",void 0),e([c({type:w,json:{write:!0}})],N.prototype,"transform",void 0),e([c({constructOnly:!0})],N.prototype,"metadata",void 0),e([c()],N.prototype,"hasExtent",null),e([c()],N.prototype,"_transformedExtent",null),e([c()],N.prototype,"_untransformedExtent",null),e([c()],N.prototype,"anchor",null),e([c()],N.prototype,"origin",null),e([c({readOnly:!0,json:{read:!1}})],N.prototype,"extent",null),e([c({readOnly:!0,json:{read:!1,write:!0,default:!0}})],N.prototype,"hasZ",void 0),e([c({readOnly:!0,json:{read:!1,write:!0,default:!1}})],N.prototype,"hasM",void 0),e([c({type:b,nonNullable:!0,json:{write:!0}})],N.prototype,"vertexAttributes",void 0),N=k=e([p(D)],N);const Z=l(),H=g(),I=N;export{I as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Error.js";import{HandleOwnerMixin as r}from"../core/HandleOwner.js";import o from"../core/Loadable.js";import s from"../core/Logger.js";import{EsriPromiseMixin as n}from"../core/Promise.js";import{whenOrAbort as i}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{c as l}from"../chunks/vec3f64.js";import m from"./Extent.js";import h from"./Geometry.js";import u from"./Point.js";import f from"./Polygon.js";import{composeAxes as d,create as g}from"./support/axisAngleDegrees.js";import x from"./support/MeshComponent.js";import y from"./support/MeshGeoreferencedRelativeVertexSpace.js";import v from"./support/MeshGeoreferencedVertexSpace.js";import j from"./support/MeshLocalVertexSpace.js";import w from"./support/MeshTransform.js";import{MeshVertexAttributes as b}from"./support/MeshVertexAttributes.js";import{triangulate as S}from"./support/triangulationUtils.js";import{getProjectedExtent as L,getExtentFromPositions as A}from"./support/meshUtils/bounds.js";import{centerAt as M}from"./support/meshUtils/centerAt.js";import{project as P}from"./support/meshUtils/georeference.js";import{loadExternal as R}from"./support/meshUtils/loadExternal.js";import{Metadata as F}from"./support/meshUtils/Metadata.js";import{offset as E}from"./support/meshUtils/offset.js";import{convertUnitGeometry as U,createUnitSizeBox as C,extractSingleFaceOfBox as _,createUnitSizeSphere as z,createUnitSizeCylinder as G,convertPlaneSizeParameter as O,createUnitSizePlane as T}from"./support/meshUtils/primitives.js";import{rotate as V}from"./support/meshUtils/rotate.js";import{scale as W}from"./support/meshUtils/scale.js";var B;const k="esri.geometry.Mesh",D={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:v,"georeferenced-relative":y,local:j}};let N=B=class extends(r(o.LoadableMixin(n(h)))){constructor(e){super(e),this.components=null,this.vertexSpace=new v,this.transform=null,this.metadata=new F,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new b,this.type="mesh"}initialize(){(0===this.metadata.externalSources.length||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when((()=>{this.handles.add(a((()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map((e=>e.clone()))})),(()=>this._clearSources()),{once:!0,sync:!0}))}))}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):null!=this.metadata.displaySource?.extent}get _transformedExtent(){const{components:e,spatialReference:t,vertexAttributes:r,vertexSpace:o}=this,s=r.position;if(0===s.length||e&&0===e.length)return new m({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:t});if("local"===o.type){const{_untransformedExtent:e,transform:r}=this;return L(e,r,o,t)}if("georeferenced-relative"===o.type){const{transform:e}=this,r=P(t,e,o,s,t);return A(r,t)}return A(s,t)}get _untransformedExtent(){return A(this.vertexAttributes.position,this.spatialReference)}get anchor(){const{vertexSpace:e}=this;if(e.isRelative)return e.getOriginPoint(this.spatialReference);const{center:t,zmin:r}=this._transformedExtent;return new u({x:t.x,y:t.y,z:r,spatialReference:this.spatialReference})}get origin(){const{vertexSpace:e}=this;return e.isRelative?e.getOriginPoint(this.spatialReference):this._transformedExtent.center}get extent(){return this.loaded||null==this.metadata?.displaySource?.extent?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this.loaded?(this.components||(this.components=[]),this.components.push(x.from(e)),this.notifyChange("components")):s.getLogger(this).error("addComponent()","Mesh must be loaded before applying operations")}removeComponent(e){if(this.loaded){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}s.getLogger(this).error("removeComponent()","Provided component is not part of the list of components")}else s.getLogger(this).error("removeComponent()","Mesh must be loaded before applying operations")}rotate(e,t,r,o){return d(e,t,r,H),V(this,H,o),this}offset(e,t,r,o){return this.loaded?(Z[0]=e,Z[1]=t,Z[2]=r,E(this,Z,o),this):(s.getLogger(this).error("offset()","Mesh must be loaded before applying operations"),this)}scale(e,t){return this.loaded?(W(this,e,t),this):(s.getLogger(this).error("scale()","Mesh must be loaded before applying operations"),this)}centerAt(e,t){return this.loaded?(M(this,e,t),this):(s.getLogger(this).error("centerAt()","Mesh must be loaded before applying operations"),this)}load(e){const{metadata:{displaySource:t}}=this;return t&&this.addResolvingPromise(R(this,t,e)),Promise.resolve(this)}addExternalSources(e){this.metadata.externalSources.addMany(e)}updateDisplaySource(e){this.metadata.displaySource=e}clone(){return this.cloneWithVertexSpace(this.vertexSpace.clone())}cloneWithVertexSpace(e){let t=null;if(this.components){const e=new Map,r=new Map;t=this.components.map((t=>t.cloneWithDeduplication(e,r)))}const r={components:t,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes.clone(),vertexSpace:e,transform:this.transform?.clone()??null,metadata:this.metadata.clone()};return new B(r)}cloneShallow(){return new B({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const t=import("./support/meshUtils/exporters/gltf/gltfexport.js"),r=this.load(),o=await Promise.all([t,r]),{toBinaryGLTF:s}=o[0];return s(this,e)}get memoryUsage(){let e=0;if(e+=this.vertexAttributes.memoryUsage,null!=this.components)for(const t of this.components)e+=t.memoryUsage;return e}_clearSources(){this.metadata.clearSources()}static createBox(e,t){if(!(e instanceof u))return s.getLogger(k).error(".createBox()","expected location to be a Point instance"),null;const r=new B(U(C(),e,t));return t&&t.imageFace&&"all"!==t.imageFace?_(r,t.imageFace):r}static createSphere(e,t){return e instanceof u?new B(U(z(t&&t.densificationFactor||0),e,t)):(s.getLogger(k).error(".createSphere()","expected location to be a Point instance"),null)}static createCylinder(e,t){return e instanceof u?new B(U(G(t&&t.densificationFactor||0),e,t)):(s.getLogger(k).error(".createCylinder()","expected location to be a Point instance"),null)}static createPlane(e,t){if(!(e instanceof u))return s.getLogger(k).error(".createPlane()","expected location to be a Point instance"),null;const r=t?.facing??"up",o=O(r,t?.size);return new B(U(T(r),e,{...t,size:o}))}static createFromPolygon(e,t){if(!(e instanceof f))return s.getLogger(k).error(".createFromPolygon()","expected polygon to be a Polygon instance"),null;const r=S(e);return new B({vertexAttributes:new b({position:r.position}),components:[new x({faces:r.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new v})}static async createFromGLTF(e,r,o){if(!(e instanceof u))throw s.getLogger(k).error(".createfromGLTF()","expected location to be a Point instance"),new t("invalid-input","Expected location to be a Point instance");const{loadGLTFMesh:n}=await i(import("./support/meshUtils/loadGLTFMesh.js"),o);return new B(await n(e,r,o))}static async createFromFiles(e,r,o){if(!(e instanceof u)){const e="Expected location to be a Point instance";throw s.getLogger(k).error(".createFromFiles()",e),new t("invalid-input",e)}const n=B.createWithExternalSource(e,r),i=o?.layer;if(!i){const e="A layer is needed to convert the files";throw s.getLogger(k).error(".createFromFiles()",e),new t("invalid-input",e)}const[a]=await i.uploadAssets([n],o);return a}static createWithExternalSource(e,t,r){const o=r?.extent??null,{x:s,y:n,z:i,spatialReference:a}=e,c=r?.transform?.clone()??new w,p=r?.vertexSpace??new j({origin:[s,n,i??0]}),l={source:t,extent:o},m=new F;return m.externalSources.push(l),new B({metadata:m,transform:c,vertexSpace:p,spatialReference:a})}static createIncomplete(e,r){const{x:o,y:s,z:n,spatialReference:i}=e,a=r?.transform?.clone()??new w,c=r?.vertexSpace??new j({origin:[o,s,n??0]}),p=new B({transform:a,vertexSpace:c,spatialReference:i});return p.addResolvingPromise(Promise.reject(new t("mesh-incomplete","Mesh resources are not complete"))),p}};e([c({type:[x],json:{write:!0}})],N.prototype,"components",void 0),e([c({nonNullable:!0,types:D,constructOnly:!0,json:{write:!0}})],N.prototype,"vertexSpace",void 0),e([c({type:w,json:{write:!0}})],N.prototype,"transform",void 0),e([c({constructOnly:!0})],N.prototype,"metadata",void 0),e([c()],N.prototype,"hasExtent",null),e([c()],N.prototype,"_transformedExtent",null),e([c()],N.prototype,"_untransformedExtent",null),e([c()],N.prototype,"anchor",null),e([c()],N.prototype,"origin",null),e([c({readOnly:!0,json:{read:!1}})],N.prototype,"extent",null),e([c({readOnly:!0,json:{read:!1,write:!0,default:!0}})],N.prototype,"hasZ",void 0),e([c({readOnly:!0,json:{read:!1,write:!0,default:!1}})],N.prototype,"hasM",void 0),e([c({type:b,nonNullable:!0,json:{write:!0}})],N.prototype,"vertexAttributes",void 0),N=B=e([p(k)],N);const Z=l(),H=g(),I=N;export{I as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
+ */
5
+ import{f as e}from"../../chunks/mat4.js";import{c as t}from"../../chunks/mat4f64.js";import r from"./MeshGeoreferencedRelativeVertexSpace.js";import{t as o}from"../../chunks/vec32.js";function n(t){const{vertexSpace:n}=t;if(n.isRelative)return t.clone();const{anchor:i}=t,c=i.clone(),a=e(s,[-c.x,-c.y,-c.z]),m=new r({origin:[c.x,c.y,c.z]}),p=t.cloneWithVertexSpace(m),{position:f}=p.vertexAttributes;return p.vertexAttributes.position=o(new Float64Array(f.length),f,a),p.vertexAttributesChanged(),p}const s=t();export{n as toRelativeVertexSpace};
package/interfaces.d.ts CHANGED
@@ -5787,6 +5787,12 @@ declare namespace __esri {
5787
5787
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#scale)
5788
5788
  */
5789
5789
  scale(factor: number, params?: MeshScaleParams): Mesh;
5790
+ /**
5791
+ * Notifies that any cached values that depend on vertex attributes need to be recalculated.
5792
+ *
5793
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributesChanged)
5794
+ */
5795
+ vertexAttributesChanged(): void;
5790
5796
  /**
5791
5797
  * Creates a mesh representing a box.
5792
5798
  *
@@ -20398,7 +20404,7 @@ declare namespace __esri {
20398
20404
  *
20399
20405
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SubtypeGroupLayer.html#sublayers)
20400
20406
  */
20401
- sublayers?: CollectionProperties<SubtypeSublayer>;
20407
+ sublayers?: CollectionProperties<SubtypeSublayerProperties>;
20402
20408
  /**
20403
20409
  * The name of the SubtypeGroupLayer's subtype field.
20404
20410
  *
@@ -27471,7 +27477,16 @@ declare namespace __esri {
27471
27477
  alias: string;
27472
27478
  }
27473
27479
 
27474
- export class SubtypeSublayer extends Identifiable {
27480
+ export interface SubtypeSublayer extends Accessor, Loadable, Identifiable {
27481
+ }
27482
+
27483
+ export class SubtypeSublayer {
27484
+ /**
27485
+ * Describes the layer's supported capabilities.
27486
+ *
27487
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#capabilities)
27488
+ */
27489
+ readonly capabilities: Capabilities;
27475
27490
  /**
27476
27491
  * Determines if the layer is editable.
27477
27492
  *
@@ -27503,13 +27518,13 @@ declare namespace __esri {
27503
27518
  *
27504
27519
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#geometryType)
27505
27520
  */
27506
- geometryType: "point" | "multipoint" | "polyline" | "polygon" | "multipatch" | "mesh";
27521
+ readonly geometryType: "point" | "multipoint" | "polyline" | "polygon" | "multipatch" | "mesh";
27507
27522
  /**
27508
27523
  * The unique ID assigned to the layer.
27509
27524
  *
27510
27525
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#id)
27511
27526
  */
27512
- id: string;
27527
+ readonly id: string;
27513
27528
  /**
27514
27529
  * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html).
27515
27530
  *
@@ -27553,7 +27568,7 @@ declare namespace __esri {
27553
27568
  *
27554
27569
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#objectIdField)
27555
27570
  */
27556
- objectIdField: string;
27571
+ readonly objectIdField: string;
27557
27572
  /**
27558
27573
  * The opacity of the layer.
27559
27574
  *
@@ -27623,13 +27638,18 @@ declare namespace __esri {
27623
27638
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#visible)
27624
27639
  */
27625
27640
  visible: boolean;
27626
- constructor(properties?: any);
27641
+ /**
27642
+ * Represents a sublayer in a [SubtypeGroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SubtypeGroupLayer.html).
27643
+ *
27644
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html)
27645
+ */
27646
+ constructor(properties?: SubtypeSublayerProperties);
27627
27647
  /**
27628
27648
  * Adds an attachment to a feature.
27629
27649
  *
27630
27650
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#addAttachment)
27631
27651
  */
27632
- addAttachment(feature: Graphic, attachment: HTMLFormElement | FormData): Promise<any>;
27652
+ addAttachment(feature: Graphic, attachment: HTMLFormElement | FormData): Promise<FeatureEditResult>;
27633
27653
  /**
27634
27654
  * Creates a popup template for the layer, populated with all the fields of the layer.
27635
27655
  *
@@ -27641,7 +27661,7 @@ declare namespace __esri {
27641
27661
  *
27642
27662
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#deleteAttachments)
27643
27663
  */
27644
- deleteAttachments(feature: Graphic, attachmentIds: number[]): Promise<any>;
27664
+ deleteAttachments(feature: Graphic, attachmentIds: number[]): Promise<FeatureEditResult>;
27645
27665
  /**
27646
27666
  * Returns the [Field](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html) instance for a field name (case-insensitive).
27647
27667
  *
@@ -27665,12 +27685,135 @@ declare namespace __esri {
27665
27685
  *
27666
27686
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#updateAttachment)
27667
27687
  */
27668
- updateAttachment(feature: Graphic, attachmentId: number, attachment: HTMLFormElement | FormData): Promise<any>;
27688
+ updateAttachment(feature: Graphic, attachmentId: number, attachment: HTMLFormElement | FormData): Promise<FeatureEditResult>;
27669
27689
  }
27670
27690
 
27671
27691
  /** @deprecated Import the SubtypeSublayer class instead. */
27672
27692
  export type SubtypeSublayerConstructor = typeof SubtypeSublayer;
27673
27693
 
27694
+ interface SubtypeSublayerProperties extends LoadableProperties {
27695
+ /**
27696
+ * Determines if the layer is editable.
27697
+ *
27698
+ * @default true
27699
+ *
27700
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#editingEnabled)
27701
+ */
27702
+ editingEnabled?: boolean;
27703
+ /**
27704
+ * The [template](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-FormTemplate.html) used in an associated layer's [FeatureForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html).
27705
+ *
27706
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#formTemplate)
27707
+ */
27708
+ formTemplate?: FormTemplateProperties;
27709
+ /**
27710
+ * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html).
27711
+ *
27712
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#labelingInfo)
27713
+ */
27714
+ labelingInfo?: LabelClassProperties[];
27715
+ /**
27716
+ * Indicates whether to display labels for this layer.
27717
+ *
27718
+ * @default true
27719
+ *
27720
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#labelsVisible)
27721
+ */
27722
+ labelsVisible?: boolean;
27723
+ /**
27724
+ * Indicates whether the layer will be included in the legend.
27725
+ *
27726
+ * @default true
27727
+ *
27728
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#legendEnabled)
27729
+ */
27730
+ legendEnabled?: boolean;
27731
+ /**
27732
+ * The maximum scale (most zoomed in) at which the layer is visible in the view.
27733
+ *
27734
+ * @default 0
27735
+ *
27736
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#maxScale)
27737
+ */
27738
+ maxScale?: number;
27739
+ /**
27740
+ * The minimum scale (most zoomed out) at which the layer is visible in the view.
27741
+ *
27742
+ * @default 0
27743
+ *
27744
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#minScale)
27745
+ */
27746
+ minScale?: number;
27747
+ /**
27748
+ * The opacity of the layer.
27749
+ *
27750
+ * @default 1
27751
+ *
27752
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#opacity)
27753
+ */
27754
+ opacity?: number;
27755
+ /**
27756
+ * The [SubtypeGroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SubtypeGroupLayer.html) to which the sublayer belongs.
27757
+ *
27758
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#parent)
27759
+ */
27760
+ parent?: SubtypeGroupLayerProperties;
27761
+ /**
27762
+ * Indicates whether to display popups when features in the layer are clicked.
27763
+ *
27764
+ * @default true
27765
+ *
27766
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#popupEnabled)
27767
+ */
27768
+ popupEnabled?: boolean;
27769
+ /**
27770
+ * The popup template for the layer.
27771
+ *
27772
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#popupTemplate)
27773
+ */
27774
+ popupTemplate?: PopupTemplateProperties;
27775
+ /**
27776
+ * The renderer assigned to the layer.
27777
+ *
27778
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#renderer)
27779
+ */
27780
+ renderer?: RendererProperties;
27781
+ /**
27782
+ * The spatial reference of the layer.
27783
+ *
27784
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#spatialReference)
27785
+ */
27786
+ spatialReference?: SpatialReferenceProperties;
27787
+ /**
27788
+ * The unique identifier representing the [SubtypeSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html) created from the [SubtypeGroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SubtypeGroupLayer.html).
27789
+ *
27790
+ * @default null
27791
+ *
27792
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#subtypeCode)
27793
+ */
27794
+ subtypeCode?: number;
27795
+ /**
27796
+ * An array of feature templates defined in the feature layer.
27797
+ *
27798
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#templates)
27799
+ */
27800
+ templates?: FeatureTemplateProperties[];
27801
+ /**
27802
+ * The title of the layer used to identify it in places such as the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget.
27803
+ *
27804
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#title)
27805
+ */
27806
+ title?: string;
27807
+ /**
27808
+ * Indicates if the layer is visible in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html).
27809
+ *
27810
+ * @default true
27811
+ *
27812
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#visible)
27813
+ */
27814
+ visible?: boolean;
27815
+ }
27816
+
27674
27817
  export interface SubtypeSublayerQueryAttachmentsOptions {
27675
27818
  /**
27676
27819
  * Signal object that can be used to abort the asynchronous task.
@@ -80317,7 +80460,7 @@ declare namespace __esri {
80317
80460
  *
80318
80461
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-support-colorUtils.html#getBackgroundColorTheme)
80319
80462
  */
80320
- getBackgroundColorTheme(view: MapView | SceneView): Promise<string>;
80463
+ getBackgroundColorTheme(view: MapView | SceneView): Promise<"light" | "dark">;
80321
80464
  }
80322
80465
 
80323
80466
  export const colorUtils: colorUtils;
@@ -91834,7 +91977,7 @@ declare namespace __esri {
91834
91977
  *
91835
91978
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#layer)
91836
91979
  */
91837
- layer?: (FeatureLayerProperties & { type: "feature" }) | (SubtypeSublayer & { type: "subtype-sublayer" });
91980
+ layer?: (FeatureLayerProperties & { type: "feature" }) | (SubtypeSublayerProperties & { type: "subtype-sublayer" });
91838
91981
  /**
91839
91982
  * A reference to the associated [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html).
91840
91983
  *
@@ -91857,20 +92000,7 @@ declare namespace __esri {
91857
92000
  viewModel?: FeatureFormViewModelProperties;
91858
92001
  }
91859
92002
 
91860
- export interface EditableInput extends Accessor, InputBase {
91861
- }
91862
-
91863
92003
  export class EditableInput {
91864
- constructor(properties?: EditableInputProperties);
91865
- }
91866
-
91867
- /** @deprecated Import the EditableInput class instead. */
91868
- export type EditableInputConstructor = typeof EditableInput;
91869
-
91870
- interface EditableInputProperties extends InputBaseProperties {
91871
- }
91872
-
91873
- export class FeatureFormEditableInput {
91874
92004
  }
91875
92005
 
91876
92006
  export interface FeatureFormViewModel extends Accessor, Evented {
@@ -91992,7 +92122,7 @@ declare namespace __esri {
91992
92122
  */
91993
92123
  layer?: | (FeatureLayerProperties & { type: "feature" })
91994
92124
  | (SceneLayerProperties & { type: "scene" })
91995
- | (SubtypeSublayer & { type: "subtype-sublayer" });
92125
+ | (SubtypeSublayerProperties & { type: "subtype-sublayer" });
91996
92126
  /**
91997
92127
  * A reference to the associated [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html).
91998
92128
  *
@@ -92276,7 +92406,7 @@ declare namespace __esri {
92276
92406
  visibilityExpression?: string;
92277
92407
  }
92278
92408
 
92279
- export interface FieldInput extends Accessor, FeatureFormEditableInput {
92409
+ export interface FieldInput extends Accessor, EditableInput {
92280
92410
  }
92281
92411
 
92282
92412
  export class FieldInput {
@@ -92384,6 +92514,12 @@ declare namespace __esri {
92384
92514
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldInput.html#required)
92385
92515
  */
92386
92516
  readonly required: boolean;
92517
+ /**
92518
+ * Indicates if the field's value can be submitted without introducing data validation issues.
92519
+ *
92520
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldInput.html#submittable)
92521
+ */
92522
+ readonly submittable: boolean;
92387
92523
  /**
92388
92524
  * The type of input.
92389
92525
  *
@@ -92425,7 +92561,7 @@ declare namespace __esri {
92425
92561
  /** @deprecated Import the FieldInput class instead. */
92426
92562
  export type FieldInputConstructor = typeof FieldInput;
92427
92563
 
92428
- interface FieldInputProperties extends EditableInputProperties {
92564
+ interface FieldInputProperties {
92429
92565
  }
92430
92566
 
92431
92567
  export interface GroupInput extends Accessor, InputBase {
@@ -92530,7 +92666,7 @@ declare namespace __esri {
92530
92666
 
92531
92667
  export const InputFieldGroup: InputFieldGroup;
92532
92668
 
92533
- export interface RelationshipInput extends Accessor, FeatureFormEditableInput {
92669
+ export interface RelationshipInput extends Accessor, EditableInput {
92534
92670
  }
92535
92671
 
92536
92672
  export class RelationshipInput {
@@ -92591,7 +92727,7 @@ declare namespace __esri {
92591
92727
  /** @deprecated Import the RelationshipInput class instead. */
92592
92728
  export type RelationshipInputConstructor = typeof RelationshipInput;
92593
92729
 
92594
- interface RelationshipInputProperties extends EditableInputProperties {
92730
+ interface RelationshipInputProperties {
92595
92731
  }
92596
92732
 
92597
92733
  export interface FeatureFormSubmitEvent {
@@ -94941,7 +95077,7 @@ declare namespace __esri {
94941
95077
  | (FeatureLayerProperties & { type: "feature" })
94942
95078
  | (GeoJSONLayerProperties & { type: "geojson" })
94943
95079
  | (SceneLayerProperties & { type: "scene" })
94944
- | (SubtypeSublayer & { type: "subtype-sublayer" })
95080
+ | (SubtypeSublayerProperties & { type: "subtype-sublayer" })
94945
95081
  | (SubtypeGroupLayerProperties & { type: "subtype-group" })
94946
95082
  )[];
94947
95083
  /**
@@ -95044,7 +95180,7 @@ declare namespace __esri {
95044
95180
  | (FeatureLayerProperties & { type: "feature" })
95045
95181
  | (GeoJSONLayerProperties & { type: "geojson" })
95046
95182
  | (SceneLayerProperties & { type: "scene" })
95047
- | (SubtypeSublayer & { type: "subtype-sublayer" })
95183
+ | (SubtypeSublayerProperties & { type: "subtype-sublayer" })
95048
95184
  | (SubtypeGroupLayerProperties & { type: "subtype-group" })
95049
95185
  )[];
95050
95186
  }
@@ -110130,6 +110266,12 @@ declare namespace __esri {
110130
110266
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UtilityNetworkTrace-UtilityNetworkTraceViewModel.html#state)
110131
110267
  */
110132
110268
  readonly state: "loading" | "ready";
110269
+ /**
110270
+ * Stores the result of completed traces.
110271
+ *
110272
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UtilityNetworkTrace-UtilityNetworkTraceViewModel.html#traceResults)
110273
+ */
110274
+ traceResults: TraceResultExtend[];
110133
110275
  /**
110134
110276
  * Determines the utility network to use.
110135
110277
  *
@@ -110365,6 +110507,12 @@ declare namespace __esri {
110365
110507
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UtilityNetworkTrace-UtilityNetworkTraceViewModel.html#showSelectionAttributes)
110366
110508
  */
110367
110509
  showSelectionAttributes?: boolean;
110510
+ /**
110511
+ * Stores the result of completed traces.
110512
+ *
110513
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UtilityNetworkTrace-UtilityNetworkTraceViewModel.html#traceResults)
110514
+ */
110515
+ traceResults?: TraceResultExtend[];
110368
110516
  /**
110369
110517
  * Determines the utility network to use.
110370
110518
  *
package/kernel.js CHANGED
@@ -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{getInterceptor as t,addQueryParameter as e}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";const a="4.27";let s=a;s="4.27.0-rc.1";const r={async request(e,a){const{default:s}=await import("./request.js"),r=e.options,n=r.responseType;r.signal=a?.signal,r.responseType="native"===n||"native-request-init"===n?"native-request-init":n&&["blob","json","text"].includes(n)&&t(e.url)?.after?n:"array-buffer";const o=await s(e.url,r),i={data:o.data,httpStatus:o.httpStatus,ssl:o.ssl};switch(o.requestOptions?.responseType){case"native-request-init":return delete i.data.signal,i;case"blob":i.data=await i.data.arrayBuffer();break;case"json":i.data=(new TextEncoder).encode(JSON.stringify(i.data)).buffer;break;case"text":i.data=(new TextEncoder).encode(i.data).buffer}return{result:i,transferList:[i.data]}}};let n;function o(t){n=t}function i(t){const a=n?.findCredential(t);return a?.token?e(t,"token",a.token):t}has("host-webworker");export{i as addTokenParameter,s as fullVersion,n as id,o as setId,a as version,r as workerMessages};
5
+ import has from"./core/has.js";import{getInterceptor as t,addQueryParameter as e}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";const a="4.27";let s=a;s="4.27.0-rc.2";const r={async request(e,a){const{default:s}=await import("./request.js"),r=e.options,n=r.responseType;r.signal=a?.signal,r.responseType="native"===n||"native-request-init"===n?"native-request-init":n&&["blob","json","text"].includes(n)&&t(e.url)?.after?n:"array-buffer";const o=await s(e.url,r),i={data:o.data,httpStatus:o.httpStatus,ssl:o.ssl};switch(o.requestOptions?.responseType){case"native-request-init":return delete i.data.signal,i;case"blob":i.data=await i.data.arrayBuffer();break;case"json":i.data=(new TextEncoder).encode(JSON.stringify(i.data)).buffer;break;case"text":i.data=(new TextEncoder).encode(i.data).buffer}return{result:i,transferList:[i.data]}}};let n;function o(t){n=t}function i(t){const a=n?.findCredential(t);return a?.token?e(t,"token",a.token):t}has("host-webworker");export{i as addTokenParameter,s as fullVersion,n as id,o as setId,a as version,r as workerMessages};
@@ -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"../geometry.js";import r from"../request.js";import{clamp as e}from"../core/mathUtils.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.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{reader as l}from"../core/accessorSupport/decorators/reader.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import p from"./Layer.js";import{BlendLayer as n}from"./mixins/BlendLayer.js";import{CustomParametersMixin as a}from"./mixins/CustomParametersMixin.js";import{ScaleRangeLayer as u}from"./mixins/ScaleRangeLayer.js";import{url as c}from"./support/commonProperties.js";import y from"./support/PlaybackInfo.js";import{getVideoLayerCapabilities as m}from"./support/serviceCapabilitiesUtils.js";import d from"./support/TelemetryData.js";import h from"./support/TelemetryDisplay.js";import f from"./support/VideoFrame.js";import g from"./support/VideoQualities.js";import v from"./video/VideoController.js";import j from"../geometry/Polygon.js";import b from"../geometry/Extent.js";let S=class extends(n(u(o(a(p))))){constructor(t){super(t),this.capabilities=null,this.connectionInfo=null,this.controller=new v,this.copyright=null,this.coverage=null,this.currentFrame=null,this.currentTelemetry=null,this.description=null,this.frameCount=null,this.initialExtent=null,this.playbackInfo=null,this.posterUrl=null,this.protocol="hls",this.qualities=null,this.sourceJSON=null,this.spatialReference=null,this.telemetryDisplay=null,this.timeExtent=null,this.title=null,this.type="video",this.url=null}load(t){const r=null!=t?t.signal:null;return this.addResolvingPromise(this._fetchService(r)),Promise.resolve(this)}get buffered(){return this.controller.buffered}readCapabilitiesFromService(t,r){return m(r)}get currentMetadata(){return this.controller.currentMetadata}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get loop(){return this.controller.loop}set loop(t){this.controller.loop=t}get muted(){return this.controller.muted}set muted(t){this.controller.muted=t}get playbackRate(){return this.controller.rate}set playbackRate(t){this.controller.rate=t}get playbackUrl(){return this.connectionInfo&&this.protocol?this.connectionInfo[this.protocol]:null}get sourceUrl(){return this.controller.sourceUrl??""}set sourceUrl(t){this.controller.sourceUrl=t}get state(){return this.controller.state}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){this.controller.reset()}setCurrentTime(t){if(!this.duration)return;const r=e(t,0,this.duration);this.controller.setCurrentTime(r)}getCurrentFrame(){}toGround(){}toVideo(){}async _fetchService(t){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:e,ssl:o}=await r(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters},signal:t});o&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=e,this.read(e,{origin:"service",url:this.parsedUrl})}};t([i({readOnly:!0})],S.prototype,"buffered",null),t([i({readOnly:!0})],S.prototype,"capabilities",void 0),t([l("service","capabilities")],S.prototype,"readCapabilitiesFromService",null),t([i({readOnly:!0,json:{read:{source:"connectionUrl"}}})],S.prototype,"connectionInfo",void 0),t([i()],S.prototype,"controller",void 0),t([i({type:String})],S.prototype,"copyright",void 0),t([i({type:j})],S.prototype,"coverage",void 0),t([i({type:f})],S.prototype,"currentFrame",void 0),t([i({readOnly:!0})],S.prototype,"currentMetadata",null),t([i({type:d})],S.prototype,"currentTelemetry",void 0),t([i({type:Number})],S.prototype,"currentTime",null),t([i({type:String})],S.prototype,"description",void 0),t([i({type:Number})],S.prototype,"duration",null),t([i({type:Boolean})],S.prototype,"ended",null),t([i({type:Number})],S.prototype,"frameCount",void 0),t([i({type:b})],S.prototype,"initialExtent",void 0),t([i({type:Boolean})],S.prototype,"loop",null),t([i({type:Boolean})],S.prototype,"muted",null),t([i({type:y})],S.prototype,"playbackInfo",void 0),t([i({type:Number})],S.prototype,"playbackRate",null),t([i({readOnly:!0})],S.prototype,"playbackUrl",null),t([i({readOnly:!0,json:{read:{source:"poster"}}})],S.prototype,"posterUrl",void 0),t([i({type:String})],S.prototype,"protocol",void 0),t([i({type:g})],S.prototype,"qualities",void 0),t([i()],S.prototype,"sourceJSON",void 0),t([i({type:String})],S.prototype,"sourceUrl",null),t([i()],S.prototype,"spatialReference",void 0),t([i({type:String})],S.prototype,"state",null),t([i({type:h})],S.prototype,"telemetryDisplay",void 0),t([i({readOnly:!0,json:{read:{source:"time"}}})],S.prototype,"timeExtent",void 0),t([i({readOnly:!0,json:{read:{source:"name"}}})],S.prototype,"title",void 0),t([i({readOnly:!0})],S.prototype,"type",void 0),t([i(c)],S.prototype,"url",void 0),t([i({readOnly:!0})],S.prototype,"waiting",null),S=t([s("esri.layers.VideoLayer")],S);const O=S;export{O as default};
5
+ import{_ as t}from"../chunks/tslib.es6.js";import"../geometry.js";import r from"../request.js";import{clamp as e}from"../core/mathUtils.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.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{reader as s}from"../core/accessorSupport/decorators/reader.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import p from"../geometry/SpatialReference.js";import n from"./Layer.js";import{BlendLayer as a}from"./mixins/BlendLayer.js";import{CustomParametersMixin as u}from"./mixins/CustomParametersMixin.js";import{ScaleRangeLayer as c}from"./mixins/ScaleRangeLayer.js";import{url as y}from"./support/commonProperties.js";import m from"./support/PlaybackInfo.js";import{getVideoLayerCapabilities as d}from"./support/serviceCapabilitiesUtils.js";import h from"./support/TelemetryData.js";import f from"./support/TelemetryDisplay.js";import v from"./support/VideoFrame.js";import g from"./video/VideoController.js";import{readVideoTimeExtent as j}from"./video/videoUtils.js";import b from"../geometry/Polygon.js";import S from"../geometry/Extent.js";let O=class extends(a(c(o(u(n))))){constructor(t){super(t),this.capabilities=null,this.connectionInfo=null,this.controller=new g,this.copyright=null,this.coverage=null,this.currentFrame=null,this.currentTelemetry=null,this.description=null,this.frameCount=null,this.initialExtent=null,this.playbackInfo=null,this.posterUrl=null,this.protocol="hls",this.qualities=null,this.sourceJSON=null,this.spatialReference=p.WGS84,this.telemetryDisplay=null,this.videoTimeExtent=null,this.title=null,this.type="video",this.url=null}load(t){const r=null!=t?t.signal:null;return this.addResolvingPromise(this._fetchService(r)),Promise.resolve(this)}get buffered(){return this.controller.buffered}readCapabilitiesFromService(t,r){return d(r)}get currentMetadata(){return this.controller?.currentMetadata}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get loop(){return this.controller.loop}set loop(t){this.controller.loop=t}get muted(){return this.controller.muted}set muted(t){this.controller.muted=t}get playbackRate(){return this.controller.rate}set playbackRate(t){this.controller.rate=t}get playbackUrl(){return this.connectionInfo&&this.protocol?this.connectionInfo[this.protocol]:null}get sourceUrl(){return this.controller.sourceUrl??""}set sourceUrl(t){this.controller.sourceUrl=t}get state(){return this.controller.state}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){this.controller.reset()}setCurrentTime(t){if(!this.duration)return;const r=e(t,0,this.duration);this.controller.setCurrentTime(r)}getCurrentFrame(){}toGround(){}toVideo(){}async _fetchService(t){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:e,ssl:o}=await r(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters},signal:t});o&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=e,this.read(e,{origin:"service",url:this.parsedUrl})}};t([i({readOnly:!0})],O.prototype,"buffered",null),t([i({readOnly:!0,json:{read:!1}})],O.prototype,"capabilities",void 0),t([s("service","capabilities",["supportsCoverageQuery","supportsExportClip","supportsMensuration"])],O.prototype,"readCapabilitiesFromService",null),t([i({readOnly:!0,json:{read:{source:"connectionUrl"}}})],O.prototype,"connectionInfo",void 0),t([i()],O.prototype,"controller",void 0),t([i({type:String})],O.prototype,"copyright",void 0),t([i({type:b})],O.prototype,"coverage",void 0),t([i({type:v})],O.prototype,"currentFrame",void 0),t([i({readOnly:!0})],O.prototype,"currentMetadata",null),t([i({type:h})],O.prototype,"currentTelemetry",void 0),t([i({type:Number})],O.prototype,"currentTime",null),t([i({type:String})],O.prototype,"description",void 0),t([i({type:Number})],O.prototype,"duration",null),t([i({type:Boolean})],O.prototype,"ended",null),t([i({type:Number})],O.prototype,"frameCount",void 0),t([i({type:S})],O.prototype,"initialExtent",void 0),t([i({type:Boolean})],O.prototype,"loop",null),t([i({type:Boolean})],O.prototype,"muted",null),t([i({type:m})],O.prototype,"playbackInfo",void 0),t([i({type:Number})],O.prototype,"playbackRate",null),t([i({readOnly:!0})],O.prototype,"playbackUrl",null),t([i({readOnly:!0,json:{read:{source:"poster"}}})],O.prototype,"posterUrl",void 0),t([i({type:String})],O.prototype,"protocol",void 0),t([i({readOnly:!0})],O.prototype,"qualities",void 0),t([i()],O.prototype,"sourceJSON",void 0),t([i({type:String})],O.prototype,"sourceUrl",null),t([i()],O.prototype,"spatialReference",void 0),t([i({type:String})],O.prototype,"state",null),t([i({type:f})],O.prototype,"telemetryDisplay",void 0),t([i({readOnly:!0,nonNullable:!1,json:{read:{reader:j,source:"time"}}})],O.prototype,"videoTimeExtent",void 0),t([i({readOnly:!0,json:{read:{source:"name"}}})],O.prototype,"title",void 0),t([i({readOnly:!0})],O.prototype,"type",void 0),t([i(y)],O.prototype,"url",void 0),t([i({readOnly:!0})],O.prototype,"waiting",null),O=t([l("esri.layers.VideoLayer")],O);const U=O;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 e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{HandleOwnerMixin as s}from"../../../core/HandleOwner.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{EsriPromiseMixin as i}from"../../../core/Promise.js";import{watch as a}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{StreamFeatureManager as p}from"../data/StreamFeatureManager.js";import{createConnection as h}from"../sources/connections/createConnection.js";import{EventedSet as d}from"../../../views/3d/support/EventedSet.js";import{featureGeometryTypeKebabDictionary as l}from"../../../geometry/support/typeUtils.js";const u=2500;let m=class extends t{getObjectId(){return this.objectId}};e([n({type:Number,json:{read:!0}})],m.prototype,"objectId",void 0),m=e([c("esri.layers.graphics.controllers.StreamGraphic")],m);class y{constructor(e){this.onUpdate=e,this._idToGraphic=new Map}destroy(){this._idToGraphic.clear()}add(e){this._idToGraphic.set(e.objectId,e)}get(e){return this._idToGraphic.get(e)}forEach(e){this._idToGraphic.forEach(e)}removeById(e){const t=this._idToGraphic.get(e);return t?(t.sourceLayer=t.layer=null,this._idToGraphic.delete(e),t):null}update(e,t){this.onUpdate(e,t)}get size(){return this._idToGraphic.size}}let f=class extends(s(i(r))){constructor(){super(...arguments),this.isPaused=!1,this.graphics=new d,this._updateInfo={websocket:0,client:0},this._updateIntervalId=null,this._outSpatialReference=null}initialize(){this.addResolvingPromise(this.layer.when((()=>this._startup())))}destroy(){this.clear()}_clearInterval(){null!==this._updateIntervalId&&(clearInterval(this._updateIntervalId),this._updateIntervalId=null)}clear(){this._clearInterval(),this.connection=o(this.connection),this.store=o(this.store),this.graphics.clear(),this.handles.removeAll()}get updating(){return!this.connection||"connected"===this.connection.connectionStatus}_startup(){const{layer:e,layerView:t}=this,{spatialReference:r,definitionExpression:s,geometryDefinition:o,objectIdField:i,timeInfo:n,purgeOptions:c,maxReconnectionAttempts:d,maxReconnectionInterval:u,customParameters:m}=e,f=e.geometryType?l.toJSON(e.geometryType):null,g=r,I=t.view.spatialReference,_={geometry:o,where:s};this.clear(),this._set("connection",h(e.parsedUrl,g,I,f,_,d,u,m??void 0)),this._outSpatialReference=I.toJSON(),this.store=new y(this._onUpdate.bind(this)),this.featuresManager=new p(this.store,i,n.toJSON(),c);const v="startup-watches";this.handles.remove(v),this.handles.add([e.on("send-message-to-socket",(e=>this.connection.sendMessageToSocket(e))),e.on("send-message-to-client",(e=>this.connection.sendMessageToClient(e))),this.connection.on("data-received",(e=>this._onFeature(e))),this.connection.on("message-received",(e=>this._onWebSocketMessage(e))),a((()=>[e.definitionExpression,e.geometryDefinition,e.purgeOptions]),(()=>this._startup()))],v),this._initUpdateInterval()}_onWebSocketMessage(e){if(this.layerView.emit("message-received",e),"type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this.featuresManager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this.featuresManager.removeByTrackId(t);break;case"clear":this.store.forEach((e=>this.featuresManager.removeById(e.objectId)))}}_onFeature(e){this._updateInfo.websocket++,this.layerView.hasEventListener("data-received")&&this.layerView.emit("data-received",{attributes:e.attributes,centroid:e.centroid,geometry:e.geometry});try{null==e.geometry||e.geometry.spatialReference||(e.geometry.spatialReference=this._outSpatialReference);const t=m.fromJSON(e);t.sourceLayer=t.layer=this.layer,this.featuresManager.add(t)}catch{}}_onUpdate(e,t){null!=t&&this.graphics.removeMany(t),null!=e&&(this._updateInfo.client+=e.length,this.graphics.addMany(e))}_initUpdateInterval(){this._clearInterval();const{updateInterval:e}=this.layer;let t=performance.now();this._updateIntervalId=setInterval((()=>{const e=performance.now(),r=e-t;if(r>u){t=e;const s=Math.round(this._updateInfo.client/(r/1e3)),o=Math.round(this._updateInfo.websocket/(r/1e3));this._updateInfo.client=0,this._updateInfo.websocket=0,this.layerView.emit("update-rate",{client:s,websocket:o})}this.featuresManager.checkForUpdates()}),e)}pauseStream(){this.isPaused=!0,this._clearInterval()}resumeStream(){this.isPaused=!1,this._initUpdateInterval()}};e([n()],f.prototype,"isPaused",void 0),e([n({constructOnly:!0})],f.prototype,"layer",void 0),e([n({constructOnly:!0})],f.prototype,"layerView",void 0),e([n()],f.prototype,"connection",void 0),e([n({readOnly:!0})],f.prototype,"updating",null),f=e([c("esri.layers.graphics.controllers.StreamController")],f);export{f as StreamController,m as StreamGraphic};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{HandleOwnerMixin as s}from"../../../core/HandleOwner.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{EsriPromiseMixin as i}from"../../../core/Promise.js";import{watch as a}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{StreamFeatureManager as p}from"../data/StreamFeatureManager.js";import{createConnection as h}from"../sources/connections/createConnection.js";import{EventedSet as d}from"../../../views/3d/support/EventedSet.js";import{featureGeometryTypeKebabDictionary as l}from"../../../geometry/support/typeUtils.js";const u=2500;let m=class extends t{getObjectId(){return this.objectId}};e([n({type:Number,json:{read:!0}})],m.prototype,"objectId",void 0),m=e([c("esri.layers.graphics.controllers.StreamGraphic")],m);class y{constructor(e){this.onUpdate=e,this._idToGraphic=new Map}destroy(){this._idToGraphic.clear()}add(e){this._idToGraphic.set(e.objectId,e)}get(e){return this._idToGraphic.get(e)}forEach(e){this._idToGraphic.forEach(e)}removeById(e){const t=this._idToGraphic.get(e);return t?(t.sourceLayer=t.layer=null,this._idToGraphic.delete(e),t):null}update(e,t){this.onUpdate(e,t)}get size(){return this._idToGraphic.size}}let f=class extends(s(i(r))){constructor(){super(...arguments),this.isPaused=!1,this.graphics=new d,this._updateInfo={websocket:0,client:0},this._updateIntervalId=null,this._outSpatialReference=null}initialize(){this.addResolvingPromise(this.layer.when((()=>this._startup())))}destroy(){this.clear()}_clearInterval(){null!==this._updateIntervalId&&(clearInterval(this._updateIntervalId),this._updateIntervalId=null)}clear(){this._clearInterval(),this.connection=o(this.connection),this.store=o(this.store),this.graphics.clear(),this.handles.removeAll()}get updating(){return!this.connection||"connected"===this.connection.connectionStatus}_startup(){const{layer:e,layerView:t}=this,{spatialReference:r,definitionExpression:s,geometryDefinition:o,objectIdField:i,timeInfo:n,purgeOptions:c,maxReconnectionAttempts:d,maxReconnectionInterval:u,customParameters:m}=e,f=e.geometryType?l.toJSON(e.geometryType):null,g=r,I=t.view.spatialReference,_={geometry:o,where:s};this.clear(),this._set("connection",h(e.parsedUrl,g,I,f,_,d,u,m??void 0)),this._outSpatialReference=I.toJSON(),this.store=new y(this._onUpdate.bind(this)),this.featuresManager=new p(this.store,i,n.toJSON(),c);const v="startup-watches";this.handles.remove(v),this.handles.add([e.on("send-message-to-socket",(e=>this.connection.sendMessageToSocket(e))),e.on("send-message-to-client",(e=>this.connection.sendMessageToClient(e))),this.connection.on("data-received",(e=>this._onFeature(e))),this.connection.on("message-received",(e=>this._onWebSocketMessage(e))),a((()=>[e.definitionExpression,e.geometryDefinition,e.purgeOptions]),(()=>this._startup()))],v),this.isPaused||this._initUpdateInterval()}_onWebSocketMessage(e){if(this.layerView.emit("message-received",e),"type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this.featuresManager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this.featuresManager.removeByTrackId(t);break;case"clear":this.store.forEach((e=>this.featuresManager.removeById(e.objectId)))}}_onFeature(e){this._updateInfo.websocket++,this.layerView.hasEventListener("data-received")&&this.layerView.emit("data-received",{attributes:e.attributes,centroid:e.centroid,geometry:e.geometry});try{null==e.geometry||e.geometry.spatialReference||(e.geometry.spatialReference=this._outSpatialReference);const t=m.fromJSON(e);t.sourceLayer=t.layer=this.layer,this.featuresManager.add(t)}catch{}}_onUpdate(e,t){null!=t&&this.graphics.removeMany(t),null!=e&&(this._updateInfo.client+=e.length,this.graphics.addMany(e))}_initUpdateInterval(){this._clearInterval();const{updateInterval:e}=this.layer;let t=performance.now();this._updateIntervalId=setInterval((()=>{const e=performance.now(),r=e-t;if(r>u){t=e;const s=Math.round(this._updateInfo.client/(r/1e3)),o=Math.round(this._updateInfo.websocket/(r/1e3));this._updateInfo.client=0,this._updateInfo.websocket=0,this.layerView.emit("update-rate",{client:s,websocket:o})}this.featuresManager.checkForUpdates()}),e)}pauseStream(){this.isPaused=!0,this._clearInterval()}resumeStream(){this.isPaused=!1,this._initUpdateInterval()}};e([n()],f.prototype,"isPaused",void 0),e([n({constructOnly:!0})],f.prototype,"layer",void 0),e([n({constructOnly:!0})],f.prototype,"layerView",void 0),e([n()],f.prototype,"connection",void 0),e([n({readOnly:!0})],f.prototype,"updating",null),f=e([c("esri.layers.graphics.controllers.StreamController")],f);export{f as StreamController,m as StreamGraphic};