authhero 0.218.0 → 0.220.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.
package/dist/authhero.mjs CHANGED
@@ -340,15 +340,15 @@ class ma extends dc {
340
340
  } = this.extractFromKey(e[e.length - 1], n), u = l[l.length - 1], d = n.lng || this.language, p = n.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
341
341
  if ((d == null ? void 0 : d.toLowerCase()) === "cimode") {
342
342
  if (p) {
343
- const V = n.nsSeparator || this.options.nsSeparator;
343
+ const z = n.nsSeparator || this.options.nsSeparator;
344
344
  return i ? {
345
- res: `${u}${V}${a}`,
345
+ res: `${u}${z}${a}`,
346
346
  usedKey: a,
347
347
  exactUsedKey: a,
348
348
  usedLng: d,
349
349
  usedNS: u,
350
350
  usedParams: this.getUsedParamsDetails(n)
351
- } : `${u}${V}${a}`;
351
+ } : `${u}${z}${a}`;
352
352
  }
353
353
  return i ? {
354
354
  res: a,
@@ -365,17 +365,17 @@ class ma extends dc {
365
365
  if (x && g && q && O.indexOf(T) < 0 && !(Ne(D) && Array.isArray(g))) {
366
366
  if (!n.returnObjects && !this.options.returnObjects) {
367
367
  this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
368
- const V = this.options.returnedObjectHandler ? this.options.returnedObjectHandler($, g, {
368
+ const z = this.options.returnedObjectHandler ? this.options.returnedObjectHandler($, g, {
369
369
  ...n,
370
370
  ns: l
371
371
  }) : `key '${a} (${this.language})' returned an object instead of string.`;
372
- return i ? (h.res = V, h.usedParams = this.getUsedParamsDetails(n), h) : V;
372
+ return i ? (h.res = z, h.usedParams = this.getUsedParamsDetails(n), h) : z;
373
373
  }
374
374
  if (s) {
375
- const V = Array.isArray(g), M = V ? [] : {}, G = V ? A : $;
375
+ const z = Array.isArray(g), M = z ? [] : {}, K = z ? A : $;
376
376
  for (const W in g)
377
377
  if (Object.prototype.hasOwnProperty.call(g, W)) {
378
- const Z = `${G}${s}${W}`;
378
+ const Z = `${K}${s}${W}`;
379
379
  M[W] = this.translate(Z, {
380
380
  ...n,
381
381
  joinArrays: !1,
@@ -387,13 +387,13 @@ class ma extends dc {
387
387
  } else if (x && Ne(D) && Array.isArray(g))
388
388
  g = g.join(D), g && (g = this.extendTranslation(g, e, n, r));
389
389
  else {
390
- let V = !1, M = !1;
391
- const G = n.count !== void 0 && !Ne(n.count), W = ma.hasDefaultValue(n), Z = G ? this.pluralResolver.getSuffix(d, n.count, n) : "", Y = n.ordinal && G ? this.pluralResolver.getSuffix(d, n.count, {
390
+ let z = !1, M = !1;
391
+ const K = n.count !== void 0 && !Ne(n.count), W = ma.hasDefaultValue(n), Z = K ? this.pluralResolver.getSuffix(d, n.count, n) : "", Y = n.ordinal && K ? this.pluralResolver.getSuffix(d, n.count, {
392
392
  ordinal: !1
393
- }) : "", Se = G && !n.ordinal && n.count === 0, j = Se && n[`defaultValue${this.options.pluralSeparator}zero`] || n[`defaultValue${Z}`] || n[`defaultValue${Y}`] || n.defaultValue;
394
- !this.isValidLookup(g) && W && (V = !0, g = j), this.isValidLookup(g) || (M = !0, g = a);
393
+ }) : "", Se = K && !n.ordinal && n.count === 0, j = Se && n[`defaultValue${this.options.pluralSeparator}zero`] || n[`defaultValue${Z}`] || n[`defaultValue${Y}`] || n.defaultValue;
394
+ !this.isValidLookup(g) && W && (z = !0, g = j), this.isValidLookup(g) || (M = !0, g = a);
395
395
  const P = (n.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && M ? void 0 : g, N = W && j !== g && this.options.updateMissing;
396
- if (M || V || N) {
396
+ if (M || z || N) {
397
397
  if (this.logger.log(N ? "updateKey" : "missingKey", d, u, a, N ? j : g), s) {
398
398
  const pe = this.resolve(a, {
399
399
  ...n,
@@ -407,19 +407,19 @@ class ma extends dc {
407
407
  for (let pe = 0; pe < L.length; pe++)
408
408
  k.push(L[pe]);
409
409
  else this.options.saveMissingTo === "all" ? k = this.languageUtils.toResolveHierarchy(n.lng || this.language) : k.push(n.lng || this.language);
410
- const K = (pe, se, $e) => {
410
+ const G = (pe, se, $e) => {
411
411
  var ee;
412
412
  const Ce = W && $e !== g ? $e : P;
413
413
  this.options.missingKeyHandler ? this.options.missingKeyHandler(pe, u, se, Ce, N, n) : (ee = this.backendConnector) != null && ee.saveMissing && this.backendConnector.saveMissing(pe, u, se, Ce, N, n), this.emit("missingKey", pe, u, se, g);
414
414
  };
415
- this.options.saveMissing && (this.options.saveMissingPlurals && G ? k.forEach((pe) => {
415
+ this.options.saveMissing && (this.options.saveMissingPlurals && K ? k.forEach((pe) => {
416
416
  const se = this.pluralResolver.getSuffixes(pe, n);
417
417
  Se && n[`defaultValue${this.options.pluralSeparator}zero`] && se.indexOf(`${this.options.pluralSeparator}zero`) < 0 && se.push(`${this.options.pluralSeparator}zero`), se.forEach(($e) => {
418
- K([pe], a + $e, n[`defaultValue${$e}`] || j);
418
+ G([pe], a + $e, n[`defaultValue${$e}`] || j);
419
419
  });
420
- }) : K(k, a, j));
420
+ }) : G(k, a, j));
421
421
  }
422
- g = this.extendTranslation(g, e, n, h, r), M && g === a && this.options.appendNamespaceToMissingKey && (g = `${u}:${a}`), (M || V) && this.options.parseMissingKeyHandler && (g = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${u}:${a}` : a, V ? g : void 0));
422
+ g = this.extendTranslation(g, e, n, h, r), M && g === a && this.options.appendNamespaceToMissingKey && (g = `${u}:${a}`), (M || z) && this.options.parseMissingKeyHandler && (g = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${u}:${a}` : a, z ? g : void 0));
423
423
  }
424
424
  return i ? (h.res = g, h.usedParams = this.getUsedParamsDetails(n), h) : g;
425
425
  }
@@ -482,23 +482,23 @@ class ma extends dc {
482
482
  h.forEach((O) => {
483
483
  var D, x;
484
484
  this.isValidLookup(r) || (l = O, !nh[`${T[0]}-${O}`] && ((D = this.utils) != null && D.hasLoadedNamespace) && !((x = this.utils) != null && x.hasLoadedNamespace(l)) && (nh[`${T[0]}-${O}`] = !0, this.logger.warn(`key "${i}" for languages "${T.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), T.forEach((q) => {
485
- var G;
485
+ var K;
486
486
  if (this.isValidLookup(r)) return;
487
487
  a = q;
488
- const V = [p];
489
- if ((G = this.i18nFormat) != null && G.addLookupKeys)
490
- this.i18nFormat.addLookupKeys(V, p, q, O, n);
488
+ const z = [p];
489
+ if ((K = this.i18nFormat) != null && K.addLookupKeys)
490
+ this.i18nFormat.addLookupKeys(z, p, q, O, n);
491
491
  else {
492
492
  let W;
493
493
  g && (W = this.pluralResolver.getSuffix(q, n.count, n));
494
494
  const Z = `${this.options.pluralSeparator}zero`, Y = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
495
- if (g && (V.push(p + W), n.ordinal && W.indexOf(Y) === 0 && V.push(p + W.replace(Y, this.options.pluralSeparator)), $ && V.push(p + Z)), A) {
495
+ if (g && (z.push(p + W), n.ordinal && W.indexOf(Y) === 0 && z.push(p + W.replace(Y, this.options.pluralSeparator)), $ && z.push(p + Z)), A) {
496
496
  const Se = `${p}${this.options.contextSeparator}${n.context}`;
497
- V.push(Se), g && (V.push(Se + W), n.ordinal && W.indexOf(Y) === 0 && V.push(Se + W.replace(Y, this.options.pluralSeparator)), $ && V.push(Se + Z));
497
+ z.push(Se), g && (z.push(Se + W), n.ordinal && W.indexOf(Y) === 0 && z.push(Se + W.replace(Y, this.options.pluralSeparator)), $ && z.push(Se + Z));
498
498
  }
499
499
  }
500
500
  let M;
501
- for (; M = V.pop(); )
501
+ for (; M = z.pop(); )
502
502
  this.isValidLookup(r) || (s = M, r = this.getResource(q, O, M, n));
503
503
  }));
504
504
  });
@@ -3187,9 +3187,9 @@ const ov = {}, av = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
3187
3187
  N(P);
3188
3188
  } else
3189
3189
  return new Promise(function(k, L) {
3190
- N(function(K, pe) {
3191
- if (K) {
3192
- L(K);
3190
+ N(function(G, pe) {
3191
+ if (G) {
3192
+ L(G);
3193
3193
  return;
3194
3194
  }
3195
3195
  k(pe);
@@ -3201,7 +3201,7 @@ const ov = {}, av = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
3201
3201
  return Se(j, F);
3202
3202
  }, e.hash = function(j, F, P, N) {
3203
3203
  function k(L) {
3204
- typeof j == "string" && typeof F == "number" ? e.genSalt(F, function(K, pe) {
3204
+ typeof j == "string" && typeof F == "number" ? e.genSalt(F, function(G, pe) {
3205
3205
  Se(j, pe, L, N);
3206
3206
  }) : typeof j == "string" && typeof F == "string" ? Se(j, F, L, N) : a(L.bind(this, Error("Illegal arguments: " + typeof j + ", " + typeof F)));
3207
3207
  }
@@ -3210,10 +3210,10 @@ const ov = {}, av = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
3210
3210
  throw Error("Illegal callback: " + typeof P);
3211
3211
  k(P);
3212
3212
  } else
3213
- return new Promise(function(L, K) {
3213
+ return new Promise(function(L, G) {
3214
3214
  k(function(pe, se) {
3215
3215
  if (pe) {
3216
- K(pe);
3216
+ G(pe);
3217
3217
  return;
3218
3218
  }
3219
3219
  L(se);
@@ -3239,8 +3239,8 @@ const ov = {}, av = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
3239
3239
  a(L.bind(this, null, !1));
3240
3240
  return;
3241
3241
  }
3242
- e.hash(j, F.substr(0, 29), function(K, pe) {
3243
- K ? L(K) : L(null, s(pe, F));
3242
+ e.hash(j, F.substr(0, 29), function(G, pe) {
3243
+ G ? L(G) : L(null, s(pe, F));
3244
3244
  }, N);
3245
3245
  }
3246
3246
  if (P) {
@@ -3248,10 +3248,10 @@ const ov = {}, av = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
3248
3248
  throw Error("Illegal callback: " + typeof P);
3249
3249
  k(P);
3250
3250
  } else
3251
- return new Promise(function(L, K) {
3251
+ return new Promise(function(L, G) {
3252
3252
  k(function(pe, se) {
3253
3253
  if (pe) {
3254
- K(pe);
3254
+ G(pe);
3255
3255
  return;
3256
3256
  }
3257
3257
  L(se);
@@ -3425,10 +3425,10 @@ const ov = {}, av = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
3425
3425
  return N.join("");
3426
3426
  }
3427
3427
  function g(j, F) {
3428
- var P = 0, N = j.length, k = 0, L = [], K, pe, se, $e, Ce, ee;
3428
+ var P = 0, N = j.length, k = 0, L = [], G, pe, se, $e, Ce, ee;
3429
3429
  if (F <= 0)
3430
3430
  throw Error("Illegal len: " + F);
3431
- for (; P < N - 1 && k < F && (ee = j.charCodeAt(P++), K = ee < d.length ? d[ee] : -1, ee = j.charCodeAt(P++), pe = ee < d.length ? d[ee] : -1, !(K == -1 || pe == -1 || (Ce = K << 2 >>> 0, Ce |= (pe & 48) >> 4, L.push(p(Ce)), ++k >= F || P >= N) || (ee = j.charCodeAt(P++), se = ee < d.length ? d[ee] : -1, se == -1) || (Ce = (pe & 15) << 4 >>> 0, Ce |= (se & 60) >> 2, L.push(p(Ce)), ++k >= F || P >= N))); )
3431
+ for (; P < N - 1 && k < F && (ee = j.charCodeAt(P++), G = ee < d.length ? d[ee] : -1, ee = j.charCodeAt(P++), pe = ee < d.length ? d[ee] : -1, !(G == -1 || pe == -1 || (Ce = G << 2 >>> 0, Ce |= (pe & 48) >> 4, L.push(p(Ce)), ++k >= F || P >= N) || (ee = j.charCodeAt(P++), se = ee < d.length ? d[ee] : -1, se == -1) || (Ce = (pe & 15) << 4 >>> 0, Ce |= (se & 60) >> 2, L.push(p(Ce)), ++k >= F || P >= N))); )
3432
3432
  ee = j.charCodeAt(P++), $e = ee < d.length ? d[ee] : -1, Ce = (se & 3) << 6 >>> 0, Ce |= $e, L.push(p(Ce)), ++k;
3433
3433
  var we = [];
3434
3434
  for (P = 0; P < k; P++)
@@ -3444,7 +3444,7 @@ const ov = {}, av = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
3444
3444
  }); N !== null || (N = F()) !== null; )
3445
3445
  N < 128 ? P(N & 127) : N < 2048 ? (P(N >> 6 & 31 | 192), P(N & 63 | 128)) : N < 65536 ? (P(N >> 12 & 15 | 224), P(N >> 6 & 63 | 128), P(N & 63 | 128)) : (P(N >> 18 & 7 | 240), P(N >> 12 & 63 | 128), P(N >> 6 & 63 | 128), P(N & 63 | 128)), N = null;
3446
3446
  }, j.decodeUTF8 = function(F, P) {
3447
- for (var N, k, L, K, pe = function(se) {
3447
+ for (var N, k, L, G, pe = function(se) {
3448
3448
  se = se.slice(0, se.indexOf(null));
3449
3449
  var $e = Error(se.toString());
3450
3450
  throw $e.name = "TruncatedError", $e.bytes = se, $e;
@@ -3456,7 +3456,7 @@ const ov = {}, av = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
3456
3456
  else if ((N & 240) === 224)
3457
3457
  ((k = F()) === null || (L = F()) === null) && pe([N, k, L]), P((N & 15) << 12 | (k & 63) << 6 | L & 63);
3458
3458
  else if ((N & 248) === 240)
3459
- ((k = F()) === null || (L = F()) === null || (K = F()) === null) && pe([N, k, L, K]), P((N & 7) << 18 | (k & 63) << 12 | (L & 63) << 6 | K & 63);
3459
+ ((k = F()) === null || (L = F()) === null || (G = F()) === null) && pe([N, k, L, G]), P((N & 7) << 18 | (k & 63) << 12 | (L & 63) << 6 | G & 63);
3460
3460
  else throw RangeError("Illegal starting byte: " + N);
3461
3461
  }, j.UTF16toUTF8 = function(F, P) {
3462
3462
  for (var N, k = null; (N = k !== null ? k : F()) !== null; ) {
@@ -4541,7 +4541,7 @@ const ov = {}, av = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
4541
4541
  3463963227,
4542
4542
  1469046755,
4543
4543
  985887462
4544
- ], V = [
4544
+ ], z = [
4545
4545
  1332899944,
4546
4546
  1700884034,
4547
4547
  1701343084,
@@ -4550,32 +4550,32 @@ const ov = {}, av = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
4550
4550
  1869963892
4551
4551
  ];
4552
4552
  function M(j, F, P, N) {
4553
- var k, L = j[F], K = j[F + 1];
4554
- return L ^= P[0], k = N[L >>> 24], k += N[256 | L >> 16 & 255], k ^= N[512 | L >> 8 & 255], k += N[768 | L & 255], K ^= k ^ P[1], k = N[K >>> 24], k += N[256 | K >> 16 & 255], k ^= N[512 | K >> 8 & 255], k += N[768 | K & 255], L ^= k ^ P[2], k = N[L >>> 24], k += N[256 | L >> 16 & 255], k ^= N[512 | L >> 8 & 255], k += N[768 | L & 255], K ^= k ^ P[3], k = N[K >>> 24], k += N[256 | K >> 16 & 255], k ^= N[512 | K >> 8 & 255], k += N[768 | K & 255], L ^= k ^ P[4], k = N[L >>> 24], k += N[256 | L >> 16 & 255], k ^= N[512 | L >> 8 & 255], k += N[768 | L & 255], K ^= k ^ P[5], k = N[K >>> 24], k += N[256 | K >> 16 & 255], k ^= N[512 | K >> 8 & 255], k += N[768 | K & 255], L ^= k ^ P[6], k = N[L >>> 24], k += N[256 | L >> 16 & 255], k ^= N[512 | L >> 8 & 255], k += N[768 | L & 255], K ^= k ^ P[7], k = N[K >>> 24], k += N[256 | K >> 16 & 255], k ^= N[512 | K >> 8 & 255], k += N[768 | K & 255], L ^= k ^ P[8], k = N[L >>> 24], k += N[256 | L >> 16 & 255], k ^= N[512 | L >> 8 & 255], k += N[768 | L & 255], K ^= k ^ P[9], k = N[K >>> 24], k += N[256 | K >> 16 & 255], k ^= N[512 | K >> 8 & 255], k += N[768 | K & 255], L ^= k ^ P[10], k = N[L >>> 24], k += N[256 | L >> 16 & 255], k ^= N[512 | L >> 8 & 255], k += N[768 | L & 255], K ^= k ^ P[11], k = N[K >>> 24], k += N[256 | K >> 16 & 255], k ^= N[512 | K >> 8 & 255], k += N[768 | K & 255], L ^= k ^ P[12], k = N[L >>> 24], k += N[256 | L >> 16 & 255], k ^= N[512 | L >> 8 & 255], k += N[768 | L & 255], K ^= k ^ P[13], k = N[K >>> 24], k += N[256 | K >> 16 & 255], k ^= N[512 | K >> 8 & 255], k += N[768 | K & 255], L ^= k ^ P[14], k = N[L >>> 24], k += N[256 | L >> 16 & 255], k ^= N[512 | L >> 8 & 255], k += N[768 | L & 255], K ^= k ^ P[15], k = N[K >>> 24], k += N[256 | K >> 16 & 255], k ^= N[512 | K >> 8 & 255], k += N[768 | K & 255], L ^= k ^ P[16], j[F] = K ^ P[O + 1], j[F + 1] = L, j;
4553
+ var k, L = j[F], G = j[F + 1];
4554
+ return L ^= P[0], k = N[L >>> 24], k += N[256 | L >> 16 & 255], k ^= N[512 | L >> 8 & 255], k += N[768 | L & 255], G ^= k ^ P[1], k = N[G >>> 24], k += N[256 | G >> 16 & 255], k ^= N[512 | G >> 8 & 255], k += N[768 | G & 255], L ^= k ^ P[2], k = N[L >>> 24], k += N[256 | L >> 16 & 255], k ^= N[512 | L >> 8 & 255], k += N[768 | L & 255], G ^= k ^ P[3], k = N[G >>> 24], k += N[256 | G >> 16 & 255], k ^= N[512 | G >> 8 & 255], k += N[768 | G & 255], L ^= k ^ P[4], k = N[L >>> 24], k += N[256 | L >> 16 & 255], k ^= N[512 | L >> 8 & 255], k += N[768 | L & 255], G ^= k ^ P[5], k = N[G >>> 24], k += N[256 | G >> 16 & 255], k ^= N[512 | G >> 8 & 255], k += N[768 | G & 255], L ^= k ^ P[6], k = N[L >>> 24], k += N[256 | L >> 16 & 255], k ^= N[512 | L >> 8 & 255], k += N[768 | L & 255], G ^= k ^ P[7], k = N[G >>> 24], k += N[256 | G >> 16 & 255], k ^= N[512 | G >> 8 & 255], k += N[768 | G & 255], L ^= k ^ P[8], k = N[L >>> 24], k += N[256 | L >> 16 & 255], k ^= N[512 | L >> 8 & 255], k += N[768 | L & 255], G ^= k ^ P[9], k = N[G >>> 24], k += N[256 | G >> 16 & 255], k ^= N[512 | G >> 8 & 255], k += N[768 | G & 255], L ^= k ^ P[10], k = N[L >>> 24], k += N[256 | L >> 16 & 255], k ^= N[512 | L >> 8 & 255], k += N[768 | L & 255], G ^= k ^ P[11], k = N[G >>> 24], k += N[256 | G >> 16 & 255], k ^= N[512 | G >> 8 & 255], k += N[768 | G & 255], L ^= k ^ P[12], k = N[L >>> 24], k += N[256 | L >> 16 & 255], k ^= N[512 | L >> 8 & 255], k += N[768 | L & 255], G ^= k ^ P[13], k = N[G >>> 24], k += N[256 | G >> 16 & 255], k ^= N[512 | G >> 8 & 255], k += N[768 | G & 255], L ^= k ^ P[14], k = N[L >>> 24], k += N[256 | L >> 16 & 255], k ^= N[512 | L >> 8 & 255], k += N[768 | L & 255], G ^= k ^ P[15], k = N[G >>> 24], k += N[256 | G >> 16 & 255], k ^= N[512 | G >> 8 & 255], k += N[768 | G & 255], L ^= k ^ P[16], j[F] = G ^ P[O + 1], j[F + 1] = L, j;
4555
4555
  }
4556
- function G(j, F) {
4556
+ function K(j, F) {
4557
4557
  for (var P = 0, N = 0; P < 4; ++P)
4558
4558
  N = N << 8 | j[F] & 255, F = (F + 1) % j.length;
4559
4559
  return { key: N, offp: F };
4560
4560
  }
4561
4561
  function W(j, F, P) {
4562
- for (var N = 0, k = [0, 0], L = F.length, K = P.length, pe, se = 0; se < L; se++)
4563
- pe = G(j, N), N = pe.offp, F[se] = F[se] ^ pe.key;
4562
+ for (var N = 0, k = [0, 0], L = F.length, G = P.length, pe, se = 0; se < L; se++)
4563
+ pe = K(j, N), N = pe.offp, F[se] = F[se] ^ pe.key;
4564
4564
  for (se = 0; se < L; se += 2)
4565
4565
  k = M(k, 0, F, P), F[se] = k[0], F[se + 1] = k[1];
4566
- for (se = 0; se < K; se += 2)
4566
+ for (se = 0; se < G; se += 2)
4567
4567
  k = M(k, 0, F, P), P[se] = k[0], P[se + 1] = k[1];
4568
4568
  }
4569
4569
  function Z(j, F, P, N) {
4570
- for (var k = 0, L = [0, 0], K = P.length, pe = N.length, se, $e = 0; $e < K; $e++)
4571
- se = G(F, k), k = se.offp, P[$e] = P[$e] ^ se.key;
4572
- for (k = 0, $e = 0; $e < K; $e += 2)
4573
- se = G(j, k), k = se.offp, L[0] ^= se.key, se = G(j, k), k = se.offp, L[1] ^= se.key, L = M(L, 0, P, N), P[$e] = L[0], P[$e + 1] = L[1];
4570
+ for (var k = 0, L = [0, 0], G = P.length, pe = N.length, se, $e = 0; $e < G; $e++)
4571
+ se = K(F, k), k = se.offp, P[$e] = P[$e] ^ se.key;
4572
+ for (k = 0, $e = 0; $e < G; $e += 2)
4573
+ se = K(j, k), k = se.offp, L[0] ^= se.key, se = K(j, k), k = se.offp, L[1] ^= se.key, L = M(L, 0, P, N), P[$e] = L[0], P[$e + 1] = L[1];
4574
4574
  for ($e = 0; $e < pe; $e += 2)
4575
- se = G(j, k), k = se.offp, L[0] ^= se.key, se = G(j, k), k = se.offp, L[1] ^= se.key, L = M(L, 0, P, N), N[$e] = L[0], N[$e + 1] = L[1];
4575
+ se = K(j, k), k = se.offp, L[0] ^= se.key, se = K(j, k), k = se.offp, L[1] ^= se.key, L = M(L, 0, P, N), N[$e] = L[0], N[$e + 1] = L[1];
4576
4576
  }
4577
4577
  function Y(j, F, P, N, k) {
4578
- var L = V.slice(), K = L.length, pe;
4578
+ var L = z.slice(), G = L.length, pe;
4579
4579
  if (P < 4 || P > 31)
4580
4580
  if (pe = Error("Illegal number of rounds (4-31): " + P), N) {
4581
4581
  a(N.bind(this, pe));
@@ -4597,10 +4597,10 @@ const ov = {}, av = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
4597
4597
  ;
4598
4598
  else {
4599
4599
  for (Ce = 0; Ce < 64; Ce++)
4600
- for (ee = 0; ee < K >> 1; ee++)
4600
+ for (ee = 0; ee < G >> 1; ee++)
4601
4601
  M(L, ee << 1, se, $e);
4602
4602
  var Xe = [];
4603
- for (Ce = 0; Ce < K; Ce++)
4603
+ for (Ce = 0; Ce < G; Ce++)
4604
4604
  Xe.push((L[Ce] >> 24 & 255) >>> 0), Xe.push((L[Ce] >> 16 & 255) >>> 0), Xe.push((L[Ce] >> 8 & 255) >>> 0), Xe.push((L[Ce] & 255) >>> 0);
4605
4605
  if (N) {
4606
4606
  N(null, Xe);
@@ -4625,7 +4625,7 @@ const ov = {}, av = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
4625
4625
  return;
4626
4626
  } else
4627
4627
  throw k;
4628
- var L, K;
4628
+ var L, G;
4629
4629
  if (F.charAt(0) !== "$" || F.charAt(1) !== "2")
4630
4630
  if (k = Error("Invalid salt version: " + F.substring(0, 2)), P) {
4631
4631
  a(P.bind(this, k));
@@ -4633,7 +4633,7 @@ const ov = {}, av = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
4633
4633
  } else
4634
4634
  throw k;
4635
4635
  if (F.charAt(2) === "$")
4636
- L = "\0", K = 3;
4636
+ L = "\0", G = 3;
4637
4637
  else {
4638
4638
  if (L = F.charAt(2), L !== "a" && L !== "b" && L !== "y" || F.charAt(3) !== "$")
4639
4639
  if (k = Error("Invalid salt revision: " + F.substring(2, 4)), P) {
@@ -4641,20 +4641,20 @@ const ov = {}, av = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
4641
4641
  return;
4642
4642
  } else
4643
4643
  throw k;
4644
- K = 4;
4644
+ G = 4;
4645
4645
  }
4646
- if (F.charAt(K + 2) > "$")
4646
+ if (F.charAt(G + 2) > "$")
4647
4647
  if (k = Error("Missing salt rounds"), P) {
4648
4648
  a(P.bind(this, k));
4649
4649
  return;
4650
4650
  } else
4651
4651
  throw k;
4652
- var pe = parseInt(F.substring(K, K + 1), 10) * 10, se = parseInt(F.substring(K + 1, K + 2), 10), $e = pe + se, Ce = F.substring(K + 3, K + 25);
4652
+ var pe = parseInt(F.substring(G, G + 1), 10) * 10, se = parseInt(F.substring(G + 1, G + 2), 10), $e = pe + se, Ce = F.substring(G + 3, G + 25);
4653
4653
  j += L >= "a" ? "\0" : "";
4654
4654
  var ee = l(j), we = g(Ce, A);
4655
4655
  function Un(Fe) {
4656
4656
  var Xe = [];
4657
- return Xe.push("$2"), L >= "a" && Xe.push(L), Xe.push("$"), $e < 10 && Xe.push("0"), Xe.push($e.toString()), Xe.push("$"), Xe.push(h(we, we.length)), Xe.push(h(Fe, V.length * 4 - 1)), Xe.join("");
4657
+ return Xe.push("$2"), L >= "a" && Xe.push(L), Xe.push("$"), $e < 10 && Xe.push("0"), Xe.push($e.toString()), Xe.push("$"), Xe.push(h(we, we.length)), Xe.push(h(Fe, z.length * 4 - 1)), Xe.join("");
4658
4658
  }
4659
4659
  if (typeof P > "u")
4660
4660
  return Un(Y(ee, we, $e));
@@ -6576,9 +6576,9 @@ const t_ = [
6576
6576
  async function Qb(t, e) {
6577
6577
  var x, q;
6578
6578
  const { tenantId: n, clientId: r, audience: i, requestedScopes: s } = e, a = s.filter(
6579
- (V) => t_.includes(V)
6579
+ (z) => t_.includes(z)
6580
6580
  ), u = (await t.env.data.resourceServers.list(n)).resource_servers.filter(
6581
- (V) => V.identifier === i
6581
+ (z) => z.identifier === i
6582
6582
  );
6583
6583
  if (u.length === 0)
6584
6584
  return { scopes: a, permissions: [] };
@@ -6588,31 +6588,35 @@ async function Qb(t, e) {
6588
6588
  const p = ((x = d.options) == null ? void 0 : x.enforce_policies) === !0, h = ((q = d.options) == null ? void 0 : q.token_dialect) || "access_token", $ = (await t.env.data.clientGrants.list(n, {
6589
6589
  q: `client_id:"${r}"`
6590
6590
  })).client_grants.find(
6591
- (V) => V.audience === i
6591
+ (z) => z.audience === i
6592
6592
  );
6593
6593
  if (!$)
6594
6594
  return { scopes: a, permissions: [] };
6595
6595
  const A = $.scope || [], T = (d.scopes || []).map(
6596
- (V) => V.value
6596
+ (z) => z.value
6597
6597
  );
6598
6598
  if (!p) {
6599
- const V = s.filter(
6600
- (G) => T.includes(G) && A.includes(G)
6601
- );
6602
- return { scopes: [
6603
- .../* @__PURE__ */ new Set([...a, ...V])
6599
+ let z;
6600
+ return s.length === 0 ? z = A.filter(
6601
+ (K) => T.includes(K)
6602
+ ) : z = s.filter(
6603
+ (K) => T.includes(K) && A.includes(K)
6604
+ ), { scopes: [
6605
+ .../* @__PURE__ */ new Set([...a, ...z])
6604
6606
  ], permissions: [] };
6605
6607
  }
6606
6608
  if (h === "access_token_authz") {
6607
- const V = A.filter(
6609
+ const z = A.filter(
6608
6610
  (M) => T.includes(M)
6609
6611
  );
6610
- return { scopes: a, permissions: V };
6611
- }
6612
- const O = s.filter(
6613
- (V) => T.includes(V) && A.includes(V)
6614
- );
6615
- return { scopes: [
6612
+ return { scopes: a, permissions: z };
6613
+ }
6614
+ let O;
6615
+ return s.length === 0 ? O = A.filter(
6616
+ (z) => T.includes(z)
6617
+ ) : O = s.filter(
6618
+ (z) => T.includes(z) && A.includes(z)
6619
+ ), { scopes: [
6616
6620
  .../* @__PURE__ */ new Set([...a, ...O])
6617
6621
  ], permissions: [] };
6618
6622
  }
@@ -6688,15 +6692,15 @@ async function va(t, e) {
6688
6692
  }), x.forEach((Y) => {
6689
6693
  q.add(Y);
6690
6694
  });
6691
- const V = Array.from(q);
6695
+ const z = Array.from(q);
6692
6696
  if ($ === "access_token_authz") {
6693
- const Y = V.filter(
6697
+ const Y = z.filter(
6694
6698
  (Se) => h.includes(Se)
6695
6699
  );
6696
6700
  return { scopes: l, permissions: Y };
6697
6701
  }
6698
6702
  const M = s.filter(
6699
- (Y) => h.includes(Y) && V.includes(Y)
6703
+ (Y) => h.includes(Y) && z.includes(Y)
6700
6704
  );
6701
6705
  return { scopes: [
6702
6706
  .../* @__PURE__ */ new Set([...l, ...M])
@@ -6704,29 +6708,34 @@ async function va(t, e) {
6704
6708
  }
6705
6709
  const $h = ["sub", "iss", "aud", "exp", "nbf", "iat", "jti"];
6706
6710
  async function yc(t, e) {
6707
- var O, D;
6711
+ var D, x;
6708
6712
  const { authParams: n, user: r, client: i, session_id: s } = e, { signingKeys: a } = await t.env.data.keys.list({
6709
6713
  q: "type:jwt_signing"
6710
6714
  }), l = a.filter(
6711
- (x) => !x.revoked_at || new Date(x.revoked_at) > /* @__PURE__ */ new Date()
6715
+ (q) => !q.revoked_at || new Date(q.revoked_at) > /* @__PURE__ */ new Date()
6712
6716
  ), u = l[l.length - 1];
6713
6717
  if (!(u != null && u.pkcs7))
6714
6718
  throw new E(500, { message: "No signing key available" });
6715
- const d = bv(u.pkcs7), p = t.var.custom_domain ? `https://${t.var.custom_domain}/` : t.env.ISSUER, h = {
6719
+ let d = null;
6720
+ e.organization && (d = await t.env.data.organizations.get(
6721
+ t.var.tenant_id,
6722
+ e.organization
6723
+ ));
6724
+ const p = bv(u.pkcs7), h = t.var.custom_domain ? `https://${t.var.custom_domain}/` : t.env.ISSUER, g = {
6716
6725
  // TODO: consider if the dafault should be removed
6717
6726
  aud: n.audience || "default",
6718
6727
  scope: n.scope || "",
6719
6728
  sub: (r == null ? void 0 : r.user_id) || n.client_id,
6720
- iss: p,
6729
+ iss: h,
6721
6730
  tenant_id: t.var.tenant_id,
6722
6731
  sid: s,
6723
6732
  ...e.organization && { org_id: e.organization },
6724
6733
  ...e.permissions && e.permissions.length > 0 && { permissions: e.permissions }
6725
- }, g = r && ((O = n.scope) != null && O.split(" ").includes("openid")) ? {
6734
+ }, $ = r && ((D = n.scope) != null && D.split(" ").includes("openid")) ? {
6726
6735
  // The audience for an id token is the client id
6727
6736
  aud: n.client_id,
6728
6737
  sub: r.user_id,
6729
- iss: p,
6738
+ iss: h,
6730
6739
  sid: s,
6731
6740
  nonce: n.nonce,
6732
6741
  given_name: r.given_name,
@@ -6737,9 +6746,12 @@ async function yc(t, e) {
6737
6746
  name: r.name,
6738
6747
  email: r.email,
6739
6748
  email_verified: r.email_verified,
6740
- ...e.organization && { org_id: e.organization }
6749
+ ...e.organization && d ? {
6750
+ org_id: e.organization,
6751
+ org_name: d.name
6752
+ } : {}
6741
6753
  } : void 0;
6742
- (D = t.env.hooks) != null && D.onExecuteCredentialsExchange && await t.env.hooks.onExecuteCredentialsExchange(
6754
+ (x = t.env.hooks) != null && x.onExecuteCredentialsExchange && await t.env.hooks.onExecuteCredentialsExchange(
6743
6755
  {
6744
6756
  ctx: t,
6745
6757
  client: i,
@@ -6755,44 +6767,44 @@ async function yc(t, e) {
6755
6767
  },
6756
6768
  {
6757
6769
  accessToken: {
6758
- setCustomClaim: (x, q) => {
6759
- if ($h.includes(x))
6760
- throw new Error(`Cannot overwrite reserved claim '${x}'`);
6761
- h[x] = q;
6770
+ setCustomClaim: (q, z) => {
6771
+ if ($h.includes(q))
6772
+ throw new Error(`Cannot overwrite reserved claim '${q}'`);
6773
+ g[q] = z;
6762
6774
  }
6763
6775
  },
6764
6776
  idToken: {
6765
- setCustomClaim: (x, q) => {
6766
- if ($h.includes(x))
6767
- throw new Error(`Cannot overwrite reserved claim '${x}'`);
6768
- g && (g[x] = q);
6777
+ setCustomClaim: (q, z) => {
6778
+ if ($h.includes(q))
6779
+ throw new Error(`Cannot overwrite reserved claim '${q}'`);
6780
+ $ && ($[q] = z);
6769
6781
  }
6770
6782
  },
6771
6783
  access: {
6772
- deny: (x) => {
6784
+ deny: (q) => {
6773
6785
  throw new E(400, {
6774
- message: `Access denied: ${x}`
6786
+ message: `Access denied: ${q}`
6775
6787
  });
6776
6788
  }
6777
6789
  }
6778
6790
  }
6779
6791
  );
6780
- const $ = {
6792
+ const A = {
6781
6793
  includeIssuedTimestamp: !0,
6782
6794
  expiresIn: new mp(1, "d"),
6783
6795
  headers: {
6784
6796
  kid: u.kid
6785
6797
  }
6786
- }, A = await mh(
6798
+ }, T = await mh(
6787
6799
  "RS256",
6788
- d,
6789
- h,
6790
- $
6791
- ), T = g ? await mh("RS256", d, g, $) : void 0;
6800
+ p,
6801
+ g,
6802
+ A
6803
+ ), O = $ ? await mh("RS256", p, $, A) : void 0;
6792
6804
  return {
6793
- access_token: A,
6805
+ access_token: T,
6794
6806
  refresh_token: e.refresh_token,
6795
- id_token: T,
6807
+ id_token: O,
6796
6808
  token_type: "Bearer",
6797
6809
  expires_in: 86400
6798
6810
  };
@@ -8482,8 +8494,8 @@ var kh;
8482
8494
  return R[I];
8483
8495
  }
8484
8496
  }, h = Object.getPrototypeOf(Function), g = typeof Map == "function" && typeof Map.prototype.entries == "function" ? Map : le(), $ = typeof Set == "function" && typeof Set.prototype.entries == "function" ? Set : Wt(), A = typeof WeakMap == "function" ? WeakMap : Lt(), T = i ? Symbol.for("@reflect-metadata:registry") : void 0, O = bn(), D = Et(O);
8485
- function x(R, I, z, ne) {
8486
- if (ee(z)) {
8497
+ function x(R, I, V, ne) {
8498
+ if (ee(V)) {
8487
8499
  if (!Pt(R))
8488
8500
  throw new TypeError();
8489
8501
  if (!ge(I))
@@ -8496,49 +8508,49 @@ var kh;
8496
8508
  throw new TypeError();
8497
8509
  if (!Fe(ne) && !ee(ne) && !we(ne))
8498
8510
  throw new TypeError();
8499
- return we(ne) && (ne = void 0), z = rt(z), P(R, I, z, ne);
8511
+ return we(ne) && (ne = void 0), V = rt(V), P(R, I, V, ne);
8500
8512
  }
8501
8513
  }
8502
8514
  e("decorate", x);
8503
8515
  function q(R, I) {
8504
- function z(ne, ve) {
8516
+ function V(ne, ve) {
8505
8517
  if (!Fe(ne))
8506
8518
  throw new TypeError();
8507
8519
  if (!ee(ve) && !me(ve))
8508
8520
  throw new TypeError();
8509
8521
  pe(R, I, ne, ve);
8510
8522
  }
8511
- return z;
8523
+ return V;
8512
8524
  }
8513
8525
  e("metadata", q);
8514
- function V(R, I, z, ne) {
8515
- if (!Fe(z))
8526
+ function z(R, I, V, ne) {
8527
+ if (!Fe(V))
8516
8528
  throw new TypeError();
8517
- return ee(ne) || (ne = rt(ne)), pe(R, I, z, ne);
8529
+ return ee(ne) || (ne = rt(ne)), pe(R, I, V, ne);
8518
8530
  }
8519
- e("defineMetadata", V);
8520
- function M(R, I, z) {
8531
+ e("defineMetadata", z);
8532
+ function M(R, I, V) {
8521
8533
  if (!Fe(I))
8522
8534
  throw new TypeError();
8523
- return ee(z) || (z = rt(z)), N(R, I, z);
8535
+ return ee(V) || (V = rt(V)), N(R, I, V);
8524
8536
  }
8525
8537
  e("hasMetadata", M);
8526
- function G(R, I, z) {
8538
+ function K(R, I, V) {
8527
8539
  if (!Fe(I))
8528
8540
  throw new TypeError();
8529
- return ee(z) || (z = rt(z)), k(R, I, z);
8541
+ return ee(V) || (V = rt(V)), k(R, I, V);
8530
8542
  }
8531
- e("hasOwnMetadata", G);
8532
- function W(R, I, z) {
8543
+ e("hasOwnMetadata", K);
8544
+ function W(R, I, V) {
8533
8545
  if (!Fe(I))
8534
8546
  throw new TypeError();
8535
- return ee(z) || (z = rt(z)), L(R, I, z);
8547
+ return ee(V) || (V = rt(V)), L(R, I, V);
8536
8548
  }
8537
8549
  e("getMetadata", W);
8538
- function Z(R, I, z) {
8550
+ function Z(R, I, V) {
8539
8551
  if (!Fe(I))
8540
8552
  throw new TypeError();
8541
- return ee(z) || (z = rt(z)), K(R, I, z);
8553
+ return ee(V) || (V = rt(V)), G(R, I, V);
8542
8554
  }
8543
8555
  e("getOwnMetadata", Z);
8544
8556
  function Y(R, I) {
@@ -8553,24 +8565,24 @@ var kh;
8553
8565
  return ee(I) || (I = rt(I)), $e(R, I);
8554
8566
  }
8555
8567
  e("getOwnMetadataKeys", Se);
8556
- function j(R, I, z) {
8568
+ function j(R, I, V) {
8557
8569
  if (!Fe(I))
8558
8570
  throw new TypeError();
8559
- if (ee(z) || (z = rt(z)), !Fe(I))
8571
+ if (ee(V) || (V = rt(V)), !Fe(I))
8560
8572
  throw new TypeError();
8561
- ee(z) || (z = rt(z));
8573
+ ee(V) || (V = rt(V));
8562
8574
  var ne = _e(
8563
8575
  I,
8564
- z,
8576
+ V,
8565
8577
  /*Create*/
8566
8578
  !1
8567
8579
  );
8568
- return ee(ne) ? !1 : ne.OrdinaryDeleteMetadata(R, I, z);
8580
+ return ee(ne) ? !1 : ne.OrdinaryDeleteMetadata(R, I, V);
8569
8581
  }
8570
8582
  e("deleteMetadata", j);
8571
8583
  function F(R, I) {
8572
- for (var z = R.length - 1; z >= 0; --z) {
8573
- var ne = R[z], ve = ne(I);
8584
+ for (var V = R.length - 1; V >= 0; --V) {
8585
+ var ne = R[V], ve = ne(I);
8574
8586
  if (!ee(ve) && !we(ve)) {
8575
8587
  if (!ge(ve))
8576
8588
  throw new TypeError();
@@ -8579,9 +8591,9 @@ var kh;
8579
8591
  }
8580
8592
  return I;
8581
8593
  }
8582
- function P(R, I, z, ne) {
8594
+ function P(R, I, V, ne) {
8583
8595
  for (var ve = R.length - 1; ve >= 0; --ve) {
8584
- var it = R[ve], Be = it(I, z, ne);
8596
+ var it = R[ve], Be = it(I, V, ne);
8585
8597
  if (!ee(Be) && !we(Be)) {
8586
8598
  if (!Fe(Be))
8587
8599
  throw new TypeError();
@@ -8590,59 +8602,59 @@ var kh;
8590
8602
  }
8591
8603
  return ne;
8592
8604
  }
8593
- function N(R, I, z) {
8594
- var ne = k(R, I, z);
8605
+ function N(R, I, V) {
8606
+ var ne = k(R, I, V);
8595
8607
  if (ne)
8596
8608
  return !0;
8597
8609
  var ve = Bt(I);
8598
- return we(ve) ? !1 : N(R, ve, z);
8610
+ return we(ve) ? !1 : N(R, ve, V);
8599
8611
  }
8600
- function k(R, I, z) {
8612
+ function k(R, I, V) {
8601
8613
  var ne = _e(
8602
8614
  I,
8603
- z,
8615
+ V,
8604
8616
  /*Create*/
8605
8617
  !1
8606
8618
  );
8607
- return ee(ne) ? !1 : te(ne.OrdinaryHasOwnMetadata(R, I, z));
8619
+ return ee(ne) ? !1 : te(ne.OrdinaryHasOwnMetadata(R, I, V));
8608
8620
  }
8609
- function L(R, I, z) {
8610
- var ne = k(R, I, z);
8621
+ function L(R, I, V) {
8622
+ var ne = k(R, I, V);
8611
8623
  if (ne)
8612
- return K(R, I, z);
8624
+ return G(R, I, V);
8613
8625
  var ve = Bt(I);
8614
8626
  if (!we(ve))
8615
- return L(R, ve, z);
8627
+ return L(R, ve, V);
8616
8628
  }
8617
- function K(R, I, z) {
8629
+ function G(R, I, V) {
8618
8630
  var ne = _e(
8619
8631
  I,
8620
- z,
8632
+ V,
8621
8633
  /*Create*/
8622
8634
  !1
8623
8635
  );
8624
8636
  if (!ee(ne))
8625
- return ne.OrdinaryGetOwnMetadata(R, I, z);
8637
+ return ne.OrdinaryGetOwnMetadata(R, I, V);
8626
8638
  }
8627
- function pe(R, I, z, ne) {
8639
+ function pe(R, I, V, ne) {
8628
8640
  var ve = _e(
8629
- z,
8641
+ V,
8630
8642
  ne,
8631
8643
  /*Create*/
8632
8644
  !0
8633
8645
  );
8634
- ve.OrdinaryDefineOwnMetadata(R, I, z, ne);
8646
+ ve.OrdinaryDefineOwnMetadata(R, I, V, ne);
8635
8647
  }
8636
8648
  function se(R, I) {
8637
- var z = $e(R, I), ne = Bt(R);
8649
+ var V = $e(R, I), ne = Bt(R);
8638
8650
  if (ne === null)
8639
- return z;
8651
+ return V;
8640
8652
  var ve = se(ne, I);
8641
8653
  if (ve.length <= 0)
8642
- return z;
8643
- if (z.length <= 0)
8654
+ return V;
8655
+ if (V.length <= 0)
8644
8656
  return ve;
8645
- for (var it = new $(), Be = [], c = 0, f = z; c < f.length; c++) {
8657
+ for (var it = new $(), Be = [], c = 0, f = V; c < f.length; c++) {
8646
8658
  var y = f[c], b = it.has(y);
8647
8659
  b || (it.add(y), Be.push(y));
8648
8660
  }
@@ -8653,13 +8665,13 @@ var kh;
8653
8665
  return Be;
8654
8666
  }
8655
8667
  function $e(R, I) {
8656
- var z = _e(
8668
+ var V = _e(
8657
8669
  R,
8658
8670
  I,
8659
8671
  /*create*/
8660
8672
  !1
8661
8673
  );
8662
- return z ? z.OrdinaryOwnMetadataKeys(R, I) : [];
8674
+ return V ? V.OrdinaryOwnMetadataKeys(R, I) : [];
8663
8675
  }
8664
8676
  function Ce(R) {
8665
8677
  if (R === null)
@@ -8708,9 +8720,9 @@ var kh;
8708
8720
  case 5:
8709
8721
  return R;
8710
8722
  }
8711
- var z = "string", ne = Lo(R, s);
8723
+ var V = "string", ne = Lo(R, s);
8712
8724
  if (ne !== void 0) {
8713
- var ve = ne.call(R, z);
8725
+ var ve = ne.call(R, V);
8714
8726
  if (Fe(ve))
8715
8727
  throw new TypeError();
8716
8728
  return ve;
@@ -8718,7 +8730,7 @@ var kh;
8718
8730
  return tn(R);
8719
8731
  }
8720
8732
  function tn(R, I) {
8721
- var z, ne;
8733
+ var V, ne;
8722
8734
  {
8723
8735
  var ve = R.toString;
8724
8736
  if (Me(ve)) {
@@ -8726,9 +8738,9 @@ var kh;
8726
8738
  if (!Fe(ne))
8727
8739
  return ne;
8728
8740
  }
8729
- var z = R.valueOf;
8730
- if (Me(z)) {
8731
- var ne = z.call(R);
8741
+ var V = R.valueOf;
8742
+ if (Me(V)) {
8743
+ var ne = V.call(R);
8732
8744
  if (!Fe(ne))
8733
8745
  return ne;
8734
8746
  }
@@ -8768,21 +8780,21 @@ var kh;
8768
8780
  return R === I || R !== R && I !== I;
8769
8781
  }
8770
8782
  function Lo(R, I) {
8771
- var z = R[I];
8772
- if (z != null) {
8773
- if (!Me(z))
8783
+ var V = R[I];
8784
+ if (V != null) {
8785
+ if (!Me(V))
8774
8786
  throw new TypeError();
8775
- return z;
8787
+ return V;
8776
8788
  }
8777
8789
  }
8778
8790
  function fe(R) {
8779
8791
  var I = Lo(R, a);
8780
8792
  if (!Me(I))
8781
8793
  throw new TypeError();
8782
- var z = I.call(R);
8783
- if (!Fe(z))
8794
+ var V = I.call(R);
8795
+ if (!Fe(V))
8784
8796
  throw new TypeError();
8785
- return z;
8797
+ return V;
8786
8798
  }
8787
8799
  function lt(R) {
8788
8800
  return R.value;
@@ -8799,7 +8811,7 @@ var kh;
8799
8811
  var I = Object.getPrototypeOf(R);
8800
8812
  if (typeof R != "function" || R === h || I !== h)
8801
8813
  return I;
8802
- var z = R.prototype, ne = z && Object.getPrototypeOf(z);
8814
+ var V = R.prototype, ne = V && Object.getPrototypeOf(V);
8803
8815
  if (ne == null || ne === Object.prototype)
8804
8816
  return I;
8805
8817
  var ve = ne.constructor;
@@ -8808,7 +8820,7 @@ var kh;
8808
8820
  function Gt() {
8809
8821
  var R;
8810
8822
  !ee(T) && typeof n.Reflect < "u" && !(T in n.Reflect) && typeof n.Reflect.defineMetadata == "function" && (R = nn(n.Reflect));
8811
- var I, z, ne, ve = new A(), it = {
8823
+ var I, V, ne, ve = new A(), it = {
8812
8824
  registerProvider: Be,
8813
8825
  getProvider: f,
8814
8826
  setProvider: b
@@ -8825,10 +8837,10 @@ var kh;
8825
8837
  break;
8826
8838
  case I === v:
8827
8839
  break;
8828
- case ee(z):
8829
- z = v;
8840
+ case ee(V):
8841
+ V = v;
8830
8842
  break;
8831
- case z === v:
8843
+ case V === v:
8832
8844
  break;
8833
8845
  default:
8834
8846
  ne === void 0 && (ne = new $()), ne.add(v);
@@ -8839,8 +8851,8 @@ var kh;
8839
8851
  if (!ee(I)) {
8840
8852
  if (I.isProviderFor(v, S))
8841
8853
  return I;
8842
- if (!ee(z)) {
8843
- if (z.isProviderFor(v, S))
8854
+ if (!ee(V)) {
8855
+ if (V.isProviderFor(v, S))
8844
8856
  return I;
8845
8857
  if (!ee(ne))
8846
8858
  for (var X = fe(ne); ; ) {
@@ -8863,7 +8875,7 @@ var kh;
8863
8875
  function y(v) {
8864
8876
  if (ee(v))
8865
8877
  throw new TypeError();
8866
- return I === v || z === v || !ee(ne) && ne.has(v);
8878
+ return I === v || V === v || !ee(ne) && ne.has(v);
8867
8879
  }
8868
8880
  function b(v, S, X) {
8869
8881
  if (!y(X))
@@ -8888,7 +8900,7 @@ var kh;
8888
8900
  }), R;
8889
8901
  }
8890
8902
  function Et(R) {
8891
- var I = new A(), z = {
8903
+ var I = new A(), V = {
8892
8904
  isProviderFor: function(y, b) {
8893
8905
  var v = I.get(y);
8894
8906
  return ee(v) ? !1 : v.has(b);
@@ -8899,7 +8911,7 @@ var kh;
8899
8911
  OrdinaryOwnMetadataKeys: c,
8900
8912
  OrdinaryDeleteMetadata: f
8901
8913
  };
8902
- return O.registerProvider(z), z;
8914
+ return O.registerProvider(V), V;
8903
8915
  function ne(y, b, v) {
8904
8916
  var S = I.get(y), X = !1;
8905
8917
  if (ee(S)) {
@@ -8911,7 +8923,7 @@ var kh;
8911
8923
  if (ee(ye)) {
8912
8924
  if (!v)
8913
8925
  return;
8914
- if (ye = new g(), S.set(b, ye), !R.setProvider(y, b, z))
8926
+ if (ye = new g(), S.set(b, ye), !R.setProvider(y, b, V))
8915
8927
  throw S.delete(b), X && I.delete(y), new Error("Wrong provider for target.");
8916
8928
  }
8917
8929
  return ye;
@@ -8987,31 +8999,31 @@ var kh;
8987
8999
  }
8988
9000
  }
8989
9001
  function nn(R) {
8990
- var I = R.defineMetadata, z = R.hasOwnMetadata, ne = R.getOwnMetadata, ve = R.getOwnMetadataKeys, it = R.deleteMetadata, Be = new A(), c = {
9002
+ var I = R.defineMetadata, V = R.hasOwnMetadata, ne = R.getOwnMetadata, ve = R.getOwnMetadataKeys, it = R.deleteMetadata, Be = new A(), c = {
8991
9003
  isProviderFor: function(f, y) {
8992
9004
  var b = Be.get(f);
8993
9005
  return !ee(b) && b.has(y) ? !0 : ve(f, y).length ? (ee(b) && (b = new $(), Be.set(f, b)), b.add(y), !0) : !1;
8994
9006
  },
8995
9007
  OrdinaryDefineOwnMetadata: I,
8996
- OrdinaryHasOwnMetadata: z,
9008
+ OrdinaryHasOwnMetadata: V,
8997
9009
  OrdinaryGetOwnMetadata: ne,
8998
9010
  OrdinaryOwnMetadataKeys: ve,
8999
9011
  OrdinaryDeleteMetadata: it
9000
9012
  };
9001
9013
  return c;
9002
9014
  }
9003
- function _e(R, I, z) {
9015
+ function _e(R, I, V) {
9004
9016
  var ne = O.getProvider(R, I);
9005
9017
  if (!ee(ne))
9006
9018
  return ne;
9007
- if (z) {
9019
+ if (V) {
9008
9020
  if (O.setProvider(R, I, D))
9009
9021
  return D;
9010
9022
  throw new Error("Illegal state.");
9011
9023
  }
9012
9024
  }
9013
9025
  function le() {
9014
- var R = {}, I = [], z = (
9026
+ var R = {}, I = [], V = (
9015
9027
  /** @class */
9016
9028
  function() {
9017
9029
  function c(f, y, b) {
@@ -9081,11 +9093,11 @@ var kh;
9081
9093
  }, c.prototype.clear = function() {
9082
9094
  this._keys.length = 0, this._values.length = 0, this._cacheKey = R, this._cacheIndex = -2;
9083
9095
  }, c.prototype.keys = function() {
9084
- return new z(this._keys, this._values, ve);
9096
+ return new V(this._keys, this._values, ve);
9085
9097
  }, c.prototype.values = function() {
9086
- return new z(this._keys, this._values, it);
9098
+ return new V(this._keys, this._values, it);
9087
9099
  }, c.prototype.entries = function() {
9088
- return new z(this._keys, this._values, Be);
9100
+ return new V(this._keys, this._values, Be);
9089
9101
  }, c.prototype["@@iterator"] = function() {
9090
9102
  return this.entries();
9091
9103
  }, c.prototype[a] = function() {
@@ -9127,12 +9139,12 @@ var kh;
9127
9139
  },
9128
9140
  enumerable: !0,
9129
9141
  configurable: !0
9130
- }), I.prototype.has = function(z) {
9131
- return this._map.has(z);
9132
- }, I.prototype.add = function(z) {
9133
- return this._map.set(z, z), this;
9134
- }, I.prototype.delete = function(z) {
9135
- return this._map.delete(z);
9142
+ }), I.prototype.has = function(V) {
9143
+ return this._map.has(V);
9144
+ }, I.prototype.add = function(V) {
9145
+ return this._map.set(V, V), this;
9146
+ }, I.prototype.delete = function(V) {
9147
+ return this._map.delete(V);
9136
9148
  }, I.prototype.clear = function() {
9137
9149
  this._map.clear();
9138
9150
  }, I.prototype.keys = function() {
@@ -9151,7 +9163,7 @@ var kh;
9151
9163
  return R;
9152
9164
  }
9153
9165
  function Lt() {
9154
- var R = 16, I = p.create(), z = ne();
9166
+ var R = 16, I = p.create(), V = ne();
9155
9167
  return (
9156
9168
  /** @class */
9157
9169
  function() {
@@ -9199,12 +9211,12 @@ var kh;
9199
9211
  return I[f] = !0, f;
9200
9212
  }
9201
9213
  function ve(f, y) {
9202
- if (!r.call(f, z)) {
9214
+ if (!r.call(f, V)) {
9203
9215
  if (!y)
9204
9216
  return;
9205
- Object.defineProperty(f, z, { value: p.create() });
9217
+ Object.defineProperty(f, V, { value: p.create() });
9206
9218
  }
9207
- return f[z];
9219
+ return f[V];
9208
9220
  }
9209
9221
  function it(f, y) {
9210
9222
  for (var b = 0; b < y; ++b)
@@ -19455,7 +19467,7 @@ function gl(t, e) {
19455
19467
  T[O] = D;
19456
19468
  continue;
19457
19469
  }
19458
- const q = i[x] ?? r, V = [
19470
+ const q = i[x] ?? r, z = [
19459
19471
  "create",
19460
19472
  "update",
19461
19473
  "remove",
@@ -19464,14 +19476,14 @@ function gl(t, e) {
19464
19476
  "used"
19465
19477
  ].includes(O);
19466
19478
  T[O] = async (...M) => {
19467
- if (V)
19479
+ if (z)
19468
19480
  return await D.apply($, M);
19469
- const G = ex(
19481
+ const K = ex(
19470
19482
  g,
19471
19483
  O,
19472
19484
  M,
19473
19485
  l
19474
- ), W = await n.get(G);
19486
+ ), W = await n.get(K);
19475
19487
  if (W !== null)
19476
19488
  if (W && typeof W == "object" && "isCachedNull" in W) {
19477
19489
  const Y = W;
@@ -19481,13 +19493,13 @@ function gl(t, e) {
19481
19493
  const Z = await D.apply($, M);
19482
19494
  if (q >= 0)
19483
19495
  if (Z !== null)
19484
- await n.set(G, Z, q);
19496
+ await n.set(K, Z, q);
19485
19497
  else {
19486
19498
  const Y = {
19487
19499
  value: null,
19488
19500
  isCachedNull: !0
19489
19501
  };
19490
- await n.set(G, Y, q);
19502
+ await n.set(K, Y, q);
19491
19503
  }
19492
19504
  return Z;
19493
19505
  };
@@ -25615,8 +25627,8 @@ const AE = new be().openapi(
25615
25627
  if (q && typeof q == "object" && "access_token" in q)
25616
25628
  return t.json(q);
25617
25629
  } catch (q) {
25618
- const V = q;
25619
- "message" in V && typeof V.message == "string" && ($ = V.message);
25630
+ const z = q;
25631
+ "message" in z && typeof z.message == "string" && ($ = z.message);
25620
25632
  }
25621
25633
  const A = t.get("ip"), T = t.get("useragent"), O = t.get("auth0_client"), D = Qn(O), x = await e.data.loginSessions.create(
25622
25634
  h.tenant.id,
@@ -26021,17 +26033,17 @@ async function TE({
26021
26033
  response_type: p
26022
26034
  }) {
26023
26035
  const { env: h } = t, g = new URL(r), $ = `${g.protocol}//${g.host}`;
26024
- async function A(G = "Login required") {
26036
+ async function A(K = "Login required") {
26025
26037
  const W = Ve(t, {
26026
26038
  type: qe.FAILED_SILENT_AUTH,
26027
- description: G
26039
+ description: K
26028
26040
  });
26029
26041
  return await t.env.data.logs.create(e.tenant.id, W), t.html(
26030
26042
  Tu(
26031
26043
  $,
26032
26044
  JSON.stringify({
26033
26045
  error: "login_required",
26034
- error_description: G,
26046
+ error_description: K,
26035
26047
  state: i
26036
26048
  })
26037
26049
  )
@@ -26082,14 +26094,14 @@ async function TE({
26082
26094
  description: "Successful silent authentication"
26083
26095
  });
26084
26096
  await t.env.data.logs.create(e.tenant.id, q);
26085
- const V = new Headers();
26086
- V.set("Server-Timing", "cf-nel=0; no-cloudflare-insights=1");
26097
+ const z = new Headers();
26098
+ z.set("Server-Timing", "cf-nel=0; no-cloudflare-insights=1");
26087
26099
  const M = ya(
26088
26100
  e.tenant.id,
26089
26101
  n.id,
26090
26102
  t.req.header("host")
26091
26103
  );
26092
- return V.set("set-cookie", M), t.html(
26104
+ return z.set("set-cookie", M), t.html(
26093
26105
  Tu(
26094
26106
  $,
26095
26107
  JSON.stringify({
@@ -26098,7 +26110,7 @@ async function TE({
26098
26110
  })
26099
26111
  ),
26100
26112
  {
26101
- headers: V
26113
+ headers: z
26102
26114
  }
26103
26115
  );
26104
26116
  }
@@ -26195,12 +26207,12 @@ const IE = ["email", "sms", "Username-Password-Authentication"], OE = new be().o
26195
26207
  auth0Client: D,
26196
26208
  login_hint: x,
26197
26209
  ui_locales: q,
26198
- organization: V
26210
+ organization: z
26199
26211
  } = t.req.valid("query");
26200
26212
  t.set("log", "authorize");
26201
26213
  const M = await as(e, n);
26202
26214
  t.set("client_id", M.client_id), t.set("tenant_id", M.tenant.id);
26203
- const G = {
26215
+ const K = {
26204
26216
  redirect_uri: i.split("#")[0],
26205
26217
  // Remove fragment if present
26206
26218
  scope: s,
@@ -26216,19 +26228,19 @@ const IE = ["email", "sms", "Username-Password-Authentication"], OE = new be().o
26216
26228
  code_challenge_method: $,
26217
26229
  username: x,
26218
26230
  ui_locales: q,
26219
- organization: V
26231
+ organization: z
26220
26232
  }, W = t.req.header("origin");
26221
26233
  if (W && !I1(W, M.web_origins || []))
26222
26234
  throw new E(403, {
26223
26235
  message: `Origin ${W} not allowed`
26224
26236
  });
26225
- if (G.redirect_uri) {
26237
+ if (K.redirect_uri) {
26226
26238
  const F = M.callbacks || [];
26227
- if (t.var.host && (F.push(`${pl(t.env)}/*`), F.push(`${ft(t.env)}/*`)), !yf(G.redirect_uri, F, {
26239
+ if (t.var.host && (F.push(`${pl(t.env)}/*`), F.push(`${ft(t.env)}/*`)), !yf(K.redirect_uri, F, {
26228
26240
  allowPathWildcards: !0
26229
26241
  }))
26230
26242
  throw new E(400, {
26231
- message: `Invalid redirect URI - ${G.redirect_uri}`
26243
+ message: `Invalid redirect URI - ${K.redirect_uri}`
26232
26244
  });
26233
26245
  }
26234
26246
  const Z = Ii(
@@ -26259,16 +26271,16 @@ const IE = ["email", "sms", "Username-Password-Authentication"], OE = new be().o
26259
26271
  t,
26260
26272
  M,
26261
26273
  M.connections[0].name,
26262
- G
26274
+ K
26263
26275
  );
26264
26276
  if (d && d !== "email")
26265
- return lg(t, M, d, G);
26277
+ return lg(t, M, d, K);
26266
26278
  if (T) {
26267
26279
  const F = await CE(
26268
26280
  t,
26269
26281
  M.tenant.id,
26270
26282
  T,
26271
- G,
26283
+ K,
26272
26284
  O
26273
26285
  );
26274
26286
  return F instanceof Response ? F : t.json(F);
@@ -26277,7 +26289,7 @@ const IE = ["email", "sms", "Username-Password-Authentication"], OE = new be().o
26277
26289
  ctx: t,
26278
26290
  client: M,
26279
26291
  auth0Client: D,
26280
- authParams: G,
26292
+ authParams: K,
26281
26293
  session: Se || void 0,
26282
26294
  connection: d,
26283
26295
  login_hint: x
@@ -27261,7 +27273,7 @@ const i8 = (t, e) => {
27261
27273
  email: i,
27262
27274
  client: s
27263
27275
  }) => {
27264
- const a = s.connections.map(({ strategy: V }) => V), l = a.includes("email") || a.includes("Username-Password-Authentication"), u = a.includes("sms"), d = a.includes("facebook"), p = a.includes("google-oauth2"), h = a.includes("apple"), g = a.includes("vipps"), $ = d || p || h || g, A = l || u;
27276
+ const a = s.connections.map(({ strategy: z }) => z), l = a.includes("email") || a.includes("Username-Password-Authentication"), u = a.includes("sms"), d = a.includes("facebook"), p = a.includes("google-oauth2"), h = a.includes("apple"), g = a.includes("vipps"), $ = d || p || h || g, A = l || u;
27265
27277
  let T = "text", O = "username";
27266
27278
  const D = l && u ? "email_or_phone_placeholder" : l ? "email_placeholder" : "phone_placeholder";
27267
27279
  let x = B.t(
@@ -27940,21 +27952,21 @@ var Zs = "_hp", d8 = {
27940
27952
  const x = s.querySelectorAll(t);
27941
27953
  e:
27942
27954
  for (const q of x)
27943
- for (const V of ca[t])
27944
- if (q.getAttribute(V) === e[V]) {
27955
+ for (const z of ca[t])
27956
+ if (q.getAttribute(z) === e[z]) {
27945
27957
  h = q;
27946
27958
  break e;
27947
27959
  }
27948
27960
  if (!h) {
27949
27961
  const q = $.reduce(
27950
- (V, M) => e[M] === void 0 ? V : `${V}-${M}-${e[M]}`,
27962
+ (z, M) => e[M] === void 0 ? z : `${z}-${M}-${e[M]}`,
27951
27963
  t
27952
27964
  );
27953
27965
  g = !Wo[q], h = Wo[q] || (Wo[q] = (() => {
27954
- const V = document.createElement(t);
27966
+ const z = document.createElement(t);
27955
27967
  for (const M of $)
27956
- e[M] !== void 0 && V.setAttribute(M, e[M]), e.rel && V.setAttribute("rel", e.rel);
27957
- return V;
27968
+ e[M] !== void 0 && z.setAttribute(M, e[M]), e.rel && z.setAttribute("rel", e.rel);
27969
+ return z;
27958
27970
  })());
27959
27971
  }
27960
27972
  } else
@@ -27964,18 +27976,18 @@ var Zs = "_hp", d8 = {
27964
27976
  (x) => {
27965
27977
  if ($.length > 0) {
27966
27978
  let q = !1;
27967
- for (const V of s.querySelectorAll(t)) {
27968
- if (q && V.getAttribute(la) !== u) {
27969
- s.insertBefore(x, V);
27979
+ for (const z of s.querySelectorAll(t)) {
27980
+ if (q && z.getAttribute(la) !== u) {
27981
+ s.insertBefore(x, z);
27970
27982
  return;
27971
27983
  }
27972
- V.getAttribute(la) === u && (q = !0);
27984
+ z.getAttribute(la) === u && (q = !0);
27973
27985
  }
27974
27986
  s.appendChild(x);
27975
27987
  } else if (A) {
27976
27988
  let q = !1;
27977
- for (const V of A)
27978
- if (V === x) {
27989
+ for (const z of A)
27990
+ if (z === x) {
27979
27991
  q = !0;
27980
27992
  break;
27981
27993
  }
@@ -27991,21 +28003,21 @@ var Zs = "_hp", d8 = {
27991
28003
  const q = $[0];
27992
28004
  if (n === 2 && (x.innerHTML = ""), (g || A) && T(x), !l && !a)
27993
28005
  return;
27994
- let V = hi[M = x.getAttribute(q)] || (hi[M] = new Promise(
27995
- (G, W) => {
27996
- x.addEventListener("load", G), x.addEventListener("error", W);
28006
+ let z = hi[M = x.getAttribute(q)] || (hi[M] = new Promise(
28007
+ (K, W) => {
28008
+ x.addEventListener("load", K), x.addEventListener("error", W);
27997
28009
  }
27998
28010
  ));
27999
- a && (V = V.then(a)), l && (V = V.catch(l)), V.catch(() => {
28011
+ a && (z = z.then(a)), l && (z = z.catch(l)), z.catch(() => {
28000
28012
  });
28001
28013
  });
28002
28014
  if (i && d === "render") {
28003
28015
  const x = ca[t][0];
28004
28016
  if (e[x]) {
28005
- const q = e[x], V = hi[q] || (hi[q] = new Promise((M, G) => {
28006
- T(h), h.addEventListener("load", M), h.addEventListener("error", G);
28017
+ const q = e[x], z = hi[q] || (hi[q] = new Promise((M, K) => {
28018
+ T(h), h.addEventListener("load", M), h.addEventListener("error", K);
28007
28019
  }));
28008
- $8(V);
28020
+ $8(z);
28009
28021
  }
28010
28022
  }
28011
28023
  const D = {
@@ -30823,8 +30835,8 @@ const au = ({
30823
30835
  const p = await t.req.parseBody(), h = [], g = {};
30824
30836
  for (const D of d)
30825
30837
  if (D.type === "LEGAL") {
30826
- const x = D.id, q = !!D.required, V = p[x];
30827
- q && (!V || V === "") ? h.push(x) : typeof V == "string" && (g[x] = V);
30838
+ const x = D.id, q = !!D.required, z = p[x];
30839
+ q && (!z || z === "") ? h.push(x) : typeof z == "string" && (g[x] = z);
30828
30840
  }
30829
30841
  if (h.length > 0)
30830
30842
  return t.html(
@@ -31642,7 +31654,7 @@ var $6 = {}, ri = {}, Oo = {}, bl = {};
31642
31654
  }, this.reduceActions[13] = function(c) {
31643
31655
  return new L(c[0], c[2]);
31644
31656
  }, this.reduceActions[15] = function(c) {
31645
- return new K(c[0], c[2]);
31657
+ return new G(c[0], c[2]);
31646
31658
  }, this.reduceActions[16] = function(c) {
31647
31659
  return new pe(c[0], c[2]);
31648
31660
  }, this.reduceActions[18] = function(c) {
@@ -32344,11 +32356,11 @@ var $6 = {}, ri = {}, Oo = {}, bl = {};
32344
32356
  q.prototype.toString = function() {
32345
32357
  return this.expression.toString();
32346
32358
  };
32347
- function V(c, f, y) {
32359
+ function z(c, f, y) {
32348
32360
  f in c || (c[f] = y);
32349
32361
  }
32350
32362
  q.prototype.evaluate = function(c) {
32351
- return c.contextNode = c.expressionContextNode, c.contextSize = 1, c.contextPosition = 1, c.isHtml && (V(c, "caseInsensitive", !0), V(c, "allowAnyNamespaceForNoPrefix", !0)), V(c, "caseInsensitive", !1), this.expression.evaluate(c);
32363
+ return c.contextNode = c.expressionContextNode, c.contextSize = 1, c.contextPosition = 1, c.isHtml && (z(c, "caseInsensitive", !0), z(c, "allowAnyNamespaceForNoPrefix", !0)), z(c, "caseInsensitive", !1), this.expression.evaluate(c);
32352
32364
  }, q.XML_NAMESPACE_URI = "http://www.w3.org/XML/1998/namespace", q.XMLNS_NAMESPACE_URI = "http://www.w3.org/2000/xmlns/", M.prototype = new Object(), M.prototype.constructor = M, M.superclass = Object.prototype;
32353
32365
  function M() {
32354
32366
  }
@@ -32357,13 +32369,13 @@ var $6 = {}, ri = {}, Oo = {}, bl = {};
32357
32369
  return "<Expression>";
32358
32370
  }, M.prototype.evaluate = function(c) {
32359
32371
  throw new Error("Could not evaluate expression.");
32360
- }, G.prototype = new M(), G.prototype.constructor = G, G.superclass = M.prototype;
32361
- function G(c) {
32372
+ }, K.prototype = new M(), K.prototype.constructor = K, K.superclass = M.prototype;
32373
+ function K(c) {
32362
32374
  arguments.length > 0 && this.init(c);
32363
32375
  }
32364
- G.prototype.init = function(c) {
32376
+ K.prototype.init = function(c) {
32365
32377
  this.rhs = c;
32366
- }, W.prototype = new G(), W.prototype.constructor = W, W.superclass = G.prototype;
32378
+ }, W.prototype = new K(), W.prototype.constructor = W, W.superclass = K.prototype;
32367
32379
  function W(c) {
32368
32380
  arguments.length > 0 && this.init(c);
32369
32381
  }
@@ -32461,15 +32473,15 @@ var $6 = {}, ri = {}, Oo = {}, bl = {};
32461
32473
  return this.lhs.evaluate(c).greaterthanorequal(this.rhs.evaluate(c));
32462
32474
  }, L.prototype.toString = function() {
32463
32475
  return "(" + this.lhs.toString() + " >= " + this.rhs.toString() + ")";
32464
- }, K.prototype = new Z(), K.prototype.constructor = K, K.superclass = Z.prototype;
32465
- function K(c, f) {
32476
+ }, G.prototype = new Z(), G.prototype.constructor = G, G.superclass = Z.prototype;
32477
+ function G(c, f) {
32466
32478
  arguments.length > 0 && this.init(c, f);
32467
32479
  }
32468
- K.prototype.init = function(c, f) {
32469
- K.superclass.init.call(this, c, f);
32470
- }, K.prototype.evaluate = function(c) {
32480
+ G.prototype.init = function(c, f) {
32481
+ G.superclass.init.call(this, c, f);
32482
+ }, G.prototype.evaluate = function(c) {
32471
32483
  return this.lhs.evaluate(c).number().plus(this.rhs.evaluate(c).number());
32472
- }, K.prototype.toString = function() {
32484
+ }, G.prototype.toString = function() {
32473
32485
  return "(" + this.lhs.toString() + " + " + this.rhs.toString() + ")";
32474
32486
  }, pe.prototype = new Z(), pe.prototype.constructor = pe, pe.superclass = Z.prototype;
32475
32487
  function pe(c, f) {
@@ -33637,7 +33649,7 @@ var $6 = {}, ri = {}, Oo = {}, bl = {};
33637
33649
  throw new Wt(Wt.TYPE_ERR);
33638
33650
  return this.nodes[c];
33639
33651
  }, I.ANY_TYPE = 0, I.NUMBER_TYPE = 1, I.STRING_TYPE = 2, I.BOOLEAN_TYPE = 3, I.UNORDERED_NODE_ITERATOR_TYPE = 4, I.ORDERED_NODE_ITERATOR_TYPE = 5, I.UNORDERED_NODE_SNAPSHOT_TYPE = 6, I.ORDERED_NODE_SNAPSHOT_TYPE = 7, I.ANY_UNORDERED_NODE_TYPE = 8, I.FIRST_ORDERED_NODE_TYPE = 9;
33640
- function z(c, f) {
33652
+ function V(c, f) {
33641
33653
  c.createExpression = function(y, b) {
33642
33654
  try {
33643
33655
  return new Lt(y, b, f);
@@ -33660,10 +33672,10 @@ var $6 = {}, ri = {}, Oo = {}, bl = {};
33660
33672
  document.implementation && document.implementation.hasFeature && document.implementation.hasFeature("XPath", null) && (ne = !1);
33661
33673
  } catch {
33662
33674
  }
33663
- ne && z(document, new x());
33675
+ ne && V(document, new x());
33664
33676
  } catch {
33665
33677
  }
33666
- z(n, new x()), function() {
33678
+ V(n, new x()), function() {
33667
33679
  var c = new x(), f = new nn(), y = new Et(), b = new bn();
33668
33680
  function v(Q) {
33669
33681
  return {
@@ -33808,7 +33820,7 @@ var $6 = {}, ri = {}, Oo = {}, bl = {};
33808
33820
  GreaterThanOperation: N,
33809
33821
  LessThanOrEqualOperation: k,
33810
33822
  GreaterThanOrEqualOperation: L,
33811
- PlusOperation: K,
33823
+ PlusOperation: G,
33812
33824
  MinusOperation: pe,
33813
33825
  MultiplyOperation: se,
33814
33826
  DivOperation: $e,
@@ -33949,32 +33961,32 @@ Ae.assertIsDocumentFragmentNode = q6;
33949
33961
  return Array.isArray(M) && M.length > 0;
33950
33962
  }
33951
33963
  t.isArrayHasLength = r;
33952
- function i(M, G, W) {
33953
- return M.localName === G && (M.namespaceURI === W || W == null);
33964
+ function i(M, K, W) {
33965
+ return M.localName === K && (M.namespaceURI === W || W == null);
33954
33966
  }
33955
- function s(M, G, W, Z) {
33956
- return M.localName === G && (!M.namespaceURI && (Z == null ? void 0 : Z.namespaceURI) === W || W == null);
33967
+ function s(M, K, W, Z) {
33968
+ return M.localName === K && (!M.namespaceURI && (Z == null ? void 0 : Z.namespaceURI) === W || W == null);
33957
33969
  }
33958
- function a(M, G, W) {
33970
+ function a(M, K, W) {
33959
33971
  for (let Z = 0; Z < M.attributes.length; Z++) {
33960
33972
  const Y = M.attributes[Z];
33961
- if (i(Y, G, W) || s(Y, G, W, M))
33973
+ if (i(Y, K, W) || s(Y, K, W, M))
33962
33974
  return Y;
33963
33975
  }
33964
33976
  return null;
33965
33977
  }
33966
33978
  t.findAttr = a;
33967
- function l(M, G, W) {
33979
+ function l(M, K, W) {
33968
33980
  const Z = M.documentElement ?? M, Y = [];
33969
33981
  for (let Se = 0; Se < Z.childNodes.length; Se++) {
33970
33982
  const j = Z.childNodes[Se];
33971
- n.isElementNode(j) && j.localName === G && (j.namespaceURI === W || W == null) && Y.push(j);
33983
+ n.isElementNode(j) && j.localName === K && (j.namespaceURI === W || W == null) && Y.push(j);
33972
33984
  }
33973
33985
  return Y;
33974
33986
  }
33975
33987
  t.findChildren = l;
33976
- function u(M, G, W) {
33977
- return l(M, G, W);
33988
+ function u(M, K, W) {
33989
+ return l(M, K, W);
33978
33990
  }
33979
33991
  t.findChilds = u;
33980
33992
  const d = {
@@ -33991,13 +34003,13 @@ Ae.assertIsDocumentFragmentNode = q6;
33991
34003
  "\r": "&#xD;"
33992
34004
  };
33993
34005
  function h(M) {
33994
- return M.replace(/([&<"\r\n\t])/g, function(G, W) {
34006
+ return M.replace(/([&<"\r\n\t])/g, function(K, W) {
33995
34007
  return d[W];
33996
34008
  });
33997
34009
  }
33998
34010
  t.encodeSpecialCharactersInAttribute = h;
33999
34011
  function g(M) {
34000
- return M.replace(/([&<>\r])/g, function(G, W) {
34012
+ return M.replace(/([&<>\r])/g, function(K, W) {
34001
34013
  return p[W];
34002
34014
  });
34003
34015
  }
@@ -34015,53 +34027,53 @@ Ae.assertIsDocumentFragmentNode = q6;
34015
34027
  return Buffer.from(M.replace(/(\r\n|\r)/g, "").replace(/-----BEGIN [A-Z\x20]{1,48}-----\n?/, "").replace(/-----END [A-Z\x20]{1,48}-----\n?/, ""), "base64");
34016
34028
  }
34017
34029
  t.pemToDer = A;
34018
- function T(M, G) {
34030
+ function T(M, K) {
34019
34031
  const W = Buffer.isBuffer(M) ? M.toString("base64").trim() : M.replace(/(\r\n|\r)/g, "").trim();
34020
34032
  if (t.PEM_FORMAT_REGEX.test(W))
34021
34033
  return $(W);
34022
34034
  if (t.BASE64_REGEX.test(W.replace(/ /g, ""))) {
34023
- if (G == null)
34035
+ if (K == null)
34024
34036
  throw new Error("PEM label is required when DER is given.");
34025
- const Z = `-----BEGIN ${G}-----
34037
+ const Z = `-----BEGIN ${K}-----
34026
34038
  ${W.replace(/ /g, "")}
34027
- -----END ${G}-----`;
34039
+ -----END ${K}-----`;
34028
34040
  return $(Z);
34029
34041
  }
34030
34042
  throw new Error("Unknown DER format.");
34031
34043
  }
34032
34044
  t.derToPem = T;
34033
- function O(M, G = []) {
34045
+ function O(M, K = []) {
34034
34046
  if (!n.isElementNode(M.parentNode))
34035
- return G;
34047
+ return K;
34036
34048
  const W = M.parentNode;
34037
34049
  if (!W)
34038
- return G;
34050
+ return K;
34039
34051
  if (W.attributes && W.attributes.length > 0)
34040
34052
  for (let Z = 0; Z < W.attributes.length; Z++) {
34041
34053
  const Y = W.attributes[Z];
34042
- Y && Y.nodeName && Y.nodeName.search(/^xmlns:?/) !== -1 && G.push({
34054
+ Y && Y.nodeName && Y.nodeName.search(/^xmlns:?/) !== -1 && K.push({
34043
34055
  prefix: Y.nodeName.replace(/^xmlns:?/, ""),
34044
34056
  namespaceURI: Y.nodeValue || ""
34045
34057
  });
34046
34058
  }
34047
- return O(W, G);
34059
+ return O(W, K);
34048
34060
  }
34049
34061
  function D(M) {
34050
- const G = M.attributes;
34051
- for (let W = 0; W < G.length; W++) {
34052
- const Z = G[W].nodeName;
34062
+ const K = M.attributes;
34063
+ for (let W = 0; W < K.length; W++) {
34064
+ const Z = K[W].nodeName;
34053
34065
  if (Z.search(/^xmlns:?/) !== -1)
34054
34066
  return Z.replace(/^xmlns:?/, "");
34055
34067
  }
34056
34068
  return M.prefix || "";
34057
34069
  }
34058
34070
  function x(M) {
34059
- return M.every((G) => n.isElementNode(G));
34071
+ return M.every((K) => n.isElementNode(K));
34060
34072
  }
34061
- function q(M, G, W) {
34062
- if (G == null)
34073
+ function q(M, K, W) {
34074
+ if (K == null)
34063
34075
  return [];
34064
- const Z = e.selectWithResolver(G, M, W);
34076
+ const Z = e.selectWithResolver(K, M, W);
34065
34077
  if (!r(Z))
34066
34078
  return [];
34067
34079
  if (!x(Z))
@@ -34082,8 +34094,8 @@ ${W.replace(/ /g, "")}
34082
34094
  return j;
34083
34095
  }
34084
34096
  t.findAncestorNs = q;
34085
- function V(M, G) {
34086
- const W = Buffer.from(M, "base64"), Z = Buffer.from(G, "base64");
34097
+ function z(M, K) {
34098
+ const W = Buffer.from(M, "base64"), Z = Buffer.from(K, "base64");
34087
34099
  if (typeof W.equals == "function")
34088
34100
  return W.equals(Z);
34089
34101
  if (W.length !== Z.length)
@@ -34093,7 +34105,7 @@ ${W.replace(/ /g, "")}
34093
34105
  return !1;
34094
34106
  return !0;
34095
34107
  }
34096
- t.validateDigestValue = V;
34108
+ t.validateDigestValue = z;
34097
34109
  })(Oo);
34098
34110
  Object.defineProperty(ri, "__esModule", { value: !0 });
34099
34111
  ri.C14nCanonicalizationWithComments = ri.C14nCanonicalization = void 0;
@@ -35403,8 +35415,8 @@ function Si(t, e, n, r, i) {
35403
35415
  else if (q && q != ".")
35404
35416
  e.push(" SYSTEM ", q, ">");
35405
35417
  else {
35406
- var V = t.internalSubset;
35407
- V && e.push(" [", V, "]"), e.push(">");
35418
+ var z = t.internalSubset;
35419
+ z && e.push(" [", z, "]"), e.push(">");
35408
35420
  }
35409
35421
  return;
35410
35422
  case iy:
@@ -37665,24 +37677,24 @@ function sS(t, e, n, r, i) {
37665
37677
  function s(L) {
37666
37678
  if (L > 65535) {
37667
37679
  L -= 65536;
37668
- var K = 55296 + (L >> 10), pe = 56320 + (L & 1023);
37669
- return String.fromCharCode(K, pe);
37680
+ var G = 55296 + (L >> 10), pe = 56320 + (L & 1023);
37681
+ return String.fromCharCode(G, pe);
37670
37682
  } else
37671
37683
  return String.fromCharCode(L);
37672
37684
  }
37673
37685
  function a(L) {
37674
- var K = L.slice(1, -1);
37675
- return Object.hasOwnProperty.call(n, K) ? n[K] : K.charAt(0) === "#" ? s(parseInt(K.substr(1).replace("x", "0x"))) : (i.error("entity not found:" + L), L);
37686
+ var G = L.slice(1, -1);
37687
+ return Object.hasOwnProperty.call(n, G) ? n[G] : G.charAt(0) === "#" ? s(parseInt(G.substr(1).replace("x", "0x"))) : (i.error("entity not found:" + L), L);
37676
37688
  }
37677
37689
  function l(L) {
37678
37690
  if (L > T) {
37679
- var K = t.substring(T, L).replace(/&#?\w+;/g, a);
37680
- g && u(T), r.characters(K, 0, L - T), T = L;
37691
+ var G = t.substring(T, L).replace(/&#?\w+;/g, a);
37692
+ g && u(T), r.characters(G, 0, L - T), T = L;
37681
37693
  }
37682
37694
  }
37683
- function u(L, K) {
37684
- for (; L >= p && (K = h.exec(t)); )
37685
- d = K.index, p = d + K[0].length, g.lineNumber++;
37695
+ function u(L, G) {
37696
+ for (; L >= p && (G = h.exec(t)); )
37697
+ d = G.index, p = d + G[0].length, g.lineNumber++;
37686
37698
  g.columnNumber = L - d + 1;
37687
37699
  }
37688
37700
  for (var d = 0, p = 0, h = /.*(?:\r\n?|\n)|.*$/g, g = r.locator, $ = [{ currentNSMap: e }], A = {}, T = 0; ; ) {
@@ -37697,16 +37709,16 @@ function sS(t, e, n, r, i) {
37697
37709
  }
37698
37710
  switch (O > T && l(O), t.charAt(O + 1)) {
37699
37711
  case "/":
37700
- var j = t.indexOf(">", O + 3), q = t.substring(O + 2, j).replace(/[ \t\n\r]+$/g, ""), V = $.pop();
37701
- j < 0 ? (q = t.substring(O + 2).replace(/[\s<].*/, ""), i.error("end tag name: " + q + " is not complete:" + V.tagName), j = O + 1 + q.length) : q.match(/\s</) && (q = q.replace(/[\s<].*/, ""), i.error("end tag name: " + q + " maybe not complete"), j = O + 1 + q.length);
37702
- var M = V.localNSMap, G = V.tagName == q, W = G || V.tagName && V.tagName.toLowerCase() == q.toLowerCase();
37712
+ var j = t.indexOf(">", O + 3), q = t.substring(O + 2, j).replace(/[ \t\n\r]+$/g, ""), z = $.pop();
37713
+ j < 0 ? (q = t.substring(O + 2).replace(/[\s<].*/, ""), i.error("end tag name: " + q + " is not complete:" + z.tagName), j = O + 1 + q.length) : q.match(/\s</) && (q = q.replace(/[\s<].*/, ""), i.error("end tag name: " + q + " maybe not complete"), j = O + 1 + q.length);
37714
+ var M = z.localNSMap, K = z.tagName == q, W = K || z.tagName && z.tagName.toLowerCase() == q.toLowerCase();
37703
37715
  if (W) {
37704
- if (r.endElement(V.uri, V.localName, q), M)
37716
+ if (r.endElement(z.uri, z.localName, q), M)
37705
37717
  for (var Z in M)
37706
37718
  Object.prototype.hasOwnProperty.call(M, Z) && r.endPrefixMapping(Z);
37707
- G || i.fatalError("end tag name: " + q + " is not match the current start tagName:" + V.tagName);
37719
+ K || i.fatalError("end tag name: " + q + " is not match the current start tagName:" + z.tagName);
37708
37720
  } else
37709
- $.push(V);
37721
+ $.push(z);
37710
37722
  j++;
37711
37723
  break;
37712
37724
  case "?":
@@ -38624,34 +38636,34 @@ class Vn {
38624
38636
  let u;
38625
38637
  const d = ["append", "prepend", "before", "after"], p = n.prefix, h = n.attrs || {}, g = n.location || {}, $ = n.existingPrefixes || {};
38626
38638
  if (this.namespaceResolver = {
38627
- lookupNamespaceURI: function(G) {
38628
- return G ? $[G] : null;
38639
+ lookupNamespaceURI: function(K) {
38640
+ return K ? $[K] : null;
38629
38641
  }
38630
38642
  }, g.reference = g.reference || "/*", g.action = g.action || "append", d.indexOf(g.action) === -1) {
38631
- const G = new Error(`location.action option has an invalid action: ${g.action}, must be any of the following values: ${d.join(", ")}`);
38643
+ const K = new Error(`location.action option has an invalid action: ${g.action}, must be any of the following values: ${d.join(", ")}`);
38632
38644
  if (i) {
38633
- i(G);
38645
+ i(K);
38634
38646
  return;
38635
38647
  } else
38636
- throw G;
38648
+ throw K;
38637
38649
  }
38638
- p ? (a += `:${p}`, u = `${p}:`) : u = "", Object.keys(h).forEach(function(G) {
38639
- G !== "xmlns" && G !== a && l.push(`${G}="${h[G]}"`);
38650
+ p ? (a += `:${p}`, u = `${p}:`) : u = "", Object.keys(h).forEach(function(K) {
38651
+ K !== "xmlns" && K !== a && l.push(`${K}="${h[K]}"`);
38640
38652
  }), l.push(`${a}="http://www.w3.org/2000/09/xmldsig#"`);
38641
38653
  let A = `<${u}Signature ${l.join(" ")}>`;
38642
38654
  A += this.createSignedInfo(s, p), A += this.getKeyInfo(p), A += `</${u}Signature>`, this.originalXmlWithIds = s.toString();
38643
38655
  let T = "";
38644
- Object.keys($).forEach(function(G) {
38645
- T += `xmlns:${G}="${$[G]}" `;
38656
+ Object.keys($).forEach(function(K) {
38657
+ T += `xmlns:${K}="${$[K]}" `;
38646
38658
  });
38647
38659
  const O = `<Dummy ${T}>${A}</Dummy>`, x = new Ir.DOMParser().parseFromString(O).documentElement.firstChild, q = Xt.select1(g.reference, s);
38648
38660
  if (!Ft.isNodeLike(q)) {
38649
- const G = new Error(`the following xpath cannot be used because it was not found: ${g.reference}`);
38661
+ const K = new Error(`the following xpath cannot be used because it was not found: ${g.reference}`);
38650
38662
  if (i) {
38651
- i(G);
38663
+ i(K);
38652
38664
  return;
38653
38665
  } else
38654
- throw G;
38666
+ throw K;
38655
38667
  }
38656
38668
  if (g.action === "append")
38657
38669
  q.appendChild(x);
@@ -38667,18 +38679,18 @@ class Vn {
38667
38679
  q.parentNode.insertBefore(x, q.nextSibling);
38668
38680
  }
38669
38681
  this.signatureNode = x;
38670
- const V = Re.findChildren(this.signatureNode, "SignedInfo");
38671
- if (V.length === 0) {
38672
- const G = new Error("could not find SignedInfo element in the message");
38682
+ const z = Re.findChildren(this.signatureNode, "SignedInfo");
38683
+ if (z.length === 0) {
38684
+ const K = new Error("could not find SignedInfo element in the message");
38673
38685
  if (i) {
38674
- i(G);
38686
+ i(K);
38675
38687
  return;
38676
38688
  } else
38677
- throw G;
38689
+ throw K;
38678
38690
  }
38679
- const M = V[0];
38680
- typeof i == "function" ? this.calculateSignatureValue(s, (G, W) => {
38681
- G ? i(G) : (this.signatureValue = W || "", x.insertBefore(this.createSignature(p), M.nextSibling), this.signatureXml = x.toString(), this.signedXml = s.toString(), i(null, this));
38691
+ const M = z[0];
38692
+ typeof i == "function" ? this.calculateSignatureValue(s, (K, W) => {
38693
+ K ? i(K) : (this.signatureValue = W || "", x.insertBefore(this.createSignature(p), M.nextSibling), this.signatureXml = x.toString(), this.signedXml = s.toString(), i(null, this));
38682
38694
  }) : (this.calculateSignatureValue(s), x.insertBefore(this.createSignature(p), M.nextSibling), this.signatureXml = x.toString(), this.signedXml = s.toString());
38683
38695
  }
38684
38696
  getKeyInfo(e) {