@arcgis/core 4.33.0-next.20250423 → 4.33.0-next.20250424

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 (204) hide show
  1. package/Graphic.js +1 -1
  2. package/WebScene.js +1 -1
  3. package/analysis/Analysis.d.ts +4 -0
  4. package/analysis/Analysis.js +1 -1
  5. package/analysis/SliceAnalysis.js +1 -1
  6. package/analysis/SlicePlane.js +1 -1
  7. package/analysis/support/AnalysisOriginWebScene.d.ts +4 -0
  8. package/analysis/support/AnalysisOriginWebScene.js +5 -0
  9. package/analysis/support/SliceAnalysisExcludedLayer.js +5 -0
  10. package/assets/esri/core/workers/RemoteClient.js +1 -1
  11. package/assets/esri/core/workers/chunks/{d4d011eea16a89a5aad9.js → 0219c3f9408d3fa3c9a0.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{4f8782b3b6ad414409e8.js → 0a48b9734ab4c64a6f4f.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{ccc50f28f217e50cc2c3.js → 1427e7953c3d8c87c5e8.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{184d7c8ea818bec5c462.js → 146b3699a9e8b1f2dcc2.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{8ba7d44eff348004f084.js → 1a6d2d090b643a87408a.js} +1 -1
  16. package/assets/esri/core/workers/chunks/1b8cc83aa1179245b2dc.js +1 -0
  17. package/assets/esri/core/workers/chunks/{5e5225623977e61fd0ef.js → 213adc87c843d627c5d6.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{fa8a3c75f9b41d31559b.js → 265f69d153b7b6f07e42.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{769b66cca8347f0f84db.js → 279bbd61b32577693a4a.js} +1 -1
  20. package/assets/esri/core/workers/chunks/290b065b377f9d2ee058.js +1 -0
  21. package/assets/esri/core/workers/chunks/29d3245261a7223124ed.js +1 -0
  22. package/assets/esri/core/workers/chunks/335b539893569e3d7b82.js +1 -0
  23. package/assets/esri/core/workers/chunks/5958af341014e13475d2.js +1 -0
  24. package/assets/esri/core/workers/chunks/60f7cd05e88701f43d3f.js +1 -0
  25. package/assets/esri/core/workers/chunks/{26e0a0a13060cd3e4291.js → 626ba3a7dee952308566.js} +1 -1
  26. package/assets/esri/core/workers/chunks/7cd32b10ed0e18e44ef2.js +1 -0
  27. package/assets/esri/core/workers/chunks/7ffa68d69c138db1295d.js +1 -0
  28. package/assets/esri/core/workers/chunks/91f8547a13f0461045ef.js +1 -0
  29. package/assets/esri/core/workers/chunks/9661ee8569ee208e6237.js +1 -0
  30. package/assets/esri/core/workers/chunks/974742af7beb000c4b4a.js +1 -0
  31. package/assets/esri/core/workers/chunks/{e27fa1e84f16b7f19a90.js → 9850ff14bd9c7da81c65.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{a276980c06d5d311a37e.js → 9f416cc5673665f8c37c.js} +1 -1
  33. package/assets/esri/core/workers/chunks/a0c51c4c30a5f749dfc6.js +1 -0
  34. package/assets/esri/core/workers/chunks/{fdcbd28f38bc485ac5e3.js → ab6ecd8eeec5ff761b34.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{5bdd5ae2d2f23ef6b331.js → c87e2a63b96e0da77dfe.js} +1 -1
  36. package/assets/esri/core/workers/chunks/cc4dd739c4c7e3ccea3f.js +1 -0
  37. package/assets/esri/core/workers/chunks/d3a74087e076a3ae76ca.js +1 -0
  38. package/assets/esri/core/workers/chunks/{26fcbe053194bd78fcc3.js → d8474dca270b25705699.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{7c42281188b874ffcdad.js → db5913824d5e5a2a8365.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{48a1bb1e171dd06a7c6e.js → dd94585508f49863dc15.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{9408a72968cbd985dd24.js → f2cef954b58c6604642c.js} +34 -34
  42. package/chunks/BloomBlur.glsl.js +7 -7
  43. package/chunks/BloomComposition.glsl.js +24 -25
  44. package/chunks/cameraUtilsSpherical.js +1 -1
  45. package/chunks/sphere.js +1 -1
  46. package/core/Collection.js +1 -1
  47. package/core/JSONSupport.js +1 -1
  48. package/core/SetUtils.js +1 -1
  49. package/{views/webgl/GLObjectType.js → core/support/jsonUtils.js} +1 -1
  50. package/core/urlUtils.js +1 -1
  51. package/geometry/Mesh.js +1 -1
  52. package/geometry/support/normalizeUtilsSync.js +1 -1
  53. package/geometry/support/sphere.js +1 -1
  54. package/interfaces.d.ts +344 -111
  55. package/layers/DimensionLayer.js +1 -1
  56. package/layers/RouteLayer.js +1 -1
  57. package/layers/SubtypeGroupLayer.js +1 -1
  58. package/layers/ViewshedLayer.js +1 -1
  59. package/layers/graphics/data/QueryEngine.js +1 -1
  60. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  61. package/layers/orientedImagery/transformations/utils.js +1 -1
  62. package/layers/support/FieldsIndex.js +1 -1
  63. package/layers/support/VideoElement.js +1 -1
  64. package/layers/support/rasterDatasets/FunctionRaster.js +1 -1
  65. package/layers/support/rasterDatasets/TIFFRaster.js +1 -1
  66. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  67. package/layers/support/rasterFormats/{TiffTags.js → tiffTag.js} +1 -1
  68. package/layers/support/rasterFunctions/BandArithmeticFunction.js +1 -1
  69. package/layers/support/rasterFunctions/BaseRasterFunction.js +1 -1
  70. package/layers/support/rasterFunctions/ExtractBandFunction.js +1 -1
  71. package/layers/support/rasterFunctions/NDVIFunction.js +1 -1
  72. package/layers/support/rasterFunctions/RemapFunction.js +1 -1
  73. package/layers/support/rasterFunctions/rasterFunctionHelper.js +1 -1
  74. package/layers/support/videoUtils.js +5 -0
  75. package/package.json +1 -1
  76. package/portal/schemas/definitions.js +1 -1
  77. package/renderers/UniqueValueRenderer.js +1 -1
  78. package/renderers/support/colorRampUtils.js +1 -1
  79. package/support/revision.js +1 -1
  80. package/symbols/IconSymbol3DLayer.js +1 -1
  81. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  82. package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
  83. package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
  84. package/views/2d/engine/webgl/textureUtils.js +1 -1
  85. package/views/2d/layers/MediaLayerView2D.js +1 -1
  86. package/views/2d/layers/TileLayerView2D.js +1 -1
  87. package/views/2d/layers/support/DebugOverlay.js +1 -1
  88. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  89. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  90. package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
  91. package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
  92. package/views/3d/analysis/Viewshed/ViewshedAnalysisVisualization.js +1 -1
  93. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  94. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  95. package/views/3d/camera/constraintUtils/distance.js +1 -1
  96. package/views/3d/camera/intersectionUtils.js +1 -1
  97. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  98. package/views/3d/environment/atmosphereUtils.js +1 -1
  99. package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
  100. package/views/3d/interactive/visualElements/EngineVisualElement.js +1 -1
  101. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  102. package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
  103. package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
  104. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  105. package/views/3d/interactive/visualElements/MarkerVisualElement.js +1 -1
  106. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  107. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  108. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  109. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  110. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  111. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  112. package/views/3d/interactive/visualElements/SlicePlaneVisualElement.js +1 -1
  113. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  114. package/views/3d/interactive/visualElements/ViewshedShapeVisualElement.js +1 -1
  115. package/views/3d/interactive/visualElements/VisualElement.js +1 -1
  116. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  117. package/views/3d/layers/I3SMeshView3D.js +1 -1
  118. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  119. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  120. package/views/3d/state/ConstraintsManager.js +1 -1
  121. package/views/3d/state/NearFarHeuristic.js +1 -1
  122. package/views/3d/state/ViewState.js +1 -1
  123. package/views/3d/state/ViewStateManager.js +1 -1
  124. package/views/3d/state/utils/navigationUtils.js +1 -1
  125. package/views/3d/support/cameraUtilsSpherical.js +1 -1
  126. package/views/3d/support/geometryUtils/sphere.js +1 -1
  127. package/views/3d/terrain/OverlayRenderTargets.js +1 -1
  128. package/views/3d/webgl/ManagedDepthTexture.js +1 -1
  129. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  130. package/views/3d/webgl-engine/core/FBOCacheFormats.js +5 -0
  131. package/views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js +12 -14
  132. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +1 -1
  133. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  134. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  135. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  136. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  137. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  138. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  139. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  140. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  141. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  142. package/views/3d/webgl-engine/lib/DepthRange.js +1 -1
  143. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  144. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  145. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  146. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  147. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  148. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  149. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  150. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  151. package/views/SceneView.js +1 -1
  152. package/views/VideoView.js +1 -1
  153. package/views/webgl/FBOAttachmentType.js +5 -0
  154. package/views/webgl/FramebufferObject.js +1 -1
  155. package/views/webgl/Renderbuffer.js +1 -1
  156. package/views/webgl/RenderbufferDescriptor.js +1 -1
  157. package/views/webgl/Texture.js +1 -1
  158. package/views/webgl/TextureDescriptor.js +1 -1
  159. package/views/webgl/textureUtils.js +1 -1
  160. package/webscene/InitialViewProperties.js +1 -1
  161. package/webscene/Presentation.js +1 -1
  162. package/webscene/Slide.js +1 -1
  163. package/webscene/SlideLegendInfo.js +1 -1
  164. package/webscene/background/ColorBackground.js +1 -1
  165. package/webscene/spec-certification/api.js +1 -1
  166. package/webscene/spec-certification/compare.js +1 -1
  167. package/webscene/spec-certification/index.js +1 -1
  168. package/webscene/spec-certification/spec.js +1 -1
  169. package/webscene/spec-certification/utils.js +1 -1
  170. package/webscene/support/Description.js +1 -1
  171. package/webscene/support/SlideElements.js +1 -1
  172. package/webscene/support/SlideEnvironment.js +1 -1
  173. package/webscene/support/SlideGround.js +1 -1
  174. package/webscene/support/SlideVisibleLayer.js +1 -1
  175. package/webscene/support/Title.js +1 -1
  176. package/webscene/support/analysisUtils.js +5 -0
  177. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  178. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  179. package/widgets/Editor/EditorViewModel.js +1 -1
  180. package/widgets/Editor/UpdateWorkflow.js +1 -1
  181. package/widgets/Editor/support/SketchController.js +5 -0
  182. package/widgets/Editor/workflowUtils.js +1 -1
  183. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  184. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  185. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  186. package/widgets/FeatureTable.js +1 -1
  187. package/widgets/LayerList/LayerListItem.js +1 -1
  188. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  189. package/widgets/Widget.js +1 -1
  190. package/widgets/support/SelectionList.js +1 -1
  191. package/widgets/support/SnappingControls.js +1 -1
  192. package/assets/esri/core/workers/chunks/244d2196bac5ef279436.js +0 -1
  193. package/assets/esri/core/workers/chunks/32f2e0c88046b39916cc.js +0 -1
  194. package/assets/esri/core/workers/chunks/388a763da712ca71ccf4.js +0 -1
  195. package/assets/esri/core/workers/chunks/5ffc3ca6c6a4d32e1282.js +0 -1
  196. package/assets/esri/core/workers/chunks/642a595353a86f3717e3.js +0 -1
  197. package/assets/esri/core/workers/chunks/93e9dfd1ba8f393c6c47.js +0 -1
  198. package/assets/esri/core/workers/chunks/95379fdd6917c8a84c71.js +0 -1
  199. package/assets/esri/core/workers/chunks/9b21dc4659922cc577cb.js +0 -1
  200. package/assets/esri/core/workers/chunks/a197c86d42cc9ce21924.js +0 -1
  201. package/assets/esri/core/workers/chunks/d81bebbb6fe000200d35.js +0 -1
  202. package/assets/esri/core/workers/chunks/dd8e72d6784a8ebc115d.js +0 -1
  203. package/assets/esri/core/workers/chunks/e9fba86036b8fe700a41.js +0 -1
  204. package/views/webgl/formats.js +0 -5
@@ -2,9 +2,9 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{gauss as e}from"../core/mathUtils.js";import{ScreenSpacePass as r}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{Gamma as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import{FloatPassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as s}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{blurRadiusPresets as l}from"../views/3d/webgl-engine/effects/bloom/BloomPresets.glsl.js";import{NoParameters as a}from"../views/webgl/NoParameters.js";import{ShaderBuilder as n}from"../views/webgl/ShaderBuilder.js";var c;!function(e){e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e[e.COUNT=2]="COUNT"}(c||(c={}));class u extends a{constructor(){super(...arguments),this.blurRadius=l.sunny}}function m(l){const a=new n,u=a.fragment;a.include(r),a.include(o),u.uniforms.add(new i("colorTexture",(e=>e.color)),new t("blurRadius",(e=>e.blurRadius)));let m="";const d=15;for(let e=0;e<d;e++){m+=`locations1D[${e}] = ${(e/(d-1)*2-1).toFixed(3).toString()};`}const f=2;let v="";for(let r=0;r<d;r++){v+=`locations1DWeights[${r}] = ${e(r-Math.floor(d/2),f).toFixed(7).toString()};`}const g=l.bloomStage===c.Horizontal;return u.code.add(s`
6
- float locations1D[${s.int(d)}];
7
- float locations1DWeights[${s.int(d)}];
5
+ import{gauss as e}from"../core/mathUtils.js";import{ScreenSpacePass as r}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{Gamma as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import{FloatPassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as i}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{blurRadiusPresets as l}from"../views/3d/webgl-engine/effects/bloom/BloomPresets.glsl.js";import{NoParameters as a}from"../views/webgl/NoParameters.js";import{ShaderBuilder as n}from"../views/webgl/ShaderBuilder.js";var c;!function(e){e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e[e.COUNT=2]="COUNT"}(c||(c={}));class u extends a{constructor(){super(...arguments),this.blurRadius=l.sunny}}function m(l){const a=new n,u=a.fragment;a.include(r),a.include(o),u.uniforms.add(new s("colorTexture",(e=>e.color)),new t("blurRadius",(e=>e.blurRadius)));let m="";const d=15;for(let e=0;e<d;e++){m+=`locations1D[${e}] = ${(e/(d-1)*2-1).toFixed(3).toString()};`}const f=2;let v="";for(let r=0;r<d;r++){v+=`locations1DWeights[${r}] = ${e(r-Math.floor(d/2),f).toFixed(7).toString()};`}const g=l.bloomStage===c.Horizontal;return u.code.add(i`
6
+ float locations1D[${i.int(d)}];
7
+ float locations1DWeights[${i.int(d)}];
8
8
 
9
9
  vec4 blurUniformSamples(sampler2D toBlur) {
10
10
  vec4 res = vec4(0.0);
@@ -16,15 +16,15 @@ import{gauss as e}from"../core/mathUtils.js";import{ScreenSpacePass as r}from"..
16
16
  ${v}
17
17
  vec2 pixelCenterShift = 0.5 / size;
18
18
 
19
- for(int i=0;i < ${s.int(d)}; i++) {
19
+ for(int i=0;i < ${i.int(d)}; i++) {
20
20
  float uv1D = locations1D[i] + ${g?"pixelCenterShift.x":"pixelCenterShift.y"};
21
21
  vec2 uvOffset = ${g?"vec2(uv1D, 0.0)":"vec2(0.0, uv1D)"};
22
22
 
23
23
  vec2 uvDistorted = uv + uvOffset * blurRadius * aspectCorrection;
24
24
  vec4 sampleColor = texture(toBlur, uvDistorted);
25
- res += sampleColor * locations1DWeights[i];
25
+ res += vec4(linearizeGamma(sampleColor.rgb), sampleColor.a) * locations1DWeights[i];
26
26
  }
27
27
  res.a = clamp(res.a, 0.0, 1.0);
28
- return res;
28
+ return delinearizeGamma(res);
29
29
  }
30
- `).main.add(s`fragColor = blurUniformSamples(colorTexture);`),a}const d=Object.freeze(Object.defineProperty({__proto__:null,BloomBlurPassParameters:u,get BlurDirection(){return c},build:m},Symbol.toStringTag,{value:"Module"}));export{u as B,c as a,d as b,m as c};
30
+ `).main.add(i`fragColor = blurUniformSamples(colorTexture);`),a}const d=Object.freeze(Object.defineProperty({__proto__:null,BloomBlurPassParameters:u,get BlurDirection(){return c},build:m},Symbol.toStringTag,{value:"Module"}));export{u as B,c as a,d as b,m as c};
@@ -2,28 +2,27 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ScreenSpacePass as o}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepth as e}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{Gamma as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import{FloatPassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{FloatsPassUniform as s}from"../views/3d/webgl-engine/core/shaderModules/FloatsPassUniform.js";import{glsl as t}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{IntegerPassUniform as a}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{Texture2DPassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{defaultExposure as d,lodFactorsPresets as i}from"../views/3d/webgl-engine/effects/bloom/BloomPresets.glsl.js";import{ToneMapping as m,ToneMappingFunction as u}from"../views/3d/webgl-engine/shaders/ToneMapping.glsl.js";import{NoParameters as c}from"../views/webgl/NoParameters.js";import{ShaderBuilder as g}from"../views/webgl/ShaderBuilder.js";class b extends c{constructor(o=d,e=i.sunny.far,r=i.sunny.near){super(),this.exposure=o,this.lodFactors=e,this.lodFactorsFront=r}}const f=new b;class p extends b{constructor(){super(...arguments),this.bloomLod=-1}}function w(d){const i=new g,c=i.fragment;i.include(o),i.include(r),c.include(e),c.include(m,d);const b=d.toneMapping;return c.uniforms.add(new n("colorTexture",(o=>o.color)),new n("bloomTexture0",(o=>o.bloomTexture0)),new n("bloomTexture1",(o=>o.bloomTexture1)),new n("bloomTexture2",(o=>o.bloomTexture2)),new n("bloomTexture3",(o=>o.bloomTexture3)),new n("bloomTexture4",(o=>o.bloomTexture4)),new l("exposure",(o=>o.exposure)),new a("bloomLod",(o=>o.bloomLod)),new s("lodFactors",(o=>o.lodFactors),5),new s("lodFactorsFront",(o=>o.lodFactorsFront),5)).main.add(t`
6
- vec4 color = texture(colorTexture, uv);
7
- color = vec4(linearizeGamma(color.rgb), color.a);
8
-
9
- vec4 lod0 = texture(bloomTexture0, uv);
10
- vec4 lod1 = texture(bloomTexture1, uv);
11
- vec4 lod2 = texture(bloomTexture2, uv);
12
- vec4 lod3 = texture(bloomTexture3, uv);
13
- vec4 lod4 = texture(bloomTexture4, uv);
14
-
15
- fragColor = lodFactors[0] * lod0;
16
- fragColor += lodFactors[1] * lod1;
17
- fragColor += lodFactors[2] * lod2;
18
- fragColor += lodFactors[3] * lod3;
19
- fragColor += lodFactors[4] * lod4;
20
-
21
- // only for bloom editor lod debugging
22
- fragColor = bloomLod == 0 ? lodFactors[0] * lod0 : bloomLod == 1 ? lodFactors[1] * lod1 : bloomLod == 2 ? lodFactors[2] * lod2 : bloomLod == 3 ? lodFactors[3] * lod3 : bloomLod == 4 ? lodFactors[4] * lod4 : fragColor;
23
-
24
- // tonemapping is only applied to the emissive part since main color values are not in HDR.
25
- fragColor = vec4(
26
- ${b===u.KronosNeutral?"tonemapKhronosNeutral(fragColor.rgb, exposure)":b===u.ACES?"tonemapACES(fragColor.rgb)":"tonemapSimpleExposure(fragColor.rgb, exposure)"}, fragColor.a);
27
- fragColor += color;
28
- fragColor = delinearizeGamma(fragColor);
29
- `),i}const x=Object.freeze(Object.defineProperty({__proto__:null,BloomCompositionPassParameters:p,build:w,defaultCompositionParameters:f},Symbol.toStringTag,{value:"Module"}));export{p as B,x as a,w as b,f as d};
5
+ import{ScreenSpacePass as o}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepth as e}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{Gamma as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import{FloatPassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{FloatsPassUniform as s}from"../views/3d/webgl-engine/core/shaderModules/FloatsPassUniform.js";import{glsl as t}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{IntegerPassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{Texture2DPassUniform as a}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{defaultExposure as d,lodFactorsPresets as m}from"../views/3d/webgl-engine/effects/bloom/BloomPresets.glsl.js";import{ToneMapping as n}from"../views/3d/webgl-engine/shaders/ToneMapping.glsl.js";import{NoParameters as u}from"../views/webgl/NoParameters.js";import{ShaderBuilder as c}from"../views/webgl/ShaderBuilder.js";class b extends u{constructor(o=d,e=m.sunny.far,r=m.sunny.near){super(),this.exposure=o,this.lodFactors=e,this.lodFactorsFront=r}}const g=new b;class w extends b{constructor(){super(...arguments),this.bloomLod=-1}}function v(d){const m=new c,u=m.fragment;return m.include(o),m.include(r),u.include(e),u.include(n,d),u.uniforms.add(new a("colorTexture",(o=>o.color)),new a("emissionTexture",(o=>o.emission)),new a("bloomTexture0",(o=>o.bloomTexture0)),new a("bloomTexture1",(o=>o.bloomTexture1)),new a("bloomTexture2",(o=>o.bloomTexture2)),new a("bloomTexture3",(o=>o.bloomTexture3)),new a("bloomTexture4",(o=>o.bloomTexture4)),new l("exposure",(o=>o.exposure)),new i("bloomLod",(o=>o.bloomLod)),new s("lodFactors",(o=>o.lodFactors),5),new s("lodFactorsFront",(o=>o.lodFactorsFront),5)).main.add(t`vec4 color = texture(colorTexture, uv);
6
+ color = vec4(linearizeGamma(color.rgb), color.a);
7
+ vec4 lod0 = texture(bloomTexture0, uv);
8
+ lod0 = vec4(linearizeGamma(lod0.rgb), lod0.a);
9
+ vec4 lod1 = texture(bloomTexture1, uv);
10
+ lod1 = vec4(linearizeGamma(lod1.rgb), lod1.a);
11
+ vec4 lod2 = texture(bloomTexture2, uv);
12
+ lod2 = vec4(linearizeGamma(lod2.rgb), lod2.a);
13
+ vec4 lod3 = texture(bloomTexture3, uv);
14
+ lod3 = vec4(linearizeGamma(lod3.rgb), lod3.a);
15
+ vec4 lod4 = texture(bloomTexture4, uv);
16
+ lod4 = vec4(linearizeGamma(lod4.rgb), lod4.a);
17
+ vec4 blur = lodFactors[0] * lod0;
18
+ blur += lodFactors[1] * lod1;
19
+ blur += lodFactors[2] * lod2;
20
+ blur += lodFactors[3] * lod3;
21
+ blur += lodFactors[4] * lod4;
22
+ blur = bloomLod == 0 ? lodFactors[0] * lod0 : bloomLod == 1 ? lodFactors[1] * lod1 : bloomLod == 2 ? lodFactors[2] * lod2 : bloomLod == 3 ? lodFactors[3] * lod3 : bloomLod == 4 ? lodFactors[4] * lod4 : blur;
23
+ vec4 emission = texture(emissionTexture, uv);
24
+ emission = vec4(linearizeGamma(emission.rgb), emission.a);
25
+ emission += blur;
26
+ emission = vec4(tonemapACES(emission.rgb), emission.a);
27
+ fragColor = emission + color;
28
+ fragColor = delinearizeGamma(fragColor);`),m}const x=Object.freeze(Object.defineProperty({__proto__:null,BloomCompositionPassParameters:w,build:v,defaultCompositionParameters:g},Symbol.toStringTag,{value:"Module"}));export{w as B,x as a,v as b,g as d};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{Cyclical as t,cyclical2PI as e}from"../core/Cyclical.js";import{deg2rad as r,rad2deg as s,asinClamped as o,lerp as a,clamp as n}from"../core/mathUtils.js";import{fromRotation as i,rotate as c}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as l}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{n as m,e as p,f as u,t as f,v as h,l as y,h as d,j as g,m as M,y as T,b as R}from"./vec32.js";import{fromValues as j,create as _,ZEROS as E,clone as b}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as I,f as S}from"./vec42.js";import{create as v}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{getEpsilon as A}from"../core/libs/gl-matrix-2/math/common.js";import{getReferenceEllipsoid as x}from"../geometry/ellipsoidUtils.js";import O from"../geometry/Extent.js";import N from"../geometry/Polygon.js";import C from"../geometry/SpatialReference.js";import{isClockwise as U}from"../geometry/support/coordsUtils.js";import{PlaneIndex as F}from"../geometry/support/frustum.js";import{create as w,fromPoints as P}from"../geometry/support/lineSegment.js";import{fromPositionAndNormal as H,create as D,isPointInside as G,intersectLineOrRay as q,IntersectFlags as k,IntersectResult as L,getNormal as B}from"../geometry/support/plane.js";import{wrap as W}from"../geometry/support/ray.js";import{b as z,d as Y,c as J}from"./sphere.js";import{geographicToWebMercator as K}from"../geometry/support/webMercatorUtils.js";import{LineIndex as Q}from"../views/3d/state/Frustum.js";import{viewAngle as V}from"../views/3d/state/utils/viewUtils.js";import{createDirectionUp as X,directionToHeadingTilt as Z,clampLineSegmentToPlane as $}from"../views/3d/support/cameraUtilsInternal.js";import{getLonDeltaForDistance as tt}from"../views/3d/support/earthUtils.js";import{slerp as et}from"../views/3d/support/mathUtils.js";const rt=j(0,0,1),st=m(_(),j(1,1,1)),ot=new t(-180,180),at=l(),nt=_(),it=_();function ct(t,e,s,o=X()){p(nt,t,rt),0===u(nt,nt)&&p(nt,t,st),i(at,-r(e),t),c(at,at,-r(s),nt);const{up:a,direction:n}=o;return p(a,nt,t),m(a,a),f(a,a,at),m(n,t),h(n,n),f(n,n,at),o}function lt(t,e,r,s){const o=nt,a=it;return m(o,t),p(it,o,rt),0===u(it,it)&&p(it,o,st),p(a,it,o),Z(e,r,s,o,a)}function mt(t,e,s,a){const n={eye:_(),up:null,tilt:a,heading:s},i=nt;i[0]=t[0],i[1]=t[2],i[2]=-t[1];const c=e,l=r(s),m=r(a),p=Math.sin(l),u=Math.cos(l),f=Math.sin(m),h=Math.cos(m),g=y(i);let M;if(Math.abs(m)<1e-8)M=c+g;else{const t=g/f,e=o(c/t),r=Math.PI-m-e;M=t*Math.sin(r)}const T=h*c,R=c*c*(f*f),j=u*u*R,E=M-T,b=E*E,I=j*(j+b-i[1]*i[1]);if(I<0)return d(n.eye,i,M/g),n.tilt=0,ut(n,t);const S=Math.sqrt(I),v=i[1]*E,A=j+b;let x;if(x=u>0?-S+v:S+v,Math.abs(A)<1e-8)return g<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=c):d(n.eye,i,M/g),n.tilt=0,pt(n.eye),ut(n,t);n.eye[1]=x/A;const O=p*p*R,N=f*c,C=u*N*n.eye[1],U=n.eye[1]*n.eye[1],F=1-U,w=Math.sqrt(F),P=j*U+O-2*C*w*E+F*b;return Math.abs(P)<1e-8?(d(n.eye,i,M/g),n.tilt=0,pt(n.eye),ut(n,t)):(n.eye[0]=(F*(M*i[0]-T*i[0])-N*w*(i[0]*n.eye[1]*u+i[2]*p))/P,n.eye[2]=(F*(M*i[2]-T*i[2])-N*w*(i[2]*n.eye[1]*u-i[0]*p))/P,d(n.eye,n.eye,M),pt(n.eye),ut(n,t))}function pt(t){const e=t[1];t[1]=-t[2],t[2]=e}function ut(t,e){const r=ct(e,t.heading,t.tilt);return t.up=r.up,t}function ft(t,e,r){const a=y(e),n=Math.sqrt(r*r+a*a-2*r*a*Math.cos(Math.PI-t)),i=o(r/(n/Math.sin(t)));return s(t-i)}function ht(t,e,s){const a=r(t),n=y(e);return o(s/(n/Math.sin(a)))+a}function yt(t,o,a,n,i){let c,l,m,p;const u=o.latitude,f=x(t.spatialReference).radius,h=o.longitude,y=tt(u,a,f)/2;c=h-y,l=h+y;const d=r(u),g=(1+Math.sin(d))/(1-Math.sin(d)),M=(g+1)*Math.tan(n/f/2),T=M*M;function R(t){const r=Math.PI/2;return(t=e.normalize(t,-r))>r&&(t=Math.PI-t),t}if(m=1.5*Math.PI-2*Math.atan(.5*(M+Math.sqrt(4*g+T))),p=m+n/f,m=R(m),p=R(p),p<m){const t=p;p=m,m=t}if(m=Math.max(s(m),-90),p=Math.min(s(p),90),l=ot.monotonic(c,l),l-c>180){const t=(l-c-180)/2;c+=t,l-=t}const j=t.spatialReference&&t.spatialReference.isGeographic?t.spatialReference:C.WGS84;return i?(i.xmin=c,i.ymin=m,i.xmax=l,i.ymax=p,i.spatialReference=j):i=new O(c,m,l,p,j),t.spatialReference&&t.spatialReference.isWebMercator&&K(i,!1,i),i}function dt(t,e){const r=t.frustum,{renderCoordsHelper:s}=t,o=s.getAltitude(e),i=t.spatialReference,c=s.referenceEllipsoid.radius,l=t.state.camera,m=l.eye,p=1+g(m,e)/(c+o),u=Math.sqrt(p*p-1),{minCurvature:f,maxCurvature:h,minSamples:y,maxSamples:d}=jt,R=Rt(t),j=n((u-f)/(h-f),0,1),_=Math.round(a(y,d,j)),v=l.aboveGround,A=r.planes[F.FAR],x=[],O=H(E,_t,D()),C=H(E,Et,D());I(xt,0,0,0,0);const U=t=>{};for(let n=0;n<4;n++){const t=n===Q.NEAR_FAR_BOTTOM_RIGHT&&!v||n===Q.NEAR_FAR_TOP_LEFT&&v?1-R:0,e=n===Q.NEAR_FAR_BOTTOM_RIGHT&&v||n===Q.NEAR_FAR_TOP_LEFT&&!v?R:1,i=r.lines[n],c=r.lines[3===n?0:n+1];for(let r=0;r<_;r++){const l=r/_,p=n===Q.NEAR_FAR_BOTTOM_RIGHT?1-(1-l)**2:n===Q.NEAR_FAR_TOP_LEFT?l**2:l,u=0===r?0:a(t,e,p),f=M(It,i.origin,c.origin,u),h=et(i.direction,c.direction,u,bt);s.intersectManifoldClosestSilhouette(W(f,h),o,St),$(St,m,St,A),x.push(b(St)),0!==x.length&&U(T(x.at(-1),St));const y=(G(O,St)?1:0)|(G(C,St)?2:0);xt[y]=1}}x.length>2&&U(T(x[0],x.at(-1)));const w=gt(S(xt)>1?Mt(Tt(x,O),C):[x],s,i);return new N({rings:w,spatialReference:i})}function gt(t,e,r){const s=2*A();return t.map((t=>{const o=[];let a=!1;for(const n of t)e.fromRenderCoords(n,St,r),Math.abs(n[0])<s&&Math.abs(n[1])<s?(o.push([null,St[1]]),o.push([null,St[1]]),a=!0):o.push([St[0],St[1]]);if(a)for(let e=0;e<o.length;e++){const t=o[e];if(null!=t[0])continue;const r=o[e+1],s=o.at(0===e?-1:e-1);t[0]=s[0],e++;const a=o.at(e===o.length-1?0:e+1);r[0]=a[0]}return o.push(o[0]),U(o)||o.reverse(),o}))}function Mt(t,e){const r=[];for(const s of t)r.push(...Tt(s,e));return r}function Tt(t,e){const r=[],s=[],o=A();for(let n=0;n<t.length;n++){const a=t[n],i=n===t.length-1?t[0]:t[n+1],c=P(a,i,At),l=q(e,c.origin,c.vector,k.NONE,St);switch(l){case L.INSIDE:r.push(a);break;case L.OUTSIDE:s.push(a);break;case L.INTERSECTS_INSIDE_OUT:case L.INTERSECTS_OUTSIDE_IN:{const[t,n,i]=l===L.INTERSECTS_INSIDE_OUT?[1,r,s]:[-1,s,r],c=B(e),m=R(_(),St,c,t*o),p=R(_(),St,c,t*-o);n.push(a),n.push(m),i.push(p)}}}const a=[];return r.length&&a.push(r),s.length&&a.push(s),a}function Rt(t){const{renderCoordsHelper:e,state:{camera:r}}=t,{center:s,eye:o}=r,a=Math.abs(e.getAltitude(s)),n=Math.abs(Math.PI/2-V(e,s,o));return z(vt,e.referenceEllipsoid.radius+a),Y(vt,n,r.distance,r.fovY)}const jt={minCurvature:r(5),maxCurvature:r(50),minSamples:1,maxSamples:6},_t=j(1,0,0),Et=j(0,1,0),bt=_(),It=_(),St=_(),vt=J(),At=w(),xt=v(),Ot=Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:lt,eyeForCenterWithHeadingTilt:mt,eyeTiltToLookAtTilt:ht,headingTiltToDirectionUp:ct,lookAtTiltToEyeTilt:ft,toArea:dt,toExtent:yt},Symbol.toStringTag,{value:"Module"}));export{ht as a,dt as b,Ot as c,lt as d,mt as e,ct as h,ft as l,yt as t};
5
+ import{Cyclical as t,cyclical2PI as e}from"../core/Cyclical.js";import{deg2rad as r,rad2deg as s,asinClamped as o,lerp as a,clamp as n}from"../core/mathUtils.js";import{fromRotation as i,rotate as c}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as l}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{n as m,e as p,f as u,t as f,v as h,l as d,h as y,j as g,m as M,y as T,b as R}from"./vec32.js";import{fromValues as j,create as _,ZEROS as E,clone as b}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as I,f as v}from"./vec42.js";import{create as S}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{getEpsilon as A}from"../core/libs/gl-matrix-2/math/common.js";import{getReferenceEllipsoid as x}from"../geometry/ellipsoidUtils.js";import N from"../geometry/Extent.js";import O from"../geometry/Polygon.js";import w from"../geometry/SpatialReference.js";import{isClockwise as C}from"../geometry/support/coordsUtils.js";import{PlaneIndex as F}from"../geometry/support/frustum.js";import{create as U,fromPoints as P}from"../geometry/support/lineSegment.js";import{fromPositionAndNormal as H,create as D,isPointInside as G,intersectLineOrRay as q,IntersectFlags as k,IntersectResult as L,getNormal as B}from"../geometry/support/plane.js";import{wrap as W}from"../geometry/support/ray.js";import{b as z,d as Y,c as J}from"./sphere.js";import{geographicToWebMercator as K}from"../geometry/support/webMercatorUtils.js";import{Frustum as Q,LineIndex as V}from"../views/3d/state/Frustum.js";import{minNearDistanceInMeters as X}from"../views/3d/state/NearFarHeuristic.js";import{viewAngle as Z}from"../views/3d/state/utils/viewUtils.js";import{createDirectionUp as $,directionToHeadingTilt as tt,clampLineSegmentToPlane as et}from"../views/3d/support/cameraUtilsInternal.js";import{getLonDeltaForDistance as rt}from"../views/3d/support/earthUtils.js";import{slerp as st}from"../views/3d/support/mathUtils.js";const ot=j(0,0,1),at=m(_(),j(1,1,1)),nt=new t(-180,180),it=l(),ct=_(),lt=_();function mt(t,e,s,o=$()){p(ct,t,ot),0===u(ct,ct)&&p(ct,t,at),i(it,-r(e),t),c(it,it,-r(s),ct);const{up:a,direction:n}=o;return p(a,ct,t),m(a,a),f(a,a,it),m(n,t),h(n,n),f(n,n,it),o}function pt(t,e,r,s){const o=ct,a=lt;return m(o,t),p(lt,o,ot),0===u(lt,lt)&&p(lt,o,at),p(a,lt,o),tt(e,r,s,o,a)}function ut(t,e,s,a){const n={eye:_(),up:null,tilt:a,heading:s},i=ct;i[0]=t[0],i[1]=t[2],i[2]=-t[1];const c=e,l=r(s),m=r(a),p=Math.sin(l),u=Math.cos(l),f=Math.sin(m),h=Math.cos(m),g=d(i);let M;if(Math.abs(m)<1e-8)M=c+g;else{const t=g/f,e=o(c/t),r=Math.PI-m-e;M=t*Math.sin(r)}const T=h*c,R=c*c*(f*f),j=u*u*R,E=M-T,b=E*E,I=j*(j+b-i[1]*i[1]);if(I<0)return y(n.eye,i,M/g),n.tilt=0,ht(n,t);const v=Math.sqrt(I),S=i[1]*E,A=j+b;let x;if(x=u>0?-v+S:v+S,Math.abs(A)<1e-8)return g<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=c):y(n.eye,i,M/g),n.tilt=0,ft(n.eye),ht(n,t);n.eye[1]=x/A;const N=p*p*R,O=f*c,w=u*O*n.eye[1],C=n.eye[1]*n.eye[1],F=1-C,U=Math.sqrt(F),P=j*C+N-2*w*U*E+F*b;return Math.abs(P)<1e-8?(y(n.eye,i,M/g),n.tilt=0,ft(n.eye),ht(n,t)):(n.eye[0]=(F*(M*i[0]-T*i[0])-O*U*(i[0]*n.eye[1]*u+i[2]*p))/P,n.eye[2]=(F*(M*i[2]-T*i[2])-O*U*(i[2]*n.eye[1]*u-i[0]*p))/P,y(n.eye,n.eye,M),ft(n.eye),ht(n,t))}function ft(t){const e=t[1];t[1]=-t[2],t[2]=e}function ht(t,e){const r=mt(e,t.heading,t.tilt);return t.up=r.up,t}function dt(t,e,r){const a=d(e),n=Math.sqrt(r*r+a*a-2*r*a*Math.cos(Math.PI-t)),i=o(r/(n/Math.sin(t)));return s(t-i)}function yt(t,e,s){const a=r(t),n=d(e);return o(s/(n/Math.sin(a)))+a}function gt(t,o,a,n,i){let c,l,m,p;const u=o.latitude,f=x(t.spatialReference).radius,h=o.longitude,d=rt(u,a,f)/2;c=h-d,l=h+d;const y=r(u),g=(1+Math.sin(y))/(1-Math.sin(y)),M=(g+1)*Math.tan(n/f/2),T=M*M;function R(t){const r=Math.PI/2;return(t=e.normalize(t,-r))>r&&(t=Math.PI-t),t}if(m=1.5*Math.PI-2*Math.atan(.5*(M+Math.sqrt(4*g+T))),p=m+n/f,m=R(m),p=R(p),p<m){const t=p;p=m,m=t}if(m=Math.max(s(m),-90),p=Math.min(s(p),90),l=nt.monotonic(c,l),l-c>180){const t=(l-c-180)/2;c+=t,l-=t}const j=t.spatialReference&&t.spatialReference.isGeographic?t.spatialReference:w.WGS84;return i?(i.xmin=c,i.ymin=m,i.xmax=l,i.ymax=p,i.spatialReference=j):i=new N(c,m,l,p,j),t.spatialReference&&t.spatialReference.isWebMercator&&K(i,!1,i),i}function Mt(t,e){const{renderCoordsHelper:r}=t,s=t.state.camera.clone(),o=new Q(r);s.near=X,o.update(s);const i=r.getAltitude(e),c=t.spatialReference,l=r.referenceEllipsoid.radius,m=s.eye,p=1+g(m,e)/(l+i),u=Math.sqrt(p*p-1),{minCurvature:f,maxCurvature:h,minSamples:d,maxSamples:y}=Et,R=_t(t),j=n((u-f)/(h-f),0,1),_=Math.round(a(d,y,j)),S=s.aboveGround,A=o.planes[F.FAR],x=[],N=H(E,bt,D()),w=H(E,It,D());I(Ot,0,0,0,0);const C=t=>{};for(let n=0;n<4;n++){const t=n===V.NEAR_FAR_BOTTOM_RIGHT&&!S||n===V.NEAR_FAR_TOP_LEFT&&S?1-R:0,e=n===V.NEAR_FAR_BOTTOM_RIGHT&&S||n===V.NEAR_FAR_TOP_LEFT&&!S?R:1,s=o.lines[n],c=o.lines[3===n?0:n+1];for(let o=0;o<_;o++){const l=o/_,p=n===V.NEAR_FAR_BOTTOM_RIGHT?1-(1-l)**2:n===V.NEAR_FAR_TOP_LEFT?l**2:l,u=0===o?0:a(t,e,p),f=M(St,s.origin,c.origin,u),h=st(s.direction,c.direction,u,vt);r.intersectManifoldClosestSilhouette(W(f,h),i,At),et(At,m,At,A),x.push(b(At)),0!==x.length&&C(T(x.at(-1),At));const d=(G(N,At)?1:0)|(G(w,At)?2:0);Ot[d]=1}}x.length>2&&C(T(x[0],x.at(-1)));const U=Tt(v(Ot)>1?Rt(jt(x,N),w):[x],r,c);return new O({rings:U,spatialReference:c})}function Tt(t,e,r){const s=2*A();return t.map((t=>{const o=[];let a=!1;for(const n of t)e.fromRenderCoords(n,At,r),Math.abs(n[0])<s&&Math.abs(n[1])<s?(o.push([null,At[1]]),o.push([null,At[1]]),a=!0):o.push([At[0],At[1]]);if(a)for(let e=0;e<o.length;e++){const t=o[e];if(null!=t[0])continue;const r=o[e+1],s=o.at(0===e?-1:e-1);t[0]=s[0],e++;const a=o.at(e===o.length-1?0:e+1);r[0]=a[0]}return o.push(o[0]),C(o)||o.reverse(),o}))}function Rt(t,e){const r=[];for(const s of t)r.push(...jt(s,e));return r}function jt(t,e){const r=[],s=[],o=A();for(let n=0;n<t.length;n++){const a=t[n],i=n===t.length-1?t[0]:t[n+1],c=P(a,i,Nt),l=q(e,c.origin,c.vector,k.NONE,At);switch(l){case L.INSIDE:r.push(a);break;case L.OUTSIDE:s.push(a);break;case L.INTERSECTS_INSIDE_OUT:case L.INTERSECTS_OUTSIDE_IN:{const[t,n,i]=l===L.INTERSECTS_INSIDE_OUT?[1,r,s]:[-1,s,r],c=B(e),m=R(_(),At,c,t*o),p=R(_(),At,c,t*-o);n.push(a),n.push(m),i.push(p)}}}const a=[];return r.length&&a.push(r),s.length&&a.push(s),a}function _t(t){const{renderCoordsHelper:e,state:{camera:r}}=t,{center:s,eye:o}=r,a=Math.abs(e.getAltitude(s)),n=Math.abs(Math.PI/2-Z(e,s,o));return z(xt,e.referenceEllipsoid.radius+a),Y(xt,n,r.distance,r.fovY)}const Et={minCurvature:r(5),maxCurvature:r(50),minSamples:1,maxSamples:6},bt=j(1,0,0),It=j(0,1,0),vt=_(),St=_(),At=_(),xt=J(),Nt=U(),Ot=S(),wt=Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:pt,eyeForCenterWithHeadingTilt:ut,eyeTiltToLookAtTilt:yt,headingTiltToDirectionUp:mt,lookAtTiltToEyeTilt:dt,toArea:Mt,toExtent:gt},Symbol.toStringTag,{value:"Module"}));export{yt as a,Mt as b,wt as c,pt as d,ut as e,mt as h,dt as l,gt as t};
package/chunks/sphere.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.33/esri/copyright.txt for details.
4
4
  */
5
- import"../core/has.js";import"../core/Logger.js";import{acosClamped as t}from"../core/mathUtils.js";import{fromRotation as r}from"../core/libs/gl-matrix-2/math/mat4.js";import{g as n,h as s,j as o,l as e,e as i,t as a,d as c,k as u,n as f,i as m,s as l,m as g,b as p}from"./vec32.js";import{create as h}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{e as M,c as j}from"./vec42.js";import{create as d,fromValues as y}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{getEpsilon as b}from"../core/libs/gl-matrix-2/math/common.js";import{Axis as x}from"../geometry/support/Axis.js";import{fromPoints as v,closestPoint as S}from"../geometry/support/ray.js";import{cartesianToSpherical as q}from"../geometry/support/sphereUtils.js";import{angle as A}from"../geometry/support/vector.js";import{sv3d as P,sm4d as R}from"../geometry/support/vectorStacks.js";const C=E();function E(){return d()}const _=M,k=M;function w(t,r){return j(r,t)}function O(t,r){return y(t[0],t[1],t[2],r)}function T(t){return t}function z(t){t[0]=t[1]=t[2]=t[3]=0}function L(t,r){return t[0]=t[1]=t[2]=0,t[3]=r,t}function N(t){return t[3]}function U(t){return t}function V(t,r,n,s){return y(t,r,n,s)}function Z(t,r,n){return t!==n&&(n[0]=t[0],n[1]=t[1],n[2]=t[2]),n[3]=t[3]+r,n}function B(t,r,n){return t!==n&&w(t,n),n}function D(t,r){return r}function F(t,r,n){if(null==r)return!1;if(!Y(t,r,X))return!1;let{t0:s,t1:o}=X;if((s<0||o<s&&o>0)&&(s=o),s<0)return!1;if(n){const{origin:t,direction:o}=r;n[0]=t[0]+o[0]*s,n[1]=t[1]+o[1]*s,n[2]=t[2]+o[2]*s}return!0}function I(t,r,n){const s=v(r,n);if(!Y(t,s,X))return[];const{origin:o,direction:e}=s,{t0:i,t1:a}=X,c=r=>{const n=h();return p(n,o,e,r),$(t,n,n)};return Math.abs(i-a)<b()?[c(i)]:[c(i),c(a)]}const X={t0:0,t1:0};function Y(t,r,n){const{origin:s,direction:o}=r,e=G;e[0]=s[0]-t[0],e[1]=s[1]-t[1],e[2]=s[2]-t[2];const i=o[0]*o[0]+o[1]*o[1]+o[2]*o[2];if(0===i)return!1;const a=2*(o[0]*e[0]+o[1]*e[1]+o[2]*e[2]),c=a*a-4*i*(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]-t[3]*t[3]);if(c<0)return!1;const u=Math.sqrt(c);return n.t0=(-a-u)/(2*i),n.t1=(-a+u)/(2*i),!0}const G=h();function H(t,r){return F(t,r,null)}function J(t,r,i){if(F(t,r,i))return i;const a=K(t,r,P.get());return n(i,r.origin,s(P.get(),r.direction,o(r.origin,a)/e(r.direction))),i}function K(t,n,o){const c=P.get(),u=R.get();i(c,n.origin,n.direction);const f=N(t);i(o,c,n.origin),s(o,o,1/e(o)*f);const m=rt(t,n.origin),l=A(n.origin,o);return r(u,l+m,c),a(o,o,u),o}function Q(t,r,n,s){const o=N(t),e=o*o,i=r+.5*Math.PI,a=n*n+e-2*Math.cos(i)*n*o,c=Math.sqrt(a),u=a-e;if(u<=0)return.5;const f=Math.sqrt(u),m=Math.acos(f/c)-Math.asin(o/(c/Math.sin(i)));return Math.min(1,(m+.5*s)/s)}function W(t,r,n){return F(t,r,n)?n:(S(r,U(t),n),$(t,n,n))}function $(t,r,o){const i=c(P.get(),r,U(t)),a=s(P.get(),i,t[3]/e(i));return n(o,a,U(t))}function tt(t,r){const n=c(P.get(),r,U(t)),s=u(n),o=t[3]*t[3];return Math.sqrt(Math.abs(s-o))}function rt(r,n){const s=c(P.get(),n,U(r)),o=e(s),i=N(r),a=i+Math.abs(i-o);return t(i/a)}const nt=h();function st(t,r,n,s){const o=c(nt,r,U(t));switch(n){case x.X:{const t=q(o,nt)[2];return m(s,-Math.sin(t),Math.cos(t),0)}case x.Y:{const t=q(o,nt),r=t[1],n=t[2],e=Math.sin(r);return m(s,-e*Math.cos(n),-e*Math.sin(n),Math.cos(r))}case x.Z:return f(s,o);default:return}}function ot(t,r){const n=c(ct,r,U(t));return e(n)-t[3]}function et(t,r,o,e){const i=ot(t,r),a=st(t,r,x.Z,ct),c=s(ct,a,o-i);return n(e,r,c)}function it(t,r){const n=l(U(t),r),s=N(t);return n<=s*s}function at(t,r,n=d()){const s=o(U(t),U(r)),e=t[3],i=r[3];return s+i<e?(j(n,t),n):s+e<i?(j(n,r),n):(g(n,U(t),U(r),(s+i-e)/(2*s)),n[3]=(s+e+i)/2,n)}const ct=h(),ut=E(),ft=Object.freeze(Object.defineProperty({__proto__:null,NullSphere:C,altitudeAt:ot,angleToSilhouette:rt,axisAt:st,cameraFrustumCoverage:Q,clear:z,closestPoint:W,closestPointOnSilhouette:K,containsPoint:it,copy:w,create:E,distanceToSilhouette:tt,elevate:Z,equals:k,exactEquals:_,fromCenterAndRadius:O,fromRadius:L,fromValues:V,getCenter:U,getExtent:D,getRadius:N,intersectLine:I,intersectRay:F,intersectRayClosestSilhouette:J,intersectsRay:H,projectPoint:$,setAltitudeAt:et,setExtent:B,tmpSphere:ut,union:at,wrap:T},Symbol.toStringTag,{value:"Module"}));export{W as A,rt as B,st as C,ot as D,et as E,C as N,U as a,L as b,E as c,Q as d,w as e,V as f,N as g,tt as h,H as i,F as j,K as k,O as l,_ as m,I as n,it as o,$ as p,k as q,z as r,ft as s,ut as t,at as u,Z as v,T as w,B as x,D as y,J as z};
5
+ import"../core/has.js";import"../core/Logger.js";import{acosClamped as t}from"../core/mathUtils.js";import{fromRotation as r}from"../core/libs/gl-matrix-2/math/mat4.js";import{g as n,h as s,j as o,l as e,e as i,t as a,d as c,k as u,n as f,i as m,s as l,m as g,b as p}from"./vec32.js";import{create as h}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{e as M,c as j}from"./vec42.js";import{create as d,fromValues as y}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{getEpsilon as b}from"../core/libs/gl-matrix-2/math/common.js";import{Axis as x}from"../geometry/support/Axis.js";import{fromPoints as v,closestPoint as S}from"../geometry/support/ray.js";import{cartesianToSpherical as q}from"../geometry/support/sphereUtils.js";import{angle as A}from"../geometry/support/vector.js";import{sv3d as P,sm4d as R}from"../geometry/support/vectorStacks.js";const C=E();function E(){return d()}const _=M,k=M;function w(t,r){return j(r,t)}function O(t,r){return y(t[0],t[1],t[2],r)}function T(t){return t}function z(t){t[0]=t[1]=t[2]=t[3]=0}function L(t,r){return t[0]=t[1]=t[2]=0,t[3]=r,t}function N(t){return t[3]}function U(t){return t}function V(t,r,n,s){return y(t,r,n,s)}function Z(t,r,n){return t!==n&&(n[0]=t[0],n[1]=t[1],n[2]=t[2]),n[3]=t[3]+r,n}function B(t,r,n){return t!==n&&w(t,n),n}function D(t,r){return r}function F(t,r,n){if(null==r)return!1;if(!Y(t,r,X))return!1;let{t0:s,t1:o}=X;if((s<0||o<s&&o>0)&&(s=o),s<0)return!1;if(n){const{origin:t,direction:o}=r;n[0]=t[0]+o[0]*s,n[1]=t[1]+o[1]*s,n[2]=t[2]+o[2]*s}return!0}function I(t,r,n){const s=v(r,n);if(!Y(t,s,X))return[];const{origin:o,direction:e}=s,{t0:i,t1:a}=X,c=r=>{const n=h();return p(n,o,e,r),$(t,n,n)};return Math.abs(i-a)<b()?[c(i)]:[c(i),c(a)]}const X={t0:0,t1:0};function Y(t,r,n){const{origin:s,direction:o}=r,e=G;e[0]=s[0]-t[0],e[1]=s[1]-t[1],e[2]=s[2]-t[2];const i=o[0]*o[0]+o[1]*o[1]+o[2]*o[2];if(0===i)return!1;const a=2*(o[0]*e[0]+o[1]*e[1]+o[2]*e[2]),c=a*a-4*i*(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]-t[3]*t[3]);if(c<0)return!1;const u=Math.sqrt(c);return n.t0=(-a-u)/(2*i),n.t1=(-a+u)/(2*i),!0}const G=h();function H(t,r){return F(t,r,null)}function J(t,r,i){if(F(t,r,i))return i;const a=K(t,r,P.get());return n(i,r.origin,s(P.get(),r.direction,o(r.origin,a)/e(r.direction))),i}function K(t,n,o){const c=P.get(),u=R.get();i(c,n.origin,n.direction);const f=N(t);i(o,c,n.origin),s(o,o,1/e(o)*f);const m=rt(t,n.origin),l=A(n.origin,o);return r(u,l+m,c),a(o,o,u),o}function Q(t,r,n,s){const o=N(t),e=o*o,i=r+.5*Math.PI,a=n*n+e-2*Math.cos(i)*n*o,c=Math.sqrt(a),u=a-e;if(u<=0)return.5;const f=Math.sqrt(u),m=Math.acos(f/c)-Math.asin(o/(c/Math.sin(i)));return Math.min(1,(m+.5*s)/s)}function W(t,r,n){return F(t,r,n)?n:(S(r,U(t),n),$(t,n,n))}function $(t,r,o){const i=c(P.get(),r,U(t)),a=s(P.get(),i,t[3]/e(i));return n(o,a,U(t))}function tt(t,r){const n=c(P.get(),r,U(t)),s=u(n),o=t[3]*t[3];return Math.sqrt(Math.abs(s-o))}function rt(r,n){const s=c(P.get(),n,U(r)),o=e(s),i=N(r),a=i+Math.abs(i-o);return t(i/a)}const nt=h();function st(t,r,n,s){const o=c(nt,r,U(t));switch(n){case x.X:{const t=q(o,nt)[2];return m(s,-Math.sin(t),Math.cos(t),0)}case x.Y:{const t=q(o,nt),r=t[1],n=t[2],e=Math.sin(r);return m(s,-e*Math.cos(n),-e*Math.sin(n),Math.cos(r))}case x.Z:return f(s,o);default:return}}function ot(t,r){const n=c(ct,r,U(t));return e(n)-t[3]}function et(t,r,o,e){const i=ot(t,r),a=st(t,r,x.Z,ct),c=s(ct,a,o-i);return n(e,r,c)}function it(t,r){const n=l(U(t),r),s=N(t);return n<=s*s}function at(t,r,n=d()){const s=o(U(t),U(r)),e=t[3],i=r[3];return s+i<e?(j(n,t),n):s+e<i?(j(n,r),n):(g(n,U(t),U(r),(s+i-e)/(2*s)),n[3]=(s+e+i)/2,n)}const ct=h(),ut=E(),ft=Object.freeze(Object.defineProperty({__proto__:null,NullSphere:C,altitudeAt:ot,angleToSilhouette:rt,axisAt:st,cameraFrustumCoverage:Q,clear:z,closestPoint:W,closestPointOnSilhouette:K,containsPoint:it,copy:w,create:E,distanceToSilhouette:tt,elevate:Z,equals:k,exactEquals:_,fromCenterAndRadius:O,fromRadius:L,fromValues:V,getCenter:U,getExtent:D,getRadius:N,intersectLine:I,intersectRay:F,intersectRayClosestSilhouette:J,intersectsRay:H,projectPoint:$,setAltitudeAt:et,setExtent:B,tmpSphere:ut,union:at,wrap:T},Symbol.toStringTag,{value:"Module"}));export{W as A,rt as B,st as C,ot as D,et as E,C as N,U as a,L as b,E as c,Q as d,w as e,V as f,N as g,F as h,H as i,tt as j,K as k,O as l,_ as m,I as n,it as o,$ as p,k as q,z as r,ft as s,ut as t,at as u,Z as v,T as w,B as x,D as y,J as z};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"./ArrayPool.js";import s from"./Evented.js";import{makeHandle as i}from"./handleUtils.js";import{clone as r}from"./lang.js";import n from"./ObjectPool.js";import{ObservableChangesType as h}from"./ObservableChangesType.js";import{schedule as o}from"./scheduling.js";import{ensureType as l,ensureOneOfType as a}from"./accessorSupport/ensureType.js";import{trackAccess as c}from"./accessorSupport/tracking.js";import{property as f}from"./accessorSupport/decorators/property.js";import{shared as _}from"./accessorSupport/decorators/shared.js";import{subclass as u}from"./accessorSupport/decorators/subclass.js";import{SimpleObservable as m}from"./accessorSupport/tracking/SimpleObservable.js";var g;class d{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}}class p{constructor(e,t,s,i,r){this.target=e,this.added=t,this.removed=s,this.start=i,this.deleteCount=r}}const b=new n(d,void 0,(e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1}));function v(e){e&&"object"==typeof e&&"destroy"in e&&"function"==typeof e.destroy&&e.destroy()}function y(e){return e?e instanceof R?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function E(e){if(e?.length)return e[0]}function A(e,t,s,i){const r=Math.min(e.length-s,t.length-i);let n=0;for(;n<r&&e[s+n]===t[i+n];)n++;return n}function C(e,t,s,i){t&&t.forEach(((t,r,n)=>{e.push(t),C(e,s.call(i,t,r,n),s,i)}))}const O=new Set,M=new Set,D=new Set,x=new Map;let j=0,R=class extends s.EventedAccessor{static{g=this}static{this.ofType=t=>{if(!t)return g;if(x.has(t))return x.get(t);let s=null;if("function"==typeof t)s=t.prototype.declaredClass;else if(t.base)s=t.base.prototype.declaredClass;else for(const e in t.typeMap){const i=t.typeMap[e].prototype.declaredClass;s?s+=` | ${i}`:s=i}let i=class extends g{};return e([_({Type:t,ensureType:"function"==typeof t?l(t):a(t)})],i.prototype,"itemType",void 0),i=e([u(`esri.core.Collection<${s}>`)],i),x.set(t,i),i}}static isCollection(e){return null!=e&&e instanceof g}constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._updating=!1,this._timer=null,this._observable=new m,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:j++})}normalizeCtorArgs(e){return e?Array.isArray(e)||e instanceof g?{items:e}:e:{}}destroy(){this._removeAllRaw(),this._timer&&this._timer.remove(),this._emitter.destroy(),this._notifications=null}*[Symbol.iterator](){yield*this.items}get items(){return c(this._observable),this._items}set items(e){this._emitBeforeChanges(h.ADD)||(this._splice(0,this.length,y(e)),this._emitAfterChanges(h.ADD))}hasEventListener(e){return!this.destroyed&&("change"===e?this._chgListeners.length>0:this._emitter.hasEventListener(e))}on(e,t){if(this.destroyed)return i();if("change"===e){const e=this._chgListeners,s={removed:!1,callback:t};return e.push(s),this._notifications&&this._notifications.push({listeners:e.slice(),items:this._items.slice(),changes:[]}),i((()=>{s.removed=!0,e.splice(e.indexOf(s),1)}))}return this._emitter.on(e,t)}once(e,t){const s="deref"in t?()=>t.deref():()=>t,i=this.on(e,(e=>{s()?.call(null,e),i.remove()}));return i}add(e,t){if(c(this._observable),this._emitBeforeChanges(h.ADD))return this;const s=this.getNextIndex(t??null);return this._splice(s,0,[e]),this._emitAfterChanges(h.ADD),this}addMany(e,t=this._items.length){if(c(this._observable),!e?.length)return this;if(this._emitBeforeChanges(h.ADD))return this;const s=this.getNextIndex(t);return this._splice(s,0,y(e)),this._emitAfterChanges(h.ADD),this}at(e){if(c(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if(c(this._observable),!this.length||this._emitBeforeChanges(h.REMOVE))return[];const e=this._removeAllRaw();return this._emitAfterChanges(h.REMOVE),e}_removeAllRaw(){return 0===this.length?[]:this._splice(0,this.length)||[]}clone(){return c(this._observable),this._createNewInstance({items:this._items.map(r)})}concat(...e){c(this._observable);const t=e.map(y);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if(c(this._observable),!this.length||this._emitBeforeChanges(h.REMOVE))return;const s=this._splice(0,this.length),i=s.length;for(let r=0;r<i;r++)e.call(t,s[r],r,s);this._emitAfterChanges(h.REMOVE)}destroyAll(){this.drain(v)}destroyMany(e){const t=this.removeMany(e);return t.forEach(v),t}every(e,t){return c(this._observable),this._items.every(e,t)}filter(e,t){c(this._observable);const s=2===arguments.length?this._items.filter(e,t):this._items.filter(e);return this._createNewInstance({items:s})}find(e,t){return c(this._observable),this._items.find(e,t)}findIndex(e,t){return c(this._observable),this._items.findIndex(e,t)}flatten(e,t){c(this._observable);const s=[];return C(s,this,e,t),new g(s)}forEach(e,t){return c(this._observable),this._items.forEach(e,t)}getItemAt(e){return c(this._observable),this._items[e]}getNextIndex(e){c(this._observable);const t=this.length;return(e=e??t)<0?e=0:e>t&&(e=t),e}includes(e,t=0){return c(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return c(this._observable),this._items.indexOf(e,t)}join(e=","){return c(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return c(this._observable),this._items.lastIndexOf(e,t)}map(e,t){c(this._observable);const s=this._items.map(e,t);return new g({items:s})}reorder(e,t=this.length-1){c(this._observable);const s=this.indexOf(e);if(-1!==s){if(t<0?t=0:t>=this.length&&(t=this.length-1),s!==t){if(this._emitBeforeChanges(h.MOVE))return e;this._splice(s,1),this._splice(t,0,[e]),this._emitAfterChanges(h.MOVE)}return e}}pop(){if(c(this._observable),!this.length||this._emitBeforeChanges(h.REMOVE))return;const e=E(this._splice(this.length-1,1));return this._emitAfterChanges(h.REMOVE),e}push(...e){return c(this._observable),this._emitBeforeChanges(h.ADD)||(this._splice(this.length,0,e),this._emitAfterChanges(h.ADD)),this.length}reduce(e,t){c(this._observable);const s=this._items;return 2===arguments.length?s.reduce(e,t):s.reduce(e)}reduceRight(e,t){c(this._observable);const s=this._items;return 2===arguments.length?s.reduceRight(e,t):s.reduceRight(e)}remove(e){return c(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if(c(this._observable),e<0||e>=this.length||this._emitBeforeChanges(h.REMOVE))return;const t=E(this._splice(e,1));return this._emitAfterChanges(h.REMOVE),t}removeMany(e){if(c(this._observable),!e?.length||this._emitBeforeChanges(h.REMOVE))return[];const t=e instanceof g?e.toArray():e,s=this._items,i=[],r=t.length;for(let n=0;n<r;n++){const e=t[n],r=s.indexOf(e);if(r>-1){const e=1+A(t,s,n+1,r+1),h=this._splice(r,e);h&&h.length>0&&i.push.apply(i,h),n+=e-1}}return this._emitAfterChanges(h.REMOVE),i}reverse(){if(c(this._observable),this._emitBeforeChanges(h.MOVE))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(h.MOVE),this}shift(){if(c(this._observable),!this.length||this._emitBeforeChanges(h.REMOVE))return;const e=E(this._splice(0,1));return this._emitAfterChanges(h.REMOVE),e}slice(e=0,t=this.length){return c(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return c(this._observable),this._items.some(e,t)}sort(e){if(c(this._observable),!this.length||this._emitBeforeChanges(h.MOVE)||!this._requiresSort(e))return this;const t=this._splice(0,this.length);return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(h.MOVE),this}_requiresSort(e=(e,t)=>e===t?0:e<t?-1:1){const t=this.length-1;for(let s=0;s<t;s++){if(e(this.items[s],this.items[s+1])>0)return!0}return!1}splice(e,t,...s){c(this._observable);const i=(t?h.REMOVE:0)|(s.length?h.ADD:0);if(this._emitBeforeChanges(i))return[];const r=this._splice(e,t,s)||[];return this._emitAfterChanges(i),r}toArray(){return c(this._observable),this._items.slice()}toJSON(){return c(this._observable),this.toArray()}toLocaleString(){return c(this._observable),this._items.toLocaleString()}toString(){return c(this._observable),this._items.toString()}unshift(...e){return c(this._observable),!e.length||this._emitBeforeChanges(h.ADD)||(this._splice(0,0,e),this._emitAfterChanges(h.ADD)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,s){const i=this._items,r=this.itemType;let n,h;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._updating=!0,this._timer=o((()=>this._dispatchChange()))),e<0&&(e+=this.length),t){if(h=i.splice(e,t),this.hasEventListener("before-remove")){const t=b.acquire();t.target=this,t.cancellable=!0;for(let s=0,r=h.length;s<r;s++)n=h[s],t.reset(n),this.emit("before-remove",t),t.defaultPrevented&&(h.splice(s,1),i.splice(e,0,n),e+=1,s-=1,r-=1);b.release(t)}if(this.length=this._items.length,this.hasEventListener("after-remove")){const e=b.acquire();e.target=this,e.cancellable=!1;const t=h.length;for(let s=0;s<t;s++)e.reset(h[s]),this.emit("after-remove",e);b.release(e)}}if(s?.length){if(r){const e=[];for(const t of s){const s=r.ensureType(t);null==s&&null!=t||e.push(s)}s=e}const t=this.hasEventListener("before-add"),n=this.hasEventListener("after-add"),h=e===this.length;if(t||n){const r=b.acquire();r.target=this,r.cancellable=!0;const o=b.acquire();o.target=this,o.cancellable=!1;for(const l of s)t?(r.reset(l),this.emit("before-add",r),r.defaultPrevented||(h?i.push(l):i.splice(e++,0,l),this._set("length",i.length),n&&(o.reset(l),this.emit("after-add",o)))):(h?i.push(l):i.splice(e++,0,l),this._set("length",i.length),o.reset(l),this.emit("after-add",o));b.release(o),b.release(r)}else{if(h)for(const e of s)i.push(e);else i.splice(e,0,...s);this._set("length",i.length)}}if((s?.length||h?.length)&&this._notifyChangeEvent(s,h),this.hasEventListener("after-splice")){const i=new p(this,s,h,e,t);this.emit("after-splice",i)}return h}_emitBeforeChanges(e){let t=!1;if(this.hasEventListener("before-changes")){const s=b.acquire();s.target=this,s.cancellable=!0,s.type=e,this.emit("before-changes",s),t=s.defaultPrevented,b.release(s)}return t}_emitAfterChanges(e){if(this.hasEventListener("after-changes")){const t=b.acquire();t.target=this,t.cancellable=!1,t.type=e,this.emit("after-changes",t),b.release(t)}this._observable.notify()}_notifyChangeEvent(e,t){this.hasEventListener("change")&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:e,removed:t})}get updating(){return this._updating}_dispatchChange(){if(this._timer&&(this._timer.remove(),this._timer=null),this._updating=!1,!this._notifications)return;const e=this._notifications;this._notifications=null;for(const s of e){const e=s.changes;O.clear(),M.clear(),D.clear();for(const{added:t,removed:s}of e){if(t)if(0===D.size&&0===M.size)for(const e of t)O.add(e);else for(const e of t)M.has(e)?(D.add(e),M.delete(e)):D.has(e)||O.add(e);if(s)if(0===D.size&&0===O.size)for(const e of s)M.add(e);else for(const e of s)O.has(e)?O.delete(e):(D.delete(e),M.add(e))}const i=t.acquire();O.forEach((e=>{i.push(e)}));const r=t.acquire();M.forEach((e=>{r.push(e)}));const n=this._items,h=s.items,o=t.acquire();if(D.forEach((e=>{h.indexOf(e)!==n.indexOf(e)&&o.push(e)})),s.listeners&&(i.length||r.length||o.length)){const e={target:this,added:i,removed:r,moved:o},t=s.listeners.length;for(let i=0;i<t;i++){const t=s.listeners[i];t.removed||t.callback.call(this,e)}}t.release(i),t.release(r),t.release(o)}O.clear(),M.clear(),D.clear()}};e([f()],R.prototype,"_updating",void 0),e([f()],R.prototype,"length",void 0),e([f()],R.prototype,"items",null),e([f({readOnly:!0})],R.prototype,"updating",null),R=g=e([u("esri.core.Collection")],R);const V=R;export{V as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"./ArrayPool.js";import s from"./Evented.js";import{makeHandle as i}from"./handleUtils.js";import{clone as r}from"./lang.js";import n from"./ObjectPool.js";import{ObservableChangesType as h}from"./ObservableChangesType.js";import{schedule as o}from"./scheduling.js";import{ensureType as l,ensureOneOfType as a}from"./accessorSupport/ensureType.js";import{trackAccess as c}from"./accessorSupport/tracking.js";import{property as f}from"./accessorSupport/decorators/property.js";import{shared as _}from"./accessorSupport/decorators/shared.js";import{subclass as m}from"./accessorSupport/decorators/subclass.js";import{SimpleObservable as u}from"./accessorSupport/tracking/SimpleObservable.js";import{isSerializable as g}from"./support/jsonUtils.js";var d;class p{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}}class b{constructor(e,t,s,i,r){this.target=e,this.added=t,this.removed=s,this.start=i,this.deleteCount=r}}const v=new n(p,void 0,(e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1}));function y(e){e&&"object"==typeof e&&"destroy"in e&&"function"==typeof e.destroy&&e.destroy()}function E(e){return e?e instanceof S?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function A(e){if(e?.length)return e[0]}function C(e,t,s,i){const r=Math.min(e.length-s,t.length-i);let n=0;for(;n<r&&e[s+n]===t[i+n];)n++;return n}function O(e,t,s,i){t&&t.forEach(((t,r,n)=>{e.push(t),O(e,s.call(i,t,r,n),s,i)}))}const M=new Set,D=new Set,j=new Set,x=new Map;let R=0,S=class extends s.EventedAccessor{static{d=this}static{this.ofType=t=>{if(!t)return d;if(x.has(t))return x.get(t);let s=null;if("function"==typeof t)s=t.prototype.declaredClass;else if(t.base)s=t.base.prototype.declaredClass;else for(const e in t.typeMap){const i=t.typeMap[e].prototype.declaredClass;s?s+=` | ${i}`:s=i}let i=class extends d{};return e([_({Type:t,ensureType:"function"==typeof t?l(t):a(t)})],i.prototype,"itemType",void 0),i=e([m(`esri.core.Collection<${s}>`)],i),x.set(t,i),i}}static isCollection(e){return null!=e&&e instanceof d}constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._updating=!1,this._timer=null,this._observable=new u,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:R++})}normalizeCtorArgs(e){return e?Array.isArray(e)||e instanceof d?{items:e}:e:{}}destroy(){this._removeAllRaw(),this._timer&&this._timer.remove(),this._emitter.destroy(),this._notifications=null}*[Symbol.iterator](){yield*this.items}get items(){return c(this._observable),this._items}set items(e){this._emitBeforeChanges(h.ADD)||(this._splice(0,this.length,E(e)),this._emitAfterChanges(h.ADD))}hasEventListener(e){return!this.destroyed&&("change"===e?this._chgListeners.length>0:this._emitter.hasEventListener(e))}on(e,t){if(this.destroyed)return i();if("change"===e){const e=this._chgListeners,s={removed:!1,callback:t};return e.push(s),this._notifications&&this._notifications.push({listeners:e.slice(),items:this._items.slice(),changes:[]}),i((()=>{s.removed=!0,e.splice(e.indexOf(s),1)}))}return this._emitter.on(e,t)}once(e,t){const s="deref"in t?()=>t.deref():()=>t,i=this.on(e,(e=>{s()?.call(null,e),i.remove()}));return i}add(e,t){if(c(this._observable),this._emitBeforeChanges(h.ADD))return this;const s=this.getNextIndex(t??null);return this._splice(s,0,[e]),this._emitAfterChanges(h.ADD),this}addMany(e,t=this._items.length){if(c(this._observable),!e?.length)return this;if(this._emitBeforeChanges(h.ADD))return this;const s=this.getNextIndex(t);return this._splice(s,0,E(e)),this._emitAfterChanges(h.ADD),this}at(e){if(c(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if(c(this._observable),!this.length||this._emitBeforeChanges(h.REMOVE))return[];const e=this._removeAllRaw();return this._emitAfterChanges(h.REMOVE),e}_removeAllRaw(){return 0===this.length?[]:this._splice(0,this.length)||[]}clone(){return c(this._observable),this._createNewInstance({items:this._items.map(r)})}concat(...e){c(this._observable);const t=e.map(E);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if(c(this._observable),!this.length||this._emitBeforeChanges(h.REMOVE))return;const s=this._splice(0,this.length),i=s.length;for(let r=0;r<i;r++)e.call(t,s[r],r,s);this._emitAfterChanges(h.REMOVE)}destroyAll(){this.drain(y)}destroyMany(e){const t=this.removeMany(e);return t.forEach(y),t}every(e,t){return c(this._observable),this._items.every(e,t)}filter(e,t){c(this._observable);const s=2===arguments.length?this._items.filter(e,t):this._items.filter(e);return this._createNewInstance({items:s})}find(e,t){return c(this._observable),this._items.find(e,t)}findIndex(e,t){return c(this._observable),this._items.findIndex(e,t)}flatten(e,t){c(this._observable);const s=[];return O(s,this,e,t),new d(s)}forEach(e,t){return c(this._observable),this._items.forEach(e,t)}getItemAt(e){return c(this._observable),this._items[e]}getNextIndex(e){c(this._observable);const t=this.length;return(e=e??t)<0?e=0:e>t&&(e=t),e}includes(e,t=0){return c(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return c(this._observable),this._items.indexOf(e,t)}join(e=","){return c(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return c(this._observable),this._items.lastIndexOf(e,t)}map(e,t){c(this._observable);const s=this._items.map(e,t);return new d({items:s})}reorder(e,t=this.length-1){c(this._observable);const s=this.indexOf(e);if(-1!==s){if(t<0?t=0:t>=this.length&&(t=this.length-1),s!==t){if(this._emitBeforeChanges(h.MOVE))return e;this._splice(s,1),this._splice(t,0,[e]),this._emitAfterChanges(h.MOVE)}return e}}pop(){if(c(this._observable),!this.length||this._emitBeforeChanges(h.REMOVE))return;const e=A(this._splice(this.length-1,1));return this._emitAfterChanges(h.REMOVE),e}push(...e){return c(this._observable),this._emitBeforeChanges(h.ADD)||(this._splice(this.length,0,e),this._emitAfterChanges(h.ADD)),this.length}reduce(e,t){c(this._observable);const s=this._items;return 2===arguments.length?s.reduce(e,t):s.reduce(e)}reduceRight(e,t){c(this._observable);const s=this._items;return 2===arguments.length?s.reduceRight(e,t):s.reduceRight(e)}remove(e){return c(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if(c(this._observable),e<0||e>=this.length||this._emitBeforeChanges(h.REMOVE))return;const t=A(this._splice(e,1));return this._emitAfterChanges(h.REMOVE),t}removeMany(e){if(c(this._observable),!e?.length||this._emitBeforeChanges(h.REMOVE))return[];const t=e instanceof d?e.toArray():e,s=this._items,i=[],r=t.length;for(let n=0;n<r;n++){const e=t[n],r=s.indexOf(e);if(r>-1){const e=1+C(t,s,n+1,r+1),h=this._splice(r,e);h&&h.length>0&&i.push.apply(i,h),n+=e-1}}return this._emitAfterChanges(h.REMOVE),i}reverse(){if(c(this._observable),this._emitBeforeChanges(h.MOVE))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(h.MOVE),this}shift(){if(c(this._observable),!this.length||this._emitBeforeChanges(h.REMOVE))return;const e=A(this._splice(0,1));return this._emitAfterChanges(h.REMOVE),e}slice(e=0,t=this.length){return c(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return c(this._observable),this._items.some(e,t)}sort(e){if(c(this._observable),!this.length||this._emitBeforeChanges(h.MOVE)||!this._requiresSort(e))return this;const t=this._splice(0,this.length);return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(h.MOVE),this}_requiresSort(e=(e,t)=>e===t?0:e<t?-1:1){const t=this.length-1;for(let s=0;s<t;s++){if(e(this.items[s],this.items[s+1])>0)return!0}return!1}splice(e,t,...s){c(this._observable);const i=(t?h.REMOVE:0)|(s.length?h.ADD:0);if(this._emitBeforeChanges(i))return[];const r=this._splice(e,t,s)||[];return this._emitAfterChanges(i),r}toArray(){return c(this._observable),this._items.slice()}toJSON(e){c(this._observable);return this.toArray().map((t=>g(t)?t.toJSON(e):t))}toLocaleString(){return c(this._observable),this._items.toLocaleString()}toString(){return c(this._observable),this._items.toString()}unshift(...e){return c(this._observable),!e.length||this._emitBeforeChanges(h.ADD)||(this._splice(0,0,e),this._emitAfterChanges(h.ADD)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,s){const i=this._items,r=this.itemType;let n,h;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._updating=!0,this._timer=o((()=>this._dispatchChange()))),e<0&&(e+=this.length),t){if(h=i.splice(e,t),this.hasEventListener("before-remove")){const t=v.acquire();t.target=this,t.cancellable=!0;for(let s=0,r=h.length;s<r;s++)n=h[s],t.reset(n),this.emit("before-remove",t),t.defaultPrevented&&(h.splice(s,1),i.splice(e,0,n),e+=1,s-=1,r-=1);v.release(t)}if(this.length=this._items.length,this.hasEventListener("after-remove")){const e=v.acquire();e.target=this,e.cancellable=!1;const t=h.length;for(let s=0;s<t;s++)e.reset(h[s]),this.emit("after-remove",e);v.release(e)}}if(s?.length){if(r){const e=[];for(const t of s){const s=r.ensureType(t);null==s&&null!=t||e.push(s)}s=e}const t=this.hasEventListener("before-add"),n=this.hasEventListener("after-add"),h=e===this.length;if(t||n){const r=v.acquire();r.target=this,r.cancellable=!0;const o=v.acquire();o.target=this,o.cancellable=!1;for(const l of s)t?(r.reset(l),this.emit("before-add",r),r.defaultPrevented||(h?i.push(l):i.splice(e++,0,l),this._set("length",i.length),n&&(o.reset(l),this.emit("after-add",o)))):(h?i.push(l):i.splice(e++,0,l),this._set("length",i.length),o.reset(l),this.emit("after-add",o));v.release(o),v.release(r)}else{if(h)for(const e of s)i.push(e);else i.splice(e,0,...s);this._set("length",i.length)}}if((s?.length||h?.length)&&this._notifyChangeEvent(s,h),this.hasEventListener("after-splice")){const i=new b(this,s,h,e,t);this.emit("after-splice",i)}return h}_emitBeforeChanges(e){let t=!1;if(this.hasEventListener("before-changes")){const s=v.acquire();s.target=this,s.cancellable=!0,s.type=e,this.emit("before-changes",s),t=s.defaultPrevented,v.release(s)}return t}_emitAfterChanges(e){if(this.hasEventListener("after-changes")){const t=v.acquire();t.target=this,t.cancellable=!1,t.type=e,this.emit("after-changes",t),v.release(t)}this._observable.notify()}_notifyChangeEvent(e,t){this.hasEventListener("change")&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:e,removed:t})}get updating(){return this._updating}_dispatchChange(){if(this._timer&&(this._timer.remove(),this._timer=null),this._updating=!1,!this._notifications)return;const e=this._notifications;this._notifications=null;for(const s of e){const e=s.changes;M.clear(),D.clear(),j.clear();for(const{added:t,removed:s}of e){if(t)if(0===j.size&&0===D.size)for(const e of t)M.add(e);else for(const e of t)D.has(e)?(j.add(e),D.delete(e)):j.has(e)||M.add(e);if(s)if(0===j.size&&0===M.size)for(const e of s)D.add(e);else for(const e of s)M.has(e)?M.delete(e):(j.delete(e),D.add(e))}const i=t.acquire();M.forEach((e=>{i.push(e)}));const r=t.acquire();D.forEach((e=>{r.push(e)}));const n=this._items,h=s.items,o=t.acquire();if(j.forEach((e=>{h.indexOf(e)!==n.indexOf(e)&&o.push(e)})),s.listeners&&(i.length||r.length||o.length)){const e={target:this,added:i,removed:r,moved:o},t=s.listeners.length;for(let i=0;i<t;i++){const t=s.listeners[i];t.removed||t.callback.call(this,e)}}t.release(i),t.release(r),t.release(o)}M.clear(),D.clear(),j.clear()}};e([f()],S.prototype,"_updating",void 0),e([f()],S.prototype,"length",void 0),e([f()],S.prototype,"items",null),e([f({readOnly:!0})],S.prototype,"updating",null),S=d=e([m("esri.core.Collection")],S);const V=S;export{V 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.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../chunks/tslib.es6.js";import t from"./Accessor.js";import{DefaultsStore as o}from"./accessorSupport/DefaultsStore.js";import{setupConstructedDefaults as s}from"./accessorSupport/defaultsStoreUtils.js";import{read as e}from"./accessorSupport/read.js";import{getProperties as i}from"./accessorSupport/utils.js";import{write as c}from"./accessorSupport/write.js";import{subclass as p}from"./accessorSupport/decorators/subclass.js";const u=t=>{let u=class extends t{constructor(...r){super(...r);const t=i(this),e=t.store,c=new o;t.store=c,s(t,e,c)}read(r,t){e(this,r,t)}write(r,t){return c(this,r??{},t)}toJSON(r){return this.write({},r)}static fromJSON(r,t){return n.call(this,r,t)}};return u=r([p("esri.core.JSONSupport")],u),u.prototype.toJSON.isDefaultToJSON=!0,u};function n(r,t){if(!r)return null;if(r.declaredClass)throw new Error("JSON object is already hydrated");const o=new this;return o.read(r,t),o}let a=class extends(u(t)){};a=r([p("esri.core.JSONSupport")],a),function(r){function t(r){return r&&"object"==typeof r&&"toJSON"in r&&"function"==typeof r.toJSON}r.JSONSupportMixin=u,r.isSerializable=t}(a||(a={}));const S=a;export{S as default};
5
+ import{_ as r}from"../chunks/tslib.es6.js";import t from"./Accessor.js";import{DefaultsStore as s}from"./accessorSupport/DefaultsStore.js";import{setupConstructedDefaults as o}from"./accessorSupport/defaultsStoreUtils.js";import{read as e}from"./accessorSupport/read.js";import{getProperties as c}from"./accessorSupport/utils.js";import{write as i}from"./accessorSupport/write.js";import{subclass as p}from"./accessorSupport/decorators/subclass.js";const u=t=>{let u=class extends t{constructor(...r){super(...r);const t=c(this),e=t.store,i=new s;t.store=i,o(t,e,i)}read(r,t){e(this,r,t)}write(r,t){return i(this,r??{},t)}toJSON(r){return this.write({},r)}static fromJSON(r,t){return a.call(this,r,t)}};return u=r([p("esri.core.JSONSupport")],u),u.prototype.toJSON.isDefaultToJSON=!0,u};function a(r,t){if(!r)return null;if(r.declaredClass)throw new Error("JSON object is already hydrated");const s=new this;return s.read(r,t),s}let n=class extends(u(t)){};n=r([p("esri.core.JSONSupport")],n),function(r){r.JSONSupportMixin=u}(n||(n={}));const l=n;export{l as default};
package/core/SetUtils.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.33/esri/copyright.txt for details.
4
4
  */
5
- function n(n,r){for(const t of n.values())if(r(t))return!0;return!1}function r(n,r){if(!r)return n;for(const t of r)null!=t&&n.add(t);return n}function t(n,r){return null!=r&&n.add(r),n}function u(n,t){const u=new Set;return r(u,n),r(u,t),u}function o(n,r){const t=new Set;for(const u of r)n.has(u)&&t.add(u);return t}function e(n,r){if(!n||!r)return!1;if(n===r)return!0;for(const t of n)if(!r.has(t))return!1;return!0}function f(n,r){if(null==n&&null==r)return!0;if(null==n||null==r||n.size!==r.size)return!1;for(const t of n)if(!r.has(t))return!1;return!0}function i(n,r){const t=new Set(n);for(const u of r)t.delete(u);return t}function c(n,r){return i(u(n,r),o(n,r))}function l(n){let r;for(r of n);return r}export{r as addMany,t as addMaybe,i as difference,f as equals,o as intersection,e as isSubsetOf,l as last,n as someSet,c as symmetricDifference,u as union};
5
+ function n(n,r){for(const t of n.values())if(r(t))return!0;return!1}function r(n,r){if(!r)return n;for(const t of r)null!=t&&n.add(t);return n}function t(n,r){return null!=r&&n.add(r),n}function u(n,t){const u=new Set;return r(u,n),r(u,t),u}function e(n,r){const t=new Set;for(const u of r)n.has(u)&&t.add(u);return t}function o(n,r){if(!n||!r)return!1;if(n===r)return!0;for(const t of n)if(!r.has(t))return!1;return!0}function f(n,r){if(null==n&&null==r)return!0;if(null==n||null==r||n.size!==r.size)return!1;for(const t of n)if(!r.has(t))return!1;return!0}function i(n,r){const t=new Set(n);for(const u of r)t.delete(u);return t}function c(n,r){return i(u(n,r),e(n,r))}function l(n){return n.values().next().value}function s(n){let r;for(r of n);return r}export{r as addMany,t as addMaybe,i as difference,f as equals,l as first,e as intersection,o as isSubsetOf,s as last,n as someSet,c as symmetricDifference,u as union};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- var e;!function(e){e[e.Texture=0]="Texture",e[e.Renderbuffer=1]="Renderbuffer"}(e||(e={}));export{e as GLObjectType};
5
+ function t(t){return t&&"object"==typeof t&&"toJSON"in t&&"function"==typeof t.toJSON}export{t as isSerializable};
package/core/urlUtils.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.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../config.js";import{isSome as n}from"./arrayUtils.js";import e from"./Error.js";import r from"./JSONSupport.js";import o from"./Logger.js";import{parseKnownArcGISOnlineDomain as i}from"../portal/support/urlUtils.js";import{base64ToArrayBuffer as s,arrayBufferToBase64 as l}from"../support/base64Utils.js";const u=()=>o.getLogger("esri.core.urlUtils"),c=t.request,f="esri/config: esriConfig.request.proxyUrl is not set.",a=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,p=/^\s*http:/i,h=/^\s*https:/i,d=/^\s*file:/i,m=/:\d+$/,y=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),$=new RegExp("^((([^[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^[:]*))(:([0-9]+))?$");class x{constructor(t=""){this.uri=t,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let n=this.uri.match(g);this.scheme=n[2]||(n[1]?"":null),this.authority=n[4]||(n[3]?"":null),this.path=n[5],this.query=n[7]||(n[6]?"":null),this.fragment=n[9]||(n[8]?"":null),null!=this.authority&&(n=this.authority.match($),this.user=n[3]||null,this.password=n[4]||null,this.host=n[6]||n[7],this.port=n[9]||null)}toString(){return this.uri}}const w={},O=new x(t.applicationUrl);let U=O;const R=j();let q=R;const C=()=>U,b=()=>q;function j(){const t=U.path,n=t.slice(0,t.lastIndexOf("/")+1);return`${`${U.scheme}://${U.host}${null!=U.port?`:${U.port}`:""}`}${n}`}const L={setAppUrl:t=>U=t,setAppBaseUrl:t=>q=t,restoreUrls:()=>{U=O,q=R}};function I(t){if(!t)return null;const n={path:null,query:null},e=new x(t),r=t.indexOf("?");return null===e.query?n.path=t:(n.path=t.slice(0,r),n.query=A(e.query)),e.fragment&&(n.hash=e.fragment,null===e.query&&(n.path=n.path.slice(0,n.path.length-(e.fragment.length+1)))),n}function A(t){const n=t.split("&"),e={};for(const r of n){if(!r)continue;const t=r.indexOf("=");let n,o;t<0?(n=decodeURIComponent(r),o=""):(n=decodeURIComponent(r.slice(0,t)),o=decodeURIComponent(r.slice(t+1)));let i=e[n];"string"==typeof i&&(i=e[n]=[i]),Array.isArray(i)?i.push(o):e[n]=o}return e}function v(t,n){return t?n&&"function"==typeof n?Object.keys(t).map((e=>encodeURIComponent(e)+"="+encodeURIComponent(n(e,t[e])))).join("&"):Object.keys(t).map((e=>{const o=t[e];if(null==o)return"";const i=encodeURIComponent(e)+"=",s=n?.[e];return s?i+encodeURIComponent(s(o)):Array.isArray(o)?o.map((t=>r.isSerializable(t)?i+encodeURIComponent(JSON.stringify(t)):i+encodeURIComponent(t))).join("&"):r.isSerializable(o)?i+encodeURIComponent(JSON.stringify(o)):i+encodeURIComponent(o)})).filter((t=>t)).join("&"):""}function S(t=!1){let n,r=c.proxyUrl;if("string"==typeof t){n=dt(t);const e=H(t);e&&(r=e.proxyUrl)}else n=!!t;if(!r)throw u().warn(f),new e("urlUtils:proxy-not-set",f);n&&wt()&&(r=$t(r));return I(r)}function P(t,n=!1){const e=H(t);let r,o;if(e){const t=E(e.proxyUrl);r=t.path,o=t.query?A(t.query):null}else if(n){const n=S(t);r=n.path,o=n.query}if(r){const n=I(t);t=r+"?"+n.path;const e=v({...o,...n.query});e&&(t=`${t}?${e}`)}return t}const k={path:"",query:""};function E(t){const n=t.indexOf("?");return-1!==n?(k.path=t.slice(0,n),k.query=t.slice(n+1)):(k.path=t,k.query=null),k}function B(t){return t=(t=Ot(t=Ct(t=E(t).path),!0)).toLowerCase()}function z(t){const n={proxyUrl:t.proxyUrl,urlPrefix:B(t.urlPrefix)},e=c.proxyRules,r=n.urlPrefix;let o=e.length;for(let i=0;i<e.length;i++){const t=e[i].urlPrefix;if(0===r.indexOf(t)){if(r.length===t.length)return-1;o=i;break}0===t.indexOf(r)&&(o=i+1)}return e.splice(o,0,n),o}function H(t){const n=c.proxyRules,e=B(t);for(let r=0;r<n.length;r++)if(0===e.indexOf(n[r].urlPrefix))return n[r]}function T(t,n){if(!t||!n)return!1;t=N(t),n=N(n);const e=i(t),r=i(n);return null!=e&&null!=r?e.portalHostname===r.portalHostname:null==e&&null==r&&F(t,n,!0)}function W(t,n){if(!t||!n)return!1;t=N(t),n=N(n);const e=i(t),r=i(n);return null!=e&&null!=r&&e.portalHostname===r.portalHostname}function J(t,n){return t=N(t),n=N(n),Ot(t)===Ot(n)}function N(t){const n=(t=K(t)).indexOf("/sharing");return n>0?t.slice(0,n):t.replace(/\/+$/,"")}function D(t,n=c.interceptors){const e=n=>null==n||n instanceof RegExp&&n.test(t)||"string"==typeof n&&t.startsWith(n);if(n)for(const r of n)if(Array.isArray(r.urls)){if(r.urls.some(e))return r}else if(e(r.urls))return r;return null}function F(t,n,e=!1){if(!t||!n)return!1;const r=vt(t),o=vt(n);return!(!e&&r.scheme!==o.scheme)&&(null!=r.host&&null!=o.host&&(r.host.toLowerCase()===o.host.toLowerCase()&&r.port===o.port))}function M(t){if("string"==typeof t){if(!Y(t))return!0;t=vt(t)}if(F(t,U))return!0;const n=c.trustedServers||[];for(let e=0;e<n.length;e++){const r=Q(n[e]);for(let n=0;n<r.length;n++)if(F(t,r[n]))return!0}return!1}function Q(t){return w[t]||(ht(t)||pt(t)?w[t]=[new x(_(t))]:w[t]=[new x(`http://${t}`),new x(`https://${t}`)]),w[t]}function _(t,n=q,e){return pt(t)?e?.preserveProtocolRelative?t:"http"===U.scheme&&U.authority===X(t).slice(2)?`http:${t}`:`https:${t}`:ht(t)?t:V("/"===t[0]?Ut(n):n,t)}function G(t,n=q,e){if(null==t||!Y(t))return t;const r=K(t),o=r.toLowerCase(),i=K(n).toLowerCase().replace(/\/+$/,""),s=e?K(e).toLowerCase().replace(/\/+$/,""):null;if(s&&0!==i.indexOf(s))return t;const l=(t,n,e)=>-1===(e=t.indexOf(n,e))?t.length:e;let u=l(o,"/",o.indexOf("//")+2),c=-1;for(;o.slice(0,u+1)===i.slice(0,u)+"/"&&(c=u+1,u!==o.length);)u=l(o,"/",u+1);if(-1===c)return t;if(s&&c<s.length)return t;t=r.slice(c);const f=i.slice(c-1).replaceAll(/[^/]+/g,"").length;if(f>0)for(let a=0;a<f;a++)t=`../${t}`;else t=`./${t}`;return t}function K(t){return t=It(t=Lt(t=jt(t=_(t=t.trim()))))}function V(...t){const e=t.filter(n);if(!e?.length)return;const r=[];if(Y(e[0])){const t=e[0],n=t.indexOf("//");-1!==n&&(r.push(t.slice(0,n+1)),yt(e[0])&&(r[0]+="/"),e[0]=t.slice(n+2))}else"/"===e[0][0]&&r.push("");const o=e.reduce(((t,n)=>n?t.concat(n.split("/")):t),[]);for(let n=0;n<o.length;n++){const t=o[n];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&n===o.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function X(t,n=!1){if(null==t||Z(t)||tt(t))return null;let e=t.indexOf("://");if(-1===e&&pt(t))e=2;else{if(-1===e)return null;e+=3}const r=t.indexOf("/",e);return-1!==r&&(t=t.slice(0,r)),n&&(t=Ot(t,!0)),t}function Y(t){return pt(t)||ht(t)}function Z(t){return null!=t&&"blob:"===t.slice(0,5)}function tt(t){return null!=t&&"data:"===t.slice(0,5)}function nt(t){const n=ot(t);return n?.isBase64?s(n.data):null}function et(t){return l(t).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}const rt=/^data:(.*?)(;base64)?,(.*)$/;function ot(t){const n=t.match(rt);if(!n)return null;const[,e,r,o]=n;return{mediaType:e,isBase64:!!r,data:o}}function it(t){return t.isBase64?`data:${t.mediaType};base64,${t.data}`:`data:${t.mediaType},${t.data}`}async function st(t){return(await fetch(t)).blob()}function lt(t){const n=nt(t);if(!n)return null;const e=ot(t);return new Blob([n],{type:e.mediaType})}function ut(t,n){ft(t,n)}function ct(t,n){at(t,n)}function ft(t,n){const e=lt(t);return!!e&&at(e,n)}function at(t,n){if(!t)return!1;const e=document.createElement("a");if(!("download"in e))return!1;const r=URL.createObjectURL(t);return e.download=n,e.href=r,e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e),URL.revokeObjectURL(r),!0}function pt(t){return null!=t&&"/"===t[0]&&"/"===t[1]}function ht(t){return null!=t&&a.test(t)}function dt(t){return null!=t&&h.test(t)||"https"===U.scheme&&pt(t)}function mt(t){return null!=t&&p.test(t)||"http"===U.scheme&&pt(t)}function yt(t){return null!=t&&d.test(t)}function gt(t){return pt(t)?`http:${t}`:t.replace(h,"http:")}function $t(t){return pt(t)?`https:${t}`:t.replace(p,"https:")}function xt(){return"http"===U.scheme}function wt(){return"https"===U.scheme}function Ot(t,n=!1){return pt(t)?t.slice(2):(t=t.replace(a,""),n&&t.length>1&&"/"===t[0]&&"/"===t[1]&&(t=t.slice(2)),t)}function Ut(t){const n=t.indexOf("//"),e=t.indexOf("/",n+2);return-1===e?t:t.slice(0,e)}function Rt(t){let n=0;if(Y(t)){const e=t.indexOf("//");-1!==e&&(n=e+2)}const e=t.lastIndexOf("/");return e<n?t:t.slice(0,e+1)}function qt(t,n){if(!t)return"";const e=I(t).path.replace(/\/+$/,""),r=e.slice(e.lastIndexOf("/")+1);if(!n?.length)return r;const o=new RegExp(`\\.(${n.join("|")})$`,"i");return r.replace(o,"")}function Ct(t){return t.endsWith("/")?t:`${t}/`}function bt(t){return t.replace(/\/+$/,"")}function jt(t){if(/^https?:\/\//i.test(t)){const n=E(t);t=(t=n.path.replaceAll(/\/{2,}/g,"/")).replace("/","//"),n.query&&(t+=`?${n.query}`)}return t}function Lt(t){return t.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}function It(t){const n=c.httpsDomains;if(!mt(t))return t;const e=t.indexOf("/",7);let r;if(r=-1===e?t:t.slice(0,e),r=r.toLowerCase().slice(7),m.test(r)){if(!r.endsWith(":80"))return t;r=r.slice(0,-3),t=t.replace(":80","")}return xt()&&r===U.authority&&!y.test(t)||(wt()&&r===U.authority||n&&n.some((t=>r===t||r.endsWith(`.${t}`)))||wt()&&!H(t))&&(t=$t(t)),t}function At(t,n,e){if(!(n&&e&&t&&Y(t)))return t;const r=t.indexOf("//"),o=t.indexOf("/",r+2),i=t.indexOf(":",r+2),s=Math.min(o<0?t.length:o,i<0?t.length:i);if(t.slice(r+2,s).toLowerCase()!==n.toLowerCase())return t;return`${t.slice(0,r+2)}${e}${t.slice(s)}`}function vt(t){return"string"==typeof t?new x(_(t)):(t.scheme||(t.scheme=U.scheme),t)}function St(t){return Jt.test(t)}function Pt(t,n){const e=I(t),r=Object.keys(e.query||{});return r.length>0&&n&&n.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${r.join(", ")}.`),e.path}function kt(t,n,e){const r=I(t),o=r.query||{};return o[n]=String(e),`${r.path}?${v(o)}`}function Et(t,n){if(!n)return t;const e=I(t),r=e.query||{};for(const[i,s]of Object.entries(n))null!=s&&(r[i]=s);const o=v(r);return o?`${e.path}?${o}`:e.path}function Bt(t,n){const{path:e,query:r}=I(t);if(!r)return t;delete r[n];const o=v(r);return o?`${e}?${o}`:e}function zt(t){if(null==t)return null;const n=t.match(Wt);return n?n[2]:null}function Ht(t){if(null==t)return null;const n=t.match(Wt);return n?{path:n[1],extension:n[2]}:{path:t,extension:null}}async function Tt(t){if("string"==typeof t){return ot(t)??{data:t}}return new Promise(((n,e)=>{const r=new FileReader;r.readAsDataURL(t),r.onload=()=>n(ot(r.result)),r.onerror=t=>e(t)}))}const Wt=/([^.]*)\.([^/]*)$/,Jt=/(^data:image\/svg|\.svg$)/i;export{x as Url,P as addProxy,z as addProxyRule,kt as addQueryParameter,Et as addQueryParameters,et as base64UrlEncode,st as blobUrlToBlob,At as changeDomain,ot as dataComponents,nt as dataToArrayBuffer,lt as dataToBlob,ct as downloadBlobAsFile,ut as downloadDataAsFile,Ct as ensureTrailingSlash,b as getAppBaseUrl,C as getAppUrl,qt as getFilename,D as getInterceptor,X as getOrigin,zt as getPathExtension,H as getProxyRule,S as getProxyUrl,ht as hasProtocol,W as hasSameCanonicalArcGISOnlinePortal,T as hasSameCanonicalPortal,F as hasSameOrigin,J as hasSamePortal,Y as isAbsolute,wt as isAppHTTPS,Z as isBlobProtocol,tt as isDataProtocol,dt as isHTTPSProtocol,pt as isProtocolRelative,St as isSVG,M as isTrustedServer,V as join,_ as makeAbsolute,it as makeData,G as makeRelative,K as normalize,v as objectToQuery,Tt as parseData,A as queryToObject,Rt as removeFile,Bt as removeQueryParameter,Pt as removeQueryParameters,bt as removeTrailingSlash,Ht as splitPathExtension,L as test,gt as toHTTP,$t as toHTTPS,w as trustedServersUrlCache,I as urlToObject};
5
+ import t from"../config.js";import{isSome as n}from"./arrayUtils.js";import e from"./Error.js";import r from"./Logger.js";import{isSerializable as o}from"./support/jsonUtils.js";import{parseKnownArcGISOnlineDomain as i}from"../portal/support/urlUtils.js";import{base64ToArrayBuffer as s,arrayBufferToBase64 as u}from"../support/base64Utils.js";const l=()=>r.getLogger("esri.core.urlUtils"),c=t.request,f="esri/config: esriConfig.request.proxyUrl is not set.",a=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,p=/^\s*http:/i,h=/^\s*https:/i,d=/^\s*file:/i,m=/:\d+$/,y=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),$=new RegExp("^((([^[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^[:]*))(:([0-9]+))?$");class x{constructor(t=""){this.uri=t,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let n=this.uri.match(g);this.scheme=n[2]||(n[1]?"":null),this.authority=n[4]||(n[3]?"":null),this.path=n[5],this.query=n[7]||(n[6]?"":null),this.fragment=n[9]||(n[8]?"":null),null!=this.authority&&(n=this.authority.match($),this.user=n[3]||null,this.password=n[4]||null,this.host=n[6]||n[7],this.port=n[9]||null)}toString(){return this.uri}}const w={},U=new x(t.applicationUrl);let O=U;const R=b();let q=R;const C=()=>O,j=()=>q;function b(){const t=O.path,n=t.slice(0,t.lastIndexOf("/")+1);return`${`${O.scheme}://${O.host}${null!=O.port?`:${O.port}`:""}`}${n}`}const L={setAppUrl:t=>O=t,setAppBaseUrl:t=>q=t,restoreUrls:()=>{O=U,q=R}};function I(t){if(!t)return null;const n={path:null,query:null},e=new x(t),r=t.indexOf("?");return null===e.query?n.path=t:(n.path=t.slice(0,r),n.query=A(e.query)),e.fragment&&(n.hash=e.fragment,null===e.query&&(n.path=n.path.slice(0,n.path.length-(e.fragment.length+1)))),n}function A(t){const n=t.split("&"),e={};for(const r of n){if(!r)continue;const t=r.indexOf("=");let n,o;t<0?(n=decodeURIComponent(r),o=""):(n=decodeURIComponent(r.slice(0,t)),o=decodeURIComponent(r.slice(t+1)));let i=e[n];"string"==typeof i&&(i=e[n]=[i]),Array.isArray(i)?i.push(o):e[n]=o}return e}function v(t,n){return t?n&&"function"==typeof n?Object.keys(t).map((e=>encodeURIComponent(e)+"="+encodeURIComponent(n(e,t[e])))).join("&"):Object.keys(t).map((e=>{const r=t[e];if(null==r)return"";const i=encodeURIComponent(e)+"=",s=n?.[e];return s?i+encodeURIComponent(s(r)):Array.isArray(r)?r.map((t=>o(t)?i+encodeURIComponent(JSON.stringify(t)):i+encodeURIComponent(t))).join("&"):o(r)?i+encodeURIComponent(JSON.stringify(r)):i+encodeURIComponent(r)})).filter((t=>t)).join("&"):""}function P(t=!1){let n,r=c.proxyUrl;if("string"==typeof t){n=dt(t);const e=T(t);e&&(r=e.proxyUrl)}else n=!!t;if(!r)throw l().warn(f),new e("urlUtils:proxy-not-set",f);n&&wt()&&(r=$t(r));return I(r)}function k(t,n=!1){const e=T(t);let r,o;if(e){const t=B(e.proxyUrl);r=t.path,o=t.query?A(t.query):null}else if(n){const n=P(t);r=n.path,o=n.query}if(r){const n=I(t);t=r+"?"+n.path;const e=v({...o,...n.query});e&&(t=`${t}?${e}`)}return t}const E={path:"",query:""};function B(t){const n=t.indexOf("?");return-1!==n?(E.path=t.slice(0,n),E.query=t.slice(n+1)):(E.path=t,E.query=null),E}function S(t){return t=(t=Ut(t=Ct(t=B(t).path),!0)).toLowerCase()}function H(t){const n={proxyUrl:t.proxyUrl,urlPrefix:S(t.urlPrefix)},e=c.proxyRules,r=n.urlPrefix;let o=e.length;for(let i=0;i<e.length;i++){const t=e[i].urlPrefix;if(0===r.indexOf(t)){if(r.length===t.length)return-1;o=i;break}0===t.indexOf(r)&&(o=i+1)}return e.splice(o,0,n),o}function T(t){const n=c.proxyRules,e=S(t);for(let r=0;r<n.length;r++)if(0===e.indexOf(n[r].urlPrefix))return n[r]}function W(t,n){if(!t||!n)return!1;t=J(t),n=J(n);const e=i(t),r=i(n);return null!=e&&null!=r?e.portalHostname===r.portalHostname:null==e&&null==r&&F(t,n,!0)}function z(t,n){if(!t||!n)return!1;t=J(t),n=J(n);const e=i(t),r=i(n);return null!=e&&null!=r&&e.portalHostname===r.portalHostname}function D(t,n){return t=J(t),n=J(n),Ut(t)===Ut(n)}function J(t){const n=(t=K(t)).indexOf("/sharing");return n>0?t.slice(0,n):t.replace(/\/+$/,"")}function N(t,n=c.interceptors){const e=n=>null==n||n instanceof RegExp&&n.test(t)||"string"==typeof n&&t.startsWith(n);if(n)for(const r of n)if(Array.isArray(r.urls)){if(r.urls.some(e))return r}else if(e(r.urls))return r;return null}function F(t,n,e=!1){if(!t||!n)return!1;const r=vt(t),o=vt(n);return!(!e&&r.scheme!==o.scheme)&&(null!=r.host&&null!=o.host&&(r.host.toLowerCase()===o.host.toLowerCase()&&r.port===o.port))}function M(t){if("string"==typeof t){if(!Y(t))return!0;t=vt(t)}if(F(t,O))return!0;const n=c.trustedServers||[];for(let e=0;e<n.length;e++){const r=Q(n[e]);for(let n=0;n<r.length;n++)if(F(t,r[n]))return!0}return!1}function Q(t){return w[t]||(ht(t)||pt(t)?w[t]=[new x(_(t))]:w[t]=[new x(`http://${t}`),new x(`https://${t}`)]),w[t]}function _(t,n=q,e){return pt(t)?e?.preserveProtocolRelative?t:"http"===O.scheme&&O.authority===X(t).slice(2)?`http:${t}`:`https:${t}`:ht(t)?t:V("/"===t[0]?Ot(n):n,t)}function G(t,n=q,e){if(null==t||!Y(t))return t;const r=K(t),o=r.toLowerCase(),i=K(n).toLowerCase().replace(/\/+$/,""),s=e?K(e).toLowerCase().replace(/\/+$/,""):null;if(s&&0!==i.indexOf(s))return t;const u=(t,n,e)=>-1===(e=t.indexOf(n,e))?t.length:e;let l=u(o,"/",o.indexOf("//")+2),c=-1;for(;o.slice(0,l+1)===i.slice(0,l)+"/"&&(c=l+1,l!==o.length);)l=u(o,"/",l+1);if(-1===c)return t;if(s&&c<s.length)return t;t=r.slice(c);const f=i.slice(c-1).replaceAll(/[^/]+/g,"").length;if(f>0)for(let a=0;a<f;a++)t=`../${t}`;else t=`./${t}`;return t}function K(t){return t=It(t=Lt(t=bt(t=_(t=t.trim()))))}function V(...t){const e=t.filter(n);if(!e?.length)return;const r=[];if(Y(e[0])){const t=e[0],n=t.indexOf("//");-1!==n&&(r.push(t.slice(0,n+1)),yt(e[0])&&(r[0]+="/"),e[0]=t.slice(n+2))}else"/"===e[0][0]&&r.push("");const o=e.reduce(((t,n)=>n?t.concat(n.split("/")):t),[]);for(let n=0;n<o.length;n++){const t=o[n];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&n===o.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function X(t,n=!1){if(null==t||Z(t)||tt(t))return null;let e=t.indexOf("://");if(-1===e&&pt(t))e=2;else{if(-1===e)return null;e+=3}const r=t.indexOf("/",e);return-1!==r&&(t=t.slice(0,r)),n&&(t=Ut(t,!0)),t}function Y(t){return pt(t)||ht(t)}function Z(t){return null!=t&&"blob:"===t.slice(0,5)}function tt(t){return null!=t&&"data:"===t.slice(0,5)}function nt(t){const n=ot(t);return n?.isBase64?s(n.data):null}function et(t){return u(t).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}const rt=/^data:(.*?)(;base64)?,(.*)$/;function ot(t){const n=t.match(rt);if(!n)return null;const[,e,r,o]=n;return{mediaType:e,isBase64:!!r,data:o}}function it(t){return t.isBase64?`data:${t.mediaType};base64,${t.data}`:`data:${t.mediaType},${t.data}`}async function st(t){return(await fetch(t)).blob()}function ut(t){const n=nt(t);if(!n)return null;const e=ot(t);return new Blob([n],{type:e.mediaType})}function lt(t,n){ft(t,n)}function ct(t,n){at(t,n)}function ft(t,n){const e=ut(t);return!!e&&at(e,n)}function at(t,n){if(!t)return!1;const e=document.createElement("a");if(!("download"in e))return!1;const r=URL.createObjectURL(t);return e.download=n,e.href=r,e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e),URL.revokeObjectURL(r),!0}function pt(t){return null!=t&&"/"===t[0]&&"/"===t[1]}function ht(t){return null!=t&&a.test(t)}function dt(t){return null!=t&&h.test(t)||"https"===O.scheme&&pt(t)}function mt(t){return null!=t&&p.test(t)||"http"===O.scheme&&pt(t)}function yt(t){return null!=t&&d.test(t)}function gt(t){return pt(t)?`http:${t}`:t.replace(h,"http:")}function $t(t){return pt(t)?`https:${t}`:t.replace(p,"https:")}function xt(){return"http"===O.scheme}function wt(){return"https"===O.scheme}function Ut(t,n=!1){return pt(t)?t.slice(2):(t=t.replace(a,""),n&&t.length>1&&"/"===t[0]&&"/"===t[1]&&(t=t.slice(2)),t)}function Ot(t){const n=t.indexOf("//"),e=t.indexOf("/",n+2);return-1===e?t:t.slice(0,e)}function Rt(t){let n=0;if(Y(t)){const e=t.indexOf("//");-1!==e&&(n=e+2)}const e=t.lastIndexOf("/");return e<n?t:t.slice(0,e+1)}function qt(t,n){if(!t)return"";const e=I(t).path.replace(/\/+$/,""),r=e.slice(e.lastIndexOf("/")+1);if(!n?.length)return r;const o=new RegExp(`\\.(${n.join("|")})$`,"i");return r.replace(o,"")}function Ct(t){return t.endsWith("/")?t:`${t}/`}function jt(t){return t.replace(/\/+$/,"")}function bt(t){if(/^https?:\/\//i.test(t)){const n=B(t);t=(t=n.path.replaceAll(/\/{2,}/g,"/")).replace("/","//"),n.query&&(t+=`?${n.query}`)}return t}function Lt(t){return t.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}function It(t){const n=c.httpsDomains;if(!mt(t))return t;const e=t.indexOf("/",7);let r;if(r=-1===e?t:t.slice(0,e),r=r.toLowerCase().slice(7),m.test(r)){if(!r.endsWith(":80"))return t;r=r.slice(0,-3),t=t.replace(":80","")}return xt()&&r===O.authority&&!y.test(t)||(wt()&&r===O.authority||n&&n.some((t=>r===t||r.endsWith(`.${t}`)))||wt()&&!T(t))&&(t=$t(t)),t}function At(t,n,e){if(!(n&&e&&t&&Y(t)))return t;const r=t.indexOf("//"),o=t.indexOf("/",r+2),i=t.indexOf(":",r+2),s=Math.min(o<0?t.length:o,i<0?t.length:i);if(t.slice(r+2,s).toLowerCase()!==n.toLowerCase())return t;return`${t.slice(0,r+2)}${e}${t.slice(s)}`}function vt(t){return"string"==typeof t?new x(_(t)):(t.scheme||(t.scheme=O.scheme),t)}function Pt(t){return Dt.test(t)}function kt(t,n){const e=I(t),r=Object.keys(e.query||{});return r.length>0&&n&&n.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${r.join(", ")}.`),e.path}function Et(t,n,e){const r=I(t),o=r.query||{};return o[n]=String(e),`${r.path}?${v(o)}`}function Bt(t,n){if(!n)return t;const e=I(t),r=e.query||{};for(const[i,s]of Object.entries(n))null!=s&&(r[i]=s);const o=v(r);return o?`${e.path}?${o}`:e.path}function St(t,n){const{path:e,query:r}=I(t);if(!r)return t;delete r[n];const o=v(r);return o?`${e}?${o}`:e}function Ht(t){if(null==t)return null;const n=t.match(zt);return n?n[2]:null}function Tt(t){if(null==t)return null;const n=t.match(zt);return n?{path:n[1],extension:n[2]}:{path:t,extension:null}}async function Wt(t){if("string"==typeof t){return ot(t)??{data:t}}return new Promise(((n,e)=>{const r=new FileReader;r.readAsDataURL(t),r.onload=()=>n(ot(r.result)),r.onerror=t=>e(t)}))}const zt=/([^.]*)\.([^/]*)$/,Dt=/(^data:image\/svg|\.svg$)/i;export{x as Url,k as addProxy,H as addProxyRule,Et as addQueryParameter,Bt as addQueryParameters,et as base64UrlEncode,st as blobUrlToBlob,At as changeDomain,ot as dataComponents,nt as dataToArrayBuffer,ut as dataToBlob,ct as downloadBlobAsFile,lt as downloadDataAsFile,Ct as ensureTrailingSlash,j as getAppBaseUrl,C as getAppUrl,qt as getFilename,N as getInterceptor,X as getOrigin,Ht as getPathExtension,T as getProxyRule,P as getProxyUrl,ht as hasProtocol,z as hasSameCanonicalArcGISOnlinePortal,W as hasSameCanonicalPortal,F as hasSameOrigin,D as hasSamePortal,Y as isAbsolute,wt as isAppHTTPS,Z as isBlobProtocol,tt as isDataProtocol,dt as isHTTPSProtocol,pt as isProtocolRelative,Pt as isSVG,M as isTrustedServer,V as join,_ as makeAbsolute,it as makeData,G as makeRelative,K as normalize,v as objectToQuery,Wt as parseData,A as queryToObject,Rt as removeFile,St as removeQueryParameter,kt as removeQueryParameters,jt as removeTrailingSlash,Tt as splitPathExtension,L as test,gt as toHTTP,$t as toHTTPS,w as trustedServersUrlCache,I as urlToObject};
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.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Error.js";import r from"../core/Loadable.js";import o from"../core/Logger.js";import s from"../core/Promise.js";import{throwIfAborted as n,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/has.js";import"../core/RandomLCG.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{fromValues as m}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import l from"./Geometry.js";import u from"./Point.js";import h from"./Polygon.js";import{create as d,fromBuffer as f,zero as x}from"./support/aaBoundingBox.js";import{composeAxes as y,create as v}from"./support/axisAngleDegrees.js";import g from"./support/MeshComponent.js";import{componentNotFoundMessage as j,meshNotLoadedMessage as w,invalidLocationMessage as S,invalidPolygonMessage as b,InvalidLocationError as A}from"./support/meshErrors.js";import M from"./support/MeshGeoreferencedVertexSpace.js";import L from"./support/MeshLocalVertexSpace.js";import R from"./support/MeshTransform.js";import{MeshVertexAttributes as C}from"./support/MeshVertexAttributes.js";import{vertexSpaceOriginToPoint as _,isRelativeVertexSpace as F,selectVertexSpace as U}from"./support/meshVertexSpaceUtils.js";import{triangulate as P}from"./support/triangulationUtils.js";import{centerAt as E}from"./support/meshUtils/centerAt.js";import{computeMeshExtent as B}from"./support/meshUtils/extent.js";import{loadExternal as G}from"./support/meshUtils/loadExternal.js";import{Metadata as k}from"./support/meshUtils/Metadata.js";import{convertUnitGeometry as I,createUnitSizeBox as T,extractSingleFaceOfBox as V,createUnitSizeSphere as O,createUnitSizeCylinder as z,convertPlaneSizeParameter as D,createUnitSizePlane as N}from"./support/meshUtils/primitives.js";import{rotate as W}from"./support/meshUtils/rotate.js";import{scale as Z}from"./support/meshUtils/scale.js";var H;const K="esri.geometry.Mesh";function q(){return o.getLogger(K)}const J={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:M,local:L}};let Q=H=class extends(r.LoadableMixin(s.EsriPromiseMixin(l))){constructor(e){super(e),this.components=null,this.vertexSpace=new M,this.transform=null,this.metadata=new k,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new C,this.type="mesh"}initialize(){(0===this.metadata.externalSources.length||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when((()=>{this.addHandles(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{spatialReference:e,vertexSpace:t}=this,r=this;return B({get transform(){return r.transform},vertexSpace:t,spatialReference:e,untransformedBounds:this._untransformedBounds})}get _untransformedBounds(){const{vertexAttributes:{position:e},components:t}=this;return 0===e.length||0===t?.length?d(x):f(e)}get origin(){const e=_(this.vertexSpace,this.spatialReference);if(null!=e)return e;const{center:t,zmin:r}=this._transformedExtent;return new u({x:t.x,y:t.y,z:r,spatialReference:this.spatialReference})}get extent(){return this.loaded||null==this.metadata?.displaySource?.extent?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(g.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}q().error("removeComponent()",j)}}rotate(e,t,r,o){return y(e,t,r,X),W(this,X,o),this}offset(e,t,r){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:o,vertexAttributes:s}=this,n=s?.position;if(!n)return this;if(F(o)){const[s,n,i]=o.origin;o.origin=m(s+e,n+t,i+r)}else{for(let o=0;o<n.length;o+=3)n[o]+=e,n[o+1]+=t,n[o+2]+=r;this.vertexAttributesChanged()}return this}scale(e,t){return this._checkIfLoaded("scale()")?(Z(this,e,t),this):this}centerAt(e,t){return this._checkIfLoaded("centerAt()")?(E(this,e,t),this):this}load(e){const{metadata:{displaySource:t}}=this;return t&&this.addResolvingPromise(G(this,t,e)),Promise.resolve(this)}addExternalSources(e){this.metadata.externalSources.addMany(e)}updateDisplaySource(e){this.metadata.displaySource=e}clone(){return this.cloneAndModifyVertexAttributes(this.vertexAttributes.clone(),this.vertexSpace.clone(),{preserveMetadata:!0})}cloneAndModifyVertexAttributes(e,t,r){let o=null;if(this.components){const e=new Map,t=new Map;o=this.components.map((r=>r.cloneWithDeduplication(e,t)))}const s={components:o,spatialReference:this.spatialReference,vertexAttributes:e,vertexSpace:t,transform:this.transform?.clone()??null,metadata:r?.preserveMetadata?this.metadata.clone():new k};return new H(s)}cloneShallow(){return new H({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[{toBinaryGLTF:t}]=await Promise.all([import("./support/meshUtils/exporters/gltf/gltfexport.js"),this.load(e)]);return n(e),await t(this,e)}get usedMemory(){return this.components?this.components.reduce(((e,t)=>e+t.memoryUsage),this.vertexAttributes.usedMemory):this.vertexAttributes.usedMemory}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(q().error(e,w),!1)}static createBox(e,t){if(!(e instanceof u))return q().error(".createBox()",S),null;const r=new H(I(T(),e,t));return t?.imageFace&&"all"!==t.imageFace?V(r,t.imageFace):r}static createSphere(e,t){return e instanceof u?new H(I(O(t?.densificationFactor||0),e,t)):(q().error(".createSphere()",S),null)}static createCylinder(e,t){return e instanceof u?new H(I(z(t?.densificationFactor||0),e,t)):(q().error(".createCylinder()",S),null)}static createPlane(e,t){if(!(e instanceof u))return q().error(".createPlane()",S),null;const r=t?.facing??"up",o=D(r,t?.size);return new H(I(N(r),e,{...t,size:o}))}static createFromPolygon(e,t){if(!(e instanceof h))return q().error(".createFromPolygon()",b),null;const r=P(e);return new H({vertexAttributes:new C({position:r.position}),components:[new g({faces:r.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new M})}static async createFromGLTF(e,t,r){if(!(e instanceof u)){const e=new A;throw q().error(".createfromGLTF()",e.message),e}const{loadGLTFMesh:o}=await i(import("./support/meshUtils/loadGLTFMesh.js"),r);return new H(await o(e,t,r))}static createWithExternalSource(e,t,r){const o=r?.extent??null,{spatialReference:s}=e,n=r?.transform?.clone()??new R,i=U(e,r),a=r?.unitConversionDisabled,c={source:t,extent:o,unitConversionDisabled:a},p=new k;return p.externalSources.push(c),new H({metadata:p,transform:n,vertexSpace:i,spatialReference:s})}static createIncomplete(e,r){const{spatialReference:o}=e,s=r?.transform?.clone()??new R,n=U(e,r),i=new H({transform:s,vertexSpace:n,spatialReference:o});return i.addResolvingPromise(Promise.reject(new t("mesh-incomplete","Mesh resources are not complete"))),i}};e([c({type:[g],json:{write:!0}})],Q.prototype,"components",void 0),e([c({nonNullable:!0,types:J,constructOnly:!0,json:{write:!0}})],Q.prototype,"vertexSpace",void 0),e([c({type:R,json:{write:!0}})],Q.prototype,"transform",void 0),e([c({constructOnly:!0})],Q.prototype,"metadata",void 0),e([c()],Q.prototype,"hasExtent",null),e([c()],Q.prototype,"_transformedExtent",null),e([c()],Q.prototype,"_untransformedBounds",null),e([c()],Q.prototype,"origin",null),e([c({readOnly:!0,json:{read:!1}})],Q.prototype,"extent",null),e([c({readOnly:!0,json:{read:!1,write:!0,default:!0}})],Q.prototype,"hasZ",void 0),e([c({readOnly:!0,json:{read:!1,write:!0,default:!1}})],Q.prototype,"hasM",void 0),e([c({type:C,nonNullable:!0,json:{write:!0}})],Q.prototype,"vertexAttributes",void 0),Q=H=e([p(K)],Q);const X=v(),Y=Q;export{Y as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Error.js";import r from"../core/Loadable.js";import o from"../core/Logger.js";import s from"../core/Promise.js";import{throwIfAborted as n,whenOrAbort as i}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{fromValues as m}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import l from"./Geometry.js";import h from"./Point.js";import u from"./Polygon.js";import{create as d,fromBuffer as f,zero as g}from"./support/aaBoundingBox.js";import{composeAxes as x,create as y}from"./support/axisAngleDegrees.js";import v from"./support/MeshComponent.js";import{componentNotFoundMessage as j,meshNotLoadedMessage as w,invalidLocationMessage as S,invalidPolygonMessage as b,InvalidLocationError as A}from"./support/meshErrors.js";import L from"./support/MeshGeoreferencedVertexSpace.js";import M from"./support/MeshLocalVertexSpace.js";import R from"./support/MeshTransform.js";import{MeshVertexAttributes as C}from"./support/MeshVertexAttributes.js";import{vertexSpaceOriginToPoint as _,isRelativeVertexSpace as F,selectVertexSpace as U}from"./support/meshVertexSpaceUtils.js";import{triangulate as P}from"./support/triangulationUtils.js";import{centerAt as E}from"./support/meshUtils/centerAt.js";import{computeMeshExtent as B}from"./support/meshUtils/extent.js";import{loadExternal as G}from"./support/meshUtils/loadExternal.js";import{Metadata as k}from"./support/meshUtils/Metadata.js";import{convertUnitGeometry as I,createUnitSizeBox as T,extractSingleFaceOfBox as V,createUnitSizeSphere as O,createUnitSizeCylinder as z,convertPlaneSizeParameter as D,createUnitSizePlane as N}from"./support/meshUtils/primitives.js";import{rotate as W}from"./support/meshUtils/rotate.js";import{scale as Z}from"./support/meshUtils/scale.js";var H;const K={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:L,local:M}};let q=H=class extends(r.LoadableMixin(s.EsriPromiseMixin(l))){constructor(e){super(e),this.components=null,this.vertexSpace=new L,this.transform=null,this.metadata=new k,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new C,this.type="mesh"}initialize(){(0===this.metadata.externalSources.length||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when((()=>{this.addHandles(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{spatialReference:e,vertexSpace:t}=this,r=this;return B({get transform(){return r.transform},vertexSpace:t,spatialReference:e,untransformedBounds:this._untransformedBounds})}get _untransformedBounds(){const{vertexAttributes:{position:e},components:t}=this;return 0===e.length||0===t?.length?d(g):f(e)}get origin(){const e=_(this.vertexSpace,this.spatialReference);if(null!=e)return e;const{center:t,zmin:r}=this._transformedExtent;return new h({x:t.x,y:t.y,z:r,spatialReference:this.spatialReference})}get extent(){return this.loaded||null==this.metadata?.displaySource?.extent?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(v.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}o.getLogger(this).error("removeComponent()",j)}}rotate(e,t,r,o){return x(e,t,r,J),W(this,J,o),this}offset(e,t,r){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:o,vertexAttributes:s}=this,n=s?.position;if(!n)return this;if(F(o)){const[s,n,i]=o.origin;o.origin=m(s+e,n+t,i+r)}else{for(let o=0;o<n.length;o+=3)n[o]+=e,n[o+1]+=t,n[o+2]+=r;this.vertexAttributesChanged()}return this}scale(e,t){return this._checkIfLoaded("scale()")?(Z(this,e,t),this):this}centerAt(e,t){return this._checkIfLoaded("centerAt()")?(E(this,e,t),this):this}load(e){const{metadata:{displaySource:t}}=this;return t&&this.addResolvingPromise(G(this,t,e)),Promise.resolve(this)}addExternalSources(e){this.metadata.externalSources.addMany(e)}updateDisplaySource(e){this.metadata.displaySource=e}clone(){return this.cloneAndModifyVertexAttributes(this.vertexAttributes.clone(),this.vertexSpace.clone(),{preserveMetadata:!0})}cloneAndModifyVertexAttributes(e,t,r){let o=null;if(this.components){const e=new Map,t=new Map;o=this.components.map((r=>r.cloneWithDeduplication(e,t)))}const s={components:o,spatialReference:this.spatialReference,vertexAttributes:e,vertexSpace:t,transform:this.transform?.clone()??null,metadata:r?.preserveMetadata?this.metadata.clone():new k};return new H(s)}cloneShallow(){return new H({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[{toBinaryGLTF:t}]=await Promise.all([import("./support/meshUtils/exporters/gltf/gltfexport.js"),this.load(e)]);return n(e),await t(this,e)}get usedMemory(){return this.components?this.components.reduce(((e,t)=>e+t.memoryUsage),this.vertexAttributes.usedMemory):this.vertexAttributes.usedMemory}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(o.getLogger(this).error(e,w),!1)}static createBox(e,t){if(!(e instanceof h))return o.getLogger(this.prototype).error(".createBox()",S),null;const r=new H(I(T(),e,t));return t?.imageFace&&"all"!==t.imageFace?V(r,t.imageFace):r}static createSphere(e,t){return e instanceof h?new H(I(O(t?.densificationFactor||0),e,t)):(o.getLogger(this.prototype).error(".createSphere()",S),null)}static createCylinder(e,t){return e instanceof h?new H(I(z(t?.densificationFactor||0),e,t)):(o.getLogger(this.prototype).error(".createCylinder()",S),null)}static createPlane(e,t){if(!(e instanceof h))return o.getLogger(this.prototype).error(".createPlane()",S),null;const r=t?.facing??"up",s=D(r,t?.size);return new H(I(N(r),e,{...t,size:s}))}static createFromPolygon(e,t){if(!(e instanceof u))return o.getLogger(this.prototype).error(".createFromPolygon()",b),null;const r=P(e);return new H({vertexAttributes:new C({position:r.position}),components:[new v({faces:r.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new L})}static async createFromGLTF(e,t,r){if(!(e instanceof h)){const e=new A;throw o.getLogger(this.prototype).error(".createfromGLTF()",e.message),e}const{loadGLTFMesh:s}=await i(import("./support/meshUtils/loadGLTFMesh.js"),r);return new H(await s(e,t,r))}static createWithExternalSource(e,t,r){const o=r?.extent??null,{spatialReference:s}=e,n=r?.transform?.clone()??new R,i=U(e,r),a=r?.unitConversionDisabled,p={source:t,extent:o,unitConversionDisabled:a},c=new k;return c.externalSources.push(p),new H({metadata:c,transform:n,vertexSpace:i,spatialReference:s})}static createIncomplete(e,r){const{spatialReference:o}=e,s=r?.transform?.clone()??new R,n=U(e,r),i=new H({transform:s,vertexSpace:n,spatialReference:o});return i.addResolvingPromise(Promise.reject(new t("mesh-incomplete","Mesh resources are not complete"))),i}};e([p({type:[v],json:{write:!0}})],q.prototype,"components",void 0),e([p({nonNullable:!0,types:K,constructOnly:!0,json:{write:!0}})],q.prototype,"vertexSpace",void 0),e([p({type:R,json:{write:!0}})],q.prototype,"transform",void 0),e([p({constructOnly:!0})],q.prototype,"metadata",void 0),e([p()],q.prototype,"hasExtent",null),e([p()],q.prototype,"_transformedExtent",null),e([p()],q.prototype,"_untransformedBounds",null),e([p()],q.prototype,"origin",null),e([p({readOnly:!0,json:{read:!1}})],q.prototype,"extent",null),e([p({readOnly:!0,json:{read:!1,write:!0,default:!0}})],q.prototype,"hasZ",void 0),e([p({readOnly:!0,json:{read:!1,write:!0,default:!1}})],q.prototype,"hasM",void 0),e([p({type:C,nonNullable:!0,json:{write:!0}})],q.prototype,"vertexAttributes",void 0),q=H=e([c("esri.geometry.Mesh")],q);const J=y(),Q=q;export{Q 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.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../core/JSONSupport.js";import{create as i}from"./aaBoundingRect.js";import{getBoundsXY as s}from"./boundsUtils.js";import{closeRings as n}from"./coordsUtils.js";import{isPoint as e,isMultipoint as h,isExtent as o,isPolygon as r,isPolyline as u}from"./jsonUtils.js";import{cutParams as m,updatePolyGeometry as l,offsetMagnitude as x}from"./normalizeUtilsCommon.js";import{getInfo as _,isWebMercator as c}from"./spatialReferenceUtils.js";function p(t){return f(t,!0)}function a(t){return f(t,!1)}function f(i,n){if(null==i)return null;const p=i.spatialReference,a=_(p),f=t.isSerializable(i)?i.toJSON():i;if(!a)return f;const I=c(p)?102100:4326,g=m[I].maxX,v=m[I].minX;if(e(f))return y(f,g,v);if(h(f))return f.points=f.points.map((t=>y(t,g,v))),f;if(o(f))return d(f,a);if(r(f)||u(f)){const t=s(S,f),i={xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]},e=x(i.xmin,v)*(2*g),h=0===e?f:l(f,e);return i.xmin+=e,i.xmax+=e,i.xmax>g?C(h,g,n):i.xmin<v?C(h,v,n):h}return f}function d(t,i){if(!i)return t;const s=I(t,i).map((t=>t.extent));return s.length<2?s[0]||t:s.length>2?(t.xmin=i.valid[0],t.xmax=i.valid[1],t):{rings:s.map((t=>[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]))}}function y(t,i,s){if(Array.isArray(t)){const n=t[0];if(n>i){const s=x(n,i);t[0]=n+s*(-2*i)}else if(n<s){const i=x(n,s);t[0]=n+i*(-2*s)}}else{const n=t.x;if(n>i){const s=x(n,i);t.x+=s*(-2*i)}else if(n<s){const i=x(n,s);t.x+=i*(-2*s)}}return t}function I(t,i){const s=[],{ymin:n,ymax:e,xmin:h,xmax:o}=t,r=t.xmax-t.xmin,[u,m]=i.valid,{x:l,frameId:x}=g(t.xmin,i),{x:_,frameId:c}=g(t.xmax,i),p=l===_&&r>0;if(r>2*m){const t={xmin:h<o?l:_,ymin:n,xmax:m,ymax:e},i={xmin:u,ymin:n,xmax:h<o?_:l,ymax:e},r={xmin:0,ymin:n,xmax:m,ymax:e},p={xmin:u,ymin:n,xmax:0,ymax:e},a=[],f=[];v(t,r)&&a.push(x),v(t,p)&&f.push(x),v(i,r)&&a.push(c),v(i,p)&&f.push(c);for(let s=x+1;s<c;s++)a.push(s),f.push(s);s.push(new P(t,[x]),new P(i,[c]),new P(r,a),new P(p,f))}else l>_||p?s.push(new P({xmin:l,ymin:n,xmax:m,ymax:e},[x]),new P({xmin:u,ymin:n,xmax:_,ymax:e},[c])):s.push(new P({xmin:l,ymin:n,xmax:_,ymax:e},[x]));return s}function g(t,i){const[s,n]=i.valid,e=2*n;let h,o=0;return t>n?(h=Math.ceil(Math.abs(t-n)/e),t-=h*e,o=h):t<s&&(h=Math.ceil(Math.abs(t-s)/e),t+=h*e,o=-h),{x:t,frameId:o}}function v(t,i){const{xmin:s,ymin:n,xmax:e,ymax:h}=i;return O(t,s,n)&&O(t,s,h)&&O(t,e,h)&&O(t,e,n)}function O(t,i,s){return i>=t.xmin&&i<=t.xmax&&s>=t.ymin&&s<=t.ymax}function C(t,i,s=!0){const e=!u(t);if(e&&n(t),s){return(new T).cut(t,i)}const h=e?t.rings:t.paths,o=e?4:2,r=h.length,m=-2*i;for(let n=0;n<r;n++){const t=h[n];if(t&&t.length>=o){const i=[];for(const s of t)i.push([s[0]+m,s[1]]);h.push(i)}}return e?t.rings=h:t.paths=h,t}class P{constructor(t,i){this.extent=t,this.frameIds=i}}const S=i();class T{constructor(){this._linesIn=[],this._linesOut=[]}cut(t,i){let s;if(this._xCut=i,t.rings)this._closed=!0,s=t.rings,this._minPts=4;else{if(!t.paths)return null;this._closed=!1,s=t.paths,this._minPts=2}for(const e of s){if(!e||e.length<this._minPts)continue;let t=!0;for(const i of e)t?(this.moveTo(i),t=!1):this.lineTo(i);this._closed&&this.close()}this._pushLineIn(),this._pushLineOut(),s=[];for(const e of this._linesIn)e&&e.length>=this._minPts&&s.push(e);const n=-2*this._xCut;for(const e of this._linesOut)if(e&&e.length>=this._minPts){for(const t of e)t[0]+=n;s.push(e)}return this._closed?t.rings=s:t.paths=s,t}moveTo(t){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(t[0]),this._moveTo(t[0],t[1],this._prevSide),this._prevPt=t,this._firstPt=t}lineTo(t){const i=this._side(t[0]);if(i*this._prevSide==-1){const s=this._intersect(this._prevPt,t);this._lineTo(this._xCut,s,0),this._prevSide=0,this._lineTo(t[0],t[1],i)}else this._lineTo(t[0],t[1],i);this._prevSide=i,this._prevPt=t}close(){const t=this._firstPt,i=this._prevPt;t[0]===i[0]&&t[1]===i[1]||this.lineTo(t),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(t,i,s){this._closed?(this._lineIn.push([s<=0?t:this._xCut,i]),this._lineOut.push([s>=0?t:this._xCut,i])):(s<=0&&this._lineIn.push([t,i]),s>=0&&this._lineOut.push([t,i]))}_lineTo(t,i,s){this._closed?(j(this._lineIn,s<=0?t:this._xCut,i),j(this._lineOut,s>=0?t:this._xCut,i)):s<0?(0===this._prevSide&&this._pushLineOut(),this._lineIn.push([t,i])):s>0?(0===this._prevSide&&this._pushLineIn(),this._lineOut.push([t,i])):this._prevSide<0?(this._lineIn.push([t,i]),this._lineOut.push([t,i])):this._prevSide>0&&(this._lineOut.push([t,i]),this._lineIn.push([t,i]))}_checkClosingPt(t){const i=t.length;i>3&&t[0][0]===this._xCut&&t[i-2][0]===this._xCut&&t[1][0]===this._xCut&&(t[0][1]=t[i-2][1],t.pop())}_side(t){return t<this._xCut?-1:t>this._xCut?1:0}_intersect(t,i){const s=(this._xCut-t[0])/(i[0]-t[0]);return t[1]+s*(i[1]-t[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}function j(t,i,s){const n=t.length;n>1&&t[n-1][0]===i&&t[n-2][0]===i?t[n-1][1]=s:t.push([i,s])}export{T as CutVertical,a as normalizeCentralMeridianForDisplay,p as normalizeCentralMeridianSync};
5
+ import{isSerializable as t}from"../../core/support/jsonUtils.js";import{create as i}from"./aaBoundingRect.js";import{getBoundsXY as s}from"./boundsUtils.js";import{closeRings as n}from"./coordsUtils.js";import{isPoint as e,isMultipoint as h,isExtent as o,isPolygon as u,isPolyline as r}from"./jsonUtils.js";import{cutParams as m,updatePolyGeometry as x,offsetMagnitude as l}from"./normalizeUtilsCommon.js";import{getInfo as _,isWebMercator as c}from"./spatialReferenceUtils.js";function p(t){return f(t,!0)}function a(t){return f(t,!1)}function f(i,n){if(null==i)return null;const p=i.spatialReference,a=_(p),f=t(i)?i.toJSON():i;if(!a)return f;const I=c(p)?102100:4326,g=m[I].maxX,v=m[I].minX;if(e(f))return y(f,g,v);if(h(f))return f.points=f.points.map((t=>y(t,g,v))),f;if(o(f))return d(f,a);if(u(f)||r(f)){const t=s(T,f),i={xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]},e=l(i.xmin,v)*(2*g),h=0===e?f:x(f,e);return i.xmin+=e,i.xmax+=e,i.xmax>g?C(h,g,n):i.xmin<v?C(h,v,n):h}return f}function d(t,i){if(!i)return t;const s=I(t,i).map((t=>t.extent));return s.length<2?s[0]||t:s.length>2?(t.xmin=i.valid[0],t.xmax=i.valid[1],t):{rings:s.map((t=>[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]))}}function y(t,i,s){if(Array.isArray(t)){const n=t[0];if(n>i){const s=l(n,i);t[0]=n+s*(-2*i)}else if(n<s){const i=l(n,s);t[0]=n+i*(-2*s)}}else{const n=t.x;if(n>i){const s=l(n,i);t.x+=s*(-2*i)}else if(n<s){const i=l(n,s);t.x+=i*(-2*s)}}return t}function I(t,i){const s=[],{ymin:n,ymax:e,xmin:h,xmax:o}=t,u=t.xmax-t.xmin,[r,m]=i.valid,{x,frameId:l}=g(t.xmin,i),{x:_,frameId:c}=g(t.xmax,i),p=x===_&&u>0;if(u>2*m){const t={xmin:h<o?x:_,ymin:n,xmax:m,ymax:e},i={xmin:r,ymin:n,xmax:h<o?_:x,ymax:e},u={xmin:0,ymin:n,xmax:m,ymax:e},p={xmin:r,ymin:n,xmax:0,ymax:e},a=[],f=[];v(t,u)&&a.push(l),v(t,p)&&f.push(l),v(i,u)&&a.push(c),v(i,p)&&f.push(c);for(let s=l+1;s<c;s++)a.push(s),f.push(s);s.push(new P(t,[l]),new P(i,[c]),new P(u,a),new P(p,f))}else x>_||p?s.push(new P({xmin:x,ymin:n,xmax:m,ymax:e},[l]),new P({xmin:r,ymin:n,xmax:_,ymax:e},[c])):s.push(new P({xmin:x,ymin:n,xmax:_,ymax:e},[l]));return s}function g(t,i){const[s,n]=i.valid,e=2*n;let h,o=0;return t>n?(h=Math.ceil(Math.abs(t-n)/e),t-=h*e,o=h):t<s&&(h=Math.ceil(Math.abs(t-s)/e),t+=h*e,o=-h),{x:t,frameId:o}}function v(t,i){const{xmin:s,ymin:n,xmax:e,ymax:h}=i;return O(t,s,n)&&O(t,s,h)&&O(t,e,h)&&O(t,e,n)}function O(t,i,s){return i>=t.xmin&&i<=t.xmax&&s>=t.ymin&&s<=t.ymax}function C(t,i,s=!0){const e=!r(t);if(e&&n(t),s){return(new S).cut(t,i)}const h=e?t.rings:t.paths,o=e?4:2,u=h.length,m=-2*i;for(let n=0;n<u;n++){const t=h[n];if(t&&t.length>=o){const i=[];for(const s of t)i.push([s[0]+m,s[1]]);h.push(i)}}return e?t.rings=h:t.paths=h,t}class P{constructor(t,i){this.extent=t,this.frameIds=i}}const T=i();class S{constructor(){this._linesIn=[],this._linesOut=[]}cut(t,i){let s;if(this._xCut=i,t.rings)this._closed=!0,s=t.rings,this._minPts=4;else{if(!t.paths)return null;this._closed=!1,s=t.paths,this._minPts=2}for(const e of s){if(!e||e.length<this._minPts)continue;let t=!0;for(const i of e)t?(this.moveTo(i),t=!1):this.lineTo(i);this._closed&&this.close()}this._pushLineIn(),this._pushLineOut(),s=[];for(const e of this._linesIn)e&&e.length>=this._minPts&&s.push(e);const n=-2*this._xCut;for(const e of this._linesOut)if(e&&e.length>=this._minPts){for(const t of e)t[0]+=n;s.push(e)}return this._closed?t.rings=s:t.paths=s,t}moveTo(t){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(t[0]),this._moveTo(t[0],t[1],this._prevSide),this._prevPt=t,this._firstPt=t}lineTo(t){const i=this._side(t[0]);if(i*this._prevSide==-1){const s=this._intersect(this._prevPt,t);this._lineTo(this._xCut,s,0),this._prevSide=0,this._lineTo(t[0],t[1],i)}else this._lineTo(t[0],t[1],i);this._prevSide=i,this._prevPt=t}close(){const t=this._firstPt,i=this._prevPt;t[0]===i[0]&&t[1]===i[1]||this.lineTo(t),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(t,i,s){this._closed?(this._lineIn.push([s<=0?t:this._xCut,i]),this._lineOut.push([s>=0?t:this._xCut,i])):(s<=0&&this._lineIn.push([t,i]),s>=0&&this._lineOut.push([t,i]))}_lineTo(t,i,s){this._closed?(j(this._lineIn,s<=0?t:this._xCut,i),j(this._lineOut,s>=0?t:this._xCut,i)):s<0?(0===this._prevSide&&this._pushLineOut(),this._lineIn.push([t,i])):s>0?(0===this._prevSide&&this._pushLineIn(),this._lineOut.push([t,i])):this._prevSide<0?(this._lineIn.push([t,i]),this._lineOut.push([t,i])):this._prevSide>0&&(this._lineOut.push([t,i]),this._lineIn.push([t,i]))}_checkClosingPt(t){const i=t.length;i>3&&t[0][0]===this._xCut&&t[i-2][0]===this._xCut&&t[1][0]===this._xCut&&(t[0][1]=t[i-2][1],t.pop())}_side(t){return t<this._xCut?-1:t>this._xCut?1:0}_intersect(t,i){const s=(this._xCut-t[0])/(i[0]-t[0]);return t[1]+s*(i[1]-t[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}function j(t,i,s){const n=t.length;n>1&&t[n-1][0]===i&&t[n-2][0]===i?t[n-1][1]=s:t.push([i,s])}export{S as CutVertical,a as normalizeCentralMeridianForDisplay,p as normalizeCentralMeridianSync};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import"../../core/Logger.js";import"../../core/mathUtils.js";import"../../core/libs/gl-matrix-2/math/mat4.js";import"../../chunks/vec32.js";import"../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../chunks/vec42.js";import"../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../../core/libs/gl-matrix-2/math/common.js";import"./Axis.js";import"./ray.js";import"./sphereUtils.js";import"./vector.js";import"./vectorStacks.js";export{N as NullSphere,D as altitudeAt,B as angleToSilhouette,C as axisAt,d as cameraFrustumCoverage,r as clear,A as closestPoint,k as closestPointOnSilhouette,o as containsPoint,e as copy,c as create,h as distanceToSilhouette,v as elevate,q as equals,m as exactEquals,l as fromCenterAndRadius,b as fromRadius,f as fromValues,a as getCenter,y as getExtent,g as getRadius,n as intersectLine,j as intersectRay,z as intersectRayClosestSilhouette,i as intersectsRay,p as projectPoint,E as setAltitudeAt,x as setExtent,t as tmpSphere,u as union,w as wrap}from"../../chunks/sphere.js";
5
+ import"../../core/has.js";import"../../core/Logger.js";import"../../core/mathUtils.js";import"../../core/libs/gl-matrix-2/math/mat4.js";import"../../chunks/vec32.js";import"../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../chunks/vec42.js";import"../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../../core/libs/gl-matrix-2/math/common.js";import"./Axis.js";import"./ray.js";import"./sphereUtils.js";import"./vector.js";import"./vectorStacks.js";export{N as NullSphere,D as altitudeAt,B as angleToSilhouette,C as axisAt,d as cameraFrustumCoverage,r as clear,A as closestPoint,k as closestPointOnSilhouette,o as containsPoint,e as copy,c as create,j as distanceToSilhouette,v as elevate,q as equals,m as exactEquals,l as fromCenterAndRadius,b as fromRadius,f as fromValues,a as getCenter,y as getExtent,g as getRadius,n as intersectLine,h as intersectRay,z as intersectRayClosestSilhouette,i as intersectsRay,p as projectPoint,E as setAltitudeAt,x as setExtent,t as tmpSphere,u as union,w as wrap}from"../../chunks/sphere.js";