@itwin/core-backend 4.0.0-dev.1 → 4.0.0-dev.100

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 (270) hide show
  1. package/CHANGELOG.md +68 -1
  2. package/lib/cjs/BackendHubAccess.d.ts +226 -224
  3. package/lib/cjs/BackendHubAccess.d.ts.map +1 -1
  4. package/lib/cjs/BackendHubAccess.js +41 -41
  5. package/lib/cjs/BackendHubAccess.js.map +1 -1
  6. package/lib/cjs/BackendLoggerCategory.d.ts +90 -91
  7. package/lib/cjs/BackendLoggerCategory.d.ts.map +1 -1
  8. package/lib/cjs/BackendLoggerCategory.js +98 -99
  9. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  10. package/lib/cjs/BisCoreSchema.d.ts +21 -21
  11. package/lib/cjs/BisCoreSchema.js +60 -60
  12. package/lib/cjs/BlobContainerService.d.ts +120 -0
  13. package/lib/cjs/BlobContainerService.d.ts.map +1 -0
  14. package/lib/cjs/BlobContainerService.js +18 -0
  15. package/lib/cjs/BlobContainerService.js.map +1 -0
  16. package/lib/cjs/BriefcaseManager.d.ts +184 -170
  17. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  18. package/lib/cjs/BriefcaseManager.js +421 -414
  19. package/lib/cjs/BriefcaseManager.js.map +1 -1
  20. package/lib/cjs/Category.d.ts +153 -153
  21. package/lib/cjs/Category.js +243 -243
  22. package/lib/cjs/Category.js.map +1 -1
  23. package/lib/cjs/ChangeSummaryManager.d.ts +187 -187
  24. package/lib/cjs/ChangeSummaryManager.js +444 -445
  25. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  26. package/lib/cjs/ChangedElementsDb.d.ts +99 -99
  27. package/lib/cjs/ChangedElementsDb.js +165 -165
  28. package/lib/cjs/ChangedElementsManager.d.ts +39 -39
  29. package/lib/cjs/ChangedElementsManager.js +88 -88
  30. package/lib/cjs/ChannelControl.d.ts +70 -0
  31. package/lib/cjs/ChannelControl.d.ts.map +1 -0
  32. package/lib/cjs/ChannelControl.js +89 -0
  33. package/lib/cjs/ChannelControl.js.map +1 -0
  34. package/lib/cjs/CheckpointManager.d.ts +121 -121
  35. package/lib/cjs/CheckpointManager.d.ts.map +1 -1
  36. package/lib/cjs/CheckpointManager.js +351 -349
  37. package/lib/cjs/CheckpointManager.js.map +1 -1
  38. package/lib/cjs/ClassRegistry.d.ts +79 -79
  39. package/lib/cjs/ClassRegistry.js +249 -245
  40. package/lib/cjs/ClassRegistry.js.map +1 -1
  41. package/lib/cjs/CloudSqlite.d.ts +572 -350
  42. package/lib/cjs/CloudSqlite.d.ts.map +1 -1
  43. package/lib/cjs/CloudSqlite.js +374 -153
  44. package/lib/cjs/CloudSqlite.js.map +1 -1
  45. package/lib/cjs/CodeService.d.ts +399 -396
  46. package/lib/cjs/CodeService.d.ts.map +1 -1
  47. package/lib/cjs/CodeService.js +63 -63
  48. package/lib/cjs/CodeService.js.map +1 -1
  49. package/lib/cjs/CodeSpecs.d.ts +58 -55
  50. package/lib/cjs/CodeSpecs.d.ts.map +1 -1
  51. package/lib/cjs/CodeSpecs.js +154 -124
  52. package/lib/cjs/CodeSpecs.js.map +1 -1
  53. package/lib/cjs/ConcurrentQuery.d.ts +13 -13
  54. package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
  55. package/lib/cjs/ConcurrentQuery.js +36 -36
  56. package/lib/cjs/CustomViewState3dCreator.d.ts +21 -21
  57. package/lib/cjs/CustomViewState3dCreator.d.ts.map +1 -1
  58. package/lib/cjs/CustomViewState3dCreator.js +80 -81
  59. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  60. package/lib/cjs/DevTools.d.ts +74 -71
  61. package/lib/cjs/DevTools.d.ts.map +1 -1
  62. package/lib/cjs/DevTools.js +156 -154
  63. package/lib/cjs/DevTools.js.map +1 -1
  64. package/lib/cjs/DisplayStyle.d.ts +104 -106
  65. package/lib/cjs/DisplayStyle.d.ts.map +1 -1
  66. package/lib/cjs/DisplayStyle.js +251 -256
  67. package/lib/cjs/DisplayStyle.js.map +1 -1
  68. package/lib/cjs/ECDb.d.ts +194 -191
  69. package/lib/cjs/ECDb.d.ts.map +1 -1
  70. package/lib/cjs/ECDb.js +351 -350
  71. package/lib/cjs/ECDb.js.map +1 -1
  72. package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
  73. package/lib/cjs/ECSchemaXmlContext.d.ts.map +1 -1
  74. package/lib/cjs/ECSchemaXmlContext.js +41 -41
  75. package/lib/cjs/ECSqlStatement.d.ts +473 -473
  76. package/lib/cjs/ECSqlStatement.js +791 -791
  77. package/lib/cjs/Element.d.ts +1105 -1109
  78. package/lib/cjs/Element.d.ts.map +1 -1
  79. package/lib/cjs/Element.js +1416 -1427
  80. package/lib/cjs/Element.js.map +1 -1
  81. package/lib/cjs/ElementAspect.d.ts +175 -179
  82. package/lib/cjs/ElementAspect.d.ts.map +1 -1
  83. package/lib/cjs/ElementAspect.js +202 -211
  84. package/lib/cjs/ElementAspect.js.map +1 -1
  85. package/lib/cjs/ElementGraphics.d.ts +9 -9
  86. package/lib/cjs/ElementGraphics.js +41 -41
  87. package/lib/cjs/ElementGraphics.js.map +1 -1
  88. package/lib/cjs/ElementTreeWalker.d.ts +162 -162
  89. package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
  90. package/lib/cjs/ElementTreeWalker.js +409 -409
  91. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  92. package/lib/cjs/Entity.d.ts +102 -106
  93. package/lib/cjs/Entity.d.ts.map +1 -1
  94. package/lib/cjs/Entity.js +118 -134
  95. package/lib/cjs/Entity.js.map +1 -1
  96. package/lib/cjs/EntityReferences.d.ts +49 -49
  97. package/lib/cjs/EntityReferences.d.ts.map +1 -1
  98. package/lib/cjs/EntityReferences.js +95 -95
  99. package/lib/cjs/ExportGraphics.d.ts +317 -317
  100. package/lib/cjs/ExportGraphics.d.ts.map +1 -1
  101. package/lib/cjs/ExportGraphics.js +208 -208
  102. package/lib/cjs/ExternalSource.d.ts +95 -96
  103. package/lib/cjs/ExternalSource.d.ts.map +1 -1
  104. package/lib/cjs/ExternalSource.js +130 -131
  105. package/lib/cjs/ExternalSource.js.map +1 -1
  106. package/lib/cjs/GeoCoordConfig.d.ts +19 -19
  107. package/lib/cjs/GeoCoordConfig.js +85 -85
  108. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  109. package/lib/cjs/GeometrySummary.d.ts +4 -4
  110. package/lib/cjs/GeometrySummary.js +333 -333
  111. package/lib/cjs/GeometrySummary.js.map +1 -1
  112. package/lib/cjs/HubMock.d.ts +94 -94
  113. package/lib/cjs/HubMock.js +220 -222
  114. package/lib/cjs/HubMock.js.map +1 -1
  115. package/lib/cjs/IModelCloneContext.d.ts +8 -8
  116. package/lib/cjs/IModelCloneContext.d.ts.map +1 -1
  117. package/lib/cjs/IModelCloneContext.js +15 -15
  118. package/lib/cjs/IModelDb.d.ts +1222 -1196
  119. package/lib/cjs/IModelDb.d.ts.map +1 -1
  120. package/lib/cjs/IModelDb.js +2389 -2392
  121. package/lib/cjs/IModelDb.js.map +1 -1
  122. package/lib/cjs/IModelElementCloneContext.d.ts +89 -89
  123. package/lib/cjs/IModelElementCloneContext.js +159 -159
  124. package/lib/cjs/IModelHost.d.ts +370 -369
  125. package/lib/cjs/IModelHost.d.ts.map +1 -1
  126. package/lib/cjs/IModelHost.js +476 -496
  127. package/lib/cjs/IModelHost.js.map +1 -1
  128. package/lib/cjs/IModelJsFs.d.ts +62 -62
  129. package/lib/cjs/IModelJsFs.js +139 -140
  130. package/lib/cjs/IModelJsFs.js.map +1 -1
  131. package/lib/cjs/IpcHost.d.ts +104 -104
  132. package/lib/cjs/IpcHost.js +276 -278
  133. package/lib/cjs/IpcHost.js.map +1 -1
  134. package/lib/cjs/LineStyle.d.ts +311 -311
  135. package/lib/cjs/LineStyle.js +295 -295
  136. package/lib/cjs/LocalHub.d.ts +162 -162
  137. package/lib/cjs/LocalHub.d.ts.map +1 -1
  138. package/lib/cjs/LocalHub.js +579 -584
  139. package/lib/cjs/LocalHub.js.map +1 -1
  140. package/lib/cjs/LocalhostIpcHost.d.ts +21 -20
  141. package/lib/cjs/LocalhostIpcHost.d.ts.map +1 -1
  142. package/lib/cjs/LocalhostIpcHost.js +79 -81
  143. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  144. package/lib/cjs/Material.d.ts +131 -131
  145. package/lib/cjs/Material.d.ts.map +1 -1
  146. package/lib/cjs/Material.js +185 -181
  147. package/lib/cjs/Material.js.map +1 -1
  148. package/lib/cjs/Model.d.ts +391 -392
  149. package/lib/cjs/Model.d.ts.map +1 -1
  150. package/lib/cjs/Model.js +487 -485
  151. package/lib/cjs/Model.js.map +1 -1
  152. package/lib/cjs/NativeAppStorage.d.ts +51 -51
  153. package/lib/cjs/NativeAppStorage.js +202 -202
  154. package/lib/cjs/NativeAppStorage.js.map +1 -1
  155. package/lib/cjs/NativeHost.d.ts +52 -52
  156. package/lib/cjs/NativeHost.d.ts.map +1 -1
  157. package/lib/cjs/NativeHost.js +158 -163
  158. package/lib/cjs/NativeHost.js.map +1 -1
  159. package/lib/cjs/NavigationRelationship.d.ts +156 -156
  160. package/lib/cjs/NavigationRelationship.js +225 -225
  161. package/lib/cjs/NavigationRelationship.js.map +1 -1
  162. package/lib/cjs/PromiseMemoizer.d.ts +51 -51
  163. package/lib/cjs/PromiseMemoizer.d.ts.map +1 -1
  164. package/lib/cjs/PromiseMemoizer.js +101 -101
  165. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  166. package/lib/cjs/PropertyStore.d.ts +123 -132
  167. package/lib/cjs/PropertyStore.d.ts.map +1 -1
  168. package/lib/cjs/PropertyStore.js +179 -11
  169. package/lib/cjs/PropertyStore.js.map +1 -1
  170. package/lib/cjs/Relationship.d.ts +413 -416
  171. package/lib/cjs/Relationship.d.ts.map +1 -1
  172. package/lib/cjs/Relationship.js +491 -494
  173. package/lib/cjs/Relationship.js.map +1 -1
  174. package/lib/cjs/RpcBackend.d.ts +5 -5
  175. package/lib/cjs/RpcBackend.js +32 -32
  176. package/lib/cjs/SQLiteDb.d.ts +317 -219
  177. package/lib/cjs/SQLiteDb.d.ts.map +1 -1
  178. package/lib/cjs/SQLiteDb.js +318 -214
  179. package/lib/cjs/SQLiteDb.js.map +1 -1
  180. package/lib/cjs/Schema.d.ts +55 -55
  181. package/lib/cjs/Schema.js +83 -83
  182. package/lib/cjs/Schema.js.map +1 -1
  183. package/lib/cjs/ServerBasedLocks.d.ts +57 -57
  184. package/lib/cjs/ServerBasedLocks.js +168 -168
  185. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  186. package/lib/cjs/SqliteStatement.d.ts +360 -360
  187. package/lib/cjs/SqliteStatement.d.ts.map +1 -1
  188. package/lib/cjs/SqliteStatement.js +586 -586
  189. package/lib/cjs/Texture.d.ts +58 -58
  190. package/lib/cjs/Texture.js +82 -82
  191. package/lib/cjs/Texture.js.map +1 -1
  192. package/lib/cjs/TileStorage.d.ts +44 -18
  193. package/lib/cjs/TileStorage.d.ts.map +1 -1
  194. package/lib/cjs/TileStorage.js +109 -90
  195. package/lib/cjs/TileStorage.js.map +1 -1
  196. package/lib/cjs/TxnManager.d.ts +202 -202
  197. package/lib/cjs/TxnManager.d.ts.map +1 -1
  198. package/lib/cjs/TxnManager.js +356 -356
  199. package/lib/cjs/TxnManager.js.map +1 -1
  200. package/lib/cjs/ViewDefinition.d.ts +429 -439
  201. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  202. package/lib/cjs/ViewDefinition.js +640 -646
  203. package/lib/cjs/ViewDefinition.js.map +1 -1
  204. package/lib/cjs/ViewStateHydrator.d.ts +13 -13
  205. package/lib/cjs/ViewStateHydrator.js +103 -103
  206. package/lib/cjs/core-backend.d.ts +181 -184
  207. package/lib/cjs/core-backend.d.ts.map +1 -1
  208. package/lib/cjs/core-backend.js +205 -204
  209. package/lib/cjs/core-backend.js.map +1 -1
  210. package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
  211. package/lib/cjs/domains/FunctionalElements.js +145 -145
  212. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  213. package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
  214. package/lib/cjs/domains/FunctionalSchema.d.ts.map +1 -1
  215. package/lib/cjs/domains/FunctionalSchema.js +39 -40
  216. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  217. package/lib/cjs/domains/GenericElements.d.ts +177 -177
  218. package/lib/cjs/domains/GenericElements.js +263 -263
  219. package/lib/cjs/domains/GenericSchema.d.ts +10 -10
  220. package/lib/cjs/domains/GenericSchema.js +28 -28
  221. package/lib/cjs/rpc/multipart.d.ts +11 -11
  222. package/lib/cjs/rpc/multipart.js +71 -71
  223. package/lib/cjs/rpc/tracing.d.ts +28 -28
  224. package/lib/cjs/rpc/tracing.js +73 -74
  225. package/lib/cjs/rpc/tracing.js.map +1 -1
  226. package/lib/cjs/rpc/web/logging.d.ts +9 -9
  227. package/lib/cjs/rpc/web/logging.js +43 -43
  228. package/lib/cjs/rpc/web/request.d.ts +6 -6
  229. package/lib/cjs/rpc/web/request.js +73 -74
  230. package/lib/cjs/rpc/web/request.js.map +1 -1
  231. package/lib/cjs/rpc/web/response.d.ts +6 -6
  232. package/lib/cjs/rpc/web/response.js +105 -106
  233. package/lib/cjs/rpc/web/response.js.map +1 -1
  234. package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
  235. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
  236. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +47 -47
  237. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +293 -294
  238. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  239. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +20 -22
  240. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts.map +1 -1
  241. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +193 -205
  242. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  243. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
  244. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +166 -168
  245. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  246. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
  247. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +42 -43
  248. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  249. package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
  250. package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
  251. package/lib/cjs/workspace/Settings.d.ts +186 -186
  252. package/lib/cjs/workspace/Settings.d.ts.map +1 -1
  253. package/lib/cjs/workspace/Settings.js +155 -155
  254. package/lib/cjs/workspace/Settings.js.map +1 -1
  255. package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
  256. package/lib/cjs/workspace/SettingsSchemas.js +190 -191
  257. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  258. package/lib/cjs/workspace/Workspace.d.ts +411 -414
  259. package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
  260. package/lib/cjs/workspace/Workspace.js +521 -543
  261. package/lib/cjs/workspace/Workspace.js.map +1 -1
  262. package/package.json +25 -28
  263. package/lib/cjs/AliCloudStorageService.d.ts +0 -24
  264. package/lib/cjs/AliCloudStorageService.d.ts.map +0 -1
  265. package/lib/cjs/AliCloudStorageService.js +0 -72
  266. package/lib/cjs/AliCloudStorageService.js.map +0 -1
  267. package/lib/cjs/CloudStorageBackend.d.ts +0 -59
  268. package/lib/cjs/CloudStorageBackend.d.ts.map +0 -1
  269. package/lib/cjs/CloudStorageBackend.js +0 -174
  270. package/lib/cjs/CloudStorageBackend.js.map +0 -1
@@ -1,82 +1,81 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.CustomViewState3dCreator = void 0;
8
- const core_bentley_1 = require("@itwin/core-bentley");
9
- const core_common_1 = require("@itwin/core-common");
10
- const core_geometry_1 = require("@itwin/core-geometry");
11
- const BackendLoggerCategory_1 = require("./BackendLoggerCategory");
12
- const loggerCategory = BackendLoggerCategory_1.BackendLoggerCategory.CustomViewState3dCreator;
13
- /**
14
- * Class which helps to generate a custom ViewState3d.
15
- * @internal
16
- */
17
- class CustomViewState3dCreator {
18
- constructor(iModel) {
19
- this._executeQuery = async (query) => {
20
- const rows = [];
21
- for await (const row of this._imodel.query(query, undefined, { rowFormat: core_common_1.QueryRowFormat.UseJsPropertyNames }))
22
- rows.push(row.id);
23
- return rows;
24
- };
25
- this._imodel = iModel;
26
- }
27
- /** Gets default view state data such as category Ids and modelextents. If no model ids are passed in, all 3D models in the iModel are used.
28
- * @param [modelIds] Ids of models to display in the view.
29
- * @throws [IModelError]($common) If no 3d models are found in the iModel.
30
- */
31
- async getCustomViewState3dData(options) {
32
- let decompressedModelIds;
33
- if ((options === null || options === void 0 ? void 0 : options.modelIds) !== undefined)
34
- decompressedModelIds = core_bentley_1.CompressedId64Set.decompressArray(options.modelIds);
35
- const models = decompressedModelIds !== null && decompressedModelIds !== void 0 ? decompressedModelIds : await this._getAllModels();
36
- const categories = await this._getAllCategories();
37
- const modelExtents = await this._getModelExtents(models);
38
- return {
39
- modelIds: core_bentley_1.CompressedId64Set.sortAndCompress(models),
40
- categoryIds: core_bentley_1.CompressedId64Set.sortAndCompress(categories),
41
- modelExtents: modelExtents.toJSON(),
42
- };
43
- }
44
- async _getAllCategories() {
45
- // Only use categories with elements in them
46
- core_bentley_1.Logger.logInfo(loggerCategory, "Starting getAllCategories query.");
47
- const query = `SELECT DISTINCT Category.Id AS id FROM BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId FROM BisCore.SpatialCategory)`;
48
- const categories = await this._executeQuery(query);
49
- core_bentley_1.Logger.logInfo(loggerCategory, "Finished getAllCategories query.");
50
- return categories;
51
- }
52
- /** Compute the union of the extents of all the specified models. */
53
- async _getModelExtents(modelIds) {
54
- if (modelIds.length === 0)
55
- return new core_geometry_1.Range3d();
56
- const timer = new core_bentley_1.StopWatch("getModelExtents query", true);
57
- const range = await this._imodel.models.queryRange(modelIds);
58
- timer.stop();
59
- core_bentley_1.Logger.logInfo(loggerCategory, "Finished getModelExtents query.", { timeElapsedMs: timer.elapsed });
60
- return range;
61
- }
62
- /** Get the Ids of all spatially-located, non-template 3d models in the iModel. */
63
- async _getAllModels() {
64
- // Note: IsNotSpatiallyLocated was introduced in a later version of the BisCore ECSchema.
65
- // If the iModel has an earlier version, the statement will throw because the property does not exist.
66
- // If the iModel was created from an earlier version and later upgraded to a newer version, the property may be NULL for models created prior to the upgrade.
67
- const select = "SELECT ECInstanceId FROM Bis.GeometricModel3D WHERE IsPrivate = false AND IsTemplate = false";
68
- const spatialCriterion = "AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated = false)";
69
- let models = [];
70
- core_bentley_1.Logger.logInfo(loggerCategory, "Starting getAllModels query.");
71
- try {
72
- models = await this._executeQuery(`${select} ${spatialCriterion}`);
73
- }
74
- catch {
75
- models = await this._executeQuery(select);
76
- }
77
- core_bentley_1.Logger.logInfo(loggerCategory, "Finished getAllModels query.");
78
- return models;
79
- }
80
- }
81
- exports.CustomViewState3dCreator = CustomViewState3dCreator;
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.CustomViewState3dCreator = void 0;
8
+ const core_bentley_1 = require("@itwin/core-bentley");
9
+ const core_geometry_1 = require("@itwin/core-geometry");
10
+ const BackendLoggerCategory_1 = require("./BackendLoggerCategory");
11
+ const loggerCategory = BackendLoggerCategory_1.BackendLoggerCategory.CustomViewState3dCreator;
12
+ /**
13
+ * Class which helps to generate a custom ViewState3d.
14
+ * @internal
15
+ */
16
+ class CustomViewState3dCreator {
17
+ constructor(iModel) {
18
+ this._executeQuery = async (query) => {
19
+ const rows = [];
20
+ for await (const row of this._imodel.createQueryReader(query))
21
+ rows.push(row.id);
22
+ return rows;
23
+ };
24
+ this._imodel = iModel;
25
+ }
26
+ /** Gets default view state data such as category Ids and modelextents. If no model ids are passed in, all 3D models in the iModel are used.
27
+ * @param [modelIds] Ids of models to display in the view.
28
+ * @throws [IModelError]($common) If no 3d models are found in the iModel.
29
+ */
30
+ async getCustomViewState3dData(options) {
31
+ let decompressedModelIds;
32
+ if (options?.modelIds !== undefined)
33
+ decompressedModelIds = core_bentley_1.CompressedId64Set.decompressArray(options.modelIds);
34
+ const models = decompressedModelIds ?? await this._getAllModels();
35
+ const categories = await this._getAllCategories();
36
+ const modelExtents = await this._getModelExtents(models);
37
+ return {
38
+ modelIds: core_bentley_1.CompressedId64Set.sortAndCompress(models),
39
+ categoryIds: core_bentley_1.CompressedId64Set.sortAndCompress(categories),
40
+ modelExtents: modelExtents.toJSON(),
41
+ };
42
+ }
43
+ async _getAllCategories() {
44
+ // Only use categories with elements in them
45
+ core_bentley_1.Logger.logInfo(loggerCategory, "Starting getAllCategories query.");
46
+ const query = `SELECT DISTINCT Category.Id AS id FROM BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId FROM BisCore.SpatialCategory)`;
47
+ const categories = await this._executeQuery(query);
48
+ core_bentley_1.Logger.logInfo(loggerCategory, "Finished getAllCategories query.");
49
+ return categories;
50
+ }
51
+ /** Compute the union of the extents of all the specified models. */
52
+ async _getModelExtents(modelIds) {
53
+ if (modelIds.length === 0)
54
+ return new core_geometry_1.Range3d();
55
+ const timer = new core_bentley_1.StopWatch("getModelExtents query", true);
56
+ const range = await this._imodel.models.queryRange(modelIds);
57
+ timer.stop();
58
+ core_bentley_1.Logger.logInfo(loggerCategory, "Finished getModelExtents query.", { timeElapsedMs: timer.elapsed });
59
+ return range;
60
+ }
61
+ /** Get the Ids of all spatially-located, non-template 3d models in the iModel. */
62
+ async _getAllModels() {
63
+ // Note: IsNotSpatiallyLocated was introduced in a later version of the BisCore ECSchema.
64
+ // If the iModel has an earlier version, the statement will throw because the property does not exist.
65
+ // If the iModel was created from an earlier version and later upgraded to a newer version, the property may be NULL for models created prior to the upgrade.
66
+ const select = "SELECT ECInstanceId FROM Bis.GeometricModel3D WHERE IsPrivate = false AND IsTemplate = false";
67
+ const spatialCriterion = "AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated = false)";
68
+ let models = [];
69
+ core_bentley_1.Logger.logInfo(loggerCategory, "Starting getAllModels query.");
70
+ try {
71
+ models = await this._executeQuery(`${select} ${spatialCriterion}`);
72
+ }
73
+ catch {
74
+ models = await this._executeQuery(select);
75
+ }
76
+ core_bentley_1.Logger.logInfo(loggerCategory, "Finished getAllModels query.");
77
+ return models;
78
+ }
79
+ }
80
+ exports.CustomViewState3dCreator = CustomViewState3dCreator;
82
81
  //# sourceMappingURL=CustomViewState3dCreator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomViewState3dCreator.js","sourceRoot":"","sources":["../../src/CustomViewState3dCreator.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,sDAAkG;AAClG,oDAA6G;AAC7G,wDAA+C;AAC/C,mEAAgE;AAGhE,MAAM,cAAc,GAAG,6CAAqB,CAAC,wBAAwB,CAAC;AAEtE;;;GAGG;AACH,MAAa,wBAAwB;IAEnC,YAAmB,MAAgB;QAiE3B,kBAAa,GAAG,KAAK,EAAE,KAAa,EAAE,EAAE;YAC9C,MAAM,IAAI,GAAG,EAAE,CAAC;YAChB,IAAI,KAAK,EAAE,MAAM,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CA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,oEAAoE;IAC5D,KAAK,CAAC,gBAAgB,CAAC,QAAsB;QACnD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;YACvB,OAAO,IAAI,uBAAO,EAAE,CAAC;QAEvB,MAAM,KAAK,GAAG,IAAI,wBAAS,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;QAC3D,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAE7D,KAAK,CAAC,IAAI,EAAE,CAAC;QACb,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,iCAAiC,EAAE,EAAC,aAAa,EAAE,KAAK,CAAC,OAAO,EAAC,CAAC,CAAC;QAElG,OAAO,KAAK,CAAC;IACf,CAAC;IAED,kFAAkF;IAC1E,KAAK,CAAC,aAAa;QACzB,yFAAyF;QACzF,sGAAsG;QACtG,6JAA6J;QAC7J,MAAM,MAAM,GAAG,8FAA8F,CAAC;QAC9G,MAAM,gBAAgB,GAAG,sEAAsE,CAAC;QAEhG,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,8BAA8B,CAAC,CAAC;QAC/D,IAAI;YACF,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,MAAM,IAAI,gBAAgB,EAAE,CAAC,CAAC;SACpE;QAAC,MAAM;YACN,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;SAC3C;QAED,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,8BAA8B,CAAC,CAAC;QAC/D,OAAO,MAAM,CAAC;IAChB,CAAC;CASF;AA1ED,4DA0EC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { CompressedId64Set, Id64Array, Id64String, Logger, StopWatch } from \"@itwin/core-bentley\";\r\nimport { CustomViewState3dCreatorOptions, CustomViewState3dProps, QueryRowFormat } from \"@itwin/core-common\";\r\nimport { Range3d } from \"@itwin/core-geometry\";\r\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\r\nimport { IModelDb } from \"./IModelDb\";\r\n\r\nconst loggerCategory = BackendLoggerCategory.CustomViewState3dCreator;\r\n\r\n/**\r\n * Class which helps to generate a custom ViewState3d.\r\n * @internal\r\n */\r\nexport class CustomViewState3dCreator {\r\n private _imodel: IModelDb;\r\n public constructor(iModel: IModelDb) {\r\n this._imodel = iModel;\r\n }\r\n /** Gets default view state data such as category Ids and modelextents. If no model ids are passed in, all 3D models in the iModel are used.\r\n * @param [modelIds] Ids of models to display in the view.\r\n * @throws [IModelError]($common) If no 3d models are found in the iModel.\r\n */\r\n public async getCustomViewState3dData(options: CustomViewState3dCreatorOptions): Promise<CustomViewState3dProps> {\r\n let decompressedModelIds;\r\n if (options?.modelIds !== undefined)\r\n decompressedModelIds = CompressedId64Set.decompressArray(options.modelIds);\r\n\r\n const models: Id64Array = decompressedModelIds ?? await this._getAllModels();\r\n const categories: Id64Array = await this._getAllCategories();\r\n const modelExtents: Range3d = await this._getModelExtents(models);\r\n return {\r\n modelIds: CompressedId64Set.sortAndCompress(models),\r\n categoryIds: CompressedId64Set.sortAndCompress(categories),\r\n modelExtents: modelExtents.toJSON(),\r\n };\r\n }\r\n\r\n private async _getAllCategories(): Promise<Id64Array> {\r\n // Only use categories with elements in them\r\n Logger.logInfo(loggerCategory, \"Starting getAllCategories query.\");\r\n const query = `SELECT DISTINCT Category.Id AS id FROM BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId FROM BisCore.SpatialCategory)`;\r\n const categories: Id64Array = await this._executeQuery(query);\r\n Logger.logInfo(loggerCategory, \"Finished getAllCategories query.\");\r\n return categories;\r\n }\r\n\r\n /** Compute the union of the extents of all the specified models. */\r\n private async _getModelExtents(modelIds: Id64String[]): Promise<Range3d> {\r\n if (modelIds.length === 0)\r\n return new Range3d();\r\n\r\n const timer = new StopWatch(\"getModelExtents query\", true);\r\n const range = await this._imodel.models.queryRange(modelIds);\r\n\r\n timer.stop();\r\n Logger.logInfo(loggerCategory, \"Finished getModelExtents query.\", {timeElapsedMs: timer.elapsed});\r\n\r\n return range;\r\n }\r\n\r\n /** Get the Ids of all spatially-located, non-template 3d models in the iModel. */\r\n private async _getAllModels(): Promise<Id64Array> {\r\n // Note: IsNotSpatiallyLocated was introduced in a later version of the BisCore ECSchema.\r\n // If the iModel has an earlier version, the statement will throw because the property does not exist.\r\n // If the iModel was created from an earlier version and later upgraded to a newer version, the property may be NULL for models created prior to the upgrade.\r\n const select = \"SELECT ECInstanceId FROM Bis.GeometricModel3D WHERE IsPrivate = false AND IsTemplate = false\";\r\n const spatialCriterion = \"AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated = false)\";\r\n\r\n let models = [];\r\n Logger.logInfo(loggerCategory, \"Starting getAllModels query.\");\r\n try {\r\n models = await this._executeQuery(`${select} ${spatialCriterion}`);\r\n } catch {\r\n models = await this._executeQuery(select);\r\n }\r\n\r\n Logger.logInfo(loggerCategory, \"Finished getAllModels query.\");\r\n return models;\r\n }\r\n\r\n private _executeQuery = async (query: string) => {\r\n const rows = [];\r\n for await (const row of this._imodel.query(query, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames }))\r\n rows.push(row.id);\r\n\r\n return rows;\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"CustomViewState3dCreator.js","sourceRoot":"","sources":["../../src/CustomViewState3dCreator.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,sDAAkG;AAElG,wDAA+C;AAC/C,mEAAgE;AAGhE,MAAM,cAAc,GAAG,6CAAqB,CAAC,wBAAwB,CAAC;AAEtE;;;GAGG;AACH,MAAa,wBAAwB;IAEnC,YAAmB,MAAgB;QAiE3B,kBAAa,GAAG,KAAK,EAA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,CAAC;IAED,oEAAoE;IAC5D,KAAK,CAAC,gBAAgB,CAAC,QAAsB;QACnD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;YACvB,OAAO,IAAI,uBAAO,EAAE,CAAC;QAEvB,MAAM,KAAK,GAAG,IAAI,wBAAS,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;QAC3D,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAE7D,KAAK,CAAC,IAAI,EAAE,CAAC;QACb,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,iCAAiC,EAAE,EAAE,aAAa,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAEpG,OAAO,KAAK,CAAC;IACf,CAAC;IAED,kFAAkF;IAC1E,KAAK,CAAC,aAAa;QACzB,yFAAyF;QACzF,sGAAsG;QACtG,6JAA6J;QAC7J,MAAM,MAAM,GAAG,8FAA8F,CAAC;QAC9G,MAAM,gBAAgB,GAAG,sEAAsE,CAAC;QAEhG,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,8BAA8B,CAAC,CAAC;QAC/D,IAAI;YACF,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,MAAM,IAAI,gBAAgB,EAAE,CAAC,CAAC;SACpE;QAAC,MAAM;YACN,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;SAC3C;QAED,qBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,8BAA8B,CAAC,CAAC;QAC/D,OAAO,MAAM,CAAC;IAChB,CAAC;CASF;AA1ED,4DA0EC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { CompressedId64Set, Id64Array, Id64String, Logger, StopWatch } from \"@itwin/core-bentley\";\r\nimport { CustomViewState3dCreatorOptions, CustomViewState3dProps } from \"@itwin/core-common\";\r\nimport { Range3d } from \"@itwin/core-geometry\";\r\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\r\nimport { IModelDb } from \"./IModelDb\";\r\n\r\nconst loggerCategory = BackendLoggerCategory.CustomViewState3dCreator;\r\n\r\n/**\r\n * Class which helps to generate a custom ViewState3d.\r\n * @internal\r\n */\r\nexport class CustomViewState3dCreator {\r\n private _imodel: IModelDb;\r\n public constructor(iModel: IModelDb) {\r\n this._imodel = iModel;\r\n }\r\n /** Gets default view state data such as category Ids and modelextents. If no model ids are passed in, all 3D models in the iModel are used.\r\n * @param [modelIds] Ids of models to display in the view.\r\n * @throws [IModelError]($common) If no 3d models are found in the iModel.\r\n */\r\n public async getCustomViewState3dData(options: CustomViewState3dCreatorOptions): Promise<CustomViewState3dProps> {\r\n let decompressedModelIds;\r\n if (options?.modelIds !== undefined)\r\n decompressedModelIds = CompressedId64Set.decompressArray(options.modelIds);\r\n\r\n const models: Id64Array = decompressedModelIds ?? await this._getAllModels();\r\n const categories: Id64Array = await this._getAllCategories();\r\n const modelExtents: Range3d = await this._getModelExtents(models);\r\n return {\r\n modelIds: CompressedId64Set.sortAndCompress(models),\r\n categoryIds: CompressedId64Set.sortAndCompress(categories),\r\n modelExtents: modelExtents.toJSON(),\r\n };\r\n }\r\n\r\n private async _getAllCategories(): Promise<Id64Array> {\r\n // Only use categories with elements in them\r\n Logger.logInfo(loggerCategory, \"Starting getAllCategories query.\");\r\n const query = `SELECT DISTINCT Category.Id AS id FROM BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId FROM BisCore.SpatialCategory)`;\r\n const categories: Id64Array = await this._executeQuery(query);\r\n Logger.logInfo(loggerCategory, \"Finished getAllCategories query.\");\r\n return categories;\r\n }\r\n\r\n /** Compute the union of the extents of all the specified models. */\r\n private async _getModelExtents(modelIds: Id64String[]): Promise<Range3d> {\r\n if (modelIds.length === 0)\r\n return new Range3d();\r\n\r\n const timer = new StopWatch(\"getModelExtents query\", true);\r\n const range = await this._imodel.models.queryRange(modelIds);\r\n\r\n timer.stop();\r\n Logger.logInfo(loggerCategory, \"Finished getModelExtents query.\", { timeElapsedMs: timer.elapsed });\r\n\r\n return range;\r\n }\r\n\r\n /** Get the Ids of all spatially-located, non-template 3d models in the iModel. */\r\n private async _getAllModels(): Promise<Id64Array> {\r\n // Note: IsNotSpatiallyLocated was introduced in a later version of the BisCore ECSchema.\r\n // If the iModel has an earlier version, the statement will throw because the property does not exist.\r\n // If the iModel was created from an earlier version and later upgraded to a newer version, the property may be NULL for models created prior to the upgrade.\r\n const select = \"SELECT ECInstanceId FROM Bis.GeometricModel3D WHERE IsPrivate = false AND IsTemplate = false\";\r\n const spatialCriterion = \"AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated = false)\";\r\n\r\n let models = [];\r\n Logger.logInfo(loggerCategory, \"Starting getAllModels query.\");\r\n try {\r\n models = await this._executeQuery(`${select} ${spatialCriterion}`);\r\n } catch {\r\n models = await this._executeQuery(select);\r\n }\r\n\r\n Logger.logInfo(loggerCategory, \"Finished getAllModels query.\");\r\n return models;\r\n }\r\n\r\n private _executeQuery = async (query: string) => {\r\n const rows = [];\r\n for await (const row of this._imodel.createQueryReader(query))\r\n rows.push(row.id);\r\n\r\n return rows;\r\n };\r\n}\r\n"]}
@@ -1,72 +1,75 @@
1
- /// <reference types="node" />
2
- import * as os from "os";
3
- import { LogLevel } from "@itwin/core-bentley";
4
- /**
5
- * Performance and Memory statistics of backend
6
- * @internal
7
- */
8
- export interface DevToolsStats {
9
- os: DevToolsOsStats;
10
- process: DevToolsProcessStats;
11
- }
12
- /**
13
- * OS stats of backend
14
- * @internal
15
- */
16
- export interface DevToolsOsStats {
17
- platform: NodeJS.Platform;
18
- hostname: string;
19
- totalmem: number;
20
- freemem: number;
21
- uptime: number;
22
- cpus: os.CpuInfo[];
23
- cpuUsage: number;
24
- }
25
- /**
26
- * Process stats of backend
27
- * @internal
28
- */
29
- export interface DevToolsProcessStats {
30
- uptime: number;
31
- pid: number;
32
- ppid: number;
33
- memoryUsage: NodeJS.MemoryUsage;
34
- }
35
- /** Utility to format the JSON created by DevTools.stats() to include the appropriate units
36
- * @internal
37
- */
38
- export declare class DevToolsStatsFormatter {
39
- private static readonly _megaByteProps;
40
- private static readonly _percentProps;
41
- private static readonly _mHzProps;
42
- private static readonly _secondsProps;
43
- /** Replacer that includes units - can be used with JSON.stringify() */
44
- private static _replacer;
45
- /** Converts the input stats to another JSON object with the appropriate units setup for various fields */
46
- static toFormattedJson(stats: any): any;
47
- }
48
- /**
49
- * Internal diagnostic utility
50
- * @internal
51
- */
52
- export declare class DevTools {
53
- /** Receives a ping and returns true */
54
- static ping(): boolean;
55
- private static hrtimeToMS;
56
- private static bytesToMegaBytes;
57
- private static evaluateCpuUsage;
58
- private static evaluateCpus;
59
- private static evaluateMemoryUsage;
60
- private static evaluateProcessStats;
61
- private static evaluateOsStats;
62
- /** Returns JSON object with backend statistics */
63
- static stats(): DevToolsStats;
64
- /** Sets up a log level at the backend and returns the old log level */
65
- static setLogLevel(inLoggerCategory: string, newLevel: LogLevel): LogLevel | undefined;
66
- /** Obtains the backend application and iTwin.js Core versions */
67
- static versions(): {
68
- application: string;
69
- iTwinJs: any;
70
- };
71
- }
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import * as os from "os";
4
+ import { LogLevel } from "@itwin/core-bentley";
5
+ import { RpcInterfaceEndpoints } from "@itwin/core-common";
6
+ /**
7
+ * Performance and Memory statistics of backend
8
+ * @internal
9
+ */
10
+ export interface DevToolsStats {
11
+ os: DevToolsOsStats;
12
+ process: DevToolsProcessStats;
13
+ }
14
+ /**
15
+ * OS stats of backend
16
+ * @internal
17
+ */
18
+ export interface DevToolsOsStats {
19
+ platform: NodeJS.Platform;
20
+ hostname: string;
21
+ totalmem: number;
22
+ freemem: number;
23
+ uptime: number;
24
+ cpus: os.CpuInfo[];
25
+ cpuUsage: number;
26
+ }
27
+ /**
28
+ * Process stats of backend
29
+ * @internal
30
+ */
31
+ export interface DevToolsProcessStats {
32
+ uptime: number;
33
+ pid: number;
34
+ ppid: number;
35
+ memoryUsage: NodeJS.MemoryUsage;
36
+ }
37
+ /** Utility to format the JSON created by DevTools.stats() to include the appropriate units
38
+ * @internal
39
+ */
40
+ export declare class DevToolsStatsFormatter {
41
+ private static readonly _megaByteProps;
42
+ private static readonly _percentProps;
43
+ private static readonly _mHzProps;
44
+ private static readonly _secondsProps;
45
+ /** Replacer that includes units - can be used with JSON.stringify() */
46
+ private static _replacer;
47
+ /** Converts the input stats to another JSON object with the appropriate units setup for various fields */
48
+ static toFormattedJson(stats: any): any;
49
+ }
50
+ /**
51
+ * Internal diagnostic utility
52
+ * @internal
53
+ */
54
+ export declare class DevTools {
55
+ /** Receives a ping and returns true */
56
+ static ping(): boolean;
57
+ private static hrtimeToMS;
58
+ private static bytesToMegaBytes;
59
+ private static evaluateCpuUsage;
60
+ private static evaluateCpus;
61
+ private static evaluateMemoryUsage;
62
+ private static evaluateProcessStats;
63
+ private static evaluateOsStats;
64
+ /** Returns JSON object with backend statistics */
65
+ static stats(): DevToolsStats;
66
+ /** Sets up a log level at the backend and returns the old log level */
67
+ static setLogLevel(inLoggerCategory: string, newLevel: LogLevel): LogLevel | undefined;
68
+ /** Obtains the backend application and iTwin.js Core versions */
69
+ static versions(): Promise<{
70
+ application: string;
71
+ iTwinJs: any;
72
+ availableRpcs: RpcInterfaceEndpoints[];
73
+ }>;
74
+ }
72
75
  //# sourceMappingURL=DevTools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DevTools.d.ts","sourceRoot":"","sources":["../../src/DevTools.ts"],"names":[],"mappings":";AAKA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,OAAO,EAAU,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAYvD;;;GA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