@arcgis/core 5.2.0-next.62 → 5.2.0-next.63

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 (202) hide show
  1. package/WebDocument2D.d.ts +17 -1
  2. package/WebDocument2D.js +1 -1
  3. package/WebLinkChart.js +1 -1
  4. package/WebMap.js +1 -1
  5. package/WebScene.js +1 -1
  6. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  7. package/arcgisGlobal.d.ts +5 -0
  8. package/assets/esri/core/workers/RemoteClient.js +1 -1
  9. package/assets/esri/core/workers/chunks/02dd79beb13eff6be85e.js +1 -0
  10. package/assets/esri/core/workers/chunks/04ffe788d2efc0a076dd.js +1 -0
  11. package/assets/esri/core/workers/chunks/0623acb2bd14a61b65c9.js +29 -0
  12. package/assets/esri/core/workers/chunks/08c2bf9defcece9e049a.js +1 -0
  13. package/assets/esri/core/workers/chunks/0d61c8d348b09179777a.js +1 -0
  14. package/assets/esri/core/workers/chunks/14cd8bb1ad4da8d1d2ca.js +1 -0
  15. package/assets/esri/core/workers/chunks/23a3d8f91caf3136b2aa.js +1 -0
  16. package/assets/esri/core/workers/chunks/{1b68b1b724ad30396723.js → 2426601b8cae7f06af4d.js} +1 -1
  17. package/assets/esri/core/workers/chunks/2a1c6df073e6ca6a6365.js +1 -0
  18. package/assets/esri/core/workers/chunks/{f4891345507df63cff3c.js → 3f775deea48e268411f1.js} +3 -3
  19. package/assets/esri/core/workers/chunks/{e3623e557ab463580fd2.js → 41e821ce229bc56dc1a1.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{17acbf40e7c1cb42d9bd.js → 44b1cdf28269b4fa8a39.js} +1 -1
  21. package/assets/esri/core/workers/chunks/44e8cd4b3dad777ab0c9.js +1 -0
  22. package/assets/esri/core/workers/chunks/456e616f32e7de696d38.js +1 -0
  23. package/assets/esri/core/workers/chunks/54b9667450d066c6f6ce.js +1 -0
  24. package/assets/esri/core/workers/chunks/5dbd8ca7e7b8eb9a0bf7.js +1 -0
  25. package/assets/esri/core/workers/chunks/5e3d5347223f0111f40f.js +1 -0
  26. package/assets/esri/core/workers/chunks/62f3ca0719ac6bc76512.js +1 -0
  27. package/assets/esri/core/workers/chunks/63ede7295938f7010808.js +1 -0
  28. package/assets/esri/core/workers/chunks/687cf21e027f49b44d22.js +1 -0
  29. package/assets/esri/core/workers/chunks/6c98a64d92c9bca78203.js +1 -0
  30. package/assets/esri/core/workers/chunks/{e7402dfd683f82878360.js → 752343d92ed48e674351.js} +1 -1
  31. package/assets/esri/core/workers/chunks/7538a0fe0cec3156769e.js +1 -0
  32. package/assets/esri/core/workers/chunks/{64247e439ef3e1f712e9.js → 7fdd6a5fa062778be55d.js} +1 -1
  33. package/assets/esri/core/workers/chunks/8369edafab7bdc59b95a.js +1 -0
  34. package/assets/esri/core/workers/chunks/{94e9cf8e729ec36de5be.js → 8c535c6a39d2be2ed655.js} +1 -1
  35. package/assets/esri/core/workers/chunks/8e1d4867406753c5483c.js +1 -0
  36. package/assets/esri/core/workers/chunks/92696cce2b980373f9ad.js +1 -0
  37. package/assets/esri/core/workers/chunks/{580451761cadfe308919.js → 9954149def644c371894.js} +1 -1
  38. package/assets/esri/core/workers/chunks/9f65cc6d9f7390bb1d5b.js +1 -0
  39. package/assets/esri/core/workers/chunks/a09ce34fc7c8abe64ed5.js +1 -0
  40. package/assets/esri/core/workers/chunks/{83991475aa54fd5aa008.js → a965d151515b76dd7566.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{128799741dd3c6fc69b9.js → ac4131121230cfc14f21.js} +1 -1
  42. package/assets/esri/core/workers/chunks/afeeb11b39e140303b5a.js +1 -0
  43. package/assets/esri/core/workers/chunks/b13d2da33ec07e9d41ff.js +1 -0
  44. package/assets/esri/core/workers/chunks/{33bd9785bd0b6ccef21b.js → b2cf1d3f0d48eac23a84.js} +1 -1
  45. package/assets/esri/core/workers/chunks/c53b2be005721591e29b.js +1 -0
  46. package/assets/esri/core/workers/chunks/{e287113777a94ded8de6.js → c82ab4f0908290e70ee9.js} +1 -1
  47. package/assets/esri/core/workers/chunks/d456520e4b119a2816b6.js +1 -0
  48. package/assets/esri/core/workers/chunks/d83ea3e4e9ab45334068.js +1 -0
  49. package/assets/esri/core/workers/chunks/{4f59357f535f30a6b5cc.js → d9b83d7dd7d1f7729a91.js} +1 -1
  50. package/assets/esri/core/workers/chunks/dbcec48c4ba104a6d0b5.js +1 -0
  51. package/assets/esri/core/workers/chunks/e02f02040b63d9c2e654.js +1 -0
  52. package/assets/esri/core/workers/chunks/e08c64e4ae5a68eae2be.js +1 -0
  53. package/assets/esri/core/workers/chunks/e2ddfc96ddba92302e0c.js +1 -0
  54. package/assets/esri/core/workers/chunks/{61d3fcb419d6bf7e355e.js → e65ee26feca0564aeb9b.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{35cbf00f0c37a86517af.js → ed1de8b7406269e217b9.js} +1 -1
  56. package/assets/esri/core/workers/chunks/ed4ac5568dc2815b066d.js +1 -0
  57. package/assets/esri/core/workers/chunks/f029c12f1afee0e9b2a1.js +1 -0
  58. package/assets/esri/core/workers/chunks/{461c2de938bf4c9b1442.js → f6715b8765cd36d81ec8.js} +1 -1
  59. package/assets/esri/core/workers/chunks/f9a4f4efd63b8189a4eb.js +1 -0
  60. package/assets/esri/core/workers/chunks/{26a2d4b95cda0a41d980.js → fa1c58e5b582d61a03ab.js} +1 -1
  61. package/assets/esri/core/workers/chunks/fa377112ef3b78f6ed18.js +1 -0
  62. package/chunks/VolumeMask.glsl.js +3 -0
  63. package/chunks/persistableUrlUtils.js +1 -1
  64. package/config.js +1 -1
  65. package/core/Collection.d.ts +42 -6
  66. package/core/Collection.js +1 -1
  67. package/geometry/SpatialReference.d.ts +1 -4
  68. package/kernel.js +1 -1
  69. package/layers/BaseElevationLayer.js +1 -1
  70. package/layers/ElevationLayer.js +1 -1
  71. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  72. package/layers/KnowledgeGraphLayer.js +1 -1
  73. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  74. package/layers/StreamLayer.js +1 -1
  75. package/layers/VoxelWasmPerSceneView.js +1 -1
  76. package/layers/graphics/sources/connections/createConnection.js +1 -1
  77. package/layers/graphics/sources/parquet/ParquetFileStatistics.js +1 -1
  78. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  79. package/layers/graphics/sources/support/QueryTask.js +1 -1
  80. package/layers/mixins/SceneService.js +1 -1
  81. package/layers/raster/datasets/BaseRaster.js +1 -1
  82. package/layers/save/groupLayerUtils.js +1 -1
  83. package/layers/save/mediaLayerUtils.js +1 -1
  84. package/layers/support/ElevationQueryTileCache.js +1 -1
  85. package/layers/video/types.d.ts +17 -1
  86. package/linkChart/LinkChartProperties.js +1 -1
  87. package/package.json +1 -1
  88. package/portal/support/jsonContext.js +1 -1
  89. package/support/persistableUrlUtils.js +1 -1
  90. package/support/revision.js +1 -1
  91. package/views/2d/layers/features/sources/strategies/AFeatureLoadStrategy.js +1 -1
  92. package/views/2d/layers/features/sources/strategies/FeatureHybridTileLoadStrategy.js +1 -1
  93. package/views/3d/GroundView3D.js +1 -1
  94. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  95. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  96. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  97. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  98. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  99. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  100. package/views/3d/support/gaussianSplatting/GaussianSplatHeaderTexture.js +1 -1
  101. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  102. package/views/3d/support/hitTest.js +1 -1
  103. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  104. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  105. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  106. package/views/3d/terrain/TerrainRenderer.js +1 -1
  107. package/views/3d/terrain/TerrainSurface.js +1 -1
  108. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
  109. package/views/3d/webgl-engine/collections/Component/ComponentObjectFixedBVH.js +1 -1
  110. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  111. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +1 -1
  112. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMask.js +1 -1
  113. package/views/3d/webgl-engine/lib/CutFillVisualization.js +1 -1
  114. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  115. package/views/3d/webgl-engine/lib/IntersectorResult.js +1 -1
  116. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  117. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  118. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  119. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
  120. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  121. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  122. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  123. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  124. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  125. package/views/3d/webgl-engine/materials/intersectWithPolygonOffset.js +1 -1
  126. package/views/3d/webgl-engine/shaders/ShadowCastMaskTechnique.js +1 -1
  127. package/views/3d/webgl-engine/shaders/{CutFillMask.glsl.js → VolumeMask.glsl.js} +1 -1
  128. package/views/3d/webgl-engine/shaders/VolumeMaskTechnique.js +2 -0
  129. package/webdoc/support/resourceUtils.js +1 -1
  130. package/webdoc/support/types.d.ts +2 -0
  131. package/webdoc/support/utils.js +2 -0
  132. package/webdoc/support/webdocLoadUtils.js +1 -1
  133. package/webdoc/support/webdocSaveUtils.js +1 -1
  134. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  135. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  136. package/widgets/BatchAttributeForm/expressions/ArcadeExecutorProvider.js +1 -1
  137. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  138. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  139. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  140. package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
  141. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  142. package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
  143. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  144. package/widgets/BatchAttributeForm/rendered-content/RelationshipDetails.js +1 -1
  145. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  146. package/widgets/BatchAttributeForm.js +1 -1
  147. package/widgets/Editor/UpdateWorkflow.js +1 -1
  148. package/widgets/Editor.js +1 -1
  149. package/widgets/FeatureForm.js +1 -1
  150. package/widgets/FeatureTable/Grid/Column.d.ts +6 -0
  151. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  152. package/widgets/Sketch/SketchViewModel.js +1 -1
  153. package/widgets/support/SelectionList/FeatureItem.d.ts +116 -0
  154. package/widgets/support/SelectionList/GroupLayerItem.d.ts +94 -0
  155. package/widgets/support/SelectionList/ItemBase.d.ts +70 -0
  156. package/widgets/support/SelectionList/LayerItem.d.ts +140 -0
  157. package/widgets/support/SelectionList/LayerItem.js +1 -1
  158. package/widgets/support/SelectionList/SelectionListViewModel.d.ts +265 -0
  159. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  160. package/widgets/support/SelectionList/types.d.ts +42 -0
  161. package/widgets/support/forms/formUtils.js +1 -1
  162. package/assets/esri/core/workers/chunks/003a87b16f8a4b476e14.js +0 -1
  163. package/assets/esri/core/workers/chunks/0a50efb07eee36237e21.js +0 -1
  164. package/assets/esri/core/workers/chunks/129fdd1636e67997337c.js +0 -1
  165. package/assets/esri/core/workers/chunks/12e0c5b7cc5c3f9e6f0f.js +0 -1
  166. package/assets/esri/core/workers/chunks/147a89553188cc6aabf4.js +0 -1
  167. package/assets/esri/core/workers/chunks/26f1fd3f2be5102aae1d.js +0 -1
  168. package/assets/esri/core/workers/chunks/34fbeeeeef4bd01672c6.js +0 -1
  169. package/assets/esri/core/workers/chunks/36fe6adf6517d8f80125.js +0 -1
  170. package/assets/esri/core/workers/chunks/403f08e0c1a9203f7fba.js +0 -1
  171. package/assets/esri/core/workers/chunks/4f2170609742b51bd7b8.js +0 -1
  172. package/assets/esri/core/workers/chunks/5133083222588799493f.js +0 -1
  173. package/assets/esri/core/workers/chunks/52993a9dc0c56e9bda19.js +0 -1
  174. package/assets/esri/core/workers/chunks/5e35828216020f33e26b.js +0 -1
  175. package/assets/esri/core/workers/chunks/5f0d6c853873a7f32527.js +0 -1
  176. package/assets/esri/core/workers/chunks/6121cd0264b6841a5bac.js +0 -1
  177. package/assets/esri/core/workers/chunks/6823ba1688dfedba0107.js +0 -1
  178. package/assets/esri/core/workers/chunks/705d6b108fd121cea887.js +0 -1
  179. package/assets/esri/core/workers/chunks/73aa1bfa6e1dc271c9d7.js +0 -1
  180. package/assets/esri/core/workers/chunks/825eb845216762a1ed2f.js +0 -1
  181. package/assets/esri/core/workers/chunks/88df19742edb0cdc3e67.js +0 -1
  182. package/assets/esri/core/workers/chunks/8977c85aecc7e08ab13c.js +0 -1
  183. package/assets/esri/core/workers/chunks/8bdca809dd88eab9e5d8.js +0 -29
  184. package/assets/esri/core/workers/chunks/8c5726c7ce40a92901e6.js +0 -1
  185. package/assets/esri/core/workers/chunks/8c5e65982c3f9295e844.js +0 -1
  186. package/assets/esri/core/workers/chunks/8ce649e55fefc8eca55c.js +0 -1
  187. package/assets/esri/core/workers/chunks/90ae80b797642bff0efa.js +0 -1
  188. package/assets/esri/core/workers/chunks/97c758f736f28c5dab84.js +0 -1
  189. package/assets/esri/core/workers/chunks/a494abeb026d536d9fae.js +0 -1
  190. package/assets/esri/core/workers/chunks/a8ade34612e73862de6f.js +0 -1
  191. package/assets/esri/core/workers/chunks/a9d391071803b1e9e8a0.js +0 -1
  192. package/assets/esri/core/workers/chunks/aa3abc07de2921ef6ca1.js +0 -1
  193. package/assets/esri/core/workers/chunks/b03f09ee2224f0cc526a.js +0 -1
  194. package/assets/esri/core/workers/chunks/b3f1a442d6b7826e917f.js +0 -1
  195. package/assets/esri/core/workers/chunks/b819a9187426d0c146df.js +0 -1
  196. package/assets/esri/core/workers/chunks/f0225829f7d941914815.js +0 -1
  197. package/assets/esri/core/workers/chunks/fb34d6d96c8c0d53fcf6.js +0 -1
  198. package/chunks/CutFillMask.glsl.js +0 -3
  199. package/chunks/FocusAreaMask.glsl.js +0 -3
  200. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMask.glsl.js +0 -2
  201. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskTechnique.js +0 -2
  202. package/views/3d/webgl-engine/shaders/CutFillMaskTechnique.js +0 -2
@@ -0,0 +1,265 @@
1
+ import type Layer from "../../../layers/Layer.js";
2
+ import type Accessor from "../../../core/Accessor.js";
3
+ import type SubtypeSublayer from "../../../layers/support/SubtypeSublayer.js";
4
+ import type SelectionManager from "../../../views/SelectionManager.js";
5
+ import type FeatureItem from "./FeatureItem.js";
6
+ import type GroupLayerItem from "./GroupLayerItem.js";
7
+ import type LayerItem from "./LayerItem.js";
8
+ import type { SelectableLayer, SelectableLayerView, SelectableViewUnion, SelectionIdentifier } from "../../../views/selection/types.js";
9
+ import type { ListItem, ParentItem, State } from "./types.js";
10
+
11
+ /** @internal */
12
+ export interface SelectionListViewModelProperties extends Partial<Pick<SelectionListViewModel, "filterText" | "layer" | "maxVisibleFeatureCountPerLayer" | "selectionManager" | "view">> {}
13
+
14
+ /**
15
+ * Displays selected features from a SelectionManager in a list format.
16
+ *
17
+ * @internal
18
+ */
19
+ export default class SelectionListViewModel extends Accessor {
20
+ /** @internal */
21
+ constructor(properties?: SelectionListViewModelProperties);
22
+ /**
23
+ * Reference to a singular LayerItem being displayed in the list, if the
24
+ * 'layer' property is set and the layer has selected features.
25
+ *
26
+ * @internal
27
+ */
28
+ get activeLayerItem(): LayerItem | null | undefined;
29
+ /**
30
+ * Items representing all individual layers and group layers with an active selection.
31
+ *
32
+ * @internal
33
+ */
34
+ get allLayerItems(): ParentItem[];
35
+ /**
36
+ * Total number of selected features.
37
+ *
38
+ * @internal
39
+ */
40
+ get effectiveCount(): number;
41
+ /**
42
+ * Reference to the SelectionManager being represented by the widget view.
43
+ *
44
+ * @internal
45
+ */
46
+ get effectiveSelectionManager(): SelectionManager | null | undefined;
47
+ /**
48
+ * Current value of the list's text filter.
49
+ *
50
+ * @internal
51
+ */
52
+ accessor filterText: string | undefined;
53
+ /**
54
+ * Indicates the widget is currently updating.
55
+ *
56
+ * @internal
57
+ */
58
+ get isUpdating(): boolean;
59
+ /**
60
+ * Setting this property causes the list to only display features from this layer.
61
+ * If there are no selected features from this layer, the full list will appear.
62
+ * This value also reflects when a layer is selected from the layer dropdown.
63
+ *
64
+ * @internal
65
+ */
66
+ accessor layer: SelectableLayer | null | undefined;
67
+ /**
68
+ * Items representing individual layers with an active selection. Excludes group layer items.
69
+ *
70
+ * @internal
71
+ */
72
+ get layerItems(): LayerItem[];
73
+ /**
74
+ * Lookup of layer views by layer id.
75
+ *
76
+ * @internal
77
+ */
78
+ get layerViewMap(): Map<string, SelectableLayerView>;
79
+ /**
80
+ * Indicates at least one item in the list has hidden features due to
81
+ * the selection being greater than the current value of the
82
+ * 'maxVisibleFeatureCountPerLayer' property.
83
+ *
84
+ * @internal
85
+ */
86
+ get maxVisibleFeatureCountExceeded(): boolean;
87
+ /**
88
+ * Maximum number of selected feature items displayed per layer.
89
+ * Does not limit or restrict the selection itself.
90
+ *
91
+ * @default 500
92
+ * @internal
93
+ */
94
+ accessor maxVisibleFeatureCountPerLayer: number;
95
+ /**
96
+ * Override for viewing a selection without having to modify the view's selection
97
+ *
98
+ * @internal
99
+ */
100
+ accessor selectionManager: SelectionManager | null | undefined;
101
+ /**
102
+ * Reflects the widget's current state.
103
+ *
104
+ * @internal
105
+ */
106
+ get state(): State;
107
+ /**
108
+ * Reference to the associated view. Required for temporary highlights.
109
+ *
110
+ * @internal
111
+ */
112
+ accessor view: SelectableViewUnion | null | undefined;
113
+ /**
114
+ * Convenience property for all layers and tables on the associated view.
115
+ * Used to identify group layers that selection sources may belong to.
116
+ *
117
+ * @internal
118
+ */
119
+ get viewLayersAndTables(): Layer[];
120
+ /**
121
+ * Total number of feature list items visible in the list itself. This value accounts for the limit imposed by 'maxVisibleFeatureCountPerLayer' and 'filterText' so this
122
+ * value will be less than the actual total selection count when a selection on a single layer exceeds the current value of 'maxVisibleFeatureCountPerLayer' or
123
+ * a value has been provided for 'filterText'. For the unmodified total selection count on all relevant layers, use the [effectiveCount](#effectiveCount) property.
124
+ *
125
+ * @internal
126
+ */
127
+ get visibleFeatureCount(): number;
128
+ /**
129
+ * Current number of visible feature list items, accounting for 'maxVisibleFeatureCountPerLayer'.
130
+ * Excludes feature list items hidden by the filter.
131
+ *
132
+ * @internal
133
+ */
134
+ get visibleFeatureItems(): FeatureItem[];
135
+ /**
136
+ * Count for total number of visible layer items in the list, excluding group layer items.
137
+ *
138
+ * @internal
139
+ */
140
+ get visibleLayerCount(): number;
141
+ /**
142
+ * Adds temporary highlight to the provided item. Removes a previously configured
143
+ * temporary highlight.
144
+ *
145
+ * @param item - Feature item to highlight.
146
+ * @internal
147
+ */
148
+ addTemporaryHighlight(item: FeatureItem): void;
149
+ /**
150
+ * Clears all active selections for all groups, layers and features.
151
+ *
152
+ * @internal
153
+ */
154
+ clear(): void;
155
+ /**
156
+ * Removes a specific feature from the overall selection.
157
+ *
158
+ * @param item - Feature item to remove from the selection.
159
+ * @internal
160
+ */
161
+ deselectFeatureItem(item: FeatureItem): void;
162
+ /**
163
+ * Removes all features and layers inside a specific group from the overall selection.
164
+ *
165
+ * @param item - Group layer item to remove from the selection.
166
+ * @internal
167
+ */
168
+ deselectGroupItem(item: GroupLayerItem): void;
169
+ /**
170
+ * Utility method to unselect any group, layer or feature item.
171
+ * Typically calls deselectFeatureItem(), deselectGroupItem() or deselectLayerItem().
172
+ *
173
+ * @param item - List item to remove from the selection.
174
+ * @internal
175
+ */
176
+ deselectItem(item: ListItem): void;
177
+ /**
178
+ * Removes all features from a specific layer from the overall selection.
179
+ *
180
+ * @param item - Layer item to remove from the selection.
181
+ * @internal
182
+ */
183
+ deselectLayerItem(item: LayerItem): void;
184
+ /** @internal */
185
+ destroy(): void;
186
+ /**
187
+ * Repositions the view to center based on the chosen item.
188
+ *
189
+ * @param item - List item to center the view on.
190
+ * @internal
191
+ */
192
+ goToItem(item: ListItem): void;
193
+ /**
194
+ * Internal convenience method for generating a list of items to display.
195
+ * If no layers are provided, creates a list based on the view's layers and tables.
196
+ * Typically used by SelectionListGroupItem to generate children.
197
+ * Implemented as such to avoid having a cyclical dependency.
198
+ *
199
+ * @param params - Parameters used to generate the list of items.
200
+ * @returns List of items to display in the selection list.
201
+ * @internal
202
+ */
203
+ layersToItems(params: {
204
+ controller: AbortController;
205
+ promises: Promise<void>[];
206
+ groupLayerItem?: GroupLayerItem | null | undefined;
207
+ layers?: Layer[] | SubtypeSublayer[];
208
+ }): ParentItem[];
209
+ /**
210
+ * Removes specific features from the selection, based on the provided
211
+ * layer and object IDs.
212
+ *
213
+ * @param params - Parameters used to remove features from the selection.
214
+ * @internal
215
+ */
216
+ removeFromSelection(params: {
217
+ layer: SelectableLayer;
218
+ selection: SelectionIdentifier[];
219
+ }): void;
220
+ /**
221
+ * Removes all temporary highlights.
222
+ *
223
+ * @internal
224
+ */
225
+ removeTemporaryHighlight(): void;
226
+ /**
227
+ * Adds specific features to the selection, based on the provided
228
+ * layer and object IDs.
229
+ *
230
+ * @param params - Parameters used to replace features in the selection.
231
+ * @internal
232
+ */
233
+ replace(params: {
234
+ layer: SelectableLayer;
235
+ selection: SelectionIdentifier[];
236
+ }): void;
237
+ /**
238
+ * Selects a single feature and unselects all other features.
239
+ *
240
+ * @param item - Feature item to select.
241
+ * @internal
242
+ */
243
+ selectSingleFeatureItem(item: FeatureItem): void;
244
+ /**
245
+ * Selects all features from layers within a specific group layer and unselects all other features.
246
+ *
247
+ * @param item - Group layer item to select.
248
+ * @internal
249
+ */
250
+ selectSingleGroupItem(item: GroupLayerItem): void;
251
+ /**
252
+ * Selects all features contextual to a given item. Unselects all other features.
253
+ *
254
+ * @param item - List item to select.
255
+ * @internal
256
+ */
257
+ selectSingleItem(item: ListItem): void;
258
+ /**
259
+ * Selects all features for the specified layer. Unselects all other selected features.
260
+ *
261
+ * @param item - Layer item to select.
262
+ * @internal
263
+ */
264
+ selectSingleLayerItem(item: LayerItem): void;
265
+ }
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import r from"../../../core/Collection.js";import i from"../../../core/Logger.js";import{removeMaybe as o,abortMaybe as s}from"../../../core/maybe.js";import{ignoreAbortErrors as a,debounce as l,whenOrTimeout as n}from"../../../core/promiseUtils.js";import{watch as c,on as h,whenOnce as p}from"../../../core/reactiveUtils.js";import{property as y,subclass as g}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as u,isSubtypeSublayer as m}from"../../../layers/support/layerUtils.js";import{isSelectableLayerViewWithHighlights as f,isSelectableLayerWithObjectIds as v,isSelectableLayerWithGraphics as _,isSelectableLayer as C,isSelectableLayerBaseWithEditing as I}from"../../../views/support/selectionUtils.js";import{goTo as b}from"../goToUtils.js";import L from"./GroupLayerItem.js";import S from"./LayerItem.js";import{computeEffectiveCount as w,getNestedLayerItems as M,isLayerItem as H,isGroupLayerItem as E,getNestedFeatureItems as A}from"./selectionListUtils.js";const F=100;let T=class extends t{constructor(e){super(e),this._allLayerItems=null,this._groupItemCache=new Map,this._hoverHighlightHandle=null,this._layerEditAbortControllers=new Map,this._layerEditHandles=new r,this._layerItemCache=new Map,this._onChangeAbortController=null,this._updatingHandles=new d,this.filterText=void 0,this.layer=null,this.maxVisibleFeatureCountPerLayer=500,this.selectionManager=null,this._onSelectionChangeController=async()=>{this._cancelOnSelectionChange();const e=new AbortController;this._onChangeAbortController=e,await this._updatingHandles.addPromise(a(this._generateListItems(e))),this._onChangeAbortController===e&&(this._onChangeAbortController=null);const t=this.layer&&this.effectiveSelectionManager?.getSelection(this.layer);t?.length||(this.layer=null)},this._cancelOnSelectionChange=()=>this._onChangeAbortController?.abort(),this._onSelectionChangeDebounced=l(this._onSelectionChangeController,F),this._cancelOnLayerEdit=e=>this._layerEditAbortControllers.get(e)?.abort()}initialize(){this.addHandles([c(()=>[this.view,this.effectiveSelectionManager,...this._sources],()=>{this._onSelectionChange(),this._refreshLayerEditHandles()}),h(()=>this.effectiveSelectionManager?.sources,"change",()=>{this._onSelectionChange(),this._refreshLayerEditHandles()}),h(()=>this.effectiveSelectionManager,"selection-change",()=>this._onSelectionChange())])}destroy(){this._cancelOnSelectionChange(),this.removeTemporaryHighlight(),this._updatingHandles.destroy(),this._layerEditHandles.drain(o),this._layerEditAbortControllers.forEach(s)}get _sources(){return this.effectiveSelectionManager?.sources.toArray()??[]}get activeLayerItem(){const{layer:e}=this;return e&&this.layerItems.find(t=>t.layer===e)}get allLayerItems(){return this._allLayerItems??[]}get effectiveCount(){return w(this.allLayerItems)}get effectiveSelectionManager(){return this.selectionManager??this.view?.selectionManager}get isUpdating(){return!(!this._onChangeAbortController&&!this._updatingHandles.updating)}get layerItems(){return M(this.allLayerItems)}get layerViewMap(){const e=new Map,{view:t}=this;if(!t)return e;for(const r of t.allLayerViews)if(e.set(r.layer.id,r),u(r.layer))for(const t of r.layer.sublayers)e.set(t.id,r);return e}get maxVisibleFeatureCountExceeded(){return this.allLayerItems.some(e=>e.maxVisibleFeatureCountExceeded)}get state(){const{view:e}=this;return e?e.ready?this.effectiveSelectionManager?"ready":"error":"loading":"disabled"}get viewLayersAndTables(){const{view:e}=this;return e?.map?[...e.map.layers.toArray().reverse(),...e.map.tables.toArray().reverse()]:[]}get visibleFeatureCount(){return this.activeLayerItem?.visibleTotal??this.visibleFeatureItems.length}get visibleFeatureItems(){return this.layerItems.flatMap(e=>e.featureItems.filter(e=>e.visible))}get visibleLayerCount(){const{effectiveSelectionManager:e}=this;return e&&0!==e.count?1===e.count||this.activeLayerItem?1:this.layerItems.filter(e=>e.visible).length:0}addTemporaryHighlight({graphic:e,layerView:t}){this.removeTemporaryHighlight(),t&&e&&f(t)&&(this._hoverHighlightHandle=t.highlight(e,{name:"temporary"}))}clear(){this.effectiveSelectionManager?.clear()}deselectFeatureItem({layer:e,graphic:t,objectId:r}){v(e)&&null!=r?this.effectiveSelectionManager?.remove(e,[r]):_(e)&&this.effectiveSelectionManager?.remove(e,[t])}deselectGroupItem(e){e.items.forEach(e=>{H(e)?this.deselectLayerItem(e):this.deselectGroupItem(e)})}deselectLayerItem({layer:e}){this.replace({layer:e,selection:[]})}deselectItem(e){E(e)?this.deselectGroupItem(e):H(e)?this.deselectLayerItem(e):this.deselectFeatureItem(e)}goToItem(e){H(e)||E(e)?this._goTo(A([e]).map(e=>e.graphic)):this._goTo(e.graphic)}layersToItems(e){const{controller:t,groupLayerItem:r,layers:i,promises:o}=e,{_groupItemCache:s,_layerItemCache:a,effectiveSelectionManager:l,viewLayersAndTables:n}=this,c=i??n;if(!l||0===l.count)return[];const h=[];for(const p of c)switch(p.type){case"subtype-group":case"knowledge-graph":case"group":{const e=s.get(p),r=e??new L({layer:p,viewModel:this});e||s.set(p,r),o.push(r.sync({controller:t,promises:o})),h.push(r)}break;default:if(C(p)){const e=l.getSelection(p);if(!e?.length)continue;const i=a.get(p),s=i??new S({groupLayerItem:r,layer:p,viewModel:this});i||a.set(p,s),o.push(s.sync({controller:t,promises:o})),h.push(s)}}return h}removeFromSelection({layer:e,selection:t}){(v(e)||_(e))&&this.effectiveSelectionManager?.remove(e,t)}removeTemporaryHighlight(){this._hoverHighlightHandle=o(this._hoverHighlightHandle)}selectSingleFeatureItem(e){const t=e.identifier;if(this.effectiveSelectionManager)for(const{layer:r}of this.effectiveSelectionManager.selections)this.replace({layer:r,selection:r===e.layer?[t]:[]})}selectSingleGroupItem(e){if(this.effectiveSelectionManager)for(const{layer:t,selection:r}of this.effectiveSelectionManager.selections)this.replace({layer:t,selection:t.parent===e.layer?r:[]})}selectSingleItem(e){E(e)?this.selectSingleGroupItem(e):H(e)?this.selectSingleLayerItem(e):this.selectSingleFeatureItem(e)}selectSingleLayerItem(e){if(this.effectiveSelectionManager)for(const{layer:t,selection:r}of this.effectiveSelectionManager.selections)this.replace({layer:t,selection:t===e.layer?r:[]})}replace({layer:e,selection:t}){(v(e)||_(e))&&this.effectiveSelectionManager?.replace(e,t)}async _goTo(e){const{view:t}=this;if(t)try{await b(t,e)}catch(r){"AbortError"!==r.name&&i.getLogger(this).warn("Failed to go to feature(s)",r)}}async _generateListItems(e){try{this.removeTemporaryHighlight();const t=[],r=this.layersToItems({controller:e,promises:t});t.length>0&&await Promise.all(t),this._onChangeAbortController===e&&(this._allLayerItems=r)}catch(t){i.getLogger(this).warn("Failed updating selection",t)}}_onSelectionChange(){a(this._onSelectionChangeDebounced())}_refreshLayerEditHandles(){const{effectiveSelectionManager:e}=this;if(this._layerEditHandles.drain(o),!e?.sources.length)return;const t=new Set(e.sources.map(e=>m(e)?e.parent:e));for(const r of t)C(r)&&(_(r)?this._layerEditHandles.push(r.graphics.on("change",()=>{this._onLayerEdit(r)})):I(r)&&this._layerEditHandles.push(r.on("edits",e=>{this._onLayerEdit(r,e)})))}async _onLayerEdit(e,t){try{if(this.removeTemporaryHighlight(),this._cancelOnLayerEdit(e),t&&!t.updatedFeatures.some(e=>null!=e.objectId&&!e.error))return;const r=new AbortController;this._layerEditAbortControllers.set(e,r);const i="subtype-group"===e.type||"knowledge-graph"===e.type?this.allLayerItems.find(t=>t.layer===e):this.layerItems.find(t=>t.layer===e);if(i?.layerView){const e=i.layerView;if(await this._onLayerViewUpdate(e),r.signal.aborted)return;i.reset(),this._onSelectionChange()}this._layerEditAbortControllers.get(e)===r&&this._layerEditAbortControllers.delete(e)}catch(r){i.getLogger(this).warn("Failed updating selected features",r)}}async _onLayerViewUpdate(e){await n(p(()=>e.updating),2e3),await p(()=>!e.updating)}};e([y()],T.prototype,"_allLayerItems",void 0),e([y()],T.prototype,"_groupItemCache",void 0),e([y()],T.prototype,"_hoverHighlightHandle",void 0),e([y()],T.prototype,"_layerEditAbortControllers",void 0),e([y()],T.prototype,"_layerEditHandles",void 0),e([y()],T.prototype,"_layerItemCache",void 0),e([y()],T.prototype,"_onChangeAbortController",void 0),e([y()],T.prototype,"_sources",null),e([y()],T.prototype,"_updatingHandles",void 0),e([y()],T.prototype,"activeLayerItem",null),e([y()],T.prototype,"allLayerItems",null),e([y()],T.prototype,"effectiveCount",null),e([y()],T.prototype,"effectiveSelectionManager",null),e([y()],T.prototype,"filterText",void 0),e([y()],T.prototype,"isUpdating",null),e([y()],T.prototype,"layer",void 0),e([y()],T.prototype,"layerItems",null),e([y()],T.prototype,"layerViewMap",null),e([y()],T.prototype,"maxVisibleFeatureCountExceeded",null),e([y()],T.prototype,"maxVisibleFeatureCountPerLayer",void 0),e([y()],T.prototype,"selectionManager",void 0),e([y()],T.prototype,"state",null),e([y()],T.prototype,"view",void 0),e([y()],T.prototype,"viewLayersAndTables",null),e([y()],T.prototype,"visibleFeatureCount",null),e([y()],T.prototype,"visibleFeatureItems",null),e([y()],T.prototype,"visibleLayerCount",null),T=e([g("esri.widgets.support.SelectionList.SelectionListViewModel")],T);const j=T;export{j as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import r from"../../../core/Collection.js";import i from"../../../core/Logger.js";import{removeMaybe as o,abortMaybe as s}from"../../../core/maybe.js";import{ignoreAbortErrors as a,debounce as l,whenOrTimeout as n}from"../../../core/promiseUtils.js";import{watch as c,on as h,whenOnce as p}from"../../../core/reactiveUtils.js";import{property as y,subclass as g}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as u,isSubtypeSublayer as m}from"../../../layers/support/layerUtils.js";import{isSelectableLayerViewWithHighlights as f,isSelectableLayerWithObjectIds as v,isSelectableLayerWithGraphics as _,isSelectableLayer as C,isSelectableLayerBaseWithEditing as I}from"../../../views/support/selectionUtils.js";import{goTo as b}from"../goToUtils.js";import L from"./GroupLayerItem.js";import S from"./LayerItem.js";import{computeEffectiveCount as w,getNestedLayerItems as M,isLayerItem as H,isGroupLayerItem as E,getNestedFeatureItems as A}from"./selectionListUtils.js";const F=100;let T=class extends t{constructor(e){super(e),this._allLayerItems=null,this._groupItemCache=new Map,this._hoverHighlightHandle=null,this._layerEditAbortControllers=new Map,this._layerEditHandles=new r,this._layerItemCache=new Map,this._onChangeAbortController=null,this._updatingHandles=new d,this.filterText=void 0,this.layer=null,this.maxVisibleFeatureCountPerLayer=500,this.selectionManager=null,this._onSelectionChangeController=async()=>{this._cancelOnSelectionChange();const e=new AbortController;this._onChangeAbortController=e,await this._updatingHandles.addPromise(a(this._generateListItems(e))),this._onChangeAbortController===e&&(this._onChangeAbortController=null);const t=this.layer&&this.effectiveSelectionManager?.getSelection(this.layer);t?.length||(this.layer=null)},this._cancelOnSelectionChange=()=>this._onChangeAbortController?.abort(),this._onSelectionChangeDebounced=l(this._onSelectionChangeController,F),this._cancelOnLayerEdit=e=>this._layerEditAbortControllers.get(e)?.abort()}initialize(){this.addHandles([c(()=>[this.view,this.effectiveSelectionManager,...this._sources],()=>{this._onSelectionChange(),this._refreshLayerEditHandles()}),h(()=>this.effectiveSelectionManager?.sources,"change",()=>{this._onSelectionChange(),this._refreshLayerEditHandles()}),h(()=>this.effectiveSelectionManager,"selection-change",()=>this._onSelectionChange())])}destroy(){this._cancelOnSelectionChange(),this.removeTemporaryHighlight(),this._updatingHandles.destroy(),this._layerEditHandles.drain(o),this._layerEditAbortControllers.forEach(s)}get _sources(){return this.effectiveSelectionManager?.sources.toArray()??[]}get activeLayerItem(){const{layer:e}=this;return e&&this.layerItems.find(t=>t.layer===e)}get allLayerItems(){return this._allLayerItems??[]}get effectiveCount(){return w(this.allLayerItems)}get effectiveSelectionManager(){return this.selectionManager??this.view?.selectionManager}get isUpdating(){return!(!this._onChangeAbortController&&!this._updatingHandles.updating)}get layerItems(){return M(this.allLayerItems)}get layerViewMap(){const e=new Map,{view:t}=this;if(!t)return e;for(const r of t.allLayerViews)if(e.set(r.layer.id,r),u(r.layer))for(const t of r.layer.sublayers)e.set(t.id,r);return e}get maxVisibleFeatureCountExceeded(){return this.allLayerItems.some(e=>e.maxVisibleFeatureCountExceeded)}get state(){const{view:e}=this;return e?e.ready?this.effectiveSelectionManager?"ready":"error":"loading":"disabled"}get viewLayersAndTables(){const{view:e}=this;return e?.map?[...e.map.layers.toArray().reverse(),...e.map.tables.toArray().reverse()]:[]}get visibleFeatureCount(){return this.activeLayerItem?.visibleTotal??this.visibleFeatureItems.length}get visibleFeatureItems(){return this.layerItems.flatMap(e=>e.featureItems.filter(e=>e.visible))}get visibleLayerCount(){const{effectiveSelectionManager:e}=this;return e&&0!==e.count?1===e.count||this.activeLayerItem?1:this.layerItems.filter(e=>e.visible).length:0}addTemporaryHighlight(e){const{graphic:t,layerView:r}=e;this.removeTemporaryHighlight(),r&&t&&f(r)&&(this._hoverHighlightHandle=r.highlight(t,{name:"temporary"}))}clear(){this.effectiveSelectionManager?.clear()}deselectFeatureItem(e){const{layer:t,graphic:r,objectId:i}=e;v(t)&&null!=i?this.effectiveSelectionManager?.remove(t,[i]):_(t)&&this.effectiveSelectionManager?.remove(t,[r])}deselectGroupItem(e){e.items.forEach(e=>{H(e)?this.deselectLayerItem(e):this.deselectGroupItem(e)})}deselectLayerItem(e){const{layer:t}=e;this.replace({layer:t,selection:[]})}deselectItem(e){E(e)?this.deselectGroupItem(e):H(e)?this.deselectLayerItem(e):this.deselectFeatureItem(e)}goToItem(e){H(e)||E(e)?this._goTo(A([e]).map(e=>e.graphic)):this._goTo(e.graphic)}layersToItems(e){const{controller:t,groupLayerItem:r,layers:i,promises:o}=e,{_groupItemCache:s,_layerItemCache:a,effectiveSelectionManager:l,viewLayersAndTables:n}=this,c=i??n;if(!l||0===l.count)return[];const h=[];for(const p of c)switch(p.type){case"subtype-group":case"knowledge-graph":case"group":{const e=s.get(p),r=e??new L({layer:p,viewModel:this});e||s.set(p,r),o.push(r.sync({controller:t,promises:o})),h.push(r)}break;default:if(C(p)){const e=l.getSelection(p);if(!e?.length)continue;const i=a.get(p),s=i??new S({groupLayerItem:r,layer:p,viewModel:this});i||a.set(p,s),o.push(s.sync({controller:t,promises:o})),h.push(s)}}return h}removeFromSelection(e){const{layer:t,selection:r}=e;(v(t)||_(t))&&this.effectiveSelectionManager?.remove(t,r)}removeTemporaryHighlight(){this._hoverHighlightHandle=o(this._hoverHighlightHandle)}selectSingleFeatureItem(e){const t=e.identifier;if(this.effectiveSelectionManager)for(const{layer:r}of this.effectiveSelectionManager.selections)this.replace({layer:r,selection:r===e.layer?[t]:[]})}selectSingleGroupItem(e){if(this.effectiveSelectionManager)for(const{layer:t,selection:r}of this.effectiveSelectionManager.selections)this.replace({layer:t,selection:t.parent===e.layer?r:[]})}selectSingleItem(e){E(e)?this.selectSingleGroupItem(e):H(e)?this.selectSingleLayerItem(e):this.selectSingleFeatureItem(e)}selectSingleLayerItem(e){if(this.effectiveSelectionManager)for(const{layer:t,selection:r}of this.effectiveSelectionManager.selections)this.replace({layer:t,selection:t===e.layer?r:[]})}replace(e){const{layer:t,selection:r}=e;(v(t)||_(t))&&this.effectiveSelectionManager?.replace(t,r)}async _goTo(e){const{view:t}=this;if(t)try{await b(t,e)}catch(r){"AbortError"!==r.name&&i.getLogger(this).warn("Failed to go to feature(s)",r)}}async _generateListItems(e){try{this.removeTemporaryHighlight();const t=[],r=this.layersToItems({controller:e,promises:t});t.length>0&&await Promise.all(t),this._onChangeAbortController===e&&(this._allLayerItems=r)}catch(t){i.getLogger(this).warn("Failed updating selection",t)}}_onSelectionChange(){a(this._onSelectionChangeDebounced())}_refreshLayerEditHandles(){const{effectiveSelectionManager:e}=this;if(this._layerEditHandles.drain(o),!e?.sources.length)return;const t=new Set(e.sources.map(e=>m(e)?e.parent:e));for(const r of t)C(r)&&(_(r)?this._layerEditHandles.push(r.graphics.on("change",()=>{this._onLayerEdit(r)})):I(r)&&this._layerEditHandles.push(r.on("edits",e=>{this._onLayerEdit(r,e)})))}async _onLayerEdit(e,t){try{if(this.removeTemporaryHighlight(),this._cancelOnLayerEdit(e),t&&!t.updatedFeatures.some(e=>null!=e.objectId&&!e.error))return;const r=new AbortController;this._layerEditAbortControllers.set(e,r);const i="subtype-group"===e.type||"knowledge-graph"===e.type?this.allLayerItems.find(t=>t.layer===e):this.layerItems.find(t=>t.layer===e);if(i?.layerView){const e=i.layerView;if(await this._onLayerViewUpdate(e),r.signal.aborted)return;i.reset(),this._onSelectionChange()}this._layerEditAbortControllers.get(e)===r&&this._layerEditAbortControllers.delete(e)}catch(r){i.getLogger(this).warn("Failed updating selected features",r)}}async _onLayerViewUpdate(e){await n(p(()=>e.updating),2e3),await p(()=>!e.updating)}};e([y()],T.prototype,"_allLayerItems",void 0),e([y()],T.prototype,"_groupItemCache",void 0),e([y()],T.prototype,"_hoverHighlightHandle",void 0),e([y()],T.prototype,"_layerEditAbortControllers",void 0),e([y()],T.prototype,"_layerEditHandles",void 0),e([y()],T.prototype,"_layerItemCache",void 0),e([y()],T.prototype,"_onChangeAbortController",void 0),e([y()],T.prototype,"_sources",null),e([y()],T.prototype,"_updatingHandles",void 0),e([y()],T.prototype,"activeLayerItem",null),e([y()],T.prototype,"allLayerItems",null),e([y()],T.prototype,"effectiveCount",null),e([y()],T.prototype,"effectiveSelectionManager",null),e([y()],T.prototype,"filterText",void 0),e([y()],T.prototype,"isUpdating",null),e([y()],T.prototype,"layer",void 0),e([y()],T.prototype,"layerItems",null),e([y()],T.prototype,"layerViewMap",null),e([y()],T.prototype,"maxVisibleFeatureCountExceeded",null),e([y()],T.prototype,"maxVisibleFeatureCountPerLayer",void 0),e([y()],T.prototype,"selectionManager",void 0),e([y()],T.prototype,"state",null),e([y()],T.prototype,"view",void 0),e([y()],T.prototype,"viewLayersAndTables",null),e([y()],T.prototype,"visibleFeatureCount",null),e([y()],T.prototype,"visibleFeatureItems",null),e([y()],T.prototype,"visibleLayerCount",null),T=e([g("esri.widgets.support.SelectionList.SelectionListViewModel")],T);const j=T;export{j as default};
@@ -0,0 +1,42 @@
1
+ import type GroupLayer from "../../../layers/GroupLayer.js";
2
+ import type KnowledgeGraphLayer from "../../../layers/KnowledgeGraphLayer.js";
3
+ import type SubtypeGroupLayer from "../../../layers/SubtypeGroupLayer.js";
4
+ import type FeatureItem from "./FeatureItem.js";
5
+ import type GroupLayerItem from "./GroupLayerItem.js";
6
+ import type LayerItem from "./LayerItem.js";
7
+
8
+ /**
9
+ * Union of selection list layer types that may contain other layers.
10
+ * These are typically represented by a group list item in the selection list.
11
+ *
12
+ * @internal
13
+ */
14
+ export type SelectionListParentLayer = GroupLayer | SubtypeGroupLayer | KnowledgeGraphLayer;
15
+
16
+ /**
17
+ * Represents the state of a selection list item.
18
+ *
19
+ * @internal
20
+ */
21
+ export type State = "disabled" | "loading" | "error" | "ready";
22
+
23
+ /**
24
+ * Types of selection list items that may contain other list items.
25
+ *
26
+ * @internal
27
+ */
28
+ export type ParentItem = LayerItem | GroupLayerItem;
29
+
30
+ /**
31
+ * Union of all selection list item types.
32
+ *
33
+ * @internal
34
+ */
35
+ export type ListItem = FeatureItem | ParentItem;
36
+
37
+ /**
38
+ * Options used to synchronize selection list items with the current selection.
39
+ *
40
+ * @internal
41
+ */
42
+ export interface SyncOptions {}
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{isTextInput as t}from"../../../form/support/formUtils.js";import{validateDomainValue as e}from"../../../layers/support/domainUtils.js";import{validateFieldValue as n}from"../../../layers/support/fieldUtils.js";import{dateTimeIsInRange as r}from"../dateUtils.js";const i=(t,e)=>{if(!t)return!0;const{operations:n}=t;switch(e){case"INSERT":return n.supportsAdd;case"UPDATE":case"DELETE":return n.supportsUpdate;default:return!0}};function o(t,i){const{dataType:o,domain:u,field:l,maxLength:a,minLength:s,multipleChoice:c,range:m,required:f}=i;if(null==t)return f?"text"===o&&c?"multiple-choice-validation-error::too-few-selected-choices":"input-validation-error::cannot-be-empty":null;if("text"===o&&"string"==typeof t){if(s>-1&&t.length<s)return"length-validation-error::too-short";if(a>-1&&t.length>a)return"length-validation-error::too-long";if(c){const e=g(t,c.choiceDelimiter);if(null!=c.maximumChoices&&e>c.maximumChoices)return"multiple-choice-validation-error::too-many-selected-choices";if(null!=c.minimumChoices&&e<c.minimumChoices)return"multiple-choice-validation-error::too-few-selected-choices"}}return"date"!==o||r({type:l.type,range:m,value:t})?u?e(l,t,u):n(l,t):"numeric-range-validation-error::out-of-range"}function u(t,e){return!(!l(t)||!l(e))||t===e}function l(t){return null==t||""===t}function a({dataType:e,field:n,input:r}){const i=-1;if("date"===e)return i;const o=c(n.length);if(!r||!t(r))return o;const u=c(r.maxLength);return u===i?o:o===i?u:Math.min(o,u)}function s({dataType:e,field:n,input:r}){const i=-1;if("date"===e)return i;if(!r||!t(r))return i;const o=c(r.minLength);if(o<0)return i;const u=c(n.length);return u>i&&u<o?i:o}function c(t){return"number"==typeof t&&t>-1?t:-1}const m={type:"number"},f={type:"number",intlOptions:{notation:"scientific"}};function p(t){return t>=1e7||t<=-1e7}function d(t,e){return null!=t.max&&null!=t.min?e.outsideRange:null!=t.max?e.outsideRangeMax:e.outsideRangeMin}const h=t=>t&&!Number.isNaN(t.valueOf());function g(t,e){return""===t?0:t.split(e).map(t=>t.trim()).filter(t=>""!==t).length}export{i as capabilitiesAllowEditType,h as dateIsValid,c as ensureMinOrMaxLength,a as getMaxLength,s as getMinLength,d as getRangeErrorMessage,l as isEmptyValue,m as numberFormatOptions,f as scientificNumberFormatOptions,p as shouldUseScientificNotation,o as validateFormValue,u as valuesAreEquivalent};
2
+ import{isTextInput as t}from"../../../form/support/formUtils.js";import{validateDomainValue as e}from"../../../layers/support/domainUtils.js";import{validateFieldValue as n}from"../../../layers/support/fieldUtils.js";import{dateTimeIsInRange as r}from"../dateUtils.js";const i=(t,e)=>{if(!t)return!0;const{operations:n}=t;switch(e){case"INSERT":return n.supportsAdd;case"UPDATE":case"DELETE":return n.supportsUpdate;default:return!0}};function o(t,i){const{dataType:o,domain:u,field:l,maxLength:a,minLength:s,multipleChoice:c,range:m,required:f}=i;if(null==t)return f?"text"===o&&c?"multiple-choice-validation-error::too-few-selected-choices":"input-validation-error::cannot-be-empty":null;if("text"===o&&"string"==typeof t){if(s>-1&&t.length<s)return"length-validation-error::too-short";if(a>-1&&t.length>a)return"length-validation-error::too-long";if(c){const e=g(t,c.choiceDelimiter);if(null!=c.maximumChoices&&e>c.maximumChoices)return"multiple-choice-validation-error::too-many-selected-choices";if(null!=c.minimumChoices&&e<c.minimumChoices)return"multiple-choice-validation-error::too-few-selected-choices"}}return"date"!==o||r({type:l.type,range:m,value:t})?u?e(l,t,u):n(l,t):"numeric-range-validation-error::out-of-range"}function u(t,e){return!!(l(t)&&l(e)||Number.isNaN(t)&&Number.isNaN(e))||t===e}function l(t){return null==t||""===t}function a({dataType:e,field:n,input:r}){const i=-1;if("date"===e)return i;const o=c(n.length);if(!r||!t(r))return o;const u=c(r.maxLength);return u===i?o:o===i?u:Math.min(o,u)}function s({dataType:e,field:n,input:r}){const i=-1;if("date"===e)return i;if(!r||!t(r))return i;const o=c(r.minLength);if(o<0)return i;const u=c(n.length);return u>i&&u<o?i:o}function c(t){return"number"==typeof t&&t>-1?t:-1}const m={type:"number"},f={type:"number",intlOptions:{notation:"scientific"}};function p(t){return t>=1e7||t<=-1e7}function d(t,e){return null!=t.max&&null!=t.min?e.outsideRange:null!=t.max?e.outsideRangeMax:e.outsideRangeMin}const h=t=>t&&!Number.isNaN(t.valueOf());function g(t,e){return""===t?0:t.split(e).map(t=>t.trim()).filter(t=>""!==t).length}export{i as capabilitiesAllowEditType,h as dateIsValid,c as ensureMinOrMaxLength,a as getMaxLength,s as getMinLength,d as getRangeErrorMessage,l as isEmptyValue,m as numberFormatOptions,f as scientificNumberFormatOptions,p as shouldUseScientificNotation,o as validateFormValue,u as valuesAreEquivalent};
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5804,7642],{46130(e,t,r){r.d(t,{v:()=>n});var o=r(76553);function n(e){e?.writtenProperties&&e.writtenProperties.forEach(({target:e,propName:t,newOrigin:r})=>{(0,o.H)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)})}},35522(e,t,r){r.d(t,{$A:()=>C,Bw:()=>s,C:()=>a,Cc:()=>A,DI:()=>x,Io:()=>v,Ln:()=>g,Om:()=>b,Qr:()=>p,Re:()=>c,S8:()=>I,T9:()=>y,WQ:()=>l,Z0:()=>R,_S:()=>h,aI:()=>O,ei:()=>Z,fw:()=>j,g7:()=>N,gL:()=>P,hG:()=>M,hZ:()=>i,hs:()=>m,jk:()=>f,lw:()=>u,m3:()=>w,oW:()=>U,t2:()=>q,tn:()=>d,ze:()=>S});var o=r(51850),n=r(34304);function s(e){const t=e[0],r=e[1],o=e[2];return Math.sqrt(t*t+r*r+o*o)}function a(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function i(e,t,r,o){return e[0]=t,e[1]=r,e[2]=o,e}function l(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function c(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function u(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function p(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function d(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}function h(e,t){return e[0]=Math.sign(t[0]),e[1]=Math.sign(t[1]),e[2]=Math.sign(t[2]),e}function f(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function y(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function m(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function g(e,t,r,o){return e[0]=t[0]+r[0]*o,e[1]=t[1]+r[1]*o,e[2]=t[2]+r[2]*o,e}function v(e,t){const r=t[0]-e[0],o=t[1]-e[1],n=t[2]-e[2];return Math.sqrt(r*r+o*o+n*n)}function M(e,t){const r=t[0]-e[0],o=t[1]-e[1],n=t[2]-e[2];return r*r+o*o+n*n}function w(e){const t=e[0],r=e[1],o=e[2];return t*t+r*r+o*o}function S(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function x(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function I(e,t){const r=t[0],o=t[1],n=t[2];let s=r*r+o*o+n*n;return s>0&&(s=1/Math.sqrt(s),e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s),e}function b(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function C(e,t,r){const o=t[0],n=t[1],s=t[2],a=r[0],i=r[1],l=r[2];return e[0]=n*l-s*i,e[1]=s*a-o*l,e[2]=o*i-n*a,e}function A(e,t,r,o){const n=t[0],s=t[1],a=t[2];return e[0]=n+o*(r[0]-n),e[1]=s+o*(r[1]-s),e[2]=a+o*(r[2]-a),e}function R(e,t,r){const o=t[0],n=t[1],s=t[2];return e[0]=r[0]*o+r[4]*n+r[8]*s+r[12],e[1]=r[1]*o+r[5]*n+r[9]*s+r[13],e[2]=r[2]*o+r[6]*n+r[10]*s+r[14],e}function Z(e,t,r){const o=t[0],n=t[1],s=t[2];return e[0]=o*r[0]+n*r[3]+s*r[6],e[1]=o*r[1]+n*r[4]+s*r[7],e[2]=o*r[2]+n*r[5]+s*r[8],e}function P(e,t,r){return j(e,t,r[0],r[1],r[2],r[3])}function j(e,t,r,o,n,s){const a=t[0],i=t[1],l=t[2],c=o*l-n*i,u=n*a-r*l,p=r*i-o*a,d=o*p-n*u,h=n*c-r*p,f=r*u-o*c,y=2*s;return e[0]=a+c*y+2*d,e[1]=i+u*y+2*h,e[2]=l+p*y+2*f,e}function N(e,t){I(T,e),I(L,t);const r=b(T,L);return r>1?0:r<-1?Math.PI:Math.acos(r)}const T=(0,o.vt)(),L=(0,o.vt)();function q(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function O(e,t){if(e===t)return!0;const r=e[0],o=e[1],s=e[2],a=t[0],i=t[1],l=t[2],c=(0,n.FD)();return Math.abs(r-a)<=c*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(o-i)<=c*Math.max(1,Math.abs(o),Math.abs(i))&&Math.abs(s-l)<=c*Math.max(1,Math.abs(s),Math.abs(l))}function U(e,t,r){const o=r[0]-t[0],n=r[1]-t[1],s=r[2]-t[2];let a=o*o+n*n+s*s;return a>0?(a=1/Math.sqrt(a),e[0]=o*a,e[1]=n*a,e[2]=s*a,e):(e[0]=0,e[1]=0,e[2]=0,e)}const F=c,_=u,K=p,D=v,k=M,$=s,E=w;Object.freeze(Object.defineProperty({__proto__:null,abs:d,add:l,angle:N,bezier:function(e,t,r,o,n,s){const a=1-s,i=a*a,l=s*s,c=i*a,u=3*s*i,p=3*l*a,d=l*s;return e[0]=t[0]*c+r[0]*u+o[0]*p+n[0]*d,e[1]=t[1]*c+r[1]*u+o[1]*p+n[1]*d,e[2]=t[2]*c+r[2]*u+o[2]*p+n[2]*d,e},ceil:function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e},clamp:function(e,t=0,r=1){return e[0]=Math.min(Math.max(e[0],t),r),e[1]=Math.min(Math.max(e[1],t),r),e[2]=Math.min(Math.max(e[2],t),r),e},copy:a,cross:C,crossAndNormalize:function(e,t,r){const o=t[0],n=t[1],s=t[2],a=r[0],i=r[1],l=r[2],c=n*l-s*i,u=s*a-o*l,p=o*i-n*a,d=Math.sqrt(c*c+u*u+p*p);return e[0]=c/d,e[1]=u/d,e[2]=p/d,e},direction:U,dist:D,distance:v,div:K,divide:p,dot:b,equals:O,exactEquals:q,floor:function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e},hermite:function(e,t,r,o,n,s){const a=s*s,i=a*(2*s-3)+1,l=a*(s-2)+s,c=a*(s-1),u=a*(3-2*s);return e[0]=t[0]*i+r[0]*l+o[0]*c+n[0]*u,e[1]=t[1]*i+r[1]*l+o[1]*c+n[1]*u,e[2]=t[2]*i+r[2]*l+o[2]*c+n[2]*u,e},inverse:x,len:$,length:s,lerp:A,max:y,min:f,mul:_,multiply:u,negate:S,normalize:I,random:function(e,t=1){const r=n.Ov,o=2*r()*Math.PI,s=2*r()-1,a=Math.sqrt(1-s*s)*t;return e[0]=Math.cos(o)*a,e[1]=Math.sin(o)*a,e[2]=s*t,e},rotateX:function(e,t,r,o){const n=[],s=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],s[0]=n[0],s[1]=n[1]*Math.cos(o)-n[2]*Math.sin(o),s[2]=n[1]*Math.sin(o)+n[2]*Math.cos(o),e[0]=s[0]+r[0],e[1]=s[1]+r[1],e[2]=s[2]+r[2],e},rotateY:function(e,t,r,o){const n=[],s=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],s[0]=n[2]*Math.sin(o)+n[0]*Math.cos(o),s[1]=n[1],s[2]=n[2]*Math.cos(o)-n[0]*Math.sin(o),e[0]=s[0]+r[0],e[1]=s[1]+r[1],e[2]=s[2]+r[2],e},rotateZ:function(e,t,r,o){const n=[],s=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],s[0]=n[0]*Math.cos(o)-n[1]*Math.sin(o),s[1]=n[0]*Math.sin(o)+n[1]*Math.cos(o),s[2]=n[2],e[0]=s[0]+r[0],e[1]=s[1]+r[1],e[2]=s[2]+r[2],e},round:function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e},scale:m,scaleAndAdd:g,set:i,sign:h,sqrDist:k,sqrLen:E,squaredDistance:M,squaredLength:w,str:function(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"},sub:F,subtract:c,transformMat3:Z,transformMat4:R,transformMat4Z:function(e,t){return t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]},transformQuat:P,transformQuatValues:j},Symbol.toStringTag,{value:"Module"})),r.d(t,["Il",0,$,"jb",0,F,"lo",0,k,"uE",0,E,"xg",0,D])},76553(e,t,r){function o(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{H:()=>o})},65806(e,t,r){r.d(t,{g:()=>a});var o=r(51850),n=r(91218),s=r(9762);function a(e,t,r,o){if((0,n.canProjectWithoutEngine)(e.spatialReference,r))return i[0]=e.x,i[1]=e.y,i[2]=e.z??0,(0,s.projectBuffer)(i,e.spatialReference,0,t,r,0);const a=(0,n.tryProject)(e,r,o);return!!a&&(t[0]=a.x,t[1]=a.y,t[2]=a.z??0,!0)}const i=(0,o.vt)()},27993(e,t,r){r.d(t,{F:()=>i});var o=r(91218),n=r(16930),s=r(9762),a=r(65806);function i(e,t,r,n){return!(null==t||null==n||e.length<2)&&((0,o.canProjectWithoutEngine)(t,n)?(0,s.projectBuffer)(e,t,0,r,n,0,1):(l.x=e[0],l.y=e[1],l.z=e[2],l.spatialReference=t,(0,a.g)(l,r,n)))}const l={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:n.A.WGS84,type:"point"}},58947(e,t,r){r.d(t,{w6:()=>I,qM:()=>A});var o=r(5482),n=r(11254),s=r(49186),a=r(53966),i=r(17676),l=r(91429),c=r(46130),u=r(5443),p=r(54239),d=r(16930),h=r(60694),f=r(10873),y=r(83898),m=r(73179);var g=r(20655),v=r(80812),M=r(88788),w=r(91682),S=r(26121),x=r(36005);const I=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.url=null,this.indexInfo=null,this._debouncedSaveOperations=(0,i.sg)(async(e,t,r)=>{switch(e){case 0:return this._save(t);case 1:return this._saveAs(r,t)}})}readSpatialReference(e,t){return C(t)}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const o=null==e.spatialReference?{...e,spatialReference:C(t)}:e;return u.A.fromJSON(o,r)}const o=t.store,n=C(t);return null==n||null==o?.extent||!Array.isArray(o.extent)||o.extent.some(e=>e<b)?null:new u.A({xmin:o.extent[0],ymin:o.extent[1],xmax:o.extent[2],ymax:o.extent[3],spatialReference:n})}parseVersionString(e){const t={major:Number.NaN,minor:Number.NaN,versionString:e},r=e.split(".");return r.length>=2&&(t.major=parseInt(r[0],10),t.minor=parseInt(r[1],10)),t}readVersion(e,t){const r=t.store,o=null!=r.version?r.version.toString():"";return this.parseVersionString(o)}readTitlePortalItem(e){return"item-title"!==this.sublayerTitleMode?void 0:e}readTitleService(e,t){if("item-title"===this.sublayerTitleMode)return this.url?(0,h.yG)(this.url,t.name):t.name;let r=t.name;if(!r&&this.url){const e=(0,h.qg)(this.url);null!=e&&(r=e.title)}const o=this.portalItem?.title;return"item-title-and-service-name"===this.sublayerTitleMode&&o&&(r=o+" - "+r),(0,h.cr)(r)}get parsedUrl(){return(0,m.h)(this,{separator:"layers"})}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=(0,y.F)(this.parsedUrl?.path??"",this.rootNode,e,this.customParameters,this.apiKey,a.A.getLogger(this),t),this.indexInfo.catch(()=>{});const{fullExtent:r}=this;null==r||r.hasZ||this._updateExtent(r,await this.indexInfo)}_updateExtent(e,t){if("page"===t?.type){const r=t.rootIndex%t.pageSize,o=t.rootPage?.nodes?.[r];A(e,o?.obb)}else if("node"===t?.type){const r=t.rootNode?.mbs;if(!Array.isArray(r)||4!==r.length||r[0]<b)return;const o=r[2],n=r[3];e.zmin=o-n,e.zmax=o+n}}async _fetchService(e){if(null==this.url)throw new s.A("sceneservice:url-not-set","Scene service can not be loaded without valid portal item or url");if(null==this.layerId&&/SceneServer\/*$/i.test(this.url)){const t=await this._fetchFirstLayerId(e);null!=t&&(this.layerId=t)}return this._fetchServiceLayer(e)}async _fetchFirstLayerId(e){const t=await(0,n.A)(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(t.data&&Array.isArray(t.data.layers)&&t.data.layers.length>0)return t.data.layers[0].id}async _fetchServiceLayer(e){const t=await(0,n.A)(this.parsedUrl?.path??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});t.ssl&&this.url&&(this.url=this.url.replace(/^http:/i,"https:"));let r=!1;if(t.data.layerType&&"Voxel"===t.data.layerType&&(r=!0),r)return this._fetchVoxelServiceLayer();const o=t.data;this.read(o,this._getServiceContext()),this.validateLayer(o)}async _fetchVoxelServiceLayer(e){const t=(await(0,n.A)(this.parsedUrl?.path+"/layer",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,this._getServiceContext()),this.validateLayer(t)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&"function"==typeof this.beforeSave&&await this.beforeSave()}validateLayer(e){}async _saveAs(e,t){const r={...P,...t};let o=v.default.from(e);if(!o)throw new s.A("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");o.id&&(o=o.clone(),o.id=null);const n=o.portal||g.A.getDefault();await this._ensureLoadBeforeSave(),o.type=Z,o.portal=n;const a=(0,M.m)(o,"portal-item",!0),i={layers:[this.write({},a)]};return await Promise.all(a.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(i,a,r),this.url&&(o.url=this.url),o.title||(o.title=this.title),R(o,r,1),await n.signIn(),await n.user.addItem({item:o,folder:r?.folder,data:i}),await(0,w.r)(this.resourceReferences,a),this.portalItem=o,(0,c.v)(a),a.portalItem=o,o}async _save(e){const t={...P,...e};if(!this.portalItem)throw new s.A("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==Z)throw new s.A("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${Z}"`);await this._ensureLoadBeforeSave();const r=(0,M.m)(this.portalItem,"portal-item",!0),o=this.write({},r),a=await async function(e,t){const r=await e.fetchData("json")??{};return Array.isArray(r.layers)||(r.layers=await async function(e,t){const r=await async function(e){const t=N(e.url);if(!t)return null;const r=(await(0,n.A)(t,{query:{f:"json"},responseType:"json"})).data.layers;if(!Array.isArray(r))return null;const o=r.filter(({id:e})=>null!=e).map(({id:e})=>({id:e}));return o.length?o:null}(e).catch(()=>null);return r?.some(({id:e})=>e===t.id)?r:[t]}(e,t)),function(e,t){const r=e.findIndex(({id:e})=>e===t.id);-1===r?e.push(t):e[r]=t}(r.layers,t),r}(this.portalItem,o);await Promise.all(r.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(a,r,t);const i=function(e,t){return t&&function(e,t){const r=N(e);return!!r&&r===T(t).url}(e.url,t)?e.url:t}(this.portalItem,this.url);return i&&(this.portalItem.url=i),this.portalItem.title||(this.portalItem.title=this.title),R(this.portalItem,t,0),await(0,w.S)(this.portalItem,a,this.resourceReferences,r),(0,c.v)(r),this.portalItem}async _validateAgainstJSONSchema(e,t,r){const o=r?.validationOptions;(0,S.ci)(t,{errorName:"sceneservice:save"},{ignoreUnsupported:o?.ignoreUnsupported,supplementalUnsupportedErrors:["scenemodification:unsupported"]});const n=o?.enabled,i=null;if(n&&i){const t=(await i()).validate(e,r.portalItemLayerType);if(!t.length)return;const n=`Layer item did not validate:\n${t.join("\n")}`;if(a.A.getLogger(this).error(`_validateAgainstJSONSchema(): ${n}`),"throw"===o.failPolicy){const e=t.map(e=>new s.A("sceneservice:schema-validation",e));throw new s.A("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{validationErrors:e})}}}};return(0,o.Cg)([(0,l.MZ)(f.id)],r.prototype,"id",void 0),(0,o.Cg)([(0,l.MZ)({type:d.A})],r.prototype,"spatialReference",void 0),(0,o.Cg)([(0,x.w)("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],r.prototype,"readSpatialReference",null),(0,o.Cg)([(0,l.MZ)({type:u.A})],r.prototype,"fullExtent",void 0),(0,o.Cg)([(0,x.w)("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],r.prototype,"readFullExtent",null),(0,o.Cg)([(0,l.MZ)({readOnly:!0,type:p.A})],r.prototype,"heightModelInfo",void 0),(0,o.Cg)([(0,l.MZ)({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],r.prototype,"minScale",void 0),(0,o.Cg)([(0,l.MZ)({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],r.prototype,"maxScale",void 0),(0,o.Cg)([(0,l.MZ)({readOnly:!0})],r.prototype,"version",void 0),(0,o.Cg)([(0,x.w)("version",["store.version"])],r.prototype,"readVersion",null),(0,o.Cg)([(0,l.MZ)({type:String,json:{read:{source:"copyrightText"}}})],r.prototype,"copyright",void 0),(0,o.Cg)([(0,l.MZ)({type:String,json:{read:!1}})],r.prototype,"sublayerTitleMode",void 0),(0,o.Cg)([(0,l.MZ)({type:String})],r.prototype,"title",void 0),(0,o.Cg)([(0,x.w)("portal-item","title")],r.prototype,"readTitlePortalItem",null),(0,o.Cg)([(0,x.w)("service","title",["name"])],r.prototype,"readTitleService",null),(0,o.Cg)([(0,l.MZ)({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],r.prototype,"layerId",void 0),(0,o.Cg)([(0,l.MZ)((0,m.b)({separator:"layers"}))],r.prototype,"url",void 0),(0,o.Cg)([(0,l.MZ)({readOnly:!0})],r.prototype,"parsedUrl",null),(0,o.Cg)([(0,l.MZ)({readOnly:!0})],r.prototype,"store",void 0),(0,o.Cg)([(0,l.MZ)({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],r.prototype,"rootNode",void 0),r=(0,o.Cg)([(0,l.$K)("esri.layers.mixins.SceneService")],r),r},b=-1e38;function C(e){if(null!=e.spatialReference)return d.A.fromJSON(e.spatialReference);const t=e.store,r=t.indexCRS||t.geographicCRS,o=r&&parseInt(r.slice(r.lastIndexOf("/")+1),10);return null!=o?new d.A(o):null}function A(e,t){if(null==t?.center||null==t.halfSize)throw new s.A("sceneservice:invalid-node-page","Invalid node page.");if(t.center[0]<b)return;const r=t.halfSize,o=t.center[2],n=Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);e.zmin=o-n,e.zmax=o+n}function R(e,t,r){e.typeKeywords||(e.typeKeywords=[]);const o=t.getTypeKeywords();for(const t of o)e.typeKeywords.push(t);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t),1===r&&(e.typeKeywords=e.typeKeywords.filter(e=>"Hosted Service"!==e)))}const Z="Scene Service",P={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}},j={layerId:null};function N(e){if(!e)return null;const t=T(e);if(null!=t.layerId)return null;const r=(0,h.qg)(t.url);return null==r||"SceneServer"===r.serverType?t.url:null}function T(e){return(0,h.HZ)({layer:j,url:e,nonStandardUrlAllowed:!0})}},83898(e,t,r){r.d(t,{F:()=>s});var o=r(11254),n=r(49186);async function s(e,t,r,s,a,i,l){let c=null;if(null!=r){const t=`${e}/nodepages/`,n=t+Math.floor(r.rootIndex/r.nodesPerPage);try{return{type:"page",rootPage:(await(0,o.A)(n,{query:{f:"json",...s,token:a},responseType:"json",signal:l})).data,rootIndex:r.rootIndex,pageSize:r.nodesPerPage,lodMetric:r.lodSelectionMetricType,urlPrefix:t}}catch(e){null!=i&&i.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",n,e),c=e}}if(!t)return null;const u=t?.split("/").pop(),p=`${e}/nodes/`,d=p+u;try{return{type:"node",rootNode:(await(0,o.A)(d,{query:{f:"json",...s,token:a},responseType:"json",signal:l})).data,urlPrefix:p}}catch(e){throw new n.A("sceneservice:root-node-missing","Root node missing.",{pageError:c,nodeError:e,url:d})}}},50805(e,t,r){r.d(t,{L0:()=>m,Ot:()=>d,W4:()=>i,uV:()=>u});var o=r(5482),n=r(25482),s=r(91429),a=r(93223);let i=class extends n.o{constructor(){super(...arguments),this.nodesPerPage=null,this.rootIndex=0,this.lodSelectionMetricType=null}};(0,o.Cg)([(0,s.MZ)({type:Number})],i.prototype,"nodesPerPage",void 0),(0,o.Cg)([(0,s.MZ)({type:Number})],i.prototype,"rootIndex",void 0),(0,o.Cg)([(0,s.MZ)({type:String})],i.prototype,"lodSelectionMetricType",void 0),i=(0,o.Cg)([(0,s.$K)("esri.layers.support.I3SLayerDefinitions.I3SNodePageDefinition")],i);let l=class extends n.o{constructor(){super(...arguments),this.factor=1}};(0,o.Cg)([(0,s.MZ)({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],l.prototype,"id",void 0),(0,o.Cg)([(0,s.MZ)({type:Number})],l.prototype,"factor",void 0),l=(0,o.Cg)([(0,s.$K)("esri.layers.support.I3SLayerDefinitions.I3SMaterialTexture")],l);let c=class extends n.o{constructor(){super(...arguments),this.baseColorFactor=[1,1,1,1],this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.metallicFactor=1,this.roughnessFactor=1}};(0,o.Cg)([(0,s.MZ)({type:[Number]})],c.prototype,"baseColorFactor",void 0),(0,o.Cg)([(0,s.MZ)({type:l})],c.prototype,"baseColorTexture",void 0),(0,o.Cg)([(0,s.MZ)({type:l})],c.prototype,"metallicRoughnessTexture",void 0),(0,o.Cg)([(0,s.MZ)({type:Number})],c.prototype,"metallicFactor",void 0),(0,o.Cg)([(0,s.MZ)({type:Number})],c.prototype,"roughnessFactor",void 0),c=(0,o.Cg)([(0,s.$K)("esri.layers.support.I3SLayerDefinitions.I3SMaterialPBRMetallicRoughness")],c);let u=class extends n.o{constructor(){super(...arguments),this.alphaMode="opaque",this.alphaCutoff=.25,this.doubleSided=!1,this.cullFace="none",this.normalTexture=null,this.occlusionTexture=null,this.emissiveTexture=null,this.emissiveFactor=null,this.pbrMetallicRoughness=null}};(0,o.Cg)([(0,a.e)({opaque:"opaque",mask:"mask",blend:"blend"})],u.prototype,"alphaMode",void 0),(0,o.Cg)([(0,s.MZ)({type:Number})],u.prototype,"alphaCutoff",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],u.prototype,"doubleSided",void 0),(0,o.Cg)([(0,a.e)({none:"none",back:"back",front:"front"})],u.prototype,"cullFace",void 0),(0,o.Cg)([(0,s.MZ)({type:l})],u.prototype,"normalTexture",void 0),(0,o.Cg)([(0,s.MZ)({type:l})],u.prototype,"occlusionTexture",void 0),(0,o.Cg)([(0,s.MZ)({type:l})],u.prototype,"emissiveTexture",void 0),(0,o.Cg)([(0,s.MZ)({type:[Number]})],u.prototype,"emissiveFactor",void 0),(0,o.Cg)([(0,s.MZ)({type:c})],u.prototype,"pbrMetallicRoughness",void 0),u=(0,o.Cg)([(0,s.$K)("esri.layers.support.I3SLayerDefinitions.I3SMaterialDefinition")],u);let p=class extends n.o{};(0,o.Cg)([(0,s.MZ)({type:String,json:{read:{source:["name","index"],reader:(e,t)=>null!=e?e:`${t.index}`}}})],p.prototype,"name",void 0),(0,o.Cg)([(0,a.e)({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],p.prototype,"format",void 0),p=(0,o.Cg)([(0,s.$K)("esri.layers.support.I3SLayerDefinitions.I3STextureFormat")],p);let d=class extends n.o{constructor(){super(...arguments),this.atlas=!1}};(0,o.Cg)([(0,s.MZ)({type:[p]})],d.prototype,"formats",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],d.prototype,"atlas",void 0),d=(0,o.Cg)([(0,s.$K)("esri.layers.support.I3SLayerDefinitions.I3STextureSetDefinition")],d);let h=class extends n.o{};(0,o.Cg)([(0,a.e)({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],h.prototype,"type",void 0),(0,o.Cg)([(0,s.MZ)({type:Number})],h.prototype,"component",void 0),h=(0,o.Cg)([(0,s.$K)("esri.layers.support.I3SLayerDefinitions.I3SGeometryAttribute")],h);let f=class extends n.o{};(0,o.Cg)([(0,a.e)({draco:"draco"})],f.prototype,"encoding",void 0),(0,o.Cg)([(0,s.MZ)({type:[String]})],f.prototype,"attributes",void 0),f=(0,o.Cg)([(0,s.$K)("esri.layers.support.I3SLayerDefinitions.I3SGeometryCompressedAttributes")],f);let y=class extends n.o{constructor(){super(...arguments),this.offset=0}};(0,o.Cg)([(0,s.MZ)({type:Number})],y.prototype,"offset",void 0),(0,o.Cg)([(0,s.MZ)({type:h})],y.prototype,"position",void 0),(0,o.Cg)([(0,s.MZ)({type:h})],y.prototype,"normal",void 0),(0,o.Cg)([(0,s.MZ)({type:h})],y.prototype,"uv0",void 0),(0,o.Cg)([(0,s.MZ)({type:h})],y.prototype,"color",void 0),(0,o.Cg)([(0,s.MZ)({type:h})],y.prototype,"uvRegion",void 0),(0,o.Cg)([(0,s.MZ)({type:h})],y.prototype,"featureId",void 0),(0,o.Cg)([(0,s.MZ)({type:h})],y.prototype,"faceRange",void 0),(0,o.Cg)([(0,s.MZ)({type:f})],y.prototype,"compressedAttributes",void 0),y=(0,o.Cg)([(0,s.$K)("esri.layers.support.I3SLayerDefinitions.I3SGeometryBuffer")],y);let m=class extends n.o{};(0,o.Cg)([(0,a.e)({triangle:"triangle"})],m.prototype,"topology",void 0),(0,o.Cg)([(0,s.MZ)()],m.prototype,"geometryBuffers",void 0),m=(0,o.Cg)([(0,s.$K)("esri.layers.support.I3SLayerDefinitions.I3SGeometryDefinition")],m)},88788(e,t,r){r.d(t,{m:()=>a,v:()=>s});var o=r(84952),n=r(20655);function s(e,t){return{...i(e,t),readResourcePaths:[]}}function a(e,t,r){const n=(0,o.An)(e.itemUrl);return{...i(e,t),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:n?{rootPath:n.path,writtenUrls:[]}:null,resources:r?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function i(e,t){return{origin:t,url:(0,o.An)(e.itemUrl),portal:e.portal||n.A.getDefault(),portalItem:e}}},15804(e,t,r){r.d(t,{addOrUpdateResources:()=>i,bg:()=>d,cL:()=>p,fetchResources:()=>a,removeAllResources:()=>c,removeResource:()=>l});var o=r(11254),n=r(49186),s=r(84952);async function a(e,t={},r){await e.load(r);const o=(0,s.fj)(e.itemUrl,"resources"),{start:n=1,num:a=10,sortOrder:i="asc",sortField:l="resource"}=t,c={query:{start:n,num:a,sortOrder:i,sortField:l,token:e.apiKey},signal:r?.signal},u=await e.portal.request(o,c);return{total:u.total,nextStart:u.nextStart,resources:u.resources.map(({created:t,size:r,resource:o})=>({created:new Date(t),size:r,resource:e.resourceFromPath(o)}))}}async function i(e,t,r,o){const a=new Map;for(const{resource:e,content:o,compress:s,access:i}of t){if(!e.hasPath())throw new n.A(`portal-item-resource-${r}:invalid-path`,"Resource does not have a valid path");const[t,l]=u(e.path),c=`${t}/${s??""}/${i??""}`;a.has(c)||a.set(c,{prefix:t,compress:s,access:i,files:[]}),a.get(c).files.push({fileName:l,content:o})}await e.load(o);const i=(0,s.fj)(e.userItemUrl,"add"===r?"addResources":"updateResources");for(const{prefix:t,compress:r,access:s,files:l}of a.values()){const a=25;for(let c=0;c<l.length;c+=a){const u=l.slice(c,c+a),p=new FormData;t&&"."!==t&&p.append("resourcesPrefix",t),r&&p.append("compress","true"),s&&p.append("access",s);let d=0;for(const{fileName:e,content:t}of u)p.append("file"+ ++d,t,e);p.append("f","json");try{await e.portal.request(i,{method:"post",body:p,signal:o?.signal})}catch(e){if(o?.ignoreResourceCopyErrors&&e instanceof n.A&&"CONT_00942"===e.details?.messageCode)continue;throw e}}}}async function l(e,t,r){if(!t.hasPath())throw new n.A("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await e.load(r);const o=(0,s.fj)(e.userItemUrl,"removeResources");await e.portal.request(o,{method:"post",query:{resource:t.path},signal:r?.signal}),t.portalItem=null}async function c(e,t){await e.load(t);const r=(0,s.fj)(e.userItemUrl,"removeResources");return e.portal.request(r,{method:"post",query:{deleteAll:!0},signal:t?.signal})}function u(e){const t=e.lastIndexOf("/");return-1===t?[".",e]:[e.slice(0,t),e.slice(t+1)]}async function p(e){return"blob"===e.type?e.blob:"json"===e.type?new Blob([e.jsonString],{type:"application/json"}):(await(0,o.A)(e.url,{responseType:"blob"})).data}function d(e,t){if(!e.hasPath())return null;const[r,,o]=function(e){const[t,r]=function(e){const t=(0,s.Zo)(e);return null==t?[e,""]:[e.slice(0,e.length-t.length-1),`.${t}`]}(e),[o,n]=u(t);return[o,n,r]}(e.path);return e.portalItem.resourceFromPath((0,s.fj)(r,t+o))}},91682(e,t,r){r.d(t,{S:()=>l,r:()=>i});var o=r(49186),n=r(17676),s=r(13069),a=r(15804);async function i(e,t,r){const o=await c(e,t,r);await u(o,t,r)}async function l(e,t,r,o,n){const s=await c(r,o,n);await e.update({data:t}),await u(s,o,n)}async function c(e,t,i){if(!t?.resources)return;const l=t.portalItem===e.portalItem?new Set(e.paths):new Set;e.paths.length=0,e.portalItem=t.portalItem;const c=new Set(t.resources.toKeep.map(e=>e.resource.path)),u=new Set,p=[];c.forEach(t=>{l.delete(t),e.paths.push(t)});const d=[],h=[],f=[];for(const r of t.resources.toUpdate)if(l.delete(r.resource.path),c.has(r.resource.path)||u.has(r.resource.path)){const{resource:t,content:o,finish:n}=r,i=(0,a.bg)(t,(0,s.lk)());e.paths.push(i.path),d.push({resource:i,content:await(0,a.cL)(o),compress:r.compress}),n&&f.push(()=>n(i))}else{e.paths.push(r.resource.path),h.push({resource:r.resource,content:await(0,a.cL)(r.content),compress:r.compress});const t=r.finish;t&&f.push(()=>t(r.resource)),u.add(r.resource.path)}for(const r of t.resources.toAdd)if(e.paths.push(r.resource.path),l.has(r.resource.path))l.delete(r.resource.path);else{d.push({resource:r.resource,content:await(0,a.cL)(r.content),compress:r.compress});const e=r.finish;e&&f.push(()=>e(r.resource))}if(d.length||h.length){const{addOrUpdateResources:e}=await Promise.resolve().then(r.bind(r,15804));await e(t.portalItem,d,"add",i),await e(t.portalItem,h,"update",i)}if(f.forEach(e=>e()),0===p.length)return l;const y=await(0,n.Ol)(p);if((0,n.Te)(i),y.length>0)throw new o.A("save:resources","Failed to save one or more resources",{errors:y});return l}async function u(e,t,r){if(!e||!t.portalItem)return;const o=[];for(const n of e){const e=t.portalItem.resourceFromPath(n);o.push(e.portalItem.removeResource(e,r))}await(0,n.Lx)(o)}},26121(e,t,r){r.d(t,{I6:()=>l,ci:()=>i,dL:()=>a});var o=r(49186),n=r(77548),s=r(59923);async function a(e){const t=[];for(const r of e.allLayers)if("beforeSave"in r&&"function"==typeof r.beforeSave){const e=r.beforeSave();e&&t.push(e)}await Promise.allSettled(t)}function i(e,t,r){let n=(e.messages??[]).filter(({type:e})=>"error"===e).map(({name:e,message:t,details:r})=>new o.A(e,t,r));if(e.blockedRelativeUrls&&(n=n.concat(e.blockedRelativeUrls.map(e=>(0,s.GL)("url",`Relative url '${e}' is not supported`)))),r){const{ignoreUnsupported:e,supplementalUnsupportedErrors:t=[],requiredPropertyChecksDisabled:o}=r;e&&(n=n.filter(({name:e})=>!(s.MG.has(e)||t.includes(e)))),o&&(n=n.filter(e=>"web-document-write:property-required"!==e.name))}if(n.length>0)throw new o.A(t.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:n})}function l(e){return(0,n.qd)(e).some(e=>!!e.charts?.length)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8692],{28692(e,t,i){i.r(t);var a=i(5482),s=i(67996),r=i(7762),n=i(49186),o=i(53966),l=i(91869),d=i(25728),h=i(17676),p=i(36708),u=i(84952),y=i(13069),c=i(91429),g=i(35666),f=i(4146),m=i(24137),w=i(62796),M=i(40736),b=i(18768),T=i(63074),v=i(69208),_=i(34287),D=i(8303),I=i(54310),A=i(25036),C=i(10873),L=i(54628),P=i(53902),S=i(97159),E=i(56400),k=i(36005),N=i(43937);let G=class extends((0,T.dM)((0,A.j)((0,I.J)((0,b.b)((0,_.q)((0,D.A)((0,d.M)((0,v.d)(f.A))))))))){constructor(e){super(e),this._graphTypeLookup=new Map,this._namedTypesModified=!1,this._idMapCreationDate=null,this.dataManager=null,this.definitionSetMap=null,this.knowledgeGraph=null,this.layers=new(r.A.ofType(w.A)),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="KnowledgeGraphLayer",this.sublayerIdsCache=new Map,this.tables=new(r.A.ofType(w.A)),this.type="knowledge-graph",this.url=null,!e?.title&&e?.url&&(this.title=(0,M.$L)(e.url)),this.addHandles((0,p.wB)(()=>this.layers.concat(this.tables),(e,t)=>this._handleSublayersChange(e,t),p.OH))}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){try{await this.loadFromPortal({supportedTypes:["Knowledge Graph Layer"]},e)}catch(e){(0,h.QP)(e)}await this._fetchMetadata(e),await this._initializeLayerProperties(e),this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await(0,M.qN)(this)}async _fetchMetadata(e){if(!this.url)throw new n.A("knowledge-graph:missing-url","KnowledgeGraphLayer must be created with a url");const t=await(0,P.fetchKnowledgeGraph)(this.url);this.knowledgeGraph=t;const{edit:i,fullEdit:a,updateItem:s}=await(0,M.N1)(t.serviceDefinition.serviceItemId,this.url,e);this._set("userHasEditingPrivileges",i),this._set("userHasFullEditingPrivileges",a),this._set("userHasUpdateItemPrivileges",s),this.read({dateFieldsTimeReference:t.serviceDefinition.dateFieldsTimeReference},{origin:"service"}),this._forEachGraphType(e=>{e.name&&this._graphTypeLookup.set(e.name,e)})}async _initializeLayerProperties(e){7===this.originIdOf("inclusionModeDefinition")?this._validateInclusionModeDefinition():await this._initializeInclusionModeDefinition(e),this._setMemberTypes(),this.dataManager=new m.P({knowledgeGraph:this.knowledgeGraph,inclusionModeDefinition:this.inclusionModeDefinition})}async _initializeInclusionModeDefinition(e){this._idMapCreationDate=(await(0,L.lV)([this.definitionSetMap??""],this.portalItem?.itemUrl??"")).get(this.definitionSetMap??"")??null;const t=this.definitionSetMap?await(0,s.cZ)(this.definitionSetMap,!0,e?.signal?{signal:e.signal}:void 0):{generateAllSublayers:!0,namedTypeDefinitions:new Map};[...this.layers.toArray(),...this.tables.toArray()].forEach(e=>{const i=this._graphTypeLookup.get(e.graphTypeName);i&&!t.namedTypeDefinitions.has(i.name)&&t.namedTypeDefinitions.set(i.name,{useAllData:!0})}),this.setAtOrigin("inclusionModeDefinition",t,(0,g.OL)(this.originIdOf("definitionSetMap")))}_validateInclusionModeDefinition(){const{inclusionModeDefinition:e}=this;if(!e)return;const{namedTypeDefinitions:t}=e;if(t?.size>0)t.forEach((e,i)=>{const a=this._graphTypeLookup.get(i);if(!a)return o.A.getLogger(this).warn(`A named type, ${i}, was in the inclusion list that wasn't in the data model and will be removed`),void t.delete(i);"relationship"!==a.type&&"entity"!==a.type&&(o.A.getLogger(this).warn(`A named type, ${i}, was in the inclusion list that wasn't properly modeled and will be removed`),t.delete(i))});else if(!e.generateAllSublayers)throw new n.A("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined")}_setMemberTypes(){let e=[],t=[];const{inclusionModeDefinition:i}=this,a=i?.namedTypeDefinitions;!i||i.generateAllSublayers?(e=this.knowledgeGraph.dataModel?.entityTypes??[],t=this.knowledgeGraph.dataModel?.relationshipTypes??[]):a&&a.size>0&&a.forEach((i,a)=>{const s=this._graphTypeLookup.get(a);switch(s?.type){case"relationship":t.push(s);break;case"entity":e.push(s)}}),this.memberEntityTypes=e,this.memberRelationshipTypes=t}_forEachGraphType(e){[...this.knowledgeGraph.dataModel?.entityTypes??[],...this.knowledgeGraph.dataModel?.relationshipTypes??[]].forEach(t=>{e(t)})}_refreshNamedTypes(){this._namedTypesModified=!0;for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}async _handleNewRecords(e){const t=new Set,i=[];for(const a of e)this._graphTypeLookup.has(a.typeName)&&(!1===this.layers.concat(this.tables).some(e=>e.objectType.name===a.typeName)&&(this.dataManager.sublayerCaches.set(a.typeName,new Map),t.add(a.typeName)),(0,l.tE)(this.sublayerIdsCache,a.typeName,()=>new Set).add(a.id),i.push(a));this.dataManager.addToLayer(i);for(const e of t){const t=this._graphTypeLookup.get(e);t&&(this._addSublayer(t),"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e))}await(0,M.qN)(this,Array.from(t)),this._refreshNamedTypes()}_createSublayers(e,t,i){e.forEach(e=>{const a=this._createSublayer(e);i(a)&&t.push(a),this._updateSublayerCaches(e)})}_addSublayer(e){const t=this._createSublayer(e);return t.geometryType?this.layers.push(t):this.tables.push(t),t}_createSublayer(e){return new w.A({objectType:e,parentCompositeLayer:this,graphType:e.type})}_updateSublayers(e,t){t.forEach(t=>{t.parentCompositeLayer=this;const i=e.find(e=>e.type===t.graphType&&e.name===t.graphTypeName);i&&(t.objectType=i,this._updateSublayerCaches(i))})}_updateSublayerCaches({name:e}){if(!e)return;const t=this.dataManager.sublayerCaches;t.has(e)||t.set(e,new Map)}_saveUrlAsNewResource(e,t,i,a,r,n){(async function(e){const t=await(0,s.fe)(e);return new Blob([t],{type:"application/x-protobuf"})})(this.inclusionModeDefinition).then(s=>{const n=function(e){const t=`definitionSetMap-${(0,y.lk)()}.dat`,i=(0,u.fj)("knowledgeGraphLayer",t);return e.resourceFromPath(i)}(a);e[t]=n.itemRelativeUrl,i.toAdd.push({resource:n,content:{type:"blob",blob:s},compress:!1,finish:e=>{this.definitionSetMap=e.url}}),r()}).catch(e=>{n(e)})}_displaysAllRecords(e){for(const[,{useAllData:t}]of e.namedTypeDefinitions)if(!t)return!1;return!0}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(e=>{e.parent=this}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this}),e.on("after-remove",({item:e})=>{e.parent=null})],"sublayers-owner"))}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=3&&e<7}readDefinitionSetMap(e,t,i){return(0,S.f)(e,i)}writeDefinitionSetMap(e,t,i,a){const s=a?.portalItem,r=a?.resources,n=(0,g.aB)(a?.origin);t[i]="<pending>",r?.pendingOperations.push(new Promise((o,l)=>{(0,L.zI)(e??"",s?.itemUrl??"",this._idMapCreationDate).then(d=>{if(!s||!r||null==n)return e&&(t[i]=(0,S.t)(e,a)),void o();const{inclusionModeDefinition:h}=this;if(!h||this._displaysAllRecords(h))return this.definitionSetMap=null,void o();const p=this.originIdOf("inclusionModeDefinition");if(7===p||this._namedTypesModified||!d||n<p)this._saveUrlAsNewResource(t,i,r,s,o,l);else{if(n===p&&e){const n=(0,S.t)(e,a);return void((0,u.oP)(n)?this._saveUrlAsNewResource(t,i,r,s,o,l):(t[i]=n,o()))}o()}}).catch(e=>{l(e)})}))}set inclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("inclusionModeDefinition",e):o.A.getLogger(this).error("#inclusionModeDefinition","inclusionModeDefinition cannot be changed after the layer is loaded.")}get sublayerCapabilities(){return(0,M.hZ)(this.knowledgeGraph)}loadLayerAssumingLocalCache(){const e=[...this.memberEntityTypes,...this.memberRelationshipTypes];this.layers.length||0===this.originIdOf("tables")?0===this.originIdOf("layers")?this._createSublayers(e,this.layers,e=>!!e.geometryType):this._updateSublayers(e,this.layers):this.layers=new r.A,this.tables.length||0===this.originIdOf("layers")?0===this.originIdOf("tables")?this._createSublayers(e,this.tables,e=>!e.geometryType):this._updateSublayers(e,this.tables):this.tables=new r.A,this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{const i=(0,l.tE)(this.sublayerIdsCache,t,()=>new Set);e.members?.forEach(e=>{i.add(e.id)})})}async addRecords(e){await this.load(),await this._handleNewRecords(e)}async createSublayerForNamedType(e){await this.load();const t=this._graphTypeLookup.get(e);if(!t)throw new n.A("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(this.dataManager.sublayerCaches.has(e))throw new n.A("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),(0,l.tE)(this.sublayerIdsCache,e,()=>new Set);const i=this._addSublayer(t);return"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),await(0,M.qN)(this,[e]),this._refreshNamedTypes(),i}convertSublayerToDynamicData(e){if(!this.dataManager.inclusionModeDefinition)throw new n.A("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new n.A("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(!this.dataManager.sublayerCaches.has(e))throw new n.A("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");const t=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);t?.useAllData?o.A.getLogger(this).warn("This Knowledge Graph Layer already uses dynamic membership for the sublayer - no conversion was made"):(this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),this.sublayerIdsCache.delete(e),this._refreshNamedTypes())}convertSublayerToExplicitMembership(e){if(!this.dataManager.inclusionModeDefinition)throw new n.A("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new n.A("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");const t=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);if(!t||t.useAllData){if(!this.dataManager.sublayerCaches.has(e))throw new n.A("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");this.sublayerIdsCache.set(e,new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map}),this._refreshNamedTypes()}else o.A.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership for the sublayer - no conversion was made")}convertToFullyDynamicData(){this.dataManager.inclusionModeDefinition?(this.sublayerIdsCache.clear(),this.dataManager.inclusionModeDefinition=null,this._set("inclusionModeDefinition",this.dataManager.inclusionModeDefinition),this._refreshNamedTypes()):o.A.getLogger(this).warn("This Knowledge Graph Layer already uses fully dynamic membership - no conversion was made")}convertToExplicitMembership(){if(this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.size>0&&[...this.dataManager.inclusionModeDefinition.namedTypeDefinitions.values()].every(e=>!1===e.useAllData))o.A.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership - no conversion was made");else{this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map};for(const e of this.dataManager.sublayerCaches.keys())(0,l.tE)(this.sublayerIdsCache,e,()=>new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map});this._set("inclusionModeDefinition",this.dataManager.inclusionModeDefinition),this._refreshNamedTypes()}}async removeRecords(e){await this.load();const t=[];for(const i of e)!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.members?.has(i.id)&&t.push(i);this.dataManager.removeFromLayer(t);for(const e of t)this.sublayerIdsCache.get(e.typeName)?.delete(e.id);return this._refreshNamedTypes(),t}};(0,a.Cg)([(0,c.MZ)()],G.prototype,"dataManager",void 0),(0,a.Cg)([(0,c.MZ)({json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],G.prototype,"definitionSetMap",void 0),(0,a.Cg)([(0,k.w)("definitionSetMap")],G.prototype,"readDefinitionSetMap",null),(0,a.Cg)([(0,N.K)("definitionSetMap")],G.prototype,"writeDefinitionSetMap",null),(0,a.Cg)([(0,c.MZ)()],G.prototype,"inclusionModeDefinition",null),(0,a.Cg)([(0,c.MZ)()],G.prototype,"knowledgeGraph",void 0),(0,a.Cg)([(0,c.MZ)({type:r.A.ofType(w.A),json:{write:{ignoreOrigin:!0}}})],G.prototype,"layers",void 0),(0,a.Cg)([(0,c.MZ)()],G.prototype,"memberEntityTypes",void 0),(0,a.Cg)([(0,c.MZ)()],G.prototype,"memberRelationshipTypes",void 0),(0,a.Cg)([(0,c.MZ)({type:["KnowledgeGraphLayer"]})],G.prototype,"operationalLayerType",void 0),(0,a.Cg)([(0,c.MZ)()],G.prototype,"sublayerCapabilities",null),(0,a.Cg)([(0,c.MZ)()],G.prototype,"sublayerIdsCache",void 0),(0,a.Cg)([(0,c.MZ)({type:r.A.ofType(w.A),json:{write:{ignoreOrigin:!0}}})],G.prototype,"tables",void 0),(0,a.Cg)([(0,c.MZ)({json:{read:!1}})],G.prototype,"type",void 0),(0,a.Cg)([(0,c.MZ)(C.OZ)],G.prototype,"url",void 0),(0,a.Cg)([(0,c.MZ)((0,E.P6)("dateFieldsTimeReference"))],G.prototype,"dateFieldsTimeZone",void 0),G=(0,a.Cg)([(0,c.$K)("esri.layers.KnowledgeGraphLayer")],G);const U=G;i.d(t,["default",0,U])},18768(e,t,i){var a=i(5482),s=i(53966),r=i(91429),n=i(60694);i.d(t,["b",0,e=>{const t=e;let i=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,n.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,n.Jf)(e,s.A.getLogger(this)))}};return(0,a.Cg)([(0,r.MZ)()],i.prototype,"title",null),(0,a.Cg)([(0,r.MZ)({type:String})],i.prototype,"url",null),i=(0,a.Cg)([(0,r.$K)("esri.layers.mixins.ArcGISService")],i),i}])},69208(e,t,i){var a=i(5482),s=i(91429);i.d(t,["d",0,e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.customParameters=null}};return(0,a.Cg)([(0,s.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],i.prototype,"customParameters",void 0),i=(0,a.Cg)([(0,s.$K)("esri.layers.mixins.CustomParametersMixin")],i),i}])},8303(e,t,i){var a=i(5482),s=i(92602),r=i(70333),n=i(11254),o=i(60999),l=i(49186),d=i(36563),h=i(53966),p=i(97768),u=i(17676),y=i(84952),c=i(91429),g=i(77548),f=i(20655),m=i(80812),w=i(41318),M=i(10407),b=i(36005),T=i(43937);const v={credential:null,user:null};i.d(t,["A",0,e=>{const t=e;let _=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){super.destroy(),this.portalItem=(0,p.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}get portalItem(){return this._get("portalItem")}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,i){if(t.itemId)return new m.default({id:t.itemId,portal:i?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:a}=await i.e(1204).then(i.bind(i,41204));return(0,u.Te)(t),await a({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,u.zf)(e)||h.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async reloadFromPortal(e){if(!this.loaded||!this.portalItem?.id)return!1;try{const{reload:t}=await i.e(1204).then(i.bind(i,41204)),a=new AbortController,s=(0,d.rE)(a);return this.addHandles(s,"reloadFromPortal"),await t({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},{signal:a.signal})}catch(e){throw(0,u.zf)(e)||h.A.getLogger(this).warn(`Failed to reload layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}finally{this.removeHandles("reloadFromPortal")}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,u.QP)(e),!0)))}async setUserPrivileges(e,t){if(!s.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:i,fullEdit:a},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",i),this._set("userHasFullEditingPrivileges",a),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,u.QP)(e)}}async _fetchUserPrivileges(e,t){let i=this.portalItem;if(!e||!i||!i.loaded||i.sourceUrl)return this._fetchFallbackUserPrivileges(t);const a=!r.id?.findCredential(this.url),s=e===i.id;if(s&&i.portal.user)return this._getUserPrivileges(i,a);let n,o;if(s)n=i.portal.url;else try{n=await(0,g.wI)(this.url,t)}catch(e){(0,u.QP)(e)}if(!n||!(0,y.b8)(n,i.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;o=await(r.id?.getCredential(`${n}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,u.QP)(e)}const l=!0,d=!1,h=!1;if(!o)return{features:{edit:l,fullEdit:d},content:{updateItem:h}};try{if(s?await i.reload():(i=new m.default({id:e,portal:{url:n}}),await i.load(t)),i.portal.user)return this._getUserPrivileges(i,a)}catch(e){(0,u.QP)(e)}return{features:{edit:l,fullEdit:d},content:{updateItem:h}}}_getUserPrivileges(e,t){const i=(0,M.It)(e);return t&&(i.features.edit=!0),i}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,u.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?r.id?.findCredential(this.url):null;if(!t)return!0;const i=v.credential===t?v.user:await this._fetchEditingUser(e);return v.credential=t,v.user=i,null==i?.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const i=r.id?.findServerInfo(this.url??"");if(!i?.owningSystemUrl)return null;const a=`${i.owningSystemUrl}/sharing/rest`,s=f.A.getDefault();if(s&&s.loaded&&(0,y.S8)(s.restUrl)===(0,y.S8)(a))return s.user;const l=`${a}/community/self`,d=null!=e?e.signal:null,h=await(0,o.Ke)((0,n.A)(l,{authMode:"no-prompt",query:{f:"json"},signal:d}));return h.ok?w.A.fromJSON(h.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const i=t?.portal,a=this.portalItem?.id&&(this.portalItem.portal||f.A.getDefault());return i&&a&&!(0,y.ut)(a.restUrl,i.restUrl)?(t.messages&&t.messages.push(new l.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,a.Cg)([(0,c.MZ)({type:m.default})],_.prototype,"portalItem",null),(0,a.Cg)([(0,b.w)("web-document","portalItem",["itemId"])],_.prototype,"readPortalItem",null),(0,a.Cg)([(0,T.K)("web-document","portalItem",{itemId:{type:String}})],_.prototype,"writePortalItem",null),(0,a.Cg)([(0,c.MZ)({clonable:!1})],_.prototype,"resourceReferences",void 0),(0,a.Cg)([(0,c.MZ)({type:Boolean,readOnly:!0})],_.prototype,"userHasEditingPrivileges",void 0),(0,a.Cg)([(0,c.MZ)({type:Boolean,readOnly:!0})],_.prototype,"userHasFullEditingPrivileges",void 0),(0,a.Cg)([(0,c.MZ)({type:Boolean,readOnly:!0})],_.prototype,"userHasUpdateItemPrivileges",void 0),_=(0,a.Cg)([(0,c.$K)("esri.layers.mixins.PortalLayer")],_),_}])}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7373],{37373(e,n,t){t.d(n,{DO:()=>F,FT:()=>W,Hh:()=>b,OM:()=>j,Ps:()=>J,Wo:()=>k,_I:()=>S,_l:()=>v,l0:()=>Y,t$:()=>X,uk:()=>L});var i=t(4576),o=t(49186),s=t(86211),r=t(5443),a=t(83290),l=t(86738),c=t(39829),f=t(91218),u=t(16930),x=t(21325);function m(){if(!P)throw new o.A("rasterprojectionhelper-project","projection operator is not loaded")}const h=(e,n,t,i=0)=>{if(1===t[0])return[0,0];let o=1,s=-1,r=1,a=-1;for(let n=0;n<e.length;n+=2)isNaN(e[n])||(o=o>e[n]?e[n]:o,s=s>e[n]?s:e[n],r=r>e[n+1]?e[n+1]:r,a=a>e[n+1]?a:e[n+1]);const{cols:l,rows:c}=n,f=(s-o)/l/t[0],u=(a-r)/c/t[1],x=2*i;let m=0,h=!1,p=[0,0];for(let n=0;n<l-3;n++){for(let t=0;t<c-3;t++){const i=n*c*2+2*t,o=(e[i]+e[i+4]+e[i+4*c]+e[i+4*c+4])/4,s=(e[i+1]+e[i+5]+e[i+4*c+1]+e[i+4*c+5])/4,r=Math.abs((o-e[i+2*c+2])/f),a=Math.abs((s-e[i+2*c+3])/u);if(r+a>m&&(m=r+a,p=[r,a]),x&&m>x){h=!0;break}}if(h)break}return p},p={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},g=new Map,y=new Map,d=500;let w,M,R,P=!1;async function b(){return w||(w=Promise.withResolvers(),M=await t.e(3276).then(t.bind(t,83276)),R=await t.e(2158).then(t.bind(t,12158)),M.isLoaded()||await M.load(),R.isLoaded()||await R.load(),P=!0,w.resolve()),w.promise}function k(e,n,t,i){const o=e.spatialReference;if(!o||!n||o.equals(n))return e;m();const a=t.center,l=new r.A({xmin:a.x-e.x/2,xmax:a.x+e.x/2,ymin:a.y-e.y/2,ymax:a.y+e.y/2,spatialReference:o}),c=M.execute(l,n,{geographicTransformation:i}),f=W(n);return null==c||null!=f&&c.width>=f?function(e,n,t){const i=(0,s.GA)(n)/(0,s.GA)(t);return{x:e.x*i,y:e.y*i}}(e,o,n):{x:c.width,y:c.height}}function G(e,n=.01){return(0,s.GA)(e)?n/(0,s.GA)(e):0}function S(e,n,t,i=!0){const o=e.spatialReference;if(o.equals(n))return e;m();const s=M.execute(e,n,{geographicTransformation:t});return i&&s?(E([e],[s],o,n),s):s}function E(e,n,t,i){const o=z(t,!0),s=z(i,!0),r=G(t,d),a=G(i,d);if(r&&null!=o&&null!=s)for(let t=0;t<e.length;t++){const i=n[t];if(!i)continue;const{x:l}=e[t],{x:c}=i;c>=s[1]-a&&Math.abs(l-o[0])<r?i.x-=s[1]-s[0]:c<=s[0]+a&&Math.abs(l-o[1])<r&&(i.x+=s[1]-s[0])}}function A(e){const{inSR:n,outSR:t,preferPE:i}=e;if(n.equals(t)){const{points:n}=_(e,null);return n}if(n.isWebMercator&&t.isWGS84||n.isWGS84&&t.isWebMercator)return function(e){const{cols:n,rows:t,xres:i,yres:o,usePixelCenter:s,inSR:r,outSR:a}=e;let{xmin:c,ymax:u}=e;s&&(c+=i/2,u-=o/2);const x=[],m=[],h=Math.max(n,t);for(let e=0;e<h;e++){const s=c+i*Math.min(n,e),h=u-o*Math.min(t,e),p=(0,f.projectWithoutEngine)(new l.A({x:s,y:h,spatialReference:r}),r,a);e<=n&&x.push(p.x),e<=t&&m.push(p.y)}const p=[];for(let e=0;e<n;e++)for(let n=0;n<t;n++)p.push([x[e],m[n]]);return p}(e);if(i){if(n.isGeographic)return N(e);if(null!=T(n))return N(e)}return function(e){const{points:n}=_(e,null),{inSR:t,outSR:i,datumTransformation:o}=e,s=n.map(e=>new l.A(e[0],e[1],t)),r=M.executeMany(s,i,{geographicTransformation:o});return o&&E(s,r,t,i),r.map(e=>e?[e.x,e.y]:[NaN,NaN])}(e)}function N(e){const{inSR:n,outSR:t,datumTransformation:i}=e,o=T(n),{points:s,mask:r}=_(e,o);if(!n.isGeographic){const e=n.wkid?a.P.coordsys(n.wkid):a.P.fromString(n.isGeographic?a.a.PE_TYPE_GEOGCS:a.a.PE_TYPE_PROJCS,n.wkt2||n.wkt);a.c.projToGeog(e,s.length,s)}if(null!=i&&i.steps.length){let e;const n=179.9955;if(t.isGeographic&&(e=s.map(([e])=>e>n?1:e<-n?-1:0)),i.steps.forEach(e=>{const n=e.wkid?a.P.geogtran(e.wkid):a.P.fromString(a.a.PE_TYPE_GEOGTRAN,e.wkt);a.d.geogToGeog(n,s.length,s,null,e.isInverse?a.a.PE_TRANSFORM_2_TO_1:a.a.PE_TRANSFORM_1_TO_2)}),e)for(let t=0;t<s.length;t++){const i=e[t],o=s[t][0],r=o>n?1:o<-n?-1:0;i&&r&&i!==r&&(s[t][0]=i>0?o+360:o-360)}}if(!t.isGeographic){const e=T(t,!0),n=null!=e&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90];!function(e,n){const[t,i]=n;for(let n=0;n<e.length;n++){const o=e[n][1];(o<t||o>i)&&(e[n]=[NaN,NaN])}}(s,n);const i=t.wkid?a.P.coordsys(t.wkid):a.P.fromString(t.isGeographic?a.a.PE_TYPE_GEOGCS:a.a.PE_TYPE_PROJCS,t.wkt2||t.wkt);a.c.geogToProj(i,s.length,s)}let l=s;if(r&&s.length!==r.length){l=[];for(let e=0,n=0;e<r.length;e++)r[e]?l.push(s[n++]):l.push([NaN,NaN])}return l}function T(e,n=!1){let t=e.wkid||e.wkt2||e.wkt;if(!t||e.isGeographic)return null;if(t=String(t),g.has(t)){const e=g.get(t);return n?e?.gcs:e?.pcs}const i=e.wkid?a.P.coordsys(e.wkid):a.P.fromString(e.isGeographic?a.a.PE_TYPE_GEOGCS:a.a.PE_TYPE_PROJCS,e.wkt2||e.wkt),o=C(i,G(e,1e-4)),s=C(i,0,!0);return g.set(t,{pcs:o,gcs:s}),n?s:o}function C(e,n=0,t=!1){const i=a.b.generate(e),o=t?e.horizonGcsGenerate():e.horizonPcsGenerate();if(!i||!o?.length)return null;let s=!1,r=o.find(e=>1===e.getInclusive()&&1===e.getKind());if(!r){if(r=o.find(e=>1===e.getInclusive()&&0===e.getKind()),!r)return null;s=!0}const l=t?0:(2===i.getNorthPoleLocation()?1:0)|(2===i.getSouthPoleLocation()?2:0),c=i.isPannableRectangle(),f=r.getCoord();if(s)return{isEnvelope:s,isPannable:c,vertices:f,coef:null,bbox:[f[0][0]-n,f[0][1]-n,f[1][0]+n,f[1][1]+n],poleLocation:l};let u=0;const x=[];let[m,h]=f[0],[p,g]=f[0];for(let e=0,n=f.length;e<n;e++){u++,u===n&&(u=0);const[t,i]=f[e],[o,s]=f[u];if(s===i)x.push([t,o,i,s,2]);else{const e=(o-t)/(s-i||1e-4),n=t-e*i;i<s?x.push([e,n,i,s,0]):x.push([e,n,s,i,1])}m=m<t?m:t,h=h<i?h:i,p=p>t?p:t,g=g>i?g:i}return{isEnvelope:!1,isPannable:c,vertices:f,coef:x,bbox:[m,h,p,g],poleLocation:l}}function _(e,n){const t=[],{cols:i,rows:o,xres:s,yres:r,usePixelCenter:a}=e;let{xmin:l,ymax:c}=e;if(a&&(l+=s/2,c-=r/2),null==n){for(let e=0;e<i;e++)for(let n=0;n<o;n++)t.push([l+s*e,c-r*n]);return{points:t}}const f=new Uint8Array(i*o);if(n.isEnvelope){const{isPannable:e,bbox:[a,u,x,m]}=n;for(let n=0,h=0;n<i;n++){const i=l+s*n,p=e||i>=a&&i<=x;for(let e=0;e<o;e++,h++){const n=c-r*e;p&&n>=u&&n<=m&&(t.push([i,n]),f[h]=1)}}return{points:t,mask:f}}const u=n.coef,x=[];for(let e=0;e<o;e++){const n=c-r*e,t=[],i=[];for(let e=0;e<u.length;e++){const[o,s,r,a,l]=u[e];if(n===r&&r===a)t.push(o),t.push(s),i.push(2),i.push(2);else if(n>=r&&n<=a){const e=o*n+s;t.push(e),i.push(l)}}let o=t;if(t.length>2){let e=2===i[0]?0:i[0],n=t[0];o=[];for(let s=1;s<i.length;s++)2===i[s]&&s!==i.length-1||(i[s]!==e&&(o.push(0===e?Math.min(n,t[s-1]):Math.max(n,t[s-1])),e=i[s],n=t[s]),s===i.length-1&&o.push(0===i[s]?Math.min(n,t[s]):Math.max(n,t[s])));o.sort((e,n)=>e-n)}else t[0]>t[1]&&(o=[t[1],t[0]]);x.push(o)}for(let e=0,n=0;e<i;e++){const i=l+s*e;for(let e=0;e<o;e++,n++){const o=c-r*e,s=x[e];if(2===s.length)i>=s[0]&&i<=s[1]&&(t.push([i,o]),f[n]=1);else if(s.length>2){let e=!1;for(let n=0;n<s.length;n+=2)if(i>=s[n]&&i<=s[n+1]){e=!0;break}e&&(t.push([i,o]),f[n]=1)}}}return{points:t,mask:f}}function v(e,n,t=null,o=!0){const s=e.spatialReference;if(s.equals(n)||!n)return e;const a=j(e),l=W(s,!0),f=W(n);if(0===a||null==l||null==f){const i=O(e,n,t,o);if(i&&null==l&&null!=f&&Math.abs(i.width-f)<G(n)&&M.isLoaded()){const t=T(s);if(null!=t&&0===t.poleLocation&&e.width<(t.bbox[2]-t.bbox[0])/2)return function(e,n){const t=W(n);if(null==t)return null;let{xmin:i,ymin:o,xmax:s,ymax:a}=e;const l=e.spatialReference,f=new c.A({spatialReference:l,rings:[[[i,o],[s,o],[s,a],[i,a],[i,o]]]}),u=M.execute(f,n);if(2!==u.rings.length||!u.rings[0].length||!u.rings[1].length)return null;const{rings:x}=u,m=G(l),h=new r.A({spatialReference:n});for(let e=0;e<2;e++){i=s=x[e][0][0],o=a=x[e][0][1];for(let n=0;n<x[e].length;n++)i=i>x[e][n][0]?x[e][n][0]:i,s=s<x[e][n][0]?x[e][n][0]:s,o=o>x[e][n][1]?x[e][n][1]:o,a=a<x[e][n][1]?x[e][n][1]:a;if(0===e)h.ymin=o,h.ymax=a,h.xmin=i,h.xmax=s;else if(h.ymin=Math.min(h.ymin,o),h.ymax=Math.max(h.ymax,a),Math.abs(s-t/2)<m)h.xmin=i,h.xmax=h.xmax+t;else{if(!(Math.abs(i+t/2)<m))return null;h.xmax=s+t}}return h}(e,n)||i}return i}const u=e.clone().normalize();if(1===u.length&&e.xmax<l&&e.xmax-l/2>G(s)){const{xmin:n,xmax:t}=e;for(let i=0;i<=a;i++){const o=0===i?n:-l/2,c=i===a?t-l*i:l/2;u[i]=new r.A({xmin:o,xmax:c,ymin:e.ymin,ymax:e.ymax,spatialReference:s})}}const x=u.map(e=>O(e,n,t,o)).filter(i.Ru);return 0===x.length?null:function(e,n){const t=W(e[0].spatialReference);if(e.length<2||null==t)return e[0];if(n=n??G(e[0].spatialReference),1===(e=e.filter(e=>e.width>n)).length)return e[0];let{xmin:i,xmax:o,ymin:s,ymax:a}=e[0];for(let n=1;n<e.length;n++){const i=e[n];o=i.xmax+t*n,s=Math.min(s,i.ymin),a=Math.max(a,i.ymax)}return new r.A({xmin:i,xmax:o,ymin:s,ymax:a,spatialReference:e[0].spatialReference})}(x)}function L(e,n,t){if("extent"===e.type){const{xmin:n,ymin:t,xmax:i,ymax:o,spatialReference:s}=e;e=new c.A({rings:[[[n,o],[i,o],[i,t],[n,t],[n,o]]],spatialReference:s})}return e.spatialReference.equals(n)?e:(m(),M.execute(e,n,{geographicTransformation:t}))}function O(e,n,t,i=!0,o=!0){const s=e.spatialReference;if(s.equals(n)||!n)return e;m();const r=M.execute(e,n,{geographicTransformation:t});if(o&&n.isWebMercator&&r&&(r.ymax=Math.min(20037508.342787,r.ymax),r.ymin=Math.max(-20037508.342787,r.ymin),r.ymin>=r.ymax))return null;if(!i||!r)return r;const a=z(s,!0),c=z(n,!0);if(null==a||null==c)return r;const f=G(s,.001),u=G(s,d),x=G(n,.001);if(Math.abs(r.xmin-c[0])<x&&Math.abs(r.xmax-c[1])<x){const i=Math.abs(e.xmin-a[0]),o=Math.abs(a[1]-e.xmax);if(i<f&&o>u){r.xmin=c[0];const i=[];i.push(new l.A(e.xmax,e.ymin,s)),i.push(new l.A(e.xmax,(e.ymin+e.ymax)/2,s)),i.push(new l.A(e.xmax,e.ymax,s));const o=i.map(e=>S(e,n,t)).filter(e=>!isNaN(e?.x)).map(e=>e.x);r.xmax=Math.max.apply(null,o)}if(o<f&&i>u){r.xmax=c[1];const i=[];i.push(new l.A(e.xmin,e.ymin,s)),i.push(new l.A(e.xmin,(e.ymin+e.ymax)/2,s)),i.push(new l.A(e.xmin,e.ymax,s));const o=i.map(e=>S(e,n,t)).filter(e=>!isNaN(e?.x)).map(e=>e.x);r.xmin=Math.min.apply(null,o)}}else{const e=G(n,.001);Math.abs(r.xmin-c[0])<e&&(r.xmin=c[0]),Math.abs(r.xmax-c[1])<e&&(r.xmax=c[1])}return r}function W(e,n=!1){if(!e)return null;const t=n?20037508.342787:20037508.342788905;return e.isWebMercator?2*t:e.wkid&&e.isGeographic?360:2*p[e.wkid]||null}function z(e,n=!1){if(e.isGeographic)return[-180,180];const t=W(e,n);return t?[-t/2,t/2]:null}function I(e,n,t,i){let o=(e-n)/t;return o-Math.floor(o)!==0?o=Math.floor(o):i&&(o-=1),o}function j(e,n=!1){const t=W(e.spatialReference);if(null==t)return 0;const i=n?0:-t/2,o=G(e.spatialReference),s=!n&&Math.abs(e.xmax-t/2)<o?t/2:e.xmax,r=!n&&Math.abs(e.xmin+t/2)<o?-t/2:e.xmin;return I(s,i,t,!0)-I(r,i,t,!1)}function F(e){const n=e.storageInfo.origin.x,t=W(e.spatialReference,!0);if(null==t)return{originX:n,halfWorldWidth:null,pyramidsInfo:null};const i=t/2,{nativePixelSize:o,storageInfo:s,extent:r}=e,{maximumPyramidLevel:a,blockWidth:l,pyramidScalingFactor:c}=s;let f=o.x;const u=[],x=null!=e.transform&&"gcs-shift"===e.transform.type,m=n+(x?0:i),h=x?t-n:i-n;for(let e=0;e<=a;e++){const e=(r.xmax-n)/f/l,t=e-Math.floor(e)===0?e:Math.ceil(e),i=h/f/l,o=i-Math.floor(i)===0?i:Math.ceil(i),s=Math.floor(m/f/l),a=Math.round(m/f)%l,x=(l-Math.round(h/f)%l)%l;u.push({resolutionX:f,blockWidth:l,datasetColumnCount:t,worldColumnCountFromOrigin:o,leftMargin:a,rightPadding:x,originColumnOffset:s}),f*=c}return{originX:n,halfWorldWidth:i,pyramidsInfo:u,hasGCSSShiftTransform:x}}function Y(e){const n=e.isAdaptive&&null==e.spacing;let t=e.spacing||[32,32],i=B(e),o={cols:i.size[0]+1,rows:i.size[1]+1};const s=i.outofBoundPointCount>0&&i.outofBoundPointCount<i.offsets.length/2;let r=i.outofBoundPointCount===i.offsets.length/2||n&&s?[0,0]:h(i.offsets,o,t,4);const l=(r[0]+r[1])/2,c=e.projectedExtent.spatialReference,f=e.srcBufferExtent.spatialReference;if(n&&(s||l>4)&&(c.isGeographic||T(c),t=[4,4],i=B({...e,spacing:t}),o={cols:i.size[0]+1,rows:i.size[1]+1},r=h(i.offsets,o,t,4)),i.error=r,t[0]>1&&(i.coefficients=q(i.offsets,o,s)),e.includeGCSGrid&&!c.isGeographic&&!c.isWebMercator)if(f.isGeographic)i.gcsGrid={offsets:i.offsets,coefficients:i.coefficients,spacing:t};else{const n=T(c);if(null!=n&&!n.isEnvelope){const n=function(e){if(!e||e.isGeographic)return e;const n=String(e.wkid||e.wkt2||e.wkt);let t;return y.has(n)?t=y.get(n):(t=(e.wkid?a.P.coordsys(e.wkid):a.P.fromString(a.a.PE_TYPE_PROJCS,e.wkt2||e.wkt)).getGeogcs().getCode(),y.set(n,t)),new u.A({wkid:t})}(c),r=v(e.projectedExtent,n),{offsets:l}=B({...e,srcBufferExtent:r,spacing:t}),f=q(l,o,s);i.gcsGrid={offsets:l,coefficients:f,spacing:t}}}return i}function B(e){const{projectedExtent:n,srcBufferExtent:t,pixelSize:i,datumTransformation:o,rasterTransform:s}=e,r=n.spatialReference,a=t.spatialReference;m();const{xmin:c,ymin:f,xmax:u,ymax:x}=n,h=W(a),p=null!=h&&(e.hasWrapAround||"gcs-shift"===s?.type),g=e.spacing||[32,32],y=g[0]*i.x,w=g[1]*i.y,M=1===g[0],R=Math.ceil((u-c)/y-.1/g[0])+(M?0:1),P=Math.ceil((x-f)/w-.1/g[1])+(M?0:1),b=A({cols:R,rows:P,xmin:c,ymax:x,xres:y,yres:w,inSR:r,outSR:a,datumTransformation:o,preferPE:g[0]<=4,usePixelCenter:M}),k=[];let S,E=0;const N=M?-1:NaN,{xmin:C,xmax:_,ymax:v,width:L,height:O}=t,z=G(a,d),I=null!=h&&C>0&&_>h/2,j=T(r),F=null!=j&&j.poleLocation>0;for(let e=0;e<R;e++){const n=[];for(let t=0;t<P;t++){let i=b[e*P+t];if(p&&i[0]>_&&i[0]>h/2-z?i[0]-=h:p&&0===e&&i[0]<0&&I&&!s&&(i[0]+=h),!i||isNaN(i[0])||isNaN(i[1]))k.push(N),k.push(N),n.push(null),E++;else{if(s){const e=s.inverseTransform(new l.A({x:i[0],y:i[1],spatialReference:a}));i=[e.x,e.y]}n.push(i),e>0&&p&&S[t]&&i[0]<S[t][0]&&(i[0]+=h,F&&i[0]>_&&i[0]>h&&(i[0]-=h)),k.push((i[0]-C)/L),k.push((v-i[1])/O)}}S=n}return{offsets:k,error:null,coefficients:null,outofBoundPointCount:E,spacing:g,size:M?[R,P]:[R-1,P-1]}}function q(e,n,t){const{cols:i,rows:o}=n,s=new Float32Array((i-1)*(o-1)*2*6),r=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let n=0;n<i-1;n++){for(let t=0;t<o-1;t++){let l=n*o*2+2*t;const c=e[l],f=e[l+1],u=e[l+2],x=e[l+3];l+=2*o;const m=e[l],h=e[l+1],p=e[l+2],g=e[l+3];let y=0,d=12*(t*(i-1)+n);for(let e=0;e<3;e++)s[d++]=r[y++]*c+r[y++]*u+r[y++]*p;y=0;for(let e=0;e<3;e++)s[d++]=r[y++]*f+r[y++]*x+r[y++]*g;y=0;for(let e=0;e<3;e++)s[d++]=a[y++]*c+a[y++]*m+a[y++]*p;y=0;for(let e=0;e<3;e++)s[d++]=a[y++]*f+a[y++]*h+a[y++]*g}if(t)for(let e=0;e<s.length;e++)isNaN(s[e])&&(s[e]=-1)}return s}function J(e){const{spatialReference:n}=e,t=(0,x.Vp)(n);if(!t)return e;const[i,o]=t.valid,s=o-i;let a=0;if(e.xmin<i){const n=i-e.xmin;a=Math.ceil(n/s)}else if(e.xmin>o){const n=e.xmin-o;a=-Math.ceil(n/s)}return new r.A({spatialReference:e.spatialReference,xmin:e.xmin+a*s,ymin:e.ymin,xmax:e.xmax+a*s,ymax:e.ymax})}function X(e,n,t){const{storageInfo:i,pixelSize:o}=n;let r=0,a=!1;const{pyramidResolutions:c}=i,f="mixed"===i.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,i.tileInfo.dpi/96)):1,u=(e.x+e.y)/2/f;if(null!=c&&c.length){const e=c[c.length-1],i=(e.x+e.y)/2,f=(o.x+o.y)/2;if(u<=f)r=0;else if(u>=i)r=c.length,a=u/i>8;else{let e,n=f;for(let i=1;i<=c.length;i++){if(e=(c[i-1].x+c[i-1].y)/2,u<=e){u===e?r=i:"down"===t?(r=i-1,a=u/n>8):r="up"===t||u-n>e-u||u/n>2?i:i-1;break}n=e}}const x=0===r?o:c[r-1];return a&&Math.min(x.x,x.y)*(0,s.GA)(n.spatialReference)>19567&&(a=!1),{pyramidLevel:r,pyramidResolution:new l.A({x:x.x,y:x.y,spatialReference:n.spatialReference}),excessiveReading:a}}const x=Math.log(e.x/o.x)/Math.LN2,m=Math.log(e.y/o.y)/Math.LN2,h=n.storageInfo.maximumPyramidLevel||0;r="down"===t?Math.floor(Math.min(x,m)):"up"===t?Math.ceil(Math.max(x,m)):Math.round((x+m)/2),r<0?r=0:r>h&&(a=r>h+3,r=h);const p=2**r;return{pyramidLevel:r,pyramidResolution:new l.A({x:p*n.nativePixelSize.x,y:p*n.nativePixelSize.y,spatialReference:n.spatialReference}),excessiveReading:a}}}}]);