@arcgis/core 5.2.0-next.6 → 5.2.0-next.7

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 (346) hide show
  1. package/WebLinkChart.d.ts +1 -1
  2. package/WebMap.d.ts +2 -2
  3. package/WebScene.d.ts +3 -3
  4. package/arcade.d.ts +9 -9
  5. package/arcgisGlobal.d.ts +4 -0
  6. package/assets/esri/core/workers/RemoteClient.js +1 -1
  7. package/assets/esri/core/workers/chunks/03354ad3d74d858173b4.js +1 -0
  8. package/assets/esri/core/workers/chunks/{07a242ea908aa8e2ba28.js → 09a4139fc6d069ab6928.js} +1 -1
  9. package/assets/esri/core/workers/chunks/09d0e430c66788a2626f.js +640 -0
  10. package/assets/esri/core/workers/chunks/0a510acf50915e00c62b.js +1 -0
  11. package/assets/esri/core/workers/chunks/{829a0583b8a228c65379.js → 0b169bb1969f86232a1a.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{20e2d11f6de438ee883e.js → 0ded58ccb83f624f1460.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{d1ac98f48bb6d43d97c8.js → 0f3654c8157ec8f22869.js} +3 -3
  14. package/assets/esri/core/workers/chunks/19dcae83be0fc0aced02.js +1 -0
  15. package/assets/esri/core/workers/chunks/1eabe746481e0b228498.js +1 -0
  16. package/assets/esri/core/workers/chunks/{c27cb2a83a1d2e004501.js → 238478cfe493fd4a6100.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{bf706a5d065a357de51b.js → 2413b383b7f2bdcd4ced.js} +1 -1
  18. package/assets/esri/core/workers/chunks/277718031c903da2b3b9.js +1 -0
  19. package/assets/esri/core/workers/chunks/{7ed5b669010db58845f8.js → 294f2803aac000c99693.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{093f27e4e4781870b431.js → 297ae764445e6f73a5ea.js} +1 -1
  21. package/assets/esri/core/workers/chunks/2b36a54927f5a7281da3.js +1 -0
  22. package/assets/esri/core/workers/chunks/{be0eab592db0e651b023.js → 2b814bb51704a5b4fdc2.js} +6 -6
  23. package/assets/esri/core/workers/chunks/3172d7fc23787a287191.js +1 -0
  24. package/assets/esri/core/workers/chunks/{eedee0af459e6b8a6116.js → 33e0130e6a40fc768978.js} +1 -1
  25. package/assets/esri/core/workers/chunks/343ba5ea459e96ba79c6.js +1 -0
  26. package/assets/esri/core/workers/chunks/{a2159df718a7f2f59271.js → 38a2f34661563c7c29c1.js} +1 -1
  27. package/assets/esri/core/workers/chunks/3a5c1c501808352857bd.js +1 -0
  28. package/assets/esri/core/workers/chunks/{a96c7432ca97cbeef4b8.js → 3db898a38a7c5f0efb48.js} +1 -1
  29. package/assets/esri/core/workers/chunks/3fbb6ff940156a981983.js +1 -0
  30. package/assets/esri/core/workers/chunks/{24eaf1349ffe10e616e6.js → 40c4e14e7bb505ef10a3.js} +1 -1
  31. package/assets/esri/core/workers/chunks/4104fa1ede36bcee9be5.js +1 -0
  32. package/assets/esri/core/workers/chunks/{b002304a45856b024b46.js → 4714241189c13d0db897.js} +1 -1
  33. package/assets/esri/core/workers/chunks/485d20152495c27b8074.js +1 -0
  34. package/assets/esri/core/workers/chunks/{16b90d8f628a412ba4ba.js → 4894997bfa438f66da36.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{0e774f14ba274832f390.js → 520e0e5307eef27becc6.js} +1 -1
  36. package/assets/esri/core/workers/chunks/53d165b4f30fd64e5d8a.js +1 -0
  37. package/assets/esri/core/workers/chunks/{c83fea0d0ebd0d8e43fd.js → 542f5469f7b42026b24f.js} +1 -1
  38. package/assets/esri/core/workers/chunks/5553279998ae07b60f5f.js +1 -0
  39. package/assets/esri/core/workers/chunks/{cda99b543a0e1979346c.js → 5cb1b950249d651f3837.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{7601278ebced0c0c31cf.js → 5e3e0d7b85dfd52d1c7d.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{f5a2c28dc26c065ea355.js → 62dfbdc847be4800e833.js} +22 -20
  42. package/assets/esri/core/workers/chunks/{c216cd5d6b5d4fe4bab3.js → 62e77e3c5ca9b4887923.js} +2 -2
  43. package/assets/esri/core/workers/chunks/{cc479daacd2cf715baa8.js → 62fc3c367f736c73b0d7.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{b1f1271434af302938e8.js → 643c33a98f2d30a92001.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{1c1515e020e32e177b54.js → 6a5356ebed70e0f8f979.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{3402fb9c596b582311c7.js → 75839240022b280929f7.js} +1 -1
  47. package/assets/esri/core/workers/chunks/77a4f6f224d7ca4b69f4.js +1 -0
  48. package/assets/esri/core/workers/chunks/{6637f19b82555738a1d5.js → 78aa5bc6af2758da20d0.js} +1 -1
  49. package/assets/esri/core/workers/chunks/7df94cb985db41815fad.js +2 -0
  50. package/assets/esri/core/workers/chunks/{153dc2a0b08a0e44a881.js → 8419934bec7723b0feef.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{50dc9893e13396f5e35d.js → 875cce0be4f6c89f80f3.js} +2 -2
  52. package/assets/esri/core/workers/chunks/{c319c3b85cdec73a9f45.js → 877c848beaf9a939862c.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{ae74f722fb385e45fcf1.js → 893c0d28a5bf3f9f29f1.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{5abe34bb0110694f7b42.js → 90953a827bc89d0e6bd5.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{14c6419568d8a7a15cd6.js → 92ab5886aa2d8b9b179f.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{4e676e888a935c507d90.js → 93d4bda22bde33fafa57.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{fbb23db01f3cf629d32e.js → 992a90ecbab931198fd0.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{1765042635084f75d2b3.js → 9b676606bf839b7aa433.js} +1 -1
  59. package/assets/esri/core/workers/chunks/a261f4c22224511fdfff.js +1 -0
  60. package/assets/esri/core/workers/chunks/{ea8f642b1db933d2c26f.js → a2ac139d0975085279a6.js} +1 -1
  61. package/assets/esri/core/workers/chunks/a4d3cbc02dc1186a9a6d.js +1 -0
  62. package/assets/esri/core/workers/chunks/a8ec5b85c2fa6fb4f391.js +1 -0
  63. package/assets/esri/core/workers/chunks/{6af77529c977d034d287.js → b23009d9f8eb7c20ce45.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{1f55d60d3adc31283296.js → b79428c5093614174e76.js} +1 -1
  65. package/assets/esri/core/workers/chunks/b9bdb1f05e904c3655e4.js +1 -0
  66. package/assets/esri/core/workers/chunks/c4fc85281ca83af7abaf.js +1 -0
  67. package/assets/esri/core/workers/chunks/c983e5ce0ff952b65d7f.js +1 -0
  68. package/assets/esri/core/workers/chunks/{f79bd469b25099a31274.js → ca6907e14b1dde4d5c07.js} +1 -1
  69. package/assets/esri/core/workers/chunks/cbbd94c53e75efc99876.js +1 -0
  70. package/assets/esri/core/workers/chunks/{8f94c90fdb0333da2d0f.js → cfd28eba44cf5a296c6d.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{e9dcc3e9dbafe9bbed84.js → d21480b078ec9680d4c4.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{ace1899a8e5162b4018d.js → d6bb8db22ba85ad05fd7.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{8244b74e9c3a30d8d2f6.js → d9d4754062758789f186.js} +2 -2
  74. package/assets/esri/core/workers/chunks/{d35c475f004367e333eb.js → e094364e54981c91e1b4.js} +1 -1
  75. package/assets/esri/core/workers/chunks/e33d2ede6c9f1527d51b.js +1 -0
  76. package/assets/esri/core/workers/chunks/{3e3134e4bc34d4e07179.js → e545df5ea7c0ced92cee.js} +1 -1
  77. package/assets/esri/core/workers/chunks/{49f6c9e9980b8c624fd7.js → f02fe24177e56a7e42b2.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{d1ccc5f2d8892328ab01.js → f5731ad4cfbbf1cc569a.js} +2 -2
  79. package/assets/esri/themes/base/widgets/_DatePicker.scss +1 -1
  80. package/chunks/RealisticTree.glsl.js +17 -15
  81. package/config.d.ts +2 -2
  82. package/config.js +1 -1
  83. package/core/Collection.d.ts +25 -25
  84. package/core/Error.d.ts +1 -1
  85. package/core/JSONSupport.d.ts +1 -1
  86. package/core/promiseUtils.d.ts +3 -3
  87. package/core/reactiveUtils.d.ts +4 -4
  88. package/core/sql/WhereClause.d.ts +1 -1
  89. package/core/timeUtils.d.ts +1 -1
  90. package/core/workers/Connection.d.ts +9 -9
  91. package/core/workers.d.ts +1 -1
  92. package/editing/types.d.ts +3 -3
  93. package/geometry/Mesh.d.ts +9 -2
  94. package/geometry/Mesh.js +1 -1
  95. package/geometry/support/MeshMaterial.d.ts +5 -5
  96. package/geometry/support/MeshTexture.d.ts +19 -19
  97. package/geometry/support/jsonUtils.d.ts +1 -1
  98. package/geometry/support/meshUtils.d.ts +130 -2
  99. package/geometry/support/meshUtils.js +1 -1
  100. package/identity/Credential.d.ts +1 -1
  101. package/identity/IdentityManager.d.ts +1 -1
  102. package/identity/OAuthInfo.d.ts +1 -1
  103. package/identity/ServerInfo.d.ts +2 -2
  104. package/interfaces.d.ts +13 -0
  105. package/intl/number.d.ts +3 -3
  106. package/intl/substitute.d.ts +2 -2
  107. package/intl.d.ts +28 -28
  108. package/kernel.js +1 -1
  109. package/layers/AnnotationLayer.js +1 -1
  110. package/layers/BaseDynamicLayer.d.ts +5 -5
  111. package/layers/BaseTileLayer.d.ts +4 -4
  112. package/layers/BuildingSceneLayer.d.ts +1 -1
  113. package/layers/CSVLayer.d.ts +7 -1
  114. package/layers/CatalogLayer.d.ts +6 -0
  115. package/layers/DimensionFeatureLayer.js +1 -1
  116. package/layers/FeatureLayer.d.ts +44 -7
  117. package/layers/FeatureLayer.js +1 -1
  118. package/layers/GeoJSONLayer.d.ts +7 -1
  119. package/layers/LinkChartLayer.js +1 -1
  120. package/layers/MapImageLayer.d.ts +5 -5
  121. package/layers/MediaLayer.d.ts +2 -2
  122. package/layers/OrientedImageryLayer.d.ts +29 -2
  123. package/layers/ParquetLayer.d.ts +7 -1
  124. package/layers/SceneLayer.d.ts +1 -1
  125. package/layers/SceneLayer.js +1 -1
  126. package/layers/StreamLayer.d.ts +1 -1
  127. package/layers/SubtypeGroupLayer.d.ts +7 -1
  128. package/layers/TileLayer.d.ts +2 -2
  129. package/layers/VideoLayer.d.ts +1 -1
  130. package/layers/VoxelLayer.d.ts +4 -4
  131. package/layers/WCSLayer.d.ts +2 -2
  132. package/layers/WFSLayer.d.ts +6 -0
  133. package/layers/WebTileLayer.d.ts +1 -1
  134. package/layers/catalog/CatalogFootprintLayer.d.ts +20 -1
  135. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  136. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +6 -0
  137. package/layers/mixins/ArcGISImageService.d.ts +7 -1
  138. package/layers/mixins/BlendLayer.d.ts +1 -1
  139. package/layers/mixins/DataSeriesLayer.d.ts +161 -0
  140. package/layers/mixins/DataSeriesLayer.js +2 -0
  141. package/layers/mixins/FeatureLayerBase.d.ts +3 -3
  142. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  143. package/layers/support/DateTimeFieldFormat.d.ts +10 -10
  144. package/layers/support/FeatureEffect.d.ts +22 -22
  145. package/layers/support/FeatureReductionBinning.d.ts +12 -0
  146. package/layers/support/FeatureReductionCluster.d.ts +12 -0
  147. package/layers/support/Field.d.ts +2 -2
  148. package/layers/support/ImageElement.d.ts +1 -1
  149. package/layers/support/MosaicRule.d.ts +0 -2
  150. package/layers/support/NumberFieldFormat.d.ts +5 -5
  151. package/layers/support/StreamConnection.d.ts +1 -1
  152. package/layers/support/Sublayer.d.ts +2 -2
  153. package/layers/support/SubtypeSublayer.d.ts +14 -1
  154. package/layers/support/TimeSeriesFieldTimeMapping.d.ts +30 -0
  155. package/layers/support/TimeSeriesFieldTimeMapping.js +2 -0
  156. package/layers/support/TimeSeriesInfo.d.ts +149 -0
  157. package/layers/support/TimeSeriesInfo.js +2 -0
  158. package/layers/support/VideoElement.d.ts +1 -1
  159. package/layers/support/dataSeriesUtils.d.ts +18 -0
  160. package/layers/support/dataSeriesUtils.js +2 -0
  161. package/layers/support/kmlUtils.js +1 -1
  162. package/layers/support/timeSeriesUtils.d.ts +27 -0
  163. package/layers/support/timeSeriesUtils.js +2 -0
  164. package/layers/types.d.ts +1 -1
  165. package/linkChart/ChronologicalLayoutSettings.d.ts +1 -1
  166. package/networks/CircuitManager.d.ts +1 -1
  167. package/networks/Network.d.ts +1 -1
  168. package/networks/UnitIdentifierManager.d.ts +1 -1
  169. package/networks/support/NamedTraceConfiguration.d.ts +1 -1
  170. package/networks/support/TraceConfiguration.d.ts +2 -2
  171. package/networks/support/UNTraceConfiguration.d.ts +3 -3
  172. package/networks/support/jsonTypes.d.ts +7 -1
  173. package/networks/support/utils.js +1 -1
  174. package/package.json +3 -3
  175. package/popup/content/CustomContent.d.ts +1 -1
  176. package/portal/Portal.d.ts +2 -2
  177. package/portal/jsonTypes.d.ts +2 -2
  178. package/renderers/support/AuthoringInfo.d.ts +14 -1
  179. package/renderers/support/AuthoringInfo.js +1 -1
  180. package/renderers/support/AuthoringInfoVisualVariable.d.ts +14 -1
  181. package/renderers/support/AuthoringInfoVisualVariable.js +1 -1
  182. package/renderers/support/jsonUtils.d.ts +1 -1
  183. package/renderers/support/utils.d.ts +1 -1
  184. package/renderers/visualVariables/RotationVariable.d.ts +16 -1
  185. package/renderers/visualVariables/RotationVariable.js +1 -1
  186. package/request/types.d.ts +23 -23
  187. package/rest/geometryService.d.ts +1 -1
  188. package/rest/knowledgeGraph/CreateReplicaResponse.d.ts +1 -1
  189. package/rest/knowledgeGraph/GraphApplyEdits.d.ts +1 -1
  190. package/rest/knowledgeGraph/GraphProperty.d.ts +5 -1
  191. package/rest/knowledgeGraph/GraphQueryStreamingResult.d.ts +2 -2
  192. package/rest/knowledgeGraph/wasmInterface/wasmToDataModelFactories.js +1 -1
  193. package/rest/knowledgeGraph/wasmInterface/wasmToQueryResponseObjFactories.js +1 -1
  194. package/rest/knowledgeGraph/wasmInterface/wasmToReplicaFactories.js +1 -1
  195. package/rest/knowledgeGraphService.d.ts +13 -13
  196. package/rest/layerSources/DynamicDataLayer.d.ts +1 -1
  197. package/rest/print.d.ts +1 -1
  198. package/rest/support/AttributeBinsQuery.d.ts +16 -2
  199. package/rest/support/ClosestFacilityParameters.d.ts +6 -6
  200. package/rest/support/LastMileDeliveryParameters.d.ts +4 -4
  201. package/rest/support/LocationToAddressParameters.d.ts +1 -1
  202. package/rest/support/PrintTemplate.d.ts +5 -5
  203. package/rest/support/Query.d.ts +18 -4
  204. package/rest/support/RouteParameters.d.ts +5 -5
  205. package/rest/support/ServiceAreaParameters.d.ts +6 -6
  206. package/rest/support/TopFeaturesQuery.d.ts +16 -2
  207. package/rest/support/meshFeatureSet.js +1 -1
  208. package/smartMapping/renderers/color.d.ts +40 -0
  209. package/smartMapping/renderers/color.js +1 -1
  210. package/smartMapping/renderers/opacity.d.ts +8 -0
  211. package/smartMapping/renderers/opacity.js +1 -1
  212. package/smartMapping/renderers/size.d.ts +38 -0
  213. package/smartMapping/renderers/size.js +1 -1
  214. package/smartMapping/renderers/support/regenerateUtils.js +1 -1
  215. package/smartMapping/renderers/support/timeSeriesUtils.js +2 -0
  216. package/smartMapping/renderers/type.d.ts +20 -1
  217. package/smartMapping/renderers/type.js +1 -1
  218. package/smartMapping/renderers/univariateColorSize.d.ts +19 -0
  219. package/smartMapping/renderers/univariateColorSize.js +1 -1
  220. package/support/revision.js +1 -1
  221. package/support/tests/setupServiceMocksMesh.js +1 -1
  222. package/support/timeUtils.d.ts +3 -3
  223. package/symbols/Font.d.ts +7 -7
  224. package/symbols/WebStyleSymbol.d.ts +11 -11
  225. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  226. package/symbols/support/Symbol3DEmissive.d.ts +8 -2
  227. package/symbols/support/jsonUtils.d.ts +1 -1
  228. package/time/TimeExtent.d.ts +2 -2
  229. package/versionManagement/VersionManagementService.d.ts +8 -8
  230. package/versionManagement/VersionManager.d.ts +13 -3
  231. package/versionManagement/VersioningState.d.ts +4 -4
  232. package/views/2d/MapViewConstraints.d.ts +29 -25
  233. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  234. package/views/2d/engine/flow/styles/Particles.js +1 -1
  235. package/views/2d/engine/flow/styles/Streamlines.js +1 -1
  236. package/views/2d/engine/vectorTiles/VectorTileFeatureIndex.js +1 -1
  237. package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
  238. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  239. package/views/2d/layers/BaseLayerView2D.d.ts +4 -20
  240. package/views/2d/layers/BaseLayerViewGL2D.d.ts +6 -22
  241. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  242. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  243. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  244. package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
  245. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
  246. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementError.d.ts +1 -1
  247. package/views/3d/glTF/internal/resourceUtils.js +1 -1
  248. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  249. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  250. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  251. package/views/3d/webgl/RenderNode.d.ts +7 -7
  252. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  253. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  254. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  255. package/views/BreakpointsOwner.d.ts +1 -1
  256. package/views/DOMContainer.d.ts +6 -6
  257. package/views/Magnifier.d.ts +1 -1
  258. package/views/MapView.d.ts +1 -1
  259. package/views/SceneView.d.ts +2 -2
  260. package/views/View2D.d.ts +62 -54
  261. package/views/Viewport2DMixin.d.ts +1 -1
  262. package/views/analysis/ElevationProfile/ElevationProfileError.d.ts +1 -1
  263. package/views/input/gamepad/GamepadInputDevice.d.ts +1 -1
  264. package/views/input/types.d.ts +15 -15
  265. package/views/layers/FeatureLikeLayerView.d.ts +7 -4
  266. package/views/layers/GraphicsLayerView.d.ts +6 -3
  267. package/views/layers/ImageryLayerView.d.ts +4 -0
  268. package/views/navigation/Navigation.d.ts +1 -1
  269. package/views/support/WebAssemblyRequirements.js +1 -1
  270. package/views/types.d.ts +1 -1
  271. package/webscene/Glow.d.ts +0 -4
  272. package/widgets/BasemapGallery.d.ts +1 -1
  273. package/widgets/BasemapLayerList.d.ts +1 -1
  274. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  275. package/widgets/BatchAttributeForm.d.ts +1 -1
  276. package/widgets/BatchAttributeForm.js +1 -1
  277. package/widgets/Bookmarks.d.ts +1 -1
  278. package/widgets/BuildingExplorer.d.ts +1 -1
  279. package/widgets/CoordinateConversion/CoordinateConversionViewModel.d.ts +2 -2
  280. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  281. package/widgets/CoordinateConversion.d.ts +2 -2
  282. package/widgets/Daylight.d.ts +1 -1
  283. package/widgets/Directions.d.ts +1 -1
  284. package/widgets/Editor.d.ts +1 -1
  285. package/widgets/Feature.d.ts +1 -1
  286. package/widgets/FeatureForm.d.ts +1 -1
  287. package/widgets/FeatureTable/FieldColumn.d.ts +1 -14
  288. package/widgets/FeatureTable/Grid/Column.d.ts +1 -1
  289. package/widgets/FeatureTable/support/ColumnTemplateBase.d.ts +1 -1
  290. package/widgets/FeatureTemplates.d.ts +1 -1
  291. package/widgets/FloorFilter.d.ts +1 -1
  292. package/widgets/Fullscreen/FullscreenViewModel.d.ts +3 -3
  293. package/widgets/Fullscreen/FullscreenViewModel.js +1 -1
  294. package/widgets/Fullscreen.d.ts +3 -3
  295. package/widgets/LayerList/ListItemPanel.d.ts +5 -5
  296. package/widgets/Legend.d.ts +1 -1
  297. package/widgets/Locate/LocateViewModel.d.ts +2 -2
  298. package/widgets/Locate.d.ts +1 -1
  299. package/widgets/PanoramicViewer/utils.js +1 -1
  300. package/widgets/Popup.d.ts +1 -1
  301. package/widgets/Print/PrintViewModel.d.ts +2 -2
  302. package/widgets/Print/TemplateOptions.d.ts +4 -4
  303. package/widgets/Print.d.ts +6 -6
  304. package/widgets/Search/SearchViewModel.d.ts +5 -5
  305. package/widgets/Search.d.ts +4 -4
  306. package/widgets/ShadowCast.d.ts +1 -1
  307. package/widgets/Sketch/SketchViewModel.d.ts +1 -1
  308. package/widgets/Slice.d.ts +1 -1
  309. package/widgets/TableList/ListItemPanel.d.ts +5 -5
  310. package/widgets/Track/TrackViewModel.d.ts +3 -3
  311. package/widgets/Track.d.ts +3 -3
  312. package/widgets/UtilityNetworkTrace.d.ts +1 -1
  313. package/widgets/VersionManagement/VersionManagementViewModel.d.ts +2 -2
  314. package/widgets/Weather.d.ts +1 -1
  315. package/widgets/Widget.d.ts +1 -1
  316. package/widgets/support/forms/formUtils.js +1 -1
  317. package/widgets/support/types.d.ts +1 -1
  318. package/widgets/support/widget.d.ts +6 -6
  319. package/assets/esri/core/workers/chunks/1ddbf5f507ac153234be.js +0 -1
  320. package/assets/esri/core/workers/chunks/29615df388a0df022d8c.js +0 -1
  321. package/assets/esri/core/workers/chunks/2bd334f9ab89334df713.js +0 -1
  322. package/assets/esri/core/workers/chunks/319ff04282dc8ae38b56.js +0 -2
  323. package/assets/esri/core/workers/chunks/3a6678ee9990d7e83e15.js +0 -1
  324. package/assets/esri/core/workers/chunks/3b3986276e70297d573b.js +0 -1
  325. package/assets/esri/core/workers/chunks/46fbd519cc1a37923bfc.js +0 -1
  326. package/assets/esri/core/workers/chunks/4ef53455c8bc6efee80e.js +0 -1
  327. package/assets/esri/core/workers/chunks/51ee6102f5f4840a5b47.js +0 -1
  328. package/assets/esri/core/workers/chunks/58994b6bfcda5f2ada80.js +0 -1
  329. package/assets/esri/core/workers/chunks/6db274f6767102a39021.js +0 -1
  330. package/assets/esri/core/workers/chunks/77769663cd712822d33e.js +0 -1
  331. package/assets/esri/core/workers/chunks/8c5a41ae68775bac3446.js +0 -1
  332. package/assets/esri/core/workers/chunks/b08a1255dacf6cfcf139.js +0 -640
  333. package/assets/esri/core/workers/chunks/b098469e0010a6b44df9.js +0 -1
  334. package/assets/esri/core/workers/chunks/ca1b0cb14ea9ae1bf2a3.js +0 -1
  335. package/assets/esri/core/workers/chunks/ca4245414d8ecd217f9d.js +0 -1
  336. package/assets/esri/core/workers/chunks/d3af51a6d9014ff46170.js +0 -1
  337. package/assets/esri/core/workers/chunks/d561dc933d8fe1672d85.js +0 -1
  338. package/assets/esri/core/workers/chunks/e38836bfcc7a15a2fd1f.js +0 -1
  339. package/assets/esri/core/workers/chunks/e645f992ec6f935ee3a5.js +0 -1
  340. package/assets/esri/core/workers/chunks/eabd4a78221b7e733793.js +0 -1
  341. package/assets/esri/core/workers/chunks/f05932aea4eb267cba4d.js +0 -1
  342. /package/assets/esri/core/workers/chunks/{50dc9893e13396f5e35d.js.LICENSE.txt → 62e77e3c5ca9b4887923.js.LICENSE.txt} +0 -0
  343. /package/assets/esri/core/workers/chunks/{319ff04282dc8ae38b56.js.LICENSE.txt → 7df94cb985db41815fad.js.LICENSE.txt} +0 -0
  344. /package/assets/esri/core/workers/chunks/{c216cd5d6b5d4fe4bab3.js.LICENSE.txt → 875cce0be4f6c89f80f3.js.LICENSE.txt} +0 -0
  345. /package/assets/esri/core/workers/chunks/{8244b74e9c3a30d8d2f6.js.LICENSE.txt → d9d4754062758789f186.js.LICENSE.txt} +0 -0
  346. /package/assets/esri/core/workers/chunks/{d1ccc5f2d8892328ab01.js.LICENSE.txt → f5731ad4cfbbf1cc569a.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3309],{93309(e,t,i){i.r(t),i.d(t,{default:()=>W});var a=i(5482),n=i(79842),o=i(7762),s=i(51447),r=i(49186),l=i(53966),h=i(91869),d=i(25728),p=i(17676),u=i(36708),g=i(91429),y=i(35666),c=i(5443),m=i(86738),f=i(82799),L=i(12359),C=i(4146),M=i(90708),w=i(15375);const b={MULTIPLIER:"multiplier",ABSOLUTE:"absolute-value"};var k=i(24137),T=i(62796),v=i(40736),E=i(69860),N=i(99916),D=i(63074),S=i(34287),x=i(25036),I=i(10873),A=i(8460),_=i(69540),R=i(25482),Z=i(56507),B=i(69647),z=i(93223);let O=class extends((0,_.OU)(R.o)){constructor(e){super(e),this.durationLineWidth=5,this.entityPositionAtDurationRatio=1,this.eventsTicksVisualization="start-and-end",this.lineSeparationMultiplier=1,this.moveFirstBends=!0,this.secondBendRatio=.3,this.separateTimeOverlaps=!0,this.separateTimelineOverlaps=!0,this.separatedLineShapeRatio=0,this.showDurationLineForNonZeroDurationEntityEvents=!1,this.showNonZeroDurationIntervalBounds=!1,this.spaceSeparatedLinesEvenly=!1,this.timeBannerUTCOffsetInMinutes=0,this.timeDirection="right",this.useBezierCurves=!1}};(0,a.Cg)([(0,g.MZ)({type:Z.jz,range:{min:1,max:10},json:{write:!0}})],O.prototype,"durationLineWidth",void 0),(0,a.Cg)([(0,g.MZ)({type:Number,range:{min:0,max:1},json:{write:!0}})],O.prototype,"entityPositionAtDurationRatio",void 0),(0,a.Cg)([(0,z.e)(B.SJ)],O.prototype,"eventsTicksVisualization",void 0),(0,a.Cg)([(0,g.MZ)({type:Number,range:{min:0},json:{write:!0}})],O.prototype,"lineSeparationMultiplier",void 0),(0,a.Cg)([(0,g.MZ)({type:Boolean,json:{write:!0}})],O.prototype,"moveFirstBends",void 0),(0,a.Cg)([(0,g.MZ)({type:Number,range:{min:0,max:1},json:{write:!0}})],O.prototype,"secondBendRatio",void 0),(0,a.Cg)([(0,g.MZ)({type:Boolean,json:{write:!0}})],O.prototype,"separateTimeOverlaps",void 0),(0,a.Cg)([(0,g.MZ)({type:Boolean,json:{write:!0}})],O.prototype,"separateTimelineOverlaps",void 0),(0,a.Cg)([(0,g.MZ)({type:Number,range:{min:0,max:1},json:{write:!0}})],O.prototype,"separatedLineShapeRatio",void 0),(0,a.Cg)([(0,g.MZ)({type:Boolean,json:{write:!0}})],O.prototype,"showDurationLineForNonZeroDurationEntityEvents",void 0),(0,a.Cg)([(0,g.MZ)({type:Boolean,json:{write:!0}})],O.prototype,"showNonZeroDurationIntervalBounds",void 0),(0,a.Cg)([(0,g.MZ)({type:Boolean,json:{write:!0}})],O.prototype,"spaceSeparatedLinesEvenly",void 0),(0,a.Cg)([(0,g.MZ)({type:Z.jz,json:{write:!0}})],O.prototype,"timeBannerUTCOffsetInMinutes",void 0),(0,a.Cg)([(0,g.MZ)({type:["bottom","left","right","top"],json:{write:!0}})],O.prototype,"timeDirection",void 0),(0,a.Cg)([(0,g.MZ)({type:Boolean,json:{write:!0}})],O.prototype,"useBezierCurves",void 0),O=(0,a.Cg)([(0,g.$K)("esri.linkChart.ChronologicalLayoutSettings")],O);const P=O;let U=class extends((0,_.OU)(R.o)){constructor(e){super(e),this.absoluteIdealEdgeLength=1,this.autoRepulsionRadius=!0,this.computationBudgetTime=2,this.idealEdgeLengthType="multiplier",this.multiplicativeIdealEdgeLength=1,this.repulsionRadiusMultiplier=1}};(0,a.Cg)([(0,g.MZ)({type:Number,range:{min:0,max:360},json:{write:!0}})],U.prototype,"absoluteIdealEdgeLength",void 0),(0,a.Cg)([(0,g.MZ)({type:Boolean,json:{write:!0}})],U.prototype,"autoRepulsionRadius",void 0),(0,a.Cg)([(0,g.MZ)({type:Number,json:{write:!1}})],U.prototype,"computationBudgetTime",void 0),(0,a.Cg)([(0,z.e)(B.lg)],U.prototype,"idealEdgeLengthType",void 0),(0,a.Cg)([(0,g.MZ)({type:Number,range:{min:0,max:5},json:{write:!0}})],U.prototype,"multiplicativeIdealEdgeLength",void 0),(0,a.Cg)([(0,g.MZ)({type:Number,range:{min:1,max:99},json:{write:!0}})],U.prototype,"repulsionRadiusMultiplier",void 0),U=(0,a.Cg)([(0,g.$K)("esri.linkChart.OrganicLayoutSettings")],U);const j=U;let F=class extends((0,_.OU)(R.o)){constructor(e){super(e),this.rootEntities=[]}};(0,a.Cg)([(0,g.MZ)({type:[Object],json:{write:!0}})],F.prototype,"rootEntities",void 0),F=(0,a.Cg)([(0,g.$K)("esri.linkChart.RootedLayoutSettings")],F);let G=class extends((0,_.OU)(R.o)){constructor(e){super(e),this.chronologicalLayoutSettings=null,this.organicLayoutSettings=null,this.rootedLayoutSettings=null}};(0,a.Cg)([(0,g.MZ)({type:P,json:{write:!0}})],G.prototype,"chronologicalLayoutSettings",void 0),(0,a.Cg)([(0,g.MZ)({type:j,json:{write:!0}})],G.prototype,"organicLayoutSettings",void 0),(0,a.Cg)([(0,g.MZ)({type:F,json:{write:!0}})],G.prototype,"rootedLayoutSettings",void 0),G=(0,a.Cg)([(0,g.$K)("esri.linkChart.LayoutSettings")],G);var H=i(54628),$=i(53902),K=i(56400);let Q=class extends((0,S.q)((0,D.dM)((0,x.j)((0,d.M)(C.A))))){constructor(e){if(super(e),this.url=null,this.dataPreloadedInLocalCache=!1,this.initializationLinkChartConfig=null,this.membershipModified=!0,this._currentLinkChartConfig={layoutMode:"organic-standard"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(o.A.ofType(T.A)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new c.A({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="LinkChartLayer",this.sublayerIdsCache=new Map,this.tables=new(o.A.ofType(T.A)),this.type="link-chart",this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1,this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.initializationInclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.initializationInclusionModeDefinition)throw new r.A("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");this.addHandles((0,u.wB)(()=>this.layers.concat(this.tables),(e,t)=>this._handleSublayersChange(e,t),u.OH))}normalizeCtorArgs(e){if(!e)return{};const{url:t,dataPreloadedInLocalCache:i,initializationLinkChartConfig:a}=e;let{title:n}=e;return!n&&e?.url&&(n=(0,v.$L)(e.url)),{url:t,title:n,dataPreloadedInLocalCache:i,initializationLinkChartConfig:a}}_initializeLayerProperties(e){const t=new Set;let i=[],a=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new r.A("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.inclusionModeDefinition?.generateAllSublayers?(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach((n,o)=>{const s=this._graphTypeLookup.get(o);if(!s)return l.A.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(o);"relationship"===s.type?t.has(o)||(t.add(o),a.push(s)):"entity"===s.type?t.has(o)||(t.add(o),i.push(s)):(l.A.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(o))}):(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]);const n=new k.P({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=i,this.memberRelationshipTypes=a,this.dataManager=n}load(e){const t=async()=>{const e=[],t=[];this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await(0,v.qN)(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(e=>{e.useAllData=!1}),await this._initializeDiagram(),this.layers.forEach(i=>{t.push(i.refreshCachedQueryEngine()),e.push(new Promise(e=>{i.on("layerview-create",()=>{e(null)})}))}),this.tables.forEach(e=>{t.push(e.refreshCachedQueryEngine())}),await Promise.all(t)};return this.addResolvingPromise(new Promise(i=>{(0,$.fetchKnowledgeGraph)(this.url).then(async a=>{a.dataModel.entityTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)}),a.dataModel.relationshipTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)});const o=this.linkChart?.linkChartProperties;6===o?.originIdOf("entitiesUrl")&&(this.membershipModified=!1,(0,H.lV)([o.entitiesUrl??"",o.relationshipsUrl??""],this.linkChart?.portalItem?.itemUrl??"").then(e=>{this.linkChart?.linkChartProperties.setCreationDatesForResources(e)}),this._originalInclusionList=await n.XW.fetchAndConvertSerializedLinkChart({entitiesUrl:o?.entitiesUrl,relationshipsUrl:o?.relationshipsUrl},{signal:e?.signal}),this._alignLayersDataModelAndInclusionDefinition(a.dataModel),this.initializationLinkChartConfig={layoutSettings:o?.layoutSettings??void 0,layoutMode:(0,N.k5)(o.layoutType)}),this._initializeLayerProperties({knowledgeGraph:a,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach(e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}));const{edit:s,fullEdit:r,updateItem:l}=await(0,v.N1)(a.serviceDefinition.serviceItemId,this.url,e);if(this._set("userHasEditingPrivileges",s),this._set("userHasFullEditingPrivileges",r),this._set("userHasUpdateItemPrivileges",l),this.read({dateFieldsTimeReference:a.serviceDefinition.dateFieldsTimeReference},{origin:"service"}),this.dataPreloadedInLocalCache){const e=E.A.getInstance();for(const[t,i]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions??[])for(const a of i.members?.values()??[]){const i=e.readFromStoreById(`${t}__${a.id}`);i&&(0,h.tE)(this.dataManager.sublayerCaches,t,()=>new Map).set(a.id,i)}await t()}else{const i="geographic-organic-standard"===this.initializationLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,i,!0).then(async()=>{(0,p.Te)(e),await t()}))}i(null)})})),Promise.resolve(this)}set initializationInclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("initializationInclusionModeDefinition",e):l.A.getLogger(this).error("#initializationInclusionModeDefinition","initializationInclusionModeDefinition cannot be changed after the layer is loaded.")}get linkChart(){return this.parent}get sublayerCapabilities(){return(0,v.hZ)(this.knowledgeGraph)}async addRecords(e,t){let i=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(i=await(0,N.aq)(e,this.dataManager.knowledgeGraph));const a=e.concat(i).filter(e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id));a.length>0&&(this.membershipModified=!0),await this._handleNewRecords(a,t)}async createSublayerForNamedType(e){await this.load();const t=this._graphTypeLookup.get(e);if(!t)throw new r.A("knowledge-graph:missing-type","The specified type does not exist in the knowledge graph.");if(this.dataManager.sublayerCaches.has(e))throw new r.A("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),(0,h.tE)(this.sublayerIdsCache,e,()=>new Set);const i=this._createSublayer(t);return"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.set(e,{useAllData:!1,members:new Map}),i.geometryType?this.layers.push(i):this.tables.push(i),await(0,v.qN)(this,[e]),this._refreshNamedTypes(),i}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:i=!1,overrideMembershipCheck:a=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1,overrideMembershipCheck:!1}){let n=[];for(const t of e)(a||!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.members?.has(t.id))&&n.push(t);if(t){const e=new Set,t=[];for(const t of n)if(this.dataManager.nodeConnectionsLookup.has(t.id))for(const i of this.dataManager.nodeConnectionsLookup.get(t.id))e.add(i);for(const i of e)if(this.dataManager.memberIdTypeLookup.has(i))for(const e of this.dataManager.memberIdTypeLookup.get(i))this.dataManager.relationshipTypeNames.has(e)&&t.push({id:i,typeName:e});n=n.concat(t)}const o=this._currentLinkChartConfig.layoutSettings?.rootedLayoutSettings?.rootEntities;if(o?.length){const e=new Set(n.map(({id:e})=>e)),t=o.filter(({id:t})=>!e.has(t));if(t.length!==o.length){this._currentLinkChartConfig.layoutSettings.rootedLayoutSettings.rootEntities=t;const e=this.linkChart?.linkChartProperties;e?.layoutSettings?.rootedLayoutSettings&&(e.layoutSettings.rootedLayoutSettings.rootEntities=t)}}this.dataManager.removeFromLayer(n);for(const e of n)this.sublayerIdsCache.get(e.typeName)?.delete(e.id),this.dataManager.relationshipTypeNames.has(e.typeName)?this.relationshipLinkChartDiagramLookup.delete(e.id):this.entityLinkChartDiagramLookup.delete(e.id);const s=i?void 0:this.getCurrentNodeLocations();await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,{layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedEntityLocations:s}),n.length>0&&(this.membershipModified=!0);const r=[];return this.layers.forEach(e=>{r.push(e.refreshCachedQueryEngine())}),await Promise.all(r),this._refreshNamedTypes(),n}async expand(e,t){let i=[];try{const a=await this.dataManager.getConnectedRecordIds(e,t?.relationshipTypeNames,t);i=a.filter(e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)),await this._handleNewRecords(i,t),a.length>0&&(this.membershipModified=!0),(0,p.Te)(t?.signal)}catch(e){throw(0,p.zf)(e)&&i.length>0&&await this.removeRecords(i,{overrideMembershipCheck:!0}),e}return{records:i}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];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 o.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 o.A,this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{const i=(0,h.tE)(this.sublayerIdsCache,t,()=>new Set);e.members?.forEach(({id:e,linkChartLocation:a})=>{if(i.add(e),a){const i="coords"in a&&"lengths"in a?a:(0,M.Ux)(a);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(e,i):this.entityLinkChartDiagramLookup.set(e,i)}})})}async calculateLinkChartLayout(e="organic-standard",t){const i=[],a=[],n=[];this.dataManager.sublayerCaches.forEach((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach(e=>{i.push({typeName:t,feature:e})}):this.dataManager.relationshipTypeNames.has(t)&&e.forEach(e=>{a.push({typeName:t,feature:e})})}),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const o=new Map,s=new Map,d=new Map,u=new Map,g=new Uint8Array(i.length),y=new Float64Array(i.length),C=new Float64Array(i.length),b=new Float64Array(i.length),k=new Float64Array(i.length),T=new Uint32Array(a.length),v=new Uint32Array(a.length),E=new Float64Array(a.length),N=new Float64Array(a.length),D=[];let S=!1;const x=new c.A({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let I,_="organic-standard",R=0,Z=0;const B=A.i6.apply;switch(_="geographic-organic-standard"===e?"organic-standard":e,_){case"organic-standard":I=A.pM.apply;break;case"organic-community":I=A.Tu.apply;break;case"hierarchical-bottom-to-top":I=A.$C.apply;break;case"radial-root-centric":I=A.vJ.apply;break;case"tree-left-to-right":I=A.Xq.apply;break;default:I=A.Wg.apply}let z=!1;const O=new Set(t?.layoutSettings?.rootedLayoutSettings?.rootEntities?.map(({id:e})=>e));i.forEach(({typeName:i,feature:a})=>{if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e&&t?.lockedEntityLocations?.has(a.attributes[w.dr])){"geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(i)?g[R]=2:g[R]=0;const n=t.lockedEntityLocations.get(a.attributes[w.dr]);y[R]=n.x,C[R]=n.y}else if("geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(i)){g[R]=2;let e=null;const t=a.attributes[this.dataManager.geographicLookup.get(i).name],n=this.dataManager.geographicLookup.get(i)?.geometryType;switch(n){case"esriGeometryPoint":y[R]=t?.x,C[R]=t?.y;break;case"esriGeometryPolygon":{const i=t?(0,L.Ve)(t):null;e=i?m.A.fromJSON(i):null,null!=e?.x&&null!=e?.y?(y[R]=e.x,C[R]=e.y):g[R]=1;break}case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(y[R]=e.x,C[R]=e.y):g[R]=1;break;default:g[R]=1}(null==y[R]||null==C[R]||Number.isNaN(y[R])||Number.isNaN(C[R]))&&(g[R]=1,y[R]=0,C[R]=0)}else if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){!z&&t?.lockedEntityLocations?.has(a.attributes[w.dr])&&(z=!0);const e=t?.timeInfoByTypeName?.get(i),n=e?.startField,o=n&&e?.startField?a.attributes[n]:null;b[R]=o?new Date(o).getTime():NaN;const s=e?.endField,r=s&&e?.endField?a.attributes[s]:null;k[R]=r?new Date(r).getTime():NaN,y[R]=0,C[R]=0,g[R]=1}else g[R]=1,y[R]=0,C[R]=0;O.has(a.attributes[w.dr])&&(g[R]|=4),u.set(a.attributes[w.dr],R),D[R]={feature:a,typeName:i},R++}),z&&l.A.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let P=!1;const U=new Map;a.forEach(i=>{const a=i.feature.attributes[w.Cz],o=i.feature.attributes[w.KQ],s=u.get(a),r=u.get(o),l=t?.timeInfoByTypeName?.get(i.typeName),h=t?.timeInfoByTypeName?l?.startField:null,d=h?i.feature.attributes[h]:null,p=l?.endField,g=p?i.feature.attributes[p]:null;if(void 0!==s&&void 0!==r){let t=a+"-"+o;"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(t=t+"-"+d+"-"+g);const l=U.get(t),h=l?.has(i.typeName);h||(T[Z]=s,v[Z]=r,"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(E[Z]=d?new Date(d).getTime():NaN,N[Z]=g?new Date(g).getTime():NaN),void 0===l?U.set(t,new Map([[i.typeName,Z]])):l.set(i.typeName,Z),Z++),n.push(i)}else P=!0,this.relationshipLinkChartDiagramLookup.set(a,null)}),P&&l.A.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const j=this._validateOrganicLayoutSettings(e,t?.layoutSettings?.organicLayoutSettings),F=this._convertValidatedOrganicSettingsToCalculationSettings(j);await(0,A.Hh)();let G=1,H=null;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){let i;({status:G,links:H,graphics:i}=B(()=>t?.signal?.aborted??!1,g,y,C,b,k,T.subarray(0,Z),v.subarray(0,Z),E.subarray(0,Z),N.subarray(0,Z),"chronological-multi-timeline"===e,t?.layoutSettings?.chronologicalLayoutSettings)),0===G&&(this.chronologicalAuxiliaryGraphics=i)}else({status:G,links:H}=I(()=>t?.signal?.aborted??!1,g,y,C,T.subarray(0,Z),v.subarray(0,Z),F.computationBudgetTime,F.idealEdgeLengthMultiplier,F.repulsionRadiusMultiplier));if((0,p.Te)(t?.signal),1===G)throw new r.A("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");if(2===G)throw(0,p.NK)();for(let e=0;e<D.length;e++){if(C[e]>84.9999?C[e]=84.9999:C[e]<-84.9999&&(C[e]=-84.9999),y[e]>179.9999?y[e]=179.9999:y[e]<-179.9999&&(y[e]=-179.9999),D[e].feature.attributes[w.T1]=new m.A(y[e],C[e]),o.has(D[e].typeName)){const t=o.get(D[e].typeName);t?.set(D[e].feature.attributes[w.dr],D[e].feature)}else{const t=new Map;t.set(D[e].feature.attributes[w.dr],D[e].feature),o.set(D[e].typeName,t)}d.set(D[e].feature.attributes[w.dr],D[e].feature);const t=(0,M.Ux)(D[e].feature.attributes[w.T1]);this.entityLinkChartDiagramLookup.set(D[e].feature.attributes[w.dr],D[e].feature.attributes[w.T1]?t:null);const i=(0,h.tE)(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,D[e].typeName,()=>({useAllData:!1,members:new Map}));(0,h.tE)(i.members,D[e].feature.attributes[w.dr],()=>({id:D[e].feature.attributes[w.dr],linkChartLocation:void 0})).linkChartLocation=D[e].feature.attributes[w.T1];const{x:a,y:n}=D[e].feature.attributes[w.T1];if(S)x.xmin=Math.min(x.xmin,a),x.xmax=Math.max(x.xmax,a),x.ymin=Math.min(x.ymin,n),x.ymax=Math.max(x.ymax,n);else{const e=1e-7;x.xmin=a-e,x.xmax=a+e,x.ymin=n-e,x.ymax=n+e,S=!0}}if(this.linkChartExtent.xmin=x.xmin,this.linkChartExtent.xmax=x.xmax,this.linkChartExtent.ymin=x.ymin,this.linkChartExtent.ymax=x.ymax,!H)throw new r.A("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const $=new Map,K=new Map,Q=new Map,W=new Set;for(let i=0;i<n.length;i++){const a=[],o=n[i],r=o.feature.attributes[w.Cz],p=o.feature.attributes[w.KQ];let g=r+"-"+p;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){const e=t?.timeInfoByTypeName?.get(o.typeName),i=t?.timeInfoByTypeName?e?.startField:null,a=i?o.feature.attributes[i]:null,n=e?.endField;g+="-"+a+"-"+(n?o.feature.attributes[n]:null)}const y=U.get(g).get(o.typeName),c=0===y?0:H?.vertexEndIndex[y-1];if(!W.has(y)){if(W.add(y),2===H.types[y]){const e=[H.vertices[2*c],H.vertices[2*c+1]],t=[H.vertices[2*(c+1)],H.vertices[2*(c+1)+1]],i=[.5*(e[0]+t[0]),.5*(e[1]+t[1])],n=[i[0]-e[0],i[1]-e[1]],o=[i[0]+n[1],i[1]-n[0]],s=[i[0]-n[1],i[1]+n[0]];a.push(e),a.push(o),a.push(t),a.push(s),a.push(e)}else{if(0!==H.types[y]){l.A.getLogger(this).warn("A relationship generated an unsupported link geometry type. It will not be rendered");continue}for(let e=c;e<H.vertexEndIndex[y];e++)a.push([H.vertices[2*e],H.vertices[2*e+1]])}if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e){const e=D[u.get(r)]?.feature.attributes[w.T1],t=D[u.get(p)]?.feature.attributes[w.T1];a[0][0]===e.x&&a[0][1]===e.y||(a[0]=[e.x,e.y]),a[a.length-1][0]===t.x&&a[a.length-1][1]===t.y||(a[a.length-1]=[t.x,t.y])}for(let e=1;e<a.length-1;e++)a[e][1]>85.5?a[e][1]=85.5:a[e][1]<-85.5&&(a[e][1]=-85.5),a[e][0]>179.9999?a[e][0]=179.9999:a[e][0]<-179.9999&&(a[e][0]=-179.9999);$.has(g)?$.get(g).push(a):$.set(g,[a])}const m=$.get(g);K.has(g)||(K.set(g,new Map),Q.set(g,new Map));const L=K.get(g),C=Q.get(g);L.has(o.typeName)||(L.set(o.typeName,m.shift()),C.set(o.typeName,0));const b=L.get(o.typeName);C.set(o.typeName,C.get(o.typeName)+1);const k=new f.A({paths:[b]});if(o.feature.attributes[w.T1]=k,s.has(o.typeName)){const e=s.get(o.typeName);e?.set(o.feature.attributes[w.dr],o.feature)}else{const e=new Map;e.set(o.feature.attributes[w.dr],o.feature),s.set(o.typeName,e)}d.set(o.feature.attributes[w.dr],o.feature);const T=(0,M.Ux)(o.feature.attributes[w.T1]);this.relationshipLinkChartDiagramLookup.set(o.feature.attributes[w.dr],o.feature.attributes[w.T1]?T:null);const v=(0,h.tE)(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,o.typeName,()=>({useAllData:!1,members:new Map}));(0,h.tE)(v.members,o.feature.attributes[w.dr],()=>({id:o.feature.attributes[w.dr],linkChartLocation:void 0})).linkChartLocation=T}for(const e of n)e.feature.attributes[w.M1]=Q.get(e.feature.attributes[w.Cz]+"-"+e.feature.attributes[w.KQ])?.get(e.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutSettings:t?.layoutSettings?.clone()},{nodes:o,links:s,idMap:d}}async applyNewLinkChartLayout(e="organic-standard",t){let{lockedNodeLocations:i,lockedEntityLocations:a,rootEntityIds:n,...o}=t??{};!a&&i?((0,s.io)(l.A.getLogger(this),"lockedNodeLocations is deprecated in 5.0. Use lockedEntityLocations instead.",{replacement:"Use lockedEntityLocations instead.",version:"5.0"}),a=i):a&&i&&(0,s.io)(l.A.getLogger(this),"Both lockedNodeLocations (deprecated in 5.0) and lockedEntityLocations are defined. Use lockedEntityLocations only instead.",{replacement:"Use lockedEntityLocations instead.",version:"5.0"});const r=o.layoutSettings?.rootedLayoutSettings?.rootEntities;if(!r&&n){(0,s.io)(l.A.getLogger(this),"rootEntityIds is deprecated in 5.1. Use layoutSettings.rootedLayoutSettings.rootEntities instead.",{replacement:"Use layoutSettings.rootedLayoutSettings.rootEntities instead.",version:"5.1"});const e=[];for(const t of n){const i=this.dataManager.memberIdTypeLookup.get(t),a=Array.from(i??[]).find(e=>this.dataManager.entityTypeNames.has(e));a&&e.push({id:t,typeName:a})}o.layoutSettings=o.layoutSettings??new G,o.layoutSettings.rootedLayoutSettings=o.layoutSettings.rootedLayoutSettings??new F,o.layoutSettings.rootedLayoutSettings.rootEntities=e}else r&&n&&(0,s.io)(l.A.getLogger(this),"Both rootEntityIds (deprecated in 5.1) and layoutSettings.rootedLayoutSettings.rootEntities are defined. Use layoutSettings.rootedLayoutSettings.rootEntities only instead.",{replacement:"Use layoutSettings.rootedLayoutSettings.rootEntities instead.",version:"5.1"});const h=[];await this._calculateLayoutWithSublayerTimeInfo(e,{...o,lockedEntityLocations:a}),this.layers.forEach(e=>{h.push(e.refreshCachedQueryEngine())}),this.membershipModified=!0,await Promise.all(h),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;for(const[t,i]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.entries()??[])this.dataManager.relationshipTypeNames.has(t)||i?.members?.forEach(t=>{const i=t.linkChartLocation;let a;const n=t.id;i&&(a="x"in i?{x:i.x,y:i.y}:{x:i.coords[0],y:i.coords[1]},e.set(n,new m.A({x:a.x,y:a.y})))});return e}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach(e=>{t.push(e.refreshCachedQueryEngine())}),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e,t){if(!e.length)return{records:[]};let i=[];try{let a=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(a=a.concat(Array.from(t.keys())))}i=await this.dataManager.getRelationshipsBetweenNodes(e,a,t),await this._handleNewRecords(i,t),(0,p.Te)(t)}catch(e){throw(0,p.zf)(e)&&this.removeRecords(i),e}return{records:i}}async connectFromEntities(e,t){if(!e.length)return{records:[]};let i=[];try{let a=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(a=a.concat(Array.from(t.keys())))}let n=[];for(const e of this.dataManager.entityTypeNames){const t=this.sublayerIdsCache.get(e);t&&(n=n.concat(Array.from(t)))}i=await this.dataManager.getRelationshipsFromNodes(e,n,a,t),await this._handleNewRecords(i,t),i.length>0&&(this.membershipModified=!0),(0,p.Te)(t)}catch(e){throw(0,p.zf)(e)&&this.removeRecords(i),e}return{records:i}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="organic-standard",t){const i=new Map;this.layers.forEach(e=>{i.set(e.objectType.name,e.timeInfo)}),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:i,...t}),this.linkChart?.handleChronologicalOverlay()}async _handleNewRecords(e,t){const i=new Set,a=[],n=this.layers.concat(this.tables);for(const t of e)this._graphTypeLookup.has(t.typeName)&&(!1===n.some(e=>e.objectType.name===t.typeName)&&(this.dataManager.sublayerCaches.set(t.typeName,new Map),i.add(t.typeName)),(0,h.tE)(this.sublayerIdsCache,t.typeName,()=>new Set).add(t.id),a.push(t));this.dataManager.addToLayer(a);for(const e of i){const t=this._graphTypeLookup.get(e);if(t){const i=this._createSublayer(t);"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),i.geometryType?this.layers.push(i):this.tables.push(i)}}await(0,v.qN)(this,Array.from(i),t),await this.dataManager.refreshCacheContent(e.map(e=>e.id),void 0,void 0,void 0,t);const o={layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedEntityLocations:new Map};for(const[e,t]of this.entityLinkChartDiagramLookup.entries())t&&o.lockedEntityLocations.set(e,new m.A(t.coords[0],t.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,o)}_createSublayers(e,t,i){e.forEach(e=>{const a=this._createSublayer(e);i(a)&&t.push(a),this._updateSublayerCaches(e)})}_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,t.read({title:i.name},{origin:"service"}),this._updateSublayerCaches(i))})}_updateSublayerCaches({name:e}){if(!e)return;const t=this.dataManager.sublayerCaches;t.has(e)||t.set(e,new Map)}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=3&&e<7}async _initializeDiagram(){this.initializationLinkChartConfig?this.initializationLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e?.members?.forEach(e=>{const i=e.linkChartLocation;let a;const n=e.id;if(!i)return;a="x"in i?{x:i.x,y:i.y}:{x:i.coords[0],y:i.coords[1]};const o=(0,M.Ux)(a);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(n,o):this.entityLinkChartDiagramLookup.set(n,o),this.linkChartExtent.xmin>a.x&&(this.linkChartExtent.xmin=a.x),this.linkChartExtent.xmax<a.x&&(this.linkChartExtent.xmax=a.x),this.linkChartExtent.ymin>a.y&&(this.linkChartExtent.ymin=a.y),this.linkChartExtent.ymax<a.y&&(this.linkChartExtent.ymax=a.y)})}),this.memberRelationshipTypes.forEach(e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach(e=>{const t=this.relationshipLinkChartDiagramLookup.get(e.attributes[w.Cz]),i=this.relationshipLinkChartDiagramLookup.get(e.attributes[w.KQ]);if(t&&i){const a=(0,M.Ux)(new f.A({paths:[[[t.coords[0],t.coords[1]],[i.coords[0],i.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(e.attributes[w.dr],a)}else this.relationshipLinkChartDiagramLookup.set(e.attributes[w.dr],null)})})):await this._calculateLayoutWithSublayerTimeInfo(this.initializationLinkChartConfig.layoutMode,{lockedEntityLocations:this.getCurrentNodeLocations(),...this.initializationLinkChartConfig}):await this._calculateLayoutWithSublayerTimeInfo("organic-standard",{lockedEntityLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateOrganicLayoutSettings(e,t){const i=e=>"number"==typeof e&&!isNaN(e),a=e=>i(e)&&e>=0,n={};if(!new Set(["organic-standard","organic-community","geographic-organic-standard","chronological-multi-timeline","chronological-mono-timeline"]).has(e)||!t)return n;const{computationBudgetTime:o,autoRepulsionRadius:s,repulsionRadiusMultiplier:r,absoluteIdealEdgeLength:h,multiplicativeIdealEdgeLength:d,idealEdgeLengthType:p}=t;return(e=>i(e)&&e>=1)(o)?n.computationBudgetTime=o:o&&l.A.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),n.autoRepulsionRadius=s,!s&&(e=>i(e)&&e>=1)(r)?n.repulsionRadiusMultiplier=r:s||(n.autoRepulsionRadius=!0,l.A.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting")),"geographic-organic-standard"===e&&((e=>Object.values(b).includes(e))(p)?n.idealEdgeLengthType=p:void 0!==p&&l.A.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),"absolute-value"===p&&a(h)?n.absoluteIdealEdgeLength=h:"absolute-value"===p&&void 0!==h?l.A.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting"):"multiplier"===p&&a(d)?n.multiplicativeIdealEdgeLength=d:"multiplier"===p&&void 0!==d&&l.A.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),n}_convertValidatedOrganicSettingsToCalculationSettings(e){let t=e.idealEdgeLengthType===b.ABSOLUTE?e.absoluteIdealEdgeLength:e.multiplicativeIdealEdgeLength;return e.idealEdgeLengthType===b.ABSOLUTE&&(void 0===t?t=-1:t*=-1),{computationBudgetTime:e.computationBudgetTime??void 0,repulsionRadiusMultiplier:e.repulsionRadiusMultiplier&&!e.autoRepulsionRadius?e.repulsionRadiusMultiplier:void 0,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new T.A({objectType:e,parentCompositeLayer:this,graphType:e.type})}_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"))}_alignLayersDataModelAndInclusionDefinition(e){const t=new Set((e.entityTypes??[]).map(e=>e.name).concat((e.relationshipTypes??[]).map(e=>e.name))),i=new Set((e.entityTypes??[]).map(e=>e.name)),a=new Set((e.relationshipTypes??[]).map(e=>e.name));if(this.layers){for(const e of this.layers)!e.graphType&&t.has(e.graphTypeName)&&(e.graphType=i.has(e.graphTypeName)?"entity":"relationship");const e=this.layers.filter(e=>t.has(e.graphTypeName)&&("entity"===e.graphType?i.has(e.graphTypeName):a.has(e.graphTypeName)));this.setAtOrigin("layers",e,(0,y.OL)(this.originIdOf("layers")))}else this.layers=new o.A;if(this.layers&&this._originalInclusionList){const e=new Set(this._originalInclusionList.namedTypeDefinitions.keys()),t=this.tables?.map(e=>e.graphTypeName)??[],i=this.layers.map(e=>e.graphTypeName).concat(t);for(const t of i)e.has(t)||this._originalInclusionList.namedTypeDefinitions.set(t,{useAllData:!1,members:new Map});const a=[];for(const e of this._originalInclusionList.namedTypeDefinitions.keys())i.includes(e)||(l.A.getLogger(this).warn(`A named type, ${e}, was in the serialized feature collection but did not have a sublayer config in the item, so will be removed`),a.push(e));for(const e of a)this._originalInclusionList.namedTypeDefinitions.delete(e)}}};(0,a.Cg)([(0,g.MZ)(I.OZ)],Q.prototype,"url",void 0),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"dataPreloadedInLocalCache",void 0),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"initializationLinkChartConfig",void 0),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"membershipModified",void 0),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"dataManager",void 0),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"initializationInclusionModeDefinition",null),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"knowledgeGraph",void 0),(0,a.Cg)([(0,g.MZ)({type:o.A.ofType(T.A),json:{write:{ignoreOrigin:!0}}})],Q.prototype,"layers",void 0),(0,a.Cg)([(0,g.MZ)({readOnly:!0})],Q.prototype,"linkChart",null),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"entityLinkChartDiagramLookup",void 0),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"relationshipLinkChartDiagramLookup",void 0),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"linkChartExtent",void 0),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"memberEntityTypes",void 0),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"memberRelationshipTypes",void 0),(0,a.Cg)([(0,g.MZ)({type:["LinkChartLayer"]})],Q.prototype,"operationalLayerType",void 0),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"sublayerCapabilities",null),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"sublayerIdsCache",void 0),(0,a.Cg)([(0,g.MZ)({type:o.A.ofType(T.A),json:{write:{ignoreOrigin:!0}}})],Q.prototype,"tables",void 0),(0,a.Cg)([(0,g.MZ)({json:{read:!1}})],Q.prototype,"type",void 0),(0,a.Cg)([(0,g.MZ)({readOnly:!0})],Q.prototype,"userHasEditingPrivileges",void 0),(0,a.Cg)([(0,g.MZ)({readOnly:!0})],Q.prototype,"userHasFullEditingPrivileges",void 0),(0,a.Cg)([(0,g.MZ)({readOnly:!0})],Q.prototype,"userHasUpdateItemPrivileges",void 0),(0,a.Cg)([(0,g.MZ)({json:{read:!1}})],Q.prototype,"chronologicalAuxiliaryGraphics",void 0),(0,a.Cg)([(0,g.MZ)((0,K.P6)("dateFieldsTimeReference"))],Q.prototype,"dateFieldsTimeZone",void 0),Q=(0,a.Cg)([(0,g.$K)("esri.layers.LinkChartLayer")],Q);const W=Q}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3309],{93309(e,t,i){i.r(t),i.d(t,{default:()=>V});var a=i(5482),n=i(79842),o=i(7762),s=i(51447),r=i(49186),l=i(53966),h=i(91869),d=i(25728),p=i(17676),u=i(36708),g=i(91429),y=i(35666),c=i(5443),m=i(86738),f=i(82799),L=i(12359),C=i(4146),M=i(90708),w=i(15375);const b={MULTIPLIER:"multiplier",ABSOLUTE:"absolute-value"};var k=i(24137),T=i(62796),v=i(40736),E=i(69860),N=i(99916),D=i(63074),S=i(34287),x=i(25036),I=i(10873),A=i(8460),_=i(69540),R=i(25482),Z=i(56507),B=i(69647),z=i(93223);let O=class extends((0,_.OU)(R.o)){constructor(e){super(e),this.durationLineWidth=5,this.entityPositionAtDurationRatio=1,this.eventsTicksVisualization="start-and-end",this.lineSeparationMultiplier=1,this.moveFirstBends=!0,this.secondBendRatio=.3,this.separateTimeOverlaps=!0,this.separateTimelineOverlaps=!0,this.separatedLineShapeRatio=0,this.showDurationLineForNonZeroDurationEntityEvents=!1,this.showNonZeroDurationIntervalBounds=!1,this.spaceSeparatedLinesEvenly=!1,this.timeBannerUTCOffsetInMinutes=0,this.timeDirection="right",this.useBezierCurves=!1}};(0,a.Cg)([(0,g.MZ)({type:Z.jz,range:{min:1,max:10},json:{write:!0}})],O.prototype,"durationLineWidth",void 0),(0,a.Cg)([(0,g.MZ)({type:Number,range:{min:0,max:1},json:{write:!0}})],O.prototype,"entityPositionAtDurationRatio",void 0),(0,a.Cg)([(0,z.e)(B.SJ)],O.prototype,"eventsTicksVisualization",void 0),(0,a.Cg)([(0,g.MZ)({type:Number,range:{min:0},json:{write:!0}})],O.prototype,"lineSeparationMultiplier",void 0),(0,a.Cg)([(0,g.MZ)({type:Boolean,json:{write:!0}})],O.prototype,"moveFirstBends",void 0),(0,a.Cg)([(0,g.MZ)({type:Number,range:{min:0,max:1},json:{write:!0}})],O.prototype,"secondBendRatio",void 0),(0,a.Cg)([(0,g.MZ)({type:Boolean,json:{write:!0}})],O.prototype,"separateTimeOverlaps",void 0),(0,a.Cg)([(0,g.MZ)({type:Boolean,json:{write:!0}})],O.prototype,"separateTimelineOverlaps",void 0),(0,a.Cg)([(0,g.MZ)({type:Number,range:{min:0,max:1},json:{write:!0}})],O.prototype,"separatedLineShapeRatio",void 0),(0,a.Cg)([(0,g.MZ)({type:Boolean,json:{write:!0}})],O.prototype,"showDurationLineForNonZeroDurationEntityEvents",void 0),(0,a.Cg)([(0,g.MZ)({type:Boolean,json:{write:!0}})],O.prototype,"showNonZeroDurationIntervalBounds",void 0),(0,a.Cg)([(0,g.MZ)({type:Boolean,json:{write:!0}})],O.prototype,"spaceSeparatedLinesEvenly",void 0),(0,a.Cg)([(0,g.MZ)({type:Z.jz,json:{write:!0}})],O.prototype,"timeBannerUTCOffsetInMinutes",void 0),(0,a.Cg)([(0,g.MZ)({type:["bottom","left","right","top"],json:{write:!0}})],O.prototype,"timeDirection",void 0),(0,a.Cg)([(0,g.MZ)({type:Boolean,json:{write:!0}})],O.prototype,"useBezierCurves",void 0),O=(0,a.Cg)([(0,g.$K)("esri.linkChart.ChronologicalLayoutSettings")],O);const P=O;let U=class extends((0,_.OU)(R.o)){constructor(e){super(e),this.absoluteIdealEdgeLength=1,this.autoRepulsionRadius=!0,this.computationBudgetTime=2,this.idealEdgeLengthType="multiplier",this.multiplicativeIdealEdgeLength=1,this.repulsionRadiusMultiplier=1}};(0,a.Cg)([(0,g.MZ)({type:Number,range:{min:0,max:360},json:{write:!0}})],U.prototype,"absoluteIdealEdgeLength",void 0),(0,a.Cg)([(0,g.MZ)({type:Boolean,json:{write:!0}})],U.prototype,"autoRepulsionRadius",void 0),(0,a.Cg)([(0,g.MZ)({type:Number,json:{write:!1}})],U.prototype,"computationBudgetTime",void 0),(0,a.Cg)([(0,z.e)(B.lg)],U.prototype,"idealEdgeLengthType",void 0),(0,a.Cg)([(0,g.MZ)({type:Number,range:{min:0,max:5},json:{write:!0}})],U.prototype,"multiplicativeIdealEdgeLength",void 0),(0,a.Cg)([(0,g.MZ)({type:Number,range:{min:1,max:99},json:{write:!0}})],U.prototype,"repulsionRadiusMultiplier",void 0),U=(0,a.Cg)([(0,g.$K)("esri.linkChart.OrganicLayoutSettings")],U);const j=U;let F=class extends((0,_.OU)(R.o)){constructor(e){super(e),this.rootEntities=[]}};(0,a.Cg)([(0,g.MZ)({type:[Object],json:{write:!0}})],F.prototype,"rootEntities",void 0),F=(0,a.Cg)([(0,g.$K)("esri.linkChart.RootedLayoutSettings")],F);let G=class extends((0,_.OU)(R.o)){constructor(e){super(e),this.chronologicalLayoutSettings=null,this.organicLayoutSettings=null,this.rootedLayoutSettings=null}};(0,a.Cg)([(0,g.MZ)({type:P,json:{write:!0}})],G.prototype,"chronologicalLayoutSettings",void 0),(0,a.Cg)([(0,g.MZ)({type:j,json:{write:!0}})],G.prototype,"organicLayoutSettings",void 0),(0,a.Cg)([(0,g.MZ)({type:F,json:{write:!0}})],G.prototype,"rootedLayoutSettings",void 0),G=(0,a.Cg)([(0,g.$K)("esri.linkChart.LayoutSettings")],G);var H=i(54628),$=i(53902),K=i(56400);let Q=class extends((0,S.q)((0,D.dM)((0,x.j)((0,d.M)(C.A))))){constructor(e){if(super(e),this.url=null,this.dataPreloadedInLocalCache=!1,this.initializationLinkChartConfig=null,this.membershipModified=!0,this._currentLinkChartConfig={layoutMode:"organic-standard"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(o.A.ofType(T.A)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new c.A({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="LinkChartLayer",this.sublayerIdsCache=new Map,this.tables=new(o.A.ofType(T.A)),this.type="link-chart",this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1,this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.initializationInclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.initializationInclusionModeDefinition)throw new r.A("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");this.addHandles((0,u.wB)(()=>this.layers.concat(this.tables),(e,t)=>this._handleSublayersChange(e,t),u.OH))}normalizeCtorArgs(e){if(!e)return{};const{url:t,dataPreloadedInLocalCache:i,initializationLinkChartConfig:a}=e;let{title:n}=e;return!n&&e?.url&&(n=(0,v.$L)(e.url)),{url:t,title:n,dataPreloadedInLocalCache:i,initializationLinkChartConfig:a}}_initializeLayerProperties(e){const t=new Set;let i=[],a=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new r.A("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.inclusionModeDefinition?.generateAllSublayers?(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach((n,o)=>{const s=this._graphTypeLookup.get(o);if(!s)return l.A.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(o);"relationship"===s.type?t.has(o)||(t.add(o),a.push(s)):"entity"===s.type?t.has(o)||(t.add(o),i.push(s)):(l.A.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(o))}):(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]);const n=new k.P({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=i,this.memberRelationshipTypes=a,this.dataManager=n}load(e){const t=async()=>{const e=[],t=[];this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await(0,v.qN)(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(e=>{e.useAllData=!1}),await this._initializeDiagram(),this.layers.forEach(i=>{t.push(i.refreshCachedQueryEngine()),e.push(new Promise(e=>{i.on("layerview-create",()=>{e(null)})}))}),this.tables.forEach(e=>{t.push(e.refreshCachedQueryEngine())}),await Promise.all(t)};return this.addResolvingPromise(new Promise(i=>{(0,$.fetchKnowledgeGraph)(this.url).then(async a=>{a.dataModel.entityTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)}),a.dataModel.relationshipTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)});const o=this.linkChart?.linkChartProperties;6===o?.originIdOf("entitiesUrl")&&(this.membershipModified=!1,(0,H.lV)([o.entitiesUrl??"",o.relationshipsUrl??""],this.linkChart?.portalItem?.itemUrl??"").then(e=>{this.linkChart?.linkChartProperties.setCreationDatesForResources(e)}),this._originalInclusionList=await n.XW.fetchAndConvertSerializedLinkChart({entitiesUrl:o?.entitiesUrl,relationshipsUrl:o?.relationshipsUrl},{signal:e?.signal}),this._alignLayersDataModelAndInclusionDefinition(a.dataModel),this.initializationLinkChartConfig={layoutSettings:o?.layoutSettings??void 0,layoutMode:(0,N.k5)(o.layoutType)}),this._initializeLayerProperties({knowledgeGraph:a,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach(e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}));const{edit:s,fullEdit:r,updateItem:l}=await(0,v.N1)(a.serviceDefinition.serviceItemId,this.url,e);if(this._set("userHasEditingPrivileges",s),this._set("userHasFullEditingPrivileges",r),this._set("userHasUpdateItemPrivileges",l),this.read({dateFieldsTimeReference:a.serviceDefinition.dateFieldsTimeReference},{origin:"service"}),this.dataPreloadedInLocalCache){const e=E.A.getInstance();for(const[t,i]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions??[])for(const a of i.members?.values()??[]){const i=e.readFromStoreById(`${t}__${a.id}`);i&&(0,h.tE)(this.dataManager.sublayerCaches,t,()=>new Map).set(a.id,i)}await t()}else{const i="geographic-organic-standard"===this.initializationLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,i,!0).then(async()=>{(0,p.Te)(e),await t()}))}i(null)})})),Promise.resolve(this)}set initializationInclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("initializationInclusionModeDefinition",e):l.A.getLogger(this).error("#initializationInclusionModeDefinition","initializationInclusionModeDefinition cannot be changed after the layer is loaded.")}get linkChart(){return this.parent}get sublayerCapabilities(){return(0,v.hZ)(this.knowledgeGraph)}async addRecords(e,t){let i=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(i=await(0,N.aq)(e,this.dataManager.knowledgeGraph));const a=e.concat(i).filter(e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id));a.length>0&&(this.membershipModified=!0),await this._handleNewRecords(a,t)}async createSublayerForNamedType(e){await this.load();const t=this._graphTypeLookup.get(e);if(!t)throw new r.A("knowledge-graph:missing-type","The specified type does not exist in the knowledge graph.");if(this.dataManager.sublayerCaches.has(e))throw new r.A("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),(0,h.tE)(this.sublayerIdsCache,e,()=>new Set);const i=this._createSublayer(t);return"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.set(e,{useAllData:!1,members:new Map}),i.geometryType?this.layers.push(i):this.tables.push(i),await(0,v.qN)(this,[e]),this._refreshNamedTypes(),i}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:i=!1,overrideMembershipCheck:a=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1,overrideMembershipCheck:!1}){let n=[];for(const t of e)(a||!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.members?.has(t.id))&&n.push(t);if(t){const e=new Set,t=[];for(const t of n)if(this.dataManager.nodeConnectionsLookup.has(t.id))for(const i of this.dataManager.nodeConnectionsLookup.get(t.id))e.add(i);for(const i of e)if(this.dataManager.memberIdTypeLookup.has(i))for(const e of this.dataManager.memberIdTypeLookup.get(i))this.dataManager.relationshipTypeNames.has(e)&&t.push({id:i,typeName:e});n=n.concat(t)}const o=this._currentLinkChartConfig.layoutSettings?.rootedLayoutSettings?.rootEntities;if(o?.length){const e=new Set(n.map(({id:e})=>e)),t=o.filter(({id:t})=>!e.has(t));if(t.length!==o.length){this._currentLinkChartConfig.layoutSettings.rootedLayoutSettings.rootEntities=t;const e=this.linkChart?.linkChartProperties;e?.layoutSettings?.rootedLayoutSettings&&(e.layoutSettings.rootedLayoutSettings.rootEntities=t)}}this.dataManager.removeFromLayer(n);for(const e of n)this.sublayerIdsCache.get(e.typeName)?.delete(e.id),this.dataManager.relationshipTypeNames.has(e.typeName)?this.relationshipLinkChartDiagramLookup.delete(e.id):this.entityLinkChartDiagramLookup.delete(e.id);const s=i?void 0:this.getCurrentNodeLocations();await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,{layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedEntityLocations:s}),n.length>0&&(this.membershipModified=!0);const r=[];return this.layers.forEach(e=>{r.push(e.refreshCachedQueryEngine())}),await Promise.all(r),this._refreshNamedTypes(),n}async expand(e,t){let i=[];try{const a=await this.dataManager.getConnectedRecordIds(e,t?.relationshipTypeNames,t);i=a.filter(e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)),await this._handleNewRecords(i,t),a.length>0&&(this.membershipModified=!0),(0,p.Te)(t?.signal)}catch(e){throw(0,p.zf)(e)&&i.length>0&&await this.removeRecords(i,{overrideMembershipCheck:!0}),e}return{records:i}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];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 o.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 o.A,this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{const i=(0,h.tE)(this.sublayerIdsCache,t,()=>new Set);e.members?.forEach(({id:e,linkChartLocation:a})=>{if(i.add(e),a){const i="coords"in a&&"lengths"in a?a:(0,M.Ux)(a);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(e,i):this.entityLinkChartDiagramLookup.set(e,i)}})})}async calculateLinkChartLayout(e="organic-standard",t){const i=[],a=[],n=[];this.dataManager.sublayerCaches.forEach((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach(e=>{i.push({typeName:t,feature:e})}):this.dataManager.relationshipTypeNames.has(t)&&e.forEach(e=>{a.push({typeName:t,feature:e})})}),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const o=new Map,s=new Map,d=new Map,u=new Map,g=new Uint8Array(i.length),y=new Float64Array(i.length),C=new Float64Array(i.length),b=new Float64Array(i.length),k=new Float64Array(i.length),T=new Uint32Array(a.length),v=new Uint32Array(a.length),E=new Float64Array(a.length),N=new Float64Array(a.length),D=[];let S=!1;const x=new c.A({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let I,_="organic-standard",R=0,Z=0;const B=A.i6.apply;switch(_="geographic-organic-standard"===e?"organic-standard":e,_){case"organic-standard":I=A.pM.apply;break;case"organic-community":I=A.Tu.apply;break;case"hierarchical-bottom-to-top":I=A.$C.apply;break;case"radial-root-centric":I=A.vJ.apply;break;case"tree-left-to-right":I=A.Xq.apply;break;default:I=A.Wg.apply}let z=!1;const O=new Set(t?.layoutSettings?.rootedLayoutSettings?.rootEntities?.map(({id:e})=>e));i.forEach(({typeName:i,feature:a})=>{if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e&&t?.lockedEntityLocations?.has(a.attributes[w.dr])){"geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(i)?g[R]=2:g[R]=0;const n=t.lockedEntityLocations.get(a.attributes[w.dr]);y[R]=n.x,C[R]=n.y}else if("geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(i)){g[R]=2;let e=null;const t=a.attributes[this.dataManager.geographicLookup.get(i).name],n=this.dataManager.geographicLookup.get(i)?.geometryType;switch(n){case"esriGeometryPoint":y[R]=t?.x,C[R]=t?.y;break;case"esriGeometryPolygon":{const i=t?(0,L.Ve)(t):null;e=i?m.A.fromJSON(i):null,null!=e?.x&&null!=e?.y?(y[R]=e.x,C[R]=e.y):g[R]=1;break}case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(y[R]=e.x,C[R]=e.y):g[R]=1;break;default:g[R]=1}(null==y[R]||null==C[R]||Number.isNaN(y[R])||Number.isNaN(C[R]))&&(g[R]=1,y[R]=0,C[R]=0)}else if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){!z&&t?.lockedEntityLocations?.has(a.attributes[w.dr])&&(z=!0);const e=t?.timeInfoByTypeName?.get(i),n=e?.startField,o=n&&e?.startField?a.attributes[n]:null;b[R]=o?new Date(o).getTime():NaN;const s=e?.endField,r=s&&e?.endField?a.attributes[s]:null;k[R]=r?new Date(r).getTime():NaN,y[R]=0,C[R]=0,g[R]=1}else g[R]=1,y[R]=0,C[R]=0;O.has(a.attributes[w.dr])&&(g[R]|=4),u.set(a.attributes[w.dr],R),D[R]={feature:a,typeName:i},R++}),z&&l.A.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let P=!1;const U=new Map;a.forEach(i=>{const a=i.feature.attributes[w.Cz],o=i.feature.attributes[w.KQ],s=u.get(a),r=u.get(o),l=t?.timeInfoByTypeName?.get(i.typeName),h=t?.timeInfoByTypeName?l?.startField:null,d=h?i.feature.attributes[h]:null,p=l?.endField,g=p?i.feature.attributes[p]:null;if(void 0!==s&&void 0!==r){let t=a+"-"+o;"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(t=t+"-"+d+"-"+g);const l=U.get(t),h=l?.has(i.typeName);h||(T[Z]=s,v[Z]=r,"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(E[Z]=d?new Date(d).getTime():NaN,N[Z]=g?new Date(g).getTime():NaN),void 0===l?U.set(t,new Map([[i.typeName,Z]])):l.set(i.typeName,Z),Z++),n.push(i)}else P=!0,this.relationshipLinkChartDiagramLookup.set(a,null)}),P&&l.A.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const j=this._validateOrganicLayoutSettings(e,t?.layoutSettings?.organicLayoutSettings),F=this._convertValidatedOrganicSettingsToCalculationSettings(j);await(0,A.Hh)();let G=1,H=null;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){let i;({status:G,links:H,graphics:i}=B(()=>t?.signal?.aborted??!1,g,y,C,b,k,T.subarray(0,Z),v.subarray(0,Z),E.subarray(0,Z),N.subarray(0,Z),"chronological-multi-timeline"===e,t?.layoutSettings?.chronologicalLayoutSettings)),0===G&&(this.chronologicalAuxiliaryGraphics=i)}else({status:G,links:H}=I(()=>t?.signal?.aborted??!1,g,y,C,T.subarray(0,Z),v.subarray(0,Z),F.computationBudgetTime,F.idealEdgeLengthMultiplier,F.repulsionRadiusMultiplier));if((0,p.Te)(t?.signal),1===G)throw new r.A("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");if(2===G)throw(0,p.NK)();for(let e=0;e<D.length;e++){if(C[e]>84.9999?C[e]=84.9999:C[e]<-84.9999&&(C[e]=-84.9999),y[e]>179.9999?y[e]=179.9999:y[e]<-179.9999&&(y[e]=-179.9999),D[e].feature.attributes[w.T1]=new m.A(y[e],C[e]),o.has(D[e].typeName)){const t=o.get(D[e].typeName);t?.set(D[e].feature.attributes[w.dr],D[e].feature)}else{const t=new Map;t.set(D[e].feature.attributes[w.dr],D[e].feature),o.set(D[e].typeName,t)}d.set(D[e].feature.attributes[w.dr],D[e].feature);const t=(0,M.Ux)(D[e].feature.attributes[w.T1]);this.entityLinkChartDiagramLookup.set(D[e].feature.attributes[w.dr],D[e].feature.attributes[w.T1]?t:null);const i=(0,h.tE)(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,D[e].typeName,()=>({useAllData:!1,members:new Map}));(0,h.tE)(i.members,D[e].feature.attributes[w.dr],()=>({id:D[e].feature.attributes[w.dr],linkChartLocation:void 0})).linkChartLocation=D[e].feature.attributes[w.T1];const{x:a,y:n}=D[e].feature.attributes[w.T1];if(S)x.xmin=Math.min(x.xmin,a),x.xmax=Math.max(x.xmax,a),x.ymin=Math.min(x.ymin,n),x.ymax=Math.max(x.ymax,n);else{const e=1e-7;x.xmin=a-e,x.xmax=a+e,x.ymin=n-e,x.ymax=n+e,S=!0}}if(this.linkChartExtent.xmin=x.xmin,this.linkChartExtent.xmax=x.xmax,this.linkChartExtent.ymin=x.ymin,this.linkChartExtent.ymax=x.ymax,!H)throw new r.A("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const $=new Map,K=new Map,Q=new Map,V=new Set;for(let i=0;i<n.length;i++){const a=[],o=n[i],r=o.feature.attributes[w.Cz],p=o.feature.attributes[w.KQ];let g=r+"-"+p;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){const e=t?.timeInfoByTypeName?.get(o.typeName),i=t?.timeInfoByTypeName?e?.startField:null,a=i?o.feature.attributes[i]:null,n=e?.endField;g+="-"+a+"-"+(n?o.feature.attributes[n]:null)}const y=U.get(g).get(o.typeName),c=0===y?0:H?.vertexEndIndex[y-1];if(!V.has(y)){if(V.add(y),2===H.types[y]){const e=[H.vertices[2*c],H.vertices[2*c+1]],t=[H.vertices[2*(c+1)],H.vertices[2*(c+1)+1]],i=[.5*(e[0]+t[0]),.5*(e[1]+t[1])],n=[i[0]-e[0],i[1]-e[1]],o=[i[0]+n[1],i[1]-n[0]],s=[i[0]-n[1],i[1]+n[0]];a.push(e),a.push(o),a.push(t),a.push(s),a.push(e)}else{if(0!==H.types[y]){l.A.getLogger(this).warn("A relationship generated an unsupported link geometry type. It will not be rendered");continue}for(let e=c;e<H.vertexEndIndex[y];e++)a.push([H.vertices[2*e],H.vertices[2*e+1]])}if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e){const e=D[u.get(r)]?.feature.attributes[w.T1],t=D[u.get(p)]?.feature.attributes[w.T1];a[0][0]===e.x&&a[0][1]===e.y||(a[0]=[e.x,e.y]),a[a.length-1][0]===t.x&&a[a.length-1][1]===t.y||(a[a.length-1]=[t.x,t.y])}for(let e=1;e<a.length-1;e++)a[e][1]>85.5?a[e][1]=85.5:a[e][1]<-85.5&&(a[e][1]=-85.5),a[e][0]>179.9999?a[e][0]=179.9999:a[e][0]<-179.9999&&(a[e][0]=-179.9999);$.has(g)?$.get(g).push(a):$.set(g,[a])}const m=$.get(g);K.has(g)||(K.set(g,new Map),Q.set(g,new Map));const L=K.get(g),C=Q.get(g);L.has(o.typeName)||(L.set(o.typeName,m.shift()),C.set(o.typeName,0));const b=L.get(o.typeName);C.set(o.typeName,C.get(o.typeName)+1);const k=new f.A({paths:[b]});if(o.feature.attributes[w.T1]=k,s.has(o.typeName)){const e=s.get(o.typeName);e?.set(o.feature.attributes[w.dr],o.feature)}else{const e=new Map;e.set(o.feature.attributes[w.dr],o.feature),s.set(o.typeName,e)}d.set(o.feature.attributes[w.dr],o.feature);const T=(0,M.Ux)(o.feature.attributes[w.T1]);this.relationshipLinkChartDiagramLookup.set(o.feature.attributes[w.dr],o.feature.attributes[w.T1]?T:null);const v=(0,h.tE)(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,o.typeName,()=>({useAllData:!1,members:new Map}));(0,h.tE)(v.members,o.feature.attributes[w.dr],()=>({id:o.feature.attributes[w.dr],linkChartLocation:void 0})).linkChartLocation=T}for(const e of n)e.feature.attributes[w.M1]=Q.get(e.feature.attributes[w.Cz]+"-"+e.feature.attributes[w.KQ])?.get(e.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutSettings:t?.layoutSettings?.clone()},{nodes:o,links:s,idMap:d}}async applyNewLinkChartLayout(e="organic-standard",t){let{lockedNodeLocations:i,lockedEntityLocations:a,rootEntityIds:n,...o}=t??{};!a&&i?((0,s.io)(l.A.getLogger(this),"lockedNodeLocations is deprecated in 5.0. Use lockedEntityLocations instead.",{replacement:"Use lockedEntityLocations instead.",version:"5.0"}),a=i):a&&i&&(0,s.io)(l.A.getLogger(this),"Both lockedNodeLocations (deprecated in 5.0) and lockedEntityLocations are defined. Use lockedEntityLocations only instead.",{replacement:"Use lockedEntityLocations instead.",version:"5.0"});const r=o.layoutSettings?.rootedLayoutSettings?.rootEntities;if(!r&&n){(0,s.io)(l.A.getLogger(this),"rootEntityIds is deprecated in 5.1. Use layoutSettings.rootedLayoutSettings.rootEntities instead.",{replacement:"Use layoutSettings.rootedLayoutSettings.rootEntities instead.",version:"5.1"});const e=[];for(const t of n){const i=this.dataManager.memberIdTypeLookup.get(t),a=Array.from(i??[]).find(e=>this.dataManager.entityTypeNames.has(e));a&&e.push({id:t,typeName:a})}o.layoutSettings=o.layoutSettings??new G,o.layoutSettings.rootedLayoutSettings=o.layoutSettings.rootedLayoutSettings??new F,o.layoutSettings.rootedLayoutSettings.rootEntities=e}else r&&n&&(0,s.io)(l.A.getLogger(this),"Both rootEntityIds (deprecated in 5.1) and layoutSettings.rootedLayoutSettings.rootEntities are defined. Use layoutSettings.rootedLayoutSettings.rootEntities only instead.",{replacement:"Use layoutSettings.rootedLayoutSettings.rootEntities instead.",version:"5.1"});const h=[];await this._calculateLayoutWithSublayerTimeInfo(e,{...o,lockedEntityLocations:a}),this.layers.forEach(e=>{h.push(e.refreshCachedQueryEngine())}),this.membershipModified=!0,await Promise.all(h),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;for(const[t,i]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.entries()??[])this.dataManager.relationshipTypeNames.has(t)||i?.members?.forEach(t=>{const i=t.linkChartLocation;let a;const n=t.id;i&&(a="x"in i?{x:i.x,y:i.y}:{x:i.coords[0],y:i.coords[1]},e.set(n,new m.A({x:a.x,y:a.y})))});return e}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach(e=>{t.push(e.refreshCachedQueryEngine())}),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e,t){if(!e.length)return{records:[]};let i=[];try{let a=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(a=a.concat(Array.from(t.keys())))}i=await this.dataManager.getRelationshipsBetweenNodes(e,a,t),await this._handleNewRecords(i,t),(0,p.Te)(t)}catch(e){throw(0,p.zf)(e)&&this.removeRecords(i),e}return{records:i}}async connectFromEntities(e,t){if(!e.length)return{records:[]};let i=[];try{let a=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(a=a.concat(Array.from(t.keys())))}let n=[];for(const e of this.dataManager.entityTypeNames){const t=this.sublayerIdsCache.get(e);t&&(n=n.concat(Array.from(t)))}i=await this.dataManager.getRelationshipsFromNodes(e,n,a,t),await this._handleNewRecords(i,t),i.length>0&&(this.membershipModified=!0),(0,p.Te)(t)}catch(e){throw(0,p.zf)(e)&&this.removeRecords(i),e}return{records:i}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="organic-standard",t){const i=new Map;this.layers.forEach(e=>{i.set(e.objectType.name,e.timeInfo)}),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:i,...t}),this.linkChart?.handleChronologicalOverlay()}async _handleNewRecords(e,t){const i=new Set,a=[],n=this.layers.concat(this.tables);for(const t of e)this._graphTypeLookup.has(t.typeName)&&(!1===n.some(e=>e.objectType.name===t.typeName)&&(this.dataManager.sublayerCaches.set(t.typeName,new Map),i.add(t.typeName)),(0,h.tE)(this.sublayerIdsCache,t.typeName,()=>new Set).add(t.id),a.push(t));this.dataManager.addToLayer(a);for(const e of i){const t=this._graphTypeLookup.get(e);if(t){const i=this._createSublayer(t);"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),i.geometryType?this.layers.push(i):this.tables.push(i)}}await(0,v.qN)(this,Array.from(i),t),await this.dataManager.refreshCacheContent(e.map(e=>e.id),void 0,void 0,void 0,t);const o={layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedEntityLocations:new Map};for(const[e,t]of this.entityLinkChartDiagramLookup.entries())t&&o.lockedEntityLocations.set(e,new m.A(t.coords[0],t.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,o)}_createSublayers(e,t,i){e.forEach(e=>{const a=this._createSublayer(e);i(a)&&t.push(a),this._updateSublayerCaches(e)})}_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,t.read({title:i.name},{origin:"service"}),this._updateSublayerCaches(i))})}_updateSublayerCaches({name:e}){if(!e)return;const t=this.dataManager.sublayerCaches;t.has(e)||t.set(e,new Map)}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=3&&e<7}async _initializeDiagram(){this.initializationLinkChartConfig?this.initializationLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e?.members?.forEach(e=>{const i=e.linkChartLocation;let a;const n=e.id;if(!i)return;a="x"in i?{x:i.x,y:i.y}:{x:i.coords[0],y:i.coords[1]};const o=(0,M.Ux)(a);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(n,o):this.entityLinkChartDiagramLookup.set(n,o),this.linkChartExtent.xmin>a.x&&(this.linkChartExtent.xmin=a.x),this.linkChartExtent.xmax<a.x&&(this.linkChartExtent.xmax=a.x),this.linkChartExtent.ymin>a.y&&(this.linkChartExtent.ymin=a.y),this.linkChartExtent.ymax<a.y&&(this.linkChartExtent.ymax=a.y)})}),this.memberRelationshipTypes.forEach(e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach(e=>{const t=this.relationshipLinkChartDiagramLookup.get(e.attributes[w.Cz]),i=this.relationshipLinkChartDiagramLookup.get(e.attributes[w.KQ]);if(t&&i){const a=(0,M.Ux)(new f.A({paths:[[[t.coords[0],t.coords[1]],[i.coords[0],i.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(e.attributes[w.dr],a)}else this.relationshipLinkChartDiagramLookup.set(e.attributes[w.dr],null)})})):await this._calculateLayoutWithSublayerTimeInfo(this.initializationLinkChartConfig.layoutMode,{lockedEntityLocations:this.getCurrentNodeLocations(),...this.initializationLinkChartConfig}):await this._calculateLayoutWithSublayerTimeInfo("organic-standard",{lockedEntityLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateOrganicLayoutSettings(e,t){const i=e=>"number"==typeof e&&!isNaN(e),a=e=>i(e)&&e>=0,n={};if(!new Set(["organic-standard","organic-community","geographic-organic-standard","chronological-multi-timeline","chronological-mono-timeline"]).has(e)||!t)return n;const{computationBudgetTime:o,autoRepulsionRadius:s,repulsionRadiusMultiplier:r,absoluteIdealEdgeLength:h,multiplicativeIdealEdgeLength:d,idealEdgeLengthType:p}=t;return(e=>i(e)&&e>=1)(o)?n.computationBudgetTime=o:o&&l.A.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),n.autoRepulsionRadius=s,!s&&(e=>i(e)&&e>=1)(r)?n.repulsionRadiusMultiplier=r:s||(n.autoRepulsionRadius=!0,l.A.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting")),"geographic-organic-standard"===e&&((e=>Object.values(b).includes(e))(p)?n.idealEdgeLengthType=p:void 0!==p&&l.A.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),"absolute-value"===p&&a(h)?n.absoluteIdealEdgeLength=h:"absolute-value"===p&&void 0!==h?l.A.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting"):"multiplier"===p&&a(d)?n.multiplicativeIdealEdgeLength=d:"multiplier"===p&&void 0!==d&&l.A.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),n}_convertValidatedOrganicSettingsToCalculationSettings(e){let t=e.idealEdgeLengthType===b.ABSOLUTE?e.absoluteIdealEdgeLength:e.multiplicativeIdealEdgeLength;return e.idealEdgeLengthType===b.ABSOLUTE&&(void 0===t?t=-1:t*=-1),{computationBudgetTime:e.computationBudgetTime??void 0,repulsionRadiusMultiplier:e.repulsionRadiusMultiplier&&!e.autoRepulsionRadius?e.repulsionRadiusMultiplier:void 0,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new T.A({objectType:e,parentCompositeLayer:this,graphType:e.type})}_handleSublayersChange(e,t){if(t&&(t.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner")),e){const t=[];e.forEach(e=>{e.parent=this,t.push(this._createVisibleRefreshHandle(e))}),this.addHandles([...t,e.on("after-add",({item:e})=>{e.parent=this,this.addHandles(this._createVisibleRefreshHandle(e),"sublayers-owner")}),e.on("after-remove",({item:e})=>{e.parent=null})],"sublayers-owner")}}_createVisibleRefreshHandle(e){return(0,u.wB)(()=>e.visible,(t,i)=>{!0===t&&!1===i&&e.emit("refresh",{dataChanged:!0})})}_alignLayersDataModelAndInclusionDefinition(e){const t=new Set((e.entityTypes??[]).map(e=>e.name).concat((e.relationshipTypes??[]).map(e=>e.name))),i=new Set((e.entityTypes??[]).map(e=>e.name)),a=new Set((e.relationshipTypes??[]).map(e=>e.name));if(this.layers){for(const e of this.layers)!e.graphType&&t.has(e.graphTypeName)&&(e.graphType=i.has(e.graphTypeName)?"entity":"relationship");const e=this.layers.filter(e=>t.has(e.graphTypeName)&&("entity"===e.graphType?i.has(e.graphTypeName):a.has(e.graphTypeName)));this.setAtOrigin("layers",e,(0,y.OL)(this.originIdOf("layers")))}else this.layers=new o.A;if(this.layers&&this._originalInclusionList){const e=new Set(this._originalInclusionList.namedTypeDefinitions.keys()),t=this.tables?.map(e=>e.graphTypeName)??[],i=this.layers.map(e=>e.graphTypeName).concat(t);for(const t of i)e.has(t)||this._originalInclusionList.namedTypeDefinitions.set(t,{useAllData:!1,members:new Map});const a=[];for(const e of this._originalInclusionList.namedTypeDefinitions.keys())i.includes(e)||(l.A.getLogger(this).warn(`A named type, ${e}, was in the serialized feature collection but did not have a sublayer config in the item, so will be removed`),a.push(e));for(const e of a)this._originalInclusionList.namedTypeDefinitions.delete(e)}}};(0,a.Cg)([(0,g.MZ)(I.OZ)],Q.prototype,"url",void 0),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"dataPreloadedInLocalCache",void 0),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"initializationLinkChartConfig",void 0),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"membershipModified",void 0),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"dataManager",void 0),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"initializationInclusionModeDefinition",null),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"knowledgeGraph",void 0),(0,a.Cg)([(0,g.MZ)({type:o.A.ofType(T.A),json:{write:{ignoreOrigin:!0}}})],Q.prototype,"layers",void 0),(0,a.Cg)([(0,g.MZ)({readOnly:!0})],Q.prototype,"linkChart",null),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"entityLinkChartDiagramLookup",void 0),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"relationshipLinkChartDiagramLookup",void 0),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"linkChartExtent",void 0),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"memberEntityTypes",void 0),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"memberRelationshipTypes",void 0),(0,a.Cg)([(0,g.MZ)({type:["LinkChartLayer"]})],Q.prototype,"operationalLayerType",void 0),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"sublayerCapabilities",null),(0,a.Cg)([(0,g.MZ)()],Q.prototype,"sublayerIdsCache",void 0),(0,a.Cg)([(0,g.MZ)({type:o.A.ofType(T.A),json:{write:{ignoreOrigin:!0}}})],Q.prototype,"tables",void 0),(0,a.Cg)([(0,g.MZ)({json:{read:!1}})],Q.prototype,"type",void 0),(0,a.Cg)([(0,g.MZ)({readOnly:!0})],Q.prototype,"userHasEditingPrivileges",void 0),(0,a.Cg)([(0,g.MZ)({readOnly:!0})],Q.prototype,"userHasFullEditingPrivileges",void 0),(0,a.Cg)([(0,g.MZ)({readOnly:!0})],Q.prototype,"userHasUpdateItemPrivileges",void 0),(0,a.Cg)([(0,g.MZ)({json:{read:!1}})],Q.prototype,"chronologicalAuxiliaryGraphics",void 0),(0,a.Cg)([(0,g.MZ)((0,K.P6)("dateFieldsTimeReference"))],Q.prototype,"dateFieldsTimeZone",void 0),Q=(0,a.Cg)([(0,g.$K)("esri.layers.LinkChartLayer")],Q);const V=Q}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9506],{49590(e,t,n){n.d(t,{e:()=>d,g:()=>p,l:()=>f});var r=n(86211),o=n(86742),i=n(5808);let l,s,a,c;function u(){return!!l&&(0,o.s1)()}async function f(){if(!u()){const[e]=await Promise.all([Promise.all([n.e(6042),n.e(1878),n.e(8885),n.e(5756),n.e(3299),n.e(1550)]).then(n.bind(n,78125)),(0,o.Hh)()]);l=e.fromGeometry,s=e.fromSpatialReference,a=e.getSpatialReference,c=(0,o.fz)()}}function d(e,t={}){const{curveType:n="geodesic",unit:c}=t,u=a(e);let f=(0,o.g7)(l(e),s(u),i.O[n]);return f&&c&&(f=(0,r.oU)(f,"square-meters",c)),f}const p=Object.freeze(Object.defineProperty({__proto__:null,execute:d,isLoaded:u,load:f,get supportsCurves(){return c}},Symbol.toStringTag,{value:"Module"}))},89506(e,t,n){n.d(t,{execute:()=>r.e,load:()=>r.l}),n(86211),n(86742),n(5808);var r=n(49590)},86742(e,t,n){n.d(t,{Hh:()=>l,fz:()=>a,g7:()=>s,s1:()=>i});var r=n(83290);let o;function i(){return!!o&&(0,r.i)()}async function l(){if(!i()){const[e,t]=await Promise.all([Promise.all([n.e(6042),n.e(1878),n.e(8885),n.e(5756),n.e(6859),n.e(6558)]).then(n.bind(n,6558)),Promise.all([n.e(6042),n.e(1878),n.e(8885),n.e(5756),n.e(6061)]).then(n.bind(n,15756)).then(e=>e.aP).then(({injectPe:e})=>e),(0,r.l)()]);o=new e.OperatorGeodeticArea,t(r.p)}}function s(e,t,n){return o.execute(e,t,n,null)}function a(){return o.supportsCurves()}},5808(e,t,n){n.d(t,{O:()=>r});const r={geodesic:0,loxodrome:1,"great-elliptic":2,"normal-section":3,"shape-preserving":4}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9506],{49590(e,t,n){n.d(t,{e:()=>d,g:()=>p,l:()=>f});var r=n(86211),o=n(86742),i=n(5808);let l,s,a,c;function u(){return!!l&&(0,o.s1)()}async function f(){if(!u()){const[e]=await Promise.all([Promise.all([n.e(6042),n.e(1878),n.e(8885),n.e(5756),n.e(3299),n.e(1550)]).then(n.bind(n,78125)),(0,o.Hh)()]);l=e.fromGeometry,s=e.fromSpatialReference,a=e.getSpatialReference,c=(0,o.fz)()}}function d(e,t={}){const{curveType:n="geodesic",unit:c}=t,u=a(e);let f=(0,o.g7)(l(e),s(u),i.O[n]);return f&&c&&(f=(0,r.oU)(f,"square-meters",c)),f}const p=Object.freeze(Object.defineProperty({__proto__:null,execute:d,isLoaded:u,load:f,get supportsCurves(){return c}},Symbol.toStringTag,{value:"Module"}))},89506(e,t,n){n.d(t,{execute:()=>r.e,load:()=>r.l}),n(86211),n(86742);var r=n(49590)},86742(e,t,n){n.d(t,{Hh:()=>l,fz:()=>a,g7:()=>s,s1:()=>i});var r=n(83290);let o;function i(){return!!o&&(0,r.i)()}async function l(){if(!i()){const[e,t]=await Promise.all([Promise.all([n.e(6042),n.e(1878),n.e(8885),n.e(5756),n.e(6859),n.e(6558)]).then(n.bind(n,6558)),Promise.all([n.e(6042),n.e(1878),n.e(8885),n.e(5756),n.e(6061)]).then(n.bind(n,15756)).then(e=>e.aP).then(({injectPe:e})=>e),(0,r.l)()]);o=new e.OperatorGeodeticArea,t(r.p)}}function s(e,t,n){return o.execute(e,t,n,null)}function a(){return o.supportsCurves()}},5808(e,t,n){n.d(t,{O:()=>r});const r={geodesic:0,loxodrome:1,"great-elliptic":2,"normal-section":3,"shape-preserving":4}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[909],{92009(e,a,t){t.d(a,{L:()=>u});var n=t(70333),r=t(11254),i=t(49186),l=t(17676),s=t(60694),o=t(20655),y=t(80812);async function u(e,a){const t=(0,s.qg)(e);if(!t)throw new i.A("invalid-url","Invalid scene service url");const u={...a,sceneServerUrl:t.url.path,layerId:t.sublayer??void 0};if(u.sceneLayerItem??=await async function(e){const a=(await c(e)).serviceItemId;if(!a)return null;const t=new y.default({id:a,apiKey:e.apiKey}),i=await async function(e){const a=n.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const t=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,r.A)(t,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,l.QP)(e)}return null}(e);null!=i&&(t.portal=new o.A({url:i}));try{return await t.load({signal:e.signal})}catch(e){return(0,l.QP)(e),null}}(u),null==u.sceneLayerItem)return d(u.sceneServerUrl.replace("/SceneServer","/FeatureServer"),u);const f=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const t=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find(e=>"Feature Service"===e.type)||null;if(!t)return null;const n=new y.default({portal:t.portal,id:t.id});return await n.load(),n}catch(e){return(0,l.QP)(e),null}}(u);if(!f?.url)throw new i.A("related-service-not-found","Could not find feature service through portal item relationship");u.featureServiceItem=f;const m=await d(f.url,u);return m.portalItem=f,m}async function c(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const t=await(0,r.A)(e.sceneServerUrl,a);e.rootDocument=t.data}catch{e.rootDocument={}}return e.rootDocument}async function d(e,a){const t=(0,s.qg)(e);if(!t)throw new i.A("invalid-feature-service-url","Invalid feature service url");const n=t.url.path,l=a.layerId;if(null==l)return{serverUrl:n};const o=c(a),y=a.featureServiceItem?await a.featureServiceItem.fetchData("json"):null,u=(y?.layers?.[0]||y?.tables?.[0])?.customParameters,d=e=>{const t={query:{f:"json",...u},responseType:"json",authMode:e,signal:a.signal};return(0,r.A)(n,t)},f=d("anonymous").catch(()=>d("no-prompt")),[m,w]=await Promise.all([f,o]),h=w?.layers,L=m.data&&m.data.layers;if(!Array.isArray(L))throw new Error("expected layers array");if(Array.isArray(h)){for(let e=0;e<Math.min(h.length,L.length);e++)if(h[e].id===l)return{serverUrl:n,layerId:L[e].id}}else if(null!=l&&l<L.length)return{serverUrl:n,layerId:L[l].id};throw new Error("could not find matching associated sublayer")}},23154(e,a,t){t.d(a,{K:()=>f,Q:()=>l});var n=t(77548),r=t(7861);const i=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer","Dimension Layer","Annotation Layer"]);async function l(e,a){const{loadContext:t,...i}=a||{},l=t?await t.fetchServiceMetadata(e,i):await(0,r.L)(e,i),s=(0,n.G$)();d(l),y(l);const o={serviceJSON:l,preferredHost:s};if((l.currentVersion??0)<10.5)return o;const u=`${(0,n.$x)()??e}/layers`,c=t?await t.fetchServiceMetadata(u,i):await(0,r.L)(u,i);return d(c),y(c),o.layersJSON={layers:c.layers,tables:c.tables},o}function s(e){const{type:a}=e;return!!a&&i.has(a)}function o(e){return"Table"===e.type}function y(e){e.layers=e.layers?.filter(s),e.tables=e.tables?.filter(o)}function u(e){e.type||="Feature Layer"}function c(e){e.type||="Table"}function d(e){e.layers?.forEach(u),e.tables?.forEach(c)}function f(e){switch(e){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer";case"Dimension Layer":return"DimensionFeatureLayer";case"Annotation Layer":return"AnnotationLayer"}return"FeatureLayer"}},2976(e,a,t){t.d(a,{U:()=>n});const n={AnnotationLayer:async()=>(await Promise.all([t.e(7632),t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(4674),t.e(993),t.e(8589),t.e(7609),t.e(8144),t.e(3806)]).then(t.bind(t,26519))).default,BingMapsLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(6684)]).then(t.bind(t,17029))).default,BuildingSceneLayer:async()=>(await Promise.all([t.e(7632),t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(4674),t.e(993),t.e(8589),t.e(7609),t.e(6231),t.e(7005),t.e(3077),t.e(7261),t.e(1427),t.e(2942),t.e(9028)]).then(t.bind(t,82411))).default,CSVLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(4079)]).then(t.bind(t,68695))).default,CatalogLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(4674),t.e(993),t.e(7609),t.e(893),t.e(3636),t.e(9279),t.e(28)]).then(t.bind(t,83508))).default,DimensionFeatureLayer:async()=>(await Promise.all([t.e(7632),t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(4674),t.e(993),t.e(8589),t.e(7609),t.e(5971),t.e(1425)]).then(t.bind(t,58638))).default,DimensionLayer:async()=>(await Promise.all([t.e(8278),t.e(3813)]).then(t.bind(t,71493))).default,ElevationLayer:async()=>(await Promise.all([t.e(8278),t.e(9953),t.e(9186),t.e(8732),t.e(5335)]).then(t.bind(t,38732))).default,FeatureLayer:async()=>(await Promise.all([t.e(7632),t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(4674),t.e(993),t.e(8589),t.e(7609),t.e(9098)]).then(t.bind(t,18589))).default,GaussianSplatLayer:async()=>(await Promise.all([t.e(8278),t.e(6231),t.e(9716),t.e(6475)]).then(t.bind(t,36475))).default,GeoJSONLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(3197)]).then(t.bind(t,15481))).default,GeoRSSLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(9657)]).then(t.bind(t,63201))).default,GroupLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(5613),t.e(6569)]).then(t.bind(t,85989))).default,ImageryLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(7552),t.e(893),t.e(6231),t.e(3892),t.e(9863),t.e(5138),t.e(8434),t.e(9397)]).then(t.bind(t,87772))).default,ImageryTileLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(6231),t.e(3892),t.e(9863),t.e(7373),t.e(5138),t.e(9235),t.e(3500),t.e(1003),t.e(2806),t.e(7870)]).then(t.bind(t,90124))).default,IntegratedMesh3DTilesLayer:async()=>(await Promise.all([t.e(8278),t.e(9953),t.e(6231),t.e(9716),t.e(8325),t.e(9544)]).then(t.bind(t,61528))).default,IntegratedMeshLayer:async()=>(await Promise.all([t.e(8278),t.e(9953),t.e(6231),t.e(9716),t.e(1427),t.e(8325),t.e(7464)]).then(t.bind(t,74660))).default,KMLLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(6847)]).then(t.bind(t,162))).default,KnowledgeGraphLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(993),t.e(708),t.e(9696),t.e(2031),t.e(5752),t.e(3892),t.e(217),t.e(3902),t.e(2655),t.e(9153),t.e(8692)]).then(t.bind(t,28692))).default,LineOfSightLayer:async()=>(await Promise.all([t.e(8278),t.e(6231),t.e(4807),t.e(9695)]).then(t.bind(t,49695))).default,LinkChartLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(993),t.e(708),t.e(9696),t.e(2031),t.e(5752),t.e(3892),t.e(217),t.e(3902),t.e(2655),t.e(9153),t.e(3309)]).then(t.bind(t,93309))).default,MapImageLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(4674),t.e(893),t.e(2045),t.e(104)]).then(t.bind(t,7656))).default,MapNotesLayer:async()=>(await Promise.all([t.e(7632),t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(4674),t.e(993),t.e(8589),t.e(7609),t.e(2655),t.e(3290)]).then(t.bind(t,96299))).default,MediaLayer:async()=>(await Promise.all([t.e(7632),t.e(8278),t.e(7865),t.e(2031),t.e(7433),t.e(2491)]).then(t.bind(t,90182))).default,OGCFeatureLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(708),t.e(3077),t.e(5594)]).then(t.bind(t,65977))).default,OpenStreetMapLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(7269),t.e(349)]).then(t.bind(t,40349))).default,OrientedImageryLayer:async()=>(await Promise.all([t.e(7632),t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(4674),t.e(993),t.e(8589),t.e(7609),t.e(2293),t.e(8568)]).then(t.bind(t,16852))).default,ParquetLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(9953),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(4599)]).then(t.bind(t,62167))).default,PointCloudLayer:async()=>(await Promise.all([t.e(8278),t.e(2869),t.e(6231),t.e(7984),t.e(241)]).then(t.bind(t,77885))).default,RouteLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(217),t.e(524)]).then(t.bind(t,39622))).default,SceneLayer:async()=>(await Promise.all([t.e(8278),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(6231),t.e(7005),t.e(3077),t.e(7261),t.e(1427),t.e(2942),t.e(2569)]).then(t.bind(t,2e4))).default,StreamLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(6938),t.e(6111)]).then(t.bind(t,79457))).default,SubtypeGroupLayer:async()=>(await Promise.all([t.e(7632),t.e(8278),t.e(7865),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(7552),t.e(8399),t.e(4674),t.e(993),t.e(7609),t.e(3892),t.e(8575)]).then(t.bind(t,97483))).default,TileLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(4674),t.e(893),t.e(9186),t.e(2045),t.e(2746)]).then(t.bind(t,71756))).default,UnknownLayer:async()=>(await t.e(146).then(t.bind(t,146))).default,UnsupportedLayer:async()=>(await t.e(5165).then(t.bind(t,45165))).default,VectorTileLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(9186),t.e(8447),t.e(5013),t.e(8260)]).then(t.bind(t,48757))).default,VideoLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(3910),t.e(821),t.e(4674),t.e(3892),t.e(7433),t.e(841)]).then(t.bind(t,86875))).default,ViewshedLayer:async()=>(await Promise.all([t.e(8278),t.e(6231),t.e(4807),t.e(6650)]).then(t.bind(t,96650))).default,VoxelLayer:async()=>(await Promise.all([t.e(8278),t.e(2869),t.e(4273)]).then(t.bind(t,21005))).default,WCSLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(3892),t.e(9863),t.e(7373),t.e(5138),t.e(9235),t.e(3500),t.e(2806),t.e(3661)]).then(t.bind(t,20521))).default,WFSLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(708),t.e(8216)]).then(t.bind(t,21901))).default,WMSLayer:async()=>(await Promise.all([t.e(7632),t.e(8278),t.e(7865),t.e(6554),t.e(2869),t.e(3910),t.e(6705)]).then(t.bind(t,51904))).default,WMTSLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(7269),t.e(309)]).then(t.bind(t,20309))).default,WebTileLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(7269)]).then(t.bind(t,47314))).default}},7861(e,a,t){t.d(a,{L:()=>r});var n=t(11254);async function r(e,a){return(await(0,n.A)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}})).data}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[909],{92009(e,a,t){t.d(a,{L:()=>u});var n=t(70333),r=t(11254),i=t(49186),l=t(17676),s=t(60694),o=t(20655),y=t(80812);async function u(e,a){const t=(0,s.qg)(e);if(!t)throw new i.A("invalid-url","Invalid scene service url");const u={...a,sceneServerUrl:t.url.path,layerId:t.sublayer??void 0};if(u.sceneLayerItem??=await async function(e){const a=(await c(e)).serviceItemId;if(!a)return null;const t=new y.default({id:a,apiKey:e.apiKey}),i=await async function(e){const a=n.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const t=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,r.A)(t,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,l.QP)(e)}return null}(e);null!=i&&(t.portal=new o.A({url:i}));try{return await t.load({signal:e.signal})}catch(e){return(0,l.QP)(e),null}}(u),null==u.sceneLayerItem)return d(u.sceneServerUrl.replace("/SceneServer","/FeatureServer"),u);const f=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const t=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find(e=>"Feature Service"===e.type)||null;if(!t)return null;const n=new y.default({portal:t.portal,id:t.id});return await n.load(),n}catch(e){return(0,l.QP)(e),null}}(u);if(!f?.url)throw new i.A("related-service-not-found","Could not find feature service through portal item relationship");u.featureServiceItem=f;const m=await d(f.url,u);return m.portalItem=f,m}async function c(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const t=await(0,r.A)(e.sceneServerUrl,a);e.rootDocument=t.data}catch{e.rootDocument={}}return e.rootDocument}async function d(e,a){const t=(0,s.qg)(e);if(!t)throw new i.A("invalid-feature-service-url","Invalid feature service url");const n=t.url.path,l=a.layerId;if(null==l)return{serverUrl:n};const o=c(a),y=a.featureServiceItem?await a.featureServiceItem.fetchData("json"):null,u=(y?.layers?.[0]||y?.tables?.[0])?.customParameters,d=e=>{const t={query:{f:"json",...u},responseType:"json",authMode:e,signal:a.signal};return(0,r.A)(n,t)},f=d("anonymous").catch(()=>d("no-prompt")),[m,w]=await Promise.all([f,o]),h=w?.layers,L=m.data&&m.data.layers;if(!Array.isArray(L))throw new Error("expected layers array");if(Array.isArray(h)){for(let e=0;e<Math.min(h.length,L.length);e++)if(h[e].id===l)return{serverUrl:n,layerId:L[e].id}}else if(null!=l&&l<L.length)return{serverUrl:n,layerId:L[l].id};throw new Error("could not find matching associated sublayer")}},23154(e,a,t){t.d(a,{K:()=>f,Q:()=>l});var n=t(77548),r=t(7861);const i=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer","Dimension Layer","Annotation Layer"]);async function l(e,a){const{loadContext:t,...i}=a||{},l=t?await t.fetchServiceMetadata(e,i):await(0,r.L)(e,i),s=(0,n.G$)();d(l),y(l);const o={serviceJSON:l,preferredHost:s};if((l.currentVersion??0)<10.5)return o;const u=`${(0,n.$x)()??e}/layers`,c=t?await t.fetchServiceMetadata(u,i):await(0,r.L)(u,i);return d(c),y(c),o.layersJSON={layers:c.layers,tables:c.tables},o}function s(e){const{type:a}=e;return!!a&&i.has(a)}function o(e){return"Table"===e.type}function y(e){e.layers=e.layers?.filter(s),e.tables=e.tables?.filter(o)}function u(e){e.type||="Feature Layer"}function c(e){e.type||="Table"}function d(e){e.layers?.forEach(u),e.tables?.forEach(c)}function f(e){switch(e){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer";case"Dimension Layer":return"DimensionFeatureLayer";case"Annotation Layer":return"AnnotationLayer"}return"FeatureLayer"}},2976(e,a,t){t.d(a,{U:()=>n});const n={AnnotationLayer:async()=>(await Promise.all([t.e(7632),t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(4674),t.e(993),t.e(3781),t.e(7609),t.e(8144),t.e(3806)]).then(t.bind(t,26519))).default,BingMapsLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(6684)]).then(t.bind(t,17029))).default,BuildingSceneLayer:async()=>(await Promise.all([t.e(7632),t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(4674),t.e(993),t.e(3781),t.e(7609),t.e(6231),t.e(7005),t.e(3077),t.e(7261),t.e(1427),t.e(2942),t.e(9028)]).then(t.bind(t,82411))).default,CSVLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(4079)]).then(t.bind(t,68695))).default,CatalogLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(4674),t.e(993),t.e(7609),t.e(893),t.e(3636),t.e(9279),t.e(28)]).then(t.bind(t,83508))).default,DimensionFeatureLayer:async()=>(await Promise.all([t.e(7632),t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(4674),t.e(993),t.e(3781),t.e(7609),t.e(5971),t.e(1425)]).then(t.bind(t,58638))).default,DimensionLayer:async()=>(await Promise.all([t.e(8278),t.e(3813)]).then(t.bind(t,71493))).default,ElevationLayer:async()=>(await Promise.all([t.e(8278),t.e(9953),t.e(9186),t.e(8732),t.e(5335)]).then(t.bind(t,38732))).default,FeatureLayer:async()=>(await Promise.all([t.e(7632),t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(4674),t.e(993),t.e(3781),t.e(7609),t.e(9098)]).then(t.bind(t,53781))).default,GaussianSplatLayer:async()=>(await Promise.all([t.e(8278),t.e(6231),t.e(9716),t.e(6475)]).then(t.bind(t,36475))).default,GeoJSONLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(3197)]).then(t.bind(t,15481))).default,GeoRSSLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(9657)]).then(t.bind(t,63201))).default,GroupLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(5613),t.e(6569)]).then(t.bind(t,85989))).default,ImageryLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(7552),t.e(893),t.e(6231),t.e(3892),t.e(9863),t.e(5138),t.e(8434),t.e(9397)]).then(t.bind(t,87772))).default,ImageryTileLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(6231),t.e(3892),t.e(9863),t.e(7373),t.e(5138),t.e(9235),t.e(3500),t.e(1003),t.e(2806),t.e(7870)]).then(t.bind(t,90124))).default,IntegratedMesh3DTilesLayer:async()=>(await Promise.all([t.e(8278),t.e(9953),t.e(6231),t.e(9716),t.e(8325),t.e(9544)]).then(t.bind(t,61528))).default,IntegratedMeshLayer:async()=>(await Promise.all([t.e(8278),t.e(9953),t.e(6231),t.e(9716),t.e(1427),t.e(8325),t.e(7464)]).then(t.bind(t,74660))).default,KMLLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(6847)]).then(t.bind(t,162))).default,KnowledgeGraphLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(993),t.e(708),t.e(9696),t.e(8245),t.e(3892),t.e(217),t.e(3902),t.e(2655),t.e(9153),t.e(8692)]).then(t.bind(t,28692))).default,LineOfSightLayer:async()=>(await Promise.all([t.e(8278),t.e(6231),t.e(4807),t.e(9695)]).then(t.bind(t,49695))).default,LinkChartLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(993),t.e(708),t.e(9696),t.e(8245),t.e(3892),t.e(217),t.e(3902),t.e(2655),t.e(9153),t.e(3309)]).then(t.bind(t,93309))).default,MapImageLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(4674),t.e(893),t.e(2045),t.e(104)]).then(t.bind(t,7656))).default,MapNotesLayer:async()=>(await Promise.all([t.e(7632),t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(4674),t.e(993),t.e(3781),t.e(7609),t.e(2655),t.e(3290)]).then(t.bind(t,96299))).default,MediaLayer:async()=>(await Promise.all([t.e(7632),t.e(8278),t.e(7865),t.e(1670),t.e(2491)]).then(t.bind(t,90182))).default,OGCFeatureLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(708),t.e(3077),t.e(5594)]).then(t.bind(t,65977))).default,OpenStreetMapLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(7269),t.e(349)]).then(t.bind(t,40349))).default,OrientedImageryLayer:async()=>(await Promise.all([t.e(7632),t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(4674),t.e(993),t.e(3781),t.e(7609),t.e(2293),t.e(8568)]).then(t.bind(t,16852))).default,ParquetLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(9953),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(4599)]).then(t.bind(t,62167))).default,PointCloudLayer:async()=>(await Promise.all([t.e(8278),t.e(2869),t.e(6231),t.e(7984),t.e(241)]).then(t.bind(t,77885))).default,RouteLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(217),t.e(524)]).then(t.bind(t,39622))).default,SceneLayer:async()=>(await Promise.all([t.e(8278),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(6231),t.e(7005),t.e(3077),t.e(7261),t.e(1427),t.e(2942),t.e(2569)]).then(t.bind(t,2e4))).default,StreamLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(6938),t.e(6111)]).then(t.bind(t,79457))).default,SubtypeGroupLayer:async()=>(await Promise.all([t.e(7632),t.e(8278),t.e(7865),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(7552),t.e(8399),t.e(4674),t.e(993),t.e(7609),t.e(3892),t.e(8575)]).then(t.bind(t,97483))).default,TileLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(4674),t.e(893),t.e(9186),t.e(2045),t.e(2746)]).then(t.bind(t,71756))).default,UnknownLayer:async()=>(await t.e(146).then(t.bind(t,146))).default,UnsupportedLayer:async()=>(await t.e(5165).then(t.bind(t,45165))).default,VectorTileLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(9186),t.e(8447),t.e(5013),t.e(8260)]).then(t.bind(t,48757))).default,VideoLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(3910),t.e(821),t.e(4674),t.e(3892),t.e(1670),t.e(2274)]).then(t.bind(t,86875))).default,ViewshedLayer:async()=>(await Promise.all([t.e(8278),t.e(6231),t.e(4807),t.e(6650)]).then(t.bind(t,96650))).default,VoxelLayer:async()=>(await Promise.all([t.e(8278),t.e(2869),t.e(4273)]).then(t.bind(t,21005))).default,WCSLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(3892),t.e(9863),t.e(7373),t.e(5138),t.e(9235),t.e(3500),t.e(2806),t.e(3661)]).then(t.bind(t,20521))).default,WFSLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(9953),t.e(6554),t.e(2869),t.e(3910),t.e(821),t.e(1733),t.e(1214),t.e(7552),t.e(8399),t.e(1017),t.e(708),t.e(8216)]).then(t.bind(t,21901))).default,WMSLayer:async()=>(await Promise.all([t.e(7632),t.e(8278),t.e(7865),t.e(6554),t.e(2869),t.e(3910),t.e(6705)]).then(t.bind(t,51904))).default,WMTSLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(7269),t.e(309)]).then(t.bind(t,20309))).default,WebTileLayer:async()=>(await Promise.all([t.e(8278),t.e(7865),t.e(6554),t.e(7269)]).then(t.bind(t,47314))).default}},7861(e,a,t){t.d(a,{L:()=>r});var n=t(11254);async function r(e,a){return(await(0,n.A)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}})).data}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4038],{84038(e,t,s){s.r(t),s.d(t,{exportGLTF:()=>k,modelNameGlb:()=>P,modelNameGltf:()=>D,toBinaryGLTF:()=>G});var i=s(17676),r=s(4576);class n{constructor(){this.copyright="",this.defaultScene=0,this.generator="",this._scenes=[]}addScene(e){if(this._scenes.includes(e))throw new Error("Scene already added");this._scenes.push(e)}removeScene(e){(0,r.TF)(this._scenes,e)}forEachScene(e){this._scenes.forEach(e)}}class a{static{this.HEADER_SIZE=12}static{this.CHUNK_HEADER_SIZE=8}static{this.MAGIC=1179937895}static{this.VERSION=2}constructor(e,t){if(!e)throw new Error("GLB requires a JSON gltf chunk");this._length=a.HEADER_SIZE,this._length+=a.CHUNK_HEADER_SIZE;const s=function(e){return(new TextEncoder).encode(e).buffer}(e);if(this._length+=o(s.byteLength,4),t&&(this._length+=a.CHUNK_HEADER_SIZE,this._length+=t.byteLength,t.byteLength%4))throw new Error("Expected BIN chunk length to be divisible by 4 at this point");this.buffer=new ArrayBuffer(this._length),this._outView=new DataView(this.buffer),this._writeHeader();const i=this._writeChunk(s,12,1313821514,32);t&&this._writeChunk(t,i,5130562)}_writeHeader(){this._outView.setUint32(0,a.MAGIC,!0),this._outView.setUint32(4,a.VERSION,!0),this._outView.setUint32(8,this._length,!0)}_writeChunk(e,t,s,i=0){const r=o(e.byteLength,4);for(this._outView.setUint32(t,r,!0),this._outView.setUint32(t+=4,s,!0),function(e,t,s,i,r){new Uint8Array(e,s,r).set(new Uint8Array(t,0,r),0)}(this._outView.buffer,e,t+=4,0,e.byteLength),t+=e.byteLength;t%4;)i&&this._outView.setUint8(t,i),t++;return t}}function o(e,t){return t*Math.ceil(e/t)}var c=s(40876),h=s(53966),u=s(91869),f=s(34727),l=s(67026),d=s(82534),p=s(35522),m=s(51850),g=s(80882),_=s(72258),w=s(63907);class b{constructor(e,t,s,i,r){this._buffer=e,this._componentType=s,this._dataType=i,this._data=[],this._isFinalized=!1,this._accessorIndex=-1,this._accessorAttribute=null,this._accessorMin=null,this._accessorMax=null,t.bufferViews||(t.bufferViews=[]),this.index=t.bufferViews.length,this._bufferView={buffer:e.index,byteLength:-1,target:r};const n=this._getElementSize();n>=4&&34963!==r&&(this._bufferView.byteStride=n),t.bufferViews.push(this._bufferView),this._numComponentsForDataType=this._calculateNumComponentsForDataType()}push(e){const t=this._data.length;if(this._data.push(e),this._accessorIndex>=0){const s=t%this._numComponentsForDataType,i=this._accessorMin[s];this._accessorMin[s]="number"!=typeof i?e:Math.min(i,e);const r=this._accessorMax[s];this._accessorMax[s]="number"!=typeof r?e:Math.max(r,e)}}get dataSize(){return this._data.length*this._sizeComponentType()}get byteSize(){return e=this.dataSize,4*Math.ceil(e/4);var e}getByteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}get byteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}_createTypedArray(e,t){switch(this._componentType){case w.pe.BYTE:return new Int8Array(e,t);case w.pe.FLOAT:return new Float32Array(e,t);case w.pe.SHORT:return new Int16Array(e,t);case w.pe.UNSIGNED_BYTE:return new Uint8Array(e,t);case w.pe.UNSIGNED_INT:return new Uint32Array(e,t);case w.pe.UNSIGNED_SHORT:return new Uint16Array(e,t)}}writeOutToBuffer(e,t){this._createTypedArray(e,t).set(this._data)}writeAsync(e){if(this._asyncWritePromise)throw new Error("Can't write multiple bufferView values asynchronously");return this._asyncWritePromise=e.then(e=>{const t=new Uint8Array(e);for(let e=0;e<t.length;++e)this._data.push(t[e]);delete this._asyncWritePromise}),this._asyncWritePromise}startAccessor(e){if(this._accessorIndex>=0)throw new Error("Accessor was started without ending the previous one");this._accessorIndex=this._data.length,this._accessorAttribute=e;const t=this._numComponentsForDataType;this._accessorMin=new Array(t),this._accessorMax=new Array(t)}endAccessor(){if(this._accessorIndex<0)throw new Error("An accessor was not started, but was attempted to be ended");const e=this._getElementSize(),t=this._numComponentsForDataType,s=(this._data.length-this._accessorIndex)/t;if(s%1)throw new Error("An accessor was ended with missing component values");for(let e=0;e<this._accessorMin.length;++e)"number"!=typeof this._accessorMin[e]&&(this._accessorMin[e]=0),"number"!=typeof this._accessorMax[e]&&(this._accessorMax[e]=0);const i={byteOffset:e*(this._accessorIndex/t),componentType:this._componentType,count:s,type:this._dataType,min:this._accessorMin,max:this._accessorMax,name:this._accessorAttribute};switch(this._accessorAttribute){case"TEXCOORD_0":case"TEXCOORD_1":case"COLOR_0":case"WEIGHTS_0":switch(this._componentType){case w.pe.UNSIGNED_BYTE:case w.pe.UNSIGNED_SHORT:i.normalized=!0}}return this._accessorIndex=-1,this._accessorAttribute=null,this._accessorMin=null,this._accessorMax=null,i}get finalized(){return this._finalizedPromise?this._finalizedPromise:this._isFinalized?this._finalizedPromise=Promise.resolve():this._finalizedPromise=new Promise(e=>this._finalizedPromiseResolve=e)}async finalize(){const e=this._bufferView,t=this._buffer.getViewFinalizePromises(this);this._asyncWritePromise&&t.push(this._asyncWritePromise),await Promise.allSettled(t),this._isFinalized=!0,e.byteOffset=this.getByteOffset(),e.byteLength=this.dataSize,this._finalizedPromiseResolve&&this._finalizedPromiseResolve()}_getElementSize(){return this._sizeComponentType()*this._numComponentsForDataType}_sizeComponentType(){switch(this._componentType){case w.pe.BYTE:case w.pe.UNSIGNED_BYTE:return 1;case w.pe.SHORT:case w.pe.UNSIGNED_SHORT:return 2;case w.pe.UNSIGNED_INT:case w.pe.FLOAT:return 4}}_calculateNumComponentsForDataType(){switch(this._dataType){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}}class y{constructor(e){this._gltf=e,this._bufferViews=[],this._isFinalized=!1,e.buffers||(e.buffers=[]),this.index=e.buffers.length;const t={byteLength:-1};e.buffers.push(t),this._buffer=t}addBufferView(e,t,s){if(this._finalizePromise)throw new Error("Cannot add buffer view after fiinalizing buffer");const i=new b(this,this._gltf,e,t,s);return this._bufferViews.push(i),i}getByteOffset(e){let t=0;for(const s of this._bufferViews){if(s===e)return t;t+=s.byteSize}throw new Error("Given bufferView was not present in this buffer")}getViewFinalizePromises(e){const t=[];for(const s of this._bufferViews){if(e&&s===e)return t;t.push(s.finalized)}return t}getArrayBuffer(){if(!this._isFinalized)throw new Error("Cannot get ArrayBuffer from Buffer before it is finalized");const e=this._getTotalSize(),t=new ArrayBuffer(e);let s=0;for(const e of this._bufferViews)e.writeOutToBuffer(t,s),s+=e.byteSize;return t}finalize(){if(this._finalizePromise)throw new Error(`Buffer ${this.index} was already finalized`);return this._finalizePromise=Promise.allSettled(this.getViewFinalizePromises()).then(()=>{this._isFinalized=!0;const e=this.getArrayBuffer();this._buffer.byteLength=e.byteLength,this._buffer.uri=e}),this._gltf.extras.promises.push(this._finalizePromise),this._finalizePromise}_getTotalSize(){let e=0;for(const t of this._bufferViews)e+=t.byteSize;return e}}function T(e,t){if(e.components)for(const s of e.components)s.faces&&"smooth"===s.shading&&x(s.faces,t)}function x(e,t){null==t.normal&&(t.normal=new Float32Array(t.position.length));const{position:s,normal:i}=t,r=e.length/3;for(let t=0;t<r;++t){const r=3*e[3*t],n=3*e[3*t+1],a=3*e[3*t+2],o=(0,p.hZ)(A,s[r],s[r+1],s[r+2]),c=(0,p.hZ)(E,s[n],s[n+1],s[n+2]),h=(0,p.hZ)(S,s[a],s[a+1],s[a+2]),u=(0,p.Re)(c,c,o),f=(0,p.Re)(h,h,o),l=(0,p.$A)(u,u,f);i[r]+=l[0],i[r+1]+=l[1],i[r+2]+=l[2],i[n]+=l[0],i[n+1]+=l[1],i[n+2]+=l[2],i[a]+=l[0],i[a+1]+=l[1],i[a+2]+=l[2]}for(let e=0;e<i.length;e+=3)(0,p.hZ)(M,i[e],i[e+1],i[e+2]),(0,p.S8)(M,M),i[e]=M[0],i[e+1]=M[1],i[e+2]=M[2]}const A=(0,m.vt)(),E=(0,m.vt)(),S=(0,m.vt)(),M=(0,m.vt)();var N=s(49186),O=s(84952);async function C(e,t){const s=v(e);if(null==s)throw new N.A("imageToArrayBuffer","Unsupported image type");const r=function(e){if(!(e instanceof HTMLImageElement))return"image/png";const t=e.src;if((0,O.DB)(t)){const e=(0,O.r$)(t);return"image/jpeg"===e?.mediaType?e.mediaType:"image/png"}return/\.png$/i.test(t)?"image/png":/\.(jpg|jpeg)$/i.test(t)?"image/jpeg":"image/png"}(e),n=await new Promise(e=>s.toBlob(e,r));if((0,i.Te)(t),!n)throw new N.A("imageToArrayBuffer","Failed to encode image");const a=await n.arrayBuffer();return(0,i.Te)(t),{data:a,type:r}}function v(e){if(e instanceof HTMLCanvasElement)return e;if(e instanceof HTMLVideoElement)return null;const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const s=t.getContext("2d");return e instanceof HTMLImageElement?s.drawImage(e,0,0,e.width,e.height):e instanceof ImageData&&s.putImageData(e,0,0),t}var I=s(51530);const z=()=>h.A.getLogger("esri.geometry.support.meshUtils.exporters.gltf.gltf");class R{constructor(e,t){this.options=t,this._materialMap=new Array,this._imageMap=new Map,this._textureMap=new Map,this.gltf={asset:{version:"2.0",copyright:e.copyright,generator:e.generator},extras:{output:t.output,binChunkBuffer:null,promises:[]}},this._addScenes(e)}_addScenes(e){this.gltf.scene=e.defaultScene;const t=this.gltf.extras,s=2===t.output.buffer||2===t.output.image;s&&(t.binChunkBuffer=new y(this.gltf)),e.forEachScene(e=>{this._addScene(e)}),s&&t.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const t={};e.name&&(t.name=e.name),e.forEachNode(e=>{t.nodes||(t.nodes=[]),t.nodes.push(...this._addNodes(e))}),this.gltf.scenes.push(t)}_addNodes(e){this.gltf.nodes||(this.gltf.nodes=[]);const t={};e.name&&(t.name=e.name);const s=e.translation;(0,p.t2)(s,m.uY)||(t.translation=(0,m.o8)(s));const i=e.rotation;(0,l.t2)(i,d.zK)||(t.rotation=(0,d.o8)(i));const r=e.scale;(0,p.t2)(r,m.Un)||(t.scale=(0,m.o8)(r));const n=this.gltf.nodes.length;if(this.gltf.nodes.push(t),e.mesh&&e.mesh.vertexAttributes.position){const s=this._createMeshes(e.mesh),i=[n];if(1===s.length)this._addMesh(t,s[0]);else for(const e of s){const t={};this._addMesh(t,e),i.push(this.gltf.nodes.length),this.gltf.nodes.push(t)}return i}return e.forEachNode(e=>{t.children||(t.children=[]),t.children.push(...this._addNodes(e))}),[n]}_addMesh(e,t){this.gltf.meshes??=[];const s=this.gltf.meshes.length;this.gltf.meshes.push(t),e.mesh=s}_createMeshes(e){const t=this.gltf.extras,s=2===t.output.buffer;let i;i=s?t.binChunkBuffer:new y(this.gltf);const r=this.options.origin,n=e.vertexSpace.clone();n.origin=[r.x,r.y,r.z??0];const a=(0,_.UR)({vertexAttributes:e.vertexAttributes,vertexSpace:e.vertexSpace,transform:this.options?.ignoreLocalTransform?null:e.transform,spatialReference:e.spatialReference},n,{targetUnit:this.options.unitConversionDisabled?void 0:"meters"});if(!a)return[];T(e,a),V(a);const{position:o,normal:c,tangent:h}=a,{uv:u,color:f}=e.vertexAttributes,l=i.addBufferView(w.pe.FLOAT,"VEC3",34962);let d,p,m,g;c&&(d=i.addBufferView(w.pe.FLOAT,"VEC3",34962)),u&&(p=i.addBufferView(w.pe.FLOAT,"VEC2",34962)),h&&(m=i.addBufferView(w.pe.FLOAT,"VEC4",34962)),f&&(g=i.addBufferView(w.pe.FLOAT,"VEC4",34962)),l.startAccessor("POSITION"),d&&d.startAccessor("NORMAL"),p&&p.startAccessor("TEXCOORD_0"),m&&m.startAccessor("TANGENT"),g&&g.startAccessor("COLOR_0");const b=a.position.length/3;for(let e=0;e<b;++e)l.push(o[3*e]),l.push(o[3*e+1]),l.push(o[3*e+2]),d&&null!=c&&(d.push(c[3*e]),d.push(c[3*e+1]),d.push(c[3*e+2])),p&&null!=u&&(p.push(u[2*e]),p.push(u[2*e+1])),m&&null!=h&&(m.push(h[4*e]),m.push(h[4*e+1]),m.push(h[4*e+2]),m.push(h[4*e+3])),g&&null!=f&&(g.push(B(f[4*e]/255)),g.push(B(f[4*e+1]/255)),g.push(B(f[4*e+2]/255)),g.push(f[4*e+3]/255));const x=l.endAccessor(),A=this._addAccessor(l.index,x);let E,S,M,N,O;if(d){const e=d.endAccessor();E=this._addAccessor(d.index,e)}if(p){const e=p.endAccessor();S=this._addAccessor(p.index,e)}if(m){const e=m.endAccessor();M=this._addAccessor(m.index,e)}if(g){const e=g.endAccessor();N=this._addAccessor(g.index,e)}const C=[];return e.components&&e.components.length>0&&e.components[0].faces?(O=i.addBufferView(w.pe.UNSIGNED_INT,"SCALAR",34963),this._addMeshVertexIndexed(O,e.components,C,A,E,S,M,N)):this._addMeshVertexNonIndexed(e.components,C,A,E,S,M,N),l.finalize(),d?.finalize(),p?.finalize(),m?.finalize(),O?.finalize(),g?.finalize(),s||i.finalize(),C}_addMaterial(e){if(null==e)return;const t=this._materialMap.indexOf(e);if(-1!==t)return t;this.gltf.materials||(this.gltf.materials=[]);const s={};switch(e.alphaMode){case"mask":s.alphaMode="MASK";break;case"auto":case"blend":s.alphaMode="BLEND"}s.alphaCutoff=e.alphaCutoff,e.doubleSided&&(s.doubleSided=e.doubleSided),s.pbrMetallicRoughness={};const i=e=>{const t=e.toRgba();return t[0]=B(t[0]/255),t[1]=B(t[1]/255),t[2]=B(t[2]/255),t};if(null!=e.color&&(s.pbrMetallicRoughness.baseColorFactor=i(e.color)),null!=e.colorTexture&&(s.pbrMetallicRoughness.baseColorTexture=this._createTextureInfo(e.colorTexture,e.colorTextureTransform)),null!=e.normalTexture&&(s.normalTexture=this._createTextureInfo(e.normalTexture,e.normalTextureTransform)),e instanceof g.A){if(null!=e.emissiveTexture&&(s.emissiveTexture=this._createTextureInfo(e.emissiveTexture,e.emissiveTextureTransform)),null!=e.emissiveColor){const t=i(e.emissiveColor);s.emissiveFactor=[t[0],t[1],t[2]]}null!=e.emissiveStrength&&(s.extensions??={},s.extensions.KHR_materials_emissive_strength={emissiveStrength:e.emissiveStrength}),null!=e.occlusionTexture&&(s.occlusionTexture=this._createTextureInfo(e.occlusionTexture,e.occlusionTextureTransform)),null!=e.metallicRoughnessTexture&&(s.pbrMetallicRoughness.metallicRoughnessTexture=this._createTextureInfo(e.metallicRoughnessTexture,e.metallicRoughnessTextureTransform)),s.pbrMetallicRoughness.metallicFactor=e.metallic,s.pbrMetallicRoughness.roughnessFactor=e.roughness}else s.pbrMetallicRoughness.metallicFactor=1,s.pbrMetallicRoughness.roughnessFactor=1,z().warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const r=this.gltf.materials.length;return this.gltf.materials.push(s),this._materialMap.push(e),r}_createTextureInfo(e,t){const s={index:this._addTexture(e)};return t?(s.extensions||(s.extensions={}),s.extensions.KHR_texture_transform={scale:t.scale,offset:t.offset,rotation:(0,f.kU)(t.rotation)},s):s}_addTexture(e){const t=this.gltf.textures??[];return this.gltf.textures=t,(0,u.tE)(this._textureMap,e,()=>{const s={sampler:this._addSampler(e),source:this._addImage(e)},i=t.length;return t.push(s),i})}_addImage(e){const t=this._imageMap.get(e);if(null!=t)return t;this.gltf.images||(this.gltf.images=[]);const s={};if(e.url)s.uri=e.url;else{const t=e.data;s.extras=t;for(let e=0;e<this.gltf.images.length;++e)if(t===this.gltf.images[e].extras)return e;const i=this.gltf.extras;switch(i.output.image){case 2:{const e=i.binChunkBuffer.addBufferView(w.pe.UNSIGNED_BYTE,"SCALAR");if((0,I.x3)(t))null!=t.data&&e.writeOutToBuffer(t.data.buffer,0);else{const r=C(t,this.options.signal).then(({data:e,type:t})=>(s.mimeType=t,e));i.promises.push(e.writeAsync(r).then(()=>e.finalize()))}s.bufferView=e.index;break}case 1:if((0,I.x3)(t)){z().warnOnce("Image export for basis compressed textures not available.");break}s.uri=function(e){const t=v(e);return null!=t?t.toDataURL():""}(t);break;default:if((0,I.x3)(t)){z().warnOnce("Image export for basis compressed textures not available.");break}i.promises.push(C(t,this.options.signal).then(({data:e,type:t})=>{s.uri=e,s.mimeType=t}))}}const i=this.gltf.images.length;return this.gltf.images.push(s),this._imageMap.set(e,i),i}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let t=10497,s=10497;if("string"==typeof e.wrap)switch(e.wrap){case"clamp":t=33071,s=33071;break;case"mirror":t=33648,s=33648}else{switch(e.wrap.vertical){case"clamp":s=33071;break;case"mirror":s=33648}switch(e.wrap.horizontal){case"clamp":t=33071;break;case"mirror":t=33648}}const i={wrapS:t,wrapT:s};for(let e=0;e<this.gltf.samplers.length;++e)if(JSON.stringify(i)===JSON.stringify(this.gltf.samplers[e]))return e;const r=this.gltf.samplers.length;return this.gltf.samplers.push(i),r}_addAccessor(e,t){this.gltf.accessors||(this.gltf.accessors=[]);const s={bufferView:e,byteOffset:t.byteOffset,componentType:t.componentType,count:t.count,type:t.type,min:t.min,max:t.max,name:t.name};t.normalized&&(s.normalized=!0);const i=this.gltf.accessors.length;return this.gltf.accessors.push(s),i}_addMeshVertexIndexed(e,t,s,i,r,n,a,o){const c=new Map;for(const h of t){if(e.startAccessor("INDICES"),h.faces)for(let t=0;t<h.faces.length;++t)e.push(h.faces[t]);const t=e.endAccessor(),u={attributes:{POSITION:i},indices:this._addAccessor(e.index,t),material:this._addMaterial(h.material)};r&&"flat"!==h.shading&&(u.attributes.NORMAL=r),n&&(u.attributes.TEXCOORD_0=n),a&&"flat"!==h.shading&&(u.attributes.TANGENT=a),o&&(u.attributes.COLOR_0=o);const f=c.get(h.name);if(f)f.primitives.push(u);else{const e={name:h.name,primitives:[u]};c.set(h.name,e),s.push(e)}}}_addMeshVertexNonIndexed(e,t,s,i,r,n,a){const o={primitives:[]};t.push(o);const c={attributes:{POSITION:s}};i&&(c.attributes.NORMAL=i),r&&(c.attributes.TEXCOORD_0=r),n&&(c.attributes.TANGENT=n),a&&(c.attributes.COLOR_0=a),e&&(c.material=this._addMaterial(e[0].material)),o.primitives.push(c)}}function V({position:e,normal:t,tangent:s}){L(e,3),L(t,3),L(s,4)}function L(e,t){if(null!=e)for(let s=1,i=2;s<e.length;s+=t,i+=t){const t=e[s],r=e[i];e[s]=r,e[i]=-t}}function B(e){return e**c.Tf}class U{constructor(e){this.mesh=e,this.name="",this.translation=(0,m.vt)(),this.rotation=(0,d.vt)(),this.scale=(0,m.o8)(m.Un),this._nodes=[]}addNode(e){if(this._nodes.includes(e))throw new Error("Node already added");this._nodes.push(e)}forEachNode(e){this._nodes.forEach(e)}set rotationAngles(e){(0,l.A6)(this.rotation,e[0],e[1],e[2])}}class F{constructor(){this.name="",this._nodes=[]}addNode(e){if(this._nodes.includes(e))throw new Error("Node already added");this._nodes.push(e)}forEachNode(e){this._nodes.forEach(e)}}const D="model.gltf",P="model.glb";async function k(e,t){const s=new R(e,t).gltf,r=s.extras.promises;let n=1,o=1,c=null;await Promise.allSettled(r),(0,i.Te)(t.signal);const h=t.jsonSpacing??4,u=new Map,f=JSON.stringify(s,(e,s)=>{if("extras"!==e){if(s instanceof ArrayBuffer){if(function(e){if(e.byteLength<8)return!1;const t=new Uint8Array(e);return 137===t[0]&&80===t[1]&&78===t[2]&&71===t[3]&&13===t[4]&&10===t[5]&&26===t[6]&&10===t[7]}(s))switch(t.output?.image){case 1:case 2:break;default:{const e=`img${o}.png`;return o++,u.set(e,s),e}}switch(t.output?.buffer){case 1:return function(e){const t=[],s=new Uint8Array(e);for(let e=0;e<s.length;e++)t.push(String.fromCharCode(s[e]));return"data:application/octet-stream;base64,"+btoa(t.join(""))}(s);case 2:if(c)throw new Error("Already encountered an ArrayBuffer, there should only be one in the GLB format.");return void(c=s);default:{const e=`data${n}.bin`;return n++,u.set(e,s),e}}}return s}},h);return 2===t.output?.buffer||2===t.output?.image?u.set(P,new a(f,c).buffer):u.set(D,f),u}async function G(e,t){const s=new n,i=new F;return s.addScene(i),i.addNode(new U(e)),await async function(e,t){const s=(await k(e,{output:{buffer:2,image:2},jsonSpacing:0,...t})).get(P);if(!(s&&s instanceof ArrayBuffer))throw new Error("failed to export to glb");return s}(s,{origin:e.origin,...t})}},51530(e,t,s){s.d(t,{KB:()=>a,Xi:()=>r,pn:()=>o,x3:()=>n});var i=s(44208);class r{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function n(e){return"encoded-mesh-texture"===e?.type}async function a(e){const t=new Blob([e]),s=await t.text();return JSON.parse(s)}async function o(e,t){if("image/ktx2"===t)return new r(e);const s=new Blob([e],{type:t});let n=URL.createObjectURL(s);switch(t){case"image/jpeg":n+="#.jpg";break;case"image/png":n+="#.png"}const a=new Image;if((0,i.A)("esri-iPhone"))return new Promise((e,t)=>{const s=()=>{r(),e(a)},i=e=>{r(),t(e)},r=()=>{URL.revokeObjectURL(n),a.removeEventListener("load",s),a.removeEventListener("error",i)};a.addEventListener("load",s),a.addEventListener("error",i),a.src=n});try{a.src=n,await a.decode()}catch(e){console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(n),a}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4038],{84038(e,t,s){s.r(t),s.d(t,{exportGLTF:()=>k,modelNameGlb:()=>P,modelNameGltf:()=>D,toBinaryGLTF:()=>G});var i=s(17676),r=s(4576);class n{constructor(){this.copyright="",this.defaultScene=0,this.generator="",this._scenes=[]}addScene(e){if(this._scenes.includes(e))throw new Error("Scene already added");this._scenes.push(e)}removeScene(e){(0,r.TF)(this._scenes,e)}forEachScene(e){this._scenes.forEach(e)}}class a{static{this.HEADER_SIZE=12}static{this.CHUNK_HEADER_SIZE=8}static{this.MAGIC=1179937895}static{this.VERSION=2}constructor(e,t){if(!e)throw new Error("GLB requires a JSON gltf chunk");this._length=a.HEADER_SIZE,this._length+=a.CHUNK_HEADER_SIZE;const s=function(e){return(new TextEncoder).encode(e).buffer}(e);if(this._length+=o(s.byteLength,4),t&&(this._length+=a.CHUNK_HEADER_SIZE,this._length+=t.byteLength,t.byteLength%4))throw new Error("Expected BIN chunk length to be divisible by 4 at this point");this.buffer=new ArrayBuffer(this._length),this._outView=new DataView(this.buffer),this._writeHeader();const i=this._writeChunk(s,12,1313821514,32);t&&this._writeChunk(t,i,5130562)}_writeHeader(){this._outView.setUint32(0,a.MAGIC,!0),this._outView.setUint32(4,a.VERSION,!0),this._outView.setUint32(8,this._length,!0)}_writeChunk(e,t,s,i=0){const r=o(e.byteLength,4);for(this._outView.setUint32(t,r,!0),this._outView.setUint32(t+=4,s,!0),function(e,t,s,i,r){new Uint8Array(e,s,r).set(new Uint8Array(t,0,r),0)}(this._outView.buffer,e,t+=4,0,e.byteLength),t+=e.byteLength;t%4;)i&&this._outView.setUint8(t,i),t++;return t}}function o(e,t){return t*Math.ceil(e/t)}var c=s(40876),h=s(53966),u=s(91869),f=s(34727),l=s(67026),d=s(82534),p=s(35522),m=s(51850),g=s(80882),_=s(72258),w=s(63907);class b{constructor(e,t,s,i,r){this._buffer=e,this._componentType=s,this._dataType=i,this._data=[],this._isFinalized=!1,this._accessorIndex=-1,this._accessorAttribute=null,this._accessorMin=null,this._accessorMax=null,t.bufferViews||(t.bufferViews=[]),this.index=t.bufferViews.length,this._bufferView={buffer:e.index,byteLength:-1,target:r};const n=this._getElementSize();n>=4&&34963!==r&&(this._bufferView.byteStride=n),t.bufferViews.push(this._bufferView),this._numComponentsForDataType=this._calculateNumComponentsForDataType()}push(e){const t=this._data.length;if(this._data.push(e),this._accessorIndex>=0){const s=t%this._numComponentsForDataType,i=this._accessorMin[s];this._accessorMin[s]="number"!=typeof i?e:Math.min(i,e);const r=this._accessorMax[s];this._accessorMax[s]="number"!=typeof r?e:Math.max(r,e)}}get dataSize(){return this._data.length*this._sizeComponentType()}get byteSize(){return e=this.dataSize,4*Math.ceil(e/4);var e}getByteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}get byteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}_createTypedArray(e,t){switch(this._componentType){case w.pe.BYTE:return new Int8Array(e,t);case w.pe.FLOAT:return new Float32Array(e,t);case w.pe.SHORT:return new Int16Array(e,t);case w.pe.UNSIGNED_BYTE:return new Uint8Array(e,t);case w.pe.UNSIGNED_INT:return new Uint32Array(e,t);case w.pe.UNSIGNED_SHORT:return new Uint16Array(e,t)}}writeOutToBuffer(e,t){this._createTypedArray(e,t).set(this._data)}writeAsync(e){if(this._asyncWritePromise)throw new Error("Can't write multiple bufferView values asynchronously");return this._asyncWritePromise=e.then(e=>{const t=new Uint8Array(e);for(let e=0;e<t.length;++e)this._data.push(t[e]);delete this._asyncWritePromise}),this._asyncWritePromise}startAccessor(e){if(this._accessorIndex>=0)throw new Error("Accessor was started without ending the previous one");this._accessorIndex=this._data.length,this._accessorAttribute=e;const t=this._numComponentsForDataType;this._accessorMin=new Array(t),this._accessorMax=new Array(t)}endAccessor(){if(this._accessorIndex<0)throw new Error("An accessor was not started, but was attempted to be ended");const e=this._getElementSize(),t=this._numComponentsForDataType,s=(this._data.length-this._accessorIndex)/t;if(s%1)throw new Error("An accessor was ended with missing component values");for(let e=0;e<this._accessorMin.length;++e)"number"!=typeof this._accessorMin[e]&&(this._accessorMin[e]=0),"number"!=typeof this._accessorMax[e]&&(this._accessorMax[e]=0);const i={byteOffset:e*(this._accessorIndex/t),componentType:this._componentType,count:s,type:this._dataType,min:this._accessorMin,max:this._accessorMax,name:this._accessorAttribute};switch(this._accessorAttribute){case"TEXCOORD_0":case"TEXCOORD_1":case"COLOR_0":case"WEIGHTS_0":switch(this._componentType){case w.pe.UNSIGNED_BYTE:case w.pe.UNSIGNED_SHORT:i.normalized=!0}}return this._accessorIndex=-1,this._accessorAttribute=null,this._accessorMin=null,this._accessorMax=null,i}get finalized(){return this._finalizedPromise?this._finalizedPromise:this._isFinalized?this._finalizedPromise=Promise.resolve():this._finalizedPromise=new Promise(e=>this._finalizedPromiseResolve=e)}async finalize(){const e=this._bufferView,t=this._buffer.getViewFinalizePromises(this);this._asyncWritePromise&&t.push(this._asyncWritePromise),await Promise.allSettled(t),this._isFinalized=!0,e.byteOffset=this.getByteOffset(),e.byteLength=this.dataSize,this._finalizedPromiseResolve&&this._finalizedPromiseResolve()}_getElementSize(){return this._sizeComponentType()*this._numComponentsForDataType}_sizeComponentType(){switch(this._componentType){case w.pe.BYTE:case w.pe.UNSIGNED_BYTE:return 1;case w.pe.SHORT:case w.pe.UNSIGNED_SHORT:return 2;case w.pe.UNSIGNED_INT:case w.pe.FLOAT:return 4}}_calculateNumComponentsForDataType(){switch(this._dataType){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}}class y{constructor(e){this._gltf=e,this._bufferViews=[],this._isFinalized=!1,e.buffers||(e.buffers=[]),this.index=e.buffers.length;const t={byteLength:-1};e.buffers.push(t),this._buffer=t}addBufferView(e,t,s){if(this._finalizePromise)throw new Error("Cannot add buffer view after fiinalizing buffer");const i=new b(this,this._gltf,e,t,s);return this._bufferViews.push(i),i}getByteOffset(e){let t=0;for(const s of this._bufferViews){if(s===e)return t;t+=s.byteSize}throw new Error("Given bufferView was not present in this buffer")}getViewFinalizePromises(e){const t=[];for(const s of this._bufferViews){if(e&&s===e)return t;t.push(s.finalized)}return t}getArrayBuffer(){if(!this._isFinalized)throw new Error("Cannot get ArrayBuffer from Buffer before it is finalized");const e=this._getTotalSize(),t=new ArrayBuffer(e);let s=0;for(const e of this._bufferViews)e.writeOutToBuffer(t,s),s+=e.byteSize;return t}finalize(){if(this._finalizePromise)throw new Error(`Buffer ${this.index} was already finalized`);return this._finalizePromise=Promise.allSettled(this.getViewFinalizePromises()).then(()=>{this._isFinalized=!0;const e=this.getArrayBuffer();this._buffer.byteLength=e.byteLength,this._buffer.uri=e}),this._gltf.extras.promises.push(this._finalizePromise),this._finalizePromise}_getTotalSize(){let e=0;for(const t of this._bufferViews)e+=t.byteSize;return e}}function T(e,t){if(e.components)for(const s of e.components)s.faces&&"smooth"===s.shading&&x(s.faces,t)}function x(e,t){null==t.normal&&(t.normal=new Float32Array(t.position.length));const{position:s,normal:i}=t,r=e.length/3;for(let t=0;t<r;++t){const r=3*e[3*t],n=3*e[3*t+1],a=3*e[3*t+2],o=(0,p.hZ)(A,s[r],s[r+1],s[r+2]),c=(0,p.hZ)(E,s[n],s[n+1],s[n+2]),h=(0,p.hZ)(S,s[a],s[a+1],s[a+2]),u=(0,p.Re)(c,c,o),f=(0,p.Re)(h,h,o),l=(0,p.$A)(u,u,f);i[r]+=l[0],i[r+1]+=l[1],i[r+2]+=l[2],i[n]+=l[0],i[n+1]+=l[1],i[n+2]+=l[2],i[a]+=l[0],i[a+1]+=l[1],i[a+2]+=l[2]}for(let e=0;e<i.length;e+=3)(0,p.hZ)(M,i[e],i[e+1],i[e+2]),(0,p.S8)(M,M),i[e]=M[0],i[e+1]=M[1],i[e+2]=M[2]}const A=(0,m.vt)(),E=(0,m.vt)(),S=(0,m.vt)(),M=(0,m.vt)();var N=s(49186),O=s(84952);async function C(e,t){const s=v(e);if(null==s)throw new N.A("imageToArrayBuffer","Unsupported image type");const r=function(e){if(!(e instanceof HTMLImageElement))return"image/png";const t=e.src;if((0,O.DB)(t)){const e=(0,O.r$)(t);return"image/jpeg"===e?.mediaType?e.mediaType:"image/png"}return/\.png$/i.test(t)?"image/png":/\.(jpg|jpeg)$/i.test(t)?"image/jpeg":"image/png"}(e),n=await new Promise(e=>s.toBlob(e,r));if((0,i.Te)(t),!n)throw new N.A("imageToArrayBuffer","Failed to encode image");const a=await n.arrayBuffer();return(0,i.Te)(t),{data:a,type:r}}function v(e){if(e instanceof HTMLCanvasElement)return e;if(e instanceof HTMLVideoElement)return null;const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const s=t.getContext("2d");return e instanceof HTMLImageElement?s.drawImage(e,0,0,e.width,e.height):e instanceof ImageData&&s.putImageData(e,0,0),t}var z=s(51530);const I=()=>h.A.getLogger("esri.geometry.support.meshUtils.exporters.gltf.gltf");class R{constructor(e,t){this.options=t,this._materialMap=new Array,this._imageMap=new Map,this._textureMap=new Map,this.gltf={asset:{version:"2.0",copyright:e.copyright,generator:e.generator},extras:{output:t.output,binChunkBuffer:null,promises:[]}},this._addScenes(e)}_addScenes(e){this.gltf.scene=e.defaultScene;const t=this.gltf.extras,s=2===t.output.buffer||2===t.output.image;s&&(t.binChunkBuffer=new y(this.gltf)),e.forEachScene(e=>{this._addScene(e)}),s&&t.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const t={};e.name&&(t.name=e.name),e.forEachNode(e=>{t.nodes||(t.nodes=[]),t.nodes.push(...this._addNodes(e))}),this.gltf.scenes.push(t)}_addNodes(e){this.gltf.nodes||(this.gltf.nodes=[]);const t={};e.name&&(t.name=e.name);const s=e.translation;(0,p.t2)(s,m.uY)||(t.translation=(0,m.o8)(s));const i=e.rotation;(0,l.t2)(i,d.zK)||(t.rotation=(0,d.o8)(i));const r=e.scale;(0,p.t2)(r,m.Un)||(t.scale=(0,m.o8)(r));const n=this.gltf.nodes.length;if(this.gltf.nodes.push(t),e.mesh&&e.mesh.vertexAttributes.position){const s=this._createMeshes(e.mesh),i=[n];if(1===s.length)this._addMesh(t,s[0]);else for(const e of s){const t={};this._addMesh(t,e),i.push(this.gltf.nodes.length),this.gltf.nodes.push(t)}return i}return e.forEachNode(e=>{t.children||(t.children=[]),t.children.push(...this._addNodes(e))}),[n]}_addMesh(e,t){this.gltf.meshes??=[];const s=this.gltf.meshes.length;this.gltf.meshes.push(t),e.mesh=s}_createMeshes(e){const t=this.gltf.extras,s=2===t.output.buffer;let i;i=s?t.binChunkBuffer:new y(this.gltf);const r=this.options.origin,n=e.vertexSpace.clone();n.origin=[r.x,r.y,r.z??0];const a=(0,_.UR)({vertexAttributes:e.vertexAttributes,vertexSpace:e.vertexSpace,transform:this.options?.ignoreLocalTransform?null:e.transform,spatialReference:e.spatialReference},n,{targetUnit:this.options.unitConversionDisabled?void 0:"meters"});if(!a)return[];T(e,a),V(a);const{position:o,normal:c,tangent:h}=a,{uv:u,color:f}=e.vertexAttributes,l=i.addBufferView(w.pe.FLOAT,"VEC3",34962);let d,p,m,g;c&&(d=i.addBufferView(w.pe.FLOAT,"VEC3",34962)),u&&(p=i.addBufferView(w.pe.FLOAT,"VEC2",34962)),h&&(m=i.addBufferView(w.pe.FLOAT,"VEC4",34962)),f&&(g=i.addBufferView(w.pe.FLOAT,"VEC4",34962)),l.startAccessor("POSITION"),d&&d.startAccessor("NORMAL"),p&&p.startAccessor("TEXCOORD_0"),m&&m.startAccessor("TANGENT"),g&&g.startAccessor("COLOR_0");const b=a.position.length/3;for(let e=0;e<b;++e)l.push(o[3*e]),l.push(o[3*e+1]),l.push(o[3*e+2]),d&&null!=c&&(d.push(c[3*e]),d.push(c[3*e+1]),d.push(c[3*e+2])),p&&null!=u&&(p.push(u[2*e]),p.push(u[2*e+1])),m&&null!=h&&(m.push(h[4*e]),m.push(h[4*e+1]),m.push(h[4*e+2]),m.push(h[4*e+3])),g&&null!=f&&(g.push(L(f[4*e]/255)),g.push(L(f[4*e+1]/255)),g.push(L(f[4*e+2]/255)),g.push(f[4*e+3]/255));const x=l.endAccessor(),A=this._addAccessor(l.index,x);let E,S,M,N,O;if(d){const e=d.endAccessor();E=this._addAccessor(d.index,e)}if(p){const e=p.endAccessor();S=this._addAccessor(p.index,e)}if(m){const e=m.endAccessor();M=this._addAccessor(m.index,e)}if(g){const e=g.endAccessor();N=this._addAccessor(g.index,e)}const C=[];return e.components&&e.components.length>0&&e.components[0].faces?(O=i.addBufferView(w.pe.UNSIGNED_INT,"SCALAR",34963),this._addMeshVertexIndexed(O,e.components,C,A,E,S,M,N)):this._addMeshVertexNonIndexed(e.components,C,A,E,S,M,N),l.finalize(),d?.finalize(),p?.finalize(),m?.finalize(),O?.finalize(),g?.finalize(),s||i.finalize(),C}_addMaterial(e){if(null==e)return;const t=this._materialMap.indexOf(e);if(-1!==t)return t;this.gltf.materials||(this.gltf.materials=[]);const s={};switch(e.alphaMode){case"mask":s.alphaMode="MASK";break;case"auto":case"blend":s.alphaMode="BLEND"}s.alphaCutoff=e.alphaCutoff,e.doubleSided&&(s.doubleSided=e.doubleSided),s.pbrMetallicRoughness={};const i=e=>{const t=e.toRgba();return t[0]=L(t[0]/255),t[1]=L(t[1]/255),t[2]=L(t[2]/255),t};if(null!=e.color&&(s.pbrMetallicRoughness.baseColorFactor=i(e.color)),null!=e.colorTexture&&(s.pbrMetallicRoughness.baseColorTexture=this._createTextureInfo(e.colorTexture,e.colorTextureTransform)),null!=e.normalTexture&&(s.normalTexture=this._createTextureInfo(e.normalTexture,e.normalTextureTransform)),e instanceof g.A){if(null!=e.emissiveTexture&&(s.emissiveTexture=this._createTextureInfo(e.emissiveTexture,e.emissiveTextureTransform)),null!=e.emissiveColor){const t=i(e.emissiveColor);s.emissiveFactor=[t[0],t[1],t[2]]}null!=e.emissiveStrength&&(s.extensions??={},s.extensions.KHR_materials_emissive_strength={emissiveStrength:e.emissiveStrength}),null!=e.occlusionTexture&&(s.occlusionTexture=this._createTextureInfo(e.occlusionTexture,e.occlusionTextureTransform)),null!=e.metallicRoughnessTexture&&(s.pbrMetallicRoughness.metallicRoughnessTexture=this._createTextureInfo(e.metallicRoughnessTexture,e.metallicRoughnessTextureTransform)),s.pbrMetallicRoughness.metallicFactor=e.metallic,s.pbrMetallicRoughness.roughnessFactor=e.roughness}else s.pbrMetallicRoughness.metallicFactor=1,s.pbrMetallicRoughness.roughnessFactor=1,I().warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const r=this.gltf.materials.length;return this.gltf.materials.push(s),this._materialMap.push(e),r}_createTextureInfo(e,t){const s={index:this._addTexture(e)};return t?(s.extensions||(s.extensions={}),s.extensions.KHR_texture_transform={scale:t.scale,offset:t.offset,rotation:(0,f.kU)(t.rotation)},s):s}_addTexture(e){const t=this.gltf.textures??[];return this.gltf.textures=t,(0,u.tE)(this._textureMap,e,()=>{const s={sampler:this._addSampler(e),source:this._addImage(e)},i=t.length;return t.push(s),i})}_addImage(e){const t=this._imageMap.get(e);if(null!=t)return t;this.gltf.images||(this.gltf.images=[]);const s={};if(e.url)s.uri=e.url;else{const t=e.data;s.extras=t;for(let e=0;e<this.gltf.images.length;++e)if(t===this.gltf.images[e].extras)return e;const i=this.gltf.extras;switch(i.output.image){case 2:{const e=i.binChunkBuffer.addBufferView(w.pe.UNSIGNED_BYTE,"SCALAR");if((0,z.x3)(t))null!=t.data&&e.writeOutToBuffer(t.data.buffer,0);else{const r=C(t,this.options.signal).then(({data:e,type:t})=>(s.mimeType=t,e));i.promises.push(e.writeAsync(r).then(()=>e.finalize()))}s.bufferView=e.index;break}case 1:if((0,z.x3)(t)){I().warnOnce("Image export for basis compressed textures not available.");break}s.uri=function(e){const t=v(e);return null!=t?t.toDataURL():""}(t);break;default:if((0,z.x3)(t)){I().warnOnce("Image export for basis compressed textures not available.");break}i.promises.push(C(t,this.options.signal).then(({data:e,type:t})=>{s.uri=e,s.mimeType=t}))}}const i=this.gltf.images.length;return this.gltf.images.push(s),this._imageMap.set(e,i),i}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let t=10497,s=10497;if("string"==typeof e.wrap)switch(e.wrap){case"clamp":t=33071,s=33071;break;case"mirror":t=33648,s=33648}else{switch(e.wrap.vertical){case"clamp":s=33071;break;case"mirror":s=33648}switch(e.wrap.horizontal){case"clamp":t=33071;break;case"mirror":t=33648}}const i={wrapS:t,wrapT:s};for(let e=0;e<this.gltf.samplers.length;++e)if(JSON.stringify(i)===JSON.stringify(this.gltf.samplers[e]))return e;const r=this.gltf.samplers.length;return this.gltf.samplers.push(i),r}_addAccessor(e,t){this.gltf.accessors||(this.gltf.accessors=[]);const s={bufferView:e,byteOffset:t.byteOffset,componentType:t.componentType,count:t.count,type:t.type,min:t.min,max:t.max,name:t.name};t.normalized&&(s.normalized=!0);const i=this.gltf.accessors.length;return this.gltf.accessors.push(s),i}_addMeshVertexIndexed(e,t,s,i,r,n,a,o){const c=new Map;for(const h of t){if(e.startAccessor("INDICES"),h.faces)for(let t=0;t<h.faces.length;++t)e.push(h.faces[t]);const t=e.endAccessor(),u={attributes:{POSITION:i},indices:this._addAccessor(e.index,t),material:this._addMaterial(h.material)};r&&"flat"!==h.shading&&(u.attributes.NORMAL=r),n&&(u.attributes.TEXCOORD_0=n),a&&"flat"!==h.shading&&(u.attributes.TANGENT=a),o&&(u.attributes.COLOR_0=o);const f=c.get(h.name);if(f)f.primitives.push(u);else{const e={name:h.name,primitives:[u]};c.set(h.name,e),s.push(e)}}}_addMeshVertexNonIndexed(e,t,s,i,r,n,a){const o={primitives:[]};t.push(o);const c={attributes:{POSITION:s}};i&&(c.attributes.NORMAL=i),r&&(c.attributes.TEXCOORD_0=r),n&&(c.attributes.TANGENT=n),a&&(c.attributes.COLOR_0=a),e&&(c.material=this._addMaterial(e[0].material)),o.primitives.push(c)}}function V({position:e,normal:t,tangent:s}){B(e,3),B(t,3),B(s,4)}function B(e,t){if(null!=e)for(let s=1,i=2;s<e.length;s+=t,i+=t){const t=e[s],r=e[i];e[s]=r,e[i]=-t}}function L(e){return e**c.Tf}class U{constructor(e){this.mesh=e,this.name="",this.translation=(0,m.vt)(),this.rotation=(0,d.vt)(),this.scale=(0,m.o8)(m.Un),this._nodes=[]}addNode(e){if(this._nodes.includes(e))throw new Error("Node already added");this._nodes.push(e)}forEachNode(e){this._nodes.forEach(e)}set rotationAngles(e){(0,l.A6)(this.rotation,e[0],e[1],e[2])}}class F{constructor(){this.name="",this._nodes=[]}addNode(e){if(this._nodes.includes(e))throw new Error("Node already added");this._nodes.push(e)}forEachNode(e){this._nodes.forEach(e)}}const D="model.gltf",P="model.glb";async function k(e,t){const s=new R(e,t).gltf,r=s.extras.promises;let n=1,o=1,c=null;await Promise.allSettled(r),(0,i.Te)(t.signal);const h=t.jsonSpacing??4,u=new Map,f=JSON.stringify(s,(e,s)=>{if("extras"!==e){if(s instanceof ArrayBuffer){if(function(e){if(e.byteLength<8)return!1;const t=new Uint8Array(e);return 137===t[0]&&80===t[1]&&78===t[2]&&71===t[3]&&13===t[4]&&10===t[5]&&26===t[6]&&10===t[7]}(s))switch(t.output?.image){case 1:case 2:break;default:{const e=`img${o}.png`;return o++,u.set(e,s),e}}switch(t.output?.buffer){case 1:return function(e){const t=[],s=new Uint8Array(e);for(let e=0;e<s.length;e++)t.push(String.fromCharCode(s[e]));return"data:application/octet-stream;base64,"+btoa(t.join(""))}(s);case 2:if(c)throw new Error("Already encountered an ArrayBuffer, there should only be one in the GLB format.");return void(c=s);default:{const e=`data${n}.bin`;return n++,u.set(e,s),e}}}return s}},h);return 2===t.output?.buffer||2===t.output?.image?u.set(P,new a(f,c).buffer):u.set(D,f),u}async function G(e,t){const s=new n,i=new F;return s.addScene(i),i.addNode(new U(e)),await async function(e,t){const s=(await k(e,{output:{buffer:2,image:2},jsonSpacing:0,...t})).get(P);if(!(s&&s instanceof ArrayBuffer))throw new Error("failed to export to glb");return s}(s,{origin:e.origin,...t})}},51530(e,t,s){s.d(t,{KB:()=>a,Xi:()=>r,pn:()=>o,x3:()=>n});var i=s(44208);class r{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function n(e){return"encoded-mesh-texture"===e?.type}async function a(e){const t=new Blob([e]),s=await t.text();return JSON.parse(s)}async function o(e,t){if("image/ktx2"===t)return new r(e);const s=new Blob([e],{type:t});let n=URL.createObjectURL(s);switch(t){case"image/jpeg":n+="#.jpg";break;case"image/png":n+="#.png"}const a=new Image;if((0,i.A)("esri-iPhone"))return new Promise((e,t)=>{const s=()=>{r(),e(a)},i=e=>{r(),t(e)},r=()=>{URL.revokeObjectURL(n),a.removeEventListener("load",s),a.removeEventListener("error",i)};a.addEventListener("load",s),a.addEventListener("error",i),a.src=n});try{a.src=n,await a.decode()}catch{}return URL.revokeObjectURL(n),a}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5404],{95404(e,r,t){t.d(r,{computeObjectLayerResourceSize:()=>c}),t(11254);var i=t(49186),n=t(66344),o=t(51850),s=t(70328),l=t(8887);let u=new n.q(50);async function c(e,r=null){if(!e.isPrimitive){const r=e.resource?.href;if(!r)throw new i.A("symbol:invalid-resource","The symbol does not have a valid resource");const n=u.get(r);if(null!=n)return n;const{fetch:l}=await Promise.all([t.e(1843),t.e(7005),t.e(6622),t.e(5647)]).then(t.bind(t,5644)),c=await l(r,{disableTextures:!0,spherical:!0}),a=(0,s.Ej)(c.referenceBoundingBox,(0,o.vt)());return u.put(r,a),a}if(!e.resource?.primitive)throw new i.A("symbol:invalid-resource","The symbol does not have a valid resource");const n=(0,s.vt)((0,l.Fq)(e.resource.primitive));if(null!=r)for(let e=0;e<n.length;e++)n[e]*=r;return(0,s.Ej)(n,(0,o.vt)())}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5404],{95404(e,r,t){t.d(r,{computeObjectLayerResourceSize:()=>c}),t(11254);var i=t(49186),n=t(66344),o=t(51850),s=t(70328),l=t(8887);let u=new n.q(50);async function c(e,r=null){if(!e.isPrimitive){const r=e.resource?.href;if(!r)throw new i.A("symbol:invalid-resource","The symbol does not have a valid resource");const n=u.get(r);if(null!=n)return n;const{fetch:l}=await Promise.all([t.e(1843),t.e(7005),t.e(1653),t.e(5647)]).then(t.bind(t,5644)),c=await l(r,{disableTextures:!0,spherical:!0}),a=(0,s.Ej)(c.referenceBoundingBox,(0,o.vt)());return u.put(r,a),a}if(!e.resource?.primitive)throw new i.A("symbol:invalid-resource","The symbol does not have a valid resource");const n=(0,s.vt)((0,l.Fq)(e.resource.primitive));if(null!=r)for(let e=0;e<n.length;e++)n[e]*=r;return(0,s.Ej)(n,(0,o.vt)())}}}]);