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

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 (115) hide show
  1. package/analysis/Analysis.js +1 -1
  2. package/analysis/support/AnalysisOriginWebScene.d.ts +1 -1
  3. package/analysis/support/AnalysisOriginWebScene.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/070839cb71c8e764b8d7.js +1 -0
  6. package/assets/esri/core/workers/chunks/19084a293694c5a00cae.js +1 -0
  7. package/assets/esri/core/workers/chunks/{5958af341014e13475d2.js → 2bed8a5ed9ae3760fa2f.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{7ffa68d69c138db1295d.js → 2e3019ce49e972a815ca.js} +1 -1
  9. package/assets/esri/core/workers/chunks/38f5e6a202ce292edd9f.js +1 -0
  10. package/assets/esri/core/workers/chunks/415903f481392c72870f.js +1 -0
  11. package/assets/esri/core/workers/chunks/4351b3e54b309935faed.js +1 -0
  12. package/assets/esri/core/workers/chunks/4da99f058cca83937e9b.js +1 -0
  13. package/assets/esri/core/workers/chunks/5acdd49c5f1a49fdc6e7.js +1 -0
  14. package/assets/esri/core/workers/chunks/968f2f841c011095a6d2.js +1 -0
  15. package/assets/esri/core/workers/chunks/a2676f3f135ad5fdf872.js +1 -0
  16. package/assets/esri/core/workers/chunks/a8430e1e2142f1ce9b92.js +1 -0
  17. package/assets/esri/core/workers/chunks/b53300b46646cfad2526.js +319 -0
  18. package/assets/esri/core/workers/chunks/bf543bdec3da0fe278fb.js +1 -0
  19. package/assets/esri/core/workers/chunks/f52e597dca4b32a81881.js +1 -0
  20. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  21. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  22. package/chunks/ShadowCastAccumulate.glsl.js +13 -9
  23. package/chunks/ShadowCastVisualize.glsl.js +24 -9
  24. package/chunks/lyr3DMain.js +1 -1
  25. package/chunks/lyr3DWorker.js +1 -1
  26. package/interfaces.d.ts +200 -5
  27. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  28. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  29. package/layers/ParquetLayer.js +1 -1
  30. package/layers/mixins/ImageryTileMixin.js +1 -1
  31. package/layers/support/ParquetEncodingLocation.d.ts +4 -0
  32. package/layers/support/ParquetEncodingLocation.js +1 -1
  33. package/layers/support/ParquetEncodingWkb.d.ts +4 -0
  34. package/layers/support/ParquetEncodingWkb.js +1 -1
  35. package/layers/support/RasterStorageInfo.js +1 -1
  36. package/layers/support/layerUtils.js +1 -1
  37. package/layers/support/parquetUtils.d.ts +3 -0
  38. package/layers/support/parquetUtils.js +1 -1
  39. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  40. package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
  41. package/layers/support/rasterDatasets/RawBlockCache.js +1 -1
  42. package/layers/support/rasterFormats/pixelRangeUtils.js +1 -1
  43. package/package.json +2 -2
  44. package/portal/schemas/definitions.js +1 -1
  45. package/portal/schemas/integratedMesh3DTilesLayerItem.js +1 -1
  46. package/support/revision.js +1 -1
  47. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  48. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  49. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  50. package/views/2d/layers/support/MediaLayerInteraction.js +1 -1
  51. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  52. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  53. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  54. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  55. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  56. package/views/3d/layers/Lyr3DWorker.js +1 -1
  57. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  58. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  59. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  60. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
  61. package/views/3d/layers/graphics/pipeline/PipelineCommand.js +1 -1
  62. package/views/3d/layers/graphics/pipeline/Tile3DManager.js +1 -1
  63. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  64. package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
  65. package/views/3d/layers/graphics/pipeline/symbolization/Factory.js +5 -0
  66. package/views/3d/layers/graphics/pipeline/symbolization/SimpleFeatureRenderer.js +5 -0
  67. package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
  68. package/views/3d/layers/graphics/pipeline/symbolization/TestSymbol.js +1 -1
  69. package/views/3d/layers/graphics/pipeline/symbolization/UniqueValueFeatureRenderer.js +1 -1
  70. package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
  71. package/views/3d/webgl/ManagedFBO.js +1 -1
  72. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  73. package/views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js +7 -13
  74. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendColorsPremultiplied.glsl.js +5 -0
  75. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  76. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  77. package/views/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +1 -1
  78. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
  79. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechniqueConfiguration.js +5 -0
  80. package/views/3d/webgl-engine/shaders/ShadowCastVisualize.glsl.js +1 -1
  81. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
  82. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration.js +1 -1
  83. package/views/PopupView.js +1 -1
  84. package/views/SelectionManager.js +1 -1
  85. package/views/analysis/analysisViewUtils.js +1 -1
  86. package/views/input/InputManager.js +1 -1
  87. package/views/input/ViewEvents.js +1 -1
  88. package/views/support/selectionUtils.js +1 -1
  89. package/webscene/support/analysisUtils.js +1 -1
  90. package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
  91. package/widgets/Editor/UpdateWorkflow.js +1 -1
  92. package/widgets/Editor/workflowUtils.js +1 -1
  93. package/widgets/ElevationProfile/ElevationProfileInteraction.js +1 -1
  94. package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
  95. package/widgets/FeatureTable/support/tableUtils.js +1 -1
  96. package/widgets/FeatureTable.js +1 -1
  97. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  98. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  99. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  100. package/widgets/ShadowCast/ThresholdOptions.js +1 -1
  101. package/widgets/Sketch/SketchViewModel.js +1 -1
  102. package/widgets/VideoPlayer.js +1 -1
  103. package/widgets/support/AnalysisViewModel.js +1 -1
  104. package/assets/esri/core/workers/chunks/0a48b9734ab4c64a6f4f.js +0 -1
  105. package/assets/esri/core/workers/chunks/1427e7953c3d8c87c5e8.js +0 -1
  106. package/assets/esri/core/workers/chunks/146b3699a9e8b1f2dcc2.js +0 -1
  107. package/assets/esri/core/workers/chunks/22f604726529ee6f8c25.js +0 -1
  108. package/assets/esri/core/workers/chunks/8dd26b12c625d20196ed.js +0 -319
  109. package/assets/esri/core/workers/chunks/91f8547a13f0461045ef.js +0 -1
  110. package/assets/esri/core/workers/chunks/931275cfa2c55eb0f504.js +0 -1
  111. package/assets/esri/core/workers/chunks/9f416cc5673665f8c37c.js +0 -1
  112. package/assets/esri/core/workers/chunks/b42ecc7c3eb2fd8d1308.js +0 -1
  113. package/assets/esri/core/workers/chunks/d04efa51da9b4eb3a8a7.js +0 -1
  114. package/assets/esri/core/workers/chunks/d8474dca270b25705699.js +0 -1
  115. package/assets/esri/core/workers/chunks/ed3d1d0465f4a4d8df4a.js +0 -1
package/interfaces.d.ts CHANGED
@@ -22794,6 +22794,13 @@ declare namespace __esri {
22794
22794
  */
22795
22795
  get elevationInfo(): IntegratedMesh3DTilesLayerElevationInfo | nullish;
22796
22796
  set elevationInfo(value: IntegratedMesh3DTilesLayerElevationInfoProperties | nullish);
22797
+ /**
22798
+ * A collection of {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SceneModification.html SceneModification} with polygons and types to apply client-side modifications.
22799
+ *
22800
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMesh3DTilesLayer.html#modifications Read more...}
22801
+ */
22802
+ get modifications(): SceneModifications | nullish;
22803
+ set modifications(value: SceneModificationsProperties | nullish);
22797
22804
  /**
22798
22805
  * The portal item from which the layer is loaded.
22799
22806
  *
@@ -22842,6 +22849,12 @@ declare namespace __esri {
22842
22849
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMesh3DTilesLayer.html#minScale Read more...}
22843
22850
  */
22844
22851
  minScale?: ScaleRangeLayerProperties["minScale"];
22852
+ /**
22853
+ * A collection of {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SceneModification.html SceneModification} with polygons and types to apply client-side modifications.
22854
+ *
22855
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMesh3DTilesLayer.html#modifications Read more...}
22856
+ */
22857
+ modifications?: SceneModificationsProperties | nullish;
22845
22858
  /**
22846
22859
  * Enable persistence of the layer in a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html WebMap} or {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html WebScene}.
22847
22860
  *
@@ -35877,6 +35890,156 @@ declare namespace __esri {
35877
35890
  valueExpression?: string | nullish;
35878
35891
  }
35879
35892
 
35893
+ export interface ParquetEncodingLocation extends Accessor, JSONSupport {
35894
+ }
35895
+
35896
+ export class ParquetEncodingLocation {
35897
+ /**
35898
+ * The name of the field in the Parquet file that contains the latitude values.
35899
+ *
35900
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingLocation.html#latitudeFieldName Read more...}
35901
+ */
35902
+ latitudeFieldName: string;
35903
+ /**
35904
+ * The name of the field in the Parquet file that contains the longitude values.
35905
+ *
35906
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingLocation.html#longitudeFieldName Read more...}
35907
+ */
35908
+ longitudeFieldName: string;
35909
+ /**
35910
+ * The type of encoding used for the geometries in the parquet file.
35911
+ *
35912
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingLocation.html#type Read more...}
35913
+ */
35914
+ readonly type: "location";
35915
+ /**
35916
+ * The location format used to store geometries in Pparquet files.
35917
+ *
35918
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingLocation.html Read more...}
35919
+ */
35920
+ constructor(properties?: ParquetEncodingLocationProperties);
35921
+ /**
35922
+ * Converts an instance of this class to its [ArcGIS portal JSON](https://developers.arcgis.com/documentation/common-data-types/geometry-objects.htm) representation.
35923
+ *
35924
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingLocation.html#toJSON Read more...}
35925
+ */
35926
+ toJSON(): any;
35927
+ /**
35928
+ * Creates a new instance of this class and initializes it with values from a JSON object
35929
+ * generated from an ArcGIS product.
35930
+ *
35931
+ * @param json A JSON representation of the instance in the ArcGIS format. See the [ArcGIS REST API documentation](https://developers.arcgis.com/documentation/common-data-types/overview-of-common-data-types.htm) for examples of the structure of various input JSON objects.
35932
+ *
35933
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingLocation.html#fromJSON Read more...}
35934
+ */
35935
+ static fromJSON(json: any): any | nullish;
35936
+ static fromJSON(json: any): ParquetEncodingLocation;
35937
+ }
35938
+
35939
+ interface ParquetEncodingLocationProperties {
35940
+ /**
35941
+ * The name of the field in the Parquet file that contains the latitude values.
35942
+ *
35943
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingLocation.html#latitudeFieldName Read more...}
35944
+ */
35945
+ latitudeFieldName?: string;
35946
+ /**
35947
+ * The name of the field in the Parquet file that contains the longitude values.
35948
+ *
35949
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingLocation.html#longitudeFieldName Read more...}
35950
+ */
35951
+ longitudeFieldName?: string;
35952
+ }
35953
+
35954
+ export interface ParquetEncodingWkb extends Accessor, JSONSupport {
35955
+ }
35956
+
35957
+ export class ParquetEncodingWkb {
35958
+ /**
35959
+ * The name of the primary geometry column.
35960
+ *
35961
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingWkb.html#primaryFieldName Read more...}
35962
+ */
35963
+ primaryFieldName: string;
35964
+ /**
35965
+ * The type of encoding used for the geometries in the parquet file.
35966
+ *
35967
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingWkb.html#type Read more...}
35968
+ */
35969
+ readonly type: "wkb";
35970
+ /**
35971
+ * Well-Known Binary (WKB) is a binary format used to encode geometries before storing them in parquet files.
35972
+ *
35973
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingWkb.html Read more...}
35974
+ */
35975
+ constructor(properties?: ParquetEncodingWkbProperties);
35976
+ /**
35977
+ * Converts an instance of this class to its [ArcGIS portal JSON](https://developers.arcgis.com/documentation/common-data-types/geometry-objects.htm) representation.
35978
+ *
35979
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingWkb.html#toJSON Read more...}
35980
+ */
35981
+ toJSON(): any;
35982
+ /**
35983
+ * Creates a new instance of this class and initializes it with values from a JSON object
35984
+ * generated from an ArcGIS product.
35985
+ *
35986
+ * @param json A JSON representation of the instance in the ArcGIS format. See the [ArcGIS REST API documentation](https://developers.arcgis.com/documentation/common-data-types/overview-of-common-data-types.htm) for examples of the structure of various input JSON objects.
35987
+ *
35988
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingWkb.html#fromJSON Read more...}
35989
+ */
35990
+ static fromJSON(json: any): any | nullish;
35991
+ static fromJSON(json: any): ParquetEncodingWkb;
35992
+ }
35993
+
35994
+ interface ParquetEncodingWkbProperties {
35995
+ /**
35996
+ * The name of the primary geometry column.
35997
+ *
35998
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ParquetEncodingWkb.html#primaryFieldName Read more...}
35999
+ */
36000
+ primaryFieldName?: string;
36001
+ }
36002
+
36003
+ /**
36004
+ * Provides utility functions for the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ParquetLayer.html ParquetLayer}.
36005
+ *
36006
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-parquetUtils.html Read more...}
36007
+ */
36008
+ interface parquetUtils {
36009
+ /**
36010
+ * Retrieves information about a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ParquetLayer.html ParquetLayer} from the first parquet file in the specified URLs array.
36011
+ *
36012
+ * @param urls An array of URLs pointing to parquet files. At least one url must be provided.
36013
+ * @param options An object specifying additional options. See the object specification table below for the properties of this object.
36014
+ * @param options.customParameters A list of key-value pairs of parameters to append to the url.
36015
+ * @param options.signal An [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) to abort the executions of the remote method. If canceled, the promise will be rejected with an error named `AbortError`. See also [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController).
36016
+ *
36017
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-parquetUtils.html#getParquetLayerInfo Read more...}
36018
+ */
36019
+ getParquetLayerInfo(urls: string[], options?: parquetUtilsGetParquetLayerInfoOptions): Promise<ParquetLayerInfo>;
36020
+ }
36021
+
36022
+ export const parquetUtils: parquetUtils;
36023
+
36024
+ /**
36025
+ * Contains an information inferred from the parquet files.
36026
+ *
36027
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-parquetUtils.html#ParquetLayerInfo Read more...}
36028
+ */
36029
+ export interface ParquetLayerInfo {
36030
+ urls: Collection<string>;
36031
+ fields?: Field[];
36032
+ encoding?: ParquetEncodingWkb | ParquetEncodingLocation | nullish;
36033
+ geometryType?: "point" | "polygon" | "polyline" | "multipoint";
36034
+ objectIdField?: string;
36035
+ spatialReference?: SpatialReference;
36036
+ }
36037
+
36038
+ export interface parquetUtilsGetParquetLayerInfoOptions {
36039
+ customParameters?: any;
36040
+ signal?: AbortSignal | nullish;
36041
+ }
36042
+
35880
36043
  export class PixelBlock extends Accessor {
35881
36044
  /**
35882
36045
  * The height (or number of rows) of the PixelBlock in pixels.
@@ -93763,6 +93926,15 @@ declare namespace __esri {
93763
93926
  */
93764
93927
  visible: boolean;
93765
93928
  constructor(properties?: any);
93929
+ /**
93930
+ * Starts the interactive placement of a direct line measurement.
93931
+ *
93932
+ * @param options An object specifying additional options.
93933
+ * @param options.signal Abort signal which can be used to cancel creation.
93934
+ *
93935
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-analysis-DirectLineMeasurementAnalysisView3D.html#place Read more...}
93936
+ */
93937
+ place(options?: DirectLineMeasurementAnalysisView3DPlaceOptions | nullish): Promise<void>;
93766
93938
  }
93767
93939
 
93768
93940
  /**
@@ -93777,6 +93949,10 @@ declare namespace __esri {
93777
93949
  verticalDistance: Length;
93778
93950
  }
93779
93951
 
93952
+ export interface DirectLineMeasurementAnalysisView3DPlaceOptions {
93953
+ signal?: AbortSignal | nullish;
93954
+ }
93955
+
93780
93956
  export class LineOfSightAnalysisResult {
93781
93957
  /**
93782
93958
  * The first {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html Graphic} intersected by the line of sight.
@@ -101519,6 +101695,7 @@ declare namespace __esri {
101519
101695
  }
101520
101696
 
101521
101697
  export interface ViewBlurEvent {
101698
+ defer: EventDefer;
101522
101699
  native: any;
101523
101700
  target: View;
101524
101701
  }
@@ -101526,6 +101703,7 @@ declare namespace __esri {
101526
101703
  export interface ViewClickEvent {
101527
101704
  button: number;
101528
101705
  buttons: 0 | 1 | 2;
101706
+ defer: EventDefer;
101529
101707
  mapPoint: Point;
101530
101708
  native: any;
101531
101709
  timestamp: number;
@@ -101543,6 +101721,7 @@ declare namespace __esri {
101543
101721
  export interface ViewDoubleClickEvent {
101544
101722
  button: number;
101545
101723
  buttons: 0 | 1 | 2;
101724
+ defer: EventDefer;
101546
101725
  mapPoint: Point;
101547
101726
  native: any;
101548
101727
  timestamp: number;
@@ -101562,6 +101741,7 @@ declare namespace __esri {
101562
101741
  angle: number;
101563
101742
  button: 0 | 1 | 2;
101564
101743
  buttons: number;
101744
+ defer: EventDefer;
101565
101745
  native: any;
101566
101746
  origin: ViewDragEventOrigin;
101567
101747
  radius: number;
@@ -101577,7 +101757,11 @@ declare namespace __esri {
101577
101757
  stopPropagation(): void;
101578
101758
  }
101579
101759
 
101760
+ export type EventDefer = (operation: EventDeferredOperation) => Promise<any>;
101761
+ export type EventDeferredOperation = () => Promise<any>;
101762
+
101580
101763
  export interface ViewFocusEvent {
101764
+ defer: EventDefer;
101581
101765
  native: any;
101582
101766
  target: View;
101583
101767
  }
@@ -101585,6 +101769,7 @@ declare namespace __esri {
101585
101769
  export interface ViewHoldEvent {
101586
101770
  button: 0 | 1 | 2;
101587
101771
  buttons: number;
101772
+ defer: EventDefer;
101588
101773
  mapPoint: Point;
101589
101774
  native: any;
101590
101775
  timestamp: number;
@@ -101602,6 +101787,7 @@ declare namespace __esri {
101602
101787
  export interface ViewImmediateClickEvent {
101603
101788
  button: 0 | 1 | 2;
101604
101789
  buttons: number;
101790
+ defer: EventDefer;
101605
101791
  mapPoint: Point;
101606
101792
  native: any;
101607
101793
  timestamp: number;
@@ -101619,6 +101805,7 @@ declare namespace __esri {
101619
101805
  export interface ViewImmediateDoubleClickEvent {
101620
101806
  button: 0 | 1 | 2;
101621
101807
  buttons: number;
101808
+ defer: EventDefer;
101622
101809
  mapPoint: Point;
101623
101810
  native: any;
101624
101811
  timestamp: number;
@@ -101634,6 +101821,7 @@ declare namespace __esri {
101634
101821
  }
101635
101822
 
101636
101823
  export interface ViewKeyDownEvent {
101824
+ defer: EventDefer;
101637
101825
  key: string;
101638
101826
  native: any;
101639
101827
  repeat: boolean;
@@ -101648,6 +101836,7 @@ declare namespace __esri {
101648
101836
  }
101649
101837
 
101650
101838
  export interface ViewKeyUpEvent {
101839
+ defer: EventDefer;
101651
101840
  key: string;
101652
101841
  native: any;
101653
101842
  timestamp: number;
@@ -101676,6 +101865,7 @@ declare namespace __esri {
101676
101865
  }
101677
101866
 
101678
101867
  export interface ViewMouseWheelEvent {
101868
+ defer: EventDefer;
101679
101869
  deltaY: number;
101680
101870
  native: any;
101681
101871
  timestamp: number;
@@ -101693,6 +101883,7 @@ declare namespace __esri {
101693
101883
  export interface ViewPointerDownEvent {
101694
101884
  button: number;
101695
101885
  buttons: number;
101886
+ defer: EventDefer;
101696
101887
  native: any;
101697
101888
  pointerId: number;
101698
101889
  pointerType: "mouse" | "touch";
@@ -101711,6 +101902,7 @@ declare namespace __esri {
101711
101902
  export interface ViewPointerEnterEvent {
101712
101903
  button: number;
101713
101904
  buttons: number;
101905
+ defer: EventDefer;
101714
101906
  native: any;
101715
101907
  pointerId: number;
101716
101908
  pointerType: "mouse" | "touch";
@@ -101729,6 +101921,7 @@ declare namespace __esri {
101729
101921
  export interface ViewPointerLeaveEvent {
101730
101922
  button: number;
101731
101923
  buttons: number;
101924
+ defer: EventDefer;
101732
101925
  native: any;
101733
101926
  pointerId: number;
101734
101927
  pointerType: "mouse" | "touch";
@@ -101747,6 +101940,7 @@ declare namespace __esri {
101747
101940
  export interface ViewPointerMoveEvent {
101748
101941
  button: number;
101749
101942
  buttons: number;
101943
+ defer: EventDefer;
101750
101944
  native: any;
101751
101945
  pointerId: number;
101752
101946
  pointerType: "mouse" | "touch";
@@ -101765,6 +101959,7 @@ declare namespace __esri {
101765
101959
  export interface ViewPointerUpEvent {
101766
101960
  button: number;
101767
101961
  buttons: number;
101962
+ defer: EventDefer;
101768
101963
  native: any;
101769
101964
  pointerId: number;
101770
101965
  pointerType: "mouse" | "touch";
@@ -110997,13 +111192,13 @@ declare namespace __esri {
110997
111192
  *
110998
111193
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#unit Read more...}
110999
111194
  */
111000
- unit: SystemOrLengthUnit;
111195
+ unit: SystemOrLengthUnit | nullish;
111001
111196
  /**
111002
111197
  * List of unit systems (imperial, metric) and specific units for displaying the distance values.
111003
111198
  *
111004
111199
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#unitOptions Read more...}
111005
111200
  */
111006
- unitOptions: SystemOrLengthUnit[];
111201
+ unitOptions: SystemOrLengthUnit[] | nullish;
111007
111202
  /**
111008
111203
  * The view from which the widget will operate.
111009
111204
  *
@@ -111042,13 +111237,13 @@ declare namespace __esri {
111042
111237
  *
111043
111238
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#unit Read more...}
111044
111239
  */
111045
- unit?: SystemOrLengthUnit;
111240
+ unit?: SystemOrLengthUnit | nullish;
111046
111241
  /**
111047
111242
  * List of unit systems (imperial, metric) and specific units for displaying the distance values.
111048
111243
  *
111049
111244
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#unitOptions Read more...}
111050
111245
  */
111051
- unitOptions?: SystemOrLengthUnit[];
111246
+ unitOptions?: SystemOrLengthUnit[] | nullish;
111052
111247
  /**
111053
111248
  * The view from which the widget will operate.
111054
111249
  *
@@ -137685,7 +137880,7 @@ declare namespace __esri {
137685
137880
  */
137686
137881
  view: MapView | nullish;
137687
137882
  /**
137688
- * The VideoPlayerViewModel class provides the logic for the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VideoPlayer.html VideoPlayer} widget.
137883
+ * The VideoPlayerViewModel class provides the logic for the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VideoPlayer.html VideoPlayer} widget and {@link https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-video-player/ Video Player component}.
137689
137884
  *
137690
137885
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VideoPlayer-VideoPlayerViewModel.html Read more...}
137691
137886
  */
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import r from"../core/Error.js";import i from"../core/Logger.js";import{rad2deg as o}from"../core/mathUtils.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{d as p,g as l,t as c,c as f,A as y,D as h,a as u}from"../chunks/vec32.js";import{fromValues as d,create as x}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{WGS84ECEFSpatialReferenceLike as g}from"../geometry/ellipsoidUtils.js";import v from"../geometry/Extent.js";import j from"../geometry/SpatialReference.js";import{projectBuffer as A}from"../geometry/projection/projectBuffer.js";import b from"./Layer.js";import{APIKeyMixin as L}from"./mixins/APIKeyMixin.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{CustomParametersMixin as _}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as E}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as I}from"./mixins/ScaleRangeLayer.js";import{elevationInfo as M,url as R}from"./support/commonProperties.js";import{logInvalidElevationInfoWarning as T,elevationModeRequiredMessage as U,featureExpressionUnsupportedMessage as D}from"../support/elevationInfoUtils.js";let N=class extends(S(w(E(I(s(_(L(b)))))))){constructor(e){super(e),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.spatialReference=new j({wkid:4326,vcsWkid:115700}),this.fullExtent=new v(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}_verifyArray(e,t){if(!Array.isArray(e)||e.length<t)return!1;for(const r of e)if("number"!=typeof r)return!1;return!0}_initFullExtent(e){const t=e.root?.boundingVolume;if(!t)return;if(t.box){const e=t?.box;if(e[3]>7972671&&e[7]>7972671&&e[11]>7945940)return}const r=e.root?.transform,i=x();if(t.region&&this._verifyArray(t.region,6)){const e=t.region,r=o(e[0]),i=o(e[1]),s=e[4],a=o(e[2]),n=o(e[3]),m=e[5];this.fullExtent=new v({xmin:r,ymin:i,zmin:s,xmax:a,ymax:n,zmax:m,spatialReference:this.spatialReference})}else if(t.sphere&&this._verifyArray(t.sphere,4)){const e=t.sphere,o=d(e[0],e[1],e[2]),s=e[3]/Math.sqrt(3),a=x();p(a,o,d(s,s,s));const n=x();if(l(n,o,d(s,s,s)),r&&this._verifyArray(r,16)){const e=r;c(i,a,e),f(a,i),c(i,n,e),f(n,i)}A(a,g,0,a,j.WGS84,0),A(n,g,0,n,j.WGS84,0);const m=x(),u=x();y(m,a,n),h(u,a,n),this.fullExtent=new v({xmin:m[0],ymin:m[1],zmin:m[2],xmax:u[0],ymax:u[1],zmax:u[2],spatialReference:this.spatialReference})}else if(t.box&&this._verifyArray(t.box,12)){const e=t.box,i=d(e[0],e[1],e[2]),o=d(e[3],e[4],e[5]),s=d(e[6],e[7],e[8]),a=d(e[9],e[10],e[11]),n=[];for(let t=0;t<8;++t)n.push(x());if(l(n[0],i,o),l(n[0],n[0],s),l(n[0],n[0],a),u(n[1],i,o),l(n[1],n[1],s),l(n[1],n[1],a),l(n[2],i,o),u(n[2],n[2],s),l(n[2],n[2],a),u(n[3],i,o),u(n[3],n[3],s),l(n[3],n[3],a),l(n[4],i,o),l(n[4],n[4],s),u(n[4],n[4],a),u(n[5],i,o),l(n[5],n[5],s),u(n[5],n[5],a),l(n[6],i,o),u(n[6],n[6],s),u(n[6],n[6],a),u(n[7],i,o),u(n[7],n[7],s),u(n[7],n[7],a),r&&this._verifyArray(r,16)){const e=r;for(let t=0;t<8;++t)c(n[t],n[t],e)}const m=d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),p=d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let t=0;t<8;++t)A(n[t],g,0,n[t],j.WGS84,0),y(p,p,n[t]),h(m,m,n[t]);this.fullExtent=new v({xmin:p[0],ymin:p[1],zmin:p[2],xmax:m[0],ymax:m[1],zmax:m[2],spatialReference:this.spatialReference})}}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const i=null!=e?e.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{if(e.typeKeywords?.includes("IntegratedMesh"))return!0;throw new r("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},e)}catch(o){a(o)}if(this.url){const e=t(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:i}).then((e=>{this._initFullExtent(e.data)}),(e=>{a(e)}));await e}}async fetchAttributionData(){return this.load().then((()=>({})))}_validateElevationInfo(e){const t="Integrated mesh 3d tiles layers";T(i.getLogger(this),U(t,"absolute-height",e)),T(i.getLogger(this),D(t,e))}};e([n({type:["IntegratedMesh3DTilesLayer"]})],N.prototype,"operationalLayerType",void 0),e([n({type:j})],N.prototype,"spatialReference",void 0),e([n({type:v})],N.prototype,"fullExtent",void 0),e([n(M)],N.prototype,"elevationInfo",null),e([n({type:["show","hide"]})],N.prototype,"listMode",void 0),e([n(R)],N.prototype,"url",void 0),e([n({readOnly:!0})],N.prototype,"type",void 0),e([n({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],N.prototype,"path",void 0),e([n({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],N.prototype,"minScale",void 0),e([n({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],N.prototype,"maxScale",void 0),N=e([m("esri.layers.IntegratedMesh3DTilesLayer")],N);const P=N;export{P as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import i from"../core/Error.js";import r from"../core/Logger.js";import{rad2deg as o}from"../core/mathUtils.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{on as n,sync as m}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{persistable as f}from"../core/accessorSupport/decorators/persistable.js";import{d,g as h,t as y,c as u,A as x,D as g,a as v}from"../chunks/vec32.js";import{fromValues as j,create as S}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{WGS84ECEFSpatialReferenceLike as b}from"../geometry/ellipsoidUtils.js";import _ from"../geometry/Extent.js";import A from"../geometry/SpatialReference.js";import{projectBuffer as w}from"../geometry/projection/projectBuffer.js";import L from"./Layer.js";import{APIKeyMixin as M}from"./mixins/APIKeyMixin.js";import{ArcGISService as E}from"./mixins/ArcGISService.js";import{CustomParametersMixin as I}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as R}from"./mixins/OperationalLayer.js";import{PortalLayer as U}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as T}from"./mixins/ScaleRangeLayer.js";import{elevationInfo as D,url as N}from"./support/commonProperties.js";import z from"./support/SceneModifications.js";import{logInvalidElevationInfoWarning as P,elevationModeRequiredMessage as V,featureExpressionUnsupportedMessage as k}from"../support/elevationInfoUtils.js";import{f as X}from"../chunks/persistableUrlUtils.js";let G=class extends(E(R(U(T(s(I(M(L)))))))){readModifications(e,t,i){this._modificationsSource={url:X(e,i),context:i}}initialize(){this.addHandles(n((()=>this.modifications),"after-changes",(()=>this.modifications=this.modifications),m))}constructor(e){super(e),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.modifications=null,this._modificationsSource=null,this.spatialReference=new A({wkid:4326,vcsWkid:115700}),this.fullExtent=new _(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}_verifyArray(e,t){if(!Array.isArray(e)||e.length<t)return!1;for(const i of e)if("number"!=typeof i)return!1;return!0}_initFullExtent(e){const t=e.root?.boundingVolume;if(!t)return;if(t.box){const e=t?.box;if(e[3]>7972671&&e[7]>7972671&&e[11]>7945940)return}const i=e.root?.transform,r=S();if(t.region&&this._verifyArray(t.region,6)){const e=t.region,i=o(e[0]),r=o(e[1]),s=e[4],a=o(e[2]),n=o(e[3]),m=e[5];this.fullExtent=new _({xmin:i,ymin:r,zmin:s,xmax:a,ymax:n,zmax:m,spatialReference:this.spatialReference})}else if(t.sphere&&this._verifyArray(t.sphere,4)){const e=t.sphere,o=j(e[0],e[1],e[2]),s=e[3]/Math.sqrt(3),a=S();d(a,o,j(s,s,s));const n=S();if(h(n,o,j(s,s,s)),i&&this._verifyArray(i,16)){const e=i;y(r,a,e),u(a,r),y(r,n,e),u(n,r)}w(a,b,0,a,A.WGS84,0),w(n,b,0,n,A.WGS84,0);const m=S(),l=S();x(m,a,n),g(l,a,n),this.fullExtent=new _({xmin:m[0],ymin:m[1],zmin:m[2],xmax:l[0],ymax:l[1],zmax:l[2],spatialReference:this.spatialReference})}else if(t.box&&this._verifyArray(t.box,12)){const e=t.box,r=j(e[0],e[1],e[2]),o=j(e[3],e[4],e[5]),s=j(e[6],e[7],e[8]),a=j(e[9],e[10],e[11]),n=[];for(let t=0;t<8;++t)n.push(S());if(h(n[0],r,o),h(n[0],n[0],s),h(n[0],n[0],a),v(n[1],r,o),h(n[1],n[1],s),h(n[1],n[1],a),h(n[2],r,o),v(n[2],n[2],s),h(n[2],n[2],a),v(n[3],r,o),v(n[3],n[3],s),h(n[3],n[3],a),h(n[4],r,o),h(n[4],n[4],s),v(n[4],n[4],a),v(n[5],r,o),h(n[5],n[5],s),v(n[5],n[5],a),h(n[6],r,o),v(n[6],n[6],s),v(n[6],n[6],a),v(n[7],r,o),v(n[7],n[7],s),v(n[7],n[7],a),i&&this._verifyArray(i,16)){const e=i;for(let t=0;t<8;++t)y(n[t],n[t],e)}const m=j(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),l=j(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let t=0;t<8;++t)w(n[t],b,0,n[t],A.WGS84,0),x(l,l,n[t]),g(m,m,n[t]);this.fullExtent=new _({xmin:l[0],ymin:l[1],zmin:l[2],xmax:m[0],ymax:m[1],zmax:m[2],spatialReference:this.spatialReference})}}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const r=null!=e?e.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{if(e.typeKeywords?.includes("IntegratedMesh"))return!0;throw new i("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},e)}catch(o){a(o)}if(null!=this._modificationsSource){const t=await z.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}if(this.url){const e=t(this.url,{query:{...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then((e=>{this._initFullExtent(e.data)}),(e=>{a(e)}));await e}}beforeSave(){if(null!=this._modificationsSource)return this.load().then((()=>{}),(()=>{}))}async fetchAttributionData(){return this.load().then((()=>({})))}_validateElevationInfo(e){const t="Integrated mesh 3d tiles layers";P(r.getLogger(this),V(t,"absolute-height",e)),P(r.getLogger(this),k(t,e))}};e([l({type:["IntegratedMesh3DTilesLayer"]})],G.prototype,"operationalLayerType",void 0),e([l({type:z}),f({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],G.prototype,"modifications",void 0),e([p(["web-scene","portal-item"],"modifications")],G.prototype,"readModifications",null),e([l({type:A})],G.prototype,"spatialReference",void 0),e([l({type:_})],G.prototype,"fullExtent",void 0),e([l(D)],G.prototype,"elevationInfo",null),e([l({type:["show","hide"]})],G.prototype,"listMode",void 0),e([l(N)],G.prototype,"url",void 0),e([l({readOnly:!0})],G.prototype,"type",void 0),e([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],G.prototype,"path",void 0),e([l({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],G.prototype,"minScale",void 0),e([l({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],G.prototype,"maxScale",void 0),G=e([c("esri.layers.IntegratedMesh3DTilesLayer")],G);const O=G;export{O as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import i from"../core/Accessor.js";import r from"../core/Logger.js";import{isAbortError as s}from"../core/promiseUtils.js";import{watch as n}from"../core/reactiveUtils.js";import{addFrameTask as a}from"../core/scheduling.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{wasmFailedToInit as d,Lyr3DWasmWorkerOutputStatus as h,invalidLayerView as _}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as u}from"./Lyr3DWorkerHandle.js";import{loadLyr3DMainWASM as y}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as g}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as m}from"../views/3d/layers/support/makeScheduleFunction.js";var c,b;!function(e){e[e.Lifetime=0]="Lifetime",e[e.Jobs=1]="Jobs",e[e.Renderables=2]="Renderables"}(c||(c={})),function(e){e[e.Critical=0]="Critical",e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Info=3]="Info"}(b||(b={}));let f=class extends i{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._debugFlags=new Set,this._debugLevel=b.Critical,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._session=null,this._debugFlags.add(c.Lifetime),this._debugFlags.add(c.Jobs),this._debugFlags.add(c.Renderables)}_debugLog(e,t,i,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=t){const e=s?`[js] ${i}`:`${i}`;t===b.Critical||t===b.Error?r.getLogger(this).error(e):t===b.Warning&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}initialize(){this._debugLevel>b.Warning&&(r.getLogger(this).level="info"),this._debugLog(c.Lifetime,b.Info,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([n((()=>this.view.state?.contentCamera),(()=>this._updateWasmCamera()))]),this._pulseTaskHandle=a({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(c.Lifetime,b.Info,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach((e=>{e.abortController.abort()})),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null);const e=this._worker;e&&e.destroyWasm().then((()=>{this._worker?.destroy(),this._worker=null})),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}add3DTilesLayerView(e){return this._lyr3DMain?this._add3DTilesLayerView(e):(this._debugLog(c.Lifetime,b.Error,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),d)}remove3DTilesLayerView(e){if(!this._lyr3DMain)return this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const t=this._layers.size;return 0===t&&(this._debugLog(c.Lifetime,b.Info,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),t}setEnabled(e,t){if(!this._lyr3DMain)return void this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);i&&(this._lyr3DMain.set_enabled(e.wasmLayerId,t),i.needMemoryUsageUpdate=!0,i.needFrame=!0,i.layerView.updatingFlagChanged())}setLayerOffset(e,t){if(!this._lyr3DMain)return void this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,t)}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,t,i){if(!this._lyr3DMain)return void this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,t,i)}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const t=this._layers.get(e);return!!t&&(t.outstandingJobCount>0||t.outstandingRenderableCount>0||t.needFrame)}initializeWasm(e,t){return this._lyr3DMain?Promise.resolve():(this._debugLog(c.Lifetime,b.Info,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=y().then((i=>{this._lyr3DMain=i,this._lyr3DMainPromise=null;const r=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),s=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),n=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),a=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),l="global"===this.view.viewingMode,d=this.view.renderSpatialReference?.isWebMercator?3857:this.view.renderSpatialReference?.wkid??-1,h=this.view.heightModelInfo?.heightModel,_=!h||"gravity-related-height"===h;return this._lyr3DMain.initialize_lyr3d_wasm(o,r,s,n,a,e,t,l,_,d,this._debugLevel)?(this._worker=new u(m(this.view.resourceController)),this._worker.promise?this._worker.promise:void 0):(this._lyr3DMain=null,void this._debugLog(c.Lifetime,b.Critical,"Lyr3d Main WASM failed to initialize",!1))})).catch((e=>{this._debugLog(c.Lifetime,b.Critical,`Lyr3d WASM failed to download error = ${e}`,!1)}))),this._lyr3DMainPromise)}_pulseTask(){if(this._lyr3DMain){let e=0,t=0;this._layers.forEach((i=>{e+=i.layerView.usedMemory,t+=i.layerView.cachedMemory})),e/=1048576,t/=1048576;const i=this.view.resourceController.memoryController,r=i.usedMemory*i.maxMemory-e;this._lyr3DMain.frame_pulse(i.memoryFactor,e,t,r,i.maxMemory),this._layers.forEach((e=>{!0===e.needFrame&&(e.needFrame=!1,e.layerView.updatingFlagChanged())}))}}_incrementJobCount(e){e.outstandingJobCount+=1,1===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_decrementJobCount(e){e.outstandingJobCount-=1,0===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){e.outstandingRenderableCount+=1,e.outstandingJobCount<1&&1===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){e.outstandingRenderableCount-=1,e.outstandingJobCount<1&&0===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_onJobFailed(e,t,i){t.error.length&&this._debugLog(c.Jobs,b.Error,t.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(i.jobId,i.desc),this._decrementJobCount(e)}_onJobSucceeded(e,t,i){if(this._lyr3DMain){const e=t.data.byteLength,r=this._lyr3DMain._malloc(e);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,r,e).set(t.data),this._lyr3DMain.on_job_completed(i.jobId,t.jobDescJson,r,e),this._lyr3DMain._free(r)}this._decrementJobCount(e)}_getRequestPromises(e,i,r){const s=[];for(const n of e){const e=new URL(n),a=e.searchParams.get("session");a?this._session=a:!this._session||e.origin===r.origin&&e.pathname===r.pathname||e.searchParams.append("session",this._session),s.push(t(e.toString(),i).then((e=>e.data)))}return s}_onNewJob(){const e=this._lyr3DMain.get_next_job(),t=this._layers.get(e.layerId);if(!t)return;this._incrementJobCount(t);const i=t.abortController.signal,r={responseType:"array-buffer",signal:i,query:{...t.customParameters,token:t.apiKey}},n={inputs:[],jobDescJson:e.desc,isMissingResourceCase:!1},a=new URL(t.layerView.layer.url),o=this._getRequestPromises(e.urls,r,a);Promise.all(o).then((e=>(n.inputs=e,this._worker.invoke(n,i)))).then((e=>e)).catch((t=>(s(t)?this._debugLog(c.Jobs,b.Warning,`job ${e.jobId} was cancelled.`):this._debugLog(c.Jobs,b.Error,`job ${e.jobId} failed with error ${t}.`),{status:h.Failed,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}))).then((o=>{if(o.status===h.Failed)this._onJobFailed(t,o,e);else if(o.status===h.Succeeded)this._onJobSucceeded(t,o,e);else if(o.status===h.MissingInputs){const l=this._getRequestPromises(o.missingInputUrls,r,a);Promise.all(l).then((e=>{n.jobDescJson=o.jobDescJson,o.originalInputs?n.inputs=o.originalInputs:n.inputs=[],n.isMissingResourceCase=!0;for(const t of e)n.inputs.push(t);return this._worker.invoke(n,i)})).then((i=>{i.status===h.Failed?this._onJobFailed(t,i,e):i.status===h.Succeeded&&this._onJobSucceeded(t,i,e)})).catch((i=>{this._decrementJobCount(t),s(i)?this._debugLog(c.Jobs,b.Warning,`job ${e.jobId} was cancelled.`):this._debugLog(c.Jobs,b.Error,`job ${e.jobId} failed with error2 ${i}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)}))}}))}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),t=e.meshData;if(t.data&&t.data.byteLength>0){const e=t.data.slice();t.data=e}const i=this._layers.get(e.layerId);i&&(this._incrementRenderableCount(i),i.layerView.createRenderable(e).then((t=>{this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!0,e.layerId,e.handle,t.memUsageBytes),this._decrementRenderableCount(i)})).catch((t=>{s(t)||this._debugLog(c.Renderables,b.Error,`createRenderable failed with error ${t}.`),this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!1,e.layerId,e.handle,0),this._decrementRenderableCount(i)})))}_freeRenderables(e,t,i){if(i<1)return;const r=this._layers.get(e);if(!r)return;const s=r.layerView,n=[],a=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,i);for(let o=0;o<i;++o)n.push(a[o]);for(let o=0;o<i;++o)s.freeRenderable(n[o])}_setRenderableVisibility(e,t,i,r){if(r<1)return;const s=this._layers.get(e);if(!s)return;const n=s.layerView,a=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,r),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,i,r);for(let h=0;h<r;++h)a.push(l[h]),o.push(1===d[h]);n.setRenderableVisibility(a,o,r)}_onWasmError(e,t,i,r){this._lyr3DMain&&this._debugLog(i,r,this._lyr3DMain.UTF8ToString(e,t),!1)}_doRemoveLayerView(e){const t=this._layers.get(e.wasmLayerId);return!!t&&(t.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._layers.delete(e.wasmLayerId),!0)}_add3DTilesLayerView(e){const t=e.layer;if(!t.url)return _;const i=this._lyr3DMain.get_next_layer_id(),r=new AbortController;this._layers.set(i,{layerView:e,abortController:r,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:t.customParameters,apiKey:t.apiKey,needFrame:!1});const s=g(t.elevationInfo);return this._lyr3DMain.add_layer(t.url,i,s)?(this._updateWasmCamera(),i):(this._layers.delete(i),_)}_updateWasmCamera(){const e=this.view.state?.contentCamera;if(!e||!this._lyr3DMain)return;const{eye:t,center:i,up:r,near:s,far:n,fovY:a}=e,o=[e.viewport[2],e.viewport[3]],l=e.width/e.height;this._lyr3DMain.set_camera_parameters({eye:t,center:i,up:r,near:s,far:n,fov:a,aspectRatio:l,viewport:o})}};e([o({constructOnly:!0})],f.prototype,"view",void 0),f=e([l("esri.layers.Lyr3DWasmPerSceneView")],f);const w=f;export{w as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import i from"../core/Accessor.js";import r from"../core/Logger.js";import{isAbortError as s}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{addFrameTask as n}from"../core/scheduling.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{wasmFailedToInit as d,Lyr3DWasmWorkerOutputStatus as h,invalidLayerView as _}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as u}from"./Lyr3DWorkerHandle.js";import{loadLyr3DMainWASM as y}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as g}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as m}from"../views/3d/layers/support/makeScheduleFunction.js";var c,b;!function(e){e[e.Lifetime=0]="Lifetime",e[e.Jobs=1]="Jobs",e[e.Renderables=2]="Renderables"}(c||(c={})),function(e){e[e.Critical=0]="Critical",e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Info=3]="Info"}(b||(b={}));let f=class extends i{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._debugFlags=new Set,this._debugLevel=b.Critical,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._session=null,this._debugFlags.add(c.Lifetime),this._debugFlags.add(c.Jobs),this._debugFlags.add(c.Renderables)}_debugLog(e,t,i,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=t){const e=s?`[js] ${i}`:`${i}`;t===b.Critical||t===b.Error?r.getLogger(this).error(e):t===b.Warning&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}initialize(){this._debugLevel>b.Warning&&(r.getLogger(this).level="info"),this._debugLog(c.Lifetime,b.Info,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([a((()=>this.view.state?.contentCamera),(()=>this._updateWasmCamera()))]),this._pulseTaskHandle=n({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(c.Lifetime,b.Info,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach((e=>{e.abortController.abort()})),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null);const e=this._worker;e&&e.destroyWasm().then((()=>{this._worker?.destroy(),this._worker=null})),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}add3DTilesLayerView(e){return this._lyr3DMain?this._add3DTilesLayerView(e):(this._debugLog(c.Lifetime,b.Error,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),d)}remove3DTilesLayerView(e){if(!this._lyr3DMain)return this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const t=this._layers.size;return 0===t&&(this._debugLog(c.Lifetime,b.Info,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),t}setEnabled(e,t){if(!this._lyr3DMain)return void this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);i&&(this._lyr3DMain.set_enabled(e.wasmLayerId,t),i.needMemoryUsageUpdate=!0,i.needFrame=!0,i.layerView.updatingFlagChanged())}setLayerOffset(e,t){if(!this._lyr3DMain)return void this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,t)}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,t,i){if(!this._lyr3DMain)return void this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,t,i)}setMeshModifications(e,t,i){if(!this._lyr3DMain)return void this._debugLog(c.Lifetime,b.Error,this._wasmNotLoaded);const r=this._layers.get(e.wasmLayerId);if(r){const s=this._lyr3DMain._malloc(8*t.length),a=new Float64Array(this._lyr3DMain.HEAPF64.buffer,s,t.length);for(let e=0;e<t.length;++e)a[e]=t[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,s,t.length,i),this._lyr3DMain._free(s),r.needFrame=!0,r.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const t=this._layers.get(e);return!!t&&(t.outstandingJobCount>0||t.outstandingRenderableCount>0||t.needFrame)}initializeWasm(e,t){return this._lyr3DMain?Promise.resolve():(this._debugLog(c.Lifetime,b.Info,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=y().then((i=>{this._lyr3DMain=i,this._lyr3DMainPromise=null;const r=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),s=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),l="global"===this.view.viewingMode,d=this.view.renderSpatialReference?.isWebMercator?3857:this.view.renderSpatialReference?.wkid??-1,h=this.view.heightModelInfo?.heightModel,_=!h||"gravity-related-height"===h;return this._lyr3DMain.initialize_lyr3d_wasm(o,r,s,a,n,e,t,l,_,d,this._debugLevel)?(this._worker=new u(m(this.view.resourceController)),this._worker.promise?this._worker.promise:void 0):(this._lyr3DMain=null,void this._debugLog(c.Lifetime,b.Critical,"Lyr3d Main WASM failed to initialize",!1))})).catch((e=>{this._debugLog(c.Lifetime,b.Critical,`Lyr3d WASM failed to download error = ${e}`,!1)}))),this._lyr3DMainPromise)}_pulseTask(){if(this._lyr3DMain){let e=0,t=0;this._layers.forEach((i=>{e+=i.layerView.usedMemory,t+=i.layerView.cachedMemory})),e/=1048576,t/=1048576;const i=this.view.resourceController.memoryController,r=i.usedMemory*i.maxMemory-e;this._lyr3DMain.frame_pulse(i.memoryFactor,e,t,r,i.maxMemory),this._layers.forEach((e=>{!0===e.needFrame&&(e.needFrame=!1,e.layerView.updatingFlagChanged())}))}}_incrementJobCount(e){e.outstandingJobCount+=1,1===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_decrementJobCount(e){e.outstandingJobCount-=1,0===e.outstandingJobCount&&e.outstandingRenderableCount<1&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){e.outstandingRenderableCount+=1,e.outstandingJobCount<1&&1===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){e.outstandingRenderableCount-=1,e.outstandingJobCount<1&&0===e.outstandingRenderableCount&&e.layerView.updatingFlagChanged()}_onJobFailed(e,t,i){t.error.length&&this._debugLog(c.Jobs,b.Error,t.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(i.jobId,i.desc),this._decrementJobCount(e)}_onJobSucceeded(e,t,i){if(this._lyr3DMain){const e=t.data.byteLength,r=this._lyr3DMain._malloc(e);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,r,e).set(t.data),this._lyr3DMain.on_job_completed(i.jobId,t.jobDescJson,r,e),this._lyr3DMain._free(r)}this._decrementJobCount(e)}_getRequestPromises(e,i,r){const s=[];for(const a of e){const e=new URL(a),n=e.searchParams.get("session");n?this._session=n:!this._session||e.origin===r.origin&&e.pathname===r.pathname||e.searchParams.append("session",this._session),s.push(t(e.toString(),i).then((e=>e.data)))}return s}_onNewJob(){const e=this._lyr3DMain.get_next_job(),t=this._layers.get(e.layerId);if(!t)return;this._incrementJobCount(t);const i=t.abortController.signal,r={responseType:"array-buffer",signal:i,query:{...t.customParameters,token:t.apiKey}},a={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},n=new URL(t.layerView.layer.url),o=this._getRequestPromises(e.urls,r,n);Promise.all(o).then((e=>(a.inputs=e,this._worker.invoke(a,i)))).then((e=>e)).catch((t=>(s(t)?this._debugLog(c.Jobs,b.Warning,`job ${e.jobId} was cancelled.`):this._debugLog(c.Jobs,b.Error,`job ${e.jobId} failed with error ${t}.`),{status:h.Failed,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}))).then((o=>{if(o.status===h.Failed)this._onJobFailed(t,o,e);else if(o.status===h.Succeeded)this._onJobSucceeded(t,o,e);else if(o.status===h.MissingInputs){const l=this._getRequestPromises(o.missingInputUrls,r,n);Promise.all(l).then((e=>{a.jobDescJson=o.jobDescJson,o.originalInputs?a.inputs=o.originalInputs:a.inputs=[],a.isMissingResourceCase=!0;for(const t of e)a.inputs.push(t);return this._worker.invoke(a,i)})).then((i=>{i.status===h.Failed?this._onJobFailed(t,i,e):i.status===h.Succeeded&&this._onJobSucceeded(t,i,e)})).catch((i=>{this._decrementJobCount(t),s(i)?this._debugLog(c.Jobs,b.Warning,`job ${e.jobId} was cancelled.`):this._debugLog(c.Jobs,b.Error,`job ${e.jobId} failed with error2 ${i}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)}))}}))}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),t=e.meshData;if(t.data&&t.data.byteLength>0){const e=t.data.slice();t.data=e}const i=this._layers.get(e.layerId);i&&(this._incrementRenderableCount(i),i.layerView.createRenderable(e).then((t=>{this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!0,e.layerId,e.handle,t.memUsageBytes),this._decrementRenderableCount(i)})).catch((t=>{s(t)||this._debugLog(c.Renderables,b.Error,`createRenderable failed with error ${t}.`),this._lyr3DMain&&this._lyr3DMain.on_renderable_created(!1,e.layerId,e.handle,0),this._decrementRenderableCount(i)})))}_freeRenderables(e,t,i){if(i<1)return;const r=this._layers.get(e);if(!r)return;const s=r.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,i);for(let o=0;o<i;++o)a.push(n[o]);for(let o=0;o<i;++o)s.freeRenderable(a[o])}_setRenderableVisibility(e,t,i,r){if(r<1)return;const s=this._layers.get(e);if(!s)return;const a=s.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,r),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,i,r);for(let h=0;h<r;++h)n.push(l[h]),o.push(1===d[h]);a.setRenderableVisibility(n,o,r)}_onWasmError(e,t,i,r){this._lyr3DMain&&this._debugLog(i,r,this._lyr3DMain.UTF8ToString(e,t),!1)}_doRemoveLayerView(e){const t=this._layers.get(e.wasmLayerId);return!!t&&(t.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._layers.delete(e.wasmLayerId),!0)}_add3DTilesLayerView(e){const t=e.layer;if(!t.url)return _;const i=this._lyr3DMain.get_next_layer_id(),r=new AbortController;this._layers.set(i,{layerView:e,abortController:r,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:t.customParameters,apiKey:t.apiKey,needFrame:!1});const s=g(t.elevationInfo);return this._lyr3DMain.add_layer(t.url,i,s)?(this._updateWasmCamera(),i):(this._layers.delete(i),_)}_updateWasmCamera(){const e=this.view.state?.contentCamera;if(!e||!this._lyr3DMain)return;const{eye:t,center:i,up:r,near:s,far:a,fovY:n}=e,o=[e.viewport[2],e.viewport[3]],l=e.width/e.height;this._lyr3DMain.set_camera_parameters({eye:t,center:i,up:r,near:s,far:a,fov:n,aspectRatio:l,viewport:o})}};e([o({constructOnly:!0})],f.prototype,"view",void 0),f=e([l("esri.layers.Lyr3DWasmPerSceneView")],f);const w=f;export{w as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../PopupTemplate.js";import r from"../core/Clonable.js";import o from"../core/Collection.js";import i from"../core/Error.js";import s from"../core/Logger.js";import{MultiOriginJSONMixin as a}from"../core/MultiOriginJSONSupport.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import l from"../geometry/SpatialReference.js";import m from"./Layer.js";import{ParquetSource as d}from"./graphics/sources/ParquetSource.js";import{createCapabilities as u}from"./graphics/sources/support/clientSideDefaults.js";import{BlendLayer as c}from"./mixins/BlendLayer.js";import{CustomParametersMixin as f}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as y}from"./mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as g}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as h}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as j}from"./mixins/OperationalLayer.js";import{OrderedLayer as b}from"./mixins/OrderedLayer.js";import{PortalLayer as w}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as I}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as v}from"./mixins/TemporalLayer.js";import{labelsVisible as F}from"./support/commonProperties.js";import q from"./support/FeatureTemplate.js";import x from"./support/Field.js";import{defineFieldProperties as P}from"./support/fieldProperties.js";import{fixRendererFields as T,fixTimeInfoFields as S}from"./support/fieldUtils.js";import R from"./support/LabelClass.js";import{reader as L}from"./support/labelingInfo.js";import{ParquetEncodingBase as O}from"./support/ParquetEncodingBase.js";import{ParquetEncodingLocation as U}from"./support/ParquetEncodingLocation.js";import{ParquetEncodingWkb as D}from"./support/ParquetEncodingWkb.js";import{completeParquetLayerInfo as G,parquetGeometryTypeKebabDict as W}from"./support/parquetUtils.js";import{rendererTypes as _}from"../renderers/support/typeUtils.js";import C from"../rest/support/Query.js";import{createPopupTemplate as E}from"../support/popupUtils.js";const M=P(),k={types:{key:"type",base:O,typeMap:{wkb:D,location:U}}};let B=class extends(y(h(g(c(b(v(I(j(w(a(f(r.ClonableMixin(m))))))))))))){constructor(e){super(e),this.capabilities=u(!1,!1),this.copyright=null,this.fields=null,this.fieldsIndex=null,this.encoding=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.objectIdField=null,this.outFields=null,this.popupTemplate=null,this.source=null,this.spatialReference=l.WGS84,this.templates=null,this.title="Parquet",this.type="parquet",this.urls=new o}async load(e){return this.addResolvingPromise(this._load(e)),this}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){T(e,this.fieldsIndex),this._set("renderer",e)}createPopupTemplate(e){return E(this,e)}createQuery(){const e=new C;return e.returnGeometry=!0,e.outFields=["*"],e}async createSource(e){const t=await G({urls:this.urls,fields:this.fields,objectIdField:this.objectIdField,encoding:this.encoding,geometryType:this.geometryType,spatialReference:this.spatialReference,metadata:this.metadata},{customParameters:this.customParameters});let{fields:r,geometryType:o,encoding:a,spatialReference:p,objectIdField:n,urls:m,metadata:u}=t;if(null==r)throw new i("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer fields",t);if(null==o)throw new i("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer geometryType",t);if(null==a)throw new i("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer encoding",t);if(null==p)throw new i("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer spatialReference",t);if(!p.isGeographic&&!p.isWebMercator)throw new i("parquet-layer:unsupported","Unable to create parquet source: currently only geographic and Web Mercator supported",t);p.isGeographic&&!p.isWGS84&&(s.getLogger("parquet-layer").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",{spatialReference:t.spatialReference}),p=l.WGS84),null==n&&(n="__OBJECTID",r.push(new x({name:n,type:"oid",alias:n})));const c=new d({urls:m.items,fields:r,objectIdField:n,spatialReference:p,encoding:a,geometryType:o,metadata:u,customParameters:this.customParameters??void 0});return await c.load(e),c}getFieldDomain(e,t){return null}getField(e){return this.fieldsIndex.get(e)}async _load(e){const t=await this.createSource(e);this._set("source",t),this.fields=t.fields,this.objectIdField=t.objectIdField,this.encoding=t.encoding,this.metadata=t.metadata,this.geometryType=t.geometryType,this.spatialReference=t.spatialReference,T(this.renderer,this.fieldsIndex),S(this.timeInfo,this.fieldsIndex)}};e([p({readOnly:!0,json:{read:!1,write:!1}})],B.prototype,"capabilities",void 0),e([p({type:String})],B.prototype,"copyright",void 0),e([p({readOnly:!0})],B.prototype,"defaultPopupTemplate",null),e([p({type:[x],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],B.prototype,"fields",void 0),e([p(M.fieldsIndex)],B.prototype,"fieldsIndex",void 0),e([p(k)],B.prototype,"encoding",void 0),e([p({json:{read:{reader:W.read}}})],B.prototype,"geometryType",void 0),e([p(F)],B.prototype,"labelsVisible",void 0),e([p({type:[R],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:L},write:!0}})],B.prototype,"labelingInfo",void 0),e([p()],B.prototype,"metadata",void 0),e([p({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],B.prototype,"objectIdField",void 0),e([p(M.outFields)],B.prototype,"outFields",void 0),e([p({type:t,json:{name:"popupInfo",write:!0}})],B.prototype,"popupTemplate",void 0),e([p({types:_,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"}}}})],B.prototype,"renderer",null),e([p({json:{read:!1},cast:null,type:d,readOnly:!0})],B.prototype,"source",void 0),e([p({type:l})],B.prototype,"spatialReference",void 0),e([p({type:[q]})],B.prototype,"templates",void 0),e([p()],B.prototype,"title",void 0),e([p({json:{read:!1},readOnly:!0})],B.prototype,"type",void 0),e([p({type:o.ofType(String)})],B.prototype,"urls",void 0),B=e([n("esri.layers.ParquetLayer")],B);const J=B;export{J as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../PopupTemplate.js";import r from"../core/Clonable.js";import o from"../core/Collection.js";import i from"../core/Error.js";import s from"../core/Logger.js";import{MultiOriginJSONMixin as a}from"../core/MultiOriginJSONSupport.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import l from"../geometry/SpatialReference.js";import m from"./Layer.js";import{ParquetSource as d}from"./graphics/sources/ParquetSource.js";import{createCapabilities as u}from"./graphics/sources/support/clientSideDefaults.js";import{BlendLayer as c}from"./mixins/BlendLayer.js";import{CustomParametersMixin as f}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as y}from"./mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as g}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as h}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as j}from"./mixins/OperationalLayer.js";import{OrderedLayer as b}from"./mixins/OrderedLayer.js";import{PortalLayer as w}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as I}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as v}from"./mixins/TemporalLayer.js";import{labelsVisible as F}from"./support/commonProperties.js";import q from"./support/FeatureTemplate.js";import x from"./support/Field.js";import{defineFieldProperties as P}from"./support/fieldProperties.js";import{fixRendererFields as T,fixTimeInfoFields as S}from"./support/fieldUtils.js";import R from"./support/LabelClass.js";import{reader as L}from"./support/labelingInfo.js";import{ParquetEncodingBase as O}from"./support/ParquetEncodingBase.js";import U from"./support/ParquetEncodingLocation.js";import D from"./support/ParquetEncodingWkb.js";import{completeParquetLayerInfo as G,parquetGeometryTypeKebabDict as W}from"./support/parquetUtils.js";import{rendererTypes as _}from"../renderers/support/typeUtils.js";import C from"../rest/support/Query.js";import{createPopupTemplate as E}from"../support/popupUtils.js";const M=P(),k={types:{key:"type",base:O,typeMap:{wkb:D,location:U}}};let B=class extends(y(h(g(c(b(v(I(j(w(a(f(r.ClonableMixin(m))))))))))))){constructor(e){super(e),this.capabilities=u(!1,!1),this.copyright=null,this.fields=null,this.fieldsIndex=null,this.encoding=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.objectIdField=null,this.outFields=null,this.popupTemplate=null,this.source=null,this.spatialReference=l.WGS84,this.templates=null,this.title="Parquet",this.type="parquet",this.urls=new o}async load(e){return this.addResolvingPromise(this._load(e)),this}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){T(e,this.fieldsIndex),this._set("renderer",e)}createPopupTemplate(e){return E(this,e)}createQuery(){const e=new C;return e.returnGeometry=!0,e.outFields=["*"],e}async createSource(e){const t=await G({urls:this.urls,fields:this.fields,objectIdField:this.objectIdField,encoding:this.encoding,geometryType:this.geometryType,spatialReference:this.spatialReference,metadata:this.metadata},{customParameters:this.customParameters});let{fields:r,geometryType:o,encoding:a,spatialReference:p,objectIdField:n,urls:m,metadata:u}=t;if(null==r)throw new i("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer fields",t);if(null==o)throw new i("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer geometryType",t);if(null==a)throw new i("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer encoding",t);if(null==p)throw new i("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer spatialReference",t);if(!p.isGeographic&&!p.isWebMercator)throw new i("parquet-layer:unsupported","Unable to create parquet source: currently only geographic and Web Mercator supported",t);p.isGeographic&&!p.isWGS84&&(s.getLogger("parquet-layer").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",{spatialReference:t.spatialReference}),p=l.WGS84),null==n&&(n="__OBJECTID",r.push(new x({name:n,type:"oid",alias:n})));const c=new d({urls:m.items,fields:r,objectIdField:n,spatialReference:p,encoding:a,geometryType:o,metadata:u,customParameters:this.customParameters??void 0});return await c.load(e),c}getFieldDomain(e,t){return null}getField(e){return this.fieldsIndex.get(e)}async _load(e){const t=await this.createSource(e);this._set("source",t),this.fields=t.fields,this.objectIdField=t.objectIdField,this.encoding=t.encoding,this.metadata=t.metadata,this.geometryType=t.geometryType,this.spatialReference=t.spatialReference,T(this.renderer,this.fieldsIndex),S(this.timeInfo,this.fieldsIndex)}};e([p({readOnly:!0,json:{read:!1,write:!1}})],B.prototype,"capabilities",void 0),e([p({type:String})],B.prototype,"copyright",void 0),e([p({readOnly:!0})],B.prototype,"defaultPopupTemplate",null),e([p({type:[x],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],B.prototype,"fields",void 0),e([p(M.fieldsIndex)],B.prototype,"fieldsIndex",void 0),e([p(k)],B.prototype,"encoding",void 0),e([p({json:{read:{reader:W.read}}})],B.prototype,"geometryType",void 0),e([p(F)],B.prototype,"labelsVisible",void 0),e([p({type:[R],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:L},write:!0}})],B.prototype,"labelingInfo",void 0),e([p()],B.prototype,"metadata",void 0),e([p({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],B.prototype,"objectIdField",void 0),e([p(M.outFields)],B.prototype,"outFields",void 0),e([p({type:t,json:{name:"popupInfo",write:!0}})],B.prototype,"popupTemplate",void 0),e([p({types:_,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"}}}})],B.prototype,"renderer",null),e([p({json:{read:!1},cast:null,type:d,readOnly:!0})],B.prototype,"source",void 0),e([p({type:l})],B.prototype,"spatialReference",void 0),e([p({type:[q]})],B.prototype,"templates",void 0),e([p()],B.prototype,"title",void 0),e([p({json:{read:!1},readOnly:!0})],B.prototype,"type",void 0),e([p({type:o.ofType(String)})],B.prototype,"urls",void 0),B=e([n("esri.layers.ParquetLayer")],B);const J=B;export{J as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import i from"../../core/Error.js";import r from"../../core/Logger.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{Integer as n,ensureClass as o}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{enumeration as a}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as l}from"../../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import u from"../../geometry/Point.js";import p from"../../geometry/SpatialReference.js";import{getInfo as c}from"../../geometry/support/spatialReferenceUtils.js";import{sanitizeUrl as d}from"../support/arcgisLayerUrl.js";import{url as h}from"../support/commonProperties.js";import f from"../support/DimensionalDefinition.js";import y from"../support/MultidimensionalSubset.js";import{interpolationKebab as g}from"../support/rasterEnums.js";import b from"../support/RasterFunction.js";import R from"../support/TileInfo.js";import{isFunctionRaster as I}from"../support/rasterDatasets/datasetUtils.js";import x from"../support/rasterDatasets/FunctionRaster.js";import{getEffectiveMultidimensionalDefinition as S,getDefaultVariableInfo as w,isMultiSliceOrRangeDefinition as F,convertOleDateTimeToEpoch as v,getSubsetVariablesFromMdInfo as _,getDefaultMultidimensionalDefinition as j}from"../support/rasterDatasets/multidimensionalUtils.js";import{snapToRaster as D,clip as J}from"../support/rasterFunctions/clipUtils.js";import{create as N}from"../support/rasterFunctions/rasterFunctionHelper.js";import{load as T,projectExtent as O,projectPolygon as z}from"../support/rasterFunctions/rasterProjectionHelper.js";import{computeStatisticsHistograms as H}from"../support/rasterFunctions/stretchUtils.js";import{getVariableRasterInfo as P,getDefaultInterpolation as E,matchPresetRenderer as C,getDefaultBandCombination as M,getFunctionColorRamp as U,createDefaultRenderer as L,normalizeRendererJSON as k}from"../../renderers/support/rasterRendererHelper.js";import q from"../../renderers/support/RasterSymbolizer.js";import{rasterRendererTypes as A,websceneRasterRendererTypes as B,read as V}from"../../renderers/support/rasterTypeUtils.js";import $ from"../../rest/support/ImageHistogramParameters.js";import G from"../../rest/support/ImageSample.js";import W from"../../rest/support/ImageSampleParameters.js";import K from"../../rest/support/ImageSampleResult.js";const Q=1e3,X=X=>{let Y=class extends X{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=I(e[0]?.raster)}destroy(){this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",d(e,r.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find((({name:t})=>t===e));return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const r=t?.layerDefinition?.drawingInfo?.renderer;return V(r,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=o($,e).clone();const{serviceRasterInfo:r}=this;if(null==r)throw new i("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new i("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let n=s;const{spatialReference:a}=r;if(!s.spatialReference.equals(a)){await T();const e="extent"===s.type?O(s,a):z(s,a);if(null==e)throw new i("imagery-tile-mixin:compute-statistics-histograms","geometry cannot be projected to the data source");n=e}const l=e.pixelSize??new u({x:r.pixelSize.x,y:r.pixelSize.y,spatialReference:a}),{extent:m,width:p,height:c}=D(r,n,l),d=await this.fetchPixels(m,p,c,{...t,interpolation:"nearest"});if(null==d.pixelBlock)throw new i("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const h=await J(d.pixelBlock,m,n),f=this._rasterJobHandler;return f?f.computeStatisticsHistograms({pixelBlock:h},t):H(h)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=S({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:i}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:i}=this;if(!e||!t||!i)return;const{rasterInfo:r}=this.raster,s=w(r,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=s?.name,o=P(r,n);return this._updateSymbolizer(t,i,n,o)}async applyRenderer(e,t,i){const r=e?.pixelBlock;if(!(null!=r&&r.pixels&&r.pixels.length>0))return null;await this.updateRenderer();const s=this.bandIds??[],{pixelBlock:n}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:s,symbolizer:this.symbolizer},i);return n}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const r=c(e);return R.create({size:256,spatialReference:e,origin:r?{x:r.origin[0],y:r.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,i,r,s={}){if(Z(this),s.requestAsImageElement){const n=this.getTileUrl(e,i,r);return t(n,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then((e=>e.data))}const{serviceRasterInfo:n}=this;if(null!=n.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const t=s.tileInfo||n.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,i,r,t),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,i,r,s)}async fetchPixels(e,t,i,r={}){return null!=this.serviceRasterInfo.multidimensionalInfo&&null==(r=this.normalizeRasterFetchOptions(r)).multidimensionalDefinition?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i),this.raster.fetchPixels(e,t,i,r))}async getSamples(e,t){if(await this.load(),(e=o(W,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new i("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const r=e.mosaicRule?.multidimensionalDefinition,s={...t,multidimensionalDefinition:r},n=(await this._getSampleLocations(e)).map((e=>this.identify(e,s).then((t=>(t.location=e,t))))),a=(await Promise.all(n)).flatMap(((e,t)=>this._convertRasterIdentifyResultToSample(e,t)));return new K({samples:a})}async identify(e,t={}){await this.load();const{raster:r,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo){if(!(s.hasMultidimensionalTranspose&&!!(F(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent))&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:e,value:null}}const n=this.multidimensionalSubset?.areaOfInterest;if(n&&!n.contains(e))throw new i("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return r.identify(e,t)}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some((e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some((e=>"StdTime"===e.name)))))}getStandardTimeValue(e){return new Date(v(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return _(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=j(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&I(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then((async()=>{if(!this._rasterJobHandler)return;Z(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,I(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch((()=>{})),this.renderer&&this.updateRenderer()})).catch((()=>{}))}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:i,type:r}=t;if("multipoint"===r)return t.points.map((e=>new u({x:e[0],y:e[1],spatialReference:i})));if("polyline"===r){let r=t;if(e.sampleCount||e.sampleDistance){const i=await import("../../geometry/operators/densifyOperator.js"),s=(await import("../../geometry/operators/lengthOperator.js")).execute(t,{unit:"meters"}),n=Math.min(e.sampleCount||100,Q);let o=e.sampleDistance;if(!o){o=s/(n+(2===r.paths[0].length?1:0))}r=i.execute(t,o,{unit:"meters"})}return r.paths.flatMap((e=>e.map((e=>new u({x:e[0],y:e[1],spatialReference:i})))))}const s=Math.min(e.sampleCount||100,Q),n="extent"===t.type,o=n?t:t.extent,a=Math.sqrt(o.width*o.height/s),l=o.height/a,m=o.width/a,{xmin:p,ymax:c}=o,d=[];for(let h=0;h<l;h++)for(let e=0;e<m;e++){const r=new u({x:p+(e+.5)*a,y:c-(h+.5)*a,spatialReference:i});(n||t.contains(r))&&d.push(r)}return d}_configDefaultInterpolation(){if(null==this.interpolation){Z(this);const{raster:e}=this,t=E(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){Z(this);const{rasterInfo:t}=this.raster,i=w(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,n=C({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=n?.bandIds??M(t)),!this.renderer||"override"===e){const e=U(this.raster),i=n?.renderer??L(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),r=t.statistics,o=r&&r.length>0?r[0]:null,a=o?.max??0,l=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(a>1e24||l<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const o=k({...this.renderer.toJSON(),variableName:s}),a=P(t,s);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=a):this.symbolizer=new q({rendererJSON:o,rasterInfo:a});const l=this.symbolizer.bind();if(l.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=L(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else r.getLogger(this).warn("imagery-tile-mixin",l.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&I(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",b.fromJSON(e)))}let e,t=this.raster,i=!1;I(t)?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:r}=this;if(r){const i={raster:t};e.length>1&&e.forEach((e=>i[e.url]=e));const s=N(r.functionDefinition?.toJSON()??r.toJSON(),i),n=new x({rasterFunction:s});n.rasterJobHandler=this._rasterJobHandler,await n.open(),this.raster=n}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!i&&!r)return;const{bandIds:s}=this,{bandCount:n}=this.raster.rasterInfo,o=s?.length?s.some((e=>e>=n)):n>=3;s&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:i}=this.raster,r=i.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),s=(i.pixelSize.x+i.pixelSize.y)/2*r;if(!e.dataSeries?.length)return[new G({location:e.location,pixelValue:e.value,locationId:t,resolution:s})];const n=[];return e.dataSeries.forEach((({value:i,multidimensionalDefinition:r},o)=>{const a={Variables:r[0].variableName,Dimensions:r.flatMap((({dimensionName:e})=>e)).join(",")};for(const{dimensionName:e,values:t}of r){a[e]=Array.isArray(t[0])?t[0][0]:t[0];const i=t[t.length-1];a[`${e}_Max`]=Array.isArray(i)?i[i.length-1]:i}const l=new G({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:s,attributes:a});n.push(l)})),n}};function Z(e){if(!e.raster||!e.serviceRasterInfo)throw new i("imagery-tile","no raster")}return e([s({clonable:!1})],Y.prototype,"_cachedRasterFunctionJson",void 0),e([s({clonable:!1})],Y.prototype,"_compatibleFullExtent",void 0),e([s({clonable:!1})],Y.prototype,"_isConstructedFromFunctionRaster",void 0),e([s({clonable:!1})],Y.prototype,"_rasterFunctionUpdatePromise",void 0),e([s({type:[n],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],Y.prototype,"bandIds",void 0),e([s({json:{origins:{service:{read:{source:"copyrightText"}}}}})],Y.prototype,"copyright",void 0),e([s({json:{read:!1}})],Y.prototype,"fullExtent",null),e([s({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),a(g)],Y.prototype,"interpolation",void 0),e([s()],Y.prototype,"ioConfig",void 0),e([s({type:[f],json:{write:!0}})],Y.prototype,"multidimensionalDefinition",null),e([s({type:y,json:{write:!0}})],Y.prototype,"multidimensionalSubset",void 0),e([s()],Y.prototype,"raster",void 0),e([s({type:b})],Y.prototype,"rasterFunction",null),e([s()],Y.prototype,"serviceRasterInfo",void 0),e([s()],Y.prototype,"sourceJSON",void 0),e([s({readOnly:!0,type:p,json:{read:!1}})],Y.prototype,"spatialReference",void 0),e([s({type:R})],Y.prototype,"tileInfo",void 0),e([s(h)],Y.prototype,"url",null),e([s()],Y.prototype,"renderer",null),e([s({types:A,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:B,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],Y.prototype,"internalRenderer",null),e([l("internalRenderer")],Y.prototype,"readRenderer",null),e([s({clonable:!1})],Y.prototype,"symbolizer",void 0),Y=e([m("esri.layers.mixins.ImageryTileMixin")],Y),Y};export{X as ImageryTileMixin};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import i from"../../core/Error.js";import r from"../../core/Logger.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{Integer as n,ensureClass as o}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{enumeration as a}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as l}from"../../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import u from"../../geometry/Point.js";import p from"../../geometry/SpatialReference.js";import{getInfo as c}from"../../geometry/support/spatialReferenceUtils.js";import{sanitizeUrl as d}from"../support/arcgisLayerUrl.js";import{url as h}from"../support/commonProperties.js";import f from"../support/DimensionalDefinition.js";import y from"../support/MultidimensionalSubset.js";import{interpolationKebab as g}from"../support/rasterEnums.js";import b from"../support/RasterFunction.js";import R from"../support/TileInfo.js";import{isFunctionRaster as I}from"../support/rasterDatasets/datasetUtils.js";import x from"../support/rasterDatasets/FunctionRaster.js";import{getEffectiveMultidimensionalDefinition as S,getDefaultVariableInfo as w,isMultiSliceOrRangeDefinition as v,convertOleDateTimeToEpoch as F,getSubsetVariablesFromMdInfo as _,getDefaultMultidimensionalDefinition as j}from"../support/rasterDatasets/multidimensionalUtils.js";import{snapToRaster as D,clip as J}from"../support/rasterFunctions/clipUtils.js";import{create as N}from"../support/rasterFunctions/rasterFunctionHelper.js";import{load as T,projectExtent as O,projectPolygon as z}from"../support/rasterFunctions/rasterProjectionHelper.js";import{computeStatisticsHistograms as H}from"../support/rasterFunctions/stretchUtils.js";import{getVariableRasterInfo as P,getDefaultInterpolation as E,matchPresetRenderer as C,getDefaultBandCombination as M,getFunctionColorRamp as U,createDefaultRenderer as q,normalizeRendererJSON as L}from"../../renderers/support/rasterRendererHelper.js";import k from"../../renderers/support/RasterSymbolizer.js";import{rasterRendererTypes as B,websceneRasterRendererTypes as A,read as V}from"../../renderers/support/rasterTypeUtils.js";import $ from"../../rest/support/ImageHistogramParameters.js";import G from"../../rest/support/ImageSample.js";import W from"../../rest/support/ImageSampleParameters.js";import K from"../../rest/support/ImageSampleResult.js";const Q=1e3,X=X=>{let Y=class extends X{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=I(e[0]?.raster)}destroy(){this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",d(e,r.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find((({name:t})=>t===e));return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const r=t?.layerDefinition?.drawingInfo?.renderer;return V(r,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=o($,e).clone();const{serviceRasterInfo:r}=this;if(null==r)throw new i("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new i("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let n=s;const{spatialReference:a}=r;if(!s.spatialReference.equals(a)){await T();const e="extent"===s.type?O(s,a):z(s,a);if(null==e)throw new i("imagery-tile-mixin:compute-statistics-histograms","geometry cannot be projected to the data source");n=e}const l=e.pixelSize??new u({x:r.pixelSize.x,y:r.pixelSize.y,spatialReference:a}),{extent:m,width:p,height:c}=D(r,n,l),d=await this.fetchPixels(m,p,c,{...t,interpolation:"nearest"});if(null==d.pixelBlock)throw new i("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const h=await J(d.pixelBlock,m,n),f=this._rasterJobHandler;return f?f.computeStatisticsHistograms({pixelBlock:h},t):H(h)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=S({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:i}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:i}=this;if(!e||!t||!i)return;const{rasterInfo:r}=this.raster,s=w(r,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=s?.name,o=P(r,n);return this._updateSymbolizer(t,i,n,o)}async applyRenderer(e,t,i){const r=e?.pixelBlock;if(!(null!=r&&r.pixels&&r.pixels.length>0))return null;await this.updateRenderer();const s=this.bandIds??[],{pixelBlock:n}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:s,symbolizer:this.symbolizer},i);return n}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const r=c(e);return R.create({size:256,spatialReference:e,origin:r?{x:r.origin[0],y:r.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,i,r,s={}){if(Z(this),s.requestAsImageElement){const n=this.getTileUrl(e,i,r);return t(n,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then((e=>e.data))}const{serviceRasterInfo:n}=this;if(null!=n.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const t=s.tileInfo||n.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,i,r,t),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,i,r,s)}async fetchPixels(e,t,i,r={}){return null!=this.serviceRasterInfo.multidimensionalInfo&&null==(r=this.normalizeRasterFetchOptions(r)).multidimensionalDefinition?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i),this.raster.fetchPixels(e,t,i,r))}async getSamples(e,t){if(await this.load(),(e=o(W,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new i("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const r=e.mosaicRule?.multidimensionalDefinition,s={...t,multidimensionalDefinition:r},n=(await this._getSampleLocations(e)).map((e=>this.identify(e,s).then((t=>(t.location=e,t))))),a=(await Promise.all(n)).flatMap(((e,t)=>this._convertRasterIdentifyResultToSample(e,t)));return new K({samples:a})}async identify(e,t={}){await this.load();const{raster:r,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo){if(!(s.hasMultidimensionalTranspose&&!!(v(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent))&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:e,value:null}}const n=this.multidimensionalSubset?.areaOfInterest;if(n&&!n.contains(e))throw new i("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");const o=this.serviceRasterInfo?.storageInfo.isBsqTile&&this.bandIds?.length?this.bandIds:void 0;return r.identify(e,{...t,bandIds:o})}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some((e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some((e=>"StdTime"===e.name)))))}getStandardTimeValue(e){return new Date(F(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return _(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=j(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&I(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then((async()=>{if(!this._rasterJobHandler)return;Z(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,I(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch((()=>{})),this.renderer&&this.updateRenderer()})).catch((()=>{}))}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:i,type:r}=t;if("multipoint"===r)return t.points.map((e=>new u({x:e[0],y:e[1],spatialReference:i})));if("polyline"===r){let r=t;if(e.sampleCount||e.sampleDistance){const i=await import("../../geometry/operators/densifyOperator.js"),s=(await import("../../geometry/operators/lengthOperator.js")).execute(t,{unit:"meters"}),n=Math.min(e.sampleCount||100,Q);let o=e.sampleDistance;if(!o){o=s/(n+(2===r.paths[0].length?1:0))}r=i.execute(t,o,{unit:"meters"})}return r.paths.flatMap((e=>e.map((e=>new u({x:e[0],y:e[1],spatialReference:i})))))}const s=Math.min(e.sampleCount||100,Q),n="extent"===t.type,o=n?t:t.extent,a=Math.sqrt(o.width*o.height/s),l=o.height/a,m=o.width/a,{xmin:p,ymax:c}=o,d=[];for(let h=0;h<l;h++)for(let e=0;e<m;e++){const r=new u({x:p+(e+.5)*a,y:c-(h+.5)*a,spatialReference:i});(n||t.contains(r))&&d.push(r)}return d}_configDefaultInterpolation(){if(null==this.interpolation){Z(this);const{raster:e}=this,t=E(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){Z(this);const{rasterInfo:t}=this.raster,i=w(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,n=C({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=n?.bandIds??M(t)),!this.renderer||"override"===e){const e=U(this.raster),i=n?.renderer??q(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),r=t.statistics,o=r&&r.length>0?r[0]:null,a=o?.max??0,l=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(a>1e24||l<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const o=L({...this.renderer.toJSON(),variableName:s}),a=P(t,s);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=a):this.symbolizer=new k({rendererJSON:o,rasterInfo:a});const l=this.symbolizer.bind();if(l.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=q(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else r.getLogger(this).warn("imagery-tile-mixin",l.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&I(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",b.fromJSON(e)))}let e,t=this.raster,i=!1;I(t)?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:r}=this;if(r){const i={raster:t};e.length>1&&e.forEach((e=>i[e.url]=e));const s=N(r.functionDefinition?.toJSON()??r.toJSON(),i),n=new x({rasterFunction:s});n.rasterJobHandler=this._rasterJobHandler,await n.open(),this.raster=n}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!i&&!r)return;const{bandIds:s}=this,{bandCount:n}=this.raster.rasterInfo,o=s?.length?s.some((e=>e>=n)):n>=3;s&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:i}=this.raster,r=i.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),s=(i.pixelSize.x+i.pixelSize.y)/2*r;if(!e.dataSeries?.length)return[new G({location:e.location,pixelValue:e.value,locationId:t,resolution:s})];const n=[];return e.dataSeries.forEach((({value:i,multidimensionalDefinition:r},o)=>{const a={Variables:r[0].variableName,Dimensions:r.flatMap((({dimensionName:e})=>e)).join(",")};for(const{dimensionName:e,values:t}of r){a[e]=Array.isArray(t[0])?t[0][0]:t[0];const i=t[t.length-1];a[`${e}_Max`]=Array.isArray(i)?i[i.length-1]:i}const l=new G({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:s,attributes:a});n.push(l)})),n}};function Z(e){if(!e.raster||!e.serviceRasterInfo)throw new i("imagery-tile","no raster")}return e([s({clonable:!1})],Y.prototype,"_cachedRasterFunctionJson",void 0),e([s({clonable:!1})],Y.prototype,"_compatibleFullExtent",void 0),e([s({clonable:!1})],Y.prototype,"_isConstructedFromFunctionRaster",void 0),e([s({clonable:!1})],Y.prototype,"_rasterFunctionUpdatePromise",void 0),e([s({type:[n],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],Y.prototype,"bandIds",void 0),e([s({json:{origins:{service:{read:{source:"copyrightText"}}}}})],Y.prototype,"copyright",void 0),e([s({json:{read:!1}})],Y.prototype,"fullExtent",null),e([s({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),a(g)],Y.prototype,"interpolation",void 0),e([s()],Y.prototype,"ioConfig",void 0),e([s({type:[f],json:{write:!0}})],Y.prototype,"multidimensionalDefinition",null),e([s({type:y,json:{write:!0}})],Y.prototype,"multidimensionalSubset",void 0),e([s()],Y.prototype,"raster",void 0),e([s({type:b})],Y.prototype,"rasterFunction",null),e([s()],Y.prototype,"serviceRasterInfo",void 0),e([s()],Y.prototype,"sourceJSON",void 0),e([s({readOnly:!0,type:p,json:{read:!1}})],Y.prototype,"spatialReference",void 0),e([s({type:R})],Y.prototype,"tileInfo",void 0),e([s(h)],Y.prototype,"url",null),e([s()],Y.prototype,"renderer",null),e([s({types:B,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:A,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],Y.prototype,"internalRenderer",null),e([l("internalRenderer")],Y.prototype,"readRenderer",null),e([s({clonable:!1})],Y.prototype,"symbolizer",void 0),Y=e([m("esri.layers.mixins.ImageryTileMixin")],Y),Y};export{X as ImageryTileMixin};
@@ -0,0 +1,4 @@
1
+ import "../../interfaces";
2
+
3
+ import ParquetEncodingLocation = __esri.ParquetEncodingLocation;
4
+ export default ParquetEncodingLocation;
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../chunks/tslib.es6.js";import t from"../../core/JSONSupport.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends t{constructor(o){super(o),this.type="location",this.latitudeFieldName=null,this.longitudeFieldName=null}};o([r({type:["location"],readOnly:!0,json:{write:!0}})],s.prototype,"type",void 0),o([r({json:{write:!0}})],s.prototype,"latitudeFieldName",void 0),o([r({json:{write:!0}})],s.prototype,"longitudeFieldName",void 0),s=o([e("esri.layers.support.ParquetEncodingLocation")],s);export{s as ParquetEncodingLocation};
5
+ import{_ as o}from"../../chunks/tslib.es6.js";import t from"../../core/JSONSupport.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends t{constructor(o){super(o),this.type="location",this.latitudeFieldName=null,this.longitudeFieldName=null}};o([e({type:["location"],readOnly:!0,json:{write:!0}})],s.prototype,"type",void 0),o([e({json:{write:!0}})],s.prototype,"latitudeFieldName",void 0),o([e({json:{write:!0}})],s.prototype,"longitudeFieldName",void 0),s=o([r("esri.layers.support.ParquetEncodingLocation")],s);const i=s;export{i as default};
@@ -0,0 +1,4 @@
1
+ import "../../interfaces";
2
+
3
+ import ParquetEncodingWkb = __esri.ParquetEncodingWkb;
4
+ export default ParquetEncodingWkb;