@sinequa/atomic 2.7.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/README.md +84 -68
  2. package/dist/atomic.cjs +1 -1
  3. package/dist/atomic.js +1 -2
  4. package/dist/authentication/constants.d.ts.map +1 -1
  5. package/dist/authentication/events/auth-events.d.ts +25 -0
  6. package/dist/authentication/events/auth-events.d.ts.map +1 -1
  7. package/dist/authentication/events/emit-authenticated-event.d.ts.map +1 -1
  8. package/dist/authentication/events/index.d.ts +1 -1
  9. package/dist/authentication/events/index.d.ts.map +1 -1
  10. package/dist/authentication/index.d.ts +1 -1
  11. package/dist/authentication/index.d.ts.map +1 -1
  12. package/dist/authentication/providers/oauth-authentication.d.ts.map +1 -1
  13. package/dist/authentication/providers/redirect-to-identity-provider.d.ts.map +1 -1
  14. package/dist/authentication/providers/saml-authentication.d.ts.map +1 -1
  15. package/dist/authentication/session/auth-mode-marker.d.ts.map +1 -1
  16. package/dist/authentication/session/auth-state.d.ts.map +1 -1
  17. package/dist/authentication/session/has-session.d.ts.map +1 -1
  18. package/dist/authentication/session/login.d.ts.map +1 -1
  19. package/dist/authentication/session/logout.d.ts.map +1 -1
  20. package/dist/authentication/session/redirect-guard.d.ts.map +1 -1
  21. package/dist/authentication/session/session-lost-latch.d.ts +32 -0
  22. package/dist/authentication/session/session-lost-latch.d.ts.map +1 -0
  23. package/dist/authentication/session/try-auto-authentication.d.ts.map +1 -1
  24. package/dist/authentication/session/user-authentication.d.ts.map +1 -1
  25. package/dist/authentication/tokens/delete-web-token-cookie.d.ts.map +1 -1
  26. package/dist/authentication/tokens/get-csrf-token.d.ts.map +1 -1
  27. package/dist/authentication/tokens/get-jwt-token.d.ts.map +1 -1
  28. package/dist/authentication/tokens/get-token.d.ts.map +1 -1
  29. package/dist/authentication/tokens/set-token.d.ts.map +1 -1
  30. package/dist/client/atomic-context.d.ts.map +1 -1
  31. package/dist/client/create-api.d.ts +8 -8
  32. package/dist/client/create-api.d.ts.map +1 -1
  33. package/dist/client/create-atomic-client.d.ts.map +1 -1
  34. package/dist/client/http-adapter.d.ts.map +1 -1
  35. package/dist/configurations/auth-mode.d.ts.map +1 -1
  36. package/dist/configurations/global.config.d.ts.map +1 -1
  37. package/dist/configurations/index.d.ts +1 -1
  38. package/dist/configurations/index.d.ts.map +1 -1
  39. package/dist/helpers/column-resolver.d.ts.map +1 -1
  40. package/dist/helpers/columns.d.ts.map +1 -1
  41. package/dist/helpers/filters.d.ts.map +1 -1
  42. package/dist/helpers/metadata.d.ts.map +1 -1
  43. package/dist/helpers/utils.d.ts.map +1 -1
  44. package/dist/polyfills/storage.d.ts.map +1 -1
  45. package/dist/spfx/index.cjs +1 -1
  46. package/dist/spfx/index.js +1 -2
  47. package/dist/src-CIXEwWsl.cjs +1 -0
  48. package/dist/{src-BowomHL9.js → src-DHcYZVfw.js} +687 -622
  49. package/dist/types/agent-workspace/index.d.ts +4 -0
  50. package/dist/types/{document-upload → agent-workspace}/index.d.ts.map +1 -1
  51. package/dist/types/{document-upload → agent-workspace}/upload-status.d.ts +8 -8
  52. package/dist/types/agent-workspace/upload-status.d.ts.map +1 -0
  53. package/dist/types/{document-upload/container-document.d.ts → agent-workspace/workspace-document.d.ts} +8 -8
  54. package/dist/types/{document-upload/container-document.d.ts.map → agent-workspace/workspace-document.d.ts.map} +1 -1
  55. package/dist/types/agent-workspace/workspace.d.ts +31 -0
  56. package/dist/types/{document-upload/container.d.ts.map → agent-workspace/workspace.d.ts.map} +1 -1
  57. package/dist/types/aggregations/AggregationItem.d.ts.map +1 -1
  58. package/dist/types/api-endpoints.d.ts +1 -1
  59. package/dist/types/config/EngineTypeModifier.d.ts.map +1 -1
  60. package/dist/types/config/QueryPrecision.d.ts.map +1 -1
  61. package/dist/types/filters/Filter.d.ts.map +1 -1
  62. package/dist/types/index.d.ts +1 -1
  63. package/dist/types/search/index.d.ts +1 -1
  64. package/dist/types/search/index.d.ts.map +1 -1
  65. package/dist/utils/aggregations.d.ts.map +1 -1
  66. package/dist/utils/bisect.d.ts.map +1 -1
  67. package/dist/utils/concepts.d.ts.map +1 -1
  68. package/dist/utils/date.d.ts.map +1 -1
  69. package/dist/utils/index.d.ts +1 -1
  70. package/dist/utils/index.d.ts.map +1 -1
  71. package/dist/utils/is-not-input-event.d.ts.map +1 -1
  72. package/dist/utils/logger.d.ts.map +1 -1
  73. package/dist/utils/query-params.d.ts.map +1 -1
  74. package/dist/utils/utilities.d.ts.map +1 -1
  75. package/dist/web-api/helpers/aad-http-client-manager.d.ts.map +1 -1
  76. package/dist/web-api/helpers/create-headers.d.ts.map +1 -1
  77. package/dist/web-api/helpers/handle-response.d.ts.map +1 -1
  78. package/dist/web-api/helpers/methods/del.d.ts.map +1 -1
  79. package/dist/web-api/helpers/methods/get.d.ts.map +1 -1
  80. package/dist/web-api/helpers/methods/patch.d.ts.map +1 -1
  81. package/dist/web-api/helpers/methods/post.d.ts.map +1 -1
  82. package/dist/web-api/helpers/methods/put.d.ts.map +1 -1
  83. package/dist/web-api/helpers/methods/send-request.d.ts +5 -0
  84. package/dist/web-api/helpers/methods/send-request.d.ts.map +1 -1
  85. package/dist/web-api/helpers/utils/build-request-url.d.ts.map +1 -1
  86. package/dist/web-api/helpers/utils/create-timeout-controller.d.ts.map +1 -1
  87. package/dist/web-api/helpers/utils/resolve-no-auto-authentication.d.ts.map +1 -1
  88. package/dist/web-api/index.d.ts +2 -2
  89. package/dist/web-api/index.d.ts.map +1 -1
  90. package/dist/web-api/v1/fetch-aggregation.d.ts.map +1 -1
  91. package/dist/web-api/v1/fetch-app.d.ts.map +1 -1
  92. package/dist/web-api/v1/fetch-audit.d.ts.map +1 -1
  93. package/dist/web-api/v1/fetch-dataset.d.ts.map +1 -1
  94. package/dist/web-api/v1/fetch-labels.d.ts.map +1 -1
  95. package/dist/web-api/v1/fetch-preview.d.ts.map +1 -1
  96. package/dist/web-api/v1/fetch-principal.d.ts.map +1 -1
  97. package/dist/web-api/v1/fetch-query-export.d.ts.map +1 -1
  98. package/dist/web-api/v1/fetch-query-intent.d.ts.map +1 -1
  99. package/dist/web-api/v1/fetch-query.d.ts.map +1 -1
  100. package/dist/web-api/v1/fetch-security-principal.d.ts +1 -1
  101. package/dist/web-api/v1/fetch-security-principal.d.ts.map +1 -1
  102. package/dist/web-api/v1/fetch-similar-documents.d.ts.map +1 -1
  103. package/dist/web-api/v1/fetch-sponsored-links.d.ts.map +1 -1
  104. package/dist/web-api/v1/fetch-suggest.d.ts.map +1 -1
  105. package/dist/web-api/v1/fetch-text-chunk.d.ts.map +1 -1
  106. package/dist/web-api/v1/fetch-user-settings.d.ts.map +1 -1
  107. package/dist/web-api/v2/{fetch-document-upload-status.d.ts → fetch-agent-workspace-status.d.ts} +4 -4
  108. package/dist/web-api/v2/{fetch-document-upload-status.d.ts.map → fetch-agent-workspace-status.d.ts.map} +1 -1
  109. package/dist/web-api/v2/fetch-agent-workspace.d.ts +100 -0
  110. package/dist/web-api/v2/fetch-agent-workspace.d.ts.map +1 -0
  111. package/dist/web-api/v2/fetch-change-password.d.ts.map +1 -1
  112. package/dist/web-api/v2/fetch-forgot-password.d.ts.map +1 -1
  113. package/dist/web-api/v2/fetch-user-profile.d.ts.map +1 -1
  114. package/dist/web-api/v2/fetch-version.d.ts.map +1 -1
  115. package/package.json +24 -34
  116. package/dist/src-BS1kfBgv.cjs +0 -1
  117. package/dist/types/document-upload/container.d.ts +0 -31
  118. package/dist/types/document-upload/index.d.ts +0 -4
  119. package/dist/types/document-upload/upload-status.d.ts.map +0 -1
  120. package/dist/web-api/v2/fetch-document-upload-container.d.ts +0 -98
  121. package/dist/web-api/v2/fetch-document-upload-container.d.ts.map +0 -1
@@ -118,15 +118,11 @@ function ie(e) {
118
118
  }
119
119
  function ae(e, t) {
120
120
  let { useCredentials: n, useSSO: r, useSAML: i, authMode: a, ...o } = t;
121
- if (Object.assign(e, o), a !== void 0) {
122
- e.authMode = a;
123
- return;
124
- }
125
- (n !== void 0 || r !== void 0 || i !== void 0) && (e.authMode = re({
121
+ Object.assign(e, o), a === void 0 ? (n !== void 0 || r !== void 0 || i !== void 0) && (e.authMode = re({
126
122
  useCredentials: n,
127
123
  useSSO: r,
128
124
  useSAML: i
129
- }, e));
125
+ }, e)) : e.authMode = a;
130
126
  }
131
127
  //#endregion
132
128
  //#region src/configurations/auth-options.ts
@@ -250,21 +246,51 @@ function b(e, t) {
250
246
  ae(e.config, t);
251
247
  }
252
248
  //#endregion
253
- //#region src/authentication/session/signed-out-guard.ts
254
- var ge = /* @__PURE__ */ new WeakSet();
249
+ //#region src/authentication/session/session-lost-latch.ts
250
+ var ge = /* @__PURE__ */ new WeakMap();
251
+ function x(e) {
252
+ let t = ge.get(e);
253
+ return t || (t = {
254
+ epoch: 0,
255
+ claimed: !1,
256
+ claimedAt: 0,
257
+ establishedAt: 0
258
+ }, ge.set(e, t)), t;
259
+ }
255
260
  function _e(e) {
256
- ge.add(e);
261
+ return x(e).epoch;
257
262
  }
258
- function ve(e) {
259
- return ge.has(e);
263
+ function ve(e, t) {
264
+ let n = x(e);
265
+ return n.claimed || t < n.establishedAt ? !1 : (n.claimed = !0, n.claimedAt = ++n.epoch, !0);
260
266
  }
261
267
  function ye(e) {
262
- ge.delete(e);
268
+ let t = x(e);
269
+ t.claimed = !1, t.establishedAt = ++t.epoch;
270
+ }
271
+ function be(e, t) {
272
+ x(e).establishedAt <= t && ye(e);
273
+ }
274
+ function xe(e, t) {
275
+ let n = x(e);
276
+ n.claimed && t >= n.claimedAt && (n.claimed = !1);
277
+ }
278
+ //#endregion
279
+ //#region src/authentication/session/signed-out-guard.ts
280
+ var Se = /* @__PURE__ */ new WeakSet();
281
+ function Ce(e) {
282
+ Se.add(e);
283
+ }
284
+ function we(e) {
285
+ return Se.has(e);
286
+ }
287
+ function Te(e) {
288
+ Se.delete(e);
263
289
  }
264
290
  //#endregion
265
291
  //#region src/authentication/events/emit-authenticated-event.ts
266
- function x(e, t) {
267
- if (t && ye(e), e.events.emit("authenticated", { authenticated: t }), typeof CustomEvent > "u") return;
292
+ function S(e, t) {
293
+ if (t && (Te(e), ye(e)), e.events.emit("authenticated", { authenticated: t }), typeof CustomEvent > "u") return;
268
294
  let n = new CustomEvent("authenticated", {
269
295
  bubbles: !0,
270
296
  cancelable: !1,
@@ -272,67 +298,67 @@ function x(e, t) {
272
298
  });
273
299
  typeof document < "u" ? document.dispatchEvent(n) : typeof dispatchEvent < "u" && dispatchEvent(n);
274
300
  }
275
- function be(e) {
276
- x(g, e);
301
+ function Ee(e) {
302
+ S(g, e);
277
303
  }
278
- var S = (e) => e.config.auth?.timeoutMs ?? 1e4, C = {
304
+ var C = (e) => e.config.auth?.timeoutMs ?? 1e4, w = {
279
305
  credentials: "sinequa-credentials",
280
306
  legacyCsrfToken: "csrfToken",
281
307
  authenticated: "sinequa-authenticated",
282
308
  lastAuthMode: "sinequa-last-auth-mode"
283
- }, w = "sinequa-auth-redirect-attempt", T = (e) => {
284
- let t = v(e, "session").get(y(e, C.credentials));
309
+ }, T = "sinequa-auth-redirect-attempt", E = (e) => {
310
+ let t = v(e, "session").get(y(e, w.credentials));
285
311
  if (t) try {
286
312
  let e = JSON.parse(t).data?.csrfToken;
287
313
  if (typeof e == "string" && e) return e;
288
314
  } catch (t) {
289
315
  _(e).warn("Failed to parse session storage credentials, falling back to local storage", t);
290
316
  }
291
- return v(e, "local").get(y(e, C.legacyCsrfToken)) || null;
292
- }, xe = () => T(g);
317
+ return v(e, "local").get(y(e, w.legacyCsrfToken)) || null;
318
+ }, De = () => E(g);
293
319
  //#endregion
294
320
  //#region src/web-api/helpers/create-headers.ts
295
- function E(e, t) {
296
- let n = T(e), r = new Headers(t);
321
+ function D(e, t) {
322
+ let n = E(e), r = new Headers(t);
297
323
  r.append("Sinequa-Force-Camel-Case", "true"), r.append("accept", "application/json"), n && r.append("Sinequa-csrf-token", n);
298
324
  let { userOverride: i, userOverrideActive: a } = e.config, o = p(e.config);
299
325
  return o && !e.resolveHttpAdapter() && r.append("Authorization", `Bearer ${o}`), i && a && (r.append("sinequa-override-user", i.username), r.append("sinequa-override-domain", i.domain)), r;
300
326
  }
301
- function Se(e) {
302
- return E(g, e);
327
+ function Oe(e) {
328
+ return D(g, e);
303
329
  }
304
330
  //#endregion
305
331
  //#region src/web-api/helpers/utils/build-request-url.ts
306
- function D(e, t, n) {
332
+ function O(e, t, n) {
307
333
  let r = t.startsWith("plugin") ? `api/v1/${t}` : t, i = n ? `?${new URLSearchParams(n)}` : "", { backendUrl: a } = e.config;
308
334
  return a ? `${a}/${r}${i}` : `${r}${i}`;
309
335
  }
310
336
  //#endregion
311
337
  //#region src/web-api/helpers/errors/api-error.ts
312
- var O = class extends Error {
338
+ var k = class extends Error {
313
339
  status;
314
340
  constructor(e, t) {
315
341
  super(e), Object.setPrototypeOf(this, new.target.prototype), this.name = "ApiError", this.status = t;
316
342
  }
317
- }, k = class extends O {
343
+ }, A = class extends k {
318
344
  constructor(e = "Unauthorized access") {
319
345
  super(e, 401), this.name = "UnauthorizedError";
320
346
  }
321
- }, A = (e, t) => {
322
- v(e, "session").set(y(e, C.credentials), JSON.stringify({ data: { csrfToken: t } })), e.events.emit("tokenRefreshed", { token: t });
323
- }, Ce = (e) => A(g, e), we = class extends O {
347
+ }, j = (e, t) => {
348
+ v(e, "session").set(y(e, w.credentials), JSON.stringify({ data: { csrfToken: t } })), e.events.emit("tokenRefreshed", { token: t });
349
+ }, ke = (e) => j(g, e), Ae = class extends k {
324
350
  constructor(e = "Server error") {
325
351
  super(e, 500), this.name = "ServerError";
326
352
  }
327
353
  };
328
354
  //#endregion
329
355
  //#region src/web-api/helpers/handle-response.ts
330
- async function Te(e, t = "json") {
331
- return Ee(g, e, t);
356
+ async function je(e, t = "json") {
357
+ return M(g, e, t);
332
358
  }
333
- async function Ee(e, t, n = "json", r = t.url ?? "") {
359
+ async function M(e, t, n = "json", r = t.url ?? "") {
334
360
  let i = t.headers.get("sinequa-jwt-refresh");
335
- if (i !== null && A(e, i), t.status >= 200 && t.status < 300) {
361
+ if (i !== null && j(e, i), t.status >= 200 && t.status < 300) {
336
362
  if (n === "response") return t;
337
363
  let e = t.headers.get("content-length");
338
364
  if (t.status === 204 || e === "0") return;
@@ -353,7 +379,7 @@ async function Ee(e, t, n = "json", r = t.url ?? "") {
353
379
  endpoint: t.url ?? "",
354
380
  error: n
355
381
  });
356
- let i = new k(n.errorMessage ?? n.message ?? "Unauthorized... User override failed.");
382
+ let i = new A(n.errorMessage ?? n.message ?? "Unauthorized... User override failed.");
357
383
  throw e.events.emit("requestFailed", {
358
384
  endpoint: r,
359
385
  status: 401,
@@ -363,11 +389,11 @@ async function Ee(e, t, n = "json", r = t.url ?? "") {
363
389
  error: i
364
390
  }), i;
365
391
  }
366
- return await De(e, t, 401, r);
392
+ return await Me(e, t, 401, r);
367
393
  }
368
- return t.status === 500 ? (_(e).error("Server error occurred", { endpoint: r }), await De(e, t, 500, r)) : (_(e).warn(`Unexpected response status: ${t.status}`, { endpoint: r }), await De(e, t, t.status, r));
394
+ return t.status === 500 ? (_(e).error("Server error occurred", { endpoint: r }), await Me(e, t, 500, r)) : (_(e).warn(`Unexpected response status: ${t.status}`, { endpoint: r }), await Me(e, t, t.status, r));
369
395
  }
370
- async function De(e, t, n, r) {
396
+ async function Me(e, t, n, r) {
371
397
  let i = "";
372
398
  try {
373
399
  i = await t.text() ?? "";
@@ -380,111 +406,147 @@ async function De(e, t, n, r) {
380
406
  errorCodeText: e.errorCodeText
381
407
  };
382
408
  } catch {}
383
- let s = n === 401 ? new k(a) : n === 500 ? new we(a) : new O(a ?? `Request failed with status ${n}`, n);
409
+ let s = n === 401 ? new A(a) : n === 500 ? new Ae(a) : new k(a ?? `Request failed with status ${n}`, n);
384
410
  throw o && (s.cause = o), e.events.emit("requestFailed", {
385
411
  endpoint: r,
386
412
  status: n,
387
413
  error: s
388
- }), s instanceof k && e.events.emit("unauthorized", {
414
+ }), s instanceof A && e.events.emit("unauthorized", {
389
415
  endpoint: r,
390
416
  error: s
391
417
  }), s;
392
418
  }
393
419
  //#endregion
394
420
  //#region src/web-api/helpers/utils/resolve-no-auto-authentication.ts
395
- function j(e) {
421
+ function N(e) {
396
422
  return e.config.authMode?.kind !== "sso";
397
423
  }
398
- function Oe() {
399
- return j(g);
424
+ function Ne() {
425
+ return N(g);
400
426
  }
401
427
  //#endregion
402
428
  //#region src/web-api/helpers/methods/send-request.ts
403
- var ke = /* @__PURE__ */ new WeakMap();
404
- function Ae(e, t, n) {
405
- let r = ke.get(e);
429
+ var Pe = /* @__PURE__ */ new WeakMap();
430
+ function Fe(e, t, n) {
431
+ let r = Pe.get(e);
406
432
  if (r) return r;
407
- if (ve(e)) return _(e).debug(`Skipping session recovery for ${t}: the user signed out`), Promise.resolve(!1);
433
+ if (we(e)) return _(e).debug(`Skipping session recovery for ${t}: the user signed out`), Promise.resolve({
434
+ outcome: "signedOut",
435
+ mark: -1
436
+ });
408
437
  let i = e.config.auth?.recoverFromUnauthorized;
409
- if (!i) return Promise.resolve(!1);
410
- let a = Promise.resolve(i({
438
+ if (!i) return Promise.resolve({
439
+ outcome: "noHook",
440
+ mark: -1
441
+ });
442
+ let a = _e(e), o = Promise.resolve().then(() => i({
411
443
  endpoint: t,
412
444
  error: n
413
- })).catch((t) => (_(e).debug("Session recovery failed", t), !1)).finally(() => ke.delete(e));
414
- return ke.set(e, a), a;
445
+ })).then((t) => t ? (be(e, a), {
446
+ outcome: "recovered",
447
+ mark: a
448
+ }) : {
449
+ outcome: "refused",
450
+ mark: a
451
+ }).catch((t) => (_(e).debug("Session recovery failed", t), {
452
+ outcome: "refused",
453
+ mark: a
454
+ })).finally(() => Pe.delete(e));
455
+ return Pe.set(e, o), o;
456
+ }
457
+ function Ie(e, t, n, r, i, a) {
458
+ return we(e) || a?.aborted || ve(e, i) && e.events.emit("sessionLost", {
459
+ endpoint: t,
460
+ error: n,
461
+ reason: r
462
+ }), n;
415
463
  }
416
- async function je(e, t, n, r) {
464
+ async function Le(e, t, n, r, i) {
465
+ let a = await Re(e, t, n, r);
466
+ return xe(e, i), a;
467
+ }
468
+ async function Re(e, t, n, r) {
417
469
  let i = e.resolveHttpAdapter();
418
- return i ? Ee(e, await i.fetch(t, {
470
+ return i ? M(e, await i.fetch(t, {
419
471
  ...n,
420
472
  signal: r?.signal
421
- }), r?.responseType, t) : Ee(e, await me(e)(t, {
473
+ }), r?.responseType, t) : M(e, await me(e)(t, {
422
474
  ...n,
423
475
  credentials: he(e),
424
476
  signal: r?.signal,
425
477
  redirect: r?.redirect
426
478
  }), r?.responseType, t);
427
479
  }
428
- async function M(e, t, n, r) {
480
+ async function P(e, t, n, r) {
481
+ let i = _e(e);
429
482
  try {
430
- return await je(e, t, n, r);
431
- } catch (i) {
432
- if (!(i instanceof k) || r?.noRecovery || !await Ae(e, t, i)) throw i;
483
+ return await Le(e, t, n, r, i);
484
+ } catch (a) {
485
+ if (!(a instanceof A) || r?.noRecovery) throw a;
486
+ let o = await Fe(e, t, a), { outcome: s } = o;
487
+ if (s === "signedOut") throw a;
488
+ if (s !== "recovered") throw Ie(e, t, a, s, Math.max(i, o.mark), r?.signal);
433
489
  _(e).debug("Session recovered — replaying the request once");
434
- let a = new Headers(n.headers), o = T(e);
435
- return o && a.set("Sinequa-csrf-token", o), je(e, t, {
436
- ...n,
437
- headers: a
438
- }, r);
490
+ let c = new Headers(n.headers), l = E(e);
491
+ l && c.set("Sinequa-csrf-token", l);
492
+ let u = _e(e);
493
+ try {
494
+ return await Le(e, t, {
495
+ ...n,
496
+ headers: c
497
+ }, r, u);
498
+ } catch (n) {
499
+ throw n instanceof A ? Ie(e, t, n, "replayUnauthorized", u, r?.signal) : n;
500
+ }
439
501
  }
440
502
  }
441
- function Me() {
503
+ function ze() {
442
504
  return typeof navigator > "u" ? void 0 : navigator.language;
443
505
  }
444
- function N(e, t, n) {
506
+ function F(e, t, n) {
445
507
  let { uiLanguage: r } = e.config;
446
508
  return JSON.stringify({
447
509
  app: e.config.app,
448
510
  ...t,
449
- locale: t.locale || r || Me(),
511
+ locale: t.locale || r || ze(),
450
512
  ...r ? { "ui-language": r } : {},
451
513
  noUserOverride: !e.config.userOverrideActive,
452
- noAutoAuthentication: n?.noAutoAuthentication ?? j(e)
514
+ noAutoAuthentication: n?.noAutoAuthentication ?? N(e)
453
515
  });
454
516
  }
455
517
  //#endregion
456
518
  //#region src/web-api/helpers/methods/post.ts
457
- async function P(e, t, n, r) {
458
- let i = E(e, r?.headers);
519
+ async function I(e, t, n, r) {
520
+ let i = D(e, r?.headers);
459
521
  i.has("Content-Type") || i.set("Content-Type", "application/json");
460
- let a = D(e, t);
522
+ let a = O(e, t);
461
523
  _(e).debug(`Making POST request to: ${a}`);
462
524
  try {
463
- return await M(e, a, {
525
+ return await P(e, a, {
464
526
  method: "POST",
465
527
  headers: i,
466
- body: N(e, n, r)
528
+ body: F(e, n, r)
467
529
  }, r);
468
530
  } catch (t) {
469
531
  throw _(e).error("Error making POST request:", t), t;
470
532
  }
471
533
  }
472
- async function Ne(e, t, n) {
473
- return P(g, e, t, n);
534
+ async function Be(e, t, n) {
535
+ return I(g, e, t, n);
474
536
  }
475
537
  //#endregion
476
538
  //#region src/web-api/helpers/errors/timeout-error.ts
477
- var Pe = class extends O {
539
+ var Ve = class extends k {
478
540
  constructor(e = "Request timed out") {
479
541
  super(e, 408), this.name = "TimeoutError";
480
542
  }
481
543
  };
482
544
  //#endregion
483
545
  //#region src/web-api/helpers/utils/create-timeout-controller.ts
484
- function F(e) {
546
+ function L(e) {
485
547
  let t = new AbortController(), { signal: n } = t;
486
548
  return e && setTimeout(() => {
487
- n.aborted || t.abort(new Pe(`Request timed out after ${e}ms`));
549
+ n.aborted || t.abort(new Ve(`Request timed out after ${e}ms`));
488
550
  }, e), {
489
551
  controller: t,
490
552
  signal: n
@@ -492,7 +554,7 @@ function F(e) {
492
554
  }
493
555
  //#endregion
494
556
  //#region src/authentication/providers/redirect-to-identity-provider.ts
495
- var Fe = {
557
+ var He = {
496
558
  oauth: {
497
559
  label: "OAuth",
498
560
  endpoint: "api/v1/security.oauth",
@@ -504,8 +566,8 @@ var Fe = {
504
566
  action: "getresponse"
505
567
  }
506
568
  };
507
- async function Ie(e, { kind: t, provider: n }) {
508
- let { label: r, endpoint: i, action: a } = Fe[t], o = typeof window < "u", s = v(e, "session"), c = y(e, w);
569
+ async function Ue(e, { kind: t, provider: n }) {
570
+ let { label: r, endpoint: i, action: a } = He[t], o = typeof window < "u", s = v(e, "session"), c = y(e, T);
509
571
  if (o && s.get(c)) throw Error(`${r} sign-in with provider "${n}" did not establish a session — its callback is likely not authorized for this application.`);
510
572
  let l = {
511
573
  action: a,
@@ -514,8 +576,8 @@ async function Ie(e, { kind: t, provider: n }) {
514
576
  originalUrl: typeof window > "u" ? "http://localhost" : window.location.href
515
577
  }, u;
516
578
  try {
517
- let { signal: t } = F(S(e));
518
- u = await P(e, i, l, { signal: t });
579
+ let { signal: t } = L(C(e));
580
+ u = await I(e, i, l, { signal: t });
519
581
  } catch (t) {
520
582
  throw _(e).error(`Failed to authenticate with ${r}`, t), t;
521
583
  }
@@ -525,24 +587,24 @@ async function Ie(e, { kind: t, provider: n }) {
525
587
  }
526
588
  //#endregion
527
589
  //#region src/authentication/providers/oauth-authentication.ts
528
- var Le = async (e) => {
590
+ var We = async (e) => {
529
591
  let t = ee(e.config);
530
592
  if (!t) throw Error("No OAuth provider configured: set `authMode: AuthMode.oauth(provider)`, or the `autoOAuthProvider` key.");
531
- return Ie(e, {
593
+ return Ue(e, {
532
594
  kind: "oauth",
533
595
  provider: t
534
596
  });
535
- }, Re = () => Le(g), ze = async (e) => {
597
+ }, Ge = () => We(g), Ke = async (e) => {
536
598
  let t = te(e.config);
537
599
  if (!t) throw Error("No SAML provider configured: set `authMode: AuthMode.saml(provider)`, or the `autoSAMLProvider` key.");
538
- return Ie(e, {
600
+ return Ue(e, {
539
601
  kind: "saml",
540
602
  provider: t
541
603
  });
542
- }, Be = () => ze(g);
604
+ }, qe = () => Ke(g);
543
605
  //#endregion
544
606
  //#region src/authentication/session/detect-auth-mode.ts
545
- function Ve(e, t) {
607
+ function Je(e, t) {
546
608
  if (e.authMode && e.authMode.kind !== "unknown") return e.authMode;
547
609
  if (e.bearerToken) return f.bearer(e.bearerToken);
548
610
  let n = e.autoOAuthProvider || t?.autoOAuthProvider;
@@ -552,13 +614,13 @@ function Ve(e, t) {
552
614
  }
553
615
  //#endregion
554
616
  //#region src/web-api/helpers/methods/get.ts
555
- async function I(e, t, n, r) {
556
- let i = E(e, r?.headers), a = n;
617
+ async function R(e, t, n, r) {
618
+ let i = D(e, r?.headers), a = n;
557
619
  r?.noAutoAuthentication !== void 0 && (a = new URLSearchParams(n), a.set("noAutoAuthentication", String(r.noAutoAuthentication)));
558
- let o = D(e, t, a);
620
+ let o = O(e, t, a);
559
621
  _(e).debug(`Making GET request to: ${o}`);
560
622
  try {
561
- return await M(e, o, {
623
+ return await P(e, o, {
562
624
  method: "GET",
563
625
  headers: i
564
626
  }, r);
@@ -566,49 +628,49 @@ async function I(e, t, n, r) {
566
628
  throw _(e).error("Error making GET request:", t), t;
567
629
  }
568
630
  }
569
- async function He(e, t, n) {
570
- return I(g, e, t, n);
631
+ async function Ye(e, t, n) {
632
+ return R(g, e, t, n);
571
633
  }
572
634
  //#endregion
573
635
  //#region src/authentication/tokens/get-csrf-token.ts
574
- var Ue = async (e) => {
636
+ var Xe = async (e) => {
575
637
  let t;
576
638
  try {
577
- let { signal: n } = F(S(e));
578
- t = await I(e, "api/v1/challenge?action=getCsrfToken&suppressErrors=true", void 0, {
639
+ let { signal: n } = L(C(e));
640
+ t = await R(e, "api/v1/challenge?action=getCsrfToken&suppressErrors=true", void 0, {
579
641
  signal: n,
580
642
  noRecovery: !0
581
643
  });
582
644
  } catch (t) {
583
645
  throw _(e).warn("CSRF token fetch failed", t), t;
584
646
  }
585
- return t?.csrfToken ? (A(e, t.csrfToken), t.csrfToken) : null;
586
- }, We = () => Ue(g);
647
+ return t?.csrfToken ? (j(e, t.csrfToken), t.csrfToken) : null;
648
+ }, Ze = () => Xe(g);
587
649
  //#endregion
588
650
  //#region src/authentication/session/has-session.ts
589
- async function Ge(e) {
590
- if (T(e)) return _(e).info("Existing session (stored token)"), Ke(e), !0;
651
+ async function Qe(e) {
652
+ if (E(e)) return _(e).info("Existing session (stored token)"), $e(e), !0;
591
653
  try {
592
- return _(e).info("Checking for an existing session via CSRF token retrieval"), await Ue(e) === null ? !1 : (Ke(e), !0);
654
+ return _(e).info("Checking for an existing session via CSRF token retrieval"), await Xe(e) !== null && ($e(e), !0);
593
655
  } catch (t) {
594
656
  return _(e).debug("CSRF session probe failed — treated as no existing session", t), !1;
595
657
  }
596
658
  }
597
- function Ke(e) {
598
- v(e, "session").remove(y(e, w));
659
+ function $e(e) {
660
+ v(e, "session").remove(y(e, T));
599
661
  }
600
- var qe = () => Ge(g);
662
+ var et = () => Qe(g);
601
663
  //#endregion
602
664
  //#region src/helpers/ts-helper.ts
603
- function Je(e) {
665
+ function tt(e) {
604
666
  throw Error(`Unexpected value: ${JSON.stringify(e)}`);
605
667
  }
606
668
  //#endregion
607
669
  //#region src/authentication/tokens/get-jwt-token.ts
608
- async function Ye(e, t, n) {
670
+ async function nt(e, t, n) {
609
671
  if (t) {
610
672
  let { username: n, password: r } = t;
611
- return Qe(e, {
673
+ return at(e, {
612
674
  action: "get",
613
675
  tokenInCookie: !0,
614
676
  user: n,
@@ -616,48 +678,48 @@ async function Ye(e, t, n) {
616
678
  }, !0, "Failed to get JWT");
617
679
  }
618
680
  if (!p(e.config)) throw Error("A bearer token is required for credential-less authentication: set `authMode: AuthMode.bearer(token)`, or the legacy `bearerToken` key.");
619
- return Qe(e, {
681
+ return at(e, {
620
682
  action: "get",
621
683
  tokenInCookie: !0
622
684
  }, !1, "Failed to get JWT without credentials", n?.recoverable);
623
685
  }
624
- async function Xe(e) {
625
- return Ye(g, e);
686
+ async function rt(e) {
687
+ return nt(g, e);
626
688
  }
627
- var Ze = Xe;
628
- async function Qe(e, t, n, r, i = !1) {
689
+ var it = rt;
690
+ async function at(e, t, n, r, i = !1) {
629
691
  try {
630
- let { signal: r } = F(S(e)), i = await P(e, "api/v1/security.webtoken", t, {
692
+ let { signal: r } = L(C(e)), i = await I(e, "api/v1/security.webtoken", t, {
631
693
  signal: r,
632
694
  noAutoAuthentication: n,
633
695
  noRecovery: !0
634
696
  });
635
- return i?.csrfToken ? (A(e, i.csrfToken), i.csrfToken) : null;
697
+ return i?.csrfToken ? (j(e, i.csrfToken), i.csrfToken) : null;
636
698
  } catch (t) {
637
699
  throw _(e)[i ? "debug" : "error"](r, t), t;
638
700
  }
639
701
  }
640
702
  //#endregion
641
703
  //#region src/authentication/session/auth-mode-marker.ts
642
- var $e = (e) => ({
704
+ var ot = (e) => ({
643
705
  storage: v(e, "local"),
644
- key: y(e, C.lastAuthMode)
645
- }), et = (e) => {
646
- let { storage: t, key: n } = $e(e);
706
+ key: y(e, w.lastAuthMode)
707
+ }), st = (e) => {
708
+ let { storage: t, key: n } = ot(e);
647
709
  t.set(n, "credentials");
648
- }, tt = (e) => {
649
- let { storage: t, key: n } = $e(e);
710
+ }, ct = (e) => {
711
+ let { storage: t, key: n } = ot(e);
650
712
  return t.get(n) === "credentials";
651
- }, nt = (e) => {
652
- let { storage: t, key: n } = $e(e);
713
+ }, lt = (e) => {
714
+ let { storage: t, key: n } = ot(e);
653
715
  t.remove(n);
654
- }, rt = (e, t) => {
655
- let n = v(e, "session"), r = y(e, C.authenticated);
716
+ }, ut = (e, t) => {
717
+ let n = v(e, "session"), r = y(e, w.authenticated);
656
718
  t ? n.set(r, "true") : n.remove(r);
657
- }, it = (e) => v(e, "session").get(y(e, C.authenticated)) === "true", at = "api/v1/principal", ot = async (e) => {
719
+ }, dt = (e) => v(e, "session").get(y(e, w.authenticated)) === "true", ft = "api/v1/principal", pt = async (e) => {
658
720
  try {
659
- let { signal: t } = F(S(e));
660
- return await I(e, e.config.auth?.probeEndpoint ?? at, new URLSearchParams({ action: "get" }), {
721
+ let { signal: t } = L(C(e));
722
+ return await R(e, e.config.auth?.probeEndpoint ?? ft, new URLSearchParams({ action: "get" }), {
661
723
  signal: t,
662
724
  redirect: "manual",
663
725
  noRecovery: !0
@@ -665,113 +727,113 @@ var $e = (e) => ({
665
727
  } catch (t) {
666
728
  return _(e).debug("Protected-endpoint probe failed — not authenticated", t), !1;
667
729
  }
668
- }, st = () => ot(g), ct = (e) => e.resolveHttpAdapter() ? f.sso() : tt(e) ? f.credentials() : f.sso(), lt = (e, t) => {
669
- if (v(e, "session").remove(y(e, w)), t.kind === "unknown") {
670
- let t = ct(e);
730
+ }, mt = () => pt(g), ht = (e) => e.resolveHttpAdapter() ? f.sso() : ct(e) ? f.credentials() : f.sso(), gt = (e, t) => {
731
+ if (v(e, "session").remove(y(e, T)), t.kind === "unknown") {
732
+ let t = ht(e);
671
733
  _(e).info(`Ambiguous auth mode resolved to "${t.kind}"`), b(e, { authMode: t });
672
734
  }
673
- return x(e, !0), !0;
674
- }, ut = async (e) => await ot(e) ? (_(e).info("User authenticated by the server (ambient SSO / OIDC)"), await Ue(e).catch((t) => _(e).debug("Best-effort CSRF refresh after auto-authentication failed", t)), rt(e, !0), !0) : !1, dt = async (e, t) => {
735
+ return S(e, !0), !0;
736
+ }, _t = async (e) => await pt(e) ? (_(e).info("User authenticated by the server (ambient SSO / OIDC)"), await Xe(e).catch((t) => _(e).debug("Best-effort CSRF refresh after auto-authentication failed", t)), ut(e, !0), !0) : !1, vt = async (e, t) => {
675
737
  if (t) {
676
738
  let { username: n, password: r } = t;
677
- return !n || !r ? (_(e).error("Credentials are required for authentication"), x(e, !1), !1) : pt(e, {
739
+ return !n || !r ? (_(e).error("Credentials are required for authentication"), S(e, !1), !1) : bt(e, {
678
740
  username: n,
679
741
  password: r
680
742
  });
681
743
  }
682
744
  let n = e.config.authMode ?? f.unknown();
683
- if (n.kind === "bearer") return mt(e, n);
684
- if (await Ge(e)) return _(e).info("User already authenticated (existing session)"), lt(e, n);
745
+ if (n.kind === "bearer") return xt(e, n);
746
+ if (await Qe(e)) return _(e).info("User already authenticated (existing session)"), gt(e, n);
685
747
  switch (n.kind) {
686
- case "credentials": return x(e, !1), !1;
687
- case "oauth": return _(e).info("Initiating OAuth authentication flow"), await Le(e), x(e, !1), !1;
688
- case "saml": return _(e).info("Initiating SAML authentication flow"), await ze(e), x(e, !1), !1;
689
- case "sso": return _(e).info("Letting the server authenticate the request (ambient SSO)"), await ut(e) ? lt(e, n) : (x(e, !1), !1);
748
+ case "credentials": return S(e, !1), !1;
749
+ case "oauth": return _(e).info("Initiating OAuth authentication flow"), await We(e), S(e, !1), !1;
750
+ case "saml": return _(e).info("Initiating SAML authentication flow"), await Ke(e), S(e, !1), !1;
751
+ case "sso": return _(e).info("Letting the server authenticate the request (ambient SSO)"), await _t(e) ? gt(e, n) : (S(e, !1), !1);
690
752
  case "unknown":
691
- if (_(e).info("No provider declared — probing for server-side auto-authentication"), await ut(e)) {
753
+ if (_(e).info("No provider declared — probing for server-side auto-authentication"), await _t(e)) {
692
754
  let t = f.sso();
693
- return b(e, { authMode: t }), lt(e, t);
755
+ return b(e, { authMode: t }), gt(e, t);
694
756
  }
695
- return _(e).info("No provider, no session and no server-side authentication — falling back to the credentials form"), b(e, { authMode: f.credentials() }), x(e, !1), !1;
696
- default: return Je(n);
757
+ return _(e).info("No provider, no session and no server-side authentication — falling back to the credentials form"), b(e, { authMode: f.credentials() }), S(e, !1), !1;
758
+ default: return tt(n);
697
759
  }
698
- }, ft = (e) => dt(g, e);
699
- async function pt(e, t) {
700
- _(e).info("Attempting authentication using credentials"), b(e, { authMode: f.credentials() }), et(e);
760
+ }, yt = (e) => vt(g, e);
761
+ async function bt(e, t) {
762
+ _(e).info("Attempting authentication using credentials"), b(e, { authMode: f.credentials() }), st(e);
701
763
  let { userOverrideActive: n, userOverride: r } = e.config;
702
764
  b(e, {
703
765
  userOverrideActive: !1,
704
766
  userOverride: void 0
705
767
  });
706
768
  try {
707
- await Ye(e, t);
769
+ await nt(e, t);
708
770
  } catch (t) {
709
- throw x(e, !1), t;
771
+ throw S(e, !1), t;
710
772
  } finally {
711
773
  b(e, {
712
774
  userOverrideActive: n,
713
775
  userOverride: r
714
776
  });
715
777
  }
716
- return x(e, !0), !0;
778
+ return S(e, !0), !0;
717
779
  }
718
- async function mt(e, t) {
719
- if (_(e).info("Attempting authentication using bearer token"), !p(e.config)) throw x(e, !1), Error("Bearer mode requires a token: set `authMode: AuthMode.bearer(token)`, or the legacy `bearerToken` key.");
780
+ async function xt(e, t) {
781
+ if (_(e).info("Attempting authentication using bearer token"), !p(e.config)) throw S(e, !1), Error("Bearer mode requires a token: set `authMode: AuthMode.bearer(token)`, or the legacy `bearerToken` key.");
720
782
  if (t.sessionCookie !== !1) try {
721
- if (await Ye(e, void 0, { recoverable: !0 })) return _(e).info("Bearer token exchanged for a server session"), x(e, !0), !0;
783
+ if (await nt(e, void 0, { recoverable: !0 })) return _(e).info("Bearer token exchanged for a server session"), S(e, !0), !0;
722
784
  } catch (t) {
723
785
  _(e).info("The server refused to exchange the bearer token for a session — continuing with the token alone. Requests this library issues stay authenticated, but what the browser loads by itself (document previews and their sub-resources, thumbnails, /xdownload links) cannot be. Allow the `webtoken` JSON method for this access token to get a session cookie, or set `AuthMode.bearer(token, { sessionCookie: false })` to stop asking.", t);
724
786
  }
725
- if (!await ot(e)) throw x(e, !1), Error("The server refused the configured bearer token: it may be expired or revoked, or its JSON method rules may not allow the probe endpoint (see `auth.probeEndpoint`).");
726
- return rt(e, !0), x(e, !0), !0;
787
+ if (!await pt(e)) throw S(e, !1), Error("The server refused the configured bearer token: it may be expired or revoked, or its JSON method rules may not allow the probe endpoint (see `auth.probeEndpoint`).");
788
+ return ut(e, !0), S(e, !0), !0;
727
789
  }
728
790
  //#endregion
729
791
  //#region src/authentication/tokens/delete-web-token-cookie.ts
730
- var ht = async (e) => {
792
+ var St = async (e) => {
731
793
  let t = new URLSearchParams({
732
794
  action: "deleteWebTokenCookie",
733
795
  noUserOverride: "true"
734
- }), { signal: n } = F(S(e));
735
- return I(e, "api/v1/challenge", t, {
796
+ }), { signal: n } = L(C(e));
797
+ return R(e, "api/v1/challenge", t, {
736
798
  signal: n,
737
799
  noAutoAuthentication: !0,
738
800
  noRecovery: !0
739
801
  });
740
- }, gt = () => ht(g);
802
+ }, Ct = () => St(g);
741
803
  //#endregion
742
804
  //#region src/authentication/session/logout.ts
743
- async function _t(e) {
805
+ async function wt(e) {
744
806
  let { userOverrideActive: t } = e.config;
745
- if (yt(e), nt(e), v(e, "session").remove(y(e, w)), _e(e), e.events.emit("loggedOut", {}), !t) try {
746
- let { methodresult: t, logoutUrl: n } = await ht(e);
807
+ if (Et(e), lt(e), v(e, "session").remove(y(e, T)), Ce(e), e.events.emit("loggedOut", {}), !t) try {
808
+ let { methodresult: t, logoutUrl: n } = await St(e);
747
809
  if (t === "ok") return n;
748
810
  _(e).error("logout failed");
749
811
  } catch (t) {
750
812
  _(e).error("logout failed", t);
751
813
  }
752
814
  }
753
- async function vt() {
754
- return _t(g);
815
+ async function Tt() {
816
+ return wt(g);
755
817
  }
756
- function yt(e) {
757
- v(e, "local").remove(y(e, C.legacyCsrfToken)), v(e, "session").remove(y(e, C.credentials)), rt(e, !1), x(e, !1);
818
+ function Et(e) {
819
+ v(e, "local").remove(y(e, w.legacyCsrfToken)), v(e, "session").remove(y(e, w.credentials)), ut(e, !1), S(e, !1);
758
820
  }
759
- function bt() {
760
- yt(g);
821
+ function Dt() {
822
+ Et(g);
761
823
  }
762
824
  //#endregion
763
825
  //#region src/authentication/session/redirect-guard.ts
764
- function xt(e) {
765
- return v(e, "session").get(y(e, w)) !== null;
826
+ function Ot(e) {
827
+ return v(e, "session").get(y(e, T)) !== null;
766
828
  }
767
- var St = () => xt(g), Ct = (e) => !!T(e) || it(e), wt = () => Ct(g);
829
+ var kt = () => Ot(g), At = (e) => !!E(e) || dt(e), jt = () => At(g);
768
830
  //#endregion
769
831
  //#region src/web-api/helpers/methods/del.ts
770
- async function L(e, t, n, r) {
771
- let i = E(e, r?.headers), a = D(e, t, n), o;
772
- r?.body && (i.has("Content-Type") || i.set("Content-Type", "application/json"), o = N(e, r.body, r)), _(e).debug(`Making DELETE request to: ${a}`);
832
+ async function z(e, t, n, r) {
833
+ let i = D(e, r?.headers), a = O(e, t, n), o;
834
+ r?.body && (i.has("Content-Type") || i.set("Content-Type", "application/json"), o = F(e, r.body, r)), _(e).debug(`Making DELETE request to: ${a}`);
773
835
  try {
774
- return await M(e, a, {
836
+ return await P(e, a, {
775
837
  method: "DELETE",
776
838
  headers: i,
777
839
  body: o
@@ -780,63 +842,63 @@ async function L(e, t, n, r) {
780
842
  throw _(e).error("Error making DELETE request:", t), t;
781
843
  }
782
844
  }
783
- async function Tt(e, t, n) {
784
- return L(g, e, t, n);
845
+ async function Mt(e, t, n) {
846
+ return z(g, e, t, n);
785
847
  }
786
848
  //#endregion
787
849
  //#region src/web-api/helpers/methods/patch.ts
788
- async function R(e, t, n, r) {
789
- let i = E(e, r?.headers);
850
+ async function B(e, t, n, r) {
851
+ let i = D(e, r?.headers);
790
852
  i.append("content-type", "application/json");
791
- let a = D(e, t);
853
+ let a = O(e, t);
792
854
  _(e).debug(`Making PATCH request to: ${a}`);
793
855
  try {
794
- return await M(e, a, {
856
+ return await P(e, a, {
795
857
  method: "PATCH",
796
858
  headers: i,
797
- body: N(e, n, r)
859
+ body: F(e, n, r)
798
860
  }, r);
799
861
  } catch (t) {
800
862
  throw _(e).error("Error making PATCH request:", t), t;
801
863
  }
802
864
  }
803
- async function Et(e, t, n) {
804
- return R(g, e, t, n);
865
+ async function Nt(e, t, n) {
866
+ return B(g, e, t, n);
805
867
  }
806
868
  //#endregion
807
869
  //#region src/web-api/helpers/methods/put.ts
808
- async function z(e, t, n, r) {
809
- let i = E(e, r?.headers);
870
+ async function V(e, t, n, r) {
871
+ let i = D(e, r?.headers);
810
872
  i.has("Content-Type") || i.set("Content-Type", "application/json");
811
- let a = D(e, t);
873
+ let a = O(e, t);
812
874
  _(e).debug(`Making PUT request to: ${a}`);
813
875
  try {
814
- return await M(e, a, {
876
+ return await P(e, a, {
815
877
  method: "PUT",
816
878
  headers: i,
817
- body: N(e, n, r)
879
+ body: F(e, n, r)
818
880
  }, r);
819
881
  } catch (t) {
820
882
  throw _(e).error("Error making PUT request:", t), t;
821
883
  }
822
884
  }
823
- async function Dt(e, t, n) {
824
- return z(g, e, t, n);
885
+ async function Pt(e, t, n) {
886
+ return V(g, e, t, n);
825
887
  }
826
888
  //#endregion
827
889
  //#region src/web-api/v1/fetch-app.ts
828
- async function Ot(e, t = g) {
890
+ async function Ft(e, t = g) {
829
891
  let n = e || t.config.app;
830
- return I(t, "api/v1/app", new URLSearchParams({ app: n || "" }));
892
+ return R(t, "api/v1/app", new URLSearchParams({ app: n || "" }));
831
893
  }
832
- async function kt(e = g) {
894
+ async function It(e = g) {
833
895
  let { app: t } = e.config;
834
- return I(e, "api/v1/app", new URLSearchParams({
896
+ return R(e, "api/v1/app", new URLSearchParams({
835
897
  app: t || "",
836
898
  preLogin: "true"
837
899
  }));
838
900
  }
839
- function At(e = g) {
901
+ function Lt(e = g) {
840
902
  let { backendUrl: t, app: n } = e.config;
841
903
  if (typeof window < "u") {
842
904
  if (t ||= window.location.origin, !n) {
@@ -853,33 +915,33 @@ function At(e = g) {
853
915
  autoOAuthProvider: void 0,
854
916
  autoSAMLProvider: void 0,
855
917
  bearerToken: void 0
856
- }), Promise.resolve({})) : kt(e).then((t) => (b(e, {
857
- authMode: Ve(e.config, t),
918
+ }), Promise.resolve({})) : It(e).then((t) => (b(e, {
919
+ authMode: Je(e.config, t),
858
920
  autoOAuthProvider: e.config.autoOAuthProvider || t.autoOAuthProvider,
859
921
  autoSAMLProvider: e.config.autoSAMLProvider || t.autoSAMLProvider
860
922
  }), t)).catch((t) => {
861
923
  throw _(e).error("atomic:fetchAppPreLogin error", t), t;
862
924
  });
863
925
  }
864
- var jt = At, Mt = 10;
865
- function Nt(e, t) {
926
+ var Rt = Lt, zt = 10;
927
+ function Bt(e, t) {
866
928
  let n = t?.aggregations;
867
929
  if (!n || Array.isArray(n)) return;
868
930
  let r = n[e]?.count;
869
931
  return typeof r == "number" ? r : void 0;
870
932
  }
871
- function Pt(e, t, n) {
872
- let r = Nt(e, t);
933
+ function Vt(e, t, n) {
934
+ let r = Bt(e, t);
873
935
  if (r !== void 0) return r;
874
936
  let i = n?.[e];
875
937
  return typeof i == "number" ? i : 10;
876
938
  }
877
- function Ft(e, t) {
939
+ function Ht(e, t) {
878
940
  return e.isDistribution || e.isTree || !e.items ? !1 : e.items.length > t;
879
941
  }
880
942
  //#endregion
881
943
  //#region src/helpers/column-resolver.ts
882
- function It(e, t, n) {
944
+ function Ut(e, t, n) {
883
945
  if (!e || !t) return;
884
946
  if (n) {
885
947
  let r = Object.keys(t.queries).find((e) => e === n?.toLowerCase()), i;
@@ -894,93 +956,93 @@ function It(e, t, n) {
894
956
  }
895
957
  //#endregion
896
958
  //#region src/types/audit/AuditEventType.ts
897
- var B = /* @__PURE__ */ function(e) {
959
+ var H = /* @__PURE__ */ function(e) {
898
960
  return e.None = "None", e.Search_FirstPage = "Search_FirstPage", e.Search_Text = "Search_Text", e.Search_Refine = "Search_Refine", e.Search_Select_Item = "Search_Select_Item", e.Search_Select_Custom = "Search_Select_Custom", e.Search_Select_Concept = "Search_Select_Concept", e.Search_Select_Correction = "Search_Select_Correction", e.Search_GotoPage = "Search_GotoPage", e.Search_GotoTab = "Search_GotoTab", e.Search_DisplayResult = "Search_DisplayResult", e.Search_RemoveResult = "Search_RemoveResult", e.Search_RemoveAdvanced = "Search_RemoveAdvanced", e.Search_SavedQuery = "Search_SavedQuery", e.Search_WebService = "Search_WebService", e.Search_DidYouMean_Original = "Search_DidYouMean_Original", e.Search_DidYouMean_Correction = "Search_DidYouMean_Correction", e.Search_ExportCSV = "Search_ExportCSV", e.Search_SavedQuery_ExportCSV = "Search_SavedQuery_ExportCSV", e.Search_Selection_ExportCSV = "Search_Selection_ExportCSV", e.Search_AlertQuery = "Search_AlertQuery", e.Search_Select_AnalyticsItem = "Search_Select_AnalyticsItem", e.Search_Sort = "Search_Sort", e.Search_Exit_Logout = "Search_Exit_Logout", e.Search_Timeline_Usage = "Search_Timeline_Usage", e.Search_AutoComplete = "Search_Autocomplete", e.Search_Login_Success = "Login_Success_Form", e.Search_QueryIntent_Detected = "Search_QueryIntent_Detected", e.SavedQuery_Add = "SavedQuery_Add", e.SavedQuery_Delete = "SavedQuery_Delete", e.SavedQuery_DeleteAll = "SavedQuery_DeleteAll", e.SavedQuery_Rename = "SavedQuery_Rename", e.Alert_Edit = "Alert_Edit", e.Alert_Delete = "Alert_Delete", e.Alert_DeleteAll = "Alert_DeleteAll", e.Link_Display = "Link_Display", e.Link_Click = "Link_Click", e.Basket_Add = "Basket_Add", e.Basket_Delete = "Basket_Delete", e.Basket_DeleteAll = "Basket_DeleteAll", e.Basket_Rename = "Basket_Rename", e.Basket_AddDoc = "Basket_AddDoc", e.Basket_RemoveDoc = "Basket_RemoveDoc", e.Basket_Open = "Basket_Open", e.Basket_ExportCSV = "Basket_ExportCSV", e.Label_Add = "Label_Add", e.Label_Delete = "Label_Delete", e.Label_Rename = "Label_Rename", e.Label_Open = "Label_Open", e.Label_AddDoc = "Label_AddDoc", e.Label_RemoveDoc = "Label_RemoveDoc", e.Label_ExportCSV = "Label_ExportCSV", e.Label_Menu_ExportCSV = "Label_Menu_ExportCSV", e.Rating_Set = "Rating_Set", e.Rating_Delete = "Rating_Delete", e.Doc_Preview = "Doc_Preview", e.Doc_CacheHtml = "Doc_CacheHtml", e.Doc_CachePdf = "Doc_CachePdf", e.Doc_CacheOriginal = "Doc_CacheOriginal", e.Doc_Url1 = "Doc_Url1", e.Doc_Url2 = "Doc_Url2", e.Preview_Close = "Preview_Close", e.Click_ResultLink = "Click_ResultLink", e.Click_ResultLink1 = "Click_ResultLink1", e.Click_ResultLink2 = "Click_ResultLink2", e.Click_ResultLink3 = "Click_ResultLink3", e.Click_ResultLink4 = "Click_ResultLink4", e.Click_ResultLink5 = "Click_ResultLink5", e.Click_ResultLink6 = "Click_ResultLink6", e.Click_ResultLink7 = "Click_ResultLink7", e.Click_ResultLink8 = "Click_ResultLink8", e.Click_ResultLink9 = "Click_ResultLink9", e.Click_ResultLink10 = "Click_ResultLink10", e.Click_PreviewLink1 = "Click_PreviewLink1", e.Click_PreviewLink2 = "Click_PreviewLink2", e.Click_PreviewLink3 = "Click_PreviewLink3", e.Click_PreviewLink4 = "Click_PreviewLink4", e.Click_PreviewLink5 = "Click_PreviewLink5", e.Click_PreviewLink6 = "Click_PreviewLink6", e.Click_PreviewLink7 = "Click_PreviewLink7", e.Click_PreviewLink8 = "Click_PreviewLink8", e.Click_PreviewLink9 = "Click_PreviewLink9", e.Click_PreviewLink10 = "Click_PreviewLink10", e.RFM_ClickSet = "RFM_ClickSet", e.RFM_ClickReset = "RFM_ClickReset", e.RFM_Like = "RFM_Like", e.RFM_LikeReset = "RFM_LikeReset", e.RFM_Dislike = "RFM_Dislike", e.RFM_Important = "RFM_Important", e.RFM_ImportantReset = "RFM_ImportantReset", e.RFM_Ban = "RFM_Ban", e.Navigation_Exit = "Navigation_Exit", e.Navigation_Return = "Navigation_Return", e.Navigation_Route = "Navigation_Route", e.Answer_Display = "Answer_Display", e.Answer_Click = "Answer_Click", e.Answer_Result = "Answer_Result", e.Answer_Liked = "Answer_Liked", e.Answer_Disliked = "Answer_Disliked", e.Answer_Liked_Cancelled = "Answer_Liked_Cancelled", e.Answer_Disliked_Cancelled = "Answer_Disliked_Cancelled", e.TopPassages_Display = "TopPassages_Display", e.TopPassages_Click = "TopPassages_Click", e.UserSettings_Reset = "UserSettings_Reset", e.Change_Password_Failed = "change.password.failed", e.Change_Password_Success_Form = "change.password.success.form", e.Forgot_Password_Request = "forgot.password.request", e.Login_Denied = "login.denied", e.Login_Success_Form = "login.success.form", e.Send_Reset_Password_Link = "send.reset.password.link", e.Xrest_ChangePassword = "xrest.changepassword", e;
899
- }({}), V = /* @__PURE__ */ function(e) {
961
+ }({}), U = /* @__PURE__ */ function(e) {
900
962
  return e[e.none = 0] = "none", e[e.bool = 1] = "bool", e[e.date = 2] = "date", e[e.dateTime = 3] = "dateTime", e[e.time = 4] = "time", e[e.unsigned = 5] = "unsigned", e[e.integer = 6] = "integer", e[e.float = 7] = "float", e[e.double = 8] = "double", e[e.dates = 9] = "dates", e[e.dateTimes = 10] = "dateTimes", e[e.times = 11] = "times", e[e.varchar = 12] = "varchar", e[e.binary = 13] = "binary", e[e.string = 14] = "string", e[e.csv = 15] = "csv", e;
901
- }({}), H = /* @__PURE__ */ function(e) {
963
+ }({}), W = /* @__PURE__ */ function(e) {
902
964
  return e[e.none = 0] = "none", e[e.a = 2053] = "a", e[e.c = 4] = "c", e[e.d = 8] = "d", e[e.e = 2068] = "e", e[e.i = 256] = "i", e[e.l = 2052] = "l", e[e.n = 8192] = "n", e[e.t = 524292] = "t", e[e.x = 8388608] = "x", e[e.z = 33554432] = "z", e[e.f_ordinal = 8192] = "f_ordinal", e[e.f_multidates = 8192] = "f_multidates", e[e.f_varchar = 33554432] = "f_varchar", e[e.f_binary = 33562624] = "f_binary", e[e.f_string = 33562888] = "f_string", e[e.f_csv = 42477853] = "f_csv", e[e.f_overridable = 33554696] = "f_overridable", e;
903
- }({}), Lt = "1.0", Rt = /* @__PURE__ */ function(e) {
965
+ }({}), Wt = "1.0", Gt = /* @__PURE__ */ function(e) {
904
966
  return e[e.Original = 0] = "Original", e[e.Corrected = 1] = "Corrected", e;
905
- }({}), zt = /* @__PURE__ */ function(e) {
967
+ }({}), Kt = /* @__PURE__ */ function(e) {
906
968
  return e[e.none = 0] = "none", e[e.positiveRate = 1] = "positiveRate", e[e.mainlyPosRate = 2] = "mainlyPosRate", e[e.unrate = 4] = "unrate", e[e.mainlyNegRate = 8] = "mainlyNegRate", e[e.negativeRate = 16] = "negativeRate", e[e.all = 31] = "all", e[e.positiveOnly = 7] = "positiveOnly", e[e.negativeOnly = 28] = "negativeOnly", e[e.personalAll = 21] = "personalAll", e[e.personalPosOnly = 5] = "personalPosOnly", e[e.personalNegOnly = 20] = "personalNegOnly", e;
907
969
  }({});
908
970
  //#endregion
909
971
  //#region src/helpers/columns.ts
910
- function Bt(e) {
911
- if (!e) return V.none;
972
+ function qt(e) {
973
+ if (!e) return U.none;
912
974
  switch (e.toLocaleLowerCase()) {
913
975
  case "bool":
914
- case "boolean": return V.bool;
915
- case "date": return V.date;
916
- case "datetime": return V.dateTime;
917
- case "time": return V.time;
918
- case "unsigned": return V.unsigned;
919
- case "integer": return V.integer;
920
- case "float": return V.float;
921
- case "double": return V.double;
922
- case "dates": return V.dates;
923
- case "datetimes": return V.dateTimes;
924
- case "times": return V.times;
925
- case "varchar": return V.varchar;
926
- case "binary": return V.binary;
927
- case "string": return V.string;
928
- case "csv": return V.csv;
929
- default: return V.none;
976
+ case "boolean": return U.bool;
977
+ case "date": return U.date;
978
+ case "datetime": return U.dateTime;
979
+ case "time": return U.time;
980
+ case "unsigned": return U.unsigned;
981
+ case "integer": return U.integer;
982
+ case "float": return U.float;
983
+ case "double": return U.double;
984
+ case "dates": return U.dates;
985
+ case "datetimes": return U.dateTimes;
986
+ case "times": return U.times;
987
+ case "varchar": return U.varchar;
988
+ case "binary": return U.binary;
989
+ case "string": return U.string;
990
+ case "csv": return U.csv;
991
+ default: return U.none;
930
992
  }
931
993
  }
932
- function Vt(e) {
994
+ function Jt(e) {
933
995
  switch (e) {
934
- case "a": return H.a;
935
- case "c": return H.c;
936
- case "d": return H.d;
937
- case "e": return H.e;
938
- case "i": return H.i;
939
- case "l": return H.l;
940
- case "n": return H.n;
941
- case "t": return H.t;
942
- case "x": return H.x;
943
- case "z": return H.z;
944
- default: return H.none;
996
+ case "a": return W.a;
997
+ case "c": return W.c;
998
+ case "d": return W.d;
999
+ case "e": return W.e;
1000
+ case "i": return W.i;
1001
+ case "l": return W.l;
1002
+ case "n": return W.n;
1003
+ case "t": return W.t;
1004
+ case "x": return W.x;
1005
+ case "z": return W.z;
1006
+ default: return W.none;
945
1007
  }
946
1008
  }
947
- function Ht(e) {
948
- let t = H.none;
949
- if (e) for (let n of e) t |= Vt(n);
1009
+ function Yt(e) {
1010
+ let t = W.none;
1011
+ if (e) for (let n of e) t |= Jt(n);
950
1012
  return t;
951
1013
  }
952
- function U(e, t, n, r) {
1014
+ function G(e, t, n, r) {
953
1015
  return {
954
1016
  name: e,
955
1017
  type: t,
956
1018
  typeModifier: n,
957
- eType: Bt(t),
958
- eTypeModifier: Ht(n || ""),
1019
+ eType: qt(t),
1020
+ eTypeModifier: Yt(n || ""),
959
1021
  aliases: r
960
1022
  };
961
1023
  }
962
- var Ut = {
963
- id: U("id", "string"),
964
- text: U("text", "varchar"),
965
- documentlanguages: U("documentlanguages", "csv", "ci", ["language"]),
966
- databasealias: U("databasealias", "varchar"),
967
- globalrelevance: U("globalrelevance", "double"),
968
- matchingpartnames: U("matchingpartnames", "csv"),
969
- matchlocations: U("matchlocations", "csv"),
970
- matchlocationsperpartname: U("matchlocationsperpartname", "varchar"),
971
- extracts: U("extracts", "csv"),
972
- extractsperpartname: U("extractsperpartname", "varchar"),
973
- extractslocations: U("extractslocations", "csv"),
974
- documentweight: U("documentweight", "varchar"),
975
- groupcount: U("groupcount", "integer"),
976
- accesslists: U("accesslists", "varchar", void 0, ["accessLists"])
1024
+ var Xt = {
1025
+ id: G("id", "string"),
1026
+ text: G("text", "varchar"),
1027
+ documentlanguages: G("documentlanguages", "csv", "ci", ["language"]),
1028
+ databasealias: G("databasealias", "varchar"),
1029
+ globalrelevance: G("globalrelevance", "double"),
1030
+ matchingpartnames: G("matchingpartnames", "csv"),
1031
+ matchlocations: G("matchlocations", "csv"),
1032
+ matchlocationsperpartname: G("matchlocationsperpartname", "varchar"),
1033
+ extracts: G("extracts", "csv"),
1034
+ extractsperpartname: G("extractsperpartname", "varchar"),
1035
+ extractslocations: G("extractslocations", "csv"),
1036
+ documentweight: G("documentweight", "varchar"),
1037
+ groupcount: G("groupcount", "integer"),
1038
+ accesslists: G("accesslists", "varchar", void 0, ["accessLists"])
977
1039
  };
978
1040
  //#endregion
979
1041
  //#region src/helpers/filters.ts
980
- function Wt(e) {
1042
+ function Zt(e) {
981
1043
  return e.filter((e) => !!e);
982
1044
  }
983
- var W = {
1045
+ var K = {
984
1046
  eq: (e, t) => ({
985
1047
  field: e,
986
1048
  operator: "eq",
@@ -1051,44 +1113,44 @@ var W = {
1051
1113
  if (!n) return;
1052
1114
  let r = n.split(" AND ").map((e) => e.trim()).filter(Boolean).map((t) => {
1053
1115
  let n = t.substring(t.search(/\s/) + 1).trim();
1054
- return t.startsWith(">=") ? W.gte(e, n) : t.startsWith(">") ? W.gt(e, n) : t.startsWith("<=") ? W.lte(e, n) : W.lt(e, n);
1116
+ return t.startsWith(">=") ? K.gte(e, n) : t.startsWith(">") ? K.gt(e, n) : t.startsWith("<=") ? K.lte(e, n) : K.lt(e, n);
1055
1117
  });
1056
- return W.and(...r);
1118
+ return K.and(...r);
1057
1119
  },
1058
- and: (...e) => Gt("and", e),
1059
- or: (...e) => Gt("or", e),
1120
+ and: (...e) => Qt("and", e),
1121
+ or: (...e) => Qt("or", e),
1060
1122
  not: (...e) => {
1061
- let t = Wt(e);
1123
+ let t = Zt(e);
1062
1124
  return t.length ? {
1063
1125
  operator: "not",
1064
1126
  filters: t
1065
1127
  } : void 0;
1066
1128
  }
1067
1129
  };
1068
- function Gt(e, t) {
1069
- let n = Wt(t);
1130
+ function Qt(e, t) {
1131
+ let n = Zt(t);
1070
1132
  if (n.length !== 0) return n.length === 1 ? n[0] : {
1071
1133
  operator: e,
1072
1134
  filters: n
1073
1135
  };
1074
1136
  }
1075
- function Kt(e) {
1137
+ function $t(e) {
1076
1138
  if (!e) return;
1077
1139
  let { operator: t, field: n } = e;
1078
1140
  switch (t) {
1079
1141
  case "and":
1080
1142
  case "or": {
1081
- let n = (e.filters ?? []).map((e) => Kt(e));
1082
- return t === "and" ? W.and(...n) : W.or(...n);
1143
+ let n = (e.filters ?? []).map((e) => $t(e));
1144
+ return t === "and" ? K.and(...n) : K.or(...n);
1083
1145
  }
1084
1146
  case "not": {
1085
- let t = (e.filters ?? []).map((e) => Kt(e));
1086
- return W.not(...t);
1147
+ let t = (e.filters ?? []).map((e) => $t(e));
1148
+ return K.not(...t);
1087
1149
  }
1088
- case "in": return n && e.values?.length ? W.in(n, e.values) : void 0;
1089
- case "between": return n && e.start !== void 0 && e.end !== void 0 ? W.between(n, e.start, e.end) : void 0;
1090
- case "null": return n ? W.isNull(n) : void 0;
1091
- case "notnull": return n ? W.isNotNull(n) : void 0;
1150
+ case "in": return n && e.values?.length ? K.in(n, e.values) : void 0;
1151
+ case "between": return n && e.start !== void 0 && e.end !== void 0 ? K.between(n, e.start, e.end) : void 0;
1152
+ case "null": return n ? K.isNull(n) : void 0;
1153
+ case "notnull": return n ? K.isNotNull(n) : void 0;
1092
1154
  case "eq":
1093
1155
  case "neq":
1094
1156
  case "gt":
@@ -1097,12 +1159,12 @@ function Kt(e) {
1097
1159
  case "lte":
1098
1160
  case "like":
1099
1161
  case "contains":
1100
- case "regex": return n && e.value !== void 0 ? W[t](n, e.value) : void 0;
1101
- case void 0: return n && e.value !== void 0 ? W.eq(n, e.value) : void 0;
1162
+ case "regex": return n && e.value !== void 0 ? K[t](n, e.value) : void 0;
1163
+ case void 0: return n && e.value !== void 0 ? K.eq(n, e.value) : void 0;
1102
1164
  default: return;
1103
1165
  }
1104
1166
  }
1105
- function qt(e) {
1167
+ function en(e) {
1106
1168
  let t = [];
1107
1169
  function n(e) {
1108
1170
  for (let r of e) r.value ? (t.push(r.value), r.display && t.push(r.display)) : r.values && t.push(...r.values), r.filters && n(r.filters);
@@ -1111,14 +1173,14 @@ function qt(e) {
1111
1173
  }
1112
1174
  //#endregion
1113
1175
  //#region src/helpers/metadata.ts
1114
- function Jt(e, t) {
1176
+ function tn(e, t) {
1115
1177
  let n = e[t];
1116
1178
  return n === void 0 ? [] : (typeof n == "string" && (n = String(n).split(",")), Array.isArray(n) ? n.map((e) => {
1117
1179
  if (typeof e == "string") return e.trim();
1118
1180
  if (typeof e == "object" && e && "display" in e) return e.display.trim();
1119
1181
  }).filter((e) => e !== void 0) : [String(n).trim()]);
1120
1182
  }
1121
- function Yt(e, t) {
1183
+ function nn(e, t) {
1122
1184
  let n = e[t];
1123
1185
  if (n === void 0) return [];
1124
1186
  if (typeof n == "string" && (n = String(n).split(",")), Array.isArray(n)) return n.map((e) => {
@@ -1142,7 +1204,7 @@ function Yt(e, t) {
1142
1204
  }
1143
1205
  //#endregion
1144
1206
  //#region src/helpers/pagination.ts
1145
- function Xt(e) {
1207
+ function rn(e) {
1146
1208
  let { page: t, pageSize: n, rowCount: r } = e;
1147
1209
  return t === void 0 || !n || r === void 0 ? {
1148
1210
  nextPage: void 0,
@@ -1154,35 +1216,35 @@ function Xt(e) {
1154
1216
  }
1155
1217
  //#endregion
1156
1218
  //#region src/helpers/utils.ts
1157
- function G(e) {
1219
+ function q(e) {
1158
1220
  return typeof e == "object" && !!e;
1159
1221
  }
1160
- function Zt(e) {
1161
- return G(e) && Object.prototype.toString.call(e) === "[object ArrayBuffer]";
1222
+ function an(e) {
1223
+ return q(e) && Object.prototype.toString.call(e) === "[object ArrayBuffer]";
1162
1224
  }
1163
- function Qt(e) {
1164
- return G(e) && Object.prototype.toString.call(e) === "[object Blob]";
1225
+ function on(e) {
1226
+ return q(e) && Object.prototype.toString.call(e) === "[object Blob]";
1165
1227
  }
1166
- function $t(e) {
1228
+ function sn(e) {
1167
1229
  return Object.prototype.toString.call(e) === "[object Date]";
1168
1230
  }
1169
- function en(e) {
1231
+ function cn(e) {
1170
1232
  return typeof e == "string";
1171
1233
  }
1172
- function tn(e) {
1173
- return (G(e) || Array.isArray(e)) && !Zt(e) && !Qt(e) && !en(e);
1234
+ function ln(e) {
1235
+ return (q(e) || Array.isArray(e)) && !an(e) && !on(e) && !cn(e);
1174
1236
  }
1175
- function nn(e) {
1237
+ function un(e) {
1176
1238
  return e ? (e.getHours() * 60 * 60 + e.getMinutes() * 60 + e.getSeconds()) * 1e3 + e.getMilliseconds() : 0;
1177
1239
  }
1178
- function rn(e = !0) {
1240
+ function dn(e = !0) {
1179
1241
  let t = Date.now();
1180
1242
  return (e ? "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" : "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g, (e) => {
1181
1243
  let n = (t + Math.random() * 16) % 16 | 0;
1182
1244
  return t = Math.floor(t / 16), (e === "x" ? n : n & 3 | 8).toString(16);
1183
1245
  });
1184
1246
  }
1185
- function an(e) {
1247
+ function fn(e) {
1186
1248
  if (!e) return "``";
1187
1249
  if (e = String(e), e.search(/[\\`]/) === -1) return `\`${e}\``;
1188
1250
  let t = ["`"];
@@ -1192,13 +1254,13 @@ function an(e) {
1192
1254
  }
1193
1255
  return t.push("`"), t.join("");
1194
1256
  }
1195
- async function on(e) {
1257
+ async function pn(e) {
1196
1258
  let t = globalThis.crypto?.subtle;
1197
1259
  if (typeof t?.digest != "function") throw Error("sha512 requires the Web Crypto API, and `crypto.subtle` is unavailable here. That usually means an insecure context: it is exposed over HTTPS and on localhost, but not over plain HTTP. Serve the application over HTTPS.");
1198
1260
  let n = await t.digest("SHA-512", new TextEncoder().encode(e));
1199
1261
  return Array.from(new Uint8Array(n), (e) => e.toString(16).padStart(2, "0")).join("");
1200
1262
  }
1201
- function sn(e, t = 0) {
1263
+ function mn(e, t = 0) {
1202
1264
  let n = 3735928559 ^ t, r = 1103547991 ^ t;
1203
1265
  for (let t = 0; t < e.length; t++) {
1204
1266
  let i = e.charCodeAt(t);
@@ -1208,52 +1270,52 @@ function sn(e, t = 0) {
1208
1270
  }
1209
1271
  //#endregion
1210
1272
  //#region src/web-api/v1/fetch-audit.ts
1211
- var cn, ln;
1212
- function K(e, t = !0) {
1213
- let n = un(e.$auditRecord);
1214
- n && (dn(n), t && fn(n)), e.$auditRecord = n;
1273
+ var hn, gn;
1274
+ function J(e, t = !0) {
1275
+ let n = _n(e.$auditRecord);
1276
+ n && (vn(n), t && yn(n)), e.$auditRecord = n;
1215
1277
  }
1216
- function un(e) {
1278
+ function _n(e) {
1217
1279
  if (!e) return;
1218
1280
  let t;
1219
1281
  if (Array.isArray(e)) t = e;
1220
- else if (G(e)) {
1282
+ else if (q(e)) {
1221
1283
  let n = e;
1222
1284
  if (n.auditEvents || n.mlAuditEvents) return n;
1223
1285
  t = [e];
1224
1286
  }
1225
1287
  return { auditEvents: t };
1226
1288
  }
1227
- function dn(e) {
1228
- let t = pn();
1289
+ function vn(e) {
1290
+ let t = bn();
1229
1291
  return e.auditEvents?.forEach((e) => {
1230
1292
  e.detail ||= {}, e.detail.sessionid = t;
1231
1293
  }), e;
1232
1294
  }
1233
- function fn(e) {
1295
+ function yn(e) {
1234
1296
  let t = typeof window < "u" ? decodeURIComponent(window.location.href) : "http://localhost";
1235
1297
  return e?.auditEvents?.forEach((e) => {
1236
1298
  e.detail ||= {}, e.detail.url = t;
1237
1299
  }), e;
1238
1300
  }
1239
- function pn() {
1240
- return (!cn || mn()) && (cn = rn()), ln = /* @__PURE__ */ new Date(), cn;
1301
+ function bn() {
1302
+ return (!hn || xn()) && (hn = dn()), gn = /* @__PURE__ */ new Date(), hn;
1241
1303
  }
1242
- function mn() {
1243
- return Date.now() - ln.getTime() > 600 * 1e3;
1304
+ function xn() {
1305
+ return Date.now() - gn.getTime() > 6e5;
1244
1306
  }
1245
- async function hn(e, t = !0, n = g) {
1307
+ async function Sn(e, t = !0, n = g) {
1246
1308
  let r = {
1247
- event: B.None,
1309
+ event: H.None,
1248
1310
  $auditRecord: e
1249
1311
  };
1250
- return K(r, t), P(n, "api/v1/audit.notify", r, { noRecovery: !0 });
1312
+ return J(r, t), I(n, "api/v1/audit.notify", r, { noRecovery: !0 });
1251
1313
  }
1252
- var gn = { notify: hn };
1314
+ var Cn = { notify: Sn };
1253
1315
  //#endregion
1254
1316
  //#region src/web-api/v1/fetch-aggregation.ts
1255
- async function _n(e, t, n, r, i = g) {
1256
- let a = r ?? Pt(e.name, t, i.config.aggregationCounts), o = e.items?.length || 0, s = {
1317
+ async function wn(e, t, n, r, i = g) {
1318
+ let a = r ?? Vt(e.name, t, i.config.aggregationCounts), o = e.items?.length || 0, s = {
1257
1319
  query: {
1258
1320
  ...t,
1259
1321
  action: "aggregate",
@@ -1264,32 +1326,32 @@ async function _n(e, t, n, r, i = g) {
1264
1326
  },
1265
1327
  ...n ? { $auditRecord: { auditEvents: [n] } } : {}
1266
1328
  };
1267
- K(s);
1268
- let c = (await P(i, "api/v1/query", s)).aggregations[0];
1269
- return c.$hasMore = Ft(c, a), c.items = [...e.items ?? [], ...c.items ?? []], Promise.resolve(c);
1329
+ J(s);
1330
+ let c = (await I(i, "api/v1/query", s)).aggregations[0];
1331
+ return c.$hasMore = Ht(c, a), c.items = [...e.items ?? [], ...c.items ?? []], Promise.resolve(c);
1270
1332
  }
1271
1333
  //#endregion
1272
1334
  //#region src/web-api/v1/fetch-dataset.ts
1273
- async function vn(e, t, n = {}, r = g) {
1274
- let i = await P(r, `api/v1/search.dataset/${e}/${t}`, { parameters: n }), a = t[0].toLowerCase() + t.slice(1), o = i.datasets[a];
1335
+ async function Tn(e, t, n = {}, r = g) {
1336
+ let i = await I(r, `api/v1/search.dataset/${e}/${t}`, { parameters: n }), a = t[0].toLowerCase() + t.slice(1), o = i.datasets[a];
1275
1337
  if ("errorCode" in o && "errorMessage" in o) throw Error(o.errorMessage);
1276
1338
  return o;
1277
1339
  }
1278
- async function yn(e, t, n = g) {
1340
+ async function En(e, t, n = g) {
1279
1341
  let r = `api/v1/search.dataset/${e}`, { parameters: i = {}, datasets: a = [] } = t;
1280
- return (await P(n, r, {
1342
+ return (await I(n, r, {
1281
1343
  parameters: i,
1282
1344
  datasets: a
1283
1345
  })).datasets;
1284
1346
  }
1285
- async function bn(e, t = g) {
1286
- return await I(t, `api/v1/search.dataset/${e}`);
1347
+ async function Dn(e, t = g) {
1348
+ return await R(t, `api/v1/search.dataset/${e}`);
1287
1349
  }
1288
1350
  //#endregion
1289
1351
  //#region src/web-api/v1/fetch-labels.ts
1290
- async function xn(e, t = !0, n, r = g) {
1352
+ async function On(e, t = !0, n, r = g) {
1291
1353
  try {
1292
- return (await P(r, "api/v1/labels", {
1354
+ return (await I(r, "api/v1/labels", {
1293
1355
  action: "list",
1294
1356
  q: e,
1295
1357
  public: t,
@@ -1300,10 +1362,10 @@ async function xn(e, t = !0, n, r = g) {
1300
1362
  throw l("Error in fetchLabels", e), e;
1301
1363
  }
1302
1364
  }
1303
- async function Sn(e = g) {
1365
+ async function kn(e = g) {
1304
1366
  try {
1305
1367
  let { app: t = "" } = e.config;
1306
- return await I(e, "api/v1/labels", new URLSearchParams({
1368
+ return await R(e, "api/v1/labels", new URLSearchParams({
1307
1369
  app: t,
1308
1370
  action: "getUserRights"
1309
1371
  }));
@@ -1311,7 +1373,7 @@ async function Sn(e = g) {
1311
1373
  throw l("Error in getUserRights", e), e;
1312
1374
  }
1313
1375
  }
1314
- async function Cn(e, t, n = !0, r = g) {
1376
+ async function An(e, t, n = !0, r = g) {
1315
1377
  try {
1316
1378
  let i = {
1317
1379
  action: "add",
@@ -1320,7 +1382,7 @@ async function Cn(e, t, n = !0, r = g) {
1320
1382
  public: n,
1321
1383
  $auditRecord: {
1322
1384
  auditEvents: [{
1323
- type: B.Label_AddDoc,
1385
+ type: H.Label_AddDoc,
1324
1386
  detail: {
1325
1387
  public: n,
1326
1388
  label: e ? e.toString() : null,
@@ -1333,12 +1395,12 @@ async function Cn(e, t, n = !0, r = g) {
1333
1395
  }]
1334
1396
  }
1335
1397
  };
1336
- return K(i), await P(r, "api/v1/labels", i);
1398
+ return J(i), await I(r, "api/v1/labels", i);
1337
1399
  } catch (e) {
1338
1400
  throw l("Error in add", e), e;
1339
1401
  }
1340
1402
  }
1341
- async function wn(e, t, n = !0, r = g) {
1403
+ async function jn(e, t, n = !0, r = g) {
1342
1404
  try {
1343
1405
  let i = {
1344
1406
  action: "remove",
@@ -1347,7 +1409,7 @@ async function wn(e, t, n = !0, r = g) {
1347
1409
  public: n,
1348
1410
  $auditRecord: {
1349
1411
  auditEvents: [{
1350
- type: B.Label_RemoveDoc,
1412
+ type: H.Label_RemoveDoc,
1351
1413
  detail: {
1352
1414
  public: n,
1353
1415
  label: e ? e.toString() : null,
@@ -1360,12 +1422,12 @@ async function wn(e, t, n = !0, r = g) {
1360
1422
  }]
1361
1423
  }
1362
1424
  };
1363
- return K(i), await P(r, "api/v1/labels", i);
1425
+ return J(i), await I(r, "api/v1/labels", i);
1364
1426
  } catch (e) {
1365
1427
  throw l("Error in remove", e), e;
1366
1428
  }
1367
1429
  }
1368
- async function Tn(e, t, n = !0, r = g) {
1430
+ async function Mn(e, t, n = !0, r = g) {
1369
1431
  try {
1370
1432
  let i = {
1371
1433
  action: "rename",
@@ -1373,7 +1435,7 @@ async function Tn(e, t, n = !0, r = g) {
1373
1435
  newLabel: t,
1374
1436
  public: n,
1375
1437
  $auditRecord: { auditEvents: [{
1376
- type: B.Label_Rename,
1438
+ type: H.Label_Rename,
1377
1439
  detail: {
1378
1440
  public: n,
1379
1441
  oldlabel: e ? e.toString() : null,
@@ -1381,31 +1443,31 @@ async function Tn(e, t, n = !0, r = g) {
1381
1443
  }
1382
1444
  }] }
1383
1445
  };
1384
- return K(i), await P(r, "api/v1/labels", i);
1446
+ return J(i), await I(r, "api/v1/labels", i);
1385
1447
  } catch (e) {
1386
1448
  throw l("Error in rename", e), e;
1387
1449
  }
1388
1450
  }
1389
- async function En(e, t = !0, n = g) {
1451
+ async function Nn(e, t = !0, n = g) {
1390
1452
  try {
1391
1453
  let r = {
1392
1454
  action: "delete",
1393
1455
  labels: e,
1394
1456
  public: t,
1395
1457
  $auditRecord: { auditEvents: [{
1396
- type: B.Label_Delete,
1458
+ type: H.Label_Delete,
1397
1459
  detail: {
1398
1460
  public: t,
1399
1461
  label: e ? e.toString() : null
1400
1462
  }
1401
1463
  }] }
1402
1464
  };
1403
- return K(r), await P(n, "api/v1/labels", r);
1465
+ return J(r), await I(n, "api/v1/labels", r);
1404
1466
  } catch (e) {
1405
1467
  throw l("Error in deleteLabels", e), e;
1406
1468
  }
1407
1469
  }
1408
- async function Dn(e, t, n = !0, r = g) {
1470
+ async function Pn(e, t, n = !0, r = g) {
1409
1471
  try {
1410
1472
  let i = {
1411
1473
  action: "bulkAdd",
@@ -1413,7 +1475,7 @@ async function Dn(e, t, n = !0, r = g) {
1413
1475
  query: t,
1414
1476
  public: n,
1415
1477
  $auditRecord: { auditEvents: [{
1416
- type: B.Label_Add,
1478
+ type: H.Label_Add,
1417
1479
  detail: {
1418
1480
  public: n,
1419
1481
  label: e ? e.toString() : null,
@@ -1421,12 +1483,12 @@ async function Dn(e, t, n = !0, r = g) {
1421
1483
  }
1422
1484
  }] }
1423
1485
  };
1424
- return K(i), await P(r, "api/v1/labels", i);
1486
+ return J(i), await I(r, "api/v1/labels", i);
1425
1487
  } catch (e) {
1426
1488
  throw l("Error in bulkAdd", e), e;
1427
1489
  }
1428
1490
  }
1429
- async function On(e, t, n = !0, r = g) {
1491
+ async function Fn(e, t, n = !0, r = g) {
1430
1492
  try {
1431
1493
  let i = {
1432
1494
  action: "bulkRemove",
@@ -1434,7 +1496,7 @@ async function On(e, t, n = !0, r = g) {
1434
1496
  query: t,
1435
1497
  public: n,
1436
1498
  $auditRecord: { auditEvents: [{
1437
- type: B.Label_Delete,
1499
+ type: H.Label_Delete,
1438
1500
  detail: {
1439
1501
  public: n,
1440
1502
  label: e ? e.toString() : null,
@@ -1442,30 +1504,30 @@ async function On(e, t, n = !0, r = g) {
1442
1504
  }
1443
1505
  }] }
1444
1506
  };
1445
- return K(i), await P(r, "api/v1/labels", i);
1507
+ return J(i), await I(r, "api/v1/labels", i);
1446
1508
  } catch (e) {
1447
1509
  throw l("Error in bulkRemove", e), e;
1448
1510
  }
1449
1511
  }
1450
- var q = {
1451
- getUserRights: Sn,
1452
- add: Cn,
1453
- remove: wn,
1454
- rename: Tn,
1455
- delete: En,
1456
- bulkAdd: Dn,
1457
- bulkRemove: On
1512
+ var Y = {
1513
+ getUserRights: kn,
1514
+ add: An,
1515
+ remove: jn,
1516
+ rename: Mn,
1517
+ delete: Nn,
1518
+ bulkAdd: Pn,
1519
+ bulkRemove: Fn
1458
1520
  };
1459
1521
  //#endregion
1460
1522
  //#region src/web-api/v1/fetch-preview.ts
1461
- async function kn(e, t, n = g) {
1462
- if (typeof window > "u") return P(n, "api/v1/preview", {
1523
+ async function In(e, t, n = g) {
1524
+ if (typeof window > "u") return I(n, "api/v1/preview", {
1463
1525
  action: "get",
1464
1526
  id: e,
1465
1527
  query: t
1466
1528
  });
1467
1529
  let r = `${window.location.origin}${window.location.pathname}`;
1468
- return P(n, "api/v1/preview", {
1530
+ return I(n, "api/v1/preview", {
1469
1531
  action: "get",
1470
1532
  id: e,
1471
1533
  query: {
@@ -1475,66 +1537,66 @@ async function kn(e, t, n = g) {
1475
1537
  browserUrl: r
1476
1538
  });
1477
1539
  }
1478
- async function An(e, t = g) {
1479
- return M(t, /^[a-z][a-z0-9+.-]*:\/\//i.test(e) ? e : D(t, e.replace(/^\//, "")), {
1540
+ async function Ln(e, t = g) {
1541
+ return P(t, /^[a-z][a-z0-9+.-]*:\/\//i.test(e) ? e : O(t, e.replace(/^\//, "")), {
1480
1542
  method: "GET",
1481
- headers: E(t)
1543
+ headers: D(t)
1482
1544
  }, { responseType: "text" });
1483
1545
  }
1484
1546
  //#endregion
1485
1547
  //#region src/web-api/v1/fetch-principal.ts
1486
- async function jn(e, t = g) {
1487
- return I(t, "api/v1/principal", new URLSearchParams({ action: "get" }), {
1488
- noAutoAuthentication: j(t),
1548
+ async function Rn(e, t = g) {
1549
+ return R(t, "api/v1/principal", new URLSearchParams({ action: "get" }), {
1550
+ noAutoAuthentication: N(t),
1489
1551
  ...e
1490
1552
  });
1491
1553
  }
1492
- async function Mn(e, t = g) {
1554
+ async function zn(e, t = g) {
1493
1555
  let n = new URLSearchParams();
1494
1556
  return Object.entries(e).forEach(([e, t]) => {
1495
1557
  t !== void 0 && n.append(e, String(t));
1496
- }), I(t, "api/v1/principal/list", n, { noAutoAuthentication: j(t) });
1558
+ }), R(t, "api/v1/principal/list", n, { noAutoAuthentication: N(t) });
1497
1559
  }
1498
- async function Nn(e, t = g) {
1499
- return e ? I(t, "api/v1/principal", new URLSearchParams({
1560
+ async function Bn(e, t = g) {
1561
+ return e ? R(t, "api/v1/principal", new URLSearchParams({
1500
1562
  action: "userid",
1501
1563
  userid: e
1502
- }), { noAutoAuthentication: j(t) }) : Promise.reject(/* @__PURE__ */ Error("userid is required"));
1564
+ }), { noAutoAuthentication: N(t) }) : Promise.reject(/* @__PURE__ */ Error("userid is required"));
1503
1565
  }
1504
- async function Pn(e, t = g) {
1505
- return e.length === 0 ? Promise.reject(/* @__PURE__ */ Error("userids is required")) : I(t, "api/v1/principal/userids", new URLSearchParams({ userids: [...e].join(",") }), { noAutoAuthentication: j(t) });
1566
+ async function Vn(e, t = g) {
1567
+ return e.length === 0 ? Promise.reject(/* @__PURE__ */ Error("userids is required")) : R(t, "api/v1/principal/userids", new URLSearchParams({ userids: [...e].join(",") }), { noAutoAuthentication: N(t) });
1506
1568
  }
1507
- var Fn = { principal: {
1508
- get: jn,
1509
- list: Mn,
1510
- userid: Nn,
1511
- userids: Pn
1569
+ var Hn = { principal: {
1570
+ get: Rn,
1571
+ list: zn,
1572
+ userid: Bn,
1573
+ userids: Vn
1512
1574
  } };
1513
1575
  //#endregion
1514
1576
  //#region src/web-api/v1/fetch-query.ts
1515
- function In(e, t, n) {
1577
+ function Un(e, t, n) {
1516
1578
  let r = n.config.aggregationCounts;
1517
1579
  e.aggregations?.forEach((e) => {
1518
- e.$hasMore = Ft(e, Pt(e.name, t, r)), e.isTree && zn(e);
1580
+ e.$hasMore = Ht(e, Vt(e.name, t, r)), e.isTree && Kn(e);
1519
1581
  });
1520
1582
  }
1521
- async function Ln(e, t, n, r = g) {
1522
- let i = await P(r, "api/v1/query", {
1583
+ async function Wn(e, t, n, r = g) {
1584
+ let i = await I(r, "api/v1/query", {
1523
1585
  query: e,
1524
1586
  $auditRecord: t,
1525
1587
  queryIntentData: n
1526
1588
  });
1527
- In(i, e, r), i.records?.map((e) => Object.assign(e, {
1589
+ Un(i, e, r), i.records?.map((e) => Object.assign(e, {
1528
1590
  value: e.title,
1529
1591
  type: "default"
1530
1592
  }));
1531
1593
  let a = {
1532
1594
  ...i,
1533
- ...Xt(i)
1595
+ ...rn(i)
1534
1596
  };
1535
1597
  return Promise.resolve(a);
1536
1598
  }
1537
- async function Rn(e, t, n, r = g) {
1599
+ async function Gn(e, t, n, r = g) {
1538
1600
  let { app: i = "" } = r.config, a = {
1539
1601
  methods: [],
1540
1602
  mode: t,
@@ -1546,9 +1608,9 @@ async function Rn(e, t, n, r = g) {
1546
1608
  app: i,
1547
1609
  query: t
1548
1610
  });
1549
- let o = await P(r, "api/v1/multi", a);
1611
+ let o = await I(r, "api/v1/multi", a);
1550
1612
  o.results.forEach((t, n) => {
1551
- In(t, e[n], r);
1613
+ Un(t, e[n], r);
1552
1614
  }), o.results.forEach((e) => {
1553
1615
  e.records?.map((e) => Object.assign(e, {
1554
1616
  value: e.title,
@@ -1557,23 +1619,23 @@ async function Rn(e, t, n, r = g) {
1557
1619
  });
1558
1620
  let s = o.results.map((e) => ({
1559
1621
  ...e,
1560
- ...Xt(e)
1622
+ ...rn(e)
1561
1623
  }));
1562
1624
  return Promise.resolve(s);
1563
1625
  }
1564
- function zn(e, t = "", n = 0) {
1626
+ function Kn(e, t = "", n = 0) {
1565
1627
  let r = [];
1566
1628
  return e.items && e.items.forEach((e) => {
1567
1629
  let i = t ? `${t}/${e.value}` : e.value, a = n + 1;
1568
1630
  r.push({
1569
1631
  path: i,
1570
1632
  level: a
1571
- }), e.$path = i, e.$level = a, e.hasChildren ? r = r.concat(zn(e, i, a)) : e.hasChildren = !1;
1633
+ }), e.$path = i, e.$level = a, e.hasChildren ? r = r.concat(Kn(e, i, a)) : e.hasChildren = !1;
1572
1634
  }), r;
1573
1635
  }
1574
1636
  //#endregion
1575
1637
  //#region src/web-api/v1/fetch-query-export.ts
1576
- async function Bn({ model: e, appName: t, query: n, article: r }, i = g) {
1638
+ async function qn({ model: e, appName: t, query: n, article: r }, i = g) {
1577
1639
  let { webservice: a, format: o, maxcount: s, exportedColumns: c, export: l } = e, u = {
1578
1640
  app: t,
1579
1641
  webservice: a,
@@ -1587,24 +1649,24 @@ async function Bn({ model: e, appName: t, query: n, article: r }, i = g) {
1587
1649
  detail: { resultid: r ? r.id : void 0 }
1588
1650
  }] }
1589
1651
  };
1590
- return K(u), await P(i, "api/v1/search.queryexport", u, { responseType: "blob" });
1652
+ return J(u), await I(i, "api/v1/search.queryexport", u, { responseType: "blob" });
1591
1653
  }
1592
1654
  //#endregion
1593
1655
  //#region src/web-api/v1/fetch-query-intent.ts
1594
- async function Vn(e, t = g) {
1595
- return (await P(t, "api/v1/queryintent", { query: e }))?.intents;
1656
+ async function Jn(e, t = g) {
1657
+ return (await I(t, "api/v1/queryintent", { query: e }))?.intents;
1596
1658
  }
1597
1659
  //#endregion
1598
1660
  //#region src/web-api/v1/fetch-security-principal.ts
1599
- var Hn = "api/v1/security.principal";
1600
- function Un(e, t, n = g) {
1601
- return P(n, Hn, {
1661
+ var Yn = "api/v1/security.principal";
1662
+ function Xn(e, t, n = g) {
1663
+ return I(n, Yn, {
1602
1664
  action: "list",
1603
1665
  ...e
1604
1666
  }, { signal: t });
1605
1667
  }
1606
- async function Wn(e, t = g) {
1607
- return e.length ? (await P(t, Hn, {
1668
+ async function Zn(e, t = g) {
1669
+ return e.length ? (await I(t, Yn, {
1608
1670
  action: "userids",
1609
1671
  userids: e,
1610
1672
  limit: e.length
@@ -1612,16 +1674,16 @@ async function Wn(e, t = g) {
1612
1674
  }
1613
1675
  //#endregion
1614
1676
  //#region src/web-api/v1/fetch-similar-documents.ts
1615
- async function Gn(e, t, n, r = g) {
1616
- return (await P(r, "api/v1/similardocuments", {
1677
+ async function Qn(e, t, n, r = g) {
1678
+ return (await I(r, "api/v1/similardocuments", {
1617
1679
  sourceDocumentId: e,
1618
1680
  query: { name: t }
1619
1681
  }, { signal: n })).data;
1620
1682
  }
1621
1683
  //#endregion
1622
1684
  //#region src/web-api/v1/fetch-sponsored-links.ts
1623
- async function Kn(e, t, n = g) {
1624
- return (await P(n, "api/v1/query.links", {
1685
+ async function $n(e, t, n = g) {
1686
+ return (await I(n, "api/v1/query.links", {
1625
1687
  webservice: e,
1626
1688
  query: t
1627
1689
  }))?.links?.map((e) => ({
@@ -1631,9 +1693,9 @@ async function Kn(e, t, n = g) {
1631
1693
  }
1632
1694
  //#endregion
1633
1695
  //#region src/utils/to-sql.ts
1634
- function qn(e, t) {
1696
+ function er(e, t) {
1635
1697
  if (typeof e == "number") return `${e}`;
1636
- if ($t(e)) return t ? `'${Jn(e)}'` : Jn(e);
1698
+ if (sn(e)) return t ? `'${tr(e)}'` : tr(e);
1637
1699
  if (typeof e == "boolean") return e ? "true" : "false";
1638
1700
  if (e === null) return "null";
1639
1701
  if (Array.isArray(e)) {
@@ -1644,10 +1706,10 @@ function qn(e, t) {
1644
1706
  }
1645
1707
  return t ? `'${e}'` : e;
1646
1708
  }
1647
- function Jn(e) {
1709
+ function tr(e) {
1648
1710
  if (!e) return "";
1649
1711
  try {
1650
- return nn(e) === 0 ? new Intl.DateTimeFormat("en-CA", {
1712
+ return un(e) === 0 ? new Intl.DateTimeFormat("en-CA", {
1651
1713
  year: "numeric",
1652
1714
  month: "2-digit",
1653
1715
  day: "2-digit"
@@ -1663,7 +1725,7 @@ function Jn(e) {
1663
1725
  }
1664
1726
  //#endregion
1665
1727
  //#region src/web-api/v1/fetch-suggest.ts
1666
- async function Yn(e, t, n, r, i, a = g) {
1728
+ async function nr(e, t, n, r, i, a = g) {
1667
1729
  let { app: o } = a.config, s = {
1668
1730
  app: o || "",
1669
1731
  suggestQuery: e,
@@ -1673,14 +1735,14 @@ async function Yn(e, t, n, r, i, a = g) {
1673
1735
  showSource: i
1674
1736
  };
1675
1737
  try {
1676
- return (await P(a, "api/v1/search.suggest", s)).suggests;
1738
+ return (await I(a, "api/v1/search.suggest", s)).suggests;
1677
1739
  } catch (e) {
1678
1740
  throw console.error("Error fetching suggestions:", e), e;
1679
1741
  }
1680
1742
  }
1681
- async function Xn(e, t, n, r, i = g) {
1743
+ async function rr(e, t, n, r, i = g) {
1682
1744
  let { app: a } = i.config;
1683
- return (await P(i, "api/v1/suggestquery", {
1745
+ return (await I(i, "api/v1/suggestquery", {
1684
1746
  app: a || "",
1685
1747
  suggestQuery: e,
1686
1748
  text: t,
@@ -1688,22 +1750,22 @@ async function Xn(e, t, n, r, i = g) {
1688
1750
  kinds: r
1689
1751
  })).suggests;
1690
1752
  }
1691
- async function Zn(e, t, n, r = g) {
1753
+ async function ir(e, t, n, r = g) {
1692
1754
  if (!t) return Promise.resolve([]);
1693
- let { app: i } = r.config, a = await P(r, "api/v1/suggestfield", {
1755
+ let { app: i } = r.config, a = await I(r, "api/v1/suggestfield", {
1694
1756
  app: i || "",
1695
1757
  text: e,
1696
1758
  fields: t,
1697
1759
  query: n
1698
1760
  });
1699
1761
  return a.suggests.forEach((e) => {
1700
- e.display = qn(e.display);
1762
+ e.display = er(e.display);
1701
1763
  }), a.suggests;
1702
1764
  }
1703
1765
  //#endregion
1704
1766
  //#region src/web-api/v1/fetch-text-chunk.ts
1705
- async function Qn(e, t, n, r, i, a, o = g) {
1706
- return P(o, "api/v1/doc.textchunks", {
1767
+ async function ar(e, t, n, r, i, a, o = g) {
1768
+ return I(o, "api/v1/doc.textchunks", {
1707
1769
  id: e,
1708
1770
  textChunks: t,
1709
1771
  highlights: n,
@@ -1714,252 +1776,252 @@ async function Qn(e, t, n, r, i, a, o = g) {
1714
1776
  }
1715
1777
  //#endregion
1716
1778
  //#region src/web-api/v1/fetch-user-settings.ts
1717
- async function $n(e = g) {
1779
+ async function or(e = g) {
1718
1780
  let { app: t } = e.config;
1719
- return I(e, "api/v1/usersettings", new URLSearchParams({
1781
+ return R(e, "api/v1/usersettings", new URLSearchParams({
1720
1782
  app: t || "",
1721
1783
  action: "load"
1722
1784
  }));
1723
1785
  }
1724
- async function er(e, t, n = g) {
1786
+ async function sr(e, t, n = g) {
1725
1787
  let r = {
1726
1788
  action: "save",
1727
1789
  userSettings: e,
1728
1790
  $auditRecord: { auditEvents: [t] }
1729
1791
  };
1730
- return K(r), P(n, "api/v1/usersettings", r);
1792
+ return J(r), I(n, "api/v1/usersettings", r);
1731
1793
  }
1732
- async function tr(e, t, n = g) {
1794
+ async function cr(e, t, n = g) {
1733
1795
  let r = {
1734
1796
  action: "patch",
1735
1797
  userSettings: e,
1736
1798
  $auditRecord: t ? { auditEvents: [t] } : void 0
1737
1799
  };
1738
- return K(r), P(n, "api/v1/usersettings", r);
1800
+ return J(r), I(n, "api/v1/usersettings", r);
1739
1801
  }
1740
- async function nr(e = g) {
1741
- return er({}, { type: "UserSettings_Reset" }, e);
1802
+ async function lr(e = g) {
1803
+ return sr({}, { type: "UserSettings_Reset" }, e);
1742
1804
  }
1743
1805
  //#endregion
1744
1806
  //#region src/web-api/v2/fetch-change-password.ts
1745
- async function rr(e, t, n = g) {
1746
- return P(n, "api/v2/security/password/change", {
1807
+ async function ur(e, t, n = g) {
1808
+ return I(n, "api/v2/security/password/change", {
1747
1809
  newPassword: e,
1748
1810
  currentPassword: t
1749
1811
  });
1750
1812
  }
1751
1813
  //#endregion
1752
- //#region src/web-api/v2/fetch-document-upload-container.ts
1753
- var J = "api/v2/document-upload/container";
1754
- function ir(e) {
1814
+ //#region src/web-api/v2/fetch-agent-workspace.ts
1815
+ var X = "api/v2/agent-workspace/workspace";
1816
+ function dr(e) {
1755
1817
  let t = new URLSearchParams();
1756
1818
  return e.page !== void 0 && t.set("pageNumber", String(e.page)), e.pageSize !== void 0 && t.set("pageSize", String(e.pageSize)), t;
1757
1819
  }
1758
- function ar(e) {
1820
+ function fr(e) {
1759
1821
  let { pageNumber: t, ...n } = e;
1760
1822
  return {
1761
1823
  ...n,
1762
1824
  page: t
1763
1825
  };
1764
1826
  }
1765
- async function or(e = {}, t = g) {
1766
- return ar(await I(t, J, ir(e)));
1827
+ async function pr(e = {}, t = g) {
1828
+ return fr(await R(t, X, dr(e)));
1767
1829
  }
1768
- function sr(e, t = g) {
1769
- return I(t, `${J}/${encodeURIComponent(e)}`);
1830
+ function mr(e, t = g) {
1831
+ return R(t, `${X}/${encodeURIComponent(e)}`);
1770
1832
  }
1771
- function cr(e, t = g) {
1772
- return P(t, J, e);
1833
+ function hr(e, t = g) {
1834
+ return I(t, X, e);
1773
1835
  }
1774
- function lr(e, t, n = g) {
1775
- return z(n, `${J}/${encodeURIComponent(e)}`, t);
1836
+ function gr(e, t, n = g) {
1837
+ return V(n, `${X}/${encodeURIComponent(e)}`, t);
1776
1838
  }
1777
- async function ur(e, t = g) {
1778
- let n = (await L(t, "api/v2/document-upload/containers", void 0, { body: { containerIds: e } }))?.failed ?? [], r = new Set(n.map((e) => e.containerId));
1839
+ async function _r(e, t = g) {
1840
+ let n = (await z(t, "api/v2/agent-workspace/workspaces", void 0, { body: { workspaceIds: e } }))?.failed ?? [], r = new Set(n.map((e) => e.workspaceId));
1779
1841
  return {
1780
1842
  succeeded: e.filter((e) => !r.has(e)),
1781
1843
  failed: n
1782
1844
  };
1783
1845
  }
1784
- async function dr(e, t, n, r = g) {
1785
- return ar(await I(r, `${J}/${encodeURIComponent(e)}/documents`, ir(t ?? {}), n));
1846
+ async function vr(e, t, n, r = g) {
1847
+ return fr(await R(r, `${X}/${encodeURIComponent(e)}/documents`, dr(t ?? {}), n));
1786
1848
  }
1787
- async function fr(e, t, n = g) {
1788
- return (await P(n, `${J}/${encodeURIComponent(e)}/documents`, { documents: t })).documents;
1849
+ async function yr(e, t, n = g) {
1850
+ return (await I(n, `${X}/${encodeURIComponent(e)}/documents`, { documents: t })).documents;
1789
1851
  }
1790
- function pr(e, t, n = g) {
1791
- return L(n, `${J}/${encodeURIComponent(e)}/documents`, void 0, { body: { fileIds: t } });
1852
+ function br(e, t, n = g) {
1853
+ return z(n, `${X}/${encodeURIComponent(e)}/documents`, void 0, { body: { fileIds: t } });
1792
1854
  }
1793
1855
  //#endregion
1794
- //#region src/web-api/v2/fetch-document-upload-status.ts
1795
- async function mr(e, t, n = g) {
1856
+ //#region src/web-api/v2/fetch-agent-workspace-status.ts
1857
+ async function xr(e, t, n = g) {
1796
1858
  let r = new URLSearchParams();
1797
- return e?.containerId !== void 0 && r.set("containerId", e.containerId), e?.initiatedBy !== void 0 && r.set("initiatedBy", e.initiatedBy), e?.skip !== void 0 && r.set("skip", String(e.skip)), e?.take !== void 0 && r.set("take", String(e.take)), I(n, "api/v2/document-upload/status", r, t);
1859
+ return e?.workspaceId !== void 0 && r.set("workspaceId", e.workspaceId), e?.initiatedBy !== void 0 && r.set("initiatedBy", e.initiatedBy), e?.skip !== void 0 && r.set("skip", String(e.skip)), e?.take !== void 0 && r.set("take", String(e.take)), R(n, "api/v2/agent-workspace/status", r, t);
1798
1860
  }
1799
1861
  //#endregion
1800
1862
  //#region src/web-api/v2/fetch-forgot-password.ts
1801
- function hr() {
1863
+ function Sr() {
1802
1864
  return typeof window > "u" ? void 0 : `${window.location.origin}/login?mode=changepassword`;
1803
1865
  }
1804
- async function gr(e, t, n = g) {
1805
- let r = t ?? hr();
1866
+ async function Cr(e, t, n = g) {
1867
+ let r = t ?? Sr();
1806
1868
  if (!r) throw Error("fetchSendPasswordResetEmail needs a changePasswordRedirectUrl outside a browser: there is no page origin to derive it from. Pass the URL the reset email should link to.");
1807
- return P(n, "api/v2/security/password/ask-reset-email", {
1869
+ return I(n, "api/v2/security/password/ask-reset-email", {
1808
1870
  changePasswordRedirectUrl: r,
1809
1871
  userName: e
1810
1872
  });
1811
1873
  }
1812
1874
  //#endregion
1813
1875
  //#region src/web-api/v2/fetch-user-profile.ts
1814
- async function _r(e, t = g) {
1815
- return await I(t, `api/v2/user-profile/${e}`);
1876
+ async function wr(e, t = g) {
1877
+ return await R(t, `api/v2/user-profile/${e}`);
1816
1878
  }
1817
- async function vr(e, t = g) {
1818
- return await P(t, "api/v2/user-profile", e);
1879
+ async function Tr(e, t = g) {
1880
+ return await I(t, "api/v2/user-profile", e);
1819
1881
  }
1820
- async function yr(e, t, n, r = g) {
1821
- return await R(r, `api/v2/user-profile/${e.data?.id}/${t}/${n}`, e);
1882
+ async function Er(e, t, n, r = g) {
1883
+ return await B(r, `api/v2/user-profile/${e.data?.id}/${t}/${n}`, e);
1822
1884
  }
1823
- async function br(e, t, n, r = g) {
1824
- return (await L(r, `api/v2/user-profile/${e.data?.id}/${t}/${n}`)).success === !0;
1885
+ async function Dr(e, t, n, r = g) {
1886
+ return (await z(r, `api/v2/user-profile/${e.data?.id}/${t}/${n}`)).success === !0;
1825
1887
  }
1826
1888
  //#endregion
1827
1889
  //#region src/web-api/v2/fetch-version.ts
1828
- async function xr(e = g) {
1829
- return await I(e, "api/v2/version");
1890
+ async function Or(e = g) {
1891
+ return await R(e, "api/v2/version");
1830
1892
  }
1831
1893
  //#endregion
1832
1894
  //#region src/client/create-api.ts
1833
- var Y = (e, t) => (...n) => {
1895
+ var Z = (e, t) => (...n) => {
1834
1896
  let r = Array(Math.max(0, e.length - n.length)).fill(void 0);
1835
1897
  return e(...n, ...r, t);
1836
1898
  };
1837
- function Sr(e) {
1899
+ function kr(e) {
1838
1900
  return {
1839
1901
  app: {
1840
- get: Y(Ot, e),
1841
- preLogin: Y(kt, e)
1902
+ get: Z(Ft, e),
1903
+ preLogin: Z(It, e)
1842
1904
  },
1843
1905
  principal: {
1844
- get: Y(jn, e),
1845
- list: Y(Mn, e),
1846
- userid: Y(Nn, e),
1847
- userids: Y(Pn, e),
1848
- search: Y(Un, e),
1849
- byIds: Y(Wn, e)
1906
+ get: Z(Rn, e),
1907
+ list: Z(zn, e),
1908
+ userid: Z(Bn, e),
1909
+ userids: Z(Vn, e),
1910
+ search: Z(Xn, e),
1911
+ byIds: Z(Zn, e)
1850
1912
  },
1851
1913
  query: {
1852
- search: Y(Ln, e),
1853
- bulk: Y(Rn, e),
1854
- intent: Y(Vn, e),
1855
- export: Y(Bn, e),
1856
- aggregate: Y(_n, e),
1857
- sponsoredLinks: Y(Kn, e),
1858
- similarDocuments: Y(Gn, e)
1914
+ search: Z(Wn, e),
1915
+ bulk: Z(Gn, e),
1916
+ intent: Z(Jn, e),
1917
+ export: Z(qn, e),
1918
+ aggregate: Z(wn, e),
1919
+ sponsoredLinks: Z($n, e),
1920
+ similarDocuments: Z(Qn, e)
1859
1921
  },
1860
1922
  suggest: {
1861
- get: Y(Yn, e),
1862
- query: Y(Xn, e),
1863
- field: Y(Zn, e)
1923
+ get: Z(nr, e),
1924
+ query: Z(rr, e),
1925
+ field: Z(ir, e)
1864
1926
  },
1865
1927
  preview: {
1866
- get: Y(kn, e),
1867
- textChunks: Y(Qn, e)
1928
+ get: Z(In, e),
1929
+ textChunks: Z(ar, e)
1868
1930
  },
1869
1931
  labels: {
1870
- get: Y(xn, e),
1871
- rights: Y(q.getUserRights, e),
1872
- add: Y(q.add, e),
1873
- remove: Y(q.remove, e),
1874
- rename: Y(q.rename, e),
1875
- delete: Y(q.delete, e),
1876
- bulkAdd: Y(q.bulkAdd, e),
1877
- bulkRemove: Y(q.bulkRemove, e)
1932
+ get: Z(On, e),
1933
+ rights: Z(Y.getUserRights, e),
1934
+ add: Z(Y.add, e),
1935
+ remove: Z(Y.remove, e),
1936
+ rename: Z(Y.rename, e),
1937
+ delete: Z(Y.delete, e),
1938
+ bulkAdd: Z(Y.bulkAdd, e),
1939
+ bulkRemove: Z(Y.bulkRemove, e)
1878
1940
  },
1879
1941
  dataset: {
1880
- get: Y(vn, e),
1881
- getMany: Y(yn, e),
1882
- list: Y(bn, e)
1942
+ get: Z(Tn, e),
1943
+ getMany: Z(En, e),
1944
+ list: Z(Dn, e)
1883
1945
  },
1884
1946
  userSettings: {
1885
- get: Y($n, e),
1886
- save: Y(er, e),
1887
- patch: Y(tr, e),
1888
- reset: Y(nr, e)
1947
+ get: Z(or, e),
1948
+ save: Z(sr, e),
1949
+ patch: Z(cr, e),
1950
+ reset: Z(lr, e)
1889
1951
  },
1890
1952
  userProfile: {
1891
- get: Y(_r, e),
1892
- create: Y(vr, e),
1893
- patch: Y(yr, e),
1894
- deleteProperty: Y(br, e)
1953
+ get: Z(wr, e),
1954
+ create: Z(Tr, e),
1955
+ patch: Z(Er, e),
1956
+ deleteProperty: Z(Dr, e)
1895
1957
  },
1896
- containers: {
1897
- list: Y(or, e),
1898
- get: Y(sr, e),
1899
- create: Y(cr, e),
1900
- update: Y(lr, e),
1901
- delete: Y(ur, e),
1902
- listDocuments: Y(dr, e),
1903
- addDocuments: Y(fr, e),
1904
- deleteDocuments: Y(pr, e),
1905
- uploadStatus: Y(mr, e)
1958
+ workspaces: {
1959
+ list: Z(pr, e),
1960
+ get: Z(mr, e),
1961
+ create: Z(hr, e),
1962
+ update: Z(gr, e),
1963
+ delete: Z(_r, e),
1964
+ listDocuments: Z(vr, e),
1965
+ addDocuments: Z(yr, e),
1966
+ deleteDocuments: Z(br, e),
1967
+ uploadStatus: Z(xr, e)
1906
1968
  },
1907
1969
  password: {
1908
- change: Y(rr, e),
1909
- sendResetEmail: Y(gr, e)
1970
+ change: Z(ur, e),
1971
+ sendResetEmail: Z(Cr, e)
1910
1972
  },
1911
- version: Y(xr, e)
1973
+ version: Z(Or, e)
1912
1974
  };
1913
1975
  }
1914
1976
  //#endregion
1915
1977
  //#region src/client/create-atomic-client.ts
1916
- function Cr(e) {
1978
+ function Ar(e) {
1917
1979
  return {
1918
1980
  config: e.config,
1919
1981
  storagePrefix: e.storagePrefix,
1920
1982
  configure: (t) => b(e, t),
1921
- initializeConfig: () => At(e),
1983
+ initializeConfig: () => Lt(e),
1922
1984
  auth: {
1923
- login: (t) => dt(e, t),
1924
- logout: () => _t(e),
1925
- isAuthenticated: () => Ct(e),
1926
- hasSession: () => Ge(e),
1927
- isRedirectPending: () => xt(e),
1928
- clearSession: () => yt(e),
1929
- getToken: () => T(e),
1930
- setToken: (t) => A(e, t),
1985
+ login: (t) => vt(e, t),
1986
+ logout: () => wt(e),
1987
+ isAuthenticated: () => At(e),
1988
+ hasSession: () => Qe(e),
1989
+ isRedirectPending: () => Ot(e),
1990
+ clearSession: () => Et(e),
1991
+ getToken: () => E(e),
1992
+ setToken: (t) => j(e, t),
1931
1993
  on: (t, n) => e.events.on(t, n)
1932
1994
  },
1933
1995
  http: {
1934
- get: (t, n, r) => I(e, t, n, r),
1935
- post: (t, n, r) => P(e, t, n, r),
1936
- put: (t, n, r) => z(e, t, n, r),
1937
- patch: (t, n, r) => R(e, t, n, r),
1938
- del: (t, n, r) => L(e, t, n, r)
1996
+ get: (t, n, r) => R(e, t, n, r),
1997
+ post: (t, n, r) => I(e, t, n, r),
1998
+ put: (t, n, r) => V(e, t, n, r),
1999
+ patch: (t, n, r) => B(e, t, n, r),
2000
+ del: (t, n, r) => z(e, t, n, r)
1939
2001
  },
1940
- api: Sr(e),
2002
+ api: kr(e),
1941
2003
  context: e
1942
2004
  };
1943
2005
  }
1944
- function wr(e) {
2006
+ function jr(e) {
1945
2007
  let { httpAdapter: t, storagePrefix: n, ...r } = e, i = pe({
1946
2008
  config: {},
1947
2009
  storagePrefix: n,
1948
2010
  httpAdapter: t
1949
2011
  });
1950
- return b(i, r), Cr(i);
2012
+ return b(i, r), Ar(i);
1951
2013
  }
1952
- var Tr = Cr(g);
1953
- function Er() {
1954
- return Tr;
2014
+ var Mr = Ar(g);
2015
+ function Nr() {
2016
+ return Mr;
1955
2017
  }
1956
2018
  //#endregion
1957
2019
  //#region src/utils/aggregations.ts
1958
- var Dr = /.*:\(?([><=\d\-.AND ]+)\)?/;
1959
- function Or(e, t) {
2020
+ var Pr = /.*:\(?([><=\d\-.AND ]+)\)?/;
2021
+ function Fr(e, t) {
1960
2022
  return !e?.items || e?.items?.length === 0 ? [] : e.items.reduce((n, r) => {
1961
2023
  if (!r.value || r.value === "") return n;
1962
- let i = kr(r, e.column);
2024
+ let i = Ir(r, e.column);
1963
2025
  return n.push({
1964
2026
  operator: i.operator,
1965
2027
  value: i.value,
@@ -1970,15 +2032,18 @@ function Or(e, t) {
1970
2032
  }), n;
1971
2033
  }, []);
1972
2034
  }
1973
- function kr(e, t) {
1974
- let n = t, r = e.value.match(Dr);
2035
+ function Ir(e, t) {
2036
+ let n = t, r = e.value.match(Pr);
1975
2037
  if (r?.[1]) {
1976
- let t = (r?.[1].split(" AND ")).map((t) => ({
1977
- field: n,
1978
- operator: t.indexOf(">=") === -1 ? "lt" : "gte",
1979
- value: t.substring(t.indexOf(" ") + 1),
1980
- display: e.display || e.value
1981
- }));
2038
+ let t = (r?.[1].split(" AND ")).map((t) => {
2039
+ let r = t.indexOf(">=") === -1 ? "lt" : "gte", i = t.substring(t.indexOf(" ") + 1);
2040
+ return {
2041
+ field: n,
2042
+ operator: r,
2043
+ value: i,
2044
+ display: e.display || e.value
2045
+ };
2046
+ });
1982
2047
  if (t.length === 2) return {
1983
2048
  field: n,
1984
2049
  operator: "and",
@@ -1999,26 +2064,26 @@ function kr(e, t) {
1999
2064
  display: e.display
2000
2065
  };
2001
2066
  }
2002
- function Ar(e, t, n) {
2067
+ function Lr(e, t, n) {
2003
2068
  return e.valuesAreExpressions ? t.display === n.display : t.value === n.value;
2004
2069
  }
2005
- function jr(e) {
2006
- return e.items &&= e.items.map((e) => jr(e)), e.items?.some((e) => e.$selected || e.$opened) && (e.$opened = !0), e;
2070
+ function Rr(e) {
2071
+ return e.items &&= e.items.map((e) => Rr(e)), e.items?.some((e) => e.$selected || e.$opened) && (e.$opened = !0), e;
2007
2072
  }
2008
- function Mr(e, t) {
2073
+ function zr(e, t) {
2009
2074
  let n = [];
2010
2075
  if (e.length > 0) {
2011
2076
  let r = /* @__PURE__ */ new Map(), i = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").normalize("NFD").replace(/[\u0300-\u036f]/g, ""), a = RegExp(`\\b${i}`, "i");
2012
2077
  e.forEach((e) => {
2013
2078
  if (e.display.length > 1) {
2014
2079
  let i = e.display.normalize("NFD").replace(/[\u0300-\u036f]/g, ""), o = a.exec(i);
2015
- Nr(n, r, "/", e.display, +(e.frequency || 0), 1, (o?.index || 0) + t.length);
2080
+ Br(n, r, "/", e.display, +(e.frequency || 0), 1, (o?.index || 0) + t.length);
2016
2081
  }
2017
2082
  });
2018
2083
  }
2019
2084
  return n;
2020
2085
  }
2021
- function Nr(e, t, n, r, i, a, o) {
2086
+ function Br(e, t, n, r, i, a, o) {
2022
2087
  let s = r.indexOf("/", n.length), c = r.substring(0, s + 1), l = t.get(c);
2023
2088
  if (!l) {
2024
2089
  let u = c.replace(/^\/|\/$/g, "");
@@ -2032,11 +2097,11 @@ function Nr(e, t, n, r, i, a, o) {
2032
2097
  $path: u
2033
2098
  }, t.set(c, l), e.push(l);
2034
2099
  }
2035
- c.length < r.length && (l.hasChildren = !0, Nr(l.items, t, c, r, i, a + 1, o));
2100
+ c.length < r.length && (l.hasChildren = !0, Br(l.items, t, c, r, i, a + 1, o));
2036
2101
  }
2037
2102
  //#endregion
2038
2103
  //#region src/utils/bisect.ts
2039
- function Pr(e, t) {
2104
+ function Vr(e, t) {
2040
2105
  return e.reduce((e, n) => (t(n) ? e.true.push(n) : e.false.push(n), e), {
2041
2106
  true: [],
2042
2107
  false: []
@@ -2044,34 +2109,34 @@ function Pr(e, t) {
2044
2109
  }
2045
2110
  //#endregion
2046
2111
  //#region src/utils/concepts.ts
2047
- var Fr = /(([+-])?\(([^)]+)\))|(([+-])?\[([^\]]+)\])|(([+-])?"([^"]+)")|(([+-])?\/([^/]+)\/)|(([+-])?(\S+))/g, Ir = 2, Lr = 3, Rr = 5, zr = 6, Br = 8, Vr = 9, Hr = 11, Ur = 12, Wr = 14, Gr = 15;
2048
- function X(e) {
2112
+ var Hr = /(([+-])?\(([^)]+)\))|(([+-])?\[([^\]]+)\])|(([+-])?"([^"]+)")|(([+-])?\/([^/]+)\/)|(([+-])?(\S+))/g, Ur = 2, Wr = 3, Gr = 5, Kr = 6, qr = 8, Jr = 9, Yr = 11, Xr = 12, Zr = 14, Qr = 15;
2113
+ function Q(e) {
2049
2114
  if (!e) return [];
2050
- let t = [], n = e.matchAll(Fr);
2051
- for (let e of n) e[Lr] ? t.push({
2115
+ let t = [], n = e.matchAll(Hr);
2116
+ for (let e of n) e[Wr] ? t.push({
2052
2117
  type: "group",
2053
- value: e[Lr],
2054
- op: e[Ir]
2055
- }) : e[zr] ? t.push({
2118
+ value: e[Wr],
2119
+ op: e[Ur]
2120
+ }) : e[Kr] ? t.push({
2056
2121
  type: "adjacent",
2057
- value: e[zr],
2058
- op: e[Rr]
2059
- }) : e[Vr] ? t.push({
2122
+ value: e[Kr],
2123
+ op: e[Gr]
2124
+ }) : e[Jr] ? t.push({
2060
2125
  type: "exact",
2061
- value: e[Vr],
2062
- op: e[Br]
2063
- }) : e[Ur] ? t.push({
2126
+ value: e[Jr],
2127
+ op: e[qr]
2128
+ }) : e[Xr] ? t.push({
2064
2129
  type: "regex",
2065
- value: e[Ur],
2066
- op: e[Hr]
2067
- }) : e[Gr] && t.push({
2130
+ value: e[Xr],
2131
+ op: e[Yr]
2132
+ }) : e[Qr] && t.push({
2068
2133
  type: "token",
2069
- value: e[Gr],
2070
- op: e[Wr]
2134
+ value: e[Qr],
2135
+ op: e[Zr]
2071
2136
  });
2072
2137
  return t;
2073
2138
  }
2074
- function Z(e) {
2139
+ function $r(e) {
2075
2140
  return e.map((e) => {
2076
2141
  let t = e.op || "";
2077
2142
  switch (e.type) {
@@ -2084,39 +2149,39 @@ function Z(e) {
2084
2149
  }
2085
2150
  }).join(" ");
2086
2151
  }
2087
- function Kr(e, t, n) {
2088
- let r = X(e);
2152
+ function ei(e, t, n) {
2153
+ let r = Q(e);
2089
2154
  for (let e of t) r.push({
2090
2155
  type: "adjacent",
2091
2156
  value: e,
2092
2157
  op: n
2093
2158
  });
2094
- return Z(r);
2159
+ return $r(r);
2095
2160
  }
2096
- function qr(e, t) {
2097
- let n = X(t), r = n.findIndex((t) => t.value === e);
2098
- return r === -1 ? t : (n.splice(r, 1), Z(n));
2161
+ function ti(e, t) {
2162
+ let n = Q(t), r = n.findIndex((t) => t.value === e);
2163
+ return r === -1 ? t : (n.splice(r, 1), $r(n));
2099
2164
  }
2100
- function Jr(e) {
2101
- return Z(X(e).filter((e) => e.type !== "adjacent"));
2165
+ function ni(e) {
2166
+ return $r(Q(e).filter((e) => e.type !== "adjacent"));
2102
2167
  }
2103
- function Yr(e) {
2104
- return X(e).filter((e) => e.type === "adjacent").map((e) => e.value);
2168
+ function ri(e) {
2169
+ return Q(e).filter((e) => e.type === "adjacent").map((e) => e.value);
2105
2170
  }
2106
2171
  //#endregion
2107
2172
  //#region src/utils/date.ts
2108
- function Xr(e, t, n) {
2109
- let r = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: i, unit: a, isFuture: o } = Qr(t, n);
2173
+ function ii(e, t, n) {
2174
+ let r = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: i, unit: a, isFuture: o } = oi(t, n);
2110
2175
  return r.format(i * (o ? 1 : -1), a);
2111
2176
  }
2112
- var Zr = [
2177
+ var ai = [
2113
2178
  ["year", 365],
2114
2179
  ["month", 30],
2115
2180
  ["week", 7],
2116
2181
  ["day", 1]
2117
2182
  ];
2118
- function Qr(e, t) {
2119
- let n = new Date(e), r = t ? new Date(t) : /* @__PURE__ */ new Date(), i = Math.abs(r.getTime() - n.getTime()), a = Math.floor(i / (1e3 * 60 * 60 * 24)), [o, s] = Zr.find(([, e]) => a >= e) ?? ["day", 1];
2183
+ function oi(e, t) {
2184
+ let n = new Date(e), r = t ? new Date(t) : /* @__PURE__ */ new Date(), i = Math.abs(r.getTime() - n.getTime()), a = Math.floor(i / 864e5), [o, s] = ai.find(([, e]) => a >= e) ?? ["day", 1];
2120
2185
  return {
2121
2186
  offset: Math.floor(a / s),
2122
2187
  unit: o,
@@ -2125,13 +2190,13 @@ function Qr(e, t) {
2125
2190
  }
2126
2191
  //#endregion
2127
2192
  //#region src/utils/is-not-input-event.ts
2128
- function $r(e) {
2193
+ function si(e) {
2129
2194
  let t = e.target;
2130
2195
  return t && t.nodeName !== "INPUT" && t.nodeName !== "TEXTAREA";
2131
2196
  }
2132
2197
  //#endregion
2133
2198
  //#region src/utils/notification.ts
2134
- function Q(e) {
2199
+ function ci(e) {
2135
2200
  let t = new CustomEvent("notification", {
2136
2201
  bubbles: !0,
2137
2202
  cancelable: !1,
@@ -2139,30 +2204,30 @@ function Q(e) {
2139
2204
  });
2140
2205
  dispatchEvent(t);
2141
2206
  }
2142
- var ei = {
2207
+ var li = {
2143
2208
  success: (e, t) => {
2144
- Q({
2209
+ ci({
2145
2210
  type: "success",
2146
2211
  message: e,
2147
2212
  options: t
2148
2213
  });
2149
2214
  },
2150
2215
  info: (e, t) => {
2151
- Q({
2216
+ ci({
2152
2217
  type: "info",
2153
2218
  message: e,
2154
2219
  options: t
2155
2220
  });
2156
2221
  },
2157
2222
  warning: (e, t) => {
2158
- Q({
2223
+ ci({
2159
2224
  type: "warning",
2160
2225
  message: e,
2161
2226
  options: t
2162
2227
  });
2163
2228
  },
2164
2229
  error: (e, t) => {
2165
- Q({
2230
+ ci({
2166
2231
  type: "error",
2167
2232
  message: e,
2168
2233
  options: t
@@ -2171,13 +2236,13 @@ var ei = {
2171
2236
  };
2172
2237
  //#endregion
2173
2238
  //#region src/utils/query-params.ts
2174
- function ti(e) {
2239
+ function ui(e) {
2175
2240
  if (e === void 0) return;
2176
2241
  let { q: t, f: n, p: r, s: i, t: a, n: o, b: s } = $(e), [c] = e.split("?");
2177
2242
  return {
2178
2243
  path: c,
2179
2244
  text: t,
2180
- filters: n ? ii(n) : void 0,
2245
+ filters: n ? pi(n) : void 0,
2181
2246
  page: r ? parseInt(r, 10) : void 0,
2182
2247
  sort: i,
2183
2248
  tab: a,
@@ -2185,17 +2250,17 @@ function ti(e) {
2185
2250
  basket: s
2186
2251
  };
2187
2252
  }
2188
- function ni(e) {
2253
+ function di(e) {
2189
2254
  if (!e) return "";
2190
2255
  let { text: t, filters: n, page: r, sort: i, tab: a, name: o, basket: s } = e, c = {};
2191
2256
  return t && (c.q = t), n && (c.f = JSON.stringify(n)), r && (c.p = r.toString()), i && (c.s = i), a && (c.t = a), o && (c.n = o), s && (c.b = s), new URLSearchParams(c).toString() || "";
2192
2257
  }
2193
- function ri(e) {
2258
+ function fi(e) {
2194
2259
  if (e === void 0) return [];
2195
2260
  let { f: t } = $(e);
2196
- return ii(t);
2261
+ return pi(t);
2197
2262
  }
2198
- function ii(e) {
2263
+ function pi(e) {
2199
2264
  let t = decodeURIComponent(e);
2200
2265
  try {
2201
2266
  return JSON.parse(t ?? "[]");
@@ -2209,41 +2274,41 @@ function $(e) {
2209
2274
  let n = new URLSearchParams(t);
2210
2275
  return Object.fromEntries(n);
2211
2276
  }
2212
- function ai(e) {
2277
+ function mi(e) {
2213
2278
  let { q: t = "" } = $(e);
2214
2279
  return t;
2215
2280
  }
2216
- function oi(e) {
2281
+ function hi(e) {
2217
2282
  let { id: t } = $(e);
2218
2283
  return t === void 0 ? void 0 : decodeURIComponent(t);
2219
2284
  }
2220
- function si(e) {
2285
+ function gi(e) {
2221
2286
  let { p: t = "0" } = $(e);
2222
2287
  return parseInt(t, 10);
2223
2288
  }
2224
- function ci(e) {
2289
+ function _i(e) {
2225
2290
  let { t } = $(e);
2226
2291
  return t;
2227
2292
  }
2228
2293
  //#endregion
2229
2294
  //#region src/utils/syslang.ts
2230
- function li(e, t) {
2295
+ function vi(e, t) {
2231
2296
  if (!e) return e;
2232
2297
  let n = 0, r = e.length, i = 0;
2233
2298
  if (e[i] === "[") {
2234
2299
  for (; i < r && /[0-9]/.test(e[i]);) i++;
2235
2300
  e[i] === "]" && (n = i + 1);
2236
2301
  }
2237
- let a = ui(e, n, !1);
2302
+ let a = yi(e, n, !1);
2238
2303
  if (!a) return e;
2239
2304
  let o = t.charCodeAt(0), s = t.charCodeAt(1), c = a;
2240
2305
  for (; c;) if (o === c.lang1 && s === c.lang2) {
2241
- let t = ui(e, c.end + 4, !0);
2306
+ let t = yi(e, c.end + 4, !0);
2242
2307
  return e.substring(t.start, t.end);
2243
- } else c = ui(e, c.end + 4, !1);
2308
+ } else c = yi(e, c.end + 4, !1);
2244
2309
  return e.substring(a.start, a.end) || e;
2245
2310
  }
2246
- function ui(e, t, n) {
2311
+ function yi(e, t, n) {
2247
2312
  for (let n = t, r = e.length - 3; n < r; n++) if (e[n] === "[" && e[n + 3] === "]") return {
2248
2313
  start: t,
2249
2314
  end: n,
@@ -2259,7 +2324,7 @@ function ui(e, t, n) {
2259
2324
  }
2260
2325
  //#endregion
2261
2326
  //#region src/utils/utilities.ts
2262
- function di(e, t) {
2327
+ function bi(e, t) {
2263
2328
  let { useLocale: n, useLocaleAsPrefix: r, indexFile: i, path: a, folder: o } = t, s = n ? `${e}/` : null, c = r ? `${e}.${i}` : i ?? "";
2264
2329
  return [
2265
2330
  a,
@@ -2269,32 +2334,32 @@ function di(e, t) {
2269
2334
  }
2270
2335
  //#endregion
2271
2336
  //#region src/web-api/helpers/utils/date-utils.ts
2272
- function fi(e) {
2337
+ function xi(e) {
2273
2338
  if (!e) return;
2274
2339
  let t = new Date(e);
2275
2340
  return Number.isNaN(t.getTime()) ? void 0 : t;
2276
2341
  }
2277
- function pi(e) {
2278
- let t = fi(e);
2342
+ function Si(e) {
2343
+ let t = xi(e);
2279
2344
  return !!t && t.getTime() <= Date.now();
2280
2345
  }
2281
- function mi(e, t = 7) {
2282
- let n = fi(e);
2346
+ function Ci(e, t = 7) {
2347
+ let n = xi(e);
2283
2348
  if (!n) return !1;
2284
2349
  let r = Date.now(), i = r + t * 24 * 60 * 60 * 1e3, a = n.getTime();
2285
2350
  return a > r && a <= i;
2286
2351
  }
2287
2352
  //#endregion
2288
2353
  //#region src/web-api/helpers/utils/with-retry.ts
2289
- async function hi(e, t = 0, n = 1e3) {
2354
+ async function wi(e, t = 0, n = 1e3) {
2290
2355
  let r;
2291
2356
  for (let i = 0; i <= t; i++) try {
2292
2357
  return await e();
2293
2358
  } catch (e) {
2294
- if (r = e, e instanceof O && e.status >= 400 && e.status < 500 && e.status !== 429 || e instanceof DOMException && e.name === "AbortError") throw e;
2359
+ if (r = e, e instanceof k && e.status >= 400 && e.status < 500 && e.status !== 429 || e instanceof DOMException && e.name === "AbortError") throw e;
2295
2360
  i < t && (c(`Retrying request (${i + 1}/${t})`, { error: e }), await new Promise((e) => setTimeout(e, n)));
2296
2361
  }
2297
2362
  throw r;
2298
2363
  }
2299
2364
  //#endregion
2300
- export { tr as $, ae as $n, Lt as $t, kr as A, I as An, dn as At, gr as B, Te as Bn, G as Bt, qr as C, st as Cn, q as Ct, Dr as D, qe as Dn, _n as Dt, Pr as E, Je as En, yn as Et, xr as F, Pe as Fn, sn as Ft, ur as G, O as Gn, Yt as Gt, fr as H, we as Hn, on as Ht, vr as I, Ne as In, Zt as It, or as J, xe as Jn, Kt as Jt, sr as K, Se as Kn, W as Kt, br as L, P as Ln, Qt as Lt, Or as M, Be as Mn, an as Mt, wr as N, Re as Nn, nn as Nt, Ar as O, We as On, gn as Ot, Er as P, F as Pn, rn as Pt, $n as Q, ue as Qn, Rt as Qt, _r as R, Oe as Rn, $t as Rt, X as S, ft as Sn, xn as St, Z as T, Xe as Tn, bn as Tt, cr as U, Ce as Un, Xt as Ut, mr as V, Ee as Vn, en as Vt, pr as W, k as Wn, Jt as Wt, rr as X, de as Xn, U as Xt, lr as Y, be as Yn, Ut as Yt, nr as Z, h as Zn, zt as Zt, $r as _, wt as _n, Mn as _t, di as a, Ft as an, p as ar, qn as at, Kr as b, vt as bn, kn as bt, ri as c, Ot as cn, r as cr, Wn as ct, ti as d, Dt as dn, l as dr, Bn as dt, H as en, m as er, er as et, ci as f, z as fn, s as fr, zn as ft, ei as g, L as gn, jn as gt, $ as h, Tt as hn, Fn as ht, fi as i, Mt as in, re as ir, Xn as it, Mr as j, Ve as jn, fn as jt, jr as k, He as kn, K as kt, oi as l, kt as ln, d as lr, Un as lt, ni as m, R as mn, n as mr, Ln as mt, mi as n, B as nn, f as nr, Yn as nt, li as o, Pt as on, ee as or, Kn as ot, ai as p, Et as pn, c as pr, Rn as pt, dr as q, E as qn, qt, pi as r, It as rn, ne as rr, Zn as rt, ii as s, jt as sn, te as sr, Gn as st, hi as t, V as tn, ie as tr, Qn as tt, si as u, At as un, o as ur, Vn as ut, Qr as v, St as vn, Nn as vt, Jr as w, Ze as wn, vn as wt, Yr as x, gt as xn, An as xt, Xr as y, bt as yn, Pn as yt, yr as z, j as zn, tn as zt };
2365
+ export { cr as $, ae as $n, Wt as $t, Ir as A, R as An, vn as At, Cr as B, je as Bn, q as Bt, ti as C, mt as Cn, Y as Ct, Pr as D, et as Dn, wn as Dt, Vr as E, tt as En, En as Et, Or as F, Ve as Fn, mn as Ft, _r as G, k as Gn, nn as Gt, yr as H, Ae as Hn, pn as Ht, Tr as I, Be as In, an as It, pr as J, De as Jn, $t as Jt, mr as K, Oe as Kn, K as Kt, Dr as L, I as Ln, on as Lt, Fr as M, qe as Mn, fn as Mt, jr as N, Ge as Nn, un as Nt, Lr as O, Ze as On, Cn as Ot, Nr as P, L as Pn, dn as Pt, or as Q, ue as Qn, Gt as Qt, wr as R, Ne as Rn, sn as Rt, Q as S, yt as Sn, On as St, $r as T, rt as Tn, Dn as Tt, hr as U, ke as Un, rn as Ut, xr as V, M as Vn, cn as Vt, br as W, A as Wn, tn as Wt, ur as X, de as Xn, G as Xt, gr as Y, Ee as Yn, Xt as Yt, lr as Z, h as Zn, Kt as Zt, si as _, jt as _n, zn as _t, bi as a, Ht as an, p as ar, er as at, ei as b, Tt as bn, In as bt, fi as c, Ft as cn, r as cr, Zn as ct, ui as d, Pt as dn, l as dr, qn as dt, W as en, m as er, sr as et, _i as f, V as fn, s as fr, Kn as ft, li as g, z as gn, Rn as gt, $ as h, Mt as hn, Hn as ht, xi as i, zt as in, re as ir, rr as it, zr as j, Je as jn, yn as jt, Rr as k, Ye as kn, J as kt, hi as l, It as ln, d as lr, Xn as lt, di as m, B as mn, n as mr, Wn as mt, Ci as n, H as nn, f as nr, nr as nt, vi as o, Vt as on, ee as or, $n as ot, mi as p, Nt as pn, c as pr, Gn as pt, vr as q, D as qn, en as qt, Si as r, Ut as rn, ne as rr, ir as rt, pi as s, Rt as sn, te as sr, Qn as st, wi as t, U as tn, ie as tr, ar as tt, gi as u, Lt as un, o as ur, Jn as ut, oi as v, kt as vn, Bn as vt, ni as w, it as wn, Tn as wt, ri as x, Ct as xn, Ln as xt, ii as y, Dt as yn, Vn as yt, Er as z, N as zn, ln as zt };