@itwin/core-frontend 5.0.0-dev.32 → 5.0.0-dev.34

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 (259) hide show
  1. package/lib/cjs/AccuDraw.js +1 -1
  2. package/lib/cjs/AccuDraw.js.map +1 -1
  3. package/lib/cjs/ApproximateTerrainHeights.js +1 -1
  4. package/lib/cjs/ApproximateTerrainHeights.js.map +1 -1
  5. package/lib/cjs/BackgroundMapGeometry.js +5 -5
  6. package/lib/cjs/BackgroundMapGeometry.js.map +1 -1
  7. package/lib/cjs/DrawingViewState.js +9 -9
  8. package/lib/cjs/DrawingViewState.js.map +1 -1
  9. package/lib/cjs/GraphicalEditingScope.js +4 -4
  10. package/lib/cjs/GraphicalEditingScope.js.map +1 -1
  11. package/lib/cjs/IModelApp.js +61 -63
  12. package/lib/cjs/IModelApp.js.map +1 -1
  13. package/lib/cjs/IModelConnection.js +10 -10
  14. package/lib/cjs/IModelConnection.js.map +1 -1
  15. package/lib/cjs/IModelRoutingContext.js +1 -1
  16. package/lib/cjs/IModelRoutingContext.js.map +1 -1
  17. package/lib/cjs/IpcApp.js +2 -2
  18. package/lib/cjs/IpcApp.js.map +1 -1
  19. package/lib/cjs/LocalhostIpcApp.js +1 -1
  20. package/lib/cjs/LocalhostIpcApp.js.map +1 -1
  21. package/lib/cjs/NativeApp.js +15 -17
  22. package/lib/cjs/NativeApp.js.map +1 -1
  23. package/lib/cjs/NativeAppLogger.js +1 -1
  24. package/lib/cjs/NativeAppLogger.js.map +1 -1
  25. package/lib/cjs/NoRenderApp.js +1 -1
  26. package/lib/cjs/NoRenderApp.js.map +1 -1
  27. package/lib/cjs/SelectionSet.js +148 -156
  28. package/lib/cjs/SelectionSet.js.map +1 -1
  29. package/lib/cjs/Sprites.js +1 -1
  30. package/lib/cjs/Sprites.js.map +1 -1
  31. package/lib/cjs/ViewCreator2d.js +3 -3
  32. package/lib/cjs/ViewCreator2d.js.map +1 -1
  33. package/lib/cjs/ViewGlobalLocation.js +5 -5
  34. package/lib/cjs/ViewGlobalLocation.js.map +1 -1
  35. package/lib/cjs/ViewState.js +2 -2
  36. package/lib/cjs/ViewState.js.map +1 -1
  37. package/lib/cjs/ViewingSpace.js +9 -9
  38. package/lib/cjs/ViewingSpace.js.map +1 -1
  39. package/lib/cjs/Viewport.js +41 -41
  40. package/lib/cjs/Viewport.js.map +1 -1
  41. package/lib/cjs/common/internal/render/DisplayParams.js +1 -1
  42. package/lib/cjs/common/internal/render/DisplayParams.js.map +1 -1
  43. package/lib/cjs/common/internal/render/GraphicDescriptionBuilderImpl.js +1 -1
  44. package/lib/cjs/common/internal/render/GraphicDescriptionBuilderImpl.js.map +1 -1
  45. package/lib/cjs/common/internal/render/GraphicDescriptionContextImpl.js +1 -1
  46. package/lib/cjs/common/internal/render/GraphicDescriptionContextImpl.js.map +1 -1
  47. package/lib/cjs/internal/render/PrimitiveBuilder.js +1 -1
  48. package/lib/cjs/internal/render/PrimitiveBuilder.js.map +1 -1
  49. package/lib/cjs/internal/render/RenderInstancesParamsImpl.js +1 -1
  50. package/lib/cjs/internal/render/RenderInstancesParamsImpl.js.map +1 -1
  51. package/lib/cjs/render/MockRender.js +3 -3
  52. package/lib/cjs/render/MockRender.js.map +1 -1
  53. package/lib/cjs/render/webgl/BackgroundMapDrape.js +1 -1
  54. package/lib/cjs/render/webgl/BackgroundMapDrape.js.map +1 -1
  55. package/lib/cjs/render/webgl/BatchState.js +1 -1
  56. package/lib/cjs/render/webgl/BatchState.js.map +1 -1
  57. package/lib/cjs/render/webgl/ColorInfo.js +2 -2
  58. package/lib/cjs/render/webgl/ColorInfo.js.map +1 -1
  59. package/lib/cjs/render/webgl/Diagnostics.js +4 -4
  60. package/lib/cjs/render/webgl/Diagnostics.js.map +1 -1
  61. package/lib/cjs/render/webgl/DrawCommand.js +4 -4
  62. package/lib/cjs/render/webgl/DrawCommand.js.map +1 -1
  63. package/lib/cjs/render/webgl/IModelFrameLifecycle.js +4 -4
  64. package/lib/cjs/render/webgl/IModelFrameLifecycle.js.map +1 -1
  65. package/lib/cjs/render/webgl/InstancedGeometry.js +3 -3
  66. package/lib/cjs/render/webgl/InstancedGeometry.js.map +1 -1
  67. package/lib/cjs/render/webgl/Material.js +4 -4
  68. package/lib/cjs/render/webgl/Material.js.map +1 -1
  69. package/lib/cjs/render/webgl/PlanarClassifier.js +1 -1
  70. package/lib/cjs/render/webgl/PlanarClassifier.js.map +1 -1
  71. package/lib/cjs/render/webgl/PlanarTextureProjection.js +1 -1
  72. package/lib/cjs/render/webgl/PlanarTextureProjection.js.map +1 -1
  73. package/lib/cjs/render/webgl/RenderState.js +1 -1
  74. package/lib/cjs/render/webgl/RenderState.js.map +1 -1
  75. package/lib/cjs/render/webgl/Target.js +1 -1
  76. package/lib/cjs/render/webgl/Target.js.map +1 -1
  77. package/lib/cjs/render/webgl/Technique.js +39 -39
  78. package/lib/cjs/render/webgl/Technique.js.map +1 -1
  79. package/lib/cjs/render/webgl/TechniqueFlags.js +1 -1
  80. package/lib/cjs/render/webgl/TechniqueFlags.js.map +1 -1
  81. package/lib/cjs/render/webgl/Texture.js +3 -3
  82. package/lib/cjs/render/webgl/Texture.js.map +1 -1
  83. package/lib/cjs/tile/CesiumAssetProvider.js +1 -1
  84. package/lib/cjs/tile/CesiumAssetProvider.js.map +1 -1
  85. package/lib/cjs/tile/map/ArcGISTileMap.js +1 -1
  86. package/lib/cjs/tile/map/ArcGISTileMap.js.map +1 -1
  87. package/lib/cjs/tile/map/ArcGisUtilities.js +1 -1
  88. package/lib/cjs/tile/map/ArcGisUtilities.js.map +1 -1
  89. package/lib/cjs/tile/map/CesiumTerrainProvider.js +6 -6
  90. package/lib/cjs/tile/map/CesiumTerrainProvider.js.map +1 -1
  91. package/lib/cjs/tile/map/ImageryTileTree.js +2 -2
  92. package/lib/cjs/tile/map/ImageryTileTree.js.map +1 -1
  93. package/lib/cjs/tile/map/MapLayerImageryFormats.js +7 -7
  94. package/lib/cjs/tile/map/MapLayerImageryFormats.js.map +1 -1
  95. package/lib/cjs/tile/map/MapTile.js +8 -8
  96. package/lib/cjs/tile/map/MapTile.js.map +1 -1
  97. package/lib/cjs/tile/map/MapTileAvailability.js +1 -1
  98. package/lib/cjs/tile/map/MapTileAvailability.js.map +1 -1
  99. package/lib/cjs/tile/map/MapTileTree.js +9 -9
  100. package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
  101. package/lib/cjs/tile/map/MapTilingScheme.js +1 -1
  102. package/lib/cjs/tile/map/MapTilingScheme.js.map +1 -1
  103. package/lib/cjs/tile/map/WmsCapabilities.js +2 -2
  104. package/lib/cjs/tile/map/WmsCapabilities.js.map +1 -1
  105. package/lib/cjs/tile/map/WmtsCapabilities.js +1 -1
  106. package/lib/cjs/tile/map/WmtsCapabilities.js.map +1 -1
  107. package/lib/cjs/tools/AccuDrawTool.js +21 -21
  108. package/lib/cjs/tools/AccuDrawTool.js.map +1 -1
  109. package/lib/cjs/tools/ClipViewTool.js +32 -32
  110. package/lib/cjs/tools/ClipViewTool.js.map +1 -1
  111. package/lib/cjs/tools/EditManipulator.js +2 -2
  112. package/lib/cjs/tools/EditManipulator.js.map +1 -1
  113. package/lib/cjs/tools/IdleTool.js +2 -2
  114. package/lib/cjs/tools/IdleTool.js.map +1 -1
  115. package/lib/cjs/tools/MeasureTool.js +34 -34
  116. package/lib/cjs/tools/MeasureTool.js.map +1 -1
  117. package/lib/cjs/tools/SelectTool.js +5 -5
  118. package/lib/cjs/tools/SelectTool.js.map +1 -1
  119. package/lib/cjs/tools/Tool.js +10 -10
  120. package/lib/cjs/tools/Tool.js.map +1 -1
  121. package/lib/cjs/tools/ToolAdmin.js +19 -19
  122. package/lib/cjs/tools/ToolAdmin.js.map +1 -1
  123. package/lib/cjs/tools/ToolAssistance.js +19 -19
  124. package/lib/cjs/tools/ToolAssistance.js.map +1 -1
  125. package/lib/cjs/tools/ToolSettings.js +63 -63
  126. package/lib/cjs/tools/ToolSettings.js.map +1 -1
  127. package/lib/cjs/tools/ViewTool.js +37 -37
  128. package/lib/cjs/tools/ViewTool.js.map +1 -1
  129. package/lib/esm/AccuDraw.js +1 -1
  130. package/lib/esm/AccuDraw.js.map +1 -1
  131. package/lib/esm/ApproximateTerrainHeights.js +1 -1
  132. package/lib/esm/ApproximateTerrainHeights.js.map +1 -1
  133. package/lib/esm/BackgroundMapGeometry.js +5 -5
  134. package/lib/esm/BackgroundMapGeometry.js.map +1 -1
  135. package/lib/esm/DrawingViewState.js +9 -9
  136. package/lib/esm/DrawingViewState.js.map +1 -1
  137. package/lib/esm/GraphicalEditingScope.js +4 -4
  138. package/lib/esm/GraphicalEditingScope.js.map +1 -1
  139. package/lib/esm/IModelApp.js +61 -63
  140. package/lib/esm/IModelApp.js.map +1 -1
  141. package/lib/esm/IModelConnection.js +10 -10
  142. package/lib/esm/IModelConnection.js.map +1 -1
  143. package/lib/esm/IModelRoutingContext.js +1 -1
  144. package/lib/esm/IModelRoutingContext.js.map +1 -1
  145. package/lib/esm/IpcApp.js +2 -2
  146. package/lib/esm/IpcApp.js.map +1 -1
  147. package/lib/esm/LocalhostIpcApp.js +1 -1
  148. package/lib/esm/LocalhostIpcApp.js.map +1 -1
  149. package/lib/esm/NativeApp.js +15 -17
  150. package/lib/esm/NativeApp.js.map +1 -1
  151. package/lib/esm/NativeAppLogger.js +1 -1
  152. package/lib/esm/NativeAppLogger.js.map +1 -1
  153. package/lib/esm/NoRenderApp.js +1 -1
  154. package/lib/esm/NoRenderApp.js.map +1 -1
  155. package/lib/esm/SelectionSet.js +148 -156
  156. package/lib/esm/SelectionSet.js.map +1 -1
  157. package/lib/esm/Sprites.js +1 -1
  158. package/lib/esm/Sprites.js.map +1 -1
  159. package/lib/esm/ViewCreator2d.js +3 -3
  160. package/lib/esm/ViewCreator2d.js.map +1 -1
  161. package/lib/esm/ViewGlobalLocation.js +5 -5
  162. package/lib/esm/ViewGlobalLocation.js.map +1 -1
  163. package/lib/esm/ViewState.js +2 -2
  164. package/lib/esm/ViewState.js.map +1 -1
  165. package/lib/esm/ViewingSpace.js +9 -9
  166. package/lib/esm/ViewingSpace.js.map +1 -1
  167. package/lib/esm/Viewport.js +41 -41
  168. package/lib/esm/Viewport.js.map +1 -1
  169. package/lib/esm/common/internal/render/DisplayParams.js +1 -1
  170. package/lib/esm/common/internal/render/DisplayParams.js.map +1 -1
  171. package/lib/esm/common/internal/render/GraphicDescriptionBuilderImpl.js +1 -1
  172. package/lib/esm/common/internal/render/GraphicDescriptionBuilderImpl.js.map +1 -1
  173. package/lib/esm/common/internal/render/GraphicDescriptionContextImpl.js +1 -1
  174. package/lib/esm/common/internal/render/GraphicDescriptionContextImpl.js.map +1 -1
  175. package/lib/esm/internal/render/PrimitiveBuilder.js +1 -1
  176. package/lib/esm/internal/render/PrimitiveBuilder.js.map +1 -1
  177. package/lib/esm/internal/render/RenderInstancesParamsImpl.js +1 -1
  178. package/lib/esm/internal/render/RenderInstancesParamsImpl.js.map +1 -1
  179. package/lib/esm/render/MockRender.js +3 -3
  180. package/lib/esm/render/MockRender.js.map +1 -1
  181. package/lib/esm/render/webgl/BackgroundMapDrape.js +1 -1
  182. package/lib/esm/render/webgl/BackgroundMapDrape.js.map +1 -1
  183. package/lib/esm/render/webgl/BatchState.js +1 -1
  184. package/lib/esm/render/webgl/BatchState.js.map +1 -1
  185. package/lib/esm/render/webgl/ColorInfo.js +2 -2
  186. package/lib/esm/render/webgl/ColorInfo.js.map +1 -1
  187. package/lib/esm/render/webgl/Diagnostics.js +4 -4
  188. package/lib/esm/render/webgl/Diagnostics.js.map +1 -1
  189. package/lib/esm/render/webgl/DrawCommand.js +4 -4
  190. package/lib/esm/render/webgl/DrawCommand.js.map +1 -1
  191. package/lib/esm/render/webgl/IModelFrameLifecycle.js +4 -4
  192. package/lib/esm/render/webgl/IModelFrameLifecycle.js.map +1 -1
  193. package/lib/esm/render/webgl/InstancedGeometry.js +3 -3
  194. package/lib/esm/render/webgl/InstancedGeometry.js.map +1 -1
  195. package/lib/esm/render/webgl/Material.js +4 -4
  196. package/lib/esm/render/webgl/Material.js.map +1 -1
  197. package/lib/esm/render/webgl/PlanarClassifier.js +1 -1
  198. package/lib/esm/render/webgl/PlanarClassifier.js.map +1 -1
  199. package/lib/esm/render/webgl/PlanarTextureProjection.js +1 -1
  200. package/lib/esm/render/webgl/PlanarTextureProjection.js.map +1 -1
  201. package/lib/esm/render/webgl/RenderState.js +1 -1
  202. package/lib/esm/render/webgl/RenderState.js.map +1 -1
  203. package/lib/esm/render/webgl/Target.js +1 -1
  204. package/lib/esm/render/webgl/Target.js.map +1 -1
  205. package/lib/esm/render/webgl/Technique.js +39 -39
  206. package/lib/esm/render/webgl/Technique.js.map +1 -1
  207. package/lib/esm/render/webgl/TechniqueFlags.js +1 -1
  208. package/lib/esm/render/webgl/TechniqueFlags.js.map +1 -1
  209. package/lib/esm/render/webgl/Texture.js +3 -3
  210. package/lib/esm/render/webgl/Texture.js.map +1 -1
  211. package/lib/esm/tile/CesiumAssetProvider.js +1 -1
  212. package/lib/esm/tile/CesiumAssetProvider.js.map +1 -1
  213. package/lib/esm/tile/map/ArcGISTileMap.js +1 -1
  214. package/lib/esm/tile/map/ArcGISTileMap.js.map +1 -1
  215. package/lib/esm/tile/map/ArcGisUtilities.js +1 -1
  216. package/lib/esm/tile/map/ArcGisUtilities.js.map +1 -1
  217. package/lib/esm/tile/map/CesiumTerrainProvider.js +6 -6
  218. package/lib/esm/tile/map/CesiumTerrainProvider.js.map +1 -1
  219. package/lib/esm/tile/map/ImageryTileTree.js +2 -2
  220. package/lib/esm/tile/map/ImageryTileTree.js.map +1 -1
  221. package/lib/esm/tile/map/MapLayerImageryFormats.js +7 -7
  222. package/lib/esm/tile/map/MapLayerImageryFormats.js.map +1 -1
  223. package/lib/esm/tile/map/MapTile.js +8 -8
  224. package/lib/esm/tile/map/MapTile.js.map +1 -1
  225. package/lib/esm/tile/map/MapTileAvailability.js +1 -1
  226. package/lib/esm/tile/map/MapTileAvailability.js.map +1 -1
  227. package/lib/esm/tile/map/MapTileTree.js +9 -9
  228. package/lib/esm/tile/map/MapTileTree.js.map +1 -1
  229. package/lib/esm/tile/map/MapTilingScheme.js +1 -1
  230. package/lib/esm/tile/map/MapTilingScheme.js.map +1 -1
  231. package/lib/esm/tile/map/WmsCapabilities.js +2 -2
  232. package/lib/esm/tile/map/WmsCapabilities.js.map +1 -1
  233. package/lib/esm/tile/map/WmtsCapabilities.js +1 -1
  234. package/lib/esm/tile/map/WmtsCapabilities.js.map +1 -1
  235. package/lib/esm/tools/AccuDrawTool.js +21 -21
  236. package/lib/esm/tools/AccuDrawTool.js.map +1 -1
  237. package/lib/esm/tools/ClipViewTool.js +32 -32
  238. package/lib/esm/tools/ClipViewTool.js.map +1 -1
  239. package/lib/esm/tools/EditManipulator.js +2 -2
  240. package/lib/esm/tools/EditManipulator.js.map +1 -1
  241. package/lib/esm/tools/IdleTool.js +2 -2
  242. package/lib/esm/tools/IdleTool.js.map +1 -1
  243. package/lib/esm/tools/MeasureTool.js +34 -34
  244. package/lib/esm/tools/MeasureTool.js.map +1 -1
  245. package/lib/esm/tools/SelectTool.js +5 -5
  246. package/lib/esm/tools/SelectTool.js.map +1 -1
  247. package/lib/esm/tools/Tool.js +10 -10
  248. package/lib/esm/tools/Tool.js.map +1 -1
  249. package/lib/esm/tools/ToolAdmin.js +19 -19
  250. package/lib/esm/tools/ToolAdmin.js.map +1 -1
  251. package/lib/esm/tools/ToolAssistance.js +19 -19
  252. package/lib/esm/tools/ToolAssistance.js.map +1 -1
  253. package/lib/esm/tools/ToolSettings.js +63 -63
  254. package/lib/esm/tools/ToolSettings.js.map +1 -1
  255. package/lib/esm/tools/ViewTool.js +37 -37
  256. package/lib/esm/tools/ViewTool.js.map +1 -1
  257. package/lib/public/scripts/parse-imdl-worker.js +1 -1
  258. package/lib/workers/webpack/parse-imdl-worker.js +1 -1
  259. package/package.json +18 -18
@@ -1 +1 @@
1
- {"version":3,"file":"GraphicalEditingScope.js","sour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AAY,CAAC,EAAE,CAAC,CAAC;YACtD,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;YAC/B,KAAK,MAAM,aAAa,IAAI,YAAY,CAAC,QAAQ,EAAE,CAAC;gBAClD,IAAI,CAAC,IAAI,EAAE,CAAC;oBACV,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,EAAE,IAAI,GAAG,IAAI,YAAY,CAAC,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;gBACrH,CAAC;qBAAM,CAAC;oBACN,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC,YAAY,CAAC;oBAC9C,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACvC,CAAC;gBAED,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;gBAC3B,IAAI,uBAAQ,CAAC,MAAM,KAAK,aAAa,CAAC,IAAI,EAAE,CAAC;oBAC3C,IAAI,SAAS,KAAK,UAAU;wBAC1B,UAAU,GAAG,IAAI,GAAG,EAAc,CAAC;oBACrC,UAAU,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;gBACnC,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YAC5C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC;QACvD,CAAC;QAED,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;;AA3JH,sDA4JC;AAjJC;;GAEG;AACoB,6BAAO,GAAG,IAAI,sBAAO,EAA0C,AAAxD,CAAyD","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module IModelConnection\n */\n\nimport { assert, BeEvent, compareStrings, DbOpcode, DuplicatePolicy, GuidString, Id64Set, Id64String, SortedArray } from \"@itwin/core-bentley\";\nimport { Range3d } from \"@itwin/core-geometry\";\nimport {\n EditingScopeNotifications, ElementGeometryChange, ipcAppChannels, ModelGeometryChanges, ModelGeometryChangesProps, RemoveFunction,\n} from \"@itwin/core-common\";\nimport { BriefcaseNotificationHandler } from \"./BriefcaseTxns\";\nimport { BriefcaseConnection } from \"./BriefcaseConnection\";\nimport { IpcApp } from \"./IpcApp\";\n\nclass ModelChanges extends SortedArray<ElementGeometryChange> {\n public geometryGuid: GuidString;\n public readonly range: Range3d;\n\n public constructor(geometryGuid: GuidString, range: Range3d) {\n super((lhs, rhs) => compareStrings(lhs.id, rhs.id), DuplicatePolicy.Replace);\n this.geometryGuid = geometryGuid;\n this.range = range;\n }\n}\n\n/** Represents a period of time within an [interactive editing]($docs/learning/InteractiveEditing.md) session during which the\n * geometry of elements being displayed in one or more [[Viewport]]s is being modified. Outside of such a scope, whenever the\n * geometry within a [GeometricModel]($backend) changes new [[Tile]]s must be generated to reflect those changes in a viewport.\n * Regenerating entire tiles each time individual elements change can be time-consuming, which may introduce an unacceptable delay\n * between making a modification and seeing its result on the screen.\n *\n * Within the context of a graphical editing scope, no new tiles are generated. Instead, the geometry for any deleted or modified elements\n * is hidden in the tile graphics, and additional temporary graphics are displayed for any newly-inserted or modified elements. Only when the\n * scope exits are new tiles produced.\n *\n * The application decides when to enter and exit a graphical editing scope. A single interactive editing session may involve any number of\n * editing scopes. Typically, applications will enter a new editing scope (after first exiting a previous scope, if one exists):\n * - When switching from a non-graphical workflow to one that involves editing geometry; or\n * - When changing which geometric model is being edited; or\n * - After performing an operation that creates or modifies a \"large\" number (perhaps hundreds?) of elements.\n *\n * An application should typically exit any graphical editing scope before:\n * - Pulling changesets; or\n * - Switching from a graphical editing workflow to some non-graphical workflow.\n *\n * Graphical editing scopes are only supported for [[BriefcaseConnection]]s opened in read-write mode that contain version 1.0.11 or newer of the BisCore schema.\n * @see [[BriefcaseConnection.enterEditingScope]] to create a scope for a briefcase.\n * @see [[BriefcaseConnection.editingScope]] to obtain a briefcase's current scope.\n * @see [[exit]] to terminate a scope.\n * @public\n */\nexport class GraphicalEditingScope extends BriefcaseNotificationHandler implements EditingScopeNotifications {\n public get briefcaseChannelName() { return ipcAppChannels.editingScope; }\n\n /** Maps model Id to accumulated changes to geometric elements within the associated model. */\n private readonly _geometryChanges = new Map<Id64String, ModelChanges>();\n private _disposed = false;\n private _cleanup?: RemoveFunction;\n\n /** The connection to the iModel being edited. */\n public readonly iModel: BriefcaseConnection;\n\n /** Event raised when a new scope is created for any [[BriefcaseConnection]].\n * @see [[onExiting]] and [[onExited]] for complementary events.\n */\n public static readonly onEnter = new BeEvent<(scope: GraphicalEditingScope) => void>();\n\n /** Event raised when this scope is about to exit.\n * @see [[onEnter]] for the complementary event.\n * @see [[onExited]] for an event raised after the scope exits.\n */\n public readonly onExiting = new BeEvent<(scope: GraphicalEditingScope) => void>();\n\n /** Event raised when this scope has exited.\n * @see [[onEnter]] for the complementary event.\n * @see [[onExiting]] for an event raised just before the scope is exited.\n */\n public readonly onExited = new BeEvent<(scope: GraphicalEditingScope) => void>();\n\n /** Event raised after geometric changes are written to the iModel. */\n public readonly onGeometryChanges = new BeEvent<(changes: Iterable<ModelGeometryChanges>, scope: GraphicalEditingScope) => void>();\n\n /** Don't call this directly - use BriefcaseConnection.enterEditingScope.\n * @internal\n */\n public static async enter(imodel: BriefcaseConnection): Promise<GraphicalEditingScope> {\n if (imodel.editingScope)\n throw new Error(\"Cannot create an editing scope for an iModel that already has one\");\n\n // Register the scope synchronously, in case enter() is called again for same iModel while awaiting asynchronous initialization.\n const scope = new GraphicalEditingScope(imodel);\n try {\n const scopeStarted = await IpcApp.appFunctionIpc.toggleGraphicalEditingScope(imodel.key, true);\n assert(scopeStarted); // If it didn't, the backend threw an error.\n } catch (e) {\n scope.dispose();\n throw e;\n }\n\n this.onEnter.raiseEvent(scope);\n\n return scope;\n }\n\n /** Exits this editing scope. The associated [[BriefcaseConnection]]'s `editingScope` will be reset to `undefined`.\n * @throws Error if the scope could not be exited, e.g., if it has already been exited.\n * @see [[BriefcaseConnection.enterEditingScope]] to enter an editing scope.\n */\n public async exit(): Promise<void> {\n if (this._disposed || this.iModel.editingScope !== this)\n throw new Error(\"Cannot exit editing scope after it is disconnected from the iModel\");\n\n this._disposed = true;\n try {\n this.onExiting.raiseEvent(this);\n } finally {\n const scopeExited = await IpcApp.appFunctionIpc.toggleGraphicalEditingScope(this.iModel.key, false);\n assert(!scopeExited);\n try {\n this.onExited.raiseEvent(this);\n } finally {\n this.dispose();\n }\n }\n }\n\n /** Obtain all geometric changes to elements within the specified model accumulated within this scope. */\n public getGeometryChangesForModel(modelId: Id64String): Iterable<ElementGeometryChange> | undefined {\n return this._geometryChanges.get(modelId);\n }\n\n /** Obtain all geometric changes to models accumulated within this scope. */\n public getGeometryChanges(): Iterable<ModelGeometryChanges> {\n return { [Symbol.iterator]: () => this.geometryChangeIterator() };\n }\n\n /** @internal */\n public get isDisposed() {\n return this._disposed;\n }\n\n private * geometryChangeIterator(): Iterator<ModelGeometryChanges> {\n for (const [key, value] of this._geometryChanges) {\n yield {\n id: key,\n geometryGuid: value.geometryGuid,\n range: value.range,\n elements: value,\n };\n }\n }\n\n private constructor(iModel: BriefcaseConnection) {\n super(iModel.key);\n this.iModel = iModel;\n this._cleanup = this.registerImpl();\n }\n\n private dispose(): void {\n this._disposed = true;\n\n this.onExiting.clear();\n this.onGeometryChanges.clear();\n this.onExited.clear();\n\n this._geometryChanges.clear();\n\n if (this._cleanup) {\n this._cleanup();\n this._cleanup = undefined;\n }\n }\n\n /** @internal */\n public notifyGeometryChanged(props: ModelGeometryChangesProps[]) {\n const changes = ModelGeometryChanges.iterable(props);\n const modelIds: Id64String[] = [];\n let deletedIds: Id64Set | undefined;\n\n for (const modelChanges of changes) {\n // ###TODO do we care about the model range?\n let list = this._geometryChanges.get(modelChanges.id);\n modelIds.push(modelChanges.id);\n for (const elementChange of modelChanges.elements) {\n if (!list) {\n this._geometryChanges.set(modelChanges.id, list = new ModelChanges(modelChanges.geometryGuid, modelChanges.range));\n } else {\n list.geometryGuid = modelChanges.geometryGuid;\n modelChanges.range.clone(list.range);\n }\n\n list.insert(elementChange);\n if (DbOpcode.Delete === elementChange.type) {\n if (undefined === deletedIds)\n deletedIds = new Set<Id64String>();\n deletedIds.add(elementChange.id);\n }\n }\n }\n\n if (deletedIds) {\n this.iModel.selectionSet.remove(deletedIds);\n this.iModel.hilited.remove({ elements: deletedIds });\n }\n\n this.onGeometryChanges.raiseEvent(changes, this);\n }\n}\n"]}
1
+ {"version":3,"file":"GraphicalEditingScope.js","sourceRoot":"","sources":["../../src/GraphicalEditingScope.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA+I;AAE/I,oDAE4B;AAC5B,mDAA+D;AAE/D,qCAAkC;AAElC,MAAM,YAAa,SAAQ,0BAAkC;IAI3D,YAAmB,YAAwB,EAAE,KAAc;QACzD,KAAK,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,IAAA,6BAAc,EAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,8BAAe,CAAC,OAAO,CAAC,CAAC;QAC7E,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAa,qBAAsB,SAAQ,4CAA4B;IACrE,IAAW,oBAAoB,KAAK,OAAO,4BAAc,CAAC,YAAY,CAAC,CAAC,CAAC;IAUzE;;OAEG;aACoB,YAAO,GAAG,IAAI,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AAM,KAAK,aAAa,CAAC,IAAI,EAAE,CAAC;oBAC3C,IAAI,SAAS,KAAK,UAAU;wBAC1B,UAAU,GAAG,IAAI,GAAG,EAAc,CAAC;oBACrC,UAAU,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;gBACnC,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YAC5C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC;QACvD,CAAC;QAED,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;;AA3JH,sDA4JC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module IModelConnection\n */\n\nimport { assert, BeEvent, compareStrings, DbOpcode, DuplicatePolicy, GuidString, Id64Set, Id64String, SortedArray } from \"@itwin/core-bentley\";\nimport { Range3d } from \"@itwin/core-geometry\";\nimport {\n EditingScopeNotifications, ElementGeometryChange, ipcAppChannels, ModelGeometryChanges, ModelGeometryChangesProps, RemoveFunction,\n} from \"@itwin/core-common\";\nimport { BriefcaseNotificationHandler } from \"./BriefcaseTxns\";\nimport { BriefcaseConnection } from \"./BriefcaseConnection\";\nimport { IpcApp } from \"./IpcApp\";\n\nclass ModelChanges extends SortedArray<ElementGeometryChange> {\n public geometryGuid: GuidString;\n public readonly range: Range3d;\n\n public constructor(geometryGuid: GuidString, range: Range3d) {\n super((lhs, rhs) => compareStrings(lhs.id, rhs.id), DuplicatePolicy.Replace);\n this.geometryGuid = geometryGuid;\n this.range = range;\n }\n}\n\n/** Represents a period of time within an [interactive editing]($docs/learning/InteractiveEditing.md) session during which the\n * geometry of elements being displayed in one or more [[Viewport]]s is being modified. Outside of such a scope, whenever the\n * geometry within a [GeometricModel]($backend) changes new [[Tile]]s must be generated to reflect those changes in a viewport.\n * Regenerating entire tiles each time individual elements change can be time-consuming, which may introduce an unacceptable delay\n * between making a modification and seeing its result on the screen.\n *\n * Within the context of a graphical editing scope, no new tiles are generated. Instead, the geometry for any deleted or modified elements\n * is hidden in the tile graphics, and additional temporary graphics are displayed for any newly-inserted or modified elements. Only when the\n * scope exits are new tiles produced.\n *\n * The application decides when to enter and exit a graphical editing scope. A single interactive editing session may involve any number of\n * editing scopes. Typically, applications will enter a new editing scope (after first exiting a previous scope, if one exists):\n * - When switching from a non-graphical workflow to one that involves editing geometry; or\n * - When changing which geometric model is being edited; or\n * - After performing an operation that creates or modifies a \"large\" number (perhaps hundreds?) of elements.\n *\n * An application should typically exit any graphical editing scope before:\n * - Pulling changesets; or\n * - Switching from a graphical editing workflow to some non-graphical workflow.\n *\n * Graphical editing scopes are only supported for [[BriefcaseConnection]]s opened in read-write mode that contain version 1.0.11 or newer of the BisCore schema.\n * @see [[BriefcaseConnection.enterEditingScope]] to create a scope for a briefcase.\n * @see [[BriefcaseConnection.editingScope]] to obtain a briefcase's current scope.\n * @see [[exit]] to terminate a scope.\n * @public\n */\nexport class GraphicalEditingScope extends BriefcaseNotificationHandler implements EditingScopeNotifications {\n public get briefcaseChannelName() { return ipcAppChannels.editingScope; }\n\n /** Maps model Id to accumulated changes to geometric elements within the associated model. */\n private readonly _geometryChanges = new Map<Id64String, ModelChanges>();\n private _disposed = false;\n private _cleanup?: RemoveFunction;\n\n /** The connection to the iModel being edited. */\n public readonly iModel: BriefcaseConnection;\n\n /** Event raised when a new scope is created for any [[BriefcaseConnection]].\n * @see [[onExiting]] and [[onExited]] for complementary events.\n */\n public static readonly onEnter = new BeEvent<(scope: GraphicalEditingScope) => void>();\n\n /** Event raised when this scope is about to exit.\n * @see [[onEnter]] for the complementary event.\n * @see [[onExited]] for an event raised after the scope exits.\n */\n public readonly onExiting = new BeEvent<(scope: GraphicalEditingScope) => void>();\n\n /** Event raised when this scope has exited.\n * @see [[onEnter]] for the complementary event.\n * @see [[onExiting]] for an event raised just before the scope is exited.\n */\n public readonly onExited = new BeEvent<(scope: GraphicalEditingScope) => void>();\n\n /** Event raised after geometric changes are written to the iModel. */\n public readonly onGeometryChanges = new BeEvent<(changes: Iterable<ModelGeometryChanges>, scope: GraphicalEditingScope) => void>();\n\n /** Don't call this directly - use BriefcaseConnection.enterEditingScope.\n * @internal\n */\n public static async enter(imodel: BriefcaseConnection): Promise<GraphicalEditingScope> {\n if (imodel.editingScope)\n throw new Error(\"Cannot create an editing scope for an iModel that already has one\");\n\n // Register the scope synchronously, in case enter() is called again for same iModel while awaiting asynchronous initialization.\n const scope = new GraphicalEditingScope(imodel);\n try {\n const scopeStarted = await IpcApp.appFunctionIpc.toggleGraphicalEditingScope(imodel.key, true);\n assert(scopeStarted); // If it didn't, the backend threw an error.\n } catch (e) {\n scope.dispose();\n throw e;\n }\n\n this.onEnter.raiseEvent(scope);\n\n return scope;\n }\n\n /** Exits this editing scope. The associated [[BriefcaseConnection]]'s `editingScope` will be reset to `undefined`.\n * @throws Error if the scope could not be exited, e.g., if it has already been exited.\n * @see [[BriefcaseConnection.enterEditingScope]] to enter an editing scope.\n */\n public async exit(): Promise<void> {\n if (this._disposed || this.iModel.editingScope !== this)\n throw new Error(\"Cannot exit editing scope after it is disconnected from the iModel\");\n\n this._disposed = true;\n try {\n this.onExiting.raiseEvent(this);\n } finally {\n const scopeExited = await IpcApp.appFunctionIpc.toggleGraphicalEditingScope(this.iModel.key, false);\n assert(!scopeExited);\n try {\n this.onExited.raiseEvent(this);\n } finally {\n this.dispose();\n }\n }\n }\n\n /** Obtain all geometric changes to elements within the specified model accumulated within this scope. */\n public getGeometryChangesForModel(modelId: Id64String): Iterable<ElementGeometryChange> | undefined {\n return this._geometryChanges.get(modelId);\n }\n\n /** Obtain all geometric changes to models accumulated within this scope. */\n public getGeometryChanges(): Iterable<ModelGeometryChanges> {\n return { [Symbol.iterator]: () => this.geometryChangeIterator() };\n }\n\n /** @internal */\n public get isDisposed() {\n return this._disposed;\n }\n\n private * geometryChangeIterator(): Iterator<ModelGeometryChanges> {\n for (const [key, value] of this._geometryChanges) {\n yield {\n id: key,\n geometryGuid: value.geometryGuid,\n range: value.range,\n elements: value,\n };\n }\n }\n\n private constructor(iModel: BriefcaseConnection) {\n super(iModel.key);\n this.iModel = iModel;\n this._cleanup = this.registerImpl();\n }\n\n private dispose(): void {\n this._disposed = true;\n\n this.onExiting.clear();\n this.onGeometryChanges.clear();\n this.onExited.clear();\n\n this._geometryChanges.clear();\n\n if (this._cleanup) {\n this._cleanup();\n this._cleanup = undefined;\n }\n }\n\n /** @internal */\n public notifyGeometryChanged(props: ModelGeometryChangesProps[]) {\n const changes = ModelGeometryChanges.iterable(props);\n const modelIds: Id64String[] = [];\n let deletedIds: Id64Set | undefined;\n\n for (const modelChanges of changes) {\n // ###TODO do we care about the model range?\n let list = this._geometryChanges.get(modelChanges.id);\n modelIds.push(modelChanges.id);\n for (const elementChange of modelChanges.elements) {\n if (!list) {\n this._geometryChanges.set(modelChanges.id, list = new ModelChanges(modelChanges.geometryGuid, modelChanges.range));\n } else {\n list.geometryGuid = modelChanges.geometryGuid;\n modelChanges.range.clone(list.range);\n }\n\n list.insert(elementChange);\n if (DbOpcode.Delete === elementChange.type) {\n if (undefined === deletedIds)\n deletedIds = new Set<Id64String>();\n deletedIds.add(elementChange.id);\n }\n }\n }\n\n if (deletedIds) {\n this.iModel.selectionSet.remove(deletedIds);\n this.iModel.hilited.remove({ elements: deletedIds });\n }\n\n this.onGeometryChanges.raiseEvent(changes, this);\n }\n}\n"]}
@@ -32,7 +32,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
32
32
  var __importDefault = (this && this.__importDefault) || function (mod) {
33
33
  return (mod && mod.__esModule) ? mod : { "default": mod };
34
34
  };
35
- var _a;
36
35
  Object.defineProperty(exports, "__esModule", { value: true });
37
36
  exports.IModelApp = exports.ITWINJS_CORE_VERSION = void 0;
38
37
  // @ts-expect-error package.json will resolve from the lib/{cjs,esm} dir without copying it into the build output we deliver
@@ -89,8 +88,18 @@ require("./IModeljs-css");
89
88
  * @public
90
89
  */
91
90
  class IModelApp {
91
+ static { this._initialized = false; }
92
+ static { this._wantEventLoop = false; }
93
+ static { this._animationRequested = false; }
94
+ static { this._animationInterval = core_bentley_1.BeDuration.fromSeconds(1); }
92
95
  // No instances of IModelApp may be created. All members are static and must be on the singleton object IModelApp.
93
96
  constructor() { }
97
+ /** Event raised just before the frontend IModelApp is to be [[shutdown]]. */
98
+ static { this.onBeforeShutdown = new core_bentley_1.BeEvent(); }
99
+ /** Event raised after IModelApp [[startup]] completes. */
100
+ static { this.onAfterStartup = new core_bentley_1.BeEvent(); }
101
+ /** The [[ToolRegistry]] for this session. */
102
+ static { this.tools = new Tool_1.ToolRegistry(); }
94
103
  /** The [[MapLayerFormatRegistry]] for this session. */
95
104
  static get mapLayerFormatRegistry() { return this._mapLayerFormatRegistry; }
96
105
  /** The [[TerrainProviderRegistry]] for this session. */
@@ -153,6 +162,14 @@ class IModelApp {
153
162
  * The path should always end with a trailing `/`.
154
163
  */
155
164
  static get publicPath() { return this._publicPath; }
165
+ /** The [[TelemetryManager]] for this session
166
+ * @internal
167
+ */
168
+ static { this.telemetry = new core_telemetry_1.TelemetryManager(); }
169
+ /** @alpha */
170
+ static { this.extensionAdmin = this._createExtensionAdmin(); }
171
+ /** Map of classFullName to EntityState class */
172
+ static { this._entityClasses = new Map(); }
156
173
  /** Register all of the subclasses of EntityState from a module.
157
174
  * @internal
158
175
  */
@@ -277,7 +294,7 @@ class IModelApp {
277
294
  window.iModelAppForDebugger = undefined;
278
295
  }
279
296
  this._wantEventLoop = false;
280
- window.removeEventListener("resize", () => _a.requestNextAnimation());
297
+ window.removeEventListener("resize", () => IModelApp.requestNextAnimation());
281
298
  this.clearIntervalAnimation();
282
299
  [this.toolAdmin, this.viewManager, this.tileAdmin].forEach((sys) => sys.onShutDown());
283
300
  this.tools.shutdown();
@@ -295,14 +312,14 @@ class IModelApp {
295
312
  * @param interval The interval at which to poll for changes. If undefined (or negative), the application will never poll. If zero, the application will poll as frequently as possible.
296
313
  * @beta
297
314
  */
298
- static get animationInterval() { return _a._animationInterval; }
315
+ static get animationInterval() { return IModelApp._animationInterval; }
299
316
  static set animationInterval(interval) {
300
317
  if (undefined !== interval && interval.isTowardsPast)
301
318
  interval = undefined;
302
- if (interval !== _a._animationInterval) {
303
- _a._animationInterval = interval;
304
- if (_a._wantEventLoop)
305
- _a.requestIntervalAnimation();
319
+ if (interval !== IModelApp._animationInterval) {
320
+ IModelApp._animationInterval = interval;
321
+ if (IModelApp._wantEventLoop)
322
+ IModelApp.requestIntervalAnimation();
306
323
  }
307
324
  }
308
325
  /** Request that the event loop execute on the next [animation frame](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame).
@@ -310,35 +327,35 @@ class IModelApp {
310
327
  */
311
328
  static requestNextAnimation() {
312
329
  // Only want to call requestAnimationFrame if it is defined. Need to check whether current iModelApp is a NoRenderApp.
313
- if (_a._noRender)
330
+ if (IModelApp._noRender)
314
331
  return;
315
- if (!_a._animationRequested) {
316
- _a._animationRequested = true;
317
- requestAnimationFrame(() => _a.eventLoop());
332
+ if (!IModelApp._animationRequested) {
333
+ IModelApp._animationRequested = true;
334
+ requestAnimationFrame(() => IModelApp.eventLoop());
318
335
  }
319
336
  }
320
337
  /** @internal */
321
338
  static clearIntervalAnimation() {
322
- if (undefined !== _a._animationIntervalId) {
323
- window.clearInterval(_a._animationIntervalId);
324
- _a._animationIntervalId = undefined;
339
+ if (undefined !== IModelApp._animationIntervalId) {
340
+ window.clearInterval(IModelApp._animationIntervalId);
341
+ IModelApp._animationIntervalId = undefined;
325
342
  }
326
343
  }
327
344
  /** @internal */
328
345
  static requestIntervalAnimation() {
329
- _a.clearIntervalAnimation();
330
- if (undefined !== _a.animationInterval)
331
- _a._animationIntervalId = window.setInterval(() => {
332
- _a.requestNextAnimation();
333
- }, _a.animationInterval.milliseconds);
346
+ IModelApp.clearIntervalAnimation();
347
+ if (undefined !== IModelApp.animationInterval)
348
+ IModelApp._animationIntervalId = window.setInterval(() => {
349
+ IModelApp.requestNextAnimation();
350
+ }, IModelApp.animationInterval.milliseconds);
334
351
  }
335
352
  /** @internal */
336
353
  static startEventLoop() {
337
- if (!_a._wantEventLoop) {
338
- _a._wantEventLoop = true;
339
- window.addEventListener("resize", () => _a.requestNextAnimation());
340
- _a.requestIntervalAnimation();
341
- _a.requestNextAnimation();
354
+ if (!IModelApp._wantEventLoop) {
355
+ IModelApp._wantEventLoop = true;
356
+ window.addEventListener("resize", () => IModelApp.requestNextAnimation());
357
+ IModelApp.requestIntervalAnimation();
358
+ IModelApp.requestNextAnimation();
342
359
  }
343
360
  }
344
361
  /** Strictly for tests. @internal */
@@ -347,19 +364,19 @@ class IModelApp {
347
364
  }
348
365
  /** The main event processing loop for Tools and rendering. */
349
366
  static eventLoop() {
350
- _a._animationRequested = false;
351
- if (!_a._wantEventLoop) // flag turned on at startup
367
+ IModelApp._animationRequested = false;
368
+ if (!IModelApp._wantEventLoop) // flag turned on at startup
352
369
  return;
353
370
  try {
354
- _a.toolAdmin.processEvent(); // eslint-disable-line @typescript-eslint/no-floating-promises
355
- _a.viewManager.renderLoop();
356
- _a.tileAdmin.process();
371
+ IModelApp.toolAdmin.processEvent(); // eslint-disable-line @typescript-eslint/no-floating-promises
372
+ IModelApp.viewManager.renderLoop();
373
+ IModelApp.tileAdmin.process();
357
374
  }
358
375
  catch (exception) {
359
376
  ToolAdmin_1.ToolAdmin.exceptionHandler(exception); // eslint-disable-line @typescript-eslint/no-floating-promises
360
- _a._wantEventLoop = false;
361
- _a._animationRequested = true; // unrecoverable after exception, don't request any further frames.
362
- window.removeEventListener("resize", () => _a.requestNextAnimation());
377
+ IModelApp._wantEventLoop = false;
378
+ IModelApp._animationRequested = true; // unrecoverable after exception, don't request any further frames.
379
+ window.removeEventListener("resize", () => IModelApp.requestNextAnimation());
363
380
  }
364
381
  }
365
382
  /** Get the user's access token for this IModelApp, or a blank string if none is available.
@@ -389,7 +406,7 @@ class IModelApp {
389
406
  sessionId: this.sessionId,
390
407
  authorization: core_bentley_1.ProcessDetector.isMobileAppFrontend ? "" : await this.getAccessToken(),
391
408
  };
392
- const csrf = _a.securityOptions.csrfProtection;
409
+ const csrf = IModelApp.securityOptions.csrfProtection;
393
410
  if (csrf && csrf.enabled) {
394
411
  const cookieName = csrf.cookieName || "XSRF-TOKEN";
395
412
  const cookieValue = document.cookie.split("; ").find((r) => r.startsWith(`${cookieName}=`));
@@ -426,7 +443,7 @@ class IModelApp {
426
443
  static makeModalDiv(options) {
427
444
  const root = options.rootDiv ? options.rootDiv : document.body;
428
445
  // create the overlay div to "black out" the application to indicate everything is inactive until the modal has been dismissed.
429
- const overlay = _a.makeHTMLElement("div", { parent: root, className: "imodeljs-modal-overlay" });
446
+ const overlay = IModelApp.makeHTMLElement("div", { parent: root, className: "imodeljs-modal-overlay" });
430
447
  overlay.tabIndex = -1; // so we can catch keystroke events
431
448
  // function to remove modal dialog
432
449
  const stop = (ev) => {
@@ -446,14 +463,14 @@ class IModelApp {
446
463
  };
447
464
  overlay.focus();
448
465
  }
449
- const modal = _a.makeHTMLElement("div", { parent: overlay, className: "imodeljs-modal" });
466
+ const modal = IModelApp.makeHTMLElement("div", { parent: overlay, className: "imodeljs-modal" });
450
467
  if (undefined !== options.width) {
451
468
  modal.style.width = `${options.width}px`;
452
469
  // allow the dialog to be smaller than the width
453
470
  modal.style.maxWidth = `min(100% - (2 * var(--width-border)), ${options.width}px)`;
454
471
  }
455
472
  if (options.closeBox) {
456
- const close = _a.makeHTMLElement("p", { parent: modal, className: "imodeljs-modal-close" });
473
+ const close = IModelApp.makeHTMLElement("p", { parent: modal, className: "imodeljs-modal-close" });
457
474
  close.innerText = "\u00d7"; // unicode "times" symbol
458
475
  close.onclick = stop;
459
476
  }
@@ -464,27 +481,27 @@ class IModelApp {
464
481
  * @beta
465
482
  */
466
483
  static makeLogoCard(opts) {
467
- const card = _a.makeHTMLElement("tr");
468
- const iconCell = _a.makeHTMLElement("td", { parent: card, className: "logo-card-logo" });
484
+ const card = IModelApp.makeHTMLElement("tr");
485
+ const iconCell = IModelApp.makeHTMLElement("td", { parent: card, className: "logo-card-logo" });
469
486
  if (undefined !== opts.iconSrc) {
470
487
  if (typeof opts.iconSrc === "string") {
471
- const logo = _a.makeHTMLElement("img");
488
+ const logo = IModelApp.makeHTMLElement("img");
472
489
  logo.src = opts.iconSrc;
473
490
  logo.width = opts.iconWidth ? opts.iconWidth : 64;
474
491
  opts.iconSrc = logo;
475
492
  }
476
493
  iconCell.appendChild(opts.iconSrc);
477
494
  }
478
- const noticeCell = _a.makeHTMLElement("td", { parent: card, className: "logo-card-message" });
495
+ const noticeCell = IModelApp.makeHTMLElement("td", { parent: card, className: "logo-card-message" });
479
496
  if (undefined !== opts.heading) {
480
497
  if (typeof opts.heading === "string")
481
- _a.makeHTMLElement("h2", { parent: noticeCell, innerHTML: opts.heading, className: "logo-card-header" });
498
+ IModelApp.makeHTMLElement("h2", { parent: noticeCell, innerHTML: opts.heading, className: "logo-card-header" });
482
499
  else
483
500
  noticeCell.appendChild(opts.heading);
484
501
  }
485
502
  if (undefined !== opts.notice) {
486
503
  if (typeof opts.notice === "string")
487
- _a.makeHTMLElement("p", { parent: noticeCell, innerHTML: opts.notice, className: "logo-cards" });
504
+ IModelApp.makeHTMLElement("p", { parent: noticeCell, innerHTML: opts.notice, className: "logo-cards" });
488
505
  else
489
506
  noticeCell.appendChild(opts.notice);
490
507
  }
@@ -505,7 +522,7 @@ class IModelApp {
505
522
  */
506
523
  static formatElementToolTip(msg) {
507
524
  let out = "";
508
- msg.forEach((line) => out += `${_a.localization?.getLocalizedKeys(line)}<br>`);
525
+ msg.forEach((line) => out += `${IModelApp.localization?.getLocalizedKeys(line)}<br>`);
509
526
  const div = document.createElement("div");
510
527
  div.innerHTML = out;
511
528
  return div;
@@ -538,28 +555,9 @@ class IModelApp {
538
555
  */
539
556
  static _createExtensionAdmin() {
540
557
  const extensionAdmin = new ExtensionAdmin_1.ExtensionAdmin();
541
- _a.onAfterStartup.addListener(extensionAdmin.onStartup);
558
+ IModelApp.onAfterStartup.addListener(extensionAdmin.onStartup);
542
559
  return extensionAdmin;
543
560
  }
544
561
  }
545
562
  exports.IModelApp = IModelApp;
546
- _a = IModelApp;
547
- IModelApp._initialized = false;
548
- IModelApp._wantEventLoop = false;
549
- IModelApp._animationRequested = false;
550
- IModelApp._animationInterval = core_bentley_1.BeDuration.fromSeconds(1);
551
- /** Event raised just before the frontend IModelApp is to be [[shutdown]]. */
552
- IModelApp.onBeforeShutdown = new core_bentley_1.BeEvent();
553
- /** Event raised after IModelApp [[startup]] completes. */
554
- IModelApp.onAfterStartup = new core_bentley_1.BeEvent();
555
- /** The [[ToolRegistry]] for this session. */
556
- IModelApp.tools = new Tool_1.ToolRegistry();
557
- /** The [[TelemetryManager]] for this session
558
- * @internal
559
- */
560
- IModelApp.telemetry = new core_telemetry_1.TelemetryManager();
561
- /** @alpha */
562
- IModelApp.extensionAdmin = _a._createExtensionAdmin();
563
- /** Map of classFullName to EntityState class */
564
- IModelApp._entityClasses = new Map();
565
563
  //# sourceMappingURL=IModelApp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IModelApp.js","sourceRoot":"","sources":["../../src/IModelApp.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4HAA4H;AAC5H,wDAAwD;AACxD,sEAA6C;AAC7C,cAAc;AACD,QAAA,oBAAoB,GAAG,sBAAW,CAAC,OAAiB,CAAC;AAClE,MAAM,gBAAgB,GAAG,6HAA6H,CAAC;AAEvJ,0DAAgD;AAChD,sDAAoJ;AACpJ,oDAE4B;AAC5B,gD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CAAsB;AAuElD;;GAEG;AACoB,mBAAS,GAAqB,IAAI,iCAAgB,EAAE,AAA3C,CAA4C;AAE5E,aAAa;AACU,wBAAc,GAAG,EAAI,CAAC,qBAAqB,EAAE,AAA/B,CAAgC;AAErE,gDAAgD;AACjC,wBAAc,GAAG,IAAI,GAAG,EAA8B,AAAxC,CAAyC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module IModelApp\n */\n\n// @ts-expect-error package.json will resolve from the lib/{cjs,esm} dir without copying it into the build output we deliver\n// eslint-disable-next-line @itwin/import-within-package\nimport packageJson from \"../../package.json\";\n/** @public */\nexport const ITWINJS_CORE_VERSION = packageJson.version as string;\nconst COPYRIGHT_NOTICE = 'Copyright © 2017-2024 <a href=\"https://www.bentley.com\" target=\"_blank\" rel=\"noopener noreferrer\">Bentley Systems, Inc.</a>';\n\nimport { UiAdmin } from \"@itwin/appui-abstract\";\nimport { AccessToken, BeDuration, BeEvent, BentleyStatus, DbResult, dispose, Guid, GuidString, Logger, ProcessDetector } from \"@itwin/core-bentley\";\nimport {\n AuthorizationClient, IModelStatus, Localization, RealityDataAccess, RpcConfiguration, RpcInterfaceDefinition, RpcRequest, SerializedRpcActivity,\n} from \"@itwin/core-common\";\nimport { ITwinLocalization } from \"@itwin/core-i18n\";\nimport { TelemetryManager } from \"@itwin/core-telemetry\";\nimport { queryRenderCompatibility, WebGLRenderCompatibilityInfo } from \"@itwin/webgl-compatibility\";\nimport { AccuDraw } from \"./AccuDraw\";\nimport { AccuSnap } from \"./AccuSnap\";\nimport * as auxCoordState from \"./AuxCoordSys\";\nimport * as categorySelectorState from \"./CategorySelectorState\";\nimport { ExtensionAdmin } from \"./extension/ExtensionAdmin\";\nimport * as displayStyleState from \"./DisplayStyleState\";\nimport * as drawingViewState from \"./DrawingViewState\";\nimport { ElementLocateManager } from \"./ElementLocateManager\";\nimport { EntityState } from \"./EntityState\";\nimport { FrontendHubAccess } from \"./FrontendHubAccess\";\nimport { FrontendLoggerCategory } from \"./common/FrontendLoggerCategory\";\nimport * as modelselector from \"./ModelSelectorState\";\nimport * as modelState from \"./ModelState\";\nimport { NotificationManager } from \"./NotificationManager\";\nimport { QuantityFormatter } from \"./quantity-formatting/QuantityFormatter\";\nimport { RenderSystem } from \"./render/RenderSystem\";\nimport { System } from \"./render/webgl/System\";\nimport * as sheetState from \"./SheetViewState\";\nimport * as spatialViewState from \"./SpatialViewState\";\nimport { TentativePoint } from \"./TentativePoint\";\nimport { RealityDataSourceProviderRegistry } from \"./RealityDataSource\";\nimport { MapLayerFormatRegistry, MapLayerOptions, TerrainProviderRegistry, TileAdmin } from \"./tile/internal\";\nimport * as accudrawTool from \"./tools/AccuDrawTool\";\nimport * as clipViewTool from \"./tools/ClipViewTool\";\nimport * as idleTool from \"./tools/IdleTool\";\nimport * as measureTool from \"./tools/MeasureTool\";\nimport * as selectTool from \"./tools/SelectTool\";\nimport { ToolRegistry } from \"./tools/Tool\";\nimport { ToolAdmin } from \"./tools/ToolAdmin\";\nimport * as viewTool from \"./tools/ViewTool\";\nimport { UserPreferencesAccess } from \"./UserPreferences\";\nimport { ViewManager } from \"./ViewManager\";\nimport * as viewState from \"./ViewState\";\nimport \"./IModeljs-css\";\n\n// cSpell:ignore noopener noreferrer gprid forin nbsp csrf xsrf\n\n/** Options that can be supplied with [[IModelAppOptions]] to customize frontend security.\n * @public\n * @extensions\n */\nexport interface FrontendSecurityOptions {\n /** Configures protection from Cross Site Request Forgery attacks. */\n readonly csrfProtection?: {\n /** If enabled, IModelApp will extract the CSRF token for the current session from the document's cookies and send it with each request as a header value. */\n readonly enabled: boolean;\n /** Defaults to XSRF-TOKEN. */\n readonly cookieName?: string;\n /** Defaults to X-XSRF-TOKEN. */\n readonly headerName?: string;\n };\n}\n\n/** Options that can be supplied to [[IModelApp.startup]] to customize frontend behavior.\n * @public\n */\nexport interface IModelAppOptions {\n /** If present, supplies the [[FrontendHubAccess]] for this session. */\n hubAccess?: FrontendHubAccess;\n /** If present, supplies the Id of this application. Applications must set this to the Bentley Global Product Registry Id (GPRID) for usage logging. */\n applicationId?: string;\n /** If present, supplies the version of this application. Must be set for usage logging. */\n applicationVersion?: string;\n /** If present, supplies the [[UserPreferencesAccess]] for this session.\n * @beta\n */\n userPreferences?: UserPreferencesAccess;\n /** If present, supplies the [[ViewManager]] for this session. */\n viewManager?: ViewManager;\n /** If present, supplies Map Layer Options for this session such as Azure Access Keys\n * @beta\n */\n mapLayerOptions?: MapLayerOptions;\n /** If present, supplies the properties with which to initialize the [[TileAdmin]] for this session. */\n tileAdmin?: TileAdmin.Props;\n /** If present, supplies the [[NotificationManager]] for this session. */\n notifications?: NotificationManager;\n /** If present, supplies the [[ToolAdmin]] for this session. */\n toolAdmin?: ToolAdmin;\n /** If present, supplies the [[AccuDraw]] for this session. */\n accuDraw?: AccuDraw;\n /** If present, supplies the [[AccuSnap]] for this session. */\n accuSnap?: AccuSnap;\n /** If present, supplies the [[Localization]] for this session. Defaults to [ITwinLocalization]($i18n). */\n localization?: Localization;\n /** The AuthorizationClient used to obtain [AccessToken]($bentley)s. */\n authorizationClient?: AuthorizationClient;\n /** If present, supplies security options for the frontend. */\n security?: FrontendSecurityOptions;\n /** @internal */\n sessionId?: GuidString;\n /** @internal */\n locateManager?: ElementLocateManager;\n /** If present, supplies the [[TentativePoint]] for this session. */\n tentativePoint?: TentativePoint;\n /** @internal */\n quantityFormatter?: QuantityFormatter;\n /** If present, supplies an implementation of the render system, or options for initializing the default render system. */\n renderSys?: RenderSystem | RenderSystem.Options;\n /** If present, supplies the [[UiAdmin]] for this session. */\n uiAdmin?: UiAdmin;\n /** If present, determines whether iModelApp is a NoRenderApp\n * @internal\n */\n noRender?: boolean;\n /**\n * @deprecated in 3.7. Specify desired RPC interfaces in the platform-specific RPC manager call instead.\n * See [[MobileRpcManager.initializeClient]], [[ElectronRpcManager.initializeFrontend]], [[BentleyCloudRpcManager.initializeClient]].\n */\n rpcInterfaces?: RpcInterfaceDefinition[];\n /** @beta */\n realityDataAccess?: RealityDataAccess;\n /** If present, overrides where public assets are fetched. The default is to fetch assets relative to the current URL.\n * The path should always end with a trailing `/`.\n */\n publicPath?: string;\n}\n\n/** Options for [[IModelApp.makeModalDiv]]\n * @public\n */\nexport interface ModalOptions {\n /** Width for the Modal dialog box. */\n width?: number;\n /** The dialog should be dismissed if the user clicks anywhere or hits Enter or Escape on the keyboard. */\n autoClose?: boolean;\n /** Show an 'x' in the upper right corner to close the dialog */\n closeBox?: boolean;\n /** The parent for the semi transparent *darkening* div. If not present, use `document.body` */\n rootDiv?: HTMLElement;\n}\n\n/** Return type for [[IModelApp.makeModalDiv]]\n * @public\n */\nexport interface ModalReturn {\n /** The modal HTMLDivElement created. */\n modal: HTMLDivElement;\n /** A function that can be set as an event handler to stop the modal dialog. This can be used if [[ModalOptions.autoClose]] or [[IModalOptions.closeBox]]\n * were not enabled for the dialog.\n */\n stop: (_ev: Event) => void;\n}\n\n/** We hang the IModelApp object off the global `window` object in IModelApp.startup for debugging purposes.\n * It's removed in IModelApp.shutdown.\n */\ninterface IModelAppForDebugger {\n iModelAppForDebugger?: typeof IModelApp;\n}\n\n/**\n * Global singleton that connects the user interface with the iTwin.js services. There can be only one IModelApp active in a session. All\n * members of IModelApp are static, and it serves as a singleton object for gaining access to session information.\n *\n * Before any interactive operations may be performed by the `@itwin/core-frontend package`, [[IModelApp.startup]] must be called and awaited.\n * Applications may customize the frontend behavior of iTwin.js by supplying options to [[IModelApp.startup]].\n *\n * @public\n */\nexport class IModelApp {\n private static _initialized = false;\n private static _accuDraw: AccuDraw;\n private static _accuSnap: AccuSnap;\n private static _applicationId: string;\n private static _applicationVersion: string;\n private static _localization: Localization;\n private static _locateManager: ElementLocateManager;\n private static _notifications: NotificationManager;\n private static _quantityFormatter: QuantityFormatter;\n private static _renderSystem?: RenderSystem;\n private static _userPreferences?: UserPreferencesAccess;\n private static _tentativePoint: TentativePoint;\n private static _tileAdmin: TileAdmin;\n private static _toolAdmin: ToolAdmin;\n private static _viewManager: ViewManager;\n private static _uiAdmin: UiAdmin;\n private static _noRender: boolean;\n private static _wantEventLoop = false;\n private static _animationRequested = false;\n private static _animationInterval: BeDuration | undefined = BeDuration.fromSeconds(1);\n private static _animationIntervalId?: number;\n private static _securityOptions: FrontendSecurityOptions;\n private static _mapLayerFormatRegistry: MapLayerFormatRegistry;\n private static _terrainProviderRegistry: TerrainProviderRegistry;\n private static _realityDataSourceProviders: RealityDataSourceProviderRegistry;\n private static _hubAccess?: FrontendHubAccess;\n private static _realityDataAccess?: RealityDataAccess;\n private static _publicPath: string;\n\n // No instances of IModelApp may be created. All members are static and must be on the singleton object IModelApp.\n protected constructor() { }\n\n /** Event raised just before the frontend IModelApp is to be [[shutdown]]. */\n public static readonly onBeforeShutdown = new BeEvent<() => void>();\n\n /** Event raised after IModelApp [[startup]] completes. */\n public static readonly onAfterStartup = new BeEvent<() => void>();\n\n /** The AuthorizationClient used to obtain [AccessToken]($bentley)s. */\n public static authorizationClient?: AuthorizationClient;\n /** The [[ToolRegistry]] for this session. */\n public static readonly tools = new ToolRegistry();\n /** A uniqueId for this session */\n public static sessionId: GuidString;\n /** The [[MapLayerFormatRegistry]] for this session. */\n public static get mapLayerFormatRegistry(): MapLayerFormatRegistry { return this._mapLayerFormatRegistry; }\n /** The [[TerrainProviderRegistry]] for this session. */\n public static get terrainProviderRegistry(): TerrainProviderRegistry { return this._terrainProviderRegistry; }\n /** The [[RealityDataSourceProviderRegistry]] for this session.\n * @alpha\n */\n public static get realityDataSourceProviders(): RealityDataSourceProviderRegistry { return this._realityDataSourceProviders; }\n /** The [[RenderSystem]] for this session. */\n public static get renderSystem(): RenderSystem { return this._renderSystem!; }\n /** The [[ViewManager]] for this session. */\n public static get viewManager(): ViewManager { return this._viewManager; }\n /** The [[NotificationManager]] for this session. */\n public static get notifications(): NotificationManager { return this._notifications; }\n /** The [[TileAdmin]] for this session. */\n public static get tileAdmin(): TileAdmin { return this._tileAdmin; }\n /** The [[QuantityFormatter]] for this session. */\n public static get quantityFormatter(): QuantityFormatter { return this._quantityFormatter; }\n /** The [[ToolAdmin]] for this session. */\n public static get toolAdmin(): ToolAdmin { return this._toolAdmin; }\n /** The [[AccuDraw]] for this session. */\n public static get accuDraw(): AccuDraw { return this._accuDraw; }\n /** The [[AccuSnap]] for this session. */\n public static get accuSnap(): AccuSnap { return this._accuSnap; }\n public static get locateManager(): ElementLocateManager { return this._locateManager; }\n /** The [[TentativePoint]] for this session]]. */\n public static get tentativePoint(): TentativePoint { return this._tentativePoint; }\n /** The [[Localization]] for this session. */\n public static get localization(): Localization { return this._localization; }\n /** The [[UserPreferencesAccess]] for this session.\n * @beta\n */\n public static get userPreferences(): UserPreferencesAccess | undefined { return this._userPreferences; }\n /** The Id of this application. Applications must set this to the Global Product Registry ID (GPRID) for usage logging. */\n public static get applicationId(): string { return this._applicationId; }\n /** The version of this application. Must be set for usage logging. */\n public static get applicationVersion(): string { return this._applicationVersion; }\n /** True after [[startup]] has been called, until [[shutdown]] is called. */\n public static get initialized() { return this._initialized; }\n\n /** Provides access to IModelHub services. */\n public static get hubAccess(): FrontendHubAccess | undefined { return this._hubAccess; }\n\n /** Provides access to the RealityData service implementation for this IModelApp\n * @beta\n */\n public static get realityDataAccess(): RealityDataAccess | undefined { return this._realityDataAccess; }\n\n /** Whether the [renderSystem[]] has been successfully initialized.\n * This will always be `false` before calling [[startup]] and after calling [[shutdown]].\n * In rare circumstances (e.g., while executing in a headless test environment) it may remain `false` due to a failure to\n * obtain a [WebGL rendering context](https://www.google.com/search?channel=fs&client=ubuntu-sn&q=mdn+webglrenderingcontext).\n * As long as you have called [[startup]], you can generally assume it to be `true`.\n */\n public static get hasRenderSystem() {\n return this._renderSystem !== undefined && this._renderSystem.isValid;\n }\n\n /** The [[UiAdmin]] for this session. */\n public static get uiAdmin() { return this._uiAdmin; }\n /** The requested security options for the frontend. */\n public static get securityOptions() { return this._securityOptions; }\n\n /** If present, overrides where public assets are fetched. The default is to fetch assets relative to the current URL.\n * The path should always end with a trailing `/`.\n */\n public static get publicPath() { return this._publicPath; }\n\n /** The [[TelemetryManager]] for this session\n * @internal\n */\n public static readonly telemetry: TelemetryManager = new TelemetryManager();\n\n /** @alpha */\n public static readonly extensionAdmin = this._createExtensionAdmin();\n\n /** Map of classFullName to EntityState class */\n private static _entityClasses = new Map<string, typeof EntityState>();\n\n /** Register all of the subclasses of EntityState from a module.\n * @internal\n */\n public static registerModuleEntities(moduleObj: any) {\n for (const thisMember in moduleObj) { // eslint-disable-line guard-for-in\n const thisEntityState = moduleObj[thisMember];\n if (thisEntityState.prototype instanceof EntityState) {\n this.registerEntityState(thisEntityState.classFullName, thisEntityState);\n }\n }\n }\n\n /** Register an EntityState class by its classFullName\n * @internal\n */\n public static registerEntityState(classFullName: string, classType: typeof EntityState) {\n const lowerName = classFullName.toLowerCase();\n if (this._entityClasses.has(lowerName)) {\n const errMsg = `Class ${classFullName} is already registered. Make sure static schemaName and className members are correct on class ${classType.name}`;\n Logger.logError(FrontendLoggerCategory.IModelConnection, errMsg);\n throw new Error(errMsg);\n }\n\n this._entityClasses.set(lowerName, classType);\n }\n\n /** @internal */\n public static lookupEntityClass(classFullName: string) { return this._entityClasses.get(classFullName.toLowerCase()); }\n\n /**\n * Obtain WebGL rendering compatibility information for the client system. This information describes whether the client meets the\n * minimum rendering capabilities. It also describes whether the system lacks any optional capabilities that could improve quality\n * and/or performance.\n * @note As of 4.x, iTwin.js requires WebGL 2. If the client does not support WebGL 2, the `status` field of the returned compatibility info will be [WebGLRenderCompatibilityStatus.CannotCreateContext]($webgl-compatibility).\n */\n public static queryRenderCompatibility(): WebGLRenderCompatibilityInfo {\n return queryRenderCompatibility(true, (canvas, useWebGL2, inputContextAttributes) => System.createContext(canvas, useWebGL2, inputContextAttributes));\n }\n\n /**\n * This method must be called before any other `@itwin/core-frontend` methods are used.\n * Somewhere in your startup code, call [[IModelApp.startup]]. E.g.:\n * ``` ts\n * await IModelApp.startup( {applicationId: myAppId} );\n * ```\n * @param opts The options for configuring IModelApp\n */\n public static async startup(opts?: IModelAppOptions): Promise<void> {\n if (this._initialized)\n return; // we're already initialized, do nothing.\n this._initialized = true;\n\n opts = opts ?? {};\n this._securityOptions = opts.security ?? {};\n\n if (process.env.NODE_ENV === \"development\") {\n // Make IModelApp globally accessible for debugging purposes. We'll remove it on shutdown.\n (window as IModelAppForDebugger).iModelAppForDebugger = this;\n }\n\n this.sessionId = opts.sessionId ?? Guid.createValue();\n this._applicationId = opts.applicationId ?? \"2686\"; // Default to product id of iTwin.js\n this._applicationVersion = opts.applicationVersion ?? \"1.0.0\";\n this.authorizationClient = opts.authorizationClient;\n this._hubAccess = opts.hubAccess;\n this._noRender = opts.noRender ?? false;\n\n this._setupRpcRequestContext();\n\n this._localization = opts.localization ?? new ITwinLocalization();\n const toolsNs = \"CoreTools\";\n await this.localization.initialize([\"iModelJs\", toolsNs]);\n [\n selectTool,\n idleTool,\n viewTool,\n clipViewTool,\n measureTool,\n accudrawTool,\n ].forEach((tool) => this.tools.registerModule(tool, toolsNs));\n\n this.registerEntityState(EntityState.classFullName, EntityState);\n [\n modelState,\n sheetState,\n viewState,\n drawingViewState,\n spatialViewState,\n displayStyleState,\n modelselector,\n categorySelectorState,\n auxCoordState,\n ].forEach((module) => this.registerModuleEntities(module));\n\n this._renderSystem = (opts.renderSys instanceof RenderSystem) ? opts.renderSys : this.createRenderSys(opts.renderSys);\n if (opts.userPreferences)\n this._userPreferences = opts.userPreferences;\n this._viewManager = opts.viewManager ?? new ViewManager();\n this._tileAdmin = await TileAdmin.create(opts.tileAdmin);\n this._notifications = opts.notifications ?? new NotificationManager();\n this._toolAdmin = opts.toolAdmin ?? new ToolAdmin();\n this._accuDraw = opts.accuDraw ?? new AccuDraw();\n this._accuSnap = opts.accuSnap ?? new AccuSnap();\n this._locateManager = opts.locateManager ?? new ElementLocateManager();\n this._tentativePoint = opts.tentativePoint ?? new TentativePoint();\n this._quantityFormatter = opts.quantityFormatter ?? new QuantityFormatter();\n this._uiAdmin = opts.uiAdmin ?? new UiAdmin();\n this._mapLayerFormatRegistry = new MapLayerFormatRegistry(opts.mapLayerOptions);\n this._terrainProviderRegistry = new TerrainProviderRegistry();\n this._realityDataSourceProviders = new RealityDataSourceProviderRegistry();\n this._realityDataAccess = opts.realityDataAccess;\n this._publicPath = opts.publicPath ?? \"\";\n\n [\n this.renderSystem,\n this.viewManager,\n this.toolAdmin,\n this.accuDraw,\n this.accuSnap,\n this.locateManager,\n this.tentativePoint,\n this.uiAdmin,\n ].forEach((sys) => sys.onInitialized());\n\n await this.quantityFormatter.onInitialized();\n this.onAfterStartup.raiseEvent();\n }\n\n /** Must be called before the application exits to release any held resources. */\n public static async shutdown() {\n if (!this._initialized)\n return;\n\n // notify listeners that this IModelApp is about to be shut down.\n this.onBeforeShutdown.raiseEvent();\n this.onBeforeShutdown.clear();\n\n if (process.env.NODE_ENV === \"development\") {\n (window as IModelAppForDebugger).iModelAppForDebugger = undefined;\n }\n\n this._wantEventLoop = false;\n window.removeEventListener(\"resize\", () => IModelApp.requestNextAnimation());\n this.clearIntervalAnimation();\n [this.toolAdmin, this.viewManager, this.tileAdmin].forEach((sys) => sys.onShutDown());\n this.tools.shutdown();\n this._renderSystem = dispose(this._renderSystem);\n this._entityClasses.clear();\n this.authorizationClient = undefined;\n this._initialized = false;\n this.onAfterStartup.clear();\n }\n\n /** Controls how frequently the application polls for changes that may require a new animation frame to be requested.\n * Such changes include resizing a Viewport or changing the device pixel ratio by zooming in or out in the browser.\n * The default interval is 1 second. It may be desirable to override the default for specific apps and/or devices.\n * - Increasing the interval can conserve battery life on battery-powered devices at the expense of slower response to resize events.\n * - An application that only displays a single Viewport whose dimensions only change when the dimensions of the application window change, and which does not support changing application zoom level, could disable the interval altogether.\n * @param interval The interval at which to poll for changes. If undefined (or negative), the application will never poll. If zero, the application will poll as frequently as possible.\n * @beta\n */\n public static get animationInterval(): BeDuration | undefined { return IModelApp._animationInterval; }\n public static set animationInterval(interval: BeDuration | undefined) {\n if (undefined !== interval && interval.isTowardsPast)\n interval = undefined;\n\n if (interval !== IModelApp._animationInterval) {\n IModelApp._animationInterval = interval;\n if (IModelApp._wantEventLoop)\n IModelApp.requestIntervalAnimation();\n }\n }\n\n /** Request that the event loop execute on the next [animation frame](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame).\n * There is generally no reason for applications to invoke this method directly.\n */\n public static requestNextAnimation() {\n // Only want to call requestAnimationFrame if it is defined. Need to check whether current iModelApp is a NoRenderApp.\n if (IModelApp._noRender)\n return;\n\n if (!IModelApp._animationRequested) {\n IModelApp._animationRequested = true;\n requestAnimationFrame(() => IModelApp.eventLoop());\n }\n }\n\n /** @internal */\n private static clearIntervalAnimation(): void {\n if (undefined !== IModelApp._animationIntervalId) {\n window.clearInterval(IModelApp._animationIntervalId);\n IModelApp._animationIntervalId = undefined;\n }\n }\n\n /** @internal */\n private static requestIntervalAnimation(): void {\n IModelApp.clearIntervalAnimation();\n\n if (undefined !== IModelApp.animationInterval)\n IModelApp._animationIntervalId = window.setInterval(() => {\n IModelApp.requestNextAnimation();\n }, IModelApp.animationInterval.milliseconds);\n }\n\n /** @internal */\n public static startEventLoop() {\n if (!IModelApp._wantEventLoop) {\n IModelApp._wantEventLoop = true;\n window.addEventListener(\"resize\", () => IModelApp.requestNextAnimation());\n IModelApp.requestIntervalAnimation();\n IModelApp.requestNextAnimation();\n }\n }\n\n /** Strictly for tests. @internal */\n public static stopEventLoop() {\n this._wantEventLoop = false;\n }\n\n /** The main event processing loop for Tools and rendering. */\n private static eventLoop() {\n IModelApp._animationRequested = false;\n if (!IModelApp._wantEventLoop) // flag turned on at startup\n return;\n\n try {\n IModelApp.toolAdmin.processEvent(); // eslint-disable-line @typescript-eslint/no-floating-promises\n IModelApp.viewManager.renderLoop();\n IModelApp.tileAdmin.process();\n } catch (exception) {\n ToolAdmin.exceptionHandler(exception); // eslint-disable-line @typescript-eslint/no-floating-promises\n\n IModelApp._wantEventLoop = false;\n IModelApp._animationRequested = true; // unrecoverable after exception, don't request any further frames.\n window.removeEventListener(\"resize\", () => IModelApp.requestNextAnimation());\n }\n }\n\n /** Get the user's access token for this IModelApp, or a blank string if none is available.\n * @note Access tokens expire periodically and are automatically refreshed, if possible. Therefore tokens should not be saved, and the value\n * returned by this method may change over time throughout the course of a session.\n */\n public static async getAccessToken(): Promise<AccessToken> {\n try {\n return (await this.authorizationClient?.getAccessToken()) ?? \"\";\n } catch {\n return \"\";\n }\n }\n\n /** @internal */\n public static createRenderSys(opts?: RenderSystem.Options): RenderSystem { return System.create(opts); }\n\n private static _setupRpcRequestContext() {\n RpcConfiguration.requestContext.getId = (_request: RpcRequest): string => {\n return Guid.createValue();\n };\n\n RpcConfiguration.requestContext.serialize = async (_request: RpcRequest): Promise<SerializedRpcActivity> => {\n const id = _request.id;\n const serialized: SerializedRpcActivity = {\n id,\n applicationId: this.applicationId,\n applicationVersion: this.applicationVersion,\n sessionId: this.sessionId,\n authorization: ProcessDetector.isMobileAppFrontend ? \"\" : await this.getAccessToken(),\n };\n\n const csrf = IModelApp.securityOptions.csrfProtection;\n if (csrf && csrf.enabled) {\n const cookieName = csrf.cookieName || \"XSRF-TOKEN\";\n const cookieValue = document.cookie.split(\"; \").find((r) => r.startsWith(`${cookieName}=`));\n\n if (cookieValue) {\n const headerName = csrf.headerName || \"X-XSRF-TOKEN\";\n const headerValue = cookieValue.split(\"=\")[1];\n serialized.csrfToken = { headerName, headerValue };\n }\n }\n\n return serialized;\n };\n }\n\n /** Shortcut for creating an HTMLElement with optional parent, className, id, innerHTML, innerText. */\n public static makeHTMLElement<K extends keyof HTMLElementTagNameMap>(type: K, opt?: {\n /** The parent for the new HTMLElement */\n parent?: HTMLElement;\n /** The className for the new HTMLElement */\n className?: string;\n /** The Id for the new HTMLElement */\n id?: string;\n /** innerHTML for the new HTMLElement */\n innerHTML?: string;\n /** innerText for the new HTMLElement */\n innerText?: string;\n }) {\n const el = document.createElement(type);\n if (undefined !== opt) {\n if (undefined !== opt.className)\n el.className = opt.className;\n if (undefined !== opt.id)\n el.id = opt.id;\n if (undefined !== opt.innerHTML)\n el.innerHTML = opt.innerHTML;\n if (undefined !== opt.innerText)\n el.innerText = opt.innerText;\n if (undefined !== opt.parent)\n opt.parent.appendChild(el);\n }\n return el;\n }\n\n /** Shortcut for making a modal dialog on top of the root of the application. The returned HTMLDivElement will be placed topmost, all other application\n * windows will be covered with a semi-transparent background that intercepts all key/mouse/touch events until the modal is dismissed.\n * @param options The options that describe how the modal should work.\n */\n public static makeModalDiv(options: ModalOptions): ModalReturn {\n const root = options.rootDiv ? options.rootDiv : document.body;\n // create the overlay div to \"black out\" the application to indicate everything is inactive until the modal has been dismissed.\n const overlay = IModelApp.makeHTMLElement(\"div\", { parent: root, className: \"imodeljs-modal-overlay\" });\n overlay.tabIndex = -1; // so we can catch keystroke events\n\n // function to remove modal dialog\n const stop = (ev: Event) => {\n root.removeChild(overlay);\n ev.stopPropagation();\n };\n\n if (options.autoClose) {\n overlay.onclick = overlay.oncontextmenu = stop;\n overlay.onkeydown = overlay.onkeyup = (ev: KeyboardEvent) => { // ignore all keystrokes other than enter and escape\n switch (ev.key) {\n case \"Enter\":\n case \"Escape\":\n stop(ev);\n return;\n }\n ev.stopPropagation();\n };\n overlay.focus();\n }\n\n const modal = IModelApp.makeHTMLElement(\"div\", { parent: overlay, className: \"imodeljs-modal\" });\n if (undefined !== options.width) {\n modal.style.width = `${options.width}px`;\n // allow the dialog to be smaller than the width\n modal.style.maxWidth = `min(100% - (2 * var(--width-border)), ${options.width}px)`;\n }\n if (options.closeBox) {\n const close = IModelApp.makeHTMLElement(\"p\", { parent: modal, className: \"imodeljs-modal-close\" });\n close.innerText = \"\\u00d7\"; // unicode \"times\" symbol\n close.onclick = stop;\n }\n\n return { modal, stop };\n }\n\n /** Applications may implement this method to supply a Logo Card.\n * @beta\n */\n public static applicationLogoCard?: () => HTMLTableRowElement;\n\n /** Make a new Logo Card. Call this method from your implementation of [[IModelApp.applicationLogoCard]]\n * @param opts Options for Logo Card\n * @beta\n */\n public static makeLogoCard(\n opts: {\n /** The heading to be put at the top of this logo card inside an <h2>. May include HTML. */\n heading: string | HTMLElement;\n /** The URL or HTMLImageElement for the icon on this logo card. */\n iconSrc?: string | HTMLImageElement;\n /** The width of the icon, if `iconSrc` is a string. Default is 64. */\n iconWidth?: number;\n /** A *notice* string to be shown on the logo card. May include HTML. */\n notice?: string | HTMLElement;\n }): HTMLTableRowElement {\n const card = IModelApp.makeHTMLElement(\"tr\");\n const iconCell = IModelApp.makeHTMLElement(\"td\", { parent: card, className: \"logo-card-logo\" });\n if (undefined !== opts.iconSrc) {\n if (typeof opts.iconSrc === \"string\") {\n const logo = IModelApp.makeHTMLElement(\"img\");\n logo.src = opts.iconSrc;\n logo.width = opts.iconWidth ? opts.iconWidth : 64;\n opts.iconSrc = logo;\n }\n iconCell.appendChild(opts.iconSrc);\n }\n const noticeCell = IModelApp.makeHTMLElement(\"td\", { parent: card, className: \"logo-card-message\" });\n if (undefined !== opts.heading) {\n if (typeof opts.heading === \"string\")\n IModelApp.makeHTMLElement(\"h2\", { parent: noticeCell, innerHTML: opts.heading, className: \"logo-card-header\" });\n else\n noticeCell.appendChild(opts.heading);\n }\n if (undefined !== opts.notice) {\n if (typeof opts.notice === \"string\")\n IModelApp.makeHTMLElement(\"p\", { parent: noticeCell, innerHTML: opts.notice, className: \"logo-cards\" });\n else\n noticeCell.appendChild(opts.notice);\n }\n return card;\n }\n\n /** Make the logo card for the library itself. This card gets placed at the top of the stack.\n * @internal\n */\n public static makeIModelJsLogoCard() {\n return this.makeLogoCard({\n iconSrc: `${this.publicPath}images/about-imodeljs.svg`,\n heading: `<span style=\"font-weight:normal\">${this.localization.getLocalizedString(\"iModelJs:Notices.PoweredBy\")}</span>&nbsp;iTwin.js`,\n notice: `${ITWINJS_CORE_VERSION}<br>${COPYRIGHT_NOTICE}`,\n });\n }\n\n /** Format the tooltip strings returned by [[IModelConnection.getToolTipMessage]].\n * @alpha\n */\n public static formatElementToolTip(msg: string[]): HTMLElement {\n let out = \"\";\n msg.forEach((line) => out += `${IModelApp.localization?.getLocalizedKeys(line)}<br>`);\n const div = document.createElement(\"div\");\n div.innerHTML = out;\n return div;\n }\n\n /** Localize an error status\n * @param status one of the status values from [BentleyStatus]($core-bentley), [IModelStatus]($core-bentley) or [DbResult]($core-bentley)\n * @returns a localized error message\n * @beta\n */\n public static translateStatus(status: number) {\n let key: { scope: string, val: string, status?: string };\n if (typeof status !== \"number\") {\n key = { scope: \"Errors\", val: \"IllegalValue\" };\n } else {\n key = { scope: \"BentleyStatus\", val: BentleyStatus[status] };\n if (!key.val)\n key = { scope: \"IModelStatus\", val: IModelStatus[status] };\n if (!key.val)\n key = { scope: \"DbResult\", val: DbResult[status] };\n if (!key.val)\n key = { scope: \"Errors\", val: \"Status\", status: status.toString() };\n }\n\n return this.localization.getLocalizedString(`iModelJs:${key.scope}.${key.val}`, key);\n }\n\n /**\n * Creates an instance of the ExtensionAdmin\n * and registers an event to execute after startup is complete\n * @returns an instance of ExtensionAdmin\n */\n private static _createExtensionAdmin(): ExtensionAdmin {\n const extensionAdmin = new ExtensionAdmin();\n IModelApp.onAfterStartup.addListener(extensionAdmin.onStartup);\n return extensionAdmin;\n }\n}\n"]}
1
+ {"version":3,"file":"IModelApp.js","sourceRoot":"","sources":["../../src/IModelApp.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4HAA4H;AAC5H,wDAAwD;AACxD,sEAA6C;AAC7C,cAAc;AACD,QAAA,oBAAoB,GAAG,sBAAW,CAAC,OAAiB,CAAC;AAClE,MAAM,gBAAgB,GAAG,6HAA6H,CAAC;AAEvJ,0DAAgD;AAChD,sDAAoJ;AACpJ,oDAE4B;AAC5B,gDAAqD;AACrD,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SAAS,CAAC,cAAc,CAAC,WAAW,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QAC/D,OAAO,cAAc,CAAC;IACxB,CAAC;;AAvkBH,8BAwkBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module IModelApp\n */\n\n// @ts-expect-error package.json will resolve from the lib/{cjs,esm} dir without copying it into the build output we deliver\n// eslint-disable-next-line @itwin/import-within-package\nimport packageJson from \"../../package.json\";\n/** @public */\nexport const ITWINJS_CORE_VERSION = packageJson.version as string;\nconst COPYRIGHT_NOTICE = 'Copyright © 2017-2024 <a href=\"https://www.bentley.com\" target=\"_blank\" rel=\"noopener noreferrer\">Bentley Systems, Inc.</a>';\n\nimport { UiAdmin } from \"@itwin/appui-abstract\";\nimport { AccessToken, BeDuration, BeEvent, BentleyStatus, DbResult, dispose, Guid, GuidString, Logger, ProcessDetector } from \"@itwin/core-bentley\";\nimport {\n AuthorizationClient, IModelStatus, Localization, RealityDataAccess, RpcConfiguration, RpcInterfaceDefinition, RpcRequest, SerializedRpcActivity,\n} from \"@itwin/core-common\";\nimport { ITwinLocalization } from \"@itwin/core-i18n\";\nimport { TelemetryManager } from \"@itwin/core-telemetry\";\nimport { queryRenderCompatibility, WebGLRenderCompatibilityInfo } from \"@itwin/webgl-compatibility\";\nimport { AccuDraw } from \"./AccuDraw\";\nimport { AccuSnap } from \"./AccuSnap\";\nimport * as auxCoordState from \"./AuxCoordSys\";\nimport * as categorySelectorState from \"./CategorySelectorState\";\nimport { ExtensionAdmin } from \"./extension/ExtensionAdmin\";\nimport * as displayStyleState from \"./DisplayStyleState\";\nimport * as drawingViewState from \"./DrawingViewState\";\nimport { ElementLocateManager } from \"./ElementLocateManager\";\nimport { EntityState } from \"./EntityState\";\nimport { FrontendHubAccess } from \"./FrontendHubAccess\";\nimport { FrontendLoggerCategory } from \"./common/FrontendLoggerCategory\";\nimport * as modelselector from \"./ModelSelectorState\";\nimport * as modelState from \"./ModelState\";\nimport { NotificationManager } from \"./NotificationManager\";\nimport { QuantityFormatter } from \"./quantity-formatting/QuantityFormatter\";\nimport { RenderSystem } from \"./render/RenderSystem\";\nimport { System } from \"./render/webgl/System\";\nimport * as sheetState from \"./SheetViewState\";\nimport * as spatialViewState from \"./SpatialViewState\";\nimport { TentativePoint } from \"./TentativePoint\";\nimport { RealityDataSourceProviderRegistry } from \"./RealityDataSource\";\nimport { MapLayerFormatRegistry, MapLayerOptions, TerrainProviderRegistry, TileAdmin } from \"./tile/internal\";\nimport * as accudrawTool from \"./tools/AccuDrawTool\";\nimport * as clipViewTool from \"./tools/ClipViewTool\";\nimport * as idleTool from \"./tools/IdleTool\";\nimport * as measureTool from \"./tools/MeasureTool\";\nimport * as selectTool from \"./tools/SelectTool\";\nimport { ToolRegistry } from \"./tools/Tool\";\nimport { ToolAdmin } from \"./tools/ToolAdmin\";\nimport * as viewTool from \"./tools/ViewTool\";\nimport { UserPreferencesAccess } from \"./UserPreferences\";\nimport { ViewManager } from \"./ViewManager\";\nimport * as viewState from \"./ViewState\";\nimport \"./IModeljs-css\";\n\n// cSpell:ignore noopener noreferrer gprid forin nbsp csrf xsrf\n\n/** Options that can be supplied with [[IModelAppOptions]] to customize frontend security.\n * @public\n * @extensions\n */\nexport interface FrontendSecurityOptions {\n /** Configures protection from Cross Site Request Forgery attacks. */\n readonly csrfProtection?: {\n /** If enabled, IModelApp will extract the CSRF token for the current session from the document's cookies and send it with each request as a header value. */\n readonly enabled: boolean;\n /** Defaults to XSRF-TOKEN. */\n readonly cookieName?: string;\n /** Defaults to X-XSRF-TOKEN. */\n readonly headerName?: string;\n };\n}\n\n/** Options that can be supplied to [[IModelApp.startup]] to customize frontend behavior.\n * @public\n */\nexport interface IModelAppOptions {\n /** If present, supplies the [[FrontendHubAccess]] for this session. */\n hubAccess?: FrontendHubAccess;\n /** If present, supplies the Id of this application. Applications must set this to the Bentley Global Product Registry Id (GPRID) for usage logging. */\n applicationId?: string;\n /** If present, supplies the version of this application. Must be set for usage logging. */\n applicationVersion?: string;\n /** If present, supplies the [[UserPreferencesAccess]] for this session.\n * @beta\n */\n userPreferences?: UserPreferencesAccess;\n /** If present, supplies the [[ViewManager]] for this session. */\n viewManager?: ViewManager;\n /** If present, supplies Map Layer Options for this session such as Azure Access Keys\n * @beta\n */\n mapLayerOptions?: MapLayerOptions;\n /** If present, supplies the properties with which to initialize the [[TileAdmin]] for this session. */\n tileAdmin?: TileAdmin.Props;\n /** If present, supplies the [[NotificationManager]] for this session. */\n notifications?: NotificationManager;\n /** If present, supplies the [[ToolAdmin]] for this session. */\n toolAdmin?: ToolAdmin;\n /** If present, supplies the [[AccuDraw]] for this session. */\n accuDraw?: AccuDraw;\n /** If present, supplies the [[AccuSnap]] for this session. */\n accuSnap?: AccuSnap;\n /** If present, supplies the [[Localization]] for this session. Defaults to [ITwinLocalization]($i18n). */\n localization?: Localization;\n /** The AuthorizationClient used to obtain [AccessToken]($bentley)s. */\n authorizationClient?: AuthorizationClient;\n /** If present, supplies security options for the frontend. */\n security?: FrontendSecurityOptions;\n /** @internal */\n sessionId?: GuidString;\n /** @internal */\n locateManager?: ElementLocateManager;\n /** If present, supplies the [[TentativePoint]] for this session. */\n tentativePoint?: TentativePoint;\n /** @internal */\n quantityFormatter?: QuantityFormatter;\n /** If present, supplies an implementation of the render system, or options for initializing the default render system. */\n renderSys?: RenderSystem | RenderSystem.Options;\n /** If present, supplies the [[UiAdmin]] for this session. */\n uiAdmin?: UiAdmin;\n /** If present, determines whether iModelApp is a NoRenderApp\n * @internal\n */\n noRender?: boolean;\n /**\n * @deprecated in 3.7. Specify desired RPC interfaces in the platform-specific RPC manager call instead.\n * See [[MobileRpcManager.initializeClient]], [[ElectronRpcManager.initializeFrontend]], [[BentleyCloudRpcManager.initializeClient]].\n */\n rpcInterfaces?: RpcInterfaceDefinition[];\n /** @beta */\n realityDataAccess?: RealityDataAccess;\n /** If present, overrides where public assets are fetched. The default is to fetch assets relative to the current URL.\n * The path should always end with a trailing `/`.\n */\n publicPath?: string;\n}\n\n/** Options for [[IModelApp.makeModalDiv]]\n * @public\n */\nexport interface ModalOptions {\n /** Width for the Modal dialog box. */\n width?: number;\n /** The dialog should be dismissed if the user clicks anywhere or hits Enter or Escape on the keyboard. */\n autoClose?: boolean;\n /** Show an 'x' in the upper right corner to close the dialog */\n closeBox?: boolean;\n /** The parent for the semi transparent *darkening* div. If not present, use `document.body` */\n rootDiv?: HTMLElement;\n}\n\n/** Return type for [[IModelApp.makeModalDiv]]\n * @public\n */\nexport interface ModalReturn {\n /** The modal HTMLDivElement created. */\n modal: HTMLDivElement;\n /** A function that can be set as an event handler to stop the modal dialog. This can be used if [[ModalOptions.autoClose]] or [[IModalOptions.closeBox]]\n * were not enabled for the dialog.\n */\n stop: (_ev: Event) => void;\n}\n\n/** We hang the IModelApp object off the global `window` object in IModelApp.startup for debugging purposes.\n * It's removed in IModelApp.shutdown.\n */\ninterface IModelAppForDebugger {\n iModelAppForDebugger?: typeof IModelApp;\n}\n\n/**\n * Global singleton that connects the user interface with the iTwin.js services. There can be only one IModelApp active in a session. All\n * members of IModelApp are static, and it serves as a singleton object for gaining access to session information.\n *\n * Before any interactive operations may be performed by the `@itwin/core-frontend package`, [[IModelApp.startup]] must be called and awaited.\n * Applications may customize the frontend behavior of iTwin.js by supplying options to [[IModelApp.startup]].\n *\n * @public\n */\nexport class IModelApp {\n private static _initialized = false;\n private static _accuDraw: AccuDraw;\n private static _accuSnap: AccuSnap;\n private static _applicationId: string;\n private static _applicationVersion: string;\n private static _localization: Localization;\n private static _locateManager: ElementLocateManager;\n private static _notifications: NotificationManager;\n private static _quantityFormatter: QuantityFormatter;\n private static _renderSystem?: RenderSystem;\n private static _userPreferences?: UserPreferencesAccess;\n private static _tentativePoint: TentativePoint;\n private static _tileAdmin: TileAdmin;\n private static _toolAdmin: ToolAdmin;\n private static _viewManager: ViewManager;\n private static _uiAdmin: UiAdmin;\n private static _noRender: boolean;\n private static _wantEventLoop = false;\n private static _animationRequested = false;\n private static _animationInterval: BeDuration | undefined = BeDuration.fromSeconds(1);\n private static _animationIntervalId?: number;\n private static _securityOptions: FrontendSecurityOptions;\n private static _mapLayerFormatRegistry: MapLayerFormatRegistry;\n private static _terrainProviderRegistry: TerrainProviderRegistry;\n private static _realityDataSourceProviders: RealityDataSourceProviderRegistry;\n private static _hubAccess?: FrontendHubAccess;\n private static _realityDataAccess?: RealityDataAccess;\n private static _publicPath: string;\n\n // No instances of IModelApp may be created. All members are static and must be on the singleton object IModelApp.\n protected constructor() { }\n\n /** Event raised just before the frontend IModelApp is to be [[shutdown]]. */\n public static readonly onBeforeShutdown = new BeEvent<() => void>();\n\n /** Event raised after IModelApp [[startup]] completes. */\n public static readonly onAfterStartup = new BeEvent<() => void>();\n\n /** The AuthorizationClient used to obtain [AccessToken]($bentley)s. */\n public static authorizationClient?: AuthorizationClient;\n /** The [[ToolRegistry]] for this session. */\n public static readonly tools = new ToolRegistry();\n /** A uniqueId for this session */\n public static sessionId: GuidString;\n /** The [[MapLayerFormatRegistry]] for this session. */\n public static get mapLayerFormatRegistry(): MapLayerFormatRegistry { return this._mapLayerFormatRegistry; }\n /** The [[TerrainProviderRegistry]] for this session. */\n public static get terrainProviderRegistry(): TerrainProviderRegistry { return this._terrainProviderRegistry; }\n /** The [[RealityDataSourceProviderRegistry]] for this session.\n * @alpha\n */\n public static get realityDataSourceProviders(): RealityDataSourceProviderRegistry { return this._realityDataSourceProviders; }\n /** The [[RenderSystem]] for this session. */\n public static get renderSystem(): RenderSystem { return this._renderSystem!; }\n /** The [[ViewManager]] for this session. */\n public static get viewManager(): ViewManager { return this._viewManager; }\n /** The [[NotificationManager]] for this session. */\n public static get notifications(): NotificationManager { return this._notifications; }\n /** The [[TileAdmin]] for this session. */\n public static get tileAdmin(): TileAdmin { return this._tileAdmin; }\n /** The [[QuantityFormatter]] for this session. */\n public static get quantityFormatter(): QuantityFormatter { return this._quantityFormatter; }\n /** The [[ToolAdmin]] for this session. */\n public static get toolAdmin(): ToolAdmin { return this._toolAdmin; }\n /** The [[AccuDraw]] for this session. */\n public static get accuDraw(): AccuDraw { return this._accuDraw; }\n /** The [[AccuSnap]] for this session. */\n public static get accuSnap(): AccuSnap { return this._accuSnap; }\n public static get locateManager(): ElementLocateManager { return this._locateManager; }\n /** The [[TentativePoint]] for this session]]. */\n public static get tentativePoint(): TentativePoint { return this._tentativePoint; }\n /** The [[Localization]] for this session. */\n public static get localization(): Localization { return this._localization; }\n /** The [[UserPreferencesAccess]] for this session.\n * @beta\n */\n public static get userPreferences(): UserPreferencesAccess | undefined { return this._userPreferences; }\n /** The Id of this application. Applications must set this to the Global Product Registry ID (GPRID) for usage logging. */\n public static get applicationId(): string { return this._applicationId; }\n /** The version of this application. Must be set for usage logging. */\n public static get applicationVersion(): string { return this._applicationVersion; }\n /** True after [[startup]] has been called, until [[shutdown]] is called. */\n public static get initialized() { return this._initialized; }\n\n /** Provides access to IModelHub services. */\n public static get hubAccess(): FrontendHubAccess | undefined { return this._hubAccess; }\n\n /** Provides access to the RealityData service implementation for this IModelApp\n * @beta\n */\n public static get realityDataAccess(): RealityDataAccess | undefined { return this._realityDataAccess; }\n\n /** Whether the [renderSystem[]] has been successfully initialized.\n * This will always be `false` before calling [[startup]] and after calling [[shutdown]].\n * In rare circumstances (e.g., while executing in a headless test environment) it may remain `false` due to a failure to\n * obtain a [WebGL rendering context](https://www.google.com/search?channel=fs&client=ubuntu-sn&q=mdn+webglrenderingcontext).\n * As long as you have called [[startup]], you can generally assume it to be `true`.\n */\n public static get hasRenderSystem() {\n return this._renderSystem !== undefined && this._renderSystem.isValid;\n }\n\n /** The [[UiAdmin]] for this session. */\n public static get uiAdmin() { return this._uiAdmin; }\n /** The requested security options for the frontend. */\n public static get securityOptions() { return this._securityOptions; }\n\n /** If present, overrides where public assets are fetched. The default is to fetch assets relative to the current URL.\n * The path should always end with a trailing `/`.\n */\n public static get publicPath() { return this._publicPath; }\n\n /** The [[TelemetryManager]] for this session\n * @internal\n */\n public static readonly telemetry: TelemetryManager = new TelemetryManager();\n\n /** @alpha */\n public static readonly extensionAdmin = this._createExtensionAdmin();\n\n /** Map of classFullName to EntityState class */\n private static _entityClasses = new Map<string, typeof EntityState>();\n\n /** Register all of the subclasses of EntityState from a module.\n * @internal\n */\n public static registerModuleEntities(moduleObj: any) {\n for (const thisMember in moduleObj) { // eslint-disable-line guard-for-in\n const thisEntityState = moduleObj[thisMember];\n if (thisEntityState.prototype instanceof EntityState) {\n this.registerEntityState(thisEntityState.classFullName, thisEntityState);\n }\n }\n }\n\n /** Register an EntityState class by its classFullName\n * @internal\n */\n public static registerEntityState(classFullName: string, classType: typeof EntityState) {\n const lowerName = classFullName.toLowerCase();\n if (this._entityClasses.has(lowerName)) {\n const errMsg = `Class ${classFullName} is already registered. Make sure static schemaName and className members are correct on class ${classType.name}`;\n Logger.logError(FrontendLoggerCategory.IModelConnection, errMsg);\n throw new Error(errMsg);\n }\n\n this._entityClasses.set(lowerName, classType);\n }\n\n /** @internal */\n public static lookupEntityClass(classFullName: string) { return this._entityClasses.get(classFullName.toLowerCase()); }\n\n /**\n * Obtain WebGL rendering compatibility information for the client system. This information describes whether the client meets the\n * minimum rendering capabilities. It also describes whether the system lacks any optional capabilities that could improve quality\n * and/or performance.\n * @note As of 4.x, iTwin.js requires WebGL 2. If the client does not support WebGL 2, the `status` field of the returned compatibility info will be [WebGLRenderCompatibilityStatus.CannotCreateContext]($webgl-compatibility).\n */\n public static queryRenderCompatibility(): WebGLRenderCompatibilityInfo {\n return queryRenderCompatibility(true, (canvas, useWebGL2, inputContextAttributes) => System.createContext(canvas, useWebGL2, inputContextAttributes));\n }\n\n /**\n * This method must be called before any other `@itwin/core-frontend` methods are used.\n * Somewhere in your startup code, call [[IModelApp.startup]]. E.g.:\n * ``` ts\n * await IModelApp.startup( {applicationId: myAppId} );\n * ```\n * @param opts The options for configuring IModelApp\n */\n public static async startup(opts?: IModelAppOptions): Promise<void> {\n if (this._initialized)\n return; // we're already initialized, do nothing.\n this._initialized = true;\n\n opts = opts ?? {};\n this._securityOptions = opts.security ?? {};\n\n if (process.env.NODE_ENV === \"development\") {\n // Make IModelApp globally accessible for debugging purposes. We'll remove it on shutdown.\n (window as IModelAppForDebugger).iModelAppForDebugger = this;\n }\n\n this.sessionId = opts.sessionId ?? Guid.createValue();\n this._applicationId = opts.applicationId ?? \"2686\"; // Default to product id of iTwin.js\n this._applicationVersion = opts.applicationVersion ?? \"1.0.0\";\n this.authorizationClient = opts.authorizationClient;\n this._hubAccess = opts.hubAccess;\n this._noRender = opts.noRender ?? false;\n\n this._setupRpcRequestContext();\n\n this._localization = opts.localization ?? new ITwinLocalization();\n const toolsNs = \"CoreTools\";\n await this.localization.initialize([\"iModelJs\", toolsNs]);\n [\n selectTool,\n idleTool,\n viewTool,\n clipViewTool,\n measureTool,\n accudrawTool,\n ].forEach((tool) => this.tools.registerModule(tool, toolsNs));\n\n this.registerEntityState(EntityState.classFullName, EntityState);\n [\n modelState,\n sheetState,\n viewState,\n drawingViewState,\n spatialViewState,\n displayStyleState,\n modelselector,\n categorySelectorState,\n auxCoordState,\n ].forEach((module) => this.registerModuleEntities(module));\n\n this._renderSystem = (opts.renderSys instanceof RenderSystem) ? opts.renderSys : this.createRenderSys(opts.renderSys);\n if (opts.userPreferences)\n this._userPreferences = opts.userPreferences;\n this._viewManager = opts.viewManager ?? new ViewManager();\n this._tileAdmin = await TileAdmin.create(opts.tileAdmin);\n this._notifications = opts.notifications ?? new NotificationManager();\n this._toolAdmin = opts.toolAdmin ?? new ToolAdmin();\n this._accuDraw = opts.accuDraw ?? new AccuDraw();\n this._accuSnap = opts.accuSnap ?? new AccuSnap();\n this._locateManager = opts.locateManager ?? new ElementLocateManager();\n this._tentativePoint = opts.tentativePoint ?? new TentativePoint();\n this._quantityFormatter = opts.quantityFormatter ?? new QuantityFormatter();\n this._uiAdmin = opts.uiAdmin ?? new UiAdmin();\n this._mapLayerFormatRegistry = new MapLayerFormatRegistry(opts.mapLayerOptions);\n this._terrainProviderRegistry = new TerrainProviderRegistry();\n this._realityDataSourceProviders = new RealityDataSourceProviderRegistry();\n this._realityDataAccess = opts.realityDataAccess;\n this._publicPath = opts.publicPath ?? \"\";\n\n [\n this.renderSystem,\n this.viewManager,\n this.toolAdmin,\n this.accuDraw,\n this.accuSnap,\n this.locateManager,\n this.tentativePoint,\n this.uiAdmin,\n ].forEach((sys) => sys.onInitialized());\n\n await this.quantityFormatter.onInitialized();\n this.onAfterStartup.raiseEvent();\n }\n\n /** Must be called before the application exits to release any held resources. */\n public static async shutdown() {\n if (!this._initialized)\n return;\n\n // notify listeners that this IModelApp is about to be shut down.\n this.onBeforeShutdown.raiseEvent();\n this.onBeforeShutdown.clear();\n\n if (process.env.NODE_ENV === \"development\") {\n (window as IModelAppForDebugger).iModelAppForDebugger = undefined;\n }\n\n this._wantEventLoop = false;\n window.removeEventListener(\"resize\", () => IModelApp.requestNextAnimation());\n this.clearIntervalAnimation();\n [this.toolAdmin, this.viewManager, this.tileAdmin].forEach((sys) => sys.onShutDown());\n this.tools.shutdown();\n this._renderSystem = dispose(this._renderSystem);\n this._entityClasses.clear();\n this.authorizationClient = undefined;\n this._initialized = false;\n this.onAfterStartup.clear();\n }\n\n /** Controls how frequently the application polls for changes that may require a new animation frame to be requested.\n * Such changes include resizing a Viewport or changing the device pixel ratio by zooming in or out in the browser.\n * The default interval is 1 second. It may be desirable to override the default for specific apps and/or devices.\n * - Increasing the interval can conserve battery life on battery-powered devices at the expense of slower response to resize events.\n * - An application that only displays a single Viewport whose dimensions only change when the dimensions of the application window change, and which does not support changing application zoom level, could disable the interval altogether.\n * @param interval The interval at which to poll for changes. If undefined (or negative), the application will never poll. If zero, the application will poll as frequently as possible.\n * @beta\n */\n public static get animationInterval(): BeDuration | undefined { return IModelApp._animationInterval; }\n public static set animationInterval(interval: BeDuration | undefined) {\n if (undefined !== interval && interval.isTowardsPast)\n interval = undefined;\n\n if (interval !== IModelApp._animationInterval) {\n IModelApp._animationInterval = interval;\n if (IModelApp._wantEventLoop)\n IModelApp.requestIntervalAnimation();\n }\n }\n\n /** Request that the event loop execute on the next [animation frame](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame).\n * There is generally no reason for applications to invoke this method directly.\n */\n public static requestNextAnimation() {\n // Only want to call requestAnimationFrame if it is defined. Need to check whether current iModelApp is a NoRenderApp.\n if (IModelApp._noRender)\n return;\n\n if (!IModelApp._animationRequested) {\n IModelApp._animationRequested = true;\n requestAnimationFrame(() => IModelApp.eventLoop());\n }\n }\n\n /** @internal */\n private static clearIntervalAnimation(): void {\n if (undefined !== IModelApp._animationIntervalId) {\n window.clearInterval(IModelApp._animationIntervalId);\n IModelApp._animationIntervalId = undefined;\n }\n }\n\n /** @internal */\n private static requestIntervalAnimation(): void {\n IModelApp.clearIntervalAnimation();\n\n if (undefined !== IModelApp.animationInterval)\n IModelApp._animationIntervalId = window.setInterval(() => {\n IModelApp.requestNextAnimation();\n }, IModelApp.animationInterval.milliseconds);\n }\n\n /** @internal */\n public static startEventLoop() {\n if (!IModelApp._wantEventLoop) {\n IModelApp._wantEventLoop = true;\n window.addEventListener(\"resize\", () => IModelApp.requestNextAnimation());\n IModelApp.requestIntervalAnimation();\n IModelApp.requestNextAnimation();\n }\n }\n\n /** Strictly for tests. @internal */\n public static stopEventLoop() {\n this._wantEventLoop = false;\n }\n\n /** The main event processing loop for Tools and rendering. */\n private static eventLoop() {\n IModelApp._animationRequested = false;\n if (!IModelApp._wantEventLoop) // flag turned on at startup\n return;\n\n try {\n IModelApp.toolAdmin.processEvent(); // eslint-disable-line @typescript-eslint/no-floating-promises\n IModelApp.viewManager.renderLoop();\n IModelApp.tileAdmin.process();\n } catch (exception) {\n ToolAdmin.exceptionHandler(exception); // eslint-disable-line @typescript-eslint/no-floating-promises\n\n IModelApp._wantEventLoop = false;\n IModelApp._animationRequested = true; // unrecoverable after exception, don't request any further frames.\n window.removeEventListener(\"resize\", () => IModelApp.requestNextAnimation());\n }\n }\n\n /** Get the user's access token for this IModelApp, or a blank string if none is available.\n * @note Access tokens expire periodically and are automatically refreshed, if possible. Therefore tokens should not be saved, and the value\n * returned by this method may change over time throughout the course of a session.\n */\n public static async getAccessToken(): Promise<AccessToken> {\n try {\n return (await this.authorizationClient?.getAccessToken()) ?? \"\";\n } catch {\n return \"\";\n }\n }\n\n /** @internal */\n public static createRenderSys(opts?: RenderSystem.Options): RenderSystem { return System.create(opts); }\n\n private static _setupRpcRequestContext() {\n RpcConfiguration.requestContext.getId = (_request: RpcRequest): string => {\n return Guid.createValue();\n };\n\n RpcConfiguration.requestContext.serialize = async (_request: RpcRequest): Promise<SerializedRpcActivity> => {\n const id = _request.id;\n const serialized: SerializedRpcActivity = {\n id,\n applicationId: this.applicationId,\n applicationVersion: this.applicationVersion,\n sessionId: this.sessionId,\n authorization: ProcessDetector.isMobileAppFrontend ? \"\" : await this.getAccessToken(),\n };\n\n const csrf = IModelApp.securityOptions.csrfProtection;\n if (csrf && csrf.enabled) {\n const cookieName = csrf.cookieName || \"XSRF-TOKEN\";\n const cookieValue = document.cookie.split(\"; \").find((r) => r.startsWith(`${cookieName}=`));\n\n if (cookieValue) {\n const headerName = csrf.headerName || \"X-XSRF-TOKEN\";\n const headerValue = cookieValue.split(\"=\")[1];\n serialized.csrfToken = { headerName, headerValue };\n }\n }\n\n return serialized;\n };\n }\n\n /** Shortcut for creating an HTMLElement with optional parent, className, id, innerHTML, innerText. */\n public static makeHTMLElement<K extends keyof HTMLElementTagNameMap>(type: K, opt?: {\n /** The parent for the new HTMLElement */\n parent?: HTMLElement;\n /** The className for the new HTMLElement */\n className?: string;\n /** The Id for the new HTMLElement */\n id?: string;\n /** innerHTML for the new HTMLElement */\n innerHTML?: string;\n /** innerText for the new HTMLElement */\n innerText?: string;\n }) {\n const el = document.createElement(type);\n if (undefined !== opt) {\n if (undefined !== opt.className)\n el.className = opt.className;\n if (undefined !== opt.id)\n el.id = opt.id;\n if (undefined !== opt.innerHTML)\n el.innerHTML = opt.innerHTML;\n if (undefined !== opt.innerText)\n el.innerText = opt.innerText;\n if (undefined !== opt.parent)\n opt.parent.appendChild(el);\n }\n return el;\n }\n\n /** Shortcut for making a modal dialog on top of the root of the application. The returned HTMLDivElement will be placed topmost, all other application\n * windows will be covered with a semi-transparent background that intercepts all key/mouse/touch events until the modal is dismissed.\n * @param options The options that describe how the modal should work.\n */\n public static makeModalDiv(options: ModalOptions): ModalReturn {\n const root = options.rootDiv ? options.rootDiv : document.body;\n // create the overlay div to \"black out\" the application to indicate everything is inactive until the modal has been dismissed.\n const overlay = IModelApp.makeHTMLElement(\"div\", { parent: root, className: \"imodeljs-modal-overlay\" });\n overlay.tabIndex = -1; // so we can catch keystroke events\n\n // function to remove modal dialog\n const stop = (ev: Event) => {\n root.removeChild(overlay);\n ev.stopPropagation();\n };\n\n if (options.autoClose) {\n overlay.onclick = overlay.oncontextmenu = stop;\n overlay.onkeydown = overlay.onkeyup = (ev: KeyboardEvent) => { // ignore all keystrokes other than enter and escape\n switch (ev.key) {\n case \"Enter\":\n case \"Escape\":\n stop(ev);\n return;\n }\n ev.stopPropagation();\n };\n overlay.focus();\n }\n\n const modal = IModelApp.makeHTMLElement(\"div\", { parent: overlay, className: \"imodeljs-modal\" });\n if (undefined !== options.width) {\n modal.style.width = `${options.width}px`;\n // allow the dialog to be smaller than the width\n modal.style.maxWidth = `min(100% - (2 * var(--width-border)), ${options.width}px)`;\n }\n if (options.closeBox) {\n const close = IModelApp.makeHTMLElement(\"p\", { parent: modal, className: \"imodeljs-modal-close\" });\n close.innerText = \"\\u00d7\"; // unicode \"times\" symbol\n close.onclick = stop;\n }\n\n return { modal, stop };\n }\n\n /** Applications may implement this method to supply a Logo Card.\n * @beta\n */\n public static applicationLogoCard?: () => HTMLTableRowElement;\n\n /** Make a new Logo Card. Call this method from your implementation of [[IModelApp.applicationLogoCard]]\n * @param opts Options for Logo Card\n * @beta\n */\n public static makeLogoCard(\n opts: {\n /** The heading to be put at the top of this logo card inside an <h2>. May include HTML. */\n heading: string | HTMLElement;\n /** The URL or HTMLImageElement for the icon on this logo card. */\n iconSrc?: string | HTMLImageElement;\n /** The width of the icon, if `iconSrc` is a string. Default is 64. */\n iconWidth?: number;\n /** A *notice* string to be shown on the logo card. May include HTML. */\n notice?: string | HTMLElement;\n }): HTMLTableRowElement {\n const card = IModelApp.makeHTMLElement(\"tr\");\n const iconCell = IModelApp.makeHTMLElement(\"td\", { parent: card, className: \"logo-card-logo\" });\n if (undefined !== opts.iconSrc) {\n if (typeof opts.iconSrc === \"string\") {\n const logo = IModelApp.makeHTMLElement(\"img\");\n logo.src = opts.iconSrc;\n logo.width = opts.iconWidth ? opts.iconWidth : 64;\n opts.iconSrc = logo;\n }\n iconCell.appendChild(opts.iconSrc);\n }\n const noticeCell = IModelApp.makeHTMLElement(\"td\", { parent: card, className: \"logo-card-message\" });\n if (undefined !== opts.heading) {\n if (typeof opts.heading === \"string\")\n IModelApp.makeHTMLElement(\"h2\", { parent: noticeCell, innerHTML: opts.heading, className: \"logo-card-header\" });\n else\n noticeCell.appendChild(opts.heading);\n }\n if (undefined !== opts.notice) {\n if (typeof opts.notice === \"string\")\n IModelApp.makeHTMLElement(\"p\", { parent: noticeCell, innerHTML: opts.notice, className: \"logo-cards\" });\n else\n noticeCell.appendChild(opts.notice);\n }\n return card;\n }\n\n /** Make the logo card for the library itself. This card gets placed at the top of the stack.\n * @internal\n */\n public static makeIModelJsLogoCard() {\n return this.makeLogoCard({\n iconSrc: `${this.publicPath}images/about-imodeljs.svg`,\n heading: `<span style=\"font-weight:normal\">${this.localization.getLocalizedString(\"iModelJs:Notices.PoweredBy\")}</span>&nbsp;iTwin.js`,\n notice: `${ITWINJS_CORE_VERSION}<br>${COPYRIGHT_NOTICE}`,\n });\n }\n\n /** Format the tooltip strings returned by [[IModelConnection.getToolTipMessage]].\n * @alpha\n */\n public static formatElementToolTip(msg: string[]): HTMLElement {\n let out = \"\";\n msg.forEach((line) => out += `${IModelApp.localization?.getLocalizedKeys(line)}<br>`);\n const div = document.createElement(\"div\");\n div.innerHTML = out;\n return div;\n }\n\n /** Localize an error status\n * @param status one of the status values from [BentleyStatus]($core-bentley), [IModelStatus]($core-bentley) or [DbResult]($core-bentley)\n * @returns a localized error message\n * @beta\n */\n public static translateStatus(status: number) {\n let key: { scope: string, val: string, status?: string };\n if (typeof status !== \"number\") {\n key = { scope: \"Errors\", val: \"IllegalValue\" };\n } else {\n key = { scope: \"BentleyStatus\", val: BentleyStatus[status] };\n if (!key.val)\n key = { scope: \"IModelStatus\", val: IModelStatus[status] };\n if (!key.val)\n key = { scope: \"DbResult\", val: DbResult[status] };\n if (!key.val)\n key = { scope: \"Errors\", val: \"Status\", status: status.toString() };\n }\n\n return this.localization.getLocalizedString(`iModelJs:${key.scope}.${key.val}`, key);\n }\n\n /**\n * Creates an instance of the ExtensionAdmin\n * and registers an event to execute after startup is complete\n * @returns an instance of ExtensionAdmin\n */\n private static _createExtensionAdmin(): ExtensionAdmin {\n const extensionAdmin = new ExtensionAdmin();\n IModelApp.onAfterStartup.addListener(extensionAdmin.onStartup);\n return extensionAdmin;\n }\n}\n"]}
@@ -37,6 +37,8 @@ class IModelConnection extends core_common_1.IModel {
37
37
  get noGcsDefined() { return this._gcsDisabled || undefined === this.geographicCoordinateSystem; }
38
38
  /** @internal */
39
39
  disableGCS(disable) { this._gcsDisabled = disable; }
40
+ /** The maximum time (in milliseconds) to wait before timing out the request to open a connection to a new iModel */
41
+ static { this.connectionTimeout = 10 * 60 * 1000; }
40
42
  /** Type guard for instanceof [[BriefcaseConnection]] */
41
43
  isBriefcaseConnection() { return false; }
42
44
  /** Type guard for instanceof [[CheckpointConnection]]
@@ -62,6 +64,14 @@ class IModelConnection extends core_common_1.IModel {
62
64
  * @note no RPC operations are valid on this IModelConnection if this method returns false.
63
65
  */
64
66
  get isOpen() { return !this.isClosed; }
67
+ /** Event raised immediately before *any* IModelConnection is [[close]]d.
68
+ * @note This static event is raised when *any* IModelConnection is closed, and the specific IModelConnection is passed as its argument. To
69
+ * monitor closing a specific IModelConnection, listen for the `onClose` instance event instead.
70
+ * @note Be careful not to perform any asynchronous operations on the IModelConnection because it will close before they are processed.
71
+ */
72
+ static { this.onClose = new core_bentley_1.BeEvent(); }
73
+ /** Event called immediately after *any* IModelConnection is opened. */
74
+ static { this.onOpen = new core_bentley_1.BeEvent(); }
65
75
  /** Load the FontMap for this IModelConnection.
66
76
  * @returns Returns a Promise<FontMap> that is fulfilled when the FontMap member of this IModelConnection is valid.
67
77
  * @deprecated in 5.0.0. If you need font Ids on the front-end for some reason, write an Ipc method that queries [IModelDb.fonts]($backend).
@@ -545,16 +555,6 @@ class IModelConnection extends core_common_1.IModel {
545
555
  }
546
556
  }
547
557
  exports.IModelConnection = IModelConnection;
548
- /** The maximum time (in milliseconds) to wait before timing out the request to open a connection to a new iModel */
549
- IModelConnection.connectionTimeout = 10 * 60 * 1000;
550
- /** Event raised immediately before *any* IModelConnection is [[close]]d.
551
- * @note This static event is raised when *any* IModelConnection is closed, and the specific IModelConnection is passed as its argument. To
552
- * monitor closing a specific IModelConnection, listen for the `onClose` instance event instead.
553
- * @note Be careful not to perform any asynchronous operations on the IModelConnection because it will close before they are processed.
554
- */
555
- IModelConnection.onClose = new core_bentley_1.BeEvent();
556
- /** Event called immediately after *any* IModelConnection is opened. */
557
- IModelConnection.onOpen = new core_bentley_1.BeEvent();
558
558
  /** A connection that exists without an iModel. Useful for connecting to Reality Data services.
559
559
  * @note This class exists because our display system requires an IModelConnection type even if only reality data is drawn.
560
560
  * @public