@arcgis/core 5.1.0-next.100 → 5.1.0-next.102

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 (158) hide show
  1. package/arcgisGlobal.d.ts +1449 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/0d81409721d29d8bc276.js +1 -0
  4. package/assets/esri/core/workers/chunks/{9478a0478fb49a88685e.js → 119b84f5349f90d1dd28.js} +1 -1
  5. package/assets/esri/core/workers/chunks/15167eeb6d7dbe7e392d.js +1 -0
  6. package/assets/esri/core/workers/chunks/{6881ae969b48bd04f064.js → 1ba37706e5d5eaabcb8e.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{889a0405e3cdfa59b8e7.js → 1faa8a42d5a437fc40a3.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{40137b23d8ad4af7ff9c.js → 3996149146dd1eca7cc5.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{38b1d2ffcc318ac0119d.js → 48fcc10768d93e95a04e.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{e7637d6a8ce0af46843c.js → 55ccb8ed7325efb62091.js} +2 -2
  11. package/assets/esri/core/workers/chunks/{2b2e5628d08d0e3108d2.js → 5663df3cd1dfd4b43c73.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{0253292939b981134663.js → 5bc299f7f89a07a6e6a6.js} +1 -1
  13. package/assets/esri/core/workers/chunks/5dafd35801dca4229aed.js +1 -0
  14. package/assets/esri/core/workers/chunks/{d345030a89914348d3c5.js → 6f96ce41c47cae82e687.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{b6b6f190687813267d77.js → 7db09c5bf024242becfa.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{df232b8aa77f7e3285e3.js → 86bff154d46f8a562887.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{07ddf1b1f7602063ceb0.js → 8f9117d589de7caaa02d.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{2ad7c221ad317706387a.js → 9e7c84a3a2abec4d49df.js} +2 -2
  19. package/assets/esri/core/workers/chunks/{490e4a648cb2ab3e7956.js → a318cf6bb900e0ee268c.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{3ba29e7cf9fba3aa5f41.js → b1b8a7c00ec4d998ab84.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{fff4b9e43464ebb3fb4e.js → bb5512ecb5300d45d46b.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{d8c4fb66c733ab2f66d3.js → bb81da98546c4d923e0d.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{765ee0f2bfcec6d5bcc6.js → bc6a809a965355eb425f.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{53ff47c06ccfc0be885c.js → d30790c69724258dab2b.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{7a20941913d0115cfe26.js → de25311b6d13bf1c6089.js} +2 -2
  26. package/assets/esri/core/workers/chunks/{9940b318f38ea9d7a533.js → e86c073f0b6d395c7a38.js} +1 -1
  27. package/assets/esri/core/workers/chunks/f5bd0a4f82df5e942b70.js +1 -0
  28. package/assets/esri/core/workers/chunks/{b8d10d8db44c7c6acebe.js → fa38dc5010f8630a80fe.js} +1 -1
  29. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +125 -0
  30. package/assets/esri/themes/base/widgets/_Directions.scss +5 -1
  31. package/assets/esri/themes/dark/main.css +1 -1
  32. package/assets/esri/themes/light/main.css +1 -1
  33. package/assets/esri/themes/light/view.css +1 -1
  34. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  35. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  36. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer.json +1 -1
  37. package/chunks/GaussianSplatShadow.glsl.js +39 -0
  38. package/chunks/GlobalIllumination.glsl.js +1 -1
  39. package/config.js +1 -1
  40. package/form/elements/inputs/MultipleChoiceInput.d.ts +5 -5
  41. package/form/elements/inputs/MultipleChoiceInput.js +1 -1
  42. package/interfaces.d.ts +17 -0
  43. package/kernel.js +1 -1
  44. package/layers/FeatureLayer.d.ts +29 -39
  45. package/layers/KnowledgeGraphLayer.d.ts +1 -1
  46. package/layers/KnowledgeGraphLayer.js +1 -1
  47. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  48. package/layers/OrientedImageryLayer.d.ts +233 -0
  49. package/layers/OrientedImageryLayer.js +1 -1
  50. package/layers/ParquetLayer.d.ts +73 -24
  51. package/layers/ParquetLayer.js +1 -1
  52. package/layers/SceneLayer.d.ts +2 -2
  53. package/layers/VideoLayer.d.ts +35 -9
  54. package/layers/VideoLayer.js +1 -1
  55. package/layers/catalog/CatalogFootprintLayer.d.ts +147 -0
  56. package/layers/graphics/sources/ParquetSource.js +1 -1
  57. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  58. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +3 -1
  59. package/layers/support/FeatureReductionBinning.d.ts +87 -9
  60. package/layers/support/FeatureReductionCluster.d.ts +87 -9
  61. package/layers/support/FieldConfiguration.d.ts +1 -1
  62. package/layers/support/ParquetFilesData.d.ts +46 -0
  63. package/layers/support/ParquetFilesData.js +2 -0
  64. package/layers/support/ParquetPortalItemData.d.ts +25 -0
  65. package/layers/support/ParquetPortalItemData.js +2 -0
  66. package/layers/support/SubtypeSublayer.d.ts +147 -0
  67. package/layers/support/TelemetryData.d.ts +5 -0
  68. package/layers/support/TelemetryData.js +1 -1
  69. package/layers/support/TelemetryDisplay.d.ts +10 -2
  70. package/layers/support/TelemetryDisplay.js +1 -1
  71. package/layers/support/parquetUtils.js +1 -1
  72. package/layers/support/types.d.ts +9 -0
  73. package/layers/video/VideoController.js +1 -1
  74. package/layers/video/types.d.ts +8 -1
  75. package/layers/video/videoUtils.js +1 -1
  76. package/networks/UtilityNetworkTraceAnalysis.d.ts +1 -1
  77. package/networks/UtilityNetworkTraceAnalysis.js +1 -1
  78. package/package.json +3 -3
  79. package/portal/jsonTypes.d.ts +7 -0
  80. package/renderers/support/ClassBreakInfo.d.ts +3 -3
  81. package/renderers/support/ClassBreakInfo.js +1 -1
  82. package/renderers/support/UniqueValueInfo.d.ts +3 -3
  83. package/renderers/support/UniqueValueInfo.js +1 -1
  84. package/rest/print.js +1 -1
  85. package/rest/support/PrintParameters.d.ts +8 -1
  86. package/rest/support/PrintParameters.js +1 -1
  87. package/support/revision.js +1 -1
  88. package/third-party-notices.txt +4 -0
  89. package/views/2d/engine/webgl/shaderGraph/graph/GlslGraphWriter.js +1 -1
  90. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
  91. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphNode.js +1 -1
  92. package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
  93. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
  94. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  95. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js +1 -1
  96. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/AspectShader.js +1 -1
  97. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CurvatureShader.js +1 -1
  98. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MaskShader.js +1 -1
  99. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/RemapShader.js +1 -1
  100. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/SlopeShader.js +1 -1
  101. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/math.js +1 -1
  102. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/surface.js +1 -1
  103. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  104. package/views/2d/layers/VideoLayerView2D.js +1 -1
  105. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  106. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  107. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  108. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  109. package/views/3d/webgl/RenderNode.js +1 -1
  110. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +5 -2
  111. package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
  112. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  113. package/views/3d/webgl-engine/lib/GaussianSplatShadowRenderNode.js +2 -0
  114. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  115. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  116. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  117. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  118. package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +2 -0
  119. package/views/3d/webgl-engine/shaders/GaussianSplatShadowTechnique.js +2 -0
  120. package/views/3d/webgl.js +1 -1
  121. package/views/Viewport2DBaseMixin.js +1 -1
  122. package/widgets/Attachments/support/attachmentUtils.js +1 -1
  123. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +8 -1
  124. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  125. package/widgets/BatchAttributeForm/attachmentUtils.js +2 -0
  126. package/widgets/BatchAttributeForm/css.js +1 -1
  127. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  128. package/widgets/BatchAttributeForm/templates/RelationshipElementTemplate.js +1 -1
  129. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  130. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  131. package/widgets/BatchAttributeForm/types.d.ts +7 -0
  132. package/widgets/BatchAttributeForm.js +1 -1
  133. package/widgets/FeatureForm/RelationshipInput.d.ts +1 -1
  134. package/widgets/FeatureTable.js +1 -1
  135. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  136. package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.js +1 -1
  137. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  138. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  139. package/widgets/OrientedImageryViewer/constants.js +1 -1
  140. package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
  141. package/widgets/OrientedImageryViewer/services/TransformationService.js +1 -1
  142. package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +1 -1
  143. package/widgets/OrientedImageryViewer/support/geometryUtils.js +1 -1
  144. package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
  145. package/widgets/OrientedImageryViewer/types.js +1 -1
  146. package/widgets/OrientedImageryViewer/videoViewerUtils.js +1 -1
  147. package/widgets/OrientedImageryViewer.js +1 -1
  148. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
  149. package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +9 -0
  150. package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
  151. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
  152. package/widgets/support/forms/formUtils.js +1 -1
  153. package/assets/esri/core/workers/chunks/26f28406056ddc0e159c.js +0 -1
  154. package/assets/esri/core/workers/chunks/43cc82373be791b7cb4c.js +0 -1
  155. package/assets/esri/core/workers/chunks/b06cc59068d32baaaa87.js +0 -1
  156. package/assets/esri/core/workers/chunks/c9461568e1002ebac534.js +0 -1
  157. /package/assets/esri/core/workers/chunks/{e7637d6a8ce0af46843c.js.LICENSE.txt → 55ccb8ed7325efb62091.js.LICENSE.txt} +0 -0
  158. /package/assets/esri/core/workers/chunks/{7a20941913d0115cfe26.js.LICENSE.txt → de25311b6d13bf1c6089.js.LICENSE.txt} +0 -0
@@ -1,4 +1,3 @@
1
- import type Color from "../Color.js";
2
1
  import type Extent from "../geometry/Extent.js";
3
2
  import type SpatialReference from "../geometry/SpatialReference.js";
4
3
  import type Layer from "./Layer.js";
@@ -11,6 +10,7 @@ import type PictureMarkerSymbol from "../symbols/PictureMarkerSymbol.js";
11
10
  import type SimpleFillSymbol from "../symbols/SimpleFillSymbol.js";
12
11
  import type SimpleLineSymbol from "../symbols/SimpleLineSymbol.js";
13
12
  import type SimpleMarkerSymbol from "../symbols/SimpleMarkerSymbol.js";
13
+ import type { ColorLike } from "../Color.js";
14
14
  import type { MultiOriginJSONSupportMixin } from "../core/MultiOriginJSONSupport.js";
15
15
  import type { VideoLayerCapabilities } from "./types.js";
16
16
  import type { BlendLayer, BlendLayerProperties } from "./mixins/BlendLayer.js";
@@ -19,15 +19,15 @@ import type { OperationalLayer, OperationalLayerProperties } from "./mixins/Oper
19
19
  import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js";
20
20
  import type { ScaleRangeLayer, ScaleRangeLayerProperties } from "./mixins/ScaleRangeLayer.js";
21
21
  import type { Effect } from "./support/FeatureEffect.js";
22
- import type { LivestreamStatus, SensorOrientationInfo, VideoMetadataEntry, VideoState } from "./video/types.js";
23
- import type { Codecs, VideoCameraInfo, VideoGroundControlPoint, VideoQuality, VideoServiceLayerInfo, VideoSourceType } from "../portal/jsonTypes.js";
22
+ import type { Coverage, LivestreamStatus, SensorOrientationInfo, VideoMetadataEntry, VideoState } from "./video/types.js";
23
+ import type { Codecs, TelemetryElementFilter, VideoCameraInfo, VideoGroundControlPoint, VideoQuality, VideoServiceLayerInfo, VideoSourceType } from "../portal/jsonTypes.js";
24
24
  import type { SimpleMarkerSymbolProperties } from "../symbols/SimpleMarkerSymbol.js";
25
25
  import type { SimpleFillSymbolProperties } from "../symbols/SimpleFillSymbol.js";
26
26
  import type { ExtentProperties } from "../geometry/Extent.js";
27
27
  import type { PlaybackInfoProperties } from "./support/PlaybackInfo.js";
28
+ import type { SimpleLineSymbolProperties } from "../symbols/SimpleLineSymbol.js";
28
29
  import type { CIMSymbolProperties } from "../symbols/CIMSymbol.js";
29
30
  import type { PictureMarkerSymbolProperties } from "../symbols/PictureMarkerSymbol.js";
30
- import type { SimpleLineSymbolProperties } from "../symbols/SimpleLineSymbol.js";
31
31
  import type { SpatialReferenceProperties } from "../geometry/SpatialReference.js";
32
32
  import type { TelemetryDisplayProperties } from "./support/TelemetryDisplay.js";
33
33
  import type { LayerProperties } from "./Layer.js";
@@ -75,6 +75,12 @@ export interface VideoLayerProperties extends LayerProperties, CustomParametersM
75
75
  * @since 4.33
76
76
  */
77
77
  playbackInfo?: PlaybackInfoProperties | null;
78
+ /**
79
+ * A [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleLineSymbol/) used for representing the sensor path from collection start to end.
80
+ *
81
+ * @since 5.1
82
+ */
83
+ sensorPathSymbol?: (SimpleLineSymbolProperties & { type: "simple-line" });
78
84
  /**
79
85
  * A [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleLineSymbol/) used for representing the line of sight from the sensor to the center of the frame coverage area.
80
86
  *
@@ -131,6 +137,7 @@ export interface VideoLayerProperties extends LayerProperties, CustomParametersM
131
137
  * frameOutline: true,
132
138
  * lineOfSight: false,
133
139
  * sensorLocation: false,
140
+ * sensorPath: false,
134
141
  * sensorTrail: false,
135
142
  * });
136
143
  */
@@ -222,6 +229,12 @@ export default class VideoLayer extends VideoLayerSuperclass {
222
229
  * videoLayer.copyright = "© 2024 Esri";
223
230
  */
224
231
  accessor copyright: string | null | undefined;
232
+ /**
233
+ * Geographic path followed by the video sensor in the collection.
234
+ *
235
+ * @since 5.1
236
+ */
237
+ get coverage(): Coverage | null | undefined;
225
238
  /** The date the video layer was created. */
226
239
  get created(): Date | null | undefined;
227
240
  /** The current time of the video layer in seconds. */
@@ -394,6 +407,13 @@ export default class VideoLayer extends VideoLayerSuperclass {
394
407
  * uhd | 3840x2160 | Ultra High Definition
395
408
  */
396
409
  get qualities(): VideoQuality[] | null | undefined;
410
+ /**
411
+ * A [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleLineSymbol/) used for representing the sensor path from collection start to end.
412
+ *
413
+ * @since 5.1
414
+ */
415
+ get sensorPathSymbol(): SimpleLineSymbol;
416
+ set sensorPathSymbol(value: (SimpleLineSymbolProperties & { type: "simple-line" }));
397
417
  /**
398
418
  * A [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleLineSymbol/) used for representing the line of sight from the sensor to the center of the frame coverage area.
399
419
  *
@@ -500,6 +520,7 @@ export default class VideoLayer extends VideoLayerSuperclass {
500
520
  * frameOutline: true,
501
521
  * lineOfSight: false,
502
522
  * sensorLocation: false,
523
+ * sensorPath: false,
503
524
  * sensorTrail: false,
504
525
  * });
505
526
  */
@@ -581,14 +602,19 @@ export default class VideoLayer extends VideoLayerSuperclass {
581
602
  */
582
603
  setCurrentTime(timestamp: number): void;
583
604
  /**
584
- * Updates the telemetry color of all telemetry symbol elements to the provided color value.
605
+ * Updates the color configuration for telemetry display elements.
585
606
  *
586
- * @param color - The color to set the video telemetry symbol color to.
607
+ * @param color - The new color to apply to the telemetry symbols.
608
+ * @param options - Optional list of element names that should skip this color update.
609
+ * Defaults to an empty array (all elements are updated).
610
+ * @example
611
+ * // Update color for all telemetry elements
612
+ * updateTelemetryColor(myColor);
587
613
  * @example
588
- * // Set the telemetry color to red
589
- * videoLayer.updateTelemetryColor(new Color("red"));
614
+ * // Update everything except path and trail symbols
615
+ * updateTelemetryColor(myColor, ["sensorPath", "sensorTrail"]);
590
616
  */
591
- updateTelemetryColor(color: Color): void;
617
+ updateTelemetryColor(color: ColorLike, options?: TelemetryElementFilter): void;
592
618
  }
593
619
  declare const VideoLayerSuperclass: typeof Layer & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof ScaleRangeLayer & typeof BlendLayer
594
620
 
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../Color.js";import r from"../request.js";import{deprecatedProperty as o}from"../core/deprecate.js";import i from"../core/Error.js";import s from"../core/Logger.js";import{clamp as l}from"../core/mathUtils.js";import{MultiOriginJSONSupportMixin as n}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{watch as p,initial as y,whenOnce as m}from"../core/reactiveUtils.js";import{property as u,subclass as d}from"../core/accessorSupport/decorators.js";import{Integer as c}from"../core/accessorSupport/ensureType.js";import h from"../geometry/Extent.js";import f from"../geometry/Polyline.js";import v from"../geometry/SpatialReference.js";import g from"./Layer.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{BlendLayer as b,effectProperty as O}from"./mixins/BlendLayer.js";import{CustomParametersMixin as j}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as T}from"./mixins/OperationalLayer.js";import{PortalLayer as w}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as I}from"./mixins/ScaleRangeLayer.js";import{parse as L,cleanTitle as P,titleFromUrlAndName as C}from"./support/arcgisLayerUrl.js";import{opacity as x,id as U}from"./support/commonProperties.js";import{normalizeParsedUrlObject as E,urlProperty as M}from"./support/multiLayerServiceUtils.js";import N from"./support/PlaybackInfo.js";import{getVideoLayerCapabilities as k}from"./support/serviceCapabilitiesUtils.js";import F from"./support/TelemetryData.js";import V from"./support/TelemetryDisplay.js";import H from"./support/VideoFrame.js";import J from"./support/VideoTimeExtent.js";import _ from"./video/VideoController.js";import{getFrameHorizonPoints as G,getGroundControlPoints as R,getTelemetryData as z,getServiceLayersInfo as A,getStyledTelemetrySymbol as q,getSensorTrailPoints as D,readVideoTimeExtent as B}from"./video/videoUtils.js";import W from"../symbols/CIMSymbol.js";import Q from"../symbols/PictureMarkerSymbol.js";import Z from"../symbols/SimpleFillSymbol.js";import K from"../symbols/SimpleLineSymbol.js";import X from"../symbols/SimpleMarkerSymbol.js";import Y from"../symbols/Symbol.js";import{write as $}from"../symbols/support/jsonUtils.js";import{addLayerUnsupportedError as ee}from"../webdoc/support/unsupportedErrors.js";import{reader as te}from"../core/accessorSupport/decorators/reader.js";function re(e,t){return{ignoreOrigin:this.originIdOf(t)<3}}const oe=new t([255,127,0]),ie=new t([0,0,0,.05]),se=new X({angle:0,color:oe,size:10,style:"cross"}),le=new Z({color:ie,outline:new K({color:oe,width:2})}),ne=new K({color:oe,width:1}),ae=new X({angle:0,color:oe,outline:{color:[255,255,255],width:1.33},size:10,style:"circle"}),pe=new K({color:oe,width:1}),ye={types:{base:Y,key:"type",typeMap:{"simple-marker":X,"picture-marker":Q,cim:W}},json:{name:"drawingInfo.sensorSymbol",write:{writer:$,overridePolicy:re}}};function me(e,t){return{type:t,json:{name:e,write:{overridePolicy:re}}}}let ue=class extends(b(I(S(T(w(n(j(g)))))))){constructor(e){super(e),this._trailPoints=[],this.cameraInfo=null,this.capabilities=null,this.codecs=null,this.connectionInfo=null,this.controller=new _,this.copyright=null,this.created=null,this.customParameters=null,this.description=null,this.elevationSource=null,this.frame=null,this.frameCenterSymbol=se.clone(),this.frameCount=null,this.frameEffect=null,this.frameOpacity=1,this.frameOutlineSymbol=le.clone(),this.fullExtent=null,this.fullTimeExtent=null,this.initialExtent=null,this.layerId=null,this.operationalLayerType="ArcGISVideoLayer",this.playbackInfo=null,this.posterUrl=null,this.qualities=null,this.sensorSymbolOrientation={source:"platformHeading",symbolOffset:0},this.sensorSymbol=ae.clone(),this.sensorSightLineSymbol=ne.clone(),this.sensorTrailSymbol=pe.clone(),this.serviceItemId=null,this.sourceJSON=null,this.sourceQuality=null,this.sourceType=null,this.spatialReference=v.WGS84,this.start=0,this.telemetryDisplay=new V,this.sublayerTitleMode="item-title",this.type="video",this.url=null,this.version=null,this.videoLayersInfo=null}initialize(){this.addHandles([p(()=>this.metadata,()=>{this.notifyChange("telemetry"),this.notifyChange("groundControlPoints"),this.notifyChange("frameHorizonPoints")}),p(()=>this.telemetry?.sensorLocation,e=>this._setSensorTrail(e),y)]),m(()=>this.loaded&&"can-play"===this.state&&this.duration>0).then(()=>{this.start>=0&&this.start<=this.duration&&this.setCurrentTime(this.start)})}destroy(){this.removeAllHandles(),this.controller&&this.controller.destroy()}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Video Service"],supportsData:!0},e).catch(a).then(()=>this._fetchService(t));return this.addResolvingPromise(r),Promise.resolve(this)}get autoplay(){return this.controller?.autoplay??!1}set autoplay(e){this.controller.autoplay=e}get buffered(){return this.controller.buffered}readCapabilitiesFromService(e,t){return k(t)}readConnectionInfo(e,t){const r=Object.values(t.connectionUrl);return r?.length&&(this.controller.playerUrl=r[0]),t.connectionUrl}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get frameHorizonPoints(){return G(this.metadata)}get groundControlPoints(){return R(this.metadata)}get isLive(){return this.controller?.isLive??!1}get livestreamStatus(){return this.controller?.livestreamStatus}get loop(){return this.controller.loop}set loop(e){this.controller.loop=e}get metadata(){return this.controller?.currentMetadata}get mimeType(){return this.controller?.mimeType}get muted(){return this.controller.muted}set muted(e){this.controller.muted=e}get parsedUrl(){return E(this)}get playbackRate(){return this.controller.rate}set playbackRate(e){this.controller.rate=e}get playerUrl(){return this.controller.playerUrl}get playing(){return this.controller.playing}get started(){return this.controller?.started??!1}get state(){return this.controller.state}get telemetry(){return z(this.metadata)}readTitleFromService(e,t){const{url:r}=this,o=t.name||(r?L(r)?.title:void 0);switch(this.sublayerTitleMode){case"item-title":if(r)return C(r,o);break;case"item-title-and-service-name":{const e=this.portalItem?.title;if(e&&e!==o)return P(e)+(o?" - "+P(o):"");break}}return o?P(o):void 0}readTitleFromPortalItem(e){return"item-title"===this.sublayerTitleMode?e:void 0}get videoElement(){return this.controller?.element}get videoHeight(){return this.controller?.videoHeight}readLayerInfosFromService(e,t){return A(t)}get videoTimeExtent(){return o(s.getLogger(this),"videoTimeExtent",{replacement:"fullTimeExtent",version:"4.33",warnOnce:!0}),this.fullTimeExtent}get videoWidth(){return this.controller?.videoWidth}get volume(){return this.controller?.volume??0}set volume(e){this.controller.volume=e}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){this._trailPoints=[],this.controller.reset()}setCurrentTime(e){if(this.duration<0)return;const t=l(e,0,this.duration);this.controller.setCurrentTime(t)}toGround(e,t){return this.controller?.sensorModel?.metadataSupportsTransforms?this.controller.sensorModel.transformImageToGeo(e,t):null}toVideo(e){if(!this.controller?.sensorModel?.metadataSupportsTransforms)return null;const t=this.controller.sensorModel.transformGeoToImage(e.x,e.y,e.z);return{x:t[0],y:t[1]}}updateTelemetryColor(e){this.frameCenterSymbol=q(this.frameCenterSymbol,e)??se,this.frameOutlineSymbol=q(this.frameOutlineSymbol,e,ie)??le,this.sensorSightLineSymbol=q(this.sensorSightLineSymbol,e)??ne,this.sensorTrailSymbol=q(this.sensorTrailSymbol,e)??pe,this.sensorSymbol=q(this.sensorSymbol,e)??ae}write(e,t){return null==this.layerId?(ee(t,this,"the ArcGIS server version must be greater than 11.2."),null):super.write(e,t)}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:o}=await r(this.url,{query:{f:"json",...this.parsedUrl.query,...this.customParameters},signal:e});if(o&&(this.url=this.url.replace(/^http:/i,"https:")),!t?.currentVersion)return t.currentVersion="11.2",this.sourceJSON=t,void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});if(this.layerId??=t.layers?.[0]?.id??null,null==this.layerId)throw new i("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");const{data:s}=await r(this.parsedUrl.path,{query:{f:"json",...this.customParameters},signal:e});this.sourceJSON={...t,...s},this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl})}_setSensorTrail(e){if(!e)return;const t=D(e,this._trailPoints);this._trailPoints=[...t];const r=this._trailPoints.map(e=>e.toArray()),o=new f({hasZ:e.hasZ,paths:[r]});this.telemetry.sensorTrail=o.clone()}};e([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],ue.prototype,"autoplay",null),e([u({readOnly:!0})],ue.prototype,"buffered",null),e([u({readOnly:!0})],ue.prototype,"cameraInfo",void 0),e([u({readOnly:!0,json:{read:!1}})],ue.prototype,"capabilities",void 0),e([te("service","capabilities",["supportsAppend","supportsCoverageQuery","supportsExportClip","supportsExportFrameset","supportsMensuration","supportsPreviews","supportsUpdate"])],ue.prototype,"readCapabilitiesFromService",null),e([u({readOnly:!0})],ue.prototype,"codecs",void 0),e([u({readOnly:!0})],ue.prototype,"connectionInfo",void 0),e([te("connectionInfo",["connectionUrl"])],ue.prototype,"readConnectionInfo",null),e([u()],ue.prototype,"controller",void 0),e([u({type:String})],ue.prototype,"copyright",void 0),e([u({readOnly:!0,type:Date})],ue.prototype,"created",void 0),e([u({type:Number})],ue.prototype,"currentTime",null),e([u({json:{write:!1}})],ue.prototype,"customParameters",void 0),e([u({type:String})],ue.prototype,"description",void 0),e([u({type:Number})],ue.prototype,"duration",null),e([u({readOnly:!0})],ue.prototype,"elevationSource",void 0),e([u({type:Boolean})],ue.prototype,"ended",null),e([u({type:H})],ue.prototype,"frame",void 0),e([u(me("drawingInfo.frameCenterSymbol",X))],ue.prototype,"frameCenterSymbol",void 0),e([u({readOnly:!0,type:c})],ue.prototype,"frameCount",void 0),e([u(O)],ue.prototype,"frameEffect",void 0),e([u(x)],ue.prototype,"frameOpacity",void 0),e([u(me("drawingInfo.frameOutlineSymbol",Z))],ue.prototype,"frameOutlineSymbol",void 0),e([u({type:h})],ue.prototype,"fullExtent",void 0),e([u({readOnly:!0})],ue.prototype,"frameHorizonPoints",null),e([u({readOnly:!0,json:{read:{reader:B,source:"time"}},type:J})],ue.prototype,"fullTimeExtent",void 0),e([u({readOnly:!0})],ue.prototype,"groundControlPoints",null),e([u(U)],ue.prototype,"id",void 0),e([u({type:h})],ue.prototype,"initialExtent",void 0),e([u({readOnly:!0})],ue.prototype,"isLive",null),e([u({type:c,json:{read:!1,origins:{service:{read:{source:"id"}}}}})],ue.prototype,"layerId",void 0),e([u({readOnly:!0})],ue.prototype,"livestreamStatus",null),e([u({type:Boolean})],ue.prototype,"loop",null),e([u({readOnly:!0})],ue.prototype,"metadata",null),e([u({readOnly:!0})],ue.prototype,"mimeType",null),e([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],ue.prototype,"muted",null),e([u({type:["ArcGISVideoLayer"]})],ue.prototype,"operationalLayerType",void 0),e([u({readOnly:!0})],ue.prototype,"parsedUrl",null),e([u({type:N})],ue.prototype,"playbackInfo",void 0),e([u({type:Number})],ue.prototype,"playbackRate",null),e([u({readOnly:!0,type:String})],ue.prototype,"playerUrl",null),e([u({readOnly:!0})],ue.prototype,"playing",null),e([u({readOnly:!0,json:{read:{source:"poster"}}})],ue.prototype,"posterUrl",void 0),e([u({readOnly:!0})],ue.prototype,"qualities",void 0),e([u()],ue.prototype,"sensorSymbolOrientation",void 0),e([u(ye)],ue.prototype,"sensorSymbol",void 0),e([u(me("drawingInfo.sensorSightLineSymbol",K))],ue.prototype,"sensorSightLineSymbol",void 0),e([u(me("drawingInfo.sensorTrailSymbol",K))],ue.prototype,"sensorTrailSymbol",void 0),e([u({readOnly:!0})],ue.prototype,"serviceItemId",void 0),e([u()],ue.prototype,"sourceJSON",void 0),e([u({readOnly:!0})],ue.prototype,"sourceQuality",void 0),e([u({readOnly:!0,json:{name:"serviceType"}})],ue.prototype,"sourceType",void 0),e([u({type:v})],ue.prototype,"spatialReference",void 0),e([u({json:{write:!0}})],ue.prototype,"start",void 0),e([u({readOnly:!0})],ue.prototype,"started",null),e([u({readOnly:!0,type:String})],ue.prototype,"state",null),e([u({readOnly:!0,type:F})],ue.prototype,"telemetry",null),e([u({type:V,nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],ue.prototype,"telemetryDisplay",void 0),e([te("service","title",["name"])],ue.prototype,"readTitleFromService",null),e([te("portal-item","title")],ue.prototype,"readTitleFromPortalItem",null),e([u({type:String})],ue.prototype,"sublayerTitleMode",void 0),e([u({readOnly:!0})],ue.prototype,"type",void 0),e([u(M())],ue.prototype,"url",void 0),e([u({readOnly:!0,type:Number,json:{read:{source:"currentVersion"}}})],ue.prototype,"version",void 0),e([u({readOnly:!0})],ue.prototype,"videoElement",null),e([u({readOnly:!0})],ue.prototype,"videoHeight",null),e([u({readOnly:!0,json:{read:!1}})],ue.prototype,"videoLayersInfo",void 0),e([te("service","videoLayersInfo",["id","name","poster","serviceType","type"])],ue.prototype,"readLayerInfosFromService",null),e([u({type:J,readOnly:!0})],ue.prototype,"videoTimeExtent",null),e([u({readOnly:!0})],ue.prototype,"videoWidth",null),e([u()],ue.prototype,"volume",null),e([u({readOnly:!0})],ue.prototype,"waiting",null),ue=e([d("esri.layers.VideoLayer")],ue);const de=ue;export{de as default};
2
+ import{__decorate as e}from"tslib";import t from"../Color.js";import r from"../request.js";import{deprecatedProperty as o}from"../core/deprecate.js";import i from"../core/Error.js";import s from"../core/Logger.js";import{clamp as l}from"../core/mathUtils.js";import{MultiOriginJSONSupportMixin as n}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{watch as p,initial as m,whenOnce as y}from"../core/reactiveUtils.js";import{property as u,subclass as d}from"../core/accessorSupport/decorators.js";import{Integer as c}from"../core/accessorSupport/ensureType.js";import h from"../geometry/Extent.js";import f from"../geometry/Point.js";import v from"../geometry/Polygon.js";import g from"../geometry/Polyline.js";import S from"../geometry/SpatialReference.js";import b from"./Layer.js";import{ArcGISService as O}from"./mixins/ArcGISService.js";import{BlendLayer as j,effectProperty as T}from"./mixins/BlendLayer.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as P}from"./mixins/OperationalLayer.js";import{PortalLayer as I}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as C}from"./mixins/ScaleRangeLayer.js";import{parse as L,cleanTitle as x,titleFromUrlAndName as U}from"./support/arcgisLayerUrl.js";import{opacity as E,id as M}from"./support/commonProperties.js";import{normalizeParsedUrlObject as N,urlProperty as _}from"./support/multiLayerServiceUtils.js";import k from"./support/PlaybackInfo.js";import{getVideoLayerCapabilities as J}from"./support/serviceCapabilitiesUtils.js";import F from"./support/TelemetryData.js";import V from"./support/TelemetryDisplay.js";import R from"./support/VideoFrame.js";import H from"./support/VideoTimeExtent.js";import G from"./video/VideoController.js";import{getFrameHorizonPoints as q,getGroundControlPoints as z,getTelemetryData as A,getServiceLayersInfo as D,getStyledTelemetrySymbol as Z,getLineOfSight as B,getSensorTrailPoints as Q,readVideoTimeExtent as W}from"./video/videoUtils.js";import $ from"../symbols/CIMSymbol.js";import K from"../symbols/PictureMarkerSymbol.js";import X from"../symbols/SimpleFillSymbol.js";import Y from"../symbols/SimpleLineSymbol.js";import ee from"../symbols/SimpleMarkerSymbol.js";import te from"../symbols/Symbol.js";import{write as re}from"../symbols/support/jsonUtils.js";import{addLayerUnsupportedError as oe}from"../webdoc/support/unsupportedErrors.js";import{reader as ie}from"../core/accessorSupport/decorators/reader.js";function se(e,t){return{ignoreOrigin:this.originIdOf(t)<3}}const le=new t([255,127,0]),ne=new t([0,0,0,.05]),ae=new t([0,0,0]),pe=new ee({angle:0,color:le,size:10,style:"cross"}),me=new X({color:ne,outline:new Y({color:le,width:2})}),ye=new Y({color:ae,style:"dash",width:1}),ue=new Y({color:le,width:1}),de=new ee({angle:0,color:le,outline:{color:[255,255,255],width:1.33},size:10,style:"circle"}),ce=new Y({color:le,width:1}),he={types:{base:te,key:"type",typeMap:{"simple-marker":ee,"picture-marker":K,cim:$}},json:{name:"drawingInfo.sensorSymbol",write:{writer:re,overridePolicy:se}}};function fe(e,t){return{type:t,json:{name:e,write:{overridePolicy:se}}}}let ve=class extends(j(C(O(P(I(n(w(b)))))))){constructor(e){super(e),this._trailPoints=[],this.cameraInfo=null,this.capabilities=null,this.codecs=null,this.connectionInfo=null,this.controller=new G,this.copyright=null,this.coverage=null,this.created=null,this.customParameters=null,this.description=null,this.elevationSource=null,this.frame=null,this.frameCenterSymbol=pe.clone(),this.frameCount=null,this.frameEffect=null,this.frameOpacity=1,this.frameOutlineSymbol=me.clone(),this.fullExtent=null,this.fullTimeExtent=null,this.initialExtent=null,this.layerId=null,this.operationalLayerType="ArcGISVideoLayer",this.playbackInfo=null,this.posterUrl=null,this.qualities=null,this.sensorSymbolOrientation={source:"platformHeading",symbolOffset:0},this.sensorPathSymbol=ye.clone(),this.sensorSymbol=de.clone(),this.sensorSightLineSymbol=ue.clone(),this.sensorTrailSymbol=ce.clone(),this.serviceItemId=null,this.sourceJSON=null,this.sourceQuality=null,this.sourceType=null,this.spatialReference=S.WGS84,this.start=0,this.telemetryDisplay=new V,this.sublayerTitleMode="item-title",this.type="video",this.url=null,this.version=null,this.videoLayersInfo=null}initialize(){this.addHandles([p(()=>this.metadata,()=>{this.notifyChange("telemetry"),this.notifyChange("groundControlPoints"),this.notifyChange("frameHorizonPoints")}),p(()=>this.telemetry?.sensorLocation,e=>{this._setSensorPath(e),this._setSensorTrail(e)},m)]),y(()=>this.loaded&&"can-play"===this.state&&this.duration>0).then(()=>{this.start>=0&&this.start<=this.duration&&this.setCurrentTime(this.start)})}destroy(){this.removeAllHandles(),this.controller&&this.controller.destroy()}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Video Service"],supportsData:!0},e).catch(a).then(()=>this._fetchService(t)).then(()=>this._fetchCoverage(t));return this.addResolvingPromise(r),Promise.resolve(this)}get autoplay(){return this.controller?.autoplay??!1}set autoplay(e){this.controller.autoplay=e}get buffered(){return this.controller.buffered}readCapabilitiesFromService(e,t){return J(t)}readConnectionInfo(e,t){const r=Object.values(t.connectionUrl);return r?.length&&(this.controller.startMode="ondemand"===t.serviceType?"auto":"metadata",this.controller.playerUrl=r[0]),t.connectionUrl}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get frameHorizonPoints(){return q(this.metadata)}get groundControlPoints(){return z(this.metadata)}get isLive(){return this.controller?.isLive??!1}get livestreamStatus(){return this.controller?.livestreamStatus}get loop(){return this.controller.loop}set loop(e){this.controller.loop=e}get metadata(){return this.controller?.currentMetadata}get mimeType(){return this.controller?.mimeType}get muted(){return this.controller.muted}set muted(e){this.controller.muted=e}get parsedUrl(){return N(this)}get playbackRate(){return this.controller.rate}set playbackRate(e){this.controller.rate=e}get playerUrl(){return this.controller.playerUrl}get playing(){return this.controller.playing}get started(){return this.controller?.started??!1}get state(){return this.controller.state}get telemetry(){return A(this.metadata)}readTitleFromService(e,t){const{url:r}=this,o=t.name||(r?L(r)?.title:void 0);switch(this.sublayerTitleMode){case"item-title":if(r)return U(r,o);break;case"item-title-and-service-name":{const e=this.portalItem?.title;if(e&&e!==o)return x(e)+(o?" - "+x(o):"");break}}return o?x(o):void 0}readTitleFromPortalItem(e){return"item-title"===this.sublayerTitleMode?e:void 0}get videoElement(){return this.controller?.element}get videoHeight(){return this.controller?.videoHeight}readLayerInfosFromService(e,t){return D(t)}get videoTimeExtent(){return o(s.getLogger(this),"videoTimeExtent",{replacement:"fullTimeExtent",version:"4.33",warnOnce:!0}),this.fullTimeExtent}get videoWidth(){return this.controller?.videoWidth}get volume(){return this.controller?.volume??0}set volume(e){this.controller.volume=e}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){this._trailPoints=[],this.controller.reset()}setCurrentTime(e){if(this.duration<0)return;const t=l(e,0,this.duration);this.controller.setCurrentTime(t)}toGround(e,t){return this.controller?.sensorModel?.metadataSupportsTransforms?this.controller.sensorModel.transformImageToGeo(e,t):null}toVideo(e){if(!this.controller?.sensorModel?.metadataSupportsTransforms)return null;const t=this.controller.sensorModel.transformGeoToImage(e.x,e.y,e.z);return{x:t[0],y:t[1]}}updateTelemetryColor(e,r){if(!e)return;const o=new t(e);r&&!r?.frameCenter||(this.frameCenterSymbol=Z(this.frameCenterSymbol,o)??pe),r&&!r?.frameOutline||(this.frameOutlineSymbol=Z(this.frameOutlineSymbol,o,ne)??me),r&&!r?.lineOfSight||(this.sensorSightLineSymbol=Z(this.sensorSightLineSymbol,o)??ue),r&&!r?.sensorLocation||(this.sensorSymbol=Z(this.sensorSymbol,o)??de),r&&!r?.sensorPath||(this.sensorPathSymbol=Z(this.sensorPathSymbol,o)??ye),r&&!r?.sensorTrail||(this.sensorTrailSymbol=Z(this.sensorTrailSymbol,o)??ce)}write(e,t){return null==this.layerId?(oe(t,this,"the ArcGIS server version must be greater than 11.2."),null):super.write(e,t)}async _fetchCoverage(e){if(!this.capabilities?.operations?.supportsCoverageQuery||"number"!=typeof this.layerId)return;const t=`${this.parsedUrl.path}/coverage`,{data:o}=await r(t,{query:{f:"json",...this.customParameters},signal:e}),{area:i=null,sensorPoints:s=null,telemetry:l=null}=o,n={area:null,path:null};if(i?.rings?.length&&(n.area=v.fromJSON(i)),s?.points?.length){const e=s.points;n.path=new g({hasM:!0,hasZ:!0,paths:[e]})}if(l?.start){const{frameCenter:e=null,frameOutline:t=null,sensor:r=null}=l?.start||{};if(t&&(this.telemetry.frameOutline=v.fromJSON(t)),r&&(this.telemetry.sensorLocation=f.fromJSON(r)),e&&(this.telemetry.frameCenter=f.fromJSON(e)),r&&e){const{sensorLocation:e,frameCenter:t}=this.telemetry;this.telemetry.lineOfSight=B(e,t)}}this._set("coverage",n)}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:o}=await r(this.url,{query:{f:"json",...this.parsedUrl.query,...this.customParameters},signal:e});if(o&&(this.url=this.url.replace(/^http:/i,"https:")),!t?.currentVersion)return t.currentVersion="11.2",this.sourceJSON=t,void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});if(this.layerId??=t.layers?.[0]?.id??null,null==this.layerId)throw new i("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");const{data:s}=await r(this.parsedUrl.path,{query:{f:"json",...this.customParameters},signal:e});this.sourceJSON={...t,...s},this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl})}_setSensorTrail(e){if(!e)return;const t=Q(e,this._trailPoints);this._trailPoints=[...t];const r=this._trailPoints.map(e=>e.toArray()),o=new g({hasZ:e.hasZ,paths:[r]});this.telemetry.sensorTrail=o.clone()}_setSensorPath(e){if(!e||"polyline"!==this.coverage?.path?.type)return;const t=this.telemetry?.sensorPath??this.coverage.path.clone(),{spatialReference:r,hasZ:o,hasM:i,paths:s}=t;if(!i)return;const l=t.hasZ?3:2,n=1e3*this.currentTime,a=[];for(const p of s){let e=0;const t=p.length,r=n>500?n+1500:n;for(;e<t&&p[e][l]<=r;)e++;e<p.length&&a.push(...p.slice(e))}this.telemetry.sensorPath=new g({hasZ:o,hasM:i,paths:[a],spatialReference:r})}};e([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],ve.prototype,"autoplay",null),e([u({readOnly:!0})],ve.prototype,"buffered",null),e([u({readOnly:!0})],ve.prototype,"cameraInfo",void 0),e([u({readOnly:!0,json:{read:!1}})],ve.prototype,"capabilities",void 0),e([ie("service","capabilities",["supportsAppend","supportsCoverageQuery","supportsExportClip","supportsExportFrameset","supportsMensuration","supportsPreviews","supportsUpdate"])],ve.prototype,"readCapabilitiesFromService",null),e([u({readOnly:!0})],ve.prototype,"codecs",void 0),e([u({readOnly:!0})],ve.prototype,"connectionInfo",void 0),e([ie("connectionInfo",["connectionUrl"])],ve.prototype,"readConnectionInfo",null),e([u()],ve.prototype,"controller",void 0),e([u({type:String})],ve.prototype,"copyright",void 0),e([u({readOnly:!0})],ve.prototype,"coverage",void 0),e([u({readOnly:!0,type:Date})],ve.prototype,"created",void 0),e([u({type:Number})],ve.prototype,"currentTime",null),e([u({json:{write:!1}})],ve.prototype,"customParameters",void 0),e([u({type:String})],ve.prototype,"description",void 0),e([u({type:Number})],ve.prototype,"duration",null),e([u({readOnly:!0})],ve.prototype,"elevationSource",void 0),e([u({type:Boolean})],ve.prototype,"ended",null),e([u({type:R})],ve.prototype,"frame",void 0),e([u(fe("drawingInfo.frameCenterSymbol",ee))],ve.prototype,"frameCenterSymbol",void 0),e([u({readOnly:!0,type:c})],ve.prototype,"frameCount",void 0),e([u(T)],ve.prototype,"frameEffect",void 0),e([u(E)],ve.prototype,"frameOpacity",void 0),e([u(fe("drawingInfo.frameOutlineSymbol",X))],ve.prototype,"frameOutlineSymbol",void 0),e([u({type:h})],ve.prototype,"fullExtent",void 0),e([u({readOnly:!0})],ve.prototype,"frameHorizonPoints",null),e([u({readOnly:!0,json:{read:{reader:W,source:"time"}},type:H})],ve.prototype,"fullTimeExtent",void 0),e([u({readOnly:!0})],ve.prototype,"groundControlPoints",null),e([u(M)],ve.prototype,"id",void 0),e([u({type:h})],ve.prototype,"initialExtent",void 0),e([u({readOnly:!0})],ve.prototype,"isLive",null),e([u({type:c,json:{read:!1,origins:{service:{read:{source:"id"}}}}})],ve.prototype,"layerId",void 0),e([u({readOnly:!0})],ve.prototype,"livestreamStatus",null),e([u({type:Boolean})],ve.prototype,"loop",null),e([u({readOnly:!0})],ve.prototype,"metadata",null),e([u({readOnly:!0})],ve.prototype,"mimeType",null),e([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],ve.prototype,"muted",null),e([u({type:["ArcGISVideoLayer"]})],ve.prototype,"operationalLayerType",void 0),e([u({readOnly:!0})],ve.prototype,"parsedUrl",null),e([u({type:k})],ve.prototype,"playbackInfo",void 0),e([u({type:Number})],ve.prototype,"playbackRate",null),e([u({readOnly:!0,type:String})],ve.prototype,"playerUrl",null),e([u({readOnly:!0})],ve.prototype,"playing",null),e([u({readOnly:!0,json:{read:{source:"poster"}}})],ve.prototype,"posterUrl",void 0),e([u({readOnly:!0})],ve.prototype,"qualities",void 0),e([u()],ve.prototype,"sensorSymbolOrientation",void 0),e([u(fe("drawingInfo.sensorPathSymbol",Y))],ve.prototype,"sensorPathSymbol",void 0),e([u(he)],ve.prototype,"sensorSymbol",void 0),e([u(fe("drawingInfo.sensorSightLineSymbol",Y))],ve.prototype,"sensorSightLineSymbol",void 0),e([u(fe("drawingInfo.sensorTrailSymbol",Y))],ve.prototype,"sensorTrailSymbol",void 0),e([u({readOnly:!0})],ve.prototype,"serviceItemId",void 0),e([u()],ve.prototype,"sourceJSON",void 0),e([u({readOnly:!0})],ve.prototype,"sourceQuality",void 0),e([u({readOnly:!0,json:{name:"serviceType"}})],ve.prototype,"sourceType",void 0),e([u({type:S})],ve.prototype,"spatialReference",void 0),e([u({json:{write:!0}})],ve.prototype,"start",void 0),e([u({readOnly:!0})],ve.prototype,"started",null),e([u({readOnly:!0,type:String})],ve.prototype,"state",null),e([u({readOnly:!0,type:F})],ve.prototype,"telemetry",null),e([u({type:V,nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],ve.prototype,"telemetryDisplay",void 0),e([ie("service","title",["name"])],ve.prototype,"readTitleFromService",null),e([ie("portal-item","title")],ve.prototype,"readTitleFromPortalItem",null),e([u({type:String})],ve.prototype,"sublayerTitleMode",void 0),e([u({readOnly:!0})],ve.prototype,"type",void 0),e([u(_())],ve.prototype,"url",void 0),e([u({readOnly:!0,type:Number,json:{read:{source:"currentVersion"}}})],ve.prototype,"version",void 0),e([u({readOnly:!0})],ve.prototype,"videoElement",null),e([u({readOnly:!0})],ve.prototype,"videoHeight",null),e([u({readOnly:!0,json:{read:!1}})],ve.prototype,"videoLayersInfo",void 0),e([ie("service","videoLayersInfo",["id","name","poster","serviceType","type"])],ve.prototype,"readLayerInfosFromService",null),e([u({type:H,readOnly:!0})],ve.prototype,"videoTimeExtent",null),e([u({readOnly:!0})],ve.prototype,"videoWidth",null),e([u()],ve.prototype,"volume",null),e([u({readOnly:!0})],ve.prototype,"waiting",null),ve=e([d("esri.layers.VideoLayer")],ve);const ge=ve;export{ge as default};
@@ -4,6 +4,7 @@ import type SpatialReference from "../../geometry/SpatialReference.js";
4
4
  import type Layer from "../Layer.js";
5
5
  import type DisplayFilterInfo from "../support/DisplayFilterInfo.js";
6
6
  import type Field from "../support/Field.js";
7
+ import type FieldConfiguration from "../support/FieldConfiguration.js";
7
8
  import type FieldsIndex from "../support/FieldsIndex.js";
8
9
  import type GeometryFieldsInfo from "../support/GeometryFieldsInfo.js";
9
10
  import type LabelClass from "../support/LabelClass.js";
@@ -32,6 +33,7 @@ import type { TimeZone } from "../../time/types.js";
32
33
  import type { ObjectId } from "../../views/types.js";
33
34
  import type { AttributeTableTemplateProperties } from "../../tables/AttributeTableTemplate.js";
34
35
  import type { ElevationInfoProperties } from "../../symbols/support/ElevationInfo.js";
36
+ import type { FieldConfigurationProperties } from "../support/FieldConfiguration.js";
35
37
  import type { LabelClassProperties } from "../support/LabelClass.js";
36
38
  import type { PopupTemplateProperties } from "../../PopupTemplate.js";
37
39
  import type { HeatmapRendererProperties } from "../../renderers/HeatmapRenderer.js";
@@ -68,6 +70,58 @@ export interface CatalogFootprintLayerProperties extends LayerProperties, BlendL
68
70
  * > If the elevation info is not specified, the effective elevation depends on the context and could vary per graphic.
69
71
  */
70
72
  elevationInfo?: ElevationInfoProperties | null;
73
+ /**
74
+ * An array of [FieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/) objects that control how fields are displayed in popups and other UI elements. Each object specifies options for an individual field, such as its display name, via `alias`, and formatting rules, via `fieldFormat`. Assign this property before the layer loads to ensure the configurations take effect. For more information, see the [FieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/) documentation.
75
+ * If no field configurations are provided, they are automatically created when a [popupTemplate](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#popupTemplate) is assigned to the layer. If no [popupTemplate](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#popupTemplate) is set, you can manually define field configurations to customize how fields are shown.
76
+ * > [!WARNING]
77
+ * >
78
+ * > Support is limited in version 5.1. For details, see the [FieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/) documentation.
79
+ *
80
+ * To modify field configurations, clone [fieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#fieldConfigurations), make the changes, and then reassign the updated clone back to [fieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#fieldConfigurations).
81
+ *
82
+ * @since 5.1
83
+ * @see [CatalogFootprintLayer.getFieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#getFieldConfiguration)
84
+ * @see [CatalogFootprintLayer.getFieldAlias](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#getFieldAlias)
85
+ * @example
86
+ * // Adding a new field configuration
87
+ * const addNewConfig = (layer, fieldName, alias, fieldFormat) => {
88
+ * // Check if there is already an existing configuration for fieldName
89
+ * const existingConfig = layer.getFieldConfiguration(fieldName);
90
+ * if (!existingConfig) {
91
+ * const newConfig = new FieldConfiguration({ name: fieldName, alias, fieldFormat });
92
+ * const newConfigs = clone(layer.fieldConfigurations);
93
+ * newConfigs.push(newConfig);
94
+ * layer.fieldConfigurations = newConfigs;
95
+ * }
96
+ * };
97
+ * @example
98
+ * // Updating an existing field configuration
99
+ * const updateConfig = (layer, fieldName, alias, fieldFormat) => {
100
+ * const existingConfig = layer.getFieldConfiguration(fieldName);
101
+ * if (existingConfig) {
102
+ * const newConfig = existingConfig.clone();
103
+ * newConfig.alias = alias;
104
+ * newConfig.fieldFormat = fieldFormat;
105
+ *
106
+ * const index = layer.fieldConfigurations.indexOf(existingConfig);
107
+ * const newConfigs = clone(layer.fieldConfigurations);
108
+ * newConfigs[index] = newConfig;
109
+ * layer.fieldConfigurations = newConfigs;
110
+ * }
111
+ * };
112
+ * @example
113
+ * // Deleting an existing field configuration
114
+ * const deleteConfig = (layer, fieldName) => {
115
+ * const existingConfig = layer.getFieldConfiguration(fieldName);
116
+ * if (existingConfig) {
117
+ * const index = layer.fieldConfigurations.indexOf(existingConfig);
118
+ * var newConfigs = clone(layer.fieldConfigurations);
119
+ * newConfigs.splice(index, 1);
120
+ * layer.fieldConfigurations = newConfigs;
121
+ * }
122
+ * };
123
+ */
124
+ fieldConfigurations?: FieldConfigurationProperties[] | null;
71
125
  /**
72
126
  * The label definition for this layer, specified as an array of
73
127
  * [LabelClass](https://developers.arcgis.com/javascript/latest/references/core/layers/support/LabelClass/). Use this property to specify
@@ -253,6 +307,59 @@ export default class CatalogFootprintLayer extends CatalogFootprintLayerSupercla
253
307
  */
254
308
  get elevationInfo(): ElevationInfo | null | undefined;
255
309
  set elevationInfo(value: ElevationInfoProperties | null | undefined);
310
+ /**
311
+ * An array of [FieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/) objects that control how fields are displayed in popups and other UI elements. Each object specifies options for an individual field, such as its display name, via `alias`, and formatting rules, via `fieldFormat`. Assign this property before the layer loads to ensure the configurations take effect. For more information, see the [FieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/) documentation.
312
+ * If no field configurations are provided, they are automatically created when a [popupTemplate](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#popupTemplate) is assigned to the layer. If no [popupTemplate](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#popupTemplate) is set, you can manually define field configurations to customize how fields are shown.
313
+ * > [!WARNING]
314
+ * >
315
+ * > Support is limited in version 5.1. For details, see the [FieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/) documentation.
316
+ *
317
+ * To modify field configurations, clone [fieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#fieldConfigurations), make the changes, and then reassign the updated clone back to [fieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#fieldConfigurations).
318
+ *
319
+ * @since 5.1
320
+ * @see [CatalogFootprintLayer.getFieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#getFieldConfiguration)
321
+ * @see [CatalogFootprintLayer.getFieldAlias](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#getFieldAlias)
322
+ * @example
323
+ * // Adding a new field configuration
324
+ * const addNewConfig = (layer, fieldName, alias, fieldFormat) => {
325
+ * // Check if there is already an existing configuration for fieldName
326
+ * const existingConfig = layer.getFieldConfiguration(fieldName);
327
+ * if (!existingConfig) {
328
+ * const newConfig = new FieldConfiguration({ name: fieldName, alias, fieldFormat });
329
+ * const newConfigs = clone(layer.fieldConfigurations);
330
+ * newConfigs.push(newConfig);
331
+ * layer.fieldConfigurations = newConfigs;
332
+ * }
333
+ * };
334
+ * @example
335
+ * // Updating an existing field configuration
336
+ * const updateConfig = (layer, fieldName, alias, fieldFormat) => {
337
+ * const existingConfig = layer.getFieldConfiguration(fieldName);
338
+ * if (existingConfig) {
339
+ * const newConfig = existingConfig.clone();
340
+ * newConfig.alias = alias;
341
+ * newConfig.fieldFormat = fieldFormat;
342
+ *
343
+ * const index = layer.fieldConfigurations.indexOf(existingConfig);
344
+ * const newConfigs = clone(layer.fieldConfigurations);
345
+ * newConfigs[index] = newConfig;
346
+ * layer.fieldConfigurations = newConfigs;
347
+ * }
348
+ * };
349
+ * @example
350
+ * // Deleting an existing field configuration
351
+ * const deleteConfig = (layer, fieldName) => {
352
+ * const existingConfig = layer.getFieldConfiguration(fieldName);
353
+ * if (existingConfig) {
354
+ * const index = layer.fieldConfigurations.indexOf(existingConfig);
355
+ * var newConfigs = clone(layer.fieldConfigurations);
356
+ * newConfigs.splice(index, 1);
357
+ * layer.fieldConfigurations = newConfigs;
358
+ * }
359
+ * };
360
+ */
361
+ get fieldConfigurations(): FieldConfiguration[] | null | undefined;
362
+ set fieldConfigurations(value: FieldConfigurationProperties[] | null | undefined);
256
363
  /**
257
364
  * An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer.
258
365
  * For example, a field named `POP_2015`, stores information about total population as a numeric value for each feature; this value represents the total number
@@ -484,6 +591,19 @@ export default class CatalogFootprintLayer extends CatalogFootprintLayerSupercla
484
591
  * }
485
592
  */
486
593
  get useViewTime(): boolean;
594
+ /**
595
+ * Creates default field configuration objects that define the display properties of fields.
596
+ * These field configurations are generated from the layer's [fields](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#fields) property.
597
+ *
598
+ * @returns An array of field configuration objects, or `null` if the layer does not have any fields that require formatting.
599
+ * @since 5.1
600
+ * @see [CatalogFootprintLayer.fieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#fieldConfigurations)
601
+ * @returns An array of field configuration objects, or `null` if the layer does not have any fields that require formatting.
602
+ * @example
603
+ * const fieldConfigs = layer.createFieldConfigurations();
604
+ * layer.fieldConfigurations = fieldConfigs;
605
+ */
606
+ createFieldConfigurations(): FieldConfiguration[] | null | undefined;
487
607
  /**
488
608
  * Creates a popup template for the layer, populated with all the fields of the layer.
489
609
  *
@@ -556,6 +676,33 @@ export default class CatalogFootprintLayer extends CatalogFootprintLayerSupercla
556
676
  * @see [fields](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#fields)
557
677
  */
558
678
  getField(fieldName: string): Field | null | undefined;
679
+ /**
680
+ * Returns the alias of the specified field. Previously, this value was commonly retrieved from [Layer.popupTemplate.fieldInfos[x].label](https://developers.arcgis.com/javascript/latest/references/core/popup/FieldInfo/#label) or [Layer.fields[x].alias](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#alias). While these properties are still supported, this method is now the recommended approach for obtaining a field's alias.
681
+ *
682
+ * The alias is resolved in the following order:
683
+ *
684
+ * 1. [Field configuration alias](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#fieldConfigurations)
685
+ * 2. [Field alias](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#fields) defined on the field.
686
+ *
687
+ * @param fieldName - The name of the field for which to get the alias.
688
+ * @returns The alias of the specified field.
689
+ * @since 5.1
690
+ * @see [CatalogFootprintLayer.fieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#fieldConfigurations)
691
+ * @see [CatalogFootprintLayer.getFieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#getFieldConfiguration)
692
+ */
693
+ getFieldAlias(fieldName: string): string | null | undefined;
694
+ /**
695
+ * Returns the [FieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/) for the specified field. The field configuration provides optional formatting and display information for the field.
696
+ *
697
+ * Previously, field formatting was commonly retrieved from [Layer.popupTemplate.fieldInfos[x].format](https://developers.arcgis.com/javascript/latest/references/core/popup/FieldInfo/#format). This is no longer needed, instead use [Layer.getFieldConfiguration(fieldname).fieldFormat](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/#fieldFormat) to retrieve the field configuration formatting.
698
+ *
699
+ * @param fieldName - The name of the field for which to get the configuration.
700
+ * @returns The field configuration of the specified field.
701
+ * @since 5.1
702
+ * @see [CatalogFootprintLayer.fieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#fieldConfigurations)
703
+ * @see [CatalogFootprintLayer.getFieldAlias](https://developers.arcgis.com/javascript/latest/references/core/layers/catalog/CatalogFootprintLayer/#getFieldAlias)
704
+ */
705
+ getFieldConfiguration(fieldName: string): FieldConfiguration | null | undefined;
559
706
  /**
560
707
  * Returns the [Domain](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Domain/) associated with the given field name. The domain can be either a
561
708
  * [CodedValueDomain](https://developers.arcgis.com/javascript/latest/references/core/layers/support/CodedValueDomain/) or [RangeDomain](https://developers.arcgis.com/javascript/latest/references/core/layers/support/RangeDomain/).
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{Loadable as e}from"../../../core/Loadable.js";import r from"../../../core/Logger.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import{open as o}from"../../../core/workers.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../../../geometry/Extent.js";import{toParquetJSONGeometryType as u}from"../../support/parquetUtils.js";import l from"../../../rest/support/FeatureSet.js";let c=class extends e{constructor(t){super(t),this.type="parquet"}load(t){const e=null!=t?t.signal:null;return this.addResolvingPromise(this._initialize(e)),Promise.resolve(this)}destroy(){this._connection?.destroy()}async openPorts(){return await this.load(),this._connection.openPorts()}setCustomParameters(t){this._proxy.setCustomParameters(t).catch(()=>{r.getLogger(this).warn("Failed to update customParameters")})}async updateFiles(t){await this._proxy.updateFiles(t)}async queryFeaturesJSON(t,e={}){return await this.load(e),this._proxy.queryFeatures(t.toJSON(),{signal:e?.signal})}async queryFeatures(t,e={}){const r=await this.queryFeaturesJSON(t,{signal:e?.signal});return l.fromJSON(r)}async queryObjectIds(t,e){return await this._proxy.queryObjectIds(t.toJSON(),{signal:e?.signal})}async queryFeatureCount(t,e){return this._proxy.queryFeatureCount(t.toJSON(),{signal:e?.signal})}async queryExtent(t,e){if(null==this.layer.geometryEncoding)return r.getLogger(this).warn("Tried to queryExtent, but source does not have a geometry. Returning null extent."),{count:0,extent:null};const s=await this._proxy.queryExtent(t.toJSON(),{signal:e?.signal});return{count:s.count,extent:n.fromJSON(s.extent)}}async _initialize(t){this._connection=await o("ParquetSourceWorker",{strategy:"dedicated",signal:t,registryTarget:this}),s(t),this._proxy=this._connection.createInvokeProxy();const{layerDefinition:e,capabilities:r}=await this._proxy.load({urls:this.layer.urls.items,fields:this.layer.fields?.map(t=>t.toJSON()),geometryType:this.layer.geometryType?u(this.layer.geometryType):null,spatialReference:this.layer.spatialReference?.toJSON(),geometryEncoding:this.layer.geometryEncoding?.toJSON(),displayOptimization:this.layer.displayOptimization,customParameters:this.layer.customParameters});s(t),this.sourceJSON=e,this.capabilities=r}};t([i()],c.prototype,"type",void 0),t([i({constructOnly:!0})],c.prototype,"layer",void 0),t([i()],c.prototype,"sourceJSON",void 0),t([i()],c.prototype,"capabilities",void 0),c=t([a("esri.layers.graphics.sources.ParquetSource")],c);export{c as ParquetSource};
2
+ import{__decorate as t}from"tslib";import{Loadable as e}from"../../../core/Loadable.js";import r from"../../../core/Logger.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import{watch as o}from"../../../core/reactiveUtils.js";import{open as i}from"../../../core/workers.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import l from"../../../geometry/Extent.js";import{resolveParquetDataUrls as u,toParquetJSONGeometryType as y}from"../../support/parquetUtils.js";import c from"../../../rest/support/FeatureSet.js";let p=class extends e{constructor(t){super(t),this.type="parquet",this.resolvedUrls=[]}load(t){const e=null!=t?t.signal:null;return this.addResolvingPromise(this._initialize(e)),this.addHandles([o(()=>"files"===this.layer.data?.type?this.layer.data.urls:null,t=>this.updateFiles(t?.items??[])),o(()=>this.layer.customParameters,t=>this.setCustomParameters(t))]),Promise.resolve(this)}destroy(){this._connection?.destroy()}async openPorts(){return await this.load(),this._connection.openPorts()}setCustomParameters(t){this._proxy.setCustomParameters(t).catch(()=>{r.getLogger(this).warn("Failed to update customParameters")})}async updateFiles(t){await this._proxy.updateFiles(t)}async queryFeaturesJSON(t,e={}){return await this.load(e),this._proxy.queryFeatures(t.toJSON(),{signal:e?.signal})}async queryFeatures(t,e={}){const r=await this.queryFeaturesJSON(t,{signal:e?.signal});return c.fromJSON(r)}async queryObjectIds(t,e){return await this._proxy.queryObjectIds(t.toJSON(),{signal:e?.signal})}async queryFeatureCount(t,e){return this._proxy.queryFeatureCount(t.toJSON(),{signal:e?.signal})}async queryExtent(t,e){if(null==this.layer.geometryEncoding)return r.getLogger(this).warn("Tried to queryExtent, but source does not have a geometry. Returning null extent."),{count:0,extent:null};const s=await this._proxy.queryExtent(t.toJSON(),{signal:e?.signal});return{count:s.count,extent:l.fromJSON(s.extent)}}async _initialize(t){const e=await u(this.layer.data,{signal:t});s(t),this._connection=await i("ParquetSourceWorker",{strategy:"dedicated",signal:t,registryTarget:this}),s(t),this._proxy=this._connection.createInvokeProxy();const{layerDefinition:r,capabilities:o}=await this._proxy.load({urls:e,fields:this.layer.fields?.map(t=>t.toJSON()),geometryType:this.layer.geometryType?y(this.layer.geometryType):null,spatialReference:this.layer.spatialReference?.toJSON(),geometryEncoding:this.layer.geometryEncoding?.toJSON(),displayOptimization:this.layer.displayOptimization,customParameters:this.layer.customParameters});s(t),this.sourceJSON=r,this.capabilities=o,this.resolvedUrls=e}};t([a()],p.prototype,"type",void 0),t([a({constructOnly:!0})],p.prototype,"layer",void 0),t([a()],p.prototype,"sourceJSON",void 0),t([a()],p.prototype,"capabilities",void 0),t([a()],p.prototype,"resolvedUrls",void 0),p=t([n("esri.layers.graphics.sources.ParquetSource")],p);export{p as ParquetSource};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__addDisposableResource as e,__disposeResources as t}from"tslib";import r from"../../../../core/Collection.js";import{toConst as s}from"../../../../core/compilerUtils.js";import i from"../../../../core/Error.js";import has from"../../../../core/has.js";import o from"../../../../core/Logger.js";import{onAbortOrThrow as a,throwIfAborted as n}from"../../../../core/promiseUtils.js";import{QueueProcessor as u}from"../../../../core/QueueProcessor.js";import{parseWhereClause as p}from"../../../../core/sql.js";import l from"../../../../geometry/SpatialReference.js";import{set as c,create as d,expandWithRect as f,expandWithAABB as m,negativeInfinity as y,fromRect as h}from"../../../../geometry/support/aaBoundingBox.js";import{getQueryResultExtent as g,QueryEngine as w}from"../../data/QueryEngine.js";import{QueryEngineResult as _}from"../../data/QueryEngineResult.js";import{normalizeQueryLike as I}from"../../data/queryUtils.js";import{createDrawingInfo as F}from"./clientSideDefaults.js";import{getParquetFileId as x,getParquetRowId as R}from"./parquetIdUtils.js";import S from"../../../support/Field.js";import q from"../../../support/FieldsIndex.js";import{fromParquetGeometryEncodingJSON as C}from"../../../support/parquetEncodingUtils.js";import{completeParquetLayerInfo as E,fromParquetJSONGeometryType as v,toParquetJSONGeometryType as b}from"../../../support/parquetUtils.js";import{loadParquetModule as O}from"../../../../libs/parquet/loadParquetModule.js";import{createParquetFile as Q,readGeoMetadata as T}from"../../../../libs/parquet/parquet.js";import{FeatureStoreQueryAdapter as j}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as P}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as M}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as A}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as G}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const B=new j,D=4,z="__OBJECTID",W=new TextDecoder;class U{constructor(){this._fileInfos=new Map,this._queue=new u({concurrency:D,process:(e,t)=>this._executeQuery(e,t)}),this._indexMap={}}async load(s){const a=s.spatialReference?l.fromJSON(s.spatialReference):void 0;if(a&&!a.isWGS84&&!a.isWebMercator)throw new i("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");const n=await E({urls:new r(s.urls),fields:s.fields?.map(e=>S.fromJSON(e)),geometryEncoding:s.geometryEncoding?C(s.geometryEncoding):null,geometryType:s.geometryType?v(s.geometryType):null,displayOptimization:s.displayOptimization,spatialReference:a},{customParameters:s.customParameters});if(!n.fields)throw new i("parquet:unsupported","Fields must be defined");let u;if(n.spatialReference&&n.geometryType){if(!n.spatialReference)throw new i("parquet:unsupported","SpatialReference must be defined");if(!n.spatialReference.isGeographic&&!n.spatialReference.isWebMercator)throw new i("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");n.spatialReference.isGeographic&&!n.spatialReference.isWGS84&&(o.getLogger("parquet:unsupported-projection").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",{spatialReference:n.spatialReference}),n.spatialReference=l.WGS84),u={geometry:n.geometryEncoding?{geometryType:b(n.geometryType),spatialReference:n.spatialReference.toJSON(),encoding:n.geometryEncoding.toJSON()}:null,displayOptimization:n.displayOptimization}}this.setCustomParameters(s.customParameters),this._geometryInfo=u;const p=s.urls;for(const e of p)this._addFile(e);this._capabilities=H(await this.getFileStatistics());const m=this._fileInfos.values().next().value;if(!m)return{layerDefinition:{},capabilities:H(null)};const h=await m,{fields:g}=n;if(null==g)throw new i("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer fields",g);g.push(new S({name:z,type:"oid",alias:z}));for(const e of g){const t=h.file.columnForFieldName(e.name);null!=t&&(this._indexMap[e.name]=t)}const w=new q(g.map(e=>e.toJSON()));this._fieldsIndex=w;const _=b(n.geometryType??"point");if(this._metadata=A.createFeature({fieldsIndex:w.toJSON(),geometryType:_,hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:"rowId"},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:n.spatialReference,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:_,featureIdInfo:{type:"object-id",fieldName:"rowId"},hasM:!1,hasZ:!1,spatialReference:n.spatialReference?.toJSON()??{wkid:4326},aggregateAdapter:null,timeInfo:null,definitionExpression:null},n.spatialReference){const e=await this.getFileInfos();this._fullExtent=V(e,n.spatialReference.toJSON())}if(null==this._fullExtent&&"location"===n.geometryEncoding?.type){const{xField:r,yField:s}=n.geometryEncoding,i=c(d(),y);for(const o of await this.getFileInfos())for(const a of o.file.rowGroups()){const o={stack:[],error:void 0,hasError:!1};try{const t=e(o,a.columnDescriptorForAttribute(r),!1),n=e(o,a.columnDescriptorForAttribute(s),!1),u=[t.minValue(),n.minValue(),t.maxValue(),n.maxValue()];f(i,u),a.free()}catch(I){o.error=I,o.hasError=!0}finally{t(o)}}this._fullExtent={xmin:i[0],ymin:i[1],xmax:i[3],ymax:i[4],spatialReference:n.spatialReference?.toJSON()}}return{capabilities:this._capabilities,layerDefinition:{fields:n.fields?.map(e=>e.toJSON()),drawingInfo:F(_),extent:this._fullExtent??void 0,geometryType:_,geometryEncoding:n.geometryEncoding?.toJSON(),displayOptimization:n.displayOptimization}}}destroy(){for(const e of this._fileInfos.values())e.then(e=>e.file.free);this._fileInfos.clear(),this._queue.destroy()}setCustomParameters(e){this._customParameters=e}getIndexMap(){return this._indexMap}async getFileId(e){const t=this._fileInfos.get(e);if(!t)throw new Error(`InternalError: File ${e} does not exist`);return(await t).id}async getFileInfo(e){const t=this._fileInfos.get(e);if(!t)throw new Error(`InternalError: File ${e} does not exist`);return t}async getFileInfos(){return Promise.all(Array.from(this._fileInfos.values()))}async getFileStatistics(){if(!this._fileInfos.size)return null;const e=(await this.getFileInfos()).reduce((e,t)=>e+t.file.byteLength(),0);return{featureCount:await this._getFeatureCount(),byteLength:e}}async updateFiles(e){const t=new Set(e);for(const[r,s]of this._fileInfos.entries())t.has(r)?t.delete(r):(s.then(e=>e.file.free()),this._fileInfos.delete(r));await Promise.all(Array.from(t.values()).map(e=>this._addFile(e)))}async queryFeatures(e,t){this._validateQuery(e),Z(e)||(e.resultRecordCount=e.resultRecordCount?Math.min(e.resultRecordCount,8e3):8e3,e.resultOffset=e.resultOffset??0),(e.outStatistics||e.returnDistinctValues)&&(e.returnGeometry=void 0);return(await this._enqueueQuery(e,t)).createQueryResponse()}async queryFeatureCount(e,t){const r=await I(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),!N(r))return this._getFeatureCount();r.outFields=void 0,r.returnGeometry=void 0;return(await this._enqueueQuery(r,t)).createQueryResponseForCount()}async queryObjectIds(e,t){const r=await I(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),!N(r))return Array.from({length:await this._getFeatureCount()},(e,t)=>t);r.resultRecordCount=r.resultRecordCount?Math.min(r.resultRecordCount,8e3):8e3,r.resultOffset=r.resultOffset??0,r.returnGeometry=void 0,r.outFields=void 0;return(await this._enqueueQuery(r,t)).items.map(e=>e.getObjectId())}async queryExtent(e,t){const r=await I(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),this._fullExtent&&!N(r))return{count:await this._getFeatureCount(),extent:this._fullExtent};const i=s(this._metadata.spatialReference);r.returnGeometry=!0,r.outFields=void 0;const o=c(d(),y),a=d(),n=await this._enqueueQuery(r,t);let u=0;for(const s of n.items)s.getBounds(a)&&(m(o,a),u+=1);return{count:u,extent:g(o,i,r.outSR?s(r.outSR):i,i,!1)}}async queryStream(e,t,r){if(!r.signal)throw new Error("InternalError: AbortSignal must be passed");const s=await this.getFileInfo(e),i=(await O()).Query.new();"tile"===t.type&&(i.setExtent(t.extent),i.setQuantizationTransform(t.transform),i.setScale(t.scale)),i.setOutFields(t.outFields.filter(e=>null!=this._indexMap[e])),i.setOutSpatialReference(t.outSpatialReference.wkid),i.setReturnGeometry(!0),t.where&&await this._setWhereClause(i,s.file,t.where);const o=await s.file.executeQuery(i,r.signal),n=s.streamIdCounter++,u=a(r.signal,e=>{const t=s.streams.get(n);null!=t&&(t.handle.remove(),s.streams.delete(n))});return s.streams.set(n,{stream:o,handle:u}),n}async getStreamNext(e,t,r){if(!r.signal)throw new Error("InternalError: AbortSignal must be passed");const s=await this.getFileInfo(e),i=s.streams.get(t);if(!i)return null;const o=await i.stream.next(r.signal);return null==o&&(i.handle.remove(),s.streams.delete(t)),o?.serialize().buffer}async createPatch(e,t,r,s,i){if(!i.signal)throw new Error("InternalError: AbortSignal must be passed");const o=await this.getFileInfo(e);return(await o.file.createChunkPatch(t,r,s,i.signal)).serialize().buffer}async _getFile(e){for(const t of await this.getFileInfos())if(t.id===e)return t.file;throw new Error(`InternalError: File ${e} does not exist`)}_addFile(e){const t=this._fileInfos.size;this._fileInfos.set(e,this._createFileInfo(e,t))}async _createFileInfo(e,t){return{id:t,file:await Q(e,{geometryInfo:this._geometryInfo,getCustomParameters:()=>this._customParameters}),streamIdCounter:0,streams:new Map}}async _getFeatureCount(){return(await this.getFileInfos()).reduce((e,t)=>e+t.file.numRows(),0)}_validateQuery(e){if(!this._capabilities.query.supportsStatistics&&e.outStatistics)throw new i("parquet:unsupported","Statistics queries are not supported",{query:e});if(!this._capabilities.query.supportsOrderBy&&e.orderByFields?.length)throw new i("parquet:unsupported","Queries using orderBy are not supported",{query:e});if(!this._capabilities.query.supportsDistinct&&e.returnDistinctValues)throw new i("parquet:unsupported","Queries using returnDistinctValues are not supported",{query:e})}async _setWhereClause(e,t,r){const s=this._indexMap,o=this._fieldsIndex,a={getAttribute(e,r){const i=t.readAttribute(e.rowGroup,e.row,s[r]);if(null==i)return null;const a=o.get(r);return"esriFieldTypeString"===a.type||"esriFieldTypeDateOnly"===a.type||"esriFieldTypeTimeOnly"===a.type||"esriFieldTypeTimestampOffset"===a.type?W.decode(i):i}},n=await p(r,this._fieldsIndex);if(!n.isStandardized)throw new i("sql-parse-error","expression is not standardized");const u=(e,t)=>n.testFeatureCompiled({rowGroup:e,row:t},a,null);e.setWhere(r),e.setWhereEvaluator(u),e.setWhereFields(n.fieldNames)}async*_fetchChunks(e,t){const r=await O();for(const s of await this.getFileInfos()){const i=r.Query.new();i.setOutFields(e.fields),i.setReturnGeometry(e.returnGeometry),e.where&&await this._setWhereClause(i,s.file,e.where);const o=await s.file.executeQuery(i),a=[],u=o.next(t);for(let e=0;e<D;e++)a.push(o.next(t));let p=await u;for(;null!=p;){n(t);const e=new G(this._metadata,this._indexMap,p,s.id),r=k([new P(e,null,0,!1)],this._queryEngineParams),i=a.shift();a.push(o.next(t)),yield r,p=await i}}}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){const r=await this._getReadParams(e);if(e.where=void 0,e.objectIds?.length){const r=new Map;for(const t of e.objectIds){const e=x(t),s=R(t);let i=r.get(e);i||(i=[],r.set(e,i)),i.push(s)}const s=[];for(const[i,o]of r.entries()){const r=await this._executeFileIdQuery(e,i,o,t);for(const e of r)s.push(e)}return new _(s,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:B,featureIdInfo:this._queryEngineParams.featureIdInfo})}let s=e.resultRecordCount??await this._getFeatureCount(),i=e.resultOffset??0;e.resultRecordCount=void 0,e.resultOffset=void 0;const o=[];for await(const a of this._fetchChunks(r,t)){const r=await a.executeQueryForOpaqueFeatures(e,t);if(r.length>i){const t=r.slice(i,Math.min(i+s,r.length));for(const e of t)o.push(e);if(i=0,s-=t.length,0===s)return new _(o,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:B,featureIdInfo:this._queryEngineParams.featureIdInfo})}else i-=r.length}return new _(o,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:B,featureIdInfo:this._queryEngineParams.featureIdInfo})}async _executeFileIdQuery(e,t,r,s){const i=await this._getReadParams(e),o=(await O()).Query.new();o.setOutFields(i.fields),o.setReturnGeometry(i.returnGeometry),o.setIds(new Uint32Array(r));const a=await this._getFile(t),n=await a.executeQuery(o,s);let u=await n.next(s),p=0;const l=[];for(;null!=u;){const e=new G(this._metadata,this._indexMap,u,t),r=new P(e,null,p++,!1);l.push(r),u=await n.next(s)}return k(l,this._queryEngineParams).executeQueryForOpaqueFeatures(e,s)}async _getReadParams(e){const t=new Set;if(e.outStatistics)for(const r of e.outStatistics)null!=r.onStatisticField&&t.add(r.onStatisticField);if(e.outFields)for(const r of e.outFields)t.add(r);return{fields:(t.has("*")?this._fieldsIndex.fields.map(e=>e.name):Array.from(t)).filter(e=>null!=this._indexMap[e]),returnGeometry:!!e.returnGeometry||!!e.geometry,where:e.where}}}function N(e){for(const t in e){const r=t;switch(r){case"resultOffset":case"resultRecordCount":case"aggregateIds":case"distance":case"gdbVersion":case"geometry":case"having":case"timeExtent":case"objectIds":case"historicMoment":case"where":return null!=e[r]}}return!1}function k(e,t){const r=new M;for(const s of e)r.insert(s);return new w({...t,featureStore:r})}function J(e){switch(e.length){case 4:return h(d(),e);case 6:return e;default:throw new i("parquet:protocol-violation","Invalid Geoparquet file. BoundingBox size must be 4 or 6.",{bbox:e})}}function V(e,t){const r=c(d(),y);for(const s of e){const e=T(s.file);if(!e)return null;const t=e.columns[e.primary_column];if(!t.bbox)return null;const i=J(t.bbox);m(r,i)}return{xmin:r[0],ymin:r[1],xmax:r[3],ymax:r[4],spatialReference:t}}function H(e){const t=e?.featureCount;let r=!1;return null!=t&&t<has("parquetlayer-full-query-feature-count")&&(r=!0),{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:8e3,maxRecordCountFactor:void 0,maxUniqueIDCount:void 0,relativeTimeBinWindow:void 0,standardMaxRecordCount:void 0,standardMaxRecordCountNoGeometry:void 0,supportsStatisticsAggregatedIds:!1,supportsCacheHint:!1,supportsCentroid:!0,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsOutDistance:!1,supportsDistinct:r,supportsExtent:!1,supportsFormatPBF:!1,supportsFormatPBFWithCurves:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:r,supportsPagination:!0,supportsPaginationOnAggregatedQueries:!1,supportsPercentileStatistics:!1,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsReturnExceededLimitGeometries:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:r,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,supportsTrueCurve:!1,tileMaxRecordCount:void 0},queryAttributeBins:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}function Z(e){return!!(e.objectIds?.length||e.outStatistics||e.orderByFields?.length||e.returnDistinctValues)}export{U as default};
2
+ import{__addDisposableResource as e,__disposeResources as t}from"tslib";import r from"../../../../core/Collection.js";import{toConst as s}from"../../../../core/compilerUtils.js";import i from"../../../../core/Error.js";import has from"../../../../core/has.js";import o from"../../../../core/Logger.js";import{onAbortOrThrow as a,throwIfAborted as n}from"../../../../core/promiseUtils.js";import{QueueProcessor as u}from"../../../../core/QueueProcessor.js";import{parseWhereClause as p}from"../../../../core/sql.js";import l from"../../../../geometry/SpatialReference.js";import{set as c,create as d,expandWithRect as f,expandWithAABB as m,negativeInfinity as y,fromRect as h}from"../../../../geometry/support/aaBoundingBox.js";import{getQueryResultExtent as g,QueryEngine as w}from"../../data/QueryEngine.js";import{QueryEngineResult as _}from"../../data/QueryEngineResult.js";import{normalizeQueryLike as I}from"../../data/queryUtils.js";import{createDrawingInfo as F}from"./clientSideDefaults.js";import{getParquetFileId as x,getParquetRowId as R}from"./parquetIdUtils.js";import S from"../../../support/Field.js";import q from"../../../support/FieldsIndex.js";import{fromParquetGeometryEncodingJSON as C}from"../../../support/parquetEncodingUtils.js";import{completeParquetLayerInfo as E,fromParquetJSONGeometryType as v,toParquetJSONGeometryType as b}from"../../../support/parquetUtils.js";import{loadParquetModule as O}from"../../../../libs/parquet/loadParquetModule.js";import{createParquetFile as Q,readGeoMetadata as T}from"../../../../libs/parquet/parquet.js";import{FeatureStoreQueryAdapter as j}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as P}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as M}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as A}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as G}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const B=new j,D=4,z="__OBJECTID",W=new TextDecoder;class U{constructor(){this._fileInfos=new Map,this._queue=new u({concurrency:D,process:(e,t)=>this._executeQuery(e,t)}),this._indexMap={}}async load(s){const{urls:a}=s,n=s.spatialReference?l.fromJSON(s.spatialReference):void 0;if(n&&!n.isWGS84&&!n.isWebMercator)throw new i("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");const u=await E({urls:new r(a),fields:s.fields?.map(e=>S.fromJSON(e)),geometryEncoding:s.geometryEncoding?C(s.geometryEncoding):null,geometryType:s.geometryType?v(s.geometryType):null,displayOptimization:s.displayOptimization,spatialReference:n},{customParameters:s.customParameters});if(!u.fields)throw new i("parquet:unsupported","Fields must be defined");let p;if(u.spatialReference&&u.geometryType){if(!u.spatialReference)throw new i("parquet:unsupported","SpatialReference must be defined");if(!u.spatialReference.isGeographic&&!u.spatialReference.isWebMercator)throw new i("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");u.spatialReference.isGeographic&&!u.spatialReference.isWGS84&&(o.getLogger("parquet:unsupported-projection").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",{spatialReference:u.spatialReference}),u.spatialReference=l.WGS84),p={geometry:u.geometryEncoding?{geometryType:b(u.geometryType),spatialReference:u.spatialReference.toJSON(),encoding:u.geometryEncoding.toJSON()}:null,displayOptimization:u.displayOptimization}}this.setCustomParameters(s.customParameters),this._geometryInfo=p;for(const e of a)this._addFile(e);this._capabilities=H(await this.getFileStatistics());const m=this._fileInfos.values().next().value;if(!m)return{layerDefinition:{},capabilities:H(null)};const h=await m,{fields:g}=u;if(null==g)throw new i("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer fields",g);g.push(new S({name:z,type:"oid",alias:z}));for(const e of g){const t=h.file.columnForFieldName(e.name);null!=t&&(this._indexMap[e.name]=t)}const w=new q(g.map(e=>e.toJSON()));this._fieldsIndex=w;const _=b(u.geometryType??"point");if(this._metadata=A.createFeature({fieldsIndex:w.toJSON(),geometryType:_,hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:"rowId"},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:u.spatialReference,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:_,featureIdInfo:{type:"object-id",fieldName:"rowId"},hasM:!1,hasZ:!1,spatialReference:u.spatialReference?.toJSON()??{wkid:4326},aggregateAdapter:null,timeInfo:null,definitionExpression:null},u.spatialReference){const e=await this.getFileInfos();this._fullExtent=V(e,u.spatialReference.toJSON())}if(null==this._fullExtent&&"location"===u.geometryEncoding?.type){const{xField:r,yField:s}=u.geometryEncoding,i=c(d(),y);for(const o of await this.getFileInfos())for(const a of o.file.rowGroups()){const o={stack:[],error:void 0,hasError:!1};try{const t=e(o,a.columnDescriptorForAttribute(r),!1),n=e(o,a.columnDescriptorForAttribute(s),!1),u=[t.minValue(),n.minValue(),t.maxValue(),n.maxValue()];f(i,u),a.free()}catch(I){o.error=I,o.hasError=!0}finally{t(o)}}this._fullExtent={xmin:i[0],ymin:i[1],xmax:i[3],ymax:i[4],spatialReference:u.spatialReference?.toJSON()}}return{capabilities:this._capabilities,layerDefinition:{fields:u.fields?.map(e=>e.toJSON()),drawingInfo:F(_),extent:this._fullExtent??void 0,geometryType:_,geometryEncoding:u.geometryEncoding?.toJSON(),displayOptimization:u.displayOptimization}}}destroy(){for(const e of this._fileInfos.values())e.then(e=>e.file.free);this._fileInfos.clear(),this._queue.destroy()}setCustomParameters(e){this._customParameters=e}getIndexMap(){return this._indexMap}async getFileId(e){const t=this._fileInfos.get(e);if(!t)throw new Error(`InternalError: File ${e} does not exist`);return(await t).id}async getFileInfo(e){const t=this._fileInfos.get(e);if(!t)throw new Error(`InternalError: File ${e} does not exist`);return t}async getFileInfos(){return Promise.all(Array.from(this._fileInfos.values()))}async getFileStatistics(){if(!this._fileInfos.size)return null;const e=(await this.getFileInfos()).reduce((e,t)=>e+t.file.byteLength(),0);return{featureCount:await this._getFeatureCount(),byteLength:e}}async updateFiles(e){const t=new Set(e);for(const[r,s]of this._fileInfos.entries())t.has(r)?t.delete(r):(s.then(e=>e.file.free()),this._fileInfos.delete(r));await Promise.all(Array.from(t.values()).map(e=>this._addFile(e)))}async queryFeatures(e,t){this._validateQuery(e),Z(e)||(e.resultRecordCount=e.resultRecordCount?Math.min(e.resultRecordCount,8e3):8e3,e.resultOffset=e.resultOffset??0),(e.outStatistics||e.returnDistinctValues)&&(e.returnGeometry=void 0);return(await this._enqueueQuery(e,t)).createQueryResponse()}async queryFeatureCount(e,t){const r=await I(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),!N(r))return this._getFeatureCount();r.outFields=void 0,r.returnGeometry=void 0;return(await this._enqueueQuery(r,t)).createQueryResponseForCount()}async queryObjectIds(e,t){const r=await I(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),!N(r))return Array.from({length:await this._getFeatureCount()},(e,t)=>t);r.resultRecordCount=r.resultRecordCount?Math.min(r.resultRecordCount,8e3):8e3,r.resultOffset=r.resultOffset??0,r.returnGeometry=void 0,r.outFields=void 0;return(await this._enqueueQuery(r,t)).items.map(e=>e.getObjectId())}async queryExtent(e,t){const r=await I(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),this._fullExtent&&!N(r))return{count:await this._getFeatureCount(),extent:this._fullExtent};const i=s(this._metadata.spatialReference);r.returnGeometry=!0,r.outFields=void 0;const o=c(d(),y),a=d(),n=await this._enqueueQuery(r,t);let u=0;for(const s of n.items)s.getBounds(a)&&(m(o,a),u+=1);return{count:u,extent:g(o,i,r.outSR?s(r.outSR):i,i,!1)}}async queryStream(e,t,r){if(!r.signal)throw new Error("InternalError: AbortSignal must be passed");const s=await this.getFileInfo(e),i=(await O()).Query.new();"tile"===t.type&&(i.setExtent(t.extent),i.setQuantizationTransform(t.transform),i.setScale(t.scale)),i.setOutFields(t.outFields.filter(e=>null!=this._indexMap[e])),i.setOutSpatialReference(t.outSpatialReference.wkid),i.setReturnGeometry(!0),t.where&&await this._setWhereClause(i,s.file,t.where);const o=await s.file.executeQuery(i,r.signal),n=s.streamIdCounter++,u=a(r.signal,e=>{const t=s.streams.get(n);null!=t&&(t.handle.remove(),s.streams.delete(n))});return s.streams.set(n,{stream:o,handle:u}),n}async getStreamNext(e,t,r){if(!r.signal)throw new Error("InternalError: AbortSignal must be passed");const s=await this.getFileInfo(e),i=s.streams.get(t);if(!i)return null;const o=await i.stream.next(r.signal);return null==o&&(i.handle.remove(),s.streams.delete(t)),o?.serialize().buffer}async createPatch(e,t,r,s,i){if(!i.signal)throw new Error("InternalError: AbortSignal must be passed");const o=await this.getFileInfo(e);return(await o.file.createChunkPatch(t,r,s,i.signal)).serialize().buffer}async _getFile(e){for(const t of await this.getFileInfos())if(t.id===e)return t.file;throw new Error(`InternalError: File ${e} does not exist`)}_addFile(e){const t=this._fileInfos.size;this._fileInfos.set(e,this._createFileInfo(e,t))}async _createFileInfo(e,t){return{id:t,file:await Q(e,{geometryInfo:this._geometryInfo,getCustomParameters:()=>this._customParameters}),streamIdCounter:0,streams:new Map}}async _getFeatureCount(){return(await this.getFileInfos()).reduce((e,t)=>e+t.file.numRows(),0)}_validateQuery(e){if(!this._capabilities.query.supportsStatistics&&e.outStatistics)throw new i("parquet:unsupported","Statistics queries are not supported",{query:e});if(!this._capabilities.query.supportsOrderBy&&e.orderByFields?.length)throw new i("parquet:unsupported","Queries using orderBy are not supported",{query:e});if(!this._capabilities.query.supportsDistinct&&e.returnDistinctValues)throw new i("parquet:unsupported","Queries using returnDistinctValues are not supported",{query:e})}async _setWhereClause(e,t,r){const s=this._indexMap,o=this._fieldsIndex,a={getAttribute(e,r){const i=t.readAttribute(e.rowGroup,e.row,s[r]);if(null==i)return null;const a=o.get(r);return"esriFieldTypeString"===a.type||"esriFieldTypeDateOnly"===a.type||"esriFieldTypeTimeOnly"===a.type||"esriFieldTypeTimestampOffset"===a.type?W.decode(i):i}},n=await p(r,this._fieldsIndex);if(!n.isStandardized)throw new i("sql-parse-error","expression is not standardized");const u=(e,t)=>n.testFeatureCompiled({rowGroup:e,row:t},a,null);e.setWhere(r),e.setWhereEvaluator(u),e.setWhereFields(n.fieldNames)}async*_fetchChunks(e,t){const r=await O();for(const s of await this.getFileInfos()){const i=r.Query.new();i.setOutFields(e.fields),i.setReturnGeometry(e.returnGeometry),e.where&&await this._setWhereClause(i,s.file,e.where);const o=await s.file.executeQuery(i),a=[],u=o.next(t);for(let e=0;e<D;e++)a.push(o.next(t));let p=await u;for(;null!=p;){n(t);const e=new G(this._metadata,this._indexMap,p,s.id),r=k([new P(e,null,0,!1)],this._queryEngineParams),i=a.shift();a.push(o.next(t)),yield r,p=await i}}}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){const r=await this._getReadParams(e);if(e.where=void 0,e.objectIds?.length){const r=new Map;for(const t of e.objectIds){const e=x(t),s=R(t);let i=r.get(e);i||(i=[],r.set(e,i)),i.push(s)}const s=[];for(const[i,o]of r.entries()){const r=await this._executeFileIdQuery(e,i,o,t);for(const e of r)s.push(e)}return new _(s,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:B,featureIdInfo:this._queryEngineParams.featureIdInfo})}let s=e.resultRecordCount??await this._getFeatureCount(),i=e.resultOffset??0;e.resultRecordCount=void 0,e.resultOffset=void 0;const o=[];for await(const a of this._fetchChunks(r,t)){const r=await a.executeQueryForOpaqueFeatures(e,t);if(r.length>i){const t=r.slice(i,Math.min(i+s,r.length));for(const e of t)o.push(e);if(i=0,s-=t.length,0===s)return new _(o,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:B,featureIdInfo:this._queryEngineParams.featureIdInfo})}else i-=r.length}return new _(o,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:B,featureIdInfo:this._queryEngineParams.featureIdInfo})}async _executeFileIdQuery(e,t,r,s){const i=await this._getReadParams(e),o=(await O()).Query.new();o.setOutFields(i.fields),o.setReturnGeometry(i.returnGeometry),o.setIds(new Uint32Array(r));const a=await this._getFile(t),n=await a.executeQuery(o,s);let u=await n.next(s),p=0;const l=[];for(;null!=u;){const e=new G(this._metadata,this._indexMap,u,t),r=new P(e,null,p++,!1);l.push(r),u=await n.next(s)}return k(l,this._queryEngineParams).executeQueryForOpaqueFeatures(e,s)}async _getReadParams(e){const t=new Set;if(e.outStatistics)for(const r of e.outStatistics)null!=r.onStatisticField&&t.add(r.onStatisticField);if(e.outFields)for(const r of e.outFields)t.add(r);return{fields:(t.has("*")?this._fieldsIndex.fields.map(e=>e.name):Array.from(t)).filter(e=>null!=this._indexMap[e]),returnGeometry:!!e.returnGeometry||!!e.geometry,where:e.where}}}function N(e){for(const t in e){const r=t;switch(r){case"resultOffset":case"resultRecordCount":case"aggregateIds":case"distance":case"gdbVersion":case"geometry":case"having":case"timeExtent":case"objectIds":case"historicMoment":case"where":return null!=e[r]}}return!1}function k(e,t){const r=new M;for(const s of e)r.insert(s);return new w({...t,featureStore:r})}function J(e){switch(e.length){case 4:return h(d(),e);case 6:return e;default:throw new i("parquet:protocol-violation","Invalid Geoparquet file. BoundingBox size must be 4 or 6.",{bbox:e})}}function V(e,t){const r=c(d(),y);for(const s of e){const e=T(s.file);if(!e)return null;const t=e.columns[e.primary_column];if(!t.bbox)return null;const i=J(t.bbox);m(r,i)}return{xmin:r[0],ymin:r[1],xmax:r[3],ymax:r[4],spatialReference:t}}function H(e){const t=e?.featureCount;let r=!1;return null!=t&&t<has("parquetlayer-full-query-feature-count")&&(r=!0),{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:8e3,maxRecordCountFactor:void 0,maxUniqueIDCount:void 0,relativeTimeBinWindow:void 0,standardMaxRecordCount:void 0,standardMaxRecordCountNoGeometry:void 0,supportsStatisticsAggregatedIds:!1,supportsCacheHint:!1,supportsCentroid:!0,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsOutDistance:!1,supportsDistinct:r,supportsExtent:!1,supportsFormatPBF:!1,supportsFormatPBFWithCurves:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:r,supportsPagination:!0,supportsPaginationOnAggregatedQueries:!1,supportsPercentileStatistics:!1,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsReturnExceededLimitGeometries:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:r,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,supportsTrueCurve:!1,tileMaxRecordCount:void 0},queryAttributeBins:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}function Z(e){return!!(e.objectIds?.length||e.outStatistics||e.orderByFields?.length||e.returnDistinctValues)}export{U as default};
@@ -94,6 +94,8 @@ export interface KnowledgeGraphSublayerProperties extends LayerProperties, Refre
94
94
  * })
95
95
  */
96
96
  formTemplate?: FormTemplateProperties | null;
97
+ /** The unique ID assigned to the layer. */
98
+ id?: string;
97
99
  /**
98
100
  * The label definition for this sublayer, specified as an array of
99
101
  * [label classes](https://developers.arcgis.com/javascript/latest/references/core/layers/support/LabelClass/). Use this property to specify
@@ -378,7 +380,7 @@ export default class KnowledgeGraphSublayer extends KnowledgeGraphSublayerSuperc
378
380
  */
379
381
  get hasZ(): boolean;
380
382
  /** The unique ID assigned to the layer. */
381
- get id(): string;
383
+ accessor id: string;
382
384
  /**
383
385
  * The label definition for this sublayer, specified as an array of
384
386
  * [label classes](https://developers.arcgis.com/javascript/latest/references/core/layers/support/LabelClass/). Use this property to specify