@seams/wallet 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/LICENSE.md +201 -0
  2. package/THIRD_PARTY_NOTICES.md +15095 -0
  3. package/dist/.build-inputs.sha256 +1 -1
  4. package/dist/esm/SeamsWeb/signingSurface/BrowserSigningSurface.js +7 -14
  5. package/dist/esm/core/signingEngine/session/identity/exactWalletSessionReader.js +2 -27
  6. package/dist/esm/react/SeamsWeb/signingSurface/BrowserSigningSurface.js +7 -14
  7. package/dist/esm/react/core/signingEngine/session/identity/exactWalletSessionReader.js +2 -27
  8. package/dist/esm/sdk/export-private-key-viewer.js +1420 -1425
  9. package/dist/esm/sdk/halo-border.js +1424 -1429
  10. package/dist/esm/sdk/{host-BqwEYhX0.js → host-DNmO0eve.js} +2 -2
  11. package/dist/esm/sdk/passkey-halo-loading.js +1426 -1431
  12. package/dist/{public/sdk/registrationPreparationPreload-u3ruCmpF.js → esm/sdk/registrationPreparationPreload-CwUkRwVz.js} +1 -1
  13. package/dist/esm/sdk/router_ab_ed25519_yao_client_bg.wasm +0 -0
  14. package/dist/{public/sdk/runtime-auth-Da9yQyaD.js → esm/sdk/runtime-auth-dpoaCtkK.js} +2 -2
  15. package/dist/esm/sdk/{runtime-device-link-DNlzlwrr.js → runtime-device-link-C75epnbj.js} +1 -1
  16. package/dist/{public/sdk/runtime-ecdsa-tempo-B7dBVcCI.js → esm/sdk/runtime-ecdsa-tempo-CV-E-iZG.js} +1 -1
  17. package/dist/{public/sdk/runtime-email-otp-CckVQZJC.js → esm/sdk/runtime-email-otp-V0mdMD_t.js} +1 -1
  18. package/dist/{public/sdk/runtime-export-WAiBwZL_.js → esm/sdk/runtime-export-C4HO5ysH.js} +1 -1
  19. package/dist/esm/sdk/{runtime-near-DBJ4KfFv.js → runtime-near-DlviFQWy.js} +1 -1
  20. package/dist/{public/sdk/runtime-preferences-DmH7eMHH.js → esm/sdk/runtime-preferences-DyJidFuf.js} +1 -1
  21. package/dist/esm/sdk/{runtime-recovery-kPgl9nTT.js → runtime-recovery-CHDE5gl0.js} +1 -1
  22. package/dist/esm/sdk/{runtimeContext-BorCgXo5.js → runtimeContext-D_TkUM6Z.js} +6 -38
  23. package/dist/esm/sdk/{runtimeLoader-BKQjNgXO.js → runtimeLoader-DxiLgXPm.js} +9 -9
  24. package/dist/esm/sdk/tx-confirm-ui.js +1400 -1407
  25. package/dist/esm/sdk/w3a-tx-confirmer.js +1442 -1447
  26. package/dist/esm/sdk/wallet-iframe-host-ecdsa.js +1 -1
  27. package/dist/esm/sdk/wallet-iframe-host-full.js +1 -1
  28. package/dist/esm/sdk/wallet-iframe-host-near.js +1 -1
  29. package/dist/esm/sdk/wallet-iframe-host-runtime.js +1 -1
  30. package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker.js +4 -4
  31. package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker_bg.wasm +0 -0
  32. package/dist/esm/wasm/router_ab_ecdsa_client/pkg/router_ab_ecdsa_client_bg.wasm +0 -0
  33. package/dist/esm/wasm/router_ab_ed25519_yao_client/pkg/router_ab_ed25519_yao_client_bg.wasm +0 -0
  34. package/dist/public/headers.manifest.json +1 -1
  35. package/dist/public/sdk/export-private-key-viewer.js +1420 -1425
  36. package/dist/public/sdk/halo-border.js +1424 -1429
  37. package/dist/public/sdk/{host-BqwEYhX0.js → host-DNmO0eve.js} +2 -2
  38. package/dist/public/sdk/passkey-halo-loading.js +1426 -1431
  39. package/dist/{esm/sdk/registrationPreparationPreload-u3ruCmpF.js → public/sdk/registrationPreparationPreload-CwUkRwVz.js} +1 -1
  40. package/dist/public/sdk/router_ab_ed25519_yao_client_bg.wasm +0 -0
  41. package/dist/{esm/sdk/runtime-auth-Da9yQyaD.js → public/sdk/runtime-auth-dpoaCtkK.js} +2 -2
  42. package/dist/public/sdk/{runtime-device-link-DNlzlwrr.js → runtime-device-link-C75epnbj.js} +1 -1
  43. package/dist/{esm/sdk/runtime-ecdsa-tempo-B7dBVcCI.js → public/sdk/runtime-ecdsa-tempo-CV-E-iZG.js} +1 -1
  44. package/dist/{esm/sdk/runtime-email-otp-CckVQZJC.js → public/sdk/runtime-email-otp-V0mdMD_t.js} +1 -1
  45. package/dist/{esm/sdk/runtime-export-WAiBwZL_.js → public/sdk/runtime-export-C4HO5ysH.js} +1 -1
  46. package/dist/public/sdk/{runtime-near-DBJ4KfFv.js → runtime-near-DlviFQWy.js} +1 -1
  47. package/dist/{esm/sdk/runtime-preferences-DmH7eMHH.js → public/sdk/runtime-preferences-DyJidFuf.js} +1 -1
  48. package/dist/public/sdk/{runtime-recovery-kPgl9nTT.js → runtime-recovery-CHDE5gl0.js} +1 -1
  49. package/dist/public/sdk/{runtimeContext-BorCgXo5.js → runtimeContext-D_TkUM6Z.js} +6 -38
  50. package/dist/public/sdk/{runtimeLoader-BKQjNgXO.js → runtimeLoader-DxiLgXPm.js} +9 -9
  51. package/dist/public/sdk/tx-confirm-ui.js +1400 -1407
  52. package/dist/public/sdk/w3a-tx-confirmer.js +1442 -1447
  53. package/dist/public/sdk/wallet-iframe-host-ecdsa.js +1 -1
  54. package/dist/public/sdk/wallet-iframe-host-full.js +1 -1
  55. package/dist/public/sdk/wallet-iframe-host-near.js +1 -1
  56. package/dist/public/sdk/wallet-iframe-host-runtime.js +1 -1
  57. package/dist/public/sdk/workers/device-linking-key.worker.js +133 -140
  58. package/dist/public/sdk/workers/ecdsa-derivation-client.worker.js +94 -188
  59. package/dist/public/sdk/workers/ecdsa-online-client.worker.js +6 -7
  60. package/dist/public/sdk/workers/ecdsa-presign-client.worker.js +6 -7
  61. package/dist/public/sdk/workers/email-otp.worker.js +39 -52
  62. package/dist/public/sdk/workers/email_otp_runtime_bg.wasm +0 -0
  63. package/dist/public/sdk/workers/evm-crypto.worker.js +3 -3
  64. package/dist/public/sdk/workers/evm_crypto.wasm +0 -0
  65. package/dist/public/sdk/workers/evm_crypto_bg.wasm +0 -0
  66. package/dist/public/sdk/workers/near-signer.worker.js +9 -9
  67. package/dist/public/sdk/workers/near_signer.wasm +0 -0
  68. package/dist/public/sdk/workers/passkey-confirm.worker.js +4 -4
  69. package/dist/public/sdk/workers/passkey-mpc-export.worker.js +9 -19
  70. package/dist/public/sdk/workers/router_ab_ecdsa_client_bg.wasm +0 -0
  71. package/dist/public/sdk/workers/router_ab_ed25519_yao_client_bg.wasm +0 -0
  72. package/dist/public/sdk/workers/shamir3pass.worker.js +3 -3
  73. package/dist/public/sdk/workers/shamir3pass_runtime_bg.wasm +0 -0
  74. package/dist/public/sdk/workers/tempo-signer.worker.js +3 -3
  75. package/dist/public/sdk/workers/tempo_signer.wasm +0 -0
  76. package/dist/public/sdk/workers/tempo_signer_bg.wasm +0 -0
  77. package/dist/public/sdk/workers/wallet-custody-ceremony.worker.js +55 -1244
  78. package/dist/public/sdk/workers/wallet_custody_ceremony_bg.wasm +0 -0
  79. package/dist/public/sdk/workers/wasm_signer_worker_bg.wasm +0 -0
  80. package/dist/public/wallet-assets.manifest.json +32 -32
  81. package/dist/types/wallet/src/SeamsWeb/signingSurface/BrowserSigningSurface.d.ts +4 -4
  82. package/dist/types/wallet/src/core/signingEngine/session/identity/exactWalletSessionReader.d.ts +1 -9
  83. package/dist/workers/device-linking-key.worker.js +133 -140
  84. package/dist/workers/ecdsa-derivation-client.worker.js +94 -188
  85. package/dist/workers/ecdsa-online-client.worker.js +6 -7
  86. package/dist/workers/ecdsa-presign-client.worker.js +6 -7
  87. package/dist/workers/email-otp.worker.js +39 -52
  88. package/dist/workers/email_otp_runtime_bg.wasm +0 -0
  89. package/dist/workers/evm-crypto.worker.js +3 -3
  90. package/dist/workers/evm_crypto.wasm +0 -0
  91. package/dist/workers/evm_crypto_bg.wasm +0 -0
  92. package/dist/workers/near-signer.worker.js +9 -9
  93. package/dist/workers/near_signer.wasm +0 -0
  94. package/dist/workers/passkey-confirm.worker.js +4 -4
  95. package/dist/workers/passkey-mpc-export.worker.js +9 -19
  96. package/dist/workers/router_ab_ecdsa_client_bg.wasm +0 -0
  97. package/dist/workers/router_ab_ed25519_yao_client_bg.wasm +0 -0
  98. package/dist/workers/shamir3pass.worker.js +3 -3
  99. package/dist/workers/shamir3pass_runtime_bg.wasm +0 -0
  100. package/dist/workers/tempo-signer.worker.js +3 -3
  101. package/dist/workers/tempo_signer.wasm +0 -0
  102. package/dist/workers/tempo_signer_bg.wasm +0 -0
  103. package/dist/workers/wallet-custody-ceremony.worker.js +55 -1244
  104. package/dist/workers/wallet_custody_ceremony_bg.wasm +0 -0
  105. package/dist/workers/wasm_signer_worker_bg.wasm +0 -0
  106. package/package.json +6 -3
  107. package/LICENSE +0 -21
@@ -1,14 +1,28 @@
1
1
  var __defProp = Object.defineProperty;
2
+ var __returnValue = (v) => v;
3
+ function __exportSetter(name, newValue) {
4
+ this[name] = __returnValue.bind(null, newValue);
5
+ }
2
6
  var __export = (target, all) => {
3
7
  for (var name in all)
4
8
  __defProp(target, name, {
5
9
  get: all[name],
6
10
  enumerable: true,
7
11
  configurable: true,
8
- set: (newValue) => all[name] = () => newValue
12
+ set: __exportSetter.bind(all, name)
9
13
  });
10
14
  };
11
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
15
+ var __esm = (fn, res, err) => () => {
16
+ if (fn)
17
+ try {
18
+ res = fn(fn = 0);
19
+ } catch (e) {
20
+ err = [e];
21
+ }
22
+ if (err)
23
+ throw err[0];
24
+ return res;
25
+ };
12
26
 
13
27
  // src/core/browser/walletIframe/events.ts
14
28
  var WalletIframeDomEvents;
@@ -342,31 +356,31 @@ var init_actions2 = __esm(() => {
342
356
 
343
357
  // ../../node_modules/@lit/reactive-element/css-tag.js
344
358
  class n {
345
- constructor(t2, e2, o2) {
346
- if (this._$cssResult$ = true, o2 !== s)
359
+ constructor(t, e, o) {
360
+ if (this._$cssResult$ = true, o !== s)
347
361
  throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
348
- this.cssText = t2, this.t = e2;
362
+ this.cssText = t, this.t = e;
349
363
  }
350
364
  get styleSheet() {
351
- let t2 = this.o;
352
- const s2 = this.t;
353
- if (e && t2 === undefined) {
354
- const e2 = s2 !== undefined && s2.length === 1;
355
- e2 && (t2 = o.get(s2)), t2 === undefined && ((this.o = t2 = new CSSStyleSheet).replaceSync(this.cssText), e2 && o.set(s2, t2));
365
+ let t = this.o;
366
+ const s = this.t;
367
+ if (e && t === undefined) {
368
+ const e = s !== undefined && s.length === 1;
369
+ e && (t = o.get(s)), t === undefined && ((this.o = t = new CSSStyleSheet).replaceSync(this.cssText), e && o.set(s, t));
356
370
  }
357
- return t2;
371
+ return t;
358
372
  }
359
373
  toString() {
360
374
  return this.cssText;
361
375
  }
362
376
  }
363
- var t, e, s, o, r = (t2) => new n(typeof t2 == "string" ? t2 : t2 + "", undefined, s), S = (s2, o2) => {
377
+ var t, e, s, o, r = (t) => new n(typeof t == "string" ? t : t + "", undefined, s), S = (s, o) => {
364
378
  if (e)
365
- s2.adoptedStyleSheets = o2.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet);
379
+ s.adoptedStyleSheets = o.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
366
380
  else
367
- for (const e2 of o2) {
368
- const o3 = document.createElement("style"), n2 = t.litNonce;
369
- n2 !== undefined && o3.setAttribute("nonce", n2), o3.textContent = e2.cssText, s2.appendChild(o3);
381
+ for (const e of o) {
382
+ const o = document.createElement("style"), n = t.litNonce;
383
+ n !== undefined && o.setAttribute("nonce", n), o.textContent = e.cssText, s.appendChild(o);
370
384
  }
371
385
  }, c;
372
386
  var init_css_tag = __esm(() => {
@@ -374,16 +388,16 @@ var init_css_tag = __esm(() => {
374
388
  e = t.ShadowRoot && (t.ShadyCSS === undefined || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype;
375
389
  s = Symbol();
376
390
  o = new WeakMap;
377
- c = e ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => {
378
- let e2 = "";
379
- for (const s2 of t3.cssRules)
380
- e2 += s2.cssText;
381
- return r(e2);
382
- })(t2) : t2;
391
+ c = e ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((t) => {
392
+ let e = "";
393
+ for (const s of t.cssRules)
394
+ e += s.cssText;
395
+ return r(e);
396
+ })(t) : t;
383
397
  });
384
398
 
385
399
  // ../../node_modules/@lit/reactive-element/reactive-element.js
386
- var i2, e2, h, r2, o2, n2, a, c2, l, p, d = (t2, s2) => t2, u, f = (t2, s2) => !i2(t2, s2), b, y;
400
+ var i2, e2, h, r2, o2, n2, a, c2, l, p, d = (t, s) => t, u, f = (t, s) => !i2(t, s), b, y;
387
401
  var init_reactive_element = __esm(() => {
388
402
  init_css_tag();
389
403
  init_css_tag();
@@ -392,175 +406,175 @@ var init_reactive_element = __esm(() => {
392
406
  c2 = a.trustedTypes;
393
407
  l = c2 ? c2.emptyScript : "";
394
408
  p = a.reactiveElementPolyfillSupport;
395
- u = { toAttribute(t2, s2) {
396
- switch (s2) {
409
+ u = { toAttribute(t, s) {
410
+ switch (s) {
397
411
  case Boolean:
398
- t2 = t2 ? l : null;
412
+ t = t ? l : null;
399
413
  break;
400
414
  case Object:
401
415
  case Array:
402
- t2 = t2 == null ? t2 : JSON.stringify(t2);
416
+ t = t == null ? t : JSON.stringify(t);
403
417
  }
404
- return t2;
405
- }, fromAttribute(t2, s2) {
406
- let i3 = t2;
407
- switch (s2) {
418
+ return t;
419
+ }, fromAttribute(t, s) {
420
+ let i = t;
421
+ switch (s) {
408
422
  case Boolean:
409
- i3 = t2 !== null;
423
+ i = t !== null;
410
424
  break;
411
425
  case Number:
412
- i3 = t2 === null ? null : Number(t2);
426
+ i = t === null ? null : Number(t);
413
427
  break;
414
428
  case Object:
415
429
  case Array:
416
430
  try {
417
- i3 = JSON.parse(t2);
418
- } catch (t3) {
419
- i3 = null;
431
+ i = JSON.parse(t);
432
+ } catch (t) {
433
+ i = null;
420
434
  }
421
435
  }
422
- return i3;
436
+ return i;
423
437
  } };
424
438
  b = { attribute: true, type: String, converter: u, reflect: false, useDefault: false, hasChanged: f };
425
439
  Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= new WeakMap;
426
440
  y = class y extends HTMLElement {
427
- static addInitializer(t2) {
428
- this._$Ei(), (this.l ??= []).push(t2);
441
+ static addInitializer(t) {
442
+ this._$Ei(), (this.l ??= []).push(t);
429
443
  }
430
444
  static get observedAttributes() {
431
445
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
432
446
  }
433
- static createProperty(t2, s2 = b) {
434
- if (s2.state && (s2.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t2) && ((s2 = Object.create(s2)).wrapped = true), this.elementProperties.set(t2, s2), !s2.noAccessor) {
435
- const i3 = Symbol(), h2 = this.getPropertyDescriptor(t2, i3, s2);
436
- h2 !== undefined && e2(this.prototype, t2, h2);
447
+ static createProperty(t, s = b) {
448
+ if (s.state && (s.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t) && ((s = Object.create(s)).wrapped = true), this.elementProperties.set(t, s), !s.noAccessor) {
449
+ const i = Symbol(), h = this.getPropertyDescriptor(t, i, s);
450
+ h !== undefined && e2(this.prototype, t, h);
437
451
  }
438
452
  }
439
- static getPropertyDescriptor(t2, s2, i3) {
440
- const { get: e3, set: r3 } = h(this.prototype, t2) ?? { get() {
441
- return this[s2];
442
- }, set(t3) {
443
- this[s2] = t3;
453
+ static getPropertyDescriptor(t, s, i) {
454
+ const { get: e, set: r } = h(this.prototype, t) ?? { get() {
455
+ return this[s];
456
+ }, set(t) {
457
+ this[s] = t;
444
458
  } };
445
- return { get: e3, set(s3) {
446
- const h2 = e3?.call(this);
447
- r3?.call(this, s3), this.requestUpdate(t2, h2, i3);
459
+ return { get: e, set(s) {
460
+ const h = e?.call(this);
461
+ r?.call(this, s), this.requestUpdate(t, h, i);
448
462
  }, configurable: true, enumerable: true };
449
463
  }
450
- static getPropertyOptions(t2) {
451
- return this.elementProperties.get(t2) ?? b;
464
+ static getPropertyOptions(t) {
465
+ return this.elementProperties.get(t) ?? b;
452
466
  }
453
467
  static _$Ei() {
454
468
  if (this.hasOwnProperty(d("elementProperties")))
455
469
  return;
456
- const t2 = n2(this);
457
- t2.finalize(), t2.l !== undefined && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties);
470
+ const t = n2(this);
471
+ t.finalize(), t.l !== undefined && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
458
472
  }
459
473
  static finalize() {
460
474
  if (this.hasOwnProperty(d("finalized")))
461
475
  return;
462
476
  if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) {
463
- const t3 = this.properties, s2 = [...r2(t3), ...o2(t3)];
464
- for (const i3 of s2)
465
- this.createProperty(i3, t3[i3]);
477
+ const t = this.properties, s = [...r2(t), ...o2(t)];
478
+ for (const i of s)
479
+ this.createProperty(i, t[i]);
466
480
  }
467
- const t2 = this[Symbol.metadata];
468
- if (t2 !== null) {
469
- const s2 = litPropertyMetadata.get(t2);
470
- if (s2 !== undefined)
471
- for (const [t3, i3] of s2)
472
- this.elementProperties.set(t3, i3);
481
+ const t = this[Symbol.metadata];
482
+ if (t !== null) {
483
+ const s = litPropertyMetadata.get(t);
484
+ if (s !== undefined)
485
+ for (const [t, i] of s)
486
+ this.elementProperties.set(t, i);
473
487
  }
474
488
  this._$Eh = new Map;
475
- for (const [t3, s2] of this.elementProperties) {
476
- const i3 = this._$Eu(t3, s2);
477
- i3 !== undefined && this._$Eh.set(i3, t3);
489
+ for (const [t, s] of this.elementProperties) {
490
+ const i = this._$Eu(t, s);
491
+ i !== undefined && this._$Eh.set(i, t);
478
492
  }
479
493
  this.elementStyles = this.finalizeStyles(this.styles);
480
494
  }
481
- static finalizeStyles(s2) {
482
- const i3 = [];
483
- if (Array.isArray(s2)) {
484
- const e3 = new Set(s2.flat(1 / 0).reverse());
485
- for (const s3 of e3)
486
- i3.unshift(c(s3));
495
+ static finalizeStyles(s) {
496
+ const i = [];
497
+ if (Array.isArray(s)) {
498
+ const e = new Set(s.flat(1 / 0).reverse());
499
+ for (const s of e)
500
+ i.unshift(c(s));
487
501
  } else
488
- s2 !== undefined && i3.push(c(s2));
489
- return i3;
502
+ s !== undefined && i.push(c(s));
503
+ return i;
490
504
  }
491
- static _$Eu(t2, s2) {
492
- const i3 = s2.attribute;
493
- return i3 === false ? undefined : typeof i3 == "string" ? i3 : typeof t2 == "string" ? t2.toLowerCase() : undefined;
505
+ static _$Eu(t, s) {
506
+ const i = s.attribute;
507
+ return i === false ? undefined : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : undefined;
494
508
  }
495
509
  constructor() {
496
510
  super(), this._$Ep = undefined, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
497
511
  }
498
512
  _$Ev() {
499
- this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = new Map, this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this));
513
+ this._$ES = new Promise((t) => this.enableUpdating = t), this._$AL = new Map, this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t) => t(this));
500
514
  }
501
- addController(t2) {
502
- (this._$EO ??= new Set).add(t2), this.renderRoot !== undefined && this.isConnected && t2.hostConnected?.();
515
+ addController(t) {
516
+ (this._$EO ??= new Set).add(t), this.renderRoot !== undefined && this.isConnected && t.hostConnected?.();
503
517
  }
504
- removeController(t2) {
505
- this._$EO?.delete(t2);
518
+ removeController(t) {
519
+ this._$EO?.delete(t);
506
520
  }
507
521
  _$E_() {
508
- const t2 = new Map, s2 = this.constructor.elementProperties;
509
- for (const i3 of s2.keys())
510
- this.hasOwnProperty(i3) && (t2.set(i3, this[i3]), delete this[i3]);
511
- t2.size > 0 && (this._$Ep = t2);
522
+ const t = new Map, s = this.constructor.elementProperties;
523
+ for (const i of s.keys())
524
+ this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
525
+ t.size > 0 && (this._$Ep = t);
512
526
  }
513
527
  createRenderRoot() {
514
- const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
515
- return S(t2, this.constructor.elementStyles), t2;
528
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
529
+ return S(t, this.constructor.elementStyles), t;
516
530
  }
517
531
  connectedCallback() {
518
- this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.());
532
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t) => t.hostConnected?.());
519
533
  }
520
- enableUpdating(t2) {}
534
+ enableUpdating(t) {}
521
535
  disconnectedCallback() {
522
- this._$EO?.forEach((t2) => t2.hostDisconnected?.());
536
+ this._$EO?.forEach((t) => t.hostDisconnected?.());
523
537
  }
524
- attributeChangedCallback(t2, s2, i3) {
525
- this._$AK(t2, i3);
538
+ attributeChangedCallback(t, s, i) {
539
+ this._$AK(t, i);
526
540
  }
527
- _$ET(t2, s2) {
528
- const i3 = this.constructor.elementProperties.get(t2), e3 = this.constructor._$Eu(t2, i3);
529
- if (e3 !== undefined && i3.reflect === true) {
530
- const h2 = (i3.converter?.toAttribute !== undefined ? i3.converter : u).toAttribute(s2, i3.type);
531
- this._$Em = t2, h2 == null ? this.removeAttribute(e3) : this.setAttribute(e3, h2), this._$Em = null;
541
+ _$ET(t, s) {
542
+ const i = this.constructor.elementProperties.get(t), e = this.constructor._$Eu(t, i);
543
+ if (e !== undefined && i.reflect === true) {
544
+ const h = (i.converter?.toAttribute !== undefined ? i.converter : u).toAttribute(s, i.type);
545
+ this._$Em = t, h == null ? this.removeAttribute(e) : this.setAttribute(e, h), this._$Em = null;
532
546
  }
533
547
  }
534
- _$AK(t2, s2) {
535
- const i3 = this.constructor, e3 = i3._$Eh.get(t2);
536
- if (e3 !== undefined && this._$Em !== e3) {
537
- const t3 = i3.getPropertyOptions(e3), h2 = typeof t3.converter == "function" ? { fromAttribute: t3.converter } : t3.converter?.fromAttribute !== undefined ? t3.converter : u;
538
- this._$Em = e3;
539
- const r3 = h2.fromAttribute(s2, t3.type);
540
- this[e3] = r3 ?? this._$Ej?.get(e3) ?? r3, this._$Em = null;
548
+ _$AK(t, s) {
549
+ const i = this.constructor, e = i._$Eh.get(t);
550
+ if (e !== undefined && this._$Em !== e) {
551
+ const t = i.getPropertyOptions(e), h = typeof t.converter == "function" ? { fromAttribute: t.converter } : t.converter?.fromAttribute !== undefined ? t.converter : u;
552
+ this._$Em = e;
553
+ const r = h.fromAttribute(s, t.type);
554
+ this[e] = r ?? this._$Ej?.get(e) ?? r, this._$Em = null;
541
555
  }
542
556
  }
543
- requestUpdate(t2, s2, i3) {
544
- if (t2 !== undefined) {
545
- const e3 = this.constructor, h2 = this[t2];
546
- if (i3 ??= e3.getPropertyOptions(t2), !((i3.hasChanged ?? f)(h2, s2) || i3.useDefault && i3.reflect && h2 === this._$Ej?.get(t2) && !this.hasAttribute(e3._$Eu(t2, i3))))
557
+ requestUpdate(t, s, i) {
558
+ if (t !== undefined) {
559
+ const e = this.constructor, h = this[t];
560
+ if (i ??= e.getPropertyOptions(t), !((i.hasChanged ?? f)(h, s) || i.useDefault && i.reflect && h === this._$Ej?.get(t) && !this.hasAttribute(e._$Eu(t, i))))
547
561
  return;
548
- this.C(t2, s2, i3);
562
+ this.C(t, s, i);
549
563
  }
550
564
  this.isUpdatePending === false && (this._$ES = this._$EP());
551
565
  }
552
- C(t2, s2, { useDefault: i3, reflect: e3, wrapped: h2 }, r3) {
553
- i3 && !(this._$Ej ??= new Map).has(t2) && (this._$Ej.set(t2, r3 ?? s2 ?? this[t2]), h2 !== true || r3 !== undefined) || (this._$AL.has(t2) || (this.hasUpdated || i3 || (s2 = undefined), this._$AL.set(t2, s2)), e3 === true && this._$Em !== t2 && (this._$Eq ??= new Set).add(t2));
566
+ C(t, s, { useDefault: i, reflect: e, wrapped: h }, r) {
567
+ i && !(this._$Ej ??= new Map).has(t) && (this._$Ej.set(t, r ?? s ?? this[t]), h !== true || r !== undefined) || (this._$AL.has(t) || (this.hasUpdated || i || (s = undefined), this._$AL.set(t, s)), e === true && this._$Em !== t && (this._$Eq ??= new Set).add(t));
554
568
  }
555
569
  async _$EP() {
556
570
  this.isUpdatePending = true;
557
571
  try {
558
572
  await this._$ES;
559
- } catch (t3) {
560
- Promise.reject(t3);
573
+ } catch (t) {
574
+ Promise.reject(t);
561
575
  }
562
- const t2 = this.scheduleUpdate();
563
- return t2 != null && await t2, !this.isUpdatePending;
576
+ const t = this.scheduleUpdate();
577
+ return t != null && await t, !this.isUpdatePending;
564
578
  }
565
579
  scheduleUpdate() {
566
580
  return this.performUpdate();
@@ -570,29 +584,29 @@ var init_reactive_element = __esm(() => {
570
584
  return;
571
585
  if (!this.hasUpdated) {
572
586
  if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
573
- for (const [t4, s3] of this._$Ep)
574
- this[t4] = s3;
587
+ for (const [t, s] of this._$Ep)
588
+ this[t] = s;
575
589
  this._$Ep = undefined;
576
590
  }
577
- const t3 = this.constructor.elementProperties;
578
- if (t3.size > 0)
579
- for (const [s3, i3] of t3) {
580
- const { wrapped: t4 } = i3, e3 = this[s3];
581
- t4 !== true || this._$AL.has(s3) || e3 === undefined || this.C(s3, undefined, i3, e3);
591
+ const t = this.constructor.elementProperties;
592
+ if (t.size > 0)
593
+ for (const [s, i] of t) {
594
+ const { wrapped: t } = i, e = this[s];
595
+ t !== true || this._$AL.has(s) || e === undefined || this.C(s, undefined, i, e);
582
596
  }
583
597
  }
584
- let t2 = false;
585
- const s2 = this._$AL;
598
+ let t = false;
599
+ const s = this._$AL;
586
600
  try {
587
- t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EM();
588
- } catch (s3) {
589
- throw t2 = false, this._$EM(), s3;
601
+ t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach((t) => t.hostUpdate?.()), this.update(s)) : this._$EM();
602
+ } catch (s) {
603
+ throw t = false, this._$EM(), s;
590
604
  }
591
- t2 && this._$AE(s2);
605
+ t && this._$AE(s);
592
606
  }
593
- willUpdate(t2) {}
594
- _$AE(t2) {
595
- this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2);
607
+ willUpdate(t) {}
608
+ _$AE(t) {
609
+ this._$EO?.forEach((t) => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t)), this.updated(t);
596
610
  }
597
611
  _$EM() {
598
612
  this._$AL = new Map, this.isUpdatePending = false;
@@ -603,80 +617,80 @@ var init_reactive_element = __esm(() => {
603
617
  getUpdateComplete() {
604
618
  return this._$ES;
605
619
  }
606
- shouldUpdate(t2) {
620
+ shouldUpdate(t) {
607
621
  return true;
608
622
  }
609
- update(t2) {
610
- this._$Eq &&= this._$Eq.forEach((t3) => this._$ET(t3, this[t3])), this._$EM();
623
+ update(t) {
624
+ this._$Eq &&= this._$Eq.forEach((t) => this._$ET(t, this[t])), this._$EM();
611
625
  }
612
- updated(t2) {}
613
- firstUpdated(t2) {}
626
+ updated(t) {}
627
+ firstUpdated(t) {}
614
628
  };
615
629
  y.elementStyles = [], y.shadowRootOptions = { mode: "open" }, y[d("elementProperties")] = new Map, y[d("finalized")] = new Map, p?.({ ReactiveElement: y }), (a.reactiveElementVersions ??= []).push("2.1.1");
616
630
  });
617
631
 
618
632
  // ../../node_modules/lit-html/lit-html.js
619
- function P(t3, i4) {
620
- if (!a2(t3) || !t3.hasOwnProperty("raw"))
633
+ function P(t, i) {
634
+ if (!a2(t) || !t.hasOwnProperty("raw"))
621
635
  throw Error("invalid template strings array");
622
- return s2 !== undefined ? s2.createHTML(i4) : i4;
636
+ return s2 !== undefined ? s2.createHTML(i) : i;
623
637
  }
624
638
 
625
639
  class N {
626
- constructor({ strings: t3, _$litType$: s3 }, n4) {
627
- let r4;
640
+ constructor({ strings: t, _$litType$: s }, n) {
641
+ let r;
628
642
  this.parts = [];
629
- let c4 = 0, a3 = 0;
630
- const u3 = t3.length - 1, d3 = this.parts, [f3, v2] = V(t3, s3);
631
- if (this.el = N.createElement(f3, n4), C.currentNode = this.el.content, s3 === 2 || s3 === 3) {
632
- const t4 = this.el.content.firstChild;
633
- t4.replaceWith(...t4.childNodes);
634
- }
635
- for (;(r4 = C.nextNode()) !== null && d3.length < u3; ) {
636
- if (r4.nodeType === 1) {
637
- if (r4.hasAttributes())
638
- for (const t4 of r4.getAttributeNames())
639
- if (t4.endsWith(e3)) {
640
- const i4 = v2[a3++], s4 = r4.getAttribute(t4).split(h2), e4 = /([.?@])?(.*)/.exec(i4);
641
- d3.push({ type: 1, index: c4, name: e4[2], strings: s4, ctor: e4[1] === "." ? H : e4[1] === "?" ? I : e4[1] === "@" ? L : k }), r4.removeAttribute(t4);
643
+ let c = 0, a = 0;
644
+ const u = t.length - 1, d = this.parts, [f, v] = V(t, s);
645
+ if (this.el = N.createElement(f, n), C.currentNode = this.el.content, s === 2 || s === 3) {
646
+ const t = this.el.content.firstChild;
647
+ t.replaceWith(...t.childNodes);
648
+ }
649
+ for (;(r = C.nextNode()) !== null && d.length < u; ) {
650
+ if (r.nodeType === 1) {
651
+ if (r.hasAttributes())
652
+ for (const t of r.getAttributeNames())
653
+ if (t.endsWith(e3)) {
654
+ const i = v[a++], s = r.getAttribute(t).split(h2), e = /([.?@])?(.*)/.exec(i);
655
+ d.push({ type: 1, index: c, name: e[2], strings: s, ctor: e[1] === "." ? H : e[1] === "?" ? I : e[1] === "@" ? L : k }), r.removeAttribute(t);
642
656
  } else
643
- t4.startsWith(h2) && (d3.push({ type: 6, index: c4 }), r4.removeAttribute(t4));
644
- if ($.test(r4.tagName)) {
645
- const t4 = r4.textContent.split(h2), s4 = t4.length - 1;
646
- if (s4 > 0) {
647
- r4.textContent = i3 ? i3.emptyScript : "";
648
- for (let i4 = 0;i4 < s4; i4++)
649
- r4.append(t4[i4], l2()), C.nextNode(), d3.push({ type: 2, index: ++c4 });
650
- r4.append(t4[s4], l2());
657
+ t.startsWith(h2) && (d.push({ type: 6, index: c }), r.removeAttribute(t));
658
+ if ($.test(r.tagName)) {
659
+ const t = r.textContent.split(h2), s = t.length - 1;
660
+ if (s > 0) {
661
+ r.textContent = i3 ? i3.emptyScript : "";
662
+ for (let i = 0;i < s; i++)
663
+ r.append(t[i], l2()), C.nextNode(), d.push({ type: 2, index: ++c });
664
+ r.append(t[s], l2());
651
665
  }
652
666
  }
653
- } else if (r4.nodeType === 8)
654
- if (r4.data === o3)
655
- d3.push({ type: 2, index: c4 });
667
+ } else if (r.nodeType === 8)
668
+ if (r.data === o3)
669
+ d.push({ type: 2, index: c });
656
670
  else {
657
- let t4 = -1;
658
- for (;(t4 = r4.data.indexOf(h2, t4 + 1)) !== -1; )
659
- d3.push({ type: 7, index: c4 }), t4 += h2.length - 1;
671
+ let t = -1;
672
+ for (;(t = r.data.indexOf(h2, t + 1)) !== -1; )
673
+ d.push({ type: 7, index: c }), t += h2.length - 1;
660
674
  }
661
- c4++;
675
+ c++;
662
676
  }
663
677
  }
664
- static createElement(t3, i4) {
665
- const s3 = r3.createElement("template");
666
- return s3.innerHTML = t3, s3;
678
+ static createElement(t, i) {
679
+ const s = r3.createElement("template");
680
+ return s.innerHTML = t, s;
667
681
  }
668
682
  }
669
- function S2(t3, i4, s3 = t3, e4) {
670
- if (i4 === T)
671
- return i4;
672
- let h3 = e4 !== undefined ? s3._$Co?.[e4] : s3._$Cl;
673
- const o4 = c3(i4) ? undefined : i4._$litDirective$;
674
- return h3?.constructor !== o4 && (h3?._$AO?.(false), o4 === undefined ? h3 = undefined : (h3 = new o4(t3), h3._$AT(t3, s3, e4)), e4 !== undefined ? (s3._$Co ??= [])[e4] = h3 : s3._$Cl = h3), h3 !== undefined && (i4 = S2(t3, h3._$AS(t3, i4.values), h3, e4)), i4;
683
+ function S2(t, i, s = t, e) {
684
+ if (i === T)
685
+ return i;
686
+ let h = e !== undefined ? s._$Co?.[e] : s._$Cl;
687
+ const o = c3(i) ? undefined : i._$litDirective$;
688
+ return h?.constructor !== o && (h?._$AO?.(false), o === undefined ? h = undefined : (h = new o(t), h._$AT(t, s, e)), e !== undefined ? (s._$Co ??= [])[e] = h : s._$Cl = h), h !== undefined && (i = S2(t, h._$AS(t, i.values), h, e)), i;
675
689
  }
676
690
 
677
691
  class M {
678
- constructor(t3, i4) {
679
- this._$AV = [], this._$AN = undefined, this._$AD = t3, this._$AM = i4;
692
+ constructor(t, i) {
693
+ this._$AV = [], this._$AN = undefined, this._$AD = t, this._$AM = i;
680
694
  }
681
695
  get parentNode() {
682
696
  return this._$AM.parentNode;
@@ -684,23 +698,23 @@ class M {
684
698
  get _$AU() {
685
699
  return this._$AM._$AU;
686
700
  }
687
- u(t3) {
688
- const { el: { content: i4 }, parts: s3 } = this._$AD, e4 = (t3?.creationScope ?? r3).importNode(i4, true);
689
- C.currentNode = e4;
690
- let h3 = C.nextNode(), o4 = 0, n4 = 0, l3 = s3[0];
691
- for (;l3 !== undefined; ) {
692
- if (o4 === l3.index) {
693
- let i5;
694
- l3.type === 2 ? i5 = new R(h3, h3.nextSibling, this, t3) : l3.type === 1 ? i5 = new l3.ctor(h3, l3.name, l3.strings, this, t3) : l3.type === 6 && (i5 = new z(h3, this, t3)), this._$AV.push(i5), l3 = s3[++n4];
701
+ u(t) {
702
+ const { el: { content: i }, parts: s } = this._$AD, e = (t?.creationScope ?? r3).importNode(i, true);
703
+ C.currentNode = e;
704
+ let h = C.nextNode(), o = 0, n = 0, l = s[0];
705
+ for (;l !== undefined; ) {
706
+ if (o === l.index) {
707
+ let i;
708
+ l.type === 2 ? i = new R(h, h.nextSibling, this, t) : l.type === 1 ? i = new l.ctor(h, l.name, l.strings, this, t) : l.type === 6 && (i = new z(h, this, t)), this._$AV.push(i), l = s[++n];
695
709
  }
696
- o4 !== l3?.index && (h3 = C.nextNode(), o4++);
710
+ o !== l?.index && (h = C.nextNode(), o++);
697
711
  }
698
- return C.currentNode = r3, e4;
712
+ return C.currentNode = r3, e;
699
713
  }
700
- p(t3) {
701
- let i4 = 0;
702
- for (const s3 of this._$AV)
703
- s3 !== undefined && (s3.strings !== undefined ? (s3._$AI(t3, s3, i4), i4 += s3.strings.length - 2) : s3._$AI(t3[i4])), i4++;
714
+ p(t) {
715
+ let i = 0;
716
+ for (const s of this._$AV)
717
+ s !== undefined && (s.strings !== undefined ? (s._$AI(t, s, i), i += s.strings.length - 2) : s._$AI(t[i])), i++;
704
718
  }
705
719
  }
706
720
 
@@ -708,13 +722,13 @@ class R {
708
722
  get _$AU() {
709
723
  return this._$AM?._$AU ?? this._$Cv;
710
724
  }
711
- constructor(t3, i4, s3, e4) {
712
- this.type = 2, this._$AH = E, this._$AN = undefined, this._$AA = t3, this._$AB = i4, this._$AM = s3, this.options = e4, this._$Cv = e4?.isConnected ?? true;
725
+ constructor(t, i, s, e) {
726
+ this.type = 2, this._$AH = E, this._$AN = undefined, this._$AA = t, this._$AB = i, this._$AM = s, this.options = e, this._$Cv = e?.isConnected ?? true;
713
727
  }
714
728
  get parentNode() {
715
- let t3 = this._$AA.parentNode;
716
- const i4 = this._$AM;
717
- return i4 !== undefined && t3?.nodeType === 11 && (t3 = i4.parentNode), t3;
729
+ let t = this._$AA.parentNode;
730
+ const i = this._$AM;
731
+ return i !== undefined && t?.nodeType === 11 && (t = i.parentNode), t;
718
732
  }
719
733
  get startNode() {
720
734
  return this._$AA;
@@ -722,47 +736,47 @@ class R {
722
736
  get endNode() {
723
737
  return this._$AB;
724
738
  }
725
- _$AI(t3, i4 = this) {
726
- t3 = S2(this, t3, i4), c3(t3) ? t3 === E || t3 == null || t3 === "" ? (this._$AH !== E && this._$AR(), this._$AH = E) : t3 !== this._$AH && t3 !== T && this._(t3) : t3._$litType$ !== undefined ? this.$(t3) : t3.nodeType !== undefined ? this.T(t3) : u2(t3) ? this.k(t3) : this._(t3);
739
+ _$AI(t, i = this) {
740
+ t = S2(this, t, i), c3(t) ? t === E || t == null || t === "" ? (this._$AH !== E && this._$AR(), this._$AH = E) : t !== this._$AH && t !== T && this._(t) : t._$litType$ !== undefined ? this.$(t) : t.nodeType !== undefined ? this.T(t) : u2(t) ? this.k(t) : this._(t);
727
741
  }
728
- O(t3) {
729
- return this._$AA.parentNode.insertBefore(t3, this._$AB);
742
+ O(t) {
743
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
730
744
  }
731
- T(t3) {
732
- this._$AH !== t3 && (this._$AR(), this._$AH = this.O(t3));
745
+ T(t) {
746
+ this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
733
747
  }
734
- _(t3) {
735
- this._$AH !== E && c3(this._$AH) ? this._$AA.nextSibling.data = t3 : this.T(r3.createTextNode(t3)), this._$AH = t3;
748
+ _(t) {
749
+ this._$AH !== E && c3(this._$AH) ? this._$AA.nextSibling.data = t : this.T(r3.createTextNode(t)), this._$AH = t;
736
750
  }
737
- $(t3) {
738
- const { values: i4, _$litType$: s3 } = t3, e4 = typeof s3 == "number" ? this._$AC(t3) : (s3.el === undefined && (s3.el = N.createElement(P(s3.h, s3.h[0]), this.options)), s3);
739
- if (this._$AH?._$AD === e4)
740
- this._$AH.p(i4);
751
+ $(t) {
752
+ const { values: i, _$litType$: s } = t, e = typeof s == "number" ? this._$AC(t) : (s.el === undefined && (s.el = N.createElement(P(s.h, s.h[0]), this.options)), s);
753
+ if (this._$AH?._$AD === e)
754
+ this._$AH.p(i);
741
755
  else {
742
- const t4 = new M(e4, this), s4 = t4.u(this.options);
743
- t4.p(i4), this.T(s4), this._$AH = t4;
756
+ const t = new M(e, this), s = t.u(this.options);
757
+ t.p(i), this.T(s), this._$AH = t;
744
758
  }
745
759
  }
746
- _$AC(t3) {
747
- let i4 = A.get(t3.strings);
748
- return i4 === undefined && A.set(t3.strings, i4 = new N(t3)), i4;
760
+ _$AC(t) {
761
+ let i = A.get(t.strings);
762
+ return i === undefined && A.set(t.strings, i = new N(t)), i;
749
763
  }
750
- k(t3) {
764
+ k(t) {
751
765
  a2(this._$AH) || (this._$AH = [], this._$AR());
752
- const i4 = this._$AH;
753
- let s3, e4 = 0;
754
- for (const h3 of t3)
755
- e4 === i4.length ? i4.push(s3 = new R(this.O(l2()), this.O(l2()), this, this.options)) : s3 = i4[e4], s3._$AI(h3), e4++;
756
- e4 < i4.length && (this._$AR(s3 && s3._$AB.nextSibling, e4), i4.length = e4);
766
+ const i = this._$AH;
767
+ let s, e = 0;
768
+ for (const h of t)
769
+ e === i.length ? i.push(s = new R(this.O(l2()), this.O(l2()), this, this.options)) : s = i[e], s._$AI(h), e++;
770
+ e < i.length && (this._$AR(s && s._$AB.nextSibling, e), i.length = e);
757
771
  }
758
- _$AR(t3 = this._$AA.nextSibling, i4) {
759
- for (this._$AP?.(false, true, i4);t3 !== this._$AB; ) {
760
- const i5 = t3.nextSibling;
761
- t3.remove(), t3 = i5;
772
+ _$AR(t = this._$AA.nextSibling, i) {
773
+ for (this._$AP?.(false, true, i);t !== this._$AB; ) {
774
+ const i = t.nextSibling;
775
+ t.remove(), t = i;
762
776
  }
763
777
  }
764
- setConnected(t3) {
765
- this._$AM === undefined && (this._$Cv = t3, this._$AP?.(t3));
778
+ setConnected(t) {
779
+ this._$AM === undefined && (this._$Cv = t, this._$AP?.(t));
766
780
  }
767
781
  }
768
782
 
@@ -773,64 +787,64 @@ class k {
773
787
  get _$AU() {
774
788
  return this._$AM._$AU;
775
789
  }
776
- constructor(t3, i4, s3, e4, h3) {
777
- this.type = 1, this._$AH = E, this._$AN = undefined, this.element = t3, this.name = i4, this._$AM = e4, this.options = h3, s3.length > 2 || s3[0] !== "" || s3[1] !== "" ? (this._$AH = Array(s3.length - 1).fill(new String), this.strings = s3) : this._$AH = E;
790
+ constructor(t, i, s, e, h) {
791
+ this.type = 1, this._$AH = E, this._$AN = undefined, this.element = t, this.name = i, this._$AM = e, this.options = h, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String), this.strings = s) : this._$AH = E;
778
792
  }
779
- _$AI(t3, i4 = this, s3, e4) {
780
- const h3 = this.strings;
781
- let o4 = false;
782
- if (h3 === undefined)
783
- t3 = S2(this, t3, i4, 0), o4 = !c3(t3) || t3 !== this._$AH && t3 !== T, o4 && (this._$AH = t3);
793
+ _$AI(t, i = this, s, e) {
794
+ const h = this.strings;
795
+ let o = false;
796
+ if (h === undefined)
797
+ t = S2(this, t, i, 0), o = !c3(t) || t !== this._$AH && t !== T, o && (this._$AH = t);
784
798
  else {
785
- const e5 = t3;
786
- let n4, r4;
787
- for (t3 = h3[0], n4 = 0;n4 < h3.length - 1; n4++)
788
- r4 = S2(this, e5[s3 + n4], i4, n4), r4 === T && (r4 = this._$AH[n4]), o4 ||= !c3(r4) || r4 !== this._$AH[n4], r4 === E ? t3 = E : t3 !== E && (t3 += (r4 ?? "") + h3[n4 + 1]), this._$AH[n4] = r4;
799
+ const e = t;
800
+ let n, r;
801
+ for (t = h[0], n = 0;n < h.length - 1; n++)
802
+ r = S2(this, e[s + n], i, n), r === T && (r = this._$AH[n]), o ||= !c3(r) || r !== this._$AH[n], r === E ? t = E : t !== E && (t += (r ?? "") + h[n + 1]), this._$AH[n] = r;
789
803
  }
790
- o4 && !e4 && this.j(t3);
804
+ o && !e && this.j(t);
791
805
  }
792
- j(t3) {
793
- t3 === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t3 ?? "");
806
+ j(t) {
807
+ t === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
794
808
  }
795
809
  }
796
810
 
797
811
  class z {
798
- constructor(t3, i4, s3) {
799
- this.element = t3, this.type = 6, this._$AN = undefined, this._$AM = i4, this.options = s3;
812
+ constructor(t, i, s) {
813
+ this.element = t, this.type = 6, this._$AN = undefined, this._$AM = i, this.options = s;
800
814
  }
801
815
  get _$AU() {
802
816
  return this._$AM._$AU;
803
817
  }
804
- _$AI(t3) {
805
- S2(this, t3);
806
- }
807
- }
808
- var t2, i3, s2, e3 = "$lit$", h2, o3, n3, r3, l2 = () => r3.createComment(""), c3 = (t3) => t3 === null || typeof t3 != "object" && typeof t3 != "function", a2, u2 = (t3) => a2(t3) || typeof t3?.[Symbol.iterator] == "function", d2 = `[
809
- \f\r]`, f2, v, _, m, p2, g, $, y2 = (t3) => (i4, ...s3) => ({ _$litType$: t3, strings: i4, values: s3 }), x, b2, w, T, E, A, C, V = (t3, i4) => {
810
- const s3 = t3.length - 1, o4 = [];
811
- let r4, l3 = i4 === 2 ? "<svg>" : i4 === 3 ? "<math>" : "", c4 = f2;
812
- for (let i5 = 0;i5 < s3; i5++) {
813
- const s4 = t3[i5];
814
- let a3, u3, d3 = -1, y3 = 0;
815
- for (;y3 < s4.length && (c4.lastIndex = y3, u3 = c4.exec(s4), u3 !== null); )
816
- y3 = c4.lastIndex, c4 === f2 ? u3[1] === "!--" ? c4 = v : u3[1] !== undefined ? c4 = _ : u3[2] !== undefined ? ($.test(u3[2]) && (r4 = RegExp("</" + u3[2], "g")), c4 = m) : u3[3] !== undefined && (c4 = m) : c4 === m ? u3[0] === ">" ? (c4 = r4 ?? f2, d3 = -1) : u3[1] === undefined ? d3 = -2 : (d3 = c4.lastIndex - u3[2].length, a3 = u3[1], c4 = u3[3] === undefined ? m : u3[3] === '"' ? g : p2) : c4 === g || c4 === p2 ? c4 = m : c4 === v || c4 === _ ? c4 = f2 : (c4 = m, r4 = undefined);
817
- const x2 = c4 === m && t3[i5 + 1].startsWith("/>") ? " " : "";
818
- l3 += c4 === f2 ? s4 + n3 : d3 >= 0 ? (o4.push(a3), s4.slice(0, d3) + e3 + s4.slice(d3) + h2 + x2) : s4 + h2 + (d3 === -2 ? i5 : x2);
819
- }
820
- return [P(t3, l3 + (t3[s3] || "<?>") + (i4 === 2 ? "</svg>" : i4 === 3 ? "</math>" : "")), o4];
821
- }, H, I, L, Z, j, B = (t3, i4, s3) => {
822
- const e4 = s3?.renderBefore ?? i4;
823
- let h3 = e4._$litPart$;
824
- if (h3 === undefined) {
825
- const t4 = s3?.renderBefore ?? null;
826
- e4._$litPart$ = h3 = new R(i4.insertBefore(l2(), t4), t4, undefined, s3 ?? {});
827
- }
828
- return h3._$AI(t3), h3;
818
+ _$AI(t) {
819
+ S2(this, t);
820
+ }
821
+ }
822
+ var t2, i3, s2, e3 = "$lit$", h2, o3, n3, r3, l2 = () => r3.createComment(""), c3 = (t) => t === null || typeof t != "object" && typeof t != "function", a2, u2 = (t) => a2(t) || typeof t?.[Symbol.iterator] == "function", d2 = `[
823
+ \f\r]`, f2, v, _, m, p2, g, $, y2 = (t) => (i, ...s) => ({ _$litType$: t, strings: i, values: s }), x, b2, w, T, E, A, C, V = (t, i) => {
824
+ const s = t.length - 1, o = [];
825
+ let r, l = i === 2 ? "<svg>" : i === 3 ? "<math>" : "", c = f2;
826
+ for (let i = 0;i < s; i++) {
827
+ const s = t[i];
828
+ let a, u, d = -1, y = 0;
829
+ for (;y < s.length && (c.lastIndex = y, u = c.exec(s), u !== null); )
830
+ y = c.lastIndex, c === f2 ? u[1] === "!--" ? c = v : u[1] !== undefined ? c = _ : u[2] !== undefined ? ($.test(u[2]) && (r = RegExp("</" + u[2], "g")), c = m) : u[3] !== undefined && (c = m) : c === m ? u[0] === ">" ? (c = r ?? f2, d = -1) : u[1] === undefined ? d = -2 : (d = c.lastIndex - u[2].length, a = u[1], c = u[3] === undefined ? m : u[3] === '"' ? g : p2) : c === g || c === p2 ? c = m : c === v || c === _ ? c = f2 : (c = m, r = undefined);
831
+ const x = c === m && t[i + 1].startsWith("/>") ? " " : "";
832
+ l += c === f2 ? s + n3 : d >= 0 ? (o.push(a), s.slice(0, d) + e3 + s.slice(d) + h2 + x) : s + h2 + (d === -2 ? i : x);
833
+ }
834
+ return [P(t, l + (t[s] || "<?>") + (i === 2 ? "</svg>" : i === 3 ? "</math>" : "")), o];
835
+ }, H, I, L, Z, j, B = (t, i, s) => {
836
+ const e = s?.renderBefore ?? i;
837
+ let h = e._$litPart$;
838
+ if (h === undefined) {
839
+ const t = s?.renderBefore ?? null;
840
+ e._$litPart$ = h = new R(i.insertBefore(l2(), t), t, undefined, s ?? {});
841
+ }
842
+ return h._$AI(t), h;
829
843
  };
830
844
  var init_lit_html = __esm(() => {
831
845
  t2 = globalThis;
832
846
  i3 = t2.trustedTypes;
833
- s2 = i3 ? i3.createPolicy("lit-html", { createHTML: (t3) => t3 }) : undefined;
847
+ s2 = i3 ? i3.createPolicy("lit-html", { createHTML: (t) => t }) : undefined;
834
848
  h2 = `lit$${Math.random().toFixed(9).slice(2)}$`;
835
849
  o3 = "?" + h2;
836
850
  n3 = `<${o3}>`;
@@ -855,30 +869,30 @@ var init_lit_html = __esm(() => {
855
869
  constructor() {
856
870
  super(...arguments), this.type = 3;
857
871
  }
858
- j(t3) {
859
- this.element[this.name] = t3 === E ? undefined : t3;
872
+ j(t) {
873
+ this.element[this.name] = t === E ? undefined : t;
860
874
  }
861
875
  };
862
876
  I = class I extends k {
863
877
  constructor() {
864
878
  super(...arguments), this.type = 4;
865
879
  }
866
- j(t3) {
867
- this.element.toggleAttribute(this.name, !!t3 && t3 !== E);
880
+ j(t) {
881
+ this.element.toggleAttribute(this.name, !!t && t !== E);
868
882
  }
869
883
  };
870
884
  L = class L extends k {
871
- constructor(t3, i4, s3, e4, h3) {
872
- super(t3, i4, s3, e4, h3), this.type = 5;
885
+ constructor(t, i, s, e, h) {
886
+ super(t, i, s, e, h), this.type = 5;
873
887
  }
874
- _$AI(t3, i4 = this) {
875
- if ((t3 = S2(this, t3, i4, 0) ?? E) === T)
888
+ _$AI(t, i = this) {
889
+ if ((t = S2(this, t, i, 0) ?? E) === T)
876
890
  return;
877
- const s3 = this._$AH, e4 = t3 === E && s3 !== E || t3.capture !== s3.capture || t3.once !== s3.once || t3.passive !== s3.passive, h3 = t3 !== E && (s3 === E || e4);
878
- e4 && this.element.removeEventListener(this.name, this, s3), h3 && this.element.addEventListener(this.name, this, t3), this._$AH = t3;
891
+ const s = this._$AH, e = t === E && s !== E || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, h = t !== E && (s === E || e);
892
+ e && this.element.removeEventListener(this.name, this, s), h && this.element.addEventListener(this.name, this, t), this._$AH = t;
879
893
  }
880
- handleEvent(t3) {
881
- typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t3) : this._$AH.handleEvent(t3);
894
+ handleEvent(t) {
895
+ typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
882
896
  }
883
897
  };
884
898
  Z = { M: e3, P: h2, A: o3, C: 1, L: V, R: M, D: u2, V: S2, I: R, H: k, N: I, U: L, B: H, F: z };
@@ -889,9 +903,9 @@ var init_lit_html = __esm(() => {
889
903
  // ../../node_modules/lit-element/lit-element.js
890
904
  var s3, i4, o4;
891
905
  var init_lit_element = __esm(() => {
892
- init_reactive_element();
893
906
  init_reactive_element();
894
907
  init_lit_html();
908
+ init_reactive_element();
895
909
  init_lit_html();
896
910
  s3 = globalThis;
897
911
  i4 = class i4 extends y {
@@ -899,12 +913,12 @@ var init_lit_element = __esm(() => {
899
913
  super(...arguments), this.renderOptions = { host: this }, this._$Do = undefined;
900
914
  }
901
915
  createRenderRoot() {
902
- const t3 = super.createRenderRoot();
903
- return this.renderOptions.renderBefore ??= t3.firstChild, t3;
916
+ const t = super.createRenderRoot();
917
+ return this.renderOptions.renderBefore ??= t.firstChild, t;
904
918
  }
905
- update(t3) {
906
- const r4 = this.render();
907
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t3), this._$Do = B(r4, this.renderRoot, this.renderOptions);
919
+ update(t) {
920
+ const r = this.render();
921
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = B(r, this.renderRoot, this.renderOptions);
908
922
  }
909
923
  connectedCallback() {
910
924
  super.connectedCallback(), this._$Do?.setConnected(true);
@@ -934,28 +948,28 @@ var init_lit = __esm(() => {
934
948
  });
935
949
 
936
950
  // ../../node_modules/lit-html/directive-helpers.js
937
- var t3, f3 = (o5) => o5.strings === undefined, r4 = () => document.createComment(""), s4 = (o5, i5, n4) => {
938
- const e4 = o5._$AA.parentNode, l3 = i5 === undefined ? o5._$AB : i5._$AA;
939
- if (n4 === undefined) {
940
- const i6 = e4.insertBefore(r4(), l3), d3 = e4.insertBefore(r4(), l3);
941
- n4 = new t3(i6, d3, o5, o5.options);
951
+ var t3, f3 = (o) => o.strings === undefined, r4 = () => document.createComment(""), s4 = (o, i, n) => {
952
+ const e = o._$AA.parentNode, l = i === undefined ? o._$AB : i._$AA;
953
+ if (n === undefined) {
954
+ const i = e.insertBefore(r4(), l), d = e.insertBefore(r4(), l);
955
+ n = new t3(i, d, o, o.options);
942
956
  } else {
943
- const t4 = n4._$AB.nextSibling, i6 = n4._$AM, d3 = i6 !== o5;
944
- if (d3) {
945
- let t5;
946
- n4._$AQ?.(o5), n4._$AM = o5, n4._$AP !== undefined && (t5 = o5._$AU) !== i6._$AU && n4._$AP(t5);
957
+ const t = n._$AB.nextSibling, i = n._$AM, d = i !== o;
958
+ if (d) {
959
+ let t;
960
+ n._$AQ?.(o), n._$AM = o, n._$AP !== undefined && (t = o._$AU) !== i._$AU && n._$AP(t);
947
961
  }
948
- if (t4 !== l3 || d3) {
949
- let o6 = n4._$AA;
950
- for (;o6 !== t4; ) {
951
- const t5 = o6.nextSibling;
952
- e4.insertBefore(o6, l3), o6 = t5;
962
+ if (t !== l || d) {
963
+ let o = n._$AA;
964
+ for (;o !== t; ) {
965
+ const t = o.nextSibling;
966
+ e.insertBefore(o, l), o = t;
953
967
  }
954
968
  }
955
969
  }
956
- return n4;
957
- }, v2 = (o5, t4, i5 = o5) => (o5._$AI(t4, i5), o5), u3, m2 = (o5, t4 = u3) => o5._$AH = t4, p3 = (o5) => o5._$AH, M2 = (o5) => {
958
- o5._$AR(), o5._$AA.remove();
970
+ return n;
971
+ }, v2 = (o, t, i = o) => (o._$AI(t, i), o), u3, m2 = (o, t = u3) => o._$AH = t, p3 = (o) => o._$AH, M2 = (o) => {
972
+ o._$AR(), o._$AA.remove();
959
973
  };
960
974
  var init_directive_helpers = __esm(() => {
961
975
  init_lit_html();
@@ -965,66 +979,66 @@ var init_directive_helpers = __esm(() => {
965
979
 
966
980
  // ../../node_modules/lit-html/directive.js
967
981
  class i5 {
968
- constructor(t5) {}
982
+ constructor(t) {}
969
983
  get _$AU() {
970
984
  return this._$AM._$AU;
971
985
  }
972
- _$AT(t5, e5, i6) {
973
- this._$Ct = t5, this._$AM = e5, this._$Ci = i6;
986
+ _$AT(t, e, i) {
987
+ this._$Ct = t, this._$AM = e, this._$Ci = i;
974
988
  }
975
- _$AS(t5, e5) {
976
- return this.update(t5, e5);
989
+ _$AS(t, e) {
990
+ return this.update(t, e);
977
991
  }
978
- update(t5, e5) {
979
- return this.render(...e5);
992
+ update(t, e) {
993
+ return this.render(...e);
980
994
  }
981
995
  }
982
- var t4, e4 = (t5) => (...e5) => ({ _$litDirective$: t5, values: e5 });
996
+ var t4, e4 = (t) => (...e) => ({ _$litDirective$: t, values: e });
983
997
  var init_directive = __esm(() => {
984
998
  t4 = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 };
985
999
  });
986
1000
 
987
1001
  // ../../node_modules/lit-html/async-directive.js
988
- function h3(i6) {
989
- this._$AN !== undefined ? (o5(this), this._$AM = i6, r5(this)) : this._$AM = i6;
990
- }
991
- function n4(i6, t5 = false, e5 = 0) {
992
- const r6 = this._$AH, h4 = this._$AN;
993
- if (h4 !== undefined && h4.size !== 0)
994
- if (t5)
995
- if (Array.isArray(r6))
996
- for (let i7 = e5;i7 < r6.length; i7++)
997
- s5(r6[i7], false), o5(r6[i7]);
1002
+ function h3(i) {
1003
+ this._$AN !== undefined ? (o5(this), this._$AM = i, r5(this)) : this._$AM = i;
1004
+ }
1005
+ function n4(i, t = false, e = 0) {
1006
+ const r = this._$AH, h = this._$AN;
1007
+ if (h !== undefined && h.size !== 0)
1008
+ if (t)
1009
+ if (Array.isArray(r))
1010
+ for (let i = e;i < r.length; i++)
1011
+ s5(r[i], false), o5(r[i]);
998
1012
  else
999
- r6 != null && (s5(r6, false), o5(r6));
1013
+ r != null && (s5(r, false), o5(r));
1000
1014
  else
1001
- s5(this, i6);
1015
+ s5(this, i);
1002
1016
  }
1003
- var s5 = (i6, t5) => {
1004
- const e5 = i6._$AN;
1005
- if (e5 === undefined)
1017
+ var s5 = (i, t) => {
1018
+ const e = i._$AN;
1019
+ if (e === undefined)
1006
1020
  return false;
1007
- for (const i7 of e5)
1008
- i7._$AO?.(t5, false), s5(i7, t5);
1021
+ for (const i of e)
1022
+ i._$AO?.(t, false), s5(i, t);
1009
1023
  return true;
1010
- }, o5 = (i6) => {
1011
- let t5, e5;
1024
+ }, o5 = (i) => {
1025
+ let t, e;
1012
1026
  do {
1013
- if ((t5 = i6._$AM) === undefined)
1027
+ if ((t = i._$AM) === undefined)
1014
1028
  break;
1015
- e5 = t5._$AN, e5.delete(i6), i6 = t5;
1016
- } while (e5?.size === 0);
1017
- }, r5 = (i6) => {
1018
- for (let t5;t5 = i6._$AM; i6 = t5) {
1019
- let e5 = t5._$AN;
1020
- if (e5 === undefined)
1021
- t5._$AN = e5 = new Set;
1022
- else if (e5.has(i6))
1029
+ e = t._$AN, e.delete(i), i = t;
1030
+ } while (e?.size === 0);
1031
+ }, r5 = (i) => {
1032
+ for (let t;t = i._$AM; i = t) {
1033
+ let e = t._$AN;
1034
+ if (e === undefined)
1035
+ t._$AN = e = new Set;
1036
+ else if (e.has(i))
1023
1037
  break;
1024
- e5.add(i6), c4(t5);
1038
+ e.add(i), c4(t);
1025
1039
  }
1026
- }, c4 = (i6) => {
1027
- i6.type == t4.CHILD && (i6._$AP ??= n4, i6._$AQ ??= h3);
1040
+ }, c4 = (i) => {
1041
+ i.type == t4.CHILD && (i._$AP ??= n4, i._$AQ ??= h3);
1028
1042
  }, f4;
1029
1043
  var init_async_directive = __esm(() => {
1030
1044
  init_directive_helpers();
@@ -1034,18 +1048,18 @@ var init_async_directive = __esm(() => {
1034
1048
  constructor() {
1035
1049
  super(...arguments), this._$AN = undefined;
1036
1050
  }
1037
- _$AT(i6, t5, e5) {
1038
- super._$AT(i6, t5, e5), r5(this), this.isConnected = i6._$AU;
1051
+ _$AT(i, t, e) {
1052
+ super._$AT(i, t, e), r5(this), this.isConnected = i._$AU;
1039
1053
  }
1040
- _$AO(i6, t5 = true) {
1041
- i6 !== this.isConnected && (this.isConnected = i6, i6 ? this.reconnected?.() : this.disconnected?.()), t5 && (s5(this, i6), o5(this));
1054
+ _$AO(i, t = true) {
1055
+ i !== this.isConnected && (this.isConnected = i, i ? this.reconnected?.() : this.disconnected?.()), t && (s5(this, i), o5(this));
1042
1056
  }
1043
- setValue(t5) {
1057
+ setValue(t) {
1044
1058
  if (f3(this._$Ct))
1045
- this._$Ct._$AI(t5, this);
1059
+ this._$Ct._$AI(t, this);
1046
1060
  else {
1047
- const i6 = [...this._$Ct._$AH];
1048
- i6[this._$Ci] = t5, this._$Ct._$AI(i6, this, 0);
1061
+ const i = [...this._$Ct._$AH];
1062
+ i[this._$Ci] = t, this._$Ct._$AI(i, this, 0);
1049
1063
  }
1050
1064
  }
1051
1065
  disconnected() {}
@@ -1063,20 +1077,20 @@ var init_ref = __esm(() => {
1063
1077
  init_directive();
1064
1078
  o6 = new WeakMap;
1065
1079
  n5 = e4(class extends f4 {
1066
- render(i6) {
1080
+ render(i) {
1067
1081
  return E;
1068
1082
  }
1069
- update(i6, [s6]) {
1070
- const e6 = s6 !== this.G;
1071
- return e6 && this.G !== undefined && this.rt(undefined), (e6 || this.lt !== this.ct) && (this.G = s6, this.ht = i6.options?.host, this.rt(this.ct = i6.element)), E;
1083
+ update(i, [s]) {
1084
+ const e = s !== this.G;
1085
+ return e && this.G !== undefined && this.rt(undefined), (e || this.lt !== this.ct) && (this.G = s, this.ht = i.options?.host, this.rt(this.ct = i.element)), E;
1072
1086
  }
1073
- rt(t5) {
1074
- if (this.isConnected || (t5 = undefined), typeof this.G == "function") {
1075
- const i6 = this.ht ?? globalThis;
1076
- let s6 = o6.get(i6);
1077
- s6 === undefined && (s6 = new WeakMap, o6.set(i6, s6)), s6.get(this.G) !== undefined && this.G.call(this.ht, undefined), s6.set(this.G, t5), t5 !== undefined && this.G.call(this.ht, t5);
1087
+ rt(t) {
1088
+ if (this.isConnected || (t = undefined), typeof this.G == "function") {
1089
+ const i = this.ht ?? globalThis;
1090
+ let s = o6.get(i);
1091
+ s === undefined && (s = new WeakMap, o6.set(i, s)), s.get(this.G) !== undefined && this.G.call(this.ht, undefined), s.set(this.G, t), t !== undefined && this.G.call(this.ht, t);
1078
1092
  } else
1079
- this.G.value = t5;
1093
+ this.G.value = t;
1080
1094
  }
1081
1095
  get lt() {
1082
1096
  return typeof this.G == "function" ? o6.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value;
@@ -1135,11 +1149,14 @@ var init_LitElementWithProps = __esm(() => {
1135
1149
  init_lit();
1136
1150
  init_validation();
1137
1151
  LitElementWithProps = class LitElementWithProps extends i4 {
1138
- _varsSheet = null;
1139
- _varsMap = {};
1140
- _appearanceVarNames = new Set;
1141
- _varsDocSheet = null;
1142
- _varsClassName = null;
1152
+ constructor() {
1153
+ super(...arguments);
1154
+ this._varsSheet = null;
1155
+ this._varsMap = {};
1156
+ this._appearanceVarNames = new Set;
1157
+ this._varsDocSheet = null;
1158
+ this._varsClassName = null;
1159
+ }
1143
1160
  static keepDefinitions;
1144
1161
  static requiredChildTags;
1145
1162
  static strictChildDefinitions;
@@ -1159,7 +1176,6 @@ var init_LitElementWithProps = __esm(() => {
1159
1176
  propertyNames.forEach((prop) => this.upgradeProperty(prop));
1160
1177
  }
1161
1178
  }
1162
- styles;
1163
1179
  connectedCallback() {
1164
1180
  super.connectedCallback();
1165
1181
  this.upgradeAllProperties();
@@ -1171,7 +1187,7 @@ var init_LitElementWithProps = __esm(() => {
1171
1187
  const { keepDefinitions, requiredChildTags, strictChildDefinitions } = ctor;
1172
1188
  const defs = keepDefinitions;
1173
1189
  if (defs && defs.length) {
1174
- for (const d3 of defs)
1190
+ for (const d of defs)
1175
1191
  ;
1176
1192
  }
1177
1193
  const req = requiredChildTags;
@@ -1206,7 +1222,7 @@ var init_LitElementWithProps = __esm(() => {
1206
1222
  const setVar = (name, val) => {
1207
1223
  vars[name] = val;
1208
1224
  };
1209
- const toKebab = (s6) => this.camelToKebab(s6);
1225
+ const toKebab = (s) => this.camelToKebab(s);
1210
1226
  const transformViewportUnits = (val) => {
1211
1227
  if (!val || typeof val !== "string")
1212
1228
  return val;
@@ -1253,14 +1269,14 @@ var init_LitElementWithProps = __esm(() => {
1253
1269
  setVar(colorMappings[key], maybeTransformed);
1254
1270
  return;
1255
1271
  }
1256
- const r6 = key.match(radiusMatcher);
1257
- if (r6) {
1258
- setVar(`--w3a-border-radius-${r6[1].toLowerCase()}`, maybeTransformed);
1272
+ const r = key.match(radiusMatcher);
1273
+ if (r) {
1274
+ setVar(`--w3a-border-radius-${r[1].toLowerCase()}`, maybeTransformed);
1259
1275
  return;
1260
1276
  }
1261
- const s6 = key.match(shadowMatcher);
1262
- if (s6) {
1263
- setVar(`--w3a-shadows-${s6[1].toLowerCase()}`, maybeTransformed);
1277
+ const s = key.match(shadowMatcher);
1278
+ if (s) {
1279
+ setVar(`--w3a-shadows-${s[1].toLowerCase()}`, maybeTransformed);
1264
1280
  return;
1265
1281
  }
1266
1282
  setVar(`--w3a-${toKebab(key)}`, maybeTransformed);
@@ -1271,8 +1287,8 @@ var init_LitElementWithProps = __esm(() => {
1271
1287
  const kebabSection = toKebab(section);
1272
1288
  const kebabProp = toKebab(prop);
1273
1289
  const cssVarNew = `--w3a-${prefix}__${kebabSection}__${kebabProp}`;
1274
- const v3 = typeof value === "string" ? transformViewportUnits(value) : String(value);
1275
- vars[cssVarNew] = v3;
1290
+ const v = typeof value === "string" ? transformViewportUnits(value) : String(value);
1291
+ vars[cssVarNew] = v;
1276
1292
  });
1277
1293
  }
1278
1294
  });
@@ -1283,12 +1299,12 @@ var init_LitElementWithProps = __esm(() => {
1283
1299
  }
1284
1300
  setCssVars(vars) {
1285
1301
  try {
1286
- for (const [k2, v3] of Object.entries(vars)) {
1287
- if (v3 == null)
1302
+ for (const [k, v] of Object.entries(vars)) {
1303
+ if (v == null)
1288
1304
  continue;
1289
- this._varsMap[k2] = String(v3);
1305
+ this._varsMap[k] = String(v);
1290
1306
  }
1291
- const decls = Object.entries(this._varsMap).map(([k2, v3]) => `${k2}: ${v3};`).join(" ");
1307
+ const decls = Object.entries(this._varsMap).map(([k, v]) => `${k}: ${v};`).join(" ");
1292
1308
  const cssTextShadow = `:host{ ${decls} }`;
1293
1309
  const canUseConstructable = supportsConstructableStylesheets();
1294
1310
  if (this.renderRoot instanceof ShadowRoot && canUseConstructable && hasAdoptedStyleSheets(this.renderRoot)) {
@@ -1383,16 +1399,16 @@ var init_lit_events = __esm(() => {
1383
1399
  });
1384
1400
 
1385
1401
  // src/core/signingEngine/uiConfirm/ui/lit-components/asset-base.ts
1386
- function withTrailingSlash(s6) {
1387
- return s6.endsWith("/") ? s6 : s6 + "/";
1402
+ function withTrailingSlash(s) {
1403
+ return s.endsWith("/") ? s : s + "/";
1388
1404
  }
1389
1405
  function readGlobalEmbeddedBase() {
1390
1406
  try {
1391
1407
  if (typeof window === "undefined")
1392
1408
  return;
1393
- const v3 = window.__W3A_WALLET_SDK_BASE__;
1394
- if (typeof v3 === "string" && v3.length > 0)
1395
- return withTrailingSlash(v3);
1409
+ const v = window.__W3A_WALLET_SDK_BASE__;
1410
+ if (typeof v === "string" && v.length > 0)
1411
+ return withTrailingSlash(v);
1396
1412
  } catch {}
1397
1413
  return;
1398
1414
  }
@@ -1401,14 +1417,14 @@ function deriveFromModuleUrl() {
1401
1417
  const moduleUrl = String(import.meta.url || "").trim();
1402
1418
  if (!moduleUrl)
1403
1419
  return;
1404
- const base2 = typeof window !== "undefined" ? window.location.href : undefined;
1405
- const u4 = base2 ? new URL(moduleUrl, base2) : new URL(moduleUrl);
1406
- const href = u4.toString();
1420
+ const base = typeof window !== "undefined" ? window.location.href : undefined;
1421
+ const u = base ? new URL(moduleUrl, base) : new URL(moduleUrl);
1422
+ const href = u.toString();
1407
1423
  const idx = href.indexOf(SDK_SEGMENT);
1408
1424
  if (idx > 0) {
1409
1425
  return withTrailingSlash(href.slice(0, idx + SDK_SEGMENT.length));
1410
1426
  }
1411
- const origin = u4.origin;
1427
+ const origin = u.origin;
1412
1428
  if (origin && /^https?:/i.test(origin)) {
1413
1429
  return withTrailingSlash(origin + "/sdk");
1414
1430
  }
@@ -1422,22 +1438,22 @@ var SDK_SEGMENT = "/sdk/";
1422
1438
 
1423
1439
  // src/core/signingEngine/uiConfirm/ui/lit-components/css/css-loader.ts
1424
1440
  function resolveStylesheetUrl(assetName) {
1425
- const base2 = resolveEmbeddedBase();
1426
- const join = (s6) => s6.endsWith("/") ? s6 : s6 + "/";
1427
- if (/^https?:/i.test(base2))
1428
- return `${join(base2)}${assetName}`;
1441
+ const base = resolveEmbeddedBase();
1442
+ const join = (s) => s.endsWith("/") ? s : s + "/";
1443
+ if (/^https?:/i.test(base))
1444
+ return `${join(base)}${assetName}`;
1429
1445
  try {
1430
1446
  if (!warnedRelativeBaseOnce && typeof document !== "undefined" && document.URL === "about:srcdoc") {
1431
1447
  warnedRelativeBaseOnce = true;
1432
- console.warn(`[W3A][css-loader] Embedded SDK base is relative: "${base2}". ` + `In production, configure an absolute base so iframe assets resolve: ` + `set SeamsWebProvider config { iframeWallet: { walletOrigin: "https://wallet.example.com", sdkBasePath: "/sdk" } }, `);
1448
+ console.warn(`[W3A][css-loader] Embedded SDK base is relative: "${base}". ` + `In production, configure an absolute base so iframe assets resolve: ` + `set SeamsWebProvider config { iframeWallet: { walletOrigin: "https://wallet.example.com", sdkBasePath: "/sdk" } }, `);
1433
1449
  }
1434
1450
  } catch {}
1435
1451
  const origin = typeof window !== "undefined" && window.location ? window.location.origin : "";
1436
1452
  if (origin && origin !== "null" && /^https?:/i.test(origin)) {
1437
- const prefix = base2.startsWith("/") ? base2 : `/${base2}`;
1453
+ const prefix = base.startsWith("/") ? base : `/${base}`;
1438
1454
  return `${join(origin + prefix)}${assetName}`;
1439
1455
  }
1440
- const normalized = base2.startsWith("/") ? base2 : `/${base2}`;
1456
+ const normalized = base.startsWith("/") ? base : `/${base}`;
1441
1457
  return `${join(normalized)}${assetName}`;
1442
1458
  }
1443
1459
  function getDoc(root) {
@@ -1483,9 +1499,9 @@ async function adoptConstructable(root, assetName) {
1483
1499
  if (!res.ok)
1484
1500
  return null;
1485
1501
  const cssText = await res.text();
1486
- const sheet2 = new CSSStyleSheet;
1487
- sheet2.replaceSync(cssText);
1488
- return sheet2;
1502
+ const sheet = new CSSStyleSheet;
1503
+ sheet.replaceSync(cssText);
1504
+ return sheet;
1489
1505
  } catch {
1490
1506
  return null;
1491
1507
  }
@@ -1535,8 +1551,8 @@ var init_css_loader = __esm(() => {
1535
1551
  });
1536
1552
 
1537
1553
  // src/core/signingEngine/uiConfirm/ui/lit-components/Drawer/index.ts
1538
- function clamp(n6, min, max) {
1539
- return Math.max(min, Math.min(max, n6));
1554
+ function clamp(n, min, max) {
1555
+ return Math.max(min, Math.min(max, n));
1540
1556
  }
1541
1557
  var SHEET_HEIGHT_VH = 100, DEFAULT_VISIBLE_VH = 50, FLICK_UP_CLOSE_THRESHOLD = -0.6, FLICK_DOWN_CLOSE_THRESHOLD = 0.7, NEAR_CLOSED_PX = 50, OVERPULL_SHEET_FACTOR = 0.5, OVERPULL_VIEWPORT_FACTOR = 0.5, DrawerElement, Drawer_default;
1542
1558
  var init_Drawer = __esm(() => {
@@ -1558,44 +1574,185 @@ var init_Drawer = __esm(() => {
1558
1574
  height: { type: String },
1559
1575
  overpullPx: { type: Number, attribute: "overpull-px" }
1560
1576
  };
1561
- isDragging = false;
1562
- pendingDrag = false;
1563
- startY = 0;
1564
- currentY = 0;
1565
- dragDistance = 0;
1566
- lastDragTime = 0;
1567
- velocity = 0;
1568
- drawerElement = null;
1569
- overlayElement = null;
1570
- bodyElement = null;
1571
- drawerHeight = 0;
1572
- startTranslateYPx = 0;
1573
- openRestTranslateYPx = 0;
1574
- dragStartTime = 0;
1575
- isClosing = false;
1576
- aboveFoldResizeObserver;
1577
- drawerResizeObserver;
1578
- detachViewportSync;
1579
- _syncRAF = null;
1580
- _lastOpenTranslatePct;
1581
- _contentAnimRAF = null;
1582
- _activeHeightTransitions = 0;
1583
- detachContentAnimSync;
1584
- _initialMount = true;
1585
- _firstOpen = true;
1586
- _stylesReady = false;
1587
- _stylePromises = [];
1588
- _stylesAwaiting = null;
1589
- _childObserver = null;
1590
1577
  createRenderRoot() {
1591
1578
  const root = this;
1592
- const p4 = ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css");
1593
- this._stylePromises.push(p4);
1594
- p4.catch(() => {});
1579
+ const p = ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css");
1580
+ this._stylePromises.push(p);
1581
+ p.catch(() => {});
1595
1582
  return root;
1596
1583
  }
1597
1584
  constructor() {
1598
1585
  super();
1586
+ this.isDragging = false;
1587
+ this.pendingDrag = false;
1588
+ this.startY = 0;
1589
+ this.currentY = 0;
1590
+ this.dragDistance = 0;
1591
+ this.lastDragTime = 0;
1592
+ this.velocity = 0;
1593
+ this.drawerElement = null;
1594
+ this.overlayElement = null;
1595
+ this.bodyElement = null;
1596
+ this.drawerHeight = 0;
1597
+ this.startTranslateYPx = 0;
1598
+ this.openRestTranslateYPx = 0;
1599
+ this.dragStartTime = 0;
1600
+ this.isClosing = false;
1601
+ this._syncRAF = null;
1602
+ this._contentAnimRAF = null;
1603
+ this._activeHeightTransitions = 0;
1604
+ this._initialMount = true;
1605
+ this._firstOpen = true;
1606
+ this._stylesReady = false;
1607
+ this._stylePromises = [];
1608
+ this._stylesAwaiting = null;
1609
+ this._childObserver = null;
1610
+ this._initialChildren = null;
1611
+ this.handleTransitionEnd = (e) => {
1612
+ if (!this.drawerElement)
1613
+ return;
1614
+ if (e.target !== this.drawerElement)
1615
+ return;
1616
+ if (e.propertyName !== "transform")
1617
+ return;
1618
+ const type = this.open ? "w3a:drawer-open-end" : "w3a:drawer-close-end";
1619
+ this.dispatchEvent(new CustomEvent(type, { bubbles: true, composed: true }));
1620
+ };
1621
+ this.handlePointerDown = (e) => {
1622
+ if (this.loading || !this.open)
1623
+ return;
1624
+ if (e.pointerType === "mouse" && e.button !== 0)
1625
+ return;
1626
+ this.pendingDrag = true;
1627
+ this.startY = e.clientY;
1628
+ this.currentY = e.clientY;
1629
+ this.dragStartTime = Date.now();
1630
+ };
1631
+ this.handlePointerMove = (e) => {
1632
+ if (!this.pendingDrag && !this.isDragging)
1633
+ return;
1634
+ const y = e.clientY;
1635
+ if (this.pendingDrag) {
1636
+ const dy = y - this.startY;
1637
+ const absDy = Math.abs(dy);
1638
+ const ACTIVATE_PX = 8;
1639
+ const body = this.bodyElement;
1640
+ const atTop = !body || body.scrollTop <= 0;
1641
+ if (absDy >= ACTIVATE_PX && atTop) {
1642
+ this.pendingDrag = false;
1643
+ this.startDrag(this.startY);
1644
+ e.target?.setPointerCapture?.(e.pointerId);
1645
+ } else {
1646
+ return;
1647
+ }
1648
+ }
1649
+ if (this.isDragging) {
1650
+ this.updateDrag(y);
1651
+ e.preventDefault();
1652
+ }
1653
+ };
1654
+ this.handlePointerUp = (e) => {
1655
+ if (this.pendingDrag) {
1656
+ this.pendingDrag = false;
1657
+ }
1658
+ if (this.isDragging) {
1659
+ this.endDrag();
1660
+ e.preventDefault();
1661
+ }
1662
+ e.target?.releasePointerCapture?.(e.pointerId);
1663
+ };
1664
+ this.handlePointerCancel = (e) => {
1665
+ if (this.pendingDrag)
1666
+ this.pendingDrag = false;
1667
+ if (this.isDragging)
1668
+ this.endDrag();
1669
+ e.target?.releasePointerCapture?.(e.pointerId);
1670
+ };
1671
+ this.handleTouchStart = (e) => {
1672
+ if (this.loading || !this.open)
1673
+ return;
1674
+ const target = e.target;
1675
+ if (target && target.closest && target.closest(".close-btn")) {
1676
+ return;
1677
+ }
1678
+ const touch = e.touches[0];
1679
+ this.pendingDrag = true;
1680
+ this.startY = touch.clientY;
1681
+ this.currentY = touch.clientY;
1682
+ };
1683
+ this.handleTouchMove = (e) => {
1684
+ const touch = e.touches[0];
1685
+ if (this.pendingDrag && !this.isDragging) {
1686
+ const dy = touch.clientY - this.startY;
1687
+ const absDy = Math.abs(dy);
1688
+ const ACTIVATE_PX = 8;
1689
+ const body = this.bodyElement;
1690
+ const atTop = !body || body.scrollTop <= 0;
1691
+ if (absDy >= ACTIVATE_PX) {
1692
+ if (atTop) {
1693
+ this.startDrag(this.startY);
1694
+ this.isDragging = true;
1695
+ this.pendingDrag = false;
1696
+ }
1697
+ }
1698
+ }
1699
+ if (!this.isDragging)
1700
+ return;
1701
+ this.updateDrag(touch.clientY);
1702
+ e.preventDefault();
1703
+ };
1704
+ this.handleTouchEnd = (e) => {
1705
+ this.pendingDrag = false;
1706
+ if (!this.isDragging)
1707
+ return;
1708
+ this.endDrag();
1709
+ e.preventDefault();
1710
+ };
1711
+ this.handleMouseDown = (e) => {
1712
+ if (this.loading || !this.open)
1713
+ return;
1714
+ this.startDrag(e.clientY);
1715
+ e.preventDefault();
1716
+ };
1717
+ this.handleMouseMove = (e) => {
1718
+ if (!this.isDragging)
1719
+ return;
1720
+ this.updateDrag(e.clientY);
1721
+ e.preventDefault();
1722
+ };
1723
+ this.handleMouseUp = (e) => {
1724
+ if (!this.isDragging)
1725
+ return;
1726
+ this.endDrag();
1727
+ e.preventDefault();
1728
+ };
1729
+ this.onClose = () => {
1730
+ if (this.loading)
1731
+ return;
1732
+ if (this.isClosing)
1733
+ return;
1734
+ if (this.drawerElement) {
1735
+ this.drawerElement.classList.remove("dragging");
1736
+ }
1737
+ this.open = false;
1738
+ dispatchLitCancel(this);
1739
+ this.isClosing = true;
1740
+ setTimeout(() => {
1741
+ this.isClosing = false;
1742
+ }, 300);
1743
+ };
1744
+ this.onHandleClick = () => {
1745
+ if (!this.open) {
1746
+ this.show();
1747
+ } else {
1748
+ this.hide("handle");
1749
+ }
1750
+ };
1751
+ this.onOverlayClick = () => {
1752
+ if (!this.closeOnOverlayClick)
1753
+ return;
1754
+ this.onClose();
1755
+ };
1599
1756
  this.open = false;
1600
1757
  this.theme = "dark";
1601
1758
  this.appearance = undefined;
@@ -1609,13 +1766,12 @@ var init_Drawer = __esm(() => {
1609
1766
  getComponentPrefix() {
1610
1767
  return "modal";
1611
1768
  }
1612
- _initialChildren = null;
1613
1769
  connectedCallback() {
1614
1770
  if (!this._initialChildren) {
1615
1771
  this._initialChildren = Array.from(this.childNodes);
1616
1772
  try {
1617
- for (const n6 of this._initialChildren)
1618
- this.removeChild(n6);
1773
+ for (const n of this._initialChildren)
1774
+ this.removeChild(n);
1619
1775
  } catch {}
1620
1776
  }
1621
1777
  super.connectedCallback();
@@ -1626,7 +1782,7 @@ var init_Drawer = __esm(() => {
1626
1782
  if (this._stylesReady)
1627
1783
  return true;
1628
1784
  if (!this._stylesAwaiting) {
1629
- const settle = Promise.all(this._stylePromises).then(() => new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6()))));
1785
+ const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
1630
1786
  this._stylesAwaiting = settle.then(() => {
1631
1787
  this._stylesReady = true;
1632
1788
  this.requestUpdate();
@@ -1723,17 +1879,17 @@ var init_Drawer = __esm(() => {
1723
1879
  return;
1724
1880
  const host = this;
1725
1881
  const toMove = [];
1726
- host.childNodes.forEach((n6) => {
1727
- if (n6.nodeType !== Node.ELEMENT_NODE)
1882
+ host.childNodes.forEach((n) => {
1883
+ if (n.nodeType !== Node.ELEMENT_NODE)
1728
1884
  return;
1729
- const el = n6;
1885
+ const el = n;
1730
1886
  if (el.classList?.contains("overlay"))
1731
1887
  return;
1732
1888
  if (el.classList?.contains("drawer"))
1733
1889
  return;
1734
- toMove.push(n6);
1890
+ toMove.push(n);
1735
1891
  });
1736
- toMove.forEach((n6) => above.appendChild(n6));
1892
+ toMove.forEach((n) => above.appendChild(n));
1737
1893
  this.syncCssVarsForOpenTranslate();
1738
1894
  }
1739
1895
  get contentRoot() {
@@ -1741,10 +1897,10 @@ var init_Drawer = __esm(() => {
1741
1897
  return root && root.querySelector(".above-fold") || null;
1742
1898
  }
1743
1899
  getVisibleVh() {
1744
- const h5 = (this.height || "").trim();
1745
- const m3 = h5.match(/^([0-9]+(?:\.[0-9]+)?)\s*(d?vh|svh|lvh|vh)$/i);
1746
- if (m3)
1747
- return clamp(parseFloat(m3[1]), 0, 100);
1900
+ const h = (this.height || "").trim();
1901
+ const m = h.match(/^([0-9]+(?:\.[0-9]+)?)\s*(d?vh|svh|lvh|vh)$/i);
1902
+ if (m)
1903
+ return clamp(parseFloat(m[1]), 0, 100);
1748
1904
  return DEFAULT_VISIBLE_VH;
1749
1905
  }
1750
1906
  getOpenTranslateRatio() {
@@ -1757,15 +1913,15 @@ var init_Drawer = __esm(() => {
1757
1913
  return;
1758
1914
  if (this.isDragging || this.pendingDrag)
1759
1915
  return;
1760
- const h5 = (this.height || "").trim();
1761
- const m3 = h5.match(/^([0-9]+(?:\.[0-9]+)?)\s*(d?vh|svh|lvh|vh)$/i);
1762
- if (m3) {
1763
- const unit2 = (m3[2] || "vh").toLowerCase();
1764
- const visibleVh = clamp(parseFloat(m3[1]), 0, 100);
1765
- const pct2 = clamp(100 - visibleVh, 0, 100);
1766
- this.setCssVars({ "--w3a-drawer__sheet-height": `100${unit2}` });
1916
+ const h = (this.height || "").trim();
1917
+ const m = h.match(/^([0-9]+(?:\.[0-9]+)?)\s*(d?vh|svh|lvh|vh)$/i);
1918
+ if (m) {
1919
+ const unit = (m[2] || "vh").toLowerCase();
1920
+ const visibleVh = clamp(parseFloat(m[1]), 0, 100);
1921
+ const pct = clamp(100 - visibleVh, 0, 100);
1922
+ this.setCssVars({ "--w3a-drawer__sheet-height": `100${unit}` });
1767
1923
  if (!this.open) {
1768
- this.setCssVars({ "--w3a-drawer__open-translate": pct2 + "%" });
1924
+ this.setCssVars({ "--w3a-drawer__open-translate": pct + "%" });
1769
1925
  }
1770
1926
  return;
1771
1927
  }
@@ -1798,16 +1954,6 @@ var init_Drawer = __esm(() => {
1798
1954
  this._performSyncCssVarsForOpenTranslate();
1799
1955
  });
1800
1956
  }
1801
- handleTransitionEnd = (e6) => {
1802
- if (!this.drawerElement)
1803
- return;
1804
- if (e6.target !== this.drawerElement)
1805
- return;
1806
- if (e6.propertyName !== "transform")
1807
- return;
1808
- const type = this.open ? "w3a:drawer-open-end" : "w3a:drawer-close-end";
1809
- this.dispatchEvent(new CustomEvent(type, { bubbles: true, composed: true }));
1810
- };
1811
1957
  setupAnimateWithContentSync() {
1812
1958
  const root = this.renderRoot;
1813
1959
  const host = root.querySelector(".drawer");
@@ -1832,12 +1978,12 @@ var init_Drawer = __esm(() => {
1832
1978
  };
1833
1979
  const syncTimingFromElement = (el) => {
1834
1980
  const cs = getComputedStyle(el);
1835
- const props = (cs.transitionProperty || "").split(",").map((s6) => s6.trim());
1836
- const durations = (cs.transitionDuration || "").split(",").map((s6) => s6.trim());
1837
- const easings = (cs.transitionTimingFunction || "").split(",").map((s6) => s6.trim());
1838
- let idx = props.findIndex((p4) => p4 === "height");
1981
+ const props = (cs.transitionProperty || "").split(",").map((s) => s.trim());
1982
+ const durations = (cs.transitionDuration || "").split(",").map((s) => s.trim());
1983
+ const easings = (cs.transitionTimingFunction || "").split(",").map((s) => s.trim());
1984
+ let idx = props.findIndex((p) => p === "height");
1839
1985
  if (idx < 0)
1840
- idx = props.findIndex((p4) => p4 === "all");
1986
+ idx = props.findIndex((p) => p === "all");
1841
1987
  if (idx < 0)
1842
1988
  idx = 0;
1843
1989
  const dur = durations[Math.min(idx, durations.length - 1)] || "100ms";
@@ -1848,28 +1994,28 @@ var init_Drawer = __esm(() => {
1848
1994
  });
1849
1995
  };
1850
1996
  const onRun = (ev) => {
1851
- const e6 = ev;
1997
+ const e = ev;
1852
1998
  if (!this.open)
1853
1999
  return;
1854
- if (e6.propertyName !== "height")
2000
+ if (e.propertyName !== "height")
1855
2001
  return;
1856
2002
  this._activeHeightTransitions++;
1857
2003
  ensureLoop();
1858
2004
  };
1859
2005
  const onStart = (ev) => {
1860
- const e6 = ev;
2006
+ const e = ev;
1861
2007
  if (!this.open)
1862
2008
  return;
1863
- if (e6.propertyName !== "height")
2009
+ if (e.propertyName !== "height")
1864
2010
  return;
1865
- if (e6.target && e6.target instanceof Element)
1866
- syncTimingFromElement(e6.target);
2011
+ if (e.target && e.target instanceof Element)
2012
+ syncTimingFromElement(e.target);
1867
2013
  this._activeHeightTransitions++;
1868
2014
  ensureLoop();
1869
2015
  };
1870
2016
  const onEnd = (ev) => {
1871
- const e6 = ev;
1872
- if (e6.propertyName !== "height")
2017
+ const e = ev;
2018
+ if (e.propertyName !== "height")
1873
2019
  return;
1874
2020
  this._activeHeightTransitions = Math.max(0, this._activeHeightTransitions - 1);
1875
2021
  if (this._activeHeightTransitions === 0)
@@ -1965,118 +2111,10 @@ var init_Drawer = __esm(() => {
1965
2111
  document.removeEventListener("pointerup", this.handlePointerUp);
1966
2112
  document.removeEventListener("pointercancel", this.handlePointerCancel);
1967
2113
  }
1968
- handlePointerDown = (e6) => {
1969
- if (this.loading || !this.open)
1970
- return;
1971
- if (e6.pointerType === "mouse" && e6.button !== 0)
1972
- return;
1973
- this.pendingDrag = true;
1974
- this.startY = e6.clientY;
1975
- this.currentY = e6.clientY;
1976
- this.dragStartTime = Date.now();
1977
- };
1978
- handlePointerMove = (e6) => {
1979
- if (!this.pendingDrag && !this.isDragging)
1980
- return;
1981
- const y3 = e6.clientY;
1982
- if (this.pendingDrag) {
1983
- const dy = y3 - this.startY;
1984
- const absDy = Math.abs(dy);
1985
- const ACTIVATE_PX = 8;
1986
- const body = this.bodyElement;
1987
- const atTop = !body || body.scrollTop <= 0;
1988
- if (absDy >= ACTIVATE_PX && atTop) {
1989
- this.pendingDrag = false;
1990
- this.startDrag(this.startY);
1991
- e6.target?.setPointerCapture?.(e6.pointerId);
1992
- } else {
1993
- return;
1994
- }
1995
- }
1996
- if (this.isDragging) {
1997
- this.updateDrag(y3);
1998
- e6.preventDefault();
1999
- }
2000
- };
2001
- handlePointerUp = (e6) => {
2002
- if (this.pendingDrag) {
2003
- this.pendingDrag = false;
2004
- }
2005
- if (this.isDragging) {
2006
- this.endDrag();
2007
- e6.preventDefault();
2008
- }
2009
- e6.target?.releasePointerCapture?.(e6.pointerId);
2010
- };
2011
- handlePointerCancel = (e6) => {
2012
- if (this.pendingDrag)
2013
- this.pendingDrag = false;
2014
- if (this.isDragging)
2015
- this.endDrag();
2016
- e6.target?.releasePointerCapture?.(e6.pointerId);
2017
- };
2018
- handleTouchStart = (e6) => {
2019
- if (this.loading || !this.open)
2020
- return;
2021
- const target = e6.target;
2022
- if (target && target.closest && target.closest(".close-btn")) {
2023
- return;
2024
- }
2025
- const touch = e6.touches[0];
2026
- this.pendingDrag = true;
2027
- this.startY = touch.clientY;
2028
- this.currentY = touch.clientY;
2029
- };
2030
- handleTouchMove = (e6) => {
2031
- const touch = e6.touches[0];
2032
- if (this.pendingDrag && !this.isDragging) {
2033
- const dy = touch.clientY - this.startY;
2034
- const absDy = Math.abs(dy);
2035
- const ACTIVATE_PX = 8;
2036
- const body = this.bodyElement;
2037
- const atTop = !body || body.scrollTop <= 0;
2038
- if (absDy >= ACTIVATE_PX) {
2039
- if (atTop) {
2040
- this.startDrag(this.startY);
2041
- this.isDragging = true;
2042
- this.pendingDrag = false;
2043
- } else {}
2044
- }
2045
- }
2046
- if (!this.isDragging)
2047
- return;
2048
- this.updateDrag(touch.clientY);
2049
- e6.preventDefault();
2050
- };
2051
- handleTouchEnd = (e6) => {
2052
- this.pendingDrag = false;
2053
- if (!this.isDragging)
2054
- return;
2055
- this.endDrag();
2056
- e6.preventDefault();
2057
- };
2058
- handleMouseDown = (e6) => {
2059
- if (this.loading || !this.open)
2060
- return;
2061
- this.startDrag(e6.clientY);
2062
- e6.preventDefault();
2063
- };
2064
- handleMouseMove = (e6) => {
2065
- if (!this.isDragging)
2066
- return;
2067
- this.updateDrag(e6.clientY);
2068
- e6.preventDefault();
2069
- };
2070
- handleMouseUp = (e6) => {
2071
- if (!this.isDragging)
2072
- return;
2073
- this.endDrag();
2074
- e6.preventDefault();
2075
- };
2076
- startDrag(y3) {
2114
+ startDrag(y) {
2077
2115
  this.isDragging = true;
2078
- this.startY = y3;
2079
- this.currentY = y3;
2116
+ this.startY = y;
2117
+ this.currentY = y;
2080
2118
  this.dragDistance = 0;
2081
2119
  this.dragStartTime = Date.now();
2082
2120
  this.lastDragTime = this.dragStartTime;
@@ -2097,17 +2135,17 @@ var init_Drawer = __esm(() => {
2097
2135
  this.drawerElement.classList.add("dragging");
2098
2136
  }
2099
2137
  }
2100
- updateDrag(y3) {
2138
+ updateDrag(y) {
2101
2139
  if (!this.isDragging || !this.drawerElement)
2102
2140
  return;
2103
2141
  const now = Date.now();
2104
2142
  const deltaTime = now - this.lastDragTime;
2105
- const deltaY = y3 - this.currentY;
2143
+ const deltaY = y - this.currentY;
2106
2144
  if (deltaTime > 0) {
2107
2145
  this.velocity = deltaY / deltaTime;
2108
2146
  }
2109
- this.currentY = y3;
2110
- this.dragDistance = y3 - this.startY;
2147
+ this.currentY = y;
2148
+ this.dragDistance = y - this.startY;
2111
2149
  const viewportHalf = typeof window !== "undefined" && window.innerHeight ? window.innerHeight * OVERPULL_VIEWPORT_FACTOR : 0;
2112
2150
  const maxOverdragUpPx = Math.max(this.drawerHeight * OVERPULL_SHEET_FACTOR, viewportHalf, this.overpullPx);
2113
2151
  const rawTargetTranslateY = this.startTranslateYPx + this.dragDistance;
@@ -2161,11 +2199,11 @@ var init_Drawer = __esm(() => {
2161
2199
  if (!transform || transform === "none")
2162
2200
  return NaN;
2163
2201
  if (transform.startsWith("matrix(")) {
2164
- const values = transform.slice(7, -1).split(",").map((v3) => parseFloat(v3.trim()));
2202
+ const values = transform.slice(7, -1).split(",").map((v) => parseFloat(v.trim()));
2165
2203
  return values.length === 6 ? values[5] : NaN;
2166
2204
  }
2167
2205
  if (transform.startsWith("matrix3d(")) {
2168
- const values = transform.slice(9, -1).split(",").map((v3) => parseFloat(v3.trim()));
2206
+ const values = transform.slice(9, -1).split(",").map((v) => parseFloat(v.trim()));
2169
2207
  return values.length === 16 ? values[13] : NaN;
2170
2208
  }
2171
2209
  const match = transform.match(/translateY\(([-\d.]+)px\)/);
@@ -2186,28 +2224,6 @@ var init_Drawer = __esm(() => {
2186
2224
  this.isClosing = false;
2187
2225
  }, 300);
2188
2226
  }
2189
- onClose = () => {
2190
- if (this.loading)
2191
- return;
2192
- if (this.isClosing)
2193
- return;
2194
- if (this.drawerElement) {
2195
- this.drawerElement.classList.remove("dragging");
2196
- }
2197
- this.open = false;
2198
- dispatchLitCancel(this);
2199
- this.isClosing = true;
2200
- setTimeout(() => {
2201
- this.isClosing = false;
2202
- }, 300);
2203
- };
2204
- onHandleClick = () => {
2205
- if (!this.open) {
2206
- this.show();
2207
- } else {
2208
- this.hide("handle");
2209
- }
2210
- };
2211
2227
  show() {
2212
2228
  if (this.drawerElement) {
2213
2229
  this.drawerElement.classList.remove("dragging");
@@ -2257,11 +2273,6 @@ var init_Drawer = __esm(() => {
2257
2273
  </section>
2258
2274
  `;
2259
2275
  }
2260
- onOverlayClick = () => {
2261
- if (!this.closeOnOverlayClick)
2262
- return;
2263
- this.onClose();
2264
- };
2265
2276
  };
2266
2277
  Drawer_default = function ensureDefined() {
2267
2278
  const TAG = W3A_DRAWER_ID;
@@ -2273,74 +2284,74 @@ var init_Drawer = __esm(() => {
2273
2284
  });
2274
2285
 
2275
2286
  // ../../node_modules/lit-html/directives/repeat.js
2276
- var u4 = (e6, s6, t5) => {
2277
- const r6 = new Map;
2278
- for (let l3 = s6;l3 <= t5; l3++)
2279
- r6.set(e6[l3], l3);
2280
- return r6;
2287
+ var u4 = (e, s, t) => {
2288
+ const r = new Map;
2289
+ for (let l = s;l <= t; l++)
2290
+ r.set(e[l], l);
2291
+ return r;
2281
2292
  }, c5;
2282
2293
  var init_repeat = __esm(() => {
2283
2294
  init_lit_html();
2284
2295
  init_directive();
2285
2296
  init_directive_helpers();
2286
2297
  c5 = e4(class extends i5 {
2287
- constructor(e6) {
2288
- if (super(e6), e6.type !== t4.CHILD)
2298
+ constructor(e) {
2299
+ if (super(e), e.type !== t4.CHILD)
2289
2300
  throw Error("repeat() can only be used in text expressions");
2290
2301
  }
2291
- dt(e6, s6, t5) {
2292
- let r6;
2293
- t5 === undefined ? t5 = s6 : s6 !== undefined && (r6 = s6);
2294
- const l3 = [], o7 = [];
2295
- let i6 = 0;
2296
- for (const s7 of e6)
2297
- l3[i6] = r6 ? r6(s7, i6) : i6, o7[i6] = t5(s7, i6), i6++;
2298
- return { values: o7, keys: l3 };
2299
- }
2300
- render(e6, s6, t5) {
2301
- return this.dt(e6, s6, t5).values;
2302
- }
2303
- update(s6, [t5, r6, c6]) {
2304
- const d3 = p3(s6), { values: p4, keys: a3 } = this.dt(t5, r6, c6);
2305
- if (!Array.isArray(d3))
2306
- return this.ut = a3, p4;
2307
- const h5 = this.ut ??= [], v3 = [];
2308
- let m3, y3, x2 = 0, j2 = d3.length - 1, k2 = 0, w2 = p4.length - 1;
2309
- for (;x2 <= j2 && k2 <= w2; )
2310
- if (d3[x2] === null)
2311
- x2++;
2312
- else if (d3[j2] === null)
2313
- j2--;
2314
- else if (h5[x2] === a3[k2])
2315
- v3[k2] = v2(d3[x2], p4[k2]), x2++, k2++;
2316
- else if (h5[j2] === a3[w2])
2317
- v3[w2] = v2(d3[j2], p4[w2]), j2--, w2--;
2318
- else if (h5[x2] === a3[w2])
2319
- v3[w2] = v2(d3[x2], p4[w2]), s4(s6, v3[w2 + 1], d3[x2]), x2++, w2--;
2320
- else if (h5[j2] === a3[k2])
2321
- v3[k2] = v2(d3[j2], p4[k2]), s4(s6, d3[x2], d3[j2]), j2--, k2++;
2322
- else if (m3 === undefined && (m3 = u4(a3, k2, w2), y3 = u4(h5, x2, j2)), m3.has(h5[x2]))
2323
- if (m3.has(h5[j2])) {
2324
- const e6 = y3.get(a3[k2]), t6 = e6 !== undefined ? d3[e6] : null;
2325
- if (t6 === null) {
2326
- const e7 = s4(s6, d3[x2]);
2327
- v2(e7, p4[k2]), v3[k2] = e7;
2302
+ dt(e, s, t) {
2303
+ let r;
2304
+ t === undefined ? t = s : s !== undefined && (r = s);
2305
+ const l = [], o = [];
2306
+ let i = 0;
2307
+ for (const s of e)
2308
+ l[i] = r ? r(s, i) : i, o[i] = t(s, i), i++;
2309
+ return { values: o, keys: l };
2310
+ }
2311
+ render(e, s, t) {
2312
+ return this.dt(e, s, t).values;
2313
+ }
2314
+ update(s, [t, r, c]) {
2315
+ const d = p3(s), { values: p, keys: a } = this.dt(t, r, c);
2316
+ if (!Array.isArray(d))
2317
+ return this.ut = a, p;
2318
+ const h = this.ut ??= [], v = [];
2319
+ let m, y, x = 0, j = d.length - 1, k = 0, w = p.length - 1;
2320
+ for (;x <= j && k <= w; )
2321
+ if (d[x] === null)
2322
+ x++;
2323
+ else if (d[j] === null)
2324
+ j--;
2325
+ else if (h[x] === a[k])
2326
+ v[k] = v2(d[x], p[k]), x++, k++;
2327
+ else if (h[j] === a[w])
2328
+ v[w] = v2(d[j], p[w]), j--, w--;
2329
+ else if (h[x] === a[w])
2330
+ v[w] = v2(d[x], p[w]), s4(s, v[w + 1], d[x]), x++, w--;
2331
+ else if (h[j] === a[k])
2332
+ v[k] = v2(d[j], p[k]), s4(s, d[x], d[j]), j--, k++;
2333
+ else if (m === undefined && (m = u4(a, k, w), y = u4(h, x, j)), m.has(h[x]))
2334
+ if (m.has(h[j])) {
2335
+ const e = y.get(a[k]), t = e !== undefined ? d[e] : null;
2336
+ if (t === null) {
2337
+ const e = s4(s, d[x]);
2338
+ v2(e, p[k]), v[k] = e;
2328
2339
  } else
2329
- v3[k2] = v2(t6, p4[k2]), s4(s6, d3[x2], t6), d3[e6] = null;
2330
- k2++;
2340
+ v[k] = v2(t, p[k]), s4(s, d[x], t), d[e] = null;
2341
+ k++;
2331
2342
  } else
2332
- M2(d3[j2]), j2--;
2343
+ M2(d[j]), j--;
2333
2344
  else
2334
- M2(d3[x2]), x2++;
2335
- for (;k2 <= w2; ) {
2336
- const e6 = s4(s6, v3[w2 + 1]);
2337
- v2(e6, p4[k2]), v3[k2++] = e6;
2345
+ M2(d[x]), x++;
2346
+ for (;k <= w; ) {
2347
+ const e = s4(s, v[w + 1]);
2348
+ v2(e, p[k]), v[k++] = e;
2338
2349
  }
2339
- for (;x2 <= j2; ) {
2340
- const e6 = d3[x2++];
2341
- e6 !== null && M2(e6);
2350
+ for (;x <= j; ) {
2351
+ const e = d[x++];
2352
+ e !== null && M2(e);
2342
2353
  }
2343
- return this.ut = a3, m2(s6, v3), T;
2354
+ return this.ut = a, m2(s, v), T;
2344
2355
  }
2345
2356
  });
2346
2357
  });
@@ -2524,7 +2535,7 @@ function createHostHeightPin(element) {
2524
2535
  const retired = sheet;
2525
2536
  sheet = null;
2526
2537
  try {
2527
- document.adoptedStyleSheets = document.adoptedStyleSheets.filter((s6) => s6 !== retired);
2538
+ document.adoptedStyleSheets = document.adoptedStyleSheets.filter((s) => s !== retired);
2528
2539
  } catch {}
2529
2540
  }
2530
2541
  };
@@ -2934,8 +2945,8 @@ var fromScale = (prefix, scale) => {
2934
2945
  if (!scale)
2935
2946
  return {};
2936
2947
  const out = {};
2937
- for (const k2 of Object.keys(scale))
2938
- out[`${prefix}${k2}`] = scale[k2];
2948
+ for (const k of Object.keys(scale))
2949
+ out[`${prefix}${k}`] = scale[k];
2939
2950
  return out;
2940
2951
  };
2941
2952
  var init_base_styles = () => {};
@@ -3190,7 +3201,7 @@ function formatArgs(args) {
3190
3201
  if (typeof args === "string")
3191
3202
  return args;
3192
3203
  try {
3193
- return JSON.stringify(args, (_k, v3) => typeof v3 === "bigint" ? v3.toString() : v3, 2);
3204
+ return JSON.stringify(args, (_k, v) => typeof v === "bigint" ? v.toString() : v, 2);
3194
3205
  } catch {
3195
3206
  return String(args);
3196
3207
  }
@@ -3265,6 +3276,98 @@ var init_TxTree = __esm(() => {
3265
3276
  init_registry();
3266
3277
  HEIGHT_DRIVEN_CLASSES = ["anim-h", "anim-h-active", "anim-h-driven"];
3267
3278
  TxTree = class TxTree extends LitElementWithProps {
3279
+ constructor() {
3280
+ super(...arguments);
3281
+ this.showShadow = true;
3282
+ this._copied = new Set;
3283
+ this._copyTimers = new Map;
3284
+ this._fileContentModes = new Map;
3285
+ this._animating = new WeakSet;
3286
+ this.onFileContentToggleClick = (e, node) => {
3287
+ e.preventDefault();
3288
+ e.stopPropagation();
3289
+ if (!this.hasFileContentToggle(node))
3290
+ return;
3291
+ const shell = e.currentTarget?.closest(".file-content-shell") ?? null;
3292
+ const currentMode = this.resolveFileContentMode(node);
3293
+ const nextMode = currentMode === "decoded" ? "raw" : "decoded";
3294
+ const fromCssPx = shell?.getBoundingClientRect().height ?? 0;
3295
+ if (shell) {
3296
+ shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
3297
+ this.setCssVars({ "--w3a-tree__anim-target": `${fromCssPx}px` });
3298
+ }
3299
+ this._fileContentModes.set(node.id, nextMode);
3300
+ this.requestUpdate();
3301
+ if (!shell)
3302
+ return;
3303
+ this.updateComplete.then(() => {
3304
+ shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
3305
+ const toCssPx = shell.getBoundingClientRect().height;
3306
+ shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
3307
+ const claimed = announceClampedSurfaceResize({
3308
+ reason: `${node.id}:file-content-mode`,
3309
+ element: shell,
3310
+ drivenClasses: HEIGHT_DRIVEN_CLASSES,
3311
+ fromCssPx,
3312
+ toCssPx,
3313
+ setHeightCssPx: (px) => this.setCssVars({ "--w3a-tree__anim-target": `${px}px` })
3314
+ });
3315
+ if (!claimed)
3316
+ shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
3317
+ });
3318
+ };
3319
+ this.onSummaryClick = (e) => {
3320
+ const summary = e.currentTarget;
3321
+ if (!summary)
3322
+ return;
3323
+ const path = typeof e.composedPath === "function" ? e.composedPath() : undefined;
3324
+ let clickedReceiverLink = null;
3325
+ if (Array.isArray(path)) {
3326
+ for (const t of path) {
3327
+ if (t instanceof Element && t.matches("a.highlight-receiver-id")) {
3328
+ clickedReceiverLink = t;
3329
+ break;
3330
+ }
3331
+ }
3332
+ } else {
3333
+ const target = e.target;
3334
+ clickedReceiverLink = target?.closest?.("a.highlight-receiver-id") ?? null;
3335
+ }
3336
+ if (clickedReceiverLink) {
3337
+ e.preventDefault();
3338
+ e.stopPropagation();
3339
+ dispatchTxReviewOpenLink(this, { href: clickedReceiverLink.href });
3340
+ try {
3341
+ window.open(clickedReceiverLink.href, "_blank", "noopener");
3342
+ } catch {}
3343
+ return;
3344
+ }
3345
+ e.preventDefault();
3346
+ e.stopPropagation();
3347
+ const details = summary.closest("details");
3348
+ if (!details || this._animating.has(details))
3349
+ return;
3350
+ const body = details.querySelector(":scope > .folder-children, :scope > .row.file-row");
3351
+ if (!body) {
3352
+ details.open = !details.open;
3353
+ this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
3354
+ return;
3355
+ }
3356
+ const reduceMotion = (() => {
3357
+ return typeof window !== "undefined" && "matchMedia" in window ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : false;
3358
+ })();
3359
+ if (reduceMotion) {
3360
+ details.open = !details.open;
3361
+ this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
3362
+ return;
3363
+ }
3364
+ if (!details.open) {
3365
+ this.animateOpen(details, body);
3366
+ } else {
3367
+ this.animateClose(details, body);
3368
+ }
3369
+ };
3370
+ }
3268
3371
  static properties = {
3269
3372
  node: { attribute: false },
3270
3373
  depth: { type: Number, attribute: false },
@@ -3278,26 +3381,11 @@ var init_TxTree = __esm(() => {
3278
3381
  evmExplorerUrl: { type: String, attribute: "evm-explorer-url" },
3279
3382
  showShadow: { type: Boolean, attribute: "show-shadow" }
3280
3383
  };
3281
- node;
3282
- depth;
3283
- theme;
3284
- appearance;
3285
- class;
3286
- width;
3287
- shadowDom;
3288
- nearExplorerUrl;
3289
- tempoExplorerUrl;
3290
- evmExplorerUrl;
3291
- showShadow = true;
3292
- _copied = new Set;
3293
- _copyTimers = new Map;
3294
- _fileContentModes = new Map;
3295
- _animating = new WeakSet;
3296
3384
  isCopied(id) {
3297
3385
  return this._copied.has(id);
3298
3386
  }
3299
- async handleCopyClick(e6, node) {
3300
- e6.stopPropagation();
3387
+ async handleCopyClick(e, node) {
3388
+ e.stopPropagation();
3301
3389
  const value = node.copyValue;
3302
3390
  if (!value)
3303
3391
  return;
@@ -3359,94 +3447,10 @@ var init_TxTree = __esm(() => {
3359
3447
  const mode = this.resolveFileContentMode(node);
3360
3448
  return mode === "raw" ? variants.raw : variants.decoded;
3361
3449
  }
3362
- onFileContentToggleClick = (e6, node) => {
3363
- e6.preventDefault();
3364
- e6.stopPropagation();
3365
- if (!this.hasFileContentToggle(node))
3366
- return;
3367
- const shell = e6.currentTarget?.closest(".file-content-shell") ?? null;
3368
- const currentMode = this.resolveFileContentMode(node);
3369
- const nextMode = currentMode === "decoded" ? "raw" : "decoded";
3370
- const fromCssPx = shell?.getBoundingClientRect().height ?? 0;
3371
- if (shell) {
3372
- shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
3373
- this.setCssVars({ "--w3a-tree__anim-target": `${fromCssPx}px` });
3374
- }
3375
- this._fileContentModes.set(node.id, nextMode);
3376
- this.requestUpdate();
3377
- if (!shell)
3378
- return;
3379
- this.updateComplete.then(() => {
3380
- shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
3381
- const toCssPx = shell.getBoundingClientRect().height;
3382
- shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
3383
- const claimed = announceClampedSurfaceResize({
3384
- reason: `${node.id}:file-content-mode`,
3385
- element: shell,
3386
- drivenClasses: HEIGHT_DRIVEN_CLASSES,
3387
- fromCssPx,
3388
- toCssPx,
3389
- setHeightCssPx: (px) => this.setCssVars({ "--w3a-tree__anim-target": `${px}px` })
3390
- });
3391
- if (!claimed)
3392
- shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
3393
- });
3394
- };
3395
3450
  handleToggle(detail) {
3396
3451
  dispatchLitTreeToggled(this);
3397
3452
  dispatchTxReviewToggleNode(this, detail);
3398
3453
  }
3399
- onSummaryClick = (e6) => {
3400
- const summary = e6.currentTarget;
3401
- if (!summary)
3402
- return;
3403
- const path = typeof e6.composedPath === "function" ? e6.composedPath() : undefined;
3404
- let clickedReceiverLink = null;
3405
- if (Array.isArray(path)) {
3406
- for (const t5 of path) {
3407
- if (t5 instanceof Element && t5.matches("a.highlight-receiver-id")) {
3408
- clickedReceiverLink = t5;
3409
- break;
3410
- }
3411
- }
3412
- } else {
3413
- const target = e6.target;
3414
- clickedReceiverLink = target?.closest?.("a.highlight-receiver-id") ?? null;
3415
- }
3416
- if (clickedReceiverLink) {
3417
- e6.preventDefault();
3418
- e6.stopPropagation();
3419
- dispatchTxReviewOpenLink(this, { href: clickedReceiverLink.href });
3420
- try {
3421
- window.open(clickedReceiverLink.href, "_blank", "noopener");
3422
- } catch {}
3423
- return;
3424
- }
3425
- e6.preventDefault();
3426
- e6.stopPropagation();
3427
- const details = summary.closest("details");
3428
- if (!details || this._animating.has(details))
3429
- return;
3430
- const body = details.querySelector(":scope > .folder-children, :scope > .row.file-row");
3431
- if (!body) {
3432
- details.open = !details.open;
3433
- this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
3434
- return;
3435
- }
3436
- const reduceMotion = (() => {
3437
- return typeof window !== "undefined" && "matchMedia" in window ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : false;
3438
- })();
3439
- if (reduceMotion) {
3440
- details.open = !details.open;
3441
- this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
3442
- return;
3443
- }
3444
- if (!details.open) {
3445
- this.animateOpen(details, body);
3446
- } else {
3447
- this.animateClose(details, body);
3448
- }
3449
- };
3450
3454
  animateOpen(details, body) {
3451
3455
  this._animating.add(details);
3452
3456
  body.classList.add("anim-h", "anim-h-hold");
@@ -3542,9 +3546,9 @@ var init_TxTree = __esm(() => {
3542
3546
  }
3543
3547
  createRenderRoot() {
3544
3548
  if (this.shadowDom) {
3545
- const root2 = super.createRenderRoot();
3546
- ensureExternalStyles(root2, "tx-tree.css", "data-w3a-tx-tree-css").catch(() => {});
3547
- return root2;
3549
+ const root = super.createRenderRoot();
3550
+ ensureExternalStyles(root, "tx-tree.css", "data-w3a-tx-tree-css").catch(() => {});
3551
+ return root;
3548
3552
  }
3549
3553
  ensureExternalStyles(this, "tx-tree.css", "data-w3a-tx-tree-css").catch(() => {});
3550
3554
  const root = this.getRootNode ? this.getRootNode() : null;
@@ -3600,7 +3604,7 @@ var init_TxTree = __esm(() => {
3600
3604
  }
3601
3605
  resolveContractExplorerHref(treeNode, contractAddress) {
3602
3606
  const chain = treeNode.chain;
3603
- const base2 = (() => {
3607
+ const base = (() => {
3604
3608
  if (chain === "tempo")
3605
3609
  return this.normalizeExplorerBase(this.tempoExplorerUrl);
3606
3610
  if (chain === "evm")
@@ -3609,9 +3613,9 @@ var init_TxTree = __esm(() => {
3609
3613
  return this.normalizeExplorerBase(this.nearExplorerUrl || "https://testnet.nearblocks.io");
3610
3614
  return;
3611
3615
  })();
3612
- if (!base2)
3616
+ if (!base)
3613
3617
  return;
3614
- return `${base2}/address/${encodeURIComponent(contractAddress)}`;
3618
+ return `${base}/address/${encodeURIComponent(contractAddress)}`;
3615
3619
  }
3616
3620
  renderContractTransactionLabel(treeNode) {
3617
3621
  const contractAddress = String(treeNode.contractAddress || "").trim();
@@ -3653,17 +3657,17 @@ var init_TxTree = __esm(() => {
3653
3657
  }
3654
3658
  renderLabelWithSelectiveHighlight(treeNode) {
3655
3659
  if (treeNode.action) {
3656
- const a3 = treeNode.action;
3657
- switch (a3.type) {
3660
+ const a = treeNode.action;
3661
+ switch (a.type) {
3658
3662
  case "FunctionCall": {
3659
- const method = a3.methodName;
3660
- const gasStr = formatGas(a3.gas);
3661
- const depositStr = formatDeposit(a3.deposit);
3663
+ const method = a.methodName;
3664
+ const gasStr = formatGas(a.gas);
3665
+ const depositStr = formatDeposit(a.deposit);
3662
3666
  return x`Calling <span class="highlight-method-name">${method}</span> ${depositStr !== "0 NEAR" ? x` with <span class="highlight-method-name">${depositStr}</span>` : ""}
3663
3667
  ${gasStr ? x` using <span class="highlight-method-name">${gasStr}</span>` : ""}`;
3664
3668
  }
3665
3669
  case "Transfer": {
3666
- const amount = formatDeposit(a3.amount);
3670
+ const amount = formatDeposit(a.amount);
3667
3671
  return x`Transfer <span class="highlight-amount">${amount}</span>`;
3668
3672
  }
3669
3673
  case "CreateAccount":
@@ -3671,26 +3675,26 @@ var init_TxTree = __esm(() => {
3671
3675
  case "DeleteAccount":
3672
3676
  return "Deleting Account";
3673
3677
  case "Stake":
3674
- return `Staking ${formatDeposit(a3.stake)}`;
3678
+ return `Staking ${formatDeposit(a.stake)}`;
3675
3679
  case "AddKey":
3676
3680
  return "Adding Key";
3677
3681
  case "DeleteKey":
3678
3682
  return "Deleting Key";
3679
3683
  case "DeployContract": {
3680
- const codeSize = formatCodeSize(a3.code);
3684
+ const codeSize = formatCodeSize(a.code);
3681
3685
  return `Deploying WASM contract (${codeSize})`;
3682
3686
  }
3683
3687
  case "DeployGlobalContract": {
3684
- const codeSize = formatCodeSize(a3.code);
3685
- const mode = a3.deployMode || "Unknown";
3688
+ const codeSize = formatCodeSize(a.code);
3689
+ const mode = a.deployMode || "Unknown";
3686
3690
  return `Deploy global WASM contract (mode: ${String(mode)}, size ${codeSize})`;
3687
3691
  }
3688
3692
  case "UseGlobalContract": {
3689
- const accountId = a3.accountId;
3690
- const codeHash = a3.codeHash;
3693
+ const accountId = a.accountId;
3694
+ const codeHash = a.codeHash;
3691
3695
  if (accountId) {
3692
- const base2 = (this.nearExplorerUrl || "https://testnet.nearblocks.io").replace(/\/$/, "");
3693
- const href = `${base2}/address/${encodeURIComponent(String(accountId))}`;
3696
+ const base = (this.nearExplorerUrl || "https://testnet.nearblocks.io").replace(/\/$/, "");
3697
+ const href = `${base}/address/${encodeURIComponent(String(accountId))}`;
3694
3698
  return x`Use global contract
3695
3699
  <a
3696
3700
  class="highlight-receiver-id"
@@ -3709,7 +3713,7 @@ var init_TxTree = __esm(() => {
3709
3713
  }
3710
3714
  default: {
3711
3715
  const idxText = isNumber(treeNode.actionIndex) ? ` ${treeNode.actionIndex + 1}` : "";
3712
- const typeText = a3.type || "Unknown";
3716
+ const typeText = a.type || "Unknown";
3713
3717
  return `Action${idxText}: ${typeText}`;
3714
3718
  }
3715
3719
  }
@@ -3719,8 +3723,8 @@ var init_TxTree = __esm(() => {
3719
3723
  const idx = treeNode.transactionIndex ?? 0;
3720
3724
  const prefix = total > 1 ? `Transaction ${idx + 1}: to ` : "Transaction to ";
3721
3725
  const receiverId = treeNode.transaction.receiverId;
3722
- const base2 = (this.nearExplorerUrl || "https://testnet.nearblocks.io").replace(/\/$/, "");
3723
- const href = `${base2}/address/${encodeURIComponent(receiverId)}`;
3726
+ const base = (this.nearExplorerUrl || "https://testnet.nearblocks.io").replace(/\/$/, "");
3727
+ const href = `${base}/address/${encodeURIComponent(receiverId)}`;
3724
3728
  return x`${prefix}<a
3725
3729
  class="highlight-receiver-id"
3726
3730
  href=${href}
@@ -3739,22 +3743,22 @@ var init_TxTree = __esm(() => {
3739
3743
  }
3740
3744
  computePlainLabel(treeNode) {
3741
3745
  if (treeNode.action) {
3742
- const a3 = treeNode.action;
3743
- switch (a3.type) {
3746
+ const a = treeNode.action;
3747
+ switch (a.type) {
3744
3748
  case "FunctionCall": {
3745
- const method = a3.methodName;
3746
- const gasStr = formatGas(a3.gas);
3747
- const depositStr = formatDeposit(a3.deposit);
3749
+ const method = a.methodName;
3750
+ const gasStr = formatGas(a.gas);
3751
+ const depositStr = formatDeposit(a.deposit);
3748
3752
  return `Calling ${method} with ${depositStr} using ${gasStr}`;
3749
3753
  }
3750
3754
  case "Transfer":
3751
- return `Transfer ${formatDeposit(a3.amount)}`;
3755
+ return `Transfer ${formatDeposit(a.amount)}`;
3752
3756
  case "CreateAccount":
3753
3757
  return "Creating Account";
3754
3758
  case "DeleteAccount":
3755
3759
  return "Deleting Account";
3756
3760
  case "Stake":
3757
- return `Staking ${formatDeposit(a3.stake)}`;
3761
+ return `Staking ${formatDeposit(a.stake)}`;
3758
3762
  case "AddKey":
3759
3763
  return "Adding Key";
3760
3764
  case "DeleteKey":
@@ -3762,13 +3766,13 @@ var init_TxTree = __esm(() => {
3762
3766
  case "DeployContract":
3763
3767
  return "Deploying WASM contract";
3764
3768
  case "DeployGlobalContract": {
3765
- const codeSize = formatCodeSize(a3.code);
3766
- const mode = a3.deployMode || "Unknown";
3769
+ const codeSize = formatCodeSize(a.code);
3770
+ const mode = a.deployMode || "Unknown";
3767
3771
  return `Deploy global WASM contract (mode: ${String(mode)}, size ${codeSize})`;
3768
3772
  }
3769
3773
  case "UseGlobalContract": {
3770
- const accountId = a3.accountId;
3771
- const codeHash = a3.codeHash;
3774
+ const accountId = a.accountId;
3775
+ const codeHash = a.codeHash;
3772
3776
  if (accountId) {
3773
3777
  return `Use global contract by account ${String(accountId)}`;
3774
3778
  }
@@ -3779,7 +3783,7 @@ var init_TxTree = __esm(() => {
3779
3783
  }
3780
3784
  default: {
3781
3785
  const idxText = isNumber(treeNode.actionIndex) ? ` ${treeNode.actionIndex + 1}` : "";
3782
- const typeText = a3.type || "Unknown";
3786
+ const typeText = a.type || "Unknown";
3783
3787
  return `Action${idxText}: ${typeText}`;
3784
3788
  }
3785
3789
  }
@@ -3822,7 +3826,7 @@ var init_TxTree = __esm(() => {
3822
3826
  ${node.copyValue ? x` <span
3823
3827
  class="copy-badge"
3824
3828
  data-copied=${this.isCopied(node.id)}
3825
- @click=${(e6) => this.handleCopyClick(e6, node)}
3829
+ @click=${(e) => this.handleCopyClick(e, node)}
3826
3830
  title=${this.isCopied(node.id) ? "Copied" : "Copy"}
3827
3831
  >
3828
3832
  ${this.isCopied(node.id) ? "copied" : "copy"}
@@ -3835,7 +3839,7 @@ var init_TxTree = __esm(() => {
3835
3839
  class="file-content-mode-toggle"
3836
3840
  title=${`Show ${toggleLabel}`}
3837
3841
  aria-label=${`Show ${toggleLabel}`}
3838
- @click=${(e6) => this.onFileContentToggleClick(e6, node)}
3842
+ @click=${(e) => this.onFileContentToggleClick(e, node)}
3839
3843
  >
3840
3844
  ${toggleLabel}
3841
3845
  </button>` : ""}
@@ -3861,7 +3865,7 @@ var init_TxTree = __esm(() => {
3861
3865
  <span
3862
3866
  class="copy-badge"
3863
3867
  data-copied=${this.isCopied(node.id)}
3864
- @click=${(e6) => this.handleCopyClick(e6, node)}
3868
+ @click=${(e) => this.handleCopyClick(e, node)}
3865
3869
  title=${this.isCopied(node.id) ? "Copied" : "Copy"}
3866
3870
  >${this.isCopied(node.id) ? "copied" : "copy"}</span
3867
3871
  >
@@ -3894,7 +3898,7 @@ var init_TxTree = __esm(() => {
3894
3898
  </summary>
3895
3899
  ${nodeChildren && nodeChildren.length > 0 ? x`
3896
3900
  <div class="folder-children">
3897
- ${c5(nodeChildren, (c6) => c6.id, (c6) => this.renderAnyNode(c6, depth + 1))}
3901
+ ${c5(nodeChildren, (c) => c.id, (c) => this.renderAnyNode(c, depth + 1))}
3898
3902
  </div>
3899
3903
  ` : x``}
3900
3904
  </details>
@@ -4393,49 +4397,49 @@ function hexToBytes(hex) {
4393
4397
  throw new Error(`Invalid hex (odd length): ${hex}`);
4394
4398
  }
4395
4399
  const bytes = new Uint8Array(normalized.length / 2);
4396
- for (let i6 = 0;i6 < bytes.length; i6++) {
4397
- const byte = normalized.slice(i6 * 2, i6 * 2 + 2);
4400
+ for (let i = 0;i < bytes.length; i++) {
4401
+ const byte = normalized.slice(i * 2, i * 2 + 2);
4398
4402
  const value = Number.parseInt(byte, 16);
4399
4403
  if (!Number.isFinite(value))
4400
4404
  throw new Error(`Invalid hex: ${hex}`);
4401
- bytes[i6] = value;
4405
+ bytes[i] = value;
4402
4406
  }
4403
4407
  return bytes;
4404
4408
  }
4405
4409
  function bytesToHex(bytes) {
4406
- return `0x${Array.from(bytes).map((b3) => b3.toString(16).padStart(2, "0")).join("")}`;
4410
+ return `0x${Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("")}`;
4407
4411
  }
4408
4412
 
4409
4413
  // ../shared-ts/src/utils/keccak.ts
4410
4414
  function rotateLeft64(value, shift) {
4411
- const n6 = BigInt(shift);
4412
- return (value << n6 | value >> 64n - n6) & UINT64_MASK;
4415
+ const n = BigInt(shift);
4416
+ return (value << n | value >> 64n - n) & UINT64_MASK;
4413
4417
  }
4414
4418
  function keccakF1600(state) {
4415
- const c6 = new Array(5);
4416
- const d3 = new Array(5);
4419
+ const c = new Array(5);
4420
+ const d = new Array(5);
4417
4421
  for (let round = 0;round < 24; round += 1) {
4418
- for (let x2 = 0;x2 < 5; x2 += 1) {
4419
- c6[x2] = state[x2] ^ state[x2 + 5] ^ state[x2 + 10] ^ state[x2 + 15] ^ state[x2 + 20];
4422
+ for (let x = 0;x < 5; x += 1) {
4423
+ c[x] = state[x] ^ state[x + 5] ^ state[x + 10] ^ state[x + 15] ^ state[x + 20];
4420
4424
  }
4421
- for (let x2 = 0;x2 < 5; x2 += 1) {
4422
- d3[x2] = c6[(x2 + 4) % 5] ^ rotateLeft64(c6[(x2 + 1) % 5], 1);
4425
+ for (let x = 0;x < 5; x += 1) {
4426
+ d[x] = c[(x + 4) % 5] ^ rotateLeft64(c[(x + 1) % 5], 1);
4423
4427
  }
4424
- for (let y3 = 0;y3 < 5; y3 += 1) {
4425
- const rowOffset = y3 * 5;
4426
- for (let x2 = 0;x2 < 5; x2 += 1) {
4427
- state[rowOffset + x2] ^= d3[x2];
4428
+ for (let y = 0;y < 5; y += 1) {
4429
+ const rowOffset = y * 5;
4430
+ for (let x = 0;x < 5; x += 1) {
4431
+ state[rowOffset + x] ^= d[x];
4428
4432
  }
4429
4433
  }
4430
4434
  let lane = state[1];
4431
- for (let i6 = 0;i6 < 24; i6 += 1) {
4432
- const targetIndex = PI_LANE_INDEXES[i6];
4435
+ for (let i = 0;i < 24; i += 1) {
4436
+ const targetIndex = PI_LANE_INDEXES[i];
4433
4437
  const nextLane = state[targetIndex];
4434
- state[targetIndex] = rotateLeft64(lane, ROTATION_OFFSETS[i6]);
4438
+ state[targetIndex] = rotateLeft64(lane, ROTATION_OFFSETS[i]);
4435
4439
  lane = nextLane;
4436
4440
  }
4437
- for (let y3 = 0;y3 < 5; y3 += 1) {
4438
- const rowOffset = y3 * 5;
4441
+ for (let y = 0;y < 5; y += 1) {
4442
+ const rowOffset = y * 5;
4439
4443
  const lane0 = state[rowOffset];
4440
4444
  const lane1 = state[rowOffset + 1];
4441
4445
  const lane2 = state[rowOffset + 2];
@@ -4458,8 +4462,8 @@ function absorbByte(state, offset, byte) {
4458
4462
  function keccak256Bytes(input) {
4459
4463
  const state = new Array(25).fill(0n);
4460
4464
  let offset = 0;
4461
- for (let i6 = 0;i6 < input.length; i6 += 1) {
4462
- absorbByte(state, offset, input[i6]);
4465
+ for (let i = 0;i < input.length; i += 1) {
4466
+ absorbByte(state, offset, input[i]);
4463
4467
  offset += 1;
4464
4468
  if (offset === KECCAK_RATE_BYTES) {
4465
4469
  keccakF1600(state);
@@ -4470,10 +4474,10 @@ function keccak256Bytes(input) {
4470
4474
  absorbByte(state, KECCAK_RATE_BYTES - 1, 128);
4471
4475
  keccakF1600(state);
4472
4476
  const out = new Uint8Array(KECCAK256_OUTPUT_BYTES);
4473
- for (let i6 = 0;i6 < KECCAK256_OUTPUT_BYTES; i6 += 1) {
4474
- const lane = state[Math.floor(i6 / 8)];
4475
- const laneShift = BigInt(i6 % 8 * 8);
4476
- out[i6] = Number(lane >> laneShift & 0xffn);
4477
+ for (let i = 0;i < KECCAK256_OUTPUT_BYTES; i += 1) {
4478
+ const lane = state[Math.floor(i / 8)];
4479
+ const laneShift = BigInt(i % 8 * 8);
4480
+ out[i] = Number(lane >> laneShift & 0xffn);
4477
4481
  }
4478
4482
  return out;
4479
4483
  }
@@ -4714,8 +4718,8 @@ function parseAbiTypeNode(args) {
4714
4718
  dynamic: baseType === "bytes" || baseType === "string"
4715
4719
  };
4716
4720
  }
4717
- for (let i6 = arrayDimensions.length - 1;i6 >= 0; i6 -= 1) {
4718
- const length = arrayDimensions[i6];
4721
+ for (let i = arrayDimensions.length - 1;i >= 0; i -= 1) {
4722
+ const length = arrayDimensions[i];
4719
4723
  node = {
4720
4724
  kind: "array",
4721
4725
  canonicalType: `${node.canonicalType}[${length == null ? "" : String(length)}]`,
@@ -4842,16 +4846,16 @@ function decodeTypeAt(typeNode, bytes, offset) {
4842
4846
  if (!decodedItems)
4843
4847
  return null;
4844
4848
  const out = {};
4845
- for (let i6 = 0;i6 < typeNode.components.length; i6 += 1) {
4846
- const component = typeNode.components[i6];
4847
- const baseName = String(component.name || "").trim() || `item${i6}`;
4849
+ for (let i = 0;i < typeNode.components.length; i += 1) {
4850
+ const component = typeNode.components[i];
4851
+ const baseName = String(component.name || "").trim() || `item${i}`;
4848
4852
  let name = baseName;
4849
4853
  let counter = 1;
4850
4854
  while (Object.prototype.hasOwnProperty.call(out, name)) {
4851
4855
  counter += 1;
4852
4856
  name = `${baseName}_${counter}`;
4853
4857
  }
4854
- out[name] = decodedItems[i6];
4858
+ out[name] = decodedItems[i];
4855
4859
  }
4856
4860
  return out;
4857
4861
  }
@@ -4865,8 +4869,8 @@ function decodeTypeAt(typeNode, bytes, offset) {
4865
4869
  const baseOffset = isDynamicArray ? offset + WORD_SIZE : offset;
4866
4870
  const items = [];
4867
4871
  if (typeNode.item.dynamic) {
4868
- for (let i6 = 0;i6 < arrayLength; i6 += 1) {
4869
- const itemRelativeOffset = readWordNumber(bytes, baseOffset + i6 * WORD_SIZE);
4872
+ for (let i = 0;i < arrayLength; i += 1) {
4873
+ const itemRelativeOffset = readWordNumber(bytes, baseOffset + i * WORD_SIZE);
4870
4874
  if (itemRelativeOffset == null)
4871
4875
  return null;
4872
4876
  const decoded = decodeTypeAt(typeNode.item, bytes, baseOffset + itemRelativeOffset);
@@ -4877,8 +4881,8 @@ function decodeTypeAt(typeNode, bytes, offset) {
4877
4881
  return items;
4878
4882
  }
4879
4883
  const itemWords = staticWordLength(typeNode.item);
4880
- for (let i6 = 0;i6 < arrayLength; i6 += 1) {
4881
- const itemOffset = baseOffset + i6 * itemWords * WORD_SIZE;
4884
+ for (let i = 0;i < arrayLength; i += 1) {
4885
+ const itemOffset = baseOffset + i * itemWords * WORD_SIZE;
4882
4886
  const decoded = decodeTypeAt(typeNode.item, bytes, itemOffset);
4883
4887
  if (decoded == null)
4884
4888
  return null;
@@ -4894,17 +4898,17 @@ function decodeTupleComponents(components, bytes, tupleOffset) {
4894
4898
  cursorWords += component.typeNode.dynamic ? 1 : staticWordLength(component.typeNode);
4895
4899
  }
4896
4900
  const out = [];
4897
- for (let i6 = 0;i6 < components.length; i6 += 1) {
4898
- const component = components[i6];
4899
- const headOffset = tupleOffset + headOffsets[i6];
4901
+ for (let i = 0;i < components.length; i += 1) {
4902
+ const component = components[i];
4903
+ const headOffset = tupleOffset + headOffsets[i];
4900
4904
  if (component.typeNode.dynamic) {
4901
4905
  const relativeOffset = readWordNumber(bytes, headOffset);
4902
4906
  if (relativeOffset == null)
4903
4907
  return null;
4904
- const decoded2 = decodeTypeAt(component.typeNode, bytes, tupleOffset + relativeOffset);
4905
- if (decoded2 == null)
4908
+ const decoded = decodeTypeAt(component.typeNode, bytes, tupleOffset + relativeOffset);
4909
+ if (decoded == null)
4906
4910
  return null;
4907
- out.push(decoded2);
4911
+ out.push(decoded);
4908
4912
  continue;
4909
4913
  }
4910
4914
  const decoded = decodeTypeAt(component.typeNode, bytes, headOffset);
@@ -4987,10 +4991,6 @@ var init_abiDecode = __esm(() => {
4987
4991
  });
4988
4992
 
4989
4993
  // src/core/signingEngine/uiConfirm/ui/lit-components/TxTree/abi/enrichDisplayModelWithAbi.ts
4990
- var exports_enrichDisplayModelWithAbi = {};
4991
- __export(exports_enrichDisplayModelWithAbi, {
4992
- enrichDisplayModelWithAbi: () => enrichDisplayModelWithAbi
4993
- });
4994
4994
  function isGenericContractCallOperation(operation) {
4995
4995
  return operation.kind === "generic.contractCall";
4996
4996
  }
@@ -5088,12 +5088,6 @@ var init_tx_confirm_content = __esm(() => {
5088
5088
  init_registry();
5089
5089
  init_registry();
5090
5090
  TxConfirmContentElement = class TxConfirmContentElement extends LitElementWithProps {
5091
- _heightReflow = createSurfaceHeightReflow({
5092
- reason: "tx-body",
5093
- element: () => this.querySelector(".txc-root"),
5094
- setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
5095
- settled: () => this.updateComplete
5096
- });
5097
5091
  static requiredChildTags = [W3A_TX_TREE_ID];
5098
5092
  static keepDefinitions = [TxTree_default];
5099
5093
  static properties = {
@@ -5116,22 +5110,39 @@ var init_tx_confirm_content = __esm(() => {
5116
5110
  evmExplorerUrl: { type: String, attribute: "evm-explorer-url" },
5117
5111
  showShadow: { type: Boolean, attribute: "show-shadow" }
5118
5112
  };
5119
- _treeNode = null;
5120
- _ensureTreeDefinition = TxTree_default;
5121
- _stylesReady = false;
5122
- _stylePromises = [];
5123
- _stylesAwaiting = null;
5124
5113
  static _STYLE_MARKERS = [
5125
5114
  "data-w3a-tx-tree-css",
5126
5115
  "data-w3a-tx-confirmer-css",
5127
5116
  "data-w3a-components-css"
5128
5117
  ];
5129
- _treeBuildVersion = 0;
5130
- _confirmArmed = false;
5131
- _confirmArmRaf1 = null;
5132
- _confirmArmRaf2 = null;
5133
5118
  constructor() {
5134
5119
  super();
5120
+ this._heightReflow = createSurfaceHeightReflow({
5121
+ reason: "tx-body",
5122
+ element: () => this.querySelector(".txc-root"),
5123
+ setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
5124
+ settled: () => this.updateComplete
5125
+ });
5126
+ this._treeNode = null;
5127
+ this._ensureTreeDefinition = TxTree_default;
5128
+ this._stylesReady = false;
5129
+ this._stylePromises = [];
5130
+ this._stylesAwaiting = null;
5131
+ this._treeBuildVersion = 0;
5132
+ this._confirmArmed = false;
5133
+ this._confirmArmRaf1 = null;
5134
+ this._confirmArmRaf2 = null;
5135
+ this._stopDragStart = (e) => {
5136
+ e.stopPropagation();
5137
+ };
5138
+ this.onConfirm = () => {
5139
+ if (this.loading || !this._confirmArmed)
5140
+ return;
5141
+ dispatchLitConfirm(this);
5142
+ };
5143
+ this.onCancel = () => {
5144
+ dispatchLitCancel(this);
5145
+ };
5135
5146
  const root = document?.documentElement || null;
5136
5147
  if (root) {
5137
5148
  this._stylePromises.push(ensureExternalStyles(root, "tx-tree.css", "data-w3a-tx-tree-css"), ensureExternalStyles(root, "tx-confirmer.css", "data-w3a-tx-confirmer-css"), ensureExternalStyles(root, "w3a-components.css", "data-w3a-components-css"));
@@ -5181,8 +5192,8 @@ var init_tx_confirm_content = __esm(() => {
5181
5192
  return true;
5182
5193
  }
5183
5194
  if (!this._stylesAwaiting) {
5184
- const p4 = Promise.all(this._stylePromises).then(() => new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6()))));
5185
- this._stylesAwaiting = p4.then(() => {
5195
+ const p = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
5196
+ this._stylesAwaiting = p.then(() => {
5186
5197
  this._stylesReady = true;
5187
5198
  this._rebuildTree();
5188
5199
  });
@@ -5222,17 +5233,17 @@ var init_tx_confirm_content = __esm(() => {
5222
5233
  }
5223
5234
  }
5224
5235
  _applyTooltipWidthVar() {
5225
- const w2 = this._normalizeWidth(this.tooltipWidth);
5226
- if (w2)
5227
- this.setCssVars({ "--tooltip-width": w2 });
5236
+ const w = this._normalizeWidth(this.tooltipWidth);
5237
+ if (w)
5238
+ this.setCssVars({ "--tooltip-width": w });
5228
5239
  }
5229
5240
  _normalizeWidth(val) {
5230
5241
  if (val === undefined || val === null)
5231
5242
  return;
5232
5243
  if (typeof val === "number" && Number.isFinite(val))
5233
5244
  return `${val}px`;
5234
- const s6 = String(val).trim();
5235
- return s6.length ? s6 : undefined;
5245
+ const s = String(val).trim();
5246
+ return s.length ? s : undefined;
5236
5247
  }
5237
5248
  _operationHasAbiDecodeHint(operation) {
5238
5249
  const hint = operation.abiDecodeHint;
@@ -5258,10 +5269,10 @@ var init_tx_confirm_content = __esm(() => {
5258
5269
  }
5259
5270
  async _enrichTreeWithAbi(args) {
5260
5271
  try {
5261
- const module = await Promise.resolve().then(() => (init_enrichDisplayModelWithAbi(), exports_enrichDisplayModelWithAbi));
5272
+ const module = await Promise.resolve().then(() => (init_enrichDisplayModelWithAbi(), {}));
5262
5273
  if (args.buildVersion !== this._treeBuildVersion)
5263
5274
  return;
5264
- const enrichedModel = module.enrichDisplayModelWithAbi(args.model);
5275
+ const enrichedModel = enrichDisplayModelWithAbi(args.model);
5265
5276
  if (args.buildVersion !== this._treeBuildVersion)
5266
5277
  return;
5267
5278
  this._treeNode = buildDisplayTreeFromModel(enrichedModel);
@@ -5304,23 +5315,12 @@ var init_tx_confirm_content = __esm(() => {
5304
5315
  return;
5305
5316
  }
5306
5317
  this._treeNode = null;
5307
- } catch (e6) {
5308
- console.warn("[TxConfirmContent] failed to build TxTree", e6);
5318
+ } catch (e) {
5319
+ console.warn("[TxConfirmContent] failed to build TxTree", e);
5309
5320
  this._treeNode = null;
5310
5321
  }
5311
5322
  maybeRequestUpdate();
5312
5323
  }
5313
- _stopDragStart = (e6) => {
5314
- e6.stopPropagation();
5315
- };
5316
- onConfirm = () => {
5317
- if (this.loading || !this._confirmArmed)
5318
- return;
5319
- dispatchLitConfirm(this);
5320
- };
5321
- onCancel = () => {
5322
- dispatchLitCancel(this);
5323
- };
5324
5324
  render() {
5325
5325
  const treeTheme = this.theme === "dark" ? "dark" : "light";
5326
5326
  const nearExplorerBase = this.nearExplorerUrl || "https://testnet.nearblocks.io";
@@ -5444,6 +5444,26 @@ var init_HaloBorder = __esm(() => {
5444
5444
  init_css_loader();
5445
5445
  init_registry();
5446
5446
  HaloBorderElement = class HaloBorderElement extends LitElementWithProps {
5447
+ constructor() {
5448
+ super(...arguments);
5449
+ this._stylesReady = false;
5450
+ this._stylePromises = [];
5451
+ this._stylesAwaiting = null;
5452
+ this._rafId = null;
5453
+ this._startTs = 0;
5454
+ this._running = false;
5455
+ this.tick = (ts) => {
5456
+ if (!this._running)
5457
+ return;
5458
+ if (!this._startTs)
5459
+ this._startTs = ts;
5460
+ const dur = typeof this.durationMs === "number" && this.durationMs > 0 ? this.durationMs : 1150;
5461
+ const delta = (ts - this._startTs) % dur;
5462
+ const angle = delta / dur * 360;
5463
+ this.setCssVars({ "--halo-angle": `${angle}deg` });
5464
+ this._rafId = requestAnimationFrame(this.tick);
5465
+ };
5466
+ }
5447
5467
  static properties = {
5448
5468
  animated: { type: Boolean },
5449
5469
  theme: { type: String },
@@ -5458,15 +5478,12 @@ var init_HaloBorder = __esm(() => {
5458
5478
  innerPadding: { type: String, attribute: "inner-padding" },
5459
5479
  innerBackground: { type: String, attribute: "inner-background" }
5460
5480
  };
5461
- _stylesReady = false;
5462
- _stylePromises = [];
5463
- _stylesAwaiting = null;
5464
5481
  static _STYLE_MARKER = "data-w3a-halo-border-css";
5465
5482
  createRenderRoot() {
5466
5483
  const root = super.createRenderRoot();
5467
- const p4 = ensureExternalStyles(root, "halo-border.css", HaloBorderElement._STYLE_MARKER);
5468
- this._stylePromises.push(p4);
5469
- p4.catch(() => {});
5484
+ const p = ensureExternalStyles(root, "halo-border.css", HaloBorderElement._STYLE_MARKER);
5485
+ this._stylePromises.push(p);
5486
+ p.catch(() => {});
5470
5487
  return root;
5471
5488
  }
5472
5489
  shouldUpdate(_changed) {
@@ -5477,7 +5494,7 @@ var init_HaloBorder = __esm(() => {
5477
5494
  return true;
5478
5495
  }
5479
5496
  if (!this._stylesAwaiting) {
5480
- const settle = Promise.all(this._stylePromises).then(() => new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6()))));
5497
+ const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
5481
5498
  this._stylesAwaiting = settle.then(() => {
5482
5499
  this._stylesReady = true;
5483
5500
  this.requestUpdate();
@@ -5495,9 +5512,6 @@ var init_HaloBorder = __esm(() => {
5495
5512
  const statefulLink = link;
5496
5513
  return !!(statefulLink._w3aLoaded || link.sheet);
5497
5514
  }
5498
- _rafId = null;
5499
- _startTs = 0;
5500
- _running = false;
5501
5515
  connectedCallback() {
5502
5516
  super.connectedCallback();
5503
5517
  this.applyCssVars();
@@ -5537,17 +5551,6 @@ var init_HaloBorder = __esm(() => {
5537
5551
  this.stop();
5538
5552
  super.disconnectedCallback();
5539
5553
  }
5540
- tick = (ts) => {
5541
- if (!this._running)
5542
- return;
5543
- if (!this._startTs)
5544
- this._startTs = ts;
5545
- const dur = typeof this.durationMs === "number" && this.durationMs > 0 ? this.durationMs : 1150;
5546
- const delta = (ts - this._startTs) % dur;
5547
- const angle = delta / dur * 360;
5548
- this.setCssVars({ "--halo-angle": `${angle}deg` });
5549
- this._rafId = requestAnimationFrame(this.tick);
5550
- };
5551
5554
  start() {
5552
5555
  if (this._running)
5553
5556
  return;
@@ -5590,6 +5593,12 @@ var init_PasskeyHaloLoading = __esm(() => {
5590
5593
  init_css_loader();
5591
5594
  init_registry();
5592
5595
  PasskeyHaloLoadingElement = class PasskeyHaloLoadingElement extends LitElementWithProps {
5596
+ constructor() {
5597
+ super(...arguments);
5598
+ this._stylesReady = false;
5599
+ this._stylePromises = [];
5600
+ this._stylesAwaiting = null;
5601
+ }
5593
5602
  static properties = {
5594
5603
  animated: { type: Boolean },
5595
5604
  theme: { type: String },
@@ -5608,15 +5617,12 @@ var init_PasskeyHaloLoading = __esm(() => {
5608
5617
  iconContainerBorderRadius: { type: String, attribute: "icon-container-border-radius" },
5609
5618
  iconContainerBackgroundColor: { type: String, attribute: "icon-container-background-color" }
5610
5619
  };
5611
- _stylesReady = false;
5612
- _stylePromises = [];
5613
- _stylesAwaiting = null;
5614
5620
  static _STYLE_MARKER = "data-w3a-passkey-halo-loading-css";
5615
5621
  createRenderRoot() {
5616
5622
  const root = super.createRenderRoot();
5617
- const p4 = ensureExternalStyles(root, "passkey-halo-loading.css", PasskeyHaloLoadingElement._STYLE_MARKER);
5618
- this._stylePromises.push(p4);
5619
- p4.catch(() => {});
5623
+ const p = ensureExternalStyles(root, "passkey-halo-loading.css", PasskeyHaloLoadingElement._STYLE_MARKER);
5624
+ this._stylePromises.push(p);
5625
+ p.catch(() => {});
5620
5626
  return root;
5621
5627
  }
5622
5628
  shouldUpdate(_changed) {
@@ -5627,7 +5633,7 @@ var init_PasskeyHaloLoading = __esm(() => {
5627
5633
  return true;
5628
5634
  }
5629
5635
  if (!this._stylesAwaiting) {
5630
- const settle = Promise.all(this._stylePromises).then(() => new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6()))));
5636
+ const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
5631
5637
  this._stylesAwaiting = settle.then(() => {
5632
5638
  this._stylesReady = true;
5633
5639
  this.requestUpdate();
@@ -5889,50 +5895,6 @@ var init_viewer_drawer = __esm(() => {
5889
5895
  otpResendStatus: { type: String, attribute: false },
5890
5896
  otpSubmitAnimating: { type: Boolean, attribute: false }
5891
5897
  };
5892
- otpCode = "";
5893
- otpError = "";
5894
- otpResendBusy = false;
5895
- otpResendUntilMs = 0;
5896
- otpResendStatus = "";
5897
- otpSubmitAnimating = false;
5898
- _otpResendTimer = null;
5899
- _otpSubmitTimer = null;
5900
- _lastAutoOtpSubmitCode = "";
5901
- _ensureDrawerDefinition = Drawer_default;
5902
- _drawerEl = null;
5903
- _open = false;
5904
- _ownsThemeAttr = false;
5905
- _onWindowMessage = (ev) => {
5906
- const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
5907
- if (!data || typeof data.type !== "string")
5908
- return;
5909
- if (data.type === "MODAL_TIMEOUT") {
5910
- const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
5911
- this.loading = false;
5912
- this.errorMessage = msg;
5913
- this._drawerEl?.handleClose?.();
5914
- this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
5915
- bubbles: true,
5916
- composed: true,
5917
- detail: { confirmed: false }
5918
- }));
5919
- }
5920
- };
5921
- _onKeyDown = (e6) => {
5922
- if (e6.key === "Escape" || e6.key === "Esc") {
5923
- if (this.loading)
5924
- return;
5925
- e6.preventDefault();
5926
- this._drawerEl?.handleClose();
5927
- if (!this._drawerEl) {
5928
- this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
5929
- bubbles: true,
5930
- composed: true,
5931
- detail: { confirmed: false }
5932
- }));
5933
- }
5934
- }
5935
- };
5936
5898
  _chainLabelForModel() {
5937
5899
  switch (this.model?.chain) {
5938
5900
  case "tempo":
@@ -6025,24 +5987,6 @@ var init_viewer_drawer = __esm(() => {
6025
5987
  </div>
6026
5988
  `;
6027
5989
  }
6028
- onPasskeyRegistrationConfirm = () => {
6029
- this.finishContentConfirm();
6030
- };
6031
- _onOtpInput = (event) => {
6032
- const input = event.currentTarget;
6033
- const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
6034
- this.otpCode = code;
6035
- this.otpError = "";
6036
- if (code.length < 6) {
6037
- this._lastAutoOtpSubmitCode = "";
6038
- this._resetOtpSubmitAnimation();
6039
- return;
6040
- }
6041
- if (this.loading || this._lastAutoOtpSubmitCode === code)
6042
- return;
6043
- this._lastAutoOtpSubmitCode = code;
6044
- this._submitEmailOtpAfterFade(code);
6045
- };
6046
5990
  _clearOtpSubmitTimer() {
6047
5991
  if (this._otpSubmitTimer != null)
6048
5992
  window.clearTimeout(this._otpSubmitTimer);
@@ -6086,40 +6030,6 @@ var init_viewer_drawer = __esm(() => {
6086
6030
  return `Resend in ${Math.ceil(remainingMs / 1000)}s`;
6087
6031
  return this.otpResendStatus || "Resend code";
6088
6032
  }
6089
- _onOtpResend = () => {
6090
- const resend = this.emailOtpPrompt?.onResend;
6091
- if (typeof resend !== "function" || this.otpResendBusy || this.loading)
6092
- return;
6093
- if (this.otpResendUntilMs > Date.now())
6094
- return;
6095
- this.otpError = "";
6096
- this.otpResendStatus = "";
6097
- this._lastAutoOtpSubmitCode = "";
6098
- this._resetOtpSubmitAnimation();
6099
- this.otpResendBusy = true;
6100
- this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
6101
- this.requestUpdate();
6102
- (async () => {
6103
- try {
6104
- const result = await resend();
6105
- const challengeId = String(result?.challengeId || "").trim();
6106
- const emailHint = String(result?.emailHint || "").trim();
6107
- if (challengeId) {
6108
- this.emailOtpPrompt = {
6109
- ...this.emailOtpPrompt,
6110
- challengeId,
6111
- ...emailHint ? { emailHint } : {}
6112
- };
6113
- }
6114
- this.otpResendStatus = "Code sent";
6115
- } catch (error) {
6116
- this.otpError = formatEmailOtpResendError(error);
6117
- } finally {
6118
- this.otpResendBusy = false;
6119
- this.requestUpdate();
6120
- }
6121
- })();
6122
- };
6123
6033
  _renderEmailOtpPrompt() {
6124
6034
  if (!this._isEmailOtpMode())
6125
6035
  return "";
@@ -6166,11 +6076,6 @@ var init_viewer_drawer = __esm(() => {
6166
6076
  </div>
6167
6077
  `;
6168
6078
  }
6169
- _onFundingNoticeCopy = (event) => {
6170
- const target = event.currentTarget;
6171
- const accountId = String(target?.dataset.copyValue || "").trim();
6172
- copyTextToClipboard(accountId);
6173
- };
6174
6079
  _renderConfirmationBody() {
6175
6080
  const body = String(this.body || "").trim();
6176
6081
  if (!body)
@@ -6201,6 +6106,147 @@ var init_viewer_drawer = __esm(() => {
6201
6106
  }
6202
6107
  constructor() {
6203
6108
  super();
6109
+ this.otpCode = "";
6110
+ this.otpError = "";
6111
+ this.otpResendBusy = false;
6112
+ this.otpResendUntilMs = 0;
6113
+ this.otpResendStatus = "";
6114
+ this.otpSubmitAnimating = false;
6115
+ this._otpResendTimer = null;
6116
+ this._otpSubmitTimer = null;
6117
+ this._lastAutoOtpSubmitCode = "";
6118
+ this._ensureDrawerDefinition = Drawer_default;
6119
+ this._drawerEl = null;
6120
+ this._open = false;
6121
+ this._ownsThemeAttr = false;
6122
+ this._onWindowMessage = (ev) => {
6123
+ const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
6124
+ if (!data || typeof data.type !== "string")
6125
+ return;
6126
+ if (data.type === "MODAL_TIMEOUT") {
6127
+ const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
6128
+ this.loading = false;
6129
+ this.errorMessage = msg;
6130
+ this._drawerEl?.handleClose?.();
6131
+ this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
6132
+ bubbles: true,
6133
+ composed: true,
6134
+ detail: { confirmed: false }
6135
+ }));
6136
+ }
6137
+ };
6138
+ this._onKeyDown = (e) => {
6139
+ if (e.key === "Escape" || e.key === "Esc") {
6140
+ if (this.loading)
6141
+ return;
6142
+ e.preventDefault();
6143
+ this._drawerEl?.handleClose();
6144
+ if (!this._drawerEl) {
6145
+ this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
6146
+ bubbles: true,
6147
+ composed: true,
6148
+ detail: { confirmed: false }
6149
+ }));
6150
+ }
6151
+ }
6152
+ };
6153
+ this.onPasskeyRegistrationConfirm = () => {
6154
+ this.finishContentConfirm();
6155
+ };
6156
+ this._onOtpInput = (event) => {
6157
+ const input = event.currentTarget;
6158
+ const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
6159
+ this.otpCode = code;
6160
+ this.otpError = "";
6161
+ if (code.length < 6) {
6162
+ this._lastAutoOtpSubmitCode = "";
6163
+ this._resetOtpSubmitAnimation();
6164
+ return;
6165
+ }
6166
+ if (this.loading || this._lastAutoOtpSubmitCode === code)
6167
+ return;
6168
+ this._lastAutoOtpSubmitCode = code;
6169
+ this._submitEmailOtpAfterFade(code);
6170
+ };
6171
+ this._onOtpResend = () => {
6172
+ const resend = this.emailOtpPrompt?.onResend;
6173
+ if (typeof resend !== "function" || this.otpResendBusy || this.loading)
6174
+ return;
6175
+ if (this.otpResendUntilMs > Date.now())
6176
+ return;
6177
+ this.otpError = "";
6178
+ this.otpResendStatus = "";
6179
+ this._lastAutoOtpSubmitCode = "";
6180
+ this._resetOtpSubmitAnimation();
6181
+ this.otpResendBusy = true;
6182
+ this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
6183
+ this.requestUpdate();
6184
+ (async () => {
6185
+ try {
6186
+ const result = await resend();
6187
+ const challengeId = String(result?.challengeId || "").trim();
6188
+ const emailHint = String(result?.emailHint || "").trim();
6189
+ if (challengeId) {
6190
+ this.emailOtpPrompt = {
6191
+ ...this.emailOtpPrompt,
6192
+ challengeId,
6193
+ ...emailHint ? { emailHint } : {}
6194
+ };
6195
+ }
6196
+ this.otpResendStatus = "Code sent";
6197
+ } catch (error) {
6198
+ this.otpError = formatEmailOtpResendError(error);
6199
+ } finally {
6200
+ this.otpResendBusy = false;
6201
+ this.requestUpdate();
6202
+ }
6203
+ })();
6204
+ };
6205
+ this._onFundingNoticeCopy = (event) => {
6206
+ const target = event.currentTarget;
6207
+ const accountId = String(target?.dataset.copyValue || "").trim();
6208
+ copyTextToClipboard(accountId);
6209
+ };
6210
+ this.onDrawerCancel = () => {
6211
+ if (this.loading)
6212
+ return;
6213
+ this._open = false;
6214
+ this.requestUpdate();
6215
+ this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
6216
+ bubbles: true,
6217
+ composed: true,
6218
+ detail: { confirmed: false }
6219
+ }));
6220
+ };
6221
+ this.onContentConfirm = () => {
6222
+ if (this.loading || this.otpSubmitAnimating)
6223
+ return;
6224
+ if (this._isEmailOtpMode()) {
6225
+ const code = String(this.otpCode || "").replace(/\D/g, "").slice(0, 6);
6226
+ if (!/^\d{6}$/.test(code)) {
6227
+ this.otpCode = code;
6228
+ this.otpError = "Enter the 6-digit Email OTP code.";
6229
+ this.requestUpdate();
6230
+ return;
6231
+ }
6232
+ this.otpCode = code;
6233
+ this.otpError = "";
6234
+ this._lastAutoOtpSubmitCode = code;
6235
+ this._submitEmailOtpAfterFade(code);
6236
+ return;
6237
+ }
6238
+ this.finishContentConfirm();
6239
+ };
6240
+ this.onContentCancel = () => {
6241
+ this._drawerEl?.handleClose();
6242
+ this._open = false;
6243
+ this.requestUpdate();
6244
+ this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
6245
+ bubbles: true,
6246
+ composed: true,
6247
+ detail: { confirmed: false }
6248
+ }));
6249
+ };
6204
6250
  this.nearAccountId = "";
6205
6251
  this.txSigningRequests = undefined;
6206
6252
  this.model = undefined;
@@ -6261,7 +6307,7 @@ var init_viewer_drawer = __esm(() => {
6261
6307
  ensureExternalStyles(root, "tx-confirmer.css", "data-w3a-tx-confirmer-css"),
6262
6308
  ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css")
6263
6309
  ]);
6264
- await new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6())));
6310
+ await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r())));
6265
6311
  this._open = true;
6266
6312
  this.requestUpdate();
6267
6313
  }
@@ -6290,36 +6336,6 @@ var init_viewer_drawer = __esm(() => {
6290
6336
  }
6291
6337
  }
6292
6338
  }
6293
- onDrawerCancel = () => {
6294
- if (this.loading)
6295
- return;
6296
- this._open = false;
6297
- this.requestUpdate();
6298
- this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
6299
- bubbles: true,
6300
- composed: true,
6301
- detail: { confirmed: false }
6302
- }));
6303
- };
6304
- onContentConfirm = () => {
6305
- if (this.loading || this.otpSubmitAnimating)
6306
- return;
6307
- if (this._isEmailOtpMode()) {
6308
- const code = String(this.otpCode || "").replace(/\D/g, "").slice(0, 6);
6309
- if (!/^\d{6}$/.test(code)) {
6310
- this.otpCode = code;
6311
- this.otpError = "Enter the 6-digit Email OTP code.";
6312
- this.requestUpdate();
6313
- return;
6314
- }
6315
- this.otpCode = code;
6316
- this.otpError = "";
6317
- this._lastAutoOtpSubmitCode = code;
6318
- this._submitEmailOtpAfterFade(code);
6319
- return;
6320
- }
6321
- this.finishContentConfirm();
6322
- };
6323
6339
  finishContentConfirm(opts) {
6324
6340
  if (this.loading)
6325
6341
  return;
@@ -6339,16 +6355,6 @@ var init_viewer_drawer = __esm(() => {
6339
6355
  }
6340
6356
  }));
6341
6357
  }
6342
- onContentCancel = () => {
6343
- this._drawerEl?.handleClose();
6344
- this._open = false;
6345
- this.requestUpdate();
6346
- this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
6347
- bubbles: true,
6348
- composed: true,
6349
- detail: { confirmed: false }
6350
- }));
6351
- };
6352
6358
  close(_confirmed) {
6353
6359
  if (!this._open)
6354
6360
  return;
@@ -6549,12 +6555,6 @@ var init_viewer_modal = __esm(() => {
6549
6555
  init_nearFundingNotice();
6550
6556
  init_registry();
6551
6557
  ModalTxConfirmElement = class ModalTxConfirmElement extends LitElementWithProps {
6552
- _heightReflow = createSurfaceHeightReflow({
6553
- reason: "confirm-body",
6554
- element: () => this.querySelector(".modal-container-root"),
6555
- setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
6556
- settled: () => this.updateComplete
6557
- });
6558
6558
  static requiredChildTags = ["w3a-tx-confirm-content"];
6559
6559
  static strictChildDefinitions = true;
6560
6560
  static keepDefinitions = [tx_confirm_content_default];
@@ -6587,57 +6587,6 @@ var init_viewer_modal = __esm(() => {
6587
6587
  otpResendStatus: { type: String, attribute: false },
6588
6588
  otpSubmitAnimating: { type: Boolean, attribute: false }
6589
6589
  };
6590
- totalAmount = "";
6591
- method = "";
6592
- fingerprint = "";
6593
- body = "";
6594
- title = "";
6595
- cancelText = "Cancel";
6596
- confirmText = "Next";
6597
- model;
6598
- securityContext;
6599
- loading = false;
6600
- errorMessage = undefined;
6601
- theme = "dark";
6602
- appearance;
6603
- nearExplorerUrl;
6604
- tempoExplorerUrl;
6605
- evmExplorerUrl;
6606
- signingAuthMode;
6607
- emailOtpPrompt;
6608
- otpCode = "";
6609
- otpError = "";
6610
- otpResendBusy = false;
6611
- otpResendUntilMs = 0;
6612
- otpResendStatus = "";
6613
- otpSubmitAnimating = false;
6614
- _otpResendTimer = null;
6615
- _otpSubmitTimer = null;
6616
- _lastAutoOtpSubmitCode = "";
6617
- intentDigest;
6618
- deferClose = false;
6619
- _stylesReady = false;
6620
- _stylePromises = [];
6621
- _stylesAwaiting = null;
6622
- _ensureTreeDefinition = TxTree_default;
6623
- _ensureHaloElements = [HaloBorder_default, PasskeyHaloLoading_default];
6624
- _onKeyDown = (e6) => {
6625
- if (e6.key === "Escape" || e6.key === "Esc") {
6626
- e6.preventDefault();
6627
- this._handleCancel();
6628
- }
6629
- };
6630
- _onWindowMessage = (ev) => {
6631
- const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
6632
- if (!data || typeof data.type !== "string")
6633
- return;
6634
- if (data.type === "MODAL_TIMEOUT") {
6635
- const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
6636
- this.loading = false;
6637
- this.errorMessage = msg;
6638
- this._handleCancel();
6639
- }
6640
- };
6641
6590
  _chainLabelForModel() {
6642
6591
  switch (this.model?.chain) {
6643
6592
  case "tempo":
@@ -6675,12 +6624,6 @@ var init_viewer_modal = __esm(() => {
6675
6624
  _isStandaloneSurface() {
6676
6625
  return this.closest("w3a-tx-confirmer")?.getAttribute("data-w3a-confirm-surface") === "standalone";
6677
6626
  }
6678
- _handleBackdropClick = (event) => {
6679
- if (!this._isStandaloneSurface())
6680
- return;
6681
- event.stopPropagation();
6682
- this._handleCancel();
6683
- };
6684
6627
  _authHeadingFallback() {
6685
6628
  if (this._passkeyRegistrationDisplay())
6686
6629
  return "Create your passkey";
@@ -6746,9 +6689,6 @@ var init_viewer_modal = __esm(() => {
6746
6689
  </div>
6747
6690
  `;
6748
6691
  }
6749
- _onPasskeyRegistrationConfirm = () => {
6750
- this._finishConfirm();
6751
- };
6752
6692
  _renderPasskeyRegistrationModal(display) {
6753
6693
  return x`
6754
6694
  ${this._isStandaloneSurface() ? x`<div class="standalone-surface-backdrop" @click=${this._handleBackdropClick}></div>` : ""}
@@ -6783,21 +6723,6 @@ var init_viewer_modal = __esm(() => {
6783
6723
  </div>
6784
6724
  `;
6785
6725
  }
6786
- _onOtpInput = (event) => {
6787
- const input = event.currentTarget;
6788
- const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
6789
- this.otpCode = code;
6790
- this.otpError = "";
6791
- if (code.length < 6) {
6792
- this._lastAutoOtpSubmitCode = "";
6793
- this._resetOtpSubmitAnimation();
6794
- return;
6795
- }
6796
- if (this.loading || this._lastAutoOtpSubmitCode === code)
6797
- return;
6798
- this._lastAutoOtpSubmitCode = code;
6799
- this._submitEmailOtpAfterFade(code);
6800
- };
6801
6726
  _clearOtpSubmitTimer() {
6802
6727
  if (this._otpSubmitTimer != null)
6803
6728
  window.clearTimeout(this._otpSubmitTimer);
@@ -6841,40 +6766,6 @@ var init_viewer_modal = __esm(() => {
6841
6766
  return `Resend in ${Math.ceil(remainingMs / 1000)}s`;
6842
6767
  return this.otpResendStatus || "Resend code";
6843
6768
  }
6844
- _onOtpResend = () => {
6845
- const resend = this.emailOtpPrompt?.onResend;
6846
- if (typeof resend !== "function" || this.otpResendBusy || this.loading)
6847
- return;
6848
- if (this.otpResendUntilMs > Date.now())
6849
- return;
6850
- this.otpError = "";
6851
- this.otpResendStatus = "";
6852
- this._lastAutoOtpSubmitCode = "";
6853
- this._resetOtpSubmitAnimation();
6854
- this.otpResendBusy = true;
6855
- this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
6856
- this.requestUpdate();
6857
- (async () => {
6858
- try {
6859
- const result = await resend();
6860
- const challengeId = String(result?.challengeId || "").trim();
6861
- const emailHint = String(result?.emailHint || "").trim();
6862
- if (challengeId) {
6863
- this.emailOtpPrompt = {
6864
- ...this.emailOtpPrompt,
6865
- challengeId,
6866
- ...emailHint ? { emailHint } : {}
6867
- };
6868
- }
6869
- this.otpResendStatus = "Code sent";
6870
- } catch (error) {
6871
- this.otpError = formatEmailOtpResendError2(error);
6872
- } finally {
6873
- this.otpResendBusy = false;
6874
- this.requestUpdate();
6875
- }
6876
- })();
6877
- };
6878
6769
  _renderEmailOtpPrompt() {
6879
6770
  if (!this._isEmailOtpMode())
6880
6771
  return "";
@@ -6919,11 +6810,6 @@ var init_viewer_modal = __esm(() => {
6919
6810
  </div>
6920
6811
  `;
6921
6812
  }
6922
- _onFundingNoticeCopy = (event) => {
6923
- const target = event.currentTarget;
6924
- const accountId = String(target?.dataset.copyValue || "").trim();
6925
- copyTextToClipboard(accountId);
6926
- };
6927
6813
  _renderConfirmationBody() {
6928
6814
  const body = String(this.body || "").trim();
6929
6815
  if (!body)
@@ -6954,12 +6840,123 @@ var init_viewer_modal = __esm(() => {
6954
6840
  }
6955
6841
  constructor() {
6956
6842
  super();
6843
+ this._heightReflow = createSurfaceHeightReflow({
6844
+ reason: "confirm-body",
6845
+ element: () => this.querySelector(".modal-container-root"),
6846
+ setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
6847
+ settled: () => this.updateComplete
6848
+ });
6849
+ this.totalAmount = "";
6850
+ this.method = "";
6851
+ this.fingerprint = "";
6852
+ this.body = "";
6853
+ this.title = "";
6854
+ this.cancelText = "Cancel";
6855
+ this.confirmText = "Next";
6856
+ this.loading = false;
6857
+ this.errorMessage = undefined;
6858
+ this.theme = "dark";
6859
+ this.otpCode = "";
6860
+ this.otpError = "";
6861
+ this.otpResendBusy = false;
6862
+ this.otpResendUntilMs = 0;
6863
+ this.otpResendStatus = "";
6864
+ this.otpSubmitAnimating = false;
6865
+ this._otpResendTimer = null;
6866
+ this._otpSubmitTimer = null;
6867
+ this._lastAutoOtpSubmitCode = "";
6868
+ this.deferClose = false;
6869
+ this._stylesReady = false;
6870
+ this._stylePromises = [];
6871
+ this._stylesAwaiting = null;
6872
+ this._ensureTreeDefinition = TxTree_default;
6873
+ this._ensureHaloElements = [HaloBorder_default, PasskeyHaloLoading_default];
6874
+ this._onKeyDown = (e) => {
6875
+ if (e.key === "Escape" || e.key === "Esc") {
6876
+ e.preventDefault();
6877
+ this._handleCancel();
6878
+ }
6879
+ };
6880
+ this._onWindowMessage = (ev) => {
6881
+ const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
6882
+ if (!data || typeof data.type !== "string")
6883
+ return;
6884
+ if (data.type === "MODAL_TIMEOUT") {
6885
+ const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
6886
+ this.loading = false;
6887
+ this.errorMessage = msg;
6888
+ this._handleCancel();
6889
+ }
6890
+ };
6891
+ this._handleBackdropClick = (event) => {
6892
+ if (!this._isStandaloneSurface())
6893
+ return;
6894
+ event.stopPropagation();
6895
+ this._handleCancel();
6896
+ };
6897
+ this._onPasskeyRegistrationConfirm = () => {
6898
+ this._finishConfirm();
6899
+ };
6900
+ this._onOtpInput = (event) => {
6901
+ const input = event.currentTarget;
6902
+ const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
6903
+ this.otpCode = code;
6904
+ this.otpError = "";
6905
+ if (code.length < 6) {
6906
+ this._lastAutoOtpSubmitCode = "";
6907
+ this._resetOtpSubmitAnimation();
6908
+ return;
6909
+ }
6910
+ if (this.loading || this._lastAutoOtpSubmitCode === code)
6911
+ return;
6912
+ this._lastAutoOtpSubmitCode = code;
6913
+ this._submitEmailOtpAfterFade(code);
6914
+ };
6915
+ this._onOtpResend = () => {
6916
+ const resend = this.emailOtpPrompt?.onResend;
6917
+ if (typeof resend !== "function" || this.otpResendBusy || this.loading)
6918
+ return;
6919
+ if (this.otpResendUntilMs > Date.now())
6920
+ return;
6921
+ this.otpError = "";
6922
+ this.otpResendStatus = "";
6923
+ this._lastAutoOtpSubmitCode = "";
6924
+ this._resetOtpSubmitAnimation();
6925
+ this.otpResendBusy = true;
6926
+ this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
6927
+ this.requestUpdate();
6928
+ (async () => {
6929
+ try {
6930
+ const result = await resend();
6931
+ const challengeId = String(result?.challengeId || "").trim();
6932
+ const emailHint = String(result?.emailHint || "").trim();
6933
+ if (challengeId) {
6934
+ this.emailOtpPrompt = {
6935
+ ...this.emailOtpPrompt,
6936
+ challengeId,
6937
+ ...emailHint ? { emailHint } : {}
6938
+ };
6939
+ }
6940
+ this.otpResendStatus = "Code sent";
6941
+ } catch (error) {
6942
+ this.otpError = formatEmailOtpResendError2(error);
6943
+ } finally {
6944
+ this.otpResendBusy = false;
6945
+ this.requestUpdate();
6946
+ }
6947
+ })();
6948
+ };
6949
+ this._onFundingNoticeCopy = (event) => {
6950
+ const target = event.currentTarget;
6951
+ const accountId = String(target?.dataset.copyValue || "").trim();
6952
+ copyTextToClipboard(accountId);
6953
+ };
6954
+ this._ownsThemeAttr = false;
6957
6955
  const root = document?.documentElement || null;
6958
6956
  if (root) {
6959
6957
  this._stylePromises.push(ensureExternalStyles(root, "w3a-components.css", "data-w3a-components-css"), ensureExternalStyles(root, "tx-tree.css", "data-w3a-tx-tree-css"), ensureExternalStyles(root, "tx-confirmer.css", "data-w3a-tx-confirmer-css"), ensureExternalStyles(root, "halo-border.css", "data-w3a-halo-border-css"), ensureExternalStyles(root, "passkey-halo-loading.css", "data-w3a-passkey-halo-loading-css"));
6960
6958
  }
6961
6959
  }
6962
- _ownsThemeAttr = false;
6963
6960
  willUpdate(changedProperties) {
6964
6961
  super.willUpdate(changedProperties);
6965
6962
  if (this.hasUpdated)
@@ -7031,8 +7028,8 @@ var init_viewer_modal = __esm(() => {
7031
7028
  if (this._stylesReady)
7032
7029
  return true;
7033
7030
  if (!this._stylesAwaiting) {
7034
- const p4 = Promise.all(this._stylePromises).then(() => new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6()))));
7035
- this._stylesAwaiting = p4.then(() => {
7031
+ const p = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
7032
+ this._stylesAwaiting = p.then(() => {
7036
7033
  this._stylesReady = true;
7037
7034
  this.requestUpdate();
7038
7035
  });
@@ -7271,18 +7268,18 @@ var init_tx_confirmer_wrapper = __esm(() => {
7271
7268
  evmExplorerUrl: { type: String, attribute: "evm-explorer-url" }
7272
7269
  };
7273
7270
  static keepDefinitions = [ModalTxConfirmElement, DrawerTxConfirmerElement];
7274
- childRef = e5();
7275
- redispatchingEvent = false;
7276
- interactiveAnnounced = false;
7277
- currentChild = null;
7278
- boundConfirmListener = (event) => {
7279
- this.handleChildConfirm(event);
7280
- };
7281
- boundCancelListener = (_event) => {
7282
- this.handleChildCancel();
7283
- };
7284
7271
  constructor() {
7285
7272
  super();
7273
+ this.childRef = e5();
7274
+ this.redispatchingEvent = false;
7275
+ this.interactiveAnnounced = false;
7276
+ this.currentChild = null;
7277
+ this.boundConfirmListener = (event) => {
7278
+ this.handleChildConfirm(event);
7279
+ };
7280
+ this.boundCancelListener = (_event) => {
7281
+ this.handleChildCancel();
7282
+ };
7286
7283
  this.variant = DEFAULT_VARIANT;
7287
7284
  this.nearAccountId = "";
7288
7285
  this.txSigningRequests = undefined;
@@ -7557,7 +7554,7 @@ function renderCopyStatusIcon() {
7557
7554
  function settlingState(state, maskedTarget, startedAtMs) {
7558
7555
  const prefix = maskedTarget.startsWith(state.prefix) ? state.prefix : "";
7559
7556
  const targetSlots = Array.from(maskedTarget.slice(prefix.length));
7560
- const slots = targetSlots.length === state.slots.length ? state.slots : targetSlots.map((_2, index) => ({
7557
+ const slots = targetSlots.length === state.slots.length ? state.slots : targetSlots.map((_, index) => ({
7561
7558
  glyph: randomReelGlyph(state.alphabet),
7562
7559
  nextChangeAtMs: startedAtMs + index * 37 % 90
7563
7560
  }));
@@ -7683,15 +7680,38 @@ var init_viewer = __esm(() => {
7683
7680
  errorMessage: { type: String },
7684
7681
  showCloseButton: { type: Boolean, attribute: "show-close-button" }
7685
7682
  };
7686
- copiedFields = new Set;
7687
- copyTimers = new Map;
7688
- revealStates = new Map;
7689
- revealAnimationFrame = null;
7690
- _stylesReady = false;
7691
- _stylePromises = [];
7692
- _stylesAwaiting = null;
7693
7683
  constructor() {
7694
7684
  super();
7685
+ this.copiedFields = new Set;
7686
+ this.copyTimers = new Map;
7687
+ this.revealStates = new Map;
7688
+ this.revealAnimationFrame = null;
7689
+ this._stylesReady = false;
7690
+ this._stylePromises = [];
7691
+ this._stylesAwaiting = null;
7692
+ this.onRevealAnimationFrame = (now) => {
7693
+ this.revealAnimationFrame = null;
7694
+ if (this.ownerDocument?.hidden) {
7695
+ this.scheduleRevealAnimation();
7696
+ return;
7697
+ }
7698
+ let changed = false;
7699
+ for (const [entryKey, state] of this.revealStates) {
7700
+ if (state.kind === "settled")
7701
+ continue;
7702
+ const nextState = advanceRevealState(state, now);
7703
+ if (nextState !== state) {
7704
+ this.revealStates.set(entryKey, nextState);
7705
+ changed = true;
7706
+ }
7707
+ }
7708
+ if (changed)
7709
+ this.requestUpdate();
7710
+ this.scheduleRevealAnimation();
7711
+ };
7712
+ this._stopDragStart = (e) => {
7713
+ e.stopPropagation();
7714
+ };
7695
7715
  this.theme = "dark";
7696
7716
  this.variant = "drawer";
7697
7717
  this.keys = undefined;
@@ -7703,27 +7723,27 @@ var init_viewer = __esm(() => {
7703
7723
  return "export";
7704
7724
  }
7705
7725
  createRenderRoot() {
7706
- const supportsConstructable2 = typeof ShadowRoot !== "undefined" && "adoptedStyleSheets" in ShadowRoot.prototype && typeof CSSStyleSheet !== "undefined" && "replaceSync" in CSSStyleSheet.prototype;
7707
- const root = supportsConstructable2 ? super.createRenderRoot() : this;
7726
+ const supportsConstructable = typeof ShadowRoot !== "undefined" && "adoptedStyleSheets" in ShadowRoot.prototype && typeof CSSStyleSheet !== "undefined" && "replaceSync" in CSSStyleSheet.prototype;
7727
+ const root = supportsConstructable ? super.createRenderRoot() : this;
7708
7728
  const p1 = ensureExternalStyles(root, "export-viewer.css", "data-w3a-export-viewer-css");
7709
7729
  this._stylePromises.push(p1);
7710
7730
  p1.catch(() => {});
7711
7731
  const pCopyIcon = ensureExternalStyles(root, "copy-icon.css", "data-w3a-copy-icon-css");
7712
7732
  this._stylePromises.push(pCopyIcon);
7713
7733
  pCopyIcon.catch(() => {});
7714
- const p22 = ensureExternalStyles(root, "w3a-components.css", "data-w3a-components-css");
7715
- this._stylePromises.push(p22);
7716
- p22.catch(() => {});
7717
- const p32 = ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css");
7718
- this._stylePromises.push(p32);
7719
- p32.catch(() => {});
7734
+ const p2 = ensureExternalStyles(root, "w3a-components.css", "data-w3a-components-css");
7735
+ this._stylePromises.push(p2);
7736
+ p2.catch(() => {});
7737
+ const p3 = ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css");
7738
+ this._stylePromises.push(p3);
7739
+ p3.catch(() => {});
7720
7740
  return root;
7721
7741
  }
7722
7742
  shouldUpdate(_changed) {
7723
7743
  if (this._stylesReady)
7724
7744
  return true;
7725
7745
  if (!this._stylesAwaiting) {
7726
- const settle = Promise.all(this._stylePromises).then(() => new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6()))));
7746
+ const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
7727
7747
  this._stylesAwaiting = settle.then(() => {
7728
7748
  this._stylesReady = true;
7729
7749
  this.requestUpdate();
@@ -7758,26 +7778,6 @@ var init_viewer = __esm(() => {
7758
7778
  this.resetRevealStates();
7759
7779
  super.disconnectedCallback();
7760
7780
  }
7761
- onRevealAnimationFrame = (now) => {
7762
- this.revealAnimationFrame = null;
7763
- if (this.ownerDocument?.hidden) {
7764
- this.scheduleRevealAnimation();
7765
- return;
7766
- }
7767
- let changed = false;
7768
- for (const [entryKey, state] of this.revealStates) {
7769
- if (state.kind === "settled")
7770
- continue;
7771
- const nextState = advanceRevealState(state, now);
7772
- if (nextState !== state) {
7773
- this.revealStates.set(entryKey, nextState);
7774
- changed = true;
7775
- }
7776
- }
7777
- if (changed)
7778
- this.requestUpdate();
7779
- this.scheduleRevealAnimation();
7780
- };
7781
7781
  scheduleRevealAnimation() {
7782
7782
  if (this.revealAnimationFrame !== null || prefersReducedMotion(this.ownerDocument))
7783
7783
  return;
@@ -7834,9 +7834,6 @@ var init_viewer = __esm(() => {
7834
7834
  }
7835
7835
  this.scheduleRevealAnimation();
7836
7836
  }
7837
- _stopDragStart = (e6) => {
7838
- e6.stopPropagation();
7839
- };
7840
7837
  updateTheme() {
7841
7838
  try {
7842
7839
  const docEl = this.ownerDocument?.documentElement;
@@ -7884,8 +7881,8 @@ var init_viewer = __esm(() => {
7884
7881
  }
7885
7882
  this.markCopied(index, type);
7886
7883
  this.requestUpdate();
7887
- } catch (e6) {
7888
- console.warn("Copy failed", e6);
7884
+ } catch (e) {
7885
+ console.warn("Copy failed", e);
7889
7886
  }
7890
7887
  }
7891
7888
  copyViaTextareaFallback(text) {
@@ -7938,9 +7935,9 @@ var init_viewer = __esm(() => {
7938
7935
  const provided = Array.isArray(this.keys) ? this.keys.filter((item) => {
7939
7936
  if (!item || typeof item !== "object")
7940
7937
  return false;
7941
- const publicKey2 = String(item.publicKey || "").trim();
7942
- const privateKey2 = String(item.privateKey || "").trim();
7943
- return !!publicKey2 || !!privateKey2;
7938
+ const publicKey = String(item.publicKey || "").trim();
7939
+ const privateKey = String(item.privateKey || "").trim();
7940
+ return !!publicKey || !!privateKey;
7944
7941
  }) : [];
7945
7942
  if (provided.length > 0)
7946
7943
  return provided;
@@ -8083,8 +8080,8 @@ function declarationsToCssText(selector, declarations) {
8083
8080
  function getDefaultCspNonce() {
8084
8081
  if (typeof window === "undefined")
8085
8082
  return;
8086
- const w2 = window;
8087
- return w2.w3aNonce || w2.litNonce || undefined;
8083
+ const w = window;
8084
+ return w.w3aNonce || w.litNonce || undefined;
8088
8085
  }
8089
8086
  function createCspStylesheetManager(opts) {
8090
8087
  const { doc, baseCss, baseStyleDataAttr, dynamicStyleDataAttr, nonce } = opts;
@@ -8103,7 +8100,7 @@ function createCspStylesheetManager(opts) {
8103
8100
  return;
8104
8101
  return typeof nonce === "function" ? nonce() : nonce;
8105
8102
  };
8106
- const supportsConstructable2 = () => {
8103
+ const supportsConstructable = () => {
8107
8104
  if (state.supportConstructable != null)
8108
8105
  return state.supportConstructable;
8109
8106
  state.supportConstructable = typeof CSSStyleSheet !== "undefined" && "adoptedStyleSheets" in doc;
@@ -8143,7 +8140,7 @@ function createCspStylesheetManager(opts) {
8143
8140
  const ensureBase = () => {
8144
8141
  if (state.baseSheet || state.baseStyleEl)
8145
8142
  return;
8146
- if (supportsConstructable2()) {
8143
+ if (supportsConstructable()) {
8147
8144
  try {
8148
8145
  state.baseSheet = new CSSStyleSheet;
8149
8146
  state.baseSheet.replaceSync(baseCss);
@@ -8161,7 +8158,7 @@ function createCspStylesheetManager(opts) {
8161
8158
  const buildDynamicCss = () => Array.from(state.rules.values()).join(`
8162
8159
  `);
8163
8160
  const ensureDynamic = () => {
8164
- if (supportsConstructable2()) {
8161
+ if (supportsConstructable()) {
8165
8162
  if (!state.dynamicSheet) {
8166
8163
  state.dynamicSheet = new CSSStyleSheet;
8167
8164
  adoptSheets([state.dynamicSheet]);
@@ -8176,7 +8173,7 @@ function createCspStylesheetManager(opts) {
8176
8173
  };
8177
8174
  const syncDynamic = () => {
8178
8175
  const css = buildDynamicCss();
8179
- if (supportsConstructable2()) {
8176
+ if (supportsConstructable()) {
8180
8177
  try {
8181
8178
  ensureDynamic();
8182
8179
  state.dynamicSheet?.replaceSync(css);
@@ -8195,7 +8192,7 @@ function createCspStylesheetManager(opts) {
8195
8192
  const existing = state.declarationRules.get(id);
8196
8193
  if (existing && existing.selector === selector)
8197
8194
  return existing.rule;
8198
- if (!supportsConstructable2())
8195
+ if (!supportsConstructable())
8199
8196
  return null;
8200
8197
  try {
8201
8198
  if (!state.declarationSheet) {
@@ -8204,9 +8201,9 @@ function createCspStylesheetManager(opts) {
8204
8201
  }
8205
8202
  const sheet = state.declarationSheet;
8206
8203
  if (existing) {
8207
- const index2 = Array.prototype.indexOf.call(sheet.cssRules, existing.rule);
8208
- if (index2 >= 0)
8209
- sheet.deleteRule(index2);
8204
+ const index = Array.prototype.indexOf.call(sheet.cssRules, existing.rule);
8205
+ if (index >= 0)
8206
+ sheet.deleteRule(index);
8210
8207
  state.declarationRules.delete(id);
8211
8208
  }
8212
8209
  const index = sheet.insertRule(`${selector}{}`, sheet.cssRules.length);
@@ -8296,8 +8293,8 @@ function createCspStylesheetManager(opts) {
8296
8293
  // src/core/signingEngine/uiConfirm/ui/lit-components/ExportPrivateKey/iframe-host.ts
8297
8294
  var exports_iframe_host = {};
8298
8295
  __export(exports_iframe_host, {
8299
- default: () => iframe_host_default,
8300
- IframeExportHost: () => IframeExportHost
8296
+ IframeExportHost: () => IframeExportHost,
8297
+ default: () => iframe_host_default
8301
8298
  });
8302
8299
  function getExportTokenStyleManager() {
8303
8300
  if (!exportTokenStyleManager) {
@@ -8314,9 +8311,9 @@ function toStringRecord(value) {
8314
8311
  if (!value || typeof value !== "object")
8315
8312
  return {};
8316
8313
  const out = {};
8317
- for (const [k2, v3] of Object.entries(value)) {
8318
- if (typeof v3 === "string")
8319
- out[k2] = v3;
8314
+ for (const [k, v] of Object.entries(value)) {
8315
+ if (typeof v === "string")
8316
+ out[k] = v;
8320
8317
  }
8321
8318
  return out;
8322
8319
  }
@@ -8398,13 +8395,13 @@ var init_iframe_host = __esm(() => {
8398
8395
  errorMessage: { type: String },
8399
8396
  surface: { type: String, attribute: "data-w3a-export-surface", reflect: false }
8400
8397
  };
8401
- drawerEl = null;
8402
- viewerEl = null;
8403
- openFrame = null;
8404
- stylesReady = false;
8405
- stylePromise = null;
8406
8398
  constructor() {
8407
8399
  super();
8400
+ this.drawerEl = null;
8401
+ this.viewerEl = null;
8402
+ this.openFrame = null;
8403
+ this.stylesReady = false;
8404
+ this.stylePromise = null;
8408
8405
  this.theme = "dark";
8409
8406
  this.variant = "drawer";
8410
8407
  this.accountId = "";
@@ -8625,13 +8622,98 @@ var init_viewer2 = __esm(() => {
8625
8622
  statusMessage: { state: true },
8626
8623
  copied: { state: true }
8627
8624
  };
8628
- experience = { kind: "unconfigured" };
8629
- loadGeneration = 0;
8630
- copiedResetTimer = null;
8631
- stylesReady = false;
8632
- stylePromise = null;
8633
8625
  constructor() {
8634
8626
  super();
8627
+ this.experience = { kind: "unconfigured" };
8628
+ this.loadGeneration = 0;
8629
+ this.copiedResetTimer = null;
8630
+ this.stylesReady = false;
8631
+ this.stylePromise = null;
8632
+ this.retryStatus = () => {
8633
+ if (this.experience.kind !== "account_menu")
8634
+ return;
8635
+ const generation = this.loadGeneration + 1;
8636
+ this.loadGeneration = generation;
8637
+ const current = this.viewState;
8638
+ if (current.kind !== "summary")
8639
+ return;
8640
+ this.viewState = { ...current, loadState: { kind: "loading" }, actionError: null };
8641
+ this.loadSummaryStatus(this.experience, generation);
8642
+ };
8643
+ this.openRecoveryCodes = async () => {
8644
+ if (this.experience.kind !== "account_menu" || this.viewState.kind !== "summary")
8645
+ return;
8646
+ const generation = this.loadGeneration;
8647
+ const summary = this.viewState;
8648
+ this.viewState = { ...summary, kind: "opening", actionError: null };
8649
+ try {
8650
+ const request = await this.experience.loadPendingBackup();
8651
+ if (generation !== this.loadGeneration)
8652
+ return;
8653
+ if (!request) {
8654
+ this.viewState = {
8655
+ ...summary,
8656
+ actionError: "Recovery codes are no longer available on this device."
8657
+ };
8658
+ return;
8659
+ }
8660
+ this.viewState = { kind: "recovery_codes", request };
8661
+ await this.updateComplete;
8662
+ await new Promise(requestAnimationFrame);
8663
+ this.querySelector("#w3a-wallet-recovery-title")?.focus();
8664
+ } catch (error) {
8665
+ if (generation !== this.loadGeneration)
8666
+ return;
8667
+ this.viewState = {
8668
+ ...summary,
8669
+ actionError: errorMessage(error, "Could not open recovery codes")
8670
+ };
8671
+ }
8672
+ };
8673
+ this.closeSummary = () => {
8674
+ this.dispatchClose({ kind: "dismissed" });
8675
+ };
8676
+ this.download = () => {
8677
+ if (this.viewState.kind !== "recovery_codes")
8678
+ return;
8679
+ const { walletId, recoveryCodes } = this.viewState.request;
8680
+ try {
8681
+ const url = URL.createObjectURL(new Blob([backupText(walletId, recoveryCodes)], {
8682
+ type: "text/plain;charset=utf-8"
8683
+ }));
8684
+ const anchor = document.createElement("a");
8685
+ anchor.href = url;
8686
+ anchor.download = `seams-wallet-recovery-codes-${safeWalletId(walletId)}.txt`;
8687
+ try {
8688
+ anchor.click();
8689
+ } finally {
8690
+ window.setTimeout(URL.revokeObjectURL.bind(URL, url), 0);
8691
+ }
8692
+ this.statusMessage = "Recovery codes downloaded.";
8693
+ } catch {
8694
+ this.statusMessage = "Unable to download the codes. Copy them or try again.";
8695
+ }
8696
+ };
8697
+ this.copy = async () => {
8698
+ if (this.viewState.kind !== "recovery_codes")
8699
+ return;
8700
+ const { walletId, recoveryCodes } = this.viewState.request;
8701
+ try {
8702
+ await navigator.clipboard.writeText(backupText(walletId, recoveryCodes));
8703
+ this.statusMessage = "Recovery codes copied.";
8704
+ this.flashCopied();
8705
+ } catch {
8706
+ this.statusMessage = "Unable to copy the codes. Download them or try again.";
8707
+ }
8708
+ };
8709
+ this.onAcknowledgementChange = (event) => {
8710
+ const input = event.target;
8711
+ if (input instanceof HTMLInputElement)
8712
+ this.acknowledged = input.checked;
8713
+ };
8714
+ this.closeRecoveryCodes = () => {
8715
+ this.dispatchClose({ kind: "recovery_codes", acknowledged: this.acknowledged });
8716
+ };
8635
8717
  this.viewState = { kind: "unconfigured" };
8636
8718
  this.acknowledged = false;
8637
8719
  this.statusMessage = "";
@@ -8757,50 +8839,6 @@ var init_viewer2 = __esm(() => {
8757
8839
  assertNever2(this.viewState);
8758
8840
  }
8759
8841
  }
8760
- retryStatus = () => {
8761
- if (this.experience.kind !== "account_menu")
8762
- return;
8763
- const generation = this.loadGeneration + 1;
8764
- this.loadGeneration = generation;
8765
- const current = this.viewState;
8766
- if (current.kind !== "summary")
8767
- return;
8768
- this.viewState = { ...current, loadState: { kind: "loading" }, actionError: null };
8769
- this.loadSummaryStatus(this.experience, generation);
8770
- };
8771
- openRecoveryCodes = async () => {
8772
- if (this.experience.kind !== "account_menu" || this.viewState.kind !== "summary")
8773
- return;
8774
- const generation = this.loadGeneration;
8775
- const summary = this.viewState;
8776
- this.viewState = { ...summary, kind: "opening", actionError: null };
8777
- try {
8778
- const request = await this.experience.loadPendingBackup();
8779
- if (generation !== this.loadGeneration)
8780
- return;
8781
- if (!request) {
8782
- this.viewState = {
8783
- ...summary,
8784
- actionError: "Recovery codes are no longer available on this device."
8785
- };
8786
- return;
8787
- }
8788
- this.viewState = { kind: "recovery_codes", request };
8789
- await this.updateComplete;
8790
- await new Promise(requestAnimationFrame);
8791
- this.querySelector("#w3a-wallet-recovery-title")?.focus();
8792
- } catch (error) {
8793
- if (generation !== this.loadGeneration)
8794
- return;
8795
- this.viewState = {
8796
- ...summary,
8797
- actionError: errorMessage(error, "Could not open recovery codes")
8798
- };
8799
- }
8800
- };
8801
- closeSummary = () => {
8802
- this.dispatchClose({ kind: "dismissed" });
8803
- };
8804
8842
  dispatchClose(detail) {
8805
8843
  this.dispatchEvent(new CustomEvent(RECOVERY_BACKUP_CLOSE_EVENT, {
8806
8844
  detail,
@@ -8808,39 +8846,6 @@ var init_viewer2 = __esm(() => {
8808
8846
  composed: true
8809
8847
  }));
8810
8848
  }
8811
- download = () => {
8812
- if (this.viewState.kind !== "recovery_codes")
8813
- return;
8814
- const { walletId, recoveryCodes } = this.viewState.request;
8815
- try {
8816
- const url = URL.createObjectURL(new Blob([backupText(walletId, recoveryCodes)], {
8817
- type: "text/plain;charset=utf-8"
8818
- }));
8819
- const anchor = document.createElement("a");
8820
- anchor.href = url;
8821
- anchor.download = `seams-wallet-recovery-codes-${safeWalletId(walletId)}.txt`;
8822
- try {
8823
- anchor.click();
8824
- } finally {
8825
- window.setTimeout(URL.revokeObjectURL.bind(URL, url), 0);
8826
- }
8827
- this.statusMessage = "Recovery codes downloaded.";
8828
- } catch {
8829
- this.statusMessage = "Unable to download the codes. Copy them or try again.";
8830
- }
8831
- };
8832
- copy = async () => {
8833
- if (this.viewState.kind !== "recovery_codes")
8834
- return;
8835
- const { walletId, recoveryCodes } = this.viewState.request;
8836
- try {
8837
- await navigator.clipboard.writeText(backupText(walletId, recoveryCodes));
8838
- this.statusMessage = "Recovery codes copied.";
8839
- this.flashCopied();
8840
- } catch {
8841
- this.statusMessage = "Unable to copy the codes. Download them or try again.";
8842
- }
8843
- };
8844
8849
  flashCopied() {
8845
8850
  if (this.copiedResetTimer !== null)
8846
8851
  window.clearTimeout(this.copiedResetTimer);
@@ -8850,14 +8855,6 @@ var init_viewer2 = __esm(() => {
8850
8855
  this.copied = false;
8851
8856
  }, COPIED_FLASH_MS);
8852
8857
  }
8853
- onAcknowledgementChange = (event) => {
8854
- const input = event.target;
8855
- if (input instanceof HTMLInputElement)
8856
- this.acknowledged = input.checked;
8857
- };
8858
- closeRecoveryCodes = () => {
8859
- this.dispatchClose({ kind: "recovery_codes", acknowledged: this.acknowledged });
8860
- };
8861
8858
  closeLabel(request) {
8862
8859
  if (this.acknowledged)
8863
8860
  return "Finish backup";
@@ -9005,8 +9002,8 @@ var init_viewer2 = __esm(() => {
9005
9002
  // src/core/signingEngine/uiConfirm/ui/lit-components/RecoveryCodeBackup/host.ts
9006
9003
  var exports_host = {};
9007
9004
  __export(exports_host, {
9008
- default: () => host_default,
9009
- RecoveryCodeBackupHost: () => RecoveryCodeBackupHost
9005
+ RecoveryCodeBackupHost: () => RecoveryCodeBackupHost,
9006
+ default: () => host_default
9010
9007
  });
9011
9008
  var RecoveryCodeBackupHost, host_default;
9012
9009
  var init_host = __esm(() => {
@@ -9022,24 +9019,22 @@ var init_host = __esm(() => {
9022
9019
  experience: { attribute: false },
9023
9020
  surface: { type: String }
9024
9021
  };
9025
- dialogEl = null;
9026
- viewerEl = null;
9027
- shown = false;
9028
- dialogShown;
9029
- resolveDialogShown;
9030
- handleCancel = (event) => {
9031
- event.preventDefault();
9032
- this.dispatchEvent(new CustomEvent(RECOVERY_BACKUP_CANCEL_EVENT, { bubbles: true, composed: true }));
9033
- };
9034
- handleStageChange = (event) => {
9035
- const dialog = event.currentTarget;
9036
- if (!(dialog instanceof HTMLDialogElement))
9037
- return;
9038
- const detail = event.detail;
9039
- dialog.dataset.w3aRecoveryStage = detail.stage;
9040
- };
9041
9022
  constructor() {
9042
9023
  super();
9024
+ this.dialogEl = null;
9025
+ this.viewerEl = null;
9026
+ this.shown = false;
9027
+ this.handleCancel = (event) => {
9028
+ event.preventDefault();
9029
+ this.dispatchEvent(new CustomEvent(RECOVERY_BACKUP_CANCEL_EVENT, { bubbles: true, composed: true }));
9030
+ };
9031
+ this.handleStageChange = (event) => {
9032
+ const dialog = event.currentTarget;
9033
+ if (!(dialog instanceof HTMLDialogElement))
9034
+ return;
9035
+ const detail = event.detail;
9036
+ dialog.dataset.w3aRecoveryStage = detail.stage;
9037
+ };
9043
9038
  this.experience = { kind: "unconfigured" };
9044
9039
  this.surface = "standalone";
9045
9040
  this.dialogShown = new Promise((resolve) => {
@@ -9119,7 +9114,7 @@ var init_host = __esm(() => {
9119
9114
  });
9120
9115
 
9121
9116
  // src/core/signingEngine/uiConfirm/ui/registry.ts
9122
- async function ensureDefined2(tag, loader) {
9117
+ async function ensureDefined(tag, loader) {
9123
9118
  try {
9124
9119
  if (!customElements.get(tag)) {
9125
9120
  await loader();
@@ -9395,17 +9390,21 @@ function allocateSurfaceMeasurementSequence() {
9395
9390
  }
9396
9391
 
9397
9392
  class SurfaceMeasurementReporter {
9398
- options;
9399
- observer;
9400
- latestEntry = null;
9401
- recentPostTimes = [];
9402
- warnedAboutStreaming = false;
9403
- surfaceHasSettled = false;
9404
- animationFrame = null;
9405
- lastSize = null;
9406
- disconnected = false;
9407
9393
  constructor(options) {
9408
9394
  this.options = options;
9395
+ this.latestEntry = null;
9396
+ this.recentPostTimes = [];
9397
+ this.warnedAboutStreaming = false;
9398
+ this.surfaceHasSettled = false;
9399
+ this.animationFrame = null;
9400
+ this.lastSize = null;
9401
+ this.disconnected = false;
9402
+ this.onResize = (entries) => {
9403
+ if (this.disconnected)
9404
+ return;
9405
+ this.latestEntry = entries.at(-1) ?? null;
9406
+ this.scheduleReport();
9407
+ };
9409
9408
  if (typeof ResizeObserver === "function") {
9410
9409
  this.observer = new ResizeObserver(this.onResize);
9411
9410
  this.observer.observe(options.element);
@@ -9426,12 +9425,6 @@ class SurfaceMeasurementReporter {
9426
9425
  this.animationFrame = null;
9427
9426
  this.latestEntry = null;
9428
9427
  }
9429
- onResize = (entries) => {
9430
- if (this.disconnected)
9431
- return;
9432
- this.latestEntry = entries.at(-1) ?? null;
9433
- this.scheduleReport();
9434
- };
9435
9428
  scheduleReport() {
9436
9429
  if (this.disconnected)
9437
9430
  return;
@@ -9495,7 +9488,7 @@ var confirmSurfaceMeasurementReporters = new WeakMap;
9495
9488
  var confirmSurfaceResizeChoreographers = new WeakMap;
9496
9489
  var confirmSurfaceMeasurementBindings = new WeakMap;
9497
9490
  async function ensureTxConfirmerElementDefined() {
9498
- await ensureDefined2(W3A_TX_CONFIRMER_ID, () => Promise.resolve().then(() => (init_tx_confirmer_wrapper(), exports_tx_confirmer_wrapper)));
9491
+ await ensureDefined(W3A_TX_CONFIRMER_ID, () => Promise.resolve().then(() => (init_tx_confirmer_wrapper(), exports_tx_confirmer_wrapper)));
9499
9492
  }
9500
9493
  async function prewarmTxConfirmerUi() {
9501
9494
  await ensureTxConfirmerElementDefined();
@@ -9533,8 +9526,8 @@ function withAppearanceMode(appearance, mode) {
9533
9526
  };
9534
9527
  }
9535
9528
  function resolveAppearance(args) {
9536
- const base2 = args.requestedAppearance ?? args.ctx.getAppearance?.() ?? DEFAULT_CONFIRM_APPEARANCE;
9537
- return withAppearanceMode(base2, args.requestedMode);
9529
+ const base = args.requestedAppearance ?? args.ctx.getAppearance?.() ?? DEFAULT_CONFIRM_APPEARANCE;
9530
+ return withAppearanceMode(base, args.requestedMode);
9538
9531
  }
9539
9532
  function postWalletUiMessage(type) {
9540
9533
  try {
@@ -10124,9 +10117,9 @@ function mountHostElement({
10124
10117
  return { el: element, handle };
10125
10118
  }
10126
10119
  export {
10127
- prewarmTxConfirmerUi,
10128
- prepareConfirmUISurface,
10129
- mountConfirmUI,
10120
+ W3A_TX_CONFIRMER_ID,
10130
10121
  awaitConfirmUIDecision,
10131
- W3A_TX_CONFIRMER_ID
10122
+ mountConfirmUI,
10123
+ prepareConfirmUISurface,
10124
+ prewarmTxConfirmerUi
10132
10125
  };