@itwin/rpcinterface-full-stack-tests 5.15.0-dev.9 → 5.16.0-dev.3

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.
@@ -38476,6 +38476,7 @@ function assert(condition, message) {
38476
38476
  "use strict";
38477
38477
  __webpack_require__.r(__webpack_exports__);
38478
38478
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
38479
+ /* harmony export */ BeAsyncEvent: () => (/* binding */ BeAsyncEvent),
38479
38480
  /* harmony export */ BeEvent: () => (/* binding */ BeEvent),
38480
38481
  /* harmony export */ BeEventList: () => (/* binding */ BeEventList),
38481
38482
  /* harmony export */ BeUiEvent: () => (/* binding */ BeUiEvent),
@@ -38563,8 +38564,13 @@ class BeEvent {
38563
38564
  dropped = true;
38564
38565
  }
38565
38566
  else {
38567
+ const listener = context.listener;
38568
+ if (context.once) {
38569
+ context.listener = undefined;
38570
+ dropped = true;
38571
+ }
38566
38572
  try {
38567
- context.listener.apply(context.scope, args);
38573
+ listener.apply(context.scope, args);
38568
38574
  }
38569
38575
  catch (e) {
38570
38576
  _UnexpectedErrors__WEBPACK_IMPORTED_MODULE_0__.UnexpectedErrors.handle(e);
@@ -38573,10 +38579,6 @@ class BeEvent {
38573
38579
  // listener was removed during its own callback
38574
38580
  dropped = true;
38575
38581
  }
38576
- else if (context.once) {
38577
- context.listener = undefined;
38578
- dropped = true;
38579
- }
38580
38582
  }
38581
38583
  }
38582
38584
  this._emitDepth--;
@@ -38620,8 +38622,6 @@ class BeUiEvent extends BeEvent {
38620
38622
  */
38621
38623
  class BeUnorderedEvent {
38622
38624
  _listeners = new Set();
38623
- _emitDepth = 0;
38624
- _hasTombstones = false;
38625
38625
  /** The number of listeners currently subscribed to the event.
38626
38626
  * @note During `raiseEvent()`, this may include listeners that have been removed or are one-shot
38627
38627
  * but are awaiting deferred cleanup. The count is accurate outside of `raiseEvent()`.
@@ -38651,43 +38651,26 @@ class BeUnorderedEvent {
38651
38651
  }
38652
38652
  /** Remove a specific context entry, deferring during emit. */
38653
38653
  _removeCtx(ctx) {
38654
- if (this._emitDepth > 0) {
38655
- ctx.listener = undefined; // tombstone for deferred cleanup
38656
- this._hasTombstones = true;
38657
- }
38658
- else {
38659
- this._listeners.delete(ctx);
38660
- }
38654
+ this._listeners.delete(ctx);
38661
38655
  }
38662
38656
  /**
38663
38657
  * Raises the event by calling each registered listener with the supplied arguments.
38664
38658
  * @param args This method takes any number of parameters and passes them through to the listeners.
38665
38659
  */
38666
38660
  raiseEvent(...args) {
38667
- this._emitDepth++;
38668
38661
  for (const ctx of this._listeners) {
38669
38662
  if (!ctx.listener) {
38670
38663
  continue;
38671
38664
  }
38665
+ if (ctx.once) {
38666
+ this._listeners.delete(ctx);
38667
+ }
38672
38668
  try {
38673
38669
  ctx.listener.apply(ctx.scope, args);
38674
38670
  }
38675
38671
  catch (e) {
38676
38672
  _UnexpectedErrors__WEBPACK_IMPORTED_MODULE_0__.UnexpectedErrors.handle(e);
38677
38673
  }
38678
- if (ctx.listener && ctx.once) {
38679
- ctx.listener = undefined;
38680
- this._hasTombstones = true;
38681
- }
38682
- }
38683
- this._emitDepth--;
38684
- // Only clean up tombstoned entries when we're back at the outermost emit
38685
- if (this._hasTombstones && this._emitDepth === 0) {
38686
- this._hasTombstones = false;
38687
- for (const ctx of this._listeners) {
38688
- if (ctx.listener === undefined)
38689
- this._listeners.delete(ctx);
38690
- }
38691
38674
  }
38692
38675
  }
38693
38676
  /** Clear all listeners from this BeUnorderedEvent.
@@ -38703,6 +38686,108 @@ class BeUnorderedUiEvent extends BeUnorderedEvent {
38703
38686
  /** Raises event with single strongly typed argument. */
38704
38687
  emit(args) { this.raiseEvent(args); }
38705
38688
  }
38689
+ /**
38690
+ * Manages a set of *listeners* for a particular event and notifies them when the event is raised.
38691
+ * Each listener is async (return a Promise<void>). The listeners may be invoked in series
38692
+ * or concurrently depending on the configuration of the instance.
38693
+ *
38694
+ * Like [[BeUnorderedEvent]], this class uses a `Set` internally to support more performant removal
38695
+ * of old listeners. When a listener is removed during emit, it is marked for deferred removal instead
38696
+ * of mutating the set immediately. Despite the "unordered" implication, items in a `Set` are enumerated
38697
+ * in insertion order, which means that this class invokes the listeners in insertion order.
38698
+ *
38699
+ * Listeners are managed exclusively through the disposal closure returned by [[addListener]] and
38700
+ * [[addOnce]]. There is no `removeListener` or `has` method — callers must capture the returned
38701
+ * closure to unsubscribe.
38702
+ * @beta
38703
+ */
38704
+ class BeAsyncEvent {
38705
+ _listeners = new Set();
38706
+ _concurrent = false;
38707
+ _promiseRejectionIsUnexpected = false;
38708
+ constructor(options) {
38709
+ if (options?.concurrent)
38710
+ this._concurrent = true;
38711
+ if (options?.promiseRejectionIsUnexpected)
38712
+ this._promiseRejectionIsUnexpected = true;
38713
+ }
38714
+ /** The number of listeners currently subscribed to the event.
38715
+ * @note During `raiseEvent()`, this may include listeners that have been removed or are one-shot
38716
+ * but are awaiting deferred cleanup. The count is accurate outside of `raiseEvent()`.
38717
+ */
38718
+ get numberOfListeners() { return this._listeners.size; }
38719
+ /**
38720
+ * Registers a Listener to be executed whenever this event is raised.
38721
+ * @param listener The function to be executed when the event is raised.
38722
+ * @param scope An optional object scope to serve as the 'this' pointer when listener is invoked.
38723
+ * @returns A function that will remove this event listener in O(1).
38724
+ */
38725
+ addListener(listener, scope) {
38726
+ const ctx = { listener, scope, once: false };
38727
+ this._listeners.add(ctx);
38728
+ return () => this._removeCtx(ctx);
38729
+ }
38730
+ /**
38731
+ * Registers a callback function to be executed *only once* when the event is raised.
38732
+ * @param listener The function to be executed once when the event is raised.
38733
+ * @param scope An optional object scope to serve as the `this` pointer in which the listener function will execute.
38734
+ * @returns A function that will remove this event listener in O(1).
38735
+ */
38736
+ addOnce(listener, scope) {
38737
+ const ctx = { listener, scope, once: true };
38738
+ this._listeners.add(ctx);
38739
+ return () => this._removeCtx(ctx);
38740
+ }
38741
+ /** Remove a specific context entry, deferring during emit. */
38742
+ _removeCtx(ctx) {
38743
+ this._listeners.delete(ctx);
38744
+ }
38745
+ /**
38746
+ * Raises the event by calling each registered listener with the supplied arguments.
38747
+ *
38748
+ * See [[BeAsyncEventOptions]] for options that control the behavior of this method.
38749
+ *
38750
+ * @param args This method takes any number of parameters and passes them through to the listeners.
38751
+ * @returns A Promise that settles when the event invocation is complete.
38752
+ */
38753
+ async raiseEvent(...args) {
38754
+ const promises = [];
38755
+ // Wrapper to ensure that an exception thrown immediately by a listener is captured as a rejected promise rather than
38756
+ // allowed to propagate as an exception. A well-behaved Promise-returning function should never throw, but
38757
+ // this defends against the poorly-behaved ones. In Node 23+ we could use `Promise.try` instead.
38758
+ const invoke = async (ctx, args) => {
38759
+ if (!ctx.listener)
38760
+ return;
38761
+ await ctx.listener.apply(ctx.scope, args);
38762
+ };
38763
+ for (const ctx of this._listeners) {
38764
+ if (!ctx.listener)
38765
+ continue;
38766
+ if (ctx.once) {
38767
+ // Set guarantees this is safe during iteration.
38768
+ this._listeners.delete(ctx);
38769
+ }
38770
+ let promise = invoke(ctx, args);
38771
+ if (this._promiseRejectionIsUnexpected)
38772
+ promise = promise.catch(reason => _UnexpectedErrors__WEBPACK_IMPORTED_MODULE_0__.UnexpectedErrors.handle(reason));
38773
+ if (this._concurrent)
38774
+ promises.push(promise);
38775
+ else
38776
+ await promise;
38777
+ }
38778
+ if (this._concurrent) {
38779
+ const result = await Promise.allSettled(promises);
38780
+ const firstRejection = result.find(r => r.status === "rejected");
38781
+ if (firstRejection)
38782
+ throw firstRejection.reason;
38783
+ }
38784
+ }
38785
+ /** Clear all listeners from this BeAsyncEvent.
38786
+ * @note If called during `raiseEvent`, remaining listeners in the current iteration are skipped
38787
+ * immediately rather than being tombstoned.
38788
+ */
38789
+ clear() { this._listeners.clear(); }
38790
+ }
38706
38791
  /**
38707
38792
  * A list of BeEvent objects, accessible by an event name.
38708
38793
  * This class may be used instead of explicitly declaring each BeEvent as a member of a containing class.
@@ -41259,16 +41344,18 @@ var Id64;
41259
41344
  Id64.getFirst = getFirst;
41260
41345
  /** Return the number of [[Id64String]]s represented by an [[Id64Arg]]. */
41261
41346
  function sizeOf(arg) {
41262
- return typeof arg === "string" ? 1 : (Array.isArray(arg) ? arg.length : arg.size);
41347
+ return typeof arg === "string" ? 1 : "size" in arg ? arg.size : arg.length;
41263
41348
  }
41264
41349
  Id64.sizeOf = sizeOf;
41265
41350
  /** Returns true if the [[Id64Arg]] contains the specified Id. */
41266
41351
  function has(arg, id) {
41267
- if (typeof arg === "string")
41352
+ if (typeof arg === "string") {
41268
41353
  return arg === id;
41269
- if (Array.isArray(arg))
41270
- return -1 !== arg.indexOf(id);
41271
- return arg.has(id);
41354
+ }
41355
+ if ("has" in arg) {
41356
+ return arg.has(id);
41357
+ }
41358
+ return -1 !== arg.indexOf(id);
41272
41359
  }
41273
41360
  Id64.has = has;
41274
41361
  /** The string representation of an invalid Id. */
@@ -45338,6 +45425,7 @@ class YieldManager {
45338
45425
  __webpack_require__.r(__webpack_exports__);
45339
45426
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
45340
45427
  /* harmony export */ AbandonedError: () => (/* reexport safe */ _OneAtATimeAction__WEBPACK_IMPORTED_MODULE_22__.AbandonedError),
45428
+ /* harmony export */ BeAsyncEvent: () => (/* reexport safe */ _BeEvent__WEBPACK_IMPORTED_MODULE_2__.BeAsyncEvent),
45341
45429
  /* harmony export */ BeDuration: () => (/* reexport safe */ _Time__WEBPACK_IMPORTED_MODULE_30__.BeDuration),
45342
45430
  /* harmony export */ BeEvent: () => (/* reexport safe */ _BeEvent__WEBPACK_IMPORTED_MODULE_2__.BeEvent),
45343
45431
  /* harmony export */ BeEventList: () => (/* reexport safe */ _BeEvent__WEBPACK_IMPORTED_MODULE_2__.BeEventList),
@@ -50901,7 +50989,8 @@ __webpack_require__.r(__webpack_exports__);
50901
50989
  /* harmony export */ ECSqlReader: () => (/* binding */ ECSqlReader)
50902
50990
  /* harmony export */ });
50903
50991
  /* harmony import */ var _ConcurrentQuery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ConcurrentQuery */ "../../core/common/lib/esm/ConcurrentQuery.js");
50904
- /* harmony import */ var _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ECSqlReaderBase */ "../../core/common/lib/esm/ECSqlReaderBase.js");
50992
+ /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
50993
+ /* harmony import */ var _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ECSqlReaderBase */ "../../core/common/lib/esm/ECSqlReaderBase.js");
50905
50994
  /*---------------------------------------------------------------------------------------------
50906
50995
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
50907
50996
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -50911,6 +51000,7 @@ __webpack_require__.r(__webpack_exports__);
50911
51000
  */
50912
51001
 
50913
51002
 
51003
+
50914
51004
  /**
50915
51005
  * Execute ECSQL statements and read the results.
50916
51006
  *
@@ -50933,7 +51023,7 @@ __webpack_require__.r(__webpack_exports__);
50933
51023
  * JavaScript object, call [[QueryRowProxy.toRow]] on it.
50934
51024
  * @public
50935
51025
  */
50936
- class ECSqlReader extends _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_1__.ECSqlReaderBase {
51026
+ class ECSqlReader extends _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_2__.ECSqlReaderBase {
50937
51027
  _executor;
50938
51028
  query;
50939
51029
  static _maxRetryCount = 10;
@@ -50944,6 +51034,7 @@ class ECSqlReader extends _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_1__.ECSqlRea
50944
51034
  _globalDone = false;
50945
51035
  _param = new _ConcurrentQuery__WEBPACK_IMPORTED_MODULE_0__.QueryBinder().serialize();
50946
51036
  _lockArgs = false;
51037
+ _cursorId = "";
50947
51038
  _stats = { backendCpuTime: 0, backendTotalTime: 0, backendMemUsed: 0, backendRowsReturned: 0, totalTime: 0, retryCount: 0, prepareTime: 0 };
50948
51039
  _options = new _ConcurrentQuery__WEBPACK_IMPORTED_MODULE_0__.QueryOptionsBuilder().getOptions();
50949
51040
  /**
@@ -50975,10 +51066,11 @@ class ECSqlReader extends _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_1__.ECSqlRea
50975
51066
  * @deprecated in 5.6 - will not be removed until after 2027-04-02. Should not be used. Will be made private in a future release.
50976
51067
  */
50977
51068
  reset(options) {
51069
+ this._cursorId = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_1__.Guid.createValue();
50978
51070
  if (options) {
50979
51071
  this._options = options;
50980
51072
  }
50981
- this._props = new _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_1__.PropertyMetaDataMap([]);
51073
+ this._props = new _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_2__.PropertyMetaDataMap([]);
50982
51074
  this._localRows = [];
50983
51075
  this._globalDone = false;
50984
51076
  this._globalOffset = 0;
@@ -50999,6 +51091,7 @@ class ECSqlReader extends _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_1__.ECSqlRea
50999
51091
  * @deprecated in 5.6 - will not be removed until after 2027-04-02. Should not be used. Will be made private in a future release.
51000
51092
  */
51001
51093
  resetBindings() {
51094
+ this._cursorId = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_1__.Guid.createValue();
51002
51095
  this._param = new _ConcurrentQuery__WEBPACK_IMPORTED_MODULE_0__.QueryBinder().serialize();
51003
51096
  this._lockArgs = false;
51004
51097
  }
@@ -51037,13 +51130,14 @@ class ECSqlReader extends _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_1__.ECSqlRea
51037
51130
  valueFormat,
51038
51131
  query: this.query,
51039
51132
  args: this._param,
51133
+ cursorId: this._cursorId,
51040
51134
  };
51041
51135
  request.includeMetaData = this._props.length > 0 ? false : true;
51042
51136
  request.limit = { offset: this._globalOffset, count: this._globalCount < 1 ? -1 : this._globalCount };
51043
51137
  const resp = await this.runWithRetry(request);
51044
51138
  this._globalDone = resp.status === _ConcurrentQuery__WEBPACK_IMPORTED_MODULE_0__.DbResponseStatus.Done || resp.status === _ConcurrentQuery__WEBPACK_IMPORTED_MODULE_0__.DbResponseStatus.NotOpen;
51045
51139
  if (this._props.length === 0 && resp.meta.length > 0) {
51046
- this._props = new _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_1__.PropertyMetaDataMap(resp.meta);
51140
+ this._props = new _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_2__.PropertyMetaDataMap(resp.meta);
51047
51141
  }
51048
51142
  for (const row of resp.data) {
51049
51143
  ECSqlReader.replaceBase64WithUint8Array(row);
@@ -51807,7 +51901,8 @@ __webpack_require__.r(__webpack_exports__);
51807
51901
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
51808
51902
  /* harmony export */ EntityMetaData: () => (/* binding */ EntityMetaData),
51809
51903
  /* harmony export */ PrimitiveTypeCode: () => (/* binding */ PrimitiveTypeCode),
51810
- /* harmony export */ PropertyMetaData: () => (/* binding */ PropertyMetaData)
51904
+ /* harmony export */ PropertyMetaData: () => (/* binding */ PropertyMetaData),
51905
+ /* harmony export */ isPersisted: () => (/* binding */ isPersisted)
51811
51906
  /* harmony export */ });
51812
51907
  /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
51813
51908
  /* harmony import */ var _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @itwin/core-geometry */ "../../core/geometry/lib/esm/core-geometry.js");
@@ -51822,6 +51917,13 @@ __webpack_require__.r(__webpack_exports__);
51822
51917
 
51823
51918
 
51824
51919
 
51920
+ /** Tests whether an [[EntityProps]] has a valid `id`, narrowing its type to [[Persisted]] if it does.
51921
+ * @public @preview
51922
+ * @extensions
51923
+ */
51924
+ function isPersisted(entity) {
51925
+ return undefined !== entity.id && _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.isValidId64(entity.id);
51926
+ }
51825
51927
  /** The primitive types of an Entity property.
51826
51928
  * @beta
51827
51929
  */
@@ -53700,6 +53802,9 @@ var GeoCoordStatus;
53700
53802
  * Geoid separation data or vertical datum differential data (such as used by NGVD29 to NAVD88 conversion).
53701
53803
  * The horizontal coordinates returned are valid but the elevation ordinate will be returned unchanged or partially changed.
53702
53804
  * This status should be somehow reported so actions can be performed to provide the missing information.
53805
+ * A finite elevation, including one equal to the input elevation, is not evidence that vertical conversion succeeded.
53806
+ * Callers requiring converted elevations must reject this result. Horizontal-only callers may use XY while retaining
53807
+ * and reporting this status. A visual fallback must not be presented as a successful vertical conversion.
53703
53808
  */
53704
53809
  GeoCoordStatus[GeoCoordStatus["VerticalDatumConvertError"] = 26] = "VerticalDatumConvertError";
53705
53810
  /** General inner conversion engine error. Coordinates returned are invalid and should be discarded */
@@ -65955,6 +66060,7 @@ __webpack_require__.r(__webpack_exports__);
65955
66060
  /* harmony export */ isBinaryImageSource: () => (/* reexport safe */ _Image__WEBPACK_IMPORTED_MODULE_69__.isBinaryImageSource),
65956
66061
  /* harmony export */ isKnownFieldPropertyType: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_166__.isKnownFieldPropertyType),
65957
66062
  /* harmony export */ isKnownTileFormat: () => (/* reexport safe */ _tile_TileIO__WEBPACK_IMPORTED_MODULE_162__.isKnownTileFormat),
66063
+ /* harmony export */ isPersisted: () => (/* reexport safe */ _EntityProps__WEBPACK_IMPORTED_MODULE_34__.isPersisted),
65958
66064
  /* harmony export */ isPlacement2dProps: () => (/* reexport safe */ _ElementProps__WEBPACK_IMPORTED_MODULE_32__.isPlacement2dProps),
65959
66065
  /* harmony export */ isPlacement3dProps: () => (/* reexport safe */ _ElementProps__WEBPACK_IMPORTED_MODULE_32__.isPlacement3dProps),
65960
66066
  /* harmony export */ isPowerOfTwo: () => (/* reexport safe */ _Image__WEBPACK_IMPORTED_MODULE_69__.isPowerOfTwo),
@@ -76991,7 +77097,7 @@ class IModelReadRpcInterface extends _RpcInterface__WEBPACK_IMPORTED_MODULE_0__.
76991
77097
  /** The immutable name of the interface. */
76992
77098
  static interfaceName = "IModelReadRpcInterface";
76993
77099
  /** The semantic version of the interface. */
76994
- static interfaceVersion = "3.8.0";
77100
+ static interfaceVersion = "3.8.1";
76995
77101
  /*===========================================================================================
76996
77102
  NOTE: Any add/remove/change to the methods below requires an update of the interface version.
76997
77103
  NOTE: Please consult the README in this folder for the semantic versioning rules.
@@ -77936,8 +78042,7 @@ class RpcInvocation {
77936
78042
  return;
77937
78043
  for (let i = 0; i !== parameters.length; ++i) {
77938
78044
  const parameter = parameters[i];
77939
- const isToken = typeof (parameter) === "object" && parameter !== null && parameter.hasOwnProperty("iModelId") && parameter.hasOwnProperty("iTwinId");
77940
- if (isToken && this.protocol.checkToken && !this.operation.policy.allowTokenMismatch) {
78045
+ if (this.protocol.checkToken && !this.operation.policy.allowTokenMismatch && RpcInvocation.isTokenParameter(parameter, i)) {
77941
78046
  const inflated = this.protocol.inflateToken(parameter, this.request);
77942
78047
  parameters[i] = inflated;
77943
78048
  if (!RpcInvocation.compareTokens(parameter, inflated)) {
@@ -77951,9 +78056,20 @@ class RpcInvocation {
77951
78056
  }
77952
78057
  }
77953
78058
  }
78059
+ /** Determine whether an operation parameter is an [[IModelRpcProps]]. Every property of the token other than `key` is optional
78060
+ * and all of them are supplied by the caller, so the first parameter is treated as a token if it has *any* of the identifying properties.
78061
+ */
78062
+ static isTokenParameter(parameter, index) {
78063
+ if (typeof parameter !== "object" || parameter === null || Array.isArray(parameter))
78064
+ return false;
78065
+ const has = (prop) => Object.prototype.hasOwnProperty.call(parameter, prop);
78066
+ if (has("iModelId") && has("iTwinId"))
78067
+ return true;
78068
+ return 0 === index && (has("key") || has("iModelId") || has("iTwinId"));
78069
+ }
77954
78070
  static compareTokens(a, b) {
77955
78071
  return a.key === b.key &&
77956
- a.iTwinId === b.iTwinId &&
78072
+ (undefined === a.iTwinId || a.iTwinId === b.iTwinId) &&
77957
78073
  a.iModelId === b.iModelId &&
77958
78074
  (undefined === a.changeset || (a.changeset.id === b.changeset?.id));
77959
78075
  }
@@ -96516,8 +96632,8 @@ class SchemaView {
96516
96632
  throw new Error("SchemaView is not mergeable: create it via SchemaView.createMergeable to merge fragments.");
96517
96633
  this._mergeContext.mergeBlob(blob);
96518
96634
  // A new fragment can add subclasses to an already-present base class, so the derived-class map
96519
- // must be rebuilt. transitiveBaseCache stays valid: a class's ancestors are always merged
96520
- // before it (dependency order), so an append never adds an ancestor to an already-cached class.
96635
+ // must be rebuilt. transitiveBaseCache and PropertyRef.overriddenProperty stay valid: a class's ancestors
96636
+ // are always merged before it (dependency order), so an append never adds an ancestor to an already-cached class.
96521
96637
  this[_storage].derivedClassMap = undefined;
96522
96638
  }
96523
96639
  // --- Internal helpers used by view objects ---
@@ -96607,12 +96723,18 @@ class SchemaView {
96607
96723
  // 1. Base class (recursive, depth-first)
96608
96724
  if (cls.baseClassIdx !== -1)
96609
96725
  this._collectProperties(cls.baseClassIdx, merged);
96610
- // 2. Mixins in declaration order
96726
+ // 2. Mixins in declaration order. Each mixin is resolved on its own so its overrides win over its
96727
+ // ancestors, then only adds names not already provided by the base class or an earlier mixin.
96611
96728
  for (let i = 0; i < cls.mixinCount; i++) {
96612
96729
  const mixinIdx = this[_storage].classMixins[cls.mixinStartIdx + i];
96613
96730
  if (mixinIdx === -1 || mixinIdx === undefined)
96614
96731
  continue; // safety: dangling mixin ref
96615
- this._collectMixinProperties(mixinIdx, merged);
96732
+ const mixinProperties = new Map();
96733
+ this._collectProperties(mixinIdx, mixinProperties);
96734
+ for (const [nameKey, resolved] of mixinProperties) {
96735
+ if (!merged.has(nameKey))
96736
+ merged.set(nameKey, resolved);
96737
+ }
96616
96738
  }
96617
96739
  // 3. Own properties - always override
96618
96740
  for (let i = 0; i < cls.ownPropCount; i++) {
@@ -96621,27 +96743,62 @@ class SchemaView {
96621
96743
  merged.set(nameKey, { ref, classIdx });
96622
96744
  }
96623
96745
  }
96624
- _collectMixinProperties(mixinIdx, merged) {
96625
- const mixin = this[_storage].classes[mixinIdx];
96626
- if (mixin === undefined)
96627
- return; // safety: dangling index from excluded schema
96628
- // Walk mixin's own base chain (mixins can extend other mixins)
96629
- if (mixin.baseClassIdx !== -1)
96630
- this._collectMixinProperties(mixin.baseClassIdx, merged);
96631
- // Mixin's own mixins
96632
- for (let i = 0; i < mixin.mixinCount; i++) {
96633
- const subMixinIdx = this[_storage].classMixins[mixin.mixinStartIdx + i];
96634
- if (subMixinIdx === -1 || subMixinIdx === undefined)
96746
+ /** Finds the property declaration that a property of the given class overrides.
96747
+ * Searches the base class and its ancestors first, then each mixin in declaration order.
96748
+ */
96749
+ _findOverriddenProperty(classIdx, nameKey) {
96750
+ const cls = this[_storage].classes[classIdx];
96751
+ if (cls === undefined || cls.type === _SchemaViewInterfaces__WEBPACK_IMPORTED_MODULE_0__.ClassType.View)
96752
+ return undefined;
96753
+ if (cls.baseClassIdx !== -1) {
96754
+ const found = this._findPropertyDeclaration(cls.baseClassIdx, nameKey);
96755
+ if (found !== undefined)
96756
+ return found;
96757
+ }
96758
+ for (let i = 0; i < cls.mixinCount; i++) {
96759
+ const mixinIdx = this[_storage].classMixins[cls.mixinStartIdx + i];
96760
+ if (mixinIdx === -1 || mixinIdx === undefined)
96635
96761
  continue; // safety: dangling mixin ref
96636
- this._collectMixinProperties(subMixinIdx, merged);
96762
+ const found = this._findPropertyDeclaration(mixinIdx, nameKey);
96763
+ if (found !== undefined)
96764
+ return found;
96765
+ }
96766
+ return undefined;
96767
+ }
96768
+ _findPropertyDeclaration(classIdx, nameKey) {
96769
+ const cls = this[_storage].classes[classIdx];
96770
+ if (cls === undefined)
96771
+ return undefined; // safety: dangling index from excluded schema
96772
+ for (let i = 0; i < cls.ownPropCount; i++) {
96773
+ const ref = this[_storage].propertyRefs[cls.ownPropStart + i];
96774
+ if (this[_storage].lowerStrings[this[_storage].propDefs[ref.defIdx].nameStringIdx] === nameKey)
96775
+ return { ref, classIdx };
96637
96776
  }
96638
- // Mixin's own properties - only set if not already present (first mixin wins)
96639
- for (let i = 0; i < mixin.ownPropCount; i++) {
96640
- const ref = this[_storage].propertyRefs[mixin.ownPropStart + i];
96777
+ return this._findOverriddenProperty(classIdx, nameKey);
96778
+ }
96779
+ /** Returns the first declaration matching `predicate`, starting with the given declaration and
96780
+ * continuing with the declarations it overrides.
96781
+ * @internal
96782
+ */
96783
+ findPropertyDefInOverrides(ref, classIdx, predicate) {
96784
+ let current = { ref, classIdx };
96785
+ while (current !== null) {
96786
+ const def = this[_storage].propDefs[current.ref.defIdx];
96787
+ if (predicate(def))
96788
+ return def;
96789
+ current = this._getOverriddenProperty(current.ref, current.classIdx);
96790
+ }
96791
+ return undefined;
96792
+ }
96793
+ /** Returns the declaration the given one overrides, resolving and storing it on the ref on first access.
96794
+ * Caching per ref is sound because a ref belongs to exactly one class; view properties (classIdx -1) never override.
96795
+ */
96796
+ _getOverriddenProperty(ref, classIdx) {
96797
+ if (ref.overriddenProperty === undefined) {
96641
96798
  const nameKey = this[_storage].lowerStrings[this[_storage].propDefs[ref.defIdx].nameStringIdx];
96642
- if (!merged.has(nameKey))
96643
- merged.set(nameKey, { ref, classIdx: mixinIdx });
96799
+ ref.overriddenProperty = classIdx !== -1 ? this._findOverriddenProperty(classIdx, nameKey) ?? null : null;
96644
96800
  }
96801
+ return ref.overriddenProperty;
96645
96802
  }
96646
96803
  /** @internal */
96647
96804
  buildDerivedClassMap() {
@@ -96666,6 +96823,9 @@ class SchemaView {
96666
96823
  // =====================================================================================
96667
96824
  // SchemaView namespace - flyweight view types
96668
96825
  // =====================================================================================
96826
+ function hasCategory(def) { return def.categoryIdx !== -1; }
96827
+ function hasKindOfQuantity(def) { return def.koqIdx !== -1; }
96828
+ function isHiddenDef(def) { return def.isHidden; }
96669
96829
  /** @beta */
96670
96830
  (function (SchemaView) {
96671
96831
  /** Lightweight view over a schema in a `SchemaView`. Holds only a view reference and
@@ -97009,10 +97169,21 @@ class SchemaView {
97009
97169
  }
97010
97170
  get kind() { return this._def.kind; }
97011
97171
  get isReadOnly() { return this._def.isReadOnly; }
97012
- /** Reflects the `HiddenProperty` custom attribute from `CoreCustomAttributes`.
97013
- * Properties marked hidden are typically excluded from UI display but remain accessible programmatically. */
97172
+ /** Reflects the `HiddenProperty` custom attribute from `CoreCustomAttributes` on this declaration only;
97173
+ * see `isEffectivelyHidden`. Properties marked hidden are typically excluded from UI display but remain
97174
+ * accessible programmatically. */
97014
97175
  get isHidden() { return this._def.isHidden; }
97015
- /** Display priority. Higher values should be displayed more prominently. 0 means default. */
97176
+ /** True if this declaration is hidden. If it is not and the property is an override, we take this from the
97177
+ * overridden property. Limitation: `HiddenProperty(Show=true)` reads the same as no `HiddenProperty`, so it does not
97178
+ * unhide a property whose overridden property is hidden. */
97179
+ get isEffectivelyHidden() {
97180
+ if (this._def.isHidden)
97181
+ return true;
97182
+ return this._ctx.findPropertyDefInOverrides(this._ref, this._classIdx, isHiddenDef) !== undefined;
97183
+ }
97184
+ /** Display priority. Higher values should be displayed more prominently. 0 means default.
97185
+ * Not inherited from the overridden property: an omitted priority is stored as 0, which cannot be told
97186
+ * apart from an explicit 0 that overrides a base priority. */
97016
97187
  get priority() { return this._ref.priority; }
97017
97188
  /** The class that declared or contributed this property through inheritance.
97018
97189
  * For own properties, returns the class itself. For inherited properties, returns the
@@ -97023,11 +97194,21 @@ class SchemaView {
97023
97194
  get declaringClass() {
97024
97195
  return this._classIdx !== -1 ? createClass(this._ctx, this._classIdx) : undefined;
97025
97196
  }
97026
- /** Property category, or undefined if none assigned. Available on all property kinds. */
97197
+ /** Property category. If there is no local category and the property is an override, we take this from
97198
+ * the overridden property. Available on all property kinds. */
97027
97199
  get category() {
97028
- const idx = this._def.categoryIdx;
97200
+ let idx = this._def.categoryIdx;
97201
+ if (idx === -1 && this._ctx[_storage].propCategories.length !== 0)
97202
+ idx = this._ctx.findPropertyDefInOverrides(this._ref, this._classIdx, hasCategory)?.categoryIdx ?? -1;
97029
97203
  return idx !== -1 ? new PropertyCategory(this._ctx, idx) : undefined;
97030
97204
  }
97205
+ /** @internal */
97206
+ get _kindOfQuantity() {
97207
+ let idx = this._def.koqIdx;
97208
+ if (idx === -1 && this._ctx[_storage].koqs.length !== 0)
97209
+ idx = this._ctx.findPropertyDefInOverrides(this._ref, this._classIdx, hasKindOfQuantity)?.koqIdx ?? -1;
97210
+ return idx !== -1 ? new KindOfQuantity(this._ctx, idx) : undefined;
97211
+ }
97031
97212
  // Type guards - real type predicates that narrow `this`
97032
97213
  /** True for `SchemaView.PrimitiveProperty` and `SchemaView.PrimitiveArrayProperty`.
97033
97214
  * Matches ecschema-metadata behavior where `isPrimitive()` includes primitive arrays. */
@@ -97089,10 +97270,9 @@ class SchemaView {
97089
97270
  const idx = this._def.enumIdx;
97090
97271
  return idx !== -1 ? new Enumeration(this._ctx, idx) : undefined;
97091
97272
  }
97092
- get kindOfQuantity() {
97093
- const idx = this._def.koqIdx;
97094
- return idx !== -1 ? new KindOfQuantity(this._ctx, idx) : undefined;
97095
- }
97273
+ /** KindOfQuantity. If there is no local KindOfQuantity and the property is an override, we take this
97274
+ * from the overridden property. */
97275
+ get kindOfQuantity() { return this._kindOfQuantity; }
97096
97276
  }
97097
97277
  SchemaView.PrimitiveProperty = PrimitiveProperty;
97098
97278
  /** An array of primitive values. Same primitive/enum fields as `PrimitiveProperty`,
@@ -97109,10 +97289,9 @@ class SchemaView {
97109
97289
  const idx = this._def.enumIdx;
97110
97290
  return idx !== -1 ? new Enumeration(this._ctx, idx) : undefined;
97111
97291
  }
97112
- get kindOfQuantity() {
97113
- const idx = this._def.koqIdx;
97114
- return idx !== -1 ? new KindOfQuantity(this._ctx, idx) : undefined;
97115
- }
97292
+ /** KindOfQuantity. If there is no local KindOfQuantity and the property is an override, we take this
97293
+ * from the overridden property. */
97294
+ get kindOfQuantity() { return this._kindOfQuantity; }
97116
97295
  get arrayMinOccurs() { return this._def.arrayMinOccurs; }
97117
97296
  get arrayMaxOccurs() { return this._def.arrayMaxOccurs; }
97118
97297
  }
@@ -98018,6 +98197,7 @@ function mergeFragmentBlob(ctx, data) {
98018
98197
  defIdx,
98019
98198
  labelStringIdx: pr.labelStringIdx,
98020
98199
  priority: pr.priority,
98200
+ overriddenProperty: undefined,
98021
98201
  });
98022
98202
  }
98023
98203
  let sourceConstraintIdx = -1;
@@ -110829,30 +111009,63 @@ class CoordinateConverter {
110829
111009
  }
110830
111010
  }
110831
111011
  /** An object capable of communicating with the backend to convert between coordinates in a geographic coordinate system and coordinates in an [[IModelConnection]]'s own coordinate system.
111012
+ * Conversion results retain the backend's per-point status, including failed vertical conversions. Check each status
111013
+ * before using elevations; [[GeoCoordStatus.VerticalDatumConvertError]] does not provide a reliable converted Z.
111014
+ * Results, including failures, are cached in this converter. Loading grids does not invalidate those cached results.
111015
+ * To retry after resources become available, finish outstanding requests and acquire a fresh converter from
111016
+ * [[GeoServices.getConverter]] instead of reusing the retained instance.
110832
111017
  * @see [[GeoServices.getConverter]] to obtain a converter.
110833
111018
  * @see [GeographicCRS]($common) for more information about geographic coordinate reference systems.
110834
111019
  * @public
110835
111020
  */
110836
111021
  class GeoConverter {
110837
- _geoToIModel;
110838
- _iModelToGeo;
111022
+ _converters;
111023
+ _gcs;
111024
+ _options;
110839
111025
  /** Used for removing this converter from GeoServices' cache after all requests are completed.
110840
111026
  * @internal
110841
111027
  */
110842
111028
  onAllRequestsCompleted = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
110843
111029
  /** @internal */
110844
111030
  constructor(opts) {
111031
+ this._options = opts;
111032
+ this._gcs = opts.getGcs?.();
111033
+ this._converters = this.createConverters();
111034
+ }
111035
+ createConverters() {
111036
+ const opts = this._options;
110845
111037
  const isIModelClosed = opts.isIModelClosed;
110846
- this._geoToIModel = new CoordinateConverter({
110847
- direction: "geoToIModel",
110848
- isIModelClosed,
110849
- requestPoints: async (geoCoords) => opts.toIModelCoords({ source: opts.datum, geoCoords }),
110850
- });
110851
- this._iModelToGeo = new CoordinateConverter({
110852
- direction: "iModelToGeo",
110853
- isIModelClosed,
110854
- requestPoints: async (iModelCoords) => opts.fromIModelCoords({ target: opts.datum, iModelCoords }),
110855
- });
111038
+ return {
111039
+ geoToIModel: new CoordinateConverter({
111040
+ direction: "geoToIModel",
111041
+ isIModelClosed,
111042
+ requestPoints: async (geoCoords) => opts.toIModelCoords({ source: opts.datum, geoCoords }),
111043
+ }),
111044
+ iModelToGeo: new CoordinateConverter({
111045
+ direction: "iModelToGeo",
111046
+ isIModelClosed,
111047
+ requestPoints: async (iModelCoords) => opts.fromIModelCoords({ target: opts.datum, iModelCoords }),
111048
+ }),
111049
+ };
111050
+ }
111051
+ refreshGcs() {
111052
+ const gcs = this._options.getGcs?.();
111053
+ if (gcs !== this._gcs) {
111054
+ this._gcs = gcs;
111055
+ this._converters = this.createConverters();
111056
+ }
111057
+ }
111058
+ async convert(points, direction) {
111059
+ for (;;) {
111060
+ this.refreshGcs();
111061
+ const converter = this._converters[direction];
111062
+ const result = await converter.convert(points);
111063
+ this.refreshGcs();
111064
+ if (converter !== this._converters[direction])
111065
+ continue;
111066
+ this.checkCompletion();
111067
+ return result;
111068
+ }
110856
111069
  }
110857
111070
  /** Convert the specified geographic coordinates into iModel coordinates. */
110858
111071
  async convertToIModelCoords(geoPoints) {
@@ -110866,8 +111079,7 @@ class GeoConverter {
110866
111079
  }
110867
111080
  /** @internal */
110868
111081
  async getIModelCoordinatesFromGeoCoordinates(geoPoints) {
110869
- const result = await this._geoToIModel.convert(geoPoints);
110870
- this.checkCompletion();
111082
+ const result = await this.convert(geoPoints, "geoToIModel");
110871
111083
  return {
110872
111084
  iModelCoords: result.points,
110873
111085
  fromCache: result.fromCache,
@@ -110875,20 +111087,20 @@ class GeoConverter {
110875
111087
  }
110876
111088
  /** @internal */
110877
111089
  async getGeoCoordinatesFromIModelCoordinates(iModelPoints) {
110878
- const result = await this._iModelToGeo.convert(iModelPoints);
110879
- this.checkCompletion();
111090
+ const result = await this.convert(iModelPoints, "iModelToGeo");
110880
111091
  return {
110881
111092
  geoCoords: result.points,
110882
111093
  fromCache: result.fromCache,
110883
111094
  };
110884
111095
  }
110885
111096
  checkCompletion() {
110886
- if (this._geoToIModel.isIdle && this._iModelToGeo.isIdle)
111097
+ if (this._converters.geoToIModel.isIdle && this._converters.iModelToGeo.isIdle)
110887
111098
  this.onAllRequestsCompleted.raiseEvent();
110888
111099
  }
110889
111100
  /** @internal */
110890
111101
  getCachedIModelCoordinatesFromGeoCoordinates(geoPoints) {
110891
- return this._geoToIModel.findCached(geoPoints);
111102
+ this.refreshGcs();
111103
+ return this._converters.geoToIModel.findCached(geoPoints);
110892
111104
  }
110893
111105
  }
110894
111106
  /** The Geographic Services available for an [[IModelConnection]].
@@ -110916,6 +111128,7 @@ class GeoServices {
110916
111128
  static createForIModel(iModel) {
110917
111129
  return new GeoServices({
110918
111130
  isIModelClosed: () => iModel.isClosed,
111131
+ getGcs: () => iModel.geographicCoordinateSystem,
110919
111132
  toIModelCoords: async (request) => {
110920
111133
  const rpc = _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelReadRpcInterface.getClientForRouting(iModel.routingContext.token);
110921
111134
  const response = await rpc.getIModelCoordinatesFromGeoCoordinates(iModel.getRpcProps(), request);
@@ -113041,6 +113254,25 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
113041
113254
  async generateElementMeshes(requestProps) {
113042
113255
  return _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelReadRpcInterface.getClientForRouting(this.routingContext.token).generateElementMeshes(this.getRpcProps(), requestProps);
113043
113256
  }
113257
+ /** Constructs a point after validating raw ordinates, before JSON normalization can conceal NaN.
113258
+ * Omitted ordinates default to zero.
113259
+ * @throws IModelError with GeoServiceStatus.CSMapError if any supplied ordinate is non-finite.
113260
+ * @internal
113261
+ */
113262
+ static getFiniteGeoPoint(props) {
113263
+ const coordinates = Array.isArray(props) ? props : [props.x, props.y, props.z];
113264
+ for (let index = 0; index < 3; ++index) {
113265
+ // RPC marshaling converts NaN and infinities to null; reject null rather than defaulting it to zero.
113266
+ if (!Number.isFinite(coordinates[index] === undefined ? 0 : coordinates[index])) {
113267
+ _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logError(loggerCategory, "Non-finite coordinate returned by geographic conversion", {
113268
+ ordinateIndex: index,
113269
+ coordinates: coordinates.map((ordinate) => String(ordinate)),
113270
+ });
113271
+ throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.GeoServiceStatus.CSMapError, "Non-finite coordinate returned by geographic conversion");
113272
+ }
113273
+ }
113274
+ return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(props);
113275
+ }
113044
113276
  /** Convert a point in this iModel's Spatial coordinates to a [[Cartographic]] using the Geographic location services for this IModelConnection.
113045
113277
  * @param spatial A point in the iModel's spatial coordinates
113046
113278
  * @param result If defined, use this for output
@@ -113059,7 +113291,7 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
113059
113291
  const geoServiceStatus = (0,_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.mapToGeoServiceStatus)(coordResponse.geoCoords[0].s);
113060
113292
  throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError(geoServiceStatus, "Error converting spatial to cartographic");
113061
113293
  }
113062
- const longLatHeight = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(coordResponse.geoCoords[0].p); // x is longitude in degrees, y is latitude in degrees, z is height in meters...
113294
+ const longLatHeight = IModelConnection.getFiniteGeoPoint(coordResponse.geoCoords[0].p); // x is longitude in degrees, y is latitude in degrees, z is height in meters...
113063
113295
  return _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.Cartographic.fromDegrees({ longitude: longLatHeight.x, latitude: longLatHeight.y, height: longLatHeight.z }, result);
113064
113296
  }
113065
113297
  /** Convert a point in this iModel's Spatial coordinates to a [[Cartographic]] using the Geographic location services for this IModelConnection or [[IModel.ecefLocation]].
@@ -113113,7 +113345,7 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
113113
113345
  case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.GeoCoordStatus.NoGCSDefined:
113114
113346
  throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.GeoServiceStatus.NoGeoLocation, "iModel is not GeoLocated");
113115
113347
  case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.GeoCoordStatus.Success:
113116
- const llh = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(coord.p);
113348
+ const llh = IModelConnection.getFiniteGeoPoint(coord.p);
113117
113349
  return _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.Cartographic.fromDegrees({ longitude: llh.x, latitude: llh.y, height: llh.z });
113118
113350
  default:
113119
113351
  throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError((0,_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.mapToGeoServiceStatus)(coord.s), "Error converting spatial to cartographic");
@@ -113140,7 +113372,7 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
113140
113372
  throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError(geoServiceStatus, "Error converting cartographic to spatial");
113141
113373
  }
113142
113374
  result = result ? result : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point3d.createZero();
113143
- result.setFromJSON(coordResponse.iModelCoords[0].p);
113375
+ result.setFrom(IModelConnection.getFiniteGeoPoint(coordResponse.iModelCoords[0].p));
113144
113376
  return result;
113145
113377
  }
113146
113378
  /** Convert a [Cartographic]($common) to a point in this iModel's Spatial coordinates using a [[GeoConverter]] or[[IModel.ecefLocation]($common).
@@ -113190,7 +113422,7 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
113190
113422
  case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.GeoCoordStatus.NoGCSDefined:
113191
113423
  throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.GeoServiceStatus.NoGeoLocation, "iModel is not GeoLocated");
113192
113424
  case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.GeoCoordStatus.Success:
113193
- return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(coord.p);
113425
+ return IModelConnection.getFiniteGeoPoint(coord.p);
113194
113426
  default:
113195
113427
  throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError((0,_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.mapToGeoServiceStatus)(coord.s), "Error converting cartographic to spatial");
113196
113428
  }
@@ -113526,7 +113758,7 @@ class SnapshotConnection extends IModelConnection {
113526
113758
  /** @internal */
113527
113759
  async getDictionaryModel() {
113528
113760
  const res = await this._iModel.models.queryProps({ from: "bis.DictionaryModel", wantPrivate: true });
113529
- if (res.length !== 1 || res[0].id === undefined)
113761
+ if (res.length !== 1)
113530
113762
  throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.IModelStatus.BadModel, "bis.DictionaryModel");
113531
113763
  return res[0].id;
113532
113764
  }
@@ -137061,6 +137293,7 @@ const extensionExports = {
137061
137293
  imageBufferToPngDataUrl: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.imageBufferToPngDataUrl,
137062
137294
  imageElementFromImageSource: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.imageElementFromImageSource,
137063
137295
  imageElementFromUrl: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.imageElementFromUrl,
137296
+ isPersisted: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.isPersisted,
137064
137297
  queryTerrainElevationOffset: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.queryTerrainElevationOffset,
137065
137298
  readElementGraphics: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.readElementGraphics,
137066
137299
  readGltfGraphics: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.readGltfGraphics,
@@ -174181,9 +174414,10 @@ __webpack_require__.r(__webpack_exports__);
174181
174414
  /* harmony import */ var _common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/FrontendLoggerCategory */ "../../core/frontend/lib/esm/common/FrontendLoggerCategory.js");
174182
174415
  /* harmony import */ var _DisplayStyleState__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../DisplayStyleState */ "../../core/frontend/lib/esm/DisplayStyleState.js");
174183
174416
  /* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
174184
- /* harmony import */ var _RealityDataSource__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../RealityDataSource */ "../../core/frontend/lib/esm/RealityDataSource.js");
174185
- /* harmony import */ var _common_internal_render_MeshPrimitives__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/internal/render/MeshPrimitives */ "../../core/frontend/lib/esm/common/internal/render/MeshPrimitives.js");
174186
- /* harmony import */ var _tile_internal__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../tile/internal */ "../../core/frontend/lib/esm/tile/internal.js");
174417
+ /* harmony import */ var _IModelConnection__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../IModelConnection */ "../../core/frontend/lib/esm/IModelConnection.js");
174418
+ /* harmony import */ var _RealityDataSource__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../RealityDataSource */ "../../core/frontend/lib/esm/RealityDataSource.js");
174419
+ /* harmony import */ var _common_internal_render_MeshPrimitives__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/internal/render/MeshPrimitives */ "../../core/frontend/lib/esm/common/internal/render/MeshPrimitives.js");
174420
+ /* harmony import */ var _tile_internal__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../tile/internal */ "../../core/frontend/lib/esm/tile/internal.js");
174187
174421
  /*---------------------------------------------------------------------------------------------
174188
174422
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
174189
174423
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -174202,6 +174436,7 @@ __webpack_require__.r(__webpack_exports__);
174202
174436
 
174203
174437
 
174204
174438
 
174439
+
174205
174440
  const scratchRange = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Range3d.create();
174206
174441
  const scratchWorldFrustum = new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.Frustum();
174207
174442
  function compareSourceKeys(lhs, rhs) {
@@ -174265,7 +174500,7 @@ class OrbitGtTileTreeParams {
174265
174500
  id;
174266
174501
  modelId;
174267
174502
  iModel;
174268
- get priority() { return _tile_internal__WEBPACK_IMPORTED_MODULE_10__.TileLoadPriority.Context; }
174503
+ get priority() { return _tile_internal__WEBPACK_IMPORTED_MODULE_11__.TileLoadPriority.Context; }
174269
174504
  constructor(rdSourceKey, iModel, modelId, location) {
174270
174505
  this.location = location;
174271
174506
  const key = rdSourceKey;
@@ -174274,7 +174509,7 @@ class OrbitGtTileTreeParams {
174274
174509
  this.iModel = iModel;
174275
174510
  }
174276
174511
  }
174277
- class OrbitGtRootTile extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.Tile {
174512
+ class OrbitGtRootTile extends _tile_internal__WEBPACK_IMPORTED_MODULE_11__.Tile {
174278
174513
  _loadChildren(_resolve, _reject) { }
174279
174514
  async requestContent(_isCanceled) { return undefined; }
174280
174515
  get channel() { return _IModelApp__WEBPACK_IMPORTED_MODULE_7__.IModelApp.tileAdmin.channels.getForHttp("itwinjs-orbitgit"); }
@@ -174347,7 +174582,7 @@ class TileSortProjector {
174347
174582
  coordinate.z = point.z;
174348
174583
  }
174349
174584
  }
174350
- class OrbitGtTileGraphic extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.TileUsageMarker {
174585
+ class OrbitGtTileGraphic extends _tile_internal__WEBPACK_IMPORTED_MODULE_11__.TileUsageMarker {
174351
174586
  graphic;
174352
174587
  constructor(graphic, viewport, time) {
174353
174588
  super();
@@ -174358,7 +174593,7 @@ class OrbitGtTileGraphic extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.Ti
174358
174593
  this.graphic[Symbol.dispose]();
174359
174594
  }
174360
174595
  }
174361
- class OrbitGtTileTree extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.TileTree {
174596
+ class OrbitGtTileTree extends _tile_internal__WEBPACK_IMPORTED_MODULE_11__.TileTree {
174362
174597
  _dataManager;
174363
174598
  _centerOffset;
174364
174599
  _ecefTransform;
@@ -174374,7 +174609,7 @@ class OrbitGtTileTree extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.TileT
174374
174609
  this._dataManager = _dataManager;
174375
174610
  this._centerOffset = _centerOffset;
174376
174611
  this._ecefTransform = _ecefTransform;
174377
- this._layerHandler = new _tile_internal__WEBPACK_IMPORTED_MODULE_10__.LayerTileTreeHandler(this);
174612
+ this._layerHandler = new _tile_internal__WEBPACK_IMPORTED_MODULE_11__.LayerTileTreeHandler(this);
174378
174613
  this._tileParams = { contentId: "0", range: cloudRange, maximumSize: 256 };
174379
174614
  this.rootTile = new OrbitGtRootTile(this._tileParams, this);
174380
174615
  }
@@ -174444,7 +174679,7 @@ class OrbitGtTileTree extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.TileT
174444
174679
  range.high.addInPlace(this._centerOffset);
174445
174680
  const qParams = _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QParams3d.fromRange(range, undefined, (tile.points8 != null) ? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.Quantization.rangeScale8 : _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.Quantization.rangeScale16);
174446
174681
  const featureTable = new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.FeatureTable(1, this.modelId, _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.BatchType.Primary);
174447
- const features = new _common_internal_render_MeshPrimitives__WEBPACK_IMPORTED_MODULE_9__.Mesh.Features(featureTable);
174682
+ const features = new _common_internal_render_MeshPrimitives__WEBPACK_IMPORTED_MODULE_10__.Mesh.Features(featureTable);
174448
174683
  const system = _IModelApp__WEBPACK_IMPORTED_MODULE_7__.IModelApp.renderSystem;
174449
174684
  const voxelSize = (range.high.x - range.low.x) / 64;
174450
174685
  features.add(new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.Feature(this.modelId), 1);
@@ -174519,7 +174754,17 @@ async function computeVerticalDatumShift(geoOrigin, heightAsEllipsoidalDbZ, iMod
174519
174754
  _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logWarning(_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_5__.FrontendLoggerCategory.RealityData, `Failed to compute orthometric height correction for point cloud (status ${response.iModelCoords[0].s}); heights will be treated as ellipsoidal`);
174520
174755
  return 0;
174521
174756
  }
174522
- return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(response.iModelCoords[0].p).z - heightAsEllipsoidalDbZ;
174757
+ try {
174758
+ const converted = _IModelConnection__WEBPACK_IMPORTED_MODULE_8__.IModelConnection.getFiniteGeoPoint(response.iModelCoords[0].p);
174759
+ const shift = converted.z - heightAsEllipsoidalDbZ;
174760
+ if (!Number.isFinite(shift))
174761
+ throw new Error("Non-finite orthometric height correction");
174762
+ return shift;
174763
+ }
174764
+ catch {
174765
+ _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logWarning(_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_5__.FrontendLoggerCategory.RealityData, "Non-finite orthometric height correction for point cloud; heights will be treated as ellipsoidal");
174766
+ return 0;
174767
+ }
174523
174768
  }
174524
174769
  catch (err) {
174525
174770
  _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logError(_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_5__.FrontendLoggerCategory.RealityData, err);
@@ -174549,7 +174794,7 @@ async function computeVerticalDatumShift(geoOrigin, heightAsEllipsoidalDbZ, iMod
174549
174794
  return isValidSASToken(props.sasToken);
174550
174795
  }
174551
174796
  async function createOrbitGtTileTree(rdSourceKey, iModel, modelId) {
174552
- const rdSource = await _RealityDataSource__WEBPACK_IMPORTED_MODULE_8__.RealityDataSource.fromKey(rdSourceKey, iModel.iTwinId);
174797
+ const rdSource = await _RealityDataSource__WEBPACK_IMPORTED_MODULE_9__.RealityDataSource.fromKey(rdSourceKey, iModel.iTwinId);
174553
174798
  const isContextShare = rdSourceKey.provider === _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RealityDataProvider.ContextShare;
174554
174799
  const isTilestUrl = rdSourceKey.provider === _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RealityDataProvider.TilesetUrl;
174555
174800
  let blobStringUrl;
@@ -174568,7 +174813,7 @@ async function computeVerticalDatumShift(geoOrigin, heightAsEllipsoidalDbZ, iMod
174568
174813
  blobStringUrl = rdSourceKey.id;
174569
174814
  }
174570
174815
  else {
174571
- const orbitGtBlobProps = _RealityDataSource__WEBPACK_IMPORTED_MODULE_8__.RealityDataSource.createOrbitGtBlobPropsFromKey(rdSourceKey);
174816
+ const orbitGtBlobProps = _RealityDataSource__WEBPACK_IMPORTED_MODULE_9__.RealityDataSource.createOrbitGtBlobPropsFromKey(rdSourceKey);
174572
174817
  if (orbitGtBlobProps === undefined)
174573
174818
  return undefined;
174574
174819
  if (!isValidOrbitGtBlobProps(orbitGtBlobProps))
@@ -174657,7 +174902,7 @@ async function computeVerticalDatumShift(geoOrigin, heightAsEllipsoidalDbZ, iMod
174657
174902
  /** Supplies a reality data [[TileTree]] from a URL. May be associated with a persistent [[GeometricModelState]], or attached at run-time via a [[ContextOrbitGtState]].
174658
174903
  * Exported strictly for tests.
174659
174904
  */
174660
- class OrbitGtTreeReference extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.RealityModelTileTree.Reference {
174905
+ class OrbitGtTreeReference extends _tile_internal__WEBPACK_IMPORTED_MODULE_11__.RealityModelTileTree.Reference {
174661
174906
  treeOwner;
174662
174907
  _rdSourceKey;
174663
174908
  _modelId;
@@ -174670,11 +174915,11 @@ class OrbitGtTreeReference extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.
174670
174915
  this._rdSourceKey = props.rdSourceKey;
174671
174916
  }
174672
174917
  else if (props.orbitGtBlob) {
174673
- this._rdSourceKey = _RealityDataSource__WEBPACK_IMPORTED_MODULE_8__.RealityDataSource.createKeyFromOrbitGtBlobProps(props.orbitGtBlob);
174918
+ this._rdSourceKey = _RealityDataSource__WEBPACK_IMPORTED_MODULE_9__.RealityDataSource.createKeyFromOrbitGtBlobProps(props.orbitGtBlob);
174674
174919
  }
174675
174920
  else {
174676
174921
  // TODO: Maybe we should throw an exception
174677
- this._rdSourceKey = _RealityDataSource__WEBPACK_IMPORTED_MODULE_8__.RealityDataSource.createKeyFromBlobUrl("", _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RealityDataProvider.OrbitGtBlob, _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RealityDataFormat.OPC);
174922
+ this._rdSourceKey = _RealityDataSource__WEBPACK_IMPORTED_MODULE_9__.RealityDataSource.createKeyFromBlobUrl("", _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RealityDataProvider.OrbitGtBlob, _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RealityDataFormat.OPC);
174678
174923
  }
174679
174924
  // ###TODO find compatible model Id
174680
174925
  let modelId = props.modelId;
@@ -181673,7 +181918,12 @@ var QuantityType;
181673
181918
  class AlternateUnitLabelsRegistry {
181674
181919
  _alternateLabelRegistry = new Map();
181675
181920
  addAlternateLabels(key, ...labels) {
181676
- [...labels].forEach((value) => this._alternateLabelRegistry.get(key)?.add(value));
181921
+ let entry = this._alternateLabelRegistry.get(key);
181922
+ if (!entry) {
181923
+ entry = new Set();
181924
+ this._alternateLabelRegistry.set(key, entry);
181925
+ }
181926
+ labels.forEach((value) => entry.add(value));
181677
181927
  }
181678
181928
  constructor(defaultAlternates) {
181679
181929
  if (defaultAlternates) {
@@ -182476,7 +182726,7 @@ class QuantityFormatter {
182476
182726
  const entry = this.quantityTypesRegistry.get(quantityKey);
182477
182727
  if (!entry)
182478
182728
  throw new Error(`Unable to find registered quantity type with key ${quantityKey}`);
182479
- return entry.generateParserSpec(this.getFormatPropsByQuantityTypeEntryAndSystem(entry, requestedSystem), this.unitsProvider);
182729
+ return entry.generateParserSpec(this.getFormatPropsByQuantityTypeEntryAndSystem(entry, requestedSystem), this.unitsProvider, this.alternateUnitLabelsProvider);
182480
182730
  }
182481
182731
  /** Asynchronous Call to get a ParserSpec for a QuantityType.
182482
182732
  * @param type One of the built-in quantity types supported.
@@ -182624,7 +182874,7 @@ class QuantityFormatter {
182624
182874
  const { persistenceUnitName, formatProps, formatName } = props;
182625
182875
  const persistenceUnitProps = await this._unitsProvider.findUnitByName(persistenceUnitName);
182626
182876
  const format = await _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.Format.createFromJSON(formatName ?? "temp", this._unitsProvider, formatProps);
182627
- return _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.ParserSpec.create(format, this._unitsProvider, persistenceUnitProps);
182877
+ return _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.ParserSpec.create(format, this._unitsProvider, persistenceUnitProps, this.alternateUnitLabelsProvider);
182628
182878
  }
182629
182879
  /**
182630
182880
  * @beta
@@ -183166,6 +183416,9 @@ const UNIT_EXTRA_DATA = [
183166
183416
  { name: "Units.CUB_US_SURVEY_FT", altDisplayLabels: ["cf"] },
183167
183417
  { name: "Units.CUB_YRD", altDisplayLabels: ["cy"] },
183168
183418
  { name: "Units.CUB_M", altDisplayLabels: ["cm"] },
183419
+ // Velocity ( base unit m/s )
183420
+ { name: "Units.KM_PER_HR", altDisplayLabels: ["kph", "kmh"] },
183421
+ { name: "Units.MPH", altDisplayLabels: ["mph"] },
183169
183422
  ];
183170
183423
 
183171
183424
 
@@ -209971,7 +210224,14 @@ class ToolAdmin {
209971
210224
  return false;
209972
210225
  if (!await this.finishEditCommandForTxnOperation())
209973
210226
  return false;
209974
- return imodel.txns.reverseSingleTxnAsync().then(() => true).catch(() => false);
210227
+ try {
210228
+ await imodel.txns.reverseSingleTxnAsync();
210229
+ return true;
210230
+ }
210231
+ catch (error) {
210232
+ await this.onTxnOperationError("undo", error);
210233
+ return false;
210234
+ }
209975
210235
  }
209976
210236
  /** Called to redo previous data button for primitive tools or undo last write operation. */
209977
210237
  async doRedoOperation() {
@@ -209986,8 +210246,22 @@ class ToolAdmin {
209986
210246
  return false;
209987
210247
  if (!await this.finishEditCommandForTxnOperation())
209988
210248
  return false;
209989
- return imodel.txns.reinstateTxnAsync().then(() => true).catch(() => false);
210249
+ try {
210250
+ await imodel.txns.reinstateTxnAsync();
210251
+ return true;
210252
+ }
210253
+ catch (error) {
210254
+ await this.onTxnOperationError("redo", error);
210255
+ return false;
210256
+ }
209990
210257
  }
210258
+ /** Called when [[doUndoOperation]] or [[doRedoOperation]] fails to reverse or reinstate a Txn.
210259
+ * @param _operation The operation that failed.
210260
+ * @param _error The error thrown by [[BriefcaseTxns.reverseSingleTxnAsync]] or [[BriefcaseTxns.reinstateTxnAsync]].
210261
+ * @note Implementations should not throw. Any exception thrown by this method propagates to the caller of [[doUndoOperation]] or [[doRedoOperation]].
210262
+ * @beta
210263
+ */
210264
+ async onTxnOperationError(_operation, _error) { }
209991
210265
  onActiveToolChanged(tool, start) {
209992
210266
  this.clearMotionPromises();
209993
210267
  this.activeToolChanged.raiseEvent(tool, start);
@@ -316496,7 +316770,7 @@ __webpack_require__.r(__webpack_exports__);
316496
316770
  /* harmony export */ });
316497
316771
  /* harmony import */ var i18next__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18next */ "../../common/temp/node_modules/.pnpm/i18next@21.10.0/node_modules/i18next/dist/esm/i18next.js");
316498
316772
  /* harmony import */ var i18next_browser_languagedetector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18next-browser-languagedetector */ "../../common/temp/node_modules/.pnpm/i18next-browser-languagedetector@6.1.8/node_modules/i18next-browser-languagedetector/dist/esm/i18nextBrowserLanguageDetector.js");
316499
- /* harmony import */ var i18next_http_backend__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18next-http-backend */ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/index.js");
316773
+ /* harmony import */ var i18next_http_backend__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18next-http-backend */ "../../common/temp/node_modules/.pnpm/i18next-http-backend@4.0.5/node_modules/i18next-http-backend/esm/index.js");
316500
316774
  /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
316501
316775
  /*---------------------------------------------------------------------------------------------
316502
316776
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
@@ -337211,7 +337485,16 @@ class Parser {
337211
337485
  // Don't add space when the wip token is empty.
337212
337486
  continue;
337213
337487
  }
337214
- if (isCharOperator) {
337488
+ // A slash directly between two label characters (e.g. "km/h") is part of the label, not a division.
337489
+ const nextCharCode = str.charCodeAt(i + 1);
337490
+ const isUnitLabelSlash = charCode === _Constants__WEBPACK_IMPORTED_MODULE_1__.QuantityConstants.CHAR_SLASH &&
337491
+ wipToken.length > 0 &&
337492
+ i + 1 < str.length &&
337493
+ !/\s/.test(str[i - 1]) &&
337494
+ !/\s/.test(str[i + 1]) &&
337495
+ !Parser.isDigitOrDecimalSeparator(nextCharCode, format) &&
337496
+ !isOperator(nextCharCode);
337497
+ if (isCharOperator && !isUnitLabelSlash) {
337215
337498
  if (wipToken.length > 0) {
337216
337499
  // There is a token is progress, process it now, before adding the new operator token.
337217
337500
  tokens.push(new ParseToken(wipToken));
@@ -344181,7 +344464,7 @@ class TestContext {
344181
344464
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
344182
344465
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
344183
344466
  await core_frontend_1.NoRenderApp.startup({
344184
- applicationVersion: "5.15.0-dev.9",
344467
+ applicationVersion: "5.16.0-dev.3",
344185
344468
  applicationId: this.settings.gprid,
344186
344469
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.serviceAuthToken),
344187
344470
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -366354,534 +366637,377 @@ const isSafeIterable = (thing) =>
366354
366637
 
366355
366638
  /***/ },
366356
366639
 
366357
- /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/index.js"
366640
+ /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@4.0.5/node_modules/i18next-http-backend/esm/index.js"
366358
366641
  /*!**********************************************************************************************************************!*\
366359
- !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/index.js ***!
366642
+ !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@4.0.5/node_modules/i18next-http-backend/esm/index.js ***!
366360
366643
  \**********************************************************************************************************************/
366361
366644
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
366362
366645
 
366363
366646
  "use strict";
366364
366647
  __webpack_require__.r(__webpack_exports__);
366365
366648
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
366366
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
366367
- /* harmony export */ });
366368
- /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/utils.js");
366369
- /* harmony import */ var _request_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./request.js */ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/request.js");
366370
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
366371
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
366372
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
366373
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
366374
- function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
366375
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
366376
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
366377
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
366378
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
366379
- ;
366380
-
366381
- var getDefaults = function getDefaults() {
366382
- return {
366383
- loadPath: '/locales/{{lng}}/{{ns}}.json',
366384
- addPath: '/locales/add/{{lng}}/{{ns}}',
366385
- parse: function parse(data) {
366386
- return JSON.parse(data);
366387
- },
366388
- stringify: JSON.stringify,
366389
- parsePayload: function parsePayload(namespace, key, fallbackValue) {
366390
- return _defineProperty({}, key, fallbackValue || '');
366391
- },
366392
- parseLoadPayload: function parseLoadPayload(languages, namespaces) {
366393
- return undefined;
366394
- },
366395
- request: _request_js__WEBPACK_IMPORTED_MODULE_1__["default"],
366396
- reloadInterval: typeof window !== 'undefined' ? false : 60 * 60 * 1000,
366397
- customHeaders: {},
366398
- queryStringParams: {},
366399
- crossDomain: false,
366400
- withCredentials: false,
366401
- overrideMimeType: false,
366402
- requestOptions: {
366403
- mode: 'cors',
366404
- credentials: 'same-origin',
366405
- cache: 'default'
366406
- }
366407
- };
366408
- };
366409
- var Backend = function () {
366410
- function Backend(services) {
366411
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
366412
- var allOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
366413
- _classCallCheck(this, Backend);
366414
- this.services = services;
366415
- this.options = options;
366416
- this.allOptions = allOptions;
366417
- this.type = 'backend';
366418
- this.init(services, options, allOptions);
366419
- }
366420
- return _createClass(Backend, [{
366421
- key: "init",
366422
- value: function init(services) {
366423
- var _this = this;
366424
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
366425
- var allOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
366426
- this.services = services;
366427
- this.options = _objectSpread(_objectSpread(_objectSpread({}, getDefaults()), this.options || {}), options);
366428
- this.allOptions = allOptions;
366429
- if (this.services && this.options.reloadInterval) {
366430
- var timer = setInterval(function () {
366431
- return _this.reload();
366432
- }, this.options.reloadInterval);
366433
- if (_typeof(timer) === 'object' && typeof timer.unref === 'function') timer.unref();
366434
- }
366435
- }
366436
- }, {
366437
- key: "readMulti",
366438
- value: function readMulti(languages, namespaces, callback) {
366439
- this._readAny(languages, languages, namespaces, namespaces, callback);
366440
- }
366441
- }, {
366442
- key: "read",
366443
- value: function read(language, namespace, callback) {
366444
- this._readAny([language], language, [namespace], namespace, callback);
366445
- }
366446
- }, {
366447
- key: "_readAny",
366448
- value: function _readAny(languages, loadUrlLanguages, namespaces, loadUrlNamespaces, callback) {
366449
- var _this2 = this;
366450
- var loadPath = this.options.loadPath;
366451
- if (typeof this.options.loadPath === 'function') {
366452
- loadPath = this.options.loadPath(languages, namespaces);
366453
- }
366454
- loadPath = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.makePromise)(loadPath);
366455
- loadPath.then(function (resolvedLoadPath) {
366456
- if (!resolvedLoadPath) return callback(null, {});
366457
- var url = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.interpolateUrl)(resolvedLoadPath, {
366458
- lng: languages.join('+'),
366459
- ns: namespaces.join('+')
366460
- });
366461
- if (url == null) {
366462
- var safeLngs = languages.map(_utils_js__WEBPACK_IMPORTED_MODULE_0__.sanitizeLogValue).join(', ');
366463
- var safeNss = namespaces.map(_utils_js__WEBPACK_IMPORTED_MODULE_0__.sanitizeLogValue).join(', ');
366464
- return callback(new Error('i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=[' + safeLngs + '] namespaces=[' + safeNss + ']'), false);
366465
- }
366466
- _this2.loadUrl(url, callback, loadUrlLanguages, loadUrlNamespaces);
366467
- });
366468
- }
366469
- }, {
366470
- key: "loadUrl",
366471
- value: function loadUrl(url, callback, languages, namespaces) {
366472
- var _this3 = this;
366473
- var lng = typeof languages === 'string' ? [languages] : languages;
366474
- var ns = typeof namespaces === 'string' ? [namespaces] : namespaces;
366475
- var payload = this.options.parseLoadPayload(lng, ns);
366476
- var safeUrl = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.sanitizeLogValue)((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.redactUrlCredentials)(url));
366477
- this.options.request(this.options, url, payload, function (err, res) {
366478
- if (res && (res.status >= 500 && res.status < 600 || !res.status)) return callback('failed loading ' + safeUrl + '; status code: ' + res.status, true);
366479
- if (res && res.status >= 400 && res.status < 500) return callback('failed loading ' + safeUrl + '; status code: ' + res.status, false);
366480
- if (!res && err && err.message) {
366481
- var errorMessage = err.message.toLowerCase();
366482
- var isNetworkError = ['failed', 'fetch', 'network', 'load'].find(function (term) {
366483
- return errorMessage.indexOf(term) > -1;
366484
- });
366485
- if (isNetworkError) {
366486
- return callback('failed loading ' + safeUrl + ': ' + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.sanitizeLogValue)(err.message), true);
366487
- }
366488
- }
366489
- if (err) return callback(err, false);
366490
- var ret, parseErr;
366491
- try {
366492
- if (typeof res.data === 'string') {
366493
- ret = _this3.options.parse(res.data, languages, namespaces);
366494
- } else {
366495
- ret = res.data;
366496
- }
366497
- } catch (e) {
366498
- parseErr = 'failed parsing ' + safeUrl + ' to json';
366499
- }
366500
- if (parseErr) return callback(parseErr, false);
366501
- callback(null, ret);
366502
- });
366503
- }
366504
- }, {
366505
- key: "create",
366506
- value: function create(languages, namespace, key, fallbackValue, callback) {
366507
- var _this4 = this;
366508
- if (!this.options.addPath) return;
366509
- if (typeof languages === 'string') languages = [languages];
366510
- var payload = this.options.parsePayload(namespace, key, fallbackValue);
366511
- var finished = 0;
366512
- var dataArray = [];
366513
- var resArray = [];
366514
- languages.forEach(function (lng) {
366515
- var addPath = _this4.options.addPath;
366516
- if (typeof _this4.options.addPath === 'function') {
366517
- addPath = _this4.options.addPath(lng, namespace);
366518
- }
366519
- var url = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.interpolateUrl)(addPath, {
366520
- lng: lng,
366521
- ns: namespace
366522
- });
366523
- if (url == null) {
366524
- finished += 1;
366525
- if (callback && finished === languages.length) callback(dataArray, resArray);
366526
- return;
366527
- }
366528
- _this4.options.request(_this4.options, url, payload, function (data, res) {
366529
- finished += 1;
366530
- dataArray.push(data);
366531
- resArray.push(res);
366532
- if (finished === languages.length) {
366533
- if (typeof callback === 'function') callback(dataArray, resArray);
366534
- }
366535
- });
366536
- });
366537
- }
366538
- }, {
366539
- key: "reload",
366540
- value: function reload() {
366541
- var _this5 = this;
366542
- var _this$services = this.services,
366543
- backendConnector = _this$services.backendConnector,
366544
- languageUtils = _this$services.languageUtils,
366545
- logger = _this$services.logger;
366546
- var currentLanguage = backendConnector.language;
366547
- if (currentLanguage && currentLanguage.toLowerCase() === 'cimode') return;
366548
- var toLoad = [];
366549
- var append = function append(lng) {
366550
- var lngs = languageUtils.toResolveHierarchy(lng);
366551
- lngs.forEach(function (l) {
366552
- if (toLoad.indexOf(l) < 0) toLoad.push(l);
366553
- });
366554
- };
366555
- append(currentLanguage);
366556
- if (this.allOptions.preload) this.allOptions.preload.forEach(function (l) {
366557
- return append(l);
366558
- });
366559
- toLoad.forEach(function (lng) {
366560
- _this5.allOptions.ns.forEach(function (ns) {
366561
- backendConnector.read(lng, ns, 'read', null, null, function (err, data) {
366562
- if (err) logger.warn("loading namespace ".concat(ns, " for language ").concat(lng, " failed"), err);
366563
- if (!err && data) logger.log("loaded namespace ".concat(ns, " for language ").concat(lng), data);
366564
- backendConnector.loaded("".concat(lng, "|").concat(ns), err, data);
366565
- });
366566
- });
366567
- });
366568
- }
366569
- }]);
366570
- }();
366571
- Backend.type = 'backend';
366572
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Backend);
366573
-
366574
- /***/ },
366575
-
366576
- /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/request.js"
366577
- /*!************************************************************************************************************************!*\
366578
- !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/request.js ***!
366579
- \************************************************************************************************************************/
366580
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
366581
-
366582
- "use strict";
366583
- __webpack_require__.r(__webpack_exports__);
366584
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
366585
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
366649
+ /* harmony export */ "default": () => (/* binding */ Backend)
366586
366650
  /* harmony export */ });
366587
- /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/utils.js");
366588
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
366589
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
366590
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
366591
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
366592
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
366593
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
366594
- ;
366595
- var fetchApi = typeof fetch === 'function' ? fetch : undefined;
366596
- if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.fetch) {
366597
- fetchApi = __webpack_require__.g.fetch;
366598
- } else if (typeof window !== 'undefined' && window.fetch) {
366599
- fetchApi = window.fetch;
366600
- }
366601
- var XmlHttpRequestApi;
366602
- if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.hasXMLHttpRequest)()) {
366603
- if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.XMLHttpRequest) {
366604
- XmlHttpRequestApi = __webpack_require__.g.XMLHttpRequest;
366605
- } else if (typeof window !== 'undefined' && window.XMLHttpRequest) {
366606
- XmlHttpRequestApi = window.XMLHttpRequest;
366607
- }
366608
- }
366609
- var ActiveXObjectApi;
366610
- if (typeof ActiveXObject === 'function') {
366611
- if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.ActiveXObject) {
366612
- ActiveXObjectApi = __webpack_require__.g.ActiveXObject;
366613
- } else if (typeof window !== 'undefined' && window.ActiveXObject) {
366614
- ActiveXObjectApi = window.ActiveXObject;
366615
- }
366616
- }
366617
- if (typeof fetchApi !== 'function') fetchApi = undefined;
366618
- if (!fetchApi && !XmlHttpRequestApi && !ActiveXObjectApi) {
366619
- try {
366620
- __webpack_require__.e(/*! import() */ "vendors-common_temp_node_modules_pnpm_cross-fetch_4_1_0_node_modules_cross-fetch_dist_browser-44272f").then(() => (__webpack_require__.t(/*! cross-fetch */ "../../common/temp/node_modules/.pnpm/cross-fetch@4.1.0/node_modules/cross-fetch/dist/browser-ponyfill.js", 19))).then(function (mod) {
366621
- fetchApi = mod.default;
366622
- }).catch(function () {});
366623
- } catch (e) {}
366624
- }
366625
- var UNSAFE_KEYS = ['__proto__', 'constructor', 'prototype'];
366626
- var addQueryString = function addQueryString(url, params) {
366627
- if (params && _typeof(params) === 'object') {
366628
- var queryString = '';
366629
- for (var _i = 0, _Object$keys = Object.keys(params); _i < _Object$keys.length; _i++) {
366630
- var paramName = _Object$keys[_i];
366631
- if (UNSAFE_KEYS.indexOf(paramName) > -1) continue;
366632
- queryString += '&' + encodeURIComponent(paramName) + '=' + encodeURIComponent(params[paramName]);
366633
- }
366634
- if (!queryString) return url;
366635
- url = url + (url.indexOf('?') !== -1 ? '&' : '?') + queryString.slice(1);
366636
- }
366637
- return url;
366638
- };
366639
- var fetchIt = function fetchIt(url, fetchOptions, callback, altFetch) {
366640
- var resolver = function resolver(response) {
366641
- if (!response.ok) return callback(response.statusText || 'Error', {
366642
- status: response.status
366643
- });
366644
- response.text().then(function (data) {
366645
- callback(null, {
366646
- status: response.status,
366647
- data: data
366648
- });
366649
- }).catch(callback);
366650
- };
366651
- if (altFetch) {
366652
- var altResponse = altFetch(url, fetchOptions);
366653
- if (altResponse instanceof Promise) {
366654
- altResponse.then(resolver).catch(callback);
366655
- return;
366656
- }
366657
- }
366658
- if (typeof fetch === 'function') {
366659
- fetch(url, fetchOptions).then(resolver).catch(callback);
366660
- } else {
366661
- fetchApi(url, fetchOptions).then(resolver).catch(callback);
366662
- }
366663
- };
366664
- var requestWithFetch = function requestWithFetch(options, url, payload, callback) {
366665
- if (options.queryStringParams) {
366666
- url = addQueryString(url, options.queryStringParams);
366667
- }
366668
- var headers = _objectSpread({}, typeof options.customHeaders === 'function' ? options.customHeaders() : options.customHeaders);
366669
- if (typeof window === 'undefined' && typeof __webpack_require__.g !== 'undefined' && typeof __webpack_require__.g.process !== 'undefined' && __webpack_require__.g.process.versions && __webpack_require__.g.process.versions.node) {
366670
- headers['User-Agent'] = "i18next-http-backend (node/".concat(__webpack_require__.g.process.version, "; ").concat(__webpack_require__.g.process.platform, " ").concat(__webpack_require__.g.process.arch, ")");
366671
- }
366672
- if (payload) headers['Content-Type'] = 'application/json';
366673
- var reqOptions = typeof options.requestOptions === 'function' ? options.requestOptions(payload) : options.requestOptions;
366674
- var fetchOptions = _objectSpread({
366675
- method: payload ? 'POST' : 'GET',
366676
- body: payload ? options.stringify(payload) : undefined,
366677
- headers: headers
366678
- }, options._omitFetchOptions ? {} : reqOptions);
366679
- var altFetch = typeof options.alternateFetch === 'function' && options.alternateFetch.length >= 1 ? options.alternateFetch : undefined;
366680
- try {
366681
- fetchIt(url, fetchOptions, callback, altFetch);
366682
- } catch (e) {
366683
- if (!reqOptions || Object.keys(reqOptions).length === 0 || !e.message || e.message.indexOf('not implemented') < 0) {
366684
- return callback(e);
366685
- }
366686
- try {
366687
- Object.keys(reqOptions).forEach(function (opt) {
366688
- delete fetchOptions[opt];
366689
- });
366690
- fetchIt(url, fetchOptions, callback, altFetch);
366691
- options._omitFetchOptions = true;
366692
- } catch (err) {
366693
- callback(err);
366694
- }
366695
- }
366696
- };
366697
- var requestWithXmlHttpRequest = function requestWithXmlHttpRequest(options, url, payload, callback) {
366698
- if (payload && _typeof(payload) === 'object') {
366699
- payload = addQueryString('', payload).slice(1);
366700
- }
366701
- if (options.queryStringParams) {
366702
- url = addQueryString(url, options.queryStringParams);
366703
- }
366704
- try {
366705
- var x = XmlHttpRequestApi ? new XmlHttpRequestApi() : new ActiveXObjectApi('MSXML2.XMLHTTP.3.0');
366706
- x.open(payload ? 'POST' : 'GET', url, 1);
366707
- if (!options.crossDomain) {
366708
- x.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
366709
- }
366710
- x.withCredentials = !!options.withCredentials;
366711
- if (payload) {
366712
- x.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
366713
- }
366714
- if (x.overrideMimeType) {
366715
- x.overrideMimeType('application/json');
366716
- }
366717
- var h = options.customHeaders;
366718
- h = typeof h === 'function' ? h() : h;
366719
- if (h) {
366720
- for (var _i2 = 0, _Object$keys2 = Object.keys(h); _i2 < _Object$keys2.length; _i2++) {
366721
- var i = _Object$keys2[_i2];
366722
- if (UNSAFE_KEYS.indexOf(i) > -1) continue;
366723
- x.setRequestHeader(i, h[i]);
366724
- }
366725
- }
366726
- x.onreadystatechange = function () {
366727
- x.readyState > 3 && callback(x.status >= 400 ? x.statusText : null, {
366728
- status: x.status,
366729
- data: x.responseText
366730
- });
366731
- };
366732
- x.send(payload);
366733
- } catch (e) {
366734
- console && console.log(e);
366735
- }
366736
- };
366737
- var request = function request(options, url, payload, callback) {
366738
- if (typeof payload === 'function') {
366739
- callback = payload;
366740
- payload = undefined;
366741
- }
366742
- callback = callback || function () {};
366743
- if (fetchApi && url.indexOf('file:') !== 0) {
366744
- return requestWithFetch(options, url, payload, callback);
366745
- }
366746
- if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.hasXMLHttpRequest)() || typeof ActiveXObject === 'function') {
366747
- return requestWithXmlHttpRequest(options, url, payload, callback);
366748
- }
366749
- callback(new Error('No fetch and no xhr implementation found!'));
366750
- };
366751
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (request);
366752
-
366753
- /***/ },
366754
-
366755
- /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/utils.js"
366756
- /*!**********************************************************************************************************************!*\
366757
- !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/utils.js ***!
366758
- \**********************************************************************************************************************/
366759
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
366760
-
366761
- "use strict";
366762
- __webpack_require__.r(__webpack_exports__);
366763
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
366764
- /* harmony export */ defaults: () => (/* binding */ defaults),
366765
- /* harmony export */ hasXMLHttpRequest: () => (/* binding */ hasXMLHttpRequest),
366766
- /* harmony export */ interpolate: () => (/* binding */ interpolate),
366767
- /* harmony export */ interpolateUrl: () => (/* binding */ interpolateUrl),
366768
- /* harmony export */ isSafeLangUrlSegment: () => (/* binding */ isSafeLangUrlSegment),
366769
- /* harmony export */ isSafeNsUrlSegment: () => (/* binding */ isSafeNsUrlSegment),
366770
- /* harmony export */ isSafeUrlSegment: () => (/* binding */ isSafeUrlSegment),
366771
- /* harmony export */ makePromise: () => (/* binding */ makePromise),
366772
- /* harmony export */ redactUrlCredentials: () => (/* binding */ redactUrlCredentials),
366773
- /* harmony export */ sanitizeLogValue: () => (/* binding */ sanitizeLogValue)
366774
- /* harmony export */ });
366775
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
366776
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
366777
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
366778
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
366779
- var arr = [];
366780
- var each = arr.forEach;
366781
- var slice = arr.slice;
366782
- var UNSAFE_KEYS = ['__proto__', 'constructor', 'prototype'];
366783
- function defaults(obj) {
366784
- each.call(slice.call(arguments, 1), function (source) {
366785
- if (source) {
366786
- for (var _i = 0, _Object$keys = Object.keys(source); _i < _Object$keys.length; _i++) {
366787
- var prop = _Object$keys[_i];
366788
- if (UNSAFE_KEYS.indexOf(prop) > -1) continue;
366789
- if (obj[prop] === undefined) obj[prop] = source[prop];
366790
- }
366791
- }
366792
- });
366793
- return obj;
366794
- }
366651
+ //#region lib/utils.js
366652
+ const arr = [];
366653
+ arr.forEach;
366654
+ arr.slice;
366655
+ const UNSAFE_KEYS$1 = [
366656
+ "__proto__",
366657
+ "constructor",
366658
+ "prototype"
366659
+ ];
366795
366660
  function isSafeUrlSegmentBase(v) {
366796
- if (typeof v !== 'string') return false;
366797
- if (v.length === 0 || v.length > 128) return false;
366798
- if (UNSAFE_KEYS.indexOf(v) > -1) return false;
366799
- if (v.indexOf('..') > -1) return false;
366800
- if (v.indexOf('\\') > -1) return false;
366801
- if (/[?#%\s@]/.test(v)) return false;
366802
- if (/[\x00-\x1F\x7F]/.test(v)) return false;
366803
- return true;
366661
+ if (typeof v !== "string") return false;
366662
+ if (v.length === 0 || v.length > 128) return false;
366663
+ if (UNSAFE_KEYS$1.indexOf(v) > -1) return false;
366664
+ if (v.indexOf("..") > -1) return false;
366665
+ if (v.indexOf("\\") > -1) return false;
366666
+ if (/[?#%:&=;\s]/.test(v)) return false;
366667
+ if (/[\x00-\x1F\x7F]/.test(v)) return false;
366668
+ return true;
366804
366669
  }
366805
366670
  function isSafeLangUrlSegment(v) {
366806
- if (!isSafeUrlSegmentBase(v)) return false;
366807
- if (v.indexOf('/') > -1) return false;
366808
- return true;
366671
+ if (!isSafeUrlSegmentBase(v)) return false;
366672
+ if (v.indexOf("/") > -1 || v.indexOf("@") > -1) return false;
366673
+ return true;
366809
366674
  }
366810
366675
  function isSafeNsUrlSegment(v) {
366811
- return isSafeUrlSegmentBase(v);
366676
+ if (!isSafeUrlSegmentBase(v)) return false;
366677
+ if (v.indexOf("//") > -1) return false;
366678
+ return true;
366812
366679
  }
366813
- var isSafeUrlSegment = isSafeLangUrlSegment;
366814
- var SAFETY_CHECK_BY_KEY = {
366815
- lng: isSafeLangUrlSegment,
366816
- ns: isSafeNsUrlSegment
366680
+ const SAFETY_CHECK_BY_KEY = {
366681
+ lng: isSafeLangUrlSegment,
366682
+ ns: isSafeNsUrlSegment
366817
366683
  };
366818
366684
  function sanitizeLogValue(v) {
366819
- if (typeof v !== 'string') return v;
366820
- return v.replace(/[\r\n\x00-\x1F\x7F]/g, ' ');
366685
+ if (typeof v !== "string") return v;
366686
+ return v.replace(/[\r\n\x00-\x1F\x7F]/g, " ");
366821
366687
  }
366822
366688
  function redactUrlCredentials(u) {
366823
- if (typeof u !== 'string' || u.length === 0) return u;
366824
- try {
366825
- var parsed = new URL(u);
366826
- if (parsed.username || parsed.password) {
366827
- parsed.username = '';
366828
- parsed.password = '';
366829
- return parsed.toString();
366830
- }
366831
- return u;
366832
- } catch (e) {
366833
- return u.replace(/(\/\/)[^/@\s]+@/g, '$1');
366834
- }
366689
+ if (typeof u !== "string" || u.length === 0) return u;
366690
+ try {
366691
+ const parsed = new URL(u);
366692
+ if (parsed.username || parsed.password) {
366693
+ parsed.username = "";
366694
+ parsed.password = "";
366695
+ return parsed.toString();
366696
+ }
366697
+ return u;
366698
+ } catch (e) {
366699
+ return u.replace(/(\/\/)[^/@\s]+@/g, "$1");
366700
+ }
366835
366701
  }
366836
366702
  function hasXMLHttpRequest() {
366837
- return typeof XMLHttpRequest === 'function' || (typeof XMLHttpRequest === "undefined" ? "undefined" : _typeof(XMLHttpRequest)) === 'object';
366703
+ return typeof XMLHttpRequest === "function" || typeof XMLHttpRequest === "object";
366838
366704
  }
366705
+ /**
366706
+ * Determine whether the given `maybePromise` is a Promise.
366707
+ *
366708
+ * @param {*} maybePromise
366709
+ *
366710
+ * @returns {Boolean}
366711
+ */
366839
366712
  function isPromise(maybePromise) {
366840
- return !!maybePromise && typeof maybePromise.then === 'function';
366713
+ return !!maybePromise && typeof maybePromise.then === "function";
366841
366714
  }
366715
+ /**
366716
+ * Convert any value to a Promise than will resolve to this value.
366717
+ *
366718
+ * @param {*} maybePromise
366719
+ *
366720
+ * @returns {Promise}
366721
+ */
366842
366722
  function makePromise(maybePromise) {
366843
- if (isPromise(maybePromise)) {
366844
- return maybePromise;
366845
- }
366846
- return Promise.resolve(maybePromise);
366847
- }
366848
- var interpolationRegexp = /\{\{(.+?)\}\}/g;
366849
- function interpolate(str, data) {
366850
- return str.replace(interpolationRegexp, function (match, key) {
366851
- var k = key.trim();
366852
- if (UNSAFE_KEYS.indexOf(k) > -1) return match;
366853
- var value = data[k];
366854
- return value != null ? value : match;
366855
- });
366723
+ if (isPromise(maybePromise)) return maybePromise;
366724
+ return Promise.resolve(maybePromise);
366856
366725
  }
366726
+ const interpolationRegexp = /\{\{(.+?)\}\}/g;
366727
+ const LEADING_DOUBLE_SLASH = /^[/\\]{2}/;
366857
366728
  function interpolateUrl(str, data) {
366858
- var unsafe = false;
366859
- var result = str.replace(interpolationRegexp, function (match, key) {
366860
- var k = key.trim();
366861
- if (UNSAFE_KEYS.indexOf(k) > -1) return match;
366862
- var value = data[k];
366863
- if (value == null) return match;
366864
- var check = SAFETY_CHECK_BY_KEY[k] || isSafeLangUrlSegment;
366865
- var segments = String(value).split('+');
366866
- var _iterator = _createForOfIteratorHelper(segments),
366867
- _step;
366868
- try {
366869
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
366870
- var seg = _step.value;
366871
- if (!check(seg)) {
366872
- unsafe = true;
366873
- return match;
366874
- }
366875
- }
366876
- } catch (err) {
366877
- _iterator.e(err);
366878
- } finally {
366879
- _iterator.f();
366880
- }
366881
- return segments.join('+');
366882
- });
366883
- return unsafe ? null : result;
366884
- }
366729
+ let unsafe = false;
366730
+ const result = str.replace(interpolationRegexp, (match, key) => {
366731
+ const k = key.trim();
366732
+ if (UNSAFE_KEYS$1.indexOf(k) > -1) return match;
366733
+ const value = data[k];
366734
+ if (value == null) return match;
366735
+ const check = SAFETY_CHECK_BY_KEY[k] || isSafeLangUrlSegment;
366736
+ const segments = String(value).split("+");
366737
+ for (const seg of segments) if (!check(seg)) {
366738
+ unsafe = true;
366739
+ return match;
366740
+ }
366741
+ return segments.join("+");
366742
+ });
366743
+ if (unsafe) return null;
366744
+ if (LEADING_DOUBLE_SLASH.test(result) && !LEADING_DOUBLE_SLASH.test(str)) return null;
366745
+ return result;
366746
+ }
366747
+ //#endregion
366748
+ //#region lib/request.js
366749
+ const g = typeof globalThis !== "undefined" ? globalThis : typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof window !== "undefined" ? window : void 0;
366750
+ let fetchApi;
366751
+ if (typeof fetch === "function") fetchApi = fetch;
366752
+ else if (g && typeof g.fetch === "function") fetchApi = g.fetch;
366753
+ const XmlHttpRequestApi = hasXMLHttpRequest() && g ? g.XMLHttpRequest : void 0;
366754
+ const ActiveXObjectApi = typeof ActiveXObject === "function" && g ? g.ActiveXObject : void 0;
366755
+ const UNSAFE_KEYS = [
366756
+ "__proto__",
366757
+ "constructor",
366758
+ "prototype"
366759
+ ];
366760
+ const addQueryString = (url, params) => {
366761
+ if (params && typeof params === "object") {
366762
+ let queryString = "";
366763
+ for (const paramName of Object.keys(params)) {
366764
+ if (UNSAFE_KEYS.indexOf(paramName) > -1) continue;
366765
+ queryString += "&" + encodeURIComponent(paramName) + "=" + encodeURIComponent(params[paramName]);
366766
+ }
366767
+ if (!queryString) return url;
366768
+ url = url + (url.indexOf("?") !== -1 ? "&" : "?") + queryString.slice(1);
366769
+ }
366770
+ return url;
366771
+ };
366772
+ const fetchIt = (url, fetchOptions, callback, altFetch) => {
366773
+ const resolver = (response) => {
366774
+ if (!response.ok) return callback(response.statusText || "Error", { status: response.status });
366775
+ response.text().then((data) => {
366776
+ callback(null, {
366777
+ status: response.status,
366778
+ data
366779
+ });
366780
+ }).catch(callback);
366781
+ };
366782
+ if (altFetch) {
366783
+ const altResponse = altFetch(url, fetchOptions);
366784
+ if (altResponse instanceof Promise) {
366785
+ altResponse.then(resolver).catch(callback);
366786
+ return;
366787
+ }
366788
+ }
366789
+ if (typeof fetch === "function") fetch(url, fetchOptions).then(resolver).catch(callback);
366790
+ else fetchApi(url, fetchOptions).then(resolver).catch(callback);
366791
+ };
366792
+ const requestWithFetch = (options, url, payload, callback) => {
366793
+ if (options.queryStringParams) url = addQueryString(url, options.queryStringParams);
366794
+ const headers = { ...typeof options.customHeaders === "function" ? options.customHeaders() : options.customHeaders };
366795
+ if (typeof window === "undefined" && typeof __webpack_require__.g !== "undefined" && typeof __webpack_require__.g.process !== "undefined" && __webpack_require__.g.process.versions && __webpack_require__.g.process.versions.node) headers["User-Agent"] = `i18next-http-backend (node/${__webpack_require__.g.process.version}; ${__webpack_require__.g.process.platform} ${__webpack_require__.g.process.arch})`;
366796
+ if (payload) headers["Content-Type"] = "application/json";
366797
+ const reqOptions = typeof options.requestOptions === "function" ? options.requestOptions(payload) : options.requestOptions;
366798
+ const fetchOptions = {
366799
+ method: payload ? "POST" : "GET",
366800
+ body: payload ? options.stringify(payload) : void 0,
366801
+ headers,
366802
+ ...options._omitFetchOptions ? {} : reqOptions
366803
+ };
366804
+ const altFetch = typeof options.alternateFetch === "function" && options.alternateFetch.length >= 1 ? options.alternateFetch : void 0;
366805
+ try {
366806
+ fetchIt(url, fetchOptions, callback, altFetch);
366807
+ } catch (e) {
366808
+ if (!reqOptions || Object.keys(reqOptions).length === 0 || !e.message || e.message.indexOf("not implemented") < 0) return callback(e);
366809
+ try {
366810
+ Object.keys(reqOptions).forEach((opt) => {
366811
+ delete fetchOptions[opt];
366812
+ });
366813
+ fetchIt(url, fetchOptions, callback, altFetch);
366814
+ options._omitFetchOptions = true;
366815
+ } catch (err) {
366816
+ callback(err);
366817
+ }
366818
+ }
366819
+ };
366820
+ const requestWithXmlHttpRequest = (options, url, payload, callback) => {
366821
+ if (payload && typeof payload === "object") payload = addQueryString("", payload).slice(1);
366822
+ if (options.queryStringParams) url = addQueryString(url, options.queryStringParams);
366823
+ try {
366824
+ const x = XmlHttpRequestApi ? new XmlHttpRequestApi() : new ActiveXObjectApi("MSXML2.XMLHTTP.3.0");
366825
+ x.open(payload ? "POST" : "GET", url, 1);
366826
+ if (!options.crossDomain) x.setRequestHeader("X-Requested-With", "XMLHttpRequest");
366827
+ x.withCredentials = !!options.withCredentials;
366828
+ if (payload) x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
366829
+ if (x.overrideMimeType) x.overrideMimeType("application/json");
366830
+ let h = options.customHeaders;
366831
+ h = typeof h === "function" ? h() : h;
366832
+ if (h) for (const i of Object.keys(h)) {
366833
+ if (UNSAFE_KEYS.indexOf(i) > -1) continue;
366834
+ x.setRequestHeader(i, h[i]);
366835
+ }
366836
+ x.onreadystatechange = () => {
366837
+ x.readyState > 3 && callback(x.status >= 400 ? x.statusText : null, {
366838
+ status: x.status,
366839
+ data: x.responseText
366840
+ });
366841
+ };
366842
+ x.send(payload);
366843
+ } catch (e) {
366844
+ console && console.log(e);
366845
+ }
366846
+ };
366847
+ const request = (options, url, payload, callback) => {
366848
+ if (typeof payload === "function") {
366849
+ callback = payload;
366850
+ payload = void 0;
366851
+ }
366852
+ callback = callback || (() => {});
366853
+ if (fetchApi && url.indexOf("file:") !== 0) return requestWithFetch(options, url, payload, callback);
366854
+ if (hasXMLHttpRequest() || typeof ActiveXObject === "function") return requestWithXmlHttpRequest(options, url, payload, callback);
366855
+ callback(/* @__PURE__ */ new Error("No fetch and no xhr implementation found!"));
366856
+ };
366857
+ //#endregion
366858
+ //#region lib/index.js
366859
+ const getDefaults = () => {
366860
+ return {
366861
+ loadPath: "/locales/{{lng}}/{{ns}}.json",
366862
+ addPath: "/locales/add/{{lng}}/{{ns}}",
366863
+ parse: (data) => JSON.parse(data),
366864
+ stringify: JSON.stringify,
366865
+ parsePayload: (namespace, key, fallbackValue) => ({ [key]: fallbackValue || "" }),
366866
+ parseLoadPayload: (languages, namespaces) => void 0,
366867
+ request,
366868
+ reloadInterval: typeof window !== "undefined" ? false : 3600 * 1e3,
366869
+ customHeaders: {},
366870
+ queryStringParams: {},
366871
+ crossDomain: false,
366872
+ withCredentials: false,
366873
+ overrideMimeType: false,
366874
+ requestOptions: {
366875
+ mode: "cors",
366876
+ credentials: "same-origin",
366877
+ cache: "default"
366878
+ }
366879
+ };
366880
+ };
366881
+ var Backend = class {
366882
+ constructor(services, options = {}, allOptions = {}) {
366883
+ this.services = services;
366884
+ this.options = options;
366885
+ this.allOptions = allOptions;
366886
+ this.type = "backend";
366887
+ this.init(services, options, allOptions);
366888
+ }
366889
+ init(services, options = {}, allOptions = {}) {
366890
+ this.services = services;
366891
+ this.options = {
366892
+ ...getDefaults(),
366893
+ ...this.options || {},
366894
+ ...options
366895
+ };
366896
+ this.allOptions = allOptions;
366897
+ if (this.services && this.options.reloadInterval) {
366898
+ const timer = setInterval(() => this.reload(), this.options.reloadInterval);
366899
+ if (typeof timer === "object" && typeof timer.unref === "function") timer.unref();
366900
+ }
366901
+ }
366902
+ readMulti(languages, namespaces, callback) {
366903
+ this._readAny(languages, languages, namespaces, namespaces, callback);
366904
+ }
366905
+ read(language, namespace, callback) {
366906
+ this._readAny([language], language, [namespace], namespace, callback);
366907
+ }
366908
+ _readAny(languages, loadUrlLanguages, namespaces, loadUrlNamespaces, callback) {
366909
+ let loadPath = this.options.loadPath;
366910
+ if (typeof this.options.loadPath === "function") loadPath = this.options.loadPath(languages, namespaces);
366911
+ loadPath = makePromise(loadPath);
366912
+ loadPath.then((resolvedLoadPath) => {
366913
+ if (!resolvedLoadPath) return callback(null, {});
366914
+ const url = interpolateUrl(resolvedLoadPath, {
366915
+ lng: languages.join("+"),
366916
+ ns: namespaces.join("+")
366917
+ });
366918
+ if (url == null) {
366919
+ const safeLngs = languages.map(sanitizeLogValue).join(", ");
366920
+ const safeNss = namespaces.map(sanitizeLogValue).join(", ");
366921
+ return callback(/* @__PURE__ */ new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=[" + safeLngs + "] namespaces=[" + safeNss + "]"), false);
366922
+ }
366923
+ this.loadUrl(url, callback, loadUrlLanguages, loadUrlNamespaces);
366924
+ }, (err) => callback(err, false));
366925
+ }
366926
+ loadUrl(url, callback, languages, namespaces) {
366927
+ const lng = typeof languages === "string" ? [languages] : languages;
366928
+ const ns = typeof namespaces === "string" ? [namespaces] : namespaces;
366929
+ const payload = this.options.parseLoadPayload(lng, ns);
366930
+ const safeUrl = sanitizeLogValue(redactUrlCredentials(url));
366931
+ this.options.request(this.options, url, payload, (err, res) => {
366932
+ if (res && (res.status >= 500 && res.status < 600 || !res.status)) return callback("failed loading " + safeUrl + "; status code: " + res.status, true);
366933
+ if (res && res.status >= 400 && res.status < 500) return callback("failed loading " + safeUrl + "; status code: " + res.status, false);
366934
+ if (!res && err && err.message) {
366935
+ const errorMessage = err.message.toLowerCase();
366936
+ if ([
366937
+ "failed",
366938
+ "fetch",
366939
+ "network",
366940
+ "load"
366941
+ ].find((term) => errorMessage.indexOf(term) > -1)) return callback("failed loading " + safeUrl + ": " + sanitizeLogValue(err.message), true);
366942
+ }
366943
+ if (err) return callback(err, false);
366944
+ let ret, parseErr;
366945
+ try {
366946
+ if (typeof res.data === "string") ret = this.options.parse(res.data, languages, namespaces);
366947
+ else ret = res.data;
366948
+ } catch (e) {
366949
+ parseErr = "failed parsing " + safeUrl + " to json";
366950
+ }
366951
+ if (parseErr) return callback(parseErr, false);
366952
+ callback(null, ret);
366953
+ });
366954
+ }
366955
+ create(languages, namespace, key, fallbackValue, callback) {
366956
+ if (!this.options.addPath) return;
366957
+ if (typeof languages === "string") languages = [languages];
366958
+ const payload = this.options.parsePayload(namespace, key, fallbackValue);
366959
+ let finished = 0;
366960
+ const dataArray = [];
366961
+ const resArray = [];
366962
+ languages.forEach((lng) => {
366963
+ let addPath = this.options.addPath;
366964
+ if (typeof this.options.addPath === "function") addPath = this.options.addPath(lng, namespace);
366965
+ const url = interpolateUrl(addPath, {
366966
+ lng,
366967
+ ns: namespace
366968
+ });
366969
+ if (url == null) {
366970
+ finished += 1;
366971
+ if (callback && finished === languages.length) callback(dataArray, resArray);
366972
+ return;
366973
+ }
366974
+ this.options.request(this.options, url, payload, (data, res) => {
366975
+ finished += 1;
366976
+ dataArray.push(data);
366977
+ resArray.push(res);
366978
+ if (finished === languages.length) {
366979
+ if (typeof callback === "function") callback(dataArray, resArray);
366980
+ }
366981
+ });
366982
+ });
366983
+ }
366984
+ reload() {
366985
+ const { backendConnector, languageUtils, logger } = this.services;
366986
+ const currentLanguage = backendConnector.language;
366987
+ if (currentLanguage && currentLanguage.toLowerCase() === "cimode") return;
366988
+ const toLoad = [];
366989
+ const append = (lng) => {
366990
+ languageUtils.toResolveHierarchy(lng).forEach((l) => {
366991
+ if (toLoad.indexOf(l) < 0) toLoad.push(l);
366992
+ });
366993
+ };
366994
+ append(currentLanguage);
366995
+ if (this.allOptions.preload) this.allOptions.preload.forEach((l) => append(l));
366996
+ toLoad.forEach((lng) => {
366997
+ this.allOptions.ns.forEach((ns) => {
366998
+ backendConnector.read(lng, ns, "read", null, null, (err, data) => {
366999
+ if (err) logger.warn(`loading namespace ${ns} for language ${lng} failed`, err);
367000
+ if (!err && data) logger.log(`loaded namespace ${ns} for language ${lng}`, data);
367001
+ backendConnector.loaded(`${lng}|${ns}`, err, data);
367002
+ });
367003
+ });
367004
+ });
367005
+ }
367006
+ };
367007
+ Backend.type = "backend";
367008
+ //#endregion
367009
+
367010
+
366885
367011
 
366886
367012
  /***/ },
366887
367013
 
@@ -370950,7 +371076,7 @@ class WMS {
370950
371076
  (module) {
370951
371077
 
370952
371078
  "use strict";
370953
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.15.0-dev.9","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s build:workers && npm run -s copy:draco","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2022 --outDir lib/esm","clean":"rimraf -g lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:draco":"cpx \\"./node_modules/@loaders.gl/draco/dist/libs/*\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts && npm run -s extract","extract":"betools extract --fileExt=ts --extractFrom=./src/test/example-code --recursive --out=../../generated-docs/extract","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-deprecation":"eslint --fix -f visualstudio --no-inline-config -c ../../common/config/eslint/eslint.config.deprecation-policy.js \\"./src/**/*.ts\\"","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run build:test-worker && vitest --run","cover":"npm run build:test-worker && vitest --run","build:test-worker":"vite build --config ./src/test/worker/vite.config.mts 1>&2","build:workers":"rimraf lib/workers/webpack && vite build --config ./src/workers/ImdlParser/vite.config.mts 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@bentley/aec-units-schema":"^1.0.3","@bentley/formats-schema":"^1.0.0","@bentley/units-schema":"^1.0.12","@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/object-storage-core":"^3.0.4","@itwin/eslint-plugin":"^6.0.0","@types/node":"~20.17.0","@types/sinon":"^17.0.2","@vitest/browser-playwright":"^4.1.10","@vitest/coverage-v8":"^4.1.10","cpx2":"^8.0.0","eslint":"^9.31.0","playwright":"~1.56.1","rimraf":"^6.0.1","sinon":"^17.0.2","typescript":"~5.6.2","vite":"^6.4.3","vitest":"^4.1.10"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^4.4.5","@loaders.gl/draco":"^4.4.5","fuse.js":"^3.3.0","wms-capabilities":"0.6.0"}}');
371079
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.16.0-dev.3","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s build:workers && npm run -s copy:draco","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2022 --outDir lib/esm","clean":"rimraf -g lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:draco":"cpx \\"./node_modules/@loaders.gl/draco/dist/libs/*\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts && npm run -s extract","extract":"betools extract --fileExt=ts --extractFrom=./src/test/example-code --recursive --out=../../generated-docs/extract","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-deprecation":"eslint --fix -f visualstudio --no-inline-config -c ../../common/config/eslint/eslint.config.deprecation-policy.js \\"./src/**/*.ts\\"","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run build:test-worker && vitest --run","cover":"npm run build:test-worker && vitest --run","build:test-worker":"vite build --config ./src/test/worker/vite.config.mts 1>&2","build:workers":"rimraf lib/workers/webpack && vite build --config ./src/workers/ImdlParser/vite.config.mts 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@bentley/aec-units-schema":"^1.0.3","@bentley/formats-schema":"^1.0.0","@bentley/units-schema":"^1.0.12","@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/object-storage-core":"^3.0.4","@itwin/eslint-plugin":"^6.0.0","@types/node":"~20.17.0","@types/sinon":"^17.0.2","@vitest/browser-playwright":"^4.1.10","@vitest/coverage-v8":"^4.1.10","cpx2":"^8.0.0","eslint":"^9.31.0","playwright":"~1.56.1","rimraf":"^6.0.1","sinon":"^17.0.2","typescript":"~5.6.2","vite":"^6.4.4","vitest":"^4.1.10"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^4.4.5","@loaders.gl/draco":"^4.4.5","fuse.js":"^3.3.0","wms-capabilities":"0.6.0"}}');
370954
371080
 
370955
371081
  /***/ },
370956
371082
 
@@ -371022,36 +371148,6 @@ module.exports = /*#__PURE__*/JSON.parse('{"$schema":"../../../node_modules/@itw
371022
371148
  /******/ return getter;
371023
371149
  /******/ };
371024
371150
  /******/
371025
- /******/ /* webpack/runtime/create fake namespace object */
371026
- /******/ (() => {
371027
- /******/ const getProto = Object.getPrototypeOf;
371028
- /******/ let leafPrototypes;
371029
- /******/ // create a fake namespace object
371030
- /******/ // mode & 1: value is a module id, require it
371031
- /******/ // mode & 2: merge all properties of value into the ns
371032
- /******/ // mode & 4: return value when already ns object
371033
- /******/ // mode & 16: return value when it's Promise-like
371034
- /******/ // mode & 8|1: behave like require
371035
- /******/ __webpack_require__.t = function(value, mode) {
371036
- /******/ if(mode & 1) value = this(value);
371037
- /******/ if(mode & 8) return value;
371038
- /******/ if(typeof value === 'object' && value) {
371039
- /******/ if((mode & 4) && value.__esModule) return value;
371040
- /******/ if((mode & 16) && typeof value.then === 'function') return value;
371041
- /******/ }
371042
- /******/ const ns = Object.create(null);
371043
- /******/ __webpack_require__.r(ns);
371044
- /******/ const def = {};
371045
- /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
371046
- /******/ for(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {
371047
- /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
371048
- /******/ }
371049
- /******/ def['default'] = () => (value);
371050
- /******/ __webpack_require__.d(ns, def);
371051
- /******/ return ns;
371052
- /******/ };
371053
- /******/ })();
371054
- /******/
371055
371151
  /******/ /* webpack/runtime/define property getters */
371056
371152
  /******/ // define getter/value functions for harmony exports
371057
371153
  /******/ __webpack_require__.d = (exports, definition) => {