@itwin/ecschema-rpcinterface-tests 5.15.0-dev.7 → 5.16.0-dev.2

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.
@@ -18311,6 +18311,7 @@ function assert(condition, message) {
18311
18311
  "use strict";
18312
18312
  __webpack_require__.r(__webpack_exports__);
18313
18313
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18314
+ /* harmony export */ BeAsyncEvent: () => (/* binding */ BeAsyncEvent),
18314
18315
  /* harmony export */ BeEvent: () => (/* binding */ BeEvent),
18315
18316
  /* harmony export */ BeEventList: () => (/* binding */ BeEventList),
18316
18317
  /* harmony export */ BeUiEvent: () => (/* binding */ BeUiEvent),
@@ -18398,8 +18399,13 @@ class BeEvent {
18398
18399
  dropped = true;
18399
18400
  }
18400
18401
  else {
18402
+ const listener = context.listener;
18403
+ if (context.once) {
18404
+ context.listener = undefined;
18405
+ dropped = true;
18406
+ }
18401
18407
  try {
18402
- context.listener.apply(context.scope, args);
18408
+ listener.apply(context.scope, args);
18403
18409
  }
18404
18410
  catch (e) {
18405
18411
  _UnexpectedErrors__WEBPACK_IMPORTED_MODULE_0__.UnexpectedErrors.handle(e);
@@ -18408,10 +18414,6 @@ class BeEvent {
18408
18414
  // listener was removed during its own callback
18409
18415
  dropped = true;
18410
18416
  }
18411
- else if (context.once) {
18412
- context.listener = undefined;
18413
- dropped = true;
18414
- }
18415
18417
  }
18416
18418
  }
18417
18419
  this._emitDepth--;
@@ -18455,8 +18457,6 @@ class BeUiEvent extends BeEvent {
18455
18457
  */
18456
18458
  class BeUnorderedEvent {
18457
18459
  _listeners = new Set();
18458
- _emitDepth = 0;
18459
- _hasTombstones = false;
18460
18460
  /** The number of listeners currently subscribed to the event.
18461
18461
  * @note During `raiseEvent()`, this may include listeners that have been removed or are one-shot
18462
18462
  * but are awaiting deferred cleanup. The count is accurate outside of `raiseEvent()`.
@@ -18486,43 +18486,26 @@ class BeUnorderedEvent {
18486
18486
  }
18487
18487
  /** Remove a specific context entry, deferring during emit. */
18488
18488
  _removeCtx(ctx) {
18489
- if (this._emitDepth > 0) {
18490
- ctx.listener = undefined; // tombstone for deferred cleanup
18491
- this._hasTombstones = true;
18492
- }
18493
- else {
18494
- this._listeners.delete(ctx);
18495
- }
18489
+ this._listeners.delete(ctx);
18496
18490
  }
18497
18491
  /**
18498
18492
  * Raises the event by calling each registered listener with the supplied arguments.
18499
18493
  * @param args This method takes any number of parameters and passes them through to the listeners.
18500
18494
  */
18501
18495
  raiseEvent(...args) {
18502
- this._emitDepth++;
18503
18496
  for (const ctx of this._listeners) {
18504
18497
  if (!ctx.listener) {
18505
18498
  continue;
18506
18499
  }
18500
+ if (ctx.once) {
18501
+ this._listeners.delete(ctx);
18502
+ }
18507
18503
  try {
18508
18504
  ctx.listener.apply(ctx.scope, args);
18509
18505
  }
18510
18506
  catch (e) {
18511
18507
  _UnexpectedErrors__WEBPACK_IMPORTED_MODULE_0__.UnexpectedErrors.handle(e);
18512
18508
  }
18513
- if (ctx.listener && ctx.once) {
18514
- ctx.listener = undefined;
18515
- this._hasTombstones = true;
18516
- }
18517
- }
18518
- this._emitDepth--;
18519
- // Only clean up tombstoned entries when we're back at the outermost emit
18520
- if (this._hasTombstones && this._emitDepth === 0) {
18521
- this._hasTombstones = false;
18522
- for (const ctx of this._listeners) {
18523
- if (ctx.listener === undefined)
18524
- this._listeners.delete(ctx);
18525
- }
18526
18509
  }
18527
18510
  }
18528
18511
  /** Clear all listeners from this BeUnorderedEvent.
@@ -18538,6 +18521,108 @@ class BeUnorderedUiEvent extends BeUnorderedEvent {
18538
18521
  /** Raises event with single strongly typed argument. */
18539
18522
  emit(args) { this.raiseEvent(args); }
18540
18523
  }
18524
+ /**
18525
+ * Manages a set of *listeners* for a particular event and notifies them when the event is raised.
18526
+ * Each listener is async (return a Promise<void>). The listeners may be invoked in series
18527
+ * or concurrently depending on the configuration of the instance.
18528
+ *
18529
+ * Like [[BeUnorderedEvent]], this class uses a `Set` internally to support more performant removal
18530
+ * of old listeners. When a listener is removed during emit, it is marked for deferred removal instead
18531
+ * of mutating the set immediately. Despite the "unordered" implication, items in a `Set` are enumerated
18532
+ * in insertion order, which means that this class invokes the listeners in insertion order.
18533
+ *
18534
+ * Listeners are managed exclusively through the disposal closure returned by [[addListener]] and
18535
+ * [[addOnce]]. There is no `removeListener` or `has` method — callers must capture the returned
18536
+ * closure to unsubscribe.
18537
+ * @beta
18538
+ */
18539
+ class BeAsyncEvent {
18540
+ _listeners = new Set();
18541
+ _concurrent = false;
18542
+ _promiseRejectionIsUnexpected = false;
18543
+ constructor(options) {
18544
+ if (options?.concurrent)
18545
+ this._concurrent = true;
18546
+ if (options?.promiseRejectionIsUnexpected)
18547
+ this._promiseRejectionIsUnexpected = true;
18548
+ }
18549
+ /** The number of listeners currently subscribed to the event.
18550
+ * @note During `raiseEvent()`, this may include listeners that have been removed or are one-shot
18551
+ * but are awaiting deferred cleanup. The count is accurate outside of `raiseEvent()`.
18552
+ */
18553
+ get numberOfListeners() { return this._listeners.size; }
18554
+ /**
18555
+ * Registers a Listener to be executed whenever this event is raised.
18556
+ * @param listener The function to be executed when the event is raised.
18557
+ * @param scope An optional object scope to serve as the 'this' pointer when listener is invoked.
18558
+ * @returns A function that will remove this event listener in O(1).
18559
+ */
18560
+ addListener(listener, scope) {
18561
+ const ctx = { listener, scope, once: false };
18562
+ this._listeners.add(ctx);
18563
+ return () => this._removeCtx(ctx);
18564
+ }
18565
+ /**
18566
+ * Registers a callback function to be executed *only once* when the event is raised.
18567
+ * @param listener The function to be executed once when the event is raised.
18568
+ * @param scope An optional object scope to serve as the `this` pointer in which the listener function will execute.
18569
+ * @returns A function that will remove this event listener in O(1).
18570
+ */
18571
+ addOnce(listener, scope) {
18572
+ const ctx = { listener, scope, once: true };
18573
+ this._listeners.add(ctx);
18574
+ return () => this._removeCtx(ctx);
18575
+ }
18576
+ /** Remove a specific context entry, deferring during emit. */
18577
+ _removeCtx(ctx) {
18578
+ this._listeners.delete(ctx);
18579
+ }
18580
+ /**
18581
+ * Raises the event by calling each registered listener with the supplied arguments.
18582
+ *
18583
+ * See [[BeAsyncEventOptions]] for options that control the behavior of this method.
18584
+ *
18585
+ * @param args This method takes any number of parameters and passes them through to the listeners.
18586
+ * @returns A Promise that settles when the event invocation is complete.
18587
+ */
18588
+ async raiseEvent(...args) {
18589
+ const promises = [];
18590
+ // Wrapper to ensure that an exception thrown immediately by a listener is captured as a rejected promise rather than
18591
+ // allowed to propagate as an exception. A well-behaved Promise-returning function should never throw, but
18592
+ // this defends against the poorly-behaved ones. In Node 23+ we could use `Promise.try` instead.
18593
+ const invoke = async (ctx, args) => {
18594
+ if (!ctx.listener)
18595
+ return;
18596
+ await ctx.listener.apply(ctx.scope, args);
18597
+ };
18598
+ for (const ctx of this._listeners) {
18599
+ if (!ctx.listener)
18600
+ continue;
18601
+ if (ctx.once) {
18602
+ // Set guarantees this is safe during iteration.
18603
+ this._listeners.delete(ctx);
18604
+ }
18605
+ let promise = invoke(ctx, args);
18606
+ if (this._promiseRejectionIsUnexpected)
18607
+ promise = promise.catch(reason => _UnexpectedErrors__WEBPACK_IMPORTED_MODULE_0__.UnexpectedErrors.handle(reason));
18608
+ if (this._concurrent)
18609
+ promises.push(promise);
18610
+ else
18611
+ await promise;
18612
+ }
18613
+ if (this._concurrent) {
18614
+ const result = await Promise.allSettled(promises);
18615
+ const firstRejection = result.find(r => r.status === "rejected");
18616
+ if (firstRejection)
18617
+ throw firstRejection.reason;
18618
+ }
18619
+ }
18620
+ /** Clear all listeners from this BeAsyncEvent.
18621
+ * @note If called during `raiseEvent`, remaining listeners in the current iteration are skipped
18622
+ * immediately rather than being tombstoned.
18623
+ */
18624
+ clear() { this._listeners.clear(); }
18625
+ }
18541
18626
  /**
18542
18627
  * A list of BeEvent objects, accessible by an event name.
18543
18628
  * This class may be used instead of explicitly declaring each BeEvent as a member of a containing class.
@@ -21094,16 +21179,18 @@ var Id64;
21094
21179
  Id64.getFirst = getFirst;
21095
21180
  /** Return the number of [[Id64String]]s represented by an [[Id64Arg]]. */
21096
21181
  function sizeOf(arg) {
21097
- return typeof arg === "string" ? 1 : (Array.isArray(arg) ? arg.length : arg.size);
21182
+ return typeof arg === "string" ? 1 : "size" in arg ? arg.size : arg.length;
21098
21183
  }
21099
21184
  Id64.sizeOf = sizeOf;
21100
21185
  /** Returns true if the [[Id64Arg]] contains the specified Id. */
21101
21186
  function has(arg, id) {
21102
- if (typeof arg === "string")
21187
+ if (typeof arg === "string") {
21103
21188
  return arg === id;
21104
- if (Array.isArray(arg))
21105
- return -1 !== arg.indexOf(id);
21106
- return arg.has(id);
21189
+ }
21190
+ if ("has" in arg) {
21191
+ return arg.has(id);
21192
+ }
21193
+ return -1 !== arg.indexOf(id);
21107
21194
  }
21108
21195
  Id64.has = has;
21109
21196
  /** The string representation of an invalid Id. */
@@ -25173,6 +25260,7 @@ class YieldManager {
25173
25260
  __webpack_require__.r(__webpack_exports__);
25174
25261
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
25175
25262
  /* harmony export */ AbandonedError: () => (/* reexport safe */ _OneAtATimeAction__WEBPACK_IMPORTED_MODULE_22__.AbandonedError),
25263
+ /* harmony export */ BeAsyncEvent: () => (/* reexport safe */ _BeEvent__WEBPACK_IMPORTED_MODULE_2__.BeAsyncEvent),
25176
25264
  /* harmony export */ BeDuration: () => (/* reexport safe */ _Time__WEBPACK_IMPORTED_MODULE_30__.BeDuration),
25177
25265
  /* harmony export */ BeEvent: () => (/* reexport safe */ _BeEvent__WEBPACK_IMPORTED_MODULE_2__.BeEvent),
25178
25266
  /* harmony export */ BeEventList: () => (/* reexport safe */ _BeEvent__WEBPACK_IMPORTED_MODULE_2__.BeEventList),
@@ -30736,7 +30824,8 @@ __webpack_require__.r(__webpack_exports__);
30736
30824
  /* harmony export */ ECSqlReader: () => (/* binding */ ECSqlReader)
30737
30825
  /* harmony export */ });
30738
30826
  /* harmony import */ var _ConcurrentQuery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ConcurrentQuery */ "../../core/common/lib/esm/ConcurrentQuery.js");
30739
- /* harmony import */ var _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ECSqlReaderBase */ "../../core/common/lib/esm/ECSqlReaderBase.js");
30827
+ /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
30828
+ /* harmony import */ var _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ECSqlReaderBase */ "../../core/common/lib/esm/ECSqlReaderBase.js");
30740
30829
  /*---------------------------------------------------------------------------------------------
30741
30830
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
30742
30831
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -30746,6 +30835,7 @@ __webpack_require__.r(__webpack_exports__);
30746
30835
  */
30747
30836
 
30748
30837
 
30838
+
30749
30839
  /**
30750
30840
  * Execute ECSQL statements and read the results.
30751
30841
  *
@@ -30768,7 +30858,7 @@ __webpack_require__.r(__webpack_exports__);
30768
30858
  * JavaScript object, call [[QueryRowProxy.toRow]] on it.
30769
30859
  * @public
30770
30860
  */
30771
- class ECSqlReader extends _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_1__.ECSqlReaderBase {
30861
+ class ECSqlReader extends _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_2__.ECSqlReaderBase {
30772
30862
  _executor;
30773
30863
  query;
30774
30864
  static _maxRetryCount = 10;
@@ -30779,6 +30869,7 @@ class ECSqlReader extends _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_1__.ECSqlRea
30779
30869
  _globalDone = false;
30780
30870
  _param = new _ConcurrentQuery__WEBPACK_IMPORTED_MODULE_0__.QueryBinder().serialize();
30781
30871
  _lockArgs = false;
30872
+ _cursorId = "";
30782
30873
  _stats = { backendCpuTime: 0, backendTotalTime: 0, backendMemUsed: 0, backendRowsReturned: 0, totalTime: 0, retryCount: 0, prepareTime: 0 };
30783
30874
  _options = new _ConcurrentQuery__WEBPACK_IMPORTED_MODULE_0__.QueryOptionsBuilder().getOptions();
30784
30875
  /**
@@ -30810,10 +30901,11 @@ class ECSqlReader extends _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_1__.ECSqlRea
30810
30901
  * @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.
30811
30902
  */
30812
30903
  reset(options) {
30904
+ this._cursorId = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_1__.Guid.createValue();
30813
30905
  if (options) {
30814
30906
  this._options = options;
30815
30907
  }
30816
- this._props = new _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_1__.PropertyMetaDataMap([]);
30908
+ this._props = new _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_2__.PropertyMetaDataMap([]);
30817
30909
  this._localRows = [];
30818
30910
  this._globalDone = false;
30819
30911
  this._globalOffset = 0;
@@ -30834,6 +30926,7 @@ class ECSqlReader extends _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_1__.ECSqlRea
30834
30926
  * @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.
30835
30927
  */
30836
30928
  resetBindings() {
30929
+ this._cursorId = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_1__.Guid.createValue();
30837
30930
  this._param = new _ConcurrentQuery__WEBPACK_IMPORTED_MODULE_0__.QueryBinder().serialize();
30838
30931
  this._lockArgs = false;
30839
30932
  }
@@ -30872,13 +30965,14 @@ class ECSqlReader extends _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_1__.ECSqlRea
30872
30965
  valueFormat,
30873
30966
  query: this.query,
30874
30967
  args: this._param,
30968
+ cursorId: this._cursorId,
30875
30969
  };
30876
30970
  request.includeMetaData = this._props.length > 0 ? false : true;
30877
30971
  request.limit = { offset: this._globalOffset, count: this._globalCount < 1 ? -1 : this._globalCount };
30878
30972
  const resp = await this.runWithRetry(request);
30879
30973
  this._globalDone = resp.status === _ConcurrentQuery__WEBPACK_IMPORTED_MODULE_0__.DbResponseStatus.Done || resp.status === _ConcurrentQuery__WEBPACK_IMPORTED_MODULE_0__.DbResponseStatus.NotOpen;
30880
30974
  if (this._props.length === 0 && resp.meta.length > 0) {
30881
- this._props = new _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_1__.PropertyMetaDataMap(resp.meta);
30975
+ this._props = new _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_2__.PropertyMetaDataMap(resp.meta);
30882
30976
  }
30883
30977
  for (const row of resp.data) {
30884
30978
  ECSqlReader.replaceBase64WithUint8Array(row);
@@ -31642,7 +31736,8 @@ __webpack_require__.r(__webpack_exports__);
31642
31736
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31643
31737
  /* harmony export */ EntityMetaData: () => (/* binding */ EntityMetaData),
31644
31738
  /* harmony export */ PrimitiveTypeCode: () => (/* binding */ PrimitiveTypeCode),
31645
- /* harmony export */ PropertyMetaData: () => (/* binding */ PropertyMetaData)
31739
+ /* harmony export */ PropertyMetaData: () => (/* binding */ PropertyMetaData),
31740
+ /* harmony export */ isPersisted: () => (/* binding */ isPersisted)
31646
31741
  /* harmony export */ });
31647
31742
  /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
31648
31743
  /* harmony import */ var _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @itwin/core-geometry */ "../../core/geometry/lib/esm/core-geometry.js");
@@ -31657,6 +31752,13 @@ __webpack_require__.r(__webpack_exports__);
31657
31752
 
31658
31753
 
31659
31754
 
31755
+ /** Tests whether an [[EntityProps]] has a valid `id`, narrowing its type to [[Persisted]] if it does.
31756
+ * @public @preview
31757
+ * @extensions
31758
+ */
31759
+ function isPersisted(entity) {
31760
+ return undefined !== entity.id && _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.isValidId64(entity.id);
31761
+ }
31660
31762
  /** The primitive types of an Entity property.
31661
31763
  * @beta
31662
31764
  */
@@ -33535,6 +33637,9 @@ var GeoCoordStatus;
33535
33637
  * Geoid separation data or vertical datum differential data (such as used by NGVD29 to NAVD88 conversion).
33536
33638
  * The horizontal coordinates returned are valid but the elevation ordinate will be returned unchanged or partially changed.
33537
33639
  * This status should be somehow reported so actions can be performed to provide the missing information.
33640
+ * A finite elevation, including one equal to the input elevation, is not evidence that vertical conversion succeeded.
33641
+ * Callers requiring converted elevations must reject this result. Horizontal-only callers may use XY while retaining
33642
+ * and reporting this status. A visual fallback must not be presented as a successful vertical conversion.
33538
33643
  */
33539
33644
  GeoCoordStatus[GeoCoordStatus["VerticalDatumConvertError"] = 26] = "VerticalDatumConvertError";
33540
33645
  /** General inner conversion engine error. Coordinates returned are invalid and should be discarded */
@@ -45790,6 +45895,7 @@ __webpack_require__.r(__webpack_exports__);
45790
45895
  /* harmony export */ isBinaryImageSource: () => (/* reexport safe */ _Image__WEBPACK_IMPORTED_MODULE_69__.isBinaryImageSource),
45791
45896
  /* harmony export */ isKnownFieldPropertyType: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_166__.isKnownFieldPropertyType),
45792
45897
  /* harmony export */ isKnownTileFormat: () => (/* reexport safe */ _tile_TileIO__WEBPACK_IMPORTED_MODULE_162__.isKnownTileFormat),
45898
+ /* harmony export */ isPersisted: () => (/* reexport safe */ _EntityProps__WEBPACK_IMPORTED_MODULE_34__.isPersisted),
45793
45899
  /* harmony export */ isPlacement2dProps: () => (/* reexport safe */ _ElementProps__WEBPACK_IMPORTED_MODULE_32__.isPlacement2dProps),
45794
45900
  /* harmony export */ isPlacement3dProps: () => (/* reexport safe */ _ElementProps__WEBPACK_IMPORTED_MODULE_32__.isPlacement3dProps),
45795
45901
  /* harmony export */ isPowerOfTwo: () => (/* reexport safe */ _Image__WEBPACK_IMPORTED_MODULE_69__.isPowerOfTwo),
@@ -56826,7 +56932,7 @@ class IModelReadRpcInterface extends _RpcInterface__WEBPACK_IMPORTED_MODULE_0__.
56826
56932
  /** The immutable name of the interface. */
56827
56933
  static interfaceName = "IModelReadRpcInterface";
56828
56934
  /** The semantic version of the interface. */
56829
- static interfaceVersion = "3.8.0";
56935
+ static interfaceVersion = "3.8.1";
56830
56936
  /*===========================================================================================
56831
56937
  NOTE: Any add/remove/change to the methods below requires an update of the interface version.
56832
56938
  NOTE: Please consult the README in this folder for the semantic versioning rules.
@@ -57771,8 +57877,7 @@ class RpcInvocation {
57771
57877
  return;
57772
57878
  for (let i = 0; i !== parameters.length; ++i) {
57773
57879
  const parameter = parameters[i];
57774
- const isToken = typeof (parameter) === "object" && parameter !== null && parameter.hasOwnProperty("iModelId") && parameter.hasOwnProperty("iTwinId");
57775
- if (isToken && this.protocol.checkToken && !this.operation.policy.allowTokenMismatch) {
57880
+ if (this.protocol.checkToken && !this.operation.policy.allowTokenMismatch && RpcInvocation.isTokenParameter(parameter, i)) {
57776
57881
  const inflated = this.protocol.inflateToken(parameter, this.request);
57777
57882
  parameters[i] = inflated;
57778
57883
  if (!RpcInvocation.compareTokens(parameter, inflated)) {
@@ -57786,9 +57891,20 @@ class RpcInvocation {
57786
57891
  }
57787
57892
  }
57788
57893
  }
57894
+ /** Determine whether an operation parameter is an [[IModelRpcProps]]. Every property of the token other than `key` is optional
57895
+ * 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.
57896
+ */
57897
+ static isTokenParameter(parameter, index) {
57898
+ if (typeof parameter !== "object" || parameter === null || Array.isArray(parameter))
57899
+ return false;
57900
+ const has = (prop) => Object.prototype.hasOwnProperty.call(parameter, prop);
57901
+ if (has("iModelId") && has("iTwinId"))
57902
+ return true;
57903
+ return 0 === index && (has("key") || has("iModelId") || has("iTwinId"));
57904
+ }
57789
57905
  static compareTokens(a, b) {
57790
57906
  return a.key === b.key &&
57791
- a.iTwinId === b.iTwinId &&
57907
+ (undefined === a.iTwinId || a.iTwinId === b.iTwinId) &&
57792
57908
  a.iModelId === b.iModelId &&
57793
57909
  (undefined === a.changeset || (a.changeset.id === b.changeset?.id));
57794
57910
  }
@@ -76351,8 +76467,8 @@ class SchemaView {
76351
76467
  throw new Error("SchemaView is not mergeable: create it via SchemaView.createMergeable to merge fragments.");
76352
76468
  this._mergeContext.mergeBlob(blob);
76353
76469
  // A new fragment can add subclasses to an already-present base class, so the derived-class map
76354
- // must be rebuilt. transitiveBaseCache stays valid: a class's ancestors are always merged
76355
- // before it (dependency order), so an append never adds an ancestor to an already-cached class.
76470
+ // must be rebuilt. transitiveBaseCache and PropertyRef.overriddenProperty stay valid: a class's ancestors
76471
+ // are always merged before it (dependency order), so an append never adds an ancestor to an already-cached class.
76356
76472
  this[_storage].derivedClassMap = undefined;
76357
76473
  }
76358
76474
  // --- Internal helpers used by view objects ---
@@ -76442,12 +76558,18 @@ class SchemaView {
76442
76558
  // 1. Base class (recursive, depth-first)
76443
76559
  if (cls.baseClassIdx !== -1)
76444
76560
  this._collectProperties(cls.baseClassIdx, merged);
76445
- // 2. Mixins in declaration order
76561
+ // 2. Mixins in declaration order. Each mixin is resolved on its own so its overrides win over its
76562
+ // ancestors, then only adds names not already provided by the base class or an earlier mixin.
76446
76563
  for (let i = 0; i < cls.mixinCount; i++) {
76447
76564
  const mixinIdx = this[_storage].classMixins[cls.mixinStartIdx + i];
76448
76565
  if (mixinIdx === -1 || mixinIdx === undefined)
76449
76566
  continue; // safety: dangling mixin ref
76450
- this._collectMixinProperties(mixinIdx, merged);
76567
+ const mixinProperties = new Map();
76568
+ this._collectProperties(mixinIdx, mixinProperties);
76569
+ for (const [nameKey, resolved] of mixinProperties) {
76570
+ if (!merged.has(nameKey))
76571
+ merged.set(nameKey, resolved);
76572
+ }
76451
76573
  }
76452
76574
  // 3. Own properties - always override
76453
76575
  for (let i = 0; i < cls.ownPropCount; i++) {
@@ -76456,27 +76578,62 @@ class SchemaView {
76456
76578
  merged.set(nameKey, { ref, classIdx });
76457
76579
  }
76458
76580
  }
76459
- _collectMixinProperties(mixinIdx, merged) {
76460
- const mixin = this[_storage].classes[mixinIdx];
76461
- if (mixin === undefined)
76462
- return; // safety: dangling index from excluded schema
76463
- // Walk mixin's own base chain (mixins can extend other mixins)
76464
- if (mixin.baseClassIdx !== -1)
76465
- this._collectMixinProperties(mixin.baseClassIdx, merged);
76466
- // Mixin's own mixins
76467
- for (let i = 0; i < mixin.mixinCount; i++) {
76468
- const subMixinIdx = this[_storage].classMixins[mixin.mixinStartIdx + i];
76469
- if (subMixinIdx === -1 || subMixinIdx === undefined)
76581
+ /** Finds the property declaration that a property of the given class overrides.
76582
+ * Searches the base class and its ancestors first, then each mixin in declaration order.
76583
+ */
76584
+ _findOverriddenProperty(classIdx, nameKey) {
76585
+ const cls = this[_storage].classes[classIdx];
76586
+ if (cls === undefined || cls.type === _SchemaViewInterfaces__WEBPACK_IMPORTED_MODULE_0__.ClassType.View)
76587
+ return undefined;
76588
+ if (cls.baseClassIdx !== -1) {
76589
+ const found = this._findPropertyDeclaration(cls.baseClassIdx, nameKey);
76590
+ if (found !== undefined)
76591
+ return found;
76592
+ }
76593
+ for (let i = 0; i < cls.mixinCount; i++) {
76594
+ const mixinIdx = this[_storage].classMixins[cls.mixinStartIdx + i];
76595
+ if (mixinIdx === -1 || mixinIdx === undefined)
76470
76596
  continue; // safety: dangling mixin ref
76471
- this._collectMixinProperties(subMixinIdx, merged);
76597
+ const found = this._findPropertyDeclaration(mixinIdx, nameKey);
76598
+ if (found !== undefined)
76599
+ return found;
76600
+ }
76601
+ return undefined;
76602
+ }
76603
+ _findPropertyDeclaration(classIdx, nameKey) {
76604
+ const cls = this[_storage].classes[classIdx];
76605
+ if (cls === undefined)
76606
+ return undefined; // safety: dangling index from excluded schema
76607
+ for (let i = 0; i < cls.ownPropCount; i++) {
76608
+ const ref = this[_storage].propertyRefs[cls.ownPropStart + i];
76609
+ if (this[_storage].lowerStrings[this[_storage].propDefs[ref.defIdx].nameStringIdx] === nameKey)
76610
+ return { ref, classIdx };
76472
76611
  }
76473
- // Mixin's own properties - only set if not already present (first mixin wins)
76474
- for (let i = 0; i < mixin.ownPropCount; i++) {
76475
- const ref = this[_storage].propertyRefs[mixin.ownPropStart + i];
76612
+ return this._findOverriddenProperty(classIdx, nameKey);
76613
+ }
76614
+ /** Returns the first declaration matching `predicate`, starting with the given declaration and
76615
+ * continuing with the declarations it overrides.
76616
+ * @internal
76617
+ */
76618
+ findPropertyDefInOverrides(ref, classIdx, predicate) {
76619
+ let current = { ref, classIdx };
76620
+ while (current !== null) {
76621
+ const def = this[_storage].propDefs[current.ref.defIdx];
76622
+ if (predicate(def))
76623
+ return def;
76624
+ current = this._getOverriddenProperty(current.ref, current.classIdx);
76625
+ }
76626
+ return undefined;
76627
+ }
76628
+ /** Returns the declaration the given one overrides, resolving and storing it on the ref on first access.
76629
+ * Caching per ref is sound because a ref belongs to exactly one class; view properties (classIdx -1) never override.
76630
+ */
76631
+ _getOverriddenProperty(ref, classIdx) {
76632
+ if (ref.overriddenProperty === undefined) {
76476
76633
  const nameKey = this[_storage].lowerStrings[this[_storage].propDefs[ref.defIdx].nameStringIdx];
76477
- if (!merged.has(nameKey))
76478
- merged.set(nameKey, { ref, classIdx: mixinIdx });
76634
+ ref.overriddenProperty = classIdx !== -1 ? this._findOverriddenProperty(classIdx, nameKey) ?? null : null;
76479
76635
  }
76636
+ return ref.overriddenProperty;
76480
76637
  }
76481
76638
  /** @internal */
76482
76639
  buildDerivedClassMap() {
@@ -76501,6 +76658,9 @@ class SchemaView {
76501
76658
  // =====================================================================================
76502
76659
  // SchemaView namespace - flyweight view types
76503
76660
  // =====================================================================================
76661
+ function hasCategory(def) { return def.categoryIdx !== -1; }
76662
+ function hasKindOfQuantity(def) { return def.koqIdx !== -1; }
76663
+ function isHiddenDef(def) { return def.isHidden; }
76504
76664
  /** @beta */
76505
76665
  (function (SchemaView) {
76506
76666
  /** Lightweight view over a schema in a `SchemaView`. Holds only a view reference and
@@ -76844,10 +77004,21 @@ class SchemaView {
76844
77004
  }
76845
77005
  get kind() { return this._def.kind; }
76846
77006
  get isReadOnly() { return this._def.isReadOnly; }
76847
- /** Reflects the `HiddenProperty` custom attribute from `CoreCustomAttributes`.
76848
- * Properties marked hidden are typically excluded from UI display but remain accessible programmatically. */
77007
+ /** Reflects the `HiddenProperty` custom attribute from `CoreCustomAttributes` on this declaration only;
77008
+ * see `isEffectivelyHidden`. Properties marked hidden are typically excluded from UI display but remain
77009
+ * accessible programmatically. */
76849
77010
  get isHidden() { return this._def.isHidden; }
76850
- /** Display priority. Higher values should be displayed more prominently. 0 means default. */
77011
+ /** True if this declaration is hidden. If it is not and the property is an override, we take this from the
77012
+ * overridden property. Limitation: `HiddenProperty(Show=true)` reads the same as no `HiddenProperty`, so it does not
77013
+ * unhide a property whose overridden property is hidden. */
77014
+ get isEffectivelyHidden() {
77015
+ if (this._def.isHidden)
77016
+ return true;
77017
+ return this._ctx.findPropertyDefInOverrides(this._ref, this._classIdx, isHiddenDef) !== undefined;
77018
+ }
77019
+ /** Display priority. Higher values should be displayed more prominently. 0 means default.
77020
+ * Not inherited from the overridden property: an omitted priority is stored as 0, which cannot be told
77021
+ * apart from an explicit 0 that overrides a base priority. */
76851
77022
  get priority() { return this._ref.priority; }
76852
77023
  /** The class that declared or contributed this property through inheritance.
76853
77024
  * For own properties, returns the class itself. For inherited properties, returns the
@@ -76858,11 +77029,21 @@ class SchemaView {
76858
77029
  get declaringClass() {
76859
77030
  return this._classIdx !== -1 ? createClass(this._ctx, this._classIdx) : undefined;
76860
77031
  }
76861
- /** Property category, or undefined if none assigned. Available on all property kinds. */
77032
+ /** Property category. If there is no local category and the property is an override, we take this from
77033
+ * the overridden property. Available on all property kinds. */
76862
77034
  get category() {
76863
- const idx = this._def.categoryIdx;
77035
+ let idx = this._def.categoryIdx;
77036
+ if (idx === -1 && this._ctx[_storage].propCategories.length !== 0)
77037
+ idx = this._ctx.findPropertyDefInOverrides(this._ref, this._classIdx, hasCategory)?.categoryIdx ?? -1;
76864
77038
  return idx !== -1 ? new PropertyCategory(this._ctx, idx) : undefined;
76865
77039
  }
77040
+ /** @internal */
77041
+ get _kindOfQuantity() {
77042
+ let idx = this._def.koqIdx;
77043
+ if (idx === -1 && this._ctx[_storage].koqs.length !== 0)
77044
+ idx = this._ctx.findPropertyDefInOverrides(this._ref, this._classIdx, hasKindOfQuantity)?.koqIdx ?? -1;
77045
+ return idx !== -1 ? new KindOfQuantity(this._ctx, idx) : undefined;
77046
+ }
76866
77047
  // Type guards - real type predicates that narrow `this`
76867
77048
  /** True for `SchemaView.PrimitiveProperty` and `SchemaView.PrimitiveArrayProperty`.
76868
77049
  * Matches ecschema-metadata behavior where `isPrimitive()` includes primitive arrays. */
@@ -76924,10 +77105,9 @@ class SchemaView {
76924
77105
  const idx = this._def.enumIdx;
76925
77106
  return idx !== -1 ? new Enumeration(this._ctx, idx) : undefined;
76926
77107
  }
76927
- get kindOfQuantity() {
76928
- const idx = this._def.koqIdx;
76929
- return idx !== -1 ? new KindOfQuantity(this._ctx, idx) : undefined;
76930
- }
77108
+ /** KindOfQuantity. If there is no local KindOfQuantity and the property is an override, we take this
77109
+ * from the overridden property. */
77110
+ get kindOfQuantity() { return this._kindOfQuantity; }
76931
77111
  }
76932
77112
  SchemaView.PrimitiveProperty = PrimitiveProperty;
76933
77113
  /** An array of primitive values. Same primitive/enum fields as `PrimitiveProperty`,
@@ -76944,10 +77124,9 @@ class SchemaView {
76944
77124
  const idx = this._def.enumIdx;
76945
77125
  return idx !== -1 ? new Enumeration(this._ctx, idx) : undefined;
76946
77126
  }
76947
- get kindOfQuantity() {
76948
- const idx = this._def.koqIdx;
76949
- return idx !== -1 ? new KindOfQuantity(this._ctx, idx) : undefined;
76950
- }
77127
+ /** KindOfQuantity. If there is no local KindOfQuantity and the property is an override, we take this
77128
+ * from the overridden property. */
77129
+ get kindOfQuantity() { return this._kindOfQuantity; }
76951
77130
  get arrayMinOccurs() { return this._def.arrayMinOccurs; }
76952
77131
  get arrayMaxOccurs() { return this._def.arrayMaxOccurs; }
76953
77132
  }
@@ -77853,6 +78032,7 @@ function mergeFragmentBlob(ctx, data) {
77853
78032
  defIdx,
77854
78033
  labelStringIdx: pr.labelStringIdx,
77855
78034
  priority: pr.priority,
78035
+ overriddenProperty: undefined,
77856
78036
  });
77857
78037
  }
77858
78038
  let sourceConstraintIdx = -1;
@@ -90664,30 +90844,63 @@ class CoordinateConverter {
90664
90844
  }
90665
90845
  }
90666
90846
  /** 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.
90847
+ * Conversion results retain the backend's per-point status, including failed vertical conversions. Check each status
90848
+ * before using elevations; [[GeoCoordStatus.VerticalDatumConvertError]] does not provide a reliable converted Z.
90849
+ * Results, including failures, are cached in this converter. Loading grids does not invalidate those cached results.
90850
+ * To retry after resources become available, finish outstanding requests and acquire a fresh converter from
90851
+ * [[GeoServices.getConverter]] instead of reusing the retained instance.
90667
90852
  * @see [[GeoServices.getConverter]] to obtain a converter.
90668
90853
  * @see [GeographicCRS]($common) for more information about geographic coordinate reference systems.
90669
90854
  * @public
90670
90855
  */
90671
90856
  class GeoConverter {
90672
- _geoToIModel;
90673
- _iModelToGeo;
90857
+ _converters;
90858
+ _gcs;
90859
+ _options;
90674
90860
  /** Used for removing this converter from GeoServices' cache after all requests are completed.
90675
90861
  * @internal
90676
90862
  */
90677
90863
  onAllRequestsCompleted = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
90678
90864
  /** @internal */
90679
90865
  constructor(opts) {
90866
+ this._options = opts;
90867
+ this._gcs = opts.getGcs?.();
90868
+ this._converters = this.createConverters();
90869
+ }
90870
+ createConverters() {
90871
+ const opts = this._options;
90680
90872
  const isIModelClosed = opts.isIModelClosed;
90681
- this._geoToIModel = new CoordinateConverter({
90682
- direction: "geoToIModel",
90683
- isIModelClosed,
90684
- requestPoints: async (geoCoords) => opts.toIModelCoords({ source: opts.datum, geoCoords }),
90685
- });
90686
- this._iModelToGeo = new CoordinateConverter({
90687
- direction: "iModelToGeo",
90688
- isIModelClosed,
90689
- requestPoints: async (iModelCoords) => opts.fromIModelCoords({ target: opts.datum, iModelCoords }),
90690
- });
90873
+ return {
90874
+ geoToIModel: new CoordinateConverter({
90875
+ direction: "geoToIModel",
90876
+ isIModelClosed,
90877
+ requestPoints: async (geoCoords) => opts.toIModelCoords({ source: opts.datum, geoCoords }),
90878
+ }),
90879
+ iModelToGeo: new CoordinateConverter({
90880
+ direction: "iModelToGeo",
90881
+ isIModelClosed,
90882
+ requestPoints: async (iModelCoords) => opts.fromIModelCoords({ target: opts.datum, iModelCoords }),
90883
+ }),
90884
+ };
90885
+ }
90886
+ refreshGcs() {
90887
+ const gcs = this._options.getGcs?.();
90888
+ if (gcs !== this._gcs) {
90889
+ this._gcs = gcs;
90890
+ this._converters = this.createConverters();
90891
+ }
90892
+ }
90893
+ async convert(points, direction) {
90894
+ for (;;) {
90895
+ this.refreshGcs();
90896
+ const converter = this._converters[direction];
90897
+ const result = await converter.convert(points);
90898
+ this.refreshGcs();
90899
+ if (converter !== this._converters[direction])
90900
+ continue;
90901
+ this.checkCompletion();
90902
+ return result;
90903
+ }
90691
90904
  }
90692
90905
  /** Convert the specified geographic coordinates into iModel coordinates. */
90693
90906
  async convertToIModelCoords(geoPoints) {
@@ -90701,8 +90914,7 @@ class GeoConverter {
90701
90914
  }
90702
90915
  /** @internal */
90703
90916
  async getIModelCoordinatesFromGeoCoordinates(geoPoints) {
90704
- const result = await this._geoToIModel.convert(geoPoints);
90705
- this.checkCompletion();
90917
+ const result = await this.convert(geoPoints, "geoToIModel");
90706
90918
  return {
90707
90919
  iModelCoords: result.points,
90708
90920
  fromCache: result.fromCache,
@@ -90710,20 +90922,20 @@ class GeoConverter {
90710
90922
  }
90711
90923
  /** @internal */
90712
90924
  async getGeoCoordinatesFromIModelCoordinates(iModelPoints) {
90713
- const result = await this._iModelToGeo.convert(iModelPoints);
90714
- this.checkCompletion();
90925
+ const result = await this.convert(iModelPoints, "iModelToGeo");
90715
90926
  return {
90716
90927
  geoCoords: result.points,
90717
90928
  fromCache: result.fromCache,
90718
90929
  };
90719
90930
  }
90720
90931
  checkCompletion() {
90721
- if (this._geoToIModel.isIdle && this._iModelToGeo.isIdle)
90932
+ if (this._converters.geoToIModel.isIdle && this._converters.iModelToGeo.isIdle)
90722
90933
  this.onAllRequestsCompleted.raiseEvent();
90723
90934
  }
90724
90935
  /** @internal */
90725
90936
  getCachedIModelCoordinatesFromGeoCoordinates(geoPoints) {
90726
- return this._geoToIModel.findCached(geoPoints);
90937
+ this.refreshGcs();
90938
+ return this._converters.geoToIModel.findCached(geoPoints);
90727
90939
  }
90728
90940
  }
90729
90941
  /** The Geographic Services available for an [[IModelConnection]].
@@ -90751,6 +90963,7 @@ class GeoServices {
90751
90963
  static createForIModel(iModel) {
90752
90964
  return new GeoServices({
90753
90965
  isIModelClosed: () => iModel.isClosed,
90966
+ getGcs: () => iModel.geographicCoordinateSystem,
90754
90967
  toIModelCoords: async (request) => {
90755
90968
  const rpc = _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelReadRpcInterface.getClientForRouting(iModel.routingContext.token);
90756
90969
  const response = await rpc.getIModelCoordinatesFromGeoCoordinates(iModel.getRpcProps(), request);
@@ -92876,6 +93089,25 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
92876
93089
  async generateElementMeshes(requestProps) {
92877
93090
  return _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelReadRpcInterface.getClientForRouting(this.routingContext.token).generateElementMeshes(this.getRpcProps(), requestProps);
92878
93091
  }
93092
+ /** Constructs a point after validating raw ordinates, before JSON normalization can conceal NaN.
93093
+ * Omitted ordinates default to zero.
93094
+ * @throws IModelError with GeoServiceStatus.CSMapError if any supplied ordinate is non-finite.
93095
+ * @internal
93096
+ */
93097
+ static getFiniteGeoPoint(props) {
93098
+ const coordinates = Array.isArray(props) ? props : [props.x, props.y, props.z];
93099
+ for (let index = 0; index < 3; ++index) {
93100
+ // RPC marshaling converts NaN and infinities to null; reject null rather than defaulting it to zero.
93101
+ if (!Number.isFinite(coordinates[index] === undefined ? 0 : coordinates[index])) {
93102
+ _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logError(loggerCategory, "Non-finite coordinate returned by geographic conversion", {
93103
+ ordinateIndex: index,
93104
+ coordinates: coordinates.map((ordinate) => String(ordinate)),
93105
+ });
93106
+ 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");
93107
+ }
93108
+ }
93109
+ return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(props);
93110
+ }
92879
93111
  /** Convert a point in this iModel's Spatial coordinates to a [[Cartographic]] using the Geographic location services for this IModelConnection.
92880
93112
  * @param spatial A point in the iModel's spatial coordinates
92881
93113
  * @param result If defined, use this for output
@@ -92894,7 +93126,7 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
92894
93126
  const geoServiceStatus = (0,_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.mapToGeoServiceStatus)(coordResponse.geoCoords[0].s);
92895
93127
  throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError(geoServiceStatus, "Error converting spatial to cartographic");
92896
93128
  }
92897
- 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...
93129
+ const longLatHeight = IModelConnection.getFiniteGeoPoint(coordResponse.geoCoords[0].p); // x is longitude in degrees, y is latitude in degrees, z is height in meters...
92898
93130
  return _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.Cartographic.fromDegrees({ longitude: longLatHeight.x, latitude: longLatHeight.y, height: longLatHeight.z }, result);
92899
93131
  }
92900
93132
  /** Convert a point in this iModel's Spatial coordinates to a [[Cartographic]] using the Geographic location services for this IModelConnection or [[IModel.ecefLocation]].
@@ -92948,7 +93180,7 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
92948
93180
  case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.GeoCoordStatus.NoGCSDefined:
92949
93181
  throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.GeoServiceStatus.NoGeoLocation, "iModel is not GeoLocated");
92950
93182
  case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.GeoCoordStatus.Success:
92951
- const llh = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(coord.p);
93183
+ const llh = IModelConnection.getFiniteGeoPoint(coord.p);
92952
93184
  return _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.Cartographic.fromDegrees({ longitude: llh.x, latitude: llh.y, height: llh.z });
92953
93185
  default:
92954
93186
  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");
@@ -92975,7 +93207,7 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
92975
93207
  throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError(geoServiceStatus, "Error converting cartographic to spatial");
92976
93208
  }
92977
93209
  result = result ? result : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point3d.createZero();
92978
- result.setFromJSON(coordResponse.iModelCoords[0].p);
93210
+ result.setFrom(IModelConnection.getFiniteGeoPoint(coordResponse.iModelCoords[0].p));
92979
93211
  return result;
92980
93212
  }
92981
93213
  /** Convert a [Cartographic]($common) to a point in this iModel's Spatial coordinates using a [[GeoConverter]] or[[IModel.ecefLocation]($common).
@@ -93025,7 +93257,7 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
93025
93257
  case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.GeoCoordStatus.NoGCSDefined:
93026
93258
  throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.GeoServiceStatus.NoGeoLocation, "iModel is not GeoLocated");
93027
93259
  case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.GeoCoordStatus.Success:
93028
- return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(coord.p);
93260
+ return IModelConnection.getFiniteGeoPoint(coord.p);
93029
93261
  default:
93030
93262
  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");
93031
93263
  }
@@ -93361,7 +93593,7 @@ class SnapshotConnection extends IModelConnection {
93361
93593
  /** @internal */
93362
93594
  async getDictionaryModel() {
93363
93595
  const res = await this._iModel.models.queryProps({ from: "bis.DictionaryModel", wantPrivate: true });
93364
- if (res.length !== 1 || res[0].id === undefined)
93596
+ if (res.length !== 1)
93365
93597
  throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.IModelStatus.BadModel, "bis.DictionaryModel");
93366
93598
  return res[0].id;
93367
93599
  }
@@ -116896,6 +117128,7 @@ const extensionExports = {
116896
117128
  imageBufferToPngDataUrl: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.imageBufferToPngDataUrl,
116897
117129
  imageElementFromImageSource: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.imageElementFromImageSource,
116898
117130
  imageElementFromUrl: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.imageElementFromUrl,
117131
+ isPersisted: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.isPersisted,
116899
117132
  queryTerrainElevationOffset: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.queryTerrainElevationOffset,
116900
117133
  readElementGraphics: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.readElementGraphics,
116901
117134
  readGltfGraphics: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.readGltfGraphics,
@@ -154016,9 +154249,10 @@ __webpack_require__.r(__webpack_exports__);
154016
154249
  /* harmony import */ var _common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/FrontendLoggerCategory */ "../../core/frontend/lib/esm/common/FrontendLoggerCategory.js");
154017
154250
  /* harmony import */ var _DisplayStyleState__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../DisplayStyleState */ "../../core/frontend/lib/esm/DisplayStyleState.js");
154018
154251
  /* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
154019
- /* harmony import */ var _RealityDataSource__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../RealityDataSource */ "../../core/frontend/lib/esm/RealityDataSource.js");
154020
- /* 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");
154021
- /* harmony import */ var _tile_internal__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../tile/internal */ "../../core/frontend/lib/esm/tile/internal.js");
154252
+ /* harmony import */ var _IModelConnection__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../IModelConnection */ "../../core/frontend/lib/esm/IModelConnection.js");
154253
+ /* harmony import */ var _RealityDataSource__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../RealityDataSource */ "../../core/frontend/lib/esm/RealityDataSource.js");
154254
+ /* 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");
154255
+ /* harmony import */ var _tile_internal__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../tile/internal */ "../../core/frontend/lib/esm/tile/internal.js");
154022
154256
  /*---------------------------------------------------------------------------------------------
154023
154257
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
154024
154258
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -154037,6 +154271,7 @@ __webpack_require__.r(__webpack_exports__);
154037
154271
 
154038
154272
 
154039
154273
 
154274
+
154040
154275
  const scratchRange = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Range3d.create();
154041
154276
  const scratchWorldFrustum = new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.Frustum();
154042
154277
  function compareSourceKeys(lhs, rhs) {
@@ -154100,7 +154335,7 @@ class OrbitGtTileTreeParams {
154100
154335
  id;
154101
154336
  modelId;
154102
154337
  iModel;
154103
- get priority() { return _tile_internal__WEBPACK_IMPORTED_MODULE_10__.TileLoadPriority.Context; }
154338
+ get priority() { return _tile_internal__WEBPACK_IMPORTED_MODULE_11__.TileLoadPriority.Context; }
154104
154339
  constructor(rdSourceKey, iModel, modelId, location) {
154105
154340
  this.location = location;
154106
154341
  const key = rdSourceKey;
@@ -154109,7 +154344,7 @@ class OrbitGtTileTreeParams {
154109
154344
  this.iModel = iModel;
154110
154345
  }
154111
154346
  }
154112
- class OrbitGtRootTile extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.Tile {
154347
+ class OrbitGtRootTile extends _tile_internal__WEBPACK_IMPORTED_MODULE_11__.Tile {
154113
154348
  _loadChildren(_resolve, _reject) { }
154114
154349
  async requestContent(_isCanceled) { return undefined; }
154115
154350
  get channel() { return _IModelApp__WEBPACK_IMPORTED_MODULE_7__.IModelApp.tileAdmin.channels.getForHttp("itwinjs-orbitgit"); }
@@ -154182,7 +154417,7 @@ class TileSortProjector {
154182
154417
  coordinate.z = point.z;
154183
154418
  }
154184
154419
  }
154185
- class OrbitGtTileGraphic extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.TileUsageMarker {
154420
+ class OrbitGtTileGraphic extends _tile_internal__WEBPACK_IMPORTED_MODULE_11__.TileUsageMarker {
154186
154421
  graphic;
154187
154422
  constructor(graphic, viewport, time) {
154188
154423
  super();
@@ -154193,7 +154428,7 @@ class OrbitGtTileGraphic extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.Ti
154193
154428
  this.graphic[Symbol.dispose]();
154194
154429
  }
154195
154430
  }
154196
- class OrbitGtTileTree extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.TileTree {
154431
+ class OrbitGtTileTree extends _tile_internal__WEBPACK_IMPORTED_MODULE_11__.TileTree {
154197
154432
  _dataManager;
154198
154433
  _centerOffset;
154199
154434
  _ecefTransform;
@@ -154209,7 +154444,7 @@ class OrbitGtTileTree extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.TileT
154209
154444
  this._dataManager = _dataManager;
154210
154445
  this._centerOffset = _centerOffset;
154211
154446
  this._ecefTransform = _ecefTransform;
154212
- this._layerHandler = new _tile_internal__WEBPACK_IMPORTED_MODULE_10__.LayerTileTreeHandler(this);
154447
+ this._layerHandler = new _tile_internal__WEBPACK_IMPORTED_MODULE_11__.LayerTileTreeHandler(this);
154213
154448
  this._tileParams = { contentId: "0", range: cloudRange, maximumSize: 256 };
154214
154449
  this.rootTile = new OrbitGtRootTile(this._tileParams, this);
154215
154450
  }
@@ -154279,7 +154514,7 @@ class OrbitGtTileTree extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.TileT
154279
154514
  range.high.addInPlace(this._centerOffset);
154280
154515
  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);
154281
154516
  const featureTable = new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.FeatureTable(1, this.modelId, _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.BatchType.Primary);
154282
- const features = new _common_internal_render_MeshPrimitives__WEBPACK_IMPORTED_MODULE_9__.Mesh.Features(featureTable);
154517
+ const features = new _common_internal_render_MeshPrimitives__WEBPACK_IMPORTED_MODULE_10__.Mesh.Features(featureTable);
154283
154518
  const system = _IModelApp__WEBPACK_IMPORTED_MODULE_7__.IModelApp.renderSystem;
154284
154519
  const voxelSize = (range.high.x - range.low.x) / 64;
154285
154520
  features.add(new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.Feature(this.modelId), 1);
@@ -154354,7 +154589,17 @@ async function computeVerticalDatumShift(geoOrigin, heightAsEllipsoidalDbZ, iMod
154354
154589
  _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`);
154355
154590
  return 0;
154356
154591
  }
154357
- return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(response.iModelCoords[0].p).z - heightAsEllipsoidalDbZ;
154592
+ try {
154593
+ const converted = _IModelConnection__WEBPACK_IMPORTED_MODULE_8__.IModelConnection.getFiniteGeoPoint(response.iModelCoords[0].p);
154594
+ const shift = converted.z - heightAsEllipsoidalDbZ;
154595
+ if (!Number.isFinite(shift))
154596
+ throw new Error("Non-finite orthometric height correction");
154597
+ return shift;
154598
+ }
154599
+ catch {
154600
+ _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");
154601
+ return 0;
154602
+ }
154358
154603
  }
154359
154604
  catch (err) {
154360
154605
  _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logError(_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_5__.FrontendLoggerCategory.RealityData, err);
@@ -154384,7 +154629,7 @@ async function computeVerticalDatumShift(geoOrigin, heightAsEllipsoidalDbZ, iMod
154384
154629
  return isValidSASToken(props.sasToken);
154385
154630
  }
154386
154631
  async function createOrbitGtTileTree(rdSourceKey, iModel, modelId) {
154387
- const rdSource = await _RealityDataSource__WEBPACK_IMPORTED_MODULE_8__.RealityDataSource.fromKey(rdSourceKey, iModel.iTwinId);
154632
+ const rdSource = await _RealityDataSource__WEBPACK_IMPORTED_MODULE_9__.RealityDataSource.fromKey(rdSourceKey, iModel.iTwinId);
154388
154633
  const isContextShare = rdSourceKey.provider === _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RealityDataProvider.ContextShare;
154389
154634
  const isTilestUrl = rdSourceKey.provider === _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RealityDataProvider.TilesetUrl;
154390
154635
  let blobStringUrl;
@@ -154403,7 +154648,7 @@ async function computeVerticalDatumShift(geoOrigin, heightAsEllipsoidalDbZ, iMod
154403
154648
  blobStringUrl = rdSourceKey.id;
154404
154649
  }
154405
154650
  else {
154406
- const orbitGtBlobProps = _RealityDataSource__WEBPACK_IMPORTED_MODULE_8__.RealityDataSource.createOrbitGtBlobPropsFromKey(rdSourceKey);
154651
+ const orbitGtBlobProps = _RealityDataSource__WEBPACK_IMPORTED_MODULE_9__.RealityDataSource.createOrbitGtBlobPropsFromKey(rdSourceKey);
154407
154652
  if (orbitGtBlobProps === undefined)
154408
154653
  return undefined;
154409
154654
  if (!isValidOrbitGtBlobProps(orbitGtBlobProps))
@@ -154492,7 +154737,7 @@ async function computeVerticalDatumShift(geoOrigin, heightAsEllipsoidalDbZ, iMod
154492
154737
  /** Supplies a reality data [[TileTree]] from a URL. May be associated with a persistent [[GeometricModelState]], or attached at run-time via a [[ContextOrbitGtState]].
154493
154738
  * Exported strictly for tests.
154494
154739
  */
154495
- class OrbitGtTreeReference extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.RealityModelTileTree.Reference {
154740
+ class OrbitGtTreeReference extends _tile_internal__WEBPACK_IMPORTED_MODULE_11__.RealityModelTileTree.Reference {
154496
154741
  treeOwner;
154497
154742
  _rdSourceKey;
154498
154743
  _modelId;
@@ -154505,11 +154750,11 @@ class OrbitGtTreeReference extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.
154505
154750
  this._rdSourceKey = props.rdSourceKey;
154506
154751
  }
154507
154752
  else if (props.orbitGtBlob) {
154508
- this._rdSourceKey = _RealityDataSource__WEBPACK_IMPORTED_MODULE_8__.RealityDataSource.createKeyFromOrbitGtBlobProps(props.orbitGtBlob);
154753
+ this._rdSourceKey = _RealityDataSource__WEBPACK_IMPORTED_MODULE_9__.RealityDataSource.createKeyFromOrbitGtBlobProps(props.orbitGtBlob);
154509
154754
  }
154510
154755
  else {
154511
154756
  // TODO: Maybe we should throw an exception
154512
- 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);
154757
+ 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);
154513
154758
  }
154514
154759
  // ###TODO find compatible model Id
154515
154760
  let modelId = props.modelId;
@@ -161508,7 +161753,12 @@ var QuantityType;
161508
161753
  class AlternateUnitLabelsRegistry {
161509
161754
  _alternateLabelRegistry = new Map();
161510
161755
  addAlternateLabels(key, ...labels) {
161511
- [...labels].forEach((value) => this._alternateLabelRegistry.get(key)?.add(value));
161756
+ let entry = this._alternateLabelRegistry.get(key);
161757
+ if (!entry) {
161758
+ entry = new Set();
161759
+ this._alternateLabelRegistry.set(key, entry);
161760
+ }
161761
+ labels.forEach((value) => entry.add(value));
161512
161762
  }
161513
161763
  constructor(defaultAlternates) {
161514
161764
  if (defaultAlternates) {
@@ -162311,7 +162561,7 @@ class QuantityFormatter {
162311
162561
  const entry = this.quantityTypesRegistry.get(quantityKey);
162312
162562
  if (!entry)
162313
162563
  throw new Error(`Unable to find registered quantity type with key ${quantityKey}`);
162314
- return entry.generateParserSpec(this.getFormatPropsByQuantityTypeEntryAndSystem(entry, requestedSystem), this.unitsProvider);
162564
+ return entry.generateParserSpec(this.getFormatPropsByQuantityTypeEntryAndSystem(entry, requestedSystem), this.unitsProvider, this.alternateUnitLabelsProvider);
162315
162565
  }
162316
162566
  /** Asynchronous Call to get a ParserSpec for a QuantityType.
162317
162567
  * @param type One of the built-in quantity types supported.
@@ -162459,7 +162709,7 @@ class QuantityFormatter {
162459
162709
  const { persistenceUnitName, formatProps, formatName } = props;
162460
162710
  const persistenceUnitProps = await this._unitsProvider.findUnitByName(persistenceUnitName);
162461
162711
  const format = await _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.Format.createFromJSON(formatName ?? "temp", this._unitsProvider, formatProps);
162462
- return _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.ParserSpec.create(format, this._unitsProvider, persistenceUnitProps);
162712
+ return _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.ParserSpec.create(format, this._unitsProvider, persistenceUnitProps, this.alternateUnitLabelsProvider);
162463
162713
  }
162464
162714
  /**
162465
162715
  * @beta
@@ -163001,6 +163251,9 @@ const UNIT_EXTRA_DATA = [
163001
163251
  { name: "Units.CUB_US_SURVEY_FT", altDisplayLabels: ["cf"] },
163002
163252
  { name: "Units.CUB_YRD", altDisplayLabels: ["cy"] },
163003
163253
  { name: "Units.CUB_M", altDisplayLabels: ["cm"] },
163254
+ // Velocity ( base unit m/s )
163255
+ { name: "Units.KM_PER_HR", altDisplayLabels: ["kph", "kmh"] },
163256
+ { name: "Units.MPH", altDisplayLabels: ["mph"] },
163004
163257
  ];
163005
163258
 
163006
163259
 
@@ -296331,7 +296584,7 @@ __webpack_require__.r(__webpack_exports__);
296331
296584
  /* harmony export */ });
296332
296585
  /* 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");
296333
296586
  /* 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");
296334
- /* 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");
296587
+ /* 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");
296335
296588
  /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
296336
296589
  /*---------------------------------------------------------------------------------------------
296337
296590
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
@@ -317046,7 +317299,16 @@ class Parser {
317046
317299
  // Don't add space when the wip token is empty.
317047
317300
  continue;
317048
317301
  }
317049
- if (isCharOperator) {
317302
+ // A slash directly between two label characters (e.g. "km/h") is part of the label, not a division.
317303
+ const nextCharCode = str.charCodeAt(i + 1);
317304
+ const isUnitLabelSlash = charCode === _Constants__WEBPACK_IMPORTED_MODULE_1__.QuantityConstants.CHAR_SLASH &&
317305
+ wipToken.length > 0 &&
317306
+ i + 1 < str.length &&
317307
+ !/\s/.test(str[i - 1]) &&
317308
+ !/\s/.test(str[i + 1]) &&
317309
+ !Parser.isDigitOrDecimalSeparator(nextCharCode, format) &&
317310
+ !isOperator(nextCharCode);
317311
+ if (isCharOperator && !isUnitLabelSlash) {
317050
317312
  if (wipToken.length > 0) {
317051
317313
  // There is a token is progress, process it now, before adding the new operator token.
317052
317314
  tokens.push(new ParseToken(wipToken));
@@ -317216,11 +317478,18 @@ class Parser {
317216
317478
  }
317217
317479
  return undefined;
317218
317480
  }
317481
+ /** Get the Unit Conversion for a known unit. Matches by unit name first because labels can differ between units providers
317482
+ * (e.g. an unlabeled schema unit may have an empty label in one provider and a name-derived label in another). Falls back to label lookup.
317483
+ */
317484
+ static tryFindUnitConversionForUnit(unit, unitsConversions) {
317485
+ const byName = unitsConversions.find((conversion) => conversion.name === unit.name);
317486
+ return byName ? byName.conversion : Parser.tryFindUnitConversion(unit.label, unitsConversions, unit);
317487
+ }
317219
317488
  /**
317220
317489
  * Get what the unit conversion is for a unitless value.
317221
317490
  */
317222
317491
  static getDefaultUnitConversion(tokens, unitsConversions, defaultUnit) {
317223
- let unitConversion = defaultUnit ? Parser.tryFindUnitConversion(defaultUnit.label, unitsConversions, defaultUnit) : undefined;
317492
+ let unitConversion = defaultUnit ? Parser.tryFindUnitConversionForUnit(defaultUnit, unitsConversions) : undefined;
317224
317493
  if (!unitConversion) {
317225
317494
  // No default unit conversion, take the first valid unit.
317226
317495
  const uniqueUnitLabels = [...new Set(tokens.filter((token) => token.isString).map((token) => token.value))];
@@ -317340,7 +317609,7 @@ class Parser {
317340
317609
  if (compositeUnitIndex > 0 && format.units && format.units.length > compositeUnitIndex) {
317341
317610
  // if this is not the first token, and we have a composite spec, look up the unit from the current index
317342
317611
  const presUnitAtIndex = format.units[compositeUnitIndex][0];
317343
- conversion = Parser.tryFindUnitConversion(presUnitAtIndex.label, unitsConversions, presUnitAtIndex);
317612
+ conversion = Parser.tryFindUnitConversionForUnit(presUnitAtIndex, unitsConversions);
317344
317613
  }
317345
317614
  else if (defaultUnitConversion) {
317346
317615
  conversion = defaultUnitConversion;
@@ -317633,7 +317902,7 @@ class Parser {
317633
317902
  }
317634
317903
  // Original flow for 1-unit composite - use Quantity.convertTo for proper unit conversion
317635
317904
  const defaultUnit = spec.format.units && spec.format.units.length > 0 ? spec.format.units[0][0] : undefined;
317636
- const unitConversion = defaultUnit ? Parser.tryFindUnitConversion(defaultUnit.label, spec.unitConversions, defaultUnit) : undefined;
317905
+ const unitConversion = defaultUnit ? Parser.tryFindUnitConversionForUnit(defaultUnit, spec.unitConversions) : undefined;
317637
317906
  if (!unitConversion) {
317638
317907
  throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.QuantityError(_Exception__WEBPACK_IMPORTED_MODULE_2__.QuantityStatus.MissingRequiredProperty, `Missing input unit or unit conversion for interpreting ${spec.format.name}.`);
317639
317908
  }
@@ -333002,534 +333271,377 @@ const isSafeIterable = (thing) =>
333002
333271
 
333003
333272
  /***/ },
333004
333273
 
333005
- /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/index.js"
333006
- /*!**********************************************************************************************************************!*\
333007
- !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/index.js ***!
333008
- \**********************************************************************************************************************/
333009
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
333010
-
333011
- "use strict";
333012
- __webpack_require__.r(__webpack_exports__);
333013
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
333014
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
333015
- /* harmony export */ });
333016
- /* 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");
333017
- /* 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");
333018
- 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); }
333019
- 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; }
333020
- 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; }
333021
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
333022
- 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); } }
333023
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
333024
- 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; }
333025
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
333026
- 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); }
333027
- ;
333028
-
333029
- var getDefaults = function getDefaults() {
333030
- return {
333031
- loadPath: '/locales/{{lng}}/{{ns}}.json',
333032
- addPath: '/locales/add/{{lng}}/{{ns}}',
333033
- parse: function parse(data) {
333034
- return JSON.parse(data);
333035
- },
333036
- stringify: JSON.stringify,
333037
- parsePayload: function parsePayload(namespace, key, fallbackValue) {
333038
- return _defineProperty({}, key, fallbackValue || '');
333039
- },
333040
- parseLoadPayload: function parseLoadPayload(languages, namespaces) {
333041
- return undefined;
333042
- },
333043
- request: _request_js__WEBPACK_IMPORTED_MODULE_1__["default"],
333044
- reloadInterval: typeof window !== 'undefined' ? false : 60 * 60 * 1000,
333045
- customHeaders: {},
333046
- queryStringParams: {},
333047
- crossDomain: false,
333048
- withCredentials: false,
333049
- overrideMimeType: false,
333050
- requestOptions: {
333051
- mode: 'cors',
333052
- credentials: 'same-origin',
333053
- cache: 'default'
333054
- }
333055
- };
333056
- };
333057
- var Backend = function () {
333058
- function Backend(services) {
333059
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
333060
- var allOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
333061
- _classCallCheck(this, Backend);
333062
- this.services = services;
333063
- this.options = options;
333064
- this.allOptions = allOptions;
333065
- this.type = 'backend';
333066
- this.init(services, options, allOptions);
333067
- }
333068
- return _createClass(Backend, [{
333069
- key: "init",
333070
- value: function init(services) {
333071
- var _this = this;
333072
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
333073
- var allOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
333074
- this.services = services;
333075
- this.options = _objectSpread(_objectSpread(_objectSpread({}, getDefaults()), this.options || {}), options);
333076
- this.allOptions = allOptions;
333077
- if (this.services && this.options.reloadInterval) {
333078
- var timer = setInterval(function () {
333079
- return _this.reload();
333080
- }, this.options.reloadInterval);
333081
- if (_typeof(timer) === 'object' && typeof timer.unref === 'function') timer.unref();
333082
- }
333083
- }
333084
- }, {
333085
- key: "readMulti",
333086
- value: function readMulti(languages, namespaces, callback) {
333087
- this._readAny(languages, languages, namespaces, namespaces, callback);
333088
- }
333089
- }, {
333090
- key: "read",
333091
- value: function read(language, namespace, callback) {
333092
- this._readAny([language], language, [namespace], namespace, callback);
333093
- }
333094
- }, {
333095
- key: "_readAny",
333096
- value: function _readAny(languages, loadUrlLanguages, namespaces, loadUrlNamespaces, callback) {
333097
- var _this2 = this;
333098
- var loadPath = this.options.loadPath;
333099
- if (typeof this.options.loadPath === 'function') {
333100
- loadPath = this.options.loadPath(languages, namespaces);
333101
- }
333102
- loadPath = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.makePromise)(loadPath);
333103
- loadPath.then(function (resolvedLoadPath) {
333104
- if (!resolvedLoadPath) return callback(null, {});
333105
- var url = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.interpolateUrl)(resolvedLoadPath, {
333106
- lng: languages.join('+'),
333107
- ns: namespaces.join('+')
333108
- });
333109
- if (url == null) {
333110
- var safeLngs = languages.map(_utils_js__WEBPACK_IMPORTED_MODULE_0__.sanitizeLogValue).join(', ');
333111
- var safeNss = namespaces.map(_utils_js__WEBPACK_IMPORTED_MODULE_0__.sanitizeLogValue).join(', ');
333112
- return callback(new Error('i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=[' + safeLngs + '] namespaces=[' + safeNss + ']'), false);
333113
- }
333114
- _this2.loadUrl(url, callback, loadUrlLanguages, loadUrlNamespaces);
333115
- });
333116
- }
333117
- }, {
333118
- key: "loadUrl",
333119
- value: function loadUrl(url, callback, languages, namespaces) {
333120
- var _this3 = this;
333121
- var lng = typeof languages === 'string' ? [languages] : languages;
333122
- var ns = typeof namespaces === 'string' ? [namespaces] : namespaces;
333123
- var payload = this.options.parseLoadPayload(lng, ns);
333124
- var safeUrl = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.sanitizeLogValue)((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.redactUrlCredentials)(url));
333125
- this.options.request(this.options, url, payload, function (err, res) {
333126
- if (res && (res.status >= 500 && res.status < 600 || !res.status)) return callback('failed loading ' + safeUrl + '; status code: ' + res.status, true);
333127
- if (res && res.status >= 400 && res.status < 500) return callback('failed loading ' + safeUrl + '; status code: ' + res.status, false);
333128
- if (!res && err && err.message) {
333129
- var errorMessage = err.message.toLowerCase();
333130
- var isNetworkError = ['failed', 'fetch', 'network', 'load'].find(function (term) {
333131
- return errorMessage.indexOf(term) > -1;
333132
- });
333133
- if (isNetworkError) {
333134
- return callback('failed loading ' + safeUrl + ': ' + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.sanitizeLogValue)(err.message), true);
333135
- }
333136
- }
333137
- if (err) return callback(err, false);
333138
- var ret, parseErr;
333139
- try {
333140
- if (typeof res.data === 'string') {
333141
- ret = _this3.options.parse(res.data, languages, namespaces);
333142
- } else {
333143
- ret = res.data;
333144
- }
333145
- } catch (e) {
333146
- parseErr = 'failed parsing ' + safeUrl + ' to json';
333147
- }
333148
- if (parseErr) return callback(parseErr, false);
333149
- callback(null, ret);
333150
- });
333151
- }
333152
- }, {
333153
- key: "create",
333154
- value: function create(languages, namespace, key, fallbackValue, callback) {
333155
- var _this4 = this;
333156
- if (!this.options.addPath) return;
333157
- if (typeof languages === 'string') languages = [languages];
333158
- var payload = this.options.parsePayload(namespace, key, fallbackValue);
333159
- var finished = 0;
333160
- var dataArray = [];
333161
- var resArray = [];
333162
- languages.forEach(function (lng) {
333163
- var addPath = _this4.options.addPath;
333164
- if (typeof _this4.options.addPath === 'function') {
333165
- addPath = _this4.options.addPath(lng, namespace);
333166
- }
333167
- var url = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.interpolateUrl)(addPath, {
333168
- lng: lng,
333169
- ns: namespace
333170
- });
333171
- if (url == null) {
333172
- finished += 1;
333173
- if (callback && finished === languages.length) callback(dataArray, resArray);
333174
- return;
333175
- }
333176
- _this4.options.request(_this4.options, url, payload, function (data, res) {
333177
- finished += 1;
333178
- dataArray.push(data);
333179
- resArray.push(res);
333180
- if (finished === languages.length) {
333181
- if (typeof callback === 'function') callback(dataArray, resArray);
333182
- }
333183
- });
333184
- });
333185
- }
333186
- }, {
333187
- key: "reload",
333188
- value: function reload() {
333189
- var _this5 = this;
333190
- var _this$services = this.services,
333191
- backendConnector = _this$services.backendConnector,
333192
- languageUtils = _this$services.languageUtils,
333193
- logger = _this$services.logger;
333194
- var currentLanguage = backendConnector.language;
333195
- if (currentLanguage && currentLanguage.toLowerCase() === 'cimode') return;
333196
- var toLoad = [];
333197
- var append = function append(lng) {
333198
- var lngs = languageUtils.toResolveHierarchy(lng);
333199
- lngs.forEach(function (l) {
333200
- if (toLoad.indexOf(l) < 0) toLoad.push(l);
333201
- });
333202
- };
333203
- append(currentLanguage);
333204
- if (this.allOptions.preload) this.allOptions.preload.forEach(function (l) {
333205
- return append(l);
333206
- });
333207
- toLoad.forEach(function (lng) {
333208
- _this5.allOptions.ns.forEach(function (ns) {
333209
- backendConnector.read(lng, ns, 'read', null, null, function (err, data) {
333210
- if (err) logger.warn("loading namespace ".concat(ns, " for language ").concat(lng, " failed"), err);
333211
- if (!err && data) logger.log("loaded namespace ".concat(ns, " for language ").concat(lng), data);
333212
- backendConnector.loaded("".concat(lng, "|").concat(ns), err, data);
333213
- });
333214
- });
333215
- });
333216
- }
333217
- }]);
333218
- }();
333219
- Backend.type = 'backend';
333220
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Backend);
333221
-
333222
- /***/ },
333223
-
333224
- /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/request.js"
333225
- /*!************************************************************************************************************************!*\
333226
- !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/request.js ***!
333227
- \************************************************************************************************************************/
333228
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
333229
-
333230
- "use strict";
333231
- __webpack_require__.r(__webpack_exports__);
333232
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
333233
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
333234
- /* harmony export */ });
333235
- /* 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");
333236
- 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; }
333237
- 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; }
333238
- 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; }
333239
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
333240
- 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); }
333241
- 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); }
333242
- ;
333243
- var fetchApi = typeof fetch === 'function' ? fetch : undefined;
333244
- if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.fetch) {
333245
- fetchApi = __webpack_require__.g.fetch;
333246
- } else if (typeof window !== 'undefined' && window.fetch) {
333247
- fetchApi = window.fetch;
333248
- }
333249
- var XmlHttpRequestApi;
333250
- if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.hasXMLHttpRequest)()) {
333251
- if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.XMLHttpRequest) {
333252
- XmlHttpRequestApi = __webpack_require__.g.XMLHttpRequest;
333253
- } else if (typeof window !== 'undefined' && window.XMLHttpRequest) {
333254
- XmlHttpRequestApi = window.XMLHttpRequest;
333255
- }
333256
- }
333257
- var ActiveXObjectApi;
333258
- if (typeof ActiveXObject === 'function') {
333259
- if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.ActiveXObject) {
333260
- ActiveXObjectApi = __webpack_require__.g.ActiveXObject;
333261
- } else if (typeof window !== 'undefined' && window.ActiveXObject) {
333262
- ActiveXObjectApi = window.ActiveXObject;
333263
- }
333264
- }
333265
- if (typeof fetchApi !== 'function') fetchApi = undefined;
333266
- if (!fetchApi && !XmlHttpRequestApi && !ActiveXObjectApi) {
333267
- try {
333268
- __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) {
333269
- fetchApi = mod.default;
333270
- }).catch(function () {});
333271
- } catch (e) {}
333272
- }
333273
- var UNSAFE_KEYS = ['__proto__', 'constructor', 'prototype'];
333274
- var addQueryString = function addQueryString(url, params) {
333275
- if (params && _typeof(params) === 'object') {
333276
- var queryString = '';
333277
- for (var _i = 0, _Object$keys = Object.keys(params); _i < _Object$keys.length; _i++) {
333278
- var paramName = _Object$keys[_i];
333279
- if (UNSAFE_KEYS.indexOf(paramName) > -1) continue;
333280
- queryString += '&' + encodeURIComponent(paramName) + '=' + encodeURIComponent(params[paramName]);
333281
- }
333282
- if (!queryString) return url;
333283
- url = url + (url.indexOf('?') !== -1 ? '&' : '?') + queryString.slice(1);
333284
- }
333285
- return url;
333286
- };
333287
- var fetchIt = function fetchIt(url, fetchOptions, callback, altFetch) {
333288
- var resolver = function resolver(response) {
333289
- if (!response.ok) return callback(response.statusText || 'Error', {
333290
- status: response.status
333291
- });
333292
- response.text().then(function (data) {
333293
- callback(null, {
333294
- status: response.status,
333295
- data: data
333296
- });
333297
- }).catch(callback);
333298
- };
333299
- if (altFetch) {
333300
- var altResponse = altFetch(url, fetchOptions);
333301
- if (altResponse instanceof Promise) {
333302
- altResponse.then(resolver).catch(callback);
333303
- return;
333304
- }
333305
- }
333306
- if (typeof fetch === 'function') {
333307
- fetch(url, fetchOptions).then(resolver).catch(callback);
333308
- } else {
333309
- fetchApi(url, fetchOptions).then(resolver).catch(callback);
333310
- }
333311
- };
333312
- var requestWithFetch = function requestWithFetch(options, url, payload, callback) {
333313
- if (options.queryStringParams) {
333314
- url = addQueryString(url, options.queryStringParams);
333315
- }
333316
- var headers = _objectSpread({}, typeof options.customHeaders === 'function' ? options.customHeaders() : options.customHeaders);
333317
- 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) {
333318
- 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, ")");
333319
- }
333320
- if (payload) headers['Content-Type'] = 'application/json';
333321
- var reqOptions = typeof options.requestOptions === 'function' ? options.requestOptions(payload) : options.requestOptions;
333322
- var fetchOptions = _objectSpread({
333323
- method: payload ? 'POST' : 'GET',
333324
- body: payload ? options.stringify(payload) : undefined,
333325
- headers: headers
333326
- }, options._omitFetchOptions ? {} : reqOptions);
333327
- var altFetch = typeof options.alternateFetch === 'function' && options.alternateFetch.length >= 1 ? options.alternateFetch : undefined;
333328
- try {
333329
- fetchIt(url, fetchOptions, callback, altFetch);
333330
- } catch (e) {
333331
- if (!reqOptions || Object.keys(reqOptions).length === 0 || !e.message || e.message.indexOf('not implemented') < 0) {
333332
- return callback(e);
333333
- }
333334
- try {
333335
- Object.keys(reqOptions).forEach(function (opt) {
333336
- delete fetchOptions[opt];
333337
- });
333338
- fetchIt(url, fetchOptions, callback, altFetch);
333339
- options._omitFetchOptions = true;
333340
- } catch (err) {
333341
- callback(err);
333342
- }
333343
- }
333344
- };
333345
- var requestWithXmlHttpRequest = function requestWithXmlHttpRequest(options, url, payload, callback) {
333346
- if (payload && _typeof(payload) === 'object') {
333347
- payload = addQueryString('', payload).slice(1);
333348
- }
333349
- if (options.queryStringParams) {
333350
- url = addQueryString(url, options.queryStringParams);
333351
- }
333352
- try {
333353
- var x = XmlHttpRequestApi ? new XmlHttpRequestApi() : new ActiveXObjectApi('MSXML2.XMLHTTP.3.0');
333354
- x.open(payload ? 'POST' : 'GET', url, 1);
333355
- if (!options.crossDomain) {
333356
- x.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
333357
- }
333358
- x.withCredentials = !!options.withCredentials;
333359
- if (payload) {
333360
- x.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
333361
- }
333362
- if (x.overrideMimeType) {
333363
- x.overrideMimeType('application/json');
333364
- }
333365
- var h = options.customHeaders;
333366
- h = typeof h === 'function' ? h() : h;
333367
- if (h) {
333368
- for (var _i2 = 0, _Object$keys2 = Object.keys(h); _i2 < _Object$keys2.length; _i2++) {
333369
- var i = _Object$keys2[_i2];
333370
- if (UNSAFE_KEYS.indexOf(i) > -1) continue;
333371
- x.setRequestHeader(i, h[i]);
333372
- }
333373
- }
333374
- x.onreadystatechange = function () {
333375
- x.readyState > 3 && callback(x.status >= 400 ? x.statusText : null, {
333376
- status: x.status,
333377
- data: x.responseText
333378
- });
333379
- };
333380
- x.send(payload);
333381
- } catch (e) {
333382
- console && console.log(e);
333383
- }
333384
- };
333385
- var request = function request(options, url, payload, callback) {
333386
- if (typeof payload === 'function') {
333387
- callback = payload;
333388
- payload = undefined;
333389
- }
333390
- callback = callback || function () {};
333391
- if (fetchApi && url.indexOf('file:') !== 0) {
333392
- return requestWithFetch(options, url, payload, callback);
333393
- }
333394
- if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.hasXMLHttpRequest)() || typeof ActiveXObject === 'function') {
333395
- return requestWithXmlHttpRequest(options, url, payload, callback);
333396
- }
333397
- callback(new Error('No fetch and no xhr implementation found!'));
333398
- };
333399
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (request);
333400
-
333401
- /***/ },
333402
-
333403
- /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/utils.js"
333274
+ /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@4.0.5/node_modules/i18next-http-backend/esm/index.js"
333404
333275
  /*!**********************************************************************************************************************!*\
333405
- !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/utils.js ***!
333276
+ !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@4.0.5/node_modules/i18next-http-backend/esm/index.js ***!
333406
333277
  \**********************************************************************************************************************/
333407
333278
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
333408
333279
 
333409
333280
  "use strict";
333410
333281
  __webpack_require__.r(__webpack_exports__);
333411
333282
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
333412
- /* harmony export */ defaults: () => (/* binding */ defaults),
333413
- /* harmony export */ hasXMLHttpRequest: () => (/* binding */ hasXMLHttpRequest),
333414
- /* harmony export */ interpolate: () => (/* binding */ interpolate),
333415
- /* harmony export */ interpolateUrl: () => (/* binding */ interpolateUrl),
333416
- /* harmony export */ isSafeLangUrlSegment: () => (/* binding */ isSafeLangUrlSegment),
333417
- /* harmony export */ isSafeNsUrlSegment: () => (/* binding */ isSafeNsUrlSegment),
333418
- /* harmony export */ isSafeUrlSegment: () => (/* binding */ isSafeUrlSegment),
333419
- /* harmony export */ makePromise: () => (/* binding */ makePromise),
333420
- /* harmony export */ redactUrlCredentials: () => (/* binding */ redactUrlCredentials),
333421
- /* harmony export */ sanitizeLogValue: () => (/* binding */ sanitizeLogValue)
333283
+ /* harmony export */ "default": () => (/* binding */ Backend)
333422
333284
  /* harmony export */ });
333423
- 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; } } }; }
333424
- 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; } }
333425
- 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; }
333426
- 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); }
333427
- var arr = [];
333428
- var each = arr.forEach;
333429
- var slice = arr.slice;
333430
- var UNSAFE_KEYS = ['__proto__', 'constructor', 'prototype'];
333431
- function defaults(obj) {
333432
- each.call(slice.call(arguments, 1), function (source) {
333433
- if (source) {
333434
- for (var _i = 0, _Object$keys = Object.keys(source); _i < _Object$keys.length; _i++) {
333435
- var prop = _Object$keys[_i];
333436
- if (UNSAFE_KEYS.indexOf(prop) > -1) continue;
333437
- if (obj[prop] === undefined) obj[prop] = source[prop];
333438
- }
333439
- }
333440
- });
333441
- return obj;
333442
- }
333285
+ //#region lib/utils.js
333286
+ const arr = [];
333287
+ arr.forEach;
333288
+ arr.slice;
333289
+ const UNSAFE_KEYS$1 = [
333290
+ "__proto__",
333291
+ "constructor",
333292
+ "prototype"
333293
+ ];
333443
333294
  function isSafeUrlSegmentBase(v) {
333444
- if (typeof v !== 'string') return false;
333445
- if (v.length === 0 || v.length > 128) return false;
333446
- if (UNSAFE_KEYS.indexOf(v) > -1) return false;
333447
- if (v.indexOf('..') > -1) return false;
333448
- if (v.indexOf('\\') > -1) return false;
333449
- if (/[?#%\s@]/.test(v)) return false;
333450
- if (/[\x00-\x1F\x7F]/.test(v)) return false;
333451
- return true;
333295
+ if (typeof v !== "string") return false;
333296
+ if (v.length === 0 || v.length > 128) return false;
333297
+ if (UNSAFE_KEYS$1.indexOf(v) > -1) return false;
333298
+ if (v.indexOf("..") > -1) return false;
333299
+ if (v.indexOf("\\") > -1) return false;
333300
+ if (/[?#%:&=;\s]/.test(v)) return false;
333301
+ if (/[\x00-\x1F\x7F]/.test(v)) return false;
333302
+ return true;
333452
333303
  }
333453
333304
  function isSafeLangUrlSegment(v) {
333454
- if (!isSafeUrlSegmentBase(v)) return false;
333455
- if (v.indexOf('/') > -1) return false;
333456
- return true;
333305
+ if (!isSafeUrlSegmentBase(v)) return false;
333306
+ if (v.indexOf("/") > -1 || v.indexOf("@") > -1) return false;
333307
+ return true;
333457
333308
  }
333458
333309
  function isSafeNsUrlSegment(v) {
333459
- return isSafeUrlSegmentBase(v);
333310
+ if (!isSafeUrlSegmentBase(v)) return false;
333311
+ if (v.indexOf("//") > -1) return false;
333312
+ return true;
333460
333313
  }
333461
- var isSafeUrlSegment = isSafeLangUrlSegment;
333462
- var SAFETY_CHECK_BY_KEY = {
333463
- lng: isSafeLangUrlSegment,
333464
- ns: isSafeNsUrlSegment
333314
+ const SAFETY_CHECK_BY_KEY = {
333315
+ lng: isSafeLangUrlSegment,
333316
+ ns: isSafeNsUrlSegment
333465
333317
  };
333466
333318
  function sanitizeLogValue(v) {
333467
- if (typeof v !== 'string') return v;
333468
- return v.replace(/[\r\n\x00-\x1F\x7F]/g, ' ');
333319
+ if (typeof v !== "string") return v;
333320
+ return v.replace(/[\r\n\x00-\x1F\x7F]/g, " ");
333469
333321
  }
333470
333322
  function redactUrlCredentials(u) {
333471
- if (typeof u !== 'string' || u.length === 0) return u;
333472
- try {
333473
- var parsed = new URL(u);
333474
- if (parsed.username || parsed.password) {
333475
- parsed.username = '';
333476
- parsed.password = '';
333477
- return parsed.toString();
333478
- }
333479
- return u;
333480
- } catch (e) {
333481
- return u.replace(/(\/\/)[^/@\s]+@/g, '$1');
333482
- }
333323
+ if (typeof u !== "string" || u.length === 0) return u;
333324
+ try {
333325
+ const parsed = new URL(u);
333326
+ if (parsed.username || parsed.password) {
333327
+ parsed.username = "";
333328
+ parsed.password = "";
333329
+ return parsed.toString();
333330
+ }
333331
+ return u;
333332
+ } catch (e) {
333333
+ return u.replace(/(\/\/)[^/@\s]+@/g, "$1");
333334
+ }
333483
333335
  }
333484
333336
  function hasXMLHttpRequest() {
333485
- return typeof XMLHttpRequest === 'function' || (typeof XMLHttpRequest === "undefined" ? "undefined" : _typeof(XMLHttpRequest)) === 'object';
333337
+ return typeof XMLHttpRequest === "function" || typeof XMLHttpRequest === "object";
333486
333338
  }
333339
+ /**
333340
+ * Determine whether the given `maybePromise` is a Promise.
333341
+ *
333342
+ * @param {*} maybePromise
333343
+ *
333344
+ * @returns {Boolean}
333345
+ */
333487
333346
  function isPromise(maybePromise) {
333488
- return !!maybePromise && typeof maybePromise.then === 'function';
333347
+ return !!maybePromise && typeof maybePromise.then === "function";
333489
333348
  }
333349
+ /**
333350
+ * Convert any value to a Promise than will resolve to this value.
333351
+ *
333352
+ * @param {*} maybePromise
333353
+ *
333354
+ * @returns {Promise}
333355
+ */
333490
333356
  function makePromise(maybePromise) {
333491
- if (isPromise(maybePromise)) {
333492
- return maybePromise;
333493
- }
333494
- return Promise.resolve(maybePromise);
333495
- }
333496
- var interpolationRegexp = /\{\{(.+?)\}\}/g;
333497
- function interpolate(str, data) {
333498
- return str.replace(interpolationRegexp, function (match, key) {
333499
- var k = key.trim();
333500
- if (UNSAFE_KEYS.indexOf(k) > -1) return match;
333501
- var value = data[k];
333502
- return value != null ? value : match;
333503
- });
333357
+ if (isPromise(maybePromise)) return maybePromise;
333358
+ return Promise.resolve(maybePromise);
333504
333359
  }
333360
+ const interpolationRegexp = /\{\{(.+?)\}\}/g;
333361
+ const LEADING_DOUBLE_SLASH = /^[/\\]{2}/;
333505
333362
  function interpolateUrl(str, data) {
333506
- var unsafe = false;
333507
- var result = str.replace(interpolationRegexp, function (match, key) {
333508
- var k = key.trim();
333509
- if (UNSAFE_KEYS.indexOf(k) > -1) return match;
333510
- var value = data[k];
333511
- if (value == null) return match;
333512
- var check = SAFETY_CHECK_BY_KEY[k] || isSafeLangUrlSegment;
333513
- var segments = String(value).split('+');
333514
- var _iterator = _createForOfIteratorHelper(segments),
333515
- _step;
333516
- try {
333517
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
333518
- var seg = _step.value;
333519
- if (!check(seg)) {
333520
- unsafe = true;
333521
- return match;
333522
- }
333523
- }
333524
- } catch (err) {
333525
- _iterator.e(err);
333526
- } finally {
333527
- _iterator.f();
333528
- }
333529
- return segments.join('+');
333530
- });
333531
- return unsafe ? null : result;
333532
- }
333363
+ let unsafe = false;
333364
+ const result = str.replace(interpolationRegexp, (match, key) => {
333365
+ const k = key.trim();
333366
+ if (UNSAFE_KEYS$1.indexOf(k) > -1) return match;
333367
+ const value = data[k];
333368
+ if (value == null) return match;
333369
+ const check = SAFETY_CHECK_BY_KEY[k] || isSafeLangUrlSegment;
333370
+ const segments = String(value).split("+");
333371
+ for (const seg of segments) if (!check(seg)) {
333372
+ unsafe = true;
333373
+ return match;
333374
+ }
333375
+ return segments.join("+");
333376
+ });
333377
+ if (unsafe) return null;
333378
+ if (LEADING_DOUBLE_SLASH.test(result) && !LEADING_DOUBLE_SLASH.test(str)) return null;
333379
+ return result;
333380
+ }
333381
+ //#endregion
333382
+ //#region lib/request.js
333383
+ const g = typeof globalThis !== "undefined" ? globalThis : typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof window !== "undefined" ? window : void 0;
333384
+ let fetchApi;
333385
+ if (typeof fetch === "function") fetchApi = fetch;
333386
+ else if (g && typeof g.fetch === "function") fetchApi = g.fetch;
333387
+ const XmlHttpRequestApi = hasXMLHttpRequest() && g ? g.XMLHttpRequest : void 0;
333388
+ const ActiveXObjectApi = typeof ActiveXObject === "function" && g ? g.ActiveXObject : void 0;
333389
+ const UNSAFE_KEYS = [
333390
+ "__proto__",
333391
+ "constructor",
333392
+ "prototype"
333393
+ ];
333394
+ const addQueryString = (url, params) => {
333395
+ if (params && typeof params === "object") {
333396
+ let queryString = "";
333397
+ for (const paramName of Object.keys(params)) {
333398
+ if (UNSAFE_KEYS.indexOf(paramName) > -1) continue;
333399
+ queryString += "&" + encodeURIComponent(paramName) + "=" + encodeURIComponent(params[paramName]);
333400
+ }
333401
+ if (!queryString) return url;
333402
+ url = url + (url.indexOf("?") !== -1 ? "&" : "?") + queryString.slice(1);
333403
+ }
333404
+ return url;
333405
+ };
333406
+ const fetchIt = (url, fetchOptions, callback, altFetch) => {
333407
+ const resolver = (response) => {
333408
+ if (!response.ok) return callback(response.statusText || "Error", { status: response.status });
333409
+ response.text().then((data) => {
333410
+ callback(null, {
333411
+ status: response.status,
333412
+ data
333413
+ });
333414
+ }).catch(callback);
333415
+ };
333416
+ if (altFetch) {
333417
+ const altResponse = altFetch(url, fetchOptions);
333418
+ if (altResponse instanceof Promise) {
333419
+ altResponse.then(resolver).catch(callback);
333420
+ return;
333421
+ }
333422
+ }
333423
+ if (typeof fetch === "function") fetch(url, fetchOptions).then(resolver).catch(callback);
333424
+ else fetchApi(url, fetchOptions).then(resolver).catch(callback);
333425
+ };
333426
+ const requestWithFetch = (options, url, payload, callback) => {
333427
+ if (options.queryStringParams) url = addQueryString(url, options.queryStringParams);
333428
+ const headers = { ...typeof options.customHeaders === "function" ? options.customHeaders() : options.customHeaders };
333429
+ 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})`;
333430
+ if (payload) headers["Content-Type"] = "application/json";
333431
+ const reqOptions = typeof options.requestOptions === "function" ? options.requestOptions(payload) : options.requestOptions;
333432
+ const fetchOptions = {
333433
+ method: payload ? "POST" : "GET",
333434
+ body: payload ? options.stringify(payload) : void 0,
333435
+ headers,
333436
+ ...options._omitFetchOptions ? {} : reqOptions
333437
+ };
333438
+ const altFetch = typeof options.alternateFetch === "function" && options.alternateFetch.length >= 1 ? options.alternateFetch : void 0;
333439
+ try {
333440
+ fetchIt(url, fetchOptions, callback, altFetch);
333441
+ } catch (e) {
333442
+ if (!reqOptions || Object.keys(reqOptions).length === 0 || !e.message || e.message.indexOf("not implemented") < 0) return callback(e);
333443
+ try {
333444
+ Object.keys(reqOptions).forEach((opt) => {
333445
+ delete fetchOptions[opt];
333446
+ });
333447
+ fetchIt(url, fetchOptions, callback, altFetch);
333448
+ options._omitFetchOptions = true;
333449
+ } catch (err) {
333450
+ callback(err);
333451
+ }
333452
+ }
333453
+ };
333454
+ const requestWithXmlHttpRequest = (options, url, payload, callback) => {
333455
+ if (payload && typeof payload === "object") payload = addQueryString("", payload).slice(1);
333456
+ if (options.queryStringParams) url = addQueryString(url, options.queryStringParams);
333457
+ try {
333458
+ const x = XmlHttpRequestApi ? new XmlHttpRequestApi() : new ActiveXObjectApi("MSXML2.XMLHTTP.3.0");
333459
+ x.open(payload ? "POST" : "GET", url, 1);
333460
+ if (!options.crossDomain) x.setRequestHeader("X-Requested-With", "XMLHttpRequest");
333461
+ x.withCredentials = !!options.withCredentials;
333462
+ if (payload) x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
333463
+ if (x.overrideMimeType) x.overrideMimeType("application/json");
333464
+ let h = options.customHeaders;
333465
+ h = typeof h === "function" ? h() : h;
333466
+ if (h) for (const i of Object.keys(h)) {
333467
+ if (UNSAFE_KEYS.indexOf(i) > -1) continue;
333468
+ x.setRequestHeader(i, h[i]);
333469
+ }
333470
+ x.onreadystatechange = () => {
333471
+ x.readyState > 3 && callback(x.status >= 400 ? x.statusText : null, {
333472
+ status: x.status,
333473
+ data: x.responseText
333474
+ });
333475
+ };
333476
+ x.send(payload);
333477
+ } catch (e) {
333478
+ console && console.log(e);
333479
+ }
333480
+ };
333481
+ const request = (options, url, payload, callback) => {
333482
+ if (typeof payload === "function") {
333483
+ callback = payload;
333484
+ payload = void 0;
333485
+ }
333486
+ callback = callback || (() => {});
333487
+ if (fetchApi && url.indexOf("file:") !== 0) return requestWithFetch(options, url, payload, callback);
333488
+ if (hasXMLHttpRequest() || typeof ActiveXObject === "function") return requestWithXmlHttpRequest(options, url, payload, callback);
333489
+ callback(/* @__PURE__ */ new Error("No fetch and no xhr implementation found!"));
333490
+ };
333491
+ //#endregion
333492
+ //#region lib/index.js
333493
+ const getDefaults = () => {
333494
+ return {
333495
+ loadPath: "/locales/{{lng}}/{{ns}}.json",
333496
+ addPath: "/locales/add/{{lng}}/{{ns}}",
333497
+ parse: (data) => JSON.parse(data),
333498
+ stringify: JSON.stringify,
333499
+ parsePayload: (namespace, key, fallbackValue) => ({ [key]: fallbackValue || "" }),
333500
+ parseLoadPayload: (languages, namespaces) => void 0,
333501
+ request,
333502
+ reloadInterval: typeof window !== "undefined" ? false : 3600 * 1e3,
333503
+ customHeaders: {},
333504
+ queryStringParams: {},
333505
+ crossDomain: false,
333506
+ withCredentials: false,
333507
+ overrideMimeType: false,
333508
+ requestOptions: {
333509
+ mode: "cors",
333510
+ credentials: "same-origin",
333511
+ cache: "default"
333512
+ }
333513
+ };
333514
+ };
333515
+ var Backend = class {
333516
+ constructor(services, options = {}, allOptions = {}) {
333517
+ this.services = services;
333518
+ this.options = options;
333519
+ this.allOptions = allOptions;
333520
+ this.type = "backend";
333521
+ this.init(services, options, allOptions);
333522
+ }
333523
+ init(services, options = {}, allOptions = {}) {
333524
+ this.services = services;
333525
+ this.options = {
333526
+ ...getDefaults(),
333527
+ ...this.options || {},
333528
+ ...options
333529
+ };
333530
+ this.allOptions = allOptions;
333531
+ if (this.services && this.options.reloadInterval) {
333532
+ const timer = setInterval(() => this.reload(), this.options.reloadInterval);
333533
+ if (typeof timer === "object" && typeof timer.unref === "function") timer.unref();
333534
+ }
333535
+ }
333536
+ readMulti(languages, namespaces, callback) {
333537
+ this._readAny(languages, languages, namespaces, namespaces, callback);
333538
+ }
333539
+ read(language, namespace, callback) {
333540
+ this._readAny([language], language, [namespace], namespace, callback);
333541
+ }
333542
+ _readAny(languages, loadUrlLanguages, namespaces, loadUrlNamespaces, callback) {
333543
+ let loadPath = this.options.loadPath;
333544
+ if (typeof this.options.loadPath === "function") loadPath = this.options.loadPath(languages, namespaces);
333545
+ loadPath = makePromise(loadPath);
333546
+ loadPath.then((resolvedLoadPath) => {
333547
+ if (!resolvedLoadPath) return callback(null, {});
333548
+ const url = interpolateUrl(resolvedLoadPath, {
333549
+ lng: languages.join("+"),
333550
+ ns: namespaces.join("+")
333551
+ });
333552
+ if (url == null) {
333553
+ const safeLngs = languages.map(sanitizeLogValue).join(", ");
333554
+ const safeNss = namespaces.map(sanitizeLogValue).join(", ");
333555
+ return callback(/* @__PURE__ */ new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=[" + safeLngs + "] namespaces=[" + safeNss + "]"), false);
333556
+ }
333557
+ this.loadUrl(url, callback, loadUrlLanguages, loadUrlNamespaces);
333558
+ }, (err) => callback(err, false));
333559
+ }
333560
+ loadUrl(url, callback, languages, namespaces) {
333561
+ const lng = typeof languages === "string" ? [languages] : languages;
333562
+ const ns = typeof namespaces === "string" ? [namespaces] : namespaces;
333563
+ const payload = this.options.parseLoadPayload(lng, ns);
333564
+ const safeUrl = sanitizeLogValue(redactUrlCredentials(url));
333565
+ this.options.request(this.options, url, payload, (err, res) => {
333566
+ if (res && (res.status >= 500 && res.status < 600 || !res.status)) return callback("failed loading " + safeUrl + "; status code: " + res.status, true);
333567
+ if (res && res.status >= 400 && res.status < 500) return callback("failed loading " + safeUrl + "; status code: " + res.status, false);
333568
+ if (!res && err && err.message) {
333569
+ const errorMessage = err.message.toLowerCase();
333570
+ if ([
333571
+ "failed",
333572
+ "fetch",
333573
+ "network",
333574
+ "load"
333575
+ ].find((term) => errorMessage.indexOf(term) > -1)) return callback("failed loading " + safeUrl + ": " + sanitizeLogValue(err.message), true);
333576
+ }
333577
+ if (err) return callback(err, false);
333578
+ let ret, parseErr;
333579
+ try {
333580
+ if (typeof res.data === "string") ret = this.options.parse(res.data, languages, namespaces);
333581
+ else ret = res.data;
333582
+ } catch (e) {
333583
+ parseErr = "failed parsing " + safeUrl + " to json";
333584
+ }
333585
+ if (parseErr) return callback(parseErr, false);
333586
+ callback(null, ret);
333587
+ });
333588
+ }
333589
+ create(languages, namespace, key, fallbackValue, callback) {
333590
+ if (!this.options.addPath) return;
333591
+ if (typeof languages === "string") languages = [languages];
333592
+ const payload = this.options.parsePayload(namespace, key, fallbackValue);
333593
+ let finished = 0;
333594
+ const dataArray = [];
333595
+ const resArray = [];
333596
+ languages.forEach((lng) => {
333597
+ let addPath = this.options.addPath;
333598
+ if (typeof this.options.addPath === "function") addPath = this.options.addPath(lng, namespace);
333599
+ const url = interpolateUrl(addPath, {
333600
+ lng,
333601
+ ns: namespace
333602
+ });
333603
+ if (url == null) {
333604
+ finished += 1;
333605
+ if (callback && finished === languages.length) callback(dataArray, resArray);
333606
+ return;
333607
+ }
333608
+ this.options.request(this.options, url, payload, (data, res) => {
333609
+ finished += 1;
333610
+ dataArray.push(data);
333611
+ resArray.push(res);
333612
+ if (finished === languages.length) {
333613
+ if (typeof callback === "function") callback(dataArray, resArray);
333614
+ }
333615
+ });
333616
+ });
333617
+ }
333618
+ reload() {
333619
+ const { backendConnector, languageUtils, logger } = this.services;
333620
+ const currentLanguage = backendConnector.language;
333621
+ if (currentLanguage && currentLanguage.toLowerCase() === "cimode") return;
333622
+ const toLoad = [];
333623
+ const append = (lng) => {
333624
+ languageUtils.toResolveHierarchy(lng).forEach((l) => {
333625
+ if (toLoad.indexOf(l) < 0) toLoad.push(l);
333626
+ });
333627
+ };
333628
+ append(currentLanguage);
333629
+ if (this.allOptions.preload) this.allOptions.preload.forEach((l) => append(l));
333630
+ toLoad.forEach((lng) => {
333631
+ this.allOptions.ns.forEach((ns) => {
333632
+ backendConnector.read(lng, ns, "read", null, null, (err, data) => {
333633
+ if (err) logger.warn(`loading namespace ${ns} for language ${lng} failed`, err);
333634
+ if (!err && data) logger.log(`loaded namespace ${ns} for language ${lng}`, data);
333635
+ backendConnector.loaded(`${lng}|${ns}`, err, data);
333636
+ });
333637
+ });
333638
+ });
333639
+ }
333640
+ };
333641
+ Backend.type = "backend";
333642
+ //#endregion
333643
+
333644
+
333533
333645
 
333534
333646
  /***/ },
333535
333647
 
@@ -337598,7 +337710,7 @@ class WMS {
337598
337710
  (module) {
337599
337711
 
337600
337712
  "use strict";
337601
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.15.0-dev.7","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"}}');
337713
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.16.0-dev.2","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"}}');
337602
337714
 
337603
337715
  /***/ },
337604
337716
 
@@ -337659,36 +337771,6 @@ module.exports = /*#__PURE__*/JSON.parse('{"version":"01.00.00","sourceEcSchemaV
337659
337771
  /******/ return getter;
337660
337772
  /******/ };
337661
337773
  /******/
337662
- /******/ /* webpack/runtime/create fake namespace object */
337663
- /******/ (() => {
337664
- /******/ const getProto = Object.getPrototypeOf;
337665
- /******/ let leafPrototypes;
337666
- /******/ // create a fake namespace object
337667
- /******/ // mode & 1: value is a module id, require it
337668
- /******/ // mode & 2: merge all properties of value into the ns
337669
- /******/ // mode & 4: return value when already ns object
337670
- /******/ // mode & 16: return value when it's Promise-like
337671
- /******/ // mode & 8|1: behave like require
337672
- /******/ __webpack_require__.t = function(value, mode) {
337673
- /******/ if(mode & 1) value = this(value);
337674
- /******/ if(mode & 8) return value;
337675
- /******/ if(typeof value === 'object' && value) {
337676
- /******/ if((mode & 4) && value.__esModule) return value;
337677
- /******/ if((mode & 16) && typeof value.then === 'function') return value;
337678
- /******/ }
337679
- /******/ const ns = Object.create(null);
337680
- /******/ __webpack_require__.r(ns);
337681
- /******/ const def = {};
337682
- /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
337683
- /******/ for(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {
337684
- /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
337685
- /******/ }
337686
- /******/ def['default'] = () => (value);
337687
- /******/ __webpack_require__.d(ns, def);
337688
- /******/ return ns;
337689
- /******/ };
337690
- /******/ })();
337691
- /******/
337692
337774
  /******/ /* webpack/runtime/define property getters */
337693
337775
  /******/ // define getter/value functions for harmony exports
337694
337776
  /******/ __webpack_require__.d = (exports, definition) => {